diff --git a/config.yaml.example b/config.yaml.example index e94bf09..9f96c83 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -15,7 +15,7 @@ repeater: identity_file: null # Duplicate packet cache TTL in seconds - cache_ttl: 60 + cache_ttl: 3600 # Score-based transmission filtering # Enable quality-based packet filtering and adaptive delays diff --git a/repeater/engine.py b/repeater/engine.py index c141fd7..9078537 100644 --- a/repeater/engine.py +++ b/repeater/engine.py @@ -45,7 +45,7 @@ class RepeaterHandler(BaseHandler): self.send_advert_func = send_advert_func self.airtime_mgr = AirtimeManager(config) self.seen_packets = OrderedDict() - self.cache_ttl = config.get("repeater", {}).get("cache_ttl", 3600) # 1 hour + self.cache_ttl = max(300, config.get("repeater", {}).get("cache_ttl", 3600)) # Min 5 min, default 1 hour self.max_cache_size = 1000 self.tx_delay_factor = config.get("delays", {}).get("tx_delay_factor", 1.0) self.direct_tx_delay_factor = config.get("delays", {}).get("direct_tx_delay_factor", 0.5) diff --git a/repeater/web/html/assets/index-3RchmGmb.js b/repeater/web/html/assets/index-Dz5Q9Vcf.js similarity index 92% rename from repeater/web/html/assets/index-3RchmGmb.js rename to repeater/web/html/assets/index-Dz5Q9Vcf.js index 020bc4d..5be2484 100644 --- a/repeater/web/html/assets/index-3RchmGmb.js +++ b/repeater/web/html/assets/index-Dz5Q9Vcf.js @@ -6,53 +6,53 @@ function Unt(e,t){for(var r=0;r0&&--this._on===0&&(O0=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let r,u;for(r=0,u=this.effects.length;r0)return;if(y5){let t=y5;for(y5=void 0;t;){const r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;for(;v5;){let t=v5;for(v5=void 0;t;){const r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(u){e||(e=u)}t=r}}if(e)throw e}function vj(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function yj(e){let t,r=e.depsTail,u=r;for(;u;){const T=u.prevDep;u.version===-1?(u===r&&(r=T),xE(u),nit(u)):t=u,u.dep.activeLink=u.prevActiveLink,u.prevActiveLink=void 0,u=T}e.deps=t,e.depsTail=r}function RM(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_j(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _j(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===z5)||(e.globalVersion=z5,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!RM(e))))return;e.flags|=2;const t=e.dep,r=zd,u=Fg;zd=e,Fg=!0;try{vj(e);const T=e.fn(e._value);(t.version===0||d_(T,e._value))&&(e.flags|=128,e._value=T,t.version++)}catch(T){throw t.version++,T}finally{zd=r,Fg=u,yj(e),e.flags&=-3}}function xE(e,t=!1){const{dep:r,prevSub:u,nextSub:T}=e;if(u&&(u.nextSub=T,e.prevSub=void 0),T&&(T.prevSub=u,e.nextSub=void 0),r.subs===e&&(r.subs=u,!u&&r.computed)){r.computed.flags&=-5;for(let $=r.computed.deps;$;$=$.nextDep)xE($,!0)}!t&&!--r.sc&&r.map&&r.map.delete(r.key)}function nit(e){const{prevDep:t,nextDep:r}=e;t&&(t.nextDep=r,e.prevDep=void 0),r&&(r.prevDep=t,e.nextDep=void 0)}let Fg=!0;const xj=[];function $1(){xj.push(Fg),Fg=!1}function H1(){const e=xj.pop();Fg=e===void 0?!0:e}function IO(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const r=zd;zd=void 0;try{t()}finally{zd=r}}}let z5=0;class iit{constructor(t,r){this.sub=t,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class bE{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!zd||!Fg||zd===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==zd)r=this.activeLink=new iit(zd,this),zd.deps?(r.prevDep=zd.depsTail,zd.depsTail.nextDep=r,zd.depsTail=r):zd.deps=zd.depsTail=r,bj(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const u=r.nextDep;u.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=u),r.prevDep=zd.depsTail,r.nextDep=void 0,zd.depsTail.nextDep=r,zd.depsTail=r,zd.deps===r&&(zd.deps=u)}return r}trigger(t){this.version++,z5++,this.notify(t)}notify(t){yE();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{_E()}}}function bj(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let u=t.deps;u;u=u.nextDep)bj(u)}const r=e.dep.subs;r!==e&&(e.prevSub=r,r&&(r.nextSub=e)),e.dep.subs=e}}const jT=new WeakMap,Px=Symbol(""),FM=Symbol(""),O5=Symbol("");function B0(e,t,r){if(Fg&&zd){let u=jT.get(e);u||jT.set(e,u=new Map);let T=u.get(r);T||(u.set(r,T=new bE),T.map=u,T.key=r),T.track()}}function P1(e,t,r,u,T,$){const K=jT.get(e);if(!K){z5++;return}const ct=yt=>{yt&&yt.trigger()};if(yE(),t==="clear")K.forEach(ct);else{const yt=pc(e),St=yt&&vE(r);if(yt&&r==="length"){const Ut=Number(u);K.forEach((ne,pe)=>{(pe==="length"||pe===O5||!Iv(pe)&&pe>=Ut)&&ct(ne)})}else switch((r!==void 0||K.has(void 0))&&ct(K.get(r)),St&&ct(K.get(O5)),t){case"add":yt?St&&ct(K.get("length")):(ct(K.get(Px)),P2(e)&&ct(K.get(FM)));break;case"delete":yt||(ct(K.get(Px)),P2(e)&&ct(K.get(FM)));break;case"set":P2(e)&&ct(K.get(Px));break}}_E()}function ait(e,t){const r=jT.get(e);return r&&r.get(t)}function f2(e){const t=ru(e);return t===e?t:(B0(t,"iterate",O5),yg(e)?t:t.map(x0))}function TS(e){return B0(e=ru(e),"iterate",O5),e}const oit={__proto__:null,[Symbol.iterator](){return _7(this,Symbol.iterator,x0)},concat(...e){return f2(this).concat(...e.map(t=>pc(t)?f2(t):t))},entries(){return _7(this,"entries",e=>(e[1]=x0(e[1]),e))},every(e,t){return m1(this,"every",e,t,void 0,arguments)},filter(e,t){return m1(this,"filter",e,t,r=>r.map(x0),arguments)},find(e,t){return m1(this,"find",e,t,x0,arguments)},findIndex(e,t){return m1(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return m1(this,"findLast",e,t,x0,arguments)},findLastIndex(e,t){return m1(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return m1(this,"forEach",e,t,void 0,arguments)},includes(...e){return x7(this,"includes",e)},indexOf(...e){return x7(this,"indexOf",e)},join(e){return f2(this).join(e)},lastIndexOf(...e){return x7(this,"lastIndexOf",e)},map(e,t){return m1(this,"map",e,t,void 0,arguments)},pop(){return P3(this,"pop")},push(...e){return P3(this,"push",e)},reduce(e,...t){return DO(this,"reduce",e,t)},reduceRight(e,...t){return DO(this,"reduceRight",e,t)},shift(){return P3(this,"shift")},some(e,t){return m1(this,"some",e,t,void 0,arguments)},splice(...e){return P3(this,"splice",e)},toReversed(){return f2(this).toReversed()},toSorted(e){return f2(this).toSorted(e)},toSpliced(...e){return f2(this).toSpliced(...e)},unshift(...e){return P3(this,"unshift",e)},values(){return _7(this,"values",x0)}};function _7(e,t,r){const u=TS(e),T=u[t]();return u!==e&&!yg(e)&&(T._next=T.next,T.next=()=>{const $=T._next();return $.value&&($.value=r($.value)),$}),T}const sit=Array.prototype;function m1(e,t,r,u,T,$){const K=TS(e),ct=K!==e&&!yg(e),yt=K[t];if(yt!==sit[t]){const ne=yt.apply(e,$);return ct?x0(ne):ne}let St=r;K!==e&&(ct?St=function(ne,pe){return r.call(this,x0(ne),pe,e)}:r.length>2&&(St=function(ne,pe){return r.call(this,ne,pe,e)}));const Ut=yt.call(K,St,u);return ct&&T?T(Ut):Ut}function DO(e,t,r,u){const T=TS(e);let $=r;return T!==e&&(yg(e)?r.length>3&&($=function(K,ct,yt){return r.call(this,K,ct,yt,e)}):$=function(K,ct,yt){return r.call(this,K,x0(ct),yt,e)}),T[t]($,...u)}function x7(e,t,r){const u=ru(e);B0(u,"iterate",O5);const T=u[t](...r);return(T===-1||T===!1)&&TE(r[0])?(r[0]=ru(r[0]),u[t](...r)):T}function P3(e,t,r=[]){$1(),yE();const u=ru(e)[t].apply(e,r);return _E(),H1(),u}const lit=pE("__proto__,__v_isRef,__isVue"),wj=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Iv));function cit(e){Iv(e)||(e=String(e));const t=ru(this);return B0(t,"has",e),t.hasOwnProperty(e)}class kj{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,u){if(r==="__v_skip")return t.__v_skip;const T=this._isReadonly,$=this._isShallow;if(r==="__v_isReactive")return!T;if(r==="__v_isReadonly")return T;if(r==="__v_isShallow")return $;if(r==="__v_raw")return u===(T?$?_it:Aj:$?Cj:Sj).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(u)?t:void 0;const K=pc(t);if(!T){let yt;if(K&&(yt=oit[r]))return yt;if(r==="hasOwnProperty")return cit}const ct=Reflect.get(t,r,hp(t)?t:u);return(Iv(r)?wj.has(r):lit(r))||(T||B0(t,"get",r),$)?ct:hp(ct)?K&&vE(r)?ct:ct.value:Ad(ct)?T?Ej(ct):g_(ct):ct}}class Tj extends kj{constructor(t=!1){super(!1,t)}set(t,r,u,T){let $=t[r];if(!this._isShallow){const yt=v_($);if(!yg(u)&&!v_(u)&&($=ru($),u=ru(u)),!pc(t)&&hp($)&&!hp(u))return yt?!1:($.value=u,!0)}const K=pc(t)&&vE(r)?Number(r)e,I6=e=>Reflect.getPrototypeOf(e);function pit(e,t,r){return function(...u){const T=this.__v_raw,$=ru(T),K=P2($),ct=e==="entries"||e===Symbol.iterator&&K,yt=e==="keys"&&K,St=T[e](...u),Ut=r?NM:t?UT:x0;return!t&&B0($,"iterate",yt?FM:Px),{next(){const{value:ne,done:pe}=St.next();return pe?{value:ne,done:pe}:{value:ct?[Ut(ne[0]),Ut(ne[1])]:Ut(ne),done:pe}},[Symbol.iterator](){return this}}}}function D6(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function mit(e,t){const r={get(T){const $=this.__v_raw,K=ru($),ct=ru(T);e||(d_(T,ct)&&B0(K,"get",T),B0(K,"get",ct));const{has:yt}=I6(K),St=t?NM:e?UT:x0;if(yt.call(K,T))return St($.get(T));if(yt.call(K,ct))return St($.get(ct));$!==K&&$.get(T)},get size(){const T=this.__v_raw;return!e&&B0(ru(T),"iterate",Px),Reflect.get(T,"size",T)},has(T){const $=this.__v_raw,K=ru($),ct=ru(T);return e||(d_(T,ct)&&B0(K,"has",T),B0(K,"has",ct)),T===ct?$.has(T):$.has(T)||$.has(ct)},forEach(T,$){const K=this,ct=K.__v_raw,yt=ru(ct),St=t?NM:e?UT:x0;return!e&&B0(yt,"iterate",Px),ct.forEach((Ut,ne)=>T.call($,St(Ut),St(ne),K))}};return Rp(r,e?{add:D6("add"),set:D6("set"),delete:D6("delete"),clear:D6("clear")}:{add(T){!t&&!yg(T)&&!v_(T)&&(T=ru(T));const $=ru(this);return I6($).has.call($,T)||($.add(T),P1($,"add",T,T)),this},set(T,$){!t&&!yg($)&&!v_($)&&($=ru($));const K=ru(this),{has:ct,get:yt}=I6(K);let St=ct.call(K,T);St||(T=ru(T),St=ct.call(K,T));const Ut=yt.call(K,T);return K.set(T,$),St?d_($,Ut)&&P1(K,"set",T,$):P1(K,"add",T,$),this},delete(T){const $=ru(this),{has:K,get:ct}=I6($);let yt=K.call($,T);yt||(T=ru(T),yt=K.call($,T)),ct&&ct.call($,T);const St=$.delete(T);return yt&&P1($,"delete",T,void 0),St},clear(){const T=ru(this),$=T.size!==0,K=T.clear();return $&&P1(T,"clear",void 0,void 0),K}}),["keys","values","entries",Symbol.iterator].forEach(T=>{r[T]=pit(T,e,t)}),r}function wE(e,t){const r=mit(e,t);return(u,T,$)=>T==="__v_isReactive"?!e:T==="__v_isReadonly"?e:T==="__v_raw"?u:Reflect.get(Yh(r,T)&&T in u?r:u,T,$)}const git={get:wE(!1,!1)},vit={get:wE(!1,!0)},yit={get:wE(!0,!1)};const Sj=new WeakMap,Cj=new WeakMap,Aj=new WeakMap,_it=new WeakMap;function xit(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bit(e){return e.__v_skip||!Object.isExtensible(e)?0:xit(Vnt(e))}function g_(e){return v_(e)?e:kE(e,!1,hit,git,Sj)}function Mj(e){return kE(e,!1,fit,vit,Cj)}function Ej(e){return kE(e,!0,dit,yit,Aj)}function kE(e,t,r,u,T){if(!Ad(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const $=bit(e);if($===0)return e;const K=T.get(e);if(K)return K;const ct=new Proxy(e,$===2?u:r);return T.set(e,ct),ct}function f_(e){return v_(e)?f_(e.__v_raw):!!(e&&e.__v_isReactive)}function v_(e){return!!(e&&e.__v_isReadonly)}function yg(e){return!!(e&&e.__v_isShallow)}function TE(e){return e?!!e.__v_raw:!1}function ru(e){const t=e&&e.__v_raw;return t?ru(t):e}function j1(e){return!Yh(e,"__v_skip")&&Object.isExtensible(e)&&BM(e,"__v_skip",!0),e}const x0=e=>Ad(e)?g_(e):e,UT=e=>Ad(e)?Ej(e):e;function hp(e){return e?e.__v_isRef===!0:!1}function li(e){return Lj(e,!1)}function wit(e){return Lj(e,!0)}function Lj(e,t){return hp(e)?e:new kit(e,t)}class kit{constructor(t,r){this.dep=new bE,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?t:ru(t),this._value=r?t:x0(t),this.__v_isShallow=r}get value(){return this.dep.track(),this._value}set value(t){const r=this._rawValue,u=this.__v_isShallow||yg(t)||v_(t);t=u?t:ru(t),d_(t,r)&&(this._rawValue=t,this._value=u?t:x0(t),this.dep.trigger())}}function Io(e){return hp(e)?e.value:e}const Tit={get:(e,t,r)=>t==="__v_raw"?e:Io(Reflect.get(e,t,r)),set:(e,t,r,u)=>{const T=e[t];return hp(T)&&!hp(r)?(T.value=r,!0):Reflect.set(e,t,r,u)}};function Pj(e){return f_(e)?e:new Proxy(e,Tit)}function Sit(e){const t=pc(e)?new Array(e.length):{};for(const r in e)t[r]=Ait(e,r);return t}class Cit{constructor(t,r,u){this._object=t,this._key=r,this._defaultValue=u,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return ait(ru(this._object),this._key)}}function Ait(e,t,r){const u=e[t];return hp(u)?u:new Cit(e,t,r)}class Mit{constructor(t,r,u){this.fn=t,this.setter=r,this._value=void 0,this.dep=new bE(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=z5-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=u}notify(){if(this.flags|=16,!(this.flags&8)&&zd!==this)return gj(this,!0),!0}get value(){const t=this.dep.track();return _j(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Eit(e,t,r=!1){let u,T;return Xc(e)?u=e:(u=e.get,T=e.set),new Mit(u,T,r)}const z6={},$T=new WeakMap;let vx;function Lit(e,t=!1,r=vx){if(r){let u=$T.get(r);u||$T.set(r,u=[]),u.push(e)}}function Pit(e,t,r=Cd){const{immediate:u,deep:T,once:$,scheduler:K,augmentJob:ct,call:yt}=r,St=Lr=>T?Lr:yg(Lr)||T===!1||T===0?I1(Lr,1):I1(Lr);let Ut,ne,pe,me,we=!1,Ce=!1;if(hp(e)?(ne=()=>e.value,we=yg(e)):f_(e)?(ne=()=>St(e),we=!0):pc(e)?(Ce=!0,we=e.some(Lr=>f_(Lr)||yg(Lr)),ne=()=>e.map(Lr=>{if(hp(Lr))return Lr.value;if(f_(Lr))return St(Lr);if(Xc(Lr))return yt?yt(Lr,2):Lr()})):Xc(e)?t?ne=yt?()=>yt(e,2):e:ne=()=>{if(pe){$1();try{pe()}finally{H1()}}const Lr=vx;vx=Ut;try{return yt?yt(e,3,[me]):e(me)}finally{vx=Lr}}:ne=Ev,t&&T){const Lr=ne,Mr=T===!0?1/0:T;ne=()=>I1(Lr(),Mr)}const Ve=fj(),kr=()=>{Ut.stop(),Ve&&Ve.active&&gE(Ve.effects,Ut)};if($&&t){const Lr=t;t=(...Mr)=>{Lr(...Mr),kr()}}let It=Ce?new Array(e.length).fill(z6):z6;const rn=Lr=>{if(!(!(Ut.flags&1)||!Ut.dirty&&!Lr))if(t){const Mr=Ut.run();if(T||we||(Ce?Mr.some((tn,Dn)=>d_(tn,It[Dn])):d_(Mr,It))){pe&&pe();const tn=vx;vx=Ut;try{const Dn=[Mr,It===z6?void 0:Ce&&It[0]===z6?[]:It,me];It=Mr,yt?yt(t,3,Dn):t(...Dn)}finally{vx=tn}}}else Ut.run()};return ct&&ct(rn),Ut=new pj(ne),Ut.scheduler=K?()=>K(rn,!1):rn,me=Lr=>Lit(Lr,!1,Ut),pe=Ut.onStop=()=>{const Lr=$T.get(Ut);if(Lr){if(yt)yt(Lr,4);else for(const Mr of Lr)Mr();$T.delete(Ut)}},t?u?rn(!0):It=Ut.run():K?K(rn.bind(null,!0),!0):Ut.run(),kr.pause=Ut.pause.bind(Ut),kr.resume=Ut.resume.bind(Ut),kr.stop=kr,kr}function I1(e,t=1/0,r){if(t<=0||!Ad(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,hp(e))I1(e.value,t,r);else if(pc(e))for(let u=0;u{I1(u,t,r)});else if(sj(e)){for(const u in e)I1(e[u],t,r);for(const u of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,u)&&I1(e[u],t,r)}return e}/** +**/let O0;class hj{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=O0,!t&&O0&&(this.index=(O0.scopes||(O0.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,r;if(this.scopes)for(t=0,r=this.scopes.length;t0&&--this._on===0&&(O0=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let r,u;for(r=0,u=this.effects.length;r0)return;if(y5){let t=y5;for(y5=void 0;t;){const r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;for(;v5;){let t=v5;for(v5=void 0;t;){const r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(u){e||(e=u)}t=r}}if(e)throw e}function vj(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function yj(e){let t,r=e.depsTail,u=r;for(;u;){const T=u.prevDep;u.version===-1?(u===r&&(r=T),xE(u),nit(u)):t=u,u.dep.activeLink=u.prevActiveLink,u.prevActiveLink=void 0,u=T}e.deps=t,e.depsTail=r}function RM(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_j(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _j(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===z5)||(e.globalVersion=z5,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!RM(e))))return;e.flags|=2;const t=e.dep,r=zd,u=Fg;zd=e,Fg=!0;try{vj(e);const T=e.fn(e._value);(t.version===0||d_(T,e._value))&&(e.flags|=128,e._value=T,t.version++)}catch(T){throw t.version++,T}finally{zd=r,Fg=u,yj(e),e.flags&=-3}}function xE(e,t=!1){const{dep:r,prevSub:u,nextSub:T}=e;if(u&&(u.nextSub=T,e.prevSub=void 0),T&&(T.prevSub=u,e.nextSub=void 0),r.subs===e&&(r.subs=u,!u&&r.computed)){r.computed.flags&=-5;for(let $=r.computed.deps;$;$=$.nextDep)xE($,!0)}!t&&!--r.sc&&r.map&&r.map.delete(r.key)}function nit(e){const{prevDep:t,nextDep:r}=e;t&&(t.nextDep=r,e.prevDep=void 0),r&&(r.prevDep=t,e.nextDep=void 0)}let Fg=!0;const xj=[];function $1(){xj.push(Fg),Fg=!1}function H1(){const e=xj.pop();Fg=e===void 0?!0:e}function IO(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const r=zd;zd=void 0;try{t()}finally{zd=r}}}let z5=0;class iit{constructor(t,r){this.sub=t,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class bE{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!zd||!Fg||zd===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==zd)r=this.activeLink=new iit(zd,this),zd.deps?(r.prevDep=zd.depsTail,zd.depsTail.nextDep=r,zd.depsTail=r):zd.deps=zd.depsTail=r,bj(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const u=r.nextDep;u.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=u),r.prevDep=zd.depsTail,r.nextDep=void 0,zd.depsTail.nextDep=r,zd.depsTail=r,zd.deps===r&&(zd.deps=u)}return r}trigger(t){this.version++,z5++,this.notify(t)}notify(t){yE();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{_E()}}}function bj(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let u=t.deps;u;u=u.nextDep)bj(u)}const r=e.dep.subs;r!==e&&(e.prevSub=r,r&&(r.nextSub=e)),e.dep.subs=e}}const jT=new WeakMap,Ix=Symbol(""),FM=Symbol(""),O5=Symbol("");function B0(e,t,r){if(Fg&&zd){let u=jT.get(e);u||jT.set(e,u=new Map);let T=u.get(r);T||(u.set(r,T=new bE),T.map=u,T.key=r),T.track()}}function P1(e,t,r,u,T,$){const K=jT.get(e);if(!K){z5++;return}const ct=yt=>{yt&&yt.trigger()};if(yE(),t==="clear")K.forEach(ct);else{const yt=pc(e),St=yt&&vE(r);if(yt&&r==="length"){const Ut=Number(u);K.forEach((ne,pe)=>{(pe==="length"||pe===O5||!Iv(pe)&&pe>=Ut)&&ct(ne)})}else switch((r!==void 0||K.has(void 0))&&ct(K.get(r)),St&&ct(K.get(O5)),t){case"add":yt?St&&ct(K.get("length")):(ct(K.get(Ix)),P2(e)&&ct(K.get(FM)));break;case"delete":yt||(ct(K.get(Ix)),P2(e)&&ct(K.get(FM)));break;case"set":P2(e)&&ct(K.get(Ix));break}}_E()}function ait(e,t){const r=jT.get(e);return r&&r.get(t)}function p2(e){const t=ru(e);return t===e?t:(B0(t,"iterate",O5),yg(e)?t:t.map(x0))}function TS(e){return B0(e=ru(e),"iterate",O5),e}const oit={__proto__:null,[Symbol.iterator](){return _7(this,Symbol.iterator,x0)},concat(...e){return p2(this).concat(...e.map(t=>pc(t)?p2(t):t))},entries(){return _7(this,"entries",e=>(e[1]=x0(e[1]),e))},every(e,t){return m1(this,"every",e,t,void 0,arguments)},filter(e,t){return m1(this,"filter",e,t,r=>r.map(x0),arguments)},find(e,t){return m1(this,"find",e,t,x0,arguments)},findIndex(e,t){return m1(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return m1(this,"findLast",e,t,x0,arguments)},findLastIndex(e,t){return m1(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return m1(this,"forEach",e,t,void 0,arguments)},includes(...e){return x7(this,"includes",e)},indexOf(...e){return x7(this,"indexOf",e)},join(e){return p2(this).join(e)},lastIndexOf(...e){return x7(this,"lastIndexOf",e)},map(e,t){return m1(this,"map",e,t,void 0,arguments)},pop(){return P3(this,"pop")},push(...e){return P3(this,"push",e)},reduce(e,...t){return DO(this,"reduce",e,t)},reduceRight(e,...t){return DO(this,"reduceRight",e,t)},shift(){return P3(this,"shift")},some(e,t){return m1(this,"some",e,t,void 0,arguments)},splice(...e){return P3(this,"splice",e)},toReversed(){return p2(this).toReversed()},toSorted(e){return p2(this).toSorted(e)},toSpliced(...e){return p2(this).toSpliced(...e)},unshift(...e){return P3(this,"unshift",e)},values(){return _7(this,"values",x0)}};function _7(e,t,r){const u=TS(e),T=u[t]();return u!==e&&!yg(e)&&(T._next=T.next,T.next=()=>{const $=T._next();return $.value&&($.value=r($.value)),$}),T}const sit=Array.prototype;function m1(e,t,r,u,T,$){const K=TS(e),ct=K!==e&&!yg(e),yt=K[t];if(yt!==sit[t]){const ne=yt.apply(e,$);return ct?x0(ne):ne}let St=r;K!==e&&(ct?St=function(ne,pe){return r.call(this,x0(ne),pe,e)}:r.length>2&&(St=function(ne,pe){return r.call(this,ne,pe,e)}));const Ut=yt.call(K,St,u);return ct&&T?T(Ut):Ut}function DO(e,t,r,u){const T=TS(e);let $=r;return T!==e&&(yg(e)?r.length>3&&($=function(K,ct,yt){return r.call(this,K,ct,yt,e)}):$=function(K,ct,yt){return r.call(this,K,x0(ct),yt,e)}),T[t]($,...u)}function x7(e,t,r){const u=ru(e);B0(u,"iterate",O5);const T=u[t](...r);return(T===-1||T===!1)&&TE(r[0])?(r[0]=ru(r[0]),u[t](...r)):T}function P3(e,t,r=[]){$1(),yE();const u=ru(e)[t].apply(e,r);return _E(),H1(),u}const lit=pE("__proto__,__v_isRef,__isVue"),wj=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Iv));function cit(e){Iv(e)||(e=String(e));const t=ru(this);return B0(t,"has",e),t.hasOwnProperty(e)}class kj{constructor(t=!1,r=!1){this._isReadonly=t,this._isShallow=r}get(t,r,u){if(r==="__v_skip")return t.__v_skip;const T=this._isReadonly,$=this._isShallow;if(r==="__v_isReactive")return!T;if(r==="__v_isReadonly")return T;if(r==="__v_isShallow")return $;if(r==="__v_raw")return u===(T?$?_it:Aj:$?Cj:Sj).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(u)?t:void 0;const K=pc(t);if(!T){let yt;if(K&&(yt=oit[r]))return yt;if(r==="hasOwnProperty")return cit}const ct=Reflect.get(t,r,hp(t)?t:u);return(Iv(r)?wj.has(r):lit(r))||(T||B0(t,"get",r),$)?ct:hp(ct)?K&&vE(r)?ct:ct.value:Ad(ct)?T?Ej(ct):g_(ct):ct}}class Tj extends kj{constructor(t=!1){super(!1,t)}set(t,r,u,T){let $=t[r];if(!this._isShallow){const yt=v_($);if(!yg(u)&&!v_(u)&&($=ru($),u=ru(u)),!pc(t)&&hp($)&&!hp(u))return yt?!1:($.value=u,!0)}const K=pc(t)&&vE(r)?Number(r)e,I6=e=>Reflect.getPrototypeOf(e);function pit(e,t,r){return function(...u){const T=this.__v_raw,$=ru(T),K=P2($),ct=e==="entries"||e===Symbol.iterator&&K,yt=e==="keys"&&K,St=T[e](...u),Ut=r?NM:t?UT:x0;return!t&&B0($,"iterate",yt?FM:Ix),{next(){const{value:ne,done:pe}=St.next();return pe?{value:ne,done:pe}:{value:ct?[Ut(ne[0]),Ut(ne[1])]:Ut(ne),done:pe}},[Symbol.iterator](){return this}}}}function D6(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function mit(e,t){const r={get(T){const $=this.__v_raw,K=ru($),ct=ru(T);e||(d_(T,ct)&&B0(K,"get",T),B0(K,"get",ct));const{has:yt}=I6(K),St=t?NM:e?UT:x0;if(yt.call(K,T))return St($.get(T));if(yt.call(K,ct))return St($.get(ct));$!==K&&$.get(T)},get size(){const T=this.__v_raw;return!e&&B0(ru(T),"iterate",Ix),Reflect.get(T,"size",T)},has(T){const $=this.__v_raw,K=ru($),ct=ru(T);return e||(d_(T,ct)&&B0(K,"has",T),B0(K,"has",ct)),T===ct?$.has(T):$.has(T)||$.has(ct)},forEach(T,$){const K=this,ct=K.__v_raw,yt=ru(ct),St=t?NM:e?UT:x0;return!e&&B0(yt,"iterate",Ix),ct.forEach((Ut,ne)=>T.call($,St(Ut),St(ne),K))}};return Rp(r,e?{add:D6("add"),set:D6("set"),delete:D6("delete"),clear:D6("clear")}:{add(T){!t&&!yg(T)&&!v_(T)&&(T=ru(T));const $=ru(this);return I6($).has.call($,T)||($.add(T),P1($,"add",T,T)),this},set(T,$){!t&&!yg($)&&!v_($)&&($=ru($));const K=ru(this),{has:ct,get:yt}=I6(K);let St=ct.call(K,T);St||(T=ru(T),St=ct.call(K,T));const Ut=yt.call(K,T);return K.set(T,$),St?d_($,Ut)&&P1(K,"set",T,$):P1(K,"add",T,$),this},delete(T){const $=ru(this),{has:K,get:ct}=I6($);let yt=K.call($,T);yt||(T=ru(T),yt=K.call($,T)),ct&&ct.call($,T);const St=$.delete(T);return yt&&P1($,"delete",T,void 0),St},clear(){const T=ru(this),$=T.size!==0,K=T.clear();return $&&P1(T,"clear",void 0,void 0),K}}),["keys","values","entries",Symbol.iterator].forEach(T=>{r[T]=pit(T,e,t)}),r}function wE(e,t){const r=mit(e,t);return(u,T,$)=>T==="__v_isReactive"?!e:T==="__v_isReadonly"?e:T==="__v_raw"?u:Reflect.get(Yh(r,T)&&T in u?r:u,T,$)}const git={get:wE(!1,!1)},vit={get:wE(!1,!0)},yit={get:wE(!0,!1)};const Sj=new WeakMap,Cj=new WeakMap,Aj=new WeakMap,_it=new WeakMap;function xit(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bit(e){return e.__v_skip||!Object.isExtensible(e)?0:xit(Vnt(e))}function g_(e){return v_(e)?e:kE(e,!1,hit,git,Sj)}function Mj(e){return kE(e,!1,fit,vit,Cj)}function Ej(e){return kE(e,!0,dit,yit,Aj)}function kE(e,t,r,u,T){if(!Ad(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const $=bit(e);if($===0)return e;const K=T.get(e);if(K)return K;const ct=new Proxy(e,$===2?u:r);return T.set(e,ct),ct}function f_(e){return v_(e)?f_(e.__v_raw):!!(e&&e.__v_isReactive)}function v_(e){return!!(e&&e.__v_isReadonly)}function yg(e){return!!(e&&e.__v_isShallow)}function TE(e){return e?!!e.__v_raw:!1}function ru(e){const t=e&&e.__v_raw;return t?ru(t):e}function j1(e){return!Yh(e,"__v_skip")&&Object.isExtensible(e)&&BM(e,"__v_skip",!0),e}const x0=e=>Ad(e)?g_(e):e,UT=e=>Ad(e)?Ej(e):e;function hp(e){return e?e.__v_isRef===!0:!1}function li(e){return Lj(e,!1)}function wit(e){return Lj(e,!0)}function Lj(e,t){return hp(e)?e:new kit(e,t)}class kit{constructor(t,r){this.dep=new bE,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?t:ru(t),this._value=r?t:x0(t),this.__v_isShallow=r}get value(){return this.dep.track(),this._value}set value(t){const r=this._rawValue,u=this.__v_isShallow||yg(t)||v_(t);t=u?t:ru(t),d_(t,r)&&(this._rawValue=t,this._value=u?t:x0(t),this.dep.trigger())}}function Lo(e){return hp(e)?e.value:e}const Tit={get:(e,t,r)=>t==="__v_raw"?e:Lo(Reflect.get(e,t,r)),set:(e,t,r,u)=>{const T=e[t];return hp(T)&&!hp(r)?(T.value=r,!0):Reflect.set(e,t,r,u)}};function Pj(e){return f_(e)?e:new Proxy(e,Tit)}function Sit(e){const t=pc(e)?new Array(e.length):{};for(const r in e)t[r]=Ait(e,r);return t}class Cit{constructor(t,r,u){this._object=t,this._key=r,this._defaultValue=u,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return ait(ru(this._object),this._key)}}function Ait(e,t,r){const u=e[t];return hp(u)?u:new Cit(e,t,r)}class Mit{constructor(t,r,u){this.fn=t,this.setter=r,this._value=void 0,this.dep=new bE(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=z5-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=u}notify(){if(this.flags|=16,!(this.flags&8)&&zd!==this)return gj(this,!0),!0}get value(){const t=this.dep.track();return _j(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Eit(e,t,r=!1){let u,T;return Xc(e)?u=e:(u=e.get,T=e.set),new Mit(u,T,r)}const z6={},$T=new WeakMap;let vx;function Lit(e,t=!1,r=vx){if(r){let u=$T.get(r);u||$T.set(r,u=[]),u.push(e)}}function Pit(e,t,r=Cd){const{immediate:u,deep:T,once:$,scheduler:K,augmentJob:ct,call:yt}=r,St=Lr=>T?Lr:yg(Lr)||T===!1||T===0?I1(Lr,1):I1(Lr);let Ut,ne,pe,me,we=!1,Ce=!1;if(hp(e)?(ne=()=>e.value,we=yg(e)):f_(e)?(ne=()=>St(e),we=!0):pc(e)?(Ce=!0,we=e.some(Lr=>f_(Lr)||yg(Lr)),ne=()=>e.map(Lr=>{if(hp(Lr))return Lr.value;if(f_(Lr))return St(Lr);if(Xc(Lr))return yt?yt(Lr,2):Lr()})):Xc(e)?t?ne=yt?()=>yt(e,2):e:ne=()=>{if(pe){$1();try{pe()}finally{H1()}}const Lr=vx;vx=Ut;try{return yt?yt(e,3,[me]):e(me)}finally{vx=Lr}}:ne=Ev,t&&T){const Lr=ne,Mr=T===!0?1/0:T;ne=()=>I1(Lr(),Mr)}const Ve=fj(),kr=()=>{Ut.stop(),Ve&&Ve.active&&gE(Ve.effects,Ut)};if($&&t){const Lr=t;t=(...Mr)=>{Lr(...Mr),kr()}}let It=Ce?new Array(e.length).fill(z6):z6;const rn=Lr=>{if(!(!(Ut.flags&1)||!Ut.dirty&&!Lr))if(t){const Mr=Ut.run();if(T||we||(Ce?Mr.some((tn,Dn)=>d_(tn,It[Dn])):d_(Mr,It))){pe&&pe();const tn=vx;vx=Ut;try{const Dn=[Mr,It===z6?void 0:Ce&&It[0]===z6?[]:It,me];It=Mr,yt?yt(t,3,Dn):t(...Dn)}finally{vx=tn}}}else Ut.run()};return ct&&ct(rn),Ut=new pj(ne),Ut.scheduler=K?()=>K(rn,!1):rn,me=Lr=>Lit(Lr,!1,Ut),pe=Ut.onStop=()=>{const Lr=$T.get(Ut);if(Lr){if(yt)yt(Lr,4);else for(const Mr of Lr)Mr();$T.delete(Ut)}},t?u?rn(!0):It=Ut.run():K?K(rn.bind(null,!0),!0):Ut.run(),kr.pause=Ut.pause.bind(Ut),kr.resume=Ut.resume.bind(Ut),kr.stop=kr,kr}function I1(e,t=1/0,r){if(t<=0||!Ad(e)||e.__v_skip||(r=r||new Set,r.has(e)))return e;if(r.add(e),t--,hp(e))I1(e.value,t,r);else if(pc(e))for(let u=0;u{I1(u,t,r)});else if(sj(e)){for(const u in e)I1(e[u],t,r);for(const u of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,u)&&I1(e[u],t,r)}return e}/** * @vue/runtime-core v3.5.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function e4(e,t,r,u){try{return u?e(...u):e()}catch(T){SS(T,t,r)}}function Ng(e,t,r,u){if(Xc(e)){const T=e4(e,t,r,u);return T&&aj(T)&&T.catch($=>{SS($,t,r)}),T}if(pc(e)){const T=[];for(let $=0;$>>1,T=nm[u],$=B5(T);$=B5(r)?nm.push(e):nm.splice(Dit(t),0,e),e.flags|=1,Dj()}}function Dj(){HT||(HT=Ij.then(Oj))}function zit(e){pc(e)?I2.push(...e):t_&&e.id===-1?t_.splice(w2+1,0,e):e.flags&1||(I2.push(e),e.flags|=1),Dj()}function zO(e,t,r=xv+1){for(;rB5(r)-B5(u));if(I2.length=0,t_){t_.push(...t);return}for(t_=t,w2=0;w2e.id==null?e.flags&2?-1:1/0:e.id;function Oj(e){try{for(xv=0;xv{u._d&&ZO(-1);const $=VT(t);let K;try{K=e(...T)}finally{VT($),u._d&&ZO(1)}return K};return u._n=!0,u._c=!0,u._d=!0,u}function Ml(e,t){if(Zm===null)return e;const r=DS(Zm),u=e.dirs||(e.dirs=[]);for(let T=0;Te.__isTeleport,_5=e=>e&&(e.disabled||e.disabled===""),OO=e=>e&&(e.defer||e.defer===""),BO=e=>typeof SVGElement<"u"&&e instanceof SVGElement,RO=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,jM=(e,t)=>{const r=e&&e.to;return Af(r)?t?t(r):null:r},Nj={name:"Teleport",__isTeleport:!0,process(e,t,r,u,T,$,K,ct,yt,St){const{mc:Ut,pc:ne,pbc:pe,o:{insert:me,querySelector:we,createText:Ce,createComment:Ve}}=St,kr=_5(t.props);let{shapeFlag:It,children:rn,dynamicChildren:Lr}=t;if(e==null){const Mr=t.el=Ce(""),tn=t.anchor=Ce("");me(Mr,r,u),me(tn,r,u);const Dn=(Br,Vn)=>{It&16&&(T&&T.isCE&&(T.ce._teleportTarget=Br),Ut(rn,Br,Vn,T,$,K,ct,yt))},Mn=()=>{const Br=t.target=jM(t.props,we),Vn=jj(Br,t,Ce,me);Br&&(K!=="svg"&&BO(Br)?K="svg":K!=="mathml"&&RO(Br)&&(K="mathml"),kr||(Dn(Br,Vn),gT(t,!1)))};kr&&(Dn(r,tn),gT(t,!0)),OO(t.props)?(t.el.__isMounted=!1,em(()=>{Mn(),delete t.el.__isMounted},$)):Mn()}else{if(OO(t.props)&&e.el.__isMounted===!1){em(()=>{Nj.process(e,t,r,u,T,$,K,ct,yt,St)},$);return}t.el=e.el,t.targetStart=e.targetStart;const Mr=t.anchor=e.anchor,tn=t.target=e.target,Dn=t.targetAnchor=e.targetAnchor,Mn=_5(e.props),Br=Mn?r:tn,Vn=Mn?Mr:Dn;if(K==="svg"||BO(tn)?K="svg":(K==="mathml"||RO(tn))&&(K="mathml"),Lr?(pe(e.dynamicChildren,Lr,Br,T,$,K,ct),EE(e,t,!0)):yt||ne(e,t,Br,Vn,T,$,K,ct,!1),kr)Mn?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):O6(t,r,Mr,St,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const on=t.target=jM(t.props,we);on&&O6(t,on,null,St,0)}else Mn&&O6(t,tn,Dn,St,1);gT(t,kr)}},remove(e,t,r,{um:u,o:{remove:T}},$){const{shapeFlag:K,children:ct,anchor:yt,targetStart:St,targetAnchor:Ut,target:ne,props:pe}=e;if(ne&&(T(St),T(Ut)),$&&T(yt),K&16){const me=$||!_5(pe);for(let we=0;we{e.isMounted=!0}),Tg(()=>{e.isUnmounting=!0}),e}const sg=[Function,Array],$j={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:sg,onEnter:sg,onAfterEnter:sg,onEnterCancelled:sg,onBeforeLeave:sg,onLeave:sg,onAfterLeave:sg,onLeaveCancelled:sg,onBeforeAppear:sg,onAppear:sg,onAfterAppear:sg,onAppearCancelled:sg},Hj=e=>{const t=e.subTree;return t.component?Hj(t.component):t},Bit={name:"BaseTransition",props:$j,setup(e,{slots:t}){const r=IS(),u=Uj();return()=>{const T=t.default&&CE(t.default(),!0);if(!T||!T.length)return;const $=Vj(T),K=ru(e),{mode:ct}=K;if(u.isLeaving)return b7($);const yt=FO($);if(!yt)return b7($);let St=R5(yt,K,u,r,ne=>St=ne);yt.type!==am&&Nx(yt,St);let Ut=r.subTree&&FO(r.subTree);if(Ut&&Ut.type!==am&&!kx(yt,Ut)&&Hj(r).type!==am){let ne=R5(Ut,K,u,r);if(Nx(Ut,ne),ct==="out-in"&&yt.type!==am)return u.isLeaving=!0,ne.afterLeave=()=>{u.isLeaving=!1,r.job.flags&8||r.update(),delete ne.afterLeave,Ut=void 0},b7($);ct==="in-out"&&yt.type!==am?ne.delayLeave=(pe,me,we)=>{const Ce=Wj(u,Ut);Ce[String(Ut.key)]=Ut,pe[e_]=()=>{me(),pe[e_]=void 0,delete St.delayedLeave,Ut=void 0},St.delayedLeave=()=>{we(),delete St.delayedLeave,Ut=void 0}}:Ut=void 0}else Ut&&(Ut=void 0);return $}}};function Vj(e){let t=e[0];if(e.length>1){for(const r of e)if(r.type!==am){t=r;break}}return t}const Rit=Bit;function Wj(e,t){const{leavingVNodes:r}=e;let u=r.get(t.type);return u||(u=Object.create(null),r.set(t.type,u)),u}function R5(e,t,r,u,T){const{appear:$,mode:K,persisted:ct=!1,onBeforeEnter:yt,onEnter:St,onAfterEnter:Ut,onEnterCancelled:ne,onBeforeLeave:pe,onLeave:me,onAfterLeave:we,onLeaveCancelled:Ce,onBeforeAppear:Ve,onAppear:kr,onAfterAppear:It,onAppearCancelled:rn}=t,Lr=String(e.key),Mr=Wj(r,e),tn=(Br,Vn)=>{Br&&Ng(Br,u,9,Vn)},Dn=(Br,Vn)=>{const on=Vn[1];tn(Br,Vn),pc(Br)?Br.every(pr=>pr.length<=1)&&on():Br.length<=1&&on()},Mn={mode:K,persisted:ct,beforeEnter(Br){let Vn=yt;if(!r.isMounted)if($)Vn=Ve||yt;else return;Br[e_]&&Br[e_](!0);const on=Mr[Lr];on&&kx(e,on)&&on.el[e_]&&on.el[e_](),tn(Vn,[Br])},enter(Br){let Vn=St,on=Ut,pr=ne;if(!r.isMounted)if($)Vn=kr||St,on=It||Ut,pr=rn||ne;else return;let _r=!1;const Sr=Br[B6]=Dr=>{_r||(_r=!0,Dr?tn(pr,[Br]):tn(on,[Br]),Mn.delayedLeave&&Mn.delayedLeave(),Br[B6]=void 0)};Vn?Dn(Vn,[Br,Sr]):Sr()},leave(Br,Vn){const on=String(e.key);if(Br[B6]&&Br[B6](!0),r.isUnmounting)return Vn();tn(pe,[Br]);let pr=!1;const _r=Br[e_]=Sr=>{pr||(pr=!0,Vn(),Sr?tn(Ce,[Br]):tn(we,[Br]),Br[e_]=void 0,Mr[on]===e&&delete Mr[on])};Mr[on]=e,me?Dn(me,[Br,_r]):_r()},clone(Br){const Vn=R5(Br,t,r,u,T);return T&&T(Vn),Vn}};return Mn}function b7(e){if(AS(e))return e=y_(e),e.children=null,e}function FO(e){if(!AS(e))return Fj(e.type)&&e.children?Vj(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:r}=e;if(r){if(t&16)return r[0];if(t&32&&Xc(r.default))return r.default()}}function Nx(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Nx(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function CE(e,t=!1,r){let u=[],T=0;for(let $=0;$1)for(let $=0;$x5(we,t&&(pc(t)?t[Ce]:t),r,u,T));return}if(b5(u)&&!T){u.shapeFlag&512&&u.type.__asyncResolved&&u.component.subTree.component&&x5(e,t,r,u.component.subTree);return}const $=u.shapeFlag&4?DS(u.component):u.el,K=T?null:$,{i:ct,r:yt}=e,St=t&&t.r,Ut=ct.refs===Cd?ct.refs={}:ct.refs,ne=ct.setupState,pe=ru(ne),me=ne===Cd?()=>!1:we=>Yh(pe,we);if(St!=null&&St!==yt&&(Af(St)?(Ut[St]=null,me(St)&&(ne[St]=null)):hp(St)&&(St.value=null)),Xc(yt))e4(yt,ct,12,[K,Ut]);else{const we=Af(yt),Ce=hp(yt);if(we||Ce){const Ve=()=>{if(e.f){const kr=we?me(yt)?ne[yt]:Ut[yt]:yt.value;T?pc(kr)&&gE(kr,$):pc(kr)?kr.includes($)||kr.push($):we?(Ut[yt]=[$],me(yt)&&(ne[yt]=Ut[yt])):(yt.value=[$],e.k&&(Ut[e.k]=yt.value))}else we?(Ut[yt]=K,me(yt)&&(ne[yt]=K)):Ce&&(yt.value=K,e.k&&(Ut[e.k]=K))};K?(Ve.id=-1,em(Ve,r)):Ve()}}}kS().requestIdleCallback;kS().cancelIdleCallback;const b5=e=>!!e.type.__asyncLoader,AS=e=>e.type.__isKeepAlive;function Fit(e,t){Gj(e,"a",t)}function Nit(e,t){Gj(e,"da",t)}function Gj(e,t,r=R0){const u=e.__wdc||(e.__wdc=()=>{let T=r;for(;T;){if(T.isDeactivated)return;T=T.parent}return e()});if(MS(t,u,r),r){let T=r.parent;for(;T&&T.parent;)AS(T.parent.vnode)&&jit(u,t,r,T),T=T.parent}}function jit(e,t,r,u){const T=MS(t,e,u,!0);Dv(()=>{gE(u[t],T)},r)}function MS(e,t,r=R0,u=!1){if(r){const T=r[e]||(r[e]=[]),$=t.__weh||(t.__weh=(...K)=>{$1();const ct=r4(r),yt=Ng(t,r,e,K);return ct(),H1(),yt});return u?T.unshift($):T.push($),$}}const q1=e=>(t,r=R0)=>{(!N5||e==="sp")&&MS(e,(...u)=>t(...u),r)},Uit=q1("bm"),Xd=q1("m"),$it=q1("bu"),Zj=q1("u"),Tg=q1("bum"),Dv=q1("um"),Hit=q1("sp"),Vit=q1("rtg"),Wit=q1("rtc");function qit(e,t=R0){MS("ec",e,t)}const Kj="components";function ES(e,t){return Xj(Kj,e,!0,t)||e}const Yj=Symbol.for("v-ndc");function s_(e){return Af(e)?Xj(Kj,e,!1)||e:e||Yj}function Xj(e,t,r=!0,u=!1){const T=Zm||R0;if(T){const $=T.type;{const ct=Dat($,!1);if(ct&&(ct===t||ct===wg(t)||ct===wS(wg(t))))return $}const K=NO(T[e]||$[e],t)||NO(T.appContext[e],t);return!K&&u?$:K}}function NO(e,t){return e&&(e[t]||e[wg(t)]||e[wS(wg(t))])}function jl(e,t,r,u){let T;const $=r,K=pc(e);if(K||Af(e)){const ct=K&&f_(e);let yt=!1,St=!1;ct&&(yt=!yg(e),St=v_(e),e=TS(e)),T=new Array(e.length);for(let Ut=0,ne=e.length;Utt(ct,yt,void 0,$));else{const ct=Object.keys(e);T=new Array(ct.length);for(let yt=0,St=ct.length;yte?gU(e)?DS(e):UM(e.parent):null,w5=Rp(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>UM(e.parent),$root:e=>UM(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Qj(e),$forceUpdate:e=>e.f||(e.f=()=>{SE(e.update)}),$nextTick:e=>e.n||(e.n=sp.bind(e.proxy)),$watch:e=>pat.bind(e)}),w7=(e,t)=>e!==Cd&&!e.__isScriptSetup&&Yh(e,t),Git={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:r,setupState:u,data:T,props:$,accessCache:K,type:ct,appContext:yt}=e;let St;if(t[0]!=="$"){const me=K[t];if(me!==void 0)switch(me){case 1:return u[t];case 2:return T[t];case 4:return r[t];case 3:return $[t]}else{if(w7(u,t))return K[t]=1,u[t];if(T!==Cd&&Yh(T,t))return K[t]=2,T[t];if((St=e.propsOptions[0])&&Yh(St,t))return K[t]=3,$[t];if(r!==Cd&&Yh(r,t))return K[t]=4,r[t];$M&&(K[t]=0)}}const Ut=w5[t];let ne,pe;if(Ut)return t==="$attrs"&&B0(e.attrs,"get",""),Ut(e);if((ne=ct.__cssModules)&&(ne=ne[t]))return ne;if(r!==Cd&&Yh(r,t))return K[t]=4,r[t];if(pe=yt.config.globalProperties,Yh(pe,t))return pe[t]},set({_:e},t,r){const{data:u,setupState:T,ctx:$}=e;return w7(T,t)?(T[t]=r,!0):u!==Cd&&Yh(u,t)?(u[t]=r,!0):Yh(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:($[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:u,appContext:T,propsOptions:$}},K){let ct;return!!r[K]||e!==Cd&&Yh(e,K)||w7(t,K)||(ct=$[0])&&Yh(ct,K)||Yh(u,K)||Yh(w5,K)||Yh(T.config.globalProperties,K)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:Yh(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};function jO(e){return pc(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}let $M=!0;function Zit(e){const t=Qj(e),r=e.proxy,u=e.ctx;$M=!1,t.beforeCreate&&UO(t.beforeCreate,e,"bc");const{data:T,computed:$,methods:K,watch:ct,provide:yt,inject:St,created:Ut,beforeMount:ne,mounted:pe,beforeUpdate:me,updated:we,activated:Ce,deactivated:Ve,beforeDestroy:kr,beforeUnmount:It,destroyed:rn,unmounted:Lr,render:Mr,renderTracked:tn,renderTriggered:Dn,errorCaptured:Mn,serverPrefetch:Br,expose:Vn,inheritAttrs:on,components:pr,directives:_r,filters:Sr}=t;if(St&&Kit(St,u,null),K)for(const Cn in K){const Xn=K[Cn];Xc(Xn)&&(u[Cn]=Xn.bind(r))}if(T){const Cn=T.call(r,r);Ad(Cn)&&(e.data=g_(Cn))}if($M=!0,$)for(const Cn in $){const Xn=$[Cn],_i=Xc(Xn)?Xn.bind(r,r):Xc(Xn.get)?Xn.get.bind(r,r):Ev,ta=!Xc(Xn)&&Xc(Xn.set)?Xn.set.bind(r):Ev,va=Ao({get:_i,set:ta});Object.defineProperty(u,Cn,{enumerable:!0,configurable:!0,get:()=>va.value,set:_a=>va.value=_a})}if(ct)for(const Cn in ct)Jj(ct[Cn],u,r,Cn);if(yt){const Cn=Xc(yt)?yt.call(r):yt;Reflect.ownKeys(Cn).forEach(Xn=>{vT(Xn,Cn[Xn])})}Ut&&UO(Ut,e,"c");function nn(Cn,Xn){pc(Xn)?Xn.forEach(_i=>Cn(_i.bind(r))):Xn&&Cn(Xn.bind(r))}if(nn(Uit,ne),nn(Xd,pe),nn($it,me),nn(Zj,we),nn(Fit,Ce),nn(Nit,Ve),nn(qit,Mn),nn(Wit,tn),nn(Vit,Dn),nn(Tg,It),nn(Dv,Lr),nn(Hit,Br),pc(Vn))if(Vn.length){const Cn=e.exposed||(e.exposed={});Vn.forEach(Xn=>{Object.defineProperty(Cn,Xn,{get:()=>r[Xn],set:_i=>r[Xn]=_i,enumerable:!0})})}else e.exposed||(e.exposed={});Mr&&e.render===Ev&&(e.render=Mr),on!=null&&(e.inheritAttrs=on),pr&&(e.components=pr),_r&&(e.directives=_r),Br&&qj(e)}function Kit(e,t,r=Ev){pc(e)&&(e=HM(e));for(const u in e){const T=e[u];let $;Ad(T)?"default"in T?$=_g(T.from||u,T.default,!0):$=_g(T.from||u):$=_g(T),hp($)?Object.defineProperty(t,u,{enumerable:!0,configurable:!0,get:()=>$.value,set:K=>$.value=K}):t[u]=$}}function UO(e,t,r){Ng(pc(e)?e.map(u=>u.bind(t.proxy)):e.bind(t.proxy),t,r)}function Jj(e,t,r,u){let T=u.includes(".")?hU(r,u):()=>r[u];if(Af(e)){const $=t[e];Xc($)&&Fh(T,$)}else if(Xc(e))Fh(T,e.bind(r));else if(Ad(e))if(pc(e))e.forEach($=>Jj($,t,r,u));else{const $=Xc(e.handler)?e.handler.bind(r):t[e.handler];Xc($)&&Fh(T,$,e)}}function Qj(e){const t=e.type,{mixins:r,extends:u}=t,{mixins:T,optionsCache:$,config:{optionMergeStrategies:K}}=e.appContext,ct=$.get(t);let yt;return ct?yt=ct:!T.length&&!r&&!u?yt=t:(yt={},T.length&&T.forEach(St=>WT(yt,St,K,!0)),WT(yt,t,K)),Ad(t)&&$.set(t,yt),yt}function WT(e,t,r,u=!1){const{mixins:T,extends:$}=t;$&&WT(e,$,r,!0),T&&T.forEach(K=>WT(e,K,r,!0));for(const K in t)if(!(u&&K==="expose")){const ct=Yit[K]||r&&r[K];e[K]=ct?ct(e[K],t[K]):t[K]}return e}const Yit={data:$O,props:HO,emits:HO,methods:a5,computed:a5,beforeCreate:J0,created:J0,beforeMount:J0,mounted:J0,beforeUpdate:J0,updated:J0,beforeDestroy:J0,beforeUnmount:J0,destroyed:J0,unmounted:J0,activated:J0,deactivated:J0,errorCaptured:J0,serverPrefetch:J0,components:a5,directives:a5,watch:Jit,provide:$O,inject:Xit};function $O(e,t){return t?e?function(){return Rp(Xc(e)?e.call(this,this):e,Xc(t)?t.call(this,this):t)}:t:e}function Xit(e,t){return a5(HM(e),HM(t))}function HM(e){if(pc(e)){const t={};for(let r=0;r1)return r&&Xc(t)?t.call(u&&u.proxy):t}}function eat(){return!!(IS()||Ix)}const eU={},rU=()=>Object.create(eU),nU=e=>Object.getPrototypeOf(e)===eU;function rat(e,t,r,u=!1){const T={},$=rU();e.propsDefaults=Object.create(null),iU(e,t,T,$);for(const K in e.propsOptions[0])K in T||(T[K]=void 0);r?e.props=u?T:Mj(T):e.type.props?e.props=T:e.props=$,e.attrs=$}function nat(e,t,r,u){const{props:T,attrs:$,vnode:{patchFlag:K}}=e,ct=ru(T),[yt]=e.propsOptions;let St=!1;if((u||K>0)&&!(K&16)){if(K&8){const Ut=e.vnode.dynamicProps;for(let ne=0;ne{yt=!0;const[pe,me]=aU(ne,t,!0);Rp(K,pe),me&&ct.push(...me)};!r&&t.mixins.length&&t.mixins.forEach(Ut),e.extends&&Ut(e.extends),e.mixins&&e.mixins.forEach(Ut)}if(!$&&!yt)return Ad(e)&&u.set(e,L2),L2;if(pc($))for(let Ut=0;Ut<$.length;Ut++){const ne=wg($[Ut]);VO(ne)&&(K[ne]=Cd)}else if($)for(const Ut in $){const ne=wg(Ut);if(VO(ne)){const pe=$[Ut],me=K[ne]=pc(pe)||Xc(pe)?{type:pe}:Rp({},pe),we=me.type;let Ce=!1,Ve=!0;if(pc(we))for(let kr=0;kre==="_"||e==="__"||e==="_ctx"||e==="$stable",ME=e=>pc(e)?e.map(kv):[kv(e)],aat=(e,t,r)=>{if(t._n)return t;const u=V1((...T)=>ME(t(...T)),r);return u._c=!1,u},oU=(e,t,r)=>{const u=e._ctx;for(const T in e){if(AE(T))continue;const $=e[T];if(Xc($))t[T]=aat(T,$,u);else if($!=null){const K=ME($);t[T]=()=>K}}},sU=(e,t)=>{const r=ME(t);e.slots.default=()=>r},lU=(e,t,r)=>{for(const u in t)(r||!AE(u))&&(e[u]=t[u])},oat=(e,t,r)=>{const u=e.slots=rU();if(e.vnode.shapeFlag&32){const T=t.__;T&&BM(u,"__",T,!0);const $=t._;$?(lU(u,t,r),r&&BM(u,"_",$,!0)):oU(t,u)}else t&&sU(e,t)},sat=(e,t,r)=>{const{vnode:u,slots:T}=e;let $=!0,K=Cd;if(u.shapeFlag&32){const ct=t._;ct?r&&ct===1?$=!1:lU(T,t,r):($=!t.$stable,oU(t,T)),K=t}else t&&(sU(e,t),K={default:1});if($)for(const ct in T)!AE(ct)&&K[ct]==null&&delete T[ct]},em=bat;function lat(e){return cat(e)}function cat(e,t){const r=kS();r.__VUE__=!0;const{insert:u,remove:T,patchProp:$,createElement:K,createText:ct,createComment:yt,setText:St,setElementText:Ut,parentNode:ne,nextSibling:pe,setScopeId:me=Ev,insertStaticContent:we}=e,Ce=(Ur,Sn,Hn,Qa=null,Ha=null,qa=null,Mo=void 0,Wo=null,es=!!Sn.dynamicChildren)=>{if(Ur===Sn)return;Ur&&!kx(Ur,Sn)&&(Qa=hi(Ur),_a(Ur,Ha,qa,!0),Ur=null),Sn.patchFlag===-2&&(es=!1,Sn.dynamicChildren=null);const{type:Po,ref:Ys,shapeFlag:Jo}=Sn;switch(Po){case PS:Ve(Ur,Sn,Hn,Qa);break;case am:kr(Ur,Sn,Hn,Qa);break;case yT:Ur==null&&It(Sn,Hn,Qa,Mo);break;case Es:pr(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es);break;default:Jo&1?Mr(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es):Jo&6?_r(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es):(Jo&64||Jo&128)&&Po.process(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es,oo)}Ys!=null&&Ha?x5(Ys,Ur&&Ur.ref,qa,Sn||Ur,!Sn):Ys==null&&Ur&&Ur.ref!=null&&x5(Ur.ref,null,qa,Ur,!0)},Ve=(Ur,Sn,Hn,Qa)=>{if(Ur==null)u(Sn.el=ct(Sn.children),Hn,Qa);else{const Ha=Sn.el=Ur.el;Sn.children!==Ur.children&&St(Ha,Sn.children)}},kr=(Ur,Sn,Hn,Qa)=>{Ur==null?u(Sn.el=yt(Sn.children||""),Hn,Qa):Sn.el=Ur.el},It=(Ur,Sn,Hn,Qa)=>{[Ur.el,Ur.anchor]=we(Ur.children,Sn,Hn,Qa,Ur.el,Ur.anchor)},rn=({el:Ur,anchor:Sn},Hn,Qa)=>{let Ha;for(;Ur&&Ur!==Sn;)Ha=pe(Ur),u(Ur,Hn,Qa),Ur=Ha;u(Sn,Hn,Qa)},Lr=({el:Ur,anchor:Sn})=>{let Hn;for(;Ur&&Ur!==Sn;)Hn=pe(Ur),T(Ur),Ur=Hn;T(Sn)},Mr=(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es)=>{Sn.type==="svg"?Mo="svg":Sn.type==="math"&&(Mo="mathml"),Ur==null?tn(Sn,Hn,Qa,Ha,qa,Mo,Wo,es):Br(Ur,Sn,Ha,qa,Mo,Wo,es)},tn=(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo)=>{let es,Po;const{props:Ys,shapeFlag:Jo,transition:Ss,dirs:Us}=Ur;if(es=Ur.el=K(Ur.type,qa,Ys&&Ys.is,Ys),Jo&8?Ut(es,Ur.children):Jo&16&&Mn(Ur.children,es,null,Qa,Ha,k7(Ur,qa),Mo,Wo),Us&&sx(Ur,null,Qa,"created"),Dn(es,Ur,Ur.scopeId,Mo,Qa),Ys){for(const Ou in Ys)Ou!=="value"&&!g5(Ou)&&$(es,Ou,null,Ys[Ou],qa,Qa);"value"in Ys&&$(es,"value",null,Ys.value,qa),(Po=Ys.onVnodeBeforeMount)&&hv(Po,Qa,Ur)}Us&&sx(Ur,null,Qa,"beforeMount");const Ac=uat(Ha,Ss);Ac&&Ss.beforeEnter(es),u(es,Sn,Hn),((Po=Ys&&Ys.onVnodeMounted)||Ac||Us)&&em(()=>{Po&&hv(Po,Qa,Ur),Ac&&Ss.enter(es),Us&&sx(Ur,null,Qa,"mounted")},Ha)},Dn=(Ur,Sn,Hn,Qa,Ha)=>{if(Hn&&me(Ur,Hn),Qa)for(let qa=0;qa{for(let Po=es;Po{const Wo=Sn.el=Ur.el;let{patchFlag:es,dynamicChildren:Po,dirs:Ys}=Sn;es|=Ur.patchFlag&16;const Jo=Ur.props||Cd,Ss=Sn.props||Cd;let Us;if(Hn&&lx(Hn,!1),(Us=Ss.onVnodeBeforeUpdate)&&hv(Us,Hn,Sn,Ur),Ys&&sx(Sn,Ur,Hn,"beforeUpdate"),Hn&&lx(Hn,!0),(Jo.innerHTML&&Ss.innerHTML==null||Jo.textContent&&Ss.textContent==null)&&Ut(Wo,""),Po?Vn(Ur.dynamicChildren,Po,Wo,Hn,Qa,k7(Sn,Ha),qa):Mo||Xn(Ur,Sn,Wo,null,Hn,Qa,k7(Sn,Ha),qa,!1),es>0){if(es&16)on(Wo,Jo,Ss,Hn,Ha);else if(es&2&&Jo.class!==Ss.class&&$(Wo,"class",null,Ss.class,Ha),es&4&&$(Wo,"style",Jo.style,Ss.style,Ha),es&8){const Ac=Sn.dynamicProps;for(let Ou=0;Ou{Us&&hv(Us,Hn,Sn,Ur),Ys&&sx(Sn,Ur,Hn,"updated")},Qa)},Vn=(Ur,Sn,Hn,Qa,Ha,qa,Mo)=>{for(let Wo=0;Wo{if(Sn!==Hn){if(Sn!==Cd)for(const qa in Sn)!g5(qa)&&!(qa in Hn)&&$(Ur,qa,Sn[qa],null,Ha,Qa);for(const qa in Hn){if(g5(qa))continue;const Mo=Hn[qa],Wo=Sn[qa];Mo!==Wo&&qa!=="value"&&$(Ur,qa,Wo,Mo,Ha,Qa)}"value"in Hn&&$(Ur,"value",Sn.value,Hn.value,Ha)}},pr=(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es)=>{const Po=Sn.el=Ur?Ur.el:ct(""),Ys=Sn.anchor=Ur?Ur.anchor:ct("");let{patchFlag:Jo,dynamicChildren:Ss,slotScopeIds:Us}=Sn;Us&&(Wo=Wo?Wo.concat(Us):Us),Ur==null?(u(Po,Hn,Qa),u(Ys,Hn,Qa),Mn(Sn.children||[],Hn,Ys,Ha,qa,Mo,Wo,es)):Jo>0&&Jo&64&&Ss&&Ur.dynamicChildren?(Vn(Ur.dynamicChildren,Ss,Hn,Ha,qa,Mo,Wo),(Sn.key!=null||Ha&&Sn===Ha.subTree)&&EE(Ur,Sn,!0)):Xn(Ur,Sn,Hn,Ys,Ha,qa,Mo,Wo,es)},_r=(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es)=>{Sn.slotScopeIds=Wo,Ur==null?Sn.shapeFlag&512?Ha.ctx.activate(Sn,Hn,Qa,Mo,es):Sr(Sn,Hn,Qa,Ha,qa,Mo,es):Dr(Ur,Sn,es)},Sr=(Ur,Sn,Hn,Qa,Ha,qa,Mo)=>{const Wo=Ur.component=Mat(Ur,Qa,Ha);if(AS(Ur)&&(Wo.ctx.renderer=oo),Eat(Wo,!1,Mo),Wo.asyncDep){if(Ha&&Ha.registerDep(Wo,nn,Mo),!Ur.el){const es=Wo.subTree=Vs(am);kr(null,es,Sn,Hn),Ur.placeholder=es.el}}else nn(Wo,Ur,Sn,Hn,Ha,qa,Mo)},Dr=(Ur,Sn,Hn)=>{const Qa=Sn.component=Ur.component;if(_at(Ur,Sn,Hn))if(Qa.asyncDep&&!Qa.asyncResolved){Cn(Qa,Sn,Hn);return}else Qa.next=Sn,Qa.update();else Sn.el=Ur.el,Qa.vnode=Sn},nn=(Ur,Sn,Hn,Qa,Ha,qa,Mo)=>{const Wo=()=>{if(Ur.isMounted){let{next:Jo,bu:Ss,u:Us,parent:Ac,vnode:Ou}=Ur;{const lm=cU(Ur);if(lm){Jo&&(Jo.el=Ou.el,Cn(Ur,Jo,Mo)),lm.asyncDep.then(()=>{Ur.isUnmounted||Wo()});return}}let Bu=Jo,dp;lx(Ur,!1),Jo?(Jo.el=Ou.el,Cn(Ur,Jo,Mo)):Jo=Ou,Ss&&mT(Ss),(dp=Jo.props&&Jo.props.onVnodeBeforeUpdate)&&hv(dp,Ac,Jo,Ou),lx(Ur,!0);const Wf=qO(Ur),V0=Ur.subTree;Ur.subTree=Wf,Ce(V0,Wf,ne(V0.el),hi(V0),Ur,Ha,qa),Jo.el=Wf.el,Bu===null&&xat(Ur,Wf.el),Us&&em(Us,Ha),(dp=Jo.props&&Jo.props.onVnodeUpdated)&&em(()=>hv(dp,Ac,Jo,Ou),Ha)}else{let Jo;const{el:Ss,props:Us}=Sn,{bm:Ac,m:Ou,parent:Bu,root:dp,type:Wf}=Ur,V0=b5(Sn);lx(Ur,!1),Ac&&mT(Ac),!V0&&(Jo=Us&&Us.onVnodeBeforeMount)&&hv(Jo,Bu,Sn),lx(Ur,!0);{dp.ce&&dp.ce._def.shadowRoot!==!1&&dp.ce._injectChildStyle(Wf);const lm=Ur.subTree=qO(Ur);Ce(null,lm,Hn,Qa,Ur,Ha,qa),Sn.el=lm.el}if(Ou&&em(Ou,Ha),!V0&&(Jo=Us&&Us.onVnodeMounted)){const lm=Sn;em(()=>hv(Jo,Bu,lm),Ha)}(Sn.shapeFlag&256||Bu&&b5(Bu.vnode)&&Bu.vnode.shapeFlag&256)&&Ur.a&&em(Ur.a,Ha),Ur.isMounted=!0,Sn=Hn=Qa=null}};Ur.scope.on();const es=Ur.effect=new pj(Wo);Ur.scope.off();const Po=Ur.update=es.run.bind(es),Ys=Ur.job=es.runIfDirty.bind(es);Ys.i=Ur,Ys.id=Ur.uid,es.scheduler=()=>SE(Ys),lx(Ur,!0),Po()},Cn=(Ur,Sn,Hn)=>{Sn.component=Ur;const Qa=Ur.vnode.props;Ur.vnode=Sn,Ur.next=null,nat(Ur,Sn.props,Qa,Hn),sat(Ur,Sn.children,Hn),$1(),zO(Ur),H1()},Xn=(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es=!1)=>{const Po=Ur&&Ur.children,Ys=Ur?Ur.shapeFlag:0,Jo=Sn.children,{patchFlag:Ss,shapeFlag:Us}=Sn;if(Ss>0){if(Ss&128){ta(Po,Jo,Hn,Qa,Ha,qa,Mo,Wo,es);return}else if(Ss&256){_i(Po,Jo,Hn,Qa,Ha,qa,Mo,Wo,es);return}}Us&8?(Ys&16&&Yn(Po,Ha,qa),Jo!==Po&&Ut(Hn,Jo)):Ys&16?Us&16?ta(Po,Jo,Hn,Qa,Ha,qa,Mo,Wo,es):Yn(Po,Ha,qa,!0):(Ys&8&&Ut(Hn,""),Us&16&&Mn(Jo,Hn,Qa,Ha,qa,Mo,Wo,es))},_i=(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es)=>{Ur=Ur||L2,Sn=Sn||L2;const Po=Ur.length,Ys=Sn.length,Jo=Math.min(Po,Ys);let Ss;for(Ss=0;SsYs?Yn(Ur,Ha,qa,!0,!1,Jo):Mn(Sn,Hn,Qa,Ha,qa,Mo,Wo,es,Jo)},ta=(Ur,Sn,Hn,Qa,Ha,qa,Mo,Wo,es)=>{let Po=0;const Ys=Sn.length;let Jo=Ur.length-1,Ss=Ys-1;for(;Po<=Jo&&Po<=Ss;){const Us=Ur[Po],Ac=Sn[Po]=es?r_(Sn[Po]):kv(Sn[Po]);if(kx(Us,Ac))Ce(Us,Ac,Hn,null,Ha,qa,Mo,Wo,es);else break;Po++}for(;Po<=Jo&&Po<=Ss;){const Us=Ur[Jo],Ac=Sn[Ss]=es?r_(Sn[Ss]):kv(Sn[Ss]);if(kx(Us,Ac))Ce(Us,Ac,Hn,null,Ha,qa,Mo,Wo,es);else break;Jo--,Ss--}if(Po>Jo){if(Po<=Ss){const Us=Ss+1,Ac=UsSs)for(;Po<=Jo;)_a(Ur[Po],Ha,qa,!0),Po++;else{const Us=Po,Ac=Po,Ou=new Map;for(Po=Ac;Po<=Ss;Po++){const Np=Sn[Po]=es?r_(Sn[Po]):kv(Sn[Po]);Np.key!=null&&Ou.set(Np.key,Po)}let Bu,dp=0;const Wf=Ss-Ac+1;let V0=!1,lm=0;const Hg=new Array(Wf);for(Po=0;Po=Wf){_a(Np,Ha,qa,!0);continue}let cm;if(Np.key!=null)cm=Ou.get(Np.key);else for(Bu=Ac;Bu<=Ss;Bu++)if(Hg[Bu-Ac]===0&&kx(Np,Sn[Bu])){cm=Bu;break}cm===void 0?_a(Np,Ha,qa,!0):(Hg[cm-Ac]=Po+1,cm>=lm?lm=cm:V0=!0,Ce(Np,Sn[cm],Hn,null,Ha,qa,Mo,Wo,es),dp++)}const Y1=V0?hat(Hg):L2;for(Bu=Y1.length-1,Po=Wf-1;Po>=0;Po--){const Np=Ac+Po,cm=Sn[Np],Vg=Sn[Np+1],Yx=Np+1{const{el:qa,type:Mo,transition:Wo,children:es,shapeFlag:Po}=Ur;if(Po&6){va(Ur.component.subTree,Sn,Hn,Qa);return}if(Po&128){Ur.suspense.move(Sn,Hn,Qa);return}if(Po&64){Mo.move(Ur,Sn,Hn,oo);return}if(Mo===Es){u(qa,Sn,Hn);for(let Jo=0;JoWo.enter(qa),Ha);else{const{leave:Jo,delayLeave:Ss,afterLeave:Us}=Wo,Ac=()=>{Ur.ctx.isUnmounted?T(qa):u(qa,Sn,Hn)},Ou=()=>{Jo(qa,()=>{Ac(),Us&&Us()})};Ss?Ss(qa,Ac,Ou):Ou()}else u(qa,Sn,Hn)},_a=(Ur,Sn,Hn,Qa=!1,Ha=!1)=>{const{type:qa,props:Mo,ref:Wo,children:es,dynamicChildren:Po,shapeFlag:Ys,patchFlag:Jo,dirs:Ss,cacheIndex:Us}=Ur;if(Jo===-2&&(Ha=!1),Wo!=null&&($1(),x5(Wo,null,Hn,Ur,!0),H1()),Us!=null&&(Sn.renderCache[Us]=void 0),Ys&256){Sn.ctx.deactivate(Ur);return}const Ac=Ys&1&&Ss,Ou=!b5(Ur);let Bu;if(Ou&&(Bu=Mo&&Mo.onVnodeBeforeUnmount)&&hv(Bu,Sn,Ur),Ys&6)Xi(Ur.component,Hn,Qa);else{if(Ys&128){Ur.suspense.unmount(Hn,Qa);return}Ac&&sx(Ur,null,Sn,"beforeUnmount"),Ys&64?Ur.type.remove(Ur,Sn,Hn,oo,Qa):Po&&!Po.hasOnce&&(qa!==Es||Jo>0&&Jo&64)?Yn(Po,Sn,Hn,!1,!0):(qa===Es&&Jo&384||!Ha&&Ys&16)&&Yn(es,Sn,Hn),Qa&&qi(Ur)}(Ou&&(Bu=Mo&&Mo.onVnodeUnmounted)||Ac)&&em(()=>{Bu&&hv(Bu,Sn,Ur),Ac&&sx(Ur,null,Sn,"unmounted")},Hn)},qi=Ur=>{const{type:Sn,el:Hn,anchor:Qa,transition:Ha}=Ur;if(Sn===Es){Bi(Hn,Qa);return}if(Sn===yT){Lr(Ur);return}const qa=()=>{T(Hn),Ha&&!Ha.persisted&&Ha.afterLeave&&Ha.afterLeave()};if(Ur.shapeFlag&1&&Ha&&!Ha.persisted){const{leave:Mo,delayLeave:Wo}=Ha,es=()=>Mo(Hn,qa);Wo?Wo(Ur.el,qa,es):es()}else qa()},Bi=(Ur,Sn)=>{let Hn;for(;Ur!==Sn;)Hn=pe(Ur),T(Ur),Ur=Hn;T(Sn)},Xi=(Ur,Sn,Hn)=>{const{bum:Qa,scope:Ha,job:qa,subTree:Mo,um:Wo,m:es,a:Po,parent:Ys,slots:{__:Jo}}=Ur;WO(es),WO(Po),Qa&&mT(Qa),Ys&&pc(Jo)&&Jo.forEach(Ss=>{Ys.renderCache[Ss]=void 0}),Ha.stop(),qa&&(qa.flags|=8,_a(Mo,Ur,Sn,Hn)),Wo&&em(Wo,Sn),em(()=>{Ur.isUnmounted=!0},Sn),Sn&&Sn.pendingBranch&&!Sn.isUnmounted&&Ur.asyncDep&&!Ur.asyncResolved&&Ur.suspenseId===Sn.pendingId&&(Sn.deps--,Sn.deps===0&&Sn.resolve())},Yn=(Ur,Sn,Hn,Qa=!1,Ha=!1,qa=0)=>{for(let Mo=qa;Mo{if(Ur.shapeFlag&6)return hi(Ur.component.subTree);if(Ur.shapeFlag&128)return Ur.suspense.next();const Sn=pe(Ur.anchor||Ur.el),Hn=Sn&&Sn[Rj];return Hn?pe(Hn):Sn};let aa=!1;const io=(Ur,Sn,Hn)=>{Ur==null?Sn._vnode&&_a(Sn._vnode,null,null,!0):Ce(Sn._vnode||null,Ur,Sn,null,null,null,Hn),Sn._vnode=Ur,aa||(aa=!0,zO(),zj(),aa=!1)},oo={p:Ce,um:_a,m:va,r:qi,mt:Sr,mc:Mn,pc:Xn,pbc:Vn,n:hi,o:e};return{render:io,hydrate:void 0,createApp:tat(io)}}function k7({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function lx({effect:e,job:t},r){r?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function uat(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function EE(e,t,r=!1){const u=e.children,T=t.children;if(pc(u)&&pc(T))for(let $=0;$>1,e[r[ct]]0&&(t[u]=r[$-1]),r[$]=u)}}for($=r.length,K=r[$-1];$-- >0;)r[$]=K,K=t[K];return r}function cU(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:cU(t)}function WO(e){if(e)for(let t=0;t_g(dat);function Fh(e,t,r){return uU(e,t,r)}function uU(e,t,r=Cd){const{immediate:u,deep:T,flush:$,once:K}=r,ct=Rp({},r),yt=t&&u||!t&&$!=="post";let St;if(N5){if($==="sync"){const me=fat();St=me.__watcherHandles||(me.__watcherHandles=[])}else if(!yt){const me=()=>{};return me.stop=Ev,me.resume=Ev,me.pause=Ev,me}}const Ut=R0;ct.call=(me,we,Ce)=>Ng(me,Ut,we,Ce);let ne=!1;$==="post"?ct.scheduler=me=>{em(me,Ut&&Ut.suspense)}:$!=="sync"&&(ne=!0,ct.scheduler=(me,we)=>{we?me():SE(me)}),ct.augmentJob=me=>{t&&(me.flags|=4),ne&&(me.flags|=2,Ut&&(me.id=Ut.uid,me.i=Ut))};const pe=Pit(e,t,ct);return N5&&(St?St.push(pe):yt&&pe()),pe}function pat(e,t,r){const u=this.proxy,T=Af(e)?e.includes(".")?hU(u,e):()=>u[e]:e.bind(u,u);let $;Xc(t)?$=t:($=t.handler,r=t);const K=r4(this),ct=uU(T,$.bind(u),r);return K(),ct}function hU(e,t){const r=t.split(".");return()=>{let u=e;for(let T=0;Tt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wg(t)}Modifiers`]||e[`${b_(t)}Modifiers`];function gat(e,t,...r){if(e.isUnmounted)return;const u=e.vnode.props||Cd;let T=r;const $=t.startsWith("update:"),K=$&&mat(u,t.slice(7));K&&(K.trim&&(T=r.map(Ut=>Af(Ut)?Ut.trim():Ut)),K.number&&(T=r.map(NT)));let ct,yt=u[ct=g7(t)]||u[ct=g7(wg(t))];!yt&&$&&(yt=u[ct=g7(b_(t))]),yt&&Ng(yt,e,6,T);const St=u[ct+"Once"];if(St){if(!e.emitted)e.emitted={};else if(e.emitted[ct])return;e.emitted[ct]=!0,Ng(St,e,6,T)}}function dU(e,t,r=!1){const u=t.emitsCache,T=u.get(e);if(T!==void 0)return T;const $=e.emits;let K={},ct=!1;if(!Xc(e)){const yt=St=>{const Ut=dU(St,t,!0);Ut&&(ct=!0,Rp(K,Ut))};!r&&t.mixins.length&&t.mixins.forEach(yt),e.extends&&yt(e.extends),e.mixins&&e.mixins.forEach(yt)}return!$&&!ct?(Ad(e)&&u.set(e,null),null):(pc($)?$.forEach(yt=>K[yt]=null):Rp(K,$),Ad(e)&&u.set(e,K),K)}function LS(e,t){return!e||!_S(t)?!1:(t=t.slice(2).replace(/Once$/,""),Yh(e,t[0].toLowerCase()+t.slice(1))||Yh(e,b_(t))||Yh(e,t))}function qO(e){const{type:t,vnode:r,proxy:u,withProxy:T,propsOptions:[$],slots:K,attrs:ct,emit:yt,render:St,renderCache:Ut,props:ne,data:pe,setupState:me,ctx:we,inheritAttrs:Ce}=e,Ve=VT(e);let kr,It;try{if(r.shapeFlag&4){const Lr=T||u,Mr=Lr;kr=kv(St.call(Mr,Lr,Ut,ne,me,pe,we)),It=ct}else{const Lr=t;kr=kv(Lr.length>1?Lr(ne,{attrs:ct,slots:K,emit:yt}):Lr(ne,null)),It=t.props?ct:vat(ct)}}catch(Lr){k5.length=0,SS(Lr,e,1),kr=Vs(am)}let rn=kr;if(It&&Ce!==!1){const Lr=Object.keys(It),{shapeFlag:Mr}=rn;Lr.length&&Mr&7&&($&&Lr.some(mE)&&(It=yat(It,$)),rn=y_(rn,It,!1,!0))}return r.dirs&&(rn=y_(rn,null,!1,!0),rn.dirs=rn.dirs?rn.dirs.concat(r.dirs):r.dirs),r.transition&&Nx(rn,r.transition),kr=rn,VT(Ve),kr}const vat=e=>{let t;for(const r in e)(r==="class"||r==="style"||_S(r))&&((t||(t={}))[r]=e[r]);return t},yat=(e,t)=>{const r={};for(const u in e)(!mE(u)||!(u.slice(9)in t))&&(r[u]=e[u]);return r};function _at(e,t,r){const{props:u,children:T,component:$}=e,{props:K,children:ct,patchFlag:yt}=t,St=$.emitsOptions;if(t.dirs||t.transition)return!0;if(r&&yt>=0){if(yt&1024)return!0;if(yt&16)return u?GO(u,K,St):!!K;if(yt&8){const Ut=t.dynamicProps;for(let ne=0;nee.__isSuspense;function bat(e,t){t&&t.pendingBranch?pc(e)?t.effects.push(...e):t.effects.push(e):zit(e)}const Es=Symbol.for("v-fgt"),PS=Symbol.for("v-txt"),am=Symbol.for("v-cmt"),yT=Symbol.for("v-stc"),k5=[];let Km=null;function Or(e=!1){k5.push(Km=e?null:[])}function wat(){k5.pop(),Km=k5[k5.length-1]||null}let F5=1;function ZO(e,t=!1){F5+=e,e<0&&Km&&t&&(Km.hasOnce=!0)}function pU(e){return e.dynamicChildren=F5>0?Km||L2:null,wat(),F5>0&&Km&&Km.push(e),e}function Nr(e,t,r,u,T,$){return pU(At(e,t,r,u,T,$,!0))}function w0(e,t,r,u,T){return pU(Vs(e,t,r,u,T,!0))}function qT(e){return e?e.__v_isVNode===!0:!1}function kx(e,t){return e.type===t.type&&e.key===t.key}const mU=({key:e})=>e??null,_T=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?Af(e)||hp(e)||Xc(e)?{i:Zm,r:e,k:t,f:!!r}:e:null);function At(e,t=null,r=null,u=0,T=null,$=e===Es?0:1,K=!1,ct=!1){const yt={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mU(t),ref:t&&_T(t),scopeId:Bj,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:$,patchFlag:u,dynamicProps:T,dynamicChildren:null,appContext:null,ctx:Zm};return ct?(LE(yt,r),$&128&&e.normalize(yt)):r&&(yt.shapeFlag|=Af(r)?8:16),F5>0&&!K&&Km&&(yt.patchFlag>0||$&6)&&yt.patchFlag!==32&&Km.push(yt),yt}const Vs=kat;function kat(e,t=null,r=null,u=0,T=null,$=!1){if((!e||e===Yj)&&(e=am),qT(e)){const ct=y_(e,t,!0);return r&&LE(ct,r),F5>0&&!$&&Km&&(ct.shapeFlag&6?Km[Km.indexOf(e)]=ct:Km.push(ct)),ct.patchFlag=-2,ct}if(zat(e)&&(e=e.__vccOpts),t){t=Tat(t);let{class:ct,style:yt}=t;ct&&!Af(ct)&&(t.class=ja(ct)),Ad(yt)&&(TE(yt)&&!pc(yt)&&(yt=Rp({},yt)),t.style=Sp(yt))}const K=Af(e)?1:fU(e)?128:Fj(e)?64:Ad(e)?4:Xc(e)?2:0;return At(e,t,r,u,T,K,$,!0)}function Tat(e){return e?TE(e)||nU(e)?Rp({},e):e:null}function y_(e,t,r=!1,u=!1){const{props:T,ref:$,patchFlag:K,children:ct,transition:yt}=e,St=t?Sat(T||{},t):T,Ut={__v_isVNode:!0,__v_skip:!0,type:e.type,props:St,key:St&&mU(St),ref:t&&t.ref?r&&$?pc($)?$.concat(_T(t)):[$,_T(t)]:_T(t):$,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ct,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Es?K===-1?16:K|16:K,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:yt,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&y_(e.ssContent),ssFallback:e.ssFallback&&y_(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return yt&&u&&Nx(Ut,yt.clone(Ut)),Ut}function cl(e=" ",t=0){return Vs(PS,null,e,t)}function Du(e,t){const r=Vs(yT,null,e);return r.staticCount=t,r}function Ta(e="",t=!1){return t?(Or(),w0(am,null,e)):Vs(am,null,e)}function kv(e){return e==null||typeof e=="boolean"?Vs(am):pc(e)?Vs(Es,null,e.slice()):qT(e)?r_(e):Vs(PS,null,String(e))}function r_(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:y_(e)}function LE(e,t){let r=0;const{shapeFlag:u}=e;if(t==null)t=null;else if(pc(t))r=16;else if(typeof t=="object")if(u&65){const T=t.default;T&&(T._c&&(T._d=!1),LE(e,T()),T._c&&(T._d=!0));return}else{r=32;const T=t._;!T&&!nU(t)?t._ctx=Zm:T===3&&Zm&&(Zm.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Xc(t)?(t={default:t,_ctx:Zm},r=32):(t=String(t),u&64?(r=16,t=[cl(t)]):r=8);e.children=t,e.shapeFlag|=r}function Sat(...e){const t={};for(let r=0;rR0||Zm;let GT,WM;{const e=kS(),t=(r,u)=>{let T;return(T=e[r])||(T=e[r]=[]),T.push(u),$=>{T.length>1?T.forEach(K=>K($)):T[0]($)}};GT=t("__VUE_INSTANCE_SETTERS__",r=>R0=r),WM=t("__VUE_SSR_SETTERS__",r=>N5=r)}const r4=e=>{const t=R0;return GT(e),e.scope.on(),()=>{e.scope.off(),GT(t)}},KO=()=>{R0&&R0.scope.off(),GT(null)};function gU(e){return e.vnode.shapeFlag&4}let N5=!1;function Eat(e,t=!1,r=!1){t&&WM(t);const{props:u,children:T}=e.vnode,$=gU(e);rat(e,u,$,t),oat(e,T,r||t);const K=$?Lat(e,t):void 0;return t&&WM(!1),K}function Lat(e,t){const r=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Git);const{setup:u}=r;if(u){$1();const T=e.setupContext=u.length>1?Iat(e):null,$=r4(e),K=e4(u,e,0,[e.props,T]),ct=aj(K);if(H1(),$(),(ct||e.sp)&&!b5(e)&&qj(e),ct){if(K.then(KO,KO),t)return K.then(yt=>{YO(e,yt)}).catch(yt=>{SS(yt,e,0)});e.asyncDep=K}else YO(e,K)}else vU(e)}function YO(e,t,r){Xc(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ad(t)&&(e.setupState=Pj(t)),vU(e)}function vU(e,t,r){const u=e.type;e.render||(e.render=u.render||Ev);{const T=r4(e);$1();try{Zit(e)}finally{H1(),T()}}}const Pat={get(e,t){return B0(e,"get",""),e[t]}};function Iat(e){const t=r=>{e.exposed=r||{}};return{attrs:new Proxy(e.attrs,Pat),slots:e.slots,emit:e.emit,expose:t}}function DS(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Pj(j1(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in w5)return w5[r](e)},has(t,r){return r in t||r in w5}})):e.proxy}function Dat(e,t=!0){return Xc(e)?e.displayName||e.name:e.name||t&&e.__name}function zat(e){return Xc(e)&&"__vccOpts"in e}const Ao=(e,t)=>Eit(e,t,N5);function PE(e,t,r){const u=arguments.length;return u===2?Ad(t)&&!pc(t)?qT(t)?Vs(e,null,[t]):Vs(e,t):Vs(e,null,t):(u>3?r=Array.prototype.slice.call(arguments,2):u===3&&qT(r)&&(r=[r]),Vs(e,t,r))}const Oat="3.5.18";/** +**/function e4(e,t,r,u){try{return u?e(...u):e()}catch(T){SS(T,t,r)}}function Ng(e,t,r,u){if(Xc(e)){const T=e4(e,t,r,u);return T&&aj(T)&&T.catch($=>{SS($,t,r)}),T}if(pc(e)){const T=[];for(let $=0;$>>1,T=nm[u],$=B5(T);$=B5(r)?nm.push(e):nm.splice(Dit(t),0,e),e.flags|=1,Dj()}}function Dj(){HT||(HT=Ij.then(Oj))}function zit(e){pc(e)?I2.push(...e):t_&&e.id===-1?t_.splice(k2+1,0,e):e.flags&1||(I2.push(e),e.flags|=1),Dj()}function zO(e,t,r=xv+1){for(;rB5(r)-B5(u));if(I2.length=0,t_){t_.push(...t);return}for(t_=t,k2=0;k2e.id==null?e.flags&2?-1:1/0:e.id;function Oj(e){try{for(xv=0;xv{u._d&&ZO(-1);const $=VT(t);let K;try{K=e(...T)}finally{VT($),u._d&&ZO(1)}return K};return u._n=!0,u._c=!0,u._d=!0,u}function Ml(e,t){if(Zm===null)return e;const r=DS(Zm),u=e.dirs||(e.dirs=[]);for(let T=0;Te.__isTeleport,_5=e=>e&&(e.disabled||e.disabled===""),OO=e=>e&&(e.defer||e.defer===""),BO=e=>typeof SVGElement<"u"&&e instanceof SVGElement,RO=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,jM=(e,t)=>{const r=e&&e.to;return Af(r)?t?t(r):null:r},Nj={name:"Teleport",__isTeleport:!0,process(e,t,r,u,T,$,K,ct,yt,St){const{mc:Ut,pc:ne,pbc:pe,o:{insert:me,querySelector:we,createText:Ce,createComment:Ve}}=St,kr=_5(t.props);let{shapeFlag:It,children:rn,dynamicChildren:Lr}=t;if(e==null){const Mr=t.el=Ce(""),tn=t.anchor=Ce("");me(Mr,r,u),me(tn,r,u);const Dn=(Br,Vn)=>{It&16&&(T&&T.isCE&&(T.ce._teleportTarget=Br),Ut(rn,Br,Vn,T,$,K,ct,yt))},Mn=()=>{const Br=t.target=jM(t.props,we),Vn=jj(Br,t,Ce,me);Br&&(K!=="svg"&&BO(Br)?K="svg":K!=="mathml"&&RO(Br)&&(K="mathml"),kr||(Dn(Br,Vn),gT(t,!1)))};kr&&(Dn(r,tn),gT(t,!0)),OO(t.props)?(t.el.__isMounted=!1,em(()=>{Mn(),delete t.el.__isMounted},$)):Mn()}else{if(OO(t.props)&&e.el.__isMounted===!1){em(()=>{Nj.process(e,t,r,u,T,$,K,ct,yt,St)},$);return}t.el=e.el,t.targetStart=e.targetStart;const Mr=t.anchor=e.anchor,tn=t.target=e.target,Dn=t.targetAnchor=e.targetAnchor,Mn=_5(e.props),Br=Mn?r:tn,Vn=Mn?Mr:Dn;if(K==="svg"||BO(tn)?K="svg":(K==="mathml"||RO(tn))&&(K="mathml"),Lr?(pe(e.dynamicChildren,Lr,Br,T,$,K,ct),EE(e,t,!0)):yt||ne(e,t,Br,Vn,T,$,K,ct,!1),kr)Mn?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):O6(t,r,Mr,St,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const on=t.target=jM(t.props,we);on&&O6(t,on,null,St,0)}else Mn&&O6(t,tn,Dn,St,1);gT(t,kr)}},remove(e,t,r,{um:u,o:{remove:T}},$){const{shapeFlag:K,children:ct,anchor:yt,targetStart:St,targetAnchor:Ut,target:ne,props:pe}=e;if(ne&&(T(St),T(Ut)),$&&T(yt),K&16){const me=$||!_5(pe);for(let we=0;we{e.isMounted=!0}),Tg(()=>{e.isUnmounting=!0}),e}const sg=[Function,Array],$j={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:sg,onEnter:sg,onAfterEnter:sg,onEnterCancelled:sg,onBeforeLeave:sg,onLeave:sg,onAfterLeave:sg,onLeaveCancelled:sg,onBeforeAppear:sg,onAppear:sg,onAfterAppear:sg,onAppearCancelled:sg},Hj=e=>{const t=e.subTree;return t.component?Hj(t.component):t},Bit={name:"BaseTransition",props:$j,setup(e,{slots:t}){const r=IS(),u=Uj();return()=>{const T=t.default&&CE(t.default(),!0);if(!T||!T.length)return;const $=Vj(T),K=ru(e),{mode:ct}=K;if(u.isLeaving)return b7($);const yt=FO($);if(!yt)return b7($);let St=R5(yt,K,u,r,ne=>St=ne);yt.type!==am&&jx(yt,St);let Ut=r.subTree&&FO(r.subTree);if(Ut&&Ut.type!==am&&!kx(yt,Ut)&&Hj(r).type!==am){let ne=R5(Ut,K,u,r);if(jx(Ut,ne),ct==="out-in"&&yt.type!==am)return u.isLeaving=!0,ne.afterLeave=()=>{u.isLeaving=!1,r.job.flags&8||r.update(),delete ne.afterLeave,Ut=void 0},b7($);ct==="in-out"&&yt.type!==am?ne.delayLeave=(pe,me,we)=>{const Ce=Wj(u,Ut);Ce[String(Ut.key)]=Ut,pe[e_]=()=>{me(),pe[e_]=void 0,delete St.delayedLeave,Ut=void 0},St.delayedLeave=()=>{we(),delete St.delayedLeave,Ut=void 0}}:Ut=void 0}else Ut&&(Ut=void 0);return $}}};function Vj(e){let t=e[0];if(e.length>1){for(const r of e)if(r.type!==am){t=r;break}}return t}const Rit=Bit;function Wj(e,t){const{leavingVNodes:r}=e;let u=r.get(t.type);return u||(u=Object.create(null),r.set(t.type,u)),u}function R5(e,t,r,u,T){const{appear:$,mode:K,persisted:ct=!1,onBeforeEnter:yt,onEnter:St,onAfterEnter:Ut,onEnterCancelled:ne,onBeforeLeave:pe,onLeave:me,onAfterLeave:we,onLeaveCancelled:Ce,onBeforeAppear:Ve,onAppear:kr,onAfterAppear:It,onAppearCancelled:rn}=t,Lr=String(e.key),Mr=Wj(r,e),tn=(Br,Vn)=>{Br&&Ng(Br,u,9,Vn)},Dn=(Br,Vn)=>{const on=Vn[1];tn(Br,Vn),pc(Br)?Br.every(pr=>pr.length<=1)&&on():Br.length<=1&&on()},Mn={mode:K,persisted:ct,beforeEnter(Br){let Vn=yt;if(!r.isMounted)if($)Vn=Ve||yt;else return;Br[e_]&&Br[e_](!0);const on=Mr[Lr];on&&kx(e,on)&&on.el[e_]&&on.el[e_](),tn(Vn,[Br])},enter(Br){let Vn=St,on=Ut,pr=ne;if(!r.isMounted)if($)Vn=kr||St,on=It||Ut,pr=rn||ne;else return;let _r=!1;const Sr=Br[B6]=Dr=>{_r||(_r=!0,Dr?tn(pr,[Br]):tn(on,[Br]),Mn.delayedLeave&&Mn.delayedLeave(),Br[B6]=void 0)};Vn?Dn(Vn,[Br,Sr]):Sr()},leave(Br,Vn){const on=String(e.key);if(Br[B6]&&Br[B6](!0),r.isUnmounting)return Vn();tn(pe,[Br]);let pr=!1;const _r=Br[e_]=Sr=>{pr||(pr=!0,Vn(),Sr?tn(Ce,[Br]):tn(we,[Br]),Br[e_]=void 0,Mr[on]===e&&delete Mr[on])};Mr[on]=e,me?Dn(me,[Br,_r]):_r()},clone(Br){const Vn=R5(Br,t,r,u,T);return T&&T(Vn),Vn}};return Mn}function b7(e){if(AS(e))return e=y_(e),e.children=null,e}function FO(e){if(!AS(e))return Fj(e.type)&&e.children?Vj(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:r}=e;if(r){if(t&16)return r[0];if(t&32&&Xc(r.default))return r.default()}}function jx(e,t){e.shapeFlag&6&&e.component?(e.transition=t,jx(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function CE(e,t=!1,r){let u=[],T=0;for(let $=0;$1)for(let $=0;$x5(we,t&&(pc(t)?t[Ce]:t),r,u,T));return}if(b5(u)&&!T){u.shapeFlag&512&&u.type.__asyncResolved&&u.component.subTree.component&&x5(e,t,r,u.component.subTree);return}const $=u.shapeFlag&4?DS(u.component):u.el,K=T?null:$,{i:ct,r:yt}=e,St=t&&t.r,Ut=ct.refs===Cd?ct.refs={}:ct.refs,ne=ct.setupState,pe=ru(ne),me=ne===Cd?()=>!1:we=>Yh(pe,we);if(St!=null&&St!==yt&&(Af(St)?(Ut[St]=null,me(St)&&(ne[St]=null)):hp(St)&&(St.value=null)),Xc(yt))e4(yt,ct,12,[K,Ut]);else{const we=Af(yt),Ce=hp(yt);if(we||Ce){const Ve=()=>{if(e.f){const kr=we?me(yt)?ne[yt]:Ut[yt]:yt.value;T?pc(kr)&&gE(kr,$):pc(kr)?kr.includes($)||kr.push($):we?(Ut[yt]=[$],me(yt)&&(ne[yt]=Ut[yt])):(yt.value=[$],e.k&&(Ut[e.k]=yt.value))}else we?(Ut[yt]=K,me(yt)&&(ne[yt]=K)):Ce&&(yt.value=K,e.k&&(Ut[e.k]=K))};K?(Ve.id=-1,em(Ve,r)):Ve()}}}kS().requestIdleCallback;kS().cancelIdleCallback;const b5=e=>!!e.type.__asyncLoader,AS=e=>e.type.__isKeepAlive;function Fit(e,t){Gj(e,"a",t)}function Nit(e,t){Gj(e,"da",t)}function Gj(e,t,r=R0){const u=e.__wdc||(e.__wdc=()=>{let T=r;for(;T;){if(T.isDeactivated)return;T=T.parent}return e()});if(MS(t,u,r),r){let T=r.parent;for(;T&&T.parent;)AS(T.parent.vnode)&&jit(u,t,r,T),T=T.parent}}function jit(e,t,r,u){const T=MS(t,e,u,!0);Dv(()=>{gE(u[t],T)},r)}function MS(e,t,r=R0,u=!1){if(r){const T=r[e]||(r[e]=[]),$=t.__weh||(t.__weh=(...K)=>{$1();const ct=r4(r),yt=Ng(t,r,e,K);return ct(),H1(),yt});return u?T.unshift($):T.push($),$}}const q1=e=>(t,r=R0)=>{(!N5||e==="sp")&&MS(e,(...u)=>t(...u),r)},Uit=q1("bm"),Xd=q1("m"),$it=q1("bu"),Zj=q1("u"),Tg=q1("bum"),Dv=q1("um"),Hit=q1("sp"),Vit=q1("rtg"),Wit=q1("rtc");function qit(e,t=R0){MS("ec",e,t)}const Kj="components";function ES(e,t){return Xj(Kj,e,!0,t)||e}const Yj=Symbol.for("v-ndc");function s_(e){return Af(e)?Xj(Kj,e,!1)||e:e||Yj}function Xj(e,t,r=!0,u=!1){const T=Zm||R0;if(T){const $=T.type;{const ct=Dat($,!1);if(ct&&(ct===t||ct===wg(t)||ct===wS(wg(t))))return $}const K=NO(T[e]||$[e],t)||NO(T.appContext[e],t);return!K&&u?$:K}}function NO(e,t){return e&&(e[t]||e[wg(t)]||e[wS(wg(t))])}function jl(e,t,r,u){let T;const $=r,K=pc(e);if(K||Af(e)){const ct=K&&f_(e);let yt=!1,St=!1;ct&&(yt=!yg(e),St=v_(e),e=TS(e)),T=new Array(e.length);for(let Ut=0,ne=e.length;Utt(ct,yt,void 0,$));else{const ct=Object.keys(e);T=new Array(ct.length);for(let yt=0,St=ct.length;yte?gU(e)?DS(e):UM(e.parent):null,w5=Rp(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>UM(e.parent),$root:e=>UM(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Qj(e),$forceUpdate:e=>e.f||(e.f=()=>{SE(e.update)}),$nextTick:e=>e.n||(e.n=sp.bind(e.proxy)),$watch:e=>pat.bind(e)}),w7=(e,t)=>e!==Cd&&!e.__isScriptSetup&&Yh(e,t),Git={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:r,setupState:u,data:T,props:$,accessCache:K,type:ct,appContext:yt}=e;let St;if(t[0]!=="$"){const me=K[t];if(me!==void 0)switch(me){case 1:return u[t];case 2:return T[t];case 4:return r[t];case 3:return $[t]}else{if(w7(u,t))return K[t]=1,u[t];if(T!==Cd&&Yh(T,t))return K[t]=2,T[t];if((St=e.propsOptions[0])&&Yh(St,t))return K[t]=3,$[t];if(r!==Cd&&Yh(r,t))return K[t]=4,r[t];$M&&(K[t]=0)}}const Ut=w5[t];let ne,pe;if(Ut)return t==="$attrs"&&B0(e.attrs,"get",""),Ut(e);if((ne=ct.__cssModules)&&(ne=ne[t]))return ne;if(r!==Cd&&Yh(r,t))return K[t]=4,r[t];if(pe=yt.config.globalProperties,Yh(pe,t))return pe[t]},set({_:e},t,r){const{data:u,setupState:T,ctx:$}=e;return w7(T,t)?(T[t]=r,!0):u!==Cd&&Yh(u,t)?(u[t]=r,!0):Yh(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:($[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:u,appContext:T,propsOptions:$}},K){let ct;return!!r[K]||e!==Cd&&Yh(e,K)||w7(t,K)||(ct=$[0])&&Yh(ct,K)||Yh(u,K)||Yh(w5,K)||Yh(T.config.globalProperties,K)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:Yh(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};function jO(e){return pc(e)?e.reduce((t,r)=>(t[r]=null,t),{}):e}let $M=!0;function Zit(e){const t=Qj(e),r=e.proxy,u=e.ctx;$M=!1,t.beforeCreate&&UO(t.beforeCreate,e,"bc");const{data:T,computed:$,methods:K,watch:ct,provide:yt,inject:St,created:Ut,beforeMount:ne,mounted:pe,beforeUpdate:me,updated:we,activated:Ce,deactivated:Ve,beforeDestroy:kr,beforeUnmount:It,destroyed:rn,unmounted:Lr,render:Mr,renderTracked:tn,renderTriggered:Dn,errorCaptured:Mn,serverPrefetch:Br,expose:Vn,inheritAttrs:on,components:pr,directives:_r,filters:Sr}=t;if(St&&Kit(St,u,null),K)for(const Cn in K){const Xn=K[Cn];Xc(Xn)&&(u[Cn]=Xn.bind(r))}if(T){const Cn=T.call(r,r);Ad(Cn)&&(e.data=g_(Cn))}if($M=!0,$)for(const Cn in $){const Xn=$[Cn],_i=Xc(Xn)?Xn.bind(r,r):Xc(Xn.get)?Xn.get.bind(r,r):Ev,ta=!Xc(Xn)&&Xc(Xn.set)?Xn.set.bind(r):Ev,va=Ao({get:_i,set:ta});Object.defineProperty(u,Cn,{enumerable:!0,configurable:!0,get:()=>va.value,set:_a=>va.value=_a})}if(ct)for(const Cn in ct)Jj(ct[Cn],u,r,Cn);if(yt){const Cn=Xc(yt)?yt.call(r):yt;Reflect.ownKeys(Cn).forEach(Xn=>{vT(Xn,Cn[Xn])})}Ut&&UO(Ut,e,"c");function nn(Cn,Xn){pc(Xn)?Xn.forEach(_i=>Cn(_i.bind(r))):Xn&&Cn(Xn.bind(r))}if(nn(Uit,ne),nn(Xd,pe),nn($it,me),nn(Zj,we),nn(Fit,Ce),nn(Nit,Ve),nn(qit,Mn),nn(Wit,tn),nn(Vit,Dn),nn(Tg,It),nn(Dv,Lr),nn(Hit,Br),pc(Vn))if(Vn.length){const Cn=e.exposed||(e.exposed={});Vn.forEach(Xn=>{Object.defineProperty(Cn,Xn,{get:()=>r[Xn],set:_i=>r[Xn]=_i,enumerable:!0})})}else e.exposed||(e.exposed={});Mr&&e.render===Ev&&(e.render=Mr),on!=null&&(e.inheritAttrs=on),pr&&(e.components=pr),_r&&(e.directives=_r),Br&&qj(e)}function Kit(e,t,r=Ev){pc(e)&&(e=HM(e));for(const u in e){const T=e[u];let $;Ad(T)?"default"in T?$=_g(T.from||u,T.default,!0):$=_g(T.from||u):$=_g(T),hp($)?Object.defineProperty(t,u,{enumerable:!0,configurable:!0,get:()=>$.value,set:K=>$.value=K}):t[u]=$}}function UO(e,t,r){Ng(pc(e)?e.map(u=>u.bind(t.proxy)):e.bind(t.proxy),t,r)}function Jj(e,t,r,u){let T=u.includes(".")?hU(r,u):()=>r[u];if(Af(e)){const $=t[e];Xc($)&&Fh(T,$)}else if(Xc(e))Fh(T,e.bind(r));else if(Ad(e))if(pc(e))e.forEach($=>Jj($,t,r,u));else{const $=Xc(e.handler)?e.handler.bind(r):t[e.handler];Xc($)&&Fh(T,$,e)}}function Qj(e){const t=e.type,{mixins:r,extends:u}=t,{mixins:T,optionsCache:$,config:{optionMergeStrategies:K}}=e.appContext,ct=$.get(t);let yt;return ct?yt=ct:!T.length&&!r&&!u?yt=t:(yt={},T.length&&T.forEach(St=>WT(yt,St,K,!0)),WT(yt,t,K)),Ad(t)&&$.set(t,yt),yt}function WT(e,t,r,u=!1){const{mixins:T,extends:$}=t;$&&WT(e,$,r,!0),T&&T.forEach(K=>WT(e,K,r,!0));for(const K in t)if(!(u&&K==="expose")){const ct=Yit[K]||r&&r[K];e[K]=ct?ct(e[K],t[K]):t[K]}return e}const Yit={data:$O,props:HO,emits:HO,methods:a5,computed:a5,beforeCreate:J0,created:J0,beforeMount:J0,mounted:J0,beforeUpdate:J0,updated:J0,beforeDestroy:J0,beforeUnmount:J0,destroyed:J0,unmounted:J0,activated:J0,deactivated:J0,errorCaptured:J0,serverPrefetch:J0,components:a5,directives:a5,watch:Jit,provide:$O,inject:Xit};function $O(e,t){return t?e?function(){return Rp(Xc(e)?e.call(this,this):e,Xc(t)?t.call(this,this):t)}:t:e}function Xit(e,t){return a5(HM(e),HM(t))}function HM(e){if(pc(e)){const t={};for(let r=0;r1)return r&&Xc(t)?t.call(u&&u.proxy):t}}function eat(){return!!(IS()||Dx)}const eU={},rU=()=>Object.create(eU),nU=e=>Object.getPrototypeOf(e)===eU;function rat(e,t,r,u=!1){const T={},$=rU();e.propsDefaults=Object.create(null),iU(e,t,T,$);for(const K in e.propsOptions[0])K in T||(T[K]=void 0);r?e.props=u?T:Mj(T):e.type.props?e.props=T:e.props=$,e.attrs=$}function nat(e,t,r,u){const{props:T,attrs:$,vnode:{patchFlag:K}}=e,ct=ru(T),[yt]=e.propsOptions;let St=!1;if((u||K>0)&&!(K&16)){if(K&8){const Ut=e.vnode.dynamicProps;for(let ne=0;ne{yt=!0;const[pe,me]=aU(ne,t,!0);Rp(K,pe),me&&ct.push(...me)};!r&&t.mixins.length&&t.mixins.forEach(Ut),e.extends&&Ut(e.extends),e.mixins&&e.mixins.forEach(Ut)}if(!$&&!yt)return Ad(e)&&u.set(e,L2),L2;if(pc($))for(let Ut=0;Ut<$.length;Ut++){const ne=wg($[Ut]);VO(ne)&&(K[ne]=Cd)}else if($)for(const Ut in $){const ne=wg(Ut);if(VO(ne)){const pe=$[Ut],me=K[ne]=pc(pe)||Xc(pe)?{type:pe}:Rp({},pe),we=me.type;let Ce=!1,Ve=!0;if(pc(we))for(let kr=0;kre==="_"||e==="__"||e==="_ctx"||e==="$stable",ME=e=>pc(e)?e.map(kv):[kv(e)],aat=(e,t,r)=>{if(t._n)return t;const u=V1((...T)=>ME(t(...T)),r);return u._c=!1,u},oU=(e,t,r)=>{const u=e._ctx;for(const T in e){if(AE(T))continue;const $=e[T];if(Xc($))t[T]=aat(T,$,u);else if($!=null){const K=ME($);t[T]=()=>K}}},sU=(e,t)=>{const r=ME(t);e.slots.default=()=>r},lU=(e,t,r)=>{for(const u in t)(r||!AE(u))&&(e[u]=t[u])},oat=(e,t,r)=>{const u=e.slots=rU();if(e.vnode.shapeFlag&32){const T=t.__;T&&BM(u,"__",T,!0);const $=t._;$?(lU(u,t,r),r&&BM(u,"_",$,!0)):oU(t,u)}else t&&sU(e,t)},sat=(e,t,r)=>{const{vnode:u,slots:T}=e;let $=!0,K=Cd;if(u.shapeFlag&32){const ct=t._;ct?r&&ct===1?$=!1:lU(T,t,r):($=!t.$stable,oU(t,T)),K=t}else t&&(sU(e,t),K={default:1});if($)for(const ct in T)!AE(ct)&&K[ct]==null&&delete T[ct]},em=bat;function lat(e){return cat(e)}function cat(e,t){const r=kS();r.__VUE__=!0;const{insert:u,remove:T,patchProp:$,createElement:K,createText:ct,createComment:yt,setText:St,setElementText:Ut,parentNode:ne,nextSibling:pe,setScopeId:me=Ev,insertStaticContent:we}=e,Ce=(Ur,Sn,Hn,to=null,Ha=null,qa=null,Mo=void 0,Wo=null,es=!!Sn.dynamicChildren)=>{if(Ur===Sn)return;Ur&&!kx(Ur,Sn)&&(to=hi(Ur),_a(Ur,Ha,qa,!0),Ur=null),Sn.patchFlag===-2&&(es=!1,Sn.dynamicChildren=null);const{type:Io,ref:Ys,shapeFlag:Jo}=Sn;switch(Io){case PS:Ve(Ur,Sn,Hn,to);break;case am:kr(Ur,Sn,Hn,to);break;case yT:Ur==null&&It(Sn,Hn,to,Mo);break;case Es:pr(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es);break;default:Jo&1?Mr(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es):Jo&6?_r(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es):(Jo&64||Jo&128)&&Io.process(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es,oo)}Ys!=null&&Ha?x5(Ys,Ur&&Ur.ref,qa,Sn||Ur,!Sn):Ys==null&&Ur&&Ur.ref!=null&&x5(Ur.ref,null,qa,Ur,!0)},Ve=(Ur,Sn,Hn,to)=>{if(Ur==null)u(Sn.el=ct(Sn.children),Hn,to);else{const Ha=Sn.el=Ur.el;Sn.children!==Ur.children&&St(Ha,Sn.children)}},kr=(Ur,Sn,Hn,to)=>{Ur==null?u(Sn.el=yt(Sn.children||""),Hn,to):Sn.el=Ur.el},It=(Ur,Sn,Hn,to)=>{[Ur.el,Ur.anchor]=we(Ur.children,Sn,Hn,to,Ur.el,Ur.anchor)},rn=({el:Ur,anchor:Sn},Hn,to)=>{let Ha;for(;Ur&&Ur!==Sn;)Ha=pe(Ur),u(Ur,Hn,to),Ur=Ha;u(Sn,Hn,to)},Lr=({el:Ur,anchor:Sn})=>{let Hn;for(;Ur&&Ur!==Sn;)Hn=pe(Ur),T(Ur),Ur=Hn;T(Sn)},Mr=(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es)=>{Sn.type==="svg"?Mo="svg":Sn.type==="math"&&(Mo="mathml"),Ur==null?tn(Sn,Hn,to,Ha,qa,Mo,Wo,es):Br(Ur,Sn,Ha,qa,Mo,Wo,es)},tn=(Ur,Sn,Hn,to,Ha,qa,Mo,Wo)=>{let es,Io;const{props:Ys,shapeFlag:Jo,transition:Ss,dirs:Us}=Ur;if(es=Ur.el=K(Ur.type,qa,Ys&&Ys.is,Ys),Jo&8?Ut(es,Ur.children):Jo&16&&Mn(Ur.children,es,null,to,Ha,k7(Ur,qa),Mo,Wo),Us&&sx(Ur,null,to,"created"),Dn(es,Ur,Ur.scopeId,Mo,to),Ys){for(const Ou in Ys)Ou!=="value"&&!g5(Ou)&&$(es,Ou,null,Ys[Ou],qa,to);"value"in Ys&&$(es,"value",null,Ys.value,qa),(Io=Ys.onVnodeBeforeMount)&&hv(Io,to,Ur)}Us&&sx(Ur,null,to,"beforeMount");const Ac=uat(Ha,Ss);Ac&&Ss.beforeEnter(es),u(es,Sn,Hn),((Io=Ys&&Ys.onVnodeMounted)||Ac||Us)&&em(()=>{Io&&hv(Io,to,Ur),Ac&&Ss.enter(es),Us&&sx(Ur,null,to,"mounted")},Ha)},Dn=(Ur,Sn,Hn,to,Ha)=>{if(Hn&&me(Ur,Hn),to)for(let qa=0;qa{for(let Io=es;Io{const Wo=Sn.el=Ur.el;let{patchFlag:es,dynamicChildren:Io,dirs:Ys}=Sn;es|=Ur.patchFlag&16;const Jo=Ur.props||Cd,Ss=Sn.props||Cd;let Us;if(Hn&&lx(Hn,!1),(Us=Ss.onVnodeBeforeUpdate)&&hv(Us,Hn,Sn,Ur),Ys&&sx(Sn,Ur,Hn,"beforeUpdate"),Hn&&lx(Hn,!0),(Jo.innerHTML&&Ss.innerHTML==null||Jo.textContent&&Ss.textContent==null)&&Ut(Wo,""),Io?Vn(Ur.dynamicChildren,Io,Wo,Hn,to,k7(Sn,Ha),qa):Mo||Xn(Ur,Sn,Wo,null,Hn,to,k7(Sn,Ha),qa,!1),es>0){if(es&16)on(Wo,Jo,Ss,Hn,Ha);else if(es&2&&Jo.class!==Ss.class&&$(Wo,"class",null,Ss.class,Ha),es&4&&$(Wo,"style",Jo.style,Ss.style,Ha),es&8){const Ac=Sn.dynamicProps;for(let Ou=0;Ou{Us&&hv(Us,Hn,Sn,Ur),Ys&&sx(Sn,Ur,Hn,"updated")},to)},Vn=(Ur,Sn,Hn,to,Ha,qa,Mo)=>{for(let Wo=0;Wo{if(Sn!==Hn){if(Sn!==Cd)for(const qa in Sn)!g5(qa)&&!(qa in Hn)&&$(Ur,qa,Sn[qa],null,Ha,to);for(const qa in Hn){if(g5(qa))continue;const Mo=Hn[qa],Wo=Sn[qa];Mo!==Wo&&qa!=="value"&&$(Ur,qa,Wo,Mo,Ha,to)}"value"in Hn&&$(Ur,"value",Sn.value,Hn.value,Ha)}},pr=(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es)=>{const Io=Sn.el=Ur?Ur.el:ct(""),Ys=Sn.anchor=Ur?Ur.anchor:ct("");let{patchFlag:Jo,dynamicChildren:Ss,slotScopeIds:Us}=Sn;Us&&(Wo=Wo?Wo.concat(Us):Us),Ur==null?(u(Io,Hn,to),u(Ys,Hn,to),Mn(Sn.children||[],Hn,Ys,Ha,qa,Mo,Wo,es)):Jo>0&&Jo&64&&Ss&&Ur.dynamicChildren?(Vn(Ur.dynamicChildren,Ss,Hn,Ha,qa,Mo,Wo),(Sn.key!=null||Ha&&Sn===Ha.subTree)&&EE(Ur,Sn,!0)):Xn(Ur,Sn,Hn,Ys,Ha,qa,Mo,Wo,es)},_r=(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es)=>{Sn.slotScopeIds=Wo,Ur==null?Sn.shapeFlag&512?Ha.ctx.activate(Sn,Hn,to,Mo,es):Sr(Sn,Hn,to,Ha,qa,Mo,es):Dr(Ur,Sn,es)},Sr=(Ur,Sn,Hn,to,Ha,qa,Mo)=>{const Wo=Ur.component=Mat(Ur,to,Ha);if(AS(Ur)&&(Wo.ctx.renderer=oo),Eat(Wo,!1,Mo),Wo.asyncDep){if(Ha&&Ha.registerDep(Wo,nn,Mo),!Ur.el){const es=Wo.subTree=Vs(am);kr(null,es,Sn,Hn),Ur.placeholder=es.el}}else nn(Wo,Ur,Sn,Hn,Ha,qa,Mo)},Dr=(Ur,Sn,Hn)=>{const to=Sn.component=Ur.component;if(_at(Ur,Sn,Hn))if(to.asyncDep&&!to.asyncResolved){Cn(to,Sn,Hn);return}else to.next=Sn,to.update();else Sn.el=Ur.el,to.vnode=Sn},nn=(Ur,Sn,Hn,to,Ha,qa,Mo)=>{const Wo=()=>{if(Ur.isMounted){let{next:Jo,bu:Ss,u:Us,parent:Ac,vnode:Ou}=Ur;{const lm=cU(Ur);if(lm){Jo&&(Jo.el=Ou.el,Cn(Ur,Jo,Mo)),lm.asyncDep.then(()=>{Ur.isUnmounted||Wo()});return}}let Bu=Jo,dp;lx(Ur,!1),Jo?(Jo.el=Ou.el,Cn(Ur,Jo,Mo)):Jo=Ou,Ss&&mT(Ss),(dp=Jo.props&&Jo.props.onVnodeBeforeUpdate)&&hv(dp,Ac,Jo,Ou),lx(Ur,!0);const Wf=qO(Ur),V0=Ur.subTree;Ur.subTree=Wf,Ce(V0,Wf,ne(V0.el),hi(V0),Ur,Ha,qa),Jo.el=Wf.el,Bu===null&&xat(Ur,Wf.el),Us&&em(Us,Ha),(dp=Jo.props&&Jo.props.onVnodeUpdated)&&em(()=>hv(dp,Ac,Jo,Ou),Ha)}else{let Jo;const{el:Ss,props:Us}=Sn,{bm:Ac,m:Ou,parent:Bu,root:dp,type:Wf}=Ur,V0=b5(Sn);lx(Ur,!1),Ac&&mT(Ac),!V0&&(Jo=Us&&Us.onVnodeBeforeMount)&&hv(Jo,Bu,Sn),lx(Ur,!0);{dp.ce&&dp.ce._def.shadowRoot!==!1&&dp.ce._injectChildStyle(Wf);const lm=Ur.subTree=qO(Ur);Ce(null,lm,Hn,to,Ur,Ha,qa),Sn.el=lm.el}if(Ou&&em(Ou,Ha),!V0&&(Jo=Us&&Us.onVnodeMounted)){const lm=Sn;em(()=>hv(Jo,Bu,lm),Ha)}(Sn.shapeFlag&256||Bu&&b5(Bu.vnode)&&Bu.vnode.shapeFlag&256)&&Ur.a&&em(Ur.a,Ha),Ur.isMounted=!0,Sn=Hn=to=null}};Ur.scope.on();const es=Ur.effect=new pj(Wo);Ur.scope.off();const Io=Ur.update=es.run.bind(es),Ys=Ur.job=es.runIfDirty.bind(es);Ys.i=Ur,Ys.id=Ur.uid,es.scheduler=()=>SE(Ys),lx(Ur,!0),Io()},Cn=(Ur,Sn,Hn)=>{Sn.component=Ur;const to=Ur.vnode.props;Ur.vnode=Sn,Ur.next=null,nat(Ur,Sn.props,to,Hn),sat(Ur,Sn.children,Hn),$1(),zO(Ur),H1()},Xn=(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es=!1)=>{const Io=Ur&&Ur.children,Ys=Ur?Ur.shapeFlag:0,Jo=Sn.children,{patchFlag:Ss,shapeFlag:Us}=Sn;if(Ss>0){if(Ss&128){ta(Io,Jo,Hn,to,Ha,qa,Mo,Wo,es);return}else if(Ss&256){_i(Io,Jo,Hn,to,Ha,qa,Mo,Wo,es);return}}Us&8?(Ys&16&&Yn(Io,Ha,qa),Jo!==Io&&Ut(Hn,Jo)):Ys&16?Us&16?ta(Io,Jo,Hn,to,Ha,qa,Mo,Wo,es):Yn(Io,Ha,qa,!0):(Ys&8&&Ut(Hn,""),Us&16&&Mn(Jo,Hn,to,Ha,qa,Mo,Wo,es))},_i=(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es)=>{Ur=Ur||L2,Sn=Sn||L2;const Io=Ur.length,Ys=Sn.length,Jo=Math.min(Io,Ys);let Ss;for(Ss=0;SsYs?Yn(Ur,Ha,qa,!0,!1,Jo):Mn(Sn,Hn,to,Ha,qa,Mo,Wo,es,Jo)},ta=(Ur,Sn,Hn,to,Ha,qa,Mo,Wo,es)=>{let Io=0;const Ys=Sn.length;let Jo=Ur.length-1,Ss=Ys-1;for(;Io<=Jo&&Io<=Ss;){const Us=Ur[Io],Ac=Sn[Io]=es?r_(Sn[Io]):kv(Sn[Io]);if(kx(Us,Ac))Ce(Us,Ac,Hn,null,Ha,qa,Mo,Wo,es);else break;Io++}for(;Io<=Jo&&Io<=Ss;){const Us=Ur[Jo],Ac=Sn[Ss]=es?r_(Sn[Ss]):kv(Sn[Ss]);if(kx(Us,Ac))Ce(Us,Ac,Hn,null,Ha,qa,Mo,Wo,es);else break;Jo--,Ss--}if(Io>Jo){if(Io<=Ss){const Us=Ss+1,Ac=UsSs)for(;Io<=Jo;)_a(Ur[Io],Ha,qa,!0),Io++;else{const Us=Io,Ac=Io,Ou=new Map;for(Io=Ac;Io<=Ss;Io++){const Np=Sn[Io]=es?r_(Sn[Io]):kv(Sn[Io]);Np.key!=null&&Ou.set(Np.key,Io)}let Bu,dp=0;const Wf=Ss-Ac+1;let V0=!1,lm=0;const Hg=new Array(Wf);for(Io=0;Io=Wf){_a(Np,Ha,qa,!0);continue}let cm;if(Np.key!=null)cm=Ou.get(Np.key);else for(Bu=Ac;Bu<=Ss;Bu++)if(Hg[Bu-Ac]===0&&kx(Np,Sn[Bu])){cm=Bu;break}cm===void 0?_a(Np,Ha,qa,!0):(Hg[cm-Ac]=Io+1,cm>=lm?lm=cm:V0=!0,Ce(Np,Sn[cm],Hn,null,Ha,qa,Mo,Wo,es),dp++)}const Y1=V0?hat(Hg):L2;for(Bu=Y1.length-1,Io=Wf-1;Io>=0;Io--){const Np=Ac+Io,cm=Sn[Np],Vg=Sn[Np+1],Xx=Np+1{const{el:qa,type:Mo,transition:Wo,children:es,shapeFlag:Io}=Ur;if(Io&6){va(Ur.component.subTree,Sn,Hn,to);return}if(Io&128){Ur.suspense.move(Sn,Hn,to);return}if(Io&64){Mo.move(Ur,Sn,Hn,oo);return}if(Mo===Es){u(qa,Sn,Hn);for(let Jo=0;JoWo.enter(qa),Ha);else{const{leave:Jo,delayLeave:Ss,afterLeave:Us}=Wo,Ac=()=>{Ur.ctx.isUnmounted?T(qa):u(qa,Sn,Hn)},Ou=()=>{Jo(qa,()=>{Ac(),Us&&Us()})};Ss?Ss(qa,Ac,Ou):Ou()}else u(qa,Sn,Hn)},_a=(Ur,Sn,Hn,to=!1,Ha=!1)=>{const{type:qa,props:Mo,ref:Wo,children:es,dynamicChildren:Io,shapeFlag:Ys,patchFlag:Jo,dirs:Ss,cacheIndex:Us}=Ur;if(Jo===-2&&(Ha=!1),Wo!=null&&($1(),x5(Wo,null,Hn,Ur,!0),H1()),Us!=null&&(Sn.renderCache[Us]=void 0),Ys&256){Sn.ctx.deactivate(Ur);return}const Ac=Ys&1&&Ss,Ou=!b5(Ur);let Bu;if(Ou&&(Bu=Mo&&Mo.onVnodeBeforeUnmount)&&hv(Bu,Sn,Ur),Ys&6)Xi(Ur.component,Hn,to);else{if(Ys&128){Ur.suspense.unmount(Hn,to);return}Ac&&sx(Ur,null,Sn,"beforeUnmount"),Ys&64?Ur.type.remove(Ur,Sn,Hn,oo,to):Io&&!Io.hasOnce&&(qa!==Es||Jo>0&&Jo&64)?Yn(Io,Sn,Hn,!1,!0):(qa===Es&&Jo&384||!Ha&&Ys&16)&&Yn(es,Sn,Hn),to&&qi(Ur)}(Ou&&(Bu=Mo&&Mo.onVnodeUnmounted)||Ac)&&em(()=>{Bu&&hv(Bu,Sn,Ur),Ac&&sx(Ur,null,Sn,"unmounted")},Hn)},qi=Ur=>{const{type:Sn,el:Hn,anchor:to,transition:Ha}=Ur;if(Sn===Es){Bi(Hn,to);return}if(Sn===yT){Lr(Ur);return}const qa=()=>{T(Hn),Ha&&!Ha.persisted&&Ha.afterLeave&&Ha.afterLeave()};if(Ur.shapeFlag&1&&Ha&&!Ha.persisted){const{leave:Mo,delayLeave:Wo}=Ha,es=()=>Mo(Hn,qa);Wo?Wo(Ur.el,qa,es):es()}else qa()},Bi=(Ur,Sn)=>{let Hn;for(;Ur!==Sn;)Hn=pe(Ur),T(Ur),Ur=Hn;T(Sn)},Xi=(Ur,Sn,Hn)=>{const{bum:to,scope:Ha,job:qa,subTree:Mo,um:Wo,m:es,a:Io,parent:Ys,slots:{__:Jo}}=Ur;WO(es),WO(Io),to&&mT(to),Ys&&pc(Jo)&&Jo.forEach(Ss=>{Ys.renderCache[Ss]=void 0}),Ha.stop(),qa&&(qa.flags|=8,_a(Mo,Ur,Sn,Hn)),Wo&&em(Wo,Sn),em(()=>{Ur.isUnmounted=!0},Sn),Sn&&Sn.pendingBranch&&!Sn.isUnmounted&&Ur.asyncDep&&!Ur.asyncResolved&&Ur.suspenseId===Sn.pendingId&&(Sn.deps--,Sn.deps===0&&Sn.resolve())},Yn=(Ur,Sn,Hn,to=!1,Ha=!1,qa=0)=>{for(let Mo=qa;Mo{if(Ur.shapeFlag&6)return hi(Ur.component.subTree);if(Ur.shapeFlag&128)return Ur.suspense.next();const Sn=pe(Ur.anchor||Ur.el),Hn=Sn&&Sn[Rj];return Hn?pe(Hn):Sn};let na=!1;const Xa=(Ur,Sn,Hn)=>{Ur==null?Sn._vnode&&_a(Sn._vnode,null,null,!0):Ce(Sn._vnode||null,Ur,Sn,null,null,null,Hn),Sn._vnode=Ur,na||(na=!0,zO(),zj(),na=!1)},oo={p:Ce,um:_a,m:va,r:qi,mt:Sr,mc:Mn,pc:Xn,pbc:Vn,n:hi,o:e};return{render:Xa,hydrate:void 0,createApp:tat(Xa)}}function k7({type:e,props:t},r){return r==="svg"&&e==="foreignObject"||r==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:r}function lx({effect:e,job:t},r){r?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function uat(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function EE(e,t,r=!1){const u=e.children,T=t.children;if(pc(u)&&pc(T))for(let $=0;$>1,e[r[ct]]0&&(t[u]=r[$-1]),r[$]=u)}}for($=r.length,K=r[$-1];$-- >0;)r[$]=K,K=t[K];return r}function cU(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:cU(t)}function WO(e){if(e)for(let t=0;t_g(dat);function Fh(e,t,r){return uU(e,t,r)}function uU(e,t,r=Cd){const{immediate:u,deep:T,flush:$,once:K}=r,ct=Rp({},r),yt=t&&u||!t&&$!=="post";let St;if(N5){if($==="sync"){const me=fat();St=me.__watcherHandles||(me.__watcherHandles=[])}else if(!yt){const me=()=>{};return me.stop=Ev,me.resume=Ev,me.pause=Ev,me}}const Ut=R0;ct.call=(me,we,Ce)=>Ng(me,Ut,we,Ce);let ne=!1;$==="post"?ct.scheduler=me=>{em(me,Ut&&Ut.suspense)}:$!=="sync"&&(ne=!0,ct.scheduler=(me,we)=>{we?me():SE(me)}),ct.augmentJob=me=>{t&&(me.flags|=4),ne&&(me.flags|=2,Ut&&(me.id=Ut.uid,me.i=Ut))};const pe=Pit(e,t,ct);return N5&&(St?St.push(pe):yt&&pe()),pe}function pat(e,t,r){const u=this.proxy,T=Af(e)?e.includes(".")?hU(u,e):()=>u[e]:e.bind(u,u);let $;Xc(t)?$=t:($=t.handler,r=t);const K=r4(this),ct=uU(T,$.bind(u),r);return K(),ct}function hU(e,t){const r=t.split(".");return()=>{let u=e;for(let T=0;Tt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${wg(t)}Modifiers`]||e[`${b_(t)}Modifiers`];function gat(e,t,...r){if(e.isUnmounted)return;const u=e.vnode.props||Cd;let T=r;const $=t.startsWith("update:"),K=$&&mat(u,t.slice(7));K&&(K.trim&&(T=r.map(Ut=>Af(Ut)?Ut.trim():Ut)),K.number&&(T=r.map(NT)));let ct,yt=u[ct=g7(t)]||u[ct=g7(wg(t))];!yt&&$&&(yt=u[ct=g7(b_(t))]),yt&&Ng(yt,e,6,T);const St=u[ct+"Once"];if(St){if(!e.emitted)e.emitted={};else if(e.emitted[ct])return;e.emitted[ct]=!0,Ng(St,e,6,T)}}function dU(e,t,r=!1){const u=t.emitsCache,T=u.get(e);if(T!==void 0)return T;const $=e.emits;let K={},ct=!1;if(!Xc(e)){const yt=St=>{const Ut=dU(St,t,!0);Ut&&(ct=!0,Rp(K,Ut))};!r&&t.mixins.length&&t.mixins.forEach(yt),e.extends&&yt(e.extends),e.mixins&&e.mixins.forEach(yt)}return!$&&!ct?(Ad(e)&&u.set(e,null),null):(pc($)?$.forEach(yt=>K[yt]=null):Rp(K,$),Ad(e)&&u.set(e,K),K)}function LS(e,t){return!e||!_S(t)?!1:(t=t.slice(2).replace(/Once$/,""),Yh(e,t[0].toLowerCase()+t.slice(1))||Yh(e,b_(t))||Yh(e,t))}function qO(e){const{type:t,vnode:r,proxy:u,withProxy:T,propsOptions:[$],slots:K,attrs:ct,emit:yt,render:St,renderCache:Ut,props:ne,data:pe,setupState:me,ctx:we,inheritAttrs:Ce}=e,Ve=VT(e);let kr,It;try{if(r.shapeFlag&4){const Lr=T||u,Mr=Lr;kr=kv(St.call(Mr,Lr,Ut,ne,me,pe,we)),It=ct}else{const Lr=t;kr=kv(Lr.length>1?Lr(ne,{attrs:ct,slots:K,emit:yt}):Lr(ne,null)),It=t.props?ct:vat(ct)}}catch(Lr){k5.length=0,SS(Lr,e,1),kr=Vs(am)}let rn=kr;if(It&&Ce!==!1){const Lr=Object.keys(It),{shapeFlag:Mr}=rn;Lr.length&&Mr&7&&($&&Lr.some(mE)&&(It=yat(It,$)),rn=y_(rn,It,!1,!0))}return r.dirs&&(rn=y_(rn,null,!1,!0),rn.dirs=rn.dirs?rn.dirs.concat(r.dirs):r.dirs),r.transition&&jx(rn,r.transition),kr=rn,VT(Ve),kr}const vat=e=>{let t;for(const r in e)(r==="class"||r==="style"||_S(r))&&((t||(t={}))[r]=e[r]);return t},yat=(e,t)=>{const r={};for(const u in e)(!mE(u)||!(u.slice(9)in t))&&(r[u]=e[u]);return r};function _at(e,t,r){const{props:u,children:T,component:$}=e,{props:K,children:ct,patchFlag:yt}=t,St=$.emitsOptions;if(t.dirs||t.transition)return!0;if(r&&yt>=0){if(yt&1024)return!0;if(yt&16)return u?GO(u,K,St):!!K;if(yt&8){const Ut=t.dynamicProps;for(let ne=0;nee.__isSuspense;function bat(e,t){t&&t.pendingBranch?pc(e)?t.effects.push(...e):t.effects.push(e):zit(e)}const Es=Symbol.for("v-fgt"),PS=Symbol.for("v-txt"),am=Symbol.for("v-cmt"),yT=Symbol.for("v-stc"),k5=[];let Km=null;function Or(e=!1){k5.push(Km=e?null:[])}function wat(){k5.pop(),Km=k5[k5.length-1]||null}let F5=1;function ZO(e,t=!1){F5+=e,e<0&&Km&&t&&(Km.hasOnce=!0)}function pU(e){return e.dynamicChildren=F5>0?Km||L2:null,wat(),F5>0&&Km&&Km.push(e),e}function Nr(e,t,r,u,T,$){return pU(At(e,t,r,u,T,$,!0))}function w0(e,t,r,u,T){return pU(Vs(e,t,r,u,T,!0))}function qT(e){return e?e.__v_isVNode===!0:!1}function kx(e,t){return e.type===t.type&&e.key===t.key}const mU=({key:e})=>e??null,_T=({ref:e,ref_key:t,ref_for:r})=>(typeof e=="number"&&(e=""+e),e!=null?Af(e)||hp(e)||Xc(e)?{i:Zm,r:e,k:t,f:!!r}:e:null);function At(e,t=null,r=null,u=0,T=null,$=e===Es?0:1,K=!1,ct=!1){const yt={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mU(t),ref:t&&_T(t),scopeId:Bj,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:$,patchFlag:u,dynamicProps:T,dynamicChildren:null,appContext:null,ctx:Zm};return ct?(LE(yt,r),$&128&&e.normalize(yt)):r&&(yt.shapeFlag|=Af(r)?8:16),F5>0&&!K&&Km&&(yt.patchFlag>0||$&6)&&yt.patchFlag!==32&&Km.push(yt),yt}const Vs=kat;function kat(e,t=null,r=null,u=0,T=null,$=!1){if((!e||e===Yj)&&(e=am),qT(e)){const ct=y_(e,t,!0);return r&&LE(ct,r),F5>0&&!$&&Km&&(ct.shapeFlag&6?Km[Km.indexOf(e)]=ct:Km.push(ct)),ct.patchFlag=-2,ct}if(zat(e)&&(e=e.__vccOpts),t){t=Tat(t);let{class:ct,style:yt}=t;ct&&!Af(ct)&&(t.class=ja(ct)),Ad(yt)&&(TE(yt)&&!pc(yt)&&(yt=Rp({},yt)),t.style=Sp(yt))}const K=Af(e)?1:fU(e)?128:Fj(e)?64:Ad(e)?4:Xc(e)?2:0;return At(e,t,r,u,T,K,$,!0)}function Tat(e){return e?TE(e)||nU(e)?Rp({},e):e:null}function y_(e,t,r=!1,u=!1){const{props:T,ref:$,patchFlag:K,children:ct,transition:yt}=e,St=t?Sat(T||{},t):T,Ut={__v_isVNode:!0,__v_skip:!0,type:e.type,props:St,key:St&&mU(St),ref:t&&t.ref?r&&$?pc($)?$.concat(_T(t)):[$,_T(t)]:_T(t):$,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:ct,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Es?K===-1?16:K|16:K,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:yt,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&y_(e.ssContent),ssFallback:e.ssFallback&&y_(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return yt&&u&&jx(Ut,yt.clone(Ut)),Ut}function cl(e=" ",t=0){return Vs(PS,null,e,t)}function Du(e,t){const r=Vs(yT,null,e);return r.staticCount=t,r}function Ta(e="",t=!1){return t?(Or(),w0(am,null,e)):Vs(am,null,e)}function kv(e){return e==null||typeof e=="boolean"?Vs(am):pc(e)?Vs(Es,null,e.slice()):qT(e)?r_(e):Vs(PS,null,String(e))}function r_(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:y_(e)}function LE(e,t){let r=0;const{shapeFlag:u}=e;if(t==null)t=null;else if(pc(t))r=16;else if(typeof t=="object")if(u&65){const T=t.default;T&&(T._c&&(T._d=!1),LE(e,T()),T._c&&(T._d=!0));return}else{r=32;const T=t._;!T&&!nU(t)?t._ctx=Zm:T===3&&Zm&&(Zm.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Xc(t)?(t={default:t,_ctx:Zm},r=32):(t=String(t),u&64?(r=16,t=[cl(t)]):r=8);e.children=t,e.shapeFlag|=r}function Sat(...e){const t={};for(let r=0;rR0||Zm;let GT,WM;{const e=kS(),t=(r,u)=>{let T;return(T=e[r])||(T=e[r]=[]),T.push(u),$=>{T.length>1?T.forEach(K=>K($)):T[0]($)}};GT=t("__VUE_INSTANCE_SETTERS__",r=>R0=r),WM=t("__VUE_SSR_SETTERS__",r=>N5=r)}const r4=e=>{const t=R0;return GT(e),e.scope.on(),()=>{e.scope.off(),GT(t)}},KO=()=>{R0&&R0.scope.off(),GT(null)};function gU(e){return e.vnode.shapeFlag&4}let N5=!1;function Eat(e,t=!1,r=!1){t&&WM(t);const{props:u,children:T}=e.vnode,$=gU(e);rat(e,u,$,t),oat(e,T,r||t);const K=$?Lat(e,t):void 0;return t&&WM(!1),K}function Lat(e,t){const r=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Git);const{setup:u}=r;if(u){$1();const T=e.setupContext=u.length>1?Iat(e):null,$=r4(e),K=e4(u,e,0,[e.props,T]),ct=aj(K);if(H1(),$(),(ct||e.sp)&&!b5(e)&&qj(e),ct){if(K.then(KO,KO),t)return K.then(yt=>{YO(e,yt)}).catch(yt=>{SS(yt,e,0)});e.asyncDep=K}else YO(e,K)}else vU(e)}function YO(e,t,r){Xc(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ad(t)&&(e.setupState=Pj(t)),vU(e)}function vU(e,t,r){const u=e.type;e.render||(e.render=u.render||Ev);{const T=r4(e);$1();try{Zit(e)}finally{H1(),T()}}}const Pat={get(e,t){return B0(e,"get",""),e[t]}};function Iat(e){const t=r=>{e.exposed=r||{}};return{attrs:new Proxy(e.attrs,Pat),slots:e.slots,emit:e.emit,expose:t}}function DS(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Pj(j1(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in w5)return w5[r](e)},has(t,r){return r in t||r in w5}})):e.proxy}function Dat(e,t=!0){return Xc(e)?e.displayName||e.name:e.name||t&&e.__name}function zat(e){return Xc(e)&&"__vccOpts"in e}const Ao=(e,t)=>Eit(e,t,N5);function PE(e,t,r){const u=arguments.length;return u===2?Ad(t)&&!pc(t)?qT(t)?Vs(e,null,[t]):Vs(e,t):Vs(e,null,t):(u>3?r=Array.prototype.slice.call(arguments,2):u===3&&qT(r)&&(r=[r]),Vs(e,t,r))}const Oat="3.5.18";/** * @vue/runtime-dom v3.5.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let qM;const XO=typeof window<"u"&&window.trustedTypes;if(XO)try{qM=XO.createPolicy("vue",{createHTML:e=>e})}catch{}const yU=qM?e=>qM.createHTML(e):e=>e,Bat="http://www.w3.org/2000/svg",Rat="http://www.w3.org/1998/Math/MathML",M1=typeof document<"u"?document:null,JO=M1&&M1.createElement("template"),Fat={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,u)=>{const T=t==="svg"?M1.createElementNS(Bat,e):t==="mathml"?M1.createElementNS(Rat,e):r?M1.createElement(e,{is:r}):M1.createElement(e);return e==="select"&&u&&u.multiple!=null&&T.setAttribute("multiple",u.multiple),T},createText:e=>M1.createTextNode(e),createComment:e=>M1.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>M1.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,u,T,$){const K=r?r.previousSibling:t.lastChild;if(T&&(T===$||T.nextSibling))for(;t.insertBefore(T.cloneNode(!0),r),!(T===$||!(T=T.nextSibling)););else{JO.innerHTML=yU(u==="svg"?`${e}`:u==="mathml"?`${e}`:e);const ct=JO.content;if(u==="svg"||u==="mathml"){const yt=ct.firstChild;for(;yt.firstChild;)ct.appendChild(yt.firstChild);ct.removeChild(yt)}t.insertBefore(ct,r)}return[K?K.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},Ny="transition",I3="animation",R2=Symbol("_vtc"),_U={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},xU=Rp({},$j,_U),Nat=e=>(e.displayName="Transition",e.props=xU,e),F2=Nat((e,{slots:t})=>PE(Rit,bU(e),t)),cx=(e,t=[])=>{pc(e)?e.forEach(r=>r(...t)):e&&e(...t)},QO=e=>e?pc(e)?e.some(t=>t.length>1):e.length>1:!1;function bU(e){const t={};for(const pr in e)pr in _U||(t[pr]=e[pr]);if(e.css===!1)return t;const{name:r="v",type:u,duration:T,enterFromClass:$=`${r}-enter-from`,enterActiveClass:K=`${r}-enter-active`,enterToClass:ct=`${r}-enter-to`,appearFromClass:yt=$,appearActiveClass:St=K,appearToClass:Ut=ct,leaveFromClass:ne=`${r}-leave-from`,leaveActiveClass:pe=`${r}-leave-active`,leaveToClass:me=`${r}-leave-to`}=e,we=jat(T),Ce=we&&we[0],Ve=we&&we[1],{onBeforeEnter:kr,onEnter:It,onEnterCancelled:rn,onLeave:Lr,onLeaveCancelled:Mr,onBeforeAppear:tn=kr,onAppear:Dn=It,onAppearCancelled:Mn=rn}=t,Br=(pr,_r,Sr,Dr)=>{pr._enterCancelled=Dr,Gy(pr,_r?Ut:ct),Gy(pr,_r?St:K),Sr&&Sr()},Vn=(pr,_r)=>{pr._isLeaving=!1,Gy(pr,ne),Gy(pr,me),Gy(pr,pe),_r&&_r()},on=pr=>(_r,Sr)=>{const Dr=pr?Dn:It,nn=()=>Br(_r,pr,Sr);cx(Dr,[_r,nn]),tB(()=>{Gy(_r,pr?yt:$),vv(_r,pr?Ut:ct),QO(Dr)||eB(_r,u,Ce,nn)})};return Rp(t,{onBeforeEnter(pr){cx(kr,[pr]),vv(pr,$),vv(pr,K)},onBeforeAppear(pr){cx(tn,[pr]),vv(pr,yt),vv(pr,St)},onEnter:on(!1),onAppear:on(!0),onLeave(pr,_r){pr._isLeaving=!0;const Sr=()=>Vn(pr,_r);vv(pr,ne),pr._enterCancelled?(vv(pr,pe),GM()):(GM(),vv(pr,pe)),tB(()=>{pr._isLeaving&&(Gy(pr,ne),vv(pr,me),QO(Lr)||eB(pr,u,Ve,Sr))}),cx(Lr,[pr,Sr])},onEnterCancelled(pr){Br(pr,!1,void 0,!0),cx(rn,[pr])},onAppearCancelled(pr){Br(pr,!0,void 0,!0),cx(Mn,[pr])},onLeaveCancelled(pr){Vn(pr),cx(Mr,[pr])}})}function jat(e){if(e==null)return null;if(Ad(e))return[T7(e.enter),T7(e.leave)];{const t=T7(e);return[t,t]}}function T7(e){return Gnt(e)}function vv(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e[R2]||(e[R2]=new Set)).add(t)}function Gy(e,t){t.split(/\s+/).forEach(u=>u&&e.classList.remove(u));const r=e[R2];r&&(r.delete(t),r.size||(e[R2]=void 0))}function tB(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Uat=0;function eB(e,t,r,u){const T=e._endId=++Uat,$=()=>{T===e._endId&&u()};if(r!=null)return setTimeout($,r);const{type:K,timeout:ct,propCount:yt}=wU(e,t);if(!K)return u();const St=K+"end";let Ut=0;const ne=()=>{e.removeEventListener(St,pe),$()},pe=me=>{me.target===e&&++Ut>=yt&&ne()};setTimeout(()=>{Ut(r[we]||"").split(", "),T=u(`${Ny}Delay`),$=u(`${Ny}Duration`),K=rB(T,$),ct=u(`${I3}Delay`),yt=u(`${I3}Duration`),St=rB(ct,yt);let Ut=null,ne=0,pe=0;t===Ny?K>0&&(Ut=Ny,ne=K,pe=$.length):t===I3?St>0&&(Ut=I3,ne=St,pe=yt.length):(ne=Math.max(K,St),Ut=ne>0?K>St?Ny:I3:null,pe=Ut?Ut===Ny?$.length:yt.length:0);const me=Ut===Ny&&/\b(transform|all)(,|$)/.test(u(`${Ny}Property`).toString());return{type:Ut,timeout:ne,propCount:pe,hasTransform:me}}function rB(e,t){for(;e.lengthnB(r)+nB(e[u])))}function nB(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function GM(){return document.body.offsetHeight}function $at(e,t,r){const u=e[R2];u&&(t=(t?[t,...u]:[...u]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const ZT=Symbol("_vod"),kU=Symbol("_vsh"),Zy={beforeMount(e,{value:t},{transition:r}){e[ZT]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):D3(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:u}){!t!=!r&&(u?t?(u.beforeEnter(e),D3(e,!0),u.enter(e)):u.leave(e,()=>{D3(e,!1)}):D3(e,t))},beforeUnmount(e,{value:t}){D3(e,t)}};function D3(e,t){e.style.display=t?e[ZT]:"none",e[kU]=!t}const Hat=Symbol(""),Vat=/(^|;)\s*display\s*:/;function Wat(e,t,r){const u=e.style,T=Af(r);let $=!1;if(r&&!T){if(t)if(Af(t))for(const K of t.split(";")){const ct=K.slice(0,K.indexOf(":")).trim();r[ct]==null&&xT(u,ct,"")}else for(const K in t)r[K]==null&&xT(u,K,"");for(const K in r)K==="display"&&($=!0),xT(u,K,r[K])}else if(T){if(t!==r){const K=u[Hat];K&&(r+=";"+K),u.cssText=r,$=Vat.test(r)}}else t&&e.removeAttribute("style");ZT in e&&(e[ZT]=$?u.display:"",e[kU]&&(u.display="none"))}const iB=/\s*!important$/;function xT(e,t,r){if(pc(r))r.forEach(u=>xT(e,t,u));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const u=qat(e,t);iB.test(r)?e.setProperty(b_(u),r.replace(iB,""),"important"):e[u]=r}}const aB=["Webkit","Moz","ms"],S7={};function qat(e,t){const r=S7[t];if(r)return r;let u=wg(t);if(u!=="filter"&&u in e)return S7[t]=u;u=wS(u);for(let T=0;TC7||(Yat.then(()=>C7=0),C7=Date.now());function Jat(e,t){const r=u=>{if(!u._vts)u._vts=Date.now();else if(u._vts<=r.attached)return;Ng(Qat(u,r.value),t,5,[u])};return r.value=e,r.attached=Xat(),r}function Qat(e,t){if(pc(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(u=>T=>!T._stopped&&u&&u(T))}else return t}const hB=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,tot=(e,t,r,u,T,$)=>{const K=T==="svg";t==="class"?$at(e,u,K):t==="style"?Wat(e,r,u):_S(t)?mE(t)||Zat(e,t,r,u,$):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):eot(e,t,u,K))?(lB(e,t,u),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sB(e,t,u,K,$,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Af(u))?lB(e,wg(t),u,$,t):(t==="true-value"?e._trueValue=u:t==="false-value"&&(e._falseValue=u),sB(e,t,u,K))};function eot(e,t,r,u){if(u)return!!(t==="innerHTML"||t==="textContent"||t in e&&hB(t)&&Xc(r));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const T=e.tagName;if(T==="IMG"||T==="VIDEO"||T==="CANVAS"||T==="SOURCE")return!1}return hB(t)&&Af(r)?!1:t in e}const TU=new WeakMap,SU=new WeakMap,KT=Symbol("_moveCb"),dB=Symbol("_enterCb"),rot=e=>(delete e.props.mode,e),not=rot({name:"TransitionGroup",props:Rp({},xU,{tag:String,moveClass:String}),setup(e,{slots:t}){const r=IS(),u=Uj();let T,$;return Zj(()=>{if(!T.length)return;const K=e.moveClass||`${e.name||"v"}-move`;if(!lot(T[0].el,r.vnode.el,K)){T=[];return}T.forEach(aot),T.forEach(oot);const ct=T.filter(sot);GM(),ct.forEach(yt=>{const St=yt.el,Ut=St.style;vv(St,K),Ut.transform=Ut.webkitTransform=Ut.transitionDuration="";const ne=St[KT]=pe=>{pe&&pe.target!==St||(!pe||/transform$/.test(pe.propertyName))&&(St.removeEventListener("transitionend",ne),St[KT]=null,Gy(St,K))};St.addEventListener("transitionend",ne)}),T=[]}),()=>{const K=ru(e),ct=bU(K);let yt=K.tag||Es;if(T=[],$)for(let St=0;St<$.length;St++){const Ut=$[St];Ut.el&&Ut.el instanceof Element&&(T.push(Ut),Nx(Ut,R5(Ut,ct,u,r)),TU.set(Ut,Ut.el.getBoundingClientRect()))}$=t.default?CE(t.default()):[];for(let St=0;St<$.length;St++){const Ut=$[St];Ut.key!=null&&Nx(Ut,R5(Ut,ct,u,r))}return Vs(yt,null,$)}}}),iot=not;function aot(e){const t=e.el;t[KT]&&t[KT](),t[dB]&&t[dB]()}function oot(e){SU.set(e,e.el.getBoundingClientRect())}function sot(e){const t=TU.get(e),r=SU.get(e),u=t.left-r.left,T=t.top-r.top;if(u||T){const $=e.el.style;return $.transform=$.webkitTransform=`translate(${u}px,${T}px)`,$.transitionDuration="0s",e}}function lot(e,t,r){const u=e.cloneNode(),T=e[R2];T&&T.forEach(ct=>{ct.split(/\s+/).forEach(yt=>yt&&u.classList.remove(yt))}),r.split(/\s+/).forEach(ct=>ct&&u.classList.add(ct)),u.style.display="none";const $=t.nodeType===1?t:t.parentNode;$.appendChild(u);const{hasTransform:K}=wU(u);return $.removeChild(u),K}const N2=e=>{const t=e.props["onUpdate:modelValue"]||!1;return pc(t)?r=>mT(t,r):t};function cot(e){e.target.composing=!0}function fB(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const U1=Symbol("_assign"),lu={created(e,{modifiers:{lazy:t,trim:r,number:u}},T){e[U1]=N2(T);const $=u||T.props&&T.props.type==="number";o_(e,t?"change":"input",K=>{if(K.target.composing)return;let ct=e.value;r&&(ct=ct.trim()),$&&(ct=NT(ct)),e[U1](ct)}),r&&o_(e,"change",()=>{e.value=e.value.trim()}),t||(o_(e,"compositionstart",cot),o_(e,"compositionend",fB),o_(e,"change",fB))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:u,trim:T,number:$}},K){if(e[U1]=N2(K),e.composing)return;const ct=($||e.type==="number")&&!/^0\d/.test(e.value)?NT(e.value):e.value,yt=t??"";ct!==yt&&(document.activeElement===e&&e.type!=="range"&&(u&&t===r||T&&e.value.trim()===yt)||(e.value=yt))}},j5={created(e,{value:t},r){e.checked=B2(t,r.props.value),e[U1]=N2(r),o_(e,"change",()=>{e[U1](U5(e))})},beforeUpdate(e,{value:t,oldValue:r},u){e[U1]=N2(u),t!==r&&(e.checked=B2(t,u.props.value))}},xg={deep:!0,created(e,{value:t,modifiers:{number:r}},u){const T=xS(t);o_(e,"change",()=>{const $=Array.prototype.filter.call(e.options,K=>K.selected).map(K=>r?NT(U5(K)):U5(K));e[U1](e.multiple?T?new Set($):$:$[0]),e._assigning=!0,sp(()=>{e._assigning=!1})}),e[U1]=N2(u)},mounted(e,{value:t}){pB(e,t)},beforeUpdate(e,t,r){e[U1]=N2(r)},updated(e,{value:t}){e._assigning||pB(e,t)}};function pB(e,t){const r=e.multiple,u=pc(t);if(!(r&&!u&&!xS(t))){for(let T=0,$=e.options.length;T<$;T++){const K=e.options[T],ct=U5(K);if(r)if(u){const yt=typeof ct;yt==="string"||yt==="number"?K.selected=t.some(St=>String(St)===String(ct)):K.selected=eit(t,ct)>-1}else K.selected=t.has(ct);else if(B2(U5(K),t)){e.selectedIndex!==T&&(e.selectedIndex=T);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function U5(e){return"_value"in e?e._value:e.value}const uot=["ctrl","shift","alt","meta"],hot={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>uot.some(r=>e[`${r}Key`]&&!t.includes(r))},Od=(e,t)=>{const r=e._withMods||(e._withMods={}),u=t.join(".");return r[u]||(r[u]=(T,...$)=>{for(let K=0;K{const r=e._withKeys||(e._withKeys={}),u=t.join(".");return r[u]||(r[u]=T=>{if(!("key"in T))return;const $=b_(T.key);if(t.some(K=>K===$||dot[K]===$))return e(T)})},fot=Rp({patchProp:tot},Fat);let mB;function pot(){return mB||(mB=lat(fot))}const mot=(...e)=>{const t=pot().createApp(...e),{mount:r}=t;return t.mount=u=>{const T=vot(u);if(!T)return;const $=t._component;!Xc($)&&!$.render&&!$.template&&($.template=T.innerHTML),T.nodeType===1&&(T.textContent="");const K=r(T,!1,got(T));return T instanceof Element&&(T.removeAttribute("v-cloak"),T.setAttribute("data-v-app","")),K},t};function got(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function vot(e){return Af(e)?document.querySelector(e):e}/*! +**/let qM;const XO=typeof window<"u"&&window.trustedTypes;if(XO)try{qM=XO.createPolicy("vue",{createHTML:e=>e})}catch{}const yU=qM?e=>qM.createHTML(e):e=>e,Bat="http://www.w3.org/2000/svg",Rat="http://www.w3.org/1998/Math/MathML",M1=typeof document<"u"?document:null,JO=M1&&M1.createElement("template"),Fat={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,u)=>{const T=t==="svg"?M1.createElementNS(Bat,e):t==="mathml"?M1.createElementNS(Rat,e):r?M1.createElement(e,{is:r}):M1.createElement(e);return e==="select"&&u&&u.multiple!=null&&T.setAttribute("multiple",u.multiple),T},createText:e=>M1.createTextNode(e),createComment:e=>M1.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>M1.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,u,T,$){const K=r?r.previousSibling:t.lastChild;if(T&&(T===$||T.nextSibling))for(;t.insertBefore(T.cloneNode(!0),r),!(T===$||!(T=T.nextSibling)););else{JO.innerHTML=yU(u==="svg"?`${e}`:u==="mathml"?`${e}`:e);const ct=JO.content;if(u==="svg"||u==="mathml"){const yt=ct.firstChild;for(;yt.firstChild;)ct.appendChild(yt.firstChild);ct.removeChild(yt)}t.insertBefore(ct,r)}return[K?K.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}},Ny="transition",I3="animation",R2=Symbol("_vtc"),_U={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},xU=Rp({},$j,_U),Nat=e=>(e.displayName="Transition",e.props=xU,e),F2=Nat((e,{slots:t})=>PE(Rit,bU(e),t)),cx=(e,t=[])=>{pc(e)?e.forEach(r=>r(...t)):e&&e(...t)},QO=e=>e?pc(e)?e.some(t=>t.length>1):e.length>1:!1;function bU(e){const t={};for(const pr in e)pr in _U||(t[pr]=e[pr]);if(e.css===!1)return t;const{name:r="v",type:u,duration:T,enterFromClass:$=`${r}-enter-from`,enterActiveClass:K=`${r}-enter-active`,enterToClass:ct=`${r}-enter-to`,appearFromClass:yt=$,appearActiveClass:St=K,appearToClass:Ut=ct,leaveFromClass:ne=`${r}-leave-from`,leaveActiveClass:pe=`${r}-leave-active`,leaveToClass:me=`${r}-leave-to`}=e,we=jat(T),Ce=we&&we[0],Ve=we&&we[1],{onBeforeEnter:kr,onEnter:It,onEnterCancelled:rn,onLeave:Lr,onLeaveCancelled:Mr,onBeforeAppear:tn=kr,onAppear:Dn=It,onAppearCancelled:Mn=rn}=t,Br=(pr,_r,Sr,Dr)=>{pr._enterCancelled=Dr,Gy(pr,_r?Ut:ct),Gy(pr,_r?St:K),Sr&&Sr()},Vn=(pr,_r)=>{pr._isLeaving=!1,Gy(pr,ne),Gy(pr,me),Gy(pr,pe),_r&&_r()},on=pr=>(_r,Sr)=>{const Dr=pr?Dn:It,nn=()=>Br(_r,pr,Sr);cx(Dr,[_r,nn]),tB(()=>{Gy(_r,pr?yt:$),vv(_r,pr?Ut:ct),QO(Dr)||eB(_r,u,Ce,nn)})};return Rp(t,{onBeforeEnter(pr){cx(kr,[pr]),vv(pr,$),vv(pr,K)},onBeforeAppear(pr){cx(tn,[pr]),vv(pr,yt),vv(pr,St)},onEnter:on(!1),onAppear:on(!0),onLeave(pr,_r){pr._isLeaving=!0;const Sr=()=>Vn(pr,_r);vv(pr,ne),pr._enterCancelled?(vv(pr,pe),GM()):(GM(),vv(pr,pe)),tB(()=>{pr._isLeaving&&(Gy(pr,ne),vv(pr,me),QO(Lr)||eB(pr,u,Ve,Sr))}),cx(Lr,[pr,Sr])},onEnterCancelled(pr){Br(pr,!1,void 0,!0),cx(rn,[pr])},onAppearCancelled(pr){Br(pr,!0,void 0,!0),cx(Mn,[pr])},onLeaveCancelled(pr){Vn(pr),cx(Mr,[pr])}})}function jat(e){if(e==null)return null;if(Ad(e))return[T7(e.enter),T7(e.leave)];{const t=T7(e);return[t,t]}}function T7(e){return Gnt(e)}function vv(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e[R2]||(e[R2]=new Set)).add(t)}function Gy(e,t){t.split(/\s+/).forEach(u=>u&&e.classList.remove(u));const r=e[R2];r&&(r.delete(t),r.size||(e[R2]=void 0))}function tB(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Uat=0;function eB(e,t,r,u){const T=e._endId=++Uat,$=()=>{T===e._endId&&u()};if(r!=null)return setTimeout($,r);const{type:K,timeout:ct,propCount:yt}=wU(e,t);if(!K)return u();const St=K+"end";let Ut=0;const ne=()=>{e.removeEventListener(St,pe),$()},pe=me=>{me.target===e&&++Ut>=yt&&ne()};setTimeout(()=>{Ut(r[we]||"").split(", "),T=u(`${Ny}Delay`),$=u(`${Ny}Duration`),K=rB(T,$),ct=u(`${I3}Delay`),yt=u(`${I3}Duration`),St=rB(ct,yt);let Ut=null,ne=0,pe=0;t===Ny?K>0&&(Ut=Ny,ne=K,pe=$.length):t===I3?St>0&&(Ut=I3,ne=St,pe=yt.length):(ne=Math.max(K,St),Ut=ne>0?K>St?Ny:I3:null,pe=Ut?Ut===Ny?$.length:yt.length:0);const me=Ut===Ny&&/\b(transform|all)(,|$)/.test(u(`${Ny}Property`).toString());return{type:Ut,timeout:ne,propCount:pe,hasTransform:me}}function rB(e,t){for(;e.lengthnB(r)+nB(e[u])))}function nB(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function GM(){return document.body.offsetHeight}function $at(e,t,r){const u=e[R2];u&&(t=(t?[t,...u]:[...u]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}const ZT=Symbol("_vod"),kU=Symbol("_vsh"),Zy={beforeMount(e,{value:t},{transition:r}){e[ZT]=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):D3(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:u}){!t!=!r&&(u?t?(u.beforeEnter(e),D3(e,!0),u.enter(e)):u.leave(e,()=>{D3(e,!1)}):D3(e,t))},beforeUnmount(e,{value:t}){D3(e,t)}};function D3(e,t){e.style.display=t?e[ZT]:"none",e[kU]=!t}const Hat=Symbol(""),Vat=/(^|;)\s*display\s*:/;function Wat(e,t,r){const u=e.style,T=Af(r);let $=!1;if(r&&!T){if(t)if(Af(t))for(const K of t.split(";")){const ct=K.slice(0,K.indexOf(":")).trim();r[ct]==null&&xT(u,ct,"")}else for(const K in t)r[K]==null&&xT(u,K,"");for(const K in r)K==="display"&&($=!0),xT(u,K,r[K])}else if(T){if(t!==r){const K=u[Hat];K&&(r+=";"+K),u.cssText=r,$=Vat.test(r)}}else t&&e.removeAttribute("style");ZT in e&&(e[ZT]=$?u.display:"",e[kU]&&(u.display="none"))}const iB=/\s*!important$/;function xT(e,t,r){if(pc(r))r.forEach(u=>xT(e,t,u));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const u=qat(e,t);iB.test(r)?e.setProperty(b_(u),r.replace(iB,""),"important"):e[u]=r}}const aB=["Webkit","Moz","ms"],S7={};function qat(e,t){const r=S7[t];if(r)return r;let u=wg(t);if(u!=="filter"&&u in e)return S7[t]=u;u=wS(u);for(let T=0;TC7||(Yat.then(()=>C7=0),C7=Date.now());function Jat(e,t){const r=u=>{if(!u._vts)u._vts=Date.now();else if(u._vts<=r.attached)return;Ng(Qat(u,r.value),t,5,[u])};return r.value=e,r.attached=Xat(),r}function Qat(e,t){if(pc(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(u=>T=>!T._stopped&&u&&u(T))}else return t}const hB=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,tot=(e,t,r,u,T,$)=>{const K=T==="svg";t==="class"?$at(e,u,K):t==="style"?Wat(e,r,u):_S(t)?mE(t)||Zat(e,t,r,u,$):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):eot(e,t,u,K))?(lB(e,t,u),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&sB(e,t,u,K,$,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Af(u))?lB(e,wg(t),u,$,t):(t==="true-value"?e._trueValue=u:t==="false-value"&&(e._falseValue=u),sB(e,t,u,K))};function eot(e,t,r,u){if(u)return!!(t==="innerHTML"||t==="textContent"||t in e&&hB(t)&&Xc(r));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const T=e.tagName;if(T==="IMG"||T==="VIDEO"||T==="CANVAS"||T==="SOURCE")return!1}return hB(t)&&Af(r)?!1:t in e}const TU=new WeakMap,SU=new WeakMap,KT=Symbol("_moveCb"),dB=Symbol("_enterCb"),rot=e=>(delete e.props.mode,e),not=rot({name:"TransitionGroup",props:Rp({},xU,{tag:String,moveClass:String}),setup(e,{slots:t}){const r=IS(),u=Uj();let T,$;return Zj(()=>{if(!T.length)return;const K=e.moveClass||`${e.name||"v"}-move`;if(!lot(T[0].el,r.vnode.el,K)){T=[];return}T.forEach(aot),T.forEach(oot);const ct=T.filter(sot);GM(),ct.forEach(yt=>{const St=yt.el,Ut=St.style;vv(St,K),Ut.transform=Ut.webkitTransform=Ut.transitionDuration="";const ne=St[KT]=pe=>{pe&&pe.target!==St||(!pe||/transform$/.test(pe.propertyName))&&(St.removeEventListener("transitionend",ne),St[KT]=null,Gy(St,K))};St.addEventListener("transitionend",ne)}),T=[]}),()=>{const K=ru(e),ct=bU(K);let yt=K.tag||Es;if(T=[],$)for(let St=0;St<$.length;St++){const Ut=$[St];Ut.el&&Ut.el instanceof Element&&(T.push(Ut),jx(Ut,R5(Ut,ct,u,r)),TU.set(Ut,Ut.el.getBoundingClientRect()))}$=t.default?CE(t.default()):[];for(let St=0;St<$.length;St++){const Ut=$[St];Ut.key!=null&&jx(Ut,R5(Ut,ct,u,r))}return Vs(yt,null,$)}}}),iot=not;function aot(e){const t=e.el;t[KT]&&t[KT](),t[dB]&&t[dB]()}function oot(e){SU.set(e,e.el.getBoundingClientRect())}function sot(e){const t=TU.get(e),r=SU.get(e),u=t.left-r.left,T=t.top-r.top;if(u||T){const $=e.el.style;return $.transform=$.webkitTransform=`translate(${u}px,${T}px)`,$.transitionDuration="0s",e}}function lot(e,t,r){const u=e.cloneNode(),T=e[R2];T&&T.forEach(ct=>{ct.split(/\s+/).forEach(yt=>yt&&u.classList.remove(yt))}),r.split(/\s+/).forEach(ct=>ct&&u.classList.add(ct)),u.style.display="none";const $=t.nodeType===1?t:t.parentNode;$.appendChild(u);const{hasTransform:K}=wU(u);return $.removeChild(u),K}const N2=e=>{const t=e.props["onUpdate:modelValue"]||!1;return pc(t)?r=>mT(t,r):t};function cot(e){e.target.composing=!0}function fB(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const U1=Symbol("_assign"),lu={created(e,{modifiers:{lazy:t,trim:r,number:u}},T){e[U1]=N2(T);const $=u||T.props&&T.props.type==="number";o_(e,t?"change":"input",K=>{if(K.target.composing)return;let ct=e.value;r&&(ct=ct.trim()),$&&(ct=NT(ct)),e[U1](ct)}),r&&o_(e,"change",()=>{e.value=e.value.trim()}),t||(o_(e,"compositionstart",cot),o_(e,"compositionend",fB),o_(e,"change",fB))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:r,modifiers:{lazy:u,trim:T,number:$}},K){if(e[U1]=N2(K),e.composing)return;const ct=($||e.type==="number")&&!/^0\d/.test(e.value)?NT(e.value):e.value,yt=t??"";ct!==yt&&(document.activeElement===e&&e.type!=="range"&&(u&&t===r||T&&e.value.trim()===yt)||(e.value=yt))}},j5={created(e,{value:t},r){e.checked=B2(t,r.props.value),e[U1]=N2(r),o_(e,"change",()=>{e[U1](U5(e))})},beforeUpdate(e,{value:t,oldValue:r},u){e[U1]=N2(u),t!==r&&(e.checked=B2(t,u.props.value))}},xg={deep:!0,created(e,{value:t,modifiers:{number:r}},u){const T=xS(t);o_(e,"change",()=>{const $=Array.prototype.filter.call(e.options,K=>K.selected).map(K=>r?NT(U5(K)):U5(K));e[U1](e.multiple?T?new Set($):$:$[0]),e._assigning=!0,sp(()=>{e._assigning=!1})}),e[U1]=N2(u)},mounted(e,{value:t}){pB(e,t)},beforeUpdate(e,t,r){e[U1]=N2(r)},updated(e,{value:t}){e._assigning||pB(e,t)}};function pB(e,t){const r=e.multiple,u=pc(t);if(!(r&&!u&&!xS(t))){for(let T=0,$=e.options.length;T<$;T++){const K=e.options[T],ct=U5(K);if(r)if(u){const yt=typeof ct;yt==="string"||yt==="number"?K.selected=t.some(St=>String(St)===String(ct)):K.selected=eit(t,ct)>-1}else K.selected=t.has(ct);else if(B2(U5(K),t)){e.selectedIndex!==T&&(e.selectedIndex=T);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function U5(e){return"_value"in e?e._value:e.value}const uot=["ctrl","shift","alt","meta"],hot={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>uot.some(r=>e[`${r}Key`]&&!t.includes(r))},Od=(e,t)=>{const r=e._withMods||(e._withMods={}),u=t.join(".");return r[u]||(r[u]=(T,...$)=>{for(let K=0;K{const r=e._withKeys||(e._withKeys={}),u=t.join(".");return r[u]||(r[u]=T=>{if(!("key"in T))return;const $=b_(T.key);if(t.some(K=>K===$||dot[K]===$))return e(T)})},fot=Rp({patchProp:tot},Fat);let mB;function pot(){return mB||(mB=lat(fot))}const mot=(...e)=>{const t=pot().createApp(...e),{mount:r}=t;return t.mount=u=>{const T=vot(u);if(!T)return;const $=t._component;!Xc($)&&!$.render&&!$.template&&($.template=T.innerHTML),T.nodeType===1&&(T.textContent="");const K=r(T,!1,got(T));return T instanceof Element&&(T.removeAttribute("v-cloak"),T.setAttribute("data-v-app","")),K},t};function got(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function vot(e){return Af(e)?document.querySelector(e):e}/*! * pinia v3.0.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let CU;const zS=e=>CU=e,AU=Symbol();function ZM(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var T5;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(T5||(T5={}));function yot(){const e=dj(!0),t=e.run(()=>li({}));let r=[],u=[];const T=j1({install($){zS(T),T._a=$,$.provide(AU,T),$.config.globalProperties.$pinia=T,u.forEach(K=>r.push(K)),u=[]},use($){return this._a?r.push($):u.push($),this},_p:r,_a:null,_e:e,_s:new Map,state:t});return T}const MU=()=>{};function gB(e,t,r,u=MU){e.add(t);const T=()=>{e.delete(t)&&u()};return!r&&fj()&&rit(T),T}function p2(e,...t){e.forEach(r=>{r(...t)})}const _ot=e=>e(),vB=Symbol(),A7=Symbol();function KM(e,t){e instanceof Map&&t instanceof Map?t.forEach((r,u)=>e.set(u,r)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const r in t){if(!t.hasOwnProperty(r))continue;const u=t[r],T=e[r];ZM(T)&&ZM(u)&&e.hasOwnProperty(r)&&!hp(u)&&!f_(u)?e[r]=KM(T,u):e[r]=u}return e}const xot=Symbol();function bot(e){return!ZM(e)||!Object.prototype.hasOwnProperty.call(e,xot)}const{assign:Ky}=Object;function wot(e){return!!(hp(e)&&e.effect)}function kot(e,t,r,u){const{state:T,actions:$,getters:K}=t,ct=r.state.value[e];let yt;function St(){ct||(r.state.value[e]=T?T():{});const Ut=Sit(r.state.value[e]);return Ky(Ut,$,Object.keys(K||{}).reduce((ne,pe)=>(ne[pe]=j1(Ao(()=>{zS(r);const me=r._s.get(e);return K[pe].call(me,me)})),ne),{}))}return yt=EU(e,St,t,r,u,!0),yt}function EU(e,t,r={},u,T,$){let K;const ct=Ky({actions:{}},r),yt={deep:!0};let St,Ut,ne=new Set,pe=new Set,me;const we=u.state.value[e];!$&&!we&&(u.state.value[e]={}),li({});let Ce;function Ve(Mn){let Br;St=Ut=!1,typeof Mn=="function"?(Mn(u.state.value[e]),Br={type:T5.patchFunction,storeId:e,events:me}):(KM(u.state.value[e],Mn),Br={type:T5.patchObject,payload:Mn,storeId:e,events:me});const Vn=Ce=Symbol();sp().then(()=>{Ce===Vn&&(St=!0)}),Ut=!0,p2(ne,Br,u.state.value[e])}const kr=$?function(){const{state:Br}=r,Vn=Br?Br():{};this.$patch(on=>{Ky(on,Vn)})}:MU;function It(){K.stop(),ne.clear(),pe.clear(),u._s.delete(e)}const rn=(Mn,Br="")=>{if(vB in Mn)return Mn[A7]=Br,Mn;const Vn=function(){zS(u);const on=Array.from(arguments),pr=new Set,_r=new Set;function Sr(Cn){pr.add(Cn)}function Dr(Cn){_r.add(Cn)}p2(pe,{args:on,name:Vn[A7],store:Mr,after:Sr,onError:Dr});let nn;try{nn=Mn.apply(this&&this.$id===e?this:Mr,on)}catch(Cn){throw p2(_r,Cn),Cn}return nn instanceof Promise?nn.then(Cn=>(p2(pr,Cn),Cn)).catch(Cn=>(p2(_r,Cn),Promise.reject(Cn))):(p2(pr,nn),nn)};return Vn[vB]=!0,Vn[A7]=Br,Vn},Lr={_p:u,$id:e,$onAction:gB.bind(null,pe),$patch:Ve,$reset:kr,$subscribe(Mn,Br={}){const Vn=gB(ne,Mn,Br.detached,()=>on()),on=K.run(()=>Fh(()=>u.state.value[e],pr=>{(Br.flush==="sync"?Ut:St)&&Mn({storeId:e,type:T5.direct,events:me},pr)},Ky({},yt,Br)));return Vn},$dispose:It},Mr=g_(Lr);u._s.set(e,Mr);const Dn=(u._a&&u._a.runWithContext||_ot)(()=>u._e.run(()=>(K=dj()).run(()=>t({action:rn}))));for(const Mn in Dn){const Br=Dn[Mn];if(hp(Br)&&!wot(Br)||f_(Br))$||(we&&bot(Br)&&(hp(Br)?Br.value=we[Mn]:KM(Br,we[Mn])),u.state.value[e][Mn]=Br);else if(typeof Br=="function"){const Vn=rn(Br,Mn);Dn[Mn]=Vn,ct.actions[Mn]=Br}}return Ky(Mr,Dn),Ky(ru(Mr),Dn),Object.defineProperty(Mr,"$state",{get:()=>u.state.value[e],set:Mn=>{Ve(Br=>{Ky(Br,Mn)})}}),u._p.forEach(Mn=>{Ky(Mr,K.run(()=>Mn({store:Mr,app:u._a,pinia:u,options:ct})))}),we&&$&&r.hydrate&&r.hydrate(Mr.$state,we),St=!0,Ut=!0,Mr}/*! #__NO_SIDE_EFFECTS__ */function OS(e,t,r){let u;const T=typeof t=="function";u=T?r:t;function $(K,ct){const yt=eat();return K=K||(yt?_g(AU,null):null),K&&zS(K),K=CU,K._s.has(e)||(T?EU(e,t,u,K):kot(e,u,K)),K._s.get(e)}return $.$id=e,$}/*! + */let CU;const zS=e=>CU=e,AU=Symbol();function ZM(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var T5;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(T5||(T5={}));function yot(){const e=dj(!0),t=e.run(()=>li({}));let r=[],u=[];const T=j1({install($){zS(T),T._a=$,$.provide(AU,T),$.config.globalProperties.$pinia=T,u.forEach(K=>r.push(K)),u=[]},use($){return this._a?r.push($):u.push($),this},_p:r,_a:null,_e:e,_s:new Map,state:t});return T}const MU=()=>{};function gB(e,t,r,u=MU){e.add(t);const T=()=>{e.delete(t)&&u()};return!r&&fj()&&rit(T),T}function m2(e,...t){e.forEach(r=>{r(...t)})}const _ot=e=>e(),vB=Symbol(),A7=Symbol();function KM(e,t){e instanceof Map&&t instanceof Map?t.forEach((r,u)=>e.set(u,r)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const r in t){if(!t.hasOwnProperty(r))continue;const u=t[r],T=e[r];ZM(T)&&ZM(u)&&e.hasOwnProperty(r)&&!hp(u)&&!f_(u)?e[r]=KM(T,u):e[r]=u}return e}const xot=Symbol();function bot(e){return!ZM(e)||!Object.prototype.hasOwnProperty.call(e,xot)}const{assign:Ky}=Object;function wot(e){return!!(hp(e)&&e.effect)}function kot(e,t,r,u){const{state:T,actions:$,getters:K}=t,ct=r.state.value[e];let yt;function St(){ct||(r.state.value[e]=T?T():{});const Ut=Sit(r.state.value[e]);return Ky(Ut,$,Object.keys(K||{}).reduce((ne,pe)=>(ne[pe]=j1(Ao(()=>{zS(r);const me=r._s.get(e);return K[pe].call(me,me)})),ne),{}))}return yt=EU(e,St,t,r,u,!0),yt}function EU(e,t,r={},u,T,$){let K;const ct=Ky({actions:{}},r),yt={deep:!0};let St,Ut,ne=new Set,pe=new Set,me;const we=u.state.value[e];!$&&!we&&(u.state.value[e]={}),li({});let Ce;function Ve(Mn){let Br;St=Ut=!1,typeof Mn=="function"?(Mn(u.state.value[e]),Br={type:T5.patchFunction,storeId:e,events:me}):(KM(u.state.value[e],Mn),Br={type:T5.patchObject,payload:Mn,storeId:e,events:me});const Vn=Ce=Symbol();sp().then(()=>{Ce===Vn&&(St=!0)}),Ut=!0,m2(ne,Br,u.state.value[e])}const kr=$?function(){const{state:Br}=r,Vn=Br?Br():{};this.$patch(on=>{Ky(on,Vn)})}:MU;function It(){K.stop(),ne.clear(),pe.clear(),u._s.delete(e)}const rn=(Mn,Br="")=>{if(vB in Mn)return Mn[A7]=Br,Mn;const Vn=function(){zS(u);const on=Array.from(arguments),pr=new Set,_r=new Set;function Sr(Cn){pr.add(Cn)}function Dr(Cn){_r.add(Cn)}m2(pe,{args:on,name:Vn[A7],store:Mr,after:Sr,onError:Dr});let nn;try{nn=Mn.apply(this&&this.$id===e?this:Mr,on)}catch(Cn){throw m2(_r,Cn),Cn}return nn instanceof Promise?nn.then(Cn=>(m2(pr,Cn),Cn)).catch(Cn=>(m2(_r,Cn),Promise.reject(Cn))):(m2(pr,nn),nn)};return Vn[vB]=!0,Vn[A7]=Br,Vn},Lr={_p:u,$id:e,$onAction:gB.bind(null,pe),$patch:Ve,$reset:kr,$subscribe(Mn,Br={}){const Vn=gB(ne,Mn,Br.detached,()=>on()),on=K.run(()=>Fh(()=>u.state.value[e],pr=>{(Br.flush==="sync"?Ut:St)&&Mn({storeId:e,type:T5.direct,events:me},pr)},Ky({},yt,Br)));return Vn},$dispose:It},Mr=g_(Lr);u._s.set(e,Mr);const Dn=(u._a&&u._a.runWithContext||_ot)(()=>u._e.run(()=>(K=dj()).run(()=>t({action:rn}))));for(const Mn in Dn){const Br=Dn[Mn];if(hp(Br)&&!wot(Br)||f_(Br))$||(we&&bot(Br)&&(hp(Br)?Br.value=we[Mn]:KM(Br,we[Mn])),u.state.value[e][Mn]=Br);else if(typeof Br=="function"){const Vn=rn(Br,Mn);Dn[Mn]=Vn,ct.actions[Mn]=Br}}return Ky(Mr,Dn),Ky(ru(Mr),Dn),Object.defineProperty(Mr,"$state",{get:()=>u.state.value[e],set:Mn=>{Ve(Br=>{Ky(Br,Mn)})}}),u._p.forEach(Mn=>{Ky(Mr,K.run(()=>Mn({store:Mr,app:u._a,pinia:u,options:ct})))}),we&&$&&r.hydrate&&r.hydrate(Mr.$state,we),St=!0,Ut=!0,Mr}/*! #__NO_SIDE_EFFECTS__ */function OS(e,t,r){let u;const T=typeof t=="function";u=T?r:t;function $(K,ct){const yt=eat();return K=K||(yt?_g(AU,null):null),K&&zS(K),K=CU,K._s.has(e)||(T?EU(e,t,u,K):kot(e,u,K)),K._s.get(e)}return $.$id=e,$}/*! * vue-router v4.6.3 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const k2=typeof document<"u";function LU(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Tot(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&LU(e.default)}const Kh=Object.assign;function M7(e,t){const r={};for(const u in t){const T=t[u];r[u]=jg(T)?T.map(e):e(T)}return r}const S5=()=>{},jg=Array.isArray;function yB(e,t){const r={};for(const u in e)r[u]=u in t?t[u]:e[u];return r}const PU=/#/g,Sot=/&/g,Cot=/\//g,Aot=/=/g,Mot=/\?/g,IU=/\+/g,Eot=/%5B/g,Lot=/%5D/g,DU=/%5E/g,Pot=/%60/g,zU=/%7B/g,Iot=/%7C/g,OU=/%7D/g,Dot=/%20/g;function IE(e){return e==null?"":encodeURI(""+e).replace(Iot,"|").replace(Eot,"[").replace(Lot,"]")}function zot(e){return IE(e).replace(zU,"{").replace(OU,"}").replace(DU,"^")}function YM(e){return IE(e).replace(IU,"%2B").replace(Dot,"+").replace(PU,"%23").replace(Sot,"%26").replace(Pot,"`").replace(zU,"{").replace(OU,"}").replace(DU,"^")}function Oot(e){return YM(e).replace(Aot,"%3D")}function Bot(e){return IE(e).replace(PU,"%23").replace(Mot,"%3F")}function Rot(e){return Bot(e).replace(Cot,"%2F")}function $5(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Fot=/\/$/,Not=e=>e.replace(Fot,"");function E7(e,t,r="/"){let u,T={},$="",K="";const ct=t.indexOf("#");let yt=t.indexOf("?");return yt=ct>=0&&yt>ct?-1:yt,yt>=0&&(u=t.slice(0,yt),$=t.slice(yt,ct>0?ct:t.length),T=e($.slice(1))),ct>=0&&(u=u||t.slice(0,ct),K=t.slice(ct,t.length)),u=Hot(u??t,r),{fullPath:u+$+K,path:u,query:T,hash:$5(K)}}function jot(e,t){const r=t.query?e(t.query):"";return t.path+(r&&"?")+r+(t.hash||"")}function _B(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Uot(e,t,r){const u=t.matched.length-1,T=r.matched.length-1;return u>-1&&u===T&&j2(t.matched[u],r.matched[T])&&BU(t.params,r.params)&&e(t.query)===e(r.query)&&t.hash===r.hash}function j2(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function BU(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!$ot(e[r],t[r]))return!1;return!0}function $ot(e,t){return jg(e)?xB(e,t):jg(t)?xB(t,e):e===t}function xB(e,t){return jg(t)?e.length===t.length&&e.every((r,u)=>r===t[u]):e.length===1&&e[0]===t}function Hot(e,t){if(e.startsWith("/"))return e;if(!e)return t;const r=t.split("/"),u=e.split("/"),T=u[u.length-1];(T===".."||T===".")&&u.push("");let $=r.length-1,K,ct;for(K=0;K1&&$--;else break;return r.slice(0,$).join("/")+"/"+u.slice(K).join("/")}const jy={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let XM=function(e){return e.pop="pop",e.push="push",e}({}),L7=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function Vot(e){if(!e)if(k2){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Not(e)}const Wot=/^[^#]+#/;function qot(e,t){return e.replace(Wot,"#")+t}function Got(e,t){const r=document.documentElement.getBoundingClientRect(),u=e.getBoundingClientRect();return{behavior:t.behavior,left:u.left-r.left-(t.left||0),top:u.top-r.top-(t.top||0)}}const BS=()=>({left:window.scrollX,top:window.scrollY});function Zot(e){let t;if("el"in e){const r=e.el,u=typeof r=="string"&&r.startsWith("#"),T=typeof r=="string"?u?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!T)return;t=Got(T,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function bB(e,t){return(history.state?history.state.position-t:-1)+e}const JM=new Map;function Kot(e,t){JM.set(e,t)}function Yot(e){const t=JM.get(e);return JM.delete(e),t}function Xot(e){return typeof e=="string"||e&&typeof e=="object"}function RU(e){return typeof e=="string"||typeof e=="symbol"}let Nf=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const FU=Symbol("");Nf.MATCHER_NOT_FOUND+"",Nf.NAVIGATION_GUARD_REDIRECT+"",Nf.NAVIGATION_ABORTED+"",Nf.NAVIGATION_CANCELLED+"",Nf.NAVIGATION_DUPLICATED+"";function U2(e,t){return Kh(new Error,{type:e,[FU]:!0},t)}function g1(e,t){return e instanceof Error&&FU in e&&(t==null||!!(e.type&t))}const Jot=["params","query","hash"];function Qot(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const r of Jot)r in e&&(t[r]=e[r]);return JSON.stringify(t,null,2)}function tst(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let u=0;uT&&YM(T)):[u&&YM(u)]).forEach(T=>{T!==void 0&&(t+=(t.length?"&":"")+r,T!=null&&(t+="="+T))})}return t}function est(e){const t={};for(const r in e){const u=e[r];u!==void 0&&(t[r]=jg(u)?u.map(T=>T==null?null:""+T):u==null?u:""+u)}return t}const rst=Symbol(""),kB=Symbol(""),RS=Symbol(""),DE=Symbol(""),QM=Symbol("");function z3(){let e=[];function t(u){return e.push(u),()=>{const T=e.indexOf(u);T>-1&&e.splice(T,1)}}function r(){e=[]}return{add:t,list:()=>e.slice(),reset:r}}function n_(e,t,r,u,T,$=K=>K()){const K=u&&(u.enterCallbacks[T]=u.enterCallbacks[T]||[]);return()=>new Promise((ct,yt)=>{const St=pe=>{pe===!1?yt(U2(Nf.NAVIGATION_ABORTED,{from:r,to:t})):pe instanceof Error?yt(pe):Xot(pe)?yt(U2(Nf.NAVIGATION_GUARD_REDIRECT,{from:t,to:pe})):(K&&u.enterCallbacks[T]===K&&typeof pe=="function"&&K.push(pe),ct())},Ut=$(()=>e.call(u&&u.instances[T],t,r,St));let ne=Promise.resolve(Ut);e.length<3&&(ne=ne.then(St)),ne.catch(pe=>yt(pe))})}function P7(e,t,r,u,T=$=>$()){const $=[];for(const K of e)for(const ct in K.components){let yt=K.components[ct];if(!(t!=="beforeRouteEnter"&&!K.instances[ct]))if(LU(yt)){const St=(yt.__vccOpts||yt)[t];St&&$.push(n_(St,r,u,K,ct,T))}else{let St=yt();$.push(()=>St.then(Ut=>{if(!Ut)throw new Error(`Couldn't resolve component "${ct}" at "${K.path}"`);const ne=Tot(Ut)?Ut.default:Ut;K.mods[ct]=Ut,K.components[ct]=ne;const pe=(ne.__vccOpts||ne)[t];return pe&&n_(pe,r,u,K,ct,T)()}))}}return $}function nst(e,t){const r=[],u=[],T=[],$=Math.max(t.matched.length,e.matched.length);for(let K=0;K<$;K++){const ct=t.matched[K];ct&&(e.matched.find(St=>j2(St,ct))?u.push(ct):r.push(ct));const yt=e.matched[K];yt&&(t.matched.find(St=>j2(St,yt))||T.push(yt))}return[r,u,T]}/*! + */const T2=typeof document<"u";function LU(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Tot(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&LU(e.default)}const Kh=Object.assign;function M7(e,t){const r={};for(const u in t){const T=t[u];r[u]=jg(T)?T.map(e):e(T)}return r}const S5=()=>{},jg=Array.isArray;function yB(e,t){const r={};for(const u in e)r[u]=u in t?t[u]:e[u];return r}const PU=/#/g,Sot=/&/g,Cot=/\//g,Aot=/=/g,Mot=/\?/g,IU=/\+/g,Eot=/%5B/g,Lot=/%5D/g,DU=/%5E/g,Pot=/%60/g,zU=/%7B/g,Iot=/%7C/g,OU=/%7D/g,Dot=/%20/g;function IE(e){return e==null?"":encodeURI(""+e).replace(Iot,"|").replace(Eot,"[").replace(Lot,"]")}function zot(e){return IE(e).replace(zU,"{").replace(OU,"}").replace(DU,"^")}function YM(e){return IE(e).replace(IU,"%2B").replace(Dot,"+").replace(PU,"%23").replace(Sot,"%26").replace(Pot,"`").replace(zU,"{").replace(OU,"}").replace(DU,"^")}function Oot(e){return YM(e).replace(Aot,"%3D")}function Bot(e){return IE(e).replace(PU,"%23").replace(Mot,"%3F")}function Rot(e){return Bot(e).replace(Cot,"%2F")}function $5(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Fot=/\/$/,Not=e=>e.replace(Fot,"");function E7(e,t,r="/"){let u,T={},$="",K="";const ct=t.indexOf("#");let yt=t.indexOf("?");return yt=ct>=0&&yt>ct?-1:yt,yt>=0&&(u=t.slice(0,yt),$=t.slice(yt,ct>0?ct:t.length),T=e($.slice(1))),ct>=0&&(u=u||t.slice(0,ct),K=t.slice(ct,t.length)),u=Hot(u??t,r),{fullPath:u+$+K,path:u,query:T,hash:$5(K)}}function jot(e,t){const r=t.query?e(t.query):"";return t.path+(r&&"?")+r+(t.hash||"")}function _B(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Uot(e,t,r){const u=t.matched.length-1,T=r.matched.length-1;return u>-1&&u===T&&j2(t.matched[u],r.matched[T])&&BU(t.params,r.params)&&e(t.query)===e(r.query)&&t.hash===r.hash}function j2(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function BU(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!$ot(e[r],t[r]))return!1;return!0}function $ot(e,t){return jg(e)?xB(e,t):jg(t)?xB(t,e):e===t}function xB(e,t){return jg(t)?e.length===t.length&&e.every((r,u)=>r===t[u]):e.length===1&&e[0]===t}function Hot(e,t){if(e.startsWith("/"))return e;if(!e)return t;const r=t.split("/"),u=e.split("/"),T=u[u.length-1];(T===".."||T===".")&&u.push("");let $=r.length-1,K,ct;for(K=0;K1&&$--;else break;return r.slice(0,$).join("/")+"/"+u.slice(K).join("/")}const jy={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let XM=function(e){return e.pop="pop",e.push="push",e}({}),L7=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function Vot(e){if(!e)if(T2){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Not(e)}const Wot=/^[^#]+#/;function qot(e,t){return e.replace(Wot,"#")+t}function Got(e,t){const r=document.documentElement.getBoundingClientRect(),u=e.getBoundingClientRect();return{behavior:t.behavior,left:u.left-r.left-(t.left||0),top:u.top-r.top-(t.top||0)}}const BS=()=>({left:window.scrollX,top:window.scrollY});function Zot(e){let t;if("el"in e){const r=e.el,u=typeof r=="string"&&r.startsWith("#"),T=typeof r=="string"?u?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!T)return;t=Got(T,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function bB(e,t){return(history.state?history.state.position-t:-1)+e}const JM=new Map;function Kot(e,t){JM.set(e,t)}function Yot(e){const t=JM.get(e);return JM.delete(e),t}function Xot(e){return typeof e=="string"||e&&typeof e=="object"}function RU(e){return typeof e=="string"||typeof e=="symbol"}let Nf=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const FU=Symbol("");Nf.MATCHER_NOT_FOUND+"",Nf.NAVIGATION_GUARD_REDIRECT+"",Nf.NAVIGATION_ABORTED+"",Nf.NAVIGATION_CANCELLED+"",Nf.NAVIGATION_DUPLICATED+"";function U2(e,t){return Kh(new Error,{type:e,[FU]:!0},t)}function g1(e,t){return e instanceof Error&&FU in e&&(t==null||!!(e.type&t))}const Jot=["params","query","hash"];function Qot(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const r of Jot)r in e&&(t[r]=e[r]);return JSON.stringify(t,null,2)}function tst(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let u=0;uT&&YM(T)):[u&&YM(u)]).forEach(T=>{T!==void 0&&(t+=(t.length?"&":"")+r,T!=null&&(t+="="+T))})}return t}function est(e){const t={};for(const r in e){const u=e[r];u!==void 0&&(t[r]=jg(u)?u.map(T=>T==null?null:""+T):u==null?u:""+u)}return t}const rst=Symbol(""),kB=Symbol(""),RS=Symbol(""),DE=Symbol(""),QM=Symbol("");function z3(){let e=[];function t(u){return e.push(u),()=>{const T=e.indexOf(u);T>-1&&e.splice(T,1)}}function r(){e=[]}return{add:t,list:()=>e.slice(),reset:r}}function n_(e,t,r,u,T,$=K=>K()){const K=u&&(u.enterCallbacks[T]=u.enterCallbacks[T]||[]);return()=>new Promise((ct,yt)=>{const St=pe=>{pe===!1?yt(U2(Nf.NAVIGATION_ABORTED,{from:r,to:t})):pe instanceof Error?yt(pe):Xot(pe)?yt(U2(Nf.NAVIGATION_GUARD_REDIRECT,{from:t,to:pe})):(K&&u.enterCallbacks[T]===K&&typeof pe=="function"&&K.push(pe),ct())},Ut=$(()=>e.call(u&&u.instances[T],t,r,St));let ne=Promise.resolve(Ut);e.length<3&&(ne=ne.then(St)),ne.catch(pe=>yt(pe))})}function P7(e,t,r,u,T=$=>$()){const $=[];for(const K of e)for(const ct in K.components){let yt=K.components[ct];if(!(t!=="beforeRouteEnter"&&!K.instances[ct]))if(LU(yt)){const St=(yt.__vccOpts||yt)[t];St&&$.push(n_(St,r,u,K,ct,T))}else{let St=yt();$.push(()=>St.then(Ut=>{if(!Ut)throw new Error(`Couldn't resolve component "${ct}" at "${K.path}"`);const ne=Tot(Ut)?Ut.default:Ut;K.mods[ct]=Ut,K.components[ct]=ne;const pe=(ne.__vccOpts||ne)[t];return pe&&n_(pe,r,u,K,ct,T)()}))}}return $}function nst(e,t){const r=[],u=[],T=[],$=Math.max(t.matched.length,e.matched.length);for(let K=0;K<$;K++){const ct=t.matched[K];ct&&(e.matched.find(St=>j2(St,ct))?u.push(ct):r.push(ct));const yt=e.matched[K];yt&&(t.matched.find(St=>j2(St,yt))||T.push(yt))}return[r,u,T]}/*! * vue-router v4.6.3 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let ist=()=>location.protocol+"//"+location.host;function NU(e,t){const{pathname:r,search:u,hash:T}=t,$=e.indexOf("#");if($>-1){let K=T.includes(e.slice($))?e.slice($).length:1,ct=T.slice(K);return ct[0]!=="/"&&(ct="/"+ct),_B(ct,"")}return _B(r,e)+u+T}function ast(e,t,r,u){let T=[],$=[],K=null;const ct=({state:pe})=>{const me=NU(e,location),we=r.value,Ce=t.value;let Ve=0;if(pe){if(r.value=me,t.value=pe,K&&K===we){K=null;return}Ve=Ce?pe.position-Ce.position:0}else u(me);T.forEach(kr=>{kr(r.value,we,{delta:Ve,type:XM.pop,direction:Ve?Ve>0?L7.forward:L7.back:L7.unknown})})};function yt(){K=r.value}function St(pe){T.push(pe);const me=()=>{const we=T.indexOf(pe);we>-1&&T.splice(we,1)};return $.push(me),me}function Ut(){if(document.visibilityState==="hidden"){const{history:pe}=window;if(!pe.state)return;pe.replaceState(Kh({},pe.state,{scroll:BS()}),"")}}function ne(){for(const pe of $)pe();$=[],window.removeEventListener("popstate",ct),window.removeEventListener("pagehide",Ut),document.removeEventListener("visibilitychange",Ut)}return window.addEventListener("popstate",ct),window.addEventListener("pagehide",Ut),document.addEventListener("visibilitychange",Ut),{pauseListeners:yt,listen:St,destroy:ne}}function TB(e,t,r,u=!1,T=!1){return{back:e,current:t,forward:r,replaced:u,position:window.history.length,scroll:T?BS():null}}function ost(e){const{history:t,location:r}=window,u={value:NU(e,r)},T={value:t.state};T.value||$(u.value,{back:null,current:u.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function $(yt,St,Ut){const ne=e.indexOf("#"),pe=ne>-1?(r.host&&document.querySelector("base")?e:e.slice(ne))+yt:ist()+e+yt;try{t[Ut?"replaceState":"pushState"](St,"",pe),T.value=St}catch(me){console.error(me),r[Ut?"replace":"assign"](pe)}}function K(yt,St){$(yt,Kh({},t.state,TB(T.value.back,yt,T.value.forward,!0),St,{position:T.value.position}),!0),u.value=yt}function ct(yt,St){const Ut=Kh({},T.value,t.state,{forward:yt,scroll:BS()});$(Ut.current,Ut,!0),$(yt,Kh({},TB(u.value,yt,null),{position:Ut.position+1},St),!1),u.value=yt}return{location:u,state:T,push:ct,replace:K}}function sst(e){e=Vot(e);const t=ost(e),r=ast(e,t.state,t.location,t.replace);function u($,K=!0){K||r.pauseListeners(),history.go($)}const T=Kh({location:"",base:e,go:u,createHref:qot.bind(null,e)},t,r);return Object.defineProperty(T,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(T,"state",{enumerable:!0,get:()=>t.state.value}),T}let Cx=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Op=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Op||{});const lst={type:Cx.Static,value:""},cst=/[a-zA-Z0-9_]/;function ust(e){if(!e)return[[]];if(e==="/")return[[lst]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(me){throw new Error(`ERR (${r})/"${St}": ${me}`)}let r=Op.Static,u=r;const T=[];let $;function K(){$&&T.push($),$=[]}let ct=0,yt,St="",Ut="";function ne(){St&&(r===Op.Static?$.push({type:Cx.Static,value:St}):r===Op.Param||r===Op.ParamRegExp||r===Op.ParamRegExpEnd?($.length>1&&(yt==="*"||yt==="+")&&t(`A repeatable param (${St}) must be alone in its segment. eg: '/:ids+.`),$.push({type:Cx.Param,value:St,regexp:Ut,repeatable:yt==="*"||yt==="+",optional:yt==="*"||yt==="?"})):t("Invalid state to consume buffer"),St="")}function pe(){St+=yt}for(;ctt.length?t.length===1&&t[0]===rm.Static+rm.Segment?1:-1:0}function jU(e,t){let r=0;const u=e.score,T=t.score;for(;r0&&t[t.length-1]<0}const mst={strict:!1,end:!0,sensitive:!1};function gst(e,t,r){const u=fst(ust(e.path),r),T=Kh(u,{record:e,parent:t,children:[],alias:[]});return t&&!T.record.aliasOf==!t.record.aliasOf&&t.children.push(T),T}function vst(e,t){const r=[],u=new Map;t=yB(mst,t);function T(ne){return u.get(ne)}function $(ne,pe,me){const we=!me,Ce=MB(ne);Ce.aliasOf=me&&me.record;const Ve=yB(t,ne),kr=[Ce];if("alias"in ne){const Lr=typeof ne.alias=="string"?[ne.alias]:ne.alias;for(const Mr of Lr)kr.push(MB(Kh({},Ce,{components:me?me.record.components:Ce.components,path:Mr,aliasOf:me?me.record:Ce})))}let It,rn;for(const Lr of kr){const{path:Mr}=Lr;if(pe&&Mr[0]!=="/"){const tn=pe.record.path,Dn=tn[tn.length-1]==="/"?"":"/";Lr.path=pe.record.path+(Mr&&Dn+Mr)}if(It=gst(Lr,pe,Ve),me?me.alias.push(It):(rn=rn||It,rn!==It&&rn.alias.push(It),we&&ne.name&&!EB(It)&&K(ne.name)),UU(It)&&yt(It),Ce.children){const tn=Ce.children;for(let Dn=0;Dn{K(rn)}:S5}function K(ne){if(RU(ne)){const pe=u.get(ne);pe&&(u.delete(ne),r.splice(r.indexOf(pe),1),pe.children.forEach(K),pe.alias.forEach(K))}else{const pe=r.indexOf(ne);pe>-1&&(r.splice(pe,1),ne.record.name&&u.delete(ne.record.name),ne.children.forEach(K),ne.alias.forEach(K))}}function ct(){return r}function yt(ne){const pe=xst(ne,r);r.splice(pe,0,ne),ne.record.name&&!EB(ne)&&u.set(ne.record.name,ne)}function St(ne,pe){let me,we={},Ce,Ve;if("name"in ne&&ne.name){if(me=u.get(ne.name),!me)throw U2(Nf.MATCHER_NOT_FOUND,{location:ne});Ve=me.record.name,we=Kh(AB(pe.params,me.keys.filter(rn=>!rn.optional).concat(me.parent?me.parent.keys.filter(rn=>rn.optional):[]).map(rn=>rn.name)),ne.params&&AB(ne.params,me.keys.map(rn=>rn.name))),Ce=me.stringify(we)}else if(ne.path!=null)Ce=ne.path,me=r.find(rn=>rn.re.test(Ce)),me&&(we=me.parse(Ce),Ve=me.record.name);else{if(me=pe.name?u.get(pe.name):r.find(rn=>rn.re.test(pe.path)),!me)throw U2(Nf.MATCHER_NOT_FOUND,{location:ne,currentLocation:pe});Ve=me.record.name,we=Kh({},pe.params,ne.params),Ce=me.stringify(we)}const kr=[];let It=me;for(;It;)kr.unshift(It.record),It=It.parent;return{name:Ve,path:Ce,params:we,matched:kr,meta:_st(kr)}}e.forEach(ne=>$(ne));function Ut(){r.length=0,u.clear()}return{addRoute:$,resolve:St,removeRoute:K,clearRoutes:Ut,getRoutes:ct,getRecordMatcher:T}}function AB(e,t){const r={};for(const u of t)u in e&&(r[u]=e[u]);return r}function MB(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:yst(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function yst(e){const t={},r=e.props||!1;if("component"in e)t.default=r;else for(const u in e.components)t[u]=typeof r=="object"?r[u]:r;return t}function EB(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _st(e){return e.reduce((t,r)=>Kh(t,r.meta),{})}function xst(e,t){let r=0,u=t.length;for(;r!==u;){const $=r+u>>1;jU(e,t[$])<0?u=$:r=$+1}const T=bst(e);return T&&(u=t.lastIndexOf(T,u-1)),u}function bst(e){let t=e;for(;t=t.parent;)if(UU(t)&&jU(e,t)===0)return t}function UU({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function LB(e){const t=_g(RS),r=_g(DE),u=Ao(()=>{const yt=Io(e.to);return t.resolve(yt)}),T=Ao(()=>{const{matched:yt}=u.value,{length:St}=yt,Ut=yt[St-1],ne=r.matched;if(!Ut||!ne.length)return-1;const pe=ne.findIndex(j2.bind(null,Ut));if(pe>-1)return pe;const me=PB(yt[St-2]);return St>1&&PB(Ut)===me&&ne[ne.length-1].path!==me?ne.findIndex(j2.bind(null,yt[St-2])):pe}),$=Ao(()=>T.value>-1&&Cst(r.params,u.value.params)),K=Ao(()=>T.value>-1&&T.value===r.matched.length-1&&BU(r.params,u.value.params));function ct(yt={}){if(Sst(yt)){const St=t[Io(e.replace)?"replace":"push"](Io(e.to)).catch(S5);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>St),St}return Promise.resolve()}return{route:u,href:Ao(()=>u.value.href),isActive:$,isExactActive:K,navigate:ct}}function wst(e){return e.length===1?e[0]:e}const kst=Cc({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:LB,setup(e,{slots:t}){const r=g_(LB(e)),{options:u}=_g(RS),T=Ao(()=>({[IB(e.activeClass,u.linkActiveClass,"router-link-active")]:r.isActive,[IB(e.exactActiveClass,u.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive}));return()=>{const $=t.default&&wst(t.default(r));return e.custom?$:PE("a",{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:T.value},$)}}}),Tst=kst;function Sst(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Cst(e,t){for(const r in t){const u=t[r],T=e[r];if(typeof u=="string"){if(u!==T)return!1}else if(!jg(T)||T.length!==u.length||u.some(($,K)=>$!==T[K]))return!1}return!0}function PB(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const IB=(e,t,r)=>e??t??r,Ast=Cc({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:r}){const u=_g(QM),T=Ao(()=>e.route||u.value),$=_g(kB,0),K=Ao(()=>{let St=Io($);const{matched:Ut}=T.value;let ne;for(;(ne=Ut[St])&&!ne.components;)St++;return St}),ct=Ao(()=>T.value.matched[K.value]);vT(kB,Ao(()=>K.value+1)),vT(rst,ct),vT(QM,T);const yt=li();return Fh(()=>[yt.value,ct.value,e.name],([St,Ut,ne],[pe,me,we])=>{Ut&&(Ut.instances[ne]=St,me&&me!==Ut&&St&&St===pe&&(Ut.leaveGuards.size||(Ut.leaveGuards=me.leaveGuards),Ut.updateGuards.size||(Ut.updateGuards=me.updateGuards))),St&&Ut&&(!me||!j2(Ut,me)||!pe)&&(Ut.enterCallbacks[ne]||[]).forEach(Ce=>Ce(St))},{flush:"post"}),()=>{const St=T.value,Ut=e.name,ne=ct.value,pe=ne&&ne.components[Ut];if(!pe)return DB(r.default,{Component:pe,route:St});const me=ne.props[Ut],we=me?me===!0?St.params:typeof me=="function"?me(St):me:null,Ve=PE(pe,Kh({},we,t,{onVnodeUnmounted:kr=>{kr.component.isUnmounted&&(ne.instances[Ut]=null)},ref:yt}));return DB(r.default,{Component:Ve,route:St})||Ve}}});function DB(e,t){if(!e)return null;const r=e(t);return r.length===1?r[0]:r}const Mst=Ast;function Est(e){const t=vst(e.routes,e),r=e.parseQuery||tst,u=e.stringifyQuery||wB,T=e.history,$=z3(),K=z3(),ct=z3(),yt=wit(jy);let St=jy;k2&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const Ut=M7.bind(null,hi=>""+hi),ne=M7.bind(null,Rot),pe=M7.bind(null,$5);function me(hi,aa){let io,oo;return RU(hi)?(io=t.getRecordMatcher(hi),oo=aa):oo=hi,t.addRoute(oo,io)}function we(hi){const aa=t.getRecordMatcher(hi);aa&&t.removeRoute(aa)}function Ce(){return t.getRoutes().map(hi=>hi.record)}function Ve(hi){return!!t.getRecordMatcher(hi)}function kr(hi,aa){if(aa=Kh({},aa||yt.value),typeof hi=="string"){const Hn=E7(r,hi,aa.path),Qa=t.resolve({path:Hn.path},aa),Ha=T.createHref(Hn.fullPath);return Kh(Hn,Qa,{params:pe(Qa.params),hash:$5(Hn.hash),redirectedFrom:void 0,href:Ha})}let io;if(hi.path!=null)io=Kh({},hi,{path:E7(r,hi.path,aa.path).path});else{const Hn=Kh({},hi.params);for(const Qa in Hn)Hn[Qa]==null&&delete Hn[Qa];io=Kh({},hi,{params:ne(Hn)}),aa.params=ne(aa.params)}const oo=t.resolve(io,aa),xa=hi.hash||"";oo.params=Ut(pe(oo.params));const Ur=jot(u,Kh({},hi,{hash:zot(xa),path:oo.path})),Sn=T.createHref(Ur);return Kh({fullPath:Ur,hash:xa,query:u===wB?est(hi.query):hi.query||{}},oo,{redirectedFrom:void 0,href:Sn})}function It(hi){return typeof hi=="string"?E7(r,hi,yt.value.path):Kh({},hi)}function rn(hi,aa){if(St!==hi)return U2(Nf.NAVIGATION_CANCELLED,{from:aa,to:hi})}function Lr(hi){return Dn(hi)}function Mr(hi){return Lr(Kh(It(hi),{replace:!0}))}function tn(hi,aa){const io=hi.matched[hi.matched.length-1];if(io&&io.redirect){const{redirect:oo}=io;let xa=typeof oo=="function"?oo(hi,aa):oo;return typeof xa=="string"&&(xa=xa.includes("?")||xa.includes("#")?xa=It(xa):{path:xa},xa.params={}),Kh({query:hi.query,hash:hi.hash,params:xa.path!=null?{}:hi.params},xa)}}function Dn(hi,aa){const io=St=kr(hi),oo=yt.value,xa=hi.state,Ur=hi.force,Sn=hi.replace===!0,Hn=tn(io,oo);if(Hn)return Dn(Kh(It(Hn),{state:typeof Hn=="object"?Kh({},xa,Hn.state):xa,force:Ur,replace:Sn}),aa||io);const Qa=io;Qa.redirectedFrom=aa;let Ha;return!Ur&&Uot(u,oo,io)&&(Ha=U2(Nf.NAVIGATION_DUPLICATED,{to:Qa,from:oo}),va(oo,oo,!0,!1)),(Ha?Promise.resolve(Ha):Vn(Qa,oo)).catch(qa=>g1(qa)?g1(qa,Nf.NAVIGATION_GUARD_REDIRECT)?qa:ta(qa):Xn(qa,Qa,oo)).then(qa=>{if(qa){if(g1(qa,Nf.NAVIGATION_GUARD_REDIRECT))return Dn(Kh({replace:Sn},It(qa.to),{state:typeof qa.to=="object"?Kh({},xa,qa.to.state):xa,force:Ur}),aa||Qa)}else qa=pr(Qa,oo,!0,Sn,xa);return on(Qa,oo,qa),qa})}function Mn(hi,aa){const io=rn(hi,aa);return io?Promise.reject(io):Promise.resolve()}function Br(hi){const aa=Bi.values().next().value;return aa&&typeof aa.runWithContext=="function"?aa.runWithContext(hi):hi()}function Vn(hi,aa){let io;const[oo,xa,Ur]=nst(hi,aa);io=P7(oo.reverse(),"beforeRouteLeave",hi,aa);for(const Hn of oo)Hn.leaveGuards.forEach(Qa=>{io.push(n_(Qa,hi,aa))});const Sn=Mn.bind(null,hi,aa);return io.push(Sn),Yn(io).then(()=>{io=[];for(const Hn of $.list())io.push(n_(Hn,hi,aa));return io.push(Sn),Yn(io)}).then(()=>{io=P7(xa,"beforeRouteUpdate",hi,aa);for(const Hn of xa)Hn.updateGuards.forEach(Qa=>{io.push(n_(Qa,hi,aa))});return io.push(Sn),Yn(io)}).then(()=>{io=[];for(const Hn of Ur)if(Hn.beforeEnter)if(jg(Hn.beforeEnter))for(const Qa of Hn.beforeEnter)io.push(n_(Qa,hi,aa));else io.push(n_(Hn.beforeEnter,hi,aa));return io.push(Sn),Yn(io)}).then(()=>(hi.matched.forEach(Hn=>Hn.enterCallbacks={}),io=P7(Ur,"beforeRouteEnter",hi,aa,Br),io.push(Sn),Yn(io))).then(()=>{io=[];for(const Hn of K.list())io.push(n_(Hn,hi,aa));return io.push(Sn),Yn(io)}).catch(Hn=>g1(Hn,Nf.NAVIGATION_CANCELLED)?Hn:Promise.reject(Hn))}function on(hi,aa,io){ct.list().forEach(oo=>Br(()=>oo(hi,aa,io)))}function pr(hi,aa,io,oo,xa){const Ur=rn(hi,aa);if(Ur)return Ur;const Sn=aa===jy,Hn=k2?history.state:{};io&&(oo||Sn?T.replace(hi.fullPath,Kh({scroll:Sn&&Hn&&Hn.scroll},xa)):T.push(hi.fullPath,xa)),yt.value=hi,va(hi,aa,io,Sn),ta()}let _r;function Sr(){_r||(_r=T.listen((hi,aa,io)=>{if(!Xi.listening)return;const oo=kr(hi),xa=tn(oo,Xi.currentRoute.value);if(xa){Dn(Kh(xa,{replace:!0,force:!0}),oo).catch(S5);return}St=oo;const Ur=yt.value;k2&&Kot(bB(Ur.fullPath,io.delta),BS()),Vn(oo,Ur).catch(Sn=>g1(Sn,Nf.NAVIGATION_ABORTED|Nf.NAVIGATION_CANCELLED)?Sn:g1(Sn,Nf.NAVIGATION_GUARD_REDIRECT)?(Dn(Kh(It(Sn.to),{force:!0}),oo).then(Hn=>{g1(Hn,Nf.NAVIGATION_ABORTED|Nf.NAVIGATION_DUPLICATED)&&!io.delta&&io.type===XM.pop&&T.go(-1,!1)}).catch(S5),Promise.reject()):(io.delta&&T.go(-io.delta,!1),Xn(Sn,oo,Ur))).then(Sn=>{Sn=Sn||pr(oo,Ur,!1),Sn&&(io.delta&&!g1(Sn,Nf.NAVIGATION_CANCELLED)?T.go(-io.delta,!1):io.type===XM.pop&&g1(Sn,Nf.NAVIGATION_ABORTED|Nf.NAVIGATION_DUPLICATED)&&T.go(-1,!1)),on(oo,Ur,Sn)}).catch(S5)}))}let Dr=z3(),nn=z3(),Cn;function Xn(hi,aa,io){ta(hi);const oo=nn.list();return oo.length?oo.forEach(xa=>xa(hi,aa,io)):console.error(hi),Promise.reject(hi)}function _i(){return Cn&&yt.value!==jy?Promise.resolve():new Promise((hi,aa)=>{Dr.add([hi,aa])})}function ta(hi){return Cn||(Cn=!hi,Sr(),Dr.list().forEach(([aa,io])=>hi?io(hi):aa()),Dr.reset()),hi}function va(hi,aa,io,oo){const{scrollBehavior:xa}=e;if(!k2||!xa)return Promise.resolve();const Ur=!io&&Yot(bB(hi.fullPath,0))||(oo||!io)&&history.state&&history.state.scroll||null;return sp().then(()=>xa(hi,aa,Ur)).then(Sn=>Sn&&Zot(Sn)).catch(Sn=>Xn(Sn,hi,aa))}const _a=hi=>T.go(hi);let qi;const Bi=new Set,Xi={currentRoute:yt,listening:!0,addRoute:me,removeRoute:we,clearRoutes:t.clearRoutes,hasRoute:Ve,getRoutes:Ce,resolve:kr,options:e,push:Lr,replace:Mr,go:_a,back:()=>_a(-1),forward:()=>_a(1),beforeEach:$.add,beforeResolve:K.add,afterEach:ct.add,onError:nn.add,isReady:_i,install(hi){hi.component("RouterLink",Tst),hi.component("RouterView",Mst),hi.config.globalProperties.$router=Xi,Object.defineProperty(hi.config.globalProperties,"$route",{enumerable:!0,get:()=>Io(yt)}),k2&&!qi&&yt.value===jy&&(qi=!0,Lr(T.location).catch(oo=>{}));const aa={};for(const oo in jy)Object.defineProperty(aa,oo,{get:()=>yt.value[oo],enumerable:!0});hi.provide(RS,Xi),hi.provide(DE,Mj(aa)),hi.provide(QM,yt);const io=hi.unmount;Bi.add(hi),hi.unmount=function(){Bi.delete(hi),Bi.size<1&&(St=jy,_r&&_r(),_r=null,yt.value=jy,qi=!1,Cn=!1),io()}}};function Yn(hi){return hi.reduce((aa,io)=>aa.then(()=>Br(io)),Promise.resolve())}return Xi}function n4(){return _g(RS)}function zE(e){return _g(DE)}const $U="/assets/meshcore-DQNtEl5I.svg";function HU(e,t){return function(){return e.apply(t,arguments)}}const{toString:Lst}=Object.prototype,{getPrototypeOf:OE}=Object,{iterator:FS,toStringTag:VU}=Symbol,NS=(e=>t=>{const r=Lst.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),$g=e=>(e=e.toLowerCase(),t=>NS(t)===e),jS=e=>t=>typeof t===e,{isArray:Z2}=Array,$2=jS("undefined");function i4(e){return e!==null&&!$2(e)&&e.constructor!==null&&!$2(e.constructor)&&Tm(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const WU=$g("ArrayBuffer");function Pst(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&WU(e.buffer),t}const Ist=jS("string"),Tm=jS("function"),qU=jS("number"),a4=e=>e!==null&&typeof e=="object",Dst=e=>e===!0||e===!1,bT=e=>{if(NS(e)!=="object")return!1;const t=OE(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(VU in e)&&!(FS in e)},zst=e=>{if(!a4(e)||i4(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ost=$g("Date"),Bst=$g("File"),Rst=$g("Blob"),Fst=$g("FileList"),Nst=e=>a4(e)&&Tm(e.pipe),jst=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Tm(e.append)&&((t=NS(e))==="formdata"||t==="object"&&Tm(e.toString)&&e.toString()==="[object FormData]"))},Ust=$g("URLSearchParams"),[$st,Hst,Vst,Wst]=["ReadableStream","Request","Response","Headers"].map($g),qst=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function o4(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let u,T;if(typeof e!="object"&&(e=[e]),Z2(e))for(u=0,T=e.length;u0;)if(T=r[u],t===T.toLowerCase())return T;return null}const Ax=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ZU=e=>!$2(e)&&e!==Ax;function t9(){const{caseless:e,skipUndefined:t}=ZU(this)&&this||{},r={},u=(T,$)=>{const K=e&&GU(r,$)||$;bT(r[K])&&bT(T)?r[K]=t9(r[K],T):bT(T)?r[K]=t9({},T):Z2(T)?r[K]=T.slice():(!t||!$2(T))&&(r[K]=T)};for(let T=0,$=arguments.length;T<$;T++)arguments[T]&&o4(arguments[T],u);return r}const Gst=(e,t,r,{allOwnKeys:u}={})=>(o4(t,(T,$)=>{r&&Tm(T)?e[$]=HU(T,r):e[$]=T},{allOwnKeys:u}),e),Zst=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Kst=(e,t,r,u)=>{e.prototype=Object.create(t.prototype,u),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Yst=(e,t,r,u)=>{let T,$,K;const ct={};if(t=t||{},e==null)return t;do{for(T=Object.getOwnPropertyNames(e),$=T.length;$-- >0;)K=T[$],(!u||u(K,e,t))&&!ct[K]&&(t[K]=e[K],ct[K]=!0);e=r!==!1&&OE(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Xst=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const u=e.indexOf(t,r);return u!==-1&&u===r},Jst=e=>{if(!e)return null;if(Z2(e))return e;let t=e.length;if(!qU(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Qst=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&OE(Uint8Array)),tlt=(e,t)=>{const u=(e&&e[FS]).call(e);let T;for(;(T=u.next())&&!T.done;){const $=T.value;t.call(e,$[0],$[1])}},elt=(e,t)=>{let r;const u=[];for(;(r=e.exec(t))!==null;)u.push(r);return u},rlt=$g("HTMLFormElement"),nlt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,u,T){return u.toUpperCase()+T}),zB=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ilt=$g("RegExp"),KU=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),u={};o4(r,(T,$)=>{let K;(K=t(T,$,e))!==!1&&(u[$]=K||T)}),Object.defineProperties(e,u)},alt=e=>{KU(e,(t,r)=>{if(Tm(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const u=e[r];if(Tm(u)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},olt=(e,t)=>{const r={},u=T=>{T.forEach($=>{r[$]=!0})};return Z2(e)?u(e):u(String(e).split(t)),r},slt=()=>{},llt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function clt(e){return!!(e&&Tm(e.append)&&e[VU]==="FormData"&&e[FS])}const ult=e=>{const t=new Array(10),r=(u,T)=>{if(a4(u)){if(t.indexOf(u)>=0)return;if(i4(u))return u;if(!("toJSON"in u)){t[T]=u;const $=Z2(u)?[]:{};return o4(u,(K,ct)=>{const yt=r(K,T+1);!$2(yt)&&($[ct]=yt)}),t[T]=void 0,$}}return u};return r(e,0)},hlt=$g("AsyncFunction"),dlt=e=>e&&(a4(e)||Tm(e))&&Tm(e.then)&&Tm(e.catch),YU=((e,t)=>e?setImmediate:t?((r,u)=>(Ax.addEventListener("message",({source:T,data:$})=>{T===Ax&&$===r&&u.length&&u.shift()()},!1),T=>{u.push(T),Ax.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Tm(Ax.postMessage)),flt=typeof queueMicrotask<"u"?queueMicrotask.bind(Ax):typeof process<"u"&&process.nextTick||YU,plt=e=>e!=null&&Tm(e[FS]),yo={isArray:Z2,isArrayBuffer:WU,isBuffer:i4,isFormData:jst,isArrayBufferView:Pst,isString:Ist,isNumber:qU,isBoolean:Dst,isObject:a4,isPlainObject:bT,isEmptyObject:zst,isReadableStream:$st,isRequest:Hst,isResponse:Vst,isHeaders:Wst,isUndefined:$2,isDate:Ost,isFile:Bst,isBlob:Rst,isRegExp:ilt,isFunction:Tm,isStream:Nst,isURLSearchParams:Ust,isTypedArray:Qst,isFileList:Fst,forEach:o4,merge:t9,extend:Gst,trim:qst,stripBOM:Zst,inherits:Kst,toFlatObject:Yst,kindOf:NS,kindOfTest:$g,endsWith:Xst,toArray:Jst,forEachEntry:tlt,matchAll:elt,isHTMLForm:rlt,hasOwnProperty:zB,hasOwnProp:zB,reduceDescriptors:KU,freezeMethods:alt,toObjectSet:olt,toCamelCase:nlt,noop:slt,toFiniteNumber:llt,findKey:GU,global:Ax,isContextDefined:ZU,isSpecCompliantForm:clt,toJSONObject:ult,isAsyncFn:hlt,isThenable:dlt,setImmediate:YU,asap:flt,isIterable:plt};function cu(e,t,r,u,T){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),u&&(this.request=u),T&&(this.response=T,this.status=T.status?T.status:null)}yo.inherits(cu,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:yo.toJSONObject(this.config),code:this.code,status:this.status}}});const XU=cu.prototype,JU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{JU[e]={value:e}});Object.defineProperties(cu,JU);Object.defineProperty(XU,"isAxiosError",{value:!0});cu.from=(e,t,r,u,T,$)=>{const K=Object.create(XU);yo.toFlatObject(e,K,function(Ut){return Ut!==Error.prototype},St=>St!=="isAxiosError");const ct=e&&e.message?e.message:"Error",yt=t==null&&e?e.code:t;return cu.call(K,ct,yt,r,u,T),e&&K.cause==null&&Object.defineProperty(K,"cause",{value:e,configurable:!0}),K.name=e&&e.name||"Error",$&&Object.assign(K,$),K};const mlt=null;function e9(e){return yo.isPlainObject(e)||yo.isArray(e)}function QU(e){return yo.endsWith(e,"[]")?e.slice(0,-2):e}function OB(e,t,r){return e?e.concat(t).map(function(T,$){return T=QU(T),!r&&$?"["+T+"]":T}).join(r?".":""):t}function glt(e){return yo.isArray(e)&&!e.some(e9)}const vlt=yo.toFlatObject(yo,{},null,function(t){return/^is[A-Z]/.test(t)});function US(e,t,r){if(!yo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=yo.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Ce,Ve){return!yo.isUndefined(Ve[Ce])});const u=r.metaTokens,T=r.visitor||Ut,$=r.dots,K=r.indexes,yt=(r.Blob||typeof Blob<"u"&&Blob)&&yo.isSpecCompliantForm(t);if(!yo.isFunction(T))throw new TypeError("visitor must be a function");function St(we){if(we===null)return"";if(yo.isDate(we))return we.toISOString();if(yo.isBoolean(we))return we.toString();if(!yt&&yo.isBlob(we))throw new cu("Blob is not supported. Use a Buffer instead.");return yo.isArrayBuffer(we)||yo.isTypedArray(we)?yt&&typeof Blob=="function"?new Blob([we]):Buffer.from(we):we}function Ut(we,Ce,Ve){let kr=we;if(we&&!Ve&&typeof we=="object"){if(yo.endsWith(Ce,"{}"))Ce=u?Ce:Ce.slice(0,-2),we=JSON.stringify(we);else if(yo.isArray(we)&&glt(we)||(yo.isFileList(we)||yo.endsWith(Ce,"[]"))&&(kr=yo.toArray(we)))return Ce=QU(Ce),kr.forEach(function(rn,Lr){!(yo.isUndefined(rn)||rn===null)&&t.append(K===!0?OB([Ce],Lr,$):K===null?Ce:Ce+"[]",St(rn))}),!1}return e9(we)?!0:(t.append(OB(Ve,Ce,$),St(we)),!1)}const ne=[],pe=Object.assign(vlt,{defaultVisitor:Ut,convertValue:St,isVisitable:e9});function me(we,Ce){if(!yo.isUndefined(we)){if(ne.indexOf(we)!==-1)throw Error("Circular reference detected in "+Ce.join("."));ne.push(we),yo.forEach(we,function(kr,It){(!(yo.isUndefined(kr)||kr===null)&&T.call(t,kr,yo.isString(It)?It.trim():It,Ce,pe))===!0&&me(kr,Ce?Ce.concat(It):[It])}),ne.pop()}}if(!yo.isObject(e))throw new TypeError("data must be an object");return me(e),t}function BB(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(u){return t[u]})}function BE(e,t){this._pairs=[],e&&US(e,this,t)}const t$=BE.prototype;t$.append=function(t,r){this._pairs.push([t,r])};t$.toString=function(t){const r=t?function(u){return t.call(this,u,BB)}:BB;return this._pairs.map(function(T){return r(T[0])+"="+r(T[1])},"").join("&")};function ylt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function e$(e,t,r){if(!t)return e;const u=r&&r.encode||ylt;yo.isFunction(r)&&(r={serialize:r});const T=r&&r.serialize;let $;if(T?$=T(t,r):$=yo.isURLSearchParams(t)?t.toString():new BE(t,r).toString(u),$){const K=e.indexOf("#");K!==-1&&(e=e.slice(0,K)),e+=(e.indexOf("?")===-1?"?":"&")+$}return e}class RB{constructor(){this.handlers=[]}use(t,r,u){return this.handlers.push({fulfilled:t,rejected:r,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){yo.forEach(this.handlers,function(u){u!==null&&t(u)})}}const r$={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_lt=typeof URLSearchParams<"u"?URLSearchParams:BE,xlt=typeof FormData<"u"?FormData:null,blt=typeof Blob<"u"?Blob:null,wlt={isBrowser:!0,classes:{URLSearchParams:_lt,FormData:xlt,Blob:blt},protocols:["http","https","file","blob","url","data"]},RE=typeof window<"u"&&typeof document<"u",r9=typeof navigator=="object"&&navigator||void 0,klt=RE&&(!r9||["ReactNative","NativeScript","NS"].indexOf(r9.product)<0),Tlt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Slt=RE&&window.location.href||"http://localhost",Clt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:RE,hasStandardBrowserEnv:klt,hasStandardBrowserWebWorkerEnv:Tlt,navigator:r9,origin:Slt},Symbol.toStringTag,{value:"Module"})),F0={...Clt,...wlt};function Alt(e,t){return US(e,new F0.classes.URLSearchParams,{visitor:function(r,u,T,$){return F0.isNode&&yo.isBuffer(r)?(this.append(u,r.toString("base64")),!1):$.defaultVisitor.apply(this,arguments)},...t})}function Mlt(e){return yo.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Elt(e){const t={},r=Object.keys(e);let u;const T=r.length;let $;for(u=0;u=r.length;return K=!K&&yo.isArray(T)?T.length:K,yt?(yo.hasOwnProp(T,K)?T[K]=[T[K],u]:T[K]=u,!ct):((!T[K]||!yo.isObject(T[K]))&&(T[K]=[]),t(r,u,T[K],$)&&yo.isArray(T[K])&&(T[K]=Elt(T[K])),!ct)}if(yo.isFormData(e)&&yo.isFunction(e.entries)){const r={};return yo.forEachEntry(e,(u,T)=>{t(Mlt(u),T,r,0)}),r}return null}function Llt(e,t,r){if(yo.isString(e))try{return(t||JSON.parse)(e),yo.trim(e)}catch(u){if(u.name!=="SyntaxError")throw u}return(r||JSON.stringify)(e)}const s4={transitional:r$,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const u=r.getContentType()||"",T=u.indexOf("application/json")>-1,$=yo.isObject(t);if($&&yo.isHTMLForm(t)&&(t=new FormData(t)),yo.isFormData(t))return T?JSON.stringify(n$(t)):t;if(yo.isArrayBuffer(t)||yo.isBuffer(t)||yo.isStream(t)||yo.isFile(t)||yo.isBlob(t)||yo.isReadableStream(t))return t;if(yo.isArrayBufferView(t))return t.buffer;if(yo.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let ct;if($){if(u.indexOf("application/x-www-form-urlencoded")>-1)return Alt(t,this.formSerializer).toString();if((ct=yo.isFileList(t))||u.indexOf("multipart/form-data")>-1){const yt=this.env&&this.env.FormData;return US(ct?{"files[]":t}:t,yt&&new yt,this.formSerializer)}}return $||T?(r.setContentType("application/json",!1),Llt(t)):t}],transformResponse:[function(t){const r=this.transitional||s4.transitional,u=r&&r.forcedJSONParsing,T=this.responseType==="json";if(yo.isResponse(t)||yo.isReadableStream(t))return t;if(t&&yo.isString(t)&&(u&&!this.responseType||T)){const K=!(r&&r.silentJSONParsing)&&T;try{return JSON.parse(t,this.parseReviver)}catch(ct){if(K)throw ct.name==="SyntaxError"?cu.from(ct,cu.ERR_BAD_RESPONSE,this,null,this.response):ct}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F0.classes.FormData,Blob:F0.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};yo.forEach(["delete","get","head","post","put","patch"],e=>{s4.headers[e]={}});const Plt=yo.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ilt=e=>{const t={};let r,u,T;return e&&e.split(` + */let ist=()=>location.protocol+"//"+location.host;function NU(e,t){const{pathname:r,search:u,hash:T}=t,$=e.indexOf("#");if($>-1){let K=T.includes(e.slice($))?e.slice($).length:1,ct=T.slice(K);return ct[0]!=="/"&&(ct="/"+ct),_B(ct,"")}return _B(r,e)+u+T}function ast(e,t,r,u){let T=[],$=[],K=null;const ct=({state:pe})=>{const me=NU(e,location),we=r.value,Ce=t.value;let Ve=0;if(pe){if(r.value=me,t.value=pe,K&&K===we){K=null;return}Ve=Ce?pe.position-Ce.position:0}else u(me);T.forEach(kr=>{kr(r.value,we,{delta:Ve,type:XM.pop,direction:Ve?Ve>0?L7.forward:L7.back:L7.unknown})})};function yt(){K=r.value}function St(pe){T.push(pe);const me=()=>{const we=T.indexOf(pe);we>-1&&T.splice(we,1)};return $.push(me),me}function Ut(){if(document.visibilityState==="hidden"){const{history:pe}=window;if(!pe.state)return;pe.replaceState(Kh({},pe.state,{scroll:BS()}),"")}}function ne(){for(const pe of $)pe();$=[],window.removeEventListener("popstate",ct),window.removeEventListener("pagehide",Ut),document.removeEventListener("visibilitychange",Ut)}return window.addEventListener("popstate",ct),window.addEventListener("pagehide",Ut),document.addEventListener("visibilitychange",Ut),{pauseListeners:yt,listen:St,destroy:ne}}function TB(e,t,r,u=!1,T=!1){return{back:e,current:t,forward:r,replaced:u,position:window.history.length,scroll:T?BS():null}}function ost(e){const{history:t,location:r}=window,u={value:NU(e,r)},T={value:t.state};T.value||$(u.value,{back:null,current:u.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function $(yt,St,Ut){const ne=e.indexOf("#"),pe=ne>-1?(r.host&&document.querySelector("base")?e:e.slice(ne))+yt:ist()+e+yt;try{t[Ut?"replaceState":"pushState"](St,"",pe),T.value=St}catch(me){console.error(me),r[Ut?"replace":"assign"](pe)}}function K(yt,St){$(yt,Kh({},t.state,TB(T.value.back,yt,T.value.forward,!0),St,{position:T.value.position}),!0),u.value=yt}function ct(yt,St){const Ut=Kh({},T.value,t.state,{forward:yt,scroll:BS()});$(Ut.current,Ut,!0),$(yt,Kh({},TB(u.value,yt,null),{position:Ut.position+1},St),!1),u.value=yt}return{location:u,state:T,push:ct,replace:K}}function sst(e){e=Vot(e);const t=ost(e),r=ast(e,t.state,t.location,t.replace);function u($,K=!0){K||r.pauseListeners(),history.go($)}const T=Kh({location:"",base:e,go:u,createHref:qot.bind(null,e)},t,r);return Object.defineProperty(T,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(T,"state",{enumerable:!0,get:()=>t.state.value}),T}let Cx=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Op=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Op||{});const lst={type:Cx.Static,value:""},cst=/[a-zA-Z0-9_]/;function ust(e){if(!e)return[[]];if(e==="/")return[[lst]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(me){throw new Error(`ERR (${r})/"${St}": ${me}`)}let r=Op.Static,u=r;const T=[];let $;function K(){$&&T.push($),$=[]}let ct=0,yt,St="",Ut="";function ne(){St&&(r===Op.Static?$.push({type:Cx.Static,value:St}):r===Op.Param||r===Op.ParamRegExp||r===Op.ParamRegExpEnd?($.length>1&&(yt==="*"||yt==="+")&&t(`A repeatable param (${St}) must be alone in its segment. eg: '/:ids+.`),$.push({type:Cx.Param,value:St,regexp:Ut,repeatable:yt==="*"||yt==="+",optional:yt==="*"||yt==="?"})):t("Invalid state to consume buffer"),St="")}function pe(){St+=yt}for(;ctt.length?t.length===1&&t[0]===rm.Static+rm.Segment?1:-1:0}function jU(e,t){let r=0;const u=e.score,T=t.score;for(;r0&&t[t.length-1]<0}const mst={strict:!1,end:!0,sensitive:!1};function gst(e,t,r){const u=fst(ust(e.path),r),T=Kh(u,{record:e,parent:t,children:[],alias:[]});return t&&!T.record.aliasOf==!t.record.aliasOf&&t.children.push(T),T}function vst(e,t){const r=[],u=new Map;t=yB(mst,t);function T(ne){return u.get(ne)}function $(ne,pe,me){const we=!me,Ce=MB(ne);Ce.aliasOf=me&&me.record;const Ve=yB(t,ne),kr=[Ce];if("alias"in ne){const Lr=typeof ne.alias=="string"?[ne.alias]:ne.alias;for(const Mr of Lr)kr.push(MB(Kh({},Ce,{components:me?me.record.components:Ce.components,path:Mr,aliasOf:me?me.record:Ce})))}let It,rn;for(const Lr of kr){const{path:Mr}=Lr;if(pe&&Mr[0]!=="/"){const tn=pe.record.path,Dn=tn[tn.length-1]==="/"?"":"/";Lr.path=pe.record.path+(Mr&&Dn+Mr)}if(It=gst(Lr,pe,Ve),me?me.alias.push(It):(rn=rn||It,rn!==It&&rn.alias.push(It),we&&ne.name&&!EB(It)&&K(ne.name)),UU(It)&&yt(It),Ce.children){const tn=Ce.children;for(let Dn=0;Dn{K(rn)}:S5}function K(ne){if(RU(ne)){const pe=u.get(ne);pe&&(u.delete(ne),r.splice(r.indexOf(pe),1),pe.children.forEach(K),pe.alias.forEach(K))}else{const pe=r.indexOf(ne);pe>-1&&(r.splice(pe,1),ne.record.name&&u.delete(ne.record.name),ne.children.forEach(K),ne.alias.forEach(K))}}function ct(){return r}function yt(ne){const pe=xst(ne,r);r.splice(pe,0,ne),ne.record.name&&!EB(ne)&&u.set(ne.record.name,ne)}function St(ne,pe){let me,we={},Ce,Ve;if("name"in ne&&ne.name){if(me=u.get(ne.name),!me)throw U2(Nf.MATCHER_NOT_FOUND,{location:ne});Ve=me.record.name,we=Kh(AB(pe.params,me.keys.filter(rn=>!rn.optional).concat(me.parent?me.parent.keys.filter(rn=>rn.optional):[]).map(rn=>rn.name)),ne.params&&AB(ne.params,me.keys.map(rn=>rn.name))),Ce=me.stringify(we)}else if(ne.path!=null)Ce=ne.path,me=r.find(rn=>rn.re.test(Ce)),me&&(we=me.parse(Ce),Ve=me.record.name);else{if(me=pe.name?u.get(pe.name):r.find(rn=>rn.re.test(pe.path)),!me)throw U2(Nf.MATCHER_NOT_FOUND,{location:ne,currentLocation:pe});Ve=me.record.name,we=Kh({},pe.params,ne.params),Ce=me.stringify(we)}const kr=[];let It=me;for(;It;)kr.unshift(It.record),It=It.parent;return{name:Ve,path:Ce,params:we,matched:kr,meta:_st(kr)}}e.forEach(ne=>$(ne));function Ut(){r.length=0,u.clear()}return{addRoute:$,resolve:St,removeRoute:K,clearRoutes:Ut,getRoutes:ct,getRecordMatcher:T}}function AB(e,t){const r={};for(const u of t)u in e&&(r[u]=e[u]);return r}function MB(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:yst(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function yst(e){const t={},r=e.props||!1;if("component"in e)t.default=r;else for(const u in e.components)t[u]=typeof r=="object"?r[u]:r;return t}function EB(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _st(e){return e.reduce((t,r)=>Kh(t,r.meta),{})}function xst(e,t){let r=0,u=t.length;for(;r!==u;){const $=r+u>>1;jU(e,t[$])<0?u=$:r=$+1}const T=bst(e);return T&&(u=t.lastIndexOf(T,u-1)),u}function bst(e){let t=e;for(;t=t.parent;)if(UU(t)&&jU(e,t)===0)return t}function UU({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function LB(e){const t=_g(RS),r=_g(DE),u=Ao(()=>{const yt=Lo(e.to);return t.resolve(yt)}),T=Ao(()=>{const{matched:yt}=u.value,{length:St}=yt,Ut=yt[St-1],ne=r.matched;if(!Ut||!ne.length)return-1;const pe=ne.findIndex(j2.bind(null,Ut));if(pe>-1)return pe;const me=PB(yt[St-2]);return St>1&&PB(Ut)===me&&ne[ne.length-1].path!==me?ne.findIndex(j2.bind(null,yt[St-2])):pe}),$=Ao(()=>T.value>-1&&Cst(r.params,u.value.params)),K=Ao(()=>T.value>-1&&T.value===r.matched.length-1&&BU(r.params,u.value.params));function ct(yt={}){if(Sst(yt)){const St=t[Lo(e.replace)?"replace":"push"](Lo(e.to)).catch(S5);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>St),St}return Promise.resolve()}return{route:u,href:Ao(()=>u.value.href),isActive:$,isExactActive:K,navigate:ct}}function wst(e){return e.length===1?e[0]:e}const kst=Cc({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:LB,setup(e,{slots:t}){const r=g_(LB(e)),{options:u}=_g(RS),T=Ao(()=>({[IB(e.activeClass,u.linkActiveClass,"router-link-active")]:r.isActive,[IB(e.exactActiveClass,u.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive}));return()=>{const $=t.default&&wst(t.default(r));return e.custom?$:PE("a",{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:T.value},$)}}}),Tst=kst;function Sst(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Cst(e,t){for(const r in t){const u=t[r],T=e[r];if(typeof u=="string"){if(u!==T)return!1}else if(!jg(T)||T.length!==u.length||u.some(($,K)=>$!==T[K]))return!1}return!0}function PB(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const IB=(e,t,r)=>e??t??r,Ast=Cc({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:r}){const u=_g(QM),T=Ao(()=>e.route||u.value),$=_g(kB,0),K=Ao(()=>{let St=Lo($);const{matched:Ut}=T.value;let ne;for(;(ne=Ut[St])&&!ne.components;)St++;return St}),ct=Ao(()=>T.value.matched[K.value]);vT(kB,Ao(()=>K.value+1)),vT(rst,ct),vT(QM,T);const yt=li();return Fh(()=>[yt.value,ct.value,e.name],([St,Ut,ne],[pe,me,we])=>{Ut&&(Ut.instances[ne]=St,me&&me!==Ut&&St&&St===pe&&(Ut.leaveGuards.size||(Ut.leaveGuards=me.leaveGuards),Ut.updateGuards.size||(Ut.updateGuards=me.updateGuards))),St&&Ut&&(!me||!j2(Ut,me)||!pe)&&(Ut.enterCallbacks[ne]||[]).forEach(Ce=>Ce(St))},{flush:"post"}),()=>{const St=T.value,Ut=e.name,ne=ct.value,pe=ne&&ne.components[Ut];if(!pe)return DB(r.default,{Component:pe,route:St});const me=ne.props[Ut],we=me?me===!0?St.params:typeof me=="function"?me(St):me:null,Ve=PE(pe,Kh({},we,t,{onVnodeUnmounted:kr=>{kr.component.isUnmounted&&(ne.instances[Ut]=null)},ref:yt}));return DB(r.default,{Component:Ve,route:St})||Ve}}});function DB(e,t){if(!e)return null;const r=e(t);return r.length===1?r[0]:r}const Mst=Ast;function Est(e){const t=vst(e.routes,e),r=e.parseQuery||tst,u=e.stringifyQuery||wB,T=e.history,$=z3(),K=z3(),ct=z3(),yt=wit(jy);let St=jy;T2&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const Ut=M7.bind(null,hi=>""+hi),ne=M7.bind(null,Rot),pe=M7.bind(null,$5);function me(hi,na){let Xa,oo;return RU(hi)?(Xa=t.getRecordMatcher(hi),oo=na):oo=hi,t.addRoute(oo,Xa)}function we(hi){const na=t.getRecordMatcher(hi);na&&t.removeRoute(na)}function Ce(){return t.getRoutes().map(hi=>hi.record)}function Ve(hi){return!!t.getRecordMatcher(hi)}function kr(hi,na){if(na=Kh({},na||yt.value),typeof hi=="string"){const Hn=E7(r,hi,na.path),to=t.resolve({path:Hn.path},na),Ha=T.createHref(Hn.fullPath);return Kh(Hn,to,{params:pe(to.params),hash:$5(Hn.hash),redirectedFrom:void 0,href:Ha})}let Xa;if(hi.path!=null)Xa=Kh({},hi,{path:E7(r,hi.path,na.path).path});else{const Hn=Kh({},hi.params);for(const to in Hn)Hn[to]==null&&delete Hn[to];Xa=Kh({},hi,{params:ne(Hn)}),na.params=ne(na.params)}const oo=t.resolve(Xa,na),xa=hi.hash||"";oo.params=Ut(pe(oo.params));const Ur=jot(u,Kh({},hi,{hash:zot(xa),path:oo.path})),Sn=T.createHref(Ur);return Kh({fullPath:Ur,hash:xa,query:u===wB?est(hi.query):hi.query||{}},oo,{redirectedFrom:void 0,href:Sn})}function It(hi){return typeof hi=="string"?E7(r,hi,yt.value.path):Kh({},hi)}function rn(hi,na){if(St!==hi)return U2(Nf.NAVIGATION_CANCELLED,{from:na,to:hi})}function Lr(hi){return Dn(hi)}function Mr(hi){return Lr(Kh(It(hi),{replace:!0}))}function tn(hi,na){const Xa=hi.matched[hi.matched.length-1];if(Xa&&Xa.redirect){const{redirect:oo}=Xa;let xa=typeof oo=="function"?oo(hi,na):oo;return typeof xa=="string"&&(xa=xa.includes("?")||xa.includes("#")?xa=It(xa):{path:xa},xa.params={}),Kh({query:hi.query,hash:hi.hash,params:xa.path!=null?{}:hi.params},xa)}}function Dn(hi,na){const Xa=St=kr(hi),oo=yt.value,xa=hi.state,Ur=hi.force,Sn=hi.replace===!0,Hn=tn(Xa,oo);if(Hn)return Dn(Kh(It(Hn),{state:typeof Hn=="object"?Kh({},xa,Hn.state):xa,force:Ur,replace:Sn}),na||Xa);const to=Xa;to.redirectedFrom=na;let Ha;return!Ur&&Uot(u,oo,Xa)&&(Ha=U2(Nf.NAVIGATION_DUPLICATED,{to,from:oo}),va(oo,oo,!0,!1)),(Ha?Promise.resolve(Ha):Vn(to,oo)).catch(qa=>g1(qa)?g1(qa,Nf.NAVIGATION_GUARD_REDIRECT)?qa:ta(qa):Xn(qa,to,oo)).then(qa=>{if(qa){if(g1(qa,Nf.NAVIGATION_GUARD_REDIRECT))return Dn(Kh({replace:Sn},It(qa.to),{state:typeof qa.to=="object"?Kh({},xa,qa.to.state):xa,force:Ur}),na||to)}else qa=pr(to,oo,!0,Sn,xa);return on(to,oo,qa),qa})}function Mn(hi,na){const Xa=rn(hi,na);return Xa?Promise.reject(Xa):Promise.resolve()}function Br(hi){const na=Bi.values().next().value;return na&&typeof na.runWithContext=="function"?na.runWithContext(hi):hi()}function Vn(hi,na){let Xa;const[oo,xa,Ur]=nst(hi,na);Xa=P7(oo.reverse(),"beforeRouteLeave",hi,na);for(const Hn of oo)Hn.leaveGuards.forEach(to=>{Xa.push(n_(to,hi,na))});const Sn=Mn.bind(null,hi,na);return Xa.push(Sn),Yn(Xa).then(()=>{Xa=[];for(const Hn of $.list())Xa.push(n_(Hn,hi,na));return Xa.push(Sn),Yn(Xa)}).then(()=>{Xa=P7(xa,"beforeRouteUpdate",hi,na);for(const Hn of xa)Hn.updateGuards.forEach(to=>{Xa.push(n_(to,hi,na))});return Xa.push(Sn),Yn(Xa)}).then(()=>{Xa=[];for(const Hn of Ur)if(Hn.beforeEnter)if(jg(Hn.beforeEnter))for(const to of Hn.beforeEnter)Xa.push(n_(to,hi,na));else Xa.push(n_(Hn.beforeEnter,hi,na));return Xa.push(Sn),Yn(Xa)}).then(()=>(hi.matched.forEach(Hn=>Hn.enterCallbacks={}),Xa=P7(Ur,"beforeRouteEnter",hi,na,Br),Xa.push(Sn),Yn(Xa))).then(()=>{Xa=[];for(const Hn of K.list())Xa.push(n_(Hn,hi,na));return Xa.push(Sn),Yn(Xa)}).catch(Hn=>g1(Hn,Nf.NAVIGATION_CANCELLED)?Hn:Promise.reject(Hn))}function on(hi,na,Xa){ct.list().forEach(oo=>Br(()=>oo(hi,na,Xa)))}function pr(hi,na,Xa,oo,xa){const Ur=rn(hi,na);if(Ur)return Ur;const Sn=na===jy,Hn=T2?history.state:{};Xa&&(oo||Sn?T.replace(hi.fullPath,Kh({scroll:Sn&&Hn&&Hn.scroll},xa)):T.push(hi.fullPath,xa)),yt.value=hi,va(hi,na,Xa,Sn),ta()}let _r;function Sr(){_r||(_r=T.listen((hi,na,Xa)=>{if(!Xi.listening)return;const oo=kr(hi),xa=tn(oo,Xi.currentRoute.value);if(xa){Dn(Kh(xa,{replace:!0,force:!0}),oo).catch(S5);return}St=oo;const Ur=yt.value;T2&&Kot(bB(Ur.fullPath,Xa.delta),BS()),Vn(oo,Ur).catch(Sn=>g1(Sn,Nf.NAVIGATION_ABORTED|Nf.NAVIGATION_CANCELLED)?Sn:g1(Sn,Nf.NAVIGATION_GUARD_REDIRECT)?(Dn(Kh(It(Sn.to),{force:!0}),oo).then(Hn=>{g1(Hn,Nf.NAVIGATION_ABORTED|Nf.NAVIGATION_DUPLICATED)&&!Xa.delta&&Xa.type===XM.pop&&T.go(-1,!1)}).catch(S5),Promise.reject()):(Xa.delta&&T.go(-Xa.delta,!1),Xn(Sn,oo,Ur))).then(Sn=>{Sn=Sn||pr(oo,Ur,!1),Sn&&(Xa.delta&&!g1(Sn,Nf.NAVIGATION_CANCELLED)?T.go(-Xa.delta,!1):Xa.type===XM.pop&&g1(Sn,Nf.NAVIGATION_ABORTED|Nf.NAVIGATION_DUPLICATED)&&T.go(-1,!1)),on(oo,Ur,Sn)}).catch(S5)}))}let Dr=z3(),nn=z3(),Cn;function Xn(hi,na,Xa){ta(hi);const oo=nn.list();return oo.length?oo.forEach(xa=>xa(hi,na,Xa)):console.error(hi),Promise.reject(hi)}function _i(){return Cn&&yt.value!==jy?Promise.resolve():new Promise((hi,na)=>{Dr.add([hi,na])})}function ta(hi){return Cn||(Cn=!hi,Sr(),Dr.list().forEach(([na,Xa])=>hi?Xa(hi):na()),Dr.reset()),hi}function va(hi,na,Xa,oo){const{scrollBehavior:xa}=e;if(!T2||!xa)return Promise.resolve();const Ur=!Xa&&Yot(bB(hi.fullPath,0))||(oo||!Xa)&&history.state&&history.state.scroll||null;return sp().then(()=>xa(hi,na,Ur)).then(Sn=>Sn&&Zot(Sn)).catch(Sn=>Xn(Sn,hi,na))}const _a=hi=>T.go(hi);let qi;const Bi=new Set,Xi={currentRoute:yt,listening:!0,addRoute:me,removeRoute:we,clearRoutes:t.clearRoutes,hasRoute:Ve,getRoutes:Ce,resolve:kr,options:e,push:Lr,replace:Mr,go:_a,back:()=>_a(-1),forward:()=>_a(1),beforeEach:$.add,beforeResolve:K.add,afterEach:ct.add,onError:nn.add,isReady:_i,install(hi){hi.component("RouterLink",Tst),hi.component("RouterView",Mst),hi.config.globalProperties.$router=Xi,Object.defineProperty(hi.config.globalProperties,"$route",{enumerable:!0,get:()=>Lo(yt)}),T2&&!qi&&yt.value===jy&&(qi=!0,Lr(T.location).catch(oo=>{}));const na={};for(const oo in jy)Object.defineProperty(na,oo,{get:()=>yt.value[oo],enumerable:!0});hi.provide(RS,Xi),hi.provide(DE,Mj(na)),hi.provide(QM,yt);const Xa=hi.unmount;Bi.add(hi),hi.unmount=function(){Bi.delete(hi),Bi.size<1&&(St=jy,_r&&_r(),_r=null,yt.value=jy,qi=!1,Cn=!1),Xa()}}};function Yn(hi){return hi.reduce((na,Xa)=>na.then(()=>Br(Xa)),Promise.resolve())}return Xi}function n4(){return _g(RS)}function zE(e){return _g(DE)}const $U="/assets/meshcore-DQNtEl5I.svg";function HU(e,t){return function(){return e.apply(t,arguments)}}const{toString:Lst}=Object.prototype,{getPrototypeOf:OE}=Object,{iterator:FS,toStringTag:VU}=Symbol,NS=(e=>t=>{const r=Lst.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),$g=e=>(e=e.toLowerCase(),t=>NS(t)===e),jS=e=>t=>typeof t===e,{isArray:Z2}=Array,$2=jS("undefined");function i4(e){return e!==null&&!$2(e)&&e.constructor!==null&&!$2(e.constructor)&&Tm(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const WU=$g("ArrayBuffer");function Pst(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&WU(e.buffer),t}const Ist=jS("string"),Tm=jS("function"),qU=jS("number"),a4=e=>e!==null&&typeof e=="object",Dst=e=>e===!0||e===!1,bT=e=>{if(NS(e)!=="object")return!1;const t=OE(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(VU in e)&&!(FS in e)},zst=e=>{if(!a4(e)||i4(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ost=$g("Date"),Bst=$g("File"),Rst=$g("Blob"),Fst=$g("FileList"),Nst=e=>a4(e)&&Tm(e.pipe),jst=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Tm(e.append)&&((t=NS(e))==="formdata"||t==="object"&&Tm(e.toString)&&e.toString()==="[object FormData]"))},Ust=$g("URLSearchParams"),[$st,Hst,Vst,Wst]=["ReadableStream","Request","Response","Headers"].map($g),qst=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function o4(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let u,T;if(typeof e!="object"&&(e=[e]),Z2(e))for(u=0,T=e.length;u0;)if(T=r[u],t===T.toLowerCase())return T;return null}const Ax=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ZU=e=>!$2(e)&&e!==Ax;function t9(){const{caseless:e,skipUndefined:t}=ZU(this)&&this||{},r={},u=(T,$)=>{const K=e&&GU(r,$)||$;bT(r[K])&&bT(T)?r[K]=t9(r[K],T):bT(T)?r[K]=t9({},T):Z2(T)?r[K]=T.slice():(!t||!$2(T))&&(r[K]=T)};for(let T=0,$=arguments.length;T<$;T++)arguments[T]&&o4(arguments[T],u);return r}const Gst=(e,t,r,{allOwnKeys:u}={})=>(o4(t,(T,$)=>{r&&Tm(T)?e[$]=HU(T,r):e[$]=T},{allOwnKeys:u}),e),Zst=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Kst=(e,t,r,u)=>{e.prototype=Object.create(t.prototype,u),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Yst=(e,t,r,u)=>{let T,$,K;const ct={};if(t=t||{},e==null)return t;do{for(T=Object.getOwnPropertyNames(e),$=T.length;$-- >0;)K=T[$],(!u||u(K,e,t))&&!ct[K]&&(t[K]=e[K],ct[K]=!0);e=r!==!1&&OE(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Xst=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const u=e.indexOf(t,r);return u!==-1&&u===r},Jst=e=>{if(!e)return null;if(Z2(e))return e;let t=e.length;if(!qU(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Qst=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&OE(Uint8Array)),tlt=(e,t)=>{const u=(e&&e[FS]).call(e);let T;for(;(T=u.next())&&!T.done;){const $=T.value;t.call(e,$[0],$[1])}},elt=(e,t)=>{let r;const u=[];for(;(r=e.exec(t))!==null;)u.push(r);return u},rlt=$g("HTMLFormElement"),nlt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,u,T){return u.toUpperCase()+T}),zB=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ilt=$g("RegExp"),KU=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),u={};o4(r,(T,$)=>{let K;(K=t(T,$,e))!==!1&&(u[$]=K||T)}),Object.defineProperties(e,u)},alt=e=>{KU(e,(t,r)=>{if(Tm(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const u=e[r];if(Tm(u)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},olt=(e,t)=>{const r={},u=T=>{T.forEach($=>{r[$]=!0})};return Z2(e)?u(e):u(String(e).split(t)),r},slt=()=>{},llt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function clt(e){return!!(e&&Tm(e.append)&&e[VU]==="FormData"&&e[FS])}const ult=e=>{const t=new Array(10),r=(u,T)=>{if(a4(u)){if(t.indexOf(u)>=0)return;if(i4(u))return u;if(!("toJSON"in u)){t[T]=u;const $=Z2(u)?[]:{};return o4(u,(K,ct)=>{const yt=r(K,T+1);!$2(yt)&&($[ct]=yt)}),t[T]=void 0,$}}return u};return r(e,0)},hlt=$g("AsyncFunction"),dlt=e=>e&&(a4(e)||Tm(e))&&Tm(e.then)&&Tm(e.catch),YU=((e,t)=>e?setImmediate:t?((r,u)=>(Ax.addEventListener("message",({source:T,data:$})=>{T===Ax&&$===r&&u.length&&u.shift()()},!1),T=>{u.push(T),Ax.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Tm(Ax.postMessage)),flt=typeof queueMicrotask<"u"?queueMicrotask.bind(Ax):typeof process<"u"&&process.nextTick||YU,plt=e=>e!=null&&Tm(e[FS]),yo={isArray:Z2,isArrayBuffer:WU,isBuffer:i4,isFormData:jst,isArrayBufferView:Pst,isString:Ist,isNumber:qU,isBoolean:Dst,isObject:a4,isPlainObject:bT,isEmptyObject:zst,isReadableStream:$st,isRequest:Hst,isResponse:Vst,isHeaders:Wst,isUndefined:$2,isDate:Ost,isFile:Bst,isBlob:Rst,isRegExp:ilt,isFunction:Tm,isStream:Nst,isURLSearchParams:Ust,isTypedArray:Qst,isFileList:Fst,forEach:o4,merge:t9,extend:Gst,trim:qst,stripBOM:Zst,inherits:Kst,toFlatObject:Yst,kindOf:NS,kindOfTest:$g,endsWith:Xst,toArray:Jst,forEachEntry:tlt,matchAll:elt,isHTMLForm:rlt,hasOwnProperty:zB,hasOwnProp:zB,reduceDescriptors:KU,freezeMethods:alt,toObjectSet:olt,toCamelCase:nlt,noop:slt,toFiniteNumber:llt,findKey:GU,global:Ax,isContextDefined:ZU,isSpecCompliantForm:clt,toJSONObject:ult,isAsyncFn:hlt,isThenable:dlt,setImmediate:YU,asap:flt,isIterable:plt};function cu(e,t,r,u,T){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),u&&(this.request=u),T&&(this.response=T,this.status=T.status?T.status:null)}yo.inherits(cu,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:yo.toJSONObject(this.config),code:this.code,status:this.status}}});const XU=cu.prototype,JU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{JU[e]={value:e}});Object.defineProperties(cu,JU);Object.defineProperty(XU,"isAxiosError",{value:!0});cu.from=(e,t,r,u,T,$)=>{const K=Object.create(XU);yo.toFlatObject(e,K,function(Ut){return Ut!==Error.prototype},St=>St!=="isAxiosError");const ct=e&&e.message?e.message:"Error",yt=t==null&&e?e.code:t;return cu.call(K,ct,yt,r,u,T),e&&K.cause==null&&Object.defineProperty(K,"cause",{value:e,configurable:!0}),K.name=e&&e.name||"Error",$&&Object.assign(K,$),K};const mlt=null;function e9(e){return yo.isPlainObject(e)||yo.isArray(e)}function QU(e){return yo.endsWith(e,"[]")?e.slice(0,-2):e}function OB(e,t,r){return e?e.concat(t).map(function(T,$){return T=QU(T),!r&&$?"["+T+"]":T}).join(r?".":""):t}function glt(e){return yo.isArray(e)&&!e.some(e9)}const vlt=yo.toFlatObject(yo,{},null,function(t){return/^is[A-Z]/.test(t)});function US(e,t,r){if(!yo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=yo.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Ce,Ve){return!yo.isUndefined(Ve[Ce])});const u=r.metaTokens,T=r.visitor||Ut,$=r.dots,K=r.indexes,yt=(r.Blob||typeof Blob<"u"&&Blob)&&yo.isSpecCompliantForm(t);if(!yo.isFunction(T))throw new TypeError("visitor must be a function");function St(we){if(we===null)return"";if(yo.isDate(we))return we.toISOString();if(yo.isBoolean(we))return we.toString();if(!yt&&yo.isBlob(we))throw new cu("Blob is not supported. Use a Buffer instead.");return yo.isArrayBuffer(we)||yo.isTypedArray(we)?yt&&typeof Blob=="function"?new Blob([we]):Buffer.from(we):we}function Ut(we,Ce,Ve){let kr=we;if(we&&!Ve&&typeof we=="object"){if(yo.endsWith(Ce,"{}"))Ce=u?Ce:Ce.slice(0,-2),we=JSON.stringify(we);else if(yo.isArray(we)&&glt(we)||(yo.isFileList(we)||yo.endsWith(Ce,"[]"))&&(kr=yo.toArray(we)))return Ce=QU(Ce),kr.forEach(function(rn,Lr){!(yo.isUndefined(rn)||rn===null)&&t.append(K===!0?OB([Ce],Lr,$):K===null?Ce:Ce+"[]",St(rn))}),!1}return e9(we)?!0:(t.append(OB(Ve,Ce,$),St(we)),!1)}const ne=[],pe=Object.assign(vlt,{defaultVisitor:Ut,convertValue:St,isVisitable:e9});function me(we,Ce){if(!yo.isUndefined(we)){if(ne.indexOf(we)!==-1)throw Error("Circular reference detected in "+Ce.join("."));ne.push(we),yo.forEach(we,function(kr,It){(!(yo.isUndefined(kr)||kr===null)&&T.call(t,kr,yo.isString(It)?It.trim():It,Ce,pe))===!0&&me(kr,Ce?Ce.concat(It):[It])}),ne.pop()}}if(!yo.isObject(e))throw new TypeError("data must be an object");return me(e),t}function BB(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(u){return t[u]})}function BE(e,t){this._pairs=[],e&&US(e,this,t)}const t$=BE.prototype;t$.append=function(t,r){this._pairs.push([t,r])};t$.toString=function(t){const r=t?function(u){return t.call(this,u,BB)}:BB;return this._pairs.map(function(T){return r(T[0])+"="+r(T[1])},"").join("&")};function ylt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function e$(e,t,r){if(!t)return e;const u=r&&r.encode||ylt;yo.isFunction(r)&&(r={serialize:r});const T=r&&r.serialize;let $;if(T?$=T(t,r):$=yo.isURLSearchParams(t)?t.toString():new BE(t,r).toString(u),$){const K=e.indexOf("#");K!==-1&&(e=e.slice(0,K)),e+=(e.indexOf("?")===-1?"?":"&")+$}return e}class RB{constructor(){this.handlers=[]}use(t,r,u){return this.handlers.push({fulfilled:t,rejected:r,synchronous:u?u.synchronous:!1,runWhen:u?u.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){yo.forEach(this.handlers,function(u){u!==null&&t(u)})}}const r$={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_lt=typeof URLSearchParams<"u"?URLSearchParams:BE,xlt=typeof FormData<"u"?FormData:null,blt=typeof Blob<"u"?Blob:null,wlt={isBrowser:!0,classes:{URLSearchParams:_lt,FormData:xlt,Blob:blt},protocols:["http","https","file","blob","url","data"]},RE=typeof window<"u"&&typeof document<"u",r9=typeof navigator=="object"&&navigator||void 0,klt=RE&&(!r9||["ReactNative","NativeScript","NS"].indexOf(r9.product)<0),Tlt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Slt=RE&&window.location.href||"http://localhost",Clt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:RE,hasStandardBrowserEnv:klt,hasStandardBrowserWebWorkerEnv:Tlt,navigator:r9,origin:Slt},Symbol.toStringTag,{value:"Module"})),F0={...Clt,...wlt};function Alt(e,t){return US(e,new F0.classes.URLSearchParams,{visitor:function(r,u,T,$){return F0.isNode&&yo.isBuffer(r)?(this.append(u,r.toString("base64")),!1):$.defaultVisitor.apply(this,arguments)},...t})}function Mlt(e){return yo.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Elt(e){const t={},r=Object.keys(e);let u;const T=r.length;let $;for(u=0;u=r.length;return K=!K&&yo.isArray(T)?T.length:K,yt?(yo.hasOwnProp(T,K)?T[K]=[T[K],u]:T[K]=u,!ct):((!T[K]||!yo.isObject(T[K]))&&(T[K]=[]),t(r,u,T[K],$)&&yo.isArray(T[K])&&(T[K]=Elt(T[K])),!ct)}if(yo.isFormData(e)&&yo.isFunction(e.entries)){const r={};return yo.forEachEntry(e,(u,T)=>{t(Mlt(u),T,r,0)}),r}return null}function Llt(e,t,r){if(yo.isString(e))try{return(t||JSON.parse)(e),yo.trim(e)}catch(u){if(u.name!=="SyntaxError")throw u}return(r||JSON.stringify)(e)}const s4={transitional:r$,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const u=r.getContentType()||"",T=u.indexOf("application/json")>-1,$=yo.isObject(t);if($&&yo.isHTMLForm(t)&&(t=new FormData(t)),yo.isFormData(t))return T?JSON.stringify(n$(t)):t;if(yo.isArrayBuffer(t)||yo.isBuffer(t)||yo.isStream(t)||yo.isFile(t)||yo.isBlob(t)||yo.isReadableStream(t))return t;if(yo.isArrayBufferView(t))return t.buffer;if(yo.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let ct;if($){if(u.indexOf("application/x-www-form-urlencoded")>-1)return Alt(t,this.formSerializer).toString();if((ct=yo.isFileList(t))||u.indexOf("multipart/form-data")>-1){const yt=this.env&&this.env.FormData;return US(ct?{"files[]":t}:t,yt&&new yt,this.formSerializer)}}return $||T?(r.setContentType("application/json",!1),Llt(t)):t}],transformResponse:[function(t){const r=this.transitional||s4.transitional,u=r&&r.forcedJSONParsing,T=this.responseType==="json";if(yo.isResponse(t)||yo.isReadableStream(t))return t;if(t&&yo.isString(t)&&(u&&!this.responseType||T)){const K=!(r&&r.silentJSONParsing)&&T;try{return JSON.parse(t,this.parseReviver)}catch(ct){if(K)throw ct.name==="SyntaxError"?cu.from(ct,cu.ERR_BAD_RESPONSE,this,null,this.response):ct}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F0.classes.FormData,Blob:F0.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};yo.forEach(["delete","get","head","post","put","patch"],e=>{s4.headers[e]={}});const Plt=yo.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ilt=e=>{const t={};let r,u,T;return e&&e.split(` `).forEach(function(K){T=K.indexOf(":"),r=K.substring(0,T).trim().toLowerCase(),u=K.substring(T+1).trim(),!(!r||t[r]&&Plt[r])&&(r==="set-cookie"?t[r]?t[r].push(u):t[r]=[u]:t[r]=t[r]?t[r]+", "+u:u)}),t},FB=Symbol("internals");function O3(e){return e&&String(e).trim().toLowerCase()}function wT(e){return e===!1||e==null?e:yo.isArray(e)?e.map(wT):String(e)}function Dlt(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let u;for(;u=r.exec(e);)t[u[1]]=u[2];return t}const zlt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function I7(e,t,r,u,T){if(yo.isFunction(u))return u.call(this,t,r);if(T&&(t=r),!!yo.isString(t)){if(yo.isString(u))return t.indexOf(u)!==-1;if(yo.isRegExp(u))return u.test(t)}}function Olt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,u)=>r.toUpperCase()+u)}function Blt(e,t){const r=yo.toCamelCase(" "+t);["get","set","has"].forEach(u=>{Object.defineProperty(e,u+r,{value:function(T,$,K){return this[u].call(this,t,T,$,K)},configurable:!0})})}let Sm=class{constructor(t){t&&this.set(t)}set(t,r,u){const T=this;function $(ct,yt,St){const Ut=O3(yt);if(!Ut)throw new Error("header name must be a non-empty string");const ne=yo.findKey(T,Ut);(!ne||T[ne]===void 0||St===!0||St===void 0&&T[ne]!==!1)&&(T[ne||yt]=wT(ct))}const K=(ct,yt)=>yo.forEach(ct,(St,Ut)=>$(St,Ut,yt));if(yo.isPlainObject(t)||t instanceof this.constructor)K(t,r);else if(yo.isString(t)&&(t=t.trim())&&!zlt(t))K(Ilt(t),r);else if(yo.isObject(t)&&yo.isIterable(t)){let ct={},yt,St;for(const Ut of t){if(!yo.isArray(Ut))throw TypeError("Object iterator must return a key-value pair");ct[St=Ut[0]]=(yt=ct[St])?yo.isArray(yt)?[...yt,Ut[1]]:[yt,Ut[1]]:Ut[1]}K(ct,r)}else t!=null&&$(r,t,u);return this}get(t,r){if(t=O3(t),t){const u=yo.findKey(this,t);if(u){const T=this[u];if(!r)return T;if(r===!0)return Dlt(T);if(yo.isFunction(r))return r.call(this,T,u);if(yo.isRegExp(r))return r.exec(T);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=O3(t),t){const u=yo.findKey(this,t);return!!(u&&this[u]!==void 0&&(!r||I7(this,this[u],u,r)))}return!1}delete(t,r){const u=this;let T=!1;function $(K){if(K=O3(K),K){const ct=yo.findKey(u,K);ct&&(!r||I7(u,u[ct],ct,r))&&(delete u[ct],T=!0)}}return yo.isArray(t)?t.forEach($):$(t),T}clear(t){const r=Object.keys(this);let u=r.length,T=!1;for(;u--;){const $=r[u];(!t||I7(this,this[$],$,t,!0))&&(delete this[$],T=!0)}return T}normalize(t){const r=this,u={};return yo.forEach(this,(T,$)=>{const K=yo.findKey(u,$);if(K){r[K]=wT(T),delete r[$];return}const ct=t?Olt($):String($).trim();ct!==$&&delete r[$],r[ct]=wT(T),u[ct]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return yo.forEach(this,(u,T)=>{u!=null&&u!==!1&&(r[T]=t&&yo.isArray(u)?u.join(", "):u)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const u=new this(t);return r.forEach(T=>u.set(T)),u}static accessor(t){const u=(this[FB]=this[FB]={accessors:{}}).accessors,T=this.prototype;function $(K){const ct=O3(K);u[ct]||(Blt(T,K),u[ct]=!0)}return yo.isArray(t)?t.forEach($):$(t),this}};Sm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);yo.reduceDescriptors(Sm.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(u){this[r]=u}}});yo.freezeMethods(Sm);function D7(e,t){const r=this||s4,u=t||r,T=Sm.from(u.headers);let $=u.data;return yo.forEach(e,function(ct){$=ct.call(r,$,T.normalize(),t?t.status:void 0)}),T.normalize(),$}function i$(e){return!!(e&&e.__CANCEL__)}function K2(e,t,r){cu.call(this,e??"canceled",cu.ERR_CANCELED,t,r),this.name="CanceledError"}yo.inherits(K2,cu,{__CANCEL__:!0});function a$(e,t,r){const u=r.config.validateStatus;!r.status||!u||u(r.status)?e(r):t(new cu("Request failed with status code "+r.status,[cu.ERR_BAD_REQUEST,cu.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Rlt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Flt(e,t){e=e||10;const r=new Array(e),u=new Array(e);let T=0,$=0,K;return t=t!==void 0?t:1e3,function(yt){const St=Date.now(),Ut=u[$];K||(K=St),r[T]=yt,u[T]=St;let ne=$,pe=0;for(;ne!==T;)pe+=r[ne++],ne=ne%e;if(T=(T+1)%e,T===$&&($=($+1)%e),St-K{r=Ut,T=null,$&&(clearTimeout($),$=null),e(...St)};return[(...St)=>{const Ut=Date.now(),ne=Ut-r;ne>=u?K(St,Ut):(T=St,$||($=setTimeout(()=>{$=null,K(T)},u-ne)))},()=>T&&K(T)]}const YT=(e,t,r=3)=>{let u=0;const T=Flt(50,250);return Nlt($=>{const K=$.loaded,ct=$.lengthComputable?$.total:void 0,yt=K-u,St=T(yt),Ut=K<=ct;u=K;const ne={loaded:K,total:ct,progress:ct?K/ct:void 0,bytes:yt,rate:St||void 0,estimated:St&&ct&&Ut?(ct-K)/St:void 0,event:$,lengthComputable:ct!=null,[t?"download":"upload"]:!0};e(ne)},r)},NB=(e,t)=>{const r=e!=null;return[u=>t[0]({lengthComputable:r,total:e,loaded:u}),t[1]]},jB=e=>(...t)=>yo.asap(()=>e(...t)),jlt=F0.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F0.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F0.origin),F0.navigator&&/(msie|trident)/i.test(F0.navigator.userAgent)):()=>!0,Ult=F0.hasStandardBrowserEnv?{write(e,t,r,u,T,$,K){if(typeof document>"u")return;const ct=[`${e}=${encodeURIComponent(t)}`];yo.isNumber(r)&&ct.push(`expires=${new Date(r).toUTCString()}`),yo.isString(u)&&ct.push(`path=${u}`),yo.isString(T)&&ct.push(`domain=${T}`),$===!0&&ct.push("secure"),yo.isString(K)&&ct.push(`SameSite=${K}`),document.cookie=ct.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function $lt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Hlt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function o$(e,t,r){let u=!$lt(t);return e&&(u||r==!1)?Hlt(e,t):t}const UB=e=>e instanceof Sm?{...e}:e;function jx(e,t){t=t||{};const r={};function u(St,Ut,ne,pe){return yo.isPlainObject(St)&&yo.isPlainObject(Ut)?yo.merge.call({caseless:pe},St,Ut):yo.isPlainObject(Ut)?yo.merge({},Ut):yo.isArray(Ut)?Ut.slice():Ut}function T(St,Ut,ne,pe){if(yo.isUndefined(Ut)){if(!yo.isUndefined(St))return u(void 0,St,ne,pe)}else return u(St,Ut,ne,pe)}function $(St,Ut){if(!yo.isUndefined(Ut))return u(void 0,Ut)}function K(St,Ut){if(yo.isUndefined(Ut)){if(!yo.isUndefined(St))return u(void 0,St)}else return u(void 0,Ut)}function ct(St,Ut,ne){if(ne in t)return u(St,Ut);if(ne in e)return u(void 0,St)}const yt={url:$,method:$,data:$,baseURL:K,transformRequest:K,transformResponse:K,paramsSerializer:K,timeout:K,timeoutMessage:K,withCredentials:K,withXSRFToken:K,adapter:K,responseType:K,xsrfCookieName:K,xsrfHeaderName:K,onUploadProgress:K,onDownloadProgress:K,decompress:K,maxContentLength:K,maxBodyLength:K,beforeRedirect:K,transport:K,httpAgent:K,httpsAgent:K,cancelToken:K,socketPath:K,responseEncoding:K,validateStatus:ct,headers:(St,Ut,ne)=>T(UB(St),UB(Ut),ne,!0)};return yo.forEach(Object.keys({...e,...t}),function(Ut){const ne=yt[Ut]||T,pe=ne(e[Ut],t[Ut],Ut);yo.isUndefined(pe)&&ne!==ct||(r[Ut]=pe)}),r}const s$=e=>{const t=jx({},e);let{data:r,withXSRFToken:u,xsrfHeaderName:T,xsrfCookieName:$,headers:K,auth:ct}=t;if(t.headers=K=Sm.from(K),t.url=e$(o$(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),ct&&K.set("Authorization","Basic "+btoa((ct.username||"")+":"+(ct.password?unescape(encodeURIComponent(ct.password)):""))),yo.isFormData(r)){if(F0.hasStandardBrowserEnv||F0.hasStandardBrowserWebWorkerEnv)K.setContentType(void 0);else if(yo.isFunction(r.getHeaders)){const yt=r.getHeaders(),St=["content-type","content-length"];Object.entries(yt).forEach(([Ut,ne])=>{St.includes(Ut.toLowerCase())&&K.set(Ut,ne)})}}if(F0.hasStandardBrowserEnv&&(u&&yo.isFunction(u)&&(u=u(t)),u||u!==!1&&jlt(t.url))){const yt=T&&$&&Ult.read($);yt&&K.set(T,yt)}return t},Vlt=typeof XMLHttpRequest<"u",Wlt=Vlt&&function(e){return new Promise(function(r,u){const T=s$(e);let $=T.data;const K=Sm.from(T.headers).normalize();let{responseType:ct,onUploadProgress:yt,onDownloadProgress:St}=T,Ut,ne,pe,me,we;function Ce(){me&&me(),we&&we(),T.cancelToken&&T.cancelToken.unsubscribe(Ut),T.signal&&T.signal.removeEventListener("abort",Ut)}let Ve=new XMLHttpRequest;Ve.open(T.method.toUpperCase(),T.url,!0),Ve.timeout=T.timeout;function kr(){if(!Ve)return;const rn=Sm.from("getAllResponseHeaders"in Ve&&Ve.getAllResponseHeaders()),Mr={data:!ct||ct==="text"||ct==="json"?Ve.responseText:Ve.response,status:Ve.status,statusText:Ve.statusText,headers:rn,config:e,request:Ve};a$(function(Dn){r(Dn),Ce()},function(Dn){u(Dn),Ce()},Mr),Ve=null}"onloadend"in Ve?Ve.onloadend=kr:Ve.onreadystatechange=function(){!Ve||Ve.readyState!==4||Ve.status===0&&!(Ve.responseURL&&Ve.responseURL.indexOf("file:")===0)||setTimeout(kr)},Ve.onabort=function(){Ve&&(u(new cu("Request aborted",cu.ECONNABORTED,e,Ve)),Ve=null)},Ve.onerror=function(Lr){const Mr=Lr&&Lr.message?Lr.message:"Network Error",tn=new cu(Mr,cu.ERR_NETWORK,e,Ve);tn.event=Lr||null,u(tn),Ve=null},Ve.ontimeout=function(){let Lr=T.timeout?"timeout of "+T.timeout+"ms exceeded":"timeout exceeded";const Mr=T.transitional||r$;T.timeoutErrorMessage&&(Lr=T.timeoutErrorMessage),u(new cu(Lr,Mr.clarifyTimeoutError?cu.ETIMEDOUT:cu.ECONNABORTED,e,Ve)),Ve=null},$===void 0&&K.setContentType(null),"setRequestHeader"in Ve&&yo.forEach(K.toJSON(),function(Lr,Mr){Ve.setRequestHeader(Mr,Lr)}),yo.isUndefined(T.withCredentials)||(Ve.withCredentials=!!T.withCredentials),ct&&ct!=="json"&&(Ve.responseType=T.responseType),St&&([pe,we]=YT(St,!0),Ve.addEventListener("progress",pe)),yt&&Ve.upload&&([ne,me]=YT(yt),Ve.upload.addEventListener("progress",ne),Ve.upload.addEventListener("loadend",me)),(T.cancelToken||T.signal)&&(Ut=rn=>{Ve&&(u(!rn||rn.type?new K2(null,e,Ve):rn),Ve.abort(),Ve=null)},T.cancelToken&&T.cancelToken.subscribe(Ut),T.signal&&(T.signal.aborted?Ut():T.signal.addEventListener("abort",Ut)));const It=Rlt(T.url);if(It&&F0.protocols.indexOf(It)===-1){u(new cu("Unsupported protocol "+It+":",cu.ERR_BAD_REQUEST,e));return}Ve.send($||null)})},qlt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let u=new AbortController,T;const $=function(St){if(!T){T=!0,ct();const Ut=St instanceof Error?St:this.reason;u.abort(Ut instanceof cu?Ut:new K2(Ut instanceof Error?Ut.message:Ut))}};let K=t&&setTimeout(()=>{K=null,$(new cu(`timeout ${t} of ms exceeded`,cu.ETIMEDOUT))},t);const ct=()=>{e&&(K&&clearTimeout(K),K=null,e.forEach(St=>{St.unsubscribe?St.unsubscribe($):St.removeEventListener("abort",$)}),e=null)};e.forEach(St=>St.addEventListener("abort",$));const{signal:yt}=u;return yt.unsubscribe=()=>yo.asap(ct),yt}},Glt=function*(e,t){let r=e.byteLength;if(r{const T=Zlt(e,t);let $=0,K,ct=yt=>{K||(K=!0,u&&u(yt))};return new ReadableStream({async pull(yt){try{const{done:St,value:Ut}=await T.next();if(St){ct(),yt.close();return}let ne=Ut.byteLength;if(r){let pe=$+=ne;r(pe)}yt.enqueue(new Uint8Array(Ut))}catch(St){throw ct(St),St}},cancel(yt){return ct(yt),T.return()}},{highWaterMark:2})},HB=64*1024,{isFunction:R6}=yo,Ylt=(({Request:e,Response:t})=>({Request:e,Response:t}))(yo.global),{ReadableStream:VB,TextEncoder:WB}=yo.global,qB=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Xlt=e=>{e=yo.merge.call({skipUndefined:!0},Ylt,e);const{fetch:t,Request:r,Response:u}=e,T=t?R6(t):typeof fetch=="function",$=R6(r),K=R6(u);if(!T)return!1;const ct=T&&R6(VB),yt=T&&(typeof WB=="function"?(we=>Ce=>we.encode(Ce))(new WB):async we=>new Uint8Array(await new r(we).arrayBuffer())),St=$&&ct&&qB(()=>{let we=!1;const Ce=new r(F0.origin,{body:new VB,method:"POST",get duplex(){return we=!0,"half"}}).headers.has("Content-Type");return we&&!Ce}),Ut=K&&ct&&qB(()=>yo.isReadableStream(new u("").body)),ne={stream:Ut&&(we=>we.body)};T&&["text","arrayBuffer","blob","formData","stream"].forEach(we=>{!ne[we]&&(ne[we]=(Ce,Ve)=>{let kr=Ce&&Ce[we];if(kr)return kr.call(Ce);throw new cu(`Response type '${we}' is not supported`,cu.ERR_NOT_SUPPORT,Ve)})});const pe=async we=>{if(we==null)return 0;if(yo.isBlob(we))return we.size;if(yo.isSpecCompliantForm(we))return(await new r(F0.origin,{method:"POST",body:we}).arrayBuffer()).byteLength;if(yo.isArrayBufferView(we)||yo.isArrayBuffer(we))return we.byteLength;if(yo.isURLSearchParams(we)&&(we=we+""),yo.isString(we))return(await yt(we)).byteLength},me=async(we,Ce)=>{const Ve=yo.toFiniteNumber(we.getContentLength());return Ve??pe(Ce)};return async we=>{let{url:Ce,method:Ve,data:kr,signal:It,cancelToken:rn,timeout:Lr,onDownloadProgress:Mr,onUploadProgress:tn,responseType:Dn,headers:Mn,withCredentials:Br="same-origin",fetchOptions:Vn}=s$(we),on=t||fetch;Dn=Dn?(Dn+"").toLowerCase():"text";let pr=qlt([It,rn&&rn.toAbortSignal()],Lr),_r=null;const Sr=pr&&pr.unsubscribe&&(()=>{pr.unsubscribe()});let Dr;try{if(tn&&St&&Ve!=="get"&&Ve!=="head"&&(Dr=await me(Mn,kr))!==0){let va=new r(Ce,{method:"POST",body:kr,duplex:"half"}),_a;if(yo.isFormData(kr)&&(_a=va.headers.get("content-type"))&&Mn.setContentType(_a),va.body){const[qi,Bi]=NB(Dr,YT(jB(tn)));kr=$B(va.body,HB,qi,Bi)}}yo.isString(Br)||(Br=Br?"include":"omit");const nn=$&&"credentials"in r.prototype,Cn={...Vn,signal:pr,method:Ve.toUpperCase(),headers:Mn.normalize().toJSON(),body:kr,duplex:"half",credentials:nn?Br:void 0};_r=$&&new r(Ce,Cn);let Xn=await($?on(_r,Vn):on(Ce,Cn));const _i=Ut&&(Dn==="stream"||Dn==="response");if(Ut&&(Mr||_i&&Sr)){const va={};["status","statusText","headers"].forEach(Xi=>{va[Xi]=Xn[Xi]});const _a=yo.toFiniteNumber(Xn.headers.get("content-length")),[qi,Bi]=Mr&&NB(_a,YT(jB(Mr),!0))||[];Xn=new u($B(Xn.body,HB,qi,()=>{Bi&&Bi(),Sr&&Sr()}),va)}Dn=Dn||"text";let ta=await ne[yo.findKey(ne,Dn)||"text"](Xn,we);return!_i&&Sr&&Sr(),await new Promise((va,_a)=>{a$(va,_a,{data:ta,headers:Sm.from(Xn.headers),status:Xn.status,statusText:Xn.statusText,config:we,request:_r})})}catch(nn){throw Sr&&Sr(),nn&&nn.name==="TypeError"&&/Load failed|fetch/i.test(nn.message)?Object.assign(new cu("Network Error",cu.ERR_NETWORK,we,_r),{cause:nn.cause||nn}):cu.from(nn,nn&&nn.code,we,_r)}}},Jlt=new Map,l$=e=>{let t=e&&e.env||{};const{fetch:r,Request:u,Response:T}=t,$=[u,T,r];let K=$.length,ct=K,yt,St,Ut=Jlt;for(;ct--;)yt=$[ct],St=Ut.get(yt),St===void 0&&Ut.set(yt,St=ct?new Map:Xlt(t)),Ut=St;return St};l$();const FE={http:mlt,xhr:Wlt,fetch:{get:l$}};yo.forEach(FE,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const GB=e=>`- ${e}`,Qlt=e=>yo.isFunction(e)||e===null||e===!1;function tct(e,t){e=yo.isArray(e)?e:[e];const{length:r}=e;let u,T;const $={};for(let K=0;K`adapter ${yt} `+(St===!1?"is not supported by the environment":"is not available in the build"));let ct=r?K.length>1?`since : +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const u=new this(t);return r.forEach(T=>u.set(T)),u}static accessor(t){const u=(this[FB]=this[FB]={accessors:{}}).accessors,T=this.prototype;function $(K){const ct=O3(K);u[ct]||(Blt(T,K),u[ct]=!0)}return yo.isArray(t)?t.forEach($):$(t),this}};Sm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);yo.reduceDescriptors(Sm.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(u){this[r]=u}}});yo.freezeMethods(Sm);function D7(e,t){const r=this||s4,u=t||r,T=Sm.from(u.headers);let $=u.data;return yo.forEach(e,function(ct){$=ct.call(r,$,T.normalize(),t?t.status:void 0)}),T.normalize(),$}function i$(e){return!!(e&&e.__CANCEL__)}function K2(e,t,r){cu.call(this,e??"canceled",cu.ERR_CANCELED,t,r),this.name="CanceledError"}yo.inherits(K2,cu,{__CANCEL__:!0});function a$(e,t,r){const u=r.config.validateStatus;!r.status||!u||u(r.status)?e(r):t(new cu("Request failed with status code "+r.status,[cu.ERR_BAD_REQUEST,cu.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Rlt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Flt(e,t){e=e||10;const r=new Array(e),u=new Array(e);let T=0,$=0,K;return t=t!==void 0?t:1e3,function(yt){const St=Date.now(),Ut=u[$];K||(K=St),r[T]=yt,u[T]=St;let ne=$,pe=0;for(;ne!==T;)pe+=r[ne++],ne=ne%e;if(T=(T+1)%e,T===$&&($=($+1)%e),St-K{r=Ut,T=null,$&&(clearTimeout($),$=null),e(...St)};return[(...St)=>{const Ut=Date.now(),ne=Ut-r;ne>=u?K(St,Ut):(T=St,$||($=setTimeout(()=>{$=null,K(T)},u-ne)))},()=>T&&K(T)]}const YT=(e,t,r=3)=>{let u=0;const T=Flt(50,250);return Nlt($=>{const K=$.loaded,ct=$.lengthComputable?$.total:void 0,yt=K-u,St=T(yt),Ut=K<=ct;u=K;const ne={loaded:K,total:ct,progress:ct?K/ct:void 0,bytes:yt,rate:St||void 0,estimated:St&&ct&&Ut?(ct-K)/St:void 0,event:$,lengthComputable:ct!=null,[t?"download":"upload"]:!0};e(ne)},r)},NB=(e,t)=>{const r=e!=null;return[u=>t[0]({lengthComputable:r,total:e,loaded:u}),t[1]]},jB=e=>(...t)=>yo.asap(()=>e(...t)),jlt=F0.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F0.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F0.origin),F0.navigator&&/(msie|trident)/i.test(F0.navigator.userAgent)):()=>!0,Ult=F0.hasStandardBrowserEnv?{write(e,t,r,u,T,$,K){if(typeof document>"u")return;const ct=[`${e}=${encodeURIComponent(t)}`];yo.isNumber(r)&&ct.push(`expires=${new Date(r).toUTCString()}`),yo.isString(u)&&ct.push(`path=${u}`),yo.isString(T)&&ct.push(`domain=${T}`),$===!0&&ct.push("secure"),yo.isString(K)&&ct.push(`SameSite=${K}`),document.cookie=ct.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function $lt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Hlt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function o$(e,t,r){let u=!$lt(t);return e&&(u||r==!1)?Hlt(e,t):t}const UB=e=>e instanceof Sm?{...e}:e;function Ux(e,t){t=t||{};const r={};function u(St,Ut,ne,pe){return yo.isPlainObject(St)&&yo.isPlainObject(Ut)?yo.merge.call({caseless:pe},St,Ut):yo.isPlainObject(Ut)?yo.merge({},Ut):yo.isArray(Ut)?Ut.slice():Ut}function T(St,Ut,ne,pe){if(yo.isUndefined(Ut)){if(!yo.isUndefined(St))return u(void 0,St,ne,pe)}else return u(St,Ut,ne,pe)}function $(St,Ut){if(!yo.isUndefined(Ut))return u(void 0,Ut)}function K(St,Ut){if(yo.isUndefined(Ut)){if(!yo.isUndefined(St))return u(void 0,St)}else return u(void 0,Ut)}function ct(St,Ut,ne){if(ne in t)return u(St,Ut);if(ne in e)return u(void 0,St)}const yt={url:$,method:$,data:$,baseURL:K,transformRequest:K,transformResponse:K,paramsSerializer:K,timeout:K,timeoutMessage:K,withCredentials:K,withXSRFToken:K,adapter:K,responseType:K,xsrfCookieName:K,xsrfHeaderName:K,onUploadProgress:K,onDownloadProgress:K,decompress:K,maxContentLength:K,maxBodyLength:K,beforeRedirect:K,transport:K,httpAgent:K,httpsAgent:K,cancelToken:K,socketPath:K,responseEncoding:K,validateStatus:ct,headers:(St,Ut,ne)=>T(UB(St),UB(Ut),ne,!0)};return yo.forEach(Object.keys({...e,...t}),function(Ut){const ne=yt[Ut]||T,pe=ne(e[Ut],t[Ut],Ut);yo.isUndefined(pe)&&ne!==ct||(r[Ut]=pe)}),r}const s$=e=>{const t=Ux({},e);let{data:r,withXSRFToken:u,xsrfHeaderName:T,xsrfCookieName:$,headers:K,auth:ct}=t;if(t.headers=K=Sm.from(K),t.url=e$(o$(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),ct&&K.set("Authorization","Basic "+btoa((ct.username||"")+":"+(ct.password?unescape(encodeURIComponent(ct.password)):""))),yo.isFormData(r)){if(F0.hasStandardBrowserEnv||F0.hasStandardBrowserWebWorkerEnv)K.setContentType(void 0);else if(yo.isFunction(r.getHeaders)){const yt=r.getHeaders(),St=["content-type","content-length"];Object.entries(yt).forEach(([Ut,ne])=>{St.includes(Ut.toLowerCase())&&K.set(Ut,ne)})}}if(F0.hasStandardBrowserEnv&&(u&&yo.isFunction(u)&&(u=u(t)),u||u!==!1&&jlt(t.url))){const yt=T&&$&&Ult.read($);yt&&K.set(T,yt)}return t},Vlt=typeof XMLHttpRequest<"u",Wlt=Vlt&&function(e){return new Promise(function(r,u){const T=s$(e);let $=T.data;const K=Sm.from(T.headers).normalize();let{responseType:ct,onUploadProgress:yt,onDownloadProgress:St}=T,Ut,ne,pe,me,we;function Ce(){me&&me(),we&&we(),T.cancelToken&&T.cancelToken.unsubscribe(Ut),T.signal&&T.signal.removeEventListener("abort",Ut)}let Ve=new XMLHttpRequest;Ve.open(T.method.toUpperCase(),T.url,!0),Ve.timeout=T.timeout;function kr(){if(!Ve)return;const rn=Sm.from("getAllResponseHeaders"in Ve&&Ve.getAllResponseHeaders()),Mr={data:!ct||ct==="text"||ct==="json"?Ve.responseText:Ve.response,status:Ve.status,statusText:Ve.statusText,headers:rn,config:e,request:Ve};a$(function(Dn){r(Dn),Ce()},function(Dn){u(Dn),Ce()},Mr),Ve=null}"onloadend"in Ve?Ve.onloadend=kr:Ve.onreadystatechange=function(){!Ve||Ve.readyState!==4||Ve.status===0&&!(Ve.responseURL&&Ve.responseURL.indexOf("file:")===0)||setTimeout(kr)},Ve.onabort=function(){Ve&&(u(new cu("Request aborted",cu.ECONNABORTED,e,Ve)),Ve=null)},Ve.onerror=function(Lr){const Mr=Lr&&Lr.message?Lr.message:"Network Error",tn=new cu(Mr,cu.ERR_NETWORK,e,Ve);tn.event=Lr||null,u(tn),Ve=null},Ve.ontimeout=function(){let Lr=T.timeout?"timeout of "+T.timeout+"ms exceeded":"timeout exceeded";const Mr=T.transitional||r$;T.timeoutErrorMessage&&(Lr=T.timeoutErrorMessage),u(new cu(Lr,Mr.clarifyTimeoutError?cu.ETIMEDOUT:cu.ECONNABORTED,e,Ve)),Ve=null},$===void 0&&K.setContentType(null),"setRequestHeader"in Ve&&yo.forEach(K.toJSON(),function(Lr,Mr){Ve.setRequestHeader(Mr,Lr)}),yo.isUndefined(T.withCredentials)||(Ve.withCredentials=!!T.withCredentials),ct&&ct!=="json"&&(Ve.responseType=T.responseType),St&&([pe,we]=YT(St,!0),Ve.addEventListener("progress",pe)),yt&&Ve.upload&&([ne,me]=YT(yt),Ve.upload.addEventListener("progress",ne),Ve.upload.addEventListener("loadend",me)),(T.cancelToken||T.signal)&&(Ut=rn=>{Ve&&(u(!rn||rn.type?new K2(null,e,Ve):rn),Ve.abort(),Ve=null)},T.cancelToken&&T.cancelToken.subscribe(Ut),T.signal&&(T.signal.aborted?Ut():T.signal.addEventListener("abort",Ut)));const It=Rlt(T.url);if(It&&F0.protocols.indexOf(It)===-1){u(new cu("Unsupported protocol "+It+":",cu.ERR_BAD_REQUEST,e));return}Ve.send($||null)})},qlt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let u=new AbortController,T;const $=function(St){if(!T){T=!0,ct();const Ut=St instanceof Error?St:this.reason;u.abort(Ut instanceof cu?Ut:new K2(Ut instanceof Error?Ut.message:Ut))}};let K=t&&setTimeout(()=>{K=null,$(new cu(`timeout ${t} of ms exceeded`,cu.ETIMEDOUT))},t);const ct=()=>{e&&(K&&clearTimeout(K),K=null,e.forEach(St=>{St.unsubscribe?St.unsubscribe($):St.removeEventListener("abort",$)}),e=null)};e.forEach(St=>St.addEventListener("abort",$));const{signal:yt}=u;return yt.unsubscribe=()=>yo.asap(ct),yt}},Glt=function*(e,t){let r=e.byteLength;if(r{const T=Zlt(e,t);let $=0,K,ct=yt=>{K||(K=!0,u&&u(yt))};return new ReadableStream({async pull(yt){try{const{done:St,value:Ut}=await T.next();if(St){ct(),yt.close();return}let ne=Ut.byteLength;if(r){let pe=$+=ne;r(pe)}yt.enqueue(new Uint8Array(Ut))}catch(St){throw ct(St),St}},cancel(yt){return ct(yt),T.return()}},{highWaterMark:2})},HB=64*1024,{isFunction:R6}=yo,Ylt=(({Request:e,Response:t})=>({Request:e,Response:t}))(yo.global),{ReadableStream:VB,TextEncoder:WB}=yo.global,qB=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Xlt=e=>{e=yo.merge.call({skipUndefined:!0},Ylt,e);const{fetch:t,Request:r,Response:u}=e,T=t?R6(t):typeof fetch=="function",$=R6(r),K=R6(u);if(!T)return!1;const ct=T&&R6(VB),yt=T&&(typeof WB=="function"?(we=>Ce=>we.encode(Ce))(new WB):async we=>new Uint8Array(await new r(we).arrayBuffer())),St=$&&ct&&qB(()=>{let we=!1;const Ce=new r(F0.origin,{body:new VB,method:"POST",get duplex(){return we=!0,"half"}}).headers.has("Content-Type");return we&&!Ce}),Ut=K&&ct&&qB(()=>yo.isReadableStream(new u("").body)),ne={stream:Ut&&(we=>we.body)};T&&["text","arrayBuffer","blob","formData","stream"].forEach(we=>{!ne[we]&&(ne[we]=(Ce,Ve)=>{let kr=Ce&&Ce[we];if(kr)return kr.call(Ce);throw new cu(`Response type '${we}' is not supported`,cu.ERR_NOT_SUPPORT,Ve)})});const pe=async we=>{if(we==null)return 0;if(yo.isBlob(we))return we.size;if(yo.isSpecCompliantForm(we))return(await new r(F0.origin,{method:"POST",body:we}).arrayBuffer()).byteLength;if(yo.isArrayBufferView(we)||yo.isArrayBuffer(we))return we.byteLength;if(yo.isURLSearchParams(we)&&(we=we+""),yo.isString(we))return(await yt(we)).byteLength},me=async(we,Ce)=>{const Ve=yo.toFiniteNumber(we.getContentLength());return Ve??pe(Ce)};return async we=>{let{url:Ce,method:Ve,data:kr,signal:It,cancelToken:rn,timeout:Lr,onDownloadProgress:Mr,onUploadProgress:tn,responseType:Dn,headers:Mn,withCredentials:Br="same-origin",fetchOptions:Vn}=s$(we),on=t||fetch;Dn=Dn?(Dn+"").toLowerCase():"text";let pr=qlt([It,rn&&rn.toAbortSignal()],Lr),_r=null;const Sr=pr&&pr.unsubscribe&&(()=>{pr.unsubscribe()});let Dr;try{if(tn&&St&&Ve!=="get"&&Ve!=="head"&&(Dr=await me(Mn,kr))!==0){let va=new r(Ce,{method:"POST",body:kr,duplex:"half"}),_a;if(yo.isFormData(kr)&&(_a=va.headers.get("content-type"))&&Mn.setContentType(_a),va.body){const[qi,Bi]=NB(Dr,YT(jB(tn)));kr=$B(va.body,HB,qi,Bi)}}yo.isString(Br)||(Br=Br?"include":"omit");const nn=$&&"credentials"in r.prototype,Cn={...Vn,signal:pr,method:Ve.toUpperCase(),headers:Mn.normalize().toJSON(),body:kr,duplex:"half",credentials:nn?Br:void 0};_r=$&&new r(Ce,Cn);let Xn=await($?on(_r,Vn):on(Ce,Cn));const _i=Ut&&(Dn==="stream"||Dn==="response");if(Ut&&(Mr||_i&&Sr)){const va={};["status","statusText","headers"].forEach(Xi=>{va[Xi]=Xn[Xi]});const _a=yo.toFiniteNumber(Xn.headers.get("content-length")),[qi,Bi]=Mr&&NB(_a,YT(jB(Mr),!0))||[];Xn=new u($B(Xn.body,HB,qi,()=>{Bi&&Bi(),Sr&&Sr()}),va)}Dn=Dn||"text";let ta=await ne[yo.findKey(ne,Dn)||"text"](Xn,we);return!_i&&Sr&&Sr(),await new Promise((va,_a)=>{a$(va,_a,{data:ta,headers:Sm.from(Xn.headers),status:Xn.status,statusText:Xn.statusText,config:we,request:_r})})}catch(nn){throw Sr&&Sr(),nn&&nn.name==="TypeError"&&/Load failed|fetch/i.test(nn.message)?Object.assign(new cu("Network Error",cu.ERR_NETWORK,we,_r),{cause:nn.cause||nn}):cu.from(nn,nn&&nn.code,we,_r)}}},Jlt=new Map,l$=e=>{let t=e&&e.env||{};const{fetch:r,Request:u,Response:T}=t,$=[u,T,r];let K=$.length,ct=K,yt,St,Ut=Jlt;for(;ct--;)yt=$[ct],St=Ut.get(yt),St===void 0&&Ut.set(yt,St=ct?new Map:Xlt(t)),Ut=St;return St};l$();const FE={http:mlt,xhr:Wlt,fetch:{get:l$}};yo.forEach(FE,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const GB=e=>`- ${e}`,Qlt=e=>yo.isFunction(e)||e===null||e===!1;function tct(e,t){e=yo.isArray(e)?e:[e];const{length:r}=e;let u,T;const $={};for(let K=0;K`adapter ${yt} `+(St===!1?"is not supported by the environment":"is not available in the build"));let ct=r?K.length>1?`since : `+K.map(GB).join(` -`):" "+GB(K[0]):"as no adapter specified";throw new cu("There is no suitable adapter to dispatch the request "+ct,"ERR_NOT_SUPPORT")}return T}const c$={getAdapter:tct,adapters:FE};function z7(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new K2(null,e)}function ZB(e){return z7(e),e.headers=Sm.from(e.headers),e.data=D7.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),c$.getAdapter(e.adapter||s4.adapter,e)(e).then(function(u){return z7(e),u.data=D7.call(e,e.transformResponse,u),u.headers=Sm.from(u.headers),u},function(u){return i$(u)||(z7(e),u&&u.response&&(u.response.data=D7.call(e,e.transformResponse,u.response),u.response.headers=Sm.from(u.response.headers))),Promise.reject(u)})}const u$="1.13.2",$S={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$S[e]=function(u){return typeof u===e||"a"+(t<1?"n ":" ")+e}});const KB={};$S.transitional=function(t,r,u){function T($,K){return"[Axios v"+u$+"] Transitional option '"+$+"'"+K+(u?". "+u:"")}return($,K,ct)=>{if(t===!1)throw new cu(T(K," has been removed"+(r?" in "+r:"")),cu.ERR_DEPRECATED);return r&&!KB[K]&&(KB[K]=!0,console.warn(T(K," has been deprecated since v"+r+" and will be removed in the near future"))),t?t($,K,ct):!0}};$S.spelling=function(t){return(r,u)=>(console.warn(`${u} is likely a misspelling of ${t}`),!0)};function ect(e,t,r){if(typeof e!="object")throw new cu("options must be an object",cu.ERR_BAD_OPTION_VALUE);const u=Object.keys(e);let T=u.length;for(;T-- >0;){const $=u[T],K=t[$];if(K){const ct=e[$],yt=ct===void 0||K(ct,$,e);if(yt!==!0)throw new cu("option "+$+" must be "+yt,cu.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new cu("Unknown option "+$,cu.ERR_BAD_OPTION)}}const kT={assertOptions:ect,validators:$S},dv=kT.validators;let Dx=class{constructor(t){this.defaults=t||{},this.interceptors={request:new RB,response:new RB}}async request(t,r){try{return await this._request(t,r)}catch(u){if(u instanceof Error){let T={};Error.captureStackTrace?Error.captureStackTrace(T):T=new Error;const $=T.stack?T.stack.replace(/^.+\n/,""):"";try{u.stack?$&&!String(u.stack).endsWith($.replace(/^.+\n.+\n/,""))&&(u.stack+=` -`+$):u.stack=$}catch{}}throw u}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=jx(this.defaults,r);const{transitional:u,paramsSerializer:T,headers:$}=r;u!==void 0&&kT.assertOptions(u,{silentJSONParsing:dv.transitional(dv.boolean),forcedJSONParsing:dv.transitional(dv.boolean),clarifyTimeoutError:dv.transitional(dv.boolean)},!1),T!=null&&(yo.isFunction(T)?r.paramsSerializer={serialize:T}:kT.assertOptions(T,{encode:dv.function,serialize:dv.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),kT.assertOptions(r,{baseUrl:dv.spelling("baseURL"),withXsrfToken:dv.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let K=$&&yo.merge($.common,$[r.method]);$&&yo.forEach(["delete","get","head","post","put","patch","common"],we=>{delete $[we]}),r.headers=Sm.concat(K,$);const ct=[];let yt=!0;this.interceptors.request.forEach(function(Ce){typeof Ce.runWhen=="function"&&Ce.runWhen(r)===!1||(yt=yt&&Ce.synchronous,ct.unshift(Ce.fulfilled,Ce.rejected))});const St=[];this.interceptors.response.forEach(function(Ce){St.push(Ce.fulfilled,Ce.rejected)});let Ut,ne=0,pe;if(!yt){const we=[ZB.bind(this),void 0];for(we.unshift(...ct),we.push(...St),pe=we.length,Ut=Promise.resolve(r);ne{if(!u._listeners)return;let $=u._listeners.length;for(;$-- >0;)u._listeners[$](T);u._listeners=null}),this.promise.then=T=>{let $;const K=new Promise(ct=>{u.subscribe(ct),$=ct}).then(T);return K.cancel=function(){u.unsubscribe($)},K},t(function($,K,ct){u.reason||(u.reason=new K2($,K,ct),r(u.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=u=>{t.abort(u)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new h$(function(T){t=T}),cancel:t}}};function nct(e){return function(r){return e.apply(null,r)}}function ict(e){return yo.isObject(e)&&e.isAxiosError===!0}const n9={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(n9).forEach(([e,t])=>{n9[t]=e});function d$(e){const t=new Dx(e),r=HU(Dx.prototype.request,t);return yo.extend(r,Dx.prototype,t,{allOwnKeys:!0}),yo.extend(r,t,null,{allOwnKeys:!0}),r.create=function(T){return d$(jx(e,T))},r}const cf=d$(s4);cf.Axios=Dx;cf.CanceledError=K2;cf.CancelToken=rct;cf.isCancel=i$;cf.VERSION=u$;cf.toFormData=US;cf.AxiosError=cu;cf.Cancel=cf.CanceledError;cf.all=function(t){return Promise.all(t)};cf.spread=nct;cf.isAxiosError=ict;cf.mergeConfig=jx;cf.AxiosHeaders=Sm;cf.formToJSON=e=>n$(yo.isHTMLForm(e)?new FormData(e):e);cf.getAdapter=c$.getAdapter;cf.HttpStatusCode=n9;cf.default=cf;const{Axios:fRt,AxiosError:pRt,CanceledError:mRt,isCancel:gRt,CancelToken:vRt,VERSION:yRt,all:_Rt,Cancel:xRt,isAxiosError:bRt,spread:wRt,toFormData:kRt,AxiosHeaders:TRt,HttpStatusCode:SRt,formToJSON:CRt,getAdapter:ARt,mergeConfig:MRt}=cf,NE="pymc_jwt_token",YB="pymc_client_id";function f$(){let e=localStorage.getItem(YB);return e||(e=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(YB,e)),e}function Wx(){return localStorage.getItem(NE)}function i9(e){localStorage.setItem(NE,e)}function Y2(){localStorage.removeItem(NE)}function p$(){return Wx()!==null}function jE(e){try{const r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),u=decodeURIComponent(atob(r).split("").map(T=>"%"+("00"+T.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(u)}catch{return null}}function m$(){const e=Wx();if(!e)return!0;const t=jE(e);return!t||!t.exp?!0:Date.now()>=t.exp*1e3-3e4}function g$(){const e=Wx();if(!e)return!1;const t=jE(e);if(!t||!t.exp)return!1;const r=t.exp*1e3-Date.now();return r>0&&r<3e5}function act(){const e=Wx();if(!e)return null;const t=jE(e);return!t||!t.sub?null:t.sub}/*! +`):" "+GB(K[0]):"as no adapter specified";throw new cu("There is no suitable adapter to dispatch the request "+ct,"ERR_NOT_SUPPORT")}return T}const c$={getAdapter:tct,adapters:FE};function z7(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new K2(null,e)}function ZB(e){return z7(e),e.headers=Sm.from(e.headers),e.data=D7.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),c$.getAdapter(e.adapter||s4.adapter,e)(e).then(function(u){return z7(e),u.data=D7.call(e,e.transformResponse,u),u.headers=Sm.from(u.headers),u},function(u){return i$(u)||(z7(e),u&&u.response&&(u.response.data=D7.call(e,e.transformResponse,u.response),u.response.headers=Sm.from(u.response.headers))),Promise.reject(u)})}const u$="1.13.2",$S={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$S[e]=function(u){return typeof u===e||"a"+(t<1?"n ":" ")+e}});const KB={};$S.transitional=function(t,r,u){function T($,K){return"[Axios v"+u$+"] Transitional option '"+$+"'"+K+(u?". "+u:"")}return($,K,ct)=>{if(t===!1)throw new cu(T(K," has been removed"+(r?" in "+r:"")),cu.ERR_DEPRECATED);return r&&!KB[K]&&(KB[K]=!0,console.warn(T(K," has been deprecated since v"+r+" and will be removed in the near future"))),t?t($,K,ct):!0}};$S.spelling=function(t){return(r,u)=>(console.warn(`${u} is likely a misspelling of ${t}`),!0)};function ect(e,t,r){if(typeof e!="object")throw new cu("options must be an object",cu.ERR_BAD_OPTION_VALUE);const u=Object.keys(e);let T=u.length;for(;T-- >0;){const $=u[T],K=t[$];if(K){const ct=e[$],yt=ct===void 0||K(ct,$,e);if(yt!==!0)throw new cu("option "+$+" must be "+yt,cu.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new cu("Unknown option "+$,cu.ERR_BAD_OPTION)}}const kT={assertOptions:ect,validators:$S},dv=kT.validators;let zx=class{constructor(t){this.defaults=t||{},this.interceptors={request:new RB,response:new RB}}async request(t,r){try{return await this._request(t,r)}catch(u){if(u instanceof Error){let T={};Error.captureStackTrace?Error.captureStackTrace(T):T=new Error;const $=T.stack?T.stack.replace(/^.+\n/,""):"";try{u.stack?$&&!String(u.stack).endsWith($.replace(/^.+\n.+\n/,""))&&(u.stack+=` +`+$):u.stack=$}catch{}}throw u}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ux(this.defaults,r);const{transitional:u,paramsSerializer:T,headers:$}=r;u!==void 0&&kT.assertOptions(u,{silentJSONParsing:dv.transitional(dv.boolean),forcedJSONParsing:dv.transitional(dv.boolean),clarifyTimeoutError:dv.transitional(dv.boolean)},!1),T!=null&&(yo.isFunction(T)?r.paramsSerializer={serialize:T}:kT.assertOptions(T,{encode:dv.function,serialize:dv.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),kT.assertOptions(r,{baseUrl:dv.spelling("baseURL"),withXsrfToken:dv.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let K=$&&yo.merge($.common,$[r.method]);$&&yo.forEach(["delete","get","head","post","put","patch","common"],we=>{delete $[we]}),r.headers=Sm.concat(K,$);const ct=[];let yt=!0;this.interceptors.request.forEach(function(Ce){typeof Ce.runWhen=="function"&&Ce.runWhen(r)===!1||(yt=yt&&Ce.synchronous,ct.unshift(Ce.fulfilled,Ce.rejected))});const St=[];this.interceptors.response.forEach(function(Ce){St.push(Ce.fulfilled,Ce.rejected)});let Ut,ne=0,pe;if(!yt){const we=[ZB.bind(this),void 0];for(we.unshift(...ct),we.push(...St),pe=we.length,Ut=Promise.resolve(r);ne{if(!u._listeners)return;let $=u._listeners.length;for(;$-- >0;)u._listeners[$](T);u._listeners=null}),this.promise.then=T=>{let $;const K=new Promise(ct=>{u.subscribe(ct),$=ct}).then(T);return K.cancel=function(){u.unsubscribe($)},K},t(function($,K,ct){u.reason||(u.reason=new K2($,K,ct),r(u.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=u=>{t.abort(u)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new h$(function(T){t=T}),cancel:t}}};function nct(e){return function(r){return e.apply(null,r)}}function ict(e){return yo.isObject(e)&&e.isAxiosError===!0}const n9={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(n9).forEach(([e,t])=>{n9[t]=e});function d$(e){const t=new zx(e),r=HU(zx.prototype.request,t);return yo.extend(r,zx.prototype,t,{allOwnKeys:!0}),yo.extend(r,t,null,{allOwnKeys:!0}),r.create=function(T){return d$(Ux(e,T))},r}const cf=d$(s4);cf.Axios=zx;cf.CanceledError=K2;cf.CancelToken=rct;cf.isCancel=i$;cf.VERSION=u$;cf.toFormData=US;cf.AxiosError=cu;cf.Cancel=cf.CanceledError;cf.all=function(t){return Promise.all(t)};cf.spread=nct;cf.isAxiosError=ict;cf.mergeConfig=Ux;cf.AxiosHeaders=Sm;cf.formToJSON=e=>n$(yo.isHTMLForm(e)?new FormData(e):e);cf.getAdapter=c$.getAdapter;cf.HttpStatusCode=n9;cf.default=cf;const{Axios:pRt,AxiosError:mRt,CanceledError:gRt,isCancel:vRt,CancelToken:yRt,VERSION:_Rt,all:xRt,Cancel:bRt,isAxiosError:wRt,spread:kRt,toFormData:TRt,AxiosHeaders:SRt,HttpStatusCode:CRt,formToJSON:ARt,getAdapter:MRt,mergeConfig:ERt}=cf,NE="pymc_jwt_token",YB="pymc_client_id";function f$(){let e=localStorage.getItem(YB);return e||(e=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(YB,e)),e}function qx(){return localStorage.getItem(NE)}function i9(e){localStorage.setItem(NE,e)}function Y2(){localStorage.removeItem(NE)}function p$(){return qx()!==null}function jE(e){try{const r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),u=decodeURIComponent(atob(r).split("").map(T=>"%"+("00"+T.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(u)}catch{return null}}function m$(){const e=qx();if(!e)return!0;const t=jE(e);return!t||!t.exp?!0:Date.now()>=t.exp*1e3-3e4}function g$(){const e=qx();if(!e)return!1;const t=jE(e);if(!t||!t.exp)return!1;const r=t.exp*1e3-Date.now();return r>0&&r<3e5}function act(){const e=qx();if(!e)return null;const t=jE(e);return!t||!t.sub?null:t.sub}/*! * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme * (c) 2024 Jukka Kurkela * Released under the MIT License - */function l4(e){return e+.5|0}const l_=(e,t,r)=>Math.max(Math.min(e,r),t);function o5(e){return l_(l4(e*2.55),0,255)}function p_(e){return l_(l4(e*255),0,255)}function L1(e){return l_(l4(e/2.55)/100,0,1)}function XB(e){return l_(l4(e*100),0,100)}const lg={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},a9=[..."0123456789ABCDEF"],oct=e=>a9[e&15],sct=e=>a9[(e&240)>>4]+a9[e&15],F6=e=>(e&240)>>4===(e&15),lct=e=>F6(e.r)&&F6(e.g)&&F6(e.b)&&F6(e.a);function cct(e){var t=e.length,r;return e[0]==="#"&&(t===4||t===5?r={r:255&lg[e[1]]*17,g:255&lg[e[2]]*17,b:255&lg[e[3]]*17,a:t===5?lg[e[4]]*17:255}:(t===7||t===9)&&(r={r:lg[e[1]]<<4|lg[e[2]],g:lg[e[3]]<<4|lg[e[4]],b:lg[e[5]]<<4|lg[e[6]],a:t===9?lg[e[7]]<<4|lg[e[8]]:255})),r}const uct=(e,t)=>e<255?t(e):"";function hct(e){var t=lct(e)?oct:sct;return e?"#"+t(e.r)+t(e.g)+t(e.b)+uct(e.a,t):void 0}const dct=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function v$(e,t,r){const u=t*Math.min(r,1-r),T=($,K=($+e/30)%12)=>r-u*Math.max(Math.min(K-3,9-K,1),-1);return[T(0),T(8),T(4)]}function fct(e,t,r){const u=(T,$=(T+e/60)%6)=>r-r*t*Math.max(Math.min($,4-$,1),0);return[u(5),u(3),u(1)]}function pct(e,t,r){const u=v$(e,1,.5);let T;for(t+r>1&&(T=1/(t+r),t*=T,r*=T),T=0;T<3;T++)u[T]*=1-t-r,u[T]+=t;return u}function mct(e,t,r,u,T){return e===T?(t-r)/u+(t.5?Ut/(2-$-K):Ut/($+K),yt=mct(r,u,T,Ut,$),yt=yt*60+.5),[yt|0,St||0,ct]}function $E(e,t,r,u){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,r,u)).map(p_)}function HE(e,t,r){return $E(v$,e,t,r)}function gct(e,t,r){return $E(pct,e,t,r)}function vct(e,t,r){return $E(fct,e,t,r)}function y$(e){return(e%360+360)%360}function yct(e){const t=dct.exec(e);let r=255,u;if(!t)return;t[5]!==u&&(r=t[6]?o5(+t[5]):p_(+t[5]));const T=y$(+t[2]),$=+t[3]/100,K=+t[4]/100;return t[1]==="hwb"?u=gct(T,$,K):t[1]==="hsv"?u=vct(T,$,K):u=HE(T,$,K),{r:u[0],g:u[1],b:u[2],a:r}}function _ct(e,t){var r=UE(e);r[0]=y$(r[0]+t),r=HE(r),e.r=r[0],e.g=r[1],e.b=r[2]}function xct(e){if(!e)return;const t=UE(e),r=t[0],u=XB(t[1]),T=XB(t[2]);return e.a<255?`hsla(${r}, ${u}%, ${T}%, ${L1(e.a)})`:`hsl(${r}, ${u}%, ${T}%)`}const JB={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},QB={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function bct(){const e={},t=Object.keys(QB),r=Object.keys(JB);let u,T,$,K,ct;for(u=0;u>16&255,$>>8&255,$&255]}return e}let N6;function wct(e){N6||(N6=bct(),N6.transparent=[0,0,0,0]);const t=N6[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const kct=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Tct(e){const t=kct.exec(e);let r=255,u,T,$;if(t){if(t[7]!==u){const K=+t[7];r=t[8]?o5(K):l_(K*255,0,255)}return u=+t[1],T=+t[3],$=+t[5],u=255&(t[2]?o5(u):l_(u,0,255)),T=255&(t[4]?o5(T):l_(T,0,255)),$=255&(t[6]?o5($):l_($,0,255)),{r:u,g:T,b:$,a:r}}}function Sct(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${L1(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const O7=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,m2=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Cct(e,t,r){const u=m2(L1(e.r)),T=m2(L1(e.g)),$=m2(L1(e.b));return{r:p_(O7(u+r*(m2(L1(t.r))-u))),g:p_(O7(T+r*(m2(L1(t.g))-T))),b:p_(O7($+r*(m2(L1(t.b))-$))),a:e.a+r*(t.a-e.a)}}function j6(e,t,r){if(e){let u=UE(e);u[t]=Math.max(0,Math.min(u[t]+u[t]*r,t===0?360:1)),u=HE(u),e.r=u[0],e.g=u[1],e.b=u[2]}}function _$(e,t){return e&&Object.assign(t||{},e)}function tR(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=p_(e[3]))):(t=_$(e,{r:0,g:0,b:0,a:1}),t.a=p_(t.a)),t}function Act(e){return e.charAt(0)==="r"?Tct(e):yct(e)}class H5{constructor(t){if(t instanceof H5)return t;const r=typeof t;let u;r==="object"?u=tR(t):r==="string"&&(u=cct(t)||wct(t)||Act(t)),this._rgb=u,this._valid=!!u}get valid(){return this._valid}get rgb(){var t=_$(this._rgb);return t&&(t.a=L1(t.a)),t}set rgb(t){this._rgb=tR(t)}rgbString(){return this._valid?Sct(this._rgb):void 0}hexString(){return this._valid?hct(this._rgb):void 0}hslString(){return this._valid?xct(this._rgb):void 0}mix(t,r){if(t){const u=this.rgb,T=t.rgb;let $;const K=r===$?.5:r,ct=2*K-1,yt=u.a-T.a,St=((ct*yt===-1?ct:(ct+yt)/(1+ct*yt))+1)/2;$=1-St,u.r=255&St*u.r+$*T.r+.5,u.g=255&St*u.g+$*T.g+.5,u.b=255&St*u.b+$*T.b+.5,u.a=K*u.a+(1-K)*T.a,this.rgb=u}return this}interpolate(t,r){return t&&(this._rgb=Cct(this._rgb,t._rgb,r)),this}clone(){return new H5(this.rgb)}alpha(t){return this._rgb.a=p_(t),this}clearer(t){const r=this._rgb;return r.a*=1-t,this}greyscale(){const t=this._rgb,r=l4(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=r,this}opaquer(t){const r=this._rgb;return r.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return j6(this._rgb,2,t),this}darken(t){return j6(this._rgb,2,-t),this}saturate(t){return j6(this._rgb,1,t),this}desaturate(t){return j6(this._rgb,1,-t),this}rotate(t){return _ct(this._rgb,t),this}}/*! + */function l4(e){return e+.5|0}const l_=(e,t,r)=>Math.max(Math.min(e,r),t);function o5(e){return l_(l4(e*2.55),0,255)}function p_(e){return l_(l4(e*255),0,255)}function L1(e){return l_(l4(e/2.55)/100,0,1)}function XB(e){return l_(l4(e*100),0,100)}const lg={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},a9=[..."0123456789ABCDEF"],oct=e=>a9[e&15],sct=e=>a9[(e&240)>>4]+a9[e&15],F6=e=>(e&240)>>4===(e&15),lct=e=>F6(e.r)&&F6(e.g)&&F6(e.b)&&F6(e.a);function cct(e){var t=e.length,r;return e[0]==="#"&&(t===4||t===5?r={r:255&lg[e[1]]*17,g:255&lg[e[2]]*17,b:255&lg[e[3]]*17,a:t===5?lg[e[4]]*17:255}:(t===7||t===9)&&(r={r:lg[e[1]]<<4|lg[e[2]],g:lg[e[3]]<<4|lg[e[4]],b:lg[e[5]]<<4|lg[e[6]],a:t===9?lg[e[7]]<<4|lg[e[8]]:255})),r}const uct=(e,t)=>e<255?t(e):"";function hct(e){var t=lct(e)?oct:sct;return e?"#"+t(e.r)+t(e.g)+t(e.b)+uct(e.a,t):void 0}const dct=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function v$(e,t,r){const u=t*Math.min(r,1-r),T=($,K=($+e/30)%12)=>r-u*Math.max(Math.min(K-3,9-K,1),-1);return[T(0),T(8),T(4)]}function fct(e,t,r){const u=(T,$=(T+e/60)%6)=>r-r*t*Math.max(Math.min($,4-$,1),0);return[u(5),u(3),u(1)]}function pct(e,t,r){const u=v$(e,1,.5);let T;for(t+r>1&&(T=1/(t+r),t*=T,r*=T),T=0;T<3;T++)u[T]*=1-t-r,u[T]+=t;return u}function mct(e,t,r,u,T){return e===T?(t-r)/u+(t.5?Ut/(2-$-K):Ut/($+K),yt=mct(r,u,T,Ut,$),yt=yt*60+.5),[yt|0,St||0,ct]}function $E(e,t,r,u){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,r,u)).map(p_)}function HE(e,t,r){return $E(v$,e,t,r)}function gct(e,t,r){return $E(pct,e,t,r)}function vct(e,t,r){return $E(fct,e,t,r)}function y$(e){return(e%360+360)%360}function yct(e){const t=dct.exec(e);let r=255,u;if(!t)return;t[5]!==u&&(r=t[6]?o5(+t[5]):p_(+t[5]));const T=y$(+t[2]),$=+t[3]/100,K=+t[4]/100;return t[1]==="hwb"?u=gct(T,$,K):t[1]==="hsv"?u=vct(T,$,K):u=HE(T,$,K),{r:u[0],g:u[1],b:u[2],a:r}}function _ct(e,t){var r=UE(e);r[0]=y$(r[0]+t),r=HE(r),e.r=r[0],e.g=r[1],e.b=r[2]}function xct(e){if(!e)return;const t=UE(e),r=t[0],u=XB(t[1]),T=XB(t[2]);return e.a<255?`hsla(${r}, ${u}%, ${T}%, ${L1(e.a)})`:`hsl(${r}, ${u}%, ${T}%)`}const JB={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},QB={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function bct(){const e={},t=Object.keys(QB),r=Object.keys(JB);let u,T,$,K,ct;for(u=0;u>16&255,$>>8&255,$&255]}return e}let N6;function wct(e){N6||(N6=bct(),N6.transparent=[0,0,0,0]);const t=N6[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const kct=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Tct(e){const t=kct.exec(e);let r=255,u,T,$;if(t){if(t[7]!==u){const K=+t[7];r=t[8]?o5(K):l_(K*255,0,255)}return u=+t[1],T=+t[3],$=+t[5],u=255&(t[2]?o5(u):l_(u,0,255)),T=255&(t[4]?o5(T):l_(T,0,255)),$=255&(t[6]?o5($):l_($,0,255)),{r:u,g:T,b:$,a:r}}}function Sct(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${L1(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const O7=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,g2=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Cct(e,t,r){const u=g2(L1(e.r)),T=g2(L1(e.g)),$=g2(L1(e.b));return{r:p_(O7(u+r*(g2(L1(t.r))-u))),g:p_(O7(T+r*(g2(L1(t.g))-T))),b:p_(O7($+r*(g2(L1(t.b))-$))),a:e.a+r*(t.a-e.a)}}function j6(e,t,r){if(e){let u=UE(e);u[t]=Math.max(0,Math.min(u[t]+u[t]*r,t===0?360:1)),u=HE(u),e.r=u[0],e.g=u[1],e.b=u[2]}}function _$(e,t){return e&&Object.assign(t||{},e)}function tR(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=p_(e[3]))):(t=_$(e,{r:0,g:0,b:0,a:1}),t.a=p_(t.a)),t}function Act(e){return e.charAt(0)==="r"?Tct(e):yct(e)}class H5{constructor(t){if(t instanceof H5)return t;const r=typeof t;let u;r==="object"?u=tR(t):r==="string"&&(u=cct(t)||wct(t)||Act(t)),this._rgb=u,this._valid=!!u}get valid(){return this._valid}get rgb(){var t=_$(this._rgb);return t&&(t.a=L1(t.a)),t}set rgb(t){this._rgb=tR(t)}rgbString(){return this._valid?Sct(this._rgb):void 0}hexString(){return this._valid?hct(this._rgb):void 0}hslString(){return this._valid?xct(this._rgb):void 0}mix(t,r){if(t){const u=this.rgb,T=t.rgb;let $;const K=r===$?.5:r,ct=2*K-1,yt=u.a-T.a,St=((ct*yt===-1?ct:(ct+yt)/(1+ct*yt))+1)/2;$=1-St,u.r=255&St*u.r+$*T.r+.5,u.g=255&St*u.g+$*T.g+.5,u.b=255&St*u.b+$*T.b+.5,u.a=K*u.a+(1-K)*T.a,this.rgb=u}return this}interpolate(t,r){return t&&(this._rgb=Cct(this._rgb,t._rgb,r)),this}clone(){return new H5(this.rgb)}alpha(t){return this._rgb.a=p_(t),this}clearer(t){const r=this._rgb;return r.a*=1-t,this}greyscale(){const t=this._rgb,r=l4(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=r,this}opaquer(t){const r=this._rgb;return r.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return j6(this._rgb,2,t),this}darken(t){return j6(this._rgb,2,-t),this}saturate(t){return j6(this._rgb,1,t),this}desaturate(t){return j6(this._rgb,1,-t),this}rotate(t){return _ct(this._rgb,t),this}}/*! * Chart.js v4.5.1 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License - */function v1(){}const Mct=(()=>{let e=0;return()=>e++})();function Rh(e){return e==null}function Tp(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Uu(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function $0(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function fv(e,t){return $0(e)?e:t}function _u(e,t){return typeof e>"u"?t:e}const Ect=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,x$=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Kd(e,t,r){if(e&&typeof e.call=="function")return e.apply(r,t)}function cd(e,t,r,u){let T,$,K;if(Tp(e))for($=e.length,T=0;T<$;T++)t.call(r,e[T],T);else if(Uu(e))for(K=Object.keys(e),$=K.length,T=0;T<$;T++)t.call(r,e[K[T]],K[T])}function XT(e,t){let r,u,T,$;if(!e||!t||e.length!==t.length)return!1;for(r=0,u=e.length;re,x:e=>e.x,y:e=>e.y};function Ict(e){const t=e.split("."),r=[];let u="";for(const T of t)u+=T,u.endsWith("\\")?u=u.slice(0,-1)+".":(r.push(u),u="");return r}function Dct(e){const t=Ict(e);return r=>{for(const u of t){if(u==="")break;r=r&&r[u]}return r}}function Ux(e,t){return(eR[t]||(eR[t]=Dct(t)))(e)}function VE(e){return e.charAt(0).toUpperCase()+e.slice(1)}const W5=e=>typeof e<"u",__=e=>typeof e=="function",rR=(e,t)=>{if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0};function zct(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ud=Math.PI,Cf=2*ud,Oct=Cf+ud,QT=Number.POSITIVE_INFINITY,Bct=ud/180,Bp=ud/2,ux=ud/4,nR=ud*2/3,w$=Math.log10,Lv=Math.sign;function A5(e,t,r){return Math.abs(e-t)T-$).pop(),t}function Fct(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function H2(e){return!Fct(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Nct(e,t){const r=Math.round(e);return r-t<=e&&r+t>=e}function jct(e,t,r){let u,T,$;for(u=0,T=e.length;uyt&&St=Math.min(t,r)-u&&e<=Math.max(t,r)+u}function WE(e,t,r){r=r||(K=>e[K]1;)$=T+u>>1,r($)?T=$:u=$;return{lo:T,hi:u}}const Mx=(e,t,r,u)=>WE(e,r,u?T=>{const $=e[T][t];return $e[T][t]WE(e,r,u=>e[u][t]>=r);function Wct(e,t,r){let u=0,T=e.length;for(;uu&&e[T-1]>r;)T--;return u>0||T{const u="_onData"+VE(r),T=e[r];Object.defineProperty(e,r,{configurable:!0,enumerable:!1,value(...$){const K=T.apply(this,$);return e._chartjs.listeners.forEach(ct=>{typeof ct[u]=="function"&&ct[u](...$)}),K}})})}function oR(e,t){const r=e._chartjs;if(!r)return;const u=r.listeners,T=u.indexOf(t);T!==-1&&u.splice(T,1),!(u.length>0)&&(T$.forEach($=>{delete e[$]}),delete e._chartjs)}function S$(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const C$=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function A$(e,t){let r=[],u=!1;return function(...T){r=T,u||(u=!0,C$.call(window,()=>{u=!1,e.apply(t,r)}))}}function Gct(e,t){let r;return function(...u){return t?(clearTimeout(r),r=setTimeout(e,t,u)):e.apply(this,u),t}}const qE=e=>e==="start"?"left":e==="end"?"right":"center",z0=(e,t,r)=>e==="start"?t:e==="end"?r:(t+r)/2,Zct=(e,t,r,u)=>e===(u?"left":"right")?r:e==="center"?(t+r)/2:t;function M$(e,t,r){const u=t.length;let T=0,$=u;if(e._sorted){const{iScale:K,vScale:ct,_parsed:yt}=e,St=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,Ut=K.axis,{min:ne,max:pe,minDefined:me,maxDefined:we}=K.getUserBounds();if(me){if(T=Math.min(Mx(yt,Ut,ne).lo,r?u:Mx(t,Ut,K.getPixelForValue(ne)).lo),St){const Ce=yt.slice(0,T+1).reverse().findIndex(Ve=>!Rh(Ve[ct.axis]));T-=Math.max(0,Ce)}T=j0(T,0,u-1)}if(we){let Ce=Math.max(Mx(yt,K.axis,pe,!0).hi+1,r?0:Mx(t,Ut,K.getPixelForValue(pe),!0).hi+1);if(St){const Ve=yt.slice(Ce-1).findIndex(kr=>!Rh(kr[ct.axis]));Ce+=Math.max(0,Ve)}$=j0(Ce,T,u)-T}else $=u-T}return{start:T,count:$}}function E$(e){const{xScale:t,yScale:r,_scaleRanges:u}=e,T={xmin:t.min,xmax:t.max,ymin:r.min,ymax:r.max};if(!u)return e._scaleRanges=T,!0;const $=u.xmin!==t.min||u.xmax!==t.max||u.ymin!==r.min||u.ymax!==r.max;return Object.assign(u,T),$}const U6=e=>e===0||e===1,sR=(e,t,r)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Cf/r)),lR=(e,t,r)=>Math.pow(2,-10*e)*Math.sin((e-t)*Cf/r)+1,M5={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Bp)+1,easeOutSine:e=>Math.sin(e*Bp),easeInOutSine:e=>-.5*(Math.cos(ud*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>U6(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>U6(e)?e:sR(e,.075,.3),easeOutElastic:e=>U6(e)?e:lR(e,.075,.3),easeInOutElastic(e){return U6(e)?e:e<.5?.5*sR(e*2,.1125,.45):.5+.5*lR(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-M5.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?M5.easeInBounce(e*2)*.5:M5.easeOutBounce(e*2-1)*.5+.5};function GE(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function cR(e){return GE(e)?e:new H5(e)}function B7(e){return GE(e)?e:new H5(e).saturate(.5).darken(.1).hexString()}const Kct=["x","y","borderWidth","radius","tension"],Yct=["color","borderColor","backgroundColor"];function Xct(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Yct},numbers:{type:"number",properties:Kct}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Jct(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const uR=new Map;function Qct(e,t){t=t||{};const r=e+JSON.stringify(t);let u=uR.get(r);return u||(u=new Intl.NumberFormat(e,t),uR.set(r,u)),u}function ZE(e,t,r){return Qct(t,r).format(e)}const tut={values(e){return Tp(e)?e:""+e},numeric(e,t,r){if(e===0)return"0";const u=this.chart.options.locale;let T,$=e;if(r.length>1){const St=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(St<1e-4||St>1e15)&&(T="scientific"),$=eut(e,r)}const K=w$(Math.abs($)),ct=isNaN(K)?1:Math.max(Math.min(-1*Math.floor(K),20),0),yt={notation:T,minimumFractionDigits:ct,maximumFractionDigits:ct};return Object.assign(yt,this.options.ticks.format),ZE(e,u,yt)}};function eut(e,t){let r=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(r)>=1&&e!==Math.floor(e)&&(r=e-Math.floor(e)),r}var L$={formatters:tut};function rut(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,r)=>r.lineWidth,tickColor:(t,r)=>r.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:L$.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const $x=Object.create(null),s9=Object.create(null);function E5(e,t){if(!t)return e;const r=t.split(".");for(let u=0,T=r.length;uu.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(u,T)=>B7(T.backgroundColor),this.hoverBorderColor=(u,T)=>B7(T.borderColor),this.hoverColor=(u,T)=>B7(T.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(r)}set(t,r){return R7(this,t,r)}get(t){return E5(this,t)}describe(t,r){return R7(s9,t,r)}override(t,r){return R7($x,t,r)}route(t,r,u,T){const $=E5(this,t),K=E5(this,u),ct="_"+r;Object.defineProperties($,{[ct]:{value:$[r],writable:!0},[r]:{enumerable:!0,get(){const yt=this[ct],St=K[T];return Uu(yt)?Object.assign({},St,yt):_u(yt,St)},set(yt){this[ct]=yt}}})}apply(t){t.forEach(r=>r(this))}}var lp=new nut({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xct,Jct,rut]);function iut(e){return!e||Rh(e.size)||Rh(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function hR(e,t,r,u,T){let $=t[T];return $||($=t[T]=e.measureText(T).width,r.push(T)),$>u&&(u=$),u}function hx(e,t,r){const u=e.currentDevicePixelRatio,T=r!==0?Math.max(r/2,.5):0;return Math.round((t-T)*u)/u+T}function dR(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function l9(e,t,r,u){P$(e,t,r,u,null)}function P$(e,t,r,u,T){let $,K,ct,yt,St,Ut,ne,pe;const me=t.pointStyle,we=t.rotation,Ce=t.radius;let Ve=(we||0)*Bct;if(me&&typeof me=="object"&&($=me.toString(),$==="[object HTMLImageElement]"||$==="[object HTMLCanvasElement]")){e.save(),e.translate(r,u),e.rotate(Ve),e.drawImage(me,-me.width/2,-me.height/2,me.width,me.height),e.restore();return}if(!(isNaN(Ce)||Ce<=0)){switch(e.beginPath(),me){default:T?e.ellipse(r,u,T/2,Ce,0,0,Cf):e.arc(r,u,Ce,0,Cf),e.closePath();break;case"triangle":Ut=T?T/2:Ce,e.moveTo(r+Math.sin(Ve)*Ut,u-Math.cos(Ve)*Ce),Ve+=nR,e.lineTo(r+Math.sin(Ve)*Ut,u-Math.cos(Ve)*Ce),Ve+=nR,e.lineTo(r+Math.sin(Ve)*Ut,u-Math.cos(Ve)*Ce),e.closePath();break;case"rectRounded":St=Ce*.516,yt=Ce-St,K=Math.cos(Ve+ux)*yt,ne=Math.cos(Ve+ux)*(T?T/2-St:yt),ct=Math.sin(Ve+ux)*yt,pe=Math.sin(Ve+ux)*(T?T/2-St:yt),e.arc(r-ne,u-ct,St,Ve-ud,Ve-Bp),e.arc(r+pe,u-K,St,Ve-Bp,Ve),e.arc(r+ne,u+ct,St,Ve,Ve+Bp),e.arc(r-pe,u+K,St,Ve+Bp,Ve+ud),e.closePath();break;case"rect":if(!we){yt=Math.SQRT1_2*Ce,Ut=T?T/2:yt,e.rect(r-Ut,u-yt,2*Ut,2*yt);break}Ve+=ux;case"rectRot":ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+pe,u-K),e.lineTo(r+ne,u+ct),e.lineTo(r-pe,u+K),e.closePath();break;case"crossRot":Ve+=ux;case"cross":ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+ne,u+ct),e.moveTo(r+pe,u-K),e.lineTo(r-pe,u+K);break;case"star":ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+ne,u+ct),e.moveTo(r+pe,u-K),e.lineTo(r-pe,u+K),Ve+=ux,ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+ne,u+ct),e.moveTo(r+pe,u-K),e.lineTo(r-pe,u+K);break;case"line":K=T?T/2:Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,e.moveTo(r-K,u-ct),e.lineTo(r+K,u+ct);break;case"dash":e.moveTo(r,u),e.lineTo(r+Math.cos(Ve)*(T?T/2:Ce),u+Math.sin(Ve)*Ce);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function G5(e,t,r){return r=r||.5,!t||e&&e.x>t.left-r&&e.xt.top-r&&e.y0&&$.strokeColor!=="";let yt,St;for(e.save(),e.font=T.string,sut(e,$),yt=0;yt+e||0;function KE(e,t){const r={},u=Uu(t),T=u?Object.keys(t):t,$=Uu(e)?u?K=>_u(e[K],e[t[K]]):K=>e[K]:()=>e;for(const K of T)r[K]=fut($(K));return r}function I$(e){return KE(e,{top:"y",right:"x",bottom:"y",left:"x"})}function D2(e){return KE(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kg(e){const t=I$(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function U0(e,t){e=e||{},t=t||lp.font;let r=_u(e.size,t.size);typeof r=="string"&&(r=parseInt(r,10));let u=_u(e.style,t.style);u&&!(""+u).match(hut)&&(console.warn('Invalid font style specified: "'+u+'"'),u=void 0);const T={family:_u(e.family,t.family),lineHeight:dut(_u(e.lineHeight,t.lineHeight),r),size:r,style:u,weight:_u(e.weight,t.weight),string:""};return T.string=iut(T),T}function $6(e,t,r,u){let T,$,K;for(T=0,$=e.length;T<$;++T)if(K=e[T],K!==void 0&&K!==void 0)return K}function put(e,t,r){const{min:u,max:T}=e,$=x$(t,(T-u)/2),K=(ct,yt)=>r&&ct===0?0:ct+yt;return{min:K(u,-Math.abs($)),max:K(T,$)}}function qx(e,t){return Object.assign(Object.create(e),t)}function YE(e,t=[""],r,u,T=()=>e[0]){const $=r||e;typeof u>"u"&&(u=B$("_fallback",e));const K={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:$,_fallback:u,_getTarget:T,override:ct=>YE([ct,...e],t,$,u)};return new Proxy(K,{deleteProperty(ct,yt){return delete ct[yt],delete ct._keys,delete e[0][yt],!0},get(ct,yt){return z$(ct,yt,()=>wut(yt,t,e,ct))},getOwnPropertyDescriptor(ct,yt){return Reflect.getOwnPropertyDescriptor(ct._scopes[0],yt)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(ct,yt){return pR(ct).includes(yt)},ownKeys(ct){return pR(ct)},set(ct,yt,St){const Ut=ct._storage||(ct._storage=T());return ct[yt]=Ut[yt]=St,delete ct._keys,!0}})}function V2(e,t,r,u){const T={_cacheable:!1,_proxy:e,_context:t,_subProxy:r,_stack:new Set,_descriptors:D$(e,u),setContext:$=>V2(e,$,r,u),override:$=>V2(e.override($),t,r,u)};return new Proxy(T,{deleteProperty($,K){return delete $[K],delete e[K],!0},get($,K,ct){return z$($,K,()=>gut($,K,ct))},getOwnPropertyDescriptor($,K){return $._descriptors.allKeys?Reflect.has(e,K)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,K)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has($,K){return Reflect.has(e,K)},ownKeys(){return Reflect.ownKeys(e)},set($,K,ct){return e[K]=ct,delete $[K],!0}})}function D$(e,t={scriptable:!0,indexable:!0}){const{_scriptable:r=t.scriptable,_indexable:u=t.indexable,_allKeys:T=t.allKeys}=e;return{allKeys:T,scriptable:r,indexable:u,isScriptable:__(r)?r:()=>r,isIndexable:__(u)?u:()=>u}}const mut=(e,t)=>e?e+VE(t):t,XE=(e,t)=>Uu(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function z$(e,t,r){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const u=r();return e[t]=u,u}function gut(e,t,r){const{_proxy:u,_context:T,_subProxy:$,_descriptors:K}=e;let ct=u[t];return __(ct)&&K.isScriptable(t)&&(ct=vut(t,ct,e,r)),Tp(ct)&&ct.length&&(ct=yut(t,ct,e,K.isIndexable)),XE(t,ct)&&(ct=V2(ct,T,$&&$[t],K)),ct}function vut(e,t,r,u){const{_proxy:T,_context:$,_subProxy:K,_stack:ct}=r;if(ct.has(e))throw new Error("Recursion detected: "+Array.from(ct).join("->")+"->"+e);ct.add(e);let yt=t($,K||u);return ct.delete(e),XE(e,yt)&&(yt=JE(T._scopes,T,e,yt)),yt}function yut(e,t,r,u){const{_proxy:T,_context:$,_subProxy:K,_descriptors:ct}=r;if(typeof $.index<"u"&&u(e))return t[$.index%t.length];if(Uu(t[0])){const yt=t,St=T._scopes.filter(Ut=>Ut!==yt);t=[];for(const Ut of yt){const ne=JE(St,T,e,Ut);t.push(V2(ne,$,K&&K[e],ct))}}return t}function O$(e,t,r){return __(e)?e(t,r):e}const _ut=(e,t)=>e===!0?t:typeof e=="string"?Ux(t,e):void 0;function xut(e,t,r,u,T){for(const $ of t){const K=_ut(r,$);if(K){e.add(K);const ct=O$(K._fallback,r,T);if(typeof ct<"u"&&ct!==r&&ct!==u)return ct}else if(K===!1&&typeof u<"u"&&r!==u)return null}return!1}function JE(e,t,r,u){const T=t._rootScopes,$=O$(t._fallback,r,u),K=[...e,...T],ct=new Set;ct.add(u);let yt=fR(ct,K,r,$||r,u);return yt===null||typeof $<"u"&&$!==r&&(yt=fR(ct,K,$,yt,u),yt===null)?!1:YE(Array.from(ct),[""],T,$,()=>but(t,r,u))}function fR(e,t,r,u,T){for(;r;)r=xut(e,t,r,u,T);return r}function but(e,t,r){const u=e._getTarget();t in u||(u[t]={});const T=u[t];return Tp(T)&&Uu(r)?r:T||{}}function wut(e,t,r,u){let T;for(const $ of t)if(T=B$(mut($,e),r),typeof T<"u")return XE(e,T)?JE(r,u,e,T):T}function B$(e,t){for(const r of t){if(!r)continue;const u=r[e];if(typeof u<"u")return u}}function pR(e){let t=e._keys;return t||(t=e._keys=kut(e._scopes)),t}function kut(e){const t=new Set;for(const r of e)for(const u of Object.keys(r).filter(T=>!T.startsWith("_")))t.add(u);return Array.from(t)}const Tut=Number.EPSILON||1e-14,W2=(e,t)=>te==="x"?"y":"x";function Sut(e,t,r,u){const T=e.skip?t:e,$=t,K=r.skip?t:r,ct=o9($,T),yt=o9(K,$);let St=ct/(ct+yt),Ut=yt/(ct+yt);St=isNaN(St)?0:St,Ut=isNaN(Ut)?0:Ut;const ne=u*St,pe=u*Ut;return{previous:{x:$.x-ne*(K.x-T.x),y:$.y-ne*(K.y-T.y)},next:{x:$.x+pe*(K.x-T.x),y:$.y+pe*(K.y-T.y)}}}function Cut(e,t,r){const u=e.length;let T,$,K,ct,yt,St=W2(e,0);for(let Ut=0;Ut!St.skip)),t.cubicInterpolationMode==="monotone")Mut(e,T);else{let St=u?e[e.length-1]:e[0];for($=0,K=e.length;$e.ownerDocument.defaultView.getComputedStyle(e,null);function Put(e,t){return WS(e).getPropertyValue(t)}const Iut=["top","right","bottom","left"];function zx(e,t,r){const u={};r=r?"-"+r:"";for(let T=0;T<4;T++){const $=Iut[T];u[$]=parseFloat(e[t+"-"+$+r])||0}return u.width=u.left+u.right,u.height=u.top+u.bottom,u}const Dut=(e,t,r)=>(e>0||t>0)&&(!r||!r.shadowRoot);function zut(e,t){const r=e.touches,u=r&&r.length?r[0]:e,{offsetX:T,offsetY:$}=u;let K=!1,ct,yt;if(Dut(T,$,e.target))ct=T,yt=$;else{const St=t.getBoundingClientRect();ct=u.clientX-St.left,yt=u.clientY-St.top,K=!0}return{x:ct,y:yt,box:K}}function yx(e,t){if("native"in e)return e;const{canvas:r,currentDevicePixelRatio:u}=t,T=WS(r),$=T.boxSizing==="border-box",K=zx(T,"padding"),ct=zx(T,"border","width"),{x:yt,y:St,box:Ut}=zut(e,r),ne=K.left+(Ut&&ct.left),pe=K.top+(Ut&&ct.top);let{width:me,height:we}=t;return $&&(me-=K.width+ct.width,we-=K.height+ct.height),{x:Math.round((yt-ne)/me*r.width/u),y:Math.round((St-pe)/we*r.height/u)}}function Out(e,t,r){let u,T;if(t===void 0||r===void 0){const $=e&&tL(e);if(!$)t=e.clientWidth,r=e.clientHeight;else{const K=$.getBoundingClientRect(),ct=WS($),yt=zx(ct,"border","width"),St=zx(ct,"padding");t=K.width-St.width-yt.width,r=K.height-St.height-yt.height,u=eS(ct.maxWidth,$,"clientWidth"),T=eS(ct.maxHeight,$,"clientHeight")}}return{width:t,height:r,maxWidth:u||QT,maxHeight:T||QT}}const c_=e=>Math.round(e*10)/10;function But(e,t,r,u){const T=WS(e),$=zx(T,"margin"),K=eS(T.maxWidth,e,"clientWidth")||QT,ct=eS(T.maxHeight,e,"clientHeight")||QT,yt=Out(e,t,r);let{width:St,height:Ut}=yt;if(T.boxSizing==="content-box"){const pe=zx(T,"border","width"),me=zx(T,"padding");St-=me.width+pe.width,Ut-=me.height+pe.height}return St=Math.max(0,St-$.width),Ut=Math.max(0,u?St/u:Ut-$.height),St=c_(Math.min(St,K,yt.maxWidth)),Ut=c_(Math.min(Ut,ct,yt.maxHeight)),St&&!Ut&&(Ut=c_(St/2)),(t!==void 0||r!==void 0)&&u&&yt.height&&Ut>yt.height&&(Ut=yt.height,St=c_(Math.floor(Ut*u))),{width:St,height:Ut}}function mR(e,t,r){const u=t||1,T=c_(e.height*u),$=c_(e.width*u);e.height=c_(e.height),e.width=c_(e.width);const K=e.canvas;return K.style&&(r||!K.style.height&&!K.style.width)&&(K.style.height=`${e.height}px`,K.style.width=`${e.width}px`),e.currentDevicePixelRatio!==u||K.height!==T||K.width!==$?(e.currentDevicePixelRatio=u,K.height=T,K.width=$,e.ctx.setTransform(u,0,0,u,0,0),!0):!1}const Rut=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};QE()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function gR(e,t){const r=Put(e,t),u=r&&r.match(/^(\d+)(\.\d+)?px$/);return u?+u[1]:void 0}function _x(e,t,r,u){return{x:e.x+r*(t.x-e.x),y:e.y+r*(t.y-e.y)}}function Fut(e,t,r,u){return{x:e.x+r*(t.x-e.x),y:u==="middle"?r<.5?e.y:t.y:u==="after"?r<1?e.y:t.y:r>0?t.y:e.y}}function Nut(e,t,r,u){const T={x:e.cp2x,y:e.cp2y},$={x:t.cp1x,y:t.cp1y},K=_x(e,T,r),ct=_x(T,$,r),yt=_x($,t,r),St=_x(K,ct,r),Ut=_x(ct,yt,r);return _x(St,Ut,r)}const jut=function(e,t){return{x(r){return e+e+t-r},setWidth(r){t=r},textAlign(r){return r==="center"?r:r==="right"?"left":"right"},xPlus(r,u){return r-u},leftForLtr(r,u){return r-u}}},Uut=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function z2(e,t,r){return e?jut(t,r):Uut()}function F$(e,t){let r,u;(t==="ltr"||t==="rtl")&&(r=e.canvas.style,u=[r.getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",t,"important"),e.prevTextDirection=u)}function N$(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function j$(e){return e==="angle"?{between:q5,compare:$ct,normalize:Gm}:{between:O1,compare:(t,r)=>t-r,normalize:t=>t}}function vR({start:e,end:t,count:r,loop:u,style:T}){return{start:e%r,end:t%r,loop:u&&(t-e+1)%r===0,style:T}}function $ut(e,t,r){const{property:u,start:T,end:$}=r,{between:K,normalize:ct}=j$(u),yt=t.length;let{start:St,end:Ut,loop:ne}=e,pe,me;if(ne){for(St+=yt,Ut+=yt,pe=0,me=yt;peyt(T,rn,kr)&&ct(T,rn)!==0,Mr=()=>ct($,kr)===0||yt($,rn,kr),tn=()=>Ce||Lr(),Dn=()=>!Ce||Mr();for(let Mn=Ut,Br=Ut;Mn<=ne;++Mn)It=t[Mn%K],!It.skip&&(kr=St(It[u]),kr!==rn&&(Ce=yt(kr,T,$),Ve===null&&tn()&&(Ve=ct(kr,T)===0?Mn:Br),Ve!==null&&Dn()&&(we.push(vR({start:Ve,end:Mn,loop:pe,count:K,style:me})),Ve=null),Br=Mn,rn=kr));return Ve!==null&&we.push(vR({start:Ve,end:ne,loop:pe,count:K,style:me})),we}function $$(e,t){const r=[],u=e.segments;for(let T=0;TT&&e[$%t].skip;)$--;return $%=t,{start:T,end:$}}function Vut(e,t,r,u){const T=e.length,$=[];let K=t,ct=e[t],yt;for(yt=t+1;yt<=r;++yt){const St=e[yt%T];St.skip||St.stop?ct.skip||(u=!1,$.push({start:t%T,end:(yt-1)%T,loop:u}),t=K=St.stop?yt:null):(K=yt,ct.skip&&(t=yt)),ct=St}return K!==null&&$.push({start:t%T,end:K%T,loop:u}),$}function Wut(e,t){const r=e.points,u=e.options.spanGaps,T=r.length;if(!T)return[];const $=!!e._loop,{start:K,end:ct}=Hut(r,T,$,u);if(u===!0)return yR(e,[{start:K,end:ct,loop:$}],r,t);const yt=ct{let e=0;return()=>e++})();function Rh(e){return e==null}function Tp(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Uu(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function $0(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function fv(e,t){return $0(e)?e:t}function _u(e,t){return typeof e>"u"?t:e}const Ect=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,x$=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Kd(e,t,r){if(e&&typeof e.call=="function")return e.apply(r,t)}function cd(e,t,r,u){let T,$,K;if(Tp(e))for($=e.length,T=0;T<$;T++)t.call(r,e[T],T);else if(Uu(e))for(K=Object.keys(e),$=K.length,T=0;T<$;T++)t.call(r,e[K[T]],K[T])}function XT(e,t){let r,u,T,$;if(!e||!t||e.length!==t.length)return!1;for(r=0,u=e.length;re,x:e=>e.x,y:e=>e.y};function Ict(e){const t=e.split("."),r=[];let u="";for(const T of t)u+=T,u.endsWith("\\")?u=u.slice(0,-1)+".":(r.push(u),u="");return r}function Dct(e){const t=Ict(e);return r=>{for(const u of t){if(u==="")break;r=r&&r[u]}return r}}function $x(e,t){return(eR[t]||(eR[t]=Dct(t)))(e)}function VE(e){return e.charAt(0).toUpperCase()+e.slice(1)}const W5=e=>typeof e<"u",__=e=>typeof e=="function",rR=(e,t)=>{if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0};function zct(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ud=Math.PI,Cf=2*ud,Oct=Cf+ud,QT=Number.POSITIVE_INFINITY,Bct=ud/180,Bp=ud/2,ux=ud/4,nR=ud*2/3,w$=Math.log10,Lv=Math.sign;function A5(e,t,r){return Math.abs(e-t)T-$).pop(),t}function Fct(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function H2(e){return!Fct(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Nct(e,t){const r=Math.round(e);return r-t<=e&&r+t>=e}function jct(e,t,r){let u,T,$;for(u=0,T=e.length;uyt&&St=Math.min(t,r)-u&&e<=Math.max(t,r)+u}function WE(e,t,r){r=r||(K=>e[K]1;)$=T+u>>1,r($)?T=$:u=$;return{lo:T,hi:u}}const Mx=(e,t,r,u)=>WE(e,r,u?T=>{const $=e[T][t];return $e[T][t]WE(e,r,u=>e[u][t]>=r);function Wct(e,t,r){let u=0,T=e.length;for(;uu&&e[T-1]>r;)T--;return u>0||T{const u="_onData"+VE(r),T=e[r];Object.defineProperty(e,r,{configurable:!0,enumerable:!1,value(...$){const K=T.apply(this,$);return e._chartjs.listeners.forEach(ct=>{typeof ct[u]=="function"&&ct[u](...$)}),K}})})}function oR(e,t){const r=e._chartjs;if(!r)return;const u=r.listeners,T=u.indexOf(t);T!==-1&&u.splice(T,1),!(u.length>0)&&(T$.forEach($=>{delete e[$]}),delete e._chartjs)}function S$(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const C$=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function A$(e,t){let r=[],u=!1;return function(...T){r=T,u||(u=!0,C$.call(window,()=>{u=!1,e.apply(t,r)}))}}function Gct(e,t){let r;return function(...u){return t?(clearTimeout(r),r=setTimeout(e,t,u)):e.apply(this,u),t}}const qE=e=>e==="start"?"left":e==="end"?"right":"center",z0=(e,t,r)=>e==="start"?t:e==="end"?r:(t+r)/2,Zct=(e,t,r,u)=>e===(u?"left":"right")?r:e==="center"?(t+r)/2:t;function M$(e,t,r){const u=t.length;let T=0,$=u;if(e._sorted){const{iScale:K,vScale:ct,_parsed:yt}=e,St=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,Ut=K.axis,{min:ne,max:pe,minDefined:me,maxDefined:we}=K.getUserBounds();if(me){if(T=Math.min(Mx(yt,Ut,ne).lo,r?u:Mx(t,Ut,K.getPixelForValue(ne)).lo),St){const Ce=yt.slice(0,T+1).reverse().findIndex(Ve=>!Rh(Ve[ct.axis]));T-=Math.max(0,Ce)}T=j0(T,0,u-1)}if(we){let Ce=Math.max(Mx(yt,K.axis,pe,!0).hi+1,r?0:Mx(t,Ut,K.getPixelForValue(pe),!0).hi+1);if(St){const Ve=yt.slice(Ce-1).findIndex(kr=>!Rh(kr[ct.axis]));Ce+=Math.max(0,Ve)}$=j0(Ce,T,u)-T}else $=u-T}return{start:T,count:$}}function E$(e){const{xScale:t,yScale:r,_scaleRanges:u}=e,T={xmin:t.min,xmax:t.max,ymin:r.min,ymax:r.max};if(!u)return e._scaleRanges=T,!0;const $=u.xmin!==t.min||u.xmax!==t.max||u.ymin!==r.min||u.ymax!==r.max;return Object.assign(u,T),$}const U6=e=>e===0||e===1,sR=(e,t,r)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Cf/r)),lR=(e,t,r)=>Math.pow(2,-10*e)*Math.sin((e-t)*Cf/r)+1,M5={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Bp)+1,easeOutSine:e=>Math.sin(e*Bp),easeInOutSine:e=>-.5*(Math.cos(ud*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>U6(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>U6(e)?e:sR(e,.075,.3),easeOutElastic:e=>U6(e)?e:lR(e,.075,.3),easeInOutElastic(e){return U6(e)?e:e<.5?.5*sR(e*2,.1125,.45):.5+.5*lR(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-M5.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?M5.easeInBounce(e*2)*.5:M5.easeOutBounce(e*2-1)*.5+.5};function GE(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function cR(e){return GE(e)?e:new H5(e)}function B7(e){return GE(e)?e:new H5(e).saturate(.5).darken(.1).hexString()}const Kct=["x","y","borderWidth","radius","tension"],Yct=["color","borderColor","backgroundColor"];function Xct(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Yct},numbers:{type:"number",properties:Kct}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Jct(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const uR=new Map;function Qct(e,t){t=t||{};const r=e+JSON.stringify(t);let u=uR.get(r);return u||(u=new Intl.NumberFormat(e,t),uR.set(r,u)),u}function ZE(e,t,r){return Qct(t,r).format(e)}const tut={values(e){return Tp(e)?e:""+e},numeric(e,t,r){if(e===0)return"0";const u=this.chart.options.locale;let T,$=e;if(r.length>1){const St=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(St<1e-4||St>1e15)&&(T="scientific"),$=eut(e,r)}const K=w$(Math.abs($)),ct=isNaN(K)?1:Math.max(Math.min(-1*Math.floor(K),20),0),yt={notation:T,minimumFractionDigits:ct,maximumFractionDigits:ct};return Object.assign(yt,this.options.ticks.format),ZE(e,u,yt)}};function eut(e,t){let r=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(r)>=1&&e!==Math.floor(e)&&(r=e-Math.floor(e)),r}var L$={formatters:tut};function rut(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,r)=>r.lineWidth,tickColor:(t,r)=>r.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:L$.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Hx=Object.create(null),s9=Object.create(null);function E5(e,t){if(!t)return e;const r=t.split(".");for(let u=0,T=r.length;uu.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(u,T)=>B7(T.backgroundColor),this.hoverBorderColor=(u,T)=>B7(T.borderColor),this.hoverColor=(u,T)=>B7(T.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(r)}set(t,r){return R7(this,t,r)}get(t){return E5(this,t)}describe(t,r){return R7(s9,t,r)}override(t,r){return R7(Hx,t,r)}route(t,r,u,T){const $=E5(this,t),K=E5(this,u),ct="_"+r;Object.defineProperties($,{[ct]:{value:$[r],writable:!0},[r]:{enumerable:!0,get(){const yt=this[ct],St=K[T];return Uu(yt)?Object.assign({},St,yt):_u(yt,St)},set(yt){this[ct]=yt}}})}apply(t){t.forEach(r=>r(this))}}var lp=new nut({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xct,Jct,rut]);function iut(e){return!e||Rh(e.size)||Rh(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function hR(e,t,r,u,T){let $=t[T];return $||($=t[T]=e.measureText(T).width,r.push(T)),$>u&&(u=$),u}function hx(e,t,r){const u=e.currentDevicePixelRatio,T=r!==0?Math.max(r/2,.5):0;return Math.round((t-T)*u)/u+T}function dR(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function l9(e,t,r,u){P$(e,t,r,u,null)}function P$(e,t,r,u,T){let $,K,ct,yt,St,Ut,ne,pe;const me=t.pointStyle,we=t.rotation,Ce=t.radius;let Ve=(we||0)*Bct;if(me&&typeof me=="object"&&($=me.toString(),$==="[object HTMLImageElement]"||$==="[object HTMLCanvasElement]")){e.save(),e.translate(r,u),e.rotate(Ve),e.drawImage(me,-me.width/2,-me.height/2,me.width,me.height),e.restore();return}if(!(isNaN(Ce)||Ce<=0)){switch(e.beginPath(),me){default:T?e.ellipse(r,u,T/2,Ce,0,0,Cf):e.arc(r,u,Ce,0,Cf),e.closePath();break;case"triangle":Ut=T?T/2:Ce,e.moveTo(r+Math.sin(Ve)*Ut,u-Math.cos(Ve)*Ce),Ve+=nR,e.lineTo(r+Math.sin(Ve)*Ut,u-Math.cos(Ve)*Ce),Ve+=nR,e.lineTo(r+Math.sin(Ve)*Ut,u-Math.cos(Ve)*Ce),e.closePath();break;case"rectRounded":St=Ce*.516,yt=Ce-St,K=Math.cos(Ve+ux)*yt,ne=Math.cos(Ve+ux)*(T?T/2-St:yt),ct=Math.sin(Ve+ux)*yt,pe=Math.sin(Ve+ux)*(T?T/2-St:yt),e.arc(r-ne,u-ct,St,Ve-ud,Ve-Bp),e.arc(r+pe,u-K,St,Ve-Bp,Ve),e.arc(r+ne,u+ct,St,Ve,Ve+Bp),e.arc(r-pe,u+K,St,Ve+Bp,Ve+ud),e.closePath();break;case"rect":if(!we){yt=Math.SQRT1_2*Ce,Ut=T?T/2:yt,e.rect(r-Ut,u-yt,2*Ut,2*yt);break}Ve+=ux;case"rectRot":ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+pe,u-K),e.lineTo(r+ne,u+ct),e.lineTo(r-pe,u+K),e.closePath();break;case"crossRot":Ve+=ux;case"cross":ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+ne,u+ct),e.moveTo(r+pe,u-K),e.lineTo(r-pe,u+K);break;case"star":ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+ne,u+ct),e.moveTo(r+pe,u-K),e.lineTo(r-pe,u+K),Ve+=ux,ne=Math.cos(Ve)*(T?T/2:Ce),K=Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,pe=Math.sin(Ve)*(T?T/2:Ce),e.moveTo(r-ne,u-ct),e.lineTo(r+ne,u+ct),e.moveTo(r+pe,u-K),e.lineTo(r-pe,u+K);break;case"line":K=T?T/2:Math.cos(Ve)*Ce,ct=Math.sin(Ve)*Ce,e.moveTo(r-K,u-ct),e.lineTo(r+K,u+ct);break;case"dash":e.moveTo(r,u),e.lineTo(r+Math.cos(Ve)*(T?T/2:Ce),u+Math.sin(Ve)*Ce);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function G5(e,t,r){return r=r||.5,!t||e&&e.x>t.left-r&&e.xt.top-r&&e.y0&&$.strokeColor!=="";let yt,St;for(e.save(),e.font=T.string,sut(e,$),yt=0;yt+e||0;function KE(e,t){const r={},u=Uu(t),T=u?Object.keys(t):t,$=Uu(e)?u?K=>_u(e[K],e[t[K]]):K=>e[K]:()=>e;for(const K of T)r[K]=fut($(K));return r}function I$(e){return KE(e,{top:"y",right:"x",bottom:"y",left:"x"})}function D2(e){return KE(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kg(e){const t=I$(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function U0(e,t){e=e||{},t=t||lp.font;let r=_u(e.size,t.size);typeof r=="string"&&(r=parseInt(r,10));let u=_u(e.style,t.style);u&&!(""+u).match(hut)&&(console.warn('Invalid font style specified: "'+u+'"'),u=void 0);const T={family:_u(e.family,t.family),lineHeight:dut(_u(e.lineHeight,t.lineHeight),r),size:r,style:u,weight:_u(e.weight,t.weight),string:""};return T.string=iut(T),T}function $6(e,t,r,u){let T,$,K;for(T=0,$=e.length;T<$;++T)if(K=e[T],K!==void 0&&K!==void 0)return K}function put(e,t,r){const{min:u,max:T}=e,$=x$(t,(T-u)/2),K=(ct,yt)=>r&&ct===0?0:ct+yt;return{min:K(u,-Math.abs($)),max:K(T,$)}}function Gx(e,t){return Object.assign(Object.create(e),t)}function YE(e,t=[""],r,u,T=()=>e[0]){const $=r||e;typeof u>"u"&&(u=B$("_fallback",e));const K={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:$,_fallback:u,_getTarget:T,override:ct=>YE([ct,...e],t,$,u)};return new Proxy(K,{deleteProperty(ct,yt){return delete ct[yt],delete ct._keys,delete e[0][yt],!0},get(ct,yt){return z$(ct,yt,()=>wut(yt,t,e,ct))},getOwnPropertyDescriptor(ct,yt){return Reflect.getOwnPropertyDescriptor(ct._scopes[0],yt)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(ct,yt){return pR(ct).includes(yt)},ownKeys(ct){return pR(ct)},set(ct,yt,St){const Ut=ct._storage||(ct._storage=T());return ct[yt]=Ut[yt]=St,delete ct._keys,!0}})}function V2(e,t,r,u){const T={_cacheable:!1,_proxy:e,_context:t,_subProxy:r,_stack:new Set,_descriptors:D$(e,u),setContext:$=>V2(e,$,r,u),override:$=>V2(e.override($),t,r,u)};return new Proxy(T,{deleteProperty($,K){return delete $[K],delete e[K],!0},get($,K,ct){return z$($,K,()=>gut($,K,ct))},getOwnPropertyDescriptor($,K){return $._descriptors.allKeys?Reflect.has(e,K)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,K)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has($,K){return Reflect.has(e,K)},ownKeys(){return Reflect.ownKeys(e)},set($,K,ct){return e[K]=ct,delete $[K],!0}})}function D$(e,t={scriptable:!0,indexable:!0}){const{_scriptable:r=t.scriptable,_indexable:u=t.indexable,_allKeys:T=t.allKeys}=e;return{allKeys:T,scriptable:r,indexable:u,isScriptable:__(r)?r:()=>r,isIndexable:__(u)?u:()=>u}}const mut=(e,t)=>e?e+VE(t):t,XE=(e,t)=>Uu(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function z$(e,t,r){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const u=r();return e[t]=u,u}function gut(e,t,r){const{_proxy:u,_context:T,_subProxy:$,_descriptors:K}=e;let ct=u[t];return __(ct)&&K.isScriptable(t)&&(ct=vut(t,ct,e,r)),Tp(ct)&&ct.length&&(ct=yut(t,ct,e,K.isIndexable)),XE(t,ct)&&(ct=V2(ct,T,$&&$[t],K)),ct}function vut(e,t,r,u){const{_proxy:T,_context:$,_subProxy:K,_stack:ct}=r;if(ct.has(e))throw new Error("Recursion detected: "+Array.from(ct).join("->")+"->"+e);ct.add(e);let yt=t($,K||u);return ct.delete(e),XE(e,yt)&&(yt=JE(T._scopes,T,e,yt)),yt}function yut(e,t,r,u){const{_proxy:T,_context:$,_subProxy:K,_descriptors:ct}=r;if(typeof $.index<"u"&&u(e))return t[$.index%t.length];if(Uu(t[0])){const yt=t,St=T._scopes.filter(Ut=>Ut!==yt);t=[];for(const Ut of yt){const ne=JE(St,T,e,Ut);t.push(V2(ne,$,K&&K[e],ct))}}return t}function O$(e,t,r){return __(e)?e(t,r):e}const _ut=(e,t)=>e===!0?t:typeof e=="string"?$x(t,e):void 0;function xut(e,t,r,u,T){for(const $ of t){const K=_ut(r,$);if(K){e.add(K);const ct=O$(K._fallback,r,T);if(typeof ct<"u"&&ct!==r&&ct!==u)return ct}else if(K===!1&&typeof u<"u"&&r!==u)return null}return!1}function JE(e,t,r,u){const T=t._rootScopes,$=O$(t._fallback,r,u),K=[...e,...T],ct=new Set;ct.add(u);let yt=fR(ct,K,r,$||r,u);return yt===null||typeof $<"u"&&$!==r&&(yt=fR(ct,K,$,yt,u),yt===null)?!1:YE(Array.from(ct),[""],T,$,()=>but(t,r,u))}function fR(e,t,r,u,T){for(;r;)r=xut(e,t,r,u,T);return r}function but(e,t,r){const u=e._getTarget();t in u||(u[t]={});const T=u[t];return Tp(T)&&Uu(r)?r:T||{}}function wut(e,t,r,u){let T;for(const $ of t)if(T=B$(mut($,e),r),typeof T<"u")return XE(e,T)?JE(r,u,e,T):T}function B$(e,t){for(const r of t){if(!r)continue;const u=r[e];if(typeof u<"u")return u}}function pR(e){let t=e._keys;return t||(t=e._keys=kut(e._scopes)),t}function kut(e){const t=new Set;for(const r of e)for(const u of Object.keys(r).filter(T=>!T.startsWith("_")))t.add(u);return Array.from(t)}const Tut=Number.EPSILON||1e-14,W2=(e,t)=>te==="x"?"y":"x";function Sut(e,t,r,u){const T=e.skip?t:e,$=t,K=r.skip?t:r,ct=o9($,T),yt=o9(K,$);let St=ct/(ct+yt),Ut=yt/(ct+yt);St=isNaN(St)?0:St,Ut=isNaN(Ut)?0:Ut;const ne=u*St,pe=u*Ut;return{previous:{x:$.x-ne*(K.x-T.x),y:$.y-ne*(K.y-T.y)},next:{x:$.x+pe*(K.x-T.x),y:$.y+pe*(K.y-T.y)}}}function Cut(e,t,r){const u=e.length;let T,$,K,ct,yt,St=W2(e,0);for(let Ut=0;Ut!St.skip)),t.cubicInterpolationMode==="monotone")Mut(e,T);else{let St=u?e[e.length-1]:e[0];for($=0,K=e.length;$e.ownerDocument.defaultView.getComputedStyle(e,null);function Put(e,t){return WS(e).getPropertyValue(t)}const Iut=["top","right","bottom","left"];function Ox(e,t,r){const u={};r=r?"-"+r:"";for(let T=0;T<4;T++){const $=Iut[T];u[$]=parseFloat(e[t+"-"+$+r])||0}return u.width=u.left+u.right,u.height=u.top+u.bottom,u}const Dut=(e,t,r)=>(e>0||t>0)&&(!r||!r.shadowRoot);function zut(e,t){const r=e.touches,u=r&&r.length?r[0]:e,{offsetX:T,offsetY:$}=u;let K=!1,ct,yt;if(Dut(T,$,e.target))ct=T,yt=$;else{const St=t.getBoundingClientRect();ct=u.clientX-St.left,yt=u.clientY-St.top,K=!0}return{x:ct,y:yt,box:K}}function yx(e,t){if("native"in e)return e;const{canvas:r,currentDevicePixelRatio:u}=t,T=WS(r),$=T.boxSizing==="border-box",K=Ox(T,"padding"),ct=Ox(T,"border","width"),{x:yt,y:St,box:Ut}=zut(e,r),ne=K.left+(Ut&&ct.left),pe=K.top+(Ut&&ct.top);let{width:me,height:we}=t;return $&&(me-=K.width+ct.width,we-=K.height+ct.height),{x:Math.round((yt-ne)/me*r.width/u),y:Math.round((St-pe)/we*r.height/u)}}function Out(e,t,r){let u,T;if(t===void 0||r===void 0){const $=e&&tL(e);if(!$)t=e.clientWidth,r=e.clientHeight;else{const K=$.getBoundingClientRect(),ct=WS($),yt=Ox(ct,"border","width"),St=Ox(ct,"padding");t=K.width-St.width-yt.width,r=K.height-St.height-yt.height,u=eS(ct.maxWidth,$,"clientWidth"),T=eS(ct.maxHeight,$,"clientHeight")}}return{width:t,height:r,maxWidth:u||QT,maxHeight:T||QT}}const c_=e=>Math.round(e*10)/10;function But(e,t,r,u){const T=WS(e),$=Ox(T,"margin"),K=eS(T.maxWidth,e,"clientWidth")||QT,ct=eS(T.maxHeight,e,"clientHeight")||QT,yt=Out(e,t,r);let{width:St,height:Ut}=yt;if(T.boxSizing==="content-box"){const pe=Ox(T,"border","width"),me=Ox(T,"padding");St-=me.width+pe.width,Ut-=me.height+pe.height}return St=Math.max(0,St-$.width),Ut=Math.max(0,u?St/u:Ut-$.height),St=c_(Math.min(St,K,yt.maxWidth)),Ut=c_(Math.min(Ut,ct,yt.maxHeight)),St&&!Ut&&(Ut=c_(St/2)),(t!==void 0||r!==void 0)&&u&&yt.height&&Ut>yt.height&&(Ut=yt.height,St=c_(Math.floor(Ut*u))),{width:St,height:Ut}}function mR(e,t,r){const u=t||1,T=c_(e.height*u),$=c_(e.width*u);e.height=c_(e.height),e.width=c_(e.width);const K=e.canvas;return K.style&&(r||!K.style.height&&!K.style.width)&&(K.style.height=`${e.height}px`,K.style.width=`${e.width}px`),e.currentDevicePixelRatio!==u||K.height!==T||K.width!==$?(e.currentDevicePixelRatio=u,K.height=T,K.width=$,e.ctx.setTransform(u,0,0,u,0,0),!0):!1}const Rut=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};QE()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function gR(e,t){const r=Put(e,t),u=r&&r.match(/^(\d+)(\.\d+)?px$/);return u?+u[1]:void 0}function _x(e,t,r,u){return{x:e.x+r*(t.x-e.x),y:e.y+r*(t.y-e.y)}}function Fut(e,t,r,u){return{x:e.x+r*(t.x-e.x),y:u==="middle"?r<.5?e.y:t.y:u==="after"?r<1?e.y:t.y:r>0?t.y:e.y}}function Nut(e,t,r,u){const T={x:e.cp2x,y:e.cp2y},$={x:t.cp1x,y:t.cp1y},K=_x(e,T,r),ct=_x(T,$,r),yt=_x($,t,r),St=_x(K,ct,r),Ut=_x(ct,yt,r);return _x(St,Ut,r)}const jut=function(e,t){return{x(r){return e+e+t-r},setWidth(r){t=r},textAlign(r){return r==="center"?r:r==="right"?"left":"right"},xPlus(r,u){return r-u},leftForLtr(r,u){return r-u}}},Uut=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function z2(e,t,r){return e?jut(t,r):Uut()}function F$(e,t){let r,u;(t==="ltr"||t==="rtl")&&(r=e.canvas.style,u=[r.getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",t,"important"),e.prevTextDirection=u)}function N$(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function j$(e){return e==="angle"?{between:q5,compare:$ct,normalize:Gm}:{between:O1,compare:(t,r)=>t-r,normalize:t=>t}}function vR({start:e,end:t,count:r,loop:u,style:T}){return{start:e%r,end:t%r,loop:u&&(t-e+1)%r===0,style:T}}function $ut(e,t,r){const{property:u,start:T,end:$}=r,{between:K,normalize:ct}=j$(u),yt=t.length;let{start:St,end:Ut,loop:ne}=e,pe,me;if(ne){for(St+=yt,Ut+=yt,pe=0,me=yt;peyt(T,rn,kr)&&ct(T,rn)!==0,Mr=()=>ct($,kr)===0||yt($,rn,kr),tn=()=>Ce||Lr(),Dn=()=>!Ce||Mr();for(let Mn=Ut,Br=Ut;Mn<=ne;++Mn)It=t[Mn%K],!It.skip&&(kr=St(It[u]),kr!==rn&&(Ce=yt(kr,T,$),Ve===null&&tn()&&(Ve=ct(kr,T)===0?Mn:Br),Ve!==null&&Dn()&&(we.push(vR({start:Ve,end:Mn,loop:pe,count:K,style:me})),Ve=null),Br=Mn,rn=kr));return Ve!==null&&we.push(vR({start:Ve,end:ne,loop:pe,count:K,style:me})),we}function $$(e,t){const r=[],u=e.segments;for(let T=0;TT&&e[$%t].skip;)$--;return $%=t,{start:T,end:$}}function Vut(e,t,r,u){const T=e.length,$=[];let K=t,ct=e[t],yt;for(yt=t+1;yt<=r;++yt){const St=e[yt%T];St.skip||St.stop?ct.skip||(u=!1,$.push({start:t%T,end:(yt-1)%T,loop:u}),t=K=St.stop?yt:null):(K=yt,ct.skip&&(t=yt)),ct=St}return K!==null&&$.push({start:t%T,end:K%T,loop:u}),$}function Wut(e,t){const r=e.points,u=e.options.spanGaps,T=r.length;if(!T)return[];const $=!!e._loop,{start:K,end:ct}=Hut(r,T,$,u);if(u===!0)return yR(e,[{start:K,end:ct,loop:$}],r,t);const yt=ctct({chart:t,initial:r.initial,numSteps:K,currentStep:Math.min(u-r.start,K)}))}_refresh(){this._request||(this._running=!0,this._request=C$.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let r=0;this._charts.forEach((u,T)=>{if(!u.running||!u.items.length)return;const $=u.items;let K=$.length-1,ct=!1,yt;for(;K>=0;--K)yt=$[K],yt._active?(yt._total>u.duration&&(u.duration=yt._total),yt.tick(t),ct=!0):($[K]=$[$.length-1],$.pop());ct&&(T.draw(),this._notify(T,u,t,"progress")),$.length||(u.running=!1,this._notify(T,u,t,"complete"),u.initial=!1),r+=$.length}),this._lastDate=t,r===0&&(this._running=!1)}_getAnims(t){const r=this._charts;let u=r.get(t);return u||(u={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},r.set(t,u)),u}listen(t,r,u){this._getAnims(t).listeners[r].push(u)}add(t,r){!r||!r.length||this._getAnims(t).items.push(...r)}has(t){return this._getAnims(t).items.length>0}start(t){const r=this._charts.get(t);r&&(r.running=!0,r.start=Date.now(),r.duration=r.items.reduce((u,T)=>Math.max(u,T._duration),0),this._refresh())}running(t){if(!this._running)return!1;const r=this._charts.get(t);return!(!r||!r.running||!r.items.length)}stop(t){const r=this._charts.get(t);if(!r||!r.items.length)return;const u=r.items;let T=u.length-1;for(;T>=0;--T)u[T].cancel();r.items=[],this._notify(t,r,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var k1=new Kut;const xR="transparent",Yut={boolean(e,t,r){return r>.5?t:e},color(e,t,r){const u=cR(e||xR),T=u.valid&&cR(t||xR);return T&&T.valid?T.mix(u,r).hexString():t},number(e,t,r){return e+(t-e)*r}};class Xut{constructor(t,r,u,T){const $=r[u];T=$6([t.to,T,$,t.from]);const K=$6([t.from,$,T]);this._active=!0,this._fn=t.fn||Yut[t.type||typeof K],this._easing=M5[t.easing]||M5.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=r,this._prop=u,this._from=K,this._to=T,this._promises=void 0}active(){return this._active}update(t,r,u){if(this._active){this._notify(!1);const T=this._target[this._prop],$=u-this._start,K=this._duration-$;this._start=u,this._duration=Math.floor(Math.max(K,t.duration)),this._total+=$,this._loop=!!t.loop,this._to=$6([t.to,r,T,t.from]),this._from=$6([t.from,T,r])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const r=t-this._start,u=this._duration,T=this._prop,$=this._from,K=this._loop,ct=this._to;let yt;if(this._active=$!==ct&&(K||r1?2-yt:yt,yt=this._easing(Math.min(1,Math.max(0,yt))),this._target[T]=this._fn($,ct,yt)}wait(){const t=this._promises||(this._promises=[]);return new Promise((r,u)=>{t.push({res:r,rej:u})})}_notify(t){const r=t?"res":"rej",u=this._promises||[];for(let T=0;T{const $=t[T];if(!Uu($))return;const K={};for(const ct of r)K[ct]=$[ct];(Tp($.properties)&&$.properties||[T]).forEach(ct=>{(ct===T||!u.has(ct))&&u.set(ct,K)})})}_animateOptions(t,r){const u=r.options,T=Qut(t,u);if(!T)return[];const $=this._createAnimations(T,u);return u.$shared&&Jut(t.options.$animations,u).then(()=>{t.options=u},()=>{}),$}_createAnimations(t,r){const u=this._properties,T=[],$=t.$animations||(t.$animations={}),K=Object.keys(r),ct=Date.now();let yt;for(yt=K.length-1;yt>=0;--yt){const St=K[yt];if(St.charAt(0)==="$")continue;if(St==="options"){T.push(...this._animateOptions(t,r));continue}const Ut=r[St];let ne=$[St];const pe=u.get(St);if(ne)if(pe&&ne.active()){ne.update(pe,Ut,ct);continue}else ne.cancel();if(!pe||!pe.duration){t[St]=Ut;continue}$[St]=ne=new Xut(pe,t,St,Ut),T.push(ne)}return T}update(t,r){if(this._properties.size===0){Object.assign(t,r);return}const u=this._createAnimations(t,r);if(u.length)return k1.add(this._chart,u),!0}}function Jut(e,t){const r=[],u=Object.keys(t);for(let T=0;T0||!r&&$<0)return T.index}return null}function TR(e,t){const{chart:r,_cachedMeta:u}=e,T=r._stacks||(r._stacks={}),{iScale:$,vScale:K,index:ct}=u,yt=$.axis,St=K.axis,Ut=nht($,K,u),ne=t.length;let pe;for(let me=0;mer[u].axis===t).shift()}function oht(e,t){return qx(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function sht(e,t,r){return qx(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:r,index:t,mode:"default",type:"data"})}function B3(e,t){const r=e.controller.index,u=e.vScale&&e.vScale.axis;if(u){t=t||e._parsed;for(const T of t){const $=T._stacks;if(!$||$[u]===void 0||$[u][r]===void 0)return;delete $[u][r],$[u]._visualValues!==void 0&&$[u]._visualValues[r]!==void 0&&delete $[u]._visualValues[r]}}}const j7=e=>e==="reset"||e==="none",SR=(e,t)=>t?e:Object.assign({},e),lht=(e,t,r)=>e&&!t.hidden&&t._stacked&&{keys:W$(r,!0),values:null};class c4{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,r){this.chart=t,this._ctx=t.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=F7(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&B3(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,r=this._cachedMeta,u=this.getDataset(),T=(ne,pe,me,we)=>ne==="x"?pe:ne==="r"?we:me,$=r.xAxisID=_u(u.xAxisID,N7(t,"x")),K=r.yAxisID=_u(u.yAxisID,N7(t,"y")),ct=r.rAxisID=_u(u.rAxisID,N7(t,"r")),yt=r.indexAxis,St=r.iAxisID=T(yt,$,K,ct),Ut=r.vAxisID=T(yt,K,$,ct);r.xScale=this.getScaleForId($),r.yScale=this.getScaleForId(K),r.rScale=this.getScaleForId(ct),r.iScale=this.getScaleForId(St),r.vScale=this.getScaleForId(Ut)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const r=this._cachedMeta;return t===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&oR(this._data,this),t._stacked&&B3(t)}_dataCheck(){const t=this.getDataset(),r=t.data||(t.data=[]),u=this._data;if(Uu(r)){const T=this._cachedMeta;this._data=rht(r,T)}else if(u!==r){if(u){oR(u,this);const T=this._cachedMeta;B3(T),T._parsed=[]}r&&Object.isExtensible(r)&&qct(r,this),this._syncList=[],this._data=r}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const r=this._cachedMeta,u=this.getDataset();let T=!1;this._dataCheck();const $=r._stacked;r._stacked=F7(r.vScale,r),r.stack!==u.stack&&(T=!0,B3(r),r.stack=u.stack),this._resyncElements(t),(T||$!==r._stacked)&&(TR(this,r._parsed),r._stacked=F7(r.vScale,r))}configure(){const t=this.chart.config,r=t.datasetScopeKeys(this._type),u=t.getOptionScopes(this.getDataset(),r,!0);this.options=t.createResolver(u,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,r){const{_cachedMeta:u,_data:T}=this,{iScale:$,_stacked:K}=u,ct=$.axis;let yt=t===0&&r===T.length?!0:u._sorted,St=t>0&&u._parsed[t-1],Ut,ne,pe;if(this._parsing===!1)u._parsed=T,u._sorted=!0,pe=T;else{Tp(T[t])?pe=this.parseArrayData(u,T,t,r):Uu(T[t])?pe=this.parseObjectData(u,T,t,r):pe=this.parsePrimitiveData(u,T,t,r);const me=()=>ne[ct]===null||St&&ne[ct]Ce||ne=0;--pe)if(!we()){this.updateRangeFromParsed(St,t,me,yt);break}}return St}getAllParsedValues(t){const r=this._cachedMeta._parsed,u=[];let T,$,K;for(T=0,$=r.length;T<$;++T)K=r[T][t.axis],$0(K)&&u.push(K);return u}getMaxOverflow(){return!1}getLabelAndValue(t){const r=this._cachedMeta,u=r.iScale,T=r.vScale,$=this.getParsed(t);return{label:u?""+u.getLabelForValue($[u.axis]):"",value:T?""+T.getLabelForValue($[T.axis]):""}}_update(t){const r=this._cachedMeta;this.update(t||"default"),r._clip=eht(_u(this.options.clip,tht(r.xScale,r.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,r=this.chart,u=this._cachedMeta,T=u.data||[],$=r.chartArea,K=[],ct=this._drawStart||0,yt=this._drawCount||T.length-ct,St=this.options.drawActiveElementsOnTop;let Ut;for(u.dataset&&u.dataset.draw(t,$,ct,yt),Ut=ct;Ut=0&&tthis.getContext(u,T,r),Ce=St.resolveNamedOptions(pe,me,we,ne);return Ce.$shared&&(Ce.$shared=yt,$[K]=Object.freeze(SR(Ce,yt))),Ce}_resolveAnimations(t,r,u){const T=this.chart,$=this._cachedDataOpts,K=`animation-${r}`,ct=$[K];if(ct)return ct;let yt;if(T.options.animation!==!1){const Ut=this.chart.config,ne=Ut.datasetAnimationScopeKeys(this._type,r),pe=Ut.getOptionScopes(this.getDataset(),ne);yt=Ut.createResolver(pe,this.getContext(t,u,r))}const St=new V$(T,yt&&yt.animations);return yt&&yt._cacheable&&($[K]=Object.freeze(St)),St}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,r){return!r||j7(t)||this.chart._animationsDisabled}_getSharedOptions(t,r){const u=this.resolveDataElementOptions(t,r),T=this._sharedOptions,$=this.getSharedOptions(u),K=this.includeOptions(r,$)||$!==T;return this.updateSharedOptions($,r,u),{sharedOptions:$,includeOptions:K}}updateElement(t,r,u,T){j7(T)?Object.assign(t,u):this._resolveAnimations(r,T).update(t,u)}updateSharedOptions(t,r,u){t&&!j7(r)&&this._resolveAnimations(void 0,r).update(t,u)}_setStyle(t,r,u,T){t.active=T;const $=this.getStyle(r,T);this._resolveAnimations(r,u,T).update(t,{options:!T&&this.getSharedOptions($)||$})}removeHoverStyle(t,r,u){this._setStyle(t,u,"active",!1)}setHoverStyle(t,r,u){this._setStyle(t,u,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const r=this._data,u=this._cachedMeta.data;for(const[ct,yt,St]of this._syncList)this[ct](yt,St);this._syncList=[];const T=u.length,$=r.length,K=Math.min($,T);K&&this.parse(0,K),$>T?this._insertElements(T,$-T,t):${for(St.length+=r,ct=St.length-1;ct>=K;ct--)St[ct]=St[ct-r]};for(yt($),ct=t;ctT-$))}return e._cache.$bar}function uht(e){const t=e.iScale,r=cht(t,e.type);let u=t._length,T,$,K,ct;const yt=()=>{K===32767||K===-32768||(W5(ct)&&(u=Math.min(u,Math.abs(K-ct)||u)),ct=K)};for(T=0,$=r.length;T<$;++T)K=t.getPixelForValue(r[T]),yt();for(ct=void 0,T=0,$=t.ticks.length;T<$;++T)K=t.getPixelForTick(T),yt();return u}function hht(e,t,r,u){const T=r.barThickness;let $,K;return Rh(T)?($=t.min*r.categoryPercentage,K=r.barPercentage):($=T*u,K=1),{chunk:$/u,ratio:K,start:t.pixels[e]-$/2}}function dht(e,t,r,u){const T=t.pixels,$=T[e];let K=e>0?T[e-1]:null,ct=eMath.abs(ct)&&(yt=ct,St=K),t[r.axis]=St,t._custom={barStart:yt,barEnd:St,start:T,end:$,min:K,max:ct}}function q$(e,t,r,u){return Tp(e)?fht(e,t,r,u):t[r.axis]=r.parse(e,u),t}function CR(e,t,r,u){const T=e.iScale,$=e.vScale,K=T.getLabels(),ct=T===$,yt=[];let St,Ut,ne,pe;for(St=r,Ut=r+u;St=r?1:-1)}function mht(e){let t,r,u,T,$;return e.horizontal?(t=e.base>e.x,r="left",u="right"):(t=e.baseUt.controller.options.grouped),$=u.options.stacked,K=[],ct=this._cachedMeta.controller.getParsed(r),yt=ct&&ct[u.axis],St=Ut=>{const ne=Ut._parsed.find(me=>me[u.axis]===yt),pe=ne&&ne[Ut.vScale.axis];if(Rh(pe)||isNaN(pe))return!0};for(const Ut of T)if(!(r!==void 0&&St(Ut))&&(($===!1||K.indexOf(Ut.stack)===-1||$===void 0&&Ut.stack===void 0)&&K.push(Ut.stack),Ut.index===t))break;return K.length||K.push(void 0),K}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,r=this.chart.options.indexAxis;return Object.keys(t).filter(u=>t[u].axis===r).shift()}_getAxis(){const t={},r=this.getFirstScaleIdForIndexAxis();for(const u of this.chart.data.datasets)t[_u(this.chart.options.indexAxis==="x"?u.xAxisID:u.yAxisID,r)]=!0;return Object.keys(t)}_getStackIndex(t,r,u){const T=this._getStacks(t,u),$=r!==void 0?T.indexOf(r):-1;return $===-1?T.length-1:$}_getRuler(){const t=this.options,r=this._cachedMeta,u=r.iScale,T=[];let $,K;for($=0,K=r.data.length;$q5(rn,ct,yt,!0)?1:Math.max(Lr,Lr*r,Mr,Mr*r),we=(rn,Lr,Mr)=>q5(rn,ct,yt,!0)?-1:Math.min(Lr,Lr*r,Mr,Mr*r),Ce=me(0,St,ne),Ve=me(Bp,Ut,pe),kr=we(ud,St,ne),It=we(ud+Bp,Ut,pe);u=(Ce-kr)/2,T=(Ve-It)/2,$=-(Ce+kr)/2,K=-(Ve+It)/2}return{ratioX:u,ratioY:T,offsetX:$,offsetY:K}}class Z$ extends c4{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const r=t.data,{labels:{pointStyle:u,textAlign:T,color:$,useBorderRadius:K,borderRadius:ct}}=t.legend.options;return r.labels.length&&r.datasets.length?r.labels.map((yt,St)=>{const ne=t.getDatasetMeta(0).controller.getStyle(St);return{text:yt,fillStyle:ne.backgroundColor,fontColor:$,hidden:!t.getDataVisibility(St),lineDash:ne.borderDash,lineDashOffset:ne.borderDashOffset,lineJoin:ne.borderJoinStyle,lineWidth:ne.borderWidth,strokeStyle:ne.borderColor,textAlign:T,pointStyle:u,borderRadius:K&&(ct||ne.borderRadius),index:St}}):[]}},onClick(t,r,u){u.chart.toggleDataVisibility(r.index),u.chart.update()}}}};constructor(t,r){super(t,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,r){const u=this.getDataset().data,T=this._cachedMeta;if(this._parsing===!1)T._parsed=u;else{let $=yt=>+u[yt];if(Uu(u[t])){const{key:yt="value"}=this._parsing;$=St=>+Ux(u[St],yt)}let K,ct;for(K=t,ct=t+r;K0&&!isNaN(t)?Cf*(Math.abs(t)/r):0}getLabelAndValue(t){const r=this._cachedMeta,u=this.chart,T=u.data.labels||[],$=ZE(r._parsed[t],u.options.locale);return{label:T[t]||"",value:$}}getMaxBorderWidth(t){let r=0;const u=this.chart;let T,$,K,ct,yt;if(!t){for(T=0,$=u.data.datasets.length;T<$;++T)if(u.isDatasetVisible(T)){K=u.getDatasetMeta(T),t=K.data,ct=K.controller;break}}if(!t)return 0;for(T=0,$=t.length;T<$;++T)yt=ct.resolveDataElementOptions(T),yt.borderAlign!=="inner"&&(r=Math.max(r,yt.borderWidth||0,yt.hoverBorderWidth||0));return r}getMaxOffset(t){let r=0;for(let u=0,T=t.length;u0&&this.getParsed(r-1);for(let Mr=0;Mr=It){Dn.skip=!0;continue}const Mn=this.getParsed(Mr),Br=Rh(Mn[me]),Vn=Dn[pe]=K.getPixelForValue(Mn[pe],Mr),on=Dn[me]=$||Br?ct.getBasePixel():ct.getPixelForValue(yt?this.applyStack(ct,Mn,yt):Mn[me],Mr);Dn.skip=isNaN(Vn)||isNaN(on)||Br,Dn.stop=Mr>0&&Math.abs(Mn[pe]-Lr[pe])>Ve,Ce&&(Dn.parsed=Mn,Dn.raw=St.data[Mr]),ne&&(Dn.options=Ut||this.resolveDataElementOptions(Mr,tn.active?"active":T)),kr||this.updateElement(tn,Mr,Dn,T),Lr=Mn}}getMaxOverflow(){const t=this._cachedMeta,r=t.dataset,u=r.options&&r.options.borderWidth||0,T=t.data||[];if(!T.length)return u;const $=T[0].size(this.resolveDataElementOptions(0)),K=T[T.length-1].size(this.resolveDataElementOptions(T.length-1));return Math.max(u,$,K)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class xht extends c4{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const r=this._cachedMeta,u=this.chart.data.labels||[],{xScale:T,yScale:$}=r,K=this.getParsed(t),ct=T.getLabelForValue(K.x),yt=$.getLabelForValue(K.y);return{label:u[t]||"",value:"("+ct+", "+yt+")"}}update(t){const r=this._cachedMeta,{data:u=[]}=r,T=this.chart._animationsDisabled;let{start:$,count:K}=M$(r,u,T);if(this._drawStart=$,this._drawCount=K,E$(r)&&($=0,K=u.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:ct,_dataset:yt}=r;ct._chart=this.chart,ct._datasetIndex=this.index,ct._decimated=!!yt._decimated,ct.points=u;const St=this.resolveDatasetElementOptions(t);St.segment=this.options.segment,this.updateElement(ct,void 0,{animated:!T,options:St},t)}else this.datasetElementType&&(delete r.dataset,this.datasetElementType=!1);this.updateElements(u,$,K,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,r,u,T){const $=T==="reset",{iScale:K,vScale:ct,_stacked:yt,_dataset:St}=this._cachedMeta,Ut=this.resolveDataElementOptions(r,T),ne=this.getSharedOptions(Ut),pe=this.includeOptions(T,ne),me=K.axis,we=ct.axis,{spanGaps:Ce,segment:Ve}=this.options,kr=H2(Ce)?Ce:Number.POSITIVE_INFINITY,It=this.chart._animationsDisabled||$||T==="none";let rn=r>0&&this.getParsed(r-1);for(let Lr=r;Lr0&&Math.abs(tn[me]-rn[me])>kr,Ve&&(Dn.parsed=tn,Dn.raw=St.data[Lr]),pe&&(Dn.options=ne||this.resolveDataElementOptions(Lr,Mr.active?"active":T)),It||this.updateElement(Mr,Lr,Dn,T),rn=tn}this.updateSharedOptions(ne,T,Ut)}getMaxOverflow(){const t=this._cachedMeta,r=t.data||[];if(!this.options.showLine){let ct=0;for(let yt=r.length-1;yt>=0;--yt)ct=Math.max(ct,r[yt].size(this.resolveDataElementOptions(yt))/2);return ct>0&&ct}const u=t.dataset,T=u.options&&u.options.borderWidth||0;if(!r.length)return T;const $=r[0].size(this.resolveDataElementOptions(0)),K=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(T,$,K)/2}}function dx(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class rL{static override(t){Object.assign(rL.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return dx()}parse(){return dx()}format(){return dx()}add(){return dx()}diff(){return dx()}startOf(){return dx()}endOf(){return dx()}}var K$={_date:rL};function bht(e,t,r,u){const{controller:T,data:$,_sorted:K}=e,ct=T._cachedMeta.iScale,yt=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(ct&&t===ct.axis&&t!=="r"&&K&&$.length){const St=ct._reversePixels?Vct:Mx;if(u){if(T._sharedOptions){const Ut=$[0],ne=typeof Ut.getRange=="function"&&Ut.getRange(t);if(ne){const pe=St($,t,r-ne),me=St($,t,r+ne);return{lo:pe.lo,hi:me.hi}}}}else{const Ut=St($,t,r);if(yt){const{vScale:ne}=T._cachedMeta,{_parsed:pe}=e,me=pe.slice(0,Ut.lo+1).reverse().findIndex(Ce=>!Rh(Ce[ne.axis]));Ut.lo-=Math.max(0,me);const we=pe.slice(Ut.hi).findIndex(Ce=>!Rh(Ce[ne.axis]));Ut.hi+=Math.max(0,we)}return Ut}}return{lo:0,hi:$.length-1}}function qS(e,t,r,u,T){const $=e.getSortedVisibleDatasetMetas(),K=r[t];for(let ct=0,yt=$.length;ct{yt[K]&&yt[K](t[r],T)&&($.push({element:yt,datasetIndex:St,index:Ut}),ct=ct||yt.inRange(t.x,t.y,T))}),u&&!ct?[]:$}var Sht={modes:{index(e,t,r,u){const T=yx(t,e),$=r.axis||"x",K=r.includeInvisible||!1,ct=r.intersect?$7(e,T,$,u,K):H7(e,T,$,!1,u,K),yt=[];return ct.length?(e.getSortedVisibleDatasetMetas().forEach(St=>{const Ut=ct[0].index,ne=St.data[Ut];ne&&!ne.skip&&yt.push({element:ne,datasetIndex:St.index,index:Ut})}),yt):[]},dataset(e,t,r,u){const T=yx(t,e),$=r.axis||"xy",K=r.includeInvisible||!1;let ct=r.intersect?$7(e,T,$,u,K):H7(e,T,$,!1,u,K);if(ct.length>0){const yt=ct[0].datasetIndex,St=e.getDatasetMeta(yt).data;ct=[];for(let Ut=0;Utr.pos===t)}function LR(e,t){return e.filter(r=>Y$.indexOf(r.pos)===-1&&r.box.axis===t)}function F3(e,t){return e.sort((r,u)=>{const T=t?u:r,$=t?r:u;return T.weight===$.weight?T.index-$.index:T.weight-$.weight})}function Cht(e){const t=[];let r,u,T,$,K,ct;for(r=0,u=(e||[]).length;rSt.box.fullSize),!0),u=F3(R3(t,"left"),!0),T=F3(R3(t,"right")),$=F3(R3(t,"top"),!0),K=F3(R3(t,"bottom")),ct=LR(t,"x"),yt=LR(t,"y");return{fullSize:r,leftAndTop:u.concat($),rightAndBottom:T.concat(yt).concat(K).concat(ct),chartArea:R3(t,"chartArea"),vertical:u.concat(T).concat(yt),horizontal:$.concat(K).concat(ct)}}function PR(e,t,r,u){return Math.max(e[r],t[r])+Math.max(e[u],t[u])}function X$(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Lht(e,t,r,u){const{pos:T,box:$}=r,K=e.maxPadding;if(!Uu(T)){r.size&&(e[T]-=r.size);const ne=u[r.stack]||{size:0,count:1};ne.size=Math.max(ne.size,r.horizontal?$.height:$.width),r.size=ne.size/ne.count,e[T]+=r.size}$.getPadding&&X$(K,$.getPadding());const ct=Math.max(0,t.outerWidth-PR(K,e,"left","right")),yt=Math.max(0,t.outerHeight-PR(K,e,"top","bottom")),St=ct!==e.w,Ut=yt!==e.h;return e.w=ct,e.h=yt,r.horizontal?{same:St,other:Ut}:{same:Ut,other:St}}function Pht(e){const t=e.maxPadding;function r(u){const T=Math.max(t[u]-e[u],0);return e[u]+=T,T}e.y+=r("top"),e.x+=r("left"),r("right"),r("bottom")}function Iht(e,t){const r=t.maxPadding;function u(T){const $={left:0,top:0,right:0,bottom:0};return T.forEach(K=>{$[K]=Math.max(t[K],r[K])}),$}return u(e?["left","right"]:["top","bottom"])}function s5(e,t,r,u){const T=[];let $,K,ct,yt,St,Ut;for($=0,K=e.length,St=0;${typeof Ce.beforeLayout=="function"&&Ce.beforeLayout()});const Ut=yt.reduce((Ce,Ve)=>Ve.box.options&&Ve.box.options.display===!1?Ce:Ce+1,0)||1,ne=Object.freeze({outerWidth:t,outerHeight:r,padding:T,availableWidth:$,availableHeight:K,vBoxMaxWidth:$/2/Ut,hBoxMaxHeight:K/2}),pe=Object.assign({},T);X$(pe,kg(u));const me=Object.assign({maxPadding:pe,w:$,h:K,x:T.left,y:T.top},T),we=Mht(yt.concat(St),ne);s5(ct.fullSize,me,ne,we),s5(yt,me,ne,we),s5(St,me,ne,we)&&s5(yt,me,ne,we),Pht(me),IR(ct.leftAndTop,me,ne,we),me.x+=me.w,me.y+=me.h,IR(ct.rightAndBottom,me,ne,we),e.chartArea={left:me.left,top:me.top,right:me.left+me.w,bottom:me.top+me.h,height:me.h,width:me.w},cd(ct.chartArea,Ce=>{const Ve=Ce.box;Object.assign(Ve,e.chartArea),Ve.update(me.w,me.h,{left:0,top:0,right:0,bottom:0})})}};class J${acquireContext(t,r){}releaseContext(t){return!1}addEventListener(t,r,u){}removeEventListener(t,r,u){}getDevicePixelRatio(){return 1}getMaximumSize(t,r,u,T){return r=Math.max(0,r||t.width),u=u||t.height,{width:r,height:Math.max(0,T?Math.floor(r/T):u)}}isAttached(t){return!0}updateConfig(t){}}class Dht extends J${acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const TT="$chartjs",zht={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},DR=e=>e===null||e==="";function Oht(e,t){const r=e.style,u=e.getAttribute("height"),T=e.getAttribute("width");if(e[TT]={initial:{height:u,width:T,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",DR(T)){const $=gR(e,"width");$!==void 0&&(e.width=$)}if(DR(u))if(e.style.height==="")e.height=e.width/(t||2);else{const $=gR(e,"height");$!==void 0&&(e.height=$)}return e}const Q$=Rut?{passive:!0}:!1;function Bht(e,t,r){e&&e.addEventListener(t,r,Q$)}function Rht(e,t,r){e&&e.canvas&&e.canvas.removeEventListener(t,r,Q$)}function Fht(e,t){const r=zht[e.type]||e.type,{x:u,y:T}=yx(e,t);return{type:r,chart:t,native:e,x:u!==void 0?u:null,y:T!==void 0?T:null}}function rS(e,t){for(const r of e)if(r===t||r.contains(t))return!0}function Nht(e,t,r){const u=e.canvas,T=new MutationObserver($=>{let K=!1;for(const ct of $)K=K||rS(ct.addedNodes,u),K=K&&!rS(ct.removedNodes,u);K&&r()});return T.observe(document,{childList:!0,subtree:!0}),T}function jht(e,t,r){const u=e.canvas,T=new MutationObserver($=>{let K=!1;for(const ct of $)K=K||rS(ct.removedNodes,u),K=K&&!rS(ct.addedNodes,u);K&&r()});return T.observe(document,{childList:!0,subtree:!0}),T}const K5=new Map;let zR=0;function tH(){const e=window.devicePixelRatio;e!==zR&&(zR=e,K5.forEach((t,r)=>{r.currentDevicePixelRatio!==e&&t()}))}function Uht(e,t){K5.size||window.addEventListener("resize",tH),K5.set(e,t)}function $ht(e){K5.delete(e),K5.size||window.removeEventListener("resize",tH)}function Hht(e,t,r){const u=e.canvas,T=u&&tL(u);if(!T)return;const $=A$((ct,yt)=>{const St=T.clientWidth;r(ct,yt),St{const yt=ct[0],St=yt.contentRect.width,Ut=yt.contentRect.height;St===0&&Ut===0||$(St,Ut)});return K.observe(T),Uht(e,$),K}function V7(e,t,r){r&&r.disconnect(),t==="resize"&&$ht(e)}function Vht(e,t,r){const u=e.canvas,T=A$($=>{e.ctx!==null&&r(Fht($,e))},e);return Bht(u,t,T),T}class Wht extends J${acquireContext(t,r){const u=t&&t.getContext&&t.getContext("2d");return u&&u.canvas===t?(Oht(t,r),u):null}releaseContext(t){const r=t.canvas;if(!r[TT])return!1;const u=r[TT].initial;["height","width"].forEach($=>{const K=u[$];Rh(K)?r.removeAttribute($):r.setAttribute($,K)});const T=u.style||{};return Object.keys(T).forEach($=>{r.style[$]=T[$]}),r.width=r.width,delete r[TT],!0}addEventListener(t,r,u){this.removeEventListener(t,r);const T=t.$proxies||(t.$proxies={}),K={attach:Nht,detach:jht,resize:Hht}[r]||Vht;T[r]=K(t,r,u)}removeEventListener(t,r){const u=t.$proxies||(t.$proxies={}),T=u[r];if(!T)return;({attach:V7,detach:V7,resize:V7}[r]||Rht)(t,r,T),u[r]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,r,u,T){return But(t,r,u,T)}isAttached(t){const r=t&&tL(t);return!!(r&&r.isConnected)}}function qht(e){return!QE()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Dht:Wht}let G1=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:r,y:u}=this.getProps(["x","y"],t);return{x:r,y:u}}hasValue(){return H2(this.x)&&H2(this.y)}getProps(t,r){const u=this.$animations;if(!r||!u)return this;const T={};return t.forEach($=>{T[$]=u[$]&&u[$].active()?u[$]._to:this[$]}),T}};function Ght(e,t){const r=e.options.ticks,u=Zht(e),T=Math.min(r.maxTicksLimit||u,u),$=r.major.enabled?Yht(t):[],K=$.length,ct=$[0],yt=$[K-1],St=[];if(K>T)return Xht(t,St,$,K/T),St;const Ut=Kht($,t,T);if(K>0){let ne,pe;const me=K>1?Math.round((yt-ct)/(K-1)):null;for(q6(t,St,Ut,Rh(me)?0:ct-me,ct),ne=0,pe=K-1;neT)return yt}return Math.max(T,1)}function Yht(e){const t=[];let r,u;for(r=0,u=e.length;re==="left"?"right":e==="right"?"left":e,OR=(e,t,r)=>t==="top"||t==="left"?e[t]+r:e[t]-r,BR=(e,t)=>Math.min(t||e,e);function RR(e,t){const r=[],u=e.length/t,T=e.length;let $=0;for(;$K+ct)))return yt}function edt(e,t){cd(e,r=>{const u=r.gc,T=u.length/2;let $;if(T>t){for($=0;$u?u:r,u=T&&r>u?r:u,{min:fv(r,fv(u,r)),max:fv(u,fv(r,u))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Kd(this.options.beforeUpdate,[this])}update(t,r,u){const{beginAtZero:T,grace:$,ticks:K}=this.options,ct=K.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=r,this._margins=u=Object.assign({left:0,right:0,top:0,bottom:0},u),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+u.left+u.right:this.height+u.top+u.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=put(this,$,T),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const yt=ct=$||u<=1||!this.isHorizontal()){this.labelRotation=T;return}const Ut=this._getLabelSizes(),ne=Ut.widest.width,pe=Ut.highest.height,me=j0(this.chart.width-ne,0,this.maxWidth);ct=t.offset?this.maxWidth/u:me/(u-1),ne+6>ct&&(ct=me/(u-(t.offset?.5:1)),yt=this.maxHeight-N3(t.grid)-r.padding-FR(t.title,this.chart.options.font),St=Math.sqrt(ne*ne+pe*pe),K=Uct(Math.min(Math.asin(j0((Ut.highest.height+6)/ct,-1,1)),Math.asin(j0(yt/St,-1,1))-Math.asin(j0(pe/St,-1,1)))),K=Math.max(T,Math.min($,K))),this.labelRotation=K}afterCalculateLabelRotation(){Kd(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Kd(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:r,options:{ticks:u,title:T,grid:$}}=this,K=this._isVisible(),ct=this.isHorizontal();if(K){const yt=FR(T,r.options.font);if(ct?(t.width=this.maxWidth,t.height=N3($)+yt):(t.height=this.maxHeight,t.width=N3($)+yt),u.display&&this.ticks.length){const{first:St,last:Ut,widest:ne,highest:pe}=this._getLabelSizes(),me=u.padding*2,we=z1(this.labelRotation),Ce=Math.cos(we),Ve=Math.sin(we);if(ct){const kr=u.mirror?0:Ve*ne.width+Ce*pe.height;t.height=Math.min(this.maxHeight,t.height+kr+me)}else{const kr=u.mirror?0:Ce*ne.width+Ve*pe.height;t.width=Math.min(this.maxWidth,t.width+kr+me)}this._calculatePadding(St,Ut,Ve,Ce)}}this._handleMargins(),ct?(this.width=this._length=r.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=r.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,r,u,T){const{ticks:{align:$,padding:K},position:ct}=this.options,yt=this.labelRotation!==0,St=ct!=="top"&&this.axis==="x";if(this.isHorizontal()){const Ut=this.getPixelForTick(0)-this.left,ne=this.right-this.getPixelForTick(this.ticks.length-1);let pe=0,me=0;yt?St?(pe=T*t.width,me=u*r.height):(pe=u*t.height,me=T*r.width):$==="start"?me=r.width:$==="end"?pe=t.width:$!=="inner"&&(pe=t.width/2,me=r.width/2),this.paddingLeft=Math.max((pe-Ut+K)*this.width/(this.width-Ut),0),this.paddingRight=Math.max((me-ne+K)*this.width/(this.width-ne),0)}else{let Ut=r.height/2,ne=t.height/2;$==="start"?(Ut=0,ne=t.height):$==="end"&&(Ut=r.height,ne=0),this.paddingTop=Ut+K,this.paddingBottom=ne+K}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Kd(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:r}=this.options;return r==="top"||r==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let r,u;for(r=0,u=t.length;r({width:K[Br]||0,height:ct[Br]||0});return{first:Mn(0),last:Mn(r-1),widest:Mn(tn),highest:Mn(Dn),widths:K,heights:ct}}getLabelForValue(t){return t}getPixelForValue(t,r){return NaN}getValueForPixel(t){}getPixelForTick(t){const r=this.ticks;return t<0||t>r.length-1?null:this.getPixelForValue(r[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const r=this._startPixel+t*this._length;return Hct(this._alignToPixels?hx(this.chart,r,0):r)}getDecimalForPixel(t){const r=(t-this._startPixel)/this._length;return this._reversePixels?1-r:r}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:r}=this;return t<0&&r<0?r:t>0&&r>0?t:0}getContext(t){const r=this.ticks||[];if(t>=0&&tct*T?ct/u:yt/T:yt*T0}_computeGridLineItems(t){const r=this.axis,u=this.chart,T=this.options,{grid:$,position:K,border:ct}=T,yt=$.offset,St=this.isHorizontal(),ne=this.ticks.length+(yt?1:0),pe=N3($),me=[],we=ct.setContext(this.getContext()),Ce=we.display?we.width:0,Ve=Ce/2,kr=function(nn){return hx(u,nn,Ce)};let It,rn,Lr,Mr,tn,Dn,Mn,Br,Vn,on,pr,_r;if(K==="top")It=kr(this.bottom),Dn=this.bottom-pe,Br=It-Ve,on=kr(t.top)+Ve,_r=t.bottom;else if(K==="bottom")It=kr(this.top),on=t.top,_r=kr(t.bottom)-Ve,Dn=It+Ve,Br=this.top+pe;else if(K==="left")It=kr(this.right),tn=this.right-pe,Mn=It-Ve,Vn=kr(t.left)+Ve,pr=t.right;else if(K==="right")It=kr(this.left),Vn=t.left,pr=kr(t.right)-Ve,tn=It+Ve,Mn=this.left+pe;else if(r==="x"){if(K==="center")It=kr((t.top+t.bottom)/2+.5);else if(Uu(K)){const nn=Object.keys(K)[0],Cn=K[nn];It=kr(this.chart.scales[nn].getPixelForValue(Cn))}on=t.top,_r=t.bottom,Dn=It+Ve,Br=Dn+pe}else if(r==="y"){if(K==="center")It=kr((t.left+t.right)/2);else if(Uu(K)){const nn=Object.keys(K)[0],Cn=K[nn];It=kr(this.chart.scales[nn].getPixelForValue(Cn))}tn=It-Ve,Mn=tn-pe,Vn=t.left,pr=t.right}const Sr=_u(T.ticks.maxTicksLimit,ne),Dr=Math.max(1,Math.ceil(ne/Sr));for(rn=0;rn0&&(Yn-=Bi/2);break}va={left:Yn,top:Xi,width:Bi+_a.width,height:qi+_a.height,color:Dr.backdropColor}}Ve.push({label:Lr,font:Br,textOffset:pr,options:{rotation:Ce,color:Cn,strokeColor:Xn,strokeWidth:_i,textAlign:ta,textBaseline:_r,translation:[Mr,tn],backdrop:va}})}return Ve}_getXAxisLabelAlignment(){const{position:t,ticks:r}=this.options;if(-z1(this.labelRotation))return t==="top"?"left":"right";let T="center";return r.align==="start"?T="left":r.align==="end"?T="right":r.align==="inner"&&(T="inner"),T}_getYAxisLabelAlignment(t){const{position:r,ticks:{crossAlign:u,mirror:T,padding:$}}=this.options,K=this._getLabelSizes(),ct=t+$,yt=K.widest.width;let St,Ut;return r==="left"?T?(Ut=this.right+$,u==="near"?St="left":u==="center"?(St="center",Ut+=yt/2):(St="right",Ut+=yt)):(Ut=this.right-ct,u==="near"?St="right":u==="center"?(St="center",Ut-=yt/2):(St="left",Ut=this.left)):r==="right"?T?(Ut=this.left+$,u==="near"?St="right":u==="center"?(St="center",Ut-=yt/2):(St="left",Ut-=yt)):(Ut=this.left+ct,u==="near"?St="left":u==="center"?(St="center",Ut+=yt/2):(St="right",Ut=this.right)):St="right",{textAlign:St,x:Ut}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,r=this.options.position;if(r==="left"||r==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(r==="top"||r==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:r},left:u,top:T,width:$,height:K}=this;r&&(t.save(),t.fillStyle=r,t.fillRect(u,T,$,K),t.restore())}getLineWidthForValue(t){const r=this.options.grid;if(!this._isVisible()||!r.display)return 0;const T=this.ticks.findIndex($=>$.value===t);return T>=0?r.setContext(this.getContext(T)).lineWidth:0}drawGrid(t){const r=this.options.grid,u=this.ctx,T=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let $,K;const ct=(yt,St,Ut)=>{!Ut.width||!Ut.color||(u.save(),u.lineWidth=Ut.width,u.strokeStyle=Ut.color,u.setLineDash(Ut.borderDash||[]),u.lineDashOffset=Ut.borderDashOffset,u.beginPath(),u.moveTo(yt.x,yt.y),u.lineTo(St.x,St.y),u.stroke(),u.restore())};if(r.display)for($=0,K=T.length;${this.draw($)}}]:[{z:u,draw:$=>{this.drawBackground(),this.drawGrid($),this.drawTitle()}},{z:T,draw:()=>{this.drawBorder()}},{z:r,draw:$=>{this.drawLabels($)}}]}getMatchingVisibleMetas(t){const r=this.chart.getSortedVisibleDatasetMetas(),u=this.axis+"AxisID",T=[];let $,K;for($=0,K=r.length;${const u=r.split("."),T=u.pop(),$=[e].concat(u).join("."),K=t[r].split("."),ct=K.pop(),yt=K.join(".");lp.route($,T,yt,ct)})}function ldt(e){return"id"in e&&"defaults"in e}class cdt{constructor(){this.controllers=new G6(c4,"datasets",!0),this.elements=new G6(G1,"elements"),this.plugins=new G6(Object,"plugins"),this.scales=new G6(X2,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,r,u){[...r].forEach(T=>{const $=u||this._getRegistryForType(T);u||$.isForType(T)||$===this.plugins&&T.id?this._exec(t,$,T):cd(T,K=>{const ct=u||this._getRegistryForType(K);this._exec(t,ct,K)})})}_exec(t,r,u){const T=VE(t);Kd(u["before"+T],[],u),r[t](u),Kd(u["after"+T],[],u)}_getRegistryForType(t){for(let r=0;r$.filter(ct=>!K.some(yt=>ct.plugin.id===yt.plugin.id));this._notify(T(r,u),t,"stop"),this._notify(T(u,r),t,"start")}}function hdt(e){const t={},r=[],u=Object.keys(bv.plugins.items);for(let $=0;$1&&NR(e[0].toLowerCase());if(u)return u}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function jR(e,t,r){if(r[t+"AxisID"]===e)return{axis:t}}function ydt(e,t){if(t.data&&t.data.datasets){const r=t.data.datasets.filter(u=>u.xAxisID===e||u.yAxisID===e);if(r.length)return jR(e,"x",r[0])||jR(e,"y",r[0])}return{}}function _dt(e,t){const r=$x[e.type]||{scales:{}},u=t.scales||{},T=c9(e.type,t),$=Object.create(null);return Object.keys(u).forEach(K=>{const ct=u[K];if(!Uu(ct))return console.error(`Invalid scale configuration for scale: ${K}`);if(ct._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${K}`);const yt=u9(K,ct,ydt(K,e),lp.scales[ct.type]),St=gdt(yt,T),Ut=r.scales||{};$[K]=C5(Object.create(null),[{axis:yt},ct,Ut[yt],Ut[St]])}),e.data.datasets.forEach(K=>{const ct=K.type||e.type,yt=K.indexAxis||c9(ct,t),Ut=($x[ct]||{}).scales||{};Object.keys(Ut).forEach(ne=>{const pe=mdt(ne,yt),me=K[pe+"AxisID"]||pe;$[me]=$[me]||Object.create(null),C5($[me],[{axis:pe},u[me],Ut[ne]])})}),Object.keys($).forEach(K=>{const ct=$[K];C5(ct,[lp.scales[ct.type],lp.scale])}),$}function eH(e){const t=e.options||(e.options={});t.plugins=_u(t.plugins,{}),t.scales=_dt(e,t)}function rH(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function xdt(e){return e=e||{},e.data=rH(e.data),eH(e),e}const UR=new Map,nH=new Set;function Z6(e,t){let r=UR.get(e);return r||(r=t(),UR.set(e,r),nH.add(r)),r}const j3=(e,t,r)=>{const u=Ux(t,r);u!==void 0&&e.add(u)};class bdt{constructor(t){this._config=xdt(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=rH(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),eH(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Z6(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,r){return Z6(`${t}.transition.${r}`,()=>[[`datasets.${t}.transitions.${r}`,`transitions.${r}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,r){return Z6(`${t}-${r}`,()=>[[`datasets.${t}.elements.${r}`,`datasets.${t}`,`elements.${r}`,""]])}pluginScopeKeys(t){const r=t.id,u=this.type;return Z6(`${u}-plugin-${r}`,()=>[[`plugins.${r}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,r){const u=this._scopeCache;let T=u.get(t);return(!T||r)&&(T=new Map,u.set(t,T)),T}getOptionScopes(t,r,u){const{options:T,type:$}=this,K=this._cachedScopes(t,u),ct=K.get(r);if(ct)return ct;const yt=new Set;r.forEach(Ut=>{t&&(yt.add(t),Ut.forEach(ne=>j3(yt,t,ne))),Ut.forEach(ne=>j3(yt,T,ne)),Ut.forEach(ne=>j3(yt,$x[$]||{},ne)),Ut.forEach(ne=>j3(yt,lp,ne)),Ut.forEach(ne=>j3(yt,s9,ne))});const St=Array.from(yt);return St.length===0&&St.push(Object.create(null)),nH.has(r)&&K.set(r,St),St}chartOptionScopes(){const{options:t,type:r}=this;return[t,$x[r]||{},lp.datasets[r]||{},{type:r},lp,s9]}resolveNamedOptions(t,r,u,T=[""]){const $={$shared:!0},{resolver:K,subPrefixes:ct}=$R(this._resolverCache,t,T);let yt=K;if(kdt(K,r)){$.$shared=!1,u=__(u)?u():u;const St=this.createResolver(t,u,ct);yt=V2(K,u,St)}for(const St of r)$[St]=yt[St];return $}createResolver(t,r,u=[""],T){const{resolver:$}=$R(this._resolverCache,t,u);return Uu(r)?V2($,r,void 0,T):$}}function $R(e,t,r){let u=e.get(t);u||(u=new Map,e.set(t,u));const T=r.join();let $=u.get(T);return $||($={resolver:YE(t,r),subPrefixes:r.filter(ct=>!ct.toLowerCase().includes("hover"))},u.set(T,$)),$}const wdt=e=>Uu(e)&&Object.getOwnPropertyNames(e).some(t=>__(e[t]));function kdt(e,t){const{isScriptable:r,isIndexable:u}=D$(e);for(const T of t){const $=r(T),K=u(T),ct=(K||$)&&e[T];if($&&(__(ct)||wdt(ct))||K&&Tp(ct))return!0}return!1}var Tdt="4.5.1";const Sdt=["top","bottom","left","right","chartArea"];function HR(e,t){return e==="top"||e==="bottom"||Sdt.indexOf(e)===-1&&t==="x"}function VR(e,t){return function(r,u){return r[e]===u[e]?r[t]-u[t]:r[e]-u[e]}}function WR(e){const t=e.chart,r=t.options.animation;t.notifyPlugins("afterRender"),Kd(r&&r.onComplete,[e],t)}function Cdt(e){const t=e.chart,r=t.options.animation;Kd(r&&r.onProgress,[e],t)}function iH(e){return QE()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ST={},qR=e=>{const t=iH(e);return Object.values(ST).filter(r=>r.canvas===t).pop()};function Adt(e,t,r){const u=Object.keys(e);for(const T of u){const $=+T;if($>=t){const K=e[T];delete e[T],(r>0||$>t)&&(e[$+r]=K)}}}function Mdt(e,t,r,u){return!r||e.type==="mouseout"?null:u?t:e}class Av{static defaults=lp;static instances=ST;static overrides=$x;static registry=bv;static version=Tdt;static getChart=qR;static register(...t){bv.add(...t),GR()}static unregister(...t){bv.remove(...t),GR()}constructor(t,r){const u=this.config=new bdt(r),T=iH(t),$=qR(T);if($)throw new Error("Canvas is already in use. Chart with ID '"+$.id+"' must be destroyed before the canvas with ID '"+$.canvas.id+"' can be reused.");const K=u.createResolver(u.chartOptionScopes(),this.getContext());this.platform=new(u.platform||qht(T)),this.platform.updateConfig(u);const ct=this.platform.acquireContext(T,K.aspectRatio),yt=ct&&ct.canvas,St=yt&&yt.height,Ut=yt&&yt.width;if(this.id=Mct(),this.ctx=ct,this.canvas=yt,this.width=Ut,this.height=St,this._options=K,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new udt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Gct(ne=>this.update(ne),K.resizeDelay||0),this._dataChanges=[],ST[this.id]=this,!ct||!yt){console.error("Failed to create chart: can't acquire context from the given item");return}k1.listen(this,"complete",WR),k1.listen(this,"progress",Cdt),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:r},width:u,height:T,_aspectRatio:$}=this;return Rh(t)?r&&$?$:T?u/T:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return bv}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():mR(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return dR(this.canvas,this.ctx),this}stop(){return k1.stop(this),this}resize(t,r){k1.running(this)?this._resizeBeforeDraw={width:t,height:r}:this._resize(t,r)}_resize(t,r){const u=this.options,T=this.canvas,$=u.maintainAspectRatio&&this.aspectRatio,K=this.platform.getMaximumSize(T,t,r,$),ct=u.devicePixelRatio||this.platform.getDevicePixelRatio(),yt=this.width?"resize":"attach";this.width=K.width,this.height=K.height,this._aspectRatio=this.aspectRatio,mR(this,ct,!0)&&(this.notifyPlugins("resize",{size:K}),Kd(u.onResize,[this,K],this),this.attached&&this._doResize(yt)&&this.render())}ensureScalesHaveIDs(){const r=this.options.scales||{};cd(r,(u,T)=>{u.id=T})}buildOrUpdateScales(){const t=this.options,r=t.scales,u=this.scales,T=Object.keys(u).reduce((K,ct)=>(K[ct]=!1,K),{});let $=[];r&&($=$.concat(Object.keys(r).map(K=>{const ct=r[K],yt=u9(K,ct),St=yt==="r",Ut=yt==="x";return{options:ct,dposition:St?"chartArea":Ut?"bottom":"left",dtype:St?"radialLinear":Ut?"category":"linear"}}))),cd($,K=>{const ct=K.options,yt=ct.id,St=u9(yt,ct),Ut=_u(ct.type,K.dtype);(ct.position===void 0||HR(ct.position,St)!==HR(K.dposition))&&(ct.position=K.dposition),T[yt]=!0;let ne=null;if(yt in u&&u[yt].type===Ut)ne=u[yt];else{const pe=bv.getScale(Ut);ne=new pe({id:yt,type:Ut,ctx:this.ctx,chart:this}),u[ne.id]=ne}ne.init(ct,t)}),cd(T,(K,ct)=>{K||delete u[ct]}),cd(u,K=>{vg.configure(this,K,K.options),vg.addBox(this,K)})}_updateMetasets(){const t=this._metasets,r=this.data.datasets.length,u=t.length;if(t.sort((T,$)=>T.index-$.index),u>r){for(let T=r;Tr.length&&delete this._stacks,t.forEach((u,T)=>{r.filter($=>$===u._dataset).length===0&&this._destroyDatasetMeta(T)})}buildOrUpdateControllers(){const t=[],r=this.data.datasets;let u,T;for(this._removeUnreferencedMetasets(),u=0,T=r.length;u{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const r=this.config;r.update();const u=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),T=this._animationsDisabled=!u.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const $=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let K=0;for(let St=0,Ut=this.data.datasets.length;St{St.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(VR("z","_idx"));const{_active:ct,_lastEvent:yt}=this;yt?this._eventHandler(yt,!0):ct.length&&this._updateHoverStyles(ct,ct,!0),this.render()}_updateScales(){cd(this.scales,t=>{vg.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,r=new Set(Object.keys(this._listeners)),u=new Set(t.events);(!rR(r,u)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,r=this._getUniformDataChanges()||[];for(const{method:u,start:T,count:$}of r){const K=u==="_removeElements"?-$:$;Adt(t,T,K)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const r=this.data.datasets.length,u=$=>new Set(t.filter(K=>K[0]===$).map((K,ct)=>ct+","+K.splice(1).join(","))),T=u(0);for(let $=1;$$.split(",")).map($=>({method:$[1],start:+$[2],count:+$[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vg.update(this,this.width,this.height,t);const r=this.chartArea,u=r.width<=0||r.height<=0;this._layers=[],cd(this.boxes,T=>{u&&T.position==="chartArea"||(T.configure&&T.configure(),this._layers.push(...T._layers()))},this),this._layers.forEach((T,$)=>{T._idx=$}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let r=0,u=this.data.datasets.length;r=0;--r)this._drawDataset(t[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const r=this.ctx,u={meta:t,index:t.index,cancelable:!0},T=H$(this,t);this.notifyPlugins("beforeDatasetDraw",u)!==!1&&(T&&HS(r,T),t.controller.draw(),T&&VS(r),u.cancelable=!1,this.notifyPlugins("afterDatasetDraw",u))}isPointInArea(t){return G5(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,r,u,T){const $=Sht.modes[r];return typeof $=="function"?$(this,t,u,T):[]}getDatasetMeta(t){const r=this.data.datasets[t],u=this._metasets;let T=u.filter($=>$&&$._dataset===r).pop();return T||(T={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:t,_dataset:r,_parsed:[],_sorted:!1},u.push(T)),T}getContext(){return this.$context||(this.$context=qx(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const r=this.data.datasets[t];if(!r)return!1;const u=this.getDatasetMeta(t);return typeof u.hidden=="boolean"?!u.hidden:!r.hidden}setDatasetVisibility(t,r){const u=this.getDatasetMeta(t);u.hidden=!r}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,r,u){const T=u?"show":"hide",$=this.getDatasetMeta(t),K=$.controller._resolveAnimations(void 0,T);W5(r)?($.data[r].hidden=!u,this.update()):(this.setDatasetVisibility(t,u),K.update($,{visible:u}),this.update(ct=>ct.datasetIndex===t?T:void 0))}hide(t,r){this._updateVisibility(t,r,!1)}show(t,r){this._updateVisibility(t,r,!0)}_destroyDatasetMeta(t){const r=this._metasets[t];r&&r.controller&&r.controller._destroy(),delete this._metasets[t]}_stop(){let t,r;for(this.stop(),k1.remove(this),t=0,r=this.data.datasets.length;t{r.addEventListener(this,$,K),t[$]=K},T=($,K,ct)=>{$.offsetX=K,$.offsetY=ct,this._eventHandler($)};cd(this.options.events,$=>u($,T))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,r=this.platform,u=(yt,St)=>{r.addEventListener(this,yt,St),t[yt]=St},T=(yt,St)=>{t[yt]&&(r.removeEventListener(this,yt,St),delete t[yt])},$=(yt,St)=>{this.canvas&&this.resize(yt,St)};let K;const ct=()=>{T("attach",ct),this.attached=!0,this.resize(),u("resize",$),u("detach",K)};K=()=>{this.attached=!1,T("resize",$),this._stop(),this._resize(0,0),u("attach",ct)},r.isAttached(this.canvas)?ct():K()}unbindEvents(){cd(this._listeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._listeners={},cd(this._responsiveListeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,r,u){const T=u?"set":"remove";let $,K,ct,yt;for(r==="dataset"&&($=this.getDatasetMeta(t[0].datasetIndex),$.controller["_"+T+"DatasetHoverStyle"]()),ct=0,yt=t.length;ct{const ct=this.getDatasetMeta($);if(!ct)throw new Error("No dataset found at index "+$);return{datasetIndex:$,element:ct.data[K],index:K}});!XT(u,r)&&(this._active=u,this._lastEvent=null,this._updateHoverStyles(u,r))}notifyPlugins(t,r,u){return this._plugins.notify(this,t,r,u)}isPluginEnabled(t){return this._plugins._cache.filter(r=>r.plugin.id===t).length===1}_updateHoverStyles(t,r,u){const T=this.options.hover,$=(yt,St)=>yt.filter(Ut=>!St.some(ne=>Ut.datasetIndex===ne.datasetIndex&&Ut.index===ne.index)),K=$(r,t),ct=u?t:$(t,r);K.length&&this.updateHoverStyle(K,T.mode,!1),ct.length&&T.mode&&this.updateHoverStyle(ct,T.mode,!0)}_eventHandler(t,r){const u={event:t,replay:r,cancelable:!0,inChartArea:this.isPointInArea(t)},T=K=>(K.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",u,T)===!1)return;const $=this._handleEvent(t,r,u.inChartArea);return u.cancelable=!1,this.notifyPlugins("afterEvent",u,T),($||u.changed)&&this.render(),this}_handleEvent(t,r,u){const{_active:T=[],options:$}=this,K=r,ct=this._getActiveElements(t,T,u,K),yt=zct(t),St=Mdt(t,this._lastEvent,u,yt);u&&(this._lastEvent=null,Kd($.onHover,[t,ct,this],this),yt&&Kd($.onClick,[t,ct,this],this));const Ut=!XT(ct,T);return(Ut||r)&&(this._active=ct,this._updateHoverStyles(ct,T,r)),this._lastEvent=St,Ut}_getActiveElements(t,r,u,T){if(t.type==="mouseout")return[];if(!u)return r;const $=this.options.hover;return this.getElementsAtEventForMode(t,$.mode,$,T)}}function GR(){return cd(Av.instances,e=>e._plugins.invalidate())}function Edt(e,t,r){const{startAngle:u,x:T,y:$,outerRadius:K,innerRadius:ct,options:yt}=t,{borderWidth:St,borderJoinStyle:Ut}=yt,ne=Math.min(St/K,Gm(u-r));if(e.beginPath(),e.arc(T,$,K-St/2,u+ne/2,r-ne/2),ct>0){const pe=Math.min(St/ct,Gm(u-r));e.arc(T,$,ct+St/2,r-pe/2,u+pe/2,!0)}else{const pe=Math.min(St/2,K*Gm(u-r));if(Ut==="round")e.arc(T,$,pe,r-ud/2,u+ud/2,!0);else if(Ut==="bevel"){const me=2*pe*pe,we=-me*Math.cos(r+ud/2)+T,Ce=-me*Math.sin(r+ud/2)+$,Ve=me*Math.cos(u+ud/2)+T,kr=me*Math.sin(u+ud/2)+$;e.lineTo(we,Ce),e.lineTo(Ve,kr)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ldt(e,t,r){const{startAngle:u,pixelMargin:T,x:$,y:K,outerRadius:ct,innerRadius:yt}=t;let St=T/ct;e.beginPath(),e.arc($,K,ct,u-St,r+St),yt>T?(St=T/yt,e.arc($,K,yt,r+St,u-St,!0)):e.arc($,K,T,r+Bp,u-Bp),e.closePath(),e.clip()}function Pdt(e){return KE(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Idt(e,t,r,u){const T=Pdt(e.options.borderRadius),$=(r-t)/2,K=Math.min($,u*t/2),ct=yt=>{const St=(r-Math.min($,yt))*u/2;return j0(yt,0,Math.min($,St))};return{outerStart:ct(T.outerStart),outerEnd:ct(T.outerEnd),innerStart:j0(T.innerStart,0,K),innerEnd:j0(T.innerEnd,0,K)}}function g2(e,t,r,u){return{x:r+e*Math.cos(t),y:u+e*Math.sin(t)}}function nS(e,t,r,u,T,$){const{x:K,y:ct,startAngle:yt,pixelMargin:St,innerRadius:Ut}=t,ne=Math.max(t.outerRadius+u+r-St,0),pe=Ut>0?Ut+u+r+St:0;let me=0;const we=T-yt;if(u){const Dr=Ut>0?Ut-u:0,nn=ne>0?ne-u:0,Cn=(Dr+nn)/2,Xn=Cn!==0?we*Cn/(Cn+u):we;me=(we-Xn)/2}const Ce=Math.max(.001,we*ne-r/ud)/ne,Ve=(we-Ce)/2,kr=yt+Ve+me,It=T-Ve-me,{outerStart:rn,outerEnd:Lr,innerStart:Mr,innerEnd:tn}=Idt(t,pe,ne,It-kr),Dn=ne-rn,Mn=ne-Lr,Br=kr+rn/Dn,Vn=It-Lr/Mn,on=pe+Mr,pr=pe+tn,_r=kr+Mr/on,Sr=It-tn/pr;if(e.beginPath(),$){const Dr=(Br+Vn)/2;if(e.arc(K,ct,ne,Br,Dr),e.arc(K,ct,ne,Dr,Vn),Lr>0){const _i=g2(Mn,Vn,K,ct);e.arc(_i.x,_i.y,Lr,Vn,It+Bp)}const nn=g2(pr,It,K,ct);if(e.lineTo(nn.x,nn.y),tn>0){const _i=g2(pr,Sr,K,ct);e.arc(_i.x,_i.y,tn,It+Bp,Sr+Math.PI)}const Cn=(It-tn/pe+(kr+Mr/pe))/2;if(e.arc(K,ct,pe,It-tn/pe,Cn,!0),e.arc(K,ct,pe,Cn,kr+Mr/pe,!0),Mr>0){const _i=g2(on,_r,K,ct);e.arc(_i.x,_i.y,Mr,_r+Math.PI,kr-Bp)}const Xn=g2(Dn,kr,K,ct);if(e.lineTo(Xn.x,Xn.y),rn>0){const _i=g2(Dn,Br,K,ct);e.arc(_i.x,_i.y,rn,kr-Bp,Br)}}else{e.moveTo(K,ct);const Dr=Math.cos(Br)*ne+K,nn=Math.sin(Br)*ne+ct;e.lineTo(Dr,nn);const Cn=Math.cos(Vn)*ne+K,Xn=Math.sin(Vn)*ne+ct;e.lineTo(Cn,Xn)}e.closePath()}function Ddt(e,t,r,u,T){const{fullCircles:$,startAngle:K,circumference:ct}=t;let yt=t.endAngle;if($){nS(e,t,r,u,yt,T);for(let St=0;St<$;++St)e.fill();isNaN(ct)||(yt=K+(ct%Cf||Cf))}return nS(e,t,r,u,yt,T),e.fill(),yt}function zdt(e,t,r,u,T){const{fullCircles:$,startAngle:K,circumference:ct,options:yt}=t,{borderWidth:St,borderJoinStyle:Ut,borderDash:ne,borderDashOffset:pe,borderRadius:me}=yt,we=yt.borderAlign==="inner";if(!St)return;e.setLineDash(ne||[]),e.lineDashOffset=pe,we?(e.lineWidth=St*2,e.lineJoin=Ut||"round"):(e.lineWidth=St,e.lineJoin=Ut||"bevel");let Ce=t.endAngle;if($){nS(e,t,r,u,Ce,T);for(let Ve=0;Ve<$;++Ve)e.stroke();isNaN(ct)||(Ce=K+(ct%Cf||Cf))}we&&Ldt(e,t,Ce),yt.selfJoin&&Ce-K>=ud&&me===0&&Ut!=="miter"&&Edt(e,t,Ce),$||(nS(e,t,r,u,Ce,T),e.stroke())}class aH extends G1{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,r,u){const T=this.getProps(["x","y"],u),{angle:$,distance:K}=k$(T,{x:t,y:r}),{startAngle:ct,endAngle:yt,innerRadius:St,outerRadius:Ut,circumference:ne}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],u),pe=(this.options.spacing+this.options.borderWidth)/2,me=_u(ne,yt-ct),we=q5($,ct,yt)&&ct!==yt,Ce=me>=Cf||we,Ve=O1(K,St+pe,Ut+pe);return Ce&&Ve}getCenterPoint(t){const{x:r,y:u,startAngle:T,endAngle:$,innerRadius:K,outerRadius:ct}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:yt,spacing:St}=this.options,Ut=(T+$)/2,ne=(K+ct+St+yt)/2;return{x:r+Math.cos(Ut)*ne,y:u+Math.sin(Ut)*ne}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:r,circumference:u}=this,T=(r.offset||0)/4,$=(r.spacing||0)/2,K=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=u>Cf?Math.floor(u/Cf):0,u===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const ct=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(ct)*T,Math.sin(ct)*T);const yt=1-Math.sin(Math.min(ud,u||0)),St=T*yt;t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,Ddt(t,this,St,$,K),zdt(t,this,St,$,K),t.restore()}}function oH(e,t,r=t){e.lineCap=_u(r.borderCapStyle,t.borderCapStyle),e.setLineDash(_u(r.borderDash,t.borderDash)),e.lineDashOffset=_u(r.borderDashOffset,t.borderDashOffset),e.lineJoin=_u(r.borderJoinStyle,t.borderJoinStyle),e.lineWidth=_u(r.borderWidth,t.borderWidth),e.strokeStyle=_u(r.borderColor,t.borderColor)}function Odt(e,t,r){e.lineTo(r.x,r.y)}function Bdt(e){return e.stepped?aut:e.tension||e.cubicInterpolationMode==="monotone"?out:Odt}function sH(e,t,r={}){const u=e.length,{start:T=0,end:$=u-1}=r,{start:K,end:ct}=t,yt=Math.max(T,K),St=Math.min($,ct),Ut=Tct&&$>ct;return{count:u,start:yt,loop:t.loop,ilen:St(K+(St?ct-Lr:Lr))%$,rn=()=>{Ce!==Ve&&(e.lineTo(Ut,Ve),e.lineTo(Ut,Ce),e.lineTo(Ut,kr))};for(yt&&(me=T[It(0)],e.moveTo(me.x,me.y)),pe=0;pe<=ct;++pe){if(me=T[It(pe)],me.skip)continue;const Lr=me.x,Mr=me.y,tn=Lr|0;tn===we?(MrVe&&(Ve=Mr),Ut=(ne*Ut+Lr)/++ne):(rn(),e.lineTo(Lr,Mr),we=tn,ne=0,Ce=Ve=Mr),kr=Mr}rn()}function h9(e){const t=e.options,r=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!r?Fdt:Rdt}function Ndt(e){return e.stepped?Fut:e.tension||e.cubicInterpolationMode==="monotone"?Nut:_x}function jdt(e,t,r,u){let T=t._path;T||(T=t._path=new Path2D,t.path(T,r,u)&&T.closePath()),oH(e,t.options),e.stroke(T)}function Udt(e,t,r,u){const{segments:T,options:$}=t,K=h9(t);for(const ct of T)oH(e,$,ct.style),e.beginPath(),K(e,t,ct,{start:r,end:r+u-1})&&e.closePath(),e.stroke()}const $dt=typeof Path2D=="function";function Hdt(e,t,r,u){$dt&&!t.options.segment?jdt(e,t,r,u):Udt(e,t,r,u)}class J2 extends G1{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,r){const u=this.options;if((u.tension||u.cubicInterpolationMode==="monotone")&&!u.stepped&&!this._pointsUpdated){const T=u.spanGaps?this._loop:this._fullLoop;Lut(this._points,u,t,T,r),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Wut(this,this.options.segment))}first(){const t=this.segments,r=this.points;return t.length&&r[t[0].start]}last(){const t=this.segments,r=this.points,u=t.length;return u&&r[t[u-1].end]}interpolate(t,r){const u=this.options,T=t[r],$=this.points,K=$$(this,{property:r,start:T,end:T});if(!K.length)return;const ct=[],yt=Ndt(u);let St,Ut;for(St=0,Ut=K.length;St{ct=GS(K,ct,T);const yt=T[K],St=T[ct];u!==null?($.push({x:yt.x,y:u}),$.push({x:St.x,y:u})):r!==null&&($.push({x:r,y:yt.y}),$.push({x:r,y:St.y}))}),$}function GS(e,t,r){for(;t>e;t--){const u=r[t];if(!isNaN(u.x)&&!isNaN(u.y))break}return t}function KR(e,t,r,u){return e&&t?u(e[r],t[r]):e?e[r]:t?t[r]:0}function uH(e,t){let r=[],u=!1;return Tp(e)?(u=!0,r=e):r=Ydt(e,t),r.length?new J2({points:r,options:{tension:0},_loop:u,_fullLoop:u}):null}function YR(e){return e&&e.fill!==!1}function Xdt(e,t,r){let T=e[t].fill;const $=[t];let K;if(!r)return T;for(;T!==!1&&$.indexOf(T)===-1;){if(!$0(T))return T;if(K=e[T],!K)return!1;if(K.visible)return T;$.push(T),T=K.fill}return!1}function Jdt(e,t,r){const u=rft(e);if(Uu(u))return isNaN(u.value)?!1:u;let T=parseFloat(u);return $0(T)&&Math.floor(T)===T?Qdt(u[0],t,T,r):["origin","start","end","stack","shape"].indexOf(u)>=0&&u}function Qdt(e,t,r,u){return(e==="-"||e==="+")&&(r=t+r),r===t||r<0||r>=u?!1:r}function tft(e,t){let r=null;return e==="start"?r=t.bottom:e==="end"?r=t.top:Uu(e)?r=t.getPixelForValue(e.value):t.getBasePixel&&(r=t.getBasePixel()),r}function eft(e,t,r){let u;return e==="start"?u=r:e==="end"?u=t.options.reverse?t.min:t.max:Uu(e)?u=e.value:u=t.getBaseValue(),u}function rft(e){const t=e.options,r=t.fill;let u=_u(r&&r.target,r);return u===void 0&&(u=!!t.backgroundColor),u===!1||u===null?!1:u===!0?"origin":u}function nft(e){const{scale:t,index:r,line:u}=e,T=[],$=u.segments,K=u.points,ct=ift(t,r);ct.push(uH({x:null,y:t.bottom},u));for(let yt=0;yt<$.length;yt++){const St=$[yt];for(let Ut=St.start;Ut<=St.end;Ut++)aft(T,K[Ut],ct)}return new J2({points:T,options:{}})}function ift(e,t){const r=[],u=e.getMatchingVisibleMetas("line");for(let T=0;T=0;--K){const ct=T[K].$filler;ct&&(ct.line.updateControlPoints($,ct.axis),u&&ct.fill&&G7(e.ctx,ct,$))}},beforeDatasetsDraw(e,t,r){if(r.drawTime!=="beforeDatasetsDraw")return;const u=e.getSortedVisibleDatasetMetas();for(let T=u.length-1;T>=0;--T){const $=u[T].$filler;YR($)&&G7(e.ctx,$,e.chartArea)}},beforeDatasetDraw(e,t,r){const u=t.meta.$filler;!YR(u)||r.drawTime!=="beforeDatasetDraw"||G7(e.ctx,u,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const tF=(e,t)=>{let{boxHeight:r=t,boxWidth:u=t}=e;return e.usePointStyle&&(r=Math.min(r,t),u=e.pointStyleWidth||Math.min(u,t)),{boxWidth:u,boxHeight:r,itemHeight:Math.max(t,r)}},pft=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class eF extends G1{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,r,u){this.maxWidth=t,this.maxHeight=r,this._margins=u,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let r=Kd(t.generateLabels,[this.chart],this)||[];t.filter&&(r=r.filter(u=>t.filter(u,this.chart.data))),t.sort&&(r=r.sort((u,T)=>t.sort(u,T,this.chart.data))),this.options.reverse&&r.reverse(),this.legendItems=r}fit(){const{options:t,ctx:r}=this;if(!t.display){this.width=this.height=0;return}const u=t.labels,T=U0(u.font),$=T.size,K=this._computeTitleHeight(),{boxWidth:ct,itemHeight:yt}=tF(u,$);let St,Ut;r.font=T.string,this.isHorizontal()?(St=this.maxWidth,Ut=this._fitRows(K,$,ct,yt)+10):(Ut=this.maxHeight,St=this._fitCols(K,T,ct,yt)+10),this.width=Math.min(St,t.maxWidth||this.maxWidth),this.height=Math.min(Ut,t.maxHeight||this.maxHeight)}_fitRows(t,r,u,T){const{ctx:$,maxWidth:K,options:{labels:{padding:ct}}}=this,yt=this.legendHitBoxes=[],St=this.lineWidths=[0],Ut=T+ct;let ne=t;$.textAlign="left",$.textBaseline="middle";let pe=-1,me=-Ut;return this.legendItems.forEach((we,Ce)=>{const Ve=u+r/2+$.measureText(we.text).width;(Ce===0||St[St.length-1]+Ve+2*ct>K)&&(ne+=Ut,St[St.length-(Ce>0?0:1)]=0,me+=Ut,pe++),yt[Ce]={left:0,top:me,row:pe,width:Ve,height:T},St[St.length-1]+=Ve+ct}),ne}_fitCols(t,r,u,T){const{ctx:$,maxHeight:K,options:{labels:{padding:ct}}}=this,yt=this.legendHitBoxes=[],St=this.columnSizes=[],Ut=K-t;let ne=ct,pe=0,me=0,we=0,Ce=0;return this.legendItems.forEach((Ve,kr)=>{const{itemWidth:It,itemHeight:rn}=mft(u,r,$,Ve,T);kr>0&&me+rn+2*ct>Ut&&(ne+=pe+ct,St.push({width:pe,height:me}),we+=pe+ct,Ce++,pe=me=0),yt[kr]={left:we,top:me,col:Ce,width:It,height:rn},pe=Math.max(pe,It),me+=rn+ct}),ne+=pe,St.push({width:pe,height:me}),ne}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:r,options:{align:u,labels:{padding:T},rtl:$}}=this,K=z2($,this.left,this.width);if(this.isHorizontal()){let ct=0,yt=z0(u,this.left+T,this.right-this.lineWidths[ct]);for(const St of r)ct!==St.row&&(ct=St.row,yt=z0(u,this.left+T,this.right-this.lineWidths[ct])),St.top+=this.top+t+T,St.left=K.leftForLtr(K.x(yt),St.width),yt+=St.width+T}else{let ct=0,yt=z0(u,this.top+t+T,this.bottom-this.columnSizes[ct].height);for(const St of r)St.col!==ct&&(ct=St.col,yt=z0(u,this.top+t+T,this.bottom-this.columnSizes[ct].height)),St.top=yt,St.left+=this.left+T,St.left=K.leftForLtr(K.x(St.left),St.width),yt+=St.height+T}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;HS(t,this),this._draw(),VS(t)}}_draw(){const{options:t,columnSizes:r,lineWidths:u,ctx:T}=this,{align:$,labels:K}=t,ct=lp.color,yt=z2(t.rtl,this.left,this.width),St=U0(K.font),{padding:Ut}=K,ne=St.size,pe=ne/2;let me;this.drawTitle(),T.textAlign=yt.textAlign("left"),T.textBaseline="middle",T.lineWidth=.5,T.font=St.string;const{boxWidth:we,boxHeight:Ce,itemHeight:Ve}=tF(K,ne),kr=function(tn,Dn,Mn){if(isNaN(we)||we<=0||isNaN(Ce)||Ce<0)return;T.save();const Br=_u(Mn.lineWidth,1);if(T.fillStyle=_u(Mn.fillStyle,ct),T.lineCap=_u(Mn.lineCap,"butt"),T.lineDashOffset=_u(Mn.lineDashOffset,0),T.lineJoin=_u(Mn.lineJoin,"miter"),T.lineWidth=Br,T.strokeStyle=_u(Mn.strokeStyle,ct),T.setLineDash(_u(Mn.lineDash,[])),K.usePointStyle){const Vn={radius:Ce*Math.SQRT2/2,pointStyle:Mn.pointStyle,rotation:Mn.rotation,borderWidth:Br},on=yt.xPlus(tn,we/2),pr=Dn+pe;P$(T,Vn,on,pr,K.pointStyleWidth&&we)}else{const Vn=Dn+Math.max((ne-Ce)/2,0),on=yt.leftForLtr(tn,we),pr=D2(Mn.borderRadius);T.beginPath(),Object.values(pr).some(_r=>_r!==0)?tS(T,{x:on,y:Vn,w:we,h:Ce,radius:pr}):T.rect(on,Vn,we,Ce),T.fill(),Br!==0&&T.stroke()}T.restore()},It=function(tn,Dn,Mn){Z5(T,Mn.text,tn,Dn+Ve/2,St,{strikethrough:Mn.hidden,textAlign:yt.textAlign(Mn.textAlign)})},rn=this.isHorizontal(),Lr=this._computeTitleHeight();rn?me={x:z0($,this.left+Ut,this.right-u[0]),y:this.top+Ut+Lr,line:0}:me={x:this.left+Ut,y:z0($,this.top+Lr+Ut,this.bottom-r[0].height),line:0},F$(this.ctx,t.textDirection);const Mr=Ve+Ut;this.legendItems.forEach((tn,Dn)=>{T.strokeStyle=tn.fontColor,T.fillStyle=tn.fontColor;const Mn=T.measureText(tn.text).width,Br=yt.textAlign(tn.textAlign||(tn.textAlign=K.textAlign)),Vn=we+pe+Mn;let on=me.x,pr=me.y;yt.setWidth(this.width),rn?Dn>0&&on+Vn+Ut>this.right&&(pr=me.y+=Mr,me.line++,on=me.x=z0($,this.left+Ut,this.right-u[me.line])):Dn>0&&pr+Mr>this.bottom&&(on=me.x=on+r[me.line].width+Ut,me.line++,pr=me.y=z0($,this.top+Lr+Ut,this.bottom-r[me.line].height));const _r=yt.x(on);if(kr(_r,pr,tn),on=Zct(Br,on+we+pe,rn?on+Vn:this.right,t.rtl),It(yt.x(on),pr,tn),rn)me.x+=Vn+Ut;else if(typeof tn.text!="string"){const Sr=St.lineHeight;me.y+=dH(tn,Sr)+Ut}else me.y+=Mr}),N$(this.ctx,t.textDirection)}drawTitle(){const t=this.options,r=t.title,u=U0(r.font),T=kg(r.padding);if(!r.display)return;const $=z2(t.rtl,this.left,this.width),K=this.ctx,ct=r.position,yt=u.size/2,St=T.top+yt;let Ut,ne=this.left,pe=this.width;if(this.isHorizontal())pe=Math.max(...this.lineWidths),Ut=this.top+St,ne=z0(t.align,ne,this.right-pe);else{const we=this.columnSizes.reduce((Ce,Ve)=>Math.max(Ce,Ve.height),0);Ut=St+z0(t.align,this.top,this.bottom-we-t.labels.padding-this._computeTitleHeight())}const me=z0(ct,ne,ne+pe);K.textAlign=$.textAlign(qE(ct)),K.textBaseline="middle",K.strokeStyle=r.color,K.fillStyle=r.color,K.font=u.string,Z5(K,r.text,me,Ut,u)}_computeTitleHeight(){const t=this.options.title,r=U0(t.font),u=kg(t.padding);return t.display?r.lineHeight+u.height:0}_getLegendItemAt(t,r){let u,T,$;if(O1(t,this.left,this.right)&&O1(r,this.top,this.bottom)){for($=this.legendHitBoxes,u=0;u<$.length;++u)if(T=$[u],O1(t,T.left,T.left+T.width)&&O1(r,T.top,T.top+T.height))return this.legendItems[u]}return null}handleEvent(t){const r=this.options;if(!yft(t.type,r))return;const u=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const T=this._hoveredItem,$=pft(T,u);T&&!$&&Kd(r.onLeave,[t,T,this],this),this._hoveredItem=u,u&&!$&&Kd(r.onHover,[t,u,this],this)}else u&&Kd(r.onClick,[t,u,this],this)}}function mft(e,t,r,u,T){const $=gft(u,e,t,r),K=vft(T,u,t.lineHeight);return{itemWidth:$,itemHeight:K}}function gft(e,t,r,u){let T=e.text;return T&&typeof T!="string"&&(T=T.reduce(($,K)=>$.length>K.length?$:K)),t+r.size/2+u.measureText(T).width}function vft(e,t,r){let u=e;return typeof t.text!="string"&&(u=dH(t,r)),u}function dH(e,t){const r=e.text?e.text.length:0;return t*r}function yft(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var fH={id:"legend",_element:eF,start(e,t,r){const u=e.legend=new eF({ctx:e.ctx,options:r,chart:e});vg.configure(e,u,r),vg.addBox(e,u)},stop(e){vg.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,r){const u=e.legend;vg.configure(e,u,r),u.options=r},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,r){const u=t.datasetIndex,T=r.chart;T.isDatasetVisible(u)?(T.hide(u),t.hidden=!0):(T.show(u),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:r,pointStyle:u,textAlign:T,color:$,useBorderRadius:K,borderRadius:ct}}=e.legend.options;return e._getSortedDatasetMetas().map(yt=>{const St=yt.controller.getStyle(r?0:void 0),Ut=kg(St.borderWidth);return{text:t[yt.index].label,fillStyle:St.backgroundColor,fontColor:$,hidden:!yt.visible,lineCap:St.borderCapStyle,lineDash:St.borderDash,lineDashOffset:St.borderDashOffset,lineJoin:St.borderJoinStyle,lineWidth:(Ut.width+Ut.height)/4,strokeStyle:St.borderColor,pointStyle:u||St.pointStyle,rotation:St.rotation,textAlign:T||St.textAlign,borderRadius:K&&(ct||St.borderRadius),datasetIndex:yt.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class pH extends G1{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,r){const u=this.options;if(this.left=0,this.top=0,!u.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=r;const T=Tp(u.text)?u.text.length:1;this._padding=kg(u.padding);const $=T*U0(u.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=$:this.width=$}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:r,left:u,bottom:T,right:$,options:K}=this,ct=K.align;let yt=0,St,Ut,ne;return this.isHorizontal()?(Ut=z0(ct,u,$),ne=r+t,St=$-u):(K.position==="left"?(Ut=u+t,ne=z0(ct,T,r),yt=ud*-.5):(Ut=$-t,ne=z0(ct,r,T),yt=ud*.5),St=T-r),{titleX:Ut,titleY:ne,maxWidth:St,rotation:yt}}draw(){const t=this.ctx,r=this.options;if(!r.display)return;const u=U0(r.font),$=u.lineHeight/2+this._padding.top,{titleX:K,titleY:ct,maxWidth:yt,rotation:St}=this._drawArgs($);Z5(t,r.text,0,0,u,{color:r.color,maxWidth:yt,rotation:St,textAlign:qE(r.align),textBaseline:"middle",translation:[K,ct]})}}function _ft(e,t){const r=new pH({ctx:e.ctx,options:t,chart:e});vg.configure(e,r,t),vg.addBox(e,r),e.titleBlock=r}var mH={id:"title",_element:pH,start(e,t,r){_ft(e,r)},stop(e){const t=e.titleBlock;vg.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,r){const u=e.titleBlock;vg.configure(e,u,r),u.options=r},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const l5={average(e){if(!e.length)return!1;let t,r,u=new Set,T=0,$=0;for(t=0,r=e.length;tct+yt)/u.size,y:T/$}},nearest(e,t){if(!e.length)return!1;let r=t.x,u=t.y,T=Number.POSITIVE_INFINITY,$,K,ct;for($=0,K=e.length;$ct({chart:t,initial:r.initial,numSteps:K,currentStep:Math.min(u-r.start,K)}))}_refresh(){this._request||(this._running=!0,this._request=C$.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let r=0;this._charts.forEach((u,T)=>{if(!u.running||!u.items.length)return;const $=u.items;let K=$.length-1,ct=!1,yt;for(;K>=0;--K)yt=$[K],yt._active?(yt._total>u.duration&&(u.duration=yt._total),yt.tick(t),ct=!0):($[K]=$[$.length-1],$.pop());ct&&(T.draw(),this._notify(T,u,t,"progress")),$.length||(u.running=!1,this._notify(T,u,t,"complete"),u.initial=!1),r+=$.length}),this._lastDate=t,r===0&&(this._running=!1)}_getAnims(t){const r=this._charts;let u=r.get(t);return u||(u={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},r.set(t,u)),u}listen(t,r,u){this._getAnims(t).listeners[r].push(u)}add(t,r){!r||!r.length||this._getAnims(t).items.push(...r)}has(t){return this._getAnims(t).items.length>0}start(t){const r=this._charts.get(t);r&&(r.running=!0,r.start=Date.now(),r.duration=r.items.reduce((u,T)=>Math.max(u,T._duration),0),this._refresh())}running(t){if(!this._running)return!1;const r=this._charts.get(t);return!(!r||!r.running||!r.items.length)}stop(t){const r=this._charts.get(t);if(!r||!r.items.length)return;const u=r.items;let T=u.length-1;for(;T>=0;--T)u[T].cancel();r.items=[],this._notify(t,r,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var k1=new Kut;const xR="transparent",Yut={boolean(e,t,r){return r>.5?t:e},color(e,t,r){const u=cR(e||xR),T=u.valid&&cR(t||xR);return T&&T.valid?T.mix(u,r).hexString():t},number(e,t,r){return e+(t-e)*r}};class Xut{constructor(t,r,u,T){const $=r[u];T=$6([t.to,T,$,t.from]);const K=$6([t.from,$,T]);this._active=!0,this._fn=t.fn||Yut[t.type||typeof K],this._easing=M5[t.easing]||M5.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=r,this._prop=u,this._from=K,this._to=T,this._promises=void 0}active(){return this._active}update(t,r,u){if(this._active){this._notify(!1);const T=this._target[this._prop],$=u-this._start,K=this._duration-$;this._start=u,this._duration=Math.floor(Math.max(K,t.duration)),this._total+=$,this._loop=!!t.loop,this._to=$6([t.to,r,T,t.from]),this._from=$6([t.from,T,r])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const r=t-this._start,u=this._duration,T=this._prop,$=this._from,K=this._loop,ct=this._to;let yt;if(this._active=$!==ct&&(K||r1?2-yt:yt,yt=this._easing(Math.min(1,Math.max(0,yt))),this._target[T]=this._fn($,ct,yt)}wait(){const t=this._promises||(this._promises=[]);return new Promise((r,u)=>{t.push({res:r,rej:u})})}_notify(t){const r=t?"res":"rej",u=this._promises||[];for(let T=0;T{const $=t[T];if(!Uu($))return;const K={};for(const ct of r)K[ct]=$[ct];(Tp($.properties)&&$.properties||[T]).forEach(ct=>{(ct===T||!u.has(ct))&&u.set(ct,K)})})}_animateOptions(t,r){const u=r.options,T=Qut(t,u);if(!T)return[];const $=this._createAnimations(T,u);return u.$shared&&Jut(t.options.$animations,u).then(()=>{t.options=u},()=>{}),$}_createAnimations(t,r){const u=this._properties,T=[],$=t.$animations||(t.$animations={}),K=Object.keys(r),ct=Date.now();let yt;for(yt=K.length-1;yt>=0;--yt){const St=K[yt];if(St.charAt(0)==="$")continue;if(St==="options"){T.push(...this._animateOptions(t,r));continue}const Ut=r[St];let ne=$[St];const pe=u.get(St);if(ne)if(pe&&ne.active()){ne.update(pe,Ut,ct);continue}else ne.cancel();if(!pe||!pe.duration){t[St]=Ut;continue}$[St]=ne=new Xut(pe,t,St,Ut),T.push(ne)}return T}update(t,r){if(this._properties.size===0){Object.assign(t,r);return}const u=this._createAnimations(t,r);if(u.length)return k1.add(this._chart,u),!0}}function Jut(e,t){const r=[],u=Object.keys(t);for(let T=0;T0||!r&&$<0)return T.index}return null}function TR(e,t){const{chart:r,_cachedMeta:u}=e,T=r._stacks||(r._stacks={}),{iScale:$,vScale:K,index:ct}=u,yt=$.axis,St=K.axis,Ut=nht($,K,u),ne=t.length;let pe;for(let me=0;mer[u].axis===t).shift()}function oht(e,t){return Gx(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function sht(e,t,r){return Gx(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:r,index:t,mode:"default",type:"data"})}function B3(e,t){const r=e.controller.index,u=e.vScale&&e.vScale.axis;if(u){t=t||e._parsed;for(const T of t){const $=T._stacks;if(!$||$[u]===void 0||$[u][r]===void 0)return;delete $[u][r],$[u]._visualValues!==void 0&&$[u]._visualValues[r]!==void 0&&delete $[u]._visualValues[r]}}}const j7=e=>e==="reset"||e==="none",SR=(e,t)=>t?e:Object.assign({},e),lht=(e,t,r)=>e&&!t.hidden&&t._stacked&&{keys:W$(r,!0),values:null};class c4{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,r){this.chart=t,this._ctx=t.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=F7(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&B3(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,r=this._cachedMeta,u=this.getDataset(),T=(ne,pe,me,we)=>ne==="x"?pe:ne==="r"?we:me,$=r.xAxisID=_u(u.xAxisID,N7(t,"x")),K=r.yAxisID=_u(u.yAxisID,N7(t,"y")),ct=r.rAxisID=_u(u.rAxisID,N7(t,"r")),yt=r.indexAxis,St=r.iAxisID=T(yt,$,K,ct),Ut=r.vAxisID=T(yt,K,$,ct);r.xScale=this.getScaleForId($),r.yScale=this.getScaleForId(K),r.rScale=this.getScaleForId(ct),r.iScale=this.getScaleForId(St),r.vScale=this.getScaleForId(Ut)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const r=this._cachedMeta;return t===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&oR(this._data,this),t._stacked&&B3(t)}_dataCheck(){const t=this.getDataset(),r=t.data||(t.data=[]),u=this._data;if(Uu(r)){const T=this._cachedMeta;this._data=rht(r,T)}else if(u!==r){if(u){oR(u,this);const T=this._cachedMeta;B3(T),T._parsed=[]}r&&Object.isExtensible(r)&&qct(r,this),this._syncList=[],this._data=r}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const r=this._cachedMeta,u=this.getDataset();let T=!1;this._dataCheck();const $=r._stacked;r._stacked=F7(r.vScale,r),r.stack!==u.stack&&(T=!0,B3(r),r.stack=u.stack),this._resyncElements(t),(T||$!==r._stacked)&&(TR(this,r._parsed),r._stacked=F7(r.vScale,r))}configure(){const t=this.chart.config,r=t.datasetScopeKeys(this._type),u=t.getOptionScopes(this.getDataset(),r,!0);this.options=t.createResolver(u,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,r){const{_cachedMeta:u,_data:T}=this,{iScale:$,_stacked:K}=u,ct=$.axis;let yt=t===0&&r===T.length?!0:u._sorted,St=t>0&&u._parsed[t-1],Ut,ne,pe;if(this._parsing===!1)u._parsed=T,u._sorted=!0,pe=T;else{Tp(T[t])?pe=this.parseArrayData(u,T,t,r):Uu(T[t])?pe=this.parseObjectData(u,T,t,r):pe=this.parsePrimitiveData(u,T,t,r);const me=()=>ne[ct]===null||St&&ne[ct]Ce||ne=0;--pe)if(!we()){this.updateRangeFromParsed(St,t,me,yt);break}}return St}getAllParsedValues(t){const r=this._cachedMeta._parsed,u=[];let T,$,K;for(T=0,$=r.length;T<$;++T)K=r[T][t.axis],$0(K)&&u.push(K);return u}getMaxOverflow(){return!1}getLabelAndValue(t){const r=this._cachedMeta,u=r.iScale,T=r.vScale,$=this.getParsed(t);return{label:u?""+u.getLabelForValue($[u.axis]):"",value:T?""+T.getLabelForValue($[T.axis]):""}}_update(t){const r=this._cachedMeta;this.update(t||"default"),r._clip=eht(_u(this.options.clip,tht(r.xScale,r.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,r=this.chart,u=this._cachedMeta,T=u.data||[],$=r.chartArea,K=[],ct=this._drawStart||0,yt=this._drawCount||T.length-ct,St=this.options.drawActiveElementsOnTop;let Ut;for(u.dataset&&u.dataset.draw(t,$,ct,yt),Ut=ct;Ut=0&&tthis.getContext(u,T,r),Ce=St.resolveNamedOptions(pe,me,we,ne);return Ce.$shared&&(Ce.$shared=yt,$[K]=Object.freeze(SR(Ce,yt))),Ce}_resolveAnimations(t,r,u){const T=this.chart,$=this._cachedDataOpts,K=`animation-${r}`,ct=$[K];if(ct)return ct;let yt;if(T.options.animation!==!1){const Ut=this.chart.config,ne=Ut.datasetAnimationScopeKeys(this._type,r),pe=Ut.getOptionScopes(this.getDataset(),ne);yt=Ut.createResolver(pe,this.getContext(t,u,r))}const St=new V$(T,yt&&yt.animations);return yt&&yt._cacheable&&($[K]=Object.freeze(St)),St}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,r){return!r||j7(t)||this.chart._animationsDisabled}_getSharedOptions(t,r){const u=this.resolveDataElementOptions(t,r),T=this._sharedOptions,$=this.getSharedOptions(u),K=this.includeOptions(r,$)||$!==T;return this.updateSharedOptions($,r,u),{sharedOptions:$,includeOptions:K}}updateElement(t,r,u,T){j7(T)?Object.assign(t,u):this._resolveAnimations(r,T).update(t,u)}updateSharedOptions(t,r,u){t&&!j7(r)&&this._resolveAnimations(void 0,r).update(t,u)}_setStyle(t,r,u,T){t.active=T;const $=this.getStyle(r,T);this._resolveAnimations(r,u,T).update(t,{options:!T&&this.getSharedOptions($)||$})}removeHoverStyle(t,r,u){this._setStyle(t,u,"active",!1)}setHoverStyle(t,r,u){this._setStyle(t,u,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const r=this._data,u=this._cachedMeta.data;for(const[ct,yt,St]of this._syncList)this[ct](yt,St);this._syncList=[];const T=u.length,$=r.length,K=Math.min($,T);K&&this.parse(0,K),$>T?this._insertElements(T,$-T,t):${for(St.length+=r,ct=St.length-1;ct>=K;ct--)St[ct]=St[ct-r]};for(yt($),ct=t;ctT-$))}return e._cache.$bar}function uht(e){const t=e.iScale,r=cht(t,e.type);let u=t._length,T,$,K,ct;const yt=()=>{K===32767||K===-32768||(W5(ct)&&(u=Math.min(u,Math.abs(K-ct)||u)),ct=K)};for(T=0,$=r.length;T<$;++T)K=t.getPixelForValue(r[T]),yt();for(ct=void 0,T=0,$=t.ticks.length;T<$;++T)K=t.getPixelForTick(T),yt();return u}function hht(e,t,r,u){const T=r.barThickness;let $,K;return Rh(T)?($=t.min*r.categoryPercentage,K=r.barPercentage):($=T*u,K=1),{chunk:$/u,ratio:K,start:t.pixels[e]-$/2}}function dht(e,t,r,u){const T=t.pixels,$=T[e];let K=e>0?T[e-1]:null,ct=eMath.abs(ct)&&(yt=ct,St=K),t[r.axis]=St,t._custom={barStart:yt,barEnd:St,start:T,end:$,min:K,max:ct}}function q$(e,t,r,u){return Tp(e)?fht(e,t,r,u):t[r.axis]=r.parse(e,u),t}function CR(e,t,r,u){const T=e.iScale,$=e.vScale,K=T.getLabels(),ct=T===$,yt=[];let St,Ut,ne,pe;for(St=r,Ut=r+u;St=r?1:-1)}function mht(e){let t,r,u,T,$;return e.horizontal?(t=e.base>e.x,r="left",u="right"):(t=e.baseUt.controller.options.grouped),$=u.options.stacked,K=[],ct=this._cachedMeta.controller.getParsed(r),yt=ct&&ct[u.axis],St=Ut=>{const ne=Ut._parsed.find(me=>me[u.axis]===yt),pe=ne&&ne[Ut.vScale.axis];if(Rh(pe)||isNaN(pe))return!0};for(const Ut of T)if(!(r!==void 0&&St(Ut))&&(($===!1||K.indexOf(Ut.stack)===-1||$===void 0&&Ut.stack===void 0)&&K.push(Ut.stack),Ut.index===t))break;return K.length||K.push(void 0),K}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,r=this.chart.options.indexAxis;return Object.keys(t).filter(u=>t[u].axis===r).shift()}_getAxis(){const t={},r=this.getFirstScaleIdForIndexAxis();for(const u of this.chart.data.datasets)t[_u(this.chart.options.indexAxis==="x"?u.xAxisID:u.yAxisID,r)]=!0;return Object.keys(t)}_getStackIndex(t,r,u){const T=this._getStacks(t,u),$=r!==void 0?T.indexOf(r):-1;return $===-1?T.length-1:$}_getRuler(){const t=this.options,r=this._cachedMeta,u=r.iScale,T=[];let $,K;for($=0,K=r.data.length;$q5(rn,ct,yt,!0)?1:Math.max(Lr,Lr*r,Mr,Mr*r),we=(rn,Lr,Mr)=>q5(rn,ct,yt,!0)?-1:Math.min(Lr,Lr*r,Mr,Mr*r),Ce=me(0,St,ne),Ve=me(Bp,Ut,pe),kr=we(ud,St,ne),It=we(ud+Bp,Ut,pe);u=(Ce-kr)/2,T=(Ve-It)/2,$=-(Ce+kr)/2,K=-(Ve+It)/2}return{ratioX:u,ratioY:T,offsetX:$,offsetY:K}}class Z$ extends c4{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const r=t.data,{labels:{pointStyle:u,textAlign:T,color:$,useBorderRadius:K,borderRadius:ct}}=t.legend.options;return r.labels.length&&r.datasets.length?r.labels.map((yt,St)=>{const ne=t.getDatasetMeta(0).controller.getStyle(St);return{text:yt,fillStyle:ne.backgroundColor,fontColor:$,hidden:!t.getDataVisibility(St),lineDash:ne.borderDash,lineDashOffset:ne.borderDashOffset,lineJoin:ne.borderJoinStyle,lineWidth:ne.borderWidth,strokeStyle:ne.borderColor,textAlign:T,pointStyle:u,borderRadius:K&&(ct||ne.borderRadius),index:St}}):[]}},onClick(t,r,u){u.chart.toggleDataVisibility(r.index),u.chart.update()}}}};constructor(t,r){super(t,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,r){const u=this.getDataset().data,T=this._cachedMeta;if(this._parsing===!1)T._parsed=u;else{let $=yt=>+u[yt];if(Uu(u[t])){const{key:yt="value"}=this._parsing;$=St=>+$x(u[St],yt)}let K,ct;for(K=t,ct=t+r;K0&&!isNaN(t)?Cf*(Math.abs(t)/r):0}getLabelAndValue(t){const r=this._cachedMeta,u=this.chart,T=u.data.labels||[],$=ZE(r._parsed[t],u.options.locale);return{label:T[t]||"",value:$}}getMaxBorderWidth(t){let r=0;const u=this.chart;let T,$,K,ct,yt;if(!t){for(T=0,$=u.data.datasets.length;T<$;++T)if(u.isDatasetVisible(T)){K=u.getDatasetMeta(T),t=K.data,ct=K.controller;break}}if(!t)return 0;for(T=0,$=t.length;T<$;++T)yt=ct.resolveDataElementOptions(T),yt.borderAlign!=="inner"&&(r=Math.max(r,yt.borderWidth||0,yt.hoverBorderWidth||0));return r}getMaxOffset(t){let r=0;for(let u=0,T=t.length;u0&&this.getParsed(r-1);for(let Mr=0;Mr=It){Dn.skip=!0;continue}const Mn=this.getParsed(Mr),Br=Rh(Mn[me]),Vn=Dn[pe]=K.getPixelForValue(Mn[pe],Mr),on=Dn[me]=$||Br?ct.getBasePixel():ct.getPixelForValue(yt?this.applyStack(ct,Mn,yt):Mn[me],Mr);Dn.skip=isNaN(Vn)||isNaN(on)||Br,Dn.stop=Mr>0&&Math.abs(Mn[pe]-Lr[pe])>Ve,Ce&&(Dn.parsed=Mn,Dn.raw=St.data[Mr]),ne&&(Dn.options=Ut||this.resolveDataElementOptions(Mr,tn.active?"active":T)),kr||this.updateElement(tn,Mr,Dn,T),Lr=Mn}}getMaxOverflow(){const t=this._cachedMeta,r=t.dataset,u=r.options&&r.options.borderWidth||0,T=t.data||[];if(!T.length)return u;const $=T[0].size(this.resolveDataElementOptions(0)),K=T[T.length-1].size(this.resolveDataElementOptions(T.length-1));return Math.max(u,$,K)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class xht extends c4{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const r=this._cachedMeta,u=this.chart.data.labels||[],{xScale:T,yScale:$}=r,K=this.getParsed(t),ct=T.getLabelForValue(K.x),yt=$.getLabelForValue(K.y);return{label:u[t]||"",value:"("+ct+", "+yt+")"}}update(t){const r=this._cachedMeta,{data:u=[]}=r,T=this.chart._animationsDisabled;let{start:$,count:K}=M$(r,u,T);if(this._drawStart=$,this._drawCount=K,E$(r)&&($=0,K=u.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:ct,_dataset:yt}=r;ct._chart=this.chart,ct._datasetIndex=this.index,ct._decimated=!!yt._decimated,ct.points=u;const St=this.resolveDatasetElementOptions(t);St.segment=this.options.segment,this.updateElement(ct,void 0,{animated:!T,options:St},t)}else this.datasetElementType&&(delete r.dataset,this.datasetElementType=!1);this.updateElements(u,$,K,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,r,u,T){const $=T==="reset",{iScale:K,vScale:ct,_stacked:yt,_dataset:St}=this._cachedMeta,Ut=this.resolveDataElementOptions(r,T),ne=this.getSharedOptions(Ut),pe=this.includeOptions(T,ne),me=K.axis,we=ct.axis,{spanGaps:Ce,segment:Ve}=this.options,kr=H2(Ce)?Ce:Number.POSITIVE_INFINITY,It=this.chart._animationsDisabled||$||T==="none";let rn=r>0&&this.getParsed(r-1);for(let Lr=r;Lr0&&Math.abs(tn[me]-rn[me])>kr,Ve&&(Dn.parsed=tn,Dn.raw=St.data[Lr]),pe&&(Dn.options=ne||this.resolveDataElementOptions(Lr,Mr.active?"active":T)),It||this.updateElement(Mr,Lr,Dn,T),rn=tn}this.updateSharedOptions(ne,T,Ut)}getMaxOverflow(){const t=this._cachedMeta,r=t.data||[];if(!this.options.showLine){let ct=0;for(let yt=r.length-1;yt>=0;--yt)ct=Math.max(ct,r[yt].size(this.resolveDataElementOptions(yt))/2);return ct>0&&ct}const u=t.dataset,T=u.options&&u.options.borderWidth||0;if(!r.length)return T;const $=r[0].size(this.resolveDataElementOptions(0)),K=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(T,$,K)/2}}function dx(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class rL{static override(t){Object.assign(rL.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return dx()}parse(){return dx()}format(){return dx()}add(){return dx()}diff(){return dx()}startOf(){return dx()}endOf(){return dx()}}var K$={_date:rL};function bht(e,t,r,u){const{controller:T,data:$,_sorted:K}=e,ct=T._cachedMeta.iScale,yt=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(ct&&t===ct.axis&&t!=="r"&&K&&$.length){const St=ct._reversePixels?Vct:Mx;if(u){if(T._sharedOptions){const Ut=$[0],ne=typeof Ut.getRange=="function"&&Ut.getRange(t);if(ne){const pe=St($,t,r-ne),me=St($,t,r+ne);return{lo:pe.lo,hi:me.hi}}}}else{const Ut=St($,t,r);if(yt){const{vScale:ne}=T._cachedMeta,{_parsed:pe}=e,me=pe.slice(0,Ut.lo+1).reverse().findIndex(Ce=>!Rh(Ce[ne.axis]));Ut.lo-=Math.max(0,me);const we=pe.slice(Ut.hi).findIndex(Ce=>!Rh(Ce[ne.axis]));Ut.hi+=Math.max(0,we)}return Ut}}return{lo:0,hi:$.length-1}}function qS(e,t,r,u,T){const $=e.getSortedVisibleDatasetMetas(),K=r[t];for(let ct=0,yt=$.length;ct{yt[K]&&yt[K](t[r],T)&&($.push({element:yt,datasetIndex:St,index:Ut}),ct=ct||yt.inRange(t.x,t.y,T))}),u&&!ct?[]:$}var Sht={modes:{index(e,t,r,u){const T=yx(t,e),$=r.axis||"x",K=r.includeInvisible||!1,ct=r.intersect?$7(e,T,$,u,K):H7(e,T,$,!1,u,K),yt=[];return ct.length?(e.getSortedVisibleDatasetMetas().forEach(St=>{const Ut=ct[0].index,ne=St.data[Ut];ne&&!ne.skip&&yt.push({element:ne,datasetIndex:St.index,index:Ut})}),yt):[]},dataset(e,t,r,u){const T=yx(t,e),$=r.axis||"xy",K=r.includeInvisible||!1;let ct=r.intersect?$7(e,T,$,u,K):H7(e,T,$,!1,u,K);if(ct.length>0){const yt=ct[0].datasetIndex,St=e.getDatasetMeta(yt).data;ct=[];for(let Ut=0;Utr.pos===t)}function LR(e,t){return e.filter(r=>Y$.indexOf(r.pos)===-1&&r.box.axis===t)}function F3(e,t){return e.sort((r,u)=>{const T=t?u:r,$=t?r:u;return T.weight===$.weight?T.index-$.index:T.weight-$.weight})}function Cht(e){const t=[];let r,u,T,$,K,ct;for(r=0,u=(e||[]).length;rSt.box.fullSize),!0),u=F3(R3(t,"left"),!0),T=F3(R3(t,"right")),$=F3(R3(t,"top"),!0),K=F3(R3(t,"bottom")),ct=LR(t,"x"),yt=LR(t,"y");return{fullSize:r,leftAndTop:u.concat($),rightAndBottom:T.concat(yt).concat(K).concat(ct),chartArea:R3(t,"chartArea"),vertical:u.concat(T).concat(yt),horizontal:$.concat(K).concat(ct)}}function PR(e,t,r,u){return Math.max(e[r],t[r])+Math.max(e[u],t[u])}function X$(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Lht(e,t,r,u){const{pos:T,box:$}=r,K=e.maxPadding;if(!Uu(T)){r.size&&(e[T]-=r.size);const ne=u[r.stack]||{size:0,count:1};ne.size=Math.max(ne.size,r.horizontal?$.height:$.width),r.size=ne.size/ne.count,e[T]+=r.size}$.getPadding&&X$(K,$.getPadding());const ct=Math.max(0,t.outerWidth-PR(K,e,"left","right")),yt=Math.max(0,t.outerHeight-PR(K,e,"top","bottom")),St=ct!==e.w,Ut=yt!==e.h;return e.w=ct,e.h=yt,r.horizontal?{same:St,other:Ut}:{same:Ut,other:St}}function Pht(e){const t=e.maxPadding;function r(u){const T=Math.max(t[u]-e[u],0);return e[u]+=T,T}e.y+=r("top"),e.x+=r("left"),r("right"),r("bottom")}function Iht(e,t){const r=t.maxPadding;function u(T){const $={left:0,top:0,right:0,bottom:0};return T.forEach(K=>{$[K]=Math.max(t[K],r[K])}),$}return u(e?["left","right"]:["top","bottom"])}function s5(e,t,r,u){const T=[];let $,K,ct,yt,St,Ut;for($=0,K=e.length,St=0;${typeof Ce.beforeLayout=="function"&&Ce.beforeLayout()});const Ut=yt.reduce((Ce,Ve)=>Ve.box.options&&Ve.box.options.display===!1?Ce:Ce+1,0)||1,ne=Object.freeze({outerWidth:t,outerHeight:r,padding:T,availableWidth:$,availableHeight:K,vBoxMaxWidth:$/2/Ut,hBoxMaxHeight:K/2}),pe=Object.assign({},T);X$(pe,kg(u));const me=Object.assign({maxPadding:pe,w:$,h:K,x:T.left,y:T.top},T),we=Mht(yt.concat(St),ne);s5(ct.fullSize,me,ne,we),s5(yt,me,ne,we),s5(St,me,ne,we)&&s5(yt,me,ne,we),Pht(me),IR(ct.leftAndTop,me,ne,we),me.x+=me.w,me.y+=me.h,IR(ct.rightAndBottom,me,ne,we),e.chartArea={left:me.left,top:me.top,right:me.left+me.w,bottom:me.top+me.h,height:me.h,width:me.w},cd(ct.chartArea,Ce=>{const Ve=Ce.box;Object.assign(Ve,e.chartArea),Ve.update(me.w,me.h,{left:0,top:0,right:0,bottom:0})})}};class J${acquireContext(t,r){}releaseContext(t){return!1}addEventListener(t,r,u){}removeEventListener(t,r,u){}getDevicePixelRatio(){return 1}getMaximumSize(t,r,u,T){return r=Math.max(0,r||t.width),u=u||t.height,{width:r,height:Math.max(0,T?Math.floor(r/T):u)}}isAttached(t){return!0}updateConfig(t){}}class Dht extends J${acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const TT="$chartjs",zht={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},DR=e=>e===null||e==="";function Oht(e,t){const r=e.style,u=e.getAttribute("height"),T=e.getAttribute("width");if(e[TT]={initial:{height:u,width:T,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",DR(T)){const $=gR(e,"width");$!==void 0&&(e.width=$)}if(DR(u))if(e.style.height==="")e.height=e.width/(t||2);else{const $=gR(e,"height");$!==void 0&&(e.height=$)}return e}const Q$=Rut?{passive:!0}:!1;function Bht(e,t,r){e&&e.addEventListener(t,r,Q$)}function Rht(e,t,r){e&&e.canvas&&e.canvas.removeEventListener(t,r,Q$)}function Fht(e,t){const r=zht[e.type]||e.type,{x:u,y:T}=yx(e,t);return{type:r,chart:t,native:e,x:u!==void 0?u:null,y:T!==void 0?T:null}}function rS(e,t){for(const r of e)if(r===t||r.contains(t))return!0}function Nht(e,t,r){const u=e.canvas,T=new MutationObserver($=>{let K=!1;for(const ct of $)K=K||rS(ct.addedNodes,u),K=K&&!rS(ct.removedNodes,u);K&&r()});return T.observe(document,{childList:!0,subtree:!0}),T}function jht(e,t,r){const u=e.canvas,T=new MutationObserver($=>{let K=!1;for(const ct of $)K=K||rS(ct.removedNodes,u),K=K&&!rS(ct.addedNodes,u);K&&r()});return T.observe(document,{childList:!0,subtree:!0}),T}const K5=new Map;let zR=0;function tH(){const e=window.devicePixelRatio;e!==zR&&(zR=e,K5.forEach((t,r)=>{r.currentDevicePixelRatio!==e&&t()}))}function Uht(e,t){K5.size||window.addEventListener("resize",tH),K5.set(e,t)}function $ht(e){K5.delete(e),K5.size||window.removeEventListener("resize",tH)}function Hht(e,t,r){const u=e.canvas,T=u&&tL(u);if(!T)return;const $=A$((ct,yt)=>{const St=T.clientWidth;r(ct,yt),St{const yt=ct[0],St=yt.contentRect.width,Ut=yt.contentRect.height;St===0&&Ut===0||$(St,Ut)});return K.observe(T),Uht(e,$),K}function V7(e,t,r){r&&r.disconnect(),t==="resize"&&$ht(e)}function Vht(e,t,r){const u=e.canvas,T=A$($=>{e.ctx!==null&&r(Fht($,e))},e);return Bht(u,t,T),T}class Wht extends J${acquireContext(t,r){const u=t&&t.getContext&&t.getContext("2d");return u&&u.canvas===t?(Oht(t,r),u):null}releaseContext(t){const r=t.canvas;if(!r[TT])return!1;const u=r[TT].initial;["height","width"].forEach($=>{const K=u[$];Rh(K)?r.removeAttribute($):r.setAttribute($,K)});const T=u.style||{};return Object.keys(T).forEach($=>{r.style[$]=T[$]}),r.width=r.width,delete r[TT],!0}addEventListener(t,r,u){this.removeEventListener(t,r);const T=t.$proxies||(t.$proxies={}),K={attach:Nht,detach:jht,resize:Hht}[r]||Vht;T[r]=K(t,r,u)}removeEventListener(t,r){const u=t.$proxies||(t.$proxies={}),T=u[r];if(!T)return;({attach:V7,detach:V7,resize:V7}[r]||Rht)(t,r,T),u[r]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,r,u,T){return But(t,r,u,T)}isAttached(t){const r=t&&tL(t);return!!(r&&r.isConnected)}}function qht(e){return!QE()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Dht:Wht}let G1=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:r,y:u}=this.getProps(["x","y"],t);return{x:r,y:u}}hasValue(){return H2(this.x)&&H2(this.y)}getProps(t,r){const u=this.$animations;if(!r||!u)return this;const T={};return t.forEach($=>{T[$]=u[$]&&u[$].active()?u[$]._to:this[$]}),T}};function Ght(e,t){const r=e.options.ticks,u=Zht(e),T=Math.min(r.maxTicksLimit||u,u),$=r.major.enabled?Yht(t):[],K=$.length,ct=$[0],yt=$[K-1],St=[];if(K>T)return Xht(t,St,$,K/T),St;const Ut=Kht($,t,T);if(K>0){let ne,pe;const me=K>1?Math.round((yt-ct)/(K-1)):null;for(q6(t,St,Ut,Rh(me)?0:ct-me,ct),ne=0,pe=K-1;neT)return yt}return Math.max(T,1)}function Yht(e){const t=[];let r,u;for(r=0,u=e.length;re==="left"?"right":e==="right"?"left":e,OR=(e,t,r)=>t==="top"||t==="left"?e[t]+r:e[t]-r,BR=(e,t)=>Math.min(t||e,e);function RR(e,t){const r=[],u=e.length/t,T=e.length;let $=0;for(;$K+ct)))return yt}function edt(e,t){cd(e,r=>{const u=r.gc,T=u.length/2;let $;if(T>t){for($=0;$u?u:r,u=T&&r>u?r:u,{min:fv(r,fv(u,r)),max:fv(u,fv(r,u))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Kd(this.options.beforeUpdate,[this])}update(t,r,u){const{beginAtZero:T,grace:$,ticks:K}=this.options,ct=K.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=r,this._margins=u=Object.assign({left:0,right:0,top:0,bottom:0},u),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+u.left+u.right:this.height+u.top+u.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=put(this,$,T),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const yt=ct=$||u<=1||!this.isHorizontal()){this.labelRotation=T;return}const Ut=this._getLabelSizes(),ne=Ut.widest.width,pe=Ut.highest.height,me=j0(this.chart.width-ne,0,this.maxWidth);ct=t.offset?this.maxWidth/u:me/(u-1),ne+6>ct&&(ct=me/(u-(t.offset?.5:1)),yt=this.maxHeight-N3(t.grid)-r.padding-FR(t.title,this.chart.options.font),St=Math.sqrt(ne*ne+pe*pe),K=Uct(Math.min(Math.asin(j0((Ut.highest.height+6)/ct,-1,1)),Math.asin(j0(yt/St,-1,1))-Math.asin(j0(pe/St,-1,1)))),K=Math.max(T,Math.min($,K))),this.labelRotation=K}afterCalculateLabelRotation(){Kd(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Kd(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:r,options:{ticks:u,title:T,grid:$}}=this,K=this._isVisible(),ct=this.isHorizontal();if(K){const yt=FR(T,r.options.font);if(ct?(t.width=this.maxWidth,t.height=N3($)+yt):(t.height=this.maxHeight,t.width=N3($)+yt),u.display&&this.ticks.length){const{first:St,last:Ut,widest:ne,highest:pe}=this._getLabelSizes(),me=u.padding*2,we=z1(this.labelRotation),Ce=Math.cos(we),Ve=Math.sin(we);if(ct){const kr=u.mirror?0:Ve*ne.width+Ce*pe.height;t.height=Math.min(this.maxHeight,t.height+kr+me)}else{const kr=u.mirror?0:Ce*ne.width+Ve*pe.height;t.width=Math.min(this.maxWidth,t.width+kr+me)}this._calculatePadding(St,Ut,Ve,Ce)}}this._handleMargins(),ct?(this.width=this._length=r.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=r.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,r,u,T){const{ticks:{align:$,padding:K},position:ct}=this.options,yt=this.labelRotation!==0,St=ct!=="top"&&this.axis==="x";if(this.isHorizontal()){const Ut=this.getPixelForTick(0)-this.left,ne=this.right-this.getPixelForTick(this.ticks.length-1);let pe=0,me=0;yt?St?(pe=T*t.width,me=u*r.height):(pe=u*t.height,me=T*r.width):$==="start"?me=r.width:$==="end"?pe=t.width:$!=="inner"&&(pe=t.width/2,me=r.width/2),this.paddingLeft=Math.max((pe-Ut+K)*this.width/(this.width-Ut),0),this.paddingRight=Math.max((me-ne+K)*this.width/(this.width-ne),0)}else{let Ut=r.height/2,ne=t.height/2;$==="start"?(Ut=0,ne=t.height):$==="end"&&(Ut=r.height,ne=0),this.paddingTop=Ut+K,this.paddingBottom=ne+K}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Kd(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:r}=this.options;return r==="top"||r==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let r,u;for(r=0,u=t.length;r({width:K[Br]||0,height:ct[Br]||0});return{first:Mn(0),last:Mn(r-1),widest:Mn(tn),highest:Mn(Dn),widths:K,heights:ct}}getLabelForValue(t){return t}getPixelForValue(t,r){return NaN}getValueForPixel(t){}getPixelForTick(t){const r=this.ticks;return t<0||t>r.length-1?null:this.getPixelForValue(r[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const r=this._startPixel+t*this._length;return Hct(this._alignToPixels?hx(this.chart,r,0):r)}getDecimalForPixel(t){const r=(t-this._startPixel)/this._length;return this._reversePixels?1-r:r}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:r}=this;return t<0&&r<0?r:t>0&&r>0?t:0}getContext(t){const r=this.ticks||[];if(t>=0&&tct*T?ct/u:yt/T:yt*T0}_computeGridLineItems(t){const r=this.axis,u=this.chart,T=this.options,{grid:$,position:K,border:ct}=T,yt=$.offset,St=this.isHorizontal(),ne=this.ticks.length+(yt?1:0),pe=N3($),me=[],we=ct.setContext(this.getContext()),Ce=we.display?we.width:0,Ve=Ce/2,kr=function(nn){return hx(u,nn,Ce)};let It,rn,Lr,Mr,tn,Dn,Mn,Br,Vn,on,pr,_r;if(K==="top")It=kr(this.bottom),Dn=this.bottom-pe,Br=It-Ve,on=kr(t.top)+Ve,_r=t.bottom;else if(K==="bottom")It=kr(this.top),on=t.top,_r=kr(t.bottom)-Ve,Dn=It+Ve,Br=this.top+pe;else if(K==="left")It=kr(this.right),tn=this.right-pe,Mn=It-Ve,Vn=kr(t.left)+Ve,pr=t.right;else if(K==="right")It=kr(this.left),Vn=t.left,pr=kr(t.right)-Ve,tn=It+Ve,Mn=this.left+pe;else if(r==="x"){if(K==="center")It=kr((t.top+t.bottom)/2+.5);else if(Uu(K)){const nn=Object.keys(K)[0],Cn=K[nn];It=kr(this.chart.scales[nn].getPixelForValue(Cn))}on=t.top,_r=t.bottom,Dn=It+Ve,Br=Dn+pe}else if(r==="y"){if(K==="center")It=kr((t.left+t.right)/2);else if(Uu(K)){const nn=Object.keys(K)[0],Cn=K[nn];It=kr(this.chart.scales[nn].getPixelForValue(Cn))}tn=It-Ve,Mn=tn-pe,Vn=t.left,pr=t.right}const Sr=_u(T.ticks.maxTicksLimit,ne),Dr=Math.max(1,Math.ceil(ne/Sr));for(rn=0;rn0&&(Yn-=Bi/2);break}va={left:Yn,top:Xi,width:Bi+_a.width,height:qi+_a.height,color:Dr.backdropColor}}Ve.push({label:Lr,font:Br,textOffset:pr,options:{rotation:Ce,color:Cn,strokeColor:Xn,strokeWidth:_i,textAlign:ta,textBaseline:_r,translation:[Mr,tn],backdrop:va}})}return Ve}_getXAxisLabelAlignment(){const{position:t,ticks:r}=this.options;if(-z1(this.labelRotation))return t==="top"?"left":"right";let T="center";return r.align==="start"?T="left":r.align==="end"?T="right":r.align==="inner"&&(T="inner"),T}_getYAxisLabelAlignment(t){const{position:r,ticks:{crossAlign:u,mirror:T,padding:$}}=this.options,K=this._getLabelSizes(),ct=t+$,yt=K.widest.width;let St,Ut;return r==="left"?T?(Ut=this.right+$,u==="near"?St="left":u==="center"?(St="center",Ut+=yt/2):(St="right",Ut+=yt)):(Ut=this.right-ct,u==="near"?St="right":u==="center"?(St="center",Ut-=yt/2):(St="left",Ut=this.left)):r==="right"?T?(Ut=this.left+$,u==="near"?St="right":u==="center"?(St="center",Ut-=yt/2):(St="left",Ut-=yt)):(Ut=this.left+ct,u==="near"?St="left":u==="center"?(St="center",Ut+=yt/2):(St="right",Ut=this.right)):St="right",{textAlign:St,x:Ut}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,r=this.options.position;if(r==="left"||r==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(r==="top"||r==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:r},left:u,top:T,width:$,height:K}=this;r&&(t.save(),t.fillStyle=r,t.fillRect(u,T,$,K),t.restore())}getLineWidthForValue(t){const r=this.options.grid;if(!this._isVisible()||!r.display)return 0;const T=this.ticks.findIndex($=>$.value===t);return T>=0?r.setContext(this.getContext(T)).lineWidth:0}drawGrid(t){const r=this.options.grid,u=this.ctx,T=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let $,K;const ct=(yt,St,Ut)=>{!Ut.width||!Ut.color||(u.save(),u.lineWidth=Ut.width,u.strokeStyle=Ut.color,u.setLineDash(Ut.borderDash||[]),u.lineDashOffset=Ut.borderDashOffset,u.beginPath(),u.moveTo(yt.x,yt.y),u.lineTo(St.x,St.y),u.stroke(),u.restore())};if(r.display)for($=0,K=T.length;${this.draw($)}}]:[{z:u,draw:$=>{this.drawBackground(),this.drawGrid($),this.drawTitle()}},{z:T,draw:()=>{this.drawBorder()}},{z:r,draw:$=>{this.drawLabels($)}}]}getMatchingVisibleMetas(t){const r=this.chart.getSortedVisibleDatasetMetas(),u=this.axis+"AxisID",T=[];let $,K;for($=0,K=r.length;${const u=r.split("."),T=u.pop(),$=[e].concat(u).join("."),K=t[r].split("."),ct=K.pop(),yt=K.join(".");lp.route($,T,yt,ct)})}function ldt(e){return"id"in e&&"defaults"in e}class cdt{constructor(){this.controllers=new G6(c4,"datasets",!0),this.elements=new G6(G1,"elements"),this.plugins=new G6(Object,"plugins"),this.scales=new G6(X2,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,r,u){[...r].forEach(T=>{const $=u||this._getRegistryForType(T);u||$.isForType(T)||$===this.plugins&&T.id?this._exec(t,$,T):cd(T,K=>{const ct=u||this._getRegistryForType(K);this._exec(t,ct,K)})})}_exec(t,r,u){const T=VE(t);Kd(u["before"+T],[],u),r[t](u),Kd(u["after"+T],[],u)}_getRegistryForType(t){for(let r=0;r$.filter(ct=>!K.some(yt=>ct.plugin.id===yt.plugin.id));this._notify(T(r,u),t,"stop"),this._notify(T(u,r),t,"start")}}function hdt(e){const t={},r=[],u=Object.keys(bv.plugins.items);for(let $=0;$1&&NR(e[0].toLowerCase());if(u)return u}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function jR(e,t,r){if(r[t+"AxisID"]===e)return{axis:t}}function ydt(e,t){if(t.data&&t.data.datasets){const r=t.data.datasets.filter(u=>u.xAxisID===e||u.yAxisID===e);if(r.length)return jR(e,"x",r[0])||jR(e,"y",r[0])}return{}}function _dt(e,t){const r=Hx[e.type]||{scales:{}},u=t.scales||{},T=c9(e.type,t),$=Object.create(null);return Object.keys(u).forEach(K=>{const ct=u[K];if(!Uu(ct))return console.error(`Invalid scale configuration for scale: ${K}`);if(ct._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${K}`);const yt=u9(K,ct,ydt(K,e),lp.scales[ct.type]),St=gdt(yt,T),Ut=r.scales||{};$[K]=C5(Object.create(null),[{axis:yt},ct,Ut[yt],Ut[St]])}),e.data.datasets.forEach(K=>{const ct=K.type||e.type,yt=K.indexAxis||c9(ct,t),Ut=(Hx[ct]||{}).scales||{};Object.keys(Ut).forEach(ne=>{const pe=mdt(ne,yt),me=K[pe+"AxisID"]||pe;$[me]=$[me]||Object.create(null),C5($[me],[{axis:pe},u[me],Ut[ne]])})}),Object.keys($).forEach(K=>{const ct=$[K];C5(ct,[lp.scales[ct.type],lp.scale])}),$}function eH(e){const t=e.options||(e.options={});t.plugins=_u(t.plugins,{}),t.scales=_dt(e,t)}function rH(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function xdt(e){return e=e||{},e.data=rH(e.data),eH(e),e}const UR=new Map,nH=new Set;function Z6(e,t){let r=UR.get(e);return r||(r=t(),UR.set(e,r),nH.add(r)),r}const j3=(e,t,r)=>{const u=$x(t,r);u!==void 0&&e.add(u)};class bdt{constructor(t){this._config=xdt(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=rH(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),eH(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Z6(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,r){return Z6(`${t}.transition.${r}`,()=>[[`datasets.${t}.transitions.${r}`,`transitions.${r}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,r){return Z6(`${t}-${r}`,()=>[[`datasets.${t}.elements.${r}`,`datasets.${t}`,`elements.${r}`,""]])}pluginScopeKeys(t){const r=t.id,u=this.type;return Z6(`${u}-plugin-${r}`,()=>[[`plugins.${r}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,r){const u=this._scopeCache;let T=u.get(t);return(!T||r)&&(T=new Map,u.set(t,T)),T}getOptionScopes(t,r,u){const{options:T,type:$}=this,K=this._cachedScopes(t,u),ct=K.get(r);if(ct)return ct;const yt=new Set;r.forEach(Ut=>{t&&(yt.add(t),Ut.forEach(ne=>j3(yt,t,ne))),Ut.forEach(ne=>j3(yt,T,ne)),Ut.forEach(ne=>j3(yt,Hx[$]||{},ne)),Ut.forEach(ne=>j3(yt,lp,ne)),Ut.forEach(ne=>j3(yt,s9,ne))});const St=Array.from(yt);return St.length===0&&St.push(Object.create(null)),nH.has(r)&&K.set(r,St),St}chartOptionScopes(){const{options:t,type:r}=this;return[t,Hx[r]||{},lp.datasets[r]||{},{type:r},lp,s9]}resolveNamedOptions(t,r,u,T=[""]){const $={$shared:!0},{resolver:K,subPrefixes:ct}=$R(this._resolverCache,t,T);let yt=K;if(kdt(K,r)){$.$shared=!1,u=__(u)?u():u;const St=this.createResolver(t,u,ct);yt=V2(K,u,St)}for(const St of r)$[St]=yt[St];return $}createResolver(t,r,u=[""],T){const{resolver:$}=$R(this._resolverCache,t,u);return Uu(r)?V2($,r,void 0,T):$}}function $R(e,t,r){let u=e.get(t);u||(u=new Map,e.set(t,u));const T=r.join();let $=u.get(T);return $||($={resolver:YE(t,r),subPrefixes:r.filter(ct=>!ct.toLowerCase().includes("hover"))},u.set(T,$)),$}const wdt=e=>Uu(e)&&Object.getOwnPropertyNames(e).some(t=>__(e[t]));function kdt(e,t){const{isScriptable:r,isIndexable:u}=D$(e);for(const T of t){const $=r(T),K=u(T),ct=(K||$)&&e[T];if($&&(__(ct)||wdt(ct))||K&&Tp(ct))return!0}return!1}var Tdt="4.5.1";const Sdt=["top","bottom","left","right","chartArea"];function HR(e,t){return e==="top"||e==="bottom"||Sdt.indexOf(e)===-1&&t==="x"}function VR(e,t){return function(r,u){return r[e]===u[e]?r[t]-u[t]:r[e]-u[e]}}function WR(e){const t=e.chart,r=t.options.animation;t.notifyPlugins("afterRender"),Kd(r&&r.onComplete,[e],t)}function Cdt(e){const t=e.chart,r=t.options.animation;Kd(r&&r.onProgress,[e],t)}function iH(e){return QE()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const ST={},qR=e=>{const t=iH(e);return Object.values(ST).filter(r=>r.canvas===t).pop()};function Adt(e,t,r){const u=Object.keys(e);for(const T of u){const $=+T;if($>=t){const K=e[T];delete e[T],(r>0||$>t)&&(e[$+r]=K)}}}function Mdt(e,t,r,u){return!r||e.type==="mouseout"?null:u?t:e}class Av{static defaults=lp;static instances=ST;static overrides=Hx;static registry=bv;static version=Tdt;static getChart=qR;static register(...t){bv.add(...t),GR()}static unregister(...t){bv.remove(...t),GR()}constructor(t,r){const u=this.config=new bdt(r),T=iH(t),$=qR(T);if($)throw new Error("Canvas is already in use. Chart with ID '"+$.id+"' must be destroyed before the canvas with ID '"+$.canvas.id+"' can be reused.");const K=u.createResolver(u.chartOptionScopes(),this.getContext());this.platform=new(u.platform||qht(T)),this.platform.updateConfig(u);const ct=this.platform.acquireContext(T,K.aspectRatio),yt=ct&&ct.canvas,St=yt&&yt.height,Ut=yt&&yt.width;if(this.id=Mct(),this.ctx=ct,this.canvas=yt,this.width=Ut,this.height=St,this._options=K,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new udt,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Gct(ne=>this.update(ne),K.resizeDelay||0),this._dataChanges=[],ST[this.id]=this,!ct||!yt){console.error("Failed to create chart: can't acquire context from the given item");return}k1.listen(this,"complete",WR),k1.listen(this,"progress",Cdt),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:r},width:u,height:T,_aspectRatio:$}=this;return Rh(t)?r&&$?$:T?u/T:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return bv}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():mR(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return dR(this.canvas,this.ctx),this}stop(){return k1.stop(this),this}resize(t,r){k1.running(this)?this._resizeBeforeDraw={width:t,height:r}:this._resize(t,r)}_resize(t,r){const u=this.options,T=this.canvas,$=u.maintainAspectRatio&&this.aspectRatio,K=this.platform.getMaximumSize(T,t,r,$),ct=u.devicePixelRatio||this.platform.getDevicePixelRatio(),yt=this.width?"resize":"attach";this.width=K.width,this.height=K.height,this._aspectRatio=this.aspectRatio,mR(this,ct,!0)&&(this.notifyPlugins("resize",{size:K}),Kd(u.onResize,[this,K],this),this.attached&&this._doResize(yt)&&this.render())}ensureScalesHaveIDs(){const r=this.options.scales||{};cd(r,(u,T)=>{u.id=T})}buildOrUpdateScales(){const t=this.options,r=t.scales,u=this.scales,T=Object.keys(u).reduce((K,ct)=>(K[ct]=!1,K),{});let $=[];r&&($=$.concat(Object.keys(r).map(K=>{const ct=r[K],yt=u9(K,ct),St=yt==="r",Ut=yt==="x";return{options:ct,dposition:St?"chartArea":Ut?"bottom":"left",dtype:St?"radialLinear":Ut?"category":"linear"}}))),cd($,K=>{const ct=K.options,yt=ct.id,St=u9(yt,ct),Ut=_u(ct.type,K.dtype);(ct.position===void 0||HR(ct.position,St)!==HR(K.dposition))&&(ct.position=K.dposition),T[yt]=!0;let ne=null;if(yt in u&&u[yt].type===Ut)ne=u[yt];else{const pe=bv.getScale(Ut);ne=new pe({id:yt,type:Ut,ctx:this.ctx,chart:this}),u[ne.id]=ne}ne.init(ct,t)}),cd(T,(K,ct)=>{K||delete u[ct]}),cd(u,K=>{vg.configure(this,K,K.options),vg.addBox(this,K)})}_updateMetasets(){const t=this._metasets,r=this.data.datasets.length,u=t.length;if(t.sort((T,$)=>T.index-$.index),u>r){for(let T=r;Tr.length&&delete this._stacks,t.forEach((u,T)=>{r.filter($=>$===u._dataset).length===0&&this._destroyDatasetMeta(T)})}buildOrUpdateControllers(){const t=[],r=this.data.datasets;let u,T;for(this._removeUnreferencedMetasets(),u=0,T=r.length;u{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const r=this.config;r.update();const u=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),T=this._animationsDisabled=!u.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const $=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let K=0;for(let St=0,Ut=this.data.datasets.length;St{St.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(VR("z","_idx"));const{_active:ct,_lastEvent:yt}=this;yt?this._eventHandler(yt,!0):ct.length&&this._updateHoverStyles(ct,ct,!0),this.render()}_updateScales(){cd(this.scales,t=>{vg.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,r=new Set(Object.keys(this._listeners)),u=new Set(t.events);(!rR(r,u)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,r=this._getUniformDataChanges()||[];for(const{method:u,start:T,count:$}of r){const K=u==="_removeElements"?-$:$;Adt(t,T,K)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const r=this.data.datasets.length,u=$=>new Set(t.filter(K=>K[0]===$).map((K,ct)=>ct+","+K.splice(1).join(","))),T=u(0);for(let $=1;$$.split(",")).map($=>({method:$[1],start:+$[2],count:+$[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vg.update(this,this.width,this.height,t);const r=this.chartArea,u=r.width<=0||r.height<=0;this._layers=[],cd(this.boxes,T=>{u&&T.position==="chartArea"||(T.configure&&T.configure(),this._layers.push(...T._layers()))},this),this._layers.forEach((T,$)=>{T._idx=$}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let r=0,u=this.data.datasets.length;r=0;--r)this._drawDataset(t[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const r=this.ctx,u={meta:t,index:t.index,cancelable:!0},T=H$(this,t);this.notifyPlugins("beforeDatasetDraw",u)!==!1&&(T&&HS(r,T),t.controller.draw(),T&&VS(r),u.cancelable=!1,this.notifyPlugins("afterDatasetDraw",u))}isPointInArea(t){return G5(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,r,u,T){const $=Sht.modes[r];return typeof $=="function"?$(this,t,u,T):[]}getDatasetMeta(t){const r=this.data.datasets[t],u=this._metasets;let T=u.filter($=>$&&$._dataset===r).pop();return T||(T={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:t,_dataset:r,_parsed:[],_sorted:!1},u.push(T)),T}getContext(){return this.$context||(this.$context=Gx(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const r=this.data.datasets[t];if(!r)return!1;const u=this.getDatasetMeta(t);return typeof u.hidden=="boolean"?!u.hidden:!r.hidden}setDatasetVisibility(t,r){const u=this.getDatasetMeta(t);u.hidden=!r}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,r,u){const T=u?"show":"hide",$=this.getDatasetMeta(t),K=$.controller._resolveAnimations(void 0,T);W5(r)?($.data[r].hidden=!u,this.update()):(this.setDatasetVisibility(t,u),K.update($,{visible:u}),this.update(ct=>ct.datasetIndex===t?T:void 0))}hide(t,r){this._updateVisibility(t,r,!1)}show(t,r){this._updateVisibility(t,r,!0)}_destroyDatasetMeta(t){const r=this._metasets[t];r&&r.controller&&r.controller._destroy(),delete this._metasets[t]}_stop(){let t,r;for(this.stop(),k1.remove(this),t=0,r=this.data.datasets.length;t{r.addEventListener(this,$,K),t[$]=K},T=($,K,ct)=>{$.offsetX=K,$.offsetY=ct,this._eventHandler($)};cd(this.options.events,$=>u($,T))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,r=this.platform,u=(yt,St)=>{r.addEventListener(this,yt,St),t[yt]=St},T=(yt,St)=>{t[yt]&&(r.removeEventListener(this,yt,St),delete t[yt])},$=(yt,St)=>{this.canvas&&this.resize(yt,St)};let K;const ct=()=>{T("attach",ct),this.attached=!0,this.resize(),u("resize",$),u("detach",K)};K=()=>{this.attached=!1,T("resize",$),this._stop(),this._resize(0,0),u("attach",ct)},r.isAttached(this.canvas)?ct():K()}unbindEvents(){cd(this._listeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._listeners={},cd(this._responsiveListeners,(t,r)=>{this.platform.removeEventListener(this,r,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,r,u){const T=u?"set":"remove";let $,K,ct,yt;for(r==="dataset"&&($=this.getDatasetMeta(t[0].datasetIndex),$.controller["_"+T+"DatasetHoverStyle"]()),ct=0,yt=t.length;ct{const ct=this.getDatasetMeta($);if(!ct)throw new Error("No dataset found at index "+$);return{datasetIndex:$,element:ct.data[K],index:K}});!XT(u,r)&&(this._active=u,this._lastEvent=null,this._updateHoverStyles(u,r))}notifyPlugins(t,r,u){return this._plugins.notify(this,t,r,u)}isPluginEnabled(t){return this._plugins._cache.filter(r=>r.plugin.id===t).length===1}_updateHoverStyles(t,r,u){const T=this.options.hover,$=(yt,St)=>yt.filter(Ut=>!St.some(ne=>Ut.datasetIndex===ne.datasetIndex&&Ut.index===ne.index)),K=$(r,t),ct=u?t:$(t,r);K.length&&this.updateHoverStyle(K,T.mode,!1),ct.length&&T.mode&&this.updateHoverStyle(ct,T.mode,!0)}_eventHandler(t,r){const u={event:t,replay:r,cancelable:!0,inChartArea:this.isPointInArea(t)},T=K=>(K.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",u,T)===!1)return;const $=this._handleEvent(t,r,u.inChartArea);return u.cancelable=!1,this.notifyPlugins("afterEvent",u,T),($||u.changed)&&this.render(),this}_handleEvent(t,r,u){const{_active:T=[],options:$}=this,K=r,ct=this._getActiveElements(t,T,u,K),yt=zct(t),St=Mdt(t,this._lastEvent,u,yt);u&&(this._lastEvent=null,Kd($.onHover,[t,ct,this],this),yt&&Kd($.onClick,[t,ct,this],this));const Ut=!XT(ct,T);return(Ut||r)&&(this._active=ct,this._updateHoverStyles(ct,T,r)),this._lastEvent=St,Ut}_getActiveElements(t,r,u,T){if(t.type==="mouseout")return[];if(!u)return r;const $=this.options.hover;return this.getElementsAtEventForMode(t,$.mode,$,T)}}function GR(){return cd(Av.instances,e=>e._plugins.invalidate())}function Edt(e,t,r){const{startAngle:u,x:T,y:$,outerRadius:K,innerRadius:ct,options:yt}=t,{borderWidth:St,borderJoinStyle:Ut}=yt,ne=Math.min(St/K,Gm(u-r));if(e.beginPath(),e.arc(T,$,K-St/2,u+ne/2,r-ne/2),ct>0){const pe=Math.min(St/ct,Gm(u-r));e.arc(T,$,ct+St/2,r-pe/2,u+pe/2,!0)}else{const pe=Math.min(St/2,K*Gm(u-r));if(Ut==="round")e.arc(T,$,pe,r-ud/2,u+ud/2,!0);else if(Ut==="bevel"){const me=2*pe*pe,we=-me*Math.cos(r+ud/2)+T,Ce=-me*Math.sin(r+ud/2)+$,Ve=me*Math.cos(u+ud/2)+T,kr=me*Math.sin(u+ud/2)+$;e.lineTo(we,Ce),e.lineTo(Ve,kr)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ldt(e,t,r){const{startAngle:u,pixelMargin:T,x:$,y:K,outerRadius:ct,innerRadius:yt}=t;let St=T/ct;e.beginPath(),e.arc($,K,ct,u-St,r+St),yt>T?(St=T/yt,e.arc($,K,yt,r+St,u-St,!0)):e.arc($,K,T,r+Bp,u-Bp),e.closePath(),e.clip()}function Pdt(e){return KE(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Idt(e,t,r,u){const T=Pdt(e.options.borderRadius),$=(r-t)/2,K=Math.min($,u*t/2),ct=yt=>{const St=(r-Math.min($,yt))*u/2;return j0(yt,0,Math.min($,St))};return{outerStart:ct(T.outerStart),outerEnd:ct(T.outerEnd),innerStart:j0(T.innerStart,0,K),innerEnd:j0(T.innerEnd,0,K)}}function v2(e,t,r,u){return{x:r+e*Math.cos(t),y:u+e*Math.sin(t)}}function nS(e,t,r,u,T,$){const{x:K,y:ct,startAngle:yt,pixelMargin:St,innerRadius:Ut}=t,ne=Math.max(t.outerRadius+u+r-St,0),pe=Ut>0?Ut+u+r+St:0;let me=0;const we=T-yt;if(u){const Dr=Ut>0?Ut-u:0,nn=ne>0?ne-u:0,Cn=(Dr+nn)/2,Xn=Cn!==0?we*Cn/(Cn+u):we;me=(we-Xn)/2}const Ce=Math.max(.001,we*ne-r/ud)/ne,Ve=(we-Ce)/2,kr=yt+Ve+me,It=T-Ve-me,{outerStart:rn,outerEnd:Lr,innerStart:Mr,innerEnd:tn}=Idt(t,pe,ne,It-kr),Dn=ne-rn,Mn=ne-Lr,Br=kr+rn/Dn,Vn=It-Lr/Mn,on=pe+Mr,pr=pe+tn,_r=kr+Mr/on,Sr=It-tn/pr;if(e.beginPath(),$){const Dr=(Br+Vn)/2;if(e.arc(K,ct,ne,Br,Dr),e.arc(K,ct,ne,Dr,Vn),Lr>0){const _i=v2(Mn,Vn,K,ct);e.arc(_i.x,_i.y,Lr,Vn,It+Bp)}const nn=v2(pr,It,K,ct);if(e.lineTo(nn.x,nn.y),tn>0){const _i=v2(pr,Sr,K,ct);e.arc(_i.x,_i.y,tn,It+Bp,Sr+Math.PI)}const Cn=(It-tn/pe+(kr+Mr/pe))/2;if(e.arc(K,ct,pe,It-tn/pe,Cn,!0),e.arc(K,ct,pe,Cn,kr+Mr/pe,!0),Mr>0){const _i=v2(on,_r,K,ct);e.arc(_i.x,_i.y,Mr,_r+Math.PI,kr-Bp)}const Xn=v2(Dn,kr,K,ct);if(e.lineTo(Xn.x,Xn.y),rn>0){const _i=v2(Dn,Br,K,ct);e.arc(_i.x,_i.y,rn,kr-Bp,Br)}}else{e.moveTo(K,ct);const Dr=Math.cos(Br)*ne+K,nn=Math.sin(Br)*ne+ct;e.lineTo(Dr,nn);const Cn=Math.cos(Vn)*ne+K,Xn=Math.sin(Vn)*ne+ct;e.lineTo(Cn,Xn)}e.closePath()}function Ddt(e,t,r,u,T){const{fullCircles:$,startAngle:K,circumference:ct}=t;let yt=t.endAngle;if($){nS(e,t,r,u,yt,T);for(let St=0;St<$;++St)e.fill();isNaN(ct)||(yt=K+(ct%Cf||Cf))}return nS(e,t,r,u,yt,T),e.fill(),yt}function zdt(e,t,r,u,T){const{fullCircles:$,startAngle:K,circumference:ct,options:yt}=t,{borderWidth:St,borderJoinStyle:Ut,borderDash:ne,borderDashOffset:pe,borderRadius:me}=yt,we=yt.borderAlign==="inner";if(!St)return;e.setLineDash(ne||[]),e.lineDashOffset=pe,we?(e.lineWidth=St*2,e.lineJoin=Ut||"round"):(e.lineWidth=St,e.lineJoin=Ut||"bevel");let Ce=t.endAngle;if($){nS(e,t,r,u,Ce,T);for(let Ve=0;Ve<$;++Ve)e.stroke();isNaN(ct)||(Ce=K+(ct%Cf||Cf))}we&&Ldt(e,t,Ce),yt.selfJoin&&Ce-K>=ud&&me===0&&Ut!=="miter"&&Edt(e,t,Ce),$||(nS(e,t,r,u,Ce,T),e.stroke())}class aH extends G1{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,r,u){const T=this.getProps(["x","y"],u),{angle:$,distance:K}=k$(T,{x:t,y:r}),{startAngle:ct,endAngle:yt,innerRadius:St,outerRadius:Ut,circumference:ne}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],u),pe=(this.options.spacing+this.options.borderWidth)/2,me=_u(ne,yt-ct),we=q5($,ct,yt)&&ct!==yt,Ce=me>=Cf||we,Ve=O1(K,St+pe,Ut+pe);return Ce&&Ve}getCenterPoint(t){const{x:r,y:u,startAngle:T,endAngle:$,innerRadius:K,outerRadius:ct}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:yt,spacing:St}=this.options,Ut=(T+$)/2,ne=(K+ct+St+yt)/2;return{x:r+Math.cos(Ut)*ne,y:u+Math.sin(Ut)*ne}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:r,circumference:u}=this,T=(r.offset||0)/4,$=(r.spacing||0)/2,K=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=u>Cf?Math.floor(u/Cf):0,u===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const ct=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(ct)*T,Math.sin(ct)*T);const yt=1-Math.sin(Math.min(ud,u||0)),St=T*yt;t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,Ddt(t,this,St,$,K),zdt(t,this,St,$,K),t.restore()}}function oH(e,t,r=t){e.lineCap=_u(r.borderCapStyle,t.borderCapStyle),e.setLineDash(_u(r.borderDash,t.borderDash)),e.lineDashOffset=_u(r.borderDashOffset,t.borderDashOffset),e.lineJoin=_u(r.borderJoinStyle,t.borderJoinStyle),e.lineWidth=_u(r.borderWidth,t.borderWidth),e.strokeStyle=_u(r.borderColor,t.borderColor)}function Odt(e,t,r){e.lineTo(r.x,r.y)}function Bdt(e){return e.stepped?aut:e.tension||e.cubicInterpolationMode==="monotone"?out:Odt}function sH(e,t,r={}){const u=e.length,{start:T=0,end:$=u-1}=r,{start:K,end:ct}=t,yt=Math.max(T,K),St=Math.min($,ct),Ut=Tct&&$>ct;return{count:u,start:yt,loop:t.loop,ilen:St(K+(St?ct-Lr:Lr))%$,rn=()=>{Ce!==Ve&&(e.lineTo(Ut,Ve),e.lineTo(Ut,Ce),e.lineTo(Ut,kr))};for(yt&&(me=T[It(0)],e.moveTo(me.x,me.y)),pe=0;pe<=ct;++pe){if(me=T[It(pe)],me.skip)continue;const Lr=me.x,Mr=me.y,tn=Lr|0;tn===we?(MrVe&&(Ve=Mr),Ut=(ne*Ut+Lr)/++ne):(rn(),e.lineTo(Lr,Mr),we=tn,ne=0,Ce=Ve=Mr),kr=Mr}rn()}function h9(e){const t=e.options,r=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!r?Fdt:Rdt}function Ndt(e){return e.stepped?Fut:e.tension||e.cubicInterpolationMode==="monotone"?Nut:_x}function jdt(e,t,r,u){let T=t._path;T||(T=t._path=new Path2D,t.path(T,r,u)&&T.closePath()),oH(e,t.options),e.stroke(T)}function Udt(e,t,r,u){const{segments:T,options:$}=t,K=h9(t);for(const ct of T)oH(e,$,ct.style),e.beginPath(),K(e,t,ct,{start:r,end:r+u-1})&&e.closePath(),e.stroke()}const $dt=typeof Path2D=="function";function Hdt(e,t,r,u){$dt&&!t.options.segment?jdt(e,t,r,u):Udt(e,t,r,u)}class J2 extends G1{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,r){const u=this.options;if((u.tension||u.cubicInterpolationMode==="monotone")&&!u.stepped&&!this._pointsUpdated){const T=u.spanGaps?this._loop:this._fullLoop;Lut(this._points,u,t,T,r),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Wut(this,this.options.segment))}first(){const t=this.segments,r=this.points;return t.length&&r[t[0].start]}last(){const t=this.segments,r=this.points,u=t.length;return u&&r[t[u-1].end]}interpolate(t,r){const u=this.options,T=t[r],$=this.points,K=$$(this,{property:r,start:T,end:T});if(!K.length)return;const ct=[],yt=Ndt(u);let St,Ut;for(St=0,Ut=K.length;St{ct=GS(K,ct,T);const yt=T[K],St=T[ct];u!==null?($.push({x:yt.x,y:u}),$.push({x:St.x,y:u})):r!==null&&($.push({x:r,y:yt.y}),$.push({x:r,y:St.y}))}),$}function GS(e,t,r){for(;t>e;t--){const u=r[t];if(!isNaN(u.x)&&!isNaN(u.y))break}return t}function KR(e,t,r,u){return e&&t?u(e[r],t[r]):e?e[r]:t?t[r]:0}function uH(e,t){let r=[],u=!1;return Tp(e)?(u=!0,r=e):r=Ydt(e,t),r.length?new J2({points:r,options:{tension:0},_loop:u,_fullLoop:u}):null}function YR(e){return e&&e.fill!==!1}function Xdt(e,t,r){let T=e[t].fill;const $=[t];let K;if(!r)return T;for(;T!==!1&&$.indexOf(T)===-1;){if(!$0(T))return T;if(K=e[T],!K)return!1;if(K.visible)return T;$.push(T),T=K.fill}return!1}function Jdt(e,t,r){const u=rft(e);if(Uu(u))return isNaN(u.value)?!1:u;let T=parseFloat(u);return $0(T)&&Math.floor(T)===T?Qdt(u[0],t,T,r):["origin","start","end","stack","shape"].indexOf(u)>=0&&u}function Qdt(e,t,r,u){return(e==="-"||e==="+")&&(r=t+r),r===t||r<0||r>=u?!1:r}function tft(e,t){let r=null;return e==="start"?r=t.bottom:e==="end"?r=t.top:Uu(e)?r=t.getPixelForValue(e.value):t.getBasePixel&&(r=t.getBasePixel()),r}function eft(e,t,r){let u;return e==="start"?u=r:e==="end"?u=t.options.reverse?t.min:t.max:Uu(e)?u=e.value:u=t.getBaseValue(),u}function rft(e){const t=e.options,r=t.fill;let u=_u(r&&r.target,r);return u===void 0&&(u=!!t.backgroundColor),u===!1||u===null?!1:u===!0?"origin":u}function nft(e){const{scale:t,index:r,line:u}=e,T=[],$=u.segments,K=u.points,ct=ift(t,r);ct.push(uH({x:null,y:t.bottom},u));for(let yt=0;yt<$.length;yt++){const St=$[yt];for(let Ut=St.start;Ut<=St.end;Ut++)aft(T,K[Ut],ct)}return new J2({points:T,options:{}})}function ift(e,t){const r=[],u=e.getMatchingVisibleMetas("line");for(let T=0;T=0;--K){const ct=T[K].$filler;ct&&(ct.line.updateControlPoints($,ct.axis),u&&ct.fill&&G7(e.ctx,ct,$))}},beforeDatasetsDraw(e,t,r){if(r.drawTime!=="beforeDatasetsDraw")return;const u=e.getSortedVisibleDatasetMetas();for(let T=u.length-1;T>=0;--T){const $=u[T].$filler;YR($)&&G7(e.ctx,$,e.chartArea)}},beforeDatasetDraw(e,t,r){const u=t.meta.$filler;!YR(u)||r.drawTime!=="beforeDatasetDraw"||G7(e.ctx,u,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const tF=(e,t)=>{let{boxHeight:r=t,boxWidth:u=t}=e;return e.usePointStyle&&(r=Math.min(r,t),u=e.pointStyleWidth||Math.min(u,t)),{boxWidth:u,boxHeight:r,itemHeight:Math.max(t,r)}},pft=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class eF extends G1{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,r,u){this.maxWidth=t,this.maxHeight=r,this._margins=u,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let r=Kd(t.generateLabels,[this.chart],this)||[];t.filter&&(r=r.filter(u=>t.filter(u,this.chart.data))),t.sort&&(r=r.sort((u,T)=>t.sort(u,T,this.chart.data))),this.options.reverse&&r.reverse(),this.legendItems=r}fit(){const{options:t,ctx:r}=this;if(!t.display){this.width=this.height=0;return}const u=t.labels,T=U0(u.font),$=T.size,K=this._computeTitleHeight(),{boxWidth:ct,itemHeight:yt}=tF(u,$);let St,Ut;r.font=T.string,this.isHorizontal()?(St=this.maxWidth,Ut=this._fitRows(K,$,ct,yt)+10):(Ut=this.maxHeight,St=this._fitCols(K,T,ct,yt)+10),this.width=Math.min(St,t.maxWidth||this.maxWidth),this.height=Math.min(Ut,t.maxHeight||this.maxHeight)}_fitRows(t,r,u,T){const{ctx:$,maxWidth:K,options:{labels:{padding:ct}}}=this,yt=this.legendHitBoxes=[],St=this.lineWidths=[0],Ut=T+ct;let ne=t;$.textAlign="left",$.textBaseline="middle";let pe=-1,me=-Ut;return this.legendItems.forEach((we,Ce)=>{const Ve=u+r/2+$.measureText(we.text).width;(Ce===0||St[St.length-1]+Ve+2*ct>K)&&(ne+=Ut,St[St.length-(Ce>0?0:1)]=0,me+=Ut,pe++),yt[Ce]={left:0,top:me,row:pe,width:Ve,height:T},St[St.length-1]+=Ve+ct}),ne}_fitCols(t,r,u,T){const{ctx:$,maxHeight:K,options:{labels:{padding:ct}}}=this,yt=this.legendHitBoxes=[],St=this.columnSizes=[],Ut=K-t;let ne=ct,pe=0,me=0,we=0,Ce=0;return this.legendItems.forEach((Ve,kr)=>{const{itemWidth:It,itemHeight:rn}=mft(u,r,$,Ve,T);kr>0&&me+rn+2*ct>Ut&&(ne+=pe+ct,St.push({width:pe,height:me}),we+=pe+ct,Ce++,pe=me=0),yt[kr]={left:we,top:me,col:Ce,width:It,height:rn},pe=Math.max(pe,It),me+=rn+ct}),ne+=pe,St.push({width:pe,height:me}),ne}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:r,options:{align:u,labels:{padding:T},rtl:$}}=this,K=z2($,this.left,this.width);if(this.isHorizontal()){let ct=0,yt=z0(u,this.left+T,this.right-this.lineWidths[ct]);for(const St of r)ct!==St.row&&(ct=St.row,yt=z0(u,this.left+T,this.right-this.lineWidths[ct])),St.top+=this.top+t+T,St.left=K.leftForLtr(K.x(yt),St.width),yt+=St.width+T}else{let ct=0,yt=z0(u,this.top+t+T,this.bottom-this.columnSizes[ct].height);for(const St of r)St.col!==ct&&(ct=St.col,yt=z0(u,this.top+t+T,this.bottom-this.columnSizes[ct].height)),St.top=yt,St.left+=this.left+T,St.left=K.leftForLtr(K.x(St.left),St.width),yt+=St.height+T}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;HS(t,this),this._draw(),VS(t)}}_draw(){const{options:t,columnSizes:r,lineWidths:u,ctx:T}=this,{align:$,labels:K}=t,ct=lp.color,yt=z2(t.rtl,this.left,this.width),St=U0(K.font),{padding:Ut}=K,ne=St.size,pe=ne/2;let me;this.drawTitle(),T.textAlign=yt.textAlign("left"),T.textBaseline="middle",T.lineWidth=.5,T.font=St.string;const{boxWidth:we,boxHeight:Ce,itemHeight:Ve}=tF(K,ne),kr=function(tn,Dn,Mn){if(isNaN(we)||we<=0||isNaN(Ce)||Ce<0)return;T.save();const Br=_u(Mn.lineWidth,1);if(T.fillStyle=_u(Mn.fillStyle,ct),T.lineCap=_u(Mn.lineCap,"butt"),T.lineDashOffset=_u(Mn.lineDashOffset,0),T.lineJoin=_u(Mn.lineJoin,"miter"),T.lineWidth=Br,T.strokeStyle=_u(Mn.strokeStyle,ct),T.setLineDash(_u(Mn.lineDash,[])),K.usePointStyle){const Vn={radius:Ce*Math.SQRT2/2,pointStyle:Mn.pointStyle,rotation:Mn.rotation,borderWidth:Br},on=yt.xPlus(tn,we/2),pr=Dn+pe;P$(T,Vn,on,pr,K.pointStyleWidth&&we)}else{const Vn=Dn+Math.max((ne-Ce)/2,0),on=yt.leftForLtr(tn,we),pr=D2(Mn.borderRadius);T.beginPath(),Object.values(pr).some(_r=>_r!==0)?tS(T,{x:on,y:Vn,w:we,h:Ce,radius:pr}):T.rect(on,Vn,we,Ce),T.fill(),Br!==0&&T.stroke()}T.restore()},It=function(tn,Dn,Mn){Z5(T,Mn.text,tn,Dn+Ve/2,St,{strikethrough:Mn.hidden,textAlign:yt.textAlign(Mn.textAlign)})},rn=this.isHorizontal(),Lr=this._computeTitleHeight();rn?me={x:z0($,this.left+Ut,this.right-u[0]),y:this.top+Ut+Lr,line:0}:me={x:this.left+Ut,y:z0($,this.top+Lr+Ut,this.bottom-r[0].height),line:0},F$(this.ctx,t.textDirection);const Mr=Ve+Ut;this.legendItems.forEach((tn,Dn)=>{T.strokeStyle=tn.fontColor,T.fillStyle=tn.fontColor;const Mn=T.measureText(tn.text).width,Br=yt.textAlign(tn.textAlign||(tn.textAlign=K.textAlign)),Vn=we+pe+Mn;let on=me.x,pr=me.y;yt.setWidth(this.width),rn?Dn>0&&on+Vn+Ut>this.right&&(pr=me.y+=Mr,me.line++,on=me.x=z0($,this.left+Ut,this.right-u[me.line])):Dn>0&&pr+Mr>this.bottom&&(on=me.x=on+r[me.line].width+Ut,me.line++,pr=me.y=z0($,this.top+Lr+Ut,this.bottom-r[me.line].height));const _r=yt.x(on);if(kr(_r,pr,tn),on=Zct(Br,on+we+pe,rn?on+Vn:this.right,t.rtl),It(yt.x(on),pr,tn),rn)me.x+=Vn+Ut;else if(typeof tn.text!="string"){const Sr=St.lineHeight;me.y+=dH(tn,Sr)+Ut}else me.y+=Mr}),N$(this.ctx,t.textDirection)}drawTitle(){const t=this.options,r=t.title,u=U0(r.font),T=kg(r.padding);if(!r.display)return;const $=z2(t.rtl,this.left,this.width),K=this.ctx,ct=r.position,yt=u.size/2,St=T.top+yt;let Ut,ne=this.left,pe=this.width;if(this.isHorizontal())pe=Math.max(...this.lineWidths),Ut=this.top+St,ne=z0(t.align,ne,this.right-pe);else{const we=this.columnSizes.reduce((Ce,Ve)=>Math.max(Ce,Ve.height),0);Ut=St+z0(t.align,this.top,this.bottom-we-t.labels.padding-this._computeTitleHeight())}const me=z0(ct,ne,ne+pe);K.textAlign=$.textAlign(qE(ct)),K.textBaseline="middle",K.strokeStyle=r.color,K.fillStyle=r.color,K.font=u.string,Z5(K,r.text,me,Ut,u)}_computeTitleHeight(){const t=this.options.title,r=U0(t.font),u=kg(t.padding);return t.display?r.lineHeight+u.height:0}_getLegendItemAt(t,r){let u,T,$;if(O1(t,this.left,this.right)&&O1(r,this.top,this.bottom)){for($=this.legendHitBoxes,u=0;u<$.length;++u)if(T=$[u],O1(t,T.left,T.left+T.width)&&O1(r,T.top,T.top+T.height))return this.legendItems[u]}return null}handleEvent(t){const r=this.options;if(!yft(t.type,r))return;const u=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const T=this._hoveredItem,$=pft(T,u);T&&!$&&Kd(r.onLeave,[t,T,this],this),this._hoveredItem=u,u&&!$&&Kd(r.onHover,[t,u,this],this)}else u&&Kd(r.onClick,[t,u,this],this)}}function mft(e,t,r,u,T){const $=gft(u,e,t,r),K=vft(T,u,t.lineHeight);return{itemWidth:$,itemHeight:K}}function gft(e,t,r,u){let T=e.text;return T&&typeof T!="string"&&(T=T.reduce(($,K)=>$.length>K.length?$:K)),t+r.size/2+u.measureText(T).width}function vft(e,t,r){let u=e;return typeof t.text!="string"&&(u=dH(t,r)),u}function dH(e,t){const r=e.text?e.text.length:0;return t*r}function yft(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var fH={id:"legend",_element:eF,start(e,t,r){const u=e.legend=new eF({ctx:e.ctx,options:r,chart:e});vg.configure(e,u,r),vg.addBox(e,u)},stop(e){vg.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,r){const u=e.legend;vg.configure(e,u,r),u.options=r},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,r){const u=t.datasetIndex,T=r.chart;T.isDatasetVisible(u)?(T.hide(u),t.hidden=!0):(T.show(u),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:r,pointStyle:u,textAlign:T,color:$,useBorderRadius:K,borderRadius:ct}}=e.legend.options;return e._getSortedDatasetMetas().map(yt=>{const St=yt.controller.getStyle(r?0:void 0),Ut=kg(St.borderWidth);return{text:t[yt.index].label,fillStyle:St.backgroundColor,fontColor:$,hidden:!yt.visible,lineCap:St.borderCapStyle,lineDash:St.borderDash,lineDashOffset:St.borderDashOffset,lineJoin:St.borderJoinStyle,lineWidth:(Ut.width+Ut.height)/4,strokeStyle:St.borderColor,pointStyle:u||St.pointStyle,rotation:St.rotation,textAlign:T||St.textAlign,borderRadius:K&&(ct||St.borderRadius),datasetIndex:yt.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class pH extends G1{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,r){const u=this.options;if(this.left=0,this.top=0,!u.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=r;const T=Tp(u.text)?u.text.length:1;this._padding=kg(u.padding);const $=T*U0(u.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=$:this.width=$}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:r,left:u,bottom:T,right:$,options:K}=this,ct=K.align;let yt=0,St,Ut,ne;return this.isHorizontal()?(Ut=z0(ct,u,$),ne=r+t,St=$-u):(K.position==="left"?(Ut=u+t,ne=z0(ct,T,r),yt=ud*-.5):(Ut=$-t,ne=z0(ct,r,T),yt=ud*.5),St=T-r),{titleX:Ut,titleY:ne,maxWidth:St,rotation:yt}}draw(){const t=this.ctx,r=this.options;if(!r.display)return;const u=U0(r.font),$=u.lineHeight/2+this._padding.top,{titleX:K,titleY:ct,maxWidth:yt,rotation:St}=this._drawArgs($);Z5(t,r.text,0,0,u,{color:r.color,maxWidth:yt,rotation:St,textAlign:qE(r.align),textBaseline:"middle",translation:[K,ct]})}}function _ft(e,t){const r=new pH({ctx:e.ctx,options:t,chart:e});vg.configure(e,r,t),vg.addBox(e,r),e.titleBlock=r}var mH={id:"title",_element:pH,start(e,t,r){_ft(e,r)},stop(e){const t=e.titleBlock;vg.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,r){const u=e.titleBlock;vg.configure(e,u,r),u.options=r},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const l5={average(e){if(!e.length)return!1;let t,r,u=new Set,T=0,$=0;for(t=0,r=e.length;tct+yt)/u.size,y:T/$}},nearest(e,t){if(!e.length)return!1;let r=t.x,u=t.y,T=Number.POSITIVE_INFINITY,$,K,ct;for($=0,K=e.length;$-1?e.split(` -`):e}function xft(e,t){const{element:r,datasetIndex:u,index:T}=t,$=e.getDatasetMeta(u).controller,{label:K,value:ct}=$.getLabelAndValue(T);return{chart:e,label:K,parsed:$.getParsed(T),raw:e.data.datasets[u].data[T],formattedValue:ct,dataset:$.getDataset(),dataIndex:T,datasetIndex:u,element:r}}function rF(e,t){const r=e.chart.ctx,{body:u,footer:T,title:$}=e,{boxWidth:K,boxHeight:ct}=t,yt=U0(t.bodyFont),St=U0(t.titleFont),Ut=U0(t.footerFont),ne=$.length,pe=T.length,me=u.length,we=kg(t.padding);let Ce=we.height,Ve=0,kr=u.reduce((Lr,Mr)=>Lr+Mr.before.length+Mr.lines.length+Mr.after.length,0);if(kr+=e.beforeBody.length+e.afterBody.length,ne&&(Ce+=ne*St.lineHeight+(ne-1)*t.titleSpacing+t.titleMarginBottom),kr){const Lr=t.displayColors?Math.max(ct,yt.lineHeight):yt.lineHeight;Ce+=me*Lr+(kr-me)*yt.lineHeight+(kr-1)*t.bodySpacing}pe&&(Ce+=t.footerMarginTop+pe*Ut.lineHeight+(pe-1)*t.footerSpacing);let It=0;const rn=function(Lr){Ve=Math.max(Ve,r.measureText(Lr).width+It)};return r.save(),r.font=St.string,cd(e.title,rn),r.font=yt.string,cd(e.beforeBody.concat(e.afterBody),rn),It=t.displayColors?K+2+t.boxPadding:0,cd(u,Lr=>{cd(Lr.before,rn),cd(Lr.lines,rn),cd(Lr.after,rn)}),It=0,r.font=Ut.string,cd(e.footer,rn),r.restore(),Ve+=we.width,{width:Ve,height:Ce}}function bft(e,t){const{y:r,height:u}=t;return re.height-u/2?"bottom":"center"}function wft(e,t,r,u){const{x:T,width:$}=u,K=r.caretSize+r.caretPadding;if(e==="left"&&T+$+K>t.width||e==="right"&&T-$-K<0)return!0}function kft(e,t,r,u){const{x:T,width:$}=r,{width:K,chartArea:{left:ct,right:yt}}=e;let St="center";return u==="center"?St=T<=(ct+yt)/2?"left":"right":T<=$/2?St="left":T>=K-$/2&&(St="right"),wft(St,e,t,r)&&(St="center"),St}function nF(e,t,r){const u=r.yAlign||t.yAlign||bft(e,r);return{xAlign:r.xAlign||t.xAlign||kft(e,t,r,u),yAlign:u}}function Tft(e,t){let{x:r,width:u}=e;return t==="right"?r-=u:t==="center"&&(r-=u/2),r}function Sft(e,t,r){let{y:u,height:T}=e;return t==="top"?u+=r:t==="bottom"?u-=T+r:u-=T/2,u}function iF(e,t,r,u){const{caretSize:T,caretPadding:$,cornerRadius:K}=e,{xAlign:ct,yAlign:yt}=r,St=T+$,{topLeft:Ut,topRight:ne,bottomLeft:pe,bottomRight:me}=D2(K);let we=Tft(t,ct);const Ce=Sft(t,yt,St);return yt==="center"?ct==="left"?we+=St:ct==="right"&&(we-=St):ct==="left"?we-=Math.max(Ut,pe)+T:ct==="right"&&(we+=Math.max(ne,me)+T),{x:j0(we,0,u.width-t.width),y:j0(Ce,0,u.height-t.height)}}function K6(e,t,r){const u=kg(r.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-u.right:e.x+u.left}function aF(e){return yv([],T1(e))}function Cft(e,t,r){return qx(e,{tooltip:t,tooltipItems:r,type:"tooltip"})}function oF(e,t){const r=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return r?e.override(r):e}const gH={beforeTitle:v1,title(e){if(e.length>0){const t=e[0],r=t.chart.data.labels,u=r?r.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(u>0&&t.dataIndex"u"?gH[t].call(r,u):T}class sF extends G1{static positioners=l5;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const r=this.chart,u=this.options.setContext(this.getContext()),T=u.enabled&&r.options.animation&&u.animations,$=new V$(this.chart,T);return T._cacheable&&(this._cachedAnimations=Object.freeze($)),$}getContext(){return this.$context||(this.$context=Cft(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,r){const{callbacks:u}=r,T=xm(u,"beforeTitle",this,t),$=xm(u,"title",this,t),K=xm(u,"afterTitle",this,t);let ct=[];return ct=yv(ct,T1(T)),ct=yv(ct,T1($)),ct=yv(ct,T1(K)),ct}getBeforeBody(t,r){return aF(xm(r.callbacks,"beforeBody",this,t))}getBody(t,r){const{callbacks:u}=r,T=[];return cd(t,$=>{const K={before:[],lines:[],after:[]},ct=oF(u,$);yv(K.before,T1(xm(ct,"beforeLabel",this,$))),yv(K.lines,xm(ct,"label",this,$)),yv(K.after,T1(xm(ct,"afterLabel",this,$))),T.push(K)}),T}getAfterBody(t,r){return aF(xm(r.callbacks,"afterBody",this,t))}getFooter(t,r){const{callbacks:u}=r,T=xm(u,"beforeFooter",this,t),$=xm(u,"footer",this,t),K=xm(u,"afterFooter",this,t);let ct=[];return ct=yv(ct,T1(T)),ct=yv(ct,T1($)),ct=yv(ct,T1(K)),ct}_createItems(t){const r=this._active,u=this.chart.data,T=[],$=[],K=[];let ct=[],yt,St;for(yt=0,St=r.length;ytt.filter(Ut,ne,pe,u))),t.itemSort&&(ct=ct.sort((Ut,ne)=>t.itemSort(Ut,ne,u))),cd(ct,Ut=>{const ne=oF(t.callbacks,Ut);T.push(xm(ne,"labelColor",this,Ut)),$.push(xm(ne,"labelPointStyle",this,Ut)),K.push(xm(ne,"labelTextColor",this,Ut))}),this.labelColors=T,this.labelPointStyles=$,this.labelTextColors=K,this.dataPoints=ct,ct}update(t,r){const u=this.options.setContext(this.getContext()),T=this._active;let $,K=[];if(!T.length)this.opacity!==0&&($={opacity:0});else{const ct=l5[u.position].call(this,T,this._eventPosition);K=this._createItems(u),this.title=this.getTitle(K,u),this.beforeBody=this.getBeforeBody(K,u),this.body=this.getBody(K,u),this.afterBody=this.getAfterBody(K,u),this.footer=this.getFooter(K,u);const yt=this._size=rF(this,u),St=Object.assign({},ct,yt),Ut=nF(this.chart,u,St),ne=iF(u,St,Ut,this.chart);this.xAlign=Ut.xAlign,this.yAlign=Ut.yAlign,$={opacity:1,x:ne.x,y:ne.y,width:yt.width,height:yt.height,caretX:ct.x,caretY:ct.y}}this._tooltipItems=K,this.$context=void 0,$&&this._resolveAnimations().update(this,$),t&&u.external&&u.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(t,r,u,T){const $=this.getCaretPosition(t,u,T);r.lineTo($.x1,$.y1),r.lineTo($.x2,$.y2),r.lineTo($.x3,$.y3)}getCaretPosition(t,r,u){const{xAlign:T,yAlign:$}=this,{caretSize:K,cornerRadius:ct}=u,{topLeft:yt,topRight:St,bottomLeft:Ut,bottomRight:ne}=D2(ct),{x:pe,y:me}=t,{width:we,height:Ce}=r;let Ve,kr,It,rn,Lr,Mr;return $==="center"?(Lr=me+Ce/2,T==="left"?(Ve=pe,kr=Ve-K,rn=Lr+K,Mr=Lr-K):(Ve=pe+we,kr=Ve+K,rn=Lr-K,Mr=Lr+K),It=Ve):(T==="left"?kr=pe+Math.max(yt,Ut)+K:T==="right"?kr=pe+we-Math.max(St,ne)-K:kr=this.caretX,$==="top"?(rn=me,Lr=rn-K,Ve=kr-K,It=kr+K):(rn=me+Ce,Lr=rn+K,Ve=kr+K,It=kr-K),Mr=rn),{x1:Ve,x2:kr,x3:It,y1:rn,y2:Lr,y3:Mr}}drawTitle(t,r,u){const T=this.title,$=T.length;let K,ct,yt;if($){const St=z2(u.rtl,this.x,this.width);for(t.x=K6(this,u.titleAlign,u),r.textAlign=St.textAlign(u.titleAlign),r.textBaseline="middle",K=U0(u.titleFont),ct=u.titleSpacing,r.fillStyle=u.titleColor,r.font=K.string,yt=0;yt<$;++yt)r.fillText(T[yt],St.x(t.x),t.y+K.lineHeight/2),t.y+=K.lineHeight+ct,yt+1===$&&(t.y+=u.titleMarginBottom-ct)}}_drawColorBox(t,r,u,T,$){const K=this.labelColors[u],ct=this.labelPointStyles[u],{boxHeight:yt,boxWidth:St}=$,Ut=U0($.bodyFont),ne=K6(this,"left",$),pe=T.x(ne),me=ytIt!==0)?(t.beginPath(),t.fillStyle=$.multiKeyBackground,tS(t,{x:Ce,y:we,w:St,h:yt,radius:kr}),t.fill(),t.stroke(),t.fillStyle=K.backgroundColor,t.beginPath(),tS(t,{x:Ve,y:we+1,w:St-2,h:yt-2,radius:kr}),t.fill()):(t.fillStyle=$.multiKeyBackground,t.fillRect(Ce,we,St,yt),t.strokeRect(Ce,we,St,yt),t.fillStyle=K.backgroundColor,t.fillRect(Ve,we+1,St-2,yt-2))}t.fillStyle=this.labelTextColors[u]}drawBody(t,r,u){const{body:T}=this,{bodySpacing:$,bodyAlign:K,displayColors:ct,boxHeight:yt,boxWidth:St,boxPadding:Ut}=u,ne=U0(u.bodyFont);let pe=ne.lineHeight,me=0;const we=z2(u.rtl,this.x,this.width),Ce=function(Mn){r.fillText(Mn,we.x(t.x+me),t.y+pe/2),t.y+=pe+$},Ve=we.textAlign(K);let kr,It,rn,Lr,Mr,tn,Dn;for(r.textAlign=K,r.textBaseline="middle",r.font=ne.string,t.x=K6(this,Ve,u),r.fillStyle=u.bodyColor,cd(this.beforeBody,Ce),me=ct&&Ve!=="right"?K==="center"?St/2+Ut:St+2+Ut:0,Lr=0,tn=T.length;Lr0&&r.stroke()}_updateAnimationTarget(t){const r=this.chart,u=this.$animations,T=u&&u.x,$=u&&u.y;if(T||$){const K=l5[t.position].call(this,this._active,this._eventPosition);if(!K)return;const ct=this._size=rF(this,t),yt=Object.assign({},K,this._size),St=nF(r,t,yt),Ut=iF(t,yt,St,r);(T._to!==Ut.x||$._to!==Ut.y)&&(this.xAlign=St.xAlign,this.yAlign=St.yAlign,this.width=ct.width,this.height=ct.height,this.caretX=K.x,this.caretY=K.y,this._resolveAnimations().update(this,Ut))}}_willRender(){return!!this.opacity}draw(t){const r=this.options.setContext(this.getContext());let u=this.opacity;if(!u)return;this._updateAnimationTarget(r);const T={width:this.width,height:this.height},$={x:this.x,y:this.y};u=Math.abs(u)<.001?0:u;const K=kg(r.padding),ct=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&ct&&(t.save(),t.globalAlpha=u,this.drawBackground($,t,T,r),F$(t,r.textDirection),$.y+=K.top,this.drawTitle($,t,r),this.drawBody($,t,r),this.drawFooter($,t,r),N$(t,r.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,r){const u=this._active,T=t.map(({datasetIndex:ct,index:yt})=>{const St=this.chart.getDatasetMeta(ct);if(!St)throw new Error("Cannot find a dataset at index "+ct);return{datasetIndex:ct,element:St.data[yt],index:yt}}),$=!XT(u,T),K=this._positionChanged(T,r);($||K)&&(this._active=T,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,r,u=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const T=this.options,$=this._active||[],K=this._getActiveElements(t,$,r,u),ct=this._positionChanged(K,t),yt=r||!XT(K,$)||ct;return yt&&(this._active=K,(T.enabled||T.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,r))),yt}_getActiveElements(t,r,u,T){const $=this.options;if(t.type==="mouseout")return[];if(!T)return r.filter(ct=>this.chart.data.datasets[ct.datasetIndex]&&this.chart.getDatasetMeta(ct.datasetIndex).controller.getParsed(ct.index)!==void 0);const K=this.chart.getElementsAtEventForMode(t,$.mode,$,u);return $.reverse&&K.reverse(),K}_positionChanged(t,r){const{caretX:u,caretY:T,options:$}=this,K=l5[$.position].call(this,t,r);return K!==!1&&(u!==K.x||T!==K.y)}}var vH={id:"tooltip",_element:sF,positioners:l5,afterInit(e,t,r){r&&(e.tooltip=new sF({chart:e,options:r}))},beforeUpdate(e,t,r){e.tooltip&&e.tooltip.initialize(r)},reset(e,t,r){e.tooltip&&e.tooltip.initialize(r)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const r={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...r,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",r)}},afterEvent(e,t){if(e.tooltip){const r=t.replay;e.tooltip.handleEvent(t.event,r,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:gH},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Aft=(e,t,r,u)=>(typeof t=="string"?(r=e.push(t)-1,u.unshift({index:r,label:t})):isNaN(t)&&(r=null),r);function Mft(e,t,r,u){const T=e.indexOf(t);if(T===-1)return Aft(e,t,r,u);const $=e.lastIndexOf(t);return T!==$?r:T}const Eft=(e,t)=>e===null?null:j0(Math.round(e),0,t);function lF(e){const t=this.getLabels();return e>=0&&er.length-1?null:this.getPixelForValue(r[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Lft(e,t){const r=[],{bounds:T,step:$,min:K,max:ct,precision:yt,count:St,maxTicks:Ut,maxDigits:ne,includeBounds:pe}=e,me=$||1,we=Ut-1,{min:Ce,max:Ve}=t,kr=!Rh(K),It=!Rh(ct),rn=!Rh(St),Lr=(Ve-Ce)/(ne+1);let Mr=iR((Ve-Ce)/we/me)*me,tn,Dn,Mn,Br;if(Mr<1e-14&&!kr&&!It)return[{value:Ce},{value:Ve}];Br=Math.ceil(Ve/Mr)-Math.floor(Ce/Mr),Br>we&&(Mr=iR(Br*Mr/we/me)*me),Rh(yt)||(tn=Math.pow(10,yt),Mr=Math.ceil(Mr*tn)/tn),T==="ticks"?(Dn=Math.floor(Ce/Mr)*Mr,Mn=Math.ceil(Ve/Mr)*Mr):(Dn=Ce,Mn=Ve),kr&&It&&$&&Nct((ct-K)/$,Mr/1e3)?(Br=Math.round(Math.min((ct-K)/Mr,Ut)),Mr=(ct-K)/Br,Dn=K,Mn=ct):rn?(Dn=kr?K:Dn,Mn=It?ct:Mn,Br=St-1,Mr=(Mn-Dn)/Br):(Br=(Mn-Dn)/Mr,A5(Br,Math.round(Br),Mr/1e3)?Br=Math.round(Br):Br=Math.ceil(Br));const Vn=Math.max(aR(Mr),aR(Dn));tn=Math.pow(10,Rh(yt)?Vn:yt),Dn=Math.round(Dn*tn)/tn,Mn=Math.round(Mn*tn)/tn;let on=0;for(kr&&(pe&&Dn!==K?(r.push({value:K}),Dnct)break;r.push({value:pr})}return It&&pe&&Mn!==ct?r.length&&A5(r[r.length-1].value,ct,cF(ct,Lr,e))?r[r.length-1].value=ct:r.push({value:ct}):(!It||Mn===ct)&&r.push({value:Mn}),r}function cF(e,t,{horizontal:r,minRotation:u}){const T=z1(u),$=(r?Math.sin(T):Math.cos(T))||.001,K=.75*t*(""+e).length;return Math.min(t/$,K)}class Pft extends X2{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,r){return Rh(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:r,maxDefined:u}=this.getUserBounds();let{min:T,max:$}=this;const K=yt=>T=r?T:yt,ct=yt=>$=u?$:yt;if(t){const yt=Lv(T),St=Lv($);yt<0&&St<0?ct(0):yt>0&&St>0&&K(0)}if(T===$){let yt=$===0?1:Math.abs($*.05);ct($+yt),t||K(T-yt)}this.min=T,this.max=$}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:r,stepSize:u}=t,T;return u?(T=Math.ceil(this.max/u)-Math.floor(this.min/u)+1,T>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${u} would result generating up to ${T} ticks. Limiting to 1000.`),T=1e3)):(T=this.computeTickLimit(),r=r||11),r&&(T=Math.min(r,T)),T}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,r=t.ticks;let u=this.getTickLimit();u=Math.max(2,u);const T={maxTicks:u,bounds:t.bounds,min:t.min,max:t.max,precision:r.precision,step:r.stepSize,count:r.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:r.minRotation||0,includeBounds:r.includeBounds!==!1},$=this._range||this,K=Lft(T,$);return t.bounds==="ticks"&&jct(K,this,"value"),t.reverse?(K.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),K}configure(){const t=this.ticks;let r=this.min,u=this.max;if(super.configure(),this.options.offset&&t.length){const T=(u-r)/Math.max(t.length-1,1)/2;r-=T,u+=T}this._startValue=r,this._endValue=u,this._valueRange=u-r}getLabelForValue(t){return ZE(t,this.chart.options.locale,this.options.ticks.format)}}class oL extends Pft{static id="linear";static defaults={ticks:{callback:L$.formatters.numeric}};determineDataLimits(){const{min:t,max:r}=this.getMinMax(!0);this.min=$0(t)?t:0,this.max=$0(r)?r:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),r=t?this.width:this.height,u=z1(this.options.ticks.minRotation),T=(t?Math.sin(u):Math.cos(u))||.001,$=this._resolveTickFontOptions(0);return Math.ceil(r/Math.min(40,$.lineHeight/T))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const ZS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},km=Object.keys(ZS);function uF(e,t){return e-t}function hF(e,t){if(Rh(t))return null;const r=e._adapter,{parser:u,round:T,isoWeekday:$}=e._parseOpts;let K=t;return typeof u=="function"&&(K=u(K)),$0(K)||(K=typeof u=="string"?r.parse(K,u):r.parse(K)),K===null?null:(T&&(K=T==="week"&&(H2($)||$===!0)?r.startOf(K,"isoWeek",$):r.startOf(K,T)),+K)}function dF(e,t,r,u){const T=km.length;for(let $=km.indexOf(e);$=km.indexOf(r);$--){const K=km[$];if(ZS[K].common&&e._adapter.diff(T,u,K)>=t-1)return K}return km[r?km.indexOf(r):0]}function Dft(e){for(let t=km.indexOf(e)+1,r=km.length;t=t?r[u]:r[T];e[$]=!0}}function zft(e,t,r,u){const T=e._adapter,$=+T.startOf(t[0].value,u),K=t[t.length-1].value;let ct,yt;for(ct=$;ct<=K;ct=+T.add(ct,1,u))yt=r[ct],yt>=0&&(t[yt].major=!0);return t}function pF(e,t,r){const u=[],T={},$=t.length;let K,ct;for(K=0;K<$;++K)ct=t[K],T[ct]=K,u.push({value:ct,major:!1});return $===0||!r?u:zft(e,u,T,r)}class iS extends X2{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,r={}){const u=t.time||(t.time={}),T=this._adapter=new K$._date(t.adapters.date);T.init(r),C5(u.displayFormats,T.formats()),this._parseOpts={parser:u.parser,round:u.round,isoWeekday:u.isoWeekday},super.init(t),this._normalized=r.normalized}parse(t,r){return t===void 0?null:hF(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,r=this._adapter,u=t.time.unit||"day";let{min:T,max:$,minDefined:K,maxDefined:ct}=this.getUserBounds();function yt(St){!K&&!isNaN(St.min)&&(T=Math.min(T,St.min)),!ct&&!isNaN(St.max)&&($=Math.max($,St.max))}(!K||!ct)&&(yt(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&yt(this.getMinMax(!1))),T=$0(T)&&!isNaN(T)?T:+r.startOf(Date.now(),u),$=$0($)&&!isNaN($)?$:+r.endOf(Date.now(),u)+1,this.min=Math.min(T,$-1),this.max=Math.max(T+1,$)}_getLabelBounds(){const t=this.getLabelTimestamps();let r=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;return t.length&&(r=t[0],u=t[t.length-1]),{min:r,max:u}}buildTicks(){const t=this.options,r=t.time,u=t.ticks,T=u.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&T.length&&(this.min=this._userMin||T[0],this.max=this._userMax||T[T.length-1]);const $=this.min,K=this.max,ct=Wct(T,$,K);return this._unit=r.unit||(u.autoSkip?dF(r.minUnit,this.min,this.max,this._getLabelCapacity($)):Ift(this,ct.length,r.minUnit,this.min,this.max)),this._majorUnit=!u.major.enabled||this._unit==="year"?void 0:Dft(this._unit),this.initOffsets(T),t.reverse&&ct.reverse(),pF(this,ct,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let r=0,u=0,T,$;this.options.offset&&t.length&&(T=this.getDecimalForValue(t[0]),t.length===1?r=1-T:r=(this.getDecimalForValue(t[1])-T)/2,$=this.getDecimalForValue(t[t.length-1]),t.length===1?u=$:u=($-this.getDecimalForValue(t[t.length-2]))/2);const K=t.length<3?.5:.25;r=j0(r,0,K),u=j0(u,0,K),this._offsets={start:r,end:u,factor:1/(r+1+u)}}_generate(){const t=this._adapter,r=this.min,u=this.max,T=this.options,$=T.time,K=$.unit||dF($.minUnit,r,u,this._getLabelCapacity(r)),ct=_u(T.ticks.stepSize,1),yt=K==="week"?$.isoWeekday:!1,St=H2(yt)||yt===!0,Ut={};let ne=r,pe,me;if(St&&(ne=+t.startOf(ne,"isoWeek",yt)),ne=+t.startOf(ne,St?"day":K),t.diff(u,r,K)>1e5*ct)throw new Error(r+" and "+u+" are too far apart with stepSize of "+ct+" "+K);const we=T.ticks.source==="data"&&this.getDataTimestamps();for(pe=ne,me=0;pe+Ce)}getLabelForValue(t){const r=this._adapter,u=this.options.time;return u.tooltipFormat?r.format(t,u.tooltipFormat):r.format(t,u.displayFormats.datetime)}format(t,r){const T=this.options.time.displayFormats,$=this._unit,K=r||T[$];return this._adapter.format(t,K)}_tickFormatFunction(t,r,u,T){const $=this.options,K=$.ticks.callback;if(K)return Kd(K,[t,r,u],this);const ct=$.time.displayFormats,yt=this._unit,St=this._majorUnit,Ut=yt&&ct[yt],ne=St&&ct[St],pe=u[r],me=St&&ne&&pe&&pe.major;return this._adapter.format(t,T||(me?ne:Ut))}generateTickLabels(t){let r,u,T;for(r=0,u=t.length;r0?ct:1}getDataTimestamps(){let t=this._cache.data||[],r,u;if(t.length)return t;const T=this.getMatchingVisibleMetas();if(this._normalized&&T.length)return this._cache.data=T[0].controller.getAllParsedValues(this);for(r=0,u=T.length;r=e[u].pos&&t<=e[T].pos&&({lo:u,hi:T}=Mx(e,"pos",t)),{pos:$,time:ct}=e[u],{pos:K,time:yt}=e[T]):(t>=e[u].time&&t<=e[T].time&&({lo:u,hi:T}=Mx(e,"time",t)),{time:$,pos:ct}=e[u],{time:K,pos:yt}=e[T]);const St=K-$;return St?ct+(yt-ct)*(t-$)/St:ct}class LRt extends iS{static id="timeseries";static defaults=iS.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),r=this._table=this.buildLookupTable(t);this._minPos=Y6(r,this.min),this._tableRange=Y6(r,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:r,max:u}=this,T=[],$=[];let K,ct,yt,St,Ut;for(K=0,ct=t.length;K=r&&St<=u&&T.push(St);if(T.length<2)return[{time:r,pos:0},{time:u,pos:1}];for(K=0,ct=T.length;KT-$)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const r=this.getDataTimestamps(),u=this.getLabelTimestamps();return r.length&&u.length?t=this.normalize(r.concat(u)):t=r.length?r:u,t=this._cache.all=t,t}getDecimalForValue(t){return(Y6(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const r=this._offsets,u=this.getDecimalForPixel(t)/r.factor-r.end;return Y6(this._table,u*this._tableRange+this._minPos,!0)}}const Oft={class:"sparkline-card"},Bft={class:"card-header"},Rft={class:"card-title"},Fft={class:"card-chart"},Nft=Cc({name:"ChartSparkline",__name:"ChartSparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0}},setup(e){Av.register(aL,oL,nL,J2,eL,iL);const t=e,r=li(null),u=li(null),T=yt=>{if(yt.length<3)return yt;const St=Math.min(15,Math.max(3,Math.floor(yt.length*.2))),Ut=[];for(let we=0;wern+Lr,0)/It.length)}const ne=Math.min(12,Ut.length),pe=Ut.length/ne,me=[];for(let we=0;we!t.data||t.data.length===0?[]:T(t.data)),K=()=>{if(!r.value)return;const yt=r.value.getContext("2d");if(!yt)return;u.value&&(u.value.destroy(),u.value=null);const St=$.value;St.length<2||(u.value=j1(new Av(yt,{type:"line",data:{labels:St.map((Ut,ne)=>ne.toString()),datasets:[{data:St,borderColor:t.color,borderWidth:2.5,fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1},grace:"10%"}},elements:{line:{capBezierPoints:!0}}}})))},ct=()=>{if(!u.value){K();return}const yt=$.value;yt.length<2||(u.value.data.labels=yt.map((St,Ut)=>Ut.toString()),u.value.data.datasets[0].data=yt,u.value.update("default"))};return Fh(()=>t.data,()=>{sp(()=>ct())},{deep:!0}),Fh(()=>t.color,()=>{u.value&&(u.value.data.datasets[0].borderColor=t.color,u.value.update("none"))}),Xd(()=>{sp(()=>K())}),Tg(()=>{u.value&&(u.value.destroy(),u.value=null)}),(yt,St)=>(Or(),Nr("div",Oft,[At("div",Bft,[At("p",Rft,yn(yt.title),1),At("span",{class:"card-value",style:Sp({color:yt.color})},yn(typeof yt.value=="number"?yt.value.toLocaleString():yt.value),5)]),At("div",Fft,[yt.showChart?(Or(),Nr("canvas",{key:0,ref_key:"canvasRef",ref:r},null,512)):Ta("",!0)])]))}}),vh=(e,t)=>{const r=e.__vccOpts||e;for(const[u,T]of t)r[u]=T;return r},X6=vh(Nft,[["__scopeId","data-v-bcd5cf93"]]),u4=OS("packets",()=>{const e=li(null),t=li(null),r=li([]),u=li([]),T=li(null),$=li(!1),K=li(null),ct=li(null),yt=li([]),St=li([]),Ut=li(null),ne=li({rx:0,tx:0,drop:0}),pe=li({rx:0,tx:0,drop:0}),me=Ao(()=>e.value!==null),we=Ao(()=>t.value!==null),Ce=Ao(()=>r.value.length>0),Ve=Ao(()=>u.value.length>0),kr=Ao(()=>T.value?.avg_noise_floor??0),It=Ao(()=>e.value?.total_packets??0),rn=Ao(()=>e.value?.avg_rssi??0),Lr=Ao(()=>e.value?.avg_snr??0),Mr=Ao(()=>t.value?.uptime_seconds??0),tn=Ao(()=>{if(!e.value?.packet_types)return[];const qi=e.value.packet_types,Bi=qi.reduce((Xi,Yn)=>Xi+Yn.count,0);return qi.map(Xi=>({type:Xi.type.toString(),count:Xi.count,percentage:Bi>0?Xi.count/Bi*100:0}))}),Dn=Ao(()=>{const qi={};return r.value.forEach(Bi=>{qi[Bi.type]||(qi[Bi.type]=[]),qi[Bi.type].push(Bi)}),qi});async function Mn(){try{const qi=await bs.get("/stats");if(qi.success&&qi.data){t.value=qi.data;const Bi=new Date;return St.value.push({timestamp:Bi,stats:qi.data}),St.value.length>50&&(St.value=St.value.slice(-50)),qi.data}else if(qi&&"version"in qi){const Bi=qi;t.value=Bi;const Xi=new Date;return St.value.push({timestamp:Xi,stats:Bi}),St.value.length>50&&(St.value=St.value.slice(-50)),Bi}else throw new Error(qi.error||"Failed to fetch system stats")}catch(qi){throw K.value=qi instanceof Error?qi.message:"Unknown error occurred",console.error("Error fetching system stats:",qi),qi}}async function Br(qi={hours:24}){try{const Bi=await bs.get("/noise_floor_history",qi);if(Bi.success&&Bi.data&&Bi.data.history)return u.value=Bi.data.history,ct.value=new Date,Bi.data.history;throw new Error(Bi.error||"Failed to fetch noise floor history")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching noise floor history:",Bi),Bi}}async function Vn(qi={hours:24}){try{const Bi=await bs.get("/noise_floor_stats",qi);if(Bi.success&&Bi.data&&Bi.data.stats)return T.value=Bi.data.stats,ct.value=new Date,Bi.data.stats;throw new Error(Bi.error||"Failed to fetch noise floor stats")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching noise floor stats:",Bi),Bi}}const on=Ao(()=>!u.value||!Array.isArray(u.value)?[]:u.value.slice(-50).map(qi=>qi.noise_floor_dbm));async function pr(qi={hours:24}){try{$.value=!0,K.value=null;const Bi=await bs.get("/packet_stats",qi);if(Bi.success&&Bi.data){e.value=Bi.data;const Xi=new Date;yt.value.push({timestamp:Xi,stats:Bi.data}),yt.value.length>50&&(yt.value=yt.value.slice(-50)),ct.value=Xi}else throw new Error(Bi.error||"Failed to fetch packet stats")}catch(Bi){K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching packet stats:",Bi)}finally{$.value=!1}}async function _r(qi={limit:100}){try{$.value=!0,K.value=null;const Bi=await bs.get("/recent_packets",qi);if(Bi.success&&Bi.data)r.value=Bi.data,ct.value=new Date;else throw new Error(Bi.error||"Failed to fetch recent packets")}catch(Bi){K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching recent packets:",Bi)}finally{$.value=!1}}async function Sr(qi){try{$.value=!0,K.value=null;const Bi=await bs.get("/filtered_packets",qi);if(Bi.success&&Bi.data)return r.value=Bi.data,ct.value=new Date,Bi.data;throw new Error(Bi.error||"Failed to fetch filtered packets")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching filtered packets:",Bi),Bi}finally{$.value=!1}}async function Dr(qi){try{$.value=!0,K.value=null;const Bi=await bs.get("/packet_by_hash",{packet_hash:qi});if(Bi.success&&Bi.data)return Bi.data;throw new Error(Bi.error||"Packet not found")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching packet by hash:",Bi),Bi}finally{$.value=!1}}const nn=Ao(()=>{if(!Ut.value?.series)return{totalPackets:[],transmittedPackets:[],droppedPackets:[],currentRates:ne.value};const qi=Ut.value.series.find(aa=>aa.type==="rx_count"),Bi=Ut.value.series.find(aa=>aa.type==="tx_count"),Xi=qi?.data||[],Yn=Bi?.data||[],hi=Xi.map((aa,io)=>{const oo=Yn[io];return oo?Math.max(0,aa[1]-oo[1]):aa[1]});return{totalPackets:Xi.map(aa=>aa[1]),transmittedPackets:Yn.map(aa=>aa[1]),droppedPackets:hi,currentRates:ne.value}}),Cn=Ao(()=>{const qi=yt.value,Bi=St.value;return{totalPackets:qi.map(Xi=>Xi.stats.total_packets),transmittedPackets:qi.map(Xi=>Xi.stats.transmitted_packets),droppedPackets:qi.map(Xi=>Xi.stats.dropped_packets),avgRssi:qi.map(Xi=>Xi.stats.avg_rssi),uptimeHours:Bi.map(Xi=>Math.floor((Xi.stats.uptime_seconds||0)/3600))}});async function Xn(qi=3e4){await Promise.all([Mn(),pr(),_r(),Br({hours:1}),Vn({hours:1})]);const Bi=setInterval(async()=>{try{await Promise.all([Mn(),pr(),_r(),Br({hours:1}),Vn({hours:1})])}catch(Xi){console.error("Auto-refresh error:",Xi)}},qi);return()=>clearInterval(Bi)}async function _i(){try{const qi=await bs.get("/metrics_graph_data",{hours:24,resolution:"average",metrics:"rx_count,tx_count"});qi?.success&&qi.data&&(Ut.value=qi.data)}catch(qi){console.error("Failed to fetch sparkline data:",qi)}}async function ta(){await _i()}function va(){_i()}function _a(){e.value=null,t.value=null,r.value=[],u.value=[],T.value=null,yt.value=[],St.value=[],Ut.value=null,ne.value={rx:0,tx:0,drop:0},pe.value={rx:0,tx:0,drop:0},K.value=null,ct.value=null,$.value=!1}return{packetStats:e,systemStats:t,recentPackets:r,noiseFloorHistory:u,noiseFloorStats:T,packetStatsHistory:yt,systemStatsHistory:St,isLoading:$,error:K,lastUpdated:ct,hasPacketStats:me,hasSystemStats:we,hasRecentPackets:Ce,hasNoiseFloorData:Ve,currentNoiseFloor:kr,totalPackets:It,averageRSSI:rn,averageSNR:Lr,uptime:Mr,packetTypeBreakdown:tn,recentPacketsByType:Dn,sparklineData:nn,legacySparklineData:Cn,noiseFloorSparklineData:on,interpolatedRates:ne,fetchSystemStats:Mn,fetchPacketStats:pr,fetchRecentPackets:_r,fetchFilteredPackets:Sr,getPacketByHash:Dr,fetchNoiseFloorHistory:Br,fetchNoiseFloorStats:Vn,startAutoRefresh:Xn,initializeSparklineHistory:ta,interpolateRates:va,reset:_a}}),jft={class:"grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4 mb-5 stats-cards-container"},Uft=Cc({name:"StatsCards",__name:"StatsCards",setup(e){const t=u4(),r=li(null),u=li(null),T=li(!1),$=Ao(()=>{const yt=t.packetStats,St=t.systemStats,Ut=we=>{const Ce=Math.floor(we/86400),Ve=Math.floor(we%86400/3600),kr=Math.floor(we%3600/60);return Ce>0?`${Ce}d ${Ve}h`:Ve>0?`${Ve}h ${kr}m`:`${kr}m`},ne=yt?.total_packets||0,pe=yt?.dropped_packets||0,me=ne>0?Math.round(pe/ne*100):0;return{packetsReceived:ne,packetsForwarded:yt?.transmitted_packets||0,uptimeFormatted:St?Ut(St.uptime_seconds||0):"0m",uptimeHours:St?Math.floor((St.uptime_seconds||0)/3600):0,droppedPackets:pe,dropPercent:`${me}%`,signalQuality:Math.round((yt?.avg_rssi||0)+120)}}),K=Ao(()=>t.sparklineData),ct=async()=>{if(!T.value)try{T.value=!0,await Promise.all([t.fetchSystemStats(),t.fetchPacketStats({hours:24})]),await sp()}catch(yt){console.error("Error fetching stats:",yt)}finally{T.value=!1}};return Xd(async()=>{await t.initializeSparklineHistory(),ct(),r.value=window.setInterval(ct,3e4),u.value=window.setInterval(()=>{t.interpolateRates()},6e4)}),Tg(()=>{r.value&&clearInterval(r.value),u.value&&clearInterval(u.value)}),(yt,St)=>(Or(),Nr("div",jft,[Vs(X6,{title:"Up Time",value:$.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1,class:"stat-card"},null,8,["value"]),Vs(X6,{title:"RX Packets",value:$.value.packetsReceived,color:"#AAE8E8",data:K.value.totalPackets,class:"stat-card"},null,8,["value","data"]),Vs(X6,{title:"Forward",value:$.value.packetsForwarded,color:"#FFC246",data:K.value.transmittedPackets,class:"stat-card"},null,8,["value","data"]),Vs(X6,{title:"Dropped",value:$.value.droppedPackets,color:"#FB787B",data:K.value.droppedPackets,class:"stat-card"},null,8,["value","data"])]))}}),$ft=vh(Uft,[["__scopeId","data-v-38c473ee"]]),Hft={class:"glass-card rounded-[10px] p-4 lg:p-6"},Vft={class:"h-48 lg:h-56 relative"},Wft={key:0,class:"absolute inset-0 flex items-center justify-center"},qft={key:1,class:"absolute inset-0 flex items-center justify-center"},Gft={class:"text-red-600 dark:text-red-400 text-sm lg:text-base"},Zft={key:2,class:"absolute inset-0 flex items-center justify-center"},Kft={key:3,class:"h-full flex flex-col"},Yft={key:0,class:"absolute top-2 left-1/2 -translate-x-1/2 bg-white/95 dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke rounded-lg px-3 py-2 z-10 pointer-events-none min-w-48"},Xft={class:"text-content-primary dark:text-content-primary text-sm font-medium mb-1"},Jft={class:"text-content-primary dark:text-content-primary"},Qft={class:"flex-1 flex items-end justify-evenly gap-4 px-4"},tpt=["onMouseenter"],ept={class:"text-content-primary dark:text-content-primary text-xs sm:text-sm font-semibold text-center w-full",style:{"padding-bottom":"5px"}},rpt={class:"text-content-secondary dark:text-content-muted text-xs mt-2 text-center"},npt={key:0,class:"mt-4 flex flex-wrap justify-center gap-3 sm:gap-4 px-2 sm:px-4 text-[10px] sm:text-xs text-content-secondary dark:text-content-muted"},ipt={class:"truncate text-left"},apt={key:1,class:"mt-3 text-xs text-content-secondary dark:text-content-muted text-center"},opt=Cc({name:"PacketTypesChart",__name:"PacketTypesChart",setup(e){const t=li([]),r=li(null),u=li(!0),T=li(null),$=li(null),K=[{name:"Payload",types:["Plain Text Message","Group Text Message","Group Datagram","Multi-part Packet"],subColors:["#3B82F6","#60A5FA","#93C5FD","#BFDBFE"]},{name:"Requests",types:["Request","Response","Anonymous Request"],subColors:["#10B981","#34D399","#6EE7B7"]},{name:"Control",types:["Node Advertisement","Acknowledgment","Returned Path"],subColors:["#F59E0B","#FBBF24","#FCD34D"]},{name:"Routing",types:["Trace"],subColors:["#8B5CF6"]},{name:"Reserved",types:["Reserved Type 11","Reserved Type 12","Reserved Type 13"],subColors:["#6B7280","#9CA3AF","#D1D5DB"]}],ct=Ao(()=>K.map(me=>{const we=t.value.filter(Ce=>me.types.some(Ve=>Ce.name.includes(Ve)||Ce.name===Ve)).sort((Ce,Ve)=>Ve.count-Ce.count).map((Ce,Ve)=>({...Ce,color:me.subColors[Ve%me.subColors.length]}));return{name:me.name,color:me.subColors[0],items:we,total:we.reduce((Ce,Ve)=>Ce+Ve.count,0)}}).filter(me=>me.total>0)),yt=Ao(()=>Math.max(...ct.value.map(me=>me.total),1)),St=Ao(()=>ct.value.reduce((me,we)=>me+we.total,0)),Ut=async()=>{try{T.value=null;const me=await bs.get("/packet_type_graph_data");if(me?.success&&me?.data){const we=me.data;if(we?.series){const Ce=[];we.series.forEach((Ve,kr)=>{let It=0;Ve.data&&Array.isArray(Ve.data)&&(It=Ve.data.reduce((rn,Lr)=>rn+(Lr[1]||0),0)),It>0&&Ce.push({name:Ve.name||`Type ${Ve.type}`,type:Ve.type,count:It,color:""})}),t.value=Ce,u.value=!1}else T.value="No series data in server response",u.value=!1}else T.value="Invalid response from server",u.value=!1}catch(me){T.value=me instanceof Error?me.message:"Failed to load data",u.value=!1}},ne=me=>Math.max(me/yt.value*90,2),pe=(me,we)=>we===0?0:me/we*100;return Xd(()=>{Ut(),r.value=setInterval(()=>{Ut()},3e4)}),Tg(()=>{r.value&&clearInterval(r.value)}),(me,we)=>(Or(),Nr("div",Hft,[we[3]||(we[3]=At("div",{class:"flex items-baseline justify-between mb-3 lg:mb-4"},[At("h3",{class:"text-content-primary dark:text-content-primary text-lg lg:text-xl font-semibold"},"Packet Types"),At("p",{class:"text-content-secondary dark:text-content-muted text-xs lg:text-sm uppercase"},"Distribution by Type")],-1)),At("div",Vft,[u.value?(Or(),Nr("div",Wft,we[1]||(we[1]=[At("div",{class:"text-content-secondary dark:text-content-primary text-sm lg:text-base"},"Loading packet types...",-1)]))):T.value?(Or(),Nr("div",qft,[At("div",Gft,yn(T.value),1)])):ct.value.length===0?(Or(),Nr("div",Zft,we[2]||(we[2]=[At("div",{class:"text-content-secondary dark:text-content-primary text-sm lg:text-base"},"No packet data available",-1)]))):(Or(),Nr("div",Kft,[$.value?(Or(),Nr("div",Yft,[At("div",Xft,yn($.value.name)+" · "+yn($.value.total.toLocaleString()),1),(Or(!0),Nr(Es,null,jl($.value.items,Ce=>(Or(),Nr("div",{key:Ce.type,class:"flex justify-between gap-4 text-xs text-content-secondary dark:text-content-muted"},[At("span",null,yn(Ce.name),1),At("span",Jft,yn(Ce.count.toLocaleString()),1)]))),128))])):Ta("",!0),At("div",Qft,[(Or(!0),Nr(Es,null,jl(ct.value,Ce=>(Or(),Nr("div",{key:Ce.name,class:"flex flex-col items-center flex-1 max-w-32 h-full justify-end cursor-pointer",onMouseenter:Ve=>$.value=Ce,onMouseleave:we[0]||(we[0]=Ve=>$.value=null)},[At("span",ept,yn(Ce.total.toLocaleString()),1),At("div",{class:"w-full rounded-[5px] transition-all duration-300 ease-out hover:opacity-90 overflow-hidden flex flex-col-reverse",style:Sp({height:ne(Ce.total)+"%",minHeight:"8px"})},[(Or(!0),Nr(Es,null,jl(Ce.items,Ve=>(Or(),Nr("div",{key:Ve.type,style:Sp({height:pe(Ve.count,Ce.total)+"%",backgroundColor:Ve.color})},null,4))),128))],4),At("span",rpt,yn(Ce.name),1)],40,tpt))),128))])]))]),ct.value.length>0?(Or(),Nr("div",npt,[(Or(!0),Nr(Es,null,jl(ct.value,Ce=>(Or(),Nr("div",{key:"legend-"+Ce.name,class:"flex flex-col gap-0.5 min-w-[100px] max-w-[140px] flex-shrink-0"},[(Or(!0),Nr(Es,null,jl(Ce.items,Ve=>(Or(),Nr("div",{key:Ve.type,class:"flex items-center gap-1.5"},[At("span",{class:"w-2 h-2 rounded-sm shrink-0",style:Sp({backgroundColor:Ve.color})},null,4),At("span",ipt,yn(Ve.name),1)]))),128))]))),128))])):Ta("",!0),ct.value.length>0?(Or(),Nr("div",apt," Total: "+yn(St.value.toLocaleString())+" packets ",1)):Ta("",!0)]))}}),spt=vh(opt,[["__scopeId","data-v-3ad21abb"]]),lpt={class:"glass-card rounded-[10px] p-4 lg:p-6"},cpt={class:"relative h-40 lg:h-48"},upt={class:"mt-3 lg:mt-4 grid grid-cols-2 gap-3 lg:gap-4"},hpt={class:"text-center"},dpt={class:"text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary"},fpt={class:"text-center"},ppt={class:"text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary"},mpt={class:"mt-2 lg:mt-3 grid grid-cols-3 gap-2 lg:gap-3 text-center"},gpt={class:"text-xs lg:text-sm font-semibold text-accent-purple flex items-center justify-center gap-1"},vpt={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},ypt={class:"text-xs text-content-secondary dark:text-content-muted"},_pt={class:"text-xs lg:text-sm font-semibold text-accent-red flex items-center justify-center gap-1"},xpt={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},bpt={class:"text-xs text-content-secondary dark:text-content-muted"},wpt={class:"text-xs lg:text-sm font-semibold text-white"},kpt=Cc({name:"AirtimeUtilizationChart",__name:"AirtimeUtilizationChart",setup(e){const t=u4(),r=Ym(),u=li(null),T=li([]),$=li(!0),K=li(null),ct=li(30),yt=li({totalReceived:0,totalTransmitted:0,dropped:0,firstPacketTime:0}),St=li({sf:9,bwHz:62500,cr:5,preamble:17}),Ut=Ce=>{const{sf:Ve,bwHz:kr,cr:It,preamble:rn}=St.value,Lr=1,Mr=0,tn=Ve>=11&&kr<=125e3?1:0,Dn=kr/1e3,Mn=Math.pow(2,Ve)/Dn,Br=(rn+4.25)*Mn,Vn=Math.max(8*Ce-4*Ve+28+16*Lr-20*Mr,0),on=4*(Ve-2*tn),_r=(8+Math.ceil(Vn/on)*It)*Mn;return Br+_r},ne=(Ce,Ve=60)=>{if(Ce.length===0)return[];const kr=1-Math.pow(.5,1/Ve),It=Math.min(Ce.length,Math.max(10,Math.floor(Ve/3)));let rn=0,Lr=0;for(let Mr=0;Mr(rn=kr*Mr.rxUtil+(1-kr)*rn,Lr=kr*Mr.txUtil+(1-kr)*Lr,{...Mr,rxUtil:rn,txUtil:Lr}))},pe=Ao(()=>{const Ce=t.packetStats?.total_packets||0,Ve=t.packetStats?.transmitted_packets||0,kr=r.stats?.uptime_seconds||0,It=Ce||yt.value.totalReceived,rn=Ve||yt.value.totalTransmitted,Lr=yt.value.firstPacketTime>0?Math.floor(Date.now()/1e3)-yt.value.firstPacketTime:0,Mr=kr||Lr,tn=Math.max(Mr/3600,.1);if(tn<1){const pr=Math.max(Mr/60,1);return{rxRate:{value:Math.round(It/pr*100)/100,label:tn<.5?"RX/min (early)":"RX/min"},txRate:{value:Math.round(rn/pr*100)/100,label:tn<.5?"TX/min (early)":"TX/min"},confidence:"low"}}const Mn=Math.round(It/tn*100)/100,Br=Math.round(rn/tn*100)/100;let Vn,on;return tn<6?(Vn=`RX/hr (${Math.round(tn)}h)`,on="medium"):tn<24?(Vn=`RX/hr (${Math.round(tn)}h)`,on="high"):(Vn="RX/hr",on="high"),{rxRate:{value:Mn,label:Vn},txRate:{value:Br,label:Vn.replace("RX","TX")},confidence:on}}),me=async()=>{$.value=!0;try{const rn=Math.floor(Date.now()/1e3),Lr=rn-24*3600;let Mr=0;try{const _i=await bs.get("/stats");if(_i.success&&_i.data){const ta=_i.data,va=ta.config;if(va?.radio){const _a=va.radio;St.value={sf:_a.spreading_factor??9,bwHz:_a.bandwidth??62500,cr:_a.coding_rate??5,preamble:_a.preamble_length??17}}Mr=ta.dropped_count??0}}catch{}const tn=await bs.get("/filtered_packets",{start_timestamp:Lr,end_timestamp:rn,limit:5e4});if(!tn.success){T.value=[],$.value=!1,sp(()=>we());return}const Dn=tn.data||[],Mn=new Float64Array(8640),Br=new Float64Array(8640);let Vn=0,on=0,pr=1/0;for(const _i of Dn){const ta=Math.floor((_i.timestamp-Lr)/10);if(ta<0||ta>=8640)continue;const va=_i.length??_i.payload_length??32,_a=Ut(va),qi=_i.packet_origin;_i.timestamp[_i.rxUtil,_i.txUtil]))*1.05;ct.value=Math.max(5,Math.ceil(Xn/5)*5),$.value=!1,sp(()=>we())}catch(Ce){console.error("Failed to fetch airtime data:",Ce),T.value=[],$.value=!1,sp(()=>we())}},we=()=>{if(!u.value)return;const Ce=u.value,Ve=Ce.getContext("2d");if(!Ve)return;const kr=Ce.parentElement;if(!kr)return;const It=kr.getBoundingClientRect(),rn=It.width,Lr=It.height;Ce.width=rn*window.devicePixelRatio,Ce.height=Lr*window.devicePixelRatio,Ce.style.width=rn+"px",Ce.style.height=Lr+"px",Ve.scale(window.devicePixelRatio,window.devicePixelRatio);const Mr=20,tn=45;if(Ve.clearRect(0,0,rn,Lr),$.value){Ve.fillStyle="#666",Ve.font="16px system-ui",Ve.textAlign="center",Ve.fillText("Loading chart data...",rn/2,Lr/2);return}if(T.value.length===0){Ve.fillStyle="#666",Ve.font="16px system-ui",Ve.textAlign="center",Ve.fillText("No data available",rn/2,Lr/2);return}const Dn=rn-tn-Mr,Mn=Lr-Mr*2,Br=ct.value,Vn=ct.value;Ve.strokeStyle="rgba(255, 255, 255, 0.1)",Ve.lineWidth=1,Ve.font="10px system-ui",Ve.textAlign="right";for(let on=0;on<=5;on++){const pr=Mr+Mn*on/5;Ve.beginPath(),Ve.moveTo(tn,pr),Ve.lineTo(rn-Mr,pr),Ve.stroke();const _r=Br-on/5*Vn;Ve.fillStyle="rgba(255, 255, 255, 0.5)",Ve.fillText(`${_r.toFixed(0)}%`,tn-5,pr+3)}for(let on=0;on<=6;on++){const pr=tn+Dn*on/6;Ve.beginPath(),Ve.moveTo(pr,Mr),Ve.lineTo(pr,Lr-Mr),Ve.stroke()}T.value.length>1&&(Ve.strokeStyle="#EBA0FC",Ve.lineWidth=2,Ve.beginPath(),T.value.forEach((on,pr)=>{const _r=tn+Dn*pr/(T.value.length-1),Sr=Lr-Mr-Math.min(on.rxUtil,ct.value)/Vn*Mn;pr===0?Ve.moveTo(_r,Sr):Ve.lineTo(_r,Sr)}),Ve.stroke()),T.value.length>1&&(Ve.strokeStyle="#FB787B",Ve.lineWidth=2,Ve.beginPath(),T.value.forEach((on,pr)=>{const _r=tn+Dn*pr/(T.value.length-1),Sr=Lr-Mr-Math.min(on.txUtil,ct.value)/Vn*Mn;pr===0?Ve.moveTo(_r,Sr):Ve.lineTo(_r,Sr)}),Ve.stroke())};return Xd(()=>{me(),K.value=window.setInterval(me,3e4),sp(()=>{we(),setTimeout(()=>we(),100)}),window.addEventListener("resize",we)}),Tg(()=>{K.value&&clearInterval(K.value),window.removeEventListener("resize",we)}),(Ce,Ve)=>(Or(),Nr("div",lpt,[Ve[3]||(Ve[3]=Du('

Airtime Utilization

Activity (Last 24 Hours)

Rx Util
Tx Util
',3)),At("div",cpt,[At("canvas",{ref_key:"chartRef",ref:u,class:"absolute inset-0 w-full h-full"},null,512)]),At("div",upt,[At("div",hpt,[At("div",dpt,yn(Io(t).packetStats?.total_packets||yt.value.totalReceived),1),Ve[0]||(Ve[0]=At("div",{class:"text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Total Received",-1))]),At("div",fpt,[At("div",ppt,yn(Io(t).packetStats?.transmitted_packets||yt.value.totalTransmitted),1),Ve[1]||(Ve[1]=At("div",{class:"text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Total Transmitted",-1))])]),At("div",mpt,[At("div",null,[At("div",gpt,[cl(yn(pe.value.rxRate.value)+" ",1),pe.value.confidence==="low"?(Or(),Nr("span",vpt)):Ta("",!0)]),At("div",ypt,yn(pe.value.rxRate.label),1)]),At("div",null,[At("div",_pt,[cl(yn(pe.value.txRate.value)+" ",1),pe.value.confidence==="low"?(Or(),Nr("span",xpt)):Ta("",!0)]),At("div",bpt,yn(pe.value.txRate.label),1)]),At("div",null,[At("div",wpt,yn(Io(t).packetStats?.dropped_packets||yt.value.dropped),1),Ve[2]||(Ve[2]=At("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),Tpt=vh(kpt,[["__scopeId","data-v-0aca4e12"]]),Spt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] shadow-2xl border border-stroke-subtle dark:border-white/20 flex flex-col h-full overflow-hidden"},Cpt={class:"flex items-center justify-between p-8 pb-4 flex-shrink-0"},Apt={class:"text-content-secondary dark:text-content-muted text-sm"},Mpt={class:"flex items-center gap-2"},Ept=["title"],Lpt={class:"flex-1 overflow-y-auto custom-scrollbar px-8"},Ppt={class:"mb-6"},Ipt={class:"glass-card bg-white/5 rounded-[15px] p-4"},Dpt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},zpt={class:"space-y-3"},Opt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Bpt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Rpt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Fpt={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all"},Npt={key:0,class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},jpt={class:"text-content-primary dark:text-content-primary font-mono text-xs"},Upt={class:"space-y-3"},$pt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Hpt={class:"text-content-primary dark:text-content-primary font-semibold"},Vpt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Wpt={class:"text-content-primary dark:text-content-primary font-semibold"},qpt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Gpt={class:"mb-6"},Zpt={class:"bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10"},Kpt={class:"space-y-3"},Ypt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Xpt={class:"text-content-primary dark:text-content-primary"},Jpt={key:0,class:"pt-2"},Qpt={class:"glass-card bg-background-mute dark:bg-black/30 rounded-[10px] p-4 mb-4"},t0t={class:"w-full overflow-x-auto"},e0t={class:"text-content-primary dark:text-content-primary/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},r0t={class:"flex items-center justify-between mb-3"},n0t={class:"text-content-secondary dark:text-content-primary/80 text-sm font-semibold"},i0t={class:"text-content-muted dark:text-content-muted text-xs"},a0t={class:"bg-background-mute dark:bg-black/40 rounded-[8px] p-3 mb-3"},o0t={class:"font-mono text-xs text-content-primary dark:text-content-primary break-all whitespace-pre-wrap leading-relaxed"},s0t={class:"bg-gray-50 dark:bg-white/5 rounded-[10px] overflow-hidden"},l0t={key:0,class:"min-w-0"},c0t={class:"text-cyan-500 text-sm font-mono break-words min-w-0"},u0t={class:"text-content-primary dark:text-content-primary text-sm break-words min-w-0"},h0t={class:"text-content-primary dark:text-content-primary text-sm font-semibold break-all min-w-0 overflow-hidden"},d0t=["title"],f0t={key:0,class:"text-orange-500 text-xs font-mono break-all min-w-0 overflow-hidden"},p0t=["title"],m0t={class:"grid grid-cols-2 gap-2"},g0t={class:"text-cyan-500 text-sm font-mono break-words"},v0t={class:"text-content-primary dark:text-content-primary text-sm break-words"},y0t=["title"],_0t={key:0},x0t=["title"],b0t={key:0,class:"text-content-muted dark:text-content-muted text-xs italic mt-2 px-1"},w0t={key:1,class:"py-2"},k0t={class:"mb-6"},T0t={class:"bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10"},S0t={class:"space-y-4"},C0t={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},A0t={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},M0t={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},E0t={key:0,class:"py-2"},L0t={class:"bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},P0t={class:"flex items-center flex-wrap gap-2"},I0t={class:"relative group"},D0t={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},z0t={class:"font-mono text-xs font-semibold text-content-primary dark:text-content-primary/90"},O0t={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-content-primary dark:bg-background/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},B0t={key:0,class:"mx-2 text-cyan-600 dark:text-cyan-400/60"},R0t={key:1,class:"py-2"},F0t={class:"text-content-secondary dark:text-content-muted text-sm mb-2 flex items-center"},N0t={key:0,class:"w-4 h-4 ml-2 text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},j0t={key:1,class:"text-yellow-500 text-xs ml-1"},U0t={class:"bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},$0t={class:"flex items-center flex-wrap gap-2"},H0t={class:"relative group"},V0t={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},W0t={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},q0t={key:0,class:"mx-1 text-orange-600 dark:text-orange-400/60"},G0t={class:"mb-6"},Z0t={class:"glass-card bg-gray-50 dark:bg-white/5 rounded-[15px] p-4"},K0t={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},Y0t={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},X0t={class:"text-lg font-bold text-content-primary dark:text-content-primary"},J0t={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},Q0t={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},tmt={class:"text-lg font-bold text-content-primary dark:text-content-primary"},emt={key:0,class:"mb-4"},rmt={class:"flex items-center gap-3"},nmt={class:"flex gap-1"},imt={class:"text-content-secondary dark:text-content-primary/80 text-sm capitalize"},amt={key:1,class:"mb-4"},omt={key:2,class:"mb-4"},smt={class:"text-content-secondary dark:text-content-muted text-sm mb-3"},lmt={class:"space-y-2"},cmt={class:"flex items-center gap-3"},umt={class:"text-content-muted dark:text-content-muted text-sm"},hmt={key:3,class:"mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke/10"},dmt={class:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4"},fmt={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},pmt={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},mmt={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},gmt={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},vmt={class:"text-content-muted dark:text-content-muted text-xs mt-1"},ymt={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},_mt={class:"text-content-muted dark:text-content-muted text-xs mt-1"},xmt={key:0,class:"glass-card bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},bmt={class:"space-y-3"},wmt={class:"flex-shrink-0 w-16 text-right"},kmt={class:"text-content-secondary dark:text-content-muted text-xs"},Tmt={class:"flex-1 relative"},Smt={class:"h-8 rounded-lg overflow-hidden bg-background-mute dark:bg-stroke/5 relative"},Cmt={class:"absolute inset-0 flex items-center px-3"},Amt={class:"text-content-primary dark:text-content-primary text-xs font-mono font-semibold"},Mmt={class:"flex-shrink-0 w-12 text-left"},Emt={class:"text-content-muted dark:text-content-muted text-xs"},Lmt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Pmt={class:"space-y-2"},Imt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Dmt={class:"text-content-primary dark:text-content-primary"},zmt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Omt={class:"space-y-2"},Bmt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Rmt={key:0,class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Fmt={class:"text-red-600 dark:text-red-400 text-sm"},Nmt={class:"p-8 pt-4 border-t border-stroke-subtle dark:border-stroke/10 flex justify-end flex-shrink-0"},jmt=Cc({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(e,{emit:t}){const r=e,u=t,T=li(!1),$=Mr=>new Date(Mr*1e3).toLocaleString(),K=Mr=>Mr.transmitted?Mr.is_duplicate?"text-amber-600 dark:text-amber-400":Mr.drop_reason?"text-red-600 dark:text-red-400":"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",ct=Mr=>Mr.transmitted?Mr.is_duplicate?"Duplicate":Mr.drop_reason?"Dropped":"Forwarded":"Dropped",yt=Mr=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[Mr]||`Unknown Type (${Mr})`,St=Mr=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[Mr]||`Unknown Route (${Mr})`,Ut=Mr=>{if(!Mr)return"None";const Dn=Mr.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],Mn=[];for(let Br=0;Br{try{let Mn=0;const Br=tn.length/2;if(Br>=100){if(tn.length>=Mn+64){const Vn=tn.slice(Mn,Mn+64);Mr.push({name:"Public Key",byteRange:`${(Dn+Mn)/2}-${(Dn+Mn+63)/2}`,hexData:Vn.match(/.{8}/g)?.join(" ")||Vn,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${Vn.slice(0,16)}...${Vn.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),Mn+=64}if(tn.length>=Mn+8){const Vn=tn.slice(Mn,Mn+8),on=parseInt(Vn,16),pr=new Date(on*1e3);Mr.push({name:"Timestamp",byteRange:`${(Dn+Mn)/2}-${(Dn+Mn+7)/2}`,hexData:Vn.match(/.{2}/g)?.join(" ")||Vn,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${on} (${pr.toLocaleString()})`,binary:on.toString(2).padStart(32,"0")}]}),Mn+=8}if(tn.length>=Mn+128){const Vn=tn.slice(Mn,Mn+128);Mr.push({name:"Signature",byteRange:`${(Dn+Mn)/2}-${(Dn+Mn+127)/2}`,hexData:Vn.match(/.{8}/g)?.join(" ")||Vn,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${Vn.slice(0,16)}...${Vn.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),Mn+=128}if(tn.length>Mn){const Vn=tn.slice(Mn);pe(Mr,Vn,Dn+Mn)}}else Mr.push({name:"ADVERT AppData (Partial)",byteRange:`${Dn/2}-${Dn/2+Br-1}`,hexData:tn.match(/.{2}/g)?.join(" ")||tn,description:`Partial ADVERT data - appears to be just AppData portion (${Br} bytes)`,fields:[{bits:`0-${Br*8-1}`,name:"Partial Data",value:`${Br} bytes - attempting to decode as AppData`,binary:`${Br} bytes (${Br*8} bits)`}]}),pe(Mr,tn,Dn)}catch(Mn){Mr.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:tn.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${Mn instanceof Error?Mn.message:"Unknown error"}`,binary:"Invalid"}]})}},pe=(Mr,tn,Dn)=>{try{const Mn=tn.length/2;Mr.push({name:"AppData",byteRange:`${Dn/2}-${Dn/2+Mn-1}`,hexData:tn.match(/.{2}/g)?.join(" ")||tn,description:`Node advertisement application data (${Mn} bytes)`,fields:[{bits:`0-${Mn*8-1}`,name:"Application Data",value:`${Mn} bytes (contains flags, location, name, etc.)`,binary:`${Mn} bytes (${Mn*8} bits)`}]});let Br=0;if(tn.length>=2){const Vn=parseInt(tn.slice(Br,Br+2),16),on=[],pr=!!(Vn&16),_r=!!(Vn&32),Sr=!!(Vn&64),Dr=!!(Vn&128);if(Vn&1&&on.push("is chat node"),Vn&2&&on.push("is repeater"),Vn&4&&on.push("is room server"),Vn&8&&on.push("is sensor"),pr&&on.push("has location"),_r&&on.push("has feature 1"),Sr&&on.push("has feature 2"),Dr&&on.push("has name"),Mr.push({name:"AppData Flags",byteRange:`${(Dn+Br)/2}`,hexData:`0x${tn.slice(Br,Br+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:on.join(", ")||"none",binary:Vn.toString(2).padStart(8,"0")}]}),Br+=2,pr&&tn.length>=Br+16){const nn=tn.slice(Br,Br+8),Cn=[];for(let Yn=6;Yn>=0;Yn-=2)Cn.push(nn.slice(Yn,Yn+2));const Xn=parseInt(Cn.join(""),16),_i=Xn>2147483647?Xn-4294967296:Xn,ta=_i/1e6,va=tn.slice(Br+8,Br+16),_a=[];for(let Yn=6;Yn>=0;Yn-=2)_a.push(va.slice(Yn,Yn+2));const qi=parseInt(_a.join(""),16),Bi=qi>2147483647?qi-4294967296:qi,Xi=Bi/1e6;Mr.push({name:"Location Data",byteRange:`${(Dn+Br)/2}-${(Dn+Br+15)/2}`,hexData:`${nn.match(/.{2}/g)?.join(" ")||nn} ${va.match(/.{2}/g)?.join(" ")||va}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${ta.toFixed(6)}° (raw: ${_i})`,binary:_i.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${Xi.toFixed(6)}° (raw: ${Bi})`,binary:Bi.toString(2).padStart(32,"0")}]}),Br+=16}if(_r&&tn.length>=Br+4){const nn=tn.slice(Br,Br+4),Cn=parseInt(nn,16);Mr.push({name:"Feature 1",byteRange:`${(Dn+Br)/2}-${(Dn+Br+3)/2}`,hexData:nn.match(/.{2}/g)?.join(" ")||nn,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${Cn}`,binary:Cn.toString(2).padStart(16,"0")}]}),Br+=4}if(Sr&&tn.length>=Br+4){const nn=tn.slice(Br,Br+4),Cn=parseInt(nn,16);Mr.push({name:"Feature 2",byteRange:`${(Dn+Br)/2}-${(Dn+Br+3)/2}`,hexData:nn.match(/.{2}/g)?.join(" ")||nn,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${Cn}`,binary:Cn.toString(2).padStart(16,"0")}]}),Br+=4}if(Dr&&tn.length>Br){const nn=tn.slice(Br),Cn=nn.match(/.{2}/g)||[],Xn=Cn.map(_i=>{const ta=parseInt(_i,16);return ta>=32&&ta<=126?String.fromCharCode(ta):"."}).join("").replace(/\.+$/,"");Mr.push({name:"Node Name",byteRange:`${(Dn+Br)/2}-${(Dn+tn.length-1)/2}`,hexData:nn.match(/.{2}/g)?.join(" ")||nn,description:`Node name string (${Cn.length} bytes)`,fields:[{bits:`0-${Cn.length*8-1}`,name:"Node Name",value:`"${Xn}"`,binary:`ASCII text (${Cn.length} bytes)`}]})}}}catch(Mn){Mr.push({name:"AppData Parse Error",byteRange:"N/A",hexData:tn.slice(0,Math.min(32,tn.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${Mn instanceof Error?Mn.message:"Unknown error"}`,binary:"Invalid"}]})}},me=Mr=>{if(!Mr)return[];if(Array.isArray(Mr))return Mr;if(typeof Mr=="string")try{return JSON.parse(Mr)}catch{return[]}return[]},we=Mr=>{const tn=[];if(!Mr)return tn;try{const Dn=Mr.raw_packet;if(Dn){const Mn=Dn.replace(/\s+/g,"").toUpperCase();let Br=0;if(Mn.length>=2){const Vn=Mn.slice(Br,Br+2),on=parseInt(Vn,16),pr=on&3,_r=(on&60)>>2,Sr=(on&192)>>6,Dr={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},nn={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(tn.push({name:"Header",byteRange:"0",hexData:`0x${Vn}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:Dr[pr]||"Unknown",binary:pr.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:nn[_r]||"Unknown",binary:_r.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:Sr.toString(),binary:Sr.toString(2).padStart(2,"0")}]}),Br+=2,(pr===0||pr===3)&&Mn.length>=Br+8){const Xn=Mn.slice(Br,Br+8),_i=parseInt(Xn.slice(0,4),16),ta=parseInt(Xn.slice(4,8),16);tn.push({name:"Transport Codes",byteRange:"1-4",hexData:`${Xn.slice(0,4)} ${Xn.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:_i.toString(),binary:_i.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:ta.toString(),binary:ta.toString(2).padStart(16,"0")}]}),Br+=8}if(Mn.length>=Br+2){const Xn=Mn.slice(Br,Br+2),_i=parseInt(Xn,16);if(tn.push({name:"Path Length",byteRange:`${Br/2}`,hexData:`0x${Xn}`,description:`${_i} bytes of path data`,fields:[{bits:"0-7",name:"Path Length",value:`${_i} bytes`,binary:_i.toString(2).padStart(8,"0")}]}),Br+=2,_i>0&&Mn.length>=Br+_i*2){const ta=Mn.slice(Br,Br+_i*2);tn.push({name:"Path Data",byteRange:`${Br/2}-${(Br+_i*2-2)/2}`,hexData:ta.match(/.{2}/g)?.join(" ")||ta,description:"Routing path information",fields:[{bits:`0-${_i*8-1}`,name:"Route Path",value:`${_i} bytes of routing data`,binary:`${_i} bytes (${_i*8} bits)`}]}),Br+=_i*2}}if(Mn.length>Br){const Xn=Mn.slice(Br),_i=Xn.length/2;_r===4?ne(tn,Xn,Br):tn.push({name:"Payload Data",byteRange:`${Br/2}-${Br/2+_i-1}`,hexData:Xn.match(/.{2}/g)?.join(" ")||Xn,description:"Application data content",fields:[{bits:`0-${_i*8-1}`,name:"Application Data",value:`${_i} bytes`,binary:`${_i} bytes (${_i*8} bits)`}]})}}}else{if(Mr.header){const Mn=Mr.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),Br=parseInt(Mn,16),Vn=Br&3,on=(Br&60)>>2,pr=(Br&192)>>6,_r={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},Sr={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};tn.push({name:"Header",byteRange:"0",hexData:`0x${Mn}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:_r[Vn]||"Unknown",binary:Vn.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:Sr[on]||"Unknown",binary:on.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:pr.toString(),binary:pr.toString(2).padStart(2,"0")}]}),Mr.transport_codes&&tn.push({name:"Transport Codes",byteRange:"1-4",hexData:Mr.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:Mr.transport_codes,binary:"Available in separate field"}]}),Mr.original_path&&Mr.original_path.length>0&&tn.push({name:"Original Path",byteRange:"?",hexData:Mr.original_path.join(" "),description:`Original routing path (${Mr.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Mr.original_path.length} nodes`,binary:"Available as node list"}]}),Mr.forwarded_path&&Mr.forwarded_path.length>0&&tn.push({name:"Forwarded Path",byteRange:"?",hexData:Mr.forwarded_path.join(" "),description:`Forwarded routing path (${Mr.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Mr.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(Mr.payload){const Mn=Mr.payload.replace(/\s+/g,"").toUpperCase(),Br=Mn.length/2;Mr.type===4?ne(tn,Mn,0):tn.push({name:"Payload Data",byteRange:`0-${Br-1}`,hexData:Mn.match(/.{2}/g)?.join(" ")||Mn,description:`Application data content (${Br} bytes)`,fields:[{bits:`0-${Br*8-1}`,name:"Application Data",value:`${Br} bytes`,binary:`${Br} bytes (${Br*8} bits)`}]})}}}catch{tn.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return tn},Ce=Mr=>Mr==null?"text-content-muted dark:text-content-muted":Mr>=10?"text-green-600 dark:text-green-400":Mr>=5?"text-cyan-600 dark:text-cyan-400":Mr>=0?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",Ve=(Mr,tn=8)=>{if(Mr==null)return{level:0,className:"signal-none"};const Mn={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20}[tn]||-10;let Br,Vn;return Mr>=Mn+10?(Br=4,Vn="signal-excellent"):Mr>=Mn+5?(Br=3,Vn="signal-good"):Mr>=Mn?(Br=2,Vn="signal-fair"):(Br=1,Vn="signal-poor"),{level:Br,className:Vn}},kr=Mr=>{if(!Mr)return[];try{const tn=JSON.parse(Mr);return Array.isArray(tn)?tn:[]}catch{return[]}},It=Mr=>Mr>=1e3?`${(Mr/1e3).toFixed(2)}s`:`${Math.round(Mr)}ms`,rn=Mr=>{Mr.key==="Escape"&&u("close")},Lr=Mr=>{Mr.target===Mr.currentTarget&&u("close")};return Fh(()=>r.isOpen,Mr=>{Mr?document.body.style.overflow="hidden":document.body.style.overflow=""},{immediate:!0}),(Mr,tn)=>(Or(),w0(CS,{to:"body"},[Vs(F2,{name:"modal",appear:""},{default:V1(()=>[Mr.isOpen&&Mr.packet?(Or(),Nr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 overflow-hidden",onClick:Lr,onKeydown:rn,tabindex:"0"},[tn[51]||(tn[51]=At("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md pointer-events-none"},null,-1)),At("div",{class:"relative w-full max-w-4xl max-h-[90vh] flex flex-col",onClick:tn[3]||(tn[3]=Od(()=>{},["stop"]))},[At("div",Spt,[At("div",Cpt,[At("div",null,[tn[4]||(tn[4]=At("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Packet Details",-1)),At("p",Apt,yn(yt(Mr.packet.type))+" - "+yn(St(Mr.packet.route)),1)]),At("div",Mpt,[At("button",{onClick:tn[0]||(tn[0]=Dn=>T.value=!T.value),class:ja(["flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all duration-200",T.value?"bg-cyan-500/20 border border-cyan-400/30 text-cyan-600 dark:text-cyan-400":"bg-background-mute dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted"]),title:T.value?"Hide binary values":"Show binary values"},tn[5]||(tn[5]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})],-1),At("span",{class:"text-xs font-medium"},"Binary",-1)]),10,Ept),At("button",{onClick:tn[1]||(tn[1]=Dn=>u("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-background-mute dark:bg-white/10 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors duration-200 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary"},tn[6]||(tn[6]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),At("div",Lpt,[At("div",Ppt,[tn[13]||(tn[13]=At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[At("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),cl(" Basic Information ")],-1)),At("div",Ipt,[At("div",Dpt,[At("div",zpt,[At("div",Opt,[tn[7]||(tn[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Timestamp",-1)),At("span",Bpt,yn($(Mr.packet.timestamp)),1)]),At("div",Rpt,[tn[8]||(tn[8]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Packet Hash",-1)),At("span",Fpt,yn(Mr.packet.packet_hash),1)]),Mr.packet.header?(Or(),Nr("div",Npt,[tn[9]||(tn[9]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Header",-1)),At("span",jpt,yn(Mr.packet.header),1)])):Ta("",!0)]),At("div",Upt,[At("div",$pt,[tn[10]||(tn[10]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Type",-1)),At("span",Hpt,yn(Mr.packet.type)+" ("+yn(yt(Mr.packet.type))+")",1)]),At("div",Vpt,[tn[11]||(tn[11]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Route",-1)),At("span",Wpt,yn(Mr.packet.route)+" ("+yn(St(Mr.packet.route))+")",1)]),At("div",qpt,[tn[12]||(tn[12]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Status",-1)),At("span",{class:ja(["font-semibold",K(Mr.packet)])},yn(ct(Mr.packet)),3)])])])])]),At("div",Gpt,[tn[25]||(tn[25]=At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[At("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),cl(" Payload Data ")],-1)),At("div",Zpt,[At("div",Kpt,[At("div",Ypt,[tn[14]||(tn[14]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Payload Length",-1)),At("span",Xpt,yn(Mr.packet.payload_length||Mr.packet.length)+" bytes",1)]),Mr.packet.payload?(Or(),Nr("div",Jpt,[tn[23]||(tn[23]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3"},"Payload Analysis",-1)),At("div",Qpt,[tn[15]||(tn[15]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),At("div",t0t,[At("pre",e0t,yn(Ut(Mr.packet.payload)),1)])]),(Or(!0),Nr(Es,null,jl(we(Mr.packet).filter(Dn=>!Dn.name.includes("Parse Error")),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"mb-4"},[At("div",r0t,[At("h4",n0t,yn(Dn.name),1),At("span",i0t,"Bytes "+yn(Dn.byteRange),1)]),At("div",a0t,[At("div",o0t,yn(Dn.hexData),1)]),At("div",s0t,[At("div",{class:ja(["hidden md:grid gap-3 p-3 bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-muted text-xs font-semibold uppercase tracking-wide",T.value?"grid-cols-4":"grid-cols-3"])},[tn[16]||(tn[16]=At("div",{class:"min-w-0"},"Bits",-1)),tn[17]||(tn[17]=At("div",{class:"min-w-0"},"Field",-1)),tn[18]||(tn[18]=At("div",{class:"min-w-0"},"Value",-1)),T.value?(Or(),Nr("div",l0t,"Binary")):Ta("",!0)],2),(Or(!0),Nr(Es,null,jl(Dn.fields,(Br,Vn)=>(Or(),Nr("div",{key:Vn,class:ja(["hidden md:grid gap-3 p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors",T.value?"grid-cols-4":"grid-cols-3"])},[At("div",c0t,yn(Br.bits),1),At("div",u0t,yn(Br.name),1),At("div",h0t,[At("span",{class:"block",title:Br.value},yn(Br.value),9,d0t)]),T.value?(Or(),Nr("div",f0t,[At("span",{class:"block",title:Br.binary},yn(Br.binary),9,p0t)])):Ta("",!0)],2))),128)),(Or(!0),Nr(Es,null,jl(Dn.fields,(Br,Vn)=>(Or(),Nr("div",{key:`mobile-${Vn}`,class:"md:hidden p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 space-y-2"},[At("div",m0t,[At("div",null,[tn[19]||(tn[19]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Bits:",-1)),At("div",g0t,yn(Br.bits),1)]),At("div",null,[tn[20]||(tn[20]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Field:",-1)),At("div",v0t,yn(Br.name),1)])]),At("div",null,[tn[21]||(tn[21]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Value:",-1)),At("div",{class:"text-content-primary dark:text-content-primary text-sm font-semibold break-all",title:Br.value},yn(Br.value),9,y0t)]),T.value?(Or(),Nr("div",_0t,[tn[22]||(tn[22]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Binary:",-1)),At("div",{class:"text-orange-500 text-xs font-mono break-all",title:Br.binary},yn(Br.binary),9,x0t)])):Ta("",!0)]))),128))]),Dn.description?(Or(),Nr("div",b0t,yn(Dn.description),1)):Ta("",!0)]))),128))])):(Or(),Nr("div",w0t,tn[24]||(tn[24]=[At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Payload:",-1),At("span",{class:"text-content-muted dark:text-content-muted ml-2"},"None",-1)])))])])]),At("div",k0t,[tn[33]||(tn[33]=At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[At("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),cl(" Path Information ")],-1)),At("div",T0t,[At("div",S0t,[At("div",C0t,[At("div",A0t,[tn[26]||(tn[26]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Source Hash",-1)),At("span",{class:ja(["text-content-primary dark:text-content-primary font-mono text-xs",r.localHash&&Mr.packet.src_hash===r.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},yn(Mr.packet.src_hash||"Unknown"),3)]),At("div",M0t,[tn[27]||(tn[27]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Destination Hash",-1)),At("span",{class:ja(["text-content-primary dark:text-content-primary font-mono text-xs",r.localHash&&Mr.packet.dst_hash===r.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},yn(Mr.packet.dst_hash||"Broadcast"),3)])]),me(Mr.packet.original_path).length>0?(Or(),Nr("div",E0t,[tn[29]||(tn[29]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"Original Path",-1)),At("div",L0t,[At("div",P0t,[(Or(!0),Nr(Es,null,jl(me(Mr.packet.original_path),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center"},[At("div",I0t,[At("div",D0t,[At("div",z0t,yn(Dn.length<=2?Dn.toUpperCase():Dn.slice(0,2).toUpperCase()),1)]),At("div",O0t," Node: "+yn(Dn),1)]),Mn0?(Or(),Nr("div",R0t,[At("div",F0t,[tn[31]||(tn[31]=cl(" Forwarded Path ",-1)),JSON.stringify(me(Mr.packet.original_path))!==JSON.stringify(me(Mr.packet.forwarded_path))?(Or(),Nr("svg",N0t,tn[30]||(tn[30]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):Ta("",!0),JSON.stringify(me(Mr.packet.original_path))!==JSON.stringify(me(Mr.packet.forwarded_path))?(Or(),Nr("span",j0t,"(Modified)")):Ta("",!0)]),At("div",U0t,[At("div",$0t,[(Or(!0),Nr(Es,null,jl(me(Mr.packet.forwarded_path),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center"},[At("div",H0t,[At("div",{class:ja(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-500 dark:border-orange-400/40 rounded-lg transform transition-all hover:scale-105",r.localHash&&Dn===r.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-500 dark:border-orange-400/60"])},[At("div",{class:ja(["font-mono text-xs font-semibold",r.localHash&&Dn===r.localHash?"text-yellow-200":"text-white/90"])},yn(Dn.slice(0,2).toUpperCase()),3),r.localHash&&Dn===r.localHash?(Or(),Nr("div",V0t)):Ta("",!0)],2),At("div",W0t,yn(Dn),1)]),MnAt("div",{key:Dn,class:ja(["w-2 h-6 rounded-sm transition-all duration-300",Dn<=Ve(Mr.packet.snr).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[Ve(Mr.packet.snr).className]:"bg-stroke-subtle dark:bg-stroke/10"])},null,2)),64))]),At("span",imt,yn(Ve(Mr.packet.snr).className.replace("signal-","")),1)])])):(Or(),Nr("div",amt,tn[40]||(tn[40]=[At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"Signal Quality",-1),At("div",{class:"text-content-muted dark:text-content-muted text-sm italic"},"N/A (TX Packet)",-1)]))),Mr.packet.is_trace&&Mr.packet.path_snr_details&&Mr.packet.path_snr_details.length>0?(Or(),Nr("div",omt,[At("div",smt,"Path SNR Details ("+yn(Mr.packet.path_snr_details.length)+" hops)",1),At("div",lmt,[(Or(!0),Nr(Es,null,jl(Mr.packet.path_snr_details,(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center justify-between p-2 glass-card bg-background-mute dark:bg-black/20 rounded-[8px]"},[At("div",cmt,[At("span",umt,yn(Mn+1)+".",1),At("span",{class:ja(["font-mono text-xs text-content-primary dark:text-content-primary",r.localHash&&Dn.hash===r.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},yn(Dn.hash),3)]),At("span",{class:ja(["text-sm font-bold",Ce(Dn.snr_db)])},yn(Dn.snr_db.toFixed(1))+"dB ",3)]))),128))])])):Ta("",!0),Mr.packet.transmitted&&Mr.packet.lbt_attempts!==void 0?(Or(),Nr("div",hmt,[tn[45]||(tn[45]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3 flex items-center"},[At("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})]),cl(" Listen Before Talk (LBT) Metrics ")],-1)),At("div",dmt,[At("div",fmt,[tn[41]||(tn[41]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"CAD Attempts",-1)),At("div",pmt,yn(Mr.packet.lbt_attempts),1)]),At("div",mmt,[tn[42]||(tn[42]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Total LBT Delay",-1)),At("div",gmt,yn(It(kr(Mr.packet.lbt_backoff_delays_ms).reduce((Dn,Mn)=>Dn+Mn,0))),1),At("div",vmt,yn(kr(Mr.packet.lbt_backoff_delays_ms).length)+" backoffs ",1)]),At("div",ymt,[tn[43]||(tn[43]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Channel Status",-1)),At("div",{class:ja(["text-lg font-bold",Mr.packet.lbt_channel_busy?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400"])},yn(Mr.packet.lbt_channel_busy?"BUSY":"CLEAR"),3),At("div",_mt,yn(Mr.packet.lbt_channel_busy?"Waited for clear":"Immediate TX"),1)])]),kr(Mr.packet.lbt_backoff_delays_ms).length>0?(Or(),Nr("div",xmt,[tn[44]||(tn[44]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-3 font-semibold"},"Backoff Pattern (Exponential with Jitter)",-1)),At("div",bmt,[(Or(!0),Nr(Es,null,jl(kr(Mr.packet.lbt_backoff_delays_ms),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center gap-3"},[At("div",wmt,[At("span",kmt,"Attempt "+yn(Mn+1),1)]),At("div",Tmt,[At("div",Smt,[At("div",{class:ja(["h-full rounded-lg transition-all duration-300",[Mn===0?"bg-gradient-to-r from-cyan-500/50 to-cyan-600/50":Mn===1?"bg-gradient-to-r from-yellow-500/50 to-yellow-600/50":Mn===2?"bg-gradient-to-r from-orange-500/50 to-orange-600/50":"bg-gradient-to-r from-red-500/50 to-red-600/50"]]),style:Sp({width:`${Math.min(100,Dn/Math.max(...kr(Mr.packet.lbt_backoff_delays_ms))*100)}%`})},[At("div",Cmt,[At("span",Amt,yn(It(Dn)),1)])],6)])]),At("div",Mmt,[At("span",Emt,yn(Math.round(Dn/kr(Mr.packet.lbt_backoff_delays_ms).reduce((Br,Vn)=>Br+Vn,0)*100))+"% ",1)])]))),128))])])):Ta("",!0)])):Ta("",!0),At("div",Lmt,[At("div",Pmt,[At("div",Imt,[tn[46]||(tn[46]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"TX Delay",-1)),At("span",Dmt,yn(Number(Mr.packet.tx_delay_ms)>0?Number(Mr.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),At("div",zmt,[tn[47]||(tn[47]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Transmitted",-1)),At("span",{class:ja(Mr.packet.transmitted?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400")},yn(Mr.packet.transmitted?"Yes":"No"),3)])]),At("div",Omt,[At("div",Bmt,[tn[48]||(tn[48]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Is Duplicate",-1)),At("span",{class:ja(Mr.packet.is_duplicate?"text-amber-600 dark:text-amber-400":"text-content-muted dark:text-content-muted")},yn(Mr.packet.is_duplicate?"Yes":"No"),3)]),Mr.packet.drop_reason?(Or(),Nr("div",Rmt,[tn[49]||(tn[49]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Drop Reason",-1)),At("span",Fmt,yn(Mr.packet.drop_reason),1)])):Ta("",!0)])])])])]),At("div",Nmt,[At("button",{onClick:tn[2]||(tn[2]=Dn=>u("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-content-primary dark:text-content-primary transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):Ta("",!0)]),_:1})]))}}),Umt=vh(jmt,[["__scopeId","data-v-6aa59823"]]),yH="pymc_pref_";function B1(e,t){try{const r=localStorage.getItem(yH+e);return r===null?t:JSON.parse(r)}catch(r){return console.warn(`Failed to get preference ${e}:`,r),t}}function R1(e,t){try{localStorage.setItem(yH+e,JSON.stringify(t))}catch(r){console.warn(`Failed to set preference ${e}:`,r)}}const $mt={class:"glass-card rounded-[20px] p-6"},Hmt={class:"flex flex-col lg:flex-row lg:justify-between lg:items-center mb-6 gap-4 filter-container"},Vmt={class:"flex items-center gap-2 header-info relative"},Wmt={class:"text-content-secondary dark:text-content-muted text-sm packet-count"},qmt=["title"],Gmt={class:"hidden sm:inline"},Zmt={key:1,class:"text-accent-red text-sm error-indicator"},Kmt={class:"flex items-center gap-3 lg:flex filter-controls"},Ymt={class:"flex flex-col"},Xmt=["value"],Jmt={class:"flex flex-col"},Qmt=["value"],tgt={class:"flex flex-col"},egt={class:"flex flex-col reset-container"},rgt=["disabled"],ngt={class:"space-y-4 overflow-hidden"},igt=["onClick"],agt={class:"hidden lg:grid grid-cols-12 gap-2 items-center"},ogt={class:"col-span-1 text-content-primary dark:text-content-primary text-sm"},sgt={class:"col-span-1 flex items-center gap-2"},lgt={class:"flex flex-col"},cgt={class:"text-content-primary dark:text-content-primary text-xs"},ugt=["title"],hgt={class:"col-span-2"},dgt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},fgt={class:"col-span-2"},pgt={class:"space-y-1"},mgt={class:"inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs"},ggt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},vgt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},ygt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},_gt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},xgt={key:0,class:"flex items-center gap-1"},bgt={class:"col-span-1"},wgt={key:0,class:"text-accent-red text-[8px] italic truncate"},kgt={class:"lg:hidden space-y-2"},Tgt={class:"flex items-center justify-between"},Sgt={class:"flex items-center gap-2"},Cgt={class:"flex flex-col"},Agt={class:"text-content-primary dark:text-content-primary text-sm font-medium"},Mgt=["title"],Egt={class:"flex items-center gap-2 text-right"},Lgt={class:"text-content-secondary dark:text-content-muted text-xs"},Pgt={class:"flex items-center justify-between"},Igt={class:"flex items-center gap-2"},Dgt={class:"inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs"},zgt={class:"flex items-center gap-2"},Ogt={class:"flex items-center gap-1"},Bgt={key:0,class:"flex gap-0.5"},Rgt={class:"text-content-primary dark:text-content-primary text-xs"},Fgt={class:"flex items-center justify-between text-content-secondary dark:text-content-muted text-xs"},Ngt={class:"flex items-center gap-3"},jgt={class:"flex items-center gap-2"},Ugt={key:0,class:"flex items-center gap-1"},$gt={key:0,class:"text-accent-red text-xs italic"},Hgt={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke pagination-container"},Vgt={class:"flex items-center gap-4 pagination-info"},Wgt={class:"text-content-secondary dark:text-content-muted text-sm"},qgt={key:0,class:"flex items-center gap-2 load-more-section"},Ggt=["disabled"],Zgt={class:"text-content-secondary dark:text-content-muted text-xs load-more-count"},Kgt={class:"flex items-center gap-2 pagination-controls"},Ygt=["disabled"],Xgt={class:"flex items-center gap-1 page-numbers"},Jgt={key:1,class:"text-content-secondary dark:text-content-muted text-sm px-2 ellipsis"},Qgt=["onClick"],tvt={key:2,class:"text-content-secondary dark:text-content-muted text-sm px-2 ellipsis"},evt=["disabled"],rvt={key:1,class:"flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke"},nvt={class:"flex items-center gap-4"},ivt={class:"text-content-secondary dark:text-content-muted text-sm"},avt={class:"text-content-secondary dark:text-content-muted text-xs"},ovt={key:2,class:"flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke"},U3=10,fx=1e3,svt=Cc({name:"PacketTable",__name:"PacketTable",setup(e){const t=u4(),r=li(1),u=li(null),T=li(100),$=li(!1),K=li(!1);let ct=null;Fh(()=>t.isLoading,Bi=>{Bi?(ct&&(clearTimeout(ct),ct=null),K.value=!0):ct=window.setTimeout(()=>{K.value=!1,ct=null},600)});const yt=li(null),St=li(!1),Ut=Bi=>{yt.value=Bi,St.value=!0},ne=()=>{St.value=!1,yt.value=null},pe=li(B1("packetTable_selectedType","all")),me=li(B1("packetTable_selectedRoute","all")),we=li(!1),Ce=li(null),Ve=["all","0","1","2","3","4","5","6","7","8","9","10","11"],kr=["all","1","2"];Fh(pe,Bi=>{R1("packetTable_selectedType",Bi),r.value=1}),Fh(me,Bi=>{R1("packetTable_selectedRoute",Bi),r.value=1}),Fh(we,()=>{r.value=1});const It=Ao(()=>{let Bi=t.recentPackets;if(pe.value!=="all"){const Xi=parseInt(pe.value);Bi=Bi.filter(Yn=>Yn.type===Xi)}if(me.value!=="all"){const Xi=parseInt(me.value);Bi=Bi.filter(Yn=>Yn.route===Xi)}return we.value&&Ce.value!==null&&(Bi=Bi.filter(Xi=>Xi.timestamp>=Ce.value)),Bi}),rn=Ao(()=>{const Bi=(r.value-1)*U3,Xi=Bi+U3;return It.value.slice(Bi,Xi)}),Lr=Ao(()=>Math.ceil(It.value.length/U3)),Mr=Ao(()=>r.value===Lr.value),tn=Ao(()=>t.recentPackets.length>=T.value&&T.valueMr.value&&tn.value&&!$.value),Mn=Bi=>new Date(Bi*1e3).toLocaleTimeString(void 0,{hour12:!0}),Br=Bi=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTI_PART",11:"CONTROL"})[Bi]||`TYPE_${Bi}`,Vn=Bi=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[Bi]||`Route ${Bi}`,on=Bi=>Bi.transmitted?"text-accent-green":"text-primary",pr=Bi=>Bi.drop_reason?"Dropped":Bi.transmitted?"Forward":"Received",_r=Bi=>Bi===1?"bg-badge-cyan-bg text-badge-cyan-text":"bg-badge-neutral-bg text-badge-neutral-text",Sr=Bi=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[Bi]||"bg-gray-500",Dr=Bi=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[Bi]||"border-l-gray-500",nn=Bi=>!Bi.transmitted||!Bi.lbt_attempts||Bi.lbt_attempts===0?"bg-green-400":Bi.lbt_attempts===1?"bg-cyan-400":Bi.lbt_attempts===2?"bg-yellow-400":"bg-orange-400",Cn=Bi=>Bi>=1e3?(Bi/1e3).toFixed(2)+"s":Bi.toFixed(1)+"ms",Xn=Bi=>{if(Bi.type!==4||!Bi.payload)return null;try{const Xi=Bi.payload.replace(/\s+/g,"").toUpperCase();let Yn=Xi,hi=0;if(Xi.length/2>=100)if(Xi.length>200)Yn=Xi.slice(200),hi=0;else return null;if(Yn.length>=2){const io=parseInt(Yn.slice(0,2),16);hi+=2;const oo=!!(io&16),xa=!!(io&32),Ur=!!(io&64);if(!!!(io&128))return null;if(oo&&Yn.length>=hi+16&&(hi+=16),xa&&Yn.length>=hi+4&&(hi+=4),Ur&&Yn.length>=hi+4&&(hi+=4),Yn.length>hi){const Ha=(Yn.slice(hi).match(/.{2}/g)||[]).map(qa=>{const Mo=parseInt(qa,16);return Mo>=32&&Mo<=126?String.fromCharCode(Mo):"."}).join("").replace(/\.*$/,"");return Ha.length>0?Ha:null}}}catch(Xi){console.error("Error parsing ADVERT node name:",Xi)}return null},_i=()=>{pe.value="all",me.value="all",we.value=!1,Ce.value=null,r.value=1},ta=()=>{we.value?(we.value=!1,Ce.value=null):(we.value=!0,Ce.value=Date.now()/1e3),r.value=1},va=Ao(()=>Ce.value?new Date(Ce.value*1e3).toLocaleTimeString(void 0,{hour12:!0}):""),_a=async Bi=>{try{const Xi=Bi||T.value;await t.fetchRecentPackets({limit:Xi})}catch(Xi){console.error("Error fetching packet data:",Xi)}},qi=async()=>{if(!($.value||T.value>=fx)){$.value=!0;try{const Bi=Math.min(T.value+200,fx);T.value=Bi,await _a(Bi)}catch(Bi){console.error("Error loading more records:",Bi)}finally{$.value=!1}}};return Xd(async()=>{await _a(),u.value=window.setInterval(_a,1e4)}),Tg(()=>{u.value&&clearInterval(u.value),ct&&clearTimeout(ct)}),(Bi,Xi)=>(Or(),Nr(Es,null,[At("div",$mt,[At("div",Hmt,[At("div",Vmt,[Xi[7]||(Xi[7]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold"},"Recent Packets",-1)),At("span",Wmt," ("+yn(It.value.length)+" of "+yn(Io(t).recentPackets.length)+") ",1),we.value?(Or(),Nr("span",{key:0,class:"text-primary text-xs sm:text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20 live-mode-badge whitespace-nowrap",title:`Filter activated at ${va.value}`},[At("span",Gmt,"Live Mode (since "+yn(va.value)+")",1),Xi[6]||(Xi[6]=At("span",{class:"sm:hidden"},"Live",-1))],8,qmt)):Ta("",!0),Io(t).error?(Or(),Nr("span",Zmt,yn(Io(t).error),1)):Ta("",!0)]),At("div",Kmt,[At("div",Ymt,[Xi[8]||(Xi[8]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Type",-1)),Ml(At("select",{"onUpdate:modelValue":Xi[0]||(Xi[0]=Yn=>pe.value=Yn),class:"glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(Or(),Nr(Es,null,jl(Ve,Yn=>At("option",{key:Yn,value:Yn,class:"bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary"},yn(Yn==="all"?"All Types":`Type ${Yn} (${Br(parseInt(Yn))})`),9,Xmt)),64))],512),[[xg,pe.value]])]),At("div",Jmt,[Xi[9]||(Xi[9]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Route",-1)),Ml(At("select",{"onUpdate:modelValue":Xi[1]||(Xi[1]=Yn=>me.value=Yn),class:"glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(Or(),Nr(Es,null,jl(kr,Yn=>At("option",{key:Yn,value:Yn,class:"bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary"},yn(Yn==="all"?"All Routes":`Route ${Yn} (${Vn(parseInt(Yn))})`),9,Qmt)),64))],512),[[xg,me.value]])]),At("div",tgt,[Xi[10]||(Xi[10]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Filter",-1)),At("button",{onClick:ta,class:ja(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":we.value,"border-stroke-subtle dark:border-stroke text-content-secondary dark:text-content-muted hover:border-primary hover:text-content-primary dark:hover:text-content-primary hover:bg-primary/5":!we.value}])},yn(we.value?"New Only":"Show New"),3)]),At("div",egt,[Xi[11]||(Xi[11]=At("label",{class:"text-transparent text-xs mb-1"},".",-1)),At("button",{onClick:_i,class:ja(["glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[10px] px-4 py-2 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-stroke-subtle dark:hover:border-stroke hover:text-content-secondary dark:hover:text-content-muted":pe.value==="all"&&me.value==="all"&&!we.value,"hover:bg-primary/10":pe.value!=="all"||me.value!=="all"||we.value}]),disabled:pe.value==="all"&&me.value==="all"&&!we.value}," Reset ",10,rgt)])])]),Xi[17]||(Xi[17]=Du('',1)),At("div",ngt,[Vs(iot,{name:"packet-list",tag:"div",class:"space-y-4",appear:""},{default:V1(()=>[(Or(!0),Nr(Es,null,jl(rn.value,(Yn,hi)=>(Or(),Nr("div",{key:`${Yn.packet_hash}_${Yn.timestamp}_${hi}`,class:ja(["packet-row border-b border-stroke-subtle dark:border-dark-border/50 pb-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors duration-200 cursor-pointer rounded-[10px] p-2 border-l-4",Dr(Yn.type)]),onClick:aa=>Ut(Yn)},[At("div",agt,[At("div",ogt,yn(Mn(Yn.timestamp)),1),At("div",sgt,[At("div",{class:ja(["w-2 h-2 rounded-full",Sr(Yn.type)])},null,2),At("div",lgt,[At("span",cgt,yn(Br(Yn.type)),1),Yn.type===4&&Xn(Yn)?(Or(),Nr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium max-w-[80px] truncate",title:Xn(Yn)||void 0},yn(Xn(Yn)),9,ugt)):Ta("",!0)])]),At("div",hgt,[At("span",{class:ja(["inline-block px-2 py-1 rounded text-xs font-medium",_r(Yn.route)])},yn(Vn(Yn.route)),3)]),At("div",dgt,yn(Yn.length)+"B",1),At("div",fgt,[At("div",pgt,[At("span",mgt,yn(Yn.src_hash?.slice(-4)||"????")+" → "+yn(Yn.dst_hash?.slice(-4)||"????"),1)])]),At("div",ggt,yn(Yn.rssi!=null?Yn.rssi.toFixed(0):"N/A"),1),At("div",vgt,yn(Yn.snr!=null?Yn.snr.toFixed(1)+"dB":"N/A"),1),At("div",ygt,yn(Yn.score!=null?Yn.score.toFixed(2):"N/A"),1),At("div",_gt,[Number(Yn.tx_delay_ms)>0?(Or(),Nr("div",xgt,[Yn.transmitted?(Or(),Nr("div",{key:0,class:ja(["w-1.5 h-1.5 rounded-full flex-shrink-0",nn(Yn)])},null,2)):Ta("",!0),At("span",null,yn(Cn(Number(Yn.tx_delay_ms))),1)])):Ta("",!0)]),At("div",bgt,[At("div",null,[At("span",{class:ja(["text-xs font-medium",on(Yn)])},yn(pr(Yn)),3),Yn.drop_reason?(Or(),Nr("p",wgt,yn(Yn.drop_reason),1)):Ta("",!0)])])]),At("div",kgt,[At("div",Tgt,[At("div",Sgt,[At("div",{class:ja(["w-2 h-2 rounded-full flex-shrink-0",Sr(Yn.type)])},null,2),At("div",Cgt,[At("span",Agt,yn(Br(Yn.type)),1),Yn.type===4&&Xn(Yn)?(Or(),Nr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium leading-tight",title:Xn(Yn)||void 0},yn(Xn(Yn)),9,Mgt)):Ta("",!0)]),At("span",{class:ja(["inline-block px-2 py-1 rounded text-xs font-medium ml-2",_r(Yn.route)])},yn(Vn(Yn.route)),3)]),At("div",Egt,[At("span",Lgt,yn(Mn(Yn.timestamp)),1),At("span",{class:ja(["text-xs font-medium",on(Yn)])},yn(pr(Yn)),3)])]),At("div",Pgt,[At("div",Igt,[At("span",Dgt,yn(Yn.src_hash?.slice(-4)||"????")+" → "+yn(Yn.dst_hash?.slice(-4)||"????"),1)]),At("div",zgt,[At("div",Ogt,[Yn.snr!=null?(Or(),Nr("div",Bgt,[At("div",{class:ja(["w-1 h-3 rounded-sm",Yn.snr>=-10?"bg-green-400":"bg-white/20"])},null,2),At("div",{class:ja(["w-1 h-4 rounded-sm",Yn.snr>=-5?"bg-green-400":"bg-white/20"])},null,2),At("div",{class:ja(["w-1 h-5 rounded-sm",Yn.snr>=0?"bg-green-400":"bg-white/20"])},null,2),At("div",{class:ja(["w-1 h-6 rounded-sm",Yn.snr>=10?"bg-green-400":"bg-white/20"])},null,2)])):Ta("",!0),At("span",Rgt,yn(Yn.rssi!=null?Yn.rssi.toFixed(0)+"dBm":"TX"),1)])])]),At("div",Fgt,[At("div",Ngt,[At("span",null,yn(Yn.length)+"B",1),At("span",null,"SNR: "+yn(Yn.snr!=null?Yn.snr.toFixed(1)+"dB":"N/A"),1),At("span",null,"Score: "+yn(Yn.score!=null?Yn.score.toFixed(2):"N/A"),1)]),At("div",jgt,[Number(Yn.tx_delay_ms)>0?(Or(),Nr("span",Ugt,[Yn.transmitted?(Or(),Nr("div",{key:0,class:ja(["w-1.5 h-1.5 rounded-full flex-shrink-0",nn(Yn)])},null,2)):Ta("",!0),At("span",null,yn(Cn(Number(Yn.tx_delay_ms))),1)])):Ta("",!0)])]),Yn.drop_reason?(Or(),Nr("div",$gt,yn(Yn.drop_reason),1)):Ta("",!0)])],10,igt))),128))]),_:1})]),Lr.value>1?(Or(),Nr("div",Hgt,[At("div",Vgt,[At("span",Wgt," Showing "+yn((r.value-1)*U3+1)+" - "+yn(Math.min(r.value*U3,It.value.length))+" of "+yn(It.value.length)+" packets ",1),Dn.value?(Or(),Nr("div",qgt,[Xi[12]||(Xi[12]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"•",-1)),At("button",{onClick:qi,disabled:$.value,class:ja(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!$.value,"text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke cursor-not-allowed opacity-50":$.value}])},yn($.value?"Loading...":`Load ${Math.min(200,fx-T.value)} more`),11,Ggt),At("span",Zgt,"("+yn(T.value)+"/"+yn(fx)+" max)",1)])):Ta("",!0)]),At("div",Kgt,[At("button",{onClick:Xi[2]||(Xi[2]=Yn=>r.value=r.value-1),disabled:r.value<=1,class:ja(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":r.value<=1,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":r.value>1}])},Xi[13]||(Xi[13]=[At("span",{class:"hidden sm:inline"},"Previous",-1),At("span",{class:"sm:hidden"},"‹",-1)]),10,Ygt),At("div",Xgt,[r.value>3?(Or(),Nr("button",{key:0,onClick:Xi[3]||(Xi[3]=Yn=>r.value=1),class:"glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):Ta("",!0),r.value>4?(Or(),Nr("span",Jgt,"...")):Ta("",!0),(Or(!0),Nr(Es,null,jl(Array.from({length:Math.min(5,Lr.value)},(Yn,hi)=>Math.max(1,Math.min(r.value-2,Lr.value-4))+hi).filter(Yn=>Yn<=Lr.value),Yn=>(Or(),Nr("button",{key:Yn,onClick:hi=>r.value=Yn,class:ja(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 page-number",{"border-primary bg-primary/10 text-primary":r.value===Yn,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":r.value!==Yn}])},yn(Yn),11,Qgt))),128)),r.valuer.value=Lr.value),class:"glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},yn(Lr.value),1)):Ta("",!0)]),At("button",{onClick:Xi[5]||(Xi[5]=Yn=>r.value=r.value+1),disabled:r.value>=Lr.value,class:ja(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":r.value>=Lr.value,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":r.value(Or(),Nr("div",null,[Vs($ft),At("div",cvt,[Vs(Tpt),Vs(spt)]),Vs(lvt)]))}}),hvt={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mb-6"},dvt={class:"flex items-center gap-3"},fvt={class:"flex-1 min-w-0"},pvt={class:"text-content-primary dark:text-content-primary font-medium truncate"},mvt={class:"text-content-secondary dark:text-content-muted text-sm font-mono"},gvt={key:0,class:"text-white/50 text-xs"},vvt={key:1,class:"text-white/50 text-xs"},yvt=Cc({__name:"DeleteNeighborModal",props:{show:{type:Boolean},neighbor:{}},emits:["close","delete"],setup(e,{emit:t}){const r=e,u=t,T=()=>{r.neighbor&&(u("delete",r.neighbor.id),$())},$=()=>{u("close")},K=ct=>{ct.target===ct.currentTarget&&$()};return(ct,yt)=>ct.show&&ct.neighbor?(Or(),Nr("div",{key:0,onClick:K,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:yt[0]||(yt[0]=Od(()=>{},["stop"]))},[At("div",{class:"flex items-center gap-3 mb-6"},[yt[2]||(yt[2]=At("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),yt[3]||(yt[3]=At("div",null,[At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Delete Neighbor"),At("p",{class:"text-content-secondary dark:text-content-muted text-sm mt-1"}," Are you sure you want to delete this neighbor? ")],-1)),At("button",{onClick:$,class:"ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},yt[1]||(yt[1]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",hvt,[At("div",dvt,[At("div",fvt,[At("div",pvt,yn(ct.neighbor?.node_name||ct.neighbor?.long_name||ct.neighbor?.short_name||"Unknown"),1),At("div",mvt," ID: "+yn(ct.neighbor?.node_num_hex||ct.neighbor?.node_num||ct.neighbor?.id||"N/A"),1),ct.neighbor?.contact_type?(Or(),Nr("div",gvt,yn(ct.neighbor.contact_type),1)):Ta("",!0),ct.neighbor?.hw_model?(Or(),Nr("div",vvt,yn(ct.neighbor.hw_model),1)):Ta("",!0)])])]),yt[4]||(yt[4]=At("div",{class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},[At("div",{class:"flex items-center gap-2 text-accent-red text-sm"},[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),At("span",null,"This action cannot be undone")])],-1)),At("div",{class:"flex gap-3"},[At("button",{onClick:$,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{onClick:T,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"}," Delete ")])])])):Ta("",!0)}}),_vt={class:"bg-gradient-to-r from-primary/20 to-accent-blue/20 border-b border-stroke-subtle dark:border-stroke/10 px-6 py-4"},xvt={class:"flex items-center justify-between"},bvt={class:"flex items-center gap-3"},wvt={key:0,class:"text-sm text-content-secondary dark:text-content-muted"},kvt={class:"p-6"},Tvt={key:0,class:"text-center py-8"},Svt={key:1,class:"text-center py-8"},Cvt={class:"text-content-secondary dark:text-content-muted text-sm"},Avt={key:2,class:"space-y-4"},Mvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Evt={class:"flex items-center justify-between mb-2"},Lvt={class:"flex items-baseline gap-2"},Pvt={class:"text-3xl font-bold text-content-primary dark:text-content-primary"},Ivt={class:"grid grid-cols-2 gap-3"},Dvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},zvt={class:"flex items-center gap-2 mb-2"},Ovt={class:"flex gap-0.5"},Bvt={class:"flex items-baseline gap-1"},Rvt={class:"text-xl font-bold text-content-primary dark:text-content-primary"},Fvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Nvt={class:"flex items-baseline gap-1"},jvt={class:"text-xl font-bold text-content-primary dark:text-content-primary"},Uvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},$vt={class:"relative"},Hvt={class:"flex items-center gap-2 overflow-x-auto pb-2"},Vvt={key:0,class:"relative flex items-center"},Wvt={key:0,class:"absolute left-1/2 -translate-x-1/2 animate-pulse"},qvt={class:"text-content-muted dark:text-content-muted text-xs mt-2 flex items-center justify-between"},Gvt={key:0,class:"text-cyan-500 dark:text-primary animate-pulse"},Zvt={class:"flex items-center justify-between text-xs text-content-muted dark:text-content-muted pt-2"},Kvt=Cc({__name:"PingResultModal",props:{show:{type:Boolean},nodeName:{default:null},result:{default:null},error:{default:null},loading:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const r=e,u=t,T=Ym(),$=li(0),K=li(!1),ct=Ao(()=>{const pe=T.stats?.config?.radio?.spreading_factor??7,me=T.stats?.config?.radio?.bandwidth??125,we=T.stats?.config?.radio?.coding_rate??5,Ce=Math.pow(2,pe)/me,Ve=8+4.25*(we-4)+20;return Ce*Ve}),yt=Ao(()=>{if(!r.result)return{color:"text-gray-400",label:"Unknown"};const pe=r.result.rtt_ms,me=ct.value,we=r.result.path.length,Ve=2*me*we+500*we;return pe{if(!r.result)return{bars:0,color:"text-gray-400"};const pe=r.result.rssi;return pe>=-50?{bars:5,color:"text-green-600 dark:text-green-400"}:pe>=-60?{bars:4,color:"text-green-600 dark:text-green-300"}:pe>=-70?{bars:3,color:"text-yellow-600 dark:text-yellow-400"}:pe>=-80?{bars:2,color:"text-orange-600 dark:text-orange-400"}:pe>=-90?{bars:1,color:"text-red-600 dark:text-red-400"}:{bars:0,color:"text-red-600 dark:text-red-500"}});Fh(()=>r.result,pe=>{if(pe&&!K.value){K.value=!0,$.value=0;const me=pe.path.length,Ce=1500/(me*2);let Ve=0;const kr=me*2-2,It=()=>{Ve<=kr?($.value=Ve/kr,Ve++,setTimeout(It,Ce)):(K.value=!1,$.value=1)};setTimeout(It,100)}},{immediate:!0});const Ut=Ao(()=>{if(!r.result||!K.value)return-1;const pe=r.result.path.length;if(pe<=1)return-1;const me=$.value,we=.5;if(me<=we)return me/we*(pe-1);{const Ce=(me-we)/we;return(pe-1)*(1-Ce)}}),ne=()=>{u("close")};return(pe,me)=>(Or(),w0(CS,{to:"body"},[Vs(F2,{name:"modal"},{default:V1(()=>[pe.show?(Or(),Nr("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[99999] p-4",onClick:Od(ne,["self"])},[At("div",{class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[20px] shadow-2xl w-full max-w-md overflow-hidden",onClick:me[0]||(me[0]=Od(()=>{},["stop"]))},[At("div",_vt,[At("div",xvt,[At("div",bvt,[me[2]||(me[2]=At("div",{class:"p-2 bg-cyan-400/20 dark:bg-primary/20 rounded-lg"},[At("svg",{class:"w-5 h-5 text-cyan-500 dark:text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})])],-1)),At("div",null,[me[1]||(me[1]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Ping Result",-1)),pe.nodeName?(Or(),Nr("p",wvt,yn(pe.nodeName),1)):Ta("",!0)])]),At("button",{onClick:ne,class:"p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary"},me[3]||(me[3]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),At("div",kvt,[pe.loading?(Or(),Nr("div",Tvt,me[4]||(me[4]=[At("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"},null,-1),At("p",{class:"text-content-secondary dark:text-content-muted"},"Sending ping...",-1),At("p",{class:"text-content-muted dark:text-content-muted text-sm mt-1"},"Waiting for response...",-1)]))):pe.error?(Or(),Nr("div",Svt,[me[5]||(me[5]=At("div",{class:"p-3 bg-accent-red/10 rounded-full w-16 h-16 mx-auto mb-4 flex items-center justify-center"},[At("svg",{class:"w-8 h-8 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z"})])],-1)),me[6]||(me[6]=At("h3",{class:"text-accent-red font-semibold mb-2"},"Ping Failed",-1)),At("p",Cvt,yn(pe.error),1)])):pe.result?(Or(),Nr("div",Avt,[At("div",Mvt,[At("div",Evt,[me[7]||(me[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Round-Trip Time",-1)),At("span",{class:ja(["text-xs font-medium px-2 py-1 rounded-full",yt.value.color,"bg-current/10"])},yn(yt.value.label),3)]),At("div",Lvt,[At("span",Pvt,yn(pe.result.rtt_ms.toFixed(2)),1),me[8]||(me[8]=At("span",{class:"text-content-secondary dark:text-content-muted"},"ms",-1))])]),At("div",Ivt,[At("div",Dvt,[At("div",zvt,[me[9]||(me[9]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"RSSI",-1)),At("div",Ovt,[(Or(),Nr(Es,null,jl(5,we=>At("div",{key:we,class:ja(["w-1 h-3 rounded-sm",we<=St.value.bars?St.value.color:"bg-stroke-subtle dark:bg-stroke/10"])},null,2)),64))])]),At("div",Bvt,[At("span",Rvt,yn(pe.result.rssi),1),me[10]||(me[10]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"dBm",-1))])]),At("div",Fvt,[me[12]||(me[12]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"SNR",-1)),At("div",Nvt,[At("span",jvt,yn(pe.result.snr_db),1),me[11]||(me[11]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"dB",-1))])])]),At("div",Uvt,[me[15]||(me[15]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3"},"Network Path",-1)),At("div",$vt,[At("div",Hvt,[(Or(!0),Nr(Es,null,jl(pe.result.path,(we,Ce)=>(Or(),Nr("div",{key:Ce,class:"flex items-center gap-2 flex-shrink-0 relative"},[At("div",{class:ja(["bg-cyan-400/20 dark:bg-primary/20 text-cyan-600 dark:text-primary border border-cyan-400/40 dark:border-primary/30 px-3 py-1.5 rounded-lg text-sm font-mono transition-all duration-300",K.value&&Math.floor(Ut.value)===Ce?"ring-2 ring-cyan-400/50 dark:ring-primary/50 scale-105":""])},yn(we),3),Ce[K.value&&Ut.value>=Ce&&Ut.valueLr+Mr.before.length+Mr.lines.length+Mr.after.length,0);if(kr+=e.beforeBody.length+e.afterBody.length,ne&&(Ce+=ne*St.lineHeight+(ne-1)*t.titleSpacing+t.titleMarginBottom),kr){const Lr=t.displayColors?Math.max(ct,yt.lineHeight):yt.lineHeight;Ce+=me*Lr+(kr-me)*yt.lineHeight+(kr-1)*t.bodySpacing}pe&&(Ce+=t.footerMarginTop+pe*Ut.lineHeight+(pe-1)*t.footerSpacing);let It=0;const rn=function(Lr){Ve=Math.max(Ve,r.measureText(Lr).width+It)};return r.save(),r.font=St.string,cd(e.title,rn),r.font=yt.string,cd(e.beforeBody.concat(e.afterBody),rn),It=t.displayColors?K+2+t.boxPadding:0,cd(u,Lr=>{cd(Lr.before,rn),cd(Lr.lines,rn),cd(Lr.after,rn)}),It=0,r.font=Ut.string,cd(e.footer,rn),r.restore(),Ve+=we.width,{width:Ve,height:Ce}}function bft(e,t){const{y:r,height:u}=t;return re.height-u/2?"bottom":"center"}function wft(e,t,r,u){const{x:T,width:$}=u,K=r.caretSize+r.caretPadding;if(e==="left"&&T+$+K>t.width||e==="right"&&T-$-K<0)return!0}function kft(e,t,r,u){const{x:T,width:$}=r,{width:K,chartArea:{left:ct,right:yt}}=e;let St="center";return u==="center"?St=T<=(ct+yt)/2?"left":"right":T<=$/2?St="left":T>=K-$/2&&(St="right"),wft(St,e,t,r)&&(St="center"),St}function nF(e,t,r){const u=r.yAlign||t.yAlign||bft(e,r);return{xAlign:r.xAlign||t.xAlign||kft(e,t,r,u),yAlign:u}}function Tft(e,t){let{x:r,width:u}=e;return t==="right"?r-=u:t==="center"&&(r-=u/2),r}function Sft(e,t,r){let{y:u,height:T}=e;return t==="top"?u+=r:t==="bottom"?u-=T+r:u-=T/2,u}function iF(e,t,r,u){const{caretSize:T,caretPadding:$,cornerRadius:K}=e,{xAlign:ct,yAlign:yt}=r,St=T+$,{topLeft:Ut,topRight:ne,bottomLeft:pe,bottomRight:me}=D2(K);let we=Tft(t,ct);const Ce=Sft(t,yt,St);return yt==="center"?ct==="left"?we+=St:ct==="right"&&(we-=St):ct==="left"?we-=Math.max(Ut,pe)+T:ct==="right"&&(we+=Math.max(ne,me)+T),{x:j0(we,0,u.width-t.width),y:j0(Ce,0,u.height-t.height)}}function K6(e,t,r){const u=kg(r.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-u.right:e.x+u.left}function aF(e){return yv([],T1(e))}function Cft(e,t,r){return Gx(e,{tooltip:t,tooltipItems:r,type:"tooltip"})}function oF(e,t){const r=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return r?e.override(r):e}const gH={beforeTitle:v1,title(e){if(e.length>0){const t=e[0],r=t.chart.data.labels,u=r?r.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(u>0&&t.dataIndex"u"?gH[t].call(r,u):T}class sF extends G1{static positioners=l5;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const r=this.chart,u=this.options.setContext(this.getContext()),T=u.enabled&&r.options.animation&&u.animations,$=new V$(this.chart,T);return T._cacheable&&(this._cachedAnimations=Object.freeze($)),$}getContext(){return this.$context||(this.$context=Cft(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,r){const{callbacks:u}=r,T=xm(u,"beforeTitle",this,t),$=xm(u,"title",this,t),K=xm(u,"afterTitle",this,t);let ct=[];return ct=yv(ct,T1(T)),ct=yv(ct,T1($)),ct=yv(ct,T1(K)),ct}getBeforeBody(t,r){return aF(xm(r.callbacks,"beforeBody",this,t))}getBody(t,r){const{callbacks:u}=r,T=[];return cd(t,$=>{const K={before:[],lines:[],after:[]},ct=oF(u,$);yv(K.before,T1(xm(ct,"beforeLabel",this,$))),yv(K.lines,xm(ct,"label",this,$)),yv(K.after,T1(xm(ct,"afterLabel",this,$))),T.push(K)}),T}getAfterBody(t,r){return aF(xm(r.callbacks,"afterBody",this,t))}getFooter(t,r){const{callbacks:u}=r,T=xm(u,"beforeFooter",this,t),$=xm(u,"footer",this,t),K=xm(u,"afterFooter",this,t);let ct=[];return ct=yv(ct,T1(T)),ct=yv(ct,T1($)),ct=yv(ct,T1(K)),ct}_createItems(t){const r=this._active,u=this.chart.data,T=[],$=[],K=[];let ct=[],yt,St;for(yt=0,St=r.length;ytt.filter(Ut,ne,pe,u))),t.itemSort&&(ct=ct.sort((Ut,ne)=>t.itemSort(Ut,ne,u))),cd(ct,Ut=>{const ne=oF(t.callbacks,Ut);T.push(xm(ne,"labelColor",this,Ut)),$.push(xm(ne,"labelPointStyle",this,Ut)),K.push(xm(ne,"labelTextColor",this,Ut))}),this.labelColors=T,this.labelPointStyles=$,this.labelTextColors=K,this.dataPoints=ct,ct}update(t,r){const u=this.options.setContext(this.getContext()),T=this._active;let $,K=[];if(!T.length)this.opacity!==0&&($={opacity:0});else{const ct=l5[u.position].call(this,T,this._eventPosition);K=this._createItems(u),this.title=this.getTitle(K,u),this.beforeBody=this.getBeforeBody(K,u),this.body=this.getBody(K,u),this.afterBody=this.getAfterBody(K,u),this.footer=this.getFooter(K,u);const yt=this._size=rF(this,u),St=Object.assign({},ct,yt),Ut=nF(this.chart,u,St),ne=iF(u,St,Ut,this.chart);this.xAlign=Ut.xAlign,this.yAlign=Ut.yAlign,$={opacity:1,x:ne.x,y:ne.y,width:yt.width,height:yt.height,caretX:ct.x,caretY:ct.y}}this._tooltipItems=K,this.$context=void 0,$&&this._resolveAnimations().update(this,$),t&&u.external&&u.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(t,r,u,T){const $=this.getCaretPosition(t,u,T);r.lineTo($.x1,$.y1),r.lineTo($.x2,$.y2),r.lineTo($.x3,$.y3)}getCaretPosition(t,r,u){const{xAlign:T,yAlign:$}=this,{caretSize:K,cornerRadius:ct}=u,{topLeft:yt,topRight:St,bottomLeft:Ut,bottomRight:ne}=D2(ct),{x:pe,y:me}=t,{width:we,height:Ce}=r;let Ve,kr,It,rn,Lr,Mr;return $==="center"?(Lr=me+Ce/2,T==="left"?(Ve=pe,kr=Ve-K,rn=Lr+K,Mr=Lr-K):(Ve=pe+we,kr=Ve+K,rn=Lr-K,Mr=Lr+K),It=Ve):(T==="left"?kr=pe+Math.max(yt,Ut)+K:T==="right"?kr=pe+we-Math.max(St,ne)-K:kr=this.caretX,$==="top"?(rn=me,Lr=rn-K,Ve=kr-K,It=kr+K):(rn=me+Ce,Lr=rn+K,Ve=kr+K,It=kr-K),Mr=rn),{x1:Ve,x2:kr,x3:It,y1:rn,y2:Lr,y3:Mr}}drawTitle(t,r,u){const T=this.title,$=T.length;let K,ct,yt;if($){const St=z2(u.rtl,this.x,this.width);for(t.x=K6(this,u.titleAlign,u),r.textAlign=St.textAlign(u.titleAlign),r.textBaseline="middle",K=U0(u.titleFont),ct=u.titleSpacing,r.fillStyle=u.titleColor,r.font=K.string,yt=0;yt<$;++yt)r.fillText(T[yt],St.x(t.x),t.y+K.lineHeight/2),t.y+=K.lineHeight+ct,yt+1===$&&(t.y+=u.titleMarginBottom-ct)}}_drawColorBox(t,r,u,T,$){const K=this.labelColors[u],ct=this.labelPointStyles[u],{boxHeight:yt,boxWidth:St}=$,Ut=U0($.bodyFont),ne=K6(this,"left",$),pe=T.x(ne),me=ytIt!==0)?(t.beginPath(),t.fillStyle=$.multiKeyBackground,tS(t,{x:Ce,y:we,w:St,h:yt,radius:kr}),t.fill(),t.stroke(),t.fillStyle=K.backgroundColor,t.beginPath(),tS(t,{x:Ve,y:we+1,w:St-2,h:yt-2,radius:kr}),t.fill()):(t.fillStyle=$.multiKeyBackground,t.fillRect(Ce,we,St,yt),t.strokeRect(Ce,we,St,yt),t.fillStyle=K.backgroundColor,t.fillRect(Ve,we+1,St-2,yt-2))}t.fillStyle=this.labelTextColors[u]}drawBody(t,r,u){const{body:T}=this,{bodySpacing:$,bodyAlign:K,displayColors:ct,boxHeight:yt,boxWidth:St,boxPadding:Ut}=u,ne=U0(u.bodyFont);let pe=ne.lineHeight,me=0;const we=z2(u.rtl,this.x,this.width),Ce=function(Mn){r.fillText(Mn,we.x(t.x+me),t.y+pe/2),t.y+=pe+$},Ve=we.textAlign(K);let kr,It,rn,Lr,Mr,tn,Dn;for(r.textAlign=K,r.textBaseline="middle",r.font=ne.string,t.x=K6(this,Ve,u),r.fillStyle=u.bodyColor,cd(this.beforeBody,Ce),me=ct&&Ve!=="right"?K==="center"?St/2+Ut:St+2+Ut:0,Lr=0,tn=T.length;Lr0&&r.stroke()}_updateAnimationTarget(t){const r=this.chart,u=this.$animations,T=u&&u.x,$=u&&u.y;if(T||$){const K=l5[t.position].call(this,this._active,this._eventPosition);if(!K)return;const ct=this._size=rF(this,t),yt=Object.assign({},K,this._size),St=nF(r,t,yt),Ut=iF(t,yt,St,r);(T._to!==Ut.x||$._to!==Ut.y)&&(this.xAlign=St.xAlign,this.yAlign=St.yAlign,this.width=ct.width,this.height=ct.height,this.caretX=K.x,this.caretY=K.y,this._resolveAnimations().update(this,Ut))}}_willRender(){return!!this.opacity}draw(t){const r=this.options.setContext(this.getContext());let u=this.opacity;if(!u)return;this._updateAnimationTarget(r);const T={width:this.width,height:this.height},$={x:this.x,y:this.y};u=Math.abs(u)<.001?0:u;const K=kg(r.padding),ct=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&ct&&(t.save(),t.globalAlpha=u,this.drawBackground($,t,T,r),F$(t,r.textDirection),$.y+=K.top,this.drawTitle($,t,r),this.drawBody($,t,r),this.drawFooter($,t,r),N$(t,r.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,r){const u=this._active,T=t.map(({datasetIndex:ct,index:yt})=>{const St=this.chart.getDatasetMeta(ct);if(!St)throw new Error("Cannot find a dataset at index "+ct);return{datasetIndex:ct,element:St.data[yt],index:yt}}),$=!XT(u,T),K=this._positionChanged(T,r);($||K)&&(this._active=T,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,r,u=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const T=this.options,$=this._active||[],K=this._getActiveElements(t,$,r,u),ct=this._positionChanged(K,t),yt=r||!XT(K,$)||ct;return yt&&(this._active=K,(T.enabled||T.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,r))),yt}_getActiveElements(t,r,u,T){const $=this.options;if(t.type==="mouseout")return[];if(!T)return r.filter(ct=>this.chart.data.datasets[ct.datasetIndex]&&this.chart.getDatasetMeta(ct.datasetIndex).controller.getParsed(ct.index)!==void 0);const K=this.chart.getElementsAtEventForMode(t,$.mode,$,u);return $.reverse&&K.reverse(),K}_positionChanged(t,r){const{caretX:u,caretY:T,options:$}=this,K=l5[$.position].call(this,t,r);return K!==!1&&(u!==K.x||T!==K.y)}}var vH={id:"tooltip",_element:sF,positioners:l5,afterInit(e,t,r){r&&(e.tooltip=new sF({chart:e,options:r}))},beforeUpdate(e,t,r){e.tooltip&&e.tooltip.initialize(r)},reset(e,t,r){e.tooltip&&e.tooltip.initialize(r)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const r={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...r,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",r)}},afterEvent(e,t){if(e.tooltip){const r=t.replay;e.tooltip.handleEvent(t.event,r,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:gH},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Aft=(e,t,r,u)=>(typeof t=="string"?(r=e.push(t)-1,u.unshift({index:r,label:t})):isNaN(t)&&(r=null),r);function Mft(e,t,r,u){const T=e.indexOf(t);if(T===-1)return Aft(e,t,r,u);const $=e.lastIndexOf(t);return T!==$?r:T}const Eft=(e,t)=>e===null?null:j0(Math.round(e),0,t);function lF(e){const t=this.getLabels();return e>=0&&er.length-1?null:this.getPixelForValue(r[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Lft(e,t){const r=[],{bounds:T,step:$,min:K,max:ct,precision:yt,count:St,maxTicks:Ut,maxDigits:ne,includeBounds:pe}=e,me=$||1,we=Ut-1,{min:Ce,max:Ve}=t,kr=!Rh(K),It=!Rh(ct),rn=!Rh(St),Lr=(Ve-Ce)/(ne+1);let Mr=iR((Ve-Ce)/we/me)*me,tn,Dn,Mn,Br;if(Mr<1e-14&&!kr&&!It)return[{value:Ce},{value:Ve}];Br=Math.ceil(Ve/Mr)-Math.floor(Ce/Mr),Br>we&&(Mr=iR(Br*Mr/we/me)*me),Rh(yt)||(tn=Math.pow(10,yt),Mr=Math.ceil(Mr*tn)/tn),T==="ticks"?(Dn=Math.floor(Ce/Mr)*Mr,Mn=Math.ceil(Ve/Mr)*Mr):(Dn=Ce,Mn=Ve),kr&&It&&$&&Nct((ct-K)/$,Mr/1e3)?(Br=Math.round(Math.min((ct-K)/Mr,Ut)),Mr=(ct-K)/Br,Dn=K,Mn=ct):rn?(Dn=kr?K:Dn,Mn=It?ct:Mn,Br=St-1,Mr=(Mn-Dn)/Br):(Br=(Mn-Dn)/Mr,A5(Br,Math.round(Br),Mr/1e3)?Br=Math.round(Br):Br=Math.ceil(Br));const Vn=Math.max(aR(Mr),aR(Dn));tn=Math.pow(10,Rh(yt)?Vn:yt),Dn=Math.round(Dn*tn)/tn,Mn=Math.round(Mn*tn)/tn;let on=0;for(kr&&(pe&&Dn!==K?(r.push({value:K}),Dnct)break;r.push({value:pr})}return It&&pe&&Mn!==ct?r.length&&A5(r[r.length-1].value,ct,cF(ct,Lr,e))?r[r.length-1].value=ct:r.push({value:ct}):(!It||Mn===ct)&&r.push({value:Mn}),r}function cF(e,t,{horizontal:r,minRotation:u}){const T=z1(u),$=(r?Math.sin(T):Math.cos(T))||.001,K=.75*t*(""+e).length;return Math.min(t/$,K)}class Pft extends X2{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,r){return Rh(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:r,maxDefined:u}=this.getUserBounds();let{min:T,max:$}=this;const K=yt=>T=r?T:yt,ct=yt=>$=u?$:yt;if(t){const yt=Lv(T),St=Lv($);yt<0&&St<0?ct(0):yt>0&&St>0&&K(0)}if(T===$){let yt=$===0?1:Math.abs($*.05);ct($+yt),t||K(T-yt)}this.min=T,this.max=$}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:r,stepSize:u}=t,T;return u?(T=Math.ceil(this.max/u)-Math.floor(this.min/u)+1,T>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${u} would result generating up to ${T} ticks. Limiting to 1000.`),T=1e3)):(T=this.computeTickLimit(),r=r||11),r&&(T=Math.min(r,T)),T}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,r=t.ticks;let u=this.getTickLimit();u=Math.max(2,u);const T={maxTicks:u,bounds:t.bounds,min:t.min,max:t.max,precision:r.precision,step:r.stepSize,count:r.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:r.minRotation||0,includeBounds:r.includeBounds!==!1},$=this._range||this,K=Lft(T,$);return t.bounds==="ticks"&&jct(K,this,"value"),t.reverse?(K.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),K}configure(){const t=this.ticks;let r=this.min,u=this.max;if(super.configure(),this.options.offset&&t.length){const T=(u-r)/Math.max(t.length-1,1)/2;r-=T,u+=T}this._startValue=r,this._endValue=u,this._valueRange=u-r}getLabelForValue(t){return ZE(t,this.chart.options.locale,this.options.ticks.format)}}class oL extends Pft{static id="linear";static defaults={ticks:{callback:L$.formatters.numeric}};determineDataLimits(){const{min:t,max:r}=this.getMinMax(!0);this.min=$0(t)?t:0,this.max=$0(r)?r:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),r=t?this.width:this.height,u=z1(this.options.ticks.minRotation),T=(t?Math.sin(u):Math.cos(u))||.001,$=this._resolveTickFontOptions(0);return Math.ceil(r/Math.min(40,$.lineHeight/T))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const ZS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},km=Object.keys(ZS);function uF(e,t){return e-t}function hF(e,t){if(Rh(t))return null;const r=e._adapter,{parser:u,round:T,isoWeekday:$}=e._parseOpts;let K=t;return typeof u=="function"&&(K=u(K)),$0(K)||(K=typeof u=="string"?r.parse(K,u):r.parse(K)),K===null?null:(T&&(K=T==="week"&&(H2($)||$===!0)?r.startOf(K,"isoWeek",$):r.startOf(K,T)),+K)}function dF(e,t,r,u){const T=km.length;for(let $=km.indexOf(e);$=km.indexOf(r);$--){const K=km[$];if(ZS[K].common&&e._adapter.diff(T,u,K)>=t-1)return K}return km[r?km.indexOf(r):0]}function Dft(e){for(let t=km.indexOf(e)+1,r=km.length;t=t?r[u]:r[T];e[$]=!0}}function zft(e,t,r,u){const T=e._adapter,$=+T.startOf(t[0].value,u),K=t[t.length-1].value;let ct,yt;for(ct=$;ct<=K;ct=+T.add(ct,1,u))yt=r[ct],yt>=0&&(t[yt].major=!0);return t}function pF(e,t,r){const u=[],T={},$=t.length;let K,ct;for(K=0;K<$;++K)ct=t[K],T[ct]=K,u.push({value:ct,major:!1});return $===0||!r?u:zft(e,u,T,r)}class iS extends X2{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,r={}){const u=t.time||(t.time={}),T=this._adapter=new K$._date(t.adapters.date);T.init(r),C5(u.displayFormats,T.formats()),this._parseOpts={parser:u.parser,round:u.round,isoWeekday:u.isoWeekday},super.init(t),this._normalized=r.normalized}parse(t,r){return t===void 0?null:hF(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,r=this._adapter,u=t.time.unit||"day";let{min:T,max:$,minDefined:K,maxDefined:ct}=this.getUserBounds();function yt(St){!K&&!isNaN(St.min)&&(T=Math.min(T,St.min)),!ct&&!isNaN(St.max)&&($=Math.max($,St.max))}(!K||!ct)&&(yt(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&yt(this.getMinMax(!1))),T=$0(T)&&!isNaN(T)?T:+r.startOf(Date.now(),u),$=$0($)&&!isNaN($)?$:+r.endOf(Date.now(),u)+1,this.min=Math.min(T,$-1),this.max=Math.max(T+1,$)}_getLabelBounds(){const t=this.getLabelTimestamps();let r=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;return t.length&&(r=t[0],u=t[t.length-1]),{min:r,max:u}}buildTicks(){const t=this.options,r=t.time,u=t.ticks,T=u.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&T.length&&(this.min=this._userMin||T[0],this.max=this._userMax||T[T.length-1]);const $=this.min,K=this.max,ct=Wct(T,$,K);return this._unit=r.unit||(u.autoSkip?dF(r.minUnit,this.min,this.max,this._getLabelCapacity($)):Ift(this,ct.length,r.minUnit,this.min,this.max)),this._majorUnit=!u.major.enabled||this._unit==="year"?void 0:Dft(this._unit),this.initOffsets(T),t.reverse&&ct.reverse(),pF(this,ct,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let r=0,u=0,T,$;this.options.offset&&t.length&&(T=this.getDecimalForValue(t[0]),t.length===1?r=1-T:r=(this.getDecimalForValue(t[1])-T)/2,$=this.getDecimalForValue(t[t.length-1]),t.length===1?u=$:u=($-this.getDecimalForValue(t[t.length-2]))/2);const K=t.length<3?.5:.25;r=j0(r,0,K),u=j0(u,0,K),this._offsets={start:r,end:u,factor:1/(r+1+u)}}_generate(){const t=this._adapter,r=this.min,u=this.max,T=this.options,$=T.time,K=$.unit||dF($.minUnit,r,u,this._getLabelCapacity(r)),ct=_u(T.ticks.stepSize,1),yt=K==="week"?$.isoWeekday:!1,St=H2(yt)||yt===!0,Ut={};let ne=r,pe,me;if(St&&(ne=+t.startOf(ne,"isoWeek",yt)),ne=+t.startOf(ne,St?"day":K),t.diff(u,r,K)>1e5*ct)throw new Error(r+" and "+u+" are too far apart with stepSize of "+ct+" "+K);const we=T.ticks.source==="data"&&this.getDataTimestamps();for(pe=ne,me=0;pe+Ce)}getLabelForValue(t){const r=this._adapter,u=this.options.time;return u.tooltipFormat?r.format(t,u.tooltipFormat):r.format(t,u.displayFormats.datetime)}format(t,r){const T=this.options.time.displayFormats,$=this._unit,K=r||T[$];return this._adapter.format(t,K)}_tickFormatFunction(t,r,u,T){const $=this.options,K=$.ticks.callback;if(K)return Kd(K,[t,r,u],this);const ct=$.time.displayFormats,yt=this._unit,St=this._majorUnit,Ut=yt&&ct[yt],ne=St&&ct[St],pe=u[r],me=St&&ne&&pe&&pe.major;return this._adapter.format(t,T||(me?ne:Ut))}generateTickLabels(t){let r,u,T;for(r=0,u=t.length;r0?ct:1}getDataTimestamps(){let t=this._cache.data||[],r,u;if(t.length)return t;const T=this.getMatchingVisibleMetas();if(this._normalized&&T.length)return this._cache.data=T[0].controller.getAllParsedValues(this);for(r=0,u=T.length;r=e[u].pos&&t<=e[T].pos&&({lo:u,hi:T}=Mx(e,"pos",t)),{pos:$,time:ct}=e[u],{pos:K,time:yt}=e[T]):(t>=e[u].time&&t<=e[T].time&&({lo:u,hi:T}=Mx(e,"time",t)),{time:$,pos:ct}=e[u],{time:K,pos:yt}=e[T]);const St=K-$;return St?ct+(yt-ct)*(t-$)/St:ct}class PRt extends iS{static id="timeseries";static defaults=iS.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),r=this._table=this.buildLookupTable(t);this._minPos=Y6(r,this.min),this._tableRange=Y6(r,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:r,max:u}=this,T=[],$=[];let K,ct,yt,St,Ut;for(K=0,ct=t.length;K=r&&St<=u&&T.push(St);if(T.length<2)return[{time:r,pos:0},{time:u,pos:1}];for(K=0,ct=T.length;KT-$)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const r=this.getDataTimestamps(),u=this.getLabelTimestamps();return r.length&&u.length?t=this.normalize(r.concat(u)):t=r.length?r:u,t=this._cache.all=t,t}getDecimalForValue(t){return(Y6(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const r=this._offsets,u=this.getDecimalForPixel(t)/r.factor-r.end;return Y6(this._table,u*this._tableRange+this._minPos,!0)}}const Oft={class:"sparkline-card"},Bft={class:"card-header"},Rft={class:"card-title"},Fft={class:"card-chart"},Nft=Cc({name:"ChartSparkline",__name:"ChartSparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0}},setup(e){Av.register(aL,oL,nL,J2,eL,iL);const t=e,r=li(null),u=li(null),T=yt=>{if(yt.length<3)return yt;const St=Math.min(15,Math.max(3,Math.floor(yt.length*.2))),Ut=[];for(let we=0;wern+Lr,0)/It.length)}const ne=Math.min(12,Ut.length),pe=Ut.length/ne,me=[];for(let we=0;we!t.data||t.data.length===0?[]:T(t.data)),K=()=>{if(!r.value)return;const yt=r.value.getContext("2d");if(!yt)return;u.value&&(u.value.destroy(),u.value=null);const St=$.value;St.length<2||(u.value=j1(new Av(yt,{type:"line",data:{labels:St.map((Ut,ne)=>ne.toString()),datasets:[{data:St,borderColor:t.color,borderWidth:2.5,fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1},grace:"10%"}},elements:{line:{capBezierPoints:!0}}}})))},ct=()=>{if(!u.value){K();return}const yt=$.value;yt.length<2||(u.value.data.labels=yt.map((St,Ut)=>Ut.toString()),u.value.data.datasets[0].data=yt,u.value.update("default"))};return Fh(()=>t.data,()=>{sp(()=>ct())},{deep:!0}),Fh(()=>t.color,()=>{u.value&&(u.value.data.datasets[0].borderColor=t.color,u.value.update("none"))}),Xd(()=>{sp(()=>K())}),Tg(()=>{u.value&&(u.value.destroy(),u.value=null)}),(yt,St)=>(Or(),Nr("div",Oft,[At("div",Bft,[At("p",Rft,yn(yt.title),1),At("span",{class:"card-value",style:Sp({color:yt.color})},yn(typeof yt.value=="number"?yt.value.toLocaleString():yt.value),5)]),At("div",Fft,[yt.showChart?(Or(),Nr("canvas",{key:0,ref_key:"canvasRef",ref:r},null,512)):Ta("",!0)])]))}}),vh=(e,t)=>{const r=e.__vccOpts||e;for(const[u,T]of t)r[u]=T;return r},X6=vh(Nft,[["__scopeId","data-v-bcd5cf93"]]),u4=OS("packets",()=>{const e=li(null),t=li(null),r=li([]),u=li([]),T=li(null),$=li(!1),K=li(null),ct=li(null),yt=li([]),St=li([]),Ut=li(null),ne=li({rx:0,tx:0,drop:0}),pe=li({rx:0,tx:0,drop:0}),me=Ao(()=>e.value!==null),we=Ao(()=>t.value!==null),Ce=Ao(()=>r.value.length>0),Ve=Ao(()=>u.value.length>0),kr=Ao(()=>T.value?.avg_noise_floor??0),It=Ao(()=>e.value?.total_packets??0),rn=Ao(()=>e.value?.avg_rssi??0),Lr=Ao(()=>e.value?.avg_snr??0),Mr=Ao(()=>t.value?.uptime_seconds??0),tn=Ao(()=>{if(!e.value?.packet_types)return[];const qi=e.value.packet_types,Bi=qi.reduce((Xi,Yn)=>Xi+Yn.count,0);return qi.map(Xi=>({type:Xi.type.toString(),count:Xi.count,percentage:Bi>0?Xi.count/Bi*100:0}))}),Dn=Ao(()=>{const qi={};return r.value.forEach(Bi=>{qi[Bi.type]||(qi[Bi.type]=[]),qi[Bi.type].push(Bi)}),qi});async function Mn(){try{const qi=await bs.get("/stats");if(qi.success&&qi.data){t.value=qi.data;const Bi=new Date;return St.value.push({timestamp:Bi,stats:qi.data}),St.value.length>50&&(St.value=St.value.slice(-50)),qi.data}else if(qi&&"version"in qi){const Bi=qi;t.value=Bi;const Xi=new Date;return St.value.push({timestamp:Xi,stats:Bi}),St.value.length>50&&(St.value=St.value.slice(-50)),Bi}else throw new Error(qi.error||"Failed to fetch system stats")}catch(qi){throw K.value=qi instanceof Error?qi.message:"Unknown error occurred",console.error("Error fetching system stats:",qi),qi}}async function Br(qi={hours:24}){try{const Bi=await bs.get("/noise_floor_history",qi);if(Bi.success&&Bi.data&&Bi.data.history)return u.value=Bi.data.history,ct.value=new Date,Bi.data.history;throw new Error(Bi.error||"Failed to fetch noise floor history")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching noise floor history:",Bi),Bi}}async function Vn(qi={hours:24}){try{const Bi=await bs.get("/noise_floor_stats",qi);if(Bi.success&&Bi.data&&Bi.data.stats)return T.value=Bi.data.stats,ct.value=new Date,Bi.data.stats;throw new Error(Bi.error||"Failed to fetch noise floor stats")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching noise floor stats:",Bi),Bi}}const on=Ao(()=>!u.value||!Array.isArray(u.value)?[]:u.value.slice(-50).map(qi=>qi.noise_floor_dbm));async function pr(qi={hours:24}){try{$.value=!0,K.value=null;const Bi=await bs.get("/packet_stats",qi);if(Bi.success&&Bi.data){e.value=Bi.data;const Xi=new Date;yt.value.push({timestamp:Xi,stats:Bi.data}),yt.value.length>50&&(yt.value=yt.value.slice(-50)),ct.value=Xi}else throw new Error(Bi.error||"Failed to fetch packet stats")}catch(Bi){K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching packet stats:",Bi)}finally{$.value=!1}}async function _r(qi={limit:100}){try{$.value=!0,K.value=null;const Bi=await bs.get("/recent_packets",qi);if(Bi.success&&Bi.data)r.value=Bi.data,ct.value=new Date;else throw new Error(Bi.error||"Failed to fetch recent packets")}catch(Bi){K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching recent packets:",Bi)}finally{$.value=!1}}async function Sr(qi){try{$.value=!0,K.value=null;const Bi=await bs.get("/filtered_packets",qi);if(Bi.success&&Bi.data)return r.value=Bi.data,ct.value=new Date,Bi.data;throw new Error(Bi.error||"Failed to fetch filtered packets")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching filtered packets:",Bi),Bi}finally{$.value=!1}}async function Dr(qi){try{$.value=!0,K.value=null;const Bi=await bs.get("/packet_by_hash",{packet_hash:qi});if(Bi.success&&Bi.data)return Bi.data;throw new Error(Bi.error||"Packet not found")}catch(Bi){throw K.value=Bi instanceof Error?Bi.message:"Unknown error occurred",console.error("Error fetching packet by hash:",Bi),Bi}finally{$.value=!1}}const nn=Ao(()=>{if(!Ut.value?.series)return{totalPackets:[],transmittedPackets:[],droppedPackets:[],currentRates:ne.value};const qi=Ut.value.series.find(na=>na.type==="rx_count"),Bi=Ut.value.series.find(na=>na.type==="tx_count"),Xi=qi?.data||[],Yn=Bi?.data||[],hi=Xi.map((na,Xa)=>{const oo=Yn[Xa];return oo?Math.max(0,na[1]-oo[1]):na[1]});return{totalPackets:Xi.map(na=>na[1]),transmittedPackets:Yn.map(na=>na[1]),droppedPackets:hi,currentRates:ne.value}}),Cn=Ao(()=>{const qi=yt.value,Bi=St.value;return{totalPackets:qi.map(Xi=>Xi.stats.total_packets),transmittedPackets:qi.map(Xi=>Xi.stats.transmitted_packets),droppedPackets:qi.map(Xi=>Xi.stats.dropped_packets),avgRssi:qi.map(Xi=>Xi.stats.avg_rssi),uptimeHours:Bi.map(Xi=>Math.floor((Xi.stats.uptime_seconds||0)/3600))}});async function Xn(qi=3e4){await Promise.all([Mn(),pr(),_r(),Br({hours:1}),Vn({hours:1})]);const Bi=setInterval(async()=>{try{await Promise.all([Mn(),pr(),_r(),Br({hours:1}),Vn({hours:1})])}catch(Xi){console.error("Auto-refresh error:",Xi)}},qi);return()=>clearInterval(Bi)}async function _i(){try{const qi=await bs.get("/metrics_graph_data",{hours:24,resolution:"average",metrics:"rx_count,tx_count"});qi?.success&&qi.data&&(Ut.value=qi.data)}catch(qi){console.error("Failed to fetch sparkline data:",qi)}}async function ta(){await _i()}function va(){_i()}function _a(){e.value=null,t.value=null,r.value=[],u.value=[],T.value=null,yt.value=[],St.value=[],Ut.value=null,ne.value={rx:0,tx:0,drop:0},pe.value={rx:0,tx:0,drop:0},K.value=null,ct.value=null,$.value=!1}return{packetStats:e,systemStats:t,recentPackets:r,noiseFloorHistory:u,noiseFloorStats:T,packetStatsHistory:yt,systemStatsHistory:St,isLoading:$,error:K,lastUpdated:ct,hasPacketStats:me,hasSystemStats:we,hasRecentPackets:Ce,hasNoiseFloorData:Ve,currentNoiseFloor:kr,totalPackets:It,averageRSSI:rn,averageSNR:Lr,uptime:Mr,packetTypeBreakdown:tn,recentPacketsByType:Dn,sparklineData:nn,legacySparklineData:Cn,noiseFloorSparklineData:on,interpolatedRates:ne,fetchSystemStats:Mn,fetchPacketStats:pr,fetchRecentPackets:_r,fetchFilteredPackets:Sr,getPacketByHash:Dr,fetchNoiseFloorHistory:Br,fetchNoiseFloorStats:Vn,startAutoRefresh:Xn,initializeSparklineHistory:ta,interpolateRates:va,reset:_a}}),jft={class:"grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4 mb-5 stats-cards-container"},Uft=Cc({name:"StatsCards",__name:"StatsCards",setup(e){const t=u4(),r=li(null),u=li(null),T=li(!1),$=Ao(()=>{const yt=t.packetStats,St=t.systemStats,Ut=we=>{const Ce=Math.floor(we/86400),Ve=Math.floor(we%86400/3600),kr=Math.floor(we%3600/60);return Ce>0?`${Ce}d ${Ve}h`:Ve>0?`${Ve}h ${kr}m`:`${kr}m`},ne=yt?.total_packets||0,pe=yt?.dropped_packets||0,me=ne>0?Math.round(pe/ne*100):0;return{packetsReceived:ne,packetsForwarded:yt?.transmitted_packets||0,uptimeFormatted:St?Ut(St.uptime_seconds||0):"0m",uptimeHours:St?Math.floor((St.uptime_seconds||0)/3600):0,droppedPackets:pe,dropPercent:`${me}%`,signalQuality:Math.round((yt?.avg_rssi||0)+120)}}),K=Ao(()=>t.sparklineData),ct=async()=>{if(!T.value)try{T.value=!0,await Promise.all([t.fetchSystemStats(),t.fetchPacketStats({hours:24})]),await sp()}catch(yt){console.error("Error fetching stats:",yt)}finally{T.value=!1}};return Xd(async()=>{await t.initializeSparklineHistory(),ct(),r.value=window.setInterval(ct,3e4),u.value=window.setInterval(()=>{t.interpolateRates()},6e4)}),Tg(()=>{r.value&&clearInterval(r.value),u.value&&clearInterval(u.value)}),(yt,St)=>(Or(),Nr("div",jft,[Vs(X6,{title:"Up Time",value:$.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1,class:"stat-card"},null,8,["value"]),Vs(X6,{title:"RX Packets",value:$.value.packetsReceived,color:"#AAE8E8",data:K.value.totalPackets,class:"stat-card"},null,8,["value","data"]),Vs(X6,{title:"Forward",value:$.value.packetsForwarded,color:"#FFC246",data:K.value.transmittedPackets,class:"stat-card"},null,8,["value","data"]),Vs(X6,{title:"Dropped",value:$.value.droppedPackets,color:"#FB787B",data:K.value.droppedPackets,class:"stat-card"},null,8,["value","data"])]))}}),$ft=vh(Uft,[["__scopeId","data-v-38c473ee"]]),Hft={class:"glass-card rounded-[10px] p-4 lg:p-6"},Vft={class:"h-48 lg:h-56 relative"},Wft={key:0,class:"absolute inset-0 flex items-center justify-center"},qft={key:1,class:"absolute inset-0 flex items-center justify-center"},Gft={class:"text-red-600 dark:text-red-400 text-sm lg:text-base"},Zft={key:2,class:"absolute inset-0 flex items-center justify-center"},Kft={key:3,class:"h-full flex flex-col"},Yft={key:0,class:"absolute top-2 left-1/2 -translate-x-1/2 bg-white/95 dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke rounded-lg px-3 py-2 z-10 pointer-events-none min-w-48"},Xft={class:"text-content-primary dark:text-content-primary text-sm font-medium mb-1"},Jft={class:"text-content-primary dark:text-content-primary"},Qft={class:"flex-1 flex items-end justify-evenly gap-4 px-4"},tpt=["onMouseenter"],ept={class:"text-content-primary dark:text-content-primary text-xs sm:text-sm font-semibold text-center w-full",style:{"padding-bottom":"5px"}},rpt={class:"text-content-secondary dark:text-content-muted text-xs mt-2 text-center"},npt={key:0,class:"mt-4 flex flex-wrap justify-center gap-3 sm:gap-4 px-2 sm:px-4 text-[10px] sm:text-xs text-content-secondary dark:text-content-muted"},ipt={class:"truncate text-left"},apt={key:1,class:"mt-3 text-xs text-content-secondary dark:text-content-muted text-center"},opt=Cc({name:"PacketTypesChart",__name:"PacketTypesChart",setup(e){const t=li([]),r=li(null),u=li(!0),T=li(null),$=li(null),K=[{name:"Payload",types:["Plain Text Message","Group Text Message","Group Datagram","Multi-part Packet"],subColors:["#3B82F6","#60A5FA","#93C5FD","#BFDBFE"]},{name:"Requests",types:["Request","Response","Anonymous Request"],subColors:["#10B981","#34D399","#6EE7B7"]},{name:"Control",types:["Node Advertisement","Acknowledgment","Returned Path"],subColors:["#F59E0B","#FBBF24","#FCD34D"]},{name:"Routing",types:["Trace"],subColors:["#8B5CF6"]},{name:"Reserved",types:["Reserved Type 11","Reserved Type 12","Reserved Type 13"],subColors:["#6B7280","#9CA3AF","#D1D5DB"]}],ct=Ao(()=>K.map(me=>{const we=t.value.filter(Ce=>me.types.some(Ve=>Ce.name.includes(Ve)||Ce.name===Ve)).sort((Ce,Ve)=>Ve.count-Ce.count).map((Ce,Ve)=>({...Ce,color:me.subColors[Ve%me.subColors.length]}));return{name:me.name,color:me.subColors[0],items:we,total:we.reduce((Ce,Ve)=>Ce+Ve.count,0)}}).filter(me=>me.total>0)),yt=Ao(()=>Math.max(...ct.value.map(me=>me.total),1)),St=Ao(()=>ct.value.reduce((me,we)=>me+we.total,0)),Ut=async()=>{try{T.value=null;const me=await bs.get("/packet_type_graph_data");if(me?.success&&me?.data){const we=me.data;if(we?.series){const Ce=[];we.series.forEach((Ve,kr)=>{let It=0;Ve.data&&Array.isArray(Ve.data)&&(It=Ve.data.reduce((rn,Lr)=>rn+(Lr[1]||0),0)),It>0&&Ce.push({name:Ve.name||`Type ${Ve.type}`,type:Ve.type,count:It,color:""})}),t.value=Ce,u.value=!1}else T.value="No series data in server response",u.value=!1}else T.value="Invalid response from server",u.value=!1}catch(me){T.value=me instanceof Error?me.message:"Failed to load data",u.value=!1}},ne=me=>Math.max(me/yt.value*90,2),pe=(me,we)=>we===0?0:me/we*100;return Xd(()=>{Ut(),r.value=setInterval(()=>{Ut()},3e4)}),Tg(()=>{r.value&&clearInterval(r.value)}),(me,we)=>(Or(),Nr("div",Hft,[we[3]||(we[3]=At("div",{class:"flex items-baseline justify-between mb-3 lg:mb-4"},[At("h3",{class:"text-content-primary dark:text-content-primary text-lg lg:text-xl font-semibold"},"Packet Types"),At("p",{class:"text-content-secondary dark:text-content-muted text-xs lg:text-sm uppercase"},"Distribution by Type")],-1)),At("div",Vft,[u.value?(Or(),Nr("div",Wft,we[1]||(we[1]=[At("div",{class:"text-content-secondary dark:text-content-primary text-sm lg:text-base"},"Loading packet types...",-1)]))):T.value?(Or(),Nr("div",qft,[At("div",Gft,yn(T.value),1)])):ct.value.length===0?(Or(),Nr("div",Zft,we[2]||(we[2]=[At("div",{class:"text-content-secondary dark:text-content-primary text-sm lg:text-base"},"No packet data available",-1)]))):(Or(),Nr("div",Kft,[$.value?(Or(),Nr("div",Yft,[At("div",Xft,yn($.value.name)+" · "+yn($.value.total.toLocaleString()),1),(Or(!0),Nr(Es,null,jl($.value.items,Ce=>(Or(),Nr("div",{key:Ce.type,class:"flex justify-between gap-4 text-xs text-content-secondary dark:text-content-muted"},[At("span",null,yn(Ce.name),1),At("span",Jft,yn(Ce.count.toLocaleString()),1)]))),128))])):Ta("",!0),At("div",Qft,[(Or(!0),Nr(Es,null,jl(ct.value,Ce=>(Or(),Nr("div",{key:Ce.name,class:"flex flex-col items-center flex-1 max-w-32 h-full justify-end cursor-pointer",onMouseenter:Ve=>$.value=Ce,onMouseleave:we[0]||(we[0]=Ve=>$.value=null)},[At("span",ept,yn(Ce.total.toLocaleString()),1),At("div",{class:"w-full rounded-[5px] transition-all duration-300 ease-out hover:opacity-90 overflow-hidden flex flex-col-reverse",style:Sp({height:ne(Ce.total)+"%",minHeight:"8px"})},[(Or(!0),Nr(Es,null,jl(Ce.items,Ve=>(Or(),Nr("div",{key:Ve.type,style:Sp({height:pe(Ve.count,Ce.total)+"%",backgroundColor:Ve.color})},null,4))),128))],4),At("span",rpt,yn(Ce.name),1)],40,tpt))),128))])]))]),ct.value.length>0?(Or(),Nr("div",npt,[(Or(!0),Nr(Es,null,jl(ct.value,Ce=>(Or(),Nr("div",{key:"legend-"+Ce.name,class:"flex flex-col gap-0.5 min-w-[100px] max-w-[140px] flex-shrink-0"},[(Or(!0),Nr(Es,null,jl(Ce.items,Ve=>(Or(),Nr("div",{key:Ve.type,class:"flex items-center gap-1.5"},[At("span",{class:"w-2 h-2 rounded-sm shrink-0",style:Sp({backgroundColor:Ve.color})},null,4),At("span",ipt,yn(Ve.name),1)]))),128))]))),128))])):Ta("",!0),ct.value.length>0?(Or(),Nr("div",apt," Total: "+yn(St.value.toLocaleString())+" packets ",1)):Ta("",!0)]))}}),spt=vh(opt,[["__scopeId","data-v-3ad21abb"]]),lpt={class:"glass-card rounded-[10px] p-4 lg:p-6"},cpt={class:"relative h-40 lg:h-48"},upt={class:"mt-3 lg:mt-4 grid grid-cols-2 gap-3 lg:gap-4"},hpt={class:"text-center"},dpt={class:"text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary"},fpt={class:"text-center"},ppt={class:"text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary"},mpt={class:"mt-2 lg:mt-3 grid grid-cols-3 gap-2 lg:gap-3 text-center"},gpt={class:"text-xs lg:text-sm font-semibold text-accent-purple flex items-center justify-center gap-1"},vpt={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},ypt={class:"text-xs text-content-secondary dark:text-content-muted"},_pt={class:"text-xs lg:text-sm font-semibold text-accent-red flex items-center justify-center gap-1"},xpt={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},bpt={class:"text-xs text-content-secondary dark:text-content-muted"},wpt={class:"text-xs lg:text-sm font-semibold text-white"},kpt=Cc({name:"AirtimeUtilizationChart",__name:"AirtimeUtilizationChart",setup(e){const t=u4(),r=Ym(),u=li(null),T=li([]),$=li(!0),K=li(null),ct=li(30),yt=li({totalReceived:0,totalTransmitted:0,dropped:0,firstPacketTime:0}),St=li({sf:9,bwHz:62500,cr:5,preamble:17}),Ut=Ce=>{const{sf:Ve,bwHz:kr,cr:It,preamble:rn}=St.value,Lr=1,Mr=0,tn=Ve>=11&&kr<=125e3?1:0,Dn=kr/1e3,Mn=Math.pow(2,Ve)/Dn,Br=(rn+4.25)*Mn,Vn=Math.max(8*Ce-4*Ve+28+16*Lr-20*Mr,0),on=4*(Ve-2*tn),_r=(8+Math.ceil(Vn/on)*It)*Mn;return Br+_r},ne=(Ce,Ve=60)=>{if(Ce.length===0)return[];const kr=1-Math.pow(.5,1/Ve),It=Math.min(Ce.length,Math.max(10,Math.floor(Ve/3)));let rn=0,Lr=0;for(let Mr=0;Mr(rn=kr*Mr.rxUtil+(1-kr)*rn,Lr=kr*Mr.txUtil+(1-kr)*Lr,{...Mr,rxUtil:rn,txUtil:Lr}))},pe=Ao(()=>{const Ce=t.packetStats?.total_packets||0,Ve=t.packetStats?.transmitted_packets||0,kr=r.stats?.uptime_seconds||0,It=Ce||yt.value.totalReceived,rn=Ve||yt.value.totalTransmitted,Lr=yt.value.firstPacketTime>0?Math.floor(Date.now()/1e3)-yt.value.firstPacketTime:0,Mr=kr||Lr,tn=Math.max(Mr/3600,.1);if(tn<1){const pr=Math.max(Mr/60,1);return{rxRate:{value:Math.round(It/pr*100)/100,label:tn<.5?"RX/min (early)":"RX/min"},txRate:{value:Math.round(rn/pr*100)/100,label:tn<.5?"TX/min (early)":"TX/min"},confidence:"low"}}const Mn=Math.round(It/tn*100)/100,Br=Math.round(rn/tn*100)/100;let Vn,on;return tn<6?(Vn=`RX/hr (${Math.round(tn)}h)`,on="medium"):tn<24?(Vn=`RX/hr (${Math.round(tn)}h)`,on="high"):(Vn="RX/hr",on="high"),{rxRate:{value:Mn,label:Vn},txRate:{value:Br,label:Vn.replace("RX","TX")},confidence:on}}),me=async()=>{$.value=!0;try{const rn=Math.floor(Date.now()/1e3),Lr=rn-24*3600;let Mr=0;try{const _i=await bs.get("/stats");if(_i.success&&_i.data){const ta=_i.data,va=ta.config;if(va?.radio){const _a=va.radio;St.value={sf:_a.spreading_factor??9,bwHz:_a.bandwidth??62500,cr:_a.coding_rate??5,preamble:_a.preamble_length??17}}Mr=ta.dropped_count??0}}catch{}const tn=await bs.get("/filtered_packets",{start_timestamp:Lr,end_timestamp:rn,limit:5e4});if(!tn.success){T.value=[],$.value=!1,sp(()=>we());return}const Dn=tn.data||[],Mn=new Float64Array(8640),Br=new Float64Array(8640);let Vn=0,on=0,pr=1/0;for(const _i of Dn){const ta=Math.floor((_i.timestamp-Lr)/10);if(ta<0||ta>=8640)continue;const va=_i.length??_i.payload_length??32,_a=Ut(va),qi=_i.packet_origin;_i.timestamp[_i.rxUtil,_i.txUtil]))*1.05;ct.value=Math.max(5,Math.ceil(Xn/5)*5),$.value=!1,sp(()=>we())}catch(Ce){console.error("Failed to fetch airtime data:",Ce),T.value=[],$.value=!1,sp(()=>we())}},we=()=>{if(!u.value)return;const Ce=u.value,Ve=Ce.getContext("2d");if(!Ve)return;const kr=Ce.parentElement;if(!kr)return;const It=kr.getBoundingClientRect(),rn=It.width,Lr=It.height;Ce.width=rn*window.devicePixelRatio,Ce.height=Lr*window.devicePixelRatio,Ce.style.width=rn+"px",Ce.style.height=Lr+"px",Ve.scale(window.devicePixelRatio,window.devicePixelRatio);const Mr=20,tn=45;if(Ve.clearRect(0,0,rn,Lr),$.value){Ve.fillStyle="#666",Ve.font="16px system-ui",Ve.textAlign="center",Ve.fillText("Loading chart data...",rn/2,Lr/2);return}if(T.value.length===0){Ve.fillStyle="#666",Ve.font="16px system-ui",Ve.textAlign="center",Ve.fillText("No data available",rn/2,Lr/2);return}const Dn=rn-tn-Mr,Mn=Lr-Mr*2,Br=ct.value,Vn=ct.value;Ve.strokeStyle="rgba(255, 255, 255, 0.1)",Ve.lineWidth=1,Ve.font="10px system-ui",Ve.textAlign="right";for(let on=0;on<=5;on++){const pr=Mr+Mn*on/5;Ve.beginPath(),Ve.moveTo(tn,pr),Ve.lineTo(rn-Mr,pr),Ve.stroke();const _r=Br-on/5*Vn;Ve.fillStyle="rgba(255, 255, 255, 0.5)",Ve.fillText(`${_r.toFixed(0)}%`,tn-5,pr+3)}for(let on=0;on<=6;on++){const pr=tn+Dn*on/6;Ve.beginPath(),Ve.moveTo(pr,Mr),Ve.lineTo(pr,Lr-Mr),Ve.stroke()}T.value.length>1&&(Ve.strokeStyle="#EBA0FC",Ve.lineWidth=2,Ve.beginPath(),T.value.forEach((on,pr)=>{const _r=tn+Dn*pr/(T.value.length-1),Sr=Lr-Mr-Math.min(on.rxUtil,ct.value)/Vn*Mn;pr===0?Ve.moveTo(_r,Sr):Ve.lineTo(_r,Sr)}),Ve.stroke()),T.value.length>1&&(Ve.strokeStyle="#FB787B",Ve.lineWidth=2,Ve.beginPath(),T.value.forEach((on,pr)=>{const _r=tn+Dn*pr/(T.value.length-1),Sr=Lr-Mr-Math.min(on.txUtil,ct.value)/Vn*Mn;pr===0?Ve.moveTo(_r,Sr):Ve.lineTo(_r,Sr)}),Ve.stroke())};return Xd(()=>{me(),K.value=window.setInterval(me,3e4),sp(()=>{we(),setTimeout(()=>we(),100)}),window.addEventListener("resize",we)}),Tg(()=>{K.value&&clearInterval(K.value),window.removeEventListener("resize",we)}),(Ce,Ve)=>(Or(),Nr("div",lpt,[Ve[3]||(Ve[3]=Du('

Airtime Utilization

Activity (Last 24 Hours)

Rx Util
Tx Util
',3)),At("div",cpt,[At("canvas",{ref_key:"chartRef",ref:u,class:"absolute inset-0 w-full h-full"},null,512)]),At("div",upt,[At("div",hpt,[At("div",dpt,yn(Lo(t).packetStats?.total_packets||yt.value.totalReceived),1),Ve[0]||(Ve[0]=At("div",{class:"text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Total Received",-1))]),At("div",fpt,[At("div",ppt,yn(Lo(t).packetStats?.transmitted_packets||yt.value.totalTransmitted),1),Ve[1]||(Ve[1]=At("div",{class:"text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Total Transmitted",-1))])]),At("div",mpt,[At("div",null,[At("div",gpt,[cl(yn(pe.value.rxRate.value)+" ",1),pe.value.confidence==="low"?(Or(),Nr("span",vpt)):Ta("",!0)]),At("div",ypt,yn(pe.value.rxRate.label),1)]),At("div",null,[At("div",_pt,[cl(yn(pe.value.txRate.value)+" ",1),pe.value.confidence==="low"?(Or(),Nr("span",xpt)):Ta("",!0)]),At("div",bpt,yn(pe.value.txRate.label),1)]),At("div",null,[At("div",wpt,yn(Lo(t).packetStats?.dropped_packets||yt.value.dropped),1),Ve[2]||(Ve[2]=At("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),Tpt=vh(kpt,[["__scopeId","data-v-0aca4e12"]]),Spt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] shadow-2xl border border-stroke-subtle dark:border-white/20 flex flex-col h-full overflow-hidden"},Cpt={class:"flex items-center justify-between p-8 pb-4 flex-shrink-0"},Apt={class:"text-content-secondary dark:text-content-muted text-sm"},Mpt={class:"flex items-center gap-2"},Ept=["title"],Lpt={class:"flex-1 overflow-y-auto custom-scrollbar px-8"},Ppt={class:"mb-6"},Ipt={class:"glass-card bg-white/5 rounded-[15px] p-4"},Dpt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},zpt={class:"space-y-3"},Opt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Bpt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Rpt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Fpt={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all"},Npt={key:0,class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},jpt={class:"text-content-primary dark:text-content-primary font-mono text-xs"},Upt={class:"space-y-3"},$pt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Hpt={class:"text-content-primary dark:text-content-primary font-semibold"},Vpt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Wpt={class:"text-content-primary dark:text-content-primary font-semibold"},qpt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Gpt={class:"mb-6"},Zpt={class:"bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10"},Kpt={class:"space-y-3"},Ypt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Xpt={class:"text-content-primary dark:text-content-primary"},Jpt={key:0,class:"pt-2"},Qpt={class:"glass-card bg-background-mute dark:bg-black/30 rounded-[10px] p-4 mb-4"},t0t={class:"w-full overflow-x-auto"},e0t={class:"text-content-primary dark:text-content-primary/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},r0t={class:"flex items-center justify-between mb-3"},n0t={class:"text-content-secondary dark:text-content-primary/80 text-sm font-semibold"},i0t={class:"text-content-muted dark:text-content-muted text-xs"},a0t={class:"bg-background-mute dark:bg-black/40 rounded-[8px] p-3 mb-3"},o0t={class:"font-mono text-xs text-content-primary dark:text-content-primary break-all whitespace-pre-wrap leading-relaxed"},s0t={class:"bg-gray-50 dark:bg-white/5 rounded-[10px] overflow-hidden"},l0t={key:0,class:"min-w-0"},c0t={class:"text-cyan-500 text-sm font-mono break-words min-w-0"},u0t={class:"text-content-primary dark:text-content-primary text-sm break-words min-w-0"},h0t={class:"text-content-primary dark:text-content-primary text-sm font-semibold break-all min-w-0 overflow-hidden"},d0t=["title"],f0t={key:0,class:"text-orange-500 text-xs font-mono break-all min-w-0 overflow-hidden"},p0t=["title"],m0t={class:"grid grid-cols-2 gap-2"},g0t={class:"text-cyan-500 text-sm font-mono break-words"},v0t={class:"text-content-primary dark:text-content-primary text-sm break-words"},y0t=["title"],_0t={key:0},x0t=["title"],b0t={key:0,class:"text-content-muted dark:text-content-muted text-xs italic mt-2 px-1"},w0t={key:1,class:"py-2"},k0t={class:"mb-6"},T0t={class:"bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10"},S0t={class:"space-y-4"},C0t={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},A0t={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},M0t={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},E0t={key:0,class:"py-2"},L0t={class:"bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},P0t={class:"flex items-center flex-wrap gap-2"},I0t={class:"relative group"},D0t={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},z0t={class:"font-mono text-xs font-semibold text-content-primary dark:text-content-primary/90"},O0t={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-content-primary dark:bg-background/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},B0t={key:0,class:"mx-2 text-cyan-600 dark:text-cyan-400/60"},R0t={key:1,class:"py-2"},F0t={class:"text-content-secondary dark:text-content-muted text-sm mb-2 flex items-center"},N0t={key:0,class:"w-4 h-4 ml-2 text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},j0t={key:1,class:"text-yellow-500 text-xs ml-1"},U0t={class:"bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},$0t={class:"flex items-center flex-wrap gap-2"},H0t={class:"relative group"},V0t={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},W0t={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},q0t={key:0,class:"mx-1 text-orange-600 dark:text-orange-400/60"},G0t={class:"mb-6"},Z0t={class:"glass-card bg-gray-50 dark:bg-white/5 rounded-[15px] p-4"},K0t={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},Y0t={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},X0t={class:"text-lg font-bold text-content-primary dark:text-content-primary"},J0t={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},Q0t={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},tmt={class:"text-lg font-bold text-content-primary dark:text-content-primary"},emt={key:0,class:"mb-4"},rmt={class:"flex items-center gap-3"},nmt={class:"flex gap-1"},imt={class:"text-content-secondary dark:text-content-primary/80 text-sm capitalize"},amt={key:1,class:"mb-4"},omt={key:2,class:"mb-4"},smt={class:"text-content-secondary dark:text-content-muted text-sm mb-3"},lmt={class:"space-y-2"},cmt={class:"flex items-center gap-3"},umt={class:"text-content-muted dark:text-content-muted text-sm"},hmt={key:3,class:"mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke/10"},dmt={class:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4"},fmt={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},pmt={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},mmt={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},gmt={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},vmt={class:"text-content-muted dark:text-content-muted text-xs mt-1"},ymt={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},_mt={class:"text-content-muted dark:text-content-muted text-xs mt-1"},xmt={key:0,class:"glass-card bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},bmt={class:"space-y-3"},wmt={class:"flex-shrink-0 w-16 text-right"},kmt={class:"text-content-secondary dark:text-content-muted text-xs"},Tmt={class:"flex-1 relative"},Smt={class:"h-8 rounded-lg overflow-hidden bg-background-mute dark:bg-stroke/5 relative"},Cmt={class:"absolute inset-0 flex items-center px-3"},Amt={class:"text-content-primary dark:text-content-primary text-xs font-mono font-semibold"},Mmt={class:"flex-shrink-0 w-12 text-left"},Emt={class:"text-content-muted dark:text-content-muted text-xs"},Lmt={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Pmt={class:"space-y-2"},Imt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Dmt={class:"text-content-primary dark:text-content-primary"},zmt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Omt={class:"space-y-2"},Bmt={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Rmt={key:0,class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Fmt={class:"text-red-600 dark:text-red-400 text-sm"},Nmt={class:"p-8 pt-4 border-t border-stroke-subtle dark:border-stroke/10 flex justify-end flex-shrink-0"},jmt=Cc({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(e,{emit:t}){const r=e,u=t,T=li(!1),$=Mr=>new Date(Mr*1e3).toLocaleString(),K=Mr=>Mr.transmitted?Mr.is_duplicate?"text-amber-600 dark:text-amber-400":Mr.drop_reason?"text-red-600 dark:text-red-400":"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",ct=Mr=>Mr.transmitted?Mr.is_duplicate?"Duplicate":Mr.drop_reason?"Dropped":"Forwarded":"Dropped",yt=Mr=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[Mr]||`Unknown Type (${Mr})`,St=Mr=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[Mr]||`Unknown Route (${Mr})`,Ut=Mr=>{if(!Mr)return"None";const Dn=Mr.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],Mn=[];for(let Br=0;Br{try{let Mn=0;const Br=tn.length/2;if(Br>=100){if(tn.length>=Mn+64){const Vn=tn.slice(Mn,Mn+64);Mr.push({name:"Public Key",byteRange:`${(Dn+Mn)/2}-${(Dn+Mn+63)/2}`,hexData:Vn.match(/.{8}/g)?.join(" ")||Vn,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${Vn.slice(0,16)}...${Vn.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),Mn+=64}if(tn.length>=Mn+8){const Vn=tn.slice(Mn,Mn+8),on=parseInt(Vn,16),pr=new Date(on*1e3);Mr.push({name:"Timestamp",byteRange:`${(Dn+Mn)/2}-${(Dn+Mn+7)/2}`,hexData:Vn.match(/.{2}/g)?.join(" ")||Vn,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${on} (${pr.toLocaleString()})`,binary:on.toString(2).padStart(32,"0")}]}),Mn+=8}if(tn.length>=Mn+128){const Vn=tn.slice(Mn,Mn+128);Mr.push({name:"Signature",byteRange:`${(Dn+Mn)/2}-${(Dn+Mn+127)/2}`,hexData:Vn.match(/.{8}/g)?.join(" ")||Vn,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${Vn.slice(0,16)}...${Vn.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),Mn+=128}if(tn.length>Mn){const Vn=tn.slice(Mn);pe(Mr,Vn,Dn+Mn)}}else Mr.push({name:"ADVERT AppData (Partial)",byteRange:`${Dn/2}-${Dn/2+Br-1}`,hexData:tn.match(/.{2}/g)?.join(" ")||tn,description:`Partial ADVERT data - appears to be just AppData portion (${Br} bytes)`,fields:[{bits:`0-${Br*8-1}`,name:"Partial Data",value:`${Br} bytes - attempting to decode as AppData`,binary:`${Br} bytes (${Br*8} bits)`}]}),pe(Mr,tn,Dn)}catch(Mn){Mr.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:tn.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${Mn instanceof Error?Mn.message:"Unknown error"}`,binary:"Invalid"}]})}},pe=(Mr,tn,Dn)=>{try{const Mn=tn.length/2;Mr.push({name:"AppData",byteRange:`${Dn/2}-${Dn/2+Mn-1}`,hexData:tn.match(/.{2}/g)?.join(" ")||tn,description:`Node advertisement application data (${Mn} bytes)`,fields:[{bits:`0-${Mn*8-1}`,name:"Application Data",value:`${Mn} bytes (contains flags, location, name, etc.)`,binary:`${Mn} bytes (${Mn*8} bits)`}]});let Br=0;if(tn.length>=2){const Vn=parseInt(tn.slice(Br,Br+2),16),on=[],pr=!!(Vn&16),_r=!!(Vn&32),Sr=!!(Vn&64),Dr=!!(Vn&128);if(Vn&1&&on.push("is chat node"),Vn&2&&on.push("is repeater"),Vn&4&&on.push("is room server"),Vn&8&&on.push("is sensor"),pr&&on.push("has location"),_r&&on.push("has feature 1"),Sr&&on.push("has feature 2"),Dr&&on.push("has name"),Mr.push({name:"AppData Flags",byteRange:`${(Dn+Br)/2}`,hexData:`0x${tn.slice(Br,Br+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:on.join(", ")||"none",binary:Vn.toString(2).padStart(8,"0")}]}),Br+=2,pr&&tn.length>=Br+16){const nn=tn.slice(Br,Br+8),Cn=[];for(let Yn=6;Yn>=0;Yn-=2)Cn.push(nn.slice(Yn,Yn+2));const Xn=parseInt(Cn.join(""),16),_i=Xn>2147483647?Xn-4294967296:Xn,ta=_i/1e6,va=tn.slice(Br+8,Br+16),_a=[];for(let Yn=6;Yn>=0;Yn-=2)_a.push(va.slice(Yn,Yn+2));const qi=parseInt(_a.join(""),16),Bi=qi>2147483647?qi-4294967296:qi,Xi=Bi/1e6;Mr.push({name:"Location Data",byteRange:`${(Dn+Br)/2}-${(Dn+Br+15)/2}`,hexData:`${nn.match(/.{2}/g)?.join(" ")||nn} ${va.match(/.{2}/g)?.join(" ")||va}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${ta.toFixed(6)}° (raw: ${_i})`,binary:_i.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${Xi.toFixed(6)}° (raw: ${Bi})`,binary:Bi.toString(2).padStart(32,"0")}]}),Br+=16}if(_r&&tn.length>=Br+4){const nn=tn.slice(Br,Br+4),Cn=parseInt(nn,16);Mr.push({name:"Feature 1",byteRange:`${(Dn+Br)/2}-${(Dn+Br+3)/2}`,hexData:nn.match(/.{2}/g)?.join(" ")||nn,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${Cn}`,binary:Cn.toString(2).padStart(16,"0")}]}),Br+=4}if(Sr&&tn.length>=Br+4){const nn=tn.slice(Br,Br+4),Cn=parseInt(nn,16);Mr.push({name:"Feature 2",byteRange:`${(Dn+Br)/2}-${(Dn+Br+3)/2}`,hexData:nn.match(/.{2}/g)?.join(" ")||nn,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${Cn}`,binary:Cn.toString(2).padStart(16,"0")}]}),Br+=4}if(Dr&&tn.length>Br){const nn=tn.slice(Br),Cn=nn.match(/.{2}/g)||[],Xn=Cn.map(_i=>{const ta=parseInt(_i,16);return ta>=32&&ta<=126?String.fromCharCode(ta):"."}).join("").replace(/\.+$/,"");Mr.push({name:"Node Name",byteRange:`${(Dn+Br)/2}-${(Dn+tn.length-1)/2}`,hexData:nn.match(/.{2}/g)?.join(" ")||nn,description:`Node name string (${Cn.length} bytes)`,fields:[{bits:`0-${Cn.length*8-1}`,name:"Node Name",value:`"${Xn}"`,binary:`ASCII text (${Cn.length} bytes)`}]})}}}catch(Mn){Mr.push({name:"AppData Parse Error",byteRange:"N/A",hexData:tn.slice(0,Math.min(32,tn.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${Mn instanceof Error?Mn.message:"Unknown error"}`,binary:"Invalid"}]})}},me=Mr=>{if(!Mr)return[];if(Array.isArray(Mr))return Mr;if(typeof Mr=="string")try{return JSON.parse(Mr)}catch{return[]}return[]},we=Mr=>{const tn=[];if(!Mr)return tn;try{const Dn=Mr.raw_packet;if(Dn){const Mn=Dn.replace(/\s+/g,"").toUpperCase();let Br=0;if(Mn.length>=2){const Vn=Mn.slice(Br,Br+2),on=parseInt(Vn,16),pr=on&3,_r=(on&60)>>2,Sr=(on&192)>>6,Dr={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},nn={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(tn.push({name:"Header",byteRange:"0",hexData:`0x${Vn}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:Dr[pr]||"Unknown",binary:pr.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:nn[_r]||"Unknown",binary:_r.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:Sr.toString(),binary:Sr.toString(2).padStart(2,"0")}]}),Br+=2,(pr===0||pr===3)&&Mn.length>=Br+8){const Xn=Mn.slice(Br,Br+8),_i=parseInt(Xn.slice(0,4),16),ta=parseInt(Xn.slice(4,8),16);tn.push({name:"Transport Codes",byteRange:"1-4",hexData:`${Xn.slice(0,4)} ${Xn.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:_i.toString(),binary:_i.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:ta.toString(),binary:ta.toString(2).padStart(16,"0")}]}),Br+=8}if(Mn.length>=Br+2){const Xn=Mn.slice(Br,Br+2),_i=parseInt(Xn,16);if(tn.push({name:"Path Length",byteRange:`${Br/2}`,hexData:`0x${Xn}`,description:`${_i} bytes of path data`,fields:[{bits:"0-7",name:"Path Length",value:`${_i} bytes`,binary:_i.toString(2).padStart(8,"0")}]}),Br+=2,_i>0&&Mn.length>=Br+_i*2){const ta=Mn.slice(Br,Br+_i*2);tn.push({name:"Path Data",byteRange:`${Br/2}-${(Br+_i*2-2)/2}`,hexData:ta.match(/.{2}/g)?.join(" ")||ta,description:"Routing path information",fields:[{bits:`0-${_i*8-1}`,name:"Route Path",value:`${_i} bytes of routing data`,binary:`${_i} bytes (${_i*8} bits)`}]}),Br+=_i*2}}if(Mn.length>Br){const Xn=Mn.slice(Br),_i=Xn.length/2;_r===4?ne(tn,Xn,Br):tn.push({name:"Payload Data",byteRange:`${Br/2}-${Br/2+_i-1}`,hexData:Xn.match(/.{2}/g)?.join(" ")||Xn,description:"Application data content",fields:[{bits:`0-${_i*8-1}`,name:"Application Data",value:`${_i} bytes`,binary:`${_i} bytes (${_i*8} bits)`}]})}}}else{if(Mr.header){const Mn=Mr.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),Br=parseInt(Mn,16),Vn=Br&3,on=(Br&60)>>2,pr=(Br&192)>>6,_r={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},Sr={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};tn.push({name:"Header",byteRange:"0",hexData:`0x${Mn}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:_r[Vn]||"Unknown",binary:Vn.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:Sr[on]||"Unknown",binary:on.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:pr.toString(),binary:pr.toString(2).padStart(2,"0")}]}),Mr.transport_codes&&tn.push({name:"Transport Codes",byteRange:"1-4",hexData:Mr.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:Mr.transport_codes,binary:"Available in separate field"}]}),Mr.original_path&&Mr.original_path.length>0&&tn.push({name:"Original Path",byteRange:"?",hexData:Mr.original_path.join(" "),description:`Original routing path (${Mr.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Mr.original_path.length} nodes`,binary:"Available as node list"}]}),Mr.forwarded_path&&Mr.forwarded_path.length>0&&tn.push({name:"Forwarded Path",byteRange:"?",hexData:Mr.forwarded_path.join(" "),description:`Forwarded routing path (${Mr.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${Mr.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(Mr.payload){const Mn=Mr.payload.replace(/\s+/g,"").toUpperCase(),Br=Mn.length/2;Mr.type===4?ne(tn,Mn,0):tn.push({name:"Payload Data",byteRange:`0-${Br-1}`,hexData:Mn.match(/.{2}/g)?.join(" ")||Mn,description:`Application data content (${Br} bytes)`,fields:[{bits:`0-${Br*8-1}`,name:"Application Data",value:`${Br} bytes`,binary:`${Br} bytes (${Br*8} bits)`}]})}}}catch{tn.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return tn},Ce=Mr=>Mr==null?"text-content-muted dark:text-content-muted":Mr>=10?"text-green-600 dark:text-green-400":Mr>=5?"text-cyan-600 dark:text-cyan-400":Mr>=0?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",Ve=(Mr,tn=8)=>{if(Mr==null)return{level:0,className:"signal-none"};const Mn={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20}[tn]||-10;let Br,Vn;return Mr>=Mn+10?(Br=4,Vn="signal-excellent"):Mr>=Mn+5?(Br=3,Vn="signal-good"):Mr>=Mn?(Br=2,Vn="signal-fair"):(Br=1,Vn="signal-poor"),{level:Br,className:Vn}},kr=Mr=>{if(!Mr)return[];try{const tn=JSON.parse(Mr);return Array.isArray(tn)?tn:[]}catch{return[]}},It=Mr=>Mr>=1e3?`${(Mr/1e3).toFixed(2)}s`:`${Math.round(Mr)}ms`,rn=Mr=>{Mr.key==="Escape"&&u("close")},Lr=Mr=>{Mr.target===Mr.currentTarget&&u("close")};return Fh(()=>r.isOpen,Mr=>{Mr?document.body.style.overflow="hidden":document.body.style.overflow=""},{immediate:!0}),(Mr,tn)=>(Or(),w0(CS,{to:"body"},[Vs(F2,{name:"modal",appear:""},{default:V1(()=>[Mr.isOpen&&Mr.packet?(Or(),Nr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 overflow-hidden",onClick:Lr,onKeydown:rn,tabindex:"0"},[tn[51]||(tn[51]=At("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md pointer-events-none"},null,-1)),At("div",{class:"relative w-full max-w-4xl max-h-[90vh] flex flex-col",onClick:tn[3]||(tn[3]=Od(()=>{},["stop"]))},[At("div",Spt,[At("div",Cpt,[At("div",null,[tn[4]||(tn[4]=At("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Packet Details",-1)),At("p",Apt,yn(yt(Mr.packet.type))+" - "+yn(St(Mr.packet.route)),1)]),At("div",Mpt,[At("button",{onClick:tn[0]||(tn[0]=Dn=>T.value=!T.value),class:ja(["flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all duration-200",T.value?"bg-cyan-500/20 border border-cyan-400/30 text-cyan-600 dark:text-cyan-400":"bg-background-mute dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted"]),title:T.value?"Hide binary values":"Show binary values"},tn[5]||(tn[5]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})],-1),At("span",{class:"text-xs font-medium"},"Binary",-1)]),10,Ept),At("button",{onClick:tn[1]||(tn[1]=Dn=>u("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-background-mute dark:bg-white/10 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors duration-200 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary"},tn[6]||(tn[6]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),At("div",Lpt,[At("div",Ppt,[tn[13]||(tn[13]=At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[At("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),cl(" Basic Information ")],-1)),At("div",Ipt,[At("div",Dpt,[At("div",zpt,[At("div",Opt,[tn[7]||(tn[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Timestamp",-1)),At("span",Bpt,yn($(Mr.packet.timestamp)),1)]),At("div",Rpt,[tn[8]||(tn[8]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Packet Hash",-1)),At("span",Fpt,yn(Mr.packet.packet_hash),1)]),Mr.packet.header?(Or(),Nr("div",Npt,[tn[9]||(tn[9]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Header",-1)),At("span",jpt,yn(Mr.packet.header),1)])):Ta("",!0)]),At("div",Upt,[At("div",$pt,[tn[10]||(tn[10]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Type",-1)),At("span",Hpt,yn(Mr.packet.type)+" ("+yn(yt(Mr.packet.type))+")",1)]),At("div",Vpt,[tn[11]||(tn[11]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Route",-1)),At("span",Wpt,yn(Mr.packet.route)+" ("+yn(St(Mr.packet.route))+")",1)]),At("div",qpt,[tn[12]||(tn[12]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Status",-1)),At("span",{class:ja(["font-semibold",K(Mr.packet)])},yn(ct(Mr.packet)),3)])])])])]),At("div",Gpt,[tn[25]||(tn[25]=At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[At("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),cl(" Payload Data ")],-1)),At("div",Zpt,[At("div",Kpt,[At("div",Ypt,[tn[14]||(tn[14]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Payload Length",-1)),At("span",Xpt,yn(Mr.packet.payload_length||Mr.packet.length)+" bytes",1)]),Mr.packet.payload?(Or(),Nr("div",Jpt,[tn[23]||(tn[23]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3"},"Payload Analysis",-1)),At("div",Qpt,[tn[15]||(tn[15]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),At("div",t0t,[At("pre",e0t,yn(Ut(Mr.packet.payload)),1)])]),(Or(!0),Nr(Es,null,jl(we(Mr.packet).filter(Dn=>!Dn.name.includes("Parse Error")),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"mb-4"},[At("div",r0t,[At("h4",n0t,yn(Dn.name),1),At("span",i0t,"Bytes "+yn(Dn.byteRange),1)]),At("div",a0t,[At("div",o0t,yn(Dn.hexData),1)]),At("div",s0t,[At("div",{class:ja(["hidden md:grid gap-3 p-3 bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-muted text-xs font-semibold uppercase tracking-wide",T.value?"grid-cols-4":"grid-cols-3"])},[tn[16]||(tn[16]=At("div",{class:"min-w-0"},"Bits",-1)),tn[17]||(tn[17]=At("div",{class:"min-w-0"},"Field",-1)),tn[18]||(tn[18]=At("div",{class:"min-w-0"},"Value",-1)),T.value?(Or(),Nr("div",l0t,"Binary")):Ta("",!0)],2),(Or(!0),Nr(Es,null,jl(Dn.fields,(Br,Vn)=>(Or(),Nr("div",{key:Vn,class:ja(["hidden md:grid gap-3 p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors",T.value?"grid-cols-4":"grid-cols-3"])},[At("div",c0t,yn(Br.bits),1),At("div",u0t,yn(Br.name),1),At("div",h0t,[At("span",{class:"block",title:Br.value},yn(Br.value),9,d0t)]),T.value?(Or(),Nr("div",f0t,[At("span",{class:"block",title:Br.binary},yn(Br.binary),9,p0t)])):Ta("",!0)],2))),128)),(Or(!0),Nr(Es,null,jl(Dn.fields,(Br,Vn)=>(Or(),Nr("div",{key:`mobile-${Vn}`,class:"md:hidden p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 space-y-2"},[At("div",m0t,[At("div",null,[tn[19]||(tn[19]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Bits:",-1)),At("div",g0t,yn(Br.bits),1)]),At("div",null,[tn[20]||(tn[20]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Field:",-1)),At("div",v0t,yn(Br.name),1)])]),At("div",null,[tn[21]||(tn[21]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Value:",-1)),At("div",{class:"text-content-primary dark:text-content-primary text-sm font-semibold break-all",title:Br.value},yn(Br.value),9,y0t)]),T.value?(Or(),Nr("div",_0t,[tn[22]||(tn[22]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Binary:",-1)),At("div",{class:"text-orange-500 text-xs font-mono break-all",title:Br.binary},yn(Br.binary),9,x0t)])):Ta("",!0)]))),128))]),Dn.description?(Or(),Nr("div",b0t,yn(Dn.description),1)):Ta("",!0)]))),128))])):(Or(),Nr("div",w0t,tn[24]||(tn[24]=[At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Payload:",-1),At("span",{class:"text-content-muted dark:text-content-muted ml-2"},"None",-1)])))])])]),At("div",k0t,[tn[33]||(tn[33]=At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[At("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),cl(" Path Information ")],-1)),At("div",T0t,[At("div",S0t,[At("div",C0t,[At("div",A0t,[tn[26]||(tn[26]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Source Hash",-1)),At("span",{class:ja(["text-content-primary dark:text-content-primary font-mono text-xs",r.localHash&&Mr.packet.src_hash===r.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},yn(Mr.packet.src_hash||"Unknown"),3)]),At("div",M0t,[tn[27]||(tn[27]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Destination Hash",-1)),At("span",{class:ja(["text-content-primary dark:text-content-primary font-mono text-xs",r.localHash&&Mr.packet.dst_hash===r.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},yn(Mr.packet.dst_hash||"Broadcast"),3)])]),me(Mr.packet.original_path).length>0?(Or(),Nr("div",E0t,[tn[29]||(tn[29]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"Original Path",-1)),At("div",L0t,[At("div",P0t,[(Or(!0),Nr(Es,null,jl(me(Mr.packet.original_path),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center"},[At("div",I0t,[At("div",D0t,[At("div",z0t,yn(Dn.length<=2?Dn.toUpperCase():Dn.slice(0,2).toUpperCase()),1)]),At("div",O0t," Node: "+yn(Dn),1)]),Mn0?(Or(),Nr("div",R0t,[At("div",F0t,[tn[31]||(tn[31]=cl(" Forwarded Path ",-1)),JSON.stringify(me(Mr.packet.original_path))!==JSON.stringify(me(Mr.packet.forwarded_path))?(Or(),Nr("svg",N0t,tn[30]||(tn[30]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):Ta("",!0),JSON.stringify(me(Mr.packet.original_path))!==JSON.stringify(me(Mr.packet.forwarded_path))?(Or(),Nr("span",j0t,"(Modified)")):Ta("",!0)]),At("div",U0t,[At("div",$0t,[(Or(!0),Nr(Es,null,jl(me(Mr.packet.forwarded_path),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center"},[At("div",H0t,[At("div",{class:ja(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-500 dark:border-orange-400/40 rounded-lg transform transition-all hover:scale-105",r.localHash&&Dn===r.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-500 dark:border-orange-400/60"])},[At("div",{class:ja(["font-mono text-xs font-semibold",r.localHash&&Dn===r.localHash?"text-yellow-200":"text-white/90"])},yn(Dn.slice(0,2).toUpperCase()),3),r.localHash&&Dn===r.localHash?(Or(),Nr("div",V0t)):Ta("",!0)],2),At("div",W0t,yn(Dn),1)]),MnAt("div",{key:Dn,class:ja(["w-2 h-6 rounded-sm transition-all duration-300",Dn<=Ve(Mr.packet.snr).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[Ve(Mr.packet.snr).className]:"bg-stroke-subtle dark:bg-stroke/10"])},null,2)),64))]),At("span",imt,yn(Ve(Mr.packet.snr).className.replace("signal-","")),1)])])):(Or(),Nr("div",amt,tn[40]||(tn[40]=[At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"Signal Quality",-1),At("div",{class:"text-content-muted dark:text-content-muted text-sm italic"},"N/A (TX Packet)",-1)]))),Mr.packet.is_trace&&Mr.packet.path_snr_details&&Mr.packet.path_snr_details.length>0?(Or(),Nr("div",omt,[At("div",smt,"Path SNR Details ("+yn(Mr.packet.path_snr_details.length)+" hops)",1),At("div",lmt,[(Or(!0),Nr(Es,null,jl(Mr.packet.path_snr_details,(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center justify-between p-2 glass-card bg-background-mute dark:bg-black/20 rounded-[8px]"},[At("div",cmt,[At("span",umt,yn(Mn+1)+".",1),At("span",{class:ja(["font-mono text-xs text-content-primary dark:text-content-primary",r.localHash&&Dn.hash===r.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},yn(Dn.hash),3)]),At("span",{class:ja(["text-sm font-bold",Ce(Dn.snr_db)])},yn(Dn.snr_db.toFixed(1))+"dB ",3)]))),128))])])):Ta("",!0),Mr.packet.transmitted&&Mr.packet.lbt_attempts!==void 0?(Or(),Nr("div",hmt,[tn[45]||(tn[45]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3 flex items-center"},[At("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})]),cl(" Listen Before Talk (LBT) Metrics ")],-1)),At("div",dmt,[At("div",fmt,[tn[41]||(tn[41]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"CAD Attempts",-1)),At("div",pmt,yn(Mr.packet.lbt_attempts),1)]),At("div",mmt,[tn[42]||(tn[42]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Total LBT Delay",-1)),At("div",gmt,yn(It(kr(Mr.packet.lbt_backoff_delays_ms).reduce((Dn,Mn)=>Dn+Mn,0))),1),At("div",vmt,yn(kr(Mr.packet.lbt_backoff_delays_ms).length)+" backoffs ",1)]),At("div",ymt,[tn[43]||(tn[43]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Channel Status",-1)),At("div",{class:ja(["text-lg font-bold",Mr.packet.lbt_channel_busy?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400"])},yn(Mr.packet.lbt_channel_busy?"BUSY":"CLEAR"),3),At("div",_mt,yn(Mr.packet.lbt_channel_busy?"Waited for clear":"Immediate TX"),1)])]),kr(Mr.packet.lbt_backoff_delays_ms).length>0?(Or(),Nr("div",xmt,[tn[44]||(tn[44]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-3 font-semibold"},"Backoff Pattern (Exponential with Jitter)",-1)),At("div",bmt,[(Or(!0),Nr(Es,null,jl(kr(Mr.packet.lbt_backoff_delays_ms),(Dn,Mn)=>(Or(),Nr("div",{key:Mn,class:"flex items-center gap-3"},[At("div",wmt,[At("span",kmt,"Attempt "+yn(Mn+1),1)]),At("div",Tmt,[At("div",Smt,[At("div",{class:ja(["h-full rounded-lg transition-all duration-300",[Mn===0?"bg-gradient-to-r from-cyan-500/50 to-cyan-600/50":Mn===1?"bg-gradient-to-r from-yellow-500/50 to-yellow-600/50":Mn===2?"bg-gradient-to-r from-orange-500/50 to-orange-600/50":"bg-gradient-to-r from-red-500/50 to-red-600/50"]]),style:Sp({width:`${Math.min(100,Dn/Math.max(...kr(Mr.packet.lbt_backoff_delays_ms))*100)}%`})},[At("div",Cmt,[At("span",Amt,yn(It(Dn)),1)])],6)])]),At("div",Mmt,[At("span",Emt,yn(Math.round(Dn/kr(Mr.packet.lbt_backoff_delays_ms).reduce((Br,Vn)=>Br+Vn,0)*100))+"% ",1)])]))),128))])])):Ta("",!0)])):Ta("",!0),At("div",Lmt,[At("div",Pmt,[At("div",Imt,[tn[46]||(tn[46]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"TX Delay",-1)),At("span",Dmt,yn(Number(Mr.packet.tx_delay_ms)>0?Number(Mr.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),At("div",zmt,[tn[47]||(tn[47]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Transmitted",-1)),At("span",{class:ja(Mr.packet.transmitted?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400")},yn(Mr.packet.transmitted?"Yes":"No"),3)])]),At("div",Omt,[At("div",Bmt,[tn[48]||(tn[48]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Is Duplicate",-1)),At("span",{class:ja(Mr.packet.is_duplicate?"text-amber-600 dark:text-amber-400":"text-content-muted dark:text-content-muted")},yn(Mr.packet.is_duplicate?"Yes":"No"),3)]),Mr.packet.drop_reason?(Or(),Nr("div",Rmt,[tn[49]||(tn[49]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Drop Reason",-1)),At("span",Fmt,yn(Mr.packet.drop_reason),1)])):Ta("",!0)])])])])]),At("div",Nmt,[At("button",{onClick:tn[2]||(tn[2]=Dn=>u("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-content-primary dark:text-content-primary transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):Ta("",!0)]),_:1})]))}}),Umt=vh(jmt,[["__scopeId","data-v-6aa59823"]]),yH="pymc_pref_";function B1(e,t){try{const r=localStorage.getItem(yH+e);return r===null?t:JSON.parse(r)}catch(r){return console.warn(`Failed to get preference ${e}:`,r),t}}function R1(e,t){try{localStorage.setItem(yH+e,JSON.stringify(t))}catch(r){console.warn(`Failed to set preference ${e}:`,r)}}const $mt={class:"glass-card rounded-[20px] p-6"},Hmt={class:"flex flex-col lg:flex-row lg:justify-between lg:items-center mb-6 gap-4 filter-container"},Vmt={class:"flex items-center gap-2 header-info relative"},Wmt={class:"text-content-secondary dark:text-content-muted text-sm packet-count"},qmt=["title"],Gmt={class:"hidden sm:inline"},Zmt={key:1,class:"text-accent-red text-sm error-indicator"},Kmt={class:"flex items-center gap-3 lg:flex filter-controls"},Ymt={class:"flex flex-col"},Xmt=["value"],Jmt={class:"flex flex-col"},Qmt=["value"],tgt={class:"flex flex-col"},egt={class:"flex flex-col reset-container"},rgt=["disabled"],ngt={class:"space-y-4 overflow-hidden"},igt=["onClick"],agt={class:"hidden lg:grid grid-cols-12 gap-2 items-center"},ogt={class:"col-span-1 text-content-primary dark:text-content-primary text-sm"},sgt={class:"col-span-1 flex items-center gap-2"},lgt={class:"flex flex-col"},cgt={class:"text-content-primary dark:text-content-primary text-xs"},ugt=["title"],hgt={class:"col-span-2"},dgt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},fgt={class:"col-span-2"},pgt={class:"space-y-1"},mgt={class:"inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs"},ggt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},vgt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},ygt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},_gt={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},xgt={key:0,class:"flex items-center gap-1"},bgt={class:"col-span-1"},wgt={key:0,class:"text-accent-red text-[8px] italic truncate"},kgt={class:"lg:hidden space-y-2"},Tgt={class:"flex items-center justify-between"},Sgt={class:"flex items-center gap-2"},Cgt={class:"flex flex-col"},Agt={class:"text-content-primary dark:text-content-primary text-sm font-medium"},Mgt=["title"],Egt={class:"flex items-center gap-2 text-right"},Lgt={class:"text-content-secondary dark:text-content-muted text-xs"},Pgt={class:"flex items-center justify-between"},Igt={class:"flex items-center gap-2"},Dgt={class:"inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs"},zgt={class:"flex items-center gap-2"},Ogt={class:"flex items-center gap-1"},Bgt={key:0,class:"flex gap-0.5"},Rgt={class:"text-content-primary dark:text-content-primary text-xs"},Fgt={class:"flex items-center justify-between text-content-secondary dark:text-content-muted text-xs"},Ngt={class:"flex items-center gap-3"},jgt={class:"flex items-center gap-2"},Ugt={key:0,class:"flex items-center gap-1"},$gt={key:0,class:"text-accent-red text-xs italic"},Hgt={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke pagination-container"},Vgt={class:"flex items-center gap-4 pagination-info"},Wgt={class:"text-content-secondary dark:text-content-muted text-sm"},qgt={key:0,class:"flex items-center gap-2 load-more-section"},Ggt=["disabled"],Zgt={class:"text-content-secondary dark:text-content-muted text-xs load-more-count"},Kgt={class:"flex items-center gap-2 pagination-controls"},Ygt=["disabled"],Xgt={class:"flex items-center gap-1 page-numbers"},Jgt={key:1,class:"text-content-secondary dark:text-content-muted text-sm px-2 ellipsis"},Qgt=["onClick"],tvt={key:2,class:"text-content-secondary dark:text-content-muted text-sm px-2 ellipsis"},evt=["disabled"],rvt={key:1,class:"flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke"},nvt={class:"flex items-center gap-4"},ivt={class:"text-content-secondary dark:text-content-muted text-sm"},avt={class:"text-content-secondary dark:text-content-muted text-xs"},ovt={key:2,class:"flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke"},U3=10,fx=1e3,svt=Cc({name:"PacketTable",__name:"PacketTable",setup(e){const t=u4(),r=li(1),u=li(null),T=li(100),$=li(!1),K=li(!1);let ct=null;Fh(()=>t.isLoading,Bi=>{Bi?(ct&&(clearTimeout(ct),ct=null),K.value=!0):ct=window.setTimeout(()=>{K.value=!1,ct=null},600)});const yt=li(null),St=li(!1),Ut=Bi=>{yt.value=Bi,St.value=!0},ne=()=>{St.value=!1,yt.value=null},pe=li(B1("packetTable_selectedType","all")),me=li(B1("packetTable_selectedRoute","all")),we=li(!1),Ce=li(null),Ve=["all","0","1","2","3","4","5","6","7","8","9","10","11"],kr=["all","1","2"];Fh(pe,Bi=>{R1("packetTable_selectedType",Bi),r.value=1}),Fh(me,Bi=>{R1("packetTable_selectedRoute",Bi),r.value=1}),Fh(we,()=>{r.value=1});const It=Ao(()=>{let Bi=t.recentPackets;if(pe.value!=="all"){const Xi=parseInt(pe.value);Bi=Bi.filter(Yn=>Yn.type===Xi)}if(me.value!=="all"){const Xi=parseInt(me.value);Bi=Bi.filter(Yn=>Yn.route===Xi)}return we.value&&Ce.value!==null&&(Bi=Bi.filter(Xi=>Xi.timestamp>=Ce.value)),Bi}),rn=Ao(()=>{const Bi=(r.value-1)*U3,Xi=Bi+U3;return It.value.slice(Bi,Xi)}),Lr=Ao(()=>Math.ceil(It.value.length/U3)),Mr=Ao(()=>r.value===Lr.value),tn=Ao(()=>t.recentPackets.length>=T.value&&T.valueMr.value&&tn.value&&!$.value),Mn=Bi=>new Date(Bi*1e3).toLocaleTimeString(void 0,{hour12:!0}),Br=Bi=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTI_PART",11:"CONTROL"})[Bi]||`TYPE_${Bi}`,Vn=Bi=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[Bi]||`Route ${Bi}`,on=Bi=>Bi.transmitted?"text-accent-green":"text-primary",pr=Bi=>Bi.drop_reason?"Dropped":Bi.transmitted?"Forward":"Received",_r=Bi=>Bi===1?"bg-badge-cyan-bg text-badge-cyan-text":"bg-badge-neutral-bg text-badge-neutral-text",Sr=Bi=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[Bi]||"bg-gray-500",Dr=Bi=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[Bi]||"border-l-gray-500",nn=Bi=>!Bi.transmitted||!Bi.lbt_attempts||Bi.lbt_attempts===0?"bg-green-400":Bi.lbt_attempts===1?"bg-cyan-400":Bi.lbt_attempts===2?"bg-yellow-400":"bg-orange-400",Cn=Bi=>Bi>=1e3?(Bi/1e3).toFixed(2)+"s":Bi.toFixed(1)+"ms",Xn=Bi=>{if(Bi.type!==4||!Bi.payload)return null;try{const Xi=Bi.payload.replace(/\s+/g,"").toUpperCase();let Yn=Xi,hi=0;if(Xi.length/2>=100)if(Xi.length>200)Yn=Xi.slice(200),hi=0;else return null;if(Yn.length>=2){const Xa=parseInt(Yn.slice(0,2),16);hi+=2;const oo=!!(Xa&16),xa=!!(Xa&32),Ur=!!(Xa&64);if(!!!(Xa&128))return null;if(oo&&Yn.length>=hi+16&&(hi+=16),xa&&Yn.length>=hi+4&&(hi+=4),Ur&&Yn.length>=hi+4&&(hi+=4),Yn.length>hi){const Ha=(Yn.slice(hi).match(/.{2}/g)||[]).map(qa=>{const Mo=parseInt(qa,16);return Mo>=32&&Mo<=126?String.fromCharCode(Mo):"."}).join("").replace(/\.*$/,"");return Ha.length>0?Ha:null}}}catch(Xi){console.error("Error parsing ADVERT node name:",Xi)}return null},_i=()=>{pe.value="all",me.value="all",we.value=!1,Ce.value=null,r.value=1},ta=()=>{we.value?(we.value=!1,Ce.value=null):(we.value=!0,Ce.value=Date.now()/1e3),r.value=1},va=Ao(()=>Ce.value?new Date(Ce.value*1e3).toLocaleTimeString(void 0,{hour12:!0}):""),_a=async Bi=>{try{const Xi=Bi||T.value;await t.fetchRecentPackets({limit:Xi})}catch(Xi){console.error("Error fetching packet data:",Xi)}},qi=async()=>{if(!($.value||T.value>=fx)){$.value=!0;try{const Bi=Math.min(T.value+200,fx);T.value=Bi,await _a(Bi)}catch(Bi){console.error("Error loading more records:",Bi)}finally{$.value=!1}}};return Xd(async()=>{await _a(),u.value=window.setInterval(_a,1e4)}),Tg(()=>{u.value&&clearInterval(u.value),ct&&clearTimeout(ct)}),(Bi,Xi)=>(Or(),Nr(Es,null,[At("div",$mt,[At("div",Hmt,[At("div",Vmt,[Xi[7]||(Xi[7]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold"},"Recent Packets",-1)),At("span",Wmt," ("+yn(It.value.length)+" of "+yn(Lo(t).recentPackets.length)+") ",1),we.value?(Or(),Nr("span",{key:0,class:"text-primary text-xs sm:text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20 live-mode-badge whitespace-nowrap",title:`Filter activated at ${va.value}`},[At("span",Gmt,"Live Mode (since "+yn(va.value)+")",1),Xi[6]||(Xi[6]=At("span",{class:"sm:hidden"},"Live",-1))],8,qmt)):Ta("",!0),Lo(t).error?(Or(),Nr("span",Zmt,yn(Lo(t).error),1)):Ta("",!0)]),At("div",Kmt,[At("div",Ymt,[Xi[8]||(Xi[8]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Type",-1)),Ml(At("select",{"onUpdate:modelValue":Xi[0]||(Xi[0]=Yn=>pe.value=Yn),class:"glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(Or(),Nr(Es,null,jl(Ve,Yn=>At("option",{key:Yn,value:Yn,class:"bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary"},yn(Yn==="all"?"All Types":`Type ${Yn} (${Br(parseInt(Yn))})`),9,Xmt)),64))],512),[[xg,pe.value]])]),At("div",Jmt,[Xi[9]||(Xi[9]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Route",-1)),Ml(At("select",{"onUpdate:modelValue":Xi[1]||(Xi[1]=Yn=>me.value=Yn),class:"glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(Or(),Nr(Es,null,jl(kr,Yn=>At("option",{key:Yn,value:Yn,class:"bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary"},yn(Yn==="all"?"All Routes":`Route ${Yn} (${Vn(parseInt(Yn))})`),9,Qmt)),64))],512),[[xg,me.value]])]),At("div",tgt,[Xi[10]||(Xi[10]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Filter",-1)),At("button",{onClick:ta,class:ja(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":we.value,"border-stroke-subtle dark:border-stroke text-content-secondary dark:text-content-muted hover:border-primary hover:text-content-primary dark:hover:text-content-primary hover:bg-primary/5":!we.value}])},yn(we.value?"New Only":"Show New"),3)]),At("div",egt,[Xi[11]||(Xi[11]=At("label",{class:"text-transparent text-xs mb-1"},".",-1)),At("button",{onClick:_i,class:ja(["glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[10px] px-4 py-2 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-stroke-subtle dark:hover:border-stroke hover:text-content-secondary dark:hover:text-content-muted":pe.value==="all"&&me.value==="all"&&!we.value,"hover:bg-primary/10":pe.value!=="all"||me.value!=="all"||we.value}]),disabled:pe.value==="all"&&me.value==="all"&&!we.value}," Reset ",10,rgt)])])]),Xi[17]||(Xi[17]=Du('',1)),At("div",ngt,[Vs(iot,{name:"packet-list",tag:"div",class:"space-y-4",appear:""},{default:V1(()=>[(Or(!0),Nr(Es,null,jl(rn.value,(Yn,hi)=>(Or(),Nr("div",{key:`${Yn.packet_hash}_${Yn.timestamp}_${hi}`,class:ja(["packet-row border-b border-stroke-subtle dark:border-dark-border/50 pb-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors duration-200 cursor-pointer rounded-[10px] p-2 border-l-4",Dr(Yn.type)]),onClick:na=>Ut(Yn)},[At("div",agt,[At("div",ogt,yn(Mn(Yn.timestamp)),1),At("div",sgt,[At("div",{class:ja(["w-2 h-2 rounded-full",Sr(Yn.type)])},null,2),At("div",lgt,[At("span",cgt,yn(Br(Yn.type)),1),Yn.type===4&&Xn(Yn)?(Or(),Nr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium max-w-[80px] truncate",title:Xn(Yn)||void 0},yn(Xn(Yn)),9,ugt)):Ta("",!0)])]),At("div",hgt,[At("span",{class:ja(["inline-block px-2 py-1 rounded text-xs font-medium",_r(Yn.route)])},yn(Vn(Yn.route)),3)]),At("div",dgt,yn(Yn.length)+"B",1),At("div",fgt,[At("div",pgt,[At("span",mgt,yn(Yn.src_hash?.slice(-4)||"????")+" → "+yn(Yn.dst_hash?.slice(-4)||"????"),1)])]),At("div",ggt,yn(Yn.rssi!=null?Yn.rssi.toFixed(0):"N/A"),1),At("div",vgt,yn(Yn.snr!=null?Yn.snr.toFixed(1)+"dB":"N/A"),1),At("div",ygt,yn(Yn.score!=null?Yn.score.toFixed(2):"N/A"),1),At("div",_gt,[Number(Yn.tx_delay_ms)>0?(Or(),Nr("div",xgt,[Yn.transmitted?(Or(),Nr("div",{key:0,class:ja(["w-1.5 h-1.5 rounded-full flex-shrink-0",nn(Yn)])},null,2)):Ta("",!0),At("span",null,yn(Cn(Number(Yn.tx_delay_ms))),1)])):Ta("",!0)]),At("div",bgt,[At("div",null,[At("span",{class:ja(["text-xs font-medium",on(Yn)])},yn(pr(Yn)),3),Yn.drop_reason?(Or(),Nr("p",wgt,yn(Yn.drop_reason),1)):Ta("",!0)])])]),At("div",kgt,[At("div",Tgt,[At("div",Sgt,[At("div",{class:ja(["w-2 h-2 rounded-full flex-shrink-0",Sr(Yn.type)])},null,2),At("div",Cgt,[At("span",Agt,yn(Br(Yn.type)),1),Yn.type===4&&Xn(Yn)?(Or(),Nr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium leading-tight",title:Xn(Yn)||void 0},yn(Xn(Yn)),9,Mgt)):Ta("",!0)]),At("span",{class:ja(["inline-block px-2 py-1 rounded text-xs font-medium ml-2",_r(Yn.route)])},yn(Vn(Yn.route)),3)]),At("div",Egt,[At("span",Lgt,yn(Mn(Yn.timestamp)),1),At("span",{class:ja(["text-xs font-medium",on(Yn)])},yn(pr(Yn)),3)])]),At("div",Pgt,[At("div",Igt,[At("span",Dgt,yn(Yn.src_hash?.slice(-4)||"????")+" → "+yn(Yn.dst_hash?.slice(-4)||"????"),1)]),At("div",zgt,[At("div",Ogt,[Yn.snr!=null?(Or(),Nr("div",Bgt,[At("div",{class:ja(["w-1 h-3 rounded-sm",Yn.snr>=-10?"bg-green-400":"bg-white/20"])},null,2),At("div",{class:ja(["w-1 h-4 rounded-sm",Yn.snr>=-5?"bg-green-400":"bg-white/20"])},null,2),At("div",{class:ja(["w-1 h-5 rounded-sm",Yn.snr>=0?"bg-green-400":"bg-white/20"])},null,2),At("div",{class:ja(["w-1 h-6 rounded-sm",Yn.snr>=10?"bg-green-400":"bg-white/20"])},null,2)])):Ta("",!0),At("span",Rgt,yn(Yn.rssi!=null?Yn.rssi.toFixed(0)+"dBm":"TX"),1)])])]),At("div",Fgt,[At("div",Ngt,[At("span",null,yn(Yn.length)+"B",1),At("span",null,"SNR: "+yn(Yn.snr!=null?Yn.snr.toFixed(1)+"dB":"N/A"),1),At("span",null,"Score: "+yn(Yn.score!=null?Yn.score.toFixed(2):"N/A"),1)]),At("div",jgt,[Number(Yn.tx_delay_ms)>0?(Or(),Nr("span",Ugt,[Yn.transmitted?(Or(),Nr("div",{key:0,class:ja(["w-1.5 h-1.5 rounded-full flex-shrink-0",nn(Yn)])},null,2)):Ta("",!0),At("span",null,yn(Cn(Number(Yn.tx_delay_ms))),1)])):Ta("",!0)])]),Yn.drop_reason?(Or(),Nr("div",$gt,yn(Yn.drop_reason),1)):Ta("",!0)])],10,igt))),128))]),_:1})]),Lr.value>1?(Or(),Nr("div",Hgt,[At("div",Vgt,[At("span",Wgt," Showing "+yn((r.value-1)*U3+1)+" - "+yn(Math.min(r.value*U3,It.value.length))+" of "+yn(It.value.length)+" packets ",1),Dn.value?(Or(),Nr("div",qgt,[Xi[12]||(Xi[12]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"•",-1)),At("button",{onClick:qi,disabled:$.value,class:ja(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!$.value,"text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke cursor-not-allowed opacity-50":$.value}])},yn($.value?"Loading...":`Load ${Math.min(200,fx-T.value)} more`),11,Ggt),At("span",Zgt,"("+yn(T.value)+"/"+yn(fx)+" max)",1)])):Ta("",!0)]),At("div",Kgt,[At("button",{onClick:Xi[2]||(Xi[2]=Yn=>r.value=r.value-1),disabled:r.value<=1,class:ja(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":r.value<=1,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":r.value>1}])},Xi[13]||(Xi[13]=[At("span",{class:"hidden sm:inline"},"Previous",-1),At("span",{class:"sm:hidden"},"‹",-1)]),10,Ygt),At("div",Xgt,[r.value>3?(Or(),Nr("button",{key:0,onClick:Xi[3]||(Xi[3]=Yn=>r.value=1),class:"glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):Ta("",!0),r.value>4?(Or(),Nr("span",Jgt,"...")):Ta("",!0),(Or(!0),Nr(Es,null,jl(Array.from({length:Math.min(5,Lr.value)},(Yn,hi)=>Math.max(1,Math.min(r.value-2,Lr.value-4))+hi).filter(Yn=>Yn<=Lr.value),Yn=>(Or(),Nr("button",{key:Yn,onClick:hi=>r.value=Yn,class:ja(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 page-number",{"border-primary bg-primary/10 text-primary":r.value===Yn,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":r.value!==Yn}])},yn(Yn),11,Qgt))),128)),r.valuer.value=Lr.value),class:"glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},yn(Lr.value),1)):Ta("",!0)]),At("button",{onClick:Xi[5]||(Xi[5]=Yn=>r.value=r.value+1),disabled:r.value>=Lr.value,class:ja(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":r.value>=Lr.value,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":r.value(Or(),Nr("div",null,[Vs($ft),At("div",cvt,[Vs(Tpt),Vs(spt)]),Vs(lvt)]))}}),hvt={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mb-6"},dvt={class:"flex items-center gap-3"},fvt={class:"flex-1 min-w-0"},pvt={class:"text-content-primary dark:text-content-primary font-medium truncate"},mvt={class:"text-content-secondary dark:text-content-muted text-sm font-mono"},gvt={key:0,class:"text-white/50 text-xs"},vvt={key:1,class:"text-white/50 text-xs"},yvt=Cc({__name:"DeleteNeighborModal",props:{show:{type:Boolean},neighbor:{}},emits:["close","delete"],setup(e,{emit:t}){const r=e,u=t,T=()=>{r.neighbor&&(u("delete",r.neighbor.id),$())},$=()=>{u("close")},K=ct=>{ct.target===ct.currentTarget&&$()};return(ct,yt)=>ct.show&&ct.neighbor?(Or(),Nr("div",{key:0,onClick:K,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:yt[0]||(yt[0]=Od(()=>{},["stop"]))},[At("div",{class:"flex items-center gap-3 mb-6"},[yt[2]||(yt[2]=At("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),yt[3]||(yt[3]=At("div",null,[At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Delete Neighbor"),At("p",{class:"text-content-secondary dark:text-content-muted text-sm mt-1"}," Are you sure you want to delete this neighbor? ")],-1)),At("button",{onClick:$,class:"ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},yt[1]||(yt[1]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",hvt,[At("div",dvt,[At("div",fvt,[At("div",pvt,yn(ct.neighbor?.node_name||ct.neighbor?.long_name||ct.neighbor?.short_name||"Unknown"),1),At("div",mvt," ID: "+yn(ct.neighbor?.node_num_hex||ct.neighbor?.node_num||ct.neighbor?.id||"N/A"),1),ct.neighbor?.contact_type?(Or(),Nr("div",gvt,yn(ct.neighbor.contact_type),1)):Ta("",!0),ct.neighbor?.hw_model?(Or(),Nr("div",vvt,yn(ct.neighbor.hw_model),1)):Ta("",!0)])])]),yt[4]||(yt[4]=At("div",{class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},[At("div",{class:"flex items-center gap-2 text-accent-red text-sm"},[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),At("span",null,"This action cannot be undone")])],-1)),At("div",{class:"flex gap-3"},[At("button",{onClick:$,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{onClick:T,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"}," Delete ")])])])):Ta("",!0)}}),_vt={class:"bg-gradient-to-r from-primary/20 to-accent-blue/20 border-b border-stroke-subtle dark:border-stroke/10 px-6 py-4"},xvt={class:"flex items-center justify-between"},bvt={class:"flex items-center gap-3"},wvt={key:0,class:"text-sm text-content-secondary dark:text-content-muted"},kvt={class:"p-6"},Tvt={key:0,class:"text-center py-8"},Svt={key:1,class:"text-center py-8"},Cvt={class:"text-content-secondary dark:text-content-muted text-sm"},Avt={key:2,class:"space-y-4"},Mvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Evt={class:"flex items-center justify-between mb-2"},Lvt={class:"flex items-baseline gap-2"},Pvt={class:"text-3xl font-bold text-content-primary dark:text-content-primary"},Ivt={class:"grid grid-cols-2 gap-3"},Dvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},zvt={class:"flex items-center gap-2 mb-2"},Ovt={class:"flex gap-0.5"},Bvt={class:"flex items-baseline gap-1"},Rvt={class:"text-xl font-bold text-content-primary dark:text-content-primary"},Fvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Nvt={class:"flex items-baseline gap-1"},jvt={class:"text-xl font-bold text-content-primary dark:text-content-primary"},Uvt={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},$vt={class:"relative"},Hvt={class:"flex items-center gap-2 overflow-x-auto pb-2"},Vvt={key:0,class:"relative flex items-center"},Wvt={key:0,class:"absolute left-1/2 -translate-x-1/2 animate-pulse"},qvt={class:"text-content-muted dark:text-content-muted text-xs mt-2 flex items-center justify-between"},Gvt={key:0,class:"text-cyan-500 dark:text-primary animate-pulse"},Zvt={class:"flex items-center justify-between text-xs text-content-muted dark:text-content-muted pt-2"},Kvt=Cc({__name:"PingResultModal",props:{show:{type:Boolean},nodeName:{default:null},result:{default:null},error:{default:null},loading:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const r=e,u=t,T=Ym(),$=li(0),K=li(!1),ct=Ao(()=>{const pe=T.stats?.config?.radio?.spreading_factor??7,me=T.stats?.config?.radio?.bandwidth??125,we=T.stats?.config?.radio?.coding_rate??5,Ce=Math.pow(2,pe)/me,Ve=8+4.25*(we-4)+20;return Ce*Ve}),yt=Ao(()=>{if(!r.result)return{color:"text-gray-400",label:"Unknown"};const pe=r.result.rtt_ms,me=ct.value,we=r.result.path.length,Ve=2*me*we+500*we;return pe{if(!r.result)return{bars:0,color:"text-gray-400"};const pe=r.result.rssi;return pe>=-50?{bars:5,color:"text-green-600 dark:text-green-400"}:pe>=-60?{bars:4,color:"text-green-600 dark:text-green-300"}:pe>=-70?{bars:3,color:"text-yellow-600 dark:text-yellow-400"}:pe>=-80?{bars:2,color:"text-orange-600 dark:text-orange-400"}:pe>=-90?{bars:1,color:"text-red-600 dark:text-red-400"}:{bars:0,color:"text-red-600 dark:text-red-500"}});Fh(()=>r.result,pe=>{if(pe&&!K.value){K.value=!0,$.value=0;const me=pe.path.length,Ce=1500/(me*2);let Ve=0;const kr=me*2-2,It=()=>{Ve<=kr?($.value=Ve/kr,Ve++,setTimeout(It,Ce)):(K.value=!1,$.value=1)};setTimeout(It,100)}},{immediate:!0});const Ut=Ao(()=>{if(!r.result||!K.value)return-1;const pe=r.result.path.length;if(pe<=1)return-1;const me=$.value,we=.5;if(me<=we)return me/we*(pe-1);{const Ce=(me-we)/we;return(pe-1)*(1-Ce)}}),ne=()=>{u("close")};return(pe,me)=>(Or(),w0(CS,{to:"body"},[Vs(F2,{name:"modal"},{default:V1(()=>[pe.show?(Or(),Nr("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[99999] p-4",onClick:Od(ne,["self"])},[At("div",{class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[20px] shadow-2xl w-full max-w-md overflow-hidden",onClick:me[0]||(me[0]=Od(()=>{},["stop"]))},[At("div",_vt,[At("div",xvt,[At("div",bvt,[me[2]||(me[2]=At("div",{class:"p-2 bg-cyan-400/20 dark:bg-primary/20 rounded-lg"},[At("svg",{class:"w-5 h-5 text-cyan-500 dark:text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})])],-1)),At("div",null,[me[1]||(me[1]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Ping Result",-1)),pe.nodeName?(Or(),Nr("p",wvt,yn(pe.nodeName),1)):Ta("",!0)])]),At("button",{onClick:ne,class:"p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary"},me[3]||(me[3]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),At("div",kvt,[pe.loading?(Or(),Nr("div",Tvt,me[4]||(me[4]=[At("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"},null,-1),At("p",{class:"text-content-secondary dark:text-content-muted"},"Sending ping...",-1),At("p",{class:"text-content-muted dark:text-content-muted text-sm mt-1"},"Waiting for response...",-1)]))):pe.error?(Or(),Nr("div",Svt,[me[5]||(me[5]=At("div",{class:"p-3 bg-accent-red/10 rounded-full w-16 h-16 mx-auto mb-4 flex items-center justify-center"},[At("svg",{class:"w-8 h-8 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z"})])],-1)),me[6]||(me[6]=At("h3",{class:"text-accent-red font-semibold mb-2"},"Ping Failed",-1)),At("p",Cvt,yn(pe.error),1)])):pe.result?(Or(),Nr("div",Avt,[At("div",Mvt,[At("div",Evt,[me[7]||(me[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Round-Trip Time",-1)),At("span",{class:ja(["text-xs font-medium px-2 py-1 rounded-full",yt.value.color,"bg-current/10"])},yn(yt.value.label),3)]),At("div",Lvt,[At("span",Pvt,yn(pe.result.rtt_ms.toFixed(2)),1),me[8]||(me[8]=At("span",{class:"text-content-secondary dark:text-content-muted"},"ms",-1))])]),At("div",Ivt,[At("div",Dvt,[At("div",zvt,[me[9]||(me[9]=At("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"RSSI",-1)),At("div",Ovt,[(Or(),Nr(Es,null,jl(5,we=>At("div",{key:we,class:ja(["w-1 h-3 rounded-sm",we<=St.value.bars?St.value.color:"bg-stroke-subtle dark:bg-stroke/10"])},null,2)),64))])]),At("div",Bvt,[At("span",Rvt,yn(pe.result.rssi),1),me[10]||(me[10]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"dBm",-1))])]),At("div",Fvt,[me[12]||(me[12]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"SNR",-1)),At("div",Nvt,[At("span",jvt,yn(pe.result.snr_db),1),me[11]||(me[11]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"dB",-1))])])]),At("div",Uvt,[me[15]||(me[15]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3"},"Network Path",-1)),At("div",$vt,[At("div",Hvt,[(Or(!0),Nr(Es,null,jl(pe.result.path,(we,Ce)=>(Or(),Nr("div",{key:Ce,class:"flex items-center gap-2 flex-shrink-0 relative"},[At("div",{class:ja(["bg-cyan-400/20 dark:bg-primary/20 text-cyan-600 dark:text-primary border border-cyan-400/40 dark:border-primary/30 px-3 py-1.5 rounded-lg text-sm font-mono transition-all duration-300",K.value&&Math.floor(Ut.value)===Ce?"ring-2 ring-cyan-400/50 dark:ring-primary/50 scale-105":""])},yn(we),3),Ce[K.value&&Ut.value>=Ce&&Ut.value"u"||!L||!L.Mixin)){ft=rn(ft)?ft:[ft];for(var $t=0;$t0?Math.floor(ft):Math.ceil(ft)};Xn.prototype={clone:function(){return new Xn(this.x,this.y)},add:function(ft){return this.clone()._add(ta(ft))},_add:function(ft){return this.x+=ft.x,this.y+=ft.y,this},subtract:function(ft){return this.clone()._subtract(ta(ft))},_subtract:function(ft){return this.x-=ft.x,this.y-=ft.y,this},divideBy:function(ft){return this.clone()._divideBy(ft)},_divideBy:function(ft){return this.x/=ft,this.y/=ft,this},multiplyBy:function(ft){return this.clone()._multiplyBy(ft)},_multiplyBy:function(ft){return this.x*=ft,this.y*=ft,this},scaleBy:function(ft){return new Xn(this.x*ft.x,this.y*ft.y)},unscaleBy:function(ft){return new Xn(this.x/ft.x,this.y/ft.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=_i(this.x),this.y=_i(this.y),this},distanceTo:function(ft){ft=ta(ft);var $t=ft.x-this.x,_e=ft.y-this.y;return Math.sqrt($t*$t+_e*_e)},equals:function(ft){return ft=ta(ft),ft.x===this.x&&ft.y===this.y},contains:function(ft){return ft=ta(ft),Math.abs(ft.x)<=Math.abs(this.x)&&Math.abs(ft.y)<=Math.abs(this.y)},toString:function(){return"Point("+pe(this.x)+", "+pe(this.y)+")"}};function ta(ft,$t,_e){return ft instanceof Xn?ft:rn(ft)?new Xn(ft[0],ft[1]):ft==null?ft:typeof ft=="object"&&"x"in ft&&"y"in ft?new Xn(ft.x,ft.y):new Xn(ft,$t,_e)}function va(ft,$t){if(ft)for(var _e=$t?[ft,$t]:ft,ir=0,Wr=_e.length;ir=this.min.x&&_e.x<=this.max.x&&$t.y>=this.min.y&&_e.y<=this.max.y},intersects:function(ft){ft=_a(ft);var $t=this.min,_e=this.max,ir=ft.min,Wr=ft.max,$n=Wr.x>=$t.x&&ir.x<=_e.x,na=Wr.y>=$t.y&&ir.y<=_e.y;return $n&&na},overlaps:function(ft){ft=_a(ft);var $t=this.min,_e=this.max,ir=ft.min,Wr=ft.max,$n=Wr.x>$t.x&&ir.x<_e.x,na=Wr.y>$t.y&&ir.y<_e.y;return $n&&na},isValid:function(){return!!(this.min&&this.max)},pad:function(ft){var $t=this.min,_e=this.max,ir=Math.abs($t.x-_e.x)*ft,Wr=Math.abs($t.y-_e.y)*ft;return _a(ta($t.x-ir,$t.y-Wr),ta(_e.x+ir,_e.y+Wr))},equals:function(ft){return ft?(ft=_a(ft),this.min.equals(ft.getTopLeft())&&this.max.equals(ft.getBottomRight())):!1}};function _a(ft,$t){return!ft||ft instanceof va?ft:new va(ft,$t)}function qi(ft,$t){if(ft)for(var _e=$t?[ft,$t]:ft,ir=0,Wr=_e.length;ir=$t.lat&&Wr.lat<=_e.lat&&ir.lng>=$t.lng&&Wr.lng<=_e.lng},intersects:function(ft){ft=Bi(ft);var $t=this._southWest,_e=this._northEast,ir=ft.getSouthWest(),Wr=ft.getNorthEast(),$n=Wr.lat>=$t.lat&&ir.lat<=_e.lat,na=Wr.lng>=$t.lng&&ir.lng<=_e.lng;return $n&&na},overlaps:function(ft){ft=Bi(ft);var $t=this._southWest,_e=this._northEast,ir=ft.getSouthWest(),Wr=ft.getNorthEast(),$n=Wr.lat>$t.lat&&ir.lat<_e.lat,na=Wr.lng>$t.lng&&ir.lng<_e.lng;return $n&&na},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(ft,$t){return ft?(ft=Bi(ft),this._southWest.equals(ft.getSouthWest(),$t)&&this._northEast.equals(ft.getNorthEast(),$t)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Bi(ft,$t){return ft instanceof qi?ft:new qi(ft,$t)}function Xi(ft,$t,_e){if(isNaN(ft)||isNaN($t))throw new Error("Invalid LatLng object: ("+ft+", "+$t+")");this.lat=+ft,this.lng=+$t,_e!==void 0&&(this.alt=+_e)}Xi.prototype={equals:function(ft,$t){if(!ft)return!1;ft=Yn(ft);var _e=Math.max(Math.abs(this.lat-ft.lat),Math.abs(this.lng-ft.lng));return _e<=($t===void 0?1e-9:$t)},toString:function(ft){return"LatLng("+pe(this.lat,ft)+", "+pe(this.lng,ft)+")"},distanceTo:function(ft){return aa.distance(this,Yn(ft))},wrap:function(){return aa.wrapLatLng(this)},toBounds:function(ft){var $t=180*ft/40075017,_e=$t/Math.cos(Math.PI/180*this.lat);return Bi([this.lat-$t,this.lng-_e],[this.lat+$t,this.lng+_e])},clone:function(){return new Xi(this.lat,this.lng,this.alt)}};function Yn(ft,$t,_e){return ft instanceof Xi?ft:rn(ft)&&typeof ft[0]!="object"?ft.length===3?new Xi(ft[0],ft[1],ft[2]):ft.length===2?new Xi(ft[0],ft[1]):null:ft==null?ft:typeof ft=="object"&&"lat"in ft?new Xi(ft.lat,"lng"in ft?ft.lng:ft.lon,ft.alt):$t===void 0?null:new Xi(ft,$t,_e)}var hi={latLngToPoint:function(ft,$t){var _e=this.projection.project(ft),ir=this.scale($t);return this.transformation._transform(_e,ir)},pointToLatLng:function(ft,$t){var _e=this.scale($t),ir=this.transformation.untransform(ft,_e);return this.projection.unproject(ir)},project:function(ft){return this.projection.project(ft)},unproject:function(ft){return this.projection.unproject(ft)},scale:function(ft){return 256*Math.pow(2,ft)},zoom:function(ft){return Math.log(ft/256)/Math.LN2},getProjectedBounds:function(ft){if(this.infinite)return null;var $t=this.projection.bounds,_e=this.scale(ft),ir=this.transformation.transform($t.min,_e),Wr=this.transformation.transform($t.max,_e);return new va(ir,Wr)},infinite:!1,wrapLatLng:function(ft){var $t=this.wrapLng?Ut(ft.lng,this.wrapLng,!0):ft.lng,_e=this.wrapLat?Ut(ft.lat,this.wrapLat,!0):ft.lat,ir=ft.alt;return new Xi(_e,$t,ir)},wrapLatLngBounds:function(ft){var $t=ft.getCenter(),_e=this.wrapLatLng($t),ir=$t.lat-_e.lat,Wr=$t.lng-_e.lng;if(ir===0&&Wr===0)return ft;var $n=ft.getSouthWest(),na=ft.getNorthEast(),eo=new Xi($n.lat-ir,$n.lng-Wr),fo=new Xi(na.lat-ir,na.lng-Wr);return new qi(eo,fo)}},aa=T({},hi,{wrapLng:[-180,180],R:6371e3,distance:function(ft,$t){var _e=Math.PI/180,ir=ft.lat*_e,Wr=$t.lat*_e,$n=Math.sin(($t.lat-ft.lat)*_e/2),na=Math.sin(($t.lng-ft.lng)*_e/2),eo=$n*$n+Math.cos(ir)*Math.cos(Wr)*na*na,fo=2*Math.atan2(Math.sqrt(eo),Math.sqrt(1-eo));return this.R*fo}}),io=6378137,oo={R:io,MAX_LATITUDE:85.0511287798,project:function(ft){var $t=Math.PI/180,_e=this.MAX_LATITUDE,ir=Math.max(Math.min(_e,ft.lat),-_e),Wr=Math.sin(ir*$t);return new Xn(this.R*ft.lng*$t,this.R*Math.log((1+Wr)/(1-Wr))/2)},unproject:function(ft){var $t=180/Math.PI;return new Xi((2*Math.atan(Math.exp(ft.y/this.R))-Math.PI/2)*$t,ft.x*$t/this.R)},bounds:function(){var ft=io*Math.PI;return new va([-ft,-ft],[ft,ft])}()};function xa(ft,$t,_e,ir){if(rn(ft)){this._a=ft[0],this._b=ft[1],this._c=ft[2],this._d=ft[3];return}this._a=ft,this._b=$t,this._c=_e,this._d=ir}xa.prototype={transform:function(ft,$t){return this._transform(ft.clone(),$t)},_transform:function(ft,$t){return $t=$t||1,ft.x=$t*(this._a*ft.x+this._b),ft.y=$t*(this._c*ft.y+this._d),ft},untransform:function(ft,$t){return $t=$t||1,new Xn((ft.x/$t-this._b)/this._a,(ft.y/$t-this._d)/this._c)}};function Ur(ft,$t,_e,ir){return new xa(ft,$t,_e,ir)}var Sn=T({},aa,{code:"EPSG:3857",projection:oo,transformation:function(){var ft=.5/(Math.PI*oo.R);return Ur(ft,.5,-ft,.5)}()}),Hn=T({},Sn,{code:"EPSG:900913"});function Qa(ft){return document.createElementNS("http://www.w3.org/2000/svg",ft)}function Ha(ft,$t){var _e="",ir,Wr,$n,na,eo,fo;for(ir=0,$n=ft.length;ir<$n;ir++){for(eo=ft[ir],Wr=0,na=eo.length;Wr1,o8=function(){var ft=!1;try{var $t=Object.defineProperty({},"passive",{get:function(){ft=!0}});window.addEventListener("testPassiveEventSupport",ne,$t),window.removeEventListener("testPassiveEventSupport",ne,$t)}catch{}return ft}(),s8=function(){return!!document.createElement("canvas").getContext}(),iw=!!(document.createElementNS&&Qa("svg").createSVGRect),l8=!!iw&&function(){var ft=document.createElement("div");return ft.innerHTML="",(ft.firstChild&&ft.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),c8=!iw&&function(){try{var ft=document.createElement("div");ft.innerHTML='';var $t=ft.firstChild;return $t.style.behavior="url(#default#VML)",$t&&typeof $t.adj=="object"}catch{return!1}}(),b4=navigator.platform.indexOf("Mac")===0,aw=navigator.platform.indexOf("Linux")===0;function W0(ft){return navigator.userAgent.toLowerCase().indexOf(ft)>=0}var Ul={ie:Mo,ielt9:Wo,edge:es,webkit:Po,android:Ys,android23:Jo,androidStock:Us,opera:Ac,chrome:Ou,gecko:Bu,safari:dp,phantom:Wf,opera12:V0,win:lm,ie3d:Hg,webkit3d:Y1,gecko3d:Np,any3d:cm,mobile:Vg,mobileWebkit:Yx,mobileWebkit3d:e8,msPointer:y4,pointer:_4,touch:r8,touchNative:x4,mobileOpera:n8,mobileGecko:i8,retina:a8,passiveEvents:o8,canvas:s8,svg:iw,vml:c8,inlineSvg:l8,mac:b4,linux:aw},sh=Ul.msPointer?"MSPointerDown":"pointerdown",qf=Ul.msPointer?"MSPointerMove":"pointermove",ow=Ul.msPointer?"MSPointerUp":"pointerup",nu=Ul.msPointer?"MSPointerCancel":"pointercancel",w_={touchstart:sh,touchmove:qf,touchend:ow,touchcancel:nu},w4={touchstart:d8,touchmove:Xm,touchend:Xm,touchcancel:Xm},X1={},Xx=!1;function k_(ft,$t,_e){return $t==="touchstart"&&sw(),w4[$t]?(_e=w4[$t].bind(this,_e),ft.addEventListener(w_[$t],_e,!1),_e):(console.warn("wrong event specified:",$t),ne)}function u8(ft,$t,_e){if(!w_[$t]){console.warn("wrong event specified:",$t);return}ft.removeEventListener(w_[$t],_e,!1)}function ls(ft){X1[ft.pointerId]=ft}function h8(ft){X1[ft.pointerId]&&(X1[ft.pointerId]=ft)}function T_(ft){delete X1[ft.pointerId]}function sw(){Xx||(document.addEventListener(sh,ls,!0),document.addEventListener(qf,h8,!0),document.addEventListener(ow,T_,!0),document.addEventListener(nu,T_,!0),Xx=!0)}function Xm(ft,$t){if($t.pointerType!==($t.MSPOINTER_TYPE_MOUSE||"mouse")){$t.touches=[];for(var _e in X1)$t.touches.push(X1[_e]);$t.changedTouches=[$t],ft($t)}}function d8(ft,$t){$t.MSPOINTER_TYPE_TOUCH&&$t.pointerType===$t.MSPOINTER_TYPE_TOUCH&&Cu($t),Xm(ft,$t)}function f8(ft){var $t={},_e,ir;for(ir in ft)_e=ft[ir],$t[ir]=_e&&_e.bind?_e.bind(ft):_e;return ft=$t,$t.type="dblclick",$t.detail=2,$t.isTrusted=!1,$t._simulated=!0,$t}var p8=200;function m8(ft,$t){ft.addEventListener("dblclick",$t);var _e=0,ir;function Wr($n){if($n.detail!==1){ir=$n.detail;return}if(!($n.pointerType==="mouse"||$n.sourceCapabilities&&!$n.sourceCapabilities.firesTouchEvents)){var na=C4($n);if(!(na.some(function(fo){return fo instanceof HTMLLabelElement&&fo.attributes.for})&&!na.some(function(fo){return fo instanceof HTMLInputElement||fo instanceof HTMLSelectElement}))){var eo=Date.now();eo-_e<=p8?(ir++,ir===2&&$t(f8($n))):ir=1,_e=eo}}}return ft.addEventListener("click",Wr),{dblclick:$t,simDblclick:Wr}}function lw(ft,$t){ft.removeEventListener("dblclick",$t.dblclick),ft.removeEventListener("click",$t.simDblclick)}var cw=Gg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),S_=Gg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),k4=S_==="webkitTransition"||S_==="OTransition"?S_+"End":"transitionend";function T4(ft){return typeof ft=="string"?document.getElementById(ft):ft}function C_(ft,$t){var _e=ft.style[$t]||ft.currentStyle&&ft.currentStyle[$t];if((!_e||_e==="auto")&&document.defaultView){var ir=document.defaultView.getComputedStyle(ft,null);_e=ir?ir[$t]:null}return _e==="auto"?null:_e}function $u(ft,$t,_e){var ir=document.createElement(ft);return ir.className=$t||"",_e&&_e.appendChild(ir),ir}function Bd(ft){var $t=ft.parentNode;$t&&$t.removeChild(ft)}function Jx(ft){for(;ft.firstChild;)ft.removeChild(ft.firstChild)}function J1(ft){var $t=ft.parentNode;$t&&$t.lastChild!==ft&&$t.appendChild(ft)}function jn(ft){var $t=ft.parentNode;$t&&$t.firstChild!==ft&&$t.insertBefore(ft,$t.firstChild)}function uw(ft,$t){if(ft.classList!==void 0)return ft.classList.contains($t);var _e=qg(ft);return _e.length>0&&new RegExp("(^|\\s)"+$t+"(\\s|$)").test(_e)}function Qc(ft,$t){if(ft.classList!==void 0)for(var _e=we($t),ir=0,Wr=_e.length;ir0?2*window.devicePixelRatio:1;function Fu(ft){return Ul.edge?ft.wheelDeltaY/2:ft.deltaY&&ft.deltaMode===0?-ft.deltaY/ch:ft.deltaY&&ft.deltaMode===1?-ft.deltaY*20:ft.deltaY&&ft.deltaMode===2?-ft.deltaY*60:ft.deltaX||ft.deltaZ?0:ft.wheelDelta?(ft.wheelDeltaY||ft.wheelDelta)/2:ft.detail&&Math.abs(ft.detail)<32765?-ft.detail*20:ft.detail?ft.detail/-32765*60:0}function Hv(ft,$t){var _e=$t.relatedTarget;if(!_e)return!0;try{for(;_e&&_e!==ft;)_e=_e.parentNode}catch{return!1}return _e!==ft}var T0={__proto__:null,on:Hc,off:Xh,stopPropagation:q0,disableScrollPropagation:Sg,disableClickPropagation:Q1,preventDefault:Cu,stop:$v,getPropagationPath:C4,getMousePosition:Cp,getWheelDelta:Fu,isExternalTarget:Hv,addListener:Hc,removeListener:Xh},E_=Cn.extend({run:function(ft,$t,_e,ir){this.stop(),this._el=ft,this._inProgress=!0,this._duration=_e||.25,this._easeOutPower=1/Math.max(ir||.5,.2),this._startPos=Ku(ft),this._offset=$t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=on(this._animate,this),this._step()},_step:function(ft){var $t=+new Date-this._startTime,_e=this._duration*1e3;$t<_e?this._runFrame(this._easeOut($t/_e),ft):(this._runFrame(1),this._complete())},_runFrame:function(ft,$t){var _e=this._startPos.add(this._offset.multiplyBy(ft));$t&&_e._round(),fu(this._el,_e),this.fire("step")},_complete:function(){pr(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(ft){return 1-Math.pow(1-ft,this._easeOutPower)}}),Nu=Cn.extend({options:{crs:Sn,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(ft,$t){$t=Ce(this,$t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(ft),this._initLayout(),this._onResize=K(this._onResize,this),this._initEvents(),$t.maxBounds&&this.setMaxBounds($t.maxBounds),$t.zoom!==void 0&&(this._zoom=this._limitZoom($t.zoom)),$t.center&&$t.zoom!==void 0&&this.setView(Yn($t.center),$t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=S_&&Ul.any3d&&!Ul.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Hc(this._proxy,k4,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(ft,$t,_e){if($t=$t===void 0?this._zoom:this._limitZoom($t),ft=this._limitCenter(Yn(ft),$t,this.options.maxBounds),_e=_e||{},this._stop(),this._loaded&&!_e.reset&&_e!==!0){_e.animate!==void 0&&(_e.zoom=T({animate:_e.animate},_e.zoom),_e.pan=T({animate:_e.animate,duration:_e.duration},_e.pan));var ir=this._zoom!==$t?this._tryAnimatedZoom&&this._tryAnimatedZoom(ft,$t,_e.zoom):this._tryAnimatedPan(ft,_e.pan);if(ir)return clearTimeout(this._sizeTimer),this}return this._resetView(ft,$t,_e.pan&&_e.pan.noMoveStart),this},setZoom:function(ft,$t){return this._loaded?this.setView(this.getCenter(),ft,{zoom:$t}):(this._zoom=ft,this)},zoomIn:function(ft,$t){return ft=ft||(Ul.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+ft,$t)},zoomOut:function(ft,$t){return ft=ft||(Ul.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-ft,$t)},setZoomAround:function(ft,$t,_e){var ir=this.getZoomScale($t),Wr=this.getSize().divideBy(2),$n=ft instanceof Xn?ft:this.latLngToContainerPoint(ft),na=$n.subtract(Wr).multiplyBy(1-1/ir),eo=this.containerPointToLatLng(Wr.add(na));return this.setView(eo,$t,{zoom:_e})},_getBoundsCenterZoom:function(ft,$t){$t=$t||{},ft=ft.getBounds?ft.getBounds():Bi(ft);var _e=ta($t.paddingTopLeft||$t.padding||[0,0]),ir=ta($t.paddingBottomRight||$t.padding||[0,0]),Wr=this.getBoundsZoom(ft,!1,_e.add(ir));if(Wr=typeof $t.maxZoom=="number"?Math.min($t.maxZoom,Wr):Wr,Wr===1/0)return{center:ft.getCenter(),zoom:Wr};var $n=ir.subtract(_e).divideBy(2),na=this.project(ft.getSouthWest(),Wr),eo=this.project(ft.getNorthEast(),Wr),fo=this.unproject(na.add(eo).divideBy(2).add($n),Wr);return{center:fo,zoom:Wr}},fitBounds:function(ft,$t){if(ft=Bi(ft),!ft.isValid())throw new Error("Bounds are not valid.");var _e=this._getBoundsCenterZoom(ft,$t);return this.setView(_e.center,_e.zoom,$t)},fitWorld:function(ft){return this.fitBounds([[-90,-180],[90,180]],ft)},panTo:function(ft,$t){return this.setView(ft,this._zoom,{pan:$t})},panBy:function(ft,$t){if(ft=ta(ft).round(),$t=$t||{},!ft.x&&!ft.y)return this.fire("moveend");if($t.animate!==!0&&!this.getSize().contains(ft))return this._resetView(this.unproject(this.project(this.getCenter()).add(ft)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new E_,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),$t.noMoveStart||this.fire("movestart"),$t.animate!==!1){Qc(this._mapPane,"leaflet-pan-anim");var _e=this._getMapPanePos().subtract(ft).round();this._panAnim.run(this._mapPane,_e,$t.duration||.25,$t.easeLinearity)}else this._rawPanBy(ft),this.fire("move").fire("moveend");return this},flyTo:function(ft,$t,_e){if(_e=_e||{},_e.animate===!1||!Ul.any3d)return this.setView(ft,$t,_e);this._stop();var ir=this.project(this.getCenter()),Wr=this.project(ft),$n=this.getSize(),na=this._zoom;ft=Yn(ft),$t=$t===void 0?na:$t;var eo=Math.max($n.x,$n.y),fo=eo*this.getZoomScale(na,$t),Do=Wr.distanceTo(ir)||1,tl=1.42,Il=tl*tl;function qc(Ef){var mb=Ef?-1:1,Lw=Ef?fo:eo,A8=fo*fo-eo*eo+mb*Il*Il*Do*Do,W4=2*Lw*Il*Do,Pw=A8/W4,q4=Math.sqrt(Pw*Pw+1)-Pw,M8=q4<1e-9?-18:Math.log(q4);return M8}function Kf(Ef){return(Math.exp(Ef)-Math.exp(-Ef))/2}function Qd(Ef){return(Math.exp(Ef)+Math.exp(-Ef))/2}function mm(Ef){return Kf(Ef)/Qd(Ef)}var c0=qc(0);function Jg(Ef){return eo*(Qd(c0)/Qd(c0+tl*Ef))}function fb(Ef){return eo*(Qd(c0)*mm(c0+tl*Ef)-Kf(c0))/Il}function pb(Ef){return 1-Math.pow(1-Ef,1.5)}var Ew=Date.now(),V4=(qc(1)-c0)/tl,C8=_e.duration?1e3*_e.duration:1e3*V4*.8;function Fd(){var Ef=(Date.now()-Ew)/C8,mb=pb(Ef)*V4;Ef<=1?(this._flyToFrame=on(Fd,this),this._move(this.unproject(ir.add(Wr.subtract(ir).multiplyBy(fb(mb)/Do)),na),this.getScaleZoom(eo/Jg(mb),na),{flyTo:!0})):this._move(ft,$t)._moveEnd(!0)}return this._moveStart(!0,_e.noMoveStart),Fd.call(this),this},flyToBounds:function(ft,$t){var _e=this._getBoundsCenterZoom(ft,$t);return this.flyTo(_e.center,_e.zoom,$t)},setMaxBounds:function(ft){return ft=Bi(ft),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),ft.isValid()?(this.options.maxBounds=ft,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(ft){var $t=this.options.minZoom;return this.options.minZoom=ft,this._loaded&&$t!==ft&&(this.fire("zoomlevelschange"),this.getZoom()this.options.maxZoom)?this.setZoom(ft):this},panInsideBounds:function(ft,$t){this._enforcingBounds=!0;var _e=this.getCenter(),ir=this._limitCenter(_e,this._zoom,Bi(ft));return _e.equals(ir)||this.panTo(ir,$t),this._enforcingBounds=!1,this},panInside:function(ft,$t){$t=$t||{};var _e=ta($t.paddingTopLeft||$t.padding||[0,0]),ir=ta($t.paddingBottomRight||$t.padding||[0,0]),Wr=this.project(this.getCenter()),$n=this.project(ft),na=this.getPixelBounds(),eo=_a([na.min.add(_e),na.max.subtract(ir)]),fo=eo.getSize();if(!eo.contains($n)){this._enforcingBounds=!0;var Do=$n.subtract(eo.getCenter()),tl=eo.extend($n).getSize().subtract(fo);Wr.x+=Do.x<0?-tl.x:tl.x,Wr.y+=Do.y<0?-tl.y:tl.y,this.panTo(this.unproject(Wr),$t),this._enforcingBounds=!1}return this},invalidateSize:function(ft){if(!this._loaded)return this;ft=T({animate:!1,pan:!0},ft===!0?{animate:!0}:ft);var $t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var _e=this.getSize(),ir=$t.divideBy(2).round(),Wr=_e.divideBy(2).round(),$n=ir.subtract(Wr);return!$n.x&&!$n.y?this:(ft.animate&&ft.pan?this.panBy($n):(ft.pan&&this._rawPanBy($n),this.fire("move"),ft.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(K(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:$t,newSize:_e}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(ft){if(ft=this._locateOptions=T({timeout:1e4,watch:!1},ft),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var $t=K(this._handleGeolocationResponse,this),_e=K(this._handleGeolocationError,this);return ft.watch?this._locationWatchId=navigator.geolocation.watchPosition($t,_e,ft):navigator.geolocation.getCurrentPosition($t,_e,ft),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(ft){if(this._container._leaflet_id){var $t=ft.code,_e=ft.message||($t===1?"permission denied":$t===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:$t,message:"Geolocation error: "+_e+"."})}},_handleGeolocationResponse:function(ft){if(this._container._leaflet_id){var $t=ft.coords.latitude,_e=ft.coords.longitude,ir=new Xi($t,_e),Wr=ir.toBounds(ft.coords.accuracy*2),$n=this._locateOptions;if($n.setView){var na=this.getBoundsZoom(Wr);this.setView(ir,$n.maxZoom?Math.min(na,$n.maxZoom):na)}var eo={latlng:ir,bounds:Wr,timestamp:ft.timestamp};for(var fo in ft.coords)typeof ft.coords[fo]=="number"&&(eo[fo]=ft.coords[fo]);this.fire("locationfound",eo)}},addHandler:function(ft,$t){if(!$t)return this;var _e=this[ft]=new $t(this);return this._handlers.push(_e),this.options[ft]&&_e.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Bd(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(pr(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var ft;for(ft in this._layers)this._layers[ft].remove();for(ft in this._panes)Bd(this._panes[ft]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(ft,$t){var _e="leaflet-pane"+(ft?" leaflet-"+ft.replace("Pane","")+"-pane":""),ir=$u("div",_e,$t||this._mapPane);return ft&&(this._panes[ft]=ir),ir},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var ft=this.getPixelBounds(),$t=this.unproject(ft.getBottomLeft()),_e=this.unproject(ft.getTopRight());return new qi($t,_e)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(ft,$t,_e){ft=Bi(ft),_e=ta(_e||[0,0]);var ir=this.getZoom()||0,Wr=this.getMinZoom(),$n=this.getMaxZoom(),na=ft.getNorthWest(),eo=ft.getSouthEast(),fo=this.getSize().subtract(_e),Do=_a(this.project(eo,ir),this.project(na,ir)).getSize(),tl=Ul.any3d?this.options.zoomSnap:1,Il=fo.x/Do.x,qc=fo.y/Do.y,Kf=$t?Math.max(Il,qc):Math.min(Il,qc);return ir=this.getScaleZoom(Kf,ir),tl&&(ir=Math.round(ir/(tl/100))*(tl/100),ir=$t?Math.ceil(ir/tl)*tl:Math.floor(ir/tl)*tl),Math.max(Wr,Math.min($n,ir))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Xn(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(ft,$t){var _e=this._getTopLeftPoint(ft,$t);return new va(_e,_e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(ft){return this.options.crs.getProjectedBounds(ft===void 0?this.getZoom():ft)},getPane:function(ft){return typeof ft=="string"?this._panes[ft]:ft},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(ft,$t){var _e=this.options.crs;return $t=$t===void 0?this._zoom:$t,_e.scale(ft)/_e.scale($t)},getScaleZoom:function(ft,$t){var _e=this.options.crs;$t=$t===void 0?this._zoom:$t;var ir=_e.zoom(ft*_e.scale($t));return isNaN(ir)?1/0:ir},project:function(ft,$t){return $t=$t===void 0?this._zoom:$t,this.options.crs.latLngToPoint(Yn(ft),$t)},unproject:function(ft,$t){return $t=$t===void 0?this._zoom:$t,this.options.crs.pointToLatLng(ta(ft),$t)},layerPointToLatLng:function(ft){var $t=ta(ft).add(this.getPixelOrigin());return this.unproject($t)},latLngToLayerPoint:function(ft){var $t=this.project(Yn(ft))._round();return $t._subtract(this.getPixelOrigin())},wrapLatLng:function(ft){return this.options.crs.wrapLatLng(Yn(ft))},wrapLatLngBounds:function(ft){return this.options.crs.wrapLatLngBounds(Bi(ft))},distance:function(ft,$t){return this.options.crs.distance(Yn(ft),Yn($t))},containerPointToLayerPoint:function(ft){return ta(ft).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(ft){return ta(ft).add(this._getMapPanePos())},containerPointToLatLng:function(ft){var $t=this.containerPointToLayerPoint(ta(ft));return this.layerPointToLatLng($t)},latLngToContainerPoint:function(ft){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Yn(ft)))},mouseEventToContainerPoint:function(ft){return Cp(ft,this._container)},mouseEventToLayerPoint:function(ft){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(ft))},mouseEventToLatLng:function(ft){return this.layerPointToLatLng(this.mouseEventToLayerPoint(ft))},_initContainer:function(ft){var $t=this._container=T4(ft);if($t){if($t._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Hc($t,"scroll",this._onScroll,this),this._containerId=yt($t)},_initLayout:function(){var ft=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ul.any3d,Qc(ft,"leaflet-container"+(Ul.touch?" leaflet-touch":"")+(Ul.retina?" leaflet-retina":"")+(Ul.ielt9?" leaflet-oldie":"")+(Ul.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var $t=C_(ft,"position");$t!=="absolute"&&$t!=="relative"&&$t!=="fixed"&&$t!=="sticky"&&(ft.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var ft=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),fu(this._mapPane,new Xn(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Qc(ft.markerPane,"leaflet-zoom-hide"),Qc(ft.shadowPane,"leaflet-zoom-hide"))},_resetView:function(ft,$t,_e){fu(this._mapPane,new Xn(0,0));var ir=!this._loaded;this._loaded=!0,$t=this._limitZoom($t),this.fire("viewprereset");var Wr=this._zoom!==$t;this._moveStart(Wr,_e)._move(ft,$t)._moveEnd(Wr),this.fire("viewreset"),ir&&this.fire("load")},_moveStart:function(ft,$t){return ft&&this.fire("zoomstart"),$t||this.fire("movestart"),this},_move:function(ft,$t,_e,ir){$t===void 0&&($t=this._zoom);var Wr=this._zoom!==$t;return this._zoom=$t,this._lastCenter=ft,this._pixelOrigin=this._getNewPixelOrigin(ft),ir?_e&&_e.pinch&&this.fire("zoom",_e):((Wr||_e&&_e.pinch)&&this.fire("zoom",_e),this.fire("move",_e)),this},_moveEnd:function(ft){return ft&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return pr(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(ft){fu(this._mapPane,this._getMapPanePos().subtract(ft))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(ft){this._targets={},this._targets[yt(this._container)]=this;var $t=ft?Xh:Hc;$t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&$t(window,"resize",this._onResize,this),Ul.any3d&&this.options.transform3DLimit&&(ft?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){pr(this._resizeRequest),this._resizeRequest=on(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var ft=this._getMapPanePos();Math.max(Math.abs(ft.x),Math.abs(ft.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(ft,$t){for(var _e=[],ir,Wr=$t==="mouseout"||$t==="mouseover",$n=ft.target||ft.srcElement,na=!1;$n;){if(ir=this._targets[yt($n)],ir&&($t==="click"||$t==="preclick")&&this._draggableMoved(ir)){na=!0;break}if(ir&&ir.listens($t,!0)&&(Wr&&!Hv($n,ft)||(_e.push(ir),Wr))||$n===this._container)break;$n=$n.parentNode}return!_e.length&&!na&&!Wr&&this.listens($t,!0)&&(_e=[this]),_e},_isClickDisabled:function(ft){for(;ft&&ft!==this._container;){if(ft._leaflet_disable_click)return!0;ft=ft.parentNode}},_handleDOMEvent:function(ft){var $t=ft.target||ft.srcElement;if(!(!this._loaded||$t._leaflet_disable_events||ft.type==="click"&&this._isClickDisabled($t))){var _e=ft.type;_e==="mousedown"&&fp($t),this._fireDOMEvent(ft,_e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(ft,$t,_e){if(ft.type==="click"){var ir=T({},ft);ir.type="preclick",this._fireDOMEvent(ir,ir.type,_e)}var Wr=this._findEventTargets(ft,$t);if(_e){for(var $n=[],na=0;na<_e.length;na++)_e[na].listens($t,!0)&&$n.push(_e[na]);Wr=$n.concat(Wr)}if(Wr.length){$t==="contextmenu"&&Cu(ft);var eo=Wr[0],fo={originalEvent:ft};if(ft.type!=="keypress"&&ft.type!=="keydown"&&ft.type!=="keyup"){var Do=eo.getLatLng&&(!eo._radius||eo._radius<=10);fo.containerPoint=Do?this.latLngToContainerPoint(eo.getLatLng()):this.mouseEventToContainerPoint(ft),fo.layerPoint=this.containerPointToLayerPoint(fo.containerPoint),fo.latlng=Do?eo.getLatLng():this.layerPointToLatLng(fo.layerPoint)}for(na=0;na0?Math.round(ft-$t)/2:Math.max(0,Math.ceil(ft))-Math.max(0,Math.floor($t))},_limitZoom:function(ft){var $t=this.getMinZoom(),_e=this.getMaxZoom(),ir=Ul.any3d?this.options.zoomSnap:1;return ir&&(ft=Math.round(ft/ir)*ir),Math.max($t,Math.min(_e,ft))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Jd(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(ft,$t){var _e=this._getCenterOffset(ft)._trunc();return($t&&$t.animate)!==!0&&!this.getSize().contains(_e)?!1:(this.panBy(_e,$t),!0)},_createAnimProxy:function(){var ft=this._proxy=$u("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(ft),this.on("zoomanim",function($t){var _e=cw,ir=this._proxy.style[_e];Tc(this._proxy,this.project($t.center,$t.zoom),this.getZoomScale($t.zoom,1)),ir===this._proxy.style[_e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Bd(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var ft=this.getCenter(),$t=this.getZoom();Tc(this._proxy,this.project(ft,$t),this.getZoomScale($t,1))},_catchTransitionEnd:function(ft){this._animatingZoom&&ft.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(ft,$t,_e){if(this._animatingZoom)return!0;if(_e=_e||{},!this._zoomAnimated||_e.animate===!1||this._nothingToAnimate()||Math.abs($t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var ir=this.getZoomScale($t),Wr=this._getCenterOffset(ft)._divideBy(1-1/ir);return _e.animate!==!0&&!this.getSize().contains(Wr)?!1:(on(function(){this._moveStart(!0,_e.noMoveStart||!1)._animateZoom(ft,$t,!0)},this),!0)},_animateZoom:function(ft,$t,_e,ir){this._mapPane&&(_e&&(this._animatingZoom=!0,this._animateToCenter=ft,this._animateToZoom=$t,Qc(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:ft,zoom:$t,noUpdate:ir}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(K(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Jd(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Js(ft,$t){return new Nu(ft,$t)}var jp=Sr.extend({options:{position:"topright"},initialize:function(ft){Ce(this,ft)},getPosition:function(){return this.options.position},setPosition:function(ft){var $t=this._map;return $t&&$t.removeControl(this),this.options.position=ft,$t&&$t.addControl(this),this},getContainer:function(){return this._container},addTo:function(ft){this.remove(),this._map=ft;var $t=this._container=this.onAdd(ft),_e=this.getPosition(),ir=ft._controlCorners[_e];return Qc($t,"leaflet-control"),_e.indexOf("bottom")!==-1?ir.insertBefore($t,ir.firstChild):ir.appendChild($t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Bd(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(ft){this._map&&ft&&ft.screenX>0&&ft.screenY>0&&this._map.getContainer().focus()}}),G0=function(ft){return new jp(ft)};Nu.include({addControl:function(ft){return ft.addTo(this),this},removeControl:function(ft){return ft.remove(),this},_initControlPos:function(){var ft=this._controlCorners={},$t="leaflet-",_e=this._controlContainer=$u("div",$t+"control-container",this._container);function ir(Wr,$n){var na=$t+Wr+" "+$t+$n;ft[Wr+$n]=$u("div",na,_e)}ir("top","left"),ir("top","right"),ir("bottom","left"),ir("bottom","right")},_clearControlPos:function(){for(var ft in this._controlCorners)Bd(this._controlCorners[ft]);Bd(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ty=jp.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(ft,$t,_e,ir){return _e1,this._baseLayersList.style.display=ft?"":"none"),this._separator.style.display=$t&&ft?"":"none",this},_onLayerChange:function(ft){this._handlingClick||this._update();var $t=this._getLayer(yt(ft.target)),_e=$t.overlay?ft.type==="add"?"overlayadd":"overlayremove":ft.type==="add"?"baselayerchange":null;_e&&this._map.fire(_e,$t)},_createRadioElement:function(ft,$t){var _e='",ir=document.createElement("div");return ir.innerHTML=_e,ir.firstChild},_addItem:function(ft){var $t=document.createElement("label"),_e=this._map.hasLayer(ft.layer),ir;ft.overlay?(ir=document.createElement("input"),ir.type="checkbox",ir.className="leaflet-control-layers-selector",ir.defaultChecked=_e):ir=this._createRadioElement("leaflet-base-layers_"+yt(this),_e),this._layerControlInputs.push(ir),ir.layerId=yt(ft.layer),Hc(ir,"click",this._onInputClick,this);var Wr=document.createElement("span");Wr.innerHTML=" "+ft.name;var $n=document.createElement("span");$t.appendChild($n),$n.appendChild(ir),$n.appendChild(Wr);var na=ft.overlay?this._overlaysList:this._baseLayersList;return na.appendChild($t),this._checkDisabledLayers(),$t},_onInputClick:function(){if(!this._preventClick){var ft=this._layerControlInputs,$t,_e,ir=[],Wr=[];this._handlingClick=!0;for(var $n=ft.length-1;$n>=0;$n--)$t=ft[$n],_e=this._getLayer($t.layerId).layer,$t.checked?ir.push(_e):$t.checked||Wr.push(_e);for($n=0;$n=0;Wr--)$t=ft[Wr],_e=this._getLayer($t.layerId).layer,$t.disabled=_e.options.minZoom!==void 0&&ir<_e.options.minZoom||_e.options.maxZoom!==void 0&&ir>_e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var ft=this._section;this._preventClick=!0,Hc(ft,"click",Cu),this.expand();var $t=this;setTimeout(function(){Xh(ft,"click",Cu),$t._preventClick=!1})}}),Jm=function(ft,$t,_e){return new ty(ft,$t,_e)},Fs=jp.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(ft){var $t="leaflet-control-zoom",_e=$u("div",$t+" leaflet-bar"),ir=this.options;return this._zoomInButton=this._createButton(ir.zoomInText,ir.zoomInTitle,$t+"-in",_e,this._zoomIn),this._zoomOutButton=this._createButton(ir.zoomOutText,ir.zoomOutTitle,$t+"-out",_e,this._zoomOut),this._updateDisabled(),ft.on("zoomend zoomlevelschange",this._updateDisabled,this),_e},onRemove:function(ft){ft.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(ft){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(ft.shiftKey?3:1))},_createButton:function(ft,$t,_e,ir,Wr){var $n=$u("a",_e,ir);return $n.innerHTML=ft,$n.href="#",$n.title=$t,$n.setAttribute("role","button"),$n.setAttribute("aria-label",$t),Q1($n),Hc($n,"click",$v),Hc($n,"click",Wr,this),Hc($n,"click",this._refocusOnMap,this),$n},_updateDisabled:function(){var ft=this._map,$t="leaflet-disabled";Jd(this._zoomInButton,$t),Jd(this._zoomOutButton,$t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||ft._zoom===ft.getMinZoom())&&(Qc(this._zoomOutButton,$t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||ft._zoom===ft.getMaxZoom())&&(Qc(this._zoomInButton,$t),this._zoomInButton.setAttribute("aria-disabled","true"))}});Nu.mergeOptions({zoomControl:!0}),Nu.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Fs,this.addControl(this.zoomControl))});var A4=function(ft){return new Fs(ft)},hw=jp.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(ft){var $t="leaflet-control-scale",_e=$u("div",$t),ir=this.options;return this._addScales(ir,$t+"-line",_e),ft.on(ir.updateWhenIdle?"moveend":"move",this._update,this),ft.whenReady(this._update,this),_e},onRemove:function(ft){ft.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(ft,$t,_e){ft.metric&&(this._mScale=$u("div",$t,_e)),ft.imperial&&(this._iScale=$u("div",$t,_e))},_update:function(){var ft=this._map,$t=ft.getSize().y/2,_e=ft.distance(ft.containerPointToLatLng([0,$t]),ft.containerPointToLatLng([this.options.maxWidth,$t]));this._updateScales(_e)},_updateScales:function(ft){this.options.metric&&ft&&this._updateMetric(ft),this.options.imperial&&ft&&this._updateImperial(ft)},_updateMetric:function(ft){var $t=this._getRoundNum(ft),_e=$t<1e3?$t+" m":$t/1e3+" km";this._updateScale(this._mScale,_e,$t/ft)},_updateImperial:function(ft){var $t=ft*3.2808399,_e,ir,Wr;$t>5280?(_e=$t/5280,ir=this._getRoundNum(_e),this._updateScale(this._iScale,ir+" mi",ir/_e)):(Wr=this._getRoundNum($t),this._updateScale(this._iScale,Wr+" ft",Wr/$t))},_updateScale:function(ft,$t,_e){ft.style.width=Math.round(this.options.maxWidth*_e)+"px",ft.innerHTML=$t},_getRoundNum:function(ft){var $t=Math.pow(10,(Math.floor(ft)+"").length-1),_e=ft/$t;return _e=_e>=10?10:_e>=5?5:_e>=3?3:_e>=2?2:1,$t*_e}}),g8=function(ft){return new hw(ft)},dw='',fw=jp.extend({options:{position:"bottomright",prefix:''+(Ul.inlineSvg?dw+" ":"")+"Leaflet"},initialize:function(ft){Ce(this,ft),this._attributions={}},onAdd:function(ft){ft.attributionControl=this,this._container=$u("div","leaflet-control-attribution"),Q1(this._container);for(var $t in ft._layers)ft._layers[$t].getAttribution&&this.addAttribution(ft._layers[$t].getAttribution());return this._update(),ft.on("layeradd",this._addAttribution,this),this._container},onRemove:function(ft){ft.off("layeradd",this._addAttribution,this)},_addAttribution:function(ft){ft.layer.getAttribution&&(this.addAttribution(ft.layer.getAttribution()),ft.layer.once("remove",function(){this.removeAttribution(ft.layer.getAttribution())},this))},setPrefix:function(ft){return this.options.prefix=ft,this._update(),this},addAttribution:function(ft){return ft?(this._attributions[ft]||(this._attributions[ft]=0),this._attributions[ft]++,this._update(),this):this},removeAttribution:function(ft){return ft?(this._attributions[ft]&&(this._attributions[ft]--,this._update()),this):this},_update:function(){if(this._map){var ft=[];for(var $t in this._attributions)this._attributions[$t]&&ft.push($t);var _e=[];this.options.prefix&&_e.push(this.options.prefix),ft.length&&_e.push(ft.join(", ")),this._container.innerHTML=_e.join(' ')}}});Nu.mergeOptions({attributionControl:!0}),Nu.addInitHook(function(){this.options.attributionControl&&new fw().addTo(this)});var v8=function(ft){return new fw(ft)};jp.Layers=ty,jp.Zoom=Fs,jp.Scale=hw,jp.Attribution=fw,G0.layers=Jm,G0.zoom=A4,G0.scale=g8,G0.attribution=v8;var Qm=Sr.extend({initialize:function(ft){this._map=ft},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Qm.addTo=function(ft,$t){return ft.addHandler($t,this),this};var Up={Events:nn},Mm=Ul.touch?"touchstart mousedown":"mousedown",Zg=Cn.extend({options:{clickTolerance:3},initialize:function(ft,$t,_e,ir){Ce(this,ir),this._element=ft,this._dragStartTarget=$t||ft,this._preventOutline=_e},enable:function(){this._enabled||(Hc(this._dragStartTarget,Mm,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Zg._dragging===this&&this.finishDrag(!0),Xh(this._dragStartTarget,Mm,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(ft){if(this._enabled&&(this._moved=!1,!uw(this._element,"leaflet-zoom-anim"))){if(ft.touches&&ft.touches.length!==1){Zg._dragging===this&&this.finishDrag();return}if(!(Zg._dragging||ft.shiftKey||ft.which!==1&&ft.button!==1&&!ft.touches)&&(Zg._dragging=this,this._preventOutline&&fp(this._element),lh(),Cm(),!this._moving)){this.fire("down");var $t=ft.touches?ft.touches[0]:ft,_e=Gf(this._element);this._startPoint=new Xn($t.clientX,$t.clientY),this._startPos=Ku(this._element),this._parentScale=M_(_e);var ir=ft.type==="mousedown";Hc(document,ir?"mousemove":"touchmove",this._onMove,this),Hc(document,ir?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(ft){if(this._enabled){if(ft.touches&&ft.touches.length>1){this._moved=!0;return}var $t=ft.touches&&ft.touches.length===1?ft.touches[0]:ft,_e=new Xn($t.clientX,$t.clientY)._subtract(this._startPoint);!_e.x&&!_e.y||Math.abs(_e.x)+Math.abs(_e.y)$n&&(na=eo,$n=fo);$n>_e&&($t[na]=1,Wv(ft,$t,_e,ir,na),Wv(ft,$t,_e,na,Wr))}function E4(ft,$t){for(var _e=[ft[0]],ir=1,Wr=0,$n=ft.length;ir<$n;ir++)x8(ft[ir],ft[Wr])>$t&&(_e.push(ft[ir]),Wr=ir);return Wr<$n-1&&_e.push(ft[$n-1]),_e}var gw;function vw(ft,$t,_e,ir,Wr){var $n=ir?gw:Gv(ft,_e),na=Gv($t,_e),eo,fo,Do;for(gw=na;;){if(!($n|na))return[ft,$t];if($n&na)return!1;eo=$n||na,fo=qv(ft,$t,eo,_e,Wr),Do=Gv(fo,_e),eo===$n?(ft=fo,$n=Do):($t=fo,na=Do)}}function qv(ft,$t,_e,ir,Wr){var $n=$t.x-ft.x,na=$t.y-ft.y,eo=ir.min,fo=ir.max,Do,tl;return _e&8?(Do=ft.x+$n*(fo.y-ft.y)/na,tl=fo.y):_e&4?(Do=ft.x+$n*(eo.y-ft.y)/na,tl=eo.y):_e&2?(Do=fo.x,tl=ft.y+na*(fo.x-ft.x)/$n):_e&1&&(Do=eo.x,tl=ft.y+na*(eo.x-ft.x)/$n),new Xn(Do,tl,Wr)}function Gv(ft,$t){var _e=0;return ft.x<$t.min.x?_e|=1:ft.x>$t.max.x&&(_e|=2),ft.y<$t.min.y?_e|=4:ft.y>$t.max.y&&(_e|=8),_e}function x8(ft,$t){var _e=$t.x-ft.x,ir=$t.y-ft.y;return _e*_e+ir*ir}function ey(ft,$t,_e,ir){var Wr=$t.x,$n=$t.y,na=_e.x-Wr,eo=_e.y-$n,fo=na*na+eo*eo,Do;return fo>0&&(Do=((ft.x-Wr)*na+(ft.y-$n)*eo)/fo,Do>1?(Wr=_e.x,$n=_e.y):Do>0&&(Wr+=na*Do,$n+=eo*Do)),na=ft.x-Wr,eo=ft.y-$n,ir?na*na+eo*eo:new Xn(Wr,$n)}function hm(ft){return!rn(ft[0])||typeof ft[0][0]!="object"&&typeof ft[0][0]<"u"}function L4(ft){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),hm(ft)}function P4(ft,$t){var _e,ir,Wr,$n,na,eo,fo,Do;if(!ft||ft.length===0)throw new Error("latlngs not passed");hm(ft)||(console.warn("latlngs are not flat! Only the first ring will be used"),ft=ft[0]);var tl=Yn([0,0]),Il=Bi(ft),qc=Il.getNorthWest().distanceTo(Il.getSouthWest())*Il.getNorthEast().distanceTo(Il.getNorthWest());qc<1700&&(tl=eb(ft));var Kf=ft.length,Qd=[];for(_e=0;_eir){fo=($n-ir)/Wr,Do=[eo.x-fo*(eo.x-na.x),eo.y-fo*(eo.y-na.y)];break}var c0=$t.unproject(ta(Do));return Yn([c0.lat+tl.lat,c0.lng+tl.lng])}var hd={__proto__:null,simplify:mw,pointToSegmentDistance:M4,closestPointOnSegment:Vv,clipSegment:vw,_getEdgeIntersection:qv,_getBitCode:Gv,_sqClosestPointOnSegment:ey,isFlat:hm,_flat:L4,polylineCenter:P4},dm={project:function(ft){return new Xn(ft.lng,ft.lat)},unproject:function(ft){return new Xi(ft.y,ft.x)},bounds:new va([-180,-90],[180,90])},ry={R:6378137,R_MINOR:6356752314245179e-9,bounds:new va([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(ft){var $t=Math.PI/180,_e=this.R,ir=ft.lat*$t,Wr=this.R_MINOR/_e,$n=Math.sqrt(1-Wr*Wr),na=$n*Math.sin(ir),eo=Math.tan(Math.PI/4-ir/2)/Math.pow((1-na)/(1+na),$n/2);return ir=-_e*Math.log(Math.max(eo,1e-10)),new Xn(ft.lng*$t*_e,ir)},unproject:function(ft){for(var $t=180/Math.PI,_e=this.R,ir=this.R_MINOR/_e,Wr=Math.sqrt(1-ir*ir),$n=Math.exp(-ft.y/_e),na=Math.PI/2-2*Math.atan($n),eo=0,fo=.1,Do;eo<15&&Math.abs(fo)>1e-7;eo++)Do=Wr*Math.sin(na),Do=Math.pow((1-Do)/(1+Do),Wr/2),fo=Math.PI/2-2*Math.atan($n*Do)-na,na+=fo;return new Xi(na*$t,ft.x*$t/_e)}},yw={__proto__:null,LonLat:dm,Mercator:ry,SphericalMercator:oo},_w=T({},aa,{code:"EPSG:3395",projection:ry,transformation:function(){var ft=.5/(Math.PI*ry.R);return Ur(ft,.5,-ft,.5)}()}),rb=T({},aa,{code:"EPSG:4326",projection:dm,transformation:Ur(1/180,1,-1/180,.5)}),Zv=T({},hi,{projection:dm,transformation:Ur(1,0,-1,0),scale:function(ft){return Math.pow(2,ft)},zoom:function(ft){return Math.log(ft)/Math.LN2},distance:function(ft,$t){var _e=$t.lng-ft.lng,ir=$t.lat-ft.lat;return Math.sqrt(_e*_e+ir*ir)},infinite:!0});hi.Earth=aa,hi.EPSG3395=_w,hi.EPSG3857=Sn,hi.EPSG900913=Hn,hi.EPSG4326=rb,hi.Simple=Zv;var Z0=Cn.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(ft){return ft.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(ft){return ft&&ft.removeLayer(this),this},getPane:function(ft){return this._map.getPane(ft?this.options[ft]||ft:this.options.pane)},addInteractiveTarget:function(ft){return this._map._targets[yt(ft)]=this,this},removeInteractiveTarget:function(ft){return delete this._map._targets[yt(ft)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(ft){var $t=ft.target;if($t.hasLayer(this)){if(this._map=$t,this._zoomAnimated=$t._zoomAnimated,this.getEvents){var _e=this.getEvents();$t.on(_e,this),this.once("remove",function(){$t.off(_e,this)},this)}this.onAdd($t),this.fire("add"),$t.fire("layeradd",{layer:this})}}});Nu.include({addLayer:function(ft){if(!ft._layerAdd)throw new Error("The provided object is not a Layer.");var $t=yt(ft);return this._layers[$t]?this:(this._layers[$t]=ft,ft._mapToAdd=this,ft.beforeAdd&&ft.beforeAdd(this),this.whenReady(ft._layerAdd,ft),this)},removeLayer:function(ft){var $t=yt(ft);return this._layers[$t]?(this._loaded&&ft.onRemove(this),delete this._layers[$t],this._loaded&&(this.fire("layerremove",{layer:ft}),ft.fire("remove")),ft._map=ft._mapToAdd=null,this):this},hasLayer:function(ft){return yt(ft)in this._layers},eachLayer:function(ft,$t){for(var _e in this._layers)ft.call($t,this._layers[_e]);return this},_addLayers:function(ft){ft=ft?rn(ft)?ft:[ft]:[];for(var $t=0,_e=ft.length;$t<_e;$t++)this.addLayer(ft[$t])},_addZoomLimit:function(ft){(!isNaN(ft.options.maxZoom)||!isNaN(ft.options.minZoom))&&(this._zoomBoundLayers[yt(ft)]=ft,this._updateZoomLevels())},_removeZoomLimit:function(ft){var $t=yt(ft);this._zoomBoundLayers[$t]&&(delete this._zoomBoundLayers[$t],this._updateZoomLevels())},_updateZoomLevels:function(){var ft=1/0,$t=-1/0,_e=this._getZoomSpan();for(var ir in this._zoomBoundLayers){var Wr=this._zoomBoundLayers[ir].options;ft=Wr.minZoom===void 0?ft:Math.min(ft,Wr.minZoom),$t=Wr.maxZoom===void 0?$t:Math.max($t,Wr.maxZoom)}this._layersMaxZoom=$t===-1/0?void 0:$t,this._layersMinZoom=ft===1/0?void 0:ft,_e!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&$t[0]instanceof Xi&&$t[0].equals($t[_e-1])&&$t.pop(),$t},_setLatLngs:function(ft){fm.prototype._setLatLngs.call(this,ft),hm(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return hm(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var ft=this._renderer._bounds,$t=this.options.weight,_e=new Xn($t,$t);if(ft=new va(ft.min.subtract(_e),ft.max.add(_e)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(ft))){if(this.options.noClip){this._parts=this._rings;return}for(var ir=0,Wr=this._rings.length,$n;irft.y!=Wr.y>ft.y&&ft.x<(Wr.x-ir.x)*(ft.y-ir.y)/(Wr.y-ir.y)+ir.x&&($t=!$t);return $t||fm.prototype._containsPoint.call(this,ft,!0)}});function w8(ft,$t){return new ay(ft,$t)}var Cg=l0.extend({initialize:function(ft,$t){Ce(this,$t),this._layers={},ft&&this.addData(ft)},addData:function(ft){var $t=rn(ft)?ft:ft.features,_e,ir,Wr;if($t){for(_e=0,ir=$t.length;_e0&&Wr.push(Wr[0].slice()),Wr}function Ag(ft,$t){return ft.feature?T({},ft.feature,{geometry:$t}):cb($t)}function cb(ft){return ft.type==="Feature"||ft.type==="FeatureCollection"?ft:{type:"Feature",properties:{},geometry:ft}}var Tw={toGeoJSON:function(ft){return Ag(this,{type:"Point",coordinates:kw(this.getLatLng(),ft)})}};L_.include(Tw),ab.include(Tw),ib.include(Tw),fm.include({toGeoJSON:function(ft){var $t=!hm(this._latlngs),_e=lb(this._latlngs,$t?1:0,!1,ft);return Ag(this,{type:($t?"Multi":"")+"LineString",coordinates:_e})}}),ay.include({toGeoJSON:function(ft){var $t=!hm(this._latlngs),_e=$t&&!hm(this._latlngs[0]),ir=lb(this._latlngs,_e?2:$t?1:0,!0,ft);return $t||(ir=[ir]),Ag(this,{type:(_e?"Multi":"")+"Polygon",coordinates:ir})}}),Kv.include({toMultiPoint:function(ft){var $t=[];return this.eachLayer(function(_e){$t.push(_e.toGeoJSON(ft).geometry.coordinates)}),Ag(this,{type:"MultiPoint",coordinates:$t})},toGeoJSON:function(ft){var $t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if($t==="MultiPoint")return this.toMultiPoint(ft);var _e=$t==="GeometryCollection",ir=[];return this.eachLayer(function(Wr){if(Wr.toGeoJSON){var $n=Wr.toGeoJSON(ft);if(_e)ir.push($n.geometry);else{var na=cb($n);na.type==="FeatureCollection"?ir.push.apply(ir,na.features):ir.push(na)}}}),_e?Ag(this,{geometries:ir,type:"GeometryCollection"}):{type:"FeatureCollection",features:ir}}});function Sw(ft,$t){return new Cg(ft,$t)}var ub=Sw,Mg=Z0.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(ft,$t,_e){this._url=ft,this._bounds=Bi($t),Ce(this,_e)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Qc(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Bd(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(ft){return this.options.opacity=ft,this._image&&this._updateOpacity(),this},setStyle:function(ft){return ft.opacity&&this.setOpacity(ft.opacity),this},bringToFront:function(){return this._map&&J1(this._image),this},bringToBack:function(){return this._map&&jn(this._image),this},setUrl:function(ft){return this._url=ft,this._image&&(this._image.src=ft),this},setBounds:function(ft){return this._bounds=Bi(ft),this._map&&this._reset(),this},getEvents:function(){var ft={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(ft.zoomanim=this._animateZoom),ft},setZIndex:function(ft){return this.options.zIndex=ft,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var ft=this._url.tagName==="IMG",$t=this._image=ft?this._url:$u("img");if(Qc($t,"leaflet-image-layer"),this._zoomAnimated&&Qc($t,"leaflet-zoom-animated"),this.options.className&&Qc($t,this.options.className),$t.onselectstart=ne,$t.onmousemove=ne,$t.onload=K(this.fire,this,"load"),$t.onerror=K(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&($t.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),ft){this._url=$t.src;return}$t.src=this._url,$t.alt=this.options.alt},_animateZoom:function(ft){var $t=this._map.getZoomScale(ft.zoom),_e=this._map._latLngBoundsToNewLayerBounds(this._bounds,ft.zoom,ft.center).min;Tc(this._image,_e,$t)},_reset:function(){var ft=this._image,$t=new va(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),_e=$t.getSize();fu(ft,$t.min),ft.style.width=_e.x+"px",ft.style.height=_e.y+"px"},_updateOpacity:function(){um(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var ft=this.options.errorOverlayUrl;ft&&this._url!==ft&&(this._url=ft,this._image.src=ft)},getCenter:function(){return this._bounds.getCenter()}}),Eg=function(ft,$t,_e){return new Mg(ft,$t,_e)},Em=Mg.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var ft=this._url.tagName==="VIDEO",$t=this._image=ft?this._url:$u("video");if(Qc($t,"leaflet-image-layer"),this._zoomAnimated&&Qc($t,"leaflet-zoom-animated"),this.options.className&&Qc($t,this.options.className),$t.onselectstart=ne,$t.onmousemove=ne,$t.onloadeddata=K(this.fire,this,"load"),ft){for(var _e=$t.getElementsByTagName("source"),ir=[],Wr=0;Wr<_e.length;Wr++)ir.push(_e[Wr].src);this._url=_e.length>0?ir:[$t.src];return}rn(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call($t.style,"objectFit")&&($t.style.objectFit="fill"),$t.autoplay=!!this.options.autoplay,$t.loop=!!this.options.loop,$t.muted=!!this.options.muted,$t.playsInline=!!this.options.playsInline;for(var $n=0;$nWr?($t.height=Wr+"px",Qc(ft,$n)):Jd(ft,$n),this._containerWidth=this._container.offsetWidth},_animateZoom:function(ft){var $t=this._map._latLngToNewLayerPoint(this._latlng,ft.zoom,ft.center),_e=this._getAnchor();fu(this._container,$t.add(_e))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var ft=this._map,$t=parseInt(C_(this._container,"marginBottom"),10)||0,_e=this._container.offsetHeight+$t,ir=this._containerWidth,Wr=new Xn(this._containerLeft,-_e-this._containerBottom);Wr._add(Ku(this._container));var $n=ft.layerPointToContainerPoint(Wr),na=ta(this.options.autoPanPadding),eo=ta(this.options.autoPanPaddingTopLeft||na),fo=ta(this.options.autoPanPaddingBottomRight||na),Do=ft.getSize(),tl=0,Il=0;$n.x+ir+fo.x>Do.x&&(tl=$n.x+ir-Do.x+fo.x),$n.x-tl-eo.x<0&&(tl=$n.x-eo.x),$n.y+_e+fo.y>Do.y&&(Il=$n.y+_e-Do.y+fo.y),$n.y-Il-eo.y<0&&(Il=$n.y-eo.y),(tl||Il)&&(this.options.keepInView&&(this._autopanning=!0),ft.fire("autopanstart").panBy([tl,Il]))}},_getAnchor:function(){return ta(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Md=function(ft,$t){return new Yv(ft,$t)};Nu.mergeOptions({closePopupOnClick:!0}),Nu.include({openPopup:function(ft,$t,_e){return this._initOverlay(Yv,ft,$t,_e).openOn(this),this},closePopup:function(ft){return ft=arguments.length?ft:this._popup,ft&&ft.close(),this}}),Z0.include({bindPopup:function(ft,$t){return this._popup=this._initOverlay(Yv,this._popup,ft,$t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(ft){return this._popup&&(this instanceof l0||(this._popup._source=this),this._popup._prepareOpen(ft||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(ft){return this._popup&&this._popup.setContent(ft),this},getPopup:function(){return this._popup},_openPopup:function(ft){if(!(!this._popup||!this._map)){$v(ft);var $t=ft.layer||ft.target;if(this._popup._source===$t&&!($t instanceof Yg)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(ft.latlng);return}this._popup._source=$t,this.openPopup(ft.latlng)}},_movePopup:function(ft){this._popup.setLatLng(ft.latlng)},_onKeyPress:function(ft){ft.originalEvent.keyCode===13&&this._openPopup(ft)}});var P_=tg.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(ft){tg.prototype.onAdd.call(this,ft),this.setOpacity(this.options.opacity),ft.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(ft){tg.prototype.onRemove.call(this,ft),ft.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var ft=tg.prototype.getEvents.call(this);return this.options.permanent||(ft.preclick=this.close),ft},_initLayout:function(){var ft="leaflet-tooltip",$t=ft+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=$u("div",$t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+yt(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(ft){var $t,_e,ir=this._map,Wr=this._container,$n=ir.latLngToContainerPoint(ir.getCenter()),na=ir.layerPointToContainerPoint(ft),eo=this.options.direction,fo=Wr.offsetWidth,Do=Wr.offsetHeight,tl=ta(this.options.offset),Il=this._getAnchor();eo==="top"?($t=fo/2,_e=Do):eo==="bottom"?($t=fo/2,_e=0):eo==="center"?($t=fo/2,_e=Do/2):eo==="right"?($t=0,_e=Do/2):eo==="left"?($t=fo,_e=Do/2):na.x<$n.x?(eo="right",$t=0,_e=Do/2):(eo="left",$t=fo+(tl.x+Il.x)*2,_e=Do/2),ft=ft.subtract(ta($t,_e,!0)).add(tl).add(Il),Jd(Wr,"leaflet-tooltip-right"),Jd(Wr,"leaflet-tooltip-left"),Jd(Wr,"leaflet-tooltip-top"),Jd(Wr,"leaflet-tooltip-bottom"),Qc(Wr,"leaflet-tooltip-"+eo),fu(Wr,ft)},_updatePosition:function(){var ft=this._map.latLngToLayerPoint(this._latlng);this._setPosition(ft)},setOpacity:function(ft){this.options.opacity=ft,this._container&&um(this._container,ft)},_animateZoom:function(ft){var $t=this._map._latLngToNewLayerPoint(this._latlng,ft.zoom,ft.center);this._setPosition($t)},_getAnchor:function(){return ta(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),B4=function(ft,$t){return new P_(ft,$t)};Nu.include({openTooltip:function(ft,$t,_e){return this._initOverlay(P_,ft,$t,_e).openOn(this),this},closeTooltip:function(ft){return ft.close(),this}}),Z0.include({bindTooltip:function(ft,$t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(P_,this._tooltip,ft,$t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(ft){if(!(!ft&&this._tooltipHandlersAdded)){var $t=ft?"off":"on",_e={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?_e.add=this._openTooltip:(_e.mouseover=this._openTooltip,_e.mouseout=this.closeTooltip,_e.click=this._openTooltip,this._map?this._addFocusListeners():_e.add=this._addFocusListeners),this._tooltip.options.sticky&&(_e.mousemove=this._moveTooltip),this[$t](_e),this._tooltipHandlersAdded=!ft}},openTooltip:function(ft){return this._tooltip&&(this instanceof l0||(this._tooltip._source=this),this._tooltip._prepareOpen(ft)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(ft){return this._tooltip&&this._tooltip.setContent(ft),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(ft){var $t=typeof ft.getElement=="function"&&ft.getElement();$t&&(Hc($t,"focus",function(){this._tooltip._source=ft,this.openTooltip()},this),Hc($t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(ft){var $t=typeof ft.getElement=="function"&&ft.getElement();$t&&$t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(ft){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var $t=this;this._map.once("moveend",function(){$t._openOnceFlag=!1,$t._openTooltip(ft)});return}this._tooltip._source=ft.layer||ft.target,this.openTooltip(this._tooltip.options.sticky?ft.latlng:void 0)}},_moveTooltip:function(ft){var $t=ft.latlng,_e,ir;this._tooltip.options.sticky&&ft.originalEvent&&(_e=this._map.mouseEventToContainerPoint(ft.originalEvent),ir=this._map.containerPointToLayerPoint(_e),$t=this._map.layerPointToLatLng(ir)),this._tooltip.setLatLng($t)}});var R4=Kg.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(ft){var $t=ft&&ft.tagName==="DIV"?ft:document.createElement("div"),_e=this.options;if(_e.html instanceof Element?(Jx($t),$t.appendChild(_e.html)):$t.innerHTML=_e.html!==!1?_e.html:"",_e.bgPos){var ir=ta(_e.bgPos);$t.style.backgroundPosition=-ir.x+"px "+-ir.y+"px"}return this._setIconStyles($t,"icon"),$t},createShadow:function(){return null}});function T8(ft){return new R4(ft)}Kg.Default=ny;var I_=Z0.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ul.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(ft){Ce(this,ft)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(ft){ft._addZoomLimit(this)},onRemove:function(ft){this._removeAllTiles(),Bd(this._container),ft._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(J1(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(jn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(ft){return this.options.opacity=ft,this._updateOpacity(),this},setZIndex:function(ft){return this.options.zIndex=ft,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var ft=this._clampZoom(this._map.getZoom());ft!==this._tileZoom&&(this._tileZoom=ft,this._updateLevels()),this._update()}return this},getEvents:function(){var ft={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=St(this._onMoveEnd,this.options.updateInterval,this)),ft.move=this._onMove),this._zoomAnimated&&(ft.zoomanim=this._animateZoom),ft},createTile:function(){return document.createElement("div")},getTileSize:function(){var ft=this.options.tileSize;return ft instanceof Xn?ft:new Xn(ft,ft)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(ft){for(var $t=this.getPane().children,_e=-ft(-1/0,1/0),ir=0,Wr=$t.length,$n;irthis.options.maxZoom||_eir?this._retainParent(Wr,$n,na,ir):!1)},_retainChildren:function(ft,$t,_e,ir){for(var Wr=2*ft;Wr<2*ft+2;Wr++)for(var $n=2*$t;$n<2*$t+2;$n++){var na=new Xn(Wr,$n);na.z=_e+1;var eo=this._tileCoordsToKey(na),fo=this._tiles[eo];if(fo&&fo.active){fo.retain=!0;continue}else fo&&fo.loaded&&(fo.retain=!0);_e+1this.options.maxZoom||this.options.minZoom!==void 0&&Wr1){this._setView(ft,_e);return}for(var Il=Wr.min.y;Il<=Wr.max.y;Il++)for(var qc=Wr.min.x;qc<=Wr.max.x;qc++){var Kf=new Xn(qc,Il);if(Kf.z=this._tileZoom,!!this._isValidTile(Kf)){var Qd=this._tiles[this._tileCoordsToKey(Kf)];Qd?Qd.current=!0:na.push(Kf)}}if(na.sort(function(c0,Jg){return c0.distanceTo($n)-Jg.distanceTo($n)}),na.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var mm=document.createDocumentFragment();for(qc=0;qc_e.max.x)||!$t.wrapLat&&(ft.y<_e.min.y||ft.y>_e.max.y))return!1}if(!this.options.bounds)return!0;var ir=this._tileCoordsToBounds(ft);return Bi(this.options.bounds).overlaps(ir)},_keyToBounds:function(ft){return this._tileCoordsToBounds(this._keyToTileCoords(ft))},_tileCoordsToNwSe:function(ft){var $t=this._map,_e=this.getTileSize(),ir=ft.scaleBy(_e),Wr=ir.add(_e),$n=$t.unproject(ir,ft.z),na=$t.unproject(Wr,ft.z);return[$n,na]},_tileCoordsToBounds:function(ft){var $t=this._tileCoordsToNwSe(ft),_e=new qi($t[0],$t[1]);return this.options.noWrap||(_e=this._map.wrapLatLngBounds(_e)),_e},_tileCoordsToKey:function(ft){return ft.x+":"+ft.y+":"+ft.z},_keyToTileCoords:function(ft){var $t=ft.split(":"),_e=new Xn(+$t[0],+$t[1]);return _e.z=+$t[2],_e},_removeTile:function(ft){var $t=this._tiles[ft];$t&&(Bd($t.el),delete this._tiles[ft],this.fire("tileunload",{tile:$t.el,coords:this._keyToTileCoords(ft)}))},_initTile:function(ft){Qc(ft,"leaflet-tile");var $t=this.getTileSize();ft.style.width=$t.x+"px",ft.style.height=$t.y+"px",ft.onselectstart=ne,ft.onmousemove=ne,Ul.ielt9&&this.options.opacity<1&&um(ft,this.options.opacity)},_addTile:function(ft,$t){var _e=this._getTilePos(ft),ir=this._tileCoordsToKey(ft),Wr=this.createTile(this._wrapCoords(ft),K(this._tileReady,this,ft));this._initTile(Wr),this.createTile.length<2&&on(K(this._tileReady,this,ft,null,Wr)),fu(Wr,_e),this._tiles[ir]={el:Wr,coords:ft,current:!0},$t.appendChild(Wr),this.fire("tileloadstart",{tile:Wr,coords:ft})},_tileReady:function(ft,$t,_e){$t&&this.fire("tileerror",{error:$t,tile:_e,coords:ft});var ir=this._tileCoordsToKey(ft);_e=this._tiles[ir],_e&&(_e.loaded=+new Date,this._map._fadeAnimated?(um(_e.el,0),pr(this._fadeFrame),this._fadeFrame=on(this._updateOpacity,this)):(_e.active=!0,this._pruneTiles()),$t||(Qc(_e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:_e.el,coords:ft})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ul.ielt9||!this._map._fadeAnimated?on(this._pruneTiles,this):setTimeout(K(this._pruneTiles,this),250)))},_getTilePos:function(ft){return ft.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(ft){var $t=new Xn(this._wrapX?Ut(ft.x,this._wrapX):ft.x,this._wrapY?Ut(ft.y,this._wrapY):ft.y);return $t.z=ft.z,$t},_pxBoundsToTileRange:function(ft){var $t=this.getTileSize();return new va(ft.min.unscaleBy($t).floor(),ft.max.unscaleBy($t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var ft in this._tiles)if(!this._tiles[ft].loaded)return!1;return!0}});function Aw(ft){return new I_(ft)}var K0=I_.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(ft,$t){this._url=ft,$t=Ce(this,$t),$t.detectRetina&&Ul.retina&&$t.maxZoom>0?($t.tileSize=Math.floor($t.tileSize/2),$t.zoomReverse?($t.zoomOffset--,$t.minZoom=Math.min($t.maxZoom,$t.minZoom+1)):($t.zoomOffset++,$t.maxZoom=Math.max($t.minZoom,$t.maxZoom-1)),$t.minZoom=Math.max(0,$t.minZoom)):$t.zoomReverse?$t.minZoom=Math.min($t.maxZoom,$t.minZoom):$t.maxZoom=Math.max($t.minZoom,$t.maxZoom),typeof $t.subdomains=="string"&&($t.subdomains=$t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(ft,$t){return this._url===ft&&$t===void 0&&($t=!0),this._url=ft,$t||this.redraw(),this},createTile:function(ft,$t){var _e=document.createElement("img");return Hc(_e,"load",K(this._tileOnLoad,this,$t,_e)),Hc(_e,"error",K(this._tileOnError,this,$t,_e)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(_e.referrerPolicy=this.options.referrerPolicy),_e.alt="",_e.src=this.getTileUrl(ft),_e},getTileUrl:function(ft){var $t={r:Ul.retina?"@2x":"",s:this._getSubdomain(ft),x:ft.x,y:ft.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var _e=this._globalTileRange.max.y-ft.y;this.options.tms&&($t.y=_e),$t["-y"]=_e}return It(this._url,T($t,this.options))},_tileOnLoad:function(ft,$t){Ul.ielt9?setTimeout(K(ft,this,null,$t),0):ft(null,$t)},_tileOnError:function(ft,$t,_e){var ir=this.options.errorTileUrl;ir&&$t.getAttribute("src")!==ir&&($t.src=ir),ft(_e,$t)},_onTileRemove:function(ft){ft.tile.onload=null},_getZoomForUrl:function(){var ft=this._tileZoom,$t=this.options.maxZoom,_e=this.options.zoomReverse,ir=this.options.zoomOffset;return _e&&(ft=$t-ft),ft+ir},_getSubdomain:function(ft){var $t=Math.abs(ft.x+ft.y)%this.options.subdomains.length;return this.options.subdomains[$t]},_abortLoading:function(){var ft,$t;for(ft in this._tiles)if(this._tiles[ft].coords.z!==this._tileZoom&&($t=this._tiles[ft].el,$t.onload=ne,$t.onerror=ne,!$t.complete)){$t.src=Mr;var _e=this._tiles[ft].coords;Bd($t),delete this._tiles[ft],this.fire("tileabort",{tile:$t,coords:_e})}},_removeTile:function(ft){var $t=this._tiles[ft];if($t)return $t.el.setAttribute("src",Mr),I_.prototype._removeTile.call(this,ft)},_tileReady:function(ft,$t,_e){if(!(!this._map||_e&&_e.getAttribute("src")===Mr))return I_.prototype._tileReady.call(this,ft,$t,_e)}});function hb(ft,$t){return new K0(ft,$t)}var db=K0.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(ft,$t){this._url=ft;var _e=T({},this.defaultWmsParams);for(var ir in $t)ir in this.options||(_e[ir]=$t[ir]);$t=Ce(this,$t);var Wr=$t.detectRetina&&Ul.retina?2:1,$n=this.getTileSize();_e.width=$n.x*Wr,_e.height=$n.y*Wr,this.wmsParams=_e},onAdd:function(ft){this._crs=this.options.crs||ft.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var $t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[$t]=this._crs.code,K0.prototype.onAdd.call(this,ft)},getTileUrl:function(ft){var $t=this._tileCoordsToNwSe(ft),_e=this._crs,ir=_a(_e.project($t[0]),_e.project($t[1])),Wr=ir.min,$n=ir.max,na=(this._wmsVersion>=1.3&&this._crs===rb?[Wr.y,Wr.x,$n.y,$n.x]:[Wr.x,Wr.y,$n.x,$n.y]).join(","),eo=K0.prototype.getTileUrl.call(this,ft);return eo+Ve(this.wmsParams,eo,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+na},setParams:function(ft,$t){return T(this.wmsParams,ft),$t||this.redraw(),this}});function F4(ft,$t){return new db(ft,$t)}K0.WMS=db,hb.wms=F4;var Lg=Z0.extend({options:{padding:.1},initialize:function(ft){Ce(this,ft),yt(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Qc(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var ft={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(ft.zoomanim=this._onAnimZoom),ft},_onAnimZoom:function(ft){this._updateTransform(ft.center,ft.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(ft,$t){var _e=this._map.getZoomScale($t,this._zoom),ir=this._map.getSize().multiplyBy(.5+this.options.padding),Wr=this._map.project(this._center,$t),$n=ir.multiplyBy(-_e).add(Wr).subtract(this._map._getNewPixelOrigin(ft,$t));Ul.any3d?Tc(this._container,$n,_e):fu(this._container,$n)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var ft in this._layers)this._layers[ft]._reset()},_onZoomEnd:function(){for(var ft in this._layers)this._layers[ft]._project()},_updatePaths:function(){for(var ft in this._layers)this._layers[ft]._update()},_update:function(){var ft=this.options.padding,$t=this._map.getSize(),_e=this._map.containerPointToLayerPoint($t.multiplyBy(-ft)).round();this._bounds=new va(_e,_e.add($t.multiplyBy(1+ft*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),N4=Lg.extend({options:{tolerance:0},getEvents:function(){var ft=Lg.prototype.getEvents.call(this);return ft.viewprereset=this._onViewPreReset,ft},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Lg.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var ft=this._container=document.createElement("canvas");Hc(ft,"mousemove",this._onMouseMove,this),Hc(ft,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Hc(ft,"mouseout",this._handleMouseOut,this),ft._leaflet_disable_events=!0,this._ctx=ft.getContext("2d")},_destroyContainer:function(){pr(this._redrawRequest),delete this._ctx,Bd(this._container),Xh(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var ft;this._redrawBounds=null;for(var $t in this._layers)ft=this._layers[$t],ft._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lg.prototype._update.call(this);var ft=this._bounds,$t=this._container,_e=ft.getSize(),ir=Ul.retina?2:1;fu($t,ft.min),$t.width=ir*_e.x,$t.height=ir*_e.y,$t.style.width=_e.x+"px",$t.style.height=_e.y+"px",Ul.retina&&this._ctx.scale(2,2),this._ctx.translate(-ft.min.x,-ft.min.y),this.fire("update")}},_reset:function(){Lg.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(ft){this._updateDashArray(ft),this._layers[yt(ft)]=ft;var $t=ft._order={layer:ft,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=$t),this._drawLast=$t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(ft){this._requestRedraw(ft)},_removePath:function(ft){var $t=ft._order,_e=$t.next,ir=$t.prev;_e?_e.prev=ir:this._drawLast=ir,ir?ir.next=_e:this._drawFirst=_e,delete ft._order,delete this._layers[yt(ft)],this._requestRedraw(ft)},_updatePath:function(ft){this._extendRedrawBounds(ft),ft._project(),ft._update(),this._requestRedraw(ft)},_updateStyle:function(ft){this._updateDashArray(ft),this._requestRedraw(ft)},_updateDashArray:function(ft){if(typeof ft.options.dashArray=="string"){var $t=ft.options.dashArray.split(/[, ]+/),_e=[],ir,Wr;for(Wr=0;Wr<$t.length;Wr++){if(ir=Number($t[Wr]),isNaN(ir))return;_e.push(ir)}ft.options._dashArray=_e}else ft.options._dashArray=ft.options.dashArray},_requestRedraw:function(ft){this._map&&(this._extendRedrawBounds(ft),this._redrawRequest=this._redrawRequest||on(this._redraw,this))},_extendRedrawBounds:function(ft){if(ft._pxBounds){var $t=(ft.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new va,this._redrawBounds.extend(ft._pxBounds.min.subtract([$t,$t])),this._redrawBounds.extend(ft._pxBounds.max.add([$t,$t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var ft=this._redrawBounds;if(ft){var $t=ft.getSize();this._ctx.clearRect(ft.min.x,ft.min.y,$t.x,$t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var ft,$t=this._redrawBounds;if(this._ctx.save(),$t){var _e=$t.getSize();this._ctx.beginPath(),this._ctx.rect($t.min.x,$t.min.y,_e.x,_e.y),this._ctx.clip()}this._drawing=!0;for(var ir=this._drawFirst;ir;ir=ir.next)ft=ir.layer,(!$t||ft._pxBounds&&ft._pxBounds.intersects($t))&&ft._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(ft,$t){if(this._drawing){var _e,ir,Wr,$n,na=ft._parts,eo=na.length,fo=this._ctx;if(eo){for(fo.beginPath(),_e=0;_e')}}catch{}return function(ft){return document.createElement("<"+ft+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),S8={_initContainer:function(){this._container=$u("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Lg.prototype._update.call(this),this.fire("update"))},_initPath:function(ft){var $t=ft._container=D_("shape");Qc($t,"leaflet-vml-shape "+(this.options.className||"")),$t.coordsize="1 1",ft._path=D_("path"),$t.appendChild(ft._path),this._updateStyle(ft),this._layers[yt(ft)]=ft},_addPath:function(ft){var $t=ft._container;this._container.appendChild($t),ft.options.interactive&&ft.addInteractiveTarget($t)},_removePath:function(ft){var $t=ft._container;Bd($t),ft.removeInteractiveTarget($t),delete this._layers[yt(ft)]},_updateStyle:function(ft){var $t=ft._stroke,_e=ft._fill,ir=ft.options,Wr=ft._container;Wr.stroked=!!ir.stroke,Wr.filled=!!ir.fill,ir.stroke?($t||($t=ft._stroke=D_("stroke")),Wr.appendChild($t),$t.weight=ir.weight+"px",$t.color=ir.color,$t.opacity=ir.opacity,ir.dashArray?$t.dashStyle=rn(ir.dashArray)?ir.dashArray.join(" "):ir.dashArray.replace(/( *, *)/g," "):$t.dashStyle="",$t.endcap=ir.lineCap.replace("butt","flat"),$t.joinstyle=ir.lineJoin):$t&&(Wr.removeChild($t),ft._stroke=null),ir.fill?(_e||(_e=ft._fill=D_("fill")),Wr.appendChild(_e),_e.color=ir.fillColor||ir.color,_e.opacity=ir.fillOpacity):_e&&(Wr.removeChild(_e),ft._fill=null)},_updateCircle:function(ft){var $t=ft._point.round(),_e=Math.round(ft._radius),ir=Math.round(ft._radiusY||_e);this._setPath(ft,ft._empty()?"M0 0":"AL "+$t.x+","+$t.y+" "+_e+","+ir+" 0,"+65535*360)},_setPath:function(ft,$t){ft._path.v=$t},_bringToFront:function(ft){J1(ft._container)},_bringToBack:function(ft){jn(ft._container)}},Xg=Ul.vml?D_:Qa,S0=Lg.extend({_initContainer:function(){this._container=Xg("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Xg("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Bd(this._container),Xh(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lg.prototype._update.call(this);var ft=this._bounds,$t=ft.getSize(),_e=this._container;(!this._svgSize||!this._svgSize.equals($t))&&(this._svgSize=$t,_e.setAttribute("width",$t.x),_e.setAttribute("height",$t.y)),fu(_e,ft.min),_e.setAttribute("viewBox",[ft.min.x,ft.min.y,$t.x,$t.y].join(" ")),this.fire("update")}},_initPath:function(ft){var $t=ft._path=Xg("path");ft.options.className&&Qc($t,ft.options.className),ft.options.interactive&&Qc($t,"leaflet-interactive"),this._updateStyle(ft),this._layers[yt(ft)]=ft},_addPath:function(ft){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(ft._path),ft.addInteractiveTarget(ft._path)},_removePath:function(ft){Bd(ft._path),ft.removeInteractiveTarget(ft._path),delete this._layers[yt(ft)]},_updatePath:function(ft){ft._project(),ft._update()},_updateStyle:function(ft){var $t=ft._path,_e=ft.options;$t&&(_e.stroke?($t.setAttribute("stroke",_e.color),$t.setAttribute("stroke-opacity",_e.opacity),$t.setAttribute("stroke-width",_e.weight),$t.setAttribute("stroke-linecap",_e.lineCap),$t.setAttribute("stroke-linejoin",_e.lineJoin),_e.dashArray?$t.setAttribute("stroke-dasharray",_e.dashArray):$t.removeAttribute("stroke-dasharray"),_e.dashOffset?$t.setAttribute("stroke-dashoffset",_e.dashOffset):$t.removeAttribute("stroke-dashoffset")):$t.setAttribute("stroke","none"),_e.fill?($t.setAttribute("fill",_e.fillColor||_e.color),$t.setAttribute("fill-opacity",_e.fillOpacity),$t.setAttribute("fill-rule",_e.fillRule||"evenodd")):$t.setAttribute("fill","none"))},_updatePoly:function(ft,$t){this._setPath(ft,Ha(ft._parts,$t))},_updateCircle:function(ft){var $t=ft._point,_e=Math.max(Math.round(ft._radius),1),ir=Math.max(Math.round(ft._radiusY),1)||_e,Wr="a"+_e+","+ir+" 0 1,0 ",$n=ft._empty()?"M0 0":"M"+($t.x-_e)+","+$t.y+Wr+_e*2+",0 "+Wr+-_e*2+",0 ";this._setPath(ft,$n)},_setPath:function(ft,$t){ft._path.setAttribute("d",$t)},_bringToFront:function(ft){J1(ft._path)},_bringToBack:function(ft){jn(ft._path)}});Ul.vml&&S0.include(S8);function j4(ft){return Ul.svg||Ul.vml?new S0(ft):null}Nu.include({getRenderer:function(ft){var $t=ft.options.renderer||this._getPaneRenderer(ft.options.pane)||this.options.renderer||this._renderer;return $t||($t=this._renderer=this._createRenderer()),this.hasLayer($t)||this.addLayer($t),$t},_getPaneRenderer:function(ft){if(ft==="overlayPane"||ft===void 0)return!1;var $t=this._paneRenderers[ft];return $t===void 0&&($t=this._createRenderer({pane:ft}),this._paneRenderers[ft]=$t),$t},_createRenderer:function(ft){return this.options.preferCanvas&&Mw(ft)||j4(ft)}});var Y0=ay.extend({initialize:function(ft,$t){ay.prototype.initialize.call(this,this._boundsToLatLngs(ft),$t)},setBounds:function(ft){return this.setLatLngs(this._boundsToLatLngs(ft))},_boundsToLatLngs:function(ft){return ft=Bi(ft),[ft.getSouthWest(),ft.getNorthWest(),ft.getNorthEast(),ft.getSouthEast()]}});function Lm(ft,$t){return new Y0(ft,$t)}S0.create=Xg,S0.pointsToPath=Ha,Cg.geometryToLayer=ob,Cg.coordsToLatLng=ww,Cg.coordsToLatLngs=sb,Cg.latLngToCoords=kw,Cg.latLngsToCoords=lb,Cg.getFeature=Ag,Cg.asFeature=cb,Nu.mergeOptions({boxZoom:!0});var oy=Qm.extend({initialize:function(ft){this._map=ft,this._container=ft._container,this._pane=ft._panes.overlayPane,this._resetStateTimeout=0,ft.on("unload",this._destroy,this)},addHooks:function(){Hc(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Xh(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Bd(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(ft){if(!ft.shiftKey||ft.which!==1&&ft.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Cm(),lh(),this._startPoint=this._map.mouseEventToContainerPoint(ft),Hc(document,{contextmenu:$v,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(ft){this._moved||(this._moved=!0,this._box=$u("div","leaflet-zoom-box",this._container),Qc(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(ft);var $t=new va(this._point,this._startPoint),_e=$t.getSize();fu(this._box,$t.min),this._box.style.width=_e.x+"px",this._box.style.height=_e.y+"px"},_finish:function(){this._moved&&(Bd(this._box),Jd(this._container,"leaflet-crosshair")),Nv(),k0(),Xh(document,{contextmenu:$v,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(ft){if(!(ft.which!==1&&ft.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(K(this._resetState,this),0);var $t=new qi(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds($t).fire("boxzoomend",{boxZoomBounds:$t})}},_onKeyDown:function(ft){ft.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Nu.addInitHook("addHandler","boxZoom",oy),Nu.mergeOptions({doubleClickZoom:!0});var pm=Qm.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(ft){var $t=this._map,_e=$t.getZoom(),ir=$t.options.zoomDelta,Wr=ft.originalEvent.shiftKey?_e-ir:_e+ir;$t.options.doubleClickZoom==="center"?$t.setZoom(Wr):$t.setZoomAround(ft.containerPoint,Wr)}});Nu.addInitHook("addHandler","doubleClickZoom",pm),Nu.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Pm=Qm.extend({addHooks:function(){if(!this._draggable){var ft=this._map;this._draggable=new Zg(ft._mapPane,ft._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),ft.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),ft.on("zoomend",this._onZoomEnd,this),ft.whenReady(this._onZoomEnd,this))}Qc(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Jd(this._map._container,"leaflet-grab"),Jd(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var ft=this._map;if(ft._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var $t=Bi(this._map.options.maxBounds);this._offsetLimit=_a(this._map.latLngToContainerPoint($t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint($t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;ft.fire("movestart").fire("dragstart"),ft.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(ft){if(this._map.options.inertia){var $t=this._lastTime=+new Date,_e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(_e),this._times.push($t),this._prunePositions($t)}this._map.fire("move",ft).fire("drag",ft)},_prunePositions:function(ft){for(;this._positions.length>1&&ft-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var ft=this._map.getSize().divideBy(2),$t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=$t.subtract(ft).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(ft,$t){return ft-(ft-$t)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var ft=this._draggable._newPos.subtract(this._draggable._startPos),$t=this._offsetLimit;ft.x<$t.min.x&&(ft.x=this._viscousLimit(ft.x,$t.min.x)),ft.y<$t.min.y&&(ft.y=this._viscousLimit(ft.y,$t.min.y)),ft.x>$t.max.x&&(ft.x=this._viscousLimit(ft.x,$t.max.x)),ft.y>$t.max.y&&(ft.y=this._viscousLimit(ft.y,$t.max.y)),this._draggable._newPos=this._draggable._startPos.add(ft)}},_onPreDragWrap:function(){var ft=this._worldWidth,$t=Math.round(ft/2),_e=this._initialWorldOffset,ir=this._draggable._newPos.x,Wr=(ir-$t+_e)%ft+$t-_e,$n=(ir+$t+_e)%ft-$t-_e,na=Math.abs(Wr+_e)0?$n:-$n))-$t;this._delta=0,this._startTime=null,na&&(ft.options.scrollWheelZoom==="center"?ft.setZoom($t+na):ft.setZoomAround(this._lastMousePos,$t+na))}});Nu.addInitHook("addHandler","scrollWheelZoom",Xv);var $4=600;Nu.mergeOptions({tapHold:Ul.touchNative&&Ul.safari&&Ul.mobile,tapTolerance:15});var H4=Qm.extend({addHooks:function(){Hc(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Xh(this._map._container,"touchstart",this._onDown,this)},_onDown:function(ft){if(clearTimeout(this._holdTimeout),ft.touches.length===1){var $t=ft.touches[0];this._startPos=this._newPos=new Xn($t.clientX,$t.clientY),this._holdTimeout=setTimeout(K(function(){this._cancel(),this._isTapValid()&&(Hc(document,"touchend",Cu),Hc(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",$t))},this),$4),Hc(document,"touchend touchcancel contextmenu",this._cancel,this),Hc(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function ft(){Xh(document,"touchend",Cu),Xh(document,"touchend touchcancel",ft)},_cancel:function(){clearTimeout(this._holdTimeout),Xh(document,"touchend touchcancel contextmenu",this._cancel,this),Xh(document,"touchmove",this._onMove,this)},_onMove:function(ft){var $t=ft.touches[0];this._newPos=new Xn($t.clientX,$t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(ft,$t){var _e=new MouseEvent(ft,{bubbles:!0,cancelable:!0,view:window,screenX:$t.screenX,screenY:$t.screenY,clientX:$t.clientX,clientY:$t.clientY});_e._simulated=!0,$t.target.dispatchEvent(_e)}});Nu.addInitHook("addHandler","tapHold",H4),Nu.mergeOptions({touchZoom:Ul.touch,bounceAtZoomLimits:!0});var Im=Qm.extend({addHooks:function(){Qc(this._map._container,"leaflet-touch-zoom"),Hc(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Jd(this._map._container,"leaflet-touch-zoom"),Xh(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(ft){var $t=this._map;if(!(!ft.touches||ft.touches.length!==2||$t._animatingZoom||this._zooming)){var _e=$t.mouseEventToContainerPoint(ft.touches[0]),ir=$t.mouseEventToContainerPoint(ft.touches[1]);this._centerPoint=$t.getSize()._divideBy(2),this._startLatLng=$t.containerPointToLatLng(this._centerPoint),$t.options.touchZoom!=="center"&&(this._pinchStartLatLng=$t.containerPointToLatLng(_e.add(ir)._divideBy(2))),this._startDist=_e.distanceTo(ir),this._startZoom=$t.getZoom(),this._moved=!1,this._zooming=!0,$t._stop(),Hc(document,"touchmove",this._onTouchMove,this),Hc(document,"touchend touchcancel",this._onTouchEnd,this),Cu(ft)}},_onTouchMove:function(ft){if(!(!ft.touches||ft.touches.length!==2||!this._zooming)){var $t=this._map,_e=$t.mouseEventToContainerPoint(ft.touches[0]),ir=$t.mouseEventToContainerPoint(ft.touches[1]),Wr=_e.distanceTo(ir)/this._startDist;if(this._zoom=$t.getScaleZoom(Wr,this._startZoom),!$t.options.bounceAtZoomLimits&&(this._zoom<$t.getMinZoom()&&Wr<1||this._zoom>$t.getMaxZoom()&&Wr>1)&&(this._zoom=$t._limitZoom(this._zoom)),$t.options.touchZoom==="center"){if(this._center=this._startLatLng,Wr===1)return}else{var $n=_e._add(ir)._divideBy(2)._subtract(this._centerPoint);if(Wr===1&&$n.x===0&&$n.y===0)return;this._center=$t.unproject($t.project(this._pinchStartLatLng,this._zoom).subtract($n),this._zoom)}this._moved||($t._moveStart(!0,!1),this._moved=!0),pr(this._animRequest);var na=K($t._move,$t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=on(na,this,!0),Cu(ft)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,pr(this._animRequest),Xh(document,"touchmove",this._onTouchMove,this),Xh(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Nu.addInitHook("addHandler","touchZoom",Im),Nu.BoxZoom=oy,Nu.DoubleClickZoom=pm,Nu.Drag=Pm,Nu.Keyboard=U4,Nu.ScrollWheelZoom=Xv,Nu.TapHold=H4,Nu.TouchZoom=Im,r.Bounds=va,r.Browser=Ul,r.CRS=hi,r.Canvas=N4,r.Circle=ab,r.CircleMarker=ib,r.Class=Sr,r.Control=jp,r.DivIcon=R4,r.DivOverlay=tg,r.DomEvent=T0,r.DomUtil=Ru,r.Draggable=Zg,r.Evented=Cn,r.FeatureGroup=l0,r.GeoJSON=Cg,r.GridLayer=I_,r.Handler=Qm,r.Icon=Kg,r.ImageOverlay=Mg,r.LatLng=Xi,r.LatLngBounds=qi,r.Layer=Z0,r.LayerGroup=Kv,r.LineUtil=hd,r.Map=Nu,r.Marker=L_,r.Mixin=Up,r.Path=Yg,r.Point=Xn,r.PolyUtil=y8,r.Polygon=ay,r.Polyline=fm,r.Popup=Yv,r.PosAnimation=E_,r.Projection=yw,r.Rectangle=Y0,r.Renderer=Lg,r.SVG=S0,r.SVGOverlay=Cw,r.TileLayer=K0,r.Tooltip=P_,r.Transformation=xa,r.Util=_r,r.VideoOverlay=Em,r.bind=K,r.bounds=_a,r.canvas=Mw,r.circle=iy,r.circleMarker=D4,r.control=G0,r.divIcon=T8,r.extend=T,r.featureGroup=I4,r.geoJSON=Sw,r.geoJson=ub,r.gridLayer=Aw,r.icon=xw,r.imageOverlay=Eg,r.latLng=Yn,r.latLngBounds=Bi,r.layerGroup=nb,r.map=Js,r.marker=b8,r.point=ta,r.polygon=w8,r.polyline=z4,r.popup=Md,r.rectangle=Lm,r.setOptions=Ce,r.stamp=yt,r.svg=j4,r.svgOverlay=k8,r.tileLayer=hb,r.tooltip=B4,r.transformation=Ur,r.version=u,r.videoOverlay=dd;var Dm=window.L;r.noConflict=function(){return window.L=Dm,this},window.L=r})}(c5,c5.exports)),c5.exports}var Qvt=Jvt();const ug=_H(Qvt),gF=Object.freeze(Object.defineProperty({__proto__:null,default:ug},Symbol.toStringTag,{value:"Module"})),vF=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],K7=1,$3=8;class sL{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,u]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const T=u>>4;if(T!==K7)throw new Error(`Got v${T} data when expected v${K7}.`);const $=vF[u&15];if(!$)throw new Error("Unrecognized array type.");const[K]=new Uint16Array(t,2,1),[ct]=new Uint32Array(t,4,1);return new sL(ct,K,$,t)}constructor(t,r=64,u=Float64Array,T){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=u,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const $=vF.indexOf(this.ArrayType),K=t*2*this.ArrayType.BYTES_PER_ELEMENT,ct=t*this.IndexArrayType.BYTES_PER_ELEMENT,yt=(8-ct%8)%8;if($<0)throw new Error(`Unexpected typed array class: ${u}.`);T&&T instanceof ArrayBuffer?(this.data=T,this.ids=new this.IndexArrayType(this.data,$3,t),this.coords=new this.ArrayType(this.data,$3+ct+yt,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer($3+K+ct+yt),this.ids=new this.IndexArrayType(this.data,$3,t),this.coords=new this.ArrayType(this.data,$3+ct+yt,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(K7<<4)+$]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const u=this._pos>>1;return this.ids[u]=u,this.coords[this._pos++]=t,this.coords[this._pos++]=r,u}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return f9(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,u,T){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:$,coords:K,nodeSize:ct}=this,yt=[0,$.length-1,0],St=[];for(;yt.length;){const Ut=yt.pop()||0,ne=yt.pop()||0,pe=yt.pop()||0;if(ne-pe<=ct){for(let Ve=pe;Ve<=ne;Ve++){const kr=K[2*Ve],It=K[2*Ve+1];kr>=t&&kr<=u&&It>=r&&It<=T&&St.push($[Ve])}continue}const me=pe+ne>>1,we=K[2*me],Ce=K[2*me+1];we>=t&&we<=u&&Ce>=r&&Ce<=T&&St.push($[me]),(Ut===0?t<=we:r<=Ce)&&(yt.push(pe),yt.push(me-1),yt.push(1-Ut)),(Ut===0?u>=we:T>=Ce)&&(yt.push(me+1),yt.push(ne),yt.push(1-Ut))}return St}within(t,r,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:T,coords:$,nodeSize:K}=this,ct=[0,T.length-1,0],yt=[],St=u*u;for(;ct.length;){const Ut=ct.pop()||0,ne=ct.pop()||0,pe=ct.pop()||0;if(ne-pe<=K){for(let Ve=pe;Ve<=ne;Ve++)yF($[2*Ve],$[2*Ve+1],t,r)<=St&&yt.push(T[Ve]);continue}const me=pe+ne>>1,we=$[2*me],Ce=$[2*me+1];yF(we,Ce,t,r)<=St&&yt.push(T[me]),(Ut===0?t-u<=we:r-u<=Ce)&&(ct.push(pe),ct.push(me-1),ct.push(1-Ut)),(Ut===0?t+u>=we:r+u>=Ce)&&(ct.push(me+1),ct.push(ne),ct.push(1-Ut))}return yt}}function f9(e,t,r,u,T,$){if(T-u<=r)return;const K=u+T>>1;xH(e,t,K,u,T,$),f9(e,t,r,u,K-1,1-$),f9(e,t,r,K+1,T,1-$)}function xH(e,t,r,u,T,$){for(;T>u;){if(T-u>600){const St=T-u+1,Ut=r-u+1,ne=Math.log(St),pe=.5*Math.exp(2*ne/3),me=.5*Math.sqrt(ne*pe*(St-pe)/St)*(Ut-St/2<0?-1:1),we=Math.max(u,Math.floor(r-Ut*pe/St+me)),Ce=Math.min(T,Math.floor(r+(St-Ut)*pe/St+me));xH(e,t,r,we,Ce,$)}const K=t[2*r+$];let ct=u,yt=T;for(H3(e,t,u,r),t[2*T+$]>K&&H3(e,t,u,T);ctK;)yt--}t[2*u+$]===K?H3(e,t,u,yt):(yt++,H3(e,t,yt,T)),yt<=r&&(u=yt+1),r<=yt&&(T=yt-1)}}function H3(e,t,r,u){Y7(e,r,u),Y7(t,2*r,2*u),Y7(t,2*r+1,2*u+1)}function Y7(e,t,r){const u=e[t];e[t]=e[r],e[r]=u}function yF(e,t,r,u){const T=e-r,$=t-u;return T*T+$*$}const t1t={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},_F=Math.fround||(e=>t=>(e[0]=+t,e[0]))(new Float32Array(1)),px=2,i_=3,X7=4,Yy=5,bH=6;class e1t{constructor(t){this.options=Object.assign(Object.create(t1t),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:r,minZoom:u,maxZoom:T}=this.options;r&&console.time("total time");const $=`prepare ${t.length} points`;r&&console.time($),this.points=t;const K=[];for(let yt=0;yt=u;yt--){const St=+Date.now();ct=this.trees[yt]=this._createTree(this._cluster(ct,yt)),r&&console.log("z%d: %d clusters in %dms",yt,ct.numItems,+Date.now()-St)}return r&&console.timeEnd("total time"),this}getClusters(t,r){let u=((t[0]+180)%360+360)%360-180;const T=Math.max(-90,Math.min(90,t[1]));let $=t[2]===180?180:((t[2]+180)%360+360)%360-180;const K=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)u=-180,$=180;else if(u>$){const ne=this.getClusters([u,T,180,K],r),pe=this.getClusters([-180,T,$,K],r);return ne.concat(pe)}const ct=this.trees[this._limitZoom(r)],yt=ct.range(J6(u),Q6(K),J6($),Q6(T)),St=ct.data,Ut=[];for(const ne of yt){const pe=this.stride*ne;Ut.push(St[pe+Yy]>1?xF(St,pe,this.clusterProps):this.points[St[pe+i_]])}return Ut}getChildren(t){const r=this._getOriginId(t),u=this._getOriginZoom(t),T="No cluster with the specified id.",$=this.trees[u];if(!$)throw new Error(T);const K=$.data;if(r*this.stride>=K.length)throw new Error(T);const ct=this.options.radius/(this.options.extent*Math.pow(2,u-1)),yt=K[r*this.stride],St=K[r*this.stride+1],Ut=$.within(yt,St,ct),ne=[];for(const pe of Ut){const me=pe*this.stride;K[me+X7]===t&&ne.push(K[me+Yy]>1?xF(K,me,this.clusterProps):this.points[K[me+i_]])}if(ne.length===0)throw new Error(T);return ne}getLeaves(t,r,u){r=r||10,u=u||0;const T=[];return this._appendLeaves(T,t,r,u,0),T}getTile(t,r,u){const T=this.trees[this._limitZoom(t)],$=Math.pow(2,t),{extent:K,radius:ct}=this.options,yt=ct/K,St=(u-yt)/$,Ut=(u+1+yt)/$,ne={features:[]};return this._addTileFeatures(T.range((r-yt)/$,St,(r+1+yt)/$,Ut),T.data,r,u,$,ne),r===0&&this._addTileFeatures(T.range(1-yt/$,St,1,Ut),T.data,$,u,$,ne),r===$-1&&this._addTileFeatures(T.range(0,St,yt/$,Ut),T.data,-1,u,$,ne),ne.features.length?ne:null}getClusterExpansionZoom(t){let r=this._getOriginZoom(t)-1;for(;r<=this.options.maxZoom;){const u=this.getChildren(t);if(r++,u.length!==1)break;t=u[0].properties.cluster_id}return r}_appendLeaves(t,r,u,T,$){const K=this.getChildren(r);for(const ct of K){const yt=ct.properties;if(yt&&yt.cluster?$+yt.point_count<=T?$+=yt.point_count:$=this._appendLeaves(t,yt.cluster_id,u,T,$):$1;let Ut,ne,pe;if(St)Ut=wH(r,yt,this.clusterProps),ne=r[yt],pe=r[yt+1];else{const Ce=this.points[r[yt+i_]];Ut=Ce.properties;const[Ve,kr]=Ce.geometry.coordinates;ne=J6(Ve),pe=Q6(kr)}const me={type:1,geometry:[[Math.round(this.options.extent*(ne*$-u)),Math.round(this.options.extent*(pe*$-T))]],tags:Ut};let we;St||this.options.generateId?we=r[yt+i_]:we=this.points[r[yt+i_]].id,we!==void 0&&(me.id=we),K.features.push(me)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,r){const{radius:u,extent:T,reduce:$,minPoints:K}=this.options,ct=u/(T*Math.pow(2,r)),yt=t.data,St=[],Ut=this.stride;for(let ne=0;ner&&(Ve+=yt[It+Yy])}if(Ve>Ce&&Ve>=K){let kr=pe*Ce,It=me*Ce,rn,Lr=-1;const Mr=((ne/Ut|0)<<5)+(r+1)+this.points.length;for(const tn of we){const Dn=tn*Ut;if(yt[Dn+px]<=r)continue;yt[Dn+px]=r;const Mn=yt[Dn+Yy];kr+=yt[Dn]*Mn,It+=yt[Dn+1]*Mn,yt[Dn+X7]=Mr,$&&(rn||(rn=this._map(yt,ne,!0),Lr=this.clusterProps.length,this.clusterProps.push(rn)),$(rn,this._map(yt,Dn)))}yt[ne+X7]=Mr,St.push(kr/Ve,It/Ve,1/0,Mr,-1,Ve),$&&St.push(Lr)}else{for(let kr=0;kr1)for(const kr of we){const It=kr*Ut;if(!(yt[It+px]<=r)){yt[It+px]=r;for(let rn=0;rn>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,r,u){if(t[r+Yy]>1){const K=this.clusterProps[t[r+bH]];return u?Object.assign({},K):K}const T=this.points[t[r+i_]].properties,$=this.options.map(T);return u&&$===T?Object.assign({},$):$}}function xF(e,t,r){return{type:"Feature",id:e[t+i_],properties:wH(e,t,r),geometry:{type:"Point",coordinates:[r1t(e[t]),n1t(e[t+1])]}}}function wH(e,t,r){const u=e[t+Yy],T=u>=1e4?`${Math.round(u/1e3)}k`:u>=1e3?`${Math.round(u/100)/10}k`:u,$=e[t+bH],K=$===-1?{}:Object.assign({},r[$]);return Object.assign(K,{cluster:!0,cluster_id:e[t+i_],point_count:u,point_count_abbreviated:T})}function J6(e){return e/360+.5}function Q6(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function r1t(e){return(e-.5)*360}function n1t(e){const t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}const i1t={class:"map-container"},a1t={key:0,class:"flex items-center justify-center h-96 glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] shadow-sm dark:shadow-none"},o1t={class:"hidden sm:inline"},s1t={key:3,class:"map-legend"},l1t={class:"legend-footer"},c1t={key:4,class:"map-attribution"},u1t=Cc({__name:"NetworkMap",props:{adverts:{},baseLatitude:{default:null},baseLongitude:{default:null},showLegend:{type:Boolean,default:!0}},emits:["update:showLegend"],setup(e,{expose:t,emit:r}){typeof window<"u"&&!window.chrome&&(window.chrome={runtime:{}});const u=e,T=r,$=()=>{T("update:showLegend",!u.showLegend)},K=li();let ct=null;const yt=li(new Map);let St=null;const Ut=li(new Map),ne=li([]),pe=li(!0),me=li(60),we=li(14),Ce=li(document.documentElement.classList.contains("dark")),Ve=new MutationObserver(()=>{const Sr=document.documentElement.classList.contains("dark");Sr!==Ce.value&&(Ce.value=Sr,ct&&Mn())}),kr=Ao(()=>u.baseLatitude!==null&&u.baseLongitude!==null&&typeof u.baseLatitude=="number"&&typeof u.baseLongitude=="number"&&u.baseLatitude!==0&&u.baseLongitude!==0&&Math.abs(u.baseLatitude)<=90&&Math.abs(u.baseLongitude)<=180),It=Sr=>new Date(Sr*1e3).toLocaleString(),rn=Sr=>Sr?`${Sr} dBm`:"N/A",Lr=Sr=>Sr?`${Sr} dB`:"N/A",Mr=Sr=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[Sr||0]||"Unknown",tn=(Sr,Dr,nn,Cn)=>{const _i=(nn-Sr)*Math.PI/180,ta=(Cn-Dr)*Math.PI/180,va=Math.sin(_i/2)*Math.sin(_i/2)+Math.cos(Sr*Math.PI/180)*Math.cos(nn*Math.PI/180)*Math.sin(ta/2)*Math.sin(ta/2);return 6371*(2*Math.atan2(Math.sqrt(va),Math.sqrt(1-va)))},Dn=()=>{ct&&(ne.value.forEach(Sr=>{ct&&Sr.remove()}),ne.value.length=0,ct.remove(),ct=null),yt.value.clear(),Ut.value.clear(),St=null},Mn=async()=>{const Sr=ct?.getZoom()||11,Dr=ct?.getCenter()||(kr.value?[u.baseLatitude,u.baseLongitude]:[0,0]);Dn(),await sp(),await on(),ct&&ct.setView(Dr,Sr)},Br=Sr=>{const Dr=new Map;return Sr.filter(nn=>nn.latitude!==null&&nn.longitude!==null).map(nn=>{let Cn=nn.latitude,Xn=nn.longitude;const _i=`${Cn.toFixed(6)}_${Xn.toFixed(6)}`,ta=Dr.get(_i)||0;if(Dr.set(_i,ta+1),ta>0){const _a=ta*60*(Math.PI/180);Cn+=Math.sin(_a)*.001*(ta*.5),Xn+=Math.cos(_a)*.001*(ta*.5)}return{type:"Feature",properties:{advert:{...nn,jittered_latitude:Cn,jittered_longitude:Xn}},geometry:{type:"Point",coordinates:[Xn,Cn]}}})},Vn=Sr=>{St=new e1t({radius:me.value,maxZoom:we.value,minPoints:2}),St.load(Sr)},on=async()=>{if(!K.value||!kr.value){console.warn("Cannot initialize map: missing container or coordinates");return}Dn(),await sp();const Sr=u.baseLatitude,Dr=u.baseLongitude;ct=ug.map(K.value,{center:[Sr,Dr],zoom:11,zoomControl:!0,attributionControl:!1,preferCanvas:!1});try{const nn=Ce.value?"https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",Cn=Ce.value?"https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png",Xn=ug.tileLayer(nn,{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),_i=ug.tileLayer(Cn,{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});Xn.addTo(ct),_i.addTo(ct)}catch(nn){console.warn("Error loading tiles:",nn)}try{const nn=(qi,Bi=!1)=>{const Xi=Bi?16:12;return ug.divIcon({className:"custom-div-icon",html:`
`,iconSize:[Xi+4,Xi+4],iconAnchor:[(Xi+4)/2,(Xi+4)/2]})},Cn=qi=>{const Bi=qi<10?30:qi<100?40:50;return ug.divIcon({className:"custom-cluster-icon",html:` + */var Xvt=c5.exports,mF;function Jvt(){return mF||(mF=1,function(e,t){(function(r,u){u(t)})(Xvt,function(r){var u="1.9.4";function T(ft){var $t,_e,ir,Wr;for(_e=1,ir=arguments.length;_e"u"||!L||!L.Mixin)){ft=rn(ft)?ft:[ft];for(var $t=0;$t0?Math.floor(ft):Math.ceil(ft)};Xn.prototype={clone:function(){return new Xn(this.x,this.y)},add:function(ft){return this.clone()._add(ta(ft))},_add:function(ft){return this.x+=ft.x,this.y+=ft.y,this},subtract:function(ft){return this.clone()._subtract(ta(ft))},_subtract:function(ft){return this.x-=ft.x,this.y-=ft.y,this},divideBy:function(ft){return this.clone()._divideBy(ft)},_divideBy:function(ft){return this.x/=ft,this.y/=ft,this},multiplyBy:function(ft){return this.clone()._multiplyBy(ft)},_multiplyBy:function(ft){return this.x*=ft,this.y*=ft,this},scaleBy:function(ft){return new Xn(this.x*ft.x,this.y*ft.y)},unscaleBy:function(ft){return new Xn(this.x/ft.x,this.y/ft.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=_i(this.x),this.y=_i(this.y),this},distanceTo:function(ft){ft=ta(ft);var $t=ft.x-this.x,_e=ft.y-this.y;return Math.sqrt($t*$t+_e*_e)},equals:function(ft){return ft=ta(ft),ft.x===this.x&&ft.y===this.y},contains:function(ft){return ft=ta(ft),Math.abs(ft.x)<=Math.abs(this.x)&&Math.abs(ft.y)<=Math.abs(this.y)},toString:function(){return"Point("+pe(this.x)+", "+pe(this.y)+")"}};function ta(ft,$t,_e){return ft instanceof Xn?ft:rn(ft)?new Xn(ft[0],ft[1]):ft==null?ft:typeof ft=="object"&&"x"in ft&&"y"in ft?new Xn(ft.x,ft.y):new Xn(ft,$t,_e)}function va(ft,$t){if(ft)for(var _e=$t?[ft,$t]:ft,ir=0,Wr=_e.length;ir=this.min.x&&_e.x<=this.max.x&&$t.y>=this.min.y&&_e.y<=this.max.y},intersects:function(ft){ft=_a(ft);var $t=this.min,_e=this.max,ir=ft.min,Wr=ft.max,$n=Wr.x>=$t.x&&ir.x<=_e.x,ia=Wr.y>=$t.y&&ir.y<=_e.y;return $n&&ia},overlaps:function(ft){ft=_a(ft);var $t=this.min,_e=this.max,ir=ft.min,Wr=ft.max,$n=Wr.x>$t.x&&ir.x<_e.x,ia=Wr.y>$t.y&&ir.y<_e.y;return $n&&ia},isValid:function(){return!!(this.min&&this.max)},pad:function(ft){var $t=this.min,_e=this.max,ir=Math.abs($t.x-_e.x)*ft,Wr=Math.abs($t.y-_e.y)*ft;return _a(ta($t.x-ir,$t.y-Wr),ta(_e.x+ir,_e.y+Wr))},equals:function(ft){return ft?(ft=_a(ft),this.min.equals(ft.getTopLeft())&&this.max.equals(ft.getBottomRight())):!1}};function _a(ft,$t){return!ft||ft instanceof va?ft:new va(ft,$t)}function qi(ft,$t){if(ft)for(var _e=$t?[ft,$t]:ft,ir=0,Wr=_e.length;ir=$t.lat&&Wr.lat<=_e.lat&&ir.lng>=$t.lng&&Wr.lng<=_e.lng},intersects:function(ft){ft=Bi(ft);var $t=this._southWest,_e=this._northEast,ir=ft.getSouthWest(),Wr=ft.getNorthEast(),$n=Wr.lat>=$t.lat&&ir.lat<=_e.lat,ia=Wr.lng>=$t.lng&&ir.lng<=_e.lng;return $n&&ia},overlaps:function(ft){ft=Bi(ft);var $t=this._southWest,_e=this._northEast,ir=ft.getSouthWest(),Wr=ft.getNorthEast(),$n=Wr.lat>$t.lat&&ir.lat<_e.lat,ia=Wr.lng>$t.lng&&ir.lng<_e.lng;return $n&&ia},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(ft,$t){return ft?(ft=Bi(ft),this._southWest.equals(ft.getSouthWest(),$t)&&this._northEast.equals(ft.getNorthEast(),$t)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Bi(ft,$t){return ft instanceof qi?ft:new qi(ft,$t)}function Xi(ft,$t,_e){if(isNaN(ft)||isNaN($t))throw new Error("Invalid LatLng object: ("+ft+", "+$t+")");this.lat=+ft,this.lng=+$t,_e!==void 0&&(this.alt=+_e)}Xi.prototype={equals:function(ft,$t){if(!ft)return!1;ft=Yn(ft);var _e=Math.max(Math.abs(this.lat-ft.lat),Math.abs(this.lng-ft.lng));return _e<=($t===void 0?1e-9:$t)},toString:function(ft){return"LatLng("+pe(this.lat,ft)+", "+pe(this.lng,ft)+")"},distanceTo:function(ft){return na.distance(this,Yn(ft))},wrap:function(){return na.wrapLatLng(this)},toBounds:function(ft){var $t=180*ft/40075017,_e=$t/Math.cos(Math.PI/180*this.lat);return Bi([this.lat-$t,this.lng-_e],[this.lat+$t,this.lng+_e])},clone:function(){return new Xi(this.lat,this.lng,this.alt)}};function Yn(ft,$t,_e){return ft instanceof Xi?ft:rn(ft)&&typeof ft[0]!="object"?ft.length===3?new Xi(ft[0],ft[1],ft[2]):ft.length===2?new Xi(ft[0],ft[1]):null:ft==null?ft:typeof ft=="object"&&"lat"in ft?new Xi(ft.lat,"lng"in ft?ft.lng:ft.lon,ft.alt):$t===void 0?null:new Xi(ft,$t,_e)}var hi={latLngToPoint:function(ft,$t){var _e=this.projection.project(ft),ir=this.scale($t);return this.transformation._transform(_e,ir)},pointToLatLng:function(ft,$t){var _e=this.scale($t),ir=this.transformation.untransform(ft,_e);return this.projection.unproject(ir)},project:function(ft){return this.projection.project(ft)},unproject:function(ft){return this.projection.unproject(ft)},scale:function(ft){return 256*Math.pow(2,ft)},zoom:function(ft){return Math.log(ft/256)/Math.LN2},getProjectedBounds:function(ft){if(this.infinite)return null;var $t=this.projection.bounds,_e=this.scale(ft),ir=this.transformation.transform($t.min,_e),Wr=this.transformation.transform($t.max,_e);return new va(ir,Wr)},infinite:!1,wrapLatLng:function(ft){var $t=this.wrapLng?Ut(ft.lng,this.wrapLng,!0):ft.lng,_e=this.wrapLat?Ut(ft.lat,this.wrapLat,!0):ft.lat,ir=ft.alt;return new Xi(_e,$t,ir)},wrapLatLngBounds:function(ft){var $t=ft.getCenter(),_e=this.wrapLatLng($t),ir=$t.lat-_e.lat,Wr=$t.lng-_e.lng;if(ir===0&&Wr===0)return ft;var $n=ft.getSouthWest(),ia=ft.getNorthEast(),ro=new Xi($n.lat-ir,$n.lng-Wr),fo=new Xi(ia.lat-ir,ia.lng-Wr);return new qi(ro,fo)}},na=T({},hi,{wrapLng:[-180,180],R:6371e3,distance:function(ft,$t){var _e=Math.PI/180,ir=ft.lat*_e,Wr=$t.lat*_e,$n=Math.sin(($t.lat-ft.lat)*_e/2),ia=Math.sin(($t.lng-ft.lng)*_e/2),ro=$n*$n+Math.cos(ir)*Math.cos(Wr)*ia*ia,fo=2*Math.atan2(Math.sqrt(ro),Math.sqrt(1-ro));return this.R*fo}}),Xa=6378137,oo={R:Xa,MAX_LATITUDE:85.0511287798,project:function(ft){var $t=Math.PI/180,_e=this.MAX_LATITUDE,ir=Math.max(Math.min(_e,ft.lat),-_e),Wr=Math.sin(ir*$t);return new Xn(this.R*ft.lng*$t,this.R*Math.log((1+Wr)/(1-Wr))/2)},unproject:function(ft){var $t=180/Math.PI;return new Xi((2*Math.atan(Math.exp(ft.y/this.R))-Math.PI/2)*$t,ft.x*$t/this.R)},bounds:function(){var ft=Xa*Math.PI;return new va([-ft,-ft],[ft,ft])}()};function xa(ft,$t,_e,ir){if(rn(ft)){this._a=ft[0],this._b=ft[1],this._c=ft[2],this._d=ft[3];return}this._a=ft,this._b=$t,this._c=_e,this._d=ir}xa.prototype={transform:function(ft,$t){return this._transform(ft.clone(),$t)},_transform:function(ft,$t){return $t=$t||1,ft.x=$t*(this._a*ft.x+this._b),ft.y=$t*(this._c*ft.y+this._d),ft},untransform:function(ft,$t){return $t=$t||1,new Xn((ft.x/$t-this._b)/this._a,(ft.y/$t-this._d)/this._c)}};function Ur(ft,$t,_e,ir){return new xa(ft,$t,_e,ir)}var Sn=T({},na,{code:"EPSG:3857",projection:oo,transformation:function(){var ft=.5/(Math.PI*oo.R);return Ur(ft,.5,-ft,.5)}()}),Hn=T({},Sn,{code:"EPSG:900913"});function to(ft){return document.createElementNS("http://www.w3.org/2000/svg",ft)}function Ha(ft,$t){var _e="",ir,Wr,$n,ia,ro,fo;for(ir=0,$n=ft.length;ir<$n;ir++){for(ro=ft[ir],Wr=0,ia=ro.length;Wr1,o8=function(){var ft=!1;try{var $t=Object.defineProperty({},"passive",{get:function(){ft=!0}});window.addEventListener("testPassiveEventSupport",ne,$t),window.removeEventListener("testPassiveEventSupport",ne,$t)}catch{}return ft}(),s8=function(){return!!document.createElement("canvas").getContext}(),iw=!!(document.createElementNS&&to("svg").createSVGRect),l8=!!iw&&function(){var ft=document.createElement("div");return ft.innerHTML="",(ft.firstChild&&ft.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),c8=!iw&&function(){try{var ft=document.createElement("div");ft.innerHTML='';var $t=ft.firstChild;return $t.style.behavior="url(#default#VML)",$t&&typeof $t.adj=="object"}catch{return!1}}(),b4=navigator.platform.indexOf("Mac")===0,aw=navigator.platform.indexOf("Linux")===0;function W0(ft){return navigator.userAgent.toLowerCase().indexOf(ft)>=0}var Ul={ie:Mo,ielt9:Wo,edge:es,webkit:Io,android:Ys,android23:Jo,androidStock:Us,opera:Ac,chrome:Ou,gecko:Bu,safari:dp,phantom:Wf,opera12:V0,win:lm,ie3d:Hg,webkit3d:Y1,gecko3d:Np,any3d:cm,mobile:Vg,mobileWebkit:Xx,mobileWebkit3d:e8,msPointer:y4,pointer:_4,touch:r8,touchNative:x4,mobileOpera:n8,mobileGecko:i8,retina:a8,passiveEvents:o8,canvas:s8,svg:iw,vml:c8,inlineSvg:l8,mac:b4,linux:aw},sh=Ul.msPointer?"MSPointerDown":"pointerdown",qf=Ul.msPointer?"MSPointerMove":"pointermove",ow=Ul.msPointer?"MSPointerUp":"pointerup",nu=Ul.msPointer?"MSPointerCancel":"pointercancel",w_={touchstart:sh,touchmove:qf,touchend:ow,touchcancel:nu},w4={touchstart:d8,touchmove:Xm,touchend:Xm,touchcancel:Xm},X1={},Jx=!1;function k_(ft,$t,_e){return $t==="touchstart"&&sw(),w4[$t]?(_e=w4[$t].bind(this,_e),ft.addEventListener(w_[$t],_e,!1),_e):(console.warn("wrong event specified:",$t),ne)}function u8(ft,$t,_e){if(!w_[$t]){console.warn("wrong event specified:",$t);return}ft.removeEventListener(w_[$t],_e,!1)}function ls(ft){X1[ft.pointerId]=ft}function h8(ft){X1[ft.pointerId]&&(X1[ft.pointerId]=ft)}function T_(ft){delete X1[ft.pointerId]}function sw(){Jx||(document.addEventListener(sh,ls,!0),document.addEventListener(qf,h8,!0),document.addEventListener(ow,T_,!0),document.addEventListener(nu,T_,!0),Jx=!0)}function Xm(ft,$t){if($t.pointerType!==($t.MSPOINTER_TYPE_MOUSE||"mouse")){$t.touches=[];for(var _e in X1)$t.touches.push(X1[_e]);$t.changedTouches=[$t],ft($t)}}function d8(ft,$t){$t.MSPOINTER_TYPE_TOUCH&&$t.pointerType===$t.MSPOINTER_TYPE_TOUCH&&Cu($t),Xm(ft,$t)}function f8(ft){var $t={},_e,ir;for(ir in ft)_e=ft[ir],$t[ir]=_e&&_e.bind?_e.bind(ft):_e;return ft=$t,$t.type="dblclick",$t.detail=2,$t.isTrusted=!1,$t._simulated=!0,$t}var p8=200;function m8(ft,$t){ft.addEventListener("dblclick",$t);var _e=0,ir;function Wr($n){if($n.detail!==1){ir=$n.detail;return}if(!($n.pointerType==="mouse"||$n.sourceCapabilities&&!$n.sourceCapabilities.firesTouchEvents)){var ia=C4($n);if(!(ia.some(function(fo){return fo instanceof HTMLLabelElement&&fo.attributes.for})&&!ia.some(function(fo){return fo instanceof HTMLInputElement||fo instanceof HTMLSelectElement}))){var ro=Date.now();ro-_e<=p8?(ir++,ir===2&&$t(f8($n))):ir=1,_e=ro}}}return ft.addEventListener("click",Wr),{dblclick:$t,simDblclick:Wr}}function lw(ft,$t){ft.removeEventListener("dblclick",$t.dblclick),ft.removeEventListener("click",$t.simDblclick)}var cw=Gg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),S_=Gg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),k4=S_==="webkitTransition"||S_==="OTransition"?S_+"End":"transitionend";function T4(ft){return typeof ft=="string"?document.getElementById(ft):ft}function C_(ft,$t){var _e=ft.style[$t]||ft.currentStyle&&ft.currentStyle[$t];if((!_e||_e==="auto")&&document.defaultView){var ir=document.defaultView.getComputedStyle(ft,null);_e=ir?ir[$t]:null}return _e==="auto"?null:_e}function $u(ft,$t,_e){var ir=document.createElement(ft);return ir.className=$t||"",_e&&_e.appendChild(ir),ir}function Bd(ft){var $t=ft.parentNode;$t&&$t.removeChild(ft)}function Qx(ft){for(;ft.firstChild;)ft.removeChild(ft.firstChild)}function J1(ft){var $t=ft.parentNode;$t&&$t.lastChild!==ft&&$t.appendChild(ft)}function jn(ft){var $t=ft.parentNode;$t&&$t.firstChild!==ft&&$t.insertBefore(ft,$t.firstChild)}function uw(ft,$t){if(ft.classList!==void 0)return ft.classList.contains($t);var _e=qg(ft);return _e.length>0&&new RegExp("(^|\\s)"+$t+"(\\s|$)").test(_e)}function Qc(ft,$t){if(ft.classList!==void 0)for(var _e=we($t),ir=0,Wr=_e.length;ir0?2*window.devicePixelRatio:1;function Fu(ft){return Ul.edge?ft.wheelDeltaY/2:ft.deltaY&&ft.deltaMode===0?-ft.deltaY/ch:ft.deltaY&&ft.deltaMode===1?-ft.deltaY*20:ft.deltaY&&ft.deltaMode===2?-ft.deltaY*60:ft.deltaX||ft.deltaZ?0:ft.wheelDelta?(ft.wheelDeltaY||ft.wheelDelta)/2:ft.detail&&Math.abs(ft.detail)<32765?-ft.detail*20:ft.detail?ft.detail/-32765*60:0}function Hv(ft,$t){var _e=$t.relatedTarget;if(!_e)return!0;try{for(;_e&&_e!==ft;)_e=_e.parentNode}catch{return!1}return _e!==ft}var T0={__proto__:null,on:Hc,off:Xh,stopPropagation:q0,disableScrollPropagation:Sg,disableClickPropagation:Q1,preventDefault:Cu,stop:$v,getPropagationPath:C4,getMousePosition:Cp,getWheelDelta:Fu,isExternalTarget:Hv,addListener:Hc,removeListener:Xh},E_=Cn.extend({run:function(ft,$t,_e,ir){this.stop(),this._el=ft,this._inProgress=!0,this._duration=_e||.25,this._easeOutPower=1/Math.max(ir||.5,.2),this._startPos=Ku(ft),this._offset=$t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=on(this._animate,this),this._step()},_step:function(ft){var $t=+new Date-this._startTime,_e=this._duration*1e3;$t<_e?this._runFrame(this._easeOut($t/_e),ft):(this._runFrame(1),this._complete())},_runFrame:function(ft,$t){var _e=this._startPos.add(this._offset.multiplyBy(ft));$t&&_e._round(),fu(this._el,_e),this.fire("step")},_complete:function(){pr(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(ft){return 1-Math.pow(1-ft,this._easeOutPower)}}),Nu=Cn.extend({options:{crs:Sn,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(ft,$t){$t=Ce(this,$t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(ft),this._initLayout(),this._onResize=K(this._onResize,this),this._initEvents(),$t.maxBounds&&this.setMaxBounds($t.maxBounds),$t.zoom!==void 0&&(this._zoom=this._limitZoom($t.zoom)),$t.center&&$t.zoom!==void 0&&this.setView(Yn($t.center),$t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=S_&&Ul.any3d&&!Ul.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Hc(this._proxy,k4,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(ft,$t,_e){if($t=$t===void 0?this._zoom:this._limitZoom($t),ft=this._limitCenter(Yn(ft),$t,this.options.maxBounds),_e=_e||{},this._stop(),this._loaded&&!_e.reset&&_e!==!0){_e.animate!==void 0&&(_e.zoom=T({animate:_e.animate},_e.zoom),_e.pan=T({animate:_e.animate,duration:_e.duration},_e.pan));var ir=this._zoom!==$t?this._tryAnimatedZoom&&this._tryAnimatedZoom(ft,$t,_e.zoom):this._tryAnimatedPan(ft,_e.pan);if(ir)return clearTimeout(this._sizeTimer),this}return this._resetView(ft,$t,_e.pan&&_e.pan.noMoveStart),this},setZoom:function(ft,$t){return this._loaded?this.setView(this.getCenter(),ft,{zoom:$t}):(this._zoom=ft,this)},zoomIn:function(ft,$t){return ft=ft||(Ul.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+ft,$t)},zoomOut:function(ft,$t){return ft=ft||(Ul.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-ft,$t)},setZoomAround:function(ft,$t,_e){var ir=this.getZoomScale($t),Wr=this.getSize().divideBy(2),$n=ft instanceof Xn?ft:this.latLngToContainerPoint(ft),ia=$n.subtract(Wr).multiplyBy(1-1/ir),ro=this.containerPointToLatLng(Wr.add(ia));return this.setView(ro,$t,{zoom:_e})},_getBoundsCenterZoom:function(ft,$t){$t=$t||{},ft=ft.getBounds?ft.getBounds():Bi(ft);var _e=ta($t.paddingTopLeft||$t.padding||[0,0]),ir=ta($t.paddingBottomRight||$t.padding||[0,0]),Wr=this.getBoundsZoom(ft,!1,_e.add(ir));if(Wr=typeof $t.maxZoom=="number"?Math.min($t.maxZoom,Wr):Wr,Wr===1/0)return{center:ft.getCenter(),zoom:Wr};var $n=ir.subtract(_e).divideBy(2),ia=this.project(ft.getSouthWest(),Wr),ro=this.project(ft.getNorthEast(),Wr),fo=this.unproject(ia.add(ro).divideBy(2).add($n),Wr);return{center:fo,zoom:Wr}},fitBounds:function(ft,$t){if(ft=Bi(ft),!ft.isValid())throw new Error("Bounds are not valid.");var _e=this._getBoundsCenterZoom(ft,$t);return this.setView(_e.center,_e.zoom,$t)},fitWorld:function(ft){return this.fitBounds([[-90,-180],[90,180]],ft)},panTo:function(ft,$t){return this.setView(ft,this._zoom,{pan:$t})},panBy:function(ft,$t){if(ft=ta(ft).round(),$t=$t||{},!ft.x&&!ft.y)return this.fire("moveend");if($t.animate!==!0&&!this.getSize().contains(ft))return this._resetView(this.unproject(this.project(this.getCenter()).add(ft)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new E_,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),$t.noMoveStart||this.fire("movestart"),$t.animate!==!1){Qc(this._mapPane,"leaflet-pan-anim");var _e=this._getMapPanePos().subtract(ft).round();this._panAnim.run(this._mapPane,_e,$t.duration||.25,$t.easeLinearity)}else this._rawPanBy(ft),this.fire("move").fire("moveend");return this},flyTo:function(ft,$t,_e){if(_e=_e||{},_e.animate===!1||!Ul.any3d)return this.setView(ft,$t,_e);this._stop();var ir=this.project(this.getCenter()),Wr=this.project(ft),$n=this.getSize(),ia=this._zoom;ft=Yn(ft),$t=$t===void 0?ia:$t;var ro=Math.max($n.x,$n.y),fo=ro*this.getZoomScale(ia,$t),Do=Wr.distanceTo(ir)||1,tl=1.42,Il=tl*tl;function qc(Ef){var gb=Ef?-1:1,Lw=Ef?fo:ro,A8=fo*fo-ro*ro+gb*Il*Il*Do*Do,W4=2*Lw*Il*Do,Pw=A8/W4,q4=Math.sqrt(Pw*Pw+1)-Pw,M8=q4<1e-9?-18:Math.log(q4);return M8}function Kf(Ef){return(Math.exp(Ef)-Math.exp(-Ef))/2}function Qd(Ef){return(Math.exp(Ef)+Math.exp(-Ef))/2}function mm(Ef){return Kf(Ef)/Qd(Ef)}var c0=qc(0);function Jg(Ef){return ro*(Qd(c0)/Qd(c0+tl*Ef))}function pb(Ef){return ro*(Qd(c0)*mm(c0+tl*Ef)-Kf(c0))/Il}function mb(Ef){return 1-Math.pow(1-Ef,1.5)}var Ew=Date.now(),V4=(qc(1)-c0)/tl,C8=_e.duration?1e3*_e.duration:1e3*V4*.8;function Fd(){var Ef=(Date.now()-Ew)/C8,gb=mb(Ef)*V4;Ef<=1?(this._flyToFrame=on(Fd,this),this._move(this.unproject(ir.add(Wr.subtract(ir).multiplyBy(pb(gb)/Do)),ia),this.getScaleZoom(ro/Jg(gb),ia),{flyTo:!0})):this._move(ft,$t)._moveEnd(!0)}return this._moveStart(!0,_e.noMoveStart),Fd.call(this),this},flyToBounds:function(ft,$t){var _e=this._getBoundsCenterZoom(ft,$t);return this.flyTo(_e.center,_e.zoom,$t)},setMaxBounds:function(ft){return ft=Bi(ft),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),ft.isValid()?(this.options.maxBounds=ft,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(ft){var $t=this.options.minZoom;return this.options.minZoom=ft,this._loaded&&$t!==ft&&(this.fire("zoomlevelschange"),this.getZoom()this.options.maxZoom)?this.setZoom(ft):this},panInsideBounds:function(ft,$t){this._enforcingBounds=!0;var _e=this.getCenter(),ir=this._limitCenter(_e,this._zoom,Bi(ft));return _e.equals(ir)||this.panTo(ir,$t),this._enforcingBounds=!1,this},panInside:function(ft,$t){$t=$t||{};var _e=ta($t.paddingTopLeft||$t.padding||[0,0]),ir=ta($t.paddingBottomRight||$t.padding||[0,0]),Wr=this.project(this.getCenter()),$n=this.project(ft),ia=this.getPixelBounds(),ro=_a([ia.min.add(_e),ia.max.subtract(ir)]),fo=ro.getSize();if(!ro.contains($n)){this._enforcingBounds=!0;var Do=$n.subtract(ro.getCenter()),tl=ro.extend($n).getSize().subtract(fo);Wr.x+=Do.x<0?-tl.x:tl.x,Wr.y+=Do.y<0?-tl.y:tl.y,this.panTo(this.unproject(Wr),$t),this._enforcingBounds=!1}return this},invalidateSize:function(ft){if(!this._loaded)return this;ft=T({animate:!1,pan:!0},ft===!0?{animate:!0}:ft);var $t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var _e=this.getSize(),ir=$t.divideBy(2).round(),Wr=_e.divideBy(2).round(),$n=ir.subtract(Wr);return!$n.x&&!$n.y?this:(ft.animate&&ft.pan?this.panBy($n):(ft.pan&&this._rawPanBy($n),this.fire("move"),ft.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(K(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:$t,newSize:_e}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(ft){if(ft=this._locateOptions=T({timeout:1e4,watch:!1},ft),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var $t=K(this._handleGeolocationResponse,this),_e=K(this._handleGeolocationError,this);return ft.watch?this._locationWatchId=navigator.geolocation.watchPosition($t,_e,ft):navigator.geolocation.getCurrentPosition($t,_e,ft),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(ft){if(this._container._leaflet_id){var $t=ft.code,_e=ft.message||($t===1?"permission denied":$t===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:$t,message:"Geolocation error: "+_e+"."})}},_handleGeolocationResponse:function(ft){if(this._container._leaflet_id){var $t=ft.coords.latitude,_e=ft.coords.longitude,ir=new Xi($t,_e),Wr=ir.toBounds(ft.coords.accuracy*2),$n=this._locateOptions;if($n.setView){var ia=this.getBoundsZoom(Wr);this.setView(ir,$n.maxZoom?Math.min(ia,$n.maxZoom):ia)}var ro={latlng:ir,bounds:Wr,timestamp:ft.timestamp};for(var fo in ft.coords)typeof ft.coords[fo]=="number"&&(ro[fo]=ft.coords[fo]);this.fire("locationfound",ro)}},addHandler:function(ft,$t){if(!$t)return this;var _e=this[ft]=new $t(this);return this._handlers.push(_e),this.options[ft]&&_e.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Bd(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(pr(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var ft;for(ft in this._layers)this._layers[ft].remove();for(ft in this._panes)Bd(this._panes[ft]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(ft,$t){var _e="leaflet-pane"+(ft?" leaflet-"+ft.replace("Pane","")+"-pane":""),ir=$u("div",_e,$t||this._mapPane);return ft&&(this._panes[ft]=ir),ir},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var ft=this.getPixelBounds(),$t=this.unproject(ft.getBottomLeft()),_e=this.unproject(ft.getTopRight());return new qi($t,_e)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(ft,$t,_e){ft=Bi(ft),_e=ta(_e||[0,0]);var ir=this.getZoom()||0,Wr=this.getMinZoom(),$n=this.getMaxZoom(),ia=ft.getNorthWest(),ro=ft.getSouthEast(),fo=this.getSize().subtract(_e),Do=_a(this.project(ro,ir),this.project(ia,ir)).getSize(),tl=Ul.any3d?this.options.zoomSnap:1,Il=fo.x/Do.x,qc=fo.y/Do.y,Kf=$t?Math.max(Il,qc):Math.min(Il,qc);return ir=this.getScaleZoom(Kf,ir),tl&&(ir=Math.round(ir/(tl/100))*(tl/100),ir=$t?Math.ceil(ir/tl)*tl:Math.floor(ir/tl)*tl),Math.max(Wr,Math.min($n,ir))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Xn(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(ft,$t){var _e=this._getTopLeftPoint(ft,$t);return new va(_e,_e.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(ft){return this.options.crs.getProjectedBounds(ft===void 0?this.getZoom():ft)},getPane:function(ft){return typeof ft=="string"?this._panes[ft]:ft},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(ft,$t){var _e=this.options.crs;return $t=$t===void 0?this._zoom:$t,_e.scale(ft)/_e.scale($t)},getScaleZoom:function(ft,$t){var _e=this.options.crs;$t=$t===void 0?this._zoom:$t;var ir=_e.zoom(ft*_e.scale($t));return isNaN(ir)?1/0:ir},project:function(ft,$t){return $t=$t===void 0?this._zoom:$t,this.options.crs.latLngToPoint(Yn(ft),$t)},unproject:function(ft,$t){return $t=$t===void 0?this._zoom:$t,this.options.crs.pointToLatLng(ta(ft),$t)},layerPointToLatLng:function(ft){var $t=ta(ft).add(this.getPixelOrigin());return this.unproject($t)},latLngToLayerPoint:function(ft){var $t=this.project(Yn(ft))._round();return $t._subtract(this.getPixelOrigin())},wrapLatLng:function(ft){return this.options.crs.wrapLatLng(Yn(ft))},wrapLatLngBounds:function(ft){return this.options.crs.wrapLatLngBounds(Bi(ft))},distance:function(ft,$t){return this.options.crs.distance(Yn(ft),Yn($t))},containerPointToLayerPoint:function(ft){return ta(ft).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(ft){return ta(ft).add(this._getMapPanePos())},containerPointToLatLng:function(ft){var $t=this.containerPointToLayerPoint(ta(ft));return this.layerPointToLatLng($t)},latLngToContainerPoint:function(ft){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Yn(ft)))},mouseEventToContainerPoint:function(ft){return Cp(ft,this._container)},mouseEventToLayerPoint:function(ft){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(ft))},mouseEventToLatLng:function(ft){return this.layerPointToLatLng(this.mouseEventToLayerPoint(ft))},_initContainer:function(ft){var $t=this._container=T4(ft);if($t){if($t._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Hc($t,"scroll",this._onScroll,this),this._containerId=yt($t)},_initLayout:function(){var ft=this._container;this._fadeAnimated=this.options.fadeAnimation&&Ul.any3d,Qc(ft,"leaflet-container"+(Ul.touch?" leaflet-touch":"")+(Ul.retina?" leaflet-retina":"")+(Ul.ielt9?" leaflet-oldie":"")+(Ul.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var $t=C_(ft,"position");$t!=="absolute"&&$t!=="relative"&&$t!=="fixed"&&$t!=="sticky"&&(ft.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var ft=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),fu(this._mapPane,new Xn(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Qc(ft.markerPane,"leaflet-zoom-hide"),Qc(ft.shadowPane,"leaflet-zoom-hide"))},_resetView:function(ft,$t,_e){fu(this._mapPane,new Xn(0,0));var ir=!this._loaded;this._loaded=!0,$t=this._limitZoom($t),this.fire("viewprereset");var Wr=this._zoom!==$t;this._moveStart(Wr,_e)._move(ft,$t)._moveEnd(Wr),this.fire("viewreset"),ir&&this.fire("load")},_moveStart:function(ft,$t){return ft&&this.fire("zoomstart"),$t||this.fire("movestart"),this},_move:function(ft,$t,_e,ir){$t===void 0&&($t=this._zoom);var Wr=this._zoom!==$t;return this._zoom=$t,this._lastCenter=ft,this._pixelOrigin=this._getNewPixelOrigin(ft),ir?_e&&_e.pinch&&this.fire("zoom",_e):((Wr||_e&&_e.pinch)&&this.fire("zoom",_e),this.fire("move",_e)),this},_moveEnd:function(ft){return ft&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return pr(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(ft){fu(this._mapPane,this._getMapPanePos().subtract(ft))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(ft){this._targets={},this._targets[yt(this._container)]=this;var $t=ft?Xh:Hc;$t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&$t(window,"resize",this._onResize,this),Ul.any3d&&this.options.transform3DLimit&&(ft?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){pr(this._resizeRequest),this._resizeRequest=on(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var ft=this._getMapPanePos();Math.max(Math.abs(ft.x),Math.abs(ft.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(ft,$t){for(var _e=[],ir,Wr=$t==="mouseout"||$t==="mouseover",$n=ft.target||ft.srcElement,ia=!1;$n;){if(ir=this._targets[yt($n)],ir&&($t==="click"||$t==="preclick")&&this._draggableMoved(ir)){ia=!0;break}if(ir&&ir.listens($t,!0)&&(Wr&&!Hv($n,ft)||(_e.push(ir),Wr))||$n===this._container)break;$n=$n.parentNode}return!_e.length&&!ia&&!Wr&&this.listens($t,!0)&&(_e=[this]),_e},_isClickDisabled:function(ft){for(;ft&&ft!==this._container;){if(ft._leaflet_disable_click)return!0;ft=ft.parentNode}},_handleDOMEvent:function(ft){var $t=ft.target||ft.srcElement;if(!(!this._loaded||$t._leaflet_disable_events||ft.type==="click"&&this._isClickDisabled($t))){var _e=ft.type;_e==="mousedown"&&fp($t),this._fireDOMEvent(ft,_e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(ft,$t,_e){if(ft.type==="click"){var ir=T({},ft);ir.type="preclick",this._fireDOMEvent(ir,ir.type,_e)}var Wr=this._findEventTargets(ft,$t);if(_e){for(var $n=[],ia=0;ia<_e.length;ia++)_e[ia].listens($t,!0)&&$n.push(_e[ia]);Wr=$n.concat(Wr)}if(Wr.length){$t==="contextmenu"&&Cu(ft);var ro=Wr[0],fo={originalEvent:ft};if(ft.type!=="keypress"&&ft.type!=="keydown"&&ft.type!=="keyup"){var Do=ro.getLatLng&&(!ro._radius||ro._radius<=10);fo.containerPoint=Do?this.latLngToContainerPoint(ro.getLatLng()):this.mouseEventToContainerPoint(ft),fo.layerPoint=this.containerPointToLayerPoint(fo.containerPoint),fo.latlng=Do?ro.getLatLng():this.layerPointToLatLng(fo.layerPoint)}for(ia=0;ia0?Math.round(ft-$t)/2:Math.max(0,Math.ceil(ft))-Math.max(0,Math.floor($t))},_limitZoom:function(ft){var $t=this.getMinZoom(),_e=this.getMaxZoom(),ir=Ul.any3d?this.options.zoomSnap:1;return ir&&(ft=Math.round(ft/ir)*ir),Math.max($t,Math.min(_e,ft))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Jd(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(ft,$t){var _e=this._getCenterOffset(ft)._trunc();return($t&&$t.animate)!==!0&&!this.getSize().contains(_e)?!1:(this.panBy(_e,$t),!0)},_createAnimProxy:function(){var ft=this._proxy=$u("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(ft),this.on("zoomanim",function($t){var _e=cw,ir=this._proxy.style[_e];Tc(this._proxy,this.project($t.center,$t.zoom),this.getZoomScale($t.zoom,1)),ir===this._proxy.style[_e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Bd(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var ft=this.getCenter(),$t=this.getZoom();Tc(this._proxy,this.project(ft,$t),this.getZoomScale($t,1))},_catchTransitionEnd:function(ft){this._animatingZoom&&ft.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(ft,$t,_e){if(this._animatingZoom)return!0;if(_e=_e||{},!this._zoomAnimated||_e.animate===!1||this._nothingToAnimate()||Math.abs($t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var ir=this.getZoomScale($t),Wr=this._getCenterOffset(ft)._divideBy(1-1/ir);return _e.animate!==!0&&!this.getSize().contains(Wr)?!1:(on(function(){this._moveStart(!0,_e.noMoveStart||!1)._animateZoom(ft,$t,!0)},this),!0)},_animateZoom:function(ft,$t,_e,ir){this._mapPane&&(_e&&(this._animatingZoom=!0,this._animateToCenter=ft,this._animateToZoom=$t,Qc(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:ft,zoom:$t,noUpdate:ir}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(K(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Jd(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Js(ft,$t){return new Nu(ft,$t)}var jp=Sr.extend({options:{position:"topright"},initialize:function(ft){Ce(this,ft)},getPosition:function(){return this.options.position},setPosition:function(ft){var $t=this._map;return $t&&$t.removeControl(this),this.options.position=ft,$t&&$t.addControl(this),this},getContainer:function(){return this._container},addTo:function(ft){this.remove(),this._map=ft;var $t=this._container=this.onAdd(ft),_e=this.getPosition(),ir=ft._controlCorners[_e];return Qc($t,"leaflet-control"),_e.indexOf("bottom")!==-1?ir.insertBefore($t,ir.firstChild):ir.appendChild($t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Bd(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(ft){this._map&&ft&&ft.screenX>0&&ft.screenY>0&&this._map.getContainer().focus()}}),G0=function(ft){return new jp(ft)};Nu.include({addControl:function(ft){return ft.addTo(this),this},removeControl:function(ft){return ft.remove(),this},_initControlPos:function(){var ft=this._controlCorners={},$t="leaflet-",_e=this._controlContainer=$u("div",$t+"control-container",this._container);function ir(Wr,$n){var ia=$t+Wr+" "+$t+$n;ft[Wr+$n]=$u("div",ia,_e)}ir("top","left"),ir("top","right"),ir("bottom","left"),ir("bottom","right")},_clearControlPos:function(){for(var ft in this._controlCorners)Bd(this._controlCorners[ft]);Bd(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ty=jp.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(ft,$t,_e,ir){return _e1,this._baseLayersList.style.display=ft?"":"none"),this._separator.style.display=$t&&ft?"":"none",this},_onLayerChange:function(ft){this._handlingClick||this._update();var $t=this._getLayer(yt(ft.target)),_e=$t.overlay?ft.type==="add"?"overlayadd":"overlayremove":ft.type==="add"?"baselayerchange":null;_e&&this._map.fire(_e,$t)},_createRadioElement:function(ft,$t){var _e='",ir=document.createElement("div");return ir.innerHTML=_e,ir.firstChild},_addItem:function(ft){var $t=document.createElement("label"),_e=this._map.hasLayer(ft.layer),ir;ft.overlay?(ir=document.createElement("input"),ir.type="checkbox",ir.className="leaflet-control-layers-selector",ir.defaultChecked=_e):ir=this._createRadioElement("leaflet-base-layers_"+yt(this),_e),this._layerControlInputs.push(ir),ir.layerId=yt(ft.layer),Hc(ir,"click",this._onInputClick,this);var Wr=document.createElement("span");Wr.innerHTML=" "+ft.name;var $n=document.createElement("span");$t.appendChild($n),$n.appendChild(ir),$n.appendChild(Wr);var ia=ft.overlay?this._overlaysList:this._baseLayersList;return ia.appendChild($t),this._checkDisabledLayers(),$t},_onInputClick:function(){if(!this._preventClick){var ft=this._layerControlInputs,$t,_e,ir=[],Wr=[];this._handlingClick=!0;for(var $n=ft.length-1;$n>=0;$n--)$t=ft[$n],_e=this._getLayer($t.layerId).layer,$t.checked?ir.push(_e):$t.checked||Wr.push(_e);for($n=0;$n=0;Wr--)$t=ft[Wr],_e=this._getLayer($t.layerId).layer,$t.disabled=_e.options.minZoom!==void 0&&ir<_e.options.minZoom||_e.options.maxZoom!==void 0&&ir>_e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var ft=this._section;this._preventClick=!0,Hc(ft,"click",Cu),this.expand();var $t=this;setTimeout(function(){Xh(ft,"click",Cu),$t._preventClick=!1})}}),Jm=function(ft,$t,_e){return new ty(ft,$t,_e)},Fs=jp.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(ft){var $t="leaflet-control-zoom",_e=$u("div",$t+" leaflet-bar"),ir=this.options;return this._zoomInButton=this._createButton(ir.zoomInText,ir.zoomInTitle,$t+"-in",_e,this._zoomIn),this._zoomOutButton=this._createButton(ir.zoomOutText,ir.zoomOutTitle,$t+"-out",_e,this._zoomOut),this._updateDisabled(),ft.on("zoomend zoomlevelschange",this._updateDisabled,this),_e},onRemove:function(ft){ft.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(ft){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(ft.shiftKey?3:1))},_createButton:function(ft,$t,_e,ir,Wr){var $n=$u("a",_e,ir);return $n.innerHTML=ft,$n.href="#",$n.title=$t,$n.setAttribute("role","button"),$n.setAttribute("aria-label",$t),Q1($n),Hc($n,"click",$v),Hc($n,"click",Wr,this),Hc($n,"click",this._refocusOnMap,this),$n},_updateDisabled:function(){var ft=this._map,$t="leaflet-disabled";Jd(this._zoomInButton,$t),Jd(this._zoomOutButton,$t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||ft._zoom===ft.getMinZoom())&&(Qc(this._zoomOutButton,$t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||ft._zoom===ft.getMaxZoom())&&(Qc(this._zoomInButton,$t),this._zoomInButton.setAttribute("aria-disabled","true"))}});Nu.mergeOptions({zoomControl:!0}),Nu.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Fs,this.addControl(this.zoomControl))});var A4=function(ft){return new Fs(ft)},hw=jp.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(ft){var $t="leaflet-control-scale",_e=$u("div",$t),ir=this.options;return this._addScales(ir,$t+"-line",_e),ft.on(ir.updateWhenIdle?"moveend":"move",this._update,this),ft.whenReady(this._update,this),_e},onRemove:function(ft){ft.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(ft,$t,_e){ft.metric&&(this._mScale=$u("div",$t,_e)),ft.imperial&&(this._iScale=$u("div",$t,_e))},_update:function(){var ft=this._map,$t=ft.getSize().y/2,_e=ft.distance(ft.containerPointToLatLng([0,$t]),ft.containerPointToLatLng([this.options.maxWidth,$t]));this._updateScales(_e)},_updateScales:function(ft){this.options.metric&&ft&&this._updateMetric(ft),this.options.imperial&&ft&&this._updateImperial(ft)},_updateMetric:function(ft){var $t=this._getRoundNum(ft),_e=$t<1e3?$t+" m":$t/1e3+" km";this._updateScale(this._mScale,_e,$t/ft)},_updateImperial:function(ft){var $t=ft*3.2808399,_e,ir,Wr;$t>5280?(_e=$t/5280,ir=this._getRoundNum(_e),this._updateScale(this._iScale,ir+" mi",ir/_e)):(Wr=this._getRoundNum($t),this._updateScale(this._iScale,Wr+" ft",Wr/$t))},_updateScale:function(ft,$t,_e){ft.style.width=Math.round(this.options.maxWidth*_e)+"px",ft.innerHTML=$t},_getRoundNum:function(ft){var $t=Math.pow(10,(Math.floor(ft)+"").length-1),_e=ft/$t;return _e=_e>=10?10:_e>=5?5:_e>=3?3:_e>=2?2:1,$t*_e}}),g8=function(ft){return new hw(ft)},dw='',fw=jp.extend({options:{position:"bottomright",prefix:''+(Ul.inlineSvg?dw+" ":"")+"Leaflet"},initialize:function(ft){Ce(this,ft),this._attributions={}},onAdd:function(ft){ft.attributionControl=this,this._container=$u("div","leaflet-control-attribution"),Q1(this._container);for(var $t in ft._layers)ft._layers[$t].getAttribution&&this.addAttribution(ft._layers[$t].getAttribution());return this._update(),ft.on("layeradd",this._addAttribution,this),this._container},onRemove:function(ft){ft.off("layeradd",this._addAttribution,this)},_addAttribution:function(ft){ft.layer.getAttribution&&(this.addAttribution(ft.layer.getAttribution()),ft.layer.once("remove",function(){this.removeAttribution(ft.layer.getAttribution())},this))},setPrefix:function(ft){return this.options.prefix=ft,this._update(),this},addAttribution:function(ft){return ft?(this._attributions[ft]||(this._attributions[ft]=0),this._attributions[ft]++,this._update(),this):this},removeAttribution:function(ft){return ft?(this._attributions[ft]&&(this._attributions[ft]--,this._update()),this):this},_update:function(){if(this._map){var ft=[];for(var $t in this._attributions)this._attributions[$t]&&ft.push($t);var _e=[];this.options.prefix&&_e.push(this.options.prefix),ft.length&&_e.push(ft.join(", ")),this._container.innerHTML=_e.join(' ')}}});Nu.mergeOptions({attributionControl:!0}),Nu.addInitHook(function(){this.options.attributionControl&&new fw().addTo(this)});var v8=function(ft){return new fw(ft)};jp.Layers=ty,jp.Zoom=Fs,jp.Scale=hw,jp.Attribution=fw,G0.layers=Jm,G0.zoom=A4,G0.scale=g8,G0.attribution=v8;var Qm=Sr.extend({initialize:function(ft){this._map=ft},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Qm.addTo=function(ft,$t){return ft.addHandler($t,this),this};var Up={Events:nn},Mm=Ul.touch?"touchstart mousedown":"mousedown",Zg=Cn.extend({options:{clickTolerance:3},initialize:function(ft,$t,_e,ir){Ce(this,ir),this._element=ft,this._dragStartTarget=$t||ft,this._preventOutline=_e},enable:function(){this._enabled||(Hc(this._dragStartTarget,Mm,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Zg._dragging===this&&this.finishDrag(!0),Xh(this._dragStartTarget,Mm,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(ft){if(this._enabled&&(this._moved=!1,!uw(this._element,"leaflet-zoom-anim"))){if(ft.touches&&ft.touches.length!==1){Zg._dragging===this&&this.finishDrag();return}if(!(Zg._dragging||ft.shiftKey||ft.which!==1&&ft.button!==1&&!ft.touches)&&(Zg._dragging=this,this._preventOutline&&fp(this._element),lh(),Cm(),!this._moving)){this.fire("down");var $t=ft.touches?ft.touches[0]:ft,_e=Gf(this._element);this._startPoint=new Xn($t.clientX,$t.clientY),this._startPos=Ku(this._element),this._parentScale=M_(_e);var ir=ft.type==="mousedown";Hc(document,ir?"mousemove":"touchmove",this._onMove,this),Hc(document,ir?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(ft){if(this._enabled){if(ft.touches&&ft.touches.length>1){this._moved=!0;return}var $t=ft.touches&&ft.touches.length===1?ft.touches[0]:ft,_e=new Xn($t.clientX,$t.clientY)._subtract(this._startPoint);!_e.x&&!_e.y||Math.abs(_e.x)+Math.abs(_e.y)$n&&(ia=ro,$n=fo);$n>_e&&($t[ia]=1,Wv(ft,$t,_e,ir,ia),Wv(ft,$t,_e,ia,Wr))}function E4(ft,$t){for(var _e=[ft[0]],ir=1,Wr=0,$n=ft.length;ir<$n;ir++)x8(ft[ir],ft[Wr])>$t&&(_e.push(ft[ir]),Wr=ir);return Wr<$n-1&&_e.push(ft[$n-1]),_e}var gw;function vw(ft,$t,_e,ir,Wr){var $n=ir?gw:Gv(ft,_e),ia=Gv($t,_e),ro,fo,Do;for(gw=ia;;){if(!($n|ia))return[ft,$t];if($n&ia)return!1;ro=$n||ia,fo=qv(ft,$t,ro,_e,Wr),Do=Gv(fo,_e),ro===$n?(ft=fo,$n=Do):($t=fo,ia=Do)}}function qv(ft,$t,_e,ir,Wr){var $n=$t.x-ft.x,ia=$t.y-ft.y,ro=ir.min,fo=ir.max,Do,tl;return _e&8?(Do=ft.x+$n*(fo.y-ft.y)/ia,tl=fo.y):_e&4?(Do=ft.x+$n*(ro.y-ft.y)/ia,tl=ro.y):_e&2?(Do=fo.x,tl=ft.y+ia*(fo.x-ft.x)/$n):_e&1&&(Do=ro.x,tl=ft.y+ia*(ro.x-ft.x)/$n),new Xn(Do,tl,Wr)}function Gv(ft,$t){var _e=0;return ft.x<$t.min.x?_e|=1:ft.x>$t.max.x&&(_e|=2),ft.y<$t.min.y?_e|=4:ft.y>$t.max.y&&(_e|=8),_e}function x8(ft,$t){var _e=$t.x-ft.x,ir=$t.y-ft.y;return _e*_e+ir*ir}function ey(ft,$t,_e,ir){var Wr=$t.x,$n=$t.y,ia=_e.x-Wr,ro=_e.y-$n,fo=ia*ia+ro*ro,Do;return fo>0&&(Do=((ft.x-Wr)*ia+(ft.y-$n)*ro)/fo,Do>1?(Wr=_e.x,$n=_e.y):Do>0&&(Wr+=ia*Do,$n+=ro*Do)),ia=ft.x-Wr,ro=ft.y-$n,ir?ia*ia+ro*ro:new Xn(Wr,$n)}function hm(ft){return!rn(ft[0])||typeof ft[0][0]!="object"&&typeof ft[0][0]<"u"}function L4(ft){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),hm(ft)}function P4(ft,$t){var _e,ir,Wr,$n,ia,ro,fo,Do;if(!ft||ft.length===0)throw new Error("latlngs not passed");hm(ft)||(console.warn("latlngs are not flat! Only the first ring will be used"),ft=ft[0]);var tl=Yn([0,0]),Il=Bi(ft),qc=Il.getNorthWest().distanceTo(Il.getSouthWest())*Il.getNorthEast().distanceTo(Il.getNorthWest());qc<1700&&(tl=rb(ft));var Kf=ft.length,Qd=[];for(_e=0;_eir){fo=($n-ir)/Wr,Do=[ro.x-fo*(ro.x-ia.x),ro.y-fo*(ro.y-ia.y)];break}var c0=$t.unproject(ta(Do));return Yn([c0.lat+tl.lat,c0.lng+tl.lng])}var hd={__proto__:null,simplify:mw,pointToSegmentDistance:M4,closestPointOnSegment:Vv,clipSegment:vw,_getEdgeIntersection:qv,_getBitCode:Gv,_sqClosestPointOnSegment:ey,isFlat:hm,_flat:L4,polylineCenter:P4},dm={project:function(ft){return new Xn(ft.lng,ft.lat)},unproject:function(ft){return new Xi(ft.y,ft.x)},bounds:new va([-180,-90],[180,90])},ry={R:6378137,R_MINOR:6356752314245179e-9,bounds:new va([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(ft){var $t=Math.PI/180,_e=this.R,ir=ft.lat*$t,Wr=this.R_MINOR/_e,$n=Math.sqrt(1-Wr*Wr),ia=$n*Math.sin(ir),ro=Math.tan(Math.PI/4-ir/2)/Math.pow((1-ia)/(1+ia),$n/2);return ir=-_e*Math.log(Math.max(ro,1e-10)),new Xn(ft.lng*$t*_e,ir)},unproject:function(ft){for(var $t=180/Math.PI,_e=this.R,ir=this.R_MINOR/_e,Wr=Math.sqrt(1-ir*ir),$n=Math.exp(-ft.y/_e),ia=Math.PI/2-2*Math.atan($n),ro=0,fo=.1,Do;ro<15&&Math.abs(fo)>1e-7;ro++)Do=Wr*Math.sin(ia),Do=Math.pow((1-Do)/(1+Do),Wr/2),fo=Math.PI/2-2*Math.atan($n*Do)-ia,ia+=fo;return new Xi(ia*$t,ft.x*$t/_e)}},yw={__proto__:null,LonLat:dm,Mercator:ry,SphericalMercator:oo},_w=T({},na,{code:"EPSG:3395",projection:ry,transformation:function(){var ft=.5/(Math.PI*ry.R);return Ur(ft,.5,-ft,.5)}()}),nb=T({},na,{code:"EPSG:4326",projection:dm,transformation:Ur(1/180,1,-1/180,.5)}),Zv=T({},hi,{projection:dm,transformation:Ur(1,0,-1,0),scale:function(ft){return Math.pow(2,ft)},zoom:function(ft){return Math.log(ft)/Math.LN2},distance:function(ft,$t){var _e=$t.lng-ft.lng,ir=$t.lat-ft.lat;return Math.sqrt(_e*_e+ir*ir)},infinite:!0});hi.Earth=na,hi.EPSG3395=_w,hi.EPSG3857=Sn,hi.EPSG900913=Hn,hi.EPSG4326=nb,hi.Simple=Zv;var Z0=Cn.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(ft){return ft.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(ft){return ft&&ft.removeLayer(this),this},getPane:function(ft){return this._map.getPane(ft?this.options[ft]||ft:this.options.pane)},addInteractiveTarget:function(ft){return this._map._targets[yt(ft)]=this,this},removeInteractiveTarget:function(ft){return delete this._map._targets[yt(ft)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(ft){var $t=ft.target;if($t.hasLayer(this)){if(this._map=$t,this._zoomAnimated=$t._zoomAnimated,this.getEvents){var _e=this.getEvents();$t.on(_e,this),this.once("remove",function(){$t.off(_e,this)},this)}this.onAdd($t),this.fire("add"),$t.fire("layeradd",{layer:this})}}});Nu.include({addLayer:function(ft){if(!ft._layerAdd)throw new Error("The provided object is not a Layer.");var $t=yt(ft);return this._layers[$t]?this:(this._layers[$t]=ft,ft._mapToAdd=this,ft.beforeAdd&&ft.beforeAdd(this),this.whenReady(ft._layerAdd,ft),this)},removeLayer:function(ft){var $t=yt(ft);return this._layers[$t]?(this._loaded&&ft.onRemove(this),delete this._layers[$t],this._loaded&&(this.fire("layerremove",{layer:ft}),ft.fire("remove")),ft._map=ft._mapToAdd=null,this):this},hasLayer:function(ft){return yt(ft)in this._layers},eachLayer:function(ft,$t){for(var _e in this._layers)ft.call($t,this._layers[_e]);return this},_addLayers:function(ft){ft=ft?rn(ft)?ft:[ft]:[];for(var $t=0,_e=ft.length;$t<_e;$t++)this.addLayer(ft[$t])},_addZoomLimit:function(ft){(!isNaN(ft.options.maxZoom)||!isNaN(ft.options.minZoom))&&(this._zoomBoundLayers[yt(ft)]=ft,this._updateZoomLevels())},_removeZoomLimit:function(ft){var $t=yt(ft);this._zoomBoundLayers[$t]&&(delete this._zoomBoundLayers[$t],this._updateZoomLevels())},_updateZoomLevels:function(){var ft=1/0,$t=-1/0,_e=this._getZoomSpan();for(var ir in this._zoomBoundLayers){var Wr=this._zoomBoundLayers[ir].options;ft=Wr.minZoom===void 0?ft:Math.min(ft,Wr.minZoom),$t=Wr.maxZoom===void 0?$t:Math.max($t,Wr.maxZoom)}this._layersMaxZoom=$t===-1/0?void 0:$t,this._layersMinZoom=ft===1/0?void 0:ft,_e!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&$t[0]instanceof Xi&&$t[0].equals($t[_e-1])&&$t.pop(),$t},_setLatLngs:function(ft){fm.prototype._setLatLngs.call(this,ft),hm(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return hm(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var ft=this._renderer._bounds,$t=this.options.weight,_e=new Xn($t,$t);if(ft=new va(ft.min.subtract(_e),ft.max.add(_e)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(ft))){if(this.options.noClip){this._parts=this._rings;return}for(var ir=0,Wr=this._rings.length,$n;irft.y!=Wr.y>ft.y&&ft.x<(Wr.x-ir.x)*(ft.y-ir.y)/(Wr.y-ir.y)+ir.x&&($t=!$t);return $t||fm.prototype._containsPoint.call(this,ft,!0)}});function w8(ft,$t){return new ay(ft,$t)}var Cg=l0.extend({initialize:function(ft,$t){Ce(this,$t),this._layers={},ft&&this.addData(ft)},addData:function(ft){var $t=rn(ft)?ft:ft.features,_e,ir,Wr;if($t){for(_e=0,ir=$t.length;_e0&&Wr.push(Wr[0].slice()),Wr}function Ag(ft,$t){return ft.feature?T({},ft.feature,{geometry:$t}):ub($t)}function ub(ft){return ft.type==="Feature"||ft.type==="FeatureCollection"?ft:{type:"Feature",properties:{},geometry:ft}}var Tw={toGeoJSON:function(ft){return Ag(this,{type:"Point",coordinates:kw(this.getLatLng(),ft)})}};L_.include(Tw),ob.include(Tw),ab.include(Tw),fm.include({toGeoJSON:function(ft){var $t=!hm(this._latlngs),_e=cb(this._latlngs,$t?1:0,!1,ft);return Ag(this,{type:($t?"Multi":"")+"LineString",coordinates:_e})}}),ay.include({toGeoJSON:function(ft){var $t=!hm(this._latlngs),_e=$t&&!hm(this._latlngs[0]),ir=cb(this._latlngs,_e?2:$t?1:0,!0,ft);return $t||(ir=[ir]),Ag(this,{type:(_e?"Multi":"")+"Polygon",coordinates:ir})}}),Kv.include({toMultiPoint:function(ft){var $t=[];return this.eachLayer(function(_e){$t.push(_e.toGeoJSON(ft).geometry.coordinates)}),Ag(this,{type:"MultiPoint",coordinates:$t})},toGeoJSON:function(ft){var $t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if($t==="MultiPoint")return this.toMultiPoint(ft);var _e=$t==="GeometryCollection",ir=[];return this.eachLayer(function(Wr){if(Wr.toGeoJSON){var $n=Wr.toGeoJSON(ft);if(_e)ir.push($n.geometry);else{var ia=ub($n);ia.type==="FeatureCollection"?ir.push.apply(ir,ia.features):ir.push(ia)}}}),_e?Ag(this,{geometries:ir,type:"GeometryCollection"}):{type:"FeatureCollection",features:ir}}});function Sw(ft,$t){return new Cg(ft,$t)}var hb=Sw,Mg=Z0.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(ft,$t,_e){this._url=ft,this._bounds=Bi($t),Ce(this,_e)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Qc(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Bd(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(ft){return this.options.opacity=ft,this._image&&this._updateOpacity(),this},setStyle:function(ft){return ft.opacity&&this.setOpacity(ft.opacity),this},bringToFront:function(){return this._map&&J1(this._image),this},bringToBack:function(){return this._map&&jn(this._image),this},setUrl:function(ft){return this._url=ft,this._image&&(this._image.src=ft),this},setBounds:function(ft){return this._bounds=Bi(ft),this._map&&this._reset(),this},getEvents:function(){var ft={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(ft.zoomanim=this._animateZoom),ft},setZIndex:function(ft){return this.options.zIndex=ft,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var ft=this._url.tagName==="IMG",$t=this._image=ft?this._url:$u("img");if(Qc($t,"leaflet-image-layer"),this._zoomAnimated&&Qc($t,"leaflet-zoom-animated"),this.options.className&&Qc($t,this.options.className),$t.onselectstart=ne,$t.onmousemove=ne,$t.onload=K(this.fire,this,"load"),$t.onerror=K(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&($t.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),ft){this._url=$t.src;return}$t.src=this._url,$t.alt=this.options.alt},_animateZoom:function(ft){var $t=this._map.getZoomScale(ft.zoom),_e=this._map._latLngBoundsToNewLayerBounds(this._bounds,ft.zoom,ft.center).min;Tc(this._image,_e,$t)},_reset:function(){var ft=this._image,$t=new va(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),_e=$t.getSize();fu(ft,$t.min),ft.style.width=_e.x+"px",ft.style.height=_e.y+"px"},_updateOpacity:function(){um(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var ft=this.options.errorOverlayUrl;ft&&this._url!==ft&&(this._url=ft,this._image.src=ft)},getCenter:function(){return this._bounds.getCenter()}}),Eg=function(ft,$t,_e){return new Mg(ft,$t,_e)},Em=Mg.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var ft=this._url.tagName==="VIDEO",$t=this._image=ft?this._url:$u("video");if(Qc($t,"leaflet-image-layer"),this._zoomAnimated&&Qc($t,"leaflet-zoom-animated"),this.options.className&&Qc($t,this.options.className),$t.onselectstart=ne,$t.onmousemove=ne,$t.onloadeddata=K(this.fire,this,"load"),ft){for(var _e=$t.getElementsByTagName("source"),ir=[],Wr=0;Wr<_e.length;Wr++)ir.push(_e[Wr].src);this._url=_e.length>0?ir:[$t.src];return}rn(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call($t.style,"objectFit")&&($t.style.objectFit="fill"),$t.autoplay=!!this.options.autoplay,$t.loop=!!this.options.loop,$t.muted=!!this.options.muted,$t.playsInline=!!this.options.playsInline;for(var $n=0;$nWr?($t.height=Wr+"px",Qc(ft,$n)):Jd(ft,$n),this._containerWidth=this._container.offsetWidth},_animateZoom:function(ft){var $t=this._map._latLngToNewLayerPoint(this._latlng,ft.zoom,ft.center),_e=this._getAnchor();fu(this._container,$t.add(_e))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var ft=this._map,$t=parseInt(C_(this._container,"marginBottom"),10)||0,_e=this._container.offsetHeight+$t,ir=this._containerWidth,Wr=new Xn(this._containerLeft,-_e-this._containerBottom);Wr._add(Ku(this._container));var $n=ft.layerPointToContainerPoint(Wr),ia=ta(this.options.autoPanPadding),ro=ta(this.options.autoPanPaddingTopLeft||ia),fo=ta(this.options.autoPanPaddingBottomRight||ia),Do=ft.getSize(),tl=0,Il=0;$n.x+ir+fo.x>Do.x&&(tl=$n.x+ir-Do.x+fo.x),$n.x-tl-ro.x<0&&(tl=$n.x-ro.x),$n.y+_e+fo.y>Do.y&&(Il=$n.y+_e-Do.y+fo.y),$n.y-Il-ro.y<0&&(Il=$n.y-ro.y),(tl||Il)&&(this.options.keepInView&&(this._autopanning=!0),ft.fire("autopanstart").panBy([tl,Il]))}},_getAnchor:function(){return ta(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Md=function(ft,$t){return new Yv(ft,$t)};Nu.mergeOptions({closePopupOnClick:!0}),Nu.include({openPopup:function(ft,$t,_e){return this._initOverlay(Yv,ft,$t,_e).openOn(this),this},closePopup:function(ft){return ft=arguments.length?ft:this._popup,ft&&ft.close(),this}}),Z0.include({bindPopup:function(ft,$t){return this._popup=this._initOverlay(Yv,this._popup,ft,$t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(ft){return this._popup&&(this instanceof l0||(this._popup._source=this),this._popup._prepareOpen(ft||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(ft){return this._popup&&this._popup.setContent(ft),this},getPopup:function(){return this._popup},_openPopup:function(ft){if(!(!this._popup||!this._map)){$v(ft);var $t=ft.layer||ft.target;if(this._popup._source===$t&&!($t instanceof Yg)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(ft.latlng);return}this._popup._source=$t,this.openPopup(ft.latlng)}},_movePopup:function(ft){this._popup.setLatLng(ft.latlng)},_onKeyPress:function(ft){ft.originalEvent.keyCode===13&&this._openPopup(ft)}});var P_=tg.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(ft){tg.prototype.onAdd.call(this,ft),this.setOpacity(this.options.opacity),ft.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(ft){tg.prototype.onRemove.call(this,ft),ft.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var ft=tg.prototype.getEvents.call(this);return this.options.permanent||(ft.preclick=this.close),ft},_initLayout:function(){var ft="leaflet-tooltip",$t=ft+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=$u("div",$t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+yt(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(ft){var $t,_e,ir=this._map,Wr=this._container,$n=ir.latLngToContainerPoint(ir.getCenter()),ia=ir.layerPointToContainerPoint(ft),ro=this.options.direction,fo=Wr.offsetWidth,Do=Wr.offsetHeight,tl=ta(this.options.offset),Il=this._getAnchor();ro==="top"?($t=fo/2,_e=Do):ro==="bottom"?($t=fo/2,_e=0):ro==="center"?($t=fo/2,_e=Do/2):ro==="right"?($t=0,_e=Do/2):ro==="left"?($t=fo,_e=Do/2):ia.x<$n.x?(ro="right",$t=0,_e=Do/2):(ro="left",$t=fo+(tl.x+Il.x)*2,_e=Do/2),ft=ft.subtract(ta($t,_e,!0)).add(tl).add(Il),Jd(Wr,"leaflet-tooltip-right"),Jd(Wr,"leaflet-tooltip-left"),Jd(Wr,"leaflet-tooltip-top"),Jd(Wr,"leaflet-tooltip-bottom"),Qc(Wr,"leaflet-tooltip-"+ro),fu(Wr,ft)},_updatePosition:function(){var ft=this._map.latLngToLayerPoint(this._latlng);this._setPosition(ft)},setOpacity:function(ft){this.options.opacity=ft,this._container&&um(this._container,ft)},_animateZoom:function(ft){var $t=this._map._latLngToNewLayerPoint(this._latlng,ft.zoom,ft.center);this._setPosition($t)},_getAnchor:function(){return ta(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),B4=function(ft,$t){return new P_(ft,$t)};Nu.include({openTooltip:function(ft,$t,_e){return this._initOverlay(P_,ft,$t,_e).openOn(this),this},closeTooltip:function(ft){return ft.close(),this}}),Z0.include({bindTooltip:function(ft,$t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(P_,this._tooltip,ft,$t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(ft){if(!(!ft&&this._tooltipHandlersAdded)){var $t=ft?"off":"on",_e={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?_e.add=this._openTooltip:(_e.mouseover=this._openTooltip,_e.mouseout=this.closeTooltip,_e.click=this._openTooltip,this._map?this._addFocusListeners():_e.add=this._addFocusListeners),this._tooltip.options.sticky&&(_e.mousemove=this._moveTooltip),this[$t](_e),this._tooltipHandlersAdded=!ft}},openTooltip:function(ft){return this._tooltip&&(this instanceof l0||(this._tooltip._source=this),this._tooltip._prepareOpen(ft)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(ft){return this._tooltip&&this._tooltip.setContent(ft),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(ft){var $t=typeof ft.getElement=="function"&&ft.getElement();$t&&(Hc($t,"focus",function(){this._tooltip._source=ft,this.openTooltip()},this),Hc($t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(ft){var $t=typeof ft.getElement=="function"&&ft.getElement();$t&&$t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(ft){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var $t=this;this._map.once("moveend",function(){$t._openOnceFlag=!1,$t._openTooltip(ft)});return}this._tooltip._source=ft.layer||ft.target,this.openTooltip(this._tooltip.options.sticky?ft.latlng:void 0)}},_moveTooltip:function(ft){var $t=ft.latlng,_e,ir;this._tooltip.options.sticky&&ft.originalEvent&&(_e=this._map.mouseEventToContainerPoint(ft.originalEvent),ir=this._map.containerPointToLayerPoint(_e),$t=this._map.layerPointToLatLng(ir)),this._tooltip.setLatLng($t)}});var R4=Kg.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(ft){var $t=ft&&ft.tagName==="DIV"?ft:document.createElement("div"),_e=this.options;if(_e.html instanceof Element?(Qx($t),$t.appendChild(_e.html)):$t.innerHTML=_e.html!==!1?_e.html:"",_e.bgPos){var ir=ta(_e.bgPos);$t.style.backgroundPosition=-ir.x+"px "+-ir.y+"px"}return this._setIconStyles($t,"icon"),$t},createShadow:function(){return null}});function T8(ft){return new R4(ft)}Kg.Default=ny;var I_=Z0.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Ul.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(ft){Ce(this,ft)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(ft){ft._addZoomLimit(this)},onRemove:function(ft){this._removeAllTiles(),Bd(this._container),ft._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(J1(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(jn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(ft){return this.options.opacity=ft,this._updateOpacity(),this},setZIndex:function(ft){return this.options.zIndex=ft,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var ft=this._clampZoom(this._map.getZoom());ft!==this._tileZoom&&(this._tileZoom=ft,this._updateLevels()),this._update()}return this},getEvents:function(){var ft={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=St(this._onMoveEnd,this.options.updateInterval,this)),ft.move=this._onMove),this._zoomAnimated&&(ft.zoomanim=this._animateZoom),ft},createTile:function(){return document.createElement("div")},getTileSize:function(){var ft=this.options.tileSize;return ft instanceof Xn?ft:new Xn(ft,ft)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(ft){for(var $t=this.getPane().children,_e=-ft(-1/0,1/0),ir=0,Wr=$t.length,$n;irthis.options.maxZoom||_eir?this._retainParent(Wr,$n,ia,ir):!1)},_retainChildren:function(ft,$t,_e,ir){for(var Wr=2*ft;Wr<2*ft+2;Wr++)for(var $n=2*$t;$n<2*$t+2;$n++){var ia=new Xn(Wr,$n);ia.z=_e+1;var ro=this._tileCoordsToKey(ia),fo=this._tiles[ro];if(fo&&fo.active){fo.retain=!0;continue}else fo&&fo.loaded&&(fo.retain=!0);_e+1this.options.maxZoom||this.options.minZoom!==void 0&&Wr1){this._setView(ft,_e);return}for(var Il=Wr.min.y;Il<=Wr.max.y;Il++)for(var qc=Wr.min.x;qc<=Wr.max.x;qc++){var Kf=new Xn(qc,Il);if(Kf.z=this._tileZoom,!!this._isValidTile(Kf)){var Qd=this._tiles[this._tileCoordsToKey(Kf)];Qd?Qd.current=!0:ia.push(Kf)}}if(ia.sort(function(c0,Jg){return c0.distanceTo($n)-Jg.distanceTo($n)}),ia.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var mm=document.createDocumentFragment();for(qc=0;qc_e.max.x)||!$t.wrapLat&&(ft.y<_e.min.y||ft.y>_e.max.y))return!1}if(!this.options.bounds)return!0;var ir=this._tileCoordsToBounds(ft);return Bi(this.options.bounds).overlaps(ir)},_keyToBounds:function(ft){return this._tileCoordsToBounds(this._keyToTileCoords(ft))},_tileCoordsToNwSe:function(ft){var $t=this._map,_e=this.getTileSize(),ir=ft.scaleBy(_e),Wr=ir.add(_e),$n=$t.unproject(ir,ft.z),ia=$t.unproject(Wr,ft.z);return[$n,ia]},_tileCoordsToBounds:function(ft){var $t=this._tileCoordsToNwSe(ft),_e=new qi($t[0],$t[1]);return this.options.noWrap||(_e=this._map.wrapLatLngBounds(_e)),_e},_tileCoordsToKey:function(ft){return ft.x+":"+ft.y+":"+ft.z},_keyToTileCoords:function(ft){var $t=ft.split(":"),_e=new Xn(+$t[0],+$t[1]);return _e.z=+$t[2],_e},_removeTile:function(ft){var $t=this._tiles[ft];$t&&(Bd($t.el),delete this._tiles[ft],this.fire("tileunload",{tile:$t.el,coords:this._keyToTileCoords(ft)}))},_initTile:function(ft){Qc(ft,"leaflet-tile");var $t=this.getTileSize();ft.style.width=$t.x+"px",ft.style.height=$t.y+"px",ft.onselectstart=ne,ft.onmousemove=ne,Ul.ielt9&&this.options.opacity<1&&um(ft,this.options.opacity)},_addTile:function(ft,$t){var _e=this._getTilePos(ft),ir=this._tileCoordsToKey(ft),Wr=this.createTile(this._wrapCoords(ft),K(this._tileReady,this,ft));this._initTile(Wr),this.createTile.length<2&&on(K(this._tileReady,this,ft,null,Wr)),fu(Wr,_e),this._tiles[ir]={el:Wr,coords:ft,current:!0},$t.appendChild(Wr),this.fire("tileloadstart",{tile:Wr,coords:ft})},_tileReady:function(ft,$t,_e){$t&&this.fire("tileerror",{error:$t,tile:_e,coords:ft});var ir=this._tileCoordsToKey(ft);_e=this._tiles[ir],_e&&(_e.loaded=+new Date,this._map._fadeAnimated?(um(_e.el,0),pr(this._fadeFrame),this._fadeFrame=on(this._updateOpacity,this)):(_e.active=!0,this._pruneTiles()),$t||(Qc(_e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:_e.el,coords:ft})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Ul.ielt9||!this._map._fadeAnimated?on(this._pruneTiles,this):setTimeout(K(this._pruneTiles,this),250)))},_getTilePos:function(ft){return ft.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(ft){var $t=new Xn(this._wrapX?Ut(ft.x,this._wrapX):ft.x,this._wrapY?Ut(ft.y,this._wrapY):ft.y);return $t.z=ft.z,$t},_pxBoundsToTileRange:function(ft){var $t=this.getTileSize();return new va(ft.min.unscaleBy($t).floor(),ft.max.unscaleBy($t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var ft in this._tiles)if(!this._tiles[ft].loaded)return!1;return!0}});function Aw(ft){return new I_(ft)}var K0=I_.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(ft,$t){this._url=ft,$t=Ce(this,$t),$t.detectRetina&&Ul.retina&&$t.maxZoom>0?($t.tileSize=Math.floor($t.tileSize/2),$t.zoomReverse?($t.zoomOffset--,$t.minZoom=Math.min($t.maxZoom,$t.minZoom+1)):($t.zoomOffset++,$t.maxZoom=Math.max($t.minZoom,$t.maxZoom-1)),$t.minZoom=Math.max(0,$t.minZoom)):$t.zoomReverse?$t.minZoom=Math.min($t.maxZoom,$t.minZoom):$t.maxZoom=Math.max($t.minZoom,$t.maxZoom),typeof $t.subdomains=="string"&&($t.subdomains=$t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(ft,$t){return this._url===ft&&$t===void 0&&($t=!0),this._url=ft,$t||this.redraw(),this},createTile:function(ft,$t){var _e=document.createElement("img");return Hc(_e,"load",K(this._tileOnLoad,this,$t,_e)),Hc(_e,"error",K(this._tileOnError,this,$t,_e)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(_e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(_e.referrerPolicy=this.options.referrerPolicy),_e.alt="",_e.src=this.getTileUrl(ft),_e},getTileUrl:function(ft){var $t={r:Ul.retina?"@2x":"",s:this._getSubdomain(ft),x:ft.x,y:ft.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var _e=this._globalTileRange.max.y-ft.y;this.options.tms&&($t.y=_e),$t["-y"]=_e}return It(this._url,T($t,this.options))},_tileOnLoad:function(ft,$t){Ul.ielt9?setTimeout(K(ft,this,null,$t),0):ft(null,$t)},_tileOnError:function(ft,$t,_e){var ir=this.options.errorTileUrl;ir&&$t.getAttribute("src")!==ir&&($t.src=ir),ft(_e,$t)},_onTileRemove:function(ft){ft.tile.onload=null},_getZoomForUrl:function(){var ft=this._tileZoom,$t=this.options.maxZoom,_e=this.options.zoomReverse,ir=this.options.zoomOffset;return _e&&(ft=$t-ft),ft+ir},_getSubdomain:function(ft){var $t=Math.abs(ft.x+ft.y)%this.options.subdomains.length;return this.options.subdomains[$t]},_abortLoading:function(){var ft,$t;for(ft in this._tiles)if(this._tiles[ft].coords.z!==this._tileZoom&&($t=this._tiles[ft].el,$t.onload=ne,$t.onerror=ne,!$t.complete)){$t.src=Mr;var _e=this._tiles[ft].coords;Bd($t),delete this._tiles[ft],this.fire("tileabort",{tile:$t,coords:_e})}},_removeTile:function(ft){var $t=this._tiles[ft];if($t)return $t.el.setAttribute("src",Mr),I_.prototype._removeTile.call(this,ft)},_tileReady:function(ft,$t,_e){if(!(!this._map||_e&&_e.getAttribute("src")===Mr))return I_.prototype._tileReady.call(this,ft,$t,_e)}});function db(ft,$t){return new K0(ft,$t)}var fb=K0.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(ft,$t){this._url=ft;var _e=T({},this.defaultWmsParams);for(var ir in $t)ir in this.options||(_e[ir]=$t[ir]);$t=Ce(this,$t);var Wr=$t.detectRetina&&Ul.retina?2:1,$n=this.getTileSize();_e.width=$n.x*Wr,_e.height=$n.y*Wr,this.wmsParams=_e},onAdd:function(ft){this._crs=this.options.crs||ft.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var $t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[$t]=this._crs.code,K0.prototype.onAdd.call(this,ft)},getTileUrl:function(ft){var $t=this._tileCoordsToNwSe(ft),_e=this._crs,ir=_a(_e.project($t[0]),_e.project($t[1])),Wr=ir.min,$n=ir.max,ia=(this._wmsVersion>=1.3&&this._crs===nb?[Wr.y,Wr.x,$n.y,$n.x]:[Wr.x,Wr.y,$n.x,$n.y]).join(","),ro=K0.prototype.getTileUrl.call(this,ft);return ro+Ve(this.wmsParams,ro,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ia},setParams:function(ft,$t){return T(this.wmsParams,ft),$t||this.redraw(),this}});function F4(ft,$t){return new fb(ft,$t)}K0.WMS=fb,db.wms=F4;var Lg=Z0.extend({options:{padding:.1},initialize:function(ft){Ce(this,ft),yt(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Qc(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var ft={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(ft.zoomanim=this._onAnimZoom),ft},_onAnimZoom:function(ft){this._updateTransform(ft.center,ft.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(ft,$t){var _e=this._map.getZoomScale($t,this._zoom),ir=this._map.getSize().multiplyBy(.5+this.options.padding),Wr=this._map.project(this._center,$t),$n=ir.multiplyBy(-_e).add(Wr).subtract(this._map._getNewPixelOrigin(ft,$t));Ul.any3d?Tc(this._container,$n,_e):fu(this._container,$n)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var ft in this._layers)this._layers[ft]._reset()},_onZoomEnd:function(){for(var ft in this._layers)this._layers[ft]._project()},_updatePaths:function(){for(var ft in this._layers)this._layers[ft]._update()},_update:function(){var ft=this.options.padding,$t=this._map.getSize(),_e=this._map.containerPointToLayerPoint($t.multiplyBy(-ft)).round();this._bounds=new va(_e,_e.add($t.multiplyBy(1+ft*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),N4=Lg.extend({options:{tolerance:0},getEvents:function(){var ft=Lg.prototype.getEvents.call(this);return ft.viewprereset=this._onViewPreReset,ft},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Lg.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var ft=this._container=document.createElement("canvas");Hc(ft,"mousemove",this._onMouseMove,this),Hc(ft,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Hc(ft,"mouseout",this._handleMouseOut,this),ft._leaflet_disable_events=!0,this._ctx=ft.getContext("2d")},_destroyContainer:function(){pr(this._redrawRequest),delete this._ctx,Bd(this._container),Xh(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var ft;this._redrawBounds=null;for(var $t in this._layers)ft=this._layers[$t],ft._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lg.prototype._update.call(this);var ft=this._bounds,$t=this._container,_e=ft.getSize(),ir=Ul.retina?2:1;fu($t,ft.min),$t.width=ir*_e.x,$t.height=ir*_e.y,$t.style.width=_e.x+"px",$t.style.height=_e.y+"px",Ul.retina&&this._ctx.scale(2,2),this._ctx.translate(-ft.min.x,-ft.min.y),this.fire("update")}},_reset:function(){Lg.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(ft){this._updateDashArray(ft),this._layers[yt(ft)]=ft;var $t=ft._order={layer:ft,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=$t),this._drawLast=$t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(ft){this._requestRedraw(ft)},_removePath:function(ft){var $t=ft._order,_e=$t.next,ir=$t.prev;_e?_e.prev=ir:this._drawLast=ir,ir?ir.next=_e:this._drawFirst=_e,delete ft._order,delete this._layers[yt(ft)],this._requestRedraw(ft)},_updatePath:function(ft){this._extendRedrawBounds(ft),ft._project(),ft._update(),this._requestRedraw(ft)},_updateStyle:function(ft){this._updateDashArray(ft),this._requestRedraw(ft)},_updateDashArray:function(ft){if(typeof ft.options.dashArray=="string"){var $t=ft.options.dashArray.split(/[, ]+/),_e=[],ir,Wr;for(Wr=0;Wr<$t.length;Wr++){if(ir=Number($t[Wr]),isNaN(ir))return;_e.push(ir)}ft.options._dashArray=_e}else ft.options._dashArray=ft.options.dashArray},_requestRedraw:function(ft){this._map&&(this._extendRedrawBounds(ft),this._redrawRequest=this._redrawRequest||on(this._redraw,this))},_extendRedrawBounds:function(ft){if(ft._pxBounds){var $t=(ft.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new va,this._redrawBounds.extend(ft._pxBounds.min.subtract([$t,$t])),this._redrawBounds.extend(ft._pxBounds.max.add([$t,$t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var ft=this._redrawBounds;if(ft){var $t=ft.getSize();this._ctx.clearRect(ft.min.x,ft.min.y,$t.x,$t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var ft,$t=this._redrawBounds;if(this._ctx.save(),$t){var _e=$t.getSize();this._ctx.beginPath(),this._ctx.rect($t.min.x,$t.min.y,_e.x,_e.y),this._ctx.clip()}this._drawing=!0;for(var ir=this._drawFirst;ir;ir=ir.next)ft=ir.layer,(!$t||ft._pxBounds&&ft._pxBounds.intersects($t))&&ft._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(ft,$t){if(this._drawing){var _e,ir,Wr,$n,ia=ft._parts,ro=ia.length,fo=this._ctx;if(ro){for(fo.beginPath(),_e=0;_e')}}catch{}return function(ft){return document.createElement("<"+ft+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),S8={_initContainer:function(){this._container=$u("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Lg.prototype._update.call(this),this.fire("update"))},_initPath:function(ft){var $t=ft._container=D_("shape");Qc($t,"leaflet-vml-shape "+(this.options.className||"")),$t.coordsize="1 1",ft._path=D_("path"),$t.appendChild(ft._path),this._updateStyle(ft),this._layers[yt(ft)]=ft},_addPath:function(ft){var $t=ft._container;this._container.appendChild($t),ft.options.interactive&&ft.addInteractiveTarget($t)},_removePath:function(ft){var $t=ft._container;Bd($t),ft.removeInteractiveTarget($t),delete this._layers[yt(ft)]},_updateStyle:function(ft){var $t=ft._stroke,_e=ft._fill,ir=ft.options,Wr=ft._container;Wr.stroked=!!ir.stroke,Wr.filled=!!ir.fill,ir.stroke?($t||($t=ft._stroke=D_("stroke")),Wr.appendChild($t),$t.weight=ir.weight+"px",$t.color=ir.color,$t.opacity=ir.opacity,ir.dashArray?$t.dashStyle=rn(ir.dashArray)?ir.dashArray.join(" "):ir.dashArray.replace(/( *, *)/g," "):$t.dashStyle="",$t.endcap=ir.lineCap.replace("butt","flat"),$t.joinstyle=ir.lineJoin):$t&&(Wr.removeChild($t),ft._stroke=null),ir.fill?(_e||(_e=ft._fill=D_("fill")),Wr.appendChild(_e),_e.color=ir.fillColor||ir.color,_e.opacity=ir.fillOpacity):_e&&(Wr.removeChild(_e),ft._fill=null)},_updateCircle:function(ft){var $t=ft._point.round(),_e=Math.round(ft._radius),ir=Math.round(ft._radiusY||_e);this._setPath(ft,ft._empty()?"M0 0":"AL "+$t.x+","+$t.y+" "+_e+","+ir+" 0,"+65535*360)},_setPath:function(ft,$t){ft._path.v=$t},_bringToFront:function(ft){J1(ft._container)},_bringToBack:function(ft){jn(ft._container)}},Xg=Ul.vml?D_:to,S0=Lg.extend({_initContainer:function(){this._container=Xg("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Xg("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Bd(this._container),Xh(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lg.prototype._update.call(this);var ft=this._bounds,$t=ft.getSize(),_e=this._container;(!this._svgSize||!this._svgSize.equals($t))&&(this._svgSize=$t,_e.setAttribute("width",$t.x),_e.setAttribute("height",$t.y)),fu(_e,ft.min),_e.setAttribute("viewBox",[ft.min.x,ft.min.y,$t.x,$t.y].join(" ")),this.fire("update")}},_initPath:function(ft){var $t=ft._path=Xg("path");ft.options.className&&Qc($t,ft.options.className),ft.options.interactive&&Qc($t,"leaflet-interactive"),this._updateStyle(ft),this._layers[yt(ft)]=ft},_addPath:function(ft){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(ft._path),ft.addInteractiveTarget(ft._path)},_removePath:function(ft){Bd(ft._path),ft.removeInteractiveTarget(ft._path),delete this._layers[yt(ft)]},_updatePath:function(ft){ft._project(),ft._update()},_updateStyle:function(ft){var $t=ft._path,_e=ft.options;$t&&(_e.stroke?($t.setAttribute("stroke",_e.color),$t.setAttribute("stroke-opacity",_e.opacity),$t.setAttribute("stroke-width",_e.weight),$t.setAttribute("stroke-linecap",_e.lineCap),$t.setAttribute("stroke-linejoin",_e.lineJoin),_e.dashArray?$t.setAttribute("stroke-dasharray",_e.dashArray):$t.removeAttribute("stroke-dasharray"),_e.dashOffset?$t.setAttribute("stroke-dashoffset",_e.dashOffset):$t.removeAttribute("stroke-dashoffset")):$t.setAttribute("stroke","none"),_e.fill?($t.setAttribute("fill",_e.fillColor||_e.color),$t.setAttribute("fill-opacity",_e.fillOpacity),$t.setAttribute("fill-rule",_e.fillRule||"evenodd")):$t.setAttribute("fill","none"))},_updatePoly:function(ft,$t){this._setPath(ft,Ha(ft._parts,$t))},_updateCircle:function(ft){var $t=ft._point,_e=Math.max(Math.round(ft._radius),1),ir=Math.max(Math.round(ft._radiusY),1)||_e,Wr="a"+_e+","+ir+" 0 1,0 ",$n=ft._empty()?"M0 0":"M"+($t.x-_e)+","+$t.y+Wr+_e*2+",0 "+Wr+-_e*2+",0 ";this._setPath(ft,$n)},_setPath:function(ft,$t){ft._path.setAttribute("d",$t)},_bringToFront:function(ft){J1(ft._path)},_bringToBack:function(ft){jn(ft._path)}});Ul.vml&&S0.include(S8);function j4(ft){return Ul.svg||Ul.vml?new S0(ft):null}Nu.include({getRenderer:function(ft){var $t=ft.options.renderer||this._getPaneRenderer(ft.options.pane)||this.options.renderer||this._renderer;return $t||($t=this._renderer=this._createRenderer()),this.hasLayer($t)||this.addLayer($t),$t},_getPaneRenderer:function(ft){if(ft==="overlayPane"||ft===void 0)return!1;var $t=this._paneRenderers[ft];return $t===void 0&&($t=this._createRenderer({pane:ft}),this._paneRenderers[ft]=$t),$t},_createRenderer:function(ft){return this.options.preferCanvas&&Mw(ft)||j4(ft)}});var Y0=ay.extend({initialize:function(ft,$t){ay.prototype.initialize.call(this,this._boundsToLatLngs(ft),$t)},setBounds:function(ft){return this.setLatLngs(this._boundsToLatLngs(ft))},_boundsToLatLngs:function(ft){return ft=Bi(ft),[ft.getSouthWest(),ft.getNorthWest(),ft.getNorthEast(),ft.getSouthEast()]}});function Lm(ft,$t){return new Y0(ft,$t)}S0.create=Xg,S0.pointsToPath=Ha,Cg.geometryToLayer=sb,Cg.coordsToLatLng=ww,Cg.coordsToLatLngs=lb,Cg.latLngToCoords=kw,Cg.latLngsToCoords=cb,Cg.getFeature=Ag,Cg.asFeature=ub,Nu.mergeOptions({boxZoom:!0});var oy=Qm.extend({initialize:function(ft){this._map=ft,this._container=ft._container,this._pane=ft._panes.overlayPane,this._resetStateTimeout=0,ft.on("unload",this._destroy,this)},addHooks:function(){Hc(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Xh(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Bd(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(ft){if(!ft.shiftKey||ft.which!==1&&ft.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Cm(),lh(),this._startPoint=this._map.mouseEventToContainerPoint(ft),Hc(document,{contextmenu:$v,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(ft){this._moved||(this._moved=!0,this._box=$u("div","leaflet-zoom-box",this._container),Qc(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(ft);var $t=new va(this._point,this._startPoint),_e=$t.getSize();fu(this._box,$t.min),this._box.style.width=_e.x+"px",this._box.style.height=_e.y+"px"},_finish:function(){this._moved&&(Bd(this._box),Jd(this._container,"leaflet-crosshair")),Nv(),k0(),Xh(document,{contextmenu:$v,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(ft){if(!(ft.which!==1&&ft.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(K(this._resetState,this),0);var $t=new qi(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds($t).fire("boxzoomend",{boxZoomBounds:$t})}},_onKeyDown:function(ft){ft.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Nu.addInitHook("addHandler","boxZoom",oy),Nu.mergeOptions({doubleClickZoom:!0});var pm=Qm.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(ft){var $t=this._map,_e=$t.getZoom(),ir=$t.options.zoomDelta,Wr=ft.originalEvent.shiftKey?_e-ir:_e+ir;$t.options.doubleClickZoom==="center"?$t.setZoom(Wr):$t.setZoomAround(ft.containerPoint,Wr)}});Nu.addInitHook("addHandler","doubleClickZoom",pm),Nu.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Pm=Qm.extend({addHooks:function(){if(!this._draggable){var ft=this._map;this._draggable=new Zg(ft._mapPane,ft._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),ft.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),ft.on("zoomend",this._onZoomEnd,this),ft.whenReady(this._onZoomEnd,this))}Qc(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Jd(this._map._container,"leaflet-grab"),Jd(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var ft=this._map;if(ft._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var $t=Bi(this._map.options.maxBounds);this._offsetLimit=_a(this._map.latLngToContainerPoint($t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint($t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;ft.fire("movestart").fire("dragstart"),ft.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(ft){if(this._map.options.inertia){var $t=this._lastTime=+new Date,_e=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(_e),this._times.push($t),this._prunePositions($t)}this._map.fire("move",ft).fire("drag",ft)},_prunePositions:function(ft){for(;this._positions.length>1&&ft-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var ft=this._map.getSize().divideBy(2),$t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=$t.subtract(ft).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(ft,$t){return ft-(ft-$t)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var ft=this._draggable._newPos.subtract(this._draggable._startPos),$t=this._offsetLimit;ft.x<$t.min.x&&(ft.x=this._viscousLimit(ft.x,$t.min.x)),ft.y<$t.min.y&&(ft.y=this._viscousLimit(ft.y,$t.min.y)),ft.x>$t.max.x&&(ft.x=this._viscousLimit(ft.x,$t.max.x)),ft.y>$t.max.y&&(ft.y=this._viscousLimit(ft.y,$t.max.y)),this._draggable._newPos=this._draggable._startPos.add(ft)}},_onPreDragWrap:function(){var ft=this._worldWidth,$t=Math.round(ft/2),_e=this._initialWorldOffset,ir=this._draggable._newPos.x,Wr=(ir-$t+_e)%ft+$t-_e,$n=(ir+$t+_e)%ft-$t-_e,ia=Math.abs(Wr+_e)0?$n:-$n))-$t;this._delta=0,this._startTime=null,ia&&(ft.options.scrollWheelZoom==="center"?ft.setZoom($t+ia):ft.setZoomAround(this._lastMousePos,$t+ia))}});Nu.addInitHook("addHandler","scrollWheelZoom",Xv);var $4=600;Nu.mergeOptions({tapHold:Ul.touchNative&&Ul.safari&&Ul.mobile,tapTolerance:15});var H4=Qm.extend({addHooks:function(){Hc(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Xh(this._map._container,"touchstart",this._onDown,this)},_onDown:function(ft){if(clearTimeout(this._holdTimeout),ft.touches.length===1){var $t=ft.touches[0];this._startPos=this._newPos=new Xn($t.clientX,$t.clientY),this._holdTimeout=setTimeout(K(function(){this._cancel(),this._isTapValid()&&(Hc(document,"touchend",Cu),Hc(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",$t))},this),$4),Hc(document,"touchend touchcancel contextmenu",this._cancel,this),Hc(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function ft(){Xh(document,"touchend",Cu),Xh(document,"touchend touchcancel",ft)},_cancel:function(){clearTimeout(this._holdTimeout),Xh(document,"touchend touchcancel contextmenu",this._cancel,this),Xh(document,"touchmove",this._onMove,this)},_onMove:function(ft){var $t=ft.touches[0];this._newPos=new Xn($t.clientX,$t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(ft,$t){var _e=new MouseEvent(ft,{bubbles:!0,cancelable:!0,view:window,screenX:$t.screenX,screenY:$t.screenY,clientX:$t.clientX,clientY:$t.clientY});_e._simulated=!0,$t.target.dispatchEvent(_e)}});Nu.addInitHook("addHandler","tapHold",H4),Nu.mergeOptions({touchZoom:Ul.touch,bounceAtZoomLimits:!0});var Im=Qm.extend({addHooks:function(){Qc(this._map._container,"leaflet-touch-zoom"),Hc(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Jd(this._map._container,"leaflet-touch-zoom"),Xh(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(ft){var $t=this._map;if(!(!ft.touches||ft.touches.length!==2||$t._animatingZoom||this._zooming)){var _e=$t.mouseEventToContainerPoint(ft.touches[0]),ir=$t.mouseEventToContainerPoint(ft.touches[1]);this._centerPoint=$t.getSize()._divideBy(2),this._startLatLng=$t.containerPointToLatLng(this._centerPoint),$t.options.touchZoom!=="center"&&(this._pinchStartLatLng=$t.containerPointToLatLng(_e.add(ir)._divideBy(2))),this._startDist=_e.distanceTo(ir),this._startZoom=$t.getZoom(),this._moved=!1,this._zooming=!0,$t._stop(),Hc(document,"touchmove",this._onTouchMove,this),Hc(document,"touchend touchcancel",this._onTouchEnd,this),Cu(ft)}},_onTouchMove:function(ft){if(!(!ft.touches||ft.touches.length!==2||!this._zooming)){var $t=this._map,_e=$t.mouseEventToContainerPoint(ft.touches[0]),ir=$t.mouseEventToContainerPoint(ft.touches[1]),Wr=_e.distanceTo(ir)/this._startDist;if(this._zoom=$t.getScaleZoom(Wr,this._startZoom),!$t.options.bounceAtZoomLimits&&(this._zoom<$t.getMinZoom()&&Wr<1||this._zoom>$t.getMaxZoom()&&Wr>1)&&(this._zoom=$t._limitZoom(this._zoom)),$t.options.touchZoom==="center"){if(this._center=this._startLatLng,Wr===1)return}else{var $n=_e._add(ir)._divideBy(2)._subtract(this._centerPoint);if(Wr===1&&$n.x===0&&$n.y===0)return;this._center=$t.unproject($t.project(this._pinchStartLatLng,this._zoom).subtract($n),this._zoom)}this._moved||($t._moveStart(!0,!1),this._moved=!0),pr(this._animRequest);var ia=K($t._move,$t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=on(ia,this,!0),Cu(ft)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,pr(this._animRequest),Xh(document,"touchmove",this._onTouchMove,this),Xh(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Nu.addInitHook("addHandler","touchZoom",Im),Nu.BoxZoom=oy,Nu.DoubleClickZoom=pm,Nu.Drag=Pm,Nu.Keyboard=U4,Nu.ScrollWheelZoom=Xv,Nu.TapHold=H4,Nu.TouchZoom=Im,r.Bounds=va,r.Browser=Ul,r.CRS=hi,r.Canvas=N4,r.Circle=ob,r.CircleMarker=ab,r.Class=Sr,r.Control=jp,r.DivIcon=R4,r.DivOverlay=tg,r.DomEvent=T0,r.DomUtil=Ru,r.Draggable=Zg,r.Evented=Cn,r.FeatureGroup=l0,r.GeoJSON=Cg,r.GridLayer=I_,r.Handler=Qm,r.Icon=Kg,r.ImageOverlay=Mg,r.LatLng=Xi,r.LatLngBounds=qi,r.Layer=Z0,r.LayerGroup=Kv,r.LineUtil=hd,r.Map=Nu,r.Marker=L_,r.Mixin=Up,r.Path=Yg,r.Point=Xn,r.PolyUtil=y8,r.Polygon=ay,r.Polyline=fm,r.Popup=Yv,r.PosAnimation=E_,r.Projection=yw,r.Rectangle=Y0,r.Renderer=Lg,r.SVG=S0,r.SVGOverlay=Cw,r.TileLayer=K0,r.Tooltip=P_,r.Transformation=xa,r.Util=_r,r.VideoOverlay=Em,r.bind=K,r.bounds=_a,r.canvas=Mw,r.circle=iy,r.circleMarker=D4,r.control=G0,r.divIcon=T8,r.extend=T,r.featureGroup=I4,r.geoJSON=Sw,r.geoJson=hb,r.gridLayer=Aw,r.icon=xw,r.imageOverlay=Eg,r.latLng=Yn,r.latLngBounds=Bi,r.layerGroup=ib,r.map=Js,r.marker=b8,r.point=ta,r.polygon=w8,r.polyline=z4,r.popup=Md,r.rectangle=Lm,r.setOptions=Ce,r.stamp=yt,r.svg=j4,r.svgOverlay=k8,r.tileLayer=db,r.tooltip=B4,r.transformation=Ur,r.version=u,r.videoOverlay=dd;var Dm=window.L;r.noConflict=function(){return window.L=Dm,this},window.L=r})}(c5,c5.exports)),c5.exports}var Qvt=Jvt();const ug=_H(Qvt),gF=Object.freeze(Object.defineProperty({__proto__:null,default:ug},Symbol.toStringTag,{value:"Module"})),vF=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],K7=1,$3=8;class sL{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,u]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const T=u>>4;if(T!==K7)throw new Error(`Got v${T} data when expected v${K7}.`);const $=vF[u&15];if(!$)throw new Error("Unrecognized array type.");const[K]=new Uint16Array(t,2,1),[ct]=new Uint32Array(t,4,1);return new sL(ct,K,$,t)}constructor(t,r=64,u=Float64Array,T){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=u,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const $=vF.indexOf(this.ArrayType),K=t*2*this.ArrayType.BYTES_PER_ELEMENT,ct=t*this.IndexArrayType.BYTES_PER_ELEMENT,yt=(8-ct%8)%8;if($<0)throw new Error(`Unexpected typed array class: ${u}.`);T&&T instanceof ArrayBuffer?(this.data=T,this.ids=new this.IndexArrayType(this.data,$3,t),this.coords=new this.ArrayType(this.data,$3+ct+yt,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer($3+K+ct+yt),this.ids=new this.IndexArrayType(this.data,$3,t),this.coords=new this.ArrayType(this.data,$3+ct+yt,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(K7<<4)+$]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const u=this._pos>>1;return this.ids[u]=u,this.coords[this._pos++]=t,this.coords[this._pos++]=r,u}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return f9(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,u,T){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:$,coords:K,nodeSize:ct}=this,yt=[0,$.length-1,0],St=[];for(;yt.length;){const Ut=yt.pop()||0,ne=yt.pop()||0,pe=yt.pop()||0;if(ne-pe<=ct){for(let Ve=pe;Ve<=ne;Ve++){const kr=K[2*Ve],It=K[2*Ve+1];kr>=t&&kr<=u&&It>=r&&It<=T&&St.push($[Ve])}continue}const me=pe+ne>>1,we=K[2*me],Ce=K[2*me+1];we>=t&&we<=u&&Ce>=r&&Ce<=T&&St.push($[me]),(Ut===0?t<=we:r<=Ce)&&(yt.push(pe),yt.push(me-1),yt.push(1-Ut)),(Ut===0?u>=we:T>=Ce)&&(yt.push(me+1),yt.push(ne),yt.push(1-Ut))}return St}within(t,r,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:T,coords:$,nodeSize:K}=this,ct=[0,T.length-1,0],yt=[],St=u*u;for(;ct.length;){const Ut=ct.pop()||0,ne=ct.pop()||0,pe=ct.pop()||0;if(ne-pe<=K){for(let Ve=pe;Ve<=ne;Ve++)yF($[2*Ve],$[2*Ve+1],t,r)<=St&&yt.push(T[Ve]);continue}const me=pe+ne>>1,we=$[2*me],Ce=$[2*me+1];yF(we,Ce,t,r)<=St&&yt.push(T[me]),(Ut===0?t-u<=we:r-u<=Ce)&&(ct.push(pe),ct.push(me-1),ct.push(1-Ut)),(Ut===0?t+u>=we:r+u>=Ce)&&(ct.push(me+1),ct.push(ne),ct.push(1-Ut))}return yt}}function f9(e,t,r,u,T,$){if(T-u<=r)return;const K=u+T>>1;xH(e,t,K,u,T,$),f9(e,t,r,u,K-1,1-$),f9(e,t,r,K+1,T,1-$)}function xH(e,t,r,u,T,$){for(;T>u;){if(T-u>600){const St=T-u+1,Ut=r-u+1,ne=Math.log(St),pe=.5*Math.exp(2*ne/3),me=.5*Math.sqrt(ne*pe*(St-pe)/St)*(Ut-St/2<0?-1:1),we=Math.max(u,Math.floor(r-Ut*pe/St+me)),Ce=Math.min(T,Math.floor(r+(St-Ut)*pe/St+me));xH(e,t,r,we,Ce,$)}const K=t[2*r+$];let ct=u,yt=T;for(H3(e,t,u,r),t[2*T+$]>K&&H3(e,t,u,T);ctK;)yt--}t[2*u+$]===K?H3(e,t,u,yt):(yt++,H3(e,t,yt,T)),yt<=r&&(u=yt+1),r<=yt&&(T=yt-1)}}function H3(e,t,r,u){Y7(e,r,u),Y7(t,2*r,2*u),Y7(t,2*r+1,2*u+1)}function Y7(e,t,r){const u=e[t];e[t]=e[r],e[r]=u}function yF(e,t,r,u){const T=e-r,$=t-u;return T*T+$*$}const t1t={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},_F=Math.fround||(e=>t=>(e[0]=+t,e[0]))(new Float32Array(1)),px=2,i_=3,X7=4,Yy=5,bH=6;class e1t{constructor(t){this.options=Object.assign(Object.create(t1t),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:r,minZoom:u,maxZoom:T}=this.options;r&&console.time("total time");const $=`prepare ${t.length} points`;r&&console.time($),this.points=t;const K=[];for(let yt=0;yt=u;yt--){const St=+Date.now();ct=this.trees[yt]=this._createTree(this._cluster(ct,yt)),r&&console.log("z%d: %d clusters in %dms",yt,ct.numItems,+Date.now()-St)}return r&&console.timeEnd("total time"),this}getClusters(t,r){let u=((t[0]+180)%360+360)%360-180;const T=Math.max(-90,Math.min(90,t[1]));let $=t[2]===180?180:((t[2]+180)%360+360)%360-180;const K=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)u=-180,$=180;else if(u>$){const ne=this.getClusters([u,T,180,K],r),pe=this.getClusters([-180,T,$,K],r);return ne.concat(pe)}const ct=this.trees[this._limitZoom(r)],yt=ct.range(J6(u),Q6(K),J6($),Q6(T)),St=ct.data,Ut=[];for(const ne of yt){const pe=this.stride*ne;Ut.push(St[pe+Yy]>1?xF(St,pe,this.clusterProps):this.points[St[pe+i_]])}return Ut}getChildren(t){const r=this._getOriginId(t),u=this._getOriginZoom(t),T="No cluster with the specified id.",$=this.trees[u];if(!$)throw new Error(T);const K=$.data;if(r*this.stride>=K.length)throw new Error(T);const ct=this.options.radius/(this.options.extent*Math.pow(2,u-1)),yt=K[r*this.stride],St=K[r*this.stride+1],Ut=$.within(yt,St,ct),ne=[];for(const pe of Ut){const me=pe*this.stride;K[me+X7]===t&&ne.push(K[me+Yy]>1?xF(K,me,this.clusterProps):this.points[K[me+i_]])}if(ne.length===0)throw new Error(T);return ne}getLeaves(t,r,u){r=r||10,u=u||0;const T=[];return this._appendLeaves(T,t,r,u,0),T}getTile(t,r,u){const T=this.trees[this._limitZoom(t)],$=Math.pow(2,t),{extent:K,radius:ct}=this.options,yt=ct/K,St=(u-yt)/$,Ut=(u+1+yt)/$,ne={features:[]};return this._addTileFeatures(T.range((r-yt)/$,St,(r+1+yt)/$,Ut),T.data,r,u,$,ne),r===0&&this._addTileFeatures(T.range(1-yt/$,St,1,Ut),T.data,$,u,$,ne),r===$-1&&this._addTileFeatures(T.range(0,St,yt/$,Ut),T.data,-1,u,$,ne),ne.features.length?ne:null}getClusterExpansionZoom(t){let r=this._getOriginZoom(t)-1;for(;r<=this.options.maxZoom;){const u=this.getChildren(t);if(r++,u.length!==1)break;t=u[0].properties.cluster_id}return r}_appendLeaves(t,r,u,T,$){const K=this.getChildren(r);for(const ct of K){const yt=ct.properties;if(yt&&yt.cluster?$+yt.point_count<=T?$+=yt.point_count:$=this._appendLeaves(t,yt.cluster_id,u,T,$):$1;let Ut,ne,pe;if(St)Ut=wH(r,yt,this.clusterProps),ne=r[yt],pe=r[yt+1];else{const Ce=this.points[r[yt+i_]];Ut=Ce.properties;const[Ve,kr]=Ce.geometry.coordinates;ne=J6(Ve),pe=Q6(kr)}const me={type:1,geometry:[[Math.round(this.options.extent*(ne*$-u)),Math.round(this.options.extent*(pe*$-T))]],tags:Ut};let we;St||this.options.generateId?we=r[yt+i_]:we=this.points[r[yt+i_]].id,we!==void 0&&(me.id=we),K.features.push(me)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,r){const{radius:u,extent:T,reduce:$,minPoints:K}=this.options,ct=u/(T*Math.pow(2,r)),yt=t.data,St=[],Ut=this.stride;for(let ne=0;ner&&(Ve+=yt[It+Yy])}if(Ve>Ce&&Ve>=K){let kr=pe*Ce,It=me*Ce,rn,Lr=-1;const Mr=((ne/Ut|0)<<5)+(r+1)+this.points.length;for(const tn of we){const Dn=tn*Ut;if(yt[Dn+px]<=r)continue;yt[Dn+px]=r;const Mn=yt[Dn+Yy];kr+=yt[Dn]*Mn,It+=yt[Dn+1]*Mn,yt[Dn+X7]=Mr,$&&(rn||(rn=this._map(yt,ne,!0),Lr=this.clusterProps.length,this.clusterProps.push(rn)),$(rn,this._map(yt,Dn)))}yt[ne+X7]=Mr,St.push(kr/Ve,It/Ve,1/0,Mr,-1,Ve),$&&St.push(Lr)}else{for(let kr=0;kr1)for(const kr of we){const It=kr*Ut;if(!(yt[It+px]<=r)){yt[It+px]=r;for(let rn=0;rn>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,r,u){if(t[r+Yy]>1){const K=this.clusterProps[t[r+bH]];return u?Object.assign({},K):K}const T=this.points[t[r+i_]].properties,$=this.options.map(T);return u&&$===T?Object.assign({},$):$}}function xF(e,t,r){return{type:"Feature",id:e[t+i_],properties:wH(e,t,r),geometry:{type:"Point",coordinates:[r1t(e[t]),n1t(e[t+1])]}}}function wH(e,t,r){const u=e[t+Yy],T=u>=1e4?`${Math.round(u/1e3)}k`:u>=1e3?`${Math.round(u/100)/10}k`:u,$=e[t+bH],K=$===-1?{}:Object.assign({},r[$]);return Object.assign(K,{cluster:!0,cluster_id:e[t+i_],point_count:u,point_count_abbreviated:T})}function J6(e){return e/360+.5}function Q6(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function r1t(e){return(e-.5)*360}function n1t(e){const t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}const i1t={class:"map-container"},a1t={key:0,class:"flex items-center justify-center h-96 glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] shadow-sm dark:shadow-none"},o1t={class:"hidden sm:inline"},s1t={key:3,class:"map-legend"},l1t={class:"legend-footer"},c1t={key:4,class:"map-attribution"},u1t=Cc({__name:"NetworkMap",props:{adverts:{},baseLatitude:{default:null},baseLongitude:{default:null},showLegend:{type:Boolean,default:!0}},emits:["update:showLegend"],setup(e,{expose:t,emit:r}){typeof window<"u"&&!window.chrome&&(window.chrome={runtime:{}});const u=e,T=r,$=()=>{T("update:showLegend",!u.showLegend)},K=li();let ct=null;const yt=li(new Map);let St=null;const Ut=li(new Map),ne=li([]),pe=li(!0),me=li(60),we=li(14),Ce=li(document.documentElement.classList.contains("dark")),Ve=new MutationObserver(()=>{const Sr=document.documentElement.classList.contains("dark");Sr!==Ce.value&&(Ce.value=Sr,ct&&Mn())}),kr=Ao(()=>u.baseLatitude!==null&&u.baseLongitude!==null&&typeof u.baseLatitude=="number"&&typeof u.baseLongitude=="number"&&u.baseLatitude!==0&&u.baseLongitude!==0&&Math.abs(u.baseLatitude)<=90&&Math.abs(u.baseLongitude)<=180),It=Sr=>new Date(Sr*1e3).toLocaleString(),rn=Sr=>Sr?`${Sr} dBm`:"N/A",Lr=Sr=>Sr?`${Sr} dB`:"N/A",Mr=Sr=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[Sr||0]||"Unknown",tn=(Sr,Dr,nn,Cn)=>{const _i=(nn-Sr)*Math.PI/180,ta=(Cn-Dr)*Math.PI/180,va=Math.sin(_i/2)*Math.sin(_i/2)+Math.cos(Sr*Math.PI/180)*Math.cos(nn*Math.PI/180)*Math.sin(ta/2)*Math.sin(ta/2);return 6371*(2*Math.atan2(Math.sqrt(va),Math.sqrt(1-va)))},Dn=()=>{ct&&(ne.value.forEach(Sr=>{ct&&Sr.remove()}),ne.value.length=0,ct.remove(),ct=null),yt.value.clear(),Ut.value.clear(),St=null},Mn=async()=>{const Sr=ct?.getZoom()||11,Dr=ct?.getCenter()||(kr.value?[u.baseLatitude,u.baseLongitude]:[0,0]);Dn(),await sp(),await on(),ct&&ct.setView(Dr,Sr)},Br=Sr=>{const Dr=new Map;return Sr.filter(nn=>nn.latitude!==null&&nn.longitude!==null).map(nn=>{let Cn=nn.latitude,Xn=nn.longitude;const _i=`${Cn.toFixed(6)}_${Xn.toFixed(6)}`,ta=Dr.get(_i)||0;if(Dr.set(_i,ta+1),ta>0){const _a=ta*60*(Math.PI/180);Cn+=Math.sin(_a)*.001*(ta*.5),Xn+=Math.cos(_a)*.001*(ta*.5)}return{type:"Feature",properties:{advert:{...nn,jittered_latitude:Cn,jittered_longitude:Xn}},geometry:{type:"Point",coordinates:[Xn,Cn]}}})},Vn=Sr=>{St=new e1t({radius:me.value,maxZoom:we.value,minPoints:2}),St.load(Sr)},on=async()=>{if(!K.value||!kr.value){console.warn("Cannot initialize map: missing container or coordinates");return}Dn(),await sp();const Sr=u.baseLatitude,Dr=u.baseLongitude;ct=ug.map(K.value,{center:[Sr,Dr],zoom:11,zoomControl:!0,attributionControl:!1,preferCanvas:!1});try{const nn=Ce.value?"https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",Cn=Ce.value?"https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png",Xn=ug.tileLayer(nn,{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),_i=ug.tileLayer(Cn,{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});Xn.addTo(ct),_i.addTo(ct)}catch(nn){console.warn("Error loading tiles:",nn)}try{const nn=(qi,Bi=!1)=>{const Xi=Bi?16:12;return ug.divIcon({className:"custom-div-icon",html:`
`,iconSize:[Xi+4,Xi+4],iconAnchor:[(Xi+4)/2,(Xi+4)/2]})},Cn=qi=>{const Bi=qi<10?30:qi<100?40:50;return ug.divIcon({className:"custom-cluster-icon",html:`
Base Station
${Sr.toFixed(6)}, ${Dr.toFixed(6)}
- `);const _i={Unknown:"#9CA3AF","Chat Node":"#60A5FA",Repeater:"#A5E5B6","Room Server":"#EBA0FC","Hybrid Node":"#FFC246"},ta=(qi,Bi,Xi,Yn,hi=0)=>{if(!ct)return;const aa=qi.jittered_latitude||qi.latitude,io=qi.jittered_longitude||qi.longitude;if(aa===null||io===null)return;const oo=qi.route_type||0;let xa=Yn,Ur=3,Sn=.7,Hn;oo===2?(xa="#A5E5B6",Ur=4,Sn=.9):oo===1?(xa="#FFC246",Hn="10, 5",Sn=.8):oo===3?(xa="#059669",Ur=5,Sn=.95):oo===0?(xa="#ea580c",Hn="12, 6",Sn=.8):(xa="#9CA3AF",Hn="2, 5",Sn=.6);const Qa=[Bi,Xi],Ha=[aa,io],qa=ug.polyline([Qa,Ha],{color:xa,weight:Ur,opacity:0,dashArray:Hn,className:"connection-line"}).addTo(ct),Mo=ug.polyline([Qa,Qa],{color:xa,weight:Ur,opacity:0,dashArray:Hn,className:"connection-line animated-line"}).addTo(ct);setTimeout(()=>{let Wo=0;const es=30;Mo.setStyle({opacity:Sn+.2});const Po=()=>{Wo++;const Ys=Wo/es,Jo=Qa[0]+(Ha[0]-Qa[0])*Ys,Ss=Qa[1]+(Ha[1]-Qa[1])*Ys;Mo.setLatLngs([Qa,[Jo,Ss]]),Wo{ct&&Mo&&Mo.remove(),qa.setStyle({opacity:Sn}),qa.on("mouseover",()=>{qa.setStyle({weight:Ur+2,opacity:Math.min(Sn+.3,1)})}),qa.on("mouseout",()=>{qa.setStyle({weight:Ur,opacity:Sn})});const Us=tn(Bi,Xi,aa,io);qa.bindPopup(` + `);const _i={Unknown:"#9CA3AF","Chat Node":"#60A5FA",Repeater:"#A5E5B6","Room Server":"#EBA0FC","Hybrid Node":"#FFC246"},ta=(qi,Bi,Xi,Yn,hi=0)=>{if(!ct)return;const na=qi.jittered_latitude||qi.latitude,Xa=qi.jittered_longitude||qi.longitude;if(na===null||Xa===null)return;const oo=qi.route_type||0;let xa=Yn,Ur=3,Sn=.7,Hn;oo===2?(xa="#A5E5B6",Ur=4,Sn=.9):oo===1?(xa="#FFC246",Hn="10, 5",Sn=.8):oo===3?(xa="#059669",Ur=5,Sn=.95):oo===0?(xa="#ea580c",Hn="12, 6",Sn=.8):(xa="#9CA3AF",Hn="2, 5",Sn=.6);const to=[Bi,Xi],Ha=[na,Xa],qa=ug.polyline([to,Ha],{color:xa,weight:Ur,opacity:0,dashArray:Hn,className:"connection-line"}).addTo(ct),Mo=ug.polyline([to,to],{color:xa,weight:Ur,opacity:0,dashArray:Hn,className:"connection-line animated-line"}).addTo(ct);setTimeout(()=>{let Wo=0;const es=30;Mo.setStyle({opacity:Sn+.2});const Io=()=>{Wo++;const Ys=Wo/es,Jo=to[0]+(Ha[0]-to[0])*Ys,Ss=to[1]+(Ha[1]-to[1])*Ys;Mo.setLatLngs([to,[Jo,Ss]]),Wo{ct&&Mo&&Mo.remove(),qa.setStyle({opacity:Sn}),qa.on("mouseover",()=>{qa.setStyle({weight:Ur+2,opacity:Math.min(Sn+.3,1)})}),qa.on("mouseout",()=>{qa.setStyle({weight:Ur,opacity:Sn})});const Us=tn(Bi,Xi,na,Xa);qa.bindPopup(`
Connection to ${qi.node_name||"Unknown Node"}
Distance: ${Us.toFixed(2)} km
Route: ${Mr(qi.route_type)}
Signal: ${rn(qi.rssi)} / ${Lr(qi.snr)}
- `),ne.value.push(qa)},200)};Po()},hi)},va=()=>{if(!ct||!St)return;const qi=ct.getBounds(),Bi=Math.floor(ct.getZoom());Ut.value.forEach(Yn=>{ct&&Yn.remove()}),Ut.value.clear(),ne.value.forEach(Yn=>{ct&&Yn.remove()}),ne.value.length=0,St.getClusters([qi.getWest(),qi.getSouth(),qi.getEast(),qi.getNorth()],Bi).forEach(Yn=>{const[hi,aa]=Yn.geometry.coordinates,io=Yn.properties;if(io.cluster){const oo=ug.marker([aa,hi],{icon:Cn(io.point_count||0)}).addTo(ct);oo.on("click",()=>{if(ct&&St){const Ha=St.getClusterExpansionZoom(io.cluster_id);ct.setView([aa,hi],Ha)}});const Ur=St.getLeaves(io.cluster_id,1/0).map(Ha=>`
+ `),ne.value.push(qa)},200)};Io()},hi)},va=()=>{if(!ct||!St)return;const qi=ct.getBounds(),Bi=Math.floor(ct.getZoom());Ut.value.forEach(Yn=>{ct&&Yn.remove()}),Ut.value.clear(),ne.value.forEach(Yn=>{ct&&Yn.remove()}),ne.value.length=0,St.getClusters([qi.getWest(),qi.getSouth(),qi.getEast(),qi.getNorth()],Bi).forEach(Yn=>{const[hi,na]=Yn.geometry.coordinates,Xa=Yn.properties;if(Xa.cluster){const oo=ug.marker([na,hi],{icon:Cn(Xa.point_count||0)}).addTo(ct);oo.on("click",()=>{if(ct&&St){const Ha=St.getClusterExpansionZoom(Xa.cluster_id);ct.setView([na,hi],Ha)}});const Ur=St.getLeaves(Xa.cluster_id,1/0).map(Ha=>`
• ${Ha.properties.advert.node_name||"Unknown Node"} (${Ha.properties.advert.contact_type})
`).join("");oo.bindPopup(`
- Cluster: ${io.point_count} nodes
+ Cluster: ${Xa.point_count} nodes
${Ur}
@@ -96,39 +96,39 @@ function Unt(e,t){for(var r=0;r
- `),Ut.value.set(`cluster-${io.cluster_id}`,oo);const Sn=tn(Sr,Dr,aa,hi),Hn=Math.min(Math.floor(Sn*5),200),Qa={node_name:`Cluster of ${io.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:aa,jittered_longitude:hi,latitude:aa,longitude:hi};ta(Qa,Sr,Dr,"#AAE8E8",Hn)}else{const oo=io.advert,xa=_i[oo.contact_type]||_i.Unknown,Ur=nn(xa),Sn=aa,Hn=hi,Qa=tn(Sr,Dr,Sn,Hn),Ha=ug.marker([Sn,Hn],{icon:Ur}).addTo(ct).bindPopup(` + `),Ut.value.set(`cluster-${Xa.cluster_id}`,oo);const Sn=tn(Sr,Dr,na,hi),Hn=Math.min(Math.floor(Sn*5),200),to={node_name:`Cluster of ${Xa.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:na,jittered_longitude:hi,latitude:na,longitude:hi};ta(to,Sr,Dr,"#AAE8E8",Hn)}else{const oo=Xa.advert,xa=_i[oo.contact_type]||_i.Unknown,Ur=nn(xa),Sn=na,Hn=hi,to=tn(Sr,Dr,Sn,Hn),Ha=ug.marker([Sn,Hn],{icon:Ur}).addTo(ct).bindPopup(`
${oo.node_name||"Unknown Node"}
Type: ${oo.contact_type}
- Distance: ${Qa.toFixed(2)} km
+ Distance: ${to.toFixed(2)} km
Signal: ${rn(oo.rssi)} / ${Lr(oo.snr)}
Route: ${Mr(oo.route_type)}
Last Seen: ${It(oo.last_seen)} ${oo.jittered_latitude?'
Position adjusted to separate overlapping nodes':""}
- `);yt.value.set(oo.pubkey,Ha),Ut.value.set(`node-${oo.pubkey}`,Ha);const qa=Math.min(Math.floor(Qa*5),200),Mo={...oo,jittered_latitude:Sn,jittered_longitude:Hn};ta(Mo,Sr,Dr,xa,qa)}})},_a=(qi,Bi)=>{let Xi=0;Br(u.adverts).forEach(hi=>{const aa=hi.properties.advert;if(aa.latitude!==null&&aa.longitude!==null){const io=_i[aa.contact_type]||_i.Unknown,oo=nn(io),xa=aa.jittered_latitude||aa.latitude,Ur=aa.jittered_longitude||aa.longitude,Sn=ug.marker([xa,Ur],{icon:oo}).addTo(ct).bindPopup(` + `);yt.value.set(oo.pubkey,Ha),Ut.value.set(`node-${oo.pubkey}`,Ha);const qa=Math.min(Math.floor(to*5),200),Mo={...oo,jittered_latitude:Sn,jittered_longitude:Hn};ta(Mo,Sr,Dr,xa,qa)}})},_a=(qi,Bi)=>{let Xi=0;Br(u.adverts).forEach(hi=>{const na=hi.properties.advert;if(na.latitude!==null&&na.longitude!==null){const Xa=_i[na.contact_type]||_i.Unknown,oo=nn(Xa),xa=na.jittered_latitude||na.latitude,Ur=na.jittered_longitude||na.longitude,Sn=ug.marker([xa,Ur],{icon:oo}).addTo(ct).bindPopup(`
- ${aa.node_name||"Unknown Node"}
- Type: ${aa.contact_type}
+ ${na.node_name||"Unknown Node"}
+ Type: ${na.contact_type}
Distance: ${tn(qi,Bi,xa,Ur).toFixed(2)} km
- Signal: ${rn(aa.rssi)} / ${Lr(aa.snr)}
- Route: ${Mr(aa.route_type)}
- Last Seen: ${It(aa.last_seen)} - ${aa.jittered_latitude?'
Position adjusted to separate overlapping nodes':""} + Signal: ${rn(na.rssi)} / ${Lr(na.snr)}
+ Route: ${Mr(na.route_type)}
+ Last Seen: ${It(na.last_seen)} + ${na.jittered_latitude?'
Position adjusted to separate overlapping nodes':""}
- `);yt.value.set(aa.pubkey,Sn);const Hn=Sn.getElement();Hn&&(Hn.style.opacity="0",Hn.style.transition="opacity 0.5s ease-out"),ta(aa,qi,Bi,io,Xi),setTimeout(()=>{Hn&&(Hn.style.opacity="1")},Xi+1e3),Xi+=100}})};if(pe.value&&u.adverts.length>0)try{const qi=Br(u.adverts);Vn(qi);const Bi=Math.min(14,ct.getZoom());ct.setZoom(Bi),setTimeout(()=>{try{va()}catch(Xi){console.warn("Error updating clusters:",Xi),_a(Sr,Dr)}},100),ct.on("moveend",()=>{try{va()}catch(Xi){console.warn("Error updating clusters on move:",Xi)}}),ct.on("zoomend",()=>{try{va()}catch(Xi){console.warn("Error updating clusters on zoom:",Xi)}})}catch(qi){console.warn("Error initializing clustering:",qi),_a(Sr,Dr)}else _a(Sr,Dr);setTimeout(()=>{ct&&ct.invalidateSize()},1e3)}catch(nn){console.error("Error initializing map:",nn)}};return t({highlightNode:Sr=>{const Dr=yt.value.get(Sr);if(Dr){const nn=Dr.getElement();if(nn){const Cn=nn.querySelector("div");Cn&&Cn.classList.add("marker-highlight")}}},unhighlightNode:Sr=>{const Dr=yt.value.get(Sr);if(Dr){const nn=Dr.getElement();if(nn){const Cn=nn.querySelector("div");Cn&&Cn.classList.remove("marker-highlight")}}},initializeOpenStreetMap:on}),Fh(()=>u.adverts,()=>{ct&&kr.value&&setTimeout(()=>{on()},100)},{immediate:!1}),Xd(()=>{Ve.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),kr.value&&u.adverts.length>0&&setTimeout(()=>{on()},300)}),Dv(()=>{Ve.disconnect(),Dn()}),(Sr,Dr)=>(Or(),Nr("div",i1t,[kr.value?(Or(),Nr("div",{key:1,ref_key:"mapContainer",ref:K,class:"leaflet-map-container h-96 w-full glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] overflow-hidden shadow-sm dark:shadow-none",style:{"min-height":"384px",position:"relative"}},null,512)):(Or(),Nr("div",a1t,Dr[0]||(Dr[0]=[Du('

No valid coordinates available

Configure base station location to view map

',1)]))),kr.value&&Sr.adverts.length>0?(Or(),Nr("button",{key:2,onClick:$,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[Dr[1]||(Dr[1]=At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),At("span",o1t,yn(Sr.showLegend?"Hide":"Show"),1)])):Ta("",!0),kr.value&&Sr.adverts.length>0&&Sr.showLegend?(Or(),Nr("div",s1t,[Dr[2]||(Dr[2]=Du('
Node Types
Base Station
Chat Node
Repeater
Room Server
Hybrid Node
Route Types
Direct
Transport Direct
Flood
Transport Flood
',2)),At("div",l1t,yn(Sr.adverts.length)+" node"+yn(Sr.adverts.length!==1?"s":"")+" visible ",1)])):Ta("",!0),kr.value?(Or(),Nr("div",c1t," © OpenStreetMap contributors © CARTO ")):Ta("",!0)]))}}),h1t=vh(u1t,[["__scopeId","data-v-a6a23e33"]]),d1t={class:"relative","data-menu-container":""},bF=Cc({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete"],setup(e,{emit:t}){const r=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:Ce=>{if(r.activeMenu&&r.activeMenu!==Ce)try{r.activeMenu.closeMenu()}catch(Ve){console.warn("Error closing previous menu:",Ve)}r.activeMenu=Ce}};window.__neighborMenuManager=r;const u=e,T=t,$=li(!1),K=li(),ct=li({top:0,left:0}),yt=()=>{$.value=!1,document.removeEventListener("click",pe,!0),document.removeEventListener("keydown",me),r.activeMenu===St&&(r.activeMenu=null)},St={closeMenu:yt},Ut=()=>{yt(),T("ping",u.neighbor)},ne=()=>{yt(),T("delete",u.neighbor)},pe=Ce=>{Ce.target.closest("[data-menu-container]")||yt()},me=Ce=>{Ce.key==="Escape"&&yt()},we=async()=>{if(!$.value&&K.value){r.setActiveMenu(St);const Ce=K.value.getBoundingClientRect(),Ve=window.innerWidth,kr=144,It=Ve<1024,rn=Ce.left+kr>Ve-16;let Lr=Ce.left;It&&rn&&(Lr=Ce.right-kr),Lr=Math.max(8,Lr),ct.value={top:Ce.bottom+4,left:Lr},$.value=!0,await sp(),document.addEventListener("click",pe,!0),document.addEventListener("keydown",me)}else yt()};return Dv(()=>{yt()}),(Ce,Ve)=>(Or(),Nr("div",d1t,[At("button",{ref_key:"buttonRef",ref:K,onClick:we,class:ja(["p-1 rounded hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary/80",{"bg-background-mute dark:bg-stroke/10 text-content-primary dark:text-content-primary/80":$.value}]),"data-menu-container":""},Ve[0]||(Ve[0]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(Or(),w0(CS,{to:"body"},[$.value?(Or(),Nr("div",{key:0,class:"fixed w-36 bg-white dark:bg-surface-elevated backdrop-blur-lg border border-stroke-subtle dark:border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:Sp({top:ct.value.top+"px",left:ct.value.left+"px"}),"data-menu-container":""},[At("div",{class:"py-2"},[At("button",{onClick:Ut,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-content-primary dark:text-content-primary hover:bg-primary/10 transition-colors border-b border-stroke-subtle dark:border-white/10"},Ve[1]||(Ve[1]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})],-1),At("span",{class:"font-medium"},"Ping",-1)])),At("button",{onClick:ne,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},Ve[2]||(Ve[2]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),At("span",{class:"font-medium"},"Delete",-1)]))])],4)):Ta("",!0)]))]))}}),f1t={class:"glass-card/30 backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[12px] p-6 shadow-sm dark:shadow-none"},p1t={class:"flex items-center justify-between mb-4"},m1t={class:"flex items-center gap-3"},g1t={class:"text-content-primary dark:text-content-primary text-lg font-semibold"},v1t={class:"bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary text-xs px-2 py-1 rounded-full"},y1t={key:0,class:"text-content-muted dark:text-content-muted"},_1t={key:0,class:"hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 p-1"},x1t={class:"hidden lg:block overflow-x-auto"},b1t={class:"w-full"},w1t={class:"bg-background-mute dark:bg-transparent"},k1t={class:"bg-surface/50 dark:bg-transparent"},T1t=["onMouseenter","onMouseleave"],S1t=["onClick","title"],C1t={key:0,class:"ml-1 text-xs"},A1t={key:0,class:"flex items-center gap-3"},M1t={class:"text-content-secondary dark:text-content-muted"},E1t={class:"flex gap-1"},L1t=["onClick"],P1t=["onClick"],I1t={key:1,class:"text-content-muted"},D1t={class:"flex items-center gap-2"},z1t={class:"flex items-end gap-0.5"},O1t={class:"flex items-center gap-2"},B1t=["title"],R1t=["title"],F1t={class:"lg:hidden space-y-3"},N1t=["onClick"],j1t={class:"flex items-center justify-between mb-3"},U1t={class:"flex items-center gap-3"},$1t={class:"text-content-primary dark:text-content-primary font-medium text-base"},H1t={class:"flex items-center gap-2"},V1t={class:"grid grid-cols-1 gap-3"},W1t={class:"grid grid-cols-2 gap-4"},q1t=["onClick","title"],G1t={key:0,class:"ml-1 text-xs"},Z1t={class:"flex items-center gap-2 justify-end"},K1t={class:"flex items-end gap-0.5"},Y1t={class:"grid grid-cols-2 gap-4"},X1t={class:"flex items-center gap-2"},J1t=["title"],Q1t={class:"text-content-primary dark:text-content-primary text-sm block text-right"},tyt={key:0,class:"border-t border-white/10 pt-3"},eyt={class:"flex items-center justify-between"},ryt={class:"text-content-secondary dark:text-content-muted text-sm font-mono"},nyt={class:"flex gap-2"},iyt=["onClick"],ayt=["onClick"],oyt={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},syt={class:"text-center"},lyt={class:"text-content-primary dark:text-content-primary text-sm font-medium"},cyt={class:"text-center"},uyt={class:"text-content-primary dark:text-content-primary text-sm font-medium"},hyt={class:"text-center"},dyt=["title"],fyt=Cc({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},originalCount:{default:0},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","toggle-view"],setup(e,{emit:t}){const r=li(null),u=e,T=t,$=Br=>new Date(Br*1e3).toLocaleString(),K=Br=>`${Br.slice(0,4)}...${Br.slice(-4)}`,ct=Br=>{switch(Br){case 2:return{text:"Direct",bgColor:"bg-green-100 dark:bg-green-500/20",borderColor:"border-green-500 dark:border-green-400/30",textColor:"text-green-600 dark:text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-100 dark:bg-green-600/20",borderColor:"border-green-600/40 dark:border-green-500/30",textColor:"text-green-700 dark:text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-100 dark:bg-yellow-500/20",borderColor:"border-yellow-500 dark:border-yellow-400/30",textColor:"text-yellow-600 dark:text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-100 dark:bg-orange-500/20",borderColor:"border-orange-500 dark:border-orange-400/30",textColor:"text-orange-600 dark:text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},yt=Br=>Br?`${Br} dBm`:"N/A",St=Br=>Br?`${Br} dB`:"N/A",Ut=(Br,Vn,on,pr)=>{const Sr=(on-Br)*Math.PI/180,Dr=(pr-Vn)*Math.PI/180,nn=Math.sin(Sr/2)*Math.sin(Sr/2)+Math.cos(Br*Math.PI/180)*Math.cos(on*Math.PI/180)*Math.sin(Dr/2)*Math.sin(Dr/2);return 6371*(2*Math.atan2(Math.sqrt(nn),Math.sqrt(1-nn)))},ne=Br=>u.baseLatitude===null||u.baseLongitude===null||Br.latitude===null||Br.longitude===null?"N/A":`${Ut(u.baseLatitude,u.baseLongitude,Br.latitude,Br.longitude).toFixed(1)} km`,pe=async Br=>{try{return await navigator.clipboard.writeText(Br),!0}catch{const Vn=document.createElement("textarea");return Vn.value=Br,document.body.appendChild(Vn),Vn.select(),document.execCommand("copy"),document.body.removeChild(Vn),!0}},me=Br=>{const Vn=Date.now(),on=Br*1e3,pr=Vn-on,_r=Math.floor(pr/1e3),Sr=Math.floor(_r/60),Dr=Math.floor(Sr/60),nn=Math.floor(Dr/24);return _r<60?`${_r}s ago`:Sr<60?`${Sr}m ago`:Dr<24?`${Dr}h ago`:`${nn}d ago`},we=Br=>{const Vn=Date.now(),on=Br*1e3,pr=Vn-on,_r=Math.floor(pr/(1e3*60*60));return _r<1?{color:"text-green-600 dark:text-green-400"}:_r<26?{color:"text-yellow-600 dark:text-yellow-400"}:{color:"text-red-600 dark:text-red-400"}},Ce=async(Br,Vn)=>{const on=`${Br.toFixed(6)}, ${Vn.toFixed(6)}`;await pe(on)},Ve=(Br,Vn)=>{const on=`https://www.google.com/maps?q=${Br},${Vn}`;window.open(on,"_blank")},kr=async Br=>{await pe(Br),r.value=Br,setTimeout(()=>{r.value=null},2e3)},It=Br=>Br?Br>=-50?{bars:5,color:"text-green-600 dark:text-green-400"}:Br>=-60?{bars:4,color:"text-green-600 dark:text-green-300"}:Br>=-70?{bars:3,color:"text-yellow-600 dark:text-yellow-400"}:Br>=-80?{bars:2,color:"text-orange-600 dark:text-orange-400"}:Br>=-90?{bars:1,color:"text-red-600 dark:text-red-400"}:{bars:0,color:"text-red-600 dark:text-red-500"}:{bars:0,color:"text-gray-400"},rn=()=>u.isCompactView?"py-2 px-2":"py-4 px-3",Lr=()=>{T("toggle-view")},Mr=Br=>{T("highlight-node",Br)},tn=Br=>{T("unhighlight-node",Br)},Dn=Br=>{T("menu-ping",Br)},Mn=Br=>{T("menu-delete",Br)};return(Br,Vn)=>(Or(),Nr("div",f1t,[At("div",p1t,[At("div",m1t,[At("div",{class:"w-3 h-3 rounded-full border border-white/20",style:Sp({backgroundColor:Br.color})},null,4),At("h3",g1t,yn(Br.contactType),1),At("span",v1t,[cl(yn(Br.adverts.length)+" ",1),Br.originalCount>0&&Br.adverts.length(Or(),Nr("tr",{key:on.id,class:"hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors",onMouseenter:pr=>Mr(on.pubkey),onMouseleave:pr=>tn(on.pubkey)},[At("td",{class:ja(rn())},[Vs(bF,{neighbor:on,onPing:Dn,onDelete:Mn},null,8,["neighbor"])],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},yn(on.node_name||"Unknown"),3),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm font-mono`)},[At("button",{onClick:pr=>kr(on.pubkey),class:ja(["text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60",r.value===on.pubkey?"text-green-600 dark:text-green-400 decoration-green-400/60":""]),title:r.value===on.pubkey?"Copied!":"Click to copy full public key"},[cl(yn(K(on.pubkey))+" ",1),r.value===on.pubkey?(Or(),Nr("span",C1t,"✓")):Ta("",!0)],10,S1t)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[on.latitude!==null&&on.longitude!==null?(Or(),Nr("div",A1t,[At("span",M1t,yn(on.latitude.toFixed(4))+", "+yn(on.longitude.toFixed(4)),1),At("div",E1t,[At("button",{onClick:pr=>Ce(on.latitude,on.longitude),class:"text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},Vn[2]||(Vn[2]=[At("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),At("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,L1t),At("button",{onClick:pr=>Ve(on.latitude,on.longitude),class:"text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},Vn[3]||(Vn[3]=[At("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),At("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,P1t)])])):(Or(),Nr("span",I1t,"Unknown"))],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},yn(ne(on)),3),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",ct(on.route_type).bgColor,ct(on.route_type).borderColor,ct(on.route_type).textColor])},yn(ct(on.route_type).text),3)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",on.zero_hop?"bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400":"bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400"])},yn(on.zero_hop?"Zero Hop":"Multi-Hop"),3)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("div",D1t,[At("div",z1t,[(Or(),Nr(Es,null,jl(5,pr=>At("div",{key:pr,class:ja(["w-1 transition-colors",pr<=It(on.rssi).bars?It(on.rssi).color:"text-gray-600"]),style:Sp({height:`${4+pr*2}px`})},Vn[4]||(Vn[4]=[At("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),At("span",{class:ja(It(on.rssi).color)},yn(yt(on.rssi)),3)])],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},yn(St(on.snr)),3),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("div",O1t,[At("div",{class:ja(["w-2 h-2 rounded-full",we(on.last_seen).color==="text-green-600 dark:text-green-400"?"bg-green-400":"",we(on.last_seen).color==="text-yellow-600 dark:text-yellow-400"?"bg-yellow-400":"",we(on.last_seen).color==="text-red-600 dark:text-red-400"?"bg-red-400":""])},null,2),At("span",{class:ja([we(on.last_seen).color,"cursor-help"]),title:$(on.last_seen)},yn(me(on.last_seen)),11,B1t)])],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("span",{title:$(on.first_seen),class:"cursor-help"},yn(me(on.first_seen)),9,R1t)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm text-center`)},yn(on.advert_count),3)],40,T1t))),128))])])]),At("div",F1t,[(Or(!0),Nr(Es,null,jl(Br.adverts,on=>(Or(),Nr("div",{key:on.id,class:"bg-surface/50 dark:bg-transparent border border-stroke-subtle dark:border-white/10 rounded-lg p-4 hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors",onClick:pr=>Mr(on.pubkey)},[At("div",j1t,[At("div",U1t,[At("h4",$1t,yn(on.node_name||"Unknown Node"),1),At("div",H1t,[At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border",ct(on.route_type).bgColor,ct(on.route_type).borderColor,ct(on.route_type).textColor])},yn(ct(on.route_type).text),3),At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border",on.zero_hop?"bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400":"bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400"])},yn(on.zero_hop?"Zero Hop":"Multi-Hop"),3)])]),Vs(bF,{neighbor:on,onPing:Dn,onDelete:Mn},null,8,["neighbor"])]),At("div",V1t,[At("div",W1t,[At("div",null,[Vn[5]||(Vn[5]=At("div",{class:"text-content-muted text-xs mb-1"},"Public Key",-1)),At("button",{onClick:pr=>kr(on.pubkey),class:ja(["text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60 break-all",r.value===on.pubkey?"text-green-600 dark:text-green-400 decoration-green-400/60":""]),title:r.value===on.pubkey?"Copied!":"Click to copy full public key"},[cl(yn(K(on.pubkey))+" ",1),r.value===on.pubkey?(Or(),Nr("span",G1t,"✓")):Ta("",!0)],10,q1t)]),At("div",null,[Vn[7]||(Vn[7]=At("div",{class:"text-content-muted text-xs mb-1"},"Signal",-1)),At("div",Z1t,[At("div",K1t,[(Or(),Nr(Es,null,jl(5,pr=>At("div",{key:pr,class:ja(["w-1.5 transition-colors",pr<=It(on.rssi).bars?It(on.rssi).color:"text-gray-600"]),style:Sp({height:`${6+pr*2}px`})},Vn[6]||(Vn[6]=[At("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),At("span",{class:ja(`${It(on.rssi).color} text-sm font-medium`)},yn(yt(on.rssi)),3)])])]),At("div",Y1t,[At("div",null,[Vn[8]||(Vn[8]=At("div",{class:"text-content-muted text-xs mb-1"},"Last Seen",-1)),At("div",X1t,[At("div",{class:ja(["w-2 h-2 rounded-full",we(on.last_seen).color==="text-green-600 dark:text-green-400"?"bg-green-400":"",we(on.last_seen).color==="text-yellow-600 dark:text-yellow-400"?"bg-yellow-400":"",we(on.last_seen).color==="text-red-600 dark:text-red-400"?"bg-red-400":""])},null,2),At("span",{class:ja(`${we(on.last_seen).color} text-sm`),title:$(on.last_seen)},yn(me(on.last_seen)),11,J1t)])]),At("div",null,[Vn[9]||(Vn[9]=At("div",{class:"text-content-muted text-xs mb-1"},"Distance",-1)),At("span",Q1t,yn(ne(on)),1)])]),on.latitude!==null&&on.longitude!==null?(Or(),Nr("div",tyt,[Vn[12]||(Vn[12]=At("div",{class:"text-content-muted text-xs mb-1"},"Location",-1)),At("div",eyt,[At("span",ryt,yn(on.latitude.toFixed(4))+", "+yn(on.longitude.toFixed(4)),1),At("div",nyt,[At("button",{onClick:pr=>Ce(on.latitude,on.longitude),class:"text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg",title:"Copy coordinates"},Vn[10]||(Vn[10]=[At("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),At("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,iyt),At("button",{onClick:pr=>Ve(on.latitude,on.longitude),class:"text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},Vn[11]||(Vn[11]=[At("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),At("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,ayt)])])])):Ta("",!0),At("div",oyt,[At("div",syt,[Vn[13]||(Vn[13]=At("div",{class:"text-content-muted text-xs mb-1"},"SNR",-1)),At("span",lyt,yn(St(on.snr)),1)]),At("div",cyt,[Vn[14]||(Vn[14]=At("div",{class:"text-content-muted text-xs mb-1"},"Adverts",-1)),At("span",uyt,yn(on.advert_count),1)]),At("div",hyt,[Vn[15]||(Vn[15]=At("div",{class:"text-content-muted text-xs mb-1"},"First Seen",-1)),At("span",{class:"text-content-primary dark:text-content-primary text-sm",title:$(on.first_seen)},yn(me(on.first_seen)),9,dyt)])])])],8,N1t))),128))])]))}}),pyt={class:"space-y-6"},myt={key:0,class:"flex items-center justify-center py-12"},gyt={key:1,class:"bg-red-50 dark:bg-accent-red/10 border border-red-300 dark:border-accent-red/20 rounded-[15px] p-6"},vyt={class:"flex items-center gap-3"},yyt={class:"text-red-500 dark:text-accent-red/80 text-sm"},_yt={key:0,class:""},xyt={class:"flex items-center justify-between"},byt={class:"flex items-center gap-3"},wyt={class:"hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 mb p-1"},kyt={class:"flex items-center gap-2"},Tyt={key:0,class:"ml-1 bg-accent-blue/20 text-accent-blue border border-accent-blue/30 text-xs px-1.5 py-0.5 rounded-full font-medium"},Syt={class:"bg-background dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mt-4 space-y-4"},Cyt={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Ayt={key:1,class:"text-center py-12"},Myt={key:2,class:"text-center py-12"},Eyt=Cc({name:"NeighborsView",__name:"Neighbors",setup(e){const t=Ym(),r={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},u={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},T=li({}),$=li(!0),K=li(null),ct=li(B1("neighbors_compactView",!1)),yt=li(B1("neighbors_showMapLegend",typeof window<"u"?window.innerWidth>=1024:!0)),St=li(B1("neighbors_showFilters",!1)),Ut=li(B1("neighbors_filters",{zeroHop:"all",routeType:"all",searchText:""}));Fh(ct,va=>R1("neighbors_compactView",va)),Fh(yt,va=>R1("neighbors_showMapLegend",va)),Fh(St,va=>R1("neighbors_showFilters",va)),Fh(Ut,va=>R1("neighbors_filters",va),{deep:!0});const ne=li(!1),pe=li(!1),me=li(!1),we=li(null),Ce=li(null),Ve=li(null),kr=li(null),It=Ao(()=>{if(!kr.value)return null;const va=kr.value;return{id:va.id,pubkey:va.pubkey,node_name:va.node_name,contact_type:va.contact_type,latitude:va.latitude,longitude:va.longitude,rssi:va.rssi,snr:va.snr,route_type:va.route_type,last_seen:va.last_seen,first_seen:va.first_seen,advert_count:va.advert_count,timestamp:va.timestamp,is_repeater:va.is_repeater,is_new_neighbor:va.is_new_neighbor,zero_hop:va.zero_hop}}),rn=Ao(()=>t.stats?.config?.repeater?.latitude),Lr=Ao(()=>t.stats?.config?.repeater?.longitude),Mr=va=>va.filter(_a=>{if(Ut.value.zeroHop!=="all"){const qi=_a.zero_hop;if(Ut.value.zeroHop==="true"&&!qi||Ut.value.zeroHop==="false"&&qi)return!1}if(Ut.value.routeType!=="all"){const qi=_a.route_type;if(Ut.value.routeType==="direct"&&qi!==2||Ut.value.routeType==="transport_direct"&&qi!==3||Ut.value.routeType==="flood"&&qi!==1||Ut.value.routeType==="transport_flood"&&qi!==0)return!1}if(Ut.value.searchText){const qi=Ut.value.searchText.toLowerCase(),Bi=_a.node_name?.toLowerCase()||"",Xi=_a.pubkey.toLowerCase();if(!Bi.includes(qi)&&!Xi.includes(qi))return!1}return!0}),tn=()=>{Ut.value={zeroHop:"all",routeType:"all",searchText:""}},Dn=Ao(()=>Ut.value.zeroHop!=="all"||Ut.value.routeType!=="all"||Ut.value.searchText!==""),Mn=Ao(()=>{const va={};for(const[_a,qi]of Object.entries(T.value))va[_a]=Mr(qi);return va}),Br=Ao(()=>Object.entries(r).filter(([va])=>Mn.value[va]?.length>0).sort(([va],[_a])=>parseInt(va)-parseInt(_a))),Vn=Ao(()=>Object.values(T.value).flat().filter(va=>{const _a=va.latitude,qi=va.longitude;return _a!=null&&_a!==0&&qi!==null&&qi!==void 0&&qi!==0&&typeof _a=="number"&&typeof qi=="number"&&!isNaN(_a)&&!isNaN(qi)&&va.zero_hop===!0})),on=async va=>{try{const _a=await bs.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(va)}&hours=168`);return _a.success&&Array.isArray(_a.data)?_a.data:[]}catch(_a){return console.error(`Error fetching adverts for contact type ${va}:`,_a),[]}},pr=async()=>{$.value=!0,K.value=null;try{T.value={};for(const[va,_a]of Object.entries(r)){const qi=await on(_a);qi.length>0&&(T.value[va]=qi)}}catch(va){console.error("Error loading adverts:",va),K.value=va instanceof Error?va.message:"Failed to load neighbor data"}finally{$.value=!1}},_r=li(),Sr=va=>{_r.value?.highlightNode(va)},Dr=va=>{_r.value?.unhighlightNode(va)},nn=async va=>{const _a=va;we.value=null,Ce.value=null,me.value=!0,Ve.value=_a.node_name||"Unknown Node",pe.value=!0;try{const Bi=`0x${parseInt(_a.pubkey.substring(0,2),16).toString(16).padStart(2,"0")}`;console.log(`Pinging neighbor ${_a.node_name||"Unknown"} (${Bi})...`);const Xi=await bs.pingNeighbor(Bi,10);Xi.success&&Xi.data?(we.value=Xi.data,console.log("Ping successful:",Xi.data)):(Ce.value=Xi.error||"Unknown error occurred",console.error("Failed to ping neighbor:",Xi.error))}catch(qi){console.error("Error pinging neighbor:",qi),Ce.value=qi instanceof Error?qi.message:"Unknown error occurred"}finally{me.value=!1}},Cn=()=>{pe.value=!1,we.value=null,Ce.value=null,Ve.value=null},Xn=va=>{kr.value=va,ne.value=!0},_i=()=>{ne.value=!1,kr.value=null},ta=async va=>{try{await bs.deleteAdvert(va),await pr(),_i()}catch(_a){console.error("Error deleting neighbor:",_a)}};return Xd(async()=>{await pr()}),(va,_a)=>(Or(),Nr("div",pyt,[$.value?(Or(),Nr("div",myt,_a[7]||(_a[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),At("p",{class:"text-content-secondary dark:text-content-muted"},"Loading neighbor data...")],-1)]))):K.value?(Or(),Nr("div",gyt,[At("div",vyt,[_a[9]||(_a[9]=At("svg",{class:"w-5 h-5 text-red-600 dark:text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),At("div",null,[_a[8]||(_a[8]=At("h3",{class:"text-red-600 dark:text-accent-red font-medium"},"Error Loading Neighbors",-1)),At("p",yyt,yn(K.value),1)])])])):(Or(),Nr(Es,{key:2},[Vs(h1t,{ref_key:"networkMapRef",ref:_r,adverts:Vn.value,"base-latitude":rn.value,"base-longitude":Lr.value,"show-legend":yt.value,"onUpdate:showLegend":_a[0]||(_a[0]=qi=>yt.value=qi)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),Object.keys(T.value).length>0?(Or(),Nr("div",_yt,[At("div",xyt,[_a[14]||(_a[14]=At("span",{class:"text-content-primary dark:text-content-primary text-lg font-semibold"},null,-1)),At("div",byt,[At("div",wyt,[At("button",{onClick:_a[1]||(_a[1]=qi=>ct.value=!1),class:ja(["p-2 rounded-md transition-colors",ct.value?"text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},_a[10]||(_a[10]=[At("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),At("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),At("button",{onClick:_a[2]||(_a[2]=qi=>ct.value=!0),class:ja(["p-2 rounded-md transition-colors",ct.value?"bg-primary/20 text-primary border border-primary/30":"text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10"]),title:"Compact view"},_a[11]||(_a[11]=[At("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),At("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),At("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)]),At("div",kyt,[At("button",{onClick:_a[3]||(_a[3]=qi=>St.value=!St.value),class:ja(["px-3 py-1.5 text-xs rounded-lg transition-colors border",Dn.value?"bg-primary/20 text-primary border-primary/30":"bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20"])},[_a[12]||(_a[12]=At("svg",{class:"w-4 h-4 inline mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z"})],-1)),_a[13]||(_a[13]=cl(" Filters ",-1)),Dn.value?(Or(),Nr("span",Tyt," Active ")):Ta("",!0)],2),Dn.value?(Or(),Nr("button",{key:0,onClick:tn,class:"px-3 py-1.5 text-xs rounded-lg bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors"}," Clear Filters ")):Ta("",!0)])])]),Ml(At("div",Syt,[At("div",Cyt,[At("div",null,[_a[16]||(_a[16]=At("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Zero Hop",-1)),Ml(At("select",{"onUpdate:modelValue":_a[4]||(_a[4]=qi=>Ut.value.zeroHop=qi),class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none"},_a[15]||(_a[15]=[At("option",{value:"all"},"All Nodes",-1),At("option",{value:"true"},"Zero Hop Only",-1),At("option",{value:"false"},"Multi-Hop Only",-1)]),512),[[xg,Ut.value.zeroHop]])]),At("div",null,[_a[18]||(_a[18]=At("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Route Type",-1)),Ml(At("select",{"onUpdate:modelValue":_a[5]||(_a[5]=qi=>Ut.value.routeType=qi),class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none"},_a[17]||(_a[17]=[Du('',5)]),512),[[xg,Ut.value.routeType]])]),At("div",null,[_a[19]||(_a[19]=At("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Search",-1)),Ml(At("input",{"onUpdate:modelValue":_a[6]||(_a[6]=qi=>Ut.value.searchText=qi),type:"text",placeholder:"Node name or pubkey...",class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none placeholder-gray-400 dark:placeholder-white/40"},null,512),[[lu,Ut.value.searchText]])])])],512),[[Zy,St.value]])])):Ta("",!0),(Or(!0),Nr(Es,null,jl(Br.value,([qi,Bi])=>(Or(),Nr("div",{key:qi,class:"space-y-6"},[Vs(fyt,{"contact-type":Bi,"contact-type-key":qi,adverts:Mn.value[qi],"original-count":T.value[qi]?.length||0,color:u[parseInt(qi)],"base-latitude":rn.value,"base-longitude":Lr.value,"is-compact-view":ct.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:Sr,onUnhighlightNode:Dr,onMenuPing:nn,onMenuDelete:Xn},null,8,["contact-type","contact-type-key","adverts","original-count","color","base-latitude","base-longitude","is-compact-view"])]))),128)),Br.value.length===0&&Object.keys(T.value).length===0?(Or(),Nr("div",Ayt,[_a[20]||(_a[20]=Du('

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

',3)),At("button",{onClick:pr,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):Br.value.length===0&&Dn.value?(Or(),Nr("div",Myt,[_a[21]||(_a[21]=Du('

No neighbors match your filters

Try adjusting your filter criteria to see more results.

',3)),At("button",{onClick:tn,class:"px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Clear Filters ")])):Ta("",!0)],64)),Vs(yvt,{show:ne.value,neighbor:It.value,onClose:_i,onDelete:ta},null,8,["show","neighbor"]),Vs(Yvt,{show:pe.value,"node-name":Ve.value,result:we.value,error:Ce.value,loading:me.value,onClose:Cn},null,8,["show","node-name","result","error","loading"])]))}}),Lyt={class:"sparkline-card"},Pyt={class:"card-header"},Iyt={class:"card-title"},Dyt={key:0,class:"card-chart"},zyt={key:0,class:"chart-loader"},Oyt={key:1,class:"chart-text"},Byt={class:"percent-value"},Ryt=["id","viewBox"],Fyt=["d","fill"],Nyt=["d","stroke"],tT=100,eT=40,jyt=Cc({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},variant:{default:"smooth"},loading:{type:Boolean,default:!1},centerText:{default:""}},setup(e){const t=e,r=yt=>{if(yt.length<3)return yt;const St=Math.min(15,Math.max(3,Math.floor(yt.length*.2))),Ut=[];for(let we=0;wern+Lr,0)/It.length)}const ne=Math.min(10,Ut.length),pe=Ut.length/ne,me=[];for(let we=0;we!t.data||t.data.length===0?[]:t.variant==="smooth"?r(t.data):t.data),T=yt=>{if(yt.length<2)return"";const St=Math.max(...yt),Ut=Math.min(...yt),ne=St-Ut||1,pe=t.variant==="classic"?4:2;let me="";return yt.forEach((we,Ce)=>{const Ve=Ce/(yt.length-1)*tT,kr=(we-Ut)/ne,It=pe+(eT-pe*2)*(1-kr);if(Ce===0)me+=`M ${Ve.toFixed(2)} ${It.toFixed(2)}`;else{const Lr=((Ce-1)/(yt.length-1)*tT+Ve)/2;me+=` Q ${Lr.toFixed(2)} ${It.toFixed(2)} ${Ve.toFixed(2)} ${It.toFixed(2)}`}}),me},$=Ao(()=>T(u.value)),K=Ao(()=>$.value?`${$.value} L ${tT} ${eT} L 0 ${eT} Z`:""),ct=Ao(()=>`sparkline-${t.title.replace(/\s+/g,"-").toLowerCase()}`);return(yt,St)=>(Or(),Nr("div",Lyt,[At("div",Pyt,[At("p",Iyt,yn(yt.title),1),At("span",{class:"card-value",style:Sp({color:yt.color})},yn(typeof yt.value=="number"?yt.value.toLocaleString():yt.value),5)]),yt.showChart?(Or(),Nr("div",Dyt,[yt.loading&&yt.variant==="classic"?(Or(),Nr("div",zyt,[At("div",{class:"loader-spinner",style:Sp({borderTopColor:yt.color})},null,4)])):yt.centerText?(Or(),Nr("div",Oyt,[At("span",Byt,yn(yt.centerText),1)])):(Or(),Nr("svg",{key:2,id:ct.value,class:"chart-svg",viewBox:`0 0 ${tT} ${eT}`,preserveAspectRatio:"none"},[yt.variant==="classic"?(Or(),Nr(Es,{key:0},[u.value.length>1?(Or(),Nr("path",{key:0,d:K.value,fill:yt.color,"fill-opacity":"0.8",class:"sparkline-path"},null,8,Fyt)):Ta("",!0)],64)):(Or(),Nr(Es,{key:1},[u.value.length>1?(Or(),Nr("path",{key:0,d:$.value,stroke:yt.color,"stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"sparkline-path"},null,8,Nyt)):Ta("",!0)],64))],8,Ryt))])):Ta("",!0)]))}}),S2=vh(jyt,[["__scopeId","data-v-b523a8f6"]]),kH=6048e5,Uyt=864e5,h4=6e4,d4=36e5,$yt=1e3,wF=Symbol.for("constructDateFrom");function $f(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&wF in e?e[wF](t):e instanceof Date?new e.constructor(t):new Date(t)}function Jc(e,t){return $f(t||e,e)}function KS(e,t,r){const u=Jc(e,r?.in);return isNaN(t)?$f(r?.in||e,NaN):(t&&u.setDate(u.getDate()+t),u)}function lL(e,t,r){const u=Jc(e,r?.in);if(isNaN(t))return $f(e,NaN);if(!t)return u;const T=u.getDate(),$=$f(e,u.getTime());$.setMonth(u.getMonth()+t+1,0);const K=$.getDate();return T>=K?$:(u.setFullYear($.getFullYear(),$.getMonth(),T),u)}function cL(e,t,r){return $f(e,+Jc(e)+t)}function Hyt(e,t,r){return cL(e,t*d4)}let Vyt={};function Gx(){return Vyt}function zv(e,t){const r=Gx(),u=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,T=Jc(e,t?.in),$=T.getDay(),K=($=$.getTime()?u+1:r.getTime()>=ct.getTime()?u:u-1}function aS(e){const t=Jc(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Zx(e,...t){const r=$f.bind(null,t.find(u=>typeof u=="object"));return t.map(r)}function p9(e,t){const r=Jc(e,t?.in);return r.setHours(0,0,0,0),r}function SH(e,t,r){const[u,T]=Zx(r?.in,e,t),$=p9(u),K=p9(T),ct=+$-aS($),yt=+K-aS(K);return Math.round((ct-yt)/Uyt)}function Wyt(e,t){const r=TH(e,t),u=$f(e,0);return u.setFullYear(r,0,4),u.setHours(0,0,0,0),q2(u)}function qyt(e,t,r){const u=Jc(e,r?.in);return u.setTime(u.getTime()+t*h4),u}function Gyt(e,t,r){return lL(e,t*3,r)}function Zyt(e,t,r){return cL(e,t*1e3)}function Kyt(e,t,r){return KS(e,t*7,r)}function Yyt(e,t,r){return lL(e,t*12,r)}function L5(e,t){const r=+Jc(e)-+Jc(t);return r<0?-1:r>0?1:r}function Xyt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function CH(e){return!(!Xyt(e)&&typeof e!="number"||isNaN(+Jc(e)))}function Jyt(e,t,r){const[u,T]=Zx(r?.in,e,t),$=u.getFullYear()-T.getFullYear(),K=u.getMonth()-T.getMonth();return $*12+K}function Qyt(e,t,r){const[u,T]=Zx(r?.in,e,t);return u.getFullYear()-T.getFullYear()}function AH(e,t,r){const[u,T]=Zx(r?.in,e,t),$=kF(u,T),K=Math.abs(SH(u,T));u.setDate(u.getDate()-$*K);const ct=+(kF(u,T)===-$),yt=$*(K-ct);return yt===0?0:yt}function kF(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function f4(e){return t=>{const u=(e?Math[e]:Math.trunc)(t);return u===0?0:u}}function t_t(e,t,r){const[u,T]=Zx(r?.in,e,t),$=(+u-+T)/d4;return f4(r?.roundingMethod)($)}function uL(e,t){return+Jc(e)-+Jc(t)}function e_t(e,t,r){const u=uL(e,t)/h4;return f4(r?.roundingMethod)(u)}function MH(e,t){const r=Jc(e,t?.in);return r.setHours(23,59,59,999),r}function EH(e,t){const r=Jc(e,t?.in),u=r.getMonth();return r.setFullYear(r.getFullYear(),u+1,0),r.setHours(23,59,59,999),r}function r_t(e,t){const r=Jc(e,t?.in);return+MH(r,t)==+EH(r,t)}function LH(e,t,r){const[u,T,$]=Zx(r?.in,e,e,t),K=L5(T,$),ct=Math.abs(Jyt(T,$));if(ct<1)return 0;T.getMonth()===1&&T.getDate()>27&&T.setDate(30),T.setMonth(T.getMonth()-K*ct);let yt=L5(T,$)===-K;r_t(u)&&ct===1&&L5(u,$)===1&&(yt=!1);const St=K*(ct-+yt);return St===0?0:St}function n_t(e,t,r){const u=LH(e,t,r)/3;return f4(r?.roundingMethod)(u)}function i_t(e,t,r){const u=uL(e,t)/1e3;return f4(r?.roundingMethod)(u)}function a_t(e,t,r){const u=AH(e,t,r)/7;return f4(r?.roundingMethod)(u)}function o_t(e,t,r){const[u,T]=Zx(r?.in,e,t),$=L5(u,T),K=Math.abs(Qyt(u,T));u.setFullYear(1584),T.setFullYear(1584);const ct=L5(u,T)===-$,yt=$*(K-+ct);return yt===0?0:yt}function s_t(e,t){const r=Jc(e,t?.in),u=r.getMonth(),T=u-u%3;return r.setMonth(T,1),r.setHours(0,0,0,0),r}function l_t(e,t){const r=Jc(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function c_t(e,t){const r=Jc(e,t?.in),u=r.getFullYear();return r.setFullYear(u+1,0,0),r.setHours(23,59,59,999),r}function PH(e,t){const r=Jc(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function u_t(e,t){const r=Jc(e,t?.in);return r.setMinutes(59,59,999),r}function h_t(e,t){const r=Gx(),u=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,T=Jc(e,t?.in),$=T.getDay(),K=(${let u;const T=m_t[e];return typeof T=="string"?u=T:t===1?u=T.one:u=T.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+u:u+" ago":u};function J7(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const v_t={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},y_t={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},__t={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},x_t={date:J7({formats:v_t,defaultWidth:"full"}),time:J7({formats:y_t,defaultWidth:"full"}),dateTime:J7({formats:__t,defaultWidth:"full"})},b_t={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},w_t=(e,t,r,u)=>b_t[e];function V3(e){return(t,r)=>{const u=r?.context?String(r.context):"standalone";let T;if(u==="formatting"&&e.formattingValues){const K=e.defaultFormattingWidth||e.defaultWidth,ct=r?.width?String(r.width):K;T=e.formattingValues[ct]||e.formattingValues[K]}else{const K=e.defaultWidth,ct=r?.width?String(r.width):e.defaultWidth;T=e.values[ct]||e.values[K]}const $=e.argumentCallback?e.argumentCallback(t):t;return T[$]}}const k_t={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},T_t={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},S_t={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},C_t={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},A_t={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},M_t={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},E_t=(e,t)=>{const r=Number(e),u=r%100;if(u>20||u<10)switch(u%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},L_t={ordinalNumber:E_t,era:V3({values:k_t,defaultWidth:"wide"}),quarter:V3({values:T_t,defaultWidth:"wide",argumentCallback:e=>e-1}),month:V3({values:S_t,defaultWidth:"wide"}),day:V3({values:C_t,defaultWidth:"wide"}),dayPeriod:V3({values:A_t,defaultWidth:"wide",formattingValues:M_t,defaultFormattingWidth:"wide"})};function W3(e){return(t,r={})=>{const u=r.width,T=u&&e.matchPatterns[u]||e.matchPatterns[e.defaultMatchWidth],$=t.match(T);if(!$)return null;const K=$[0],ct=u&&e.parsePatterns[u]||e.parsePatterns[e.defaultParseWidth],yt=Array.isArray(ct)?I_t(ct,ne=>ne.test(K)):P_t(ct,ne=>ne.test(K));let St;St=e.valueCallback?e.valueCallback(yt):yt,St=r.valueCallback?r.valueCallback(St):St;const Ut=t.slice(K.length);return{value:St,rest:Ut}}}function P_t(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function I_t(e,t){for(let r=0;r{const u=t.match(e.matchPattern);if(!u)return null;const T=u[0],$=t.match(e.parsePattern);if(!$)return null;let K=e.valueCallback?e.valueCallback($[0]):$[0];K=r.valueCallback?r.valueCallback(K):K;const ct=t.slice(T.length);return{value:K,rest:ct}}}const z_t=/^(\d+)(th|st|nd|rd)?/i,O_t=/\d+/i,B_t={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},R_t={any:[/^b/i,/^(a|c)/i]},F_t={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},N_t={any:[/1/i,/2/i,/3/i,/4/i]},j_t={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},U_t={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$_t={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},H_t={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},V_t={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},W_t={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},q_t={ordinalNumber:D_t({matchPattern:z_t,parsePattern:O_t,valueCallback:e=>parseInt(e,10)}),era:W3({matchPatterns:B_t,defaultMatchWidth:"wide",parsePatterns:R_t,defaultParseWidth:"any"}),quarter:W3({matchPatterns:F_t,defaultMatchWidth:"wide",parsePatterns:N_t,defaultParseWidth:"any",valueCallback:e=>e+1}),month:W3({matchPatterns:j_t,defaultMatchWidth:"wide",parsePatterns:U_t,defaultParseWidth:"any"}),day:W3({matchPatterns:$_t,defaultMatchWidth:"wide",parsePatterns:H_t,defaultParseWidth:"any"}),dayPeriod:W3({matchPatterns:V_t,defaultMatchWidth:"any",parsePatterns:W_t,defaultParseWidth:"any"})},IH={code:"en-US",formatDistance:g_t,formatLong:x_t,formatRelative:w_t,localize:L_t,match:q_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function G_t(e,t){const r=Jc(e,t?.in);return SH(r,PH(r))+1}function DH(e,t){const r=Jc(e,t?.in),u=+q2(r)-+Wyt(r);return Math.round(u/kH)+1}function hL(e,t){const r=Jc(e,t?.in),u=r.getFullYear(),T=Gx(),$=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??T.firstWeekContainsDate??T.locale?.options?.firstWeekContainsDate??1,K=$f(t?.in||e,0);K.setFullYear(u+1,0,$),K.setHours(0,0,0,0);const ct=zv(K,t),yt=$f(t?.in||e,0);yt.setFullYear(u,0,$),yt.setHours(0,0,0,0);const St=zv(yt,t);return+r>=+ct?u+1:+r>=+St?u:u-1}function Z_t(e,t){const r=Gx(),u=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,T=hL(e,t),$=$f(t?.in||e,0);return $.setFullYear(T,0,u),$.setHours(0,0,0,0),zv($,t)}function zH(e,t){const r=Jc(e,t?.in),u=+zv(r,t)-+Z_t(r,t);return Math.round(u/kH)+1}function ld(e,t){const r=e<0?"-":"",u=Math.abs(e).toString().padStart(t,"0");return r+u}const Uy={y(e,t){const r=e.getFullYear(),u=r>0?r:1-r;return ld(t==="yy"?u%100:u,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):ld(r+1,2)},d(e,t){return ld(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ld(e.getHours()%12||12,t.length)},H(e,t){return ld(e.getHours(),t.length)},m(e,t){return ld(e.getMinutes(),t.length)},s(e,t){return ld(e.getSeconds(),t.length)},S(e,t){const r=t.length,u=e.getMilliseconds(),T=Math.trunc(u*Math.pow(10,r-3));return ld(T,t.length)}},v2={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},TF={G:function(e,t,r){const u=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(u,{width:"abbreviated"});case"GGGGG":return r.era(u,{width:"narrow"});case"GGGG":default:return r.era(u,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const u=e.getFullYear(),T=u>0?u:1-u;return r.ordinalNumber(T,{unit:"year"})}return Uy.y(e,t)},Y:function(e,t,r,u){const T=hL(e,u),$=T>0?T:1-T;if(t==="YY"){const K=$%100;return ld(K,2)}return t==="Yo"?r.ordinalNumber($,{unit:"year"}):ld($,t.length)},R:function(e,t){const r=TH(e);return ld(r,t.length)},u:function(e,t){const r=e.getFullYear();return ld(r,t.length)},Q:function(e,t,r){const u=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(u);case"QQ":return ld(u,2);case"Qo":return r.ordinalNumber(u,{unit:"quarter"});case"QQQ":return r.quarter(u,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(u,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(u,{width:"wide",context:"formatting"})}},q:function(e,t,r){const u=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(u);case"qq":return ld(u,2);case"qo":return r.ordinalNumber(u,{unit:"quarter"});case"qqq":return r.quarter(u,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(u,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(u,{width:"wide",context:"standalone"})}},M:function(e,t,r){const u=e.getMonth();switch(t){case"M":case"MM":return Uy.M(e,t);case"Mo":return r.ordinalNumber(u+1,{unit:"month"});case"MMM":return r.month(u,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(u,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(u,{width:"wide",context:"formatting"})}},L:function(e,t,r){const u=e.getMonth();switch(t){case"L":return String(u+1);case"LL":return ld(u+1,2);case"Lo":return r.ordinalNumber(u+1,{unit:"month"});case"LLL":return r.month(u,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(u,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(u,{width:"wide",context:"standalone"})}},w:function(e,t,r,u){const T=zH(e,u);return t==="wo"?r.ordinalNumber(T,{unit:"week"}):ld(T,t.length)},I:function(e,t,r){const u=DH(e);return t==="Io"?r.ordinalNumber(u,{unit:"week"}):ld(u,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Uy.d(e,t)},D:function(e,t,r){const u=G_t(e);return t==="Do"?r.ordinalNumber(u,{unit:"dayOfYear"}):ld(u,t.length)},E:function(e,t,r){const u=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(u,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(u,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(u,{width:"short",context:"formatting"});case"EEEE":default:return r.day(u,{width:"wide",context:"formatting"})}},e:function(e,t,r,u){const T=e.getDay(),$=(T-u.weekStartsOn+8)%7||7;switch(t){case"e":return String($);case"ee":return ld($,2);case"eo":return r.ordinalNumber($,{unit:"day"});case"eee":return r.day(T,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(T,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(T,{width:"short",context:"formatting"});case"eeee":default:return r.day(T,{width:"wide",context:"formatting"})}},c:function(e,t,r,u){const T=e.getDay(),$=(T-u.weekStartsOn+8)%7||7;switch(t){case"c":return String($);case"cc":return ld($,t.length);case"co":return r.ordinalNumber($,{unit:"day"});case"ccc":return r.day(T,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(T,{width:"narrow",context:"standalone"});case"cccccc":return r.day(T,{width:"short",context:"standalone"});case"cccc":default:return r.day(T,{width:"wide",context:"standalone"})}},i:function(e,t,r){const u=e.getDay(),T=u===0?7:u;switch(t){case"i":return String(T);case"ii":return ld(T,t.length);case"io":return r.ordinalNumber(T,{unit:"day"});case"iii":return r.day(u,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(u,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(u,{width:"short",context:"formatting"});case"iiii":default:return r.day(u,{width:"wide",context:"formatting"})}},a:function(e,t,r){const T=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(T,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(T,{width:"wide",context:"formatting"})}},b:function(e,t,r){const u=e.getHours();let T;switch(u===12?T=v2.noon:u===0?T=v2.midnight:T=u/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(T,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(T,{width:"wide",context:"formatting"})}},B:function(e,t,r){const u=e.getHours();let T;switch(u>=17?T=v2.evening:u>=12?T=v2.afternoon:u>=4?T=v2.morning:T=v2.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(T,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(T,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let u=e.getHours()%12;return u===0&&(u=12),r.ordinalNumber(u,{unit:"hour"})}return Uy.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Uy.H(e,t)},K:function(e,t,r){const u=e.getHours()%12;return t==="Ko"?r.ordinalNumber(u,{unit:"hour"}):ld(u,t.length)},k:function(e,t,r){let u=e.getHours();return u===0&&(u=24),t==="ko"?r.ordinalNumber(u,{unit:"hour"}):ld(u,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Uy.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Uy.s(e,t)},S:function(e,t){return Uy.S(e,t)},X:function(e,t,r){const u=e.getTimezoneOffset();if(u===0)return"Z";switch(t){case"X":return CF(u);case"XXXX":case"XX":return xx(u);case"XXXXX":case"XXX":default:return xx(u,":")}},x:function(e,t,r){const u=e.getTimezoneOffset();switch(t){case"x":return CF(u);case"xxxx":case"xx":return xx(u);case"xxxxx":case"xxx":default:return xx(u,":")}},O:function(e,t,r){const u=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+SF(u,":");case"OOOO":default:return"GMT"+xx(u,":")}},z:function(e,t,r){const u=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+SF(u,":");case"zzzz":default:return"GMT"+xx(u,":")}},t:function(e,t,r){const u=Math.trunc(+e/1e3);return ld(u,t.length)},T:function(e,t,r){return ld(+e,t.length)}};function SF(e,t=""){const r=e>0?"-":"+",u=Math.abs(e),T=Math.trunc(u/60),$=u%60;return $===0?r+String(T):r+String(T)+t+ld($,2)}function CF(e,t){return e%60===0?(e>0?"-":"+")+ld(Math.abs(e)/60,2):xx(e,t)}function xx(e,t=""){const r=e>0?"-":"+",u=Math.abs(e),T=ld(Math.trunc(u/60),2),$=ld(u%60,2);return r+T+t+$}const AF=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},OH=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},K_t=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],u=r[1],T=r[2];if(!T)return AF(e,t);let $;switch(u){case"P":$=t.dateTime({width:"short"});break;case"PP":$=t.dateTime({width:"medium"});break;case"PPP":$=t.dateTime({width:"long"});break;case"PPPP":default:$=t.dateTime({width:"full"});break}return $.replace("{{date}}",AF(u,t)).replace("{{time}}",OH(T,t))},m9={p:OH,P:K_t},Y_t=/^D+$/,X_t=/^Y+$/,J_t=["D","DD","YY","YYYY"];function BH(e){return Y_t.test(e)}function RH(e){return X_t.test(e)}function g9(e,t,r){const u=Q_t(e,t,r);if(console.warn(u),J_t.includes(e))throw new RangeError(u)}function Q_t(e,t,r){const u=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${u} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const txt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ext=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rxt=/^'([^]*?)'?$/,nxt=/''/g,ixt=/[a-zA-Z]/;function axt(e,t,r){const u=Gx(),T=r?.locale??u.locale??IH,$=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,K=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,ct=Jc(e,r?.in);if(!CH(ct))throw new RangeError("Invalid time value");let yt=t.match(ext).map(Ut=>{const ne=Ut[0];if(ne==="p"||ne==="P"){const pe=m9[ne];return pe(Ut,T.formatLong)}return Ut}).join("").match(txt).map(Ut=>{if(Ut==="''")return{isToken:!1,value:"'"};const ne=Ut[0];if(ne==="'")return{isToken:!1,value:oxt(Ut)};if(TF[ne])return{isToken:!0,value:Ut};if(ne.match(ixt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ne+"`");return{isToken:!1,value:Ut}});T.localize.preprocessor&&(yt=T.localize.preprocessor(ct,yt));const St={firstWeekContainsDate:$,weekStartsOn:K,locale:T};return yt.map(Ut=>{if(!Ut.isToken)return Ut.value;const ne=Ut.value;(!r?.useAdditionalWeekYearTokens&&RH(ne)||!r?.useAdditionalDayOfYearTokens&&BH(ne))&&g9(ne,t,String(e));const pe=TF[ne[0]];return pe(ct,ne,T.localize,St)}).join("")}function oxt(e){const t=e.match(rxt);return t?t[1].replace(nxt,"'"):e}function sxt(){return Object.assign({},Gx())}function lxt(e,t){const r=Jc(e,t?.in).getDay();return r===0?7:r}function cxt(e,t){const r=uxt(t)?new t(0):$f(t,0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}function uxt(e){return typeof e=="function"&&e.prototype?.constructor===e}const hxt=10;class FH{subPriority=0;validate(t,r){return!0}}class dxt extends FH{constructor(t,r,u,T,$){super(),this.value=t,this.validateValue=r,this.setValue=u,this.priority=T,$&&(this.subPriority=$)}validate(t,r){return this.validateValue(t,this.value,r)}set(t,r,u){return this.setValue(t,r,this.value,u)}}class fxt extends FH{priority=hxt;subPriority=-1;constructor(t,r){super(),this.context=t||(u=>$f(r,u))}set(t,r){return r.timestampIsSet?t:$f(t,cxt(t,this.context))}}class Nh{run(t,r,u,T){const $=this.parse(t,r,u,T);return $?{setter:new dxt($.value,this.validate,this.set,this.priority,this.subPriority),rest:$.rest}:null}validate(t,r,u){return!0}}class pxt extends Nh{priority=140;parse(t,r,u){switch(r){case"G":case"GG":case"GGG":return u.era(t,{width:"abbreviated"})||u.era(t,{width:"narrow"});case"GGGGG":return u.era(t,{width:"narrow"});case"GGGG":default:return u.era(t,{width:"wide"})||u.era(t,{width:"abbreviated"})||u.era(t,{width:"narrow"})}}set(t,r,u){return r.era=u,t.setFullYear(u,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const cp={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Tv={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function up(e,t){return e&&{value:t(e.value),rest:e.rest}}function Sf(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function Sv(e,t){const r=t.match(e);if(!r)return null;if(r[0]==="Z")return{value:0,rest:t.slice(1)};const u=r[1]==="+"?1:-1,T=r[2]?parseInt(r[2],10):0,$=r[3]?parseInt(r[3],10):0,K=r[5]?parseInt(r[5],10):0;return{value:u*(T*d4+$*h4+K*$yt),rest:t.slice(r[0].length)}}function NH(e){return Sf(cp.anyDigitsSigned,e)}function Hf(e,t){switch(e){case 1:return Sf(cp.singleDigit,t);case 2:return Sf(cp.twoDigits,t);case 3:return Sf(cp.threeDigits,t);case 4:return Sf(cp.fourDigits,t);default:return Sf(new RegExp("^\\d{1,"+e+"}"),t)}}function oS(e,t){switch(e){case 1:return Sf(cp.singleDigitSigned,t);case 2:return Sf(cp.twoDigitsSigned,t);case 3:return Sf(cp.threeDigitsSigned,t);case 4:return Sf(cp.fourDigitsSigned,t);default:return Sf(new RegExp("^-?\\d{1,"+e+"}"),t)}}function dL(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function jH(e,t){const r=t>0,u=r?t:1-t;let T;if(u<=50)T=e||100;else{const $=u+50,K=Math.trunc($/100)*100,ct=e>=$%100;T=e+K-(ct?100:0)}return r?T:1-T}function UH(e){return e%400===0||e%4===0&&e%100!==0}class mxt extends Nh{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,r,u){const T=$=>({year:$,isTwoDigitYear:r==="yy"});switch(r){case"y":return up(Hf(4,t),T);case"yo":return up(u.ordinalNumber(t,{unit:"year"}),T);default:return up(Hf(r.length,t),T)}}validate(t,r){return r.isTwoDigitYear||r.year>0}set(t,r,u){const T=t.getFullYear();if(u.isTwoDigitYear){const K=jH(u.year,T);return t.setFullYear(K,0,1),t.setHours(0,0,0,0),t}const $=!("era"in r)||r.era===1?u.year:1-u.year;return t.setFullYear($,0,1),t.setHours(0,0,0,0),t}}class gxt extends Nh{priority=130;parse(t,r,u){const T=$=>({year:$,isTwoDigitYear:r==="YY"});switch(r){case"Y":return up(Hf(4,t),T);case"Yo":return up(u.ordinalNumber(t,{unit:"year"}),T);default:return up(Hf(r.length,t),T)}}validate(t,r){return r.isTwoDigitYear||r.year>0}set(t,r,u,T){const $=hL(t,T);if(u.isTwoDigitYear){const ct=jH(u.year,$);return t.setFullYear(ct,0,T.firstWeekContainsDate),t.setHours(0,0,0,0),zv(t,T)}const K=!("era"in r)||r.era===1?u.year:1-u.year;return t.setFullYear(K,0,T.firstWeekContainsDate),t.setHours(0,0,0,0),zv(t,T)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class vxt extends Nh{priority=130;parse(t,r){return oS(r==="R"?4:r.length,t)}set(t,r,u){const T=$f(t,0);return T.setFullYear(u,0,4),T.setHours(0,0,0,0),q2(T)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class yxt extends Nh{priority=130;parse(t,r){return oS(r==="u"?4:r.length,t)}set(t,r,u){return t.setFullYear(u,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class _xt extends Nh{priority=120;parse(t,r,u){switch(r){case"Q":case"QQ":return Hf(r.length,t);case"Qo":return u.ordinalNumber(t,{unit:"quarter"});case"QQQ":return u.quarter(t,{width:"abbreviated",context:"formatting"})||u.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return u.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(t,{width:"wide",context:"formatting"})||u.quarter(t,{width:"abbreviated",context:"formatting"})||u.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=1&&r<=4}set(t,r,u){return t.setMonth((u-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class xxt extends Nh{priority=120;parse(t,r,u){switch(r){case"q":case"qq":return Hf(r.length,t);case"qo":return u.ordinalNumber(t,{unit:"quarter"});case"qqq":return u.quarter(t,{width:"abbreviated",context:"standalone"})||u.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return u.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(t,{width:"wide",context:"standalone"})||u.quarter(t,{width:"abbreviated",context:"standalone"})||u.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,r){return r>=1&&r<=4}set(t,r,u){return t.setMonth((u-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class bxt extends Nh{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,r,u){const T=$=>$-1;switch(r){case"M":return up(Sf(cp.month,t),T);case"MM":return up(Hf(2,t),T);case"Mo":return up(u.ordinalNumber(t,{unit:"month"}),T);case"MMM":return u.month(t,{width:"abbreviated",context:"formatting"})||u.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return u.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(t,{width:"wide",context:"formatting"})||u.month(t,{width:"abbreviated",context:"formatting"})||u.month(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=0&&r<=11}set(t,r,u){return t.setMonth(u,1),t.setHours(0,0,0,0),t}}class wxt extends Nh{priority=110;parse(t,r,u){const T=$=>$-1;switch(r){case"L":return up(Sf(cp.month,t),T);case"LL":return up(Hf(2,t),T);case"Lo":return up(u.ordinalNumber(t,{unit:"month"}),T);case"LLL":return u.month(t,{width:"abbreviated",context:"standalone"})||u.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return u.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(t,{width:"wide",context:"standalone"})||u.month(t,{width:"abbreviated",context:"standalone"})||u.month(t,{width:"narrow",context:"standalone"})}}validate(t,r){return r>=0&&r<=11}set(t,r,u){return t.setMonth(u,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function kxt(e,t,r){const u=Jc(e,r?.in),T=zH(u,r)-t;return u.setDate(u.getDate()-T*7),Jc(u,r?.in)}class Txt extends Nh{priority=100;parse(t,r,u){switch(r){case"w":return Sf(cp.week,t);case"wo":return u.ordinalNumber(t,{unit:"week"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=53}set(t,r,u,T){return zv(kxt(t,u,T),T)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Sxt(e,t,r){const u=Jc(e,r?.in),T=DH(u,r)-t;return u.setDate(u.getDate()-T*7),u}class Cxt extends Nh{priority=100;parse(t,r,u){switch(r){case"I":return Sf(cp.week,t);case"Io":return u.ordinalNumber(t,{unit:"week"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=53}set(t,r,u){return q2(Sxt(t,u))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Axt=[31,28,31,30,31,30,31,31,30,31,30,31],Mxt=[31,29,31,30,31,30,31,31,30,31,30,31];class Ext extends Nh{priority=90;subPriority=1;parse(t,r,u){switch(r){case"d":return Sf(cp.date,t);case"do":return u.ordinalNumber(t,{unit:"date"});default:return Hf(r.length,t)}}validate(t,r){const u=t.getFullYear(),T=UH(u),$=t.getMonth();return T?r>=1&&r<=Mxt[$]:r>=1&&r<=Axt[$]}set(t,r,u){return t.setDate(u),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Lxt extends Nh{priority=90;subpriority=1;parse(t,r,u){switch(r){case"D":case"DD":return Sf(cp.dayOfYear,t);case"Do":return u.ordinalNumber(t,{unit:"date"});default:return Hf(r.length,t)}}validate(t,r){const u=t.getFullYear();return UH(u)?r>=1&&r<=366:r>=1&&r<=365}set(t,r,u){return t.setMonth(0,u),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function fL(e,t,r){const u=Gx(),T=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,$=Jc(e,r?.in),K=$.getDay(),yt=(t%7+7)%7,St=7-T,Ut=t<0||t>6?t-(K+St)%7:(yt+St)%7-(K+St)%7;return KS($,Ut,r)}class Pxt extends Nh{priority=90;parse(t,r,u){switch(r){case"E":case"EE":case"EEE":return u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return u.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return u.day(t,{width:"wide",context:"formatting"})||u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=0&&r<=6}set(t,r,u,T){return t=fL(t,u,T),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class Ixt extends Nh{priority=90;parse(t,r,u,T){const $=K=>{const ct=Math.floor((K-1)/7)*7;return(K+T.weekStartsOn+6)%7+ct};switch(r){case"e":case"ee":return up(Hf(r.length,t),$);case"eo":return up(u.ordinalNumber(t,{unit:"day"}),$);case"eee":return u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"eeeee":return u.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return u.day(t,{width:"wide",context:"formatting"})||u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=0&&r<=6}set(t,r,u,T){return t=fL(t,u,T),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Dxt extends Nh{priority=90;parse(t,r,u,T){const $=K=>{const ct=Math.floor((K-1)/7)*7;return(K+T.weekStartsOn+6)%7+ct};switch(r){case"c":case"cc":return up(Hf(r.length,t),$);case"co":return up(u.ordinalNumber(t,{unit:"day"}),$);case"ccc":return u.day(t,{width:"abbreviated",context:"standalone"})||u.day(t,{width:"short",context:"standalone"})||u.day(t,{width:"narrow",context:"standalone"});case"ccccc":return u.day(t,{width:"narrow",context:"standalone"});case"cccccc":return u.day(t,{width:"short",context:"standalone"})||u.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return u.day(t,{width:"wide",context:"standalone"})||u.day(t,{width:"abbreviated",context:"standalone"})||u.day(t,{width:"short",context:"standalone"})||u.day(t,{width:"narrow",context:"standalone"})}}validate(t,r){return r>=0&&r<=6}set(t,r,u,T){return t=fL(t,u,T),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function zxt(e,t,r){const u=Jc(e,r?.in),T=lxt(u,r),$=t-T;return KS(u,$,r)}class Oxt extends Nh{priority=90;parse(t,r,u){const T=$=>$===0?7:$;switch(r){case"i":case"ii":return Hf(r.length,t);case"io":return u.ordinalNumber(t,{unit:"day"});case"iii":return up(u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"}),T);case"iiiii":return up(u.day(t,{width:"narrow",context:"formatting"}),T);case"iiiiii":return up(u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"}),T);case"iiii":default:return up(u.day(t,{width:"wide",context:"formatting"})||u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"}),T)}}validate(t,r){return r>=1&&r<=7}set(t,r,u){return t=zxt(t,u),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Bxt extends Nh{priority=80;parse(t,r,u){switch(r){case"a":case"aa":case"aaa":return u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return u.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(t,{width:"wide",context:"formatting"})||u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,r,u){return t.setHours(dL(u),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Rxt extends Nh{priority=80;parse(t,r,u){switch(r){case"b":case"bb":case"bbb":return u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return u.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(t,{width:"wide",context:"formatting"})||u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,r,u){return t.setHours(dL(u),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Fxt extends Nh{priority=80;parse(t,r,u){switch(r){case"B":case"BB":case"BBB":return u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return u.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(t,{width:"wide",context:"formatting"})||u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,r,u){return t.setHours(dL(u),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Nxt extends Nh{priority=70;parse(t,r,u){switch(r){case"h":return Sf(cp.hour12h,t);case"ho":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=12}set(t,r,u){const T=t.getHours()>=12;return T&&u<12?t.setHours(u+12,0,0,0):!T&&u===12?t.setHours(0,0,0,0):t.setHours(u,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class jxt extends Nh{priority=70;parse(t,r,u){switch(r){case"H":return Sf(cp.hour23h,t);case"Ho":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=23}set(t,r,u){return t.setHours(u,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Uxt extends Nh{priority=70;parse(t,r,u){switch(r){case"K":return Sf(cp.hour11h,t);case"Ko":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=11}set(t,r,u){return t.getHours()>=12&&u<12?t.setHours(u+12,0,0,0):t.setHours(u,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class $xt extends Nh{priority=70;parse(t,r,u){switch(r){case"k":return Sf(cp.hour24h,t);case"ko":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=24}set(t,r,u){const T=u<=24?u%24:u;return t.setHours(T,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Hxt extends Nh{priority=60;parse(t,r,u){switch(r){case"m":return Sf(cp.minute,t);case"mo":return u.ordinalNumber(t,{unit:"minute"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=59}set(t,r,u){return t.setMinutes(u,0,0),t}incompatibleTokens=["t","T"]}class Vxt extends Nh{priority=50;parse(t,r,u){switch(r){case"s":return Sf(cp.second,t);case"so":return u.ordinalNumber(t,{unit:"second"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=59}set(t,r,u){return t.setSeconds(u,0),t}incompatibleTokens=["t","T"]}class Wxt extends Nh{priority=30;parse(t,r){const u=T=>Math.trunc(T*Math.pow(10,-r.length+3));return up(Hf(r.length,t),u)}set(t,r,u){return t.setMilliseconds(u),t}incompatibleTokens=["t","T"]}class qxt extends Nh{priority=10;parse(t,r){switch(r){case"X":return Sv(Tv.basicOptionalMinutes,t);case"XX":return Sv(Tv.basic,t);case"XXXX":return Sv(Tv.basicOptionalSeconds,t);case"XXXXX":return Sv(Tv.extendedOptionalSeconds,t);case"XXX":default:return Sv(Tv.extended,t)}}set(t,r,u){return r.timestampIsSet?t:$f(t,t.getTime()-aS(t)-u)}incompatibleTokens=["t","T","x"]}class Gxt extends Nh{priority=10;parse(t,r){switch(r){case"x":return Sv(Tv.basicOptionalMinutes,t);case"xx":return Sv(Tv.basic,t);case"xxxx":return Sv(Tv.basicOptionalSeconds,t);case"xxxxx":return Sv(Tv.extendedOptionalSeconds,t);case"xxx":default:return Sv(Tv.extended,t)}}set(t,r,u){return r.timestampIsSet?t:$f(t,t.getTime()-aS(t)-u)}incompatibleTokens=["t","T","X"]}class Zxt extends Nh{priority=40;parse(t){return NH(t)}set(t,r,u){return[$f(t,u*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Kxt extends Nh{priority=20;parse(t){return NH(t)}set(t,r,u){return[$f(t,u),{timestampIsSet:!0}]}incompatibleTokens="*"}const Yxt={G:new pxt,y:new mxt,Y:new gxt,R:new vxt,u:new yxt,Q:new _xt,q:new xxt,M:new bxt,L:new wxt,w:new Txt,I:new Cxt,d:new Ext,D:new Lxt,E:new Pxt,e:new Ixt,c:new Dxt,i:new Oxt,a:new Bxt,b:new Rxt,B:new Fxt,h:new Nxt,H:new jxt,K:new Uxt,k:new $xt,m:new Hxt,s:new Vxt,S:new Wxt,X:new qxt,x:new Gxt,t:new Zxt,T:new Kxt},Xxt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jxt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qxt=/^'([^]*?)'?$/,tbt=/''/g,ebt=/\S/,rbt=/[a-zA-Z]/;function nbt(e,t,r,u){const T=()=>$f(u?.in||r,NaN),$=sxt(),K=u?.locale??$.locale??IH,ct=u?.firstWeekContainsDate??u?.locale?.options?.firstWeekContainsDate??$.firstWeekContainsDate??$.locale?.options?.firstWeekContainsDate??1,yt=u?.weekStartsOn??u?.locale?.options?.weekStartsOn??$.weekStartsOn??$.locale?.options?.weekStartsOn??0;if(!t)return e?T():Jc(r,u?.in);const St={firstWeekContainsDate:ct,weekStartsOn:yt,locale:K},Ut=[new fxt(u?.in,r)],ne=t.match(Jxt).map(Ve=>{const kr=Ve[0];if(kr in m9){const It=m9[kr];return It(Ve,K.formatLong)}return Ve}).join("").match(Xxt),pe=[];for(let Ve of ne){!u?.useAdditionalWeekYearTokens&&RH(Ve)&&g9(Ve,t,e),!u?.useAdditionalDayOfYearTokens&&BH(Ve)&&g9(Ve,t,e);const kr=Ve[0],It=Yxt[kr];if(It){const{incompatibleTokens:rn}=It;if(Array.isArray(rn)){const Mr=pe.find(tn=>rn.includes(tn.token)||tn.token===kr);if(Mr)throw new RangeError(`The format string mustn't contain \`${Mr.fullToken}\` and \`${Ve}\` at the same time`)}else if(It.incompatibleTokens==="*"&&pe.length>0)throw new RangeError(`The format string mustn't contain \`${Ve}\` and any other token at the same time`);pe.push({token:kr,fullToken:Ve});const Lr=It.run(e,Ve,K.match,St);if(!Lr)return T();Ut.push(Lr.setter),e=Lr.rest}else{if(kr.match(rbt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+kr+"`");if(Ve==="''"?Ve="'":kr==="'"&&(Ve=ibt(Ve)),e.indexOf(Ve)===0)e=e.slice(Ve.length);else return T()}}if(e.length>0&&ebt.test(e))return T();const me=Ut.map(Ve=>Ve.priority).sort((Ve,kr)=>kr-Ve).filter((Ve,kr,It)=>It.indexOf(Ve)===kr).map(Ve=>Ut.filter(kr=>kr.priority===Ve).sort((kr,It)=>It.subPriority-kr.subPriority)).map(Ve=>Ve[0]);let we=Jc(r,u?.in);if(isNaN(+we))return T();const Ce={};for(const Ve of me){if(!Ve.validate(we,St))return T();const kr=Ve.set(we,Ce,St);Array.isArray(kr)?(we=kr[0],Object.assign(Ce,kr[1])):we=kr}return we}function ibt(e){return e.match(Qxt)[1].replace(tbt,"'")}function abt(e,t){const r=Jc(e,t?.in);return r.setMinutes(0,0,0),r}function obt(e,t){const r=Jc(e,t?.in);return r.setSeconds(0,0),r}function sbt(e,t){const r=Jc(e,t?.in);return r.setMilliseconds(0),r}function lbt(e,t){const r=()=>$f(t?.in,NaN),u=t?.additionalDigits??2,T=dbt(e);let $;if(T.date){const St=fbt(T.date,u);$=pbt(St.restDateString,St.year)}if(!$||isNaN(+$))return r();const K=+$;let ct=0,yt;if(T.time&&(ct=mbt(T.time),isNaN(ct)))return r();if(T.timezone){if(yt=gbt(T.timezone),isNaN(yt))return r()}else{const St=new Date(K+ct),Ut=Jc(0,t?.in);return Ut.setFullYear(St.getUTCFullYear(),St.getUTCMonth(),St.getUTCDate()),Ut.setHours(St.getUTCHours(),St.getUTCMinutes(),St.getUTCSeconds(),St.getUTCMilliseconds()),Ut}return Jc(K+ct+yt,t?.in)}const rT={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},cbt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,ubt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,hbt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function dbt(e){const t={},r=e.split(rT.dateTimeDelimiter);let u;if(r.length>2)return t;if(/:/.test(r[0])?u=r[0]:(t.date=r[0],u=r[1],rT.timeZoneDelimiter.test(t.date)&&(t.date=e.split(rT.timeZoneDelimiter)[0],u=e.substr(t.date.length,e.length))),u){const T=rT.timezone.exec(u);T?(t.time=u.replace(T[1],""),t.timezone=T[1]):t.time=u}return t}function fbt(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),u=e.match(r);if(!u)return{year:NaN,restDateString:""};const T=u[1]?parseInt(u[1]):null,$=u[2]?parseInt(u[2]):null;return{year:$===null?T:$*100,restDateString:e.slice((u[1]||u[2]).length)}}function pbt(e,t){if(t===null)return new Date(NaN);const r=e.match(cbt);if(!r)return new Date(NaN);const u=!!r[4],T=q3(r[1]),$=q3(r[2])-1,K=q3(r[3]),ct=q3(r[4]),yt=q3(r[5])-1;if(u)return bbt(t,ct,yt)?vbt(t,ct,yt):new Date(NaN);{const St=new Date(0);return!_bt(t,$,K)||!xbt(t,T)?new Date(NaN):(St.setUTCFullYear(t,$,Math.max(T,K)),St)}}function q3(e){return e?parseInt(e):1}function mbt(e){const t=e.match(ubt);if(!t)return NaN;const r=Q7(t[1]),u=Q7(t[2]),T=Q7(t[3]);return wbt(r,u,T)?r*d4+u*h4+T*1e3:NaN}function Q7(e){return e&&parseFloat(e.replace(",","."))||0}function gbt(e){if(e==="Z")return 0;const t=e.match(hbt);if(!t)return 0;const r=t[1]==="+"?-1:1,u=parseInt(t[2]),T=t[3]&&parseInt(t[3])||0;return kbt(u,T)?r*(u*d4+T*h4):NaN}function vbt(e,t,r){const u=new Date(0);u.setUTCFullYear(e,0,4);const T=u.getUTCDay()||7,$=(t-1)*7+r+1-T;return u.setUTCDate(u.getUTCDate()+$),u}const ybt=[31,null,31,30,31,30,31,31,30,31,30,31];function $H(e){return e%400===0||e%4===0&&e%100!==0}function _bt(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(ybt[t]||($H(e)?29:28))}function xbt(e,t){return t>=1&&t<=($H(e)?366:365)}function bbt(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function wbt(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function kbt(e,t){return t>=0&&t<=59}/*! + `);yt.value.set(na.pubkey,Sn);const Hn=Sn.getElement();Hn&&(Hn.style.opacity="0",Hn.style.transition="opacity 0.5s ease-out"),ta(na,qi,Bi,Xa,Xi),setTimeout(()=>{Hn&&(Hn.style.opacity="1")},Xi+1e3),Xi+=100}})};if(pe.value&&u.adverts.length>0)try{const qi=Br(u.adverts);Vn(qi);const Bi=Math.min(14,ct.getZoom());ct.setZoom(Bi),setTimeout(()=>{try{va()}catch(Xi){console.warn("Error updating clusters:",Xi),_a(Sr,Dr)}},100),ct.on("moveend",()=>{try{va()}catch(Xi){console.warn("Error updating clusters on move:",Xi)}}),ct.on("zoomend",()=>{try{va()}catch(Xi){console.warn("Error updating clusters on zoom:",Xi)}})}catch(qi){console.warn("Error initializing clustering:",qi),_a(Sr,Dr)}else _a(Sr,Dr);setTimeout(()=>{ct&&ct.invalidateSize()},1e3)}catch(nn){console.error("Error initializing map:",nn)}};return t({highlightNode:Sr=>{const Dr=yt.value.get(Sr);if(Dr){const nn=Dr.getElement();if(nn){const Cn=nn.querySelector("div");Cn&&Cn.classList.add("marker-highlight")}}},unhighlightNode:Sr=>{const Dr=yt.value.get(Sr);if(Dr){const nn=Dr.getElement();if(nn){const Cn=nn.querySelector("div");Cn&&Cn.classList.remove("marker-highlight")}}},initializeOpenStreetMap:on}),Fh(()=>u.adverts,()=>{ct&&kr.value&&setTimeout(()=>{on()},100)},{immediate:!1}),Xd(()=>{Ve.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),kr.value&&u.adverts.length>0&&setTimeout(()=>{on()},300)}),Dv(()=>{Ve.disconnect(),Dn()}),(Sr,Dr)=>(Or(),Nr("div",i1t,[kr.value?(Or(),Nr("div",{key:1,ref_key:"mapContainer",ref:K,class:"leaflet-map-container h-96 w-full glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] overflow-hidden shadow-sm dark:shadow-none",style:{"min-height":"384px",position:"relative"}},null,512)):(Or(),Nr("div",a1t,Dr[0]||(Dr[0]=[Du('

No valid coordinates available

Configure base station location to view map

',1)]))),kr.value&&Sr.adverts.length>0?(Or(),Nr("button",{key:2,onClick:$,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[Dr[1]||(Dr[1]=At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),At("span",o1t,yn(Sr.showLegend?"Hide":"Show"),1)])):Ta("",!0),kr.value&&Sr.adverts.length>0&&Sr.showLegend?(Or(),Nr("div",s1t,[Dr[2]||(Dr[2]=Du('
Node Types
Base Station
Chat Node
Repeater
Room Server
Hybrid Node
Route Types
Direct
Transport Direct
Flood
Transport Flood
',2)),At("div",l1t,yn(Sr.adverts.length)+" node"+yn(Sr.adverts.length!==1?"s":"")+" visible ",1)])):Ta("",!0),kr.value?(Or(),Nr("div",c1t," © OpenStreetMap contributors © CARTO ")):Ta("",!0)]))}}),h1t=vh(u1t,[["__scopeId","data-v-a6a23e33"]]),d1t={class:"relative","data-menu-container":""},bF=Cc({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete"],setup(e,{emit:t}){const r=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:Ce=>{if(r.activeMenu&&r.activeMenu!==Ce)try{r.activeMenu.closeMenu()}catch(Ve){console.warn("Error closing previous menu:",Ve)}r.activeMenu=Ce}};window.__neighborMenuManager=r;const u=e,T=t,$=li(!1),K=li(),ct=li({top:0,left:0}),yt=()=>{$.value=!1,document.removeEventListener("click",pe,!0),document.removeEventListener("keydown",me),r.activeMenu===St&&(r.activeMenu=null)},St={closeMenu:yt},Ut=()=>{yt(),T("ping",u.neighbor)},ne=()=>{yt(),T("delete",u.neighbor)},pe=Ce=>{Ce.target.closest("[data-menu-container]")||yt()},me=Ce=>{Ce.key==="Escape"&&yt()},we=async()=>{if(!$.value&&K.value){r.setActiveMenu(St);const Ce=K.value.getBoundingClientRect(),Ve=window.innerWidth,kr=144,It=Ve<1024,rn=Ce.left+kr>Ve-16;let Lr=Ce.left;It&&rn&&(Lr=Ce.right-kr),Lr=Math.max(8,Lr),ct.value={top:Ce.bottom+4,left:Lr},$.value=!0,await sp(),document.addEventListener("click",pe,!0),document.addEventListener("keydown",me)}else yt()};return Dv(()=>{yt()}),(Ce,Ve)=>(Or(),Nr("div",d1t,[At("button",{ref_key:"buttonRef",ref:K,onClick:we,class:ja(["p-1 rounded hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary/80",{"bg-background-mute dark:bg-stroke/10 text-content-primary dark:text-content-primary/80":$.value}]),"data-menu-container":""},Ve[0]||(Ve[0]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(Or(),w0(CS,{to:"body"},[$.value?(Or(),Nr("div",{key:0,class:"fixed w-36 bg-white dark:bg-surface-elevated backdrop-blur-lg border border-stroke-subtle dark:border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:Sp({top:ct.value.top+"px",left:ct.value.left+"px"}),"data-menu-container":""},[At("div",{class:"py-2"},[At("button",{onClick:Ut,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-content-primary dark:text-content-primary hover:bg-primary/10 transition-colors border-b border-stroke-subtle dark:border-white/10"},Ve[1]||(Ve[1]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})],-1),At("span",{class:"font-medium"},"Ping",-1)])),At("button",{onClick:ne,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},Ve[2]||(Ve[2]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),At("span",{class:"font-medium"},"Delete",-1)]))])],4)):Ta("",!0)]))]))}}),f1t={class:"glass-card/30 backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[12px] p-6 shadow-sm dark:shadow-none"},p1t={class:"flex items-center justify-between mb-4"},m1t={class:"flex items-center gap-3"},g1t={class:"text-content-primary dark:text-content-primary text-lg font-semibold"},v1t={class:"bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary text-xs px-2 py-1 rounded-full"},y1t={key:0,class:"text-content-muted dark:text-content-muted"},_1t={key:0,class:"hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 p-1"},x1t={class:"hidden lg:block overflow-x-auto"},b1t={class:"w-full"},w1t={class:"bg-background-mute dark:bg-transparent"},k1t={class:"bg-surface/50 dark:bg-transparent"},T1t=["onMouseenter","onMouseleave"],S1t=["onClick","title"],C1t={key:0,class:"ml-1 text-xs"},A1t={key:0,class:"flex items-center gap-3"},M1t={class:"text-content-secondary dark:text-content-muted"},E1t={class:"flex gap-1"},L1t=["onClick"],P1t=["onClick"],I1t={key:1,class:"text-content-muted"},D1t={class:"flex items-center gap-2"},z1t={class:"flex items-end gap-0.5"},O1t={class:"flex items-center gap-2"},B1t=["title"],R1t=["title"],F1t={class:"lg:hidden space-y-3"},N1t=["onClick"],j1t={class:"flex items-center justify-between mb-3"},U1t={class:"flex items-center gap-3"},$1t={class:"text-content-primary dark:text-content-primary font-medium text-base"},H1t={class:"flex items-center gap-2"},V1t={class:"grid grid-cols-1 gap-3"},W1t={class:"grid grid-cols-2 gap-4"},q1t=["onClick","title"],G1t={key:0,class:"ml-1 text-xs"},Z1t={class:"flex items-center gap-2 justify-end"},K1t={class:"flex items-end gap-0.5"},Y1t={class:"grid grid-cols-2 gap-4"},X1t={class:"flex items-center gap-2"},J1t=["title"],Q1t={class:"text-content-primary dark:text-content-primary text-sm block text-right"},tyt={key:0,class:"border-t border-white/10 pt-3"},eyt={class:"flex items-center justify-between"},ryt={class:"text-content-secondary dark:text-content-muted text-sm font-mono"},nyt={class:"flex gap-2"},iyt=["onClick"],ayt=["onClick"],oyt={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},syt={class:"text-center"},lyt={class:"text-content-primary dark:text-content-primary text-sm font-medium"},cyt={class:"text-center"},uyt={class:"text-content-primary dark:text-content-primary text-sm font-medium"},hyt={class:"text-center"},dyt=["title"],fyt=Cc({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},originalCount:{default:0},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","toggle-view"],setup(e,{emit:t}){const r=li(null),u=e,T=t,$=Br=>new Date(Br*1e3).toLocaleString(),K=Br=>`${Br.slice(0,4)}...${Br.slice(-4)}`,ct=Br=>{switch(Br){case 2:return{text:"Direct",bgColor:"bg-green-100 dark:bg-green-500/20",borderColor:"border-green-500 dark:border-green-400/30",textColor:"text-green-600 dark:text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-100 dark:bg-green-600/20",borderColor:"border-green-600/40 dark:border-green-500/30",textColor:"text-green-700 dark:text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-100 dark:bg-yellow-500/20",borderColor:"border-yellow-500 dark:border-yellow-400/30",textColor:"text-yellow-600 dark:text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-100 dark:bg-orange-500/20",borderColor:"border-orange-500 dark:border-orange-400/30",textColor:"text-orange-600 dark:text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},yt=Br=>Br?`${Br} dBm`:"N/A",St=Br=>Br?`${Br} dB`:"N/A",Ut=(Br,Vn,on,pr)=>{const Sr=(on-Br)*Math.PI/180,Dr=(pr-Vn)*Math.PI/180,nn=Math.sin(Sr/2)*Math.sin(Sr/2)+Math.cos(Br*Math.PI/180)*Math.cos(on*Math.PI/180)*Math.sin(Dr/2)*Math.sin(Dr/2);return 6371*(2*Math.atan2(Math.sqrt(nn),Math.sqrt(1-nn)))},ne=Br=>u.baseLatitude===null||u.baseLongitude===null||Br.latitude===null||Br.longitude===null?"N/A":`${Ut(u.baseLatitude,u.baseLongitude,Br.latitude,Br.longitude).toFixed(1)} km`,pe=async Br=>{try{return await navigator.clipboard.writeText(Br),!0}catch{const Vn=document.createElement("textarea");return Vn.value=Br,document.body.appendChild(Vn),Vn.select(),document.execCommand("copy"),document.body.removeChild(Vn),!0}},me=Br=>{const Vn=Date.now(),on=Br*1e3,pr=Vn-on,_r=Math.floor(pr/1e3),Sr=Math.floor(_r/60),Dr=Math.floor(Sr/60),nn=Math.floor(Dr/24);return _r<60?`${_r}s ago`:Sr<60?`${Sr}m ago`:Dr<24?`${Dr}h ago`:`${nn}d ago`},we=Br=>{const Vn=Date.now(),on=Br*1e3,pr=Vn-on,_r=Math.floor(pr/(1e3*60*60));return _r<1?{color:"text-green-600 dark:text-green-400"}:_r<26?{color:"text-yellow-600 dark:text-yellow-400"}:{color:"text-red-600 dark:text-red-400"}},Ce=async(Br,Vn)=>{const on=`${Br.toFixed(6)}, ${Vn.toFixed(6)}`;await pe(on)},Ve=(Br,Vn)=>{const on=`https://www.google.com/maps?q=${Br},${Vn}`;window.open(on,"_blank")},kr=async Br=>{await pe(Br),r.value=Br,setTimeout(()=>{r.value=null},2e3)},It=Br=>Br?Br>=-50?{bars:5,color:"text-green-600 dark:text-green-400"}:Br>=-60?{bars:4,color:"text-green-600 dark:text-green-300"}:Br>=-70?{bars:3,color:"text-yellow-600 dark:text-yellow-400"}:Br>=-80?{bars:2,color:"text-orange-600 dark:text-orange-400"}:Br>=-90?{bars:1,color:"text-red-600 dark:text-red-400"}:{bars:0,color:"text-red-600 dark:text-red-500"}:{bars:0,color:"text-gray-400"},rn=()=>u.isCompactView?"py-2 px-2":"py-4 px-3",Lr=()=>{T("toggle-view")},Mr=Br=>{T("highlight-node",Br)},tn=Br=>{T("unhighlight-node",Br)},Dn=Br=>{T("menu-ping",Br)},Mn=Br=>{T("menu-delete",Br)};return(Br,Vn)=>(Or(),Nr("div",f1t,[At("div",p1t,[At("div",m1t,[At("div",{class:"w-3 h-3 rounded-full border border-white/20",style:Sp({backgroundColor:Br.color})},null,4),At("h3",g1t,yn(Br.contactType),1),At("span",v1t,[cl(yn(Br.adverts.length)+" ",1),Br.originalCount>0&&Br.adverts.length(Or(),Nr("tr",{key:on.id,class:"hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors",onMouseenter:pr=>Mr(on.pubkey),onMouseleave:pr=>tn(on.pubkey)},[At("td",{class:ja(rn())},[Vs(bF,{neighbor:on,onPing:Dn,onDelete:Mn},null,8,["neighbor"])],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},yn(on.node_name||"Unknown"),3),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm font-mono`)},[At("button",{onClick:pr=>kr(on.pubkey),class:ja(["text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60",r.value===on.pubkey?"text-green-600 dark:text-green-400 decoration-green-400/60":""]),title:r.value===on.pubkey?"Copied!":"Click to copy full public key"},[cl(yn(K(on.pubkey))+" ",1),r.value===on.pubkey?(Or(),Nr("span",C1t,"✓")):Ta("",!0)],10,S1t)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[on.latitude!==null&&on.longitude!==null?(Or(),Nr("div",A1t,[At("span",M1t,yn(on.latitude.toFixed(4))+", "+yn(on.longitude.toFixed(4)),1),At("div",E1t,[At("button",{onClick:pr=>Ce(on.latitude,on.longitude),class:"text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},Vn[2]||(Vn[2]=[At("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),At("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,L1t),At("button",{onClick:pr=>Ve(on.latitude,on.longitude),class:"text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},Vn[3]||(Vn[3]=[At("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),At("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,P1t)])])):(Or(),Nr("span",I1t,"Unknown"))],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},yn(ne(on)),3),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",ct(on.route_type).bgColor,ct(on.route_type).borderColor,ct(on.route_type).textColor])},yn(ct(on.route_type).text),3)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",on.zero_hop?"bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400":"bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400"])},yn(on.zero_hop?"Zero Hop":"Multi-Hop"),3)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("div",D1t,[At("div",z1t,[(Or(),Nr(Es,null,jl(5,pr=>At("div",{key:pr,class:ja(["w-1 transition-colors",pr<=It(on.rssi).bars?It(on.rssi).color:"text-gray-600"]),style:Sp({height:`${4+pr*2}px`})},Vn[4]||(Vn[4]=[At("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),At("span",{class:ja(It(on.rssi).color)},yn(yt(on.rssi)),3)])],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},yn(St(on.snr)),3),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("div",O1t,[At("div",{class:ja(["w-2 h-2 rounded-full",we(on.last_seen).color==="text-green-600 dark:text-green-400"?"bg-green-400":"",we(on.last_seen).color==="text-yellow-600 dark:text-yellow-400"?"bg-yellow-400":"",we(on.last_seen).color==="text-red-600 dark:text-red-400"?"bg-red-400":""])},null,2),At("span",{class:ja([we(on.last_seen).color,"cursor-help"]),title:$(on.last_seen)},yn(me(on.last_seen)),11,B1t)])],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm`)},[At("span",{title:$(on.first_seen),class:"cursor-help"},yn(me(on.first_seen)),9,R1t)],2),At("td",{class:ja(`${rn()} text-content-primary dark:text-content-primary text-sm text-center`)},yn(on.advert_count),3)],40,T1t))),128))])])]),At("div",F1t,[(Or(!0),Nr(Es,null,jl(Br.adverts,on=>(Or(),Nr("div",{key:on.id,class:"bg-surface/50 dark:bg-transparent border border-stroke-subtle dark:border-white/10 rounded-lg p-4 hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors",onClick:pr=>Mr(on.pubkey)},[At("div",j1t,[At("div",U1t,[At("h4",$1t,yn(on.node_name||"Unknown Node"),1),At("div",H1t,[At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border",ct(on.route_type).bgColor,ct(on.route_type).borderColor,ct(on.route_type).textColor])},yn(ct(on.route_type).text),3),At("span",{class:ja(["inline-block px-2 py-1 rounded-full text-xs border",on.zero_hop?"bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400":"bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400"])},yn(on.zero_hop?"Zero Hop":"Multi-Hop"),3)])]),Vs(bF,{neighbor:on,onPing:Dn,onDelete:Mn},null,8,["neighbor"])]),At("div",V1t,[At("div",W1t,[At("div",null,[Vn[5]||(Vn[5]=At("div",{class:"text-content-muted text-xs mb-1"},"Public Key",-1)),At("button",{onClick:pr=>kr(on.pubkey),class:ja(["text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60 break-all",r.value===on.pubkey?"text-green-600 dark:text-green-400 decoration-green-400/60":""]),title:r.value===on.pubkey?"Copied!":"Click to copy full public key"},[cl(yn(K(on.pubkey))+" ",1),r.value===on.pubkey?(Or(),Nr("span",G1t,"✓")):Ta("",!0)],10,q1t)]),At("div",null,[Vn[7]||(Vn[7]=At("div",{class:"text-content-muted text-xs mb-1"},"Signal",-1)),At("div",Z1t,[At("div",K1t,[(Or(),Nr(Es,null,jl(5,pr=>At("div",{key:pr,class:ja(["w-1.5 transition-colors",pr<=It(on.rssi).bars?It(on.rssi).color:"text-gray-600"]),style:Sp({height:`${6+pr*2}px`})},Vn[6]||(Vn[6]=[At("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),At("span",{class:ja(`${It(on.rssi).color} text-sm font-medium`)},yn(yt(on.rssi)),3)])])]),At("div",Y1t,[At("div",null,[Vn[8]||(Vn[8]=At("div",{class:"text-content-muted text-xs mb-1"},"Last Seen",-1)),At("div",X1t,[At("div",{class:ja(["w-2 h-2 rounded-full",we(on.last_seen).color==="text-green-600 dark:text-green-400"?"bg-green-400":"",we(on.last_seen).color==="text-yellow-600 dark:text-yellow-400"?"bg-yellow-400":"",we(on.last_seen).color==="text-red-600 dark:text-red-400"?"bg-red-400":""])},null,2),At("span",{class:ja(`${we(on.last_seen).color} text-sm`),title:$(on.last_seen)},yn(me(on.last_seen)),11,J1t)])]),At("div",null,[Vn[9]||(Vn[9]=At("div",{class:"text-content-muted text-xs mb-1"},"Distance",-1)),At("span",Q1t,yn(ne(on)),1)])]),on.latitude!==null&&on.longitude!==null?(Or(),Nr("div",tyt,[Vn[12]||(Vn[12]=At("div",{class:"text-content-muted text-xs mb-1"},"Location",-1)),At("div",eyt,[At("span",ryt,yn(on.latitude.toFixed(4))+", "+yn(on.longitude.toFixed(4)),1),At("div",nyt,[At("button",{onClick:pr=>Ce(on.latitude,on.longitude),class:"text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg",title:"Copy coordinates"},Vn[10]||(Vn[10]=[At("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),At("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,iyt),At("button",{onClick:pr=>Ve(on.latitude,on.longitude),class:"text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},Vn[11]||(Vn[11]=[At("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),At("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,ayt)])])])):Ta("",!0),At("div",oyt,[At("div",syt,[Vn[13]||(Vn[13]=At("div",{class:"text-content-muted text-xs mb-1"},"SNR",-1)),At("span",lyt,yn(St(on.snr)),1)]),At("div",cyt,[Vn[14]||(Vn[14]=At("div",{class:"text-content-muted text-xs mb-1"},"Adverts",-1)),At("span",uyt,yn(on.advert_count),1)]),At("div",hyt,[Vn[15]||(Vn[15]=At("div",{class:"text-content-muted text-xs mb-1"},"First Seen",-1)),At("span",{class:"text-content-primary dark:text-content-primary text-sm",title:$(on.first_seen)},yn(me(on.first_seen)),9,dyt)])])])],8,N1t))),128))])]))}}),pyt={class:"space-y-6"},myt={key:0,class:"flex items-center justify-center py-12"},gyt={key:1,class:"bg-red-50 dark:bg-accent-red/10 border border-red-300 dark:border-accent-red/20 rounded-[15px] p-6"},vyt={class:"flex items-center gap-3"},yyt={class:"text-red-500 dark:text-accent-red/80 text-sm"},_yt={key:0,class:""},xyt={class:"flex items-center justify-between"},byt={class:"flex items-center gap-3"},wyt={class:"hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 mb p-1"},kyt={class:"flex items-center gap-2"},Tyt={key:0,class:"ml-1 bg-accent-blue/20 text-accent-blue border border-accent-blue/30 text-xs px-1.5 py-0.5 rounded-full font-medium"},Syt={class:"bg-background dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mt-4 space-y-4"},Cyt={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Ayt={key:1,class:"text-center py-12"},Myt={key:2,class:"text-center py-12"},Eyt=Cc({name:"NeighborsView",__name:"Neighbors",setup(e){const t=Ym(),r={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},u={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},T=li({}),$=li(!0),K=li(null),ct=li(B1("neighbors_compactView",!1)),yt=li(B1("neighbors_showMapLegend",typeof window<"u"?window.innerWidth>=1024:!0)),St=li(B1("neighbors_showFilters",!1)),Ut=li(B1("neighbors_filters",{zeroHop:"all",routeType:"all",searchText:""}));Fh(ct,va=>R1("neighbors_compactView",va)),Fh(yt,va=>R1("neighbors_showMapLegend",va)),Fh(St,va=>R1("neighbors_showFilters",va)),Fh(Ut,va=>R1("neighbors_filters",va),{deep:!0});const ne=li(!1),pe=li(!1),me=li(!1),we=li(null),Ce=li(null),Ve=li(null),kr=li(null),It=Ao(()=>{if(!kr.value)return null;const va=kr.value;return{id:va.id,pubkey:va.pubkey,node_name:va.node_name,contact_type:va.contact_type,latitude:va.latitude,longitude:va.longitude,rssi:va.rssi,snr:va.snr,route_type:va.route_type,last_seen:va.last_seen,first_seen:va.first_seen,advert_count:va.advert_count,timestamp:va.timestamp,is_repeater:va.is_repeater,is_new_neighbor:va.is_new_neighbor,zero_hop:va.zero_hop}}),rn=Ao(()=>t.stats?.config?.repeater?.latitude),Lr=Ao(()=>t.stats?.config?.repeater?.longitude),Mr=va=>va.filter(_a=>{if(Ut.value.zeroHop!=="all"){const qi=_a.zero_hop;if(Ut.value.zeroHop==="true"&&!qi||Ut.value.zeroHop==="false"&&qi)return!1}if(Ut.value.routeType!=="all"){const qi=_a.route_type;if(Ut.value.routeType==="direct"&&qi!==2||Ut.value.routeType==="transport_direct"&&qi!==3||Ut.value.routeType==="flood"&&qi!==1||Ut.value.routeType==="transport_flood"&&qi!==0)return!1}if(Ut.value.searchText){const qi=Ut.value.searchText.toLowerCase(),Bi=_a.node_name?.toLowerCase()||"",Xi=_a.pubkey.toLowerCase();if(!Bi.includes(qi)&&!Xi.includes(qi))return!1}return!0}),tn=()=>{Ut.value={zeroHop:"all",routeType:"all",searchText:""}},Dn=Ao(()=>Ut.value.zeroHop!=="all"||Ut.value.routeType!=="all"||Ut.value.searchText!==""),Mn=Ao(()=>{const va={};for(const[_a,qi]of Object.entries(T.value))va[_a]=Mr(qi);return va}),Br=Ao(()=>Object.entries(r).filter(([va])=>Mn.value[va]?.length>0).sort(([va],[_a])=>parseInt(va)-parseInt(_a))),Vn=Ao(()=>Object.values(T.value).flat().filter(va=>{const _a=va.latitude,qi=va.longitude;return _a!=null&&_a!==0&&qi!==null&&qi!==void 0&&qi!==0&&typeof _a=="number"&&typeof qi=="number"&&!isNaN(_a)&&!isNaN(qi)&&va.zero_hop===!0})),on=async va=>{try{const _a=await bs.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(va)}&hours=168`);return _a.success&&Array.isArray(_a.data)?_a.data:[]}catch(_a){return console.error(`Error fetching adverts for contact type ${va}:`,_a),[]}},pr=async()=>{$.value=!0,K.value=null;try{T.value={};for(const[va,_a]of Object.entries(r)){const qi=await on(_a);qi.length>0&&(T.value[va]=qi)}}catch(va){console.error("Error loading adverts:",va),K.value=va instanceof Error?va.message:"Failed to load neighbor data"}finally{$.value=!1}},_r=li(),Sr=va=>{_r.value?.highlightNode(va)},Dr=va=>{_r.value?.unhighlightNode(va)},nn=async va=>{const _a=va;we.value=null,Ce.value=null,me.value=!0,Ve.value=_a.node_name||"Unknown Node",pe.value=!0;try{const Bi=`0x${parseInt(_a.pubkey.substring(0,2),16).toString(16).padStart(2,"0")}`;console.log(`Pinging neighbor ${_a.node_name||"Unknown"} (${Bi})...`);const Xi=await bs.pingNeighbor(Bi,10);Xi.success&&Xi.data?(we.value=Xi.data,console.log("Ping successful:",Xi.data)):(Ce.value=Xi.error||"Unknown error occurred",console.error("Failed to ping neighbor:",Xi.error))}catch(qi){console.error("Error pinging neighbor:",qi),Ce.value=qi instanceof Error?qi.message:"Unknown error occurred"}finally{me.value=!1}},Cn=()=>{pe.value=!1,we.value=null,Ce.value=null,Ve.value=null},Xn=va=>{kr.value=va,ne.value=!0},_i=()=>{ne.value=!1,kr.value=null},ta=async va=>{try{await bs.deleteAdvert(va),await pr(),_i()}catch(_a){console.error("Error deleting neighbor:",_a)}};return Xd(async()=>{await pr()}),(va,_a)=>(Or(),Nr("div",pyt,[$.value?(Or(),Nr("div",myt,_a[7]||(_a[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),At("p",{class:"text-content-secondary dark:text-content-muted"},"Loading neighbor data...")],-1)]))):K.value?(Or(),Nr("div",gyt,[At("div",vyt,[_a[9]||(_a[9]=At("svg",{class:"w-5 h-5 text-red-600 dark:text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),At("div",null,[_a[8]||(_a[8]=At("h3",{class:"text-red-600 dark:text-accent-red font-medium"},"Error Loading Neighbors",-1)),At("p",yyt,yn(K.value),1)])])])):(Or(),Nr(Es,{key:2},[Vs(h1t,{ref_key:"networkMapRef",ref:_r,adverts:Vn.value,"base-latitude":rn.value,"base-longitude":Lr.value,"show-legend":yt.value,"onUpdate:showLegend":_a[0]||(_a[0]=qi=>yt.value=qi)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),Object.keys(T.value).length>0?(Or(),Nr("div",_yt,[At("div",xyt,[_a[14]||(_a[14]=At("span",{class:"text-content-primary dark:text-content-primary text-lg font-semibold"},null,-1)),At("div",byt,[At("div",wyt,[At("button",{onClick:_a[1]||(_a[1]=qi=>ct.value=!1),class:ja(["p-2 rounded-md transition-colors",ct.value?"text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},_a[10]||(_a[10]=[At("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),At("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),At("button",{onClick:_a[2]||(_a[2]=qi=>ct.value=!0),class:ja(["p-2 rounded-md transition-colors",ct.value?"bg-primary/20 text-primary border border-primary/30":"text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10"]),title:"Compact view"},_a[11]||(_a[11]=[At("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),At("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),At("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)]),At("div",kyt,[At("button",{onClick:_a[3]||(_a[3]=qi=>St.value=!St.value),class:ja(["px-3 py-1.5 text-xs rounded-lg transition-colors border",Dn.value?"bg-primary/20 text-primary border-primary/30":"bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20"])},[_a[12]||(_a[12]=At("svg",{class:"w-4 h-4 inline mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z"})],-1)),_a[13]||(_a[13]=cl(" Filters ",-1)),Dn.value?(Or(),Nr("span",Tyt," Active ")):Ta("",!0)],2),Dn.value?(Or(),Nr("button",{key:0,onClick:tn,class:"px-3 py-1.5 text-xs rounded-lg bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors"}," Clear Filters ")):Ta("",!0)])])]),Ml(At("div",Syt,[At("div",Cyt,[At("div",null,[_a[16]||(_a[16]=At("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Zero Hop",-1)),Ml(At("select",{"onUpdate:modelValue":_a[4]||(_a[4]=qi=>Ut.value.zeroHop=qi),class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none"},_a[15]||(_a[15]=[At("option",{value:"all"},"All Nodes",-1),At("option",{value:"true"},"Zero Hop Only",-1),At("option",{value:"false"},"Multi-Hop Only",-1)]),512),[[xg,Ut.value.zeroHop]])]),At("div",null,[_a[18]||(_a[18]=At("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Route Type",-1)),Ml(At("select",{"onUpdate:modelValue":_a[5]||(_a[5]=qi=>Ut.value.routeType=qi),class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none"},_a[17]||(_a[17]=[Du('',5)]),512),[[xg,Ut.value.routeType]])]),At("div",null,[_a[19]||(_a[19]=At("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Search",-1)),Ml(At("input",{"onUpdate:modelValue":_a[6]||(_a[6]=qi=>Ut.value.searchText=qi),type:"text",placeholder:"Node name or pubkey...",class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none placeholder-gray-400 dark:placeholder-white/40"},null,512),[[lu,Ut.value.searchText]])])])],512),[[Zy,St.value]])])):Ta("",!0),(Or(!0),Nr(Es,null,jl(Br.value,([qi,Bi])=>(Or(),Nr("div",{key:qi,class:"space-y-6"},[Vs(fyt,{"contact-type":Bi,"contact-type-key":qi,adverts:Mn.value[qi],"original-count":T.value[qi]?.length||0,color:u[parseInt(qi)],"base-latitude":rn.value,"base-longitude":Lr.value,"is-compact-view":ct.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:Sr,onUnhighlightNode:Dr,onMenuPing:nn,onMenuDelete:Xn},null,8,["contact-type","contact-type-key","adverts","original-count","color","base-latitude","base-longitude","is-compact-view"])]))),128)),Br.value.length===0&&Object.keys(T.value).length===0?(Or(),Nr("div",Ayt,[_a[20]||(_a[20]=Du('

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

',3)),At("button",{onClick:pr,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):Br.value.length===0&&Dn.value?(Or(),Nr("div",Myt,[_a[21]||(_a[21]=Du('

No neighbors match your filters

Try adjusting your filter criteria to see more results.

',3)),At("button",{onClick:tn,class:"px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Clear Filters ")])):Ta("",!0)],64)),Vs(yvt,{show:ne.value,neighbor:It.value,onClose:_i,onDelete:ta},null,8,["show","neighbor"]),Vs(Yvt,{show:pe.value,"node-name":Ve.value,result:we.value,error:Ce.value,loading:me.value,onClose:Cn},null,8,["show","node-name","result","error","loading"])]))}}),Lyt={class:"sparkline-card"},Pyt={class:"card-header"},Iyt={class:"card-title"},Dyt={key:0,class:"card-subtitle"},zyt={key:0,class:"card-chart"},Oyt={key:0,class:"chart-loader"},Byt={key:1,class:"chart-text"},Ryt={class:"percent-value"},Fyt=["id","viewBox"],Nyt=["d","fill"],jyt=["d","stroke"],tT=100,eT=40,Uyt=Cc({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},variant:{default:"smooth"},loading:{type:Boolean,default:!1},centerText:{default:""},subtitle:{default:""}},setup(e){const t=e,r=yt=>{if(yt.length<3)return yt;const St=Math.min(15,Math.max(3,Math.floor(yt.length*.2))),Ut=[];for(let we=0;wern+Lr,0)/It.length)}const ne=Math.min(10,Ut.length),pe=Ut.length/ne,me=[];for(let we=0;we!t.data||t.data.length===0?[]:t.variant==="smooth"?r(t.data):t.data),T=yt=>{if(yt.length<2)return"";const St=Math.max(...yt),Ut=Math.min(...yt),ne=St-Ut||1,pe=t.variant==="classic"?4:2;let me="";return yt.forEach((we,Ce)=>{const Ve=Ce/(yt.length-1)*tT,kr=(we-Ut)/ne,It=pe+(eT-pe*2)*(1-kr);if(Ce===0)me+=`M ${Ve.toFixed(2)} ${It.toFixed(2)}`;else{const Lr=((Ce-1)/(yt.length-1)*tT+Ve)/2;me+=` Q ${Lr.toFixed(2)} ${It.toFixed(2)} ${Ve.toFixed(2)} ${It.toFixed(2)}`}}),me},$=Ao(()=>T(u.value)),K=Ao(()=>$.value?`${$.value} L ${tT} ${eT} L 0 ${eT} Z`:""),ct=Ao(()=>`sparkline-${t.title.replace(/\s+/g,"-").toLowerCase()}`);return(yt,St)=>(Or(),Nr("div",Lyt,[At("div",Pyt,[At("div",null,[At("p",Iyt,yn(yt.title),1),yt.subtitle?(Or(),Nr("p",Dyt,yn(yt.subtitle),1)):Ta("",!0)]),At("span",{class:"card-value",style:Sp({color:yt.color})},yn(typeof yt.value=="number"?yt.value.toLocaleString():yt.value),5)]),yt.showChart?(Or(),Nr("div",zyt,[yt.loading&&yt.variant==="classic"?(Or(),Nr("div",Oyt,[At("div",{class:"loader-spinner",style:Sp({borderTopColor:yt.color})},null,4)])):yt.centerText?(Or(),Nr("div",Byt,[At("span",Ryt,yn(yt.centerText),1)])):(Or(),Nr("svg",{key:2,id:ct.value,class:"chart-svg",viewBox:`0 0 ${tT} ${eT}`,preserveAspectRatio:"none"},[yt.variant==="classic"?(Or(),Nr(Es,{key:0},[u.value.length>1?(Or(),Nr("path",{key:0,d:K.value,fill:yt.color,"fill-opacity":"0.8",class:"sparkline-path"},null,8,Nyt)):Ta("",!0)],64)):(Or(),Nr(Es,{key:1},[u.value.length>1?(Or(),Nr("path",{key:0,d:$.value,stroke:yt.color,"stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"sparkline-path"},null,8,jyt)):Ta("",!0)],64))],8,Fyt))])):Ta("",!0)]))}}),Ex=vh(Uyt,[["__scopeId","data-v-257cbdca"]]),kH=6048e5,$yt=864e5,h4=6e4,d4=36e5,Hyt=1e3,wF=Symbol.for("constructDateFrom");function $f(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&wF in e?e[wF](t):e instanceof Date?new e.constructor(t):new Date(t)}function Jc(e,t){return $f(t||e,e)}function KS(e,t,r){const u=Jc(e,r?.in);return isNaN(t)?$f(r?.in||e,NaN):(t&&u.setDate(u.getDate()+t),u)}function lL(e,t,r){const u=Jc(e,r?.in);if(isNaN(t))return $f(e,NaN);if(!t)return u;const T=u.getDate(),$=$f(e,u.getTime());$.setMonth(u.getMonth()+t+1,0);const K=$.getDate();return T>=K?$:(u.setFullYear($.getFullYear(),$.getMonth(),T),u)}function cL(e,t,r){return $f(e,+Jc(e)+t)}function Vyt(e,t,r){return cL(e,t*d4)}let Wyt={};function Zx(){return Wyt}function zv(e,t){const r=Zx(),u=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,T=Jc(e,t?.in),$=T.getDay(),K=($=$.getTime()?u+1:r.getTime()>=ct.getTime()?u:u-1}function aS(e){const t=Jc(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Kx(e,...t){const r=$f.bind(null,t.find(u=>typeof u=="object"));return t.map(r)}function p9(e,t){const r=Jc(e,t?.in);return r.setHours(0,0,0,0),r}function SH(e,t,r){const[u,T]=Kx(r?.in,e,t),$=p9(u),K=p9(T),ct=+$-aS($),yt=+K-aS(K);return Math.round((ct-yt)/$yt)}function qyt(e,t){const r=TH(e,t),u=$f(e,0);return u.setFullYear(r,0,4),u.setHours(0,0,0,0),q2(u)}function Gyt(e,t,r){const u=Jc(e,r?.in);return u.setTime(u.getTime()+t*h4),u}function Zyt(e,t,r){return lL(e,t*3,r)}function Kyt(e,t,r){return cL(e,t*1e3)}function Yyt(e,t,r){return KS(e,t*7,r)}function Xyt(e,t,r){return lL(e,t*12,r)}function L5(e,t){const r=+Jc(e)-+Jc(t);return r<0?-1:r>0?1:r}function Jyt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function CH(e){return!(!Jyt(e)&&typeof e!="number"||isNaN(+Jc(e)))}function Qyt(e,t,r){const[u,T]=Kx(r?.in,e,t),$=u.getFullYear()-T.getFullYear(),K=u.getMonth()-T.getMonth();return $*12+K}function t_t(e,t,r){const[u,T]=Kx(r?.in,e,t);return u.getFullYear()-T.getFullYear()}function AH(e,t,r){const[u,T]=Kx(r?.in,e,t),$=kF(u,T),K=Math.abs(SH(u,T));u.setDate(u.getDate()-$*K);const ct=+(kF(u,T)===-$),yt=$*(K-ct);return yt===0?0:yt}function kF(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function f4(e){return t=>{const u=(e?Math[e]:Math.trunc)(t);return u===0?0:u}}function e_t(e,t,r){const[u,T]=Kx(r?.in,e,t),$=(+u-+T)/d4;return f4(r?.roundingMethod)($)}function uL(e,t){return+Jc(e)-+Jc(t)}function r_t(e,t,r){const u=uL(e,t)/h4;return f4(r?.roundingMethod)(u)}function MH(e,t){const r=Jc(e,t?.in);return r.setHours(23,59,59,999),r}function EH(e,t){const r=Jc(e,t?.in),u=r.getMonth();return r.setFullYear(r.getFullYear(),u+1,0),r.setHours(23,59,59,999),r}function n_t(e,t){const r=Jc(e,t?.in);return+MH(r,t)==+EH(r,t)}function LH(e,t,r){const[u,T,$]=Kx(r?.in,e,e,t),K=L5(T,$),ct=Math.abs(Qyt(T,$));if(ct<1)return 0;T.getMonth()===1&&T.getDate()>27&&T.setDate(30),T.setMonth(T.getMonth()-K*ct);let yt=L5(T,$)===-K;n_t(u)&&ct===1&&L5(u,$)===1&&(yt=!1);const St=K*(ct-+yt);return St===0?0:St}function i_t(e,t,r){const u=LH(e,t,r)/3;return f4(r?.roundingMethod)(u)}function a_t(e,t,r){const u=uL(e,t)/1e3;return f4(r?.roundingMethod)(u)}function o_t(e,t,r){const u=AH(e,t,r)/7;return f4(r?.roundingMethod)(u)}function s_t(e,t,r){const[u,T]=Kx(r?.in,e,t),$=L5(u,T),K=Math.abs(t_t(u,T));u.setFullYear(1584),T.setFullYear(1584);const ct=L5(u,T)===-$,yt=$*(K-+ct);return yt===0?0:yt}function l_t(e,t){const r=Jc(e,t?.in),u=r.getMonth(),T=u-u%3;return r.setMonth(T,1),r.setHours(0,0,0,0),r}function c_t(e,t){const r=Jc(e,t?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function u_t(e,t){const r=Jc(e,t?.in),u=r.getFullYear();return r.setFullYear(u+1,0,0),r.setHours(23,59,59,999),r}function PH(e,t){const r=Jc(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function h_t(e,t){const r=Jc(e,t?.in);return r.setMinutes(59,59,999),r}function d_t(e,t){const r=Zx(),u=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,T=Jc(e,t?.in),$=T.getDay(),K=(${let u;const T=g_t[e];return typeof T=="string"?u=T:t===1?u=T.one:u=T.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+u:u+" ago":u};function J7(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const y_t={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},__t={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},x_t={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},b_t={date:J7({formats:y_t,defaultWidth:"full"}),time:J7({formats:__t,defaultWidth:"full"}),dateTime:J7({formats:x_t,defaultWidth:"full"})},w_t={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k_t=(e,t,r,u)=>w_t[e];function V3(e){return(t,r)=>{const u=r?.context?String(r.context):"standalone";let T;if(u==="formatting"&&e.formattingValues){const K=e.defaultFormattingWidth||e.defaultWidth,ct=r?.width?String(r.width):K;T=e.formattingValues[ct]||e.formattingValues[K]}else{const K=e.defaultWidth,ct=r?.width?String(r.width):e.defaultWidth;T=e.values[ct]||e.values[K]}const $=e.argumentCallback?e.argumentCallback(t):t;return T[$]}}const T_t={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},S_t={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},C_t={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},A_t={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},M_t={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},E_t={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},L_t=(e,t)=>{const r=Number(e),u=r%100;if(u>20||u<10)switch(u%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},P_t={ordinalNumber:L_t,era:V3({values:T_t,defaultWidth:"wide"}),quarter:V3({values:S_t,defaultWidth:"wide",argumentCallback:e=>e-1}),month:V3({values:C_t,defaultWidth:"wide"}),day:V3({values:A_t,defaultWidth:"wide"}),dayPeriod:V3({values:M_t,defaultWidth:"wide",formattingValues:E_t,defaultFormattingWidth:"wide"})};function W3(e){return(t,r={})=>{const u=r.width,T=u&&e.matchPatterns[u]||e.matchPatterns[e.defaultMatchWidth],$=t.match(T);if(!$)return null;const K=$[0],ct=u&&e.parsePatterns[u]||e.parsePatterns[e.defaultParseWidth],yt=Array.isArray(ct)?D_t(ct,ne=>ne.test(K)):I_t(ct,ne=>ne.test(K));let St;St=e.valueCallback?e.valueCallback(yt):yt,St=r.valueCallback?r.valueCallback(St):St;const Ut=t.slice(K.length);return{value:St,rest:Ut}}}function I_t(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function D_t(e,t){for(let r=0;r{const u=t.match(e.matchPattern);if(!u)return null;const T=u[0],$=t.match(e.parsePattern);if(!$)return null;let K=e.valueCallback?e.valueCallback($[0]):$[0];K=r.valueCallback?r.valueCallback(K):K;const ct=t.slice(T.length);return{value:K,rest:ct}}}const O_t=/^(\d+)(th|st|nd|rd)?/i,B_t=/\d+/i,R_t={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},F_t={any:[/^b/i,/^(a|c)/i]},N_t={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},j_t={any:[/1/i,/2/i,/3/i,/4/i]},U_t={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},$_t={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},H_t={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},V_t={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},W_t={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},q_t={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},G_t={ordinalNumber:z_t({matchPattern:O_t,parsePattern:B_t,valueCallback:e=>parseInt(e,10)}),era:W3({matchPatterns:R_t,defaultMatchWidth:"wide",parsePatterns:F_t,defaultParseWidth:"any"}),quarter:W3({matchPatterns:N_t,defaultMatchWidth:"wide",parsePatterns:j_t,defaultParseWidth:"any",valueCallback:e=>e+1}),month:W3({matchPatterns:U_t,defaultMatchWidth:"wide",parsePatterns:$_t,defaultParseWidth:"any"}),day:W3({matchPatterns:H_t,defaultMatchWidth:"wide",parsePatterns:V_t,defaultParseWidth:"any"}),dayPeriod:W3({matchPatterns:W_t,defaultMatchWidth:"any",parsePatterns:q_t,defaultParseWidth:"any"})},IH={code:"en-US",formatDistance:v_t,formatLong:b_t,formatRelative:k_t,localize:P_t,match:G_t,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Z_t(e,t){const r=Jc(e,t?.in);return SH(r,PH(r))+1}function DH(e,t){const r=Jc(e,t?.in),u=+q2(r)-+qyt(r);return Math.round(u/kH)+1}function hL(e,t){const r=Jc(e,t?.in),u=r.getFullYear(),T=Zx(),$=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??T.firstWeekContainsDate??T.locale?.options?.firstWeekContainsDate??1,K=$f(t?.in||e,0);K.setFullYear(u+1,0,$),K.setHours(0,0,0,0);const ct=zv(K,t),yt=$f(t?.in||e,0);yt.setFullYear(u,0,$),yt.setHours(0,0,0,0);const St=zv(yt,t);return+r>=+ct?u+1:+r>=+St?u:u-1}function K_t(e,t){const r=Zx(),u=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,T=hL(e,t),$=$f(t?.in||e,0);return $.setFullYear(T,0,u),$.setHours(0,0,0,0),zv($,t)}function zH(e,t){const r=Jc(e,t?.in),u=+zv(r,t)-+K_t(r,t);return Math.round(u/kH)+1}function ld(e,t){const r=e<0?"-":"",u=Math.abs(e).toString().padStart(t,"0");return r+u}const Uy={y(e,t){const r=e.getFullYear(),u=r>0?r:1-r;return ld(t==="yy"?u%100:u,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):ld(r+1,2)},d(e,t){return ld(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ld(e.getHours()%12||12,t.length)},H(e,t){return ld(e.getHours(),t.length)},m(e,t){return ld(e.getMinutes(),t.length)},s(e,t){return ld(e.getSeconds(),t.length)},S(e,t){const r=t.length,u=e.getMilliseconds(),T=Math.trunc(u*Math.pow(10,r-3));return ld(T,t.length)}},y2={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},TF={G:function(e,t,r){const u=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(u,{width:"abbreviated"});case"GGGGG":return r.era(u,{width:"narrow"});case"GGGG":default:return r.era(u,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const u=e.getFullYear(),T=u>0?u:1-u;return r.ordinalNumber(T,{unit:"year"})}return Uy.y(e,t)},Y:function(e,t,r,u){const T=hL(e,u),$=T>0?T:1-T;if(t==="YY"){const K=$%100;return ld(K,2)}return t==="Yo"?r.ordinalNumber($,{unit:"year"}):ld($,t.length)},R:function(e,t){const r=TH(e);return ld(r,t.length)},u:function(e,t){const r=e.getFullYear();return ld(r,t.length)},Q:function(e,t,r){const u=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(u);case"QQ":return ld(u,2);case"Qo":return r.ordinalNumber(u,{unit:"quarter"});case"QQQ":return r.quarter(u,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(u,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(u,{width:"wide",context:"formatting"})}},q:function(e,t,r){const u=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(u);case"qq":return ld(u,2);case"qo":return r.ordinalNumber(u,{unit:"quarter"});case"qqq":return r.quarter(u,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(u,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(u,{width:"wide",context:"standalone"})}},M:function(e,t,r){const u=e.getMonth();switch(t){case"M":case"MM":return Uy.M(e,t);case"Mo":return r.ordinalNumber(u+1,{unit:"month"});case"MMM":return r.month(u,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(u,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(u,{width:"wide",context:"formatting"})}},L:function(e,t,r){const u=e.getMonth();switch(t){case"L":return String(u+1);case"LL":return ld(u+1,2);case"Lo":return r.ordinalNumber(u+1,{unit:"month"});case"LLL":return r.month(u,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(u,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(u,{width:"wide",context:"standalone"})}},w:function(e,t,r,u){const T=zH(e,u);return t==="wo"?r.ordinalNumber(T,{unit:"week"}):ld(T,t.length)},I:function(e,t,r){const u=DH(e);return t==="Io"?r.ordinalNumber(u,{unit:"week"}):ld(u,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Uy.d(e,t)},D:function(e,t,r){const u=Z_t(e);return t==="Do"?r.ordinalNumber(u,{unit:"dayOfYear"}):ld(u,t.length)},E:function(e,t,r){const u=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(u,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(u,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(u,{width:"short",context:"formatting"});case"EEEE":default:return r.day(u,{width:"wide",context:"formatting"})}},e:function(e,t,r,u){const T=e.getDay(),$=(T-u.weekStartsOn+8)%7||7;switch(t){case"e":return String($);case"ee":return ld($,2);case"eo":return r.ordinalNumber($,{unit:"day"});case"eee":return r.day(T,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(T,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(T,{width:"short",context:"formatting"});case"eeee":default:return r.day(T,{width:"wide",context:"formatting"})}},c:function(e,t,r,u){const T=e.getDay(),$=(T-u.weekStartsOn+8)%7||7;switch(t){case"c":return String($);case"cc":return ld($,t.length);case"co":return r.ordinalNumber($,{unit:"day"});case"ccc":return r.day(T,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(T,{width:"narrow",context:"standalone"});case"cccccc":return r.day(T,{width:"short",context:"standalone"});case"cccc":default:return r.day(T,{width:"wide",context:"standalone"})}},i:function(e,t,r){const u=e.getDay(),T=u===0?7:u;switch(t){case"i":return String(T);case"ii":return ld(T,t.length);case"io":return r.ordinalNumber(T,{unit:"day"});case"iii":return r.day(u,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(u,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(u,{width:"short",context:"formatting"});case"iiii":default:return r.day(u,{width:"wide",context:"formatting"})}},a:function(e,t,r){const T=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(T,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(T,{width:"wide",context:"formatting"})}},b:function(e,t,r){const u=e.getHours();let T;switch(u===12?T=y2.noon:u===0?T=y2.midnight:T=u/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(T,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(T,{width:"wide",context:"formatting"})}},B:function(e,t,r){const u=e.getHours();let T;switch(u>=17?T=y2.evening:u>=12?T=y2.afternoon:u>=4?T=y2.morning:T=y2.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(T,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(T,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let u=e.getHours()%12;return u===0&&(u=12),r.ordinalNumber(u,{unit:"hour"})}return Uy.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Uy.H(e,t)},K:function(e,t,r){const u=e.getHours()%12;return t==="Ko"?r.ordinalNumber(u,{unit:"hour"}):ld(u,t.length)},k:function(e,t,r){let u=e.getHours();return u===0&&(u=24),t==="ko"?r.ordinalNumber(u,{unit:"hour"}):ld(u,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Uy.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Uy.s(e,t)},S:function(e,t){return Uy.S(e,t)},X:function(e,t,r){const u=e.getTimezoneOffset();if(u===0)return"Z";switch(t){case"X":return CF(u);case"XXXX":case"XX":return xx(u);case"XXXXX":case"XXX":default:return xx(u,":")}},x:function(e,t,r){const u=e.getTimezoneOffset();switch(t){case"x":return CF(u);case"xxxx":case"xx":return xx(u);case"xxxxx":case"xxx":default:return xx(u,":")}},O:function(e,t,r){const u=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+SF(u,":");case"OOOO":default:return"GMT"+xx(u,":")}},z:function(e,t,r){const u=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+SF(u,":");case"zzzz":default:return"GMT"+xx(u,":")}},t:function(e,t,r){const u=Math.trunc(+e/1e3);return ld(u,t.length)},T:function(e,t,r){return ld(+e,t.length)}};function SF(e,t=""){const r=e>0?"-":"+",u=Math.abs(e),T=Math.trunc(u/60),$=u%60;return $===0?r+String(T):r+String(T)+t+ld($,2)}function CF(e,t){return e%60===0?(e>0?"-":"+")+ld(Math.abs(e)/60,2):xx(e,t)}function xx(e,t=""){const r=e>0?"-":"+",u=Math.abs(e),T=ld(Math.trunc(u/60),2),$=ld(u%60,2);return r+T+t+$}const AF=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},OH=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Y_t=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],u=r[1],T=r[2];if(!T)return AF(e,t);let $;switch(u){case"P":$=t.dateTime({width:"short"});break;case"PP":$=t.dateTime({width:"medium"});break;case"PPP":$=t.dateTime({width:"long"});break;case"PPPP":default:$=t.dateTime({width:"full"});break}return $.replace("{{date}}",AF(u,t)).replace("{{time}}",OH(T,t))},m9={p:OH,P:Y_t},X_t=/^D+$/,J_t=/^Y+$/,Q_t=["D","DD","YY","YYYY"];function BH(e){return X_t.test(e)}function RH(e){return J_t.test(e)}function g9(e,t,r){const u=txt(e,t,r);if(console.warn(u),Q_t.includes(e))throw new RangeError(u)}function txt(e,t,r){const u=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${u} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ext=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rxt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nxt=/^'([^]*?)'?$/,ixt=/''/g,axt=/[a-zA-Z]/;function oxt(e,t,r){const u=Zx(),T=r?.locale??u.locale??IH,$=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,K=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,ct=Jc(e,r?.in);if(!CH(ct))throw new RangeError("Invalid time value");let yt=t.match(rxt).map(Ut=>{const ne=Ut[0];if(ne==="p"||ne==="P"){const pe=m9[ne];return pe(Ut,T.formatLong)}return Ut}).join("").match(ext).map(Ut=>{if(Ut==="''")return{isToken:!1,value:"'"};const ne=Ut[0];if(ne==="'")return{isToken:!1,value:sxt(Ut)};if(TF[ne])return{isToken:!0,value:Ut};if(ne.match(axt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ne+"`");return{isToken:!1,value:Ut}});T.localize.preprocessor&&(yt=T.localize.preprocessor(ct,yt));const St={firstWeekContainsDate:$,weekStartsOn:K,locale:T};return yt.map(Ut=>{if(!Ut.isToken)return Ut.value;const ne=Ut.value;(!r?.useAdditionalWeekYearTokens&&RH(ne)||!r?.useAdditionalDayOfYearTokens&&BH(ne))&&g9(ne,t,String(e));const pe=TF[ne[0]];return pe(ct,ne,T.localize,St)}).join("")}function sxt(e){const t=e.match(nxt);return t?t[1].replace(ixt,"'"):e}function lxt(){return Object.assign({},Zx())}function cxt(e,t){const r=Jc(e,t?.in).getDay();return r===0?7:r}function uxt(e,t){const r=hxt(t)?new t(0):$f(t,0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}function hxt(e){return typeof e=="function"&&e.prototype?.constructor===e}const dxt=10;class FH{subPriority=0;validate(t,r){return!0}}class fxt extends FH{constructor(t,r,u,T,$){super(),this.value=t,this.validateValue=r,this.setValue=u,this.priority=T,$&&(this.subPriority=$)}validate(t,r){return this.validateValue(t,this.value,r)}set(t,r,u){return this.setValue(t,r,this.value,u)}}class pxt extends FH{priority=dxt;subPriority=-1;constructor(t,r){super(),this.context=t||(u=>$f(r,u))}set(t,r){return r.timestampIsSet?t:$f(t,uxt(t,this.context))}}class Nh{run(t,r,u,T){const $=this.parse(t,r,u,T);return $?{setter:new fxt($.value,this.validate,this.set,this.priority,this.subPriority),rest:$.rest}:null}validate(t,r,u){return!0}}class mxt extends Nh{priority=140;parse(t,r,u){switch(r){case"G":case"GG":case"GGG":return u.era(t,{width:"abbreviated"})||u.era(t,{width:"narrow"});case"GGGGG":return u.era(t,{width:"narrow"});case"GGGG":default:return u.era(t,{width:"wide"})||u.era(t,{width:"abbreviated"})||u.era(t,{width:"narrow"})}}set(t,r,u){return r.era=u,t.setFullYear(u,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const cp={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Tv={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function up(e,t){return e&&{value:t(e.value),rest:e.rest}}function Sf(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function Sv(e,t){const r=t.match(e);if(!r)return null;if(r[0]==="Z")return{value:0,rest:t.slice(1)};const u=r[1]==="+"?1:-1,T=r[2]?parseInt(r[2],10):0,$=r[3]?parseInt(r[3],10):0,K=r[5]?parseInt(r[5],10):0;return{value:u*(T*d4+$*h4+K*Hyt),rest:t.slice(r[0].length)}}function NH(e){return Sf(cp.anyDigitsSigned,e)}function Hf(e,t){switch(e){case 1:return Sf(cp.singleDigit,t);case 2:return Sf(cp.twoDigits,t);case 3:return Sf(cp.threeDigits,t);case 4:return Sf(cp.fourDigits,t);default:return Sf(new RegExp("^\\d{1,"+e+"}"),t)}}function oS(e,t){switch(e){case 1:return Sf(cp.singleDigitSigned,t);case 2:return Sf(cp.twoDigitsSigned,t);case 3:return Sf(cp.threeDigitsSigned,t);case 4:return Sf(cp.fourDigitsSigned,t);default:return Sf(new RegExp("^-?\\d{1,"+e+"}"),t)}}function dL(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function jH(e,t){const r=t>0,u=r?t:1-t;let T;if(u<=50)T=e||100;else{const $=u+50,K=Math.trunc($/100)*100,ct=e>=$%100;T=e+K-(ct?100:0)}return r?T:1-T}function UH(e){return e%400===0||e%4===0&&e%100!==0}class gxt extends Nh{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,r,u){const T=$=>({year:$,isTwoDigitYear:r==="yy"});switch(r){case"y":return up(Hf(4,t),T);case"yo":return up(u.ordinalNumber(t,{unit:"year"}),T);default:return up(Hf(r.length,t),T)}}validate(t,r){return r.isTwoDigitYear||r.year>0}set(t,r,u){const T=t.getFullYear();if(u.isTwoDigitYear){const K=jH(u.year,T);return t.setFullYear(K,0,1),t.setHours(0,0,0,0),t}const $=!("era"in r)||r.era===1?u.year:1-u.year;return t.setFullYear($,0,1),t.setHours(0,0,0,0),t}}class vxt extends Nh{priority=130;parse(t,r,u){const T=$=>({year:$,isTwoDigitYear:r==="YY"});switch(r){case"Y":return up(Hf(4,t),T);case"Yo":return up(u.ordinalNumber(t,{unit:"year"}),T);default:return up(Hf(r.length,t),T)}}validate(t,r){return r.isTwoDigitYear||r.year>0}set(t,r,u,T){const $=hL(t,T);if(u.isTwoDigitYear){const ct=jH(u.year,$);return t.setFullYear(ct,0,T.firstWeekContainsDate),t.setHours(0,0,0,0),zv(t,T)}const K=!("era"in r)||r.era===1?u.year:1-u.year;return t.setFullYear(K,0,T.firstWeekContainsDate),t.setHours(0,0,0,0),zv(t,T)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class yxt extends Nh{priority=130;parse(t,r){return oS(r==="R"?4:r.length,t)}set(t,r,u){const T=$f(t,0);return T.setFullYear(u,0,4),T.setHours(0,0,0,0),q2(T)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class _xt extends Nh{priority=130;parse(t,r){return oS(r==="u"?4:r.length,t)}set(t,r,u){return t.setFullYear(u,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class xxt extends Nh{priority=120;parse(t,r,u){switch(r){case"Q":case"QQ":return Hf(r.length,t);case"Qo":return u.ordinalNumber(t,{unit:"quarter"});case"QQQ":return u.quarter(t,{width:"abbreviated",context:"formatting"})||u.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return u.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(t,{width:"wide",context:"formatting"})||u.quarter(t,{width:"abbreviated",context:"formatting"})||u.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=1&&r<=4}set(t,r,u){return t.setMonth((u-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class bxt extends Nh{priority=120;parse(t,r,u){switch(r){case"q":case"qq":return Hf(r.length,t);case"qo":return u.ordinalNumber(t,{unit:"quarter"});case"qqq":return u.quarter(t,{width:"abbreviated",context:"standalone"})||u.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return u.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(t,{width:"wide",context:"standalone"})||u.quarter(t,{width:"abbreviated",context:"standalone"})||u.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,r){return r>=1&&r<=4}set(t,r,u){return t.setMonth((u-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class wxt extends Nh{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,r,u){const T=$=>$-1;switch(r){case"M":return up(Sf(cp.month,t),T);case"MM":return up(Hf(2,t),T);case"Mo":return up(u.ordinalNumber(t,{unit:"month"}),T);case"MMM":return u.month(t,{width:"abbreviated",context:"formatting"})||u.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return u.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(t,{width:"wide",context:"formatting"})||u.month(t,{width:"abbreviated",context:"formatting"})||u.month(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=0&&r<=11}set(t,r,u){return t.setMonth(u,1),t.setHours(0,0,0,0),t}}class kxt extends Nh{priority=110;parse(t,r,u){const T=$=>$-1;switch(r){case"L":return up(Sf(cp.month,t),T);case"LL":return up(Hf(2,t),T);case"Lo":return up(u.ordinalNumber(t,{unit:"month"}),T);case"LLL":return u.month(t,{width:"abbreviated",context:"standalone"})||u.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return u.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(t,{width:"wide",context:"standalone"})||u.month(t,{width:"abbreviated",context:"standalone"})||u.month(t,{width:"narrow",context:"standalone"})}}validate(t,r){return r>=0&&r<=11}set(t,r,u){return t.setMonth(u,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Txt(e,t,r){const u=Jc(e,r?.in),T=zH(u,r)-t;return u.setDate(u.getDate()-T*7),Jc(u,r?.in)}class Sxt extends Nh{priority=100;parse(t,r,u){switch(r){case"w":return Sf(cp.week,t);case"wo":return u.ordinalNumber(t,{unit:"week"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=53}set(t,r,u,T){return zv(Txt(t,u,T),T)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Cxt(e,t,r){const u=Jc(e,r?.in),T=DH(u,r)-t;return u.setDate(u.getDate()-T*7),u}class Axt extends Nh{priority=100;parse(t,r,u){switch(r){case"I":return Sf(cp.week,t);case"Io":return u.ordinalNumber(t,{unit:"week"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=53}set(t,r,u){return q2(Cxt(t,u))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Mxt=[31,28,31,30,31,30,31,31,30,31,30,31],Ext=[31,29,31,30,31,30,31,31,30,31,30,31];class Lxt extends Nh{priority=90;subPriority=1;parse(t,r,u){switch(r){case"d":return Sf(cp.date,t);case"do":return u.ordinalNumber(t,{unit:"date"});default:return Hf(r.length,t)}}validate(t,r){const u=t.getFullYear(),T=UH(u),$=t.getMonth();return T?r>=1&&r<=Ext[$]:r>=1&&r<=Mxt[$]}set(t,r,u){return t.setDate(u),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Pxt extends Nh{priority=90;subpriority=1;parse(t,r,u){switch(r){case"D":case"DD":return Sf(cp.dayOfYear,t);case"Do":return u.ordinalNumber(t,{unit:"date"});default:return Hf(r.length,t)}}validate(t,r){const u=t.getFullYear();return UH(u)?r>=1&&r<=366:r>=1&&r<=365}set(t,r,u){return t.setMonth(0,u),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function fL(e,t,r){const u=Zx(),T=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,$=Jc(e,r?.in),K=$.getDay(),yt=(t%7+7)%7,St=7-T,Ut=t<0||t>6?t-(K+St)%7:(yt+St)%7-(K+St)%7;return KS($,Ut,r)}class Ixt extends Nh{priority=90;parse(t,r,u){switch(r){case"E":case"EE":case"EEE":return u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return u.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return u.day(t,{width:"wide",context:"formatting"})||u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=0&&r<=6}set(t,r,u,T){return t=fL(t,u,T),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class Dxt extends Nh{priority=90;parse(t,r,u,T){const $=K=>{const ct=Math.floor((K-1)/7)*7;return(K+T.weekStartsOn+6)%7+ct};switch(r){case"e":case"ee":return up(Hf(r.length,t),$);case"eo":return up(u.ordinalNumber(t,{unit:"day"}),$);case"eee":return u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"eeeee":return u.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return u.day(t,{width:"wide",context:"formatting"})||u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"})}}validate(t,r){return r>=0&&r<=6}set(t,r,u,T){return t=fL(t,u,T),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class zxt extends Nh{priority=90;parse(t,r,u,T){const $=K=>{const ct=Math.floor((K-1)/7)*7;return(K+T.weekStartsOn+6)%7+ct};switch(r){case"c":case"cc":return up(Hf(r.length,t),$);case"co":return up(u.ordinalNumber(t,{unit:"day"}),$);case"ccc":return u.day(t,{width:"abbreviated",context:"standalone"})||u.day(t,{width:"short",context:"standalone"})||u.day(t,{width:"narrow",context:"standalone"});case"ccccc":return u.day(t,{width:"narrow",context:"standalone"});case"cccccc":return u.day(t,{width:"short",context:"standalone"})||u.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return u.day(t,{width:"wide",context:"standalone"})||u.day(t,{width:"abbreviated",context:"standalone"})||u.day(t,{width:"short",context:"standalone"})||u.day(t,{width:"narrow",context:"standalone"})}}validate(t,r){return r>=0&&r<=6}set(t,r,u,T){return t=fL(t,u,T),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Oxt(e,t,r){const u=Jc(e,r?.in),T=cxt(u,r),$=t-T;return KS(u,$,r)}class Bxt extends Nh{priority=90;parse(t,r,u){const T=$=>$===0?7:$;switch(r){case"i":case"ii":return Hf(r.length,t);case"io":return u.ordinalNumber(t,{unit:"day"});case"iii":return up(u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"}),T);case"iiiii":return up(u.day(t,{width:"narrow",context:"formatting"}),T);case"iiiiii":return up(u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"}),T);case"iiii":default:return up(u.day(t,{width:"wide",context:"formatting"})||u.day(t,{width:"abbreviated",context:"formatting"})||u.day(t,{width:"short",context:"formatting"})||u.day(t,{width:"narrow",context:"formatting"}),T)}}validate(t,r){return r>=1&&r<=7}set(t,r,u){return t=Oxt(t,u),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Rxt extends Nh{priority=80;parse(t,r,u){switch(r){case"a":case"aa":case"aaa":return u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return u.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(t,{width:"wide",context:"formatting"})||u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,r,u){return t.setHours(dL(u),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Fxt extends Nh{priority=80;parse(t,r,u){switch(r){case"b":case"bb":case"bbb":return u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return u.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(t,{width:"wide",context:"formatting"})||u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,r,u){return t.setHours(dL(u),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Nxt extends Nh{priority=80;parse(t,r,u){switch(r){case"B":case"BB":case"BBB":return u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return u.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(t,{width:"wide",context:"formatting"})||u.dayPeriod(t,{width:"abbreviated",context:"formatting"})||u.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,r,u){return t.setHours(dL(u),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class jxt extends Nh{priority=70;parse(t,r,u){switch(r){case"h":return Sf(cp.hour12h,t);case"ho":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=12}set(t,r,u){const T=t.getHours()>=12;return T&&u<12?t.setHours(u+12,0,0,0):!T&&u===12?t.setHours(0,0,0,0):t.setHours(u,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class Uxt extends Nh{priority=70;parse(t,r,u){switch(r){case"H":return Sf(cp.hour23h,t);case"Ho":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=23}set(t,r,u){return t.setHours(u,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class $xt extends Nh{priority=70;parse(t,r,u){switch(r){case"K":return Sf(cp.hour11h,t);case"Ko":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=11}set(t,r,u){return t.getHours()>=12&&u<12?t.setHours(u+12,0,0,0):t.setHours(u,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Hxt extends Nh{priority=70;parse(t,r,u){switch(r){case"k":return Sf(cp.hour24h,t);case"ko":return u.ordinalNumber(t,{unit:"hour"});default:return Hf(r.length,t)}}validate(t,r){return r>=1&&r<=24}set(t,r,u){const T=u<=24?u%24:u;return t.setHours(T,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Vxt extends Nh{priority=60;parse(t,r,u){switch(r){case"m":return Sf(cp.minute,t);case"mo":return u.ordinalNumber(t,{unit:"minute"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=59}set(t,r,u){return t.setMinutes(u,0,0),t}incompatibleTokens=["t","T"]}class Wxt extends Nh{priority=50;parse(t,r,u){switch(r){case"s":return Sf(cp.second,t);case"so":return u.ordinalNumber(t,{unit:"second"});default:return Hf(r.length,t)}}validate(t,r){return r>=0&&r<=59}set(t,r,u){return t.setSeconds(u,0),t}incompatibleTokens=["t","T"]}class qxt extends Nh{priority=30;parse(t,r){const u=T=>Math.trunc(T*Math.pow(10,-r.length+3));return up(Hf(r.length,t),u)}set(t,r,u){return t.setMilliseconds(u),t}incompatibleTokens=["t","T"]}class Gxt extends Nh{priority=10;parse(t,r){switch(r){case"X":return Sv(Tv.basicOptionalMinutes,t);case"XX":return Sv(Tv.basic,t);case"XXXX":return Sv(Tv.basicOptionalSeconds,t);case"XXXXX":return Sv(Tv.extendedOptionalSeconds,t);case"XXX":default:return Sv(Tv.extended,t)}}set(t,r,u){return r.timestampIsSet?t:$f(t,t.getTime()-aS(t)-u)}incompatibleTokens=["t","T","x"]}class Zxt extends Nh{priority=10;parse(t,r){switch(r){case"x":return Sv(Tv.basicOptionalMinutes,t);case"xx":return Sv(Tv.basic,t);case"xxxx":return Sv(Tv.basicOptionalSeconds,t);case"xxxxx":return Sv(Tv.extendedOptionalSeconds,t);case"xxx":default:return Sv(Tv.extended,t)}}set(t,r,u){return r.timestampIsSet?t:$f(t,t.getTime()-aS(t)-u)}incompatibleTokens=["t","T","X"]}class Kxt extends Nh{priority=40;parse(t){return NH(t)}set(t,r,u){return[$f(t,u*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Yxt extends Nh{priority=20;parse(t){return NH(t)}set(t,r,u){return[$f(t,u),{timestampIsSet:!0}]}incompatibleTokens="*"}const Xxt={G:new mxt,y:new gxt,Y:new vxt,R:new yxt,u:new _xt,Q:new xxt,q:new bxt,M:new wxt,L:new kxt,w:new Sxt,I:new Axt,d:new Lxt,D:new Pxt,E:new Ixt,e:new Dxt,c:new zxt,i:new Bxt,a:new Rxt,b:new Fxt,B:new Nxt,h:new jxt,H:new Uxt,K:new $xt,k:new Hxt,m:new Vxt,s:new Wxt,S:new qxt,X:new Gxt,x:new Zxt,t:new Kxt,T:new Yxt},Jxt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qxt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tbt=/^'([^]*?)'?$/,ebt=/''/g,rbt=/\S/,nbt=/[a-zA-Z]/;function ibt(e,t,r,u){const T=()=>$f(u?.in||r,NaN),$=lxt(),K=u?.locale??$.locale??IH,ct=u?.firstWeekContainsDate??u?.locale?.options?.firstWeekContainsDate??$.firstWeekContainsDate??$.locale?.options?.firstWeekContainsDate??1,yt=u?.weekStartsOn??u?.locale?.options?.weekStartsOn??$.weekStartsOn??$.locale?.options?.weekStartsOn??0;if(!t)return e?T():Jc(r,u?.in);const St={firstWeekContainsDate:ct,weekStartsOn:yt,locale:K},Ut=[new pxt(u?.in,r)],ne=t.match(Qxt).map(Ve=>{const kr=Ve[0];if(kr in m9){const It=m9[kr];return It(Ve,K.formatLong)}return Ve}).join("").match(Jxt),pe=[];for(let Ve of ne){!u?.useAdditionalWeekYearTokens&&RH(Ve)&&g9(Ve,t,e),!u?.useAdditionalDayOfYearTokens&&BH(Ve)&&g9(Ve,t,e);const kr=Ve[0],It=Xxt[kr];if(It){const{incompatibleTokens:rn}=It;if(Array.isArray(rn)){const Mr=pe.find(tn=>rn.includes(tn.token)||tn.token===kr);if(Mr)throw new RangeError(`The format string mustn't contain \`${Mr.fullToken}\` and \`${Ve}\` at the same time`)}else if(It.incompatibleTokens==="*"&&pe.length>0)throw new RangeError(`The format string mustn't contain \`${Ve}\` and any other token at the same time`);pe.push({token:kr,fullToken:Ve});const Lr=It.run(e,Ve,K.match,St);if(!Lr)return T();Ut.push(Lr.setter),e=Lr.rest}else{if(kr.match(nbt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+kr+"`");if(Ve==="''"?Ve="'":kr==="'"&&(Ve=abt(Ve)),e.indexOf(Ve)===0)e=e.slice(Ve.length);else return T()}}if(e.length>0&&rbt.test(e))return T();const me=Ut.map(Ve=>Ve.priority).sort((Ve,kr)=>kr-Ve).filter((Ve,kr,It)=>It.indexOf(Ve)===kr).map(Ve=>Ut.filter(kr=>kr.priority===Ve).sort((kr,It)=>It.subPriority-kr.subPriority)).map(Ve=>Ve[0]);let we=Jc(r,u?.in);if(isNaN(+we))return T();const Ce={};for(const Ve of me){if(!Ve.validate(we,St))return T();const kr=Ve.set(we,Ce,St);Array.isArray(kr)?(we=kr[0],Object.assign(Ce,kr[1])):we=kr}return we}function abt(e){return e.match(tbt)[1].replace(ebt,"'")}function obt(e,t){const r=Jc(e,t?.in);return r.setMinutes(0,0,0),r}function sbt(e,t){const r=Jc(e,t?.in);return r.setSeconds(0,0),r}function lbt(e,t){const r=Jc(e,t?.in);return r.setMilliseconds(0),r}function cbt(e,t){const r=()=>$f(t?.in,NaN),u=t?.additionalDigits??2,T=fbt(e);let $;if(T.date){const St=pbt(T.date,u);$=mbt(St.restDateString,St.year)}if(!$||isNaN(+$))return r();const K=+$;let ct=0,yt;if(T.time&&(ct=gbt(T.time),isNaN(ct)))return r();if(T.timezone){if(yt=vbt(T.timezone),isNaN(yt))return r()}else{const St=new Date(K+ct),Ut=Jc(0,t?.in);return Ut.setFullYear(St.getUTCFullYear(),St.getUTCMonth(),St.getUTCDate()),Ut.setHours(St.getUTCHours(),St.getUTCMinutes(),St.getUTCSeconds(),St.getUTCMilliseconds()),Ut}return Jc(K+ct+yt,t?.in)}const rT={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ubt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,hbt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dbt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function fbt(e){const t={},r=e.split(rT.dateTimeDelimiter);let u;if(r.length>2)return t;if(/:/.test(r[0])?u=r[0]:(t.date=r[0],u=r[1],rT.timeZoneDelimiter.test(t.date)&&(t.date=e.split(rT.timeZoneDelimiter)[0],u=e.substr(t.date.length,e.length))),u){const T=rT.timezone.exec(u);T?(t.time=u.replace(T[1],""),t.timezone=T[1]):t.time=u}return t}function pbt(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),u=e.match(r);if(!u)return{year:NaN,restDateString:""};const T=u[1]?parseInt(u[1]):null,$=u[2]?parseInt(u[2]):null;return{year:$===null?T:$*100,restDateString:e.slice((u[1]||u[2]).length)}}function mbt(e,t){if(t===null)return new Date(NaN);const r=e.match(ubt);if(!r)return new Date(NaN);const u=!!r[4],T=q3(r[1]),$=q3(r[2])-1,K=q3(r[3]),ct=q3(r[4]),yt=q3(r[5])-1;if(u)return wbt(t,ct,yt)?ybt(t,ct,yt):new Date(NaN);{const St=new Date(0);return!xbt(t,$,K)||!bbt(t,T)?new Date(NaN):(St.setUTCFullYear(t,$,Math.max(T,K)),St)}}function q3(e){return e?parseInt(e):1}function gbt(e){const t=e.match(hbt);if(!t)return NaN;const r=Q7(t[1]),u=Q7(t[2]),T=Q7(t[3]);return kbt(r,u,T)?r*d4+u*h4+T*1e3:NaN}function Q7(e){return e&&parseFloat(e.replace(",","."))||0}function vbt(e){if(e==="Z")return 0;const t=e.match(dbt);if(!t)return 0;const r=t[1]==="+"?-1:1,u=parseInt(t[2]),T=t[3]&&parseInt(t[3])||0;return Tbt(u,T)?r*(u*d4+T*h4):NaN}function ybt(e,t,r){const u=new Date(0);u.setUTCFullYear(e,0,4);const T=u.getUTCDay()||7,$=(t-1)*7+r+1-T;return u.setUTCDate(u.getUTCDate()+$),u}const _bt=[31,null,31,30,31,30,31,31,30,31,30,31];function $H(e){return e%400===0||e%4===0&&e%100!==0}function xbt(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(_bt[t]||($H(e)?29:28))}function bbt(e,t){return t>=1&&t<=($H(e)?366:365)}function wbt(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function kbt(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Tbt(e,t){return t>=0&&t<=59}/*! * chartjs-adapter-date-fns v3.0.0 * https://www.chartjs.org * (c) 2022 chartjs-adapter-date-fns Contributors * Released under the MIT license - */const Tbt={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};K$._date.override({_id:"date-fns",formats:function(){return Tbt},parse:function(e,t){if(e===null||typeof e>"u")return null;const r=typeof e;return r==="number"||e instanceof Date?e=Jc(e):r==="string"&&(typeof t=="string"?e=nbt(e,t,new Date,this.options):e=lbt(e,this.options)),CH(e)?e.getTime():null},format:function(e,t){return axt(e,t,this.options)},add:function(e,t,r){switch(r){case"millisecond":return cL(e,t);case"second":return Zyt(e,t);case"minute":return qyt(e,t);case"hour":return Hyt(e,t);case"day":return KS(e,t);case"week":return Kyt(e,t);case"month":return lL(e,t);case"quarter":return Gyt(e,t);case"year":return Yyt(e,t);default:return e}},diff:function(e,t,r){switch(r){case"millisecond":return uL(e,t);case"second":return i_t(e,t);case"minute":return e_t(e,t);case"hour":return t_t(e,t);case"day":return AH(e,t);case"week":return a_t(e,t);case"month":return LH(e,t);case"quarter":return n_t(e,t);case"year":return o_t(e,t);default:return 0}},startOf:function(e,t,r){switch(t){case"second":return sbt(e);case"minute":return obt(e);case"hour":return abt(e);case"day":return p9(e);case"week":return zv(e);case"isoWeek":return zv(e,{weekStartsOn:+r});case"month":return l_t(e);case"quarter":return s_t(e);case"year":return PH(e);default:return e}},endOf:function(e,t){switch(t){case"second":return p_t(e);case"minute":return d_t(e);case"hour":return u_t(e);case"day":return MH(e);case"week":return h_t(e);case"month":return EH(e);case"quarter":return f_t(e);case"year":return c_t(e);default:return e}}});var CT={exports:{}},Sbt=CT.exports,MF;function Cbt(){return MF||(MF=1,function(e){var t={};(function(r,u){e.exports?e.exports=u():r.moduleName=u()})(typeof self<"u"?self:Sbt,()=>{var r=(()=>{var u=Object.create,T=Object.defineProperty,$=Object.defineProperties,K=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertyNames,St=Object.getOwnPropertySymbols,Ut=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,me=(et,Y,f)=>Y in et?T(et,Y,{enumerable:!0,configurable:!0,writable:!0,value:f}):et[Y]=f,we=(et,Y)=>{for(var f in Y||(Y={}))ne.call(Y,f)&&me(et,f,Y[f]);if(St)for(var f of St(Y))pe.call(Y,f)&&me(et,f,Y[f]);return et},Ce=(et,Y)=>$(et,ct(Y)),Ve=(et,Y)=>{var f={};for(var y in et)ne.call(et,y)&&Y.indexOf(y)<0&&(f[y]=et[y]);if(et!=null&&St)for(var y of St(et))Y.indexOf(y)<0&&pe.call(et,y)&&(f[y]=et[y]);return f},kr=(et,Y)=>()=>(et&&(Y=et(et=0)),Y),It=(et,Y)=>()=>(Y||et((Y={exports:{}}).exports,Y),Y.exports),rn=(et,Y)=>{for(var f in Y)T(et,f,{get:Y[f],enumerable:!0})},Lr=(et,Y,f,y)=>{if(Y&&typeof Y=="object"||typeof Y=="function")for(let z of yt(Y))!ne.call(et,z)&&z!==f&&T(et,z,{get:()=>Y[z],enumerable:!(y=K(Y,z))||y.enumerable});return et},Mr=(et,Y,f)=>(f=et!=null?u(Ut(et)):{},Lr(T(f,"default",{value:et,enumerable:!0}),et)),tn=et=>Lr(T({},"__esModule",{value:!0}),et),Dn=It(et=>{et.version="3.2.0"}),Mn=It((et,Y)=>{(function(f,y,z){y[f]=y[f]||z(),typeof Y<"u"&&Y.exports&&(Y.exports=y[f])})("Promise",typeof window<"u"?window:et,function(){var f,y,z,P=Object.prototype.toString,n=typeof setImmediate<"u"?function(A){return setImmediate(A)}:setTimeout;try{Object.defineProperty({},"x",{}),f=function(A,d,k,w){return Object.defineProperty(A,d,{value:k,writable:!0,configurable:w!==!1})}}catch{f=function(d,k,w){return d[k]=w,d}}z=function(){var A,d,k;function w(D,E){this.fn=D,this.self=E,this.next=void 0}return{add:function(D,E){k=new w(D,E),d?d.next=k:A=k,d=k,k=void 0},drain:function(){var D=A;for(A=d=y=void 0;D;)D.fn.call(D.self),D=D.next}}}();function i(A,d){z.add(A,d),y||(y=n(z.drain))}function a(A){var d,k=typeof A;return A!=null&&(k=="object"||k=="function")&&(d=A.then),typeof d=="function"?d:!1}function l(){for(var A=0;A0&&i(l,k))}catch(w){s.call(new m(k),w)}}}function s(A){var d=this;d.triggered||(d.triggered=!0,d.def&&(d=d.def),d.msg=A,d.state=2,d.chain.length>0&&i(l,d))}function h(A,d,k,w){for(var D=0;D{(function(){var f={version:"3.8.2"},y=[].slice,z=function(Et){return y.call(Et)},P=self.document;function n(Et){return Et&&(Et.ownerDocument||Et.document||Et).documentElement}function i(Et){return Et&&(Et.ownerDocument&&Et.ownerDocument.defaultView||Et.document&&Et||Et.defaultView)}if(P)try{z(P.documentElement.childNodes)[0].nodeType}catch{z=function(Vt){for(var de=Vt.length,Ie=new Array(de);de--;)Ie[de]=Vt[de];return Ie}}if(Date.now||(Date.now=function(){return+new Date}),P)try{P.createElement("DIV").style.setProperty("opacity",0,"")}catch{var a=this.Element.prototype,l=a.setAttribute,o=a.setAttributeNS,c=this.CSSStyleDeclaration.prototype,s=c.setProperty;a.setAttribute=function(Vt,de){l.call(this,Vt,de+"")},a.setAttributeNS=function(Vt,de,Ie){o.call(this,Vt,de,Ie+"")},c.setProperty=function(Vt,de,Ie){s.call(this,Vt,de+"",Ie)}}f.ascending=h;function h(Et,Vt){return EtVt?1:Et>=Vt?0:NaN}f.descending=function(Et,Vt){return VtEt?1:Vt>=Et?0:NaN},f.min=function(Et,Vt){var de=-1,Ie=Et.length,Be,He;if(arguments.length===1){for(;++de=He){Be=He;break}for(;++deHe&&(Be=He)}else{for(;++de=He){Be=He;break}for(;++deHe&&(Be=He)}return Be},f.max=function(Et,Vt){var de=-1,Ie=Et.length,Be,He;if(arguments.length===1){for(;++de=He){Be=He;break}for(;++deBe&&(Be=He)}else{for(;++de=He){Be=He;break}for(;++deBe&&(Be=He)}return Be},f.extent=function(Et,Vt){var de=-1,Ie=Et.length,Be,He,hr;if(arguments.length===1){for(;++de=He){Be=hr=He;break}for(;++deHe&&(Be=He),hr=He){Be=hr=He;break}for(;++deHe&&(Be=He),hr1)return hr/(Fr-1)},f.deviation=function(){var Et=f.variance.apply(this,arguments);return Et&&Math.sqrt(Et)};function x(Et){return{left:function(Vt,de,Ie,Be){for(arguments.length<3&&(Ie=0),arguments.length<4&&(Be=Vt.length);Ie>>1;Et(Vt[He],de)<0?Ie=He+1:Be=He}return Ie},right:function(Vt,de,Ie,Be){for(arguments.length<3&&(Ie=0),arguments.length<4&&(Be=Vt.length);Ie>>1;Et(Vt[He],de)>0?Be=He:Ie=He+1}return Ie}}}var _=x(h);f.bisectLeft=_.left,f.bisect=f.bisectRight=_.right,f.bisector=function(Et){return x(Et.length===1?function(Vt,de){return h(Et(Vt),de)}:Et)},f.shuffle=function(Et,Vt,de){(Ie=arguments.length)<3&&(de=Et.length,Ie<2&&(Vt=0));for(var Ie=de-Vt,Be,He;Ie;)He=Math.random()*Ie--|0,Be=Et[Ie+Vt],Et[Ie+Vt]=Et[He+Vt],Et[He+Vt]=Be;return Et},f.permute=function(Et,Vt){for(var de=Vt.length,Ie=new Array(de);de--;)Ie[de]=Et[Vt[de]];return Ie},f.pairs=function(Et){for(var Vt=0,de=Et.length-1,Ie,Be=Et[0],He=new Array(de<0?0:de);Vt=0;)for(hr=Et[Vt],de=hr.length;--de>=0;)He[--Be]=hr[de];return He};var d=Math.abs;f.range=function(Et,Vt,de){if(arguments.length<3&&(de=1,arguments.length<2&&(Vt=Et,Et=0)),(Vt-Et)/de===1/0)throw new Error("infinite range");var Ie=[],Be=k(d(de)),He=-1,hr;if(Et*=Be,Vt*=Be,de*=Be,de<0)for(;(hr=Et+de*++He)>Vt;)Ie.push(hr/Be);else for(;(hr=Et+de*++He)=Vt.length)return Be?Be.call(Et,Fr):Ie?Fr.sort(Ie):Fr;for(var fn=-1,Bn=Fr.length,ti=Vt[vn++],ei,ra,si,Oi=new D,$i;++fn=Vt.length)return cr;var vn=[],fn=de[Fr++];return cr.forEach(function(Bn,ti){vn.push({key:Bn,values:hr(ti,Fr)})}),fn?vn.sort(function(Bn,ti){return fn(Bn.key,ti.key)}):vn}return Et.map=function(cr,Fr){return He(Fr,cr,0)},Et.entries=function(cr){return hr(He(f.map,cr,0),0)},Et.key=function(cr){return Vt.push(cr),Et},Et.sortKeys=function(cr){return de[Vt.length-1]=cr,Et},Et.sortValues=function(cr){return Ie=cr,Et},Et.rollup=function(cr){return Be=cr,Et},Et},f.set=function(Et){var Vt=new U;if(Et)for(var de=0,Ie=Et.length;de=0&&(Ie=Et.slice(de+1),Et=Et.slice(0,de)),Et)return arguments.length<2?this[Et].on(Ie):this[Et].on(Ie,Vt);if(arguments.length===2){if(Vt==null)for(Et in this)this.hasOwnProperty(Et)&&this[Et].on(Ie,null);return this}};function tt(Et){var Vt=[],de=new D;function Ie(){for(var Be=Vt,He=-1,hr=Be.length,cr;++He=0&&(de=Et.slice(0,Vt))!=="xmlns"&&(Et=Et.slice(Vt+1)),Ct.hasOwnProperty(de)?{space:Ct[de],local:Et}:Et}},ot.attr=function(Et,Vt){if(arguments.length<2){if(typeof Et=="string"){var de=this.node();return Et=f.ns.qualify(Et),Et.local?de.getAttributeNS(Et.space,Et.local):de.getAttribute(Et)}for(Vt in Et)this.each(Rt(Vt,Et[Vt]));return this}return this.each(Rt(Et,Vt))};function Rt(Et,Vt){Et=f.ns.qualify(Et);function de(){this.removeAttribute(Et)}function Ie(){this.removeAttributeNS(Et.space,Et.local)}function Be(){this.setAttribute(Et,Vt)}function He(){this.setAttributeNS(Et.space,Et.local,Vt)}function hr(){var Fr=Vt.apply(this,arguments);Fr==null?this.removeAttribute(Et):this.setAttribute(Et,Fr)}function cr(){var Fr=Vt.apply(this,arguments);Fr==null?this.removeAttributeNS(Et.space,Et.local):this.setAttributeNS(Et.space,Et.local,Fr)}return Vt==null?Et.local?Ie:de:typeof Vt=="function"?Et.local?cr:hr:Et.local?He:Be}function Bt(Et){return Et.trim().replace(/\s+/g," ")}ot.classed=function(Et,Vt){if(arguments.length<2){if(typeof Et=="string"){var de=this.node(),Ie=(Et=Gt(Et)).length,Be=-1;if(Vt=de.classList){for(;++Be=0;)(He=de[Ie])&&(Be&&Be!==He.nextSibling&&Be.parentNode.insertBefore(He,Be),Be=He);return this},ot.sort=function(Et){Et=ie.apply(this,arguments);for(var Vt=-1,de=this.length;++Vt=Vt&&(Vt=Be+1);!(Fr=hr[Vt])&&++Vt0&&(Et=Et.slice(0,Be));var hr=mr.get(Et);hr&&(Et=hr,He=Jr);function cr(){var fn=this[Ie];fn&&(this.removeEventListener(Et,fn,fn.$),delete this[Ie])}function Fr(){var fn=He(Vt,z(arguments));cr.call(this),this.addEventListener(Et,this[Ie]=fn,fn.$=de),fn._=Vt}function vn(){var fn=new RegExp("^__on([^.]+)"+f.requote(Et)+"$"),Bn;for(var ti in this)if(Bn=ti.match(fn)){var ei=this[ti];this.removeEventListener(Bn[1],ei,ei.$),delete this[ti]}}return Be?Vt?Fr:cr:Vt?q:vn}var mr=f.map({mouseenter:"mouseover",mouseleave:"mouseout"});P&&mr.forEach(function(Et){"on"+Et in P&&mr.remove(Et)});function fr(Et,Vt){return function(de){var Ie=f.event;f.event=de,Vt[0]=this.__data__;try{Et.apply(this,Vt)}finally{f.event=Ie}}}function Jr(Et,Vt){var de=fr(Et,Vt);return function(Ie){var Be=this,He=Ie.relatedTarget;(!He||He!==Be&&!(He.compareDocumentPosition(Be)&8))&&de.call(Be,Ie)}}var an,Er=0;function dn(Et){var Vt=".dragsuppress-"+ ++Er,de="click"+Vt,Ie=f.select(i(Et)).on("touchmove"+Vt,ht).on("dragstart"+Vt,ht).on("selectstart"+Vt,ht);if(an==null&&(an="onselectstart"in Et?!1:F(Et.style,"userSelect")),an){var Be=n(Et).style,He=Be[an];Be[an]="none"}return function(hr){if(Ie.on(Vt,null),an&&(Be[an]=He),hr){var cr=function(){Ie.on(de,null)};Ie.on(de,function(){ht(),cr()},!0),setTimeout(cr,0)}}}f.mouse=function(Et){return Oe(Et,bt())};var _n=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Oe(Et,Vt){Vt.changedTouches&&(Vt=Vt.changedTouches[0]);var de=Et.ownerSVGElement||Et;if(de.createSVGPoint){var Ie=de.createSVGPoint();if(_n<0){var Be=i(Et);if(Be.scrollX||Be.scrollY){de=f.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var He=de[0][0].getScreenCTM();_n=!(He.f||He.e),de.remove()}}return _n?(Ie.x=Vt.pageX,Ie.y=Vt.pageY):(Ie.x=Vt.clientX,Ie.y=Vt.clientY),Ie=Ie.matrixTransform(Et.getScreenCTM().inverse()),[Ie.x,Ie.y]}var hr=Et.getBoundingClientRect();return[Vt.clientX-hr.left-Et.clientLeft,Vt.clientY-hr.top-Et.clientTop]}f.touch=function(Et,Vt,de){if(arguments.length<3&&(de=Vt,Vt=bt().changedTouches),Vt){for(var Ie=0,Be=Vt.length,He;Ie1?ae:Et<-1?-ae:Math.asin(Et)}function ur(Et){return((Et=Math.exp(Et))-1/Et)/2}function Rr(Et){return((Et=Math.exp(Et))+1/Et)/2}function zr(Et){return((Et=Math.exp(2*Et))-1)/(Et+1)}var xr=Math.SQRT2,pn=2,ci=4;f.interpolateZoom=function(Et,Vt){var de=Et[0],Ie=Et[1],Be=Et[2],He=Vt[0],hr=Vt[1],cr=Vt[2],Fr=He-de,vn=hr-Ie,fn=Fr*Fr+vn*vn,Bn,ti;if(fn0&&(zo=zo.transition().duration(hr)),zo.call(sa.event)}function Ko(){Oi&&Oi.domain(si.range().map(function(zo){return(zo-Et.x)/Et.k}).map(si.invert)),Ki&&Ki.domain($i.range().map(function(zo){return(zo-Et.y)/Et.k}).map($i.invert))}function rs(zo){cr++||zo({type:"zoomstart"})}function _l(zo){Ko(),zo({type:"zoom",scale:Et.k,translate:[Et.x,Et.y]})}function as(zo){--cr||(zo({type:"zoomend"}),de=null)}function Ts(){var zo=this,il=ra.of(zo,arguments),ml=0,yc=f.select(i(zo)).on(vn,Yl).on(fn,hc),oc=vi(f.mouse(zo)),ph=dn(zo);Qi.call(zo),rs(il);function Yl(){ml=1,xo(f.mouse(zo),oc),_l(il)}function hc(){yc.on(vn,null).on(fn,null),ph(ml),as(il)}}function Bl(){var zo=this,il=ra.of(zo,arguments),ml={},yc=0,oc,ph=".zoom-"+f.event.changedTouches[0].identifier,Yl="touchmove"+ph,hc="touchend"+ph,zh=[],Se=f.select(zo),Ir=dn(zo);ri(),rs(il),Se.on(Fr,null).on(ti,ri);function Vr(){var On=f.touches(zo);return oc=Et.k,On.forEach(function(Si){Si.identifier in ml&&(ml[Si.identifier]=vi(Si))}),On}function ri(){var On=f.event.target;f.select(On).on(Yl,Ai).on(hc,bi),zh.push(On);for(var Si=f.event.changedTouches,ha=0,ia=Si.length;ha1){var to=Ia[0],ma=Ia[1],ji=to[0]-ma[0],En=to[1]-ma[1];yc=ji*ji+En*En}}function Ai(){var On=f.touches(zo),Si,ha,ia,Ia;Qi.call(zo);for(var co=0,to=On.length;co1?1:Vt,de=de<0?0:de>1?1:de,Be=de<=.5?de*(1+Vt):de+Vt-de*Vt,Ie=2*de-Be;function He(cr){return cr>360?cr-=360:cr<0&&(cr+=360),cr<60?Ie+(Be-Ie)*cr/60:cr<180?Be:cr<240?Ie+(Be-Ie)*(240-cr)/60:Ie}function hr(cr){return Math.round(He(cr)*255)}return new Ga(hr(Et+120),hr(Et),hr(Et-120))}f.hcl=Ke;function Ke(Et,Vt,de){return this instanceof Ke?(this.h=+Et,this.c=+Vt,void(this.l=+de)):arguments.length<2?Et instanceof Ke?new Ke(Et.h,Et.c,Et.l):Et instanceof Ar?Zi(Et.l,Et.a,Et.b):Zi((Et=Yr((Et=f.rgb(Et)).r,Et.g,Et.b)).l,Et.a,Et.b):new Ke(Et,Vt,de)}var sr=Ke.prototype=new Ci;sr.brighter=function(Et){return new Ke(this.h,this.c,Math.min(100,this.l+mn*(arguments.length?Et:1)))},sr.darker=function(Et){return new Ke(this.h,this.c,Math.max(0,this.l-mn*(arguments.length?Et:1)))},sr.rgb=function(){return vr(this.h,this.c,this.l).rgb()};function vr(Et,Vt,de){return isNaN(Et)&&(Et=0),isNaN(Vt)&&(Vt=0),new Ar(de,Math.cos(Et*=he)*Vt,Math.sin(Et)*Vt)}f.lab=Ar;function Ar(Et,Vt,de){return this instanceof Ar?(this.l=+Et,this.a=+Vt,void(this.b=+de)):arguments.length<2?Et instanceof Ar?new Ar(Et.l,Et.a,Et.b):Et instanceof Ke?vr(Et.h,Et.c,Et.l):Yr((Et=Ga(Et)).r,Et.g,Et.b):new Ar(Et,Vt,de)}var mn=18,Zn=.95047,Un=1,Wn=1.08883,Li=Ar.prototype=new Ci;Li.brighter=function(Et){return new Ar(Math.min(100,this.l+mn*(arguments.length?Et:1)),this.a,this.b)},Li.darker=function(Et){return new Ar(Math.max(0,this.l-mn*(arguments.length?Et:1)),this.a,this.b)},Li.rgb=function(){return Fi(this.l,this.a,this.b)};function Fi(Et,Vt,de){var Ie=(Et+16)/116,Be=Ie+Vt/500,He=Ie-de/200;return Be=Ji(Be)*Zn,Ie=Ji(Ie)*Un,He=Ji(He)*Wn,new Ga(Ei(3.2404542*Be-1.5371385*Ie-.4985314*He),Ei(-.969266*Be+1.8760108*Ie+.041556*He),Ei(.0556434*Be-.2040259*Ie+1.0572252*He))}function Zi(Et,Vt,de){return Et>0?new Ke(Math.atan2(de,Vt)*Me,Math.sqrt(Vt*Vt+de*de),Et):new Ke(NaN,NaN,Et)}function Ji(Et){return Et>.206893034?Et*Et*Et:(Et-4/29)/7.787037}function ca(Et){return Et>.008856?Math.pow(Et,1/3):7.787037*Et+4/29}function Ei(Et){return Math.round(255*(Et<=.00304?12.92*Et:1.055*Math.pow(Et,1/2.4)-.055))}f.rgb=Ga;function Ga(Et,Vt,de){return this instanceof Ga?(this.r=~~Et,this.g=~~Vt,void(this.b=~~de)):arguments.length<2?Et instanceof Ga?new Ga(Et.r,Et.g,Et.b):sn(""+Et,Ga,oa):new Ga(Et,Vt,de)}function so(Et){return new Ga(Et>>16,Et>>8&255,Et&255)}function Fe(Et){return so(Et)+""}var Re=Ga.prototype=new Ci;Re.brighter=function(Et){Et=Math.pow(.7,arguments.length?Et:1);var Vt=this.r,de=this.g,Ie=this.b,Be=30;return!Vt&&!de&&!Ie?new Ga(Be,Be,Be):(Vt&&Vt>4,Ie=Ie>>4|Ie,Be=Fr&240,Be=Be>>4|Be,He=Fr&15,He=He<<4|He):Et.length===7&&(Ie=(Fr&16711680)>>16,Be=(Fr&65280)>>8,He=Fr&255)),Vt(Ie,Be,He))}function cn(Et,Vt,de){var Ie=Math.min(Et/=255,Vt/=255,de/=255),Be=Math.max(Et,Vt,de),He=Be-Ie,hr,cr,Fr=(Be+Ie)/2;return He?(cr=Fr<.5?He/(Be+Ie):He/(2-Be-Ie),Et==Be?hr=(Vt-de)/He+(Vt0&&Fr<1?0:hr),new fi(hr,cr,Fr)}function Yr(Et,Vt,de){Et=un(Et),Vt=un(Vt),de=un(de);var Ie=ca((.4124564*Et+.3575761*Vt+.1804375*de)/Zn),Be=ca((.2126729*Et+.7151522*Vt+.072175*de)/Un),He=ca((.0193339*Et+.119192*Vt+.9503041*de)/Wn);return Ar(116*Be-16,500*(Ie-Be),200*(Be-He))}function un(Et){return(Et/=255)<=.04045?Et/12.92:Math.pow((Et+.055)/1.055,2.4)}function Pn(Et){var Vt=parseFloat(Et);return Et.charAt(Et.length-1)==="%"?Math.round(Vt*2.55):Vt}var bn=f.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});bn.forEach(function(Et,Vt){bn.set(Et,so(Vt))});function ze(Et){return typeof Et=="function"?Et:function(){return Et}}f.functor=ze,f.xhr=yr(V);function yr(Et){return function(Vt,de,Ie){return arguments.length===2&&typeof de=="function"&&(Ie=de,de=null),en(Vt,de,Et,Ie)}}function en(Et,Vt,de,Ie){var Be={},He=f.dispatch("beforesend","progress","load","error"),hr={},cr=new XMLHttpRequest,Fr=null;self.XDomainRequest&&!("withCredentials"in cr)&&/^(http(s)?:)?\/\//.test(Et)&&(cr=new XDomainRequest),"onload"in cr?cr.onload=cr.onerror=vn:cr.onreadystatechange=function(){cr.readyState>3&&vn()};function vn(){var fn=cr.status,Bn;if(!fn&&ni(cr)||fn>=200&&fn<300||fn===304){try{Bn=de.call(Be,cr)}catch(ti){He.error.call(Be,ti);return}He.load.call(Be,Bn)}else He.error.call(Be,cr)}return cr.onprogress=function(fn){var Bn=f.event;f.event=fn;try{He.progress.call(Be,cr)}finally{f.event=Bn}},Be.header=function(fn,Bn){return fn=(fn+"").toLowerCase(),arguments.length<2?hr[fn]:(Bn==null?delete hr[fn]:hr[fn]=Bn+"",Be)},Be.mimeType=function(fn){return arguments.length?(Vt=fn==null?null:fn+"",Be):Vt},Be.responseType=function(fn){return arguments.length?(Fr=fn,Be):Fr},Be.response=function(fn){return de=fn,Be},["get","post"].forEach(function(fn){Be[fn]=function(){return Be.send.apply(Be,[fn].concat(z(arguments)))}}),Be.send=function(fn,Bn,ti){if(arguments.length===2&&typeof Bn=="function"&&(ti=Bn,Bn=null),cr.open(fn,Et,!0),Vt!=null&&!("accept"in hr)&&(hr.accept=Vt+",*/*"),cr.setRequestHeader)for(var ei in hr)cr.setRequestHeader(ei,hr[ei]);return Vt!=null&&cr.overrideMimeType&&cr.overrideMimeType(Vt),Fr!=null&&(cr.responseType=Fr),ti!=null&&Be.on("error",ti).on("load",function(ra){ti(null,ra)}),He.beforesend.call(Be,cr),cr.send(Bn??null),Be},Be.abort=function(){return cr.abort(),Be},f.rebind(Be,He,"on"),Ie==null?Be:Be.get(Rn(Ie))}function Rn(Et){return Et.length===1?function(Vt,de){Et(Vt==null?de:null)}:Et}function ni(Et){var Vt=Et.responseType;return Vt&&Vt!=="text"?Et.response:Et.responseText}f.dsv=function(Et,Vt){var de=new RegExp('["'+Et+` -]`),Ie=Et.charCodeAt(0);function Be(vn,fn,Bn){arguments.length<3&&(Bn=fn,fn=null);var ti=en(vn,Vt,fn==null?He:hr(fn),Bn);return ti.row=function(ei){return arguments.length?ti.response((fn=ei)==null?He:hr(ei)):fn},ti}function He(vn){return Be.parse(vn.responseText)}function hr(vn){return function(fn){return Be.parse(fn.responseText,vn)}}Be.parse=function(vn,fn){var Bn;return Be.parseRows(vn,function(ti,ei){if(Bn)return Bn(ti,ei-1);var ra=function(si){for(var Oi={},$i=ti.length,Ki=0;Ki<$i;++Ki)Oi[ti[Ki]]=si[Ki];return Oi};Bn=fn?function(si,Oi){return fn(ra(si),Oi)}:ra})},Be.parseRows=function(vn,fn){var Bn={},ti={},ei=[],ra=vn.length,si=0,Oi=0,$i,Ki;function sa(){if(si>=ra)return ti;if(Ki)return Ki=!1,Bn;var ro=si;if(vn.charCodeAt(ro)===34){for(var ao=ro;ao++"u")return null;const r=typeof e;return r==="number"||e instanceof Date?e=Jc(e):r==="string"&&(typeof t=="string"?e=ibt(e,t,new Date,this.options):e=cbt(e,this.options)),CH(e)?e.getTime():null},format:function(e,t){return oxt(e,t,this.options)},add:function(e,t,r){switch(r){case"millisecond":return cL(e,t);case"second":return Kyt(e,t);case"minute":return Gyt(e,t);case"hour":return Vyt(e,t);case"day":return KS(e,t);case"week":return Yyt(e,t);case"month":return lL(e,t);case"quarter":return Zyt(e,t);case"year":return Xyt(e,t);default:return e}},diff:function(e,t,r){switch(r){case"millisecond":return uL(e,t);case"second":return a_t(e,t);case"minute":return r_t(e,t);case"hour":return e_t(e,t);case"day":return AH(e,t);case"week":return o_t(e,t);case"month":return LH(e,t);case"quarter":return i_t(e,t);case"year":return s_t(e,t);default:return 0}},startOf:function(e,t,r){switch(t){case"second":return lbt(e);case"minute":return sbt(e);case"hour":return obt(e);case"day":return p9(e);case"week":return zv(e);case"isoWeek":return zv(e,{weekStartsOn:+r});case"month":return c_t(e);case"quarter":return l_t(e);case"year":return PH(e);default:return e}},endOf:function(e,t){switch(t){case"second":return m_t(e);case"minute":return f_t(e);case"hour":return h_t(e);case"day":return MH(e);case"week":return d_t(e);case"month":return EH(e);case"quarter":return p_t(e);case"year":return u_t(e);default:return e}}});var CT={exports:{}},Cbt=CT.exports,MF;function Abt(){return MF||(MF=1,function(e){var t={};(function(r,u){e.exports?e.exports=u():r.moduleName=u()})(typeof self<"u"?self:Cbt,()=>{var r=(()=>{var u=Object.create,T=Object.defineProperty,$=Object.defineProperties,K=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertyNames,St=Object.getOwnPropertySymbols,Ut=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,me=(et,Y,f)=>Y in et?T(et,Y,{enumerable:!0,configurable:!0,writable:!0,value:f}):et[Y]=f,we=(et,Y)=>{for(var f in Y||(Y={}))ne.call(Y,f)&&me(et,f,Y[f]);if(St)for(var f of St(Y))pe.call(Y,f)&&me(et,f,Y[f]);return et},Ce=(et,Y)=>$(et,ct(Y)),Ve=(et,Y)=>{var f={};for(var y in et)ne.call(et,y)&&Y.indexOf(y)<0&&(f[y]=et[y]);if(et!=null&&St)for(var y of St(et))Y.indexOf(y)<0&&pe.call(et,y)&&(f[y]=et[y]);return f},kr=(et,Y)=>()=>(et&&(Y=et(et=0)),Y),It=(et,Y)=>()=>(Y||et((Y={exports:{}}).exports,Y),Y.exports),rn=(et,Y)=>{for(var f in Y)T(et,f,{get:Y[f],enumerable:!0})},Lr=(et,Y,f,y)=>{if(Y&&typeof Y=="object"||typeof Y=="function")for(let z of yt(Y))!ne.call(et,z)&&z!==f&&T(et,z,{get:()=>Y[z],enumerable:!(y=K(Y,z))||y.enumerable});return et},Mr=(et,Y,f)=>(f=et!=null?u(Ut(et)):{},Lr(T(f,"default",{value:et,enumerable:!0}),et)),tn=et=>Lr(T({},"__esModule",{value:!0}),et),Dn=It(et=>{et.version="3.2.0"}),Mn=It((et,Y)=>{(function(f,y,z){y[f]=y[f]||z(),typeof Y<"u"&&Y.exports&&(Y.exports=y[f])})("Promise",typeof window<"u"?window:et,function(){var f,y,z,P=Object.prototype.toString,n=typeof setImmediate<"u"?function(A){return setImmediate(A)}:setTimeout;try{Object.defineProperty({},"x",{}),f=function(A,d,k,w){return Object.defineProperty(A,d,{value:k,writable:!0,configurable:w!==!1})}}catch{f=function(d,k,w){return d[k]=w,d}}z=function(){var A,d,k;function w(D,E){this.fn=D,this.self=E,this.next=void 0}return{add:function(D,E){k=new w(D,E),d?d.next=k:A=k,d=k,k=void 0},drain:function(){var D=A;for(A=d=y=void 0;D;)D.fn.call(D.self),D=D.next}}}();function i(A,d){z.add(A,d),y||(y=n(z.drain))}function a(A){var d,k=typeof A;return A!=null&&(k=="object"||k=="function")&&(d=A.then),typeof d=="function"?d:!1}function l(){for(var A=0;A0&&i(l,k))}catch(w){s.call(new m(k),w)}}}function s(A){var d=this;d.triggered||(d.triggered=!0,d.def&&(d=d.def),d.msg=A,d.state=2,d.chain.length>0&&i(l,d))}function h(A,d,k,w){for(var D=0;D{(function(){var f={version:"3.8.2"},y=[].slice,z=function(Et){return y.call(Et)},P=self.document;function n(Et){return Et&&(Et.ownerDocument||Et.document||Et).documentElement}function i(Et){return Et&&(Et.ownerDocument&&Et.ownerDocument.defaultView||Et.document&&Et||Et.defaultView)}if(P)try{z(P.documentElement.childNodes)[0].nodeType}catch{z=function(Vt){for(var de=Vt.length,Ie=new Array(de);de--;)Ie[de]=Vt[de];return Ie}}if(Date.now||(Date.now=function(){return+new Date}),P)try{P.createElement("DIV").style.setProperty("opacity",0,"")}catch{var a=this.Element.prototype,l=a.setAttribute,o=a.setAttributeNS,c=this.CSSStyleDeclaration.prototype,s=c.setProperty;a.setAttribute=function(Vt,de){l.call(this,Vt,de+"")},a.setAttributeNS=function(Vt,de,Ie){o.call(this,Vt,de,Ie+"")},c.setProperty=function(Vt,de,Ie){s.call(this,Vt,de+"",Ie)}}f.ascending=h;function h(Et,Vt){return EtVt?1:Et>=Vt?0:NaN}f.descending=function(Et,Vt){return VtEt?1:Vt>=Et?0:NaN},f.min=function(Et,Vt){var de=-1,Ie=Et.length,Be,He;if(arguments.length===1){for(;++de=He){Be=He;break}for(;++deHe&&(Be=He)}else{for(;++de=He){Be=He;break}for(;++deHe&&(Be=He)}return Be},f.max=function(Et,Vt){var de=-1,Ie=Et.length,Be,He;if(arguments.length===1){for(;++de=He){Be=He;break}for(;++deBe&&(Be=He)}else{for(;++de=He){Be=He;break}for(;++deBe&&(Be=He)}return Be},f.extent=function(Et,Vt){var de=-1,Ie=Et.length,Be,He,hr;if(arguments.length===1){for(;++de=He){Be=hr=He;break}for(;++deHe&&(Be=He),hr=He){Be=hr=He;break}for(;++deHe&&(Be=He),hr1)return hr/(Fr-1)},f.deviation=function(){var Et=f.variance.apply(this,arguments);return Et&&Math.sqrt(Et)};function x(Et){return{left:function(Vt,de,Ie,Be){for(arguments.length<3&&(Ie=0),arguments.length<4&&(Be=Vt.length);Ie>>1;Et(Vt[He],de)<0?Ie=He+1:Be=He}return Ie},right:function(Vt,de,Ie,Be){for(arguments.length<3&&(Ie=0),arguments.length<4&&(Be=Vt.length);Ie>>1;Et(Vt[He],de)>0?Be=He:Ie=He+1}return Ie}}}var _=x(h);f.bisectLeft=_.left,f.bisect=f.bisectRight=_.right,f.bisector=function(Et){return x(Et.length===1?function(Vt,de){return h(Et(Vt),de)}:Et)},f.shuffle=function(Et,Vt,de){(Ie=arguments.length)<3&&(de=Et.length,Ie<2&&(Vt=0));for(var Ie=de-Vt,Be,He;Ie;)He=Math.random()*Ie--|0,Be=Et[Ie+Vt],Et[Ie+Vt]=Et[He+Vt],Et[He+Vt]=Be;return Et},f.permute=function(Et,Vt){for(var de=Vt.length,Ie=new Array(de);de--;)Ie[de]=Et[Vt[de]];return Ie},f.pairs=function(Et){for(var Vt=0,de=Et.length-1,Ie,Be=Et[0],He=new Array(de<0?0:de);Vt=0;)for(hr=Et[Vt],de=hr.length;--de>=0;)He[--Be]=hr[de];return He};var d=Math.abs;f.range=function(Et,Vt,de){if(arguments.length<3&&(de=1,arguments.length<2&&(Vt=Et,Et=0)),(Vt-Et)/de===1/0)throw new Error("infinite range");var Ie=[],Be=k(d(de)),He=-1,hr;if(Et*=Be,Vt*=Be,de*=Be,de<0)for(;(hr=Et+de*++He)>Vt;)Ie.push(hr/Be);else for(;(hr=Et+de*++He)=Vt.length)return Be?Be.call(Et,Fr):Ie?Fr.sort(Ie):Fr;for(var fn=-1,Bn=Fr.length,ti=Vt[vn++],ei,ra,si,Oi=new D,$i;++fn=Vt.length)return cr;var vn=[],fn=de[Fr++];return cr.forEach(function(Bn,ti){vn.push({key:Bn,values:hr(ti,Fr)})}),fn?vn.sort(function(Bn,ti){return fn(Bn.key,ti.key)}):vn}return Et.map=function(cr,Fr){return He(Fr,cr,0)},Et.entries=function(cr){return hr(He(f.map,cr,0),0)},Et.key=function(cr){return Vt.push(cr),Et},Et.sortKeys=function(cr){return de[Vt.length-1]=cr,Et},Et.sortValues=function(cr){return Ie=cr,Et},Et.rollup=function(cr){return Be=cr,Et},Et},f.set=function(Et){var Vt=new U;if(Et)for(var de=0,Ie=Et.length;de=0&&(Ie=Et.slice(de+1),Et=Et.slice(0,de)),Et)return arguments.length<2?this[Et].on(Ie):this[Et].on(Ie,Vt);if(arguments.length===2){if(Vt==null)for(Et in this)this.hasOwnProperty(Et)&&this[Et].on(Ie,null);return this}};function tt(Et){var Vt=[],de=new D;function Ie(){for(var Be=Vt,He=-1,hr=Be.length,cr;++He=0&&(de=Et.slice(0,Vt))!=="xmlns"&&(Et=Et.slice(Vt+1)),Ct.hasOwnProperty(de)?{space:Ct[de],local:Et}:Et}},ot.attr=function(Et,Vt){if(arguments.length<2){if(typeof Et=="string"){var de=this.node();return Et=f.ns.qualify(Et),Et.local?de.getAttributeNS(Et.space,Et.local):de.getAttribute(Et)}for(Vt in Et)this.each(Rt(Vt,Et[Vt]));return this}return this.each(Rt(Et,Vt))};function Rt(Et,Vt){Et=f.ns.qualify(Et);function de(){this.removeAttribute(Et)}function Ie(){this.removeAttributeNS(Et.space,Et.local)}function Be(){this.setAttribute(Et,Vt)}function He(){this.setAttributeNS(Et.space,Et.local,Vt)}function hr(){var Fr=Vt.apply(this,arguments);Fr==null?this.removeAttribute(Et):this.setAttribute(Et,Fr)}function cr(){var Fr=Vt.apply(this,arguments);Fr==null?this.removeAttributeNS(Et.space,Et.local):this.setAttributeNS(Et.space,Et.local,Fr)}return Vt==null?Et.local?Ie:de:typeof Vt=="function"?Et.local?cr:hr:Et.local?He:Be}function Bt(Et){return Et.trim().replace(/\s+/g," ")}ot.classed=function(Et,Vt){if(arguments.length<2){if(typeof Et=="string"){var de=this.node(),Ie=(Et=Gt(Et)).length,Be=-1;if(Vt=de.classList){for(;++Be=0;)(He=de[Ie])&&(Be&&Be!==He.nextSibling&&Be.parentNode.insertBefore(He,Be),Be=He);return this},ot.sort=function(Et){Et=ie.apply(this,arguments);for(var Vt=-1,de=this.length;++Vt=Vt&&(Vt=Be+1);!(Fr=hr[Vt])&&++Vt0&&(Et=Et.slice(0,Be));var hr=mr.get(Et);hr&&(Et=hr,He=Jr);function cr(){var fn=this[Ie];fn&&(this.removeEventListener(Et,fn,fn.$),delete this[Ie])}function Fr(){var fn=He(Vt,z(arguments));cr.call(this),this.addEventListener(Et,this[Ie]=fn,fn.$=de),fn._=Vt}function vn(){var fn=new RegExp("^__on([^.]+)"+f.requote(Et)+"$"),Bn;for(var ti in this)if(Bn=ti.match(fn)){var ei=this[ti];this.removeEventListener(Bn[1],ei,ei.$),delete this[ti]}}return Be?Vt?Fr:cr:Vt?q:vn}var mr=f.map({mouseenter:"mouseover",mouseleave:"mouseout"});P&&mr.forEach(function(Et){"on"+Et in P&&mr.remove(Et)});function fr(Et,Vt){return function(de){var Ie=f.event;f.event=de,Vt[0]=this.__data__;try{Et.apply(this,Vt)}finally{f.event=Ie}}}function Jr(Et,Vt){var de=fr(Et,Vt);return function(Ie){var Be=this,He=Ie.relatedTarget;(!He||He!==Be&&!(He.compareDocumentPosition(Be)&8))&&de.call(Be,Ie)}}var an,Er=0;function dn(Et){var Vt=".dragsuppress-"+ ++Er,de="click"+Vt,Ie=f.select(i(Et)).on("touchmove"+Vt,ht).on("dragstart"+Vt,ht).on("selectstart"+Vt,ht);if(an==null&&(an="onselectstart"in Et?!1:F(Et.style,"userSelect")),an){var Be=n(Et).style,He=Be[an];Be[an]="none"}return function(hr){if(Ie.on(Vt,null),an&&(Be[an]=He),hr){var cr=function(){Ie.on(de,null)};Ie.on(de,function(){ht(),cr()},!0),setTimeout(cr,0)}}}f.mouse=function(Et){return Oe(Et,bt())};var _n=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Oe(Et,Vt){Vt.changedTouches&&(Vt=Vt.changedTouches[0]);var de=Et.ownerSVGElement||Et;if(de.createSVGPoint){var Ie=de.createSVGPoint();if(_n<0){var Be=i(Et);if(Be.scrollX||Be.scrollY){de=f.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var He=de[0][0].getScreenCTM();_n=!(He.f||He.e),de.remove()}}return _n?(Ie.x=Vt.pageX,Ie.y=Vt.pageY):(Ie.x=Vt.clientX,Ie.y=Vt.clientY),Ie=Ie.matrixTransform(Et.getScreenCTM().inverse()),[Ie.x,Ie.y]}var hr=Et.getBoundingClientRect();return[Vt.clientX-hr.left-Et.clientLeft,Vt.clientY-hr.top-Et.clientTop]}f.touch=function(Et,Vt,de){if(arguments.length<3&&(de=Vt,Vt=bt().changedTouches),Vt){for(var Ie=0,Be=Vt.length,He;Ie1?ae:Et<-1?-ae:Math.asin(Et)}function ur(Et){return((Et=Math.exp(Et))-1/Et)/2}function Rr(Et){return((Et=Math.exp(Et))+1/Et)/2}function zr(Et){return((Et=Math.exp(2*Et))-1)/(Et+1)}var xr=Math.SQRT2,pn=2,ci=4;f.interpolateZoom=function(Et,Vt){var de=Et[0],Ie=Et[1],Be=Et[2],He=Vt[0],hr=Vt[1],cr=Vt[2],Fr=He-de,vn=hr-Ie,fn=Fr*Fr+vn*vn,Bn,ti;if(fn0&&(zo=zo.transition().duration(hr)),zo.call(sa.event)}function Ko(){Oi&&Oi.domain(si.range().map(function(zo){return(zo-Et.x)/Et.k}).map(si.invert)),Ki&&Ki.domain($i.range().map(function(zo){return(zo-Et.y)/Et.k}).map($i.invert))}function rs(zo){cr++||zo({type:"zoomstart"})}function _l(zo){Ko(),zo({type:"zoom",scale:Et.k,translate:[Et.x,Et.y]})}function as(zo){--cr||(zo({type:"zoomend"}),de=null)}function Ts(){var zo=this,il=ra.of(zo,arguments),ml=0,yc=f.select(i(zo)).on(vn,Yl).on(fn,hc),oc=vi(f.mouse(zo)),ph=dn(zo);Qi.call(zo),rs(il);function Yl(){ml=1,xo(f.mouse(zo),oc),_l(il)}function hc(){yc.on(vn,null).on(fn,null),ph(ml),as(il)}}function Bl(){var zo=this,il=ra.of(zo,arguments),ml={},yc=0,oc,ph=".zoom-"+f.event.changedTouches[0].identifier,Yl="touchmove"+ph,hc="touchend"+ph,zh=[],Se=f.select(zo),Ir=dn(zo);ri(),rs(il),Se.on(Fr,null).on(ti,ri);function Vr(){var On=f.touches(zo);return oc=Et.k,On.forEach(function(Si){Si.identifier in ml&&(ml[Si.identifier]=vi(Si))}),On}function ri(){var On=f.event.target;f.select(On).on(Yl,Ai).on(hc,bi),zh.push(On);for(var Si=f.event.changedTouches,ha=0,aa=Si.length;ha1){var eo=Ia[0],ma=Ia[1],ji=eo[0]-ma[0],En=eo[1]-ma[1];yc=ji*ji+En*En}}function Ai(){var On=f.touches(zo),Si,ha,aa,Ia;Qi.call(zo);for(var co=0,eo=On.length;co1?1:Vt,de=de<0?0:de>1?1:de,Be=de<=.5?de*(1+Vt):de+Vt-de*Vt,Ie=2*de-Be;function He(cr){return cr>360?cr-=360:cr<0&&(cr+=360),cr<60?Ie+(Be-Ie)*cr/60:cr<180?Be:cr<240?Ie+(Be-Ie)*(240-cr)/60:Ie}function hr(cr){return Math.round(He(cr)*255)}return new Ga(hr(Et+120),hr(Et),hr(Et-120))}f.hcl=Ke;function Ke(Et,Vt,de){return this instanceof Ke?(this.h=+Et,this.c=+Vt,void(this.l=+de)):arguments.length<2?Et instanceof Ke?new Ke(Et.h,Et.c,Et.l):Et instanceof Ar?Zi(Et.l,Et.a,Et.b):Zi((Et=Yr((Et=f.rgb(Et)).r,Et.g,Et.b)).l,Et.a,Et.b):new Ke(Et,Vt,de)}var sr=Ke.prototype=new Ci;sr.brighter=function(Et){return new Ke(this.h,this.c,Math.min(100,this.l+mn*(arguments.length?Et:1)))},sr.darker=function(Et){return new Ke(this.h,this.c,Math.max(0,this.l-mn*(arguments.length?Et:1)))},sr.rgb=function(){return vr(this.h,this.c,this.l).rgb()};function vr(Et,Vt,de){return isNaN(Et)&&(Et=0),isNaN(Vt)&&(Vt=0),new Ar(de,Math.cos(Et*=he)*Vt,Math.sin(Et)*Vt)}f.lab=Ar;function Ar(Et,Vt,de){return this instanceof Ar?(this.l=+Et,this.a=+Vt,void(this.b=+de)):arguments.length<2?Et instanceof Ar?new Ar(Et.l,Et.a,Et.b):Et instanceof Ke?vr(Et.h,Et.c,Et.l):Yr((Et=Ga(Et)).r,Et.g,Et.b):new Ar(Et,Vt,de)}var mn=18,Zn=.95047,Un=1,Wn=1.08883,Li=Ar.prototype=new Ci;Li.brighter=function(Et){return new Ar(Math.min(100,this.l+mn*(arguments.length?Et:1)),this.a,this.b)},Li.darker=function(Et){return new Ar(Math.max(0,this.l-mn*(arguments.length?Et:1)),this.a,this.b)},Li.rgb=function(){return Fi(this.l,this.a,this.b)};function Fi(Et,Vt,de){var Ie=(Et+16)/116,Be=Ie+Vt/500,He=Ie-de/200;return Be=Ji(Be)*Zn,Ie=Ji(Ie)*Un,He=Ji(He)*Wn,new Ga(Ei(3.2404542*Be-1.5371385*Ie-.4985314*He),Ei(-.969266*Be+1.8760108*Ie+.041556*He),Ei(.0556434*Be-.2040259*Ie+1.0572252*He))}function Zi(Et,Vt,de){return Et>0?new Ke(Math.atan2(de,Vt)*Me,Math.sqrt(Vt*Vt+de*de),Et):new Ke(NaN,NaN,Et)}function Ji(Et){return Et>.206893034?Et*Et*Et:(Et-4/29)/7.787037}function ca(Et){return Et>.008856?Math.pow(Et,1/3):7.787037*Et+4/29}function Ei(Et){return Math.round(255*(Et<=.00304?12.92*Et:1.055*Math.pow(Et,1/2.4)-.055))}f.rgb=Ga;function Ga(Et,Vt,de){return this instanceof Ga?(this.r=~~Et,this.g=~~Vt,void(this.b=~~de)):arguments.length<2?Et instanceof Ga?new Ga(Et.r,Et.g,Et.b):sn(""+Et,Ga,oa):new Ga(Et,Vt,de)}function so(Et){return new Ga(Et>>16,Et>>8&255,Et&255)}function Fe(Et){return so(Et)+""}var Re=Ga.prototype=new Ci;Re.brighter=function(Et){Et=Math.pow(.7,arguments.length?Et:1);var Vt=this.r,de=this.g,Ie=this.b,Be=30;return!Vt&&!de&&!Ie?new Ga(Be,Be,Be):(Vt&&Vt>4,Ie=Ie>>4|Ie,Be=Fr&240,Be=Be>>4|Be,He=Fr&15,He=He<<4|He):Et.length===7&&(Ie=(Fr&16711680)>>16,Be=(Fr&65280)>>8,He=Fr&255)),Vt(Ie,Be,He))}function cn(Et,Vt,de){var Ie=Math.min(Et/=255,Vt/=255,de/=255),Be=Math.max(Et,Vt,de),He=Be-Ie,hr,cr,Fr=(Be+Ie)/2;return He?(cr=Fr<.5?He/(Be+Ie):He/(2-Be-Ie),Et==Be?hr=(Vt-de)/He+(Vt0&&Fr<1?0:hr),new fi(hr,cr,Fr)}function Yr(Et,Vt,de){Et=un(Et),Vt=un(Vt),de=un(de);var Ie=ca((.4124564*Et+.3575761*Vt+.1804375*de)/Zn),Be=ca((.2126729*Et+.7151522*Vt+.072175*de)/Un),He=ca((.0193339*Et+.119192*Vt+.9503041*de)/Wn);return Ar(116*Be-16,500*(Ie-Be),200*(Be-He))}function un(Et){return(Et/=255)<=.04045?Et/12.92:Math.pow((Et+.055)/1.055,2.4)}function Pn(Et){var Vt=parseFloat(Et);return Et.charAt(Et.length-1)==="%"?Math.round(Vt*2.55):Vt}var bn=f.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});bn.forEach(function(Et,Vt){bn.set(Et,so(Vt))});function ze(Et){return typeof Et=="function"?Et:function(){return Et}}f.functor=ze,f.xhr=yr(V);function yr(Et){return function(Vt,de,Ie){return arguments.length===2&&typeof de=="function"&&(Ie=de,de=null),en(Vt,de,Et,Ie)}}function en(Et,Vt,de,Ie){var Be={},He=f.dispatch("beforesend","progress","load","error"),hr={},cr=new XMLHttpRequest,Fr=null;self.XDomainRequest&&!("withCredentials"in cr)&&/^(http(s)?:)?\/\//.test(Et)&&(cr=new XDomainRequest),"onload"in cr?cr.onload=cr.onerror=vn:cr.onreadystatechange=function(){cr.readyState>3&&vn()};function vn(){var fn=cr.status,Bn;if(!fn&&ni(cr)||fn>=200&&fn<300||fn===304){try{Bn=de.call(Be,cr)}catch(ti){He.error.call(Be,ti);return}He.load.call(Be,Bn)}else He.error.call(Be,cr)}return cr.onprogress=function(fn){var Bn=f.event;f.event=fn;try{He.progress.call(Be,cr)}finally{f.event=Bn}},Be.header=function(fn,Bn){return fn=(fn+"").toLowerCase(),arguments.length<2?hr[fn]:(Bn==null?delete hr[fn]:hr[fn]=Bn+"",Be)},Be.mimeType=function(fn){return arguments.length?(Vt=fn==null?null:fn+"",Be):Vt},Be.responseType=function(fn){return arguments.length?(Fr=fn,Be):Fr},Be.response=function(fn){return de=fn,Be},["get","post"].forEach(function(fn){Be[fn]=function(){return Be.send.apply(Be,[fn].concat(z(arguments)))}}),Be.send=function(fn,Bn,ti){if(arguments.length===2&&typeof Bn=="function"&&(ti=Bn,Bn=null),cr.open(fn,Et,!0),Vt!=null&&!("accept"in hr)&&(hr.accept=Vt+",*/*"),cr.setRequestHeader)for(var ei in hr)cr.setRequestHeader(ei,hr[ei]);return Vt!=null&&cr.overrideMimeType&&cr.overrideMimeType(Vt),Fr!=null&&(cr.responseType=Fr),ti!=null&&Be.on("error",ti).on("load",function(ra){ti(null,ra)}),He.beforesend.call(Be,cr),cr.send(Bn??null),Be},Be.abort=function(){return cr.abort(),Be},f.rebind(Be,He,"on"),Ie==null?Be:Be.get(Rn(Ie))}function Rn(Et){return Et.length===1?function(Vt,de){Et(Vt==null?de:null)}:Et}function ni(Et){var Vt=Et.responseType;return Vt&&Vt!=="text"?Et.response:Et.responseText}f.dsv=function(Et,Vt){var de=new RegExp('["'+Et+` +]`),Ie=Et.charCodeAt(0);function Be(vn,fn,Bn){arguments.length<3&&(Bn=fn,fn=null);var ti=en(vn,Vt,fn==null?He:hr(fn),Bn);return ti.row=function(ei){return arguments.length?ti.response((fn=ei)==null?He:hr(ei)):fn},ti}function He(vn){return Be.parse(vn.responseText)}function hr(vn){return function(fn){return Be.parse(fn.responseText,vn)}}Be.parse=function(vn,fn){var Bn;return Be.parseRows(vn,function(ti,ei){if(Bn)return Bn(ti,ei-1);var ra=function(si){for(var Oi={},$i=ti.length,Ki=0;Ki<$i;++Ki)Oi[ti[Ki]]=si[Ki];return Oi};Bn=fn?function(si,Oi){return fn(ra(si),Oi)}:ra})},Be.parseRows=function(vn,fn){var Bn={},ti={},ei=[],ra=vn.length,si=0,Oi=0,$i,Ki;function sa(){if(si>=ra)return ti;if(Ki)return Ki=!1,Bn;var no=si;if(vn.charCodeAt(no)===34){for(var ao=no;ao++24?(isFinite(Vt)&&(clearTimeout(pi),pi=setTimeout(go,Vt)),Gn=0):(Gn=1,Va(go))}f.timer.flush=function(){mo(),Go()};function mo(){for(var Et=Date.now(),Vt=xi;Vt;)Et>=Vt.t&&Vt.c(Et-Vt.t)&&(Vt.c=null),Vt=Vt.n;return Et}function Go(){for(var Et,Vt=xi,de=1/0;Vt;)Vt.c?(Vt.t=0;--cr)si.push(Be[vn[Bn[cr]][2]]);for(cr=+ei;cr1&&qe(Et[de[Ie-2]],Et[de[Ie-1]],Et[Be])<=0;)--Ie;de[Ie++]=Be}return de.slice(0,Ie)}function Cs(Et,Vt){return Et[0]-Vt[0]||Et[1]-Vt[1]}f.geom.polygon=function(Et){return rt(Et,ps),Et};var ps=f.geom.polygon.prototype=[];ps.area=function(){for(var Et=-1,Vt=this.length,de,Ie=this[Vt-1],Be=0;++Etoe)cr=cr.L;else if(hr=Vt-Co(cr,de),hr>oe){if(!cr.R){Ie=cr;break}cr=cr.R}else{He>-oe?(Ie=cr.P,Be=cr):hr>-oe?(Ie=cr,Be=cr.N):Ie=Be=cr;break}var Fr=Ol(Et);if(ul.insert(Ie,Fr),!(!Ie&&!Be)){if(Ie===Be){$l(Ie),Be=Ol(Ie.site),ul.insert(Fr,Be),Fr.edge=Be.edge=mc(Ie.site,Fr.site),yl(Ie),yl(Be);return}if(!Be){Fr.edge=mc(Ie.site,Fr.site);return}$l(Ie),$l(Be);var vn=Ie.site,fn=vn.x,Bn=vn.y,ti=Et.x-fn,ei=Et.y-Bn,ra=Be.site,si=ra.x-fn,Oi=ra.y-Bn,$i=2*(ti*Oi-ei*si),Ki=ti*ti+ei*ei,sa=si*si+Oi*Oi,vi={x:(Oi*Ki-ei*sa)/$i+fn,y:(ti*sa-si*Ki)/$i+Bn};us(Be.edge,vn,ra,vi),Fr.edge=mc(vn,Et,null,vi),Be.edge=mc(Et,ra,null,vi),yl(Ie),yl(Be)}}function Wa(Et,Vt){var de=Et.site,Ie=de.x,Be=de.y,He=Be-Vt;if(!He)return Ie;var hr=Et.P;if(!hr)return-1/0;de=hr.site;var cr=de.x,Fr=de.y,vn=Fr-Vt;if(!vn)return cr;var fn=cr-Ie,Bn=1/He-1/vn,ti=fn/vn;return Bn?(-ti+Math.sqrt(ti*ti-2*Bn*(fn*fn/(-2*vn)-Fr+vn/2+Be-He/2)))/Bn+Ie:(Ie+cr)/2}function Co(Et,Vt){var de=Et.N;if(de)return Wa(de,Vt);var Ie=Et.site;return Ie.y===Vt?Ie.x:1/0}function el(Et){this.site=Et,this.edges=[]}el.prototype.prepare=function(){for(var Et=this.edges,Vt=Et.length,de;Vt--;)de=Et[Vt].edge,(!de.b||!de.a)&&Et.splice(Vt,1);return Et.sort(ss),Et.length};function lc(Et){for(var Vt=Et[0][0],de=Et[1][0],Ie=Et[0][1],Be=Et[1][1],He,hr,cr,Fr,vn=kl,fn=vn.length,Bn,ti,ei,ra,si,Oi;fn--;)if(Bn=vn[fn],!(!Bn||!Bn.prepare()))for(ei=Bn.edges,ra=ei.length,ti=0;tioe||d(Fr-hr)>oe)&&(ei.splice(ti,0,new Rc(Tl(Bn.site,Oi,d(cr-Vt)oe?{x:Vt,y:d(He-Vt)oe?{x:d(hr-Be)oe?{x:de,y:d(He-de)oe?{x:d(hr-Ie)=-zt)){var ei=Fr*Fr+vn*vn,ra=fn*fn+Bn*Bn,si=(Bn*ei-vn*ra)/ti,Oi=(Fr*ra-fn*ei)/ti,Bn=Oi+cr,$i=Uo.pop()||new nc;$i.arc=Et,$i.site=Be,$i.x=si+hr,$i.y=Bn+Math.sqrt(si*si+Oi*Oi),$i.cy=Bn,Et.circle=$i;for(var Ki=null,sa=Ns._;sa;)if($i.y0)){if(si/=ei,ei<0){if(si0){if(si>ti)return;si>Bn&&(Bn=si)}if(si=de-cr,!(!ei&&si<0)){if(si/=ei,ei<0){if(si>ti)return;si>Bn&&(Bn=si)}else if(ei>0){if(si0)){if(si/=ra,ra<0){if(si0){if(si>ti)return;si>Bn&&(Bn=si)}if(si=Ie-Fr,!(!ra&&si<0)){if(si/=ra,ra<0){if(si>ti)return;si>Bn&&(Bn=si)}else if(ra>0){if(si0&&(Be.a={x:cr+Bn*ei,y:Fr+Bn*ra}),ti<1&&(Be.b={x:cr+ti*ei,y:Fr+ti*ra}),Be}}}}}}function ko(Et){for(var Vt=ms,de=Gc(Et[0][0],Et[0][1],Et[1][0],Et[1][1]),Ie=Vt.length,Be;Ie--;)Be=Vt[Ie],(!zs(Be,Et)||!de(Be)||d(Be.a.x-Be.b.x)=He)return;if(fn>ti){if(!Ie)Ie={x:ra,y:hr};else if(Ie.y>=cr)return;de={x:ra,y:cr}}else{if(!Ie)Ie={x:ra,y:cr};else if(Ie.y1)if(fn>ti){if(!Ie)Ie={x:(hr-$i)/Oi,y:hr};else if(Ie.y>=cr)return;de={x:(cr-$i)/Oi,y:cr}}else{if(!Ie)Ie={x:(cr-$i)/Oi,y:cr};else if(Ie.y=He)return;de={x:He,y:Oi*He+$i}}else{if(!Ie)Ie={x:He,y:Oi*He+$i};else if(Ie.x=fn&&$i.x<=ti&&$i.y>=Bn&&$i.y<=ei?[[fn,ei],[ti,ei],[ti,Bn],[fn,Bn]]:[];Ki.point=Fr[si]}),vn}function cr(Fr){return Fr.map(function(vn,fn){return{x:Math.round(Ie(vn,fn)/oe)*oe,y:Math.round(Be(vn,fn)/oe)*oe,i:fn}})}return hr.links=function(Fr){return pu(cr(Fr)).edges.filter(function(vn){return vn.l&&vn.r}).map(function(vn){return{source:Fr[vn.l.i],target:Fr[vn.r.i]}})},hr.triangles=function(Fr){var vn=[];return pu(cr(Fr)).cells.forEach(function(fn,Bn){for(var ti=fn.site,ei=fn.edges.sort(ss),ra=-1,si=ei.length,Oi,$i,Ki=ei[si-1].edge,sa=Ki.l===ti?Ki.r:Ki.l;++rasa&&(sa=fn.x),fn.y>vi&&(vi=fn.y),ei.push(fn.x),ra.push(fn.y);else for(si=0;sisa&&(sa=ro),ao>vi&&(vi=ao),ei.push(ro),ra.push(ao)}var xo=sa-$i,$o=vi-Ki;xo>$o?vi=Ki+xo:sa=$i+$o;function Ko(as,Ts,Bl,ou,wc,zo,il,ml){if(!(isNaN(Bl)||isNaN(ou)))if(as.leaf){var yc=as.x,oc=as.y;if(yc!=null)if(d(yc-Bl)+d(oc-ou)<.01)rs(as,Ts,Bl,ou,wc,zo,il,ml);else{var ph=as.point;as.x=as.y=as.point=null,rs(as,ph,yc,oc,wc,zo,il,ml),rs(as,Ts,Bl,ou,wc,zo,il,ml)}else as.x=Bl,as.y=ou,as.point=Ts}else rs(as,Ts,Bl,ou,wc,zo,il,ml)}function rs(as,Ts,Bl,ou,wc,zo,il,ml){var yc=(wc+il)*.5,oc=(zo+ml)*.5,ph=Bl>=yc,Yl=ou>=oc,hc=Yl<<1|ph;as.leaf=!1,as=as.nodes[hc]||(as.nodes[hc]=Gl()),ph?wc=yc:il=yc,Yl?zo=oc:ml=oc,Ko(as,Ts,Bl,ou,wc,zo,il,ml)}var _l=Gl();if(_l.add=function(as){Ko(_l,as,+Bn(as,++si),+ti(as,si),$i,Ki,sa,vi)},_l.visit=function(as){Yu(as,_l,$i,Ki,sa,vi)},_l.find=function(as){return ef(_l,as[0],as[1],$i,Ki,sa,vi)},si=-1,Vt==null){for(;++siHe||ti>hr||ei=ro,$o=de>=ao,Ko=$o<<1|xo,rs=Ko+4;Kode&&(He=Vt.slice(de,He),cr[hr]?cr[hr]+=He:cr[++hr]=He),(Ie=Ie[0])===(Be=Be[0])?cr[hr]?cr[hr]+=Be:cr[++hr]=Be:(cr[++hr]=null,Fr.push({i:hr,x:bu(Ie,Be)})),de=gu.lastIndex;return de=0&&!(Ie=f.interpolators[de](Et,Vt)););return Ie}f.interpolators=[function(Et,Vt){var de=typeof Vt;return(de==="string"?bn.has(Vt.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Vt)?xu:_h:Vt instanceof Ci?xu:Array.isArray(Vt)?ic:de==="object"&&isNaN(Vt)?mu:bu)(Et,Vt)}],f.interpolateArray=ic;function ic(Et,Vt){var de=[],Ie=[],Be=Et.length,He=Vt.length,hr=Math.min(Et.length,Vt.length),cr;for(cr=0;cr=0?Et.slice(0,Vt):Et,Ie=Vt>=0?Et.slice(Vt+1):"in";return de=Hu.get(de)||jh,Ie=Qh.get(Ie)||V,Lc(Ie(de.apply(null,y.call(arguments,1))))};function Lc(Et){return function(Vt){return Vt<=0?0:Vt>=1?1:Et(Vt)}}function Xf(Et){return function(Vt){return 1-Et(1-Vt)}}function hl(Et){return function(Vt){return .5*(Vt<.5?Et(2*Vt):2-Et(2-2*Vt))}}function pp(Et){return Et*Et}function Hl(Et){return Et*Et*Et}function cs(Et){if(Et<=0)return 0;if(Et>=1)return 1;var Vt=Et*Et,de=Vt*Et;return 4*(Et<.5?de:3*(Et-Vt)+de-.75)}function _d(Et){return function(Vt){return Math.pow(Vt,Et)}}function xh(Et){return 1-Math.cos(Et*ae)}function hu(Et){return Math.pow(2,10*(Et-1))}function rf(Et){return 1-Math.sqrt(1-Et*Et)}function td(Et,Vt){var de;return arguments.length<2&&(Vt=.45),arguments.length?de=Vt/Pt*Math.asin(1/Et):(Et=1,de=Vt/4),function(Ie){return 1+Et*Math.pow(2,-10*Ie)*Math.sin((Ie-de)*Pt/Vt)}}function Ed(Et){return Et||(Et=1.70158),function(Vt){return Vt*Vt*((Et+1)*Vt-Et)}}function vu(Et){return Et<1/2.75?7.5625*Et*Et:Et<2/2.75?7.5625*(Et-=1.5/2.75)*Et+.75:Et<2.5/2.75?7.5625*(Et-=2.25/2.75)*Et+.9375:7.5625*(Et-=2.625/2.75)*Et+.984375}f.interpolateHcl=Lf;function Lf(Et,Vt){Et=f.hcl(Et),Vt=f.hcl(Vt);var de=Et.h,Ie=Et.c,Be=Et.l,He=Vt.h-de,hr=Vt.c-Ie,cr=Vt.l-Be;return isNaN(hr)&&(hr=0,Ie=isNaN(Ie)?Vt.c:Ie),isNaN(He)?(He=0,de=isNaN(de)?Vt.h:de):He>180?He-=360:He<-180&&(He+=360),function(Fr){return vr(de+He*Fr,Ie+hr*Fr,Be+cr*Fr)+""}}f.interpolateHsl=hf;function hf(Et,Vt){Et=f.hsl(Et),Vt=f.hsl(Vt);var de=Et.h,Ie=Et.s,Be=Et.l,He=Vt.h-de,hr=Vt.s-Ie,cr=Vt.l-Be;return isNaN(hr)&&(hr=0,Ie=isNaN(Ie)?Vt.s:Ie),isNaN(He)?(He=0,de=isNaN(de)?Vt.h:de):He>180?He-=360:He<-180&&(He+=360),function(Fr){return oa(de+He*Fr,Ie+hr*Fr,Be+cr*Fr)+""}}f.interpolateLab=Ld;function Ld(Et,Vt){Et=f.lab(Et),Vt=f.lab(Vt);var de=Et.l,Ie=Et.a,Be=Et.b,He=Vt.l-de,hr=Vt.a-Ie,cr=Vt.b-Be;return function(Fr){return Fi(de+He*Fr,Ie+hr*Fr,Be+cr*Fr)+""}}f.interpolateRound=ed;function ed(Et,Vt){return Vt-=Et,function(de){return Math.round(Et+Vt*de)}}f.transform=function(Et){var Vt=P.createElementNS(f.ns.prefix.svg,"g");return(f.transform=function(de){if(de!=null){Vt.setAttribute("transform",de);var Ie=Vt.transform.baseVal.consolidate()}return new nf(Ie?Ie.matrix:Uh)})(Et)};function nf(Et){var Vt=[Et.a,Et.b],de=[Et.c,Et.d],Ie=bh(Vt),Be=af(Vt,de),He=bh(df(de,Vt,-Be))||0;Vt[0]*de[1]180?Vt+=360:Vt-Et>180&&(Et+=360),Ie.push({i:de.push(Mh(de)+"rotate(",null,")")-2,x:bu(Et,Vt)})):Vt&&de.push(Mh(de)+"rotate("+Vt+")")}function of(Et,Vt,de,Ie){Et!==Vt?Ie.push({i:de.push(Mh(de)+"skewX(",null,")")-2,x:bu(Et,Vt)}):Vt&&de.push(Mh(de)+"skewX("+Vt+")")}function uc(Et,Vt,de,Ie){if(Et[0]!==Vt[0]||Et[1]!==Vt[1]){var Be=de.push(Mh(de)+"scale(",null,",",null,")");Ie.push({i:Be-4,x:bu(Et[0],Vt[0])},{i:Be-2,x:bu(Et[1],Vt[1])})}else(Vt[0]!==1||Vt[1]!==1)&&de.push(Mh(de)+"scale("+Vt+")")}function jd(Et,Vt){var de=[],Ie=[];return Et=f.transform(Et),Vt=f.transform(Vt),yu(Et.translate,Vt.translate,de,Ie),fd(Et.rotate,Vt.rotate,de,Ie),of(Et.skew,Vt.skew,de,Ie),uc(Et.scale,Vt.scale,de,Ie),Et=Vt=null,function(Be){for(var He=-1,hr=Ie.length,cr;++He0?He=vi:(de.c=null,de.t=NaN,de=null,Vt.end({type:"end",alpha:He=0})):vi>0&&(Vt.start({type:"start",alpha:He=vi}),de=ea(Et.tick)),Et):He},Et.start=function(){var vi,ro=ei.length,ao=ra.length,xo=Ie[0],$o=Ie[1],Ko,rs;for(vi=0;vi=0;)He.push(fn=vn[Fr]),fn.parent=cr,fn.depth=cr.depth+1;de&&(cr.value=0),cr.children=vn}else de&&(cr.value=+de.call(Ie,cr,cr.depth)||0),delete cr.children;return Eh(Be,function(Bn){var ti,ei;Et&&(ti=Bn.children)&&ti.sort(Et),de&&(ei=Bn.parent)&&(ei.value+=Bn.value)}),hr}return Ie.sort=function(Be){return arguments.length?(Et=Be,Ie):Et},Ie.children=function(Be){return arguments.length?(Vt=Be,Ie):Vt},Ie.value=function(Be){return arguments.length?(de=Be,Ie):de},Ie.revalue=function(Be){return de&&(xd(Be,function(He){He.children&&(He.value=0)}),Eh(Be,function(He){var hr;He.children||(He.value=+de.call(Ie,He,He.depth)||0),(hr=He.parent)&&(hr.value+=He.value)})),Be},Ie};function Pc(Et,Vt){return f.rebind(Et,Vt,"sort","children","value"),Et.nodes=Et,Et.links=Ap,Et}function xd(Et,Vt){for(var de=[Et];(Et=de.pop())!=null;)if(Vt(Et),(Be=Et.children)&&(Ie=Be.length))for(var Ie,Be;--Ie>=0;)de.push(Be[Ie])}function Eh(Et,Vt){for(var de=[Et],Ie=[];(Et=de.pop())!=null;)if(Ie.push(Et),(hr=Et.children)&&(He=hr.length))for(var Be=-1,He,hr;++BeBe&&(Be=cr),Ie.push(cr)}for(hr=0;hrIe&&(de=Vt,Ie=Be);return de}function Hh(Et){return Et.reduce(th,0)}function th(Et,Vt){return Et+Vt[1]}f.layout.histogram=function(){var Et=!0,Vt=Number,de=Id,Ie=Pf;function Be(He,hr){for(var cr=[],Fr=He.map(Vt,this),vn=de.call(this,Fr,hr),fn=Ie.call(this,vn,Fr,hr),Bn,hr=-1,ti=Fr.length,ei=fn.length-1,ra=Et?1:1/ti,si;++hr0)for(hr=-1;++hr=vn[0]&&si<=vn[1]&&(Bn=cr[f.bisect(fn,si,1,ei)-1],Bn.y+=ra,Bn.push(He[hr]));return cr}return Be.value=function(He){return arguments.length?(Vt=He,Be):Vt},Be.range=function(He){return arguments.length?(de=ze(He),Be):de},Be.bins=function(He){return arguments.length?(Ie=typeof He=="number"?function(hr){return Mc(hr,He)}:ze(He),Be):Ie},Be.frequency=function(He){return arguments.length?(Et=!!He,Be):Et},Be};function Pf(Et,Vt){return Mc(Et,Math.ceil(Math.log(Vt.length)/Math.LN2+1))}function Mc(Et,Vt){for(var de=-1,Ie=+Et[0],Be=(Et[1]-Ie)/Vt,He=[];++de<=Vt;)He[de]=Be*de+Ie;return He}function Id(Et){return[f.min(Et),f.max(Et)]}f.layout.pack=function(){var Et=f.layout.hierarchy().sort(id),Vt=0,de=[1,1],Ie;function Be(He,hr){var cr=Et.call(this,He,hr),Fr=cr[0],vn=de[0],fn=de[1],Bn=Ie==null?Math.sqrt:typeof Ie=="function"?Ie:function(){return Ie};if(Fr.x=Fr.y=0,Eh(Fr,function(ei){ei.r=+Bn(ei.value)}),Eh(Fr,Dd),Vt){var ti=Vt*(Ie?1:Math.max(2*Fr.r/vn,2*Fr.r/fn))/2;Eh(Fr,function(ei){ei.r+=ti}),Eh(Fr,Dd),Eh(Fr,function(ei){ei.r-=ti})}return gf(Fr,vn/2,fn/2,Ie?1:1/Math.max(2*Fr.r/vn,2*Fr.r/fn)),cr}return Be.size=function(He){return arguments.length?(de=He,Be):de},Be.radius=function(He){return arguments.length?(Ie=He==null||typeof He=="function"?He:+He,Be):Ie},Be.padding=function(He){return arguments.length?(Vt=+He,Be):Vt},Pc(Be,Et)};function id(Et,Vt){return Et.value-Vt.value}function dh(Et,Vt){var de=Et._pack_next;Et._pack_next=Vt,Vt._pack_prev=Et,Vt._pack_next=de,de._pack_prev=Vt}function pd(Et,Vt){Et._pack_next=Vt,Vt._pack_prev=Et}function ad(Et,Vt){var de=Vt.x-Et.x,Ie=Vt.y-Et.y,Be=Et.r+Vt.r;return .999*Be*Be>de*de+Ie*Ie}function Dd(Et){if(!(Vt=Et.children)||!(ti=Vt.length))return;var Vt,de=1/0,Ie=-1/0,Be=1/0,He=-1/0,hr,cr,Fr,vn,fn,Bn,ti;function ei(vi){de=Math.min(vi.x-vi.r,de),Ie=Math.max(vi.x+vi.r,Ie),Be=Math.min(vi.y-vi.r,Be),He=Math.max(vi.y+vi.r,He)}if(Vt.forEach(tp),hr=Vt[0],hr.x=-hr.r,hr.y=0,ei(hr),ti>1&&(cr=Vt[1],cr.x=cr.r,cr.y=0,ei(cr),ti>2))for(Fr=Vt[2],fh(hr,cr,Fr),ei(Fr),dh(hr,Fr),hr._pack_prev=Fr,dh(Fr,cr),cr=hr._pack_next,vn=3;vnOi.x&&(Oi=ro),ro.depth>$i.depth&&($i=ro)});var Ki=Vt(si,Oi)/2-si.x,sa=de[0]/(Oi.x+Vt(Oi,si)/2+Ki),vi=de[1]/($i.depth||1);xd(ei,function(ro){ro.x=(ro.x+Ki)*sa,ro.y=ro.depth*vi})}return ti}function He(fn){for(var Bn={A:null,children:[fn]},ti=[Bn],ei;(ei=ti.pop())!=null;)for(var ra=ei.children,si,Oi=0,$i=ra.length;Oi<$i;++Oi)ti.push((ra[Oi]=si={_:ra[Oi],parent:ei,children:(si=ra[Oi].children)&&si.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:Oi}).a=si);return Bn.children[0]}function hr(fn){var Bn=fn.children,ti=fn.parent.children,ei=fn.i?ti[fn.i-1]:null;if(Bn.length){Ih(fn);var ra=(Bn[0].z+Bn[Bn.length-1].z)/2;ei?(fn.z=ei.z+Vt(fn._,ei._),fn.m=fn.z-ra):fn.z=ra}else ei&&(fn.z=ei.z+Vt(fn._,ei._));fn.parent.A=Fr(fn,ei,fn.parent.A||ti[0])}function cr(fn){fn._.x=fn.z+fn.parent.m,fn.m+=fn.parent.m}function Fr(fn,Bn,ti){if(Bn){for(var ei=fn,ra=fn,si=Bn,Oi=ei.parent.children[0],$i=ei.m,Ki=ra.m,sa=si.m,vi=Oi.m,ro;si=Zc(si),ei=Ph(ei),si&&ei;)Oi=Ph(Oi),ra=Zc(ra),ra.a=fn,ro=si.z+sa-ei.z-$i+Vt(si._,ei._),ro>0&&(fc(Td(si,fn,ti),fn,ro),$i+=ro,Ki+=ro),sa+=si.m,$i+=ei.m,vi+=Oi.m,Ki+=ra.m;si&&!Zc(ra)&&(ra.t=si,ra.m+=sa-Ki),ei&&!Ph(Oi)&&(Oi.t=ei,Oi.m+=$i-vi,ti=fn)}return ti}function vn(fn){fn.x*=de[0],fn.y=fn.depth*de[1]}return Be.separation=function(fn){return arguments.length?(Vt=fn,Be):Vt},Be.size=function(fn){return arguments.length?(Ie=(de=fn)==null?vn:null,Be):Ie?null:de},Be.nodeSize=function(fn){return arguments.length?(Ie=(de=fn)==null?null:vn,Be):Ie?de:null},Pc(Be,Et)};function Vh(Et,Vt){return Et.parent==Vt.parent?1:2}function Ph(Et){var Vt=Et.children;return Vt.length?Vt[0]:Et.t}function Zc(Et){var Vt=Et.children,de;return(de=Vt.length)?Vt[de-1]:Et.t}function fc(Et,Vt,de){var Ie=de/(Vt.i-Et.i);Vt.c-=Ie,Vt.s+=de,Et.c+=Ie,Vt.z+=de,Vt.m+=de}function Ih(Et){for(var Vt=0,de=0,Ie=Et.children,Be=Ie.length,He;--Be>=0;)He=Ie[Be],He.z+=Vt,He.m+=Vt,Vt+=He.s+(de+=He.c)}function Td(Et,Vt,de){return Et.a.parent===Vt.parent?Et.a:de}f.layout.cluster=function(){var Et=f.layout.hierarchy().sort(null).value(null),Vt=Vh,de=[1,1],Ie=!1;function Be(He,hr){var cr=Et.call(this,He,hr),Fr=cr[0],vn,fn=0;Eh(Fr,function(si){var Oi=si.children;Oi&&Oi.length?(si.x=sf(Oi),si.y=Dh(Oi)):(si.x=vn?fn+=Vt(si,vn):0,si.y=0,vn=si)});var Bn=br(Fr),ti=Qr(Fr),ei=Bn.x-Vt(Bn,ti)/2,ra=ti.x+Vt(ti,Bn)/2;return Eh(Fr,Ie?function(si){si.x=(si.x-Fr.x)*de[0],si.y=(Fr.y-si.y)*de[1]}:function(si){si.x=(si.x-ei)/(ra-ei)*de[0],si.y=(1-(Fr.y?si.y/Fr.y:1))*de[1]}),cr}return Be.separation=function(He){return arguments.length?(Vt=He,Be):Vt},Be.size=function(He){return arguments.length?(Ie=(de=He)==null,Be):Ie?null:de},Be.nodeSize=function(He){return arguments.length?(Ie=(de=He)!=null,Be):Ie?de:null},Pc(Be,Et)};function Dh(Et){return 1+f.max(Et,function(Vt){return Vt.y})}function sf(Et){return Et.reduce(function(Vt,de){return Vt+de.x},0)/Et.length}function br(Et){var Vt=Et.children;return Vt&&Vt.length?br(Vt[0]):Et}function Qr(Et){var Vt=Et.children,de;return Vt&&(de=Vt.length)?Qr(Vt[de-1]):Et}f.layout.treemap=function(){var Et=f.layout.hierarchy(),Vt=Math.round,de=[1,1],Ie=null,Be=Nn,He=!1,hr,cr="squarify",Fr=.5*(1+Math.sqrt(5));function vn(si,Oi){for(var $i=-1,Ki=si.length,sa,vi;++$i0;)Ki.push(vi=sa[$o-1]),Ki.area+=vi.area,cr!=="squarify"||(ao=ti(Ki,xo))<=ro?(sa.pop(),ro=ao):(Ki.area-=Ki.pop().area,ei(Ki,xo,$i,!1),xo=Math.min($i.dx,$i.dy),Ki.length=Ki.area=0,ro=1/0);Ki.length&&(ei(Ki,xo,$i,!0),Ki.length=Ki.area=0),Oi.forEach(fn)}}function Bn(si){var Oi=si.children;if(Oi&&Oi.length){var $i=Be(si),Ki=Oi.slice(),sa,vi=[];for(vn(Ki,$i.dx*$i.dy/si.value),vi.area=0;sa=Ki.pop();)vi.push(sa),vi.area+=sa.area,sa.z!=null&&(ei(vi,sa.z?$i.dx:$i.dy,$i,!Ki.length),vi.length=vi.area=0);Oi.forEach(Bn)}}function ti(si,Oi){for(var $i=si.area,Ki,sa=0,vi=1/0,ro=-1,ao=si.length;++rosa&&(sa=Ki));return $i*=$i,Oi*=Oi,$i?Math.max(Oi*sa*Fr/$i,$i/(Oi*vi*Fr)):1/0}function ei(si,Oi,$i,Ki){var sa=-1,vi=si.length,ro=$i.x,ao=$i.y,xo=Oi?Vt(si.area/Oi):0,$o;if(Oi==$i.dx){for((Ki||xo>$i.dy)&&(xo=$i.dy);++sa$i.dx)&&(xo=$i.dx);++sa1);return Et+Vt*Ie*Math.sqrt(-2*Math.log(He)/He)}},logNormal:function(){var Et=f.random.normal.apply(f,arguments);return function(){return Math.exp(Et())}},bates:function(Et){var Vt=f.random.irwinHall(Et);return function(){return Vt()/Et}},irwinHall:function(Et){return function(){for(var Vt=0,de=0;de2?Sa:ga,vn=Ie?ff:Jf;return Be=Fr(Et,Vt,vn,de),He=Fr(Vt,Et,vn,pl),cr}function cr(Fr){return Be(Fr)}return cr.invert=function(Fr){return He(Fr)},cr.domain=function(Fr){return arguments.length?(Et=Fr.map(Number),hr()):Et},cr.range=function(Fr){return arguments.length?(Vt=Fr,hr()):Vt},cr.rangeRound=function(Fr){return cr.range(Fr).interpolate(ed)},cr.clamp=function(Fr){return arguments.length?(Ie=Fr,hr()):Ie},cr.interpolate=function(Fr){return arguments.length?(de=Fr,hr()):de},cr.ticks=function(Fr){return fs(Et,Fr)},cr.tickFormat=function(Fr,vn){return d3_scale_linearTickFormat(Et,Fr,vn)},cr.nice=function(Fr){return pa(Et,Fr),hr()},cr.copy=function(){return Za(Et,Vt,de,Ie)},hr()}function Ra(Et,Vt){return f.rebind(Et,Vt,"range","rangeRound","interpolate","clamp")}function pa(Et,Vt){return Pa(Et,Ja(_o(Et,Vt)[2])),Pa(Et,Ja(_o(Et,Vt)[2])),Et}function _o(Et,Vt){Vt==null&&(Vt=10);var de=di(Et),Ie=de[1]-de[0],Be=Math.pow(10,Math.floor(Math.log(Ie/Vt)/Math.LN10)),He=Vt/Ie*Be;return He<=.15?Be*=10:He<=.35?Be*=5:He<=.75&&(Be*=2),de[0]=Math.ceil(de[0]/Be)*Be,de[1]=Math.floor(de[1]/Be)*Be+Be*.5,de[2]=Be,de}function fs(Et,Vt){return f.range.apply(f,_o(Et,Vt))}f.scale.log=function(){return os(f.scale.linear().domain([0,1]),10,!0,[1,10])};function os(Et,Vt,de,Ie){function Be(cr){return(de?Math.log(cr<0?0:cr):-Math.log(cr>0?0:-cr))/Math.log(Vt)}function He(cr){return de?Math.pow(Vt,cr):-Math.pow(Vt,-cr)}function hr(cr){return Et(Be(cr))}return hr.invert=function(cr){return He(Et.invert(cr))},hr.domain=function(cr){return arguments.length?(de=cr[0]>=0,Et.domain((Ie=cr.map(Number)).map(Be)),hr):Ie},hr.base=function(cr){return arguments.length?(Vt=+cr,Et.domain(Ie.map(Be)),hr):Vt},hr.nice=function(){var cr=Pa(Ie.map(Be),de?Math:gs);return Et.domain(cr),Ie=cr.map(He),hr},hr.ticks=function(){var cr=di(Ie),Fr=[],vn=cr[0],fn=cr[1],Bn=Math.floor(Be(vn)),ti=Math.ceil(Be(fn)),ei=Vt%1?2:Vt;if(isFinite(ti-Bn)){if(de){for(;Bn0;ra--)Fr.push(He(Bn)*ra);for(Bn=0;Fr[Bn]fn;ti--);Fr=Fr.slice(Bn,ti)}return Fr},hr.copy=function(){return os(Et.copy(),Vt,de,Ie)},Ra(hr,Et)}var gs={floor:function(Et){return-Math.ceil(-Et)},ceil:function(Et){return-Math.floor(-Et)}};f.scale.pow=function(){return ws(f.scale.linear(),1,[0,1])};function ws(Et,Vt,de){var Ie=bo(Vt),Be=bo(1/Vt);function He(hr){return Et(Ie(hr))}return He.invert=function(hr){return Be(Et.invert(hr))},He.domain=function(hr){return arguments.length?(Et.domain((de=hr.map(Number)).map(Ie)),He):de},He.ticks=function(hr){return fs(de,hr)},He.tickFormat=function(hr,cr){return d3_scale_linearTickFormat(de,hr,cr)},He.nice=function(hr){return He.domain(pa(de,hr))},He.exponent=function(hr){return arguments.length?(Ie=bo(Vt=hr),Be=bo(1/Vt),Et.domain(de.map(Ie)),He):Vt},He.copy=function(){return ws(Et.copy(),Vt,de)},Ra(He,Et)}function bo(Et){return function(Vt){return Vt<0?-Math.pow(-Vt,Et):Math.pow(Vt,Et)}}f.scale.sqrt=function(){return f.scale.pow().exponent(.5)},f.scale.ordinal=function(){return lo([],{t:"range",a:[[]]})};function lo(Et,Vt){var de,Ie,Be;function He(cr){return Ie[((de.get(cr)||(Vt.t==="range"?de.set(cr,Et.push(cr)):NaN))-1)%Ie.length]}function hr(cr,Fr){return f.range(Et.length).map(function(vn){return cr+Fr*vn})}return He.domain=function(cr){if(!arguments.length)return Et;Et=[],de=new D;for(var Fr=-1,vn=cr.length,fn;++Fr0?de[He-1]:Et[0],Heti?0:1;if(fn=Ht)return Fr(fn,ra)+(vn?Fr(vn,1-ra):"")+"Z";var si,Oi,$i,Ki,sa=0,vi=0,ro,ao,xo,$o,Ko,rs,_l,as,Ts=[];if((Ki=(+hr.apply(this,arguments)||0)/2)&&($i=Ie===bc?Math.sqrt(vn*vn+fn*fn):+Ie.apply(this,arguments),ra||(vi*=-1),fn&&(vi=Ye($i/fn*Math.sin(Ki))),vn&&(sa=Ye($i/vn*Math.sin(Ki)))),fn){ro=fn*Math.cos(Bn+vi),ao=fn*Math.sin(Bn+vi),xo=fn*Math.cos(ti-vi),$o=fn*Math.sin(ti-vi);var Bl=Math.abs(ti-Bn-2*vi)<=_t?0:1;if(vi&&eh(ro,ao,xo,$o)===ra^Bl){var ou=(Bn+ti)/2;ro=fn*Math.cos(ou),ao=fn*Math.sin(ou),xo=$o=null}}else ro=ao=0;if(vn){Ko=vn*Math.cos(ti-sa),rs=vn*Math.sin(ti-sa),_l=vn*Math.cos(Bn+sa),as=vn*Math.sin(Bn+sa);var wc=Math.abs(Bn-ti+2*sa)<=_t?0:1;if(sa&&eh(Ko,rs,_l,as)===1-ra^wc){var zo=(Bn+ti)/2;Ko=vn*Math.cos(zo),rs=vn*Math.sin(zo),_l=as=null}}else Ko=rs=0;if(ei>oe&&(si=Math.min(Math.abs(fn-vn)/2,+de.apply(this,arguments)))>.001){Oi=vn0?0:1}function Vu(Et,Vt,de,Ie,Be){var He=Et[0]-Vt[0],hr=Et[1]-Vt[1],cr=(Be?Ie:-Ie)/Math.sqrt(He*He+hr*hr),Fr=cr*hr,vn=-cr*He,fn=Et[0]+Fr,Bn=Et[1]+vn,ti=Vt[0]+Fr,ei=Vt[1]+vn,ra=(fn+ti)/2,si=(Bn+ei)/2,Oi=ti-fn,$i=ei-Bn,Ki=Oi*Oi+$i*$i,sa=de-Ie,vi=fn*ei-ti*Bn,ro=($i<0?-1:1)*Math.sqrt(Math.max(0,sa*sa*Ki-vi*vi)),ao=(vi*$i-Oi*ro)/Ki,xo=(-vi*Oi-$i*ro)/Ki,$o=(vi*$i+Oi*ro)/Ki,Ko=(-vi*Oi+$i*ro)/Ki,rs=ao-ra,_l=xo-si,as=$o-ra,Ts=Ko-si;return rs*rs+_l*_l>as*as+Ts*Ts&&(ao=$o,xo=Ko),[[ao-Fr,xo-vn],[ao*de/sa,xo*de/sa]]}function Wh(){return!0}function rh(Et){var Vt=Lo,de=Zo,Ie=Wh,Be=Wc,He=Be.key,hr=.7;function cr(Fr){var vn=[],fn=[],Bn=-1,ti=Fr.length,ei,ra=ze(Vt),si=ze(de);function Oi(){vn.push("M",Be(Et(fn),hr))}for(;++Bn1?Et.join("L"):Et+"Z"}function Gh(Et){return Et.join("L")+"Z"}function ds(Et){for(var Vt=0,de=Et.length,Ie=Et[0],Be=[Ie[0],",",Ie[1]];++Vt1&&Be.push("H",Ie[0]),Be.join("")}function $s(Et){for(var Vt=0,de=Et.length,Ie=Et[0],Be=[Ie[0],",",Ie[1]];++Vt1){cr=Vt[1],He=Et[Fr],Fr++,Ie+="C"+(Be[0]+hr[0])+","+(Be[1]+hr[1])+","+(He[0]-cr[0])+","+(He[1]-cr[1])+","+He[0]+","+He[1];for(var vn=2;vn9&&(He=de*3/Math.sqrt(He),hr[cr]=He*Ie,hr[cr+1]=He*Be));for(cr=-1;++cr<=Fr;)He=(Et[Math.min(Fr,cr+1)][0]-Et[Math.max(0,cr-1)][0])/(6*(1+hr[cr]*hr[cr])),Vt.push([He||0,hr[cr]*He||0]);return Vt}function le(Et){return Et.length<3?Wc(Et):Et[0]+O(Et,te(Et))}f.svg.line.radial=function(){var Et=rh(Te);return Et.radius=Et.x,delete Et.x,Et.angle=Et.y,delete Et.y,Et};function Te(Et){for(var Vt,de=-1,Ie=Et.length,Be,He;++de_t)+",1 "+Bn}function vn(fn,Bn,ti,ei){return"Q 0,0 "+ei}return He.radius=function(fn){return arguments.length?(de=ze(fn),He):de},He.source=function(fn){return arguments.length?(Et=ze(fn),He):Et},He.target=function(fn){return arguments.length?(Vt=ze(fn),He):Vt},He.startAngle=function(fn){return arguments.length?(Ie=ze(fn),He):Ie},He.endAngle=function(fn){return arguments.length?(Be=ze(fn),He):Be},He};function Xe(Et){return Et.radius}f.svg.diagonal=function(){var Et=We,Vt=Ne,de=Pr;function Ie(Be,He){var hr=Et.call(this,Be,He),cr=Vt.call(this,Be,He),Fr=(hr.y+cr.y)/2,vn=[hr,{x:hr.x,y:Fr},{x:cr.x,y:Fr},cr];return vn=vn.map(de),"M"+vn[0]+"C"+vn[1]+" "+vn[2]+" "+vn[3]}return Ie.source=function(Be){return arguments.length?(Et=ze(Be),Ie):Et},Ie.target=function(Be){return arguments.length?(Vt=ze(Be),Ie):Vt},Ie.projection=function(Be){return arguments.length?(de=Be,Ie):de},Ie};function Pr(Et){return[Et.x,Et.y]}f.svg.diagonal.radial=function(){var Et=f.svg.diagonal(),Vt=Pr,de=Et.projection;return Et.projection=function(Ie){return arguments.length?de(qr(Vt=Ie)):Vt},Et};function qr(Et){return function(){var Vt=Et.apply(this,arguments),de=Vt[0],Ie=Vt[1]-ae;return[de*Math.cos(Ie),de*Math.sin(Ie)]}}f.svg.symbol=function(){var Et=gn,Vt=Xr;function de(Ie,Be){return(Qn.get(Et.call(this,Ie,Be))||zn)(Vt.call(this,Ie,Be))}return de.type=function(Ie){return arguments.length?(Et=ze(Ie),de):Et},de.size=function(Ie){return arguments.length?(Vt=ze(Ie),de):Vt},de};function Xr(){return 64}function gn(){return"circle"}function zn(Et){var Vt=Math.sqrt(Et/_t);return"M0,"+Vt+"A"+Vt+","+Vt+" 0 1,1 0,"+-Vt+"A"+Vt+","+Vt+" 0 1,1 0,"+Vt+"Z"}var Qn=f.map({circle:zn,cross:function(Et){var Vt=Math.sqrt(Et/5)/2;return"M"+-3*Vt+","+-Vt+"H"+-Vt+"V"+-3*Vt+"H"+Vt+"V"+-Vt+"H"+3*Vt+"V"+Vt+"H"+Vt+"V"+3*Vt+"H"+-Vt+"V"+Vt+"H"+-3*Vt+"Z"},diamond:function(Et){var Vt=Math.sqrt(Et/(2*Ti)),de=Vt*Ti;return"M0,"+-Vt+"L"+de+",0 0,"+Vt+" "+-de+",0Z"},square:function(Et){var Vt=Math.sqrt(Et)/2;return"M"+-Vt+","+-Vt+"L"+Vt+","+-Vt+" "+Vt+","+Vt+" "+-Vt+","+Vt+"Z"},"triangle-down":function(Et){var Vt=Math.sqrt(Et/ai),de=Vt*ai/2;return"M0,"+de+"L"+Vt+","+-de+" "+-Vt+","+-de+"Z"},"triangle-up":function(Et){var Vt=Math.sqrt(Et/ai),de=Vt*ai/2;return"M0,"+-de+"L"+Vt+","+de+" "+-Vt+","+de+"Z"}});f.svg.symbolTypes=Qn.keys();var ai=Math.sqrt(3),Ti=Math.tan(30*he);ot.transition=function(Et){for(var Vt=Yo||++wo,de=Ll(Et),Ie=[],Be,He,hr=Fo||{time:Date.now(),ease:cs,delay:0,duration:250},cr=-1,Fr=this.length;++cr0;)Bn[--Ki].call(Et,$i);if(Oi>=1)return hr.event&&hr.event.end.call(Et,Et.__data__,Vt),--He.count?delete He[Ie]:delete Et[de],1}hr||(cr=Be.time,Fr=ea(ti,0,cr),hr=He[Ie]={tween:new D,time:cr,timer:Fr,delay:Be.delay,duration:Be.duration,ease:Be.ease,index:Vt},Be=null,++He.count)}f.svg.axis=function(){var Et=f.scale.linear(),Vt=zl,de=6,Ie=6,Be=3,He=[10],hr=null,cr;function Fr(vn){vn.each(function(){var fn=f.select(this),Bn=this.__chart__||Et,ti=this.__chart__=Et.copy(),ei=hr??(ti.ticks?ti.ticks.apply(ti,He):ti.domain()),ra=cr??(ti.tickFormat?ti.tickFormat.apply(ti,He):V),si=fn.selectAll(".tick").data(ei,ti),Oi=si.enter().insert("g",".domain").attr("class","tick").style("opacity",oe),$i=f.transition(si.exit()).style("opacity",oe).remove(),Ki=f.transition(si.order()).style("opacity",1),sa=Math.max(de,0)+Be,vi,ro=Pi(ti),ao=fn.selectAll(".domain").data([0]),xo=(ao.enter().append("path").attr("class","domain"),f.transition(ao));Oi.append("line"),Oi.append("text");var $o=Oi.select("line"),Ko=Ki.select("line"),rs=si.select("text").text(ra),_l=Oi.select("text"),as=Ki.select("text"),Ts=Vt==="top"||Vt==="left"?-1:1,Bl,ou,wc,zo;if(Vt==="bottom"||Vt==="top"?(vi=Sc,Bl="x",wc="y",ou="x2",zo="y2",rs.attr("dy",Ts<0?"0em":".71em").style("text-anchor","middle"),xo.attr("d","M"+ro[0]+","+Ts*Ie+"V0H"+ro[1]+"V"+Ts*Ie)):(vi=rl,Bl="y",wc="x",ou="y2",zo="x2",rs.attr("dy",".32em").style("text-anchor",Ts<0?"end":"start"),xo.attr("d","M"+Ts*Ie+","+ro[0]+"H0V"+ro[1]+"H"+Ts*Ie)),$o.attr(zo,Ts*de),_l.attr(wc,Ts*sa),Ko.attr(ou,0).attr(zo,Ts*de),as.attr(Bl,0).attr(wc,Ts*sa),ti.rangeBand){var il=ti,ml=il.rangeBand()/2;Bn=ti=function(yc){return il(yc)+ml}}else Bn.rangeBand?Bn=ti:$i.call(vi,ti,Bn);Oi.call(vi,Bn,ti),Ki.call(vi,ti,ti)})}return Fr.scale=function(vn){return arguments.length?(Et=vn,Fr):Et},Fr.orient=function(vn){return arguments.length?(Vt=vn in Fc?vn+"":zl,Fr):Vt},Fr.ticks=function(){return arguments.length?(He=z(arguments),Fr):He},Fr.tickValues=function(vn){return arguments.length?(hr=vn,Fr):hr},Fr.tickFormat=function(vn){return arguments.length?(cr=vn,Fr):cr},Fr.tickSize=function(vn){var fn=arguments.length;return fn?(de=+vn,Ie=+arguments[fn-1],Fr):de},Fr.innerTickSize=function(vn){return arguments.length?(de=+vn,Fr):de},Fr.outerTickSize=function(vn){return arguments.length?(Ie=+vn,Fr):Ie},Fr.tickPadding=function(vn){return arguments.length?(Be=+vn,Fr):Be},Fr.tickSubdivide=function(){return arguments.length&&Fr},Fr};var zl="bottom",Fc={top:1,right:1,bottom:1,left:1};function Sc(Et,Vt,de){Et.attr("transform",function(Ie){var Be=Vt(Ie);return"translate("+(isFinite(Be)?Be:de(Ie))+",0)"})}function rl(Et,Vt,de){Et.attr("transform",function(Ie){var Be=Vt(Ie);return"translate(0,"+(isFinite(Be)?Be:de(Ie))+")"})}f.svg.brush=function(){var Et=vt(fn,"brushstart","brush","brushend"),Vt=null,de=null,Ie=[0,0],Be=[0,0],He,hr,cr=!0,Fr=!0,vn=au[0];function fn(si){si.each(function(){var Oi=f.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ra).on("touchstart.brush",ra),$i=Oi.selectAll(".background").data([0]);$i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Oi.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ki=Oi.selectAll(".resize").data(vn,V);Ki.exit().remove(),Ki.enter().append("g").attr("class",function(ao){return"resize "+ao}).style("cursor",function(ao){return nl[ao]}).append("rect").attr("x",function(ao){return/[ew]$/.test(ao)?-3:null}).attr("y",function(ao){return/^[ns]/.test(ao)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ki.style("display",fn.empty()?"none":null);var sa=f.transition(Oi),vi=f.transition($i),ro;Vt&&(ro=Pi(Vt),vi.attr("x",ro[0]).attr("width",ro[1]-ro[0]),ti(sa)),de&&(ro=Pi(de),vi.attr("y",ro[0]).attr("height",ro[1]-ro[0]),ei(sa)),Bn(sa)})}fn.event=function(si){si.each(function(){var Oi=Et.of(this,arguments),$i={x:Ie,y:Be,i:He,j:hr},Ki=this.__chart__||$i;this.__chart__=$i,Yo?f.select(this).transition().each("start.brush",function(){He=Ki.i,hr=Ki.j,Ie=Ki.x,Be=Ki.y,Oi({type:"brushstart"})}).tween("brush:brush",function(){var sa=ic(Ie,$i.x),vi=ic(Be,$i.y);return He=hr=null,function(ro){Ie=$i.x=sa(ro),Be=$i.y=vi(ro),Oi({type:"brush",mode:"resize"})}}).each("end.brush",function(){He=$i.i,hr=$i.j,Oi({type:"brush",mode:"resize"}),Oi({type:"brushend"})}):(Oi({type:"brushstart"}),Oi({type:"brush",mode:"resize"}),Oi({type:"brushend"}))})};function Bn(si){si.selectAll(".resize").attr("transform",function(Oi){return"translate("+Ie[+/e$/.test(Oi)]+","+Be[+/^s/.test(Oi)]+")"})}function ti(si){si.select(".extent").attr("x",Ie[0]),si.selectAll(".extent,.n>rect,.s>rect").attr("width",Ie[1]-Ie[0])}function ei(si){si.select(".extent").attr("y",Be[0]),si.selectAll(".extent,.e>rect,.w>rect").attr("height",Be[1]-Be[0])}function ra(){var si=this,Oi=f.select(f.event.target),$i=Et.of(si,arguments),Ki=f.select(si),sa=Oi.datum(),vi=!/^(n|s)$/.test(sa)&&Vt,ro=!/^(e|w)$/.test(sa)&&de,ao=Oi.classed("extent"),xo=dn(si),$o,Ko=f.mouse(si),rs,_l=f.select(i(si)).on("keydown.brush",Bl).on("keyup.brush",ou);if(f.event.changedTouches?_l.on("touchmove.brush",wc).on("touchend.brush",il):_l.on("mousemove.brush",wc).on("mouseup.brush",il),Ki.interrupt().selectAll("*").interrupt(),ao)Ko[0]=Ie[0]-Ko[0],Ko[1]=Be[0]-Ko[1];else if(sa){var as=+/w$/.test(sa),Ts=+/^n/.test(sa);rs=[Ie[1-as]-Ko[0],Be[1-Ts]-Ko[1]],Ko[0]=Ie[as],Ko[1]=Be[Ts]}else f.event.altKey&&($o=Ko.slice());Ki.style("pointer-events","none").selectAll(".resize").style("display",null),f.select("body").style("cursor",Oi.style("cursor")),$i({type:"brushstart"}),wc();function Bl(){f.event.keyCode==32&&(ao||($o=null,Ko[0]-=Ie[1],Ko[1]-=Be[1],ao=2),ht())}function ou(){f.event.keyCode==32&&ao==2&&(Ko[0]+=Ie[1],Ko[1]+=Be[1],ao=0,ht())}function wc(){var ml=f.mouse(si),yc=!1;rs&&(ml[0]+=rs[0],ml[1]+=rs[1]),ao||(f.event.altKey?($o||($o=[(Ie[0]+Ie[1])/2,(Be[0]+Be[1])/2]),Ko[0]=Ie[+(ml[0]<$o[0])],Ko[1]=Be[+(ml[1]<$o[1])]):$o=null),vi&&zo(ml,Vt,0)&&(ti(Ki),yc=!0),ro&&zo(ml,de,1)&&(ei(Ki),yc=!0),yc&&(Bn(Ki),$i({type:"brush",mode:ao?"move":"resize"}))}function zo(ml,yc,oc){var ph=Pi(yc),Yl=ph[0],hc=ph[1],zh=Ko[oc],Se=oc?Be:Ie,Ir=Se[1]-Se[0],Vr,ri;if(ao&&(Yl-=zh,hc-=Ir+zh),Vr=(oc?Fr:cr)?Math.max(Yl,Math.min(hc,ml[oc])):ml[oc],ao?ri=(Vr+=zh)+Ir:($o&&(zh=Math.max(Yl,Math.min(hc,2*$o[oc]-Vr))),zh{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y=new Date,z=new Date;function P(Lt,ie,be,ce){function Le(Ze){return Lt(Ze=arguments.length===0?new Date:new Date(+Ze)),Ze}return Le.floor=function(Ze){return Lt(Ze=new Date(+Ze)),Ze},Le.ceil=function(Ze){return Lt(Ze=new Date(Ze-1)),ie(Ze,1),Lt(Ze),Ze},Le.round=function(Ze){var Qe=Le(Ze),mr=Le.ceil(Ze);return Ze-Qe0))return fr;do fr.push(Jr=new Date(+Ze)),ie(Ze,mr),Lt(Ze);while(Jr=Qe)for(;Lt(Qe),!Ze(Qe);)Qe.setTime(Qe-1)},function(Qe,mr){if(Qe>=Qe)if(mr<0)for(;++mr<=0;)for(;ie(Qe,-1),!Ze(Qe););else for(;--mr>=0;)for(;ie(Qe,1),!Ze(Qe););})},be&&(Le.count=function(Ze,Qe){return y.setTime(+Ze),z.setTime(+Qe),Lt(y),Lt(z),Math.floor(be(y,z))},Le.every=function(Ze){return Ze=Math.floor(Ze),!isFinite(Ze)||!(Ze>0)?null:Ze>1?Le.filter(ce?function(Qe){return ce(Qe)%Ze===0}:function(Qe){return Le.count(0,Qe)%Ze===0}):Le}),Le}var n=P(function(){},function(Lt,ie){Lt.setTime(+Lt+ie)},function(Lt,ie){return ie-Lt});n.every=function(Lt){return Lt=Math.floor(Lt),!isFinite(Lt)||!(Lt>0)?null:Lt>1?P(function(ie){ie.setTime(Math.floor(ie/Lt)*Lt)},function(ie,be){ie.setTime(+ie+be*Lt)},function(ie,be){return(be-ie)/Lt}):n};var i=n.range,a=1e3,l=6e4,o=36e5,c=864e5,s=6048e5,h=P(function(Lt){Lt.setTime(Lt-Lt.getMilliseconds())},function(Lt,ie){Lt.setTime(+Lt+ie*a)},function(Lt,ie){return(ie-Lt)/a},function(Lt){return Lt.getUTCSeconds()}),m=h.range,b=P(function(Lt){Lt.setTime(Lt-Lt.getMilliseconds()-Lt.getSeconds()*a)},function(Lt,ie){Lt.setTime(+Lt+ie*l)},function(Lt,ie){return(ie-Lt)/l},function(Lt){return Lt.getMinutes()}),x=b.range,_=P(function(Lt){Lt.setTime(Lt-Lt.getMilliseconds()-Lt.getSeconds()*a-Lt.getMinutes()*l)},function(Lt,ie){Lt.setTime(+Lt+ie*o)},function(Lt,ie){return(ie-Lt)/o},function(Lt){return Lt.getHours()}),A=_.range,d=P(function(Lt){Lt.setHours(0,0,0,0)},function(Lt,ie){Lt.setDate(Lt.getDate()+ie)},function(Lt,ie){return(ie-Lt-(ie.getTimezoneOffset()-Lt.getTimezoneOffset())*l)/c},function(Lt){return Lt.getDate()-1}),k=d.range;function w(Lt){return P(function(ie){ie.setDate(ie.getDate()-(ie.getDay()+7-Lt)%7),ie.setHours(0,0,0,0)},function(ie,be){ie.setDate(ie.getDate()+be*7)},function(ie,be){return(be-ie-(be.getTimezoneOffset()-ie.getTimezoneOffset())*l)/s})}var D=w(0),E=w(1),I=w(2),M=w(3),p=w(4),g=w(5),C=w(6),S=D.range,N=E.range,B=I.range,U=M.range,V=p.range,W=g.range,F=C.range,H=P(function(Lt){Lt.setDate(1),Lt.setHours(0,0,0,0)},function(Lt,ie){Lt.setMonth(Lt.getMonth()+ie)},function(Lt,ie){return ie.getMonth()-Lt.getMonth()+(ie.getFullYear()-Lt.getFullYear())*12},function(Lt){return Lt.getMonth()}),q=H.range,G=P(function(Lt){Lt.setMonth(0,1),Lt.setHours(0,0,0,0)},function(Lt,ie){Lt.setFullYear(Lt.getFullYear()+ie)},function(Lt,ie){return ie.getFullYear()-Lt.getFullYear()},function(Lt){return Lt.getFullYear()});G.every=function(Lt){return!isFinite(Lt=Math.floor(Lt))||!(Lt>0)?null:P(function(ie){ie.setFullYear(Math.floor(ie.getFullYear()/Lt)*Lt),ie.setMonth(0,1),ie.setHours(0,0,0,0)},function(ie,be){ie.setFullYear(ie.getFullYear()+be*Lt)})};var tt=G.range,ht=P(function(Lt){Lt.setUTCSeconds(0,0)},function(Lt,ie){Lt.setTime(+Lt+ie*l)},function(Lt,ie){return(ie-Lt)/l},function(Lt){return Lt.getUTCMinutes()}),bt=ht.range,vt=P(function(Lt){Lt.setUTCMinutes(0,0,0)},function(Lt,ie){Lt.setTime(+Lt+ie*o)},function(Lt,ie){return(ie-Lt)/o},function(Lt){return Lt.getUTCHours()}),ut=vt.range,rt=P(function(Lt){Lt.setUTCHours(0,0,0,0)},function(Lt,ie){Lt.setUTCDate(Lt.getUTCDate()+ie)},function(Lt,ie){return(ie-Lt)/c},function(Lt){return Lt.getUTCDate()-1}),gt=rt.range;function it(Lt){return P(function(ie){ie.setUTCDate(ie.getUTCDate()-(ie.getUTCDay()+7-Lt)%7),ie.setUTCHours(0,0,0,0)},function(ie,be){ie.setUTCDate(ie.getUTCDate()+be*7)},function(ie,be){return(be-ie)/s})}var st=it(0),xt=it(1),ot=it(2),J=it(3),mt=it(4),dt=it(5),Ct=it(6),Rt=st.range,Bt=xt.range,Zt=ot.range,Gt=J.range,ee=mt.range,xe=dt.range,ge=Ct.range,ye=P(function(Lt){Lt.setUTCDate(1),Lt.setUTCHours(0,0,0,0)},function(Lt,ie){Lt.setUTCMonth(Lt.getUTCMonth()+ie)},function(Lt,ie){return ie.getUTCMonth()-Lt.getUTCMonth()+(ie.getUTCFullYear()-Lt.getUTCFullYear())*12},function(Lt){return Lt.getUTCMonth()}),ue=ye.range,Mt=P(function(Lt){Lt.setUTCMonth(0,1),Lt.setUTCHours(0,0,0,0)},function(Lt,ie){Lt.setUTCFullYear(Lt.getUTCFullYear()+ie)},function(Lt,ie){return ie.getUTCFullYear()-Lt.getUTCFullYear()},function(Lt){return Lt.getUTCFullYear()});Mt.every=function(Lt){return!isFinite(Lt=Math.floor(Lt))||!(Lt>0)?null:P(function(ie){ie.setUTCFullYear(Math.floor(ie.getUTCFullYear()/Lt)*Lt),ie.setUTCMonth(0,1),ie.setUTCHours(0,0,0,0)},function(ie,be){ie.setUTCFullYear(ie.getUTCFullYear()+be*Lt)})};var Ot=Mt.range;f.timeDay=d,f.timeDays=k,f.timeFriday=g,f.timeFridays=W,f.timeHour=_,f.timeHours=A,f.timeInterval=P,f.timeMillisecond=n,f.timeMilliseconds=i,f.timeMinute=b,f.timeMinutes=x,f.timeMonday=E,f.timeMondays=N,f.timeMonth=H,f.timeMonths=q,f.timeSaturday=C,f.timeSaturdays=F,f.timeSecond=h,f.timeSeconds=m,f.timeSunday=D,f.timeSundays=S,f.timeThursday=p,f.timeThursdays=V,f.timeTuesday=I,f.timeTuesdays=B,f.timeWednesday=M,f.timeWednesdays=U,f.timeWeek=D,f.timeWeeks=S,f.timeYear=G,f.timeYears=tt,f.utcDay=rt,f.utcDays=gt,f.utcFriday=dt,f.utcFridays=xe,f.utcHour=vt,f.utcHours=ut,f.utcMillisecond=n,f.utcMilliseconds=i,f.utcMinute=ht,f.utcMinutes=bt,f.utcMonday=xt,f.utcMondays=Bt,f.utcMonth=ye,f.utcMonths=ue,f.utcSaturday=Ct,f.utcSaturdays=ge,f.utcSecond=h,f.utcSeconds=m,f.utcSunday=st,f.utcSundays=Rt,f.utcThursday=mt,f.utcThursdays=ee,f.utcTuesday=ot,f.utcTuesdays=Zt,f.utcWednesday=J,f.utcWednesdays=Gt,f.utcWeek=st,f.utcWeeks=Rt,f.utcYear=Mt,f.utcYears=Ot,Object.defineProperty(f,"__esModule",{value:!0})})}),on=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Vn()):(f=f||self,y(f.d3=f.d3||{},f.d3))})(et,function(f,y){function z(Xt){if(0<=Xt.y&&Xt.y<100){var oe=new Date(-1,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L);return oe.setFullYear(Xt.y),oe}return new Date(Xt.y,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L)}function P(Xt){if(0<=Xt.y&&Xt.y<100){var oe=new Date(Date.UTC(-1,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L));return oe.setUTCFullYear(Xt.y),oe}return new Date(Date.UTC(Xt.y,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L))}function n(Xt,oe,zt){return{y:Xt,m:oe,d:zt,H:0,M:0,S:0,L:0}}function i(Xt){var oe=Xt.dateTime,zt=Xt.date,_t=Xt.time,Pt=Xt.periods,Ht=Xt.days,ae=Xt.shortDays,he=Xt.months,Me=Xt.shortMonths,qe=m(Pt),Ye=b(Pt),ur=m(Ht),Rr=b(Ht),zr=m(ae),xr=b(ae),pn=m(he),ci=b(he),ui=m(Me),yi=b(Me),Gi={a:Fi,A:Zi,b:Ji,B:ca,c:null,d:H,e:H,f:bt,H:q,I:G,j:tt,L:ht,m:vt,M:ut,p:Ei,q:Ga,Q:Qe,s:mr,S:rt,u:gt,U:it,V:st,w:xt,W:ot,x:null,X:null,y:J,Y:mt,Z:dt,"%":Ze},Ci={a:so,A:Fe,b:Re,B:Kr,c:null,d:Ct,e:Ct,f:ee,H:Rt,I:Bt,j:Zt,L:Gt,m:xe,M:ge,p:sn,q:cn,Q:Qe,s:mr,S:ye,u:ue,U:Mt,V:Ot,w:Lt,W:ie,x:null,X:null,y:be,Y:ce,Z:Le,"%":Ze},fi={a:vr,A:Ar,b:mn,B:Zn,c:Un,d:p,e:p,f:U,H:C,I:C,j:g,L:B,m:M,M:S,p:sr,q:I,Q:W,s:F,S:N,u:_,U:A,V:d,w:x,W:k,x:Wn,X:Li,y:D,Y:w,Z:E,"%":V};Gi.x=ba(zt,Gi),Gi.X=ba(_t,Gi),Gi.c=ba(oe,Gi),Ci.x=ba(zt,Ci),Ci.X=ba(_t,Ci),Ci.c=ba(oe,Ci);function ba(Yr,un){return function(Pn){var bn=[],ze=-1,yr=0,en=Yr.length,Rn,ni,xi;for(Pn instanceof Date||(Pn=new Date(+Pn));++ze53)return null;"w"in bn||(bn.w=1),"Z"in bn?(yr=P(n(bn.y,0,1)),en=yr.getUTCDay(),yr=en>4||en===0?y.utcMonday.ceil(yr):y.utcMonday(yr),yr=y.utcDay.offset(yr,(bn.V-1)*7),bn.y=yr.getUTCFullYear(),bn.m=yr.getUTCMonth(),bn.d=yr.getUTCDate()+(bn.w+6)%7):(yr=z(n(bn.y,0,1)),en=yr.getDay(),yr=en>4||en===0?y.timeMonday.ceil(yr):y.timeMonday(yr),yr=y.timeDay.offset(yr,(bn.V-1)*7),bn.y=yr.getFullYear(),bn.m=yr.getMonth(),bn.d=yr.getDate()+(bn.w+6)%7)}else("W"in bn||"U"in bn)&&("w"in bn||(bn.w="u"in bn?bn.u%7:"W"in bn?1:0),en="Z"in bn?P(n(bn.y,0,1)).getUTCDay():z(n(bn.y,0,1)).getDay(),bn.m=0,bn.d="W"in bn?(bn.w+6)%7+bn.W*7-(en+5)%7:bn.w+bn.U*7-(en+6)%7);return"Z"in bn?(bn.H+=bn.Z/100|0,bn.M+=bn.Z%100,P(bn)):z(bn)}}function Ke(Yr,un,Pn,bn){for(var ze=0,yr=un.length,en=Pn.length,Rn,ni;ze=en)return-1;if(Rn=un.charCodeAt(ze++),Rn===37){if(Rn=un.charAt(ze++),ni=fi[Rn in a?un.charAt(ze++):Rn],!ni||(bn=ni(Yr,Pn,bn))<0)return-1}else if(Rn!=Pn.charCodeAt(bn++))return-1}return bn}function sr(Yr,un,Pn){var bn=qe.exec(un.slice(Pn));return bn?(Yr.p=Ye[bn[0].toLowerCase()],Pn+bn[0].length):-1}function vr(Yr,un,Pn){var bn=zr.exec(un.slice(Pn));return bn?(Yr.w=xr[bn[0].toLowerCase()],Pn+bn[0].length):-1}function Ar(Yr,un,Pn){var bn=ur.exec(un.slice(Pn));return bn?(Yr.w=Rr[bn[0].toLowerCase()],Pn+bn[0].length):-1}function mn(Yr,un,Pn){var bn=ui.exec(un.slice(Pn));return bn?(Yr.m=yi[bn[0].toLowerCase()],Pn+bn[0].length):-1}function Zn(Yr,un,Pn){var bn=pn.exec(un.slice(Pn));return bn?(Yr.m=ci[bn[0].toLowerCase()],Pn+bn[0].length):-1}function Un(Yr,un,Pn){return Ke(Yr,oe,un,Pn)}function Wn(Yr,un,Pn){return Ke(Yr,zt,un,Pn)}function Li(Yr,un,Pn){return Ke(Yr,_t,un,Pn)}function Fi(Yr){return ae[Yr.getDay()]}function Zi(Yr){return Ht[Yr.getDay()]}function Ji(Yr){return Me[Yr.getMonth()]}function ca(Yr){return he[Yr.getMonth()]}function Ei(Yr){return Pt[+(Yr.getHours()>=12)]}function Ga(Yr){return 1+~~(Yr.getMonth()/3)}function so(Yr){return ae[Yr.getUTCDay()]}function Fe(Yr){return Ht[Yr.getUTCDay()]}function Re(Yr){return Me[Yr.getUTCMonth()]}function Kr(Yr){return he[Yr.getUTCMonth()]}function sn(Yr){return Pt[+(Yr.getUTCHours()>=12)]}function cn(Yr){return 1+~~(Yr.getUTCMonth()/3)}return{format:function(Yr){var un=ba(Yr+="",Gi);return un.toString=function(){return Yr},un},parse:function(Yr){var un=oa(Yr+="",!1);return un.toString=function(){return Yr},un},utcFormat:function(Yr){var un=ba(Yr+="",Ci);return un.toString=function(){return Yr},un},utcParse:function(Yr){var un=oa(Yr+="",!0);return un.toString=function(){return Yr},un}}}var a={"-":"",_:" ",0:"0"},l=/^\s*\d+/,o=/^%/,c=/[\\^$*+?|[\]().{}]/g;function s(Xt,oe,zt){var _t=Xt<0?"-":"",Pt=(_t?-Xt:Xt)+"",Ht=Pt.length;return _t+(Ht68?1900:2e3),zt+_t[0].length):-1}function E(Xt,oe,zt){var _t=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(oe.slice(zt,zt+6));return _t?(Xt.Z=_t[1]?0:-(_t[2]+(_t[3]||"00")),zt+_t[0].length):-1}function I(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+1));return _t?(Xt.q=_t[0]*3-3,zt+_t[0].length):-1}function M(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.m=_t[0]-1,zt+_t[0].length):-1}function p(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.d=+_t[0],zt+_t[0].length):-1}function g(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+3));return _t?(Xt.m=0,Xt.d=+_t[0],zt+_t[0].length):-1}function C(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.H=+_t[0],zt+_t[0].length):-1}function S(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.M=+_t[0],zt+_t[0].length):-1}function N(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.S=+_t[0],zt+_t[0].length):-1}function B(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+3));return _t?(Xt.L=+_t[0],zt+_t[0].length):-1}function U(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+6));return _t?(Xt.L=Math.floor(_t[0]/1e3),zt+_t[0].length):-1}function V(Xt,oe,zt){var _t=o.exec(oe.slice(zt,zt+1));return _t?zt+_t[0].length:-1}function W(Xt,oe,zt){var _t=l.exec(oe.slice(zt));return _t?(Xt.Q=+_t[0],zt+_t[0].length):-1}function F(Xt,oe,zt){var _t=l.exec(oe.slice(zt));return _t?(Xt.s=+_t[0],zt+_t[0].length):-1}function H(Xt,oe){return s(Xt.getDate(),oe,2)}function q(Xt,oe){return s(Xt.getHours(),oe,2)}function G(Xt,oe){return s(Xt.getHours()%12||12,oe,2)}function tt(Xt,oe){return s(1+y.timeDay.count(y.timeYear(Xt),Xt),oe,3)}function ht(Xt,oe){return s(Xt.getMilliseconds(),oe,3)}function bt(Xt,oe){return ht(Xt,oe)+"000"}function vt(Xt,oe){return s(Xt.getMonth()+1,oe,2)}function ut(Xt,oe){return s(Xt.getMinutes(),oe,2)}function rt(Xt,oe){return s(Xt.getSeconds(),oe,2)}function gt(Xt){var oe=Xt.getDay();return oe===0?7:oe}function it(Xt,oe){return s(y.timeSunday.count(y.timeYear(Xt)-1,Xt),oe,2)}function st(Xt,oe){var zt=Xt.getDay();return Xt=zt>=4||zt===0?y.timeThursday(Xt):y.timeThursday.ceil(Xt),s(y.timeThursday.count(y.timeYear(Xt),Xt)+(y.timeYear(Xt).getDay()===4),oe,2)}function xt(Xt){return Xt.getDay()}function ot(Xt,oe){return s(y.timeMonday.count(y.timeYear(Xt)-1,Xt),oe,2)}function J(Xt,oe){return s(Xt.getFullYear()%100,oe,2)}function mt(Xt,oe){return s(Xt.getFullYear()%1e4,oe,4)}function dt(Xt){var oe=Xt.getTimezoneOffset();return(oe>0?"-":(oe*=-1,"+"))+s(oe/60|0,"0",2)+s(oe%60,"0",2)}function Ct(Xt,oe){return s(Xt.getUTCDate(),oe,2)}function Rt(Xt,oe){return s(Xt.getUTCHours(),oe,2)}function Bt(Xt,oe){return s(Xt.getUTCHours()%12||12,oe,2)}function Zt(Xt,oe){return s(1+y.utcDay.count(y.utcYear(Xt),Xt),oe,3)}function Gt(Xt,oe){return s(Xt.getUTCMilliseconds(),oe,3)}function ee(Xt,oe){return Gt(Xt,oe)+"000"}function xe(Xt,oe){return s(Xt.getUTCMonth()+1,oe,2)}function ge(Xt,oe){return s(Xt.getUTCMinutes(),oe,2)}function ye(Xt,oe){return s(Xt.getUTCSeconds(),oe,2)}function ue(Xt){var oe=Xt.getUTCDay();return oe===0?7:oe}function Mt(Xt,oe){return s(y.utcSunday.count(y.utcYear(Xt)-1,Xt),oe,2)}function Ot(Xt,oe){var zt=Xt.getUTCDay();return Xt=zt>=4||zt===0?y.utcThursday(Xt):y.utcThursday.ceil(Xt),s(y.utcThursday.count(y.utcYear(Xt),Xt)+(y.utcYear(Xt).getUTCDay()===4),oe,2)}function Lt(Xt){return Xt.getUTCDay()}function ie(Xt,oe){return s(y.utcMonday.count(y.utcYear(Xt)-1,Xt),oe,2)}function be(Xt,oe){return s(Xt.getUTCFullYear()%100,oe,2)}function ce(Xt,oe){return s(Xt.getUTCFullYear()%1e4,oe,4)}function Le(){return"+0000"}function Ze(){return"%"}function Qe(Xt){return+Xt}function mr(Xt){return Math.floor(+Xt/1e3)}var fr;Jr({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"]});function Jr(Xt){return fr=i(Xt),f.timeFormat=fr.format,f.timeParse=fr.parse,f.utcFormat=fr.utcFormat,f.utcParse=fr.utcParse,fr}var an="%Y-%m-%dT%H:%M:%S.%LZ";function Er(Xt){return Xt.toISOString()}var dn=Date.prototype.toISOString?Er:f.utcFormat(an);function _n(Xt){var oe=new Date(Xt);return isNaN(oe)?null:oe}var Oe=+new Date("2000-01-01T00:00:00.000Z")?_n:f.utcParse(an);f.isoFormat=dn,f.isoParse=Oe,f.timeFormatDefaultLocale=Jr,f.timeFormatLocale=i,Object.defineProperty(f,"__esModule",{value:!0})})}),pr=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=typeof globalThis<"u"?globalThis:f||self,y(f.d3=f.d3||{}))})(et,function(f){function y(M){return Math.abs(M=Math.round(M))>=1e21?M.toLocaleString("en").replace(/,/g,""):M.toString(10)}function z(M,p){if((g=(M=p?M.toExponential(p-1):M.toExponential()).indexOf("e"))<0)return null;var g,C=M.slice(0,g);return[C.length>1?C[0]+C.slice(2):C,+M.slice(g+1)]}function P(M){return M=z(Math.abs(M)),M?M[1]:NaN}function n(M,p){return function(g,C){for(var S=g.length,N=[],B=0,U=M[0],V=0;S>0&&U>0&&(V+U+1>C&&(U=Math.max(1,C-V)),N.push(g.substring(S-=U,S+U)),!((V+=U+1)>C));)U=M[B=(B+1)%M.length];return N.reverse().join(p)}}function i(M){return function(p){return p.replace(/[0-9]/g,function(g){return M[+g]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l(M){if(!(p=a.exec(M)))throw new Error("invalid format: "+M);var p;return new o({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}l.prototype=o.prototype;function o(M){this.fill=M.fill===void 0?" ":M.fill+"",this.align=M.align===void 0?">":M.align+"",this.sign=M.sign===void 0?"-":M.sign+"",this.symbol=M.symbol===void 0?"":M.symbol+"",this.zero=!!M.zero,this.width=M.width===void 0?void 0:+M.width,this.comma=!!M.comma,this.precision=M.precision===void 0?void 0:+M.precision,this.trim=!!M.trim,this.type=M.type===void 0?"":M.type+""}o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function c(M){t:for(var p=M.length,g=1,C=-1,S;g0&&(C=0);break}return C>0?M.slice(0,C)+M.slice(S+1):M}var s;function h(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],S=g[1],N=S-(s=Math.max(-8,Math.min(8,Math.floor(S/3)))*3)+1,B=C.length;return N===B?C:N>B?C+new Array(N-B+1).join("0"):N>0?C.slice(0,N)+"."+C.slice(N):"0."+new Array(1-N).join("0")+z(M,Math.max(0,p+N-1))[0]}function m(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],S=g[1];return S<0?"0."+new Array(-S).join("0")+C:C.length>S+1?C.slice(0,S+1)+"."+C.slice(S+1):C+new Array(S-C.length+2).join("0")}var b={"%":function(M,p){return(M*100).toFixed(p)},b:function(M){return Math.round(M).toString(2)},c:function(M){return M+""},d:y,e:function(M,p){return M.toExponential(p)},f:function(M,p){return M.toFixed(p)},g:function(M,p){return M.toPrecision(p)},o:function(M){return Math.round(M).toString(8)},p:function(M,p){return m(M*100,p)},r:m,s:h,X:function(M){return Math.round(M).toString(16).toUpperCase()},x:function(M){return Math.round(M).toString(16)}};function x(M){return M}var _=Array.prototype.map,A=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function d(M){var p=M.grouping===void 0||M.thousands===void 0?x:n(_.call(M.grouping,Number),M.thousands+""),g=M.currency===void 0?"":M.currency[0]+"",C=M.currency===void 0?"":M.currency[1]+"",S=M.decimal===void 0?".":M.decimal+"",N=M.numerals===void 0?x:i(_.call(M.numerals,String)),B=M.percent===void 0?"%":M.percent+"",U=M.minus===void 0?"-":M.minus+"",V=M.nan===void 0?"NaN":M.nan+"";function W(H){H=l(H);var q=H.fill,G=H.align,tt=H.sign,ht=H.symbol,bt=H.zero,vt=H.width,ut=H.comma,rt=H.precision,gt=H.trim,it=H.type;it==="n"?(ut=!0,it="g"):b[it]||(rt===void 0&&(rt=12),gt=!0,it="g"),(bt||q==="0"&&G==="=")&&(bt=!0,q="0",G="=");var st=ht==="$"?g:ht==="#"&&/[boxX]/.test(it)?"0"+it.toLowerCase():"",xt=ht==="$"?C:/[%p]/.test(it)?B:"",ot=b[it],J=/[defgprs%]/.test(it);rt=rt===void 0?6:/[gprs]/.test(it)?Math.max(1,Math.min(21,rt)):Math.max(0,Math.min(20,rt));function mt(dt){var Ct=st,Rt=xt,Bt,Zt,Gt;if(it==="c")Rt=ot(dt)+Rt,dt="";else{dt=+dt;var ee=dt<0||1/dt<0;if(dt=isNaN(dt)?V:ot(Math.abs(dt),rt),gt&&(dt=c(dt)),ee&&+dt==0&&tt!=="+"&&(ee=!1),Ct=(ee?tt==="("?tt:U:tt==="-"||tt==="("?"":tt)+Ct,Rt=(it==="s"?A[8+s/3]:"")+Rt+(ee&&tt==="("?")":""),J){for(Bt=-1,Zt=dt.length;++BtGt||Gt>57){Rt=(Gt===46?S+dt.slice(Bt+1):dt.slice(Bt))+Rt,dt=dt.slice(0,Bt);break}}}ut&&!bt&&(dt=p(dt,1/0));var xe=Ct.length+dt.length+Rt.length,ge=xe>1)+Ct+dt+Rt+ge.slice(xe);break;default:dt=ge+Ct+dt+Rt;break}return N(dt)}return mt.toString=function(){return H+""},mt}function F(H,q){var G=W((H=l(H),H.type="f",H)),tt=Math.max(-8,Math.min(8,Math.floor(P(q)/3)))*3,ht=Math.pow(10,-tt),bt=A[8+tt/3];return function(vt){return G(ht*vt)+bt}}return{format:W,formatPrefix:F}}var k;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(M){return k=d(M),f.format=k.format,f.formatPrefix=k.formatPrefix,k}function D(M){return Math.max(0,-P(Math.abs(M)))}function E(M,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(P(p)/3)))*3-P(Math.abs(M)))}function I(M,p){return M=Math.abs(M),p=Math.abs(p)-M,Math.max(0,P(p)-P(M))+1}f.FormatSpecifier=o,f.formatDefaultLocale=w,f.formatLocale=d,f.formatSpecifier=l,f.precisionFixed=D,f.precisionPrefix=E,f.precisionRound=I,Object.defineProperty(f,"__esModule",{value:!0})})}),_r=It((et,Y)=>{Y.exports=function(f){for(var y=f.length,z,P=0;P13)&&z!==32&&z!==133&&z!==160&&z!==5760&&z!==6158&&(z<8192||z>8205)&&z!==8232&&z!==8233&&z!==8239&&z!==8287&&z!==8288&&z!==12288&&z!==65279)return!1;return!0}}),Sr=It((et,Y)=>{var f=_r();Y.exports=function(y){var z=typeof y;if(z==="string"){var P=y;if(y=+y,y===0&&f(P))return!1}else if(z!=="number")return!1;return y-y<1}}),Dr=It((et,Y)=>{Y.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}),nn=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=typeof globalThis<"u"?globalThis:f||self,y(f["base64-arraybuffer"]={}))})(et,function(f){for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=typeof Uint8Array>"u"?[]:new Uint8Array(256),P=0;P>2],s+=y[(l[o]&3)<<4|l[o+1]>>4],s+=y[(l[o+1]&15)<<2|l[o+2]>>6],s+=y[l[o+2]&63];return c%3===2?s=s.substring(0,s.length-1)+"=":c%3===1&&(s=s.substring(0,s.length-2)+"=="),s},i=function(a){var l=a.length*.75,o=a.length,c,s=0,h,m,b,x;a[a.length-1]==="="&&(l--,a[a.length-2]==="="&&l--);var _=new ArrayBuffer(l),A=new Uint8Array(_);for(c=0;c>4,A[s++]=(m&15)<<4|b>>2,A[s++]=(b&3)<<6|x&63;return _};f.decode=i,f.encode=n,Object.defineProperty(f,"__esModule",{value:!0})})}),Cn=It((et,Y)=>{Y.exports=function(f){return window&&window.process&&window.process.versions?Object.prototype.toString.call(f)==="[object Object]":Object.prototype.toString.call(f)==="[object Object]"&&Object.getPrototypeOf(f).hasOwnProperty("hasOwnProperty")}}),Xn=It(et=>{var Y=nn().decode,f=Cn(),y=Array.isArray,z=ArrayBuffer,P=DataView;function n(h){return z.isView(h)&&!(h instanceof P)}et.isTypedArray=n;function i(h){return y(h)||n(h)}et.isArrayOrTypedArray=i;function a(h){return!i(h[0])}et.isArray1D=a,et.ensureArray=function(h,m){return y(h)||(h=[]),h.length=m,h};var l={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8;function o(h){return h.constructor===ArrayBuffer}et.isArrayBuffer=o,et.decodeTypedArraySpec=function(h){var m=[],b=c(h),x=b.dtype,_=l[x];if(!_)throw new Error('Error in dtype: "'+x+'"');var A=_.BYTES_PER_ELEMENT,d=b.bdata;o(d)||(d=Y(d));var k=b.shape===void 0?[d.byteLength/A]:(""+b.shape).split(",");k.reverse();var w=k.length,D,E,I=+k[0],M=A*I,p=0;if(w===1)m=new _(d);else if(w===2)for(D=+k[1],E=0;E{var f=Sr(),y=Xn().isArrayOrTypedArray;Y.exports=function(s,h){if(f(h))h=String(h);else if(typeof h!="string"||h.substr(h.length-4)==="[-1]")throw"bad property string";var m=h.split("."),b,x,_,A;for(A=0;A{var f=_i(),y=/^\w*$/,z=0,P=1,n=2,i=3,a=4;Y.exports=function(l,o,c,s){c=c||"name",s=s||"value";var h,m,b,x={};o&&o.length?(b=f(l,o),m=b.get()):m=l,o=o||"";var _={};if(m)for(h=0;h2)return x[w]=x[w]|n,d.set(k,null);if(A){for(h=w;h{var f=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,y=/^[^\.\[\]]+$/;Y.exports=function(z,P){for(;P;){var n=z.match(f);if(n)z=n[1];else if(z.match(y))z="";else throw new Error("bad relativeAttr call:"+[z,P]);if(P.charAt(0)==="^")P=P.slice(1);else break}return z&&P.charAt(0)!=="["?z+"."+P:z+P}}),_a=It((et,Y)=>{var f=Sr();Y.exports=function(y,z){if(y>0)return Math.log(y)/Math.LN10;var P=Math.log(Math.min(z[0],z[1]))/Math.LN10;return f(P)||(P=Math.log(Math.max(z[0],z[1]))/Math.LN10-6),P}}),qi=It((et,Y)=>{var f=Xn().isArrayOrTypedArray,y=Cn();Y.exports=function z(P,n){for(var i in n){var a=n[i],l=P[i];if(l!==a)if(i.charAt(0)==="_"||typeof a=="function"){if(i in P)continue;P[i]=a}else if(f(a)&&f(l)&&y(a[0])){if(i==="customdata"||i==="ids")continue;for(var o=Math.min(a.length,l.length),c=0;c{function f(z,P){var n=z%P;return n<0?n+P:n}function y(z,P){return Math.abs(z)>P/2?z-Math.round(z/P)*P:z}Y.exports={mod:f,modHalf:y}}),Xi=It((et,Y)=>{(function(f){var y=/^\s+/,z=/\s+$/,P=0,n=f.round,i=f.min,a=f.max,l=f.random;function o(J,mt){if(J=J||"",mt=mt||{},J instanceof o)return J;if(!(this instanceof o))return new o(J,mt);var dt=c(J);this._originalInput=J,this._r=dt.r,this._g=dt.g,this._b=dt.b,this._a=dt.a,this._roundA=n(100*this._a)/100,this._format=mt.format||dt.format,this._gradientType=mt.gradientType,this._r<1&&(this._r=n(this._r)),this._g<1&&(this._g=n(this._g)),this._b<1&&(this._b=n(this._b)),this._ok=dt.ok,this._tc_id=P++}o.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var J=this.toRgb();return(J.r*299+J.g*587+J.b*114)/1e3},getLuminance:function(){var J=this.toRgb(),mt,dt,Ct,Rt,Bt,Zt;return mt=J.r/255,dt=J.g/255,Ct=J.b/255,mt<=.03928?Rt=mt/12.92:Rt=f.pow((mt+.055)/1.055,2.4),dt<=.03928?Bt=dt/12.92:Bt=f.pow((dt+.055)/1.055,2.4),Ct<=.03928?Zt=Ct/12.92:Zt=f.pow((Ct+.055)/1.055,2.4),.2126*Rt+.7152*Bt+.0722*Zt},setAlpha:function(J){return this._a=H(J),this._roundA=n(100*this._a)/100,this},toHsv:function(){var J=b(this._r,this._g,this._b);return{h:J.h*360,s:J.s,v:J.v,a:this._a}},toHsvString:function(){var J=b(this._r,this._g,this._b),mt=n(J.h*360),dt=n(J.s*100),Ct=n(J.v*100);return this._a==1?"hsv("+mt+", "+dt+"%, "+Ct+"%)":"hsva("+mt+", "+dt+"%, "+Ct+"%, "+this._roundA+")"},toHsl:function(){var J=h(this._r,this._g,this._b);return{h:J.h*360,s:J.s,l:J.l,a:this._a}},toHslString:function(){var J=h(this._r,this._g,this._b),mt=n(J.h*360),dt=n(J.s*100),Ct=n(J.l*100);return this._a==1?"hsl("+mt+", "+dt+"%, "+Ct+"%)":"hsla("+mt+", "+dt+"%, "+Ct+"%, "+this._roundA+")"},toHex:function(J){return _(this._r,this._g,this._b,J)},toHexString:function(J){return"#"+this.toHex(J)},toHex8:function(J){return A(this._r,this._g,this._b,this._a,J)},toHex8String:function(J){return"#"+this.toHex8(J)},toRgb:function(){return{r:n(this._r),g:n(this._g),b:n(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+n(this._r)+", "+n(this._g)+", "+n(this._b)+")":"rgba("+n(this._r)+", "+n(this._g)+", "+n(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:n(q(this._r,255)*100)+"%",g:n(q(this._g,255)*100)+"%",b:n(q(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+n(q(this._r,255)*100)+"%, "+n(q(this._g,255)*100)+"%, "+n(q(this._b,255)*100)+"%)":"rgba("+n(q(this._r,255)*100)+"%, "+n(q(this._g,255)*100)+"%, "+n(q(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:W[_(this._r,this._g,this._b,!0)]||!1},toFilter:function(J){var mt="#"+d(this._r,this._g,this._b,this._a),dt=mt,Ct=this._gradientType?"GradientType = 1, ":"";if(J){var Rt=o(J);dt="#"+d(Rt._r,Rt._g,Rt._b,Rt._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ct+"startColorstr="+mt+",endColorstr="+dt+")"},toString:function(J){var mt=!!J;J=J||this._format;var dt=!1,Ct=this._a<1&&this._a>=0,Rt=!mt&&Ct&&(J==="hex"||J==="hex6"||J==="hex3"||J==="hex4"||J==="hex8"||J==="name");return Rt?J==="name"&&this._a===0?this.toName():this.toRgbString():(J==="rgb"&&(dt=this.toRgbString()),J==="prgb"&&(dt=this.toPercentageRgbString()),(J==="hex"||J==="hex6")&&(dt=this.toHexString()),J==="hex3"&&(dt=this.toHexString(!0)),J==="hex4"&&(dt=this.toHex8String(!0)),J==="hex8"&&(dt=this.toHex8String()),J==="name"&&(dt=this.toName()),J==="hsl"&&(dt=this.toHslString()),J==="hsv"&&(dt=this.toHsvString()),dt||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(J,mt){var dt=J.apply(null,[this].concat([].slice.call(mt)));return this._r=dt._r,this._g=dt._g,this._b=dt._b,this.setAlpha(dt._a),this},lighten:function(){return this._applyModification(E,arguments)},brighten:function(){return this._applyModification(I,arguments)},darken:function(){return this._applyModification(M,arguments)},desaturate:function(){return this._applyModification(k,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(J,mt){return J.apply(null,[this].concat([].slice.call(mt)))},analogous:function(){return this._applyCombination(B,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(U,arguments)},splitcomplement:function(){return this._applyCombination(N,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},o.fromRatio=function(J,mt){if(typeof J=="object"){var dt={};for(var Ct in J)J.hasOwnProperty(Ct)&&(Ct==="a"?dt[Ct]=J[Ct]:dt[Ct]=ut(J[Ct]));J=dt}return o(J,mt)};function c(J){var mt={r:0,g:0,b:0},dt=1,Ct=null,Rt=null,Bt=null,Zt=!1,Gt=!1;return typeof J=="string"&&(J=xt(J)),typeof J=="object"&&(st(J.r)&&st(J.g)&&st(J.b)?(mt=s(J.r,J.g,J.b),Zt=!0,Gt=String(J.r).substr(-1)==="%"?"prgb":"rgb"):st(J.h)&&st(J.s)&&st(J.v)?(Ct=ut(J.s),Rt=ut(J.v),mt=x(J.h,Ct,Rt),Zt=!0,Gt="hsv"):st(J.h)&&st(J.s)&&st(J.l)&&(Ct=ut(J.s),Bt=ut(J.l),mt=m(J.h,Ct,Bt),Zt=!0,Gt="hsl"),J.hasOwnProperty("a")&&(dt=J.a)),dt=H(dt),{ok:Zt,format:J.format||Gt,r:i(255,a(mt.r,0)),g:i(255,a(mt.g,0)),b:i(255,a(mt.b,0)),a:dt}}function s(J,mt,dt){return{r:q(J,255)*255,g:q(mt,255)*255,b:q(dt,255)*255}}function h(J,mt,dt){J=q(J,255),mt=q(mt,255),dt=q(dt,255);var Ct=a(J,mt,dt),Rt=i(J,mt,dt),Bt,Zt,Gt=(Ct+Rt)/2;if(Ct==Rt)Bt=Zt=0;else{var ee=Ct-Rt;switch(Zt=Gt>.5?ee/(2-Ct-Rt):ee/(Ct+Rt),Ct){case J:Bt=(mt-dt)/ee+(mt1&&(ye-=1),ye<1/6?xe+(ge-xe)*6*ye:ye<1/2?ge:ye<2/3?xe+(ge-xe)*(2/3-ye)*6:xe}if(mt===0)Ct=Rt=Bt=dt;else{var Gt=dt<.5?dt*(1+mt):dt+mt-dt*mt,ee=2*dt-Gt;Ct=Zt(ee,Gt,J+1/3),Rt=Zt(ee,Gt,J),Bt=Zt(ee,Gt,J-1/3)}return{r:Ct*255,g:Rt*255,b:Bt*255}}function b(J,mt,dt){J=q(J,255),mt=q(mt,255),dt=q(dt,255);var Ct=a(J,mt,dt),Rt=i(J,mt,dt),Bt,Zt,Gt=Ct,ee=Ct-Rt;if(Zt=Ct===0?0:ee/Ct,Ct==Rt)Bt=0;else{switch(Ct){case J:Bt=(mt-dt)/ee+(mt>1)+720)%360;--mt;)Ct.h=(Ct.h+Rt)%360,Bt.push(o(Ct));return Bt}function U(J,mt){mt=mt||6;for(var dt=o(J).toHsv(),Ct=dt.h,Rt=dt.s,Bt=dt.v,Zt=[],Gt=1/mt;mt--;)Zt.push(o({h:Ct,s:Rt,v:Bt})),Bt=(Bt+Gt)%1;return Zt}o.mix=function(J,mt,dt){dt=dt===0?0:dt||50;var Ct=o(J).toRgb(),Rt=o(mt).toRgb(),Bt=dt/100,Zt={r:(Rt.r-Ct.r)*Bt+Ct.r,g:(Rt.g-Ct.g)*Bt+Ct.g,b:(Rt.b-Ct.b)*Bt+Ct.b,a:(Rt.a-Ct.a)*Bt+Ct.a};return o(Zt)},o.readability=function(J,mt){var dt=o(J),Ct=o(mt);return(f.max(dt.getLuminance(),Ct.getLuminance())+.05)/(f.min(dt.getLuminance(),Ct.getLuminance())+.05)},o.isReadable=function(J,mt,dt){var Ct=o.readability(J,mt),Rt,Bt;switch(Bt=!1,Rt=ot(dt),Rt.level+Rt.size){case"AAsmall":case"AAAlarge":Bt=Ct>=4.5;break;case"AAlarge":Bt=Ct>=3;break;case"AAAsmall":Bt=Ct>=7;break}return Bt},o.mostReadable=function(J,mt,dt){var Ct=null,Rt=0,Bt,Zt,Gt,ee;dt=dt||{},Zt=dt.includeFallbackColors,Gt=dt.level,ee=dt.size;for(var xe=0;xeRt&&(Rt=Bt,Ct=o(mt[xe]));return o.isReadable(J,Ct,{level:Gt,size:ee})||!Zt?Ct:(dt.includeFallbackColors=!1,o.mostReadable(J,["#fff","#000"],dt))};var V=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},W=o.hexNames=F(V);function F(J){var mt={};for(var dt in J)J.hasOwnProperty(dt)&&(mt[J[dt]]=dt);return mt}function H(J){return J=parseFloat(J),(isNaN(J)||J<0||J>1)&&(J=1),J}function q(J,mt){ht(J)&&(J="100%");var dt=bt(J);return J=i(mt,a(0,parseFloat(J))),dt&&(J=parseInt(J*mt,10)/100),f.abs(J-mt)<1e-6?1:J%mt/parseFloat(mt)}function G(J){return i(1,a(0,J))}function tt(J){return parseInt(J,16)}function ht(J){return typeof J=="string"&&J.indexOf(".")!=-1&&parseFloat(J)===1}function bt(J){return typeof J=="string"&&J.indexOf("%")!=-1}function vt(J){return J.length==1?"0"+J:""+J}function ut(J){return J<=1&&(J=J*100+"%"),J}function rt(J){return f.round(parseFloat(J)*255).toString(16)}function gt(J){return tt(J)/255}var it=function(){var J="[-\\+]?\\d+%?",mt="[-\\+]?\\d*\\.\\d+%?",dt="(?:"+mt+")|(?:"+J+")",Ct="[\\s|\\(]+("+dt+")[,|\\s]+("+dt+")[,|\\s]+("+dt+")\\s*\\)?",Rt="[\\s|\\(]+("+dt+")[,|\\s]+("+dt+")[,|\\s]+("+dt+")[,|\\s]+("+dt+")\\s*\\)?";return{CSS_UNIT:new RegExp(dt),rgb:new RegExp("rgb"+Ct),rgba:new RegExp("rgba"+Rt),hsl:new RegExp("hsl"+Ct),hsla:new RegExp("hsla"+Rt),hsv:new RegExp("hsv"+Ct),hsva:new RegExp("hsva"+Rt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function st(J){return!!it.CSS_UNIT.exec(J)}function xt(J){J=J.replace(y,"").replace(z,"").toLowerCase();var mt=!1;if(V[J])J=V[J],mt=!0;else if(J=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var dt;return(dt=it.rgb.exec(J))?{r:dt[1],g:dt[2],b:dt[3]}:(dt=it.rgba.exec(J))?{r:dt[1],g:dt[2],b:dt[3],a:dt[4]}:(dt=it.hsl.exec(J))?{h:dt[1],s:dt[2],l:dt[3]}:(dt=it.hsla.exec(J))?{h:dt[1],s:dt[2],l:dt[3],a:dt[4]}:(dt=it.hsv.exec(J))?{h:dt[1],s:dt[2],v:dt[3]}:(dt=it.hsva.exec(J))?{h:dt[1],s:dt[2],v:dt[3],a:dt[4]}:(dt=it.hex8.exec(J))?{r:tt(dt[1]),g:tt(dt[2]),b:tt(dt[3]),a:gt(dt[4]),format:mt?"name":"hex8"}:(dt=it.hex6.exec(J))?{r:tt(dt[1]),g:tt(dt[2]),b:tt(dt[3]),format:mt?"name":"hex"}:(dt=it.hex4.exec(J))?{r:tt(dt[1]+""+dt[1]),g:tt(dt[2]+""+dt[2]),b:tt(dt[3]+""+dt[3]),a:gt(dt[4]+""+dt[4]),format:mt?"name":"hex8"}:(dt=it.hex3.exec(J))?{r:tt(dt[1]+""+dt[1]),g:tt(dt[2]+""+dt[2]),b:tt(dt[3]+""+dt[3]),format:mt?"name":"hex"}:!1}function ot(J){var mt,dt;return J=J||{level:"AA",size:"small"},mt=(J.level||"AA").toUpperCase(),dt=(J.size||"small").toLowerCase(),mt!=="AA"&&mt!=="AAA"&&(mt="AA"),dt!=="small"&&dt!=="large"&&(dt="small"),{level:mt,size:dt}}typeof Y<"u"&&Y.exports?Y.exports=o:window.tinycolor=o})(Math)}),Yn=It(et=>{var Y=Cn(),f=Array.isArray;function y(P,n){var i,a;for(i=0;i{Y.exports=function(f){var y=f.variantValues,z=f.editType,P=f.colorEditType;P===void 0&&(P=z);var n={editType:z,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};f.noNumericWeightValues&&(n.valType="enumerated",n.values=n.extras,n.extras=void 0,n.min=void 0,n.max=void 0);var i={family:{valType:"string",noBlank:!0,strict:!0,editType:z},size:{valType:"number",min:1,editType:z},color:{valType:"color",editType:P},weight:n,style:{editType:z,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:f.noFontVariant?void 0:{editType:z,valType:"enumerated",values:y||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:f.noFontTextcase?void 0:{editType:z,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:f.noFontLineposition?void 0:{editType:z,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:f.noFontShadow?void 0:{editType:z,valType:"string",dflt:f.autoShadowDflt?"auto":"none"},editType:z};return f.autoSize&&(i.size.dflt="auto"),f.autoColor&&(i.color.dflt="auto"),f.arrayOk&&(i.family.arrayOk=!0,i.weight.arrayOk=!0,i.style.arrayOk=!0,f.noFontVariant||(i.variant.arrayOk=!0),f.noFontTextcase||(i.textcase.arrayOk=!0),f.noFontLineposition||(i.lineposition.arrayOk=!0),f.noFontShadow||(i.shadow.arrayOk=!0),i.size.arrayOk=!0,i.color.arrayOk=!0),i}}),aa=It((et,Y)=>{Y.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),io=It((et,Y)=>{var f=aa(),y=hi(),z=y({editType:"none"});z.family.dflt=f.HOVERFONT,z.size.dflt=f.HOVERFONTSIZE,Y.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:z,grouptitlefont:y({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),oo=It((et,Y)=>{var f=hi(),y=io().hoverlabel,z=Yn().extendFlat;Y.exports={hoverlabel:{bgcolor:z({},y.bgcolor,{arrayOk:!0}),bordercolor:z({},y.bordercolor,{arrayOk:!0}),font:f({arrayOk:!0,editType:"none"}),align:z({},y.align,{arrayOk:!0}),namelength:z({},y.namelength,{arrayOk:!0}),showarrow:z({},y.showarrow),editType:"none"}}}),xa=It((et,Y)=>{var f=hi(),y=oo();Y.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:f({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:y.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),Ur=It((et,Y)=>{var f=Xi(),y={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},z=y.RdBu;function P(a,l){if(l||(l=z),!a)return l;function o(){try{a=y[a]||JSON.parse(a)}catch{a=l}}return typeof a=="string"&&(o(),typeof a=="string"&&o()),n(a)?a:l}function n(a){var l=0;if(!Array.isArray(a)||a.length<2||!a[0]||!a[a.length-1]||+a[0][0]!=0||+a[a.length-1][0]!=1)return!1;for(var o=0;o{et.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],et.defaultLine="#444",et.lightLine="#eee",et.background="#fff",et.borderLine="#BEC8D9",et.lightFraction=1e3/11}),Hn=It((et,Y)=>{var f=Xi(),y=Sr(),z=Xn().isTypedArray,P=Y.exports={},n=Sn();P.defaults=n.defaults;var i=P.defaultLine=n.defaultLine;P.lightLine=n.lightLine;var a=P.background=n.background;P.tinyRGB=function(o){var c=o.toRgb();return"rgb("+Math.round(c.r)+", "+Math.round(c.g)+", "+Math.round(c.b)+")"},P.rgb=function(o){return P.tinyRGB(f(o))},P.opacity=function(o){return o?f(o).getAlpha():0},P.addOpacity=function(o,c){var s=f(o).toRgb();return"rgba("+Math.round(s.r)+", "+Math.round(s.g)+", "+Math.round(s.b)+", "+c+")"},P.combine=function(o,c){var s=f(o).toRgb();if(s.a===1)return f(o).toRgbString();var h=f(c||a).toRgb(),m=h.a===1?h:{r:255*(1-h.a)+h.r*h.a,g:255*(1-h.a)+h.g*h.a,b:255*(1-h.a)+h.b*h.a},b={r:m.r*(1-s.a)+s.r*s.a,g:m.g*(1-s.a)+s.g*s.a,b:m.b*(1-s.a)+s.b*s.a};return f(b).toRgbString()},P.interpolate=function(o,c,s){var h=f(o).toRgb(),m=f(c).toRgb(),b={r:s*h.r+(1-s)*m.r,g:s*h.g+(1-s)*m.g,b:s*h.b+(1-s)*m.b};return f(b).toRgbString()},P.contrast=function(o,c,s){var h=f(o);h.getAlpha()!==1&&(h=f(P.combine(o,a)));var m=h.isDark()?c?h.lighten(c):a:s?h.darken(s):i;return m.toString()},P.stroke=function(o,c){var s=f(c);o.style({stroke:P.tinyRGB(s),"stroke-opacity":s.getAlpha()})},P.fill=function(o,c){var s=f(c);o.style({fill:P.tinyRGB(s),"fill-opacity":s.getAlpha()})},P.clean=function(o){if(!(!o||typeof o!="object")){var c=Object.keys(o),s,h,m,b;for(s=0;s=0)))return o;if(b===3)h[b]>1&&(h[b]=1);else if(h[b]>=1)return o}var x=Math.round(h[0]*255)+", "+Math.round(h[1]*255)+", "+Math.round(h[2]*255);return m?"rgba("+x+", "+h[3]+")":"rgb("+x+")"}}),Qa=It((et,Y)=>{Y.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),Ha=It(et=>{et.counter=function(Y,f,y,z){var P=(f||"")+(y?"":"$"),n=z===!1?"":"^";return Y==="xy"?new RegExp(n+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+P):new RegExp(n+Y+"([2-9]|[1-9][0-9]+)?"+P)}}),qa=It(et=>{var Y=Sr(),f=Xi(),y=Yn().extendFlat,z=xa(),P=Ur(),n=Hn(),i=Qa().DESELECTDIM,a=_i(),l=Ha().counter,o=Bi().modHalf,c=Xn().isArrayOrTypedArray,s=Xn().isTypedArraySpec,h=Xn().decodeTypedArraySpec;et.valObjectMeta={data_array:{coerceFunction:function(b,x,_){x.set(c(b)?b:s(b)?h(b):_)}},enumerated:{coerceFunction:function(b,x,_,A){A.coerceNumber&&(b=+b),A.values.indexOf(b)===-1?x.set(_):x.set(b)},validateFunction:function(b,x){x.coerceNumber&&(b=+b);for(var _=x.values,A=0;A<_.length;A++){var d=String(_[A]);if(d.charAt(0)==="/"&&d.charAt(d.length-1)==="/"){var k=new RegExp(d.substr(1,d.length-2));if(k.test(b))return!0}else if(b===_[A])return!0}return!1}},boolean:{coerceFunction:function(b,x,_){b===!0||b===!1?x.set(b):x.set(_)}},number:{coerceFunction:function(b,x,_,A){s(b)&&(b=h(b)),!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},integer:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}s(b)&&(b=h(b)),b%1||!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},string:{coerceFunction:function(b,x,_,A){if(typeof b!="string"){var d=typeof b=="number";A.strict===!0||!d?x.set(_):x.set(String(b))}else A.noBlank&&!b?x.set(_):x.set(b)}},color:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),f(b).isValid()?x.set(b):x.set(_)}},colorlist:{coerceFunction:function(b,x,_){function A(d){return f(d).isValid()}!Array.isArray(b)||!b.length?x.set(_):b.every(A)?x.set(b):x.set(_)}},colorscale:{coerceFunction:function(b,x,_){x.set(P.get(b,_))}},angle:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),b==="auto"?x.set("auto"):Y(b)?x.set(o(+b,360)):x.set(_)}},subplotid:{coerceFunction:function(b,x,_,A){var d=A.regex||l(_);if(typeof b=="string"&&d.test(b)){x.set(b);return}x.set(_)},validateFunction:function(b,x){var _=x.dflt;return b===_?!0:typeof b!="string"?!1:!!l(_).test(b)}},flaglist:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}if(typeof b!="string"){x.set(_);return}for(var d=b.split("+"),k=0;k{var f={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},y={};function z(P,n){for(var i in P){var a=P[i];a.valType?n[i]=a.dflt:(n[i]||(n[i]={}),z(a,n[i]))}}z(f,y),Y.exports={configAttributes:f,dfltConfig:y}}),Wo=It((et,Y)=>{var f=Br(),y=Sr(),z=[];Y.exports=function(P,n){if(z.indexOf(P)!==-1)return;z.push(P);var i=1e3;y(n)?i=n:n==="long"&&(i=3e3);var a=f.select("body").selectAll(".plotly-notifier").data([0]);a.enter().append("div").classed("plotly-notifier",!0);var l=a.selectAll(".notifier-note").data(z);function o(c){c.duration(700).style("opacity",0).each("end",function(s){var h=z.indexOf(s);h!==-1&&z.splice(h,1),f.select(this).remove()})}l.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(c){var s=f.select(this);s.append("button").classed("notifier-close",!0).html("×").on("click",function(){s.transition().call(o)});for(var h=s.append("p"),m=c.split(//g),b=0;b{var f=Mo().dfltConfig,y=Wo(),z=Y.exports={};z.log=function(){var P;if(f.logging>1){var n=["LOG:"];for(P=0;P1){var i=[];for(P=0;P"),"long")}},z.warn=function(){var P;if(f.logging>0){var n=["WARN:"];for(P=0;P0){var i=[];for(P=0;P"),"stick")}},z.error=function(){var P;if(f.logging>0){var n=["ERROR:"];for(P=0;P0){var i=[];for(P=0;P"),"stick")}}}),Po=It((et,Y)=>{Y.exports=function(){}}),Ys=It((et,Y)=>{Y.exports=function(f,y){if(y instanceof RegExp){for(var z=y.toString(),P=0;P{Y.exports=f;function f(){var y=new Float32Array(16);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),Ss=It((et,Y)=>{Y.exports=f;function f(y){var z=new Float32Array(16);return z[0]=y[0],z[1]=y[1],z[2]=y[2],z[3]=y[3],z[4]=y[4],z[5]=y[5],z[6]=y[6],z[7]=y[7],z[8]=y[8],z[9]=y[9],z[10]=y[10],z[11]=y[11],z[12]=y[12],z[13]=y[13],z[14]=y[14],z[15]=y[15],z}}),Us=It((et,Y)=>{Y.exports=f;function f(y,z){return y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),Ac=It((et,Y)=>{Y.exports=f;function f(y){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),Ou=It((et,Y)=>{Y.exports=f;function f(y,z){if(y===z){var P=z[1],n=z[2],i=z[3],a=z[6],l=z[7],o=z[11];y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=P,y[6]=z[9],y[7]=z[13],y[8]=n,y[9]=a,y[11]=z[14],y[12]=i,y[13]=l,y[14]=o}else y[0]=z[0],y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=z[1],y[5]=z[5],y[6]=z[9],y[7]=z[13],y[8]=z[2],y[9]=z[6],y[10]=z[10],y[11]=z[14],y[12]=z[3],y[13]=z[7],y[14]=z[11],y[15]=z[15];return y}}),Bu=It((et,Y)=>{Y.exports=f;function f(y,z){var P=z[0],n=z[1],i=z[2],a=z[3],l=z[4],o=z[5],c=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],d=z[14],k=z[15],w=P*o-n*l,D=P*c-i*l,E=P*s-a*l,I=n*c-i*o,M=n*s-a*o,p=i*s-a*c,g=h*A-m*_,C=h*d-b*_,S=h*k-x*_,N=m*d-b*A,B=m*k-x*A,U=b*k-x*d,V=w*U-D*B+E*N+I*S-M*C+p*g;return V?(V=1/V,y[0]=(o*U-c*B+s*N)*V,y[1]=(i*B-n*U-a*N)*V,y[2]=(A*p-d*M+k*I)*V,y[3]=(b*M-m*p-x*I)*V,y[4]=(c*S-l*U-s*C)*V,y[5]=(P*U-i*S+a*C)*V,y[6]=(d*E-_*p-k*D)*V,y[7]=(h*p-b*E+x*D)*V,y[8]=(l*B-o*S+s*g)*V,y[9]=(n*S-P*B-a*g)*V,y[10]=(_*M-A*E+k*w)*V,y[11]=(m*E-h*M-x*w)*V,y[12]=(o*C-l*N-c*g)*V,y[13]=(P*N-n*C+i*g)*V,y[14]=(A*D-_*I-d*w)*V,y[15]=(h*I-m*D+b*w)*V,y):null}}),dp=It((et,Y)=>{Y.exports=f;function f(y,z){var P=z[0],n=z[1],i=z[2],a=z[3],l=z[4],o=z[5],c=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],d=z[14],k=z[15];return y[0]=o*(b*k-x*d)-m*(c*k-s*d)+A*(c*x-s*b),y[1]=-(n*(b*k-x*d)-m*(i*k-a*d)+A*(i*x-a*b)),y[2]=n*(c*k-s*d)-o*(i*k-a*d)+A*(i*s-a*c),y[3]=-(n*(c*x-s*b)-o*(i*x-a*b)+m*(i*s-a*c)),y[4]=-(l*(b*k-x*d)-h*(c*k-s*d)+_*(c*x-s*b)),y[5]=P*(b*k-x*d)-h*(i*k-a*d)+_*(i*x-a*b),y[6]=-(P*(c*k-s*d)-l*(i*k-a*d)+_*(i*s-a*c)),y[7]=P*(c*x-s*b)-l*(i*x-a*b)+h*(i*s-a*c),y[8]=l*(m*k-x*A)-h*(o*k-s*A)+_*(o*x-s*m),y[9]=-(P*(m*k-x*A)-h*(n*k-a*A)+_*(n*x-a*m)),y[10]=P*(o*k-s*A)-l*(n*k-a*A)+_*(n*s-a*o),y[11]=-(P*(o*x-s*m)-l*(n*x-a*m)+h*(n*s-a*o)),y[12]=-(l*(m*d-b*A)-h*(o*d-c*A)+_*(o*b-c*m)),y[13]=P*(m*d-b*A)-h*(n*d-i*A)+_*(n*b-i*m),y[14]=-(P*(o*d-c*A)-l*(n*d-i*A)+_*(n*c-i*o)),y[15]=P*(o*b-c*m)-l*(n*b-i*m)+h*(n*c-i*o),y}}),Wf=It((et,Y)=>{Y.exports=f;function f(y){var z=y[0],P=y[1],n=y[2],i=y[3],a=y[4],l=y[5],o=y[6],c=y[7],s=y[8],h=y[9],m=y[10],b=y[11],x=y[12],_=y[13],A=y[14],d=y[15],k=z*l-P*a,w=z*o-n*a,D=z*c-i*a,E=P*o-n*l,I=P*c-i*l,M=n*c-i*o,p=s*_-h*x,g=s*A-m*x,C=s*d-b*x,S=h*A-m*_,N=h*d-b*_,B=m*d-b*A;return k*B-w*N+D*S+E*C-I*g+M*p}}),V0=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=z[0],i=z[1],a=z[2],l=z[3],o=z[4],c=z[5],s=z[6],h=z[7],m=z[8],b=z[9],x=z[10],_=z[11],A=z[12],d=z[13],k=z[14],w=z[15],D=P[0],E=P[1],I=P[2],M=P[3];return y[0]=D*n+E*o+I*m+M*A,y[1]=D*i+E*c+I*b+M*d,y[2]=D*a+E*s+I*x+M*k,y[3]=D*l+E*h+I*_+M*w,D=P[4],E=P[5],I=P[6],M=P[7],y[4]=D*n+E*o+I*m+M*A,y[5]=D*i+E*c+I*b+M*d,y[6]=D*a+E*s+I*x+M*k,y[7]=D*l+E*h+I*_+M*w,D=P[8],E=P[9],I=P[10],M=P[11],y[8]=D*n+E*o+I*m+M*A,y[9]=D*i+E*c+I*b+M*d,y[10]=D*a+E*s+I*x+M*k,y[11]=D*l+E*h+I*_+M*w,D=P[12],E=P[13],I=P[14],M=P[15],y[12]=D*n+E*o+I*m+M*A,y[13]=D*i+E*c+I*b+M*d,y[14]=D*a+E*s+I*x+M*k,y[15]=D*l+E*h+I*_+M*w,y}}),lm=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=P[0],i=P[1],a=P[2],l,o,c,s,h,m,b,x,_,A,d,k;return z===y?(y[12]=z[0]*n+z[4]*i+z[8]*a+z[12],y[13]=z[1]*n+z[5]*i+z[9]*a+z[13],y[14]=z[2]*n+z[6]*i+z[10]*a+z[14],y[15]=z[3]*n+z[7]*i+z[11]*a+z[15]):(l=z[0],o=z[1],c=z[2],s=z[3],h=z[4],m=z[5],b=z[6],x=z[7],_=z[8],A=z[9],d=z[10],k=z[11],y[0]=l,y[1]=o,y[2]=c,y[3]=s,y[4]=h,y[5]=m,y[6]=b,y[7]=x,y[8]=_,y[9]=A,y[10]=d,y[11]=k,y[12]=l*n+h*i+_*a+z[12],y[13]=o*n+m*i+A*a+z[13],y[14]=c*n+b*i+d*a+z[14],y[15]=s*n+x*i+k*a+z[15]),y}}),Hg=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=P[0],i=P[1],a=P[2];return y[0]=z[0]*n,y[1]=z[1]*n,y[2]=z[2]*n,y[3]=z[3]*n,y[4]=z[4]*i,y[5]=z[5]*i,y[6]=z[6]*i,y[7]=z[7]*i,y[8]=z[8]*a,y[9]=z[9]*a,y[10]=z[10]*a,y[11]=z[11]*a,y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),Y1=It((et,Y)=>{Y.exports=f;function f(y,z,P,n){var i=n[0],a=n[1],l=n[2],o=Math.sqrt(i*i+a*a+l*l),c,s,h,m,b,x,_,A,d,k,w,D,E,I,M,p,g,C,S,N,B,U,V,W;return Math.abs(o)<1e-6?null:(o=1/o,i*=o,a*=o,l*=o,c=Math.sin(P),s=Math.cos(P),h=1-s,m=z[0],b=z[1],x=z[2],_=z[3],A=z[4],d=z[5],k=z[6],w=z[7],D=z[8],E=z[9],I=z[10],M=z[11],p=i*i*h+s,g=a*i*h+l*c,C=l*i*h-a*c,S=i*a*h-l*c,N=a*a*h+s,B=l*a*h+i*c,U=i*l*h+a*c,V=a*l*h-i*c,W=l*l*h+s,y[0]=m*p+A*g+D*C,y[1]=b*p+d*g+E*C,y[2]=x*p+k*g+I*C,y[3]=_*p+w*g+M*C,y[4]=m*S+A*N+D*B,y[5]=b*S+d*N+E*B,y[6]=x*S+k*N+I*B,y[7]=_*S+w*N+M*B,y[8]=m*U+A*V+D*W,y[9]=b*U+d*V+E*W,y[10]=x*U+k*V+I*W,y[11]=_*U+w*V+M*W,z!==y&&(y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y)}}),Np=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=Math.sin(P),i=Math.cos(P),a=z[4],l=z[5],o=z[6],c=z[7],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[4]=a*i+s*n,y[5]=l*i+h*n,y[6]=o*i+m*n,y[7]=c*i+b*n,y[8]=s*i-a*n,y[9]=h*i-l*n,y[10]=m*i-o*n,y[11]=b*i-c*n,y}}),cm=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=Math.sin(P),i=Math.cos(P),a=z[0],l=z[1],o=z[2],c=z[3],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*i-s*n,y[1]=l*i-h*n,y[2]=o*i-m*n,y[3]=c*i-b*n,y[8]=a*n+s*i,y[9]=l*n+h*i,y[10]=o*n+m*i,y[11]=c*n+b*i,y}}),Vg=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=Math.sin(P),i=Math.cos(P),a=z[0],l=z[1],o=z[2],c=z[3],s=z[4],h=z[5],m=z[6],b=z[7];return z!==y&&(y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*i+s*n,y[1]=l*i+h*n,y[2]=o*i+m*n,y[3]=c*i+b*n,y[4]=s*i-a*n,y[5]=h*i-l*n,y[6]=m*i-o*n,y[7]=b*i-c*n,y}}),Yx=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n,i,a,l=P[0],o=P[1],c=P[2],s=Math.sqrt(l*l+o*o+c*c);return Math.abs(s)<1e-6?null:(s=1/s,l*=s,o*=s,c*=s,n=Math.sin(z),i=Math.cos(z),a=1-i,y[0]=l*l*a+i,y[1]=o*l*a+c*n,y[2]=c*l*a-o*n,y[3]=0,y[4]=l*o*a-c*n,y[5]=o*o*a+i,y[6]=c*o*a+l*n,y[7]=0,y[8]=l*c*a+o*n,y[9]=o*c*a-l*n,y[10]=c*c*a+i,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y)}}),e8=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=z[0],i=z[1],a=z[2],l=z[3],o=n+n,c=i+i,s=a+a,h=n*o,m=n*c,b=n*s,x=i*c,_=i*s,A=a*s,d=l*o,k=l*c,w=l*s;return y[0]=1-(x+A),y[1]=m+w,y[2]=b-k,y[3]=0,y[4]=m-w,y[5]=1-(h+A),y[6]=_+d,y[7]=0,y[8]=b+k,y[9]=_-d,y[10]=1-(h+x),y[11]=0,y[12]=P[0],y[13]=P[1],y[14]=P[2],y[15]=1,y}}),y4=It((et,Y)=>{Y.exports=f;function f(y,z){return y[0]=z[0],y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=z[1],y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=z[2],y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),_4=It((et,Y)=>{Y.exports=f;function f(y,z){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=z[0],y[13]=z[1],y[14]=z[2],y[15]=1,y}}),x4=It((et,Y)=>{Y.exports=f;function f(y,z){var P=Math.sin(z),n=Math.cos(z);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=n,y[6]=P,y[7]=0,y[8]=0,y[9]=-P,y[10]=n,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),r8=It((et,Y)=>{Y.exports=f;function f(y,z){var P=Math.sin(z),n=Math.cos(z);return y[0]=n,y[1]=0,y[2]=-P,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=P,y[9]=0,y[10]=n,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),n8=It((et,Y)=>{Y.exports=f;function f(y,z){var P=Math.sin(z),n=Math.cos(z);return y[0]=n,y[1]=P,y[2]=0,y[3]=0,y[4]=-P,y[5]=n,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),i8=It((et,Y)=>{Y.exports=f;function f(y,z){var P=z[0],n=z[1],i=z[2],a=z[3],l=P+P,o=n+n,c=i+i,s=P*l,h=n*l,m=n*o,b=i*l,x=i*o,_=i*c,A=a*l,d=a*o,k=a*c;return y[0]=1-m-_,y[1]=h+k,y[2]=b-d,y[3]=0,y[4]=h-k,y[5]=1-s-_,y[6]=x+A,y[7]=0,y[8]=b+d,y[9]=x-A,y[10]=1-s-m,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),a8=It((et,Y)=>{Y.exports=f;function f(y,z,P,n,i,a,l){var o=1/(P-z),c=1/(i-n),s=1/(a-l);return y[0]=a*2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a*2*c,y[6]=0,y[7]=0,y[8]=(P+z)*o,y[9]=(i+n)*c,y[10]=(l+a)*s,y[11]=-1,y[12]=0,y[13]=0,y[14]=l*a*2*s,y[15]=0,y}}),o8=It((et,Y)=>{Y.exports=f;function f(y,z,P,n,i){var a=1/Math.tan(z/2),l=1/(n-i);return y[0]=a/P,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=(i+n)*l,y[11]=-1,y[12]=0,y[13]=0,y[14]=2*i*n*l,y[15]=0,y}}),s8=It((et,Y)=>{Y.exports=f;function f(y,z,P,n){var i=Math.tan(z.upDegrees*Math.PI/180),a=Math.tan(z.downDegrees*Math.PI/180),l=Math.tan(z.leftDegrees*Math.PI/180),o=Math.tan(z.rightDegrees*Math.PI/180),c=2/(l+o),s=2/(i+a);return y[0]=c,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=s,y[6]=0,y[7]=0,y[8]=-((l-o)*c*.5),y[9]=(i-a)*s*.5,y[10]=n/(P-n),y[11]=-1,y[12]=0,y[13]=0,y[14]=n*P/(P-n),y[15]=0,y}}),iw=It((et,Y)=>{Y.exports=f;function f(y,z,P,n,i,a,l){var o=1/(z-P),c=1/(n-i),s=1/(a-l);return y[0]=-2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*c,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*s,y[11]=0,y[12]=(z+P)*o,y[13]=(i+n)*c,y[14]=(l+a)*s,y[15]=1,y}}),l8=It((et,Y)=>{var f=Ac();Y.exports=y;function y(z,P,n,i){var a,l,o,c,s,h,m,b,x,_,A=P[0],d=P[1],k=P[2],w=i[0],D=i[1],E=i[2],I=n[0],M=n[1],p=n[2];return Math.abs(A-I)<1e-6&&Math.abs(d-M)<1e-6&&Math.abs(k-p)<1e-6?f(z):(m=A-I,b=d-M,x=k-p,_=1/Math.sqrt(m*m+b*b+x*x),m*=_,b*=_,x*=_,a=D*x-E*b,l=E*m-w*x,o=w*b-D*m,_=Math.sqrt(a*a+l*l+o*o),_?(_=1/_,a*=_,l*=_,o*=_):(a=0,l=0,o=0),c=b*o-x*l,s=x*a-m*o,h=m*l-b*a,_=Math.sqrt(c*c+s*s+h*h),_?(_=1/_,c*=_,s*=_,h*=_):(c=0,s=0,h=0),z[0]=a,z[1]=c,z[2]=m,z[3]=0,z[4]=l,z[5]=s,z[6]=b,z[7]=0,z[8]=o,z[9]=h,z[10]=x,z[11]=0,z[12]=-(a*A+l*d+o*k),z[13]=-(c*A+s*d+h*k),z[14]=-(m*A+b*d+x*k),z[15]=1,z)}}),c8=It((et,Y)=>{Y.exports=f;function f(y){return"mat4("+y[0]+", "+y[1]+", "+y[2]+", "+y[3]+", "+y[4]+", "+y[5]+", "+y[6]+", "+y[7]+", "+y[8]+", "+y[9]+", "+y[10]+", "+y[11]+", "+y[12]+", "+y[13]+", "+y[14]+", "+y[15]+")"}}),b4=It((et,Y)=>{Y.exports={create:Jo(),clone:Ss(),copy:Us(),identity:Ac(),transpose:Ou(),invert:Bu(),adjoint:dp(),determinant:Wf(),multiply:V0(),translate:lm(),scale:Hg(),rotate:Y1(),rotateX:Np(),rotateY:cm(),rotateZ:Vg(),fromRotation:Yx(),fromRotationTranslation:e8(),fromScaling:y4(),fromTranslation:_4(),fromXRotation:x4(),fromYRotation:r8(),fromZRotation:n8(),fromQuat:i8(),frustum:a8(),perspective:o8(),perspectiveFromFieldOfView:s8(),ortho:iw(),lookAt:l8(),str:c8()}}),aw=It(et=>{var Y=b4();et.init2dArray=function(f,y){for(var z=new Array(f),P=0;P{var f=Br(),y=es(),z=aw(),P=b4();function n(A){var d;if(typeof A=="string"){if(d=document.getElementById(A),d===null)throw new Error("No DOM element with id '"+A+"' exists on the page.");return d}else if(A==null)throw new Error("DOM element provided is null or undefined");return A}function i(A){var d=f.select(A);return d.node()instanceof HTMLElement&&d.size()&&d.classed("js-plotly-plot")}function a(A){var d=A&&A.parentNode;d&&d.removeChild(A)}function l(A,d){o("global",A,d)}function o(A,d,k){var w="plotly.js-style-"+A,D=document.getElementById(w);if(!(D&&D.matches(".no-inline-styles"))){D||(D=document.createElement("style"),D.setAttribute("id",w),D.appendChild(document.createTextNode("")),document.head.appendChild(D));var E=D.sheet;E?E.insertRule?E.insertRule(d+"{"+k+"}",0):E.addRule?E.addRule(d,k,0):y.warn("addStyleRule failed"):y.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function c(A){var d="plotly.js-style-"+A,k=document.getElementById(d);k&&a(k)}function s(A,d,k,w,D,E){var I=w.split(":"),M=D.split(":"),p="data-btn-style-event-added";E||(E=document),E.querySelectorAll(A).forEach(function(g){g.getAttribute(p)||(g.addEventListener("mouseenter",function(){var C=this.querySelector(k);C&&(C.style[I[0]]=I[1])}),g.addEventListener("mouseleave",function(){var C=this.querySelector(k);C&&(d&&this.matches(d)?C.style[I[0]]=I[1]:C.style[M[0]]=M[1])}),g.setAttribute(p,!0))})}function h(A){var d=b(A),k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return d.forEach(function(w){var D=m(w);if(D){var E=z.convertCssMatrix(D);k=P.multiply(k,k,E)}}),k}function m(A){var d=window.getComputedStyle(A,null),k=d.getPropertyValue("-webkit-transform")||d.getPropertyValue("-moz-transform")||d.getPropertyValue("-ms-transform")||d.getPropertyValue("-o-transform")||d.getPropertyValue("transform");return k==="none"?null:k.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(w){return+w})}function b(A){for(var d=[];x(A);)d.push(A),A=A.parentNode,typeof ShadowRoot=="function"&&A instanceof ShadowRoot&&(A=A.host);return d}function x(A){return A&&(A instanceof Element||A instanceof HTMLElement)}function _(A,d){return A&&d&&A.top===d.top&&A.left===d.left&&A.right===d.right&&A.bottom===d.bottom}Y.exports={getGraphDiv:n,isPlotDiv:i,removeElement:a,addStyleRule:l,addRelatedStyleRule:o,deleteRelatedStyleRule:c,setStyleOnHover:s,getFullTransformMatrix:h,getElementTransformMatrix:m,getElementAndAncestors:b,equalDomRects:_}}),Ul=It((et,Y)=>{Y.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),sh=It((et,Y)=>{var f=Yn().extendFlat,y=Cn(),z={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},P={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},n=z.flags.slice().concat(["fullReplot"]),i=P.flags.slice().concat("layoutReplot");Y.exports={traces:z,layout:P,traceFlags:function(){return a(n)},layoutFlags:function(){return a(i)},update:function(c,s){var h=s.editType;if(h&&h!=="none")for(var m=h.split("+"),b=0;b{et.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},et.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),ow=It((et,Y)=>{Y.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),nu=It(et=>{var{DATE_FORMAT_LINK:Y,FORMAT_LINK:f}=ow(),y=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function z({supportOther:P}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(P?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,f,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,Y,"for details on the date formatting syntax.",y].join(" ")}et.templateFormatStringDescription=z,et.hovertemplateAttrs=({editType:P="none",arrayOk:n}={},i={})=>we({valType:"string",dflt:"",editType:P},n!==!1?{arrayOk:!0}:{}),et.texttemplateAttrs=({editType:P="calc",arrayOk:n}={},i={})=>we({valType:"string",dflt:"",editType:P},n!==!1?{arrayOk:!0}:{}),et.shapeTexttemplateAttrs=({editType:P="arraydraw",newshape:n}={},i={})=>({valType:"string",dflt:"",editType:P}),et.templatefallbackAttrs=({editType:P="none"}={})=>({valType:"any",dflt:"-",editType:P})}),w_=It((et,Y)=>{function f(k,w){return w?w.d2l(k):k}function y(k,w){return w?w.l2d(k):k}function z(k){return k.x0}function P(k){return k.x1}function n(k){return k.y0}function i(k){return k.y1}function a(k){return k.x0shift||0}function l(k){return k.x1shift||0}function o(k){return k.y0shift||0}function c(k){return k.y1shift||0}function s(k,w){return f(k.x1,w)+l(k)-f(k.x0,w)-a(k)}function h(k,w,D){return f(k.y1,D)+c(k)-f(k.y0,D)-o(k)}function m(k,w){return Math.abs(s(k,w))}function b(k,w,D){return Math.abs(h(k,w,D))}function x(k,w,D){return k.type!=="line"?void 0:Math.sqrt(Math.pow(s(k,w),2)+Math.pow(h(k,w,D),2))}function _(k,w){return y((f(k.x1,w)+l(k)+f(k.x0,w)+a(k))/2,w)}function A(k,w,D){return y((f(k.y1,D)+c(k)+f(k.y0,D)+o(k))/2,D)}function d(k,w,D){return k.type!=="line"?void 0:h(k,w,D)/s(k,w)}Y.exports={x0:z,x1:P,y0:n,y1:i,slope:d,dx:s,dy:h,width:m,height:b,length:x,xcenter:_,ycenter:A}}),w4=It((et,Y)=>{var f=sh().overrideAll,y=xa(),z=hi(),P=qf().dash,n=Yn().extendFlat,{shapeTexttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=w_();Y.exports=f({newshape:{visible:n({},y.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:n({},y.legend,{}),legendgroup:n({},y.legendgroup,{}),legendgrouptitle:{text:n({},y.legendgrouptitle.text,{}),font:z({})},legendrank:n({},y.legendrank,{}),legendwidth:n({},y.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:n({},P,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:n({},y.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:i({newshape:!0},{keys:Object.keys(l)}),texttemplatefallback:a({editType:"arraydraw"}),font:z({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),X1=It((et,Y)=>{var f=qf().dash,y=Yn().extendFlat;Y.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:y({},f,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Xx=It((et,Y)=>{Y.exports=function(f){var y=f.editType;return{t:{valType:"number",dflt:0,editType:y},r:{valType:"number",dflt:0,editType:y},b:{valType:"number",dflt:0,editType:y},l:{valType:"number",dflt:0,editType:y},editType:y}}}),k_=It((et,Y)=>{var f=hi(),y=Ul(),z=Sn(),P=w4(),n=X1(),i=Xx(),a=Yn().extendFlat,l=f({editType:"calc"});l.family.dflt='"Open Sans", verdana, arial, sans-serif',l.size.dflt=12,l.color.dflt=z.defaultLine,Y.exports={font:l,title:{text:{valType:"string",editType:"layoutstyle"},font:f({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:f({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:a(i({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:z.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:z.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:z.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:P.newshape,activeshape:P.activeshape,newselection:n.newselection,activeselection:n.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:a({},y.transition,{editType:"none"})}}),u8=It(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var et=document.createElement("style");et.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",et.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(et)}})()}),ls=It(et=>{var Y=es(),f=Po(),y=Ys(),z=Cn(),P=W0().addStyleRule,n=Yn(),i=xa(),a=k_(),l=n.extendFlat,o=n.extendDeepAll;et.modules={},et.allCategories={},et.allTypes=[],et.subplotsRegistry={},et.componentsRegistry={},et.layoutArrayContainers=[],et.layoutArrayRegexes=[],et.traceLayoutAttributes={},et.localeRegistry={},et.apiMethodRegistry={},et.collectableSubplotTypes=null,et.register=function(k){if(et.collectableSubplotTypes=null,k)k&&!Array.isArray(k)&&(k=[k]);else throw new Error("No argument passed to Plotly.register.");for(var w=0;w{var Y=on().timeFormat,f=Sr(),y=es(),z=Bi().mod,P=Dr(),n=P.BADNUM,i=P.ONEDAY,a=P.ONEHOUR,l=P.ONEMIN,o=P.ONESEC,c=P.EPOCHJD,s=ls(),h=on().utcFormat,m=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,b=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=new Date().getFullYear()-70;function _(V){return V&&s.componentsRegistry.calendars&&typeof V=="string"&&V!=="gregorian"}et.dateTick0=function(V,W){var F=A(V,!!W);if(W<2)return F;var H=et.dateTime2ms(F,V);return H+=i*(W-1),et.ms2DateTime(H,0,V)};function A(V,W){return _(V)?W?s.getComponentMethod("calendars","CANONICAL_SUNDAY")[V]:s.getComponentMethod("calendars","CANONICAL_TICK")[V]:W?"2000-01-02":"2000-01-01"}et.dfltRange=function(V){return _(V)?s.getComponentMethod("calendars","DFLTRANGE")[V]:["2000-01-01","2001-01-01"]},et.isJSDate=function(V){return typeof V=="object"&&V!==null&&typeof V.getTime=="function"};var d,k;et.dateTime2ms=function(V,W){if(et.isJSDate(V)){var F=V.getTimezoneOffset()*l,H=(V.getUTCMinutes()-V.getMinutes())*l+(V.getUTCSeconds()-V.getSeconds())*o+(V.getUTCMilliseconds()-V.getMilliseconds());if(H){var q=3*l;F=F-q/2+z(H-F+q/2,q)}return V=Number(V)-F,V>=d&&V<=k?V:n}if(typeof V!="string"&&typeof V!="number")return n;V=String(V);var G=_(W),tt=V.charAt(0);G&&(tt==="G"||tt==="g")&&(V=V.substr(1),W="");var ht=G&&W.substr(0,7)==="chinese",bt=V.match(ht?b:m);if(!bt)return n;var vt=bt[1],ut=bt[3]||"1",rt=Number(bt[5]||1),gt=Number(bt[7]||0),it=Number(bt[9]||0),st=Number(bt[11]||0);if(G){if(vt.length===2)return n;vt=Number(vt);var xt;try{var ot=s.getComponentMethod("calendars","getCal")(W);if(ht){var J=ut.charAt(ut.length-1)==="i";ut=parseInt(ut,10),xt=ot.newDate(vt,ot.toMonthIndex(vt,ut,J),rt)}else xt=ot.newDate(vt,Number(ut),rt)}catch{return n}return xt?(xt.toJD()-c)*i+gt*a+it*l+st*o:n}vt.length===2?vt=(Number(vt)+2e3-x)%100+x:vt=Number(vt),ut-=1;var mt=new Date(Date.UTC(2e3,ut,rt,gt,it));return mt.setUTCFullYear(vt),mt.getUTCMonth()!==ut||mt.getUTCDate()!==rt?n:mt.getTime()+st*o},d=et.MIN_MS=et.dateTime2ms("-9999"),k=et.MAX_MS=et.dateTime2ms("9999-12-31 23:59:59.9999"),et.isDateTime=function(V,W){return et.dateTime2ms(V,W)!==n};function w(V,W){return String(V+Math.pow(10,W)).substr(1)}var D=90*i,E=3*a,I=5*l;et.ms2DateTime=function(V,W,F){if(typeof V!="number"||!(V>=d&&V<=k))return n;W||(W=0);var H=Math.floor(z(V+.05,1)*10),q=Math.round(V-H/10),G,tt,ht,bt,vt,ut;if(_(F)){var rt=Math.floor(q/i)+c,gt=Math.floor(z(V,i));try{G=s.getComponentMethod("calendars","getCal")(F).fromJD(rt).formatDate("yyyy-mm-dd")}catch{G=h("G%Y-%m-%d")(new Date(q))}if(G.charAt(0)==="-")for(;G.length<11;)G="-0"+G.substr(1);else for(;G.length<10;)G="0"+G;tt=W=d+i&&V<=k-i))return n;var W=Math.floor(z(V+.05,1)*10),F=new Date(Math.round(V-W/10)),H=Y("%Y-%m-%d")(F),q=F.getHours(),G=F.getMinutes(),tt=F.getSeconds(),ht=F.getUTCMilliseconds()*10+W;return M(H,q,G,tt,ht)};function M(V,W,F,H,q){if((W||F||H||q)&&(V+=" "+w(W,2)+":"+w(F,2),(H||q)&&(V+=":"+w(H,2),q))){for(var G=4;q%10===0;)G-=1,q/=10;V+="."+w(q,G)}return V}et.cleanDate=function(V,W,F){if(V===n)return W;if(et.isJSDate(V)||typeof V=="number"&&isFinite(V)){if(_(F))return y.error("JS Dates and milliseconds are incompatible with world calendars",V),W;if(V=et.ms2DateTimeLocal(+V),!V&&W!==void 0)return W}else if(!et.isDateTime(V,F))return y.error("unrecognized date",V),W;return V};var p=/%\d?f/g,g=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function S(V,W,F,H){V=V.replace(p,function(G){var tt=Math.min(+G.charAt(1)||6,6),ht=(W/1e3%1+2).toFixed(tt).substr(2).replace(/0+$/,"")||"0";return ht});var q=new Date(Math.floor(W+.05));if(V=V.replace(g,function(){return C[F("%q")(q)]}),_(H))try{V=s.getComponentMethod("calendars","worldCalFmt")(V,W,H)}catch{return"Invalid"}return F(V)(q)}var N=[59,59.9,59.99,59.999,59.9999];function B(V,W){var F=z(V+.05,i),H=w(Math.floor(F/a),2)+":"+w(z(Math.floor(F/l),60),2);if(W!=="M"){f(W)||(W=0);var q=Math.min(z(V/o,60),N[W]),G=(100+q).toFixed(W).substr(1);W>0&&(G=G.replace(/0+$/,"").replace(/[\.]$/,"")),H+=":"+G}return H}et.formatDate=function(V,W,F,H,q,G){if(q=_(q)&&q,!W)if(F==="y")W=G.year;else if(F==="m")W=G.month;else if(F==="d")W=G.dayMonth+` +`)};function cr(vn){return vn.map(Fr).join(Et)}function Fr(vn){return de.test(vn)?'"'+vn.replace(/\"/g,'""')+'"':vn}return Be},f.csv=f.dsv(",","text/csv"),f.tsv=f.dsv(" ","text/tab-separated-values");var xi,Jn,Gn,pi,Va=this[F(this,"requestAnimationFrame")]||function(Et){setTimeout(Et,17)};f.timer=function(){ea.apply(this,arguments)};function ea(Et,Vt,de){var Ie=arguments.length;Ie<2&&(Vt=0),Ie<3&&(de=Date.now());var Be=de+Vt,He={c:Et,t:Be,n:null};return Jn?Jn.n=He:xi=He,Jn=He,Gn||(pi=clearTimeout(pi),Gn=1,Va(go)),He}function go(){var Et=mo(),Vt=Go()-Et;Vt>24?(isFinite(Vt)&&(clearTimeout(pi),pi=setTimeout(go,Vt)),Gn=0):(Gn=1,Va(go))}f.timer.flush=function(){mo(),Go()};function mo(){for(var Et=Date.now(),Vt=xi;Vt;)Et>=Vt.t&&Vt.c(Et-Vt.t)&&(Vt.c=null),Vt=Vt.n;return Et}function Go(){for(var Et,Vt=xi,de=1/0;Vt;)Vt.c?(Vt.t=0;--cr)si.push(Be[vn[Bn[cr]][2]]);for(cr=+ei;cr1&&qe(Et[de[Ie-2]],Et[de[Ie-1]],Et[Be])<=0;)--Ie;de[Ie++]=Be}return de.slice(0,Ie)}function Cs(Et,Vt){return Et[0]-Vt[0]||Et[1]-Vt[1]}f.geom.polygon=function(Et){return rt(Et,ps),Et};var ps=f.geom.polygon.prototype=[];ps.area=function(){for(var Et=-1,Vt=this.length,de,Ie=this[Vt-1],Be=0;++Etoe)cr=cr.L;else if(hr=Vt-Co(cr,de),hr>oe){if(!cr.R){Ie=cr;break}cr=cr.R}else{He>-oe?(Ie=cr.P,Be=cr):hr>-oe?(Ie=cr,Be=cr.N):Ie=Be=cr;break}var Fr=Ol(Et);if(ul.insert(Ie,Fr),!(!Ie&&!Be)){if(Ie===Be){$l(Ie),Be=Ol(Ie.site),ul.insert(Fr,Be),Fr.edge=Be.edge=mc(Ie.site,Fr.site),yl(Ie),yl(Be);return}if(!Be){Fr.edge=mc(Ie.site,Fr.site);return}$l(Ie),$l(Be);var vn=Ie.site,fn=vn.x,Bn=vn.y,ti=Et.x-fn,ei=Et.y-Bn,ra=Be.site,si=ra.x-fn,Oi=ra.y-Bn,$i=2*(ti*Oi-ei*si),Ki=ti*ti+ei*ei,sa=si*si+Oi*Oi,vi={x:(Oi*Ki-ei*sa)/$i+fn,y:(ti*sa-si*Ki)/$i+Bn};us(Be.edge,vn,ra,vi),Fr.edge=mc(vn,Et,null,vi),Be.edge=mc(Et,ra,null,vi),yl(Ie),yl(Be)}}function Wa(Et,Vt){var de=Et.site,Ie=de.x,Be=de.y,He=Be-Vt;if(!He)return Ie;var hr=Et.P;if(!hr)return-1/0;de=hr.site;var cr=de.x,Fr=de.y,vn=Fr-Vt;if(!vn)return cr;var fn=cr-Ie,Bn=1/He-1/vn,ti=fn/vn;return Bn?(-ti+Math.sqrt(ti*ti-2*Bn*(fn*fn/(-2*vn)-Fr+vn/2+Be-He/2)))/Bn+Ie:(Ie+cr)/2}function Co(Et,Vt){var de=Et.N;if(de)return Wa(de,Vt);var Ie=Et.site;return Ie.y===Vt?Ie.x:1/0}function el(Et){this.site=Et,this.edges=[]}el.prototype.prepare=function(){for(var Et=this.edges,Vt=Et.length,de;Vt--;)de=Et[Vt].edge,(!de.b||!de.a)&&Et.splice(Vt,1);return Et.sort(ss),Et.length};function lc(Et){for(var Vt=Et[0][0],de=Et[1][0],Ie=Et[0][1],Be=Et[1][1],He,hr,cr,Fr,vn=kl,fn=vn.length,Bn,ti,ei,ra,si,Oi;fn--;)if(Bn=vn[fn],!(!Bn||!Bn.prepare()))for(ei=Bn.edges,ra=ei.length,ti=0;tioe||d(Fr-hr)>oe)&&(ei.splice(ti,0,new Rc(Tl(Bn.site,Oi,d(cr-Vt)oe?{x:Vt,y:d(He-Vt)oe?{x:d(hr-Be)oe?{x:de,y:d(He-de)oe?{x:d(hr-Ie)=-zt)){var ei=Fr*Fr+vn*vn,ra=fn*fn+Bn*Bn,si=(Bn*ei-vn*ra)/ti,Oi=(Fr*ra-fn*ei)/ti,Bn=Oi+cr,$i=Uo.pop()||new nc;$i.arc=Et,$i.site=Be,$i.x=si+hr,$i.y=Bn+Math.sqrt(si*si+Oi*Oi),$i.cy=Bn,Et.circle=$i;for(var Ki=null,sa=Ns._;sa;)if($i.y0)){if(si/=ei,ei<0){if(si0){if(si>ti)return;si>Bn&&(Bn=si)}if(si=de-cr,!(!ei&&si<0)){if(si/=ei,ei<0){if(si>ti)return;si>Bn&&(Bn=si)}else if(ei>0){if(si0)){if(si/=ra,ra<0){if(si0){if(si>ti)return;si>Bn&&(Bn=si)}if(si=Ie-Fr,!(!ra&&si<0)){if(si/=ra,ra<0){if(si>ti)return;si>Bn&&(Bn=si)}else if(ra>0){if(si0&&(Be.a={x:cr+Bn*ei,y:Fr+Bn*ra}),ti<1&&(Be.b={x:cr+ti*ei,y:Fr+ti*ra}),Be}}}}}}function ko(Et){for(var Vt=ms,de=Gc(Et[0][0],Et[0][1],Et[1][0],Et[1][1]),Ie=Vt.length,Be;Ie--;)Be=Vt[Ie],(!zs(Be,Et)||!de(Be)||d(Be.a.x-Be.b.x)=He)return;if(fn>ti){if(!Ie)Ie={x:ra,y:hr};else if(Ie.y>=cr)return;de={x:ra,y:cr}}else{if(!Ie)Ie={x:ra,y:cr};else if(Ie.y1)if(fn>ti){if(!Ie)Ie={x:(hr-$i)/Oi,y:hr};else if(Ie.y>=cr)return;de={x:(cr-$i)/Oi,y:cr}}else{if(!Ie)Ie={x:(cr-$i)/Oi,y:cr};else if(Ie.y=He)return;de={x:He,y:Oi*He+$i}}else{if(!Ie)Ie={x:He,y:Oi*He+$i};else if(Ie.x=fn&&$i.x<=ti&&$i.y>=Bn&&$i.y<=ei?[[fn,ei],[ti,ei],[ti,Bn],[fn,Bn]]:[];Ki.point=Fr[si]}),vn}function cr(Fr){return Fr.map(function(vn,fn){return{x:Math.round(Ie(vn,fn)/oe)*oe,y:Math.round(Be(vn,fn)/oe)*oe,i:fn}})}return hr.links=function(Fr){return pu(cr(Fr)).edges.filter(function(vn){return vn.l&&vn.r}).map(function(vn){return{source:Fr[vn.l.i],target:Fr[vn.r.i]}})},hr.triangles=function(Fr){var vn=[];return pu(cr(Fr)).cells.forEach(function(fn,Bn){for(var ti=fn.site,ei=fn.edges.sort(ss),ra=-1,si=ei.length,Oi,$i,Ki=ei[si-1].edge,sa=Ki.l===ti?Ki.r:Ki.l;++rasa&&(sa=fn.x),fn.y>vi&&(vi=fn.y),ei.push(fn.x),ra.push(fn.y);else for(si=0;sisa&&(sa=no),ao>vi&&(vi=ao),ei.push(no),ra.push(ao)}var xo=sa-$i,$o=vi-Ki;xo>$o?vi=Ki+xo:sa=$i+$o;function Ko(as,Ts,Bl,ou,wc,zo,il,ml){if(!(isNaN(Bl)||isNaN(ou)))if(as.leaf){var yc=as.x,oc=as.y;if(yc!=null)if(d(yc-Bl)+d(oc-ou)<.01)rs(as,Ts,Bl,ou,wc,zo,il,ml);else{var ph=as.point;as.x=as.y=as.point=null,rs(as,ph,yc,oc,wc,zo,il,ml),rs(as,Ts,Bl,ou,wc,zo,il,ml)}else as.x=Bl,as.y=ou,as.point=Ts}else rs(as,Ts,Bl,ou,wc,zo,il,ml)}function rs(as,Ts,Bl,ou,wc,zo,il,ml){var yc=(wc+il)*.5,oc=(zo+ml)*.5,ph=Bl>=yc,Yl=ou>=oc,hc=Yl<<1|ph;as.leaf=!1,as=as.nodes[hc]||(as.nodes[hc]=Gl()),ph?wc=yc:il=yc,Yl?zo=oc:ml=oc,Ko(as,Ts,Bl,ou,wc,zo,il,ml)}var _l=Gl();if(_l.add=function(as){Ko(_l,as,+Bn(as,++si),+ti(as,si),$i,Ki,sa,vi)},_l.visit=function(as){Yu(as,_l,$i,Ki,sa,vi)},_l.find=function(as){return ef(_l,as[0],as[1],$i,Ki,sa,vi)},si=-1,Vt==null){for(;++siHe||ti>hr||ei=no,$o=de>=ao,Ko=$o<<1|xo,rs=Ko+4;Kode&&(He=Vt.slice(de,He),cr[hr]?cr[hr]+=He:cr[++hr]=He),(Ie=Ie[0])===(Be=Be[0])?cr[hr]?cr[hr]+=Be:cr[++hr]=Be:(cr[++hr]=null,Fr.push({i:hr,x:bu(Ie,Be)})),de=gu.lastIndex;return de=0&&!(Ie=f.interpolators[de](Et,Vt)););return Ie}f.interpolators=[function(Et,Vt){var de=typeof Vt;return(de==="string"?bn.has(Vt.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Vt)?xu:_h:Vt instanceof Ci?xu:Array.isArray(Vt)?ic:de==="object"&&isNaN(Vt)?mu:bu)(Et,Vt)}],f.interpolateArray=ic;function ic(Et,Vt){var de=[],Ie=[],Be=Et.length,He=Vt.length,hr=Math.min(Et.length,Vt.length),cr;for(cr=0;cr=0?Et.slice(0,Vt):Et,Ie=Vt>=0?Et.slice(Vt+1):"in";return de=Hu.get(de)||jh,Ie=Qh.get(Ie)||V,Lc(Ie(de.apply(null,y.call(arguments,1))))};function Lc(Et){return function(Vt){return Vt<=0?0:Vt>=1?1:Et(Vt)}}function Xf(Et){return function(Vt){return 1-Et(1-Vt)}}function hl(Et){return function(Vt){return .5*(Vt<.5?Et(2*Vt):2-Et(2-2*Vt))}}function pp(Et){return Et*Et}function Hl(Et){return Et*Et*Et}function cs(Et){if(Et<=0)return 0;if(Et>=1)return 1;var Vt=Et*Et,de=Vt*Et;return 4*(Et<.5?de:3*(Et-Vt)+de-.75)}function _d(Et){return function(Vt){return Math.pow(Vt,Et)}}function xh(Et){return 1-Math.cos(Et*ae)}function hu(Et){return Math.pow(2,10*(Et-1))}function rf(Et){return 1-Math.sqrt(1-Et*Et)}function td(Et,Vt){var de;return arguments.length<2&&(Vt=.45),arguments.length?de=Vt/Pt*Math.asin(1/Et):(Et=1,de=Vt/4),function(Ie){return 1+Et*Math.pow(2,-10*Ie)*Math.sin((Ie-de)*Pt/Vt)}}function Ed(Et){return Et||(Et=1.70158),function(Vt){return Vt*Vt*((Et+1)*Vt-Et)}}function vu(Et){return Et<1/2.75?7.5625*Et*Et:Et<2/2.75?7.5625*(Et-=1.5/2.75)*Et+.75:Et<2.5/2.75?7.5625*(Et-=2.25/2.75)*Et+.9375:7.5625*(Et-=2.625/2.75)*Et+.984375}f.interpolateHcl=Lf;function Lf(Et,Vt){Et=f.hcl(Et),Vt=f.hcl(Vt);var de=Et.h,Ie=Et.c,Be=Et.l,He=Vt.h-de,hr=Vt.c-Ie,cr=Vt.l-Be;return isNaN(hr)&&(hr=0,Ie=isNaN(Ie)?Vt.c:Ie),isNaN(He)?(He=0,de=isNaN(de)?Vt.h:de):He>180?He-=360:He<-180&&(He+=360),function(Fr){return vr(de+He*Fr,Ie+hr*Fr,Be+cr*Fr)+""}}f.interpolateHsl=hf;function hf(Et,Vt){Et=f.hsl(Et),Vt=f.hsl(Vt);var de=Et.h,Ie=Et.s,Be=Et.l,He=Vt.h-de,hr=Vt.s-Ie,cr=Vt.l-Be;return isNaN(hr)&&(hr=0,Ie=isNaN(Ie)?Vt.s:Ie),isNaN(He)?(He=0,de=isNaN(de)?Vt.h:de):He>180?He-=360:He<-180&&(He+=360),function(Fr){return oa(de+He*Fr,Ie+hr*Fr,Be+cr*Fr)+""}}f.interpolateLab=Ld;function Ld(Et,Vt){Et=f.lab(Et),Vt=f.lab(Vt);var de=Et.l,Ie=Et.a,Be=Et.b,He=Vt.l-de,hr=Vt.a-Ie,cr=Vt.b-Be;return function(Fr){return Fi(de+He*Fr,Ie+hr*Fr,Be+cr*Fr)+""}}f.interpolateRound=ed;function ed(Et,Vt){return Vt-=Et,function(de){return Math.round(Et+Vt*de)}}f.transform=function(Et){var Vt=P.createElementNS(f.ns.prefix.svg,"g");return(f.transform=function(de){if(de!=null){Vt.setAttribute("transform",de);var Ie=Vt.transform.baseVal.consolidate()}return new nf(Ie?Ie.matrix:Uh)})(Et)};function nf(Et){var Vt=[Et.a,Et.b],de=[Et.c,Et.d],Ie=bh(Vt),Be=af(Vt,de),He=bh(df(de,Vt,-Be))||0;Vt[0]*de[1]180?Vt+=360:Vt-Et>180&&(Et+=360),Ie.push({i:de.push(Mh(de)+"rotate(",null,")")-2,x:bu(Et,Vt)})):Vt&&de.push(Mh(de)+"rotate("+Vt+")")}function of(Et,Vt,de,Ie){Et!==Vt?Ie.push({i:de.push(Mh(de)+"skewX(",null,")")-2,x:bu(Et,Vt)}):Vt&&de.push(Mh(de)+"skewX("+Vt+")")}function uc(Et,Vt,de,Ie){if(Et[0]!==Vt[0]||Et[1]!==Vt[1]){var Be=de.push(Mh(de)+"scale(",null,",",null,")");Ie.push({i:Be-4,x:bu(Et[0],Vt[0])},{i:Be-2,x:bu(Et[1],Vt[1])})}else(Vt[0]!==1||Vt[1]!==1)&&de.push(Mh(de)+"scale("+Vt+")")}function jd(Et,Vt){var de=[],Ie=[];return Et=f.transform(Et),Vt=f.transform(Vt),yu(Et.translate,Vt.translate,de,Ie),fd(Et.rotate,Vt.rotate,de,Ie),of(Et.skew,Vt.skew,de,Ie),uc(Et.scale,Vt.scale,de,Ie),Et=Vt=null,function(Be){for(var He=-1,hr=Ie.length,cr;++He0?He=vi:(de.c=null,de.t=NaN,de=null,Vt.end({type:"end",alpha:He=0})):vi>0&&(Vt.start({type:"start",alpha:He=vi}),de=ea(Et.tick)),Et):He},Et.start=function(){var vi,no=ei.length,ao=ra.length,xo=Ie[0],$o=Ie[1],Ko,rs;for(vi=0;vi=0;)He.push(fn=vn[Fr]),fn.parent=cr,fn.depth=cr.depth+1;de&&(cr.value=0),cr.children=vn}else de&&(cr.value=+de.call(Ie,cr,cr.depth)||0),delete cr.children;return Eh(Be,function(Bn){var ti,ei;Et&&(ti=Bn.children)&&ti.sort(Et),de&&(ei=Bn.parent)&&(ei.value+=Bn.value)}),hr}return Ie.sort=function(Be){return arguments.length?(Et=Be,Ie):Et},Ie.children=function(Be){return arguments.length?(Vt=Be,Ie):Vt},Ie.value=function(Be){return arguments.length?(de=Be,Ie):de},Ie.revalue=function(Be){return de&&(xd(Be,function(He){He.children&&(He.value=0)}),Eh(Be,function(He){var hr;He.children||(He.value=+de.call(Ie,He,He.depth)||0),(hr=He.parent)&&(hr.value+=He.value)})),Be},Ie};function Pc(Et,Vt){return f.rebind(Et,Vt,"sort","children","value"),Et.nodes=Et,Et.links=Ap,Et}function xd(Et,Vt){for(var de=[Et];(Et=de.pop())!=null;)if(Vt(Et),(Be=Et.children)&&(Ie=Be.length))for(var Ie,Be;--Ie>=0;)de.push(Be[Ie])}function Eh(Et,Vt){for(var de=[Et],Ie=[];(Et=de.pop())!=null;)if(Ie.push(Et),(hr=Et.children)&&(He=hr.length))for(var Be=-1,He,hr;++BeBe&&(Be=cr),Ie.push(cr)}for(hr=0;hrIe&&(de=Vt,Ie=Be);return de}function Hh(Et){return Et.reduce(th,0)}function th(Et,Vt){return Et+Vt[1]}f.layout.histogram=function(){var Et=!0,Vt=Number,de=Id,Ie=Pf;function Be(He,hr){for(var cr=[],Fr=He.map(Vt,this),vn=de.call(this,Fr,hr),fn=Ie.call(this,vn,Fr,hr),Bn,hr=-1,ti=Fr.length,ei=fn.length-1,ra=Et?1:1/ti,si;++hr0)for(hr=-1;++hr=vn[0]&&si<=vn[1]&&(Bn=cr[f.bisect(fn,si,1,ei)-1],Bn.y+=ra,Bn.push(He[hr]));return cr}return Be.value=function(He){return arguments.length?(Vt=He,Be):Vt},Be.range=function(He){return arguments.length?(de=ze(He),Be):de},Be.bins=function(He){return arguments.length?(Ie=typeof He=="number"?function(hr){return Mc(hr,He)}:ze(He),Be):Ie},Be.frequency=function(He){return arguments.length?(Et=!!He,Be):Et},Be};function Pf(Et,Vt){return Mc(Et,Math.ceil(Math.log(Vt.length)/Math.LN2+1))}function Mc(Et,Vt){for(var de=-1,Ie=+Et[0],Be=(Et[1]-Ie)/Vt,He=[];++de<=Vt;)He[de]=Be*de+Ie;return He}function Id(Et){return[f.min(Et),f.max(Et)]}f.layout.pack=function(){var Et=f.layout.hierarchy().sort(id),Vt=0,de=[1,1],Ie;function Be(He,hr){var cr=Et.call(this,He,hr),Fr=cr[0],vn=de[0],fn=de[1],Bn=Ie==null?Math.sqrt:typeof Ie=="function"?Ie:function(){return Ie};if(Fr.x=Fr.y=0,Eh(Fr,function(ei){ei.r=+Bn(ei.value)}),Eh(Fr,Dd),Vt){var ti=Vt*(Ie?1:Math.max(2*Fr.r/vn,2*Fr.r/fn))/2;Eh(Fr,function(ei){ei.r+=ti}),Eh(Fr,Dd),Eh(Fr,function(ei){ei.r-=ti})}return gf(Fr,vn/2,fn/2,Ie?1:1/Math.max(2*Fr.r/vn,2*Fr.r/fn)),cr}return Be.size=function(He){return arguments.length?(de=He,Be):de},Be.radius=function(He){return arguments.length?(Ie=He==null||typeof He=="function"?He:+He,Be):Ie},Be.padding=function(He){return arguments.length?(Vt=+He,Be):Vt},Pc(Be,Et)};function id(Et,Vt){return Et.value-Vt.value}function dh(Et,Vt){var de=Et._pack_next;Et._pack_next=Vt,Vt._pack_prev=Et,Vt._pack_next=de,de._pack_prev=Vt}function pd(Et,Vt){Et._pack_next=Vt,Vt._pack_prev=Et}function ad(Et,Vt){var de=Vt.x-Et.x,Ie=Vt.y-Et.y,Be=Et.r+Vt.r;return .999*Be*Be>de*de+Ie*Ie}function Dd(Et){if(!(Vt=Et.children)||!(ti=Vt.length))return;var Vt,de=1/0,Ie=-1/0,Be=1/0,He=-1/0,hr,cr,Fr,vn,fn,Bn,ti;function ei(vi){de=Math.min(vi.x-vi.r,de),Ie=Math.max(vi.x+vi.r,Ie),Be=Math.min(vi.y-vi.r,Be),He=Math.max(vi.y+vi.r,He)}if(Vt.forEach(tp),hr=Vt[0],hr.x=-hr.r,hr.y=0,ei(hr),ti>1&&(cr=Vt[1],cr.x=cr.r,cr.y=0,ei(cr),ti>2))for(Fr=Vt[2],fh(hr,cr,Fr),ei(Fr),dh(hr,Fr),hr._pack_prev=Fr,dh(Fr,cr),cr=hr._pack_next,vn=3;vnOi.x&&(Oi=no),no.depth>$i.depth&&($i=no)});var Ki=Vt(si,Oi)/2-si.x,sa=de[0]/(Oi.x+Vt(Oi,si)/2+Ki),vi=de[1]/($i.depth||1);xd(ei,function(no){no.x=(no.x+Ki)*sa,no.y=no.depth*vi})}return ti}function He(fn){for(var Bn={A:null,children:[fn]},ti=[Bn],ei;(ei=ti.pop())!=null;)for(var ra=ei.children,si,Oi=0,$i=ra.length;Oi<$i;++Oi)ti.push((ra[Oi]=si={_:ra[Oi],parent:ei,children:(si=ra[Oi].children)&&si.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:Oi}).a=si);return Bn.children[0]}function hr(fn){var Bn=fn.children,ti=fn.parent.children,ei=fn.i?ti[fn.i-1]:null;if(Bn.length){Ih(fn);var ra=(Bn[0].z+Bn[Bn.length-1].z)/2;ei?(fn.z=ei.z+Vt(fn._,ei._),fn.m=fn.z-ra):fn.z=ra}else ei&&(fn.z=ei.z+Vt(fn._,ei._));fn.parent.A=Fr(fn,ei,fn.parent.A||ti[0])}function cr(fn){fn._.x=fn.z+fn.parent.m,fn.m+=fn.parent.m}function Fr(fn,Bn,ti){if(Bn){for(var ei=fn,ra=fn,si=Bn,Oi=ei.parent.children[0],$i=ei.m,Ki=ra.m,sa=si.m,vi=Oi.m,no;si=Zc(si),ei=Ph(ei),si&&ei;)Oi=Ph(Oi),ra=Zc(ra),ra.a=fn,no=si.z+sa-ei.z-$i+Vt(si._,ei._),no>0&&(fc(Td(si,fn,ti),fn,no),$i+=no,Ki+=no),sa+=si.m,$i+=ei.m,vi+=Oi.m,Ki+=ra.m;si&&!Zc(ra)&&(ra.t=si,ra.m+=sa-Ki),ei&&!Ph(Oi)&&(Oi.t=ei,Oi.m+=$i-vi,ti=fn)}return ti}function vn(fn){fn.x*=de[0],fn.y=fn.depth*de[1]}return Be.separation=function(fn){return arguments.length?(Vt=fn,Be):Vt},Be.size=function(fn){return arguments.length?(Ie=(de=fn)==null?vn:null,Be):Ie?null:de},Be.nodeSize=function(fn){return arguments.length?(Ie=(de=fn)==null?null:vn,Be):Ie?de:null},Pc(Be,Et)};function Vh(Et,Vt){return Et.parent==Vt.parent?1:2}function Ph(Et){var Vt=Et.children;return Vt.length?Vt[0]:Et.t}function Zc(Et){var Vt=Et.children,de;return(de=Vt.length)?Vt[de-1]:Et.t}function fc(Et,Vt,de){var Ie=de/(Vt.i-Et.i);Vt.c-=Ie,Vt.s+=de,Et.c+=Ie,Vt.z+=de,Vt.m+=de}function Ih(Et){for(var Vt=0,de=0,Ie=Et.children,Be=Ie.length,He;--Be>=0;)He=Ie[Be],He.z+=Vt,He.m+=Vt,Vt+=He.s+(de+=He.c)}function Td(Et,Vt,de){return Et.a.parent===Vt.parent?Et.a:de}f.layout.cluster=function(){var Et=f.layout.hierarchy().sort(null).value(null),Vt=Vh,de=[1,1],Ie=!1;function Be(He,hr){var cr=Et.call(this,He,hr),Fr=cr[0],vn,fn=0;Eh(Fr,function(si){var Oi=si.children;Oi&&Oi.length?(si.x=sf(Oi),si.y=Dh(Oi)):(si.x=vn?fn+=Vt(si,vn):0,si.y=0,vn=si)});var Bn=br(Fr),ti=Qr(Fr),ei=Bn.x-Vt(Bn,ti)/2,ra=ti.x+Vt(ti,Bn)/2;return Eh(Fr,Ie?function(si){si.x=(si.x-Fr.x)*de[0],si.y=(Fr.y-si.y)*de[1]}:function(si){si.x=(si.x-ei)/(ra-ei)*de[0],si.y=(1-(Fr.y?si.y/Fr.y:1))*de[1]}),cr}return Be.separation=function(He){return arguments.length?(Vt=He,Be):Vt},Be.size=function(He){return arguments.length?(Ie=(de=He)==null,Be):Ie?null:de},Be.nodeSize=function(He){return arguments.length?(Ie=(de=He)!=null,Be):Ie?de:null},Pc(Be,Et)};function Dh(Et){return 1+f.max(Et,function(Vt){return Vt.y})}function sf(Et){return Et.reduce(function(Vt,de){return Vt+de.x},0)/Et.length}function br(Et){var Vt=Et.children;return Vt&&Vt.length?br(Vt[0]):Et}function Qr(Et){var Vt=Et.children,de;return Vt&&(de=Vt.length)?Qr(Vt[de-1]):Et}f.layout.treemap=function(){var Et=f.layout.hierarchy(),Vt=Math.round,de=[1,1],Ie=null,Be=Nn,He=!1,hr,cr="squarify",Fr=.5*(1+Math.sqrt(5));function vn(si,Oi){for(var $i=-1,Ki=si.length,sa,vi;++$i0;)Ki.push(vi=sa[$o-1]),Ki.area+=vi.area,cr!=="squarify"||(ao=ti(Ki,xo))<=no?(sa.pop(),no=ao):(Ki.area-=Ki.pop().area,ei(Ki,xo,$i,!1),xo=Math.min($i.dx,$i.dy),Ki.length=Ki.area=0,no=1/0);Ki.length&&(ei(Ki,xo,$i,!0),Ki.length=Ki.area=0),Oi.forEach(fn)}}function Bn(si){var Oi=si.children;if(Oi&&Oi.length){var $i=Be(si),Ki=Oi.slice(),sa,vi=[];for(vn(Ki,$i.dx*$i.dy/si.value),vi.area=0;sa=Ki.pop();)vi.push(sa),vi.area+=sa.area,sa.z!=null&&(ei(vi,sa.z?$i.dx:$i.dy,$i,!Ki.length),vi.length=vi.area=0);Oi.forEach(Bn)}}function ti(si,Oi){for(var $i=si.area,Ki,sa=0,vi=1/0,no=-1,ao=si.length;++nosa&&(sa=Ki));return $i*=$i,Oi*=Oi,$i?Math.max(Oi*sa*Fr/$i,$i/(Oi*vi*Fr)):1/0}function ei(si,Oi,$i,Ki){var sa=-1,vi=si.length,no=$i.x,ao=$i.y,xo=Oi?Vt(si.area/Oi):0,$o;if(Oi==$i.dx){for((Ki||xo>$i.dy)&&(xo=$i.dy);++sa$i.dx)&&(xo=$i.dx);++sa1);return Et+Vt*Ie*Math.sqrt(-2*Math.log(He)/He)}},logNormal:function(){var Et=f.random.normal.apply(f,arguments);return function(){return Math.exp(Et())}},bates:function(Et){var Vt=f.random.irwinHall(Et);return function(){return Vt()/Et}},irwinHall:function(Et){return function(){for(var Vt=0,de=0;de2?Sa:ga,vn=Ie?ff:Jf;return Be=Fr(Et,Vt,vn,de),He=Fr(Vt,Et,vn,pl),cr}function cr(Fr){return Be(Fr)}return cr.invert=function(Fr){return He(Fr)},cr.domain=function(Fr){return arguments.length?(Et=Fr.map(Number),hr()):Et},cr.range=function(Fr){return arguments.length?(Vt=Fr,hr()):Vt},cr.rangeRound=function(Fr){return cr.range(Fr).interpolate(ed)},cr.clamp=function(Fr){return arguments.length?(Ie=Fr,hr()):Ie},cr.interpolate=function(Fr){return arguments.length?(de=Fr,hr()):de},cr.ticks=function(Fr){return fs(Et,Fr)},cr.tickFormat=function(Fr,vn){return d3_scale_linearTickFormat(Et,Fr,vn)},cr.nice=function(Fr){return pa(Et,Fr),hr()},cr.copy=function(){return Za(Et,Vt,de,Ie)},hr()}function Ra(Et,Vt){return f.rebind(Et,Vt,"range","rangeRound","interpolate","clamp")}function pa(Et,Vt){return Pa(Et,Qa(_o(Et,Vt)[2])),Pa(Et,Qa(_o(Et,Vt)[2])),Et}function _o(Et,Vt){Vt==null&&(Vt=10);var de=di(Et),Ie=de[1]-de[0],Be=Math.pow(10,Math.floor(Math.log(Ie/Vt)/Math.LN10)),He=Vt/Ie*Be;return He<=.15?Be*=10:He<=.35?Be*=5:He<=.75&&(Be*=2),de[0]=Math.ceil(de[0]/Be)*Be,de[1]=Math.floor(de[1]/Be)*Be+Be*.5,de[2]=Be,de}function fs(Et,Vt){return f.range.apply(f,_o(Et,Vt))}f.scale.log=function(){return os(f.scale.linear().domain([0,1]),10,!0,[1,10])};function os(Et,Vt,de,Ie){function Be(cr){return(de?Math.log(cr<0?0:cr):-Math.log(cr>0?0:-cr))/Math.log(Vt)}function He(cr){return de?Math.pow(Vt,cr):-Math.pow(Vt,-cr)}function hr(cr){return Et(Be(cr))}return hr.invert=function(cr){return He(Et.invert(cr))},hr.domain=function(cr){return arguments.length?(de=cr[0]>=0,Et.domain((Ie=cr.map(Number)).map(Be)),hr):Ie},hr.base=function(cr){return arguments.length?(Vt=+cr,Et.domain(Ie.map(Be)),hr):Vt},hr.nice=function(){var cr=Pa(Ie.map(Be),de?Math:gs);return Et.domain(cr),Ie=cr.map(He),hr},hr.ticks=function(){var cr=di(Ie),Fr=[],vn=cr[0],fn=cr[1],Bn=Math.floor(Be(vn)),ti=Math.ceil(Be(fn)),ei=Vt%1?2:Vt;if(isFinite(ti-Bn)){if(de){for(;Bn0;ra--)Fr.push(He(Bn)*ra);for(Bn=0;Fr[Bn]fn;ti--);Fr=Fr.slice(Bn,ti)}return Fr},hr.copy=function(){return os(Et.copy(),Vt,de,Ie)},Ra(hr,Et)}var gs={floor:function(Et){return-Math.ceil(-Et)},ceil:function(Et){return-Math.floor(-Et)}};f.scale.pow=function(){return ws(f.scale.linear(),1,[0,1])};function ws(Et,Vt,de){var Ie=bo(Vt),Be=bo(1/Vt);function He(hr){return Et(Ie(hr))}return He.invert=function(hr){return Be(Et.invert(hr))},He.domain=function(hr){return arguments.length?(Et.domain((de=hr.map(Number)).map(Ie)),He):de},He.ticks=function(hr){return fs(de,hr)},He.tickFormat=function(hr,cr){return d3_scale_linearTickFormat(de,hr,cr)},He.nice=function(hr){return He.domain(pa(de,hr))},He.exponent=function(hr){return arguments.length?(Ie=bo(Vt=hr),Be=bo(1/Vt),Et.domain(de.map(Ie)),He):Vt},He.copy=function(){return ws(Et.copy(),Vt,de)},Ra(He,Et)}function bo(Et){return function(Vt){return Vt<0?-Math.pow(-Vt,Et):Math.pow(Vt,Et)}}f.scale.sqrt=function(){return f.scale.pow().exponent(.5)},f.scale.ordinal=function(){return lo([],{t:"range",a:[[]]})};function lo(Et,Vt){var de,Ie,Be;function He(cr){return Ie[((de.get(cr)||(Vt.t==="range"?de.set(cr,Et.push(cr)):NaN))-1)%Ie.length]}function hr(cr,Fr){return f.range(Et.length).map(function(vn){return cr+Fr*vn})}return He.domain=function(cr){if(!arguments.length)return Et;Et=[],de=new D;for(var Fr=-1,vn=cr.length,fn;++Fr0?de[He-1]:Et[0],Heti?0:1;if(fn=Ht)return Fr(fn,ra)+(vn?Fr(vn,1-ra):"")+"Z";var si,Oi,$i,Ki,sa=0,vi=0,no,ao,xo,$o,Ko,rs,_l,as,Ts=[];if((Ki=(+hr.apply(this,arguments)||0)/2)&&($i=Ie===bc?Math.sqrt(vn*vn+fn*fn):+Ie.apply(this,arguments),ra||(vi*=-1),fn&&(vi=Ye($i/fn*Math.sin(Ki))),vn&&(sa=Ye($i/vn*Math.sin(Ki)))),fn){no=fn*Math.cos(Bn+vi),ao=fn*Math.sin(Bn+vi),xo=fn*Math.cos(ti-vi),$o=fn*Math.sin(ti-vi);var Bl=Math.abs(ti-Bn-2*vi)<=_t?0:1;if(vi&&eh(no,ao,xo,$o)===ra^Bl){var ou=(Bn+ti)/2;no=fn*Math.cos(ou),ao=fn*Math.sin(ou),xo=$o=null}}else no=ao=0;if(vn){Ko=vn*Math.cos(ti-sa),rs=vn*Math.sin(ti-sa),_l=vn*Math.cos(Bn+sa),as=vn*Math.sin(Bn+sa);var wc=Math.abs(Bn-ti+2*sa)<=_t?0:1;if(sa&&eh(Ko,rs,_l,as)===1-ra^wc){var zo=(Bn+ti)/2;Ko=vn*Math.cos(zo),rs=vn*Math.sin(zo),_l=as=null}}else Ko=rs=0;if(ei>oe&&(si=Math.min(Math.abs(fn-vn)/2,+de.apply(this,arguments)))>.001){Oi=vn0?0:1}function Vu(Et,Vt,de,Ie,Be){var He=Et[0]-Vt[0],hr=Et[1]-Vt[1],cr=(Be?Ie:-Ie)/Math.sqrt(He*He+hr*hr),Fr=cr*hr,vn=-cr*He,fn=Et[0]+Fr,Bn=Et[1]+vn,ti=Vt[0]+Fr,ei=Vt[1]+vn,ra=(fn+ti)/2,si=(Bn+ei)/2,Oi=ti-fn,$i=ei-Bn,Ki=Oi*Oi+$i*$i,sa=de-Ie,vi=fn*ei-ti*Bn,no=($i<0?-1:1)*Math.sqrt(Math.max(0,sa*sa*Ki-vi*vi)),ao=(vi*$i-Oi*no)/Ki,xo=(-vi*Oi-$i*no)/Ki,$o=(vi*$i+Oi*no)/Ki,Ko=(-vi*Oi+$i*no)/Ki,rs=ao-ra,_l=xo-si,as=$o-ra,Ts=Ko-si;return rs*rs+_l*_l>as*as+Ts*Ts&&(ao=$o,xo=Ko),[[ao-Fr,xo-vn],[ao*de/sa,xo*de/sa]]}function Wh(){return!0}function rh(Et){var Vt=Po,de=Zo,Ie=Wh,Be=Wc,He=Be.key,hr=.7;function cr(Fr){var vn=[],fn=[],Bn=-1,ti=Fr.length,ei,ra=ze(Vt),si=ze(de);function Oi(){vn.push("M",Be(Et(fn),hr))}for(;++Bn1?Et.join("L"):Et+"Z"}function Gh(Et){return Et.join("L")+"Z"}function ds(Et){for(var Vt=0,de=Et.length,Ie=Et[0],Be=[Ie[0],",",Ie[1]];++Vt1&&Be.push("H",Ie[0]),Be.join("")}function $s(Et){for(var Vt=0,de=Et.length,Ie=Et[0],Be=[Ie[0],",",Ie[1]];++Vt1){cr=Vt[1],He=Et[Fr],Fr++,Ie+="C"+(Be[0]+hr[0])+","+(Be[1]+hr[1])+","+(He[0]-cr[0])+","+(He[1]-cr[1])+","+He[0]+","+He[1];for(var vn=2;vn9&&(He=de*3/Math.sqrt(He),hr[cr]=He*Ie,hr[cr+1]=He*Be));for(cr=-1;++cr<=Fr;)He=(Et[Math.min(Fr,cr+1)][0]-Et[Math.max(0,cr-1)][0])/(6*(1+hr[cr]*hr[cr])),Vt.push([He||0,hr[cr]*He||0]);return Vt}function le(Et){return Et.length<3?Wc(Et):Et[0]+O(Et,te(Et))}f.svg.line.radial=function(){var Et=rh(Te);return Et.radius=Et.x,delete Et.x,Et.angle=Et.y,delete Et.y,Et};function Te(Et){for(var Vt,de=-1,Ie=Et.length,Be,He;++de_t)+",1 "+Bn}function vn(fn,Bn,ti,ei){return"Q 0,0 "+ei}return He.radius=function(fn){return arguments.length?(de=ze(fn),He):de},He.source=function(fn){return arguments.length?(Et=ze(fn),He):Et},He.target=function(fn){return arguments.length?(Vt=ze(fn),He):Vt},He.startAngle=function(fn){return arguments.length?(Ie=ze(fn),He):Ie},He.endAngle=function(fn){return arguments.length?(Be=ze(fn),He):Be},He};function Xe(Et){return Et.radius}f.svg.diagonal=function(){var Et=We,Vt=Ne,de=Pr;function Ie(Be,He){var hr=Et.call(this,Be,He),cr=Vt.call(this,Be,He),Fr=(hr.y+cr.y)/2,vn=[hr,{x:hr.x,y:Fr},{x:cr.x,y:Fr},cr];return vn=vn.map(de),"M"+vn[0]+"C"+vn[1]+" "+vn[2]+" "+vn[3]}return Ie.source=function(Be){return arguments.length?(Et=ze(Be),Ie):Et},Ie.target=function(Be){return arguments.length?(Vt=ze(Be),Ie):Vt},Ie.projection=function(Be){return arguments.length?(de=Be,Ie):de},Ie};function Pr(Et){return[Et.x,Et.y]}f.svg.diagonal.radial=function(){var Et=f.svg.diagonal(),Vt=Pr,de=Et.projection;return Et.projection=function(Ie){return arguments.length?de(qr(Vt=Ie)):Vt},Et};function qr(Et){return function(){var Vt=Et.apply(this,arguments),de=Vt[0],Ie=Vt[1]-ae;return[de*Math.cos(Ie),de*Math.sin(Ie)]}}f.svg.symbol=function(){var Et=gn,Vt=Xr;function de(Ie,Be){return(Qn.get(Et.call(this,Ie,Be))||zn)(Vt.call(this,Ie,Be))}return de.type=function(Ie){return arguments.length?(Et=ze(Ie),de):Et},de.size=function(Ie){return arguments.length?(Vt=ze(Ie),de):Vt},de};function Xr(){return 64}function gn(){return"circle"}function zn(Et){var Vt=Math.sqrt(Et/_t);return"M0,"+Vt+"A"+Vt+","+Vt+" 0 1,1 0,"+-Vt+"A"+Vt+","+Vt+" 0 1,1 0,"+Vt+"Z"}var Qn=f.map({circle:zn,cross:function(Et){var Vt=Math.sqrt(Et/5)/2;return"M"+-3*Vt+","+-Vt+"H"+-Vt+"V"+-3*Vt+"H"+Vt+"V"+-Vt+"H"+3*Vt+"V"+Vt+"H"+Vt+"V"+3*Vt+"H"+-Vt+"V"+Vt+"H"+-3*Vt+"Z"},diamond:function(Et){var Vt=Math.sqrt(Et/(2*Ti)),de=Vt*Ti;return"M0,"+-Vt+"L"+de+",0 0,"+Vt+" "+-de+",0Z"},square:function(Et){var Vt=Math.sqrt(Et)/2;return"M"+-Vt+","+-Vt+"L"+Vt+","+-Vt+" "+Vt+","+Vt+" "+-Vt+","+Vt+"Z"},"triangle-down":function(Et){var Vt=Math.sqrt(Et/ai),de=Vt*ai/2;return"M0,"+de+"L"+Vt+","+-de+" "+-Vt+","+-de+"Z"},"triangle-up":function(Et){var Vt=Math.sqrt(Et/ai),de=Vt*ai/2;return"M0,"+-de+"L"+Vt+","+de+" "+-Vt+","+de+"Z"}});f.svg.symbolTypes=Qn.keys();var ai=Math.sqrt(3),Ti=Math.tan(30*he);ot.transition=function(Et){for(var Vt=Yo||++wo,de=Ll(Et),Ie=[],Be,He,hr=Fo||{time:Date.now(),ease:cs,delay:0,duration:250},cr=-1,Fr=this.length;++cr0;)Bn[--Ki].call(Et,$i);if(Oi>=1)return hr.event&&hr.event.end.call(Et,Et.__data__,Vt),--He.count?delete He[Ie]:delete Et[de],1}hr||(cr=Be.time,Fr=ea(ti,0,cr),hr=He[Ie]={tween:new D,time:cr,timer:Fr,delay:Be.delay,duration:Be.duration,ease:Be.ease,index:Vt},Be=null,++He.count)}f.svg.axis=function(){var Et=f.scale.linear(),Vt=zl,de=6,Ie=6,Be=3,He=[10],hr=null,cr;function Fr(vn){vn.each(function(){var fn=f.select(this),Bn=this.__chart__||Et,ti=this.__chart__=Et.copy(),ei=hr??(ti.ticks?ti.ticks.apply(ti,He):ti.domain()),ra=cr??(ti.tickFormat?ti.tickFormat.apply(ti,He):V),si=fn.selectAll(".tick").data(ei,ti),Oi=si.enter().insert("g",".domain").attr("class","tick").style("opacity",oe),$i=f.transition(si.exit()).style("opacity",oe).remove(),Ki=f.transition(si.order()).style("opacity",1),sa=Math.max(de,0)+Be,vi,no=Pi(ti),ao=fn.selectAll(".domain").data([0]),xo=(ao.enter().append("path").attr("class","domain"),f.transition(ao));Oi.append("line"),Oi.append("text");var $o=Oi.select("line"),Ko=Ki.select("line"),rs=si.select("text").text(ra),_l=Oi.select("text"),as=Ki.select("text"),Ts=Vt==="top"||Vt==="left"?-1:1,Bl,ou,wc,zo;if(Vt==="bottom"||Vt==="top"?(vi=Sc,Bl="x",wc="y",ou="x2",zo="y2",rs.attr("dy",Ts<0?"0em":".71em").style("text-anchor","middle"),xo.attr("d","M"+no[0]+","+Ts*Ie+"V0H"+no[1]+"V"+Ts*Ie)):(vi=rl,Bl="y",wc="x",ou="y2",zo="x2",rs.attr("dy",".32em").style("text-anchor",Ts<0?"end":"start"),xo.attr("d","M"+Ts*Ie+","+no[0]+"H0V"+no[1]+"H"+Ts*Ie)),$o.attr(zo,Ts*de),_l.attr(wc,Ts*sa),Ko.attr(ou,0).attr(zo,Ts*de),as.attr(Bl,0).attr(wc,Ts*sa),ti.rangeBand){var il=ti,ml=il.rangeBand()/2;Bn=ti=function(yc){return il(yc)+ml}}else Bn.rangeBand?Bn=ti:$i.call(vi,ti,Bn);Oi.call(vi,Bn,ti),Ki.call(vi,ti,ti)})}return Fr.scale=function(vn){return arguments.length?(Et=vn,Fr):Et},Fr.orient=function(vn){return arguments.length?(Vt=vn in Fc?vn+"":zl,Fr):Vt},Fr.ticks=function(){return arguments.length?(He=z(arguments),Fr):He},Fr.tickValues=function(vn){return arguments.length?(hr=vn,Fr):hr},Fr.tickFormat=function(vn){return arguments.length?(cr=vn,Fr):cr},Fr.tickSize=function(vn){var fn=arguments.length;return fn?(de=+vn,Ie=+arguments[fn-1],Fr):de},Fr.innerTickSize=function(vn){return arguments.length?(de=+vn,Fr):de},Fr.outerTickSize=function(vn){return arguments.length?(Ie=+vn,Fr):Ie},Fr.tickPadding=function(vn){return arguments.length?(Be=+vn,Fr):Be},Fr.tickSubdivide=function(){return arguments.length&&Fr},Fr};var zl="bottom",Fc={top:1,right:1,bottom:1,left:1};function Sc(Et,Vt,de){Et.attr("transform",function(Ie){var Be=Vt(Ie);return"translate("+(isFinite(Be)?Be:de(Ie))+",0)"})}function rl(Et,Vt,de){Et.attr("transform",function(Ie){var Be=Vt(Ie);return"translate(0,"+(isFinite(Be)?Be:de(Ie))+")"})}f.svg.brush=function(){var Et=vt(fn,"brushstart","brush","brushend"),Vt=null,de=null,Ie=[0,0],Be=[0,0],He,hr,cr=!0,Fr=!0,vn=au[0];function fn(si){si.each(function(){var Oi=f.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ra).on("touchstart.brush",ra),$i=Oi.selectAll(".background").data([0]);$i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Oi.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ki=Oi.selectAll(".resize").data(vn,V);Ki.exit().remove(),Ki.enter().append("g").attr("class",function(ao){return"resize "+ao}).style("cursor",function(ao){return nl[ao]}).append("rect").attr("x",function(ao){return/[ew]$/.test(ao)?-3:null}).attr("y",function(ao){return/^[ns]/.test(ao)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ki.style("display",fn.empty()?"none":null);var sa=f.transition(Oi),vi=f.transition($i),no;Vt&&(no=Pi(Vt),vi.attr("x",no[0]).attr("width",no[1]-no[0]),ti(sa)),de&&(no=Pi(de),vi.attr("y",no[0]).attr("height",no[1]-no[0]),ei(sa)),Bn(sa)})}fn.event=function(si){si.each(function(){var Oi=Et.of(this,arguments),$i={x:Ie,y:Be,i:He,j:hr},Ki=this.__chart__||$i;this.__chart__=$i,Yo?f.select(this).transition().each("start.brush",function(){He=Ki.i,hr=Ki.j,Ie=Ki.x,Be=Ki.y,Oi({type:"brushstart"})}).tween("brush:brush",function(){var sa=ic(Ie,$i.x),vi=ic(Be,$i.y);return He=hr=null,function(no){Ie=$i.x=sa(no),Be=$i.y=vi(no),Oi({type:"brush",mode:"resize"})}}).each("end.brush",function(){He=$i.i,hr=$i.j,Oi({type:"brush",mode:"resize"}),Oi({type:"brushend"})}):(Oi({type:"brushstart"}),Oi({type:"brush",mode:"resize"}),Oi({type:"brushend"}))})};function Bn(si){si.selectAll(".resize").attr("transform",function(Oi){return"translate("+Ie[+/e$/.test(Oi)]+","+Be[+/^s/.test(Oi)]+")"})}function ti(si){si.select(".extent").attr("x",Ie[0]),si.selectAll(".extent,.n>rect,.s>rect").attr("width",Ie[1]-Ie[0])}function ei(si){si.select(".extent").attr("y",Be[0]),si.selectAll(".extent,.e>rect,.w>rect").attr("height",Be[1]-Be[0])}function ra(){var si=this,Oi=f.select(f.event.target),$i=Et.of(si,arguments),Ki=f.select(si),sa=Oi.datum(),vi=!/^(n|s)$/.test(sa)&&Vt,no=!/^(e|w)$/.test(sa)&&de,ao=Oi.classed("extent"),xo=dn(si),$o,Ko=f.mouse(si),rs,_l=f.select(i(si)).on("keydown.brush",Bl).on("keyup.brush",ou);if(f.event.changedTouches?_l.on("touchmove.brush",wc).on("touchend.brush",il):_l.on("mousemove.brush",wc).on("mouseup.brush",il),Ki.interrupt().selectAll("*").interrupt(),ao)Ko[0]=Ie[0]-Ko[0],Ko[1]=Be[0]-Ko[1];else if(sa){var as=+/w$/.test(sa),Ts=+/^n/.test(sa);rs=[Ie[1-as]-Ko[0],Be[1-Ts]-Ko[1]],Ko[0]=Ie[as],Ko[1]=Be[Ts]}else f.event.altKey&&($o=Ko.slice());Ki.style("pointer-events","none").selectAll(".resize").style("display",null),f.select("body").style("cursor",Oi.style("cursor")),$i({type:"brushstart"}),wc();function Bl(){f.event.keyCode==32&&(ao||($o=null,Ko[0]-=Ie[1],Ko[1]-=Be[1],ao=2),ht())}function ou(){f.event.keyCode==32&&ao==2&&(Ko[0]+=Ie[1],Ko[1]+=Be[1],ao=0,ht())}function wc(){var ml=f.mouse(si),yc=!1;rs&&(ml[0]+=rs[0],ml[1]+=rs[1]),ao||(f.event.altKey?($o||($o=[(Ie[0]+Ie[1])/2,(Be[0]+Be[1])/2]),Ko[0]=Ie[+(ml[0]<$o[0])],Ko[1]=Be[+(ml[1]<$o[1])]):$o=null),vi&&zo(ml,Vt,0)&&(ti(Ki),yc=!0),no&&zo(ml,de,1)&&(ei(Ki),yc=!0),yc&&(Bn(Ki),$i({type:"brush",mode:ao?"move":"resize"}))}function zo(ml,yc,oc){var ph=Pi(yc),Yl=ph[0],hc=ph[1],zh=Ko[oc],Se=oc?Be:Ie,Ir=Se[1]-Se[0],Vr,ri;if(ao&&(Yl-=zh,hc-=Ir+zh),Vr=(oc?Fr:cr)?Math.max(Yl,Math.min(hc,ml[oc])):ml[oc],ao?ri=(Vr+=zh)+Ir:($o&&(zh=Math.max(Yl,Math.min(hc,2*$o[oc]-Vr))),zh{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y=new Date,z=new Date;function P(Lt,ie,be,ce){function Le(Ze){return Lt(Ze=arguments.length===0?new Date:new Date(+Ze)),Ze}return Le.floor=function(Ze){return Lt(Ze=new Date(+Ze)),Ze},Le.ceil=function(Ze){return Lt(Ze=new Date(Ze-1)),ie(Ze,1),Lt(Ze),Ze},Le.round=function(Ze){var Qe=Le(Ze),mr=Le.ceil(Ze);return Ze-Qe0))return fr;do fr.push(Jr=new Date(+Ze)),ie(Ze,mr),Lt(Ze);while(Jr=Qe)for(;Lt(Qe),!Ze(Qe);)Qe.setTime(Qe-1)},function(Qe,mr){if(Qe>=Qe)if(mr<0)for(;++mr<=0;)for(;ie(Qe,-1),!Ze(Qe););else for(;--mr>=0;)for(;ie(Qe,1),!Ze(Qe););})},be&&(Le.count=function(Ze,Qe){return y.setTime(+Ze),z.setTime(+Qe),Lt(y),Lt(z),Math.floor(be(y,z))},Le.every=function(Ze){return Ze=Math.floor(Ze),!isFinite(Ze)||!(Ze>0)?null:Ze>1?Le.filter(ce?function(Qe){return ce(Qe)%Ze===0}:function(Qe){return Le.count(0,Qe)%Ze===0}):Le}),Le}var n=P(function(){},function(Lt,ie){Lt.setTime(+Lt+ie)},function(Lt,ie){return ie-Lt});n.every=function(Lt){return Lt=Math.floor(Lt),!isFinite(Lt)||!(Lt>0)?null:Lt>1?P(function(ie){ie.setTime(Math.floor(ie/Lt)*Lt)},function(ie,be){ie.setTime(+ie+be*Lt)},function(ie,be){return(be-ie)/Lt}):n};var i=n.range,a=1e3,l=6e4,o=36e5,c=864e5,s=6048e5,h=P(function(Lt){Lt.setTime(Lt-Lt.getMilliseconds())},function(Lt,ie){Lt.setTime(+Lt+ie*a)},function(Lt,ie){return(ie-Lt)/a},function(Lt){return Lt.getUTCSeconds()}),m=h.range,b=P(function(Lt){Lt.setTime(Lt-Lt.getMilliseconds()-Lt.getSeconds()*a)},function(Lt,ie){Lt.setTime(+Lt+ie*l)},function(Lt,ie){return(ie-Lt)/l},function(Lt){return Lt.getMinutes()}),x=b.range,_=P(function(Lt){Lt.setTime(Lt-Lt.getMilliseconds()-Lt.getSeconds()*a-Lt.getMinutes()*l)},function(Lt,ie){Lt.setTime(+Lt+ie*o)},function(Lt,ie){return(ie-Lt)/o},function(Lt){return Lt.getHours()}),A=_.range,d=P(function(Lt){Lt.setHours(0,0,0,0)},function(Lt,ie){Lt.setDate(Lt.getDate()+ie)},function(Lt,ie){return(ie-Lt-(ie.getTimezoneOffset()-Lt.getTimezoneOffset())*l)/c},function(Lt){return Lt.getDate()-1}),k=d.range;function w(Lt){return P(function(ie){ie.setDate(ie.getDate()-(ie.getDay()+7-Lt)%7),ie.setHours(0,0,0,0)},function(ie,be){ie.setDate(ie.getDate()+be*7)},function(ie,be){return(be-ie-(be.getTimezoneOffset()-ie.getTimezoneOffset())*l)/s})}var D=w(0),E=w(1),I=w(2),M=w(3),p=w(4),g=w(5),C=w(6),S=D.range,N=E.range,B=I.range,U=M.range,V=p.range,W=g.range,F=C.range,H=P(function(Lt){Lt.setDate(1),Lt.setHours(0,0,0,0)},function(Lt,ie){Lt.setMonth(Lt.getMonth()+ie)},function(Lt,ie){return ie.getMonth()-Lt.getMonth()+(ie.getFullYear()-Lt.getFullYear())*12},function(Lt){return Lt.getMonth()}),q=H.range,G=P(function(Lt){Lt.setMonth(0,1),Lt.setHours(0,0,0,0)},function(Lt,ie){Lt.setFullYear(Lt.getFullYear()+ie)},function(Lt,ie){return ie.getFullYear()-Lt.getFullYear()},function(Lt){return Lt.getFullYear()});G.every=function(Lt){return!isFinite(Lt=Math.floor(Lt))||!(Lt>0)?null:P(function(ie){ie.setFullYear(Math.floor(ie.getFullYear()/Lt)*Lt),ie.setMonth(0,1),ie.setHours(0,0,0,0)},function(ie,be){ie.setFullYear(ie.getFullYear()+be*Lt)})};var tt=G.range,ht=P(function(Lt){Lt.setUTCSeconds(0,0)},function(Lt,ie){Lt.setTime(+Lt+ie*l)},function(Lt,ie){return(ie-Lt)/l},function(Lt){return Lt.getUTCMinutes()}),bt=ht.range,vt=P(function(Lt){Lt.setUTCMinutes(0,0,0)},function(Lt,ie){Lt.setTime(+Lt+ie*o)},function(Lt,ie){return(ie-Lt)/o},function(Lt){return Lt.getUTCHours()}),ut=vt.range,rt=P(function(Lt){Lt.setUTCHours(0,0,0,0)},function(Lt,ie){Lt.setUTCDate(Lt.getUTCDate()+ie)},function(Lt,ie){return(ie-Lt)/c},function(Lt){return Lt.getUTCDate()-1}),gt=rt.range;function it(Lt){return P(function(ie){ie.setUTCDate(ie.getUTCDate()-(ie.getUTCDay()+7-Lt)%7),ie.setUTCHours(0,0,0,0)},function(ie,be){ie.setUTCDate(ie.getUTCDate()+be*7)},function(ie,be){return(be-ie)/s})}var st=it(0),xt=it(1),ot=it(2),J=it(3),mt=it(4),dt=it(5),Ct=it(6),Rt=st.range,Bt=xt.range,Zt=ot.range,Gt=J.range,ee=mt.range,xe=dt.range,ge=Ct.range,ye=P(function(Lt){Lt.setUTCDate(1),Lt.setUTCHours(0,0,0,0)},function(Lt,ie){Lt.setUTCMonth(Lt.getUTCMonth()+ie)},function(Lt,ie){return ie.getUTCMonth()-Lt.getUTCMonth()+(ie.getUTCFullYear()-Lt.getUTCFullYear())*12},function(Lt){return Lt.getUTCMonth()}),ue=ye.range,Mt=P(function(Lt){Lt.setUTCMonth(0,1),Lt.setUTCHours(0,0,0,0)},function(Lt,ie){Lt.setUTCFullYear(Lt.getUTCFullYear()+ie)},function(Lt,ie){return ie.getUTCFullYear()-Lt.getUTCFullYear()},function(Lt){return Lt.getUTCFullYear()});Mt.every=function(Lt){return!isFinite(Lt=Math.floor(Lt))||!(Lt>0)?null:P(function(ie){ie.setUTCFullYear(Math.floor(ie.getUTCFullYear()/Lt)*Lt),ie.setUTCMonth(0,1),ie.setUTCHours(0,0,0,0)},function(ie,be){ie.setUTCFullYear(ie.getUTCFullYear()+be*Lt)})};var Ot=Mt.range;f.timeDay=d,f.timeDays=k,f.timeFriday=g,f.timeFridays=W,f.timeHour=_,f.timeHours=A,f.timeInterval=P,f.timeMillisecond=n,f.timeMilliseconds=i,f.timeMinute=b,f.timeMinutes=x,f.timeMonday=E,f.timeMondays=N,f.timeMonth=H,f.timeMonths=q,f.timeSaturday=C,f.timeSaturdays=F,f.timeSecond=h,f.timeSeconds=m,f.timeSunday=D,f.timeSundays=S,f.timeThursday=p,f.timeThursdays=V,f.timeTuesday=I,f.timeTuesdays=B,f.timeWednesday=M,f.timeWednesdays=U,f.timeWeek=D,f.timeWeeks=S,f.timeYear=G,f.timeYears=tt,f.utcDay=rt,f.utcDays=gt,f.utcFriday=dt,f.utcFridays=xe,f.utcHour=vt,f.utcHours=ut,f.utcMillisecond=n,f.utcMilliseconds=i,f.utcMinute=ht,f.utcMinutes=bt,f.utcMonday=xt,f.utcMondays=Bt,f.utcMonth=ye,f.utcMonths=ue,f.utcSaturday=Ct,f.utcSaturdays=ge,f.utcSecond=h,f.utcSeconds=m,f.utcSunday=st,f.utcSundays=Rt,f.utcThursday=mt,f.utcThursdays=ee,f.utcTuesday=ot,f.utcTuesdays=Zt,f.utcWednesday=J,f.utcWednesdays=Gt,f.utcWeek=st,f.utcWeeks=Rt,f.utcYear=Mt,f.utcYears=Ot,Object.defineProperty(f,"__esModule",{value:!0})})}),on=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Vn()):(f=f||self,y(f.d3=f.d3||{},f.d3))})(et,function(f,y){function z(Xt){if(0<=Xt.y&&Xt.y<100){var oe=new Date(-1,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L);return oe.setFullYear(Xt.y),oe}return new Date(Xt.y,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L)}function P(Xt){if(0<=Xt.y&&Xt.y<100){var oe=new Date(Date.UTC(-1,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L));return oe.setUTCFullYear(Xt.y),oe}return new Date(Date.UTC(Xt.y,Xt.m,Xt.d,Xt.H,Xt.M,Xt.S,Xt.L))}function n(Xt,oe,zt){return{y:Xt,m:oe,d:zt,H:0,M:0,S:0,L:0}}function i(Xt){var oe=Xt.dateTime,zt=Xt.date,_t=Xt.time,Pt=Xt.periods,Ht=Xt.days,ae=Xt.shortDays,he=Xt.months,Me=Xt.shortMonths,qe=m(Pt),Ye=b(Pt),ur=m(Ht),Rr=b(Ht),zr=m(ae),xr=b(ae),pn=m(he),ci=b(he),ui=m(Me),yi=b(Me),Gi={a:Fi,A:Zi,b:Ji,B:ca,c:null,d:H,e:H,f:bt,H:q,I:G,j:tt,L:ht,m:vt,M:ut,p:Ei,q:Ga,Q:Qe,s:mr,S:rt,u:gt,U:it,V:st,w:xt,W:ot,x:null,X:null,y:J,Y:mt,Z:dt,"%":Ze},Ci={a:so,A:Fe,b:Re,B:Kr,c:null,d:Ct,e:Ct,f:ee,H:Rt,I:Bt,j:Zt,L:Gt,m:xe,M:ge,p:sn,q:cn,Q:Qe,s:mr,S:ye,u:ue,U:Mt,V:Ot,w:Lt,W:ie,x:null,X:null,y:be,Y:ce,Z:Le,"%":Ze},fi={a:vr,A:Ar,b:mn,B:Zn,c:Un,d:p,e:p,f:U,H:C,I:C,j:g,L:B,m:M,M:S,p:sr,q:I,Q:W,s:F,S:N,u:_,U:A,V:d,w:x,W:k,x:Wn,X:Li,y:D,Y:w,Z:E,"%":V};Gi.x=ba(zt,Gi),Gi.X=ba(_t,Gi),Gi.c=ba(oe,Gi),Ci.x=ba(zt,Ci),Ci.X=ba(_t,Ci),Ci.c=ba(oe,Ci);function ba(Yr,un){return function(Pn){var bn=[],ze=-1,yr=0,en=Yr.length,Rn,ni,xi;for(Pn instanceof Date||(Pn=new Date(+Pn));++ze53)return null;"w"in bn||(bn.w=1),"Z"in bn?(yr=P(n(bn.y,0,1)),en=yr.getUTCDay(),yr=en>4||en===0?y.utcMonday.ceil(yr):y.utcMonday(yr),yr=y.utcDay.offset(yr,(bn.V-1)*7),bn.y=yr.getUTCFullYear(),bn.m=yr.getUTCMonth(),bn.d=yr.getUTCDate()+(bn.w+6)%7):(yr=z(n(bn.y,0,1)),en=yr.getDay(),yr=en>4||en===0?y.timeMonday.ceil(yr):y.timeMonday(yr),yr=y.timeDay.offset(yr,(bn.V-1)*7),bn.y=yr.getFullYear(),bn.m=yr.getMonth(),bn.d=yr.getDate()+(bn.w+6)%7)}else("W"in bn||"U"in bn)&&("w"in bn||(bn.w="u"in bn?bn.u%7:"W"in bn?1:0),en="Z"in bn?P(n(bn.y,0,1)).getUTCDay():z(n(bn.y,0,1)).getDay(),bn.m=0,bn.d="W"in bn?(bn.w+6)%7+bn.W*7-(en+5)%7:bn.w+bn.U*7-(en+6)%7);return"Z"in bn?(bn.H+=bn.Z/100|0,bn.M+=bn.Z%100,P(bn)):z(bn)}}function Ke(Yr,un,Pn,bn){for(var ze=0,yr=un.length,en=Pn.length,Rn,ni;ze=en)return-1;if(Rn=un.charCodeAt(ze++),Rn===37){if(Rn=un.charAt(ze++),ni=fi[Rn in a?un.charAt(ze++):Rn],!ni||(bn=ni(Yr,Pn,bn))<0)return-1}else if(Rn!=Pn.charCodeAt(bn++))return-1}return bn}function sr(Yr,un,Pn){var bn=qe.exec(un.slice(Pn));return bn?(Yr.p=Ye[bn[0].toLowerCase()],Pn+bn[0].length):-1}function vr(Yr,un,Pn){var bn=zr.exec(un.slice(Pn));return bn?(Yr.w=xr[bn[0].toLowerCase()],Pn+bn[0].length):-1}function Ar(Yr,un,Pn){var bn=ur.exec(un.slice(Pn));return bn?(Yr.w=Rr[bn[0].toLowerCase()],Pn+bn[0].length):-1}function mn(Yr,un,Pn){var bn=ui.exec(un.slice(Pn));return bn?(Yr.m=yi[bn[0].toLowerCase()],Pn+bn[0].length):-1}function Zn(Yr,un,Pn){var bn=pn.exec(un.slice(Pn));return bn?(Yr.m=ci[bn[0].toLowerCase()],Pn+bn[0].length):-1}function Un(Yr,un,Pn){return Ke(Yr,oe,un,Pn)}function Wn(Yr,un,Pn){return Ke(Yr,zt,un,Pn)}function Li(Yr,un,Pn){return Ke(Yr,_t,un,Pn)}function Fi(Yr){return ae[Yr.getDay()]}function Zi(Yr){return Ht[Yr.getDay()]}function Ji(Yr){return Me[Yr.getMonth()]}function ca(Yr){return he[Yr.getMonth()]}function Ei(Yr){return Pt[+(Yr.getHours()>=12)]}function Ga(Yr){return 1+~~(Yr.getMonth()/3)}function so(Yr){return ae[Yr.getUTCDay()]}function Fe(Yr){return Ht[Yr.getUTCDay()]}function Re(Yr){return Me[Yr.getUTCMonth()]}function Kr(Yr){return he[Yr.getUTCMonth()]}function sn(Yr){return Pt[+(Yr.getUTCHours()>=12)]}function cn(Yr){return 1+~~(Yr.getUTCMonth()/3)}return{format:function(Yr){var un=ba(Yr+="",Gi);return un.toString=function(){return Yr},un},parse:function(Yr){var un=oa(Yr+="",!1);return un.toString=function(){return Yr},un},utcFormat:function(Yr){var un=ba(Yr+="",Ci);return un.toString=function(){return Yr},un},utcParse:function(Yr){var un=oa(Yr+="",!0);return un.toString=function(){return Yr},un}}}var a={"-":"",_:" ",0:"0"},l=/^\s*\d+/,o=/^%/,c=/[\\^$*+?|[\]().{}]/g;function s(Xt,oe,zt){var _t=Xt<0?"-":"",Pt=(_t?-Xt:Xt)+"",Ht=Pt.length;return _t+(Ht68?1900:2e3),zt+_t[0].length):-1}function E(Xt,oe,zt){var _t=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(oe.slice(zt,zt+6));return _t?(Xt.Z=_t[1]?0:-(_t[2]+(_t[3]||"00")),zt+_t[0].length):-1}function I(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+1));return _t?(Xt.q=_t[0]*3-3,zt+_t[0].length):-1}function M(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.m=_t[0]-1,zt+_t[0].length):-1}function p(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.d=+_t[0],zt+_t[0].length):-1}function g(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+3));return _t?(Xt.m=0,Xt.d=+_t[0],zt+_t[0].length):-1}function C(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.H=+_t[0],zt+_t[0].length):-1}function S(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.M=+_t[0],zt+_t[0].length):-1}function N(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+2));return _t?(Xt.S=+_t[0],zt+_t[0].length):-1}function B(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+3));return _t?(Xt.L=+_t[0],zt+_t[0].length):-1}function U(Xt,oe,zt){var _t=l.exec(oe.slice(zt,zt+6));return _t?(Xt.L=Math.floor(_t[0]/1e3),zt+_t[0].length):-1}function V(Xt,oe,zt){var _t=o.exec(oe.slice(zt,zt+1));return _t?zt+_t[0].length:-1}function W(Xt,oe,zt){var _t=l.exec(oe.slice(zt));return _t?(Xt.Q=+_t[0],zt+_t[0].length):-1}function F(Xt,oe,zt){var _t=l.exec(oe.slice(zt));return _t?(Xt.s=+_t[0],zt+_t[0].length):-1}function H(Xt,oe){return s(Xt.getDate(),oe,2)}function q(Xt,oe){return s(Xt.getHours(),oe,2)}function G(Xt,oe){return s(Xt.getHours()%12||12,oe,2)}function tt(Xt,oe){return s(1+y.timeDay.count(y.timeYear(Xt),Xt),oe,3)}function ht(Xt,oe){return s(Xt.getMilliseconds(),oe,3)}function bt(Xt,oe){return ht(Xt,oe)+"000"}function vt(Xt,oe){return s(Xt.getMonth()+1,oe,2)}function ut(Xt,oe){return s(Xt.getMinutes(),oe,2)}function rt(Xt,oe){return s(Xt.getSeconds(),oe,2)}function gt(Xt){var oe=Xt.getDay();return oe===0?7:oe}function it(Xt,oe){return s(y.timeSunday.count(y.timeYear(Xt)-1,Xt),oe,2)}function st(Xt,oe){var zt=Xt.getDay();return Xt=zt>=4||zt===0?y.timeThursday(Xt):y.timeThursday.ceil(Xt),s(y.timeThursday.count(y.timeYear(Xt),Xt)+(y.timeYear(Xt).getDay()===4),oe,2)}function xt(Xt){return Xt.getDay()}function ot(Xt,oe){return s(y.timeMonday.count(y.timeYear(Xt)-1,Xt),oe,2)}function J(Xt,oe){return s(Xt.getFullYear()%100,oe,2)}function mt(Xt,oe){return s(Xt.getFullYear()%1e4,oe,4)}function dt(Xt){var oe=Xt.getTimezoneOffset();return(oe>0?"-":(oe*=-1,"+"))+s(oe/60|0,"0",2)+s(oe%60,"0",2)}function Ct(Xt,oe){return s(Xt.getUTCDate(),oe,2)}function Rt(Xt,oe){return s(Xt.getUTCHours(),oe,2)}function Bt(Xt,oe){return s(Xt.getUTCHours()%12||12,oe,2)}function Zt(Xt,oe){return s(1+y.utcDay.count(y.utcYear(Xt),Xt),oe,3)}function Gt(Xt,oe){return s(Xt.getUTCMilliseconds(),oe,3)}function ee(Xt,oe){return Gt(Xt,oe)+"000"}function xe(Xt,oe){return s(Xt.getUTCMonth()+1,oe,2)}function ge(Xt,oe){return s(Xt.getUTCMinutes(),oe,2)}function ye(Xt,oe){return s(Xt.getUTCSeconds(),oe,2)}function ue(Xt){var oe=Xt.getUTCDay();return oe===0?7:oe}function Mt(Xt,oe){return s(y.utcSunday.count(y.utcYear(Xt)-1,Xt),oe,2)}function Ot(Xt,oe){var zt=Xt.getUTCDay();return Xt=zt>=4||zt===0?y.utcThursday(Xt):y.utcThursday.ceil(Xt),s(y.utcThursday.count(y.utcYear(Xt),Xt)+(y.utcYear(Xt).getUTCDay()===4),oe,2)}function Lt(Xt){return Xt.getUTCDay()}function ie(Xt,oe){return s(y.utcMonday.count(y.utcYear(Xt)-1,Xt),oe,2)}function be(Xt,oe){return s(Xt.getUTCFullYear()%100,oe,2)}function ce(Xt,oe){return s(Xt.getUTCFullYear()%1e4,oe,4)}function Le(){return"+0000"}function Ze(){return"%"}function Qe(Xt){return+Xt}function mr(Xt){return Math.floor(+Xt/1e3)}var fr;Jr({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"]});function Jr(Xt){return fr=i(Xt),f.timeFormat=fr.format,f.timeParse=fr.parse,f.utcFormat=fr.utcFormat,f.utcParse=fr.utcParse,fr}var an="%Y-%m-%dT%H:%M:%S.%LZ";function Er(Xt){return Xt.toISOString()}var dn=Date.prototype.toISOString?Er:f.utcFormat(an);function _n(Xt){var oe=new Date(Xt);return isNaN(oe)?null:oe}var Oe=+new Date("2000-01-01T00:00:00.000Z")?_n:f.utcParse(an);f.isoFormat=dn,f.isoParse=Oe,f.timeFormatDefaultLocale=Jr,f.timeFormatLocale=i,Object.defineProperty(f,"__esModule",{value:!0})})}),pr=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=typeof globalThis<"u"?globalThis:f||self,y(f.d3=f.d3||{}))})(et,function(f){function y(M){return Math.abs(M=Math.round(M))>=1e21?M.toLocaleString("en").replace(/,/g,""):M.toString(10)}function z(M,p){if((g=(M=p?M.toExponential(p-1):M.toExponential()).indexOf("e"))<0)return null;var g,C=M.slice(0,g);return[C.length>1?C[0]+C.slice(2):C,+M.slice(g+1)]}function P(M){return M=z(Math.abs(M)),M?M[1]:NaN}function n(M,p){return function(g,C){for(var S=g.length,N=[],B=0,U=M[0],V=0;S>0&&U>0&&(V+U+1>C&&(U=Math.max(1,C-V)),N.push(g.substring(S-=U,S+U)),!((V+=U+1)>C));)U=M[B=(B+1)%M.length];return N.reverse().join(p)}}function i(M){return function(p){return p.replace(/[0-9]/g,function(g){return M[+g]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l(M){if(!(p=a.exec(M)))throw new Error("invalid format: "+M);var p;return new o({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}l.prototype=o.prototype;function o(M){this.fill=M.fill===void 0?" ":M.fill+"",this.align=M.align===void 0?">":M.align+"",this.sign=M.sign===void 0?"-":M.sign+"",this.symbol=M.symbol===void 0?"":M.symbol+"",this.zero=!!M.zero,this.width=M.width===void 0?void 0:+M.width,this.comma=!!M.comma,this.precision=M.precision===void 0?void 0:+M.precision,this.trim=!!M.trim,this.type=M.type===void 0?"":M.type+""}o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function c(M){t:for(var p=M.length,g=1,C=-1,S;g0&&(C=0);break}return C>0?M.slice(0,C)+M.slice(S+1):M}var s;function h(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],S=g[1],N=S-(s=Math.max(-8,Math.min(8,Math.floor(S/3)))*3)+1,B=C.length;return N===B?C:N>B?C+new Array(N-B+1).join("0"):N>0?C.slice(0,N)+"."+C.slice(N):"0."+new Array(1-N).join("0")+z(M,Math.max(0,p+N-1))[0]}function m(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],S=g[1];return S<0?"0."+new Array(-S).join("0")+C:C.length>S+1?C.slice(0,S+1)+"."+C.slice(S+1):C+new Array(S-C.length+2).join("0")}var b={"%":function(M,p){return(M*100).toFixed(p)},b:function(M){return Math.round(M).toString(2)},c:function(M){return M+""},d:y,e:function(M,p){return M.toExponential(p)},f:function(M,p){return M.toFixed(p)},g:function(M,p){return M.toPrecision(p)},o:function(M){return Math.round(M).toString(8)},p:function(M,p){return m(M*100,p)},r:m,s:h,X:function(M){return Math.round(M).toString(16).toUpperCase()},x:function(M){return Math.round(M).toString(16)}};function x(M){return M}var _=Array.prototype.map,A=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function d(M){var p=M.grouping===void 0||M.thousands===void 0?x:n(_.call(M.grouping,Number),M.thousands+""),g=M.currency===void 0?"":M.currency[0]+"",C=M.currency===void 0?"":M.currency[1]+"",S=M.decimal===void 0?".":M.decimal+"",N=M.numerals===void 0?x:i(_.call(M.numerals,String)),B=M.percent===void 0?"%":M.percent+"",U=M.minus===void 0?"-":M.minus+"",V=M.nan===void 0?"NaN":M.nan+"";function W(H){H=l(H);var q=H.fill,G=H.align,tt=H.sign,ht=H.symbol,bt=H.zero,vt=H.width,ut=H.comma,rt=H.precision,gt=H.trim,it=H.type;it==="n"?(ut=!0,it="g"):b[it]||(rt===void 0&&(rt=12),gt=!0,it="g"),(bt||q==="0"&&G==="=")&&(bt=!0,q="0",G="=");var st=ht==="$"?g:ht==="#"&&/[boxX]/.test(it)?"0"+it.toLowerCase():"",xt=ht==="$"?C:/[%p]/.test(it)?B:"",ot=b[it],J=/[defgprs%]/.test(it);rt=rt===void 0?6:/[gprs]/.test(it)?Math.max(1,Math.min(21,rt)):Math.max(0,Math.min(20,rt));function mt(dt){var Ct=st,Rt=xt,Bt,Zt,Gt;if(it==="c")Rt=ot(dt)+Rt,dt="";else{dt=+dt;var ee=dt<0||1/dt<0;if(dt=isNaN(dt)?V:ot(Math.abs(dt),rt),gt&&(dt=c(dt)),ee&&+dt==0&&tt!=="+"&&(ee=!1),Ct=(ee?tt==="("?tt:U:tt==="-"||tt==="("?"":tt)+Ct,Rt=(it==="s"?A[8+s/3]:"")+Rt+(ee&&tt==="("?")":""),J){for(Bt=-1,Zt=dt.length;++BtGt||Gt>57){Rt=(Gt===46?S+dt.slice(Bt+1):dt.slice(Bt))+Rt,dt=dt.slice(0,Bt);break}}}ut&&!bt&&(dt=p(dt,1/0));var xe=Ct.length+dt.length+Rt.length,ge=xe>1)+Ct+dt+Rt+ge.slice(xe);break;default:dt=ge+Ct+dt+Rt;break}return N(dt)}return mt.toString=function(){return H+""},mt}function F(H,q){var G=W((H=l(H),H.type="f",H)),tt=Math.max(-8,Math.min(8,Math.floor(P(q)/3)))*3,ht=Math.pow(10,-tt),bt=A[8+tt/3];return function(vt){return G(ht*vt)+bt}}return{format:W,formatPrefix:F}}var k;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(M){return k=d(M),f.format=k.format,f.formatPrefix=k.formatPrefix,k}function D(M){return Math.max(0,-P(Math.abs(M)))}function E(M,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(P(p)/3)))*3-P(Math.abs(M)))}function I(M,p){return M=Math.abs(M),p=Math.abs(p)-M,Math.max(0,P(p)-P(M))+1}f.FormatSpecifier=o,f.formatDefaultLocale=w,f.formatLocale=d,f.formatSpecifier=l,f.precisionFixed=D,f.precisionPrefix=E,f.precisionRound=I,Object.defineProperty(f,"__esModule",{value:!0})})}),_r=It((et,Y)=>{Y.exports=function(f){for(var y=f.length,z,P=0;P13)&&z!==32&&z!==133&&z!==160&&z!==5760&&z!==6158&&(z<8192||z>8205)&&z!==8232&&z!==8233&&z!==8239&&z!==8287&&z!==8288&&z!==12288&&z!==65279)return!1;return!0}}),Sr=It((et,Y)=>{var f=_r();Y.exports=function(y){var z=typeof y;if(z==="string"){var P=y;if(y=+y,y===0&&f(P))return!1}else if(z!=="number")return!1;return y-y<1}}),Dr=It((et,Y)=>{Y.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}),nn=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=typeof globalThis<"u"?globalThis:f||self,y(f["base64-arraybuffer"]={}))})(et,function(f){for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=typeof Uint8Array>"u"?[]:new Uint8Array(256),P=0;P>2],s+=y[(l[o]&3)<<4|l[o+1]>>4],s+=y[(l[o+1]&15)<<2|l[o+2]>>6],s+=y[l[o+2]&63];return c%3===2?s=s.substring(0,s.length-1)+"=":c%3===1&&(s=s.substring(0,s.length-2)+"=="),s},i=function(a){var l=a.length*.75,o=a.length,c,s=0,h,m,b,x;a[a.length-1]==="="&&(l--,a[a.length-2]==="="&&l--);var _=new ArrayBuffer(l),A=new Uint8Array(_);for(c=0;c>4,A[s++]=(m&15)<<4|b>>2,A[s++]=(b&3)<<6|x&63;return _};f.decode=i,f.encode=n,Object.defineProperty(f,"__esModule",{value:!0})})}),Cn=It((et,Y)=>{Y.exports=function(f){return window&&window.process&&window.process.versions?Object.prototype.toString.call(f)==="[object Object]":Object.prototype.toString.call(f)==="[object Object]"&&Object.getPrototypeOf(f).hasOwnProperty("hasOwnProperty")}}),Xn=It(et=>{var Y=nn().decode,f=Cn(),y=Array.isArray,z=ArrayBuffer,P=DataView;function n(h){return z.isView(h)&&!(h instanceof P)}et.isTypedArray=n;function i(h){return y(h)||n(h)}et.isArrayOrTypedArray=i;function a(h){return!i(h[0])}et.isArray1D=a,et.ensureArray=function(h,m){return y(h)||(h=[]),h.length=m,h};var l={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8;function o(h){return h.constructor===ArrayBuffer}et.isArrayBuffer=o,et.decodeTypedArraySpec=function(h){var m=[],b=c(h),x=b.dtype,_=l[x];if(!_)throw new Error('Error in dtype: "'+x+'"');var A=_.BYTES_PER_ELEMENT,d=b.bdata;o(d)||(d=Y(d));var k=b.shape===void 0?[d.byteLength/A]:(""+b.shape).split(",");k.reverse();var w=k.length,D,E,I=+k[0],M=A*I,p=0;if(w===1)m=new _(d);else if(w===2)for(D=+k[1],E=0;E{var f=Sr(),y=Xn().isArrayOrTypedArray;Y.exports=function(s,h){if(f(h))h=String(h);else if(typeof h!="string"||h.substr(h.length-4)==="[-1]")throw"bad property string";var m=h.split("."),b,x,_,A;for(A=0;A{var f=_i(),y=/^\w*$/,z=0,P=1,n=2,i=3,a=4;Y.exports=function(l,o,c,s){c=c||"name",s=s||"value";var h,m,b,x={};o&&o.length?(b=f(l,o),m=b.get()):m=l,o=o||"";var _={};if(m)for(h=0;h2)return x[w]=x[w]|n,d.set(k,null);if(A){for(h=w;h{var f=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,y=/^[^\.\[\]]+$/;Y.exports=function(z,P){for(;P;){var n=z.match(f);if(n)z=n[1];else if(z.match(y))z="";else throw new Error("bad relativeAttr call:"+[z,P]);if(P.charAt(0)==="^")P=P.slice(1);else break}return z&&P.charAt(0)!=="["?z+"."+P:z+P}}),_a=It((et,Y)=>{var f=Sr();Y.exports=function(y,z){if(y>0)return Math.log(y)/Math.LN10;var P=Math.log(Math.min(z[0],z[1]))/Math.LN10;return f(P)||(P=Math.log(Math.max(z[0],z[1]))/Math.LN10-6),P}}),qi=It((et,Y)=>{var f=Xn().isArrayOrTypedArray,y=Cn();Y.exports=function z(P,n){for(var i in n){var a=n[i],l=P[i];if(l!==a)if(i.charAt(0)==="_"||typeof a=="function"){if(i in P)continue;P[i]=a}else if(f(a)&&f(l)&&y(a[0])){if(i==="customdata"||i==="ids")continue;for(var o=Math.min(a.length,l.length),c=0;c{function f(z,P){var n=z%P;return n<0?n+P:n}function y(z,P){return Math.abs(z)>P/2?z-Math.round(z/P)*P:z}Y.exports={mod:f,modHalf:y}}),Xi=It((et,Y)=>{(function(f){var y=/^\s+/,z=/\s+$/,P=0,n=f.round,i=f.min,a=f.max,l=f.random;function o(J,mt){if(J=J||"",mt=mt||{},J instanceof o)return J;if(!(this instanceof o))return new o(J,mt);var dt=c(J);this._originalInput=J,this._r=dt.r,this._g=dt.g,this._b=dt.b,this._a=dt.a,this._roundA=n(100*this._a)/100,this._format=mt.format||dt.format,this._gradientType=mt.gradientType,this._r<1&&(this._r=n(this._r)),this._g<1&&(this._g=n(this._g)),this._b<1&&(this._b=n(this._b)),this._ok=dt.ok,this._tc_id=P++}o.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var J=this.toRgb();return(J.r*299+J.g*587+J.b*114)/1e3},getLuminance:function(){var J=this.toRgb(),mt,dt,Ct,Rt,Bt,Zt;return mt=J.r/255,dt=J.g/255,Ct=J.b/255,mt<=.03928?Rt=mt/12.92:Rt=f.pow((mt+.055)/1.055,2.4),dt<=.03928?Bt=dt/12.92:Bt=f.pow((dt+.055)/1.055,2.4),Ct<=.03928?Zt=Ct/12.92:Zt=f.pow((Ct+.055)/1.055,2.4),.2126*Rt+.7152*Bt+.0722*Zt},setAlpha:function(J){return this._a=H(J),this._roundA=n(100*this._a)/100,this},toHsv:function(){var J=b(this._r,this._g,this._b);return{h:J.h*360,s:J.s,v:J.v,a:this._a}},toHsvString:function(){var J=b(this._r,this._g,this._b),mt=n(J.h*360),dt=n(J.s*100),Ct=n(J.v*100);return this._a==1?"hsv("+mt+", "+dt+"%, "+Ct+"%)":"hsva("+mt+", "+dt+"%, "+Ct+"%, "+this._roundA+")"},toHsl:function(){var J=h(this._r,this._g,this._b);return{h:J.h*360,s:J.s,l:J.l,a:this._a}},toHslString:function(){var J=h(this._r,this._g,this._b),mt=n(J.h*360),dt=n(J.s*100),Ct=n(J.l*100);return this._a==1?"hsl("+mt+", "+dt+"%, "+Ct+"%)":"hsla("+mt+", "+dt+"%, "+Ct+"%, "+this._roundA+")"},toHex:function(J){return _(this._r,this._g,this._b,J)},toHexString:function(J){return"#"+this.toHex(J)},toHex8:function(J){return A(this._r,this._g,this._b,this._a,J)},toHex8String:function(J){return"#"+this.toHex8(J)},toRgb:function(){return{r:n(this._r),g:n(this._g),b:n(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+n(this._r)+", "+n(this._g)+", "+n(this._b)+")":"rgba("+n(this._r)+", "+n(this._g)+", "+n(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:n(q(this._r,255)*100)+"%",g:n(q(this._g,255)*100)+"%",b:n(q(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+n(q(this._r,255)*100)+"%, "+n(q(this._g,255)*100)+"%, "+n(q(this._b,255)*100)+"%)":"rgba("+n(q(this._r,255)*100)+"%, "+n(q(this._g,255)*100)+"%, "+n(q(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:W[_(this._r,this._g,this._b,!0)]||!1},toFilter:function(J){var mt="#"+d(this._r,this._g,this._b,this._a),dt=mt,Ct=this._gradientType?"GradientType = 1, ":"";if(J){var Rt=o(J);dt="#"+d(Rt._r,Rt._g,Rt._b,Rt._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ct+"startColorstr="+mt+",endColorstr="+dt+")"},toString:function(J){var mt=!!J;J=J||this._format;var dt=!1,Ct=this._a<1&&this._a>=0,Rt=!mt&&Ct&&(J==="hex"||J==="hex6"||J==="hex3"||J==="hex4"||J==="hex8"||J==="name");return Rt?J==="name"&&this._a===0?this.toName():this.toRgbString():(J==="rgb"&&(dt=this.toRgbString()),J==="prgb"&&(dt=this.toPercentageRgbString()),(J==="hex"||J==="hex6")&&(dt=this.toHexString()),J==="hex3"&&(dt=this.toHexString(!0)),J==="hex4"&&(dt=this.toHex8String(!0)),J==="hex8"&&(dt=this.toHex8String()),J==="name"&&(dt=this.toName()),J==="hsl"&&(dt=this.toHslString()),J==="hsv"&&(dt=this.toHsvString()),dt||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(J,mt){var dt=J.apply(null,[this].concat([].slice.call(mt)));return this._r=dt._r,this._g=dt._g,this._b=dt._b,this.setAlpha(dt._a),this},lighten:function(){return this._applyModification(E,arguments)},brighten:function(){return this._applyModification(I,arguments)},darken:function(){return this._applyModification(M,arguments)},desaturate:function(){return this._applyModification(k,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(J,mt){return J.apply(null,[this].concat([].slice.call(mt)))},analogous:function(){return this._applyCombination(B,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(U,arguments)},splitcomplement:function(){return this._applyCombination(N,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(S,arguments)}},o.fromRatio=function(J,mt){if(typeof J=="object"){var dt={};for(var Ct in J)J.hasOwnProperty(Ct)&&(Ct==="a"?dt[Ct]=J[Ct]:dt[Ct]=ut(J[Ct]));J=dt}return o(J,mt)};function c(J){var mt={r:0,g:0,b:0},dt=1,Ct=null,Rt=null,Bt=null,Zt=!1,Gt=!1;return typeof J=="string"&&(J=xt(J)),typeof J=="object"&&(st(J.r)&&st(J.g)&&st(J.b)?(mt=s(J.r,J.g,J.b),Zt=!0,Gt=String(J.r).substr(-1)==="%"?"prgb":"rgb"):st(J.h)&&st(J.s)&&st(J.v)?(Ct=ut(J.s),Rt=ut(J.v),mt=x(J.h,Ct,Rt),Zt=!0,Gt="hsv"):st(J.h)&&st(J.s)&&st(J.l)&&(Ct=ut(J.s),Bt=ut(J.l),mt=m(J.h,Ct,Bt),Zt=!0,Gt="hsl"),J.hasOwnProperty("a")&&(dt=J.a)),dt=H(dt),{ok:Zt,format:J.format||Gt,r:i(255,a(mt.r,0)),g:i(255,a(mt.g,0)),b:i(255,a(mt.b,0)),a:dt}}function s(J,mt,dt){return{r:q(J,255)*255,g:q(mt,255)*255,b:q(dt,255)*255}}function h(J,mt,dt){J=q(J,255),mt=q(mt,255),dt=q(dt,255);var Ct=a(J,mt,dt),Rt=i(J,mt,dt),Bt,Zt,Gt=(Ct+Rt)/2;if(Ct==Rt)Bt=Zt=0;else{var ee=Ct-Rt;switch(Zt=Gt>.5?ee/(2-Ct-Rt):ee/(Ct+Rt),Ct){case J:Bt=(mt-dt)/ee+(mt1&&(ye-=1),ye<1/6?xe+(ge-xe)*6*ye:ye<1/2?ge:ye<2/3?xe+(ge-xe)*(2/3-ye)*6:xe}if(mt===0)Ct=Rt=Bt=dt;else{var Gt=dt<.5?dt*(1+mt):dt+mt-dt*mt,ee=2*dt-Gt;Ct=Zt(ee,Gt,J+1/3),Rt=Zt(ee,Gt,J),Bt=Zt(ee,Gt,J-1/3)}return{r:Ct*255,g:Rt*255,b:Bt*255}}function b(J,mt,dt){J=q(J,255),mt=q(mt,255),dt=q(dt,255);var Ct=a(J,mt,dt),Rt=i(J,mt,dt),Bt,Zt,Gt=Ct,ee=Ct-Rt;if(Zt=Ct===0?0:ee/Ct,Ct==Rt)Bt=0;else{switch(Ct){case J:Bt=(mt-dt)/ee+(mt>1)+720)%360;--mt;)Ct.h=(Ct.h+Rt)%360,Bt.push(o(Ct));return Bt}function U(J,mt){mt=mt||6;for(var dt=o(J).toHsv(),Ct=dt.h,Rt=dt.s,Bt=dt.v,Zt=[],Gt=1/mt;mt--;)Zt.push(o({h:Ct,s:Rt,v:Bt})),Bt=(Bt+Gt)%1;return Zt}o.mix=function(J,mt,dt){dt=dt===0?0:dt||50;var Ct=o(J).toRgb(),Rt=o(mt).toRgb(),Bt=dt/100,Zt={r:(Rt.r-Ct.r)*Bt+Ct.r,g:(Rt.g-Ct.g)*Bt+Ct.g,b:(Rt.b-Ct.b)*Bt+Ct.b,a:(Rt.a-Ct.a)*Bt+Ct.a};return o(Zt)},o.readability=function(J,mt){var dt=o(J),Ct=o(mt);return(f.max(dt.getLuminance(),Ct.getLuminance())+.05)/(f.min(dt.getLuminance(),Ct.getLuminance())+.05)},o.isReadable=function(J,mt,dt){var Ct=o.readability(J,mt),Rt,Bt;switch(Bt=!1,Rt=ot(dt),Rt.level+Rt.size){case"AAsmall":case"AAAlarge":Bt=Ct>=4.5;break;case"AAlarge":Bt=Ct>=3;break;case"AAAsmall":Bt=Ct>=7;break}return Bt},o.mostReadable=function(J,mt,dt){var Ct=null,Rt=0,Bt,Zt,Gt,ee;dt=dt||{},Zt=dt.includeFallbackColors,Gt=dt.level,ee=dt.size;for(var xe=0;xeRt&&(Rt=Bt,Ct=o(mt[xe]));return o.isReadable(J,Ct,{level:Gt,size:ee})||!Zt?Ct:(dt.includeFallbackColors=!1,o.mostReadable(J,["#fff","#000"],dt))};var V=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},W=o.hexNames=F(V);function F(J){var mt={};for(var dt in J)J.hasOwnProperty(dt)&&(mt[J[dt]]=dt);return mt}function H(J){return J=parseFloat(J),(isNaN(J)||J<0||J>1)&&(J=1),J}function q(J,mt){ht(J)&&(J="100%");var dt=bt(J);return J=i(mt,a(0,parseFloat(J))),dt&&(J=parseInt(J*mt,10)/100),f.abs(J-mt)<1e-6?1:J%mt/parseFloat(mt)}function G(J){return i(1,a(0,J))}function tt(J){return parseInt(J,16)}function ht(J){return typeof J=="string"&&J.indexOf(".")!=-1&&parseFloat(J)===1}function bt(J){return typeof J=="string"&&J.indexOf("%")!=-1}function vt(J){return J.length==1?"0"+J:""+J}function ut(J){return J<=1&&(J=J*100+"%"),J}function rt(J){return f.round(parseFloat(J)*255).toString(16)}function gt(J){return tt(J)/255}var it=function(){var J="[-\\+]?\\d+%?",mt="[-\\+]?\\d*\\.\\d+%?",dt="(?:"+mt+")|(?:"+J+")",Ct="[\\s|\\(]+("+dt+")[,|\\s]+("+dt+")[,|\\s]+("+dt+")\\s*\\)?",Rt="[\\s|\\(]+("+dt+")[,|\\s]+("+dt+")[,|\\s]+("+dt+")[,|\\s]+("+dt+")\\s*\\)?";return{CSS_UNIT:new RegExp(dt),rgb:new RegExp("rgb"+Ct),rgba:new RegExp("rgba"+Rt),hsl:new RegExp("hsl"+Ct),hsla:new RegExp("hsla"+Rt),hsv:new RegExp("hsv"+Ct),hsva:new RegExp("hsva"+Rt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function st(J){return!!it.CSS_UNIT.exec(J)}function xt(J){J=J.replace(y,"").replace(z,"").toLowerCase();var mt=!1;if(V[J])J=V[J],mt=!0;else if(J=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var dt;return(dt=it.rgb.exec(J))?{r:dt[1],g:dt[2],b:dt[3]}:(dt=it.rgba.exec(J))?{r:dt[1],g:dt[2],b:dt[3],a:dt[4]}:(dt=it.hsl.exec(J))?{h:dt[1],s:dt[2],l:dt[3]}:(dt=it.hsla.exec(J))?{h:dt[1],s:dt[2],l:dt[3],a:dt[4]}:(dt=it.hsv.exec(J))?{h:dt[1],s:dt[2],v:dt[3]}:(dt=it.hsva.exec(J))?{h:dt[1],s:dt[2],v:dt[3],a:dt[4]}:(dt=it.hex8.exec(J))?{r:tt(dt[1]),g:tt(dt[2]),b:tt(dt[3]),a:gt(dt[4]),format:mt?"name":"hex8"}:(dt=it.hex6.exec(J))?{r:tt(dt[1]),g:tt(dt[2]),b:tt(dt[3]),format:mt?"name":"hex"}:(dt=it.hex4.exec(J))?{r:tt(dt[1]+""+dt[1]),g:tt(dt[2]+""+dt[2]),b:tt(dt[3]+""+dt[3]),a:gt(dt[4]+""+dt[4]),format:mt?"name":"hex8"}:(dt=it.hex3.exec(J))?{r:tt(dt[1]+""+dt[1]),g:tt(dt[2]+""+dt[2]),b:tt(dt[3]+""+dt[3]),format:mt?"name":"hex"}:!1}function ot(J){var mt,dt;return J=J||{level:"AA",size:"small"},mt=(J.level||"AA").toUpperCase(),dt=(J.size||"small").toLowerCase(),mt!=="AA"&&mt!=="AAA"&&(mt="AA"),dt!=="small"&&dt!=="large"&&(dt="small"),{level:mt,size:dt}}typeof Y<"u"&&Y.exports?Y.exports=o:window.tinycolor=o})(Math)}),Yn=It(et=>{var Y=Cn(),f=Array.isArray;function y(P,n){var i,a;for(i=0;i{Y.exports=function(f){var y=f.variantValues,z=f.editType,P=f.colorEditType;P===void 0&&(P=z);var n={editType:z,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};f.noNumericWeightValues&&(n.valType="enumerated",n.values=n.extras,n.extras=void 0,n.min=void 0,n.max=void 0);var i={family:{valType:"string",noBlank:!0,strict:!0,editType:z},size:{valType:"number",min:1,editType:z},color:{valType:"color",editType:P},weight:n,style:{editType:z,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:f.noFontVariant?void 0:{editType:z,valType:"enumerated",values:y||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:f.noFontTextcase?void 0:{editType:z,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:f.noFontLineposition?void 0:{editType:z,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:f.noFontShadow?void 0:{editType:z,valType:"string",dflt:f.autoShadowDflt?"auto":"none"},editType:z};return f.autoSize&&(i.size.dflt="auto"),f.autoColor&&(i.color.dflt="auto"),f.arrayOk&&(i.family.arrayOk=!0,i.weight.arrayOk=!0,i.style.arrayOk=!0,f.noFontVariant||(i.variant.arrayOk=!0),f.noFontTextcase||(i.textcase.arrayOk=!0),f.noFontLineposition||(i.lineposition.arrayOk=!0),f.noFontShadow||(i.shadow.arrayOk=!0),i.size.arrayOk=!0,i.color.arrayOk=!0),i}}),na=It((et,Y)=>{Y.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),Xa=It((et,Y)=>{var f=na(),y=hi(),z=y({editType:"none"});z.family.dflt=f.HOVERFONT,z.size.dflt=f.HOVERFONTSIZE,Y.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:z,grouptitlefont:y({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),oo=It((et,Y)=>{var f=hi(),y=Xa().hoverlabel,z=Yn().extendFlat;Y.exports={hoverlabel:{bgcolor:z({},y.bgcolor,{arrayOk:!0}),bordercolor:z({},y.bordercolor,{arrayOk:!0}),font:f({arrayOk:!0,editType:"none"}),align:z({},y.align,{arrayOk:!0}),namelength:z({},y.namelength,{arrayOk:!0}),showarrow:z({},y.showarrow),editType:"none"}}}),xa=It((et,Y)=>{var f=hi(),y=oo();Y.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:f({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:y.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),Ur=It((et,Y)=>{var f=Xi(),y={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},z=y.RdBu;function P(a,l){if(l||(l=z),!a)return l;function o(){try{a=y[a]||JSON.parse(a)}catch{a=l}}return typeof a=="string"&&(o(),typeof a=="string"&&o()),n(a)?a:l}function n(a){var l=0;if(!Array.isArray(a)||a.length<2||!a[0]||!a[a.length-1]||+a[0][0]!=0||+a[a.length-1][0]!=1)return!1;for(var o=0;o{et.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],et.defaultLine="#444",et.lightLine="#eee",et.background="#fff",et.borderLine="#BEC8D9",et.lightFraction=1e3/11}),Hn=It((et,Y)=>{var f=Xi(),y=Sr(),z=Xn().isTypedArray,P=Y.exports={},n=Sn();P.defaults=n.defaults;var i=P.defaultLine=n.defaultLine;P.lightLine=n.lightLine;var a=P.background=n.background;P.tinyRGB=function(o){var c=o.toRgb();return"rgb("+Math.round(c.r)+", "+Math.round(c.g)+", "+Math.round(c.b)+")"},P.rgb=function(o){return P.tinyRGB(f(o))},P.opacity=function(o){return o?f(o).getAlpha():0},P.addOpacity=function(o,c){var s=f(o).toRgb();return"rgba("+Math.round(s.r)+", "+Math.round(s.g)+", "+Math.round(s.b)+", "+c+")"},P.combine=function(o,c){var s=f(o).toRgb();if(s.a===1)return f(o).toRgbString();var h=f(c||a).toRgb(),m=h.a===1?h:{r:255*(1-h.a)+h.r*h.a,g:255*(1-h.a)+h.g*h.a,b:255*(1-h.a)+h.b*h.a},b={r:m.r*(1-s.a)+s.r*s.a,g:m.g*(1-s.a)+s.g*s.a,b:m.b*(1-s.a)+s.b*s.a};return f(b).toRgbString()},P.interpolate=function(o,c,s){var h=f(o).toRgb(),m=f(c).toRgb(),b={r:s*h.r+(1-s)*m.r,g:s*h.g+(1-s)*m.g,b:s*h.b+(1-s)*m.b};return f(b).toRgbString()},P.contrast=function(o,c,s){var h=f(o);h.getAlpha()!==1&&(h=f(P.combine(o,a)));var m=h.isDark()?c?h.lighten(c):a:s?h.darken(s):i;return m.toString()},P.stroke=function(o,c){var s=f(c);o.style({stroke:P.tinyRGB(s),"stroke-opacity":s.getAlpha()})},P.fill=function(o,c){var s=f(c);o.style({fill:P.tinyRGB(s),"fill-opacity":s.getAlpha()})},P.clean=function(o){if(!(!o||typeof o!="object")){var c=Object.keys(o),s,h,m,b;for(s=0;s=0)))return o;if(b===3)h[b]>1&&(h[b]=1);else if(h[b]>=1)return o}var x=Math.round(h[0]*255)+", "+Math.round(h[1]*255)+", "+Math.round(h[2]*255);return m?"rgba("+x+", "+h[3]+")":"rgb("+x+")"}}),to=It((et,Y)=>{Y.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),Ha=It(et=>{et.counter=function(Y,f,y,z){var P=(f||"")+(y?"":"$"),n=z===!1?"":"^";return Y==="xy"?new RegExp(n+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+P):new RegExp(n+Y+"([2-9]|[1-9][0-9]+)?"+P)}}),qa=It(et=>{var Y=Sr(),f=Xi(),y=Yn().extendFlat,z=xa(),P=Ur(),n=Hn(),i=to().DESELECTDIM,a=_i(),l=Ha().counter,o=Bi().modHalf,c=Xn().isArrayOrTypedArray,s=Xn().isTypedArraySpec,h=Xn().decodeTypedArraySpec;et.valObjectMeta={data_array:{coerceFunction:function(b,x,_){x.set(c(b)?b:s(b)?h(b):_)}},enumerated:{coerceFunction:function(b,x,_,A){A.coerceNumber&&(b=+b),A.values.indexOf(b)===-1?x.set(_):x.set(b)},validateFunction:function(b,x){x.coerceNumber&&(b=+b);for(var _=x.values,A=0;A<_.length;A++){var d=String(_[A]);if(d.charAt(0)==="/"&&d.charAt(d.length-1)==="/"){var k=new RegExp(d.substr(1,d.length-2));if(k.test(b))return!0}else if(b===_[A])return!0}return!1}},boolean:{coerceFunction:function(b,x,_){b===!0||b===!1?x.set(b):x.set(_)}},number:{coerceFunction:function(b,x,_,A){s(b)&&(b=h(b)),!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},integer:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}s(b)&&(b=h(b)),b%1||!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},string:{coerceFunction:function(b,x,_,A){if(typeof b!="string"){var d=typeof b=="number";A.strict===!0||!d?x.set(_):x.set(String(b))}else A.noBlank&&!b?x.set(_):x.set(b)}},color:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),f(b).isValid()?x.set(b):x.set(_)}},colorlist:{coerceFunction:function(b,x,_){function A(d){return f(d).isValid()}!Array.isArray(b)||!b.length?x.set(_):b.every(A)?x.set(b):x.set(_)}},colorscale:{coerceFunction:function(b,x,_){x.set(P.get(b,_))}},angle:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),b==="auto"?x.set("auto"):Y(b)?x.set(o(+b,360)):x.set(_)}},subplotid:{coerceFunction:function(b,x,_,A){var d=A.regex||l(_);if(typeof b=="string"&&d.test(b)){x.set(b);return}x.set(_)},validateFunction:function(b,x){var _=x.dflt;return b===_?!0:typeof b!="string"?!1:!!l(_).test(b)}},flaglist:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}if(typeof b!="string"){x.set(_);return}for(var d=b.split("+"),k=0;k{var f={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},y={};function z(P,n){for(var i in P){var a=P[i];a.valType?n[i]=a.dflt:(n[i]||(n[i]={}),z(a,n[i]))}}z(f,y),Y.exports={configAttributes:f,dfltConfig:y}}),Wo=It((et,Y)=>{var f=Br(),y=Sr(),z=[];Y.exports=function(P,n){if(z.indexOf(P)!==-1)return;z.push(P);var i=1e3;y(n)?i=n:n==="long"&&(i=3e3);var a=f.select("body").selectAll(".plotly-notifier").data([0]);a.enter().append("div").classed("plotly-notifier",!0);var l=a.selectAll(".notifier-note").data(z);function o(c){c.duration(700).style("opacity",0).each("end",function(s){var h=z.indexOf(s);h!==-1&&z.splice(h,1),f.select(this).remove()})}l.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(c){var s=f.select(this);s.append("button").classed("notifier-close",!0).html("×").on("click",function(){s.transition().call(o)});for(var h=s.append("p"),m=c.split(//g),b=0;b{var f=Mo().dfltConfig,y=Wo(),z=Y.exports={};z.log=function(){var P;if(f.logging>1){var n=["LOG:"];for(P=0;P1){var i=[];for(P=0;P"),"long")}},z.warn=function(){var P;if(f.logging>0){var n=["WARN:"];for(P=0;P0){var i=[];for(P=0;P"),"stick")}},z.error=function(){var P;if(f.logging>0){var n=["ERROR:"];for(P=0;P0){var i=[];for(P=0;P"),"stick")}}}),Io=It((et,Y)=>{Y.exports=function(){}}),Ys=It((et,Y)=>{Y.exports=function(f,y){if(y instanceof RegExp){for(var z=y.toString(),P=0;P{Y.exports=f;function f(){var y=new Float32Array(16);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),Ss=It((et,Y)=>{Y.exports=f;function f(y){var z=new Float32Array(16);return z[0]=y[0],z[1]=y[1],z[2]=y[2],z[3]=y[3],z[4]=y[4],z[5]=y[5],z[6]=y[6],z[7]=y[7],z[8]=y[8],z[9]=y[9],z[10]=y[10],z[11]=y[11],z[12]=y[12],z[13]=y[13],z[14]=y[14],z[15]=y[15],z}}),Us=It((et,Y)=>{Y.exports=f;function f(y,z){return y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),Ac=It((et,Y)=>{Y.exports=f;function f(y){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),Ou=It((et,Y)=>{Y.exports=f;function f(y,z){if(y===z){var P=z[1],n=z[2],i=z[3],a=z[6],l=z[7],o=z[11];y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=P,y[6]=z[9],y[7]=z[13],y[8]=n,y[9]=a,y[11]=z[14],y[12]=i,y[13]=l,y[14]=o}else y[0]=z[0],y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=z[1],y[5]=z[5],y[6]=z[9],y[7]=z[13],y[8]=z[2],y[9]=z[6],y[10]=z[10],y[11]=z[14],y[12]=z[3],y[13]=z[7],y[14]=z[11],y[15]=z[15];return y}}),Bu=It((et,Y)=>{Y.exports=f;function f(y,z){var P=z[0],n=z[1],i=z[2],a=z[3],l=z[4],o=z[5],c=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],d=z[14],k=z[15],w=P*o-n*l,D=P*c-i*l,E=P*s-a*l,I=n*c-i*o,M=n*s-a*o,p=i*s-a*c,g=h*A-m*_,C=h*d-b*_,S=h*k-x*_,N=m*d-b*A,B=m*k-x*A,U=b*k-x*d,V=w*U-D*B+E*N+I*S-M*C+p*g;return V?(V=1/V,y[0]=(o*U-c*B+s*N)*V,y[1]=(i*B-n*U-a*N)*V,y[2]=(A*p-d*M+k*I)*V,y[3]=(b*M-m*p-x*I)*V,y[4]=(c*S-l*U-s*C)*V,y[5]=(P*U-i*S+a*C)*V,y[6]=(d*E-_*p-k*D)*V,y[7]=(h*p-b*E+x*D)*V,y[8]=(l*B-o*S+s*g)*V,y[9]=(n*S-P*B-a*g)*V,y[10]=(_*M-A*E+k*w)*V,y[11]=(m*E-h*M-x*w)*V,y[12]=(o*C-l*N-c*g)*V,y[13]=(P*N-n*C+i*g)*V,y[14]=(A*D-_*I-d*w)*V,y[15]=(h*I-m*D+b*w)*V,y):null}}),dp=It((et,Y)=>{Y.exports=f;function f(y,z){var P=z[0],n=z[1],i=z[2],a=z[3],l=z[4],o=z[5],c=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],d=z[14],k=z[15];return y[0]=o*(b*k-x*d)-m*(c*k-s*d)+A*(c*x-s*b),y[1]=-(n*(b*k-x*d)-m*(i*k-a*d)+A*(i*x-a*b)),y[2]=n*(c*k-s*d)-o*(i*k-a*d)+A*(i*s-a*c),y[3]=-(n*(c*x-s*b)-o*(i*x-a*b)+m*(i*s-a*c)),y[4]=-(l*(b*k-x*d)-h*(c*k-s*d)+_*(c*x-s*b)),y[5]=P*(b*k-x*d)-h*(i*k-a*d)+_*(i*x-a*b),y[6]=-(P*(c*k-s*d)-l*(i*k-a*d)+_*(i*s-a*c)),y[7]=P*(c*x-s*b)-l*(i*x-a*b)+h*(i*s-a*c),y[8]=l*(m*k-x*A)-h*(o*k-s*A)+_*(o*x-s*m),y[9]=-(P*(m*k-x*A)-h*(n*k-a*A)+_*(n*x-a*m)),y[10]=P*(o*k-s*A)-l*(n*k-a*A)+_*(n*s-a*o),y[11]=-(P*(o*x-s*m)-l*(n*x-a*m)+h*(n*s-a*o)),y[12]=-(l*(m*d-b*A)-h*(o*d-c*A)+_*(o*b-c*m)),y[13]=P*(m*d-b*A)-h*(n*d-i*A)+_*(n*b-i*m),y[14]=-(P*(o*d-c*A)-l*(n*d-i*A)+_*(n*c-i*o)),y[15]=P*(o*b-c*m)-l*(n*b-i*m)+h*(n*c-i*o),y}}),Wf=It((et,Y)=>{Y.exports=f;function f(y){var z=y[0],P=y[1],n=y[2],i=y[3],a=y[4],l=y[5],o=y[6],c=y[7],s=y[8],h=y[9],m=y[10],b=y[11],x=y[12],_=y[13],A=y[14],d=y[15],k=z*l-P*a,w=z*o-n*a,D=z*c-i*a,E=P*o-n*l,I=P*c-i*l,M=n*c-i*o,p=s*_-h*x,g=s*A-m*x,C=s*d-b*x,S=h*A-m*_,N=h*d-b*_,B=m*d-b*A;return k*B-w*N+D*S+E*C-I*g+M*p}}),V0=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=z[0],i=z[1],a=z[2],l=z[3],o=z[4],c=z[5],s=z[6],h=z[7],m=z[8],b=z[9],x=z[10],_=z[11],A=z[12],d=z[13],k=z[14],w=z[15],D=P[0],E=P[1],I=P[2],M=P[3];return y[0]=D*n+E*o+I*m+M*A,y[1]=D*i+E*c+I*b+M*d,y[2]=D*a+E*s+I*x+M*k,y[3]=D*l+E*h+I*_+M*w,D=P[4],E=P[5],I=P[6],M=P[7],y[4]=D*n+E*o+I*m+M*A,y[5]=D*i+E*c+I*b+M*d,y[6]=D*a+E*s+I*x+M*k,y[7]=D*l+E*h+I*_+M*w,D=P[8],E=P[9],I=P[10],M=P[11],y[8]=D*n+E*o+I*m+M*A,y[9]=D*i+E*c+I*b+M*d,y[10]=D*a+E*s+I*x+M*k,y[11]=D*l+E*h+I*_+M*w,D=P[12],E=P[13],I=P[14],M=P[15],y[12]=D*n+E*o+I*m+M*A,y[13]=D*i+E*c+I*b+M*d,y[14]=D*a+E*s+I*x+M*k,y[15]=D*l+E*h+I*_+M*w,y}}),lm=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=P[0],i=P[1],a=P[2],l,o,c,s,h,m,b,x,_,A,d,k;return z===y?(y[12]=z[0]*n+z[4]*i+z[8]*a+z[12],y[13]=z[1]*n+z[5]*i+z[9]*a+z[13],y[14]=z[2]*n+z[6]*i+z[10]*a+z[14],y[15]=z[3]*n+z[7]*i+z[11]*a+z[15]):(l=z[0],o=z[1],c=z[2],s=z[3],h=z[4],m=z[5],b=z[6],x=z[7],_=z[8],A=z[9],d=z[10],k=z[11],y[0]=l,y[1]=o,y[2]=c,y[3]=s,y[4]=h,y[5]=m,y[6]=b,y[7]=x,y[8]=_,y[9]=A,y[10]=d,y[11]=k,y[12]=l*n+h*i+_*a+z[12],y[13]=o*n+m*i+A*a+z[13],y[14]=c*n+b*i+d*a+z[14],y[15]=s*n+x*i+k*a+z[15]),y}}),Hg=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=P[0],i=P[1],a=P[2];return y[0]=z[0]*n,y[1]=z[1]*n,y[2]=z[2]*n,y[3]=z[3]*n,y[4]=z[4]*i,y[5]=z[5]*i,y[6]=z[6]*i,y[7]=z[7]*i,y[8]=z[8]*a,y[9]=z[9]*a,y[10]=z[10]*a,y[11]=z[11]*a,y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),Y1=It((et,Y)=>{Y.exports=f;function f(y,z,P,n){var i=n[0],a=n[1],l=n[2],o=Math.sqrt(i*i+a*a+l*l),c,s,h,m,b,x,_,A,d,k,w,D,E,I,M,p,g,C,S,N,B,U,V,W;return Math.abs(o)<1e-6?null:(o=1/o,i*=o,a*=o,l*=o,c=Math.sin(P),s=Math.cos(P),h=1-s,m=z[0],b=z[1],x=z[2],_=z[3],A=z[4],d=z[5],k=z[6],w=z[7],D=z[8],E=z[9],I=z[10],M=z[11],p=i*i*h+s,g=a*i*h+l*c,C=l*i*h-a*c,S=i*a*h-l*c,N=a*a*h+s,B=l*a*h+i*c,U=i*l*h+a*c,V=a*l*h-i*c,W=l*l*h+s,y[0]=m*p+A*g+D*C,y[1]=b*p+d*g+E*C,y[2]=x*p+k*g+I*C,y[3]=_*p+w*g+M*C,y[4]=m*S+A*N+D*B,y[5]=b*S+d*N+E*B,y[6]=x*S+k*N+I*B,y[7]=_*S+w*N+M*B,y[8]=m*U+A*V+D*W,y[9]=b*U+d*V+E*W,y[10]=x*U+k*V+I*W,y[11]=_*U+w*V+M*W,z!==y&&(y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y)}}),Np=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=Math.sin(P),i=Math.cos(P),a=z[4],l=z[5],o=z[6],c=z[7],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[4]=a*i+s*n,y[5]=l*i+h*n,y[6]=o*i+m*n,y[7]=c*i+b*n,y[8]=s*i-a*n,y[9]=h*i-l*n,y[10]=m*i-o*n,y[11]=b*i-c*n,y}}),cm=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=Math.sin(P),i=Math.cos(P),a=z[0],l=z[1],o=z[2],c=z[3],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*i-s*n,y[1]=l*i-h*n,y[2]=o*i-m*n,y[3]=c*i-b*n,y[8]=a*n+s*i,y[9]=l*n+h*i,y[10]=o*n+m*i,y[11]=c*n+b*i,y}}),Vg=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=Math.sin(P),i=Math.cos(P),a=z[0],l=z[1],o=z[2],c=z[3],s=z[4],h=z[5],m=z[6],b=z[7];return z!==y&&(y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*i+s*n,y[1]=l*i+h*n,y[2]=o*i+m*n,y[3]=c*i+b*n,y[4]=s*i-a*n,y[5]=h*i-l*n,y[6]=m*i-o*n,y[7]=b*i-c*n,y}}),Xx=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n,i,a,l=P[0],o=P[1],c=P[2],s=Math.sqrt(l*l+o*o+c*c);return Math.abs(s)<1e-6?null:(s=1/s,l*=s,o*=s,c*=s,n=Math.sin(z),i=Math.cos(z),a=1-i,y[0]=l*l*a+i,y[1]=o*l*a+c*n,y[2]=c*l*a-o*n,y[3]=0,y[4]=l*o*a-c*n,y[5]=o*o*a+i,y[6]=c*o*a+l*n,y[7]=0,y[8]=l*c*a+o*n,y[9]=o*c*a-l*n,y[10]=c*c*a+i,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y)}}),e8=It((et,Y)=>{Y.exports=f;function f(y,z,P){var n=z[0],i=z[1],a=z[2],l=z[3],o=n+n,c=i+i,s=a+a,h=n*o,m=n*c,b=n*s,x=i*c,_=i*s,A=a*s,d=l*o,k=l*c,w=l*s;return y[0]=1-(x+A),y[1]=m+w,y[2]=b-k,y[3]=0,y[4]=m-w,y[5]=1-(h+A),y[6]=_+d,y[7]=0,y[8]=b+k,y[9]=_-d,y[10]=1-(h+x),y[11]=0,y[12]=P[0],y[13]=P[1],y[14]=P[2],y[15]=1,y}}),y4=It((et,Y)=>{Y.exports=f;function f(y,z){return y[0]=z[0],y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=z[1],y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=z[2],y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),_4=It((et,Y)=>{Y.exports=f;function f(y,z){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=z[0],y[13]=z[1],y[14]=z[2],y[15]=1,y}}),x4=It((et,Y)=>{Y.exports=f;function f(y,z){var P=Math.sin(z),n=Math.cos(z);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=n,y[6]=P,y[7]=0,y[8]=0,y[9]=-P,y[10]=n,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),r8=It((et,Y)=>{Y.exports=f;function f(y,z){var P=Math.sin(z),n=Math.cos(z);return y[0]=n,y[1]=0,y[2]=-P,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=P,y[9]=0,y[10]=n,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),n8=It((et,Y)=>{Y.exports=f;function f(y,z){var P=Math.sin(z),n=Math.cos(z);return y[0]=n,y[1]=P,y[2]=0,y[3]=0,y[4]=-P,y[5]=n,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),i8=It((et,Y)=>{Y.exports=f;function f(y,z){var P=z[0],n=z[1],i=z[2],a=z[3],l=P+P,o=n+n,c=i+i,s=P*l,h=n*l,m=n*o,b=i*l,x=i*o,_=i*c,A=a*l,d=a*o,k=a*c;return y[0]=1-m-_,y[1]=h+k,y[2]=b-d,y[3]=0,y[4]=h-k,y[5]=1-s-_,y[6]=x+A,y[7]=0,y[8]=b+d,y[9]=x-A,y[10]=1-s-m,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),a8=It((et,Y)=>{Y.exports=f;function f(y,z,P,n,i,a,l){var o=1/(P-z),c=1/(i-n),s=1/(a-l);return y[0]=a*2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a*2*c,y[6]=0,y[7]=0,y[8]=(P+z)*o,y[9]=(i+n)*c,y[10]=(l+a)*s,y[11]=-1,y[12]=0,y[13]=0,y[14]=l*a*2*s,y[15]=0,y}}),o8=It((et,Y)=>{Y.exports=f;function f(y,z,P,n,i){var a=1/Math.tan(z/2),l=1/(n-i);return y[0]=a/P,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=(i+n)*l,y[11]=-1,y[12]=0,y[13]=0,y[14]=2*i*n*l,y[15]=0,y}}),s8=It((et,Y)=>{Y.exports=f;function f(y,z,P,n){var i=Math.tan(z.upDegrees*Math.PI/180),a=Math.tan(z.downDegrees*Math.PI/180),l=Math.tan(z.leftDegrees*Math.PI/180),o=Math.tan(z.rightDegrees*Math.PI/180),c=2/(l+o),s=2/(i+a);return y[0]=c,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=s,y[6]=0,y[7]=0,y[8]=-((l-o)*c*.5),y[9]=(i-a)*s*.5,y[10]=n/(P-n),y[11]=-1,y[12]=0,y[13]=0,y[14]=n*P/(P-n),y[15]=0,y}}),iw=It((et,Y)=>{Y.exports=f;function f(y,z,P,n,i,a,l){var o=1/(z-P),c=1/(n-i),s=1/(a-l);return y[0]=-2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*c,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*s,y[11]=0,y[12]=(z+P)*o,y[13]=(i+n)*c,y[14]=(l+a)*s,y[15]=1,y}}),l8=It((et,Y)=>{var f=Ac();Y.exports=y;function y(z,P,n,i){var a,l,o,c,s,h,m,b,x,_,A=P[0],d=P[1],k=P[2],w=i[0],D=i[1],E=i[2],I=n[0],M=n[1],p=n[2];return Math.abs(A-I)<1e-6&&Math.abs(d-M)<1e-6&&Math.abs(k-p)<1e-6?f(z):(m=A-I,b=d-M,x=k-p,_=1/Math.sqrt(m*m+b*b+x*x),m*=_,b*=_,x*=_,a=D*x-E*b,l=E*m-w*x,o=w*b-D*m,_=Math.sqrt(a*a+l*l+o*o),_?(_=1/_,a*=_,l*=_,o*=_):(a=0,l=0,o=0),c=b*o-x*l,s=x*a-m*o,h=m*l-b*a,_=Math.sqrt(c*c+s*s+h*h),_?(_=1/_,c*=_,s*=_,h*=_):(c=0,s=0,h=0),z[0]=a,z[1]=c,z[2]=m,z[3]=0,z[4]=l,z[5]=s,z[6]=b,z[7]=0,z[8]=o,z[9]=h,z[10]=x,z[11]=0,z[12]=-(a*A+l*d+o*k),z[13]=-(c*A+s*d+h*k),z[14]=-(m*A+b*d+x*k),z[15]=1,z)}}),c8=It((et,Y)=>{Y.exports=f;function f(y){return"mat4("+y[0]+", "+y[1]+", "+y[2]+", "+y[3]+", "+y[4]+", "+y[5]+", "+y[6]+", "+y[7]+", "+y[8]+", "+y[9]+", "+y[10]+", "+y[11]+", "+y[12]+", "+y[13]+", "+y[14]+", "+y[15]+")"}}),b4=It((et,Y)=>{Y.exports={create:Jo(),clone:Ss(),copy:Us(),identity:Ac(),transpose:Ou(),invert:Bu(),adjoint:dp(),determinant:Wf(),multiply:V0(),translate:lm(),scale:Hg(),rotate:Y1(),rotateX:Np(),rotateY:cm(),rotateZ:Vg(),fromRotation:Xx(),fromRotationTranslation:e8(),fromScaling:y4(),fromTranslation:_4(),fromXRotation:x4(),fromYRotation:r8(),fromZRotation:n8(),fromQuat:i8(),frustum:a8(),perspective:o8(),perspectiveFromFieldOfView:s8(),ortho:iw(),lookAt:l8(),str:c8()}}),aw=It(et=>{var Y=b4();et.init2dArray=function(f,y){for(var z=new Array(f),P=0;P{var f=Br(),y=es(),z=aw(),P=b4();function n(A){var d;if(typeof A=="string"){if(d=document.getElementById(A),d===null)throw new Error("No DOM element with id '"+A+"' exists on the page.");return d}else if(A==null)throw new Error("DOM element provided is null or undefined");return A}function i(A){var d=f.select(A);return d.node()instanceof HTMLElement&&d.size()&&d.classed("js-plotly-plot")}function a(A){var d=A&&A.parentNode;d&&d.removeChild(A)}function l(A,d){o("global",A,d)}function o(A,d,k){var w="plotly.js-style-"+A,D=document.getElementById(w);if(!(D&&D.matches(".no-inline-styles"))){D||(D=document.createElement("style"),D.setAttribute("id",w),D.appendChild(document.createTextNode("")),document.head.appendChild(D));var E=D.sheet;E?E.insertRule?E.insertRule(d+"{"+k+"}",0):E.addRule?E.addRule(d,k,0):y.warn("addStyleRule failed"):y.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function c(A){var d="plotly.js-style-"+A,k=document.getElementById(d);k&&a(k)}function s(A,d,k,w,D,E){var I=w.split(":"),M=D.split(":"),p="data-btn-style-event-added";E||(E=document),E.querySelectorAll(A).forEach(function(g){g.getAttribute(p)||(g.addEventListener("mouseenter",function(){var C=this.querySelector(k);C&&(C.style[I[0]]=I[1])}),g.addEventListener("mouseleave",function(){var C=this.querySelector(k);C&&(d&&this.matches(d)?C.style[I[0]]=I[1]:C.style[M[0]]=M[1])}),g.setAttribute(p,!0))})}function h(A){var d=b(A),k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return d.forEach(function(w){var D=m(w);if(D){var E=z.convertCssMatrix(D);k=P.multiply(k,k,E)}}),k}function m(A){var d=window.getComputedStyle(A,null),k=d.getPropertyValue("-webkit-transform")||d.getPropertyValue("-moz-transform")||d.getPropertyValue("-ms-transform")||d.getPropertyValue("-o-transform")||d.getPropertyValue("transform");return k==="none"?null:k.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(w){return+w})}function b(A){for(var d=[];x(A);)d.push(A),A=A.parentNode,typeof ShadowRoot=="function"&&A instanceof ShadowRoot&&(A=A.host);return d}function x(A){return A&&(A instanceof Element||A instanceof HTMLElement)}function _(A,d){return A&&d&&A.top===d.top&&A.left===d.left&&A.right===d.right&&A.bottom===d.bottom}Y.exports={getGraphDiv:n,isPlotDiv:i,removeElement:a,addStyleRule:l,addRelatedStyleRule:o,deleteRelatedStyleRule:c,setStyleOnHover:s,getFullTransformMatrix:h,getElementTransformMatrix:m,getElementAndAncestors:b,equalDomRects:_}}),Ul=It((et,Y)=>{Y.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),sh=It((et,Y)=>{var f=Yn().extendFlat,y=Cn(),z={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},P={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},n=z.flags.slice().concat(["fullReplot"]),i=P.flags.slice().concat("layoutReplot");Y.exports={traces:z,layout:P,traceFlags:function(){return a(n)},layoutFlags:function(){return a(i)},update:function(c,s){var h=s.editType;if(h&&h!=="none")for(var m=h.split("+"),b=0;b{et.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},et.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),ow=It((et,Y)=>{Y.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),nu=It(et=>{var{DATE_FORMAT_LINK:Y,FORMAT_LINK:f}=ow(),y=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function z({supportOther:P}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(P?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,f,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,Y,"for details on the date formatting syntax.",y].join(" ")}et.templateFormatStringDescription=z,et.hovertemplateAttrs=({editType:P="none",arrayOk:n}={},i={})=>we({valType:"string",dflt:"",editType:P},n!==!1?{arrayOk:!0}:{}),et.texttemplateAttrs=({editType:P="calc",arrayOk:n}={},i={})=>we({valType:"string",dflt:"",editType:P},n!==!1?{arrayOk:!0}:{}),et.shapeTexttemplateAttrs=({editType:P="arraydraw",newshape:n}={},i={})=>({valType:"string",dflt:"",editType:P}),et.templatefallbackAttrs=({editType:P="none"}={})=>({valType:"any",dflt:"-",editType:P})}),w_=It((et,Y)=>{function f(k,w){return w?w.d2l(k):k}function y(k,w){return w?w.l2d(k):k}function z(k){return k.x0}function P(k){return k.x1}function n(k){return k.y0}function i(k){return k.y1}function a(k){return k.x0shift||0}function l(k){return k.x1shift||0}function o(k){return k.y0shift||0}function c(k){return k.y1shift||0}function s(k,w){return f(k.x1,w)+l(k)-f(k.x0,w)-a(k)}function h(k,w,D){return f(k.y1,D)+c(k)-f(k.y0,D)-o(k)}function m(k,w){return Math.abs(s(k,w))}function b(k,w,D){return Math.abs(h(k,w,D))}function x(k,w,D){return k.type!=="line"?void 0:Math.sqrt(Math.pow(s(k,w),2)+Math.pow(h(k,w,D),2))}function _(k,w){return y((f(k.x1,w)+l(k)+f(k.x0,w)+a(k))/2,w)}function A(k,w,D){return y((f(k.y1,D)+c(k)+f(k.y0,D)+o(k))/2,D)}function d(k,w,D){return k.type!=="line"?void 0:h(k,w,D)/s(k,w)}Y.exports={x0:z,x1:P,y0:n,y1:i,slope:d,dx:s,dy:h,width:m,height:b,length:x,xcenter:_,ycenter:A}}),w4=It((et,Y)=>{var f=sh().overrideAll,y=xa(),z=hi(),P=qf().dash,n=Yn().extendFlat,{shapeTexttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=w_();Y.exports=f({newshape:{visible:n({},y.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:n({},y.legend,{}),legendgroup:n({},y.legendgroup,{}),legendgrouptitle:{text:n({},y.legendgrouptitle.text,{}),font:z({})},legendrank:n({},y.legendrank,{}),legendwidth:n({},y.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:n({},P,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:n({},y.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:i({newshape:!0},{keys:Object.keys(l)}),texttemplatefallback:a({editType:"arraydraw"}),font:z({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),X1=It((et,Y)=>{var f=qf().dash,y=Yn().extendFlat;Y.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:y({},f,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Jx=It((et,Y)=>{Y.exports=function(f){var y=f.editType;return{t:{valType:"number",dflt:0,editType:y},r:{valType:"number",dflt:0,editType:y},b:{valType:"number",dflt:0,editType:y},l:{valType:"number",dflt:0,editType:y},editType:y}}}),k_=It((et,Y)=>{var f=hi(),y=Ul(),z=Sn(),P=w4(),n=X1(),i=Jx(),a=Yn().extendFlat,l=f({editType:"calc"});l.family.dflt='"Open Sans", verdana, arial, sans-serif',l.size.dflt=12,l.color.dflt=z.defaultLine,Y.exports={font:l,title:{text:{valType:"string",editType:"layoutstyle"},font:f({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:f({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:a(i({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:z.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:z.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:z.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:P.newshape,activeshape:P.activeshape,newselection:n.newselection,activeselection:n.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:a({},y.transition,{editType:"none"})}}),u8=It(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var et=document.createElement("style");et.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",et.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(et)}})()}),ls=It(et=>{var Y=es(),f=Io(),y=Ys(),z=Cn(),P=W0().addStyleRule,n=Yn(),i=xa(),a=k_(),l=n.extendFlat,o=n.extendDeepAll;et.modules={},et.allCategories={},et.allTypes=[],et.subplotsRegistry={},et.componentsRegistry={},et.layoutArrayContainers=[],et.layoutArrayRegexes=[],et.traceLayoutAttributes={},et.localeRegistry={},et.apiMethodRegistry={},et.collectableSubplotTypes=null,et.register=function(k){if(et.collectableSubplotTypes=null,k)k&&!Array.isArray(k)&&(k=[k]);else throw new Error("No argument passed to Plotly.register.");for(var w=0;w{var Y=on().timeFormat,f=Sr(),y=es(),z=Bi().mod,P=Dr(),n=P.BADNUM,i=P.ONEDAY,a=P.ONEHOUR,l=P.ONEMIN,o=P.ONESEC,c=P.EPOCHJD,s=ls(),h=on().utcFormat,m=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,b=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=new Date().getFullYear()-70;function _(V){return V&&s.componentsRegistry.calendars&&typeof V=="string"&&V!=="gregorian"}et.dateTick0=function(V,W){var F=A(V,!!W);if(W<2)return F;var H=et.dateTime2ms(F,V);return H+=i*(W-1),et.ms2DateTime(H,0,V)};function A(V,W){return _(V)?W?s.getComponentMethod("calendars","CANONICAL_SUNDAY")[V]:s.getComponentMethod("calendars","CANONICAL_TICK")[V]:W?"2000-01-02":"2000-01-01"}et.dfltRange=function(V){return _(V)?s.getComponentMethod("calendars","DFLTRANGE")[V]:["2000-01-01","2001-01-01"]},et.isJSDate=function(V){return typeof V=="object"&&V!==null&&typeof V.getTime=="function"};var d,k;et.dateTime2ms=function(V,W){if(et.isJSDate(V)){var F=V.getTimezoneOffset()*l,H=(V.getUTCMinutes()-V.getMinutes())*l+(V.getUTCSeconds()-V.getSeconds())*o+(V.getUTCMilliseconds()-V.getMilliseconds());if(H){var q=3*l;F=F-q/2+z(H-F+q/2,q)}return V=Number(V)-F,V>=d&&V<=k?V:n}if(typeof V!="string"&&typeof V!="number")return n;V=String(V);var G=_(W),tt=V.charAt(0);G&&(tt==="G"||tt==="g")&&(V=V.substr(1),W="");var ht=G&&W.substr(0,7)==="chinese",bt=V.match(ht?b:m);if(!bt)return n;var vt=bt[1],ut=bt[3]||"1",rt=Number(bt[5]||1),gt=Number(bt[7]||0),it=Number(bt[9]||0),st=Number(bt[11]||0);if(G){if(vt.length===2)return n;vt=Number(vt);var xt;try{var ot=s.getComponentMethod("calendars","getCal")(W);if(ht){var J=ut.charAt(ut.length-1)==="i";ut=parseInt(ut,10),xt=ot.newDate(vt,ot.toMonthIndex(vt,ut,J),rt)}else xt=ot.newDate(vt,Number(ut),rt)}catch{return n}return xt?(xt.toJD()-c)*i+gt*a+it*l+st*o:n}vt.length===2?vt=(Number(vt)+2e3-x)%100+x:vt=Number(vt),ut-=1;var mt=new Date(Date.UTC(2e3,ut,rt,gt,it));return mt.setUTCFullYear(vt),mt.getUTCMonth()!==ut||mt.getUTCDate()!==rt?n:mt.getTime()+st*o},d=et.MIN_MS=et.dateTime2ms("-9999"),k=et.MAX_MS=et.dateTime2ms("9999-12-31 23:59:59.9999"),et.isDateTime=function(V,W){return et.dateTime2ms(V,W)!==n};function w(V,W){return String(V+Math.pow(10,W)).substr(1)}var D=90*i,E=3*a,I=5*l;et.ms2DateTime=function(V,W,F){if(typeof V!="number"||!(V>=d&&V<=k))return n;W||(W=0);var H=Math.floor(z(V+.05,1)*10),q=Math.round(V-H/10),G,tt,ht,bt,vt,ut;if(_(F)){var rt=Math.floor(q/i)+c,gt=Math.floor(z(V,i));try{G=s.getComponentMethod("calendars","getCal")(F).fromJD(rt).formatDate("yyyy-mm-dd")}catch{G=h("G%Y-%m-%d")(new Date(q))}if(G.charAt(0)==="-")for(;G.length<11;)G="-0"+G.substr(1);else for(;G.length<10;)G="0"+G;tt=W=d+i&&V<=k-i))return n;var W=Math.floor(z(V+.05,1)*10),F=new Date(Math.round(V-W/10)),H=Y("%Y-%m-%d")(F),q=F.getHours(),G=F.getMinutes(),tt=F.getSeconds(),ht=F.getUTCMilliseconds()*10+W;return M(H,q,G,tt,ht)};function M(V,W,F,H,q){if((W||F||H||q)&&(V+=" "+w(W,2)+":"+w(F,2),(H||q)&&(V+=":"+w(H,2),q))){for(var G=4;q%10===0;)G-=1,q/=10;V+="."+w(q,G)}return V}et.cleanDate=function(V,W,F){if(V===n)return W;if(et.isJSDate(V)||typeof V=="number"&&isFinite(V)){if(_(F))return y.error("JS Dates and milliseconds are incompatible with world calendars",V),W;if(V=et.ms2DateTimeLocal(+V),!V&&W!==void 0)return W}else if(!et.isDateTime(V,F))return y.error("unrecognized date",V),W;return V};var p=/%\d?f/g,g=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function S(V,W,F,H){V=V.replace(p,function(G){var tt=Math.min(+G.charAt(1)||6,6),ht=(W/1e3%1+2).toFixed(tt).substr(2).replace(/0+$/,"")||"0";return ht});var q=new Date(Math.floor(W+.05));if(V=V.replace(g,function(){return C[F("%q")(q)]}),_(H))try{V=s.getComponentMethod("calendars","worldCalFmt")(V,W,H)}catch{return"Invalid"}return F(V)(q)}var N=[59,59.9,59.99,59.999,59.9999];function B(V,W){var F=z(V+.05,i),H=w(Math.floor(F/a),2)+":"+w(z(Math.floor(F/l),60),2);if(W!=="M"){f(W)||(W=0);var q=Math.min(z(V/o,60),N[W]),G=(100+q).toFixed(W).substr(1);W>0&&(G=G.replace(/0+$/,"").replace(/[\.]$/,"")),H+=":"+G}return H}et.formatDate=function(V,W,F,H,q,G){if(q=_(q)&&q,!W)if(F==="y")W=G.year;else if(F==="m")W=G.month;else if(F==="d")W=G.dayMonth+` `+G.year;else return B(V,F)+` -`+S(G.dayMonthYear,V,H,q);return S(W,V,H,q)};var U=3*i;et.incrementMonth=function(V,W,F){F=_(F)&&F;var H=z(V,i);if(V=Math.round(V-H),F)try{var q=Math.round(V/i)+c,G=s.getComponentMethod("calendars","getCal")(F),tt=G.fromJD(q);return W%12?G.add(tt,W,"m"):G.add(tt,W/12,"y"),(tt.toJD()-c)*i+H}catch{y.error("invalid ms "+V+" in calendar "+F)}var ht=new Date(V+U);return ht.setUTCMonth(ht.getUTCMonth()+W)+H-U},et.findExactDates=function(V,W){for(var F=0,H=0,q=0,G=0,tt,ht,bt=_(W)&&s.getComponentMethod("calendars","getCal")(W),vt=0;vt{Y.exports=function(f){return f}}),sw=It(et=>{var Y=Sr(),f=es(),y=T_(),z=Dr().BADNUM,P=1e-9;et.findBin=function(o,c,s){if(Y(c.start))return s?Math.ceil((o-c.start)/c.size-P)-1:Math.floor((o-c.start)/c.size+P);var h=0,m=c.length,b=0,x=m>1?(c[m-1]-c[0])/(m-1):1,_,A;for(x>=0?A=s?n:i:A=s?l:a,o+=x*P*(s?-1:1)*(x>=0?1:-1);h90&&f.log("Long binary search..."),h-1};function n(o,c){return oc}function l(o,c){return o>=c}et.sorterAsc=function(o,c){return o-c},et.sorterDes=function(o,c){return c-o},et.distinctVals=function(o){var c=o.slice();c.sort(et.sorterAsc);var s;for(s=c.length-1;s>-1&&c[s]===z;s--);for(var h=c[s]-c[0]||1,m=h/(s||1)/1e4,b=[],x,_=0;_<=s;_++){var A=c[_],d=A-x;x===void 0?(b.push(A),x=A):d>m&&(h=Math.min(h,d),b.push(A),x=A)}return{vals:b,minDiff:h}},et.roundUp=function(o,c,s){for(var h=0,m=c.length-1,b,x=0,_=s?0:1,A=s?1:0,d=s?Math.ceil:Math.floor;h0&&(h=1),s&&h)return o.sort(c)}return h?o:o.reverse()},et.findIndexOfMin=function(o,c){c=c||y;for(var s=1/0,h,m=0;m{Y.exports=function(f){return Object.keys(f).sort()}}),d8=It(et=>{var Y=Sr(),f=Xn().isArrayOrTypedArray;et.aggNums=function(y,z,P,n){var i,a;if((!n||n>P.length)&&(n=P.length),Y(z)||(z=!1),f(P[0])){for(a=new Array(n),i=0;iy.length-1)return y[y.length-1];var P=z%1;return P*y[Math.ceil(z)]+(1-P)*y[Math.floor(z)]}}),f8=It((et,Y)=>{var f=Bi(),y=f.mod,z=f.modHalf,P=Math.PI,n=2*P;function i(A){return A/180*P}function a(A){return A/P*180}function l(A){return Math.abs(A[1]-A[0])>n-1e-14}function o(A,d){return z(d-A,n)}function c(A,d){return Math.abs(o(A,d))}function s(A,d){if(l(d))return!0;var k,w;d[0]w&&(w+=n);var D=y(A,n),E=D+n;return D>=k&&D<=w||E>=k&&E<=w}function h(A,d,k,w){if(!s(d,w))return!1;var D,E;return k[0]=D&&A<=E}function m(A,d,k,w,D,E,I){D=D||0,E=E||0;var M=l([k,w]),p,g,C,S,N;M?(p=0,g=P,C=n):k{et.isLeftAnchor=function(Y){return Y.xanchor==="left"||Y.xanchor==="auto"&&Y.x<=1/3},et.isCenterAnchor=function(Y){return Y.xanchor==="center"||Y.xanchor==="auto"&&Y.x>1/3&&Y.x<2/3},et.isRightAnchor=function(Y){return Y.xanchor==="right"||Y.xanchor==="auto"&&Y.x>=2/3},et.isTopAnchor=function(Y){return Y.yanchor==="top"||Y.yanchor==="auto"&&Y.y>=2/3},et.isMiddleAnchor=function(Y){return Y.yanchor==="middle"||Y.yanchor==="auto"&&Y.y>1/3&&Y.y<2/3},et.isBottomAnchor=function(Y){return Y.yanchor==="bottom"||Y.yanchor==="auto"&&Y.y<=1/3}}),m8=It(et=>{var Y=Bi().mod;et.segmentsIntersect=f;function f(i,a,l,o,c,s,h,m){var b=l-i,x=c-i,_=h-c,A=o-a,d=s-a,k=m-s,w=b*k-_*A;if(w===0)return null;var D=(x*k-_*d)/w,E=(x*A-b*d)/w;return E<0||E>1||D<0||D>1?null:{x:i+b*D,y:a+A*D}}et.segmentDistance=function(i,a,l,o,c,s,h,m){if(f(i,a,l,o,c,s,h,m))return 0;var b=l-i,x=o-a,_=h-c,A=m-s,d=b*b+x*x,k=_*_+A*A,w=Math.min(y(b,x,d,c-i,s-a),y(b,x,d,h-i,m-a),y(_,A,k,i-c,a-s),y(_,A,k,l-c,o-s));return Math.sqrt(w)};function y(i,a,l,o,c){var s=o*i+c*a;if(s<0)return o*o+c*c;if(s>l){var h=o-i,m=c-a;return h*h+m*m}else{var b=o*a-c*i;return b*b/l}}var z,P,n;et.getTextLocation=function(i,a,l,o){if((i!==P||o!==n)&&(z={},P=i,n=o),z[l])return z[l];var c=i.getPointAtLength(Y(l-o/2,a)),s=i.getPointAtLength(Y(l+o/2,a)),h=Math.atan((s.y-c.y)/(s.x-c.x)),m=i.getPointAtLength(Y(l,a)),b=(m.x*4+c.x+s.x)/6,x=(m.y*4+c.y+s.y)/6,_={x:b,y:x,theta:h};return z[l]=_,_},et.clearLocationCache=function(){P=null},et.getVisibleSegment=function(i,a,l){var o=a.left,c=a.right,s=a.top,h=a.bottom,m=0,b=i.getTotalLength(),x=b,_,A;function d(w){var D=i.getPointAtLength(w);w===0?_=D:w===b&&(A=D);var E=D.xc?D.x-c:0,I=D.yh?D.y-h:0;return Math.sqrt(E*E+I*I)}for(var k=d(m);k;){if(m+=k+l,m>x)return;k=d(m)}for(k=d(x);k;){if(x-=k+l,m>x)return;k=d(x)}return{min:m,max:x,len:x-m,total:b,isClosed:m===0&&x===b&&Math.abs(_.x-A.x)<.1&&Math.abs(_.y-A.y)<.1}},et.findPointOnPath=function(i,a,l,o){o=o||{};for(var c=o.pathLength||i.getTotalLength(),s=o.tolerance||.001,h=o.iterationLimit||30,m=i.getPointAtLength(0)[l]>i.getPointAtLength(c)[l]?-1:1,b=0,x=0,_=c,A,d,k;b0?_=A:x=A,b++}return d}}),lw=It(et=>{var Y={};et.throttle=function(y,z,P){var n=Y[y],i=Date.now();if(!n){for(var a in Y)Y[a].tsn.ts+z){l();return}n.timer=setTimeout(function(){l(),n.timer=null},z)},et.done=function(y){var z=Y[y];return!z||!z.timer?Promise.resolve():new Promise(function(P){var n=z.onDone;z.onDone=function(){n&&n(),P(),z.onDone=null}})},et.clear=function(y){if(y)f(Y[y]),delete Y[y];else for(var z in Y)et.clear(z)};function f(y){y&&y.timer!==null&&(clearTimeout(y.timer),y.timer=null)}}),cw=It((et,Y)=>{Y.exports=function(f){f._responsiveChartHandler&&(window.removeEventListener("resize",f._responsiveChartHandler),delete f._responsiveChartHandler)}}),S_=It((et,Y)=>{Y.exports=P,Y.exports.isMobile=P,Y.exports.default=P;var f=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,y=/CrOS/,z=/android|ipad|playbook|silk/i;function P(n){n||(n={});let i=n.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;let a=f.test(i)&&!y.test(i)||!!n.tablet&&z.test(i);return!a&&n.tablet&&n.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(a=!0),a}}),k4=It((et,Y)=>{var f=Sr(),y=S_();Y.exports=function(P){var n;if(P&&P.hasOwnProperty("userAgent")?n=P.userAgent:n=z(),typeof n!="string")return!0;var i=y({ua:{headers:{"user-agent":n}},tablet:!0,featureDetect:!1});if(!i)for(var a=n.split(" "),l=1;l-1;c--){var s=a[c];if(s.substr(0,8)==="Version/"){var h=s.substr(8).split(".")[0];if(f(h)&&(h=+h),h>=13)return!0}}}return i};function z(){var P;return typeof navigator<"u"&&(P=navigator.userAgent),P&&P.headers&&typeof P.headers["user-agent"]=="string"&&(P=P.headers["user-agent"]),P}}),T4=It((et,Y)=>{var f=Br();Y.exports=function(y,z,P){var n=y.selectAll("g."+P.replace(/\s/g,".")).data(z,function(a){return a[0].trace.uid});n.exit().remove(),n.enter().append("g").attr("class",P),n.order();var i=y.classed("rangeplot")?"nodeRangePlot3":"node3";return n.each(function(a){a[0][i]=f.select(this)}),n}}),C_=It((et,Y)=>{var f=ls();Y.exports=function(y,z){for(var P=y._context.locale,n=0;n<2;n++){for(var i=y._context.locales,a=0;a<2;a++){var l=(i[P]||{}).dictionary;if(l){var o=l[z];if(o)return o}i=f.localeRegistry}var c=P.split("-")[0];if(c===P)break;P=c}return z}}),$u=It((et,Y)=>{Y.exports=function(f){for(var y={},z=[],P=0,n=0;n{Y.exports=function(P){for(var n=z(P)?y:f,i=[],a=0;a{Y.exports=function(f,y){if(!y)return f;var z=1/Math.abs(y),P=z>1?(z*f+z*y)/z:f+y,n=String(P).length;if(n>16){var i=String(y).length,a=String(f).length;if(n>=a+i){var l=parseFloat(P).toPrecision(12);l.indexOf("e+")===-1&&(P=+l)}}return P}}),J1=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;Y.exports=function(P){return typeof P=="string"&&(P=P.replace(z,"")),f(P)?Number(P):y}}),jn=It((et,Y)=>{var f=Br(),y=on().utcFormat,z=pr().format,P=Sr(),n=Dr(),i=n.FP_SAFE,a=-i,l=n.BADNUM,o=Y.exports={};o.adjustFormat=function(ot){return!ot||/^\d[.]\df/.test(ot)||/[.]\d%/.test(ot)?ot:ot==="0.f"?"~f":/^\d%/.test(ot)?"~%":/^\ds/.test(ot)?"~s":!/^[~,.0$]/.test(ot)&&/[&fps]/.test(ot)?"~"+ot:ot};var c={};o.warnBadFormat=function(ot){var J=String(ot);c[J]||(c[J]=1,o.warn('encountered bad format: "'+J+'"'))},o.noFormat=function(ot){return String(ot)},o.numberFormat=function(ot){var J;try{J=z(o.adjustFormat(ot))}catch{return o.warnBadFormat(ot),o.noFormat}return J},o.nestedProperty=_i(),o.keyedContainer=ta(),o.relativeAttr=va(),o.isPlainObject=Cn(),o.toLogRange=_a(),o.relinkPrivateKeys=qi();var s=Xn();o.isArrayBuffer=s.isArrayBuffer,o.isTypedArray=s.isTypedArray,o.isArrayOrTypedArray=s.isArrayOrTypedArray,o.isArray1D=s.isArray1D,o.ensureArray=s.ensureArray,o.concat=s.concat,o.maxRowLength=s.maxRowLength,o.minRowLength=s.minRowLength;var h=Bi();o.mod=h.mod,o.modHalf=h.modHalf;var m=qa();o.valObjectMeta=m.valObjectMeta,o.coerce=m.coerce,o.coerce2=m.coerce2,o.coerceFont=m.coerceFont,o.coercePattern=m.coercePattern,o.coerceHoverinfo=m.coerceHoverinfo,o.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,o.validate=m.validate;var b=h8();o.dateTime2ms=b.dateTime2ms,o.isDateTime=b.isDateTime,o.ms2DateTime=b.ms2DateTime,o.ms2DateTimeLocal=b.ms2DateTimeLocal,o.cleanDate=b.cleanDate,o.isJSDate=b.isJSDate,o.formatDate=b.formatDate,o.incrementMonth=b.incrementMonth,o.dateTick0=b.dateTick0,o.dfltRange=b.dfltRange,o.findExactDates=b.findExactDates,o.MIN_MS=b.MIN_MS,o.MAX_MS=b.MAX_MS;var x=sw();o.findBin=x.findBin,o.sorterAsc=x.sorterAsc,o.sorterDes=x.sorterDes,o.distinctVals=x.distinctVals,o.roundUp=x.roundUp,o.sort=x.sort,o.findIndexOfMin=x.findIndexOfMin,o.sortObjectKeys=Xm();var _=d8();o.aggNums=_.aggNums,o.len=_.len,o.mean=_.mean,o.geometricMean=_.geometricMean,o.median=_.median,o.midRange=_.midRange,o.variance=_.variance,o.stdev=_.stdev,o.interp=_.interp;var A=aw();o.init2dArray=A.init2dArray,o.transposeRagged=A.transposeRagged,o.dot=A.dot,o.translationMatrix=A.translationMatrix,o.rotationMatrix=A.rotationMatrix,o.rotationXYMatrix=A.rotationXYMatrix,o.apply3DTransform=A.apply3DTransform,o.apply2DTransform=A.apply2DTransform,o.apply2DTransform2=A.apply2DTransform2,o.convertCssMatrix=A.convertCssMatrix,o.inverseTransformMatrix=A.inverseTransformMatrix;var d=f8();o.deg2rad=d.deg2rad,o.rad2deg=d.rad2deg,o.angleDelta=d.angleDelta,o.angleDist=d.angleDist,o.isFullCircle=d.isFullCircle,o.isAngleInsideSector=d.isAngleInsideSector,o.isPtInsideSector=d.isPtInsideSector,o.pathArc=d.pathArc,o.pathSector=d.pathSector,o.pathAnnulus=d.pathAnnulus;var k=p8();o.isLeftAnchor=k.isLeftAnchor,o.isCenterAnchor=k.isCenterAnchor,o.isRightAnchor=k.isRightAnchor,o.isTopAnchor=k.isTopAnchor,o.isMiddleAnchor=k.isMiddleAnchor,o.isBottomAnchor=k.isBottomAnchor;var w=m8();o.segmentsIntersect=w.segmentsIntersect,o.segmentDistance=w.segmentDistance,o.getTextLocation=w.getTextLocation,o.clearLocationCache=w.clearLocationCache,o.getVisibleSegment=w.getVisibleSegment,o.findPointOnPath=w.findPointOnPath;var D=Yn();o.extendFlat=D.extendFlat,o.extendDeep=D.extendDeep,o.extendDeepAll=D.extendDeepAll,o.extendDeepNoArrays=D.extendDeepNoArrays;var E=es();o.log=E.log,o.warn=E.warn,o.error=E.error;var I=Ha();o.counterRegex=I.counter;var M=lw();o.throttle=M.throttle,o.throttleDone=M.done,o.clearThrottle=M.clear;var p=W0();o.getGraphDiv=p.getGraphDiv,o.isPlotDiv=p.isPlotDiv,o.removeElement=p.removeElement,o.addStyleRule=p.addStyleRule,o.addRelatedStyleRule=p.addRelatedStyleRule,o.deleteRelatedStyleRule=p.deleteRelatedStyleRule,o.setStyleOnHover=p.setStyleOnHover,o.getFullTransformMatrix=p.getFullTransformMatrix,o.getElementTransformMatrix=p.getElementTransformMatrix,o.getElementAndAncestors=p.getElementAndAncestors,o.equalDomRects=p.equalDomRects,o.clearResponsive=cw(),o.preserveDrawingBuffer=k4(),o.makeTraceGroups=T4(),o._=C_(),o.notifier=Wo(),o.filterUnique=$u(),o.filterVisible=Bd(),o.pushUnique=Ys(),o.increment=Jx(),o.cleanNumber=J1(),o.ensureNumber=function(ot){return P(ot)?(ot=Number(ot),ot>i||ot=J?!1:P(ot)&&ot>=0&&ot%1===0},o.noop=Po(),o.identity=T_(),o.repeat=function(ot,J){for(var mt=new Array(J),dt=0;dtmt?Math.max(mt,Math.min(J,ot)):Math.max(J,Math.min(mt,ot))},o.bBoxIntersect=function(ot,J,mt){return mt=mt||0,ot.left<=J.right+mt&&J.left<=ot.right+mt&&ot.top<=J.bottom+mt&&J.top<=ot.bottom+mt},o.simpleMap=function(ot,J,mt,dt,Ct){for(var Rt=ot.length,Bt=new Array(Rt),Zt=0;Zt=Math.pow(2,mt)?Ct>10?(o.warn("randstr failed uniqueness"),Bt):ot(J,mt,dt,(Ct||0)+1):Bt},o.OptionControl=function(ot,J){ot||(ot={}),J||(J="opt");var mt={};return mt.optionList=[],mt._newoption=function(dt){dt[J]=ot,mt[dt.name]=dt,mt.optionList.push(dt)},mt["_"+J]=ot,mt},o.smooth=function(ot,J){if(J=Math.round(J)||0,J<2)return ot;var mt=ot.length,dt=2*mt,Ct=2*J-1,Rt=new Array(Ct),Bt=new Array(mt),Zt,Gt,ee,xe;for(Zt=0;Zt=dt&&(ee-=dt*Math.floor(ee/dt)),ee<0?ee=-1-ee:ee>=mt&&(ee=dt-1-ee),xe+=ot[ee]*Rt[Gt];Bt[Zt]=xe}return Bt},o.syncOrAsync=function(ot,J,mt){var dt,Ct;function Rt(){return o.syncOrAsync(ot,J,mt)}for(;ot.length;)if(Ct=ot.splice(0,1)[0],dt=Ct(J),dt&&dt.then)return dt.then(Rt);return mt&&mt(J)},o.stripTrailingSlash=function(ot){return ot.substr(-1)==="/"?ot.substr(0,ot.length-1):ot},o.noneOrAll=function(ot,J,mt){if(ot){var dt=!1,Ct=!0,Rt,Bt;for(Rt=0;Rt0?Ct:0})},o.fillArray=function(ot,J,mt,dt){if(dt=dt||o.identity,o.isArrayOrTypedArray(ot))for(var Ct=0;CtB.test(window.navigator.userAgent);var U=/Firefox\/(\d+)\.\d+/;o.getFirefoxVersion=function(){var ot=U.exec(window.navigator.userAgent);if(ot&&ot.length===2){var J=parseInt(ot[1]);if(!isNaN(J))return J}return null},o.isD3Selection=function(ot){return ot instanceof f.selection},o.ensureSingle=function(ot,J,mt,dt){var Ct=ot.select(J+(mt?"."+mt:""));if(Ct.size())return Ct;var Rt=ot.append(J);return mt&&Rt.classed(mt,!0),dt&&Rt.call(dt),Rt},o.ensureSingleById=function(ot,J,mt,dt){var Ct=ot.select(J+"#"+mt);if(Ct.size())return Ct;var Rt=ot.append(J).attr("id",mt);return dt&&Rt.call(dt),Rt},o.objectFromPath=function(ot,J){for(var mt=ot.split("."),dt,Ct=dt={},Rt=0;Rt1?Ct+Bt[1]:"";if(Rt&&(Bt.length>1||Zt.length>4||mt))for(;dt.test(Zt);)Zt=Zt.replace(dt,"$1"+Rt+"$2");return Zt+Gt},o.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var H=/^\w*$/;o.templateString=function(ot,J){var mt={};return ot.replace(o.TEMPLATE_STRING_REGEX,function(dt,Ct){var Rt;return H.test(Ct)?Rt=J[Ct]:(mt[Ct]=mt[Ct]||o.nestedProperty(J,Ct).get,Rt=mt[Ct](!0)),Rt!==void 0?Rt:""})};var q={max:10,count:0,name:"hovertemplate"};o.hovertemplateString=ot=>ut(Ce(we({},ot),{opts:q}));var G={max:10,count:0,name:"texttemplate"};o.texttemplateString=ot=>ut(Ce(we({},ot),{opts:G}));var tt=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function ht(ot){var J=ot.match(tt);return J?{key:J[1],op:J[2],number:Number(J[3])}:{key:ot,op:null,number:null}}var bt={max:10,count:0,name:"texttemplate",parseMultDiv:!0};o.texttemplateStringForShapes=ot=>ut(Ce(we({},ot),{opts:bt}));var vt=/^[:|\|]/;function ut({data:ot=[],locale:J,fallback:mt,labels:dt={},opts:Ct,template:Rt}){return Rt.replace(o.TEMPLATE_STRING_REGEX,(Bt,Zt,Gt)=>{let ee=["xother","yother"].includes(Zt),xe=["_xother","_yother"].includes(Zt),ge=["_xother_","_yother_"].includes(Zt),ye=["xother_","yother_"].includes(Zt),ue=ee||xe||ye||ge;(xe||ge)&&(Zt=Zt.substring(1)),(ye||ge)&&(Zt=Zt.substring(0,Zt.length-1));let Mt=null,Ot=null;if(Ct.parseMultDiv){var Lt=ht(Zt);Zt=Lt.key,Mt=Lt.op,Ot=Lt.number}let ie;if(ue){if(dt[Zt]===void 0)return"";ie=dt[Zt]}else for(let Ze of ot)if(Ze){if(Ze.hasOwnProperty(Zt)){ie=Ze[Zt];break}if(H.test(Zt)||(ie=o.nestedProperty(Ze,Zt).get(!0)),ie!==void 0)break}if(ie===void 0){let{count:Ze,max:Qe,name:mr}=Ct,fr=mt===!1?Bt:mt;return Ze=rt&&Bt<=gt,ee=Zt>=rt&&Zt<=gt;if(Gt&&(dt=10*dt+Bt-rt),ee&&(Ct=10*Ct+Zt-rt),!Gt||!ee){if(dt!==Ct)return dt-Ct;if(Bt!==Zt)return Bt-Zt}}return Ct-dt};var it=2e9;o.seedPseudoRandom=function(){it=2e9},o.pseudoRandom=function(){var ot=it;return it=(69069*it+1)%4294967296,Math.abs(it-ot)<429496729?o.pseudoRandom():it/4294967296},o.fillText=function(ot,J,mt){var dt=Array.isArray(mt)?function(Bt){mt.push(Bt)}:function(Bt){mt.text=Bt},Ct=o.extractOption(ot,J,"htx","hovertext");if(o.isValidTextValue(Ct))return dt(Ct);var Rt=o.extractOption(ot,J,"tx","text");if(o.isValidTextValue(Rt))return dt(Rt)},o.isValidTextValue=function(ot){return ot||ot===0},o.formatPercent=function(ot,J){J=J||0;for(var mt=(Math.round(100*ot*Math.pow(10,J))*Math.pow(.1,J)).toFixed(J)+"%",dt=0;dt1&&(ee=1):ee=0,o.strTranslate(Ct-ee*(mt+Bt),Rt-ee*(dt+Zt))+o.strScale(ee)+(Gt?"rotate("+Gt+(J?"":" "+mt+" "+dt)+")":"")},o.setTransormAndDisplay=function(ot,J){ot.attr("transform",o.getTextTransform(J)),ot.style("display",J.scale?null:"none")},o.ensureUniformFontSize=function(ot,J){var mt=o.extendFlat({},J);return mt.size=Math.max(J.size,ot._fullLayout.uniformtext.minsize||0),mt},o.join2=function(ot,J,mt){var dt=ot.length;return dt>1?ot.slice(0,-1).join(J)+mt+ot[dt-1]:ot.join(J)},o.bigFont=function(ot){return Math.round(1.2*ot)};var st=o.getFirefoxVersion(),xt=st!==null&&st<86;o.getPositionFromD3Event=function(){return xt?[f.event.layerX,f.event.layerY]:[f.event.offsetX,f.event.offsetY]}}),uw=It(()=>{var et=jn(),Y={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(y in Y)f=y.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),et.addStyleRule(f,Y[y]);var f,y}),Qc=It((et,Y)=>{Y.exports=!0}),Jd=It((et,Y)=>{var f=Qc(),y;typeof window.matchMedia=="function"?y=!window.matchMedia("(hover: none)").matches:y=f,Y.exports=y}),Wg=It((et,Y)=>{var f=typeof Reflect=="object"?Reflect:null,y=f&&typeof f.apply=="function"?f.apply:function(D,E,I){return Function.prototype.apply.call(D,E,I)},z;f&&typeof f.ownKeys=="function"?z=f.ownKeys:Object.getOwnPropertySymbols?z=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:z=function(D){return Object.getOwnPropertyNames(D)};function P(D){console&&console.warn&&console.warn(D)}var n=Number.isNaN||function(D){return D!==D};function i(){i.init.call(this)}Y.exports=i,Y.exports.once=d,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function l(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(D){if(typeof D!="number"||D<0||n(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");a=D}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||n(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function o(D){return D._maxListeners===void 0?i.defaultMaxListeners:D._maxListeners}i.prototype.getMaxListeners=function(){return o(this)},i.prototype.emit=function(D){for(var E=[],I=1;I0&&(g=E[0]),g instanceof Error)throw g;var C=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw C.context=g,C}var S=p[D];if(S===void 0)return!1;if(typeof S=="function")y(S,this,E);else for(var N=S.length,B=x(S,N),I=0;I0&&C.length>p&&!C.warned){C.warned=!0;var S=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");S.name="MaxListenersExceededWarning",S.emitter=D,S.type=E,S.count=C.length,P(S)}return D}i.prototype.addListener=function(D,E){return c(this,D,E,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(D,E){return c(this,D,E,!0)};function s(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(D,E,I){var M={fired:!1,wrapFn:void 0,target:D,type:E,listener:I},p=s.bind(M);return p.listener=I,M.wrapFn=p,p}i.prototype.once=function(D,E){return l(E),this.on(D,h(this,D,E)),this},i.prototype.prependOnceListener=function(D,E){return l(E),this.prependListener(D,h(this,D,E)),this},i.prototype.removeListener=function(D,E){var I,M,p,g,C;if(l(E),M=this._events,M===void 0)return this;if(I=M[D],I===void 0)return this;if(I===E||I.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete M[D],M.removeListener&&this.emit("removeListener",D,I.listener||E));else if(typeof I!="function"){for(p=-1,g=I.length-1;g>=0;g--)if(I[g]===E||I[g].listener===E){C=I[g].listener,p=g;break}if(p<0)return this;p===0?I.shift():_(I,p),I.length===1&&(M[D]=I[0]),M.removeListener!==void 0&&this.emit("removeListener",D,C||E)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(D){var E,I,M;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[D]),this;if(arguments.length===0){var p=Object.keys(I),g;for(M=0;M=0;M--)this.removeListener(D,E[M]);return this};function m(D,E,I){var M=D._events;if(M===void 0)return[];var p=M[E];return p===void 0?[]:typeof p=="function"?I?[p.listener||p]:[p]:I?A(p):x(p,p.length)}i.prototype.listeners=function(D){return m(this,D,!0)},i.prototype.rawListeners=function(D){return m(this,D,!1)},i.listenerCount=function(D,E){return typeof D.listenerCount=="function"?D.listenerCount(E):b.call(D,E)},i.prototype.listenerCount=b;function b(D){var E=this._events;if(E!==void 0){var I=E[D];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function x(D,E){for(var I=new Array(E),M=0;M{var f=Wg().EventEmitter,y={init:function(z){if(z._ev instanceof f)return z;var P=new f,n=new f;return z._ev=P,z._internalEv=n,z.on=P.on.bind(P),z.once=P.once.bind(P),z.removeListener=P.removeListener.bind(P),z.removeAllListeners=P.removeAllListeners.bind(P),z._internalOn=n.on.bind(n),z._internalOnce=n.once.bind(n),z._removeInternalListener=n.removeListener.bind(n),z._removeAllInternalListeners=n.removeAllListeners.bind(n),z.emit=function(i,a){P.emit(i,a),n.emit(i,a)},typeof z.addEventListener=="function"&&z.addEventListener("wheel",()=>{},{passive:!0}),z},triggerHandler:function(z,P,n){var i,a=z._ev;if(!a)return;var l=a._events[P];if(!l)return;function o(s){if(s.listener){if(a.removeListener(P,s.listener),!s.fired)return s.fired=!0,s.listener.apply(a,[n])}else return s.apply(a,[n])}l=Array.isArray(l)?l:[l];var c;for(c=0;c{var f=jn(),y=Mo().dfltConfig;function z(n,i){for(var a=[],l,o=0;oy.queueLength&&(n.undoQueue.queue.shift(),n.undoQueue.index--)},P.startSequence=function(n){n.undoQueue=n.undoQueue||{index:0,queue:[],sequence:!1},n.undoQueue.sequence=!0,n.undoQueue.beginSequence=!0},P.stopSequence=function(n){n.undoQueue=n.undoQueue||{index:0,queue:[],sequence:!1},n.undoQueue.sequence=!1,n.undoQueue.beginSequence=!1},P.undo=function(n){var i,a;if(!(n.undoQueue===void 0||isNaN(n.undoQueue.index)||n.undoQueue.index<=0)){for(n.undoQueue.index--,i=n.undoQueue.queue[n.undoQueue.index],n.undoQueue.inSequence=!0,a=0;a=n.undoQueue.queue.length)){for(i=n.undoQueue.queue[n.undoQueue.index],n.undoQueue.inSequence=!0,a=0;a{Y.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),Gg=It(et=>{var Y=ls(),f=jn(),y=xa(),z=k_(),P=S4(),n=Ul(),i=Mo().configAttributes,a=sh(),l=f.extendDeepAll,o=f.isPlainObject,c=f.isArrayOrTypedArray,s=f.nestedProperty,h=f.valObjectMeta,m="_isSubplotObj",b="_isLinkedToArray",x="_arrayAttrRegexps",_="_deprecated",A=[m,b,x,_];et.IS_SUBPLOT_OBJ=m,et.IS_LINKED_TO_ARRAY=b,et.DEPRECATED=_,et.UNDERSCORE_ATTRS=A,et.get=function(){var B={};return Y.allTypes.forEach(function(U){B[U]=D(U)}),{defs:{valObjects:h,metaKeys:A.concat(["description","role","editType","impliedEdits"]),editType:{traces:a.traces,layout:a.layout},impliedEdits:{}},traces:B,layout:E(),frames:I(),animation:M(n),config:M(i)}},et.crawl=function(B,U,V,W){var F=V||0;W=W||"",Object.keys(B).forEach(function(H){var q=B[H];if(A.indexOf(H)===-1){var G=(W?W+".":"")+H;U(q,H,B,F,G),!et.isValObject(q)&&o(q)&&H!=="impliedEdits"&&et.crawl(q,U,F+1,G)}})},et.isValObject=function(B){return B&&B.valType!==void 0},et.findArrayAttributes=function(B){var U=[],V=[],W=[],F,H;function q(tt,ht,bt,vt){V=V.slice(0,vt).concat([ht]),W=W.slice(0,vt).concat([tt&&tt._isLinkedToArray]);var ut=tt&&(tt.valType==="data_array"||tt.arrayOk===!0)&&!(V[vt-1]==="colorbar"&&(ht==="ticktext"||ht==="tickvals"));ut&&G(F,0,"")}function G(tt,ht,bt){var vt=tt[V[ht]],ut=bt+V[ht];if(ht===V.length-1)c(vt)&&U.push(H+ut);else if(W[ht]){if(Array.isArray(vt))for(var rt=0;rt=H.length)return!1;if(B.dimensions===2){if(V++,U.length===V)return B;var q=U[V];if(!w(q))return!1;B=H[F][q]}else B=H[F]}else B=H}}return B}function w(B){return B===Math.round(B)&&B>=0}function D(B){var U,V;U=Y.modules[B]._module,V=U.basePlotModule;var W={};W.type=null;var F=l({},y),H=l({},U.attributes);et.crawl(H,function(tt,ht,bt,vt,ut){s(F,ut).set(void 0),tt===void 0&&s(H,ut).set(void 0)}),l(W,F),Y.traceIs(B,"noOpacity")&&delete W.opacity,Y.traceIs(B,"showLegend")||(delete W.showlegend,delete W.legendgroup),Y.traceIs(B,"noHover")&&(delete W.hoverinfo,delete W.hoverlabel),U.selectPoints||delete W.selectedpoints,l(W,H),V.attributes&&l(W,V.attributes),W.type=B;var q={meta:U.meta||{},categories:U.categories||{},animatable:!!U.animatable,type:B,attributes:M(W)};if(U.layoutAttributes){var G={};l(G,U.layoutAttributes),q.layoutAttributes=M(G)}return U.animatable||et.crawl(q,function(tt){et.isValObject(tt)&&"anim"in tt&&delete tt.anim}),q}function E(){var B={},U,V;l(B,z);for(U in Y.subplotsRegistry)if(V=Y.subplotsRegistry[U],!!V.layoutAttributes)if(Array.isArray(V.attr))for(var W=0;W{var Y=jn(),f=xa(),y="templateitemname",z={name:{valType:"string",editType:"none"}};z[y]={valType:"string",editType:"calc"},et.templatedArray=function(i,a){return a._isLinkedToArray=i,a.name=z.name,a[y]=z[y],a},et.traceTemplater=function(i){var a={},l,o;for(l in i)o=i[l],Array.isArray(o)&&o.length&&(a[l]=0);function c(s){l=Y.coerce(s,{},f,"type");var h={type:l,_template:null};if(l in a){o=i[l];var m=a[l]%o.length;a[l]++,h._template=o[m]}return h}return{newTrace:c}},et.newContainer=function(i,a,l){var o=i._template,c=o&&(o[a]||l&&o[l]);Y.isPlainObject(c)||(c=null);var s=i[a]={_template:c};return s},et.arrayTemplater=function(i,a,l){var o=i._template,c=o&&o[n(a)],s=o&&o[a];(!Array.isArray(s)||!s.length)&&(s=[]);var h={};function m(x){var _={name:x.name,_input:x},A=_[y]=x[y];if(!P(A))return _._template=c,_;for(var d=0;d=o&&(l._input||{})._templateitemname;s&&(c=o);var h=a+"["+c+"]",m;function b(){m={},s&&(m[h]={},m[h][y]=s)}b();function x(k,w){m[k]=w}function _(k,w){s?Y.nestedProperty(m[h],k).set(w):m[h+"."+k]=w}function A(){var k=m;return b(),k}function d(k,w){k&&_(k,w);var D=A();for(var E in D)Y.nestedProperty(i,E).set(D[E])}return{modifyBase:x,modifyItem:_,getUpdateObj:A,applyUpdate:d}}}),fu=It((et,Y)=>{var f=Ha().counter;Y.exports={idRegex:{x:f("x","( domain)?"),y:f("y","( domain)?")},attrRegex:f("[xy]axis"),xAxisMatch:f("xaxis"),yAxisMatch:f("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),Ku=It(et=>{var Y=ls(),f=fu();et.id2name=function(z){if(!(typeof z!="string"||!z.match(f.AX_ID_PATTERN))){var P=z.split(" ")[0].substr(1);return P==="1"&&(P=""),z.charAt(0)+"axis"+P}},et.name2id=function(z){if(z.match(f.AX_NAME_PATTERN)){var P=z.substr(5);return P==="1"&&(P=""),z.charAt(0)+P}},et.cleanId=function(z,P,n){var i=/( domain)$/.test(z);if(!(typeof z!="string"||!z.match(f.AX_ID_PATTERN))&&!(P&&z.charAt(0)!==P)&&!(i&&!n)){var a=z.split(" ")[0].substr(1).replace(/^0+/,"");return a==="1"&&(a=""),z.charAt(0)+a+(i&&n?" domain":"")}},et.list=function(z,P,n){var i=z._fullLayout;if(!i)return[];var a=et.listIds(z,P),l=new Array(a.length),o;for(o=0;oi?1:-1:+(z.substr(1)||1)-+(P.substr(1)||1)},et.ref2id=function(z){return/^[xyz]/.test(z)?z.split(" ")[0]:!1};function y(z,P){if(P&&P.length){for(var n=0;n{function f(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".outline-controllers").remove()}function y(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".select-outline").remove(),z._fullLayout._outlining=!1}Y.exports={clearOutlineControllers:f,clearOutline:y}}),Nv=It((et,Y)=>{Y.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),Mf=It(et=>{var Y=ls();fu().SUBPLOT_PATTERN,et.getSubplotCalcData=function(f,y,z){var P=Y.subplotsRegistry[y];if(!P)return[];for(var n=P.attr,i=[],a=0;a{var Y=ls(),f=jn();et.manageCommandObserver=function(a,l,o,c){var s={},h=!0;l&&l._commandObserver&&(s=l._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var m=et.hasSimpleAPICommandBindings(a,o,s.lookupTable);if(l&&l._commandObserver){if(m)return s;if(l._commandObserver.remove)return l._commandObserver.remove(),l._commandObserver=null,s}if(m){y(a,m,s.cache),s.check=function(){if(h){var _=y(a,m,s.cache);return _.changed&&c&&s.lookupTable[_.value]!==void 0&&(s.disable(),Promise.resolve(c({value:_.value,type:m.type,prop:m.prop,traces:m.traces,index:s.lookupTable[_.value]})).then(s.enable,s.enable)),_.changed}};for(var b=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],x=0;x0?".":"")+s;f.isPlainObject(h)?i(h,l,m,c+1):l(m,s,h)}})}}),lh=It((et,Y)=>{var f=Br(),y=on().timeFormatLocale,z=pr().formatLocale,P=Sr(),n=nn(),i=ls(),a=Gg(),l=Tc(),o=jn(),c=Hn(),s=Dr().BADNUM,h=Ku(),m=Cm().clearOutline,b=Nv(),x=Ul(),_=S4(),A=Mf().getModuleCalcData,d=o.relinkPrivateKeys,k=o._,w=Y.exports={};o.extendFlat(w,i),w.attributes=xa(),w.attributes.type.values=w.allTypes,w.fontAttrs=hi(),w.layoutAttributes=k_();var D=A_();w.executeAPICommand=D.executeAPICommand,w.computeAPICommandBindings=D.computeAPICommandBindings,w.manageCommandObserver=D.manageCommandObserver,w.hasSimpleAPICommandBindings=D.hasSimpleAPICommandBindings,w.redrawText=function(rt){return rt=o.getGraphDiv(rt),new Promise(function(gt){setTimeout(function(){rt._fullLayout&&(i.getComponentMethod("annotations","draw")(rt),i.getComponentMethod("legend","draw")(rt),i.getComponentMethod("colorbar","draw")(rt),gt(w.previousPromises(rt)))},300)})},w.resize=function(rt){rt=o.getGraphDiv(rt);var gt,it=new Promise(function(st,xt){(!rt||o.isHidden(rt))&&xt(new Error("Resize must be passed a displayed plot div element.")),rt._redrawTimer&&clearTimeout(rt._redrawTimer),rt._resolveResize&&(gt=rt._resolveResize),rt._resolveResize=st,rt._redrawTimer=setTimeout(function(){if(!rt.layout||rt.layout.width&&rt.layout.height||o.isHidden(rt)){st(rt);return}delete rt.layout.width,delete rt.layout.height;var ot=rt.changed;rt.autoplay=!0,i.call("relayout",rt,{autosize:!0}).then(function(){rt.changed=ot,rt._resolveResize===st&&(delete rt._resolveResize,st(rt))})},100)});return gt&>(it),it},w.previousPromises=function(rt){if((rt._promises||[]).length)return Promise.all(rt._promises).then(function(){rt._promises=[]})},w.addLinks=function(rt){if(!(!rt._context.showLink&&!rt._context.showSources)){var gt=rt._fullLayout,it=o.ensureSingle(gt._paper,"text","js-plot-link-container",function(dt){dt.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.defaultLine,"pointer-events":"all"}).each(function(){var Ct=f.select(this);Ct.append("tspan").classed("js-link-to-tool",!0),Ct.append("tspan").classed("js-link-spacer",!0),Ct.append("tspan").classed("js-sourcelinks",!0)})}),st=it.node(),xt={y:gt._paper.attr("height")-9};document.body.contains(st)&&st.getComputedTextLength()>=gt.width-20?(xt["text-anchor"]="start",xt.x=5):(xt["text-anchor"]="end",xt.x=gt._paper.attr("width")-7),it.attr(xt);var ot=it.select(".js-link-to-tool"),J=it.select(".js-link-spacer"),mt=it.select(".js-sourcelinks");rt._context.showSources&&rt._context.showSources(rt),rt._context.showLink&&E(rt,ot),J.text(ot.text()&&mt.text()?" - ":"")}};function E(rt,gt){gt.text("");var it=gt.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(rt._context.linkText+" »");if(rt._context.sendData)it.on("click",function(){w.sendDataToCloud(rt)});else{var st=window.location.pathname.split("/"),xt=window.location.search;it.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+st[2].split(".")[0]+"/"+st[1]+xt})}}w.sendDataToCloud=function(rt){var gt=(window.PLOTLYENV||{}).BASE_URL||rt._context.plotlyServerURL;if(gt){rt.emit("plotly_beforeexport");var it=f.select(rt).append("div").attr("id","hiddenform").style("display","none"),st=it.append("form").attr({action:gt+"/external",method:"post",target:"_blank"}),xt=st.append("input").attr({type:"text",name:"data"});return xt.node().value=w.graphJson(rt,!1,"keepdata"),st.node().submit(),it.remove(),rt.emit("plotly_afterexport"),!1}};var I=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(rt,gt){var it=gt&>.skipUpdateCalc,st=rt._fullLayout||{};if(st._skipDefaults){delete st._skipDefaults;return}var xt=rt._fullLayout={},ot=rt.layout||{},J=rt._fullData||[],mt=rt._fullData=[],dt=rt.data||[],Ct=rt.calcdata||[],Rt=rt._context||{},Bt;rt._transitionData||w.createTransitionData(rt),xt._dfltTitle={plot:k(rt,"Click to enter Plot title"),subtitle:k(rt,"Click to enter Plot subtitle"),x:k(rt,"Click to enter X axis title"),y:k(rt,"Click to enter Y axis title"),colorbar:k(rt,"Click to enter Colorscale title"),annotation:k(rt,"new text")},xt._traceWord=k(rt,"trace");var Zt=C(rt,I);if(xt._mapboxAccessToken=Rt.mapboxAccessToken,st._initialAutoSizeIsDone){var Gt=st.width,ee=st.height;w.supplyLayoutGlobalDefaults(ot,xt,Zt),ot.width||(xt.width=Gt),ot.height||(xt.height=ee),w.sanitizeMargins(xt)}else{w.supplyLayoutGlobalDefaults(ot,xt,Zt);var xe=!ot.width||!ot.height,ge=xt.autosize,ye=Rt.autosizable,ue=xe&&(ge||ye);ue?w.plotAutoSize(rt,ot,xt):xe&&w.sanitizeMargins(xt),!ge&&xe&&(ot.width=xt.width,ot.height=xt.height)}xt._d3locale=S(Zt,xt.separators),xt._extraFormat=C(rt,M),xt._initialAutoSizeIsDone=!0,xt._dataLength=dt.length,xt._modules=[],xt._visibleModules=[],xt._basePlotModules=[];var Mt=xt._subplots=g(),Ot=xt._splomAxes={x:{},y:{}},Lt=xt._splomSubplots={};xt._splomGridDflt={},xt._scatterStackOpts={},xt._firstScatter={},xt._alignmentOpts={},xt._colorAxes={},xt._requestRangeslider={},xt._traceUids=p(J,dt),w.supplyDataDefaults(dt,mt,ot,xt);var ie=Object.keys(Ot.x),be=Object.keys(Ot.y);if(ie.length>1&&be.length>1){for(i.getComponentMethod("grid","sizeDefaults")(ot,xt),Bt=0;Bt15&&be.length>15&&xt.shapes.length===0&&xt.images.length===0,w.linkSubplots(mt,xt,J,st),w.cleanPlot(mt,xt,J,st);var mr=!!(st._has&&st._has("cartesian")),fr=!!(xt._has&&xt._has("cartesian")),Jr=mr,an=fr;Jr&&!an?st._bgLayer.remove():an&&!Jr&&(xt._shouldCreateBgLayer=!0),st._zoomlayer&&!rt._dragging&&m({_fullLayout:st}),N(mt,xt),d(xt,st),i.getComponentMethod("colorscale","crossTraceDefaults")(mt,xt),xt._preGUI||(xt._preGUI={}),xt._tracePreGUI||(xt._tracePreGUI={});var Er=xt._tracePreGUI,dn={},_n;for(_n in Er)dn[_n]="old";for(Bt=0;Bt0){var Ct=1-2*xt;ot=Math.round(Ct*ot),J=Math.round(Ct*J)}}var Rt=w.layoutAttributes.width.min,Bt=w.layoutAttributes.height.min;ot1,Gt=!gt.height&&Math.abs(it.height-J)>1;(Gt||Zt)&&(Zt&&(it.width=ot),Gt&&(it.height=J)),rt._initialAutoSize||(rt._initialAutoSize={width:ot,height:J}),w.sanitizeMargins(it)},w.supplyLayoutModuleDefaults=function(rt,gt,it,st){var xt=i.componentsRegistry,ot=gt._basePlotModules,J,mt,dt,Ct=i.subplotsRegistry.cartesian;for(J in xt)dt=xt[J],dt.includeBasePlot&&dt.includeBasePlot(rt,gt);ot.length||ot.push(Ct),gt._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(rt,gt),Ct.finalizeSubplots(rt,gt));for(var Rt in gt._subplots)gt._subplots[Rt].sort(o.subplotSort);for(mt=0;mt1&&(it.l/=ge,it.r/=ge)}if(Zt){var ye=(it.t+it.b)/Zt;ye>1&&(it.t/=ye,it.b/=ye)}var ue=it.xl!==void 0?it.xl:it.x,Mt=it.xr!==void 0?it.xr:it.x,Ot=it.yt!==void 0?it.yt:it.y,Lt=it.yb!==void 0?it.yb:it.y;Gt[gt]={l:{val:ue,size:it.l+xe},r:{val:Mt,size:it.r+xe},b:{val:Lt,size:it.b+xe},t:{val:Ot,size:it.t+xe}},ee[gt]=1}if(!st._replotting)return w.doAutoMargin(rt)}};function H(rt){if("_redrawFromAutoMarginCount"in rt._fullLayout)return!1;var gt=h.list(rt,"",!0);for(var it in gt)if(gt[it].autoshift||gt[it].shift)return!0;return!1}w.doAutoMargin=function(rt){var gt=rt._fullLayout,it=gt.width,st=gt.height;gt._size||(gt._size={}),V(gt);var xt=gt._size,ot=gt.margin,J={t:0,b:0,l:0,r:0},mt=o.extendFlat({},xt),dt=ot.l,Ct=ot.r,Rt=ot.t,Bt=ot.b,Zt=gt._pushmargin,Gt=gt._pushmarginIds,ee=gt.minreducedwidth,xe=gt.minreducedheight;if(ot.autoexpand!==!1){for(var ge in Zt)Gt[ge]||delete Zt[ge];var ye=rt._fullLayout._reservedMargin;for(var ue in ye)for(var Mt in ye[ue]){var Ot=ye[ue][Mt];J[Mt]=Math.max(J[Mt],Ot)}Zt.base={l:{val:0,size:dt},r:{val:1,size:Ct},t:{val:1,size:Rt},b:{val:0,size:Bt}};for(var Lt in J){var ie=0;for(var be in Zt)be!=="base"&&P(Zt[be][Lt].size)&&(ie=Zt[be][Lt].size>ie?Zt[be][Lt].size:ie);var ce=Math.max(0,ot[Lt]-ie);J[Lt]=Math.max(0,J[Lt]-ce)}for(var Le in Zt){var Ze=Zt[Le].l||{},Qe=Zt[Le].b||{},mr=Ze.val,fr=Ze.size,Jr=Qe.val,an=Qe.size,Er=it-J.r-J.l,dn=st-J.t-J.b;for(var _n in Zt){if(P(fr)&&Zt[_n].r){var Oe=Zt[_n].r.val,Xt=Zt[_n].r.size;if(Oe>mr){var oe=(fr*Oe+(Xt-Er)*mr)/(Oe-mr),zt=(Xt*(1-mr)+(fr-Er)*(1-Oe))/(Oe-mr);oe+zt>dt+Ct&&(dt=oe,Ct=zt)}}if(P(an)&&Zt[_n].t){var _t=Zt[_n].t.val,Pt=Zt[_n].t.size;if(_t>Jr){var Ht=(an*_t+(Pt-dn)*Jr)/(_t-Jr),ae=(Pt*(1-Jr)+(an-dn)*(1-_t))/(_t-Jr);Ht+ae>Bt+Rt&&(Bt=Ht,Rt=ae)}}}}}var he=o.constrain(it-ot.l-ot.r,W,ee),Me=o.constrain(st-ot.t-ot.b,F,xe),qe=Math.max(0,it-he),Ye=Math.max(0,st-Me);if(qe){var ur=(dt+Ct)/qe;ur>1&&(dt/=ur,Ct/=ur)}if(Ye){var Rr=(Bt+Rt)/Ye;Rr>1&&(Bt/=Rr,Rt/=Rr)}if(xt.l=Math.round(dt)+J.l,xt.r=Math.round(Ct)+J.r,xt.t=Math.round(Rt)+J.t,xt.b=Math.round(Bt)+J.b,xt.p=Math.round(ot.pad),xt.w=Math.round(it)-xt.l-xt.r,xt.h=Math.round(st)-xt.t-xt.b,!gt._replotting&&(w.didMarginChange(mt,xt)||H(rt))){"_redrawFromAutoMarginCount"in gt?gt._redrawFromAutoMarginCount++:gt._redrawFromAutoMarginCount=1;var zr=3*(1+Object.keys(Gt).length);if(gt._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(rt,gt,it,st,xt,ot){(xt&>&&!rt._fullData||xt&&!gt&&!rt._fullLayout)&&w.supplyDefaults(rt);var J=xt?rt._fullData:rt.data,mt=xt?rt._fullLayout:rt.layout,dt=(rt._transitionData||{})._frames;function Ct(Zt,Gt){if(typeof Zt=="function")return Gt?"_function_":null;if(o.isPlainObject(Zt)){var ee={},xe;return Object.keys(Zt).sort().forEach(function(Mt){if(["_","["].indexOf(Mt.charAt(0))===-1){if(typeof Zt[Mt]=="function"){Gt&&(ee[Mt]="_function");return}if(it==="keepdata"){if(Mt.substr(Mt.length-3)==="src")return}else if(it==="keepstream"){if(xe=Zt[Mt+"src"],typeof xe=="string"&&xe.indexOf(":")>0&&!o.isPlainObject(Zt.stream))return}else if(it!=="keepall"&&(xe=Zt[Mt+"src"],typeof xe=="string"&&xe.indexOf(":")>0))return;ee[Mt]=Ct(Zt[Mt],Gt)}}),ee}var ge=Array.isArray(Zt),ye=o.isTypedArray(Zt);if((ge||ye)&&Zt.dtype&&Zt.shape){var ue=Zt.bdata;return Ct({dtype:Zt.dtype,shape:Zt.shape,bdata:o.isArrayBuffer(ue)?n.encode(ue):ue},Gt)}return ge?Zt.map(function(Mt){return Ct(Mt,Gt)}):ye?o.simpleMap(Zt,o.identity):o.isJSDate(Zt)?o.ms2DateTimeLocal(+Zt):Zt}var Rt={data:(J||[]).map(function(Zt){var Gt=Ct(Zt);return gt&&delete Gt.fit,Gt})};if(!gt&&(Rt.layout=Ct(mt),xt)){var Bt=mt._size;Rt.layout.computed={margin:{b:Bt.b,l:Bt.l,r:Bt.r,t:Bt.t}}}return dt&&(Rt.frames=Ct(dt)),ot&&(Rt.config=Ct(rt._context,!0)),st==="object"?Rt:JSON.stringify(Rt)},w.modifyFrames=function(rt,gt){var it,st,xt,ot=rt._transitionData._frames,J=rt._transitionData._frameHash;for(it=0;it0&&(rt._transitioningWithDuration=!0),rt._transitionData._interruptCallbacks.push(function(){st=!0}),it.redraw&&rt._transitionData._interruptCallbacks.push(function(){return i.call("redraw",rt)}),rt._transitionData._interruptCallbacks.push(function(){rt.emit("plotly_transitioninterrupted",[])});var Zt=0,Gt=0;function ee(){return Zt++,function(){Gt++,!st&&Gt===Zt&&mt(Bt)}}it.runFn(ee),setTimeout(ee())})}function mt(Bt){if(rt._transitionData)return ot(rt._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(it.redraw)return i.call("redraw",rt)}).then(function(){rt._transitioning=!1,rt._transitioningWithDuration=!1,rt.emit("plotly_transitioned",[])}).then(Bt)}function dt(){if(rt._transitionData)return rt._transitioning=!1,xt(rt._transitionData._interruptCallbacks)}var Ct=[w.previousPromises,dt,it.prepareFn,w.rehover,w.reselect,J],Rt=o.syncOrAsync(Ct,rt);return(!Rt||!Rt.then)&&(Rt=Promise.resolve()),Rt.then(function(){return rt})}w.doCalcdata=function(rt,gt){var it=h.list(rt),st=rt._fullData,xt=rt._fullLayout,ot,J,mt,dt,Ct=new Array(st.length),Rt=(rt.calcdata||[]).slice();for(rt.calcdata=Ct,xt._numBoxes=0,xt._numViolins=0,xt._violinScaleGroupStats={},rt._hmpixcount=0,rt._hmlumcount=0,xt._piecolormap={},xt._sunburstcolormap={},xt._treemapcolormap={},xt._iciclecolormap={},xt._funnelareacolormap={},mt=0;mt=0;dt--)if(Lt[dt].enabled){ot._indexToPoints=Lt[dt]._indexToPoints;break}J&&J.calc&&(Ot=J.calc(rt,ot))}(!Array.isArray(Ot)||!Ot[0])&&(Ot=[{x:s,y:s}]),Ot[0].t||(Ot[0].t={}),Ot[0].trace=ot,Ct[ue]=Ot}}for(vt(it,st,xt),mt=0;mt{et.xmlns="http://www.w3.org/2000/xmlns/",et.svg="http://www.w3.org/2000/svg",et.xlink="http://www.w3.org/1999/xlink",et.svgAttrs={xmlns:et.svg,"xmlns:xlink":et.xlink}}),Rd=It((et,Y)=>{Y.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}),uu=It(et=>{var Y=Br(),f=jn(),y=f.strTranslate,z=k0(),P=Rd().LINE_SPACING,n=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;et.convertToTspans=function(F,H,q){var G=F.text(),tt=!F.attr("data-notex")&&H&&H._context.typesetMath&&typeof MathJax<"u"&&G.match(n),ht=Y.select(F.node().parentNode);if(ht.empty())return;var bt=F.attr("class")?F.attr("class").split(" ")[0]:"text";bt+="-math",ht.selectAll("svg."+bt).remove(),ht.selectAll("g."+bt+"-group").remove(),F.style("display",null).attr({"data-unformatted":G,"data-math":"N"});function vt(){ht.empty()||(bt=F.attr("class")+"-math",ht.select("svg."+bt).remove()),F.text("").style("white-space","pre");var ut=B(F.node(),G);ut&&F.style("pointer-events","all"),et.positionText(F),q&&q.call(F)}return tt?(H&&H._promises||[]).push(new Promise(function(ut){F.style("display","none");var rt=parseInt(F.node().style.fontSize,10),gt={fontSize:rt};c(tt[2],gt,function(it,st,xt){ht.selectAll("svg."+bt).remove(),ht.selectAll("g."+bt+"-group").remove();var ot=it&&it.select("svg");if(!ot||!ot.node()){vt(),ut();return}var J=ht.append("g").classed(bt+"-group",!0).attr({"pointer-events":"none","data-unformatted":G,"data-math":"Y"});J.node().appendChild(ot.node()),st&&st.node()&&ot.node().insertBefore(st.node().cloneNode(!0),ot.node().firstChild);var mt=xt.width,dt=xt.height;ot.attr({class:bt,height:dt,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var Ct=F.node().style.fill||"black",Rt=ot.select("g");Rt.attr({fill:Ct,stroke:Ct});var Bt=Rt.node().getBoundingClientRect(),Zt=Bt.width,Gt=Bt.height;(Zt>mt||Gt>dt)&&(ot.style("overflow","hidden"),Bt=ot.node().getBoundingClientRect(),Zt=Bt.width,Gt=Bt.height);var ee=+F.attr("x"),xe=+F.attr("y"),ge=rt||F.node().getBoundingClientRect().height,ye=-ge/4;if(bt[0]==="y")J.attr({transform:"rotate("+[-90,ee,xe]+")"+y(-Zt/2,ye-Gt/2)});else if(bt[0]==="l")xe=ye-Gt/2;else if(bt[0]==="a"&&bt.indexOf("atitle")!==0)ee=0,xe=ye;else{var ue=F.attr("text-anchor");ee=ee-Zt*(ue==="middle"?.5:ue==="end"?1:0),xe=xe+ye-Gt/2}ot.attr({x:ee,y:xe}),q&&q.call(F,J),ut(J)})})):vt(),F};var i=/(<|<|<)/g,a=/(>|>|>)/g;function l(F){return F.replace(i,"\\lt ").replace(a,"\\gt ")}var o=[["$","$"],["\\(","\\)"]];function c(F,H,q){var G=parseInt((MathJax.version||"").split(".")[0]);if(G!==2&&G!==3){f.warn("No MathJax version:",MathJax.version);return}var tt,ht,bt,vt,ut=function(){return ht=f.extendDeepAll({},MathJax.Hub.config),bt=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:o},displayAlign:"left"})},rt=function(){ht=f.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=o},gt=function(){if(tt=MathJax.Hub.config.menuSettings.renderer,tt!=="SVG")return MathJax.Hub.setRenderer("SVG")},it=function(){tt=MathJax.config.startup.output,tt!=="svg"&&(MathJax.config.startup.output="svg")},st=function(){var Ct="math-output-"+f.randstr({},64);vt=Y.select("body").append("div").attr({id:Ct}).style({visibility:"hidden",position:"absolute","font-size":H.fontSize+"px"}).text(l(F));var Rt=vt.node();return G===2?MathJax.Hub.Typeset(Rt):MathJax.typeset([Rt])},xt=function(){var Ct=vt.select(G===2?".MathJax_SVG":".MathJax"),Rt=!Ct.empty()&&vt.select("svg").node();if(!Rt)f.log("There was an error in the tex syntax.",F),q();else{var Bt=Rt.getBoundingClientRect(),Zt;G===2?Zt=Y.select("body").select("#MathJax_SVG_glyphs"):Zt=Ct.select("defs"),q(Ct,Zt,Bt)}vt.remove()},ot=function(){if(tt!=="SVG")return MathJax.Hub.setRenderer(tt)},J=function(){tt!=="svg"&&(MathJax.config.startup.output=tt)},mt=function(){return bt!==void 0&&(MathJax.Hub.processSectionDelay=bt),MathJax.Hub.Config(ht)},dt=function(){MathJax.config=ht};G===2?MathJax.Hub.Queue(ut,gt,st,xt,ot,mt):G===3&&(rt(),it(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){st(),xt(),J(),dt()}))}var s={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},m={sub:"-0.21em",sup:"0.42em"},b="​",x=["http:","https:","mailto:","",void 0,":"],_=et.NEWLINES=/(\r\n?|\n)/g,A=/(<[^<>]*>)/,d=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;et.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,D=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,I=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(F,H){if(!F)return null;var q=F.match(H),G=q&&(q[3]||q[4]);return G&&S(G)}var p=/(^|;)\s*color:/;et.plainText=function(F,H){H=H||{};for(var q=H.len!==void 0&&H.len!==-1?H.len:1/0,G=H.allowedTags!==void 0?H.allowedTags:["br"],tt="...",ht=tt.length,bt=F.split(A),vt=[],ut="",rt=0,gt=0;gtht?vt.push(it.substr(0,J-ht)+tt):vt.push(it.substr(0,J));break}ut=""}}return vt.join("")};var g={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},C=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(F){return F.replace(C,function(H,q){var G;return q.charAt(0)==="#"?G=N(q.charAt(1)==="x"?parseInt(q.substr(2),16):parseInt(q.substr(1),10)):G=g[q],G||H})}et.convertEntities=S;function N(F){if(!(F>1114111)){var H=String.fromCodePoint;if(H)return H(F);var q=String.fromCharCode;return F<=65535?q(F):q((F>>10)+55232,F%1024+56320)}}function B(F,H){H=H.replace(_," ");var q=!1,G=[],tt,ht=-1;function bt(){ht++;var Gt=document.createElementNS(z.svg,"tspan");Y.select(Gt).attr({class:"line",dy:ht*P+"em"}),F.appendChild(Gt),tt=Gt;var ee=G;if(G=[{node:Gt}],ee.length>1)for(var xe=1;xe.",H);return}var ee=G.pop();Gt!==ee.type&&f.log("Start tag <"+ee.type+"> doesnt match end tag <"+Gt+">. Pretending it did match.",H),tt=G[G.length-1].node}var gt=k.test(H);gt?bt():(tt=F,G=[{node:F}]);for(var it=H.split(A),st=0;st{var f=Br(),y=Xi(),z=Sr(),P=jn(),n=Hn(),i=Ur().isValid;function a(_,A,d){var k=A?P.nestedProperty(_,A).get()||{}:_,w=k[d||"color"];w&&w._inputArray&&(w=w._inputArray);var D=!1;if(P.isArrayOrTypedArray(w)){for(var E=0;E=0;k--,w++){var D=_[k];d[w]=[1-D[0],D[1]]}return d}function m(_,A){A=A||{};for(var d=_.domain,k=_.range,w=k.length,D=new Array(w),E=0;E{var f=ow(),y=f.FORMAT_LINK,z=f.DATE_FORMAT_LINK;function P(a,l){return{valType:"string",dflt:"",editType:"none",description:(l?n:i)("hover text",a)+["By default the values are formatted using "+(l?"generic number format":"`"+a+"axis.hoverformat`")+"."].join(" ")}}function n(a,l){return["Sets the "+a+" formatting rule"+(l?"for `"+l+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+y+"."].join(" ")}function i(a,l){return n(a,l)+[" And for dates see: "+z+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}Y.exports={axisHoverFormat:P,descriptionOnlyNumbers:n,descriptionWithDates:i}}),Gf=It((et,Y)=>{var f=hi(),y=Sn(),z=qf().dash,P=Yn().extendFlat,n=Tc().templatedArray;nu().templateFormatStringDescription;var i=Sh().descriptionWithDates,a=Dr().ONEDAY,l=fu(),o=l.HOUR_PATTERN,c=l.WEEKDAY_PATTERN,s={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},h=P({},s,{values:s.values.slice().concat(["sync"])});function m(p){return{valType:"integer",min:0,dflt:p?5:0,editType:"ticks"}}var b={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},x={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},_={valType:"data_array",editType:"ticks"},A={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function d(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=5),g}function k(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var w={valType:"color",dflt:y.defaultLine,editType:"ticks"},D={valType:"color",dflt:y.lightLine,editType:"ticks"};function E(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var I=P({},z,{editType:"ticks"}),M={valType:"boolean",editType:"ticks"};Y.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:y.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:f({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},rangebreaks:n("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[c,o,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:a},editType:"calc"}),tickmode:h,nticks:m(),tick0:b,dtick:x,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:_,ticktext:{valType:"data_array",editType:"ticks"},ticks:A,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:d(),tickwidth:k(),tickcolor:w,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:P({},z,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:f({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:i("tick label")},tickformatstops:n("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:i("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:M,gridcolor:D,gridwidth:E(),griddash:I,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},minor:{tickmode:s,nticks:m("minor"),tick0:b,dtick:x,tickvals:_,ticks:A,ticklen:d("minor"),tickwidth:k("minor"),tickcolor:w,gridcolor:D,gridwidth:E("minor"),griddash:I,showgrid:M,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),M_=It((et,Y)=>{var f=Gf(),y=hi(),z=Yn().extendFlat,P=sh().overrideAll;Y.exports=P({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:f.linecolor,outlinewidth:f.linewidth,bordercolor:f.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:f.minor.tickmode,nticks:f.nticks,tick0:f.tick0,dtick:f.dtick,tickvals:f.tickvals,ticktext:f.ticktext,ticks:z({},f.ticks,{dflt:""}),ticklabeloverflow:z({},f.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:f.ticklen,tickwidth:f.tickwidth,tickcolor:f.tickcolor,ticklabelstep:f.ticklabelstep,showticklabels:f.showticklabels,labelalias:f.labelalias,tickfont:y({}),tickangle:f.tickangle,tickformat:f.tickformat,tickformatstops:f.tickformatstops,tickprefix:f.tickprefix,showtickprefix:f.showtickprefix,ticksuffix:f.ticksuffix,showticksuffix:f.showticksuffix,separatethousands:f.separatethousands,exponentformat:f.exponentformat,minexponent:f.minexponent,showexponent:f.showexponent,title:{text:{valType:"string"},font:y({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),Ru=It((et,Y)=>{var f=M_(),y=Ha().counter,z=Xm(),P=Ur().scales;z(P);function n(i){return"`"+i+"`"}Y.exports=function(i,a){i=i||"",a=a||{};var l=a.cLetter||"c";"onlyIfNumerical"in a&&a.onlyIfNumerical;var o="noScale"in a?a.noScale:i==="marker.line",c="showScaleDflt"in a?a.showScaleDflt:l==="z",s=typeof a.colorscaleDflt=="string"?P[a.colorscaleDflt]:null,h=a.editTypeOverride||"",m=i?i+".":"",b;"colorAttr"in a?(b=a.colorAttr,a.colorAttr):(b={z:"z",c:"color"}[l],""+n(m+b));var x=l+"auto",_=l+"min",A=l+"max",d=l+"mid",k={};k[_]=k[A]=void 0;var w={};w[x]=!1;var D={};return b==="color"&&(D.color={valType:"color",arrayOk:!0,editType:h||"style"},a.anim&&(D.color.anim=!0)),D[x]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:k},D[_]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[A]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[d]={valType:"number",dflt:null,editType:"calc",impliedEdits:k},D.colorscale={valType:"colorscale",editType:"calc",dflt:s,impliedEdits:{autocolorscale:!1}},D.autocolorscale={valType:"boolean",dflt:a.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},D.reversescale={valType:"boolean",dflt:!1,editType:"plot"},o||(D.showscale={valType:"boolean",dflt:c,editType:"calc"},D.colorbar=f),a.noColorAxis||(D.coloraxis={valType:"subplotid",regex:y("coloraxis"),dflt:null,editType:"calc"}),D}}),Hc=It((et,Y)=>{var f=Yn().extendFlat,y=Ru(),z=Ur().scales;Y.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:z.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:z.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:z.RdBu,editType:"calc"}},coloraxis:f({_isSubplotObj:!0,editType:"calc"},y("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),Am=It((et,Y)=>{var f=jn();Y.exports=function(y){return f.isPlainObject(y.colorbar)}}),Xh=It(et=>{var Y=Sr(),f=jn(),y=Dr(),z=y.ONEDAY,P=y.ONEWEEK;et.dtick=function(n,i){var a=i==="log",l=i==="date",o=i==="category",c=l?z:1;if(!n)return c;if(Y(n))return n=Number(n),n<=0?c:o?Math.max(1,Math.round(n)):l?Math.max(.1,n):n;if(typeof n!="string"||!(l||a))return c;var s=n.charAt(0),h=n.substr(1);return h=Y(h)?Number(h):0,h<=0||!(l&&s==="M"&&h===Math.round(h)||a&&s==="L"||a&&s==="D"&&(h===1||h===2))?c:n},et.tick0=function(n,i,a,l){if(i==="date")return f.cleanDate(n,f.dateTick0(a,l%P===0?1:0));if(!(l==="D1"||l==="D2"))return Y(n)?Number(n):0}}),jv=It((et,Y)=>{var f=Xh(),y=jn().isArrayOrTypedArray,z=Xn().isTypedArraySpec,P=Xn().decodeTypedArraySpec;Y.exports=function(n,i,a,l,o){o||(o={});var c=o.isMinor,s=c?n.minor||{}:n,h=c?i.minor:i,m=c?"minor.":"";function b(E){var I=s[E];return z(I)&&(I=P(I)),I!==void 0?I:(h._template||{})[E]}var x=b("tick0"),_=b("dtick"),A=b("tickvals"),d=y(A)?"array":_?"linear":"auto",k=a(m+"tickmode",d);if(k==="auto"||k==="sync")a(m+"nticks");else if(k==="linear"){var w=h.dtick=f.dtick(_,l);h.tick0=f.tick0(x,l,i.calendar,w)}else if(l!=="multicategory"){var D=a(m+"tickvals");D===void 0?h.tickmode="auto":c||a("ticktext")}}}),Uv=It((et,Y)=>{var f=jn(),y=Gf();Y.exports=function(z,P,n,i){var a=i.isMinor,l=a?z.minor||{}:z,o=a?P.minor:P,c=a?y.minor:y,s=a?"minor.":"",h=f.coerce2(l,o,c,"ticklen",a?(P.ticklen||5)*.6:void 0),m=f.coerce2(l,o,c,"tickwidth",a?P.tickwidth||1:void 0),b=f.coerce2(l,o,c,"tickcolor",(a?P.tickcolor:void 0)||o.color),x=n(s+"ticks",!a&&i.outerTicks||h||m||b?"outside":"");x||(delete o.ticklen,delete o.tickwidth,delete o.tickcolor)}}),Qx=It((et,Y)=>{Y.exports=function(f){var y=["showexponent","showtickprefix","showticksuffix"],z=y.filter(function(n){return f[n]!==void 0}),P=function(n){return f[n]===f[z[0]]};if(z.every(P)||z.length===1)return f[z[0]]}}),Zf=It((et,Y)=>{var f=jn(),y=Tc();Y.exports=function(z,P,n){var i=n.name,a=n.inclusionAttr||"visible",l=P[i],o=f.isArrayOrTypedArray(z[i])?z[i]:[],c=P[i]=[],s=y.arrayTemplater(P,i,a),h,m;for(h=0;h{var f=jn(),y=Hn().contrast,z=Gf(),P=Qx(),n=Zf();Y.exports=function(a,l,o,c,s){s||(s={});var h=o("labelalias");f.isPlainObject(h)||delete l.labelalias;var m=P(a),b=o("showticklabels");if(b){s.noTicklabelshift||o("ticklabelshift"),s.noTicklabelstandoff||o("ticklabelstandoff");var x=s.font||{},_=l.color,A=l.ticklabelposition||"",d=A.indexOf("inside")!==-1?y(s.bgColor):_&&_!==z.color.dflt?_:x.color;if(f.coerceFont(o,"tickfont",x,{overrideDflt:{color:d}}),!s.noTicklabelstep&&c!=="multicategory"&&c!=="log"&&o("ticklabelstep"),!s.noAng){var k=o("tickangle");!s.noAutotickangles&&k==="auto"&&o("autotickangles")}if(c!=="category"){var w=o("tickformat");n(a,l,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:i}),l.tickformatstops.length||delete l.tickformatstops,!s.noExp&&!w&&c!=="date"&&(o("showexponent",m),o("exponentformat"),o("minexponent"),o("separatethousands"))}!s.noMinorloglabels&&c==="log"&&o("minorloglabels")}};function i(a,l){function o(s,h){return f.coerce(a,l,z.tickformatstops,s,h)}var c=o("enabled");c&&(o("dtickrange"),o("value"))}}),Sg=It((et,Y)=>{var f=Qx();Y.exports=function(y,z,P,n,i){i||(i={});var a=i.tickSuffixDflt,l=f(y),o=P("tickprefix");o&&P("showtickprefix",l);var c=P("ticksuffix",a);c&&P("showticksuffix",l)}}),Q1=It((et,Y)=>{var f=jn(),y=Tc(),z=jv(),P=Uv(),n=q0(),i=Sg(),a=M_();Y.exports=function(l,o,c){var s=y.newContainer(o,"colorbar"),h=l.colorbar||{};function m(F,H){return f.coerce(h,s,a,F,H)}var b=c.margin||{t:0,b:0,l:0,r:0},x=c.width-b.l-b.r,_=c.height-b.t-b.b,A=m("orientation"),d=A==="v",k=m("thicknessmode");m("thickness",k==="fraction"?30/(d?x:_):30);var w=m("lenmode");m("len",w==="fraction"?1:d?_:x);var D=m("yref"),E=m("xref"),I=D==="paper",M=E==="paper",p,g,C,S="left";d?(C="middle",S=M?"left":"right",p=M?1.02:1,g=.5):(C=I?"bottom":"top",S="center",p=.5,g=I?1.02:1),f.coerce(h,s,{x:{valType:"number",min:M?-2:0,max:M?3:1,dflt:p}},"x"),f.coerce(h,s,{y:{valType:"number",min:I?-2:0,max:I?3:1,dflt:g}},"y"),m("xanchor",S),m("xpad"),m("yanchor",C),m("ypad"),f.noneOrAll(h,s,["x","y"]),m("outlinecolor"),m("outlinewidth"),m("bordercolor"),m("borderwidth"),m("bgcolor");var N=f.coerce(h,s,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:d?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");m("ticklabeloverflow",N.indexOf("inside")!==-1?"hide past domain":"hide past div"),z(h,s,m,"linear");var B=c.font,U={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:B};N.indexOf("inside")!==-1&&(U.bgColor="black"),i(h,s,m,"linear",U),n(h,s,m,"linear",U),P(h,s,m,"linear",U),m("title.text",c._dfltTitle.colorbar);var V=s.showticklabels?s.tickfont:B,W=f.extendFlat({},B,{family:V.family,size:f.bigFont(V.size)});f.coerceFont(m,"title.font",W),m("title.side",d?"top":"right")}}),Cu=It((et,Y)=>{var f=Sr(),y=jn(),z=Am(),P=Q1(),n=Ur().isValid,i=ls().traceIs;function a(l,o){var c=o.slice(0,o.length-1);return o?y.nestedProperty(l,c).get()||{}:l}Y.exports=function l(o,c,s,h,m){var b=m.prefix,x=m.cLetter,_="_module"in c,A=a(o,b),d=a(c,b),k=a(c._template||{},b)||{},w=function(){return delete o.coloraxis,delete c.coloraxis,l(o,c,s,h,m)};if(_){var D=s._colorAxes||{},E=h(b+"coloraxis");if(E){var I=i(c,"contour")&&y.nestedProperty(c,"contours.coloring").get()||"heatmap",M=D[E];M?(M[2].push(w),M[0]!==I&&(M[0]=!1,y.warn(["Ignoring coloraxis:",E,"setting","as it is linked to incompatible colorscales."].join(" ")))):D[E]=[I,c,[w]];return}}var p=A[x+"min"],g=A[x+"max"],C=f(p)&&f(g)&&p{var f=jn(),y=Tc(),z=Hc(),P=Cu();Y.exports=function(n,i){function a(x,_){return f.coerce(n,i,z,x,_)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var l=i._colorAxes,o,c;function s(x,_){return f.coerce(o,c,z.coloraxis,x,_)}for(var h in l){var m=l[h];if(m[0])o=n[h]||{},c=y.newContainer(i,h,"coloraxis"),c._name=h,P(o,c,i,s,{prefix:"",cLetter:"c"});else{for(var b=0;b{var f=jn(),y=fp().hasColorscale,z=fp().extractOpts;Y.exports=function(P,n){function i(m,b){var x=m["_"+b];x!==void 0&&(m[b]=x)}function a(m,b){var x=b.container?f.nestedProperty(m,b.container).get():m;if(x)if(x.coloraxis)x._colorAx=n[x.coloraxis];else{var _=z(x),A=_.auto;(A||_.min===void 0)&&i(x,b.min),(A||_.max===void 0)&&i(x,b.max),_.autocolorscale&&i(x,"colorscale")}}for(var l=0;l{var f=Sr(),y=jn(),z=fp().extractOpts;Y.exports=function(P,n,i){var a=P._fullLayout,l=i.vals,o=i.containerStr,c=o?y.nestedProperty(n,o).get():n,s=z(c),h=s.auto!==!1,m=s.min,b=s.max,x=s.mid,_=function(){return y.aggNums(Math.min,null,l)},A=function(){return y.aggNums(Math.max,null,l)};if(m===void 0?m=_():h&&(c._colorAx&&f(m)?m=Math.min(m,_()):m=_()),b===void 0?b=A():h&&(c._colorAx&&f(b)?b=Math.max(b,A()):b=A()),h&&x!==void 0&&(b-x>x-m?m=x-(b-x):b-x=0?d=a.colorscale.sequential:d=a.colorscale.sequentialminus,s._sync("colorscale",d)}}}),ch=It((et,Y)=>{var f=Ur(),y=fp();Y.exports={moduleType:"component",name:"colorscale",attributes:Ru(),layoutAttributes:Hc(),supplyLayoutDefaults:$v(),handleDefaults:Cu(),crossTraceDefaults:C4(),calc:Cp(),scales:f.scales,defaultScale:f.defaultScale,getScale:f.get,isValidScale:f.isValid,hasColorscale:y.hasColorscale,extractOpts:y.extractOpts,extractScale:y.extractScale,flipScale:y.flipScale,makeColorScaleFunc:y.makeColorScaleFunc,makeColorScaleFuncFromTrace:y.makeColorScaleFuncFromTrace}}),Fu=It((et,Y)=>{var f=jn(),y=Xn().isTypedArraySpec;Y.exports={hasLines:function(z){return z.visible&&z.mode&&z.mode.indexOf("lines")!==-1},hasMarkers:function(z){return z.visible&&(z.mode&&z.mode.indexOf("markers")!==-1||z.type==="splom")},hasText:function(z){return z.visible&&z.mode&&z.mode.indexOf("text")!==-1},isBubble:function(z){var P=z.marker;return f.isPlainObject(P)&&(f.isArrayOrTypedArray(P.size)||y(P.size))}}}),Hv=It((et,Y)=>{var f=Sr();Y.exports=function(y,z){z||(z=2);var P=y.marker,n=P.sizeref||1,i=P.sizemin||0,a=P.sizemode==="area"?function(l){return Math.sqrt(l/n)}:function(l){return l/n};return function(l){var o=a(l/z);return f(o)&&o>0?Math.max(o,i):0}}}),T0=It(et=>{var Y=jn();et.getSubplot=function(i){return i.subplot||i.xaxis+i.yaxis||i.geo},et.isTraceInSubplots=function(i,a){if(i.type==="splom"){for(var l=i.xaxes||[],o=i.yaxes||[],c=0;c=0&&l.index{Y.exports=z;var f={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},y=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function z(i){var a=[];return i.replace(y,function(l,o,c){var s=o.toLowerCase();for(c=n(c),s=="m"&&c.length>2&&(a.push([o].concat(c.splice(0,2))),s="l",o=o=="m"?"l":"L");;){if(c.length==f[s])return c.unshift(o),a.push(c);if(c.length{var f=E_(),y=function(x,_){return _?Math.round(x*(_=Math.pow(10,_)))/_:Math.round(x)},z="M0,0Z",P=Math.sqrt(2),n=Math.sqrt(3),i=Math.PI,a=Math.cos,l=Math.sin;Y.exports={circle:{n:0,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k="M"+d+",0A"+d+","+d+" 0 1,1 0,-"+d+"A"+d+","+d+" 0 0,1 "+d+",0Z";return A?b(_,A,k):k}},square:{n:1,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"H-"+d+"V-"+d+"H"+d+"Z")}},diamond:{n:2,f:function(x,_,A){if(o(_))return z;var d=y(x*1.3,2);return b(_,A,"M"+d+",0L0,"+d+"L-"+d+",0L0,-"+d+"Z")}},cross:{n:3,f:function(x,_,A){if(o(_))return z;var d=y(x*.4,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+d+"H"+d+"V"+k+"H-"+d+"V"+d+"H-"+k+"V-"+d+"H-"+d+"V-"+k+"H"+d+"V-"+d+"H"+k+"Z")}},x:{n:4,f:function(x,_,A){if(o(_))return z;var d=y(x*.8/P,2),k="l"+d+","+d,w="l"+d+",-"+d,D="l-"+d+",-"+d,E="l-"+d+","+d;return b(_,A,"M0,"+d+k+w+D+w+D+E+D+E+k+E+k+"Z")}},"triangle-up":{n:5,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+d+","+k+"H"+d+"L0,-"+w+"Z")}},"triangle-down":{n:6,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+d+",-"+k+"H"+d+"L0,"+w+"Z")}},"triangle-left":{n:7,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M"+k+",-"+d+"V"+d+"L-"+w+",0Z")}},"triangle-right":{n:8,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+k+",-"+d+"V"+d+"L"+w+",0Z")}},"triangle-ne":{n:9,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+k+",-"+d+"H"+d+"V"+k+"Z")}},"triangle-se":{n:10,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+d+",-"+k+"V"+d+"H-"+k+"Z")}},"triangle-sw":{n:11,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+d+"H-"+d+"V-"+k+"Z")}},"triangle-nw":{n:12,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+d+","+k+"V-"+d+"H"+k+"Z")}},pentagon:{n:13,f:function(x,_,A){if(o(_))return z;var d=y(x*.951,2),k=y(x*.588,2),w=y(-x,2),D=y(x*-.309,2),E=y(x*.809,2);return b(_,A,"M"+d+","+D+"L"+k+","+E+"H-"+k+"L-"+d+","+D+"L0,"+w+"Z")}},hexagon:{n:14,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x/2,2),w=y(x*n/2,2);return b(_,A,"M"+w+",-"+k+"V"+k+"L0,"+d+"L-"+w+","+k+"V-"+k+"L0,-"+d+"Z")}},hexagon2:{n:15,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x/2,2),w=y(x*n/2,2);return b(_,A,"M-"+k+","+w+"H"+k+"L"+d+",0L"+k+",-"+w+"H-"+k+"L-"+d+",0Z")}},octagon:{n:16,f:function(x,_,A){if(o(_))return z;var d=y(x*.924,2),k=y(x*.383,2);return b(_,A,"M-"+k+",-"+d+"H"+k+"L"+d+",-"+k+"V"+k+"L"+k+","+d+"H-"+k+"L-"+d+","+k+"V-"+k+"Z")}},star:{n:17,f:function(x,_,A){if(o(_))return z;var d=x*1.4,k=y(d*.225,2),w=y(d*.951,2),D=y(d*.363,2),E=y(d*.588,2),I=y(-d,2),M=y(d*-.309,2),p=y(d*.118,2),g=y(d*.809,2),C=y(d*.382,2);return b(_,A,"M"+k+","+M+"H"+w+"L"+D+","+p+"L"+E+","+g+"L0,"+C+"L-"+E+","+g+"L-"+D+","+p+"L-"+w+","+M+"H-"+k+"L0,"+I+"Z")}},hexagram:{n:18,f:function(x,_,A){if(o(_))return z;var d=y(x*.66,2),k=y(x*.38,2),w=y(x*.76,2);return b(_,A,"M-"+w+",0l-"+k+",-"+d+"h"+w+"l"+k+",-"+d+"l"+k+","+d+"h"+w+"l-"+k+","+d+"l"+k+","+d+"h-"+w+"l-"+k+","+d+"l-"+k+",-"+d+"h-"+w+"Z")}},"star-triangle-up":{n:19,f:function(x,_,A){if(o(_))return z;var d=y(x*n*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M-"+d+","+k+E+d+","+k+E+"0,-"+w+E+"-"+d+","+k+"Z")}},"star-triangle-down":{n:20,f:function(x,_,A){if(o(_))return z;var d=y(x*n*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M"+d+",-"+k+E+"-"+d+",-"+k+E+"0,"+w+E+d+",-"+k+"Z")}},"star-square":{n:21,f:function(x,_,A){if(o(_))return z;var d=y(x*1.1,2),k=y(x*2,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+d+",-"+d+w+"-"+d+","+d+w+d+","+d+w+d+",-"+d+w+"-"+d+",-"+d+"Z")}},"star-diamond":{n:22,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2),k=y(x*1.9,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+d+",0"+w+"0,"+d+w+d+",0"+w+"0,-"+d+w+"-"+d+",0Z")}},"diamond-tall":{n:23,f:function(x,_,A){if(o(_))return z;var d=y(x*.7,2),k=y(x*1.4,2);return b(_,A,"M0,"+k+"L"+d+",0L0,-"+k+"L-"+d+",0Z")}},"diamond-wide":{n:24,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2),k=y(x*.7,2);return b(_,A,"M0,"+k+"L"+d+",0L0,-"+k+"L-"+d+",0Z")}},hourglass:{n:25,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"H-"+d+"L"+d+",-"+d+"H-"+d+"Z")},noDot:!0},bowtie:{n:26,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"V-"+d+"L-"+d+","+d+"V-"+d+"Z")},noDot:!0},"circle-cross":{n:27,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d+"M"+d+",0A"+d+","+d+" 0 1,1 0,-"+d+"A"+d+","+d+" 0 0,1 "+d+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x/P,2);return b(_,A,"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k+"M"+d+",0A"+d+","+d+" 0 1,1 0,-"+d+"A"+d+","+d+" 0 0,1 "+d+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d+"M"+d+","+d+"H-"+d+"V-"+d+"H"+d+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"L-"+d+",-"+d+"M"+d+",-"+d+"L-"+d+","+d+"M"+d+","+d+"H-"+d+"V-"+d+"H"+d+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(x,_,A){if(o(_))return z;var d=y(x*1.3,2);return b(_,A,"M"+d+",0L0,"+d+"L-"+d+",0L0,-"+d+"ZM0,-"+d+"V"+d+"M-"+d+",0H"+d)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(x,_,A){if(o(_))return z;var d=y(x*1.3,2),k=y(x*.65,2);return b(_,A,"M"+d+",0L0,"+d+"L-"+d+",0L0,-"+d+"ZM-"+k+",-"+k+"L"+k+","+k+"M-"+k+","+k+"L"+k+",-"+k)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"L-"+d+",-"+d+"M"+d+",-"+d+"L-"+d+","+d)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*.85,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d+"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(x,_,A){if(o(_))return z;var d=y(x/2,2),k=y(x,2);return b(_,A,"M"+d+","+k+"V-"+k+"M"+(d-k)+",-"+k+"V"+k+"M"+k+","+d+"H-"+k+"M-"+k+","+(d-k)+"H"+k)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+d+","+w+"L0,0M"+d+","+w+"L0,0M0,-"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+d+",-"+w+"L0,0M"+d+",-"+w+"L0,0M0,"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M"+w+","+d+"L0,0M"+w+",-"+d+"L0,0M-"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+w+","+d+"L0,0M-"+w+",-"+d+"L0,0M"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2);return b(_,A,"M"+d+",0H-"+d)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2);return b(_,A,"M0,"+d+"V-"+d)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+",-"+d+"L-"+d+","+d)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"L-"+d+",-"+d)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+d+","+k+"H"+d+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+d+",-"+k+"H"+d+"Z")},noDot:!0},"arrow-left":{n:47,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L"+d+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-right":{n:48,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L-"+d+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M-"+d+",0H"+d+"M0,0L-"+d+","+k+"H"+d+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M-"+d+",0H"+d+"M0,0L-"+d+",-"+k+"H"+d+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L"+d+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L-"+d+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(x,_,A){if(o(_))return z;var d=i/2.5,k=2*x*a(d),w=2*x*l(d);return b(_,A,"M0,0L"+-k+","+w+"L"+k+","+w+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(x,_,A){if(o(_))return z;var d=i/4,k=2*x*a(d),w=2*x*l(d);return b(_,A,"M0,0L"+-k+","+w+"A "+2*x+","+2*x+" 0 0 1 "+k+","+w+"Z")},backoff:.4,noDot:!0}};function o(x){return x===null}var c,s,h,m;function b(x,_,A){if((!x||x%360===0)&&!_)return A;if(h===x&&m===_&&c===A)return s;h=x,m=_,c=A;function d(U,V){var W=a(U),F=l(U),H=V[0],q=V[1]+(_||0);return[H*W-q*F,H*F+q*W]}for(var k=x/180*i,w=0,D=0,E=f(A),I="",M=0;M{var f=Br(),y=jn(),z=y.numberFormat,P=Sr(),n=Xi(),i=ls(),a=Hn(),l=ch(),o=y.strTranslate,c=uu(),s=k0(),h=Rd(),m=h.LINE_SPACING,b=Qa().DESELECTDIM,x=Fu(),_=Hv(),A=T0().appendArrayPointValue,d=Y.exports={};d.font=function(Mt,Ot){var Lt=Ot.variant,ie=Ot.style,be=Ot.weight,ce=Ot.color,Le=Ot.size,Ze=Ot.family,Qe=Ot.shadow,mr=Ot.lineposition,fr=Ot.textcase;Ze&&Mt.style("font-family",Ze),Le+1&&Mt.style("font-size",Le+"px"),ce&&Mt.call(a.fill,ce),be&&Mt.style("font-weight",be),ie&&Mt.style("font-style",ie),Lt&&Mt.style("font-variant",Lt),fr&&Mt.style("text-transform",k(D(fr))),Qe&&Mt.style("text-shadow",Qe==="auto"?c.makeTextShadow(a.contrast(ce)):k(Qe)),mr&&Mt.style("text-decoration-line",k(E(mr)))};function k(Mt){return Mt==="none"?void 0:Mt}var w={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function D(Mt){return w[Mt]}function E(Mt){return Mt.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}d.setPosition=function(Mt,Ot,Lt){Mt.attr("x",Ot).attr("y",Lt)},d.setSize=function(Mt,Ot,Lt){Mt.attr("width",Ot).attr("height",Lt)},d.setRect=function(Mt,Ot,Lt,ie,be){Mt.call(d.setPosition,Ot,Lt).call(d.setSize,ie,be)},d.translatePoint=function(Mt,Ot,Lt,ie){var be=Lt.c2p(Mt.x),ce=ie.c2p(Mt.y);if(P(be)&&P(ce)&&Ot.node())Ot.node().nodeName==="text"?Ot.attr("x",be).attr("y",ce):Ot.attr("transform",o(be,ce));else return!1;return!0},d.translatePoints=function(Mt,Ot,Lt){Mt.each(function(ie){var be=f.select(this);d.translatePoint(ie,be,Ot,Lt)})},d.hideOutsideRangePoint=function(Mt,Ot,Lt,ie,be,ce){Ot.attr("display",Lt.isPtWithinRange(Mt,be)&&ie.isPtWithinRange(Mt,ce)?null:"none")},d.hideOutsideRangePoints=function(Mt,Ot){if(Ot._hasClipOnAxisFalse){var Lt=Ot.xaxis,ie=Ot.yaxis;Mt.each(function(be){var ce=be[0].trace,Le=ce.xcalendar,Ze=ce.ycalendar,Qe=i.traceIs(ce,"bar-like")?".bartext":".point,.textpoint";Mt.selectAll(Qe).each(function(mr){d.hideOutsideRangePoint(mr,f.select(this),Lt,ie,Le,Ze)})})}},d.crispRound=function(Mt,Ot,Lt){return!Ot||!P(Ot)?Lt||0:Mt._context.staticPlot?Ot:Ot<1?1:Math.round(Ot)},d.singleLineStyle=function(Mt,Ot,Lt,ie,be){Ot.style("fill","none");var ce=(((Mt||[])[0]||{}).trace||{}).line||{},Le=Lt||ce.width||0,Ze=be||ce.dash||"";a.stroke(Ot,ie||ce.color),d.dashLine(Ot,Ze,Le)},d.lineGroupStyle=function(Mt,Ot,Lt,ie){Mt.style("fill","none").each(function(be){var ce=(((be||[])[0]||{}).trace||{}).line||{},Le=Ot||ce.width||0,Ze=ie||ce.dash||"";f.select(this).call(a.stroke,Lt||ce.color).call(d.dashLine,Ze,Le)})},d.dashLine=function(Mt,Ot,Lt){Lt=+Lt||0,Ot=d.dashStyle(Ot,Lt),Mt.style({"stroke-dasharray":Ot,"stroke-width":Lt+"px"})},d.dashStyle=function(Mt,Ot){Ot=+Ot||1;var Lt=Math.max(Ot,3);return Mt==="solid"?Mt="":Mt==="dot"?Mt=Lt+"px,"+Lt+"px":Mt==="dash"?Mt=3*Lt+"px,"+3*Lt+"px":Mt==="longdash"?Mt=5*Lt+"px,"+5*Lt+"px":Mt==="dashdot"?Mt=3*Lt+"px,"+Lt+"px,"+Lt+"px,"+Lt+"px":Mt==="longdashdot"&&(Mt=5*Lt+"px,"+2*Lt+"px,"+Lt+"px,"+2*Lt+"px"),Mt};function I(Mt,Ot,Lt,ie){var be=Ot.fillpattern,ce=Ot.fillgradient,Le=d.getPatternAttr,Ze=be&&(Le(be.shape,0,"")||Le(be.path,0,""));if(Ze){var Qe=Le(be.bgcolor,0,null),mr=Le(be.fgcolor,0,null),fr=be.fgopacity,Jr=Le(be.size,0,8),an=Le(be.solidity,0,.3),Er=Ot.uid;d.pattern(Mt,"point",Lt,Er,Ze,Jr,an,void 0,be.fillmode,Qe,mr,fr)}else if(ce&&ce.type!=="none"){var dn=ce.type,_n="scatterfill-"+Ot.uid;if(ie&&(_n="legendfill-"+Ot.uid),!ie&&(ce.start!==void 0||ce.stop!==void 0)){var Oe,Xt;dn==="horizontal"?(Oe={x:ce.start,y:0},Xt={x:ce.stop,y:0}):dn==="vertical"&&(Oe={x:0,y:ce.start},Xt={x:0,y:ce.stop}),Oe.x=Ot._xA.c2p(Oe.x===void 0?Ot._extremes.x.min[0].val:Oe.x,!0),Oe.y=Ot._yA.c2p(Oe.y===void 0?Ot._extremes.y.min[0].val:Oe.y,!0),Xt.x=Ot._xA.c2p(Xt.x===void 0?Ot._extremes.x.max[0].val:Xt.x,!0),Xt.y=Ot._yA.c2p(Xt.y===void 0?Ot._extremes.y.max[0].val:Xt.y,!0),Mt.call(B,Lt,_n,"linear",ce.colorscale,"fill",Oe,Xt,!0,!1)}else dn==="horizontal"&&(dn=dn+"reversed"),Mt.call(d.gradient,Lt,_n,dn,ce.colorscale,"fill")}else Ot.fillcolor&&Mt.call(a.fill,Ot.fillcolor)}d.singleFillStyle=function(Mt,Ot){var Lt=f.select(Mt.node()),ie=Lt.data(),be=((ie[0]||[])[0]||{}).trace||{};I(Mt,be,Ot,!1)},d.fillGroupStyle=function(Mt,Ot,Lt){Mt.style("stroke-width",0).each(function(ie){var be=f.select(this);ie[0].trace&&I(be,ie[0].trace,Ot,Lt)})};var M=Nu();d.symbolNames=[],d.symbolFuncs=[],d.symbolBackOffs=[],d.symbolNeedLines={},d.symbolNoDot={},d.symbolNoFill={},d.symbolList=[],Object.keys(M).forEach(function(Mt){var Ot=M[Mt],Lt=Ot.n;d.symbolList.push(Lt,String(Lt),Mt,Lt+100,String(Lt+100),Mt+"-open"),d.symbolNames[Lt]=Mt,d.symbolFuncs[Lt]=Ot.f,d.symbolBackOffs[Lt]=Ot.backoff||0,Ot.needLine&&(d.symbolNeedLines[Lt]=!0),Ot.noDot?d.symbolNoDot[Lt]=!0:d.symbolList.push(Lt+200,String(Lt+200),Mt+"-dot",Lt+300,String(Lt+300),Mt+"-open-dot"),Ot.noFill&&(d.symbolNoFill[Lt]=!0)});var p=d.symbolNames.length,g="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";d.symbolNumber=function(Mt){if(P(Mt))Mt=+Mt;else if(typeof Mt=="string"){var Ot=0;Mt.indexOf("-open")>0&&(Ot=100,Mt=Mt.replace("-open","")),Mt.indexOf("-dot")>0&&(Ot+=200,Mt=Mt.replace("-dot","")),Mt=d.symbolNames.indexOf(Mt),Mt>=0&&(Mt+=Ot)}return Mt%100>=p||Mt>=400?0:Math.floor(Math.max(Mt,0))};function C(Mt,Ot,Lt,ie){var be=Mt%100;return d.symbolFuncs[be](Ot,Lt,ie)+(Mt>=200?g:"")}var S=z("~f"),N={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};d.gradient=function(Mt,Ot,Lt,ie,be,ce){var Le=N[ie];return B(Mt,Ot,Lt,Le.type,be,ce,Le.start,Le.stop,!1,Le.reversed)};function B(Mt,Ot,Lt,ie,be,ce,Le,Ze,Qe,mr){var fr=be.length,Jr;ie==="linear"?Jr={node:"linearGradient",attrs:{x1:Le.x,y1:Le.y,x2:Ze.x,y2:Ze.y,gradientUnits:Qe?"userSpaceOnUse":"objectBoundingBox"},reversed:mr}:ie==="radial"&&(Jr={node:"radialGradient",reversed:mr});for(var an=new Array(fr),Er=0;Er=0&&Mt.i===void 0&&(Mt.i=ce.i),Ot.style("opacity",ie.selectedOpacityFn?ie.selectedOpacityFn(Mt):Mt.mo===void 0?Le.opacity:Mt.mo),ie.ms2mrc){var Qe;Mt.ms==="various"||Le.size==="various"?Qe=3:Qe=ie.ms2mrc(Mt.ms),Mt.mrc=Qe,ie.selectedSizeFn&&(Qe=Mt.mrc=ie.selectedSizeFn(Mt));var mr=d.symbolNumber(Mt.mx||Le.symbol)||0;Mt.om=mr%200>=100;var fr=ue(Mt,Lt),Jr=mt(Mt,Lt);Ot.attr("d",C(mr,Qe,fr,Jr))}var an=!1,Er,dn,_n;if(Mt.so)_n=Ze.outlierwidth,dn=Ze.outliercolor,Er=Le.outliercolor;else{var Oe=(Ze||{}).width;_n=(Mt.mlw+1||Oe+1||(Mt.trace?(Mt.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Mt?dn=Mt.mlcc=ie.lineScale(Mt.mlc):y.isArrayOrTypedArray(Ze.color)?dn=a.defaultLine:dn=Ze.color,y.isArrayOrTypedArray(Le.color)&&(Er=a.defaultLine,an=!0),"mc"in Mt?Er=Mt.mcc=ie.markerScale(Mt.mc):Er=Le.color||Le.colors||"rgba(0,0,0,0)",ie.selectedColorFn&&(Er=ie.selectedColorFn(Mt))}if(Mt.om)Ot.call(a.stroke,Er).style({"stroke-width":(_n||1)+"px",fill:"none"});else{Ot.style("stroke-width",(Mt.isBlank?0:_n)+"px");var Xt=Le.gradient,oe=Mt.mgt;oe?an=!0:oe=Xt&&Xt.type,y.isArrayOrTypedArray(oe)&&(oe=oe[0],N[oe]||(oe=0));var zt=Le.pattern,_t=d.getPatternAttr,Pt=zt&&(_t(zt.shape,Mt.i,"")||_t(zt.path,Mt.i,""));if(oe&&oe!=="none"){var Ht=Mt.mgc;Ht?an=!0:Ht=Xt.color;var ae=Lt.uid;an&&(ae+="-"+Mt.i),d.gradient(Ot,be,ae,oe,[[0,Ht],[1,Er]],"fill")}else if(Pt){var he=!1,Me=zt.fgcolor;!Me&&ce&&ce.color&&(Me=ce.color,he=!0);var qe=_t(Me,Mt.i,ce&&ce.color||null),Ye=_t(zt.bgcolor,Mt.i,null),ur=zt.fgopacity,Rr=_t(zt.size,Mt.i,8),zr=_t(zt.solidity,Mt.i,.3);he=he||Mt.mcc||y.isArrayOrTypedArray(zt.shape)||y.isArrayOrTypedArray(zt.path)||y.isArrayOrTypedArray(zt.bgcolor)||y.isArrayOrTypedArray(zt.fgcolor)||y.isArrayOrTypedArray(zt.size)||y.isArrayOrTypedArray(zt.solidity);var xr=Lt.uid;he&&(xr+="-"+Mt.i),d.pattern(Ot,"point",be,xr,Pt,Rr,zr,Mt.mcc,zt.fillmode,Ye,qe,ur)}else y.isArrayOrTypedArray(Er)?a.fill(Ot,Er[Mt.i]):a.fill(Ot,Er);_n&&a.stroke(Ot,dn)}},d.makePointStyleFns=function(Mt){var Ot={},Lt=Mt.marker;return Ot.markerScale=d.tryColorscale(Lt,""),Ot.lineScale=d.tryColorscale(Lt,"line"),i.traceIs(Mt,"symbols")&&(Ot.ms2mrc=x.isBubble(Mt)?_(Mt):function(){return(Lt.size||6)/2}),Mt.selectedpoints&&y.extendFlat(Ot,d.makeSelectedPointStyleFns(Mt)),Ot},d.makeSelectedPointStyleFns=function(Mt){var Ot={},Lt=Mt.selected||{},ie=Mt.unselected||{},be=Mt.marker||{},ce=Lt.marker||{},Le=ie.marker||{},Ze=be.opacity,Qe=ce.opacity,mr=Le.opacity,fr=Qe!==void 0,Jr=mr!==void 0;(y.isArrayOrTypedArray(Ze)||fr||Jr)&&(Ot.selectedOpacityFn=function(_t){var Pt=_t.mo===void 0?be.opacity:_t.mo;return _t.selected?fr?Qe:Pt:Jr?mr:b*Pt});var an=be.color,Er=ce.color,dn=Le.color;(Er||dn)&&(Ot.selectedColorFn=function(_t){var Pt=_t.mcc||an;return _t.selected?Er||Pt:dn||Pt});var _n=be.size,Oe=ce.size,Xt=Le.size,oe=Oe!==void 0,zt=Xt!==void 0;return i.traceIs(Mt,"symbols")&&(oe||zt)&&(Ot.selectedSizeFn=function(_t){var Pt=_t.mrc||_n/2;return _t.selected?oe?Oe/2:Pt:zt?Xt/2:Pt}),Ot},d.makeSelectedTextStyleFns=function(Mt){var Ot={},Lt=Mt.selected||{},ie=Mt.unselected||{},be=Mt.textfont||{},ce=Lt.textfont||{},Le=ie.textfont||{},Ze=be.color,Qe=ce.color,mr=Le.color;return Ot.selectedTextColorFn=function(fr){var Jr=fr.tc||Ze;return fr.selected?Qe||Jr:mr||(Qe?Jr:a.addOpacity(Jr,b))},Ot},d.selectedPointStyle=function(Mt,Ot){if(!(!Mt.size()||!Ot.selectedpoints)){var Lt=d.makeSelectedPointStyleFns(Ot),ie=Ot.marker||{},be=[];Lt.selectedOpacityFn&&be.push(function(ce,Le){ce.style("opacity",Lt.selectedOpacityFn(Le))}),Lt.selectedColorFn&&be.push(function(ce,Le){a.fill(ce,Lt.selectedColorFn(Le))}),Lt.selectedSizeFn&&be.push(function(ce,Le){var Ze=Le.mx||ie.symbol||0,Qe=Lt.selectedSizeFn(Le);ce.attr("d",C(d.symbolNumber(Ze),Qe,ue(Le,Ot),mt(Le,Ot))),Le.mrc2=Qe}),be.length&&Mt.each(function(ce){for(var Le=f.select(this),Ze=0;Ze0?Lt:0}d.textPointStyle=function(Mt,Ot,Lt){if(Mt.size()){var ie;if(Ot.selectedpoints){var be=d.makeSelectedTextStyleFns(Ot);ie=be.selectedTextColorFn}var ce=Ot.texttemplate,Le=Lt._fullLayout;Mt.each(function(Ze){var Qe=f.select(this),mr=ce?y.extractOption(Ze,Ot,"txt","texttemplate"):y.extractOption(Ze,Ot,"tx","text");if(!mr&&mr!==0){Qe.remove();return}if(ce){var fr=Ot._module.formatLabels,Jr=fr?fr(Ze,Ot,Le):{},an={};A(an,Ot,Ze.i),mr=y.texttemplateString({data:[an,Ze,Ot._meta],fallback:Ot.texttemplatefallback,labels:Jr,locale:Le._d3locale,template:mr})}var Er=Ze.tp||Ot.textposition,dn=W(Ze,Ot),_n=ie?ie(Ze):Ze.tc||Ot.textfont.color;Qe.call(d.font,{family:Ze.tf||Ot.textfont.family,weight:Ze.tw||Ot.textfont.weight,style:Ze.ty||Ot.textfont.style,variant:Ze.tv||Ot.textfont.variant,textcase:Ze.tC||Ot.textfont.textcase,lineposition:Ze.tE||Ot.textfont.lineposition,shadow:Ze.tS||Ot.textfont.shadow,size:dn,color:_n}).text(mr).call(c.convertToTspans,Lt).call(V,Er,dn,Ze.mrc)})}},d.selectedTextStyle=function(Mt,Ot){if(!(!Mt.size()||!Ot.selectedpoints)){var Lt=d.makeSelectedTextStyleFns(Ot);Mt.each(function(ie){var be=f.select(this),ce=Lt.selectedTextColorFn(ie),Le=ie.tp||Ot.textposition,Ze=W(ie,Ot);a.fill(be,ce);var Qe=i.traceIs(Ot,"bar-like");V(be,Le,Ze,ie.mrc2||ie.mrc,Qe)})}};var F=.5;d.smoothopen=function(Mt,Ot){if(Mt.length<3)return"M"+Mt.join("L");var Lt="M"+Mt[0],ie=[],be;for(be=1;be=Qe||_t>=fr&&_t<=Qe)&&(Pt<=Jr&&Pt>=mr||Pt>=Jr&&Pt<=mr)&&(Mt=[_t,Pt])}return Mt}d.applyBackoff=rt,d.makeTester=function(){var Mt=y.ensureSingleById(f.select("body"),"svg","js-plotly-tester",function(Lt){Lt.attr(s.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),Ot=y.ensureSingle(Mt,"path","js-reference-point",function(Lt){Lt.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});d.tester=Mt,d.testref=Ot},d.savedBBoxes={};var gt=0,it=1e4;d.bBox=function(Mt,Ot,Lt){Lt||(Lt=st(Mt));var ie;if(Lt){if(ie=d.savedBBoxes[Lt],ie)return y.extendFlat({},ie)}else if(Mt.childNodes.length===1){var be=Mt.childNodes[0];if(Lt=st(be),Lt){var ce=+be.getAttribute("x")||0,Le=+be.getAttribute("y")||0,Ze=be.getAttribute("transform");if(!Ze){var Qe=d.bBox(be,!1,Lt);return ce&&(Qe.left+=ce,Qe.right+=ce),Le&&(Qe.top+=Le,Qe.bottom+=Le),Qe}if(Lt+="~"+ce+"~"+Le+"~"+Ze,ie=d.savedBBoxes[Lt],ie)return y.extendFlat({},ie)}}var mr,fr;Ot?mr=Mt:(fr=d.tester.node(),mr=Mt.cloneNode(!0),fr.appendChild(mr)),f.select(mr).attr("transform",null).call(c.positionText,0,0);var Jr=mr.getBoundingClientRect(),an=d.testref.node().getBoundingClientRect();Ot||fr.removeChild(mr);var Er={height:Jr.height,width:Jr.width,left:Jr.left-an.left,top:Jr.top-an.top,right:Jr.right-an.left,bottom:Jr.bottom-an.top};return gt>=it&&(d.savedBBoxes={},gt=0),Lt&&(d.savedBBoxes[Lt]=Er),gt++,y.extendFlat({},Er)};function st(Mt){var Ot=Mt.getAttribute("data-unformatted");if(Ot!==null)return Ot+Mt.getAttribute("data-math")+Mt.getAttribute("text-anchor")+Mt.getAttribute("style")}d.setClipUrl=function(Mt,Ot,Lt){Mt.attr("clip-path",xt(Ot,Lt))};function xt(Mt,Ot){if(!Mt)return null;var Lt=Ot._context,ie=Lt._exportedPlot?"":Lt._baseUrl||"";return ie?"url('"+ie+"#"+Mt+"')":"url(#"+Mt+")"}d.getTranslate=function(Mt){var Ot=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,Lt=Mt.attr?"attr":"getAttribute",ie=Mt[Lt]("transform")||"",be=ie.replace(Ot,function(ce,Le,Ze){return[Le,Ze].join(" ")}).split(" ");return{x:+be[0]||0,y:+be[1]||0}},d.setTranslate=function(Mt,Ot,Lt){var ie=/(\btranslate\(.*?\);?)/,be=Mt.attr?"attr":"getAttribute",ce=Mt.attr?"attr":"setAttribute",Le=Mt[be]("transform")||"";return Ot=Ot||0,Lt=Lt||0,Le=Le.replace(ie,"").trim(),Le+=o(Ot,Lt),Le=Le.trim(),Mt[ce]("transform",Le),Le},d.getScale=function(Mt){var Ot=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,Lt=Mt.attr?"attr":"getAttribute",ie=Mt[Lt]("transform")||"",be=ie.replace(Ot,function(ce,Le,Ze){return[Le,Ze].join(" ")}).split(" ");return{x:+be[0]||1,y:+be[1]||1}},d.setScale=function(Mt,Ot,Lt){var ie=/(\bscale\(.*?\);?)/,be=Mt.attr?"attr":"getAttribute",ce=Mt.attr?"attr":"setAttribute",Le=Mt[be]("transform")||"";return Ot=Ot||1,Lt=Lt||1,Le=Le.replace(ie,"").trim(),Le+="scale("+Ot+","+Lt+")",Le=Le.trim(),Mt[ce]("transform",Le),Le};var ot=/\s*sc.*/;d.setPointGroupScale=function(Mt,Ot,Lt){if(Ot=Ot||1,Lt=Lt||1,!!Mt){var ie=Ot===1&&Lt===1?"":"scale("+Ot+","+Lt+")";Mt.each(function(){var be=(this.getAttribute("transform")||"").replace(ot,"");be+=ie,be=be.trim(),this.setAttribute("transform",be)})}};var J=/translate\([^)]*\)\s*$/;d.setTextPointsScale=function(Mt,Ot,Lt){Mt&&Mt.each(function(){var ie,be=f.select(this),ce=be.select("text");if(ce.node()){var Le=parseFloat(ce.attr("x")||0),Ze=parseFloat(ce.attr("y")||0),Qe=(be.attr("transform")||"").match(J);Ot===1&&Lt===1?ie=[]:ie=[o(Le,Ze),"scale("+Ot+","+Lt+")",o(-Le,-Ze)],Qe&&ie.push(Qe),be.attr("transform",ie.join(""))}})};function mt(Mt,Ot){var Lt;return Mt&&(Lt=Mt.mf),Lt===void 0&&(Lt=Ot.marker&&Ot.marker.standoff||0),!Ot._geo&&!Ot._xA?-Lt:Lt}d.getMarkerStandoff=mt;var dt=Math.atan2,Ct=Math.cos,Rt=Math.sin;function Bt(Mt,Ot){var Lt=Ot[0],ie=Ot[1];return[Lt*Ct(Mt)-ie*Rt(Mt),Lt*Rt(Mt)+ie*Ct(Mt)]}var Zt,Gt,ee,xe,ge,ye;function ue(Mt,Ot){var Lt=Mt.ma;Lt===void 0&&(Lt=Ot.marker.angle,(!Lt||y.isArrayOrTypedArray(Lt))&&(Lt=0));var ie,be,ce=Ot.marker.angleref;if(ce==="previous"||ce==="north"){if(Ot._geo){var Le=Ot._geo.project(Mt.lonlat);ie=Le[0],be=Le[1]}else{var Ze=Ot._xA,Qe=Ot._yA;if(Ze&&Qe)ie=Ze.c2p(Mt.x),be=Qe.c2p(Mt.y);else return 90}if(Ot._geo){var mr=Mt.lonlat[0],fr=Mt.lonlat[1],Jr=Ot._geo.project([mr,fr+1e-5]),an=Ot._geo.project([mr+1e-5,fr]),Er=dt(an[1]-be,an[0]-ie),dn=dt(Jr[1]-be,Jr[0]-ie),_n;if(ce==="north")_n=Lt/180*Math.PI;else if(ce==="previous"){var Oe=mr/180*Math.PI,Xt=fr/180*Math.PI,oe=Zt/180*Math.PI,zt=Gt/180*Math.PI,_t=oe-Oe,Pt=Ct(zt)*Rt(_t),Ht=Rt(zt)*Ct(Xt)-Ct(zt)*Rt(Xt)*Ct(_t);_n=-dt(Pt,Ht)-Math.PI,Zt=mr,Gt=fr}var ae=Bt(Er,[Ct(_n),0]),he=Bt(dn,[Rt(_n),0]);Lt=dt(ae[1]+he[1],ae[0]+he[0])/Math.PI*180,ce==="previous"&&!(ye===Ot.uid&&Mt.i===ge+1)&&(Lt=null)}if(ce==="previous"&&!Ot._geo)if(ye===Ot.uid&&Mt.i===ge+1&&P(ie)&&P(be)){var Me=ie-ee,qe=be-xe,Ye=Ot.line&&Ot.line.shape||"",ur=Ye.slice(Ye.length-1);ur==="h"&&(qe=0),ur==="v"&&(Me=0),Lt+=dt(qe,Me)/Math.PI*180+90}else Lt=null}return ee=ie,xe=be,ge=Mt.i,ye=Ot.uid,Lt}d.getMarkerAngle=ue}),jp=It((et,Y)=>{var f=Br(),y=Sr(),z=lh(),P=ls(),n=jn(),i=n.strTranslate,a=Js(),l=Hn(),o=uu(),c=Qa(),s=Rd().OPPOSITE_SIDE,h=/ [XY][0-9]* /,m=1.6,b=1.6;function x(_,A,d){var k=_._fullLayout,w=d.propContainer,D=d.propName,E=d.placeholder,I=d.traceIndex,M=d.avoid||{},p=d.attributes,g=d.transform,C=d.containerGroup,S=1,N=w.title,B=(N&&N.text?N.text:"").trim(),U=!1,V=N&&N.font?N.font:{},W=V.family,F=V.size,H=V.color,q=V.weight,G=V.style,tt=V.variant,ht=V.textcase,bt=V.lineposition,vt=V.shadow,ut=d.subtitlePropName,rt=!!ut,gt=d.subtitlePlaceholder,it=(w.title||{}).subtitle||{text:"",font:{}},st=(it.text||"").trim(),xt=!1,ot=1,J=it.font,mt=J.family,dt=J.size,Ct=J.color,Rt=J.weight,Bt=J.style,Zt=J.variant,Gt=J.textcase,ee=J.lineposition,xe=J.shadow,ge;D==="title.text"?ge="titleText":D.indexOf("axis")!==-1?ge="axisTitleText":D.indexOf("colorbar")!==-1&&(ge="colorbarTitleText");var ye=_._context.edits[ge];function ue(an,Er){return an===void 0||Er===void 0?!1:an.replace(h," % ")===Er.replace(h," % ")}B===""?S=0:ue(B,E)&&(ye||(B=""),S=.2,U=!0),rt&&(st===""?ot=0:ue(st,gt)&&(ye||(st=""),ot=.2,xt=!0)),d._meta?B=n.templateString(B,d._meta):k._meta&&(B=n.templateString(B,k._meta));var Mt=B||st||ye,Ot;C||(C=n.ensureSingle(k._infolayer,"g","g-"+A),Ot=k._hColorbarMoveTitle);var Lt=C.selectAll("text."+A).data(Mt?[0]:[]);Lt.enter().append("text"),Lt.text(B).attr("class",A),Lt.exit().remove();var ie=null,be=A+"-subtitle",ce=st||ye;if(rt&&(ie=C.selectAll("text."+be).data(ce?[0]:[]),ie.enter().append("text"),ie.text(st).attr("class",be),ie.exit().remove()),!Mt)return C;function Le(an,Er){n.syncOrAsync([Ze,Qe],{title:an,subtitle:Er})}function Ze(an){var Er=an.title,dn=an.subtitle,_n;!g&&Ot&&(g={}),g?(_n="",g.rotate&&(_n+="rotate("+[g.rotate,p.x,p.y]+")"),(g.offset||Ot)&&(_n+=i(0,(g.offset||0)-(Ot||0)))):_n=null,Er.attr("transform",_n);function Oe(Ht){if(Ht){var ae=f.select(Ht.node().parentNode).select("."+be);if(!ae.empty()){var he=Ht.node().getBBox();if(he.height){var Me=he.y+he.height+m*dt;ae.attr("y",Me)}}}}if(Er.style("opacity",S*l.opacity(H)).call(a.font,{color:l.rgb(H),size:f.round(F,2),family:W,weight:q,style:G,variant:tt,textcase:ht,shadow:vt,lineposition:bt}).attr(p).call(o.convertToTspans,_,Oe),dn&&!dn.empty()){var Xt=C.select("."+A+"-math-group"),oe=Er.node().getBBox(),zt=Xt.node()?Xt.node().getBBox():void 0,_t=zt?zt.y+zt.height+m*dt:oe.y+oe.height+b*dt,Pt=n.extendFlat({},p,{y:_t});dn.attr("transform",_n),dn.style("opacity",ot*l.opacity(Ct)).call(a.font,{color:l.rgb(Ct),size:f.round(dt,2),family:mt,weight:Rt,style:Bt,variant:Zt,textcase:Gt,shadow:xe,lineposition:ee}).attr(Pt).call(o.convertToTspans,_)}return z.previousPromises(_)}function Qe(an){var Er=an.title,dn=f.select(Er.node().parentNode);if(M&&M.selection&&M.side&&B){dn.attr("transform",null);var _n=s[M.side],Oe=M.side==="left"||M.side==="top"?-1:1,Xt=y(M.pad)?M.pad:2,oe=a.bBox(dn.node()),zt={t:0,b:0,l:0,r:0},_t=_._fullLayout._reservedMargin;for(var Pt in _t)for(var Ht in _t[Pt]){var ae=_t[Pt][Ht];zt[Ht]=Math.max(zt[Ht],ae)}var he={left:zt.l,top:zt.t,right:k.width-zt.r,bottom:k.height-zt.b},Me=M.maxShift||Oe*(he[M.side]-oe[M.side]),qe=0;if(Me<0)qe=Me;else{var Ye=M.offsetLeft||0,ur=M.offsetTop||0;oe.left-=Ye,oe.right-=Ye,oe.top-=ur,oe.bottom-=ur,M.selection.each(function(){var zr=a.bBox(this);n.bBoxIntersect(oe,zr,Xt)&&(qe=Math.max(qe,Oe*(zr[M.side]-oe[_n])+Xt))}),qe=Math.min(Me,qe),w._titleScoot=Math.abs(qe)}if(qe>0||Me<0){var Rr={left:[-qe,0],right:[qe,0],top:[0,-qe],bottom:[0,qe]}[M.side];dn.attr("transform",i(Rr[0],Rr[1]))}}}Lt.call(Le,ie);function mr(an,Er){an.text(Er).on("mouseover.opacity",function(){f.select(this).transition().duration(c.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){f.select(this).transition().duration(c.HIDE_PLACEHOLDER).style("opacity",0)})}if(ye&&(B?Lt.on(".opacity",null):(mr(Lt,E),U=!0),Lt.call(o.makeEditable,{gd:_}).on("edit",function(an){I!==void 0?P.call("_guiRestyle",_,D,an,I):P.call("_guiRelayout",_,D,an)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Le)}).on("input",function(an){this.text(an||" ").call(o.positionText,p.x,p.y)}),rt)){if(rt&&!B){var fr=Lt.node().getBBox(),Jr=fr.y+fr.height+b*dt;ie.attr("y",Jr)}st?ie.on(".opacity",null):(mr(ie,gt),xt=!0),ie.call(o.makeEditable,{gd:_}).on("edit",function(an){P.call("_guiRelayout",_,"title.subtitle.text",an)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Le)}).on("input",function(an){this.text(an||" ").call(o.positionText,ie.attr("x"),ie.attr("y"))})}return Lt.classed("js-placeholder",U),ie&&!ie.empty()&&ie.classed("js-placeholder",xt),C}Y.exports={draw:x,SUBTITLE_PADDING_EM:b,SUBTITLE_PADDING_MATHJAX_EM:m}}),G0=It((et,Y)=>{var f=Br(),y=on().utcFormat,z=jn(),P=z.numberFormat,n=Sr(),i=z.cleanNumber,a=z.ms2DateTime,l=z.dateTime2ms,o=z.ensureNumber,c=z.isArrayOrTypedArray,s=Dr(),h=s.FP_SAFE,m=s.BADNUM,b=s.LOG_CLIP,x=s.ONEWEEK,_=s.ONEDAY,A=s.ONEHOUR,d=s.ONEMIN,k=s.ONESEC,w=Ku(),D=fu(),E=D.HOUR_PATTERN,I=D.WEEKDAY_PATTERN;function M(g){return Math.pow(10,g)}function p(g){return g!=null}Y.exports=function(g,C){C=C||{};var S=g._id||"x",N=S.charAt(0);function B(it,st){if(it>0)return Math.log(it)/Math.LN10;if(it<=0&&st&&g.range&&g.range.length===2){var xt=g.range[0],ot=g.range[1];return .5*(xt+ot-2*b*Math.abs(xt-ot))}else return m}function U(it,st,xt,ot){if((ot||{}).msUTC&&n(it))return+it;var J=l(it,xt||g.calendar);if(J===m)if(n(it)){it=+it;var mt=Math.floor(z.mod(it+.05,1)*10),dt=Math.round(it-mt/10);J=l(new Date(dt))+mt/10}else return m;return J}function V(it,st,xt){return a(it,st,xt||g.calendar)}function W(it){return g._categories[Math.round(it)]}function F(it){if(p(it)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[it]!==void 0)return g._categoriesMap[it];g._categories.push(typeof it=="number"?String(it):it);var st=g._categories.length-1;return g._categoriesMap[it]=st,st}return m}function H(it,st){for(var xt=new Array(st),ot=0;otg.range[1]&&(xt=!xt);for(var ot=xt?-1:1,J=ot*it,mt=0,dt=0;dtRt)mt=dt+1;else{mt=J<(Ct+Rt)/2?dt:dt+1;break}}var Bt=g._B[mt]||0;return isFinite(Bt)?ht(it,g._m2,Bt):0},ut=function(it){var st=g._rangebreaks.length;if(!st)return bt(it,g._m,g._b);for(var xt=0,ot=0;otg._rangebreaks[ot].pmax&&(xt=ot+1);return bt(it,g._m2,g._B[xt])}}g.c2l=g.type==="log"?B:o,g.l2c=g.type==="log"?M:o,g.l2p=vt,g.p2l=ut,g.c2p=g.type==="log"?function(it,st){return vt(B(it,st))}:vt,g.p2c=g.type==="log"?function(it){return M(ut(it))}:ut,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=i,g.c2d=g.c2r=g.l2d=g.l2r=o,g.d2p=g.r2p=function(it){return g.l2p(i(it))},g.p2d=g.p2r=ut,g.cleanPos=o):g.type==="log"?(g.d2r=g.d2l=function(it,st){return B(i(it),st)},g.r2d=g.r2c=function(it){return M(i(it))},g.d2c=g.r2l=i,g.c2d=g.l2r=o,g.c2r=B,g.l2d=M,g.d2p=function(it,st){return g.l2p(g.d2r(it,st))},g.p2d=function(it){return M(ut(it))},g.r2p=function(it){return g.l2p(i(it))},g.p2r=ut,g.cleanPos=o):g.type==="date"?(g.d2r=g.r2d=z.identity,g.d2c=g.r2c=g.d2l=g.r2l=U,g.c2d=g.c2r=g.l2d=g.l2r=V,g.d2p=g.r2p=function(it,st,xt){return g.l2p(U(it,0,xt))},g.p2d=g.p2r=function(it,st,xt){return V(ut(it),st,xt)},g.cleanPos=function(it){return z.cleanDate(it,m,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=F,g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(it){var st=tt(it);return st!==void 0?st:g.fraction2r(.5)},g.l2r=g.c2r=o,g.r2l=tt,g.d2p=function(it){return g.l2p(g.r2c(it))},g.p2d=function(it){return W(ut(it))},g.r2p=g.d2p,g.p2r=ut,g.cleanPos=function(it){return typeof it=="string"&&it!==""?it:o(it)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(it){var st=G(it);return st!==void 0?st:g.fraction2r(.5)},g.r2c_just_indices=q,g.l2r=g.c2r=o,g.r2l=G,g.d2p=function(it){return g.l2p(g.r2c(it))},g.p2d=function(it){return W(ut(it))},g.r2p=g.d2p,g.p2r=ut,g.cleanPos=function(it){return Array.isArray(it)||typeof it=="string"&&it!==""?it:o(it)},g.setupMultiCategory=function(it){var st=g._traceIndices,xt,ot,J=g._matchGroup;if(J&&g._categories.length===0){for(var mt in J)if(mt!==S){var dt=C[w.id2name(mt)];st=st.concat(dt._traceIndices)}}var Ct=[[0,{}],[0,{}]],Rt=[];for(xt=0;xtdt[1]&&(ot[mt?0:1]=xt),ot[0]===ot[1]){var Ct=g.l2r(st),Rt=g.l2r(xt);if(st!==void 0){var Bt=Ct+1;xt!==void 0&&(Bt=Math.min(Bt,Rt)),ot[mt?1:0]=Bt}if(xt!==void 0){var Zt=Rt+1;st!==void 0&&(Zt=Math.max(Zt,Ct)),ot[mt?0:1]=Zt}}}},g.cleanRange=function(it,st){g._cleanRange(it,st),g.limitRange(it)},g._cleanRange=function(it,st){st||(st={}),it||(it="range");var xt=z.nestedProperty(g,it).get(),ot,J;if(g.type==="date"?J=z.dfltRange(g.calendar):N==="y"?J=D.DFLTRANGEY:g._name==="realaxis"?J=[0,1]:J=st.dfltRange||D.DFLTRANGEX,J=J.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(J[0]=0),!xt||xt.length!==2){z.nestedProperty(g,it).set(J);return}var mt=xt[0]===null,dt=xt[1]===null;for(g.type==="date"&&!g.autorange&&(xt[0]=z.cleanDate(xt[0],m,g.calendar),xt[1]=z.cleanDate(xt[1],m,g.calendar)),ot=0;ot<2;ot++)if(g.type==="date"){if(!z.isDateTime(xt[ot],g.calendar)){g[it]=J;break}if(g.r2l(xt[0])===g.r2l(xt[1])){var Ct=z.constrain(g.r2l(xt[0]),z.MIN_MS+1e3,z.MAX_MS-1e3);xt[0]=g.l2r(Ct-1e3),xt[1]=g.l2r(Ct+1e3);break}}else{if(!n(xt[ot]))if(!(mt||dt)&&n(xt[1-ot]))xt[ot]=xt[1-ot]*(ot?10:.1);else{g[it]=J;break}if(xt[ot]<-h?xt[ot]=-h:xt[ot]>h&&(xt[ot]=h),xt[0]===xt[1]){var Rt=Math.max(1,Math.abs(xt[0]*1e-6));xt[0]-=Rt,xt[1]+=Rt}}},g.setScale=function(it){var st=C._size;if(g.overlaying){var xt=w.getFromId({_fullLayout:C},g.overlaying);g.domain=xt.domain}var ot=it&&g._r?"_r":"range",J=g.calendar;g.cleanRange(ot);var mt=g.r2l(g[ot][0],J),dt=g.r2l(g[ot][1],J),Ct=N==="y";if(Ct?(g._offset=st.t+(1-g.domain[1])*st.h,g._length=st.h*(g.domain[1]-g.domain[0]),g._m=g._length/(mt-dt),g._b=-g._m*dt):(g._offset=st.l+g.domain[0]*st.w,g._length=st.w*(g.domain[1]-g.domain[0]),g._m=g._length/(dt-mt),g._b=-g._m*mt),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Rt,Bt;if(g._rangebreaks=g.locateBreaks(Math.min(mt,dt),Math.max(mt,dt)),g._rangebreaks.length){for(Rt=0;Rtdt&&(Zt=!Zt),Zt&&g._rangebreaks.reverse();var Gt=Zt?-1:1;for(g._m2=Gt*g._length/(Math.abs(dt-mt)-g._lBreaks),g._B.push(-g._m2*(Ct?dt:mt)),Rt=0;RtJ&&(J+=7,mtJ&&(J+=24,mt=ot&&mt=ot&&it=ce.min&&(Otce.max&&(ce.max=Lt),ie=!1)}ie&&dt.push({min:Ot,max:Lt})}};for(xt=0;xt{var f=Sr(),y=jn(),z=Dr().BADNUM,P=y.isArrayOrTypedArray,n=y.isDateTime,i=y.cleanNumber,a=Math.round;Y.exports=function(b,x,_){var A=b,d=_.noMultiCategory;if(P(A)&&!A.length)return"-";if(!d&&m(A))return"multicategory";if(d&&Array.isArray(A[0])){for(var k=[],w=0;wk*2}function s(b){return Math.max(1,(b-1)/1e3)}function h(b,x){for(var _=b.length,A=s(_),d=0,k=0,w={},D=0;D<_;D+=A){var E=a(D),I=b[E],M=String(I);if(!w[M]){w[M]=1;var p=typeof I;p==="boolean"?k++:(x?i(I)!==z:p==="number")?d++:p==="string"&&k++}}return k>d*2}function m(b){return P(b[0])&&P(b[1])}}),Jm=It((et,Y)=>{var f=Br(),y=Sr(),z=jn(),P=Dr().FP_SAFE,n=ls(),i=Js(),a=Ku(),l=a.getFromId,o=a.isLinked;Y.exports={applyAutorangeOptions:C,getAutoRange:c,makePadFn:h,doAutoRange:_,findExtremes:A,concatExtremes:x};function c(S,N){var B,U,V=[],W=S._fullLayout,F=h(W,N,0),H=h(W,N,1),q=x(S,N),G=q.min,tt=q.max;if(G.length===0||tt.length===0)return z.simpleMap(N.range,N.r2l);var ht=G[0].val,bt=tt[0].val;for(B=1;B0&&(Bt=xt-F(mt)-H(dt),Bt>ot?Zt/Bt>J&&(Ct=mt,Rt=dt,J=Zt/Bt):Zt/xt>J&&(Ct={val:mt.val,nopad:1},Rt={val:dt.val,nopad:1},J=Zt/xt));function Gt(ue,Mt){return Math.max(ue,H(Mt))}if(ht===bt){var ee=ht-1,xe=ht+1;if(it)if(ht===0)V=[0,1];else{var ge=(ht>0?tt:G).reduce(Gt,0),ye=ht/(1-Math.min(.5,ge/xt));V=ht>0?[0,ye]:[ye,0]}else st?V=[Math.max(0,ee),Math.max(1,xe)]:V=[ee,xe]}else it?(Ct.val>=0&&(Ct={val:0,nopad:1}),Rt.val<=0&&(Rt={val:0,nopad:1})):st&&(Ct.val-J*F(Ct)<0&&(Ct={val:0,nopad:1}),Rt.val<=0&&(Rt={val:1,nopad:1})),J=(Rt.val-Ct.val-s(N,mt.val,dt.val))/(xt-F(Ct)-H(Rt)),V=[Ct.val-J*F(Ct),Rt.val+J*H(Rt)];return V=C(V,N),N.limitRange&&N.limitRange(),ut&&V.reverse(),z.simpleMap(V,N.l2r||Number)}function s(S,N,B){var U=0;if(S.rangebreaks)for(var V=S.locateBreaks(N,B),W=0;W0?B.ppadplus:B.ppadminus)||B.ppad||0),mt=ot((S._m>0?B.ppadminus:B.ppadplus)||B.ppad||0),dt=ot(B.vpadplus||B.vpad),Ct=ot(B.vpadminus||B.vpad);if(!G){if(st=1/0,xt=-1/0,q)for(ht=0;ht0&&(st=bt),bt>xt&&bt-P&&(st=bt),bt>xt&&bt=Zt;ht--)Bt(ht);return{min:U,max:V,opts:B}}function d(S,N,B,U){w(S,N,B,U,E)}function k(S,N,B,U){w(S,N,B,U,I)}function w(S,N,B,U,V){for(var W=U.tozero,F=U.extrapad,H=!0,q=0;q=B&&(G.extrapad||!F)){H=!1;break}else V(N,G.val)&&G.pad<=B&&(F||!G.extrapad)&&(S.splice(q,1),q--)}if(H){var tt=W&&N===0;S.push({val:N,pad:tt?0:B,extrapad:tt?!1:F})}}function D(S){return y(S)&&Math.abs(S)=N}function M(S,N){var B=N.autorangeoptions;return B&&B.minallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.minallowed:B&&B.clipmin!==void 0&&g(N,B.clipmin,B.clipmax)?Math.max(S,N.d2l(B.clipmin)):S}function p(S,N){var B=N.autorangeoptions;return B&&B.maxallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.maxallowed:B&&B.clipmax!==void 0&&g(N,B.clipmin,B.clipmax)?Math.min(S,N.d2l(B.clipmax)):S}function g(S,N,B){return N!==void 0&&B!==void 0?(N=S.d2l(N),B=S.d2l(B),N=q&&(W=q,B=q),F<=q&&(F=q,U=q)}}return B=M(B,N),U=p(U,N),[B,U]}}),Fs=It((et,Y)=>{var f=Br(),y=Sr(),z=lh(),P=ls(),n=jn(),i=n.strTranslate,a=uu(),l=jp(),o=Hn(),c=Js(),s=Gf(),h=Xh(),m=Dr(),b=m.ONEMAXYEAR,x=m.ONEAVGYEAR,_=m.ONEMINYEAR,A=m.ONEMAXQUARTER,d=m.ONEAVGQUARTER,k=m.ONEMINQUARTER,w=m.ONEMAXMONTH,D=m.ONEAVGMONTH,E=m.ONEMINMONTH,I=m.ONEWEEK,M=m.ONEDAY,p=M/2,g=m.ONEHOUR,C=m.ONEMIN,S=m.ONESEC,N=m.ONEMILLI,B=m.ONEMICROSEC,U=m.MINUS_SIGN,V=m.BADNUM,W={K:"zeroline"},F={K:"gridline",L:"path"},H={K:"minor-gridline",L:"path"},q={K:"tick",L:"path"},G={K:"tick",L:"text"},tt={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},ht=Rd(),bt=ht.MID_SHIFT,vt=ht.CAP_SHIFT,ut=ht.LINE_SPACING,rt=ht.OPPOSITE_SIDE,gt=3,it=Y.exports={};it.setConvert=G0();var st=ty(),xt=Ku(),ot=xt.idSort,J=xt.isLinked;it.id2name=xt.id2name,it.name2id=xt.name2id,it.cleanId=xt.cleanId,it.list=xt.list,it.listIds=xt.listIds,it.getFromId=xt.getFromId,it.getFromTrace=xt.getFromTrace;var mt=Jm();it.getAutoRange=mt.getAutoRange,it.findExtremes=mt.findExtremes;var dt=1e-4;function Ct(Fe){var Re=(Fe[1]-Fe[0])*dt;return[Fe[0]-Re,Fe[1]+Re]}it.coerceRef=function(Fe,Re,Kr,sn,cn,Yr){var un=sn.charAt(sn.length-1),Pn=Kr._fullLayout._subplots[un+"axis"],bn=sn+"ref",ze={};return cn||(cn=Pn[0]||(typeof Yr=="string"?Yr:Yr[0])),Yr||(Yr=cn),Pn=Pn.concat(Pn.map(function(yr){return yr+" domain"})),ze[bn]={valType:"enumerated",values:Pn.concat(Yr?typeof Yr=="string"?[Yr]:Yr:[]),dflt:cn},n.coerce(Fe,Re,ze,bn)},it.getRefType=function(Fe){return Fe===void 0?Fe:Fe==="paper"?"paper":Fe==="pixel"?"pixel":/( domain)$/.test(Fe)?"domain":"range"},it.coercePosition=function(Fe,Re,Kr,sn,cn,Yr){var un,Pn,bn=it.getRefType(sn);if(bn!=="range")un=n.ensureNumber,Pn=Kr(cn,Yr);else{var ze=it.getFromId(Re,sn);Yr=ze.fraction2r(Yr),Pn=Kr(cn,Yr),un=ze.cleanPos}Fe[cn]=un(Pn)},it.cleanPosition=function(Fe,Re,Kr){var sn=Kr==="paper"||Kr==="pixel"?n.ensureNumber:it.getFromId(Re,Kr).cleanPos;return sn(Fe)},it.redrawComponents=function(Fe,Re){Re=Re||it.listIds(Fe);var Kr=Fe._fullLayout;function sn(cn,Yr,un,Pn){for(var bn=P.getComponentMethod(cn,Yr),ze={},yr=0;yr2e-6||((Kr-Fe._forceTick0)/Fe._minDtick%1+1.000001)%1>2e-6)&&(Fe._minDtick=0))},it.saveRangeInitial=function(Fe,Re){for(var Kr=it.list(Fe,"",!0),sn=!1,cn=0;cnen*.3||ze(sn)||ze(cn))){var Rn=Kr.dtick/2;Fe+=Fe+Rnun){var Pn=Number(Kr.substr(1));Yr.exactYears>un&&Pn%12===0?Fe=it.tickIncrement(Fe,"M6","reverse")+M*1.5:Yr.exactMonths>un?Fe=it.tickIncrement(Fe,"M1","reverse")+M*15.5:Fe-=p;var bn=it.tickIncrement(Fe,Kr);if(bn<=sn)return bn}return Fe}it.prepMinorTicks=function(Fe,Re,Kr){if(!Re.minor.dtick){delete Fe.dtick;var sn=Re.dtick&&y(Re._tmin),cn;if(sn){var Yr=it.tickIncrement(Re._tmin,Re.dtick,!0);cn=[Re._tmin,Yr*.99+Re._tmin*.01]}else{var un=n.simpleMap(Re.range,Re.r2l);cn=[un[0],.8*un[0]+.2*un[1]]}if(Fe.range=n.simpleMap(cn,Re.l2r),Fe._isMinor=!0,it.prepTicks(Fe,Kr),sn){var Pn=y(Re.dtick),bn=y(Fe.dtick),ze=Pn?Re.dtick:+Re.dtick.substring(1),yr=bn?Fe.dtick:+Fe.dtick.substring(1);Pn&&bn?xe(ze,yr)?ze===2*I&&yr===2*M&&(Fe.dtick=I):ze===2*I&&yr===3*M?Fe.dtick=I:ze===I&&!(Re._input.minor||{}).nticks?Fe.dtick=M:ge(ze/yr,2.5)?Fe.dtick=ze/2:Fe.dtick=ze:String(Re.dtick).charAt(0)==="M"?bn?Fe.dtick="M1":xe(ze,yr)?ze>=12&&yr===2&&(Fe.dtick="M3"):Fe.dtick=Re.dtick:String(Fe.dtick).charAt(0)==="L"?String(Re.dtick).charAt(0)==="L"?xe(ze,yr)||(Fe.dtick=ge(ze/yr,2.5)?Re.dtick/2:Re.dtick):Fe.dtick="D1":Fe.dtick==="D2"&&+Re.dtick>1&&(Fe.dtick=1)}Fe.range=Re.range}Re.minor._tick0Init===void 0&&(Fe.tick0=Re.tick0)};function xe(Fe,Re){return Math.abs((Fe/Re+.5)%1-.5)<.001}function ge(Fe,Re){return Math.abs(Fe/Re-1)<.001}it.prepTicks=function(Fe,Re){var Kr=n.simpleMap(Fe.range,Fe.r2l,void 0,void 0,Re);if(Fe.tickmode==="auto"||!Fe.dtick){var sn=Fe.nticks,cn;sn||(Fe.type==="category"||Fe.type==="multicategory"?(cn=Fe.tickfont?n.bigFont(Fe.tickfont.size||12):15,sn=Fe._length/cn):(cn=Fe._id.charAt(0)==="y"?40:80,sn=n.constrain(Fe._length/cn,4,9)+1),Fe._name==="radialaxis"&&(sn*=2)),Fe.minor&&Fe.minor.tickmode!=="array"||Fe.tickmode==="array"&&(sn*=100),Fe._roughDTick=Math.abs(Kr[1]-Kr[0])/sn,it.autoTicks(Fe,Fe._roughDTick),Fe._minDtick>0&&Fe.dtick0?(Yr=sn-1,un=sn):(Yr=sn,un=sn);var Pn=Fe[Yr].value,bn=Fe[un].value,ze=Math.abs(bn-Pn),yr=Kr||ze,en=0;yr>=_?ze>=_&&ze<=b?en=ze:en=x:Kr===d&&yr>=k?ze>=k&&ze<=A?en=ze:en=d:yr>=E?ze>=E&&ze<=w?en=ze:en=D:Kr===I&&yr>=I?en=I:yr>=M?en=M:Kr===p&&yr>=p?en=p:Kr===g&&yr>=g&&(en=g);var Rn;en>=ze&&(en=ze,Rn=!0);var ni=cn+en;if(Re.rangebreaks&&en>0){for(var xi=84,Jn=0,Gn=0;GnI&&(en=ze)}(en>0||sn===0)&&(Fe[sn].periodX=cn+en/2)}}it.calcTicks=function(Fe,Re){for(var Kr=Fe.type,sn=Fe.calendar,cn=Fe.ticklabelstep,Yr=Fe.ticklabelmode==="period",un=Fe.range[0]>Fe.range[1],Pn=!Fe.ticklabelindex||n.isArrayOrTypedArray(Fe.ticklabelindex)?Fe.ticklabelindex:[Fe.ticklabelindex],bn=n.simpleMap(Fe.range,Fe.r2l,void 0,void 0,Re),ze=bn[1]=(Va?0:1);ea--){var go=!ea;ea?(Fe._dtickInit=Fe.dtick,Fe._tick0Init=Fe.tick0):(Fe.minor._dtickInit=Fe.minor.dtick,Fe.minor._tick0Init=Fe.minor.tick0);var mo=ea?Fe:n.extendFlat({},Fe,Fe.minor);if(go?it.prepMinorTicks(mo,Fe,Re):it.prepTicks(mo,Re),mo.tickmode==="array"){ea?(Jn=[],ni=ie(Fe,!go)):(Gn=[],xi=ie(Fe,!go));continue}if(mo.tickmode==="sync"){Jn=[],ni=Lt(Fe);continue}var Go=Ct(bn),Lo=Go[0],Zo=Go[1],Ka=y(mo.dtick),Cs=Kr==="log"&&!(Ka||mo.dtick.charAt(0)==="L"),ps=it.tickFirst(mo,Re);if(ea){if(Fe._tmin=ps,ps=Zo:is<=Zo;is=it.tickIncrement(is,kl,ze,sn)){if(ea&&ol++,mo.rangebreaks&&!ze){if(is=en)break}if(Jn.length>Rn||is===wl)break;wl=is;var ul={value:is};ea?(Cs&&is!==(is|0)&&(ul.simpleLabel=!0),cn>1&&ol%cn&&(ul.skipLabel=!0),Jn.push(ul)):(ul.minor=!0,Gn.push(ul))}}if(!Gn||Gn.length<2)Pn=!1;else{var Kl=(Gn[1].value-Gn[0].value)*(un?-1:1);so(Kl,Fe.tickformat)||(Pn=!1)}if(!Pn)pi=Jn;else{var vs=Jn.concat(Gn);Yr&&Jn.length&&(vs=vs.slice(1)),vs=vs.sort(function(Tl,us){return Tl.value-us.value}).filter(function(Tl,us,Rc){return us===0||Tl.value!==Rc[us-1].value});var Ns=vs.map(function(Tl,us){return Tl.minor===void 0&&!Tl.skipLabel?us:null}).filter(function(Tl){return Tl!==null});Ns.forEach(function(Tl){Pn.map(function(us){var Rc=Tl+us;Rc>=0&&Rc-1;el--){if(Jn[el].drop){Jn.splice(el,1);continue}Jn[el].value=Zi(Jn[el].value,Fe);var yl=Fe.c2p(Jn[el].value);(lc?nc>yl-ss:ncen||iuen&&(Rc.periodX=en),iucn&&Rnx)Re/=x,sn=cn(10),Fe.dtick="M"+12*Jr(Re,sn,be);else if(Yr>D)Re/=D,Fe.dtick="M"+Jr(Re,1,ce);else if(Yr>M){if(Fe.dtick=Jr(Re,M,Fe._hasDayOfWeekBreaks?[1,2,7,14]:Ze),!Kr){var un=it.getTickFormat(Fe),Pn=Fe.ticklabelmode==="period";Pn&&(Fe._rawTick0=Fe.tick0),/%[uVW]/.test(un)?Fe.tick0=n.dateTick0(Fe.calendar,2):Fe.tick0=n.dateTick0(Fe.calendar,1),Pn&&(Fe._dowTick0=Fe.tick0)}}else Yr>g?Fe.dtick=Jr(Re,g,ce):Yr>C?Fe.dtick=Jr(Re,C,Le):Yr>S?Fe.dtick=Jr(Re,S,Le):(sn=cn(10),Fe.dtick=Jr(Re,sn,be))}else if(Fe.type==="log"){Fe.tick0=0;var bn=n.simpleMap(Fe.range,Fe.r2l);if(Fe._isMinor&&(Re*=1.5),Re>.7)Fe.dtick=Math.ceil(Re);else if(Math.abs(bn[1]-bn[0])<1){var ze=1.5*Math.abs((bn[1]-bn[0])/Re);Re=Math.abs(Math.pow(10,bn[1])-Math.pow(10,bn[0]))/ze,sn=cn(10),Fe.dtick="L"+Jr(Re,sn,be)}else Fe.dtick=Re>.3?"D2":"D1"}else Fe.type==="category"||Fe.type==="multicategory"?(Fe.tick0=0,Fe.dtick=Math.ceil(Math.max(Re,1))):Fi(Fe)?(Fe.tick0=0,sn=1,Fe.dtick=Jr(Re,sn,fr)):(Fe.tick0=0,sn=cn(10),Fe.dtick=Jr(Re,sn,be));if(Fe.dtick===0&&(Fe.dtick=1),!y(Fe.dtick)&&typeof Fe.dtick!="string"){var yr=Fe.dtick;throw Fe.dtick=1,"ax.dtick error: "+String(yr)}};function an(Fe){var Re=Fe.dtick;if(Fe._tickexponent=0,!y(Re)&&typeof Re!="string"&&(Re=1),(Fe.type==="category"||Fe.type==="multicategory")&&(Fe._tickround=null),Fe.type==="date"){var Kr=Fe.r2l(Fe.tick0),sn=Fe.l2r(Kr).replace(/(^-|i)/g,""),cn=sn.length;if(String(Re).charAt(0)==="M")cn>10||sn.substr(5)!=="01-01"?Fe._tickround="d":Fe._tickround=+Re.substr(1)%12===0?"y":"m";else if(Re>=M&&cn<=10||Re>=M*15)Fe._tickround="d";else if(Re>=C&&cn<=16||Re>=g)Fe._tickround="M";else if(Re>=S&&cn<=19||Re>=C)Fe._tickround="S";else{var Yr=Fe.l2r(Kr+Re).replace(/^-/,"").length;Fe._tickround=Math.max(cn,Yr)-20,Fe._tickround<0&&(Fe._tickround=4)}}else if(y(Re)||Re.charAt(0)==="L"){var un=Fe.range.map(Fe.r2d||Number);y(Re)||(Re=Number(Re.substr(1))),Fe._tickround=2-Math.floor(Math.log(Re)/Math.LN10+.01);var Pn=Math.max(Math.abs(un[0]),Math.abs(un[1])),bn=Math.floor(Math.log(Pn)/Math.LN10+.01),ze=Fe.minexponent===void 0?3:Fe.minexponent;Math.abs(bn)>ze&&(ae(Fe.exponentformat)&&Fe.exponentformat!=="SI extended"&&!he(bn)||ae(Fe.exponentformat)&&Fe.exponentformat==="SI extended"&&!Me(bn)?Fe._tickexponent=3*Math.round((bn-1)/3):Fe._tickexponent=bn)}else Fe._tickround=null}it.tickIncrement=function(Fe,Re,Kr,sn){var cn=Kr?-1:1;if(y(Re))return n.increment(Fe,cn*Re);var Yr=Re.charAt(0),un=cn*Number(Re.substr(1));if(Yr==="M")return n.incrementMonth(Fe,un,sn);if(Yr==="L")return Math.log(Math.pow(10,Fe)+un)/Math.LN10;if(Yr==="D"){var Pn=Re==="D2"?mr:Qe,bn=Fe+cn*.01,ze=n.roundUp(n.mod(bn,1),Pn,Kr);return Math.floor(bn)+Math.log(f.round(Math.pow(10,ze),1))/Math.LN10}throw"unrecognized dtick "+String(Re)},it.tickFirst=function(Fe,Re){var Kr=Fe.r2l||Number,sn=n.simpleMap(Fe.range,Kr,void 0,void 0,Re),cn=sn[1]=0&&pi<=Fe._length?Gn:null};if(Yr&&n.isArrayOrTypedArray(Fe.ticktext)){var en=n.simpleMap(Fe.range,Fe.r2l),Rn=(Math.abs(en[1]-en[0])-(Fe._lBreaks||0))/1e4;for(ze=0;ze"+Pn;else{var ze=Ji(Fe),yr=Fe._trueSide||Fe.side;(!ze&&yr==="top"||ze&&yr==="bottom")&&(un+="
")}Re.text=un}function _n(Fe,Re,Kr,sn,cn){var Yr=Fe.dtick,un=Re.x,Pn=Fe.tickformat,bn=typeof Yr=="string"&&Yr.charAt(0);if(cn==="never"&&(cn=""),sn&&bn!=="L"&&(Yr="L3",bn="L"),Pn||bn==="L")Re.text=Ye(Math.pow(10,un),Fe,cn,sn);else if(y(Yr)||bn==="D"&&(Fe.minorloglabels==="complete"||n.mod(un+.01,1)<.1)){Fe.minorloglabels==="complete"&&!(n.mod(un+.01,1)<.1)&&(Re.fontSize*=.75);var ze=Math.pow(10,un).toExponential(0),yr=ze.split("e"),en=+yr[1],Rn=Math.abs(en),ni=Fe.exponentformat;ni==="power"||ae(ni)&&ni!=="SI extended"&&he(en)||ae(ni)&&ni==="SI extended"&&Me(en)?(Re.text=yr[0],Rn>0&&(Re.text+="x10"),Re.text==="1x10"&&(Re.text="10"),en!==0&&en!==1&&(Re.text+=""+(en>0?"":U)+Rn+""),Re.fontSize*=1.25):(ni==="e"||ni==="E")&&Rn>2?Re.text=yr[0]+ni+(en>0?"+":U)+Rn:(Re.text=Ye(Math.pow(10,un),Fe,"","fakehover"),Yr==="D1"&&Fe._id.charAt(0)==="y"&&(Re.dy-=Re.fontSize/6))}else if(bn==="D")Re.text=Fe.minorloglabels==="none"?"":String(Math.round(Math.pow(10,n.mod(un,1)))),Re.fontSize*=.75;else throw"unrecognized dtick "+String(Yr);if(Fe.dtick==="D1"){var xi=String(Re.text).charAt(0);(xi==="0"||xi==="1")&&(Fe._id.charAt(0)==="y"?Re.dx-=Re.fontSize/4:(Re.dy+=Re.fontSize/2,Re.dx+=(Fe.range[1]>Fe.range[0]?1:-1)*Re.fontSize*(un<0?.5:.25)))}}function Oe(Fe,Re){var Kr=Fe._categories[Math.round(Re.x)];Kr===void 0&&(Kr=""),Re.text=String(Kr)}function Xt(Fe,Re,Kr){var sn=Math.round(Re.x),cn=Fe._categories[sn]||[],Yr=cn[1]===void 0?"":String(cn[1]),un=cn[0]===void 0?"":String(cn[0]);Kr?Re.text=un+" - "+Yr:(Re.text=Yr,Re.text2=un)}function oe(Fe,Re,Kr,sn,cn){cn==="never"?cn="":Fe.showexponent==="all"&&Math.abs(Re.x/Fe.dtick)<1e-6&&(cn="hide"),Re.text=Ye(Re.x,Fe,cn,sn)}function zt(Fe,Re,Kr,sn,cn){if(Fe.thetaunit==="radians"&&!Kr){var Yr=Re.x/180;if(Yr===0)Re.text="0";else{var un=_t(Yr);if(un[1]>=100)Re.text=Ye(n.deg2rad(Re.x),Fe,cn,sn);else{var Pn=Re.x<0;un[1]===1?un[0]===1?Re.text="π":Re.text=un[0]+"π":Re.text=["",un[0],"","⁄","",un[1],"","π"].join(""),Pn&&(Re.text=U+Re.text)}}}else Re.text=Ye(Re.x,Fe,cn,sn)}function _t(Fe){function Re(Pn,bn){return Math.abs(Pn-bn)<=1e-6}function Kr(Pn,bn){return Re(bn,0)?Pn:Kr(bn,Pn%bn)}function sn(Pn){for(var bn=1;!Re(Math.round(Pn*bn)/bn,Pn);)bn*=10;return bn}var cn=sn(Fe),Yr=Fe*cn,un=Math.abs(Kr(Yr,cn));return[Math.round(Yr/un),Math.round(cn/un)]}var Pt=["f","p","n","μ","m","","k","M","G","T"],Ht=["q","r","y","z","a",...Pt,"P","E","Z","Y","R","Q"],ae=Fe=>["SI","SI extended","B"].includes(Fe);function he(Fe){return Fe>14||Fe<-15}function Me(Fe){return Fe>32||Fe<-30}function qe(Fe,Re){return ae(Re)?!!(Re==="SI extended"&&Me(Fe)||Re!=="SI extended"&&he(Fe)):!1}function Ye(Fe,Re,Kr,sn){var cn=Fe<0,Yr=Re._tickround,un=Kr||Re.exponentformat||"B",Pn=Re._tickexponent,bn=it.getTickFormat(Re),ze=Re.separatethousands;if(sn){var yr={exponentformat:un,minexponent:Re.minexponent,dtick:Re.showexponent==="none"?Re.dtick:y(Fe)&&Math.abs(Fe)||1,range:Re.showexponent==="none"?Re.range.map(Re.r2d):[0,Fe||1]};an(yr),Yr=(Number(yr._tickround)||0)+4,Pn=yr._tickexponent,Re.hoverformat&&(bn=Re.hoverformat)}if(bn)return Re._numFormat(bn)(Fe).replace(/-/g,U);var en=Math.pow(10,-Yr)/2;if(un==="none"&&(Pn=0),Fe=Math.abs(Fe),Fe"+xi+"":un==="B"&&Pn===9?Fe+="B":ae(un)&&(Fe+=un==="SI extended"?Ht[Pn/3+10]:Pt[Pn/3+5])}return cn?U+Fe:Fe}it.getTickFormat=function(Fe){var Re;function Kr(bn){return typeof bn!="string"?bn:Number(bn.replace("M",""))*D}function sn(bn,ze){var yr=["L","D"];if(typeof bn==typeof ze){if(typeof bn=="number")return bn-ze;var en=yr.indexOf(bn.charAt(0)),Rn=yr.indexOf(ze.charAt(0));return en===Rn?Number(bn.replace(/(L|D)/g,""))-Number(ze.replace(/(L|D)/g,"")):en-Rn}else return typeof bn=="number"?1:-1}function cn(bn,ze,yr){var en=yr||function(xi){return xi},Rn=ze[0],ni=ze[1];return(!Rn&&typeof Rn!="number"||en(Rn)<=en(bn))&&(!ni&&typeof ni!="number"||en(ni)>=en(bn))}function Yr(bn,ze){var yr=ze[0]===null,en=ze[1]===null,Rn=sn(bn,ze[0])>=0,ni=sn(bn,ze[1])<=0;return(yr||Rn)&&(en||ni)}var un,Pn;if(Fe.tickformatstops&&Fe.tickformatstops.length>0)switch(Fe.type){case"date":case"linear":{for(Re=0;Re=0&&cn.unshift(cn.splice(yr,1).shift())}});var Pn={false:{left:0,right:0}};return n.syncOrAsync(cn.map(function(bn){return function(){if(bn){var ze=it.getFromId(Fe,bn);Kr||(Kr={}),Kr.axShifts=Pn,Kr.overlayingShiftedAx=un;var yr=it.drawOne(Fe,ze,Kr);return ze._shiftPusher&&Ei(ze,ze._fullDepth||0,Pn,!0),ze._r=ze.range.slice(),ze._rl=n.simpleMap(ze._r,ze.r2l),yr}}}))},it.drawOne=function(Fe,Re,Kr){Kr=Kr||{};var sn=Kr.axShifts||{},cn=Kr.overlayingShiftedAx||[],Yr,un,Pn;Re.setScale();var bn=Fe._fullLayout,ze=Re._id,yr=ze.charAt(0),en=it.counterLetter(ze),Rn=bn._plots[Re._mainSubplot],ni=Re.zerolinelayer==="above traces";if(!Rn)return;if(Re._shiftPusher=Re.autoshift||cn.indexOf(Re._id)!==-1||cn.indexOf(Re.overlaying)!==-1,Re._shiftPusher&Re.anchor==="free"){var xi=Re.linewidth/2||0;Re.ticks==="inside"&&(xi+=Re.ticklen),Ei(Re,xi,sn,!0),Ei(Re,Re.shift||0,sn,!1)}(Kr.skipTitle!==!0||Re._shift===void 0)&&(Re._shift=Ga(Re,sn));var Jn=Rn[yr+"axislayer"],Gn=Re._mainLinePosition,pi=Gn+=Re._shift,Va=Re._mainMirrorPosition,ea=Re._vals=it.calcTicks(Re),go=[Re.mirror,pi,Va].join("_");for(Yr=0;Yr0?Dl.bottom-Rc:0,iu))));var pu=0,Ah=0;if(Re._shiftPusher&&(pu=Math.max(iu,Dl.height>0?Tl==="l"?Rc-Dl.left:Dl.right-Rc:0),Re.title.text!==bn._dfltTitle[yr]&&(Ah=(Re._titleStandoff||0)+(Re._titleScoot||0),Tl==="l"&&(Ah+=Ci(Re))),Re._fullDepth=Math.max(pu,Ah)),Re.automargin){ql={x:0,y:0,r:0,l:0,t:0,b:0};var uh=[0,1],yh=typeof Re._shift=="number"?Re._shift:0;if(yr==="x"){if(Tl==="b"?ql[Tl]=Re._depth:(ql[Tl]=Re._depth=Math.max(Dl.width>0?Rc-Dl.top:0,iu),uh.reverse()),Dl.width>0){var tf=Dl.right-(Re._offset+Re._length);tf>0&&(ql.xr=1,ql.r=tf);var Nd=Re._offset-Dl.left;Nd>0&&(ql.xl=0,ql.l=Nd)}}else if(Tl==="l"?(Re._depth=Math.max(Dl.height>0?Rc-Dl.left:0,iu),ql[Tl]=Re._depth-yh):(Re._depth=Math.max(Dl.height>0?Dl.right-Rc:0,iu),ql[Tl]=Re._depth+yh,uh.reverse()),Dl.height>0){var Gl=Dl.bottom-(Re._offset+Re._length);Gl>0&&(ql.yb=0,ql.b=Gl);var Yu=Re._offset-Dl.top;Yu>0&&(ql.yt=1,ql.t=Yu)}ql[en]=Re.anchor==="free"?Re.position:Re._anchorAxis.domain[uh[0]],Re.title.text!==bn._dfltTitle[yr]&&(ql[Tl]+=Ci(Re)+(Re.title.standoff||0)),Re.mirror&&Re.anchor!=="free"&&(cc={x:0,y:0,r:0,l:0,t:0,b:0},cc[us]=Re.linewidth,Re.mirror&&Re.mirror!==!0&&(cc[us]+=iu),Re.mirror===!0||Re.mirror==="ticks"?cc[en]=Re._anchorAxis.domain[uh[1]]:(Re.mirror==="all"||Re.mirror==="allticks")&&(cc[en]=[Re._counterDomainMin,Re._counterDomainMax][uh[1]]))}mc&&(dc=P.getComponentMethod("rangeslider","autoMarginOpts")(Fe,Re)),typeof Re.automargin=="string"&&(ur(ql,Re.automargin),ur(cc,Re.automargin)),z.autoMargin(Fe,vr(Re),ql),z.autoMargin(Fe,Ar(Re),cc),z.autoMargin(Fe,mn(Re),dc)}),n.syncOrAsync(zs)}};function ur(Fe,Re){if(Fe){var Kr=Object.keys(tt).reduce(function(sn,cn){return Re.indexOf(cn)!==-1&&tt[cn].forEach(function(Yr){sn[Yr]=1}),sn},{});Object.keys(Fe).forEach(function(sn){Kr[sn]||(sn.length===1?Fe[sn]=0:delete Fe[sn])})}}function Rr(Fe,Re){var Kr=[],sn,cn=function(Yr,un){var Pn=Yr.xbnd[un];Pn!==null&&Kr.push(n.extendFlat({},Yr,{x:Pn}))};if(Re.length){for(sn=0;snFe.range[1],Pn=Fe.ticklabelposition&&Fe.ticklabelposition.indexOf("inside")!==-1,bn=!Pn;if(Kr){var ze=un?-1:1;Kr=Kr*ze}if(sn){var yr=Fe.side,en=Pn&&(yr==="top"||yr==="left")||bn&&(yr==="bottom"||yr==="right")?1:-1;sn=sn*en}return Fe._id.charAt(0)==="x"?function(Rn){return i(cn+Fe._offset+Fe.l2p(ci(Rn))+Kr,Yr+sn)}:function(Rn){return i(Yr+sn,cn+Fe._offset+Fe.l2p(ci(Rn))+Kr)}};function ci(Fe){return Fe.periodX!==void 0?Fe.periodX:Fe.x}function ui(Fe){var Re=Fe.ticklabelposition||"",Kr=Fe.tickson||"",sn=function(xi){return Re.indexOf(xi)!==-1},cn=sn("top"),Yr=sn("left"),un=sn("right"),Pn=sn("bottom"),bn=sn("inside"),ze=Kr!=="boundaries"&&(Pn||Yr||cn||un);if(!ze&&!bn)return[0,0];var yr=Fe.side,en=ze?(Fe.tickwidth||0)/2:0,Rn=gt,ni=Fe.tickfont?Fe.tickfont.size:12;return(Pn||cn)&&(en+=ni*vt,Rn+=(Fe.linewidth||0)/2),(Yr||un)&&(en+=(Fe.linewidth||0)/2,Rn+=gt),bn&&yr==="top"&&(Rn-=ni*(1-vt)),(Yr||cn)&&(en=-en),(yr==="bottom"||yr==="right")&&(Rn=-Rn),[ze?en:0,bn?Rn:0]}it.makeTickPath=function(Fe,Re,Kr,sn){sn||(sn={});var cn=sn.minor;if(cn&&!Fe.minor)return"";var Yr=sn.len!==void 0?sn.len:cn?Fe.minor.ticklen:Fe.ticklen,un=Fe._id.charAt(0),Pn=(Fe.linewidth||1)/2;return un==="x"?"M0,"+(Re+Pn*Kr)+"v"+Yr*Kr:"M"+(Re+Pn*Kr)+",0h"+Yr*Kr},it.makeLabelFns=function(Fe,Re,Kr){var sn=Fe.ticklabelposition||"",cn=Fe.tickson||"",Yr=function(is){return sn.indexOf(is)!==-1},un=Yr("top"),Pn=Yr("left"),bn=Yr("right"),ze=Yr("bottom"),yr=cn!=="boundaries"&&(ze||Pn||un||bn),en=Yr("inside"),Rn=sn==="inside"&&Fe.ticks==="inside"||!en&&Fe.ticks==="outside"&&cn!=="boundaries",ni=0,xi=0,Jn=Rn?Fe.ticklen:0;if(en?Jn*=-1:yr&&(Jn=0),Rn&&(ni+=Jn,Kr)){var Gn=n.deg2rad(Kr);ni=Jn*Math.cos(Gn)+1,xi=Jn*Math.sin(Gn)}Fe.showticklabels&&(Rn||Fe.showline)&&(ni+=.2*Fe.tickfont.size),ni+=(Fe.linewidth||1)/2*(en?-1:1);var pi={labelStandoff:ni,labelShift:xi},Va,ea,go,mo,Go=0,Lo=Fe.side,Zo=Fe._id.charAt(0),Ka=Fe.tickangle,Cs;if(Zo==="x")Cs=!en&&Lo==="bottom"||en&&Lo==="top",mo=Cs?1:-1,en&&(mo*=-1),Va=xi*mo,ea=Re+ni*mo,go=Cs?1:-.2,Math.abs(Ka)===90&&(en?go+=bt:Ka===-90&&Lo==="bottom"?go=vt:Ka===90&&Lo==="top"?go=bt:go=.5,Go=bt/2*(Ka/90)),pi.xFn=function(is){return is.dx+Va+Go*is.fontSize},pi.yFn=function(is){return is.dy+ea+is.fontSize*go},pi.anchorFn=function(is,ol){if(yr){if(Pn)return"end";if(bn)return"start"}return!y(ol)||ol===0||ol===180?"middle":ol*mo<0!==en?"end":"start"},pi.heightFn=function(is,ol,ms){return ol<-60||ol>60?-.5*ms:Fe.side==="top"!==en?-ms:0};else if(Zo==="y"){if(Cs=!en&&Lo==="left"||en&&Lo==="right",mo=Cs?1:-1,en&&(mo*=-1),Va=ni,ea=xi*mo,go=0,!en&&Math.abs(Ka)===90&&(Ka===-90&&Lo==="left"||Ka===90&&Lo==="right"?go=vt:go=.5),en){var ps=y(Ka)?+Ka:0;if(ps!==0){var wl=n.deg2rad(ps);Go=Math.abs(Math.sin(wl))*vt*mo,go=0}}pi.xFn=function(is){return is.dx+Re-(Va+is.fontSize*go)*mo+Go*is.fontSize},pi.yFn=function(is){return is.dy+ea+is.fontSize*bt},pi.anchorFn=function(is,ol){return y(ol)&&Math.abs(ol)===90?"middle":Cs?"end":"start"},pi.heightFn=function(is,ol,ms){return Fe.side==="right"&&(ol*=-1),ol<-30?-ms:ol<30?-.5*ms:0}}return pi};function yi(Fe){return[Fe.text,Fe.x,Fe.axInfo,Fe.font,Fe.fontSize,Fe.fontColor].join("_")}it.drawTicks=function(Fe,Re,Kr){Kr=Kr||{};var sn=Re._id+"tick",cn=[].concat(Re.minor&&Re.minor.ticks?Kr.vals.filter(function(un){return un.minor&&!un.noTick}):[]).concat(Re.ticks?Kr.vals.filter(function(un){return!un.minor&&!un.noTick}):[]),Yr=Kr.layer.selectAll("path."+sn).data(cn,yi);Yr.exit().remove(),Yr.enter().append("path").classed(sn,1).classed("ticks",1).classed("crisp",Kr.crisp!==!1).each(function(un){return o.stroke(f.select(this),un.minor?Re.minor.tickcolor:Re.tickcolor)}).style("stroke-width",function(un){return c.crispRound(Fe,un.minor?Re.minor.tickwidth:Re.tickwidth,1)+"px"}).attr("d",Kr.path).style("display",null),ca(Re,[q]),Yr.attr("transform",Kr.transFn)},it.drawGrid=function(Fe,Re,Kr){if(Kr=Kr||{},Re.tickmode!=="sync"){var sn=Re._id+"grid",cn=Re.minor&&Re.minor.showgrid,Yr=cn?Kr.vals.filter(function(pi){return pi.minor}):[],un=Re.showgrid?Kr.vals.filter(function(pi){return!pi.minor}):[],Pn=Kr.counterAxis;if(Pn&&it.shouldShowZeroLine(Fe,Re,Pn))for(var bn=Re.tickmode==="array",ze=0;ze=0;xi--){var Jn=xi?Rn:ni;if(Jn){var Gn=Jn.selectAll("path."+sn).data(xi?un:Yr,yi);Gn.exit().remove(),Gn.enter().append("path").classed(sn,1).classed("crisp",Kr.crisp!==!1),Gn.attr("transform",Kr.transFn).attr("d",Kr.path).each(function(pi){return o.stroke(f.select(this),pi.minor?Re.minor.gridcolor:Re.gridcolor||"#ddd")}).style("stroke-dasharray",function(pi){return c.dashStyle(pi.minor?Re.minor.griddash:Re.griddash,pi.minor?Re.minor.gridwidth:Re.gridwidth)}).style("stroke-width",function(pi){return(pi.minor?en:Re._gw)+"px"}).style("display",null),typeof Kr.path=="function"&&Gn.attr("d",Kr.path)}}ca(Re,[F,H])}},it.drawZeroLine=function(Fe,Re,Kr){Kr=Kr||Kr;var sn=Re._id+"zl",cn=it.shouldShowZeroLine(Fe,Re,Kr.counterAxis),Yr=Kr.layer.selectAll("path."+sn).data(cn?[{x:0,id:Re._id}]:[]);Yr.exit().remove(),Yr.enter().append("path").classed(sn,1).classed("zl",1).classed("crisp",Kr.crisp!==!1).each(function(){Kr.layer.selectAll("path").sort(function(un,Pn){return ot(un.id,Pn.id)})}),Yr.attr("transform",Kr.transFn).attr("d",Kr.path).call(o.stroke,Re.zerolinecolor||o.defaultLine).style("stroke-width",c.crispRound(Fe,Re.zerolinewidth,Re._gw||1)+"px").style("display",null),ca(Re,[W])},it.drawLabels=function(Fe,Re,Kr){Kr=Kr||{};var sn=Fe._fullLayout,cn=Re._id,Yr=Re.zerolinelayer==="above traces",un=Kr.cls||cn+"tick",Pn=Kr.vals.filter(function(vs){return vs.text}),bn=Kr.labelFns,ze=Kr.secondary?0:Re.tickangle,yr=(Re._prevTickAngles||{})[un],en=Kr.layer.selectAll("g."+un).data(Re.showticklabels?Pn:[],yi),Rn=[];en.enter().append("g").classed(un,1).append("text").attr("text-anchor","middle").each(function(vs){var Ns=f.select(this),Uo=Fe._promises.length;Ns.call(a.positionText,bn.xFn(vs),bn.yFn(vs)).call(c.font,{family:vs.font,size:vs.fontSize,color:vs.fontColor,weight:vs.fontWeight,style:vs.fontStyle,variant:vs.fontVariant,textcase:vs.fontTextcase,lineposition:vs.fontLineposition,shadow:vs.fontShadow}).text(vs.text).call(a.convertToTspans,Fe),Fe._promises[Uo]?Rn.push(Fe._promises.pop().then(function(){ni(Ns,ze)})):ni(Ns,ze)}),ca(Re,[G]),en.exit().remove(),Kr.repositionOnUpdate&&en.each(function(vs){f.select(this).select("text").call(a.positionText,bn.xFn(vs),bn.yFn(vs))});function ni(vs,Ns){vs.each(function(Uo){var Ds=f.select(this),Ol=Ds.select(".text-math-group"),tc=bn.anchorFn(Uo,Ns),sc=Kr.transFn.call(Ds.node(),Uo)+(y(Ns)&&+Ns!=0?" rotate("+Ns+","+bn.xFn(Uo)+","+(bn.yFn(Uo)-Uo.fontSize/2)+")":""),Xs=a.lineCount(Ds),Wa=ut*Uo.fontSize,Co=bn.heightFn(Uo,y(Ns)?+Ns:0,(Xs-1)*Wa);if(Co&&(sc+=i(0,Co)),Ol.empty()){var el=Ds.select("text");el.attr({transform:sc,"text-anchor":tc}),el.style("display",null),Re._adjustTickLabelsOverflow&&Re._adjustTickLabelsOverflow()}else{var lc=c.bBox(Ol.node()).width,ss=lc*{end:-.5,start:.5}[tc];Ol.attr("transform",sc+i(ss,0))}})}Re._adjustTickLabelsOverflow=function(){var vs=Re.ticklabeloverflow;if(!(!vs||vs==="allow")){var Ns=vs.indexOf("hide")!==-1,Uo=Re._id.charAt(0)==="x",Ds=0,Ol=Uo?Fe._fullLayout.width:Fe._fullLayout.height;if(vs.indexOf("domain")!==-1){var tc=n.simpleMap(Re.range,Re.r2l);Ds=Re.l2p(tc[0])+Re._offset,Ol=Re.l2p(tc[1])+Re._offset}var sc=Math.min(Ds,Ol),Xs=Math.max(Ds,Ol),Wa=Re.side,Co=1/0,el=-1/0;en.each(function(yl){var $l=f.select(this),Gc=$l.select(".text-math-group");if(Gc.empty()){var ko=c.bBox($l.node()),zs=0;Uo?(ko.right>Xs||ko.leftXs||ko.top+(Re.tickangle?0:yl.fontSize/4)Re["_visibleLabelMin_"+tc._id]?$l.style("display","none"):Xs.K==="tick"&&!sc&&$l.node().style.display!=="none"&&$l.style("display",null)})})})})},ni(en,yr+1?yr:ze);function xi(){return Rn.length&&Promise.all(Rn)}var Jn=null;function Gn(){if(ni(en,ze),Pn.length&&Re.autotickangles&&(Re.type!=="log"||String(Re.dtick).charAt(0)!=="D")){Jn=Re.autotickangles[0];var vs=0,Ns=[],Uo,Ds=1;en.each(function(ql){vs=Math.max(vs,ql.fontSize);var cc=Re.l2p(ql.x),dc=sr(this),pu=c.bBox(dc.node());Ds=Math.max(Ds,a.lineCount(dc)),Ns.push({top:0,bottom:10,height:10,left:cc-pu.width/2,right:cc+pu.width/2+2,width:pu.width+2})});var Ol=(Re.tickson==="boundaries"||Re.showdividers)&&!Kr.secondary,tc=Pn.length,sc=Math.abs((Pn[tc-1].x-Pn[0].x)*Re._m)/(tc-1),Xs=Ol?sc/2:sc,Wa=Ol?Re.ticklen:vs*1.25*Ds,Co=Math.sqrt(Math.pow(Xs,2)+Math.pow(Wa,2)),el=Xs/Co,lc=Re.autotickangles.map(function(ql){return ql*Math.PI/180}),ss=lc.find(function(ql){return Math.abs(Math.cos(ql))<=el});ss===void 0&&(ss=lc.reduce(function(ql,cc){return Math.abs(Math.cos(ql))kl*ms&&(wl=ms,Ka[Zo]=Cs[Zo]=is[Zo])}var ul=Math.abs(wl-ps);ul-mo>0?(ul-=mo,mo*=1+mo/ul):mo=0,Re._id.charAt(0)!=="y"&&(mo=-mo),Ka[Lo]=ea.p2r(ea.r2p(Cs[Lo])+Go*mo),ea.autorange==="min"||ea.autorange==="max reversed"?(Ka[0]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0):(ea.autorange==="max"||ea.autorange==="min reversed")&&(Ka[1]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0),sn._insideTickLabelsUpdaterange[ea._name+".range"]=Ka}var Kl=n.syncOrAsync(pi);return Kl&&Kl.then&&Fe._promises.push(Kl),Kl};function Gi(Fe,Re,Kr){var sn=Re._id+"divider",cn=Kr.vals,Yr=Kr.layer.selectAll("path."+sn).data(cn,yi);Yr.exit().remove(),Yr.enter().insert("path",":first-child").classed(sn,1).classed("crisp",1).call(o.stroke,Re.dividercolor).style("stroke-width",c.crispRound(Fe,Re.dividerwidth,1)+"px"),Yr.attr("transform",Kr.transFn).attr("d",Kr.path)}it.getPxPosition=function(Fe,Re){var Kr=Fe._fullLayout._size,sn=Re._id.charAt(0),cn=Re.side,Yr;if(Re.anchor!=="free"?Yr=Re._anchorAxis:sn==="x"?Yr={_offset:Kr.t+(1-(Re.position||0))*Kr.h,_length:0}:sn==="y"&&(Yr={_offset:Kr.l+(Re.position||0)*Kr.w+Re._shift,_length:0}),cn==="top"||cn==="left")return Yr._offset;if(cn==="bottom"||cn==="right")return Yr._offset+Yr._length};function Ci(Fe){var Re=Fe.title.font.size,Kr=(Fe.title.text.match(a.BR_TAG_ALL)||[]).length;return Fe.title.hasOwnProperty("standoff")?Re*(vt+Kr*ut):Kr?Re*(Kr+1)*ut:Re}function fi(Fe,Re){var Kr=Fe._fullLayout,sn=Re._id,cn=sn.charAt(0),Yr=Re.title.font.size,un,Pn=(Re.title.text.match(a.BR_TAG_ALL)||[]).length;if(Re.title.hasOwnProperty("standoff"))Re.side==="bottom"||Re.side==="right"?un=Re._depth+Re.title.standoff+Yr*vt:(Re.side==="top"||Re.side==="left")&&(un=Re._depth+Re.title.standoff+Yr*(bt+Pn*ut));else{var bn=Ji(Re);if(Re.type==="multicategory")un=Re._depth;else{var ze=1.5*Yr;bn&&(ze=.5*Yr,Re.ticks==="outside"&&(ze+=Re.ticklen)),un=10+ze+(Re.linewidth?Re.linewidth-1:0)}bn||(cn==="x"?un+=Re.side==="top"?Yr*(Re.showticklabels?1:0):Yr*(Re.showticklabels?1.5:.5):un+=Re.side==="right"?Yr*(Re.showticklabels?1:.5):Yr*(Re.showticklabels?.5:0))}var yr=it.getPxPosition(Fe,Re),en,Rn,ni;cn==="x"?(Rn=Re._offset+Re._length/2,ni=Re.side==="top"?yr-un:yr+un):(ni=Re._offset+Re._length/2,Rn=Re.side==="right"?yr+un:yr-un,en={rotate:"-90",offset:0});var xi;if(Re.type!=="multicategory"){var Jn=Re._selections[Re._id+"tick"];if(xi={selection:Jn,side:Re.side},Jn&&Jn.node()&&Jn.node().parentNode){var Gn=c.getTranslate(Jn.node().parentNode);xi.offsetLeft=Gn.x,xi.offsetTop=Gn.y}Re.title.hasOwnProperty("standoff")&&(xi.pad=0)}return Re._titleStandoff=un,l.draw(Fe,sn+"title",{propContainer:Re,propName:Re._name+".title.text",placeholder:Kr._dfltTitle[cn],avoid:xi,transform:en,attributes:{x:Rn,y:ni,"text-anchor":"middle"}})}it.shouldShowZeroLine=function(Fe,Re,Kr){var sn=n.simpleMap(Re.range,Re.r2l);return sn[0]*sn[1]<=0&&Re.zeroline&&(Re.type==="linear"||Re.type==="-")&&!(Re.rangebreaks&&Re.maskBreaks(0)===V)&&(ba(Re,0)||!oa(Fe,Re,Kr,sn)||Ke(Fe,Re))},it.clipEnds=function(Fe,Re){return Re.filter(function(Kr){return ba(Fe,Kr.x)})};function ba(Fe,Re){var Kr=Fe.l2p(Re);return Kr>1&&Kr1)for(cn=1;cn=cn.min&&Fe=B:/%L/.test(Re)?Fe>=N:/%[SX]/.test(Re)?Fe>=S:/%M/.test(Re)?Fe>=C:/%[HI]/.test(Re)?Fe>=g:/%p/.test(Re)?Fe>=p:/%[Aadejuwx]/.test(Re)?Fe>=M:/%[UVW]/.test(Re)?Fe>=I:/%[Bbm]/.test(Re)?Fe>=E:/%[q]/.test(Re)?Fe>=k:/%[Yy]/.test(Re)?Fe>=_:!0}}),A4=It((et,Y)=>{Y.exports=function(f,y,z){var P,n;if(z){var i=y==="reversed"||y==="min reversed"||y==="max reversed";P=z[i?1:0],n=z[i?0:1]}var a=f("autorangeoptions.minallowed",n===null?P:void 0),l=f("autorangeoptions.maxallowed",P===null?n:void 0);a===void 0&&f("autorangeoptions.clipmin"),l===void 0&&f("autorangeoptions.clipmax"),f("autorangeoptions.include")}}),hw=It((et,Y)=>{var f=A4();Y.exports=function(y,z,P,n){var i=z._template||{},a=z.type||i.type||"-";P("minallowed"),P("maxallowed");var l=P("range");if(!l){var o;!n.noInsiderange&&a!=="log"&&(o=P("insiderange"),o&&(o[0]===null||o[1]===null)&&(z.insiderange=!1,o=void 0),o&&(l=P("range",o)))}var c=z.getAutorangeDflt(l,n),s=P("autorange",c),h;l&&(l[0]===null&&l[1]===null||(l[0]===null||l[1]===null)&&(s==="reversed"||s===!0)||l[0]!==null&&(s==="min"||s==="max reversed")||l[1]!==null&&(s==="max"||s==="min reversed"))&&(l=void 0,delete z.range,z.autorange=!0,h=!0),h||(c=z.getAutorangeDflt(l,n),s=P("autorange",c)),s&&(f(P,s,l),(a==="linear"||a==="-")&&P("rangemode")),z.cleanRange()}}),g8=It((et,Y)=>{var f={left:0,top:0};Y.exports=y;function y(P,n,i){n=n||P.currentTarget||P.srcElement,Array.isArray(i)||(i=[0,0]);var a=P.clientX||0,l=P.clientY||0,o=z(n);return i[0]=a-o.left,i[1]=l-o.top,i}function z(P){return P===window||P===document||P===document.body?f:P.getBoundingClientRect()}}),dw=It((et,Y)=>{var f=Qc();function y(){var z=!1;try{var P=Object.defineProperty({},"passive",{get:function(){z=!0}});window.addEventListener("test",null,P),window.removeEventListener("test",null,P)}catch{z=!1}return z}Y.exports=f&&y()}),fw=It((et,Y)=>{Y.exports=function(f,y,z,P,n){var i=(f-z)/(P-z),a=i+y/(P-z),l=(i+a)/2;return n==="left"||n==="bottom"?i:n==="center"||n==="middle"?l:n==="right"||n==="top"?a:i<2/3-l?i:a>4/3-l?a:l}}),v8=It((et,Y)=>{var f=jn(),y=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];Y.exports=function(z,P,n,i){return n==="left"?z=0:n==="center"?z=1:n==="right"?z=2:z=f.constrain(Math.floor(z*3),0,2),i==="bottom"?P=0:i==="middle"?P=1:i==="top"?P=2:P=f.constrain(Math.floor(P*3),0,2),y[P][z]}}),Qm=It((et,Y)=>{var f=qg(),y=lw(),z=W0().getGraphDiv,P=aa(),n=Y.exports={};n.wrapped=function(i,a,l){i=z(i),i._fullLayout&&y.clear(i._fullLayout._uid+P.HOVERID),n.raw(i,a,l)},n.raw=function(i,a){var l=i._fullLayout,o=i._hoverdata;a||(a={}),!(a.target&&!i._dragged&&f.triggerHandler(i,"plotly_beforehover",a)===!1)&&(l._hoverlayer.selectAll("g").remove(),l._hoverlayer.selectAll("line").remove(),l._hoverlayer.selectAll("circle").remove(),i._hoverdata=void 0,a.target&&o&&i.emit("plotly_unhover",{event:a,points:o}))}}),Up=It((et,Y)=>{var f=g8(),y=Jd(),z=dw(),P=jn().removeElement,n=fu(),i=Y.exports={};i.align=fw(),i.getCursor=v8();var a=Qm();i.unhover=a.wrapped,i.unhoverRaw=a.raw,i.init=function(c){var s=c.gd,h=1,m=s._context.doubleClickDelay,b=c.element,x,_,A,d,k,w,D,E;s._mouseDownTime||(s._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=p,z?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=p,b.addEventListener("touchstart",p,{passive:!1})):b.ontouchstart=p;function I(S,N,B){return Math.abs(S)"u"&&typeof S.clientY>"u"&&(S.clientX=x,S.clientY=_),A=new Date().getTime(),A-s._mouseDownTimem&&(h=Math.max(h-1,1)),s._dragged)c.doneFn&&c.doneFn();else{var N;w.target===D?N=w:(N={target:D,srcElement:D,toElement:D},Object.keys(w).concat(Object.keys(w.__proto__)).forEach(B=>{var U=w[B];!N[B]&&typeof U!="function"&&(N[B]=U)})),c.clickFn&&c.clickFn(h,N),E||D.dispatchEvent(new MouseEvent("click",S))}s._dragging=!1,s._dragged=!1}};function l(){var c=document.createElement("div");c.className="dragcover";var s=c.style;return s.position="fixed",s.left=0,s.right=0,s.top=0,s.bottom=0,s.zIndex=999999999,s.background="none",document.body.appendChild(c),c}i.coverSlip=l;function o(c){return f(c.changedTouches?c.changedTouches[0]:c,document.body)}}),Mm=It((et,Y)=>{Y.exports=function(f,y){(f.attr("class")||"").split(" ").forEach(function(z){z.indexOf("cursor-")===0&&f.classed(z,!1)}),y&&f.classed("cursor-"+y,!0)}}),Zg=It((et,Y)=>{var f=Mm(),y="data-savedcursor",z="!!";Y.exports=function(P,n){var i=P.attr(y);if(n){if(!i){for(var a=(P.attr("class")||"").split(" "),l=0;l{var f=hi(),y=Sn();Y.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:f({editType:"legend"}),grouptitlefont:f({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:f({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),tb=It(et=>{et.isGrouped=function(Y){return(Y.traceorder||"").indexOf("grouped")!==-1},et.isVertical=function(Y){return Y.orientation!=="h"},et.isReversed=function(Y){return(Y.traceorder||"").indexOf("reversed")!==-1}}),eb=It((et,Y)=>{var f=ls(),y=jn(),z=Tc(),P=xa(),n=pw(),i=k_(),a=tb();function l(o,c,s,h){var m=c[o]||{},b=z.newContainer(s,o);function x(ut,rt){return y.coerce(m,b,n,ut,rt)}var _=y.coerceFont(x,"font",s.font);x("bgcolor",s.paper_bgcolor),x("bordercolor");var A=x("visible");if(A){for(var d,k=function(ut,rt){var gt=d._input,it=d;return y.coerce(gt,it,P,ut,rt)},w=s.font||{},D=y.coerceFont(x,"grouptitlefont",w,{overrideDflt:{size:Math.round(w.size*1.1)}}),E=0,I=!1,M="normal",p=(s.shapes||[]).filter(function(ut){return ut.showlegend}),g=h.concat(p).filter(function(ut){return o===(ut.legend||"legend")}),C=0;C(o==="legend"?1:0));if(N===!1&&(s[o]=void 0),!(N===!1&&!m.uirevision)&&(x("uirevision",s.uirevision),N!==!1)){x("borderwidth");var B=x("orientation"),U=x("yref"),V=x("xref"),W=B==="h",F=U==="paper",H=V==="paper",q,G,tt,ht="left";W?(q=0,f.getComponentMethod("rangeslider","isVisible")(c.xaxis)?F?(G=1.1,tt="bottom"):(G=1,tt="top"):F?(G=-.1,tt="top"):(G=0,tt="bottom")):(G=1,tt="auto",H?q=1.02:(q=1,ht="right")),y.coerce(m,b,{x:{valType:"number",editType:"legend",min:H?-2:0,max:H?3:1,dflt:q}},"x"),y.coerce(m,b,{y:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:G}},"y"),x("traceorder",M),a.isGrouped(s[o])&&x("tracegroupgap"),x("entrywidth"),x("entrywidthmode"),x("indentation"),x("itemsizing"),x("itemwidth"),x("itemclick"),x("itemdoubleclick"),x("groupclick"),x("xanchor",ht),x("yanchor",tt),x("maxheight"),x("valign"),y.noneOrAll(m,b,["x","y"]);var bt=x("title.text");if(bt){x("title.side",W?"left":"top");var vt=y.extendFlat({},_,{size:y.bigFont(_.size)});y.coerceFont(x,"title.font",vt)}}}}Y.exports=function(o,c,s){var h,m=s.slice(),b=c.shapes;if(b)for(h=0;h{var f=ls(),y=jn(),z=y.pushUnique,P=!0;Y.exports=function(n,i,a){var l=i._fullLayout;if(i._dragged||i._editing)return;var o=l.legend.itemclick,c=l.legend.itemdoubleclick,s=l.legend.groupclick;a===1&&o==="toggle"&&c==="toggleothers"&&P&&i.data&&i._context.showTips&&y.notifier(y._(i,"Double-click on legend to isolate one trace"),"long"),P=!1;var h;if(a===1?h=o:a===2&&(h=c),!h)return;var m=s==="togglegroup",b=l.hiddenlabels?l.hiddenlabels.slice():[],x=n.data()[0][0];if(x.groupTitle&&x.noClick)return;var _=i._fullData,A=(l.shapes||[]).filter(function(ue){return ue.showlegend}),d=_.concat(A),k=x.trace;k._isShape&&(k=k._fullInput);var w=k.legendgroup,D,E,I,M,p,g,C={},S=[],N=[],B=[];function U(ue,Mt){var Ot=S.indexOf(ue),Lt=C.visible;return Lt||(Lt=C.visible=[]),S.indexOf(ue)===-1&&(S.push(ue),Ot=S.length-1),Lt[Ot]=Mt,Ot}var V=(l.shapes||[]).map(function(ue){return ue._input}),W=!1;function F(ue,Mt){V[ue].visible=Mt,W=!0}function H(ue,Mt){if(!(x.groupTitle&&!m)){var Ot=ue._fullInput||ue,Lt=Ot._isShape,ie=Ot.index;ie===void 0&&(ie=Ot._index);var be=Ot.visible===!1?!1:Mt;Lt?F(ie,be):U(ie,be)}}var q=k.legend,G=k._fullInput,tt=G&&G._isShape;if(!tt&&f.traceIs(k,"pie-like")){var ht=x.label,bt=b.indexOf(ht);if(h==="toggle")bt===-1?b.push(ht):b.splice(bt,1);else if(h==="toggleothers"){var vt=bt!==-1,ut=[];for(D=0;D{Y.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),M4=It((et,Y)=>{var f=ls(),y=tb();Y.exports=function(z,P,n){var i=P._inHover,a=y.isGrouped(P),l=y.isReversed(P),o={},c=[],s=!1,h={},m=0,b=0,x,_;function A(H,q,G){if(P.visible!==!1&&!(n&&H!==P._id))if(q===""||!y.isGrouped(P)){var tt="~~i"+m;c.push(tt),o[tt]=[G],m++}else c.indexOf(q)===-1?(c.push(q),s=!0,o[q]=[G]):o[q].push(G)}for(x=0;xS&&(C=S)}p[x][0]._groupMinRank=C,p[x][0]._preGroupSort=x}var N=function(H,q){return H[0]._groupMinRank-q[0]._groupMinRank||H[0]._preGroupSort-q[0]._preGroupSort},B=function(H,q){return H.trace.legendrank-q.trace.legendrank||H._preSort-q._preSort};for(p.forEach(function(H,q){H[0]._preGroupSort=q}),p.sort(N),x=0;x{var Y=jn();function f(y){return y.indexOf("e")!==-1?y.replace(/[.]?0+e/,"e"):y.indexOf(".")!==-1?y.replace(/[.]?0+$/,""):y}et.formatPiePercent=function(y,z){var P=f((y*100).toPrecision(3));return Y.numSeparate(P,z)+"%"},et.formatPieValue=function(y,z){var P=f(y.toPrecision(10));return Y.numSeparate(P,z)},et.getFirstFilled=function(y,z){if(Y.isArrayOrTypedArray(y))for(var P=0;P{var f=Js(),y=Hn();Y.exports=function(z,P,n,i){var a=n.marker.pattern;a&&a.shape?f.pointStyle(z,n,i,P):y.fill(z,P.color)}}),Wv=It((et,Y)=>{var f=Hn(),y=Vv().castOption,z=_8();Y.exports=function(P,n,i,a){var l=i.marker.line,o=y(l.color,n.pts)||f.defaultLine,c=y(l.width,n.pts)||0;P.call(z,n,i,a).style("stroke-width",c).call(f.stroke,o)}}),E4=It((et,Y)=>{var f=Br(),y=ls(),z=jn(),P=z.strTranslate,n=Js(),i=Hn(),a=fp().extractOpts,l=Fu(),o=Wv(),c=Vv().castOption,s=mw(),h=12,m=5,b=2,x=10,_=5;Y.exports=function(w,D,E){var I=D._fullLayout;E||(E=I.legend);var M=E.itemsizing==="constant",p=E.itemwidth,g=(p+s.itemGap*2)/2,C=P(g,0),S=function(ut,rt,gt,it){var st;if(ut+1)st=ut;else if(rt&&rt.width>0)st=rt.width;else return 0;return M?it:Math.min(st,gt)};w.each(function(ut){var rt=f.select(this),gt=z.ensureSingle(rt,"g","layers");gt.style("opacity",ut[0].trace.opacity);var it=E.indentation,st=E.valign,xt=ut[0].lineHeight,ot=ut[0].height;if(st==="middle"&&it===0||!xt||!ot)gt.attr("transform",null);else{var J={top:1,bottom:-1}[st],mt=J*(.5*(xt-ot+3))||0,dt=E.indentation;gt.attr("transform",P(dt,mt))}var Ct=gt.selectAll("g.legendfill").data([ut]);Ct.enter().append("g").classed("legendfill",!0);var Rt=gt.selectAll("g.legendlines").data([ut]);Rt.enter().append("g").classed("legendlines",!0);var Bt=gt.selectAll("g.legendsymbols").data([ut]);Bt.enter().append("g").classed("legendsymbols",!0),Bt.selectAll("g.legendpoints").data([ut]).enter().append("g").classed("legendpoints",!0)}).each(vt).each(U).each(W).each(V).each(H).each(ht).each(tt).each(N).each(B).each(q).each(G);function N(ut){var rt=d(ut),gt=rt.showFill,it=rt.showLine,st=rt.showGradientLine,xt=rt.showGradientFill,ot=rt.anyFill,J=rt.anyLine,mt=ut[0],dt=mt.trace,Ct,Rt,Bt=a(dt),Zt=Bt.colorscale,Gt=Bt.reversescale,ee=function(Lt){if(Lt.size())if(gt)n.fillGroupStyle(Lt,D,!0);else{var ie="legendfill-"+dt.uid;n.gradient(Lt,D,ie,A(Gt),Zt,"fill")}},xe=function(Lt){if(Lt.size()){var ie="legendline-"+dt.uid;n.lineGroupStyle(Lt),n.gradient(Lt,D,ie,A(Gt),Zt,"stroke")}},ge=l.hasMarkers(dt)||!ot?"M5,0":J?"M5,-2":"M5,-3",ye=f.select(this),ue=ye.select(".legendfill").selectAll("path").data(gt||xt?[ut]:[]);if(ue.enter().append("path").classed("js-fill",!0),ue.exit().remove(),ue.attr("d",ge+"h"+p+"v6h-"+p+"z").call(ee),it||st){var Mt=S(void 0,dt.line,x,m);Rt=z.minExtend(dt,{line:{width:Mt}}),Ct=[z.minExtend(mt,{trace:Rt})]}var Ot=ye.select(".legendlines").selectAll("path").data(it||st?[Ct]:[]);Ot.enter().append("path").classed("js-line",!0),Ot.exit().remove(),Ot.attr("d",ge+(st?"l"+p+",0.0001":"h"+p)).call(it?n.lineGroupStyle:xe)}function B(ut){var rt=d(ut),gt=rt.anyFill,it=rt.anyLine,st=rt.showLine,xt=rt.showMarker,ot=ut[0],J=ot.trace,mt=!xt&&!it&&!gt&&l.hasText(J),dt,Ct;function Rt(ue,Mt,Ot,Lt){var ie=z.nestedProperty(J,ue).get(),be=z.isArrayOrTypedArray(ie)&&Mt?Mt(ie):ie;if(M&&be&&Lt!==void 0&&(be=Lt),Ot){if(beOt[1])return Ot[1]}return be}function Bt(ue){return ot._distinct&&ot.index&&ue[ot.index]?ue[ot.index]:ue[0]}if(xt||mt||st){var Zt={},Gt={};if(xt){Zt.mc=Rt("marker.color",Bt),Zt.mx=Rt("marker.symbol",Bt),Zt.mo=Rt("marker.opacity",z.mean,[.2,1]),Zt.mlc=Rt("marker.line.color",Bt),Zt.mlw=Rt("marker.line.width",z.mean,[0,5],b),Gt.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var ee=Rt("marker.size",z.mean,[2,16],h);Zt.ms=ee,Gt.marker.size=ee}st&&(Gt.line={width:Rt("line.width",Bt,[0,10],m)}),mt&&(Zt.tx="Aa",Zt.tp=Rt("textposition",Bt),Zt.ts=10,Zt.tc=Rt("textfont.color",Bt),Zt.tf=Rt("textfont.family",Bt),Zt.tw=Rt("textfont.weight",Bt),Zt.ty=Rt("textfont.style",Bt),Zt.tv=Rt("textfont.variant",Bt),Zt.tC=Rt("textfont.textcase",Bt),Zt.tE=Rt("textfont.lineposition",Bt),Zt.tS=Rt("textfont.shadow",Bt)),dt=[z.minExtend(ot,Zt)],Ct=z.minExtend(J,Gt),Ct.selectedpoints=null,Ct.texttemplate=null}var xe=f.select(this).select("g.legendpoints"),ge=xe.selectAll("path.scatterpts").data(xt?dt:[]);ge.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",C),ge.exit().remove(),ge.call(n.pointStyle,Ct,D),xt&&(dt[0].mrc=3);var ye=xe.selectAll("g.pointtext").data(mt?dt:[]);ye.enter().append("g").classed("pointtext",!0).append("text").attr("transform",C),ye.exit().remove(),ye.selectAll("text").call(n.textPointStyle,Ct,D)}function U(ut){var rt=ut[0].trace,gt=rt.type==="waterfall";if(ut[0]._distinct&>){var it=ut[0].trace[ut[0].dir].marker;return ut[0].mc=it.color,ut[0].mlw=it.line.width,ut[0].mlc=it.line.color,F(ut,this,"waterfall")}var st=[];rt.visible&>&&(st=ut[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var xt=f.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(st);xt.enter().append("path").classed("legendwaterfall",!0).attr("transform",C).style("stroke-miterlimit",1),xt.exit().remove(),xt.each(function(ot){var J=f.select(this),mt=rt[ot[0]].marker,dt=S(void 0,mt.line,_,b);J.attr("d",ot[1]).style("stroke-width",dt+"px").call(i.fill,mt.color),dt&&J.call(i.stroke,mt.line.color)})}function V(ut){F(ut,this)}function W(ut){F(ut,this,"funnel")}function F(ut,rt,gt){var it=ut[0].trace,st=it.marker||{},xt=st.line||{},ot=st.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",J=gt?it.visible&&it.type===gt:y.traceIs(it,"bar"),mt=f.select(rt).select("g.legendpoints").selectAll("path.legend"+gt).data(J?[ut]:[]);mt.enter().append("path").classed("legend"+gt,!0).attr("d",ot).attr("transform",C),mt.exit().remove(),mt.each(function(dt){var Ct=f.select(this),Rt=dt[0],Bt=S(Rt.mlw,st.line,_,b);Ct.style("stroke-width",Bt+"px");var Zt=Rt.mcc;if(!E._inHover&&"mc"in Rt){var Gt=a(st),ee=Gt.mid;ee===void 0&&(ee=(Gt.max+Gt.min)/2),Zt=n.tryColorscale(st,"")(ee)}var xe=Zt||Rt.mc||st.color,ge=st.pattern,ye=n.getPatternAttr,ue=ge&&(ye(ge.shape,0,"")||ye(ge.path,0,""));if(ue){var Mt=ye(ge.bgcolor,0,null),Ot=ye(ge.fgcolor,0,null),Lt=ge.fgopacity,ie=k(ge.size,8,10),be=k(ge.solidity,.5,1),ce="legend-"+it.uid;Ct.call(n.pattern,"legend",D,ce,ue,ie,be,Zt,ge.fillmode,Mt,Ot,Lt)}else Ct.call(i.fill,xe);Bt&&i.stroke(Ct,Rt.mlc||xt.color)})}function H(ut){var rt=ut[0].trace,gt=f.select(this).select("g.legendpoints").selectAll("path.legendbox").data(rt.visible&&y.traceIs(rt,"box-violin")?[ut]:[]);gt.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),gt.exit().remove(),gt.each(function(){var it=f.select(this);if((rt.boxpoints==="all"||rt.points==="all")&&i.opacity(rt.fillcolor)===0&&i.opacity((rt.line||{}).color)===0){var st=z.minExtend(rt,{marker:{size:M?h:z.constrain(rt.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});gt.call(n.pointStyle,st,D)}else{var xt=S(void 0,rt.line,_,b);it.style("stroke-width",xt+"px").call(i.fill,rt.fillcolor),xt&&i.stroke(it,rt.line.color)}})}function q(ut){var rt=ut[0].trace,gt=f.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(rt.visible&&rt.type==="candlestick"?[ut,ut]:[]);gt.enter().append("path").classed("legendcandle",!0).attr("d",function(it,st){return st?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",C).style("stroke-miterlimit",1),gt.exit().remove(),gt.each(function(it,st){var xt=f.select(this),ot=rt[st?"increasing":"decreasing"],J=S(void 0,ot.line,_,b);xt.style("stroke-width",J+"px").call(i.fill,ot.fillcolor),J&&i.stroke(xt,ot.line.color)})}function G(ut){var rt=ut[0].trace,gt=f.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(rt.visible&&rt.type==="ohlc"?[ut,ut]:[]);gt.enter().append("path").classed("legendohlc",!0).attr("d",function(it,st){return st?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",C).style("stroke-miterlimit",1),gt.exit().remove(),gt.each(function(it,st){var xt=f.select(this),ot=rt[st?"increasing":"decreasing"],J=S(void 0,ot.line,_,b);xt.style("fill","none").call(n.dashLine,ot.line.dash,J),J&&i.stroke(xt,ot.line.color)})}function tt(ut){bt(ut,this,"pie")}function ht(ut){bt(ut,this,"funnelarea")}function bt(ut,rt,gt){var it=ut[0],st=it.trace,xt=gt?st.visible&&st.type===gt:y.traceIs(st,gt),ot=f.select(rt).select("g.legendpoints").selectAll("path.legend"+gt).data(xt?[ut]:[]);if(ot.enter().append("path").classed("legend"+gt,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),ot.exit().remove(),ot.size()){var J=st.marker||{},mt=S(c(J.line.width,it.pts),J.line,_,b),dt="pieLike",Ct=z.minExtend(st,{marker:{line:{width:mt}}},dt),Rt=z.minExtend(it,{trace:Ct},dt);o(ot,Rt,Ct,D)}}function vt(ut){var rt=ut[0].trace,gt,it=[];if(rt.visible)switch(rt.type){case"histogram2d":case"heatmap":it=[["M-15,-2V4H15V-2Z"]],gt=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":it=[["M-6,-6V6H6V-6Z"]],gt=!0;break;case"densitymapbox":case"densitymap":it=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],gt="radial";break;case"cone":it=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],gt=!1;break;case"streamtube":it=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],gt=!1;break;case"surface":it=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],gt=!0;break;case"mesh3d":it=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],gt=!1;break;case"volume":it=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],gt=!0;break;case"isosurface":it=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],gt=!1;break}var st=f.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(it);st.enter().append("path").classed("legend3dandfriends",!0).attr("transform",C).style("stroke-miterlimit",1),st.exit().remove(),st.each(function(xt,ot){var J=f.select(this),mt=a(rt),dt=mt.colorscale,Ct=mt.reversescale,Rt=function(ee){if(ee.size()){var xe="legendfill-"+rt.uid;n.gradient(ee,D,xe,A(Ct,gt==="radial"),dt,"fill")}},Bt;if(dt){if(!gt){var Zt=dt.length;Bt=ot===0?dt[Ct?Zt-1:0][1]:ot===1?dt[Ct?0:Zt-1][1]:dt[Math.floor((Zt-1)/2)][1]}}else{var Gt=rt.vertexcolor||rt.facecolor||rt.color;Bt=z.isArrayOrTypedArray(Gt)?Gt[ot]||Gt[0]:Gt}J.attr("d",xt[0]),Bt?J.call(i.fill,Bt):J.call(Rt)})}};function A(w,D){var E=D?"radial":"horizontal";return E+(w?"":"reversed")}function d(w){var D=w[0].trace,E=D.contours,I=l.hasLines(D),M=l.hasMarkers(D),p=D.visible&&D.fill&&D.fill!=="none",g=!1,C=!1;if(E){var S=E.coloring;S==="lines"?g=!0:I=S==="none"||S==="heatmap"||E.showlines,E.type==="constraint"?p=E._operation!=="=":(S==="fill"||S==="heatmap")&&(C=!0)}return{showMarker:M,showLine:I,showFill:p,showGradientLine:g,showGradientFill:C,anyLine:I||g,anyFill:p||C}}function k(w,D,E){return w&&z.isArrayOrTypedArray(w)?D:w>E?E:w}}),gw=It((et,Y)=>{var f=Br(),y=jn(),z=lh(),P=ls(),n=qg(),i=Up(),a=Js(),l=Hn(),o=uu(),c=y8(),s=mw(),h=Rd(),m=h.LINE_SPACING,b=h.FROM_TL,x=h.FROM_BR,_=M4(),A=E4(),d=tb(),k=1,w=/^legend[0-9]*$/;Y.exports=function(q,G){if(G)E(q,G);else{var tt=q._fullLayout,ht=tt._legends,bt=tt._infolayer.selectAll('[class^="legend"]');bt.each(function(){var gt=f.select(this),it=gt.attr("class"),st=it.split(" ")[0];st.match(w)&&ht.indexOf(st)===-1&>.remove()});for(var vt=0;vt1)}var mt=ht.hiddenlabels||[];if(!rt&&(!ht.showlegend||!gt.length))return ut.selectAll("."+bt).remove(),ht._topdefs.select("#"+vt).remove(),z.autoMargin(q,bt);var dt=y.ensureSingle(ut,"g",bt,function(ye){rt||ye.attr("pointer-events","all")}),Ct=y.ensureSingleById(ht._topdefs,"clipPath",vt,function(ye){ye.append("rect")}),Rt=y.ensureSingle(dt,"rect","bg",function(ye){ye.attr("shape-rendering","crispEdges")});Rt.call(l.stroke,tt.bordercolor).call(l.fill,tt.bgcolor).style("stroke-width",tt.borderwidth+"px");var Bt=y.ensureSingle(dt,"g","scrollbox"),Zt=tt.title;tt._titleWidth=0,tt._titleHeight=0;var Gt;Zt.text?(Gt=y.ensureSingle(Bt,"text",bt+"titletext"),Gt.attr("text-anchor","start").call(a.font,Zt.font).text(Zt.text),S(Gt,Bt,q,tt,k)):Bt.selectAll("."+bt+"titletext").remove();var ee=y.ensureSingle(dt,"rect","scrollbar",function(ye){ye.attr(s.scrollBarEnterAttrs).call(l.fill,s.scrollBarColor)}),xe=Bt.selectAll("g.groups").data(gt);xe.enter().append("g").attr("class","groups"),xe.exit().remove();var ge=xe.selectAll("g.traces").data(y.identity);ge.enter().append("g").attr("class","traces"),ge.exit().remove(),ge.style("opacity",function(ye){var ue=ye[0].trace;return P.traceIs(ue,"pie-like")?mt.indexOf(ye[0].label)!==-1?.5:1:ue.visible==="legendonly"?.5:1}).each(function(){f.select(this).call(p,q,tt)}).call(A,q,tt).each(function(){rt||f.select(this).call(C,q,bt)}),y.syncOrAsync([z.previousPromises,function(){return U(q,xe,ge,tt)},function(){var ye=ht._size,ue=tt.borderwidth,Mt=tt.xref==="paper",Ot=tt.yref==="paper";if(Zt.text&&D(Gt,tt,ue),!rt){var Lt,ie;Mt?Lt=ye.l+ye.w*tt.x-b[W(tt)]*tt._width:Lt=ht.width*tt.x-b[W(tt)]*tt._width,Ot?ie=ye.t+ye.h*(1-tt.y)-b[F(tt)]*tt._effHeight:ie=ht.height*(1-tt.y)-b[F(tt)]*tt._effHeight;var be=V(q,bt,Lt,ie);if(be)return;if(ht.margin.autoexpand){var ce=Lt,Le=ie;Lt=Mt?y.constrain(Lt,0,ht.width-tt._width):ce,ie=Ot?y.constrain(ie,0,ht.height-tt._effHeight):Le,Lt!==ce&&y.log("Constrain "+bt+".x to make legend fit inside graph"),ie!==Le&&y.log("Constrain "+bt+".y to make legend fit inside graph")}a.setTranslate(dt,Lt,ie)}if(ee.on(".drag",null),dt.on("wheel",null),rt||tt._height<=tt._maxHeight||q._context.staticPlot){var Ze=tt._effHeight;rt&&(Ze=tt._height),Rt.attr({width:tt._width-ue,height:Ze-ue,x:ue/2,y:ue/2}),a.setTranslate(Bt,0,0),Ct.select("rect").attr({width:tt._width-2*ue,height:Ze-2*ue,x:ue,y:ue}),a.setClipUrl(Bt,vt,q),a.setRect(ee,0,0,0,0),delete tt._scrollY}else{var Qe=Math.max(s.scrollBarMinHeight,tt._effHeight*tt._effHeight/tt._height),mr=tt._effHeight-Qe-2*s.scrollBarMargin,fr=tt._height-tt._effHeight,Jr=mr/fr,an=Math.min(tt._scrollY||0,fr);Rt.attr({width:tt._width-2*ue+s.scrollBarWidth+s.scrollBarMargin,height:tt._effHeight-ue,x:ue/2,y:ue/2}),Ct.select("rect").attr({width:tt._width-2*ue+s.scrollBarWidth+s.scrollBarMargin,height:tt._effHeight-2*ue,x:ue,y:ue+an}),a.setClipUrl(Bt,vt,q),_t(an,Qe,Jr),dt.on("wheel",function(){an=y.constrain(tt._scrollY+f.event.deltaY/fr*mr,0,fr),_t(an,Qe,Jr),an!==0&&an!==fr&&f.event.preventDefault()});var Er,dn,_n,Oe=function(Me,qe,Ye){var ur=(Ye-qe)/Jr+Me;return y.constrain(ur,0,fr)},Xt=function(Me,qe,Ye){var ur=(qe-Ye)/Jr+Me;return y.constrain(ur,0,fr)},oe=f.behavior.drag().on("dragstart",function(){var Me=f.event.sourceEvent;Me.type==="touchstart"?Er=Me.changedTouches[0].clientY:Er=Me.clientY,_n=an}).on("drag",function(){var Me=f.event.sourceEvent;Me.buttons===2||Me.ctrlKey||(Me.type==="touchmove"?dn=Me.changedTouches[0].clientY:dn=Me.clientY,an=Oe(_n,Er,dn),_t(an,Qe,Jr))});ee.call(oe);var zt=f.behavior.drag().on("dragstart",function(){var Me=f.event.sourceEvent;Me.type==="touchstart"&&(Er=Me.changedTouches[0].clientY,_n=an)}).on("drag",function(){var Me=f.event.sourceEvent;Me.type==="touchmove"&&(dn=Me.changedTouches[0].clientY,an=Xt(_n,Er,dn),_t(an,Qe,Jr))});Bt.call(zt)}function _t(Me,qe,Ye){tt._scrollY=q._fullLayout[bt]._scrollY=Me,a.setTranslate(Bt,0,-Me),a.setRect(ee,tt._width,s.scrollBarMargin+Me*Ye,s.scrollBarWidth,qe),Ct.select("rect").attr("y",ue+Me)}if(q._context.edits.legendPosition){var Pt,Ht,ae,he;dt.classed("cursor-move",!0),i.init({element:dt.node(),gd:q,prepFn:function(Me){if(Me.target!==ee.node()){var qe=a.getTranslate(dt);ae=qe.x,he=qe.y}},moveFn:function(Me,qe){if(ae!==void 0&&he!==void 0){var Ye=ae+Me,ur=he+qe;a.setTranslate(dt,Ye,ur),Pt=i.align(Ye,tt._width,ye.l,ye.l+ye.w,tt.xanchor),Ht=i.align(ur+tt._height,-tt._height,ye.t+ye.h,ye.t,tt.yanchor)}},doneFn:function(){if(Pt!==void 0&&Ht!==void 0){var Me={};Me[bt+".x"]=Pt,Me[bt+".y"]=Ht,P.call("_guiRelayout",q,Me)}},clickFn:function(Me,qe){var Ye=ut.selectAll("g.traces").filter(function(){var ur=this.getBoundingClientRect();return qe.clientX>=ur.left&&qe.clientX<=ur.right&&qe.clientY>=ur.top&&qe.clientY<=ur.bottom});Ye.size()>0&&M(q,dt,Ye,Me,qe)}})}}],q)}}function I(q,G,tt){var ht=q[0],bt=ht.width,vt=G.entrywidthmode,ut=ht.trace.legendwidth||G.entrywidth;return vt==="fraction"?G._maxWidth*ut:tt+(ut||bt)}function M(q,G,tt,ht,bt){var vt=tt.data()[0][0].trace,ut={event:bt,node:tt.node(),curveNumber:vt.index,expandedIndex:vt.index,data:q.data,layout:q.layout,frames:q._transitionData._frames,config:q._context,fullData:q._fullData,fullLayout:q._fullLayout};vt._group&&(ut.group=vt._group),P.traceIs(vt,"pie-like")&&(ut.label=tt.datum()[0].label);var rt=n.triggerHandler(q,"plotly_legendclick",ut);if(ht===1){if(rt===!1)return;G._clickTimeout=setTimeout(function(){q._fullLayout&&c(tt,q,ht)},q._context.doubleClickDelay)}else if(ht===2){G._clickTimeout&&clearTimeout(G._clickTimeout),q._legendMouseDownTime=0;var gt=n.triggerHandler(q,"plotly_legenddoubleclick",ut);gt!==!1&&rt!==!1&&c(tt,q,ht)}}function p(q,G,tt){var ht=H(tt),bt=q.data()[0][0],vt=bt.trace,ut=P.traceIs(vt,"pie-like"),rt=!tt._inHover&&G._context.edits.legendText&&!ut,gt=tt._maxNameLength,it,st;bt.groupTitle?(it=bt.groupTitle.text,st=bt.groupTitle.font):(st=tt.font,tt.entries?it=bt.text:(it=ut?bt.label:vt.name,vt._meta&&(it=y.templateString(it,vt._meta))));var xt=y.ensureSingle(q,"text",ht+"text");xt.attr("text-anchor","start").call(a.font,st).text(rt?g(it,gt):it);var ot=tt.indentation+tt.itemwidth+s.itemGap*2;o.positionText(xt,ot,0),rt?xt.call(o.makeEditable,{gd:G,text:it}).call(S,q,G,tt).on("edit",function(J){this.text(g(J,gt)).call(S,q,G,tt);var mt=bt.trace._fullInput||{},dt={};return dt.name=J,mt._isShape?P.call("_guiRelayout",G,"shapes["+vt.index+"].name",dt.name):P.call("_guiRestyle",G,dt,vt.index)}):S(xt,q,G,tt)}function g(q,G){var tt=Math.max(4,G);if(q&&q.trim().length>=tt/2)return q;q=q||"";for(var ht=tt-q.length;ht>0;ht--)q+=" ";return q}function C(q,G,tt){var ht=G._context.doubleClickDelay,bt,vt=1,ut=y.ensureSingle(q,"rect",tt+"toggle",function(rt){G._context.staticPlot||rt.style("cursor","pointer").attr("pointer-events","all"),rt.call(l.fill,"rgba(0,0,0,0)")});G._context.staticPlot||(ut.on("mousedown",function(){bt=new Date().getTime(),bt-G._legendMouseDownTimeht&&(vt=Math.max(vt-1,1)),M(G,rt,q,vt,f.event)}}))}function S(q,G,tt,ht,bt){ht._inHover&&q.attr("data-notex",!0),o.convertToTspans(q,tt,function(){N(G,tt,ht,bt)})}function N(q,G,tt,ht){var bt=q.data()[0][0];if(!tt._inHover&&bt&&!bt.trace.showlegend){q.remove();return}var vt=q.select("g[class*=math-group]"),ut=vt.node(),rt=H(tt);tt||(tt=G._fullLayout[rt]);var gt=tt.borderwidth,it;ht===k?it=tt.title.font:bt.groupTitle?it=bt.groupTitle.font:it=tt.font;var st=it.size*m,xt,ot;if(ut){var J=a.bBox(ut);xt=J.height,ot=J.width,ht===k?a.setTranslate(vt,gt,gt+xt*.75):a.setTranslate(vt,0,xt*.25)}else{var mt="."+rt+(ht===k?"title":"")+"text",dt=q.select(mt),Ct=o.lineCount(dt),Rt=dt.node();if(xt=st*Ct,ot=Rt?a.bBox(Rt).width:0,ht===k)tt.title.side==="left"&&(ot+=s.itemGap*2),o.positionText(dt,gt+s.titlePad,gt+st);else{var Bt=s.itemGap*2+tt.indentation+tt.itemwidth;bt.groupTitle&&(Bt=s.itemGap,ot-=tt.indentation+tt.itemwidth),o.positionText(dt,Bt,-st*((Ct-1)/2-.3))}}ht===k?(tt._titleWidth=ot,tt._titleHeight=xt):(bt.lineHeight=st,bt.height=Math.max(xt,16)+3,bt.width=ot)}function B(q){var G=0,tt=0,ht=q.title.side;return ht&&(ht.indexOf("left")!==-1&&(G=q._titleWidth),ht.indexOf("top")!==-1&&(tt=q._titleHeight)),[G,tt]}function U(q,G,tt,ht){var bt=q._fullLayout,vt=H(ht);ht||(ht=bt[vt]);var ut=bt._size,rt=d.isVertical(ht),gt=d.isGrouped(ht),it=ht.entrywidthmode==="fraction",st=ht.borderwidth,xt=2*st,ot=s.itemGap,J=ht.indentation+ht.itemwidth+ot*2,mt=2*(st+ot),dt=F(ht),Ct=ht.y<0||ht.y===0&&dt==="top",Rt=ht.y>1||ht.y===1&&dt==="bottom",Bt=ht.tracegroupgap,Zt={};let{orientation:Gt,yref:ee}=ht,{maxheight:xe}=ht,ge=Ct||Rt||Gt!=="v"||ee!=="paper";xe||(xe=ge?.5:1);let ye=ge?bt.height:ut.h;ht._maxHeight=Math.max(xe>1?xe:xe*ye,30);var ue=0;ht._width=0,ht._height=0;var Mt=B(ht);if(rt)tt.each(function(_t){var Pt=_t[0].height;a.setTranslate(this,st+Mt[0],st+Mt[1]+ht._height+Pt/2+ot),ht._height+=Pt,ht._width=Math.max(ht._width,_t[0].width)}),ue=J+ht._width,ht._width+=ot+J+xt,ht._height+=mt,gt&&(G.each(function(_t,Pt){a.setTranslate(this,0,Pt*ht.tracegroupgap)}),ht._height+=(ht._lgroupsLength-1)*ht.tracegroupgap);else{var Ot=W(ht),Lt=ht.x<0||ht.x===0&&Ot==="right",ie=ht.x>1||ht.x===1&&Ot==="left",be=Rt||Ct,ce=bt.width/2;ht._maxWidth=Math.max(Lt?be&&Ot==="left"?ut.l+ut.w:ce:ie?be&&Ot==="right"?ut.r+ut.w:ce:ut.w,2*J);var Le=0,Ze=0;tt.each(function(_t){var Pt=I(_t,ht,J);Le=Math.max(Le,Pt),Ze+=Pt}),ue=null;var Qe=0;if(gt){var mr=0,fr=0,Jr=0;G.each(function(){var _t=0,Pt=0;f.select(this).selectAll("g.traces").each(function(ae){var he=I(ae,ht,J),Me=ae[0].height;a.setTranslate(this,Mt[0],Mt[1]+st+ot+Me/2+Pt),Pt+=Me,_t=Math.max(_t,he),Zt[ae[0].trace.legendgroup]=_t});var Ht=_t+ot;fr>0&&Ht+st+fr>ht._maxWidth?(Qe=Math.max(Qe,fr),fr=0,Jr+=mr+Bt,mr=Pt):mr=Math.max(mr,Pt),a.setTranslate(this,fr,Jr),fr+=Ht}),ht._width=Math.max(Qe,fr)+st,ht._height=Jr+mr+mt}else{var an=tt.size(),Er=Ze+xt+(an-1)*ot=ht._maxWidth&&(Qe=Math.max(Qe,Xt),_n=0,Oe+=dn,ht._height+=dn,dn=0),a.setTranslate(this,Mt[0]+st+_n,Mt[1]+st+Oe+Pt/2+ot),Xt=_n+Ht+ot,_n+=ae,dn=Math.max(dn,Pt)}),Er?(ht._width=_n+xt,ht._height=dn+mt):(ht._width=Math.max(Qe,Xt)+xt,ht._height+=dn+mt)}}ht._width=Math.ceil(Math.max(ht._width+Mt[0],ht._titleWidth+2*(st+s.titlePad))),ht._height=Math.ceil(Math.max(ht._height+Mt[1],ht._titleHeight+2*(st+s.itemGap))),ht._effHeight=Math.min(ht._height,ht._maxHeight);var oe=q._context.edits,zt=oe.legendText||oe.legendPosition;tt.each(function(_t){var Pt=f.select(this).select("."+vt+"toggle"),Ht=_t[0].height,ae=_t[0].trace.legendgroup,he=I(_t,ht,J);gt&&ae!==""&&(he=Zt[ae]);var Me=zt?J:ue||he;!rt&&!it&&(Me+=ot/2),a.setRect(Pt,0,-Ht/2,Me,Ht)})}function V(q,G,tt,ht){var bt=q._fullLayout,vt=bt[G],ut=W(vt),rt=F(vt),gt=vt.xref==="paper",it=vt.yref==="paper";q._fullLayout._reservedMargin[G]={};var st=vt.y<.5?"b":"t",xt=vt.x<.5?"l":"r",ot={r:bt.width-tt,l:tt+vt._width,b:bt.height-ht,t:ht+vt._effHeight};if(gt&&it)return z.autoMargin(q,G,{x:vt.x,y:vt.y,l:vt._width*b[ut],r:vt._width*x[ut],b:vt._effHeight*x[rt],t:vt._effHeight*b[rt]});gt?q._fullLayout._reservedMargin[G][st]=ot[st]:it||vt.orientation==="v"?q._fullLayout._reservedMargin[G][xt]=ot[xt]:q._fullLayout._reservedMargin[G][st]=ot[st]}function W(q){return y.isRightAnchor(q)?"right":y.isCenterAnchor(q)?"center":"left"}function F(q){return y.isBottomAnchor(q)?"bottom":y.isMiddleAnchor(q)?"middle":"top"}function H(q){return q._id||"legend"}}),vw=It(et=>{var Y=Br(),f=Sr(),y=Xi(),z=jn(),P=z.pushUnique,n=z.strTranslate,i=z.strRotate,a=qg(),l=uu(),o=Zg(),c=Js(),s=Hn(),h=Up(),m=Fs(),b=fu().zindexSeparator,x=ls(),_=T0(),A=aa(),d=eb(),k=gw(),w=A.YANGLE,D=Math.PI*w/180,E=1/Math.sin(D),I=Math.cos(D),M=Math.sin(D),p=A.HOVERARROWSIZE,g=A.HOVERTEXTPAD,C={box:!0,ohlc:!0,violin:!0,candlestick:!0},S={scatter:!0,scattergl:!0,splom:!0};function N(J,mt){return J.distance-mt.distance}et.hover=function(J,mt,dt,Ct){J=z.getGraphDiv(J);var Rt=mt.target;z.throttle(J._fullLayout._uid+A.HOVERID,A.HOVERMINTIME,function(){B(J,mt,dt,Ct,Rt)})},et.loneHover=function(J,mt){var dt=!0;Array.isArray(J)||(dt=!1,J=[J]);var Ct=mt.gd,Rt=st(Ct),Bt=xt(Ct),Zt=J.map(function(Lt){var ie=Lt._x0||Lt.x0||Lt.x||0,be=Lt._x1||Lt.x1||Lt.x||0,ce=Lt._y0||Lt.y0||Lt.y||0,Le=Lt._y1||Lt.y1||Lt.y||0,Ze=Lt.eventData;if(Ze){var Qe=Math.min(ie,be),mr=Math.max(ie,be),fr=Math.min(ce,Le),Jr=Math.max(ce,Le),an=Lt.trace;if(x.traceIs(an,"gl3d")){var Er=Ct._fullLayout[an.scene]._scene.container,dn=Er.offsetLeft,_n=Er.offsetTop;Qe+=dn,mr+=dn,fr+=_n,Jr+=_n}Ze.bbox={x0:Qe+Bt,x1:mr+Bt,y0:fr+Rt,y1:Jr+Rt},mt.inOut_bbox&&mt.inOut_bbox.push(Ze.bbox)}else Ze=!1;return{color:Lt.color||s.defaultLine,x0:Lt.x0||Lt.x||0,x1:Lt.x1||Lt.x||0,y0:Lt.y0||Lt.y||0,y1:Lt.y1||Lt.y||0,xLabel:Lt.xLabel,yLabel:Lt.yLabel,zLabel:Lt.zLabel,text:Lt.text,name:Lt.name,idealAlign:Lt.idealAlign,borderColor:Lt.borderColor,fontFamily:Lt.fontFamily,fontSize:Lt.fontSize,fontColor:Lt.fontColor,fontWeight:Lt.fontWeight,fontStyle:Lt.fontStyle,fontVariant:Lt.fontVariant,nameLength:Lt.nameLength,textAlign:Lt.textAlign,trace:Lt.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Lt.hovertemplate||!1,hovertemplateLabels:Lt.hovertemplateLabels||!1,eventData:Ze}}),Gt=!1,ee=W(Zt,{gd:Ct,hovermode:"closest",rotateLabels:Gt,bgColor:mt.bgColor||s.background,container:Y.select(mt.container),outerContainer:mt.outerContainer||mt.container}),xe=ee.hoverLabels,ge=5,ye=0,ue=0;xe.sort(function(Lt,ie){return Lt.y0-ie.y0}).each(function(Lt,ie){var be=Lt.y0-Lt.by/2;be-gefr[0]._length||Ci<0||Ci>Jr[0]._length)return h.unhoverRaw(J,mt)}if(mt.pointerX=Gi+fr[0]._offset,mt.pointerY=Ci+Jr[0]._offset,"xval"in mt?zt=_.flat(Bt,mt.xval):zt=_.p2c(fr,Gi),"yval"in mt?_t=_.flat(Bt,mt.yval):_t=_.p2c(Jr,Ci),!f(zt[0])||!f(_t[0]))return z.warn("Fx.hover failed",mt,J),h.unhoverRaw(J,mt)}var oa=1/0;function Ke(Ka,Cs){for(Ht=0;Htxr&&(Xt.splice(0,xr),oa=Xt[0].distance),ye&&Oe!==0&&Xt.length===0){zr.distance=Oe,zr.index=!1;var ms=he._module.hoverPoints(zr,ur,Rr,"closest",{hoverLayer:Gt._hoverlayer});if(ms&&(ms=ms.filter(function(Uo){return Uo.spikeDistance<=Oe})),ms&&ms.length){var kl,ul=ms.filter(function(Uo){return Uo.xa.showspikes&&Uo.xa.spikesnap!=="hovered data"});if(ul.length){var Kl=ul[0];f(Kl.x0)&&f(Kl.y0)&&(kl=vr(Kl),(!pn.vLinePoint||pn.vLinePoint.spikeDistance>kl.spikeDistance)&&(pn.vLinePoint=kl))}var vs=ms.filter(function(Uo){return Uo.ya.showspikes&&Uo.ya.spikesnap!=="hovered data"});if(vs.length){var Ns=vs[0];f(Ns.x0)&&f(Ns.y0)&&(kl=vr(Ns),(!pn.hLinePoint||pn.hLinePoint.spikeDistance>kl.spikeDistance)&&(pn.hLinePoint=kl))}}}}}Ke();function sr(Ka,Cs,ps){for(var wl=null,is=1/0,ol,ms=0;msKa.trace.index===Ei.trace.index):Xt=[Ei];var Ga=Xt.length,so=it("x",Ei,Gt),Fe=it("y",Ei,Gt);Ke(so,Fe);var Re=[],Kr={},sn=0,cn=function(Ka){var Cs=C[Ka.trace.type]?U(Ka):Ka.trace.index;if(!Kr[Cs])sn++,Kr[Cs]=sn,Re.push(Ka);else{var ps=Kr[Cs]-1,wl=Re[ps];ps>0&&Math.abs(Ka.distance)Ga-1;Yr--)cn(Xt[Yr]);Xt=Re,Zn()}var un=J._hoverdata,Pn=[],bn=st(J),ze=xt(J);for(let Ka of Xt){var yr=_.makeEventData(Ka,Ka.trace,Ka.cd);if(Ka.hovertemplate!==!1){var en=!1;Ka.cd[Ka.index]&&Ka.cd[Ka.index].ht&&(en=Ka.cd[Ka.index].ht),Ka.hovertemplate=en||Ka.trace.hovertemplate||!1}if(Ka.xa&&Ka.ya){var Rn=Ka.x0+Ka.xa._offset,ni=Ka.x1+Ka.xa._offset,xi=Ka.y0+Ka.ya._offset,Jn=Ka.y1+Ka.ya._offset,Gn=Math.min(Rn,ni),pi=Math.max(Rn,ni),Va=Math.min(xi,Jn),ea=Math.max(xi,Jn);yr.bbox={x0:Gn+ze,x1:pi+ze,y0:Va+bn,y1:ea+bn}}Ka.eventData=[yr],Pn.push(yr)}J._hoverdata=Pn;var go=ue==="y"&&(oe.length>1||Xt.length>1)||ue==="closest"&&ci&&Xt.length>1,mo=s.combine(Gt.plot_bgcolor||s.background,Gt.paper_bgcolor),Go=W(Xt,{gd:J,hovermode:ue,rotateLabels:go,bgColor:mo,container:Gt._hoverlayer,outerContainer:Gt._paper.node(),commonLabelOpts:Gt.hoverlabel,hoverdistance:Gt.hoverdistance}),Lo=Go.hoverLabels;if(_.isUnifiedHover(ue)||(H(Lo,go,Gt,Go.commonLabelBoundingBox),tt(Lo,go,Gt._invScaleX,Gt._invScaleY)),Rt&&Rt.tagName){var Zo=x.getComponentMethod("annotations","hasClickToShow")(J,Pn);o(Y.select(Rt),Zo?"pointer":"")}!Rt||Ct||!vt(J,mt,un)||(un&&J.emit("plotly_unhover",{event:mt,points:un}),J.emit("plotly_hover",{event:mt,points:J._hoverdata,xaxes:fr,yaxes:Jr,xvals:zt,yvals:_t}))}function U(J){return[J.trace.index,J.index,J.x0,J.y0,J.name,J.attr,J.xa?J.xa._id:"",J.ya?J.ya._id:""].join(",")}var V=/([\s\S]*)<\/extra>/;function W(J,mt){var dt=mt.gd,Ct=dt._fullLayout,Rt=mt.hovermode,Bt=mt.rotateLabels,Zt=mt.bgColor,Gt=mt.container,ee=mt.outerContainer,xe=mt.commonLabelOpts||{};if(J.length===0)return[[]];var ge=mt.fontFamily||A.HOVERFONT,ye=mt.fontSize||A.HOVERFONTSIZE,ue=mt.fontWeight||Ct.font.weight,Mt=mt.fontStyle||Ct.font.style,Ot=mt.fontVariant||Ct.font.variant,Lt=mt.fontTextcase||Ct.font.textcase,ie=mt.fontLineposition||Ct.font.lineposition,be=mt.fontShadow||Ct.font.shadow,ce=J[0],Le=ce.xa,Ze=ce.ya,Qe=Rt.charAt(0),mr=Qe+"Label",fr=ce[mr];if(fr===void 0&&Le.type==="multicategory")for(var Jr=0;JrCt.width-ze&&(yr=Ct.width-ze),Ga.attr("d","M"+(un-yr)+",0L"+(un-yr+p)+","+bn+p+"H"+ze+"v"+bn+(g*2+Yr.height)+"H"+-ze+"V"+bn+p+"H"+(un-yr-p)+"Z"),un=yr,Ht.minX=un-ze,Ht.maxX=un+ze,Le.side==="top"?(Ht.minY=Pn-(g*2+Yr.height),Ht.maxY=Pn-g):(Ht.minY=Pn+g,Ht.maxY=Pn+(g*2+Yr.height))}else{var en,Rn,ni;Ze.side==="right"?(en="start",Rn=1,ni="",un=Le._offset+Le._length):(en="end",Rn=-1,ni="-",un=Le._offset),Pn=Ze._offset+(ce.y0+ce.y1)/2,so.attr("text-anchor",en),Ga.attr("d","M0,0L"+ni+p+","+p+"V"+(g+Yr.height/2)+"h"+ni+(g*2+Yr.width)+"V-"+(g+Yr.height/2)+"H"+ni+p+"V-"+p+"Z"),Ht.minY=Pn-(g+Yr.height/2),Ht.maxY=Pn+(g+Yr.height/2),Ze.side==="right"?(Ht.minX=un+p,Ht.maxX=un+p+(g*2+Yr.width)):(Ht.minX=un-p-(g*2+Yr.width),Ht.maxX=un-p);var xi=Yr.height/2,Jn=Er-Yr.top-xi,Gn="clip"+Ct._uid+"commonlabel"+Ze._id,pi;if(unGa.hoverinfo!=="none");if(Ei.length===0)return[];var ae=Ct.hoverlabel,he=ae.font,Me=Ei[0],qe=((Rt==="x unified"?Me.xa:Me.ya).unifiedhovertitle||{}).text,Ye=qe?z.hovertemplateString({data:Rt==="x unified"?[{xa:Me.xa,x:Me.xVal}]:[{ya:Me.ya,y:Me.yVal}],fallback:Me.trace.hovertemplatefallback,locale:Ct._d3locale,template:qe}):fr,ur={showlegend:!0,legend:{title:{text:Ye,font:he},font:he,bgcolor:ae.bgcolor,bordercolor:ae.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:Ct.legend?Ct.legend.traceorder:void 0,orientation:"v"}},Rr={font:he};d(ur,Rr,dt._fullData);var zr=Rr.legend;zr.entries=[];for(var xr=0;xr=0?Zi=Un:Wn+ba=0?Zi=Wn:Li+ba=0?Ji=mn:Zn+oa<_n&&Zn>=0?Ji=Zn:Fi+oa<_n?Ji=Fi:mn-vr=0,(Ei.idealAlign==="top"||!go)&&mo?(ni-=Jn/2,Ei.anchor="end"):go?(ni+=Jn/2,Ei.anchor="start"):Ei.anchor="middle",Ei.crossPos=ni;else{if(Ei.pos=ni,go=Rn+xi/2+ea<=dn,mo=Rn-xi/2-ea>=0,(Ei.idealAlign==="left"||!go)&&mo)Rn-=xi/2,Ei.anchor="end";else if(go)Rn+=xi/2,Ei.anchor="start";else{Ei.anchor="middle";var Go=ea/2,Lo=Rn+Go-dn,Zo=Rn-Go;Lo>0&&(Rn-=Lo),Zo<0&&(Rn+=-Zo)}Ei.crossPos=Rn}Pn.attr("text-anchor",Ei.anchor),ze&&bn.attr("text-anchor",Ei.anchor),Ga.attr("transform",n(Rn,ni)+(Bt?i(w):""))}),{hoverLabels:ca,commonLabelBoundingBox:Ht}}function F(J,mt,dt,Ct,Rt,Bt){var Zt="",Gt="";J.nameOverride!==void 0&&(J.name=J.nameOverride),J.name&&(J.trace._meta&&(J.name=z.templateString(J.name,J.trace._meta)),Zt=rt(J.name,J.nameLength));var ee=dt.charAt(0),xe=ee==="x"?"y":"x";J.zLabel!==void 0?(J.xLabel!==void 0&&(Gt+="x: "+J.xLabel+"
"),J.yLabel!==void 0&&(Gt+="y: "+J.yLabel+"
"),J.trace.type!=="choropleth"&&J.trace.type!=="choroplethmapbox"&&J.trace.type!=="choroplethmap"&&(Gt+=(Gt?"z: ":"")+J.zLabel)):mt&&J[ee+"Label"]===Rt?Gt=J[xe+"Label"]||"":J.xLabel===void 0?J.yLabel!==void 0&&J.trace.type!=="scattercarpet"&&(Gt=J.yLabel):J.yLabel===void 0?Gt=J.xLabel:Gt="("+J.xLabel+", "+J.yLabel+")",(J.text||J.text===0)&&!Array.isArray(J.text)&&(Gt+=(Gt?"
":"")+J.text),J.extraText!==void 0&&(Gt+=(Gt?"
":"")+J.extraText),Bt&&Gt===""&&!J.hovertemplate&&(Zt===""&&Bt.remove(),Gt=Zt);let{hovertemplate:ge=!1}=J;if(ge){let ye=J.hovertemplateLabels||J;J[ee+"Label"]!==Rt&&(ye[ee+"other"]=ye[ee+"Val"],ye[ee+"otherLabel"]=ye[ee+"Label"]),Gt=z.hovertemplateString({data:[J.eventData[0]||{},J.trace._meta],fallback:J.trace.hovertemplatefallback,labels:ye,locale:Ct._d3locale,template:ge}),Gt=Gt.replace(V,(ue,Mt)=>(Zt=rt(Mt,J.nameLength),""))}return[Gt,Zt]}function H(J,mt,dt,Ct){var Rt=mt?"xa":"ya",Bt=mt?"ya":"xa",Zt=0,Gt=1,ee=J.size(),xe=new Array(ee),ge=0,ye=Ct.minX,ue=Ct.maxX,Mt=Ct.minY,Ot=Ct.maxY,Lt=function(zt){return zt*dt._invScaleX},ie=function(zt){return zt*dt._invScaleY};J.each(function(zt){var _t=zt[Rt],Pt=zt[Bt],Ht=_t._id.charAt(0)==="x",ae=_t.range;ge===0&&ae&&ae[0]>ae[1]!==Ht&&(Gt=-1);var he=0,Me=Ht?dt.width:dt.height;if(dt.hovermode==="x"||dt.hovermode==="y"){var qe=q(zt,mt),Ye=zt.anchor,ur=Ye==="end"?-1:1,Rr,zr;if(Ye==="middle")Rr=zt.crossPos+(Ht?ie(qe.y-zt.by/2):Lt(zt.bx/2+zt.tx2width/2)),zr=Rr+(Ht?ie(zt.by):Lt(zt.bx));else if(Ht)Rr=zt.crossPos+ie(p+qe.y)-ie(zt.by/2-p),zr=Rr+ie(zt.by);else{var xr=Lt(ur*p+qe.x),pn=xr+Lt(ur*zt.bx);Rr=zt.crossPos+Math.min(xr,pn),zr=zt.crossPos+Math.max(xr,pn)}Ht?Mt!==void 0&&Ot!==void 0&&Math.min(zr,Ot)-Math.max(Rr,Mt)>1&&(Pt.side==="left"?(he=Pt._mainLinePosition,Me=dt.width):Me=Pt._mainLinePosition):ye!==void 0&&ue!==void 0&&Math.min(zr,ue)-Math.max(Rr,ye)>1&&(Pt.side==="top"?(he=Pt._mainLinePosition,Me=dt.height):Me=Pt._mainLinePosition)}xe[ge++]=[{datum:zt,traceIndex:zt.trace.index,dp:0,pos:zt.pos,posref:zt.posref,size:zt.by*(Ht?E:1)/2,pmin:he,pmax:Me}]}),xe.sort(function(zt,_t){return zt[0].posref-_t[0].posref||Gt*(_t[0].traceIndex-zt[0].traceIndex)});var be,ce,Le,Ze,Qe,mr,fr;function Jr(zt){var _t=zt[0],Pt=zt[zt.length-1];if(ce=_t.pmin-_t.pos-_t.dp+_t.size,Le=Pt.pos+Pt.dp+Pt.size-_t.pmax,ce>.01){for(Qe=zt.length-1;Qe>=0;Qe--)zt[Qe].dp+=ce;be=!1}if(!(Le<.01)){if(ce<-.01){for(Qe=zt.length-1;Qe>=0;Qe--)zt[Qe].dp-=Le;be=!1}if(be){var Ht=0;for(Ze=0;Ze_t.pmax&&Ht++;for(Ze=zt.length-1;Ze>=0&&!(Ht<=0);Ze--)mr=zt[Ze],mr.pos>_t.pmax-1&&(mr.del=!0,Ht--);for(Ze=0;Ze=0;Qe--)zt[Qe].dp-=Le;for(Ze=zt.length-1;Ze>=0&&!(Ht<=0);Ze--)mr=zt[Ze],mr.pos+mr.dp+mr.size>_t.pmax&&(mr.del=!0,Ht--)}}}for(;!be&&Zt<=ee;){for(Zt++,be=!0,Ze=0;Ze.01){for(Qe=Er.length-1;Qe>=0;Qe--)Er[Qe].dp+=ce;for(an.push.apply(an,Er),xe.splice(Ze+1,1),fr=0,Qe=an.length-1;Qe>=0;Qe--)fr+=an[Qe].dp;for(Le=fr/an.length,Qe=an.length-1;Qe>=0;Qe--)an[Qe].dp-=Le;be=!1}else Ze++}xe.forEach(Jr)}for(Ze=xe.length-1;Ze>=0;Ze--){var Oe=xe[Ze];for(Qe=Oe.length-1;Qe>=0;Qe--){var Xt=Oe[Qe],oe=Xt.datum;oe.offset=Xt.dp,oe.del=Xt.del}}}function q(J,mt){var dt=0,Ct=J.offset;return mt&&(Ct*=-M,dt=J.offset*I),{x:dt,y:Ct}}function G(J){var mt={start:1,end:-1,middle:0}[J.anchor],dt=mt*(p+g),Ct=dt+mt*(J.txwidth+g),Rt=J.anchor==="middle";return Rt&&(dt-=J.tx2width/2,Ct+=J.txwidth/2+g),{alignShift:mt,textShiftX:dt,text2ShiftX:Ct}}function tt(J,mt,dt,Ct){var Rt=function(Zt){return Zt*dt},Bt=function(Zt){return Zt*Ct};J.each(function(Zt){var Gt=Y.select(this);if(Zt.del)return Gt.remove();var ee=Gt.select("text.nums"),xe=Zt.anchor,ge=xe==="end"?-1:1,ye=G(Zt),ue=q(Zt,mt),Mt=ue.x,Ot=ue.y,Lt=xe==="middle",ie="hoverlabel"in Zt.trace?Zt.trace.hoverlabel.showarrow:!0,be;Lt?be="M-"+Rt(Zt.bx/2+Zt.tx2width/2)+","+Bt(Ot-Zt.by/2)+"h"+Rt(Zt.bx)+"v"+Bt(Zt.by)+"h-"+Rt(Zt.bx)+"Z":ie?be="M0,0L"+Rt(ge*p+Mt)+","+Bt(p+Ot)+"v"+Bt(Zt.by/2-p)+"h"+Rt(ge*Zt.bx)+"v-"+Bt(Zt.by)+"H"+Rt(ge*p+Mt)+"V"+Bt(Ot-p)+"Z":be="M"+Rt(ge*p+Mt)+","+Bt(Ot-Zt.by/2)+"h"+Rt(ge*Zt.bx)+"v"+Bt(Zt.by)+"h"+Rt(-ge*Zt.bx)+"Z",Gt.select("path").attr("d",be);var ce=Mt+ye.textShiftX,Le=Ot+Zt.ty0-Zt.by/2+g,Ze=Zt.textAlign||"auto";Ze!=="auto"&&(Ze==="left"&&xe!=="start"?(ee.attr("text-anchor","start"),ce=Lt?-Zt.bx/2-Zt.tx2width/2+g:-Zt.bx-g):Ze==="right"&&xe!=="end"&&(ee.attr("text-anchor","end"),ce=Lt?Zt.bx/2-Zt.tx2width/2-g:Zt.bx+g)),ee.call(l.positionText,Rt(ce),Bt(Le)),Zt.tx2width&&(Gt.select("text.name").call(l.positionText,Rt(ye.text2ShiftX+ye.alignShift*g+Mt),Bt(Ot+Zt.ty0-Zt.by/2+g)),Gt.select("rect").call(c.setRect,Rt(ye.text2ShiftX+(ye.alignShift-1)*Zt.tx2width/2+Mt),Bt(Ot-Zt.by/2-1),Rt(Zt.tx2width),Bt(Zt.by+2)))})}function ht(J,mt){var dt=J.index,Ct=J.trace||{},Rt=J.cd[0],Bt=J.cd[dt]||{};function Zt(ue){return ue||f(ue)&&ue===0}var Gt=Array.isArray(dt)?function(ue,Mt){var Ot=z.castOption(Rt,dt,ue);return Zt(Ot)?Ot:z.extractOption({},Ct,"",Mt)}:function(ue,Mt){return z.extractOption(Bt,Ct,ue,Mt)};function ee(ue,Mt,Ot){var Lt=Gt(Mt,Ot);Zt(Lt)&&(J[ue]=Lt)}if(ee("hoverinfo","hi","hoverinfo"),ee("bgcolor","hbg","hoverlabel.bgcolor"),ee("borderColor","hbc","hoverlabel.bordercolor"),ee("fontFamily","htf","hoverlabel.font.family"),ee("fontSize","hts","hoverlabel.font.size"),ee("fontColor","htc","hoverlabel.font.color"),ee("fontWeight","htw","hoverlabel.font.weight"),ee("fontStyle","hty","hoverlabel.font.style"),ee("fontVariant","htv","hoverlabel.font.variant"),ee("nameLength","hnl","hoverlabel.namelength"),ee("textAlign","hta","hoverlabel.align"),J.posref=mt==="y"||mt==="closest"&&Ct.orientation==="h"?J.xa._offset+(J.x0+J.x1)/2:J.ya._offset+(J.y0+J.y1)/2,J.x0=z.constrain(J.x0,0,J.xa._length),J.x1=z.constrain(J.x1,0,J.xa._length),J.y0=z.constrain(J.y0,0,J.ya._length),J.y1=z.constrain(J.y1,0,J.ya._length),J.xLabelVal!==void 0&&(J.xLabel="xLabel"in J?J.xLabel:m.hoverLabelText(J.xa,J.xLabelVal,Ct.xhoverformat),J.xVal=J.xa.c2d(J.xLabelVal)),J.yLabelVal!==void 0&&(J.yLabel="yLabel"in J?J.yLabel:m.hoverLabelText(J.ya,J.yLabelVal,Ct.yhoverformat),J.yVal=J.ya.c2d(J.yLabelVal)),J.zLabelVal!==void 0&&J.zLabel===void 0&&(J.zLabel=String(J.zLabelVal)),!isNaN(J.xerr)&&!(J.xa.type==="log"&&J.xerr<=0)){var xe=m.tickText(J.xa,J.xa.c2l(J.xerr),"hover").text;J.xerrneg!==void 0?J.xLabel+=" +"+xe+" / -"+m.tickText(J.xa,J.xa.c2l(J.xerrneg),"hover").text:J.xLabel+=" ± "+xe,mt==="x"&&(J.distance+=1)}if(!isNaN(J.yerr)&&!(J.ya.type==="log"&&J.yerr<=0)){var ge=m.tickText(J.ya,J.ya.c2l(J.yerr),"hover").text;J.yerrneg!==void 0?J.yLabel+=" +"+ge+" / -"+m.tickText(J.ya,J.ya.c2l(J.yerrneg),"hover").text:J.yLabel+=" ± "+ge,mt==="y"&&(J.distance+=1)}var ye=J.hoverinfo||J.trace.hoverinfo;return ye&&ye!=="all"&&(ye=Array.isArray(ye)?ye:ye.split("+"),ye.indexOf("x")===-1&&(J.xLabel=void 0),ye.indexOf("y")===-1&&(J.yLabel=void 0),ye.indexOf("z")===-1&&(J.zLabel=void 0),ye.indexOf("text")===-1&&(J.text=void 0),ye.indexOf("name")===-1&&(J.name=void 0)),J}function bt(J,mt,dt){var Ct=dt.container,Rt=dt.fullLayout,Bt=Rt._size,Zt=dt.event,Gt=!!mt.hLinePoint,ee=!!mt.vLinePoint,xe,ge;if(Ct.selectAll(".spikeline").remove(),!!(ee||Gt)){var ye=s.combine(Rt.plot_bgcolor,Rt.paper_bgcolor);if(Gt){var ue=mt.hLinePoint,Mt,Ot;xe=ue&&ue.xa,ge=ue&&ue.ya;var Lt=ge.spikesnap;Lt==="cursor"?(Mt=Zt.pointerX,Ot=Zt.pointerY):(Mt=xe._offset+ue.x,Ot=ge._offset+ue.y);var ie=y.readability(ue.color,ye)<1.5?s.contrast(ye):ue.color,be=ge.spikemode,ce=ge.spikethickness,Le=ge.spikecolor||ie,Ze=m.getPxPosition(J,ge),Qe,mr;if(be.indexOf("toaxis")!==-1||be.indexOf("across")!==-1){if(be.indexOf("toaxis")!==-1&&(Qe=Ze,mr=Mt),be.indexOf("across")!==-1){var fr=ge._counterDomainMin,Jr=ge._counterDomainMax;ge.anchor==="free"&&(fr=Math.min(fr,ge.position),Jr=Math.max(Jr,ge.position)),Qe=Bt.l+fr*Bt.w,mr=Bt.l+Jr*Bt.w}Ct.insert("line",":first-child").attr({x1:Qe,x2:mr,y1:Ot,y2:Ot,"stroke-width":ce,stroke:Le,"stroke-dasharray":c.dashStyle(ge.spikedash,ce)}).classed("spikeline",!0).classed("crisp",!0),Ct.insert("line",":first-child").attr({x1:Qe,x2:mr,y1:Ot,y2:Ot,"stroke-width":ce+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}be.indexOf("marker")!==-1&&Ct.insert("circle",":first-child").attr({cx:Ze+(ge.side!=="right"?ce:-ce),cy:Ot,r:ce,fill:Le}).classed("spikeline",!0)}if(ee){var an=mt.vLinePoint,Er,dn;xe=an&&an.xa,ge=an&&an.ya;var _n=xe.spikesnap;_n==="cursor"?(Er=Zt.pointerX,dn=Zt.pointerY):(Er=xe._offset+an.x,dn=ge._offset+an.y);var Oe=y.readability(an.color,ye)<1.5?s.contrast(ye):an.color,Xt=xe.spikemode,oe=xe.spikethickness,zt=xe.spikecolor||Oe,_t=m.getPxPosition(J,xe),Pt,Ht;if(Xt.indexOf("toaxis")!==-1||Xt.indexOf("across")!==-1){if(Xt.indexOf("toaxis")!==-1&&(Pt=_t,Ht=dn),Xt.indexOf("across")!==-1){var ae=xe._counterDomainMin,he=xe._counterDomainMax;xe.anchor==="free"&&(ae=Math.min(ae,xe.position),he=Math.max(he,xe.position)),Pt=Bt.t+(1-he)*Bt.h,Ht=Bt.t+(1-ae)*Bt.h}Ct.insert("line",":first-child").attr({x1:Er,x2:Er,y1:Pt,y2:Ht,"stroke-width":oe,stroke:zt,"stroke-dasharray":c.dashStyle(xe.spikedash,oe)}).classed("spikeline",!0).classed("crisp",!0),Ct.insert("line",":first-child").attr({x1:Er,x2:Er,y1:Pt,y2:Ht,"stroke-width":oe+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}Xt.indexOf("marker")!==-1&&Ct.insert("circle",":first-child").attr({cx:Er,cy:_t-(xe.side!=="top"?oe:-oe),r:oe,fill:zt}).classed("spikeline",!0)}}}function vt(J,mt,dt){if(!dt||dt.length!==J._hoverdata.length)return!0;for(var Ct=dt.length-1;Ct>=0;Ct--){var Rt=dt[Ct],Bt=J._hoverdata[Ct];if(Rt.curveNumber!==Bt.curveNumber||String(Rt.pointNumber)!==String(Bt.pointNumber)||String(Rt.pointNumbers)!==String(Bt.pointNumbers)||Rt.binNumber!==Bt.binNumber)return!0}return!1}function ut(J,mt){return!0}function rt(J,mt){return l.plainText(J||"",{len:mt,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function gt(J,mt){for(var dt=mt.charAt(0),Ct=[],Rt=[],Bt=[],Zt=0;ZtJ.offsetTop+J.clientTop,xt=J=>J.offsetLeft+J.clientLeft;function ot(J,mt){var dt=J._fullLayout,Ct=mt.getBoundingClientRect(),Rt=Ct.left,Bt=Ct.top,Zt=Rt+Ct.width,Gt=Bt+Ct.height,ee=z.apply3DTransform(dt._invTransform)(Rt,Bt),xe=z.apply3DTransform(dt._invTransform)(Zt,Gt),ge=ee[0],ye=ee[1],ue=xe[0],Mt=xe[1];return{x:ge,y:ye,width:ue-ge,height:Mt-ye,top:Math.min(ye,Mt),left:Math.min(ge,ue),right:Math.max(ge,ue),bottom:Math.max(ye,Mt)}}}),qv=It((et,Y)=>{var f=jn(),y=Hn(),z=T0().isUnifiedHover;Y.exports=function(P,n,i,a){a=a||{};var l=n.legend;function o(c){a.font[c]||(a.font[c]=l?n.legend.font[c]:n.font[c])}n&&z(n.hovermode)&&(a.font||(a.font={}),o("size"),o("family"),o("color"),o("weight"),o("style"),o("variant"),l?(a.bgcolor||(a.bgcolor=y.combine(n.legend.bgcolor,n.paper_bgcolor)),a.bordercolor||(a.bordercolor=n.legend.bordercolor)):a.bgcolor||(a.bgcolor=n.paper_bgcolor)),i("hoverlabel.bgcolor",a.bgcolor),i("hoverlabel.bordercolor",a.bordercolor),i("hoverlabel.namelength",a.namelength),i("hoverlabel.showarrow",a.showarrow),f.coerceFont(i,"hoverlabel.font",a.font),i("hoverlabel.align",a.align)}}),Gv=It((et,Y)=>{var f=jn(),y=qv(),z=io();Y.exports=function(P,n){function i(a,l){return f.coerce(P,n,z,a,l)}y(P,n,i)}}),x8=It((et,Y)=>{var f=jn(),y=oo(),z=qv();Y.exports=function(P,n,i,a){function l(c,s){return f.coerce(P,n,y,c,s)}var o=f.extendFlat({},a.hoverlabel);n.hovertemplate&&(o.namelength=-1),z(P,n,l,o)}}),ey=It((et,Y)=>{var f=jn(),y=io();Y.exports=function(z,P){function n(i,a){return P[i]!==void 0?P[i]:f.coerce(z,P,y,i,a)}return n("clickmode"),n("hoversubplots"),n("hovermode")}}),hm=It((et,Y)=>{var f=jn(),y=io(),z=ey(),P=qv();Y.exports=function(n,i){function a(b,x){return f.coerce(n,i,y,b,x)}var l=z(n,i);l&&(a("hoverdistance"),a("spikedistance"));var o=a("dragmode");o==="select"&&a("selectdirection");var c=i._has("mapbox"),s=i._has("map"),h=i._has("geo"),m=i._basePlotModules.length;i.dragmode==="zoom"&&((c||s||h)&&m===1||(c||s)&&h&&m===2)&&(i.dragmode="pan"),P(n,i,a),f.coerceFont(a,"hoverlabel.grouptitlefont",i.hoverlabel.font)}}),L4=It((et,Y)=>{var f=jn(),y=ls();Y.exports=function(P){var n=P.calcdata,i=P._fullLayout;function a(h){return function(m){return f.coerceHoverinfo({hoverinfo:m},{_module:h._module},i)}}for(var l=0;l{var f=ls(),y=vw().hover;Y.exports=function(z,P,n){var i=f.getComponentMethod("annotations","onClick")(z,z._hoverdata);n!==void 0&&y(z,P,n,!0);function a(){z.emit("plotly_click",{points:z._hoverdata,event:P})}z._hoverdata&&P&&P.target&&(i&&i.then?i.then(a):a(),P.stopImmediatePropagation&&P.stopImmediatePropagation())}}),hd=It((et,Y)=>{var f=Br(),y=jn(),z=Up(),P=T0(),n=io(),i=vw();Y.exports={moduleType:"component",name:"fx",constants:aa(),schema:{layout:n},attributes:oo(),layoutAttributes:n,supplyLayoutGlobalDefaults:Gv(),supplyDefaults:x8(),supplyLayoutDefaults:hm(),calc:L4(),getDistanceFunction:P.getDistanceFunction,getClosest:P.getClosest,inbox:P.inbox,quadrature:P.quadrature,appendArrayPointValue:P.appendArrayPointValue,castHoverOption:l,castHoverinfo:o,hover:i.hover,unhover:z.unhover,loneHover:i.loneHover,loneUnhover:a,click:P4()};function a(c){var s=y.isD3Selection(c)?c:f.select(c);s.selectAll("g.hovertext").remove(),s.selectAll(".spikeline").remove()}function l(c,s,h){return y.castOption(c,s,"hoverlabel."+h)}function o(c,s,h){function m(b){return y.coerceHoverinfo({hoverinfo:b},{_module:c._module},s)}return y.castOption(c,h,"hoverinfo",m)}}),dm=It(et=>{et.selectMode=function(Y){return Y==="lasso"||Y==="select"},et.drawMode=function(Y){return Y==="drawclosedpath"||Y==="drawopenpath"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},et.openMode=function(Y){return Y==="drawline"||Y==="drawopenpath"},et.rectMode=function(Y){return Y==="select"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},et.freeMode=function(Y){return Y==="lasso"||Y==="drawclosedpath"||Y==="drawopenpath"},et.selectingOrDrawing=function(Y){return et.freeMode(Y)||et.rectMode(Y)}}),ry=It((et,Y)=>{Y.exports=function(f){var y=f._fullLayout;y._glcanvas&&y._glcanvas.size()&&y._glcanvas.each(function(z){z.regl&&z.regl.clear({color:!0,depth:!0})})}}),yw=It((et,Y)=>{Y.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:[""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}),_w=It((et,Y)=>{var f=32;Y.exports={CIRCLE_SIDES:f,i000:0,i090:f/4,i180:f/2,i270:f/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),rb=It((et,Y)=>{var f=jn().strTranslate;function y(i,a){switch(i.type){case"log":return i.p2d(a);case"date":return i.p2r(a,0,i.calendar);default:return i.p2r(a)}}function z(i,a){switch(i.type){case"log":return i.d2p(a);case"date":return i.r2p(a,0,i.calendar);default:return i.r2p(a)}}function P(i){var a=i._id.charAt(0)==="y"?1:0;return function(l){return y(i,l[a])}}function n(i){return f(i.xaxis._offset,i.yaxis._offset)}Y.exports={p2r:y,r2p:z,axValue:P,getTransform:n}}),Zv=It(et=>{var Y=E_(),f=_w(),y=f.CIRCLE_SIDES,z=f.SQRT2,P=rb(),n=P.p2r,i=P.r2p,a=[0,3,4,5,6,1,2],l=[0,3,4,1,2];et.writePaths=function(s){var h=s.length;if(!h)return"M0,0Z";for(var m="",b=0;b0&&k{var f=Ku(),y=dm(),z=y.drawMode,P=y.openMode,n=_w(),i=n.i000,a=n.i090,l=n.i180,o=n.i270,c=n.cos45,s=n.sin45,h=rb(),m=h.p2r,b=h.r2p,x=Cm(),_=x.clearOutline,A=Zv(),d=A.readPaths,k=A.writePaths,w=A.ellipseOver,D=A.fixDatesForPaths;function E(M,p){if(M.length){var g=M[0][0];if(g){var C=p.gd,S=p.isActiveShape,N=p.dragmode,B=(C.layout||{}).shapes||[];if(!z(N)&&S!==void 0){var U=C._fullLayout._activeShapeIndex;if(U{var f=dm(),y=f.selectMode,z=Cm(),P=z.clearOutline,n=Zv(),i=n.readPaths,a=n.writePaths,l=n.fixDatesForPaths;Y.exports=function(o,c){if(o.length){var s=o[0][0];if(s){var h=s.getAttribute("d"),m=c.gd,b=m._fullLayout.newselection,x=c.plotinfo,_=x.xaxis,A=x.yaxis,d=c.isActiveSelection,k=c.dragmode,w=(m.layout||{}).selections||[];if(!y(k)&&d!==void 0){var D=m._fullLayout._activeSelectionIndex;if(D{Y.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),l0=It(et=>{var Y=nb(),f=jn(),y=Fs();et.rangeToShapePosition=function(n){return n.type==="log"?n.r2d:function(i){return i}},et.shapePositionToRange=function(n){return n.type==="log"?n.d2r:function(i){return i}},et.decodeDate=function(n){return function(i){return i.replace&&(i=i.replace("_"," ")),n(i)}},et.encodeDate=function(n){return function(i){return n(i).replace(" ","_")}},et.extractPathCoords=function(n,i,a){var l=[],o=n.match(Y.segmentRE);return o.forEach(function(c){var s=i[c.charAt(0)].drawn;if(s!==void 0){var h=c.substr(1).match(Y.paramRE);if(!(!h||h.lengthd&&(w="X"),w});return b>d&&(k=k.replace(/[\s,]*X.*/,""),f.log("Ignoring extra params in segment "+m)),x+k})}function P(n,i){i=i||0;var a=0;return i&&n&&(n.type==="category"||n.type==="multicategory")&&(a=(n.r2p(1)-n.r2p(0))*i),a}}),I4=It((et,Y)=>{var f=jn(),y=Fs(),z=uu(),P=Js(),n=Zv().readPaths,i=l0(),a=i.getPathString,l=w_(),o=Rd().FROM_TL;Y.exports=function(h,m,b,x){if(x.selectAll(".shape-label").remove(),!!(b.label.text||b.label.texttemplate)){var _;if(b.label.texttemplate){var A={};if(b.type!=="path"){var d=y.getFromId(h,b.xref),k=y.getFromId(h,b.yref);for(var w in l){var D=l[w](b,d,k);D!==void 0&&(A[w]=D)}}_=f.texttemplateStringForShapes({data:[A],fallback:b.label.texttemplatefallback,locale:h._fullLayout._d3locale,template:b.label.texttemplate})}else _=b.label.text;var E={"data-index":m},I=b.label.font,M={"data-notex":1},p=x.append("g").attr(E).classed("shape-label",!0),g=p.append("text").attr(M).classed("shape-label-text",!0).text(_),C,S,N,B;if(b.path){var U=a(h,b),V=n(U,h);C=1/0,N=1/0,S=-1/0,B=-1/0;for(var W=0;W=h?_=m-x:_=x-m,-180/Math.PI*Math.atan2(_,A)}function s(h,m,b,x,_,A,d){var k=_.label.textposition,w=_.label.textangle,D=_.label.padding,E=_.type,I=Math.PI/180*A,M=Math.sin(I),p=Math.cos(I),g=_.label.xanchor,C=_.label.yanchor,S,N,B,U;if(E==="line"){k==="start"?(S=h,N=m):k==="end"?(S=b,N=x):(S=(h+b)/2,N=(m+x)/2),g==="auto"&&(k==="start"?w==="auto"?b>h?g="left":bh?g="right":bh?g="right":bh?g="left":b{var f=jn(),y=f.strTranslate,z=Up(),P=dm(),n=P.drawMode,i=P.selectMode,a=ls(),l=Hn(),o=_w(),c=o.i000,s=o.i090,h=o.i180,m=o.i270,b=Cm(),x=b.clearOutlineControllers,_=Zv(),A=_.pointsOnRectangle,d=_.pointsOnEllipse,k=_.writePaths,w=Z0().newShapes,D=Z0().createShapeObj,E=Kv(),I=I4();Y.exports=function C(S,N,B,U){U||(U=0);var V=B.gd;function W(){C(S,N,B,U++),(d(S[0])||B.hasText)&&F({redrawing:!0})}function F(ye){var ue={};B.isActiveShape!==void 0&&(B.isActiveShape=!1,ue=w(N,B)),B.isActiveSelection!==void 0&&(B.isActiveSelection=!1,ue=E(N,B),V._fullLayout._reselect=!0),Object.keys(ue).length&&a.call((ye||{}).redrawing?"relayout":"_guiRelayout",V,ue)}var H=V._fullLayout,q=H._zoomlayer,G=B.dragmode,tt=n(G),ht=i(G);(tt||ht)&&(V._fullLayout._outlining=!0),x(V),N.attr("d",k(S));var bt,vt,ut,rt,gt;if(!U&&(B.isActiveShape||B.isActiveSelection)){gt=M([],S);var it=q.append("g").attr("class","outline-controllers");Rt(it),ge()}if(tt&&B.hasText){var st=q.select(".label-temp"),xt=D(N,B,B.dragmode);I(V,"label-temp",xt,st)}function ot(ye){ut=+ye.srcElement.getAttribute("data-i"),rt=+ye.srcElement.getAttribute("data-j"),bt[ut][rt].moveFn=J}function J(ye,ue){if(S.length){var Mt=gt[ut][rt][1],Ot=gt[ut][rt][2],Lt=S[ut],ie=Lt.length;if(A(Lt)){var be=ye,ce=ue;if(B.isActiveSelection){var Le=p(Lt,rt);Le[1]===Lt[rt][1]?ce=0:be=0}for(var Ze=0;Ze1&&!(ye.length===2&&ye[1][0]==="Z")&&(rt===0&&(ye[0][0]="M"),S[ut]=ye,W(),F())}}function Ct(ye,ue){if(ye===2){ut=+ue.srcElement.getAttribute("data-i"),rt=+ue.srcElement.getAttribute("data-j");var Mt=S[ut];!A(Mt)&&!d(Mt)&&dt()}}function Rt(ye){bt=[];for(var ue=0;ue{var f=Br(),y=ls(),z=jn(),P=Fs(),n=Zv().readPaths,i=Kg(),a=I4(),l=Cm().clearOutlineControllers,o=Hn(),c=Js(),s=Tc().arrayEditor,h=Up(),m=Mm(),b=nb(),x=l0(),_=x.getPathString;Y.exports={draw:A,drawOne:w,eraseActiveShape:g,drawLabel:a};function A(C){var S=C._fullLayout;S._shapeUpperLayer.selectAll("path").remove(),S._shapeLowerLayer.selectAll("path").remove(),S._shapeUpperLayer.selectAll("text").remove(),S._shapeLowerLayer.selectAll("text").remove();for(var N in S._plots){var B=S._plots[N].shapelayer;B&&(B.selectAll("path").remove(),B.selectAll("text").remove())}for(var U=0;UW&&ae>F&&!_t.shiftKey?h.getCursor(he/Ht,1-Me/ae):"move";m(S,qe),Qe=qe.split("-")[0]}}function an(_t){d(C)||(H&&(gt=Lt(N.xanchor)),q&&(it=ie(N.yanchor)),N.type==="path"?Bt=N.path:(bt=H?N.x0:Lt(N.x0),vt=q?N.y0:ie(N.y0),ut=H?N.x1:Lt(N.x1),rt=q?N.y1:ie(N.y1)),btrt?(st=vt,mt="y0",xt=rt,dt="y1"):(st=rt,mt="y1",xt=vt,dt="y0"),Jr(_t),Xt(U,N),zt(S,N,C),Ze.moveFn=Qe==="move"?_n:Oe,Ze.altKey=_t.altKey)}function Er(){d(C)||(m(S),oe(U),D(S,C,N),y.call("_guiRelayout",C,V.getUpdateObj()))}function dn(){d(C)||oe(U)}function _n(_t,Pt){if(N.type==="path"){var Ht=function(Me){return Me},ae=Ht,he=Ht;H?ht("xanchor",N.xanchor=be(gt+_t)):(ae=function(Me){return be(Lt(Me)+_t)},Gt&&Gt.type==="date"&&(ae=x.encodeDate(ae))),q?ht("yanchor",N.yanchor=ce(it+Pt)):(he=function(Me){return ce(ie(Me)+Pt)},xe&&xe.type==="date"&&(he=x.encodeDate(he))),ht("path",N.path=I(Bt,ae,he))}else H?ht("xanchor",N.xanchor=be(gt+_t)):(ht("x0",N.x0=be(bt+_t)),ht("x1",N.x1=be(ut+_t))),q?ht("yanchor",N.yanchor=ce(it+Pt)):(ht("y0",N.y0=ce(vt+Pt)),ht("y1",N.y1=ce(rt+Pt)));S.attr("d",_(C,N)),Xt(U,N),a(C,B,N,Zt)}function Oe(_t,Pt){if(tt){var Ht=function(fi){return fi},ae=Ht,he=Ht;H?ht("xanchor",N.xanchor=be(gt+_t)):(ae=function(fi){return be(Lt(fi)+_t)},Gt&&Gt.type==="date"&&(ae=x.encodeDate(ae))),q?ht("yanchor",N.yanchor=ce(it+Pt)):(he=function(fi){return ce(ie(fi)+Pt)},xe&&xe.type==="date"&&(he=x.encodeDate(he))),ht("path",N.path=I(Bt,ae,he))}else if(G){if(Qe==="resize-over-start-point"){var Me=bt+_t,qe=q?vt-Pt:vt+Pt;ht("x0",N.x0=H?Me:be(Me)),ht("y0",N.y0=q?qe:ce(qe))}else if(Qe==="resize-over-end-point"){var Ye=ut+_t,ur=q?rt-Pt:rt+Pt;ht("x1",N.x1=H?Ye:be(Ye)),ht("y1",N.y1=q?ur:ce(ur))}}else{var Rr=function(fi){return Qe.indexOf(fi)!==-1},zr=Rr("n"),xr=Rr("s"),pn=Rr("w"),ci=Rr("e"),ui=zr?st+Pt:st,yi=xr?xt+Pt:xt,Gi=pn?ot+_t:ot,Ci=ci?J+_t:J;q&&(zr&&(ui=st-Pt),xr&&(yi=xt-Pt)),(!q&&yi-ui>F||q&&ui-yi>F)&&(ht(mt,N[mt]=q?ui:ce(ui)),ht(dt,N[dt]=q?yi:ce(yi))),Ci-Gi>W&&(ht(Ct,N[Ct]=H?Gi:be(Gi)),ht(Rt,N[Rt]=H?Ci:be(Ci)))}S.attr("d",_(C,N)),Xt(U,N),a(C,B,N,Zt)}function Xt(_t,Pt){(H||q)&&Ht();function Ht(){var ae=Pt.type!=="path",he=_t.selectAll(".visual-cue").data([0]),Me=1;he.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Me}).classed("visual-cue",!0);var qe=Lt(H?Pt.xanchor:z.midRange(ae?[Pt.x0,Pt.x1]:x.extractPathCoords(Pt.path,b.paramIsX))),Ye=ie(q?Pt.yanchor:z.midRange(ae?[Pt.y0,Pt.y1]:x.extractPathCoords(Pt.path,b.paramIsY)));if(qe=x.roundPositionForSharpStrokeRendering(qe,Me),Ye=x.roundPositionForSharpStrokeRendering(Ye,Me),H&&q){var ur="M"+(qe-1-Me)+","+(Ye-1-Me)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";he.attr("d",ur)}else if(H){var Rr="M"+(qe-1-Me)+","+(Ye-9-Me)+"v18 h2 v-18 Z";he.attr("d",Rr)}else{var zr="M"+(qe-9-Me)+","+(Ye-1-Me)+"h18 v2 h-18 Z";he.attr("d",zr)}}}function oe(_t){_t.selectAll(".visual-cue").remove()}function zt(_t,Pt,Ht){var ae=Pt.xref,he=Pt.yref,Me=P.getFromId(Ht,ae),qe=P.getFromId(Ht,he),Ye="";ae!=="paper"&&!Me.autorange&&(Ye+=ae),he!=="paper"&&!qe.autorange&&(Ye+=he),c.setClipUrl(_t,Ye?"clip"+Ht._fullLayout._uid+Ye:null,Ht)}}function I(C,S,N){return C.replace(b.segmentRE,function(B){var U=0,V=B.charAt(0),W=b.paramIsX[V],F=b.paramIsY[V],H=b.numParams[V],q=B.substr(1).replace(b.paramRE,function(G){return U>=H||(W[U]?G=S(G):F[U]&&(G=N(G)),U++),G});return V+q})}function M(C,S){if(k(C)){var N=S.node(),B=+N.getAttribute("data-index");if(B>=0){if(B===C._fullLayout._activeShapeIndex){p(C);return}C._fullLayout._activeShapeIndex=B,C._fullLayout._deactivateShape=p,A(C)}}}function p(C){if(k(C)){var S=C._fullLayout._activeShapeIndex;S>=0&&(l(C),delete C._fullLayout._activeShapeIndex,A(C))}}function g(C){if(k(C)){l(C);var S=C._fullLayout._activeShapeIndex,N=(C.layout||{}).shapes||[];if(S{var f=ls(),y=lh(),z=Ku(),P=yw(),n=xw().eraseActiveShape,i=jn(),a=i._,l=Y.exports={};l.toImage={name:"toImage",title:function(E){var I=E._context.toImageButtonOptions||{},M=I.format||"png";return M==="png"?a(E,"Download plot as a PNG"):a(E,"Download plot")},icon:P.camera,click:function(E){var I=E._context.toImageButtonOptions,M={format:I.format||"png"};i.notifier(a(E,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(p){p in I&&(M[p]=I[p])}),f.call("downloadImage",E,M).then(function(p){i.notifier(a(E,"Snapshot succeeded")+" - "+p,"long")}).catch(function(){i.notifier(a(E,"Sorry, there was a problem downloading your snapshot!"),"long")})}},l.sendDataToCloud={name:"sendDataToCloud",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.disk,click:function(E){y.sendDataToCloud(E)}},l.editInChartStudio={name:"editInChartStudio",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.pencil,click:function(E){y.sendDataToCloud(E)}},l.zoom2d={name:"zoom2d",_cat:"zoom",title:function(E){return a(E,"Zoom")},attr:"dragmode",val:"zoom",icon:P.zoombox,click:o},l.pan2d={name:"pan2d",_cat:"pan",title:function(E){return a(E,"Pan")},attr:"dragmode",val:"pan",icon:P.pan,click:o},l.select2d={name:"select2d",_cat:"select",title:function(E){return a(E,"Box Select")},attr:"dragmode",val:"select",icon:P.selectbox,click:o},l.lasso2d={name:"lasso2d",_cat:"lasso",title:function(E){return a(E,"Lasso Select")},attr:"dragmode",val:"lasso",icon:P.lasso,click:o},l.drawclosedpath={name:"drawclosedpath",title:function(E){return a(E,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:P.drawclosedpath,click:o},l.drawopenpath={name:"drawopenpath",title:function(E){return a(E,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:P.drawopenpath,click:o},l.drawline={name:"drawline",title:function(E){return a(E,"Draw line")},attr:"dragmode",val:"drawline",icon:P.drawline,click:o},l.drawrect={name:"drawrect",title:function(E){return a(E,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:P.drawrect,click:o},l.drawcircle={name:"drawcircle",title:function(E){return a(E,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:P.drawcircle,click:o},l.eraseshape={name:"eraseshape",title:function(E){return a(E,"Erase active shape")},icon:P.eraseshape,click:n},l.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(E){return a(E,"Zoom in")},attr:"zoom",val:"in",icon:P.zoom_plus,click:o},l.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(E){return a(E,"Zoom out")},attr:"zoom",val:"out",icon:P.zoom_minus,click:o},l.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(E){return a(E,"Autoscale")},attr:"zoom",val:"auto",icon:P.autoscale,click:o},l.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(E){return a(E,"Reset axes")},attr:"zoom",val:"reset",icon:P.home,click:o},l.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(E){return a(E,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:P.tooltip_basic,gravity:"ne",click:o},l.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(E){return a(E,"Compare data on hover")},attr:"hovermode",val:function(E){return E._fullLayout._isHoriz?"y":"x"},icon:P.tooltip_compare,gravity:"ne",click:o};function o(E,I){var M=I.currentTarget,p=M.getAttribute("data-attr"),g=M.getAttribute("data-val")||!0,C=E._fullLayout,S={},N=z.list(E,null,!0),B=C._cartesianSpikesEnabled,U,V;if(p==="zoom"){var W=g==="in"?.5:2,F=(1+W)/2,H=(1-W)/2,q,G;for(V=0;V{var f=ny(),y=Object.keys(f),z=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],P=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(z),n=[],i=function(a){if(P.indexOf(a._cat||a.name)===-1){var l=a.name,o=(a._cat||a.name).toLowerCase();n.indexOf(l)===-1&&n.push(l),n.indexOf(o)===-1&&n.push(o)}};y.forEach(function(a){i(f[a])}),n.sort(),Y.exports={DRAW_MODES:z,backButtons:P,foreButtons:n}}),L_=It((et,Y)=>{bw(),Y.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}),b8=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=L_();Y.exports=function(n,i){var a=n.modebar||{},l=z.newContainer(i,"modebar");function o(s,h){return f.coerce(a,l,P,s,h)}o("orientation"),o("bgcolor",y.addOpacity(i.paper_bgcolor,.5));var c=y.contrast(y.rgb(i.modebar.bgcolor));o("color",y.addOpacity(c,.3)),o("activecolor",y.addOpacity(c,.7)),o("uirevision",i.uirevision),o("add"),o("remove")}}),Yg=It((et,Y)=>{var f=Br(),y=Sr(),z=jn(),P=yw(),n=Dn().version,i=new DOMParser;function a(s){this.container=s.container,this.element=document.createElement("div"),this.update(s.graphInfo,s.buttons),this.container.appendChild(this.element)}var l=a.prototype;l.update=function(s,h){this.graphInfo=s;var m=this.graphInfo._context,b=this.graphInfo._fullLayout,x="modebar-"+b._uid;this.element.setAttribute("id",x),this.element.setAttribute("role","toolbar"),this._uid=x,this.element.className="modebar modebar--custom",m.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),b.modebar.orientation==="v"&&(this.element.className+=" vertical",h=h.reverse());var _=b.modebar,A="#"+x+" .modebar-group";document.querySelectorAll(A).forEach(function(E){E.style.backgroundColor=_.bgcolor});var d=!this.hasButtons(h),k=this.hasLogo!==m.displaylogo,w=this.locale!==m.locale;if(this.locale=m.locale,(d||k||w)&&(this.removeAllButtons(),this.updateButtons(h),m.watermark||m.displaylogo)){var D=this.getLogo();m.watermark&&(D.className=D.className+" watermark"),b.modebar.orientation==="v"?this.element.insertBefore(D,this.element.childNodes[0]):this.element.appendChild(D),this.hasLogo=!0}this.updateActiveButton(),z.setStyleOnHover("#"+x+" .modebar-btn",".active",".icon path","fill: "+_.activecolor,"fill: "+_.color,this.element)},l.updateButtons=function(s){var h=this;this.buttons=s,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(m){var b=h.createGroup();m.forEach(function(x){var _=x.name;if(!_)throw new Error("must provide button 'name' in button config");if(h.buttonsNames.indexOf(_)!==-1)throw new Error("button name '"+_+"' is taken");h.buttonsNames.push(_);var A=h.createButton(x);h.buttonElements.push(A),b.appendChild(A)}),h.element.appendChild(b)})},l.createGroup=function(){var s=document.createElement("div");s.className="modebar-group";var h=this.graphInfo._fullLayout.modebar;return s.style.backgroundColor=h.bgcolor,s},l.createButton=function(s){var h=this,m=document.createElement("button");m.setAttribute("type","button"),m.setAttribute("rel","tooltip"),m.className="modebar-btn";var b=s.title;b===void 0?b=s.name:typeof b=="function"&&(b=b(this.graphInfo)),(b||b===0)&&(m.setAttribute("data-title",b),m.setAttribute("aria-label",b)),s.attr!==void 0&&m.setAttribute("data-attr",s.attr);var x=s.val;x!==void 0&&(typeof x=="function"&&(x=x(this.graphInfo)),m.setAttribute("data-val",x));var _=s.click;if(typeof _!="function")throw new Error("must provide button 'click' function in button config");m.addEventListener("click",function(d){s.click(h.graphInfo,d),h.updateActiveButton(d.currentTarget)}),m.setAttribute("data-toggle",s.toggle||!1),s.toggle&&f.select(m).classed("active",!0);var A=s.icon;return typeof A=="function"?m.appendChild(A()):m.appendChild(this.createIcon(A||P.question)),m.setAttribute("data-gravity",s.gravity||"n"),m},l.createIcon=function(s){var h=y(s.height)?Number(s.height):s.ascent-s.descent,m="http://www.w3.org/2000/svg",b;if(s.path){b=document.createElementNS(m,"svg"),b.setAttribute("viewBox",[0,0,s.width,h].join(" ")),b.setAttribute("class","icon");var x=document.createElementNS(m,"path");x.setAttribute("d",s.path),s.transform?x.setAttribute("transform",s.transform):s.ascent!==void 0&&x.setAttribute("transform","matrix(1 0 0 -1 0 "+s.ascent+")"),b.appendChild(x)}if(s.svg){var _=i.parseFromString(s.svg,"application/xml");b=_.childNodes[0]}return b.setAttribute("height","1em"),b.setAttribute("width","1em"),b},l.updateActiveButton=function(s){var h=this.graphInfo._fullLayout,m=s!==void 0?s.getAttribute("data-attr"):null;this.buttonElements.forEach(function(b){var x=b.getAttribute("data-val")||!0,_=b.getAttribute("data-attr"),A=b.getAttribute("data-toggle")==="true",d=f.select(b),k=function(E,I){var M=h.modebar,p=E.querySelector(".icon path");p&&(I||E.matches(":hover")?p.style.fill=M.activecolor:p.style.fill=M.color)};if(A){if(_===m){var w=!d.classed("active");d.classed("active",w),k(b,w)}}else{var D=_===null?_:z.nestedProperty(h,_).get();d.classed("active",D===x),k(b,D===x)}})},l.hasButtons=function(s){var h=this.buttons;if(!h||s.length!==h.length)return!1;for(var m=0;m{var f=Ku(),y=Fu(),z=ls(),P=T0().isUnifiedHover,n=Yg(),i=ny(),a=bw().DRAW_MODES,l=jn().extendDeep;Y.exports=function(x){var _=x._fullLayout,A=x._context,d=_._modeBar;if(!A.displayModeBar&&!A.watermark){d&&(d.destroy(),delete _._modeBar);return}if(!Array.isArray(A.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(A.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var k=A.modeBarButtons,w;Array.isArray(k)&&k.length?w=b(k):!A.displayModeBar&&A.watermark?w=[]:w=o(x),d?d.update(x,w):_._modeBar=n(x,w)};function o(x){var _=x._fullLayout,A=x._fullData,d=x._context;function k(J,mt){if(typeof mt=="string"){if(mt.toLowerCase()===J.toLowerCase())return!0}else{var dt=mt.name,Ct=mt._cat||mt.name;if(dt===J||Ct===J.toLowerCase())return!0}return!1}var w=_.modebar.add;typeof w=="string"&&(w=[w]);var D=_.modebar.remove;typeof D=="string"&&(D=[D]);var E=d.modeBarButtonsToAdd.concat(w.filter(function(J){for(var mt=0;mt1?(vt=["toggleHover"],ut=["resetViews"]):g?(bt=["zoomInGeo","zoomOutGeo"],vt=["hoverClosestGeo"],ut=["resetGeo"]):p?(vt=["hoverClosest3d"],ut=["resetCameraDefault3d","resetCameraLastSave3d"]):B?(bt=["zoomInMapbox","zoomOutMapbox"],vt=["toggleHover"],ut=["resetViewMapbox"]):U?(bt=["zoomInMap","zoomOutMap"],vt=["toggleHover"],ut=["resetViewMap"]):C?vt=["hoverClosestPie"]:F?(vt=["hoverClosestCartesian","hoverCompareCartesian"],ut=["resetViewSankey"]):vt=["toggleHover"],M&&vt.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(h(A)||q)&&(vt=[]),M&&!H&&(bt=["zoomIn2d","zoomOut2d","autoScale2d"],ut[0]!=="resetViews"&&(ut=["resetScale2d"])),p?rt=["zoom3d","pan3d","orbitRotation","tableRotation"]:M&&!H||N?rt=["zoom2d","pan2d"]:B||U||g?rt=["pan2d"]:V&&(rt=["zoom2d"]),s(A)&&rt.push("select2d","lasso2d");var gt=[],it=function(J){gt.indexOf(J)===-1&&vt.indexOf(J)!==-1&>.push(J)};if(Array.isArray(E)){for(var st=[],xt=0;xt{Y.exports={moduleType:"component",name:"modebar",layoutAttributes:L_(),supplyLayoutDefaults:b8(),manage:ib()}}),ab=It((et,Y)=>{var f=Rd().FROM_BL;Y.exports=function(y,z,P){P===void 0&&(P=f[y.constraintoward||"center"]);var n=[y.r2l(y.range[0]),y.r2l(y.range[1])],i=n[0]+(n[1]-n[0])*P;y.range=y._input.range=[y.l2r(i+(n[0]-i)*z),y.l2r(i+(n[1]-i)*z)],y.setScale()}}),iy=It(et=>{var Y=jn(),f=Jm(),y=Ku().id2name,z=Gf(),P=ab(),n=G0(),i=Dr().ALMOST_EQUAL,a=Rd().FROM_BL;et.handleDefaults=function(x,_,A){var d=A.axIds,k=A.axHasImage,w=_._axisConstraintGroups=[],D=_._axisMatchGroups=[],E,I,M,p,g,C,S,N;for(E=0;Ew?A.substr(w):d.substr(k))+D}function m(x,_){for(var A=_._size,d=A.h/A.w,k={},w=Object.keys(x),D=0;Di*S&&!V)){for(k=0;kut&&mtbt&&(bt=mt);var Ct=(bt-ht)/(2*vt);p/=Ct,ht=E.l2r(ht),bt=E.l2r(bt),E.range=E._input.range=q{var Y=Br(),f=ls(),y=lh(),z=jn(),P=uu(),n=ry(),i=Hn(),a=Js(),l=jp(),o=D4(),c=Fs(),s=Rd(),h=iy(),m=h.enforce,b=h.clean,x=Jm().doAutoRange,_="start",A="middle",d="end",k=fu().zindexSeparator;et.layoutStyles=function(F){return z.syncOrAsync([y.doAutoMargin,D],F)};function w(F,H,q){for(var G=0;G=F[1]||tt[1]<=F[0])&&ht[0]H[0])return!0}return!1}function D(F){var H=F._fullLayout,q=H._size,G=q.p,tt=c.list(F,"",!0),ht,bt,vt,ut,rt,gt;if(H._paperdiv.style({width:F._context.responsive&&H.autosize&&!F._context._hasZeroWidth&&!F.layout.width?"100%":H.width+"px",height:F._context.responsive&&H.autosize&&!F._context._hasZeroHeight&&!F.layout.height?"100%":H.height+"px"}).selectAll(".main-svg").call(a.setSize,H.width,H.height),F._context.setBackground(F,H.paper_bgcolor),et.drawMainTitle(F),o.manage(F),!H._has("cartesian"))return y.previousPromises(F);function it(zt,_t,Pt){var Ht=zt._lw/2;if(zt._id.charAt(0)==="x"){if(_t){if(Pt==="top")return _t._offset-G-Ht}else return q.t+q.h*(1-(zt.position||0))+Ht%1;return _t._offset+_t._length+G+Ht}if(_t){if(Pt==="right")return _t._offset+_t._length+G+Ht}else return q.l+q.w*(zt.position||0)+Ht%1;return _t._offset-G-Ht}for(ht=0;ht0){S(F,ht,rt,ut),vt.attr({x:bt,y:ht,"text-anchor":G,dy:U(H.yanchor)}).call(P.positionText,bt,ht);var gt=(H.text.match(P.BR_TAG_ALL)||[]).length;if(gt){var it=s.LINE_SPACING*gt+s.MID_SHIFT;H.y===0&&(it=-it),vt.selectAll(".line").each(function(){var mt=+this.getAttribute("dy").slice(0,-2)-it+"em";this.setAttribute("dy",mt)})}var st=Y.select(F).selectAll(".gtitle-subtitle");if(st.node()){var xt=vt.node().getBBox(),ot=xt.y+xt.height,J=ot+l.SUBTITLE_PADDING_EM*H.subtitle.font.size;st.attr({x:bt,y:J,"text-anchor":G,dy:U(H.yanchor)}).call(P.positionText,bt,J)}}}};function p(F,H,q,G,tt){var ht=H.yref==="paper"?F._fullLayout._size.h:F._fullLayout.height,bt=z.isTopAnchor(H)?G:G-tt,vt=q==="b"?ht-bt:bt;return z.isTopAnchor(H)&&q==="t"||z.isBottomAnchor(H)&&q==="b"?!1:vt.5?"t":"b",bt=F._fullLayout.margin[ht],vt=0;return H.yref==="paper"?vt=q+H.pad.t+H.pad.b:H.yref==="container"&&(vt=g(ht,G,tt,F._fullLayout.height,q)+H.pad.t+H.pad.b),vt>bt?vt:0}function S(F,H,q,G){var tt="title.automargin",ht=F._fullLayout.title,bt=ht.y>.5?"t":"b",vt={x:ht.x,y:ht.y,t:0,b:0},ut={};ht.yref==="paper"&&p(F,ht,bt,H,G)?vt[bt]=q:ht.yref==="container"&&(ut[bt]=q,F._fullLayout._reservedMargin[tt]=ut),y.allowAutoMargin(F,tt),y.autoMargin(F,tt,vt)}function N(F,H){var q=F.title,G=F._size,tt=0;switch(H===_?tt=q.pad.l:H===d&&(tt=-q.pad.r),q.xref){case"paper":return G.l+G.w*q.x+tt;case"container":default:return F.width*q.x+tt}}function B(F,H){var q=F.title,G=F._size,tt=0;if(H==="0em"||!H?tt=-q.pad.b:H===s.CAP_SHIFT+"em"&&(tt=q.pad.t),q.y==="auto")return G.t/2;switch(q.yref){case"paper":return G.t+G.h-G.h*q.y+tt;case"container":default:return F.height-F.height*q.y+tt}}function U(F){return F==="top"?s.CAP_SHIFT+.3+"em":F==="bottom"?"-0.3em":s.MID_SHIFT+"em"}function V(F){var H=F.title,q=A;return z.isRightAnchor(H)?q=d:z.isLeftAnchor(H)&&(q=_),q}function W(F){var H=F.title,q="0em";return z.isTopAnchor(H)?q=s.CAP_SHIFT+"em":z.isMiddleAnchor(H)&&(q=s.MID_SHIFT+"em"),q}et.doTraceStyle=function(F){var H=F.calcdata,q=[],G;for(G=0;G{var f=Zv().readPaths,y=Kg(),z=Cm().clearOutlineControllers,P=Hn(),n=Js(),i=Tc().arrayEditor,a=l0(),l=a.getPathString;Y.exports={draw:o,drawOne:s,activateLastSelection:b};function o(_){var A=_._fullLayout;z(_),A._selectionLayer.selectAll("path").remove();for(var d in A._plots){var k=A._plots[d].selectionLayer;k&&k.selectAll("path").remove()}for(var w=0;w=0;V--){var W=E.append("path").attr(M).style("opacity",V?.1:p).call(P.stroke,C).call(P.fill,g).call(n.dashLine,V?"solid":N,V?4+S:S);if(h(W,_,k),B){var F=i(_.layout,"selections",k);W.style({cursor:"move"});var H={element:W.node(),plotinfo:w,gd:_,editHelpers:F,isActiveSelection:!0},q=f(I,_);y(q,W,H)}else W.style("pointer-events",V?"all":"none");U[V]=W}var G=U[0],tt=U[1];tt.node().addEventListener("click",function(){return m(_,G)})}}function h(_,A,d){var k=d.xref+d.yref;n.setClipUrl(_,"clip"+A._fullLayout._uid+k,A)}function m(_,A){if(c(_)){var d=A.node(),k=+d.getAttribute("data-index");if(k>=0){if(k===_._fullLayout._activeSelectionIndex){x(_);return}_._fullLayout._activeSelectionIndex=k,_._fullLayout._deactivateSelection=x,o(_)}}}function b(_){if(c(_)){var A=_._fullLayout.selections.length-1;_._fullLayout._activeSelectionIndex=A,_._fullLayout._deactivateSelection=x,o(_)}}function x(_){if(c(_)){var A=_._fullLayout._activeSelectionIndex;A>=0&&(z(_),delete _._fullLayout._activeSelectionIndex,o(_))}}}),ay=It((et,Y)=>{function f(){var y,z=0,P=!1;function n(i,a){return y.list.push({type:i,data:a?JSON.parse(JSON.stringify(a)):void 0}),y}return y={list:[],segmentId:function(){return z++},checkIntersection:function(i,a){return n("check",{seg1:i,seg2:a})},segmentChop:function(i,a){return n("div_seg",{seg:i,pt:a}),n("chop",{seg:i,pt:a})},statusRemove:function(i){return n("pop_seg",{seg:i})},segmentUpdate:function(i){return n("seg_update",{seg:i})},segmentNew:function(i,a){return n("new_seg",{seg:i,primary:a})},segmentRemove:function(i){return n("rem_seg",{seg:i})},tempStatus:function(i,a,l){return n("temp_status",{seg:i,above:a,below:l})},rewind:function(i){return n("rewind",{seg:i})},status:function(i,a,l){return n("status",{seg:i,above:a,below:l})},vert:function(i){return i===P?y:(P=i,n("vert",{x:i}))},log:function(i){return typeof i!="string"&&(i=JSON.stringify(i,!1," ")),n("log",{txt:i})},reset:function(){return n("reset")},selected:function(i){return n("selected",{segs:i})},chainStart:function(i){return n("chain_start",{seg:i})},chainRemoveHead:function(i,a){return n("chain_rem_head",{index:i,pt:a})},chainRemoveTail:function(i,a){return n("chain_rem_tail",{index:i,pt:a})},chainNew:function(i,a){return n("chain_new",{pt1:i,pt2:a})},chainMatch:function(i){return n("chain_match",{index:i})},chainClose:function(i){return n("chain_close",{index:i})},chainAddHead:function(i,a){return n("chain_add_head",{index:i,pt:a})},chainAddTail:function(i,a){return n("chain_add_tail",{index:i,pt:a})},chainConnect:function(i,a){return n("chain_con",{index1:i,index2:a})},chainReverse:function(i){return n("chain_rev",{index:i})},chainJoin:function(i,a){return n("chain_join",{index1:i,index2:a})},done:function(){return n("done")}},y}Y.exports=f}),w8=It((et,Y)=>{function f(y){typeof y!="number"&&(y=1e-10);var z={epsilon:function(P){return typeof P=="number"&&(y=P),y},pointAboveOrOnLine:function(P,n,i){var a=n[0],l=n[1],o=i[0],c=i[1],s=P[0],h=P[1];return(o-a)*(h-l)-(c-l)*(s-a)>=-y},pointBetween:function(P,n,i){var a=P[1]-n[1],l=i[0]-n[0],o=P[0]-n[0],c=i[1]-n[1],s=o*l+a*c;if(s-y)},pointsSameX:function(P,n){return Math.abs(P[0]-n[0])y!=o-a>y&&(l-h)*(a-m)/(o-m)+h-i>y&&(c=!c),l=h,o=m}return c}};return z}Y.exports=f}),Cg=It((et,Y)=>{var f={create:function(){var y={root:{root:!0,next:null},exists:function(z){return!(z===null||z===y.root)},isEmpty:function(){return y.root.next===null},getHead:function(){return y.root.next},insertBefore:function(z,P){for(var n=y.root,i=y.root.next;i!==null;){if(P(i)){z.prev=i.prev,z.next=i,i.prev.next=z,i.prev=z;return}n=i,i=i.next}n.next=z,z.prev=n,z.next=null},findTransition:function(z){for(var P=y.root,n=y.root.next;n!==null&&!z(n);)P=n,n=n.next;return{before:P===y.root?null:P,after:n,insert:function(i){return i.prev=P,i.next=n,P.next=i,n!==null&&(n.prev=i),i}}}};return y},node:function(y){return y.prev=null,y.next=null,y.remove=function(){y.prev.next=y.next,y.next&&(y.next.prev=y.prev),y.prev=null,y.next=null},y}};Y.exports=f}),ob=It((et,Y)=>{var f=Cg();function y(z,P,n){function i(A,d){return{id:n?n.segmentId():-1,start:A,end:d,myFill:{above:null,below:null},otherFill:null}}function a(A,d,k){return{id:n?n.segmentId():-1,start:A,end:d,myFill:{above:k.myFill.above,below:k.myFill.below},otherFill:null}}var l=f.create();function o(A,d,k,w,D,E){var I=P.pointsCompare(d,D);return I!==0?I:P.pointsSame(k,E)?0:A!==w?A?1:-1:P.pointAboveOrOnLine(k,w?D:E,w?E:D)?1:-1}function c(A,d){l.insertBefore(A,function(k){var w=o(A.isStart,A.pt,d,k.isStart,k.pt,k.other.pt);return w<0})}function s(A,d){var k=f.node({isStart:!0,pt:A.start,seg:A,primary:d,other:null,status:null});return c(k,A.end),k}function h(A,d,k){var w=f.node({isStart:!1,pt:d.end,seg:d,primary:k,other:A,status:null});A.other=w,c(w,A.pt)}function m(A,d){var k=s(A,d);return h(k,A,d),k}function b(A,d){n&&n.segmentChop(A.seg,d),A.other.remove(),A.seg.end=d,A.other.pt=d,c(A.other,A.pt)}function x(A,d){var k=a(d,A.seg.end,A.seg);return b(A,d),m(k,A.primary)}function _(A,d){var k=f.create();function w(W,F){var H=W.seg.start,q=W.seg.end,G=F.seg.start,tt=F.seg.end;return P.pointsCollinear(H,G,tt)?P.pointsCollinear(q,G,tt)||P.pointAboveOrOnLine(q,G,tt)?1:-1:P.pointAboveOrOnLine(H,G,tt)?1:-1}function D(W){return k.findTransition(function(F){var H=w(W,F.ev);return H>0})}function E(W,F){var H=W.seg,q=F.seg,G=H.start,tt=H.end,ht=q.start,bt=q.end;n&&n.checkIntersection(H,q);var vt=P.linesIntersect(G,tt,ht,bt);if(vt===!1){if(!P.pointsCollinear(G,tt,ht)||P.pointsSame(G,bt)||P.pointsSame(tt,ht))return!1;var ut=P.pointsSame(G,ht),rt=P.pointsSame(tt,bt);if(ut&&rt)return F;var gt=!ut&&P.pointBetween(G,ht,bt),it=!rt&&P.pointBetween(tt,ht,bt);if(ut)return it?x(F,tt):x(W,bt),F;gt&&(rt||(it?x(F,tt):x(W,bt)),x(F,G))}else vt.alongA===0&&(vt.alongB===-1?x(W,ht):vt.alongB===0?x(W,vt.pt):vt.alongB===1&&x(W,bt)),vt.alongB===0&&(vt.alongA===-1?x(F,G):vt.alongA===0?x(F,vt.pt):vt.alongA===1&&x(F,tt));return!1}for(var I=[];!l.isEmpty();){var M=l.getHead();if(n&&n.vert(M.pt[0]),M.isStart){let W=function(){if(g){var F=E(M,g);if(F)return F}return C?E(M,C):!1};n&&n.segmentNew(M.seg,M.primary);var p=D(M),g=p.before?p.before.ev:null,C=p.after?p.after.ev:null;n&&n.tempStatus(M.seg,g?g.seg:!1,C?C.seg:!1);var S=W();if(S){if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,N&&(S.seg.myFill.above=!S.seg.myFill.above)}else S.seg.otherFill=M.seg.myFill;n&&n.segmentUpdate(S.seg),M.other.remove(),M.remove()}if(l.getHead()!==M){n&&n.rewind(M.seg);continue}if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,C?M.seg.myFill.below=C.seg.myFill.above:M.seg.myFill.below=A,N?M.seg.myFill.above=!M.seg.myFill.below:M.seg.myFill.above=M.seg.myFill.below}else if(M.seg.otherFill===null){var B;C?M.primary===C.primary?B=C.seg.otherFill.above:B=C.seg.myFill.above:B=M.primary?d:A,M.seg.otherFill={above:B,below:B}}n&&n.status(M.seg,g?g.seg:!1,C?C.seg:!1),M.other.status=p.insert(f.node({ev:M}))}else{var U=M.status;if(U===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(k.exists(U.prev)&&k.exists(U.next)&&E(U.prev.ev,U.next.ev),n&&n.statusRemove(U.ev.seg),U.remove(),!M.primary){var V=M.seg.myFill;M.seg.myFill=M.seg.otherFill,M.seg.otherFill=V}I.push(M.seg)}l.getHead().remove()}return n&&n.done(),I}return z?{addRegion:function(A){for(var d,k=A[A.length-1],w=0;w{function f(y,z,P){var n=[],i=[];return y.forEach(function(a){var l=a.start,o=a.end;if(z.pointsSame(l,o)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}P&&P.chainStart(a);var c={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},h=c;function m(B,U,V){return h.index=B,h.matches_head=U,h.matches_pt1=V,h===c?(h=s,!1):(h=null,!0)}for(var b=0;b{function f(z,P,n){var i=[];return z.forEach(function(a){var l=(a.myFill.above?8:0)+(a.myFill.below?4:0)+(a.otherFill&&a.otherFill.above?2:0)+(a.otherFill&&a.otherFill.below?1:0);P[l]!==0&&i.push({id:n?n.segmentId():-1,start:a.start,end:a.end,myFill:{above:P[l]===1,below:P[l]===2},otherFill:null})}),n&&n.selected(i),i}var y={union:function(z,P){return f(z,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],P)},intersect:function(z,P){return f(z,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],P)},difference:function(z,P){return f(z,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],P)},differenceRev:function(z,P){return f(z,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],P)},xor:function(z,P){return f(z,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],P)}};Y.exports=y}),sb=It((et,Y)=>{var f={toPolygon:function(y,z){function P(a){if(a.length<=0)return y.segments({inverted:!1,regions:[]});function l(s){var h=s.slice(0,s.length-1);return y.segments({inverted:!1,regions:[h]})}for(var o=l(a[0]),c=1;c{var f=ay(),y=w8(),z=ob(),P=O4(),n=ww(),i=sb(),a=!1,l=y(),o;o={buildLog:function(s){return s===!0?a=f():s===!1&&(a=!1),a===!1?!1:a.list},epsilon:function(s){return l.epsilon(s)},segments:function(s){var h=z(!0,l,a);return s.regions.forEach(h.addRegion),{segments:h.calculate(s.inverted),inverted:s.inverted}},combine:function(s,h){var m=z(!1,l,a);return{combined:m.calculate(s.segments,s.inverted,h.segments,h.inverted),inverted1:s.inverted,inverted2:h.inverted}},selectUnion:function(s){return{segments:n.union(s.combined,a),inverted:s.inverted1||s.inverted2}},selectIntersect:function(s){return{segments:n.intersect(s.combined,a),inverted:s.inverted1&&s.inverted2}},selectDifference:function(s){return{segments:n.difference(s.combined,a),inverted:s.inverted1&&!s.inverted2}},selectDifferenceRev:function(s){return{segments:n.differenceRev(s.combined,a),inverted:!s.inverted1&&s.inverted2}},selectXor:function(s){return{segments:n.xor(s.combined,a),inverted:s.inverted1!==s.inverted2}},polygon:function(s){return{regions:P(s.segments,l,a),inverted:s.inverted}},polygonFromGeoJSON:function(s){return i.toPolygon(o,s)},polygonToGeoJSON:function(s){return i.fromPolygon(o,l,s)},union:function(s,h){return c(s,h,o.selectUnion)},intersect:function(s,h){return c(s,h,o.selectIntersect)},difference:function(s,h){return c(s,h,o.selectDifference)},differenceRev:function(s,h){return c(s,h,o.selectDifferenceRev)},xor:function(s,h){return c(s,h,o.selectXor)}};function c(s,h,m){var b=o.segments(s),x=o.segments(h),_=o.combine(b,x),A=m(_);return o.polygon(A)}typeof window=="object"&&(window.PolyBool=o),Y.exports=o}),lb=It((et,Y)=>{Y.exports=function(f,y,z,P){var n=f[0],i=f[1],a=!1;z===void 0&&(z=0),P===void 0&&(P=y.length);for(var l=P-z,o=0,c=l-1;oi!=b>i&&n<(m-s)*(i-h)/(b-h)+s;x&&(a=!a)}return a}}),Ag=It((et,Y)=>{var f=aw().dot,y=Dr().BADNUM,z=Y.exports={};z.tester=function(P){var n=P.slice(),i=n[0][0],a=i,l=n[0][1],o=l,c;for((n[n.length-1][0]!==n[0][0]||n[n.length-1][1]!==n[0][1])&&n.push(n[0]),c=1;ca||w===y||wo||d&&h(A))}function b(A,d){var k=A[0],w=A[1];if(k===y||ka||w===y||wo)return!1;var D=n.length,E=n[0][0],I=n[0][1],M=0,p,g,C,S,N;for(p=1;pMath.max(g,E)||w>Math.max(C,I)))if(wc||Math.abs(f(b,h))>a)return!0;return!1},z.filter=function(P,n){var i=[P[0]],a=0,l=0;function o(s){P.push(s);var h=i.length,m=a;i.splice(l+1);for(var b=m+1;b1){var c=P.pop();o(c)}return{addPt:o,raw:P,filtered:i}}}),cb=It((et,Y)=>{Y.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),Tw=It((et,Y)=>{var f=kw(),y=lb(),z=ls(),P=Js().dashStyle,n=Hn(),i=hd(),a=T0().makeEventData,l=dm(),o=l.freeMode,c=l.rectMode,s=l.drawMode,h=l.openMode,m=l.selectMode,b=l0(),x=nb(),_=Kg(),A=Cm().clearOutline,d=Zv(),k=d.handleEllipse,w=d.readPaths,D=Z0().newShapes,E=Kv(),I=z4().activateLastSelection,M=jn(),p=M.sorterAsc,g=Ag(),C=lw(),S=Ku().getFromId,N=ry(),B=fm().redrawReglTraces,U=cb(),V=U.MINSELECT,W=g.filter,F=g.tester,H=rb(),q=H.p2r,G=H.axValue,tt=H.getTransform;function ht(Xt){return Xt.subplot!==void 0}function bt(Xt,oe,zt,_t,Pt){var Ht=!ht(_t),ae=o(Pt),he=c(Pt),Me=h(Pt),qe=s(Pt),Ye=m(Pt),ur=Pt==="drawline",Rr=Pt==="drawcircle",zr=ur||Rr,xr=_t.gd,pn=xr._fullLayout,ci=Ye&&pn.newselection.mode==="immediate"&&Ht,ui=pn._zoomlayer,yi=_t.element.getBoundingClientRect(),Gi=_t.plotinfo,Ci=tt(Gi),fi=oe-yi.left,ba=zt-yi.top;pn._calcInverseTransform(xr);var oa=M.apply3DTransform(pn._invTransform)(fi,ba);fi=oa[0],ba=oa[1];var Ke=pn._invScaleX,sr=pn._invScaleY,vr=fi,Ar=ba,mn="M"+fi+","+ba,Zn=_t.xaxes[0],Un=_t.yaxes[0],Wn=Zn._length,Li=Un._length,Fi=Xt.altKey&&!(s(Pt)&&Me),Zi,Ji,ca,Ei,Ga,so,Fe;st(Xt,xr,_t),ae&&(Zi=W([[fi,ba]],U.BENDPX));var Re=ui.selectAll("path.select-outline-"+Gi.id).data([1]),Kr=qe?pn.newshape:pn.newselection;qe&&(_t.hasText=Kr.label.text||Kr.label.texttemplate);var sn=qe&&!Me?Kr.fillcolor:"rgba(0,0,0,0)",cn=Kr.line.color||(Ht?n.contrast(xr._fullLayout.plot_bgcolor):"#7f7f7f");Re.enter().append("path").attr("class","select-outline select-outline-"+Gi.id).style({opacity:qe?Kr.opacity/2:1,"stroke-dasharray":P(Kr.line.dash,Kr.line.width),"stroke-width":Kr.line.width+"px","shape-rendering":"crispEdges"}).call(n.stroke,cn).call(n.fill,sn).attr("fill-rule","evenodd").classed("cursor-move",!!qe).attr("transform",Ci).attr("d",mn+"Z");var Yr=ui.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1}).attr("transform",Ci).attr("d","M0,0Z");if(qe&&_t.hasText){var un=ui.select(".label-temp");un.empty()&&(un=ui.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Pn=pn._uid+U.SELECTID,bn=[],ze=dt(xr,_t.xaxes,_t.yaxes,_t.subplot);ci&&!Xt.shiftKey&&(_t._clearSubplotSelections=function(){if(Ht){var en=Zn._id,Rn=Un._id;ce(xr,en,Rn,ze);for(var ni=(xr.layout||{}).selections||[],xi=[],Jn=!1,Gn=0;Gn=0){xr._fullLayout._deactivateShape(xr);return}if(!qe){var ni=pn.clickmode;C.done(Pn).then(function(){if(C.clear(Pn),en===2){for(Re.remove(),Ga=0;Ga-1&&vt(Rn,xr,_t.xaxes,_t.yaxes,_t.subplot,_t,Re),ni==="event"&&_n(xr,void 0);i.click(xr,Rn,Gi.id)}).catch(M.error)}},_t.doneFn=function(){Yr.remove(),C.done(Pn).then(function(){C.clear(Pn),!ci&&Ei&&_t.selectionDefs&&(Ei.subtract=Fi,_t.selectionDefs.push(Ei),_t.mergedPolygons.length=0,[].push.apply(_t.mergedPolygons,ca)),(ci||qe)&&J(_t,ci),_t.doneFnCompleted&&_t.doneFnCompleted(bn),Ye&&_n(xr,Fe)}).catch(M.error)}}function vt(Xt,oe,zt,_t,Pt,Ht,ae){var he=oe._hoverdata,Me=oe._fullLayout,qe=Me.clickmode,Ye=qe.indexOf("event")>-1,ur=[],Rr,zr,xr,pn,ci,ui,yi,Gi,Ci,fi;if(Rt(he)){st(Xt,oe,Ht),Rr=dt(oe,zt,_t,Pt);var ba=Bt(he,Rr),oa=ba.pointNumbers.length>0;if(oa?Gt(Rr,ba):ee(Rr)&&(yi=Zt(ba))){for(ae&&ae.remove(),fi=0;fi=0}function ot(Xt){return Xt._fullLayout._activeSelectionIndex>=0}function J(Xt,oe){var zt=Xt.dragmode,_t=Xt.plotinfo,Pt=Xt.gd;xt(Pt)&&Pt._fullLayout._deactivateShape(Pt),ot(Pt)&&Pt._fullLayout._deactivateSelection(Pt);var Ht=Pt._fullLayout,ae=Ht._zoomlayer,he=s(zt),Me=m(zt);if(he||Me){var qe=ae.selectAll(".select-outline-"+_t.id);if(qe&&Pt._fullLayout._outlining){var Ye;he&&(Ye=D(qe,Xt)),Ye&&z.call("_guiRelayout",Pt,{shapes:Ye});var ur;Me&&!ht(Xt)&&(ur=E(qe,Xt)),ur&&(Pt._fullLayout._noEmitSelectedAtStart=!0,z.call("_guiRelayout",Pt,{selections:ur}).then(function(){oe&&I(Pt)})),Pt._fullLayout._outlining=!1}}_t.selection={},_t.selection.selectionDefs=Xt.selectionDefs=[],_t.selection.mergedPolygons=Xt.mergedPolygons=[]}function mt(Xt){return Xt._id}function dt(Xt,oe,zt,_t){if(!Xt.calcdata)return[];var Pt=[],Ht=oe.map(mt),ae=zt.map(mt),he,Me,qe;for(qe=0;qe0,Ht=Pt?_t[0]:zt;return oe.selectedpoints?oe.selectedpoints.indexOf(Ht)>-1:!1}function Gt(Xt,oe){var zt=[],_t,Pt,Ht,ae;for(ae=0;ae0&&zt.push(_t);if(zt.length===1&&(Ht=zt[0]===oe.searchInfo,Ht&&(Pt=oe.searchInfo.cd[0].trace,Pt.selectedpoints.length===oe.pointNumbers.length))){for(ae=0;ae1||(oe+=_t.selectedpoints.length,oe>1)))return!1;return oe===1}function xe(Xt,oe,zt){var _t;for(_t=0;_t-1&&oe;if(!ae&&oe){var en=Ze(Xt,!0);if(en.length){var Rn=en[0].xref,ni=en[0].yref;if(Rn&&ni){var xi=fr(en),Jn=an([S(Xt,Rn,"x"),S(Xt,ni,"y")]);Jn(bn,xi)}}Xt._fullLayout._noEmitSelectedAtStart?Xt._fullLayout._noEmitSelectedAtStart=!1:yr&&_n(Xt,bn),Rr._reselect=!1}if(!ae&&Rr._deselect){var Gn=Rr._deselect;he=Gn.xref,Me=Gn.yref,be(he,Me,Ye)||ce(Xt,he,Me,_t),yr&&(bn.points.length?_n(Xt,bn):Oe(Xt)),Rr._deselect=!1}return{eventData:bn,selectionTesters:zt}}function ie(Xt){var oe=Xt.calcdata;if(oe)for(var zt=0;zt{Y.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}),ub=It((et,Y)=>{Y.exports={axisRefDescription:function(f,y,z){return["If set to a",f,"axis id (e.g. *"+f+"* or","*"+f+"2*), the `"+f+"` position refers to a",f,"coordinate. If set to *paper*, the `"+f+"`","position refers to the distance from the",y,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",y,"("+z+"). If set to a",f,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",y,"of the domain of that axis: e.g.,","*"+f+"2 domain* refers to the domain of the second",f," axis and a",f,"position of 0.5 refers to the","point between the",y,"and the",z,"of the domain of the","second",f,"axis."].join(" ")}}}),Mg=It((et,Y)=>{var f=Sw(),y=hi(),z=fu(),P=Tc().templatedArray;ub(),Y.exports=P("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:f.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:f.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",z.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",z.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:y({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),Eg=It((et,Y)=>{Y.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),Em=It((et,Y)=>{Y.exports=function(f){return{valType:"color",editType:"style",anim:!0}}}),dd=It((et,Y)=>{var f=Sh().axisHoverFormat,{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Ru(),i=hi(),a=qf().dash,l=qf().pattern,o=Js(),c=Eg(),s=Yn().extendFlat,h=Em();function m(_){return{valType:"any",dflt:0,editType:"calc"}}function b(_){return{valType:"any",editType:"calc"}}function x(_){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:m(),yperiod:m(),xperiod0:b(),yperiod0:b(),xperiodalignment:x(),yperiodalignment:x(),xhoverformat:f("x"),yhoverformat:f("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:z(),texttemplatefallback:P({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:y({},{keys:c.eventDataKeys}),hovertemplatefallback:P(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:s({},a,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:h(!0),fillgradient:s({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:s({symbol:{valType:"enumerated",values:o.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:s({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},n("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},n("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:i({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),Cw=It((et,Y)=>{var f=Mg(),y=dd().line,z=qf().dash,P=Yn().extendFlat,n=sh().overrideAll,i=Tc().templatedArray;ub(),Y.exports=n(i("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:P({},f.xref,{}),yref:P({},f.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:y.color,width:P({},y.width,{min:1,dflt:1}),dash:P({},z,{dflt:"dot"})}}),"arraydraw","from-root")}),k8=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=Cw(),n=l0();Y.exports=function(a,l){z(a,l,{name:"selections",handleItemDefaults:i});for(var o=l.selections,c=0;c{Y.exports=function(f,y,z){z("newselection.mode");var P=z("newselection.line.width");P&&(z("newselection.line.color"),z("newselection.line.dash")),z("activeselection.fillcolor"),z("activeselection.opacity")}}),Yv=It((et,Y)=>{var f=ls(),y=jn(),z=Ku();Y.exports=function(P){return function(n,i){var a=n[P];if(Array.isArray(a))for(var l=f.subplotsRegistry.cartesian,o=l.idRegex,c=i._subplots,s=c.xaxis,h=c.yaxis,m=c.cartesian,b=i._has("cartesian"),x=0;x{var f=z4(),y=Tw();Y.exports={moduleType:"component",name:"selections",layoutAttributes:Cw(),supplyLayoutDefaults:k8(),supplyDrawNewSelectionDefaults:tg(),includeBasePlot:Yv()("selections"),draw:f.draw,drawOne:f.drawOne,reselect:y.reselect,prepSelect:y.prepSelect,clearOutline:y.clearOutline,clearSelectionsCache:y.clearSelectionsCache,selectOnClick:y.selectOnClick}}),P_=It((et,Y)=>{var f=Br(),y=jn(),z=y.numberFormat,P=Xi(),n=dw(),i=ls(),a=y.strTranslate,l=uu(),o=Hn(),c=Js(),s=hd(),h=Fs(),m=Mm(),b=Up(),x=dm(),_=x.selectingOrDrawing,A=x.freeMode,d=Rd().FROM_TL,k=ry(),w=fm().redrawReglTraces,D=lh(),E=Ku().getFromId,I=Md().prepSelect,M=Md().clearOutline,p=Md().selectOnClick,g=ab(),C=fu(),S=C.MINDRAG,N=C.MINZOOM,B=!0;function U(Ct,Rt,Bt,Zt,Gt,ee,xe,ge){var ye=Ct._fullLayout._zoomlayer,ue=xe+ge==="nsew",Mt=(xe+ge).length===1,Ot,Lt,ie,be,ce,Le,Ze,Qe,mr,fr,Jr,an,Er,dn,_n,Oe,Xt,oe,zt,_t,Pt,Ht,ae;Bt+=Rt.yaxis._shift;function he(){if(Ot=Rt.xaxis,Lt=Rt.yaxis,mr=Ot._length,fr=Lt._length,Ze=Ot._offset,Qe=Lt._offset,ie={},ie[Ot._id]=Ot,be={},be[Lt._id]=Lt,xe&&ge)for(var Re=Rt.overlays,Kr=0;Kr=0){sn._fullLayout._deactivateShape(sn);return}var cn=sn._fullLayout.clickmode;if(gt(sn),Re===2&&!Mt&&Ji(),ue)cn.indexOf("select")>-1&&p(Kr,sn,ce,Le,Rt.id,Ye),cn.indexOf("event")>-1&&s.click(sn,Kr,Rt.id);else if(Re===1&&Mt){var Yr=xe?Lt:Ot,un=xe==="s"||ge==="w"?0:1,Pn=Yr._name+".range["+un+"]",bn=H(Yr,un),ze="left",yr="middle";if(Yr.fixedrange)return;xe?(yr=xe==="n"?"top":"bottom",Yr.side==="right"&&(ze="right")):ge==="e"&&(ze="right"),sn._context.showAxisRangeEntryBoxes&&f.select(qe).call(l.makeEditable,{gd:sn,immediate:!0,background:sn._fullLayout.paper_bgcolor,text:String(bn),fill:Yr.tickfont?Yr.tickfont.color:"#444",horizontalAlign:ze,verticalAlign:yr}).on("edit",function(en){var Rn=Yr.d2r(en);Rn!==void 0&&i.call("_guiRelayout",sn,Pn,Rn)})}}b.init(Ye);var zr,xr,pn,ci,ui,yi,Gi,Ci,fi,ba;function oa(Re,Kr,sn){var cn=qe.getBoundingClientRect();zr=Kr-cn.left,xr=sn-cn.top,Ct._fullLayout._calcInverseTransform(Ct);var Yr=y.apply3DTransform(Ct._fullLayout._invTransform)(zr,xr);zr=Yr[0],xr=Yr[1],pn={l:zr,r:zr,w:0,t:xr,b:xr,h:0},ci=Ct._hmpixcount?Ct._hmlumcount/Ct._hmpixcount:P(Ct._fullLayout.plot_bgcolor).getLuminance(),ui="M0,0H"+mr+"V"+fr+"H0V0",yi=!1,Gi="xy",ba=!1,Ci=bt(ye,ci,Ze,Qe,ui),fi=vt(ye,Ze,Qe)}function Ke(Re,Kr){if(Ct._transitioningWithDuration)return!1;var sn=Math.max(0,Math.min(mr,Ht*Re+zr)),cn=Math.max(0,Math.min(fr,ae*Kr+xr)),Yr=Math.abs(sn-zr),un=Math.abs(cn-xr);pn.l=Math.min(zr,sn),pn.r=Math.max(zr,sn),pn.t=Math.min(xr,cn),pn.b=Math.max(xr,cn);function Pn(){Gi="",pn.r=pn.l,pn.t=pn.b,fi.attr("d","M0,0Z")}if(Jr.isSubplotConstrained)Yr>N||un>N?(Gi="xy",Yr/mr>un/fr?(un=Yr*fr/mr,xr>cn?pn.t=xr-un:pn.b=xr+un):(Yr=un*mr/fr,zr>sn?pn.l=zr-Yr:pn.r=zr+Yr),fi.attr("d",ot(pn))):Pn();else if(an.isSubplotConstrained)if(Yr>N||un>N){Gi="xy";var bn=Math.min(pn.l/mr,(fr-pn.b)/fr),ze=Math.max(pn.r/mr,(fr-pn.t)/fr);pn.l=bn*mr,pn.r=ze*mr,pn.b=(1-bn)*fr,pn.t=(1-ze)*fr,fi.attr("d",ot(pn))}else Pn();else!dn||un0){var en;if(an.isSubplotConstrained||!Er&&dn.length===1){for(en=0;en1&&(Pn.maxallowed!==void 0&&Oe===(Pn.range[0]1&&(bn.maxallowed!==void 0&&Xt===(bn.range[0]=0?Math.min(Ct,.9):1/(1/Math.max(Ct,-.3)+3.222))}function ht(Ct,Rt,Bt){return Ct?Ct==="nsew"?Bt?"":Rt==="pan"?"move":"crosshair":Ct.toLowerCase()+"-resize":"pointer"}function bt(Ct,Rt,Bt,Zt,Gt){return Ct.append("path").attr("class","zoombox").style({fill:Rt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",a(Bt,Zt)).attr("d",Gt+"Z")}function vt(Ct,Rt,Bt){return Ct.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1,opacity:0}).attr("transform",a(Rt,Bt)).attr("d","M0,0Z")}function ut(Ct,Rt,Bt,Zt,Gt,ee){Ct.attr("d",Zt+"M"+Bt.l+","+Bt.t+"v"+Bt.h+"h"+Bt.w+"v-"+Bt.h+"h-"+Bt.w+"Z"),rt(Ct,Rt,Gt,ee)}function rt(Ct,Rt,Bt,Zt){Bt||(Ct.transition().style("fill",Zt>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Rt.transition().style("opacity",1).duration(200))}function gt(Ct){f.select(Ct).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function it(Ct){B&&Ct.data&&Ct._context.showTips&&(y.notifier(y._(Ct,"Double-click to zoom back out"),"long"),B=!1)}function st(Ct,Rt){return"M"+(Ct.l-.5)+","+(Rt-N-.5)+"h-3v"+(2*N+1)+"h3ZM"+(Ct.r+.5)+","+(Rt-N-.5)+"h3v"+(2*N+1)+"h-3Z"}function xt(Ct,Rt){return"M"+(Rt-N-.5)+","+(Ct.t-.5)+"v-3h"+(2*N+1)+"v3ZM"+(Rt-N-.5)+","+(Ct.b+.5)+"v3h"+(2*N+1)+"v-3Z"}function ot(Ct){var Rt=Math.floor(Math.min(Ct.b-Ct.t,Ct.r-Ct.l,N)/2);return"M"+(Ct.l-3.5)+","+(Ct.t-.5+Rt)+"h3v"+-Rt+"h"+Rt+"v-3h-"+(Rt+3)+"ZM"+(Ct.r+3.5)+","+(Ct.t-.5+Rt)+"h-3v"+-Rt+"h"+-Rt+"v-3h"+(Rt+3)+"ZM"+(Ct.r+3.5)+","+(Ct.b+.5-Rt)+"h-3v"+Rt+"h"+-Rt+"v3h"+(Rt+3)+"ZM"+(Ct.l-3.5)+","+(Ct.b+.5-Rt)+"h3v"+Rt+"h"+Rt+"v3h-"+(Rt+3)+"Z"}function J(Ct,Rt,Bt,Zt,Gt){for(var ee=!1,xe={},ge={},ye,ue,Mt,Ot,Lt=(Gt||{}).xaHash,ie=(Gt||{}).yaHash,be=0;be{var Y=Br(),f=hd(),y=Up(),z=Mm(),P=P_().makeDragBox,n=fu().DRAGGERSIZE;et.initInteractions=function(i){var a=i._fullLayout;if(i._context.staticPlot){Y.select(i).selectAll(".drag").remove();return}if(!(!a._has("cartesian")&&!a._has("splom"))){var l=Object.keys(a._plots||{}).sort(function(c,s){if((a._plots[c].mainplot&&!0)===(a._plots[s].mainplot&&!0)){var h=c.split("y"),m=s.split("y");return h[0]===m[0]?Number(h[1]||1)-Number(m[1]||1):Number(h[0]||1)-Number(m[0]||1)}return a._plots[c].mainplot?1:-1});l.forEach(function(c){var s=a._plots[c],h=s.xaxis,m=s.yaxis;if(!s.mainplot){var b=P(i,s,h._offset,m._offset,h._length,m._length,"ns","ew");b.onmousemove=function(A){i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===c&&i._fullLayout._plots[c]&&f.hover(i,A,c)},f.hover(i,A,c),i._fullLayout._lasthover=b,i._fullLayout._hoversubplot=c},b.onmouseout=function(A){i._dragging||(i._fullLayout._hoversubplot=null,y.unhover(i,A))},i._context.showAxisDragHandles&&(P(i,s,h._offset-n,m._offset-n,n,n,"n","w"),P(i,s,h._offset+h._length,m._offset-n,n,n,"n","e"),P(i,s,h._offset-n,m._offset+m._length,n,n,"s","w"),P(i,s,h._offset+h._length,m._offset+m._length,n,n,"s","e"))}if(i._context.showAxisDragHandles){if(c===h._mainSubplot){var x=h._mainLinePosition;h.side==="top"&&(x-=n),P(i,s,h._offset+h._length*.1,x,h._length*.8,n,"","ew"),P(i,s,h._offset,x,h._length*.1,n,"","w"),P(i,s,h._offset+h._length*.9,x,h._length*.1,n,"","e")}if(c===m._mainSubplot){var _=m._mainLinePosition;m.side!=="right"&&(_-=n),P(i,s,_,m._offset+m._length*.1,n,m._length*.8,"ns",""),P(i,s,_,m._offset+m._length*.9,n,m._length*.1,"s",""),P(i,s,_,m._offset,n,m._length*.1,"n","")}}});var o=a._hoverlayer.node();o.onmousemove=function(c){c.target=i._fullLayout._lasthover,f.hover(i,c,a._hoversubplot)},o.onclick=function(c){c.target=i._fullLayout._lasthover,f.click(i,c)},o.onmousedown=function(c){i._fullLayout._lasthover.onmousedown(c)},et.updateFx(i)}},et.updateFx=function(i){var a=i._fullLayout,l=a.dragmode==="pan"?"move":"crosshair";z(a._draggers,l)}}),R4=It((et,Y)=>{var f=ls();Y.exports=function(y){for(var z=f.layoutArrayContainers,P=f.layoutArrayRegexes,n=y.split("[")[0],i,a,l=0;l{var Y=Cn(),f=Po(),y=es(),z=sw().sorterAsc,P=ls();et.containerArrayMatch=R4();var n=et.isAddVal=function(a){return a==="add"||Y(a)},i=et.isRemoveVal=function(a){return a===null||a==="remove"};et.applyContainerArrayChanges=function(a,l,o,c,s){var h=l.astr,m=P.getComponentMethod(h,"supplyLayoutDefaults"),b=P.getComponentMethod(h,"draw"),x=P.getComponentMethod(h,"drawOne"),_=c.replot||c.recalc||m===f||b===f,A=a.layout,d=a._fullLayout;if(o[""]){Object.keys(o).length>1&&y.warn("Full array edits are incompatible with other edits",h);var k=o[""][""];if(i(k))l.set(null);else if(Array.isArray(k))l.set(k);else return y.warn("Unrecognized full array edit value",h,k),!0;return _?!1:(m(A,d),b(a),!0)}var w=Object.keys(o).map(Number).sort(z),D=l.get(),E=D||[],I=s(d,h).get(),M=[],p=-1,g=E.length,C,S,N,B,U,V,W,F;for(C=0;CE.length-(W?0:1)){y.warn("index out of range",h,N);continue}if(V!==void 0)U.length>1&&y.warn("Insertion & removal are incompatible with edits to the same index.",h,N),i(V)?M.push(N):W?(V==="add"&&(V={}),E.splice(N,0,V),I&&I.splice(N,0,{})):y.warn("Unrecognized full object edit value",h,N,V),p===-1&&(p=N);else for(S=0;S=0;C--)E.splice(M[C],1),I&&I.splice(M[C],1);if(E.length?D||l.set(E):l.set(null),_)return!1;if(m(A,d),x!==f){var H;if(p===-1)H=w;else{for(g=Math.max(E.length,g),H=[],C=0;C=p));C++)H.push(N);for(C=p;C{var Y=Sr(),f=ls(),y=jn(),z=lh(),P=Ku(),n=Hn(),i=P.cleanId,a=P.getFromTrace,l=f.traceIs,o=["x","y","z"];et.clearPromiseQueue=function(d){Array.isArray(d._promises)&&d._promises.length>0&&y.log("Clearing previous rejected promises from queue."),d._promises=[]},et.cleanLayout=function(d){var k;d||(d={}),d.xaxis1&&(d.xaxis||(d.xaxis=d.xaxis1),delete d.xaxis1),d.yaxis1&&(d.yaxis||(d.yaxis=d.yaxis1),delete d.yaxis1),d.scene1&&(d.scene||(d.scene=d.scene1),delete d.scene1);var w=(z.subplotsRegistry.cartesian||{}).attrRegex;(z.subplotsRegistry.polar||{}).attrRegex,(z.subplotsRegistry.ternary||{}).attrRegex,(z.subplotsRegistry.gl3d||{}).attrRegex;var D=Object.keys(d);for(k=0;k3?(B.x=1.02,B.xanchor="left"):B.x<-2&&(B.x=-.02,B.xanchor="right"),B.y>3?(B.y=1.02,B.yanchor="bottom"):B.y<-2&&(B.y=-.02,B.yanchor="top")),d.dragmode==="rotate"&&(d.dragmode="orbit"),n.clean(d),d.template&&d.template.layout&&et.cleanLayout(d.template.layout),d};function c(d,k){var w=d[k],D=k.charAt(0);w&&w!=="paper"&&(d[k]=i(w,D,!0))}et.cleanData=function(d){for(var k=0;k0)return d.substr(0,k)}et.hasParent=function(d,k){for(var w=_(k);w;){if(w in d)return!0;w=_(w)}return!1},et.clearAxisTypes=function(d,k,w){for(var D=0;D{let w=(...D)=>D.every(E=>y.isPlainObject(E))||D.every(E=>Array.isArray(E));if([d,k].every(D=>Array.isArray(D))){if(d.length!==k.length)return!1;for(let D=0;Dy.isPlainObject(D))){if(Object.keys(d).length!==Object.keys(k).length)return!1;for(let D in d){if(D.startsWith("_"))continue;let E=d[D],I=k[D];if(E!==I&&!(w(E,I)&&A(E,I)))return!1}return!0}return!1};et.collectionsAreEqual=A}),Aw=It(et=>{var Y=Br(),f=Sr(),y=Jd(),z=jn(),P=z.nestedProperty,n=qg(),i=um(),a=ls(),l=Gg(),o=lh(),c=Fs(),s=hw(),h=Gf(),m=Js(),b=Hn(),x=B4().initInteractions,_=k0(),A=Md().clearOutline,d=Mo().dfltConfig,k=T8(),w=I_(),D=fm(),E=sh(),I=fu().AX_NAME_PATTERN,M=0,p=5;function g(zt,_t,Pt,Ht){var ae;if(zt=z.getGraphDiv(zt),n.init(zt),z.isPlainObject(_t)){var he=_t;_t=he.data,Pt=he.layout,Ht=he.config,ae=he.frames}var Me=n.triggerHandler(zt,"plotly_beforeplot",[_t,Pt,Ht]);if(Me===!1)return Promise.reject();!_t&&!Pt&&!z.isPlotDiv(zt)&&z.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",zt);function qe(){if(ae)return et.addFrames(zt,ae)}U(zt,Ht),Pt||(Pt={}),Y.select(zt).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(zt._promises)||(zt._promises=[]);var Ye=(zt.data||[]).length===0&&Array.isArray(_t);Array.isArray(_t)&&(w.cleanData(_t),Ye?zt.data=_t:zt.data.push.apply(zt.data,_t),zt.empty=!1),(!zt.layout||Ye)&&(zt.layout=w.cleanLayout(Pt)),o.supplyDefaults(zt);var ur=zt._fullLayout,Rr=ur._has("cartesian");ur._replotting=!0,(Ye||ur._shouldCreateBgLayer)&&(oe(zt),ur._shouldCreateBgLayer&&delete ur._shouldCreateBgLayer),m.initGradients(zt),m.initPatterns(zt),Ye&&c.saveShowSpikeInitial(zt);var zr=!zt.calcdata||zt.calcdata.length!==(zt._fullData||[]).length;zr&&o.doCalcdata(zt);for(var xr=0;xr=zt.data.length||ae<-zt.data.length)throw new Error(Pt+" must be valid indices for gd.data.");if(_t.indexOf(ae,Ht+1)>-1||ae>=0&&_t.indexOf(-zt.data.length+ae)>-1||ae<0&&_t.indexOf(zt.data.length+ae)>-1)throw new Error("each index in "+Pt+" must be unique.")}}function q(zt,_t,Pt){if(!Array.isArray(zt.data))throw new Error("gd.data must be an array.");if(typeof _t>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(_t)||(_t=[_t]),H(zt,_t,"currentIndices"),typeof Pt<"u"&&!Array.isArray(Pt)&&(Pt=[Pt]),typeof Pt<"u"&&H(zt,Pt,"newIndices"),typeof Pt<"u"&&_t.length!==Pt.length)throw new Error("current and new indices must be of equal length.")}function G(zt,_t,Pt){var Ht,ae;if(!Array.isArray(zt.data))throw new Error("gd.data must be an array.");if(typeof _t>"u")throw new Error("traces must be defined.");for(Array.isArray(_t)||(_t=[_t]),Ht=0;Ht<_t.length;Ht++)if(ae=_t[Ht],typeof ae!="object"||Array.isArray(ae)||ae===null)throw new Error("all values in traces array must be non-array objects");if(typeof Pt<"u"&&!Array.isArray(Pt)&&(Pt=[Pt]),typeof Pt<"u"&&Pt.length!==_t.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function tt(zt,_t,Pt,Ht){var ae=z.isPlainObject(Ht);if(!Array.isArray(zt.data))throw new Error("gd.data must be an array");if(!z.isPlainObject(_t))throw new Error("update must be a key:value object");if(typeof Pt>"u")throw new Error("indices must be an integer or array of integers");H(zt,Pt,"indices");for(var he in _t){if(!Array.isArray(_t[he])||_t[he].length!==Pt.length)throw new Error("attribute "+he+" must be an array of length equal to indices array length");if(ae&&(!(he in Ht)||!Array.isArray(Ht[he])||Ht[he].length!==_t[he].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function ht(zt,_t,Pt,Ht){var ae=z.isPlainObject(Ht),he=[],Me,qe,Ye,ur,Rr;Array.isArray(Pt)||(Pt=[Pt]),Pt=F(Pt,zt.data.length-1);for(var zr in _t)for(var xr=0;xr=0&&Rr=0&&Rr"u")return ur=et.redraw(zt),i.add(zt,ae,Me,he,qe),ur;Array.isArray(Pt)||(Pt=[Pt]);try{q(zt,Ht,Pt)}catch(Rr){throw zt.data.splice(zt.data.length-_t.length,_t.length),Rr}return i.startSequence(zt),i.add(zt,ae,Me,he,qe),ur=et.moveTraces(zt,Ht,Pt),i.stopSequence(zt),ur}function it(zt,_t){zt=z.getGraphDiv(zt);var Pt=[],Ht=et.addTraces,ae=it,he=[zt,Pt,_t],Me=[zt,_t],qe,Ye;if(typeof _t>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(_t)||(_t=[_t]),H(zt,_t,"indices"),_t=F(_t,zt.data.length-1),_t.sort(z.sorterDes),qe=0;qe<_t.length;qe+=1)Ye=zt.data.splice(_t[qe],1)[0],Pt.push(Ye);var ur=et.redraw(zt);return i.add(zt,Ht,he,ae,Me),ur}function st(zt,_t,Pt){zt=z.getGraphDiv(zt);var Ht=[],ae=[],he=st,Me=st,qe=[zt,Pt,_t],Ye=[zt,_t,Pt],ur;if(q(zt,_t,Pt),_t=Array.isArray(_t)?_t:[_t],typeof Pt>"u")for(Pt=[],ur=0;ur<_t.length;ur++)Pt.push(-_t.length+ur);for(Pt=Array.isArray(Pt)?Pt:[Pt],_t=F(_t,zt.data.length-1),Pt=F(Pt,zt.data.length-1),ur=0;ur0&&typeof vr.parts[Zn]!="string";)Zn--;var Un=vr.parts[Zn],Wn=vr.parts[Zn-1]+"."+Un,Li=vr.parts.slice(0,Zn).join("."),Fi=P(zt.layout,Li).get(),Zi=P(Ht,Li).get(),Ji=vr.get();if(Ar!==void 0){Gi[sr]=Ar,Ci[sr]=Un==="reverse"?Ar:ot(Ji);var ca=l.getLayoutValObject(Ht,vr.parts);if(ca&&ca.impliedEdits&&Ar!==null)for(var Ei in ca.impliedEdits)fi(z.relativeAttr(sr,Ei),ca.impliedEdits[Ei]);if(["width","height"].indexOf(sr)!==-1)if(Ar){fi("autosize",null);var Ga=sr==="height"?"width":"height";fi(Ga,Ht[Ga])}else Ht[sr]=zt._initialAutoSize[sr];else if(sr==="autosize")fi("width",Ar?null:Ht.width),fi("height",Ar?null:Ht.height);else if(Wn.match(Gt))Ke(Wn),P(Ht,Li+"._inputRange").set(null);else if(Wn.match(ee)){Ke(Wn),P(Ht,Li+"._inputRange").set(null);var so=P(Ht,Li).get();so._inputDomain&&(so._input.domain=so._inputDomain.slice())}else Wn.match(xe)&&P(Ht,Li+"._inputDomain").set(null);if(Un==="type"){oa=Fi;var Fe=Zi.type==="linear"&&Ar==="log",Re=Zi.type==="log"&&Ar==="linear";if(Fe||Re){if(!oa||!oa.range)fi(Li+".autorange",!0);else if(Zi.autorange)Fe&&(oa.range=oa.range[1]>oa.range[0]?[1,2]:[2,1]);else{var Kr=oa.range[0],sn=oa.range[1];Fe?(Kr<=0&&sn<=0&&fi(Li+".autorange",!0),Kr<=0?Kr=sn/1e6:sn<=0&&(sn=Kr/1e6),fi(Li+".range[0]",Math.log(Kr)/Math.LN10),fi(Li+".range[1]",Math.log(sn)/Math.LN10)):(fi(Li+".range[0]",Math.pow(10,Kr)),fi(Li+".range[1]",Math.pow(10,sn)))}Array.isArray(Ht._subplots.polar)&&Ht._subplots.polar.length&&Ht[vr.parts[0]]&&vr.parts[1]==="radialaxis"&&delete Ht[vr.parts[0]]._subplot.viewInitial["radialaxis.range"],a.getComponentMethod("annotations","convertCoords")(zt,Zi,Ar,fi),a.getComponentMethod("images","convertCoords")(zt,Zi,Ar,fi)}else fi(Li+".autorange",!0),fi(Li+".range",null);P(Ht,Li+"._inputRange").set(null)}else if(Un.match(I)){var cn=P(Ht,sr).get(),Yr=(Ar||{}).type;(!Yr||Yr==="-")&&(Yr="linear"),a.getComponentMethod("annotations","convertCoords")(zt,cn,Yr,fi),a.getComponentMethod("images","convertCoords")(zt,cn,Yr,fi)}var un=k.containerArrayMatch(sr);if(un){Rr=un.array,zr=un.index;var Pn=un.property,bn=ca||{editType:"calc"};zr!==""&&Pn===""&&(k.isAddVal(Ar)?Ci[sr]=null:k.isRemoveVal(Ar)?Ci[sr]=(P(Pt,Rr).get()||[])[zr]:z.warn("unrecognized full object value",_t)),E.update(yi,bn),ur[Rr]||(ur[Rr]={});var ze=ur[Rr][zr];ze||(ze=ur[Rr][zr]={}),ze[Pn]=Ar,delete _t[sr]}else Un==="reverse"?(Fi.range?Fi.range.reverse():(fi(Li+".autorange",!0),Fi.range=[1,0]),Zi.autorange?yi.calc=!0:yi.plot=!0):(sr==="dragmode"&&(Ar===!1&&Ji!==!1||Ar!==!1&&Ji===!1)||Ht._has("scatter-like")&&Ht._has("regl")&&sr==="dragmode"&&(Ar==="lasso"||Ar==="select")&&!(Ji==="lasso"||Ji==="select")?yi.plot=!0:ca?E.update(yi,ca):yi.calc=!0,vr.set(Ar))}}for(Rr in ur){var yr=k.applyContainerArrayChanges(zt,he(Pt,Rr),ur[Rr],yi,he);yr||(yi.plot=!0)}for(var en in ba){oa=c.getFromId(zt,en);var Rn=oa&&oa._constraintGroup;if(Rn){yi.calc=!0;for(var ni in Rn)ba[ni]||(c.getFromId(zt,ni)._constraintShrinkable=!0)}}(ye(zt)||_t.height||_t.width)&&(yi.plot=!0);var xi=Ht.shapes;for(zr=0;zr1;)if(Ht.pop(),Pt=P(_t,Ht.join(".")+".uirevision").get(),Pt!==void 0)return Pt;return _t.uirevision}function ce(zt,_t){for(var Pt=0;Pt<_t.length;Pt++)if(_t[Pt]._fullInput.uid===zt)return Pt;return-1}function Le(zt,_t,Pt){for(var Ht=0;Ht<_t.length;Ht++)if(_t[Ht].uid===zt)return Ht;return!_t[Pt]||_t[Pt].uid?-1:Pt}function Ze(zt,_t){var Pt=z.isPlainObject(zt),Ht=Array.isArray(zt);return Pt||Ht?(Pt&&z.isPlainObject(_t)||Ht&&Array.isArray(_t))&&JSON.stringify(zt)===JSON.stringify(_t):zt===_t}function Qe(zt,_t,Pt,Ht){var ae=Ht._preGUI,he,Me,qe,Ye,ur,Rr,zr,xr,pn,ci,ui=[],yi={},Gi={};for(he in ae){if(ur=ie(he,Ot),ur){if(pn=ur.head,ci=ur.tail,Me=ur.attr||pn+".uirevision",qe=P(Ht,Me).get(),Ye=qe&&be(Me,_t),Ye&&Ye===qe){if(Rr=ae[he],Rr===null&&(Rr=void 0),zr=P(_t,he),xr=zr.get(),Ze(xr,Rr)){xr===void 0&&ci==="autorange"&&ui.push(pn),zr.set(ot(P(Ht,he).get()));continue}else if(ci==="autorange"||ci.substr(0,6)==="range["){var Ci=ae[pn+".range[0]"],fi=ae[pn+".range[1]"],ba=ae[pn+".autorange"];if(ba||ba===null&&Ci===null&&fi===null){if(!(pn in yi)){var oa=P(_t,pn).get();yi[pn]=oa&&(oa.autorange||oa.autorange!==!1&&(!oa.range||oa.range.length!==2))}if(yi[pn]){zr.set(ot(P(Ht,he).get()));continue}}}}}else z.warn("unrecognized GUI edit: "+he);delete ae[he],ur&&ur.tail.substr(0,6)==="range["&&(Gi[ur.head]=1)}for(var Ke=0;Ke[Li,zt._ev.listeners(Li)]);he=et.newPlot(zt,_t,Pt,Ht).then(()=>{for(let[Li,Fi]of Wn)Fi.forEach(Zi=>zt.on(Li,Zi));return et.react(zt,_t,Pt,Ht)})}else{zt.data=_t||[],w.cleanData(zt.data),zt.layout=Pt||{},w.cleanLayout(zt.layout),Qe(zt.data,zt.layout,qe,Ye),o.supplyDefaults(zt,{skipUpdateCalc:!0});var zr=zt._fullData,xr=zt._fullLayout,pn=xr.datarevision===void 0,ci=xr.transition,ui=Jr(zt,Ye,xr,pn,ci),yi=ui.newDataRevision,Gi=fr(zt,qe,zr,pn,ci,yi);if(ye(zt)&&(ui.layoutReplot=!0),Gi.calc||ui.calc){zt.calcdata=void 0;for(var Ci=Object.getOwnPropertyNames(xr),fi=0;fi(Rr||zt.emit("plotly_react",{config:Ht,data:_t,layout:Pt}),zt))}function fr(zt,_t,Pt,Ht,ae,he){var Me=_t.length===Pt.length;if(!ae&&!Me)return{fullReplot:!0,calc:!0};var qe=E.traceFlags();qe.arrays={},qe.nChanges=0,qe.nChangesAnim=0;var Ye,ur;function Rr(pn){var ci=l.getTraceValObject(ur,pn);return!ur._module.animatable&&ci.anim&&(ci.anim=!1),ci}var zr={getValObject:Rr,flags:qe,immutable:Ht,transition:ae,newDataRevision:he,gd:zt},xr={};for(Ye=0;Ye<_t.length;Ye++)if(Pt[Ye]){if(ur=Pt[Ye]._fullInput,xr[ur.uid])continue;xr[ur.uid]=1,an(_t[Ye]._fullInput,ur,[],zr)}return(qe.calc||qe.plot)&&(qe.fullReplot=!0),ae&&qe.nChanges&&qe.nChangesAnim&&(qe.anim=qe.nChanges===qe.nChangesAnim&&Me?"all":"some"),qe}function Jr(zt,_t,Pt,Ht,ae){var he=E.layoutFlags();he.arrays={},he.rangesAltered={},he.nChanges=0,he.nChangesAnim=0;function Me(xr){return l.getLayoutValObject(Pt,xr)}for(var qe in Pt)if(!(!qe.startsWith("xaxis")&&!qe.startsWith("yaxis"))&&_t[qe]){var Ye=Pt[qe].domain,ur=_t[qe].domain,Rr=_t[qe]._inputDomain;_t[qe]._inputDomain&&(Ye[0]===Rr[0]&&Ye[1]===Rr[1]?Pt[qe].domain=_t[qe].domain:(Ye[0]!==ur[0]||Ye[1]!==ur[1])&&(Pt[qe]._inputDomain=null))}var zr={getValObject:Me,flags:he,immutable:Ht,transition:ae,gd:zt};return an(_t,Pt,[],zr),(he.plot||he.calc)&&(he.layoutReplot=!0),ae&&he.nChanges&&he.nChangesAnim&&(he.anim=he.nChanges===he.nChangesAnim?"all":"some"),he}function an(zt,_t,Pt,Ht){var ae,he,Me,qe=Ht.getValObject,Ye=Ht.flags,ur=Ht.immutable,Rr=Ht.inArray,zr=Ht.arrayIndex;function xr(){var Li=ae.editType;if(Rr&&Li.indexOf("arraydraw")!==-1){z.pushUnique(Ye.arrays[Rr],zr);return}E.update(Ye,ae),Li!=="none"&&Ye.nChanges++,Ht.transition&&ae.anim&&Ye.nChangesAnim++,(Gt.test(Me)||ee.test(Me))&&(Ye.rangesAltered[Pt[0]]=1),he==="datarevision"&&(Ye.newDataRevision=1)}function pn(Li){return Li.valType==="data_array"||Li.arrayOk}for(he in zt){if(Ye.calc&&!Ht.transition)return;var ci=zt[he],ui=_t[he],yi=Pt.concat(he);if(Me=yi.join("."),!(he.charAt(0)==="_"||typeof ci=="function"||ci===ui)){if((he==="tick0"||he==="dtick")&&Pt[0]!=="geo"){var Gi=_t.tickmode;if(Gi==="auto"||Gi==="array"||!Gi)continue}if(!(he==="range"&&_t.autorange)&&!((he==="zmin"||he==="zmax")&&_t.type==="contourcarpet")&&(ae=qe(yi),!!ae&&!(ae._compareAsJSON&&JSON.stringify(ci)===JSON.stringify(ui)))){var Ci=ae.valType,fi,ba=pn(ae),oa=Array.isArray(ci),Ke=Array.isArray(ui);if(oa&&Ke){var sr="_input_"+he,vr=zt[sr],Ar=_t[sr];if(Array.isArray(vr)&&vr===Ar)continue}if(ui===void 0)ba&&oa?Ye.calc=!0:xr();else if(ae._isLinkedToArray){var mn=[],Zn=!1;Rr||(Ye.arrays[he]=mn);var Un=Math.min(ci.length,ui.length),Wn=Math.max(ci.length,ui.length);if(Un!==Wn)if(ae.editType==="arraydraw")Zn=!0;else{xr();continue}for(fi=0;fi=ae.length?ae[0]:ae[ur]:ae}function qe(ur){return Array.isArray(he)?ur>=he.length?he[0]:he[ur]:he}function Ye(ur,Rr){var zr=0;return function(){if(ur&&++zr===Rr)return ur()}}return new Promise(function(ur,Rr){function zr(){if(Ht._frameQueue.length!==0){for(;Ht._frameQueue.length;){var Un=Ht._frameQueue.pop();Un.onInterrupt&&Un.onInterrupt()}zt.emit("plotly_animationinterrupted",[])}}function xr(Un){if(Un.length!==0){for(var Wn=0;WnHt._timeToNext&&ci()};Un()}var yi=0;function Gi(Un){return Array.isArray(ae)?yi>=ae.length?Un.transitionOpts=ae[yi]:Un.transitionOpts=ae[0]:Un.transitionOpts=ae,yi++,Un}var Ci,fi,ba=[],oa=_t==null,Ke=Array.isArray(_t),sr=!oa&&!Ke&&z.isPlainObject(_t);if(sr)ba.push({type:"object",data:Gi(z.extendFlat({},_t))});else if(oa||["string","number"].indexOf(typeof _t)!==-1)for(Ci=0;Ci0&&mnmn)&&Zn.push(fi);ba=Zn}}ba.length>0?xr(ba):(zt.emit("plotly_animated"),ur())})}function dn(zt,_t,Pt){if(zt=z.getGraphDiv(zt),_t==null)return Promise.resolve();if(!z.isPlotDiv(zt))throw new Error("This element is not a Plotly plot: "+zt+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Ht,ae,he,Me,qe=zt._transitionData._frames,Ye=zt._transitionData._frameHash;if(!Array.isArray(_t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+_t);var ur=qe.length+_t.length*2,Rr=[],zr={};for(Ht=_t.length-1;Ht>=0;Ht--)if(z.isPlainObject(_t[Ht])){var xr=_t[Ht].name,pn=(Ye[xr]||zr[xr]||{}).name,ci=_t[Ht].name,ui=Ye[pn]||zr[pn];pn&&ci&&typeof ci=="number"&&ui&&Mvr.index?-1:sr.index=0;Ht--){if(ae=Rr[Ht].frame,typeof ae.name=="number"&&z.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!ae.name)for(;Ye[ae.name="frame "+zt._transitionData._counter++];);if(Ye[ae.name]){for(he=0;he=0;Pt--)Ht=_t[Pt],he.push({type:"delete",index:Ht}),Me.unshift({type:"insert",index:Ht,value:ae[Ht]});var qe=o.modifyFrames,Ye=o.modifyFrames,ur=[zt,Me],Rr=[zt,he];return i&&i.add(zt,qe,ur,Ye,Rr),o.modifyFrames(zt,he)}function Oe(zt){zt=z.getGraphDiv(zt);var _t=zt._fullLayout||{},Pt=zt._fullData||[];return o.cleanPlot([],{},Pt,_t),o.purge(zt),n.purge(zt),_t._container&&_t._container.remove(),delete zt._context,zt}function Xt(zt){var _t=zt._fullLayout,Pt=zt.getBoundingClientRect();if(!z.equalDomRects(Pt,_t._lastBBox)){var Ht=_t._invTransform=z.inverseTransformMatrix(z.getFullTransformMatrix(zt));_t._invScaleX=Math.sqrt(Ht[0][0]*Ht[0][0]+Ht[0][1]*Ht[0][1]+Ht[0][2]*Ht[0][2]),_t._invScaleY=Math.sqrt(Ht[1][0]*Ht[1][0]+Ht[1][1]*Ht[1][1]+Ht[1][2]*Ht[1][2]),_t._lastBBox=Pt}}function oe(zt){var _t=Y.select(zt),Pt=zt._fullLayout;if(Pt._calcInverseTransform=Xt,Pt._calcInverseTransform(zt),Pt._container=_t.selectAll(".plot-container").data([0]),Pt._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Pt._paperdiv=Pt._container.selectAll(".svg-container").data([0]),Pt._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Pt._glcontainer=Pt._paperdiv.selectAll(".gl-container").data([{}]),Pt._glcontainer.enter().append("div").classed("gl-container",!0),Pt._paperdiv.selectAll(".main-svg").remove(),Pt._paperdiv.select(".modebar-container").remove(),Pt._paper=Pt._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Pt._toppaper=Pt._paperdiv.append("svg").classed("main-svg",!0),Pt._modebardiv=Pt._paperdiv.append("div"),delete Pt._modeBar,Pt._hoverpaper=Pt._paperdiv.append("svg").classed("main-svg",!0),!Pt._uid){var Ht={};Y.selectAll("defs").each(function(){this.id&&(Ht[this.id.split("-")[1]]=1)}),Pt._uid=z.randstr(Ht)}Pt._paperdiv.selectAll(".main-svg").attr(_.svgAttrs),Pt._defs=Pt._paper.append("defs").attr("id","defs-"+Pt._uid),Pt._clips=Pt._defs.append("g").classed("clips",!0),Pt._topdefs=Pt._toppaper.append("defs").attr("id","topdefs-"+Pt._uid),Pt._topclips=Pt._topdefs.append("g").classed("clips",!0),Pt._bgLayer=Pt._paper.append("g").classed("bglayer",!0),Pt._draggers=Pt._paper.append("g").classed("draglayer",!0);var ae=Pt._paper.append("g").classed("layer-below",!0);Pt._imageLowerLayer=ae.append("g").classed("imagelayer",!0),Pt._shapeLowerLayer=ae.append("g").classed("shapelayer",!0),Pt._cartesianlayer=Pt._paper.append("g").classed("cartesianlayer",!0),Pt._polarlayer=Pt._paper.append("g").classed("polarlayer",!0),Pt._smithlayer=Pt._paper.append("g").classed("smithlayer",!0),Pt._ternarylayer=Pt._paper.append("g").classed("ternarylayer",!0),Pt._geolayer=Pt._paper.append("g").classed("geolayer",!0),Pt._funnelarealayer=Pt._paper.append("g").classed("funnelarealayer",!0),Pt._pielayer=Pt._paper.append("g").classed("pielayer",!0),Pt._iciclelayer=Pt._paper.append("g").classed("iciclelayer",!0),Pt._treemaplayer=Pt._paper.append("g").classed("treemaplayer",!0),Pt._sunburstlayer=Pt._paper.append("g").classed("sunburstlayer",!0),Pt._indicatorlayer=Pt._toppaper.append("g").classed("indicatorlayer",!0),Pt._glimages=Pt._paper.append("g").classed("glimages",!0);var he=Pt._toppaper.append("g").classed("layer-above",!0);Pt._imageUpperLayer=he.append("g").classed("imagelayer",!0),Pt._shapeUpperLayer=he.append("g").classed("shapelayer",!0),Pt._selectionLayer=Pt._toppaper.append("g").classed("selectionlayer",!0),Pt._infolayer=Pt._toppaper.append("g").classed("infolayer",!0),Pt._menulayer=Pt._toppaper.append("g").classed("menulayer",!0),Pt._zoomlayer=Pt._toppaper.append("g").classed("zoomlayer",!0),Pt._hoverlayer=Pt._hoverpaper.append("g").classed("hoverlayer",!0),Pt._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),zt.emit("plotly_framework")}et.animate=Er,et.addFrames=dn,et.deleteFrames=_n,et.addTraces=gt,et.deleteTraces=it,et.extendTraces=ut,et.moveTraces=st,et.prependTraces=rt,et.newPlot=W,et._doPlot=g,et.purge=Oe,et.react=mr,et.redraw=V,et.relayout=Rt,et.restyle=xt,et.setPlotConfig=S,et.update=ue,et._guiRelayout=Mt(Rt),et._guiRestyle=Mt(xt),et._guiUpdate=Mt(ue),et._storeDirectGUIEdit=dt}),K0=It(et=>{var Y=ls();et.getDelay=function(z){return z._has&&(z._has("gl3d")||z._has("mapbox")||z._has("map"))?500:0},et.getRedrawFunc=function(z){return function(){Y.getComponentMethod("colorbar","draw")(z)}},et.encodeSVG=function(z){return"data:image/svg+xml,"+encodeURIComponent(z)},et.encodeJSON=function(z){return"data:application/json,"+encodeURIComponent(z)};var f=window.URL||window.webkitURL;et.createObjectURL=function(z){return f.createObjectURL(z)},et.revokeObjectURL=function(z){return f.revokeObjectURL(z)},et.createBlob=function(z,P){if(P==="svg")return new window.Blob([z],{type:"image/svg+xml;charset=utf-8"});if(P==="full-json")return new window.Blob([z],{type:"application/json;charset=utf-8"});var n=y(window.atob(z));return new window.Blob([n],{type:"image/"+P})},et.octetStream=function(z){document.location.href="data:application/octet-stream"+z};function y(z){for(var P=z.length,n=new ArrayBuffer(P),i=new Uint8Array(n),a=0;a{var f=Br();jn();var y=Js(),z=Hn();k0();var P=/"/g,n="TOBESTRIPPED",i=new RegExp('("'+n+")|("+n+'")',"g");function a(o){var c=f.select("body").append("div").style({display:"none"}).html(""),s=o.replace(/(&[^;]*;)/gi,function(h){return h==="<"?"<":h==="&rt;"?">":h.indexOf("<")!==-1||h.indexOf(">")!==-1?"":c.html(h).text()});return c.remove(),s}function l(o){return o.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}Y.exports=function(o,c,s){var h=o._fullLayout,m=h._paper,b=h._toppaper,x=h.width,_=h.height,A;m.insert("rect",":first-child").call(y.setRect,0,0,x,_).call(z.fill,h.paper_bgcolor);var d=h._basePlotModules||[];for(A=0;A{var f=jn(),y=Wg().EventEmitter,z=K0();function P(n){var i=n.emitter||new y,a=new Promise(function(l,o){var c=window.Image,s=n.svg,h=n.format||"png",m=n.canvas,b=n.scale||1,x=n.width||300,_=n.height||150,A=b*x,d=b*_,k=m.getContext("2d",{willReadFrequently:!0}),w=new c,D,E;h==="svg"||f.isSafari()?E=z.encodeSVG(s):(D=z.createBlob(s,"svg"),E=z.createObjectURL(D)),m.width=A,m.height=d,w.onload=function(){var I;switch(D=null,z.revokeObjectURL(E),h!=="svg"&&k.drawImage(w,0,0,A,d),h){case"jpeg":I=m.toDataURL("image/jpeg");break;case"png":I=m.toDataURL("image/png");break;case"webp":I=m.toDataURL("image/webp");break;case"svg":I=E;break;default:var M="Image format is not jpeg, png, svg or webp.";if(o(new Error(M)),!n.promise)return i.emit("error",M)}l(I),n.promise||i.emit("success",I)},w.onerror=function(I){if(D=null,z.revokeObjectURL(E),o(I),!n.promise)return i.emit("error",I)},w.src=E});return n.promise?a:i}Y.exports=P}),F4=It((et,Y)=>{var f=Sr(),y=Aw(),z=lh(),P=jn(),n=K0(),i=hb(),a=db(),l=Dn().version,o={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function c(s,h){h=h||{};var m,b,x,_;P.isPlainObject(s)?(m=s.data||[],b=s.layout||{},x=s.config||{},_={}):(s=P.getGraphDiv(s),m=P.extendDeep([],s.data),b=P.extendDeep({},s.layout),x=s._context,_=s._fullLayout||{});function A(W){return!(W in h)||P.validate(h[W],o[W])}if(!A("width")&&h.width!==null||!A("height")&&h.height!==null)throw new Error("Height and width should be pixel values.");if(!A("format"))throw new Error("Export format is not "+P.join2(o.format.values,", "," or ")+".");var d={};function k(W,F){return P.coerce(h,d,o,W,F)}var w=k("format"),D=k("width"),E=k("height"),I=k("scale"),M=k("setBackground"),p=k("imageDataOnly"),g=document.createElement("div");g.style.position="absolute",g.style.left="-5000px",document.body.appendChild(g);var C=P.extendFlat({},b);D?C.width=D:h.width===null&&f(_.width)&&(C.width=_.width),E?C.height=E:h.height===null&&f(_.height)&&(C.height=_.height);var S=P.extendFlat({},x,{_exportedPlot:!0,staticPlot:!0,setBackground:M}),N=n.getRedrawFunc(g);function B(){return new Promise(function(W){setTimeout(W,n.getDelay(g._fullLayout))})}function U(){return new Promise(function(W,F){var H=i(g,w,I),q=g._fullLayout.width,G=g._fullLayout.height;function tt(){y.purge(g),document.body.removeChild(g)}if(w==="full-json"){var ht=z.graphJson(g,!1,"keepdata","object",!0,!0);return ht.version=l,ht=JSON.stringify(ht),tt(),W(p?ht:n.encodeJSON(ht))}if(tt(),w==="svg")return W(p?H:n.encodeSVG(H));var bt=document.createElement("canvas");bt.id=P.randstr(),a({format:w,width:q,height:G,scale:I,canvas:bt,svg:H,promise:!0}).then(W).catch(F)})}function V(W){return p?W.replace(n.IMAGE_URL_PREFIX,""):W}return new Promise(function(W,F){y.newPlot(g,m,C,S).then(N).then(B).then(U).then(function(H){W(V(H))}).catch(function(H){F(H)})})}Y.exports=c}),Lg=It((et,Y)=>{var f=jn(),y=lh(),z=Gg(),P=Mo().dfltConfig,n=f.isPlainObject,i=Array.isArray,a=f.isArrayOrTypedArray;Y.exports=function(d,k){d===void 0&&(d=[]),k===void 0&&(k={});var w=z.get(),D=[],E={_context:f.extendFlat({},P)},I,M;i(d)?(E.data=f.extendDeep([],d),I=d):(E.data=[],I=[],D.push(h("array","data"))),n(k)?(E.layout=f.extendDeep({},k),M=k):(E.layout={},M={},arguments.length>1&&D.push(h("object","layout"))),y.supplyDefaults(E);for(var p=E._fullData,g=I.length,C=0;CN.length&&D.push(h("unused",E,C.concat(N.length)));var H=N.length,q=Array.isArray(F);q&&(H=Math.min(H,F.length));var G,tt,ht,bt,vt;if(B.dimensions===2)for(tt=0;ttN[tt].length&&D.push(h("unused",E,C.concat(tt,N[tt].length)));var ut=N[tt].length;for(G=0;G<(q?Math.min(ut,F[tt].length):ut);G++)ht=q?F[tt][G]:F,bt=S[tt][G],vt=N[tt][G],f.validate(bt,ht)?vt!==bt&&vt!==+bt&&D.push(h("dynamic",E,C.concat(tt,G),bt,vt)):D.push(h("value",E,C.concat(tt,G),bt))}else D.push(h("array",E,C.concat(tt),S[tt]));else for(tt=0;tt{var f=jn(),y=K0();function z(P,n,i){var a=document.createElement("a"),l="download"in a,o=new Promise(function(c,s){var h,m;if(l)return h=y.createBlob(P,i),m=y.createObjectURL(h),a.href=m,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a),y.revokeObjectURL(m),h=null,c(n);if(f.isSafari()){var b=i==="svg"?",":";base64,";return y.octetStream(b+encodeURIComponent(P)),c(n)}s(new Error("download error"))});return o}Y.exports=z}),Mw=It((et,Y)=>{var f=jn(),y=F4(),z=N4();K0();function P(n,i){var a;return f.isPlainObject(n)||(a=f.getGraphDiv(n)),i=i||{},i.format=i.format||"png",i.width=i.width||null,i.height=i.height||null,i.imageDataOnly=!0,new Promise(function(l,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var c=y(n,i),s=i.filename||n.fn||"newplot";s+="."+i.format.replace("-","."),c.then(function(h){return a&&(a._snapshotInProgress=!1),z(h,s,i.format)}).then(function(h){l(h)}).catch(function(h){a&&(a._snapshotInProgress=!1),o(h)})})}Y.exports=P}),D_=It(et=>{var Y=jn(),f=Y.isPlainObject,y=Gg(),z=lh(),P=xa(),n=Tc(),i=Mo().dfltConfig;et.makeTemplate=function(x){x=Y.isPlainObject(x)?x:Y.getGraphDiv(x),x=Y.extendDeep({_context:i},{data:x.data,layout:x.layout}),z.supplyDefaults(x);var _=x.data||[],A=x.layout||{};A._basePlotModules=x._fullLayout._basePlotModules,A._modules=x._fullLayout._modules;var d={data:{},layout:{}};_.forEach(function(S){var N={};o(S,N,s.bind(null,S));var B=Y.coerce(S,{},P,"type"),U=d.data[B];U||(U=d.data[B]=[]),U.push(N)}),o(A,d.layout,c.bind(null,A)),delete d.layout.template;var k=A.template;if(f(k)){var w=k.layout,D,E,I,M,p,g;f(w)&&a(w,d.layout);var C=k.data;if(f(C)){for(E in d.data)if(I=C[E],Array.isArray(I)){for(p=d.data[E],g=p.length,M=I.length,D=0;DV?D.push({code:"unused",traceType:S,templateCount:U,dataCount:V}):V>U&&D.push({code:"reused",traceType:S,templateCount:U,dataCount:V})}}function W(F,H){for(var q in F)if(q.charAt(0)!=="_"){var G=F[q],tt=h(F,q,H);f(G)?(Array.isArray(F)&&G._template===!1&&G.templateitemname&&D.push({code:"missing",path:tt,templateitemname:G.templateitemname}),W(G,tt)):Array.isArray(G)&&m(G)&&W(G,tt)}}if(W({data:I,layout:E},""),D.length)return D.map(b)};function m(x){for(var _=0;_{var Y=Aw();et._doPlot=Y._doPlot,et.newPlot=Y.newPlot,et.restyle=Y.restyle,et.relayout=Y.relayout,et.redraw=Y.redraw,et.update=Y.update,et._guiRestyle=Y._guiRestyle,et._guiRelayout=Y._guiRelayout,et._guiUpdate=Y._guiUpdate,et._storeDirectGUIEdit=Y._storeDirectGUIEdit,et.react=Y.react,et.extendTraces=Y.extendTraces,et.prependTraces=Y.prependTraces,et.addTraces=Y.addTraces,et.deleteTraces=Y.deleteTraces,et.moveTraces=Y.moveTraces,et.purge=Y.purge,et.addFrames=Y.addFrames,et.deleteFrames=Y.deleteFrames,et.animate=Y.animate,et.setPlotConfig=Y.setPlotConfig;var f=W0().getGraphDiv,y=xw().eraseActiveShape;et.deleteActiveShape=function(P){return y(f(P))},et.toImage=F4(),et.validate=Lg(),et.downloadImage=Mw();var z=D_();et.makeTemplate=z.makeTemplate,et.validateTemplate=z.validateTemplate}),Xg=It((et,Y)=>{var f=jn(),y=ls();Y.exports=function(z,P,n,i){var a=i("x"),l=i("y"),o,c=y.getComponentMethod("calendars","handleTraceDefaults");if(c(z,P,["x","y"],n),a){var s=f.minRowLength(a);l?o=Math.min(s,f.minRowLength(l)):(o=s,i("y0"),i("dy"))}else{if(!l)return 0;o=f.minRowLength(l),i("x0"),i("dx")}return P._length=o,o}}),S0=It((et,Y)=>{var f=jn().dateTick0,y=Dr(),z=y.ONEWEEK;function P(n,i){return n%z===0?f(i,1):f(i,0)}Y.exports=function(n,i,a,l,o){if(o||(o={x:!0,y:!0}),o.x){var c=l("xperiod");c&&(l("xperiod0",P(c,i.xcalendar)),l("xperiodalignment"))}if(o.y){var s=l("yperiod");s&&(l("yperiod0",P(s,i.ycalendar)),l("yperiodalignment"))}}}),j4=It((et,Y)=>{var f=["orientation","groupnorm","stackgaps"];Y.exports=function(y,z,P,n){var i=P._scatterStackOpts,a=n("stackgroup");if(a){var l=z.xaxis+z.yaxis,o=i[l];o||(o=i[l]={});var c=o[a],s=!1;c?c.traces.push(z):(c=o[a]={traceIndices:[],traces:[z]},s=!0);for(var h={orientation:z.x&&!z.y?"h":"v"},m=0;m{var f=Hn(),y=fp().hasColorscale,z=Cu(),P=Fu();Y.exports=function(n,i,a,l,o,c){var s=P.isBubble(n),h=(n.line||{}).color,m;if(c=c||{},h&&(a=h),o("marker.symbol"),o("marker.opacity",s?.7:1),o("marker.size"),c.noAngle||(o("marker.angle"),c.noAngleRef||o("marker.angleref"),c.noStandOff||o("marker.standoff")),o("marker.color",a),y(n,"marker")&&z(n,i,l,o,{prefix:"marker.",cLetter:"c"}),c.noSelect||(o("selected.marker.color"),o("unselected.marker.color"),o("selected.marker.size"),o("unselected.marker.size")),c.noLine||(h&&!Array.isArray(h)&&i.marker.color!==h?m=h:s?m=f.background:m=f.defaultLine,o("marker.line.color",m),y(n,"marker.line")&&z(n,i,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width",s?1:0)),s&&(o("marker.sizeref"),o("marker.sizemin"),o("marker.sizemode")),c.gradient){var b=o("marker.gradient.type");b!=="none"&&o("marker.gradient.color")}}}),Lm=It((et,Y)=>{var f=jn().isArrayOrTypedArray,y=fp().hasColorscale,z=Cu();Y.exports=function(P,n,i,a,l,o){o||(o={});var c=(P.marker||{}).color;if(c&&c._inputArray&&(c=c._inputArray),l("line.color",i),y(P,"line"))z(P,n,a,l,{prefix:"line.",cLetter:"c"});else{var s=(f(c)?!1:c)||i;l("line.color",s)}l("line.width"),o.noDash||l("line.dash"),o.backoff&&l("line.backoff")}}),oy=It((et,Y)=>{Y.exports=function(f,y,z){var P=z("line.shape");P==="spline"&&z("line.smoothing")}}),pm=It((et,Y)=>{var f=jn();Y.exports=function(y,z,P,n,i){i=i||{},n("textposition"),f.coerceFont(n,"textfont",i.font||P.font,i),i.noSelect||(n("selected.textfont.color"),n("unselected.textfont.color"))}}),Pm=It((et,Y)=>{var f=Hn(),y=jn().isArrayOrTypedArray;function z(P){for(var n=f.interpolate(P[0][1],P[1][1],.5),i=2;i{var f=jn(),y=ls(),z=dd(),P=Eg(),n=Fu(),i=Xg(),a=S0(),l=j4(),o=Y0(),c=Lm(),s=oy(),h=pm(),m=Pm(),b=jn().coercePattern;Y.exports=function(x,_,A,d){function k(C,S){return f.coerce(x,_,z,C,S)}var w=i(x,_,d,k);if(w||(_.visible=!1),!!_.visible){a(x,_,d,k),k("xhoverformat"),k("yhoverformat"),k("zorder");var D=l(x,_,d,k);d.scattermode==="group"&&_.orientation===void 0&&k("orientation","v");var E=!D&&w{var f=iy().getAxisGroup;Y.exports=function(y,z,P,n,i){var a=z.orientation,l=z[{v:"x",h:"y"}[a]+"axis"],o=f(P,l)+a,c=P._alignmentOpts||{},s=n("alignmentgroup"),h=c[o];h||(h=c[o]={});var m=h[s];m?m.traces.push(z):m=h[s]={traces:[z],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var b=n("offsetgroup")||"",x=m.offsetGroups,_=x[b];z._offsetIndex=0,(i!=="group"||b)&&(_||(_=x[b]={offsetIndex:Object.keys(x).length}),z._offsetIndex=_.offsetIndex)}}),$4=It((et,Y)=>{var f=jn(),y=Xv(),z=dd();Y.exports=function(P,n){var i,a,l,o=n.scattermode;function c(x){return f.coerce(a._input,a,z,x)}if(n.scattermode==="group")for(l=0;l=0;m--){var b=P[m];if(b.type==="scatter"&&b.xaxis===s.xaxis&&b.yaxis===s.yaxis){b.opacity=void 0;break}}}}}}),H4=It((et,Y)=>{var f=jn(),y=Nv();Y.exports=function(z,P){function n(a,l){return f.coerce(z,P,y,a,l)}var i=P.barmode==="group";P.scattermode==="group"&&n("scattergap",i?P.bargap:.2)}}),Im=It((et,Y)=>{var f=Sr(),y=jn(),z=y.dateTime2ms,P=y.incrementMonth,n=Dr(),i=n.ONEAVGMONTH;Y.exports=function(a,l,o,c){if(l.type!=="date")return{vals:c};var s=a[o+"periodalignment"];if(!s)return{vals:c};var h=a[o+"period"],m;if(f(h)){if(h=+h,h<=0)return{vals:c}}else if(typeof h=="string"&&h.charAt(0)==="M"){var b=+h.substring(1);if(b>0&&Math.round(b)===b)m=b;else return{vals:c}}for(var x=l.calendar,_=s==="start",A=s==="end",d=a[o+"period0"],k=z(d,x)||0,w=[],D=[],E=[],I=c.length,M=0;Mp;)S=P(S,-m,x);for(;S<=p;)S=P(S,m,x);C=P(S,-m,x)}else{for(g=Math.round((p-k)/h),S=k+g*h;S>p;)S-=h;for(;S<=p;)S+=h;C=S-h}w[M]=_?C:A?S:(C+S)/2,D[M]=C,E[M]=S}return{vals:w,starts:D,ends:E}}}),Dm=It((et,Y)=>{var f=fp().hasColorscale,y=Cp(),z=Fu();Y.exports=function(P,n){z.hasLines(n)&&f(n,"line")&&y(P,n,{vals:n.line.color,containerStr:"line",cLetter:"c"}),z.hasMarkers(n)&&(f(n,"marker")&&y(P,n,{vals:n.marker.color,containerStr:"marker",cLetter:"c"}),f(n,"marker.line")&&y(P,n,{vals:n.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),ft=It((et,Y)=>{var f=jn();Y.exports=function(y,z){for(var P=0;P{var f=jn();Y.exports=function(y,z){f.isArrayOrTypedArray(z.selectedpoints)&&f.tagSelected(y,z)}}),_e=It((et,Y)=>{var f=Sr(),y=jn(),z=Fs(),P=Im(),n=Dr().BADNUM,i=Fu(),a=Dm(),l=ft(),o=$t();function c(_,A){var d=_._fullLayout,k=A._xA=z.getFromId(_,A.xaxis||"x","x"),w=A._yA=z.getFromId(_,A.yaxis||"y","y"),D=k.makeCalcdata(A,"x"),E=w.makeCalcdata(A,"y"),I=P(A,k,"x",D),M=P(A,w,"y",E),p=I.vals,g=M.vals,C=A._length,S=new Array(C),N=A.ids,B=x(A,d,k,w),U=!1,V,W,F,H,q,G;m(d,A);var tt="x",ht="y",bt;if(B)y.pushUnique(B.traceIndices,A.index),V=B.orientation==="v",V?(ht="s",bt="x"):(tt="s",bt="y"),q=B.stackgaps==="interpolate";else{var vt=h(A,C);s(_,A,k,w,p,g,vt)}var ut=!!A.xperiodalignment,rt=!!A.yperiodalignment;for(W=0;WW&&S[H].gap;)H--;for(G=S[H].s,F=S.length-1;F>H;F--)S[F].s=G;for(;W{Y.exports=y;var f=jn().distinctVals;function y(z,P){this.traces=z,this.sepNegVal=P.sepNegVal,this.overlapNoMerge=P.overlapNoMerge;for(var n=1/0,i=P.posAxis._id.charAt(0),a=[],l=0;l{var f=Sr(),y=jn().isArrayOrTypedArray,z=Dr().BADNUM,P=ls(),n=Fs(),i=iy().getAxisGroup,a=ir();function l(S,N){for(var B=N.xaxis,U=N.yaxis,V=S._fullLayout,W=S._fullData,F=S.calcdata,H=[],q=[],G=0;Gq+F||!f(H))}for(var tt=0;tt{var f=_e(),y=Wr().setGroupPositions;function z(i,a){for(var l=a.xaxis,o=a.yaxis,c=i._fullLayout,s=i._fullData,h=i.calcdata,m=[],b=[],x=0;xB[x]&&x{var f=Js(),y=Dr(),z=y.BADNUM,P=y.LOG_CLIP,n=P+.5,i=P-.5,a=jn(),l=a.segmentsIntersect,o=a.constrain,c=Eg();Y.exports=function(s,h){var m=h.trace||{},b=h.xaxis,x=h.yaxis,_=b.type==="log",A=x.type==="log",d=b._length,k=x._length,w=h.backoff,D=m.marker,E=h.connectGaps,I=h.baseTolerance,M=h.shape,p=M==="linear",g=m.fill&&m.fill!=="none",C=[],S=c.minTolerance,N=s.length,B=new Array(N),U=0,V,W,F,H,q,G,tt,ht,bt,vt,ut,rt,gt,it,st,xt;function ot(Me){var qe=s[Me];if(!qe)return!1;var Ye=h.linearized?b.l2p(qe.x):b.c2p(qe.x),ur=h.linearized?x.l2p(qe.y):x.c2p(qe.y);if(Ye===z){if(_&&(Ye=b.c2p(qe.x,!0)),Ye===z)return!1;A&&ur===z&&(Ye*=Math.abs(b._m*k*(b._m>0?n:i)/(x._m*d*(x._m>0?n:i)))),Ye*=1e3}if(ur===z){if(A&&(ur=x.c2p(qe.y,!0)),ur===z)return!1;ur*=1e3}return[Ye,ur]}function J(Me,qe,Ye,ur){var Rr=Ye-Me,zr=ur-qe,xr=.5-Me,pn=.5-qe,ci=Rr*Rr+zr*zr,ui=Rr*xr+zr*pn;if(ui>0&&ui1||Math.abs(xr.y-Ye[0][1])>1)&&(xr=[xr.x,xr.y],ur&&Rt(xr,Me)Gt||Me[1]xe)return[o(Me[0],Zt,Gt),o(Me[1],ee,xe)]}function Le(Me,qe){if(Me[0]===qe[0]&&(Me[0]===Zt||Me[0]===Gt)||Me[1]===qe[1]&&(Me[1]===ee||Me[1]===xe))return!0}function Ze(Me,qe){var Ye=[],ur=ce(Me),Rr=ce(qe);return ur&&Rr&&Le(ur,Rr)||(ur&&Ye.push(ur),Rr&&Ye.push(Rr)),Ye}function Qe(Me,qe,Ye){return function(ur,Rr){var zr=ce(ur),xr=ce(Rr),pn=[];if(zr&&xr&&Le(zr,xr))return pn;zr&&pn.push(zr),xr&&pn.push(xr);var ci=2*a.constrain((ur[Me]+Rr[Me])/2,qe,Ye)-((zr||ur)[Me]+(xr||Rr)[Me]);if(ci){var ui;zr&&xr?ui=ci>0==zr[Me]>xr[Me]?zr:xr:ui=zr||xr,ui[Me]+=ci}return pn}}var mr;M==="linear"||M==="spline"?mr=be:M==="hv"||M==="vh"?mr=Ze:M==="hvh"?mr=Qe(0,Zt,Gt):M==="vhv"&&(mr=Qe(1,ee,xe));function fr(Me,qe){var Ye=qe[0]-Me[0],ur=(qe[1]-Me[1])/Ye,Rr=(Me[1]*qe[0]-qe[1]*Me[0])/Ye;return Rr>0?[ur>0?Zt:Gt,xe]:[ur>0?Gt:Zt,ee]}function Jr(Me){var qe=Me[0],Ye=Me[1],ur=qe===B[U-1][0],Rr=Ye===B[U-1][1];if(!(ur&&Rr))if(U>1){var zr=qe===B[U-2][0],xr=Ye===B[U-2][1];ur&&(qe===Zt||qe===Gt)&&zr?xr?U--:B[U-1]=Me:Rr&&(Ye===ee||Ye===xe)&&xr?zr?U--:B[U-1]=Me:B[U++]=Me}else B[U++]=Me}function an(Me){B[U-1][0]!==Me[0]&&B[U-1][1]!==Me[1]&&Jr([Mt,Ot]),Jr(Me),Lt=null,Mt=Ot=0}var Er=a.isArrayOrTypedArray(D);function dn(Me){if(Me&&w&&(Me.i=V,Me.d=s,Me.trace=m,Me.marker=Er?D[Me.i]:D,Me.backoff=w),mt=Me[0]/d,dt=Me[1]/k,ye=Me[0]Gt?Gt:0,ue=Me[1]xe?xe:0,ye||ue){if(!U)B[U++]=[ye||Me[0],ue||Me[1]];else if(Lt){var qe=mr(Lt,Me);qe.length>1&&(an(qe[0]),B[U++]=qe[1])}else ie=mr(B[U-1],Me)[0],B[U++]=ie;var Ye=B[U-1];ye&&ue&&(Ye[0]!==ye||Ye[1]!==ue)?(Lt&&(Mt!==ye&&Ot!==ue?Jr(Mt&&Ot?fr(Lt,Me):[Mt||ye,Ot||ue]):Mt&&Ot&&Jr([Mt,Ot])),Jr([ye,ue])):Mt-ye&&Ot-ue&&Jr([ye||Mt,ue||Ot]),Lt=Me,Mt=ye,Ot=ue}else Lt&&an(mr(Lt,Me)[0]),B[U++]=Me}for(V=0;VCt(G,_n))break;F=G,gt=bt[0]*ht[0]+bt[1]*ht[1],gt>ut?(ut=gt,H=G,tt=!1):gt=s.length||!G)break;dn(G),W=G}}Lt&&Jr([Mt||Lt[0],Ot||Lt[1]]),C.push(B.slice(0,U))}var Oe=M.slice(M.length-1);if(w&&Oe!=="h"&&Oe!=="v"){for(var Xt=!1,oe=-1,zt=[],_t=0;_t{var f={tonextx:1,tonexty:1,tonext:1};Y.exports=function(y,z,P){var n,i,a,l,o,c={},s=!1,h=-1,m=0,b=-1;for(i=0;i=0?o=b:(o=b=m,m++),o{var f=Br(),y=ls(),z=jn(),P=z.ensureSingle,n=z.identity,i=Js(),a=Fu(),l=na(),o=eo(),c=Ag().tester;Y.exports=function(b,x,_,A,d,k){var w,D,E=!d,I=!!d&&d.duration>0,M=o(b,x,_);if(w=A.selectAll("g.trace").data(M,function(g){return g[0].trace.uid}),w.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),w.order(),s(b,w,x),I){k&&(D=k());var p=f.transition().duration(d.duration).ease(d.easing).each("end",function(){D&&D()}).each("interrupt",function(){D&&D()});p.each(function(){A.selectAll("g.trace").each(function(g,C){h(b,C,x,g,M,this,d)})})}else w.each(function(g,C){h(b,C,x,g,M,this,d)});E&&w.exit().remove(),A.selectAll("path:not([d])").remove()};function s(b,x,_){x.each(function(A){var d=P(f.select(this),"g","fills");i.setClipUrl(d,_.layerClipId,b);var k=A[0].trace,w=[];k._ownfill&&w.push("_ownFill"),k._nexttrace&&w.push("_nextFill");var D=d.selectAll("g").data(w,n);D.enter().append("g"),D.exit().each(function(E){k[E]=null}).remove(),D.order().each(function(E){k[E]=P(f.select(this),"path","js-fill")})})}function h(b,x,_,A,d,k,w){var D=b._context.staticPlot,E;m(b,x,_,A,d);var I=!!w&&w.duration>0;function M(an){return I?an.transition():an}var p=_.xaxis,g=_.yaxis,C=A[0].trace,S=C.line,N=f.select(k),B=P(N,"g","errorbars"),U=P(N,"g","lines"),V=P(N,"g","points"),W=P(N,"g","text");if(y.getComponentMethod("errorbars","plot")(b,B,_,w),C.visible!==!0)return;M(N).style("opacity",C.opacity);var F,H,q=C.fill.charAt(C.fill.length-1);q!=="x"&&q!=="y"&&(q="");var G,tt;q==="y"?(G=1,tt=g.c2p(0,!0)):q==="x"&&(G=0,tt=p.c2p(0,!0)),A[0][_.isRangePlot?"nodeRangePlot3":"node3"]=N;var ht="",bt=[],vt=C._prevtrace,ut=null,rt=null;vt&&(ht=vt._prevRevpath||"",H=vt._nextFill,bt=vt._ownPolygons,ut=vt._fillsegments,rt=vt._fillElement);var gt,it,st="",xt="",ot,J,mt,dt,Ct,Rt,Bt=[];C._polygons=[];var Zt=[],Gt=[],ee=z.noop;if(F=C._ownFill,a.hasLines(C)||C.fill!=="none"){H&&H.datum(A),["hv","vh","hvh","vhv"].indexOf(S.shape)!==-1?(ot=i.steps(S.shape),J=i.steps(S.shape.split("").reverse().join(""))):S.shape==="spline"?ot=J=function(an){var Er=an[an.length-1];return an.length>1&&an[0][0]===Er[0]&&an[0][1]===Er[1]?i.smoothclosed(an.slice(1),S.smoothing):i.smoothopen(an,S.smoothing)}:ot=J=function(an){return"M"+an.join("L")},mt=function(an){return J(an.reverse())},Gt=l(A,{xaxis:p,yaxis:g,trace:C,connectGaps:C.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,shape:S.shape,backoff:S.backoff,simplify:S.simplify,fill:C.fill}),Zt=new Array(Gt.length);var xe=0;for(E=0;E=D[0]&&N.x<=D[1]&&N.y>=E[0]&&N.y<=E[1]}),g=Math.ceil(p.length/M),C=0;d.forEach(function(N,B){var U=N[0].trace;a.hasMarkers(U)&&U.marker.maxdisplayed>0&&B{Y.exports={container:"marker",min:"cmin",max:"cmax"}}),tl=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i={_fullLayout:P},a=f.getFromTrace(i,z,"x"),l=f.getFromTrace(i,z,"y"),o=y.orig_x;o===void 0&&(o=y.x);var c=y.orig_y;return c===void 0&&(c=y.y),n.xLabel=f.tickText(a,a.c2l(o),!0).text,n.yLabel=f.tickText(l,l.c2l(c),!0).text,n}}),Il=It((et,Y)=>{var f=Br(),y=Js(),z=ls();function P(l){var o=f.select(l).selectAll("g.trace.scatter");o.style("opacity",function(c){return c[0].trace.opacity}),o.selectAll("g.points").each(function(c){var s=f.select(this),h=c.trace||c[0].trace;n(s,h,l)}),o.selectAll("g.text").each(function(c){var s=f.select(this),h=c.trace||c[0].trace;i(s,h,l)}),o.selectAll("g.trace path.js-line").call(y.lineGroupStyle),o.selectAll("g.trace path.js-fill").call(y.fillGroupStyle,l,!1),z.getComponentMethod("errorbars","style")(o)}function n(l,o,c){y.pointStyle(l.selectAll("path.point"),o,c)}function i(l,o,c){y.textPointStyle(l.selectAll("text"),o,c)}function a(l,o,c){var s=o[0].trace;s.selectedpoints?(y.selectedPointStyle(c.selectAll("path.point"),s),y.selectedTextStyle(c.selectAll("text"),s)):(n(c,s,l),i(c,s,l))}Y.exports={style:P,stylePoints:n,styleText:i,styleOnSelect:a}}),qc=It((et,Y)=>{var f=Hn(),y=Fu();Y.exports=function(z,P){var n,i;if(z.mode==="lines")return n=z.line.color,n&&f.opacity(n)?n:z.fillcolor;if(z.mode==="none")return z.fill?z.fillcolor:"";var a=P.mcc||(z.marker||{}).color,l=P.mlcc||((z.marker||{}).line||{}).color;return i=a&&f.opacity(a)?a:l&&f.opacity(l)&&(P.mlw||((z.marker||{}).line||{}).width)?l:"",i?f.opacity(i)<.3?f.addOpacity(i,.3):i:(n=(z.line||{}).color,n&&f.opacity(n)&&y.hasLines(z)&&z.line.width?n:z.fillcolor)}}),Kf=It((et,Y)=>{var f=jn(),y=hd(),z=ls(),P=qc(),n=Hn(),i=f.fillText;Y.exports=function(a,l,o,c){var s=a.cd,h=s[0].trace,m=a.xa,b=a.ya,x=m.c2p(l),_=b.c2p(o),A=[x,_],d=h.hoveron||"",k=h.mode.indexOf("markers")!==-1?3:.5,w=!!h.xperiodalignment,D=!!h.yperiodalignment;if(d.indexOf("points")!==-1){var E=function(ht){if(w){var bt=m.c2p(ht.xStart),vt=m.c2p(ht.xEnd);return x>=Math.min(bt,vt)&&x<=Math.max(bt,vt)?0:1/0}var ut=Math.max(3,ht.mrc||0),rt=1-1/ut,gt=Math.abs(m.c2p(ht.x)-x);return gt=Math.min(bt,vt)&&_<=Math.max(bt,vt)?0:1/0}var ut=Math.max(3,ht.mrc||0),rt=1-1/ut,gt=Math.abs(b.c2p(ht.y)-_);return gtst!=Bt>=st&&(dt=J[ot-1][0],Ct=J[ot][0],Bt-Rt&&(mt=dt+(Ct-dt)*(st-Rt)/(Bt-Rt),ut=Math.min(ut,mt),rt=Math.max(rt,mt)));return ut=Math.max(ut,0),rt=Math.min(rt,m._length),{x0:ut,x1:rt,y0:st,y1:st}}if(d.indexOf("fills")!==-1&&h._fillElement){var q=F(h._fillElement)&&!F(h._fillExclusionElement);if(q){var G=H(h._polygons);G===null&&(G={x0:A[0],x1:A[0],y0:A[1],y1:A[1]});var tt=n.defaultLine;return n.opacity(h.fillcolor)?tt=h.fillcolor:n.opacity((h.line||{}).color)&&(tt=h.line.color),f.extendFlat(a,{distance:a.maxHoverDistance,x0:G.x0,x1:G.x1,y0:G.y0,y1:G.y1,color:tt,hovertemplate:!1}),delete a.index,h.text&&!f.isArrayOrTypedArray(h.text)?a.text=String(h.text):a.text=h.name,[a]}}}}),Qd=It((et,Y)=>{var f=Fu();Y.exports=function(y,z){var P=y.cd,n=y.xaxis,i=y.yaxis,a=[],l=P[0].trace,o,c,s,h,m=!f.hasMarkers(l)&&!f.hasText(l);if(m)return[];if(z===!1)for(o=0;o{Y.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),c0=It((et,Y)=>{var f=ls().traceIs,y=ty();Y.exports=function(a,l,o,c){o("autotypenumbers",c.autotypenumbersDflt);var s=o("type",(c.splomStash||{}).type);s==="-"&&(z(l,c.data),l.type==="-"?l.type="linear":a.type=l.type)};function z(a,l){if(a.type==="-"){var o=a._id,c=o.charAt(0),s;o.indexOf("scene")!==-1&&(o=c);var h=P(l,o,c);if(h){if(h.type==="histogram"&&c==={v:"y",h:"x"}[h.orientation||"v"]){a.type="linear";return}var m=c+"calendar",b=h[m],x={noMultiCategory:!f(h,"cartesian")||f(h,"noMultiCategory")};if(h.type==="box"&&h._hasPreCompStats&&c==={h:"x",v:"y"}[h.orientation||"v"]&&(x.noMultiCategory=!0),x.autotypenumbers=a.autotypenumbers,i(h,c)){var _=n(h),A=[];for(s=0;s0&&(s["_"+o+"axes"]||{})[l]||(s[o+"axis"]||o)===l&&(i(s,o)||(s[o]||[]).length||s[o+"0"]))return s}}function n(a){return{v:"x",h:"y"}[a.orientation||"v"]}function i(a,l){var o=n(a),c=f(a,"box-violin"),s=f(a._fullInput||{},"candlestick");return c&&!s&&l===o&&a[o]===void 0&&a[o+"0"]===void 0}}),Jg=It((et,Y)=>{var f=Xn().isTypedArraySpec;function y(z,P){var n=P.dataAttr||z._id.charAt(0),i={},a,l,o;if(P.axData)a=P.axData;else for(a=[],l=0;l0||f(a),o;l&&(o="array");var c=n("categoryorder",o),s;c==="array"&&(s=n("categoryarray")),!l&&c==="array"&&(c=P.categoryorder="trace"),c==="trace"?P._initialCategories=[]:c==="array"?P._initialCategories=s.slice():(s=y(P,i).sort(),c==="category ascending"?P._initialCategories=s:c==="category descending"&&(P._initialCategories=s.reverse()))}}}),fb=It((et,Y)=>{var f=Xi().mix,y=Sn(),z=jn();Y.exports=function(P,n,i,a){a=a||{};var l=a.dfltColor;function o(g,C){return z.coerce2(P,n,a.attributes,g,C)}var c=o("linecolor",l),s=o("linewidth"),h=i("showline",a.showLine||!!c||!!s);h||(delete n.linecolor,delete n.linewidth);var m=f(l,a.bgColor,a.blend||y.lightFraction).toRgbString(),b=o("gridcolor",m),x=o("gridwidth"),_=o("griddash"),A=i("showgrid",a.showGrid||!!b||!!x||!!_);if(A||(delete n.gridcolor,delete n.gridwidth,delete n.griddash),a.hasMinor){var d=f(n.gridcolor,a.bgColor,67).toRgbString(),k=o("minor.gridcolor",d),w=o("minor.gridwidth",n.gridwidth||1),D=o("minor.griddash",n.griddash||"solid"),E=i("minor.showgrid",!!k||!!w||!!D);E||(delete n.minor.gridcolor,delete n.minor.gridwidth,delete n.minor.griddash)}if(!a.noZeroLine){o("zerolinelayer");var I=o("zerolinecolor",l),M=o("zerolinewidth"),p=i("zeroline",a.showGrid||!!I||!!M);p||(delete n.zerolinelayer,delete n.zerolinecolor,delete n.zerolinewidth)}}}),pb=It((et,Y)=>{var f=Sr(),y=ls(),z=jn(),P=Tc(),n=Zf(),i=Gf(),a=jv(),l=Uv(),o=q0(),c=Sg(),s=Jg(),h=fb(),m=hw(),b=G0(),x=fu().WEEKDAY_PATTERN,_=fu().HOUR_PATTERN;Y.exports=function(w,D,E,I,M){var p=I.letter,g=I.font||{},C=I.splomStash||{},S=E("visible",!I.visibleDflt),N=D._template||{},B=D.type||N.type||"-",U;if(B==="date"){var V=y.getComponentMethod("calendars","handleDefaults");V(w,D,"calendar",I.calendar),I.noTicklabelmode||(U=E("ticklabelmode"))}!I.noTicklabelindex&&(B==="date"||B==="linear")&&E("ticklabelindex");var W="";(!I.noTicklabelposition||B==="multicategory")&&(W=z.coerce(w,D,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:U==="period"?["outside","inside"]:p==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),I.noTicklabeloverflow||E("ticklabeloverflow",W.indexOf("inside")!==-1?"hide past domain":B==="category"||B==="multicategory"?"allow":"hide past div"),b(D,M),m(w,D,E,I),s(w,D,E,I),I.noHover||(B!=="category"&&E("hoverformat"),I.noUnifiedhovertitle||E("unifiedhovertitle.text"));var F=E("color"),H=F!==i.color.dflt?F:g.color,q=C.label||M._dfltTitle[p];if(c(w,D,E,B,I),!S)return D;E("title.text",q),z.coerceFont(E,"title.font",g,{overrideDflt:{size:z.bigFont(g.size),color:H}}),a(w,D,E,B);var G=I.hasMinor;if(G&&(P.newContainer(D,"minor"),a(w,D,E,B,{isMinor:!0})),o(w,D,E,B,I),l(w,D,E,I),G){var tt=I.isMinor;I.isMinor=!0,l(w,D,E,I),I.isMinor=tt}h(w,D,E,{dfltColor:F,bgColor:I.bgColor,showGrid:I.showGrid,hasMinor:G,attributes:i}),G&&!D.minor.ticks&&!D.minor.showgrid&&delete D.minor,(D.showline||D.ticks)&&E("mirror");var ht=B==="multicategory";if(!I.noTickson&&(B==="category"||ht)&&(D.ticks||D.showgrid)&&(ht?(E("tickson","boundaries"),delete D.ticklabelposition):E("tickson")),ht){var bt=E("showdividers");bt&&(E("dividercolor"),E("dividerwidth"))}if(B==="date")if(n(w,D,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:A}),!D.rangebreaks.length)delete D.rangebreaks;else{for(var vt=0;vt=2){var g="",C,S;if(p.length===2){for(C=0;C<2;C++)if(S=k(p[C]),S){g=x;break}}var N=I("pattern",g);if(N===x)for(C=0;C<2;C++)S=k(p[C]),S&&(D.bounds[C]=p[C]=S-1);if(N)for(C=0;C<2;C++)switch(S=p[C],N){case x:if(!f(S)){D.enabled=!1;return}if(S=+S,S!==Math.floor(S)||S<0||S>=7){D.enabled=!1;return}D.bounds[C]=p[C]=S;break;case _:if(!f(S)){D.enabled=!1;return}if(S=+S,S<0||S>24){D.enabled=!1;return}D.bounds[C]=p[C]=S;break}if(E.autorange===!1){var B=E.range;if(B[0]B[1]){D.enabled=!1;return}}else if(p[0]>B[0]&&p[1]{var f=Sr(),y=jn();Y.exports=function(z,P,n,i){var a=i.counterAxes||[],l=i.overlayableAxes||[],o=i.letter,c=i.grid,s=i.overlayingDomain,h,m,b,x,_,A;c&&(m=c._domains[o][c._axisMap[P._id]],h=c._anchors[P._id],m&&(b=c[o+"side"].split(" ")[0],x=c.domain[o][b==="right"||b==="top"?1:0])),m=m||[0,1],h=h||(f(z.position)?"free":a[0]||"free"),b=b||(o==="x"?"bottom":"left"),x=x||0,_=0,A=!1;var d=y.coerce(z,P,{anchor:{valType:"enumerated",values:["free"].concat(a),dflt:h}},"anchor"),k=y.coerce(z,P,{side:{valType:"enumerated",values:o==="x"?["bottom","top"]:["left","right"],dflt:b}},"side");if(d==="free"){if(o==="y"){var w=n("autoshift");w&&(x=k==="left"?s[0]:s[1],A=P.automargin?P.automargin:!0,_=k==="left"?-3:3),n("shift",_)}n("position",x)}n("automargin",A);var D=!1;if(l.length&&(D=y.coerce(z,P,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!D){var E=n("domain",m);E[0]>E[1]-1/4096&&(P.domain=m),y.noneOrAll(z.domain,P.domain,m),P.tickmode==="sync"&&(P.tickmode="auto")}return n("layer"),P}}),V4=It((et,Y)=>{var f=jn(),y=Hn(),z=T0().isUnifiedHover,P=ey(),n=Tc(),i=k_(),a=Gf(),l=c0(),o=pb(),c=iy(),s=Ew(),h=Ku(),m=h.id2name,b=h.name2id,x=fu().AX_ID_PATTERN,_=ls(),A=_.traceIs,d=_.getComponentMethod;function k(w,D,E){Array.isArray(w[D])?w[D].push(E):w[D]=[E]}Y.exports=function(w,D,E){var I=D.autotypenumbers,M={},p={},g={},C={},S={},N={},B={},U={},V={},W={},F,H;for(F=0;F{var f=Br(),y=ls(),z=jn(),P=Js(),n=Fs();Y.exports=function(i,a,l,o){var c=i._fullLayout;if(a.length===0){n.redrawComponents(i);return}function s(D){var E=D.xaxis,I=D.yaxis;c._defs.select("#"+D.clipId+"> rect").call(P.setTranslate,0,0).call(P.setScale,1,1),D.plot.call(P.setTranslate,E._offset,I._offset).call(P.setScale,1,1);var M=D.plot.selectAll(".scatterlayer .trace");M.selectAll(".point").call(P.setPointGroupScale,1,1),M.selectAll(".textpoint").call(P.setTextPointsScale,1,1),M.call(P.hideOutsideRangePoints,D)}function h(D,E){var I=D.plotinfo,M=I.xaxis,p=I.yaxis,g=M._length,C=p._length,S=!!D.xr1,N=!!D.yr1,B=[];if(S){var U=z.simpleMap(D.xr0,M.r2l),V=z.simpleMap(D.xr1,M.r2l),W=U[1]-U[0],F=V[1]-V[0];B[0]=(U[0]*(1-E)+E*V[0]-U[0])/(U[1]-U[0])*g,B[2]=g*(1-E+E*F/W),M.range[0]=M.l2r(U[0]*(1-E)+E*V[0]),M.range[1]=M.l2r(U[1]*(1-E)+E*V[1])}else B[0]=0,B[2]=g;if(N){var H=z.simpleMap(D.yr0,p.r2l),q=z.simpleMap(D.yr1,p.r2l),G=H[1]-H[0],tt=q[1]-q[0];B[1]=(H[1]*(1-E)+E*q[1]-H[1])/(H[0]-H[1])*C,B[3]=C*(1-E+E*tt/G),p.range[0]=M.l2r(H[0]*(1-E)+E*q[0]),p.range[1]=p.l2r(H[1]*(1-E)+E*q[1])}else B[1]=0,B[3]=C;n.drawOne(i,M,{skipTitle:!0}),n.drawOne(i,p,{skipTitle:!0}),n.redrawComponents(i,[M._id,p._id]);var ht=S?g/B[2]:1,bt=N?C/B[3]:1,vt=S?B[0]:0,ut=N?B[1]:0,rt=S?B[0]/B[2]*g:0,gt=N?B[1]/B[3]*C:0,it=M._offset-rt,st=p._offset-gt;I.clipRect.call(P.setTranslate,vt,ut).call(P.setScale,1/ht,1/bt),I.plot.call(P.setTranslate,it,st).call(P.setScale,ht,bt),P.setPointGroupScale(I.zoomScalePts,1/ht,1/bt),P.setTextPointsScale(I.zoomScaleTxt,1/ht,1/bt)}var m;o&&(m=o());function b(){for(var D={},E=0;El.duration?(b(),d=window.cancelAnimationFrame(w)):d=window.requestAnimationFrame(w)}return _=Date.now(),d=window.requestAnimationFrame(w),Promise.resolve()}}),Fd=It(et=>{var Y=Br(),f=ls(),y=jn(),z=lh(),P=Js(),n=Mf().getModuleCalcData,i=Ku(),a=fu(),l=k0(),o=y.ensureSingle;function c(A,d,k){return y.ensureSingle(A,d,k,function(w){w.datum(k)})}var s=a.zindexSeparator;et.name="cartesian",et.attr=["xaxis","yaxis"],et.idRoot=["x","y"],et.idRegex=a.idRegex,et.attrRegex=a.attrRegex,et.attributes=mm(),et.layoutAttributes=Gf(),et.supplyLayoutDefaults=V4(),et.transitionAxes=C8(),et.finalizeSubplots=function(A,d){var k=d._subplots,w=k.xaxis,D=k.yaxis,E=k.cartesian,I=E,M={},p={},g,C,S;for(g=0;g0){var B=N.id;if(B.indexOf(s)!==-1)continue;B+=s+(g+1),N=y.extendFlat({},N,{id:B,plot:D._cartesianlayer.selectAll(".subplot").select("."+B)})}for(var U=[],V,W=0;W1&&(tt+=s+G),q.push(M+tt),I=0;I1,S=d.mainplotinfo;if(!d.mainplot||C)if(g)d.xlines=o(w,"path","xlines-above"),d.ylines=o(w,"path","ylines-above"),d.xaxislayer=o(w,"g","xaxislayer-above"),d.yaxislayer=o(w,"g","yaxislayer-above");else{if(!I){var N=o(w,"g","layer-subplot");d.shapelayer=o(N,"g","shapelayer"),d.imagelayer=o(N,"g","imagelayer"),S&&C?(d.minorGridlayer=S.minorGridlayer,d.gridlayer=S.gridlayer,d.zerolinelayer=S.zerolinelayer):(d.minorGridlayer=o(w,"g","minor-gridlayer"),d.gridlayer=o(w,"g","gridlayer"),d.zerolinelayer=o(w,"g","zerolinelayer"));var B=o(w,"g","layer-between");d.shapelayerBetween=o(B,"g","shapelayer"),d.imagelayerBetween=o(B,"g","imagelayer"),o(w,"path","xlines-below"),o(w,"path","ylines-below"),d.overlinesBelow=o(w,"g","overlines-below"),o(w,"g","xaxislayer-below"),o(w,"g","yaxislayer-below"),d.overaxesBelow=o(w,"g","overaxes-below")}d.overplot=o(w,"g","overplot"),d.plot=o(d.overplot,"g",D),S&&C?d.zerolinelayerAbove=S.zerolinelayerAbove:d.zerolinelayerAbove=o(w,"g","zerolinelayer-above"),I||(d.xlines=o(w,"path","xlines-above"),d.ylines=o(w,"path","ylines-above"),d.overlinesAbove=o(w,"g","overlines-above"),o(w,"g","xaxislayer-above"),o(w,"g","yaxislayer-above"),d.overaxesAbove=o(w,"g","overaxes-above"),d.xlines=w.select(".xlines-"+M),d.ylines=w.select(".ylines-"+p),d.xaxislayer=w.select(".xaxislayer-"+M),d.yaxislayer=w.select(".yaxislayer-"+p))}else{var U=S.plotgroup,V=D+"-x",W=D+"-y";d.minorGridlayer=S.minorGridlayer,d.gridlayer=S.gridlayer,d.zerolinelayer=S.zerolinelayer,d.zerolinelayerAbove=S.zerolinelayerAbove,o(S.overlinesBelow,"path",V),o(S.overlinesBelow,"path",W),o(S.overaxesBelow,"g",V),o(S.overaxesBelow,"g",W),d.plot=o(S.overplot,"g",D),o(S.overlinesAbove,"path",V),o(S.overlinesAbove,"path",W),o(S.overaxesAbove,"g",V),o(S.overaxesAbove,"g",W),d.xlines=U.select(".overlines-"+M).select("."+V),d.ylines=U.select(".overlines-"+p).select("."+W),d.xaxislayer=U.select(".overaxes-"+M).select("."+V),d.yaxislayer=U.select(".overaxes-"+p).select("."+W)}I||(g||(c(d.minorGridlayer,"g",d.xaxis._id),c(d.minorGridlayer,"g",d.yaxis._id),d.minorGridlayer.selectAll("g").map(function(F){return F[0]}).sort(i.idSort),c(d.gridlayer,"g",d.xaxis._id),c(d.gridlayer,"g",d.yaxis._id),d.gridlayer.selectAll("g").map(function(F){return F[0]}).sort(i.idSort)),d.xlines.style("fill","none").classed("crisp",!0),d.ylines.style("fill","none").classed("crisp",!0))}function x(A,d){if(A){var k={};A.each(function(p){var g=p[0],C=Y.select(this);C.remove(),_(g,d),k[g]=!0});for(var w in d._plots)for(var D=d._plots[w],E=D.overlays||[],I=0;I{var f=Fu();Y.exports={hasLines:f.hasLines,hasMarkers:f.hasMarkers,hasText:f.hasText,isBubble:f.isBubble,attributes:dd(),layoutAttributes:Nv(),supplyDefaults:U4(),crossTraceDefaults:$4(),supplyLayoutDefaults:H4(),calc:_e().calc,crossTraceCalc:$n(),arraysToCalcdata:ft(),plot:fo(),colorbar:Do(),formatLabels:tl(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:Kf(),selectPoints:Qd(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Fd(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),mb=It((et,Y)=>{var f=Br(),y=Hn(),z=Sw(),P=jn(),n=P.strScale,i=P.strRotate,a=P.strTranslate;Y.exports=function(l,o,c){var s=l.node(),h=z[c.arrowhead||0],m=z[c.startarrowhead||0],b=(c.arrowwidth||1)*(c.arrowsize||1),x=(c.arrowwidth||1)*(c.startarrowsize||1),_=o.indexOf("start")>=0,A=o.indexOf("end")>=0,d=h.backoff*b+c.standoff,k=m.backoff*x+c.startstandoff,w,D,E,I;if(s.nodeName==="line"){w={x:+l.attr("x1"),y:+l.attr("y1")},D={x:+l.attr("x2"),y:+l.attr("y2")};var M=w.x-D.x,p=w.y-D.y;if(E=Math.atan2(p,M),I=E+Math.PI,d&&k&&d+k>Math.sqrt(M*M+p*p)){G();return}if(d){if(d*d>M*M+p*p){G();return}var g=d*Math.cos(E),C=d*Math.sin(E);D.x+=g,D.y+=C,l.attr({x2:D.x,y2:D.y})}if(k){if(k*k>M*M+p*p){G();return}var S=k*Math.cos(E),N=k*Math.sin(E);w.x-=S,w.y-=N,l.attr({x1:w.x,y1:w.y})}}else if(s.nodeName==="path"){var B=s.getTotalLength(),U="";if(B{var f=Br(),y=ls(),z=lh(),P=jn(),n=P.strTranslate,i=Fs(),a=Hn(),l=Js(),o=hd(),c=uu(),s=Mm(),h=Up(),m=Tc().arrayEditor,b=mb();Y.exports={draw:x,drawOne:_,drawRaw:d};function x(k){var w=k._fullLayout;w._infolayer.selectAll(".annotation").remove();for(var D=0;D2/3?fi="right":fi="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[fi]}for(var be=!1,ce=["x","y"],Le=0;Le1)&&(mr===Qe?(he=fr.r2fraction(w["a"+Ze]),(he<0||he>1)&&(be=!0)):be=!0),oe=fr._offset+fr.r2p(w[Ze]),Pt=.5}else{var Me=ae==="domain";Ze==="x"?(_t=w[Ze],oe=Me?fr._offset+fr._length*_t:oe=g.l+g.w*_t):(_t=1-w[Ze],oe=Me?fr._offset+fr._length*_t:oe=g.t+g.h*_t),Pt=w.showarrow?.5:_t}if(w.showarrow){Xt.head=oe;var qe=w["a"+Ze];if(Ht=an*ie(.5,w.xanchor)-Er*ie(.5,w.yanchor),mr===Qe){var Ye=i.getRefType(mr);Ye==="domain"?(Ze==="y"&&(qe=1-qe),Xt.tail=fr._offset+fr._length*qe):Ye==="paper"?Ze==="y"?(qe=1-qe,Xt.tail=g.t+g.h*qe):Xt.tail=g.l+g.w*qe:Xt.tail=fr._offset+fr.r2p(qe),zt=Ht}else Xt.tail=oe+qe,zt=Ht+qe;Xt.text=Xt.tail+Ht;var ur=p[Ze==="x"?"width":"height"];if(Qe==="paper"&&(Xt.head=P.constrain(Xt.head,1,ur-1)),mr==="pixel"){var Rr=-Math.max(Xt.tail-3,Xt.text),zr=Math.min(Xt.tail+3,Xt.text)-ur;Rr>0?(Xt.tail+=Rr,Xt.text+=Rr):zr>0&&(Xt.tail-=zr,Xt.text-=zr)}Xt.tail+=Oe,Xt.head+=Oe}else Ht=dn*ie(Pt,_n),zt=Ht,Xt.text=oe+Ht;Xt.text+=Oe,Ht+=Oe,zt+=Oe,w["_"+Ze+"padplus"]=dn/2+zt,w["_"+Ze+"padminus"]=dn/2-zt,w["_"+Ze+"size"]=dn,w["_"+Ze+"shift"]=Ht}if(be){ut.remove();return}var xr=0,pn=0;if(w.align!=="left"&&(xr=(ue-ge)*(w.align==="center"?.5:1)),w.valign!=="top"&&(pn=(Mt-ye)*(w.valign==="middle"?.5:1)),ee)Gt.select("svg").attr({x:it+xr-1,y:it+pn}).call(l.setClipUrl,xt?F:null,k);else{var ci=it+pn-xe.top,ui=it+xr-xe.left;dt.call(c.positionText,ui,ci).call(l.setClipUrl,xt?F:null,k)}ot.select("rect").call(l.setRect,it,it,ue,Mt),st.call(l.setRect,rt/2,rt/2,Ot-rt,Lt-rt),ut.call(l.setTranslate,Math.round(H.x.text-Ot/2),Math.round(H.y.text-Lt/2)),tt.attr({transform:"rotate("+q+","+H.x.text+","+H.y.text+")"});var yi=function(Ci,fi){G.selectAll(".annotation-arrow-g").remove();var ba=H.x.head,oa=H.y.head,Ke=H.x.tail+Ci,sr=H.y.tail+fi,vr=H.x.text+Ci,Ar=H.y.text+fi,mn=P.rotationXYMatrix(q,vr,Ar),Zn=P.apply2DTransform(mn),Un=P.apply2DTransform2(mn),Wn=+st.attr("width"),Li=+st.attr("height"),Fi=vr-.5*Wn,Zi=Fi+Wn,Ji=Ar-.5*Li,ca=Ji+Li,Ei=[[Fi,Ji,Fi,ca],[Fi,ca,Zi,ca],[Zi,ca,Zi,Ji],[Zi,Ji,Fi,Ji]].map(Un);if(!Ei.reduce(function(ze,yr){return ze^!!P.segmentsIntersect(ba,oa,ba+1e6,oa+1e6,yr[0],yr[1],yr[2],yr[3])},!1)){Ei.forEach(function(ze){var yr=P.segmentsIntersect(Ke,sr,ba,oa,ze[0],ze[1],ze[2],ze[3]);yr&&(Ke=yr.x,sr=yr.y)});var Ga=w.arrowwidth,so=w.arrowcolor,Fe=w.arrowside,Re=G.append("g").style({opacity:a.opacity(so)}).classed("annotation-arrow-g",!0),Kr=Re.append("path").attr("d","M"+Ke+","+sr+"L"+ba+","+oa).style("stroke-width",Ga+"px").call(a.stroke,a.rgb(so));if(b(Kr,Fe,w),C.annotationPosition&&Kr.node().parentNode&&!E){var sn=ba,cn=oa;if(w.standoff){var Yr=Math.sqrt(Math.pow(ba-Ke,2)+Math.pow(oa-sr,2));sn+=w.standoff*(Ke-ba)/Yr,cn+=w.standoff*(sr-oa)/Yr}var un=Re.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Ke-sn)+","+(sr-cn),transform:n(sn,cn)}).style("stroke-width",Ga+6+"px").call(a.stroke,"rgba(0,0,0,0)").call(a.fill,"rgba(0,0,0,0)"),Pn,bn;h.init({element:un.node(),gd:k,prepFn:function(){var ze=l.getTranslate(ut);Pn=ze.x,bn=ze.y,I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0)},moveFn:function(ze,yr){var en=Zn(Pn,bn),Rn=en[0]+ze,ni=en[1]+yr;ut.call(l.setTranslate,Rn,ni),V("x",A(I,ze,"x",g,w)),V("y",A(M,yr,"y",g,w)),w.axref===w.xref&&V("ax",A(I,ze,"ax",g,w)),w.ayref===w.yref&&V("ay",A(M,yr,"ay",g,w)),Re.attr("transform",n(ze,yr)),tt.attr({transform:"rotate("+q+","+Rn+","+ni+")"})},doneFn:function(){y.call("_guiRelayout",k,W());var ze=document.querySelector(".js-notes-box-panel");ze&&ze.redraw(ze.selectedObj)}})}}};if(w.showarrow&&yi(0,0),ht){var Gi;h.init({element:ut.node(),gd:k,prepFn:function(){Gi=tt.attr("transform")},moveFn:function(Ci,fi){var ba="pointer";if(w.showarrow)w.axref===w.xref?V("ax",A(I,Ci,"ax",g,w)):V("ax",w.ax+Ci),w.ayref===w.yref?V("ay",A(M,fi,"ay",g.w,w)):V("ay",w.ay+fi),yi(Ci,fi);else{if(E)return;var oa,Ke;if(I)oa=A(I,Ci,"x",g,w);else{var sr=w._xsize/g.w,vr=w.x+(w._xshift-w.xshift)/g.w-sr/2;oa=h.align(vr+Ci/g.w,sr,0,1,w.xanchor)}if(M)Ke=A(M,fi,"y",g,w);else{var Ar=w._ysize/g.h,mn=w.y-(w._yshift+w.yshift)/g.h-Ar/2;Ke=h.align(mn-fi/g.h,Ar,0,1,w.yanchor)}V("x",oa),V("y",Ke),(!I||!M)&&(ba=h.getCursor(I?.5:oa,M?.5:Ke,w.xanchor,w.yanchor))}tt.attr({transform:n(Ci,fi)+Gi}),s(ut,ba)},clickFn:function(Ci,fi){w.captureevents&&k.emit("plotly_clickannotation",vt(fi))},doneFn:function(){s(ut),y.call("_guiRelayout",k,W());var Ci=document.querySelector(".js-notes-box-panel");Ci&&Ci.redraw(Ci.selectedObj)}})}}C.annotationText?dt.call(c.makeEditable,{delegate:ut,gd:k}).call(Ct).on("edit",function(Bt){w.text=Bt,this.call(Ct),V("text",Bt),I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0),y.call("_guiRelayout",k,W())}):dt.call(Ct)}}),A8=It((et,Y)=>{var f=jn(),y=ls(),z=Tc().arrayEditor;Y.exports={hasClickToShow:P,onClick:n};function P(l,o){var c=i(l,o);return c.on.length>0||c.explicitOff.length>0}function n(l,o){var c=i(l,o),s=c.on,h=c.off.concat(c.explicitOff),m={},b=l._fullLayout.annotations,x,_;if(s.length||h.length){for(x=0;x{var f=jn(),y=Hn();Y.exports=function(z,P,n,i){i("opacity");var a=i("bgcolor"),l=i("bordercolor"),o=y.opacity(l);i("borderpad");var c=i("borderwidth"),s=i("showarrow");i("text",s?" ":n._dfltTitle.annotation),i("textangle"),f.coerceFont(i,"font",n.font),i("width"),i("align");var h=i("height");if(h&&i("valign"),s){var m=i("arrowside"),b,x;m.indexOf("end")!==-1&&(b=i("arrowhead"),x=i("arrowsize")),m.indexOf("start")!==-1&&(i("startarrowhead",b),i("startarrowsize",x)),i("arrowcolor",o?P.bordercolor:y.defaultLine),i("arrowwidth",(o&&c||1)*2),i("standoff"),i("startstandoff")}var _=i("hovertext"),A=n.hoverlabel||{};if(_){var d=i("hoverlabel.bgcolor",A.bgcolor||(y.opacity(a)?y.rgb(a):y.defaultLine)),k=i("hoverlabel.bordercolor",A.bordercolor||y.contrast(d)),w=f.extendFlat({},A.font);w.color||(w.color=k),f.coerceFont(i,"hoverlabel.font",w)}i("captureevents",!!_)}}),Pw=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=W4(),n=Mg();Y.exports=function(a,l){z(a,l,{name:"annotations",handleItemDefaults:i})};function i(a,l,o){function c(g,C){return f.coerce(a,l,n,g,C)}var s=c("visible"),h=c("clicktoshow");if(s||h){P(a,l,o,c);for(var m=l.showarrow,b=["x","y"],x=[-10,-30],_={_fullLayout:o},A=0;A<2;A++){var d=b[A],k=y.coerceRef(a,l,_,d,"","paper");if(k!=="paper"){var w=y.getFromId(_,k);w._annIndices.push(l._index)}if(y.coercePosition(l,_,c,k,d,.5),m){var D="a"+d,E=y.coerceRef(a,l,_,D,"pixel",["pixel","paper"]);E!=="pixel"&&E!==k&&(E=l[D]="pixel");var I=E==="pixel"?x[A]:.4;y.coercePosition(l,_,c,E,D,I)}c(d+"anchor"),c(d+"shift")}if(f.noneOrAll(a,l,["x","y"]),m&&f.noneOrAll(a,l,["ax","ay"]),h){var M=c("xclick"),p=c("yclick");l._xclick=M===void 0?l.x:y.cleanPosition(M,_,l.xref),l._yclick=p===void 0?l.y:y.cleanPosition(p,_,l.yref)}}}}),q4=It((et,Y)=>{var f=jn(),y=Fs(),z=Lw().draw;Y.exports=function(i){var a=i._fullLayout,l=f.filterVisible(a.annotations);if(l.length&&i._fullData.length)return f.syncOrAsync([z,P],i)};function P(i){var a=i._fullLayout;f.filterVisible(a.annotations).forEach(function(l){var o=y.getFromId(i,l.xref),c=y.getFromId(i,l.yref),s=y.getRefType(l.xref),h=y.getRefType(l.yref);l._extremes={},s==="range"&&n(l,o),h==="range"&&n(l,c)})}function n(i,a){var l=a._id,o=l.charAt(0),c=i[o],s=i["a"+o],h=i[o+"ref"],m=i["a"+o+"ref"],b=i["_"+o+"padplus"],x=i["_"+o+"padminus"],_={x:1,y:-1}[o]*i[o+"shift"],A=3*i.arrowsize*i.arrowwidth||0,d=A+_,k=A-_,w=3*i.startarrowsize*i.arrowwidth||0,D=w+_,E=w-_,I;if(m===h){var M=y.findExtremes(a,[a.r2c(c)],{ppadplus:d,ppadminus:k}),p=y.findExtremes(a,[a.r2c(s)],{ppadplus:Math.max(b,D),ppadminus:Math.max(x,E)});I={min:[M.min[0],p.min[0]],max:[M.max[0],p.max[0]]}}else D=s?D+s:D,E=s?E-s:E,I=y.findExtremes(a,[a.r2c(c)],{ppadplus:Math.max(b,d,D),ppadminus:Math.max(x,k,E)});i._extremes[l]=I}}),M8=It((et,Y)=>{var f=Sr(),y=_a();Y.exports=function(z,P,n,i){P=P||{};var a=n==="log"&&P.type==="linear",l=n==="linear"&&P.type==="log";if(!(a||l))return;var o=z._fullLayout.annotations,c=P._id.charAt(0),s,h;function m(x){var _=s[x],A=null;a?A=y(_,P.range):A=Math.pow(10,_),f(A)||(A=null),i(h+x,A)}for(var b=0;b{var f=Lw(),y=A8();Y.exports={moduleType:"component",name:"annotations",layoutAttributes:Mg(),supplyLayoutDefaults:Pw(),includeBasePlot:Yv()("annotations"),calcAutorange:q4(),draw:f.draw,drawOne:f.drawOne,drawRaw:f.drawRaw,hasClickToShow:y.hasClickToShow,onClick:y.onClick,convertCoords:M8()}}),E8=It((et,Y)=>{var f=Mg(),y=sh().overrideAll,z=Tc().templatedArray;Y.exports=y(z("annotation",{visible:f.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:f.xanchor,xshift:f.xshift,yanchor:f.yanchor,yshift:f.yshift,text:f.text,textangle:f.textangle,font:f.font,width:f.width,height:f.height,opacity:f.opacity,align:f.align,valign:f.valign,bgcolor:f.bgcolor,bordercolor:f.bordercolor,borderpad:f.borderpad,borderwidth:f.borderwidth,showarrow:f.showarrow,arrowcolor:f.arrowcolor,arrowhead:f.arrowhead,startarrowhead:f.startarrowhead,arrowside:f.arrowside,arrowsize:f.arrowsize,startarrowsize:f.startarrowsize,arrowwidth:f.arrowwidth,standoff:f.standoff,startstandoff:f.startstandoff,hovertext:f.hovertext,hoverlabel:f.hoverlabel,captureevents:f.captureevents}),"calc","from-root")}),WW=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=W4(),n=E8();Y.exports=function(a,l,o){z(a,l,{name:"annotations",handleItemDefaults:i,fullLayout:o.fullLayout})};function i(a,l,o,c){function s(b,x){return f.coerce(a,l,n,b,x)}function h(b){var x=b+"axis",_={_fullLayout:{}};return _._fullLayout[x]=o[x],y.coercePosition(l,_,s,b,b,.5)}var m=s("visible");m&&(P(a,l,c.fullLayout,s),h("x"),h("y"),h("z"),f.noneOrAll(a,l,["x","y","z"]),l.xref="x",l.yref="y",l.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),l.showarrow&&(l.axref="pixel",l.ayref="pixel",s("ax",-10),s("ay",-30),f.noneOrAll(a,l,["ax","ay"])))}}),qW=It((et,Y)=>{var f=jn(),y=Fs();Y.exports=function(P){for(var n=P.fullSceneLayout,i=n.annotations,a=0;a{function f(z,P){var n=[0,0,0,0],i,a;for(i=0;i<4;++i)for(a=0;a<4;++a)n[a]+=z[4*i+a]*P[i];return n}function y(z,P){var n=f(z.projection,f(z.view,f(z.model,[P[0],P[1],P[2],1])));return n}Y.exports=y}),GW=It((et,Y)=>{var f=Lw().drawRaw,y=DL(),z=["x","y","z"];Y.exports=function(P){for(var n=P.fullSceneLayout,i=P.dataScale,a=n.annotations,l=0;l1){c=!0;break}}c?P.fullLayout._infolayer.select(".annotation-"+P.id+'[data-index="'+l+'"]').remove():(o._pdata=y(P.glplot.cameraParams,[n.xaxis.r2l(o.x)*i[0],n.yaxis.r2l(o.y)*i[1],n.zaxis.r2l(o.z)*i[2]]),f(P.graphDiv,o,l,P.id,o._xa,o._ya))}}}),ZW=It((et,Y)=>{var f=ls(),y=jn();Y.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:E8()}}},layoutAttributes:E8(),handleDefaults:WW(),includeBasePlot:z,convert:qW(),draw:GW()};function z(P,n){var i=f.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,l=Object.keys(P),o=0;o{var f=Mg(),y=hi(),z=dd().line,P=qf().dash,n=Yn().extendFlat,i=Tc().templatedArray;ub();var a=xa(),{shapeTexttemplateAttrs:l,templatefallbackAttrs:o}=nu(),c=w_();Y.exports=i("shape",{visible:n({},a.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:n({},a.legend,{editType:"calc+arraydraw"}),legendgroup:n({},a.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:n({},a.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:y({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:n({},a.legendrank,{editType:"calc+arraydraw"}),legendwidth:n({},a.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:n({},f.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:n({},f.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:n({},z.color,{editType:"arraydraw"}),width:n({},z.width,{editType:"calc+arraydraw"}),dash:n({},P,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:l({},{keys:Object.keys(c)}),texttemplatefallback:o({editType:"arraydraw"}),font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),KW=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=zL(),n=l0();Y.exports=function(l,o){z(l,o,{name:"shapes",handleItemDefaults:a})};function i(l,o){return l?"bottom":o.indexOf("top")!==-1?"top":o.indexOf("bottom")!==-1?"bottom":"middle"}function a(l,o,c){function s(rt,gt){return f.coerce(l,o,P,rt,gt)}o._isShape=!0;var h=s("visible");if(h){var m=s("showlegend");m&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),f.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var b=s("path"),x=b?"path":"rect",_=s("type",x),A=_!=="path";A&&delete o.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule");var d=s("line.width");d&&(s("line.color"),s("line.dash"));for(var k=s("xsizemode"),w=s("ysizemode"),D=["x","y"],E=0;E<2;E++){var I=D[E],M=I+"anchor",p=I==="x"?k:w,g={_fullLayout:c},C,S,N,B=y.coerceRef(l,o,g,I,void 0,"paper"),U=y.getRefType(B);if(U==="range"?(C=y.getFromId(g,B),C._shapeIndices.push(o._index),N=n.rangeToShapePosition(C),S=n.shapePositionToRange(C),(C.type==="category"||C.type==="multicategory")&&(s(I+"0shift"),s(I+"1shift"))):S=N=f.identity,A){var V=.25,W=.75,F=I+"0",H=I+"1",q=l[F],G=l[H];l[F]=S(l[F],!0),l[H]=S(l[H],!0),p==="pixel"?(s(F,0),s(H,10)):(y.coercePosition(o,g,s,B,F,V),y.coercePosition(o,g,s,B,H,W)),o[F]=N(o[F]),o[H]=N(o[H]),l[F]=q,l[H]=G}if(p==="pixel"){var tt=l[M];l[M]=S(l[M],!0),y.coercePosition(o,g,s,B,M,.25),o[M]=N(o[M]),l[M]=tt}}A&&f.noneOrAll(l,o,["x0","x1","y0","y1"]);var ht=_==="line",bt,vt;if(A&&(bt=s("label.texttemplate"),s("label.texttemplatefallback")),bt||(vt=s("label.text")),vt||bt){s("label.textangle");var ut=s("label.textposition",ht?"middle":"middle center");s("label.xanchor"),s("label.yanchor",i(ht,ut)),s("label.padding"),f.coerceFont(s,"label.font",c.font)}}}}),YW=It((et,Y)=>{var f=Hn(),y=jn();function z(P,n){return P?"bottom":n.indexOf("top")!==-1?"top":n.indexOf("bottom")!==-1?"bottom":"middle"}Y.exports=function(P,n,i){i("newshape.visible"),i("newshape.name"),i("newshape.showlegend"),i("newshape.legend"),i("newshape.legendwidth"),i("newshape.legendgroup"),i("newshape.legendgrouptitle.text"),y.coerceFont(i,"newshape.legendgrouptitle.font"),i("newshape.legendrank"),i("newshape.drawdirection"),i("newshape.layer"),i("newshape.fillcolor"),i("newshape.fillrule"),i("newshape.opacity");var a=i("newshape.line.width");if(a){var l=(P||{}).plot_bgcolor||"#FFF";i("newshape.line.color",f.contrast(l)),i("newshape.line.dash")}var o=P.dragmode==="drawline",c=i("newshape.label.text"),s=i("newshape.label.texttemplate");if(i("newshape.label.texttemplatefallback"),c||s){i("newshape.label.textangle");var h=i("newshape.label.textposition",o?"middle":"middle center");i("newshape.label.xanchor"),i("newshape.label.yanchor",z(o,h)),i("newshape.label.padding"),y.coerceFont(i,"newshape.label.font",n.font)}i("activeshape.fillcolor"),i("activeshape.opacity")}}),XW=It((et,Y)=>{var f=jn(),y=Fs(),z=nb(),P=l0();Y.exports=function(o){var c=o._fullLayout,s=f.filterVisible(c.shapes);if(!(!s.length||!o._fullData.length))for(var h=0;h0?d+x:x;return{ppad:x,ppadplus:_?w:D,ppadminus:_?D:w}}else return{ppad:x}}function l(o,c,s){var h=o._id.charAt(0)==="x"?"x":"y",m=o.type==="category"||o.type==="multicategory",b,x,_=0,A=0,d=m?o.r2c:o.d2c,k=c[h+"sizemode"]==="scaled";if(k?(b=c[h+"0"],x=c[h+"1"],m&&(_=c[h+"0shift"],A=c[h+"1shift"])):(b=c[h+"anchor"],x=c[h+"anchor"]),b!==void 0)return[d(b)+_,d(x)+A];if(c.path){var w=1/0,D=-1/0,E=c.path.match(z.segmentRE),I,M,p,g,C;for(o.type==="date"&&(d=P.decodeDate(d)),I=0;ID&&(D=C)));if(D>=w)return[w,D]}}}),JW=It((et,Y)=>{var f=xw();Y.exports={moduleType:"component",name:"shapes",layoutAttributes:zL(),supplyLayoutDefaults:KW(),supplyDrawNewShapeDefaults:YW(),includeBasePlot:Yv()("shapes"),calcAutorange:XW(),draw:f.draw,drawOne:f.drawOne}}),OL=It((et,Y)=>{var f=fu(),y=Tc().templatedArray;ub(),Y.exports=y("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",f.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",f.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),QW=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=OL(),n="images";Y.exports=function(a,l){var o={name:n,handleItemDefaults:i};z(a,l,o)};function i(a,l,o){function c(k,w){return f.coerce(a,l,P,k,w)}var s=c("source"),h=c("visible",!!s);if(!h)return l;c("layer"),c("xanchor"),c("yanchor"),c("sizex"),c("sizey"),c("sizing"),c("opacity");for(var m={_fullLayout:o},b=["x","y"],x=0;x<2;x++){var _=b[x],A=y.coerceRef(a,l,m,_,"paper",void 0);if(A!=="paper"){var d=y.getFromId(m,A);d._imgIndices.push(l._index)}y.coercePosition(l,m,c,A,_,0)}return l}}),tq=It((et,Y)=>{var f=Br(),y=Js(),z=Fs(),P=Ku(),n=k0();Y.exports=function(i){var a=i._fullLayout,l=[],o={},c=[],s,h;for(h=0;h{var f=Sr(),y=_a();Y.exports=function(z,P,n,i){P=P||{};var a=n==="log"&&P.type==="linear",l=n==="linear"&&P.type==="log";if(a||l){for(var o=z._fullLayout.images,c=P._id.charAt(0),s,h,m=0;m{Y.exports={moduleType:"component",name:"images",layoutAttributes:OL(),supplyLayoutDefaults:QW(),includeBasePlot:Yv()("images"),draw:tq(),convertCoords:eq()}}),L8=It((et,Y)=>{Y.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}}),BL=It((et,Y)=>{var f=hi(),y=Sn(),z=Yn().extendFlat,P=sh().overrideAll,n=Xx(),i=Tc().templatedArray,a=i("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});Y.exports=P(i("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:a,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:z(n({editType:"arraydraw"}),{}),font:f({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:y.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),nq=It((et,Y)=>{var f=jn(),y=Zf(),z=BL(),P=L8(),n=P.name,i=z.buttons;Y.exports=function(o,c){var s={name:n,handleItemDefaults:a};y(o,c,s)};function a(o,c,s){function h(x,_){return f.coerce(o,c,z,x,_)}var m=y(o,c,{name:"buttons",handleItemDefaults:l}),b=h("visible",m.length>0);b&&(h("active"),h("direction"),h("type"),h("showactive"),h("x"),h("y"),f.noneOrAll(o,c,["x","y"]),h("xanchor"),h("yanchor"),h("pad.t"),h("pad.r"),h("pad.b"),h("pad.l"),f.coerceFont(h,"font",s.font),h("bgcolor",s.paper_bgcolor),h("bordercolor"),h("borderwidth"))}function l(o,c){function s(m,b){return f.coerce(o,c,i,m,b)}var h=s("visible",o.method==="skip"||Array.isArray(o.args));h&&(s("method"),s("args"),s("args2"),s("label"),s("execute"))}}),iq=It((et,Y)=>{Y.exports=n;var f=Br(),y=Hn(),z=Js(),P=jn();function n(i,a,l){this.gd=i,this.container=a,this.id=l,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(i,a,l){var o=this.gd._fullLayout,c=o.width,s=o.height;this.position=i;var h=this.position.l,m=this.position.w,b=this.position.t,x=this.position.h,_=this.position.direction,A=_==="down",d=_==="left",k=_==="right",w=_==="up",D=m,E=x,I,M,p,g;!A&&!d&&!k&&!w&&(this.position.direction="down",A=!0);var C=A||w;C?(I=h,M=I+D,A?(p=b,g=Math.min(p+E,s),E=g-p):(g=b+E,p=Math.max(g-E,0),E=g-p)):(p=b,g=p+E,d?(M=h+D,I=Math.max(M-D,0),D=M-I):(I=h,M=Math.min(I+D,c),D=M-I)),this._box={l:I,t:p,w:D,h:E};var S=m>D,N=n.barLength+2*n.barPad,B=n.barWidth+2*n.barPad,U=h,V=b+x;V+B>s&&(V=s-B);var W=this.container.selectAll("rect.scrollbar-horizontal").data(S?[0]:[]);W.exit().on(".drag",null).remove(),W.enter().append("rect").classed("scrollbar-horizontal",!0).call(y.fill,n.barColor),S?(this.hbar=W.attr({rx:n.barRadius,ry:n.barRadius,x:U,y:V,width:N,height:B}),this._hbarXMin=U+N/2,this._hbarTranslateMax=D-N):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var F=x>E,H=n.barWidth+2*n.barPad,q=n.barLength+2*n.barPad,G=h+m,tt=b;G+H>c&&(G=c-H);var ht=this.container.selectAll("rect.scrollbar-vertical").data(F?[0]:[]);ht.exit().on(".drag",null).remove(),ht.enter().append("rect").classed("scrollbar-vertical",!0).call(y.fill,n.barColor),F?(this.vbar=ht.attr({rx:n.barRadius,ry:n.barRadius,x:G,y:tt,width:H,height:q}),this._vbarYMin=tt+q/2,this._vbarTranslateMax=E-q):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var bt=this.id,vt=I-.5,ut=F?M+H+.5:M+.5,rt=p-.5,gt=S?g+B+.5:g+.5,it=o._topdefs.selectAll("#"+bt).data(S||F?[0]:[]);if(it.exit().remove(),it.enter().append("clipPath").attr("id",bt).append("rect"),S||F?(this._clipRect=it.select("rect").attr({x:Math.floor(vt),y:Math.floor(rt),width:Math.ceil(ut)-Math.floor(vt),height:Math.ceil(gt)-Math.floor(rt)}),this.container.call(z.setClipUrl,bt,this.gd),this.bg.attr({x:h,y:b,width:m,height:x})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),S||F){var st=f.behavior.drag().on("dragstart",function(){f.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(st);var xt=f.behavior.drag().on("dragstart",function(){f.event.sourceEvent.preventDefault(),f.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));S&&this.hbar.on(".drag",null).call(xt),F&&this.vbar.on(".drag",null).call(xt)}this.setTranslate(a,l)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var i=this.translateX,a=this.translateY;this.hbar&&(i-=f.event.dx),this.vbar&&(a-=f.event.dy),this.setTranslate(i,a)},n.prototype._onBoxWheel=function(){var i=this.translateX,a=this.translateY;this.hbar&&(i+=f.event.deltaY),this.vbar&&(a+=f.event.deltaY),this.setTranslate(i,a)},n.prototype._onBarDrag=function(){var i=this.translateX,a=this.translateY;if(this.hbar){var l=i+this._hbarXMin,o=l+this._hbarTranslateMax,c=P.constrain(f.event.x,l,o),s=(c-l)/(o-l),h=this.position.w-this._box.w;i=s*h}if(this.vbar){var m=a+this._vbarYMin,b=m+this._vbarTranslateMax,x=P.constrain(f.event.y,m,b),_=(x-m)/(b-m),A=this.position.h-this._box.h;a=_*A}this.setTranslate(i,a)},n.prototype.setTranslate=function(i,a){var l=this.position.w-this._box.w,o=this.position.h-this._box.h;if(i=P.constrain(i||0,0,l),a=P.constrain(a||0,0,o),this.translateX=i,this.translateY=a,this.container.call(z.setTranslate,this._box.l-this.position.l-i,this._box.t-this.position.t-a),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+i-.5),y:Math.floor(this.position.t+a-.5)}),this.hbar){var c=i/l;this.hbar.call(z.setTranslate,i+c*this._hbarTranslateMax,a)}if(this.vbar){var s=a/o;this.vbar.call(z.setTranslate,i,a+s*this._vbarTranslateMax)}}}),aq=It((et,Y)=>{var f=Br(),y=lh(),z=Hn(),P=Js(),n=jn(),i=uu(),a=Tc().arrayEditor,l=Rd().LINE_SPACING,o=L8(),c=iq();Y.exports=function(N){var B=N._fullLayout,U=n.filterVisible(B[o.name]);function V(bt){y.autoMargin(N,g(bt))}var W=B._menulayer.selectAll("g."+o.containerClassName).data(U.length>0?[0]:[]);if(W.enter().append("g").classed(o.containerClassName,!0).style("cursor","pointer"),W.exit().each(function(){f.select(this).selectAll("g."+o.headerGroupClassName).each(V)}).remove(),U.length!==0){var F=W.selectAll("g."+o.headerGroupClassName).data(U,s);F.enter().append("g").classed(o.headerGroupClassName,!0);for(var H=n.ensureSingle(W,"g",o.dropdownButtonGroupClassName,function(bt){bt.style("pointer-events","all")}),q=0;q{var f=L8();Y.exports={moduleType:"component",name:f.name,layoutAttributes:BL(),supplyLayoutDefaults:nq(),draw:aq()}}),G4=It((et,Y)=>{Y.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}),RL=It((et,Y)=>{var f=hi(),y=Xx(),z=Yn().extendDeepAll,P=sh().overrideAll,n=Ul(),i=Tc().templatedArray,a=G4(),l=i("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});Y.exports=P(i("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:l,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:z(y({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:n.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:f({})},font:f({}),activebgcolor:{valType:"color",dflt:a.gripBgActiveColor},bgcolor:{valType:"color",dflt:a.railBgColor},bordercolor:{valType:"color",dflt:a.railBorderColor},borderwidth:{valType:"number",min:0,dflt:a.railBorderWidth},ticklen:{valType:"number",min:0,dflt:a.tickLength},tickcolor:{valType:"color",dflt:a.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:a.minorTickLength}}),"arraydraw","from-root")}),sq=It((et,Y)=>{var f=jn(),y=Zf(),z=RL(),P=G4(),n=P.name,i=z.steps;Y.exports=function(o,c){y(o,c,{name:n,handleItemDefaults:a})};function a(o,c,s){function h(w,D){return f.coerce(o,c,z,w,D)}for(var m=y(o,c,{name:"steps",handleItemDefaults:l}),b=0,x=0;x{var f=Br(),y=lh(),z=Hn(),P=Js(),n=jn(),i=n.strTranslate,a=uu(),l=Tc().arrayEditor,o=G4(),c=Rd(),s=c.LINE_SPACING,h=c.FROM_TL,m=c.FROM_BR;Y.exports=function(W){var F=W._context.staticPlot,H=W._fullLayout,q=x(H,W),G=H._infolayer.selectAll("g."+o.containerClassName).data(q.length>0?[0]:[]);G.enter().append("g").classed(o.containerClassName,!0).style("cursor",F?null:"ew-resize");function tt(ut){ut._commandObserver&&(ut._commandObserver.remove(),delete ut._commandObserver),y.autoMargin(W,b(ut))}if(G.exit().each(function(){f.select(this).selectAll("g."+o.groupClassName).each(tt)}).remove(),q.length!==0){var ht=G.selectAll("g."+o.groupClassName).data(q,_);ht.enter().append("g").classed(o.groupClassName,!0),ht.exit().each(tt).remove();for(var bt=0;bt0&&(bt=bt.transition().duration(F.transition.duration).ease(F.transition.easing)),bt.attr("transform",i(ht-o.gripWidth*.5,F._dims.currentValueTotalHeight))}}function N(W,F){var H=W._dims;return H.inputAreaStart+o.stepInset+(H.inputAreaLength-2*o.stepInset)*Math.min(1,Math.max(0,F))}function B(W,F){var H=W._dims;return Math.min(1,Math.max(0,(F-o.stepInset-H.inputAreaStart)/(H.inputAreaLength-2*o.stepInset-2*H.inputAreaStart)))}function U(W,F,H){var q=H._dims,G=n.ensureSingle(W,"rect",o.railTouchRectClass,function(tt){tt.call(p,F,W,H).style("pointer-events","all")});G.attr({width:q.inputAreaLength,height:Math.max(q.inputAreaWidth,o.tickOffset+H.ticklen+q.labelHeight)}).call(z.fill,H.bgcolor).attr("opacity",0),P.setTranslate(G,0,q.currentValueTotalHeight)}function V(W,F){var H=F._dims,q=H.inputAreaLength-o.railInset*2,G=n.ensureSingle(W,"rect",o.railRectClass);G.attr({width:q,height:o.railWidth,rx:o.railRadius,ry:o.railRadius,"shape-rendering":"crispEdges"}).call(z.stroke,F.bordercolor).call(z.fill,F.bgcolor).style("stroke-width",F.borderwidth+"px"),P.setTranslate(G,o.railInset,(H.inputAreaWidth-o.railWidth)*.5+H.currentValueTotalHeight)}}),cq=It((et,Y)=>{var f=G4();Y.exports={moduleType:"component",name:f.name,layoutAttributes:RL(),supplyLayoutDefaults:sq(),draw:lq()}}),P8=It((et,Y)=>{var f=Sn();Y.exports={bgcolor:{valType:"color",dflt:f.background,editType:"plot"},bordercolor:{valType:"color",dflt:f.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),FL=It((et,Y)=>{Y.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}),I8=It((et,Y)=>{Y.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}),uq=It(et=>{var Y=Ku(),f=uu(),y=I8(),z=Rd().LINE_SPACING,P=y.name;function n(i){var a=i&&i[P];return a&&a.visible}et.isVisible=n,et.makeData=function(i){for(var a=Y.list({_fullLayout:i},"x",!0),l=i.margin,o=[],c=0;c{var f=jn(),y=Tc(),z=Ku(),P=P8(),n=FL();Y.exports=function(i,a,l){var o=i[l],c=a[l];if(!(o.rangeslider||a._requestRangeslider[c._id]))return;f.isPlainObject(o.rangeslider)||(o.rangeslider={});var s=o.rangeslider,h=y.newContainer(c,"rangeslider");function m(g,C){return f.coerce(s,h,P,g,C)}var b,x;function _(g,C){return f.coerce(b,x,n,g,C)}var A=m("visible");if(A){m("bgcolor",a.plot_bgcolor),m("bordercolor"),m("borderwidth"),m("thickness"),m("autorange",!c.isValidRange(s.range)),m("range");var d=a._subplots;if(d)for(var k=d.cartesian.filter(function(g){return g.substr(0,g.indexOf("y"))===z.name2id(l)}).map(function(g){return g.substr(g.indexOf("y"),g.length)}),w=f.simpleMap(k,z.id2name),D=0;D{var f=Ku().list,y=Jm().getAutoRange,z=I8();Y.exports=function(P){for(var n=f(P,"x",!0),i=0;i{var f=Br(),y=ls(),z=lh(),P=jn(),n=P.strTranslate,i=Js(),a=Hn(),l=jp(),o=Fd(),c=Ku(),s=Up(),h=Mm(),m=I8();Y.exports=function(p){for(var g=p._fullLayout,C=g._rangeSliderData,S=0;S=ge.max)ee=Ct[xe+1];else if(Gt=ge.pmax)ee=Ct[xe+1];else if(Gt0?p.touches[0].clientX:0}function x(p,g,C,S){if(g._context.staticPlot)return;var N=p.select("rect."+m.slideBoxClassName).node(),B=p.select("rect."+m.grabAreaMinClassName).node(),U=p.select("rect."+m.grabAreaMaxClassName).node();function V(){var W=f.event,F=W.target,H=b(W),q=H-p.node().getBoundingClientRect().left,G=S.d2p(C._rl[0]),tt=S.d2p(C._rl[1]),ht=s.coverSlip();this.addEventListener("touchmove",bt),this.addEventListener("touchend",vt),ht.addEventListener("mousemove",bt),ht.addEventListener("mouseup",vt);function bt(ut){var rt=b(ut),gt=+rt-H,it,st,xt;switch(F){case N:if(xt="ew-resize",G+gt>C._length||tt+gt<0)return;it=G+gt,st=tt+gt;break;case B:if(xt="col-resize",G+gt>C._length)return;it=G+gt,st=tt;break;case U:if(xt="col-resize",tt+gt<0)return;it=G,st=tt+gt;break;default:xt="ew-resize",it=q,st=q+gt;break}if(st{var f=jn(),y=P8(),z=FL(),P=uq();Y.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:f.extendFlat({},y,{yaxis:z})}}},layoutAttributes:P8(),handleDefaults:hq(),calcAutorange:dq(),draw:fq(),isVisible:P.isVisible,makeData:P.makeData,autoMarginOpts:P.autoMarginOpts}}),D8=It((et,Y)=>{var f=hi(),y=Sn(),z=Tc().templatedArray,P=z("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});Y.exports={visible:{valType:"boolean",editType:"plot"},buttons:P,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:f({editType:"plot"}),bgcolor:{valType:"color",dflt:y.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),NL=It((et,Y)=>{Y.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),mq=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=Zf(),n=D8(),i=NL();Y.exports=function(o,c,s,h,m){var b=o.rangeselector||{},x=z.newContainer(c,"rangeselector");function _(D,E){return f.coerce(b,x,n,D,E)}var A=P(b,x,{name:"buttons",handleItemDefaults:a,calendar:m}),d=_("visible",A.length>0);if(d){var k=l(c,s,h);_("x",k[0]),_("y",k[1]),f.noneOrAll(o,c,["x","y"]),_("xanchor"),_("yanchor"),f.coerceFont(_,"font",s.font);var w=_("bgcolor");_("activecolor",y.contrast(w,i.lightAmount,i.darkAmount)),_("bordercolor"),_("borderwidth")}};function a(o,c,s,h){var m=h.calendar;function b(A,d){return f.coerce(o,c,n.buttons,A,d)}var x=b("visible");if(x){var _=b("step");_!=="all"&&(m&&m!=="gregorian"&&(_==="month"||_==="year")?c.stepmode="backward":b("stepmode"),b("count")),b("label")}}function l(o,c,s){for(var h=s.filter(function(_){return c[_].anchor===o._id}),m=0,b=0;b{var f=Vn(),y=jn().titleCase;Y.exports=function(P,n){var i=P._name,a={};if(n.step==="all")a[i+".autorange"]=!0;else{var l=z(P,n);a[i+".range[0]"]=l[0],a[i+".range[1]"]=l[1]}return a};function z(P,n){var i=P.range,a=new Date(P.r2l(i[1])),l=n.step,o=f["utc"+y(l)],c=n.count,s;switch(n.stepmode){case"backward":s=P.l2r(+o.offset(a,-c));break;case"todate":var h=o.offset(a,-c);s=P.l2r(+o.ceil(h));break}var m=i[1];return[s,m]}}),vq=It((et,Y)=>{var f=Br(),y=ls(),z=lh(),P=Hn(),n=Js(),i=jn(),a=i.strTranslate,l=uu(),o=Ku(),c=Rd(),s=c.LINE_SPACING,h=c.FROM_TL,m=c.FROM_BR,b=NL(),x=gq();Y.exports=function(M){var p=M._fullLayout,g=p._infolayer.selectAll(".rangeselector").data(_(M),A);g.enter().append("g").classed("rangeselector",!0),g.exit().remove(),g.style({cursor:"pointer","pointer-events":"all"}),g.each(function(C){var S=f.select(this),N=C,B=N.rangeselector,U=S.selectAll("g.button").data(i.filterVisible(B.buttons));U.enter().append("g").classed("button",!0),U.exit().remove(),U.each(function(V){var W=f.select(this),F=x(N,V);V._isActive=d(N,V,F),W.call(k,B,V),W.call(D,B,V,M),W.on("click",function(){M._dragged||y.call("_guiRelayout",M,F)}),W.on("mouseover",function(){V._isHovered=!0,W.call(k,B,V)}),W.on("mouseout",function(){V._isHovered=!1,W.call(k,B,V)})}),I(M,U,B,N._name,S)})};function _(M){for(var p=o.list(M,"x",!0),g=[],C=0;C{Y.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:D8()}}},layoutAttributes:D8(),handleDefaults:mq(),draw:vq()}}),Jh=It(et=>{var Y=Yn().extendFlat;et.attributes=function(f,y){f=f||{},y=y||{};var z={valType:"info_array",editType:f.editType,items:[{valType:"number",min:0,max:1,editType:f.editType},{valType:"number",min:0,max:1,editType:f.editType}],dflt:[0,1]};f.name&&f.name+"",f.trace,y.description&&""+y.description;var P={x:Y({},z,{}),y:Y({},z,{}),editType:f.editType};return f.noGridCell||(P.row={valType:"integer",min:0,dflt:0,editType:f.editType},P.column={valType:"integer",min:0,dflt:0,editType:f.editType}),P},et.defaults=function(f,y,z,P){var n=P&&P.x||[0,1],i=P&&P.y||[0,1],a=y.grid;if(a){var l=z("domain.column");l!==void 0&&(l{var f=jn(),y=Ha().counter,z=Jh().attributes,P=fu().idRegex,n=Tc(),i={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[y("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:z({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function a(h,m,b){var x=m[b+"axes"],_=Object.keys((h._splomAxes||{})[b]||{});if(Array.isArray(x))return x;if(_.length)return _}function l(h,m){var b=h.grid||{},x=a(m,b,"x"),_=a(m,b,"y");if(!h.grid&&!x&&!_)return;var A=Array.isArray(b.subplots)&&Array.isArray(b.subplots[0]),d=Array.isArray(x),k=Array.isArray(_),w=d&&x!==b.xaxes&&k&&_!==b.yaxes,D,E;A?(D=b.subplots.length,E=b.subplots[0].length):(k&&(D=_.length),d&&(E=x.length));var I=n.newContainer(m,"grid");function M(F,H){return f.coerce(b,I,i,F,H)}var p=M("rows",D),g=M("columns",E);if(!(p*g>1)){delete m.grid;return}if(!A&&!d&&!k){var C=M("pattern")==="independent";C&&(A=!0)}I._hasSubplotGrid=A;var S=M("roworder"),N=S==="top to bottom",B=A?.2:.1,U=A?.3:.1,V,W;w&&m._splomGridDflt&&(V=m._splomGridDflt.xside,W=m._splomGridDflt.yside),I._domains={x:o("x",M,B,V,g),y:o("y",M,U,W,p,N)}}function o(h,m,b,x,_,A){var d=m(h+"gap",b),k=m("domain."+h);m(h+"side",x);for(var w=new Array(_),D=k[0],E=(k[1]-D)/(_-d),I=E*(1-d),M=0;M<_;M++){var p=D+E*M;w[A?_-1-M:M]=[p,p+I]}return w}function c(h,m){var b=m.grid;if(!(!b||!b._domains)){var x=h.grid||{},_=m._subplots,A=b._hasSubplotGrid,d=b.rows,k=b.columns,w=b.pattern==="independent",D,E,I,M,p,g,C,S=b._axisMap={};if(A){var N=x.subplots||[];g=b.subplots=new Array(d);var B=1;for(D=0;D{Y.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}),_q=It((et,Y)=>{var f=Sr(),y=ls(),z=jn(),P=Tc(),n=UL();Y.exports=function(i,a,l,o){var c="error_"+o.axis,s=P.newContainer(a,c),h=i[c]||{};function m(w,D){return z.coerce(h,s,n,w,D)}var b=h.array!==void 0||h.value!==void 0||h.type==="sqrt",x=m("visible",b);if(x!==!1){var _=m("type","array"in h?"data":"percent"),A=!0;_!=="sqrt"&&(A=m("symmetric",!((_==="data"?"arrayminus":"valueminus")in h))),_==="data"?(m("array"),m("traceref"),A||(m("arrayminus"),m("tracerefminus"))):(_==="percent"||_==="constant")&&(m("value"),A||m("valueminus"));var d="copy_"+o.inherit+"style";if(o.inherit){var k=a["error_"+o.inherit];(k||{}).visible&&m(d,!(h.color||f(h.thickness)||f(h.width)))}(!o.inherit||!s[d])&&(m("color",l),m("thickness"),m("width",y.traceIs(a,"gl3d")?0:4))}}}),$L=It((et,Y)=>{Y.exports=function(y){var z=y.type,P=y.symmetric;if(z==="data"){var n=y.array||[];if(P)return function(o,c){var s=+n[c];return[s,s]};var i=y.arrayminus||[];return function(o,c){var s=+n[c],h=+i[c];return!isNaN(s)||!isNaN(h)?[h||0,s||0]:[NaN,NaN]}}else{var a=f(z,y.value),l=f(z,y.valueminus);return P||y.valueminus===void 0?function(o){var c=a(o);return[c,c]}:function(o){return[l(o),a(o)]}}};function f(y,z){if(y==="percent")return function(P){return Math.abs(P*z/100)};if(y==="constant")return function(){return Math.abs(z)};if(y==="sqrt")return function(P){return Math.sqrt(Math.abs(P))}}}),xq=It((et,Y)=>{var f=Sr(),y=ls(),z=Fs(),P=jn(),n=$L();Y.exports=function(a){for(var l=a.calcdata,o=0;o{var f=Br(),y=Sr(),z=Js(),P=Fu();Y.exports=function(i,a,l,o){var c,s=l.xaxis,h=l.yaxis,m=o&&o.duration>0,b=i._context.staticPlot;a.each(function(x){var _=x[0].trace,A=_.error_x||{},d=_.error_y||{},k;_.ids&&(k=function(I){return I.id});var w=P.hasMarkers(_)&&_.marker.maxdisplayed>0;!d.visible&&!A.visible&&(x=[]);var D=f.select(this).selectAll("g.errorbar").data(x,k);if(D.exit().remove(),!!x.length){A.visible||D.selectAll("path.xerror").remove(),d.visible||D.selectAll("path.yerror").remove(),D.style("opacity",1);var E=D.enter().append("g").classed("errorbar",!0);m&&E.style("opacity",0).transition().duration(o.duration).style("opacity",1),z.setClipUrl(D,l.layerClipId,i),D.each(function(I){var M=f.select(this),p=n(I,s,h);if(!(w&&!I.vis)){var g,C=M.select("path.yerror");if(d.visible&&y(p.x)&&y(p.yh)&&y(p.ys)){var S=d.width;g="M"+(p.x-S)+","+p.yh+"h"+2*S+"m-"+S+",0V"+p.ys,p.noYS||(g+="m-"+S+",0h"+2*S),c=!C.size(),c?C=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("yerror",!0):m&&(C=C.transition().duration(o.duration).ease(o.easing)),C.attr("d",g)}else C.remove();var N=M.select("path.xerror");if(A.visible&&y(p.y)&&y(p.xh)&&y(p.xs)){var B=(A.copy_ystyle?d:A).width;g="M"+p.xh+","+(p.y-B)+"v"+2*B+"m0,-"+B+"H"+p.xs,p.noXS||(g+="m0,-"+B+"v"+2*B),c=!N.size(),c?N=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("xerror",!0):m&&(N=N.transition().duration(o.duration).ease(o.easing)),N.attr("d",g)}else N.remove()}})}})};function n(i,a,l){var o={x:a.c2p(i.x),y:l.c2p(i.y)};return i.yh!==void 0&&(o.yh=l.c2p(i.yh),o.ys=l.c2p(i.ys),y(o.ys)||(o.noYS=!0,o.ys=l.c2p(i.ys,!0))),i.xh!==void 0&&(o.xh=a.c2p(i.xh),o.xs=a.c2p(i.xs),y(o.xs)||(o.noXS=!0,o.xs=a.c2p(i.xs,!0))),o}}),wq=It((et,Y)=>{var f=Br(),y=Hn();Y.exports=function(z){z.each(function(P){var n=P[0].trace,i=n.error_y||{},a=n.error_x||{},l=f.select(this);l.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(y.stroke,i.color),a.copy_ystyle&&(a=i),l.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(y.stroke,a.color)})}}),kq=It((et,Y)=>{var f=jn(),y=sh().overrideAll,z=UL(),P={error_x:f.extendFlat({},z),error_y:f.extendFlat({},z)};delete P.error_x.copy_zstyle,delete P.error_y.copy_zstyle,delete P.error_y.copy_ystyle;var n={error_x:f.extendFlat({},z),error_y:f.extendFlat({},z),error_z:f.extendFlat({},z)};delete n.error_x.copy_ystyle,delete n.error_y.copy_ystyle,delete n.error_z.copy_ystyle,delete n.error_z.copy_zstyle,Y.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:P,bar:P,histogram:P,scatter3d:y(n,"calc","nested"),scattergl:y(P,"calc","nested")}},supplyDefaults:_q(),calc:xq(),makeComputeError:$L(),plot:bq(),style:wq(),hoverInfo:i};function i(a,l,o){(l.error_y||{}).visible&&(o.yerr=a.yh-a.y,l.error_y.symmetric||(o.yerrneg=a.y-a.ys)),(l.error_x||{}).visible&&(o.xerr=a.xh-a.x,l.error_x.symmetric||(o.xerrneg=a.x-a.xs))}}),Tq=It((et,Y)=>{Y.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}),Sq=It((et,Y)=>{var f=Br(),y=Xi(),z=lh(),P=ls(),n=Fs(),i=Up(),a=jn(),l=a.strTranslate,o=Yn().extendFlat,c=Mm(),s=Js(),h=Hn(),m=jp(),b=uu(),x=fp().flipScale,_=pb(),A=Ew(),d=Gf(),k=Rd(),w=k.LINE_SPACING,D=k.FROM_TL,E=k.FROM_BR,I=Tq().cn;function M(B){var U=B._fullLayout,V=U._infolayer.selectAll("g."+I.colorbar).data(p(B),function(W){return W._id});V.enter().append("g").attr("class",function(W){return W._id}).classed(I.colorbar,!0),V.each(function(W){var F=f.select(this);a.ensureSingle(F,"rect",I.cbbg),a.ensureSingle(F,"g",I.cbfills),a.ensureSingle(F,"g",I.cblines),a.ensureSingle(F,"g",I.cbaxis,function(q){q.classed(I.crisp,!0)}),a.ensureSingle(F,"g",I.cbtitleunshift,function(q){q.append("g").classed(I.cbtitle,!0)}),a.ensureSingle(F,"rect",I.cboutline);var H=g(F,W,B);H&&H.then&&(B._promises||[]).push(H),B._context.edits.colorbarPosition&&C(F,W,B)}),V.exit().each(function(W){z.autoMargin(B,W._id)}).remove(),V.order()}function p(B){var U=B._fullLayout,V=B.calcdata,W=[],F,H,q,G;function tt(J){return o(J,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function ht(){typeof G.calc=="function"?G.calc(B,q,F):(F._fillgradient=H.reversescale?x(H.colorscale):H.colorscale,F._zrange=[H[G.min],H[G.max]])}for(var bt=0;bt1){var Xt=Math.pow(10,Math.floor(Math.log(Oe)/Math.LN10));dn*=Xt*a.roundUp(Oe/Xt,[2,5,10]),(Math.abs(xe.start)/xe.size+1e-6)%1<2e-6&&(an.tick0=0)}an.dtick=dn}an.domain=W?[fr+gt/mt.h,fr+ie-gt/mt.h]:[fr+rt/mt.w,fr+ie-rt/mt.w],an.setScale(),B.attr("transform",l(Math.round(mt.l),Math.round(mt.t)));var oe=B.select("."+I.cbtitleunshift).attr("transform",l(-Math.round(mt.l),-Math.round(mt.t))),zt=an.ticklabelposition,_t=an.title.font.size,Pt=B.select("."+I.cbaxis),Ht,ae=0,he=0;function Me(zr,xr){var pn={propContainer:an,propName:U._propPrefix+"title.text",traceIndex:U._traceIndex,_meta:U._meta,placeholder:J._dfltTitle.colorbar,containerGroup:B.select("."+I.cbtitle)},ci=zr.charAt(0)==="h"?zr.substr(1):"h"+zr;B.selectAll("."+ci+",."+ci+"-math-group").remove(),m.draw(V,zr,o(pn,xr||{}))}function qe(){if(W&&Er||!W&&!Er){var zr,xr;Bt==="top"&&(zr=rt+mt.l+be*it,xr=gt+mt.t+ce*(1-fr-ie)+3+_t*.75),Bt==="bottom"&&(zr=rt+mt.l+be*it,xr=gt+mt.t+ce*(1-fr)-3-_t*.25),Bt==="right"&&(xr=gt+mt.t+ce*st+3+_t*.75,zr=rt+mt.l+be*fr),Me(an._id+"title",{attributes:{x:zr,y:xr,"text-anchor":W?"start":"middle"}})}}function Ye(){if(W&&!Er||!W&&Er){var zr=an.position||0,xr=an._offset+an._length/2,pn,ci;if(Bt==="right")ci=xr,pn=mt.l+be*zr+10+_t*(an.showticklabels?1:.5);else if(pn=xr,Bt==="bottom"&&(ci=mt.t+ce*zr+10+(zt.indexOf("inside")===-1?an.tickfont.size:0)+(an.ticks!=="inside"&&U.ticklen||0)),Bt==="top"){var ui=Rt.text.split("
").length;ci=mt.t+ce*zr+10-Mt-w*_t*ui}Me((W?"h":"v")+an._id+"title",{avoid:{selection:f.select(V).selectAll("g."+an._id+"tick"),side:Bt,offsetTop:W?0:mt.t,offsetLeft:W?mt.l:0,maxShift:W?J.width:J.height},attributes:{x:pn,y:ci,"text-anchor":"middle"},transform:{rotate:W?-90:0,offset:0}})}}function ur(){if(!W&&!Er||W&&Er){var zr=B.select("."+I.cbtitle),xr=zr.select("text"),pn=[-tt/2,tt/2],ci=zr.select(".h"+an._id+"title-math-group").node(),ui=15.6;xr.node()&&(ui=parseInt(xr.node().style.fontSize,10)*w);var yi;if(ci?(yi=s.bBox(ci),he=yi.width,ae=yi.height,ae>ui&&(pn[1]-=(ae-ui)/2)):xr.node()&&!xr.classed(I.jsPlaceholder)&&(yi=s.bBox(xr.node()),he=yi.width,ae=yi.height),W){if(ae){if(ae+=5,Bt==="top")an.domain[1]-=ae/mt.h,pn[1]*=-1;else{an.domain[0]+=ae/mt.h;var Gi=b.lineCount(xr);pn[1]+=(1-Gi)*ui}zr.attr("transform",l(pn[0],pn[1])),an.setScale()}}else he&&(Bt==="right"&&(an.domain[0]+=(he+_t/2)/mt.w),zr.attr("transform",l(pn[0],pn[1])),an.setScale())}B.selectAll("."+I.cbfills+",."+I.cblines).attr("transform",W?l(0,Math.round(mt.h*(1-an.domain[1]))):l(Math.round(mt.w*an.domain[0]),0)),Pt.attr("transform",W?l(0,Math.round(-mt.t)):l(Math.round(-mt.l),0));var Ci=B.select("."+I.cbfills).selectAll("rect."+I.cbfill).attr("style","").data(ye);Ci.enter().append("rect").classed(I.cbfill,!0).attr("style",""),Ci.exit().remove();var fi=Zt.map(an.c2p).map(Math.round).sort(function(vr,Ar){return vr-Ar});Ci.each(function(vr,Ar){var mn=[Ar===0?Zt[0]:(ye[Ar]+ye[Ar-1])/2,Ar===ye.length-1?Zt[1]:(ye[Ar]+ye[Ar+1])/2].map(an.c2p).map(Math.round);W&&(mn[1]=a.constrain(mn[1]+(mn[1]>mn[0])?1:-1,fi[0],fi[1]));var Zn=f.select(this).attr(W?"x":"y",Le).attr(W?"y":"x",f.min(mn)).attr(W?"width":"height",Math.max(Mt,2)).attr(W?"height":"width",Math.max(f.max(mn)-f.min(mn),2));if(U._fillgradient)s.gradient(Zn,V,U._id,W?"vertical":"horizontalreversed",U._fillgradient,"fill");else{var Un=ee(vr).replace("e-","");Zn.attr("fill",y(Un).toHexString())}});var ba=B.select("."+I.cblines).selectAll("path."+I.cbline).data(Ct.color&&Ct.width?ue:[]);ba.enter().append("path").classed(I.cbline,!0),ba.exit().remove(),ba.each(function(vr){var Ar=Le,mn=Math.round(an.c2p(vr))+Ct.width/2%1;f.select(this).attr("d","M"+(W?Ar+","+mn:mn+","+Ar)+(W?"h":"v")+Mt).call(s.lineGroupStyle,Ct.width,Gt(vr),Ct.dash)}),Pt.selectAll("g."+an._id+"tick,path").remove();var oa=Le+Mt+(tt||0)/2-(U.ticks==="outside"?1:0),Ke=n.calcTicks(an),sr=n.getTickSigns(an)[2];return n.drawTicks(V,an,{vals:an.ticks==="inside"?n.clipEnds(an,Ke):Ke,layer:Pt,path:n.makeTickPath(an,oa,sr),transFn:n.makeTransTickFn(an)}),n.drawLabels(V,an,{vals:Ke,layer:Pt,transFn:n.makeTransTickLabelFn(an),labelFns:n.makeLabelFns(an,oa)})}function Rr(){var zr,xr=Mt+tt/2;zt.indexOf("inside")===-1&&(zr=s.bBox(Pt.node()),xr+=W?zr.width:zr.height),Ht=oe.select("text");var pn=0,ci=W&&Bt==="top",ui=!W&&Bt==="right",yi=0;if(Ht.node()&&!Ht.classed(I.jsPlaceholder)){var Gi,Ci=oe.select(".h"+an._id+"title-math-group").node();Ci&&(W&&Er||!W&&!Er)?(zr=s.bBox(Ci),pn=zr.width,Gi=zr.height):(zr=s.bBox(oe.node()),pn=zr.right-mt.l-(W?Le:Jr),Gi=zr.bottom-mt.t-(W?Jr:Le),!W&&Bt==="top"&&(xr+=zr.height,yi=zr.height)),ui&&(Ht.attr("transform",l(pn/2+_t/2,0)),pn*=2),xr=Math.max(xr,W?pn:Gi)}var fi=(W?rt:gt)*2+xr+ht+tt/2,ba=0;!W&&Rt.text&&ut==="bottom"&&st<=0&&(ba=fi/2,fi+=ba,yi+=ba),J._hColorbarMoveTitle=ba,J._hColorbarMoveCBTitle=yi;var oa=ht+tt,Ke=(W?Le:Jr)-oa/2-(W?rt:0),sr=(W?Jr:Le)-(W?Lt:gt+yi-ba);B.select("."+I.cbbg).attr("x",Ke).attr("y",sr).attr(W?"width":"height",Math.max(fi-ba,2)).attr(W?"height":"width",Math.max(Lt+oa,2)).call(h.fill,bt).call(h.stroke,U.bordercolor).style("stroke-width",ht);var vr=ui?Math.max(pn-10,0):0;B.selectAll("."+I.cboutline).attr("x",(W?Le:Jr+rt)+vr).attr("y",(W?Jr+gt-Lt:Le)+(ci?ae:0)).attr(W?"width":"height",Math.max(Mt,2)).attr(W?"height":"width",Math.max(Lt-(W?2*gt+ae:2*rt+vr),2)).call(h.stroke,U.outlinecolor).style({fill:"none","stroke-width":tt});var Ar=W?Ze*fi:0,mn=W?0:(1-Qe)*fi-yi;if(Ar=ot?mt.l-Ar:-Ar,mn=xt?mt.t-mn:-mn,B.attr("transform",l(Ar,mn)),!W&&(ht||y(bt).getAlpha()&&!y.equals(J.paper_bgcolor,bt))){var Zn=Pt.selectAll("text"),Un=Zn[0].length,Wn=B.select("."+I.cbbg).node(),Li=s.bBox(Wn),Fi=s.getTranslate(B),Zi=2;Zn.each(function(cn,Yr){var un=0,Pn=Un-1;if(Yr===un||Yr===Pn){var bn=s.bBox(this),ze=s.getTranslate(this),yr;if(Yr===Pn){var en=bn.right+ze.x,Rn=Li.right+Fi.x+Jr-ht-Zi+it;yr=Rn-en,yr>0&&(yr=0)}else if(Yr===un){var ni=bn.left+ze.x,xi=Li.left+Fi.x+Jr+ht+Zi;yr=xi-ni,yr<0&&(yr=0)}yr&&(Un<3?this.setAttribute("transform","translate("+yr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Ji={},ca=D[vt],Ei=E[vt],Ga=D[ut],so=E[ut],Fe=fi-Mt;W?(H==="pixels"?(Ji.y=st,Ji.t=Lt*Ga,Ji.b=Lt*so):(Ji.t=Ji.b=0,Ji.yt=st+F*Ga,Ji.yb=st-F*so),G==="pixels"?(Ji.x=it,Ji.l=fi*ca,Ji.r=fi*Ei):(Ji.l=Fe*ca,Ji.r=Fe*Ei,Ji.xl=it-q*ca,Ji.xr=it+q*Ei)):(H==="pixels"?(Ji.x=it,Ji.l=Lt*ca,Ji.r=Lt*Ei):(Ji.l=Ji.r=0,Ji.xl=it+F*ca,Ji.xr=it-F*Ei),G==="pixels"?(Ji.y=1-st,Ji.t=fi*Ga,Ji.b=fi*so):(Ji.t=Fe*Ga,Ji.b=Fe*so,Ji.yt=st-q*Ga,Ji.yb=st+q*so));var Re=U.y<.5?"b":"t",Kr=U.x<.5?"l":"r";V._fullLayout._reservedMargin[U._id]={};var sn={r:J.width-Ke-Ar,l:Ke+Ji.r,b:J.height-sr-mn,t:sr+Ji.b};ot&&xt?z.autoMargin(V,U._id,Ji):ot?V._fullLayout._reservedMargin[U._id][Re]=sn[Re]:xt||W?V._fullLayout._reservedMargin[U._id][Kr]=sn[Kr]:V._fullLayout._reservedMargin[U._id][Re]=sn[Re]}return a.syncOrAsync([z.previousPromises,qe,ur,Ye,z.previousPromises,Rr],V)}function C(B,U,V){var W=U.orientation==="v",F=V._fullLayout,H=F._size,q,G,tt;i.init({element:B.node(),gd:V,prepFn:function(){q=B.attr("transform"),c(B)},moveFn:function(ht,bt){B.attr("transform",q+l(ht,bt)),G=i.align((W?U._uFrac:U._vFrac)+ht/H.w,W?U._thickFrac:U._lenFrac,0,1,U.xanchor),tt=i.align((W?U._vFrac:1-U._uFrac)-bt/H.h,W?U._lenFrac:U._thickFrac,0,1,U.yanchor);var vt=i.getCursor(G,tt,U.xanchor,U.yanchor);c(B,vt)},doneFn:function(){if(c(B),G!==void 0&&tt!==void 0){var ht={};ht[U._propPrefix+"x"]=G,ht[U._propPrefix+"y"]=tt,U._traceIndex!==void 0?P.call("_guiRestyle",V,ht,U._traceIndex):P.call("_guiRelayout",V,ht)}}})}function S(B,U,V){var W=U._levels,F=[],H=[],q,G,tt=W.end+W.size/100,ht=W.size,bt=1.001*V[0]-.001*V[1],vt=1.001*V[1]-.001*V[0];for(G=0;G<1e5&&(q=W.start+G*ht,!(ht>0?q>=tt:q<=tt));G++)q>bt&&q0?q>=tt:q<=tt));G++)q>V[0]&&q{Y.exports={moduleType:"component",name:"colorbar",attributes:M_(),supplyDefaults:Q1(),draw:Sq().draw,hasColorbar:Am()}}),Aq=It((et,Y)=>{Y.exports={moduleType:"component",name:"legend",layoutAttributes:pw(),supplyLayoutDefaults:eb(),draw:gw(),style:E4()}}),Mq=It((et,Y)=>{Y.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}),Eq=It((et,Y)=>{Y.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),HL=It((et,Y)=>{var f=ls(),y=jn(),z=y.extendFlat,P=y.extendDeep;function n(a){var l;switch(a){case"themes__thumb":l={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":l={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:l={}}return l}function i(a){var l=["xaxis","yaxis","zaxis"];return l.indexOf(a.slice(0,5))>-1}Y.exports=function(a,l){var o,c=a.data,s=a.layout,h=P([],c),m=P({},s,n(l.tileClass)),b=a._context||{};if(l.width&&(m.width=l.width),l.height&&(m.height=l.height),l.tileClass==="thumbnail"||l.tileClass==="themes__thumb"){m.annotations=[];var x=Object.keys(m);for(o=0;o{var f=Wg().EventEmitter,y=ls(),z=jn(),P=K0(),n=HL(),i=hb(),a=db();function l(o,c){var s=new f,h=n(o,{format:"png"}),m=h.gd;m.style.position="absolute",m.style.left="-5000px",document.body.appendChild(m);function b(){var _=P.getDelay(m._fullLayout);setTimeout(function(){var A=i(m),d=document.createElement("canvas");d.id=z.randstr(),s=a({format:c.format,width:m._fullLayout.width,height:m._fullLayout.height,canvas:d,emitter:s,svg:A}),s.clean=function(){m&&document.body.removeChild(m)}},_)}var x=P.getRedrawFunc(m);return y.call("_doPlot",m,h.data,h.layout,h.config).then(x).then(b).catch(function(_){s.emit("error",_)}),s}Y.exports=l}),Pq=It((et,Y)=>{var f=K0(),y={getDelay:f.getDelay,getRedrawFunc:f.getRedrawFunc,clone:HL(),toSVG:hb(),svgToImg:db(),toImage:Lq(),downloadImage:Mw()};Y.exports=y}),Iq=It(et=>{et.version=Dn().version,Mn(),uw();var Y=ls(),f=et.register=Y.register,y=S8(),z=Object.keys(y);for(n=0;n{Y.exports=Iq()}),gb=It((et,Y)=>{Y.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),Jv=It((et,Y)=>{var f=dd(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=Ru(),a=hi(),l=gb(),o=qf().pattern,c=Yn().extendFlat,s=a({editType:"calc",arrayOk:!0,colorEditType:"style"}),h=f.marker,m=h.line,b=c({},m.width,{dflt:0}),x=c({width:b,editType:"calc"},i("marker.line")),_=c({line:x,editType:"calc"},i("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:o,cornerradius:{valType:"any",editType:"calc"}});Y.exports={x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:f.xperiod0,yperiod0:f.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),text:f.text,texttemplate:P({editType:"plot"},{keys:l.eventDataKeys}),texttemplatefallback:n({editType:"plot"}),hovertext:f.hovertext,hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:n(),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:c({},s,{}),insidetextfont:c({},s,{}),outsidetextfont:c({},s,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:c({},f.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:_,offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,selected:{marker:{opacity:f.selected.marker.opacity,color:f.selected.marker.color,editType:"style"},textfont:f.selected.textfont,editType:"style"},unselected:{marker:{opacity:f.unselected.marker.opacity,color:f.unselected.marker.color,editType:"style"},textfont:f.unselected.textfont,editType:"style"},zorder:f.zorder}}),z8=It((et,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}),O8=It((et,Y)=>{var f=Hn(),y=fp().hasColorscale,z=Cu(),P=jn().coercePattern;Y.exports=function(n,i,a,l,o){var c=a("marker.color",l),s=y(n,"marker");s&&z(n,i,o,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",f.defaultLine),y(n,"marker.line")&&z(n,i,o,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),P(a,"marker.pattern",c,s),a("selected.marker.color"),a("unselected.marker.color")}}),eg=It((et,Y)=>{var f=Sr(),y=jn(),z=Hn(),P=ls(),n=Xg(),i=S0(),a=O8(),l=Xv(),o=Jv(),c=y.coerceFont;function s(x,_,A,d){function k(M,p){return y.coerce(x,_,o,M,p)}var w=n(x,_,d,k);if(!w){_.visible=!1;return}i(x,_,d,k),k("xhoverformat"),k("yhoverformat"),k("zorder"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");b(x,_,d,k,D,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),a(x,_,k,A,d);var E=(_.marker.line||{}).color,I=P.getComponentMethod("errorbars","supplyDefaults");I(x,_,E||z.defaultLine,{axis:"y"}),I(x,_,E||z.defaultLine,{axis:"x",inherit:"y"}),y.coerceSelectionMarkerOpacity(_,k)}function h(x,_){var A,d;function k(E,I){return y.coerce(d._input,d,o,E,I)}for(var w=0;w=0)return x}else if(typeof x=="string"&&(x=x.trim(),x.slice(-1)==="%"&&f(x.slice(0,-1))&&(x=+x.slice(0,-1),x>=0)))return x+"%"}function b(x,_,A,d,k,w){w=w||{};var D=w.moduleHasSelected!==!1,E=w.moduleHasUnselected!==!1,I=w.moduleHasConstrain!==!1,M=w.moduleHasCliponaxis!==!1,p=w.moduleHasTextangle!==!1,g=w.moduleHasInsideanchor!==!1,C=!!w.hasPathbar,S=Array.isArray(k)||k==="auto",N=S||k==="inside",B=S||k==="outside";if(N||B){var U=c(d,"textfont",A.font),V=y.extendFlat({},U),W=x.textfont&&x.textfont.color,F=!W;if(F&&delete V.color,c(d,"insidetextfont",V),C){var H=y.extendFlat({},U);F&&delete H.color,c(d,"pathbar.textfont",H)}B&&c(d,"outsidetextfont",U),D&&d("selected.textfont.color"),E&&d("unselected.textfont.color"),I&&d("constraintext"),M&&d("cliponaxis"),p&&d("textangle"),d("texttemplate"),d("texttemplatefallback")}N&&g&&d("insidetextanchor")}Y.exports={supplyDefaults:s,crossTraceDefaults:h,handleText:b,validateCornerradius:m}}),VL=It((et,Y)=>{var f=ls(),y=Fs(),z=jn(),P=z8(),n=eg().validateCornerradius;Y.exports=function(i,a,l){function o(D,E){return z.coerce(i,a,P,D,E)}for(var c=!1,s=!1,h=!1,m={},b=o("barmode"),x=b==="group",_=0;_0&&!m[d]&&(h=!0),m[d]=!0),A.visible&&A.type==="histogram"){var k=y.getFromId({_fullLayout:a},A[A.orientation==="v"?"xaxis":"yaxis"]);k.type!=="category"&&(s=!0)}}if(!c){delete a.barmode;return}b!=="overlay"&&o("barnorm"),o("bargap",s&&!h?0:.2),o("bargroupgap");var w=o("barcornerradius");a.barcornerradius=n(w)}}),Z4=It((et,Y)=>{var f=jn();Y.exports=function(y,z){for(var P=0;P{var f=Fs(),y=Im(),z=fp().hasColorscale,P=Cp(),n=Z4(),i=$t();Y.exports=function(a,l){var o=f.getFromId(a,l.xaxis||"x"),c=f.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A={msUTC:!!(l.base||l.base===0)};l.orientation==="h"?(s=o.makeCalcdata(l,"x",A),m=c.makeCalcdata(l,"y"),b=y(l,c,"y",m),x=!!l.yperiodalignment,_="y"):(s=c.makeCalcdata(l,"y",A),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;for(var d=Math.min(h.length,s.length),k=new Array(d),w=0;w{var f=Br(),y=jn();function z(a,l,o){var c=a._fullLayout,s=c["_"+o+"Text_minsize"];if(s){var h=c.uniformtext.mode==="hide",m;switch(o){case"funnelarea":case"pie":case"sunburst":m="g.slice";break;case"treemap":case"icicle":m="g.slice, g.pathbar";break;default:m="g.points > g.point"}l.selectAll(m).each(function(b){var x=b.transform;if(x){x.scale=h&&x.hide?0:s/x.fontSize;var _=f.select(this).select("text");y.setTransormAndDisplay(_,x)}})}}function P(a,l,o){if(o.uniformtext.mode){var c=i(a),s=o.uniformtext.minsize,h=l.scale*l.fontSize;l.hide=h{var Y=Sr(),f=Xi(),y=jn().isArrayOrTypedArray;et.coerceString=function(z,P,n){if(typeof P=="string"){if(P||!z.noBlank)return P}else if((typeof P=="number"||P===!0)&&!z.strict)return String(P);return n!==void 0?n:z.dflt},et.coerceNumber=function(z,P,n){if(Y(P)){P=+P;var i=z.min,a=z.max,l=i!==void 0&&Pa;if(!l)return P}return n!==void 0?n:z.dflt},et.coerceColor=function(z,P,n){return f(P).isValid()?P:n!==void 0?n:z.dflt},et.coerceEnumerated=function(z,P,n){return z.coerceNumber&&(P=+P),z.values.indexOf(P)!==-1?P:n!==void 0?n:z.dflt},et.getValue=function(z,P){var n;return y(z)?P{var f=Br(),y=Hn(),z=Js(),P=jn(),n=ls(),i=C0().resizeText,a=Jv(),l=a.textfont,o=a.insidetextfont,c=a.outsidetextfont,s=B8();function h(M){var p=f.select(M).selectAll('g[class^="barlayer"]').selectAll("g.trace");i(M,p,"bar");var g=p.size(),C=M._fullLayout;p.style("opacity",function(S){return S[0].trace.opacity}).each(function(S){(C.barmode==="stack"&&g>1||C.bargap===0&&C.bargroupgap===0&&!S[0].trace.marker.line.width)&&f.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(S){var N=f.select(this),B=S[0].trace;m(N,B,M)}),n.getComponentMethod("errorbars","style")(p)}function m(M,p,g){z.pointStyle(M.selectAll("path"),p,g),b(M,p,g)}function b(M,p,g){M.selectAll("text").each(function(C){var S=f.select(this),N=P.ensureUniformFontSize(g,d(S,C,p,g));z.font(S,N)})}function x(M,p,g){var C=p[0].trace;C.selectedpoints?_(g,C,M):(m(g,C,M),n.getComponentMethod("errorbars","style")(g))}function _(M,p,g){z.selectedPointStyle(M.selectAll("path"),p),A(M.selectAll("text"),p,g)}function A(M,p,g){M.each(function(C){var S=f.select(this),N;if(C.selected){N=P.ensureUniformFontSize(g,d(S,C,p,g));var B=p.selected.textfont&&p.selected.textfont.color;B&&(N.color=B),z.font(S,N)}else z.selectedTextStyle(S,p)})}function d(M,p,g,C){var S=C._fullLayout.font,N=g.textfont;if(M.classed("bartext-inside")){var B=I(p,g);N=w(g,p.i,S,B)}else M.classed("bartext-outside")&&(N=D(g,p.i,S));return N}function k(M,p,g){return E(l,M.textfont,p,g)}function w(M,p,g,C){var S=k(M,p,g),N=M._input.textfont===void 0||M._input.textfont.color===void 0||Array.isArray(M.textfont.color)&&M.textfont.color[p]===void 0;return N&&(S={color:y.contrast(C),family:S.family,size:S.size,weight:S.weight,style:S.style,variant:S.variant,textcase:S.textcase,lineposition:S.lineposition,shadow:S.shadow}),E(o,M.insidetextfont,p,S)}function D(M,p,g){var C=k(M,p,g);return E(c,M.outsidetextfont,p,C)}function E(M,p,g,C){p=p||{};var S=s.getValue(p.family,g),N=s.getValue(p.size,g),B=s.getValue(p.color,g),U=s.getValue(p.weight,g),V=s.getValue(p.style,g),W=s.getValue(p.variant,g),F=s.getValue(p.textcase,g),H=s.getValue(p.lineposition,g),q=s.getValue(p.shadow,g);return{family:s.coerceString(M.family,S,C.family),size:s.coerceNumber(M.size,N,C.size),color:s.coerceColor(M.color,B,C.color),weight:s.coerceString(M.weight,U,C.weight),style:s.coerceString(M.style,V,C.style),variant:s.coerceString(M.variant,W,C.variant),textcase:s.coerceString(M.variant,F,C.textcase),lineposition:s.coerceString(M.variant,H,C.lineposition),shadow:s.coerceString(M.variant,q,C.shadow)}}function I(M,p){return p.type==="waterfall"?p[M.dir].marker.color:M.mcc||M.mc||p.marker.color}Y.exports={style:h,styleTextPoints:b,styleOnSelect:x,getInsideTextFont:w,getOutsideTextFont:D,getBarColor:I,resizeText:i}}),vb=It((et,Y)=>{var f=Br(),y=Sr(),z=jn(),P=uu(),n=Hn(),i=Js(),a=ls(),l=Fs().tickText,o=C0(),c=o.recordMinTextSize,s=o.clearMinTextSize,h=Pg(),m=B8(),b=gb(),x=Jv(),_=x.text,A=x.textposition,d=T0().appendArrayPointValue,k=b.TEXTPAD;function w(ht){return ht.id}function D(ht){if(ht.ids)return w}function E(ht){return(ht>0)-(ht<0)}function I(ht,bt){return ht0}function C(ht,bt,vt,ut,rt,gt){var it=bt.xaxis,st=bt.yaxis,xt=ht._fullLayout,ot=ht._context.staticPlot;rt||(rt={mode:xt.barmode,norm:xt.barmode,gap:xt.bargap,groupgap:xt.bargroupgap},s("bar",xt));var J=z.makeTraceGroups(ut,vt,"trace bars").each(function(mt){var dt=f.select(this),Ct=mt[0].trace,Rt=mt[0].t,Bt=Ct.type==="waterfall",Zt=Ct.type==="funnel",Gt=Ct.type==="histogram",ee=Ct.type==="bar",xe=ee||Zt,ge=0;Bt&&Ct.connector.visible&&Ct.connector.mode==="between"&&(ge=Ct.connector.line.width/2);var ye=Ct.orientation==="h",ue=g(rt),Mt=z.ensureSingle(dt,"g","points"),Ot=D(Ct),Lt=Mt.selectAll("g.point").data(z.identity,Ot);Lt.enter().append("g").classed("point",!0),Lt.exit().remove(),Lt.each(function(be,ce){var Le=f.select(this),Ze=M(be,it,st,ye),Qe=Ze[0][0],mr=Ze[0][1],fr=Ze[1][0],Jr=Ze[1][1],an=(ye?mr-Qe:Jr-fr)===0;an&&xe&&m.getLineWidth(Ct,be)&&(an=!1),an||(an=!y(Qe)||!y(mr)||!y(fr)||!y(Jr)),be.isBlank=an,an&&(ye?mr=Qe:Jr=fr),ge&&!an&&(ye?(Qe-=I(Qe,mr)*ge,mr+=I(Qe,mr)*ge):(fr-=I(fr,Jr)*ge,Jr+=I(fr,Jr)*ge));var Er,dn;if(Ct.type==="waterfall"){if(!an){var _n=Ct[be.dir].marker;Er=_n.line.width,dn=_n.color}}else Er=m.getLineWidth(Ct,be),dn=be.mc||Ct.marker.color;function Oe(oa){var Ke=f.round(Er/2%1,2);return rt.gap===0&&rt.groupgap===0?f.round(Math.round(oa)-Ke,2):oa}function Xt(oa,Ke,sr){return sr&&oa===Ke?oa:Math.abs(oa-Ke)>=2?Oe(oa):oa>Ke?Math.ceil(oa):Math.floor(oa)}var oe=n.opacity(dn),zt=oe<1||Er>.01?Oe:Xt;ht._context.staticPlot||(Qe=zt(Qe,mr,ye),mr=zt(mr,Qe,ye),fr=zt(fr,Jr,!ye),Jr=zt(Jr,fr,!ye));var _t=ye?it.c2p:st.c2p,Pt;be.s0>0?Pt=be._sMax:be.s0<0?Pt=be._sMin:Pt=be.s1>0?be._sMax:be._sMin;function Ht(oa,Ke){if(!oa)return 0;var sr=Math.abs(ye?Jr-fr:mr-Qe),vr=Math.abs(ye?mr-Qe:Jr-fr),Ar=zt(Math.abs(_t(Pt,!0)-_t(0,!0))),mn=be.hasB?Math.min(sr/2,vr/2):Math.min(sr/2,Ar),Zn;if(Ke==="%"){var Un=Math.min(50,oa);Zn=sr*(Un/100)}else Zn=oa;return zt(Math.max(Math.min(Zn,mn),0))}var ae=ee||Gt?Ht(Rt.cornerradiusvalue,Rt.cornerradiusform):0,he,Me,qe="M"+Qe+","+fr+"V"+Jr+"H"+mr+"V"+fr+"Z",Ye=0;if(ae&&be.s){var ur=E(be.s0)===0||E(be.s)===E(be.s0)?be.s1:be.s0;if(Ye=zt(be.hasB?0:Math.abs(_t(Pt,!0)-_t(ur,!0))),Ye0?Math.sqrt(Ye*(2*ae-Ye)):0,ui=Rr>0?Math.max:Math.min;he="M"+Qe+","+fr+"V"+(Jr-pn*zr)+"H"+ui(mr-(ae-Ye)*Rr,Qe)+"A "+ae+","+ae+" 0 0 "+xr+" "+mr+","+(Jr-ae*zr-ci)+"V"+(fr+ae*zr+ci)+"A "+ae+","+ae+" 0 0 "+xr+" "+ui(mr-(ae-Ye)*Rr,Qe)+","+(fr+pn*zr)+"Z"}else if(be.hasB)he="M"+(Qe+ae*Rr)+","+fr+"A "+ae+","+ae+" 0 0 "+xr+" "+Qe+","+(fr+ae*zr)+"V"+(Jr-ae*zr)+"A "+ae+","+ae+" 0 0 "+xr+" "+(Qe+ae*Rr)+","+Jr+"H"+(mr-ae*Rr)+"A "+ae+","+ae+" 0 0 "+xr+" "+mr+","+(Jr-ae*zr)+"V"+(fr+ae*zr)+"A "+ae+","+ae+" 0 0 "+xr+" "+(mr-ae*Rr)+","+fr+"Z";else{Me=Math.abs(Jr-fr)+Ye;var yi=Me0?Math.sqrt(Ye*(2*ae-Ye)):0,Ci=zr>0?Math.max:Math.min;he="M"+(Qe+yi*Rr)+","+fr+"V"+Ci(Jr-(ae-Ye)*zr,fr)+"A "+ae+","+ae+" 0 0 "+xr+" "+(Qe+ae*Rr-Gi)+","+Jr+"H"+(mr-ae*Rr+Gi)+"A "+ae+","+ae+" 0 0 "+xr+" "+(mr-yi*Rr)+","+Ci(Jr-(ae-Ye)*zr,fr)+"V"+fr+"Z"}}else he=qe}else he=qe;var fi=p(z.ensureSingle(Le,"path"),xt,rt,gt);if(fi.style("vector-effect",ot?"none":"non-scaling-stroke").attr("d",isNaN((mr-Qe)*(Jr-fr))||an&&ht._context.staticPlot?"M0,0Z":he).call(i.setClipUrl,bt.layerClipId,ht),!xt.uniformtext.mode&&ue){var ba=i.makePointStyleFns(Ct);i.singlePointStyle(be,fi,Ct,ba,ht)}S(ht,bt,Le,mt,ce,Qe,mr,fr,Jr,ae,Ye,rt,gt),bt.layerClipId&&i.hideOutsideRangePoint(be,Le.select("text"),it,st,Ct.xcalendar,Ct.ycalendar)});var ie=Ct.cliponaxis===!1;i.setClipUrl(dt,ie?null:bt.layerClipId,ht)});a.getComponentMethod("errorbars","plot")(ht,J,bt,rt)}function S(ht,bt,vt,ut,rt,gt,it,st,xt,ot,J,mt,dt){var Ct=bt.xaxis,Rt=bt.yaxis,Bt=ht._fullLayout,Zt;function Gt(Me,qe,Ye){var ur=z.ensureSingle(Me,"text").text(qe).attr({class:"bartext bartext-"+Zt,"text-anchor":"middle","data-notex":1}).call(i.font,Ye).call(P.convertToTspans,ht);return ur}var ee=ut[0].trace,xe=ee.orientation==="h",ge=H(Bt,ut,rt,Ct,Rt);Zt=q(ee,rt);var ye=mt.mode==="stack"||mt.mode==="relative",ue=ut[rt],Mt=!ye||ue._outmost,Ot=ue.hasB,Lt=ot&&ot-J>k;if(!ge||Zt==="none"||(ue.isBlank||gt===it||st===xt)&&(Zt==="auto"||Zt==="inside")){vt.select("text").remove();return}var ie=Bt.font,be=h.getBarColor(ut[rt],ee),ce=h.getInsideTextFont(ee,rt,ie,be),Le=h.getOutsideTextFont(ee,rt,ie),Ze=ee.insidetextanchor||"end",Qe=vt.datum();xe?Ct.type==="log"&&Qe.s0<=0&&(Ct.range[0]0&&Oe>0,zt;Lt?Ot?zt=N(Jr-2*ot,an,_n,Oe,xe)||N(Jr,an-2*ot,_n,Oe,xe):xe?zt=N(Jr-(ot-J),an,_n,Oe,xe)||N(Jr,an-2*(ot-J),_n,Oe,xe):zt=N(Jr,an-(ot-J),_n,Oe,xe)||N(Jr-2*(ot-J),an,_n,Oe,xe):zt=N(Jr,an,_n,Oe,xe),oe&&zt?Zt="inside":(Zt="outside",Er.remove(),Er=null)}else Zt="inside";if(!Er){Xt=z.ensureUniformFontSize(ht,Zt==="outside"?Le:ce),Er=Gt(vt,ge,Xt);var _t=Er.attr("transform");if(Er.attr("transform",""),dn=i.bBox(Er.node()),_n=dn.width,Oe=dn.height,Er.attr("transform",_t),_n<=0||Oe<=0){Er.remove();return}}var Pt=ee.textangle,Ht,ae;Zt==="outside"?(ae=ee.constraintext==="both"||ee.constraintext==="outside",Ht=F(gt,it,st,xt,dn,{isHorizontal:xe,constrained:ae,angle:Pt})):(ae=ee.constraintext==="both"||ee.constraintext==="inside",Ht=V(gt,it,st,xt,dn,{isHorizontal:xe,constrained:ae,angle:Pt,anchor:Ze,hasB:Ot,r:ot,overhead:J})),Ht.fontSize=Xt.size,c(ee.type==="histogram"?"bar":ee.type,Ht,Bt),ue.transform=Ht;var he=p(Er,Bt,mt,dt);z.setTransormAndDisplay(he,Ht)}function N(ht,bt,vt,ut,rt){if(ht<0||bt<0)return!1;var gt=vt<=ht&&ut<=bt,it=vt<=bt&&ut<=ht,st=rt?ht>=vt*(bt/ut):bt>=ut*(ht/vt);return gt||it||st}function B(ht){return ht==="auto"?0:ht}function U(ht,bt){var vt=Math.PI/180*bt,ut=Math.abs(Math.sin(vt)),rt=Math.abs(Math.cos(vt));return{x:ht.width*rt+ht.height*ut,y:ht.width*ut+ht.height*rt}}function V(ht,bt,vt,ut,rt,gt){var it=!!gt.isHorizontal,st=!!gt.constrained,xt=gt.angle||0,ot=gt.anchor,J=ot==="end",mt=ot==="start",dt=gt.leftToRight||0,Ct=(dt+1)/2,Rt=1-Ct,Bt=gt.hasB,Zt=gt.r,Gt=gt.overhead,ee=rt.width,xe=rt.height,ge=Math.abs(bt-ht),ye=Math.abs(ut-vt),ue=ge>2*k&&ye>2*k?k:0;ge-=2*ue,ye-=2*ue;var Mt=B(xt);xt==="auto"&&!(ee<=ge&&xe<=ye)&&(ee>ge||xe>ye)&&(!(ee>ye||xe>ge)||eek){var be=W(ht,bt,vt,ut,Ot,Zt,Gt,it,Bt);Lt=be.scale,ie=be.pad}else Lt=1,st&&(Lt=Math.min(1,ge/Ot.x,ye/Ot.y)),ie=0;var ce=rt.left*Rt+rt.right*Ct,Le=(rt.top+rt.bottom)/2,Ze=(ht+k)*Rt+(bt-k)*Ct,Qe=(vt+ut)/2,mr=0,fr=0;if(mt||J){var Jr=(it?Ot.x:Ot.y)/2;Zt&&(J||Bt)&&(ue+=ie);var an=it?I(ht,bt):I(vt,ut);it?mt?(Ze=ht+an*ue,mr=-an*Jr):(Ze=bt-an*ue,mr=an*Jr):mt?(Qe=vt+an*ue,fr=-an*Jr):(Qe=ut-an*ue,fr=an*Jr)}return{textX:ce,textY:Le,targetX:Ze,targetY:Qe,anchorX:mr,anchorY:fr,scale:Lt,rotate:Mt}}function W(ht,bt,vt,ut,rt,gt,it,st,xt){var ot=Math.max(0,Math.abs(bt-ht)-2*k),J=Math.max(0,Math.abs(ut-vt)-2*k),mt=gt-k,dt=it?mt-Math.sqrt(mt*mt-(mt-it)*(mt-it)):mt,Ct=xt?mt*2:st?mt-it:2*dt,Rt=xt?mt*2:st?2*dt:mt-it,Bt,Zt,Gt,ee,xe;return rt.y/rt.x>=J/(ot-Ct)?ee=J/rt.y:rt.y/rt.x<=(J-Rt)/ot?ee=ot/rt.x:!xt&&st?(Bt=rt.x*rt.x+rt.y*rt.y/4,Zt=-2*rt.x*(ot-mt)-rt.y*(J/2-mt),Gt=(ot-mt)*(ot-mt)+(J/2-mt)*(J/2-mt)-mt*mt,ee=(-Zt+Math.sqrt(Zt*Zt-4*Bt*Gt))/(2*Bt)):xt?(Bt=(rt.x*rt.x+rt.y*rt.y)/4,Zt=-rt.x*(ot/2-mt)-rt.y*(J/2-mt),Gt=(ot/2-mt)*(ot/2-mt)+(J/2-mt)*(J/2-mt)-mt*mt,ee=(-Zt+Math.sqrt(Zt*Zt-4*Bt*Gt))/(2*Bt)):(Bt=rt.x*rt.x/4+rt.y*rt.y,Zt=-rt.x*(ot/2-mt)-2*rt.y*(J-mt),Gt=(ot/2-mt)*(ot/2-mt)+(J-mt)*(J-mt)-mt*mt,ee=(-Zt+Math.sqrt(Zt*Zt-4*Bt*Gt))/(2*Bt)),ee=Math.min(1,ee),st?xe=Math.max(0,mt-Math.sqrt(Math.max(0,mt*mt-(mt-(J-rt.y*ee)/2)*(mt-(J-rt.y*ee)/2)))-it):xe=Math.max(0,mt-Math.sqrt(Math.max(0,mt*mt-(mt-(ot-rt.x*ee)/2)*(mt-(ot-rt.x*ee)/2)))-it),{scale:ee,pad:xe}}function F(ht,bt,vt,ut,rt,gt){var it=!!gt.isHorizontal,st=!!gt.constrained,xt=gt.angle||0,ot=rt.width,J=rt.height,mt=Math.abs(bt-ht),dt=Math.abs(ut-vt),Ct;it?Ct=dt>2*k?k:0:Ct=mt>2*k?k:0;var Rt=1;st&&(Rt=it?Math.min(1,dt/J):Math.min(1,mt/ot));var Bt=B(xt),Zt=U(rt,Bt),Gt=(it?Zt.x:Zt.y)/2,ee=(rt.left+rt.right)/2,xe=(rt.top+rt.bottom)/2,ge=(ht+bt)/2,ye=(vt+ut)/2,ue=0,Mt=0,Ot=it?I(bt,ht):I(vt,ut);return it?(ge=bt-Ot*Ct,ue=Ot*Gt):(ye=ut+Ot*Ct,Mt=-Ot*Gt),{textX:ee,textY:xe,targetX:ge,targetY:ye,anchorX:ue,anchorY:Mt,scale:Rt,rotate:Bt}}function H(ht,bt,vt,ut,rt){var gt=bt[0].trace,it=gt.texttemplate,st;return it?st=G(ht,bt,vt,ut,rt):gt.textinfo?st=tt(bt,vt,ut,rt):st=m.getValue(gt.text,vt),m.coerceString(_,st)}function q(ht,bt){var vt=m.getValue(ht.textposition,bt);return m.coerceEnumerated(A,vt)}function G(ht,bt,vt,ut,rt){var gt=bt[0].trace,it=z.castOption(gt,vt,"texttemplate");if(!it)return"";var st=gt.type==="histogram",xt=gt.type==="waterfall",ot=gt.type==="funnel",J=gt.orientation==="h",mt,dt,Ct,Rt;J?(mt="y",dt=rt,Ct="x",Rt=ut):(mt="x",dt=ut,Ct="y",Rt=rt);function Bt(ue){return l(dt,dt.c2l(ue),!0).text}function Zt(ue){return l(Rt,Rt.c2l(ue),!0).text}var Gt=bt[vt],ee={};ee.label=Gt.p,ee.labelLabel=ee[mt+"Label"]=Bt(Gt.p);var xe=z.castOption(gt,Gt.i,"text");(xe===0||xe)&&(ee.text=xe),ee.value=Gt.s,ee.valueLabel=ee[Ct+"Label"]=Zt(Gt.s);var ge={};d(ge,gt,Gt.i),(st||ge.x===void 0)&&(ge.x=J?ee.value:ee.label),(st||ge.y===void 0)&&(ge.y=J?ee.label:ee.value),(st||ge.xLabel===void 0)&&(ge.xLabel=J?ee.valueLabel:ee.labelLabel),(st||ge.yLabel===void 0)&&(ge.yLabel=J?ee.labelLabel:ee.valueLabel),xt&&(ee.delta=+Gt.rawS||Gt.s,ee.deltaLabel=Zt(ee.delta),ee.final=Gt.v,ee.finalLabel=Zt(ee.final),ee.initial=ee.final-ee.delta,ee.initialLabel=Zt(ee.initial)),ot&&(ee.value=Gt.s,ee.valueLabel=Zt(ee.value),ee.percentInitial=Gt.begR,ee.percentInitialLabel=z.formatPercent(Gt.begR),ee.percentPrevious=Gt.difR,ee.percentPreviousLabel=z.formatPercent(Gt.difR),ee.percentTotal=Gt.sumR,ee.percenTotalLabel=z.formatPercent(Gt.sumR));var ye=z.castOption(gt,Gt.i,"customdata");return ye&&(ee.customdata=ye),z.texttemplateString({data:[ge,ee,gt._meta],fallback:gt.texttemplatefallback,labels:ee,locale:ht._d3locale,template:it})}function tt(ht,bt,vt,ut){var rt=ht[0].trace,gt=rt.orientation==="h",it=rt.type==="waterfall",st=rt.type==="funnel";function xt(ye){var ue=gt?ut:vt;return l(ue,ye,!0).text}function ot(ye){var ue=gt?vt:ut;return l(ue,+ye,!0).text}var J=rt.textinfo,mt=ht[bt],dt=J.split("+"),Ct=[],Rt,Bt=function(ye){return dt.indexOf(ye)!==-1};if(Bt("label")&&Ct.push(xt(ht[bt].p)),Bt("text")&&(Rt=z.castOption(rt,mt.i,"text"),(Rt===0||Rt)&&Ct.push(Rt)),it){var Zt=+mt.rawS||mt.s,Gt=mt.v,ee=Gt-Zt;Bt("initial")&&Ct.push(ot(ee)),Bt("delta")&&Ct.push(ot(Zt)),Bt("final")&&Ct.push(ot(Gt))}if(st){Bt("value")&&Ct.push(ot(mt.s));var xe=0;Bt("percent initial")&&xe++,Bt("percent previous")&&xe++,Bt("percent total")&&xe++;var ge=xe>1;Bt("percent initial")&&(Rt=z.formatPercent(mt.begR),ge&&(Rt+=" of initial"),Ct.push(Rt)),Bt("percent previous")&&(Rt=z.formatPercent(mt.difR),ge&&(Rt+=" of previous"),Ct.push(Rt)),Bt("percent total")&&(Rt=z.formatPercent(mt.sumR),ge&&(Rt+=" of total"),Ct.push(Rt))}return Ct.join("
")}Y.exports={plot:C,toMoveInsideBar:V}}),Iw=It((et,Y)=>{var f=hd(),y=ls(),z=Hn(),P=jn().fillText,n=B8().getLineWidth,i=Fs().hoverLabelText,a=Dr().BADNUM;function l(s,h,m,b,x){var _=o(s,h,m,b,x);if(_){var A=_.cd,d=A[0].trace,k=A[_.index];return _.color=c(d,k),y.getComponentMethod("errorbars","hoverInfo")(k,d,_),[_]}}function o(s,h,m,b,x){var _=s.cd,A=_[0].trace,d=_[0].t,k=b==="closest",w=A.type==="waterfall",D=s.maxHoverDistance,E=s.maxSpikeDistance,I,M,p,g,C,S,N;A.orientation==="h"?(I=m,M=h,p="y",g="x",C=ut,S=ht):(I=h,M=m,p="x",g="y",S=ut,C=ht);var B=A[p+"period"],U=k||B;function V(Rt){return F(Rt,-1)}function W(Rt){return F(Rt,1)}function F(Rt,Bt){var Zt=Rt.w;return Rt[p]+Bt*Zt/2}function H(Rt){return Rt[p+"End"]-Rt[p+"Start"]}var q=k?V:B?function(Rt){return Rt.p-H(Rt)/2}:function(Rt){return Math.min(V(Rt),Rt.p-d.bardelta/2)},G=k?W:B?function(Rt){return Rt.p+H(Rt)/2}:function(Rt){return Math.max(W(Rt),Rt.p+d.bardelta/2)};function tt(Rt,Bt,Zt){return x.finiteRange&&(Zt=0),f.inbox(Rt-I,Bt-I,Zt+Math.min(1,Math.abs(Bt-Rt)/N)-1)}function ht(Rt){return tt(q(Rt),G(Rt),D)}function bt(Rt){return tt(V(Rt),W(Rt),E)}function vt(Rt){var Bt=Rt[g];if(w){var Zt=Math.abs(Rt.rawS)||0;M>0?Bt+=Zt:M<0&&(Bt-=Zt)}return Bt}function ut(Rt){var Bt=M,Zt=Rt.b,Gt=vt(Rt);return f.inbox(Zt-Bt,Gt-Bt,D+(Gt-Bt)/(Gt-Zt)-1)}function rt(Rt){var Bt=M,Zt=Rt.b,Gt=vt(Rt);return f.inbox(Zt-Bt,Gt-Bt,E+(Gt-Bt)/(Gt-Zt)-1)}var gt=s[p+"a"],it=s[g+"a"];N=Math.abs(gt.r2c(gt.range[1])-gt.r2c(gt.range[0]));function st(Rt){return(C(Rt)+S(Rt))/2}var xt=f.getDistanceFunction(b,C,S,st);if(f.getClosest(_,xt,s),s.index!==!1&&_[s.index].p!==a){U||(q=function(Rt){return Math.min(V(Rt),Rt.p-d.bargroupwidth/2)},G=function(Rt){return Math.max(W(Rt),Rt.p+d.bargroupwidth/2)});var ot=s.index,J=_[ot],mt=A.base?J.b+J.s:J.s;s[g+"0"]=s[g+"1"]=it.c2p(J[g],!0),s[g+"LabelVal"]=mt;var dt=d.extents[d.extents.round(J.p)];s[p+"0"]=gt.c2p(k?q(J):dt[0],!0),s[p+"1"]=gt.c2p(k?G(J):dt[1],!0);var Ct=J.orig_p!==void 0;return s[p+"LabelVal"]=Ct?J.orig_p:J.p,s.labelLabel=i(gt,s[p+"LabelVal"],A[p+"hoverformat"]),s.valueLabel=i(it,s[g+"LabelVal"],A[g+"hoverformat"]),s.baseLabel=i(it,J.b,A[g+"hoverformat"]),s.spikeDistance=(rt(J)+bt(J))/2,s[p+"Spike"]=gt.c2p(J.p,!0),P(J,A,s),s.hovertemplate=A.hovertemplate,s}}function c(s,h){var m=h.mcc||s.marker.color,b=h.mlcc||s.marker.line.color,x=n(s,h);if(z.opacity(m))return m;if(z.opacity(b)&&x)return b}Y.exports={hoverPoints:l,hoverOnBars:o,getTraceColor:c}}),Oq=It((et,Y)=>{Y.exports=function(f,y,z){return f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),z.orientation==="h"?(f.label=f.y,f.value=f.x):(f.label=f.x,f.value=f.y),f}}),Dw=It((et,Y)=>{Y.exports=function(y,z){var P=y.cd,n=y.xaxis,i=y.yaxis,a=P[0].trace,l=a.type==="funnel",o=a.orientation==="h",c=[],s;if(z===!1)for(s=0;s{Y.exports={attributes:Jv(),layoutAttributes:z8(),supplyDefaults:eg().supplyDefaults,crossTraceDefaults:eg().crossTraceDefaults,supplyLayoutDefaults:VL(),calc:zq(),crossTraceCalc:Wr().crossTraceCalc,colorbar:Do(),arraysToCalcdata:Z4(),plot:vb().plot,style:Pg().style,styleOnSelect:Pg().styleOnSelect,hoverPoints:Iw().hoverPoints,eventData:Oq(),selectPoints:Dw(),moduleType:"trace",name:"bar",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),Rq=It((et,Y)=>{Y.exports=Bq()}),K4=It((et,Y)=>{var f=Em(),y=dd(),z=Jv(),P=Sn(),n=Sh().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=Yn().extendFlat,o=y.marker,c=o.line;Y.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:y.xperiod,yperiod:y.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:y.xperiodalignment,yperiodalignment:y.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},o.angle,{arrayOk:!1,editType:"calc"}),size:l({},o.size,{arrayOk:!1,editType:"calc"}),color:l({},o.color,{arrayOk:!1,editType:"style"}),line:{color:l({},c.color,{arrayOk:!1,dflt:P.defaultLine,editType:"style"}),width:l({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:f(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:z.offsetgroup,alignmentgroup:z.alignmentgroup,selected:{marker:y.selected.marker,editType:"style"},unselected:{marker:y.unselected.marker,editType:"style"},text:l({},y.text,{}),hovertext:l({},y.hovertext,{}),hovertemplate:i({}),hovertemplatefallback:a(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:y.zorder}}),Y4=It((et,Y)=>{Y.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}),X4=It((et,Y)=>{var f=jn(),y=ls(),z=Hn(),P=S0(),n=Xv(),i=ty(),a=K4();function l(h,m,b,x){function _(g,C){return f.coerce(h,m,a,g,C)}if(o(h,m,_,x),m.visible!==!1){P(h,m,x,_),_("xhoverformat"),_("yhoverformat");var A=m._hasPreCompStats;A&&(_("lowerfence"),_("upperfence")),_("line.color",(h.marker||{}).color||b),_("line.width"),_("fillcolor",z.addOpacity(m.line.color,.5));var d=!1;if(A){var k=_("mean"),w=_("sd");k&&k.length&&(d=!0,w&&w.length&&(d="sd"))}_("whiskerwidth");var D=_("sizemode"),E;D==="quartiles"&&(E=_("boxmean",d)),_("showwhiskers",D==="quartiles"),(D==="sd"||E==="sd")&&_("sdmultiple"),_("width"),_("quartilemethod");var I=!1;if(A){var M=_("notchspan");M&&M.length&&(I=!0)}else f.validate(h.notchwidth,a.notchwidth)&&(I=!0);var p=_("notched",I);p&&_("notchwidth"),c(h,m,_,{prefix:"box"}),_("zorder")}}function o(h,m,b,x){function _(tt){var ht=0;return tt&&tt.length&&(ht+=1,f.isArrayOrTypedArray(tt[0])&&tt[0].length&&(ht+=1)),ht}function A(tt){return f.validate(h[tt],a[tt])}var d=b("y"),k=b("x"),w;if(m.type==="box"){var D=b("q1"),E=b("median"),I=b("q3");m._hasPreCompStats=D&&D.length&&E&&E.length&&I&&I.length,w=Math.min(f.minRowLength(D),f.minRowLength(E),f.minRowLength(I))}var M=_(d),p=_(k),g=M&&f.minRowLength(d),C=p&&f.minRowLength(k),S=x.calendar,N={autotypenumbers:x.autotypenumbers},B,U;if(m._hasPreCompStats)switch(String(p)+String(M)){case"00":var V=A("x0")||A("dx"),W=A("y0")||A("dy");W&&!V?B="h":B="v",U=w;break;case"10":B="v",U=Math.min(w,C);break;case"20":B="h",U=Math.min(w,k.length);break;case"01":B="h",U=Math.min(w,g);break;case"02":B="v",U=Math.min(w,d.length);break;case"12":B="v",U=Math.min(w,C,d.length);break;case"21":B="h",U=Math.min(w,k.length,g);break;case"11":U=0;break;case"22":var F=!1,H;for(H=0;H0?(B="v",p>0?U=Math.min(C,g):U=Math.min(g)):p>0?(B="h",U=Math.min(C)):U=0;if(!U){m.visible=!1;return}m._length=U;var q=b("orientation",B);m._hasPreCompStats?q==="v"&&p===0?(b("x0",0),b("dx",1)):q==="h"&&M===0&&(b("y0",0),b("dy",1)):q==="v"&&p===0?b("x0"):q==="h"&&M===0&&b("y0");var G=y.getComponentMethod("calendars","handleTraceDefaults");G(h,m,["x","y"],x)}function c(h,m,b,x){var _=x.prefix,A=f.coerce2(h,m,a,"marker.outliercolor"),d=b("marker.line.outliercolor"),k="outliers";m._hasPreCompStats?k="all":(A||d)&&(k="suspectedoutliers");var w=b(_+"points",k);w?(b("jitter",w==="all"?.3:0),b("pointpos",w==="all"?-1.5:0),b("marker.symbol"),b("marker.opacity"),b("marker.size"),b("marker.angle"),b("marker.color",m.line.color),b("marker.line.color"),b("marker.line.width"),w==="suspectedoutliers"&&(b("marker.line.outliercolor",m.marker.color),b("marker.line.outlierwidth")),b("selected.marker.color"),b("unselected.marker.color"),b("selected.marker.size"),b("unselected.marker.size"),b("text"),b("hovertext")):delete m.marker;var D=b("hoveron");(D==="all"||D.indexOf("points")!==-1)&&(b("hovertemplate"),b("hovertemplatefallback")),f.coerceSelectionMarkerOpacity(m,b)}function s(h,m){var b,x;function _(w){return f.coerce(x._input,x,a,w)}for(var A=0;A{var f=ls(),y=jn(),z=Y4();function P(i,a,l,o,c){for(var s=c+"Layout",h=!1,m=0;m{var f=Sr(),y=Fs(),z=Im(),P=jn(),n=Dr().BADNUM,i=P._;Y.exports=function(w,D){var E=w._fullLayout,I=y.getFromId(w,D.xaxis||"x"),M=y.getFromId(w,D.yaxis||"y"),p=[],g=D.type==="violin"?"_numViolins":"_numBoxes",C,S,N,B,U,V,W;D.orientation==="h"?(N=I,B="x",U=M,V="y",W=!!D.yperiodalignment):(N=M,B="y",U=I,V="x",W=!!D.xperiodalignment);var F=a(D,V,U,E[g]),H=F[0],q=F[1],G=P.distinctVals(H,U),tt=G.vals,ht=G.minDiff/2,bt,vt,ut,rt,gt,it,st=(D.boxpoints||D.points)==="all"?P.identity:function(Jr){return Jr.vbt.uf};if(D._hasPreCompStats){var xt=D[B],ot=function(Jr){return N.d2c((D[Jr]||[])[C])},J=1/0,mt=-1/0;for(C=0;C=bt.q1&&bt.q3>=bt.med){var Ct=ot("lowerfence");bt.lf=Ct!==n&&Ct<=bt.q1?Ct:x(bt,ut,rt);var Rt=ot("upperfence");bt.uf=Rt!==n&&Rt>=bt.q3?Rt:_(bt,ut,rt);var Bt=ot("mean");bt.mean=Bt!==n?Bt:rt?P.mean(ut,rt):(bt.q1+bt.q3)/2;var Zt=ot("sd");bt.sd=Bt!==n&&Zt>=0?Zt:rt?P.stdev(ut,rt,bt.mean):bt.q3-bt.q1,bt.lo=A(bt),bt.uo=d(bt);var Gt=ot("notchspan");Gt=Gt!==n&&Gt>0?Gt:k(bt,rt),bt.ln=bt.med-Gt,bt.un=bt.med+Gt;var ee=bt.lf,xe=bt.uf;D.boxpoints&&ut.length&&(ee=Math.min(ee,ut[0]),xe=Math.max(xe,ut[rt-1])),D.notched&&(ee=Math.min(ee,bt.ln),xe=Math.max(xe,bt.un)),bt.min=ee,bt.max=xe}else{P.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+bt.q1,"median = "+bt.med,"q3 = "+bt.q3].join(` -`));var ge;bt.med!==n?ge=bt.med:bt.q1!==n?bt.q3!==n?ge=(bt.q1+bt.q3)/2:ge=bt.q1:bt.q3!==n?ge=bt.q3:ge=0,bt.med=ge,bt.q1=bt.q3=ge,bt.lf=bt.uf=ge,bt.mean=bt.sd=ge,bt.ln=bt.un=ge,bt.min=bt.max=ge}J=Math.min(J,bt.min),mt=Math.max(mt,bt.max),bt.pts2=vt.filter(st),p.push(bt)}}D._extremes[N._id]=y.findExtremes(N,[J,mt],{padded:!0})}else{var ye=N.makeCalcdata(D,B),ue=l(tt,ht),Mt=tt.length,Ot=o(Mt);for(C=0;C=0&&Lt0){if(bt={},bt.pos=bt[V]=tt[C],vt=bt.pts=Ot[C].sort(m),ut=bt[B]=vt.map(b),rt=ut.length,bt.min=ut[0],bt.max=ut[rt-1],bt.mean=P.mean(ut,rt),bt.sd=P.stdev(ut,rt,bt.mean)*D.sdmultiple,bt.med=P.interp(ut,.5),rt%2&&(Le||Ze)){var Qe,mr;Le?(Qe=ut.slice(0,rt/2),mr=ut.slice(rt/2+1)):Ze&&(Qe=ut.slice(0,rt/2+1),mr=ut.slice(rt/2)),bt.q1=P.interp(Qe,.5),bt.q3=P.interp(mr,.5)}else bt.q1=P.interp(ut,.25),bt.q3=P.interp(ut,.75);bt.lf=x(bt,ut,rt),bt.uf=_(bt,ut,rt),bt.lo=A(bt),bt.uo=d(bt);var fr=k(bt,rt);bt.ln=bt.med-fr,bt.un=bt.med+fr,ie=Math.min(ie,bt.ln),be=Math.max(be,bt.un),bt.pts2=vt.filter(st),p.push(bt)}D.notched&&P.isTypedArray(ye)&&(ye=Array.from(ye)),D._extremes[N._id]=y.findExtremes(N,D.notched?ye.concat([ie,be]):ye,{padded:!0})}return h(p,D),p.length>0?(p[0].t={num:E[g],dPos:ht,posLetter:V,valLetter:B,labels:{med:i(w,"median:"),min:i(w,"min:"),q1:i(w,"q1:"),q3:i(w,"q3:"),max:i(w,"max:"),mean:D.boxmean==="sd"||D.sizemode==="sd"?i(w,"mean ± σ:").replace("σ",D.sdmultiple===1?"σ":D.sdmultiple+"σ"):i(w,"mean:"),lf:i(w,"lower fence:"),uf:i(w,"upper fence:")}},E[g]++,p):[{t:{empty:!0}}]};function a(w,D,E,I){var M=D in w,p=D+"0"in w,g="d"+D in w;if(M||p&&g){var C=E.makeCalcdata(w,D),S=z(w,E,D,C).vals;return[S,C]}var N;p?N=w[D+"0"]:"name"in w&&(E.type==="category"||f(w.name)&&["linear","log"].indexOf(E.type)!==-1||P.isDateTime(w.name)&&E.type==="date")?N=w.name:N=I;for(var B=E.type==="multicategory"?E.r2c_just_indices(N):E.d2c(N,0,w[D+"calendar"]),U=w._length,V=new Array(U),W=0;W{var f=Fs(),y=jn(),z=iy().getAxisGroup,P=["v","h"];function n(a,l){for(var o=a.calcdata,c=l.xaxis,s=l.yaxis,h=0;h1,p=1-h[a+"gap"],g=1-h[a+"groupgap"];for(x=0;x0;if(B==="positive"?(vt=U*(N?1:.5),gt=rt,ut=gt=W):B==="negative"?(vt=gt=W,ut=U*(N?1:.5),it=rt):(vt=ut=U,gt=it=rt),dt){var Ct=C.pointpos,Rt=C.jitter,Bt=C.marker.size/2,Zt=0;Ct+Rt>=0&&(Zt=rt*(Ct+Rt),Zt>vt?(mt=!0,ot=Bt,st=Zt):Zt>gt&&(ot=Bt,st=vt)),Zt<=vt&&(st=vt);var Gt=0;Ct-Rt<=0&&(Gt=-rt*(Ct-Rt),Gt>ut?(mt=!0,J=Bt,xt=Gt):Gt>it&&(J=Bt,xt=ut)),Gt<=ut&&(xt=ut)}else st=vt,xt=ut;var ee=new Array(A.length);for(_=0;_{var f=Br(),y=jn(),z=Js(),P=5,n=.01;function i(c,s,h,m){var b=c._context.staticPlot,x=s.xaxis,_=s.yaxis;y.makeTraceGroups(m,h,"trace boxes").each(function(A){var d=f.select(this),k=A[0],w=k.t,D=k.trace;if(w.wdPos=w.bdPos*D.whiskerwidth,D.visible!==!0||w.empty){d.remove();return}var E,I;D.orientation==="h"?(E=_,I=x):(E=x,I=_),a(d,{pos:E,val:I},D,w,b),l(d,{x,y:_},D,w),o(d,{pos:E,val:I},D,w)})}function a(c,s,h,m,b){var x=h.orientation==="h",_=s.val,A=s.pos,d=!!A.rangebreaks,k=m.bPos,w=m.wdPos||0,D=m.bPosPxOffset||0,E=h.whiskerwidth||0,I=h.showwhiskers!==!1,M=h.notched||!1,p=M?1-2*h.notchwidth:1,g,C;Array.isArray(m.bdPos)?(g=m.bdPos[0],C=m.bdPos[1]):(g=m.bdPos,C=m.bdPos);var S=c.selectAll("path.box").data(h.type!=="violin"||h.box.visible?y.identity:[]);S.enter().append("path").style("vector-effect",b?"none":"non-scaling-stroke").attr("class","box"),S.exit().remove(),S.each(function(N){if(N.empty)return f.select(this).attr("d","M0,0Z");var B=A.c2l(N.pos+k,!0),U=A.l2p(B-g)+D,V=A.l2p(B+C)+D,W=d?(U+V)/2:A.l2p(B)+D,F=h.whiskerwidth,H=d?U*F+(1-F)*W:A.l2p(B-w)+D,q=d?V*F+(1-F)*W:A.l2p(B+w)+D,G=A.l2p(B-g*p)+D,tt=A.l2p(B+C*p)+D,ht=h.sizemode==="sd",bt=_.c2p(ht?N.mean-N.sd:N.q1,!0),vt=ht?_.c2p(N.mean+N.sd,!0):_.c2p(N.q3,!0),ut=y.constrain(ht?_.c2p(N.mean,!0):_.c2p(N.med,!0),Math.min(bt,vt)+1,Math.max(bt,vt)-1),rt=N.lf===void 0||h.boxpoints===!1||ht,gt=_.c2p(rt?N.min:N.lf,!0),it=_.c2p(rt?N.max:N.uf,!0),st=_.c2p(N.ln,!0),xt=_.c2p(N.un,!0);x?f.select(this).attr("d","M"+ut+","+G+"V"+tt+"M"+bt+","+U+"V"+V+(M?"H"+st+"L"+ut+","+tt+"L"+xt+","+V:"")+"H"+vt+"V"+U+(M?"H"+xt+"L"+ut+","+G+"L"+st+","+U:"")+"Z"+(I?"M"+bt+","+W+"H"+gt+"M"+vt+","+W+"H"+it+(E===0?"":"M"+gt+","+H+"V"+q+"M"+it+","+H+"V"+q):"")):f.select(this).attr("d","M"+G+","+ut+"H"+tt+"M"+U+","+bt+"H"+V+(M?"V"+st+"L"+tt+","+ut+"L"+V+","+xt:"")+"V"+vt+"H"+U+(M?"V"+xt+"L"+G+","+ut+"L"+U+","+st:"")+"Z"+(I?"M"+W+","+bt+"V"+gt+"M"+W+","+vt+"V"+it+(E===0?"":"M"+H+","+gt+"H"+q+"M"+H+","+it+"H"+q):""))})}function l(c,s,h,m){var b=s.x,x=s.y,_=m.bdPos,A=m.bPos,d=h.boxpoints||h.points;y.seedPseudoRandom();var k=function(E){return E.forEach(function(I){I.t=m,I.trace=h}),E},w=c.selectAll("g.points").data(d?k:[]);w.enter().append("g").attr("class","points"),w.exit().remove();var D=w.selectAll("path").data(function(E){var I,M=E.pts2,p=Math.max((E.max-E.min)/10,E.q3-E.q1),g=p*1e-9,C=p*n,S=[],N=0,B;if(h.jitter){if(p===0)for(N=1,S=new Array(M.length),I=0;IE.lo&&(q.so=!0)}return M});D.enter().append("path").classed("point",!0),D.exit().remove(),D.call(z.translatePoints,b,x)}function o(c,s,h,m){var b=s.val,x=s.pos,_=!!x.rangebreaks,A=m.bPos,d=m.bPosPxOffset||0,k=h.boxmean||(h.meanline||{}).visible,w,D;Array.isArray(m.bdPos)?(w=m.bdPos[0],D=m.bdPos[1]):(w=m.bdPos,D=m.bdPos);var E=c.selectAll("path.mean").data(h.type==="box"&&h.boxmean||h.type==="violin"&&h.box.visible&&h.meanline.visible?y.identity:[]);E.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),E.exit().remove(),E.each(function(I){var M=x.c2l(I.pos+A,!0),p=x.l2p(M-w)+d,g=x.l2p(M+D)+d,C=_?(p+g)/2:x.l2p(M)+d,S=b.c2p(I.mean,!0),N=b.c2p(I.mean-I.sd,!0),B=b.c2p(I.mean+I.sd,!0);h.orientation==="h"?f.select(this).attr("d","M"+S+","+p+"V"+g+(k==="sd"?"m0,0L"+N+","+C+"L"+S+","+p+"L"+B+","+C+"Z":"")):f.select(this).attr("d","M"+p+","+S+"H"+g+(k==="sd"?"m0,0L"+C+","+N+"L"+p+","+S+"L"+C+","+B+"Z":""))})}Y.exports={plot:i,plotBoxAndWhiskers:a,plotPoints:l,plotBoxMean:o}}),j8=It((et,Y)=>{var f=Br(),y=Hn(),z=Js();function P(i,a,l){var o=l||f.select(i).selectAll("g.trace.boxes");o.style("opacity",function(c){return c[0].trace.opacity}),o.each(function(c){var s=f.select(this),h=c[0].trace,m=h.line.width;function b(A,d,k,w){A.style("stroke-width",d+"px").call(y.stroke,k).call(y.fill,w)}var x=s.selectAll("path.box");if(h.type==="candlestick")x.each(function(A){if(!A.empty){var d=f.select(this),k=h[A.dir];b(d,k.line.width,k.line.color,k.fillcolor),d.style("opacity",h.selectedpoints&&!A.selected?.3:1)}});else{b(x,m,h.line.color,h.fillcolor),s.selectAll("path.mean").style({"stroke-width":m,"stroke-dasharray":2*m+"px,"+m+"px"}).call(y.stroke,h.line.color);var _=s.selectAll("path.point");z.pointStyle(_,h,i)}})}function n(i,a,l){var o=a[0].trace,c=l.selectAll("path.point");o.selectedpoints?z.selectedPointStyle(c,o):z.pointStyle(c,o,i)}Y.exports={style:P,styleOnSelect:n}}),qL=It((et,Y)=>{var f=Fs(),y=jn(),z=hd(),P=Hn(),n=y.fillText;function i(o,c,s,h){var m=o.cd,b=m[0].trace,x=b.hoveron,_=[],A;return x.indexOf("boxes")!==-1&&(_=_.concat(a(o,c,s,h))),x.indexOf("points")!==-1&&(A=l(o,c,s)),h==="closest"?A?[A]:_:(A&&_.push(A),_)}function a(o,c,s,h){var m=o.cd,b=o.xa,x=o.ya,_=m[0].trace,A=m[0].t,d=_.type==="violin",k,w,D,E,I,M,p,g,C,S,N,B=A.bdPos,U,V,W=A.wHover,F=function(Gt){return D.c2l(Gt.pos)+A.bPos-D.c2l(M)};d&&_.side!=="both"?(_.side==="positive"&&(C=function(Gt){var ee=F(Gt);return z.inbox(ee,ee+W,S)},U=B,V=0),_.side==="negative"&&(C=function(Gt){var ee=F(Gt);return z.inbox(ee-W,ee,S)},U=0,V=B)):(C=function(Gt){var ee=F(Gt);return z.inbox(ee-W,ee+W,S)},U=V=B);var H;d?H=function(Gt){return z.inbox(Gt.span[0]-I,Gt.span[1]-I,S)}:H=function(Gt){return z.inbox(Gt.min-I,Gt.max-I,S)},_.orientation==="h"?(I=c,M=s,p=H,g=C,k="y",D=x,w="x",E=b):(I=s,M=c,p=C,g=H,k="x",D=b,w="y",E=x);var q=Math.min(1,B/Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0])));S=o.maxHoverDistance-q,N=o.maxSpikeDistance-q;function G(Gt){return(p(Gt)+g(Gt))/2}var tt=z.getDistanceFunction(h,p,g,G);if(z.getClosest(m,tt,o),o.index===!1)return[];var ht=m[o.index],bt=_.line.color,vt=(_.marker||{}).color;P.opacity(bt)&&_.line.width?o.color=bt:P.opacity(vt)&&_.boxpoints?o.color=vt:o.color=_.fillcolor,o[k+"0"]=D.c2p(ht.pos+A.bPos-V,!0),o[k+"1"]=D.c2p(ht.pos+A.bPos+U,!0),o[k+"LabelVal"]=ht.orig_p!==void 0?ht.orig_p:ht.pos;var ut=k+"Spike";o.spikeDistance=G(ht)*N/S,o[ut]=D.c2p(ht.pos,!0);var rt=_.boxmean||_.sizemode==="sd"||(_.meanline||{}).visible,gt=_.boxpoints||_.points,it=gt&&rt?["max","uf","q3","med","mean","q1","lf","min"]:gt&&!rt?["max","uf","q3","med","q1","lf","min"]:!gt&&rt?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],st=E.range[1]{Y.exports=function(f,y){return y.hoverOnBox&&(f.hoverOnBox=y.hoverOnBox),"xVal"in y&&(f.x=y.xVal),"yVal"in y&&(f.y=y.yVal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f}}),GL=It((et,Y)=>{Y.exports=function(f,y){var z=f.cd,P=f.xaxis,n=f.yaxis,i=[],a,l;if(y===!1)for(a=0;a{Y.exports={attributes:K4(),layoutAttributes:Y4(),supplyDefaults:X4().supplyDefaults,crossTraceDefaults:X4().crossTraceDefaults,supplyLayoutDefaults:R8().supplyLayoutDefaults,calc:WL(),crossTraceCalc:F8().crossTraceCalc,plot:N8().plot,style:j8().style,styleOnSelect:j8().styleOnSelect,hoverPoints:qL().hoverPoints,eventData:Fq(),selectPoints:GL(),moduleType:"trace",name:"box",basePlotModule:Fd(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),jq=It((et,Y)=>{Y.exports=Nq()}),zw=It((et,Y)=>{var f=Ru(),{extendFlat:y}=Yn(),z=xa(),{axisHoverFormat:P}=Sh(),n=hi(),{hovertemplateAttrs:i,templatefallbackAttrs:a,texttemplateAttrs:l}=nu(),o=dd();Y.exports=y({z:{valType:"data_array",editType:"calc"},x:y({},o.x,{impliedEdits:{xtype:"array"}}),x0:y({},o.x0,{impliedEdits:{xtype:"scaled"}}),dx:y({},o.dx,{impliedEdits:{xtype:"scaled"}}),y:y({},o.y,{impliedEdits:{ytype:"array"}}),y0:y({},o.y0,{impliedEdits:{ytype:"scaled"}}),dy:y({},o.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:y({},o.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:y({},o.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:y({},o.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:y({},o.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:y({},o.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:y({},o.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:i(),hovertemplatefallback:a(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:a({editType:"plot"}),textfont:n({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:y({},z.showlegend,{dflt:!1}),zorder:o.zorder},f("",{cLetter:"z",autoColorDflt:!1}))}),U8=It((et,Y)=>{var f=Sr(),y=jn(),z=ls();Y.exports=function(i,a,l,o,c,s){var h=l("z");c=c||"x",s=s||"y";var m,b;if(h===void 0||!h.length)return 0;if(y.isArray1D(h)){m=l(c),b=l(s);var x=y.minRowLength(m),_=y.minRowLength(b);if(x===0||_===0)return 0;a._length=Math.min(x,_,h.length)}else{if(m=P(c,l),b=P(s,l),!n(h))return 0;l("transpose"),a._length=null}var A=z.getComponentMethod("calendars","handleTraceDefaults");return A(i,a,[c,s],o),!0};function P(i,a){var l=a(i),o=l?a(i+"type","array"):"scaled";return o==="scaled"&&(a(i+"0"),a("d"+i)),l}function n(i){for(var a=!0,l=!1,o=!1,c,s=0;s0&&(l=!0);for(var h=0;h{var f=jn();Y.exports=function(y,z){y("texttemplate"),y("texttemplatefallback");var P=f.extendFlat({},z.font,{color:"auto",size:"auto"});f.coerceFont(y,"textfont",P)}}),ZL=It((et,Y)=>{Y.exports=function(f,y,z){var P=z("zsmooth");P===!1&&(z("xgap"),z("ygap")),z("zhoverformat")}}),Uq=It((et,Y)=>{var f=jn(),y=U8(),z=J4(),P=S0(),n=ZL(),i=Cu(),a=zw();Y.exports=function(l,o,c,s){function h(b,x){return f.coerce(l,o,a,b,x)}var m=y(l,o,h,s);if(!m){o.visible=!1;return}P(l,o,s,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),z(h,s),n(l,o,h,s),h("hoverongaps"),h("connectgaps",f.isArray1D(o.z)&&o.zsmooth!==!1),i(l,o,s,h,{prefix:"",cLetter:"z"}),h("zorder")}}),KL=It((et,Y)=>{var f=Sr();Y.exports={count:function(y,z,P){return P[y]++,1},sum:function(y,z,P,n){var i=n[z];return f(i)?(i=Number(i),P[y]+=i,i):0},avg:function(y,z,P,n,i){var a=n[z];return f(a)&&(a=Number(a),P[y]+=a,i[y]++),0},min:function(y,z,P,n){var i=n[z];if(f(i))if(i=Number(i),f(P[y])){if(P[y]>i){var a=i-P[y];return P[y]=i,a}}else return P[y]=i,i;return 0},max:function(y,z,P,n){var i=n[z];if(f(i))if(i=Number(i),f(P[y])){if(P[y]{Y.exports={percent:function(f,y){for(var z=f.length,P=100/y,n=0;n{Y.exports=function(f,y){for(var z=f.length,P=0,n=0;n{var f=Dr(),y=f.ONEAVGYEAR,z=f.ONEAVGMONTH,P=f.ONEDAY,n=f.ONEHOUR,i=f.ONEMIN,a=f.ONESEC,l=Fs().tickIncrement;Y.exports=function(m,b,x,_,A){var d=-1.1*b,k=-.1*b,w=m-k,D=x[0],E=x[1],I=Math.min(o(D+k,D+w,_,A),o(E+k,E+w,_,A)),M=Math.min(o(D+d,D+k,_,A),o(E+d,E+k,_,A)),p,g;if(I>M&&MP){var C=p===y?1:6,S=p===y?"M12":"M1";return function(N,B){var U=_.c2d(N,y,A),V=U.indexOf("-",C);V>0&&(U=U.substr(0,V));var W=_.d2c(U,0,A);if(Wa?m>P?m>y*1.1?y:m>z*1.1?z:P:m>n?n:m>i?i:a:Math.pow(10,Math.floor(Math.log(m)/Math.LN10))}function s(m,b,x,_,A,d){if(_&&m>P){var k=h(b,A,d),w=h(x,A,d),D=m===y?0:1;return k[D]!==w[D]}return Math.floor(x/m)-Math.floor(b/m)>.1}function h(m,b,x){var _=b.c2d(m,y,x).split("-");return _[0]===""&&(_.unshift(),_[0]="-"+_[0]),_}}),QL=It((et,Y)=>{var f=Sr(),y=jn(),z=ls(),P=Fs(),{hasColorscale:n}=fp(),i=Cp(),a=Z4(),l=KL(),o=YL(),c=XL(),s=JL();function h(A,d){var k=[],w=[],D=d.orientation==="h",E=P.getFromId(A,D?d.yaxis:d.xaxis),I=D?"y":"x",M={x:"y",y:"x"}[I],p=d[I+"calendar"],g=d.cumulative,C,S=m(A,d,E,I),N=S[0],B=S[1],U=typeof N.size=="string",V=[],W=U?V:N,F=[],H=[],q=[],G=0,tt=d.histnorm,ht=d.histfunc,bt=tt.indexOf("density")!==-1,vt,ut,rt;g.enabled&&bt&&(tt=tt.replace(/ ?density$/,""),bt=!1);var gt=ht==="max"||ht==="min",it=gt?null:0,st=l.count,xt=o[tt],ot=!1,J=function(ie){return E.r2c(ie,0,p)},mt;for(y.isArrayOrTypedArray(d[M])&&ht!=="count"&&(mt=d[M],ot=ht==="avg",st=l[ht]),C=J(N.start),ut=J(N.end)+(C-P.tickIncrement(C,N.size,!1,p))/1e6;C=0&&rt=Mt;C--)if(w[C]){Ot=C;break}for(C=Mt;C<=Ot;C++)if(f(k[C])&&f(w[C])){var Lt={p:k[C],s:w[C],b:0};g.enabled||(Lt.pts=q[C],Bt?Lt.ph0=Lt.ph1=q[C].length?B[q[C][0]]:k[C]:(d._computePh=!0,Lt.ph0=ge(V[C]),Lt.ph1=ge(V[C+1],!0))),ue.push(Lt)}return ue.length===1&&(ue[0].width1=P.tickIncrement(ue[0].p,N.size,!1,p)-ue[0].p),n(d,"marker")&&i(A,d,{vals:d.marker.color,containerStr:"marker",cLetter:"c"}),n(d,"marker.line")&&i(A,d,{vals:d.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(ue,d),y.isArrayOrTypedArray(d.selectedpoints)&&y.tagSelected(ue,d,ee),ue}function m(A,d,k,w,D){var E=w+"bins",I=A._fullLayout,M=d["_"+w+"bingroup"],p=I._histogramBinOpts[M],g=I.barmode==="overlay",C,S,N,B,U,V,W,F=function(xe){return k.r2c(xe,0,B)},H=function(xe){return k.c2r(xe,0,B)},q=k.type==="date"?function(xe){return xe||xe===0?y.cleanDate(xe,null,B):null}:function(xe){return f(xe)?Number(xe):null};function G(xe,ge,ye){ge[xe+"Found"]?(ge[xe]=q(ge[xe]),ge[xe]===null&&(ge[xe]=ye[xe])):(V[xe]=ge[xe]=ye[xe],y.nestedProperty(S[0],E+"."+xe).set(ye[xe]))}if(d["_"+w+"autoBinFinished"])delete d["_"+w+"autoBinFinished"];else{S=p.traces;var tt=[],ht=!0,bt=!1,vt=!1;for(C=0;C"u"){if(D)return[rt,U,!0];rt=b(A,d,k,w,E)}W=N.cumulative||{},W.enabled&&W.currentbin!=="include"&&(W.direction==="decreasing"?rt.start=H(P.tickIncrement(F(rt.start),rt.size,!0,B)):rt.end=H(P.tickIncrement(F(rt.end),rt.size,!1,B))),p.size=rt.size,p.sizeFound||(V.size=rt.size,y.nestedProperty(S[0],E+".size").set(rt.size)),G("start",p,rt),G("end",p,rt)}U=d["_"+w+"pos0"],delete d["_"+w+"pos0"];var it=d._input[E]||{},st=y.extendFlat({},p),xt=p.start,ot=k.r2l(it.start),J=ot!==void 0;if((p.startFound||J)&&ot!==k.r2l(xt)){var mt=J?ot:y.aggNums(Math.min,null,U),dt={type:k.type==="category"||k.type==="multicategory"?"linear":k.type,r2l:k.r2l,dtick:p.size,tick0:xt,calendar:B,range:[mt,P.tickIncrement(mt,p.size,!1,B)].map(k.l2r)},Ct=P.tickFirst(dt);Ct>k.r2l(mt)&&(Ct=P.tickIncrement(Ct,p.size,!0,B)),st.start=k.l2r(Ct),J||y.nestedProperty(d,E+".start").set(st.start)}var Rt=p.end,Bt=k.r2l(it.end),Zt=Bt!==void 0;if((p.endFound||Zt)&&Bt!==k.r2l(Rt)){var Gt=Zt?Bt:y.aggNums(Math.max,null,U);st.end=k.l2r(Gt),Zt||y.nestedProperty(d,E+".start").set(st.end)}var ee="autobin"+w;return d._input[ee]===!1&&(d._input[E]=y.extendFlat({},d[E]||{}),delete d._input[ee],delete d[ee]),[st,U]}function b(A,d,k,w,D){var E=A._fullLayout,I=x(A,d),M=!1,p=1/0,g=[d],C,S,N;for(C=0;C=0;w--)M(w);else if(d==="increasing"){for(w=1;w=0;w--)A[w]+=A[w+1];k==="exclude"&&(A.push(0),A.shift())}}Y.exports={calc:h,calcAllAutoBins:m}}),$q=It((et,Y)=>{var f=jn(),y=Fs(),z=KL(),P=YL(),n=XL(),i=JL(),a=QL().calcAllAutoBins;Y.exports=function(s,h){var m=y.getFromId(s,h.xaxis),b=y.getFromId(s,h.yaxis),x=h.xcalendar,_=h.ycalendar,A=function(Oe){return m.r2c(Oe,0,x)},d=function(Oe){return b.r2c(Oe,0,_)},k=function(Oe){return m.c2r(Oe,0,x)},w=function(Oe){return b.c2r(Oe,0,_)},D,E,I,M,p=a(s,h,m,"x"),g=p[0],C=p[1],S=a(s,h,b,"y"),N=S[0],B=S[1],U=h._length;C.length>U&&C.splice(U,C.length-U),B.length>U&&B.splice(U,B.length-U);var V=[],W=[],F=[],H=typeof g.size=="string",q=typeof N.size=="string",G=[],tt=[],ht=H?G:g,bt=q?tt:N,vt=0,ut=[],rt=[],gt=h.histnorm,it=h.histfunc,st=gt.indexOf("density")!==-1,xt=it==="max"||it==="min",ot=xt?null:0,J=z.count,mt=P[gt],dt=!1,Ct=[],Rt=[],Bt="z"in h?h.z:"marker"in h&&Array.isArray(h.marker.color)?h.marker.color:"";Bt&&it!=="count"&&(dt=it==="avg",J=z[it]);var Zt=g.size,Gt=A(g.start),ee=A(g.end)+(Gt-y.tickIncrement(Gt,Zt,!1,x))/1e6;for(D=Gt;D=0&&I=0&&M{var f=jn(),y=Dr().BADNUM,z=Im();Y.exports=function(P,n,i,a,l,o){var c=P._length,s=n.makeCalcdata(P,a),h=i.makeCalcdata(P,l);s=z(P,n,a,s).vals,h=z(P,i,l,h).vals;var m=P.text,b=m!==void 0&&f.isArray1D(m),x=P.hovertext,_=x!==void 0&&f.isArray1D(x),A,d,k=f.distinctVals(s),w=k.vals,D=f.distinctVals(h),E=D.vals,I=[],M,p,g=E.length,C=w.length;for(A=0;A{var f=Sr(),y=jn(),z=Dr().BADNUM;Y.exports=function(P,n,i,a){var l,o,c,s,h,m;function b(w){if(f(w))return+w}if(n&&n.transpose){for(l=0,h=0;h{var f=jn(),y=.01,z=[[-1,0],[1,0],[0,-1],[0,1]];function P(i){return .5-.25*Math.min(1,i*.5)}Y.exports=function(i,a){var l=1,o;for(n(i,a),o=0;oy;o++)l=n(i,a,P(l));return l>y&&f.log("interp2d didn't converge quickly",l),i};function n(i,a,l){var o=0,c,s,h,m,b,x,_,A,d,k,w,D,E;for(m=0;mD&&(o=Math.max(o,Math.abs(i[s][h]-w)/(E-D))))}return o}}),W8=It((et,Y)=>{var f=jn().maxRowLength;Y.exports=function(y){var z=[],P={},n=[],i=y[0],a=[],l=[0,0,0],o=f(y),c,s,h,m,b,x,_,A;for(s=0;s=0;b--)m=n[b],s=m[0],h=m[1],x=((P[[s-1,h]]||l)[2]+(P[[s+1,h]]||l)[2]+(P[[s,h-1]]||l)[2]+(P[[s,h+1]]||l)[2])/20,x&&(_[m]=[s,h,x],n.splice(b,1),A=!0);if(!A)throw"findEmpties iterated with no new neighbors";for(m in _)P[m]=_[m],z.push(_[m])}return z.sort(function(d,k){return k[2]-d[2]})}}),tP=It((et,Y)=>{var f=ls(),y=jn().isArrayOrTypedArray;Y.exports=function(z,P,n,i,a,l){var o=[],c=f.traceIs(z,"contour"),s=f.traceIs(z,"histogram"),h,m,b,x=y(P)&&P.length>1;if(x&&!s&&l.type!=="category"){var _=P.length;if(_<=a){if(c)o=Array.from(P).slice(0,a);else if(a===1)l.type==="log"?o=[.5*P[0],2*P[0]]:o=[P[0]-.5,P[0]+.5];else if(l.type==="log"){for(o=[Math.pow(P[0],1.5)/Math.pow(P[1],.5)],b=1;b<_;b++)o.push(Math.sqrt(P[b-1]*P[b]));o.push(Math.pow(P[_-1],1.5)/Math.pow(P[_-2],.5))}else{for(o=[1.5*P[0]-.5*P[1]],b=1;b<_;b++)o.push((P[b-1]+P[b])*.5);o.push(1.5*P[_-1]-.5*P[_-2])}if(_{var f=ls(),y=jn(),z=Fs(),P=Im(),n=$q(),i=Cp(),a=$8(),l=H8(),o=V8(),c=W8(),s=tP(),h=Dr().BADNUM;Y.exports=function(x,_){var A=z.getFromId(x,_.xaxis||"x"),d=z.getFromId(x,_.yaxis||"y"),k=f.traceIs(_,"contour"),w=f.traceIs(_,"histogram"),D=k?"best":_.zsmooth,E,I,M,p,g,C,S,N,B,U,V;if(A._minDtick=0,d._minDtick=0,w)V=n(x,_),p=V.orig_x,E=V.x,I=V.x0,M=V.dx,N=V.orig_y,g=V.y,C=V.y0,S=V.dy,B=V.z;else{var W=_.z;y.isArray1D(W)?(a(_,A,d,"x","y",["z"]),E=_._x,g=_._y,W=_._z):(p=_.x?A.makeCalcdata(_,"x"):[],N=_.y?d.makeCalcdata(_,"y"):[],E=P(_,A,"x",p).vals,g=P(_,d,"y",N).vals,_._x=E,_._y=g),I=_.x0,M=_.dx,C=_.y0,S=_.dy,B=l(W,_,A,d)}(A.rangebreaks||d.rangebreaks)&&(B=b(E,g,B),w||(E=m(E),g=m(g),_._x=E,_._y=g)),!w&&(k||_.connectgaps)&&(_._emptypoints=c(B),o(B,_._emptypoints));function F(rt){D=_._input.zsmooth=_.zsmooth=!1,y.warn('cannot use zsmooth: "fast": '+rt)}function H(rt){if(rt.length>1){var gt=(rt[rt.length-1]-rt[0])/(rt.length-1),it=Math.abs(gt/100);for(U=0;Uit)return!1}return!0}_._islinear=!1,A.type==="log"||d.type==="log"?D==="fast"&&F("log axis found"):H(E)?H(g)?_._islinear=!0:D==="fast"&&F("y scale is not linear"):D==="fast"&&F("x scale is not linear");var q=y.maxRowLength(B),G=_.xtype==="scaled"?"":E,tt=s(_,G,I,M,q,A),ht=_.ytype==="scaled"?"":g,bt=s(_,ht,C,S,B.length,d);_._extremes[A._id]=z.findExtremes(A,tt),_._extremes[d._id]=z.findExtremes(d,bt);var vt={x:tt,y:bt,z:B,text:_._text||_.text,hovertext:_._hovertext||_.hovertext};if(_.xperiodalignment&&p&&(vt.orig_x=p),_.yperiodalignment&&N&&(vt.orig_y=N),G&&G.length===tt.length-1&&(vt.xCenter=G),ht&&ht.length===bt.length-1&&(vt.yCenter=ht),w&&(vt.xRanges=V.xRanges,vt.yRanges=V.yRanges,vt.pts=V.pts),k||i(x,_,{vals:B,cLetter:"z"}),k&&_.contours&&_.contours.coloring==="heatmap"){var ut={type:_.type==="contour"?"heatmap":"histogram2d",xcalendar:_.xcalendar,ycalendar:_.ycalendar};vt.xfill=s(ut,G,I,M,q,A),vt.yfill=s(ut,ht,C,S,B.length,d)}return[vt]};function m(x){for(var _=[],A=x.length,d=0;d{et.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],et.STYLE=et.CSS_DECLARATIONS.map(function(Y){return Y.join(": ")+"; "}).join("")}),eP=It((et,Y)=>{var f=G8(),y=Js(),z=jn(),P=null;function n(){if(P!==null)return P;P=!1;var i=z.isSafari()||z.isMacWKWebView()||z.isIOS();if(window.navigator.userAgent&&!i){var a=Array.from(f.CSS_DECLARATIONS).reverse(),l=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof l=="function")P=a.some(function(h){return l.apply(null,h)});else{var o=y.tester.append("image").attr("style",f.STYLE),c=window.getComputedStyle(o.node()),s=c.imageRendering;P=a.some(function(h){var m=h[1];return s===m||s===m.toLowerCase()}),o.remove()}}return P}Y.exports=n}),Z8=It((et,Y)=>{var f=Br(),y=Xi(),z=ls(),P=Js(),n=Fs(),i=jn(),a=uu(),l=tl(),o=Hn(),c=ch().extractOpts,s=ch().makeColorScaleFuncFromTrace,h=k0(),m=Rd(),b=m.LINE_SPACING,x=eP(),_=G8().STYLE,A="heatmap-label";function d(I){return I.selectAll("g."+A)}function k(I){d(I).remove()}Y.exports=function(I,M,p,g){var C=M.xaxis,S=M.yaxis;i.makeTraceGroups(g,p,"hm").each(function(N){var B=f.select(this),U=N[0],V=U.trace,W=V.xgap||0,F=V.ygap||0,H=U.z,q=U.x,G=U.y,tt=U.xCenter,ht=U.yCenter,bt=z.traceIs(V,"contour"),vt=bt?"best":V.zsmooth,ut=H.length,rt=i.maxRowLength(H),gt=!1,it=!1,st,xt,ot,J,mt,dt,Ct,Rt;for(dt=0;st===void 0&&dt0;)xt=C.c2p(q[dt]),dt--;for(xt0;)mt=S.c2p(G[dt]),dt--;mt=C._length||xt<=0||J>=S._length||mt<=0;if(xe){var ge=B.selectAll("image").data([]);ge.exit().remove(),k(B);return}var ye,ue;Bt==="fast"?(ye=rt,ue=ut):(ye=Gt,ue=ee);var Mt=document.createElement("canvas");Mt.width=ye,Mt.height=ue;var Ot=Mt.getContext("2d",{willReadFrequently:!0}),Lt=s(V,{noNumericCheck:!0,returnArray:!0}),ie,be;Bt==="fast"?(ie=gt?function(pi){return rt-1-pi}:i.identity,be=it?function(pi){return ut-1-pi}:i.identity):(ie=function(pi){return i.constrain(Math.round(C.c2p(q[pi])-st),0,Gt)},be=function(pi){return i.constrain(Math.round(S.c2p(G[pi])-J),0,ee)});var ce=be(0),Le=[ce,ce],Ze=gt?0:1,Qe=it?0:1,mr=0,fr=0,Jr=0,an=0,Er,dn,_n,Oe,Xt;function oe(pi,Va){if(pi!==void 0){var ea=Lt(pi);return ea[0]=Math.round(ea[0]),ea[1]=Math.round(ea[1]),ea[2]=Math.round(ea[2]),mr+=Va,fr+=ea[0]*Va,Jr+=ea[1]*Va,an+=ea[2]*Va,ea}return[0,0,0,0]}function zt(pi,Va,ea,go){var mo=pi[ea.bin0];if(mo===void 0)return oe(void 0,1);var Go=pi[ea.bin1],Lo=Va[ea.bin0],Zo=Va[ea.bin1],Ka=Go-mo||0,Cs=Lo-mo||0,ps;return Go===void 0?Zo===void 0?ps=0:Lo===void 0?ps=2*(Zo-mo):ps=(2*Zo-Lo-mo)*2/3:Zo===void 0?Lo===void 0?ps=0:ps=(2*mo-Go-Lo)*2/3:Lo===void 0?ps=(2*Zo-Go-mo)*2/3:ps=Zo+mo-Go-Lo,oe(mo+ea.frac*Ka+go.frac*(Cs+ea.frac*ps))}if(Bt!=="default"){var _t=0,Pt;try{Pt=new Uint8Array(ye*ue*4)}catch{Pt=new Array(ye*ue*4)}if(Bt==="smooth"){var Ht=tt||q,ae=ht||G,he=new Array(Ht.length),Me=new Array(ae.length),qe=new Array(Gt),Ye=tt?D:w,ur=ht?D:w,Rr,zr,xr;for(dt=0;dtFi||Fi>S._length))for(Ct=Zn;CtJi||Ji>C._length)){var ca=l({x:Zi,y:Li},V,I._fullLayout);ca.x=Zi,ca.y=Li;var Ei=U.z[dt][Ct];Ei===void 0?(ca.z="",ca.zLabel=""):(ca.z=Ei,ca.zLabel=n.tickText(Ke,Ei,"hover").text);var Ga=U.text&&U.text[dt]&&U.text[dt][Ct];(Ga===void 0||Ga===!1)&&(Ga=""),ca.text=Ga;var so=i.texttemplateString({data:[ca,V._meta],fallback:V.texttemplatefallback,labels:ca,locale:I._fullLayout._d3locale,template:ba});if(so){var Fe=so.split("
"),Re=Fe.length,Kr=0;for(Rt=0;Rt{Y.exports={min:"zmin",max:"zmax"}}),K8=It((et,Y)=>{var f=Br();Y.exports=function(y){f.select(y).selectAll(".hm image").style("opacity",function(z){return z.trace.opacity})}}),Y8=It((et,Y)=>{var f=hd(),y=jn(),z=y.isArrayOrTypedArray,P=Fs(),n=ch().extractOpts;Y.exports=function(i,a,l,o,c){c||(c={});var s=c.isContour,h=i.cd[0],m=h.trace,b=i.xa,x=i.ya,_=h.x,A=h.y,d=h.z,k=h.xCenter,w=h.yCenter,D=h.zmask,E=m.zhoverformat,I=_,M=A,p,g,C,S;if(i.index!==!1){try{C=Math.round(i.index[1]),S=Math.round(i.index[0])}catch{y.error("Error hovering on heatmap, pointNumber must be [row,col], found:",i.index);return}if(C<0||C>=d[0].length||S<0||S>d.length)return}else{if(f.inbox(a-_[0],a-_[_.length-1],0)>0||f.inbox(l-A[0],l-A[A.length-1],0)>0)return;if(s){var N;for(I=[2*_[0]-_[1]],N=1;N<_.length;N++)I.push((_[N]+_[N-1])/2);for(I.push([2*_[_.length-1]-_[_.length-2]]),M=[2*A[0]-A[1]],N=1;N{Y.exports={attributes:zw(),supplyDefaults:Uq(),calc:q8(),plot:Z8(),colorbar:z_(),style:K8(),hoverPoints:Y8(),moduleType:"trace",name:"heatmap",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),Vq=It((et,Y)=>{Y.exports=Hq()}),rP=It((et,Y)=>{Y.exports=function(f,y){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),Wq=It((et,Y)=>{Y.exports={eventDataKeys:["binNumber"]}}),X8=It((et,Y)=>{var f=Jv(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=hi(),a=rP(),l=Wq(),o=Yn().extendFlat;Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:y("x"),yhoverformat:y("y"),text:o({},f.text,{}),hovertext:o({},f.hovertext,{}),orientation:f.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:a("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:a("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:n(),texttemplate:P({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:n({editType:"plot"}),textposition:o({},f.textposition,{arrayOk:!1}),textfont:i({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:i({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:i({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:f.insidetextanchor,textangle:f.textangle,cliponaxis:f.cliponaxis,constraintext:f.constraintext,marker:f.marker,offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,selected:f.selected,unselected:f.unselected,zorder:f.zorder}}),qq=It((et,Y)=>{var f=ls(),y=jn(),z=Hn(),P=eg().handleText,n=O8(),i=X8();Y.exports=function(a,l,o,c){function s(M,p){return y.coerce(a,l,i,M,p)}var h=s("x"),m=s("y"),b=s("cumulative.enabled");b&&(s("cumulative.direction"),s("cumulative.currentbin")),s("text");var x=s("textposition");P(a,l,c,s,x,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("xhoverformat"),s("yhoverformat");var _=s("orientation",m&&!h?"h":"v"),A=_==="v"?"x":"y",d=_==="v"?"y":"x",k=h&&m?Math.min(y.minRowLength(h)&&y.minRowLength(m)):y.minRowLength(l[A]||[]);if(!k){l.visible=!1;return}l._length=k;var w=f.getComponentMethod("calendars","handleTraceDefaults");w(a,l,["x","y"],c);var D=l[d];D&&s("histfunc"),s("histnorm"),s("autobin"+A),n(a,l,s,o,c),y.coerceSelectionMarkerOpacity(l,s);var E=(l.marker.line||{}).color,I=f.getComponentMethod("errorbars","supplyDefaults");I(a,l,E||z.defaultLine,{axis:"y"}),I(a,l,E||z.defaultLine,{axis:"x",inherit:"y"}),s("zorder")}}),J8=It((et,Y)=>{var f=jn(),y=Ku(),z=ls().traceIs,P=Xv(),n=eg().validateCornerradius,i=f.nestedProperty,a=iy().getAxisGroup,l=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],o=["x","y"];Y.exports=function(c,s){var h=s._histogramBinOpts={},m=[],b={},x=[],_,A,d,k,w,D,E;function I(bt,vt){return f.coerce(_._input,_,_._module.attributes,bt,vt)}function M(bt){return bt.orientation==="v"?"x":"y"}function p(bt,vt){var ut=y.getFromTrace({_fullLayout:s},bt,vt);return ut.type}function g(bt,vt,ut){var rt=bt.uid+"__"+ut;vt||(vt=rt);var gt=p(bt,ut),it=bt[ut+"calendar"]||"",st=h[vt],xt=!0;st&&(gt===st.axType&&it===st.calendar?(xt=!1,st.traces.push(bt),st.dirs.push(ut)):(vt=rt,gt!==st.axType&&f.warn(["Attempted to group the bins of trace",bt.index,"set on a","type:"+gt,"axis","with bins on","type:"+st.axType,"axis."].join(" ")),it!==st.calendar&&f.warn(["Attempted to group the bins of trace",bt.index,"set with a",it,"calendar","with bins",st.calendar?"on a "+st.calendar+" calendar":"w/o a set calendar"].join(" ")))),xt&&(h[vt]={traces:[bt],dirs:[ut],axType:gt,calendar:bt[ut+"calendar"]||""}),bt["_"+ut+"bingroup"]=vt}for(w=0;w{var f=Iw().hoverPoints,y=Fs().hoverLabelText;Y.exports=function(z,P,n,i,a){var l=f(z,P,n,i,a);if(l){z=l[0];var o=z.cd[z.index],c=z.cd[0].trace;if(!c.cumulative.enabled){var s=c.orientation==="h"?"y":"x";z[s+"Label"]=y(z[s+"a"],[o.ph0,o.ph1],c[s+"hoverformat"])}return l}}}),nP=It((et,Y)=>{Y.exports=function(f,y,z,P,n){if(f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,"zLabelVal"in y&&(f.z=y.zLabelVal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),!(z.cumulative||{}).enabled){var i=Array.isArray(n)?P[0].pts[n[0]][n[1]]:P[n].pts;f.pointNumbers=i,f.binNumber=f.pointNumber,delete f.pointNumber,delete f.pointIndex;var a;if(z._indexToPoints){a=[];for(var l=0;l{Y.exports={attributes:X8(),layoutAttributes:z8(),supplyDefaults:qq(),crossTraceDefaults:J8(),supplyLayoutDefaults:VL(),calc:QL().calc,crossTraceCalc:Wr().crossTraceCalc,plot:vb().plot,layerName:"barlayer",style:Pg().style,styleOnSelect:Pg().styleOnSelect,colorbar:Do(),hoverPoints:Gq(),selectPoints:Dw(),eventData:nP(),moduleType:"trace",name:"histogram",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),Kq=It((et,Y)=>{Y.exports=Zq()}),Q8=It((et,Y)=>{var f=X8(),y=rP(),z=zw(),P=xa(),n=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:l}=nu(),o=Ru(),c=Yn().extendFlat;Y.exports=c({x:f.x,y:f.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:f.histnorm,histfunc:f.histfunc,nbinsx:f.nbinsx,xbins:y("x"),nbinsy:f.nbinsy,ybins:y("y"),autobinx:f.autobinx,autobiny:f.autobiny,bingroup:c({},f.bingroup,{}),xbingroup:c({},f.bingroup,{}),ybingroup:c({},f.bingroup,{}),xgap:z.xgap,ygap:z.ygap,zsmooth:z.zsmooth,xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z",1),hovertemplate:i({},{keys:["z"]}),hovertemplatefallback:l(),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:l({editType:"plot"}),textfont:z.textfont,showlegend:c({},P.showlegend,{dflt:!1})},o("",{cLetter:"z",autoColorDflt:!1}))}),iP=It((et,Y)=>{var f=ls(),y=jn();Y.exports=function(z,P,n,i){var a=n("x"),l=n("y"),o=y.minRowLength(a),c=y.minRowLength(l);if(!o||!c){P.visible=!1;return}P._length=Math.min(o,c);var s=f.getComponentMethod("calendars","handleTraceDefaults");s(z,P,["x","y"],i);var h=n("z")||n("marker.color");h&&n("histfunc"),n("histnorm"),n("autobinx"),n("autobiny")}}),Yq=It((et,Y)=>{var f=jn(),y=iP(),z=ZL(),P=Cu(),n=J4(),i=Q8();Y.exports=function(a,l,o,c){function s(h,m){return f.coerce(a,l,i,h,m)}y(a,l,s,c),l.visible!==!1&&(z(a,l,s,c),P(a,l,c,s,{prefix:"",cLetter:"z"}),s("hovertemplate"),s("hovertemplatefallback"),n(s,c),s("xhoverformat"),s("yhoverformat"))}}),Xq=It((et,Y)=>{var f=Y8(),y=Fs().hoverLabelText;Y.exports=function(z,P,n,i,a){var l=f(z,P,n,i,a);if(l){z=l[0];var o=z.index,c=o[0],s=o[1],h=z.cd[0],m=h.trace,b=h.xRanges[s],x=h.yRanges[c];return z.xLabel=y(z.xa,[b[0],b[1]],m.xhoverformat),z.yLabel=y(z.ya,[x[0],x[1]],m.yhoverformat),l}}}),Jq=It((et,Y)=>{Y.exports={attributes:Q8(),supplyDefaults:Yq(),crossTraceDefaults:J8(),calc:q8(),plot:Z8(),layerName:"heatmaplayer",colorbar:z_(),style:K8(),hoverPoints:Xq(),eventData:nP(),moduleType:"trace",name:"histogram2d",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),Qq=It((et,Y)=>{Y.exports=Jq()}),tC=It((et,Y)=>{Y.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),Q4=It((et,Y)=>{var f=zw(),y=dd(),z=Sh(),P=z.axisHoverFormat,n=z.descriptionOnlyNumbers,i=Ru(),a=qf().dash,l=hi(),o=Yn().extendFlat,c=tC(),s=c.COMPARISON_OPS2,h=c.INTERVAL_OPS,m=y.line;Y.exports=o({z:f.z,x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,text:f.text,hovertext:f.hovertext,transpose:f.transpose,xtype:f.xtype,ytype:f.ytype,xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:f.hovertemplate,hovertemplatefallback:f.hovertemplatefallback,texttemplate:o({},f.texttemplate,{}),texttemplatefallback:f.texttemplatefallback,textfont:o({},f.textfont,{}),hoverongaps:f.hoverongaps,connectgaps:o({},f.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:l({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:n("contour label")},operation:{valType:"enumerated",values:[].concat(s).concat(h),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:o({},m.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:a,smoothing:o({},m.smoothing,{}),editType:"plot"},zorder:y.zorder},i("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),aP=It((et,Y)=>{var f=Q8(),y=Q4(),z=Ru(),P=Sh().axisHoverFormat,n=Yn().extendFlat;Y.exports=n({x:f.x,y:f.y,z:f.z,marker:f.marker,histnorm:f.histnorm,histfunc:f.histfunc,nbinsx:f.nbinsx,xbins:f.xbins,nbinsy:f.nbinsy,ybins:f.ybins,autobinx:f.autobinx,autobiny:f.autobiny,bingroup:f.bingroup,xbingroup:f.xbingroup,ybingroup:f.ybingroup,autocontour:y.autocontour,ncontours:y.ncontours,contours:y.contours,line:{color:y.line.color,width:n({},y.line.width,{dflt:.5}),dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:f.hovertemplate,hovertemplatefallback:f.hovertemplatefallback,texttemplate:y.texttemplate,texttemplatefallback:y.texttemplatefallback,textfont:y.textfont},z("",{cLetter:"z",editTypeOverride:"calc"}))}),eC=It((et,Y)=>{Y.exports=function(f,y,z,P){var n=P("contours.start"),i=P("contours.end"),a=n===!1||i===!1,l=z("contours.size"),o;a?o=y.autocontour=!0:o=z("autocontour",!1),(o||!l)&&z("ncontours")}}),oP=It((et,Y)=>{var f=jn();Y.exports=function(y,z,P,n){n||(n={});var i=y("contours.showlabels");if(i){var a=z.font;f.coerceFont(y,"contours.labelfont",a,{overrideDflt:{color:P}}),y("contours.labelformat")}n.hasHover!==!1&&y("zhoverformat")}}),rC=It((et,Y)=>{var f=Cu(),y=oP();Y.exports=function(z,P,n,i,a){var l=n("contours.coloring"),o,c="";l==="fill"&&(o=n("contours.showlines")),o!==!1&&(l!=="lines"&&(c=n("line.color","#000")),n("line.width",.5),n("line.dash")),l!=="none"&&(z.showlegend!==!0&&(P.showlegend=!1),P._dfltShowLegend=!1,f(z,P,i,n,{prefix:"",cLetter:"z"})),n("line.smoothing"),y(n,i,c,a)}}),tG=It((et,Y)=>{var f=jn(),y=iP(),z=eC(),P=rC(),n=J4(),i=aP();Y.exports=function(a,l,o,c){function s(m,b){return f.coerce(a,l,i,m,b)}function h(m){return f.coerce2(a,l,i,m)}y(a,l,s,c),l.visible!==!1&&(z(a,l,s,h),P(a,l,s,c),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),l.contours&&l.contours.coloring==="heatmap"&&n(s,c))}}),sP=It((et,Y)=>{var f=Fs(),y=jn();Y.exports=function(P,n){var i=P.contours;if(P.autocontour){var a=P.zmin,l=P.zmax;(P.zauto||a===void 0)&&(a=y.aggNums(Math.min,null,n)),(P.zauto||l===void 0)&&(l=y.aggNums(Math.max,null,n));var o=z(a,l,P.ncontours);i.size=o.dtick,i.start=f.tickFirst(o),o.range.reverse(),i.end=f.tickFirst(o),i.start===a&&(i.start+=i.size),i.end===l&&(i.end-=i.size),i.start>i.end&&(i.start=i.end=(i.start+i.end)/2),P._input.contours||(P._input.contours={}),y.extendFlat(P._input.contours,{start:i.start,end:i.end,size:i.size}),P._input.autocontour=!0}else if(i.type!=="constraint"){var c=i.start,s=i.end,h=P._input.contours;if(c>s&&(i.start=h.start=s,s=i.end=h.end=c,c=i.start),!(i.size>0)){var m;c===s?m=1:m=z(c,s,P.ncontours).dtick,h.size=i.size=m}}};function z(P,n,i){var a={type:"linear",range:[P,n]};return f.autoTicks(a,(n-P)/(i||15)),a}}),tk=It((et,Y)=>{Y.exports=function(f){return f.end+f.size/1e6}}),lP=It((et,Y)=>{var f=ch(),y=q8(),z=sP(),P=tk();Y.exports=function(n,i){var a=y(n,i),l=a[0].z;z(i,l);var o=i.contours,c=f.extractOpts(i),s;if(o.coloring==="heatmap"&&c.auto&&i.autocontour===!1){var h=o.start,m=P(o),b=o.size||1,x=Math.floor((m-h)/b)+1;isFinite(b)||(b=1,x=1);var _=h-b/2,A=_+x*b;s=[_,A]}else s=l;return f.calc(n,i,{vals:s,cLetter:"z"}),a}}),ek=It((et,Y)=>{Y.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}),cP=It((et,Y)=>{var f=ek();Y.exports=function(z){var P=z[0].z,n=P.length,i=P[0].length,a=n===2||i===2,l,o,c,s,h,m,b,x,_;for(o=0;oz?0:1)+(P[0][1]>z?0:2)+(P[1][1]>z?0:4)+(P[1][0]>z?0:8);if(n===5||n===10){var i=(P[0][0]+P[0][1]+P[1][0]+P[1][1])/4;return z>i?n===5?713:1114:n===5?104:208}return n===15?0:n}}),uP=It((et,Y)=>{var f=jn(),y=ek();Y.exports=function(l,o,c){var s,h,m,b,x;for(o=o||.01,c=c||.01,m=0;m20?(b=y.CHOOSESADDLE[b][(x[0]||x[1])<0?0:1],l.crossings[m]=y.SADDLEREMAINDER[b]):delete l.crossings[m],x=y.NEWDELTA[b],!x){f.log("Found bad marching index:",b,o,l.level);break}_.push(a(l,o,x)),o[0]+=x[0],o[1]+=x[1],m=o.join(","),z(_[_.length-1],_[_.length-2],s,h)&&_.pop();var E=x[0]&&(o[0]<0||o[0]>d-2)||x[1]&&(o[1]<0||o[1]>A-2),I=o[0]===k[0]&&o[1]===k[1]&&x[0]===w[0]&&x[1]===w[1];if(I||c&&E)break;b=l.crossings[m]}D===1e4&&f.log("Infinite loop in contour?");var M=z(_[0],_[_.length-1],s,h),p=0,g=.2*l.smoothing,C=[],S=0,N,B,U,V,W,F,H,q,G,tt,ht;for(D=1;D<_.length;D++)H=P(_[D],_[D-1]),p+=H,C.push(H);var bt=p/C.length*g;function vt(gt){return _[gt%_.length]}for(D=_.length-2;D>=S;D--)if(N=C[D],N=S&&N+C[B]q&&G--,l.edgepaths[G]=ht.concat(_,tt));break}rt||(l.edgepaths[q]=_.concat(tt))}for(q=0;q20&&o?l===208||l===1114?s=c[0]===0?1:-1:h=c[1]===0?1:-1:y.BOTTOMSTART.indexOf(l)!==-1?h=1:y.LEFTSTART.indexOf(l)!==-1?s=1:y.TOPSTART.indexOf(l)!==-1?h=-1:s=-1,[s,h]}function a(l,o,c){var s=o[0]+Math.max(c[0],0),h=o[1]+Math.max(c[1],0),m=l.z[h][s],b=l.xaxis,x=l.yaxis;if(c[1]){var _=(l.level-m)/(l.z[h][s+1]-m),A=(_!==1?(1-_)*b.c2l(l.x[s]):0)+(_!==0?_*b.c2l(l.x[s+1]):0);return[b.c2p(b.l2c(A),!0),x.c2p(l.y[h],!0),s+_,h]}else{var d=(l.level-m)/(l.z[h+1][s]-m),k=(d!==1?(1-d)*x.c2l(l.y[h]):0)+(d!==0?d*x.c2l(l.y[h+1]):0);return[b.c2p(l.x[s],!0),x.c2p(x.l2c(k),!0),s,h+d]}}}),eG=It((et,Y)=>{var f=tC(),y=Sr();Y.exports={"[]":P("[]"),"][":P("]["),">":n(">"),"<":n("<"),"=":n("=")};function z(i,a){var l=Array.isArray(a),o;function c(s){return y(s)?+s:null}return f.COMPARISON_OPS2.indexOf(i)!==-1?o=c(l?a[0]:a):f.INTERVAL_OPS.indexOf(i)!==-1?o=l?[c(a[0]),c(a[1])]:[c(a),c(a)]:f.SET_OPS.indexOf(i)!==-1&&(o=l?a.map(c):[c(a)]),o}function P(i){return function(a){a=z(i,a);var l=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);return{start:l,end:o,size:o-l}}}function n(i){return function(a){return a=z(i,a),{start:a,end:1/0,size:1/0}}}}),hP=It((et,Y)=>{var f=jn(),y=eG(),z=tk();Y.exports=function(P,n,i){for(var a=P.type==="constraint"?y[P._operation](P.value):P,l=a.size,o=[],c=z(a),s=i.trace._carpetTrace,h=s?{xaxis:s.aaxis,yaxis:s.baxis,x:i.a,y:i.b}:{xaxis:n.xaxis,yaxis:n.yaxis,x:i.x,y:i.y},m=a.start;m1e3){f.warn("Too many contours, clipping at 1000",P);break}return o}}),dP=It((et,Y)=>{var f=jn();Y.exports=function(z,P){var n,i,a,l=function(s){return s.reverse()},o=function(s){return s};switch(P){case"=":case"<":return z;case">":for(z.length!==1&&f.warn("Contour data invalid for the specified inequality operation."),i=z[0],n=0;n{Y.exports=function(f,y){var z=f[0],P=z.z,n;switch(y.type){case"levels":var i=Math.min(P[0][0],P[0][1]);for(n=0;na.level||a.starts.length&&i===a.level)}break;case"constraint":if(z.prefixBoundary=!1,z.edgepaths.length)return;var l=z.x.length,o=z.y.length,c=-1/0,s=1/0;for(n=0;n":h>c&&(z.prefixBoundary=!0);break;case"<":(hc||z.starts.length&&b===s)&&(z.prefixBoundary=!0);break;case"][":m=Math.min(h[0],h[1]),b=Math.max(h[0],h[1]),mc&&(z.prefixBoundary=!0);break}break}}}),nC=It(et=>{var Y=Br(),f=jn(),y=Js(),z=ch(),P=uu(),n=Fs(),i=G0(),a=Z8(),l=cP(),o=uP(),c=hP(),s=dP(),h=fP(),m=ek(),b=m.LABELOPTIMIZER;et.plot=function(E,I,M,p){var g=I.xaxis,C=I.yaxis;f.makeTraceGroups(p,M,"contour").each(function(S){var N=Y.select(this),B=S[0],U=B.trace,V=B.x,W=B.y,F=U.contours,H=c(F,I,B),q=f.ensureSingle(N,"g","heatmapcoloring"),G=[];F.coloring==="heatmap"&&(G=[S]),a(E,I,G,q),l(H),o(H);var tt=g.c2p(V[0],!0),ht=g.c2p(V[V.length-1],!0),bt=C.c2p(W[0],!0),vt=C.c2p(W[W.length-1],!0),ut=[[tt,vt],[ht,vt],[ht,bt],[tt,bt]],rt=H;F.type==="constraint"&&(rt=s(H,F._operation)),x(N,ut,F),_(N,rt,ut,F),d(N,H,E,B,F),w(N,I,E,B,ut)})};function x(E,I,M){var p=f.ensureSingle(E,"g","contourbg"),g=p.selectAll("path").data(M.coloring==="fill"?[0]:[]);g.enter().append("path"),g.exit().remove(),g.attr("d","M"+I.join("L")+"Z").style("stroke","none")}function _(E,I,M,p){var g=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",C="M"+M.join("L")+"Z";g&&h(I,p);var S=f.ensureSingle(E,"g","contourfill"),N=S.selectAll("path").data(g?I:[]);N.enter().append("path"),N.exit().remove(),N.each(function(B){var U=(B.prefixBoundary?C:"")+A(B,M);U?Y.select(this).attr("d",U).style("stroke","none"):Y.select(this).remove()})}function A(E,I){var M="",p=0,g=E.edgepaths.map(function(ht,bt){return bt}),C=!0,S,N,B,U,V,W;function F(ht){return Math.abs(ht[1]-I[0][1])<.01}function H(ht){return Math.abs(ht[1]-I[2][1])<.01}function q(ht){return Math.abs(ht[0]-I[0][0])<.01}function G(ht){return Math.abs(ht[0]-I[2][0])<.01}for(;g.length;){for(W=y.smoothopen(E.edgepaths[p],E.smoothing),M+=C?W:W.replace(/^M/,"L"),g.splice(g.indexOf(p),1),S=E.edgepaths[p][E.edgepaths[p].length-1],U=-1,B=0;B<4;B++){if(!S){f.log("Missing end?",p,E);break}for(F(S)&&!G(S)?N=I[1]:q(S)?N=I[0]:H(S)?N=I[3]:G(S)&&(N=I[2]),V=0;V=0&&(N=tt,U=V):Math.abs(S[1]-N[1])<.01?Math.abs(S[1]-tt[1])<.01&&(tt[0]-S[0])*(N[0]-tt[0])>=0&&(N=tt,U=V):f.log("endpt to newendpt is not vert. or horz.",S,N,tt)}if(S=N,U>=0)break;M+="L"+N}if(U===E.edgepaths.length){f.log("unclosed perimeter path");break}p=U,C=g.indexOf(p)===-1,C&&(p=g[0],M+="Z")}for(p=0;pb.MAXCOST*2)break;F&&(N/=2),S=U-N/2,B=S+N*1.5}if(W<=b.MAXCOST)return V};function k(E,I,M,p){var g=I.width/2,C=I.height/2,S=E.x,N=E.y,B=E.theta,U=Math.cos(B)*g,V=Math.sin(B)*g,W=(S>p.center?p.right-S:S-p.left)/(U+Math.abs(Math.sin(B)*C)),F=(N>p.middle?p.bottom-N:N-p.top)/(Math.abs(V)+Math.cos(B)*C);if(W<1||F<1)return 1/0;var H=b.EDGECOST*(1/(W-1)+1/(F-1));H+=b.ANGLECOST*B*B;for(var q=S-U,G=N-V,tt=S+U,ht=N+V,bt=0;bt{var f=Br(),y=ch(),z=tk();Y.exports=function(P){var n=P.contours,i=n.start,a=z(n),l=n.size||1,o=Math.floor((a-i)/l)+1,c=n.coloring==="lines"?0:1,s=y.extractOpts(P);isFinite(l)||(l=1,o=1);var h=s.reversescale?y.flipScale(s.colorscale):s.colorscale,m=h.length,b=new Array(m),x=new Array(m),_,A,d=s.min,k=s.max;if(n.coloring==="heatmap"){for(A=0;A=k)&&(i<=d&&(i=d),a>=k&&(a=k),o=Math.floor((a-i)/l)+1,c=0),A=0;Ad&&(b.unshift(d),x.unshift(x[0])),b[b.length-1]{var f=Br(),y=Js(),z=K8(),P=pP();Y.exports=function(n){var i=f.select(n).selectAll("g.contour");i.style("opacity",function(a){return a[0].trace.opacity}),i.each(function(a){var l=f.select(this),o=a[0].trace,c=o.contours,s=o.line,h=c.size||1,m=c.start,b=c.type==="constraint",x=!b&&c.coloring==="lines",_=!b&&c.coloring==="fill",A=x||_?P(o):null;l.selectAll("g.contourlevel").each(function(w){f.select(this).selectAll("path").call(y.lineGroupStyle,s.width,x?A(w.level):s.color,s.dash)});var d=c.labelfont;if(l.selectAll("g.contourlabels text").each(function(w){y.font(f.select(this),{weight:d.weight,style:d.style,variant:d.variant,textcase:d.textcase,lineposition:d.lineposition,shadow:d.shadow,family:d.family,size:d.size,color:d.color||(x?A(w.level):s.color)})}),b)l.selectAll("g.contourfill path").style("fill",o.fillcolor);else if(_){var k;l.selectAll("g.contourfill path").style("fill",function(w){return k===void 0&&(k=w.level),A(w.level+.5*h)}),k===void 0&&(k=m),l.selectAll("g.contourbg path").style("fill",A(k-.5*h))}}),z(n)}}),aC=It((et,Y)=>{var f=ch(),y=pP(),z=tk();function P(n,i,a){var l=i.contours,o=i.line,c=l.size||1,s=l.coloring,h=y(i,{isColorbar:!0});if(s==="heatmap"){var m=f.extractOpts(i);a._fillgradient=m.reversescale?f.flipScale(m.colorscale):m.colorscale,a._zrange=[m.min,m.max]}else s==="fill"&&(a._fillcolor=h);a._line={color:s==="lines"?h:o.color,width:l.showlines!==!1?o.width:0,dash:o.dash},a._levels={start:l.start,end:z(l),size:c}}Y.exports={min:"zmin",max:"zmax",calc:P}}),mP=It((et,Y)=>{var f=Hn(),y=Y8();Y.exports=function(z,P,n,i,a){a||(a={}),a.isContour=!0;var l=y(z,P,n,i,a);return l&&l.forEach(function(o){var c=o.trace;c.contours.type==="constraint"&&(c.fillcolor&&f.opacity(c.fillcolor)?o.color=f.addOpacity(c.fillcolor,1):c.contours.showlines&&f.opacity(c.line.color)&&(o.color=f.addOpacity(c.line.color,1)))}),l}}),rG=It((et,Y)=>{Y.exports={attributes:aP(),supplyDefaults:tG(),crossTraceDefaults:J8(),calc:lP(),plot:nC().plot,layerName:"contourlayer",style:iC(),colorbar:aC(),hoverPoints:mP(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),nG=It((et,Y)=>{Y.exports=rG()}),gP=It((et,Y)=>{var f=Sr(),y=oP(),z=Hn(),P=z.addOpacity,n=z.opacity,i=tC(),a=jn().isArrayOrTypedArray,l=i.CONSTRAINT_REDUCTION,o=i.COMPARISON_OPS2;Y.exports=function(s,h,m,b,x,_){var A=h.contours,d,k,w,D=m("contours.operation");if(A._operation=l[D],c(m,A),D==="="?d=A.showlines=!0:(d=m("contours.showlines"),w=m("fillcolor",P((s.line||{}).color||x,.5))),d){var E=w&&n(w)?P(h.fillcolor,1):x;k=m("line.color",E),m("line.width",2),m("line.dash")}m("line.smoothing"),y(m,b,k,_)};function c(s,h){var m;o.indexOf(h.operation)===-1?(s("contours.value",[0,1]),a(h.value)?h.value.length>2?h.value=h.value.slice(2):h.length===0?h.value=[0,1]:h.length<2?(m=parseFloat(h.value[0]),h.value=[m,m+1]):h.value=[parseFloat(h.value[0]),parseFloat(h.value[1])]:f(h.value)&&(m=parseFloat(h.value),h.value=[m,m+1])):(s("contours.value",0),f(h.value)||(a(h.value)?h.value=parseFloat(h.value[0]):h.value=0))}}),iG=It((et,Y)=>{var f=jn(),y=U8(),z=S0(),P=gP(),n=eC(),i=rC(),a=J4(),l=Q4();Y.exports=function(o,c,s,h){function m(A,d){return f.coerce(o,c,l,A,d)}function b(A){return f.coerce2(o,c,l,A)}var x=y(o,c,m,h);if(!x){c.visible=!1;return}z(o,c,h,m),m("xhoverformat"),m("yhoverformat"),m("text"),m("hovertext"),m("hoverongaps"),m("hovertemplate"),m("hovertemplatefallback");var _=m("contours.type")==="constraint";m("connectgaps",f.isArray1D(c.z)),_?P(o,c,m,h,s):(n(o,c,m,b),i(o,c,m,h)),c.contours&&c.contours.coloring==="heatmap"&&a(m,h),m("zorder")}}),aG=It((et,Y)=>{Y.exports={attributes:Q4(),supplyDefaults:iG(),calc:lP(),plot:nC().plot,style:iC(),colorbar:aC(),hoverPoints:mP(),moduleType:"trace",name:"contour",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),oG=It((et,Y)=>{Y.exports=aG()}),vP=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=dd(),i=xa(),a=Ru(),l=qf().dash,o=Yn().extendFlat,c=n.marker,s=n.line,h=c.line;Y.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},n.mode,{dflt:"markers"}),text:o({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},n.hovertext,{}),line:{color:s.color,width:s.width,dash:l,backoff:s.backoff,shape:o({},s.shape,{values:["linear","spline"]}),smoothing:s.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:o({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:P(),marker:o({symbol:c.symbol,opacity:c.opacity,angle:c.angle,angleref:c.angleref,standoff:c.standoff,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:o({width:h.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:o({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron,hovertemplate:f(),hovertemplatefallback:z()}}),sG=It((et,Y)=>{var f=jn(),y=Eg(),z=Fu(),P=Y0(),n=Lm(),i=oy(),a=pm(),l=Pm(),o=vP();Y.exports=function(c,s,h,m){function b(D,E){return f.coerce(c,s,o,D,E)}var x=b("a"),_=b("b"),A=b("c"),d;if(x?(d=x.length,_?(d=Math.min(d,_.length),A&&(d=Math.min(d,A.length))):A?d=Math.min(d,A.length):d=0):_&&A&&(d=Math.min(_.length,A.length)),!d){s.visible=!1;return}s._length=d,b("sum"),b("text"),b("hovertext"),s.hoveron!=="fills"&&(b("hovertemplate"),b("hovertemplatefallback"));var k=d{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot;return n.aLabel=f.tickText(i.aaxis,y.a,!0).text,n.bLabel=f.tickText(i.baxis,y.b,!0).text,n.cLabel=f.tickText(i.caxis,y.c,!0).text,n}}),cG=It((et,Y)=>{var f=Sr(),y=Dm(),z=ft(),P=$t(),n=_e().calcMarkerSize,i=["a","b","c"],a={a:["b","c"],b:["a","c"],c:["a","b"]};Y.exports=function(l,o){var c=l._fullLayout[o.subplot],s=c.sum,h=o.sum||s,m={a:o.a,b:o.b,c:o.c},b=o.ids,x,_,A,d,k,w;for(x=0;x{var f=fo();Y.exports=function(y,z,P){var n=z.plotContainer;n.select(".scatterlayer").selectAll("*").remove();for(var i=z.xaxis,a=z.yaxis,l={xaxis:i,yaxis:a,plot:n,layerClipId:z._hasClipOnAxisFalse?z.clipIdRelative:null},o=z.layers.frontplot.select("g.scatterlayer"),c=0;c{var f=Kf();Y.exports=function(y,z,P,n){var i=f(y,z,P,n);if(!i||i[0].index===!1)return;var a=i[0];if(a.index===void 0){var l=1-a.y0/y.ya._length,o=y.xa._length,c=o*l/2,s=o-c;return a.x0=Math.max(Math.min(a.x0,s),c),a.x1=Math.max(Math.min(a.x1,s),c),i}var h=a.cd[a.index],m=a.trace,b=a.subplot;a.a=h.a,a.b=h.b,a.c=h.c,a.xLabelVal=void 0,a.yLabelVal=void 0;var x={};x[m.subplot]={_subplot:b};var _=m._module.formatLabels(h,m,x);a.aLabel=_.aLabel,a.bLabel=_.bLabel,a.cLabel=_.cLabel;var A=h.hi||m.hoverinfo,d=[];function k(D,E){d.push(D._hovertitle+": "+E)}if(!m.hovertemplate){var w=A.split("+");w.indexOf("all")!==-1&&(w=["a","b","c"]),w.indexOf("a")!==-1&&k(b.aaxis,a.aLabel),w.indexOf("b")!==-1&&k(b.baxis,a.bLabel),w.indexOf("c")!==-1&&k(b.caxis,a.cLabel)}return a.extraText=d.join("
"),a.hovertemplate=m.hovertemplate,i}}),dG=It((et,Y)=>{Y.exports=function(f,y,z,P,n){if(y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),P[n]){var i=P[n];f.a=i.a,f.b=i.b,f.c=i.c}else f.a=y.a,f.b=y.b,f.c=y.c;return f}}),fG=It((et,Y)=>{var f=Br(),y=Xi(),z=ls(),P=jn(),n=P.strTranslate,i=P._,a=Hn(),l=Js(),o=G0(),c=Yn().extendFlat,s=lh(),h=Fs(),m=Up(),b=hd(),x=dm(),_=x.freeMode,A=x.rectMode,d=jp(),k=Md().prepSelect,w=Md().selectOnClick,D=Md().clearOutline,E=Md().clearSelectionsCache,I=fu();function M(H,q){this.id=H.id,this.graphDiv=H.graphDiv,this.init(q),this.makeFramework(q),this.updateFx(q),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}Y.exports=M;var p=M.prototype;p.init=function(H){this.container=H._ternarylayer,this.defs=H._defs,this.layoutId=H._uid,this.traceHash={},this.layers={}},p.plot=function(H,q){var G=this,tt=q[G.id],ht=q._size;G._hasClipOnAxisFalse=!1;for(var bt=0;btg*gt?(Ct=gt,dt=Ct*g):(dt=rt,Ct=dt/g),Rt=vt*dt/rt,Bt=ut*Ct/gt,J=q.l+q.w*ht-dt/2,mt=q.t+q.h*(1-bt)-Ct/2,G.x0=J,G.y0=mt,G.w=dt,G.h=Ct,G.sum=it,G.xaxis={type:"linear",range:[st+2*ot-it,it-st-2*xt],domain:[ht-Rt/2,ht+Rt/2],_id:"x"},o(G.xaxis,G.graphDiv._fullLayout),G.xaxis.setScale(),G.xaxis.isPtWithinRange=function(ie){return ie.a>=G.aaxis.range[0]&&ie.a<=G.aaxis.range[1]&&ie.b>=G.baxis.range[1]&&ie.b<=G.baxis.range[0]&&ie.c>=G.caxis.range[1]&&ie.c<=G.caxis.range[0]},G.yaxis={type:"linear",range:[st,it-xt-ot],domain:[bt-Bt/2,bt+Bt/2],_id:"y"},o(G.yaxis,G.graphDiv._fullLayout),G.yaxis.setScale(),G.yaxis.isPtWithinRange=function(){return!0};var Zt=G.yaxis.domain[0],Gt=G.aaxis=c({},H.aaxis,{range:[st,it-xt-ot],side:"left",tickangle:(+H.aaxis.tickangle||0)-30,domain:[Zt,Zt+Bt*g],anchor:"free",position:0,_id:"y",_length:dt});o(Gt,G.graphDiv._fullLayout),Gt.setScale();var ee=G.baxis=c({},H.baxis,{range:[it-st-ot,xt],side:"bottom",domain:G.xaxis.domain,anchor:"free",position:0,_id:"x",_length:dt});o(ee,G.graphDiv._fullLayout),ee.setScale();var xe=G.caxis=c({},H.caxis,{range:[it-st-xt,ot],side:"right",tickangle:(+H.caxis.tickangle||0)+30,domain:[Zt,Zt+Bt*g],anchor:"free",position:0,_id:"y",_length:dt});o(xe,G.graphDiv._fullLayout),xe.setScale();var ge="M"+J+","+(mt+Ct)+"h"+dt+"l-"+dt/2+",-"+Ct+"Z";G.clipDef.select("path").attr("d",ge),G.layers.plotbg.select("path").attr("d",ge);var ye="M0,"+Ct+"h"+dt+"l-"+dt/2+",-"+Ct+"Z";G.clipDefRelative.select("path").attr("d",ye);var ue=n(J,mt);G.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ue),G.clipDefRelative.select("path").attr("transform",null);var Mt=n(J-ee._offset,mt+Ct);G.layers.baxis.attr("transform",Mt),G.layers.bgrid.attr("transform",Mt);var Ot=n(J+dt/2,mt)+"rotate(30)"+n(0,-Gt._offset);G.layers.aaxis.attr("transform",Ot),G.layers.agrid.attr("transform",Ot);var Lt=n(J+dt/2,mt)+"rotate(-30)"+n(0,-xe._offset);G.layers.caxis.attr("transform",Lt),G.layers.cgrid.attr("transform",Lt),G.drawAxes(!0),G.layers.aline.select("path").attr("d",Gt.showline?"M"+J+","+(mt+Ct)+"l"+dt/2+",-"+Ct:"M0,0").call(a.stroke,Gt.linecolor||"#000").style("stroke-width",(Gt.linewidth||0)+"px"),G.layers.bline.select("path").attr("d",ee.showline?"M"+J+","+(mt+Ct)+"h"+dt:"M0,0").call(a.stroke,ee.linecolor||"#000").style("stroke-width",(ee.linewidth||0)+"px"),G.layers.cline.select("path").attr("d",xe.showline?"M"+(J+dt/2)+","+mt+"l"+dt/2+","+Ct:"M0,0").call(a.stroke,xe.linecolor||"#000").style("stroke-width",(xe.linewidth||0)+"px"),G.graphDiv._context.staticPlot||G.initInteractions(),l.setClipUrl(G.layers.frontplot,G._hasClipOnAxisFalse?null:G.clipId,G.graphDiv)},p.drawAxes=function(H){var q=this,G=q.graphDiv,tt=q.id.substr(7)+"title",ht=q.layers,bt=q.aaxis,vt=q.baxis,ut=q.caxis;if(q.drawAx(bt),q.drawAx(vt),q.drawAx(ut),H){var rt=Math.max(bt.showticklabels?bt.tickfont.size/2:0,(ut.showticklabels?ut.tickfont.size*.75:0)+(ut.ticks==="outside"?ut.ticklen*.87:0)),gt=(vt.showticklabels?vt.tickfont.size:0)+(vt.ticks==="outside"?vt.ticklen:0)+3;ht["a-title"]=d.draw(G,"a"+tt,{propContainer:bt,propName:q.id+".aaxis.title.text",placeholder:i(G,"Click to enter Component A title"),attributes:{x:q.x0+q.w/2,y:q.y0-bt.title.font.size/3-rt,"text-anchor":"middle"}}),ht["b-title"]=d.draw(G,"b"+tt,{propContainer:vt,propName:q.id+".baxis.title.text",placeholder:i(G,"Click to enter Component B title"),attributes:{x:q.x0-gt,y:q.y0+q.h+vt.title.font.size*.83+gt,"text-anchor":"middle"}}),ht["c-title"]=d.draw(G,"c"+tt,{propContainer:ut,propName:q.id+".caxis.title.text",placeholder:i(G,"Click to enter Component C title"),attributes:{x:q.x0+q.w+gt,y:q.y0+q.h+ut.title.font.size*.83+gt,"text-anchor":"middle"}})}},p.drawAx=function(H){var q=this,G=q.graphDiv,tt=H._name,ht=tt.charAt(0),bt=H._id,vt=q.layers[tt],ut=30,rt=ht+"tickLayout",gt=C(H);q[rt]!==gt&&(vt.selectAll("."+bt+"tick").remove(),q[rt]=gt),H.setScale();var it=h.calcTicks(H),st=h.clipEnds(H,it),xt=h.makeTransTickFn(H),ot=h.getTickSigns(H)[2],J=P.deg2rad(ut),mt=ot*(H.linewidth||1)/2,dt=ot*H.ticklen,Ct=q.w,Rt=q.h,Bt=ht==="b"?"M0,"+mt+"l"+Math.sin(J)*dt+","+Math.cos(J)*dt:"M"+mt+",0l"+Math.cos(J)*dt+","+-Math.sin(J)*dt,Zt={a:"M0,0l"+Rt+",-"+Ct/2,b:"M0,0l-"+Ct/2+",-"+Rt,c:"M0,0l-"+Rt+","+Ct/2}[ht];h.drawTicks(G,H,{vals:H.ticks==="inside"?st:it,layer:vt,path:Bt,transFn:xt,crisp:!1}),h.drawGrid(G,H,{vals:st,layer:q.layers[ht+"grid"],path:Zt,transFn:xt,crisp:!1}),h.drawLabels(G,H,{vals:it,layer:vt,transFn:xt,labelFns:h.makeLabelFns(H,0,ut)})};function C(H){return H.ticks+String(H.ticklen)+String(H.showticklabels)}var S=I.MINZOOM/2+.87,N="m-0.87,.5h"+S+"v3h-"+(S+5.2)+"l"+(S/2+2.6)+",-"+(S*.87+4.5)+"l2.6,1.5l-"+S/2+","+S*.87+"Z",B="m0.87,.5h-"+S+"v3h"+(S+5.2)+"l-"+(S/2+2.6)+",-"+(S*.87+4.5)+"l-2.6,1.5l"+S/2+","+S*.87+"Z",U="m0,1l"+S/2+","+S*.87+"l2.6,-1.5l-"+(S/2+2.6)+",-"+(S*.87+4.5)+"l-"+(S/2+2.6)+","+(S*.87+4.5)+"l2.6,1.5l"+S/2+",-"+S*.87+"Z",V="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",W=!0;p.clearOutline=function(){E(this.dragOptions),D(this.dragOptions.gd)},p.initInteractions=function(){var H=this,q=H.layers.plotbg.select("path").node(),G=H.graphDiv,tt=G._fullLayout._zoomlayer,ht,bt;this.dragOptions={element:q,gd:G,plotinfo:{id:H.id,domain:G._fullLayout[H.id].domain,xaxis:H.xaxis,yaxis:H.yaxis},subplot:H.id,prepFn:function(Mt,Ot,Lt){H.dragOptions.xaxes=[H.xaxis],H.dragOptions.yaxes=[H.yaxis],ht=G._fullLayout._invScaleX,bt=G._fullLayout._invScaleY;var ie=H.dragOptions.dragmode=G._fullLayout.dragmode;_(ie)?H.dragOptions.minDrag=1:H.dragOptions.minDrag=void 0,ie==="zoom"?(H.dragOptions.moveFn=ee,H.dragOptions.clickFn=Ct,H.dragOptions.doneFn=xe,Rt(Mt,Ot,Lt)):ie==="pan"?(H.dragOptions.moveFn=ye,H.dragOptions.clickFn=Ct,H.dragOptions.doneFn=ue,ge(),H.clearOutline(G)):(A(ie)||_(ie))&&k(Mt,Ot,Lt,H.dragOptions,ie)}};var vt,ut,rt,gt,it,st,xt,ot,J,mt;function dt(Mt){var Ot={};return Ot[H.id+".aaxis.min"]=Mt.a,Ot[H.id+".baxis.min"]=Mt.b,Ot[H.id+".caxis.min"]=Mt.c,Ot}function Ct(Mt,Ot){var Lt=G._fullLayout.clickmode;F(G),Mt===2&&(G.emit("plotly_doubleclick",null),z.call("_guiRelayout",G,dt({a:0,b:0,c:0}))),Lt.indexOf("select")>-1&&Mt===1&&w(Ot,G,[H.xaxis],[H.yaxis],H.id,H.dragOptions),Lt.indexOf("event")>-1&&b.click(G,Ot,H.id)}function Rt(Mt,Ot,Lt){var ie=q.getBoundingClientRect();vt=Ot-ie.left,ut=Lt-ie.top,G._fullLayout._calcInverseTransform(G);var be=G._fullLayout._invTransform,ce=P.apply3DTransform(be)(vt,ut);vt=ce[0],ut=ce[1],rt={a:H.aaxis.range[0],b:H.baxis.range[1],c:H.caxis.range[1]},it=rt,gt=H.aaxis.range[1]-rt.a,st=y(H.graphDiv._fullLayout[H.id].bgcolor).getLuminance(),xt="M0,"+H.h+"L"+H.w/2+", 0L"+H.w+","+H.h+"Z",ot=!1,J=tt.append("path").attr("class","zoombox").attr("transform",n(H.x0,H.y0)).style({fill:st>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",xt),mt=tt.append("path").attr("class","zoombox-corners").attr("transform",n(H.x0,H.y0)).style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),H.clearOutline(G)}function Bt(Mt,Ot){return 1-Ot/H.h}function Zt(Mt,Ot){return 1-(Mt+(H.h-Ot)/Math.sqrt(3))/H.w}function Gt(Mt,Ot){return(Mt-(H.h-Ot)/Math.sqrt(3))/H.w}function ee(Mt,Ot){var Lt=vt+Mt*ht,ie=ut+Ot*bt,be=Math.max(0,Math.min(1,Bt(vt,ut),Bt(Lt,ie))),ce=Math.max(0,Math.min(1,Zt(vt,ut),Zt(Lt,ie))),Le=Math.max(0,Math.min(1,Gt(vt,ut),Gt(Lt,ie))),Ze=(be/2+Le)*H.w,Qe=(1-be/2-ce)*H.w,mr=(Ze+Qe)/2,fr=Qe-Ze,Jr=(1-be)*H.h,an=Jr-fr/g;fr.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),mt.transition().style("opacity",1).duration(200),ot=!0),G.emit("plotly_relayouting",dt(it))}function xe(){F(G),it!==rt&&(z.call("_guiRelayout",G,dt(it)),W&&G.data&&G._context.showTips&&(P.notifier(i(G,"Double-click to zoom back out"),"long"),W=!1))}function ge(){rt={a:H.aaxis.range[0],b:H.baxis.range[1],c:H.caxis.range[1]},it=rt}function ye(Mt,Ot){var Lt=Mt/H.xaxis._m,ie=Ot/H.yaxis._m;it={a:rt.a-ie,b:rt.b+(Lt+ie)/2,c:rt.c-(Lt-ie)/2};var be=[it.a,it.b,it.c].sort(P.sorterAsc),ce={a:be.indexOf(it.a),b:be.indexOf(it.b),c:be.indexOf(it.c)};be[0]<0&&(be[1]+be[0]/2<0?(be[2]+=be[0]+be[1],be[0]=be[1]=0):(be[2]+=be[0]/2,be[1]+=be[0]/2,be[0]=0),it={a:be[ce.a],b:be[ce.b],c:be[ce.c]},Ot=(rt.a-it.a)*H.yaxis._m,Mt=(rt.c-it.c-rt.b+it.b)*H.xaxis._m);var Le=n(H.x0+Mt,H.y0+Ot);H.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Le);var Ze=n(-Mt,-Ot);H.clipDefRelative.select("path").attr("transform",Ze),H.aaxis.range=[it.a,H.sum-it.b-it.c],H.baxis.range=[H.sum-it.a-it.c,it.b],H.caxis.range=[H.sum-it.a-it.b,it.c],H.drawAxes(!1),H._hasClipOnAxisFalse&&H.plotContainer.select(".scatterlayer").selectAll(".trace").call(l.hideOutsideRangePoints,H),G.emit("plotly_relayouting",dt(it))}function ue(){z.call("_guiRelayout",G,dt(it))}q.onmousemove=function(Mt){b.hover(G,Mt,H.id),G._fullLayout._lasthover=q,G._fullLayout._hoversubplot=H.id},q.onmouseout=function(Mt){G._dragging||m.unhover(G,Mt)},m.init(this.dragOptions)};function F(H){f.select(H).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),yP=It((et,Y)=>{var f=Sn(),y=Jh().attributes,z=Gf(),P=sh().overrideAll,n=Yn().extendFlat,i={title:{text:z.title.text,font:z.title.font},color:z.color,tickmode:z.minor.tickmode,nticks:n({},z.nticks,{dflt:6,min:1}),tick0:z.tick0,dtick:z.dtick,tickvals:z.tickvals,ticktext:z.ticktext,ticks:z.ticks,ticklen:z.ticklen,tickwidth:z.tickwidth,tickcolor:z.tickcolor,ticklabelstep:z.ticklabelstep,showticklabels:z.showticklabels,labelalias:z.labelalias,showtickprefix:z.showtickprefix,tickprefix:z.tickprefix,showticksuffix:z.showticksuffix,ticksuffix:z.ticksuffix,showexponent:z.showexponent,exponentformat:z.exponentformat,minexponent:z.minexponent,separatethousands:z.separatethousands,tickfont:z.tickfont,tickangle:z.tickangle,tickformat:z.tickformat,tickformatstops:z.tickformatstops,hoverformat:z.hoverformat,showline:n({},z.showline,{dflt:!0}),linecolor:z.linecolor,linewidth:z.linewidth,showgrid:n({},z.showgrid,{dflt:!0}),gridcolor:z.gridcolor,gridwidth:z.gridwidth,griddash:z.griddash,layer:z.layer,min:{valType:"number",dflt:0,min:0}},a=Y.exports=P({domain:y({name:"ternary"}),bgcolor:{valType:"color",dflt:f.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i},"plot","from-root");a.uirevision={valType:"any",editType:"none"},a.aaxis.uirevision=a.baxis.uirevision=a.caxis.uirevision={valType:"any",editType:"none"}}),O_=It((et,Y)=>{var f=jn(),y=Tc(),z=Jh().defaults;Y.exports=function(P,n,i,a){var l=a.type,o=a.attributes,c=a.handleDefaults,s=a.partition||"x",h=n._subplots[l],m=h.length,b=m&&h[0].replace(/\d+$/,""),x,_;function A(D,E){return f.coerce(x,_,o,D,E)}for(var d=0;d{var f=Hn(),y=Tc(),z=jn(),P=O_(),n=q0(),i=Sg(),a=Uv(),l=jv(),o=fb(),c=yP(),s=["aaxis","baxis","caxis"];Y.exports=function(b,x,_){P(b,x,_,{type:"ternary",attributes:c,handleDefaults:h,font:x.font,paper_bgcolor:x.paper_bgcolor})};function h(b,x,_,A){var d=_("bgcolor"),k=_("sum");A.bgColor=f.combine(d,A.paper_bgcolor);for(var w,D,E,I=0;I=k&&(M.min=0,p.min=0,g.min=0,b.aaxis&&delete b.aaxis.min,b.baxis&&delete b.baxis.min,b.caxis&&delete b.caxis.min)}function m(b,x,_,A){var d=c[x._name];function k(C,S){return z.coerce(b,x,d,C,S)}k("uirevision",A.uirevision),x.type="linear";var w=k("color"),D=w!==d.color.dflt?w:_.font.color,E=x._name,I=E.charAt(0).toUpperCase(),M="Component "+I,p=k("title.text",M);x._hovertitle=p===M?p:I,z.coerceFont(k,"title.font",_.font,{overrideDflt:{size:z.bigFont(_.font.size),color:D}}),k("min"),l(b,x,k,"linear"),i(b,x,k,"linear"),n(b,x,k,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),a(b,x,k,{outerTicks:!0});var g=k("showticklabels");g&&(z.coerceFont(k,"tickfont",_.font,{overrideDflt:{color:D}}),k("tickangle"),k("tickformat")),o(b,x,k,{dfltColor:w,bgColor:_.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:d}),k("hoverformat"),k("layer")}}),mG=It(et=>{var Y=fG(),f=Mf().getSubplotCalcData,y=jn().counterRegex,z="ternary";et.name=z;var P=et.attr="subplot";et.idRoot=z,et.idRegex=et.attrRegex=y(z);var n=et.attributes={};n[P]={valType:"subplotid",dflt:"ternary",editType:"calc"},et.layoutAttributes=yP(),et.supplyLayoutDefaults=pG(),et.plot=function(i){for(var a=i._fullLayout,l=i.calcdata,o=a._subplots[z],c=0;c{Y.exports={attributes:vP(),supplyDefaults:sG(),colorbar:Do(),formatLabels:lG(),calc:cG(),plot:uG(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:hG(),selectPoints:Qd(),eventData:dG(),moduleType:"trace",name:"scatterternary",basePlotModule:mG(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),vG=It((et,Y)=>{Y.exports=gG()}),_P=It((et,Y)=>{var f=K4(),y=Yn().extendFlat,z=Sh().axisHoverFormat;Y.exports={y:f.y,x:f.x,x0:f.x0,y0:f.y0,xhoverformat:z("x"),yhoverformat:z("y"),name:y({},f.name,{}),orientation:y({},f.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:f.fillcolor,points:y({},f.boxpoints,{}),jitter:y({},f.jitter,{}),pointpos:y({},f.pointpos,{}),width:y({},f.width,{}),marker:f.marker,text:f.text,hovertext:f.hovertext,hovertemplate:f.hovertemplate,hovertemplatefallback:f.hovertemplatefallback,quartilemethod:f.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,selected:f.selected,unselected:f.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:f.zorder}}),xP=It((et,Y)=>{var f=Y4(),y=jn().extendFlat;Y.exports={violinmode:y({},f.boxmode,{}),violingap:y({},f.boxgap,{}),violingroupgap:y({},f.boxgroupgap,{})}}),yG=It((et,Y)=>{var f=jn(),y=Hn(),z=X4(),P=_P();Y.exports=function(n,i,a,l){function o(p,g){return f.coerce(n,i,P,p,g)}function c(p,g){return f.coerce2(n,i,P,p,g)}if(z.handleSampleDefaults(n,i,o,l),i.visible!==!1){o("bandwidth"),o("side");var s=o("width");s||(o("scalegroup",i.name),o("scalemode"));var h=o("span"),m;Array.isArray(h)&&(m="manual"),o("spanmode",m);var b=o("line.color",(n.marker||{}).color||a),x=o("line.width"),_=o("fillcolor",y.addOpacity(i.line.color,.5));z.handlePointsDefaults(n,i,o,{prefix:""});var A=c("box.width"),d=c("box.fillcolor",_),k=c("box.line.color",b),w=c("box.line.width",x),D=o("box.visible",!!(A||d||k||w));D||(i.box={visible:!1});var E=c("meanline.color",b),I=c("meanline.width",x),M=o("meanline.visible",!!(E||I));M||(i.meanline={visible:!1}),o("quartilemethod"),o("zorder")}}}),_G=It((et,Y)=>{var f=jn(),y=xP(),z=R8();Y.exports=function(P,n,i){function a(l,o){return f.coerce(P,n,y,l,o)}z._supply(P,n,i,a,"violin")}}),oC=It(et=>{var Y=jn(),f={gaussian:function(y){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*y*y)}};et.makeKDE=function(y,z,P){var n=P.length,i=f.gaussian,a=y.bandwidth,l=1/(n*a);return function(o){for(var c=0,s=0;s{var f=jn(),y=Fs(),z=WL(),P=oC(),n=Dr().BADNUM;Y.exports=function(o,c){var s=z(o,c);if(s[0].t.empty)return s;for(var h=o._fullLayout,m=y.getFromId(o,c[c.orientation==="h"?"xaxis":"yaxis"]),b=1/0,x=-1/0,_=0,A=0,d=0;d{var f=F8().setPositionOffset,y=["v","h"];Y.exports=function(z,P){for(var n=z.calcdata,i=P.xaxis,a=P.yaxis,l=0;l{var f=Br(),y=jn(),z=Js(),P=N8(),n=na(),i=oC();Y.exports=function(a,l,o,c){var s=a._context.staticPlot,h=a._fullLayout,m=l.xaxis,b=l.yaxis;function x(_,A){var d=n(_,{xaxis:m,yaxis:b,trace:A,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return z.smoothopen(d[0],1)}y.makeTraceGroups(c,o,"trace violins").each(function(_){var A=f.select(this),d=_[0],k=d.t,w=d.trace;if(w.visible!==!0||k.empty){A.remove();return}var D=k.bPos,E=k.bdPos,I=l[k.valLetter+"axis"],M=l[k.posLetter+"axis"],p=w.side==="both",g=p||w.side==="positive",C=p||w.side==="negative",S=A.selectAll("path.violin").data(y.identity);S.enter().append("path").style("vector-effect",s?"none":"non-scaling-stroke").attr("class","violin"),S.exit().remove(),S.each(function(q){var G=f.select(this),tt=q.density,ht=tt.length,bt=M.c2l(q.pos+D,!0),vt=M.l2p(bt),ut;if(w.width)ut=k.maxKDE/E;else{var rt=h._violinScaleGroupStats[w.scalegroup];ut=w.scalemode==="count"?rt.maxKDE/E*(rt.maxCount/q.pts.length):rt.maxKDE/E}var gt,it,st,xt,ot,J,mt;if(g){for(J=new Array(ht),xt=0;xt{var f=Br(),y=Hn(),z=Il().stylePoints;Y.exports=function(P){var n=f.select(P).selectAll("g.trace.violins");n.style("opacity",function(i){return i[0].trace.opacity}),n.each(function(i){var a=i[0].trace,l=f.select(this),o=a.box||{},c=o.line||{},s=a.meanline||{},h=s.width;l.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(y.stroke,a.line.color).call(y.fill,a.fillcolor),l.selectAll("path.box").style("stroke-width",c.width+"px").call(y.stroke,c.color).call(y.fill,o.fillcolor);var m={"stroke-width":h+"px","stroke-dasharray":2*h+"px,"+h+"px"};l.selectAll("path.mean").style(m).call(y.stroke,s.color),l.selectAll("path.meanline").style(m).call(y.stroke,s.color),z(l,a,P)})}}),TG=It((et,Y)=>{var f=Hn(),y=jn(),z=Fs(),P=qL(),n=oC();Y.exports=function(i,a,l,o,c){c||(c={});var s=c.hoverLayer,h=i.cd,m=h[0].trace,b=m.hoveron,x=b.indexOf("violins")!==-1,_=b.indexOf("kde")!==-1,A=[],d,k;if(x||_){var w=P.hoverOnBoxes(i,a,l,o);if(_&&w.length>0){var D=i.xa,E=i.ya,I,M,p,g,C;m.orientation==="h"?(C=a,I="y",p=E,M="x",g=D):(C=l,I="x",p=D,M="y",g=E);var S=h[i.index];if(C>=S.span[0]&&C<=S.span[1]){var N=y.extendFlat({},i),B=g.c2p(C,!0),U=n.getKdeValue(S,m,C),V=n.getPositionOnKdePath(S,m,B),W=p._offset,F=p._length;N[I+"0"]=V[0],N[I+"1"]=V[1],N[M+"0"]=N[M+"1"]=B,N[M+"Label"]=M+": "+z.hoverLabelText(g,C,m[M+"hoverformat"])+", "+h[0].t.labels.kde+" "+U.toFixed(3);for(var H=0,q=0;q{Y.exports={attributes:_P(),layoutAttributes:xP(),supplyDefaults:yG(),crossTraceDefaults:X4().crossTraceDefaults,supplyLayoutDefaults:_G(),calc:xG(),crossTraceCalc:bG(),plot:wG(),style:kG(),styleOnSelect:Il().styleOnSelect,hoverPoints:TG(),selectPoints:GL(),moduleType:"trace",name:"violin",basePlotModule:Fd(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),CG=It((et,Y)=>{Y.exports=SG()}),AG=It((et,Y)=>{Y.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),bP=It((et,Y)=>{var f=Jv(),y=dd().line,z=xa(),P=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=AG(),o=Yn().extendFlat,c=Hn();Y.exports={x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:f.xperiod0,yperiod0:f.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:f.hovertext,hovertemplate:n({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),text:f.text,textposition:f.textposition,insidetextanchor:o({},f.insidetextanchor,{dflt:"middle"}),textangle:o({},f.textangle,{dflt:0}),textfont:f.textfont,insidetextfont:f.insidetextfont,outsidetextfont:f.outsidetextfont,constraintext:f.constraintext,cliponaxis:f.cliponaxis,orientation:o({},f.orientation,{}),offset:o({},f.offset,{arrayOk:!1}),width:o({},f.width,{arrayOk:!1}),marker:s(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:o({},y.color,{dflt:c.defaultLine}),width:o({},y.width,{dflt:0,editType:"plot"}),dash:y.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,zorder:f.zorder};function s(){var h=o({},f.marker);return delete h.pattern,delete h.cornerradius,h}}),wP=It((et,Y)=>{Y.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),kP=It((et,Y)=>{var f=jn(),y=Xv(),z=eg().handleText,P=Xg(),n=S0(),i=bP(),a=Hn();function l(s,h,m,b){function x(E,I){return f.coerce(s,h,i,E,I)}var _=P(s,h,b,x);if(!_){h.visible=!1;return}n(s,h,b,x),x("xhoverformat"),x("yhoverformat"),x("orientation",h.y&&!h.x?"v":"h"),x("offset"),x("width");var A=x("text");x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var d=x("textposition");z(s,h,b,x,d,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),h.textposition!=="none"&&!h.texttemplate&&x("textinfo",f.isArrayOrTypedArray(A)?"text+value":"value");var k=x("marker.color",m);x("marker.line.color",a.defaultLine),x("marker.line.width");var w=x("connector.visible");if(w){x("connector.fillcolor",o(k));var D=x("connector.line.width");D&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function o(s){var h=f.isArrayOrTypedArray(s)?"#000":s;return a.addOpacity(h,.5*a.opacity(h))}function c(s,h){var m,b;function x(A){return f.coerce(b._input,b,i,A)}for(var _=0;_{var f=jn(),y=wP();Y.exports=function(z,P,n){var i=!1;function a(c,s){return f.coerce(z,P,y,c,s)}for(var l=0;l{var f=jn();Y.exports=function(y,z){for(var P=0;P{var f=Fs(),y=Im(),z=EG(),P=$t(),n=Dr().BADNUM;Y.exports=function(a,l){var o=f.getFromId(a,l.xaxis||"x"),c=f.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A,d;l.orientation==="h"?(s=o.makeCalcdata(l,"x"),m=c.makeCalcdata(l,"y"),b=y(l,c,"y",m),x=!!l.yperiodalignment,_="y"):(s=c.makeCalcdata(l,"y"),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;var k=Math.min(h.length,s.length),w=new Array(k);for(l._base=[],A=0;A{var f=Wr().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,n=y._fullData,i=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],c=[],s=[],h,m;for(m=0;m{var f=Br(),y=jn(),z=Js(),P=Dr().BADNUM,n=vb(),i=C0().clearMinTextSize;Y.exports=function(c,s,h,m){var b=c._fullLayout;i("funnel",b),a(c,s,h,m),l(c,s,h,m),n.plot(c,s,h,m,{mode:b.funnelmode,norm:b.funnelmode,gap:b.funnelgap,groupgap:b.funnelgroupgap})};function a(c,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=f.select(this),d=_[0].trace,k=y.ensureSingle(A,"g","regions");if(!d.connector||!d.connector.visible){k.remove();return}var w=d.orientation==="h",D=k.selectAll("g.region").data(y.identity);D.enter().append("g").classed("region",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],S="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&g[2]!==P&&C[2]!==P&&g[3]!==P&&C[3]!==P&&(w?S+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2]+"H"+g[3]+"L"+g[1]+","+C[1]+"Z":S+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3]+"V"+C[2]+"L"+g[1]+","+C[0]+"Z"),S===""&&(S="M0,0Z"),y.ensureSingle(f.select(this),"path").attr("d",S).call(z.setClipUrl,s.layerClipId,c)}})})}function l(c,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=f.select(this),d=_[0].trace,k=y.ensureSingle(A,"g","lines");if(!d.connector||!d.connector.visible||!d.connector.line.width){k.remove();return}var w=d.orientation==="h",D=k.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],S="";g[3]!==void 0&&C[3]!==void 0&&(w?(S+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2],S+="M"+g[1]+","+C[1]+"L"+g[3]+","+C[2]):(S+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3],S+="M"+g[1]+","+C[0]+"L"+g[2]+","+C[2])),S===""&&(S="M0,0Z"),y.ensureSingle(f.select(this),"path").attr("d",S).call(z.setClipUrl,s.layerClipId,c)}})})}function o(c,s,h,m){var b=[],x=[],_=m?s:h,A=m?h:s;return b[0]=_.c2p(c.s0,!0),x[0]=A.c2p(c.p0,!0),b[1]=_.c2p(c.s1,!0),x[1]=A.c2p(c.p1,!0),b[2]=_.c2p(c.nextS0,!0),x[2]=A.c2p(c.nextP0,!0),b[3]=_.c2p(c.nextS1,!0),x[3]=A.c2p(c.nextP1,!0),m?[b,x]:[x,b]}}),DG=It((et,Y)=>{var f=Br(),y=Js(),z=Hn(),P=Qa().DESELECTDIM,n=Pg(),i=C0().resizeText,a=n.styleTextPoints;function l(o,c,s){var h=s||f.select(o).selectAll('g[class^="funnellayer"]').selectAll("g.trace");i(o,h,"funnel"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=f.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x.marker;f.select(this).call(z.fill,_.mc||A.color).call(z.stroke,_.mlc||A.line.color).call(y.dashLine,A.line.dash,_.mlw||A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".regions").each(function(){f.select(this).selectAll("path").style("stroke-width",0).call(z.fill,x.connector.fillcolor)}),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(f.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),zG=It((et,Y)=>{var f=Hn().opacity,y=Iw().hoverOnBars,z=jn().formatPercent;Y.exports=function(n,i,a,l,o){var c=y(n,i,a,l,o);if(c){var s=c.cd,h=s[0].trace,m=h.orientation==="h",b=c.index,x=s[b],_=m?"x":"y";c[_+"LabelVal"]=x.s,c.percentInitial=x.begR,c.percentInitialLabel=z(x.begR,1),c.percentPrevious=x.difR,c.percentPreviousLabel=z(x.difR,1),c.percentTotal=x.sumR,c.percentTotalLabel=z(x.sumR,1);var A=x.hi||h.hoverinfo,d=[];if(A&&A!=="none"&&A!=="skip"){var k=A==="all",w=A.split("+"),D=function(E){return k||w.indexOf(E)!==-1};D("percent initial")&&d.push(c.percentInitialLabel+" of initial"),D("percent previous")&&d.push(c.percentPreviousLabel+" of previous"),D("percent total")&&d.push(c.percentTotalLabel+" of total")}return c.extraText=d.join("
"),c.color=P(h,x),[c]}};function P(n,i){var a=n.marker,l=i.mc||a.color,o=i.mlc||a.line.color,c=i.mlw||a.line.width;if(f(l))return l;if(f(o)&&c)return o}}),OG=It((et,Y)=>{Y.exports=function(f,y){return f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,"percentInitial"in y&&(f.percentInitial=y.percentInitial),"percentPrevious"in y&&(f.percentPrevious=y.percentPrevious),"percentTotal"in y&&(f.percentTotal=y.percentTotal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f}}),BG=It((et,Y)=>{Y.exports={attributes:bP(),layoutAttributes:wP(),supplyDefaults:kP().supplyDefaults,crossTraceDefaults:kP().crossTraceDefaults,supplyLayoutDefaults:MG(),calc:LG(),crossTraceCalc:PG(),plot:IG(),style:DG().style,hoverPoints:zG(),eventData:OG(),selectPoints:Dw(),moduleType:"trace",name:"funnel",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),RG=It((et,Y)=>{Y.exports=BG()}),FG=It((et,Y)=>{Y.exports={eventDataKeys:["initial","delta","final"]}}),TP=It((et,Y)=>{var f=Jv(),y=dd().line,z=xa(),P=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=FG(),o=Yn().extendFlat,c=Hn();function s(h){return{marker:{color:o({},f.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},f.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},f.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}Y.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:f.xperiod0,yperiod0:f.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:f.hovertext,hovertemplate:n({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),texttemplatefallback:a({editType:"plot"}),text:f.text,textposition:f.textposition,insidetextanchor:f.insidetextanchor,textangle:f.textangle,textfont:f.textfont,insidetextfont:f.insidetextfont,outsidetextfont:f.outsidetextfont,constraintext:f.constraintext,cliponaxis:f.cliponaxis,orientation:f.orientation,offset:f.offset,width:f.width,increasing:s(),decreasing:s(),totals:s(),connector:{line:{color:o({},y.color,{dflt:c.defaultLine}),width:o({},y.width,{editType:"plot"}),dash:y.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,zorder:f.zorder}}),SP=It((et,Y)=>{Y.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),Ow=It((et,Y)=>{Y.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),CP=It((et,Y)=>{var f=jn(),y=Xv(),z=eg().handleText,P=Xg(),n=S0(),i=TP(),a=Hn(),l=Ow(),o=l.INCREASING.COLOR,c=l.DECREASING.COLOR,s="#4499FF";function h(x,_,A){x(_+".marker.color",A),x(_+".marker.line.color",a.defaultLine),x(_+".marker.line.width")}function m(x,_,A,d){function k(M,p){return f.coerce(x,_,i,M,p)}var w=P(x,_,d,k);if(!w){_.visible=!1;return}n(x,_,d,k),k("xhoverformat"),k("yhoverformat"),k("measure"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");z(x,_,d,k,D,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),_.textposition!=="none"&&(k("texttemplate"),k("texttemplatefallback"),_.texttemplate||k("textinfo")),h(k,"increasing",o),h(k,"decreasing",c),h(k,"totals",s);var E=k("connector.visible");if(E){k("connector.mode");var I=k("connector.line.width");I&&(k("connector.line.color"),k("connector.line.dash"))}k("zorder")}function b(x,_){var A,d;function k(D){return f.coerce(d._input,d,i,D)}if(_.waterfallmode==="group")for(var w=0;w{var f=jn(),y=SP();Y.exports=function(z,P,n){var i=!1;function a(c,s){return f.coerce(z,P,y,c,s)}for(var l=0;l{var f=Fs(),y=Im(),z=jn().mergeArray,P=$t(),n=Dr().BADNUM;function i(l){return l==="a"||l==="absolute"}function a(l){return l==="t"||l==="total"}Y.exports=function(l,o){var c=f.getFromId(l,o.xaxis||"x"),s=f.getFromId(l,o.yaxis||"y"),h,m,b,x,_,A;o.orientation==="h"?(h=c.makeCalcdata(o,"x"),b=s.makeCalcdata(o,"y"),x=y(o,s,"y",b),_=!!o.yperiodalignment,A="y"):(h=s.makeCalcdata(o,"y"),b=c.makeCalcdata(o,"x"),x=y(o,c,"x",b),_=!!o.xperiodalignment,A="x"),m=x.vals;for(var d=Math.min(m.length,h.length),k=new Array(d),w=0,D,E=!1,I=0;I{var f=Wr().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,n=y._fullData,i=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],c=[],s=[],h,m;for(m=0;m{var f=Br(),y=jn(),z=Js(),P=Dr().BADNUM,n=vb(),i=C0().clearMinTextSize;Y.exports=function(o,c,s,h){var m=o._fullLayout;i("waterfall",m),n.plot(o,c,s,h,{mode:m.waterfallmode,norm:m.waterfallmode,gap:m.waterfallgap,groupgap:m.waterfallgroupgap}),a(o,c,s,h)};function a(o,c,s,h){var m=c.xaxis,b=c.yaxis;y.makeTraceGroups(h,s,"trace bars").each(function(x){var _=f.select(this),A=x[0].trace,d=y.ensureSingle(_,"g","lines");if(!A.connector||!A.connector.visible){d.remove();return}var k=A.orientation==="h",w=A.connector.mode,D=d.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=l(I,m,b,k),g=p[0],C=p[1],S="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&(w==="spanning"&&!I.isSum&&M>0&&(k?S+="M"+g[0]+","+C[1]+"V"+C[0]:S+="M"+g[1]+","+C[0]+"H"+g[0]),w!=="between"&&(I.isSum||M{var f=Br(),y=Js(),z=Hn(),P=Qa().DESELECTDIM,n=Pg(),i=C0().resizeText,a=n.styleTextPoints;function l(o,c,s){var h=s||f.select(o).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");i(o,h,"waterfall"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=f.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x[_.dir].marker;f.select(this).call(z.fill,A.color).call(z.stroke,A.line.color).call(y.dashLine,A.line.dash,A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(f.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),VG=It((et,Y)=>{var f=Fs().hoverLabelText,y=Hn().opacity,z=Iw().hoverOnBars,P=Ow(),n={increasing:P.INCREASING.SYMBOL,decreasing:P.DECREASING.SYMBOL};Y.exports=function(a,l,o,c,s){var h=z(a,l,o,c,s);if(!h)return;var m=h.cd,b=m[0].trace,x=b.orientation==="h",_=x?"x":"y",A=x?a.xa:a.ya;function d(S){return f(A,S,b[_+"hoverformat"])}var k=h.index,w=m[k],D=w.isSum?w.b+w.s:w.rawS;h.initial=w.b+w.s-D,h.delta=D,h.final=h.initial+h.delta;var E=d(Math.abs(h.delta));h.deltaLabel=D<0?"("+E+")":E,h.finalLabel=d(h.final),h.initialLabel=d(h.initial);var I=w.hi||b.hoverinfo,M=[];if(I&&I!=="none"&&I!=="skip"){var p=I==="all",g=I.split("+"),C=function(S){return p||g.indexOf(S)!==-1};w.isSum||(C("final")&&(x?!C("x"):!C("y"))&&M.push(h.finalLabel),C("delta")&&(D<0?M.push(h.deltaLabel+" "+n.decreasing):M.push(h.deltaLabel+" "+n.increasing)),C("initial")&&M.push("Initial: "+h.initialLabel))}return M.length&&(h.extraText=M.join("
")),h.color=i(b,w),[h]};function i(a,l){var o=a[l.dir].marker,c=o.color,s=o.line.color,h=o.line.width;if(y(c))return c;if(y(s)&&h)return s}}),WG=It((et,Y)=>{Y.exports=function(f,y){return f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,"initial"in y&&(f.initial=y.initial),"delta"in y&&(f.delta=y.delta),"final"in y&&(f.final=y.final),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f}}),qG=It((et,Y)=>{Y.exports={attributes:TP(),layoutAttributes:SP(),supplyDefaults:CP().supplyDefaults,crossTraceDefaults:CP().crossTraceDefaults,supplyLayoutDefaults:NG(),calc:jG(),crossTraceCalc:UG(),plot:$G(),style:HG().style,hoverPoints:VG(),eventData:WG(),selectPoints:Dw(),moduleType:"trace",name:"waterfall",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),GG=It((et,Y)=>{Y.exports=qG()}),Bw=It((et,Y)=>{Y.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(f){return f.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(f){return f.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(f){return f.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(f){var y=f.slice(0,3);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(f){var y=f.slice(0,4);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%",""]}}}}),AP=It((et,Y)=>{var f=xa(),y=dd().zorder,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Yn().extendFlat,i=Bw().colormodel,a=["rgb","rgba","rgba256","hsl","hsla"],l=[],o=[];for(s=0;s{var f=jn(),y=AP(),z=Bw(),P=K0().IMAGE_URL_PREFIX;Y.exports=function(n,i){function a(c,s){return f.coerce(n,i,y,c,s)}a("source"),i.source&&!i.source.match(P)&&delete i.source,i._hasSource=!!i.source;var l=a("z");if(i._hasZ=!(l===void 0||!l.length||!l[0]||!l[0].length),!i._hasZ&&!i._hasSource){i.visible=!1;return}a("x0"),a("y0"),a("dx"),a("dy");var o;i._hasZ?(a("colormodel","rgb"),o=z.colormodel[i.colormodel],a("zmin",o.zminDflt||o.min),a("zmax",o.zmaxDflt||o.max)):i._hasSource&&(i.colormodel="rgba256",o=z.colormodel[i.colormodel],i.zmin=o.zminDflt,i.zmax=o.zmaxDflt),a("zsmooth"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),i._length=null,a("zorder")}}),sy=It((et,Y)=>{typeof Object.create=="function"?Y.exports=function(f,y){y&&(f.super_=y,f.prototype=Object.create(y.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}))}:Y.exports=function(f,y){if(y){f.super_=y;var z=function(){};z.prototype=y.prototype,f.prototype=new z,f.prototype.constructor=f}}}),MP=It((et,Y)=>{Y.exports=Wg().EventEmitter}),KG=It(et=>{et.byteLength=a,et.toByteArray=o,et.fromByteArray=h;var Y=[],f=[],y=typeof Uint8Array<"u"?Uint8Array:Array,z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(P=0,n=z.length;P0)throw new Error("Invalid string. Length must be a multiple of 4");var x=m.indexOf("=");x===-1&&(x=b);var _=x===b?0:4-x%4;return[x,_]}function a(m){var b=i(m),x=b[0],_=b[1];return(x+_)*3/4-_}function l(m,b,x){return(b+x)*3/4-x}function o(m){var b,x=i(m),_=x[0],A=x[1],d=new y(l(m,_,A)),k=0,w=A>0?_-4:_,D;for(D=0;D>16&255,d[k++]=b>>8&255,d[k++]=b&255;return A===2&&(b=f[m.charCodeAt(D)]<<2|f[m.charCodeAt(D+1)]>>4,d[k++]=b&255),A===1&&(b=f[m.charCodeAt(D)]<<10|f[m.charCodeAt(D+1)]<<4|f[m.charCodeAt(D+2)]>>2,d[k++]=b>>8&255,d[k++]=b&255),d}function c(m){return Y[m>>18&63]+Y[m>>12&63]+Y[m>>6&63]+Y[m&63]}function s(m,b,x){for(var _,A=[],d=b;dw?w:k+d));return _===1?(b=m[x-1],A.push(Y[b>>2]+Y[b<<4&63]+"==")):_===2&&(b=(m[x-2]<<8)+m[x-1],A.push(Y[b>>10]+Y[b>>4&63]+Y[b<<2&63]+"=")),A.join("")}}),YG=It(et=>{et.read=function(Y,f,y,z,P){var n,i,a=P*8-z-1,l=(1<>1,c=-7,s=y?P-1:0,h=y?-1:1,m=Y[f+s];for(s+=h,n=m&(1<<-c)-1,m>>=-c,c+=a;c>0;n=n*256+Y[f+s],s+=h,c-=8);for(i=n&(1<<-c)-1,n>>=-c,c+=z;c>0;i=i*256+Y[f+s],s+=h,c-=8);if(n===0)n=1-o;else{if(n===l)return i?NaN:(m?-1:1)*(1/0);i=i+Math.pow(2,z),n=n-o}return(m?-1:1)*i*Math.pow(2,n-z)},et.write=function(Y,f,y,z,P,n){var i,a,l,o=n*8-P-1,c=(1<>1,h=P===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=z?0:n-1,b=z?1:-1,x=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(a=isNaN(f)?1:0,i=c):(i=Math.floor(Math.log(f)/Math.LN2),f*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+s>=1?f+=h/l:f+=h*Math.pow(2,1-s),f*l>=2&&(i++,l/=2),i+s>=c?(a=0,i=c):i+s>=1?(a=(f*l-1)*Math.pow(2,P),i=i+s):(a=f*Math.pow(2,s-1)*Math.pow(2,P),i=0));P>=8;Y[y+m]=a&255,m+=b,a/=256,P-=8);for(i=i<0;Y[y+m]=i&255,m+=b,i/=256,o-=8);Y[y+m-b]|=x*128}}),yb=It(et=>{var Y=KG(),f=YG(),y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;et.Buffer=i,et.SlowBuffer=A,et.INSPECT_MAX_BYTES=50;var z=2147483647;et.kMaxLength=z,i.TYPED_ARRAY_SUPPORT=P(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function P(){try{let Mt=new Uint8Array(1),Ot={foo:function(){return 42}};return Object.setPrototypeOf(Ot,Uint8Array.prototype),Object.setPrototypeOf(Mt,Ot),Mt.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function n(Mt){if(Mt>z)throw new RangeError('The value "'+Mt+'" is invalid for option "size"');let Ot=new Uint8Array(Mt);return Object.setPrototypeOf(Ot,i.prototype),Ot}function i(Mt,Ot,Lt){if(typeof Mt=="number"){if(typeof Ot=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(Mt)}return a(Mt,Ot,Lt)}i.poolSize=8192;function a(Mt,Ot,Lt){if(typeof Mt=="string")return s(Mt,Ot);if(ArrayBuffer.isView(Mt))return m(Mt);if(Mt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Mt);if(ee(Mt,ArrayBuffer)||Mt&&ee(Mt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ee(Mt,SharedArrayBuffer)||Mt&&ee(Mt.buffer,SharedArrayBuffer)))return b(Mt,Ot,Lt);if(typeof Mt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ie=Mt.valueOf&&Mt.valueOf();if(ie!=null&&ie!==Mt)return i.from(ie,Ot,Lt);let be=x(Mt);if(be)return be;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Mt[Symbol.toPrimitive]=="function")return i.from(Mt[Symbol.toPrimitive]("string"),Ot,Lt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Mt)}i.from=function(Mt,Ot,Lt){return a(Mt,Ot,Lt)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(Mt){if(typeof Mt!="number")throw new TypeError('"size" argument must be of type number');if(Mt<0)throw new RangeError('The value "'+Mt+'" is invalid for option "size"')}function o(Mt,Ot,Lt){return l(Mt),Mt<=0?n(Mt):Ot!==void 0?typeof Lt=="string"?n(Mt).fill(Ot,Lt):n(Mt).fill(Ot):n(Mt)}i.alloc=function(Mt,Ot,Lt){return o(Mt,Ot,Lt)};function c(Mt){return l(Mt),n(Mt<0?0:_(Mt)|0)}i.allocUnsafe=function(Mt){return c(Mt)},i.allocUnsafeSlow=function(Mt){return c(Mt)};function s(Mt,Ot){if((typeof Ot!="string"||Ot==="")&&(Ot="utf8"),!i.isEncoding(Ot))throw new TypeError("Unknown encoding: "+Ot);let Lt=d(Mt,Ot)|0,ie=n(Lt),be=ie.write(Mt,Ot);return be!==Lt&&(ie=ie.slice(0,be)),ie}function h(Mt){let Ot=Mt.length<0?0:_(Mt.length)|0,Lt=n(Ot);for(let ie=0;ie=z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z.toString(16)+" bytes");return Mt|0}function A(Mt){return+Mt!=Mt&&(Mt=0),i.alloc(+Mt)}i.isBuffer=function(Mt){return Mt!=null&&Mt._isBuffer===!0&&Mt!==i.prototype},i.compare=function(Mt,Ot){if(ee(Mt,Uint8Array)&&(Mt=i.from(Mt,Mt.offset,Mt.byteLength)),ee(Ot,Uint8Array)&&(Ot=i.from(Ot,Ot.offset,Ot.byteLength)),!i.isBuffer(Mt)||!i.isBuffer(Ot))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Mt===Ot)return 0;let Lt=Mt.length,ie=Ot.length;for(let be=0,ce=Math.min(Lt,ie);beie.length?(i.isBuffer(ce)||(ce=i.from(ce)),ce.copy(ie,be)):Uint8Array.prototype.set.call(ie,ce,be);else if(i.isBuffer(ce))ce.copy(ie,be);else throw new TypeError('"list" argument must be an Array of Buffers');be+=ce.length}return ie};function d(Mt,Ot){if(i.isBuffer(Mt))return Mt.length;if(ArrayBuffer.isView(Mt)||ee(Mt,ArrayBuffer))return Mt.byteLength;if(typeof Mt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Mt);let Lt=Mt.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&Lt===0)return 0;let be=!1;for(;;)switch(Ot){case"ascii":case"latin1":case"binary":return Lt;case"utf8":case"utf-8":return Ct(Mt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt*2;case"hex":return Lt>>>1;case"base64":return Zt(Mt).length;default:if(be)return ie?-1:Ct(Mt).length;Ot=(""+Ot).toLowerCase(),be=!0}}i.byteLength=d;function k(Mt,Ot,Lt){let ie=!1;if((Ot===void 0||Ot<0)&&(Ot=0),Ot>this.length||((Lt===void 0||Lt>this.length)&&(Lt=this.length),Lt<=0)||(Lt>>>=0,Ot>>>=0,Lt<=Ot))return"";for(Mt||(Mt="utf8");;)switch(Mt){case"hex":return F(this,Ot,Lt);case"utf8":case"utf-8":return N(this,Ot,Lt);case"ascii":return V(this,Ot,Lt);case"latin1":case"binary":return W(this,Ot,Lt);case"base64":return S(this,Ot,Lt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,Ot,Lt);default:if(ie)throw new TypeError("Unknown encoding: "+Mt);Mt=(Mt+"").toLowerCase(),ie=!0}}i.prototype._isBuffer=!0;function w(Mt,Ot,Lt){let ie=Mt[Ot];Mt[Ot]=Mt[Lt],Mt[Lt]=ie}i.prototype.swap16=function(){let Mt=this.length;if(Mt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Ot=0;OtOt&&(Mt+=" ... "),""},y&&(i.prototype[y]=i.prototype.inspect),i.prototype.compare=function(Mt,Ot,Lt,ie,be){if(ee(Mt,Uint8Array)&&(Mt=i.from(Mt,Mt.offset,Mt.byteLength)),!i.isBuffer(Mt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Mt);if(Ot===void 0&&(Ot=0),Lt===void 0&&(Lt=Mt?Mt.length:0),ie===void 0&&(ie=0),be===void 0&&(be=this.length),Ot<0||Lt>Mt.length||ie<0||be>this.length)throw new RangeError("out of range index");if(ie>=be&&Ot>=Lt)return 0;if(ie>=be)return-1;if(Ot>=Lt)return 1;if(Ot>>>=0,Lt>>>=0,ie>>>=0,be>>>=0,this===Mt)return 0;let ce=be-ie,Le=Lt-Ot,Ze=Math.min(ce,Le),Qe=this.slice(ie,be),mr=Mt.slice(Ot,Lt);for(let fr=0;fr2147483647?Lt=2147483647:Lt<-2147483648&&(Lt=-2147483648),Lt=+Lt,xe(Lt)&&(Lt=be?0:Mt.length-1),Lt<0&&(Lt=Mt.length+Lt),Lt>=Mt.length){if(be)return-1;Lt=Mt.length-1}else if(Lt<0)if(be)Lt=0;else return-1;if(typeof Ot=="string"&&(Ot=i.from(Ot,ie)),i.isBuffer(Ot))return Ot.length===0?-1:E(Mt,Ot,Lt,ie,be);if(typeof Ot=="number")return Ot=Ot&255,typeof Uint8Array.prototype.indexOf=="function"?be?Uint8Array.prototype.indexOf.call(Mt,Ot,Lt):Uint8Array.prototype.lastIndexOf.call(Mt,Ot,Lt):E(Mt,[Ot],Lt,ie,be);throw new TypeError("val must be string, number or Buffer")}function E(Mt,Ot,Lt,ie,be){let ce=1,Le=Mt.length,Ze=Ot.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(Mt.length<2||Ot.length<2)return-1;ce=2,Le/=2,Ze/=2,Lt/=2}function Qe(fr,Jr){return ce===1?fr[Jr]:fr.readUInt16BE(Jr*ce)}let mr;if(be){let fr=-1;for(mr=Lt;mrLe&&(Lt=Le-Ze),mr=Lt;mr>=0;mr--){let fr=!0;for(let Jr=0;Jrbe&&(ie=be)):ie=be;let ce=Ot.length;ie>ce/2&&(ie=ce/2);let Le;for(Le=0;Le>>0,isFinite(Lt)?(Lt=Lt>>>0,ie===void 0&&(ie="utf8")):(ie=Lt,Lt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let be=this.length-Ot;if((Lt===void 0||Lt>be)&&(Lt=be),Mt.length>0&&(Lt<0||Ot<0)||Ot>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let ce=!1;for(;;)switch(ie){case"hex":return I(this,Mt,Ot,Lt);case"utf8":case"utf-8":return M(this,Mt,Ot,Lt);case"ascii":case"latin1":case"binary":return p(this,Mt,Ot,Lt);case"base64":return g(this,Mt,Ot,Lt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,Mt,Ot,Lt);default:if(ce)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),ce=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(Mt,Ot,Lt){return Ot===0&&Lt===Mt.length?Y.fromByteArray(Mt):Y.fromByteArray(Mt.slice(Ot,Lt))}function N(Mt,Ot,Lt){Lt=Math.min(Mt.length,Lt);let ie=[],be=Ot;for(;be239?4:ce>223?3:ce>191?2:1;if(be+Ze<=Lt){let Qe,mr,fr,Jr;switch(Ze){case 1:ce<128&&(Le=ce);break;case 2:Qe=Mt[be+1],(Qe&192)===128&&(Jr=(ce&31)<<6|Qe&63,Jr>127&&(Le=Jr));break;case 3:Qe=Mt[be+1],mr=Mt[be+2],(Qe&192)===128&&(mr&192)===128&&(Jr=(ce&15)<<12|(Qe&63)<<6|mr&63,Jr>2047&&(Jr<55296||Jr>57343)&&(Le=Jr));break;case 4:Qe=Mt[be+1],mr=Mt[be+2],fr=Mt[be+3],(Qe&192)===128&&(mr&192)===128&&(fr&192)===128&&(Jr=(ce&15)<<18|(Qe&63)<<12|(mr&63)<<6|fr&63,Jr>65535&&Jr<1114112&&(Le=Jr))}}Le===null?(Le=65533,Ze=1):Le>65535&&(Le-=65536,ie.push(Le>>>10&1023|55296),Le=56320|Le&1023),ie.push(Le),be+=Ze}return U(ie)}var B=4096;function U(Mt){let Ot=Mt.length;if(Ot<=B)return String.fromCharCode.apply(String,Mt);let Lt="",ie=0;for(;ieie)&&(Lt=ie);let be="";for(let ce=Ot;ceLt&&(Mt=Lt),Ot<0?(Ot+=Lt,Ot<0&&(Ot=0)):Ot>Lt&&(Ot=Lt),OtLt)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(Mt,Ot,Lt){Mt=Mt>>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=this[Mt],be=1,ce=0;for(;++ce>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=this[Mt+--Ot],be=1;for(;Ot>0&&(be*=256);)ie+=this[Mt+--Ot]*be;return ie},i.prototype.readUint8=i.prototype.readUInt8=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,1,this.length),this[Mt]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,2,this.length),this[Mt]|this[Mt+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,2,this.length),this[Mt]<<8|this[Mt+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),(this[Mt]|this[Mt+1]<<8|this[Mt+2]<<16)+this[Mt+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),this[Mt]*16777216+(this[Mt+1]<<16|this[Mt+2]<<8|this[Mt+3])},i.prototype.readBigUInt64LE=ye(function(Mt){Mt=Mt>>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=Ot+this[++Mt]*2**8+this[++Mt]*2**16+this[++Mt]*2**24,be=this[++Mt]+this[++Mt]*2**8+this[++Mt]*2**16+Lt*2**24;return BigInt(ie)+(BigInt(be)<>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=Ot*2**24+this[++Mt]*2**16+this[++Mt]*2**8+this[++Mt],be=this[++Mt]*2**24+this[++Mt]*2**16+this[++Mt]*2**8+Lt;return(BigInt(ie)<>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=this[Mt],be=1,ce=0;for(;++ce=be&&(ie-=Math.pow(2,8*Ot)),ie},i.prototype.readIntBE=function(Mt,Ot,Lt){Mt=Mt>>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=Ot,be=1,ce=this[Mt+--ie];for(;ie>0&&(be*=256);)ce+=this[Mt+--ie]*be;return be*=128,ce>=be&&(ce-=Math.pow(2,8*Ot)),ce},i.prototype.readInt8=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,1,this.length),this[Mt]&128?(255-this[Mt]+1)*-1:this[Mt]},i.prototype.readInt16LE=function(Mt,Ot){Mt=Mt>>>0,Ot||q(Mt,2,this.length);let Lt=this[Mt]|this[Mt+1]<<8;return Lt&32768?Lt|4294901760:Lt},i.prototype.readInt16BE=function(Mt,Ot){Mt=Mt>>>0,Ot||q(Mt,2,this.length);let Lt=this[Mt+1]|this[Mt]<<8;return Lt&32768?Lt|4294901760:Lt},i.prototype.readInt32LE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),this[Mt]|this[Mt+1]<<8|this[Mt+2]<<16|this[Mt+3]<<24},i.prototype.readInt32BE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),this[Mt]<<24|this[Mt+1]<<16|this[Mt+2]<<8|this[Mt+3]},i.prototype.readBigInt64LE=ye(function(Mt){Mt=Mt>>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=this[Mt+4]+this[Mt+5]*2**8+this[Mt+6]*2**16+(Lt<<24);return(BigInt(ie)<>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=(Ot<<24)+this[++Mt]*2**16+this[++Mt]*2**8+this[++Mt];return(BigInt(ie)<>>0,Ot||q(Mt,4,this.length),f.read(this,Mt,!0,23,4)},i.prototype.readFloatBE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),f.read(this,Mt,!1,23,4)},i.prototype.readDoubleLE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,8,this.length),f.read(this,Mt,!0,52,8)},i.prototype.readDoubleBE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,8,this.length),f.read(this,Mt,!1,52,8)};function G(Mt,Ot,Lt,ie,be,ce){if(!i.isBuffer(Mt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ot>be||OtMt.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(Mt,Ot,Lt,ie){if(Mt=+Mt,Ot=Ot>>>0,Lt=Lt>>>0,!ie){let Le=Math.pow(2,8*Lt)-1;G(this,Mt,Ot,Lt,Le,0)}let be=1,ce=0;for(this[Ot]=Mt&255;++ce>>0,Lt=Lt>>>0,!ie){let Le=Math.pow(2,8*Lt)-1;G(this,Mt,Ot,Lt,Le,0)}let be=Lt-1,ce=1;for(this[Ot+be]=Mt&255;--be>=0&&(ce*=256);)this[Ot+be]=Mt/ce&255;return Ot+Lt},i.prototype.writeUint8=i.prototype.writeUInt8=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,1,255,0),this[Ot]=Mt&255,Ot+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,65535,0),this[Ot]=Mt&255,this[Ot+1]=Mt>>>8,Ot+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,65535,0),this[Ot]=Mt>>>8,this[Ot+1]=Mt&255,Ot+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,4294967295,0),this[Ot+3]=Mt>>>24,this[Ot+2]=Mt>>>16,this[Ot+1]=Mt>>>8,this[Ot]=Mt&255,Ot+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,4294967295,0),this[Ot]=Mt>>>24,this[Ot+1]=Mt>>>16,this[Ot+2]=Mt>>>8,this[Ot+3]=Mt&255,Ot+4};function tt(Mt,Ot,Lt,ie,be){xt(Ot,ie,be,Mt,Lt,7);let ce=Number(Ot&BigInt(4294967295));Mt[Lt++]=ce,ce=ce>>8,Mt[Lt++]=ce,ce=ce>>8,Mt[Lt++]=ce,ce=ce>>8,Mt[Lt++]=ce;let Le=Number(Ot>>BigInt(32)&BigInt(4294967295));return Mt[Lt++]=Le,Le=Le>>8,Mt[Lt++]=Le,Le=Le>>8,Mt[Lt++]=Le,Le=Le>>8,Mt[Lt++]=Le,Lt}function ht(Mt,Ot,Lt,ie,be){xt(Ot,ie,be,Mt,Lt,7);let ce=Number(Ot&BigInt(4294967295));Mt[Lt+7]=ce,ce=ce>>8,Mt[Lt+6]=ce,ce=ce>>8,Mt[Lt+5]=ce,ce=ce>>8,Mt[Lt+4]=ce;let Le=Number(Ot>>BigInt(32)&BigInt(4294967295));return Mt[Lt+3]=Le,Le=Le>>8,Mt[Lt+2]=Le,Le=Le>>8,Mt[Lt+1]=Le,Le=Le>>8,Mt[Lt]=Le,Lt+8}i.prototype.writeBigUInt64LE=ye(function(Mt,Ot=0){return tt(this,Mt,Ot,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=ye(function(Mt,Ot=0){return ht(this,Mt,Ot,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(Mt,Ot,Lt,ie){if(Mt=+Mt,Ot=Ot>>>0,!ie){let Ze=Math.pow(2,8*Lt-1);G(this,Mt,Ot,Lt,Ze-1,-Ze)}let be=0,ce=1,Le=0;for(this[Ot]=Mt&255;++be>0)-Le&255;return Ot+Lt},i.prototype.writeIntBE=function(Mt,Ot,Lt,ie){if(Mt=+Mt,Ot=Ot>>>0,!ie){let Ze=Math.pow(2,8*Lt-1);G(this,Mt,Ot,Lt,Ze-1,-Ze)}let be=Lt-1,ce=1,Le=0;for(this[Ot+be]=Mt&255;--be>=0&&(ce*=256);)Mt<0&&Le===0&&this[Ot+be+1]!==0&&(Le=1),this[Ot+be]=(Mt/ce>>0)-Le&255;return Ot+Lt},i.prototype.writeInt8=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,1,127,-128),Mt<0&&(Mt=255+Mt+1),this[Ot]=Mt&255,Ot+1},i.prototype.writeInt16LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,32767,-32768),this[Ot]=Mt&255,this[Ot+1]=Mt>>>8,Ot+2},i.prototype.writeInt16BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,32767,-32768),this[Ot]=Mt>>>8,this[Ot+1]=Mt&255,Ot+2},i.prototype.writeInt32LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,2147483647,-2147483648),this[Ot]=Mt&255,this[Ot+1]=Mt>>>8,this[Ot+2]=Mt>>>16,this[Ot+3]=Mt>>>24,Ot+4},i.prototype.writeInt32BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,2147483647,-2147483648),Mt<0&&(Mt=4294967295+Mt+1),this[Ot]=Mt>>>24,this[Ot+1]=Mt>>>16,this[Ot+2]=Mt>>>8,this[Ot+3]=Mt&255,Ot+4},i.prototype.writeBigInt64LE=ye(function(Mt,Ot=0){return tt(this,Mt,Ot,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=ye(function(Mt,Ot=0){return ht(this,Mt,Ot,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function bt(Mt,Ot,Lt,ie,be,ce){if(Lt+ie>Mt.length)throw new RangeError("Index out of range");if(Lt<0)throw new RangeError("Index out of range")}function vt(Mt,Ot,Lt,ie,be){return Ot=+Ot,Lt=Lt>>>0,be||bt(Mt,Ot,Lt,4),f.write(Mt,Ot,Lt,ie,23,4),Lt+4}i.prototype.writeFloatLE=function(Mt,Ot,Lt){return vt(this,Mt,Ot,!0,Lt)},i.prototype.writeFloatBE=function(Mt,Ot,Lt){return vt(this,Mt,Ot,!1,Lt)};function ut(Mt,Ot,Lt,ie,be){return Ot=+Ot,Lt=Lt>>>0,be||bt(Mt,Ot,Lt,8),f.write(Mt,Ot,Lt,ie,52,8),Lt+8}i.prototype.writeDoubleLE=function(Mt,Ot,Lt){return ut(this,Mt,Ot,!0,Lt)},i.prototype.writeDoubleBE=function(Mt,Ot,Lt){return ut(this,Mt,Ot,!1,Lt)},i.prototype.copy=function(Mt,Ot,Lt,ie){if(!i.isBuffer(Mt))throw new TypeError("argument should be a Buffer");if(Lt||(Lt=0),!ie&&ie!==0&&(ie=this.length),Ot>=Mt.length&&(Ot=Mt.length),Ot||(Ot=0),ie>0&&ie=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),Mt.length-Ot>>0,Lt=Lt===void 0?this.length:Lt>>>0,Mt||(Mt=0);let be;if(typeof Mt=="number")for(be=Ot;be2**32?be=it(String(Lt)):typeof Lt=="bigint"&&(be=String(Lt),(Lt>BigInt(2)**BigInt(32)||Lt<-(BigInt(2)**BigInt(32)))&&(be=it(be)),be+="n"),ie+=` It must be ${Ot}. Received ${be}`,ie},RangeError);function it(Mt){let Ot="",Lt=Mt.length,ie=Mt[0]==="-"?1:0;for(;Lt>=ie+4;Lt-=3)Ot=`_${Mt.slice(Lt-3,Lt)}${Ot}`;return`${Mt.slice(0,Lt)}${Ot}`}function st(Mt,Ot,Lt){ot(Ot,"offset"),(Mt[Ot]===void 0||Mt[Ot+Lt]===void 0)&&J(Ot,Mt.length-(Lt+1))}function xt(Mt,Ot,Lt,ie,be,ce){if(Mt>Lt||Mt= 0${Le} and < 2${Le} ** ${(ce+1)*8}${Le}`:Ze=`>= -(2${Le} ** ${(ce+1)*8-1}${Le}) and < 2 ** ${(ce+1)*8-1}${Le}`,new rt.ERR_OUT_OF_RANGE("value",Ze,Mt)}st(ie,be,ce)}function ot(Mt,Ot){if(typeof Mt!="number")throw new rt.ERR_INVALID_ARG_TYPE(Ot,"number",Mt)}function J(Mt,Ot,Lt){throw Math.floor(Mt)!==Mt?(ot(Mt,Lt),new rt.ERR_OUT_OF_RANGE("offset","an integer",Mt)):Ot<0?new rt.ERR_BUFFER_OUT_OF_BOUNDS:new rt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Ot}`,Mt)}var mt=/[^+/0-9A-Za-z-_]/g;function dt(Mt){if(Mt=Mt.split("=")[0],Mt=Mt.trim().replace(mt,""),Mt.length<2)return"";for(;Mt.length%4!==0;)Mt=Mt+"=";return Mt}function Ct(Mt,Ot){Ot=Ot||1/0;let Lt,ie=Mt.length,be=null,ce=[];for(let Le=0;Le55295&&Lt<57344){if(!be){if(Lt>56319){(Ot-=3)>-1&&ce.push(239,191,189);continue}else if(Le+1===ie){(Ot-=3)>-1&&ce.push(239,191,189);continue}be=Lt;continue}if(Lt<56320){(Ot-=3)>-1&&ce.push(239,191,189),be=Lt;continue}Lt=(be-55296<<10|Lt-56320)+65536}else be&&(Ot-=3)>-1&&ce.push(239,191,189);if(be=null,Lt<128){if((Ot-=1)<0)break;ce.push(Lt)}else if(Lt<2048){if((Ot-=2)<0)break;ce.push(Lt>>6|192,Lt&63|128)}else if(Lt<65536){if((Ot-=3)<0)break;ce.push(Lt>>12|224,Lt>>6&63|128,Lt&63|128)}else if(Lt<1114112){if((Ot-=4)<0)break;ce.push(Lt>>18|240,Lt>>12&63|128,Lt>>6&63|128,Lt&63|128)}else throw new Error("Invalid code point")}return ce}function Rt(Mt){let Ot=[];for(let Lt=0;Lt>8,be=Lt%256,ce.push(be),ce.push(ie);return ce}function Zt(Mt){return Y.toByteArray(dt(Mt))}function Gt(Mt,Ot,Lt,ie){let be;for(be=0;be=Ot.length||be>=Mt.length);++be)Ot[be+Lt]=Mt[be];return be}function ee(Mt,Ot){return Mt instanceof Ot||Mt!=null&&Mt.constructor!=null&&Mt.constructor.name!=null&&Mt.constructor.name===Ot.name}function xe(Mt){return Mt!==Mt}var ge=function(){let Mt="0123456789abcdef",Ot=new Array(256);for(let Lt=0;Lt<16;++Lt){let ie=Lt*16;for(let be=0;be<16;++be)Ot[ie+be]=Mt[Lt]+Mt[be]}return Ot}();function ye(Mt){return typeof BigInt>"u"?ue:Mt}function ue(){throw new Error("BigInt not supported")}}),sC=It((et,Y)=>{Y.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var f={},y=Symbol("test"),z=Object(y);if(typeof y=="string"||Object.prototype.toString.call(y)!=="[object Symbol]"||Object.prototype.toString.call(z)!=="[object Symbol]")return!1;var P=42;f[y]=P;for(var n in f)return!1;if(typeof Object.keys=="function"&&Object.keys(f).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(f).length!==0)return!1;var i=Object.getOwnPropertySymbols(f);if(i.length!==1||i[0]!==y||!Object.prototype.propertyIsEnumerable.call(f,y))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(f,y);if(a.value!==P||a.enumerable!==!0)return!1}return!0}}),rk=It((et,Y)=>{var f=sC();Y.exports=function(){return f()&&!!Symbol.toStringTag}}),EP=It((et,Y)=>{Y.exports=Object}),XG=It((et,Y)=>{Y.exports=Error}),JG=It((et,Y)=>{Y.exports=EvalError}),QG=It((et,Y)=>{Y.exports=RangeError}),tZ=It((et,Y)=>{Y.exports=ReferenceError}),LP=It((et,Y)=>{Y.exports=SyntaxError}),Rw=It((et,Y)=>{Y.exports=TypeError}),eZ=It((et,Y)=>{Y.exports=URIError}),rZ=It((et,Y)=>{Y.exports=Math.abs}),nZ=It((et,Y)=>{Y.exports=Math.floor}),iZ=It((et,Y)=>{Y.exports=Math.max}),aZ=It((et,Y)=>{Y.exports=Math.min}),oZ=It((et,Y)=>{Y.exports=Math.pow}),sZ=It((et,Y)=>{Y.exports=Math.round}),lZ=It((et,Y)=>{Y.exports=Number.isNaN||function(f){return f!==f}}),cZ=It((et,Y)=>{var f=lZ();Y.exports=function(y){return f(y)||y===0?y:y<0?-1:1}}),uZ=It((et,Y)=>{Y.exports=Object.getOwnPropertyDescriptor}),_b=It((et,Y)=>{var f=uZ();if(f)try{f([],"length")}catch{f=null}Y.exports=f}),nk=It((et,Y)=>{var f=Object.defineProperty||!1;if(f)try{f({},"a",{value:1})}catch{f=!1}Y.exports=f}),hZ=It((et,Y)=>{var f=typeof Symbol<"u"&&Symbol,y=sC();Y.exports=function(){return typeof f!="function"||typeof Symbol!="function"||typeof f("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:y()}}),PP=It((et,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),IP=It((et,Y)=>{var f=EP();Y.exports=f.getPrototypeOf||null}),dZ=It((et,Y)=>{var f="Function.prototype.bind called on incompatible ",y=Object.prototype.toString,z=Math.max,P="[object Function]",n=function(l,o){for(var c=[],s=0;s{var f=dZ();Y.exports=Function.prototype.bind||f}),lC=It((et,Y)=>{Y.exports=Function.prototype.call}),DP=It((et,Y)=>{Y.exports=Function.prototype.apply}),fZ=It((et,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),pZ=It((et,Y)=>{var f=Fw(),y=DP(),z=lC(),P=fZ();Y.exports=P||f.call(z,y)}),mZ=It((et,Y)=>{var f=Fw(),y=Rw(),z=lC(),P=pZ();Y.exports=function(n){if(n.length<1||typeof n[0]!="function")throw new y("a function is required");return P(f,z,n)}}),gZ=It((et,Y)=>{var f=mZ(),y=_b(),z;try{z=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var P=!!z&&y&&y(Object.prototype,"__proto__"),n=Object,i=n.getPrototypeOf;Y.exports=P&&typeof P.get=="function"?f([P.get]):typeof i=="function"?function(a){return i(a==null?a:n(a))}:!1}),vZ=It((et,Y)=>{var f=PP(),y=IP(),z=gZ();Y.exports=f?function(P){return f(P)}:y?function(P){if(!P||typeof P!="object"&&typeof P!="function")throw new TypeError("getProto: not an object");return y(P)}:z?function(P){return z(P)}:null}),yZ=It((et,Y)=>{var f=Function.prototype.call,y=Object.prototype.hasOwnProperty,z=Fw();Y.exports=z.call(f,y)}),cC=It((et,Y)=>{var f,y=EP(),z=XG(),P=JG(),n=QG(),i=tZ(),a=LP(),l=Rw(),o=eZ(),c=rZ(),s=nZ(),h=iZ(),m=aZ(),b=oZ(),x=sZ(),_=cZ(),A=Function,d=function(st){try{return A('"use strict"; return ('+st+").constructor;")()}catch{}},k=_b(),w=nk(),D=function(){throw new l},E=k?function(){try{return arguments.callee,D}catch{try{return k(arguments,"callee").get}catch{return D}}}():D,I=hZ()(),M=vZ(),p=IP(),g=PP(),C=DP(),S=lC(),N={},B=typeof Uint8Array>"u"||!M?f:M(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?f:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?f:ArrayBuffer,"%ArrayIteratorPrototype%":I&&M?M([][Symbol.iterator]()):f,"%AsyncFromSyncIteratorPrototype%":f,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?f:Atomics,"%BigInt%":typeof BigInt>"u"?f:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?f:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?f:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?f:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":z,"%eval%":eval,"%EvalError%":P,"%Float16Array%":typeof Float16Array>"u"?f:Float16Array,"%Float32Array%":typeof Float32Array>"u"?f:Float32Array,"%Float64Array%":typeof Float64Array>"u"?f:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?f:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?f:Int8Array,"%Int16Array%":typeof Int16Array>"u"?f:Int16Array,"%Int32Array%":typeof Int32Array>"u"?f:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":I&&M?M(M([][Symbol.iterator]())):f,"%JSON%":typeof JSON=="object"?JSON:f,"%Map%":typeof Map>"u"?f:Map,"%MapIteratorPrototype%":typeof Map>"u"||!I||!M?f:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":y,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?f:Promise,"%Proxy%":typeof Proxy>"u"?f:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?f:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?f:Set,"%SetIteratorPrototype%":typeof Set>"u"||!I||!M?f:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?f:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&M?M(""[Symbol.iterator]()):f,"%Symbol%":I?Symbol:f,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":B,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?f:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?f:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?f:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?f:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?f:WeakMap,"%WeakRef%":typeof WeakRef>"u"?f:WeakRef,"%WeakSet%":typeof WeakSet>"u"?f:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":C,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":p,"%Math.abs%":c,"%Math.floor%":s,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":b,"%Math.round%":x,"%Math.sign%":_,"%Reflect.getPrototypeOf%":g};if(M)try{null.error}catch(st){V=M(M(st)),U["%Error.prototype%"]=V}var V,W=function st(xt){var ot;if(xt==="%AsyncFunction%")ot=d("async function () {}");else if(xt==="%GeneratorFunction%")ot=d("function* () {}");else if(xt==="%AsyncGeneratorFunction%")ot=d("async function* () {}");else if(xt==="%AsyncGenerator%"){var J=st("%AsyncGeneratorFunction%");J&&(ot=J.prototype)}else if(xt==="%AsyncIteratorPrototype%"){var mt=st("%AsyncGenerator%");mt&&M&&(ot=M(mt.prototype))}return U[xt]=ot,ot},F={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},H=Fw(),q=yZ(),G=H.call(S,Array.prototype.concat),tt=H.call(C,Array.prototype.splice),ht=H.call(S,String.prototype.replace),bt=H.call(S,String.prototype.slice),vt=H.call(S,RegExp.prototype.exec),ut=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rt=/\\(\\)?/g,gt=function(st){var xt=bt(st,0,1),ot=bt(st,-1);if(xt==="%"&&ot!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(ot==="%"&&xt!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var J=[];return ht(st,ut,function(mt,dt,Ct,Rt){J[J.length]=Ct?ht(Rt,rt,"$1"):dt||mt}),J},it=function(st,xt){var ot=st,J;if(q(F,ot)&&(J=F[ot],ot="%"+J[0]+"%"),q(U,ot)){var mt=U[ot];if(mt===N&&(mt=W(ot)),typeof mt>"u"&&!xt)throw new l("intrinsic "+st+" exists, but is not available. Please file an issue!");return{alias:J,name:ot,value:mt}}throw new a("intrinsic "+st+" does not exist!")};Y.exports=function(st,xt){if(typeof st!="string"||st.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof xt!="boolean")throw new l('"allowMissing" argument must be a boolean');if(vt(/^%?[^%]*%?$/,st)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ot=gt(st),J=ot.length>0?ot[0]:"",mt=it("%"+J+"%",xt),dt=mt.name,Ct=mt.value,Rt=!1,Bt=mt.alias;Bt&&(J=Bt[0],tt(ot,G([0,1],Bt)));for(var Zt=1,Gt=!0;Zt=ot.length){var ye=k(Ct,ee);Gt=!!ye,Gt&&"get"in ye&&!("originalValue"in ye.get)?Ct=ye.get:Ct=Ct[ee]}else Gt=q(Ct,ee),Ct=Ct[ee];Gt&&!Rt&&(U[dt]=Ct)}}return Ct}}),_Z=It((et,Y)=>{var f=nk(),y=LP(),z=Rw(),P=_b();Y.exports=function(n,i,a){if(!n||typeof n!="object"&&typeof n!="function")throw new z("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new z("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new z("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new z("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new z("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new z("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,h=!!P&&P(n,i);if(f)f(n,i,{configurable:c===null&&h?h.configurable:!c,enumerable:l===null&&h?h.enumerable:!l,value:a,writable:o===null&&h?h.writable:!o});else if(s||!l&&!o&&!c)n[i]=a;else throw new y("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),zP=It((et,Y)=>{var f=nk(),y=function(){return!!f};y.hasArrayLengthDefineBug=function(){if(!f)return null;try{return f([],"length",{value:1}).length!==1}catch{return!0}},Y.exports=y}),xZ=It((et,Y)=>{var f=cC(),y=_Z(),z=zP()(),P=_b(),n=Rw(),i=f("%Math.floor%");Y.exports=function(a,l){if(typeof a!="function")throw new n("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||i(l)!==l)throw new n("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],c=!0,s=!0;if("length"in a&&P){var h=P(a,"length");h&&!h.configurable&&(c=!1),h&&!h.writable&&(s=!1)}return(c||s||!o)&&(z?y(a,"length",l,!0,!0):y(a,"length",l)),a}}),ik=It((et,Y)=>{var f=Fw(),y=cC(),z=xZ(),P=Rw(),n=y("%Function.prototype.apply%"),i=y("%Function.prototype.call%"),a=y("%Reflect.apply%",!0)||f.call(i,n),l=nk(),o=y("%Math.max%");Y.exports=function(s){if(typeof s!="function")throw new P("a function is required");var h=a(f,i,arguments);return z(h,1+o(0,s.length-(arguments.length-1)),!0)};var c=function(){return a(f,n,arguments)};l?l(Y.exports,"apply",{value:c}):Y.exports.apply=c}),Nw=It((et,Y)=>{var f=cC(),y=ik(),z=y(f("String.prototype.indexOf"));Y.exports=function(P,n){var i=f(P,!!n);return typeof i=="function"&&z(P,".prototype.")>-1?y(i):i}}),bZ=It((et,Y)=>{var f=rk()(),y=Nw(),z=y("Object.prototype.toString"),P=function(a){return f&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:z(a)==="[object Arguments]"},n=function(a){return P(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&z(a)!=="[object Array]"&&z(a.callee)==="[object Function]"},i=function(){return P(arguments)}();P.isLegacyArguments=n,Y.exports=i?P:n}),wZ=It((et,Y)=>{var f=Object.prototype.toString,y=Function.prototype.toString,z=/^\s*(?:function)?\*/,P=rk()(),n=Object.getPrototypeOf,i=function(){if(!P)return!1;try{return Function("return function*() {}")()}catch{}},a;Y.exports=function(l){if(typeof l!="function")return!1;if(z.test(y.call(l)))return!0;if(!P){var o=f.call(l);return o==="[object GeneratorFunction]"}if(!n)return!1;if(typeof a>"u"){var c=i();a=c?n(c):!1}return n(l)===a}}),kZ=It((et,Y)=>{var f=Function.prototype.toString,y=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,z,P;if(typeof y=="function"&&typeof Object.defineProperty=="function")try{z=Object.defineProperty({},"length",{get:function(){throw P}}),P={},y(function(){throw 42},null,z)}catch(k){k!==P&&(y=null)}else y=null;var n=/^\s*class\b/,i=function(k){try{var w=f.call(k);return n.test(w)}catch{return!1}},a=function(k){try{return i(k)?!1:(f.call(k),!0)}catch{return!1}},l=Object.prototype.toString,o="[object Object]",c="[object Function]",s="[object GeneratorFunction]",h="[object HTMLAllCollection]",m="[object HTML document.all class]",b="[object HTMLCollection]",x=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),A=function(){return!1};typeof document=="object"&&(d=document.all,l.call(d)===l.call(document.all)&&(A=function(k){if((_||!k)&&(typeof k>"u"||typeof k=="object"))try{var w=l.call(k);return(w===h||w===m||w===b||w===o)&&k("")==null}catch{}return!1}));var d;Y.exports=y?function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;try{y(k,null,z)}catch(w){if(w!==P)return!1}return!i(k)&&a(k)}:function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;if(x)return a(k);if(i(k))return!1;var w=l.call(k);return w!==c&&w!==s&&!/^\[object HTML/.test(w)?!1:a(k)}}),OP=It((et,Y)=>{var f=kZ(),y=Object.prototype.toString,z=Object.prototype.hasOwnProperty,P=function(l,o,c){for(var s=0,h=l.length;s=3&&(s=c),y.call(l)==="[object Array]"?P(l,o,s):typeof l=="string"?n(l,o,s):i(l,o,s)};Y.exports=a}),BP=It((et,Y)=>{var f=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],y=typeof globalThis>"u"?window:globalThis;Y.exports=function(){for(var z=[],P=0;P{var f=OP(),y=BP(),z=ik(),P=Nw(),n=_b(),i=P("Object.prototype.toString"),a=rk()(),l=typeof globalThis>"u"?window:globalThis,o=y(),c=P("String.prototype.slice"),s=Object.getPrototypeOf,h=P("Array.prototype.indexOf",!0)||function(_,A){for(var d=0;d<_.length;d+=1)if(_[d]===A)return d;return-1},m={__proto__:null};a&&n&&s?f(o,function(_){var A=new l[_];if(Symbol.toStringTag in A){var d=s(A),k=n(d,Symbol.toStringTag);if(!k){var w=s(d);k=n(w,Symbol.toStringTag)}m["$"+_]=z(k.get)}}):f(o,function(_){var A=new l[_],d=A.slice||A.set;d&&(m["$"+_]=z(d))});var b=function(_){var A=!1;return f(m,function(d,k){if(!A)try{"$"+d(_)===k&&(A=c(k,1))}catch{}}),A},x=function(_){var A=!1;return f(m,function(d,k){if(!A)try{d(_),A=c(k,1)}catch{}}),A};Y.exports=function(_){if(!_||typeof _!="object")return!1;if(!a){var A=c(i(_),8,-1);return h(o,A)>-1?A:A!=="Object"?!1:x(_)}return n?b(_):null}}),SZ=It((et,Y)=>{var f=OP(),y=BP(),z=Nw(),P=z("Object.prototype.toString"),n=rk()(),i=_b(),a=typeof globalThis>"u"?window:globalThis,l=y(),o=z("Array.prototype.indexOf",!0)||function(b,x){for(var _=0;_-1}return i?m(b):!1}}),RP=It(et=>{var Y=bZ(),f=wZ(),y=TZ(),z=SZ();function P(Bt){return Bt.call.bind(Bt)}var n=typeof BigInt<"u",i=typeof Symbol<"u",a=P(Object.prototype.toString),l=P(Number.prototype.valueOf),o=P(String.prototype.valueOf),c=P(Boolean.prototype.valueOf);n&&(s=P(BigInt.prototype.valueOf));var s;i&&(h=P(Symbol.prototype.valueOf));var h;function m(Bt,Zt){if(typeof Bt!="object")return!1;try{return Zt(Bt),!0}catch{return!1}}et.isArgumentsObject=Y,et.isGeneratorFunction=f,et.isTypedArray=z;function b(Bt){return typeof Promise<"u"&&Bt instanceof Promise||Bt!==null&&typeof Bt=="object"&&typeof Bt.then=="function"&&typeof Bt.catch=="function"}et.isPromise=b;function x(Bt){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Bt):z(Bt)||tt(Bt)}et.isArrayBufferView=x;function _(Bt){return y(Bt)==="Uint8Array"}et.isUint8Array=_;function A(Bt){return y(Bt)==="Uint8ClampedArray"}et.isUint8ClampedArray=A;function d(Bt){return y(Bt)==="Uint16Array"}et.isUint16Array=d;function k(Bt){return y(Bt)==="Uint32Array"}et.isUint32Array=k;function w(Bt){return y(Bt)==="Int8Array"}et.isInt8Array=w;function D(Bt){return y(Bt)==="Int16Array"}et.isInt16Array=D;function E(Bt){return y(Bt)==="Int32Array"}et.isInt32Array=E;function I(Bt){return y(Bt)==="Float32Array"}et.isFloat32Array=I;function M(Bt){return y(Bt)==="Float64Array"}et.isFloat64Array=M;function p(Bt){return y(Bt)==="BigInt64Array"}et.isBigInt64Array=p;function g(Bt){return y(Bt)==="BigUint64Array"}et.isBigUint64Array=g;function C(Bt){return a(Bt)==="[object Map]"}C.working=typeof Map<"u"&&C(new Map);function S(Bt){return typeof Map>"u"?!1:C.working?C(Bt):Bt instanceof Map}et.isMap=S;function N(Bt){return a(Bt)==="[object Set]"}N.working=typeof Set<"u"&&N(new Set);function B(Bt){return typeof Set>"u"?!1:N.working?N(Bt):Bt instanceof Set}et.isSet=B;function U(Bt){return a(Bt)==="[object WeakMap]"}U.working=typeof WeakMap<"u"&&U(new WeakMap);function V(Bt){return typeof WeakMap>"u"?!1:U.working?U(Bt):Bt instanceof WeakMap}et.isWeakMap=V;function W(Bt){return a(Bt)==="[object WeakSet]"}W.working=typeof WeakSet<"u"&&W(new WeakSet);function F(Bt){return W(Bt)}et.isWeakSet=F;function H(Bt){return a(Bt)==="[object ArrayBuffer]"}H.working=typeof ArrayBuffer<"u"&&H(new ArrayBuffer);function q(Bt){return typeof ArrayBuffer>"u"?!1:H.working?H(Bt):Bt instanceof ArrayBuffer}et.isArrayBuffer=q;function G(Bt){return a(Bt)==="[object DataView]"}G.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&G(new DataView(new ArrayBuffer(1),0,1));function tt(Bt){return typeof DataView>"u"?!1:G.working?G(Bt):Bt instanceof DataView}et.isDataView=tt;var ht=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function bt(Bt){return a(Bt)==="[object SharedArrayBuffer]"}function vt(Bt){return typeof ht>"u"?!1:(typeof bt.working>"u"&&(bt.working=bt(new ht)),bt.working?bt(Bt):Bt instanceof ht)}et.isSharedArrayBuffer=vt;function ut(Bt){return a(Bt)==="[object AsyncFunction]"}et.isAsyncFunction=ut;function rt(Bt){return a(Bt)==="[object Map Iterator]"}et.isMapIterator=rt;function gt(Bt){return a(Bt)==="[object Set Iterator]"}et.isSetIterator=gt;function it(Bt){return a(Bt)==="[object Generator]"}et.isGeneratorObject=it;function st(Bt){return a(Bt)==="[object WebAssembly.Module]"}et.isWebAssemblyCompiledModule=st;function xt(Bt){return m(Bt,l)}et.isNumberObject=xt;function ot(Bt){return m(Bt,o)}et.isStringObject=ot;function J(Bt){return m(Bt,c)}et.isBooleanObject=J;function mt(Bt){return n&&m(Bt,s)}et.isBigIntObject=mt;function dt(Bt){return i&&m(Bt,h)}et.isSymbolObject=dt;function Ct(Bt){return xt(Bt)||ot(Bt)||J(Bt)||mt(Bt)||dt(Bt)}et.isBoxedPrimitive=Ct;function Rt(Bt){return typeof Uint8Array<"u"&&(q(Bt)||vt(Bt))}et.isAnyArrayBuffer=Rt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Bt){Object.defineProperty(et,Bt,{enumerable:!1,value:function(){throw new Error(Bt+" is not supported in userland")}})})}),FP=It((et,Y)=>{Y.exports=function(f){return f&&typeof f=="object"&&typeof f.copy=="function"&&typeof f.fill=="function"&&typeof f.readUInt8=="function"}}),NP=It(et=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var tt=Object.keys(G),ht={},bt=0;bt=vt)return it;switch(it){case"%s":return String(bt[ht++]);case"%d":return Number(bt[ht++]);case"%j":try{return JSON.stringify(bt[ht++])}catch{return"[Circular]"}default:return it}}),rt=bt[ht];ht"u")return function(){return et.deprecate(G,tt).apply(this,arguments)};var ht=!1;function bt(){if(!ht){if(process.throwDeprecation)throw new Error(tt);process.traceDeprecation?console.trace(tt):console.error(tt),ht=!0}return G.apply(this,arguments)}return bt};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;et.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var tt=process.pid;y[G]=function(){var ht=et.format.apply(et,arguments);console.error("%s %d: %s",G,tt,ht)}}else y[G]=function(){};return y[G]};function n(G,tt){var ht={seen:[],stylize:a};return arguments.length>=3&&(ht.depth=arguments[2]),arguments.length>=4&&(ht.colors=arguments[3]),_(tt)?ht.showHidden=tt:tt&&et._extend(ht,tt),E(ht.showHidden)&&(ht.showHidden=!1),E(ht.depth)&&(ht.depth=2),E(ht.colors)&&(ht.colors=!1),E(ht.customInspect)&&(ht.customInspect=!0),ht.colors&&(ht.stylize=i),o(ht,G,ht.depth)}et.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function i(G,tt){var ht=n.styles[tt];return ht?"\x1B["+n.colors[ht][0]+"m"+G+"\x1B["+n.colors[ht][1]+"m":G}function a(G,tt){return G}function l(G){var tt={};return G.forEach(function(ht,bt){tt[ht]=!0}),tt}function o(G,tt,ht){if(G.customInspect&&tt&&C(tt.inspect)&&tt.inspect!==et.inspect&&!(tt.constructor&&tt.constructor.prototype===tt)){var bt=tt.inspect(ht,G);return w(bt)||(bt=o(G,bt,ht)),bt}var vt=c(G,tt);if(vt)return vt;var ut=Object.keys(tt),rt=l(ut);if(G.showHidden&&(ut=Object.getOwnPropertyNames(tt)),g(tt)&&(ut.indexOf("message")>=0||ut.indexOf("description")>=0))return s(tt);if(ut.length===0){if(C(tt)){var gt=tt.name?": "+tt.name:"";return G.stylize("[Function"+gt+"]","special")}if(I(tt))return G.stylize(RegExp.prototype.toString.call(tt),"regexp");if(p(tt))return G.stylize(Date.prototype.toString.call(tt),"date");if(g(tt))return s(tt)}var it="",st=!1,xt=["{","}"];if(x(tt)&&(st=!0,xt=["[","]"]),C(tt)){var ot=tt.name?": "+tt.name:"";it=" [Function"+ot+"]"}if(I(tt)&&(it=" "+RegExp.prototype.toString.call(tt)),p(tt)&&(it=" "+Date.prototype.toUTCString.call(tt)),g(tt)&&(it=" "+s(tt)),ut.length===0&&(!st||tt.length==0))return xt[0]+it+xt[1];if(ht<0)return I(tt)?G.stylize(RegExp.prototype.toString.call(tt),"regexp"):G.stylize("[Object]","special");G.seen.push(tt);var J;return st?J=h(G,tt,ht,rt,ut):J=ut.map(function(mt){return m(G,tt,ht,rt,mt,st)}),G.seen.pop(),b(J,it,xt)}function c(G,tt){if(E(tt))return G.stylize("undefined","undefined");if(w(tt)){var ht="'"+JSON.stringify(tt).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(ht,"string")}if(k(tt))return G.stylize(""+tt,"number");if(_(tt))return G.stylize(""+tt,"boolean");if(A(tt))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,tt,ht,bt,vt){for(var ut=[],rt=0,gt=tt.length;rt{Y.exports=function(f){return f}}),sw=It(et=>{var Y=Sr(),f=es(),y=T_(),z=Dr().BADNUM,P=1e-9;et.findBin=function(o,c,s){if(Y(c.start))return s?Math.ceil((o-c.start)/c.size-P)-1:Math.floor((o-c.start)/c.size+P);var h=0,m=c.length,b=0,x=m>1?(c[m-1]-c[0])/(m-1):1,_,A;for(x>=0?A=s?n:i:A=s?l:a,o+=x*P*(s?-1:1)*(x>=0?1:-1);h90&&f.log("Long binary search..."),h-1};function n(o,c){return oc}function l(o,c){return o>=c}et.sorterAsc=function(o,c){return o-c},et.sorterDes=function(o,c){return c-o},et.distinctVals=function(o){var c=o.slice();c.sort(et.sorterAsc);var s;for(s=c.length-1;s>-1&&c[s]===z;s--);for(var h=c[s]-c[0]||1,m=h/(s||1)/1e4,b=[],x,_=0;_<=s;_++){var A=c[_],d=A-x;x===void 0?(b.push(A),x=A):d>m&&(h=Math.min(h,d),b.push(A),x=A)}return{vals:b,minDiff:h}},et.roundUp=function(o,c,s){for(var h=0,m=c.length-1,b,x=0,_=s?0:1,A=s?1:0,d=s?Math.ceil:Math.floor;h0&&(h=1),s&&h)return o.sort(c)}return h?o:o.reverse()},et.findIndexOfMin=function(o,c){c=c||y;for(var s=1/0,h,m=0;m{Y.exports=function(f){return Object.keys(f).sort()}}),d8=It(et=>{var Y=Sr(),f=Xn().isArrayOrTypedArray;et.aggNums=function(y,z,P,n){var i,a;if((!n||n>P.length)&&(n=P.length),Y(z)||(z=!1),f(P[0])){for(a=new Array(n),i=0;iy.length-1)return y[y.length-1];var P=z%1;return P*y[Math.ceil(z)]+(1-P)*y[Math.floor(z)]}}),f8=It((et,Y)=>{var f=Bi(),y=f.mod,z=f.modHalf,P=Math.PI,n=2*P;function i(A){return A/180*P}function a(A){return A/P*180}function l(A){return Math.abs(A[1]-A[0])>n-1e-14}function o(A,d){return z(d-A,n)}function c(A,d){return Math.abs(o(A,d))}function s(A,d){if(l(d))return!0;var k,w;d[0]w&&(w+=n);var D=y(A,n),E=D+n;return D>=k&&D<=w||E>=k&&E<=w}function h(A,d,k,w){if(!s(d,w))return!1;var D,E;return k[0]=D&&A<=E}function m(A,d,k,w,D,E,I){D=D||0,E=E||0;var M=l([k,w]),p,g,C,S,N;M?(p=0,g=P,C=n):k{et.isLeftAnchor=function(Y){return Y.xanchor==="left"||Y.xanchor==="auto"&&Y.x<=1/3},et.isCenterAnchor=function(Y){return Y.xanchor==="center"||Y.xanchor==="auto"&&Y.x>1/3&&Y.x<2/3},et.isRightAnchor=function(Y){return Y.xanchor==="right"||Y.xanchor==="auto"&&Y.x>=2/3},et.isTopAnchor=function(Y){return Y.yanchor==="top"||Y.yanchor==="auto"&&Y.y>=2/3},et.isMiddleAnchor=function(Y){return Y.yanchor==="middle"||Y.yanchor==="auto"&&Y.y>1/3&&Y.y<2/3},et.isBottomAnchor=function(Y){return Y.yanchor==="bottom"||Y.yanchor==="auto"&&Y.y<=1/3}}),m8=It(et=>{var Y=Bi().mod;et.segmentsIntersect=f;function f(i,a,l,o,c,s,h,m){var b=l-i,x=c-i,_=h-c,A=o-a,d=s-a,k=m-s,w=b*k-_*A;if(w===0)return null;var D=(x*k-_*d)/w,E=(x*A-b*d)/w;return E<0||E>1||D<0||D>1?null:{x:i+b*D,y:a+A*D}}et.segmentDistance=function(i,a,l,o,c,s,h,m){if(f(i,a,l,o,c,s,h,m))return 0;var b=l-i,x=o-a,_=h-c,A=m-s,d=b*b+x*x,k=_*_+A*A,w=Math.min(y(b,x,d,c-i,s-a),y(b,x,d,h-i,m-a),y(_,A,k,i-c,a-s),y(_,A,k,l-c,o-s));return Math.sqrt(w)};function y(i,a,l,o,c){var s=o*i+c*a;if(s<0)return o*o+c*c;if(s>l){var h=o-i,m=c-a;return h*h+m*m}else{var b=o*a-c*i;return b*b/l}}var z,P,n;et.getTextLocation=function(i,a,l,o){if((i!==P||o!==n)&&(z={},P=i,n=o),z[l])return z[l];var c=i.getPointAtLength(Y(l-o/2,a)),s=i.getPointAtLength(Y(l+o/2,a)),h=Math.atan((s.y-c.y)/(s.x-c.x)),m=i.getPointAtLength(Y(l,a)),b=(m.x*4+c.x+s.x)/6,x=(m.y*4+c.y+s.y)/6,_={x:b,y:x,theta:h};return z[l]=_,_},et.clearLocationCache=function(){P=null},et.getVisibleSegment=function(i,a,l){var o=a.left,c=a.right,s=a.top,h=a.bottom,m=0,b=i.getTotalLength(),x=b,_,A;function d(w){var D=i.getPointAtLength(w);w===0?_=D:w===b&&(A=D);var E=D.xc?D.x-c:0,I=D.yh?D.y-h:0;return Math.sqrt(E*E+I*I)}for(var k=d(m);k;){if(m+=k+l,m>x)return;k=d(m)}for(k=d(x);k;){if(x-=k+l,m>x)return;k=d(x)}return{min:m,max:x,len:x-m,total:b,isClosed:m===0&&x===b&&Math.abs(_.x-A.x)<.1&&Math.abs(_.y-A.y)<.1}},et.findPointOnPath=function(i,a,l,o){o=o||{};for(var c=o.pathLength||i.getTotalLength(),s=o.tolerance||.001,h=o.iterationLimit||30,m=i.getPointAtLength(0)[l]>i.getPointAtLength(c)[l]?-1:1,b=0,x=0,_=c,A,d,k;b0?_=A:x=A,b++}return d}}),lw=It(et=>{var Y={};et.throttle=function(y,z,P){var n=Y[y],i=Date.now();if(!n){for(var a in Y)Y[a].tsn.ts+z){l();return}n.timer=setTimeout(function(){l(),n.timer=null},z)},et.done=function(y){var z=Y[y];return!z||!z.timer?Promise.resolve():new Promise(function(P){var n=z.onDone;z.onDone=function(){n&&n(),P(),z.onDone=null}})},et.clear=function(y){if(y)f(Y[y]),delete Y[y];else for(var z in Y)et.clear(z)};function f(y){y&&y.timer!==null&&(clearTimeout(y.timer),y.timer=null)}}),cw=It((et,Y)=>{Y.exports=function(f){f._responsiveChartHandler&&(window.removeEventListener("resize",f._responsiveChartHandler),delete f._responsiveChartHandler)}}),S_=It((et,Y)=>{Y.exports=P,Y.exports.isMobile=P,Y.exports.default=P;var f=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,y=/CrOS/,z=/android|ipad|playbook|silk/i;function P(n){n||(n={});let i=n.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;let a=f.test(i)&&!y.test(i)||!!n.tablet&&z.test(i);return!a&&n.tablet&&n.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(a=!0),a}}),k4=It((et,Y)=>{var f=Sr(),y=S_();Y.exports=function(P){var n;if(P&&P.hasOwnProperty("userAgent")?n=P.userAgent:n=z(),typeof n!="string")return!0;var i=y({ua:{headers:{"user-agent":n}},tablet:!0,featureDetect:!1});if(!i)for(var a=n.split(" "),l=1;l-1;c--){var s=a[c];if(s.substr(0,8)==="Version/"){var h=s.substr(8).split(".")[0];if(f(h)&&(h=+h),h>=13)return!0}}}return i};function z(){var P;return typeof navigator<"u"&&(P=navigator.userAgent),P&&P.headers&&typeof P.headers["user-agent"]=="string"&&(P=P.headers["user-agent"]),P}}),T4=It((et,Y)=>{var f=Br();Y.exports=function(y,z,P){var n=y.selectAll("g."+P.replace(/\s/g,".")).data(z,function(a){return a[0].trace.uid});n.exit().remove(),n.enter().append("g").attr("class",P),n.order();var i=y.classed("rangeplot")?"nodeRangePlot3":"node3";return n.each(function(a){a[0][i]=f.select(this)}),n}}),C_=It((et,Y)=>{var f=ls();Y.exports=function(y,z){for(var P=y._context.locale,n=0;n<2;n++){for(var i=y._context.locales,a=0;a<2;a++){var l=(i[P]||{}).dictionary;if(l){var o=l[z];if(o)return o}i=f.localeRegistry}var c=P.split("-")[0];if(c===P)break;P=c}return z}}),$u=It((et,Y)=>{Y.exports=function(f){for(var y={},z=[],P=0,n=0;n{Y.exports=function(P){for(var n=z(P)?y:f,i=[],a=0;a{Y.exports=function(f,y){if(!y)return f;var z=1/Math.abs(y),P=z>1?(z*f+z*y)/z:f+y,n=String(P).length;if(n>16){var i=String(y).length,a=String(f).length;if(n>=a+i){var l=parseFloat(P).toPrecision(12);l.indexOf("e+")===-1&&(P=+l)}}return P}}),J1=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;Y.exports=function(P){return typeof P=="string"&&(P=P.replace(z,"")),f(P)?Number(P):y}}),jn=It((et,Y)=>{var f=Br(),y=on().utcFormat,z=pr().format,P=Sr(),n=Dr(),i=n.FP_SAFE,a=-i,l=n.BADNUM,o=Y.exports={};o.adjustFormat=function(ot){return!ot||/^\d[.]\df/.test(ot)||/[.]\d%/.test(ot)?ot:ot==="0.f"?"~f":/^\d%/.test(ot)?"~%":/^\ds/.test(ot)?"~s":!/^[~,.0$]/.test(ot)&&/[&fps]/.test(ot)?"~"+ot:ot};var c={};o.warnBadFormat=function(ot){var J=String(ot);c[J]||(c[J]=1,o.warn('encountered bad format: "'+J+'"'))},o.noFormat=function(ot){return String(ot)},o.numberFormat=function(ot){var J;try{J=z(o.adjustFormat(ot))}catch{return o.warnBadFormat(ot),o.noFormat}return J},o.nestedProperty=_i(),o.keyedContainer=ta(),o.relativeAttr=va(),o.isPlainObject=Cn(),o.toLogRange=_a(),o.relinkPrivateKeys=qi();var s=Xn();o.isArrayBuffer=s.isArrayBuffer,o.isTypedArray=s.isTypedArray,o.isArrayOrTypedArray=s.isArrayOrTypedArray,o.isArray1D=s.isArray1D,o.ensureArray=s.ensureArray,o.concat=s.concat,o.maxRowLength=s.maxRowLength,o.minRowLength=s.minRowLength;var h=Bi();o.mod=h.mod,o.modHalf=h.modHalf;var m=qa();o.valObjectMeta=m.valObjectMeta,o.coerce=m.coerce,o.coerce2=m.coerce2,o.coerceFont=m.coerceFont,o.coercePattern=m.coercePattern,o.coerceHoverinfo=m.coerceHoverinfo,o.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,o.validate=m.validate;var b=h8();o.dateTime2ms=b.dateTime2ms,o.isDateTime=b.isDateTime,o.ms2DateTime=b.ms2DateTime,o.ms2DateTimeLocal=b.ms2DateTimeLocal,o.cleanDate=b.cleanDate,o.isJSDate=b.isJSDate,o.formatDate=b.formatDate,o.incrementMonth=b.incrementMonth,o.dateTick0=b.dateTick0,o.dfltRange=b.dfltRange,o.findExactDates=b.findExactDates,o.MIN_MS=b.MIN_MS,o.MAX_MS=b.MAX_MS;var x=sw();o.findBin=x.findBin,o.sorterAsc=x.sorterAsc,o.sorterDes=x.sorterDes,o.distinctVals=x.distinctVals,o.roundUp=x.roundUp,o.sort=x.sort,o.findIndexOfMin=x.findIndexOfMin,o.sortObjectKeys=Xm();var _=d8();o.aggNums=_.aggNums,o.len=_.len,o.mean=_.mean,o.geometricMean=_.geometricMean,o.median=_.median,o.midRange=_.midRange,o.variance=_.variance,o.stdev=_.stdev,o.interp=_.interp;var A=aw();o.init2dArray=A.init2dArray,o.transposeRagged=A.transposeRagged,o.dot=A.dot,o.translationMatrix=A.translationMatrix,o.rotationMatrix=A.rotationMatrix,o.rotationXYMatrix=A.rotationXYMatrix,o.apply3DTransform=A.apply3DTransform,o.apply2DTransform=A.apply2DTransform,o.apply2DTransform2=A.apply2DTransform2,o.convertCssMatrix=A.convertCssMatrix,o.inverseTransformMatrix=A.inverseTransformMatrix;var d=f8();o.deg2rad=d.deg2rad,o.rad2deg=d.rad2deg,o.angleDelta=d.angleDelta,o.angleDist=d.angleDist,o.isFullCircle=d.isFullCircle,o.isAngleInsideSector=d.isAngleInsideSector,o.isPtInsideSector=d.isPtInsideSector,o.pathArc=d.pathArc,o.pathSector=d.pathSector,o.pathAnnulus=d.pathAnnulus;var k=p8();o.isLeftAnchor=k.isLeftAnchor,o.isCenterAnchor=k.isCenterAnchor,o.isRightAnchor=k.isRightAnchor,o.isTopAnchor=k.isTopAnchor,o.isMiddleAnchor=k.isMiddleAnchor,o.isBottomAnchor=k.isBottomAnchor;var w=m8();o.segmentsIntersect=w.segmentsIntersect,o.segmentDistance=w.segmentDistance,o.getTextLocation=w.getTextLocation,o.clearLocationCache=w.clearLocationCache,o.getVisibleSegment=w.getVisibleSegment,o.findPointOnPath=w.findPointOnPath;var D=Yn();o.extendFlat=D.extendFlat,o.extendDeep=D.extendDeep,o.extendDeepAll=D.extendDeepAll,o.extendDeepNoArrays=D.extendDeepNoArrays;var E=es();o.log=E.log,o.warn=E.warn,o.error=E.error;var I=Ha();o.counterRegex=I.counter;var M=lw();o.throttle=M.throttle,o.throttleDone=M.done,o.clearThrottle=M.clear;var p=W0();o.getGraphDiv=p.getGraphDiv,o.isPlotDiv=p.isPlotDiv,o.removeElement=p.removeElement,o.addStyleRule=p.addStyleRule,o.addRelatedStyleRule=p.addRelatedStyleRule,o.deleteRelatedStyleRule=p.deleteRelatedStyleRule,o.setStyleOnHover=p.setStyleOnHover,o.getFullTransformMatrix=p.getFullTransformMatrix,o.getElementTransformMatrix=p.getElementTransformMatrix,o.getElementAndAncestors=p.getElementAndAncestors,o.equalDomRects=p.equalDomRects,o.clearResponsive=cw(),o.preserveDrawingBuffer=k4(),o.makeTraceGroups=T4(),o._=C_(),o.notifier=Wo(),o.filterUnique=$u(),o.filterVisible=Bd(),o.pushUnique=Ys(),o.increment=Qx(),o.cleanNumber=J1(),o.ensureNumber=function(ot){return P(ot)?(ot=Number(ot),ot>i||ot=J?!1:P(ot)&&ot>=0&&ot%1===0},o.noop=Io(),o.identity=T_(),o.repeat=function(ot,J){for(var mt=new Array(J),dt=0;dtmt?Math.max(mt,Math.min(J,ot)):Math.max(J,Math.min(mt,ot))},o.bBoxIntersect=function(ot,J,mt){return mt=mt||0,ot.left<=J.right+mt&&J.left<=ot.right+mt&&ot.top<=J.bottom+mt&&J.top<=ot.bottom+mt},o.simpleMap=function(ot,J,mt,dt,Ct){for(var Rt=ot.length,Bt=new Array(Rt),Zt=0;Zt=Math.pow(2,mt)?Ct>10?(o.warn("randstr failed uniqueness"),Bt):ot(J,mt,dt,(Ct||0)+1):Bt},o.OptionControl=function(ot,J){ot||(ot={}),J||(J="opt");var mt={};return mt.optionList=[],mt._newoption=function(dt){dt[J]=ot,mt[dt.name]=dt,mt.optionList.push(dt)},mt["_"+J]=ot,mt},o.smooth=function(ot,J){if(J=Math.round(J)||0,J<2)return ot;var mt=ot.length,dt=2*mt,Ct=2*J-1,Rt=new Array(Ct),Bt=new Array(mt),Zt,Gt,ee,xe;for(Zt=0;Zt=dt&&(ee-=dt*Math.floor(ee/dt)),ee<0?ee=-1-ee:ee>=mt&&(ee=dt-1-ee),xe+=ot[ee]*Rt[Gt];Bt[Zt]=xe}return Bt},o.syncOrAsync=function(ot,J,mt){var dt,Ct;function Rt(){return o.syncOrAsync(ot,J,mt)}for(;ot.length;)if(Ct=ot.splice(0,1)[0],dt=Ct(J),dt&&dt.then)return dt.then(Rt);return mt&&mt(J)},o.stripTrailingSlash=function(ot){return ot.substr(-1)==="/"?ot.substr(0,ot.length-1):ot},o.noneOrAll=function(ot,J,mt){if(ot){var dt=!1,Ct=!0,Rt,Bt;for(Rt=0;Rt0?Ct:0})},o.fillArray=function(ot,J,mt,dt){if(dt=dt||o.identity,o.isArrayOrTypedArray(ot))for(var Ct=0;CtB.test(window.navigator.userAgent);var U=/Firefox\/(\d+)\.\d+/;o.getFirefoxVersion=function(){var ot=U.exec(window.navigator.userAgent);if(ot&&ot.length===2){var J=parseInt(ot[1]);if(!isNaN(J))return J}return null},o.isD3Selection=function(ot){return ot instanceof f.selection},o.ensureSingle=function(ot,J,mt,dt){var Ct=ot.select(J+(mt?"."+mt:""));if(Ct.size())return Ct;var Rt=ot.append(J);return mt&&Rt.classed(mt,!0),dt&&Rt.call(dt),Rt},o.ensureSingleById=function(ot,J,mt,dt){var Ct=ot.select(J+"#"+mt);if(Ct.size())return Ct;var Rt=ot.append(J).attr("id",mt);return dt&&Rt.call(dt),Rt},o.objectFromPath=function(ot,J){for(var mt=ot.split("."),dt,Ct=dt={},Rt=0;Rt1?Ct+Bt[1]:"";if(Rt&&(Bt.length>1||Zt.length>4||mt))for(;dt.test(Zt);)Zt=Zt.replace(dt,"$1"+Rt+"$2");return Zt+Gt},o.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var H=/^\w*$/;o.templateString=function(ot,J){var mt={};return ot.replace(o.TEMPLATE_STRING_REGEX,function(dt,Ct){var Rt;return H.test(Ct)?Rt=J[Ct]:(mt[Ct]=mt[Ct]||o.nestedProperty(J,Ct).get,Rt=mt[Ct](!0)),Rt!==void 0?Rt:""})};var q={max:10,count:0,name:"hovertemplate"};o.hovertemplateString=ot=>ut(Ce(we({},ot),{opts:q}));var G={max:10,count:0,name:"texttemplate"};o.texttemplateString=ot=>ut(Ce(we({},ot),{opts:G}));var tt=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function ht(ot){var J=ot.match(tt);return J?{key:J[1],op:J[2],number:Number(J[3])}:{key:ot,op:null,number:null}}var bt={max:10,count:0,name:"texttemplate",parseMultDiv:!0};o.texttemplateStringForShapes=ot=>ut(Ce(we({},ot),{opts:bt}));var vt=/^[:|\|]/;function ut({data:ot=[],locale:J,fallback:mt,labels:dt={},opts:Ct,template:Rt}){return Rt.replace(o.TEMPLATE_STRING_REGEX,(Bt,Zt,Gt)=>{let ee=["xother","yother"].includes(Zt),xe=["_xother","_yother"].includes(Zt),ge=["_xother_","_yother_"].includes(Zt),ye=["xother_","yother_"].includes(Zt),ue=ee||xe||ye||ge;(xe||ge)&&(Zt=Zt.substring(1)),(ye||ge)&&(Zt=Zt.substring(0,Zt.length-1));let Mt=null,Ot=null;if(Ct.parseMultDiv){var Lt=ht(Zt);Zt=Lt.key,Mt=Lt.op,Ot=Lt.number}let ie;if(ue){if(dt[Zt]===void 0)return"";ie=dt[Zt]}else for(let Ze of ot)if(Ze){if(Ze.hasOwnProperty(Zt)){ie=Ze[Zt];break}if(H.test(Zt)||(ie=o.nestedProperty(Ze,Zt).get(!0)),ie!==void 0)break}if(ie===void 0){let{count:Ze,max:Qe,name:mr}=Ct,fr=mt===!1?Bt:mt;return Ze=rt&&Bt<=gt,ee=Zt>=rt&&Zt<=gt;if(Gt&&(dt=10*dt+Bt-rt),ee&&(Ct=10*Ct+Zt-rt),!Gt||!ee){if(dt!==Ct)return dt-Ct;if(Bt!==Zt)return Bt-Zt}}return Ct-dt};var it=2e9;o.seedPseudoRandom=function(){it=2e9},o.pseudoRandom=function(){var ot=it;return it=(69069*it+1)%4294967296,Math.abs(it-ot)<429496729?o.pseudoRandom():it/4294967296},o.fillText=function(ot,J,mt){var dt=Array.isArray(mt)?function(Bt){mt.push(Bt)}:function(Bt){mt.text=Bt},Ct=o.extractOption(ot,J,"htx","hovertext");if(o.isValidTextValue(Ct))return dt(Ct);var Rt=o.extractOption(ot,J,"tx","text");if(o.isValidTextValue(Rt))return dt(Rt)},o.isValidTextValue=function(ot){return ot||ot===0},o.formatPercent=function(ot,J){J=J||0;for(var mt=(Math.round(100*ot*Math.pow(10,J))*Math.pow(.1,J)).toFixed(J)+"%",dt=0;dt1&&(ee=1):ee=0,o.strTranslate(Ct-ee*(mt+Bt),Rt-ee*(dt+Zt))+o.strScale(ee)+(Gt?"rotate("+Gt+(J?"":" "+mt+" "+dt)+")":"")},o.setTransormAndDisplay=function(ot,J){ot.attr("transform",o.getTextTransform(J)),ot.style("display",J.scale?null:"none")},o.ensureUniformFontSize=function(ot,J){var mt=o.extendFlat({},J);return mt.size=Math.max(J.size,ot._fullLayout.uniformtext.minsize||0),mt},o.join2=function(ot,J,mt){var dt=ot.length;return dt>1?ot.slice(0,-1).join(J)+mt+ot[dt-1]:ot.join(J)},o.bigFont=function(ot){return Math.round(1.2*ot)};var st=o.getFirefoxVersion(),xt=st!==null&&st<86;o.getPositionFromD3Event=function(){return xt?[f.event.layerX,f.event.layerY]:[f.event.offsetX,f.event.offsetY]}}),uw=It(()=>{var et=jn(),Y={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(y in Y)f=y.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),et.addStyleRule(f,Y[y]);var f,y}),Qc=It((et,Y)=>{Y.exports=!0}),Jd=It((et,Y)=>{var f=Qc(),y;typeof window.matchMedia=="function"?y=!window.matchMedia("(hover: none)").matches:y=f,Y.exports=y}),Wg=It((et,Y)=>{var f=typeof Reflect=="object"?Reflect:null,y=f&&typeof f.apply=="function"?f.apply:function(D,E,I){return Function.prototype.apply.call(D,E,I)},z;f&&typeof f.ownKeys=="function"?z=f.ownKeys:Object.getOwnPropertySymbols?z=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:z=function(D){return Object.getOwnPropertyNames(D)};function P(D){console&&console.warn&&console.warn(D)}var n=Number.isNaN||function(D){return D!==D};function i(){i.init.call(this)}Y.exports=i,Y.exports.once=d,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function l(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(D){if(typeof D!="number"||D<0||n(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");a=D}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||n(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function o(D){return D._maxListeners===void 0?i.defaultMaxListeners:D._maxListeners}i.prototype.getMaxListeners=function(){return o(this)},i.prototype.emit=function(D){for(var E=[],I=1;I0&&(g=E[0]),g instanceof Error)throw g;var C=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw C.context=g,C}var S=p[D];if(S===void 0)return!1;if(typeof S=="function")y(S,this,E);else for(var N=S.length,B=x(S,N),I=0;I0&&C.length>p&&!C.warned){C.warned=!0;var S=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");S.name="MaxListenersExceededWarning",S.emitter=D,S.type=E,S.count=C.length,P(S)}return D}i.prototype.addListener=function(D,E){return c(this,D,E,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(D,E){return c(this,D,E,!0)};function s(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(D,E,I){var M={fired:!1,wrapFn:void 0,target:D,type:E,listener:I},p=s.bind(M);return p.listener=I,M.wrapFn=p,p}i.prototype.once=function(D,E){return l(E),this.on(D,h(this,D,E)),this},i.prototype.prependOnceListener=function(D,E){return l(E),this.prependListener(D,h(this,D,E)),this},i.prototype.removeListener=function(D,E){var I,M,p,g,C;if(l(E),M=this._events,M===void 0)return this;if(I=M[D],I===void 0)return this;if(I===E||I.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete M[D],M.removeListener&&this.emit("removeListener",D,I.listener||E));else if(typeof I!="function"){for(p=-1,g=I.length-1;g>=0;g--)if(I[g]===E||I[g].listener===E){C=I[g].listener,p=g;break}if(p<0)return this;p===0?I.shift():_(I,p),I.length===1&&(M[D]=I[0]),M.removeListener!==void 0&&this.emit("removeListener",D,C||E)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(D){var E,I,M;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[D]),this;if(arguments.length===0){var p=Object.keys(I),g;for(M=0;M=0;M--)this.removeListener(D,E[M]);return this};function m(D,E,I){var M=D._events;if(M===void 0)return[];var p=M[E];return p===void 0?[]:typeof p=="function"?I?[p.listener||p]:[p]:I?A(p):x(p,p.length)}i.prototype.listeners=function(D){return m(this,D,!0)},i.prototype.rawListeners=function(D){return m(this,D,!1)},i.listenerCount=function(D,E){return typeof D.listenerCount=="function"?D.listenerCount(E):b.call(D,E)},i.prototype.listenerCount=b;function b(D){var E=this._events;if(E!==void 0){var I=E[D];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function x(D,E){for(var I=new Array(E),M=0;M{var f=Wg().EventEmitter,y={init:function(z){if(z._ev instanceof f)return z;var P=new f,n=new f;return z._ev=P,z._internalEv=n,z.on=P.on.bind(P),z.once=P.once.bind(P),z.removeListener=P.removeListener.bind(P),z.removeAllListeners=P.removeAllListeners.bind(P),z._internalOn=n.on.bind(n),z._internalOnce=n.once.bind(n),z._removeInternalListener=n.removeListener.bind(n),z._removeAllInternalListeners=n.removeAllListeners.bind(n),z.emit=function(i,a){P.emit(i,a),n.emit(i,a)},typeof z.addEventListener=="function"&&z.addEventListener("wheel",()=>{},{passive:!0}),z},triggerHandler:function(z,P,n){var i,a=z._ev;if(!a)return;var l=a._events[P];if(!l)return;function o(s){if(s.listener){if(a.removeListener(P,s.listener),!s.fired)return s.fired=!0,s.listener.apply(a,[n])}else return s.apply(a,[n])}l=Array.isArray(l)?l:[l];var c;for(c=0;c{var f=jn(),y=Mo().dfltConfig;function z(n,i){for(var a=[],l,o=0;oy.queueLength&&(n.undoQueue.queue.shift(),n.undoQueue.index--)},P.startSequence=function(n){n.undoQueue=n.undoQueue||{index:0,queue:[],sequence:!1},n.undoQueue.sequence=!0,n.undoQueue.beginSequence=!0},P.stopSequence=function(n){n.undoQueue=n.undoQueue||{index:0,queue:[],sequence:!1},n.undoQueue.sequence=!1,n.undoQueue.beginSequence=!1},P.undo=function(n){var i,a;if(!(n.undoQueue===void 0||isNaN(n.undoQueue.index)||n.undoQueue.index<=0)){for(n.undoQueue.index--,i=n.undoQueue.queue[n.undoQueue.index],n.undoQueue.inSequence=!0,a=0;a=n.undoQueue.queue.length)){for(i=n.undoQueue.queue[n.undoQueue.index],n.undoQueue.inSequence=!0,a=0;a{Y.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),Gg=It(et=>{var Y=ls(),f=jn(),y=xa(),z=k_(),P=S4(),n=Ul(),i=Mo().configAttributes,a=sh(),l=f.extendDeepAll,o=f.isPlainObject,c=f.isArrayOrTypedArray,s=f.nestedProperty,h=f.valObjectMeta,m="_isSubplotObj",b="_isLinkedToArray",x="_arrayAttrRegexps",_="_deprecated",A=[m,b,x,_];et.IS_SUBPLOT_OBJ=m,et.IS_LINKED_TO_ARRAY=b,et.DEPRECATED=_,et.UNDERSCORE_ATTRS=A,et.get=function(){var B={};return Y.allTypes.forEach(function(U){B[U]=D(U)}),{defs:{valObjects:h,metaKeys:A.concat(["description","role","editType","impliedEdits"]),editType:{traces:a.traces,layout:a.layout},impliedEdits:{}},traces:B,layout:E(),frames:I(),animation:M(n),config:M(i)}},et.crawl=function(B,U,V,W){var F=V||0;W=W||"",Object.keys(B).forEach(function(H){var q=B[H];if(A.indexOf(H)===-1){var G=(W?W+".":"")+H;U(q,H,B,F,G),!et.isValObject(q)&&o(q)&&H!=="impliedEdits"&&et.crawl(q,U,F+1,G)}})},et.isValObject=function(B){return B&&B.valType!==void 0},et.findArrayAttributes=function(B){var U=[],V=[],W=[],F,H;function q(tt,ht,bt,vt){V=V.slice(0,vt).concat([ht]),W=W.slice(0,vt).concat([tt&&tt._isLinkedToArray]);var ut=tt&&(tt.valType==="data_array"||tt.arrayOk===!0)&&!(V[vt-1]==="colorbar"&&(ht==="ticktext"||ht==="tickvals"));ut&&G(F,0,"")}function G(tt,ht,bt){var vt=tt[V[ht]],ut=bt+V[ht];if(ht===V.length-1)c(vt)&&U.push(H+ut);else if(W[ht]){if(Array.isArray(vt))for(var rt=0;rt=H.length)return!1;if(B.dimensions===2){if(V++,U.length===V)return B;var q=U[V];if(!w(q))return!1;B=H[F][q]}else B=H[F]}else B=H}}return B}function w(B){return B===Math.round(B)&&B>=0}function D(B){var U,V;U=Y.modules[B]._module,V=U.basePlotModule;var W={};W.type=null;var F=l({},y),H=l({},U.attributes);et.crawl(H,function(tt,ht,bt,vt,ut){s(F,ut).set(void 0),tt===void 0&&s(H,ut).set(void 0)}),l(W,F),Y.traceIs(B,"noOpacity")&&delete W.opacity,Y.traceIs(B,"showLegend")||(delete W.showlegend,delete W.legendgroup),Y.traceIs(B,"noHover")&&(delete W.hoverinfo,delete W.hoverlabel),U.selectPoints||delete W.selectedpoints,l(W,H),V.attributes&&l(W,V.attributes),W.type=B;var q={meta:U.meta||{},categories:U.categories||{},animatable:!!U.animatable,type:B,attributes:M(W)};if(U.layoutAttributes){var G={};l(G,U.layoutAttributes),q.layoutAttributes=M(G)}return U.animatable||et.crawl(q,function(tt){et.isValObject(tt)&&"anim"in tt&&delete tt.anim}),q}function E(){var B={},U,V;l(B,z);for(U in Y.subplotsRegistry)if(V=Y.subplotsRegistry[U],!!V.layoutAttributes)if(Array.isArray(V.attr))for(var W=0;W{var Y=jn(),f=xa(),y="templateitemname",z={name:{valType:"string",editType:"none"}};z[y]={valType:"string",editType:"calc"},et.templatedArray=function(i,a){return a._isLinkedToArray=i,a.name=z.name,a[y]=z[y],a},et.traceTemplater=function(i){var a={},l,o;for(l in i)o=i[l],Array.isArray(o)&&o.length&&(a[l]=0);function c(s){l=Y.coerce(s,{},f,"type");var h={type:l,_template:null};if(l in a){o=i[l];var m=a[l]%o.length;a[l]++,h._template=o[m]}return h}return{newTrace:c}},et.newContainer=function(i,a,l){var o=i._template,c=o&&(o[a]||l&&o[l]);Y.isPlainObject(c)||(c=null);var s=i[a]={_template:c};return s},et.arrayTemplater=function(i,a,l){var o=i._template,c=o&&o[n(a)],s=o&&o[a];(!Array.isArray(s)||!s.length)&&(s=[]);var h={};function m(x){var _={name:x.name,_input:x},A=_[y]=x[y];if(!P(A))return _._template=c,_;for(var d=0;d=o&&(l._input||{})._templateitemname;s&&(c=o);var h=a+"["+c+"]",m;function b(){m={},s&&(m[h]={},m[h][y]=s)}b();function x(k,w){m[k]=w}function _(k,w){s?Y.nestedProperty(m[h],k).set(w):m[h+"."+k]=w}function A(){var k=m;return b(),k}function d(k,w){k&&_(k,w);var D=A();for(var E in D)Y.nestedProperty(i,E).set(D[E])}return{modifyBase:x,modifyItem:_,getUpdateObj:A,applyUpdate:d}}}),fu=It((et,Y)=>{var f=Ha().counter;Y.exports={idRegex:{x:f("x","( domain)?"),y:f("y","( domain)?")},attrRegex:f("[xy]axis"),xAxisMatch:f("xaxis"),yAxisMatch:f("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),Ku=It(et=>{var Y=ls(),f=fu();et.id2name=function(z){if(!(typeof z!="string"||!z.match(f.AX_ID_PATTERN))){var P=z.split(" ")[0].substr(1);return P==="1"&&(P=""),z.charAt(0)+"axis"+P}},et.name2id=function(z){if(z.match(f.AX_NAME_PATTERN)){var P=z.substr(5);return P==="1"&&(P=""),z.charAt(0)+P}},et.cleanId=function(z,P,n){var i=/( domain)$/.test(z);if(!(typeof z!="string"||!z.match(f.AX_ID_PATTERN))&&!(P&&z.charAt(0)!==P)&&!(i&&!n)){var a=z.split(" ")[0].substr(1).replace(/^0+/,"");return a==="1"&&(a=""),z.charAt(0)+a+(i&&n?" domain":"")}},et.list=function(z,P,n){var i=z._fullLayout;if(!i)return[];var a=et.listIds(z,P),l=new Array(a.length),o;for(o=0;oi?1:-1:+(z.substr(1)||1)-+(P.substr(1)||1)},et.ref2id=function(z){return/^[xyz]/.test(z)?z.split(" ")[0]:!1};function y(z,P){if(P&&P.length){for(var n=0;n{function f(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".outline-controllers").remove()}function y(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".select-outline").remove(),z._fullLayout._outlining=!1}Y.exports={clearOutlineControllers:f,clearOutline:y}}),Nv=It((et,Y)=>{Y.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),Mf=It(et=>{var Y=ls();fu().SUBPLOT_PATTERN,et.getSubplotCalcData=function(f,y,z){var P=Y.subplotsRegistry[y];if(!P)return[];for(var n=P.attr,i=[],a=0;a{var Y=ls(),f=jn();et.manageCommandObserver=function(a,l,o,c){var s={},h=!0;l&&l._commandObserver&&(s=l._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var m=et.hasSimpleAPICommandBindings(a,o,s.lookupTable);if(l&&l._commandObserver){if(m)return s;if(l._commandObserver.remove)return l._commandObserver.remove(),l._commandObserver=null,s}if(m){y(a,m,s.cache),s.check=function(){if(h){var _=y(a,m,s.cache);return _.changed&&c&&s.lookupTable[_.value]!==void 0&&(s.disable(),Promise.resolve(c({value:_.value,type:m.type,prop:m.prop,traces:m.traces,index:s.lookupTable[_.value]})).then(s.enable,s.enable)),_.changed}};for(var b=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],x=0;x0?".":"")+s;f.isPlainObject(h)?i(h,l,m,c+1):l(m,s,h)}})}}),lh=It((et,Y)=>{var f=Br(),y=on().timeFormatLocale,z=pr().formatLocale,P=Sr(),n=nn(),i=ls(),a=Gg(),l=Tc(),o=jn(),c=Hn(),s=Dr().BADNUM,h=Ku(),m=Cm().clearOutline,b=Nv(),x=Ul(),_=S4(),A=Mf().getModuleCalcData,d=o.relinkPrivateKeys,k=o._,w=Y.exports={};o.extendFlat(w,i),w.attributes=xa(),w.attributes.type.values=w.allTypes,w.fontAttrs=hi(),w.layoutAttributes=k_();var D=A_();w.executeAPICommand=D.executeAPICommand,w.computeAPICommandBindings=D.computeAPICommandBindings,w.manageCommandObserver=D.manageCommandObserver,w.hasSimpleAPICommandBindings=D.hasSimpleAPICommandBindings,w.redrawText=function(rt){return rt=o.getGraphDiv(rt),new Promise(function(gt){setTimeout(function(){rt._fullLayout&&(i.getComponentMethod("annotations","draw")(rt),i.getComponentMethod("legend","draw")(rt),i.getComponentMethod("colorbar","draw")(rt),gt(w.previousPromises(rt)))},300)})},w.resize=function(rt){rt=o.getGraphDiv(rt);var gt,it=new Promise(function(st,xt){(!rt||o.isHidden(rt))&&xt(new Error("Resize must be passed a displayed plot div element.")),rt._redrawTimer&&clearTimeout(rt._redrawTimer),rt._resolveResize&&(gt=rt._resolveResize),rt._resolveResize=st,rt._redrawTimer=setTimeout(function(){if(!rt.layout||rt.layout.width&&rt.layout.height||o.isHidden(rt)){st(rt);return}delete rt.layout.width,delete rt.layout.height;var ot=rt.changed;rt.autoplay=!0,i.call("relayout",rt,{autosize:!0}).then(function(){rt.changed=ot,rt._resolveResize===st&&(delete rt._resolveResize,st(rt))})},100)});return gt&>(it),it},w.previousPromises=function(rt){if((rt._promises||[]).length)return Promise.all(rt._promises).then(function(){rt._promises=[]})},w.addLinks=function(rt){if(!(!rt._context.showLink&&!rt._context.showSources)){var gt=rt._fullLayout,it=o.ensureSingle(gt._paper,"text","js-plot-link-container",function(dt){dt.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:c.defaultLine,"pointer-events":"all"}).each(function(){var Ct=f.select(this);Ct.append("tspan").classed("js-link-to-tool",!0),Ct.append("tspan").classed("js-link-spacer",!0),Ct.append("tspan").classed("js-sourcelinks",!0)})}),st=it.node(),xt={y:gt._paper.attr("height")-9};document.body.contains(st)&&st.getComputedTextLength()>=gt.width-20?(xt["text-anchor"]="start",xt.x=5):(xt["text-anchor"]="end",xt.x=gt._paper.attr("width")-7),it.attr(xt);var ot=it.select(".js-link-to-tool"),J=it.select(".js-link-spacer"),mt=it.select(".js-sourcelinks");rt._context.showSources&&rt._context.showSources(rt),rt._context.showLink&&E(rt,ot),J.text(ot.text()&&mt.text()?" - ":"")}};function E(rt,gt){gt.text("");var it=gt.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(rt._context.linkText+" »");if(rt._context.sendData)it.on("click",function(){w.sendDataToCloud(rt)});else{var st=window.location.pathname.split("/"),xt=window.location.search;it.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+st[2].split(".")[0]+"/"+st[1]+xt})}}w.sendDataToCloud=function(rt){var gt=(window.PLOTLYENV||{}).BASE_URL||rt._context.plotlyServerURL;if(gt){rt.emit("plotly_beforeexport");var it=f.select(rt).append("div").attr("id","hiddenform").style("display","none"),st=it.append("form").attr({action:gt+"/external",method:"post",target:"_blank"}),xt=st.append("input").attr({type:"text",name:"data"});return xt.node().value=w.graphJson(rt,!1,"keepdata"),st.node().submit(),it.remove(),rt.emit("plotly_afterexport"),!1}};var I=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(rt,gt){var it=gt&>.skipUpdateCalc,st=rt._fullLayout||{};if(st._skipDefaults){delete st._skipDefaults;return}var xt=rt._fullLayout={},ot=rt.layout||{},J=rt._fullData||[],mt=rt._fullData=[],dt=rt.data||[],Ct=rt.calcdata||[],Rt=rt._context||{},Bt;rt._transitionData||w.createTransitionData(rt),xt._dfltTitle={plot:k(rt,"Click to enter Plot title"),subtitle:k(rt,"Click to enter Plot subtitle"),x:k(rt,"Click to enter X axis title"),y:k(rt,"Click to enter Y axis title"),colorbar:k(rt,"Click to enter Colorscale title"),annotation:k(rt,"new text")},xt._traceWord=k(rt,"trace");var Zt=C(rt,I);if(xt._mapboxAccessToken=Rt.mapboxAccessToken,st._initialAutoSizeIsDone){var Gt=st.width,ee=st.height;w.supplyLayoutGlobalDefaults(ot,xt,Zt),ot.width||(xt.width=Gt),ot.height||(xt.height=ee),w.sanitizeMargins(xt)}else{w.supplyLayoutGlobalDefaults(ot,xt,Zt);var xe=!ot.width||!ot.height,ge=xt.autosize,ye=Rt.autosizable,ue=xe&&(ge||ye);ue?w.plotAutoSize(rt,ot,xt):xe&&w.sanitizeMargins(xt),!ge&&xe&&(ot.width=xt.width,ot.height=xt.height)}xt._d3locale=S(Zt,xt.separators),xt._extraFormat=C(rt,M),xt._initialAutoSizeIsDone=!0,xt._dataLength=dt.length,xt._modules=[],xt._visibleModules=[],xt._basePlotModules=[];var Mt=xt._subplots=g(),Ot=xt._splomAxes={x:{},y:{}},Lt=xt._splomSubplots={};xt._splomGridDflt={},xt._scatterStackOpts={},xt._firstScatter={},xt._alignmentOpts={},xt._colorAxes={},xt._requestRangeslider={},xt._traceUids=p(J,dt),w.supplyDataDefaults(dt,mt,ot,xt);var ie=Object.keys(Ot.x),be=Object.keys(Ot.y);if(ie.length>1&&be.length>1){for(i.getComponentMethod("grid","sizeDefaults")(ot,xt),Bt=0;Bt15&&be.length>15&&xt.shapes.length===0&&xt.images.length===0,w.linkSubplots(mt,xt,J,st),w.cleanPlot(mt,xt,J,st);var mr=!!(st._has&&st._has("cartesian")),fr=!!(xt._has&&xt._has("cartesian")),Jr=mr,an=fr;Jr&&!an?st._bgLayer.remove():an&&!Jr&&(xt._shouldCreateBgLayer=!0),st._zoomlayer&&!rt._dragging&&m({_fullLayout:st}),N(mt,xt),d(xt,st),i.getComponentMethod("colorscale","crossTraceDefaults")(mt,xt),xt._preGUI||(xt._preGUI={}),xt._tracePreGUI||(xt._tracePreGUI={});var Er=xt._tracePreGUI,dn={},_n;for(_n in Er)dn[_n]="old";for(Bt=0;Bt0){var Ct=1-2*xt;ot=Math.round(Ct*ot),J=Math.round(Ct*J)}}var Rt=w.layoutAttributes.width.min,Bt=w.layoutAttributes.height.min;ot1,Gt=!gt.height&&Math.abs(it.height-J)>1;(Gt||Zt)&&(Zt&&(it.width=ot),Gt&&(it.height=J)),rt._initialAutoSize||(rt._initialAutoSize={width:ot,height:J}),w.sanitizeMargins(it)},w.supplyLayoutModuleDefaults=function(rt,gt,it,st){var xt=i.componentsRegistry,ot=gt._basePlotModules,J,mt,dt,Ct=i.subplotsRegistry.cartesian;for(J in xt)dt=xt[J],dt.includeBasePlot&&dt.includeBasePlot(rt,gt);ot.length||ot.push(Ct),gt._has("cartesian")&&(i.getComponentMethod("grid","contentDefaults")(rt,gt),Ct.finalizeSubplots(rt,gt));for(var Rt in gt._subplots)gt._subplots[Rt].sort(o.subplotSort);for(mt=0;mt1&&(it.l/=ge,it.r/=ge)}if(Zt){var ye=(it.t+it.b)/Zt;ye>1&&(it.t/=ye,it.b/=ye)}var ue=it.xl!==void 0?it.xl:it.x,Mt=it.xr!==void 0?it.xr:it.x,Ot=it.yt!==void 0?it.yt:it.y,Lt=it.yb!==void 0?it.yb:it.y;Gt[gt]={l:{val:ue,size:it.l+xe},r:{val:Mt,size:it.r+xe},b:{val:Lt,size:it.b+xe},t:{val:Ot,size:it.t+xe}},ee[gt]=1}if(!st._replotting)return w.doAutoMargin(rt)}};function H(rt){if("_redrawFromAutoMarginCount"in rt._fullLayout)return!1;var gt=h.list(rt,"",!0);for(var it in gt)if(gt[it].autoshift||gt[it].shift)return!0;return!1}w.doAutoMargin=function(rt){var gt=rt._fullLayout,it=gt.width,st=gt.height;gt._size||(gt._size={}),V(gt);var xt=gt._size,ot=gt.margin,J={t:0,b:0,l:0,r:0},mt=o.extendFlat({},xt),dt=ot.l,Ct=ot.r,Rt=ot.t,Bt=ot.b,Zt=gt._pushmargin,Gt=gt._pushmarginIds,ee=gt.minreducedwidth,xe=gt.minreducedheight;if(ot.autoexpand!==!1){for(var ge in Zt)Gt[ge]||delete Zt[ge];var ye=rt._fullLayout._reservedMargin;for(var ue in ye)for(var Mt in ye[ue]){var Ot=ye[ue][Mt];J[Mt]=Math.max(J[Mt],Ot)}Zt.base={l:{val:0,size:dt},r:{val:1,size:Ct},t:{val:1,size:Rt},b:{val:0,size:Bt}};for(var Lt in J){var ie=0;for(var be in Zt)be!=="base"&&P(Zt[be][Lt].size)&&(ie=Zt[be][Lt].size>ie?Zt[be][Lt].size:ie);var ce=Math.max(0,ot[Lt]-ie);J[Lt]=Math.max(0,J[Lt]-ce)}for(var Le in Zt){var Ze=Zt[Le].l||{},Qe=Zt[Le].b||{},mr=Ze.val,fr=Ze.size,Jr=Qe.val,an=Qe.size,Er=it-J.r-J.l,dn=st-J.t-J.b;for(var _n in Zt){if(P(fr)&&Zt[_n].r){var Oe=Zt[_n].r.val,Xt=Zt[_n].r.size;if(Oe>mr){var oe=(fr*Oe+(Xt-Er)*mr)/(Oe-mr),zt=(Xt*(1-mr)+(fr-Er)*(1-Oe))/(Oe-mr);oe+zt>dt+Ct&&(dt=oe,Ct=zt)}}if(P(an)&&Zt[_n].t){var _t=Zt[_n].t.val,Pt=Zt[_n].t.size;if(_t>Jr){var Ht=(an*_t+(Pt-dn)*Jr)/(_t-Jr),ae=(Pt*(1-Jr)+(an-dn)*(1-_t))/(_t-Jr);Ht+ae>Bt+Rt&&(Bt=Ht,Rt=ae)}}}}}var he=o.constrain(it-ot.l-ot.r,W,ee),Me=o.constrain(st-ot.t-ot.b,F,xe),qe=Math.max(0,it-he),Ye=Math.max(0,st-Me);if(qe){var ur=(dt+Ct)/qe;ur>1&&(dt/=ur,Ct/=ur)}if(Ye){var Rr=(Bt+Rt)/Ye;Rr>1&&(Bt/=Rr,Rt/=Rr)}if(xt.l=Math.round(dt)+J.l,xt.r=Math.round(Ct)+J.r,xt.t=Math.round(Rt)+J.t,xt.b=Math.round(Bt)+J.b,xt.p=Math.round(ot.pad),xt.w=Math.round(it)-xt.l-xt.r,xt.h=Math.round(st)-xt.t-xt.b,!gt._replotting&&(w.didMarginChange(mt,xt)||H(rt))){"_redrawFromAutoMarginCount"in gt?gt._redrawFromAutoMarginCount++:gt._redrawFromAutoMarginCount=1;var zr=3*(1+Object.keys(Gt).length);if(gt._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(rt,gt,it,st,xt,ot){(xt&>&&!rt._fullData||xt&&!gt&&!rt._fullLayout)&&w.supplyDefaults(rt);var J=xt?rt._fullData:rt.data,mt=xt?rt._fullLayout:rt.layout,dt=(rt._transitionData||{})._frames;function Ct(Zt,Gt){if(typeof Zt=="function")return Gt?"_function_":null;if(o.isPlainObject(Zt)){var ee={},xe;return Object.keys(Zt).sort().forEach(function(Mt){if(["_","["].indexOf(Mt.charAt(0))===-1){if(typeof Zt[Mt]=="function"){Gt&&(ee[Mt]="_function");return}if(it==="keepdata"){if(Mt.substr(Mt.length-3)==="src")return}else if(it==="keepstream"){if(xe=Zt[Mt+"src"],typeof xe=="string"&&xe.indexOf(":")>0&&!o.isPlainObject(Zt.stream))return}else if(it!=="keepall"&&(xe=Zt[Mt+"src"],typeof xe=="string"&&xe.indexOf(":")>0))return;ee[Mt]=Ct(Zt[Mt],Gt)}}),ee}var ge=Array.isArray(Zt),ye=o.isTypedArray(Zt);if((ge||ye)&&Zt.dtype&&Zt.shape){var ue=Zt.bdata;return Ct({dtype:Zt.dtype,shape:Zt.shape,bdata:o.isArrayBuffer(ue)?n.encode(ue):ue},Gt)}return ge?Zt.map(function(Mt){return Ct(Mt,Gt)}):ye?o.simpleMap(Zt,o.identity):o.isJSDate(Zt)?o.ms2DateTimeLocal(+Zt):Zt}var Rt={data:(J||[]).map(function(Zt){var Gt=Ct(Zt);return gt&&delete Gt.fit,Gt})};if(!gt&&(Rt.layout=Ct(mt),xt)){var Bt=mt._size;Rt.layout.computed={margin:{b:Bt.b,l:Bt.l,r:Bt.r,t:Bt.t}}}return dt&&(Rt.frames=Ct(dt)),ot&&(Rt.config=Ct(rt._context,!0)),st==="object"?Rt:JSON.stringify(Rt)},w.modifyFrames=function(rt,gt){var it,st,xt,ot=rt._transitionData._frames,J=rt._transitionData._frameHash;for(it=0;it0&&(rt._transitioningWithDuration=!0),rt._transitionData._interruptCallbacks.push(function(){st=!0}),it.redraw&&rt._transitionData._interruptCallbacks.push(function(){return i.call("redraw",rt)}),rt._transitionData._interruptCallbacks.push(function(){rt.emit("plotly_transitioninterrupted",[])});var Zt=0,Gt=0;function ee(){return Zt++,function(){Gt++,!st&&Gt===Zt&&mt(Bt)}}it.runFn(ee),setTimeout(ee())})}function mt(Bt){if(rt._transitionData)return ot(rt._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(it.redraw)return i.call("redraw",rt)}).then(function(){rt._transitioning=!1,rt._transitioningWithDuration=!1,rt.emit("plotly_transitioned",[])}).then(Bt)}function dt(){if(rt._transitionData)return rt._transitioning=!1,xt(rt._transitionData._interruptCallbacks)}var Ct=[w.previousPromises,dt,it.prepareFn,w.rehover,w.reselect,J],Rt=o.syncOrAsync(Ct,rt);return(!Rt||!Rt.then)&&(Rt=Promise.resolve()),Rt.then(function(){return rt})}w.doCalcdata=function(rt,gt){var it=h.list(rt),st=rt._fullData,xt=rt._fullLayout,ot,J,mt,dt,Ct=new Array(st.length),Rt=(rt.calcdata||[]).slice();for(rt.calcdata=Ct,xt._numBoxes=0,xt._numViolins=0,xt._violinScaleGroupStats={},rt._hmpixcount=0,rt._hmlumcount=0,xt._piecolormap={},xt._sunburstcolormap={},xt._treemapcolormap={},xt._iciclecolormap={},xt._funnelareacolormap={},mt=0;mt=0;dt--)if(Lt[dt].enabled){ot._indexToPoints=Lt[dt]._indexToPoints;break}J&&J.calc&&(Ot=J.calc(rt,ot))}(!Array.isArray(Ot)||!Ot[0])&&(Ot=[{x:s,y:s}]),Ot[0].t||(Ot[0].t={}),Ot[0].trace=ot,Ct[ue]=Ot}}for(vt(it,st,xt),mt=0;mt{et.xmlns="http://www.w3.org/2000/xmlns/",et.svg="http://www.w3.org/2000/svg",et.xlink="http://www.w3.org/1999/xlink",et.svgAttrs={xmlns:et.svg,"xmlns:xlink":et.xlink}}),Rd=It((et,Y)=>{Y.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}),uu=It(et=>{var Y=Br(),f=jn(),y=f.strTranslate,z=k0(),P=Rd().LINE_SPACING,n=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;et.convertToTspans=function(F,H,q){var G=F.text(),tt=!F.attr("data-notex")&&H&&H._context.typesetMath&&typeof MathJax<"u"&&G.match(n),ht=Y.select(F.node().parentNode);if(ht.empty())return;var bt=F.attr("class")?F.attr("class").split(" ")[0]:"text";bt+="-math",ht.selectAll("svg."+bt).remove(),ht.selectAll("g."+bt+"-group").remove(),F.style("display",null).attr({"data-unformatted":G,"data-math":"N"});function vt(){ht.empty()||(bt=F.attr("class")+"-math",ht.select("svg."+bt).remove()),F.text("").style("white-space","pre");var ut=B(F.node(),G);ut&&F.style("pointer-events","all"),et.positionText(F),q&&q.call(F)}return tt?(H&&H._promises||[]).push(new Promise(function(ut){F.style("display","none");var rt=parseInt(F.node().style.fontSize,10),gt={fontSize:rt};c(tt[2],gt,function(it,st,xt){ht.selectAll("svg."+bt).remove(),ht.selectAll("g."+bt+"-group").remove();var ot=it&&it.select("svg");if(!ot||!ot.node()){vt(),ut();return}var J=ht.append("g").classed(bt+"-group",!0).attr({"pointer-events":"none","data-unformatted":G,"data-math":"Y"});J.node().appendChild(ot.node()),st&&st.node()&&ot.node().insertBefore(st.node().cloneNode(!0),ot.node().firstChild);var mt=xt.width,dt=xt.height;ot.attr({class:bt,height:dt,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var Ct=F.node().style.fill||"black",Rt=ot.select("g");Rt.attr({fill:Ct,stroke:Ct});var Bt=Rt.node().getBoundingClientRect(),Zt=Bt.width,Gt=Bt.height;(Zt>mt||Gt>dt)&&(ot.style("overflow","hidden"),Bt=ot.node().getBoundingClientRect(),Zt=Bt.width,Gt=Bt.height);var ee=+F.attr("x"),xe=+F.attr("y"),ge=rt||F.node().getBoundingClientRect().height,ye=-ge/4;if(bt[0]==="y")J.attr({transform:"rotate("+[-90,ee,xe]+")"+y(-Zt/2,ye-Gt/2)});else if(bt[0]==="l")xe=ye-Gt/2;else if(bt[0]==="a"&&bt.indexOf("atitle")!==0)ee=0,xe=ye;else{var ue=F.attr("text-anchor");ee=ee-Zt*(ue==="middle"?.5:ue==="end"?1:0),xe=xe+ye-Gt/2}ot.attr({x:ee,y:xe}),q&&q.call(F,J),ut(J)})})):vt(),F};var i=/(<|<|<)/g,a=/(>|>|>)/g;function l(F){return F.replace(i,"\\lt ").replace(a,"\\gt ")}var o=[["$","$"],["\\(","\\)"]];function c(F,H,q){var G=parseInt((MathJax.version||"").split(".")[0]);if(G!==2&&G!==3){f.warn("No MathJax version:",MathJax.version);return}var tt,ht,bt,vt,ut=function(){return ht=f.extendDeepAll({},MathJax.Hub.config),bt=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:o},displayAlign:"left"})},rt=function(){ht=f.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=o},gt=function(){if(tt=MathJax.Hub.config.menuSettings.renderer,tt!=="SVG")return MathJax.Hub.setRenderer("SVG")},it=function(){tt=MathJax.config.startup.output,tt!=="svg"&&(MathJax.config.startup.output="svg")},st=function(){var Ct="math-output-"+f.randstr({},64);vt=Y.select("body").append("div").attr({id:Ct}).style({visibility:"hidden",position:"absolute","font-size":H.fontSize+"px"}).text(l(F));var Rt=vt.node();return G===2?MathJax.Hub.Typeset(Rt):MathJax.typeset([Rt])},xt=function(){var Ct=vt.select(G===2?".MathJax_SVG":".MathJax"),Rt=!Ct.empty()&&vt.select("svg").node();if(!Rt)f.log("There was an error in the tex syntax.",F),q();else{var Bt=Rt.getBoundingClientRect(),Zt;G===2?Zt=Y.select("body").select("#MathJax_SVG_glyphs"):Zt=Ct.select("defs"),q(Ct,Zt,Bt)}vt.remove()},ot=function(){if(tt!=="SVG")return MathJax.Hub.setRenderer(tt)},J=function(){tt!=="svg"&&(MathJax.config.startup.output=tt)},mt=function(){return bt!==void 0&&(MathJax.Hub.processSectionDelay=bt),MathJax.Hub.Config(ht)},dt=function(){MathJax.config=ht};G===2?MathJax.Hub.Queue(ut,gt,st,xt,ot,mt):G===3&&(rt(),it(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){st(),xt(),J(),dt()}))}var s={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},m={sub:"-0.21em",sup:"0.42em"},b="​",x=["http:","https:","mailto:","",void 0,":"],_=et.NEWLINES=/(\r\n?|\n)/g,A=/(<[^<>]*>)/,d=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;et.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,D=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,I=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(F,H){if(!F)return null;var q=F.match(H),G=q&&(q[3]||q[4]);return G&&S(G)}var p=/(^|;)\s*color:/;et.plainText=function(F,H){H=H||{};for(var q=H.len!==void 0&&H.len!==-1?H.len:1/0,G=H.allowedTags!==void 0?H.allowedTags:["br"],tt="...",ht=tt.length,bt=F.split(A),vt=[],ut="",rt=0,gt=0;gtht?vt.push(it.substr(0,J-ht)+tt):vt.push(it.substr(0,J));break}ut=""}}return vt.join("")};var g={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},C=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function S(F){return F.replace(C,function(H,q){var G;return q.charAt(0)==="#"?G=N(q.charAt(1)==="x"?parseInt(q.substr(2),16):parseInt(q.substr(1),10)):G=g[q],G||H})}et.convertEntities=S;function N(F){if(!(F>1114111)){var H=String.fromCodePoint;if(H)return H(F);var q=String.fromCharCode;return F<=65535?q(F):q((F>>10)+55232,F%1024+56320)}}function B(F,H){H=H.replace(_," ");var q=!1,G=[],tt,ht=-1;function bt(){ht++;var Gt=document.createElementNS(z.svg,"tspan");Y.select(Gt).attr({class:"line",dy:ht*P+"em"}),F.appendChild(Gt),tt=Gt;var ee=G;if(G=[{node:Gt}],ee.length>1)for(var xe=1;xe.",H);return}var ee=G.pop();Gt!==ee.type&&f.log("Start tag <"+ee.type+"> doesnt match end tag <"+Gt+">. Pretending it did match.",H),tt=G[G.length-1].node}var gt=k.test(H);gt?bt():(tt=F,G=[{node:F}]);for(var it=H.split(A),st=0;st{var f=Br(),y=Xi(),z=Sr(),P=jn(),n=Hn(),i=Ur().isValid;function a(_,A,d){var k=A?P.nestedProperty(_,A).get()||{}:_,w=k[d||"color"];w&&w._inputArray&&(w=w._inputArray);var D=!1;if(P.isArrayOrTypedArray(w)){for(var E=0;E=0;k--,w++){var D=_[k];d[w]=[1-D[0],D[1]]}return d}function m(_,A){A=A||{};for(var d=_.domain,k=_.range,w=k.length,D=new Array(w),E=0;E{var f=ow(),y=f.FORMAT_LINK,z=f.DATE_FORMAT_LINK;function P(a,l){return{valType:"string",dflt:"",editType:"none",description:(l?n:i)("hover text",a)+["By default the values are formatted using "+(l?"generic number format":"`"+a+"axis.hoverformat`")+"."].join(" ")}}function n(a,l){return["Sets the "+a+" formatting rule"+(l?"for `"+l+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+y+"."].join(" ")}function i(a,l){return n(a,l)+[" And for dates see: "+z+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}Y.exports={axisHoverFormat:P,descriptionOnlyNumbers:n,descriptionWithDates:i}}),Gf=It((et,Y)=>{var f=hi(),y=Sn(),z=qf().dash,P=Yn().extendFlat,n=Tc().templatedArray;nu().templateFormatStringDescription;var i=Sh().descriptionWithDates,a=Dr().ONEDAY,l=fu(),o=l.HOUR_PATTERN,c=l.WEEKDAY_PATTERN,s={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},h=P({},s,{values:s.values.slice().concat(["sync"])});function m(p){return{valType:"integer",min:0,dflt:p?5:0,editType:"ticks"}}var b={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},x={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},_={valType:"data_array",editType:"ticks"},A={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function d(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=5),g}function k(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var w={valType:"color",dflt:y.defaultLine,editType:"ticks"},D={valType:"color",dflt:y.lightLine,editType:"ticks"};function E(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var I=P({},z,{editType:"ticks"}),M={valType:"boolean",editType:"ticks"};Y.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:y.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:f({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},rangebreaks:n("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[c,o,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:a},editType:"calc"}),tickmode:h,nticks:m(),tick0:b,dtick:x,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:_,ticktext:{valType:"data_array",editType:"ticks"},ticks:A,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:d(),tickwidth:k(),tickcolor:w,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:P({},z,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:f({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:i("tick label")},tickformatstops:n("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:i("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:M,gridcolor:D,gridwidth:E(),griddash:I,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},minor:{tickmode:s,nticks:m("minor"),tick0:b,dtick:x,tickvals:_,ticks:A,ticklen:d("minor"),tickwidth:k("minor"),tickcolor:w,gridcolor:D,gridwidth:E("minor"),griddash:I,showgrid:M,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),M_=It((et,Y)=>{var f=Gf(),y=hi(),z=Yn().extendFlat,P=sh().overrideAll;Y.exports=P({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:f.linecolor,outlinewidth:f.linewidth,bordercolor:f.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:f.minor.tickmode,nticks:f.nticks,tick0:f.tick0,dtick:f.dtick,tickvals:f.tickvals,ticktext:f.ticktext,ticks:z({},f.ticks,{dflt:""}),ticklabeloverflow:z({},f.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:f.ticklen,tickwidth:f.tickwidth,tickcolor:f.tickcolor,ticklabelstep:f.ticklabelstep,showticklabels:f.showticklabels,labelalias:f.labelalias,tickfont:y({}),tickangle:f.tickangle,tickformat:f.tickformat,tickformatstops:f.tickformatstops,tickprefix:f.tickprefix,showtickprefix:f.showtickprefix,ticksuffix:f.ticksuffix,showticksuffix:f.showticksuffix,separatethousands:f.separatethousands,exponentformat:f.exponentformat,minexponent:f.minexponent,showexponent:f.showexponent,title:{text:{valType:"string"},font:y({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),Ru=It((et,Y)=>{var f=M_(),y=Ha().counter,z=Xm(),P=Ur().scales;z(P);function n(i){return"`"+i+"`"}Y.exports=function(i,a){i=i||"",a=a||{};var l=a.cLetter||"c";"onlyIfNumerical"in a&&a.onlyIfNumerical;var o="noScale"in a?a.noScale:i==="marker.line",c="showScaleDflt"in a?a.showScaleDflt:l==="z",s=typeof a.colorscaleDflt=="string"?P[a.colorscaleDflt]:null,h=a.editTypeOverride||"",m=i?i+".":"",b;"colorAttr"in a?(b=a.colorAttr,a.colorAttr):(b={z:"z",c:"color"}[l],""+n(m+b));var x=l+"auto",_=l+"min",A=l+"max",d=l+"mid",k={};k[_]=k[A]=void 0;var w={};w[x]=!1;var D={};return b==="color"&&(D.color={valType:"color",arrayOk:!0,editType:h||"style"},a.anim&&(D.color.anim=!0)),D[x]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:k},D[_]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[A]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[d]={valType:"number",dflt:null,editType:"calc",impliedEdits:k},D.colorscale={valType:"colorscale",editType:"calc",dflt:s,impliedEdits:{autocolorscale:!1}},D.autocolorscale={valType:"boolean",dflt:a.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},D.reversescale={valType:"boolean",dflt:!1,editType:"plot"},o||(D.showscale={valType:"boolean",dflt:c,editType:"calc"},D.colorbar=f),a.noColorAxis||(D.coloraxis={valType:"subplotid",regex:y("coloraxis"),dflt:null,editType:"calc"}),D}}),Hc=It((et,Y)=>{var f=Yn().extendFlat,y=Ru(),z=Ur().scales;Y.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:z.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:z.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:z.RdBu,editType:"calc"}},coloraxis:f({_isSubplotObj:!0,editType:"calc"},y("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),Am=It((et,Y)=>{var f=jn();Y.exports=function(y){return f.isPlainObject(y.colorbar)}}),Xh=It(et=>{var Y=Sr(),f=jn(),y=Dr(),z=y.ONEDAY,P=y.ONEWEEK;et.dtick=function(n,i){var a=i==="log",l=i==="date",o=i==="category",c=l?z:1;if(!n)return c;if(Y(n))return n=Number(n),n<=0?c:o?Math.max(1,Math.round(n)):l?Math.max(.1,n):n;if(typeof n!="string"||!(l||a))return c;var s=n.charAt(0),h=n.substr(1);return h=Y(h)?Number(h):0,h<=0||!(l&&s==="M"&&h===Math.round(h)||a&&s==="L"||a&&s==="D"&&(h===1||h===2))?c:n},et.tick0=function(n,i,a,l){if(i==="date")return f.cleanDate(n,f.dateTick0(a,l%P===0?1:0));if(!(l==="D1"||l==="D2"))return Y(n)?Number(n):0}}),jv=It((et,Y)=>{var f=Xh(),y=jn().isArrayOrTypedArray,z=Xn().isTypedArraySpec,P=Xn().decodeTypedArraySpec;Y.exports=function(n,i,a,l,o){o||(o={});var c=o.isMinor,s=c?n.minor||{}:n,h=c?i.minor:i,m=c?"minor.":"";function b(E){var I=s[E];return z(I)&&(I=P(I)),I!==void 0?I:(h._template||{})[E]}var x=b("tick0"),_=b("dtick"),A=b("tickvals"),d=y(A)?"array":_?"linear":"auto",k=a(m+"tickmode",d);if(k==="auto"||k==="sync")a(m+"nticks");else if(k==="linear"){var w=h.dtick=f.dtick(_,l);h.tick0=f.tick0(x,l,i.calendar,w)}else if(l!=="multicategory"){var D=a(m+"tickvals");D===void 0?h.tickmode="auto":c||a("ticktext")}}}),Uv=It((et,Y)=>{var f=jn(),y=Gf();Y.exports=function(z,P,n,i){var a=i.isMinor,l=a?z.minor||{}:z,o=a?P.minor:P,c=a?y.minor:y,s=a?"minor.":"",h=f.coerce2(l,o,c,"ticklen",a?(P.ticklen||5)*.6:void 0),m=f.coerce2(l,o,c,"tickwidth",a?P.tickwidth||1:void 0),b=f.coerce2(l,o,c,"tickcolor",(a?P.tickcolor:void 0)||o.color),x=n(s+"ticks",!a&&i.outerTicks||h||m||b?"outside":"");x||(delete o.ticklen,delete o.tickwidth,delete o.tickcolor)}}),tb=It((et,Y)=>{Y.exports=function(f){var y=["showexponent","showtickprefix","showticksuffix"],z=y.filter(function(n){return f[n]!==void 0}),P=function(n){return f[n]===f[z[0]]};if(z.every(P)||z.length===1)return f[z[0]]}}),Zf=It((et,Y)=>{var f=jn(),y=Tc();Y.exports=function(z,P,n){var i=n.name,a=n.inclusionAttr||"visible",l=P[i],o=f.isArrayOrTypedArray(z[i])?z[i]:[],c=P[i]=[],s=y.arrayTemplater(P,i,a),h,m;for(h=0;h{var f=jn(),y=Hn().contrast,z=Gf(),P=tb(),n=Zf();Y.exports=function(a,l,o,c,s){s||(s={});var h=o("labelalias");f.isPlainObject(h)||delete l.labelalias;var m=P(a),b=o("showticklabels");if(b){s.noTicklabelshift||o("ticklabelshift"),s.noTicklabelstandoff||o("ticklabelstandoff");var x=s.font||{},_=l.color,A=l.ticklabelposition||"",d=A.indexOf("inside")!==-1?y(s.bgColor):_&&_!==z.color.dflt?_:x.color;if(f.coerceFont(o,"tickfont",x,{overrideDflt:{color:d}}),!s.noTicklabelstep&&c!=="multicategory"&&c!=="log"&&o("ticklabelstep"),!s.noAng){var k=o("tickangle");!s.noAutotickangles&&k==="auto"&&o("autotickangles")}if(c!=="category"){var w=o("tickformat");n(a,l,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:i}),l.tickformatstops.length||delete l.tickformatstops,!s.noExp&&!w&&c!=="date"&&(o("showexponent",m),o("exponentformat"),o("minexponent"),o("separatethousands"))}!s.noMinorloglabels&&c==="log"&&o("minorloglabels")}};function i(a,l){function o(s,h){return f.coerce(a,l,z.tickformatstops,s,h)}var c=o("enabled");c&&(o("dtickrange"),o("value"))}}),Sg=It((et,Y)=>{var f=tb();Y.exports=function(y,z,P,n,i){i||(i={});var a=i.tickSuffixDflt,l=f(y),o=P("tickprefix");o&&P("showtickprefix",l);var c=P("ticksuffix",a);c&&P("showticksuffix",l)}}),Q1=It((et,Y)=>{var f=jn(),y=Tc(),z=jv(),P=Uv(),n=q0(),i=Sg(),a=M_();Y.exports=function(l,o,c){var s=y.newContainer(o,"colorbar"),h=l.colorbar||{};function m(F,H){return f.coerce(h,s,a,F,H)}var b=c.margin||{t:0,b:0,l:0,r:0},x=c.width-b.l-b.r,_=c.height-b.t-b.b,A=m("orientation"),d=A==="v",k=m("thicknessmode");m("thickness",k==="fraction"?30/(d?x:_):30);var w=m("lenmode");m("len",w==="fraction"?1:d?_:x);var D=m("yref"),E=m("xref"),I=D==="paper",M=E==="paper",p,g,C,S="left";d?(C="middle",S=M?"left":"right",p=M?1.02:1,g=.5):(C=I?"bottom":"top",S="center",p=.5,g=I?1.02:1),f.coerce(h,s,{x:{valType:"number",min:M?-2:0,max:M?3:1,dflt:p}},"x"),f.coerce(h,s,{y:{valType:"number",min:I?-2:0,max:I?3:1,dflt:g}},"y"),m("xanchor",S),m("xpad"),m("yanchor",C),m("ypad"),f.noneOrAll(h,s,["x","y"]),m("outlinecolor"),m("outlinewidth"),m("bordercolor"),m("borderwidth"),m("bgcolor");var N=f.coerce(h,s,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:d?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");m("ticklabeloverflow",N.indexOf("inside")!==-1?"hide past domain":"hide past div"),z(h,s,m,"linear");var B=c.font,U={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:B};N.indexOf("inside")!==-1&&(U.bgColor="black"),i(h,s,m,"linear",U),n(h,s,m,"linear",U),P(h,s,m,"linear",U),m("title.text",c._dfltTitle.colorbar);var V=s.showticklabels?s.tickfont:B,W=f.extendFlat({},B,{family:V.family,size:f.bigFont(V.size)});f.coerceFont(m,"title.font",W),m("title.side",d?"top":"right")}}),Cu=It((et,Y)=>{var f=Sr(),y=jn(),z=Am(),P=Q1(),n=Ur().isValid,i=ls().traceIs;function a(l,o){var c=o.slice(0,o.length-1);return o?y.nestedProperty(l,c).get()||{}:l}Y.exports=function l(o,c,s,h,m){var b=m.prefix,x=m.cLetter,_="_module"in c,A=a(o,b),d=a(c,b),k=a(c._template||{},b)||{},w=function(){return delete o.coloraxis,delete c.coloraxis,l(o,c,s,h,m)};if(_){var D=s._colorAxes||{},E=h(b+"coloraxis");if(E){var I=i(c,"contour")&&y.nestedProperty(c,"contours.coloring").get()||"heatmap",M=D[E];M?(M[2].push(w),M[0]!==I&&(M[0]=!1,y.warn(["Ignoring coloraxis:",E,"setting","as it is linked to incompatible colorscales."].join(" ")))):D[E]=[I,c,[w]];return}}var p=A[x+"min"],g=A[x+"max"],C=f(p)&&f(g)&&p{var f=jn(),y=Tc(),z=Hc(),P=Cu();Y.exports=function(n,i){function a(x,_){return f.coerce(n,i,z,x,_)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var l=i._colorAxes,o,c;function s(x,_){return f.coerce(o,c,z.coloraxis,x,_)}for(var h in l){var m=l[h];if(m[0])o=n[h]||{},c=y.newContainer(i,h,"coloraxis"),c._name=h,P(o,c,i,s,{prefix:"",cLetter:"c"});else{for(var b=0;b{var f=jn(),y=fp().hasColorscale,z=fp().extractOpts;Y.exports=function(P,n){function i(m,b){var x=m["_"+b];x!==void 0&&(m[b]=x)}function a(m,b){var x=b.container?f.nestedProperty(m,b.container).get():m;if(x)if(x.coloraxis)x._colorAx=n[x.coloraxis];else{var _=z(x),A=_.auto;(A||_.min===void 0)&&i(x,b.min),(A||_.max===void 0)&&i(x,b.max),_.autocolorscale&&i(x,"colorscale")}}for(var l=0;l{var f=Sr(),y=jn(),z=fp().extractOpts;Y.exports=function(P,n,i){var a=P._fullLayout,l=i.vals,o=i.containerStr,c=o?y.nestedProperty(n,o).get():n,s=z(c),h=s.auto!==!1,m=s.min,b=s.max,x=s.mid,_=function(){return y.aggNums(Math.min,null,l)},A=function(){return y.aggNums(Math.max,null,l)};if(m===void 0?m=_():h&&(c._colorAx&&f(m)?m=Math.min(m,_()):m=_()),b===void 0?b=A():h&&(c._colorAx&&f(b)?b=Math.max(b,A()):b=A()),h&&x!==void 0&&(b-x>x-m?m=x-(b-x):b-x=0?d=a.colorscale.sequential:d=a.colorscale.sequentialminus,s._sync("colorscale",d)}}}),ch=It((et,Y)=>{var f=Ur(),y=fp();Y.exports={moduleType:"component",name:"colorscale",attributes:Ru(),layoutAttributes:Hc(),supplyLayoutDefaults:$v(),handleDefaults:Cu(),crossTraceDefaults:C4(),calc:Cp(),scales:f.scales,defaultScale:f.defaultScale,getScale:f.get,isValidScale:f.isValid,hasColorscale:y.hasColorscale,extractOpts:y.extractOpts,extractScale:y.extractScale,flipScale:y.flipScale,makeColorScaleFunc:y.makeColorScaleFunc,makeColorScaleFuncFromTrace:y.makeColorScaleFuncFromTrace}}),Fu=It((et,Y)=>{var f=jn(),y=Xn().isTypedArraySpec;Y.exports={hasLines:function(z){return z.visible&&z.mode&&z.mode.indexOf("lines")!==-1},hasMarkers:function(z){return z.visible&&(z.mode&&z.mode.indexOf("markers")!==-1||z.type==="splom")},hasText:function(z){return z.visible&&z.mode&&z.mode.indexOf("text")!==-1},isBubble:function(z){var P=z.marker;return f.isPlainObject(P)&&(f.isArrayOrTypedArray(P.size)||y(P.size))}}}),Hv=It((et,Y)=>{var f=Sr();Y.exports=function(y,z){z||(z=2);var P=y.marker,n=P.sizeref||1,i=P.sizemin||0,a=P.sizemode==="area"?function(l){return Math.sqrt(l/n)}:function(l){return l/n};return function(l){var o=a(l/z);return f(o)&&o>0?Math.max(o,i):0}}}),T0=It(et=>{var Y=jn();et.getSubplot=function(i){return i.subplot||i.xaxis+i.yaxis||i.geo},et.isTraceInSubplots=function(i,a){if(i.type==="splom"){for(var l=i.xaxes||[],o=i.yaxes||[],c=0;c=0&&l.index{Y.exports=z;var f={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},y=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function z(i){var a=[];return i.replace(y,function(l,o,c){var s=o.toLowerCase();for(c=n(c),s=="m"&&c.length>2&&(a.push([o].concat(c.splice(0,2))),s="l",o=o=="m"?"l":"L");;){if(c.length==f[s])return c.unshift(o),a.push(c);if(c.length{var f=E_(),y=function(x,_){return _?Math.round(x*(_=Math.pow(10,_)))/_:Math.round(x)},z="M0,0Z",P=Math.sqrt(2),n=Math.sqrt(3),i=Math.PI,a=Math.cos,l=Math.sin;Y.exports={circle:{n:0,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k="M"+d+",0A"+d+","+d+" 0 1,1 0,-"+d+"A"+d+","+d+" 0 0,1 "+d+",0Z";return A?b(_,A,k):k}},square:{n:1,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"H-"+d+"V-"+d+"H"+d+"Z")}},diamond:{n:2,f:function(x,_,A){if(o(_))return z;var d=y(x*1.3,2);return b(_,A,"M"+d+",0L0,"+d+"L-"+d+",0L0,-"+d+"Z")}},cross:{n:3,f:function(x,_,A){if(o(_))return z;var d=y(x*.4,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+d+"H"+d+"V"+k+"H-"+d+"V"+d+"H-"+k+"V-"+d+"H-"+d+"V-"+k+"H"+d+"V-"+d+"H"+k+"Z")}},x:{n:4,f:function(x,_,A){if(o(_))return z;var d=y(x*.8/P,2),k="l"+d+","+d,w="l"+d+",-"+d,D="l-"+d+",-"+d,E="l-"+d+","+d;return b(_,A,"M0,"+d+k+w+D+w+D+E+D+E+k+E+k+"Z")}},"triangle-up":{n:5,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+d+","+k+"H"+d+"L0,-"+w+"Z")}},"triangle-down":{n:6,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+d+",-"+k+"H"+d+"L0,"+w+"Z")}},"triangle-left":{n:7,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M"+k+",-"+d+"V"+d+"L-"+w+",0Z")}},"triangle-right":{n:8,f:function(x,_,A){if(o(_))return z;var d=y(x*2/n,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+k+",-"+d+"V"+d+"L"+w+",0Z")}},"triangle-ne":{n:9,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+k+",-"+d+"H"+d+"V"+k+"Z")}},"triangle-se":{n:10,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+d+",-"+k+"V"+d+"H-"+k+"Z")}},"triangle-sw":{n:11,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+d+"H-"+d+"V-"+k+"Z")}},"triangle-nw":{n:12,f:function(x,_,A){if(o(_))return z;var d=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+d+","+k+"V-"+d+"H"+k+"Z")}},pentagon:{n:13,f:function(x,_,A){if(o(_))return z;var d=y(x*.951,2),k=y(x*.588,2),w=y(-x,2),D=y(x*-.309,2),E=y(x*.809,2);return b(_,A,"M"+d+","+D+"L"+k+","+E+"H-"+k+"L-"+d+","+D+"L0,"+w+"Z")}},hexagon:{n:14,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x/2,2),w=y(x*n/2,2);return b(_,A,"M"+w+",-"+k+"V"+k+"L0,"+d+"L-"+w+","+k+"V-"+k+"L0,-"+d+"Z")}},hexagon2:{n:15,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x/2,2),w=y(x*n/2,2);return b(_,A,"M-"+k+","+w+"H"+k+"L"+d+",0L"+k+",-"+w+"H-"+k+"L-"+d+",0Z")}},octagon:{n:16,f:function(x,_,A){if(o(_))return z;var d=y(x*.924,2),k=y(x*.383,2);return b(_,A,"M-"+k+",-"+d+"H"+k+"L"+d+",-"+k+"V"+k+"L"+k+","+d+"H-"+k+"L-"+d+","+k+"V-"+k+"Z")}},star:{n:17,f:function(x,_,A){if(o(_))return z;var d=x*1.4,k=y(d*.225,2),w=y(d*.951,2),D=y(d*.363,2),E=y(d*.588,2),I=y(-d,2),M=y(d*-.309,2),p=y(d*.118,2),g=y(d*.809,2),C=y(d*.382,2);return b(_,A,"M"+k+","+M+"H"+w+"L"+D+","+p+"L"+E+","+g+"L0,"+C+"L-"+E+","+g+"L-"+D+","+p+"L-"+w+","+M+"H-"+k+"L0,"+I+"Z")}},hexagram:{n:18,f:function(x,_,A){if(o(_))return z;var d=y(x*.66,2),k=y(x*.38,2),w=y(x*.76,2);return b(_,A,"M-"+w+",0l-"+k+",-"+d+"h"+w+"l"+k+",-"+d+"l"+k+","+d+"h"+w+"l-"+k+","+d+"l"+k+","+d+"h-"+w+"l-"+k+","+d+"l-"+k+",-"+d+"h-"+w+"Z")}},"star-triangle-up":{n:19,f:function(x,_,A){if(o(_))return z;var d=y(x*n*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M-"+d+","+k+E+d+","+k+E+"0,-"+w+E+"-"+d+","+k+"Z")}},"star-triangle-down":{n:20,f:function(x,_,A){if(o(_))return z;var d=y(x*n*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M"+d+",-"+k+E+"-"+d+",-"+k+E+"0,"+w+E+d+",-"+k+"Z")}},"star-square":{n:21,f:function(x,_,A){if(o(_))return z;var d=y(x*1.1,2),k=y(x*2,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+d+",-"+d+w+"-"+d+","+d+w+d+","+d+w+d+",-"+d+w+"-"+d+",-"+d+"Z")}},"star-diamond":{n:22,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2),k=y(x*1.9,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+d+",0"+w+"0,"+d+w+d+",0"+w+"0,-"+d+w+"-"+d+",0Z")}},"diamond-tall":{n:23,f:function(x,_,A){if(o(_))return z;var d=y(x*.7,2),k=y(x*1.4,2);return b(_,A,"M0,"+k+"L"+d+",0L0,-"+k+"L-"+d+",0Z")}},"diamond-wide":{n:24,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2),k=y(x*.7,2);return b(_,A,"M0,"+k+"L"+d+",0L0,-"+k+"L-"+d+",0Z")}},hourglass:{n:25,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"H-"+d+"L"+d+",-"+d+"H-"+d+"Z")},noDot:!0},bowtie:{n:26,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"V-"+d+"L-"+d+","+d+"V-"+d+"Z")},noDot:!0},"circle-cross":{n:27,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d+"M"+d+",0A"+d+","+d+" 0 1,1 0,-"+d+"A"+d+","+d+" 0 0,1 "+d+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x/P,2);return b(_,A,"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k+"M"+d+",0A"+d+","+d+" 0 1,1 0,-"+d+"A"+d+","+d+" 0 0,1 "+d+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d+"M"+d+","+d+"H-"+d+"V-"+d+"H"+d+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"L-"+d+",-"+d+"M"+d+",-"+d+"L-"+d+","+d+"M"+d+","+d+"H-"+d+"V-"+d+"H"+d+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(x,_,A){if(o(_))return z;var d=y(x*1.3,2);return b(_,A,"M"+d+",0L0,"+d+"L-"+d+",0L0,-"+d+"ZM0,-"+d+"V"+d+"M-"+d+",0H"+d)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(x,_,A){if(o(_))return z;var d=y(x*1.3,2),k=y(x*.65,2);return b(_,A,"M"+d+",0L0,"+d+"L-"+d+",0L0,-"+d+"ZM-"+k+",-"+k+"L"+k+","+k+"M-"+k+","+k+"L"+k+",-"+k)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"L-"+d+",-"+d+"M"+d+",-"+d+"L-"+d+","+d)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*.85,2);return b(_,A,"M0,"+d+"V-"+d+"M"+d+",0H-"+d+"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(x,_,A){if(o(_))return z;var d=y(x/2,2),k=y(x,2);return b(_,A,"M"+d+","+k+"V-"+k+"M"+(d-k)+",-"+k+"V"+k+"M"+k+","+d+"H-"+k+"M-"+k+","+(d-k)+"H"+k)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+d+","+w+"L0,0M"+d+","+w+"L0,0M0,-"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+d+",-"+w+"L0,0M"+d+",-"+w+"L0,0M0,"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M"+w+","+d+"L0,0M"+w+",-"+d+"L0,0M-"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(x,_,A){if(o(_))return z;var d=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+w+","+d+"L0,0M-"+w+",-"+d+"L0,0M"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2);return b(_,A,"M"+d+",0H-"+d)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(x,_,A){if(o(_))return z;var d=y(x*1.4,2);return b(_,A,"M0,"+d+"V-"+d)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+",-"+d+"L-"+d+","+d)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(x,_,A){if(o(_))return z;var d=y(x,2);return b(_,A,"M"+d+","+d+"L-"+d+",-"+d)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+d+","+k+"H"+d+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+d+",-"+k+"H"+d+"Z")},noDot:!0},"arrow-left":{n:47,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L"+d+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-right":{n:48,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L-"+d+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M-"+d+",0H"+d+"M0,0L-"+d+","+k+"H"+d+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(x,_,A){if(o(_))return z;var d=y(x,2),k=y(x*2,2);return b(_,A,"M-"+d+",0H"+d+"M0,0L-"+d+",-"+k+"H"+d+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L"+d+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(x,_,A){if(o(_))return z;var d=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L-"+d+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(x,_,A){if(o(_))return z;var d=i/2.5,k=2*x*a(d),w=2*x*l(d);return b(_,A,"M0,0L"+-k+","+w+"L"+k+","+w+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(x,_,A){if(o(_))return z;var d=i/4,k=2*x*a(d),w=2*x*l(d);return b(_,A,"M0,0L"+-k+","+w+"A "+2*x+","+2*x+" 0 0 1 "+k+","+w+"Z")},backoff:.4,noDot:!0}};function o(x){return x===null}var c,s,h,m;function b(x,_,A){if((!x||x%360===0)&&!_)return A;if(h===x&&m===_&&c===A)return s;h=x,m=_,c=A;function d(U,V){var W=a(U),F=l(U),H=V[0],q=V[1]+(_||0);return[H*W-q*F,H*F+q*W]}for(var k=x/180*i,w=0,D=0,E=f(A),I="",M=0;M{var f=Br(),y=jn(),z=y.numberFormat,P=Sr(),n=Xi(),i=ls(),a=Hn(),l=ch(),o=y.strTranslate,c=uu(),s=k0(),h=Rd(),m=h.LINE_SPACING,b=to().DESELECTDIM,x=Fu(),_=Hv(),A=T0().appendArrayPointValue,d=Y.exports={};d.font=function(Mt,Ot){var Lt=Ot.variant,ie=Ot.style,be=Ot.weight,ce=Ot.color,Le=Ot.size,Ze=Ot.family,Qe=Ot.shadow,mr=Ot.lineposition,fr=Ot.textcase;Ze&&Mt.style("font-family",Ze),Le+1&&Mt.style("font-size",Le+"px"),ce&&Mt.call(a.fill,ce),be&&Mt.style("font-weight",be),ie&&Mt.style("font-style",ie),Lt&&Mt.style("font-variant",Lt),fr&&Mt.style("text-transform",k(D(fr))),Qe&&Mt.style("text-shadow",Qe==="auto"?c.makeTextShadow(a.contrast(ce)):k(Qe)),mr&&Mt.style("text-decoration-line",k(E(mr)))};function k(Mt){return Mt==="none"?void 0:Mt}var w={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function D(Mt){return w[Mt]}function E(Mt){return Mt.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}d.setPosition=function(Mt,Ot,Lt){Mt.attr("x",Ot).attr("y",Lt)},d.setSize=function(Mt,Ot,Lt){Mt.attr("width",Ot).attr("height",Lt)},d.setRect=function(Mt,Ot,Lt,ie,be){Mt.call(d.setPosition,Ot,Lt).call(d.setSize,ie,be)},d.translatePoint=function(Mt,Ot,Lt,ie){var be=Lt.c2p(Mt.x),ce=ie.c2p(Mt.y);if(P(be)&&P(ce)&&Ot.node())Ot.node().nodeName==="text"?Ot.attr("x",be).attr("y",ce):Ot.attr("transform",o(be,ce));else return!1;return!0},d.translatePoints=function(Mt,Ot,Lt){Mt.each(function(ie){var be=f.select(this);d.translatePoint(ie,be,Ot,Lt)})},d.hideOutsideRangePoint=function(Mt,Ot,Lt,ie,be,ce){Ot.attr("display",Lt.isPtWithinRange(Mt,be)&&ie.isPtWithinRange(Mt,ce)?null:"none")},d.hideOutsideRangePoints=function(Mt,Ot){if(Ot._hasClipOnAxisFalse){var Lt=Ot.xaxis,ie=Ot.yaxis;Mt.each(function(be){var ce=be[0].trace,Le=ce.xcalendar,Ze=ce.ycalendar,Qe=i.traceIs(ce,"bar-like")?".bartext":".point,.textpoint";Mt.selectAll(Qe).each(function(mr){d.hideOutsideRangePoint(mr,f.select(this),Lt,ie,Le,Ze)})})}},d.crispRound=function(Mt,Ot,Lt){return!Ot||!P(Ot)?Lt||0:Mt._context.staticPlot?Ot:Ot<1?1:Math.round(Ot)},d.singleLineStyle=function(Mt,Ot,Lt,ie,be){Ot.style("fill","none");var ce=(((Mt||[])[0]||{}).trace||{}).line||{},Le=Lt||ce.width||0,Ze=be||ce.dash||"";a.stroke(Ot,ie||ce.color),d.dashLine(Ot,Ze,Le)},d.lineGroupStyle=function(Mt,Ot,Lt,ie){Mt.style("fill","none").each(function(be){var ce=(((be||[])[0]||{}).trace||{}).line||{},Le=Ot||ce.width||0,Ze=ie||ce.dash||"";f.select(this).call(a.stroke,Lt||ce.color).call(d.dashLine,Ze,Le)})},d.dashLine=function(Mt,Ot,Lt){Lt=+Lt||0,Ot=d.dashStyle(Ot,Lt),Mt.style({"stroke-dasharray":Ot,"stroke-width":Lt+"px"})},d.dashStyle=function(Mt,Ot){Ot=+Ot||1;var Lt=Math.max(Ot,3);return Mt==="solid"?Mt="":Mt==="dot"?Mt=Lt+"px,"+Lt+"px":Mt==="dash"?Mt=3*Lt+"px,"+3*Lt+"px":Mt==="longdash"?Mt=5*Lt+"px,"+5*Lt+"px":Mt==="dashdot"?Mt=3*Lt+"px,"+Lt+"px,"+Lt+"px,"+Lt+"px":Mt==="longdashdot"&&(Mt=5*Lt+"px,"+2*Lt+"px,"+Lt+"px,"+2*Lt+"px"),Mt};function I(Mt,Ot,Lt,ie){var be=Ot.fillpattern,ce=Ot.fillgradient,Le=d.getPatternAttr,Ze=be&&(Le(be.shape,0,"")||Le(be.path,0,""));if(Ze){var Qe=Le(be.bgcolor,0,null),mr=Le(be.fgcolor,0,null),fr=be.fgopacity,Jr=Le(be.size,0,8),an=Le(be.solidity,0,.3),Er=Ot.uid;d.pattern(Mt,"point",Lt,Er,Ze,Jr,an,void 0,be.fillmode,Qe,mr,fr)}else if(ce&&ce.type!=="none"){var dn=ce.type,_n="scatterfill-"+Ot.uid;if(ie&&(_n="legendfill-"+Ot.uid),!ie&&(ce.start!==void 0||ce.stop!==void 0)){var Oe,Xt;dn==="horizontal"?(Oe={x:ce.start,y:0},Xt={x:ce.stop,y:0}):dn==="vertical"&&(Oe={x:0,y:ce.start},Xt={x:0,y:ce.stop}),Oe.x=Ot._xA.c2p(Oe.x===void 0?Ot._extremes.x.min[0].val:Oe.x,!0),Oe.y=Ot._yA.c2p(Oe.y===void 0?Ot._extremes.y.min[0].val:Oe.y,!0),Xt.x=Ot._xA.c2p(Xt.x===void 0?Ot._extremes.x.max[0].val:Xt.x,!0),Xt.y=Ot._yA.c2p(Xt.y===void 0?Ot._extremes.y.max[0].val:Xt.y,!0),Mt.call(B,Lt,_n,"linear",ce.colorscale,"fill",Oe,Xt,!0,!1)}else dn==="horizontal"&&(dn=dn+"reversed"),Mt.call(d.gradient,Lt,_n,dn,ce.colorscale,"fill")}else Ot.fillcolor&&Mt.call(a.fill,Ot.fillcolor)}d.singleFillStyle=function(Mt,Ot){var Lt=f.select(Mt.node()),ie=Lt.data(),be=((ie[0]||[])[0]||{}).trace||{};I(Mt,be,Ot,!1)},d.fillGroupStyle=function(Mt,Ot,Lt){Mt.style("stroke-width",0).each(function(ie){var be=f.select(this);ie[0].trace&&I(be,ie[0].trace,Ot,Lt)})};var M=Nu();d.symbolNames=[],d.symbolFuncs=[],d.symbolBackOffs=[],d.symbolNeedLines={},d.symbolNoDot={},d.symbolNoFill={},d.symbolList=[],Object.keys(M).forEach(function(Mt){var Ot=M[Mt],Lt=Ot.n;d.symbolList.push(Lt,String(Lt),Mt,Lt+100,String(Lt+100),Mt+"-open"),d.symbolNames[Lt]=Mt,d.symbolFuncs[Lt]=Ot.f,d.symbolBackOffs[Lt]=Ot.backoff||0,Ot.needLine&&(d.symbolNeedLines[Lt]=!0),Ot.noDot?d.symbolNoDot[Lt]=!0:d.symbolList.push(Lt+200,String(Lt+200),Mt+"-dot",Lt+300,String(Lt+300),Mt+"-open-dot"),Ot.noFill&&(d.symbolNoFill[Lt]=!0)});var p=d.symbolNames.length,g="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";d.symbolNumber=function(Mt){if(P(Mt))Mt=+Mt;else if(typeof Mt=="string"){var Ot=0;Mt.indexOf("-open")>0&&(Ot=100,Mt=Mt.replace("-open","")),Mt.indexOf("-dot")>0&&(Ot+=200,Mt=Mt.replace("-dot","")),Mt=d.symbolNames.indexOf(Mt),Mt>=0&&(Mt+=Ot)}return Mt%100>=p||Mt>=400?0:Math.floor(Math.max(Mt,0))};function C(Mt,Ot,Lt,ie){var be=Mt%100;return d.symbolFuncs[be](Ot,Lt,ie)+(Mt>=200?g:"")}var S=z("~f"),N={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};d.gradient=function(Mt,Ot,Lt,ie,be,ce){var Le=N[ie];return B(Mt,Ot,Lt,Le.type,be,ce,Le.start,Le.stop,!1,Le.reversed)};function B(Mt,Ot,Lt,ie,be,ce,Le,Ze,Qe,mr){var fr=be.length,Jr;ie==="linear"?Jr={node:"linearGradient",attrs:{x1:Le.x,y1:Le.y,x2:Ze.x,y2:Ze.y,gradientUnits:Qe?"userSpaceOnUse":"objectBoundingBox"},reversed:mr}:ie==="radial"&&(Jr={node:"radialGradient",reversed:mr});for(var an=new Array(fr),Er=0;Er=0&&Mt.i===void 0&&(Mt.i=ce.i),Ot.style("opacity",ie.selectedOpacityFn?ie.selectedOpacityFn(Mt):Mt.mo===void 0?Le.opacity:Mt.mo),ie.ms2mrc){var Qe;Mt.ms==="various"||Le.size==="various"?Qe=3:Qe=ie.ms2mrc(Mt.ms),Mt.mrc=Qe,ie.selectedSizeFn&&(Qe=Mt.mrc=ie.selectedSizeFn(Mt));var mr=d.symbolNumber(Mt.mx||Le.symbol)||0;Mt.om=mr%200>=100;var fr=ue(Mt,Lt),Jr=mt(Mt,Lt);Ot.attr("d",C(mr,Qe,fr,Jr))}var an=!1,Er,dn,_n;if(Mt.so)_n=Ze.outlierwidth,dn=Ze.outliercolor,Er=Le.outliercolor;else{var Oe=(Ze||{}).width;_n=(Mt.mlw+1||Oe+1||(Mt.trace?(Mt.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Mt?dn=Mt.mlcc=ie.lineScale(Mt.mlc):y.isArrayOrTypedArray(Ze.color)?dn=a.defaultLine:dn=Ze.color,y.isArrayOrTypedArray(Le.color)&&(Er=a.defaultLine,an=!0),"mc"in Mt?Er=Mt.mcc=ie.markerScale(Mt.mc):Er=Le.color||Le.colors||"rgba(0,0,0,0)",ie.selectedColorFn&&(Er=ie.selectedColorFn(Mt))}if(Mt.om)Ot.call(a.stroke,Er).style({"stroke-width":(_n||1)+"px",fill:"none"});else{Ot.style("stroke-width",(Mt.isBlank?0:_n)+"px");var Xt=Le.gradient,oe=Mt.mgt;oe?an=!0:oe=Xt&&Xt.type,y.isArrayOrTypedArray(oe)&&(oe=oe[0],N[oe]||(oe=0));var zt=Le.pattern,_t=d.getPatternAttr,Pt=zt&&(_t(zt.shape,Mt.i,"")||_t(zt.path,Mt.i,""));if(oe&&oe!=="none"){var Ht=Mt.mgc;Ht?an=!0:Ht=Xt.color;var ae=Lt.uid;an&&(ae+="-"+Mt.i),d.gradient(Ot,be,ae,oe,[[0,Ht],[1,Er]],"fill")}else if(Pt){var he=!1,Me=zt.fgcolor;!Me&&ce&&ce.color&&(Me=ce.color,he=!0);var qe=_t(Me,Mt.i,ce&&ce.color||null),Ye=_t(zt.bgcolor,Mt.i,null),ur=zt.fgopacity,Rr=_t(zt.size,Mt.i,8),zr=_t(zt.solidity,Mt.i,.3);he=he||Mt.mcc||y.isArrayOrTypedArray(zt.shape)||y.isArrayOrTypedArray(zt.path)||y.isArrayOrTypedArray(zt.bgcolor)||y.isArrayOrTypedArray(zt.fgcolor)||y.isArrayOrTypedArray(zt.size)||y.isArrayOrTypedArray(zt.solidity);var xr=Lt.uid;he&&(xr+="-"+Mt.i),d.pattern(Ot,"point",be,xr,Pt,Rr,zr,Mt.mcc,zt.fillmode,Ye,qe,ur)}else y.isArrayOrTypedArray(Er)?a.fill(Ot,Er[Mt.i]):a.fill(Ot,Er);_n&&a.stroke(Ot,dn)}},d.makePointStyleFns=function(Mt){var Ot={},Lt=Mt.marker;return Ot.markerScale=d.tryColorscale(Lt,""),Ot.lineScale=d.tryColorscale(Lt,"line"),i.traceIs(Mt,"symbols")&&(Ot.ms2mrc=x.isBubble(Mt)?_(Mt):function(){return(Lt.size||6)/2}),Mt.selectedpoints&&y.extendFlat(Ot,d.makeSelectedPointStyleFns(Mt)),Ot},d.makeSelectedPointStyleFns=function(Mt){var Ot={},Lt=Mt.selected||{},ie=Mt.unselected||{},be=Mt.marker||{},ce=Lt.marker||{},Le=ie.marker||{},Ze=be.opacity,Qe=ce.opacity,mr=Le.opacity,fr=Qe!==void 0,Jr=mr!==void 0;(y.isArrayOrTypedArray(Ze)||fr||Jr)&&(Ot.selectedOpacityFn=function(_t){var Pt=_t.mo===void 0?be.opacity:_t.mo;return _t.selected?fr?Qe:Pt:Jr?mr:b*Pt});var an=be.color,Er=ce.color,dn=Le.color;(Er||dn)&&(Ot.selectedColorFn=function(_t){var Pt=_t.mcc||an;return _t.selected?Er||Pt:dn||Pt});var _n=be.size,Oe=ce.size,Xt=Le.size,oe=Oe!==void 0,zt=Xt!==void 0;return i.traceIs(Mt,"symbols")&&(oe||zt)&&(Ot.selectedSizeFn=function(_t){var Pt=_t.mrc||_n/2;return _t.selected?oe?Oe/2:Pt:zt?Xt/2:Pt}),Ot},d.makeSelectedTextStyleFns=function(Mt){var Ot={},Lt=Mt.selected||{},ie=Mt.unselected||{},be=Mt.textfont||{},ce=Lt.textfont||{},Le=ie.textfont||{},Ze=be.color,Qe=ce.color,mr=Le.color;return Ot.selectedTextColorFn=function(fr){var Jr=fr.tc||Ze;return fr.selected?Qe||Jr:mr||(Qe?Jr:a.addOpacity(Jr,b))},Ot},d.selectedPointStyle=function(Mt,Ot){if(!(!Mt.size()||!Ot.selectedpoints)){var Lt=d.makeSelectedPointStyleFns(Ot),ie=Ot.marker||{},be=[];Lt.selectedOpacityFn&&be.push(function(ce,Le){ce.style("opacity",Lt.selectedOpacityFn(Le))}),Lt.selectedColorFn&&be.push(function(ce,Le){a.fill(ce,Lt.selectedColorFn(Le))}),Lt.selectedSizeFn&&be.push(function(ce,Le){var Ze=Le.mx||ie.symbol||0,Qe=Lt.selectedSizeFn(Le);ce.attr("d",C(d.symbolNumber(Ze),Qe,ue(Le,Ot),mt(Le,Ot))),Le.mrc2=Qe}),be.length&&Mt.each(function(ce){for(var Le=f.select(this),Ze=0;Ze0?Lt:0}d.textPointStyle=function(Mt,Ot,Lt){if(Mt.size()){var ie;if(Ot.selectedpoints){var be=d.makeSelectedTextStyleFns(Ot);ie=be.selectedTextColorFn}var ce=Ot.texttemplate,Le=Lt._fullLayout;Mt.each(function(Ze){var Qe=f.select(this),mr=ce?y.extractOption(Ze,Ot,"txt","texttemplate"):y.extractOption(Ze,Ot,"tx","text");if(!mr&&mr!==0){Qe.remove();return}if(ce){var fr=Ot._module.formatLabels,Jr=fr?fr(Ze,Ot,Le):{},an={};A(an,Ot,Ze.i),mr=y.texttemplateString({data:[an,Ze,Ot._meta],fallback:Ot.texttemplatefallback,labels:Jr,locale:Le._d3locale,template:mr})}var Er=Ze.tp||Ot.textposition,dn=W(Ze,Ot),_n=ie?ie(Ze):Ze.tc||Ot.textfont.color;Qe.call(d.font,{family:Ze.tf||Ot.textfont.family,weight:Ze.tw||Ot.textfont.weight,style:Ze.ty||Ot.textfont.style,variant:Ze.tv||Ot.textfont.variant,textcase:Ze.tC||Ot.textfont.textcase,lineposition:Ze.tE||Ot.textfont.lineposition,shadow:Ze.tS||Ot.textfont.shadow,size:dn,color:_n}).text(mr).call(c.convertToTspans,Lt).call(V,Er,dn,Ze.mrc)})}},d.selectedTextStyle=function(Mt,Ot){if(!(!Mt.size()||!Ot.selectedpoints)){var Lt=d.makeSelectedTextStyleFns(Ot);Mt.each(function(ie){var be=f.select(this),ce=Lt.selectedTextColorFn(ie),Le=ie.tp||Ot.textposition,Ze=W(ie,Ot);a.fill(be,ce);var Qe=i.traceIs(Ot,"bar-like");V(be,Le,Ze,ie.mrc2||ie.mrc,Qe)})}};var F=.5;d.smoothopen=function(Mt,Ot){if(Mt.length<3)return"M"+Mt.join("L");var Lt="M"+Mt[0],ie=[],be;for(be=1;be=Qe||_t>=fr&&_t<=Qe)&&(Pt<=Jr&&Pt>=mr||Pt>=Jr&&Pt<=mr)&&(Mt=[_t,Pt])}return Mt}d.applyBackoff=rt,d.makeTester=function(){var Mt=y.ensureSingleById(f.select("body"),"svg","js-plotly-tester",function(Lt){Lt.attr(s.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),Ot=y.ensureSingle(Mt,"path","js-reference-point",function(Lt){Lt.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});d.tester=Mt,d.testref=Ot},d.savedBBoxes={};var gt=0,it=1e4;d.bBox=function(Mt,Ot,Lt){Lt||(Lt=st(Mt));var ie;if(Lt){if(ie=d.savedBBoxes[Lt],ie)return y.extendFlat({},ie)}else if(Mt.childNodes.length===1){var be=Mt.childNodes[0];if(Lt=st(be),Lt){var ce=+be.getAttribute("x")||0,Le=+be.getAttribute("y")||0,Ze=be.getAttribute("transform");if(!Ze){var Qe=d.bBox(be,!1,Lt);return ce&&(Qe.left+=ce,Qe.right+=ce),Le&&(Qe.top+=Le,Qe.bottom+=Le),Qe}if(Lt+="~"+ce+"~"+Le+"~"+Ze,ie=d.savedBBoxes[Lt],ie)return y.extendFlat({},ie)}}var mr,fr;Ot?mr=Mt:(fr=d.tester.node(),mr=Mt.cloneNode(!0),fr.appendChild(mr)),f.select(mr).attr("transform",null).call(c.positionText,0,0);var Jr=mr.getBoundingClientRect(),an=d.testref.node().getBoundingClientRect();Ot||fr.removeChild(mr);var Er={height:Jr.height,width:Jr.width,left:Jr.left-an.left,top:Jr.top-an.top,right:Jr.right-an.left,bottom:Jr.bottom-an.top};return gt>=it&&(d.savedBBoxes={},gt=0),Lt&&(d.savedBBoxes[Lt]=Er),gt++,y.extendFlat({},Er)};function st(Mt){var Ot=Mt.getAttribute("data-unformatted");if(Ot!==null)return Ot+Mt.getAttribute("data-math")+Mt.getAttribute("text-anchor")+Mt.getAttribute("style")}d.setClipUrl=function(Mt,Ot,Lt){Mt.attr("clip-path",xt(Ot,Lt))};function xt(Mt,Ot){if(!Mt)return null;var Lt=Ot._context,ie=Lt._exportedPlot?"":Lt._baseUrl||"";return ie?"url('"+ie+"#"+Mt+"')":"url(#"+Mt+")"}d.getTranslate=function(Mt){var Ot=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,Lt=Mt.attr?"attr":"getAttribute",ie=Mt[Lt]("transform")||"",be=ie.replace(Ot,function(ce,Le,Ze){return[Le,Ze].join(" ")}).split(" ");return{x:+be[0]||0,y:+be[1]||0}},d.setTranslate=function(Mt,Ot,Lt){var ie=/(\btranslate\(.*?\);?)/,be=Mt.attr?"attr":"getAttribute",ce=Mt.attr?"attr":"setAttribute",Le=Mt[be]("transform")||"";return Ot=Ot||0,Lt=Lt||0,Le=Le.replace(ie,"").trim(),Le+=o(Ot,Lt),Le=Le.trim(),Mt[ce]("transform",Le),Le},d.getScale=function(Mt){var Ot=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,Lt=Mt.attr?"attr":"getAttribute",ie=Mt[Lt]("transform")||"",be=ie.replace(Ot,function(ce,Le,Ze){return[Le,Ze].join(" ")}).split(" ");return{x:+be[0]||1,y:+be[1]||1}},d.setScale=function(Mt,Ot,Lt){var ie=/(\bscale\(.*?\);?)/,be=Mt.attr?"attr":"getAttribute",ce=Mt.attr?"attr":"setAttribute",Le=Mt[be]("transform")||"";return Ot=Ot||1,Lt=Lt||1,Le=Le.replace(ie,"").trim(),Le+="scale("+Ot+","+Lt+")",Le=Le.trim(),Mt[ce]("transform",Le),Le};var ot=/\s*sc.*/;d.setPointGroupScale=function(Mt,Ot,Lt){if(Ot=Ot||1,Lt=Lt||1,!!Mt){var ie=Ot===1&&Lt===1?"":"scale("+Ot+","+Lt+")";Mt.each(function(){var be=(this.getAttribute("transform")||"").replace(ot,"");be+=ie,be=be.trim(),this.setAttribute("transform",be)})}};var J=/translate\([^)]*\)\s*$/;d.setTextPointsScale=function(Mt,Ot,Lt){Mt&&Mt.each(function(){var ie,be=f.select(this),ce=be.select("text");if(ce.node()){var Le=parseFloat(ce.attr("x")||0),Ze=parseFloat(ce.attr("y")||0),Qe=(be.attr("transform")||"").match(J);Ot===1&&Lt===1?ie=[]:ie=[o(Le,Ze),"scale("+Ot+","+Lt+")",o(-Le,-Ze)],Qe&&ie.push(Qe),be.attr("transform",ie.join(""))}})};function mt(Mt,Ot){var Lt;return Mt&&(Lt=Mt.mf),Lt===void 0&&(Lt=Ot.marker&&Ot.marker.standoff||0),!Ot._geo&&!Ot._xA?-Lt:Lt}d.getMarkerStandoff=mt;var dt=Math.atan2,Ct=Math.cos,Rt=Math.sin;function Bt(Mt,Ot){var Lt=Ot[0],ie=Ot[1];return[Lt*Ct(Mt)-ie*Rt(Mt),Lt*Rt(Mt)+ie*Ct(Mt)]}var Zt,Gt,ee,xe,ge,ye;function ue(Mt,Ot){var Lt=Mt.ma;Lt===void 0&&(Lt=Ot.marker.angle,(!Lt||y.isArrayOrTypedArray(Lt))&&(Lt=0));var ie,be,ce=Ot.marker.angleref;if(ce==="previous"||ce==="north"){if(Ot._geo){var Le=Ot._geo.project(Mt.lonlat);ie=Le[0],be=Le[1]}else{var Ze=Ot._xA,Qe=Ot._yA;if(Ze&&Qe)ie=Ze.c2p(Mt.x),be=Qe.c2p(Mt.y);else return 90}if(Ot._geo){var mr=Mt.lonlat[0],fr=Mt.lonlat[1],Jr=Ot._geo.project([mr,fr+1e-5]),an=Ot._geo.project([mr+1e-5,fr]),Er=dt(an[1]-be,an[0]-ie),dn=dt(Jr[1]-be,Jr[0]-ie),_n;if(ce==="north")_n=Lt/180*Math.PI;else if(ce==="previous"){var Oe=mr/180*Math.PI,Xt=fr/180*Math.PI,oe=Zt/180*Math.PI,zt=Gt/180*Math.PI,_t=oe-Oe,Pt=Ct(zt)*Rt(_t),Ht=Rt(zt)*Ct(Xt)-Ct(zt)*Rt(Xt)*Ct(_t);_n=-dt(Pt,Ht)-Math.PI,Zt=mr,Gt=fr}var ae=Bt(Er,[Ct(_n),0]),he=Bt(dn,[Rt(_n),0]);Lt=dt(ae[1]+he[1],ae[0]+he[0])/Math.PI*180,ce==="previous"&&!(ye===Ot.uid&&Mt.i===ge+1)&&(Lt=null)}if(ce==="previous"&&!Ot._geo)if(ye===Ot.uid&&Mt.i===ge+1&&P(ie)&&P(be)){var Me=ie-ee,qe=be-xe,Ye=Ot.line&&Ot.line.shape||"",ur=Ye.slice(Ye.length-1);ur==="h"&&(qe=0),ur==="v"&&(Me=0),Lt+=dt(qe,Me)/Math.PI*180+90}else Lt=null}return ee=ie,xe=be,ge=Mt.i,ye=Ot.uid,Lt}d.getMarkerAngle=ue}),jp=It((et,Y)=>{var f=Br(),y=Sr(),z=lh(),P=ls(),n=jn(),i=n.strTranslate,a=Js(),l=Hn(),o=uu(),c=to(),s=Rd().OPPOSITE_SIDE,h=/ [XY][0-9]* /,m=1.6,b=1.6;function x(_,A,d){var k=_._fullLayout,w=d.propContainer,D=d.propName,E=d.placeholder,I=d.traceIndex,M=d.avoid||{},p=d.attributes,g=d.transform,C=d.containerGroup,S=1,N=w.title,B=(N&&N.text?N.text:"").trim(),U=!1,V=N&&N.font?N.font:{},W=V.family,F=V.size,H=V.color,q=V.weight,G=V.style,tt=V.variant,ht=V.textcase,bt=V.lineposition,vt=V.shadow,ut=d.subtitlePropName,rt=!!ut,gt=d.subtitlePlaceholder,it=(w.title||{}).subtitle||{text:"",font:{}},st=(it.text||"").trim(),xt=!1,ot=1,J=it.font,mt=J.family,dt=J.size,Ct=J.color,Rt=J.weight,Bt=J.style,Zt=J.variant,Gt=J.textcase,ee=J.lineposition,xe=J.shadow,ge;D==="title.text"?ge="titleText":D.indexOf("axis")!==-1?ge="axisTitleText":D.indexOf("colorbar")!==-1&&(ge="colorbarTitleText");var ye=_._context.edits[ge];function ue(an,Er){return an===void 0||Er===void 0?!1:an.replace(h," % ")===Er.replace(h," % ")}B===""?S=0:ue(B,E)&&(ye||(B=""),S=.2,U=!0),rt&&(st===""?ot=0:ue(st,gt)&&(ye||(st=""),ot=.2,xt=!0)),d._meta?B=n.templateString(B,d._meta):k._meta&&(B=n.templateString(B,k._meta));var Mt=B||st||ye,Ot;C||(C=n.ensureSingle(k._infolayer,"g","g-"+A),Ot=k._hColorbarMoveTitle);var Lt=C.selectAll("text."+A).data(Mt?[0]:[]);Lt.enter().append("text"),Lt.text(B).attr("class",A),Lt.exit().remove();var ie=null,be=A+"-subtitle",ce=st||ye;if(rt&&(ie=C.selectAll("text."+be).data(ce?[0]:[]),ie.enter().append("text"),ie.text(st).attr("class",be),ie.exit().remove()),!Mt)return C;function Le(an,Er){n.syncOrAsync([Ze,Qe],{title:an,subtitle:Er})}function Ze(an){var Er=an.title,dn=an.subtitle,_n;!g&&Ot&&(g={}),g?(_n="",g.rotate&&(_n+="rotate("+[g.rotate,p.x,p.y]+")"),(g.offset||Ot)&&(_n+=i(0,(g.offset||0)-(Ot||0)))):_n=null,Er.attr("transform",_n);function Oe(Ht){if(Ht){var ae=f.select(Ht.node().parentNode).select("."+be);if(!ae.empty()){var he=Ht.node().getBBox();if(he.height){var Me=he.y+he.height+m*dt;ae.attr("y",Me)}}}}if(Er.style("opacity",S*l.opacity(H)).call(a.font,{color:l.rgb(H),size:f.round(F,2),family:W,weight:q,style:G,variant:tt,textcase:ht,shadow:vt,lineposition:bt}).attr(p).call(o.convertToTspans,_,Oe),dn&&!dn.empty()){var Xt=C.select("."+A+"-math-group"),oe=Er.node().getBBox(),zt=Xt.node()?Xt.node().getBBox():void 0,_t=zt?zt.y+zt.height+m*dt:oe.y+oe.height+b*dt,Pt=n.extendFlat({},p,{y:_t});dn.attr("transform",_n),dn.style("opacity",ot*l.opacity(Ct)).call(a.font,{color:l.rgb(Ct),size:f.round(dt,2),family:mt,weight:Rt,style:Bt,variant:Zt,textcase:Gt,shadow:xe,lineposition:ee}).attr(Pt).call(o.convertToTspans,_)}return z.previousPromises(_)}function Qe(an){var Er=an.title,dn=f.select(Er.node().parentNode);if(M&&M.selection&&M.side&&B){dn.attr("transform",null);var _n=s[M.side],Oe=M.side==="left"||M.side==="top"?-1:1,Xt=y(M.pad)?M.pad:2,oe=a.bBox(dn.node()),zt={t:0,b:0,l:0,r:0},_t=_._fullLayout._reservedMargin;for(var Pt in _t)for(var Ht in _t[Pt]){var ae=_t[Pt][Ht];zt[Ht]=Math.max(zt[Ht],ae)}var he={left:zt.l,top:zt.t,right:k.width-zt.r,bottom:k.height-zt.b},Me=M.maxShift||Oe*(he[M.side]-oe[M.side]),qe=0;if(Me<0)qe=Me;else{var Ye=M.offsetLeft||0,ur=M.offsetTop||0;oe.left-=Ye,oe.right-=Ye,oe.top-=ur,oe.bottom-=ur,M.selection.each(function(){var zr=a.bBox(this);n.bBoxIntersect(oe,zr,Xt)&&(qe=Math.max(qe,Oe*(zr[M.side]-oe[_n])+Xt))}),qe=Math.min(Me,qe),w._titleScoot=Math.abs(qe)}if(qe>0||Me<0){var Rr={left:[-qe,0],right:[qe,0],top:[0,-qe],bottom:[0,qe]}[M.side];dn.attr("transform",i(Rr[0],Rr[1]))}}}Lt.call(Le,ie);function mr(an,Er){an.text(Er).on("mouseover.opacity",function(){f.select(this).transition().duration(c.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){f.select(this).transition().duration(c.HIDE_PLACEHOLDER).style("opacity",0)})}if(ye&&(B?Lt.on(".opacity",null):(mr(Lt,E),U=!0),Lt.call(o.makeEditable,{gd:_}).on("edit",function(an){I!==void 0?P.call("_guiRestyle",_,D,an,I):P.call("_guiRelayout",_,D,an)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Le)}).on("input",function(an){this.text(an||" ").call(o.positionText,p.x,p.y)}),rt)){if(rt&&!B){var fr=Lt.node().getBBox(),Jr=fr.y+fr.height+b*dt;ie.attr("y",Jr)}st?ie.on(".opacity",null):(mr(ie,gt),xt=!0),ie.call(o.makeEditable,{gd:_}).on("edit",function(an){P.call("_guiRelayout",_,"title.subtitle.text",an)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Le)}).on("input",function(an){this.text(an||" ").call(o.positionText,ie.attr("x"),ie.attr("y"))})}return Lt.classed("js-placeholder",U),ie&&!ie.empty()&&ie.classed("js-placeholder",xt),C}Y.exports={draw:x,SUBTITLE_PADDING_EM:b,SUBTITLE_PADDING_MATHJAX_EM:m}}),G0=It((et,Y)=>{var f=Br(),y=on().utcFormat,z=jn(),P=z.numberFormat,n=Sr(),i=z.cleanNumber,a=z.ms2DateTime,l=z.dateTime2ms,o=z.ensureNumber,c=z.isArrayOrTypedArray,s=Dr(),h=s.FP_SAFE,m=s.BADNUM,b=s.LOG_CLIP,x=s.ONEWEEK,_=s.ONEDAY,A=s.ONEHOUR,d=s.ONEMIN,k=s.ONESEC,w=Ku(),D=fu(),E=D.HOUR_PATTERN,I=D.WEEKDAY_PATTERN;function M(g){return Math.pow(10,g)}function p(g){return g!=null}Y.exports=function(g,C){C=C||{};var S=g._id||"x",N=S.charAt(0);function B(it,st){if(it>0)return Math.log(it)/Math.LN10;if(it<=0&&st&&g.range&&g.range.length===2){var xt=g.range[0],ot=g.range[1];return .5*(xt+ot-2*b*Math.abs(xt-ot))}else return m}function U(it,st,xt,ot){if((ot||{}).msUTC&&n(it))return+it;var J=l(it,xt||g.calendar);if(J===m)if(n(it)){it=+it;var mt=Math.floor(z.mod(it+.05,1)*10),dt=Math.round(it-mt/10);J=l(new Date(dt))+mt/10}else return m;return J}function V(it,st,xt){return a(it,st,xt||g.calendar)}function W(it){return g._categories[Math.round(it)]}function F(it){if(p(it)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[it]!==void 0)return g._categoriesMap[it];g._categories.push(typeof it=="number"?String(it):it);var st=g._categories.length-1;return g._categoriesMap[it]=st,st}return m}function H(it,st){for(var xt=new Array(st),ot=0;otg.range[1]&&(xt=!xt);for(var ot=xt?-1:1,J=ot*it,mt=0,dt=0;dtRt)mt=dt+1;else{mt=J<(Ct+Rt)/2?dt:dt+1;break}}var Bt=g._B[mt]||0;return isFinite(Bt)?ht(it,g._m2,Bt):0},ut=function(it){var st=g._rangebreaks.length;if(!st)return bt(it,g._m,g._b);for(var xt=0,ot=0;otg._rangebreaks[ot].pmax&&(xt=ot+1);return bt(it,g._m2,g._B[xt])}}g.c2l=g.type==="log"?B:o,g.l2c=g.type==="log"?M:o,g.l2p=vt,g.p2l=ut,g.c2p=g.type==="log"?function(it,st){return vt(B(it,st))}:vt,g.p2c=g.type==="log"?function(it){return M(ut(it))}:ut,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=i,g.c2d=g.c2r=g.l2d=g.l2r=o,g.d2p=g.r2p=function(it){return g.l2p(i(it))},g.p2d=g.p2r=ut,g.cleanPos=o):g.type==="log"?(g.d2r=g.d2l=function(it,st){return B(i(it),st)},g.r2d=g.r2c=function(it){return M(i(it))},g.d2c=g.r2l=i,g.c2d=g.l2r=o,g.c2r=B,g.l2d=M,g.d2p=function(it,st){return g.l2p(g.d2r(it,st))},g.p2d=function(it){return M(ut(it))},g.r2p=function(it){return g.l2p(i(it))},g.p2r=ut,g.cleanPos=o):g.type==="date"?(g.d2r=g.r2d=z.identity,g.d2c=g.r2c=g.d2l=g.r2l=U,g.c2d=g.c2r=g.l2d=g.l2r=V,g.d2p=g.r2p=function(it,st,xt){return g.l2p(U(it,0,xt))},g.p2d=g.p2r=function(it,st,xt){return V(ut(it),st,xt)},g.cleanPos=function(it){return z.cleanDate(it,m,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=F,g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(it){var st=tt(it);return st!==void 0?st:g.fraction2r(.5)},g.l2r=g.c2r=o,g.r2l=tt,g.d2p=function(it){return g.l2p(g.r2c(it))},g.p2d=function(it){return W(ut(it))},g.r2p=g.d2p,g.p2r=ut,g.cleanPos=function(it){return typeof it=="string"&&it!==""?it:o(it)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(it){var st=G(it);return st!==void 0?st:g.fraction2r(.5)},g.r2c_just_indices=q,g.l2r=g.c2r=o,g.r2l=G,g.d2p=function(it){return g.l2p(g.r2c(it))},g.p2d=function(it){return W(ut(it))},g.r2p=g.d2p,g.p2r=ut,g.cleanPos=function(it){return Array.isArray(it)||typeof it=="string"&&it!==""?it:o(it)},g.setupMultiCategory=function(it){var st=g._traceIndices,xt,ot,J=g._matchGroup;if(J&&g._categories.length===0){for(var mt in J)if(mt!==S){var dt=C[w.id2name(mt)];st=st.concat(dt._traceIndices)}}var Ct=[[0,{}],[0,{}]],Rt=[];for(xt=0;xtdt[1]&&(ot[mt?0:1]=xt),ot[0]===ot[1]){var Ct=g.l2r(st),Rt=g.l2r(xt);if(st!==void 0){var Bt=Ct+1;xt!==void 0&&(Bt=Math.min(Bt,Rt)),ot[mt?1:0]=Bt}if(xt!==void 0){var Zt=Rt+1;st!==void 0&&(Zt=Math.max(Zt,Ct)),ot[mt?0:1]=Zt}}}},g.cleanRange=function(it,st){g._cleanRange(it,st),g.limitRange(it)},g._cleanRange=function(it,st){st||(st={}),it||(it="range");var xt=z.nestedProperty(g,it).get(),ot,J;if(g.type==="date"?J=z.dfltRange(g.calendar):N==="y"?J=D.DFLTRANGEY:g._name==="realaxis"?J=[0,1]:J=st.dfltRange||D.DFLTRANGEX,J=J.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(J[0]=0),!xt||xt.length!==2){z.nestedProperty(g,it).set(J);return}var mt=xt[0]===null,dt=xt[1]===null;for(g.type==="date"&&!g.autorange&&(xt[0]=z.cleanDate(xt[0],m,g.calendar),xt[1]=z.cleanDate(xt[1],m,g.calendar)),ot=0;ot<2;ot++)if(g.type==="date"){if(!z.isDateTime(xt[ot],g.calendar)){g[it]=J;break}if(g.r2l(xt[0])===g.r2l(xt[1])){var Ct=z.constrain(g.r2l(xt[0]),z.MIN_MS+1e3,z.MAX_MS-1e3);xt[0]=g.l2r(Ct-1e3),xt[1]=g.l2r(Ct+1e3);break}}else{if(!n(xt[ot]))if(!(mt||dt)&&n(xt[1-ot]))xt[ot]=xt[1-ot]*(ot?10:.1);else{g[it]=J;break}if(xt[ot]<-h?xt[ot]=-h:xt[ot]>h&&(xt[ot]=h),xt[0]===xt[1]){var Rt=Math.max(1,Math.abs(xt[0]*1e-6));xt[0]-=Rt,xt[1]+=Rt}}},g.setScale=function(it){var st=C._size;if(g.overlaying){var xt=w.getFromId({_fullLayout:C},g.overlaying);g.domain=xt.domain}var ot=it&&g._r?"_r":"range",J=g.calendar;g.cleanRange(ot);var mt=g.r2l(g[ot][0],J),dt=g.r2l(g[ot][1],J),Ct=N==="y";if(Ct?(g._offset=st.t+(1-g.domain[1])*st.h,g._length=st.h*(g.domain[1]-g.domain[0]),g._m=g._length/(mt-dt),g._b=-g._m*dt):(g._offset=st.l+g.domain[0]*st.w,g._length=st.w*(g.domain[1]-g.domain[0]),g._m=g._length/(dt-mt),g._b=-g._m*mt),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Rt,Bt;if(g._rangebreaks=g.locateBreaks(Math.min(mt,dt),Math.max(mt,dt)),g._rangebreaks.length){for(Rt=0;Rtdt&&(Zt=!Zt),Zt&&g._rangebreaks.reverse();var Gt=Zt?-1:1;for(g._m2=Gt*g._length/(Math.abs(dt-mt)-g._lBreaks),g._B.push(-g._m2*(Ct?dt:mt)),Rt=0;RtJ&&(J+=7,mtJ&&(J+=24,mt=ot&&mt=ot&&it=ce.min&&(Otce.max&&(ce.max=Lt),ie=!1)}ie&&dt.push({min:Ot,max:Lt})}};for(xt=0;xt{var f=Sr(),y=jn(),z=Dr().BADNUM,P=y.isArrayOrTypedArray,n=y.isDateTime,i=y.cleanNumber,a=Math.round;Y.exports=function(b,x,_){var A=b,d=_.noMultiCategory;if(P(A)&&!A.length)return"-";if(!d&&m(A))return"multicategory";if(d&&Array.isArray(A[0])){for(var k=[],w=0;wk*2}function s(b){return Math.max(1,(b-1)/1e3)}function h(b,x){for(var _=b.length,A=s(_),d=0,k=0,w={},D=0;D<_;D+=A){var E=a(D),I=b[E],M=String(I);if(!w[M]){w[M]=1;var p=typeof I;p==="boolean"?k++:(x?i(I)!==z:p==="number")?d++:p==="string"&&k++}}return k>d*2}function m(b){return P(b[0])&&P(b[1])}}),Jm=It((et,Y)=>{var f=Br(),y=Sr(),z=jn(),P=Dr().FP_SAFE,n=ls(),i=Js(),a=Ku(),l=a.getFromId,o=a.isLinked;Y.exports={applyAutorangeOptions:C,getAutoRange:c,makePadFn:h,doAutoRange:_,findExtremes:A,concatExtremes:x};function c(S,N){var B,U,V=[],W=S._fullLayout,F=h(W,N,0),H=h(W,N,1),q=x(S,N),G=q.min,tt=q.max;if(G.length===0||tt.length===0)return z.simpleMap(N.range,N.r2l);var ht=G[0].val,bt=tt[0].val;for(B=1;B0&&(Bt=xt-F(mt)-H(dt),Bt>ot?Zt/Bt>J&&(Ct=mt,Rt=dt,J=Zt/Bt):Zt/xt>J&&(Ct={val:mt.val,nopad:1},Rt={val:dt.val,nopad:1},J=Zt/xt));function Gt(ue,Mt){return Math.max(ue,H(Mt))}if(ht===bt){var ee=ht-1,xe=ht+1;if(it)if(ht===0)V=[0,1];else{var ge=(ht>0?tt:G).reduce(Gt,0),ye=ht/(1-Math.min(.5,ge/xt));V=ht>0?[0,ye]:[ye,0]}else st?V=[Math.max(0,ee),Math.max(1,xe)]:V=[ee,xe]}else it?(Ct.val>=0&&(Ct={val:0,nopad:1}),Rt.val<=0&&(Rt={val:0,nopad:1})):st&&(Ct.val-J*F(Ct)<0&&(Ct={val:0,nopad:1}),Rt.val<=0&&(Rt={val:1,nopad:1})),J=(Rt.val-Ct.val-s(N,mt.val,dt.val))/(xt-F(Ct)-H(Rt)),V=[Ct.val-J*F(Ct),Rt.val+J*H(Rt)];return V=C(V,N),N.limitRange&&N.limitRange(),ut&&V.reverse(),z.simpleMap(V,N.l2r||Number)}function s(S,N,B){var U=0;if(S.rangebreaks)for(var V=S.locateBreaks(N,B),W=0;W0?B.ppadplus:B.ppadminus)||B.ppad||0),mt=ot((S._m>0?B.ppadminus:B.ppadplus)||B.ppad||0),dt=ot(B.vpadplus||B.vpad),Ct=ot(B.vpadminus||B.vpad);if(!G){if(st=1/0,xt=-1/0,q)for(ht=0;ht0&&(st=bt),bt>xt&&bt-P&&(st=bt),bt>xt&&bt=Zt;ht--)Bt(ht);return{min:U,max:V,opts:B}}function d(S,N,B,U){w(S,N,B,U,E)}function k(S,N,B,U){w(S,N,B,U,I)}function w(S,N,B,U,V){for(var W=U.tozero,F=U.extrapad,H=!0,q=0;q=B&&(G.extrapad||!F)){H=!1;break}else V(N,G.val)&&G.pad<=B&&(F||!G.extrapad)&&(S.splice(q,1),q--)}if(H){var tt=W&&N===0;S.push({val:N,pad:tt?0:B,extrapad:tt?!1:F})}}function D(S){return y(S)&&Math.abs(S)=N}function M(S,N){var B=N.autorangeoptions;return B&&B.minallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.minallowed:B&&B.clipmin!==void 0&&g(N,B.clipmin,B.clipmax)?Math.max(S,N.d2l(B.clipmin)):S}function p(S,N){var B=N.autorangeoptions;return B&&B.maxallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.maxallowed:B&&B.clipmax!==void 0&&g(N,B.clipmin,B.clipmax)?Math.min(S,N.d2l(B.clipmax)):S}function g(S,N,B){return N!==void 0&&B!==void 0?(N=S.d2l(N),B=S.d2l(B),N=q&&(W=q,B=q),F<=q&&(F=q,U=q)}}return B=M(B,N),U=p(U,N),[B,U]}}),Fs=It((et,Y)=>{var f=Br(),y=Sr(),z=lh(),P=ls(),n=jn(),i=n.strTranslate,a=uu(),l=jp(),o=Hn(),c=Js(),s=Gf(),h=Xh(),m=Dr(),b=m.ONEMAXYEAR,x=m.ONEAVGYEAR,_=m.ONEMINYEAR,A=m.ONEMAXQUARTER,d=m.ONEAVGQUARTER,k=m.ONEMINQUARTER,w=m.ONEMAXMONTH,D=m.ONEAVGMONTH,E=m.ONEMINMONTH,I=m.ONEWEEK,M=m.ONEDAY,p=M/2,g=m.ONEHOUR,C=m.ONEMIN,S=m.ONESEC,N=m.ONEMILLI,B=m.ONEMICROSEC,U=m.MINUS_SIGN,V=m.BADNUM,W={K:"zeroline"},F={K:"gridline",L:"path"},H={K:"minor-gridline",L:"path"},q={K:"tick",L:"path"},G={K:"tick",L:"text"},tt={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},ht=Rd(),bt=ht.MID_SHIFT,vt=ht.CAP_SHIFT,ut=ht.LINE_SPACING,rt=ht.OPPOSITE_SIDE,gt=3,it=Y.exports={};it.setConvert=G0();var st=ty(),xt=Ku(),ot=xt.idSort,J=xt.isLinked;it.id2name=xt.id2name,it.name2id=xt.name2id,it.cleanId=xt.cleanId,it.list=xt.list,it.listIds=xt.listIds,it.getFromId=xt.getFromId,it.getFromTrace=xt.getFromTrace;var mt=Jm();it.getAutoRange=mt.getAutoRange,it.findExtremes=mt.findExtremes;var dt=1e-4;function Ct(Fe){var Re=(Fe[1]-Fe[0])*dt;return[Fe[0]-Re,Fe[1]+Re]}it.coerceRef=function(Fe,Re,Kr,sn,cn,Yr){var un=sn.charAt(sn.length-1),Pn=Kr._fullLayout._subplots[un+"axis"],bn=sn+"ref",ze={};return cn||(cn=Pn[0]||(typeof Yr=="string"?Yr:Yr[0])),Yr||(Yr=cn),Pn=Pn.concat(Pn.map(function(yr){return yr+" domain"})),ze[bn]={valType:"enumerated",values:Pn.concat(Yr?typeof Yr=="string"?[Yr]:Yr:[]),dflt:cn},n.coerce(Fe,Re,ze,bn)},it.getRefType=function(Fe){return Fe===void 0?Fe:Fe==="paper"?"paper":Fe==="pixel"?"pixel":/( domain)$/.test(Fe)?"domain":"range"},it.coercePosition=function(Fe,Re,Kr,sn,cn,Yr){var un,Pn,bn=it.getRefType(sn);if(bn!=="range")un=n.ensureNumber,Pn=Kr(cn,Yr);else{var ze=it.getFromId(Re,sn);Yr=ze.fraction2r(Yr),Pn=Kr(cn,Yr),un=ze.cleanPos}Fe[cn]=un(Pn)},it.cleanPosition=function(Fe,Re,Kr){var sn=Kr==="paper"||Kr==="pixel"?n.ensureNumber:it.getFromId(Re,Kr).cleanPos;return sn(Fe)},it.redrawComponents=function(Fe,Re){Re=Re||it.listIds(Fe);var Kr=Fe._fullLayout;function sn(cn,Yr,un,Pn){for(var bn=P.getComponentMethod(cn,Yr),ze={},yr=0;yr2e-6||((Kr-Fe._forceTick0)/Fe._minDtick%1+1.000001)%1>2e-6)&&(Fe._minDtick=0))},it.saveRangeInitial=function(Fe,Re){for(var Kr=it.list(Fe,"",!0),sn=!1,cn=0;cnen*.3||ze(sn)||ze(cn))){var Rn=Kr.dtick/2;Fe+=Fe+Rnun){var Pn=Number(Kr.substr(1));Yr.exactYears>un&&Pn%12===0?Fe=it.tickIncrement(Fe,"M6","reverse")+M*1.5:Yr.exactMonths>un?Fe=it.tickIncrement(Fe,"M1","reverse")+M*15.5:Fe-=p;var bn=it.tickIncrement(Fe,Kr);if(bn<=sn)return bn}return Fe}it.prepMinorTicks=function(Fe,Re,Kr){if(!Re.minor.dtick){delete Fe.dtick;var sn=Re.dtick&&y(Re._tmin),cn;if(sn){var Yr=it.tickIncrement(Re._tmin,Re.dtick,!0);cn=[Re._tmin,Yr*.99+Re._tmin*.01]}else{var un=n.simpleMap(Re.range,Re.r2l);cn=[un[0],.8*un[0]+.2*un[1]]}if(Fe.range=n.simpleMap(cn,Re.l2r),Fe._isMinor=!0,it.prepTicks(Fe,Kr),sn){var Pn=y(Re.dtick),bn=y(Fe.dtick),ze=Pn?Re.dtick:+Re.dtick.substring(1),yr=bn?Fe.dtick:+Fe.dtick.substring(1);Pn&&bn?xe(ze,yr)?ze===2*I&&yr===2*M&&(Fe.dtick=I):ze===2*I&&yr===3*M?Fe.dtick=I:ze===I&&!(Re._input.minor||{}).nticks?Fe.dtick=M:ge(ze/yr,2.5)?Fe.dtick=ze/2:Fe.dtick=ze:String(Re.dtick).charAt(0)==="M"?bn?Fe.dtick="M1":xe(ze,yr)?ze>=12&&yr===2&&(Fe.dtick="M3"):Fe.dtick=Re.dtick:String(Fe.dtick).charAt(0)==="L"?String(Re.dtick).charAt(0)==="L"?xe(ze,yr)||(Fe.dtick=ge(ze/yr,2.5)?Re.dtick/2:Re.dtick):Fe.dtick="D1":Fe.dtick==="D2"&&+Re.dtick>1&&(Fe.dtick=1)}Fe.range=Re.range}Re.minor._tick0Init===void 0&&(Fe.tick0=Re.tick0)};function xe(Fe,Re){return Math.abs((Fe/Re+.5)%1-.5)<.001}function ge(Fe,Re){return Math.abs(Fe/Re-1)<.001}it.prepTicks=function(Fe,Re){var Kr=n.simpleMap(Fe.range,Fe.r2l,void 0,void 0,Re);if(Fe.tickmode==="auto"||!Fe.dtick){var sn=Fe.nticks,cn;sn||(Fe.type==="category"||Fe.type==="multicategory"?(cn=Fe.tickfont?n.bigFont(Fe.tickfont.size||12):15,sn=Fe._length/cn):(cn=Fe._id.charAt(0)==="y"?40:80,sn=n.constrain(Fe._length/cn,4,9)+1),Fe._name==="radialaxis"&&(sn*=2)),Fe.minor&&Fe.minor.tickmode!=="array"||Fe.tickmode==="array"&&(sn*=100),Fe._roughDTick=Math.abs(Kr[1]-Kr[0])/sn,it.autoTicks(Fe,Fe._roughDTick),Fe._minDtick>0&&Fe.dtick0?(Yr=sn-1,un=sn):(Yr=sn,un=sn);var Pn=Fe[Yr].value,bn=Fe[un].value,ze=Math.abs(bn-Pn),yr=Kr||ze,en=0;yr>=_?ze>=_&&ze<=b?en=ze:en=x:Kr===d&&yr>=k?ze>=k&&ze<=A?en=ze:en=d:yr>=E?ze>=E&&ze<=w?en=ze:en=D:Kr===I&&yr>=I?en=I:yr>=M?en=M:Kr===p&&yr>=p?en=p:Kr===g&&yr>=g&&(en=g);var Rn;en>=ze&&(en=ze,Rn=!0);var ni=cn+en;if(Re.rangebreaks&&en>0){for(var xi=84,Jn=0,Gn=0;GnI&&(en=ze)}(en>0||sn===0)&&(Fe[sn].periodX=cn+en/2)}}it.calcTicks=function(Fe,Re){for(var Kr=Fe.type,sn=Fe.calendar,cn=Fe.ticklabelstep,Yr=Fe.ticklabelmode==="period",un=Fe.range[0]>Fe.range[1],Pn=!Fe.ticklabelindex||n.isArrayOrTypedArray(Fe.ticklabelindex)?Fe.ticklabelindex:[Fe.ticklabelindex],bn=n.simpleMap(Fe.range,Fe.r2l,void 0,void 0,Re),ze=bn[1]=(Va?0:1);ea--){var go=!ea;ea?(Fe._dtickInit=Fe.dtick,Fe._tick0Init=Fe.tick0):(Fe.minor._dtickInit=Fe.minor.dtick,Fe.minor._tick0Init=Fe.minor.tick0);var mo=ea?Fe:n.extendFlat({},Fe,Fe.minor);if(go?it.prepMinorTicks(mo,Fe,Re):it.prepTicks(mo,Re),mo.tickmode==="array"){ea?(Jn=[],ni=ie(Fe,!go)):(Gn=[],xi=ie(Fe,!go));continue}if(mo.tickmode==="sync"){Jn=[],ni=Lt(Fe);continue}var Go=Ct(bn),Po=Go[0],Zo=Go[1],Ka=y(mo.dtick),Cs=Kr==="log"&&!(Ka||mo.dtick.charAt(0)==="L"),ps=it.tickFirst(mo,Re);if(ea){if(Fe._tmin=ps,ps=Zo:is<=Zo;is=it.tickIncrement(is,kl,ze,sn)){if(ea&&ol++,mo.rangebreaks&&!ze){if(is=en)break}if(Jn.length>Rn||is===wl)break;wl=is;var ul={value:is};ea?(Cs&&is!==(is|0)&&(ul.simpleLabel=!0),cn>1&&ol%cn&&(ul.skipLabel=!0),Jn.push(ul)):(ul.minor=!0,Gn.push(ul))}}if(!Gn||Gn.length<2)Pn=!1;else{var Kl=(Gn[1].value-Gn[0].value)*(un?-1:1);so(Kl,Fe.tickformat)||(Pn=!1)}if(!Pn)pi=Jn;else{var vs=Jn.concat(Gn);Yr&&Jn.length&&(vs=vs.slice(1)),vs=vs.sort(function(Tl,us){return Tl.value-us.value}).filter(function(Tl,us,Rc){return us===0||Tl.value!==Rc[us-1].value});var Ns=vs.map(function(Tl,us){return Tl.minor===void 0&&!Tl.skipLabel?us:null}).filter(function(Tl){return Tl!==null});Ns.forEach(function(Tl){Pn.map(function(us){var Rc=Tl+us;Rc>=0&&Rc-1;el--){if(Jn[el].drop){Jn.splice(el,1);continue}Jn[el].value=Zi(Jn[el].value,Fe);var yl=Fe.c2p(Jn[el].value);(lc?nc>yl-ss:ncen||iuen&&(Rc.periodX=en),iucn&&Rnx)Re/=x,sn=cn(10),Fe.dtick="M"+12*Jr(Re,sn,be);else if(Yr>D)Re/=D,Fe.dtick="M"+Jr(Re,1,ce);else if(Yr>M){if(Fe.dtick=Jr(Re,M,Fe._hasDayOfWeekBreaks?[1,2,7,14]:Ze),!Kr){var un=it.getTickFormat(Fe),Pn=Fe.ticklabelmode==="period";Pn&&(Fe._rawTick0=Fe.tick0),/%[uVW]/.test(un)?Fe.tick0=n.dateTick0(Fe.calendar,2):Fe.tick0=n.dateTick0(Fe.calendar,1),Pn&&(Fe._dowTick0=Fe.tick0)}}else Yr>g?Fe.dtick=Jr(Re,g,ce):Yr>C?Fe.dtick=Jr(Re,C,Le):Yr>S?Fe.dtick=Jr(Re,S,Le):(sn=cn(10),Fe.dtick=Jr(Re,sn,be))}else if(Fe.type==="log"){Fe.tick0=0;var bn=n.simpleMap(Fe.range,Fe.r2l);if(Fe._isMinor&&(Re*=1.5),Re>.7)Fe.dtick=Math.ceil(Re);else if(Math.abs(bn[1]-bn[0])<1){var ze=1.5*Math.abs((bn[1]-bn[0])/Re);Re=Math.abs(Math.pow(10,bn[1])-Math.pow(10,bn[0]))/ze,sn=cn(10),Fe.dtick="L"+Jr(Re,sn,be)}else Fe.dtick=Re>.3?"D2":"D1"}else Fe.type==="category"||Fe.type==="multicategory"?(Fe.tick0=0,Fe.dtick=Math.ceil(Math.max(Re,1))):Fi(Fe)?(Fe.tick0=0,sn=1,Fe.dtick=Jr(Re,sn,fr)):(Fe.tick0=0,sn=cn(10),Fe.dtick=Jr(Re,sn,be));if(Fe.dtick===0&&(Fe.dtick=1),!y(Fe.dtick)&&typeof Fe.dtick!="string"){var yr=Fe.dtick;throw Fe.dtick=1,"ax.dtick error: "+String(yr)}};function an(Fe){var Re=Fe.dtick;if(Fe._tickexponent=0,!y(Re)&&typeof Re!="string"&&(Re=1),(Fe.type==="category"||Fe.type==="multicategory")&&(Fe._tickround=null),Fe.type==="date"){var Kr=Fe.r2l(Fe.tick0),sn=Fe.l2r(Kr).replace(/(^-|i)/g,""),cn=sn.length;if(String(Re).charAt(0)==="M")cn>10||sn.substr(5)!=="01-01"?Fe._tickround="d":Fe._tickround=+Re.substr(1)%12===0?"y":"m";else if(Re>=M&&cn<=10||Re>=M*15)Fe._tickround="d";else if(Re>=C&&cn<=16||Re>=g)Fe._tickround="M";else if(Re>=S&&cn<=19||Re>=C)Fe._tickround="S";else{var Yr=Fe.l2r(Kr+Re).replace(/^-/,"").length;Fe._tickround=Math.max(cn,Yr)-20,Fe._tickround<0&&(Fe._tickround=4)}}else if(y(Re)||Re.charAt(0)==="L"){var un=Fe.range.map(Fe.r2d||Number);y(Re)||(Re=Number(Re.substr(1))),Fe._tickround=2-Math.floor(Math.log(Re)/Math.LN10+.01);var Pn=Math.max(Math.abs(un[0]),Math.abs(un[1])),bn=Math.floor(Math.log(Pn)/Math.LN10+.01),ze=Fe.minexponent===void 0?3:Fe.minexponent;Math.abs(bn)>ze&&(ae(Fe.exponentformat)&&Fe.exponentformat!=="SI extended"&&!he(bn)||ae(Fe.exponentformat)&&Fe.exponentformat==="SI extended"&&!Me(bn)?Fe._tickexponent=3*Math.round((bn-1)/3):Fe._tickexponent=bn)}else Fe._tickround=null}it.tickIncrement=function(Fe,Re,Kr,sn){var cn=Kr?-1:1;if(y(Re))return n.increment(Fe,cn*Re);var Yr=Re.charAt(0),un=cn*Number(Re.substr(1));if(Yr==="M")return n.incrementMonth(Fe,un,sn);if(Yr==="L")return Math.log(Math.pow(10,Fe)+un)/Math.LN10;if(Yr==="D"){var Pn=Re==="D2"?mr:Qe,bn=Fe+cn*.01,ze=n.roundUp(n.mod(bn,1),Pn,Kr);return Math.floor(bn)+Math.log(f.round(Math.pow(10,ze),1))/Math.LN10}throw"unrecognized dtick "+String(Re)},it.tickFirst=function(Fe,Re){var Kr=Fe.r2l||Number,sn=n.simpleMap(Fe.range,Kr,void 0,void 0,Re),cn=sn[1]=0&&pi<=Fe._length?Gn:null};if(Yr&&n.isArrayOrTypedArray(Fe.ticktext)){var en=n.simpleMap(Fe.range,Fe.r2l),Rn=(Math.abs(en[1]-en[0])-(Fe._lBreaks||0))/1e4;for(ze=0;ze"+Pn;else{var ze=Ji(Fe),yr=Fe._trueSide||Fe.side;(!ze&&yr==="top"||ze&&yr==="bottom")&&(un+="
")}Re.text=un}function _n(Fe,Re,Kr,sn,cn){var Yr=Fe.dtick,un=Re.x,Pn=Fe.tickformat,bn=typeof Yr=="string"&&Yr.charAt(0);if(cn==="never"&&(cn=""),sn&&bn!=="L"&&(Yr="L3",bn="L"),Pn||bn==="L")Re.text=Ye(Math.pow(10,un),Fe,cn,sn);else if(y(Yr)||bn==="D"&&(Fe.minorloglabels==="complete"||n.mod(un+.01,1)<.1)){Fe.minorloglabels==="complete"&&!(n.mod(un+.01,1)<.1)&&(Re.fontSize*=.75);var ze=Math.pow(10,un).toExponential(0),yr=ze.split("e"),en=+yr[1],Rn=Math.abs(en),ni=Fe.exponentformat;ni==="power"||ae(ni)&&ni!=="SI extended"&&he(en)||ae(ni)&&ni==="SI extended"&&Me(en)?(Re.text=yr[0],Rn>0&&(Re.text+="x10"),Re.text==="1x10"&&(Re.text="10"),en!==0&&en!==1&&(Re.text+=""+(en>0?"":U)+Rn+""),Re.fontSize*=1.25):(ni==="e"||ni==="E")&&Rn>2?Re.text=yr[0]+ni+(en>0?"+":U)+Rn:(Re.text=Ye(Math.pow(10,un),Fe,"","fakehover"),Yr==="D1"&&Fe._id.charAt(0)==="y"&&(Re.dy-=Re.fontSize/6))}else if(bn==="D")Re.text=Fe.minorloglabels==="none"?"":String(Math.round(Math.pow(10,n.mod(un,1)))),Re.fontSize*=.75;else throw"unrecognized dtick "+String(Yr);if(Fe.dtick==="D1"){var xi=String(Re.text).charAt(0);(xi==="0"||xi==="1")&&(Fe._id.charAt(0)==="y"?Re.dx-=Re.fontSize/4:(Re.dy+=Re.fontSize/2,Re.dx+=(Fe.range[1]>Fe.range[0]?1:-1)*Re.fontSize*(un<0?.5:.25)))}}function Oe(Fe,Re){var Kr=Fe._categories[Math.round(Re.x)];Kr===void 0&&(Kr=""),Re.text=String(Kr)}function Xt(Fe,Re,Kr){var sn=Math.round(Re.x),cn=Fe._categories[sn]||[],Yr=cn[1]===void 0?"":String(cn[1]),un=cn[0]===void 0?"":String(cn[0]);Kr?Re.text=un+" - "+Yr:(Re.text=Yr,Re.text2=un)}function oe(Fe,Re,Kr,sn,cn){cn==="never"?cn="":Fe.showexponent==="all"&&Math.abs(Re.x/Fe.dtick)<1e-6&&(cn="hide"),Re.text=Ye(Re.x,Fe,cn,sn)}function zt(Fe,Re,Kr,sn,cn){if(Fe.thetaunit==="radians"&&!Kr){var Yr=Re.x/180;if(Yr===0)Re.text="0";else{var un=_t(Yr);if(un[1]>=100)Re.text=Ye(n.deg2rad(Re.x),Fe,cn,sn);else{var Pn=Re.x<0;un[1]===1?un[0]===1?Re.text="π":Re.text=un[0]+"π":Re.text=["",un[0],"","⁄","",un[1],"","π"].join(""),Pn&&(Re.text=U+Re.text)}}}else Re.text=Ye(Re.x,Fe,cn,sn)}function _t(Fe){function Re(Pn,bn){return Math.abs(Pn-bn)<=1e-6}function Kr(Pn,bn){return Re(bn,0)?Pn:Kr(bn,Pn%bn)}function sn(Pn){for(var bn=1;!Re(Math.round(Pn*bn)/bn,Pn);)bn*=10;return bn}var cn=sn(Fe),Yr=Fe*cn,un=Math.abs(Kr(Yr,cn));return[Math.round(Yr/un),Math.round(cn/un)]}var Pt=["f","p","n","μ","m","","k","M","G","T"],Ht=["q","r","y","z","a",...Pt,"P","E","Z","Y","R","Q"],ae=Fe=>["SI","SI extended","B"].includes(Fe);function he(Fe){return Fe>14||Fe<-15}function Me(Fe){return Fe>32||Fe<-30}function qe(Fe,Re){return ae(Re)?!!(Re==="SI extended"&&Me(Fe)||Re!=="SI extended"&&he(Fe)):!1}function Ye(Fe,Re,Kr,sn){var cn=Fe<0,Yr=Re._tickround,un=Kr||Re.exponentformat||"B",Pn=Re._tickexponent,bn=it.getTickFormat(Re),ze=Re.separatethousands;if(sn){var yr={exponentformat:un,minexponent:Re.minexponent,dtick:Re.showexponent==="none"?Re.dtick:y(Fe)&&Math.abs(Fe)||1,range:Re.showexponent==="none"?Re.range.map(Re.r2d):[0,Fe||1]};an(yr),Yr=(Number(yr._tickround)||0)+4,Pn=yr._tickexponent,Re.hoverformat&&(bn=Re.hoverformat)}if(bn)return Re._numFormat(bn)(Fe).replace(/-/g,U);var en=Math.pow(10,-Yr)/2;if(un==="none"&&(Pn=0),Fe=Math.abs(Fe),Fe"+xi+"":un==="B"&&Pn===9?Fe+="B":ae(un)&&(Fe+=un==="SI extended"?Ht[Pn/3+10]:Pt[Pn/3+5])}return cn?U+Fe:Fe}it.getTickFormat=function(Fe){var Re;function Kr(bn){return typeof bn!="string"?bn:Number(bn.replace("M",""))*D}function sn(bn,ze){var yr=["L","D"];if(typeof bn==typeof ze){if(typeof bn=="number")return bn-ze;var en=yr.indexOf(bn.charAt(0)),Rn=yr.indexOf(ze.charAt(0));return en===Rn?Number(bn.replace(/(L|D)/g,""))-Number(ze.replace(/(L|D)/g,"")):en-Rn}else return typeof bn=="number"?1:-1}function cn(bn,ze,yr){var en=yr||function(xi){return xi},Rn=ze[0],ni=ze[1];return(!Rn&&typeof Rn!="number"||en(Rn)<=en(bn))&&(!ni&&typeof ni!="number"||en(ni)>=en(bn))}function Yr(bn,ze){var yr=ze[0]===null,en=ze[1]===null,Rn=sn(bn,ze[0])>=0,ni=sn(bn,ze[1])<=0;return(yr||Rn)&&(en||ni)}var un,Pn;if(Fe.tickformatstops&&Fe.tickformatstops.length>0)switch(Fe.type){case"date":case"linear":{for(Re=0;Re=0&&cn.unshift(cn.splice(yr,1).shift())}});var Pn={false:{left:0,right:0}};return n.syncOrAsync(cn.map(function(bn){return function(){if(bn){var ze=it.getFromId(Fe,bn);Kr||(Kr={}),Kr.axShifts=Pn,Kr.overlayingShiftedAx=un;var yr=it.drawOne(Fe,ze,Kr);return ze._shiftPusher&&Ei(ze,ze._fullDepth||0,Pn,!0),ze._r=ze.range.slice(),ze._rl=n.simpleMap(ze._r,ze.r2l),yr}}}))},it.drawOne=function(Fe,Re,Kr){Kr=Kr||{};var sn=Kr.axShifts||{},cn=Kr.overlayingShiftedAx||[],Yr,un,Pn;Re.setScale();var bn=Fe._fullLayout,ze=Re._id,yr=ze.charAt(0),en=it.counterLetter(ze),Rn=bn._plots[Re._mainSubplot],ni=Re.zerolinelayer==="above traces";if(!Rn)return;if(Re._shiftPusher=Re.autoshift||cn.indexOf(Re._id)!==-1||cn.indexOf(Re.overlaying)!==-1,Re._shiftPusher&Re.anchor==="free"){var xi=Re.linewidth/2||0;Re.ticks==="inside"&&(xi+=Re.ticklen),Ei(Re,xi,sn,!0),Ei(Re,Re.shift||0,sn,!1)}(Kr.skipTitle!==!0||Re._shift===void 0)&&(Re._shift=Ga(Re,sn));var Jn=Rn[yr+"axislayer"],Gn=Re._mainLinePosition,pi=Gn+=Re._shift,Va=Re._mainMirrorPosition,ea=Re._vals=it.calcTicks(Re),go=[Re.mirror,pi,Va].join("_");for(Yr=0;Yr0?Dl.bottom-Rc:0,iu))));var pu=0,Ah=0;if(Re._shiftPusher&&(pu=Math.max(iu,Dl.height>0?Tl==="l"?Rc-Dl.left:Dl.right-Rc:0),Re.title.text!==bn._dfltTitle[yr]&&(Ah=(Re._titleStandoff||0)+(Re._titleScoot||0),Tl==="l"&&(Ah+=Ci(Re))),Re._fullDepth=Math.max(pu,Ah)),Re.automargin){ql={x:0,y:0,r:0,l:0,t:0,b:0};var uh=[0,1],yh=typeof Re._shift=="number"?Re._shift:0;if(yr==="x"){if(Tl==="b"?ql[Tl]=Re._depth:(ql[Tl]=Re._depth=Math.max(Dl.width>0?Rc-Dl.top:0,iu),uh.reverse()),Dl.width>0){var tf=Dl.right-(Re._offset+Re._length);tf>0&&(ql.xr=1,ql.r=tf);var Nd=Re._offset-Dl.left;Nd>0&&(ql.xl=0,ql.l=Nd)}}else if(Tl==="l"?(Re._depth=Math.max(Dl.height>0?Rc-Dl.left:0,iu),ql[Tl]=Re._depth-yh):(Re._depth=Math.max(Dl.height>0?Dl.right-Rc:0,iu),ql[Tl]=Re._depth+yh,uh.reverse()),Dl.height>0){var Gl=Dl.bottom-(Re._offset+Re._length);Gl>0&&(ql.yb=0,ql.b=Gl);var Yu=Re._offset-Dl.top;Yu>0&&(ql.yt=1,ql.t=Yu)}ql[en]=Re.anchor==="free"?Re.position:Re._anchorAxis.domain[uh[0]],Re.title.text!==bn._dfltTitle[yr]&&(ql[Tl]+=Ci(Re)+(Re.title.standoff||0)),Re.mirror&&Re.anchor!=="free"&&(cc={x:0,y:0,r:0,l:0,t:0,b:0},cc[us]=Re.linewidth,Re.mirror&&Re.mirror!==!0&&(cc[us]+=iu),Re.mirror===!0||Re.mirror==="ticks"?cc[en]=Re._anchorAxis.domain[uh[1]]:(Re.mirror==="all"||Re.mirror==="allticks")&&(cc[en]=[Re._counterDomainMin,Re._counterDomainMax][uh[1]]))}mc&&(dc=P.getComponentMethod("rangeslider","autoMarginOpts")(Fe,Re)),typeof Re.automargin=="string"&&(ur(ql,Re.automargin),ur(cc,Re.automargin)),z.autoMargin(Fe,vr(Re),ql),z.autoMargin(Fe,Ar(Re),cc),z.autoMargin(Fe,mn(Re),dc)}),n.syncOrAsync(zs)}};function ur(Fe,Re){if(Fe){var Kr=Object.keys(tt).reduce(function(sn,cn){return Re.indexOf(cn)!==-1&&tt[cn].forEach(function(Yr){sn[Yr]=1}),sn},{});Object.keys(Fe).forEach(function(sn){Kr[sn]||(sn.length===1?Fe[sn]=0:delete Fe[sn])})}}function Rr(Fe,Re){var Kr=[],sn,cn=function(Yr,un){var Pn=Yr.xbnd[un];Pn!==null&&Kr.push(n.extendFlat({},Yr,{x:Pn}))};if(Re.length){for(sn=0;snFe.range[1],Pn=Fe.ticklabelposition&&Fe.ticklabelposition.indexOf("inside")!==-1,bn=!Pn;if(Kr){var ze=un?-1:1;Kr=Kr*ze}if(sn){var yr=Fe.side,en=Pn&&(yr==="top"||yr==="left")||bn&&(yr==="bottom"||yr==="right")?1:-1;sn=sn*en}return Fe._id.charAt(0)==="x"?function(Rn){return i(cn+Fe._offset+Fe.l2p(ci(Rn))+Kr,Yr+sn)}:function(Rn){return i(Yr+sn,cn+Fe._offset+Fe.l2p(ci(Rn))+Kr)}};function ci(Fe){return Fe.periodX!==void 0?Fe.periodX:Fe.x}function ui(Fe){var Re=Fe.ticklabelposition||"",Kr=Fe.tickson||"",sn=function(xi){return Re.indexOf(xi)!==-1},cn=sn("top"),Yr=sn("left"),un=sn("right"),Pn=sn("bottom"),bn=sn("inside"),ze=Kr!=="boundaries"&&(Pn||Yr||cn||un);if(!ze&&!bn)return[0,0];var yr=Fe.side,en=ze?(Fe.tickwidth||0)/2:0,Rn=gt,ni=Fe.tickfont?Fe.tickfont.size:12;return(Pn||cn)&&(en+=ni*vt,Rn+=(Fe.linewidth||0)/2),(Yr||un)&&(en+=(Fe.linewidth||0)/2,Rn+=gt),bn&&yr==="top"&&(Rn-=ni*(1-vt)),(Yr||cn)&&(en=-en),(yr==="bottom"||yr==="right")&&(Rn=-Rn),[ze?en:0,bn?Rn:0]}it.makeTickPath=function(Fe,Re,Kr,sn){sn||(sn={});var cn=sn.minor;if(cn&&!Fe.minor)return"";var Yr=sn.len!==void 0?sn.len:cn?Fe.minor.ticklen:Fe.ticklen,un=Fe._id.charAt(0),Pn=(Fe.linewidth||1)/2;return un==="x"?"M0,"+(Re+Pn*Kr)+"v"+Yr*Kr:"M"+(Re+Pn*Kr)+",0h"+Yr*Kr},it.makeLabelFns=function(Fe,Re,Kr){var sn=Fe.ticklabelposition||"",cn=Fe.tickson||"",Yr=function(is){return sn.indexOf(is)!==-1},un=Yr("top"),Pn=Yr("left"),bn=Yr("right"),ze=Yr("bottom"),yr=cn!=="boundaries"&&(ze||Pn||un||bn),en=Yr("inside"),Rn=sn==="inside"&&Fe.ticks==="inside"||!en&&Fe.ticks==="outside"&&cn!=="boundaries",ni=0,xi=0,Jn=Rn?Fe.ticklen:0;if(en?Jn*=-1:yr&&(Jn=0),Rn&&(ni+=Jn,Kr)){var Gn=n.deg2rad(Kr);ni=Jn*Math.cos(Gn)+1,xi=Jn*Math.sin(Gn)}Fe.showticklabels&&(Rn||Fe.showline)&&(ni+=.2*Fe.tickfont.size),ni+=(Fe.linewidth||1)/2*(en?-1:1);var pi={labelStandoff:ni,labelShift:xi},Va,ea,go,mo,Go=0,Po=Fe.side,Zo=Fe._id.charAt(0),Ka=Fe.tickangle,Cs;if(Zo==="x")Cs=!en&&Po==="bottom"||en&&Po==="top",mo=Cs?1:-1,en&&(mo*=-1),Va=xi*mo,ea=Re+ni*mo,go=Cs?1:-.2,Math.abs(Ka)===90&&(en?go+=bt:Ka===-90&&Po==="bottom"?go=vt:Ka===90&&Po==="top"?go=bt:go=.5,Go=bt/2*(Ka/90)),pi.xFn=function(is){return is.dx+Va+Go*is.fontSize},pi.yFn=function(is){return is.dy+ea+is.fontSize*go},pi.anchorFn=function(is,ol){if(yr){if(Pn)return"end";if(bn)return"start"}return!y(ol)||ol===0||ol===180?"middle":ol*mo<0!==en?"end":"start"},pi.heightFn=function(is,ol,ms){return ol<-60||ol>60?-.5*ms:Fe.side==="top"!==en?-ms:0};else if(Zo==="y"){if(Cs=!en&&Po==="left"||en&&Po==="right",mo=Cs?1:-1,en&&(mo*=-1),Va=ni,ea=xi*mo,go=0,!en&&Math.abs(Ka)===90&&(Ka===-90&&Po==="left"||Ka===90&&Po==="right"?go=vt:go=.5),en){var ps=y(Ka)?+Ka:0;if(ps!==0){var wl=n.deg2rad(ps);Go=Math.abs(Math.sin(wl))*vt*mo,go=0}}pi.xFn=function(is){return is.dx+Re-(Va+is.fontSize*go)*mo+Go*is.fontSize},pi.yFn=function(is){return is.dy+ea+is.fontSize*bt},pi.anchorFn=function(is,ol){return y(ol)&&Math.abs(ol)===90?"middle":Cs?"end":"start"},pi.heightFn=function(is,ol,ms){return Fe.side==="right"&&(ol*=-1),ol<-30?-ms:ol<30?-.5*ms:0}}return pi};function yi(Fe){return[Fe.text,Fe.x,Fe.axInfo,Fe.font,Fe.fontSize,Fe.fontColor].join("_")}it.drawTicks=function(Fe,Re,Kr){Kr=Kr||{};var sn=Re._id+"tick",cn=[].concat(Re.minor&&Re.minor.ticks?Kr.vals.filter(function(un){return un.minor&&!un.noTick}):[]).concat(Re.ticks?Kr.vals.filter(function(un){return!un.minor&&!un.noTick}):[]),Yr=Kr.layer.selectAll("path."+sn).data(cn,yi);Yr.exit().remove(),Yr.enter().append("path").classed(sn,1).classed("ticks",1).classed("crisp",Kr.crisp!==!1).each(function(un){return o.stroke(f.select(this),un.minor?Re.minor.tickcolor:Re.tickcolor)}).style("stroke-width",function(un){return c.crispRound(Fe,un.minor?Re.minor.tickwidth:Re.tickwidth,1)+"px"}).attr("d",Kr.path).style("display",null),ca(Re,[q]),Yr.attr("transform",Kr.transFn)},it.drawGrid=function(Fe,Re,Kr){if(Kr=Kr||{},Re.tickmode!=="sync"){var sn=Re._id+"grid",cn=Re.minor&&Re.minor.showgrid,Yr=cn?Kr.vals.filter(function(pi){return pi.minor}):[],un=Re.showgrid?Kr.vals.filter(function(pi){return!pi.minor}):[],Pn=Kr.counterAxis;if(Pn&&it.shouldShowZeroLine(Fe,Re,Pn))for(var bn=Re.tickmode==="array",ze=0;ze=0;xi--){var Jn=xi?Rn:ni;if(Jn){var Gn=Jn.selectAll("path."+sn).data(xi?un:Yr,yi);Gn.exit().remove(),Gn.enter().append("path").classed(sn,1).classed("crisp",Kr.crisp!==!1),Gn.attr("transform",Kr.transFn).attr("d",Kr.path).each(function(pi){return o.stroke(f.select(this),pi.minor?Re.minor.gridcolor:Re.gridcolor||"#ddd")}).style("stroke-dasharray",function(pi){return c.dashStyle(pi.minor?Re.minor.griddash:Re.griddash,pi.minor?Re.minor.gridwidth:Re.gridwidth)}).style("stroke-width",function(pi){return(pi.minor?en:Re._gw)+"px"}).style("display",null),typeof Kr.path=="function"&&Gn.attr("d",Kr.path)}}ca(Re,[F,H])}},it.drawZeroLine=function(Fe,Re,Kr){Kr=Kr||Kr;var sn=Re._id+"zl",cn=it.shouldShowZeroLine(Fe,Re,Kr.counterAxis),Yr=Kr.layer.selectAll("path."+sn).data(cn?[{x:0,id:Re._id}]:[]);Yr.exit().remove(),Yr.enter().append("path").classed(sn,1).classed("zl",1).classed("crisp",Kr.crisp!==!1).each(function(){Kr.layer.selectAll("path").sort(function(un,Pn){return ot(un.id,Pn.id)})}),Yr.attr("transform",Kr.transFn).attr("d",Kr.path).call(o.stroke,Re.zerolinecolor||o.defaultLine).style("stroke-width",c.crispRound(Fe,Re.zerolinewidth,Re._gw||1)+"px").style("display",null),ca(Re,[W])},it.drawLabels=function(Fe,Re,Kr){Kr=Kr||{};var sn=Fe._fullLayout,cn=Re._id,Yr=Re.zerolinelayer==="above traces",un=Kr.cls||cn+"tick",Pn=Kr.vals.filter(function(vs){return vs.text}),bn=Kr.labelFns,ze=Kr.secondary?0:Re.tickangle,yr=(Re._prevTickAngles||{})[un],en=Kr.layer.selectAll("g."+un).data(Re.showticklabels?Pn:[],yi),Rn=[];en.enter().append("g").classed(un,1).append("text").attr("text-anchor","middle").each(function(vs){var Ns=f.select(this),Uo=Fe._promises.length;Ns.call(a.positionText,bn.xFn(vs),bn.yFn(vs)).call(c.font,{family:vs.font,size:vs.fontSize,color:vs.fontColor,weight:vs.fontWeight,style:vs.fontStyle,variant:vs.fontVariant,textcase:vs.fontTextcase,lineposition:vs.fontLineposition,shadow:vs.fontShadow}).text(vs.text).call(a.convertToTspans,Fe),Fe._promises[Uo]?Rn.push(Fe._promises.pop().then(function(){ni(Ns,ze)})):ni(Ns,ze)}),ca(Re,[G]),en.exit().remove(),Kr.repositionOnUpdate&&en.each(function(vs){f.select(this).select("text").call(a.positionText,bn.xFn(vs),bn.yFn(vs))});function ni(vs,Ns){vs.each(function(Uo){var Ds=f.select(this),Ol=Ds.select(".text-math-group"),tc=bn.anchorFn(Uo,Ns),sc=Kr.transFn.call(Ds.node(),Uo)+(y(Ns)&&+Ns!=0?" rotate("+Ns+","+bn.xFn(Uo)+","+(bn.yFn(Uo)-Uo.fontSize/2)+")":""),Xs=a.lineCount(Ds),Wa=ut*Uo.fontSize,Co=bn.heightFn(Uo,y(Ns)?+Ns:0,(Xs-1)*Wa);if(Co&&(sc+=i(0,Co)),Ol.empty()){var el=Ds.select("text");el.attr({transform:sc,"text-anchor":tc}),el.style("display",null),Re._adjustTickLabelsOverflow&&Re._adjustTickLabelsOverflow()}else{var lc=c.bBox(Ol.node()).width,ss=lc*{end:-.5,start:.5}[tc];Ol.attr("transform",sc+i(ss,0))}})}Re._adjustTickLabelsOverflow=function(){var vs=Re.ticklabeloverflow;if(!(!vs||vs==="allow")){var Ns=vs.indexOf("hide")!==-1,Uo=Re._id.charAt(0)==="x",Ds=0,Ol=Uo?Fe._fullLayout.width:Fe._fullLayout.height;if(vs.indexOf("domain")!==-1){var tc=n.simpleMap(Re.range,Re.r2l);Ds=Re.l2p(tc[0])+Re._offset,Ol=Re.l2p(tc[1])+Re._offset}var sc=Math.min(Ds,Ol),Xs=Math.max(Ds,Ol),Wa=Re.side,Co=1/0,el=-1/0;en.each(function(yl){var $l=f.select(this),Gc=$l.select(".text-math-group");if(Gc.empty()){var ko=c.bBox($l.node()),zs=0;Uo?(ko.right>Xs||ko.leftXs||ko.top+(Re.tickangle?0:yl.fontSize/4)Re["_visibleLabelMin_"+tc._id]?$l.style("display","none"):Xs.K==="tick"&&!sc&&$l.node().style.display!=="none"&&$l.style("display",null)})})})})},ni(en,yr+1?yr:ze);function xi(){return Rn.length&&Promise.all(Rn)}var Jn=null;function Gn(){if(ni(en,ze),Pn.length&&Re.autotickangles&&(Re.type!=="log"||String(Re.dtick).charAt(0)!=="D")){Jn=Re.autotickangles[0];var vs=0,Ns=[],Uo,Ds=1;en.each(function(ql){vs=Math.max(vs,ql.fontSize);var cc=Re.l2p(ql.x),dc=sr(this),pu=c.bBox(dc.node());Ds=Math.max(Ds,a.lineCount(dc)),Ns.push({top:0,bottom:10,height:10,left:cc-pu.width/2,right:cc+pu.width/2+2,width:pu.width+2})});var Ol=(Re.tickson==="boundaries"||Re.showdividers)&&!Kr.secondary,tc=Pn.length,sc=Math.abs((Pn[tc-1].x-Pn[0].x)*Re._m)/(tc-1),Xs=Ol?sc/2:sc,Wa=Ol?Re.ticklen:vs*1.25*Ds,Co=Math.sqrt(Math.pow(Xs,2)+Math.pow(Wa,2)),el=Xs/Co,lc=Re.autotickangles.map(function(ql){return ql*Math.PI/180}),ss=lc.find(function(ql){return Math.abs(Math.cos(ql))<=el});ss===void 0&&(ss=lc.reduce(function(ql,cc){return Math.abs(Math.cos(ql))kl*ms&&(wl=ms,Ka[Zo]=Cs[Zo]=is[Zo])}var ul=Math.abs(wl-ps);ul-mo>0?(ul-=mo,mo*=1+mo/ul):mo=0,Re._id.charAt(0)!=="y"&&(mo=-mo),Ka[Po]=ea.p2r(ea.r2p(Cs[Po])+Go*mo),ea.autorange==="min"||ea.autorange==="max reversed"?(Ka[0]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0):(ea.autorange==="max"||ea.autorange==="min reversed")&&(Ka[1]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0),sn._insideTickLabelsUpdaterange[ea._name+".range"]=Ka}var Kl=n.syncOrAsync(pi);return Kl&&Kl.then&&Fe._promises.push(Kl),Kl};function Gi(Fe,Re,Kr){var sn=Re._id+"divider",cn=Kr.vals,Yr=Kr.layer.selectAll("path."+sn).data(cn,yi);Yr.exit().remove(),Yr.enter().insert("path",":first-child").classed(sn,1).classed("crisp",1).call(o.stroke,Re.dividercolor).style("stroke-width",c.crispRound(Fe,Re.dividerwidth,1)+"px"),Yr.attr("transform",Kr.transFn).attr("d",Kr.path)}it.getPxPosition=function(Fe,Re){var Kr=Fe._fullLayout._size,sn=Re._id.charAt(0),cn=Re.side,Yr;if(Re.anchor!=="free"?Yr=Re._anchorAxis:sn==="x"?Yr={_offset:Kr.t+(1-(Re.position||0))*Kr.h,_length:0}:sn==="y"&&(Yr={_offset:Kr.l+(Re.position||0)*Kr.w+Re._shift,_length:0}),cn==="top"||cn==="left")return Yr._offset;if(cn==="bottom"||cn==="right")return Yr._offset+Yr._length};function Ci(Fe){var Re=Fe.title.font.size,Kr=(Fe.title.text.match(a.BR_TAG_ALL)||[]).length;return Fe.title.hasOwnProperty("standoff")?Re*(vt+Kr*ut):Kr?Re*(Kr+1)*ut:Re}function fi(Fe,Re){var Kr=Fe._fullLayout,sn=Re._id,cn=sn.charAt(0),Yr=Re.title.font.size,un,Pn=(Re.title.text.match(a.BR_TAG_ALL)||[]).length;if(Re.title.hasOwnProperty("standoff"))Re.side==="bottom"||Re.side==="right"?un=Re._depth+Re.title.standoff+Yr*vt:(Re.side==="top"||Re.side==="left")&&(un=Re._depth+Re.title.standoff+Yr*(bt+Pn*ut));else{var bn=Ji(Re);if(Re.type==="multicategory")un=Re._depth;else{var ze=1.5*Yr;bn&&(ze=.5*Yr,Re.ticks==="outside"&&(ze+=Re.ticklen)),un=10+ze+(Re.linewidth?Re.linewidth-1:0)}bn||(cn==="x"?un+=Re.side==="top"?Yr*(Re.showticklabels?1:0):Yr*(Re.showticklabels?1.5:.5):un+=Re.side==="right"?Yr*(Re.showticklabels?1:.5):Yr*(Re.showticklabels?.5:0))}var yr=it.getPxPosition(Fe,Re),en,Rn,ni;cn==="x"?(Rn=Re._offset+Re._length/2,ni=Re.side==="top"?yr-un:yr+un):(ni=Re._offset+Re._length/2,Rn=Re.side==="right"?yr+un:yr-un,en={rotate:"-90",offset:0});var xi;if(Re.type!=="multicategory"){var Jn=Re._selections[Re._id+"tick"];if(xi={selection:Jn,side:Re.side},Jn&&Jn.node()&&Jn.node().parentNode){var Gn=c.getTranslate(Jn.node().parentNode);xi.offsetLeft=Gn.x,xi.offsetTop=Gn.y}Re.title.hasOwnProperty("standoff")&&(xi.pad=0)}return Re._titleStandoff=un,l.draw(Fe,sn+"title",{propContainer:Re,propName:Re._name+".title.text",placeholder:Kr._dfltTitle[cn],avoid:xi,transform:en,attributes:{x:Rn,y:ni,"text-anchor":"middle"}})}it.shouldShowZeroLine=function(Fe,Re,Kr){var sn=n.simpleMap(Re.range,Re.r2l);return sn[0]*sn[1]<=0&&Re.zeroline&&(Re.type==="linear"||Re.type==="-")&&!(Re.rangebreaks&&Re.maskBreaks(0)===V)&&(ba(Re,0)||!oa(Fe,Re,Kr,sn)||Ke(Fe,Re))},it.clipEnds=function(Fe,Re){return Re.filter(function(Kr){return ba(Fe,Kr.x)})};function ba(Fe,Re){var Kr=Fe.l2p(Re);return Kr>1&&Kr1)for(cn=1;cn=cn.min&&Fe=B:/%L/.test(Re)?Fe>=N:/%[SX]/.test(Re)?Fe>=S:/%M/.test(Re)?Fe>=C:/%[HI]/.test(Re)?Fe>=g:/%p/.test(Re)?Fe>=p:/%[Aadejuwx]/.test(Re)?Fe>=M:/%[UVW]/.test(Re)?Fe>=I:/%[Bbm]/.test(Re)?Fe>=E:/%[q]/.test(Re)?Fe>=k:/%[Yy]/.test(Re)?Fe>=_:!0}}),A4=It((et,Y)=>{Y.exports=function(f,y,z){var P,n;if(z){var i=y==="reversed"||y==="min reversed"||y==="max reversed";P=z[i?1:0],n=z[i?0:1]}var a=f("autorangeoptions.minallowed",n===null?P:void 0),l=f("autorangeoptions.maxallowed",P===null?n:void 0);a===void 0&&f("autorangeoptions.clipmin"),l===void 0&&f("autorangeoptions.clipmax"),f("autorangeoptions.include")}}),hw=It((et,Y)=>{var f=A4();Y.exports=function(y,z,P,n){var i=z._template||{},a=z.type||i.type||"-";P("minallowed"),P("maxallowed");var l=P("range");if(!l){var o;!n.noInsiderange&&a!=="log"&&(o=P("insiderange"),o&&(o[0]===null||o[1]===null)&&(z.insiderange=!1,o=void 0),o&&(l=P("range",o)))}var c=z.getAutorangeDflt(l,n),s=P("autorange",c),h;l&&(l[0]===null&&l[1]===null||(l[0]===null||l[1]===null)&&(s==="reversed"||s===!0)||l[0]!==null&&(s==="min"||s==="max reversed")||l[1]!==null&&(s==="max"||s==="min reversed"))&&(l=void 0,delete z.range,z.autorange=!0,h=!0),h||(c=z.getAutorangeDflt(l,n),s=P("autorange",c)),s&&(f(P,s,l),(a==="linear"||a==="-")&&P("rangemode")),z.cleanRange()}}),g8=It((et,Y)=>{var f={left:0,top:0};Y.exports=y;function y(P,n,i){n=n||P.currentTarget||P.srcElement,Array.isArray(i)||(i=[0,0]);var a=P.clientX||0,l=P.clientY||0,o=z(n);return i[0]=a-o.left,i[1]=l-o.top,i}function z(P){return P===window||P===document||P===document.body?f:P.getBoundingClientRect()}}),dw=It((et,Y)=>{var f=Qc();function y(){var z=!1;try{var P=Object.defineProperty({},"passive",{get:function(){z=!0}});window.addEventListener("test",null,P),window.removeEventListener("test",null,P)}catch{z=!1}return z}Y.exports=f&&y()}),fw=It((et,Y)=>{Y.exports=function(f,y,z,P,n){var i=(f-z)/(P-z),a=i+y/(P-z),l=(i+a)/2;return n==="left"||n==="bottom"?i:n==="center"||n==="middle"?l:n==="right"||n==="top"?a:i<2/3-l?i:a>4/3-l?a:l}}),v8=It((et,Y)=>{var f=jn(),y=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];Y.exports=function(z,P,n,i){return n==="left"?z=0:n==="center"?z=1:n==="right"?z=2:z=f.constrain(Math.floor(z*3),0,2),i==="bottom"?P=0:i==="middle"?P=1:i==="top"?P=2:P=f.constrain(Math.floor(P*3),0,2),y[P][z]}}),Qm=It((et,Y)=>{var f=qg(),y=lw(),z=W0().getGraphDiv,P=na(),n=Y.exports={};n.wrapped=function(i,a,l){i=z(i),i._fullLayout&&y.clear(i._fullLayout._uid+P.HOVERID),n.raw(i,a,l)},n.raw=function(i,a){var l=i._fullLayout,o=i._hoverdata;a||(a={}),!(a.target&&!i._dragged&&f.triggerHandler(i,"plotly_beforehover",a)===!1)&&(l._hoverlayer.selectAll("g").remove(),l._hoverlayer.selectAll("line").remove(),l._hoverlayer.selectAll("circle").remove(),i._hoverdata=void 0,a.target&&o&&i.emit("plotly_unhover",{event:a,points:o}))}}),Up=It((et,Y)=>{var f=g8(),y=Jd(),z=dw(),P=jn().removeElement,n=fu(),i=Y.exports={};i.align=fw(),i.getCursor=v8();var a=Qm();i.unhover=a.wrapped,i.unhoverRaw=a.raw,i.init=function(c){var s=c.gd,h=1,m=s._context.doubleClickDelay,b=c.element,x,_,A,d,k,w,D,E;s._mouseDownTime||(s._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=p,z?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=p,b.addEventListener("touchstart",p,{passive:!1})):b.ontouchstart=p;function I(S,N,B){return Math.abs(S)"u"&&typeof S.clientY>"u"&&(S.clientX=x,S.clientY=_),A=new Date().getTime(),A-s._mouseDownTimem&&(h=Math.max(h-1,1)),s._dragged)c.doneFn&&c.doneFn();else{var N;w.target===D?N=w:(N={target:D,srcElement:D,toElement:D},Object.keys(w).concat(Object.keys(w.__proto__)).forEach(B=>{var U=w[B];!N[B]&&typeof U!="function"&&(N[B]=U)})),c.clickFn&&c.clickFn(h,N),E||D.dispatchEvent(new MouseEvent("click",S))}s._dragging=!1,s._dragged=!1}};function l(){var c=document.createElement("div");c.className="dragcover";var s=c.style;return s.position="fixed",s.left=0,s.right=0,s.top=0,s.bottom=0,s.zIndex=999999999,s.background="none",document.body.appendChild(c),c}i.coverSlip=l;function o(c){return f(c.changedTouches?c.changedTouches[0]:c,document.body)}}),Mm=It((et,Y)=>{Y.exports=function(f,y){(f.attr("class")||"").split(" ").forEach(function(z){z.indexOf("cursor-")===0&&f.classed(z,!1)}),y&&f.classed("cursor-"+y,!0)}}),Zg=It((et,Y)=>{var f=Mm(),y="data-savedcursor",z="!!";Y.exports=function(P,n){var i=P.attr(y);if(n){if(!i){for(var a=(P.attr("class")||"").split(" "),l=0;l{var f=hi(),y=Sn();Y.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:f({editType:"legend"}),grouptitlefont:f({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:f({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),eb=It(et=>{et.isGrouped=function(Y){return(Y.traceorder||"").indexOf("grouped")!==-1},et.isVertical=function(Y){return Y.orientation!=="h"},et.isReversed=function(Y){return(Y.traceorder||"").indexOf("reversed")!==-1}}),rb=It((et,Y)=>{var f=ls(),y=jn(),z=Tc(),P=xa(),n=pw(),i=k_(),a=eb();function l(o,c,s,h){var m=c[o]||{},b=z.newContainer(s,o);function x(ut,rt){return y.coerce(m,b,n,ut,rt)}var _=y.coerceFont(x,"font",s.font);x("bgcolor",s.paper_bgcolor),x("bordercolor");var A=x("visible");if(A){for(var d,k=function(ut,rt){var gt=d._input,it=d;return y.coerce(gt,it,P,ut,rt)},w=s.font||{},D=y.coerceFont(x,"grouptitlefont",w,{overrideDflt:{size:Math.round(w.size*1.1)}}),E=0,I=!1,M="normal",p=(s.shapes||[]).filter(function(ut){return ut.showlegend}),g=h.concat(p).filter(function(ut){return o===(ut.legend||"legend")}),C=0;C(o==="legend"?1:0));if(N===!1&&(s[o]=void 0),!(N===!1&&!m.uirevision)&&(x("uirevision",s.uirevision),N!==!1)){x("borderwidth");var B=x("orientation"),U=x("yref"),V=x("xref"),W=B==="h",F=U==="paper",H=V==="paper",q,G,tt,ht="left";W?(q=0,f.getComponentMethod("rangeslider","isVisible")(c.xaxis)?F?(G=1.1,tt="bottom"):(G=1,tt="top"):F?(G=-.1,tt="top"):(G=0,tt="bottom")):(G=1,tt="auto",H?q=1.02:(q=1,ht="right")),y.coerce(m,b,{x:{valType:"number",editType:"legend",min:H?-2:0,max:H?3:1,dflt:q}},"x"),y.coerce(m,b,{y:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:G}},"y"),x("traceorder",M),a.isGrouped(s[o])&&x("tracegroupgap"),x("entrywidth"),x("entrywidthmode"),x("indentation"),x("itemsizing"),x("itemwidth"),x("itemclick"),x("itemdoubleclick"),x("groupclick"),x("xanchor",ht),x("yanchor",tt),x("maxheight"),x("valign"),y.noneOrAll(m,b,["x","y"]);var bt=x("title.text");if(bt){x("title.side",W?"left":"top");var vt=y.extendFlat({},_,{size:y.bigFont(_.size)});y.coerceFont(x,"title.font",vt)}}}}Y.exports=function(o,c,s){var h,m=s.slice(),b=c.shapes;if(b)for(h=0;h{var f=ls(),y=jn(),z=y.pushUnique,P=!0;Y.exports=function(n,i,a){var l=i._fullLayout;if(i._dragged||i._editing)return;var o=l.legend.itemclick,c=l.legend.itemdoubleclick,s=l.legend.groupclick;a===1&&o==="toggle"&&c==="toggleothers"&&P&&i.data&&i._context.showTips&&y.notifier(y._(i,"Double-click on legend to isolate one trace"),"long"),P=!1;var h;if(a===1?h=o:a===2&&(h=c),!h)return;var m=s==="togglegroup",b=l.hiddenlabels?l.hiddenlabels.slice():[],x=n.data()[0][0];if(x.groupTitle&&x.noClick)return;var _=i._fullData,A=(l.shapes||[]).filter(function(ue){return ue.showlegend}),d=_.concat(A),k=x.trace;k._isShape&&(k=k._fullInput);var w=k.legendgroup,D,E,I,M,p,g,C={},S=[],N=[],B=[];function U(ue,Mt){var Ot=S.indexOf(ue),Lt=C.visible;return Lt||(Lt=C.visible=[]),S.indexOf(ue)===-1&&(S.push(ue),Ot=S.length-1),Lt[Ot]=Mt,Ot}var V=(l.shapes||[]).map(function(ue){return ue._input}),W=!1;function F(ue,Mt){V[ue].visible=Mt,W=!0}function H(ue,Mt){if(!(x.groupTitle&&!m)){var Ot=ue._fullInput||ue,Lt=Ot._isShape,ie=Ot.index;ie===void 0&&(ie=Ot._index);var be=Ot.visible===!1?!1:Mt;Lt?F(ie,be):U(ie,be)}}var q=k.legend,G=k._fullInput,tt=G&&G._isShape;if(!tt&&f.traceIs(k,"pie-like")){var ht=x.label,bt=b.indexOf(ht);if(h==="toggle")bt===-1?b.push(ht):b.splice(bt,1);else if(h==="toggleothers"){var vt=bt!==-1,ut=[];for(D=0;D{Y.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),M4=It((et,Y)=>{var f=ls(),y=eb();Y.exports=function(z,P,n){var i=P._inHover,a=y.isGrouped(P),l=y.isReversed(P),o={},c=[],s=!1,h={},m=0,b=0,x,_;function A(H,q,G){if(P.visible!==!1&&!(n&&H!==P._id))if(q===""||!y.isGrouped(P)){var tt="~~i"+m;c.push(tt),o[tt]=[G],m++}else c.indexOf(q)===-1?(c.push(q),s=!0,o[q]=[G]):o[q].push(G)}for(x=0;xS&&(C=S)}p[x][0]._groupMinRank=C,p[x][0]._preGroupSort=x}var N=function(H,q){return H[0]._groupMinRank-q[0]._groupMinRank||H[0]._preGroupSort-q[0]._preGroupSort},B=function(H,q){return H.trace.legendrank-q.trace.legendrank||H._preSort-q._preSort};for(p.forEach(function(H,q){H[0]._preGroupSort=q}),p.sort(N),x=0;x{var Y=jn();function f(y){return y.indexOf("e")!==-1?y.replace(/[.]?0+e/,"e"):y.indexOf(".")!==-1?y.replace(/[.]?0+$/,""):y}et.formatPiePercent=function(y,z){var P=f((y*100).toPrecision(3));return Y.numSeparate(P,z)+"%"},et.formatPieValue=function(y,z){var P=f(y.toPrecision(10));return Y.numSeparate(P,z)},et.getFirstFilled=function(y,z){if(Y.isArrayOrTypedArray(y))for(var P=0;P{var f=Js(),y=Hn();Y.exports=function(z,P,n,i){var a=n.marker.pattern;a&&a.shape?f.pointStyle(z,n,i,P):y.fill(z,P.color)}}),Wv=It((et,Y)=>{var f=Hn(),y=Vv().castOption,z=_8();Y.exports=function(P,n,i,a){var l=i.marker.line,o=y(l.color,n.pts)||f.defaultLine,c=y(l.width,n.pts)||0;P.call(z,n,i,a).style("stroke-width",c).call(f.stroke,o)}}),E4=It((et,Y)=>{var f=Br(),y=ls(),z=jn(),P=z.strTranslate,n=Js(),i=Hn(),a=fp().extractOpts,l=Fu(),o=Wv(),c=Vv().castOption,s=mw(),h=12,m=5,b=2,x=10,_=5;Y.exports=function(w,D,E){var I=D._fullLayout;E||(E=I.legend);var M=E.itemsizing==="constant",p=E.itemwidth,g=(p+s.itemGap*2)/2,C=P(g,0),S=function(ut,rt,gt,it){var st;if(ut+1)st=ut;else if(rt&&rt.width>0)st=rt.width;else return 0;return M?it:Math.min(st,gt)};w.each(function(ut){var rt=f.select(this),gt=z.ensureSingle(rt,"g","layers");gt.style("opacity",ut[0].trace.opacity);var it=E.indentation,st=E.valign,xt=ut[0].lineHeight,ot=ut[0].height;if(st==="middle"&&it===0||!xt||!ot)gt.attr("transform",null);else{var J={top:1,bottom:-1}[st],mt=J*(.5*(xt-ot+3))||0,dt=E.indentation;gt.attr("transform",P(dt,mt))}var Ct=gt.selectAll("g.legendfill").data([ut]);Ct.enter().append("g").classed("legendfill",!0);var Rt=gt.selectAll("g.legendlines").data([ut]);Rt.enter().append("g").classed("legendlines",!0);var Bt=gt.selectAll("g.legendsymbols").data([ut]);Bt.enter().append("g").classed("legendsymbols",!0),Bt.selectAll("g.legendpoints").data([ut]).enter().append("g").classed("legendpoints",!0)}).each(vt).each(U).each(W).each(V).each(H).each(ht).each(tt).each(N).each(B).each(q).each(G);function N(ut){var rt=d(ut),gt=rt.showFill,it=rt.showLine,st=rt.showGradientLine,xt=rt.showGradientFill,ot=rt.anyFill,J=rt.anyLine,mt=ut[0],dt=mt.trace,Ct,Rt,Bt=a(dt),Zt=Bt.colorscale,Gt=Bt.reversescale,ee=function(Lt){if(Lt.size())if(gt)n.fillGroupStyle(Lt,D,!0);else{var ie="legendfill-"+dt.uid;n.gradient(Lt,D,ie,A(Gt),Zt,"fill")}},xe=function(Lt){if(Lt.size()){var ie="legendline-"+dt.uid;n.lineGroupStyle(Lt),n.gradient(Lt,D,ie,A(Gt),Zt,"stroke")}},ge=l.hasMarkers(dt)||!ot?"M5,0":J?"M5,-2":"M5,-3",ye=f.select(this),ue=ye.select(".legendfill").selectAll("path").data(gt||xt?[ut]:[]);if(ue.enter().append("path").classed("js-fill",!0),ue.exit().remove(),ue.attr("d",ge+"h"+p+"v6h-"+p+"z").call(ee),it||st){var Mt=S(void 0,dt.line,x,m);Rt=z.minExtend(dt,{line:{width:Mt}}),Ct=[z.minExtend(mt,{trace:Rt})]}var Ot=ye.select(".legendlines").selectAll("path").data(it||st?[Ct]:[]);Ot.enter().append("path").classed("js-line",!0),Ot.exit().remove(),Ot.attr("d",ge+(st?"l"+p+",0.0001":"h"+p)).call(it?n.lineGroupStyle:xe)}function B(ut){var rt=d(ut),gt=rt.anyFill,it=rt.anyLine,st=rt.showLine,xt=rt.showMarker,ot=ut[0],J=ot.trace,mt=!xt&&!it&&!gt&&l.hasText(J),dt,Ct;function Rt(ue,Mt,Ot,Lt){var ie=z.nestedProperty(J,ue).get(),be=z.isArrayOrTypedArray(ie)&&Mt?Mt(ie):ie;if(M&&be&&Lt!==void 0&&(be=Lt),Ot){if(beOt[1])return Ot[1]}return be}function Bt(ue){return ot._distinct&&ot.index&&ue[ot.index]?ue[ot.index]:ue[0]}if(xt||mt||st){var Zt={},Gt={};if(xt){Zt.mc=Rt("marker.color",Bt),Zt.mx=Rt("marker.symbol",Bt),Zt.mo=Rt("marker.opacity",z.mean,[.2,1]),Zt.mlc=Rt("marker.line.color",Bt),Zt.mlw=Rt("marker.line.width",z.mean,[0,5],b),Gt.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var ee=Rt("marker.size",z.mean,[2,16],h);Zt.ms=ee,Gt.marker.size=ee}st&&(Gt.line={width:Rt("line.width",Bt,[0,10],m)}),mt&&(Zt.tx="Aa",Zt.tp=Rt("textposition",Bt),Zt.ts=10,Zt.tc=Rt("textfont.color",Bt),Zt.tf=Rt("textfont.family",Bt),Zt.tw=Rt("textfont.weight",Bt),Zt.ty=Rt("textfont.style",Bt),Zt.tv=Rt("textfont.variant",Bt),Zt.tC=Rt("textfont.textcase",Bt),Zt.tE=Rt("textfont.lineposition",Bt),Zt.tS=Rt("textfont.shadow",Bt)),dt=[z.minExtend(ot,Zt)],Ct=z.minExtend(J,Gt),Ct.selectedpoints=null,Ct.texttemplate=null}var xe=f.select(this).select("g.legendpoints"),ge=xe.selectAll("path.scatterpts").data(xt?dt:[]);ge.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",C),ge.exit().remove(),ge.call(n.pointStyle,Ct,D),xt&&(dt[0].mrc=3);var ye=xe.selectAll("g.pointtext").data(mt?dt:[]);ye.enter().append("g").classed("pointtext",!0).append("text").attr("transform",C),ye.exit().remove(),ye.selectAll("text").call(n.textPointStyle,Ct,D)}function U(ut){var rt=ut[0].trace,gt=rt.type==="waterfall";if(ut[0]._distinct&>){var it=ut[0].trace[ut[0].dir].marker;return ut[0].mc=it.color,ut[0].mlw=it.line.width,ut[0].mlc=it.line.color,F(ut,this,"waterfall")}var st=[];rt.visible&>&&(st=ut[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var xt=f.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(st);xt.enter().append("path").classed("legendwaterfall",!0).attr("transform",C).style("stroke-miterlimit",1),xt.exit().remove(),xt.each(function(ot){var J=f.select(this),mt=rt[ot[0]].marker,dt=S(void 0,mt.line,_,b);J.attr("d",ot[1]).style("stroke-width",dt+"px").call(i.fill,mt.color),dt&&J.call(i.stroke,mt.line.color)})}function V(ut){F(ut,this)}function W(ut){F(ut,this,"funnel")}function F(ut,rt,gt){var it=ut[0].trace,st=it.marker||{},xt=st.line||{},ot=st.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",J=gt?it.visible&&it.type===gt:y.traceIs(it,"bar"),mt=f.select(rt).select("g.legendpoints").selectAll("path.legend"+gt).data(J?[ut]:[]);mt.enter().append("path").classed("legend"+gt,!0).attr("d",ot).attr("transform",C),mt.exit().remove(),mt.each(function(dt){var Ct=f.select(this),Rt=dt[0],Bt=S(Rt.mlw,st.line,_,b);Ct.style("stroke-width",Bt+"px");var Zt=Rt.mcc;if(!E._inHover&&"mc"in Rt){var Gt=a(st),ee=Gt.mid;ee===void 0&&(ee=(Gt.max+Gt.min)/2),Zt=n.tryColorscale(st,"")(ee)}var xe=Zt||Rt.mc||st.color,ge=st.pattern,ye=n.getPatternAttr,ue=ge&&(ye(ge.shape,0,"")||ye(ge.path,0,""));if(ue){var Mt=ye(ge.bgcolor,0,null),Ot=ye(ge.fgcolor,0,null),Lt=ge.fgopacity,ie=k(ge.size,8,10),be=k(ge.solidity,.5,1),ce="legend-"+it.uid;Ct.call(n.pattern,"legend",D,ce,ue,ie,be,Zt,ge.fillmode,Mt,Ot,Lt)}else Ct.call(i.fill,xe);Bt&&i.stroke(Ct,Rt.mlc||xt.color)})}function H(ut){var rt=ut[0].trace,gt=f.select(this).select("g.legendpoints").selectAll("path.legendbox").data(rt.visible&&y.traceIs(rt,"box-violin")?[ut]:[]);gt.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),gt.exit().remove(),gt.each(function(){var it=f.select(this);if((rt.boxpoints==="all"||rt.points==="all")&&i.opacity(rt.fillcolor)===0&&i.opacity((rt.line||{}).color)===0){var st=z.minExtend(rt,{marker:{size:M?h:z.constrain(rt.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});gt.call(n.pointStyle,st,D)}else{var xt=S(void 0,rt.line,_,b);it.style("stroke-width",xt+"px").call(i.fill,rt.fillcolor),xt&&i.stroke(it,rt.line.color)}})}function q(ut){var rt=ut[0].trace,gt=f.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(rt.visible&&rt.type==="candlestick"?[ut,ut]:[]);gt.enter().append("path").classed("legendcandle",!0).attr("d",function(it,st){return st?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",C).style("stroke-miterlimit",1),gt.exit().remove(),gt.each(function(it,st){var xt=f.select(this),ot=rt[st?"increasing":"decreasing"],J=S(void 0,ot.line,_,b);xt.style("stroke-width",J+"px").call(i.fill,ot.fillcolor),J&&i.stroke(xt,ot.line.color)})}function G(ut){var rt=ut[0].trace,gt=f.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(rt.visible&&rt.type==="ohlc"?[ut,ut]:[]);gt.enter().append("path").classed("legendohlc",!0).attr("d",function(it,st){return st?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",C).style("stroke-miterlimit",1),gt.exit().remove(),gt.each(function(it,st){var xt=f.select(this),ot=rt[st?"increasing":"decreasing"],J=S(void 0,ot.line,_,b);xt.style("fill","none").call(n.dashLine,ot.line.dash,J),J&&i.stroke(xt,ot.line.color)})}function tt(ut){bt(ut,this,"pie")}function ht(ut){bt(ut,this,"funnelarea")}function bt(ut,rt,gt){var it=ut[0],st=it.trace,xt=gt?st.visible&&st.type===gt:y.traceIs(st,gt),ot=f.select(rt).select("g.legendpoints").selectAll("path.legend"+gt).data(xt?[ut]:[]);if(ot.enter().append("path").classed("legend"+gt,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),ot.exit().remove(),ot.size()){var J=st.marker||{},mt=S(c(J.line.width,it.pts),J.line,_,b),dt="pieLike",Ct=z.minExtend(st,{marker:{line:{width:mt}}},dt),Rt=z.minExtend(it,{trace:Ct},dt);o(ot,Rt,Ct,D)}}function vt(ut){var rt=ut[0].trace,gt,it=[];if(rt.visible)switch(rt.type){case"histogram2d":case"heatmap":it=[["M-15,-2V4H15V-2Z"]],gt=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":it=[["M-6,-6V6H6V-6Z"]],gt=!0;break;case"densitymapbox":case"densitymap":it=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],gt="radial";break;case"cone":it=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],gt=!1;break;case"streamtube":it=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],gt=!1;break;case"surface":it=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],gt=!0;break;case"mesh3d":it=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],gt=!1;break;case"volume":it=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],gt=!0;break;case"isosurface":it=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],gt=!1;break}var st=f.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(it);st.enter().append("path").classed("legend3dandfriends",!0).attr("transform",C).style("stroke-miterlimit",1),st.exit().remove(),st.each(function(xt,ot){var J=f.select(this),mt=a(rt),dt=mt.colorscale,Ct=mt.reversescale,Rt=function(ee){if(ee.size()){var xe="legendfill-"+rt.uid;n.gradient(ee,D,xe,A(Ct,gt==="radial"),dt,"fill")}},Bt;if(dt){if(!gt){var Zt=dt.length;Bt=ot===0?dt[Ct?Zt-1:0][1]:ot===1?dt[Ct?0:Zt-1][1]:dt[Math.floor((Zt-1)/2)][1]}}else{var Gt=rt.vertexcolor||rt.facecolor||rt.color;Bt=z.isArrayOrTypedArray(Gt)?Gt[ot]||Gt[0]:Gt}J.attr("d",xt[0]),Bt?J.call(i.fill,Bt):J.call(Rt)})}};function A(w,D){var E=D?"radial":"horizontal";return E+(w?"":"reversed")}function d(w){var D=w[0].trace,E=D.contours,I=l.hasLines(D),M=l.hasMarkers(D),p=D.visible&&D.fill&&D.fill!=="none",g=!1,C=!1;if(E){var S=E.coloring;S==="lines"?g=!0:I=S==="none"||S==="heatmap"||E.showlines,E.type==="constraint"?p=E._operation!=="=":(S==="fill"||S==="heatmap")&&(C=!0)}return{showMarker:M,showLine:I,showFill:p,showGradientLine:g,showGradientFill:C,anyLine:I||g,anyFill:p||C}}function k(w,D,E){return w&&z.isArrayOrTypedArray(w)?D:w>E?E:w}}),gw=It((et,Y)=>{var f=Br(),y=jn(),z=lh(),P=ls(),n=qg(),i=Up(),a=Js(),l=Hn(),o=uu(),c=y8(),s=mw(),h=Rd(),m=h.LINE_SPACING,b=h.FROM_TL,x=h.FROM_BR,_=M4(),A=E4(),d=eb(),k=1,w=/^legend[0-9]*$/;Y.exports=function(q,G){if(G)E(q,G);else{var tt=q._fullLayout,ht=tt._legends,bt=tt._infolayer.selectAll('[class^="legend"]');bt.each(function(){var gt=f.select(this),it=gt.attr("class"),st=it.split(" ")[0];st.match(w)&&ht.indexOf(st)===-1&>.remove()});for(var vt=0;vt1)}var mt=ht.hiddenlabels||[];if(!rt&&(!ht.showlegend||!gt.length))return ut.selectAll("."+bt).remove(),ht._topdefs.select("#"+vt).remove(),z.autoMargin(q,bt);var dt=y.ensureSingle(ut,"g",bt,function(ye){rt||ye.attr("pointer-events","all")}),Ct=y.ensureSingleById(ht._topdefs,"clipPath",vt,function(ye){ye.append("rect")}),Rt=y.ensureSingle(dt,"rect","bg",function(ye){ye.attr("shape-rendering","crispEdges")});Rt.call(l.stroke,tt.bordercolor).call(l.fill,tt.bgcolor).style("stroke-width",tt.borderwidth+"px");var Bt=y.ensureSingle(dt,"g","scrollbox"),Zt=tt.title;tt._titleWidth=0,tt._titleHeight=0;var Gt;Zt.text?(Gt=y.ensureSingle(Bt,"text",bt+"titletext"),Gt.attr("text-anchor","start").call(a.font,Zt.font).text(Zt.text),S(Gt,Bt,q,tt,k)):Bt.selectAll("."+bt+"titletext").remove();var ee=y.ensureSingle(dt,"rect","scrollbar",function(ye){ye.attr(s.scrollBarEnterAttrs).call(l.fill,s.scrollBarColor)}),xe=Bt.selectAll("g.groups").data(gt);xe.enter().append("g").attr("class","groups"),xe.exit().remove();var ge=xe.selectAll("g.traces").data(y.identity);ge.enter().append("g").attr("class","traces"),ge.exit().remove(),ge.style("opacity",function(ye){var ue=ye[0].trace;return P.traceIs(ue,"pie-like")?mt.indexOf(ye[0].label)!==-1?.5:1:ue.visible==="legendonly"?.5:1}).each(function(){f.select(this).call(p,q,tt)}).call(A,q,tt).each(function(){rt||f.select(this).call(C,q,bt)}),y.syncOrAsync([z.previousPromises,function(){return U(q,xe,ge,tt)},function(){var ye=ht._size,ue=tt.borderwidth,Mt=tt.xref==="paper",Ot=tt.yref==="paper";if(Zt.text&&D(Gt,tt,ue),!rt){var Lt,ie;Mt?Lt=ye.l+ye.w*tt.x-b[W(tt)]*tt._width:Lt=ht.width*tt.x-b[W(tt)]*tt._width,Ot?ie=ye.t+ye.h*(1-tt.y)-b[F(tt)]*tt._effHeight:ie=ht.height*(1-tt.y)-b[F(tt)]*tt._effHeight;var be=V(q,bt,Lt,ie);if(be)return;if(ht.margin.autoexpand){var ce=Lt,Le=ie;Lt=Mt?y.constrain(Lt,0,ht.width-tt._width):ce,ie=Ot?y.constrain(ie,0,ht.height-tt._effHeight):Le,Lt!==ce&&y.log("Constrain "+bt+".x to make legend fit inside graph"),ie!==Le&&y.log("Constrain "+bt+".y to make legend fit inside graph")}a.setTranslate(dt,Lt,ie)}if(ee.on(".drag",null),dt.on("wheel",null),rt||tt._height<=tt._maxHeight||q._context.staticPlot){var Ze=tt._effHeight;rt&&(Ze=tt._height),Rt.attr({width:tt._width-ue,height:Ze-ue,x:ue/2,y:ue/2}),a.setTranslate(Bt,0,0),Ct.select("rect").attr({width:tt._width-2*ue,height:Ze-2*ue,x:ue,y:ue}),a.setClipUrl(Bt,vt,q),a.setRect(ee,0,0,0,0),delete tt._scrollY}else{var Qe=Math.max(s.scrollBarMinHeight,tt._effHeight*tt._effHeight/tt._height),mr=tt._effHeight-Qe-2*s.scrollBarMargin,fr=tt._height-tt._effHeight,Jr=mr/fr,an=Math.min(tt._scrollY||0,fr);Rt.attr({width:tt._width-2*ue+s.scrollBarWidth+s.scrollBarMargin,height:tt._effHeight-ue,x:ue/2,y:ue/2}),Ct.select("rect").attr({width:tt._width-2*ue+s.scrollBarWidth+s.scrollBarMargin,height:tt._effHeight-2*ue,x:ue,y:ue+an}),a.setClipUrl(Bt,vt,q),_t(an,Qe,Jr),dt.on("wheel",function(){an=y.constrain(tt._scrollY+f.event.deltaY/fr*mr,0,fr),_t(an,Qe,Jr),an!==0&&an!==fr&&f.event.preventDefault()});var Er,dn,_n,Oe=function(Me,qe,Ye){var ur=(Ye-qe)/Jr+Me;return y.constrain(ur,0,fr)},Xt=function(Me,qe,Ye){var ur=(qe-Ye)/Jr+Me;return y.constrain(ur,0,fr)},oe=f.behavior.drag().on("dragstart",function(){var Me=f.event.sourceEvent;Me.type==="touchstart"?Er=Me.changedTouches[0].clientY:Er=Me.clientY,_n=an}).on("drag",function(){var Me=f.event.sourceEvent;Me.buttons===2||Me.ctrlKey||(Me.type==="touchmove"?dn=Me.changedTouches[0].clientY:dn=Me.clientY,an=Oe(_n,Er,dn),_t(an,Qe,Jr))});ee.call(oe);var zt=f.behavior.drag().on("dragstart",function(){var Me=f.event.sourceEvent;Me.type==="touchstart"&&(Er=Me.changedTouches[0].clientY,_n=an)}).on("drag",function(){var Me=f.event.sourceEvent;Me.type==="touchmove"&&(dn=Me.changedTouches[0].clientY,an=Xt(_n,Er,dn),_t(an,Qe,Jr))});Bt.call(zt)}function _t(Me,qe,Ye){tt._scrollY=q._fullLayout[bt]._scrollY=Me,a.setTranslate(Bt,0,-Me),a.setRect(ee,tt._width,s.scrollBarMargin+Me*Ye,s.scrollBarWidth,qe),Ct.select("rect").attr("y",ue+Me)}if(q._context.edits.legendPosition){var Pt,Ht,ae,he;dt.classed("cursor-move",!0),i.init({element:dt.node(),gd:q,prepFn:function(Me){if(Me.target!==ee.node()){var qe=a.getTranslate(dt);ae=qe.x,he=qe.y}},moveFn:function(Me,qe){if(ae!==void 0&&he!==void 0){var Ye=ae+Me,ur=he+qe;a.setTranslate(dt,Ye,ur),Pt=i.align(Ye,tt._width,ye.l,ye.l+ye.w,tt.xanchor),Ht=i.align(ur+tt._height,-tt._height,ye.t+ye.h,ye.t,tt.yanchor)}},doneFn:function(){if(Pt!==void 0&&Ht!==void 0){var Me={};Me[bt+".x"]=Pt,Me[bt+".y"]=Ht,P.call("_guiRelayout",q,Me)}},clickFn:function(Me,qe){var Ye=ut.selectAll("g.traces").filter(function(){var ur=this.getBoundingClientRect();return qe.clientX>=ur.left&&qe.clientX<=ur.right&&qe.clientY>=ur.top&&qe.clientY<=ur.bottom});Ye.size()>0&&M(q,dt,Ye,Me,qe)}})}}],q)}}function I(q,G,tt){var ht=q[0],bt=ht.width,vt=G.entrywidthmode,ut=ht.trace.legendwidth||G.entrywidth;return vt==="fraction"?G._maxWidth*ut:tt+(ut||bt)}function M(q,G,tt,ht,bt){var vt=tt.data()[0][0].trace,ut={event:bt,node:tt.node(),curveNumber:vt.index,expandedIndex:vt.index,data:q.data,layout:q.layout,frames:q._transitionData._frames,config:q._context,fullData:q._fullData,fullLayout:q._fullLayout};vt._group&&(ut.group=vt._group),P.traceIs(vt,"pie-like")&&(ut.label=tt.datum()[0].label);var rt=n.triggerHandler(q,"plotly_legendclick",ut);if(ht===1){if(rt===!1)return;G._clickTimeout=setTimeout(function(){q._fullLayout&&c(tt,q,ht)},q._context.doubleClickDelay)}else if(ht===2){G._clickTimeout&&clearTimeout(G._clickTimeout),q._legendMouseDownTime=0;var gt=n.triggerHandler(q,"plotly_legenddoubleclick",ut);gt!==!1&&rt!==!1&&c(tt,q,ht)}}function p(q,G,tt){var ht=H(tt),bt=q.data()[0][0],vt=bt.trace,ut=P.traceIs(vt,"pie-like"),rt=!tt._inHover&&G._context.edits.legendText&&!ut,gt=tt._maxNameLength,it,st;bt.groupTitle?(it=bt.groupTitle.text,st=bt.groupTitle.font):(st=tt.font,tt.entries?it=bt.text:(it=ut?bt.label:vt.name,vt._meta&&(it=y.templateString(it,vt._meta))));var xt=y.ensureSingle(q,"text",ht+"text");xt.attr("text-anchor","start").call(a.font,st).text(rt?g(it,gt):it);var ot=tt.indentation+tt.itemwidth+s.itemGap*2;o.positionText(xt,ot,0),rt?xt.call(o.makeEditable,{gd:G,text:it}).call(S,q,G,tt).on("edit",function(J){this.text(g(J,gt)).call(S,q,G,tt);var mt=bt.trace._fullInput||{},dt={};return dt.name=J,mt._isShape?P.call("_guiRelayout",G,"shapes["+vt.index+"].name",dt.name):P.call("_guiRestyle",G,dt,vt.index)}):S(xt,q,G,tt)}function g(q,G){var tt=Math.max(4,G);if(q&&q.trim().length>=tt/2)return q;q=q||"";for(var ht=tt-q.length;ht>0;ht--)q+=" ";return q}function C(q,G,tt){var ht=G._context.doubleClickDelay,bt,vt=1,ut=y.ensureSingle(q,"rect",tt+"toggle",function(rt){G._context.staticPlot||rt.style("cursor","pointer").attr("pointer-events","all"),rt.call(l.fill,"rgba(0,0,0,0)")});G._context.staticPlot||(ut.on("mousedown",function(){bt=new Date().getTime(),bt-G._legendMouseDownTimeht&&(vt=Math.max(vt-1,1)),M(G,rt,q,vt,f.event)}}))}function S(q,G,tt,ht,bt){ht._inHover&&q.attr("data-notex",!0),o.convertToTspans(q,tt,function(){N(G,tt,ht,bt)})}function N(q,G,tt,ht){var bt=q.data()[0][0];if(!tt._inHover&&bt&&!bt.trace.showlegend){q.remove();return}var vt=q.select("g[class*=math-group]"),ut=vt.node(),rt=H(tt);tt||(tt=G._fullLayout[rt]);var gt=tt.borderwidth,it;ht===k?it=tt.title.font:bt.groupTitle?it=bt.groupTitle.font:it=tt.font;var st=it.size*m,xt,ot;if(ut){var J=a.bBox(ut);xt=J.height,ot=J.width,ht===k?a.setTranslate(vt,gt,gt+xt*.75):a.setTranslate(vt,0,xt*.25)}else{var mt="."+rt+(ht===k?"title":"")+"text",dt=q.select(mt),Ct=o.lineCount(dt),Rt=dt.node();if(xt=st*Ct,ot=Rt?a.bBox(Rt).width:0,ht===k)tt.title.side==="left"&&(ot+=s.itemGap*2),o.positionText(dt,gt+s.titlePad,gt+st);else{var Bt=s.itemGap*2+tt.indentation+tt.itemwidth;bt.groupTitle&&(Bt=s.itemGap,ot-=tt.indentation+tt.itemwidth),o.positionText(dt,Bt,-st*((Ct-1)/2-.3))}}ht===k?(tt._titleWidth=ot,tt._titleHeight=xt):(bt.lineHeight=st,bt.height=Math.max(xt,16)+3,bt.width=ot)}function B(q){var G=0,tt=0,ht=q.title.side;return ht&&(ht.indexOf("left")!==-1&&(G=q._titleWidth),ht.indexOf("top")!==-1&&(tt=q._titleHeight)),[G,tt]}function U(q,G,tt,ht){var bt=q._fullLayout,vt=H(ht);ht||(ht=bt[vt]);var ut=bt._size,rt=d.isVertical(ht),gt=d.isGrouped(ht),it=ht.entrywidthmode==="fraction",st=ht.borderwidth,xt=2*st,ot=s.itemGap,J=ht.indentation+ht.itemwidth+ot*2,mt=2*(st+ot),dt=F(ht),Ct=ht.y<0||ht.y===0&&dt==="top",Rt=ht.y>1||ht.y===1&&dt==="bottom",Bt=ht.tracegroupgap,Zt={};let{orientation:Gt,yref:ee}=ht,{maxheight:xe}=ht,ge=Ct||Rt||Gt!=="v"||ee!=="paper";xe||(xe=ge?.5:1);let ye=ge?bt.height:ut.h;ht._maxHeight=Math.max(xe>1?xe:xe*ye,30);var ue=0;ht._width=0,ht._height=0;var Mt=B(ht);if(rt)tt.each(function(_t){var Pt=_t[0].height;a.setTranslate(this,st+Mt[0],st+Mt[1]+ht._height+Pt/2+ot),ht._height+=Pt,ht._width=Math.max(ht._width,_t[0].width)}),ue=J+ht._width,ht._width+=ot+J+xt,ht._height+=mt,gt&&(G.each(function(_t,Pt){a.setTranslate(this,0,Pt*ht.tracegroupgap)}),ht._height+=(ht._lgroupsLength-1)*ht.tracegroupgap);else{var Ot=W(ht),Lt=ht.x<0||ht.x===0&&Ot==="right",ie=ht.x>1||ht.x===1&&Ot==="left",be=Rt||Ct,ce=bt.width/2;ht._maxWidth=Math.max(Lt?be&&Ot==="left"?ut.l+ut.w:ce:ie?be&&Ot==="right"?ut.r+ut.w:ce:ut.w,2*J);var Le=0,Ze=0;tt.each(function(_t){var Pt=I(_t,ht,J);Le=Math.max(Le,Pt),Ze+=Pt}),ue=null;var Qe=0;if(gt){var mr=0,fr=0,Jr=0;G.each(function(){var _t=0,Pt=0;f.select(this).selectAll("g.traces").each(function(ae){var he=I(ae,ht,J),Me=ae[0].height;a.setTranslate(this,Mt[0],Mt[1]+st+ot+Me/2+Pt),Pt+=Me,_t=Math.max(_t,he),Zt[ae[0].trace.legendgroup]=_t});var Ht=_t+ot;fr>0&&Ht+st+fr>ht._maxWidth?(Qe=Math.max(Qe,fr),fr=0,Jr+=mr+Bt,mr=Pt):mr=Math.max(mr,Pt),a.setTranslate(this,fr,Jr),fr+=Ht}),ht._width=Math.max(Qe,fr)+st,ht._height=Jr+mr+mt}else{var an=tt.size(),Er=Ze+xt+(an-1)*ot=ht._maxWidth&&(Qe=Math.max(Qe,Xt),_n=0,Oe+=dn,ht._height+=dn,dn=0),a.setTranslate(this,Mt[0]+st+_n,Mt[1]+st+Oe+Pt/2+ot),Xt=_n+Ht+ot,_n+=ae,dn=Math.max(dn,Pt)}),Er?(ht._width=_n+xt,ht._height=dn+mt):(ht._width=Math.max(Qe,Xt)+xt,ht._height+=dn+mt)}}ht._width=Math.ceil(Math.max(ht._width+Mt[0],ht._titleWidth+2*(st+s.titlePad))),ht._height=Math.ceil(Math.max(ht._height+Mt[1],ht._titleHeight+2*(st+s.itemGap))),ht._effHeight=Math.min(ht._height,ht._maxHeight);var oe=q._context.edits,zt=oe.legendText||oe.legendPosition;tt.each(function(_t){var Pt=f.select(this).select("."+vt+"toggle"),Ht=_t[0].height,ae=_t[0].trace.legendgroup,he=I(_t,ht,J);gt&&ae!==""&&(he=Zt[ae]);var Me=zt?J:ue||he;!rt&&!it&&(Me+=ot/2),a.setRect(Pt,0,-Ht/2,Me,Ht)})}function V(q,G,tt,ht){var bt=q._fullLayout,vt=bt[G],ut=W(vt),rt=F(vt),gt=vt.xref==="paper",it=vt.yref==="paper";q._fullLayout._reservedMargin[G]={};var st=vt.y<.5?"b":"t",xt=vt.x<.5?"l":"r",ot={r:bt.width-tt,l:tt+vt._width,b:bt.height-ht,t:ht+vt._effHeight};if(gt&&it)return z.autoMargin(q,G,{x:vt.x,y:vt.y,l:vt._width*b[ut],r:vt._width*x[ut],b:vt._effHeight*x[rt],t:vt._effHeight*b[rt]});gt?q._fullLayout._reservedMargin[G][st]=ot[st]:it||vt.orientation==="v"?q._fullLayout._reservedMargin[G][xt]=ot[xt]:q._fullLayout._reservedMargin[G][st]=ot[st]}function W(q){return y.isRightAnchor(q)?"right":y.isCenterAnchor(q)?"center":"left"}function F(q){return y.isBottomAnchor(q)?"bottom":y.isMiddleAnchor(q)?"middle":"top"}function H(q){return q._id||"legend"}}),vw=It(et=>{var Y=Br(),f=Sr(),y=Xi(),z=jn(),P=z.pushUnique,n=z.strTranslate,i=z.strRotate,a=qg(),l=uu(),o=Zg(),c=Js(),s=Hn(),h=Up(),m=Fs(),b=fu().zindexSeparator,x=ls(),_=T0(),A=na(),d=rb(),k=gw(),w=A.YANGLE,D=Math.PI*w/180,E=1/Math.sin(D),I=Math.cos(D),M=Math.sin(D),p=A.HOVERARROWSIZE,g=A.HOVERTEXTPAD,C={box:!0,ohlc:!0,violin:!0,candlestick:!0},S={scatter:!0,scattergl:!0,splom:!0};function N(J,mt){return J.distance-mt.distance}et.hover=function(J,mt,dt,Ct){J=z.getGraphDiv(J);var Rt=mt.target;z.throttle(J._fullLayout._uid+A.HOVERID,A.HOVERMINTIME,function(){B(J,mt,dt,Ct,Rt)})},et.loneHover=function(J,mt){var dt=!0;Array.isArray(J)||(dt=!1,J=[J]);var Ct=mt.gd,Rt=st(Ct),Bt=xt(Ct),Zt=J.map(function(Lt){var ie=Lt._x0||Lt.x0||Lt.x||0,be=Lt._x1||Lt.x1||Lt.x||0,ce=Lt._y0||Lt.y0||Lt.y||0,Le=Lt._y1||Lt.y1||Lt.y||0,Ze=Lt.eventData;if(Ze){var Qe=Math.min(ie,be),mr=Math.max(ie,be),fr=Math.min(ce,Le),Jr=Math.max(ce,Le),an=Lt.trace;if(x.traceIs(an,"gl3d")){var Er=Ct._fullLayout[an.scene]._scene.container,dn=Er.offsetLeft,_n=Er.offsetTop;Qe+=dn,mr+=dn,fr+=_n,Jr+=_n}Ze.bbox={x0:Qe+Bt,x1:mr+Bt,y0:fr+Rt,y1:Jr+Rt},mt.inOut_bbox&&mt.inOut_bbox.push(Ze.bbox)}else Ze=!1;return{color:Lt.color||s.defaultLine,x0:Lt.x0||Lt.x||0,x1:Lt.x1||Lt.x||0,y0:Lt.y0||Lt.y||0,y1:Lt.y1||Lt.y||0,xLabel:Lt.xLabel,yLabel:Lt.yLabel,zLabel:Lt.zLabel,text:Lt.text,name:Lt.name,idealAlign:Lt.idealAlign,borderColor:Lt.borderColor,fontFamily:Lt.fontFamily,fontSize:Lt.fontSize,fontColor:Lt.fontColor,fontWeight:Lt.fontWeight,fontStyle:Lt.fontStyle,fontVariant:Lt.fontVariant,nameLength:Lt.nameLength,textAlign:Lt.textAlign,trace:Lt.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Lt.hovertemplate||!1,hovertemplateLabels:Lt.hovertemplateLabels||!1,eventData:Ze}}),Gt=!1,ee=W(Zt,{gd:Ct,hovermode:"closest",rotateLabels:Gt,bgColor:mt.bgColor||s.background,container:Y.select(mt.container),outerContainer:mt.outerContainer||mt.container}),xe=ee.hoverLabels,ge=5,ye=0,ue=0;xe.sort(function(Lt,ie){return Lt.y0-ie.y0}).each(function(Lt,ie){var be=Lt.y0-Lt.by/2;be-gefr[0]._length||Ci<0||Ci>Jr[0]._length)return h.unhoverRaw(J,mt)}if(mt.pointerX=Gi+fr[0]._offset,mt.pointerY=Ci+Jr[0]._offset,"xval"in mt?zt=_.flat(Bt,mt.xval):zt=_.p2c(fr,Gi),"yval"in mt?_t=_.flat(Bt,mt.yval):_t=_.p2c(Jr,Ci),!f(zt[0])||!f(_t[0]))return z.warn("Fx.hover failed",mt,J),h.unhoverRaw(J,mt)}var oa=1/0;function Ke(Ka,Cs){for(Ht=0;Htxr&&(Xt.splice(0,xr),oa=Xt[0].distance),ye&&Oe!==0&&Xt.length===0){zr.distance=Oe,zr.index=!1;var ms=he._module.hoverPoints(zr,ur,Rr,"closest",{hoverLayer:Gt._hoverlayer});if(ms&&(ms=ms.filter(function(Uo){return Uo.spikeDistance<=Oe})),ms&&ms.length){var kl,ul=ms.filter(function(Uo){return Uo.xa.showspikes&&Uo.xa.spikesnap!=="hovered data"});if(ul.length){var Kl=ul[0];f(Kl.x0)&&f(Kl.y0)&&(kl=vr(Kl),(!pn.vLinePoint||pn.vLinePoint.spikeDistance>kl.spikeDistance)&&(pn.vLinePoint=kl))}var vs=ms.filter(function(Uo){return Uo.ya.showspikes&&Uo.ya.spikesnap!=="hovered data"});if(vs.length){var Ns=vs[0];f(Ns.x0)&&f(Ns.y0)&&(kl=vr(Ns),(!pn.hLinePoint||pn.hLinePoint.spikeDistance>kl.spikeDistance)&&(pn.hLinePoint=kl))}}}}}Ke();function sr(Ka,Cs,ps){for(var wl=null,is=1/0,ol,ms=0;msKa.trace.index===Ei.trace.index):Xt=[Ei];var Ga=Xt.length,so=it("x",Ei,Gt),Fe=it("y",Ei,Gt);Ke(so,Fe);var Re=[],Kr={},sn=0,cn=function(Ka){var Cs=C[Ka.trace.type]?U(Ka):Ka.trace.index;if(!Kr[Cs])sn++,Kr[Cs]=sn,Re.push(Ka);else{var ps=Kr[Cs]-1,wl=Re[ps];ps>0&&Math.abs(Ka.distance)Ga-1;Yr--)cn(Xt[Yr]);Xt=Re,Zn()}var un=J._hoverdata,Pn=[],bn=st(J),ze=xt(J);for(let Ka of Xt){var yr=_.makeEventData(Ka,Ka.trace,Ka.cd);if(Ka.hovertemplate!==!1){var en=!1;Ka.cd[Ka.index]&&Ka.cd[Ka.index].ht&&(en=Ka.cd[Ka.index].ht),Ka.hovertemplate=en||Ka.trace.hovertemplate||!1}if(Ka.xa&&Ka.ya){var Rn=Ka.x0+Ka.xa._offset,ni=Ka.x1+Ka.xa._offset,xi=Ka.y0+Ka.ya._offset,Jn=Ka.y1+Ka.ya._offset,Gn=Math.min(Rn,ni),pi=Math.max(Rn,ni),Va=Math.min(xi,Jn),ea=Math.max(xi,Jn);yr.bbox={x0:Gn+ze,x1:pi+ze,y0:Va+bn,y1:ea+bn}}Ka.eventData=[yr],Pn.push(yr)}J._hoverdata=Pn;var go=ue==="y"&&(oe.length>1||Xt.length>1)||ue==="closest"&&ci&&Xt.length>1,mo=s.combine(Gt.plot_bgcolor||s.background,Gt.paper_bgcolor),Go=W(Xt,{gd:J,hovermode:ue,rotateLabels:go,bgColor:mo,container:Gt._hoverlayer,outerContainer:Gt._paper.node(),commonLabelOpts:Gt.hoverlabel,hoverdistance:Gt.hoverdistance}),Po=Go.hoverLabels;if(_.isUnifiedHover(ue)||(H(Po,go,Gt,Go.commonLabelBoundingBox),tt(Po,go,Gt._invScaleX,Gt._invScaleY)),Rt&&Rt.tagName){var Zo=x.getComponentMethod("annotations","hasClickToShow")(J,Pn);o(Y.select(Rt),Zo?"pointer":"")}!Rt||Ct||!vt(J,mt,un)||(un&&J.emit("plotly_unhover",{event:mt,points:un}),J.emit("plotly_hover",{event:mt,points:J._hoverdata,xaxes:fr,yaxes:Jr,xvals:zt,yvals:_t}))}function U(J){return[J.trace.index,J.index,J.x0,J.y0,J.name,J.attr,J.xa?J.xa._id:"",J.ya?J.ya._id:""].join(",")}var V=/([\s\S]*)<\/extra>/;function W(J,mt){var dt=mt.gd,Ct=dt._fullLayout,Rt=mt.hovermode,Bt=mt.rotateLabels,Zt=mt.bgColor,Gt=mt.container,ee=mt.outerContainer,xe=mt.commonLabelOpts||{};if(J.length===0)return[[]];var ge=mt.fontFamily||A.HOVERFONT,ye=mt.fontSize||A.HOVERFONTSIZE,ue=mt.fontWeight||Ct.font.weight,Mt=mt.fontStyle||Ct.font.style,Ot=mt.fontVariant||Ct.font.variant,Lt=mt.fontTextcase||Ct.font.textcase,ie=mt.fontLineposition||Ct.font.lineposition,be=mt.fontShadow||Ct.font.shadow,ce=J[0],Le=ce.xa,Ze=ce.ya,Qe=Rt.charAt(0),mr=Qe+"Label",fr=ce[mr];if(fr===void 0&&Le.type==="multicategory")for(var Jr=0;JrCt.width-ze&&(yr=Ct.width-ze),Ga.attr("d","M"+(un-yr)+",0L"+(un-yr+p)+","+bn+p+"H"+ze+"v"+bn+(g*2+Yr.height)+"H"+-ze+"V"+bn+p+"H"+(un-yr-p)+"Z"),un=yr,Ht.minX=un-ze,Ht.maxX=un+ze,Le.side==="top"?(Ht.minY=Pn-(g*2+Yr.height),Ht.maxY=Pn-g):(Ht.minY=Pn+g,Ht.maxY=Pn+(g*2+Yr.height))}else{var en,Rn,ni;Ze.side==="right"?(en="start",Rn=1,ni="",un=Le._offset+Le._length):(en="end",Rn=-1,ni="-",un=Le._offset),Pn=Ze._offset+(ce.y0+ce.y1)/2,so.attr("text-anchor",en),Ga.attr("d","M0,0L"+ni+p+","+p+"V"+(g+Yr.height/2)+"h"+ni+(g*2+Yr.width)+"V-"+(g+Yr.height/2)+"H"+ni+p+"V-"+p+"Z"),Ht.minY=Pn-(g+Yr.height/2),Ht.maxY=Pn+(g+Yr.height/2),Ze.side==="right"?(Ht.minX=un+p,Ht.maxX=un+p+(g*2+Yr.width)):(Ht.minX=un-p-(g*2+Yr.width),Ht.maxX=un-p);var xi=Yr.height/2,Jn=Er-Yr.top-xi,Gn="clip"+Ct._uid+"commonlabel"+Ze._id,pi;if(unGa.hoverinfo!=="none");if(Ei.length===0)return[];var ae=Ct.hoverlabel,he=ae.font,Me=Ei[0],qe=((Rt==="x unified"?Me.xa:Me.ya).unifiedhovertitle||{}).text,Ye=qe?z.hovertemplateString({data:Rt==="x unified"?[{xa:Me.xa,x:Me.xVal}]:[{ya:Me.ya,y:Me.yVal}],fallback:Me.trace.hovertemplatefallback,locale:Ct._d3locale,template:qe}):fr,ur={showlegend:!0,legend:{title:{text:Ye,font:he},font:he,bgcolor:ae.bgcolor,bordercolor:ae.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:Ct.legend?Ct.legend.traceorder:void 0,orientation:"v"}},Rr={font:he};d(ur,Rr,dt._fullData);var zr=Rr.legend;zr.entries=[];for(var xr=0;xr=0?Zi=Un:Wn+ba=0?Zi=Wn:Li+ba=0?Ji=mn:Zn+oa<_n&&Zn>=0?Ji=Zn:Fi+oa<_n?Ji=Fi:mn-vr=0,(Ei.idealAlign==="top"||!go)&&mo?(ni-=Jn/2,Ei.anchor="end"):go?(ni+=Jn/2,Ei.anchor="start"):Ei.anchor="middle",Ei.crossPos=ni;else{if(Ei.pos=ni,go=Rn+xi/2+ea<=dn,mo=Rn-xi/2-ea>=0,(Ei.idealAlign==="left"||!go)&&mo)Rn-=xi/2,Ei.anchor="end";else if(go)Rn+=xi/2,Ei.anchor="start";else{Ei.anchor="middle";var Go=ea/2,Po=Rn+Go-dn,Zo=Rn-Go;Po>0&&(Rn-=Po),Zo<0&&(Rn+=-Zo)}Ei.crossPos=Rn}Pn.attr("text-anchor",Ei.anchor),ze&&bn.attr("text-anchor",Ei.anchor),Ga.attr("transform",n(Rn,ni)+(Bt?i(w):""))}),{hoverLabels:ca,commonLabelBoundingBox:Ht}}function F(J,mt,dt,Ct,Rt,Bt){var Zt="",Gt="";J.nameOverride!==void 0&&(J.name=J.nameOverride),J.name&&(J.trace._meta&&(J.name=z.templateString(J.name,J.trace._meta)),Zt=rt(J.name,J.nameLength));var ee=dt.charAt(0),xe=ee==="x"?"y":"x";J.zLabel!==void 0?(J.xLabel!==void 0&&(Gt+="x: "+J.xLabel+"
"),J.yLabel!==void 0&&(Gt+="y: "+J.yLabel+"
"),J.trace.type!=="choropleth"&&J.trace.type!=="choroplethmapbox"&&J.trace.type!=="choroplethmap"&&(Gt+=(Gt?"z: ":"")+J.zLabel)):mt&&J[ee+"Label"]===Rt?Gt=J[xe+"Label"]||"":J.xLabel===void 0?J.yLabel!==void 0&&J.trace.type!=="scattercarpet"&&(Gt=J.yLabel):J.yLabel===void 0?Gt=J.xLabel:Gt="("+J.xLabel+", "+J.yLabel+")",(J.text||J.text===0)&&!Array.isArray(J.text)&&(Gt+=(Gt?"
":"")+J.text),J.extraText!==void 0&&(Gt+=(Gt?"
":"")+J.extraText),Bt&&Gt===""&&!J.hovertemplate&&(Zt===""&&Bt.remove(),Gt=Zt);let{hovertemplate:ge=!1}=J;if(ge){let ye=J.hovertemplateLabels||J;J[ee+"Label"]!==Rt&&(ye[ee+"other"]=ye[ee+"Val"],ye[ee+"otherLabel"]=ye[ee+"Label"]),Gt=z.hovertemplateString({data:[J.eventData[0]||{},J.trace._meta],fallback:J.trace.hovertemplatefallback,labels:ye,locale:Ct._d3locale,template:ge}),Gt=Gt.replace(V,(ue,Mt)=>(Zt=rt(Mt,J.nameLength),""))}return[Gt,Zt]}function H(J,mt,dt,Ct){var Rt=mt?"xa":"ya",Bt=mt?"ya":"xa",Zt=0,Gt=1,ee=J.size(),xe=new Array(ee),ge=0,ye=Ct.minX,ue=Ct.maxX,Mt=Ct.minY,Ot=Ct.maxY,Lt=function(zt){return zt*dt._invScaleX},ie=function(zt){return zt*dt._invScaleY};J.each(function(zt){var _t=zt[Rt],Pt=zt[Bt],Ht=_t._id.charAt(0)==="x",ae=_t.range;ge===0&&ae&&ae[0]>ae[1]!==Ht&&(Gt=-1);var he=0,Me=Ht?dt.width:dt.height;if(dt.hovermode==="x"||dt.hovermode==="y"){var qe=q(zt,mt),Ye=zt.anchor,ur=Ye==="end"?-1:1,Rr,zr;if(Ye==="middle")Rr=zt.crossPos+(Ht?ie(qe.y-zt.by/2):Lt(zt.bx/2+zt.tx2width/2)),zr=Rr+(Ht?ie(zt.by):Lt(zt.bx));else if(Ht)Rr=zt.crossPos+ie(p+qe.y)-ie(zt.by/2-p),zr=Rr+ie(zt.by);else{var xr=Lt(ur*p+qe.x),pn=xr+Lt(ur*zt.bx);Rr=zt.crossPos+Math.min(xr,pn),zr=zt.crossPos+Math.max(xr,pn)}Ht?Mt!==void 0&&Ot!==void 0&&Math.min(zr,Ot)-Math.max(Rr,Mt)>1&&(Pt.side==="left"?(he=Pt._mainLinePosition,Me=dt.width):Me=Pt._mainLinePosition):ye!==void 0&&ue!==void 0&&Math.min(zr,ue)-Math.max(Rr,ye)>1&&(Pt.side==="top"?(he=Pt._mainLinePosition,Me=dt.height):Me=Pt._mainLinePosition)}xe[ge++]=[{datum:zt,traceIndex:zt.trace.index,dp:0,pos:zt.pos,posref:zt.posref,size:zt.by*(Ht?E:1)/2,pmin:he,pmax:Me}]}),xe.sort(function(zt,_t){return zt[0].posref-_t[0].posref||Gt*(_t[0].traceIndex-zt[0].traceIndex)});var be,ce,Le,Ze,Qe,mr,fr;function Jr(zt){var _t=zt[0],Pt=zt[zt.length-1];if(ce=_t.pmin-_t.pos-_t.dp+_t.size,Le=Pt.pos+Pt.dp+Pt.size-_t.pmax,ce>.01){for(Qe=zt.length-1;Qe>=0;Qe--)zt[Qe].dp+=ce;be=!1}if(!(Le<.01)){if(ce<-.01){for(Qe=zt.length-1;Qe>=0;Qe--)zt[Qe].dp-=Le;be=!1}if(be){var Ht=0;for(Ze=0;Ze_t.pmax&&Ht++;for(Ze=zt.length-1;Ze>=0&&!(Ht<=0);Ze--)mr=zt[Ze],mr.pos>_t.pmax-1&&(mr.del=!0,Ht--);for(Ze=0;Ze=0;Qe--)zt[Qe].dp-=Le;for(Ze=zt.length-1;Ze>=0&&!(Ht<=0);Ze--)mr=zt[Ze],mr.pos+mr.dp+mr.size>_t.pmax&&(mr.del=!0,Ht--)}}}for(;!be&&Zt<=ee;){for(Zt++,be=!0,Ze=0;Ze.01){for(Qe=Er.length-1;Qe>=0;Qe--)Er[Qe].dp+=ce;for(an.push.apply(an,Er),xe.splice(Ze+1,1),fr=0,Qe=an.length-1;Qe>=0;Qe--)fr+=an[Qe].dp;for(Le=fr/an.length,Qe=an.length-1;Qe>=0;Qe--)an[Qe].dp-=Le;be=!1}else Ze++}xe.forEach(Jr)}for(Ze=xe.length-1;Ze>=0;Ze--){var Oe=xe[Ze];for(Qe=Oe.length-1;Qe>=0;Qe--){var Xt=Oe[Qe],oe=Xt.datum;oe.offset=Xt.dp,oe.del=Xt.del}}}function q(J,mt){var dt=0,Ct=J.offset;return mt&&(Ct*=-M,dt=J.offset*I),{x:dt,y:Ct}}function G(J){var mt={start:1,end:-1,middle:0}[J.anchor],dt=mt*(p+g),Ct=dt+mt*(J.txwidth+g),Rt=J.anchor==="middle";return Rt&&(dt-=J.tx2width/2,Ct+=J.txwidth/2+g),{alignShift:mt,textShiftX:dt,text2ShiftX:Ct}}function tt(J,mt,dt,Ct){var Rt=function(Zt){return Zt*dt},Bt=function(Zt){return Zt*Ct};J.each(function(Zt){var Gt=Y.select(this);if(Zt.del)return Gt.remove();var ee=Gt.select("text.nums"),xe=Zt.anchor,ge=xe==="end"?-1:1,ye=G(Zt),ue=q(Zt,mt),Mt=ue.x,Ot=ue.y,Lt=xe==="middle",ie="hoverlabel"in Zt.trace?Zt.trace.hoverlabel.showarrow:!0,be;Lt?be="M-"+Rt(Zt.bx/2+Zt.tx2width/2)+","+Bt(Ot-Zt.by/2)+"h"+Rt(Zt.bx)+"v"+Bt(Zt.by)+"h-"+Rt(Zt.bx)+"Z":ie?be="M0,0L"+Rt(ge*p+Mt)+","+Bt(p+Ot)+"v"+Bt(Zt.by/2-p)+"h"+Rt(ge*Zt.bx)+"v-"+Bt(Zt.by)+"H"+Rt(ge*p+Mt)+"V"+Bt(Ot-p)+"Z":be="M"+Rt(ge*p+Mt)+","+Bt(Ot-Zt.by/2)+"h"+Rt(ge*Zt.bx)+"v"+Bt(Zt.by)+"h"+Rt(-ge*Zt.bx)+"Z",Gt.select("path").attr("d",be);var ce=Mt+ye.textShiftX,Le=Ot+Zt.ty0-Zt.by/2+g,Ze=Zt.textAlign||"auto";Ze!=="auto"&&(Ze==="left"&&xe!=="start"?(ee.attr("text-anchor","start"),ce=Lt?-Zt.bx/2-Zt.tx2width/2+g:-Zt.bx-g):Ze==="right"&&xe!=="end"&&(ee.attr("text-anchor","end"),ce=Lt?Zt.bx/2-Zt.tx2width/2-g:Zt.bx+g)),ee.call(l.positionText,Rt(ce),Bt(Le)),Zt.tx2width&&(Gt.select("text.name").call(l.positionText,Rt(ye.text2ShiftX+ye.alignShift*g+Mt),Bt(Ot+Zt.ty0-Zt.by/2+g)),Gt.select("rect").call(c.setRect,Rt(ye.text2ShiftX+(ye.alignShift-1)*Zt.tx2width/2+Mt),Bt(Ot-Zt.by/2-1),Rt(Zt.tx2width),Bt(Zt.by+2)))})}function ht(J,mt){var dt=J.index,Ct=J.trace||{},Rt=J.cd[0],Bt=J.cd[dt]||{};function Zt(ue){return ue||f(ue)&&ue===0}var Gt=Array.isArray(dt)?function(ue,Mt){var Ot=z.castOption(Rt,dt,ue);return Zt(Ot)?Ot:z.extractOption({},Ct,"",Mt)}:function(ue,Mt){return z.extractOption(Bt,Ct,ue,Mt)};function ee(ue,Mt,Ot){var Lt=Gt(Mt,Ot);Zt(Lt)&&(J[ue]=Lt)}if(ee("hoverinfo","hi","hoverinfo"),ee("bgcolor","hbg","hoverlabel.bgcolor"),ee("borderColor","hbc","hoverlabel.bordercolor"),ee("fontFamily","htf","hoverlabel.font.family"),ee("fontSize","hts","hoverlabel.font.size"),ee("fontColor","htc","hoverlabel.font.color"),ee("fontWeight","htw","hoverlabel.font.weight"),ee("fontStyle","hty","hoverlabel.font.style"),ee("fontVariant","htv","hoverlabel.font.variant"),ee("nameLength","hnl","hoverlabel.namelength"),ee("textAlign","hta","hoverlabel.align"),J.posref=mt==="y"||mt==="closest"&&Ct.orientation==="h"?J.xa._offset+(J.x0+J.x1)/2:J.ya._offset+(J.y0+J.y1)/2,J.x0=z.constrain(J.x0,0,J.xa._length),J.x1=z.constrain(J.x1,0,J.xa._length),J.y0=z.constrain(J.y0,0,J.ya._length),J.y1=z.constrain(J.y1,0,J.ya._length),J.xLabelVal!==void 0&&(J.xLabel="xLabel"in J?J.xLabel:m.hoverLabelText(J.xa,J.xLabelVal,Ct.xhoverformat),J.xVal=J.xa.c2d(J.xLabelVal)),J.yLabelVal!==void 0&&(J.yLabel="yLabel"in J?J.yLabel:m.hoverLabelText(J.ya,J.yLabelVal,Ct.yhoverformat),J.yVal=J.ya.c2d(J.yLabelVal)),J.zLabelVal!==void 0&&J.zLabel===void 0&&(J.zLabel=String(J.zLabelVal)),!isNaN(J.xerr)&&!(J.xa.type==="log"&&J.xerr<=0)){var xe=m.tickText(J.xa,J.xa.c2l(J.xerr),"hover").text;J.xerrneg!==void 0?J.xLabel+=" +"+xe+" / -"+m.tickText(J.xa,J.xa.c2l(J.xerrneg),"hover").text:J.xLabel+=" ± "+xe,mt==="x"&&(J.distance+=1)}if(!isNaN(J.yerr)&&!(J.ya.type==="log"&&J.yerr<=0)){var ge=m.tickText(J.ya,J.ya.c2l(J.yerr),"hover").text;J.yerrneg!==void 0?J.yLabel+=" +"+ge+" / -"+m.tickText(J.ya,J.ya.c2l(J.yerrneg),"hover").text:J.yLabel+=" ± "+ge,mt==="y"&&(J.distance+=1)}var ye=J.hoverinfo||J.trace.hoverinfo;return ye&&ye!=="all"&&(ye=Array.isArray(ye)?ye:ye.split("+"),ye.indexOf("x")===-1&&(J.xLabel=void 0),ye.indexOf("y")===-1&&(J.yLabel=void 0),ye.indexOf("z")===-1&&(J.zLabel=void 0),ye.indexOf("text")===-1&&(J.text=void 0),ye.indexOf("name")===-1&&(J.name=void 0)),J}function bt(J,mt,dt){var Ct=dt.container,Rt=dt.fullLayout,Bt=Rt._size,Zt=dt.event,Gt=!!mt.hLinePoint,ee=!!mt.vLinePoint,xe,ge;if(Ct.selectAll(".spikeline").remove(),!!(ee||Gt)){var ye=s.combine(Rt.plot_bgcolor,Rt.paper_bgcolor);if(Gt){var ue=mt.hLinePoint,Mt,Ot;xe=ue&&ue.xa,ge=ue&&ue.ya;var Lt=ge.spikesnap;Lt==="cursor"?(Mt=Zt.pointerX,Ot=Zt.pointerY):(Mt=xe._offset+ue.x,Ot=ge._offset+ue.y);var ie=y.readability(ue.color,ye)<1.5?s.contrast(ye):ue.color,be=ge.spikemode,ce=ge.spikethickness,Le=ge.spikecolor||ie,Ze=m.getPxPosition(J,ge),Qe,mr;if(be.indexOf("toaxis")!==-1||be.indexOf("across")!==-1){if(be.indexOf("toaxis")!==-1&&(Qe=Ze,mr=Mt),be.indexOf("across")!==-1){var fr=ge._counterDomainMin,Jr=ge._counterDomainMax;ge.anchor==="free"&&(fr=Math.min(fr,ge.position),Jr=Math.max(Jr,ge.position)),Qe=Bt.l+fr*Bt.w,mr=Bt.l+Jr*Bt.w}Ct.insert("line",":first-child").attr({x1:Qe,x2:mr,y1:Ot,y2:Ot,"stroke-width":ce,stroke:Le,"stroke-dasharray":c.dashStyle(ge.spikedash,ce)}).classed("spikeline",!0).classed("crisp",!0),Ct.insert("line",":first-child").attr({x1:Qe,x2:mr,y1:Ot,y2:Ot,"stroke-width":ce+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}be.indexOf("marker")!==-1&&Ct.insert("circle",":first-child").attr({cx:Ze+(ge.side!=="right"?ce:-ce),cy:Ot,r:ce,fill:Le}).classed("spikeline",!0)}if(ee){var an=mt.vLinePoint,Er,dn;xe=an&&an.xa,ge=an&&an.ya;var _n=xe.spikesnap;_n==="cursor"?(Er=Zt.pointerX,dn=Zt.pointerY):(Er=xe._offset+an.x,dn=ge._offset+an.y);var Oe=y.readability(an.color,ye)<1.5?s.contrast(ye):an.color,Xt=xe.spikemode,oe=xe.spikethickness,zt=xe.spikecolor||Oe,_t=m.getPxPosition(J,xe),Pt,Ht;if(Xt.indexOf("toaxis")!==-1||Xt.indexOf("across")!==-1){if(Xt.indexOf("toaxis")!==-1&&(Pt=_t,Ht=dn),Xt.indexOf("across")!==-1){var ae=xe._counterDomainMin,he=xe._counterDomainMax;xe.anchor==="free"&&(ae=Math.min(ae,xe.position),he=Math.max(he,xe.position)),Pt=Bt.t+(1-he)*Bt.h,Ht=Bt.t+(1-ae)*Bt.h}Ct.insert("line",":first-child").attr({x1:Er,x2:Er,y1:Pt,y2:Ht,"stroke-width":oe,stroke:zt,"stroke-dasharray":c.dashStyle(xe.spikedash,oe)}).classed("spikeline",!0).classed("crisp",!0),Ct.insert("line",":first-child").attr({x1:Er,x2:Er,y1:Pt,y2:Ht,"stroke-width":oe+2,stroke:ye}).classed("spikeline",!0).classed("crisp",!0)}Xt.indexOf("marker")!==-1&&Ct.insert("circle",":first-child").attr({cx:Er,cy:_t-(xe.side!=="top"?oe:-oe),r:oe,fill:zt}).classed("spikeline",!0)}}}function vt(J,mt,dt){if(!dt||dt.length!==J._hoverdata.length)return!0;for(var Ct=dt.length-1;Ct>=0;Ct--){var Rt=dt[Ct],Bt=J._hoverdata[Ct];if(Rt.curveNumber!==Bt.curveNumber||String(Rt.pointNumber)!==String(Bt.pointNumber)||String(Rt.pointNumbers)!==String(Bt.pointNumbers)||Rt.binNumber!==Bt.binNumber)return!0}return!1}function ut(J,mt){return!0}function rt(J,mt){return l.plainText(J||"",{len:mt,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function gt(J,mt){for(var dt=mt.charAt(0),Ct=[],Rt=[],Bt=[],Zt=0;ZtJ.offsetTop+J.clientTop,xt=J=>J.offsetLeft+J.clientLeft;function ot(J,mt){var dt=J._fullLayout,Ct=mt.getBoundingClientRect(),Rt=Ct.left,Bt=Ct.top,Zt=Rt+Ct.width,Gt=Bt+Ct.height,ee=z.apply3DTransform(dt._invTransform)(Rt,Bt),xe=z.apply3DTransform(dt._invTransform)(Zt,Gt),ge=ee[0],ye=ee[1],ue=xe[0],Mt=xe[1];return{x:ge,y:ye,width:ue-ge,height:Mt-ye,top:Math.min(ye,Mt),left:Math.min(ge,ue),right:Math.max(ge,ue),bottom:Math.max(ye,Mt)}}}),qv=It((et,Y)=>{var f=jn(),y=Hn(),z=T0().isUnifiedHover;Y.exports=function(P,n,i,a){a=a||{};var l=n.legend;function o(c){a.font[c]||(a.font[c]=l?n.legend.font[c]:n.font[c])}n&&z(n.hovermode)&&(a.font||(a.font={}),o("size"),o("family"),o("color"),o("weight"),o("style"),o("variant"),l?(a.bgcolor||(a.bgcolor=y.combine(n.legend.bgcolor,n.paper_bgcolor)),a.bordercolor||(a.bordercolor=n.legend.bordercolor)):a.bgcolor||(a.bgcolor=n.paper_bgcolor)),i("hoverlabel.bgcolor",a.bgcolor),i("hoverlabel.bordercolor",a.bordercolor),i("hoverlabel.namelength",a.namelength),i("hoverlabel.showarrow",a.showarrow),f.coerceFont(i,"hoverlabel.font",a.font),i("hoverlabel.align",a.align)}}),Gv=It((et,Y)=>{var f=jn(),y=qv(),z=Xa();Y.exports=function(P,n){function i(a,l){return f.coerce(P,n,z,a,l)}y(P,n,i)}}),x8=It((et,Y)=>{var f=jn(),y=oo(),z=qv();Y.exports=function(P,n,i,a){function l(c,s){return f.coerce(P,n,y,c,s)}var o=f.extendFlat({},a.hoverlabel);n.hovertemplate&&(o.namelength=-1),z(P,n,l,o)}}),ey=It((et,Y)=>{var f=jn(),y=Xa();Y.exports=function(z,P){function n(i,a){return P[i]!==void 0?P[i]:f.coerce(z,P,y,i,a)}return n("clickmode"),n("hoversubplots"),n("hovermode")}}),hm=It((et,Y)=>{var f=jn(),y=Xa(),z=ey(),P=qv();Y.exports=function(n,i){function a(b,x){return f.coerce(n,i,y,b,x)}var l=z(n,i);l&&(a("hoverdistance"),a("spikedistance"));var o=a("dragmode");o==="select"&&a("selectdirection");var c=i._has("mapbox"),s=i._has("map"),h=i._has("geo"),m=i._basePlotModules.length;i.dragmode==="zoom"&&((c||s||h)&&m===1||(c||s)&&h&&m===2)&&(i.dragmode="pan"),P(n,i,a),f.coerceFont(a,"hoverlabel.grouptitlefont",i.hoverlabel.font)}}),L4=It((et,Y)=>{var f=jn(),y=ls();Y.exports=function(P){var n=P.calcdata,i=P._fullLayout;function a(h){return function(m){return f.coerceHoverinfo({hoverinfo:m},{_module:h._module},i)}}for(var l=0;l{var f=ls(),y=vw().hover;Y.exports=function(z,P,n){var i=f.getComponentMethod("annotations","onClick")(z,z._hoverdata);n!==void 0&&y(z,P,n,!0);function a(){z.emit("plotly_click",{points:z._hoverdata,event:P})}z._hoverdata&&P&&P.target&&(i&&i.then?i.then(a):a(),P.stopImmediatePropagation&&P.stopImmediatePropagation())}}),hd=It((et,Y)=>{var f=Br(),y=jn(),z=Up(),P=T0(),n=Xa(),i=vw();Y.exports={moduleType:"component",name:"fx",constants:na(),schema:{layout:n},attributes:oo(),layoutAttributes:n,supplyLayoutGlobalDefaults:Gv(),supplyDefaults:x8(),supplyLayoutDefaults:hm(),calc:L4(),getDistanceFunction:P.getDistanceFunction,getClosest:P.getClosest,inbox:P.inbox,quadrature:P.quadrature,appendArrayPointValue:P.appendArrayPointValue,castHoverOption:l,castHoverinfo:o,hover:i.hover,unhover:z.unhover,loneHover:i.loneHover,loneUnhover:a,click:P4()};function a(c){var s=y.isD3Selection(c)?c:f.select(c);s.selectAll("g.hovertext").remove(),s.selectAll(".spikeline").remove()}function l(c,s,h){return y.castOption(c,s,"hoverlabel."+h)}function o(c,s,h){function m(b){return y.coerceHoverinfo({hoverinfo:b},{_module:c._module},s)}return y.castOption(c,h,"hoverinfo",m)}}),dm=It(et=>{et.selectMode=function(Y){return Y==="lasso"||Y==="select"},et.drawMode=function(Y){return Y==="drawclosedpath"||Y==="drawopenpath"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},et.openMode=function(Y){return Y==="drawline"||Y==="drawopenpath"},et.rectMode=function(Y){return Y==="select"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},et.freeMode=function(Y){return Y==="lasso"||Y==="drawclosedpath"||Y==="drawopenpath"},et.selectingOrDrawing=function(Y){return et.freeMode(Y)||et.rectMode(Y)}}),ry=It((et,Y)=>{Y.exports=function(f){var y=f._fullLayout;y._glcanvas&&y._glcanvas.size()&&y._glcanvas.each(function(z){z.regl&&z.regl.clear({color:!0,depth:!0})})}}),yw=It((et,Y)=>{Y.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:[""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}),_w=It((et,Y)=>{var f=32;Y.exports={CIRCLE_SIDES:f,i000:0,i090:f/4,i180:f/2,i270:f/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),nb=It((et,Y)=>{var f=jn().strTranslate;function y(i,a){switch(i.type){case"log":return i.p2d(a);case"date":return i.p2r(a,0,i.calendar);default:return i.p2r(a)}}function z(i,a){switch(i.type){case"log":return i.d2p(a);case"date":return i.r2p(a,0,i.calendar);default:return i.r2p(a)}}function P(i){var a=i._id.charAt(0)==="y"?1:0;return function(l){return y(i,l[a])}}function n(i){return f(i.xaxis._offset,i.yaxis._offset)}Y.exports={p2r:y,r2p:z,axValue:P,getTransform:n}}),Zv=It(et=>{var Y=E_(),f=_w(),y=f.CIRCLE_SIDES,z=f.SQRT2,P=nb(),n=P.p2r,i=P.r2p,a=[0,3,4,5,6,1,2],l=[0,3,4,1,2];et.writePaths=function(s){var h=s.length;if(!h)return"M0,0Z";for(var m="",b=0;b0&&k{var f=Ku(),y=dm(),z=y.drawMode,P=y.openMode,n=_w(),i=n.i000,a=n.i090,l=n.i180,o=n.i270,c=n.cos45,s=n.sin45,h=nb(),m=h.p2r,b=h.r2p,x=Cm(),_=x.clearOutline,A=Zv(),d=A.readPaths,k=A.writePaths,w=A.ellipseOver,D=A.fixDatesForPaths;function E(M,p){if(M.length){var g=M[0][0];if(g){var C=p.gd,S=p.isActiveShape,N=p.dragmode,B=(C.layout||{}).shapes||[];if(!z(N)&&S!==void 0){var U=C._fullLayout._activeShapeIndex;if(U{var f=dm(),y=f.selectMode,z=Cm(),P=z.clearOutline,n=Zv(),i=n.readPaths,a=n.writePaths,l=n.fixDatesForPaths;Y.exports=function(o,c){if(o.length){var s=o[0][0];if(s){var h=s.getAttribute("d"),m=c.gd,b=m._fullLayout.newselection,x=c.plotinfo,_=x.xaxis,A=x.yaxis,d=c.isActiveSelection,k=c.dragmode,w=(m.layout||{}).selections||[];if(!y(k)&&d!==void 0){var D=m._fullLayout._activeSelectionIndex;if(D{Y.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),l0=It(et=>{var Y=ib(),f=jn(),y=Fs();et.rangeToShapePosition=function(n){return n.type==="log"?n.r2d:function(i){return i}},et.shapePositionToRange=function(n){return n.type==="log"?n.d2r:function(i){return i}},et.decodeDate=function(n){return function(i){return i.replace&&(i=i.replace("_"," ")),n(i)}},et.encodeDate=function(n){return function(i){return n(i).replace(" ","_")}},et.extractPathCoords=function(n,i,a){var l=[],o=n.match(Y.segmentRE);return o.forEach(function(c){var s=i[c.charAt(0)].drawn;if(s!==void 0){var h=c.substr(1).match(Y.paramRE);if(!(!h||h.lengthd&&(w="X"),w});return b>d&&(k=k.replace(/[\s,]*X.*/,""),f.log("Ignoring extra params in segment "+m)),x+k})}function P(n,i){i=i||0;var a=0;return i&&n&&(n.type==="category"||n.type==="multicategory")&&(a=(n.r2p(1)-n.r2p(0))*i),a}}),I4=It((et,Y)=>{var f=jn(),y=Fs(),z=uu(),P=Js(),n=Zv().readPaths,i=l0(),a=i.getPathString,l=w_(),o=Rd().FROM_TL;Y.exports=function(h,m,b,x){if(x.selectAll(".shape-label").remove(),!!(b.label.text||b.label.texttemplate)){var _;if(b.label.texttemplate){var A={};if(b.type!=="path"){var d=y.getFromId(h,b.xref),k=y.getFromId(h,b.yref);for(var w in l){var D=l[w](b,d,k);D!==void 0&&(A[w]=D)}}_=f.texttemplateStringForShapes({data:[A],fallback:b.label.texttemplatefallback,locale:h._fullLayout._d3locale,template:b.label.texttemplate})}else _=b.label.text;var E={"data-index":m},I=b.label.font,M={"data-notex":1},p=x.append("g").attr(E).classed("shape-label",!0),g=p.append("text").attr(M).classed("shape-label-text",!0).text(_),C,S,N,B;if(b.path){var U=a(h,b),V=n(U,h);C=1/0,N=1/0,S=-1/0,B=-1/0;for(var W=0;W=h?_=m-x:_=x-m,-180/Math.PI*Math.atan2(_,A)}function s(h,m,b,x,_,A,d){var k=_.label.textposition,w=_.label.textangle,D=_.label.padding,E=_.type,I=Math.PI/180*A,M=Math.sin(I),p=Math.cos(I),g=_.label.xanchor,C=_.label.yanchor,S,N,B,U;if(E==="line"){k==="start"?(S=h,N=m):k==="end"?(S=b,N=x):(S=(h+b)/2,N=(m+x)/2),g==="auto"&&(k==="start"?w==="auto"?b>h?g="left":bh?g="right":bh?g="right":bh?g="left":b{var f=jn(),y=f.strTranslate,z=Up(),P=dm(),n=P.drawMode,i=P.selectMode,a=ls(),l=Hn(),o=_w(),c=o.i000,s=o.i090,h=o.i180,m=o.i270,b=Cm(),x=b.clearOutlineControllers,_=Zv(),A=_.pointsOnRectangle,d=_.pointsOnEllipse,k=_.writePaths,w=Z0().newShapes,D=Z0().createShapeObj,E=Kv(),I=I4();Y.exports=function C(S,N,B,U){U||(U=0);var V=B.gd;function W(){C(S,N,B,U++),(d(S[0])||B.hasText)&&F({redrawing:!0})}function F(ye){var ue={};B.isActiveShape!==void 0&&(B.isActiveShape=!1,ue=w(N,B)),B.isActiveSelection!==void 0&&(B.isActiveSelection=!1,ue=E(N,B),V._fullLayout._reselect=!0),Object.keys(ue).length&&a.call((ye||{}).redrawing?"relayout":"_guiRelayout",V,ue)}var H=V._fullLayout,q=H._zoomlayer,G=B.dragmode,tt=n(G),ht=i(G);(tt||ht)&&(V._fullLayout._outlining=!0),x(V),N.attr("d",k(S));var bt,vt,ut,rt,gt;if(!U&&(B.isActiveShape||B.isActiveSelection)){gt=M([],S);var it=q.append("g").attr("class","outline-controllers");Rt(it),ge()}if(tt&&B.hasText){var st=q.select(".label-temp"),xt=D(N,B,B.dragmode);I(V,"label-temp",xt,st)}function ot(ye){ut=+ye.srcElement.getAttribute("data-i"),rt=+ye.srcElement.getAttribute("data-j"),bt[ut][rt].moveFn=J}function J(ye,ue){if(S.length){var Mt=gt[ut][rt][1],Ot=gt[ut][rt][2],Lt=S[ut],ie=Lt.length;if(A(Lt)){var be=ye,ce=ue;if(B.isActiveSelection){var Le=p(Lt,rt);Le[1]===Lt[rt][1]?ce=0:be=0}for(var Ze=0;Ze1&&!(ye.length===2&&ye[1][0]==="Z")&&(rt===0&&(ye[0][0]="M"),S[ut]=ye,W(),F())}}function Ct(ye,ue){if(ye===2){ut=+ue.srcElement.getAttribute("data-i"),rt=+ue.srcElement.getAttribute("data-j");var Mt=S[ut];!A(Mt)&&!d(Mt)&&dt()}}function Rt(ye){bt=[];for(var ue=0;ue{var f=Br(),y=ls(),z=jn(),P=Fs(),n=Zv().readPaths,i=Kg(),a=I4(),l=Cm().clearOutlineControllers,o=Hn(),c=Js(),s=Tc().arrayEditor,h=Up(),m=Mm(),b=ib(),x=l0(),_=x.getPathString;Y.exports={draw:A,drawOne:w,eraseActiveShape:g,drawLabel:a};function A(C){var S=C._fullLayout;S._shapeUpperLayer.selectAll("path").remove(),S._shapeLowerLayer.selectAll("path").remove(),S._shapeUpperLayer.selectAll("text").remove(),S._shapeLowerLayer.selectAll("text").remove();for(var N in S._plots){var B=S._plots[N].shapelayer;B&&(B.selectAll("path").remove(),B.selectAll("text").remove())}for(var U=0;UW&&ae>F&&!_t.shiftKey?h.getCursor(he/Ht,1-Me/ae):"move";m(S,qe),Qe=qe.split("-")[0]}}function an(_t){d(C)||(H&&(gt=Lt(N.xanchor)),q&&(it=ie(N.yanchor)),N.type==="path"?Bt=N.path:(bt=H?N.x0:Lt(N.x0),vt=q?N.y0:ie(N.y0),ut=H?N.x1:Lt(N.x1),rt=q?N.y1:ie(N.y1)),btrt?(st=vt,mt="y0",xt=rt,dt="y1"):(st=rt,mt="y1",xt=vt,dt="y0"),Jr(_t),Xt(U,N),zt(S,N,C),Ze.moveFn=Qe==="move"?_n:Oe,Ze.altKey=_t.altKey)}function Er(){d(C)||(m(S),oe(U),D(S,C,N),y.call("_guiRelayout",C,V.getUpdateObj()))}function dn(){d(C)||oe(U)}function _n(_t,Pt){if(N.type==="path"){var Ht=function(Me){return Me},ae=Ht,he=Ht;H?ht("xanchor",N.xanchor=be(gt+_t)):(ae=function(Me){return be(Lt(Me)+_t)},Gt&&Gt.type==="date"&&(ae=x.encodeDate(ae))),q?ht("yanchor",N.yanchor=ce(it+Pt)):(he=function(Me){return ce(ie(Me)+Pt)},xe&&xe.type==="date"&&(he=x.encodeDate(he))),ht("path",N.path=I(Bt,ae,he))}else H?ht("xanchor",N.xanchor=be(gt+_t)):(ht("x0",N.x0=be(bt+_t)),ht("x1",N.x1=be(ut+_t))),q?ht("yanchor",N.yanchor=ce(it+Pt)):(ht("y0",N.y0=ce(vt+Pt)),ht("y1",N.y1=ce(rt+Pt)));S.attr("d",_(C,N)),Xt(U,N),a(C,B,N,Zt)}function Oe(_t,Pt){if(tt){var Ht=function(fi){return fi},ae=Ht,he=Ht;H?ht("xanchor",N.xanchor=be(gt+_t)):(ae=function(fi){return be(Lt(fi)+_t)},Gt&&Gt.type==="date"&&(ae=x.encodeDate(ae))),q?ht("yanchor",N.yanchor=ce(it+Pt)):(he=function(fi){return ce(ie(fi)+Pt)},xe&&xe.type==="date"&&(he=x.encodeDate(he))),ht("path",N.path=I(Bt,ae,he))}else if(G){if(Qe==="resize-over-start-point"){var Me=bt+_t,qe=q?vt-Pt:vt+Pt;ht("x0",N.x0=H?Me:be(Me)),ht("y0",N.y0=q?qe:ce(qe))}else if(Qe==="resize-over-end-point"){var Ye=ut+_t,ur=q?rt-Pt:rt+Pt;ht("x1",N.x1=H?Ye:be(Ye)),ht("y1",N.y1=q?ur:ce(ur))}}else{var Rr=function(fi){return Qe.indexOf(fi)!==-1},zr=Rr("n"),xr=Rr("s"),pn=Rr("w"),ci=Rr("e"),ui=zr?st+Pt:st,yi=xr?xt+Pt:xt,Gi=pn?ot+_t:ot,Ci=ci?J+_t:J;q&&(zr&&(ui=st-Pt),xr&&(yi=xt-Pt)),(!q&&yi-ui>F||q&&ui-yi>F)&&(ht(mt,N[mt]=q?ui:ce(ui)),ht(dt,N[dt]=q?yi:ce(yi))),Ci-Gi>W&&(ht(Ct,N[Ct]=H?Gi:be(Gi)),ht(Rt,N[Rt]=H?Ci:be(Ci)))}S.attr("d",_(C,N)),Xt(U,N),a(C,B,N,Zt)}function Xt(_t,Pt){(H||q)&&Ht();function Ht(){var ae=Pt.type!=="path",he=_t.selectAll(".visual-cue").data([0]),Me=1;he.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Me}).classed("visual-cue",!0);var qe=Lt(H?Pt.xanchor:z.midRange(ae?[Pt.x0,Pt.x1]:x.extractPathCoords(Pt.path,b.paramIsX))),Ye=ie(q?Pt.yanchor:z.midRange(ae?[Pt.y0,Pt.y1]:x.extractPathCoords(Pt.path,b.paramIsY)));if(qe=x.roundPositionForSharpStrokeRendering(qe,Me),Ye=x.roundPositionForSharpStrokeRendering(Ye,Me),H&&q){var ur="M"+(qe-1-Me)+","+(Ye-1-Me)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";he.attr("d",ur)}else if(H){var Rr="M"+(qe-1-Me)+","+(Ye-9-Me)+"v18 h2 v-18 Z";he.attr("d",Rr)}else{var zr="M"+(qe-9-Me)+","+(Ye-1-Me)+"h18 v2 h-18 Z";he.attr("d",zr)}}}function oe(_t){_t.selectAll(".visual-cue").remove()}function zt(_t,Pt,Ht){var ae=Pt.xref,he=Pt.yref,Me=P.getFromId(Ht,ae),qe=P.getFromId(Ht,he),Ye="";ae!=="paper"&&!Me.autorange&&(Ye+=ae),he!=="paper"&&!qe.autorange&&(Ye+=he),c.setClipUrl(_t,Ye?"clip"+Ht._fullLayout._uid+Ye:null,Ht)}}function I(C,S,N){return C.replace(b.segmentRE,function(B){var U=0,V=B.charAt(0),W=b.paramIsX[V],F=b.paramIsY[V],H=b.numParams[V],q=B.substr(1).replace(b.paramRE,function(G){return U>=H||(W[U]?G=S(G):F[U]&&(G=N(G)),U++),G});return V+q})}function M(C,S){if(k(C)){var N=S.node(),B=+N.getAttribute("data-index");if(B>=0){if(B===C._fullLayout._activeShapeIndex){p(C);return}C._fullLayout._activeShapeIndex=B,C._fullLayout._deactivateShape=p,A(C)}}}function p(C){if(k(C)){var S=C._fullLayout._activeShapeIndex;S>=0&&(l(C),delete C._fullLayout._activeShapeIndex,A(C))}}function g(C){if(k(C)){l(C);var S=C._fullLayout._activeShapeIndex,N=(C.layout||{}).shapes||[];if(S{var f=ls(),y=lh(),z=Ku(),P=yw(),n=xw().eraseActiveShape,i=jn(),a=i._,l=Y.exports={};l.toImage={name:"toImage",title:function(E){var I=E._context.toImageButtonOptions||{},M=I.format||"png";return M==="png"?a(E,"Download plot as a PNG"):a(E,"Download plot")},icon:P.camera,click:function(E){var I=E._context.toImageButtonOptions,M={format:I.format||"png"};i.notifier(a(E,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(p){p in I&&(M[p]=I[p])}),f.call("downloadImage",E,M).then(function(p){i.notifier(a(E,"Snapshot succeeded")+" - "+p,"long")}).catch(function(){i.notifier(a(E,"Sorry, there was a problem downloading your snapshot!"),"long")})}},l.sendDataToCloud={name:"sendDataToCloud",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.disk,click:function(E){y.sendDataToCloud(E)}},l.editInChartStudio={name:"editInChartStudio",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.pencil,click:function(E){y.sendDataToCloud(E)}},l.zoom2d={name:"zoom2d",_cat:"zoom",title:function(E){return a(E,"Zoom")},attr:"dragmode",val:"zoom",icon:P.zoombox,click:o},l.pan2d={name:"pan2d",_cat:"pan",title:function(E){return a(E,"Pan")},attr:"dragmode",val:"pan",icon:P.pan,click:o},l.select2d={name:"select2d",_cat:"select",title:function(E){return a(E,"Box Select")},attr:"dragmode",val:"select",icon:P.selectbox,click:o},l.lasso2d={name:"lasso2d",_cat:"lasso",title:function(E){return a(E,"Lasso Select")},attr:"dragmode",val:"lasso",icon:P.lasso,click:o},l.drawclosedpath={name:"drawclosedpath",title:function(E){return a(E,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:P.drawclosedpath,click:o},l.drawopenpath={name:"drawopenpath",title:function(E){return a(E,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:P.drawopenpath,click:o},l.drawline={name:"drawline",title:function(E){return a(E,"Draw line")},attr:"dragmode",val:"drawline",icon:P.drawline,click:o},l.drawrect={name:"drawrect",title:function(E){return a(E,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:P.drawrect,click:o},l.drawcircle={name:"drawcircle",title:function(E){return a(E,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:P.drawcircle,click:o},l.eraseshape={name:"eraseshape",title:function(E){return a(E,"Erase active shape")},icon:P.eraseshape,click:n},l.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(E){return a(E,"Zoom in")},attr:"zoom",val:"in",icon:P.zoom_plus,click:o},l.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(E){return a(E,"Zoom out")},attr:"zoom",val:"out",icon:P.zoom_minus,click:o},l.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(E){return a(E,"Autoscale")},attr:"zoom",val:"auto",icon:P.autoscale,click:o},l.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(E){return a(E,"Reset axes")},attr:"zoom",val:"reset",icon:P.home,click:o},l.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(E){return a(E,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:P.tooltip_basic,gravity:"ne",click:o},l.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(E){return a(E,"Compare data on hover")},attr:"hovermode",val:function(E){return E._fullLayout._isHoriz?"y":"x"},icon:P.tooltip_compare,gravity:"ne",click:o};function o(E,I){var M=I.currentTarget,p=M.getAttribute("data-attr"),g=M.getAttribute("data-val")||!0,C=E._fullLayout,S={},N=z.list(E,null,!0),B=C._cartesianSpikesEnabled,U,V;if(p==="zoom"){var W=g==="in"?.5:2,F=(1+W)/2,H=(1-W)/2,q,G;for(V=0;V{var f=ny(),y=Object.keys(f),z=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],P=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(z),n=[],i=function(a){if(P.indexOf(a._cat||a.name)===-1){var l=a.name,o=(a._cat||a.name).toLowerCase();n.indexOf(l)===-1&&n.push(l),n.indexOf(o)===-1&&n.push(o)}};y.forEach(function(a){i(f[a])}),n.sort(),Y.exports={DRAW_MODES:z,backButtons:P,foreButtons:n}}),L_=It((et,Y)=>{bw(),Y.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}),b8=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=L_();Y.exports=function(n,i){var a=n.modebar||{},l=z.newContainer(i,"modebar");function o(s,h){return f.coerce(a,l,P,s,h)}o("orientation"),o("bgcolor",y.addOpacity(i.paper_bgcolor,.5));var c=y.contrast(y.rgb(i.modebar.bgcolor));o("color",y.addOpacity(c,.3)),o("activecolor",y.addOpacity(c,.7)),o("uirevision",i.uirevision),o("add"),o("remove")}}),Yg=It((et,Y)=>{var f=Br(),y=Sr(),z=jn(),P=yw(),n=Dn().version,i=new DOMParser;function a(s){this.container=s.container,this.element=document.createElement("div"),this.update(s.graphInfo,s.buttons),this.container.appendChild(this.element)}var l=a.prototype;l.update=function(s,h){this.graphInfo=s;var m=this.graphInfo._context,b=this.graphInfo._fullLayout,x="modebar-"+b._uid;this.element.setAttribute("id",x),this.element.setAttribute("role","toolbar"),this._uid=x,this.element.className="modebar modebar--custom",m.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),b.modebar.orientation==="v"&&(this.element.className+=" vertical",h=h.reverse());var _=b.modebar,A="#"+x+" .modebar-group";document.querySelectorAll(A).forEach(function(E){E.style.backgroundColor=_.bgcolor});var d=!this.hasButtons(h),k=this.hasLogo!==m.displaylogo,w=this.locale!==m.locale;if(this.locale=m.locale,(d||k||w)&&(this.removeAllButtons(),this.updateButtons(h),m.watermark||m.displaylogo)){var D=this.getLogo();m.watermark&&(D.className=D.className+" watermark"),b.modebar.orientation==="v"?this.element.insertBefore(D,this.element.childNodes[0]):this.element.appendChild(D),this.hasLogo=!0}this.updateActiveButton(),z.setStyleOnHover("#"+x+" .modebar-btn",".active",".icon path","fill: "+_.activecolor,"fill: "+_.color,this.element)},l.updateButtons=function(s){var h=this;this.buttons=s,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(m){var b=h.createGroup();m.forEach(function(x){var _=x.name;if(!_)throw new Error("must provide button 'name' in button config");if(h.buttonsNames.indexOf(_)!==-1)throw new Error("button name '"+_+"' is taken");h.buttonsNames.push(_);var A=h.createButton(x);h.buttonElements.push(A),b.appendChild(A)}),h.element.appendChild(b)})},l.createGroup=function(){var s=document.createElement("div");s.className="modebar-group";var h=this.graphInfo._fullLayout.modebar;return s.style.backgroundColor=h.bgcolor,s},l.createButton=function(s){var h=this,m=document.createElement("button");m.setAttribute("type","button"),m.setAttribute("rel","tooltip"),m.className="modebar-btn";var b=s.title;b===void 0?b=s.name:typeof b=="function"&&(b=b(this.graphInfo)),(b||b===0)&&(m.setAttribute("data-title",b),m.setAttribute("aria-label",b)),s.attr!==void 0&&m.setAttribute("data-attr",s.attr);var x=s.val;x!==void 0&&(typeof x=="function"&&(x=x(this.graphInfo)),m.setAttribute("data-val",x));var _=s.click;if(typeof _!="function")throw new Error("must provide button 'click' function in button config");m.addEventListener("click",function(d){s.click(h.graphInfo,d),h.updateActiveButton(d.currentTarget)}),m.setAttribute("data-toggle",s.toggle||!1),s.toggle&&f.select(m).classed("active",!0);var A=s.icon;return typeof A=="function"?m.appendChild(A()):m.appendChild(this.createIcon(A||P.question)),m.setAttribute("data-gravity",s.gravity||"n"),m},l.createIcon=function(s){var h=y(s.height)?Number(s.height):s.ascent-s.descent,m="http://www.w3.org/2000/svg",b;if(s.path){b=document.createElementNS(m,"svg"),b.setAttribute("viewBox",[0,0,s.width,h].join(" ")),b.setAttribute("class","icon");var x=document.createElementNS(m,"path");x.setAttribute("d",s.path),s.transform?x.setAttribute("transform",s.transform):s.ascent!==void 0&&x.setAttribute("transform","matrix(1 0 0 -1 0 "+s.ascent+")"),b.appendChild(x)}if(s.svg){var _=i.parseFromString(s.svg,"application/xml");b=_.childNodes[0]}return b.setAttribute("height","1em"),b.setAttribute("width","1em"),b},l.updateActiveButton=function(s){var h=this.graphInfo._fullLayout,m=s!==void 0?s.getAttribute("data-attr"):null;this.buttonElements.forEach(function(b){var x=b.getAttribute("data-val")||!0,_=b.getAttribute("data-attr"),A=b.getAttribute("data-toggle")==="true",d=f.select(b),k=function(E,I){var M=h.modebar,p=E.querySelector(".icon path");p&&(I||E.matches(":hover")?p.style.fill=M.activecolor:p.style.fill=M.color)};if(A){if(_===m){var w=!d.classed("active");d.classed("active",w),k(b,w)}}else{var D=_===null?_:z.nestedProperty(h,_).get();d.classed("active",D===x),k(b,D===x)}})},l.hasButtons=function(s){var h=this.buttons;if(!h||s.length!==h.length)return!1;for(var m=0;m{var f=Ku(),y=Fu(),z=ls(),P=T0().isUnifiedHover,n=Yg(),i=ny(),a=bw().DRAW_MODES,l=jn().extendDeep;Y.exports=function(x){var _=x._fullLayout,A=x._context,d=_._modeBar;if(!A.displayModeBar&&!A.watermark){d&&(d.destroy(),delete _._modeBar);return}if(!Array.isArray(A.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(A.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var k=A.modeBarButtons,w;Array.isArray(k)&&k.length?w=b(k):!A.displayModeBar&&A.watermark?w=[]:w=o(x),d?d.update(x,w):_._modeBar=n(x,w)};function o(x){var _=x._fullLayout,A=x._fullData,d=x._context;function k(J,mt){if(typeof mt=="string"){if(mt.toLowerCase()===J.toLowerCase())return!0}else{var dt=mt.name,Ct=mt._cat||mt.name;if(dt===J||Ct===J.toLowerCase())return!0}return!1}var w=_.modebar.add;typeof w=="string"&&(w=[w]);var D=_.modebar.remove;typeof D=="string"&&(D=[D]);var E=d.modeBarButtonsToAdd.concat(w.filter(function(J){for(var mt=0;mt1?(vt=["toggleHover"],ut=["resetViews"]):g?(bt=["zoomInGeo","zoomOutGeo"],vt=["hoverClosestGeo"],ut=["resetGeo"]):p?(vt=["hoverClosest3d"],ut=["resetCameraDefault3d","resetCameraLastSave3d"]):B?(bt=["zoomInMapbox","zoomOutMapbox"],vt=["toggleHover"],ut=["resetViewMapbox"]):U?(bt=["zoomInMap","zoomOutMap"],vt=["toggleHover"],ut=["resetViewMap"]):C?vt=["hoverClosestPie"]:F?(vt=["hoverClosestCartesian","hoverCompareCartesian"],ut=["resetViewSankey"]):vt=["toggleHover"],M&&vt.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(h(A)||q)&&(vt=[]),M&&!H&&(bt=["zoomIn2d","zoomOut2d","autoScale2d"],ut[0]!=="resetViews"&&(ut=["resetScale2d"])),p?rt=["zoom3d","pan3d","orbitRotation","tableRotation"]:M&&!H||N?rt=["zoom2d","pan2d"]:B||U||g?rt=["pan2d"]:V&&(rt=["zoom2d"]),s(A)&&rt.push("select2d","lasso2d");var gt=[],it=function(J){gt.indexOf(J)===-1&&vt.indexOf(J)!==-1&>.push(J)};if(Array.isArray(E)){for(var st=[],xt=0;xt{Y.exports={moduleType:"component",name:"modebar",layoutAttributes:L_(),supplyLayoutDefaults:b8(),manage:ab()}}),ob=It((et,Y)=>{var f=Rd().FROM_BL;Y.exports=function(y,z,P){P===void 0&&(P=f[y.constraintoward||"center"]);var n=[y.r2l(y.range[0]),y.r2l(y.range[1])],i=n[0]+(n[1]-n[0])*P;y.range=y._input.range=[y.l2r(i+(n[0]-i)*z),y.l2r(i+(n[1]-i)*z)],y.setScale()}}),iy=It(et=>{var Y=jn(),f=Jm(),y=Ku().id2name,z=Gf(),P=ob(),n=G0(),i=Dr().ALMOST_EQUAL,a=Rd().FROM_BL;et.handleDefaults=function(x,_,A){var d=A.axIds,k=A.axHasImage,w=_._axisConstraintGroups=[],D=_._axisMatchGroups=[],E,I,M,p,g,C,S,N;for(E=0;Ew?A.substr(w):d.substr(k))+D}function m(x,_){for(var A=_._size,d=A.h/A.w,k={},w=Object.keys(x),D=0;Di*S&&!V)){for(k=0;kut&&mtbt&&(bt=mt);var Ct=(bt-ht)/(2*vt);p/=Ct,ht=E.l2r(ht),bt=E.l2r(bt),E.range=E._input.range=q{var Y=Br(),f=ls(),y=lh(),z=jn(),P=uu(),n=ry(),i=Hn(),a=Js(),l=jp(),o=D4(),c=Fs(),s=Rd(),h=iy(),m=h.enforce,b=h.clean,x=Jm().doAutoRange,_="start",A="middle",d="end",k=fu().zindexSeparator;et.layoutStyles=function(F){return z.syncOrAsync([y.doAutoMargin,D],F)};function w(F,H,q){for(var G=0;G=F[1]||tt[1]<=F[0])&&ht[0]H[0])return!0}return!1}function D(F){var H=F._fullLayout,q=H._size,G=q.p,tt=c.list(F,"",!0),ht,bt,vt,ut,rt,gt;if(H._paperdiv.style({width:F._context.responsive&&H.autosize&&!F._context._hasZeroWidth&&!F.layout.width?"100%":H.width+"px",height:F._context.responsive&&H.autosize&&!F._context._hasZeroHeight&&!F.layout.height?"100%":H.height+"px"}).selectAll(".main-svg").call(a.setSize,H.width,H.height),F._context.setBackground(F,H.paper_bgcolor),et.drawMainTitle(F),o.manage(F),!H._has("cartesian"))return y.previousPromises(F);function it(zt,_t,Pt){var Ht=zt._lw/2;if(zt._id.charAt(0)==="x"){if(_t){if(Pt==="top")return _t._offset-G-Ht}else return q.t+q.h*(1-(zt.position||0))+Ht%1;return _t._offset+_t._length+G+Ht}if(_t){if(Pt==="right")return _t._offset+_t._length+G+Ht}else return q.l+q.w*(zt.position||0)+Ht%1;return _t._offset-G-Ht}for(ht=0;ht0){S(F,ht,rt,ut),vt.attr({x:bt,y:ht,"text-anchor":G,dy:U(H.yanchor)}).call(P.positionText,bt,ht);var gt=(H.text.match(P.BR_TAG_ALL)||[]).length;if(gt){var it=s.LINE_SPACING*gt+s.MID_SHIFT;H.y===0&&(it=-it),vt.selectAll(".line").each(function(){var mt=+this.getAttribute("dy").slice(0,-2)-it+"em";this.setAttribute("dy",mt)})}var st=Y.select(F).selectAll(".gtitle-subtitle");if(st.node()){var xt=vt.node().getBBox(),ot=xt.y+xt.height,J=ot+l.SUBTITLE_PADDING_EM*H.subtitle.font.size;st.attr({x:bt,y:J,"text-anchor":G,dy:U(H.yanchor)}).call(P.positionText,bt,J)}}}};function p(F,H,q,G,tt){var ht=H.yref==="paper"?F._fullLayout._size.h:F._fullLayout.height,bt=z.isTopAnchor(H)?G:G-tt,vt=q==="b"?ht-bt:bt;return z.isTopAnchor(H)&&q==="t"||z.isBottomAnchor(H)&&q==="b"?!1:vt.5?"t":"b",bt=F._fullLayout.margin[ht],vt=0;return H.yref==="paper"?vt=q+H.pad.t+H.pad.b:H.yref==="container"&&(vt=g(ht,G,tt,F._fullLayout.height,q)+H.pad.t+H.pad.b),vt>bt?vt:0}function S(F,H,q,G){var tt="title.automargin",ht=F._fullLayout.title,bt=ht.y>.5?"t":"b",vt={x:ht.x,y:ht.y,t:0,b:0},ut={};ht.yref==="paper"&&p(F,ht,bt,H,G)?vt[bt]=q:ht.yref==="container"&&(ut[bt]=q,F._fullLayout._reservedMargin[tt]=ut),y.allowAutoMargin(F,tt),y.autoMargin(F,tt,vt)}function N(F,H){var q=F.title,G=F._size,tt=0;switch(H===_?tt=q.pad.l:H===d&&(tt=-q.pad.r),q.xref){case"paper":return G.l+G.w*q.x+tt;case"container":default:return F.width*q.x+tt}}function B(F,H){var q=F.title,G=F._size,tt=0;if(H==="0em"||!H?tt=-q.pad.b:H===s.CAP_SHIFT+"em"&&(tt=q.pad.t),q.y==="auto")return G.t/2;switch(q.yref){case"paper":return G.t+G.h-G.h*q.y+tt;case"container":default:return F.height-F.height*q.y+tt}}function U(F){return F==="top"?s.CAP_SHIFT+.3+"em":F==="bottom"?"-0.3em":s.MID_SHIFT+"em"}function V(F){var H=F.title,q=A;return z.isRightAnchor(H)?q=d:z.isLeftAnchor(H)&&(q=_),q}function W(F){var H=F.title,q="0em";return z.isTopAnchor(H)?q=s.CAP_SHIFT+"em":z.isMiddleAnchor(H)&&(q=s.MID_SHIFT+"em"),q}et.doTraceStyle=function(F){var H=F.calcdata,q=[],G;for(G=0;G{var f=Zv().readPaths,y=Kg(),z=Cm().clearOutlineControllers,P=Hn(),n=Js(),i=Tc().arrayEditor,a=l0(),l=a.getPathString;Y.exports={draw:o,drawOne:s,activateLastSelection:b};function o(_){var A=_._fullLayout;z(_),A._selectionLayer.selectAll("path").remove();for(var d in A._plots){var k=A._plots[d].selectionLayer;k&&k.selectAll("path").remove()}for(var w=0;w=0;V--){var W=E.append("path").attr(M).style("opacity",V?.1:p).call(P.stroke,C).call(P.fill,g).call(n.dashLine,V?"solid":N,V?4+S:S);if(h(W,_,k),B){var F=i(_.layout,"selections",k);W.style({cursor:"move"});var H={element:W.node(),plotinfo:w,gd:_,editHelpers:F,isActiveSelection:!0},q=f(I,_);y(q,W,H)}else W.style("pointer-events",V?"all":"none");U[V]=W}var G=U[0],tt=U[1];tt.node().addEventListener("click",function(){return m(_,G)})}}function h(_,A,d){var k=d.xref+d.yref;n.setClipUrl(_,"clip"+A._fullLayout._uid+k,A)}function m(_,A){if(c(_)){var d=A.node(),k=+d.getAttribute("data-index");if(k>=0){if(k===_._fullLayout._activeSelectionIndex){x(_);return}_._fullLayout._activeSelectionIndex=k,_._fullLayout._deactivateSelection=x,o(_)}}}function b(_){if(c(_)){var A=_._fullLayout.selections.length-1;_._fullLayout._activeSelectionIndex=A,_._fullLayout._deactivateSelection=x,o(_)}}function x(_){if(c(_)){var A=_._fullLayout._activeSelectionIndex;A>=0&&(z(_),delete _._fullLayout._activeSelectionIndex,o(_))}}}),ay=It((et,Y)=>{function f(){var y,z=0,P=!1;function n(i,a){return y.list.push({type:i,data:a?JSON.parse(JSON.stringify(a)):void 0}),y}return y={list:[],segmentId:function(){return z++},checkIntersection:function(i,a){return n("check",{seg1:i,seg2:a})},segmentChop:function(i,a){return n("div_seg",{seg:i,pt:a}),n("chop",{seg:i,pt:a})},statusRemove:function(i){return n("pop_seg",{seg:i})},segmentUpdate:function(i){return n("seg_update",{seg:i})},segmentNew:function(i,a){return n("new_seg",{seg:i,primary:a})},segmentRemove:function(i){return n("rem_seg",{seg:i})},tempStatus:function(i,a,l){return n("temp_status",{seg:i,above:a,below:l})},rewind:function(i){return n("rewind",{seg:i})},status:function(i,a,l){return n("status",{seg:i,above:a,below:l})},vert:function(i){return i===P?y:(P=i,n("vert",{x:i}))},log:function(i){return typeof i!="string"&&(i=JSON.stringify(i,!1," ")),n("log",{txt:i})},reset:function(){return n("reset")},selected:function(i){return n("selected",{segs:i})},chainStart:function(i){return n("chain_start",{seg:i})},chainRemoveHead:function(i,a){return n("chain_rem_head",{index:i,pt:a})},chainRemoveTail:function(i,a){return n("chain_rem_tail",{index:i,pt:a})},chainNew:function(i,a){return n("chain_new",{pt1:i,pt2:a})},chainMatch:function(i){return n("chain_match",{index:i})},chainClose:function(i){return n("chain_close",{index:i})},chainAddHead:function(i,a){return n("chain_add_head",{index:i,pt:a})},chainAddTail:function(i,a){return n("chain_add_tail",{index:i,pt:a})},chainConnect:function(i,a){return n("chain_con",{index1:i,index2:a})},chainReverse:function(i){return n("chain_rev",{index:i})},chainJoin:function(i,a){return n("chain_join",{index1:i,index2:a})},done:function(){return n("done")}},y}Y.exports=f}),w8=It((et,Y)=>{function f(y){typeof y!="number"&&(y=1e-10);var z={epsilon:function(P){return typeof P=="number"&&(y=P),y},pointAboveOrOnLine:function(P,n,i){var a=n[0],l=n[1],o=i[0],c=i[1],s=P[0],h=P[1];return(o-a)*(h-l)-(c-l)*(s-a)>=-y},pointBetween:function(P,n,i){var a=P[1]-n[1],l=i[0]-n[0],o=P[0]-n[0],c=i[1]-n[1],s=o*l+a*c;if(s-y)},pointsSameX:function(P,n){return Math.abs(P[0]-n[0])y!=o-a>y&&(l-h)*(a-m)/(o-m)+h-i>y&&(c=!c),l=h,o=m}return c}};return z}Y.exports=f}),Cg=It((et,Y)=>{var f={create:function(){var y={root:{root:!0,next:null},exists:function(z){return!(z===null||z===y.root)},isEmpty:function(){return y.root.next===null},getHead:function(){return y.root.next},insertBefore:function(z,P){for(var n=y.root,i=y.root.next;i!==null;){if(P(i)){z.prev=i.prev,z.next=i,i.prev.next=z,i.prev=z;return}n=i,i=i.next}n.next=z,z.prev=n,z.next=null},findTransition:function(z){for(var P=y.root,n=y.root.next;n!==null&&!z(n);)P=n,n=n.next;return{before:P===y.root?null:P,after:n,insert:function(i){return i.prev=P,i.next=n,P.next=i,n!==null&&(n.prev=i),i}}}};return y},node:function(y){return y.prev=null,y.next=null,y.remove=function(){y.prev.next=y.next,y.next&&(y.next.prev=y.prev),y.prev=null,y.next=null},y}};Y.exports=f}),sb=It((et,Y)=>{var f=Cg();function y(z,P,n){function i(A,d){return{id:n?n.segmentId():-1,start:A,end:d,myFill:{above:null,below:null},otherFill:null}}function a(A,d,k){return{id:n?n.segmentId():-1,start:A,end:d,myFill:{above:k.myFill.above,below:k.myFill.below},otherFill:null}}var l=f.create();function o(A,d,k,w,D,E){var I=P.pointsCompare(d,D);return I!==0?I:P.pointsSame(k,E)?0:A!==w?A?1:-1:P.pointAboveOrOnLine(k,w?D:E,w?E:D)?1:-1}function c(A,d){l.insertBefore(A,function(k){var w=o(A.isStart,A.pt,d,k.isStart,k.pt,k.other.pt);return w<0})}function s(A,d){var k=f.node({isStart:!0,pt:A.start,seg:A,primary:d,other:null,status:null});return c(k,A.end),k}function h(A,d,k){var w=f.node({isStart:!1,pt:d.end,seg:d,primary:k,other:A,status:null});A.other=w,c(w,A.pt)}function m(A,d){var k=s(A,d);return h(k,A,d),k}function b(A,d){n&&n.segmentChop(A.seg,d),A.other.remove(),A.seg.end=d,A.other.pt=d,c(A.other,A.pt)}function x(A,d){var k=a(d,A.seg.end,A.seg);return b(A,d),m(k,A.primary)}function _(A,d){var k=f.create();function w(W,F){var H=W.seg.start,q=W.seg.end,G=F.seg.start,tt=F.seg.end;return P.pointsCollinear(H,G,tt)?P.pointsCollinear(q,G,tt)||P.pointAboveOrOnLine(q,G,tt)?1:-1:P.pointAboveOrOnLine(H,G,tt)?1:-1}function D(W){return k.findTransition(function(F){var H=w(W,F.ev);return H>0})}function E(W,F){var H=W.seg,q=F.seg,G=H.start,tt=H.end,ht=q.start,bt=q.end;n&&n.checkIntersection(H,q);var vt=P.linesIntersect(G,tt,ht,bt);if(vt===!1){if(!P.pointsCollinear(G,tt,ht)||P.pointsSame(G,bt)||P.pointsSame(tt,ht))return!1;var ut=P.pointsSame(G,ht),rt=P.pointsSame(tt,bt);if(ut&&rt)return F;var gt=!ut&&P.pointBetween(G,ht,bt),it=!rt&&P.pointBetween(tt,ht,bt);if(ut)return it?x(F,tt):x(W,bt),F;gt&&(rt||(it?x(F,tt):x(W,bt)),x(F,G))}else vt.alongA===0&&(vt.alongB===-1?x(W,ht):vt.alongB===0?x(W,vt.pt):vt.alongB===1&&x(W,bt)),vt.alongB===0&&(vt.alongA===-1?x(F,G):vt.alongA===0?x(F,vt.pt):vt.alongA===1&&x(F,tt));return!1}for(var I=[];!l.isEmpty();){var M=l.getHead();if(n&&n.vert(M.pt[0]),M.isStart){let W=function(){if(g){var F=E(M,g);if(F)return F}return C?E(M,C):!1};n&&n.segmentNew(M.seg,M.primary);var p=D(M),g=p.before?p.before.ev:null,C=p.after?p.after.ev:null;n&&n.tempStatus(M.seg,g?g.seg:!1,C?C.seg:!1);var S=W();if(S){if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,N&&(S.seg.myFill.above=!S.seg.myFill.above)}else S.seg.otherFill=M.seg.myFill;n&&n.segmentUpdate(S.seg),M.other.remove(),M.remove()}if(l.getHead()!==M){n&&n.rewind(M.seg);continue}if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,C?M.seg.myFill.below=C.seg.myFill.above:M.seg.myFill.below=A,N?M.seg.myFill.above=!M.seg.myFill.below:M.seg.myFill.above=M.seg.myFill.below}else if(M.seg.otherFill===null){var B;C?M.primary===C.primary?B=C.seg.otherFill.above:B=C.seg.myFill.above:B=M.primary?d:A,M.seg.otherFill={above:B,below:B}}n&&n.status(M.seg,g?g.seg:!1,C?C.seg:!1),M.other.status=p.insert(f.node({ev:M}))}else{var U=M.status;if(U===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(k.exists(U.prev)&&k.exists(U.next)&&E(U.prev.ev,U.next.ev),n&&n.statusRemove(U.ev.seg),U.remove(),!M.primary){var V=M.seg.myFill;M.seg.myFill=M.seg.otherFill,M.seg.otherFill=V}I.push(M.seg)}l.getHead().remove()}return n&&n.done(),I}return z?{addRegion:function(A){for(var d,k=A[A.length-1],w=0;w{function f(y,z,P){var n=[],i=[];return y.forEach(function(a){var l=a.start,o=a.end;if(z.pointsSame(l,o)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}P&&P.chainStart(a);var c={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},h=c;function m(B,U,V){return h.index=B,h.matches_head=U,h.matches_pt1=V,h===c?(h=s,!1):(h=null,!0)}for(var b=0;b{function f(z,P,n){var i=[];return z.forEach(function(a){var l=(a.myFill.above?8:0)+(a.myFill.below?4:0)+(a.otherFill&&a.otherFill.above?2:0)+(a.otherFill&&a.otherFill.below?1:0);P[l]!==0&&i.push({id:n?n.segmentId():-1,start:a.start,end:a.end,myFill:{above:P[l]===1,below:P[l]===2},otherFill:null})}),n&&n.selected(i),i}var y={union:function(z,P){return f(z,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],P)},intersect:function(z,P){return f(z,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],P)},difference:function(z,P){return f(z,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],P)},differenceRev:function(z,P){return f(z,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],P)},xor:function(z,P){return f(z,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],P)}};Y.exports=y}),lb=It((et,Y)=>{var f={toPolygon:function(y,z){function P(a){if(a.length<=0)return y.segments({inverted:!1,regions:[]});function l(s){var h=s.slice(0,s.length-1);return y.segments({inverted:!1,regions:[h]})}for(var o=l(a[0]),c=1;c{var f=ay(),y=w8(),z=sb(),P=O4(),n=ww(),i=lb(),a=!1,l=y(),o;o={buildLog:function(s){return s===!0?a=f():s===!1&&(a=!1),a===!1?!1:a.list},epsilon:function(s){return l.epsilon(s)},segments:function(s){var h=z(!0,l,a);return s.regions.forEach(h.addRegion),{segments:h.calculate(s.inverted),inverted:s.inverted}},combine:function(s,h){var m=z(!1,l,a);return{combined:m.calculate(s.segments,s.inverted,h.segments,h.inverted),inverted1:s.inverted,inverted2:h.inverted}},selectUnion:function(s){return{segments:n.union(s.combined,a),inverted:s.inverted1||s.inverted2}},selectIntersect:function(s){return{segments:n.intersect(s.combined,a),inverted:s.inverted1&&s.inverted2}},selectDifference:function(s){return{segments:n.difference(s.combined,a),inverted:s.inverted1&&!s.inverted2}},selectDifferenceRev:function(s){return{segments:n.differenceRev(s.combined,a),inverted:!s.inverted1&&s.inverted2}},selectXor:function(s){return{segments:n.xor(s.combined,a),inverted:s.inverted1!==s.inverted2}},polygon:function(s){return{regions:P(s.segments,l,a),inverted:s.inverted}},polygonFromGeoJSON:function(s){return i.toPolygon(o,s)},polygonToGeoJSON:function(s){return i.fromPolygon(o,l,s)},union:function(s,h){return c(s,h,o.selectUnion)},intersect:function(s,h){return c(s,h,o.selectIntersect)},difference:function(s,h){return c(s,h,o.selectDifference)},differenceRev:function(s,h){return c(s,h,o.selectDifferenceRev)},xor:function(s,h){return c(s,h,o.selectXor)}};function c(s,h,m){var b=o.segments(s),x=o.segments(h),_=o.combine(b,x),A=m(_);return o.polygon(A)}typeof window=="object"&&(window.PolyBool=o),Y.exports=o}),cb=It((et,Y)=>{Y.exports=function(f,y,z,P){var n=f[0],i=f[1],a=!1;z===void 0&&(z=0),P===void 0&&(P=y.length);for(var l=P-z,o=0,c=l-1;oi!=b>i&&n<(m-s)*(i-h)/(b-h)+s;x&&(a=!a)}return a}}),Ag=It((et,Y)=>{var f=aw().dot,y=Dr().BADNUM,z=Y.exports={};z.tester=function(P){var n=P.slice(),i=n[0][0],a=i,l=n[0][1],o=l,c;for((n[n.length-1][0]!==n[0][0]||n[n.length-1][1]!==n[0][1])&&n.push(n[0]),c=1;ca||w===y||wo||d&&h(A))}function b(A,d){var k=A[0],w=A[1];if(k===y||ka||w===y||wo)return!1;var D=n.length,E=n[0][0],I=n[0][1],M=0,p,g,C,S,N;for(p=1;pMath.max(g,E)||w>Math.max(C,I)))if(wc||Math.abs(f(b,h))>a)return!0;return!1},z.filter=function(P,n){var i=[P[0]],a=0,l=0;function o(s){P.push(s);var h=i.length,m=a;i.splice(l+1);for(var b=m+1;b1){var c=P.pop();o(c)}return{addPt:o,raw:P,filtered:i}}}),ub=It((et,Y)=>{Y.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),Tw=It((et,Y)=>{var f=kw(),y=cb(),z=ls(),P=Js().dashStyle,n=Hn(),i=hd(),a=T0().makeEventData,l=dm(),o=l.freeMode,c=l.rectMode,s=l.drawMode,h=l.openMode,m=l.selectMode,b=l0(),x=ib(),_=Kg(),A=Cm().clearOutline,d=Zv(),k=d.handleEllipse,w=d.readPaths,D=Z0().newShapes,E=Kv(),I=z4().activateLastSelection,M=jn(),p=M.sorterAsc,g=Ag(),C=lw(),S=Ku().getFromId,N=ry(),B=fm().redrawReglTraces,U=ub(),V=U.MINSELECT,W=g.filter,F=g.tester,H=nb(),q=H.p2r,G=H.axValue,tt=H.getTransform;function ht(Xt){return Xt.subplot!==void 0}function bt(Xt,oe,zt,_t,Pt){var Ht=!ht(_t),ae=o(Pt),he=c(Pt),Me=h(Pt),qe=s(Pt),Ye=m(Pt),ur=Pt==="drawline",Rr=Pt==="drawcircle",zr=ur||Rr,xr=_t.gd,pn=xr._fullLayout,ci=Ye&&pn.newselection.mode==="immediate"&&Ht,ui=pn._zoomlayer,yi=_t.element.getBoundingClientRect(),Gi=_t.plotinfo,Ci=tt(Gi),fi=oe-yi.left,ba=zt-yi.top;pn._calcInverseTransform(xr);var oa=M.apply3DTransform(pn._invTransform)(fi,ba);fi=oa[0],ba=oa[1];var Ke=pn._invScaleX,sr=pn._invScaleY,vr=fi,Ar=ba,mn="M"+fi+","+ba,Zn=_t.xaxes[0],Un=_t.yaxes[0],Wn=Zn._length,Li=Un._length,Fi=Xt.altKey&&!(s(Pt)&&Me),Zi,Ji,ca,Ei,Ga,so,Fe;st(Xt,xr,_t),ae&&(Zi=W([[fi,ba]],U.BENDPX));var Re=ui.selectAll("path.select-outline-"+Gi.id).data([1]),Kr=qe?pn.newshape:pn.newselection;qe&&(_t.hasText=Kr.label.text||Kr.label.texttemplate);var sn=qe&&!Me?Kr.fillcolor:"rgba(0,0,0,0)",cn=Kr.line.color||(Ht?n.contrast(xr._fullLayout.plot_bgcolor):"#7f7f7f");Re.enter().append("path").attr("class","select-outline select-outline-"+Gi.id).style({opacity:qe?Kr.opacity/2:1,"stroke-dasharray":P(Kr.line.dash,Kr.line.width),"stroke-width":Kr.line.width+"px","shape-rendering":"crispEdges"}).call(n.stroke,cn).call(n.fill,sn).attr("fill-rule","evenodd").classed("cursor-move",!!qe).attr("transform",Ci).attr("d",mn+"Z");var Yr=ui.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1}).attr("transform",Ci).attr("d","M0,0Z");if(qe&&_t.hasText){var un=ui.select(".label-temp");un.empty()&&(un=ui.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Pn=pn._uid+U.SELECTID,bn=[],ze=dt(xr,_t.xaxes,_t.yaxes,_t.subplot);ci&&!Xt.shiftKey&&(_t._clearSubplotSelections=function(){if(Ht){var en=Zn._id,Rn=Un._id;ce(xr,en,Rn,ze);for(var ni=(xr.layout||{}).selections||[],xi=[],Jn=!1,Gn=0;Gn=0){xr._fullLayout._deactivateShape(xr);return}if(!qe){var ni=pn.clickmode;C.done(Pn).then(function(){if(C.clear(Pn),en===2){for(Re.remove(),Ga=0;Ga-1&&vt(Rn,xr,_t.xaxes,_t.yaxes,_t.subplot,_t,Re),ni==="event"&&_n(xr,void 0);i.click(xr,Rn,Gi.id)}).catch(M.error)}},_t.doneFn=function(){Yr.remove(),C.done(Pn).then(function(){C.clear(Pn),!ci&&Ei&&_t.selectionDefs&&(Ei.subtract=Fi,_t.selectionDefs.push(Ei),_t.mergedPolygons.length=0,[].push.apply(_t.mergedPolygons,ca)),(ci||qe)&&J(_t,ci),_t.doneFnCompleted&&_t.doneFnCompleted(bn),Ye&&_n(xr,Fe)}).catch(M.error)}}function vt(Xt,oe,zt,_t,Pt,Ht,ae){var he=oe._hoverdata,Me=oe._fullLayout,qe=Me.clickmode,Ye=qe.indexOf("event")>-1,ur=[],Rr,zr,xr,pn,ci,ui,yi,Gi,Ci,fi;if(Rt(he)){st(Xt,oe,Ht),Rr=dt(oe,zt,_t,Pt);var ba=Bt(he,Rr),oa=ba.pointNumbers.length>0;if(oa?Gt(Rr,ba):ee(Rr)&&(yi=Zt(ba))){for(ae&&ae.remove(),fi=0;fi=0}function ot(Xt){return Xt._fullLayout._activeSelectionIndex>=0}function J(Xt,oe){var zt=Xt.dragmode,_t=Xt.plotinfo,Pt=Xt.gd;xt(Pt)&&Pt._fullLayout._deactivateShape(Pt),ot(Pt)&&Pt._fullLayout._deactivateSelection(Pt);var Ht=Pt._fullLayout,ae=Ht._zoomlayer,he=s(zt),Me=m(zt);if(he||Me){var qe=ae.selectAll(".select-outline-"+_t.id);if(qe&&Pt._fullLayout._outlining){var Ye;he&&(Ye=D(qe,Xt)),Ye&&z.call("_guiRelayout",Pt,{shapes:Ye});var ur;Me&&!ht(Xt)&&(ur=E(qe,Xt)),ur&&(Pt._fullLayout._noEmitSelectedAtStart=!0,z.call("_guiRelayout",Pt,{selections:ur}).then(function(){oe&&I(Pt)})),Pt._fullLayout._outlining=!1}}_t.selection={},_t.selection.selectionDefs=Xt.selectionDefs=[],_t.selection.mergedPolygons=Xt.mergedPolygons=[]}function mt(Xt){return Xt._id}function dt(Xt,oe,zt,_t){if(!Xt.calcdata)return[];var Pt=[],Ht=oe.map(mt),ae=zt.map(mt),he,Me,qe;for(qe=0;qe0,Ht=Pt?_t[0]:zt;return oe.selectedpoints?oe.selectedpoints.indexOf(Ht)>-1:!1}function Gt(Xt,oe){var zt=[],_t,Pt,Ht,ae;for(ae=0;ae0&&zt.push(_t);if(zt.length===1&&(Ht=zt[0]===oe.searchInfo,Ht&&(Pt=oe.searchInfo.cd[0].trace,Pt.selectedpoints.length===oe.pointNumbers.length))){for(ae=0;ae1||(oe+=_t.selectedpoints.length,oe>1)))return!1;return oe===1}function xe(Xt,oe,zt){var _t;for(_t=0;_t-1&&oe;if(!ae&&oe){var en=Ze(Xt,!0);if(en.length){var Rn=en[0].xref,ni=en[0].yref;if(Rn&&ni){var xi=fr(en),Jn=an([S(Xt,Rn,"x"),S(Xt,ni,"y")]);Jn(bn,xi)}}Xt._fullLayout._noEmitSelectedAtStart?Xt._fullLayout._noEmitSelectedAtStart=!1:yr&&_n(Xt,bn),Rr._reselect=!1}if(!ae&&Rr._deselect){var Gn=Rr._deselect;he=Gn.xref,Me=Gn.yref,be(he,Me,Ye)||ce(Xt,he,Me,_t),yr&&(bn.points.length?_n(Xt,bn):Oe(Xt)),Rr._deselect=!1}return{eventData:bn,selectionTesters:zt}}function ie(Xt){var oe=Xt.calcdata;if(oe)for(var zt=0;zt{Y.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}),hb=It((et,Y)=>{Y.exports={axisRefDescription:function(f,y,z){return["If set to a",f,"axis id (e.g. *"+f+"* or","*"+f+"2*), the `"+f+"` position refers to a",f,"coordinate. If set to *paper*, the `"+f+"`","position refers to the distance from the",y,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",y,"("+z+"). If set to a",f,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",y,"of the domain of that axis: e.g.,","*"+f+"2 domain* refers to the domain of the second",f," axis and a",f,"position of 0.5 refers to the","point between the",y,"and the",z,"of the domain of the","second",f,"axis."].join(" ")}}}),Mg=It((et,Y)=>{var f=Sw(),y=hi(),z=fu(),P=Tc().templatedArray;hb(),Y.exports=P("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:f.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:f.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",z.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",z.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:y({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),Eg=It((et,Y)=>{Y.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),Em=It((et,Y)=>{Y.exports=function(f){return{valType:"color",editType:"style",anim:!0}}}),dd=It((et,Y)=>{var f=Sh().axisHoverFormat,{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Ru(),i=hi(),a=qf().dash,l=qf().pattern,o=Js(),c=Eg(),s=Yn().extendFlat,h=Em();function m(_){return{valType:"any",dflt:0,editType:"calc"}}function b(_){return{valType:"any",editType:"calc"}}function x(_){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:m(),yperiod:m(),xperiod0:b(),yperiod0:b(),xperiodalignment:x(),yperiodalignment:x(),xhoverformat:f("x"),yhoverformat:f("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:z(),texttemplatefallback:P({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:y({},{keys:c.eventDataKeys}),hovertemplatefallback:P(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:s({},a,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:h(!0),fillgradient:s({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:s({symbol:{valType:"enumerated",values:o.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:s({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},n("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},n("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:i({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),Cw=It((et,Y)=>{var f=Mg(),y=dd().line,z=qf().dash,P=Yn().extendFlat,n=sh().overrideAll,i=Tc().templatedArray;hb(),Y.exports=n(i("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:P({},f.xref,{}),yref:P({},f.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:y.color,width:P({},y.width,{min:1,dflt:1}),dash:P({},z,{dflt:"dot"})}}),"arraydraw","from-root")}),k8=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=Cw(),n=l0();Y.exports=function(a,l){z(a,l,{name:"selections",handleItemDefaults:i});for(var o=l.selections,c=0;c{Y.exports=function(f,y,z){z("newselection.mode");var P=z("newselection.line.width");P&&(z("newselection.line.color"),z("newselection.line.dash")),z("activeselection.fillcolor"),z("activeselection.opacity")}}),Yv=It((et,Y)=>{var f=ls(),y=jn(),z=Ku();Y.exports=function(P){return function(n,i){var a=n[P];if(Array.isArray(a))for(var l=f.subplotsRegistry.cartesian,o=l.idRegex,c=i._subplots,s=c.xaxis,h=c.yaxis,m=c.cartesian,b=i._has("cartesian"),x=0;x{var f=z4(),y=Tw();Y.exports={moduleType:"component",name:"selections",layoutAttributes:Cw(),supplyLayoutDefaults:k8(),supplyDrawNewSelectionDefaults:tg(),includeBasePlot:Yv()("selections"),draw:f.draw,drawOne:f.drawOne,reselect:y.reselect,prepSelect:y.prepSelect,clearOutline:y.clearOutline,clearSelectionsCache:y.clearSelectionsCache,selectOnClick:y.selectOnClick}}),P_=It((et,Y)=>{var f=Br(),y=jn(),z=y.numberFormat,P=Xi(),n=dw(),i=ls(),a=y.strTranslate,l=uu(),o=Hn(),c=Js(),s=hd(),h=Fs(),m=Mm(),b=Up(),x=dm(),_=x.selectingOrDrawing,A=x.freeMode,d=Rd().FROM_TL,k=ry(),w=fm().redrawReglTraces,D=lh(),E=Ku().getFromId,I=Md().prepSelect,M=Md().clearOutline,p=Md().selectOnClick,g=ob(),C=fu(),S=C.MINDRAG,N=C.MINZOOM,B=!0;function U(Ct,Rt,Bt,Zt,Gt,ee,xe,ge){var ye=Ct._fullLayout._zoomlayer,ue=xe+ge==="nsew",Mt=(xe+ge).length===1,Ot,Lt,ie,be,ce,Le,Ze,Qe,mr,fr,Jr,an,Er,dn,_n,Oe,Xt,oe,zt,_t,Pt,Ht,ae;Bt+=Rt.yaxis._shift;function he(){if(Ot=Rt.xaxis,Lt=Rt.yaxis,mr=Ot._length,fr=Lt._length,Ze=Ot._offset,Qe=Lt._offset,ie={},ie[Ot._id]=Ot,be={},be[Lt._id]=Lt,xe&&ge)for(var Re=Rt.overlays,Kr=0;Kr=0){sn._fullLayout._deactivateShape(sn);return}var cn=sn._fullLayout.clickmode;if(gt(sn),Re===2&&!Mt&&Ji(),ue)cn.indexOf("select")>-1&&p(Kr,sn,ce,Le,Rt.id,Ye),cn.indexOf("event")>-1&&s.click(sn,Kr,Rt.id);else if(Re===1&&Mt){var Yr=xe?Lt:Ot,un=xe==="s"||ge==="w"?0:1,Pn=Yr._name+".range["+un+"]",bn=H(Yr,un),ze="left",yr="middle";if(Yr.fixedrange)return;xe?(yr=xe==="n"?"top":"bottom",Yr.side==="right"&&(ze="right")):ge==="e"&&(ze="right"),sn._context.showAxisRangeEntryBoxes&&f.select(qe).call(l.makeEditable,{gd:sn,immediate:!0,background:sn._fullLayout.paper_bgcolor,text:String(bn),fill:Yr.tickfont?Yr.tickfont.color:"#444",horizontalAlign:ze,verticalAlign:yr}).on("edit",function(en){var Rn=Yr.d2r(en);Rn!==void 0&&i.call("_guiRelayout",sn,Pn,Rn)})}}b.init(Ye);var zr,xr,pn,ci,ui,yi,Gi,Ci,fi,ba;function oa(Re,Kr,sn){var cn=qe.getBoundingClientRect();zr=Kr-cn.left,xr=sn-cn.top,Ct._fullLayout._calcInverseTransform(Ct);var Yr=y.apply3DTransform(Ct._fullLayout._invTransform)(zr,xr);zr=Yr[0],xr=Yr[1],pn={l:zr,r:zr,w:0,t:xr,b:xr,h:0},ci=Ct._hmpixcount?Ct._hmlumcount/Ct._hmpixcount:P(Ct._fullLayout.plot_bgcolor).getLuminance(),ui="M0,0H"+mr+"V"+fr+"H0V0",yi=!1,Gi="xy",ba=!1,Ci=bt(ye,ci,Ze,Qe,ui),fi=vt(ye,Ze,Qe)}function Ke(Re,Kr){if(Ct._transitioningWithDuration)return!1;var sn=Math.max(0,Math.min(mr,Ht*Re+zr)),cn=Math.max(0,Math.min(fr,ae*Kr+xr)),Yr=Math.abs(sn-zr),un=Math.abs(cn-xr);pn.l=Math.min(zr,sn),pn.r=Math.max(zr,sn),pn.t=Math.min(xr,cn),pn.b=Math.max(xr,cn);function Pn(){Gi="",pn.r=pn.l,pn.t=pn.b,fi.attr("d","M0,0Z")}if(Jr.isSubplotConstrained)Yr>N||un>N?(Gi="xy",Yr/mr>un/fr?(un=Yr*fr/mr,xr>cn?pn.t=xr-un:pn.b=xr+un):(Yr=un*mr/fr,zr>sn?pn.l=zr-Yr:pn.r=zr+Yr),fi.attr("d",ot(pn))):Pn();else if(an.isSubplotConstrained)if(Yr>N||un>N){Gi="xy";var bn=Math.min(pn.l/mr,(fr-pn.b)/fr),ze=Math.max(pn.r/mr,(fr-pn.t)/fr);pn.l=bn*mr,pn.r=ze*mr,pn.b=(1-bn)*fr,pn.t=(1-ze)*fr,fi.attr("d",ot(pn))}else Pn();else!dn||un0){var en;if(an.isSubplotConstrained||!Er&&dn.length===1){for(en=0;en1&&(Pn.maxallowed!==void 0&&Oe===(Pn.range[0]1&&(bn.maxallowed!==void 0&&Xt===(bn.range[0]=0?Math.min(Ct,.9):1/(1/Math.max(Ct,-.3)+3.222))}function ht(Ct,Rt,Bt){return Ct?Ct==="nsew"?Bt?"":Rt==="pan"?"move":"crosshair":Ct.toLowerCase()+"-resize":"pointer"}function bt(Ct,Rt,Bt,Zt,Gt){return Ct.append("path").attr("class","zoombox").style({fill:Rt>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",a(Bt,Zt)).attr("d",Gt+"Z")}function vt(Ct,Rt,Bt){return Ct.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1,opacity:0}).attr("transform",a(Rt,Bt)).attr("d","M0,0Z")}function ut(Ct,Rt,Bt,Zt,Gt,ee){Ct.attr("d",Zt+"M"+Bt.l+","+Bt.t+"v"+Bt.h+"h"+Bt.w+"v-"+Bt.h+"h-"+Bt.w+"Z"),rt(Ct,Rt,Gt,ee)}function rt(Ct,Rt,Bt,Zt){Bt||(Ct.transition().style("fill",Zt>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Rt.transition().style("opacity",1).duration(200))}function gt(Ct){f.select(Ct).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function it(Ct){B&&Ct.data&&Ct._context.showTips&&(y.notifier(y._(Ct,"Double-click to zoom back out"),"long"),B=!1)}function st(Ct,Rt){return"M"+(Ct.l-.5)+","+(Rt-N-.5)+"h-3v"+(2*N+1)+"h3ZM"+(Ct.r+.5)+","+(Rt-N-.5)+"h3v"+(2*N+1)+"h-3Z"}function xt(Ct,Rt){return"M"+(Rt-N-.5)+","+(Ct.t-.5)+"v-3h"+(2*N+1)+"v3ZM"+(Rt-N-.5)+","+(Ct.b+.5)+"v3h"+(2*N+1)+"v-3Z"}function ot(Ct){var Rt=Math.floor(Math.min(Ct.b-Ct.t,Ct.r-Ct.l,N)/2);return"M"+(Ct.l-3.5)+","+(Ct.t-.5+Rt)+"h3v"+-Rt+"h"+Rt+"v-3h-"+(Rt+3)+"ZM"+(Ct.r+3.5)+","+(Ct.t-.5+Rt)+"h-3v"+-Rt+"h"+-Rt+"v-3h"+(Rt+3)+"ZM"+(Ct.r+3.5)+","+(Ct.b+.5-Rt)+"h-3v"+Rt+"h"+-Rt+"v3h"+(Rt+3)+"ZM"+(Ct.l-3.5)+","+(Ct.b+.5-Rt)+"h3v"+Rt+"h"+Rt+"v3h-"+(Rt+3)+"Z"}function J(Ct,Rt,Bt,Zt,Gt){for(var ee=!1,xe={},ge={},ye,ue,Mt,Ot,Lt=(Gt||{}).xaHash,ie=(Gt||{}).yaHash,be=0;be{var Y=Br(),f=hd(),y=Up(),z=Mm(),P=P_().makeDragBox,n=fu().DRAGGERSIZE;et.initInteractions=function(i){var a=i._fullLayout;if(i._context.staticPlot){Y.select(i).selectAll(".drag").remove();return}if(!(!a._has("cartesian")&&!a._has("splom"))){var l=Object.keys(a._plots||{}).sort(function(c,s){if((a._plots[c].mainplot&&!0)===(a._plots[s].mainplot&&!0)){var h=c.split("y"),m=s.split("y");return h[0]===m[0]?Number(h[1]||1)-Number(m[1]||1):Number(h[0]||1)-Number(m[0]||1)}return a._plots[c].mainplot?1:-1});l.forEach(function(c){var s=a._plots[c],h=s.xaxis,m=s.yaxis;if(!s.mainplot){var b=P(i,s,h._offset,m._offset,h._length,m._length,"ns","ew");b.onmousemove=function(A){i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===c&&i._fullLayout._plots[c]&&f.hover(i,A,c)},f.hover(i,A,c),i._fullLayout._lasthover=b,i._fullLayout._hoversubplot=c},b.onmouseout=function(A){i._dragging||(i._fullLayout._hoversubplot=null,y.unhover(i,A))},i._context.showAxisDragHandles&&(P(i,s,h._offset-n,m._offset-n,n,n,"n","w"),P(i,s,h._offset+h._length,m._offset-n,n,n,"n","e"),P(i,s,h._offset-n,m._offset+m._length,n,n,"s","w"),P(i,s,h._offset+h._length,m._offset+m._length,n,n,"s","e"))}if(i._context.showAxisDragHandles){if(c===h._mainSubplot){var x=h._mainLinePosition;h.side==="top"&&(x-=n),P(i,s,h._offset+h._length*.1,x,h._length*.8,n,"","ew"),P(i,s,h._offset,x,h._length*.1,n,"","w"),P(i,s,h._offset+h._length*.9,x,h._length*.1,n,"","e")}if(c===m._mainSubplot){var _=m._mainLinePosition;m.side!=="right"&&(_-=n),P(i,s,_,m._offset+m._length*.1,n,m._length*.8,"ns",""),P(i,s,_,m._offset+m._length*.9,n,m._length*.1,"s",""),P(i,s,_,m._offset,n,m._length*.1,"n","")}}});var o=a._hoverlayer.node();o.onmousemove=function(c){c.target=i._fullLayout._lasthover,f.hover(i,c,a._hoversubplot)},o.onclick=function(c){c.target=i._fullLayout._lasthover,f.click(i,c)},o.onmousedown=function(c){i._fullLayout._lasthover.onmousedown(c)},et.updateFx(i)}},et.updateFx=function(i){var a=i._fullLayout,l=a.dragmode==="pan"?"move":"crosshair";z(a._draggers,l)}}),R4=It((et,Y)=>{var f=ls();Y.exports=function(y){for(var z=f.layoutArrayContainers,P=f.layoutArrayRegexes,n=y.split("[")[0],i,a,l=0;l{var Y=Cn(),f=Io(),y=es(),z=sw().sorterAsc,P=ls();et.containerArrayMatch=R4();var n=et.isAddVal=function(a){return a==="add"||Y(a)},i=et.isRemoveVal=function(a){return a===null||a==="remove"};et.applyContainerArrayChanges=function(a,l,o,c,s){var h=l.astr,m=P.getComponentMethod(h,"supplyLayoutDefaults"),b=P.getComponentMethod(h,"draw"),x=P.getComponentMethod(h,"drawOne"),_=c.replot||c.recalc||m===f||b===f,A=a.layout,d=a._fullLayout;if(o[""]){Object.keys(o).length>1&&y.warn("Full array edits are incompatible with other edits",h);var k=o[""][""];if(i(k))l.set(null);else if(Array.isArray(k))l.set(k);else return y.warn("Unrecognized full array edit value",h,k),!0;return _?!1:(m(A,d),b(a),!0)}var w=Object.keys(o).map(Number).sort(z),D=l.get(),E=D||[],I=s(d,h).get(),M=[],p=-1,g=E.length,C,S,N,B,U,V,W,F;for(C=0;CE.length-(W?0:1)){y.warn("index out of range",h,N);continue}if(V!==void 0)U.length>1&&y.warn("Insertion & removal are incompatible with edits to the same index.",h,N),i(V)?M.push(N):W?(V==="add"&&(V={}),E.splice(N,0,V),I&&I.splice(N,0,{})):y.warn("Unrecognized full object edit value",h,N,V),p===-1&&(p=N);else for(S=0;S=0;C--)E.splice(M[C],1),I&&I.splice(M[C],1);if(E.length?D||l.set(E):l.set(null),_)return!1;if(m(A,d),x!==f){var H;if(p===-1)H=w;else{for(g=Math.max(E.length,g),H=[],C=0;C=p));C++)H.push(N);for(C=p;C{var Y=Sr(),f=ls(),y=jn(),z=lh(),P=Ku(),n=Hn(),i=P.cleanId,a=P.getFromTrace,l=f.traceIs,o=["x","y","z"];et.clearPromiseQueue=function(d){Array.isArray(d._promises)&&d._promises.length>0&&y.log("Clearing previous rejected promises from queue."),d._promises=[]},et.cleanLayout=function(d){var k;d||(d={}),d.xaxis1&&(d.xaxis||(d.xaxis=d.xaxis1),delete d.xaxis1),d.yaxis1&&(d.yaxis||(d.yaxis=d.yaxis1),delete d.yaxis1),d.scene1&&(d.scene||(d.scene=d.scene1),delete d.scene1);var w=(z.subplotsRegistry.cartesian||{}).attrRegex;(z.subplotsRegistry.polar||{}).attrRegex,(z.subplotsRegistry.ternary||{}).attrRegex,(z.subplotsRegistry.gl3d||{}).attrRegex;var D=Object.keys(d);for(k=0;k3?(B.x=1.02,B.xanchor="left"):B.x<-2&&(B.x=-.02,B.xanchor="right"),B.y>3?(B.y=1.02,B.yanchor="bottom"):B.y<-2&&(B.y=-.02,B.yanchor="top")),d.dragmode==="rotate"&&(d.dragmode="orbit"),n.clean(d),d.template&&d.template.layout&&et.cleanLayout(d.template.layout),d};function c(d,k){var w=d[k],D=k.charAt(0);w&&w!=="paper"&&(d[k]=i(w,D,!0))}et.cleanData=function(d){for(var k=0;k0)return d.substr(0,k)}et.hasParent=function(d,k){for(var w=_(k);w;){if(w in d)return!0;w=_(w)}return!1},et.clearAxisTypes=function(d,k,w){for(var D=0;D{let w=(...D)=>D.every(E=>y.isPlainObject(E))||D.every(E=>Array.isArray(E));if([d,k].every(D=>Array.isArray(D))){if(d.length!==k.length)return!1;for(let D=0;Dy.isPlainObject(D))){if(Object.keys(d).length!==Object.keys(k).length)return!1;for(let D in d){if(D.startsWith("_"))continue;let E=d[D],I=k[D];if(E!==I&&!(w(E,I)&&A(E,I)))return!1}return!0}return!1};et.collectionsAreEqual=A}),Aw=It(et=>{var Y=Br(),f=Sr(),y=Jd(),z=jn(),P=z.nestedProperty,n=qg(),i=um(),a=ls(),l=Gg(),o=lh(),c=Fs(),s=hw(),h=Gf(),m=Js(),b=Hn(),x=B4().initInteractions,_=k0(),A=Md().clearOutline,d=Mo().dfltConfig,k=T8(),w=I_(),D=fm(),E=sh(),I=fu().AX_NAME_PATTERN,M=0,p=5;function g(zt,_t,Pt,Ht){var ae;if(zt=z.getGraphDiv(zt),n.init(zt),z.isPlainObject(_t)){var he=_t;_t=he.data,Pt=he.layout,Ht=he.config,ae=he.frames}var Me=n.triggerHandler(zt,"plotly_beforeplot",[_t,Pt,Ht]);if(Me===!1)return Promise.reject();!_t&&!Pt&&!z.isPlotDiv(zt)&&z.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",zt);function qe(){if(ae)return et.addFrames(zt,ae)}U(zt,Ht),Pt||(Pt={}),Y.select(zt).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(zt._promises)||(zt._promises=[]);var Ye=(zt.data||[]).length===0&&Array.isArray(_t);Array.isArray(_t)&&(w.cleanData(_t),Ye?zt.data=_t:zt.data.push.apply(zt.data,_t),zt.empty=!1),(!zt.layout||Ye)&&(zt.layout=w.cleanLayout(Pt)),o.supplyDefaults(zt);var ur=zt._fullLayout,Rr=ur._has("cartesian");ur._replotting=!0,(Ye||ur._shouldCreateBgLayer)&&(oe(zt),ur._shouldCreateBgLayer&&delete ur._shouldCreateBgLayer),m.initGradients(zt),m.initPatterns(zt),Ye&&c.saveShowSpikeInitial(zt);var zr=!zt.calcdata||zt.calcdata.length!==(zt._fullData||[]).length;zr&&o.doCalcdata(zt);for(var xr=0;xr=zt.data.length||ae<-zt.data.length)throw new Error(Pt+" must be valid indices for gd.data.");if(_t.indexOf(ae,Ht+1)>-1||ae>=0&&_t.indexOf(-zt.data.length+ae)>-1||ae<0&&_t.indexOf(zt.data.length+ae)>-1)throw new Error("each index in "+Pt+" must be unique.")}}function q(zt,_t,Pt){if(!Array.isArray(zt.data))throw new Error("gd.data must be an array.");if(typeof _t>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(_t)||(_t=[_t]),H(zt,_t,"currentIndices"),typeof Pt<"u"&&!Array.isArray(Pt)&&(Pt=[Pt]),typeof Pt<"u"&&H(zt,Pt,"newIndices"),typeof Pt<"u"&&_t.length!==Pt.length)throw new Error("current and new indices must be of equal length.")}function G(zt,_t,Pt){var Ht,ae;if(!Array.isArray(zt.data))throw new Error("gd.data must be an array.");if(typeof _t>"u")throw new Error("traces must be defined.");for(Array.isArray(_t)||(_t=[_t]),Ht=0;Ht<_t.length;Ht++)if(ae=_t[Ht],typeof ae!="object"||Array.isArray(ae)||ae===null)throw new Error("all values in traces array must be non-array objects");if(typeof Pt<"u"&&!Array.isArray(Pt)&&(Pt=[Pt]),typeof Pt<"u"&&Pt.length!==_t.length)throw new Error("if indices is specified, traces.length must equal indices.length")}function tt(zt,_t,Pt,Ht){var ae=z.isPlainObject(Ht);if(!Array.isArray(zt.data))throw new Error("gd.data must be an array");if(!z.isPlainObject(_t))throw new Error("update must be a key:value object");if(typeof Pt>"u")throw new Error("indices must be an integer or array of integers");H(zt,Pt,"indices");for(var he in _t){if(!Array.isArray(_t[he])||_t[he].length!==Pt.length)throw new Error("attribute "+he+" must be an array of length equal to indices array length");if(ae&&(!(he in Ht)||!Array.isArray(Ht[he])||Ht[he].length!==_t[he].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function ht(zt,_t,Pt,Ht){var ae=z.isPlainObject(Ht),he=[],Me,qe,Ye,ur,Rr;Array.isArray(Pt)||(Pt=[Pt]),Pt=F(Pt,zt.data.length-1);for(var zr in _t)for(var xr=0;xr=0&&Rr=0&&Rr"u")return ur=et.redraw(zt),i.add(zt,ae,Me,he,qe),ur;Array.isArray(Pt)||(Pt=[Pt]);try{q(zt,Ht,Pt)}catch(Rr){throw zt.data.splice(zt.data.length-_t.length,_t.length),Rr}return i.startSequence(zt),i.add(zt,ae,Me,he,qe),ur=et.moveTraces(zt,Ht,Pt),i.stopSequence(zt),ur}function it(zt,_t){zt=z.getGraphDiv(zt);var Pt=[],Ht=et.addTraces,ae=it,he=[zt,Pt,_t],Me=[zt,_t],qe,Ye;if(typeof _t>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(_t)||(_t=[_t]),H(zt,_t,"indices"),_t=F(_t,zt.data.length-1),_t.sort(z.sorterDes),qe=0;qe<_t.length;qe+=1)Ye=zt.data.splice(_t[qe],1)[0],Pt.push(Ye);var ur=et.redraw(zt);return i.add(zt,Ht,he,ae,Me),ur}function st(zt,_t,Pt){zt=z.getGraphDiv(zt);var Ht=[],ae=[],he=st,Me=st,qe=[zt,Pt,_t],Ye=[zt,_t,Pt],ur;if(q(zt,_t,Pt),_t=Array.isArray(_t)?_t:[_t],typeof Pt>"u")for(Pt=[],ur=0;ur<_t.length;ur++)Pt.push(-_t.length+ur);for(Pt=Array.isArray(Pt)?Pt:[Pt],_t=F(_t,zt.data.length-1),Pt=F(Pt,zt.data.length-1),ur=0;ur0&&typeof vr.parts[Zn]!="string";)Zn--;var Un=vr.parts[Zn],Wn=vr.parts[Zn-1]+"."+Un,Li=vr.parts.slice(0,Zn).join("."),Fi=P(zt.layout,Li).get(),Zi=P(Ht,Li).get(),Ji=vr.get();if(Ar!==void 0){Gi[sr]=Ar,Ci[sr]=Un==="reverse"?Ar:ot(Ji);var ca=l.getLayoutValObject(Ht,vr.parts);if(ca&&ca.impliedEdits&&Ar!==null)for(var Ei in ca.impliedEdits)fi(z.relativeAttr(sr,Ei),ca.impliedEdits[Ei]);if(["width","height"].indexOf(sr)!==-1)if(Ar){fi("autosize",null);var Ga=sr==="height"?"width":"height";fi(Ga,Ht[Ga])}else Ht[sr]=zt._initialAutoSize[sr];else if(sr==="autosize")fi("width",Ar?null:Ht.width),fi("height",Ar?null:Ht.height);else if(Wn.match(Gt))Ke(Wn),P(Ht,Li+"._inputRange").set(null);else if(Wn.match(ee)){Ke(Wn),P(Ht,Li+"._inputRange").set(null);var so=P(Ht,Li).get();so._inputDomain&&(so._input.domain=so._inputDomain.slice())}else Wn.match(xe)&&P(Ht,Li+"._inputDomain").set(null);if(Un==="type"){oa=Fi;var Fe=Zi.type==="linear"&&Ar==="log",Re=Zi.type==="log"&&Ar==="linear";if(Fe||Re){if(!oa||!oa.range)fi(Li+".autorange",!0);else if(Zi.autorange)Fe&&(oa.range=oa.range[1]>oa.range[0]?[1,2]:[2,1]);else{var Kr=oa.range[0],sn=oa.range[1];Fe?(Kr<=0&&sn<=0&&fi(Li+".autorange",!0),Kr<=0?Kr=sn/1e6:sn<=0&&(sn=Kr/1e6),fi(Li+".range[0]",Math.log(Kr)/Math.LN10),fi(Li+".range[1]",Math.log(sn)/Math.LN10)):(fi(Li+".range[0]",Math.pow(10,Kr)),fi(Li+".range[1]",Math.pow(10,sn)))}Array.isArray(Ht._subplots.polar)&&Ht._subplots.polar.length&&Ht[vr.parts[0]]&&vr.parts[1]==="radialaxis"&&delete Ht[vr.parts[0]]._subplot.viewInitial["radialaxis.range"],a.getComponentMethod("annotations","convertCoords")(zt,Zi,Ar,fi),a.getComponentMethod("images","convertCoords")(zt,Zi,Ar,fi)}else fi(Li+".autorange",!0),fi(Li+".range",null);P(Ht,Li+"._inputRange").set(null)}else if(Un.match(I)){var cn=P(Ht,sr).get(),Yr=(Ar||{}).type;(!Yr||Yr==="-")&&(Yr="linear"),a.getComponentMethod("annotations","convertCoords")(zt,cn,Yr,fi),a.getComponentMethod("images","convertCoords")(zt,cn,Yr,fi)}var un=k.containerArrayMatch(sr);if(un){Rr=un.array,zr=un.index;var Pn=un.property,bn=ca||{editType:"calc"};zr!==""&&Pn===""&&(k.isAddVal(Ar)?Ci[sr]=null:k.isRemoveVal(Ar)?Ci[sr]=(P(Pt,Rr).get()||[])[zr]:z.warn("unrecognized full object value",_t)),E.update(yi,bn),ur[Rr]||(ur[Rr]={});var ze=ur[Rr][zr];ze||(ze=ur[Rr][zr]={}),ze[Pn]=Ar,delete _t[sr]}else Un==="reverse"?(Fi.range?Fi.range.reverse():(fi(Li+".autorange",!0),Fi.range=[1,0]),Zi.autorange?yi.calc=!0:yi.plot=!0):(sr==="dragmode"&&(Ar===!1&&Ji!==!1||Ar!==!1&&Ji===!1)||Ht._has("scatter-like")&&Ht._has("regl")&&sr==="dragmode"&&(Ar==="lasso"||Ar==="select")&&!(Ji==="lasso"||Ji==="select")?yi.plot=!0:ca?E.update(yi,ca):yi.calc=!0,vr.set(Ar))}}for(Rr in ur){var yr=k.applyContainerArrayChanges(zt,he(Pt,Rr),ur[Rr],yi,he);yr||(yi.plot=!0)}for(var en in ba){oa=c.getFromId(zt,en);var Rn=oa&&oa._constraintGroup;if(Rn){yi.calc=!0;for(var ni in Rn)ba[ni]||(c.getFromId(zt,ni)._constraintShrinkable=!0)}}(ye(zt)||_t.height||_t.width)&&(yi.plot=!0);var xi=Ht.shapes;for(zr=0;zr1;)if(Ht.pop(),Pt=P(_t,Ht.join(".")+".uirevision").get(),Pt!==void 0)return Pt;return _t.uirevision}function ce(zt,_t){for(var Pt=0;Pt<_t.length;Pt++)if(_t[Pt]._fullInput.uid===zt)return Pt;return-1}function Le(zt,_t,Pt){for(var Ht=0;Ht<_t.length;Ht++)if(_t[Ht].uid===zt)return Ht;return!_t[Pt]||_t[Pt].uid?-1:Pt}function Ze(zt,_t){var Pt=z.isPlainObject(zt),Ht=Array.isArray(zt);return Pt||Ht?(Pt&&z.isPlainObject(_t)||Ht&&Array.isArray(_t))&&JSON.stringify(zt)===JSON.stringify(_t):zt===_t}function Qe(zt,_t,Pt,Ht){var ae=Ht._preGUI,he,Me,qe,Ye,ur,Rr,zr,xr,pn,ci,ui=[],yi={},Gi={};for(he in ae){if(ur=ie(he,Ot),ur){if(pn=ur.head,ci=ur.tail,Me=ur.attr||pn+".uirevision",qe=P(Ht,Me).get(),Ye=qe&&be(Me,_t),Ye&&Ye===qe){if(Rr=ae[he],Rr===null&&(Rr=void 0),zr=P(_t,he),xr=zr.get(),Ze(xr,Rr)){xr===void 0&&ci==="autorange"&&ui.push(pn),zr.set(ot(P(Ht,he).get()));continue}else if(ci==="autorange"||ci.substr(0,6)==="range["){var Ci=ae[pn+".range[0]"],fi=ae[pn+".range[1]"],ba=ae[pn+".autorange"];if(ba||ba===null&&Ci===null&&fi===null){if(!(pn in yi)){var oa=P(_t,pn).get();yi[pn]=oa&&(oa.autorange||oa.autorange!==!1&&(!oa.range||oa.range.length!==2))}if(yi[pn]){zr.set(ot(P(Ht,he).get()));continue}}}}}else z.warn("unrecognized GUI edit: "+he);delete ae[he],ur&&ur.tail.substr(0,6)==="range["&&(Gi[ur.head]=1)}for(var Ke=0;Ke[Li,zt._ev.listeners(Li)]);he=et.newPlot(zt,_t,Pt,Ht).then(()=>{for(let[Li,Fi]of Wn)Fi.forEach(Zi=>zt.on(Li,Zi));return et.react(zt,_t,Pt,Ht)})}else{zt.data=_t||[],w.cleanData(zt.data),zt.layout=Pt||{},w.cleanLayout(zt.layout),Qe(zt.data,zt.layout,qe,Ye),o.supplyDefaults(zt,{skipUpdateCalc:!0});var zr=zt._fullData,xr=zt._fullLayout,pn=xr.datarevision===void 0,ci=xr.transition,ui=Jr(zt,Ye,xr,pn,ci),yi=ui.newDataRevision,Gi=fr(zt,qe,zr,pn,ci,yi);if(ye(zt)&&(ui.layoutReplot=!0),Gi.calc||ui.calc){zt.calcdata=void 0;for(var Ci=Object.getOwnPropertyNames(xr),fi=0;fi(Rr||zt.emit("plotly_react",{config:Ht,data:_t,layout:Pt}),zt))}function fr(zt,_t,Pt,Ht,ae,he){var Me=_t.length===Pt.length;if(!ae&&!Me)return{fullReplot:!0,calc:!0};var qe=E.traceFlags();qe.arrays={},qe.nChanges=0,qe.nChangesAnim=0;var Ye,ur;function Rr(pn){var ci=l.getTraceValObject(ur,pn);return!ur._module.animatable&&ci.anim&&(ci.anim=!1),ci}var zr={getValObject:Rr,flags:qe,immutable:Ht,transition:ae,newDataRevision:he,gd:zt},xr={};for(Ye=0;Ye<_t.length;Ye++)if(Pt[Ye]){if(ur=Pt[Ye]._fullInput,xr[ur.uid])continue;xr[ur.uid]=1,an(_t[Ye]._fullInput,ur,[],zr)}return(qe.calc||qe.plot)&&(qe.fullReplot=!0),ae&&qe.nChanges&&qe.nChangesAnim&&(qe.anim=qe.nChanges===qe.nChangesAnim&&Me?"all":"some"),qe}function Jr(zt,_t,Pt,Ht,ae){var he=E.layoutFlags();he.arrays={},he.rangesAltered={},he.nChanges=0,he.nChangesAnim=0;function Me(xr){return l.getLayoutValObject(Pt,xr)}for(var qe in Pt)if(!(!qe.startsWith("xaxis")&&!qe.startsWith("yaxis"))&&_t[qe]){var Ye=Pt[qe].domain,ur=_t[qe].domain,Rr=_t[qe]._inputDomain;_t[qe]._inputDomain&&(Ye[0]===Rr[0]&&Ye[1]===Rr[1]?Pt[qe].domain=_t[qe].domain:(Ye[0]!==ur[0]||Ye[1]!==ur[1])&&(Pt[qe]._inputDomain=null))}var zr={getValObject:Me,flags:he,immutable:Ht,transition:ae,gd:zt};return an(_t,Pt,[],zr),(he.plot||he.calc)&&(he.layoutReplot=!0),ae&&he.nChanges&&he.nChangesAnim&&(he.anim=he.nChanges===he.nChangesAnim?"all":"some"),he}function an(zt,_t,Pt,Ht){var ae,he,Me,qe=Ht.getValObject,Ye=Ht.flags,ur=Ht.immutable,Rr=Ht.inArray,zr=Ht.arrayIndex;function xr(){var Li=ae.editType;if(Rr&&Li.indexOf("arraydraw")!==-1){z.pushUnique(Ye.arrays[Rr],zr);return}E.update(Ye,ae),Li!=="none"&&Ye.nChanges++,Ht.transition&&ae.anim&&Ye.nChangesAnim++,(Gt.test(Me)||ee.test(Me))&&(Ye.rangesAltered[Pt[0]]=1),he==="datarevision"&&(Ye.newDataRevision=1)}function pn(Li){return Li.valType==="data_array"||Li.arrayOk}for(he in zt){if(Ye.calc&&!Ht.transition)return;var ci=zt[he],ui=_t[he],yi=Pt.concat(he);if(Me=yi.join("."),!(he.charAt(0)==="_"||typeof ci=="function"||ci===ui)){if((he==="tick0"||he==="dtick")&&Pt[0]!=="geo"){var Gi=_t.tickmode;if(Gi==="auto"||Gi==="array"||!Gi)continue}if(!(he==="range"&&_t.autorange)&&!((he==="zmin"||he==="zmax")&&_t.type==="contourcarpet")&&(ae=qe(yi),!!ae&&!(ae._compareAsJSON&&JSON.stringify(ci)===JSON.stringify(ui)))){var Ci=ae.valType,fi,ba=pn(ae),oa=Array.isArray(ci),Ke=Array.isArray(ui);if(oa&&Ke){var sr="_input_"+he,vr=zt[sr],Ar=_t[sr];if(Array.isArray(vr)&&vr===Ar)continue}if(ui===void 0)ba&&oa?Ye.calc=!0:xr();else if(ae._isLinkedToArray){var mn=[],Zn=!1;Rr||(Ye.arrays[he]=mn);var Un=Math.min(ci.length,ui.length),Wn=Math.max(ci.length,ui.length);if(Un!==Wn)if(ae.editType==="arraydraw")Zn=!0;else{xr();continue}for(fi=0;fi=ae.length?ae[0]:ae[ur]:ae}function qe(ur){return Array.isArray(he)?ur>=he.length?he[0]:he[ur]:he}function Ye(ur,Rr){var zr=0;return function(){if(ur&&++zr===Rr)return ur()}}return new Promise(function(ur,Rr){function zr(){if(Ht._frameQueue.length!==0){for(;Ht._frameQueue.length;){var Un=Ht._frameQueue.pop();Un.onInterrupt&&Un.onInterrupt()}zt.emit("plotly_animationinterrupted",[])}}function xr(Un){if(Un.length!==0){for(var Wn=0;WnHt._timeToNext&&ci()};Un()}var yi=0;function Gi(Un){return Array.isArray(ae)?yi>=ae.length?Un.transitionOpts=ae[yi]:Un.transitionOpts=ae[0]:Un.transitionOpts=ae,yi++,Un}var Ci,fi,ba=[],oa=_t==null,Ke=Array.isArray(_t),sr=!oa&&!Ke&&z.isPlainObject(_t);if(sr)ba.push({type:"object",data:Gi(z.extendFlat({},_t))});else if(oa||["string","number"].indexOf(typeof _t)!==-1)for(Ci=0;Ci0&&mnmn)&&Zn.push(fi);ba=Zn}}ba.length>0?xr(ba):(zt.emit("plotly_animated"),ur())})}function dn(zt,_t,Pt){if(zt=z.getGraphDiv(zt),_t==null)return Promise.resolve();if(!z.isPlotDiv(zt))throw new Error("This element is not a Plotly plot: "+zt+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Ht,ae,he,Me,qe=zt._transitionData._frames,Ye=zt._transitionData._frameHash;if(!Array.isArray(_t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+_t);var ur=qe.length+_t.length*2,Rr=[],zr={};for(Ht=_t.length-1;Ht>=0;Ht--)if(z.isPlainObject(_t[Ht])){var xr=_t[Ht].name,pn=(Ye[xr]||zr[xr]||{}).name,ci=_t[Ht].name,ui=Ye[pn]||zr[pn];pn&&ci&&typeof ci=="number"&&ui&&Mvr.index?-1:sr.index=0;Ht--){if(ae=Rr[Ht].frame,typeof ae.name=="number"&&z.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!ae.name)for(;Ye[ae.name="frame "+zt._transitionData._counter++];);if(Ye[ae.name]){for(he=0;he=0;Pt--)Ht=_t[Pt],he.push({type:"delete",index:Ht}),Me.unshift({type:"insert",index:Ht,value:ae[Ht]});var qe=o.modifyFrames,Ye=o.modifyFrames,ur=[zt,Me],Rr=[zt,he];return i&&i.add(zt,qe,ur,Ye,Rr),o.modifyFrames(zt,he)}function Oe(zt){zt=z.getGraphDiv(zt);var _t=zt._fullLayout||{},Pt=zt._fullData||[];return o.cleanPlot([],{},Pt,_t),o.purge(zt),n.purge(zt),_t._container&&_t._container.remove(),delete zt._context,zt}function Xt(zt){var _t=zt._fullLayout,Pt=zt.getBoundingClientRect();if(!z.equalDomRects(Pt,_t._lastBBox)){var Ht=_t._invTransform=z.inverseTransformMatrix(z.getFullTransformMatrix(zt));_t._invScaleX=Math.sqrt(Ht[0][0]*Ht[0][0]+Ht[0][1]*Ht[0][1]+Ht[0][2]*Ht[0][2]),_t._invScaleY=Math.sqrt(Ht[1][0]*Ht[1][0]+Ht[1][1]*Ht[1][1]+Ht[1][2]*Ht[1][2]),_t._lastBBox=Pt}}function oe(zt){var _t=Y.select(zt),Pt=zt._fullLayout;if(Pt._calcInverseTransform=Xt,Pt._calcInverseTransform(zt),Pt._container=_t.selectAll(".plot-container").data([0]),Pt._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Pt._paperdiv=Pt._container.selectAll(".svg-container").data([0]),Pt._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Pt._glcontainer=Pt._paperdiv.selectAll(".gl-container").data([{}]),Pt._glcontainer.enter().append("div").classed("gl-container",!0),Pt._paperdiv.selectAll(".main-svg").remove(),Pt._paperdiv.select(".modebar-container").remove(),Pt._paper=Pt._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Pt._toppaper=Pt._paperdiv.append("svg").classed("main-svg",!0),Pt._modebardiv=Pt._paperdiv.append("div"),delete Pt._modeBar,Pt._hoverpaper=Pt._paperdiv.append("svg").classed("main-svg",!0),!Pt._uid){var Ht={};Y.selectAll("defs").each(function(){this.id&&(Ht[this.id.split("-")[1]]=1)}),Pt._uid=z.randstr(Ht)}Pt._paperdiv.selectAll(".main-svg").attr(_.svgAttrs),Pt._defs=Pt._paper.append("defs").attr("id","defs-"+Pt._uid),Pt._clips=Pt._defs.append("g").classed("clips",!0),Pt._topdefs=Pt._toppaper.append("defs").attr("id","topdefs-"+Pt._uid),Pt._topclips=Pt._topdefs.append("g").classed("clips",!0),Pt._bgLayer=Pt._paper.append("g").classed("bglayer",!0),Pt._draggers=Pt._paper.append("g").classed("draglayer",!0);var ae=Pt._paper.append("g").classed("layer-below",!0);Pt._imageLowerLayer=ae.append("g").classed("imagelayer",!0),Pt._shapeLowerLayer=ae.append("g").classed("shapelayer",!0),Pt._cartesianlayer=Pt._paper.append("g").classed("cartesianlayer",!0),Pt._polarlayer=Pt._paper.append("g").classed("polarlayer",!0),Pt._smithlayer=Pt._paper.append("g").classed("smithlayer",!0),Pt._ternarylayer=Pt._paper.append("g").classed("ternarylayer",!0),Pt._geolayer=Pt._paper.append("g").classed("geolayer",!0),Pt._funnelarealayer=Pt._paper.append("g").classed("funnelarealayer",!0),Pt._pielayer=Pt._paper.append("g").classed("pielayer",!0),Pt._iciclelayer=Pt._paper.append("g").classed("iciclelayer",!0),Pt._treemaplayer=Pt._paper.append("g").classed("treemaplayer",!0),Pt._sunburstlayer=Pt._paper.append("g").classed("sunburstlayer",!0),Pt._indicatorlayer=Pt._toppaper.append("g").classed("indicatorlayer",!0),Pt._glimages=Pt._paper.append("g").classed("glimages",!0);var he=Pt._toppaper.append("g").classed("layer-above",!0);Pt._imageUpperLayer=he.append("g").classed("imagelayer",!0),Pt._shapeUpperLayer=he.append("g").classed("shapelayer",!0),Pt._selectionLayer=Pt._toppaper.append("g").classed("selectionlayer",!0),Pt._infolayer=Pt._toppaper.append("g").classed("infolayer",!0),Pt._menulayer=Pt._toppaper.append("g").classed("menulayer",!0),Pt._zoomlayer=Pt._toppaper.append("g").classed("zoomlayer",!0),Pt._hoverlayer=Pt._hoverpaper.append("g").classed("hoverlayer",!0),Pt._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),zt.emit("plotly_framework")}et.animate=Er,et.addFrames=dn,et.deleteFrames=_n,et.addTraces=gt,et.deleteTraces=it,et.extendTraces=ut,et.moveTraces=st,et.prependTraces=rt,et.newPlot=W,et._doPlot=g,et.purge=Oe,et.react=mr,et.redraw=V,et.relayout=Rt,et.restyle=xt,et.setPlotConfig=S,et.update=ue,et._guiRelayout=Mt(Rt),et._guiRestyle=Mt(xt),et._guiUpdate=Mt(ue),et._storeDirectGUIEdit=dt}),K0=It(et=>{var Y=ls();et.getDelay=function(z){return z._has&&(z._has("gl3d")||z._has("mapbox")||z._has("map"))?500:0},et.getRedrawFunc=function(z){return function(){Y.getComponentMethod("colorbar","draw")(z)}},et.encodeSVG=function(z){return"data:image/svg+xml,"+encodeURIComponent(z)},et.encodeJSON=function(z){return"data:application/json,"+encodeURIComponent(z)};var f=window.URL||window.webkitURL;et.createObjectURL=function(z){return f.createObjectURL(z)},et.revokeObjectURL=function(z){return f.revokeObjectURL(z)},et.createBlob=function(z,P){if(P==="svg")return new window.Blob([z],{type:"image/svg+xml;charset=utf-8"});if(P==="full-json")return new window.Blob([z],{type:"application/json;charset=utf-8"});var n=y(window.atob(z));return new window.Blob([n],{type:"image/"+P})},et.octetStream=function(z){document.location.href="data:application/octet-stream"+z};function y(z){for(var P=z.length,n=new ArrayBuffer(P),i=new Uint8Array(n),a=0;a{var f=Br();jn();var y=Js(),z=Hn();k0();var P=/"/g,n="TOBESTRIPPED",i=new RegExp('("'+n+")|("+n+'")',"g");function a(o){var c=f.select("body").append("div").style({display:"none"}).html(""),s=o.replace(/(&[^;]*;)/gi,function(h){return h==="<"?"<":h==="&rt;"?">":h.indexOf("<")!==-1||h.indexOf(">")!==-1?"":c.html(h).text()});return c.remove(),s}function l(o){return o.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}Y.exports=function(o,c,s){var h=o._fullLayout,m=h._paper,b=h._toppaper,x=h.width,_=h.height,A;m.insert("rect",":first-child").call(y.setRect,0,0,x,_).call(z.fill,h.paper_bgcolor);var d=h._basePlotModules||[];for(A=0;A{var f=jn(),y=Wg().EventEmitter,z=K0();function P(n){var i=n.emitter||new y,a=new Promise(function(l,o){var c=window.Image,s=n.svg,h=n.format||"png",m=n.canvas,b=n.scale||1,x=n.width||300,_=n.height||150,A=b*x,d=b*_,k=m.getContext("2d",{willReadFrequently:!0}),w=new c,D,E;h==="svg"||f.isSafari()?E=z.encodeSVG(s):(D=z.createBlob(s,"svg"),E=z.createObjectURL(D)),m.width=A,m.height=d,w.onload=function(){var I;switch(D=null,z.revokeObjectURL(E),h!=="svg"&&k.drawImage(w,0,0,A,d),h){case"jpeg":I=m.toDataURL("image/jpeg");break;case"png":I=m.toDataURL("image/png");break;case"webp":I=m.toDataURL("image/webp");break;case"svg":I=E;break;default:var M="Image format is not jpeg, png, svg or webp.";if(o(new Error(M)),!n.promise)return i.emit("error",M)}l(I),n.promise||i.emit("success",I)},w.onerror=function(I){if(D=null,z.revokeObjectURL(E),o(I),!n.promise)return i.emit("error",I)},w.src=E});return n.promise?a:i}Y.exports=P}),F4=It((et,Y)=>{var f=Sr(),y=Aw(),z=lh(),P=jn(),n=K0(),i=db(),a=fb(),l=Dn().version,o={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function c(s,h){h=h||{};var m,b,x,_;P.isPlainObject(s)?(m=s.data||[],b=s.layout||{},x=s.config||{},_={}):(s=P.getGraphDiv(s),m=P.extendDeep([],s.data),b=P.extendDeep({},s.layout),x=s._context,_=s._fullLayout||{});function A(W){return!(W in h)||P.validate(h[W],o[W])}if(!A("width")&&h.width!==null||!A("height")&&h.height!==null)throw new Error("Height and width should be pixel values.");if(!A("format"))throw new Error("Export format is not "+P.join2(o.format.values,", "," or ")+".");var d={};function k(W,F){return P.coerce(h,d,o,W,F)}var w=k("format"),D=k("width"),E=k("height"),I=k("scale"),M=k("setBackground"),p=k("imageDataOnly"),g=document.createElement("div");g.style.position="absolute",g.style.left="-5000px",document.body.appendChild(g);var C=P.extendFlat({},b);D?C.width=D:h.width===null&&f(_.width)&&(C.width=_.width),E?C.height=E:h.height===null&&f(_.height)&&(C.height=_.height);var S=P.extendFlat({},x,{_exportedPlot:!0,staticPlot:!0,setBackground:M}),N=n.getRedrawFunc(g);function B(){return new Promise(function(W){setTimeout(W,n.getDelay(g._fullLayout))})}function U(){return new Promise(function(W,F){var H=i(g,w,I),q=g._fullLayout.width,G=g._fullLayout.height;function tt(){y.purge(g),document.body.removeChild(g)}if(w==="full-json"){var ht=z.graphJson(g,!1,"keepdata","object",!0,!0);return ht.version=l,ht=JSON.stringify(ht),tt(),W(p?ht:n.encodeJSON(ht))}if(tt(),w==="svg")return W(p?H:n.encodeSVG(H));var bt=document.createElement("canvas");bt.id=P.randstr(),a({format:w,width:q,height:G,scale:I,canvas:bt,svg:H,promise:!0}).then(W).catch(F)})}function V(W){return p?W.replace(n.IMAGE_URL_PREFIX,""):W}return new Promise(function(W,F){y.newPlot(g,m,C,S).then(N).then(B).then(U).then(function(H){W(V(H))}).catch(function(H){F(H)})})}Y.exports=c}),Lg=It((et,Y)=>{var f=jn(),y=lh(),z=Gg(),P=Mo().dfltConfig,n=f.isPlainObject,i=Array.isArray,a=f.isArrayOrTypedArray;Y.exports=function(d,k){d===void 0&&(d=[]),k===void 0&&(k={});var w=z.get(),D=[],E={_context:f.extendFlat({},P)},I,M;i(d)?(E.data=f.extendDeep([],d),I=d):(E.data=[],I=[],D.push(h("array","data"))),n(k)?(E.layout=f.extendDeep({},k),M=k):(E.layout={},M={},arguments.length>1&&D.push(h("object","layout"))),y.supplyDefaults(E);for(var p=E._fullData,g=I.length,C=0;CN.length&&D.push(h("unused",E,C.concat(N.length)));var H=N.length,q=Array.isArray(F);q&&(H=Math.min(H,F.length));var G,tt,ht,bt,vt;if(B.dimensions===2)for(tt=0;ttN[tt].length&&D.push(h("unused",E,C.concat(tt,N[tt].length)));var ut=N[tt].length;for(G=0;G<(q?Math.min(ut,F[tt].length):ut);G++)ht=q?F[tt][G]:F,bt=S[tt][G],vt=N[tt][G],f.validate(bt,ht)?vt!==bt&&vt!==+bt&&D.push(h("dynamic",E,C.concat(tt,G),bt,vt)):D.push(h("value",E,C.concat(tt,G),bt))}else D.push(h("array",E,C.concat(tt),S[tt]));else for(tt=0;tt{var f=jn(),y=K0();function z(P,n,i){var a=document.createElement("a"),l="download"in a,o=new Promise(function(c,s){var h,m;if(l)return h=y.createBlob(P,i),m=y.createObjectURL(h),a.href=m,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a),y.revokeObjectURL(m),h=null,c(n);if(f.isSafari()){var b=i==="svg"?",":";base64,";return y.octetStream(b+encodeURIComponent(P)),c(n)}s(new Error("download error"))});return o}Y.exports=z}),Mw=It((et,Y)=>{var f=jn(),y=F4(),z=N4();K0();function P(n,i){var a;return f.isPlainObject(n)||(a=f.getGraphDiv(n)),i=i||{},i.format=i.format||"png",i.width=i.width||null,i.height=i.height||null,i.imageDataOnly=!0,new Promise(function(l,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var c=y(n,i),s=i.filename||n.fn||"newplot";s+="."+i.format.replace("-","."),c.then(function(h){return a&&(a._snapshotInProgress=!1),z(h,s,i.format)}).then(function(h){l(h)}).catch(function(h){a&&(a._snapshotInProgress=!1),o(h)})})}Y.exports=P}),D_=It(et=>{var Y=jn(),f=Y.isPlainObject,y=Gg(),z=lh(),P=xa(),n=Tc(),i=Mo().dfltConfig;et.makeTemplate=function(x){x=Y.isPlainObject(x)?x:Y.getGraphDiv(x),x=Y.extendDeep({_context:i},{data:x.data,layout:x.layout}),z.supplyDefaults(x);var _=x.data||[],A=x.layout||{};A._basePlotModules=x._fullLayout._basePlotModules,A._modules=x._fullLayout._modules;var d={data:{},layout:{}};_.forEach(function(S){var N={};o(S,N,s.bind(null,S));var B=Y.coerce(S,{},P,"type"),U=d.data[B];U||(U=d.data[B]=[]),U.push(N)}),o(A,d.layout,c.bind(null,A)),delete d.layout.template;var k=A.template;if(f(k)){var w=k.layout,D,E,I,M,p,g;f(w)&&a(w,d.layout);var C=k.data;if(f(C)){for(E in d.data)if(I=C[E],Array.isArray(I)){for(p=d.data[E],g=p.length,M=I.length,D=0;DV?D.push({code:"unused",traceType:S,templateCount:U,dataCount:V}):V>U&&D.push({code:"reused",traceType:S,templateCount:U,dataCount:V})}}function W(F,H){for(var q in F)if(q.charAt(0)!=="_"){var G=F[q],tt=h(F,q,H);f(G)?(Array.isArray(F)&&G._template===!1&&G.templateitemname&&D.push({code:"missing",path:tt,templateitemname:G.templateitemname}),W(G,tt)):Array.isArray(G)&&m(G)&&W(G,tt)}}if(W({data:I,layout:E},""),D.length)return D.map(b)};function m(x){for(var _=0;_{var Y=Aw();et._doPlot=Y._doPlot,et.newPlot=Y.newPlot,et.restyle=Y.restyle,et.relayout=Y.relayout,et.redraw=Y.redraw,et.update=Y.update,et._guiRestyle=Y._guiRestyle,et._guiRelayout=Y._guiRelayout,et._guiUpdate=Y._guiUpdate,et._storeDirectGUIEdit=Y._storeDirectGUIEdit,et.react=Y.react,et.extendTraces=Y.extendTraces,et.prependTraces=Y.prependTraces,et.addTraces=Y.addTraces,et.deleteTraces=Y.deleteTraces,et.moveTraces=Y.moveTraces,et.purge=Y.purge,et.addFrames=Y.addFrames,et.deleteFrames=Y.deleteFrames,et.animate=Y.animate,et.setPlotConfig=Y.setPlotConfig;var f=W0().getGraphDiv,y=xw().eraseActiveShape;et.deleteActiveShape=function(P){return y(f(P))},et.toImage=F4(),et.validate=Lg(),et.downloadImage=Mw();var z=D_();et.makeTemplate=z.makeTemplate,et.validateTemplate=z.validateTemplate}),Xg=It((et,Y)=>{var f=jn(),y=ls();Y.exports=function(z,P,n,i){var a=i("x"),l=i("y"),o,c=y.getComponentMethod("calendars","handleTraceDefaults");if(c(z,P,["x","y"],n),a){var s=f.minRowLength(a);l?o=Math.min(s,f.minRowLength(l)):(o=s,i("y0"),i("dy"))}else{if(!l)return 0;o=f.minRowLength(l),i("x0"),i("dx")}return P._length=o,o}}),S0=It((et,Y)=>{var f=jn().dateTick0,y=Dr(),z=y.ONEWEEK;function P(n,i){return n%z===0?f(i,1):f(i,0)}Y.exports=function(n,i,a,l,o){if(o||(o={x:!0,y:!0}),o.x){var c=l("xperiod");c&&(l("xperiod0",P(c,i.xcalendar)),l("xperiodalignment"))}if(o.y){var s=l("yperiod");s&&(l("yperiod0",P(s,i.ycalendar)),l("yperiodalignment"))}}}),j4=It((et,Y)=>{var f=["orientation","groupnorm","stackgaps"];Y.exports=function(y,z,P,n){var i=P._scatterStackOpts,a=n("stackgroup");if(a){var l=z.xaxis+z.yaxis,o=i[l];o||(o=i[l]={});var c=o[a],s=!1;c?c.traces.push(z):(c=o[a]={traceIndices:[],traces:[z]},s=!0);for(var h={orientation:z.x&&!z.y?"h":"v"},m=0;m{var f=Hn(),y=fp().hasColorscale,z=Cu(),P=Fu();Y.exports=function(n,i,a,l,o,c){var s=P.isBubble(n),h=(n.line||{}).color,m;if(c=c||{},h&&(a=h),o("marker.symbol"),o("marker.opacity",s?.7:1),o("marker.size"),c.noAngle||(o("marker.angle"),c.noAngleRef||o("marker.angleref"),c.noStandOff||o("marker.standoff")),o("marker.color",a),y(n,"marker")&&z(n,i,l,o,{prefix:"marker.",cLetter:"c"}),c.noSelect||(o("selected.marker.color"),o("unselected.marker.color"),o("selected.marker.size"),o("unselected.marker.size")),c.noLine||(h&&!Array.isArray(h)&&i.marker.color!==h?m=h:s?m=f.background:m=f.defaultLine,o("marker.line.color",m),y(n,"marker.line")&&z(n,i,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width",s?1:0)),s&&(o("marker.sizeref"),o("marker.sizemin"),o("marker.sizemode")),c.gradient){var b=o("marker.gradient.type");b!=="none"&&o("marker.gradient.color")}}}),Lm=It((et,Y)=>{var f=jn().isArrayOrTypedArray,y=fp().hasColorscale,z=Cu();Y.exports=function(P,n,i,a,l,o){o||(o={});var c=(P.marker||{}).color;if(c&&c._inputArray&&(c=c._inputArray),l("line.color",i),y(P,"line"))z(P,n,a,l,{prefix:"line.",cLetter:"c"});else{var s=(f(c)?!1:c)||i;l("line.color",s)}l("line.width"),o.noDash||l("line.dash"),o.backoff&&l("line.backoff")}}),oy=It((et,Y)=>{Y.exports=function(f,y,z){var P=z("line.shape");P==="spline"&&z("line.smoothing")}}),pm=It((et,Y)=>{var f=jn();Y.exports=function(y,z,P,n,i){i=i||{},n("textposition"),f.coerceFont(n,"textfont",i.font||P.font,i),i.noSelect||(n("selected.textfont.color"),n("unselected.textfont.color"))}}),Pm=It((et,Y)=>{var f=Hn(),y=jn().isArrayOrTypedArray;function z(P){for(var n=f.interpolate(P[0][1],P[1][1],.5),i=2;i{var f=jn(),y=ls(),z=dd(),P=Eg(),n=Fu(),i=Xg(),a=S0(),l=j4(),o=Y0(),c=Lm(),s=oy(),h=pm(),m=Pm(),b=jn().coercePattern;Y.exports=function(x,_,A,d){function k(C,S){return f.coerce(x,_,z,C,S)}var w=i(x,_,d,k);if(w||(_.visible=!1),!!_.visible){a(x,_,d,k),k("xhoverformat"),k("yhoverformat"),k("zorder");var D=l(x,_,d,k);d.scattermode==="group"&&_.orientation===void 0&&k("orientation","v");var E=!D&&w{var f=iy().getAxisGroup;Y.exports=function(y,z,P,n,i){var a=z.orientation,l=z[{v:"x",h:"y"}[a]+"axis"],o=f(P,l)+a,c=P._alignmentOpts||{},s=n("alignmentgroup"),h=c[o];h||(h=c[o]={});var m=h[s];m?m.traces.push(z):m=h[s]={traces:[z],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var b=n("offsetgroup")||"",x=m.offsetGroups,_=x[b];z._offsetIndex=0,(i!=="group"||b)&&(_||(_=x[b]={offsetIndex:Object.keys(x).length}),z._offsetIndex=_.offsetIndex)}}),$4=It((et,Y)=>{var f=jn(),y=Xv(),z=dd();Y.exports=function(P,n){var i,a,l,o=n.scattermode;function c(x){return f.coerce(a._input,a,z,x)}if(n.scattermode==="group")for(l=0;l=0;m--){var b=P[m];if(b.type==="scatter"&&b.xaxis===s.xaxis&&b.yaxis===s.yaxis){b.opacity=void 0;break}}}}}}),H4=It((et,Y)=>{var f=jn(),y=Nv();Y.exports=function(z,P){function n(a,l){return f.coerce(z,P,y,a,l)}var i=P.barmode==="group";P.scattermode==="group"&&n("scattergap",i?P.bargap:.2)}}),Im=It((et,Y)=>{var f=Sr(),y=jn(),z=y.dateTime2ms,P=y.incrementMonth,n=Dr(),i=n.ONEAVGMONTH;Y.exports=function(a,l,o,c){if(l.type!=="date")return{vals:c};var s=a[o+"periodalignment"];if(!s)return{vals:c};var h=a[o+"period"],m;if(f(h)){if(h=+h,h<=0)return{vals:c}}else if(typeof h=="string"&&h.charAt(0)==="M"){var b=+h.substring(1);if(b>0&&Math.round(b)===b)m=b;else return{vals:c}}for(var x=l.calendar,_=s==="start",A=s==="end",d=a[o+"period0"],k=z(d,x)||0,w=[],D=[],E=[],I=c.length,M=0;Mp;)S=P(S,-m,x);for(;S<=p;)S=P(S,m,x);C=P(S,-m,x)}else{for(g=Math.round((p-k)/h),S=k+g*h;S>p;)S-=h;for(;S<=p;)S+=h;C=S-h}w[M]=_?C:A?S:(C+S)/2,D[M]=C,E[M]=S}return{vals:w,starts:D,ends:E}}}),Dm=It((et,Y)=>{var f=fp().hasColorscale,y=Cp(),z=Fu();Y.exports=function(P,n){z.hasLines(n)&&f(n,"line")&&y(P,n,{vals:n.line.color,containerStr:"line",cLetter:"c"}),z.hasMarkers(n)&&(f(n,"marker")&&y(P,n,{vals:n.marker.color,containerStr:"marker",cLetter:"c"}),f(n,"marker.line")&&y(P,n,{vals:n.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),ft=It((et,Y)=>{var f=jn();Y.exports=function(y,z){for(var P=0;P{var f=jn();Y.exports=function(y,z){f.isArrayOrTypedArray(z.selectedpoints)&&f.tagSelected(y,z)}}),_e=It((et,Y)=>{var f=Sr(),y=jn(),z=Fs(),P=Im(),n=Dr().BADNUM,i=Fu(),a=Dm(),l=ft(),o=$t();function c(_,A){var d=_._fullLayout,k=A._xA=z.getFromId(_,A.xaxis||"x","x"),w=A._yA=z.getFromId(_,A.yaxis||"y","y"),D=k.makeCalcdata(A,"x"),E=w.makeCalcdata(A,"y"),I=P(A,k,"x",D),M=P(A,w,"y",E),p=I.vals,g=M.vals,C=A._length,S=new Array(C),N=A.ids,B=x(A,d,k,w),U=!1,V,W,F,H,q,G;m(d,A);var tt="x",ht="y",bt;if(B)y.pushUnique(B.traceIndices,A.index),V=B.orientation==="v",V?(ht="s",bt="x"):(tt="s",bt="y"),q=B.stackgaps==="interpolate";else{var vt=h(A,C);s(_,A,k,w,p,g,vt)}var ut=!!A.xperiodalignment,rt=!!A.yperiodalignment;for(W=0;WW&&S[H].gap;)H--;for(G=S[H].s,F=S.length-1;F>H;F--)S[F].s=G;for(;W{Y.exports=y;var f=jn().distinctVals;function y(z,P){this.traces=z,this.sepNegVal=P.sepNegVal,this.overlapNoMerge=P.overlapNoMerge;for(var n=1/0,i=P.posAxis._id.charAt(0),a=[],l=0;l{var f=Sr(),y=jn().isArrayOrTypedArray,z=Dr().BADNUM,P=ls(),n=Fs(),i=iy().getAxisGroup,a=ir();function l(S,N){for(var B=N.xaxis,U=N.yaxis,V=S._fullLayout,W=S._fullData,F=S.calcdata,H=[],q=[],G=0;Gq+F||!f(H))}for(var tt=0;tt{var f=_e(),y=Wr().setGroupPositions;function z(i,a){for(var l=a.xaxis,o=a.yaxis,c=i._fullLayout,s=i._fullData,h=i.calcdata,m=[],b=[],x=0;xB[x]&&x{var f=Js(),y=Dr(),z=y.BADNUM,P=y.LOG_CLIP,n=P+.5,i=P-.5,a=jn(),l=a.segmentsIntersect,o=a.constrain,c=Eg();Y.exports=function(s,h){var m=h.trace||{},b=h.xaxis,x=h.yaxis,_=b.type==="log",A=x.type==="log",d=b._length,k=x._length,w=h.backoff,D=m.marker,E=h.connectGaps,I=h.baseTolerance,M=h.shape,p=M==="linear",g=m.fill&&m.fill!=="none",C=[],S=c.minTolerance,N=s.length,B=new Array(N),U=0,V,W,F,H,q,G,tt,ht,bt,vt,ut,rt,gt,it,st,xt;function ot(Me){var qe=s[Me];if(!qe)return!1;var Ye=h.linearized?b.l2p(qe.x):b.c2p(qe.x),ur=h.linearized?x.l2p(qe.y):x.c2p(qe.y);if(Ye===z){if(_&&(Ye=b.c2p(qe.x,!0)),Ye===z)return!1;A&&ur===z&&(Ye*=Math.abs(b._m*k*(b._m>0?n:i)/(x._m*d*(x._m>0?n:i)))),Ye*=1e3}if(ur===z){if(A&&(ur=x.c2p(qe.y,!0)),ur===z)return!1;ur*=1e3}return[Ye,ur]}function J(Me,qe,Ye,ur){var Rr=Ye-Me,zr=ur-qe,xr=.5-Me,pn=.5-qe,ci=Rr*Rr+zr*zr,ui=Rr*xr+zr*pn;if(ui>0&&ui1||Math.abs(xr.y-Ye[0][1])>1)&&(xr=[xr.x,xr.y],ur&&Rt(xr,Me)Gt||Me[1]xe)return[o(Me[0],Zt,Gt),o(Me[1],ee,xe)]}function Le(Me,qe){if(Me[0]===qe[0]&&(Me[0]===Zt||Me[0]===Gt)||Me[1]===qe[1]&&(Me[1]===ee||Me[1]===xe))return!0}function Ze(Me,qe){var Ye=[],ur=ce(Me),Rr=ce(qe);return ur&&Rr&&Le(ur,Rr)||(ur&&Ye.push(ur),Rr&&Ye.push(Rr)),Ye}function Qe(Me,qe,Ye){return function(ur,Rr){var zr=ce(ur),xr=ce(Rr),pn=[];if(zr&&xr&&Le(zr,xr))return pn;zr&&pn.push(zr),xr&&pn.push(xr);var ci=2*a.constrain((ur[Me]+Rr[Me])/2,qe,Ye)-((zr||ur)[Me]+(xr||Rr)[Me]);if(ci){var ui;zr&&xr?ui=ci>0==zr[Me]>xr[Me]?zr:xr:ui=zr||xr,ui[Me]+=ci}return pn}}var mr;M==="linear"||M==="spline"?mr=be:M==="hv"||M==="vh"?mr=Ze:M==="hvh"?mr=Qe(0,Zt,Gt):M==="vhv"&&(mr=Qe(1,ee,xe));function fr(Me,qe){var Ye=qe[0]-Me[0],ur=(qe[1]-Me[1])/Ye,Rr=(Me[1]*qe[0]-qe[1]*Me[0])/Ye;return Rr>0?[ur>0?Zt:Gt,xe]:[ur>0?Gt:Zt,ee]}function Jr(Me){var qe=Me[0],Ye=Me[1],ur=qe===B[U-1][0],Rr=Ye===B[U-1][1];if(!(ur&&Rr))if(U>1){var zr=qe===B[U-2][0],xr=Ye===B[U-2][1];ur&&(qe===Zt||qe===Gt)&&zr?xr?U--:B[U-1]=Me:Rr&&(Ye===ee||Ye===xe)&&xr?zr?U--:B[U-1]=Me:B[U++]=Me}else B[U++]=Me}function an(Me){B[U-1][0]!==Me[0]&&B[U-1][1]!==Me[1]&&Jr([Mt,Ot]),Jr(Me),Lt=null,Mt=Ot=0}var Er=a.isArrayOrTypedArray(D);function dn(Me){if(Me&&w&&(Me.i=V,Me.d=s,Me.trace=m,Me.marker=Er?D[Me.i]:D,Me.backoff=w),mt=Me[0]/d,dt=Me[1]/k,ye=Me[0]Gt?Gt:0,ue=Me[1]xe?xe:0,ye||ue){if(!U)B[U++]=[ye||Me[0],ue||Me[1]];else if(Lt){var qe=mr(Lt,Me);qe.length>1&&(an(qe[0]),B[U++]=qe[1])}else ie=mr(B[U-1],Me)[0],B[U++]=ie;var Ye=B[U-1];ye&&ue&&(Ye[0]!==ye||Ye[1]!==ue)?(Lt&&(Mt!==ye&&Ot!==ue?Jr(Mt&&Ot?fr(Lt,Me):[Mt||ye,Ot||ue]):Mt&&Ot&&Jr([Mt,Ot])),Jr([ye,ue])):Mt-ye&&Ot-ue&&Jr([ye||Mt,ue||Ot]),Lt=Me,Mt=ye,Ot=ue}else Lt&&an(mr(Lt,Me)[0]),B[U++]=Me}for(V=0;VCt(G,_n))break;F=G,gt=bt[0]*ht[0]+bt[1]*ht[1],gt>ut?(ut=gt,H=G,tt=!1):gt=s.length||!G)break;dn(G),W=G}}Lt&&Jr([Mt||Lt[0],Ot||Lt[1]]),C.push(B.slice(0,U))}var Oe=M.slice(M.length-1);if(w&&Oe!=="h"&&Oe!=="v"){for(var Xt=!1,oe=-1,zt=[],_t=0;_t{var f={tonextx:1,tonexty:1,tonext:1};Y.exports=function(y,z,P){var n,i,a,l,o,c={},s=!1,h=-1,m=0,b=-1;for(i=0;i=0?o=b:(o=b=m,m++),o{var f=Br(),y=ls(),z=jn(),P=z.ensureSingle,n=z.identity,i=Js(),a=Fu(),l=ia(),o=ro(),c=Ag().tester;Y.exports=function(b,x,_,A,d,k){var w,D,E=!d,I=!!d&&d.duration>0,M=o(b,x,_);if(w=A.selectAll("g.trace").data(M,function(g){return g[0].trace.uid}),w.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),w.order(),s(b,w,x),I){k&&(D=k());var p=f.transition().duration(d.duration).ease(d.easing).each("end",function(){D&&D()}).each("interrupt",function(){D&&D()});p.each(function(){A.selectAll("g.trace").each(function(g,C){h(b,C,x,g,M,this,d)})})}else w.each(function(g,C){h(b,C,x,g,M,this,d)});E&&w.exit().remove(),A.selectAll("path:not([d])").remove()};function s(b,x,_){x.each(function(A){var d=P(f.select(this),"g","fills");i.setClipUrl(d,_.layerClipId,b);var k=A[0].trace,w=[];k._ownfill&&w.push("_ownFill"),k._nexttrace&&w.push("_nextFill");var D=d.selectAll("g").data(w,n);D.enter().append("g"),D.exit().each(function(E){k[E]=null}).remove(),D.order().each(function(E){k[E]=P(f.select(this),"path","js-fill")})})}function h(b,x,_,A,d,k,w){var D=b._context.staticPlot,E;m(b,x,_,A,d);var I=!!w&&w.duration>0;function M(an){return I?an.transition():an}var p=_.xaxis,g=_.yaxis,C=A[0].trace,S=C.line,N=f.select(k),B=P(N,"g","errorbars"),U=P(N,"g","lines"),V=P(N,"g","points"),W=P(N,"g","text");if(y.getComponentMethod("errorbars","plot")(b,B,_,w),C.visible!==!0)return;M(N).style("opacity",C.opacity);var F,H,q=C.fill.charAt(C.fill.length-1);q!=="x"&&q!=="y"&&(q="");var G,tt;q==="y"?(G=1,tt=g.c2p(0,!0)):q==="x"&&(G=0,tt=p.c2p(0,!0)),A[0][_.isRangePlot?"nodeRangePlot3":"node3"]=N;var ht="",bt=[],vt=C._prevtrace,ut=null,rt=null;vt&&(ht=vt._prevRevpath||"",H=vt._nextFill,bt=vt._ownPolygons,ut=vt._fillsegments,rt=vt._fillElement);var gt,it,st="",xt="",ot,J,mt,dt,Ct,Rt,Bt=[];C._polygons=[];var Zt=[],Gt=[],ee=z.noop;if(F=C._ownFill,a.hasLines(C)||C.fill!=="none"){H&&H.datum(A),["hv","vh","hvh","vhv"].indexOf(S.shape)!==-1?(ot=i.steps(S.shape),J=i.steps(S.shape.split("").reverse().join(""))):S.shape==="spline"?ot=J=function(an){var Er=an[an.length-1];return an.length>1&&an[0][0]===Er[0]&&an[0][1]===Er[1]?i.smoothclosed(an.slice(1),S.smoothing):i.smoothopen(an,S.smoothing)}:ot=J=function(an){return"M"+an.join("L")},mt=function(an){return J(an.reverse())},Gt=l(A,{xaxis:p,yaxis:g,trace:C,connectGaps:C.connectgaps,baseTolerance:Math.max(S.width||1,3)/4,shape:S.shape,backoff:S.backoff,simplify:S.simplify,fill:C.fill}),Zt=new Array(Gt.length);var xe=0;for(E=0;E=D[0]&&N.x<=D[1]&&N.y>=E[0]&&N.y<=E[1]}),g=Math.ceil(p.length/M),C=0;d.forEach(function(N,B){var U=N[0].trace;a.hasMarkers(U)&&U.marker.maxdisplayed>0&&B{Y.exports={container:"marker",min:"cmin",max:"cmax"}}),tl=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i={_fullLayout:P},a=f.getFromTrace(i,z,"x"),l=f.getFromTrace(i,z,"y"),o=y.orig_x;o===void 0&&(o=y.x);var c=y.orig_y;return c===void 0&&(c=y.y),n.xLabel=f.tickText(a,a.c2l(o),!0).text,n.yLabel=f.tickText(l,l.c2l(c),!0).text,n}}),Il=It((et,Y)=>{var f=Br(),y=Js(),z=ls();function P(l){var o=f.select(l).selectAll("g.trace.scatter");o.style("opacity",function(c){return c[0].trace.opacity}),o.selectAll("g.points").each(function(c){var s=f.select(this),h=c.trace||c[0].trace;n(s,h,l)}),o.selectAll("g.text").each(function(c){var s=f.select(this),h=c.trace||c[0].trace;i(s,h,l)}),o.selectAll("g.trace path.js-line").call(y.lineGroupStyle),o.selectAll("g.trace path.js-fill").call(y.fillGroupStyle,l,!1),z.getComponentMethod("errorbars","style")(o)}function n(l,o,c){y.pointStyle(l.selectAll("path.point"),o,c)}function i(l,o,c){y.textPointStyle(l.selectAll("text"),o,c)}function a(l,o,c){var s=o[0].trace;s.selectedpoints?(y.selectedPointStyle(c.selectAll("path.point"),s),y.selectedTextStyle(c.selectAll("text"),s)):(n(c,s,l),i(c,s,l))}Y.exports={style:P,stylePoints:n,styleText:i,styleOnSelect:a}}),qc=It((et,Y)=>{var f=Hn(),y=Fu();Y.exports=function(z,P){var n,i;if(z.mode==="lines")return n=z.line.color,n&&f.opacity(n)?n:z.fillcolor;if(z.mode==="none")return z.fill?z.fillcolor:"";var a=P.mcc||(z.marker||{}).color,l=P.mlcc||((z.marker||{}).line||{}).color;return i=a&&f.opacity(a)?a:l&&f.opacity(l)&&(P.mlw||((z.marker||{}).line||{}).width)?l:"",i?f.opacity(i)<.3?f.addOpacity(i,.3):i:(n=(z.line||{}).color,n&&f.opacity(n)&&y.hasLines(z)&&z.line.width?n:z.fillcolor)}}),Kf=It((et,Y)=>{var f=jn(),y=hd(),z=ls(),P=qc(),n=Hn(),i=f.fillText;Y.exports=function(a,l,o,c){var s=a.cd,h=s[0].trace,m=a.xa,b=a.ya,x=m.c2p(l),_=b.c2p(o),A=[x,_],d=h.hoveron||"",k=h.mode.indexOf("markers")!==-1?3:.5,w=!!h.xperiodalignment,D=!!h.yperiodalignment;if(d.indexOf("points")!==-1){var E=function(ht){if(w){var bt=m.c2p(ht.xStart),vt=m.c2p(ht.xEnd);return x>=Math.min(bt,vt)&&x<=Math.max(bt,vt)?0:1/0}var ut=Math.max(3,ht.mrc||0),rt=1-1/ut,gt=Math.abs(m.c2p(ht.x)-x);return gt=Math.min(bt,vt)&&_<=Math.max(bt,vt)?0:1/0}var ut=Math.max(3,ht.mrc||0),rt=1-1/ut,gt=Math.abs(b.c2p(ht.y)-_);return gtst!=Bt>=st&&(dt=J[ot-1][0],Ct=J[ot][0],Bt-Rt&&(mt=dt+(Ct-dt)*(st-Rt)/(Bt-Rt),ut=Math.min(ut,mt),rt=Math.max(rt,mt)));return ut=Math.max(ut,0),rt=Math.min(rt,m._length),{x0:ut,x1:rt,y0:st,y1:st}}if(d.indexOf("fills")!==-1&&h._fillElement){var q=F(h._fillElement)&&!F(h._fillExclusionElement);if(q){var G=H(h._polygons);G===null&&(G={x0:A[0],x1:A[0],y0:A[1],y1:A[1]});var tt=n.defaultLine;return n.opacity(h.fillcolor)?tt=h.fillcolor:n.opacity((h.line||{}).color)&&(tt=h.line.color),f.extendFlat(a,{distance:a.maxHoverDistance,x0:G.x0,x1:G.x1,y0:G.y0,y1:G.y1,color:tt,hovertemplate:!1}),delete a.index,h.text&&!f.isArrayOrTypedArray(h.text)?a.text=String(h.text):a.text=h.name,[a]}}}}),Qd=It((et,Y)=>{var f=Fu();Y.exports=function(y,z){var P=y.cd,n=y.xaxis,i=y.yaxis,a=[],l=P[0].trace,o,c,s,h,m=!f.hasMarkers(l)&&!f.hasText(l);if(m)return[];if(z===!1)for(o=0;o{Y.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),c0=It((et,Y)=>{var f=ls().traceIs,y=ty();Y.exports=function(a,l,o,c){o("autotypenumbers",c.autotypenumbersDflt);var s=o("type",(c.splomStash||{}).type);s==="-"&&(z(l,c.data),l.type==="-"?l.type="linear":a.type=l.type)};function z(a,l){if(a.type==="-"){var o=a._id,c=o.charAt(0),s;o.indexOf("scene")!==-1&&(o=c);var h=P(l,o,c);if(h){if(h.type==="histogram"&&c==={v:"y",h:"x"}[h.orientation||"v"]){a.type="linear";return}var m=c+"calendar",b=h[m],x={noMultiCategory:!f(h,"cartesian")||f(h,"noMultiCategory")};if(h.type==="box"&&h._hasPreCompStats&&c==={h:"x",v:"y"}[h.orientation||"v"]&&(x.noMultiCategory=!0),x.autotypenumbers=a.autotypenumbers,i(h,c)){var _=n(h),A=[];for(s=0;s0&&(s["_"+o+"axes"]||{})[l]||(s[o+"axis"]||o)===l&&(i(s,o)||(s[o]||[]).length||s[o+"0"]))return s}}function n(a){return{v:"x",h:"y"}[a.orientation||"v"]}function i(a,l){var o=n(a),c=f(a,"box-violin"),s=f(a._fullInput||{},"candlestick");return c&&!s&&l===o&&a[o]===void 0&&a[o+"0"]===void 0}}),Jg=It((et,Y)=>{var f=Xn().isTypedArraySpec;function y(z,P){var n=P.dataAttr||z._id.charAt(0),i={},a,l,o;if(P.axData)a=P.axData;else for(a=[],l=0;l0||f(a),o;l&&(o="array");var c=n("categoryorder",o),s;c==="array"&&(s=n("categoryarray")),!l&&c==="array"&&(c=P.categoryorder="trace"),c==="trace"?P._initialCategories=[]:c==="array"?P._initialCategories=s.slice():(s=y(P,i).sort(),c==="category ascending"?P._initialCategories=s:c==="category descending"&&(P._initialCategories=s.reverse()))}}}),pb=It((et,Y)=>{var f=Xi().mix,y=Sn(),z=jn();Y.exports=function(P,n,i,a){a=a||{};var l=a.dfltColor;function o(g,C){return z.coerce2(P,n,a.attributes,g,C)}var c=o("linecolor",l),s=o("linewidth"),h=i("showline",a.showLine||!!c||!!s);h||(delete n.linecolor,delete n.linewidth);var m=f(l,a.bgColor,a.blend||y.lightFraction).toRgbString(),b=o("gridcolor",m),x=o("gridwidth"),_=o("griddash"),A=i("showgrid",a.showGrid||!!b||!!x||!!_);if(A||(delete n.gridcolor,delete n.gridwidth,delete n.griddash),a.hasMinor){var d=f(n.gridcolor,a.bgColor,67).toRgbString(),k=o("minor.gridcolor",d),w=o("minor.gridwidth",n.gridwidth||1),D=o("minor.griddash",n.griddash||"solid"),E=i("minor.showgrid",!!k||!!w||!!D);E||(delete n.minor.gridcolor,delete n.minor.gridwidth,delete n.minor.griddash)}if(!a.noZeroLine){o("zerolinelayer");var I=o("zerolinecolor",l),M=o("zerolinewidth"),p=i("zeroline",a.showGrid||!!I||!!M);p||(delete n.zerolinelayer,delete n.zerolinecolor,delete n.zerolinewidth)}}}),mb=It((et,Y)=>{var f=Sr(),y=ls(),z=jn(),P=Tc(),n=Zf(),i=Gf(),a=jv(),l=Uv(),o=q0(),c=Sg(),s=Jg(),h=pb(),m=hw(),b=G0(),x=fu().WEEKDAY_PATTERN,_=fu().HOUR_PATTERN;Y.exports=function(w,D,E,I,M){var p=I.letter,g=I.font||{},C=I.splomStash||{},S=E("visible",!I.visibleDflt),N=D._template||{},B=D.type||N.type||"-",U;if(B==="date"){var V=y.getComponentMethod("calendars","handleDefaults");V(w,D,"calendar",I.calendar),I.noTicklabelmode||(U=E("ticklabelmode"))}!I.noTicklabelindex&&(B==="date"||B==="linear")&&E("ticklabelindex");var W="";(!I.noTicklabelposition||B==="multicategory")&&(W=z.coerce(w,D,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:U==="period"?["outside","inside"]:p==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),I.noTicklabeloverflow||E("ticklabeloverflow",W.indexOf("inside")!==-1?"hide past domain":B==="category"||B==="multicategory"?"allow":"hide past div"),b(D,M),m(w,D,E,I),s(w,D,E,I),I.noHover||(B!=="category"&&E("hoverformat"),I.noUnifiedhovertitle||E("unifiedhovertitle.text"));var F=E("color"),H=F!==i.color.dflt?F:g.color,q=C.label||M._dfltTitle[p];if(c(w,D,E,B,I),!S)return D;E("title.text",q),z.coerceFont(E,"title.font",g,{overrideDflt:{size:z.bigFont(g.size),color:H}}),a(w,D,E,B);var G=I.hasMinor;if(G&&(P.newContainer(D,"minor"),a(w,D,E,B,{isMinor:!0})),o(w,D,E,B,I),l(w,D,E,I),G){var tt=I.isMinor;I.isMinor=!0,l(w,D,E,I),I.isMinor=tt}h(w,D,E,{dfltColor:F,bgColor:I.bgColor,showGrid:I.showGrid,hasMinor:G,attributes:i}),G&&!D.minor.ticks&&!D.minor.showgrid&&delete D.minor,(D.showline||D.ticks)&&E("mirror");var ht=B==="multicategory";if(!I.noTickson&&(B==="category"||ht)&&(D.ticks||D.showgrid)&&(ht?(E("tickson","boundaries"),delete D.ticklabelposition):E("tickson")),ht){var bt=E("showdividers");bt&&(E("dividercolor"),E("dividerwidth"))}if(B==="date")if(n(w,D,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:A}),!D.rangebreaks.length)delete D.rangebreaks;else{for(var vt=0;vt=2){var g="",C,S;if(p.length===2){for(C=0;C<2;C++)if(S=k(p[C]),S){g=x;break}}var N=I("pattern",g);if(N===x)for(C=0;C<2;C++)S=k(p[C]),S&&(D.bounds[C]=p[C]=S-1);if(N)for(C=0;C<2;C++)switch(S=p[C],N){case x:if(!f(S)){D.enabled=!1;return}if(S=+S,S!==Math.floor(S)||S<0||S>=7){D.enabled=!1;return}D.bounds[C]=p[C]=S;break;case _:if(!f(S)){D.enabled=!1;return}if(S=+S,S<0||S>24){D.enabled=!1;return}D.bounds[C]=p[C]=S;break}if(E.autorange===!1){var B=E.range;if(B[0]B[1]){D.enabled=!1;return}}else if(p[0]>B[0]&&p[1]{var f=Sr(),y=jn();Y.exports=function(z,P,n,i){var a=i.counterAxes||[],l=i.overlayableAxes||[],o=i.letter,c=i.grid,s=i.overlayingDomain,h,m,b,x,_,A;c&&(m=c._domains[o][c._axisMap[P._id]],h=c._anchors[P._id],m&&(b=c[o+"side"].split(" ")[0],x=c.domain[o][b==="right"||b==="top"?1:0])),m=m||[0,1],h=h||(f(z.position)?"free":a[0]||"free"),b=b||(o==="x"?"bottom":"left"),x=x||0,_=0,A=!1;var d=y.coerce(z,P,{anchor:{valType:"enumerated",values:["free"].concat(a),dflt:h}},"anchor"),k=y.coerce(z,P,{side:{valType:"enumerated",values:o==="x"?["bottom","top"]:["left","right"],dflt:b}},"side");if(d==="free"){if(o==="y"){var w=n("autoshift");w&&(x=k==="left"?s[0]:s[1],A=P.automargin?P.automargin:!0,_=k==="left"?-3:3),n("shift",_)}n("position",x)}n("automargin",A);var D=!1;if(l.length&&(D=y.coerce(z,P,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!D){var E=n("domain",m);E[0]>E[1]-1/4096&&(P.domain=m),y.noneOrAll(z.domain,P.domain,m),P.tickmode==="sync"&&(P.tickmode="auto")}return n("layer"),P}}),V4=It((et,Y)=>{var f=jn(),y=Hn(),z=T0().isUnifiedHover,P=ey(),n=Tc(),i=k_(),a=Gf(),l=c0(),o=mb(),c=iy(),s=Ew(),h=Ku(),m=h.id2name,b=h.name2id,x=fu().AX_ID_PATTERN,_=ls(),A=_.traceIs,d=_.getComponentMethod;function k(w,D,E){Array.isArray(w[D])?w[D].push(E):w[D]=[E]}Y.exports=function(w,D,E){var I=D.autotypenumbers,M={},p={},g={},C={},S={},N={},B={},U={},V={},W={},F,H;for(F=0;F{var f=Br(),y=ls(),z=jn(),P=Js(),n=Fs();Y.exports=function(i,a,l,o){var c=i._fullLayout;if(a.length===0){n.redrawComponents(i);return}function s(D){var E=D.xaxis,I=D.yaxis;c._defs.select("#"+D.clipId+"> rect").call(P.setTranslate,0,0).call(P.setScale,1,1),D.plot.call(P.setTranslate,E._offset,I._offset).call(P.setScale,1,1);var M=D.plot.selectAll(".scatterlayer .trace");M.selectAll(".point").call(P.setPointGroupScale,1,1),M.selectAll(".textpoint").call(P.setTextPointsScale,1,1),M.call(P.hideOutsideRangePoints,D)}function h(D,E){var I=D.plotinfo,M=I.xaxis,p=I.yaxis,g=M._length,C=p._length,S=!!D.xr1,N=!!D.yr1,B=[];if(S){var U=z.simpleMap(D.xr0,M.r2l),V=z.simpleMap(D.xr1,M.r2l),W=U[1]-U[0],F=V[1]-V[0];B[0]=(U[0]*(1-E)+E*V[0]-U[0])/(U[1]-U[0])*g,B[2]=g*(1-E+E*F/W),M.range[0]=M.l2r(U[0]*(1-E)+E*V[0]),M.range[1]=M.l2r(U[1]*(1-E)+E*V[1])}else B[0]=0,B[2]=g;if(N){var H=z.simpleMap(D.yr0,p.r2l),q=z.simpleMap(D.yr1,p.r2l),G=H[1]-H[0],tt=q[1]-q[0];B[1]=(H[1]*(1-E)+E*q[1]-H[1])/(H[0]-H[1])*C,B[3]=C*(1-E+E*tt/G),p.range[0]=M.l2r(H[0]*(1-E)+E*q[0]),p.range[1]=p.l2r(H[1]*(1-E)+E*q[1])}else B[1]=0,B[3]=C;n.drawOne(i,M,{skipTitle:!0}),n.drawOne(i,p,{skipTitle:!0}),n.redrawComponents(i,[M._id,p._id]);var ht=S?g/B[2]:1,bt=N?C/B[3]:1,vt=S?B[0]:0,ut=N?B[1]:0,rt=S?B[0]/B[2]*g:0,gt=N?B[1]/B[3]*C:0,it=M._offset-rt,st=p._offset-gt;I.clipRect.call(P.setTranslate,vt,ut).call(P.setScale,1/ht,1/bt),I.plot.call(P.setTranslate,it,st).call(P.setScale,ht,bt),P.setPointGroupScale(I.zoomScalePts,1/ht,1/bt),P.setTextPointsScale(I.zoomScaleTxt,1/ht,1/bt)}var m;o&&(m=o());function b(){for(var D={},E=0;El.duration?(b(),d=window.cancelAnimationFrame(w)):d=window.requestAnimationFrame(w)}return _=Date.now(),d=window.requestAnimationFrame(w),Promise.resolve()}}),Fd=It(et=>{var Y=Br(),f=ls(),y=jn(),z=lh(),P=Js(),n=Mf().getModuleCalcData,i=Ku(),a=fu(),l=k0(),o=y.ensureSingle;function c(A,d,k){return y.ensureSingle(A,d,k,function(w){w.datum(k)})}var s=a.zindexSeparator;et.name="cartesian",et.attr=["xaxis","yaxis"],et.idRoot=["x","y"],et.idRegex=a.idRegex,et.attrRegex=a.attrRegex,et.attributes=mm(),et.layoutAttributes=Gf(),et.supplyLayoutDefaults=V4(),et.transitionAxes=C8(),et.finalizeSubplots=function(A,d){var k=d._subplots,w=k.xaxis,D=k.yaxis,E=k.cartesian,I=E,M={},p={},g,C,S;for(g=0;g0){var B=N.id;if(B.indexOf(s)!==-1)continue;B+=s+(g+1),N=y.extendFlat({},N,{id:B,plot:D._cartesianlayer.selectAll(".subplot").select("."+B)})}for(var U=[],V,W=0;W1&&(tt+=s+G),q.push(M+tt),I=0;I1,S=d.mainplotinfo;if(!d.mainplot||C)if(g)d.xlines=o(w,"path","xlines-above"),d.ylines=o(w,"path","ylines-above"),d.xaxislayer=o(w,"g","xaxislayer-above"),d.yaxislayer=o(w,"g","yaxislayer-above");else{if(!I){var N=o(w,"g","layer-subplot");d.shapelayer=o(N,"g","shapelayer"),d.imagelayer=o(N,"g","imagelayer"),S&&C?(d.minorGridlayer=S.minorGridlayer,d.gridlayer=S.gridlayer,d.zerolinelayer=S.zerolinelayer):(d.minorGridlayer=o(w,"g","minor-gridlayer"),d.gridlayer=o(w,"g","gridlayer"),d.zerolinelayer=o(w,"g","zerolinelayer"));var B=o(w,"g","layer-between");d.shapelayerBetween=o(B,"g","shapelayer"),d.imagelayerBetween=o(B,"g","imagelayer"),o(w,"path","xlines-below"),o(w,"path","ylines-below"),d.overlinesBelow=o(w,"g","overlines-below"),o(w,"g","xaxislayer-below"),o(w,"g","yaxislayer-below"),d.overaxesBelow=o(w,"g","overaxes-below")}d.overplot=o(w,"g","overplot"),d.plot=o(d.overplot,"g",D),S&&C?d.zerolinelayerAbove=S.zerolinelayerAbove:d.zerolinelayerAbove=o(w,"g","zerolinelayer-above"),I||(d.xlines=o(w,"path","xlines-above"),d.ylines=o(w,"path","ylines-above"),d.overlinesAbove=o(w,"g","overlines-above"),o(w,"g","xaxislayer-above"),o(w,"g","yaxislayer-above"),d.overaxesAbove=o(w,"g","overaxes-above"),d.xlines=w.select(".xlines-"+M),d.ylines=w.select(".ylines-"+p),d.xaxislayer=w.select(".xaxislayer-"+M),d.yaxislayer=w.select(".yaxislayer-"+p))}else{var U=S.plotgroup,V=D+"-x",W=D+"-y";d.minorGridlayer=S.minorGridlayer,d.gridlayer=S.gridlayer,d.zerolinelayer=S.zerolinelayer,d.zerolinelayerAbove=S.zerolinelayerAbove,o(S.overlinesBelow,"path",V),o(S.overlinesBelow,"path",W),o(S.overaxesBelow,"g",V),o(S.overaxesBelow,"g",W),d.plot=o(S.overplot,"g",D),o(S.overlinesAbove,"path",V),o(S.overlinesAbove,"path",W),o(S.overaxesAbove,"g",V),o(S.overaxesAbove,"g",W),d.xlines=U.select(".overlines-"+M).select("."+V),d.ylines=U.select(".overlines-"+p).select("."+W),d.xaxislayer=U.select(".overaxes-"+M).select("."+V),d.yaxislayer=U.select(".overaxes-"+p).select("."+W)}I||(g||(c(d.minorGridlayer,"g",d.xaxis._id),c(d.minorGridlayer,"g",d.yaxis._id),d.minorGridlayer.selectAll("g").map(function(F){return F[0]}).sort(i.idSort),c(d.gridlayer,"g",d.xaxis._id),c(d.gridlayer,"g",d.yaxis._id),d.gridlayer.selectAll("g").map(function(F){return F[0]}).sort(i.idSort)),d.xlines.style("fill","none").classed("crisp",!0),d.ylines.style("fill","none").classed("crisp",!0))}function x(A,d){if(A){var k={};A.each(function(p){var g=p[0],C=Y.select(this);C.remove(),_(g,d),k[g]=!0});for(var w in d._plots)for(var D=d._plots[w],E=D.overlays||[],I=0;I{var f=Fu();Y.exports={hasLines:f.hasLines,hasMarkers:f.hasMarkers,hasText:f.hasText,isBubble:f.isBubble,attributes:dd(),layoutAttributes:Nv(),supplyDefaults:U4(),crossTraceDefaults:$4(),supplyLayoutDefaults:H4(),calc:_e().calc,crossTraceCalc:$n(),arraysToCalcdata:ft(),plot:fo(),colorbar:Do(),formatLabels:tl(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:Kf(),selectPoints:Qd(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Fd(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),gb=It((et,Y)=>{var f=Br(),y=Hn(),z=Sw(),P=jn(),n=P.strScale,i=P.strRotate,a=P.strTranslate;Y.exports=function(l,o,c){var s=l.node(),h=z[c.arrowhead||0],m=z[c.startarrowhead||0],b=(c.arrowwidth||1)*(c.arrowsize||1),x=(c.arrowwidth||1)*(c.startarrowsize||1),_=o.indexOf("start")>=0,A=o.indexOf("end")>=0,d=h.backoff*b+c.standoff,k=m.backoff*x+c.startstandoff,w,D,E,I;if(s.nodeName==="line"){w={x:+l.attr("x1"),y:+l.attr("y1")},D={x:+l.attr("x2"),y:+l.attr("y2")};var M=w.x-D.x,p=w.y-D.y;if(E=Math.atan2(p,M),I=E+Math.PI,d&&k&&d+k>Math.sqrt(M*M+p*p)){G();return}if(d){if(d*d>M*M+p*p){G();return}var g=d*Math.cos(E),C=d*Math.sin(E);D.x+=g,D.y+=C,l.attr({x2:D.x,y2:D.y})}if(k){if(k*k>M*M+p*p){G();return}var S=k*Math.cos(E),N=k*Math.sin(E);w.x-=S,w.y-=N,l.attr({x1:w.x,y1:w.y})}}else if(s.nodeName==="path"){var B=s.getTotalLength(),U="";if(B{var f=Br(),y=ls(),z=lh(),P=jn(),n=P.strTranslate,i=Fs(),a=Hn(),l=Js(),o=hd(),c=uu(),s=Mm(),h=Up(),m=Tc().arrayEditor,b=gb();Y.exports={draw:x,drawOne:_,drawRaw:d};function x(k){var w=k._fullLayout;w._infolayer.selectAll(".annotation").remove();for(var D=0;D2/3?fi="right":fi="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[fi]}for(var be=!1,ce=["x","y"],Le=0;Le1)&&(mr===Qe?(he=fr.r2fraction(w["a"+Ze]),(he<0||he>1)&&(be=!0)):be=!0),oe=fr._offset+fr.r2p(w[Ze]),Pt=.5}else{var Me=ae==="domain";Ze==="x"?(_t=w[Ze],oe=Me?fr._offset+fr._length*_t:oe=g.l+g.w*_t):(_t=1-w[Ze],oe=Me?fr._offset+fr._length*_t:oe=g.t+g.h*_t),Pt=w.showarrow?.5:_t}if(w.showarrow){Xt.head=oe;var qe=w["a"+Ze];if(Ht=an*ie(.5,w.xanchor)-Er*ie(.5,w.yanchor),mr===Qe){var Ye=i.getRefType(mr);Ye==="domain"?(Ze==="y"&&(qe=1-qe),Xt.tail=fr._offset+fr._length*qe):Ye==="paper"?Ze==="y"?(qe=1-qe,Xt.tail=g.t+g.h*qe):Xt.tail=g.l+g.w*qe:Xt.tail=fr._offset+fr.r2p(qe),zt=Ht}else Xt.tail=oe+qe,zt=Ht+qe;Xt.text=Xt.tail+Ht;var ur=p[Ze==="x"?"width":"height"];if(Qe==="paper"&&(Xt.head=P.constrain(Xt.head,1,ur-1)),mr==="pixel"){var Rr=-Math.max(Xt.tail-3,Xt.text),zr=Math.min(Xt.tail+3,Xt.text)-ur;Rr>0?(Xt.tail+=Rr,Xt.text+=Rr):zr>0&&(Xt.tail-=zr,Xt.text-=zr)}Xt.tail+=Oe,Xt.head+=Oe}else Ht=dn*ie(Pt,_n),zt=Ht,Xt.text=oe+Ht;Xt.text+=Oe,Ht+=Oe,zt+=Oe,w["_"+Ze+"padplus"]=dn/2+zt,w["_"+Ze+"padminus"]=dn/2-zt,w["_"+Ze+"size"]=dn,w["_"+Ze+"shift"]=Ht}if(be){ut.remove();return}var xr=0,pn=0;if(w.align!=="left"&&(xr=(ue-ge)*(w.align==="center"?.5:1)),w.valign!=="top"&&(pn=(Mt-ye)*(w.valign==="middle"?.5:1)),ee)Gt.select("svg").attr({x:it+xr-1,y:it+pn}).call(l.setClipUrl,xt?F:null,k);else{var ci=it+pn-xe.top,ui=it+xr-xe.left;dt.call(c.positionText,ui,ci).call(l.setClipUrl,xt?F:null,k)}ot.select("rect").call(l.setRect,it,it,ue,Mt),st.call(l.setRect,rt/2,rt/2,Ot-rt,Lt-rt),ut.call(l.setTranslate,Math.round(H.x.text-Ot/2),Math.round(H.y.text-Lt/2)),tt.attr({transform:"rotate("+q+","+H.x.text+","+H.y.text+")"});var yi=function(Ci,fi){G.selectAll(".annotation-arrow-g").remove();var ba=H.x.head,oa=H.y.head,Ke=H.x.tail+Ci,sr=H.y.tail+fi,vr=H.x.text+Ci,Ar=H.y.text+fi,mn=P.rotationXYMatrix(q,vr,Ar),Zn=P.apply2DTransform(mn),Un=P.apply2DTransform2(mn),Wn=+st.attr("width"),Li=+st.attr("height"),Fi=vr-.5*Wn,Zi=Fi+Wn,Ji=Ar-.5*Li,ca=Ji+Li,Ei=[[Fi,Ji,Fi,ca],[Fi,ca,Zi,ca],[Zi,ca,Zi,Ji],[Zi,Ji,Fi,Ji]].map(Un);if(!Ei.reduce(function(ze,yr){return ze^!!P.segmentsIntersect(ba,oa,ba+1e6,oa+1e6,yr[0],yr[1],yr[2],yr[3])},!1)){Ei.forEach(function(ze){var yr=P.segmentsIntersect(Ke,sr,ba,oa,ze[0],ze[1],ze[2],ze[3]);yr&&(Ke=yr.x,sr=yr.y)});var Ga=w.arrowwidth,so=w.arrowcolor,Fe=w.arrowside,Re=G.append("g").style({opacity:a.opacity(so)}).classed("annotation-arrow-g",!0),Kr=Re.append("path").attr("d","M"+Ke+","+sr+"L"+ba+","+oa).style("stroke-width",Ga+"px").call(a.stroke,a.rgb(so));if(b(Kr,Fe,w),C.annotationPosition&&Kr.node().parentNode&&!E){var sn=ba,cn=oa;if(w.standoff){var Yr=Math.sqrt(Math.pow(ba-Ke,2)+Math.pow(oa-sr,2));sn+=w.standoff*(Ke-ba)/Yr,cn+=w.standoff*(sr-oa)/Yr}var un=Re.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Ke-sn)+","+(sr-cn),transform:n(sn,cn)}).style("stroke-width",Ga+6+"px").call(a.stroke,"rgba(0,0,0,0)").call(a.fill,"rgba(0,0,0,0)"),Pn,bn;h.init({element:un.node(),gd:k,prepFn:function(){var ze=l.getTranslate(ut);Pn=ze.x,bn=ze.y,I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0)},moveFn:function(ze,yr){var en=Zn(Pn,bn),Rn=en[0]+ze,ni=en[1]+yr;ut.call(l.setTranslate,Rn,ni),V("x",A(I,ze,"x",g,w)),V("y",A(M,yr,"y",g,w)),w.axref===w.xref&&V("ax",A(I,ze,"ax",g,w)),w.ayref===w.yref&&V("ay",A(M,yr,"ay",g,w)),Re.attr("transform",n(ze,yr)),tt.attr({transform:"rotate("+q+","+Rn+","+ni+")"})},doneFn:function(){y.call("_guiRelayout",k,W());var ze=document.querySelector(".js-notes-box-panel");ze&&ze.redraw(ze.selectedObj)}})}}};if(w.showarrow&&yi(0,0),ht){var Gi;h.init({element:ut.node(),gd:k,prepFn:function(){Gi=tt.attr("transform")},moveFn:function(Ci,fi){var ba="pointer";if(w.showarrow)w.axref===w.xref?V("ax",A(I,Ci,"ax",g,w)):V("ax",w.ax+Ci),w.ayref===w.yref?V("ay",A(M,fi,"ay",g.w,w)):V("ay",w.ay+fi),yi(Ci,fi);else{if(E)return;var oa,Ke;if(I)oa=A(I,Ci,"x",g,w);else{var sr=w._xsize/g.w,vr=w.x+(w._xshift-w.xshift)/g.w-sr/2;oa=h.align(vr+Ci/g.w,sr,0,1,w.xanchor)}if(M)Ke=A(M,fi,"y",g,w);else{var Ar=w._ysize/g.h,mn=w.y-(w._yshift+w.yshift)/g.h-Ar/2;Ke=h.align(mn-fi/g.h,Ar,0,1,w.yanchor)}V("x",oa),V("y",Ke),(!I||!M)&&(ba=h.getCursor(I?.5:oa,M?.5:Ke,w.xanchor,w.yanchor))}tt.attr({transform:n(Ci,fi)+Gi}),s(ut,ba)},clickFn:function(Ci,fi){w.captureevents&&k.emit("plotly_clickannotation",vt(fi))},doneFn:function(){s(ut),y.call("_guiRelayout",k,W());var Ci=document.querySelector(".js-notes-box-panel");Ci&&Ci.redraw(Ci.selectedObj)}})}}C.annotationText?dt.call(c.makeEditable,{delegate:ut,gd:k}).call(Ct).on("edit",function(Bt){w.text=Bt,this.call(Ct),V("text",Bt),I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0),y.call("_guiRelayout",k,W())}):dt.call(Ct)}}),A8=It((et,Y)=>{var f=jn(),y=ls(),z=Tc().arrayEditor;Y.exports={hasClickToShow:P,onClick:n};function P(l,o){var c=i(l,o);return c.on.length>0||c.explicitOff.length>0}function n(l,o){var c=i(l,o),s=c.on,h=c.off.concat(c.explicitOff),m={},b=l._fullLayout.annotations,x,_;if(s.length||h.length){for(x=0;x{var f=jn(),y=Hn();Y.exports=function(z,P,n,i){i("opacity");var a=i("bgcolor"),l=i("bordercolor"),o=y.opacity(l);i("borderpad");var c=i("borderwidth"),s=i("showarrow");i("text",s?" ":n._dfltTitle.annotation),i("textangle"),f.coerceFont(i,"font",n.font),i("width"),i("align");var h=i("height");if(h&&i("valign"),s){var m=i("arrowside"),b,x;m.indexOf("end")!==-1&&(b=i("arrowhead"),x=i("arrowsize")),m.indexOf("start")!==-1&&(i("startarrowhead",b),i("startarrowsize",x)),i("arrowcolor",o?P.bordercolor:y.defaultLine),i("arrowwidth",(o&&c||1)*2),i("standoff"),i("startstandoff")}var _=i("hovertext"),A=n.hoverlabel||{};if(_){var d=i("hoverlabel.bgcolor",A.bgcolor||(y.opacity(a)?y.rgb(a):y.defaultLine)),k=i("hoverlabel.bordercolor",A.bordercolor||y.contrast(d)),w=f.extendFlat({},A.font);w.color||(w.color=k),f.coerceFont(i,"hoverlabel.font",w)}i("captureevents",!!_)}}),Pw=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=W4(),n=Mg();Y.exports=function(a,l){z(a,l,{name:"annotations",handleItemDefaults:i})};function i(a,l,o){function c(g,C){return f.coerce(a,l,n,g,C)}var s=c("visible"),h=c("clicktoshow");if(s||h){P(a,l,o,c);for(var m=l.showarrow,b=["x","y"],x=[-10,-30],_={_fullLayout:o},A=0;A<2;A++){var d=b[A],k=y.coerceRef(a,l,_,d,"","paper");if(k!=="paper"){var w=y.getFromId(_,k);w._annIndices.push(l._index)}if(y.coercePosition(l,_,c,k,d,.5),m){var D="a"+d,E=y.coerceRef(a,l,_,D,"pixel",["pixel","paper"]);E!=="pixel"&&E!==k&&(E=l[D]="pixel");var I=E==="pixel"?x[A]:.4;y.coercePosition(l,_,c,E,D,I)}c(d+"anchor"),c(d+"shift")}if(f.noneOrAll(a,l,["x","y"]),m&&f.noneOrAll(a,l,["ax","ay"]),h){var M=c("xclick"),p=c("yclick");l._xclick=M===void 0?l.x:y.cleanPosition(M,_,l.xref),l._yclick=p===void 0?l.y:y.cleanPosition(p,_,l.yref)}}}}),q4=It((et,Y)=>{var f=jn(),y=Fs(),z=Lw().draw;Y.exports=function(i){var a=i._fullLayout,l=f.filterVisible(a.annotations);if(l.length&&i._fullData.length)return f.syncOrAsync([z,P],i)};function P(i){var a=i._fullLayout;f.filterVisible(a.annotations).forEach(function(l){var o=y.getFromId(i,l.xref),c=y.getFromId(i,l.yref),s=y.getRefType(l.xref),h=y.getRefType(l.yref);l._extremes={},s==="range"&&n(l,o),h==="range"&&n(l,c)})}function n(i,a){var l=a._id,o=l.charAt(0),c=i[o],s=i["a"+o],h=i[o+"ref"],m=i["a"+o+"ref"],b=i["_"+o+"padplus"],x=i["_"+o+"padminus"],_={x:1,y:-1}[o]*i[o+"shift"],A=3*i.arrowsize*i.arrowwidth||0,d=A+_,k=A-_,w=3*i.startarrowsize*i.arrowwidth||0,D=w+_,E=w-_,I;if(m===h){var M=y.findExtremes(a,[a.r2c(c)],{ppadplus:d,ppadminus:k}),p=y.findExtremes(a,[a.r2c(s)],{ppadplus:Math.max(b,D),ppadminus:Math.max(x,E)});I={min:[M.min[0],p.min[0]],max:[M.max[0],p.max[0]]}}else D=s?D+s:D,E=s?E-s:E,I=y.findExtremes(a,[a.r2c(c)],{ppadplus:Math.max(b,d,D),ppadminus:Math.max(x,k,E)});i._extremes[l]=I}}),M8=It((et,Y)=>{var f=Sr(),y=_a();Y.exports=function(z,P,n,i){P=P||{};var a=n==="log"&&P.type==="linear",l=n==="linear"&&P.type==="log";if(!(a||l))return;var o=z._fullLayout.annotations,c=P._id.charAt(0),s,h;function m(x){var _=s[x],A=null;a?A=y(_,P.range):A=Math.pow(10,_),f(A)||(A=null),i(h+x,A)}for(var b=0;b{var f=Lw(),y=A8();Y.exports={moduleType:"component",name:"annotations",layoutAttributes:Mg(),supplyLayoutDefaults:Pw(),includeBasePlot:Yv()("annotations"),calcAutorange:q4(),draw:f.draw,drawOne:f.drawOne,drawRaw:f.drawRaw,hasClickToShow:y.hasClickToShow,onClick:y.onClick,convertCoords:M8()}}),E8=It((et,Y)=>{var f=Mg(),y=sh().overrideAll,z=Tc().templatedArray;Y.exports=y(z("annotation",{visible:f.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:f.xanchor,xshift:f.xshift,yanchor:f.yanchor,yshift:f.yshift,text:f.text,textangle:f.textangle,font:f.font,width:f.width,height:f.height,opacity:f.opacity,align:f.align,valign:f.valign,bgcolor:f.bgcolor,bordercolor:f.bordercolor,borderpad:f.borderpad,borderwidth:f.borderwidth,showarrow:f.showarrow,arrowcolor:f.arrowcolor,arrowhead:f.arrowhead,startarrowhead:f.startarrowhead,arrowside:f.arrowside,arrowsize:f.arrowsize,startarrowsize:f.startarrowsize,arrowwidth:f.arrowwidth,standoff:f.standoff,startstandoff:f.startstandoff,hovertext:f.hovertext,hoverlabel:f.hoverlabel,captureevents:f.captureevents}),"calc","from-root")}),WW=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=W4(),n=E8();Y.exports=function(a,l,o){z(a,l,{name:"annotations",handleItemDefaults:i,fullLayout:o.fullLayout})};function i(a,l,o,c){function s(b,x){return f.coerce(a,l,n,b,x)}function h(b){var x=b+"axis",_={_fullLayout:{}};return _._fullLayout[x]=o[x],y.coercePosition(l,_,s,b,b,.5)}var m=s("visible");m&&(P(a,l,c.fullLayout,s),h("x"),h("y"),h("z"),f.noneOrAll(a,l,["x","y","z"]),l.xref="x",l.yref="y",l.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),l.showarrow&&(l.axref="pixel",l.ayref="pixel",s("ax",-10),s("ay",-30),f.noneOrAll(a,l,["ax","ay"])))}}),qW=It((et,Y)=>{var f=jn(),y=Fs();Y.exports=function(P){for(var n=P.fullSceneLayout,i=n.annotations,a=0;a{function f(z,P){var n=[0,0,0,0],i,a;for(i=0;i<4;++i)for(a=0;a<4;++a)n[a]+=z[4*i+a]*P[i];return n}function y(z,P){var n=f(z.projection,f(z.view,f(z.model,[P[0],P[1],P[2],1])));return n}Y.exports=y}),GW=It((et,Y)=>{var f=Lw().drawRaw,y=DL(),z=["x","y","z"];Y.exports=function(P){for(var n=P.fullSceneLayout,i=P.dataScale,a=n.annotations,l=0;l1){c=!0;break}}c?P.fullLayout._infolayer.select(".annotation-"+P.id+'[data-index="'+l+'"]').remove():(o._pdata=y(P.glplot.cameraParams,[n.xaxis.r2l(o.x)*i[0],n.yaxis.r2l(o.y)*i[1],n.zaxis.r2l(o.z)*i[2]]),f(P.graphDiv,o,l,P.id,o._xa,o._ya))}}}),ZW=It((et,Y)=>{var f=ls(),y=jn();Y.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:E8()}}},layoutAttributes:E8(),handleDefaults:WW(),includeBasePlot:z,convert:qW(),draw:GW()};function z(P,n){var i=f.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,l=Object.keys(P),o=0;o{var f=Mg(),y=hi(),z=dd().line,P=qf().dash,n=Yn().extendFlat,i=Tc().templatedArray;hb();var a=xa(),{shapeTexttemplateAttrs:l,templatefallbackAttrs:o}=nu(),c=w_();Y.exports=i("shape",{visible:n({},a.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:n({},a.legend,{editType:"calc+arraydraw"}),legendgroup:n({},a.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:n({},a.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:y({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:n({},a.legendrank,{editType:"calc+arraydraw"}),legendwidth:n({},a.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:n({},f.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:n({},f.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:n({},z.color,{editType:"arraydraw"}),width:n({},z.width,{editType:"calc+arraydraw"}),dash:n({},P,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:l({},{keys:Object.keys(c)}),texttemplatefallback:o({editType:"arraydraw"}),font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),KW=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=zL(),n=l0();Y.exports=function(l,o){z(l,o,{name:"shapes",handleItemDefaults:a})};function i(l,o){return l?"bottom":o.indexOf("top")!==-1?"top":o.indexOf("bottom")!==-1?"bottom":"middle"}function a(l,o,c){function s(rt,gt){return f.coerce(l,o,P,rt,gt)}o._isShape=!0;var h=s("visible");if(h){var m=s("showlegend");m&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),f.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var b=s("path"),x=b?"path":"rect",_=s("type",x),A=_!=="path";A&&delete o.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule");var d=s("line.width");d&&(s("line.color"),s("line.dash"));for(var k=s("xsizemode"),w=s("ysizemode"),D=["x","y"],E=0;E<2;E++){var I=D[E],M=I+"anchor",p=I==="x"?k:w,g={_fullLayout:c},C,S,N,B=y.coerceRef(l,o,g,I,void 0,"paper"),U=y.getRefType(B);if(U==="range"?(C=y.getFromId(g,B),C._shapeIndices.push(o._index),N=n.rangeToShapePosition(C),S=n.shapePositionToRange(C),(C.type==="category"||C.type==="multicategory")&&(s(I+"0shift"),s(I+"1shift"))):S=N=f.identity,A){var V=.25,W=.75,F=I+"0",H=I+"1",q=l[F],G=l[H];l[F]=S(l[F],!0),l[H]=S(l[H],!0),p==="pixel"?(s(F,0),s(H,10)):(y.coercePosition(o,g,s,B,F,V),y.coercePosition(o,g,s,B,H,W)),o[F]=N(o[F]),o[H]=N(o[H]),l[F]=q,l[H]=G}if(p==="pixel"){var tt=l[M];l[M]=S(l[M],!0),y.coercePosition(o,g,s,B,M,.25),o[M]=N(o[M]),l[M]=tt}}A&&f.noneOrAll(l,o,["x0","x1","y0","y1"]);var ht=_==="line",bt,vt;if(A&&(bt=s("label.texttemplate"),s("label.texttemplatefallback")),bt||(vt=s("label.text")),vt||bt){s("label.textangle");var ut=s("label.textposition",ht?"middle":"middle center");s("label.xanchor"),s("label.yanchor",i(ht,ut)),s("label.padding"),f.coerceFont(s,"label.font",c.font)}}}}),YW=It((et,Y)=>{var f=Hn(),y=jn();function z(P,n){return P?"bottom":n.indexOf("top")!==-1?"top":n.indexOf("bottom")!==-1?"bottom":"middle"}Y.exports=function(P,n,i){i("newshape.visible"),i("newshape.name"),i("newshape.showlegend"),i("newshape.legend"),i("newshape.legendwidth"),i("newshape.legendgroup"),i("newshape.legendgrouptitle.text"),y.coerceFont(i,"newshape.legendgrouptitle.font"),i("newshape.legendrank"),i("newshape.drawdirection"),i("newshape.layer"),i("newshape.fillcolor"),i("newshape.fillrule"),i("newshape.opacity");var a=i("newshape.line.width");if(a){var l=(P||{}).plot_bgcolor||"#FFF";i("newshape.line.color",f.contrast(l)),i("newshape.line.dash")}var o=P.dragmode==="drawline",c=i("newshape.label.text"),s=i("newshape.label.texttemplate");if(i("newshape.label.texttemplatefallback"),c||s){i("newshape.label.textangle");var h=i("newshape.label.textposition",o?"middle":"middle center");i("newshape.label.xanchor"),i("newshape.label.yanchor",z(o,h)),i("newshape.label.padding"),y.coerceFont(i,"newshape.label.font",n.font)}i("activeshape.fillcolor"),i("activeshape.opacity")}}),XW=It((et,Y)=>{var f=jn(),y=Fs(),z=ib(),P=l0();Y.exports=function(o){var c=o._fullLayout,s=f.filterVisible(c.shapes);if(!(!s.length||!o._fullData.length))for(var h=0;h0?d+x:x;return{ppad:x,ppadplus:_?w:D,ppadminus:_?D:w}}else return{ppad:x}}function l(o,c,s){var h=o._id.charAt(0)==="x"?"x":"y",m=o.type==="category"||o.type==="multicategory",b,x,_=0,A=0,d=m?o.r2c:o.d2c,k=c[h+"sizemode"]==="scaled";if(k?(b=c[h+"0"],x=c[h+"1"],m&&(_=c[h+"0shift"],A=c[h+"1shift"])):(b=c[h+"anchor"],x=c[h+"anchor"]),b!==void 0)return[d(b)+_,d(x)+A];if(c.path){var w=1/0,D=-1/0,E=c.path.match(z.segmentRE),I,M,p,g,C;for(o.type==="date"&&(d=P.decodeDate(d)),I=0;ID&&(D=C)));if(D>=w)return[w,D]}}}),JW=It((et,Y)=>{var f=xw();Y.exports={moduleType:"component",name:"shapes",layoutAttributes:zL(),supplyLayoutDefaults:KW(),supplyDrawNewShapeDefaults:YW(),includeBasePlot:Yv()("shapes"),calcAutorange:XW(),draw:f.draw,drawOne:f.drawOne}}),OL=It((et,Y)=>{var f=fu(),y=Tc().templatedArray;hb(),Y.exports=y("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",f.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",f.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),QW=It((et,Y)=>{var f=jn(),y=Fs(),z=Zf(),P=OL(),n="images";Y.exports=function(a,l){var o={name:n,handleItemDefaults:i};z(a,l,o)};function i(a,l,o){function c(k,w){return f.coerce(a,l,P,k,w)}var s=c("source"),h=c("visible",!!s);if(!h)return l;c("layer"),c("xanchor"),c("yanchor"),c("sizex"),c("sizey"),c("sizing"),c("opacity");for(var m={_fullLayout:o},b=["x","y"],x=0;x<2;x++){var _=b[x],A=y.coerceRef(a,l,m,_,"paper",void 0);if(A!=="paper"){var d=y.getFromId(m,A);d._imgIndices.push(l._index)}y.coercePosition(l,m,c,A,_,0)}return l}}),tq=It((et,Y)=>{var f=Br(),y=Js(),z=Fs(),P=Ku(),n=k0();Y.exports=function(i){var a=i._fullLayout,l=[],o={},c=[],s,h;for(h=0;h{var f=Sr(),y=_a();Y.exports=function(z,P,n,i){P=P||{};var a=n==="log"&&P.type==="linear",l=n==="linear"&&P.type==="log";if(a||l){for(var o=z._fullLayout.images,c=P._id.charAt(0),s,h,m=0;m{Y.exports={moduleType:"component",name:"images",layoutAttributes:OL(),supplyLayoutDefaults:QW(),includeBasePlot:Yv()("images"),draw:tq(),convertCoords:eq()}}),L8=It((et,Y)=>{Y.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}}),BL=It((et,Y)=>{var f=hi(),y=Sn(),z=Yn().extendFlat,P=sh().overrideAll,n=Jx(),i=Tc().templatedArray,a=i("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});Y.exports=P(i("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:a,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:z(n({editType:"arraydraw"}),{}),font:f({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:y.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),nq=It((et,Y)=>{var f=jn(),y=Zf(),z=BL(),P=L8(),n=P.name,i=z.buttons;Y.exports=function(o,c){var s={name:n,handleItemDefaults:a};y(o,c,s)};function a(o,c,s){function h(x,_){return f.coerce(o,c,z,x,_)}var m=y(o,c,{name:"buttons",handleItemDefaults:l}),b=h("visible",m.length>0);b&&(h("active"),h("direction"),h("type"),h("showactive"),h("x"),h("y"),f.noneOrAll(o,c,["x","y"]),h("xanchor"),h("yanchor"),h("pad.t"),h("pad.r"),h("pad.b"),h("pad.l"),f.coerceFont(h,"font",s.font),h("bgcolor",s.paper_bgcolor),h("bordercolor"),h("borderwidth"))}function l(o,c){function s(m,b){return f.coerce(o,c,i,m,b)}var h=s("visible",o.method==="skip"||Array.isArray(o.args));h&&(s("method"),s("args"),s("args2"),s("label"),s("execute"))}}),iq=It((et,Y)=>{Y.exports=n;var f=Br(),y=Hn(),z=Js(),P=jn();function n(i,a,l){this.gd=i,this.container=a,this.id=l,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}n.barWidth=2,n.barLength=20,n.barRadius=2,n.barPad=1,n.barColor="#808BA4",n.prototype.enable=function(i,a,l){var o=this.gd._fullLayout,c=o.width,s=o.height;this.position=i;var h=this.position.l,m=this.position.w,b=this.position.t,x=this.position.h,_=this.position.direction,A=_==="down",d=_==="left",k=_==="right",w=_==="up",D=m,E=x,I,M,p,g;!A&&!d&&!k&&!w&&(this.position.direction="down",A=!0);var C=A||w;C?(I=h,M=I+D,A?(p=b,g=Math.min(p+E,s),E=g-p):(g=b+E,p=Math.max(g-E,0),E=g-p)):(p=b,g=p+E,d?(M=h+D,I=Math.max(M-D,0),D=M-I):(I=h,M=Math.min(I+D,c),D=M-I)),this._box={l:I,t:p,w:D,h:E};var S=m>D,N=n.barLength+2*n.barPad,B=n.barWidth+2*n.barPad,U=h,V=b+x;V+B>s&&(V=s-B);var W=this.container.selectAll("rect.scrollbar-horizontal").data(S?[0]:[]);W.exit().on(".drag",null).remove(),W.enter().append("rect").classed("scrollbar-horizontal",!0).call(y.fill,n.barColor),S?(this.hbar=W.attr({rx:n.barRadius,ry:n.barRadius,x:U,y:V,width:N,height:B}),this._hbarXMin=U+N/2,this._hbarTranslateMax=D-N):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var F=x>E,H=n.barWidth+2*n.barPad,q=n.barLength+2*n.barPad,G=h+m,tt=b;G+H>c&&(G=c-H);var ht=this.container.selectAll("rect.scrollbar-vertical").data(F?[0]:[]);ht.exit().on(".drag",null).remove(),ht.enter().append("rect").classed("scrollbar-vertical",!0).call(y.fill,n.barColor),F?(this.vbar=ht.attr({rx:n.barRadius,ry:n.barRadius,x:G,y:tt,width:H,height:q}),this._vbarYMin=tt+q/2,this._vbarTranslateMax=E-q):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var bt=this.id,vt=I-.5,ut=F?M+H+.5:M+.5,rt=p-.5,gt=S?g+B+.5:g+.5,it=o._topdefs.selectAll("#"+bt).data(S||F?[0]:[]);if(it.exit().remove(),it.enter().append("clipPath").attr("id",bt).append("rect"),S||F?(this._clipRect=it.select("rect").attr({x:Math.floor(vt),y:Math.floor(rt),width:Math.ceil(ut)-Math.floor(vt),height:Math.ceil(gt)-Math.floor(rt)}),this.container.call(z.setClipUrl,bt,this.gd),this.bg.attr({x:h,y:b,width:m,height:x})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),S||F){var st=f.behavior.drag().on("dragstart",function(){f.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(st);var xt=f.behavior.drag().on("dragstart",function(){f.event.sourceEvent.preventDefault(),f.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));S&&this.hbar.on(".drag",null).call(xt),F&&this.vbar.on(".drag",null).call(xt)}this.setTranslate(a,l)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},n.prototype._onBoxDrag=function(){var i=this.translateX,a=this.translateY;this.hbar&&(i-=f.event.dx),this.vbar&&(a-=f.event.dy),this.setTranslate(i,a)},n.prototype._onBoxWheel=function(){var i=this.translateX,a=this.translateY;this.hbar&&(i+=f.event.deltaY),this.vbar&&(a+=f.event.deltaY),this.setTranslate(i,a)},n.prototype._onBarDrag=function(){var i=this.translateX,a=this.translateY;if(this.hbar){var l=i+this._hbarXMin,o=l+this._hbarTranslateMax,c=P.constrain(f.event.x,l,o),s=(c-l)/(o-l),h=this.position.w-this._box.w;i=s*h}if(this.vbar){var m=a+this._vbarYMin,b=m+this._vbarTranslateMax,x=P.constrain(f.event.y,m,b),_=(x-m)/(b-m),A=this.position.h-this._box.h;a=_*A}this.setTranslate(i,a)},n.prototype.setTranslate=function(i,a){var l=this.position.w-this._box.w,o=this.position.h-this._box.h;if(i=P.constrain(i||0,0,l),a=P.constrain(a||0,0,o),this.translateX=i,this.translateY=a,this.container.call(z.setTranslate,this._box.l-this.position.l-i,this._box.t-this.position.t-a),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+i-.5),y:Math.floor(this.position.t+a-.5)}),this.hbar){var c=i/l;this.hbar.call(z.setTranslate,i+c*this._hbarTranslateMax,a)}if(this.vbar){var s=a/o;this.vbar.call(z.setTranslate,i,a+s*this._vbarTranslateMax)}}}),aq=It((et,Y)=>{var f=Br(),y=lh(),z=Hn(),P=Js(),n=jn(),i=uu(),a=Tc().arrayEditor,l=Rd().LINE_SPACING,o=L8(),c=iq();Y.exports=function(N){var B=N._fullLayout,U=n.filterVisible(B[o.name]);function V(bt){y.autoMargin(N,g(bt))}var W=B._menulayer.selectAll("g."+o.containerClassName).data(U.length>0?[0]:[]);if(W.enter().append("g").classed(o.containerClassName,!0).style("cursor","pointer"),W.exit().each(function(){f.select(this).selectAll("g."+o.headerGroupClassName).each(V)}).remove(),U.length!==0){var F=W.selectAll("g."+o.headerGroupClassName).data(U,s);F.enter().append("g").classed(o.headerGroupClassName,!0);for(var H=n.ensureSingle(W,"g",o.dropdownButtonGroupClassName,function(bt){bt.style("pointer-events","all")}),q=0;q{var f=L8();Y.exports={moduleType:"component",name:f.name,layoutAttributes:BL(),supplyLayoutDefaults:nq(),draw:aq()}}),G4=It((et,Y)=>{Y.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}),RL=It((et,Y)=>{var f=hi(),y=Jx(),z=Yn().extendDeepAll,P=sh().overrideAll,n=Ul(),i=Tc().templatedArray,a=G4(),l=i("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});Y.exports=P(i("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:l,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:z(y({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:n.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:f({})},font:f({}),activebgcolor:{valType:"color",dflt:a.gripBgActiveColor},bgcolor:{valType:"color",dflt:a.railBgColor},bordercolor:{valType:"color",dflt:a.railBorderColor},borderwidth:{valType:"number",min:0,dflt:a.railBorderWidth},ticklen:{valType:"number",min:0,dflt:a.tickLength},tickcolor:{valType:"color",dflt:a.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:a.minorTickLength}}),"arraydraw","from-root")}),sq=It((et,Y)=>{var f=jn(),y=Zf(),z=RL(),P=G4(),n=P.name,i=z.steps;Y.exports=function(o,c){y(o,c,{name:n,handleItemDefaults:a})};function a(o,c,s){function h(w,D){return f.coerce(o,c,z,w,D)}for(var m=y(o,c,{name:"steps",handleItemDefaults:l}),b=0,x=0;x{var f=Br(),y=lh(),z=Hn(),P=Js(),n=jn(),i=n.strTranslate,a=uu(),l=Tc().arrayEditor,o=G4(),c=Rd(),s=c.LINE_SPACING,h=c.FROM_TL,m=c.FROM_BR;Y.exports=function(W){var F=W._context.staticPlot,H=W._fullLayout,q=x(H,W),G=H._infolayer.selectAll("g."+o.containerClassName).data(q.length>0?[0]:[]);G.enter().append("g").classed(o.containerClassName,!0).style("cursor",F?null:"ew-resize");function tt(ut){ut._commandObserver&&(ut._commandObserver.remove(),delete ut._commandObserver),y.autoMargin(W,b(ut))}if(G.exit().each(function(){f.select(this).selectAll("g."+o.groupClassName).each(tt)}).remove(),q.length!==0){var ht=G.selectAll("g."+o.groupClassName).data(q,_);ht.enter().append("g").classed(o.groupClassName,!0),ht.exit().each(tt).remove();for(var bt=0;bt0&&(bt=bt.transition().duration(F.transition.duration).ease(F.transition.easing)),bt.attr("transform",i(ht-o.gripWidth*.5,F._dims.currentValueTotalHeight))}}function N(W,F){var H=W._dims;return H.inputAreaStart+o.stepInset+(H.inputAreaLength-2*o.stepInset)*Math.min(1,Math.max(0,F))}function B(W,F){var H=W._dims;return Math.min(1,Math.max(0,(F-o.stepInset-H.inputAreaStart)/(H.inputAreaLength-2*o.stepInset-2*H.inputAreaStart)))}function U(W,F,H){var q=H._dims,G=n.ensureSingle(W,"rect",o.railTouchRectClass,function(tt){tt.call(p,F,W,H).style("pointer-events","all")});G.attr({width:q.inputAreaLength,height:Math.max(q.inputAreaWidth,o.tickOffset+H.ticklen+q.labelHeight)}).call(z.fill,H.bgcolor).attr("opacity",0),P.setTranslate(G,0,q.currentValueTotalHeight)}function V(W,F){var H=F._dims,q=H.inputAreaLength-o.railInset*2,G=n.ensureSingle(W,"rect",o.railRectClass);G.attr({width:q,height:o.railWidth,rx:o.railRadius,ry:o.railRadius,"shape-rendering":"crispEdges"}).call(z.stroke,F.bordercolor).call(z.fill,F.bgcolor).style("stroke-width",F.borderwidth+"px"),P.setTranslate(G,o.railInset,(H.inputAreaWidth-o.railWidth)*.5+H.currentValueTotalHeight)}}),cq=It((et,Y)=>{var f=G4();Y.exports={moduleType:"component",name:f.name,layoutAttributes:RL(),supplyLayoutDefaults:sq(),draw:lq()}}),P8=It((et,Y)=>{var f=Sn();Y.exports={bgcolor:{valType:"color",dflt:f.background,editType:"plot"},bordercolor:{valType:"color",dflt:f.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),FL=It((et,Y)=>{Y.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}),I8=It((et,Y)=>{Y.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}),uq=It(et=>{var Y=Ku(),f=uu(),y=I8(),z=Rd().LINE_SPACING,P=y.name;function n(i){var a=i&&i[P];return a&&a.visible}et.isVisible=n,et.makeData=function(i){for(var a=Y.list({_fullLayout:i},"x",!0),l=i.margin,o=[],c=0;c{var f=jn(),y=Tc(),z=Ku(),P=P8(),n=FL();Y.exports=function(i,a,l){var o=i[l],c=a[l];if(!(o.rangeslider||a._requestRangeslider[c._id]))return;f.isPlainObject(o.rangeslider)||(o.rangeslider={});var s=o.rangeslider,h=y.newContainer(c,"rangeslider");function m(g,C){return f.coerce(s,h,P,g,C)}var b,x;function _(g,C){return f.coerce(b,x,n,g,C)}var A=m("visible");if(A){m("bgcolor",a.plot_bgcolor),m("bordercolor"),m("borderwidth"),m("thickness"),m("autorange",!c.isValidRange(s.range)),m("range");var d=a._subplots;if(d)for(var k=d.cartesian.filter(function(g){return g.substr(0,g.indexOf("y"))===z.name2id(l)}).map(function(g){return g.substr(g.indexOf("y"),g.length)}),w=f.simpleMap(k,z.id2name),D=0;D{var f=Ku().list,y=Jm().getAutoRange,z=I8();Y.exports=function(P){for(var n=f(P,"x",!0),i=0;i{var f=Br(),y=ls(),z=lh(),P=jn(),n=P.strTranslate,i=Js(),a=Hn(),l=jp(),o=Fd(),c=Ku(),s=Up(),h=Mm(),m=I8();Y.exports=function(p){for(var g=p._fullLayout,C=g._rangeSliderData,S=0;S=ge.max)ee=Ct[xe+1];else if(Gt=ge.pmax)ee=Ct[xe+1];else if(Gt0?p.touches[0].clientX:0}function x(p,g,C,S){if(g._context.staticPlot)return;var N=p.select("rect."+m.slideBoxClassName).node(),B=p.select("rect."+m.grabAreaMinClassName).node(),U=p.select("rect."+m.grabAreaMaxClassName).node();function V(){var W=f.event,F=W.target,H=b(W),q=H-p.node().getBoundingClientRect().left,G=S.d2p(C._rl[0]),tt=S.d2p(C._rl[1]),ht=s.coverSlip();this.addEventListener("touchmove",bt),this.addEventListener("touchend",vt),ht.addEventListener("mousemove",bt),ht.addEventListener("mouseup",vt);function bt(ut){var rt=b(ut),gt=+rt-H,it,st,xt;switch(F){case N:if(xt="ew-resize",G+gt>C._length||tt+gt<0)return;it=G+gt,st=tt+gt;break;case B:if(xt="col-resize",G+gt>C._length)return;it=G+gt,st=tt;break;case U:if(xt="col-resize",tt+gt<0)return;it=G,st=tt+gt;break;default:xt="ew-resize",it=q,st=q+gt;break}if(st{var f=jn(),y=P8(),z=FL(),P=uq();Y.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:f.extendFlat({},y,{yaxis:z})}}},layoutAttributes:P8(),handleDefaults:hq(),calcAutorange:dq(),draw:fq(),isVisible:P.isVisible,makeData:P.makeData,autoMarginOpts:P.autoMarginOpts}}),D8=It((et,Y)=>{var f=hi(),y=Sn(),z=Tc().templatedArray,P=z("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});Y.exports={visible:{valType:"boolean",editType:"plot"},buttons:P,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:f({editType:"plot"}),bgcolor:{valType:"color",dflt:y.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),NL=It((et,Y)=>{Y.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),mq=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=Zf(),n=D8(),i=NL();Y.exports=function(o,c,s,h,m){var b=o.rangeselector||{},x=z.newContainer(c,"rangeselector");function _(D,E){return f.coerce(b,x,n,D,E)}var A=P(b,x,{name:"buttons",handleItemDefaults:a,calendar:m}),d=_("visible",A.length>0);if(d){var k=l(c,s,h);_("x",k[0]),_("y",k[1]),f.noneOrAll(o,c,["x","y"]),_("xanchor"),_("yanchor"),f.coerceFont(_,"font",s.font);var w=_("bgcolor");_("activecolor",y.contrast(w,i.lightAmount,i.darkAmount)),_("bordercolor"),_("borderwidth")}};function a(o,c,s,h){var m=h.calendar;function b(A,d){return f.coerce(o,c,n.buttons,A,d)}var x=b("visible");if(x){var _=b("step");_!=="all"&&(m&&m!=="gregorian"&&(_==="month"||_==="year")?c.stepmode="backward":b("stepmode"),b("count")),b("label")}}function l(o,c,s){for(var h=s.filter(function(_){return c[_].anchor===o._id}),m=0,b=0;b{var f=Vn(),y=jn().titleCase;Y.exports=function(P,n){var i=P._name,a={};if(n.step==="all")a[i+".autorange"]=!0;else{var l=z(P,n);a[i+".range[0]"]=l[0],a[i+".range[1]"]=l[1]}return a};function z(P,n){var i=P.range,a=new Date(P.r2l(i[1])),l=n.step,o=f["utc"+y(l)],c=n.count,s;switch(n.stepmode){case"backward":s=P.l2r(+o.offset(a,-c));break;case"todate":var h=o.offset(a,-c);s=P.l2r(+o.ceil(h));break}var m=i[1];return[s,m]}}),vq=It((et,Y)=>{var f=Br(),y=ls(),z=lh(),P=Hn(),n=Js(),i=jn(),a=i.strTranslate,l=uu(),o=Ku(),c=Rd(),s=c.LINE_SPACING,h=c.FROM_TL,m=c.FROM_BR,b=NL(),x=gq();Y.exports=function(M){var p=M._fullLayout,g=p._infolayer.selectAll(".rangeselector").data(_(M),A);g.enter().append("g").classed("rangeselector",!0),g.exit().remove(),g.style({cursor:"pointer","pointer-events":"all"}),g.each(function(C){var S=f.select(this),N=C,B=N.rangeselector,U=S.selectAll("g.button").data(i.filterVisible(B.buttons));U.enter().append("g").classed("button",!0),U.exit().remove(),U.each(function(V){var W=f.select(this),F=x(N,V);V._isActive=d(N,V,F),W.call(k,B,V),W.call(D,B,V,M),W.on("click",function(){M._dragged||y.call("_guiRelayout",M,F)}),W.on("mouseover",function(){V._isHovered=!0,W.call(k,B,V)}),W.on("mouseout",function(){V._isHovered=!1,W.call(k,B,V)})}),I(M,U,B,N._name,S)})};function _(M){for(var p=o.list(M,"x",!0),g=[],C=0;C{Y.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:D8()}}},layoutAttributes:D8(),handleDefaults:mq(),draw:vq()}}),Jh=It(et=>{var Y=Yn().extendFlat;et.attributes=function(f,y){f=f||{},y=y||{};var z={valType:"info_array",editType:f.editType,items:[{valType:"number",min:0,max:1,editType:f.editType},{valType:"number",min:0,max:1,editType:f.editType}],dflt:[0,1]};f.name&&f.name+"",f.trace,y.description&&""+y.description;var P={x:Y({},z,{}),y:Y({},z,{}),editType:f.editType};return f.noGridCell||(P.row={valType:"integer",min:0,dflt:0,editType:f.editType},P.column={valType:"integer",min:0,dflt:0,editType:f.editType}),P},et.defaults=function(f,y,z,P){var n=P&&P.x||[0,1],i=P&&P.y||[0,1],a=y.grid;if(a){var l=z("domain.column");l!==void 0&&(l{var f=jn(),y=Ha().counter,z=Jh().attributes,P=fu().idRegex,n=Tc(),i={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[y("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:z({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function a(h,m,b){var x=m[b+"axes"],_=Object.keys((h._splomAxes||{})[b]||{});if(Array.isArray(x))return x;if(_.length)return _}function l(h,m){var b=h.grid||{},x=a(m,b,"x"),_=a(m,b,"y");if(!h.grid&&!x&&!_)return;var A=Array.isArray(b.subplots)&&Array.isArray(b.subplots[0]),d=Array.isArray(x),k=Array.isArray(_),w=d&&x!==b.xaxes&&k&&_!==b.yaxes,D,E;A?(D=b.subplots.length,E=b.subplots[0].length):(k&&(D=_.length),d&&(E=x.length));var I=n.newContainer(m,"grid");function M(F,H){return f.coerce(b,I,i,F,H)}var p=M("rows",D),g=M("columns",E);if(!(p*g>1)){delete m.grid;return}if(!A&&!d&&!k){var C=M("pattern")==="independent";C&&(A=!0)}I._hasSubplotGrid=A;var S=M("roworder"),N=S==="top to bottom",B=A?.2:.1,U=A?.3:.1,V,W;w&&m._splomGridDflt&&(V=m._splomGridDflt.xside,W=m._splomGridDflt.yside),I._domains={x:o("x",M,B,V,g),y:o("y",M,U,W,p,N)}}function o(h,m,b,x,_,A){var d=m(h+"gap",b),k=m("domain."+h);m(h+"side",x);for(var w=new Array(_),D=k[0],E=(k[1]-D)/(_-d),I=E*(1-d),M=0;M<_;M++){var p=D+E*M;w[A?_-1-M:M]=[p,p+I]}return w}function c(h,m){var b=m.grid;if(!(!b||!b._domains)){var x=h.grid||{},_=m._subplots,A=b._hasSubplotGrid,d=b.rows,k=b.columns,w=b.pattern==="independent",D,E,I,M,p,g,C,S=b._axisMap={};if(A){var N=x.subplots||[];g=b.subplots=new Array(d);var B=1;for(D=0;D{Y.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}),_q=It((et,Y)=>{var f=Sr(),y=ls(),z=jn(),P=Tc(),n=UL();Y.exports=function(i,a,l,o){var c="error_"+o.axis,s=P.newContainer(a,c),h=i[c]||{};function m(w,D){return z.coerce(h,s,n,w,D)}var b=h.array!==void 0||h.value!==void 0||h.type==="sqrt",x=m("visible",b);if(x!==!1){var _=m("type","array"in h?"data":"percent"),A=!0;_!=="sqrt"&&(A=m("symmetric",!((_==="data"?"arrayminus":"valueminus")in h))),_==="data"?(m("array"),m("traceref"),A||(m("arrayminus"),m("tracerefminus"))):(_==="percent"||_==="constant")&&(m("value"),A||m("valueminus"));var d="copy_"+o.inherit+"style";if(o.inherit){var k=a["error_"+o.inherit];(k||{}).visible&&m(d,!(h.color||f(h.thickness)||f(h.width)))}(!o.inherit||!s[d])&&(m("color",l),m("thickness"),m("width",y.traceIs(a,"gl3d")?0:4))}}}),$L=It((et,Y)=>{Y.exports=function(y){var z=y.type,P=y.symmetric;if(z==="data"){var n=y.array||[];if(P)return function(o,c){var s=+n[c];return[s,s]};var i=y.arrayminus||[];return function(o,c){var s=+n[c],h=+i[c];return!isNaN(s)||!isNaN(h)?[h||0,s||0]:[NaN,NaN]}}else{var a=f(z,y.value),l=f(z,y.valueminus);return P||y.valueminus===void 0?function(o){var c=a(o);return[c,c]}:function(o){return[l(o),a(o)]}}};function f(y,z){if(y==="percent")return function(P){return Math.abs(P*z/100)};if(y==="constant")return function(){return Math.abs(z)};if(y==="sqrt")return function(P){return Math.sqrt(Math.abs(P))}}}),xq=It((et,Y)=>{var f=Sr(),y=ls(),z=Fs(),P=jn(),n=$L();Y.exports=function(a){for(var l=a.calcdata,o=0;o{var f=Br(),y=Sr(),z=Js(),P=Fu();Y.exports=function(i,a,l,o){var c,s=l.xaxis,h=l.yaxis,m=o&&o.duration>0,b=i._context.staticPlot;a.each(function(x){var _=x[0].trace,A=_.error_x||{},d=_.error_y||{},k;_.ids&&(k=function(I){return I.id});var w=P.hasMarkers(_)&&_.marker.maxdisplayed>0;!d.visible&&!A.visible&&(x=[]);var D=f.select(this).selectAll("g.errorbar").data(x,k);if(D.exit().remove(),!!x.length){A.visible||D.selectAll("path.xerror").remove(),d.visible||D.selectAll("path.yerror").remove(),D.style("opacity",1);var E=D.enter().append("g").classed("errorbar",!0);m&&E.style("opacity",0).transition().duration(o.duration).style("opacity",1),z.setClipUrl(D,l.layerClipId,i),D.each(function(I){var M=f.select(this),p=n(I,s,h);if(!(w&&!I.vis)){var g,C=M.select("path.yerror");if(d.visible&&y(p.x)&&y(p.yh)&&y(p.ys)){var S=d.width;g="M"+(p.x-S)+","+p.yh+"h"+2*S+"m-"+S+",0V"+p.ys,p.noYS||(g+="m-"+S+",0h"+2*S),c=!C.size(),c?C=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("yerror",!0):m&&(C=C.transition().duration(o.duration).ease(o.easing)),C.attr("d",g)}else C.remove();var N=M.select("path.xerror");if(A.visible&&y(p.y)&&y(p.xh)&&y(p.xs)){var B=(A.copy_ystyle?d:A).width;g="M"+p.xh+","+(p.y-B)+"v"+2*B+"m0,-"+B+"H"+p.xs,p.noXS||(g+="m0,-"+B+"v"+2*B),c=!N.size(),c?N=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("xerror",!0):m&&(N=N.transition().duration(o.duration).ease(o.easing)),N.attr("d",g)}else N.remove()}})}})};function n(i,a,l){var o={x:a.c2p(i.x),y:l.c2p(i.y)};return i.yh!==void 0&&(o.yh=l.c2p(i.yh),o.ys=l.c2p(i.ys),y(o.ys)||(o.noYS=!0,o.ys=l.c2p(i.ys,!0))),i.xh!==void 0&&(o.xh=a.c2p(i.xh),o.xs=a.c2p(i.xs),y(o.xs)||(o.noXS=!0,o.xs=a.c2p(i.xs,!0))),o}}),wq=It((et,Y)=>{var f=Br(),y=Hn();Y.exports=function(z){z.each(function(P){var n=P[0].trace,i=n.error_y||{},a=n.error_x||{},l=f.select(this);l.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(y.stroke,i.color),a.copy_ystyle&&(a=i),l.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(y.stroke,a.color)})}}),kq=It((et,Y)=>{var f=jn(),y=sh().overrideAll,z=UL(),P={error_x:f.extendFlat({},z),error_y:f.extendFlat({},z)};delete P.error_x.copy_zstyle,delete P.error_y.copy_zstyle,delete P.error_y.copy_ystyle;var n={error_x:f.extendFlat({},z),error_y:f.extendFlat({},z),error_z:f.extendFlat({},z)};delete n.error_x.copy_ystyle,delete n.error_y.copy_ystyle,delete n.error_z.copy_ystyle,delete n.error_z.copy_zstyle,Y.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:P,bar:P,histogram:P,scatter3d:y(n,"calc","nested"),scattergl:y(P,"calc","nested")}},supplyDefaults:_q(),calc:xq(),makeComputeError:$L(),plot:bq(),style:wq(),hoverInfo:i};function i(a,l,o){(l.error_y||{}).visible&&(o.yerr=a.yh-a.y,l.error_y.symmetric||(o.yerrneg=a.y-a.ys)),(l.error_x||{}).visible&&(o.xerr=a.xh-a.x,l.error_x.symmetric||(o.xerrneg=a.x-a.xs))}}),Tq=It((et,Y)=>{Y.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}),Sq=It((et,Y)=>{var f=Br(),y=Xi(),z=lh(),P=ls(),n=Fs(),i=Up(),a=jn(),l=a.strTranslate,o=Yn().extendFlat,c=Mm(),s=Js(),h=Hn(),m=jp(),b=uu(),x=fp().flipScale,_=mb(),A=Ew(),d=Gf(),k=Rd(),w=k.LINE_SPACING,D=k.FROM_TL,E=k.FROM_BR,I=Tq().cn;function M(B){var U=B._fullLayout,V=U._infolayer.selectAll("g."+I.colorbar).data(p(B),function(W){return W._id});V.enter().append("g").attr("class",function(W){return W._id}).classed(I.colorbar,!0),V.each(function(W){var F=f.select(this);a.ensureSingle(F,"rect",I.cbbg),a.ensureSingle(F,"g",I.cbfills),a.ensureSingle(F,"g",I.cblines),a.ensureSingle(F,"g",I.cbaxis,function(q){q.classed(I.crisp,!0)}),a.ensureSingle(F,"g",I.cbtitleunshift,function(q){q.append("g").classed(I.cbtitle,!0)}),a.ensureSingle(F,"rect",I.cboutline);var H=g(F,W,B);H&&H.then&&(B._promises||[]).push(H),B._context.edits.colorbarPosition&&C(F,W,B)}),V.exit().each(function(W){z.autoMargin(B,W._id)}).remove(),V.order()}function p(B){var U=B._fullLayout,V=B.calcdata,W=[],F,H,q,G;function tt(J){return o(J,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function ht(){typeof G.calc=="function"?G.calc(B,q,F):(F._fillgradient=H.reversescale?x(H.colorscale):H.colorscale,F._zrange=[H[G.min],H[G.max]])}for(var bt=0;bt1){var Xt=Math.pow(10,Math.floor(Math.log(Oe)/Math.LN10));dn*=Xt*a.roundUp(Oe/Xt,[2,5,10]),(Math.abs(xe.start)/xe.size+1e-6)%1<2e-6&&(an.tick0=0)}an.dtick=dn}an.domain=W?[fr+gt/mt.h,fr+ie-gt/mt.h]:[fr+rt/mt.w,fr+ie-rt/mt.w],an.setScale(),B.attr("transform",l(Math.round(mt.l),Math.round(mt.t)));var oe=B.select("."+I.cbtitleunshift).attr("transform",l(-Math.round(mt.l),-Math.round(mt.t))),zt=an.ticklabelposition,_t=an.title.font.size,Pt=B.select("."+I.cbaxis),Ht,ae=0,he=0;function Me(zr,xr){var pn={propContainer:an,propName:U._propPrefix+"title.text",traceIndex:U._traceIndex,_meta:U._meta,placeholder:J._dfltTitle.colorbar,containerGroup:B.select("."+I.cbtitle)},ci=zr.charAt(0)==="h"?zr.substr(1):"h"+zr;B.selectAll("."+ci+",."+ci+"-math-group").remove(),m.draw(V,zr,o(pn,xr||{}))}function qe(){if(W&&Er||!W&&!Er){var zr,xr;Bt==="top"&&(zr=rt+mt.l+be*it,xr=gt+mt.t+ce*(1-fr-ie)+3+_t*.75),Bt==="bottom"&&(zr=rt+mt.l+be*it,xr=gt+mt.t+ce*(1-fr)-3-_t*.25),Bt==="right"&&(xr=gt+mt.t+ce*st+3+_t*.75,zr=rt+mt.l+be*fr),Me(an._id+"title",{attributes:{x:zr,y:xr,"text-anchor":W?"start":"middle"}})}}function Ye(){if(W&&!Er||!W&&Er){var zr=an.position||0,xr=an._offset+an._length/2,pn,ci;if(Bt==="right")ci=xr,pn=mt.l+be*zr+10+_t*(an.showticklabels?1:.5);else if(pn=xr,Bt==="bottom"&&(ci=mt.t+ce*zr+10+(zt.indexOf("inside")===-1?an.tickfont.size:0)+(an.ticks!=="inside"&&U.ticklen||0)),Bt==="top"){var ui=Rt.text.split("
").length;ci=mt.t+ce*zr+10-Mt-w*_t*ui}Me((W?"h":"v")+an._id+"title",{avoid:{selection:f.select(V).selectAll("g."+an._id+"tick"),side:Bt,offsetTop:W?0:mt.t,offsetLeft:W?mt.l:0,maxShift:W?J.width:J.height},attributes:{x:pn,y:ci,"text-anchor":"middle"},transform:{rotate:W?-90:0,offset:0}})}}function ur(){if(!W&&!Er||W&&Er){var zr=B.select("."+I.cbtitle),xr=zr.select("text"),pn=[-tt/2,tt/2],ci=zr.select(".h"+an._id+"title-math-group").node(),ui=15.6;xr.node()&&(ui=parseInt(xr.node().style.fontSize,10)*w);var yi;if(ci?(yi=s.bBox(ci),he=yi.width,ae=yi.height,ae>ui&&(pn[1]-=(ae-ui)/2)):xr.node()&&!xr.classed(I.jsPlaceholder)&&(yi=s.bBox(xr.node()),he=yi.width,ae=yi.height),W){if(ae){if(ae+=5,Bt==="top")an.domain[1]-=ae/mt.h,pn[1]*=-1;else{an.domain[0]+=ae/mt.h;var Gi=b.lineCount(xr);pn[1]+=(1-Gi)*ui}zr.attr("transform",l(pn[0],pn[1])),an.setScale()}}else he&&(Bt==="right"&&(an.domain[0]+=(he+_t/2)/mt.w),zr.attr("transform",l(pn[0],pn[1])),an.setScale())}B.selectAll("."+I.cbfills+",."+I.cblines).attr("transform",W?l(0,Math.round(mt.h*(1-an.domain[1]))):l(Math.round(mt.w*an.domain[0]),0)),Pt.attr("transform",W?l(0,Math.round(-mt.t)):l(Math.round(-mt.l),0));var Ci=B.select("."+I.cbfills).selectAll("rect."+I.cbfill).attr("style","").data(ye);Ci.enter().append("rect").classed(I.cbfill,!0).attr("style",""),Ci.exit().remove();var fi=Zt.map(an.c2p).map(Math.round).sort(function(vr,Ar){return vr-Ar});Ci.each(function(vr,Ar){var mn=[Ar===0?Zt[0]:(ye[Ar]+ye[Ar-1])/2,Ar===ye.length-1?Zt[1]:(ye[Ar]+ye[Ar+1])/2].map(an.c2p).map(Math.round);W&&(mn[1]=a.constrain(mn[1]+(mn[1]>mn[0])?1:-1,fi[0],fi[1]));var Zn=f.select(this).attr(W?"x":"y",Le).attr(W?"y":"x",f.min(mn)).attr(W?"width":"height",Math.max(Mt,2)).attr(W?"height":"width",Math.max(f.max(mn)-f.min(mn),2));if(U._fillgradient)s.gradient(Zn,V,U._id,W?"vertical":"horizontalreversed",U._fillgradient,"fill");else{var Un=ee(vr).replace("e-","");Zn.attr("fill",y(Un).toHexString())}});var ba=B.select("."+I.cblines).selectAll("path."+I.cbline).data(Ct.color&&Ct.width?ue:[]);ba.enter().append("path").classed(I.cbline,!0),ba.exit().remove(),ba.each(function(vr){var Ar=Le,mn=Math.round(an.c2p(vr))+Ct.width/2%1;f.select(this).attr("d","M"+(W?Ar+","+mn:mn+","+Ar)+(W?"h":"v")+Mt).call(s.lineGroupStyle,Ct.width,Gt(vr),Ct.dash)}),Pt.selectAll("g."+an._id+"tick,path").remove();var oa=Le+Mt+(tt||0)/2-(U.ticks==="outside"?1:0),Ke=n.calcTicks(an),sr=n.getTickSigns(an)[2];return n.drawTicks(V,an,{vals:an.ticks==="inside"?n.clipEnds(an,Ke):Ke,layer:Pt,path:n.makeTickPath(an,oa,sr),transFn:n.makeTransTickFn(an)}),n.drawLabels(V,an,{vals:Ke,layer:Pt,transFn:n.makeTransTickLabelFn(an),labelFns:n.makeLabelFns(an,oa)})}function Rr(){var zr,xr=Mt+tt/2;zt.indexOf("inside")===-1&&(zr=s.bBox(Pt.node()),xr+=W?zr.width:zr.height),Ht=oe.select("text");var pn=0,ci=W&&Bt==="top",ui=!W&&Bt==="right",yi=0;if(Ht.node()&&!Ht.classed(I.jsPlaceholder)){var Gi,Ci=oe.select(".h"+an._id+"title-math-group").node();Ci&&(W&&Er||!W&&!Er)?(zr=s.bBox(Ci),pn=zr.width,Gi=zr.height):(zr=s.bBox(oe.node()),pn=zr.right-mt.l-(W?Le:Jr),Gi=zr.bottom-mt.t-(W?Jr:Le),!W&&Bt==="top"&&(xr+=zr.height,yi=zr.height)),ui&&(Ht.attr("transform",l(pn/2+_t/2,0)),pn*=2),xr=Math.max(xr,W?pn:Gi)}var fi=(W?rt:gt)*2+xr+ht+tt/2,ba=0;!W&&Rt.text&&ut==="bottom"&&st<=0&&(ba=fi/2,fi+=ba,yi+=ba),J._hColorbarMoveTitle=ba,J._hColorbarMoveCBTitle=yi;var oa=ht+tt,Ke=(W?Le:Jr)-oa/2-(W?rt:0),sr=(W?Jr:Le)-(W?Lt:gt+yi-ba);B.select("."+I.cbbg).attr("x",Ke).attr("y",sr).attr(W?"width":"height",Math.max(fi-ba,2)).attr(W?"height":"width",Math.max(Lt+oa,2)).call(h.fill,bt).call(h.stroke,U.bordercolor).style("stroke-width",ht);var vr=ui?Math.max(pn-10,0):0;B.selectAll("."+I.cboutline).attr("x",(W?Le:Jr+rt)+vr).attr("y",(W?Jr+gt-Lt:Le)+(ci?ae:0)).attr(W?"width":"height",Math.max(Mt,2)).attr(W?"height":"width",Math.max(Lt-(W?2*gt+ae:2*rt+vr),2)).call(h.stroke,U.outlinecolor).style({fill:"none","stroke-width":tt});var Ar=W?Ze*fi:0,mn=W?0:(1-Qe)*fi-yi;if(Ar=ot?mt.l-Ar:-Ar,mn=xt?mt.t-mn:-mn,B.attr("transform",l(Ar,mn)),!W&&(ht||y(bt).getAlpha()&&!y.equals(J.paper_bgcolor,bt))){var Zn=Pt.selectAll("text"),Un=Zn[0].length,Wn=B.select("."+I.cbbg).node(),Li=s.bBox(Wn),Fi=s.getTranslate(B),Zi=2;Zn.each(function(cn,Yr){var un=0,Pn=Un-1;if(Yr===un||Yr===Pn){var bn=s.bBox(this),ze=s.getTranslate(this),yr;if(Yr===Pn){var en=bn.right+ze.x,Rn=Li.right+Fi.x+Jr-ht-Zi+it;yr=Rn-en,yr>0&&(yr=0)}else if(Yr===un){var ni=bn.left+ze.x,xi=Li.left+Fi.x+Jr+ht+Zi;yr=xi-ni,yr<0&&(yr=0)}yr&&(Un<3?this.setAttribute("transform","translate("+yr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Ji={},ca=D[vt],Ei=E[vt],Ga=D[ut],so=E[ut],Fe=fi-Mt;W?(H==="pixels"?(Ji.y=st,Ji.t=Lt*Ga,Ji.b=Lt*so):(Ji.t=Ji.b=0,Ji.yt=st+F*Ga,Ji.yb=st-F*so),G==="pixels"?(Ji.x=it,Ji.l=fi*ca,Ji.r=fi*Ei):(Ji.l=Fe*ca,Ji.r=Fe*Ei,Ji.xl=it-q*ca,Ji.xr=it+q*Ei)):(H==="pixels"?(Ji.x=it,Ji.l=Lt*ca,Ji.r=Lt*Ei):(Ji.l=Ji.r=0,Ji.xl=it+F*ca,Ji.xr=it-F*Ei),G==="pixels"?(Ji.y=1-st,Ji.t=fi*Ga,Ji.b=fi*so):(Ji.t=Fe*Ga,Ji.b=Fe*so,Ji.yt=st-q*Ga,Ji.yb=st+q*so));var Re=U.y<.5?"b":"t",Kr=U.x<.5?"l":"r";V._fullLayout._reservedMargin[U._id]={};var sn={r:J.width-Ke-Ar,l:Ke+Ji.r,b:J.height-sr-mn,t:sr+Ji.b};ot&&xt?z.autoMargin(V,U._id,Ji):ot?V._fullLayout._reservedMargin[U._id][Re]=sn[Re]:xt||W?V._fullLayout._reservedMargin[U._id][Kr]=sn[Kr]:V._fullLayout._reservedMargin[U._id][Re]=sn[Re]}return a.syncOrAsync([z.previousPromises,qe,ur,Ye,z.previousPromises,Rr],V)}function C(B,U,V){var W=U.orientation==="v",F=V._fullLayout,H=F._size,q,G,tt;i.init({element:B.node(),gd:V,prepFn:function(){q=B.attr("transform"),c(B)},moveFn:function(ht,bt){B.attr("transform",q+l(ht,bt)),G=i.align((W?U._uFrac:U._vFrac)+ht/H.w,W?U._thickFrac:U._lenFrac,0,1,U.xanchor),tt=i.align((W?U._vFrac:1-U._uFrac)-bt/H.h,W?U._lenFrac:U._thickFrac,0,1,U.yanchor);var vt=i.getCursor(G,tt,U.xanchor,U.yanchor);c(B,vt)},doneFn:function(){if(c(B),G!==void 0&&tt!==void 0){var ht={};ht[U._propPrefix+"x"]=G,ht[U._propPrefix+"y"]=tt,U._traceIndex!==void 0?P.call("_guiRestyle",V,ht,U._traceIndex):P.call("_guiRelayout",V,ht)}}})}function S(B,U,V){var W=U._levels,F=[],H=[],q,G,tt=W.end+W.size/100,ht=W.size,bt=1.001*V[0]-.001*V[1],vt=1.001*V[1]-.001*V[0];for(G=0;G<1e5&&(q=W.start+G*ht,!(ht>0?q>=tt:q<=tt));G++)q>bt&&q0?q>=tt:q<=tt));G++)q>V[0]&&q{Y.exports={moduleType:"component",name:"colorbar",attributes:M_(),supplyDefaults:Q1(),draw:Sq().draw,hasColorbar:Am()}}),Aq=It((et,Y)=>{Y.exports={moduleType:"component",name:"legend",layoutAttributes:pw(),supplyLayoutDefaults:rb(),draw:gw(),style:E4()}}),Mq=It((et,Y)=>{Y.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{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"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}),Eq=It((et,Y)=>{Y.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),HL=It((et,Y)=>{var f=ls(),y=jn(),z=y.extendFlat,P=y.extendDeep;function n(a){var l;switch(a){case"themes__thumb":l={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":l={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:l={}}return l}function i(a){var l=["xaxis","yaxis","zaxis"];return l.indexOf(a.slice(0,5))>-1}Y.exports=function(a,l){var o,c=a.data,s=a.layout,h=P([],c),m=P({},s,n(l.tileClass)),b=a._context||{};if(l.width&&(m.width=l.width),l.height&&(m.height=l.height),l.tileClass==="thumbnail"||l.tileClass==="themes__thumb"){m.annotations=[];var x=Object.keys(m);for(o=0;o{var f=Wg().EventEmitter,y=ls(),z=jn(),P=K0(),n=HL(),i=db(),a=fb();function l(o,c){var s=new f,h=n(o,{format:"png"}),m=h.gd;m.style.position="absolute",m.style.left="-5000px",document.body.appendChild(m);function b(){var _=P.getDelay(m._fullLayout);setTimeout(function(){var A=i(m),d=document.createElement("canvas");d.id=z.randstr(),s=a({format:c.format,width:m._fullLayout.width,height:m._fullLayout.height,canvas:d,emitter:s,svg:A}),s.clean=function(){m&&document.body.removeChild(m)}},_)}var x=P.getRedrawFunc(m);return y.call("_doPlot",m,h.data,h.layout,h.config).then(x).then(b).catch(function(_){s.emit("error",_)}),s}Y.exports=l}),Pq=It((et,Y)=>{var f=K0(),y={getDelay:f.getDelay,getRedrawFunc:f.getRedrawFunc,clone:HL(),toSVG:db(),svgToImg:fb(),toImage:Lq(),downloadImage:Mw()};Y.exports=y}),Iq=It(et=>{et.version=Dn().version,Mn(),uw();var Y=ls(),f=et.register=Y.register,y=S8(),z=Object.keys(y);for(n=0;n{Y.exports=Iq()}),vb=It((et,Y)=>{Y.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),Jv=It((et,Y)=>{var f=dd(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=Ru(),a=hi(),l=vb(),o=qf().pattern,c=Yn().extendFlat,s=a({editType:"calc",arrayOk:!0,colorEditType:"style"}),h=f.marker,m=h.line,b=c({},m.width,{dflt:0}),x=c({width:b,editType:"calc"},i("marker.line")),_=c({line:x,editType:"calc"},i("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:o,cornerradius:{valType:"any",editType:"calc"}});Y.exports={x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:f.xperiod0,yperiod0:f.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),text:f.text,texttemplate:P({editType:"plot"},{keys:l.eventDataKeys}),texttemplatefallback:n({editType:"plot"}),hovertext:f.hovertext,hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:n(),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:c({},s,{}),insidetextfont:c({},s,{}),outsidetextfont:c({},s,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:c({},f.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:_,offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,selected:{marker:{opacity:f.selected.marker.opacity,color:f.selected.marker.color,editType:"style"},textfont:f.selected.textfont,editType:"style"},unselected:{marker:{opacity:f.unselected.marker.opacity,color:f.unselected.marker.color,editType:"style"},textfont:f.unselected.textfont,editType:"style"},zorder:f.zorder}}),z8=It((et,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}),O8=It((et,Y)=>{var f=Hn(),y=fp().hasColorscale,z=Cu(),P=jn().coercePattern;Y.exports=function(n,i,a,l,o){var c=a("marker.color",l),s=y(n,"marker");s&&z(n,i,o,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",f.defaultLine),y(n,"marker.line")&&z(n,i,o,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),P(a,"marker.pattern",c,s),a("selected.marker.color"),a("unselected.marker.color")}}),eg=It((et,Y)=>{var f=Sr(),y=jn(),z=Hn(),P=ls(),n=Xg(),i=S0(),a=O8(),l=Xv(),o=Jv(),c=y.coerceFont;function s(x,_,A,d){function k(M,p){return y.coerce(x,_,o,M,p)}var w=n(x,_,d,k);if(!w){_.visible=!1;return}i(x,_,d,k),k("xhoverformat"),k("yhoverformat"),k("zorder"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");b(x,_,d,k,D,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),a(x,_,k,A,d);var E=(_.marker.line||{}).color,I=P.getComponentMethod("errorbars","supplyDefaults");I(x,_,E||z.defaultLine,{axis:"y"}),I(x,_,E||z.defaultLine,{axis:"x",inherit:"y"}),y.coerceSelectionMarkerOpacity(_,k)}function h(x,_){var A,d;function k(E,I){return y.coerce(d._input,d,o,E,I)}for(var w=0;w=0)return x}else if(typeof x=="string"&&(x=x.trim(),x.slice(-1)==="%"&&f(x.slice(0,-1))&&(x=+x.slice(0,-1),x>=0)))return x+"%"}function b(x,_,A,d,k,w){w=w||{};var D=w.moduleHasSelected!==!1,E=w.moduleHasUnselected!==!1,I=w.moduleHasConstrain!==!1,M=w.moduleHasCliponaxis!==!1,p=w.moduleHasTextangle!==!1,g=w.moduleHasInsideanchor!==!1,C=!!w.hasPathbar,S=Array.isArray(k)||k==="auto",N=S||k==="inside",B=S||k==="outside";if(N||B){var U=c(d,"textfont",A.font),V=y.extendFlat({},U),W=x.textfont&&x.textfont.color,F=!W;if(F&&delete V.color,c(d,"insidetextfont",V),C){var H=y.extendFlat({},U);F&&delete H.color,c(d,"pathbar.textfont",H)}B&&c(d,"outsidetextfont",U),D&&d("selected.textfont.color"),E&&d("unselected.textfont.color"),I&&d("constraintext"),M&&d("cliponaxis"),p&&d("textangle"),d("texttemplate"),d("texttemplatefallback")}N&&g&&d("insidetextanchor")}Y.exports={supplyDefaults:s,crossTraceDefaults:h,handleText:b,validateCornerradius:m}}),VL=It((et,Y)=>{var f=ls(),y=Fs(),z=jn(),P=z8(),n=eg().validateCornerradius;Y.exports=function(i,a,l){function o(D,E){return z.coerce(i,a,P,D,E)}for(var c=!1,s=!1,h=!1,m={},b=o("barmode"),x=b==="group",_=0;_0&&!m[d]&&(h=!0),m[d]=!0),A.visible&&A.type==="histogram"){var k=y.getFromId({_fullLayout:a},A[A.orientation==="v"?"xaxis":"yaxis"]);k.type!=="category"&&(s=!0)}}if(!c){delete a.barmode;return}b!=="overlay"&&o("barnorm"),o("bargap",s&&!h?0:.2),o("bargroupgap");var w=o("barcornerradius");a.barcornerradius=n(w)}}),Z4=It((et,Y)=>{var f=jn();Y.exports=function(y,z){for(var P=0;P{var f=Fs(),y=Im(),z=fp().hasColorscale,P=Cp(),n=Z4(),i=$t();Y.exports=function(a,l){var o=f.getFromId(a,l.xaxis||"x"),c=f.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A={msUTC:!!(l.base||l.base===0)};l.orientation==="h"?(s=o.makeCalcdata(l,"x",A),m=c.makeCalcdata(l,"y"),b=y(l,c,"y",m),x=!!l.yperiodalignment,_="y"):(s=c.makeCalcdata(l,"y",A),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;for(var d=Math.min(h.length,s.length),k=new Array(d),w=0;w{var f=Br(),y=jn();function z(a,l,o){var c=a._fullLayout,s=c["_"+o+"Text_minsize"];if(s){var h=c.uniformtext.mode==="hide",m;switch(o){case"funnelarea":case"pie":case"sunburst":m="g.slice";break;case"treemap":case"icicle":m="g.slice, g.pathbar";break;default:m="g.points > g.point"}l.selectAll(m).each(function(b){var x=b.transform;if(x){x.scale=h&&x.hide?0:s/x.fontSize;var _=f.select(this).select("text");y.setTransormAndDisplay(_,x)}})}}function P(a,l,o){if(o.uniformtext.mode){var c=i(a),s=o.uniformtext.minsize,h=l.scale*l.fontSize;l.hide=h{var Y=Sr(),f=Xi(),y=jn().isArrayOrTypedArray;et.coerceString=function(z,P,n){if(typeof P=="string"){if(P||!z.noBlank)return P}else if((typeof P=="number"||P===!0)&&!z.strict)return String(P);return n!==void 0?n:z.dflt},et.coerceNumber=function(z,P,n){if(Y(P)){P=+P;var i=z.min,a=z.max,l=i!==void 0&&Pa;if(!l)return P}return n!==void 0?n:z.dflt},et.coerceColor=function(z,P,n){return f(P).isValid()?P:n!==void 0?n:z.dflt},et.coerceEnumerated=function(z,P,n){return z.coerceNumber&&(P=+P),z.values.indexOf(P)!==-1?P:n!==void 0?n:z.dflt},et.getValue=function(z,P){var n;return y(z)?P{var f=Br(),y=Hn(),z=Js(),P=jn(),n=ls(),i=C0().resizeText,a=Jv(),l=a.textfont,o=a.insidetextfont,c=a.outsidetextfont,s=B8();function h(M){var p=f.select(M).selectAll('g[class^="barlayer"]').selectAll("g.trace");i(M,p,"bar");var g=p.size(),C=M._fullLayout;p.style("opacity",function(S){return S[0].trace.opacity}).each(function(S){(C.barmode==="stack"&&g>1||C.bargap===0&&C.bargroupgap===0&&!S[0].trace.marker.line.width)&&f.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(S){var N=f.select(this),B=S[0].trace;m(N,B,M)}),n.getComponentMethod("errorbars","style")(p)}function m(M,p,g){z.pointStyle(M.selectAll("path"),p,g),b(M,p,g)}function b(M,p,g){M.selectAll("text").each(function(C){var S=f.select(this),N=P.ensureUniformFontSize(g,d(S,C,p,g));z.font(S,N)})}function x(M,p,g){var C=p[0].trace;C.selectedpoints?_(g,C,M):(m(g,C,M),n.getComponentMethod("errorbars","style")(g))}function _(M,p,g){z.selectedPointStyle(M.selectAll("path"),p),A(M.selectAll("text"),p,g)}function A(M,p,g){M.each(function(C){var S=f.select(this),N;if(C.selected){N=P.ensureUniformFontSize(g,d(S,C,p,g));var B=p.selected.textfont&&p.selected.textfont.color;B&&(N.color=B),z.font(S,N)}else z.selectedTextStyle(S,p)})}function d(M,p,g,C){var S=C._fullLayout.font,N=g.textfont;if(M.classed("bartext-inside")){var B=I(p,g);N=w(g,p.i,S,B)}else M.classed("bartext-outside")&&(N=D(g,p.i,S));return N}function k(M,p,g){return E(l,M.textfont,p,g)}function w(M,p,g,C){var S=k(M,p,g),N=M._input.textfont===void 0||M._input.textfont.color===void 0||Array.isArray(M.textfont.color)&&M.textfont.color[p]===void 0;return N&&(S={color:y.contrast(C),family:S.family,size:S.size,weight:S.weight,style:S.style,variant:S.variant,textcase:S.textcase,lineposition:S.lineposition,shadow:S.shadow}),E(o,M.insidetextfont,p,S)}function D(M,p,g){var C=k(M,p,g);return E(c,M.outsidetextfont,p,C)}function E(M,p,g,C){p=p||{};var S=s.getValue(p.family,g),N=s.getValue(p.size,g),B=s.getValue(p.color,g),U=s.getValue(p.weight,g),V=s.getValue(p.style,g),W=s.getValue(p.variant,g),F=s.getValue(p.textcase,g),H=s.getValue(p.lineposition,g),q=s.getValue(p.shadow,g);return{family:s.coerceString(M.family,S,C.family),size:s.coerceNumber(M.size,N,C.size),color:s.coerceColor(M.color,B,C.color),weight:s.coerceString(M.weight,U,C.weight),style:s.coerceString(M.style,V,C.style),variant:s.coerceString(M.variant,W,C.variant),textcase:s.coerceString(M.variant,F,C.textcase),lineposition:s.coerceString(M.variant,H,C.lineposition),shadow:s.coerceString(M.variant,q,C.shadow)}}function I(M,p){return p.type==="waterfall"?p[M.dir].marker.color:M.mcc||M.mc||p.marker.color}Y.exports={style:h,styleTextPoints:b,styleOnSelect:x,getInsideTextFont:w,getOutsideTextFont:D,getBarColor:I,resizeText:i}}),yb=It((et,Y)=>{var f=Br(),y=Sr(),z=jn(),P=uu(),n=Hn(),i=Js(),a=ls(),l=Fs().tickText,o=C0(),c=o.recordMinTextSize,s=o.clearMinTextSize,h=Pg(),m=B8(),b=vb(),x=Jv(),_=x.text,A=x.textposition,d=T0().appendArrayPointValue,k=b.TEXTPAD;function w(ht){return ht.id}function D(ht){if(ht.ids)return w}function E(ht){return(ht>0)-(ht<0)}function I(ht,bt){return ht0}function C(ht,bt,vt,ut,rt,gt){var it=bt.xaxis,st=bt.yaxis,xt=ht._fullLayout,ot=ht._context.staticPlot;rt||(rt={mode:xt.barmode,norm:xt.barmode,gap:xt.bargap,groupgap:xt.bargroupgap},s("bar",xt));var J=z.makeTraceGroups(ut,vt,"trace bars").each(function(mt){var dt=f.select(this),Ct=mt[0].trace,Rt=mt[0].t,Bt=Ct.type==="waterfall",Zt=Ct.type==="funnel",Gt=Ct.type==="histogram",ee=Ct.type==="bar",xe=ee||Zt,ge=0;Bt&&Ct.connector.visible&&Ct.connector.mode==="between"&&(ge=Ct.connector.line.width/2);var ye=Ct.orientation==="h",ue=g(rt),Mt=z.ensureSingle(dt,"g","points"),Ot=D(Ct),Lt=Mt.selectAll("g.point").data(z.identity,Ot);Lt.enter().append("g").classed("point",!0),Lt.exit().remove(),Lt.each(function(be,ce){var Le=f.select(this),Ze=M(be,it,st,ye),Qe=Ze[0][0],mr=Ze[0][1],fr=Ze[1][0],Jr=Ze[1][1],an=(ye?mr-Qe:Jr-fr)===0;an&&xe&&m.getLineWidth(Ct,be)&&(an=!1),an||(an=!y(Qe)||!y(mr)||!y(fr)||!y(Jr)),be.isBlank=an,an&&(ye?mr=Qe:Jr=fr),ge&&!an&&(ye?(Qe-=I(Qe,mr)*ge,mr+=I(Qe,mr)*ge):(fr-=I(fr,Jr)*ge,Jr+=I(fr,Jr)*ge));var Er,dn;if(Ct.type==="waterfall"){if(!an){var _n=Ct[be.dir].marker;Er=_n.line.width,dn=_n.color}}else Er=m.getLineWidth(Ct,be),dn=be.mc||Ct.marker.color;function Oe(oa){var Ke=f.round(Er/2%1,2);return rt.gap===0&&rt.groupgap===0?f.round(Math.round(oa)-Ke,2):oa}function Xt(oa,Ke,sr){return sr&&oa===Ke?oa:Math.abs(oa-Ke)>=2?Oe(oa):oa>Ke?Math.ceil(oa):Math.floor(oa)}var oe=n.opacity(dn),zt=oe<1||Er>.01?Oe:Xt;ht._context.staticPlot||(Qe=zt(Qe,mr,ye),mr=zt(mr,Qe,ye),fr=zt(fr,Jr,!ye),Jr=zt(Jr,fr,!ye));var _t=ye?it.c2p:st.c2p,Pt;be.s0>0?Pt=be._sMax:be.s0<0?Pt=be._sMin:Pt=be.s1>0?be._sMax:be._sMin;function Ht(oa,Ke){if(!oa)return 0;var sr=Math.abs(ye?Jr-fr:mr-Qe),vr=Math.abs(ye?mr-Qe:Jr-fr),Ar=zt(Math.abs(_t(Pt,!0)-_t(0,!0))),mn=be.hasB?Math.min(sr/2,vr/2):Math.min(sr/2,Ar),Zn;if(Ke==="%"){var Un=Math.min(50,oa);Zn=sr*(Un/100)}else Zn=oa;return zt(Math.max(Math.min(Zn,mn),0))}var ae=ee||Gt?Ht(Rt.cornerradiusvalue,Rt.cornerradiusform):0,he,Me,qe="M"+Qe+","+fr+"V"+Jr+"H"+mr+"V"+fr+"Z",Ye=0;if(ae&&be.s){var ur=E(be.s0)===0||E(be.s)===E(be.s0)?be.s1:be.s0;if(Ye=zt(be.hasB?0:Math.abs(_t(Pt,!0)-_t(ur,!0))),Ye0?Math.sqrt(Ye*(2*ae-Ye)):0,ui=Rr>0?Math.max:Math.min;he="M"+Qe+","+fr+"V"+(Jr-pn*zr)+"H"+ui(mr-(ae-Ye)*Rr,Qe)+"A "+ae+","+ae+" 0 0 "+xr+" "+mr+","+(Jr-ae*zr-ci)+"V"+(fr+ae*zr+ci)+"A "+ae+","+ae+" 0 0 "+xr+" "+ui(mr-(ae-Ye)*Rr,Qe)+","+(fr+pn*zr)+"Z"}else if(be.hasB)he="M"+(Qe+ae*Rr)+","+fr+"A "+ae+","+ae+" 0 0 "+xr+" "+Qe+","+(fr+ae*zr)+"V"+(Jr-ae*zr)+"A "+ae+","+ae+" 0 0 "+xr+" "+(Qe+ae*Rr)+","+Jr+"H"+(mr-ae*Rr)+"A "+ae+","+ae+" 0 0 "+xr+" "+mr+","+(Jr-ae*zr)+"V"+(fr+ae*zr)+"A "+ae+","+ae+" 0 0 "+xr+" "+(mr-ae*Rr)+","+fr+"Z";else{Me=Math.abs(Jr-fr)+Ye;var yi=Me0?Math.sqrt(Ye*(2*ae-Ye)):0,Ci=zr>0?Math.max:Math.min;he="M"+(Qe+yi*Rr)+","+fr+"V"+Ci(Jr-(ae-Ye)*zr,fr)+"A "+ae+","+ae+" 0 0 "+xr+" "+(Qe+ae*Rr-Gi)+","+Jr+"H"+(mr-ae*Rr+Gi)+"A "+ae+","+ae+" 0 0 "+xr+" "+(mr-yi*Rr)+","+Ci(Jr-(ae-Ye)*zr,fr)+"V"+fr+"Z"}}else he=qe}else he=qe;var fi=p(z.ensureSingle(Le,"path"),xt,rt,gt);if(fi.style("vector-effect",ot?"none":"non-scaling-stroke").attr("d",isNaN((mr-Qe)*(Jr-fr))||an&&ht._context.staticPlot?"M0,0Z":he).call(i.setClipUrl,bt.layerClipId,ht),!xt.uniformtext.mode&&ue){var ba=i.makePointStyleFns(Ct);i.singlePointStyle(be,fi,Ct,ba,ht)}S(ht,bt,Le,mt,ce,Qe,mr,fr,Jr,ae,Ye,rt,gt),bt.layerClipId&&i.hideOutsideRangePoint(be,Le.select("text"),it,st,Ct.xcalendar,Ct.ycalendar)});var ie=Ct.cliponaxis===!1;i.setClipUrl(dt,ie?null:bt.layerClipId,ht)});a.getComponentMethod("errorbars","plot")(ht,J,bt,rt)}function S(ht,bt,vt,ut,rt,gt,it,st,xt,ot,J,mt,dt){var Ct=bt.xaxis,Rt=bt.yaxis,Bt=ht._fullLayout,Zt;function Gt(Me,qe,Ye){var ur=z.ensureSingle(Me,"text").text(qe).attr({class:"bartext bartext-"+Zt,"text-anchor":"middle","data-notex":1}).call(i.font,Ye).call(P.convertToTspans,ht);return ur}var ee=ut[0].trace,xe=ee.orientation==="h",ge=H(Bt,ut,rt,Ct,Rt);Zt=q(ee,rt);var ye=mt.mode==="stack"||mt.mode==="relative",ue=ut[rt],Mt=!ye||ue._outmost,Ot=ue.hasB,Lt=ot&&ot-J>k;if(!ge||Zt==="none"||(ue.isBlank||gt===it||st===xt)&&(Zt==="auto"||Zt==="inside")){vt.select("text").remove();return}var ie=Bt.font,be=h.getBarColor(ut[rt],ee),ce=h.getInsideTextFont(ee,rt,ie,be),Le=h.getOutsideTextFont(ee,rt,ie),Ze=ee.insidetextanchor||"end",Qe=vt.datum();xe?Ct.type==="log"&&Qe.s0<=0&&(Ct.range[0]0&&Oe>0,zt;Lt?Ot?zt=N(Jr-2*ot,an,_n,Oe,xe)||N(Jr,an-2*ot,_n,Oe,xe):xe?zt=N(Jr-(ot-J),an,_n,Oe,xe)||N(Jr,an-2*(ot-J),_n,Oe,xe):zt=N(Jr,an-(ot-J),_n,Oe,xe)||N(Jr-2*(ot-J),an,_n,Oe,xe):zt=N(Jr,an,_n,Oe,xe),oe&&zt?Zt="inside":(Zt="outside",Er.remove(),Er=null)}else Zt="inside";if(!Er){Xt=z.ensureUniformFontSize(ht,Zt==="outside"?Le:ce),Er=Gt(vt,ge,Xt);var _t=Er.attr("transform");if(Er.attr("transform",""),dn=i.bBox(Er.node()),_n=dn.width,Oe=dn.height,Er.attr("transform",_t),_n<=0||Oe<=0){Er.remove();return}}var Pt=ee.textangle,Ht,ae;Zt==="outside"?(ae=ee.constraintext==="both"||ee.constraintext==="outside",Ht=F(gt,it,st,xt,dn,{isHorizontal:xe,constrained:ae,angle:Pt})):(ae=ee.constraintext==="both"||ee.constraintext==="inside",Ht=V(gt,it,st,xt,dn,{isHorizontal:xe,constrained:ae,angle:Pt,anchor:Ze,hasB:Ot,r:ot,overhead:J})),Ht.fontSize=Xt.size,c(ee.type==="histogram"?"bar":ee.type,Ht,Bt),ue.transform=Ht;var he=p(Er,Bt,mt,dt);z.setTransormAndDisplay(he,Ht)}function N(ht,bt,vt,ut,rt){if(ht<0||bt<0)return!1;var gt=vt<=ht&&ut<=bt,it=vt<=bt&&ut<=ht,st=rt?ht>=vt*(bt/ut):bt>=ut*(ht/vt);return gt||it||st}function B(ht){return ht==="auto"?0:ht}function U(ht,bt){var vt=Math.PI/180*bt,ut=Math.abs(Math.sin(vt)),rt=Math.abs(Math.cos(vt));return{x:ht.width*rt+ht.height*ut,y:ht.width*ut+ht.height*rt}}function V(ht,bt,vt,ut,rt,gt){var it=!!gt.isHorizontal,st=!!gt.constrained,xt=gt.angle||0,ot=gt.anchor,J=ot==="end",mt=ot==="start",dt=gt.leftToRight||0,Ct=(dt+1)/2,Rt=1-Ct,Bt=gt.hasB,Zt=gt.r,Gt=gt.overhead,ee=rt.width,xe=rt.height,ge=Math.abs(bt-ht),ye=Math.abs(ut-vt),ue=ge>2*k&&ye>2*k?k:0;ge-=2*ue,ye-=2*ue;var Mt=B(xt);xt==="auto"&&!(ee<=ge&&xe<=ye)&&(ee>ge||xe>ye)&&(!(ee>ye||xe>ge)||eek){var be=W(ht,bt,vt,ut,Ot,Zt,Gt,it,Bt);Lt=be.scale,ie=be.pad}else Lt=1,st&&(Lt=Math.min(1,ge/Ot.x,ye/Ot.y)),ie=0;var ce=rt.left*Rt+rt.right*Ct,Le=(rt.top+rt.bottom)/2,Ze=(ht+k)*Rt+(bt-k)*Ct,Qe=(vt+ut)/2,mr=0,fr=0;if(mt||J){var Jr=(it?Ot.x:Ot.y)/2;Zt&&(J||Bt)&&(ue+=ie);var an=it?I(ht,bt):I(vt,ut);it?mt?(Ze=ht+an*ue,mr=-an*Jr):(Ze=bt-an*ue,mr=an*Jr):mt?(Qe=vt+an*ue,fr=-an*Jr):(Qe=ut-an*ue,fr=an*Jr)}return{textX:ce,textY:Le,targetX:Ze,targetY:Qe,anchorX:mr,anchorY:fr,scale:Lt,rotate:Mt}}function W(ht,bt,vt,ut,rt,gt,it,st,xt){var ot=Math.max(0,Math.abs(bt-ht)-2*k),J=Math.max(0,Math.abs(ut-vt)-2*k),mt=gt-k,dt=it?mt-Math.sqrt(mt*mt-(mt-it)*(mt-it)):mt,Ct=xt?mt*2:st?mt-it:2*dt,Rt=xt?mt*2:st?2*dt:mt-it,Bt,Zt,Gt,ee,xe;return rt.y/rt.x>=J/(ot-Ct)?ee=J/rt.y:rt.y/rt.x<=(J-Rt)/ot?ee=ot/rt.x:!xt&&st?(Bt=rt.x*rt.x+rt.y*rt.y/4,Zt=-2*rt.x*(ot-mt)-rt.y*(J/2-mt),Gt=(ot-mt)*(ot-mt)+(J/2-mt)*(J/2-mt)-mt*mt,ee=(-Zt+Math.sqrt(Zt*Zt-4*Bt*Gt))/(2*Bt)):xt?(Bt=(rt.x*rt.x+rt.y*rt.y)/4,Zt=-rt.x*(ot/2-mt)-rt.y*(J/2-mt),Gt=(ot/2-mt)*(ot/2-mt)+(J/2-mt)*(J/2-mt)-mt*mt,ee=(-Zt+Math.sqrt(Zt*Zt-4*Bt*Gt))/(2*Bt)):(Bt=rt.x*rt.x/4+rt.y*rt.y,Zt=-rt.x*(ot/2-mt)-2*rt.y*(J-mt),Gt=(ot/2-mt)*(ot/2-mt)+(J-mt)*(J-mt)-mt*mt,ee=(-Zt+Math.sqrt(Zt*Zt-4*Bt*Gt))/(2*Bt)),ee=Math.min(1,ee),st?xe=Math.max(0,mt-Math.sqrt(Math.max(0,mt*mt-(mt-(J-rt.y*ee)/2)*(mt-(J-rt.y*ee)/2)))-it):xe=Math.max(0,mt-Math.sqrt(Math.max(0,mt*mt-(mt-(ot-rt.x*ee)/2)*(mt-(ot-rt.x*ee)/2)))-it),{scale:ee,pad:xe}}function F(ht,bt,vt,ut,rt,gt){var it=!!gt.isHorizontal,st=!!gt.constrained,xt=gt.angle||0,ot=rt.width,J=rt.height,mt=Math.abs(bt-ht),dt=Math.abs(ut-vt),Ct;it?Ct=dt>2*k?k:0:Ct=mt>2*k?k:0;var Rt=1;st&&(Rt=it?Math.min(1,dt/J):Math.min(1,mt/ot));var Bt=B(xt),Zt=U(rt,Bt),Gt=(it?Zt.x:Zt.y)/2,ee=(rt.left+rt.right)/2,xe=(rt.top+rt.bottom)/2,ge=(ht+bt)/2,ye=(vt+ut)/2,ue=0,Mt=0,Ot=it?I(bt,ht):I(vt,ut);return it?(ge=bt-Ot*Ct,ue=Ot*Gt):(ye=ut+Ot*Ct,Mt=-Ot*Gt),{textX:ee,textY:xe,targetX:ge,targetY:ye,anchorX:ue,anchorY:Mt,scale:Rt,rotate:Bt}}function H(ht,bt,vt,ut,rt){var gt=bt[0].trace,it=gt.texttemplate,st;return it?st=G(ht,bt,vt,ut,rt):gt.textinfo?st=tt(bt,vt,ut,rt):st=m.getValue(gt.text,vt),m.coerceString(_,st)}function q(ht,bt){var vt=m.getValue(ht.textposition,bt);return m.coerceEnumerated(A,vt)}function G(ht,bt,vt,ut,rt){var gt=bt[0].trace,it=z.castOption(gt,vt,"texttemplate");if(!it)return"";var st=gt.type==="histogram",xt=gt.type==="waterfall",ot=gt.type==="funnel",J=gt.orientation==="h",mt,dt,Ct,Rt;J?(mt="y",dt=rt,Ct="x",Rt=ut):(mt="x",dt=ut,Ct="y",Rt=rt);function Bt(ue){return l(dt,dt.c2l(ue),!0).text}function Zt(ue){return l(Rt,Rt.c2l(ue),!0).text}var Gt=bt[vt],ee={};ee.label=Gt.p,ee.labelLabel=ee[mt+"Label"]=Bt(Gt.p);var xe=z.castOption(gt,Gt.i,"text");(xe===0||xe)&&(ee.text=xe),ee.value=Gt.s,ee.valueLabel=ee[Ct+"Label"]=Zt(Gt.s);var ge={};d(ge,gt,Gt.i),(st||ge.x===void 0)&&(ge.x=J?ee.value:ee.label),(st||ge.y===void 0)&&(ge.y=J?ee.label:ee.value),(st||ge.xLabel===void 0)&&(ge.xLabel=J?ee.valueLabel:ee.labelLabel),(st||ge.yLabel===void 0)&&(ge.yLabel=J?ee.labelLabel:ee.valueLabel),xt&&(ee.delta=+Gt.rawS||Gt.s,ee.deltaLabel=Zt(ee.delta),ee.final=Gt.v,ee.finalLabel=Zt(ee.final),ee.initial=ee.final-ee.delta,ee.initialLabel=Zt(ee.initial)),ot&&(ee.value=Gt.s,ee.valueLabel=Zt(ee.value),ee.percentInitial=Gt.begR,ee.percentInitialLabel=z.formatPercent(Gt.begR),ee.percentPrevious=Gt.difR,ee.percentPreviousLabel=z.formatPercent(Gt.difR),ee.percentTotal=Gt.sumR,ee.percenTotalLabel=z.formatPercent(Gt.sumR));var ye=z.castOption(gt,Gt.i,"customdata");return ye&&(ee.customdata=ye),z.texttemplateString({data:[ge,ee,gt._meta],fallback:gt.texttemplatefallback,labels:ee,locale:ht._d3locale,template:it})}function tt(ht,bt,vt,ut){var rt=ht[0].trace,gt=rt.orientation==="h",it=rt.type==="waterfall",st=rt.type==="funnel";function xt(ye){var ue=gt?ut:vt;return l(ue,ye,!0).text}function ot(ye){var ue=gt?vt:ut;return l(ue,+ye,!0).text}var J=rt.textinfo,mt=ht[bt],dt=J.split("+"),Ct=[],Rt,Bt=function(ye){return dt.indexOf(ye)!==-1};if(Bt("label")&&Ct.push(xt(ht[bt].p)),Bt("text")&&(Rt=z.castOption(rt,mt.i,"text"),(Rt===0||Rt)&&Ct.push(Rt)),it){var Zt=+mt.rawS||mt.s,Gt=mt.v,ee=Gt-Zt;Bt("initial")&&Ct.push(ot(ee)),Bt("delta")&&Ct.push(ot(Zt)),Bt("final")&&Ct.push(ot(Gt))}if(st){Bt("value")&&Ct.push(ot(mt.s));var xe=0;Bt("percent initial")&&xe++,Bt("percent previous")&&xe++,Bt("percent total")&&xe++;var ge=xe>1;Bt("percent initial")&&(Rt=z.formatPercent(mt.begR),ge&&(Rt+=" of initial"),Ct.push(Rt)),Bt("percent previous")&&(Rt=z.formatPercent(mt.difR),ge&&(Rt+=" of previous"),Ct.push(Rt)),Bt("percent total")&&(Rt=z.formatPercent(mt.sumR),ge&&(Rt+=" of total"),Ct.push(Rt))}return Ct.join("
")}Y.exports={plot:C,toMoveInsideBar:V}}),Iw=It((et,Y)=>{var f=hd(),y=ls(),z=Hn(),P=jn().fillText,n=B8().getLineWidth,i=Fs().hoverLabelText,a=Dr().BADNUM;function l(s,h,m,b,x){var _=o(s,h,m,b,x);if(_){var A=_.cd,d=A[0].trace,k=A[_.index];return _.color=c(d,k),y.getComponentMethod("errorbars","hoverInfo")(k,d,_),[_]}}function o(s,h,m,b,x){var _=s.cd,A=_[0].trace,d=_[0].t,k=b==="closest",w=A.type==="waterfall",D=s.maxHoverDistance,E=s.maxSpikeDistance,I,M,p,g,C,S,N;A.orientation==="h"?(I=m,M=h,p="y",g="x",C=ut,S=ht):(I=h,M=m,p="x",g="y",S=ut,C=ht);var B=A[p+"period"],U=k||B;function V(Rt){return F(Rt,-1)}function W(Rt){return F(Rt,1)}function F(Rt,Bt){var Zt=Rt.w;return Rt[p]+Bt*Zt/2}function H(Rt){return Rt[p+"End"]-Rt[p+"Start"]}var q=k?V:B?function(Rt){return Rt.p-H(Rt)/2}:function(Rt){return Math.min(V(Rt),Rt.p-d.bardelta/2)},G=k?W:B?function(Rt){return Rt.p+H(Rt)/2}:function(Rt){return Math.max(W(Rt),Rt.p+d.bardelta/2)};function tt(Rt,Bt,Zt){return x.finiteRange&&(Zt=0),f.inbox(Rt-I,Bt-I,Zt+Math.min(1,Math.abs(Bt-Rt)/N)-1)}function ht(Rt){return tt(q(Rt),G(Rt),D)}function bt(Rt){return tt(V(Rt),W(Rt),E)}function vt(Rt){var Bt=Rt[g];if(w){var Zt=Math.abs(Rt.rawS)||0;M>0?Bt+=Zt:M<0&&(Bt-=Zt)}return Bt}function ut(Rt){var Bt=M,Zt=Rt.b,Gt=vt(Rt);return f.inbox(Zt-Bt,Gt-Bt,D+(Gt-Bt)/(Gt-Zt)-1)}function rt(Rt){var Bt=M,Zt=Rt.b,Gt=vt(Rt);return f.inbox(Zt-Bt,Gt-Bt,E+(Gt-Bt)/(Gt-Zt)-1)}var gt=s[p+"a"],it=s[g+"a"];N=Math.abs(gt.r2c(gt.range[1])-gt.r2c(gt.range[0]));function st(Rt){return(C(Rt)+S(Rt))/2}var xt=f.getDistanceFunction(b,C,S,st);if(f.getClosest(_,xt,s),s.index!==!1&&_[s.index].p!==a){U||(q=function(Rt){return Math.min(V(Rt),Rt.p-d.bargroupwidth/2)},G=function(Rt){return Math.max(W(Rt),Rt.p+d.bargroupwidth/2)});var ot=s.index,J=_[ot],mt=A.base?J.b+J.s:J.s;s[g+"0"]=s[g+"1"]=it.c2p(J[g],!0),s[g+"LabelVal"]=mt;var dt=d.extents[d.extents.round(J.p)];s[p+"0"]=gt.c2p(k?q(J):dt[0],!0),s[p+"1"]=gt.c2p(k?G(J):dt[1],!0);var Ct=J.orig_p!==void 0;return s[p+"LabelVal"]=Ct?J.orig_p:J.p,s.labelLabel=i(gt,s[p+"LabelVal"],A[p+"hoverformat"]),s.valueLabel=i(it,s[g+"LabelVal"],A[g+"hoverformat"]),s.baseLabel=i(it,J.b,A[g+"hoverformat"]),s.spikeDistance=(rt(J)+bt(J))/2,s[p+"Spike"]=gt.c2p(J.p,!0),P(J,A,s),s.hovertemplate=A.hovertemplate,s}}function c(s,h){var m=h.mcc||s.marker.color,b=h.mlcc||s.marker.line.color,x=n(s,h);if(z.opacity(m))return m;if(z.opacity(b)&&x)return b}Y.exports={hoverPoints:l,hoverOnBars:o,getTraceColor:c}}),Oq=It((et,Y)=>{Y.exports=function(f,y,z){return f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),z.orientation==="h"?(f.label=f.y,f.value=f.x):(f.label=f.x,f.value=f.y),f}}),Dw=It((et,Y)=>{Y.exports=function(y,z){var P=y.cd,n=y.xaxis,i=y.yaxis,a=P[0].trace,l=a.type==="funnel",o=a.orientation==="h",c=[],s;if(z===!1)for(s=0;s{Y.exports={attributes:Jv(),layoutAttributes:z8(),supplyDefaults:eg().supplyDefaults,crossTraceDefaults:eg().crossTraceDefaults,supplyLayoutDefaults:VL(),calc:zq(),crossTraceCalc:Wr().crossTraceCalc,colorbar:Do(),arraysToCalcdata:Z4(),plot:yb().plot,style:Pg().style,styleOnSelect:Pg().styleOnSelect,hoverPoints:Iw().hoverPoints,eventData:Oq(),selectPoints:Dw(),moduleType:"trace",name:"bar",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),Rq=It((et,Y)=>{Y.exports=Bq()}),K4=It((et,Y)=>{var f=Em(),y=dd(),z=Jv(),P=Sn(),n=Sh().axisHoverFormat,{hovertemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=Yn().extendFlat,o=y.marker,c=o.line;Y.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:y.xperiod,yperiod:y.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:y.xperiodalignment,yperiodalignment:y.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},o.angle,{arrayOk:!1,editType:"calc"}),size:l({},o.size,{arrayOk:!1,editType:"calc"}),color:l({},o.color,{arrayOk:!1,editType:"style"}),line:{color:l({},c.color,{arrayOk:!1,dflt:P.defaultLine,editType:"style"}),width:l({},c.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:f(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:z.offsetgroup,alignmentgroup:z.alignmentgroup,selected:{marker:y.selected.marker,editType:"style"},unselected:{marker:y.unselected.marker,editType:"style"},text:l({},y.text,{}),hovertext:l({},y.hovertext,{}),hovertemplate:i({}),hovertemplatefallback:a(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:y.zorder}}),Y4=It((et,Y)=>{Y.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}),X4=It((et,Y)=>{var f=jn(),y=ls(),z=Hn(),P=S0(),n=Xv(),i=ty(),a=K4();function l(h,m,b,x){function _(g,C){return f.coerce(h,m,a,g,C)}if(o(h,m,_,x),m.visible!==!1){P(h,m,x,_),_("xhoverformat"),_("yhoverformat");var A=m._hasPreCompStats;A&&(_("lowerfence"),_("upperfence")),_("line.color",(h.marker||{}).color||b),_("line.width"),_("fillcolor",z.addOpacity(m.line.color,.5));var d=!1;if(A){var k=_("mean"),w=_("sd");k&&k.length&&(d=!0,w&&w.length&&(d="sd"))}_("whiskerwidth");var D=_("sizemode"),E;D==="quartiles"&&(E=_("boxmean",d)),_("showwhiskers",D==="quartiles"),(D==="sd"||E==="sd")&&_("sdmultiple"),_("width"),_("quartilemethod");var I=!1;if(A){var M=_("notchspan");M&&M.length&&(I=!0)}else f.validate(h.notchwidth,a.notchwidth)&&(I=!0);var p=_("notched",I);p&&_("notchwidth"),c(h,m,_,{prefix:"box"}),_("zorder")}}function o(h,m,b,x){function _(tt){var ht=0;return tt&&tt.length&&(ht+=1,f.isArrayOrTypedArray(tt[0])&&tt[0].length&&(ht+=1)),ht}function A(tt){return f.validate(h[tt],a[tt])}var d=b("y"),k=b("x"),w;if(m.type==="box"){var D=b("q1"),E=b("median"),I=b("q3");m._hasPreCompStats=D&&D.length&&E&&E.length&&I&&I.length,w=Math.min(f.minRowLength(D),f.minRowLength(E),f.minRowLength(I))}var M=_(d),p=_(k),g=M&&f.minRowLength(d),C=p&&f.minRowLength(k),S=x.calendar,N={autotypenumbers:x.autotypenumbers},B,U;if(m._hasPreCompStats)switch(String(p)+String(M)){case"00":var V=A("x0")||A("dx"),W=A("y0")||A("dy");W&&!V?B="h":B="v",U=w;break;case"10":B="v",U=Math.min(w,C);break;case"20":B="h",U=Math.min(w,k.length);break;case"01":B="h",U=Math.min(w,g);break;case"02":B="v",U=Math.min(w,d.length);break;case"12":B="v",U=Math.min(w,C,d.length);break;case"21":B="h",U=Math.min(w,k.length,g);break;case"11":U=0;break;case"22":var F=!1,H;for(H=0;H0?(B="v",p>0?U=Math.min(C,g):U=Math.min(g)):p>0?(B="h",U=Math.min(C)):U=0;if(!U){m.visible=!1;return}m._length=U;var q=b("orientation",B);m._hasPreCompStats?q==="v"&&p===0?(b("x0",0),b("dx",1)):q==="h"&&M===0&&(b("y0",0),b("dy",1)):q==="v"&&p===0?b("x0"):q==="h"&&M===0&&b("y0");var G=y.getComponentMethod("calendars","handleTraceDefaults");G(h,m,["x","y"],x)}function c(h,m,b,x){var _=x.prefix,A=f.coerce2(h,m,a,"marker.outliercolor"),d=b("marker.line.outliercolor"),k="outliers";m._hasPreCompStats?k="all":(A||d)&&(k="suspectedoutliers");var w=b(_+"points",k);w?(b("jitter",w==="all"?.3:0),b("pointpos",w==="all"?-1.5:0),b("marker.symbol"),b("marker.opacity"),b("marker.size"),b("marker.angle"),b("marker.color",m.line.color),b("marker.line.color"),b("marker.line.width"),w==="suspectedoutliers"&&(b("marker.line.outliercolor",m.marker.color),b("marker.line.outlierwidth")),b("selected.marker.color"),b("unselected.marker.color"),b("selected.marker.size"),b("unselected.marker.size"),b("text"),b("hovertext")):delete m.marker;var D=b("hoveron");(D==="all"||D.indexOf("points")!==-1)&&(b("hovertemplate"),b("hovertemplatefallback")),f.coerceSelectionMarkerOpacity(m,b)}function s(h,m){var b,x;function _(w){return f.coerce(x._input,x,a,w)}for(var A=0;A{var f=ls(),y=jn(),z=Y4();function P(i,a,l,o,c){for(var s=c+"Layout",h=!1,m=0;m{var f=Sr(),y=Fs(),z=Im(),P=jn(),n=Dr().BADNUM,i=P._;Y.exports=function(w,D){var E=w._fullLayout,I=y.getFromId(w,D.xaxis||"x"),M=y.getFromId(w,D.yaxis||"y"),p=[],g=D.type==="violin"?"_numViolins":"_numBoxes",C,S,N,B,U,V,W;D.orientation==="h"?(N=I,B="x",U=M,V="y",W=!!D.yperiodalignment):(N=M,B="y",U=I,V="x",W=!!D.xperiodalignment);var F=a(D,V,U,E[g]),H=F[0],q=F[1],G=P.distinctVals(H,U),tt=G.vals,ht=G.minDiff/2,bt,vt,ut,rt,gt,it,st=(D.boxpoints||D.points)==="all"?P.identity:function(Jr){return Jr.vbt.uf};if(D._hasPreCompStats){var xt=D[B],ot=function(Jr){return N.d2c((D[Jr]||[])[C])},J=1/0,mt=-1/0;for(C=0;C=bt.q1&&bt.q3>=bt.med){var Ct=ot("lowerfence");bt.lf=Ct!==n&&Ct<=bt.q1?Ct:x(bt,ut,rt);var Rt=ot("upperfence");bt.uf=Rt!==n&&Rt>=bt.q3?Rt:_(bt,ut,rt);var Bt=ot("mean");bt.mean=Bt!==n?Bt:rt?P.mean(ut,rt):(bt.q1+bt.q3)/2;var Zt=ot("sd");bt.sd=Bt!==n&&Zt>=0?Zt:rt?P.stdev(ut,rt,bt.mean):bt.q3-bt.q1,bt.lo=A(bt),bt.uo=d(bt);var Gt=ot("notchspan");Gt=Gt!==n&&Gt>0?Gt:k(bt,rt),bt.ln=bt.med-Gt,bt.un=bt.med+Gt;var ee=bt.lf,xe=bt.uf;D.boxpoints&&ut.length&&(ee=Math.min(ee,ut[0]),xe=Math.max(xe,ut[rt-1])),D.notched&&(ee=Math.min(ee,bt.ln),xe=Math.max(xe,bt.un)),bt.min=ee,bt.max=xe}else{P.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+bt.q1,"median = "+bt.med,"q3 = "+bt.q3].join(` +`));var ge;bt.med!==n?ge=bt.med:bt.q1!==n?bt.q3!==n?ge=(bt.q1+bt.q3)/2:ge=bt.q1:bt.q3!==n?ge=bt.q3:ge=0,bt.med=ge,bt.q1=bt.q3=ge,bt.lf=bt.uf=ge,bt.mean=bt.sd=ge,bt.ln=bt.un=ge,bt.min=bt.max=ge}J=Math.min(J,bt.min),mt=Math.max(mt,bt.max),bt.pts2=vt.filter(st),p.push(bt)}}D._extremes[N._id]=y.findExtremes(N,[J,mt],{padded:!0})}else{var ye=N.makeCalcdata(D,B),ue=l(tt,ht),Mt=tt.length,Ot=o(Mt);for(C=0;C=0&&Lt0){if(bt={},bt.pos=bt[V]=tt[C],vt=bt.pts=Ot[C].sort(m),ut=bt[B]=vt.map(b),rt=ut.length,bt.min=ut[0],bt.max=ut[rt-1],bt.mean=P.mean(ut,rt),bt.sd=P.stdev(ut,rt,bt.mean)*D.sdmultiple,bt.med=P.interp(ut,.5),rt%2&&(Le||Ze)){var Qe,mr;Le?(Qe=ut.slice(0,rt/2),mr=ut.slice(rt/2+1)):Ze&&(Qe=ut.slice(0,rt/2+1),mr=ut.slice(rt/2)),bt.q1=P.interp(Qe,.5),bt.q3=P.interp(mr,.5)}else bt.q1=P.interp(ut,.25),bt.q3=P.interp(ut,.75);bt.lf=x(bt,ut,rt),bt.uf=_(bt,ut,rt),bt.lo=A(bt),bt.uo=d(bt);var fr=k(bt,rt);bt.ln=bt.med-fr,bt.un=bt.med+fr,ie=Math.min(ie,bt.ln),be=Math.max(be,bt.un),bt.pts2=vt.filter(st),p.push(bt)}D.notched&&P.isTypedArray(ye)&&(ye=Array.from(ye)),D._extremes[N._id]=y.findExtremes(N,D.notched?ye.concat([ie,be]):ye,{padded:!0})}return h(p,D),p.length>0?(p[0].t={num:E[g],dPos:ht,posLetter:V,valLetter:B,labels:{med:i(w,"median:"),min:i(w,"min:"),q1:i(w,"q1:"),q3:i(w,"q3:"),max:i(w,"max:"),mean:D.boxmean==="sd"||D.sizemode==="sd"?i(w,"mean ± σ:").replace("σ",D.sdmultiple===1?"σ":D.sdmultiple+"σ"):i(w,"mean:"),lf:i(w,"lower fence:"),uf:i(w,"upper fence:")}},E[g]++,p):[{t:{empty:!0}}]};function a(w,D,E,I){var M=D in w,p=D+"0"in w,g="d"+D in w;if(M||p&&g){var C=E.makeCalcdata(w,D),S=z(w,E,D,C).vals;return[S,C]}var N;p?N=w[D+"0"]:"name"in w&&(E.type==="category"||f(w.name)&&["linear","log"].indexOf(E.type)!==-1||P.isDateTime(w.name)&&E.type==="date")?N=w.name:N=I;for(var B=E.type==="multicategory"?E.r2c_just_indices(N):E.d2c(N,0,w[D+"calendar"]),U=w._length,V=new Array(U),W=0;W{var f=Fs(),y=jn(),z=iy().getAxisGroup,P=["v","h"];function n(a,l){for(var o=a.calcdata,c=l.xaxis,s=l.yaxis,h=0;h1,p=1-h[a+"gap"],g=1-h[a+"groupgap"];for(x=0;x0;if(B==="positive"?(vt=U*(N?1:.5),gt=rt,ut=gt=W):B==="negative"?(vt=gt=W,ut=U*(N?1:.5),it=rt):(vt=ut=U,gt=it=rt),dt){var Ct=C.pointpos,Rt=C.jitter,Bt=C.marker.size/2,Zt=0;Ct+Rt>=0&&(Zt=rt*(Ct+Rt),Zt>vt?(mt=!0,ot=Bt,st=Zt):Zt>gt&&(ot=Bt,st=vt)),Zt<=vt&&(st=vt);var Gt=0;Ct-Rt<=0&&(Gt=-rt*(Ct-Rt),Gt>ut?(mt=!0,J=Bt,xt=Gt):Gt>it&&(J=Bt,xt=ut)),Gt<=ut&&(xt=ut)}else st=vt,xt=ut;var ee=new Array(A.length);for(_=0;_{var f=Br(),y=jn(),z=Js(),P=5,n=.01;function i(c,s,h,m){var b=c._context.staticPlot,x=s.xaxis,_=s.yaxis;y.makeTraceGroups(m,h,"trace boxes").each(function(A){var d=f.select(this),k=A[0],w=k.t,D=k.trace;if(w.wdPos=w.bdPos*D.whiskerwidth,D.visible!==!0||w.empty){d.remove();return}var E,I;D.orientation==="h"?(E=_,I=x):(E=x,I=_),a(d,{pos:E,val:I},D,w,b),l(d,{x,y:_},D,w),o(d,{pos:E,val:I},D,w)})}function a(c,s,h,m,b){var x=h.orientation==="h",_=s.val,A=s.pos,d=!!A.rangebreaks,k=m.bPos,w=m.wdPos||0,D=m.bPosPxOffset||0,E=h.whiskerwidth||0,I=h.showwhiskers!==!1,M=h.notched||!1,p=M?1-2*h.notchwidth:1,g,C;Array.isArray(m.bdPos)?(g=m.bdPos[0],C=m.bdPos[1]):(g=m.bdPos,C=m.bdPos);var S=c.selectAll("path.box").data(h.type!=="violin"||h.box.visible?y.identity:[]);S.enter().append("path").style("vector-effect",b?"none":"non-scaling-stroke").attr("class","box"),S.exit().remove(),S.each(function(N){if(N.empty)return f.select(this).attr("d","M0,0Z");var B=A.c2l(N.pos+k,!0),U=A.l2p(B-g)+D,V=A.l2p(B+C)+D,W=d?(U+V)/2:A.l2p(B)+D,F=h.whiskerwidth,H=d?U*F+(1-F)*W:A.l2p(B-w)+D,q=d?V*F+(1-F)*W:A.l2p(B+w)+D,G=A.l2p(B-g*p)+D,tt=A.l2p(B+C*p)+D,ht=h.sizemode==="sd",bt=_.c2p(ht?N.mean-N.sd:N.q1,!0),vt=ht?_.c2p(N.mean+N.sd,!0):_.c2p(N.q3,!0),ut=y.constrain(ht?_.c2p(N.mean,!0):_.c2p(N.med,!0),Math.min(bt,vt)+1,Math.max(bt,vt)-1),rt=N.lf===void 0||h.boxpoints===!1||ht,gt=_.c2p(rt?N.min:N.lf,!0),it=_.c2p(rt?N.max:N.uf,!0),st=_.c2p(N.ln,!0),xt=_.c2p(N.un,!0);x?f.select(this).attr("d","M"+ut+","+G+"V"+tt+"M"+bt+","+U+"V"+V+(M?"H"+st+"L"+ut+","+tt+"L"+xt+","+V:"")+"H"+vt+"V"+U+(M?"H"+xt+"L"+ut+","+G+"L"+st+","+U:"")+"Z"+(I?"M"+bt+","+W+"H"+gt+"M"+vt+","+W+"H"+it+(E===0?"":"M"+gt+","+H+"V"+q+"M"+it+","+H+"V"+q):"")):f.select(this).attr("d","M"+G+","+ut+"H"+tt+"M"+U+","+bt+"H"+V+(M?"V"+st+"L"+tt+","+ut+"L"+V+","+xt:"")+"V"+vt+"H"+U+(M?"V"+xt+"L"+G+","+ut+"L"+U+","+st:"")+"Z"+(I?"M"+W+","+bt+"V"+gt+"M"+W+","+vt+"V"+it+(E===0?"":"M"+H+","+gt+"H"+q+"M"+H+","+it+"H"+q):""))})}function l(c,s,h,m){var b=s.x,x=s.y,_=m.bdPos,A=m.bPos,d=h.boxpoints||h.points;y.seedPseudoRandom();var k=function(E){return E.forEach(function(I){I.t=m,I.trace=h}),E},w=c.selectAll("g.points").data(d?k:[]);w.enter().append("g").attr("class","points"),w.exit().remove();var D=w.selectAll("path").data(function(E){var I,M=E.pts2,p=Math.max((E.max-E.min)/10,E.q3-E.q1),g=p*1e-9,C=p*n,S=[],N=0,B;if(h.jitter){if(p===0)for(N=1,S=new Array(M.length),I=0;IE.lo&&(q.so=!0)}return M});D.enter().append("path").classed("point",!0),D.exit().remove(),D.call(z.translatePoints,b,x)}function o(c,s,h,m){var b=s.val,x=s.pos,_=!!x.rangebreaks,A=m.bPos,d=m.bPosPxOffset||0,k=h.boxmean||(h.meanline||{}).visible,w,D;Array.isArray(m.bdPos)?(w=m.bdPos[0],D=m.bdPos[1]):(w=m.bdPos,D=m.bdPos);var E=c.selectAll("path.mean").data(h.type==="box"&&h.boxmean||h.type==="violin"&&h.box.visible&&h.meanline.visible?y.identity:[]);E.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),E.exit().remove(),E.each(function(I){var M=x.c2l(I.pos+A,!0),p=x.l2p(M-w)+d,g=x.l2p(M+D)+d,C=_?(p+g)/2:x.l2p(M)+d,S=b.c2p(I.mean,!0),N=b.c2p(I.mean-I.sd,!0),B=b.c2p(I.mean+I.sd,!0);h.orientation==="h"?f.select(this).attr("d","M"+S+","+p+"V"+g+(k==="sd"?"m0,0L"+N+","+C+"L"+S+","+p+"L"+B+","+C+"Z":"")):f.select(this).attr("d","M"+p+","+S+"H"+g+(k==="sd"?"m0,0L"+C+","+N+"L"+p+","+S+"L"+C+","+B+"Z":""))})}Y.exports={plot:i,plotBoxAndWhiskers:a,plotPoints:l,plotBoxMean:o}}),j8=It((et,Y)=>{var f=Br(),y=Hn(),z=Js();function P(i,a,l){var o=l||f.select(i).selectAll("g.trace.boxes");o.style("opacity",function(c){return c[0].trace.opacity}),o.each(function(c){var s=f.select(this),h=c[0].trace,m=h.line.width;function b(A,d,k,w){A.style("stroke-width",d+"px").call(y.stroke,k).call(y.fill,w)}var x=s.selectAll("path.box");if(h.type==="candlestick")x.each(function(A){if(!A.empty){var d=f.select(this),k=h[A.dir];b(d,k.line.width,k.line.color,k.fillcolor),d.style("opacity",h.selectedpoints&&!A.selected?.3:1)}});else{b(x,m,h.line.color,h.fillcolor),s.selectAll("path.mean").style({"stroke-width":m,"stroke-dasharray":2*m+"px,"+m+"px"}).call(y.stroke,h.line.color);var _=s.selectAll("path.point");z.pointStyle(_,h,i)}})}function n(i,a,l){var o=a[0].trace,c=l.selectAll("path.point");o.selectedpoints?z.selectedPointStyle(c,o):z.pointStyle(c,o,i)}Y.exports={style:P,styleOnSelect:n}}),qL=It((et,Y)=>{var f=Fs(),y=jn(),z=hd(),P=Hn(),n=y.fillText;function i(o,c,s,h){var m=o.cd,b=m[0].trace,x=b.hoveron,_=[],A;return x.indexOf("boxes")!==-1&&(_=_.concat(a(o,c,s,h))),x.indexOf("points")!==-1&&(A=l(o,c,s)),h==="closest"?A?[A]:_:(A&&_.push(A),_)}function a(o,c,s,h){var m=o.cd,b=o.xa,x=o.ya,_=m[0].trace,A=m[0].t,d=_.type==="violin",k,w,D,E,I,M,p,g,C,S,N,B=A.bdPos,U,V,W=A.wHover,F=function(Gt){return D.c2l(Gt.pos)+A.bPos-D.c2l(M)};d&&_.side!=="both"?(_.side==="positive"&&(C=function(Gt){var ee=F(Gt);return z.inbox(ee,ee+W,S)},U=B,V=0),_.side==="negative"&&(C=function(Gt){var ee=F(Gt);return z.inbox(ee-W,ee,S)},U=0,V=B)):(C=function(Gt){var ee=F(Gt);return z.inbox(ee-W,ee+W,S)},U=V=B);var H;d?H=function(Gt){return z.inbox(Gt.span[0]-I,Gt.span[1]-I,S)}:H=function(Gt){return z.inbox(Gt.min-I,Gt.max-I,S)},_.orientation==="h"?(I=c,M=s,p=H,g=C,k="y",D=x,w="x",E=b):(I=s,M=c,p=C,g=H,k="x",D=b,w="y",E=x);var q=Math.min(1,B/Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0])));S=o.maxHoverDistance-q,N=o.maxSpikeDistance-q;function G(Gt){return(p(Gt)+g(Gt))/2}var tt=z.getDistanceFunction(h,p,g,G);if(z.getClosest(m,tt,o),o.index===!1)return[];var ht=m[o.index],bt=_.line.color,vt=(_.marker||{}).color;P.opacity(bt)&&_.line.width?o.color=bt:P.opacity(vt)&&_.boxpoints?o.color=vt:o.color=_.fillcolor,o[k+"0"]=D.c2p(ht.pos+A.bPos-V,!0),o[k+"1"]=D.c2p(ht.pos+A.bPos+U,!0),o[k+"LabelVal"]=ht.orig_p!==void 0?ht.orig_p:ht.pos;var ut=k+"Spike";o.spikeDistance=G(ht)*N/S,o[ut]=D.c2p(ht.pos,!0);var rt=_.boxmean||_.sizemode==="sd"||(_.meanline||{}).visible,gt=_.boxpoints||_.points,it=gt&&rt?["max","uf","q3","med","mean","q1","lf","min"]:gt&&!rt?["max","uf","q3","med","q1","lf","min"]:!gt&&rt?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],st=E.range[1]{Y.exports=function(f,y){return y.hoverOnBox&&(f.hoverOnBox=y.hoverOnBox),"xVal"in y&&(f.x=y.xVal),"yVal"in y&&(f.y=y.yVal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f}}),GL=It((et,Y)=>{Y.exports=function(f,y){var z=f.cd,P=f.xaxis,n=f.yaxis,i=[],a,l;if(y===!1)for(a=0;a{Y.exports={attributes:K4(),layoutAttributes:Y4(),supplyDefaults:X4().supplyDefaults,crossTraceDefaults:X4().crossTraceDefaults,supplyLayoutDefaults:R8().supplyLayoutDefaults,calc:WL(),crossTraceCalc:F8().crossTraceCalc,plot:N8().plot,style:j8().style,styleOnSelect:j8().styleOnSelect,hoverPoints:qL().hoverPoints,eventData:Fq(),selectPoints:GL(),moduleType:"trace",name:"box",basePlotModule:Fd(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),jq=It((et,Y)=>{Y.exports=Nq()}),zw=It((et,Y)=>{var f=Ru(),{extendFlat:y}=Yn(),z=xa(),{axisHoverFormat:P}=Sh(),n=hi(),{hovertemplateAttrs:i,templatefallbackAttrs:a,texttemplateAttrs:l}=nu(),o=dd();Y.exports=y({z:{valType:"data_array",editType:"calc"},x:y({},o.x,{impliedEdits:{xtype:"array"}}),x0:y({},o.x0,{impliedEdits:{xtype:"scaled"}}),dx:y({},o.dx,{impliedEdits:{xtype:"scaled"}}),y:y({},o.y,{impliedEdits:{ytype:"array"}}),y0:y({},o.y0,{impliedEdits:{ytype:"scaled"}}),dy:y({},o.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:y({},o.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:y({},o.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:y({},o.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:y({},o.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:y({},o.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:y({},o.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:i(),hovertemplatefallback:a(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:a({editType:"plot"}),textfont:n({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:y({},z.showlegend,{dflt:!1}),zorder:o.zorder},f("",{cLetter:"z",autoColorDflt:!1}))}),U8=It((et,Y)=>{var f=Sr(),y=jn(),z=ls();Y.exports=function(i,a,l,o,c,s){var h=l("z");c=c||"x",s=s||"y";var m,b;if(h===void 0||!h.length)return 0;if(y.isArray1D(h)){m=l(c),b=l(s);var x=y.minRowLength(m),_=y.minRowLength(b);if(x===0||_===0)return 0;a._length=Math.min(x,_,h.length)}else{if(m=P(c,l),b=P(s,l),!n(h))return 0;l("transpose"),a._length=null}var A=z.getComponentMethod("calendars","handleTraceDefaults");return A(i,a,[c,s],o),!0};function P(i,a){var l=a(i),o=l?a(i+"type","array"):"scaled";return o==="scaled"&&(a(i+"0"),a("d"+i)),l}function n(i){for(var a=!0,l=!1,o=!1,c,s=0;s0&&(l=!0);for(var h=0;h{var f=jn();Y.exports=function(y,z){y("texttemplate"),y("texttemplatefallback");var P=f.extendFlat({},z.font,{color:"auto",size:"auto"});f.coerceFont(y,"textfont",P)}}),ZL=It((et,Y)=>{Y.exports=function(f,y,z){var P=z("zsmooth");P===!1&&(z("xgap"),z("ygap")),z("zhoverformat")}}),Uq=It((et,Y)=>{var f=jn(),y=U8(),z=J4(),P=S0(),n=ZL(),i=Cu(),a=zw();Y.exports=function(l,o,c,s){function h(b,x){return f.coerce(l,o,a,b,x)}var m=y(l,o,h,s);if(!m){o.visible=!1;return}P(l,o,s,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),z(h,s),n(l,o,h,s),h("hoverongaps"),h("connectgaps",f.isArray1D(o.z)&&o.zsmooth!==!1),i(l,o,s,h,{prefix:"",cLetter:"z"}),h("zorder")}}),KL=It((et,Y)=>{var f=Sr();Y.exports={count:function(y,z,P){return P[y]++,1},sum:function(y,z,P,n){var i=n[z];return f(i)?(i=Number(i),P[y]+=i,i):0},avg:function(y,z,P,n,i){var a=n[z];return f(a)&&(a=Number(a),P[y]+=a,i[y]++),0},min:function(y,z,P,n){var i=n[z];if(f(i))if(i=Number(i),f(P[y])){if(P[y]>i){var a=i-P[y];return P[y]=i,a}}else return P[y]=i,i;return 0},max:function(y,z,P,n){var i=n[z];if(f(i))if(i=Number(i),f(P[y])){if(P[y]{Y.exports={percent:function(f,y){for(var z=f.length,P=100/y,n=0;n{Y.exports=function(f,y){for(var z=f.length,P=0,n=0;n{var f=Dr(),y=f.ONEAVGYEAR,z=f.ONEAVGMONTH,P=f.ONEDAY,n=f.ONEHOUR,i=f.ONEMIN,a=f.ONESEC,l=Fs().tickIncrement;Y.exports=function(m,b,x,_,A){var d=-1.1*b,k=-.1*b,w=m-k,D=x[0],E=x[1],I=Math.min(o(D+k,D+w,_,A),o(E+k,E+w,_,A)),M=Math.min(o(D+d,D+k,_,A),o(E+d,E+k,_,A)),p,g;if(I>M&&MP){var C=p===y?1:6,S=p===y?"M12":"M1";return function(N,B){var U=_.c2d(N,y,A),V=U.indexOf("-",C);V>0&&(U=U.substr(0,V));var W=_.d2c(U,0,A);if(Wa?m>P?m>y*1.1?y:m>z*1.1?z:P:m>n?n:m>i?i:a:Math.pow(10,Math.floor(Math.log(m)/Math.LN10))}function s(m,b,x,_,A,d){if(_&&m>P){var k=h(b,A,d),w=h(x,A,d),D=m===y?0:1;return k[D]!==w[D]}return Math.floor(x/m)-Math.floor(b/m)>.1}function h(m,b,x){var _=b.c2d(m,y,x).split("-");return _[0]===""&&(_.unshift(),_[0]="-"+_[0]),_}}),QL=It((et,Y)=>{var f=Sr(),y=jn(),z=ls(),P=Fs(),{hasColorscale:n}=fp(),i=Cp(),a=Z4(),l=KL(),o=YL(),c=XL(),s=JL();function h(A,d){var k=[],w=[],D=d.orientation==="h",E=P.getFromId(A,D?d.yaxis:d.xaxis),I=D?"y":"x",M={x:"y",y:"x"}[I],p=d[I+"calendar"],g=d.cumulative,C,S=m(A,d,E,I),N=S[0],B=S[1],U=typeof N.size=="string",V=[],W=U?V:N,F=[],H=[],q=[],G=0,tt=d.histnorm,ht=d.histfunc,bt=tt.indexOf("density")!==-1,vt,ut,rt;g.enabled&&bt&&(tt=tt.replace(/ ?density$/,""),bt=!1);var gt=ht==="max"||ht==="min",it=gt?null:0,st=l.count,xt=o[tt],ot=!1,J=function(ie){return E.r2c(ie,0,p)},mt;for(y.isArrayOrTypedArray(d[M])&&ht!=="count"&&(mt=d[M],ot=ht==="avg",st=l[ht]),C=J(N.start),ut=J(N.end)+(C-P.tickIncrement(C,N.size,!1,p))/1e6;C=0&&rt=Mt;C--)if(w[C]){Ot=C;break}for(C=Mt;C<=Ot;C++)if(f(k[C])&&f(w[C])){var Lt={p:k[C],s:w[C],b:0};g.enabled||(Lt.pts=q[C],Bt?Lt.ph0=Lt.ph1=q[C].length?B[q[C][0]]:k[C]:(d._computePh=!0,Lt.ph0=ge(V[C]),Lt.ph1=ge(V[C+1],!0))),ue.push(Lt)}return ue.length===1&&(ue[0].width1=P.tickIncrement(ue[0].p,N.size,!1,p)-ue[0].p),n(d,"marker")&&i(A,d,{vals:d.marker.color,containerStr:"marker",cLetter:"c"}),n(d,"marker.line")&&i(A,d,{vals:d.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(ue,d),y.isArrayOrTypedArray(d.selectedpoints)&&y.tagSelected(ue,d,ee),ue}function m(A,d,k,w,D){var E=w+"bins",I=A._fullLayout,M=d["_"+w+"bingroup"],p=I._histogramBinOpts[M],g=I.barmode==="overlay",C,S,N,B,U,V,W,F=function(xe){return k.r2c(xe,0,B)},H=function(xe){return k.c2r(xe,0,B)},q=k.type==="date"?function(xe){return xe||xe===0?y.cleanDate(xe,null,B):null}:function(xe){return f(xe)?Number(xe):null};function G(xe,ge,ye){ge[xe+"Found"]?(ge[xe]=q(ge[xe]),ge[xe]===null&&(ge[xe]=ye[xe])):(V[xe]=ge[xe]=ye[xe],y.nestedProperty(S[0],E+"."+xe).set(ye[xe]))}if(d["_"+w+"autoBinFinished"])delete d["_"+w+"autoBinFinished"];else{S=p.traces;var tt=[],ht=!0,bt=!1,vt=!1;for(C=0;C"u"){if(D)return[rt,U,!0];rt=b(A,d,k,w,E)}W=N.cumulative||{},W.enabled&&W.currentbin!=="include"&&(W.direction==="decreasing"?rt.start=H(P.tickIncrement(F(rt.start),rt.size,!0,B)):rt.end=H(P.tickIncrement(F(rt.end),rt.size,!1,B))),p.size=rt.size,p.sizeFound||(V.size=rt.size,y.nestedProperty(S[0],E+".size").set(rt.size)),G("start",p,rt),G("end",p,rt)}U=d["_"+w+"pos0"],delete d["_"+w+"pos0"];var it=d._input[E]||{},st=y.extendFlat({},p),xt=p.start,ot=k.r2l(it.start),J=ot!==void 0;if((p.startFound||J)&&ot!==k.r2l(xt)){var mt=J?ot:y.aggNums(Math.min,null,U),dt={type:k.type==="category"||k.type==="multicategory"?"linear":k.type,r2l:k.r2l,dtick:p.size,tick0:xt,calendar:B,range:[mt,P.tickIncrement(mt,p.size,!1,B)].map(k.l2r)},Ct=P.tickFirst(dt);Ct>k.r2l(mt)&&(Ct=P.tickIncrement(Ct,p.size,!0,B)),st.start=k.l2r(Ct),J||y.nestedProperty(d,E+".start").set(st.start)}var Rt=p.end,Bt=k.r2l(it.end),Zt=Bt!==void 0;if((p.endFound||Zt)&&Bt!==k.r2l(Rt)){var Gt=Zt?Bt:y.aggNums(Math.max,null,U);st.end=k.l2r(Gt),Zt||y.nestedProperty(d,E+".start").set(st.end)}var ee="autobin"+w;return d._input[ee]===!1&&(d._input[E]=y.extendFlat({},d[E]||{}),delete d._input[ee],delete d[ee]),[st,U]}function b(A,d,k,w,D){var E=A._fullLayout,I=x(A,d),M=!1,p=1/0,g=[d],C,S,N;for(C=0;C=0;w--)M(w);else if(d==="increasing"){for(w=1;w=0;w--)A[w]+=A[w+1];k==="exclude"&&(A.push(0),A.shift())}}Y.exports={calc:h,calcAllAutoBins:m}}),$q=It((et,Y)=>{var f=jn(),y=Fs(),z=KL(),P=YL(),n=XL(),i=JL(),a=QL().calcAllAutoBins;Y.exports=function(s,h){var m=y.getFromId(s,h.xaxis),b=y.getFromId(s,h.yaxis),x=h.xcalendar,_=h.ycalendar,A=function(Oe){return m.r2c(Oe,0,x)},d=function(Oe){return b.r2c(Oe,0,_)},k=function(Oe){return m.c2r(Oe,0,x)},w=function(Oe){return b.c2r(Oe,0,_)},D,E,I,M,p=a(s,h,m,"x"),g=p[0],C=p[1],S=a(s,h,b,"y"),N=S[0],B=S[1],U=h._length;C.length>U&&C.splice(U,C.length-U),B.length>U&&B.splice(U,B.length-U);var V=[],W=[],F=[],H=typeof g.size=="string",q=typeof N.size=="string",G=[],tt=[],ht=H?G:g,bt=q?tt:N,vt=0,ut=[],rt=[],gt=h.histnorm,it=h.histfunc,st=gt.indexOf("density")!==-1,xt=it==="max"||it==="min",ot=xt?null:0,J=z.count,mt=P[gt],dt=!1,Ct=[],Rt=[],Bt="z"in h?h.z:"marker"in h&&Array.isArray(h.marker.color)?h.marker.color:"";Bt&&it!=="count"&&(dt=it==="avg",J=z[it]);var Zt=g.size,Gt=A(g.start),ee=A(g.end)+(Gt-y.tickIncrement(Gt,Zt,!1,x))/1e6;for(D=Gt;D=0&&I=0&&M{var f=jn(),y=Dr().BADNUM,z=Im();Y.exports=function(P,n,i,a,l,o){var c=P._length,s=n.makeCalcdata(P,a),h=i.makeCalcdata(P,l);s=z(P,n,a,s).vals,h=z(P,i,l,h).vals;var m=P.text,b=m!==void 0&&f.isArray1D(m),x=P.hovertext,_=x!==void 0&&f.isArray1D(x),A,d,k=f.distinctVals(s),w=k.vals,D=f.distinctVals(h),E=D.vals,I=[],M,p,g=E.length,C=w.length;for(A=0;A{var f=Sr(),y=jn(),z=Dr().BADNUM;Y.exports=function(P,n,i,a){var l,o,c,s,h,m;function b(w){if(f(w))return+w}if(n&&n.transpose){for(l=0,h=0;h{var f=jn(),y=.01,z=[[-1,0],[1,0],[0,-1],[0,1]];function P(i){return .5-.25*Math.min(1,i*.5)}Y.exports=function(i,a){var l=1,o;for(n(i,a),o=0;oy;o++)l=n(i,a,P(l));return l>y&&f.log("interp2d didn't converge quickly",l),i};function n(i,a,l){var o=0,c,s,h,m,b,x,_,A,d,k,w,D,E;for(m=0;mD&&(o=Math.max(o,Math.abs(i[s][h]-w)/(E-D))))}return o}}),W8=It((et,Y)=>{var f=jn().maxRowLength;Y.exports=function(y){var z=[],P={},n=[],i=y[0],a=[],l=[0,0,0],o=f(y),c,s,h,m,b,x,_,A;for(s=0;s=0;b--)m=n[b],s=m[0],h=m[1],x=((P[[s-1,h]]||l)[2]+(P[[s+1,h]]||l)[2]+(P[[s,h-1]]||l)[2]+(P[[s,h+1]]||l)[2])/20,x&&(_[m]=[s,h,x],n.splice(b,1),A=!0);if(!A)throw"findEmpties iterated with no new neighbors";for(m in _)P[m]=_[m],z.push(_[m])}return z.sort(function(d,k){return k[2]-d[2]})}}),tP=It((et,Y)=>{var f=ls(),y=jn().isArrayOrTypedArray;Y.exports=function(z,P,n,i,a,l){var o=[],c=f.traceIs(z,"contour"),s=f.traceIs(z,"histogram"),h,m,b,x=y(P)&&P.length>1;if(x&&!s&&l.type!=="category"){var _=P.length;if(_<=a){if(c)o=Array.from(P).slice(0,a);else if(a===1)l.type==="log"?o=[.5*P[0],2*P[0]]:o=[P[0]-.5,P[0]+.5];else if(l.type==="log"){for(o=[Math.pow(P[0],1.5)/Math.pow(P[1],.5)],b=1;b<_;b++)o.push(Math.sqrt(P[b-1]*P[b]));o.push(Math.pow(P[_-1],1.5)/Math.pow(P[_-2],.5))}else{for(o=[1.5*P[0]-.5*P[1]],b=1;b<_;b++)o.push((P[b-1]+P[b])*.5);o.push(1.5*P[_-1]-.5*P[_-2])}if(_{var f=ls(),y=jn(),z=Fs(),P=Im(),n=$q(),i=Cp(),a=$8(),l=H8(),o=V8(),c=W8(),s=tP(),h=Dr().BADNUM;Y.exports=function(x,_){var A=z.getFromId(x,_.xaxis||"x"),d=z.getFromId(x,_.yaxis||"y"),k=f.traceIs(_,"contour"),w=f.traceIs(_,"histogram"),D=k?"best":_.zsmooth,E,I,M,p,g,C,S,N,B,U,V;if(A._minDtick=0,d._minDtick=0,w)V=n(x,_),p=V.orig_x,E=V.x,I=V.x0,M=V.dx,N=V.orig_y,g=V.y,C=V.y0,S=V.dy,B=V.z;else{var W=_.z;y.isArray1D(W)?(a(_,A,d,"x","y",["z"]),E=_._x,g=_._y,W=_._z):(p=_.x?A.makeCalcdata(_,"x"):[],N=_.y?d.makeCalcdata(_,"y"):[],E=P(_,A,"x",p).vals,g=P(_,d,"y",N).vals,_._x=E,_._y=g),I=_.x0,M=_.dx,C=_.y0,S=_.dy,B=l(W,_,A,d)}(A.rangebreaks||d.rangebreaks)&&(B=b(E,g,B),w||(E=m(E),g=m(g),_._x=E,_._y=g)),!w&&(k||_.connectgaps)&&(_._emptypoints=c(B),o(B,_._emptypoints));function F(rt){D=_._input.zsmooth=_.zsmooth=!1,y.warn('cannot use zsmooth: "fast": '+rt)}function H(rt){if(rt.length>1){var gt=(rt[rt.length-1]-rt[0])/(rt.length-1),it=Math.abs(gt/100);for(U=0;Uit)return!1}return!0}_._islinear=!1,A.type==="log"||d.type==="log"?D==="fast"&&F("log axis found"):H(E)?H(g)?_._islinear=!0:D==="fast"&&F("y scale is not linear"):D==="fast"&&F("x scale is not linear");var q=y.maxRowLength(B),G=_.xtype==="scaled"?"":E,tt=s(_,G,I,M,q,A),ht=_.ytype==="scaled"?"":g,bt=s(_,ht,C,S,B.length,d);_._extremes[A._id]=z.findExtremes(A,tt),_._extremes[d._id]=z.findExtremes(d,bt);var vt={x:tt,y:bt,z:B,text:_._text||_.text,hovertext:_._hovertext||_.hovertext};if(_.xperiodalignment&&p&&(vt.orig_x=p),_.yperiodalignment&&N&&(vt.orig_y=N),G&&G.length===tt.length-1&&(vt.xCenter=G),ht&&ht.length===bt.length-1&&(vt.yCenter=ht),w&&(vt.xRanges=V.xRanges,vt.yRanges=V.yRanges,vt.pts=V.pts),k||i(x,_,{vals:B,cLetter:"z"}),k&&_.contours&&_.contours.coloring==="heatmap"){var ut={type:_.type==="contour"?"heatmap":"histogram2d",xcalendar:_.xcalendar,ycalendar:_.ycalendar};vt.xfill=s(ut,G,I,M,q,A),vt.yfill=s(ut,ht,C,S,B.length,d)}return[vt]};function m(x){for(var _=[],A=x.length,d=0;d{et.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],et.STYLE=et.CSS_DECLARATIONS.map(function(Y){return Y.join(": ")+"; "}).join("")}),eP=It((et,Y)=>{var f=G8(),y=Js(),z=jn(),P=null;function n(){if(P!==null)return P;P=!1;var i=z.isSafari()||z.isMacWKWebView()||z.isIOS();if(window.navigator.userAgent&&!i){var a=Array.from(f.CSS_DECLARATIONS).reverse(),l=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof l=="function")P=a.some(function(h){return l.apply(null,h)});else{var o=y.tester.append("image").attr("style",f.STYLE),c=window.getComputedStyle(o.node()),s=c.imageRendering;P=a.some(function(h){var m=h[1];return s===m||s===m.toLowerCase()}),o.remove()}}return P}Y.exports=n}),Z8=It((et,Y)=>{var f=Br(),y=Xi(),z=ls(),P=Js(),n=Fs(),i=jn(),a=uu(),l=tl(),o=Hn(),c=ch().extractOpts,s=ch().makeColorScaleFuncFromTrace,h=k0(),m=Rd(),b=m.LINE_SPACING,x=eP(),_=G8().STYLE,A="heatmap-label";function d(I){return I.selectAll("g."+A)}function k(I){d(I).remove()}Y.exports=function(I,M,p,g){var C=M.xaxis,S=M.yaxis;i.makeTraceGroups(g,p,"hm").each(function(N){var B=f.select(this),U=N[0],V=U.trace,W=V.xgap||0,F=V.ygap||0,H=U.z,q=U.x,G=U.y,tt=U.xCenter,ht=U.yCenter,bt=z.traceIs(V,"contour"),vt=bt?"best":V.zsmooth,ut=H.length,rt=i.maxRowLength(H),gt=!1,it=!1,st,xt,ot,J,mt,dt,Ct,Rt;for(dt=0;st===void 0&&dt0;)xt=C.c2p(q[dt]),dt--;for(xt0;)mt=S.c2p(G[dt]),dt--;mt=C._length||xt<=0||J>=S._length||mt<=0;if(xe){var ge=B.selectAll("image").data([]);ge.exit().remove(),k(B);return}var ye,ue;Bt==="fast"?(ye=rt,ue=ut):(ye=Gt,ue=ee);var Mt=document.createElement("canvas");Mt.width=ye,Mt.height=ue;var Ot=Mt.getContext("2d",{willReadFrequently:!0}),Lt=s(V,{noNumericCheck:!0,returnArray:!0}),ie,be;Bt==="fast"?(ie=gt?function(pi){return rt-1-pi}:i.identity,be=it?function(pi){return ut-1-pi}:i.identity):(ie=function(pi){return i.constrain(Math.round(C.c2p(q[pi])-st),0,Gt)},be=function(pi){return i.constrain(Math.round(S.c2p(G[pi])-J),0,ee)});var ce=be(0),Le=[ce,ce],Ze=gt?0:1,Qe=it?0:1,mr=0,fr=0,Jr=0,an=0,Er,dn,_n,Oe,Xt;function oe(pi,Va){if(pi!==void 0){var ea=Lt(pi);return ea[0]=Math.round(ea[0]),ea[1]=Math.round(ea[1]),ea[2]=Math.round(ea[2]),mr+=Va,fr+=ea[0]*Va,Jr+=ea[1]*Va,an+=ea[2]*Va,ea}return[0,0,0,0]}function zt(pi,Va,ea,go){var mo=pi[ea.bin0];if(mo===void 0)return oe(void 0,1);var Go=pi[ea.bin1],Po=Va[ea.bin0],Zo=Va[ea.bin1],Ka=Go-mo||0,Cs=Po-mo||0,ps;return Go===void 0?Zo===void 0?ps=0:Po===void 0?ps=2*(Zo-mo):ps=(2*Zo-Po-mo)*2/3:Zo===void 0?Po===void 0?ps=0:ps=(2*mo-Go-Po)*2/3:Po===void 0?ps=(2*Zo-Go-mo)*2/3:ps=Zo+mo-Go-Po,oe(mo+ea.frac*Ka+go.frac*(Cs+ea.frac*ps))}if(Bt!=="default"){var _t=0,Pt;try{Pt=new Uint8Array(ye*ue*4)}catch{Pt=new Array(ye*ue*4)}if(Bt==="smooth"){var Ht=tt||q,ae=ht||G,he=new Array(Ht.length),Me=new Array(ae.length),qe=new Array(Gt),Ye=tt?D:w,ur=ht?D:w,Rr,zr,xr;for(dt=0;dtFi||Fi>S._length))for(Ct=Zn;CtJi||Ji>C._length)){var ca=l({x:Zi,y:Li},V,I._fullLayout);ca.x=Zi,ca.y=Li;var Ei=U.z[dt][Ct];Ei===void 0?(ca.z="",ca.zLabel=""):(ca.z=Ei,ca.zLabel=n.tickText(Ke,Ei,"hover").text);var Ga=U.text&&U.text[dt]&&U.text[dt][Ct];(Ga===void 0||Ga===!1)&&(Ga=""),ca.text=Ga;var so=i.texttemplateString({data:[ca,V._meta],fallback:V.texttemplatefallback,labels:ca,locale:I._fullLayout._d3locale,template:ba});if(so){var Fe=so.split("
"),Re=Fe.length,Kr=0;for(Rt=0;Rt{Y.exports={min:"zmin",max:"zmax"}}),K8=It((et,Y)=>{var f=Br();Y.exports=function(y){f.select(y).selectAll(".hm image").style("opacity",function(z){return z.trace.opacity})}}),Y8=It((et,Y)=>{var f=hd(),y=jn(),z=y.isArrayOrTypedArray,P=Fs(),n=ch().extractOpts;Y.exports=function(i,a,l,o,c){c||(c={});var s=c.isContour,h=i.cd[0],m=h.trace,b=i.xa,x=i.ya,_=h.x,A=h.y,d=h.z,k=h.xCenter,w=h.yCenter,D=h.zmask,E=m.zhoverformat,I=_,M=A,p,g,C,S;if(i.index!==!1){try{C=Math.round(i.index[1]),S=Math.round(i.index[0])}catch{y.error("Error hovering on heatmap, pointNumber must be [row,col], found:",i.index);return}if(C<0||C>=d[0].length||S<0||S>d.length)return}else{if(f.inbox(a-_[0],a-_[_.length-1],0)>0||f.inbox(l-A[0],l-A[A.length-1],0)>0)return;if(s){var N;for(I=[2*_[0]-_[1]],N=1;N<_.length;N++)I.push((_[N]+_[N-1])/2);for(I.push([2*_[_.length-1]-_[_.length-2]]),M=[2*A[0]-A[1]],N=1;N{Y.exports={attributes:zw(),supplyDefaults:Uq(),calc:q8(),plot:Z8(),colorbar:z_(),style:K8(),hoverPoints:Y8(),moduleType:"trace",name:"heatmap",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),Vq=It((et,Y)=>{Y.exports=Hq()}),rP=It((et,Y)=>{Y.exports=function(f,y){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),Wq=It((et,Y)=>{Y.exports={eventDataKeys:["binNumber"]}}),X8=It((et,Y)=>{var f=Jv(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=hi(),a=rP(),l=Wq(),o=Yn().extendFlat;Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:y("x"),yhoverformat:y("y"),text:o({},f.text,{}),hovertext:o({},f.hovertext,{}),orientation:f.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:a("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:a("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:n(),texttemplate:P({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:n({editType:"plot"}),textposition:o({},f.textposition,{arrayOk:!1}),textfont:i({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:i({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:i({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:f.insidetextanchor,textangle:f.textangle,cliponaxis:f.cliponaxis,constraintext:f.constraintext,marker:f.marker,offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,selected:f.selected,unselected:f.unselected,zorder:f.zorder}}),qq=It((et,Y)=>{var f=ls(),y=jn(),z=Hn(),P=eg().handleText,n=O8(),i=X8();Y.exports=function(a,l,o,c){function s(M,p){return y.coerce(a,l,i,M,p)}var h=s("x"),m=s("y"),b=s("cumulative.enabled");b&&(s("cumulative.direction"),s("cumulative.currentbin")),s("text");var x=s("textposition");P(a,l,c,s,x,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("xhoverformat"),s("yhoverformat");var _=s("orientation",m&&!h?"h":"v"),A=_==="v"?"x":"y",d=_==="v"?"y":"x",k=h&&m?Math.min(y.minRowLength(h)&&y.minRowLength(m)):y.minRowLength(l[A]||[]);if(!k){l.visible=!1;return}l._length=k;var w=f.getComponentMethod("calendars","handleTraceDefaults");w(a,l,["x","y"],c);var D=l[d];D&&s("histfunc"),s("histnorm"),s("autobin"+A),n(a,l,s,o,c),y.coerceSelectionMarkerOpacity(l,s);var E=(l.marker.line||{}).color,I=f.getComponentMethod("errorbars","supplyDefaults");I(a,l,E||z.defaultLine,{axis:"y"}),I(a,l,E||z.defaultLine,{axis:"x",inherit:"y"}),s("zorder")}}),J8=It((et,Y)=>{var f=jn(),y=Ku(),z=ls().traceIs,P=Xv(),n=eg().validateCornerradius,i=f.nestedProperty,a=iy().getAxisGroup,l=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],o=["x","y"];Y.exports=function(c,s){var h=s._histogramBinOpts={},m=[],b={},x=[],_,A,d,k,w,D,E;function I(bt,vt){return f.coerce(_._input,_,_._module.attributes,bt,vt)}function M(bt){return bt.orientation==="v"?"x":"y"}function p(bt,vt){var ut=y.getFromTrace({_fullLayout:s},bt,vt);return ut.type}function g(bt,vt,ut){var rt=bt.uid+"__"+ut;vt||(vt=rt);var gt=p(bt,ut),it=bt[ut+"calendar"]||"",st=h[vt],xt=!0;st&&(gt===st.axType&&it===st.calendar?(xt=!1,st.traces.push(bt),st.dirs.push(ut)):(vt=rt,gt!==st.axType&&f.warn(["Attempted to group the bins of trace",bt.index,"set on a","type:"+gt,"axis","with bins on","type:"+st.axType,"axis."].join(" ")),it!==st.calendar&&f.warn(["Attempted to group the bins of trace",bt.index,"set with a",it,"calendar","with bins",st.calendar?"on a "+st.calendar+" calendar":"w/o a set calendar"].join(" ")))),xt&&(h[vt]={traces:[bt],dirs:[ut],axType:gt,calendar:bt[ut+"calendar"]||""}),bt["_"+ut+"bingroup"]=vt}for(w=0;w{var f=Iw().hoverPoints,y=Fs().hoverLabelText;Y.exports=function(z,P,n,i,a){var l=f(z,P,n,i,a);if(l){z=l[0];var o=z.cd[z.index],c=z.cd[0].trace;if(!c.cumulative.enabled){var s=c.orientation==="h"?"y":"x";z[s+"Label"]=y(z[s+"a"],[o.ph0,o.ph1],c[s+"hoverformat"])}return l}}}),nP=It((et,Y)=>{Y.exports=function(f,y,z,P,n){if(f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,"zLabelVal"in y&&(f.z=y.zLabelVal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),!(z.cumulative||{}).enabled){var i=Array.isArray(n)?P[0].pts[n[0]][n[1]]:P[n].pts;f.pointNumbers=i,f.binNumber=f.pointNumber,delete f.pointNumber,delete f.pointIndex;var a;if(z._indexToPoints){a=[];for(var l=0;l{Y.exports={attributes:X8(),layoutAttributes:z8(),supplyDefaults:qq(),crossTraceDefaults:J8(),supplyLayoutDefaults:VL(),calc:QL().calc,crossTraceCalc:Wr().crossTraceCalc,plot:yb().plot,layerName:"barlayer",style:Pg().style,styleOnSelect:Pg().styleOnSelect,colorbar:Do(),hoverPoints:Gq(),selectPoints:Dw(),eventData:nP(),moduleType:"trace",name:"histogram",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),Kq=It((et,Y)=>{Y.exports=Zq()}),Q8=It((et,Y)=>{var f=X8(),y=rP(),z=zw(),P=xa(),n=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:a,templatefallbackAttrs:l}=nu(),o=Ru(),c=Yn().extendFlat;Y.exports=c({x:f.x,y:f.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:f.histnorm,histfunc:f.histfunc,nbinsx:f.nbinsx,xbins:y("x"),nbinsy:f.nbinsy,ybins:y("y"),autobinx:f.autobinx,autobiny:f.autobiny,bingroup:c({},f.bingroup,{}),xbingroup:c({},f.bingroup,{}),ybingroup:c({},f.bingroup,{}),xgap:z.xgap,ygap:z.ygap,zsmooth:z.zsmooth,xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z",1),hovertemplate:i({},{keys:["z"]}),hovertemplatefallback:l(),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:l({editType:"plot"}),textfont:z.textfont,showlegend:c({},P.showlegend,{dflt:!1})},o("",{cLetter:"z",autoColorDflt:!1}))}),iP=It((et,Y)=>{var f=ls(),y=jn();Y.exports=function(z,P,n,i){var a=n("x"),l=n("y"),o=y.minRowLength(a),c=y.minRowLength(l);if(!o||!c){P.visible=!1;return}P._length=Math.min(o,c);var s=f.getComponentMethod("calendars","handleTraceDefaults");s(z,P,["x","y"],i);var h=n("z")||n("marker.color");h&&n("histfunc"),n("histnorm"),n("autobinx"),n("autobiny")}}),Yq=It((et,Y)=>{var f=jn(),y=iP(),z=ZL(),P=Cu(),n=J4(),i=Q8();Y.exports=function(a,l,o,c){function s(h,m){return f.coerce(a,l,i,h,m)}y(a,l,s,c),l.visible!==!1&&(z(a,l,s,c),P(a,l,c,s,{prefix:"",cLetter:"z"}),s("hovertemplate"),s("hovertemplatefallback"),n(s,c),s("xhoverformat"),s("yhoverformat"))}}),Xq=It((et,Y)=>{var f=Y8(),y=Fs().hoverLabelText;Y.exports=function(z,P,n,i,a){var l=f(z,P,n,i,a);if(l){z=l[0];var o=z.index,c=o[0],s=o[1],h=z.cd[0],m=h.trace,b=h.xRanges[s],x=h.yRanges[c];return z.xLabel=y(z.xa,[b[0],b[1]],m.xhoverformat),z.yLabel=y(z.ya,[x[0],x[1]],m.yhoverformat),l}}}),Jq=It((et,Y)=>{Y.exports={attributes:Q8(),supplyDefaults:Yq(),crossTraceDefaults:J8(),calc:q8(),plot:Z8(),layerName:"heatmaplayer",colorbar:z_(),style:K8(),hoverPoints:Xq(),eventData:nP(),moduleType:"trace",name:"histogram2d",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),Qq=It((et,Y)=>{Y.exports=Jq()}),tC=It((et,Y)=>{Y.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),Q4=It((et,Y)=>{var f=zw(),y=dd(),z=Sh(),P=z.axisHoverFormat,n=z.descriptionOnlyNumbers,i=Ru(),a=qf().dash,l=hi(),o=Yn().extendFlat,c=tC(),s=c.COMPARISON_OPS2,h=c.INTERVAL_OPS,m=y.line;Y.exports=o({z:f.z,x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,text:f.text,hovertext:f.hovertext,transpose:f.transpose,xtype:f.xtype,ytype:f.ytype,xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:f.hovertemplate,hovertemplatefallback:f.hovertemplatefallback,texttemplate:o({},f.texttemplate,{}),texttemplatefallback:f.texttemplatefallback,textfont:o({},f.textfont,{}),hoverongaps:f.hoverongaps,connectgaps:o({},f.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:l({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:n("contour label")},operation:{valType:"enumerated",values:[].concat(s).concat(h),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:o({},m.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:a,smoothing:o({},m.smoothing,{}),editType:"plot"},zorder:y.zorder},i("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),aP=It((et,Y)=>{var f=Q8(),y=Q4(),z=Ru(),P=Sh().axisHoverFormat,n=Yn().extendFlat;Y.exports=n({x:f.x,y:f.y,z:f.z,marker:f.marker,histnorm:f.histnorm,histfunc:f.histfunc,nbinsx:f.nbinsx,xbins:f.xbins,nbinsy:f.nbinsy,ybins:f.ybins,autobinx:f.autobinx,autobiny:f.autobiny,bingroup:f.bingroup,xbingroup:f.xbingroup,ybingroup:f.ybingroup,autocontour:y.autocontour,ncontours:y.ncontours,contours:y.contours,line:{color:y.line.color,width:n({},y.line.width,{dflt:.5}),dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:f.hovertemplate,hovertemplatefallback:f.hovertemplatefallback,texttemplate:y.texttemplate,texttemplatefallback:y.texttemplatefallback,textfont:y.textfont},z("",{cLetter:"z",editTypeOverride:"calc"}))}),eC=It((et,Y)=>{Y.exports=function(f,y,z,P){var n=P("contours.start"),i=P("contours.end"),a=n===!1||i===!1,l=z("contours.size"),o;a?o=y.autocontour=!0:o=z("autocontour",!1),(o||!l)&&z("ncontours")}}),oP=It((et,Y)=>{var f=jn();Y.exports=function(y,z,P,n){n||(n={});var i=y("contours.showlabels");if(i){var a=z.font;f.coerceFont(y,"contours.labelfont",a,{overrideDflt:{color:P}}),y("contours.labelformat")}n.hasHover!==!1&&y("zhoverformat")}}),rC=It((et,Y)=>{var f=Cu(),y=oP();Y.exports=function(z,P,n,i,a){var l=n("contours.coloring"),o,c="";l==="fill"&&(o=n("contours.showlines")),o!==!1&&(l!=="lines"&&(c=n("line.color","#000")),n("line.width",.5),n("line.dash")),l!=="none"&&(z.showlegend!==!0&&(P.showlegend=!1),P._dfltShowLegend=!1,f(z,P,i,n,{prefix:"",cLetter:"z"})),n("line.smoothing"),y(n,i,c,a)}}),tG=It((et,Y)=>{var f=jn(),y=iP(),z=eC(),P=rC(),n=J4(),i=aP();Y.exports=function(a,l,o,c){function s(m,b){return f.coerce(a,l,i,m,b)}function h(m){return f.coerce2(a,l,i,m)}y(a,l,s,c),l.visible!==!1&&(z(a,l,s,h),P(a,l,s,c),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),l.contours&&l.contours.coloring==="heatmap"&&n(s,c))}}),sP=It((et,Y)=>{var f=Fs(),y=jn();Y.exports=function(P,n){var i=P.contours;if(P.autocontour){var a=P.zmin,l=P.zmax;(P.zauto||a===void 0)&&(a=y.aggNums(Math.min,null,n)),(P.zauto||l===void 0)&&(l=y.aggNums(Math.max,null,n));var o=z(a,l,P.ncontours);i.size=o.dtick,i.start=f.tickFirst(o),o.range.reverse(),i.end=f.tickFirst(o),i.start===a&&(i.start+=i.size),i.end===l&&(i.end-=i.size),i.start>i.end&&(i.start=i.end=(i.start+i.end)/2),P._input.contours||(P._input.contours={}),y.extendFlat(P._input.contours,{start:i.start,end:i.end,size:i.size}),P._input.autocontour=!0}else if(i.type!=="constraint"){var c=i.start,s=i.end,h=P._input.contours;if(c>s&&(i.start=h.start=s,s=i.end=h.end=c,c=i.start),!(i.size>0)){var m;c===s?m=1:m=z(c,s,P.ncontours).dtick,h.size=i.size=m}}};function z(P,n,i){var a={type:"linear",range:[P,n]};return f.autoTicks(a,(n-P)/(i||15)),a}}),tk=It((et,Y)=>{Y.exports=function(f){return f.end+f.size/1e6}}),lP=It((et,Y)=>{var f=ch(),y=q8(),z=sP(),P=tk();Y.exports=function(n,i){var a=y(n,i),l=a[0].z;z(i,l);var o=i.contours,c=f.extractOpts(i),s;if(o.coloring==="heatmap"&&c.auto&&i.autocontour===!1){var h=o.start,m=P(o),b=o.size||1,x=Math.floor((m-h)/b)+1;isFinite(b)||(b=1,x=1);var _=h-b/2,A=_+x*b;s=[_,A]}else s=l;return f.calc(n,i,{vals:s,cLetter:"z"}),a}}),ek=It((et,Y)=>{Y.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}),cP=It((et,Y)=>{var f=ek();Y.exports=function(z){var P=z[0].z,n=P.length,i=P[0].length,a=n===2||i===2,l,o,c,s,h,m,b,x,_;for(o=0;oz?0:1)+(P[0][1]>z?0:2)+(P[1][1]>z?0:4)+(P[1][0]>z?0:8);if(n===5||n===10){var i=(P[0][0]+P[0][1]+P[1][0]+P[1][1])/4;return z>i?n===5?713:1114:n===5?104:208}return n===15?0:n}}),uP=It((et,Y)=>{var f=jn(),y=ek();Y.exports=function(l,o,c){var s,h,m,b,x;for(o=o||.01,c=c||.01,m=0;m20?(b=y.CHOOSESADDLE[b][(x[0]||x[1])<0?0:1],l.crossings[m]=y.SADDLEREMAINDER[b]):delete l.crossings[m],x=y.NEWDELTA[b],!x){f.log("Found bad marching index:",b,o,l.level);break}_.push(a(l,o,x)),o[0]+=x[0],o[1]+=x[1],m=o.join(","),z(_[_.length-1],_[_.length-2],s,h)&&_.pop();var E=x[0]&&(o[0]<0||o[0]>d-2)||x[1]&&(o[1]<0||o[1]>A-2),I=o[0]===k[0]&&o[1]===k[1]&&x[0]===w[0]&&x[1]===w[1];if(I||c&&E)break;b=l.crossings[m]}D===1e4&&f.log("Infinite loop in contour?");var M=z(_[0],_[_.length-1],s,h),p=0,g=.2*l.smoothing,C=[],S=0,N,B,U,V,W,F,H,q,G,tt,ht;for(D=1;D<_.length;D++)H=P(_[D],_[D-1]),p+=H,C.push(H);var bt=p/C.length*g;function vt(gt){return _[gt%_.length]}for(D=_.length-2;D>=S;D--)if(N=C[D],N=S&&N+C[B]q&&G--,l.edgepaths[G]=ht.concat(_,tt));break}rt||(l.edgepaths[q]=_.concat(tt))}for(q=0;q20&&o?l===208||l===1114?s=c[0]===0?1:-1:h=c[1]===0?1:-1:y.BOTTOMSTART.indexOf(l)!==-1?h=1:y.LEFTSTART.indexOf(l)!==-1?s=1:y.TOPSTART.indexOf(l)!==-1?h=-1:s=-1,[s,h]}function a(l,o,c){var s=o[0]+Math.max(c[0],0),h=o[1]+Math.max(c[1],0),m=l.z[h][s],b=l.xaxis,x=l.yaxis;if(c[1]){var _=(l.level-m)/(l.z[h][s+1]-m),A=(_!==1?(1-_)*b.c2l(l.x[s]):0)+(_!==0?_*b.c2l(l.x[s+1]):0);return[b.c2p(b.l2c(A),!0),x.c2p(l.y[h],!0),s+_,h]}else{var d=(l.level-m)/(l.z[h+1][s]-m),k=(d!==1?(1-d)*x.c2l(l.y[h]):0)+(d!==0?d*x.c2l(l.y[h+1]):0);return[b.c2p(l.x[s],!0),x.c2p(x.l2c(k),!0),s,h+d]}}}),eG=It((et,Y)=>{var f=tC(),y=Sr();Y.exports={"[]":P("[]"),"][":P("]["),">":n(">"),"<":n("<"),"=":n("=")};function z(i,a){var l=Array.isArray(a),o;function c(s){return y(s)?+s:null}return f.COMPARISON_OPS2.indexOf(i)!==-1?o=c(l?a[0]:a):f.INTERVAL_OPS.indexOf(i)!==-1?o=l?[c(a[0]),c(a[1])]:[c(a),c(a)]:f.SET_OPS.indexOf(i)!==-1&&(o=l?a.map(c):[c(a)]),o}function P(i){return function(a){a=z(i,a);var l=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);return{start:l,end:o,size:o-l}}}function n(i){return function(a){return a=z(i,a),{start:a,end:1/0,size:1/0}}}}),hP=It((et,Y)=>{var f=jn(),y=eG(),z=tk();Y.exports=function(P,n,i){for(var a=P.type==="constraint"?y[P._operation](P.value):P,l=a.size,o=[],c=z(a),s=i.trace._carpetTrace,h=s?{xaxis:s.aaxis,yaxis:s.baxis,x:i.a,y:i.b}:{xaxis:n.xaxis,yaxis:n.yaxis,x:i.x,y:i.y},m=a.start;m1e3){f.warn("Too many contours, clipping at 1000",P);break}return o}}),dP=It((et,Y)=>{var f=jn();Y.exports=function(z,P){var n,i,a,l=function(s){return s.reverse()},o=function(s){return s};switch(P){case"=":case"<":return z;case">":for(z.length!==1&&f.warn("Contour data invalid for the specified inequality operation."),i=z[0],n=0;n{Y.exports=function(f,y){var z=f[0],P=z.z,n;switch(y.type){case"levels":var i=Math.min(P[0][0],P[0][1]);for(n=0;na.level||a.starts.length&&i===a.level)}break;case"constraint":if(z.prefixBoundary=!1,z.edgepaths.length)return;var l=z.x.length,o=z.y.length,c=-1/0,s=1/0;for(n=0;n":h>c&&(z.prefixBoundary=!0);break;case"<":(hc||z.starts.length&&b===s)&&(z.prefixBoundary=!0);break;case"][":m=Math.min(h[0],h[1]),b=Math.max(h[0],h[1]),mc&&(z.prefixBoundary=!0);break}break}}}),nC=It(et=>{var Y=Br(),f=jn(),y=Js(),z=ch(),P=uu(),n=Fs(),i=G0(),a=Z8(),l=cP(),o=uP(),c=hP(),s=dP(),h=fP(),m=ek(),b=m.LABELOPTIMIZER;et.plot=function(E,I,M,p){var g=I.xaxis,C=I.yaxis;f.makeTraceGroups(p,M,"contour").each(function(S){var N=Y.select(this),B=S[0],U=B.trace,V=B.x,W=B.y,F=U.contours,H=c(F,I,B),q=f.ensureSingle(N,"g","heatmapcoloring"),G=[];F.coloring==="heatmap"&&(G=[S]),a(E,I,G,q),l(H),o(H);var tt=g.c2p(V[0],!0),ht=g.c2p(V[V.length-1],!0),bt=C.c2p(W[0],!0),vt=C.c2p(W[W.length-1],!0),ut=[[tt,vt],[ht,vt],[ht,bt],[tt,bt]],rt=H;F.type==="constraint"&&(rt=s(H,F._operation)),x(N,ut,F),_(N,rt,ut,F),d(N,H,E,B,F),w(N,I,E,B,ut)})};function x(E,I,M){var p=f.ensureSingle(E,"g","contourbg"),g=p.selectAll("path").data(M.coloring==="fill"?[0]:[]);g.enter().append("path"),g.exit().remove(),g.attr("d","M"+I.join("L")+"Z").style("stroke","none")}function _(E,I,M,p){var g=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",C="M"+M.join("L")+"Z";g&&h(I,p);var S=f.ensureSingle(E,"g","contourfill"),N=S.selectAll("path").data(g?I:[]);N.enter().append("path"),N.exit().remove(),N.each(function(B){var U=(B.prefixBoundary?C:"")+A(B,M);U?Y.select(this).attr("d",U).style("stroke","none"):Y.select(this).remove()})}function A(E,I){var M="",p=0,g=E.edgepaths.map(function(ht,bt){return bt}),C=!0,S,N,B,U,V,W;function F(ht){return Math.abs(ht[1]-I[0][1])<.01}function H(ht){return Math.abs(ht[1]-I[2][1])<.01}function q(ht){return Math.abs(ht[0]-I[0][0])<.01}function G(ht){return Math.abs(ht[0]-I[2][0])<.01}for(;g.length;){for(W=y.smoothopen(E.edgepaths[p],E.smoothing),M+=C?W:W.replace(/^M/,"L"),g.splice(g.indexOf(p),1),S=E.edgepaths[p][E.edgepaths[p].length-1],U=-1,B=0;B<4;B++){if(!S){f.log("Missing end?",p,E);break}for(F(S)&&!G(S)?N=I[1]:q(S)?N=I[0]:H(S)?N=I[3]:G(S)&&(N=I[2]),V=0;V=0&&(N=tt,U=V):Math.abs(S[1]-N[1])<.01?Math.abs(S[1]-tt[1])<.01&&(tt[0]-S[0])*(N[0]-tt[0])>=0&&(N=tt,U=V):f.log("endpt to newendpt is not vert. or horz.",S,N,tt)}if(S=N,U>=0)break;M+="L"+N}if(U===E.edgepaths.length){f.log("unclosed perimeter path");break}p=U,C=g.indexOf(p)===-1,C&&(p=g[0],M+="Z")}for(p=0;pb.MAXCOST*2)break;F&&(N/=2),S=U-N/2,B=S+N*1.5}if(W<=b.MAXCOST)return V};function k(E,I,M,p){var g=I.width/2,C=I.height/2,S=E.x,N=E.y,B=E.theta,U=Math.cos(B)*g,V=Math.sin(B)*g,W=(S>p.center?p.right-S:S-p.left)/(U+Math.abs(Math.sin(B)*C)),F=(N>p.middle?p.bottom-N:N-p.top)/(Math.abs(V)+Math.cos(B)*C);if(W<1||F<1)return 1/0;var H=b.EDGECOST*(1/(W-1)+1/(F-1));H+=b.ANGLECOST*B*B;for(var q=S-U,G=N-V,tt=S+U,ht=N+V,bt=0;bt{var f=Br(),y=ch(),z=tk();Y.exports=function(P){var n=P.contours,i=n.start,a=z(n),l=n.size||1,o=Math.floor((a-i)/l)+1,c=n.coloring==="lines"?0:1,s=y.extractOpts(P);isFinite(l)||(l=1,o=1);var h=s.reversescale?y.flipScale(s.colorscale):s.colorscale,m=h.length,b=new Array(m),x=new Array(m),_,A,d=s.min,k=s.max;if(n.coloring==="heatmap"){for(A=0;A=k)&&(i<=d&&(i=d),a>=k&&(a=k),o=Math.floor((a-i)/l)+1,c=0),A=0;Ad&&(b.unshift(d),x.unshift(x[0])),b[b.length-1]{var f=Br(),y=Js(),z=K8(),P=pP();Y.exports=function(n){var i=f.select(n).selectAll("g.contour");i.style("opacity",function(a){return a[0].trace.opacity}),i.each(function(a){var l=f.select(this),o=a[0].trace,c=o.contours,s=o.line,h=c.size||1,m=c.start,b=c.type==="constraint",x=!b&&c.coloring==="lines",_=!b&&c.coloring==="fill",A=x||_?P(o):null;l.selectAll("g.contourlevel").each(function(w){f.select(this).selectAll("path").call(y.lineGroupStyle,s.width,x?A(w.level):s.color,s.dash)});var d=c.labelfont;if(l.selectAll("g.contourlabels text").each(function(w){y.font(f.select(this),{weight:d.weight,style:d.style,variant:d.variant,textcase:d.textcase,lineposition:d.lineposition,shadow:d.shadow,family:d.family,size:d.size,color:d.color||(x?A(w.level):s.color)})}),b)l.selectAll("g.contourfill path").style("fill",o.fillcolor);else if(_){var k;l.selectAll("g.contourfill path").style("fill",function(w){return k===void 0&&(k=w.level),A(w.level+.5*h)}),k===void 0&&(k=m),l.selectAll("g.contourbg path").style("fill",A(k-.5*h))}}),z(n)}}),aC=It((et,Y)=>{var f=ch(),y=pP(),z=tk();function P(n,i,a){var l=i.contours,o=i.line,c=l.size||1,s=l.coloring,h=y(i,{isColorbar:!0});if(s==="heatmap"){var m=f.extractOpts(i);a._fillgradient=m.reversescale?f.flipScale(m.colorscale):m.colorscale,a._zrange=[m.min,m.max]}else s==="fill"&&(a._fillcolor=h);a._line={color:s==="lines"?h:o.color,width:l.showlines!==!1?o.width:0,dash:o.dash},a._levels={start:l.start,end:z(l),size:c}}Y.exports={min:"zmin",max:"zmax",calc:P}}),mP=It((et,Y)=>{var f=Hn(),y=Y8();Y.exports=function(z,P,n,i,a){a||(a={}),a.isContour=!0;var l=y(z,P,n,i,a);return l&&l.forEach(function(o){var c=o.trace;c.contours.type==="constraint"&&(c.fillcolor&&f.opacity(c.fillcolor)?o.color=f.addOpacity(c.fillcolor,1):c.contours.showlines&&f.opacity(c.line.color)&&(o.color=f.addOpacity(c.line.color,1)))}),l}}),rG=It((et,Y)=>{Y.exports={attributes:aP(),supplyDefaults:tG(),crossTraceDefaults:J8(),calc:lP(),plot:nC().plot,layerName:"contourlayer",style:iC(),colorbar:aC(),hoverPoints:mP(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),nG=It((et,Y)=>{Y.exports=rG()}),gP=It((et,Y)=>{var f=Sr(),y=oP(),z=Hn(),P=z.addOpacity,n=z.opacity,i=tC(),a=jn().isArrayOrTypedArray,l=i.CONSTRAINT_REDUCTION,o=i.COMPARISON_OPS2;Y.exports=function(s,h,m,b,x,_){var A=h.contours,d,k,w,D=m("contours.operation");if(A._operation=l[D],c(m,A),D==="="?d=A.showlines=!0:(d=m("contours.showlines"),w=m("fillcolor",P((s.line||{}).color||x,.5))),d){var E=w&&n(w)?P(h.fillcolor,1):x;k=m("line.color",E),m("line.width",2),m("line.dash")}m("line.smoothing"),y(m,b,k,_)};function c(s,h){var m;o.indexOf(h.operation)===-1?(s("contours.value",[0,1]),a(h.value)?h.value.length>2?h.value=h.value.slice(2):h.length===0?h.value=[0,1]:h.length<2?(m=parseFloat(h.value[0]),h.value=[m,m+1]):h.value=[parseFloat(h.value[0]),parseFloat(h.value[1])]:f(h.value)&&(m=parseFloat(h.value),h.value=[m,m+1])):(s("contours.value",0),f(h.value)||(a(h.value)?h.value=parseFloat(h.value[0]):h.value=0))}}),iG=It((et,Y)=>{var f=jn(),y=U8(),z=S0(),P=gP(),n=eC(),i=rC(),a=J4(),l=Q4();Y.exports=function(o,c,s,h){function m(A,d){return f.coerce(o,c,l,A,d)}function b(A){return f.coerce2(o,c,l,A)}var x=y(o,c,m,h);if(!x){c.visible=!1;return}z(o,c,h,m),m("xhoverformat"),m("yhoverformat"),m("text"),m("hovertext"),m("hoverongaps"),m("hovertemplate"),m("hovertemplatefallback");var _=m("contours.type")==="constraint";m("connectgaps",f.isArray1D(c.z)),_?P(o,c,m,h,s):(n(o,c,m,b),i(o,c,m,h)),c.contours&&c.contours.coloring==="heatmap"&&a(m,h),m("zorder")}}),aG=It((et,Y)=>{Y.exports={attributes:Q4(),supplyDefaults:iG(),calc:lP(),plot:nC().plot,style:iC(),colorbar:aC(),hoverPoints:mP(),moduleType:"trace",name:"contour",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),oG=It((et,Y)=>{Y.exports=aG()}),vP=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=dd(),i=xa(),a=Ru(),l=qf().dash,o=Yn().extendFlat,c=n.marker,s=n.line,h=c.line;Y.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},n.mode,{dflt:"markers"}),text:o({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},n.hovertext,{}),line:{color:s.color,width:s.width,dash:l,backoff:s.backoff,shape:o({},s.shape,{values:["linear","spline"]}),smoothing:s.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:o({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:P(),marker:o({symbol:c.symbol,opacity:c.opacity,angle:c.angle,angleref:c.angleref,standoff:c.standoff,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:o({width:h.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:o({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron,hovertemplate:f(),hovertemplatefallback:z()}}),sG=It((et,Y)=>{var f=jn(),y=Eg(),z=Fu(),P=Y0(),n=Lm(),i=oy(),a=pm(),l=Pm(),o=vP();Y.exports=function(c,s,h,m){function b(D,E){return f.coerce(c,s,o,D,E)}var x=b("a"),_=b("b"),A=b("c"),d;if(x?(d=x.length,_?(d=Math.min(d,_.length),A&&(d=Math.min(d,A.length))):A?d=Math.min(d,A.length):d=0):_&&A&&(d=Math.min(_.length,A.length)),!d){s.visible=!1;return}s._length=d,b("sum"),b("text"),b("hovertext"),s.hoveron!=="fills"&&(b("hovertemplate"),b("hovertemplatefallback"));var k=d{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot;return n.aLabel=f.tickText(i.aaxis,y.a,!0).text,n.bLabel=f.tickText(i.baxis,y.b,!0).text,n.cLabel=f.tickText(i.caxis,y.c,!0).text,n}}),cG=It((et,Y)=>{var f=Sr(),y=Dm(),z=ft(),P=$t(),n=_e().calcMarkerSize,i=["a","b","c"],a={a:["b","c"],b:["a","c"],c:["a","b"]};Y.exports=function(l,o){var c=l._fullLayout[o.subplot],s=c.sum,h=o.sum||s,m={a:o.a,b:o.b,c:o.c},b=o.ids,x,_,A,d,k,w;for(x=0;x{var f=fo();Y.exports=function(y,z,P){var n=z.plotContainer;n.select(".scatterlayer").selectAll("*").remove();for(var i=z.xaxis,a=z.yaxis,l={xaxis:i,yaxis:a,plot:n,layerClipId:z._hasClipOnAxisFalse?z.clipIdRelative:null},o=z.layers.frontplot.select("g.scatterlayer"),c=0;c{var f=Kf();Y.exports=function(y,z,P,n){var i=f(y,z,P,n);if(!i||i[0].index===!1)return;var a=i[0];if(a.index===void 0){var l=1-a.y0/y.ya._length,o=y.xa._length,c=o*l/2,s=o-c;return a.x0=Math.max(Math.min(a.x0,s),c),a.x1=Math.max(Math.min(a.x1,s),c),i}var h=a.cd[a.index],m=a.trace,b=a.subplot;a.a=h.a,a.b=h.b,a.c=h.c,a.xLabelVal=void 0,a.yLabelVal=void 0;var x={};x[m.subplot]={_subplot:b};var _=m._module.formatLabels(h,m,x);a.aLabel=_.aLabel,a.bLabel=_.bLabel,a.cLabel=_.cLabel;var A=h.hi||m.hoverinfo,d=[];function k(D,E){d.push(D._hovertitle+": "+E)}if(!m.hovertemplate){var w=A.split("+");w.indexOf("all")!==-1&&(w=["a","b","c"]),w.indexOf("a")!==-1&&k(b.aaxis,a.aLabel),w.indexOf("b")!==-1&&k(b.baxis,a.bLabel),w.indexOf("c")!==-1&&k(b.caxis,a.cLabel)}return a.extraText=d.join("
"),a.hovertemplate=m.hovertemplate,i}}),dG=It((et,Y)=>{Y.exports=function(f,y,z,P,n){if(y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),P[n]){var i=P[n];f.a=i.a,f.b=i.b,f.c=i.c}else f.a=y.a,f.b=y.b,f.c=y.c;return f}}),fG=It((et,Y)=>{var f=Br(),y=Xi(),z=ls(),P=jn(),n=P.strTranslate,i=P._,a=Hn(),l=Js(),o=G0(),c=Yn().extendFlat,s=lh(),h=Fs(),m=Up(),b=hd(),x=dm(),_=x.freeMode,A=x.rectMode,d=jp(),k=Md().prepSelect,w=Md().selectOnClick,D=Md().clearOutline,E=Md().clearSelectionsCache,I=fu();function M(H,q){this.id=H.id,this.graphDiv=H.graphDiv,this.init(q),this.makeFramework(q),this.updateFx(q),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}Y.exports=M;var p=M.prototype;p.init=function(H){this.container=H._ternarylayer,this.defs=H._defs,this.layoutId=H._uid,this.traceHash={},this.layers={}},p.plot=function(H,q){var G=this,tt=q[G.id],ht=q._size;G._hasClipOnAxisFalse=!1;for(var bt=0;btg*gt?(Ct=gt,dt=Ct*g):(dt=rt,Ct=dt/g),Rt=vt*dt/rt,Bt=ut*Ct/gt,J=q.l+q.w*ht-dt/2,mt=q.t+q.h*(1-bt)-Ct/2,G.x0=J,G.y0=mt,G.w=dt,G.h=Ct,G.sum=it,G.xaxis={type:"linear",range:[st+2*ot-it,it-st-2*xt],domain:[ht-Rt/2,ht+Rt/2],_id:"x"},o(G.xaxis,G.graphDiv._fullLayout),G.xaxis.setScale(),G.xaxis.isPtWithinRange=function(ie){return ie.a>=G.aaxis.range[0]&&ie.a<=G.aaxis.range[1]&&ie.b>=G.baxis.range[1]&&ie.b<=G.baxis.range[0]&&ie.c>=G.caxis.range[1]&&ie.c<=G.caxis.range[0]},G.yaxis={type:"linear",range:[st,it-xt-ot],domain:[bt-Bt/2,bt+Bt/2],_id:"y"},o(G.yaxis,G.graphDiv._fullLayout),G.yaxis.setScale(),G.yaxis.isPtWithinRange=function(){return!0};var Zt=G.yaxis.domain[0],Gt=G.aaxis=c({},H.aaxis,{range:[st,it-xt-ot],side:"left",tickangle:(+H.aaxis.tickangle||0)-30,domain:[Zt,Zt+Bt*g],anchor:"free",position:0,_id:"y",_length:dt});o(Gt,G.graphDiv._fullLayout),Gt.setScale();var ee=G.baxis=c({},H.baxis,{range:[it-st-ot,xt],side:"bottom",domain:G.xaxis.domain,anchor:"free",position:0,_id:"x",_length:dt});o(ee,G.graphDiv._fullLayout),ee.setScale();var xe=G.caxis=c({},H.caxis,{range:[it-st-xt,ot],side:"right",tickangle:(+H.caxis.tickangle||0)+30,domain:[Zt,Zt+Bt*g],anchor:"free",position:0,_id:"y",_length:dt});o(xe,G.graphDiv._fullLayout),xe.setScale();var ge="M"+J+","+(mt+Ct)+"h"+dt+"l-"+dt/2+",-"+Ct+"Z";G.clipDef.select("path").attr("d",ge),G.layers.plotbg.select("path").attr("d",ge);var ye="M0,"+Ct+"h"+dt+"l-"+dt/2+",-"+Ct+"Z";G.clipDefRelative.select("path").attr("d",ye);var ue=n(J,mt);G.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ue),G.clipDefRelative.select("path").attr("transform",null);var Mt=n(J-ee._offset,mt+Ct);G.layers.baxis.attr("transform",Mt),G.layers.bgrid.attr("transform",Mt);var Ot=n(J+dt/2,mt)+"rotate(30)"+n(0,-Gt._offset);G.layers.aaxis.attr("transform",Ot),G.layers.agrid.attr("transform",Ot);var Lt=n(J+dt/2,mt)+"rotate(-30)"+n(0,-xe._offset);G.layers.caxis.attr("transform",Lt),G.layers.cgrid.attr("transform",Lt),G.drawAxes(!0),G.layers.aline.select("path").attr("d",Gt.showline?"M"+J+","+(mt+Ct)+"l"+dt/2+",-"+Ct:"M0,0").call(a.stroke,Gt.linecolor||"#000").style("stroke-width",(Gt.linewidth||0)+"px"),G.layers.bline.select("path").attr("d",ee.showline?"M"+J+","+(mt+Ct)+"h"+dt:"M0,0").call(a.stroke,ee.linecolor||"#000").style("stroke-width",(ee.linewidth||0)+"px"),G.layers.cline.select("path").attr("d",xe.showline?"M"+(J+dt/2)+","+mt+"l"+dt/2+","+Ct:"M0,0").call(a.stroke,xe.linecolor||"#000").style("stroke-width",(xe.linewidth||0)+"px"),G.graphDiv._context.staticPlot||G.initInteractions(),l.setClipUrl(G.layers.frontplot,G._hasClipOnAxisFalse?null:G.clipId,G.graphDiv)},p.drawAxes=function(H){var q=this,G=q.graphDiv,tt=q.id.substr(7)+"title",ht=q.layers,bt=q.aaxis,vt=q.baxis,ut=q.caxis;if(q.drawAx(bt),q.drawAx(vt),q.drawAx(ut),H){var rt=Math.max(bt.showticklabels?bt.tickfont.size/2:0,(ut.showticklabels?ut.tickfont.size*.75:0)+(ut.ticks==="outside"?ut.ticklen*.87:0)),gt=(vt.showticklabels?vt.tickfont.size:0)+(vt.ticks==="outside"?vt.ticklen:0)+3;ht["a-title"]=d.draw(G,"a"+tt,{propContainer:bt,propName:q.id+".aaxis.title.text",placeholder:i(G,"Click to enter Component A title"),attributes:{x:q.x0+q.w/2,y:q.y0-bt.title.font.size/3-rt,"text-anchor":"middle"}}),ht["b-title"]=d.draw(G,"b"+tt,{propContainer:vt,propName:q.id+".baxis.title.text",placeholder:i(G,"Click to enter Component B title"),attributes:{x:q.x0-gt,y:q.y0+q.h+vt.title.font.size*.83+gt,"text-anchor":"middle"}}),ht["c-title"]=d.draw(G,"c"+tt,{propContainer:ut,propName:q.id+".caxis.title.text",placeholder:i(G,"Click to enter Component C title"),attributes:{x:q.x0+q.w+gt,y:q.y0+q.h+ut.title.font.size*.83+gt,"text-anchor":"middle"}})}},p.drawAx=function(H){var q=this,G=q.graphDiv,tt=H._name,ht=tt.charAt(0),bt=H._id,vt=q.layers[tt],ut=30,rt=ht+"tickLayout",gt=C(H);q[rt]!==gt&&(vt.selectAll("."+bt+"tick").remove(),q[rt]=gt),H.setScale();var it=h.calcTicks(H),st=h.clipEnds(H,it),xt=h.makeTransTickFn(H),ot=h.getTickSigns(H)[2],J=P.deg2rad(ut),mt=ot*(H.linewidth||1)/2,dt=ot*H.ticklen,Ct=q.w,Rt=q.h,Bt=ht==="b"?"M0,"+mt+"l"+Math.sin(J)*dt+","+Math.cos(J)*dt:"M"+mt+",0l"+Math.cos(J)*dt+","+-Math.sin(J)*dt,Zt={a:"M0,0l"+Rt+",-"+Ct/2,b:"M0,0l-"+Ct/2+",-"+Rt,c:"M0,0l-"+Rt+","+Ct/2}[ht];h.drawTicks(G,H,{vals:H.ticks==="inside"?st:it,layer:vt,path:Bt,transFn:xt,crisp:!1}),h.drawGrid(G,H,{vals:st,layer:q.layers[ht+"grid"],path:Zt,transFn:xt,crisp:!1}),h.drawLabels(G,H,{vals:it,layer:vt,transFn:xt,labelFns:h.makeLabelFns(H,0,ut)})};function C(H){return H.ticks+String(H.ticklen)+String(H.showticklabels)}var S=I.MINZOOM/2+.87,N="m-0.87,.5h"+S+"v3h-"+(S+5.2)+"l"+(S/2+2.6)+",-"+(S*.87+4.5)+"l2.6,1.5l-"+S/2+","+S*.87+"Z",B="m0.87,.5h-"+S+"v3h"+(S+5.2)+"l-"+(S/2+2.6)+",-"+(S*.87+4.5)+"l-2.6,1.5l"+S/2+","+S*.87+"Z",U="m0,1l"+S/2+","+S*.87+"l2.6,-1.5l-"+(S/2+2.6)+",-"+(S*.87+4.5)+"l-"+(S/2+2.6)+","+(S*.87+4.5)+"l2.6,1.5l"+S/2+",-"+S*.87+"Z",V="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",W=!0;p.clearOutline=function(){E(this.dragOptions),D(this.dragOptions.gd)},p.initInteractions=function(){var H=this,q=H.layers.plotbg.select("path").node(),G=H.graphDiv,tt=G._fullLayout._zoomlayer,ht,bt;this.dragOptions={element:q,gd:G,plotinfo:{id:H.id,domain:G._fullLayout[H.id].domain,xaxis:H.xaxis,yaxis:H.yaxis},subplot:H.id,prepFn:function(Mt,Ot,Lt){H.dragOptions.xaxes=[H.xaxis],H.dragOptions.yaxes=[H.yaxis],ht=G._fullLayout._invScaleX,bt=G._fullLayout._invScaleY;var ie=H.dragOptions.dragmode=G._fullLayout.dragmode;_(ie)?H.dragOptions.minDrag=1:H.dragOptions.minDrag=void 0,ie==="zoom"?(H.dragOptions.moveFn=ee,H.dragOptions.clickFn=Ct,H.dragOptions.doneFn=xe,Rt(Mt,Ot,Lt)):ie==="pan"?(H.dragOptions.moveFn=ye,H.dragOptions.clickFn=Ct,H.dragOptions.doneFn=ue,ge(),H.clearOutline(G)):(A(ie)||_(ie))&&k(Mt,Ot,Lt,H.dragOptions,ie)}};var vt,ut,rt,gt,it,st,xt,ot,J,mt;function dt(Mt){var Ot={};return Ot[H.id+".aaxis.min"]=Mt.a,Ot[H.id+".baxis.min"]=Mt.b,Ot[H.id+".caxis.min"]=Mt.c,Ot}function Ct(Mt,Ot){var Lt=G._fullLayout.clickmode;F(G),Mt===2&&(G.emit("plotly_doubleclick",null),z.call("_guiRelayout",G,dt({a:0,b:0,c:0}))),Lt.indexOf("select")>-1&&Mt===1&&w(Ot,G,[H.xaxis],[H.yaxis],H.id,H.dragOptions),Lt.indexOf("event")>-1&&b.click(G,Ot,H.id)}function Rt(Mt,Ot,Lt){var ie=q.getBoundingClientRect();vt=Ot-ie.left,ut=Lt-ie.top,G._fullLayout._calcInverseTransform(G);var be=G._fullLayout._invTransform,ce=P.apply3DTransform(be)(vt,ut);vt=ce[0],ut=ce[1],rt={a:H.aaxis.range[0],b:H.baxis.range[1],c:H.caxis.range[1]},it=rt,gt=H.aaxis.range[1]-rt.a,st=y(H.graphDiv._fullLayout[H.id].bgcolor).getLuminance(),xt="M0,"+H.h+"L"+H.w/2+", 0L"+H.w+","+H.h+"Z",ot=!1,J=tt.append("path").attr("class","zoombox").attr("transform",n(H.x0,H.y0)).style({fill:st>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",xt),mt=tt.append("path").attr("class","zoombox-corners").attr("transform",n(H.x0,H.y0)).style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),H.clearOutline(G)}function Bt(Mt,Ot){return 1-Ot/H.h}function Zt(Mt,Ot){return 1-(Mt+(H.h-Ot)/Math.sqrt(3))/H.w}function Gt(Mt,Ot){return(Mt-(H.h-Ot)/Math.sqrt(3))/H.w}function ee(Mt,Ot){var Lt=vt+Mt*ht,ie=ut+Ot*bt,be=Math.max(0,Math.min(1,Bt(vt,ut),Bt(Lt,ie))),ce=Math.max(0,Math.min(1,Zt(vt,ut),Zt(Lt,ie))),Le=Math.max(0,Math.min(1,Gt(vt,ut),Gt(Lt,ie))),Ze=(be/2+Le)*H.w,Qe=(1-be/2-ce)*H.w,mr=(Ze+Qe)/2,fr=Qe-Ze,Jr=(1-be)*H.h,an=Jr-fr/g;fr.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),mt.transition().style("opacity",1).duration(200),ot=!0),G.emit("plotly_relayouting",dt(it))}function xe(){F(G),it!==rt&&(z.call("_guiRelayout",G,dt(it)),W&&G.data&&G._context.showTips&&(P.notifier(i(G,"Double-click to zoom back out"),"long"),W=!1))}function ge(){rt={a:H.aaxis.range[0],b:H.baxis.range[1],c:H.caxis.range[1]},it=rt}function ye(Mt,Ot){var Lt=Mt/H.xaxis._m,ie=Ot/H.yaxis._m;it={a:rt.a-ie,b:rt.b+(Lt+ie)/2,c:rt.c-(Lt-ie)/2};var be=[it.a,it.b,it.c].sort(P.sorterAsc),ce={a:be.indexOf(it.a),b:be.indexOf(it.b),c:be.indexOf(it.c)};be[0]<0&&(be[1]+be[0]/2<0?(be[2]+=be[0]+be[1],be[0]=be[1]=0):(be[2]+=be[0]/2,be[1]+=be[0]/2,be[0]=0),it={a:be[ce.a],b:be[ce.b],c:be[ce.c]},Ot=(rt.a-it.a)*H.yaxis._m,Mt=(rt.c-it.c-rt.b+it.b)*H.xaxis._m);var Le=n(H.x0+Mt,H.y0+Ot);H.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Le);var Ze=n(-Mt,-Ot);H.clipDefRelative.select("path").attr("transform",Ze),H.aaxis.range=[it.a,H.sum-it.b-it.c],H.baxis.range=[H.sum-it.a-it.c,it.b],H.caxis.range=[H.sum-it.a-it.b,it.c],H.drawAxes(!1),H._hasClipOnAxisFalse&&H.plotContainer.select(".scatterlayer").selectAll(".trace").call(l.hideOutsideRangePoints,H),G.emit("plotly_relayouting",dt(it))}function ue(){z.call("_guiRelayout",G,dt(it))}q.onmousemove=function(Mt){b.hover(G,Mt,H.id),G._fullLayout._lasthover=q,G._fullLayout._hoversubplot=H.id},q.onmouseout=function(Mt){G._dragging||m.unhover(G,Mt)},m.init(this.dragOptions)};function F(H){f.select(H).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),yP=It((et,Y)=>{var f=Sn(),y=Jh().attributes,z=Gf(),P=sh().overrideAll,n=Yn().extendFlat,i={title:{text:z.title.text,font:z.title.font},color:z.color,tickmode:z.minor.tickmode,nticks:n({},z.nticks,{dflt:6,min:1}),tick0:z.tick0,dtick:z.dtick,tickvals:z.tickvals,ticktext:z.ticktext,ticks:z.ticks,ticklen:z.ticklen,tickwidth:z.tickwidth,tickcolor:z.tickcolor,ticklabelstep:z.ticklabelstep,showticklabels:z.showticklabels,labelalias:z.labelalias,showtickprefix:z.showtickprefix,tickprefix:z.tickprefix,showticksuffix:z.showticksuffix,ticksuffix:z.ticksuffix,showexponent:z.showexponent,exponentformat:z.exponentformat,minexponent:z.minexponent,separatethousands:z.separatethousands,tickfont:z.tickfont,tickangle:z.tickangle,tickformat:z.tickformat,tickformatstops:z.tickformatstops,hoverformat:z.hoverformat,showline:n({},z.showline,{dflt:!0}),linecolor:z.linecolor,linewidth:z.linewidth,showgrid:n({},z.showgrid,{dflt:!0}),gridcolor:z.gridcolor,gridwidth:z.gridwidth,griddash:z.griddash,layer:z.layer,min:{valType:"number",dflt:0,min:0}},a=Y.exports=P({domain:y({name:"ternary"}),bgcolor:{valType:"color",dflt:f.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i},"plot","from-root");a.uirevision={valType:"any",editType:"none"},a.aaxis.uirevision=a.baxis.uirevision=a.caxis.uirevision={valType:"any",editType:"none"}}),O_=It((et,Y)=>{var f=jn(),y=Tc(),z=Jh().defaults;Y.exports=function(P,n,i,a){var l=a.type,o=a.attributes,c=a.handleDefaults,s=a.partition||"x",h=n._subplots[l],m=h.length,b=m&&h[0].replace(/\d+$/,""),x,_;function A(D,E){return f.coerce(x,_,o,D,E)}for(var d=0;d{var f=Hn(),y=Tc(),z=jn(),P=O_(),n=q0(),i=Sg(),a=Uv(),l=jv(),o=pb(),c=yP(),s=["aaxis","baxis","caxis"];Y.exports=function(b,x,_){P(b,x,_,{type:"ternary",attributes:c,handleDefaults:h,font:x.font,paper_bgcolor:x.paper_bgcolor})};function h(b,x,_,A){var d=_("bgcolor"),k=_("sum");A.bgColor=f.combine(d,A.paper_bgcolor);for(var w,D,E,I=0;I=k&&(M.min=0,p.min=0,g.min=0,b.aaxis&&delete b.aaxis.min,b.baxis&&delete b.baxis.min,b.caxis&&delete b.caxis.min)}function m(b,x,_,A){var d=c[x._name];function k(C,S){return z.coerce(b,x,d,C,S)}k("uirevision",A.uirevision),x.type="linear";var w=k("color"),D=w!==d.color.dflt?w:_.font.color,E=x._name,I=E.charAt(0).toUpperCase(),M="Component "+I,p=k("title.text",M);x._hovertitle=p===M?p:I,z.coerceFont(k,"title.font",_.font,{overrideDflt:{size:z.bigFont(_.font.size),color:D}}),k("min"),l(b,x,k,"linear"),i(b,x,k,"linear"),n(b,x,k,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),a(b,x,k,{outerTicks:!0});var g=k("showticklabels");g&&(z.coerceFont(k,"tickfont",_.font,{overrideDflt:{color:D}}),k("tickangle"),k("tickformat")),o(b,x,k,{dfltColor:w,bgColor:_.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:d}),k("hoverformat"),k("layer")}}),mG=It(et=>{var Y=fG(),f=Mf().getSubplotCalcData,y=jn().counterRegex,z="ternary";et.name=z;var P=et.attr="subplot";et.idRoot=z,et.idRegex=et.attrRegex=y(z);var n=et.attributes={};n[P]={valType:"subplotid",dflt:"ternary",editType:"calc"},et.layoutAttributes=yP(),et.supplyLayoutDefaults=pG(),et.plot=function(i){for(var a=i._fullLayout,l=i.calcdata,o=a._subplots[z],c=0;c{Y.exports={attributes:vP(),supplyDefaults:sG(),colorbar:Do(),formatLabels:lG(),calc:cG(),plot:uG(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:hG(),selectPoints:Qd(),eventData:dG(),moduleType:"trace",name:"scatterternary",basePlotModule:mG(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),vG=It((et,Y)=>{Y.exports=gG()}),_P=It((et,Y)=>{var f=K4(),y=Yn().extendFlat,z=Sh().axisHoverFormat;Y.exports={y:f.y,x:f.x,x0:f.x0,y0:f.y0,xhoverformat:z("x"),yhoverformat:z("y"),name:y({},f.name,{}),orientation:y({},f.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:f.fillcolor,points:y({},f.boxpoints,{}),jitter:y({},f.jitter,{}),pointpos:y({},f.pointpos,{}),width:y({},f.width,{}),marker:f.marker,text:f.text,hovertext:f.hovertext,hovertemplate:f.hovertemplate,hovertemplatefallback:f.hovertemplatefallback,quartilemethod:f.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,selected:f.selected,unselected:f.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:f.zorder}}),xP=It((et,Y)=>{var f=Y4(),y=jn().extendFlat;Y.exports={violinmode:y({},f.boxmode,{}),violingap:y({},f.boxgap,{}),violingroupgap:y({},f.boxgroupgap,{})}}),yG=It((et,Y)=>{var f=jn(),y=Hn(),z=X4(),P=_P();Y.exports=function(n,i,a,l){function o(p,g){return f.coerce(n,i,P,p,g)}function c(p,g){return f.coerce2(n,i,P,p,g)}if(z.handleSampleDefaults(n,i,o,l),i.visible!==!1){o("bandwidth"),o("side");var s=o("width");s||(o("scalegroup",i.name),o("scalemode"));var h=o("span"),m;Array.isArray(h)&&(m="manual"),o("spanmode",m);var b=o("line.color",(n.marker||{}).color||a),x=o("line.width"),_=o("fillcolor",y.addOpacity(i.line.color,.5));z.handlePointsDefaults(n,i,o,{prefix:""});var A=c("box.width"),d=c("box.fillcolor",_),k=c("box.line.color",b),w=c("box.line.width",x),D=o("box.visible",!!(A||d||k||w));D||(i.box={visible:!1});var E=c("meanline.color",b),I=c("meanline.width",x),M=o("meanline.visible",!!(E||I));M||(i.meanline={visible:!1}),o("quartilemethod"),o("zorder")}}}),_G=It((et,Y)=>{var f=jn(),y=xP(),z=R8();Y.exports=function(P,n,i){function a(l,o){return f.coerce(P,n,y,l,o)}z._supply(P,n,i,a,"violin")}}),oC=It(et=>{var Y=jn(),f={gaussian:function(y){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*y*y)}};et.makeKDE=function(y,z,P){var n=P.length,i=f.gaussian,a=y.bandwidth,l=1/(n*a);return function(o){for(var c=0,s=0;s{var f=jn(),y=Fs(),z=WL(),P=oC(),n=Dr().BADNUM;Y.exports=function(o,c){var s=z(o,c);if(s[0].t.empty)return s;for(var h=o._fullLayout,m=y.getFromId(o,c[c.orientation==="h"?"xaxis":"yaxis"]),b=1/0,x=-1/0,_=0,A=0,d=0;d{var f=F8().setPositionOffset,y=["v","h"];Y.exports=function(z,P){for(var n=z.calcdata,i=P.xaxis,a=P.yaxis,l=0;l{var f=Br(),y=jn(),z=Js(),P=N8(),n=ia(),i=oC();Y.exports=function(a,l,o,c){var s=a._context.staticPlot,h=a._fullLayout,m=l.xaxis,b=l.yaxis;function x(_,A){var d=n(_,{xaxis:m,yaxis:b,trace:A,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return z.smoothopen(d[0],1)}y.makeTraceGroups(c,o,"trace violins").each(function(_){var A=f.select(this),d=_[0],k=d.t,w=d.trace;if(w.visible!==!0||k.empty){A.remove();return}var D=k.bPos,E=k.bdPos,I=l[k.valLetter+"axis"],M=l[k.posLetter+"axis"],p=w.side==="both",g=p||w.side==="positive",C=p||w.side==="negative",S=A.selectAll("path.violin").data(y.identity);S.enter().append("path").style("vector-effect",s?"none":"non-scaling-stroke").attr("class","violin"),S.exit().remove(),S.each(function(q){var G=f.select(this),tt=q.density,ht=tt.length,bt=M.c2l(q.pos+D,!0),vt=M.l2p(bt),ut;if(w.width)ut=k.maxKDE/E;else{var rt=h._violinScaleGroupStats[w.scalegroup];ut=w.scalemode==="count"?rt.maxKDE/E*(rt.maxCount/q.pts.length):rt.maxKDE/E}var gt,it,st,xt,ot,J,mt;if(g){for(J=new Array(ht),xt=0;xt{var f=Br(),y=Hn(),z=Il().stylePoints;Y.exports=function(P){var n=f.select(P).selectAll("g.trace.violins");n.style("opacity",function(i){return i[0].trace.opacity}),n.each(function(i){var a=i[0].trace,l=f.select(this),o=a.box||{},c=o.line||{},s=a.meanline||{},h=s.width;l.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(y.stroke,a.line.color).call(y.fill,a.fillcolor),l.selectAll("path.box").style("stroke-width",c.width+"px").call(y.stroke,c.color).call(y.fill,o.fillcolor);var m={"stroke-width":h+"px","stroke-dasharray":2*h+"px,"+h+"px"};l.selectAll("path.mean").style(m).call(y.stroke,s.color),l.selectAll("path.meanline").style(m).call(y.stroke,s.color),z(l,a,P)})}}),TG=It((et,Y)=>{var f=Hn(),y=jn(),z=Fs(),P=qL(),n=oC();Y.exports=function(i,a,l,o,c){c||(c={});var s=c.hoverLayer,h=i.cd,m=h[0].trace,b=m.hoveron,x=b.indexOf("violins")!==-1,_=b.indexOf("kde")!==-1,A=[],d,k;if(x||_){var w=P.hoverOnBoxes(i,a,l,o);if(_&&w.length>0){var D=i.xa,E=i.ya,I,M,p,g,C;m.orientation==="h"?(C=a,I="y",p=E,M="x",g=D):(C=l,I="x",p=D,M="y",g=E);var S=h[i.index];if(C>=S.span[0]&&C<=S.span[1]){var N=y.extendFlat({},i),B=g.c2p(C,!0),U=n.getKdeValue(S,m,C),V=n.getPositionOnKdePath(S,m,B),W=p._offset,F=p._length;N[I+"0"]=V[0],N[I+"1"]=V[1],N[M+"0"]=N[M+"1"]=B,N[M+"Label"]=M+": "+z.hoverLabelText(g,C,m[M+"hoverformat"])+", "+h[0].t.labels.kde+" "+U.toFixed(3);for(var H=0,q=0;q{Y.exports={attributes:_P(),layoutAttributes:xP(),supplyDefaults:yG(),crossTraceDefaults:X4().crossTraceDefaults,supplyLayoutDefaults:_G(),calc:xG(),crossTraceCalc:bG(),plot:wG(),style:kG(),styleOnSelect:Il().styleOnSelect,hoverPoints:TG(),selectPoints:GL(),moduleType:"trace",name:"violin",basePlotModule:Fd(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),CG=It((et,Y)=>{Y.exports=SG()}),AG=It((et,Y)=>{Y.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),bP=It((et,Y)=>{var f=Jv(),y=dd().line,z=xa(),P=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=AG(),o=Yn().extendFlat,c=Hn();Y.exports={x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:f.xperiod0,yperiod0:f.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:f.hovertext,hovertemplate:n({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),text:f.text,textposition:f.textposition,insidetextanchor:o({},f.insidetextanchor,{dflt:"middle"}),textangle:o({},f.textangle,{dflt:0}),textfont:f.textfont,insidetextfont:f.insidetextfont,outsidetextfont:f.outsidetextfont,constraintext:f.constraintext,cliponaxis:f.cliponaxis,orientation:o({},f.orientation,{}),offset:o({},f.offset,{arrayOk:!1}),width:o({},f.width,{arrayOk:!1}),marker:s(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:o({},y.color,{dflt:c.defaultLine}),width:o({},y.width,{dflt:0,editType:"plot"}),dash:y.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,zorder:f.zorder};function s(){var h=o({},f.marker);return delete h.pattern,delete h.cornerradius,h}}),wP=It((et,Y)=>{Y.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),kP=It((et,Y)=>{var f=jn(),y=Xv(),z=eg().handleText,P=Xg(),n=S0(),i=bP(),a=Hn();function l(s,h,m,b){function x(E,I){return f.coerce(s,h,i,E,I)}var _=P(s,h,b,x);if(!_){h.visible=!1;return}n(s,h,b,x),x("xhoverformat"),x("yhoverformat"),x("orientation",h.y&&!h.x?"v":"h"),x("offset"),x("width");var A=x("text");x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var d=x("textposition");z(s,h,b,x,d,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),h.textposition!=="none"&&!h.texttemplate&&x("textinfo",f.isArrayOrTypedArray(A)?"text+value":"value");var k=x("marker.color",m);x("marker.line.color",a.defaultLine),x("marker.line.width");var w=x("connector.visible");if(w){x("connector.fillcolor",o(k));var D=x("connector.line.width");D&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function o(s){var h=f.isArrayOrTypedArray(s)?"#000":s;return a.addOpacity(h,.5*a.opacity(h))}function c(s,h){var m,b;function x(A){return f.coerce(b._input,b,i,A)}for(var _=0;_{var f=jn(),y=wP();Y.exports=function(z,P,n){var i=!1;function a(c,s){return f.coerce(z,P,y,c,s)}for(var l=0;l{var f=jn();Y.exports=function(y,z){for(var P=0;P{var f=Fs(),y=Im(),z=EG(),P=$t(),n=Dr().BADNUM;Y.exports=function(a,l){var o=f.getFromId(a,l.xaxis||"x"),c=f.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A,d;l.orientation==="h"?(s=o.makeCalcdata(l,"x"),m=c.makeCalcdata(l,"y"),b=y(l,c,"y",m),x=!!l.yperiodalignment,_="y"):(s=c.makeCalcdata(l,"y"),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;var k=Math.min(h.length,s.length),w=new Array(k);for(l._base=[],A=0;A{var f=Wr().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,n=y._fullData,i=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],c=[],s=[],h,m;for(m=0;m{var f=Br(),y=jn(),z=Js(),P=Dr().BADNUM,n=yb(),i=C0().clearMinTextSize;Y.exports=function(c,s,h,m){var b=c._fullLayout;i("funnel",b),a(c,s,h,m),l(c,s,h,m),n.plot(c,s,h,m,{mode:b.funnelmode,norm:b.funnelmode,gap:b.funnelgap,groupgap:b.funnelgroupgap})};function a(c,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=f.select(this),d=_[0].trace,k=y.ensureSingle(A,"g","regions");if(!d.connector||!d.connector.visible){k.remove();return}var w=d.orientation==="h",D=k.selectAll("g.region").data(y.identity);D.enter().append("g").classed("region",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],S="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&g[2]!==P&&C[2]!==P&&g[3]!==P&&C[3]!==P&&(w?S+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2]+"H"+g[3]+"L"+g[1]+","+C[1]+"Z":S+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3]+"V"+C[2]+"L"+g[1]+","+C[0]+"Z"),S===""&&(S="M0,0Z"),y.ensureSingle(f.select(this),"path").attr("d",S).call(z.setClipUrl,s.layerClipId,c)}})})}function l(c,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=f.select(this),d=_[0].trace,k=y.ensureSingle(A,"g","lines");if(!d.connector||!d.connector.visible||!d.connector.line.width){k.remove();return}var w=d.orientation==="h",D=k.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],S="";g[3]!==void 0&&C[3]!==void 0&&(w?(S+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2],S+="M"+g[1]+","+C[1]+"L"+g[3]+","+C[2]):(S+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3],S+="M"+g[1]+","+C[0]+"L"+g[2]+","+C[2])),S===""&&(S="M0,0Z"),y.ensureSingle(f.select(this),"path").attr("d",S).call(z.setClipUrl,s.layerClipId,c)}})})}function o(c,s,h,m){var b=[],x=[],_=m?s:h,A=m?h:s;return b[0]=_.c2p(c.s0,!0),x[0]=A.c2p(c.p0,!0),b[1]=_.c2p(c.s1,!0),x[1]=A.c2p(c.p1,!0),b[2]=_.c2p(c.nextS0,!0),x[2]=A.c2p(c.nextP0,!0),b[3]=_.c2p(c.nextS1,!0),x[3]=A.c2p(c.nextP1,!0),m?[b,x]:[x,b]}}),DG=It((et,Y)=>{var f=Br(),y=Js(),z=Hn(),P=to().DESELECTDIM,n=Pg(),i=C0().resizeText,a=n.styleTextPoints;function l(o,c,s){var h=s||f.select(o).selectAll('g[class^="funnellayer"]').selectAll("g.trace");i(o,h,"funnel"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=f.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x.marker;f.select(this).call(z.fill,_.mc||A.color).call(z.stroke,_.mlc||A.line.color).call(y.dashLine,A.line.dash,_.mlw||A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".regions").each(function(){f.select(this).selectAll("path").style("stroke-width",0).call(z.fill,x.connector.fillcolor)}),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(f.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),zG=It((et,Y)=>{var f=Hn().opacity,y=Iw().hoverOnBars,z=jn().formatPercent;Y.exports=function(n,i,a,l,o){var c=y(n,i,a,l,o);if(c){var s=c.cd,h=s[0].trace,m=h.orientation==="h",b=c.index,x=s[b],_=m?"x":"y";c[_+"LabelVal"]=x.s,c.percentInitial=x.begR,c.percentInitialLabel=z(x.begR,1),c.percentPrevious=x.difR,c.percentPreviousLabel=z(x.difR,1),c.percentTotal=x.sumR,c.percentTotalLabel=z(x.sumR,1);var A=x.hi||h.hoverinfo,d=[];if(A&&A!=="none"&&A!=="skip"){var k=A==="all",w=A.split("+"),D=function(E){return k||w.indexOf(E)!==-1};D("percent initial")&&d.push(c.percentInitialLabel+" of initial"),D("percent previous")&&d.push(c.percentPreviousLabel+" of previous"),D("percent total")&&d.push(c.percentTotalLabel+" of total")}return c.extraText=d.join("
"),c.color=P(h,x),[c]}};function P(n,i){var a=n.marker,l=i.mc||a.color,o=i.mlc||a.line.color,c=i.mlw||a.line.width;if(f(l))return l;if(f(o)&&c)return o}}),OG=It((et,Y)=>{Y.exports=function(f,y){return f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,"percentInitial"in y&&(f.percentInitial=y.percentInitial),"percentPrevious"in y&&(f.percentPrevious=y.percentPrevious),"percentTotal"in y&&(f.percentTotal=y.percentTotal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f}}),BG=It((et,Y)=>{Y.exports={attributes:bP(),layoutAttributes:wP(),supplyDefaults:kP().supplyDefaults,crossTraceDefaults:kP().crossTraceDefaults,supplyLayoutDefaults:MG(),calc:LG(),crossTraceCalc:PG(),plot:IG(),style:DG().style,hoverPoints:zG(),eventData:OG(),selectPoints:Dw(),moduleType:"trace",name:"funnel",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),RG=It((et,Y)=>{Y.exports=BG()}),FG=It((et,Y)=>{Y.exports={eventDataKeys:["initial","delta","final"]}}),TP=It((et,Y)=>{var f=Jv(),y=dd().line,z=xa(),P=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=FG(),o=Yn().extendFlat,c=Hn();function s(h){return{marker:{color:o({},f.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},f.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},f.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}Y.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:f.x,x0:f.x0,dx:f.dx,y:f.y,y0:f.y0,dy:f.dy,xperiod:f.xperiod,yperiod:f.yperiod,xperiod0:f.xperiod0,yperiod0:f.yperiod0,xperiodalignment:f.xperiodalignment,yperiodalignment:f.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:f.hovertext,hovertemplate:n({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),texttemplatefallback:a({editType:"plot"}),text:f.text,textposition:f.textposition,insidetextanchor:f.insidetextanchor,textangle:f.textangle,textfont:f.textfont,insidetextfont:f.insidetextfont,outsidetextfont:f.outsidetextfont,constraintext:f.constraintext,cliponaxis:f.cliponaxis,orientation:f.orientation,offset:f.offset,width:f.width,increasing:s(),decreasing:s(),totals:s(),connector:{line:{color:o({},y.color,{dflt:c.defaultLine}),width:o({},y.width,{editType:"plot"}),dash:y.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:f.offsetgroup,alignmentgroup:f.alignmentgroup,zorder:f.zorder}}),SP=It((et,Y)=>{Y.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),Ow=It((et,Y)=>{Y.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),CP=It((et,Y)=>{var f=jn(),y=Xv(),z=eg().handleText,P=Xg(),n=S0(),i=TP(),a=Hn(),l=Ow(),o=l.INCREASING.COLOR,c=l.DECREASING.COLOR,s="#4499FF";function h(x,_,A){x(_+".marker.color",A),x(_+".marker.line.color",a.defaultLine),x(_+".marker.line.width")}function m(x,_,A,d){function k(M,p){return f.coerce(x,_,i,M,p)}var w=P(x,_,d,k);if(!w){_.visible=!1;return}n(x,_,d,k),k("xhoverformat"),k("yhoverformat"),k("measure"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");z(x,_,d,k,D,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),_.textposition!=="none"&&(k("texttemplate"),k("texttemplatefallback"),_.texttemplate||k("textinfo")),h(k,"increasing",o),h(k,"decreasing",c),h(k,"totals",s);var E=k("connector.visible");if(E){k("connector.mode");var I=k("connector.line.width");I&&(k("connector.line.color"),k("connector.line.dash"))}k("zorder")}function b(x,_){var A,d;function k(D){return f.coerce(d._input,d,i,D)}if(_.waterfallmode==="group")for(var w=0;w{var f=jn(),y=SP();Y.exports=function(z,P,n){var i=!1;function a(c,s){return f.coerce(z,P,y,c,s)}for(var l=0;l{var f=Fs(),y=Im(),z=jn().mergeArray,P=$t(),n=Dr().BADNUM;function i(l){return l==="a"||l==="absolute"}function a(l){return l==="t"||l==="total"}Y.exports=function(l,o){var c=f.getFromId(l,o.xaxis||"x"),s=f.getFromId(l,o.yaxis||"y"),h,m,b,x,_,A;o.orientation==="h"?(h=c.makeCalcdata(o,"x"),b=s.makeCalcdata(o,"y"),x=y(o,s,"y",b),_=!!o.yperiodalignment,A="y"):(h=s.makeCalcdata(o,"y"),b=c.makeCalcdata(o,"x"),x=y(o,c,"x",b),_=!!o.xperiodalignment,A="x"),m=x.vals;for(var d=Math.min(m.length,h.length),k=new Array(d),w=0,D,E=!1,I=0;I{var f=Wr().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,n=y._fullData,i=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],c=[],s=[],h,m;for(m=0;m{var f=Br(),y=jn(),z=Js(),P=Dr().BADNUM,n=yb(),i=C0().clearMinTextSize;Y.exports=function(o,c,s,h){var m=o._fullLayout;i("waterfall",m),n.plot(o,c,s,h,{mode:m.waterfallmode,norm:m.waterfallmode,gap:m.waterfallgap,groupgap:m.waterfallgroupgap}),a(o,c,s,h)};function a(o,c,s,h){var m=c.xaxis,b=c.yaxis;y.makeTraceGroups(h,s,"trace bars").each(function(x){var _=f.select(this),A=x[0].trace,d=y.ensureSingle(_,"g","lines");if(!A.connector||!A.connector.visible){d.remove();return}var k=A.orientation==="h",w=A.connector.mode,D=d.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=l(I,m,b,k),g=p[0],C=p[1],S="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&(w==="spanning"&&!I.isSum&&M>0&&(k?S+="M"+g[0]+","+C[1]+"V"+C[0]:S+="M"+g[1]+","+C[0]+"H"+g[0]),w!=="between"&&(I.isSum||M{var f=Br(),y=Js(),z=Hn(),P=to().DESELECTDIM,n=Pg(),i=C0().resizeText,a=n.styleTextPoints;function l(o,c,s){var h=s||f.select(o).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");i(o,h,"waterfall"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=f.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x[_.dir].marker;f.select(this).call(z.fill,A.color).call(z.stroke,A.line.color).call(y.dashLine,A.line.dash,A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(f.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),VG=It((et,Y)=>{var f=Fs().hoverLabelText,y=Hn().opacity,z=Iw().hoverOnBars,P=Ow(),n={increasing:P.INCREASING.SYMBOL,decreasing:P.DECREASING.SYMBOL};Y.exports=function(a,l,o,c,s){var h=z(a,l,o,c,s);if(!h)return;var m=h.cd,b=m[0].trace,x=b.orientation==="h",_=x?"x":"y",A=x?a.xa:a.ya;function d(S){return f(A,S,b[_+"hoverformat"])}var k=h.index,w=m[k],D=w.isSum?w.b+w.s:w.rawS;h.initial=w.b+w.s-D,h.delta=D,h.final=h.initial+h.delta;var E=d(Math.abs(h.delta));h.deltaLabel=D<0?"("+E+")":E,h.finalLabel=d(h.final),h.initialLabel=d(h.initial);var I=w.hi||b.hoverinfo,M=[];if(I&&I!=="none"&&I!=="skip"){var p=I==="all",g=I.split("+"),C=function(S){return p||g.indexOf(S)!==-1};w.isSum||(C("final")&&(x?!C("x"):!C("y"))&&M.push(h.finalLabel),C("delta")&&(D<0?M.push(h.deltaLabel+" "+n.decreasing):M.push(h.deltaLabel+" "+n.increasing)),C("initial")&&M.push("Initial: "+h.initialLabel))}return M.length&&(h.extraText=M.join("
")),h.color=i(b,w),[h]};function i(a,l){var o=a[l.dir].marker,c=o.color,s=o.line.color,h=o.line.width;if(y(c))return c;if(y(s)&&h)return s}}),WG=It((et,Y)=>{Y.exports=function(f,y){return f.x="xVal"in y?y.xVal:y.x,f.y="yVal"in y?y.yVal:y.y,"initial"in y&&(f.initial=y.initial),"delta"in y&&(f.delta=y.delta),"final"in y&&(f.final=y.final),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f}}),qG=It((et,Y)=>{Y.exports={attributes:TP(),layoutAttributes:SP(),supplyDefaults:CP().supplyDefaults,crossTraceDefaults:CP().crossTraceDefaults,supplyLayoutDefaults:NG(),calc:jG(),crossTraceCalc:UG(),plot:$G(),style:HG().style,hoverPoints:VG(),eventData:WG(),selectPoints:Dw(),moduleType:"trace",name:"waterfall",basePlotModule:Fd(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),GG=It((et,Y)=>{Y.exports=qG()}),Bw=It((et,Y)=>{Y.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(f){return f.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(f){return f.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(f){return f.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(f){var y=f.slice(0,3);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(f){var y=f.slice(0,4);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%",""]}}}}),AP=It((et,Y)=>{var f=xa(),y=dd().zorder,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Yn().extendFlat,i=Bw().colormodel,a=["rgb","rgba","rgba256","hsl","hsla"],l=[],o=[];for(s=0;s{var f=jn(),y=AP(),z=Bw(),P=K0().IMAGE_URL_PREFIX;Y.exports=function(n,i){function a(c,s){return f.coerce(n,i,y,c,s)}a("source"),i.source&&!i.source.match(P)&&delete i.source,i._hasSource=!!i.source;var l=a("z");if(i._hasZ=!(l===void 0||!l.length||!l[0]||!l[0].length),!i._hasZ&&!i._hasSource){i.visible=!1;return}a("x0"),a("y0"),a("dx"),a("dy");var o;i._hasZ?(a("colormodel","rgb"),o=z.colormodel[i.colormodel],a("zmin",o.zminDflt||o.min),a("zmax",o.zmaxDflt||o.max)):i._hasSource&&(i.colormodel="rgba256",o=z.colormodel[i.colormodel],i.zmin=o.zminDflt,i.zmax=o.zmaxDflt),a("zsmooth"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),i._length=null,a("zorder")}}),sy=It((et,Y)=>{typeof Object.create=="function"?Y.exports=function(f,y){y&&(f.super_=y,f.prototype=Object.create(y.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}))}:Y.exports=function(f,y){if(y){f.super_=y;var z=function(){};z.prototype=y.prototype,f.prototype=new z,f.prototype.constructor=f}}}),MP=It((et,Y)=>{Y.exports=Wg().EventEmitter}),KG=It(et=>{et.byteLength=a,et.toByteArray=o,et.fromByteArray=h;var Y=[],f=[],y=typeof Uint8Array<"u"?Uint8Array:Array,z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(P=0,n=z.length;P0)throw new Error("Invalid string. Length must be a multiple of 4");var x=m.indexOf("=");x===-1&&(x=b);var _=x===b?0:4-x%4;return[x,_]}function a(m){var b=i(m),x=b[0],_=b[1];return(x+_)*3/4-_}function l(m,b,x){return(b+x)*3/4-x}function o(m){var b,x=i(m),_=x[0],A=x[1],d=new y(l(m,_,A)),k=0,w=A>0?_-4:_,D;for(D=0;D>16&255,d[k++]=b>>8&255,d[k++]=b&255;return A===2&&(b=f[m.charCodeAt(D)]<<2|f[m.charCodeAt(D+1)]>>4,d[k++]=b&255),A===1&&(b=f[m.charCodeAt(D)]<<10|f[m.charCodeAt(D+1)]<<4|f[m.charCodeAt(D+2)]>>2,d[k++]=b>>8&255,d[k++]=b&255),d}function c(m){return Y[m>>18&63]+Y[m>>12&63]+Y[m>>6&63]+Y[m&63]}function s(m,b,x){for(var _,A=[],d=b;dw?w:k+d));return _===1?(b=m[x-1],A.push(Y[b>>2]+Y[b<<4&63]+"==")):_===2&&(b=(m[x-2]<<8)+m[x-1],A.push(Y[b>>10]+Y[b>>4&63]+Y[b<<2&63]+"=")),A.join("")}}),YG=It(et=>{et.read=function(Y,f,y,z,P){var n,i,a=P*8-z-1,l=(1<>1,c=-7,s=y?P-1:0,h=y?-1:1,m=Y[f+s];for(s+=h,n=m&(1<<-c)-1,m>>=-c,c+=a;c>0;n=n*256+Y[f+s],s+=h,c-=8);for(i=n&(1<<-c)-1,n>>=-c,c+=z;c>0;i=i*256+Y[f+s],s+=h,c-=8);if(n===0)n=1-o;else{if(n===l)return i?NaN:(m?-1:1)*(1/0);i=i+Math.pow(2,z),n=n-o}return(m?-1:1)*i*Math.pow(2,n-z)},et.write=function(Y,f,y,z,P,n){var i,a,l,o=n*8-P-1,c=(1<>1,h=P===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=z?0:n-1,b=z?1:-1,x=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(a=isNaN(f)?1:0,i=c):(i=Math.floor(Math.log(f)/Math.LN2),f*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+s>=1?f+=h/l:f+=h*Math.pow(2,1-s),f*l>=2&&(i++,l/=2),i+s>=c?(a=0,i=c):i+s>=1?(a=(f*l-1)*Math.pow(2,P),i=i+s):(a=f*Math.pow(2,s-1)*Math.pow(2,P),i=0));P>=8;Y[y+m]=a&255,m+=b,a/=256,P-=8);for(i=i<0;Y[y+m]=i&255,m+=b,i/=256,o-=8);Y[y+m-b]|=x*128}}),_b=It(et=>{var Y=KG(),f=YG(),y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;et.Buffer=i,et.SlowBuffer=A,et.INSPECT_MAX_BYTES=50;var z=2147483647;et.kMaxLength=z,i.TYPED_ARRAY_SUPPORT=P(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function P(){try{let Mt=new Uint8Array(1),Ot={foo:function(){return 42}};return Object.setPrototypeOf(Ot,Uint8Array.prototype),Object.setPrototypeOf(Mt,Ot),Mt.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function n(Mt){if(Mt>z)throw new RangeError('The value "'+Mt+'" is invalid for option "size"');let Ot=new Uint8Array(Mt);return Object.setPrototypeOf(Ot,i.prototype),Ot}function i(Mt,Ot,Lt){if(typeof Mt=="number"){if(typeof Ot=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(Mt)}return a(Mt,Ot,Lt)}i.poolSize=8192;function a(Mt,Ot,Lt){if(typeof Mt=="string")return s(Mt,Ot);if(ArrayBuffer.isView(Mt))return m(Mt);if(Mt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Mt);if(ee(Mt,ArrayBuffer)||Mt&&ee(Mt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ee(Mt,SharedArrayBuffer)||Mt&&ee(Mt.buffer,SharedArrayBuffer)))return b(Mt,Ot,Lt);if(typeof Mt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ie=Mt.valueOf&&Mt.valueOf();if(ie!=null&&ie!==Mt)return i.from(ie,Ot,Lt);let be=x(Mt);if(be)return be;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Mt[Symbol.toPrimitive]=="function")return i.from(Mt[Symbol.toPrimitive]("string"),Ot,Lt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Mt)}i.from=function(Mt,Ot,Lt){return a(Mt,Ot,Lt)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(Mt){if(typeof Mt!="number")throw new TypeError('"size" argument must be of type number');if(Mt<0)throw new RangeError('The value "'+Mt+'" is invalid for option "size"')}function o(Mt,Ot,Lt){return l(Mt),Mt<=0?n(Mt):Ot!==void 0?typeof Lt=="string"?n(Mt).fill(Ot,Lt):n(Mt).fill(Ot):n(Mt)}i.alloc=function(Mt,Ot,Lt){return o(Mt,Ot,Lt)};function c(Mt){return l(Mt),n(Mt<0?0:_(Mt)|0)}i.allocUnsafe=function(Mt){return c(Mt)},i.allocUnsafeSlow=function(Mt){return c(Mt)};function s(Mt,Ot){if((typeof Ot!="string"||Ot==="")&&(Ot="utf8"),!i.isEncoding(Ot))throw new TypeError("Unknown encoding: "+Ot);let Lt=d(Mt,Ot)|0,ie=n(Lt),be=ie.write(Mt,Ot);return be!==Lt&&(ie=ie.slice(0,be)),ie}function h(Mt){let Ot=Mt.length<0?0:_(Mt.length)|0,Lt=n(Ot);for(let ie=0;ie=z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z.toString(16)+" bytes");return Mt|0}function A(Mt){return+Mt!=Mt&&(Mt=0),i.alloc(+Mt)}i.isBuffer=function(Mt){return Mt!=null&&Mt._isBuffer===!0&&Mt!==i.prototype},i.compare=function(Mt,Ot){if(ee(Mt,Uint8Array)&&(Mt=i.from(Mt,Mt.offset,Mt.byteLength)),ee(Ot,Uint8Array)&&(Ot=i.from(Ot,Ot.offset,Ot.byteLength)),!i.isBuffer(Mt)||!i.isBuffer(Ot))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Mt===Ot)return 0;let Lt=Mt.length,ie=Ot.length;for(let be=0,ce=Math.min(Lt,ie);beie.length?(i.isBuffer(ce)||(ce=i.from(ce)),ce.copy(ie,be)):Uint8Array.prototype.set.call(ie,ce,be);else if(i.isBuffer(ce))ce.copy(ie,be);else throw new TypeError('"list" argument must be an Array of Buffers');be+=ce.length}return ie};function d(Mt,Ot){if(i.isBuffer(Mt))return Mt.length;if(ArrayBuffer.isView(Mt)||ee(Mt,ArrayBuffer))return Mt.byteLength;if(typeof Mt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Mt);let Lt=Mt.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&Lt===0)return 0;let be=!1;for(;;)switch(Ot){case"ascii":case"latin1":case"binary":return Lt;case"utf8":case"utf-8":return Ct(Mt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt*2;case"hex":return Lt>>>1;case"base64":return Zt(Mt).length;default:if(be)return ie?-1:Ct(Mt).length;Ot=(""+Ot).toLowerCase(),be=!0}}i.byteLength=d;function k(Mt,Ot,Lt){let ie=!1;if((Ot===void 0||Ot<0)&&(Ot=0),Ot>this.length||((Lt===void 0||Lt>this.length)&&(Lt=this.length),Lt<=0)||(Lt>>>=0,Ot>>>=0,Lt<=Ot))return"";for(Mt||(Mt="utf8");;)switch(Mt){case"hex":return F(this,Ot,Lt);case"utf8":case"utf-8":return N(this,Ot,Lt);case"ascii":return V(this,Ot,Lt);case"latin1":case"binary":return W(this,Ot,Lt);case"base64":return S(this,Ot,Lt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,Ot,Lt);default:if(ie)throw new TypeError("Unknown encoding: "+Mt);Mt=(Mt+"").toLowerCase(),ie=!0}}i.prototype._isBuffer=!0;function w(Mt,Ot,Lt){let ie=Mt[Ot];Mt[Ot]=Mt[Lt],Mt[Lt]=ie}i.prototype.swap16=function(){let Mt=this.length;if(Mt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Ot=0;OtOt&&(Mt+=" ... "),""},y&&(i.prototype[y]=i.prototype.inspect),i.prototype.compare=function(Mt,Ot,Lt,ie,be){if(ee(Mt,Uint8Array)&&(Mt=i.from(Mt,Mt.offset,Mt.byteLength)),!i.isBuffer(Mt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Mt);if(Ot===void 0&&(Ot=0),Lt===void 0&&(Lt=Mt?Mt.length:0),ie===void 0&&(ie=0),be===void 0&&(be=this.length),Ot<0||Lt>Mt.length||ie<0||be>this.length)throw new RangeError("out of range index");if(ie>=be&&Ot>=Lt)return 0;if(ie>=be)return-1;if(Ot>=Lt)return 1;if(Ot>>>=0,Lt>>>=0,ie>>>=0,be>>>=0,this===Mt)return 0;let ce=be-ie,Le=Lt-Ot,Ze=Math.min(ce,Le),Qe=this.slice(ie,be),mr=Mt.slice(Ot,Lt);for(let fr=0;fr2147483647?Lt=2147483647:Lt<-2147483648&&(Lt=-2147483648),Lt=+Lt,xe(Lt)&&(Lt=be?0:Mt.length-1),Lt<0&&(Lt=Mt.length+Lt),Lt>=Mt.length){if(be)return-1;Lt=Mt.length-1}else if(Lt<0)if(be)Lt=0;else return-1;if(typeof Ot=="string"&&(Ot=i.from(Ot,ie)),i.isBuffer(Ot))return Ot.length===0?-1:E(Mt,Ot,Lt,ie,be);if(typeof Ot=="number")return Ot=Ot&255,typeof Uint8Array.prototype.indexOf=="function"?be?Uint8Array.prototype.indexOf.call(Mt,Ot,Lt):Uint8Array.prototype.lastIndexOf.call(Mt,Ot,Lt):E(Mt,[Ot],Lt,ie,be);throw new TypeError("val must be string, number or Buffer")}function E(Mt,Ot,Lt,ie,be){let ce=1,Le=Mt.length,Ze=Ot.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(Mt.length<2||Ot.length<2)return-1;ce=2,Le/=2,Ze/=2,Lt/=2}function Qe(fr,Jr){return ce===1?fr[Jr]:fr.readUInt16BE(Jr*ce)}let mr;if(be){let fr=-1;for(mr=Lt;mrLe&&(Lt=Le-Ze),mr=Lt;mr>=0;mr--){let fr=!0;for(let Jr=0;Jrbe&&(ie=be)):ie=be;let ce=Ot.length;ie>ce/2&&(ie=ce/2);let Le;for(Le=0;Le>>0,isFinite(Lt)?(Lt=Lt>>>0,ie===void 0&&(ie="utf8")):(ie=Lt,Lt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let be=this.length-Ot;if((Lt===void 0||Lt>be)&&(Lt=be),Mt.length>0&&(Lt<0||Ot<0)||Ot>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let ce=!1;for(;;)switch(ie){case"hex":return I(this,Mt,Ot,Lt);case"utf8":case"utf-8":return M(this,Mt,Ot,Lt);case"ascii":case"latin1":case"binary":return p(this,Mt,Ot,Lt);case"base64":return g(this,Mt,Ot,Lt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,Mt,Ot,Lt);default:if(ce)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),ce=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function S(Mt,Ot,Lt){return Ot===0&&Lt===Mt.length?Y.fromByteArray(Mt):Y.fromByteArray(Mt.slice(Ot,Lt))}function N(Mt,Ot,Lt){Lt=Math.min(Mt.length,Lt);let ie=[],be=Ot;for(;be239?4:ce>223?3:ce>191?2:1;if(be+Ze<=Lt){let Qe,mr,fr,Jr;switch(Ze){case 1:ce<128&&(Le=ce);break;case 2:Qe=Mt[be+1],(Qe&192)===128&&(Jr=(ce&31)<<6|Qe&63,Jr>127&&(Le=Jr));break;case 3:Qe=Mt[be+1],mr=Mt[be+2],(Qe&192)===128&&(mr&192)===128&&(Jr=(ce&15)<<12|(Qe&63)<<6|mr&63,Jr>2047&&(Jr<55296||Jr>57343)&&(Le=Jr));break;case 4:Qe=Mt[be+1],mr=Mt[be+2],fr=Mt[be+3],(Qe&192)===128&&(mr&192)===128&&(fr&192)===128&&(Jr=(ce&15)<<18|(Qe&63)<<12|(mr&63)<<6|fr&63,Jr>65535&&Jr<1114112&&(Le=Jr))}}Le===null?(Le=65533,Ze=1):Le>65535&&(Le-=65536,ie.push(Le>>>10&1023|55296),Le=56320|Le&1023),ie.push(Le),be+=Ze}return U(ie)}var B=4096;function U(Mt){let Ot=Mt.length;if(Ot<=B)return String.fromCharCode.apply(String,Mt);let Lt="",ie=0;for(;ieie)&&(Lt=ie);let be="";for(let ce=Ot;ceLt&&(Mt=Lt),Ot<0?(Ot+=Lt,Ot<0&&(Ot=0)):Ot>Lt&&(Ot=Lt),OtLt)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(Mt,Ot,Lt){Mt=Mt>>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=this[Mt],be=1,ce=0;for(;++ce>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=this[Mt+--Ot],be=1;for(;Ot>0&&(be*=256);)ie+=this[Mt+--Ot]*be;return ie},i.prototype.readUint8=i.prototype.readUInt8=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,1,this.length),this[Mt]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,2,this.length),this[Mt]|this[Mt+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,2,this.length),this[Mt]<<8|this[Mt+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),(this[Mt]|this[Mt+1]<<8|this[Mt+2]<<16)+this[Mt+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),this[Mt]*16777216+(this[Mt+1]<<16|this[Mt+2]<<8|this[Mt+3])},i.prototype.readBigUInt64LE=ye(function(Mt){Mt=Mt>>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=Ot+this[++Mt]*2**8+this[++Mt]*2**16+this[++Mt]*2**24,be=this[++Mt]+this[++Mt]*2**8+this[++Mt]*2**16+Lt*2**24;return BigInt(ie)+(BigInt(be)<>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=Ot*2**24+this[++Mt]*2**16+this[++Mt]*2**8+this[++Mt],be=this[++Mt]*2**24+this[++Mt]*2**16+this[++Mt]*2**8+Lt;return(BigInt(ie)<>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=this[Mt],be=1,ce=0;for(;++ce=be&&(ie-=Math.pow(2,8*Ot)),ie},i.prototype.readIntBE=function(Mt,Ot,Lt){Mt=Mt>>>0,Ot=Ot>>>0,Lt||q(Mt,Ot,this.length);let ie=Ot,be=1,ce=this[Mt+--ie];for(;ie>0&&(be*=256);)ce+=this[Mt+--ie]*be;return be*=128,ce>=be&&(ce-=Math.pow(2,8*Ot)),ce},i.prototype.readInt8=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,1,this.length),this[Mt]&128?(255-this[Mt]+1)*-1:this[Mt]},i.prototype.readInt16LE=function(Mt,Ot){Mt=Mt>>>0,Ot||q(Mt,2,this.length);let Lt=this[Mt]|this[Mt+1]<<8;return Lt&32768?Lt|4294901760:Lt},i.prototype.readInt16BE=function(Mt,Ot){Mt=Mt>>>0,Ot||q(Mt,2,this.length);let Lt=this[Mt+1]|this[Mt]<<8;return Lt&32768?Lt|4294901760:Lt},i.prototype.readInt32LE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),this[Mt]|this[Mt+1]<<8|this[Mt+2]<<16|this[Mt+3]<<24},i.prototype.readInt32BE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),this[Mt]<<24|this[Mt+1]<<16|this[Mt+2]<<8|this[Mt+3]},i.prototype.readBigInt64LE=ye(function(Mt){Mt=Mt>>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=this[Mt+4]+this[Mt+5]*2**8+this[Mt+6]*2**16+(Lt<<24);return(BigInt(ie)<>>0,ot(Mt,"offset");let Ot=this[Mt],Lt=this[Mt+7];(Ot===void 0||Lt===void 0)&&J(Mt,this.length-8);let ie=(Ot<<24)+this[++Mt]*2**16+this[++Mt]*2**8+this[++Mt];return(BigInt(ie)<>>0,Ot||q(Mt,4,this.length),f.read(this,Mt,!0,23,4)},i.prototype.readFloatBE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,4,this.length),f.read(this,Mt,!1,23,4)},i.prototype.readDoubleLE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,8,this.length),f.read(this,Mt,!0,52,8)},i.prototype.readDoubleBE=function(Mt,Ot){return Mt=Mt>>>0,Ot||q(Mt,8,this.length),f.read(this,Mt,!1,52,8)};function G(Mt,Ot,Lt,ie,be,ce){if(!i.isBuffer(Mt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Ot>be||OtMt.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(Mt,Ot,Lt,ie){if(Mt=+Mt,Ot=Ot>>>0,Lt=Lt>>>0,!ie){let Le=Math.pow(2,8*Lt)-1;G(this,Mt,Ot,Lt,Le,0)}let be=1,ce=0;for(this[Ot]=Mt&255;++ce>>0,Lt=Lt>>>0,!ie){let Le=Math.pow(2,8*Lt)-1;G(this,Mt,Ot,Lt,Le,0)}let be=Lt-1,ce=1;for(this[Ot+be]=Mt&255;--be>=0&&(ce*=256);)this[Ot+be]=Mt/ce&255;return Ot+Lt},i.prototype.writeUint8=i.prototype.writeUInt8=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,1,255,0),this[Ot]=Mt&255,Ot+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,65535,0),this[Ot]=Mt&255,this[Ot+1]=Mt>>>8,Ot+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,65535,0),this[Ot]=Mt>>>8,this[Ot+1]=Mt&255,Ot+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,4294967295,0),this[Ot+3]=Mt>>>24,this[Ot+2]=Mt>>>16,this[Ot+1]=Mt>>>8,this[Ot]=Mt&255,Ot+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,4294967295,0),this[Ot]=Mt>>>24,this[Ot+1]=Mt>>>16,this[Ot+2]=Mt>>>8,this[Ot+3]=Mt&255,Ot+4};function tt(Mt,Ot,Lt,ie,be){xt(Ot,ie,be,Mt,Lt,7);let ce=Number(Ot&BigInt(4294967295));Mt[Lt++]=ce,ce=ce>>8,Mt[Lt++]=ce,ce=ce>>8,Mt[Lt++]=ce,ce=ce>>8,Mt[Lt++]=ce;let Le=Number(Ot>>BigInt(32)&BigInt(4294967295));return Mt[Lt++]=Le,Le=Le>>8,Mt[Lt++]=Le,Le=Le>>8,Mt[Lt++]=Le,Le=Le>>8,Mt[Lt++]=Le,Lt}function ht(Mt,Ot,Lt,ie,be){xt(Ot,ie,be,Mt,Lt,7);let ce=Number(Ot&BigInt(4294967295));Mt[Lt+7]=ce,ce=ce>>8,Mt[Lt+6]=ce,ce=ce>>8,Mt[Lt+5]=ce,ce=ce>>8,Mt[Lt+4]=ce;let Le=Number(Ot>>BigInt(32)&BigInt(4294967295));return Mt[Lt+3]=Le,Le=Le>>8,Mt[Lt+2]=Le,Le=Le>>8,Mt[Lt+1]=Le,Le=Le>>8,Mt[Lt]=Le,Lt+8}i.prototype.writeBigUInt64LE=ye(function(Mt,Ot=0){return tt(this,Mt,Ot,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=ye(function(Mt,Ot=0){return ht(this,Mt,Ot,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(Mt,Ot,Lt,ie){if(Mt=+Mt,Ot=Ot>>>0,!ie){let Ze=Math.pow(2,8*Lt-1);G(this,Mt,Ot,Lt,Ze-1,-Ze)}let be=0,ce=1,Le=0;for(this[Ot]=Mt&255;++be>0)-Le&255;return Ot+Lt},i.prototype.writeIntBE=function(Mt,Ot,Lt,ie){if(Mt=+Mt,Ot=Ot>>>0,!ie){let Ze=Math.pow(2,8*Lt-1);G(this,Mt,Ot,Lt,Ze-1,-Ze)}let be=Lt-1,ce=1,Le=0;for(this[Ot+be]=Mt&255;--be>=0&&(ce*=256);)Mt<0&&Le===0&&this[Ot+be+1]!==0&&(Le=1),this[Ot+be]=(Mt/ce>>0)-Le&255;return Ot+Lt},i.prototype.writeInt8=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,1,127,-128),Mt<0&&(Mt=255+Mt+1),this[Ot]=Mt&255,Ot+1},i.prototype.writeInt16LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,32767,-32768),this[Ot]=Mt&255,this[Ot+1]=Mt>>>8,Ot+2},i.prototype.writeInt16BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,2,32767,-32768),this[Ot]=Mt>>>8,this[Ot+1]=Mt&255,Ot+2},i.prototype.writeInt32LE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,2147483647,-2147483648),this[Ot]=Mt&255,this[Ot+1]=Mt>>>8,this[Ot+2]=Mt>>>16,this[Ot+3]=Mt>>>24,Ot+4},i.prototype.writeInt32BE=function(Mt,Ot,Lt){return Mt=+Mt,Ot=Ot>>>0,Lt||G(this,Mt,Ot,4,2147483647,-2147483648),Mt<0&&(Mt=4294967295+Mt+1),this[Ot]=Mt>>>24,this[Ot+1]=Mt>>>16,this[Ot+2]=Mt>>>8,this[Ot+3]=Mt&255,Ot+4},i.prototype.writeBigInt64LE=ye(function(Mt,Ot=0){return tt(this,Mt,Ot,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=ye(function(Mt,Ot=0){return ht(this,Mt,Ot,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function bt(Mt,Ot,Lt,ie,be,ce){if(Lt+ie>Mt.length)throw new RangeError("Index out of range");if(Lt<0)throw new RangeError("Index out of range")}function vt(Mt,Ot,Lt,ie,be){return Ot=+Ot,Lt=Lt>>>0,be||bt(Mt,Ot,Lt,4),f.write(Mt,Ot,Lt,ie,23,4),Lt+4}i.prototype.writeFloatLE=function(Mt,Ot,Lt){return vt(this,Mt,Ot,!0,Lt)},i.prototype.writeFloatBE=function(Mt,Ot,Lt){return vt(this,Mt,Ot,!1,Lt)};function ut(Mt,Ot,Lt,ie,be){return Ot=+Ot,Lt=Lt>>>0,be||bt(Mt,Ot,Lt,8),f.write(Mt,Ot,Lt,ie,52,8),Lt+8}i.prototype.writeDoubleLE=function(Mt,Ot,Lt){return ut(this,Mt,Ot,!0,Lt)},i.prototype.writeDoubleBE=function(Mt,Ot,Lt){return ut(this,Mt,Ot,!1,Lt)},i.prototype.copy=function(Mt,Ot,Lt,ie){if(!i.isBuffer(Mt))throw new TypeError("argument should be a Buffer");if(Lt||(Lt=0),!ie&&ie!==0&&(ie=this.length),Ot>=Mt.length&&(Ot=Mt.length),Ot||(Ot=0),ie>0&&ie=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),Mt.length-Ot>>0,Lt=Lt===void 0?this.length:Lt>>>0,Mt||(Mt=0);let be;if(typeof Mt=="number")for(be=Ot;be2**32?be=it(String(Lt)):typeof Lt=="bigint"&&(be=String(Lt),(Lt>BigInt(2)**BigInt(32)||Lt<-(BigInt(2)**BigInt(32)))&&(be=it(be)),be+="n"),ie+=` It must be ${Ot}. Received ${be}`,ie},RangeError);function it(Mt){let Ot="",Lt=Mt.length,ie=Mt[0]==="-"?1:0;for(;Lt>=ie+4;Lt-=3)Ot=`_${Mt.slice(Lt-3,Lt)}${Ot}`;return`${Mt.slice(0,Lt)}${Ot}`}function st(Mt,Ot,Lt){ot(Ot,"offset"),(Mt[Ot]===void 0||Mt[Ot+Lt]===void 0)&&J(Ot,Mt.length-(Lt+1))}function xt(Mt,Ot,Lt,ie,be,ce){if(Mt>Lt||Mt= 0${Le} and < 2${Le} ** ${(ce+1)*8}${Le}`:Ze=`>= -(2${Le} ** ${(ce+1)*8-1}${Le}) and < 2 ** ${(ce+1)*8-1}${Le}`,new rt.ERR_OUT_OF_RANGE("value",Ze,Mt)}st(ie,be,ce)}function ot(Mt,Ot){if(typeof Mt!="number")throw new rt.ERR_INVALID_ARG_TYPE(Ot,"number",Mt)}function J(Mt,Ot,Lt){throw Math.floor(Mt)!==Mt?(ot(Mt,Lt),new rt.ERR_OUT_OF_RANGE("offset","an integer",Mt)):Ot<0?new rt.ERR_BUFFER_OUT_OF_BOUNDS:new rt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Ot}`,Mt)}var mt=/[^+/0-9A-Za-z-_]/g;function dt(Mt){if(Mt=Mt.split("=")[0],Mt=Mt.trim().replace(mt,""),Mt.length<2)return"";for(;Mt.length%4!==0;)Mt=Mt+"=";return Mt}function Ct(Mt,Ot){Ot=Ot||1/0;let Lt,ie=Mt.length,be=null,ce=[];for(let Le=0;Le55295&&Lt<57344){if(!be){if(Lt>56319){(Ot-=3)>-1&&ce.push(239,191,189);continue}else if(Le+1===ie){(Ot-=3)>-1&&ce.push(239,191,189);continue}be=Lt;continue}if(Lt<56320){(Ot-=3)>-1&&ce.push(239,191,189),be=Lt;continue}Lt=(be-55296<<10|Lt-56320)+65536}else be&&(Ot-=3)>-1&&ce.push(239,191,189);if(be=null,Lt<128){if((Ot-=1)<0)break;ce.push(Lt)}else if(Lt<2048){if((Ot-=2)<0)break;ce.push(Lt>>6|192,Lt&63|128)}else if(Lt<65536){if((Ot-=3)<0)break;ce.push(Lt>>12|224,Lt>>6&63|128,Lt&63|128)}else if(Lt<1114112){if((Ot-=4)<0)break;ce.push(Lt>>18|240,Lt>>12&63|128,Lt>>6&63|128,Lt&63|128)}else throw new Error("Invalid code point")}return ce}function Rt(Mt){let Ot=[];for(let Lt=0;Lt>8,be=Lt%256,ce.push(be),ce.push(ie);return ce}function Zt(Mt){return Y.toByteArray(dt(Mt))}function Gt(Mt,Ot,Lt,ie){let be;for(be=0;be=Ot.length||be>=Mt.length);++be)Ot[be+Lt]=Mt[be];return be}function ee(Mt,Ot){return Mt instanceof Ot||Mt!=null&&Mt.constructor!=null&&Mt.constructor.name!=null&&Mt.constructor.name===Ot.name}function xe(Mt){return Mt!==Mt}var ge=function(){let Mt="0123456789abcdef",Ot=new Array(256);for(let Lt=0;Lt<16;++Lt){let ie=Lt*16;for(let be=0;be<16;++be)Ot[ie+be]=Mt[Lt]+Mt[be]}return Ot}();function ye(Mt){return typeof BigInt>"u"?ue:Mt}function ue(){throw new Error("BigInt not supported")}}),sC=It((et,Y)=>{Y.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var f={},y=Symbol("test"),z=Object(y);if(typeof y=="string"||Object.prototype.toString.call(y)!=="[object Symbol]"||Object.prototype.toString.call(z)!=="[object Symbol]")return!1;var P=42;f[y]=P;for(var n in f)return!1;if(typeof Object.keys=="function"&&Object.keys(f).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(f).length!==0)return!1;var i=Object.getOwnPropertySymbols(f);if(i.length!==1||i[0]!==y||!Object.prototype.propertyIsEnumerable.call(f,y))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(f,y);if(a.value!==P||a.enumerable!==!0)return!1}return!0}}),rk=It((et,Y)=>{var f=sC();Y.exports=function(){return f()&&!!Symbol.toStringTag}}),EP=It((et,Y)=>{Y.exports=Object}),XG=It((et,Y)=>{Y.exports=Error}),JG=It((et,Y)=>{Y.exports=EvalError}),QG=It((et,Y)=>{Y.exports=RangeError}),tZ=It((et,Y)=>{Y.exports=ReferenceError}),LP=It((et,Y)=>{Y.exports=SyntaxError}),Rw=It((et,Y)=>{Y.exports=TypeError}),eZ=It((et,Y)=>{Y.exports=URIError}),rZ=It((et,Y)=>{Y.exports=Math.abs}),nZ=It((et,Y)=>{Y.exports=Math.floor}),iZ=It((et,Y)=>{Y.exports=Math.max}),aZ=It((et,Y)=>{Y.exports=Math.min}),oZ=It((et,Y)=>{Y.exports=Math.pow}),sZ=It((et,Y)=>{Y.exports=Math.round}),lZ=It((et,Y)=>{Y.exports=Number.isNaN||function(f){return f!==f}}),cZ=It((et,Y)=>{var f=lZ();Y.exports=function(y){return f(y)||y===0?y:y<0?-1:1}}),uZ=It((et,Y)=>{Y.exports=Object.getOwnPropertyDescriptor}),xb=It((et,Y)=>{var f=uZ();if(f)try{f([],"length")}catch{f=null}Y.exports=f}),nk=It((et,Y)=>{var f=Object.defineProperty||!1;if(f)try{f({},"a",{value:1})}catch{f=!1}Y.exports=f}),hZ=It((et,Y)=>{var f=typeof Symbol<"u"&&Symbol,y=sC();Y.exports=function(){return typeof f!="function"||typeof Symbol!="function"||typeof f("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:y()}}),PP=It((et,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),IP=It((et,Y)=>{var f=EP();Y.exports=f.getPrototypeOf||null}),dZ=It((et,Y)=>{var f="Function.prototype.bind called on incompatible ",y=Object.prototype.toString,z=Math.max,P="[object Function]",n=function(l,o){for(var c=[],s=0;s{var f=dZ();Y.exports=Function.prototype.bind||f}),lC=It((et,Y)=>{Y.exports=Function.prototype.call}),DP=It((et,Y)=>{Y.exports=Function.prototype.apply}),fZ=It((et,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),pZ=It((et,Y)=>{var f=Fw(),y=DP(),z=lC(),P=fZ();Y.exports=P||f.call(z,y)}),mZ=It((et,Y)=>{var f=Fw(),y=Rw(),z=lC(),P=pZ();Y.exports=function(n){if(n.length<1||typeof n[0]!="function")throw new y("a function is required");return P(f,z,n)}}),gZ=It((et,Y)=>{var f=mZ(),y=xb(),z;try{z=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var P=!!z&&y&&y(Object.prototype,"__proto__"),n=Object,i=n.getPrototypeOf;Y.exports=P&&typeof P.get=="function"?f([P.get]):typeof i=="function"?function(a){return i(a==null?a:n(a))}:!1}),vZ=It((et,Y)=>{var f=PP(),y=IP(),z=gZ();Y.exports=f?function(P){return f(P)}:y?function(P){if(!P||typeof P!="object"&&typeof P!="function")throw new TypeError("getProto: not an object");return y(P)}:z?function(P){return z(P)}:null}),yZ=It((et,Y)=>{var f=Function.prototype.call,y=Object.prototype.hasOwnProperty,z=Fw();Y.exports=z.call(f,y)}),cC=It((et,Y)=>{var f,y=EP(),z=XG(),P=JG(),n=QG(),i=tZ(),a=LP(),l=Rw(),o=eZ(),c=rZ(),s=nZ(),h=iZ(),m=aZ(),b=oZ(),x=sZ(),_=cZ(),A=Function,d=function(st){try{return A('"use strict"; return ('+st+").constructor;")()}catch{}},k=xb(),w=nk(),D=function(){throw new l},E=k?function(){try{return arguments.callee,D}catch{try{return k(arguments,"callee").get}catch{return D}}}():D,I=hZ()(),M=vZ(),p=IP(),g=PP(),C=DP(),S=lC(),N={},B=typeof Uint8Array>"u"||!M?f:M(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?f:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?f:ArrayBuffer,"%ArrayIteratorPrototype%":I&&M?M([][Symbol.iterator]()):f,"%AsyncFromSyncIteratorPrototype%":f,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?f:Atomics,"%BigInt%":typeof BigInt>"u"?f:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?f:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?f:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?f:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":z,"%eval%":eval,"%EvalError%":P,"%Float16Array%":typeof Float16Array>"u"?f:Float16Array,"%Float32Array%":typeof Float32Array>"u"?f:Float32Array,"%Float64Array%":typeof Float64Array>"u"?f:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?f:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?f:Int8Array,"%Int16Array%":typeof Int16Array>"u"?f:Int16Array,"%Int32Array%":typeof Int32Array>"u"?f:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":I&&M?M(M([][Symbol.iterator]())):f,"%JSON%":typeof JSON=="object"?JSON:f,"%Map%":typeof Map>"u"?f:Map,"%MapIteratorPrototype%":typeof Map>"u"||!I||!M?f:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":y,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?f:Promise,"%Proxy%":typeof Proxy>"u"?f:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?f:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?f:Set,"%SetIteratorPrototype%":typeof Set>"u"||!I||!M?f:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?f:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&M?M(""[Symbol.iterator]()):f,"%Symbol%":I?Symbol:f,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":B,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?f:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?f:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?f:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?f:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?f:WeakMap,"%WeakRef%":typeof WeakRef>"u"?f:WeakRef,"%WeakSet%":typeof WeakSet>"u"?f:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":C,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":p,"%Math.abs%":c,"%Math.floor%":s,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":b,"%Math.round%":x,"%Math.sign%":_,"%Reflect.getPrototypeOf%":g};if(M)try{null.error}catch(st){V=M(M(st)),U["%Error.prototype%"]=V}var V,W=function st(xt){var ot;if(xt==="%AsyncFunction%")ot=d("async function () {}");else if(xt==="%GeneratorFunction%")ot=d("function* () {}");else if(xt==="%AsyncGeneratorFunction%")ot=d("async function* () {}");else if(xt==="%AsyncGenerator%"){var J=st("%AsyncGeneratorFunction%");J&&(ot=J.prototype)}else if(xt==="%AsyncIteratorPrototype%"){var mt=st("%AsyncGenerator%");mt&&M&&(ot=M(mt.prototype))}return U[xt]=ot,ot},F={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},H=Fw(),q=yZ(),G=H.call(S,Array.prototype.concat),tt=H.call(C,Array.prototype.splice),ht=H.call(S,String.prototype.replace),bt=H.call(S,String.prototype.slice),vt=H.call(S,RegExp.prototype.exec),ut=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rt=/\\(\\)?/g,gt=function(st){var xt=bt(st,0,1),ot=bt(st,-1);if(xt==="%"&&ot!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(ot==="%"&&xt!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var J=[];return ht(st,ut,function(mt,dt,Ct,Rt){J[J.length]=Ct?ht(Rt,rt,"$1"):dt||mt}),J},it=function(st,xt){var ot=st,J;if(q(F,ot)&&(J=F[ot],ot="%"+J[0]+"%"),q(U,ot)){var mt=U[ot];if(mt===N&&(mt=W(ot)),typeof mt>"u"&&!xt)throw new l("intrinsic "+st+" exists, but is not available. Please file an issue!");return{alias:J,name:ot,value:mt}}throw new a("intrinsic "+st+" does not exist!")};Y.exports=function(st,xt){if(typeof st!="string"||st.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof xt!="boolean")throw new l('"allowMissing" argument must be a boolean');if(vt(/^%?[^%]*%?$/,st)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ot=gt(st),J=ot.length>0?ot[0]:"",mt=it("%"+J+"%",xt),dt=mt.name,Ct=mt.value,Rt=!1,Bt=mt.alias;Bt&&(J=Bt[0],tt(ot,G([0,1],Bt)));for(var Zt=1,Gt=!0;Zt=ot.length){var ye=k(Ct,ee);Gt=!!ye,Gt&&"get"in ye&&!("originalValue"in ye.get)?Ct=ye.get:Ct=Ct[ee]}else Gt=q(Ct,ee),Ct=Ct[ee];Gt&&!Rt&&(U[dt]=Ct)}}return Ct}}),_Z=It((et,Y)=>{var f=nk(),y=LP(),z=Rw(),P=xb();Y.exports=function(n,i,a){if(!n||typeof n!="object"&&typeof n!="function")throw new z("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new z("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new z("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new z("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new z("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new z("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,h=!!P&&P(n,i);if(f)f(n,i,{configurable:c===null&&h?h.configurable:!c,enumerable:l===null&&h?h.enumerable:!l,value:a,writable:o===null&&h?h.writable:!o});else if(s||!l&&!o&&!c)n[i]=a;else throw new y("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),zP=It((et,Y)=>{var f=nk(),y=function(){return!!f};y.hasArrayLengthDefineBug=function(){if(!f)return null;try{return f([],"length",{value:1}).length!==1}catch{return!0}},Y.exports=y}),xZ=It((et,Y)=>{var f=cC(),y=_Z(),z=zP()(),P=xb(),n=Rw(),i=f("%Math.floor%");Y.exports=function(a,l){if(typeof a!="function")throw new n("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||i(l)!==l)throw new n("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],c=!0,s=!0;if("length"in a&&P){var h=P(a,"length");h&&!h.configurable&&(c=!1),h&&!h.writable&&(s=!1)}return(c||s||!o)&&(z?y(a,"length",l,!0,!0):y(a,"length",l)),a}}),ik=It((et,Y)=>{var f=Fw(),y=cC(),z=xZ(),P=Rw(),n=y("%Function.prototype.apply%"),i=y("%Function.prototype.call%"),a=y("%Reflect.apply%",!0)||f.call(i,n),l=nk(),o=y("%Math.max%");Y.exports=function(s){if(typeof s!="function")throw new P("a function is required");var h=a(f,i,arguments);return z(h,1+o(0,s.length-(arguments.length-1)),!0)};var c=function(){return a(f,n,arguments)};l?l(Y.exports,"apply",{value:c}):Y.exports.apply=c}),Nw=It((et,Y)=>{var f=cC(),y=ik(),z=y(f("String.prototype.indexOf"));Y.exports=function(P,n){var i=f(P,!!n);return typeof i=="function"&&z(P,".prototype.")>-1?y(i):i}}),bZ=It((et,Y)=>{var f=rk()(),y=Nw(),z=y("Object.prototype.toString"),P=function(a){return f&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:z(a)==="[object Arguments]"},n=function(a){return P(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&z(a)!=="[object Array]"&&z(a.callee)==="[object Function]"},i=function(){return P(arguments)}();P.isLegacyArguments=n,Y.exports=i?P:n}),wZ=It((et,Y)=>{var f=Object.prototype.toString,y=Function.prototype.toString,z=/^\s*(?:function)?\*/,P=rk()(),n=Object.getPrototypeOf,i=function(){if(!P)return!1;try{return Function("return function*() {}")()}catch{}},a;Y.exports=function(l){if(typeof l!="function")return!1;if(z.test(y.call(l)))return!0;if(!P){var o=f.call(l);return o==="[object GeneratorFunction]"}if(!n)return!1;if(typeof a>"u"){var c=i();a=c?n(c):!1}return n(l)===a}}),kZ=It((et,Y)=>{var f=Function.prototype.toString,y=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,z,P;if(typeof y=="function"&&typeof Object.defineProperty=="function")try{z=Object.defineProperty({},"length",{get:function(){throw P}}),P={},y(function(){throw 42},null,z)}catch(k){k!==P&&(y=null)}else y=null;var n=/^\s*class\b/,i=function(k){try{var w=f.call(k);return n.test(w)}catch{return!1}},a=function(k){try{return i(k)?!1:(f.call(k),!0)}catch{return!1}},l=Object.prototype.toString,o="[object Object]",c="[object Function]",s="[object GeneratorFunction]",h="[object HTMLAllCollection]",m="[object HTML document.all class]",b="[object HTMLCollection]",x=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),A=function(){return!1};typeof document=="object"&&(d=document.all,l.call(d)===l.call(document.all)&&(A=function(k){if((_||!k)&&(typeof k>"u"||typeof k=="object"))try{var w=l.call(k);return(w===h||w===m||w===b||w===o)&&k("")==null}catch{}return!1}));var d;Y.exports=y?function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;try{y(k,null,z)}catch(w){if(w!==P)return!1}return!i(k)&&a(k)}:function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;if(x)return a(k);if(i(k))return!1;var w=l.call(k);return w!==c&&w!==s&&!/^\[object HTML/.test(w)?!1:a(k)}}),OP=It((et,Y)=>{var f=kZ(),y=Object.prototype.toString,z=Object.prototype.hasOwnProperty,P=function(l,o,c){for(var s=0,h=l.length;s=3&&(s=c),y.call(l)==="[object Array]"?P(l,o,s):typeof l=="string"?n(l,o,s):i(l,o,s)};Y.exports=a}),BP=It((et,Y)=>{var f=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],y=typeof globalThis>"u"?window:globalThis;Y.exports=function(){for(var z=[],P=0;P{var f=OP(),y=BP(),z=ik(),P=Nw(),n=xb(),i=P("Object.prototype.toString"),a=rk()(),l=typeof globalThis>"u"?window:globalThis,o=y(),c=P("String.prototype.slice"),s=Object.getPrototypeOf,h=P("Array.prototype.indexOf",!0)||function(_,A){for(var d=0;d<_.length;d+=1)if(_[d]===A)return d;return-1},m={__proto__:null};a&&n&&s?f(o,function(_){var A=new l[_];if(Symbol.toStringTag in A){var d=s(A),k=n(d,Symbol.toStringTag);if(!k){var w=s(d);k=n(w,Symbol.toStringTag)}m["$"+_]=z(k.get)}}):f(o,function(_){var A=new l[_],d=A.slice||A.set;d&&(m["$"+_]=z(d))});var b=function(_){var A=!1;return f(m,function(d,k){if(!A)try{"$"+d(_)===k&&(A=c(k,1))}catch{}}),A},x=function(_){var A=!1;return f(m,function(d,k){if(!A)try{d(_),A=c(k,1)}catch{}}),A};Y.exports=function(_){if(!_||typeof _!="object")return!1;if(!a){var A=c(i(_),8,-1);return h(o,A)>-1?A:A!=="Object"?!1:x(_)}return n?b(_):null}}),SZ=It((et,Y)=>{var f=OP(),y=BP(),z=Nw(),P=z("Object.prototype.toString"),n=rk()(),i=xb(),a=typeof globalThis>"u"?window:globalThis,l=y(),o=z("Array.prototype.indexOf",!0)||function(b,x){for(var _=0;_-1}return i?m(b):!1}}),RP=It(et=>{var Y=bZ(),f=wZ(),y=TZ(),z=SZ();function P(Bt){return Bt.call.bind(Bt)}var n=typeof BigInt<"u",i=typeof Symbol<"u",a=P(Object.prototype.toString),l=P(Number.prototype.valueOf),o=P(String.prototype.valueOf),c=P(Boolean.prototype.valueOf);n&&(s=P(BigInt.prototype.valueOf));var s;i&&(h=P(Symbol.prototype.valueOf));var h;function m(Bt,Zt){if(typeof Bt!="object")return!1;try{return Zt(Bt),!0}catch{return!1}}et.isArgumentsObject=Y,et.isGeneratorFunction=f,et.isTypedArray=z;function b(Bt){return typeof Promise<"u"&&Bt instanceof Promise||Bt!==null&&typeof Bt=="object"&&typeof Bt.then=="function"&&typeof Bt.catch=="function"}et.isPromise=b;function x(Bt){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Bt):z(Bt)||tt(Bt)}et.isArrayBufferView=x;function _(Bt){return y(Bt)==="Uint8Array"}et.isUint8Array=_;function A(Bt){return y(Bt)==="Uint8ClampedArray"}et.isUint8ClampedArray=A;function d(Bt){return y(Bt)==="Uint16Array"}et.isUint16Array=d;function k(Bt){return y(Bt)==="Uint32Array"}et.isUint32Array=k;function w(Bt){return y(Bt)==="Int8Array"}et.isInt8Array=w;function D(Bt){return y(Bt)==="Int16Array"}et.isInt16Array=D;function E(Bt){return y(Bt)==="Int32Array"}et.isInt32Array=E;function I(Bt){return y(Bt)==="Float32Array"}et.isFloat32Array=I;function M(Bt){return y(Bt)==="Float64Array"}et.isFloat64Array=M;function p(Bt){return y(Bt)==="BigInt64Array"}et.isBigInt64Array=p;function g(Bt){return y(Bt)==="BigUint64Array"}et.isBigUint64Array=g;function C(Bt){return a(Bt)==="[object Map]"}C.working=typeof Map<"u"&&C(new Map);function S(Bt){return typeof Map>"u"?!1:C.working?C(Bt):Bt instanceof Map}et.isMap=S;function N(Bt){return a(Bt)==="[object Set]"}N.working=typeof Set<"u"&&N(new Set);function B(Bt){return typeof Set>"u"?!1:N.working?N(Bt):Bt instanceof Set}et.isSet=B;function U(Bt){return a(Bt)==="[object WeakMap]"}U.working=typeof WeakMap<"u"&&U(new WeakMap);function V(Bt){return typeof WeakMap>"u"?!1:U.working?U(Bt):Bt instanceof WeakMap}et.isWeakMap=V;function W(Bt){return a(Bt)==="[object WeakSet]"}W.working=typeof WeakSet<"u"&&W(new WeakSet);function F(Bt){return W(Bt)}et.isWeakSet=F;function H(Bt){return a(Bt)==="[object ArrayBuffer]"}H.working=typeof ArrayBuffer<"u"&&H(new ArrayBuffer);function q(Bt){return typeof ArrayBuffer>"u"?!1:H.working?H(Bt):Bt instanceof ArrayBuffer}et.isArrayBuffer=q;function G(Bt){return a(Bt)==="[object DataView]"}G.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&G(new DataView(new ArrayBuffer(1),0,1));function tt(Bt){return typeof DataView>"u"?!1:G.working?G(Bt):Bt instanceof DataView}et.isDataView=tt;var ht=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function bt(Bt){return a(Bt)==="[object SharedArrayBuffer]"}function vt(Bt){return typeof ht>"u"?!1:(typeof bt.working>"u"&&(bt.working=bt(new ht)),bt.working?bt(Bt):Bt instanceof ht)}et.isSharedArrayBuffer=vt;function ut(Bt){return a(Bt)==="[object AsyncFunction]"}et.isAsyncFunction=ut;function rt(Bt){return a(Bt)==="[object Map Iterator]"}et.isMapIterator=rt;function gt(Bt){return a(Bt)==="[object Set Iterator]"}et.isSetIterator=gt;function it(Bt){return a(Bt)==="[object Generator]"}et.isGeneratorObject=it;function st(Bt){return a(Bt)==="[object WebAssembly.Module]"}et.isWebAssemblyCompiledModule=st;function xt(Bt){return m(Bt,l)}et.isNumberObject=xt;function ot(Bt){return m(Bt,o)}et.isStringObject=ot;function J(Bt){return m(Bt,c)}et.isBooleanObject=J;function mt(Bt){return n&&m(Bt,s)}et.isBigIntObject=mt;function dt(Bt){return i&&m(Bt,h)}et.isSymbolObject=dt;function Ct(Bt){return xt(Bt)||ot(Bt)||J(Bt)||mt(Bt)||dt(Bt)}et.isBoxedPrimitive=Ct;function Rt(Bt){return typeof Uint8Array<"u"&&(q(Bt)||vt(Bt))}et.isAnyArrayBuffer=Rt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Bt){Object.defineProperty(et,Bt,{enumerable:!1,value:function(){throw new Error(Bt+" is not supported in userland")}})})}),FP=It((et,Y)=>{Y.exports=function(f){return f&&typeof f=="object"&&typeof f.copy=="function"&&typeof f.fill=="function"&&typeof f.readUInt8=="function"}}),NP=It(et=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var tt=Object.keys(G),ht={},bt=0;bt=vt)return it;switch(it){case"%s":return String(bt[ht++]);case"%d":return Number(bt[ht++]);case"%j":try{return JSON.stringify(bt[ht++])}catch{return"[Circular]"}default:return it}}),rt=bt[ht];ht"u")return function(){return et.deprecate(G,tt).apply(this,arguments)};var ht=!1;function bt(){if(!ht){if(process.throwDeprecation)throw new Error(tt);process.traceDeprecation?console.trace(tt):console.error(tt),ht=!0}return G.apply(this,arguments)}return bt};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;et.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var tt=process.pid;y[G]=function(){var ht=et.format.apply(et,arguments);console.error("%s %d: %s",G,tt,ht)}}else y[G]=function(){};return y[G]};function n(G,tt){var ht={seen:[],stylize:a};return arguments.length>=3&&(ht.depth=arguments[2]),arguments.length>=4&&(ht.colors=arguments[3]),_(tt)?ht.showHidden=tt:tt&&et._extend(ht,tt),E(ht.showHidden)&&(ht.showHidden=!1),E(ht.depth)&&(ht.depth=2),E(ht.colors)&&(ht.colors=!1),E(ht.customInspect)&&(ht.customInspect=!0),ht.colors&&(ht.stylize=i),o(ht,G,ht.depth)}et.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function i(G,tt){var ht=n.styles[tt];return ht?"\x1B["+n.colors[ht][0]+"m"+G+"\x1B["+n.colors[ht][1]+"m":G}function a(G,tt){return G}function l(G){var tt={};return G.forEach(function(ht,bt){tt[ht]=!0}),tt}function o(G,tt,ht){if(G.customInspect&&tt&&C(tt.inspect)&&tt.inspect!==et.inspect&&!(tt.constructor&&tt.constructor.prototype===tt)){var bt=tt.inspect(ht,G);return w(bt)||(bt=o(G,bt,ht)),bt}var vt=c(G,tt);if(vt)return vt;var ut=Object.keys(tt),rt=l(ut);if(G.showHidden&&(ut=Object.getOwnPropertyNames(tt)),g(tt)&&(ut.indexOf("message")>=0||ut.indexOf("description")>=0))return s(tt);if(ut.length===0){if(C(tt)){var gt=tt.name?": "+tt.name:"";return G.stylize("[Function"+gt+"]","special")}if(I(tt))return G.stylize(RegExp.prototype.toString.call(tt),"regexp");if(p(tt))return G.stylize(Date.prototype.toString.call(tt),"date");if(g(tt))return s(tt)}var it="",st=!1,xt=["{","}"];if(x(tt)&&(st=!0,xt=["[","]"]),C(tt)){var ot=tt.name?": "+tt.name:"";it=" [Function"+ot+"]"}if(I(tt)&&(it=" "+RegExp.prototype.toString.call(tt)),p(tt)&&(it=" "+Date.prototype.toUTCString.call(tt)),g(tt)&&(it=" "+s(tt)),ut.length===0&&(!st||tt.length==0))return xt[0]+it+xt[1];if(ht<0)return I(tt)?G.stylize(RegExp.prototype.toString.call(tt),"regexp"):G.stylize("[Object]","special");G.seen.push(tt);var J;return st?J=h(G,tt,ht,rt,ut):J=ut.map(function(mt){return m(G,tt,ht,rt,mt,st)}),G.seen.pop(),b(J,it,xt)}function c(G,tt){if(E(tt))return G.stylize("undefined","undefined");if(w(tt)){var ht="'"+JSON.stringify(tt).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(ht,"string")}if(k(tt))return G.stylize(""+tt,"number");if(_(tt))return G.stylize(""+tt,"boolean");if(A(tt))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,tt,ht,bt,vt){for(var ut=[],rt=0,gt=tt.length;rt-1&&(ut?gt=gt.split(` `).map(function(st){return" "+st}).join(` `).slice(2):gt=` @@ -137,7 +137,7 @@ function Unt(e,t){for(var r=0;r=0&&bt++,ut+rt.replace(/\u001b\[\d\d?m/g,"").length+1},0);return vt>60?ht[0]+(tt===""?"":tt+` `)+" "+G.join(`, - `)+" "+ht[1]:ht[0]+tt+" "+G.join(", ")+" "+ht[1]}et.types=RP();function x(G){return Array.isArray(G)}et.isArray=x;function _(G){return typeof G=="boolean"}et.isBoolean=_;function A(G){return G===null}et.isNull=A;function d(G){return G==null}et.isNullOrUndefined=d;function k(G){return typeof G=="number"}et.isNumber=k;function w(G){return typeof G=="string"}et.isString=w;function D(G){return typeof G=="symbol"}et.isSymbol=D;function E(G){return G===void 0}et.isUndefined=E;function I(G){return M(G)&&N(G)==="[object RegExp]"}et.isRegExp=I,et.types.isRegExp=I;function M(G){return typeof G=="object"&&G!==null}et.isObject=M;function p(G){return M(G)&&N(G)==="[object Date]"}et.isDate=p,et.types.isDate=p;function g(G){return M(G)&&(N(G)==="[object Error]"||G instanceof Error)}et.isError=g,et.types.isNativeError=g;function C(G){return typeof G=="function"}et.isFunction=C;function S(G){return G===null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||typeof G=="symbol"||typeof G>"u"}et.isPrimitive=S,et.isBuffer=FP();function N(G){return Object.prototype.toString.call(G)}function B(G){return G<10?"0"+G.toString(10):G.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var G=new Date,tt=[B(G.getHours()),B(G.getMinutes()),B(G.getSeconds())].join(":");return[G.getDate(),U[G.getMonth()],tt].join(" ")}et.log=function(){console.log("%s - %s",V(),et.format.apply(et,arguments))},et.inherits=sy(),et._extend=function(G,tt){if(!tt||!M(tt))return G;for(var ht=Object.keys(tt),bt=ht.length;bt--;)G[ht[bt]]=tt[ht[bt]];return G};function W(G,tt){return Object.prototype.hasOwnProperty.call(G,tt)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;et.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&G[F]){var tt=G[F];if(typeof tt!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(tt,F,{value:tt,enumerable:!1,writable:!1,configurable:!0}),tt}function tt(){for(var ht,bt,vt=new Promise(function(gt,it){ht=gt,bt=it}),ut=[],rt=0;rt{function f(m,b){var x=Object.keys(m);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(m);b&&(_=_.filter(function(A){return Object.getOwnPropertyDescriptor(m,A).enumerable})),x.push.apply(x,_)}return x}function y(m){for(var b=1;b0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(b){var x={data:b,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var x=this.head,_=""+x.data;x=x.next;)_+=b+x.data;return _}},{key:"concat",value:function(b){if(this.length===0)return l.alloc(0);for(var x=l.allocUnsafe(b>>>0),_=this.head,A=0;_;)h(_.data,x,A),A+=_.data.length,_=_.next;return x}},{key:"consume",value:function(b,x){var _;return bd.length?d.length:b;if(k===d.length?A+=d:A+=d.slice(0,b),b-=k,b===0){k===d.length?(++_,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=d.slice(k));break}++_}return this.length-=_,A}},{key:"_getBuffer",value:function(b){var x=l.allocUnsafe(b),_=this.head,A=1;for(_.data.copy(x),b-=_.data.length;_=_.next;){var d=_.data,k=b>d.length?d.length:b;if(d.copy(x,x.length-b,0,k),b-=k,b===0){k===d.length?(++A,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=d.slice(k));break}++A}return this.length-=A,x}},{key:s,value:function(b,x){return c(this,y({},x,{depth:0,customInspect:!1}))}}]),m}()}),jP=It((et,Y)=>{function f(a,l){var o=this,c=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return c||s?(l?l(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,a)):process.nextTick(n,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(h){!l&&h?o._writableState?o._writableState.errorEmitted?process.nextTick(z,o):(o._writableState.errorEmitted=!0,process.nextTick(y,o,h)):process.nextTick(y,o,h):l?(process.nextTick(z,o),l(h)):process.nextTick(z,o)}),this)}function y(a,l){n(a,l),z(a)}function z(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function P(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function n(a,l){a.emit("error",l)}function i(a,l){var o=a._readableState,c=a._writableState;o&&o.autoDestroy||c&&c.autoDestroy?a.destroy(l):a.emit("error",l)}Y.exports={destroy:f,undestroy:P,errorOrDestroy:i}}),xb=It((et,Y)=>{function f(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,l.__proto__=o}var y={};function z(l,o,c){c||(c=Error);function s(m,b,x){return typeof o=="string"?o:o(m,b,x)}var h=function(m){f(b,m);function b(x,_,A){return m.call(this,s(x,_,A))||this}return b}(c);h.prototype.name=c.name,h.prototype.code=l,y[l]=h}function P(l,o){if(Array.isArray(l)){var c=l.length;return l=l.map(function(s){return String(s)}),c>2?"one of ".concat(o," ").concat(l.slice(0,c-1).join(", "),", or ")+l[c-1]:c===2?"one of ".concat(o," ").concat(l[0]," or ").concat(l[1]):"of ".concat(o," ").concat(l[0])}else return"of ".concat(o," ").concat(String(l))}function n(l,o,c){return l.substr(0,o.length)===o}function i(l,o,c){return(c===void 0||c>l.length)&&(c=l.length),l.substring(c-o.length,c)===o}function a(l,o,c){return typeof c!="number"&&(c=0),c+o.length>l.length?!1:l.indexOf(o,c)!==-1}z("ERR_INVALID_OPT_VALUE",function(l,o){return'The value "'+o+'" is invalid for option "'+l+'"'},TypeError),z("ERR_INVALID_ARG_TYPE",function(l,o,c){var s;typeof o=="string"&&n(o,"not ")?(s="must not be",o=o.replace(/^not /,"")):s="must be";var h;if(i(l," argument"))h="The ".concat(l," ").concat(s," ").concat(P(o,"type"));else{var m=a(l,".")?"property":"argument";h='The "'.concat(l,'" ').concat(m," ").concat(s," ").concat(P(o,"type"))}return h+=". Received type ".concat(typeof c),h},TypeError),z("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),z("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),z("ERR_STREAM_PREMATURE_CLOSE","Premature close"),z("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),z("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),z("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),z("ERR_STREAM_WRITE_AFTER_END","write after end"),z("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),z("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),z("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Y.exports.codes=y}),UP=It((et,Y)=>{var f=xb().codes.ERR_INVALID_OPT_VALUE;function y(P,n,i){return P.highWaterMark!=null?P.highWaterMark:n?P[i]:null}function z(P,n,i,a){var l=y(n,a,i);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var o=a?i:"highWaterMark";throw new f(o,l)}return Math.floor(l)}return P.objectMode?16:16*1024}Y.exports={getHighWaterMark:z}}),AZ=It((et,Y)=>{Y.exports=f;function f(z,P){if(y("noDeprecation"))return z;var n=!1;function i(){if(!n){if(y("throwDeprecation"))throw new Error(P);y("traceDeprecation")?console.trace(P):console.warn(P),n=!0}return z.apply(this,arguments)}return i}function y(z){try{if(!window.localStorage)return!1}catch{return!1}var P=window.localStorage[z];return P==null?!1:String(P).toLowerCase()==="true"}}),$P=It((et,Y)=>{Y.exports=p;function f(rt){var gt=this;this.next=null,this.entry=null,this.finish=function(){ut(gt,rt)}}var y;p.WritableState=I;var z={deprecate:AZ()},P=MP(),n=yb().Buffer,i=window.Uint8Array||function(){};function a(rt){return n.from(rt)}function l(rt){return n.isBuffer(rt)||rt instanceof i}var o=jP(),c=UP(),s=c.getHighWaterMark,h=xb().codes,m=h.ERR_INVALID_ARG_TYPE,b=h.ERR_METHOD_NOT_IMPLEMENTED,x=h.ERR_MULTIPLE_CALLBACK,_=h.ERR_STREAM_CANNOT_PIPE,A=h.ERR_STREAM_DESTROYED,d=h.ERR_STREAM_NULL_VALUES,k=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,D=o.errorOrDestroy;sy()(p,P);function E(){}function I(rt,gt,it){y=y||bb(),rt=rt||{},typeof it!="boolean"&&(it=gt instanceof y),this.objectMode=!!rt.objectMode,it&&(this.objectMode=this.objectMode||!!rt.writableObjectMode),this.highWaterMark=s(this,rt,"writableHighWaterMark",it),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var st=rt.decodeStrings===!1;this.decodeStrings=!st,this.defaultEncoding=rt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xt){W(gt,xt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=rt.emitClose!==!1,this.autoDestroy=!!rt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}I.prototype.getBuffer=function(){for(var rt=this.bufferedRequest,gt=[];rt;)gt.push(rt),rt=rt.next;return gt},function(){try{Object.defineProperty(I.prototype,"buffer",{get:z.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var M;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(rt){return M.call(this,rt)?!0:this!==p?!1:rt&&rt._writableState instanceof I}})):M=function(rt){return rt instanceof this};function p(rt){y=y||bb();var gt=this instanceof y;if(!gt&&!M.call(p,this))return new p(rt);this._writableState=new I(rt,this,gt),this.writable=!0,rt&&(typeof rt.write=="function"&&(this._write=rt.write),typeof rt.writev=="function"&&(this._writev=rt.writev),typeof rt.destroy=="function"&&(this._destroy=rt.destroy),typeof rt.final=="function"&&(this._final=rt.final)),P.call(this)}p.prototype.pipe=function(){D(this,new _)};function g(rt,gt){var it=new k;D(rt,it),process.nextTick(gt,it)}function C(rt,gt,it,st){var xt;return it===null?xt=new d:typeof it!="string"&&!gt.objectMode&&(xt=new m("chunk",["string","Buffer"],it)),xt?(D(rt,xt),process.nextTick(st,xt),!1):!0}p.prototype.write=function(rt,gt,it){var st=this._writableState,xt=!1,ot=!st.objectMode&&l(rt);return ot&&!n.isBuffer(rt)&&(rt=a(rt)),typeof gt=="function"&&(it=gt,gt=null),ot?gt="buffer":gt||(gt=st.defaultEncoding),typeof it!="function"&&(it=E),st.ending?g(this,it):(ot||C(this,st,rt,it))&&(st.pendingcb++,xt=N(this,st,ot,rt,gt,it)),xt},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var rt=this._writableState;rt.corked&&(rt.corked--,!rt.writing&&!rt.corked&&!rt.bufferProcessing&&rt.bufferedRequest&&q(this,rt))},p.prototype.setDefaultEncoding=function(rt){if(typeof rt=="string"&&(rt=rt.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((rt+"").toLowerCase())>-1))throw new w(rt);return this._writableState.defaultEncoding=rt,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function S(rt,gt,it){return!rt.objectMode&&rt.decodeStrings!==!1&&typeof gt=="string"&&(gt=n.from(gt,it)),gt}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(rt,gt,it,st,xt,ot){if(!it){var J=S(gt,st,xt);st!==J&&(it=!0,xt="buffer",st=J)}var mt=gt.objectMode?1:st.length;gt.length+=mt;var dt=gt.length{var f=Object.keys||function(c){var s=[];for(var h in c)s.push(h);return s};Y.exports=a;var y=VP(),z=$P();for(sy()(a,y),P=f(z.prototype),i=0;i{var f=yb(),y=f.Buffer;function z(n,i){for(var a in n)i[a]=n[a]}y.from&&y.alloc&&y.allocUnsafe&&y.allocUnsafeSlow?Y.exports=f:(z(f,et),et.Buffer=P);function P(n,i,a){return y(n,i,a)}P.prototype=Object.create(y.prototype),z(y,P),P.from=function(n,i,a){if(typeof n=="number")throw new TypeError("Argument must not be a number");return y(n,i,a)},P.alloc=function(n,i,a){if(typeof n!="number")throw new TypeError("Argument must be a number");var l=y(n);return i!==void 0?typeof a=="string"?l.fill(i,a):l.fill(i):l.fill(0),l},P.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return y(n)},P.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(n)}}),HP=It(et=>{var Y=MZ().Buffer,f=Y.isEncoding||function(A){switch(A=""+A,A&&A.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function y(A){if(!A)return"utf8";for(var d;;)switch(A){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return A;default:if(d)return;A=(""+A).toLowerCase(),d=!0}}function z(A){var d=y(A);if(typeof d!="string"&&(Y.isEncoding===f||!f(A)))throw new Error("Unknown encoding: "+A);return d||A}et.StringDecoder=P;function P(A){this.encoding=z(A);var d;switch(this.encoding){case"utf16le":this.text=s,this.end=h,d=4;break;case"utf8":this.fillLast=l,d=4;break;case"base64":this.text=m,this.end=b,d=3;break;default:this.write=x,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y.allocUnsafe(d)}P.prototype.write=function(A){if(A.length===0)return"";var d,k;if(this.lastNeed){if(d=this.fillLast(A),d===void 0)return"";k=this.lastNeed,this.lastNeed=0}else k=0;return k>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function i(A,d,k){var w=d.length-1;if(w=0?(D>0&&(A.lastNeed=D-1),D):--w=0?(D>0&&(A.lastNeed=D-2),D):--w=0?(D>0&&(D===2?D=0:A.lastNeed=D-3),D):0))}function a(A,d,k){if((d[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&d.length>1){if((d[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&d.length>2&&(d[2]&192)!==128)return A.lastNeed=2,"�"}}function l(A){var d=this.lastTotal-this.lastNeed,k=a(this,A);if(k!==void 0)return k;if(this.lastNeed<=A.length)return A.copy(this.lastChar,d,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,d,0,A.length),this.lastNeed-=A.length}function o(A,d){var k=i(this,A,d);if(!this.lastNeed)return A.toString("utf8",d);this.lastTotal=k;var w=A.length-(k-this.lastNeed);return A.copy(this.lastChar,0,w),A.toString("utf8",d,w)}function c(A){var d=A&&A.length?this.write(A):"";return this.lastNeed?d+"�":d}function s(A,d){if((A.length-d)%2===0){var k=A.toString("utf16le",d);if(k){var w=k.charCodeAt(k.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],k.slice(0,-1)}return k}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",d,A.length-1)}function h(A){var d=A&&A.length?this.write(A):"";if(this.lastNeed){var k=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,k)}return d}function m(A,d){var k=(A.length-d)%3;return k===0?A.toString("base64",d):(this.lastNeed=3-k,this.lastTotal=3,k===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",d,A.length-k))}function b(A){var d=A&&A.length?this.write(A):"";return this.lastNeed?d+this.lastChar.toString("base64",0,3-this.lastNeed):d}function x(A){return A.toString(this.encoding)}function _(A){return A&&A.length?this.write(A):""}}),uC=It((et,Y)=>{var f=xb().codes.ERR_STREAM_PREMATURE_CLOSE;function y(i){var a=!1;return function(){if(!a){a=!0;for(var l=arguments.length,o=new Array(l),c=0;c{var f;function y(d,k,w){return k in d?Object.defineProperty(d,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):d[k]=w,d}var z=uC(),P=Symbol("lastResolve"),n=Symbol("lastReject"),i=Symbol("error"),a=Symbol("ended"),l=Symbol("lastPromise"),o=Symbol("handlePromise"),c=Symbol("stream");function s(d,k){return{value:d,done:k}}function h(d){var k=d[P];if(k!==null){var w=d[c].read();w!==null&&(d[l]=null,d[P]=null,d[n]=null,k(s(w,!1)))}}function m(d){process.nextTick(h,d)}function b(d,k){return function(w,D){d.then(function(){if(k[a]){w(s(void 0,!0));return}k[o](w,D)},D)}}var x=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((f={get stream(){return this[c]},next:function(){var d=this,k=this[i];if(k!==null)return Promise.reject(k);if(this[a])return Promise.resolve(s(void 0,!0));if(this[c].destroyed)return new Promise(function(I,M){process.nextTick(function(){d[i]?M(d[i]):I(s(void 0,!0))})});var w=this[l],D;if(w)D=new Promise(b(w,this));else{var E=this[c].read();if(E!==null)return Promise.resolve(s(E,!1));D=new Promise(this[o])}return this[l]=D,D}},y(f,Symbol.asyncIterator,function(){return this}),y(f,"return",function(){var d=this;return new Promise(function(k,w){d[c].destroy(null,function(D){if(D){w(D);return}k(s(void 0,!0))})})}),f),x),A=function(d){var k,w=Object.create(_,(k={},y(k,c,{value:d,writable:!0}),y(k,P,{value:null,writable:!0}),y(k,n,{value:null,writable:!0}),y(k,i,{value:null,writable:!0}),y(k,a,{value:d._readableState.endEmitted,writable:!0}),y(k,o,{value:function(D,E){var I=w[c].read();I?(w[l]=null,w[P]=null,w[n]=null,D(s(I,!1))):(w[P]=D,w[n]=E)},writable:!0}),k));return w[l]=null,z(d,function(D){if(D&&D.code!=="ERR_STREAM_PREMATURE_CLOSE"){var E=w[n];E!==null&&(w[l]=null,w[P]=null,w[n]=null,E(D)),w[i]=D;return}var I=w[P];I!==null&&(w[l]=null,w[P]=null,w[n]=null,I(s(void 0,!0))),w[a]=!0}),d.on("readable",m.bind(null,w)),w};Y.exports=A}),LZ=It((et,Y)=>{Y.exports=function(){throw new Error("Readable.from is not available in the browser")}}),VP=It((et,Y)=>{Y.exports=g;var f;g.ReadableState=p,Wg().EventEmitter;var y=function(ot,J){return ot.listeners(J).length},z=MP(),P=yb().Buffer,n=window.Uint8Array||function(){};function i(ot){return P.from(ot)}function a(ot){return P.isBuffer(ot)||ot instanceof n}var l=NP(),o;l&&l.debuglog?o=l.debuglog("stream"):o=function(){};var c=CZ(),s=jP(),h=UP(),m=h.getHighWaterMark,b=xb().codes,x=b.ERR_INVALID_ARG_TYPE,_=b.ERR_STREAM_PUSH_AFTER_EOF,A=b.ERR_METHOD_NOT_IMPLEMENTED,d=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,k,w,D;sy()(g,z);var E=s.errorOrDestroy,I=["error","close","destroy","pause","resume"];function M(ot,J,mt){if(typeof ot.prependListener=="function")return ot.prependListener(J,mt);!ot._events||!ot._events[J]?ot.on(J,mt):Array.isArray(ot._events[J])?ot._events[J].unshift(mt):ot._events[J]=[mt,ot._events[J]]}function p(ot,J,mt){f=f||bb(),ot=ot||{},typeof mt!="boolean"&&(mt=J instanceof f),this.objectMode=!!ot.objectMode,mt&&(this.objectMode=this.objectMode||!!ot.readableObjectMode),this.highWaterMark=m(this,ot,"readableHighWaterMark",mt),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ot.emitClose!==!1,this.autoDestroy=!!ot.autoDestroy,this.destroyed=!1,this.defaultEncoding=ot.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ot.encoding&&(k||(k=HP().StringDecoder),this.decoder=new k(ot.encoding),this.encoding=ot.encoding)}function g(ot){if(f=f||bb(),!(this instanceof g))return new g(ot);var J=this instanceof f;this._readableState=new p(ot,this,J),this.readable=!0,ot&&(typeof ot.read=="function"&&(this._read=ot.read),typeof ot.destroy=="function"&&(this._destroy=ot.destroy)),z.call(this)}Object.defineProperty(g.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ot){this._readableState&&(this._readableState.destroyed=ot)}}),g.prototype.destroy=s.destroy,g.prototype._undestroy=s.undestroy,g.prototype._destroy=function(ot,J){J(ot)},g.prototype.push=function(ot,J){var mt=this._readableState,dt;return mt.objectMode?dt=!0:typeof ot=="string"&&(J=J||mt.defaultEncoding,J!==mt.encoding&&(ot=P.from(ot,J),J=""),dt=!0),C(this,ot,J,!1,dt)},g.prototype.unshift=function(ot){return C(this,ot,null,!0,!1)};function C(ot,J,mt,dt,Ct){o("readableAddChunk",J);var Rt=ot._readableState;if(J===null)Rt.reading=!1,W(ot,Rt);else{var Bt;if(Ct||(Bt=N(Rt,J)),Bt)E(ot,Bt);else if(Rt.objectMode||J&&J.length>0)if(typeof J!="string"&&!Rt.objectMode&&Object.getPrototypeOf(J)!==P.prototype&&(J=i(J)),dt)Rt.endEmitted?E(ot,new d):S(ot,Rt,J,!0);else if(Rt.ended)E(ot,new _);else{if(Rt.destroyed)return!1;Rt.reading=!1,Rt.decoder&&!mt?(J=Rt.decoder.write(J),Rt.objectMode||J.length!==0?S(ot,Rt,J,!1):q(ot,Rt)):S(ot,Rt,J,!1)}else dt||(Rt.reading=!1,q(ot,Rt))}return!Rt.ended&&(Rt.length=B?ot=B:(ot--,ot|=ot>>>1,ot|=ot>>>2,ot|=ot>>>4,ot|=ot>>>8,ot|=ot>>>16,ot++),ot}function V(ot,J){return ot<=0||J.length===0&&J.ended?0:J.objectMode?1:ot!==ot?J.flowing&&J.length?J.buffer.head.data.length:J.length:(ot>J.highWaterMark&&(J.highWaterMark=U(ot)),ot<=J.length?ot:J.ended?J.length:(J.needReadable=!0,0))}g.prototype.read=function(ot){o("read",ot),ot=parseInt(ot,10);var J=this._readableState,mt=ot;if(ot!==0&&(J.emittedReadable=!1),ot===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return o("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?it(this):F(this),null;if(ot=V(ot,J),ot===0&&J.ended)return J.length===0&&it(this),null;var dt=J.needReadable;o("need readable",dt),(J.length===0||J.length-ot0?Ct=gt(ot,J):Ct=null,Ct===null?(J.needReadable=J.length<=J.highWaterMark,ot=0):(J.length-=ot,J.awaitDrain=0),J.length===0&&(J.ended||(J.needReadable=!0),mt!==ot&&J.ended&&it(this)),Ct!==null&&this.emit("data",Ct),Ct};function W(ot,J){if(o("onEofChunk"),!J.ended){if(J.decoder){var mt=J.decoder.end();mt&&mt.length&&(J.buffer.push(mt),J.length+=J.objectMode?1:mt.length)}J.ended=!0,J.sync?F(ot):(J.needReadable=!1,J.emittedReadable||(J.emittedReadable=!0,H(ot)))}}function F(ot){var J=ot._readableState;o("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(o("emitReadable",J.flowing),J.emittedReadable=!0,process.nextTick(H,ot))}function H(ot){var J=ot._readableState;o("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&(J.length||J.ended)&&(ot.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,rt(ot)}function q(ot,J){J.readingMore||(J.readingMore=!0,process.nextTick(G,ot,J))}function G(ot,J){for(;!J.reading&&!J.ended&&(J.length1&&xt(dt.pipes,ot)!==-1)&&!ee&&(o("false write response, pause",dt.awaitDrain),dt.awaitDrain++),mt.pause())}function ye(Lt){o("onerror",Lt),Ot(),ot.removeListener("error",ye),y(ot,"error")===0&&E(ot,Lt)}M(ot,"error",ye);function ue(){ot.removeListener("finish",Mt),Ot()}ot.once("close",ue);function Mt(){o("onfinish"),ot.removeListener("close",ue),Ot()}ot.once("finish",Mt);function Ot(){o("unpipe"),mt.unpipe(ot)}return ot.emit("pipe",mt),dt.flowing||(o("pipe resume"),mt.resume()),ot};function tt(ot){return function(){var J=ot._readableState;o("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&y(ot,"data")&&(J.flowing=!0,rt(ot))}}g.prototype.unpipe=function(ot){var J=this._readableState,mt={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return ot&&ot!==J.pipes?this:(ot||(ot=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,ot&&ot.emit("unpipe",this,mt),this);if(!ot){var dt=J.pipes,Ct=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var Rt=0;Rt0,dt.flowing!==!1&&this.resume()):ot==="readable"&&!dt.endEmitted&&!dt.readableListening&&(dt.readableListening=dt.needReadable=!0,dt.flowing=!1,dt.emittedReadable=!1,o("on readable",dt.length,dt.reading),dt.length?F(this):dt.reading||process.nextTick(bt,this)),mt},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(ot,J){var mt=z.prototype.removeListener.call(this,ot,J);return ot==="readable"&&process.nextTick(ht,this),mt},g.prototype.removeAllListeners=function(ot){var J=z.prototype.removeAllListeners.apply(this,arguments);return(ot==="readable"||ot===void 0)&&process.nextTick(ht,this),J};function ht(ot){var J=ot._readableState;J.readableListening=ot.listenerCount("readable")>0,J.resumeScheduled&&!J.paused?J.flowing=!0:ot.listenerCount("data")>0&&ot.resume()}function bt(ot){o("readable nexttick read 0"),ot.read(0)}g.prototype.resume=function(){var ot=this._readableState;return ot.flowing||(o("resume"),ot.flowing=!ot.readableListening,vt(this,ot)),ot.paused=!1,this};function vt(ot,J){J.resumeScheduled||(J.resumeScheduled=!0,process.nextTick(ut,ot,J))}function ut(ot,J){o("resume",J.reading),J.reading||ot.read(0),J.resumeScheduled=!1,ot.emit("resume"),rt(ot),J.flowing&&!J.reading&&ot.read(0)}g.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function rt(ot){var J=ot._readableState;for(o("flow",J.flowing);J.flowing&&ot.read()!==null;);}g.prototype.wrap=function(ot){var J=this,mt=this._readableState,dt=!1;ot.on("end",function(){if(o("wrapped end"),mt.decoder&&!mt.ended){var Bt=mt.decoder.end();Bt&&Bt.length&&J.push(Bt)}J.push(null)}),ot.on("data",function(Bt){if(o("wrapped data"),mt.decoder&&(Bt=mt.decoder.write(Bt)),!(mt.objectMode&&Bt==null)&&!(!mt.objectMode&&(!Bt||!Bt.length))){var Zt=J.push(Bt);Zt||(dt=!0,ot.pause())}});for(var Ct in ot)this[Ct]===void 0&&typeof ot[Ct]=="function"&&(this[Ct]=function(Bt){return function(){return ot[Bt].apply(ot,arguments)}}(Ct));for(var Rt=0;Rt=J.length?(J.decoder?mt=J.buffer.join(""):J.buffer.length===1?mt=J.buffer.first():mt=J.buffer.concat(J.length),J.buffer.clear()):mt=J.buffer.consume(ot,J.decoder),mt}function it(ot){var J=ot._readableState;o("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,process.nextTick(st,J,ot))}function st(ot,J){if(o("endReadableNT",ot.endEmitted,ot.length),!ot.endEmitted&&ot.length===0&&(ot.endEmitted=!0,J.readable=!1,J.emit("end"),ot.autoDestroy)){var mt=J._writableState;(!mt||mt.autoDestroy&&mt.finished)&&J.destroy()}}typeof Symbol=="function"&&(g.from=function(ot,J){return D===void 0&&(D=LZ()),D(g,ot,J)});function xt(ot,J){for(var mt=0,dt=ot.length;mt{Y.exports=l;var f=xb().codes,y=f.ERR_METHOD_NOT_IMPLEMENTED,z=f.ERR_MULTIPLE_CALLBACK,P=f.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=f.ERR_TRANSFORM_WITH_LENGTH_0,i=bb();sy()(l,i);function a(s,h){var m=this._transformState;m.transforming=!1;var b=m.writecb;if(b===null)return this.emit("error",new z);m.writechunk=null,m.writecb=null,h!=null&&this.push(h),b(s);var x=this._readableState;x.reading=!1,(x.needReadable||x.length{Y.exports=y;var f=WP();sy()(y,f);function y(z){if(!(this instanceof y))return new y(z);f.call(this,z)}y.prototype._transform=function(z,P,n){n(null,z)}}),IZ=It((et,Y)=>{var f;function y(m){var b=!1;return function(){b||(b=!0,m.apply(void 0,arguments))}}var z=xb().codes,P=z.ERR_MISSING_ARGS,n=z.ERR_STREAM_DESTROYED;function i(m){if(m)throw m}function a(m){return m.setHeader&&typeof m.abort=="function"}function l(m,b,x,_){_=y(_);var A=!1;m.on("close",function(){A=!0}),f===void 0&&(f=uC()),f(m,{readable:b,writable:x},function(k){if(k)return _(k);A=!0,_()});var d=!1;return function(k){if(!A&&!d){if(d=!0,a(m))return m.abort();if(typeof m.destroy=="function")return m.destroy();_(k||new n("pipe"))}}}function o(m){m()}function c(m,b){return m.pipe(b)}function s(m){return!m.length||typeof m[m.length-1]!="function"?i:m.pop()}function h(){for(var m=arguments.length,b=new Array(m),x=0;x0;return l(k,D,E,function(I){A||(A=I),I&&d.forEach(o),!D&&(d.forEach(o),_(A))})});return b.reduce(c)}Y.exports=h}),DZ=It((et,Y)=>{Y.exports=z;var f=Wg().EventEmitter,y=sy();y(z,f),z.Readable=VP(),z.Writable=$P(),z.Duplex=bb(),z.Transform=WP(),z.PassThrough=PZ(),z.finished=uC(),z.pipeline=IZ(),z.Stream=z;function z(){f.call(this)}z.prototype.pipe=function(P,n){var i=this;function a(b){P.writable&&P.write(b)===!1&&i.pause&&i.pause()}i.on("data",a);function l(){i.readable&&i.resume&&i.resume()}P.on("drain",l),!P._isStdio&&(!n||n.end!==!1)&&(i.on("end",c),i.on("close",s));var o=!1;function c(){o||(o=!0,P.end())}function s(){o||(o=!0,typeof P.destroy=="function"&&P.destroy())}function h(b){if(m(),f.listenerCount(this,"error")===0)throw b}i.on("error",h),P.on("error",h);function m(){i.removeListener("data",a),P.removeListener("drain",l),i.removeListener("end",c),i.removeListener("close",s),i.removeListener("error",h),P.removeListener("error",h),i.removeListener("end",m),i.removeListener("close",m),P.removeListener("close",m)}return i.on("end",m),i.on("close",m),P.on("close",m),P.emit("pipe",i),P}}),jw=It(et=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var tt=Object.keys(G),ht={},bt=0;bt=vt)return it;switch(it){case"%s":return String(bt[ht++]);case"%d":return Number(bt[ht++]);case"%j":try{return JSON.stringify(bt[ht++])}catch{return"[Circular]"}default:return it}}),rt=bt[ht];ht"u")return function(){return et.deprecate(G,tt).apply(this,arguments)};var ht=!1;function bt(){if(!ht){if(process.throwDeprecation)throw new Error(tt);process.traceDeprecation?console.trace(tt):console.error(tt),ht=!0}return G.apply(this,arguments)}return bt};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;et.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var tt=process.pid;y[G]=function(){var ht=et.format.apply(et,arguments);console.error("%s %d: %s",G,tt,ht)}}else y[G]=function(){};return y[G]};function n(G,tt){var ht={seen:[],stylize:a};return arguments.length>=3&&(ht.depth=arguments[2]),arguments.length>=4&&(ht.colors=arguments[3]),_(tt)?ht.showHidden=tt:tt&&et._extend(ht,tt),E(ht.showHidden)&&(ht.showHidden=!1),E(ht.depth)&&(ht.depth=2),E(ht.colors)&&(ht.colors=!1),E(ht.customInspect)&&(ht.customInspect=!0),ht.colors&&(ht.stylize=i),o(ht,G,ht.depth)}et.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function i(G,tt){var ht=n.styles[tt];return ht?"\x1B["+n.colors[ht][0]+"m"+G+"\x1B["+n.colors[ht][1]+"m":G}function a(G,tt){return G}function l(G){var tt={};return G.forEach(function(ht,bt){tt[ht]=!0}),tt}function o(G,tt,ht){if(G.customInspect&&tt&&C(tt.inspect)&&tt.inspect!==et.inspect&&!(tt.constructor&&tt.constructor.prototype===tt)){var bt=tt.inspect(ht,G);return w(bt)||(bt=o(G,bt,ht)),bt}var vt=c(G,tt);if(vt)return vt;var ut=Object.keys(tt),rt=l(ut);if(G.showHidden&&(ut=Object.getOwnPropertyNames(tt)),g(tt)&&(ut.indexOf("message")>=0||ut.indexOf("description")>=0))return s(tt);if(ut.length===0){if(C(tt)){var gt=tt.name?": "+tt.name:"";return G.stylize("[Function"+gt+"]","special")}if(I(tt))return G.stylize(RegExp.prototype.toString.call(tt),"regexp");if(p(tt))return G.stylize(Date.prototype.toString.call(tt),"date");if(g(tt))return s(tt)}var it="",st=!1,xt=["{","}"];if(x(tt)&&(st=!0,xt=["[","]"]),C(tt)){var ot=tt.name?": "+tt.name:"";it=" [Function"+ot+"]"}if(I(tt)&&(it=" "+RegExp.prototype.toString.call(tt)),p(tt)&&(it=" "+Date.prototype.toUTCString.call(tt)),g(tt)&&(it=" "+s(tt)),ut.length===0&&(!st||tt.length==0))return xt[0]+it+xt[1];if(ht<0)return I(tt)?G.stylize(RegExp.prototype.toString.call(tt),"regexp"):G.stylize("[Object]","special");G.seen.push(tt);var J;return st?J=h(G,tt,ht,rt,ut):J=ut.map(function(mt){return m(G,tt,ht,rt,mt,st)}),G.seen.pop(),b(J,it,xt)}function c(G,tt){if(E(tt))return G.stylize("undefined","undefined");if(w(tt)){var ht="'"+JSON.stringify(tt).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(ht,"string")}if(k(tt))return G.stylize(""+tt,"number");if(_(tt))return G.stylize(""+tt,"boolean");if(A(tt))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,tt,ht,bt,vt){for(var ut=[],rt=0,gt=tt.length;rt"u"}et.isPrimitive=S,et.isBuffer=FP();function N(G){return Object.prototype.toString.call(G)}function B(G){return G<10?"0"+G.toString(10):G.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var G=new Date,tt=[B(G.getHours()),B(G.getMinutes()),B(G.getSeconds())].join(":");return[G.getDate(),U[G.getMonth()],tt].join(" ")}et.log=function(){console.log("%s - %s",V(),et.format.apply(et,arguments))},et.inherits=sy(),et._extend=function(G,tt){if(!tt||!M(tt))return G;for(var ht=Object.keys(tt),bt=ht.length;bt--;)G[ht[bt]]=tt[ht[bt]];return G};function W(G,tt){return Object.prototype.hasOwnProperty.call(G,tt)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;et.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&G[F]){var tt=G[F];if(typeof tt!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(tt,F,{value:tt,enumerable:!1,writable:!1,configurable:!0}),tt}function tt(){for(var ht,bt,vt=new Promise(function(gt,it){ht=gt,bt=it}),ut=[],rt=0;rt{function f(m,b){var x=Object.keys(m);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(m);b&&(_=_.filter(function(A){return Object.getOwnPropertyDescriptor(m,A).enumerable})),x.push.apply(x,_)}return x}function y(m){for(var b=1;b0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(b){var x={data:b,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var x=this.head,_=""+x.data;x=x.next;)_+=b+x.data;return _}},{key:"concat",value:function(b){if(this.length===0)return l.alloc(0);for(var x=l.allocUnsafe(b>>>0),_=this.head,A=0;_;)h(_.data,x,A),A+=_.data.length,_=_.next;return x}},{key:"consume",value:function(b,x){var _;return bd.length?d.length:b;if(k===d.length?A+=d:A+=d.slice(0,b),b-=k,b===0){k===d.length?(++_,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=d.slice(k));break}++_}return this.length-=_,A}},{key:"_getBuffer",value:function(b){var x=l.allocUnsafe(b),_=this.head,A=1;for(_.data.copy(x),b-=_.data.length;_=_.next;){var d=_.data,k=b>d.length?d.length:b;if(d.copy(x,x.length-b,0,k),b-=k,b===0){k===d.length?(++A,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=d.slice(k));break}++A}return this.length-=A,x}},{key:s,value:function(b,x){return c(this,y({},x,{depth:0,customInspect:!1}))}}]),m}()}),jP=It((et,Y)=>{function f(a,l){var o=this,c=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return c||s?(l?l(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,a)):process.nextTick(n,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(h){!l&&h?o._writableState?o._writableState.errorEmitted?process.nextTick(z,o):(o._writableState.errorEmitted=!0,process.nextTick(y,o,h)):process.nextTick(y,o,h):l?(process.nextTick(z,o),l(h)):process.nextTick(z,o)}),this)}function y(a,l){n(a,l),z(a)}function z(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function P(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function n(a,l){a.emit("error",l)}function i(a,l){var o=a._readableState,c=a._writableState;o&&o.autoDestroy||c&&c.autoDestroy?a.destroy(l):a.emit("error",l)}Y.exports={destroy:f,undestroy:P,errorOrDestroy:i}}),bb=It((et,Y)=>{function f(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,l.__proto__=o}var y={};function z(l,o,c){c||(c=Error);function s(m,b,x){return typeof o=="string"?o:o(m,b,x)}var h=function(m){f(b,m);function b(x,_,A){return m.call(this,s(x,_,A))||this}return b}(c);h.prototype.name=c.name,h.prototype.code=l,y[l]=h}function P(l,o){if(Array.isArray(l)){var c=l.length;return l=l.map(function(s){return String(s)}),c>2?"one of ".concat(o," ").concat(l.slice(0,c-1).join(", "),", or ")+l[c-1]:c===2?"one of ".concat(o," ").concat(l[0]," or ").concat(l[1]):"of ".concat(o," ").concat(l[0])}else return"of ".concat(o," ").concat(String(l))}function n(l,o,c){return l.substr(0,o.length)===o}function i(l,o,c){return(c===void 0||c>l.length)&&(c=l.length),l.substring(c-o.length,c)===o}function a(l,o,c){return typeof c!="number"&&(c=0),c+o.length>l.length?!1:l.indexOf(o,c)!==-1}z("ERR_INVALID_OPT_VALUE",function(l,o){return'The value "'+o+'" is invalid for option "'+l+'"'},TypeError),z("ERR_INVALID_ARG_TYPE",function(l,o,c){var s;typeof o=="string"&&n(o,"not ")?(s="must not be",o=o.replace(/^not /,"")):s="must be";var h;if(i(l," argument"))h="The ".concat(l," ").concat(s," ").concat(P(o,"type"));else{var m=a(l,".")?"property":"argument";h='The "'.concat(l,'" ').concat(m," ").concat(s," ").concat(P(o,"type"))}return h+=". Received type ".concat(typeof c),h},TypeError),z("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),z("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),z("ERR_STREAM_PREMATURE_CLOSE","Premature close"),z("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),z("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),z("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),z("ERR_STREAM_WRITE_AFTER_END","write after end"),z("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),z("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),z("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Y.exports.codes=y}),UP=It((et,Y)=>{var f=bb().codes.ERR_INVALID_OPT_VALUE;function y(P,n,i){return P.highWaterMark!=null?P.highWaterMark:n?P[i]:null}function z(P,n,i,a){var l=y(n,a,i);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var o=a?i:"highWaterMark";throw new f(o,l)}return Math.floor(l)}return P.objectMode?16:16*1024}Y.exports={getHighWaterMark:z}}),AZ=It((et,Y)=>{Y.exports=f;function f(z,P){if(y("noDeprecation"))return z;var n=!1;function i(){if(!n){if(y("throwDeprecation"))throw new Error(P);y("traceDeprecation")?console.trace(P):console.warn(P),n=!0}return z.apply(this,arguments)}return i}function y(z){try{if(!window.localStorage)return!1}catch{return!1}var P=window.localStorage[z];return P==null?!1:String(P).toLowerCase()==="true"}}),$P=It((et,Y)=>{Y.exports=p;function f(rt){var gt=this;this.next=null,this.entry=null,this.finish=function(){ut(gt,rt)}}var y;p.WritableState=I;var z={deprecate:AZ()},P=MP(),n=_b().Buffer,i=window.Uint8Array||function(){};function a(rt){return n.from(rt)}function l(rt){return n.isBuffer(rt)||rt instanceof i}var o=jP(),c=UP(),s=c.getHighWaterMark,h=bb().codes,m=h.ERR_INVALID_ARG_TYPE,b=h.ERR_METHOD_NOT_IMPLEMENTED,x=h.ERR_MULTIPLE_CALLBACK,_=h.ERR_STREAM_CANNOT_PIPE,A=h.ERR_STREAM_DESTROYED,d=h.ERR_STREAM_NULL_VALUES,k=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,D=o.errorOrDestroy;sy()(p,P);function E(){}function I(rt,gt,it){y=y||wb(),rt=rt||{},typeof it!="boolean"&&(it=gt instanceof y),this.objectMode=!!rt.objectMode,it&&(this.objectMode=this.objectMode||!!rt.writableObjectMode),this.highWaterMark=s(this,rt,"writableHighWaterMark",it),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var st=rt.decodeStrings===!1;this.decodeStrings=!st,this.defaultEncoding=rt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xt){W(gt,xt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=rt.emitClose!==!1,this.autoDestroy=!!rt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}I.prototype.getBuffer=function(){for(var rt=this.bufferedRequest,gt=[];rt;)gt.push(rt),rt=rt.next;return gt},function(){try{Object.defineProperty(I.prototype,"buffer",{get:z.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var M;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(rt){return M.call(this,rt)?!0:this!==p?!1:rt&&rt._writableState instanceof I}})):M=function(rt){return rt instanceof this};function p(rt){y=y||wb();var gt=this instanceof y;if(!gt&&!M.call(p,this))return new p(rt);this._writableState=new I(rt,this,gt),this.writable=!0,rt&&(typeof rt.write=="function"&&(this._write=rt.write),typeof rt.writev=="function"&&(this._writev=rt.writev),typeof rt.destroy=="function"&&(this._destroy=rt.destroy),typeof rt.final=="function"&&(this._final=rt.final)),P.call(this)}p.prototype.pipe=function(){D(this,new _)};function g(rt,gt){var it=new k;D(rt,it),process.nextTick(gt,it)}function C(rt,gt,it,st){var xt;return it===null?xt=new d:typeof it!="string"&&!gt.objectMode&&(xt=new m("chunk",["string","Buffer"],it)),xt?(D(rt,xt),process.nextTick(st,xt),!1):!0}p.prototype.write=function(rt,gt,it){var st=this._writableState,xt=!1,ot=!st.objectMode&&l(rt);return ot&&!n.isBuffer(rt)&&(rt=a(rt)),typeof gt=="function"&&(it=gt,gt=null),ot?gt="buffer":gt||(gt=st.defaultEncoding),typeof it!="function"&&(it=E),st.ending?g(this,it):(ot||C(this,st,rt,it))&&(st.pendingcb++,xt=N(this,st,ot,rt,gt,it)),xt},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var rt=this._writableState;rt.corked&&(rt.corked--,!rt.writing&&!rt.corked&&!rt.bufferProcessing&&rt.bufferedRequest&&q(this,rt))},p.prototype.setDefaultEncoding=function(rt){if(typeof rt=="string"&&(rt=rt.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((rt+"").toLowerCase())>-1))throw new w(rt);return this._writableState.defaultEncoding=rt,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function S(rt,gt,it){return!rt.objectMode&&rt.decodeStrings!==!1&&typeof gt=="string"&&(gt=n.from(gt,it)),gt}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(rt,gt,it,st,xt,ot){if(!it){var J=S(gt,st,xt);st!==J&&(it=!0,xt="buffer",st=J)}var mt=gt.objectMode?1:st.length;gt.length+=mt;var dt=gt.length{var f=Object.keys||function(c){var s=[];for(var h in c)s.push(h);return s};Y.exports=a;var y=VP(),z=$P();for(sy()(a,y),P=f(z.prototype),i=0;i{var f=_b(),y=f.Buffer;function z(n,i){for(var a in n)i[a]=n[a]}y.from&&y.alloc&&y.allocUnsafe&&y.allocUnsafeSlow?Y.exports=f:(z(f,et),et.Buffer=P);function P(n,i,a){return y(n,i,a)}P.prototype=Object.create(y.prototype),z(y,P),P.from=function(n,i,a){if(typeof n=="number")throw new TypeError("Argument must not be a number");return y(n,i,a)},P.alloc=function(n,i,a){if(typeof n!="number")throw new TypeError("Argument must be a number");var l=y(n);return i!==void 0?typeof a=="string"?l.fill(i,a):l.fill(i):l.fill(0),l},P.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return y(n)},P.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(n)}}),HP=It(et=>{var Y=MZ().Buffer,f=Y.isEncoding||function(A){switch(A=""+A,A&&A.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function y(A){if(!A)return"utf8";for(var d;;)switch(A){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return A;default:if(d)return;A=(""+A).toLowerCase(),d=!0}}function z(A){var d=y(A);if(typeof d!="string"&&(Y.isEncoding===f||!f(A)))throw new Error("Unknown encoding: "+A);return d||A}et.StringDecoder=P;function P(A){this.encoding=z(A);var d;switch(this.encoding){case"utf16le":this.text=s,this.end=h,d=4;break;case"utf8":this.fillLast=l,d=4;break;case"base64":this.text=m,this.end=b,d=3;break;default:this.write=x,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y.allocUnsafe(d)}P.prototype.write=function(A){if(A.length===0)return"";var d,k;if(this.lastNeed){if(d=this.fillLast(A),d===void 0)return"";k=this.lastNeed,this.lastNeed=0}else k=0;return k>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function i(A,d,k){var w=d.length-1;if(w=0?(D>0&&(A.lastNeed=D-1),D):--w=0?(D>0&&(A.lastNeed=D-2),D):--w=0?(D>0&&(D===2?D=0:A.lastNeed=D-3),D):0))}function a(A,d,k){if((d[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&d.length>1){if((d[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&d.length>2&&(d[2]&192)!==128)return A.lastNeed=2,"�"}}function l(A){var d=this.lastTotal-this.lastNeed,k=a(this,A);if(k!==void 0)return k;if(this.lastNeed<=A.length)return A.copy(this.lastChar,d,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,d,0,A.length),this.lastNeed-=A.length}function o(A,d){var k=i(this,A,d);if(!this.lastNeed)return A.toString("utf8",d);this.lastTotal=k;var w=A.length-(k-this.lastNeed);return A.copy(this.lastChar,0,w),A.toString("utf8",d,w)}function c(A){var d=A&&A.length?this.write(A):"";return this.lastNeed?d+"�":d}function s(A,d){if((A.length-d)%2===0){var k=A.toString("utf16le",d);if(k){var w=k.charCodeAt(k.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],k.slice(0,-1)}return k}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",d,A.length-1)}function h(A){var d=A&&A.length?this.write(A):"";if(this.lastNeed){var k=this.lastTotal-this.lastNeed;return d+this.lastChar.toString("utf16le",0,k)}return d}function m(A,d){var k=(A.length-d)%3;return k===0?A.toString("base64",d):(this.lastNeed=3-k,this.lastTotal=3,k===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",d,A.length-k))}function b(A){var d=A&&A.length?this.write(A):"";return this.lastNeed?d+this.lastChar.toString("base64",0,3-this.lastNeed):d}function x(A){return A.toString(this.encoding)}function _(A){return A&&A.length?this.write(A):""}}),uC=It((et,Y)=>{var f=bb().codes.ERR_STREAM_PREMATURE_CLOSE;function y(i){var a=!1;return function(){if(!a){a=!0;for(var l=arguments.length,o=new Array(l),c=0;c{var f;function y(d,k,w){return k in d?Object.defineProperty(d,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):d[k]=w,d}var z=uC(),P=Symbol("lastResolve"),n=Symbol("lastReject"),i=Symbol("error"),a=Symbol("ended"),l=Symbol("lastPromise"),o=Symbol("handlePromise"),c=Symbol("stream");function s(d,k){return{value:d,done:k}}function h(d){var k=d[P];if(k!==null){var w=d[c].read();w!==null&&(d[l]=null,d[P]=null,d[n]=null,k(s(w,!1)))}}function m(d){process.nextTick(h,d)}function b(d,k){return function(w,D){d.then(function(){if(k[a]){w(s(void 0,!0));return}k[o](w,D)},D)}}var x=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((f={get stream(){return this[c]},next:function(){var d=this,k=this[i];if(k!==null)return Promise.reject(k);if(this[a])return Promise.resolve(s(void 0,!0));if(this[c].destroyed)return new Promise(function(I,M){process.nextTick(function(){d[i]?M(d[i]):I(s(void 0,!0))})});var w=this[l],D;if(w)D=new Promise(b(w,this));else{var E=this[c].read();if(E!==null)return Promise.resolve(s(E,!1));D=new Promise(this[o])}return this[l]=D,D}},y(f,Symbol.asyncIterator,function(){return this}),y(f,"return",function(){var d=this;return new Promise(function(k,w){d[c].destroy(null,function(D){if(D){w(D);return}k(s(void 0,!0))})})}),f),x),A=function(d){var k,w=Object.create(_,(k={},y(k,c,{value:d,writable:!0}),y(k,P,{value:null,writable:!0}),y(k,n,{value:null,writable:!0}),y(k,i,{value:null,writable:!0}),y(k,a,{value:d._readableState.endEmitted,writable:!0}),y(k,o,{value:function(D,E){var I=w[c].read();I?(w[l]=null,w[P]=null,w[n]=null,D(s(I,!1))):(w[P]=D,w[n]=E)},writable:!0}),k));return w[l]=null,z(d,function(D){if(D&&D.code!=="ERR_STREAM_PREMATURE_CLOSE"){var E=w[n];E!==null&&(w[l]=null,w[P]=null,w[n]=null,E(D)),w[i]=D;return}var I=w[P];I!==null&&(w[l]=null,w[P]=null,w[n]=null,I(s(void 0,!0))),w[a]=!0}),d.on("readable",m.bind(null,w)),w};Y.exports=A}),LZ=It((et,Y)=>{Y.exports=function(){throw new Error("Readable.from is not available in the browser")}}),VP=It((et,Y)=>{Y.exports=g;var f;g.ReadableState=p,Wg().EventEmitter;var y=function(ot,J){return ot.listeners(J).length},z=MP(),P=_b().Buffer,n=window.Uint8Array||function(){};function i(ot){return P.from(ot)}function a(ot){return P.isBuffer(ot)||ot instanceof n}var l=NP(),o;l&&l.debuglog?o=l.debuglog("stream"):o=function(){};var c=CZ(),s=jP(),h=UP(),m=h.getHighWaterMark,b=bb().codes,x=b.ERR_INVALID_ARG_TYPE,_=b.ERR_STREAM_PUSH_AFTER_EOF,A=b.ERR_METHOD_NOT_IMPLEMENTED,d=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,k,w,D;sy()(g,z);var E=s.errorOrDestroy,I=["error","close","destroy","pause","resume"];function M(ot,J,mt){if(typeof ot.prependListener=="function")return ot.prependListener(J,mt);!ot._events||!ot._events[J]?ot.on(J,mt):Array.isArray(ot._events[J])?ot._events[J].unshift(mt):ot._events[J]=[mt,ot._events[J]]}function p(ot,J,mt){f=f||wb(),ot=ot||{},typeof mt!="boolean"&&(mt=J instanceof f),this.objectMode=!!ot.objectMode,mt&&(this.objectMode=this.objectMode||!!ot.readableObjectMode),this.highWaterMark=m(this,ot,"readableHighWaterMark",mt),this.buffer=new c,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ot.emitClose!==!1,this.autoDestroy=!!ot.autoDestroy,this.destroyed=!1,this.defaultEncoding=ot.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ot.encoding&&(k||(k=HP().StringDecoder),this.decoder=new k(ot.encoding),this.encoding=ot.encoding)}function g(ot){if(f=f||wb(),!(this instanceof g))return new g(ot);var J=this instanceof f;this._readableState=new p(ot,this,J),this.readable=!0,ot&&(typeof ot.read=="function"&&(this._read=ot.read),typeof ot.destroy=="function"&&(this._destroy=ot.destroy)),z.call(this)}Object.defineProperty(g.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ot){this._readableState&&(this._readableState.destroyed=ot)}}),g.prototype.destroy=s.destroy,g.prototype._undestroy=s.undestroy,g.prototype._destroy=function(ot,J){J(ot)},g.prototype.push=function(ot,J){var mt=this._readableState,dt;return mt.objectMode?dt=!0:typeof ot=="string"&&(J=J||mt.defaultEncoding,J!==mt.encoding&&(ot=P.from(ot,J),J=""),dt=!0),C(this,ot,J,!1,dt)},g.prototype.unshift=function(ot){return C(this,ot,null,!0,!1)};function C(ot,J,mt,dt,Ct){o("readableAddChunk",J);var Rt=ot._readableState;if(J===null)Rt.reading=!1,W(ot,Rt);else{var Bt;if(Ct||(Bt=N(Rt,J)),Bt)E(ot,Bt);else if(Rt.objectMode||J&&J.length>0)if(typeof J!="string"&&!Rt.objectMode&&Object.getPrototypeOf(J)!==P.prototype&&(J=i(J)),dt)Rt.endEmitted?E(ot,new d):S(ot,Rt,J,!0);else if(Rt.ended)E(ot,new _);else{if(Rt.destroyed)return!1;Rt.reading=!1,Rt.decoder&&!mt?(J=Rt.decoder.write(J),Rt.objectMode||J.length!==0?S(ot,Rt,J,!1):q(ot,Rt)):S(ot,Rt,J,!1)}else dt||(Rt.reading=!1,q(ot,Rt))}return!Rt.ended&&(Rt.length=B?ot=B:(ot--,ot|=ot>>>1,ot|=ot>>>2,ot|=ot>>>4,ot|=ot>>>8,ot|=ot>>>16,ot++),ot}function V(ot,J){return ot<=0||J.length===0&&J.ended?0:J.objectMode?1:ot!==ot?J.flowing&&J.length?J.buffer.head.data.length:J.length:(ot>J.highWaterMark&&(J.highWaterMark=U(ot)),ot<=J.length?ot:J.ended?J.length:(J.needReadable=!0,0))}g.prototype.read=function(ot){o("read",ot),ot=parseInt(ot,10);var J=this._readableState,mt=ot;if(ot!==0&&(J.emittedReadable=!1),ot===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return o("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?it(this):F(this),null;if(ot=V(ot,J),ot===0&&J.ended)return J.length===0&&it(this),null;var dt=J.needReadable;o("need readable",dt),(J.length===0||J.length-ot0?Ct=gt(ot,J):Ct=null,Ct===null?(J.needReadable=J.length<=J.highWaterMark,ot=0):(J.length-=ot,J.awaitDrain=0),J.length===0&&(J.ended||(J.needReadable=!0),mt!==ot&&J.ended&&it(this)),Ct!==null&&this.emit("data",Ct),Ct};function W(ot,J){if(o("onEofChunk"),!J.ended){if(J.decoder){var mt=J.decoder.end();mt&&mt.length&&(J.buffer.push(mt),J.length+=J.objectMode?1:mt.length)}J.ended=!0,J.sync?F(ot):(J.needReadable=!1,J.emittedReadable||(J.emittedReadable=!0,H(ot)))}}function F(ot){var J=ot._readableState;o("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(o("emitReadable",J.flowing),J.emittedReadable=!0,process.nextTick(H,ot))}function H(ot){var J=ot._readableState;o("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&(J.length||J.ended)&&(ot.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,rt(ot)}function q(ot,J){J.readingMore||(J.readingMore=!0,process.nextTick(G,ot,J))}function G(ot,J){for(;!J.reading&&!J.ended&&(J.length1&&xt(dt.pipes,ot)!==-1)&&!ee&&(o("false write response, pause",dt.awaitDrain),dt.awaitDrain++),mt.pause())}function ye(Lt){o("onerror",Lt),Ot(),ot.removeListener("error",ye),y(ot,"error")===0&&E(ot,Lt)}M(ot,"error",ye);function ue(){ot.removeListener("finish",Mt),Ot()}ot.once("close",ue);function Mt(){o("onfinish"),ot.removeListener("close",ue),Ot()}ot.once("finish",Mt);function Ot(){o("unpipe"),mt.unpipe(ot)}return ot.emit("pipe",mt),dt.flowing||(o("pipe resume"),mt.resume()),ot};function tt(ot){return function(){var J=ot._readableState;o("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&y(ot,"data")&&(J.flowing=!0,rt(ot))}}g.prototype.unpipe=function(ot){var J=this._readableState,mt={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return ot&&ot!==J.pipes?this:(ot||(ot=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,ot&&ot.emit("unpipe",this,mt),this);if(!ot){var dt=J.pipes,Ct=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var Rt=0;Rt0,dt.flowing!==!1&&this.resume()):ot==="readable"&&!dt.endEmitted&&!dt.readableListening&&(dt.readableListening=dt.needReadable=!0,dt.flowing=!1,dt.emittedReadable=!1,o("on readable",dt.length,dt.reading),dt.length?F(this):dt.reading||process.nextTick(bt,this)),mt},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(ot,J){var mt=z.prototype.removeListener.call(this,ot,J);return ot==="readable"&&process.nextTick(ht,this),mt},g.prototype.removeAllListeners=function(ot){var J=z.prototype.removeAllListeners.apply(this,arguments);return(ot==="readable"||ot===void 0)&&process.nextTick(ht,this),J};function ht(ot){var J=ot._readableState;J.readableListening=ot.listenerCount("readable")>0,J.resumeScheduled&&!J.paused?J.flowing=!0:ot.listenerCount("data")>0&&ot.resume()}function bt(ot){o("readable nexttick read 0"),ot.read(0)}g.prototype.resume=function(){var ot=this._readableState;return ot.flowing||(o("resume"),ot.flowing=!ot.readableListening,vt(this,ot)),ot.paused=!1,this};function vt(ot,J){J.resumeScheduled||(J.resumeScheduled=!0,process.nextTick(ut,ot,J))}function ut(ot,J){o("resume",J.reading),J.reading||ot.read(0),J.resumeScheduled=!1,ot.emit("resume"),rt(ot),J.flowing&&!J.reading&&ot.read(0)}g.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function rt(ot){var J=ot._readableState;for(o("flow",J.flowing);J.flowing&&ot.read()!==null;);}g.prototype.wrap=function(ot){var J=this,mt=this._readableState,dt=!1;ot.on("end",function(){if(o("wrapped end"),mt.decoder&&!mt.ended){var Bt=mt.decoder.end();Bt&&Bt.length&&J.push(Bt)}J.push(null)}),ot.on("data",function(Bt){if(o("wrapped data"),mt.decoder&&(Bt=mt.decoder.write(Bt)),!(mt.objectMode&&Bt==null)&&!(!mt.objectMode&&(!Bt||!Bt.length))){var Zt=J.push(Bt);Zt||(dt=!0,ot.pause())}});for(var Ct in ot)this[Ct]===void 0&&typeof ot[Ct]=="function"&&(this[Ct]=function(Bt){return function(){return ot[Bt].apply(ot,arguments)}}(Ct));for(var Rt=0;Rt=J.length?(J.decoder?mt=J.buffer.join(""):J.buffer.length===1?mt=J.buffer.first():mt=J.buffer.concat(J.length),J.buffer.clear()):mt=J.buffer.consume(ot,J.decoder),mt}function it(ot){var J=ot._readableState;o("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,process.nextTick(st,J,ot))}function st(ot,J){if(o("endReadableNT",ot.endEmitted,ot.length),!ot.endEmitted&&ot.length===0&&(ot.endEmitted=!0,J.readable=!1,J.emit("end"),ot.autoDestroy)){var mt=J._writableState;(!mt||mt.autoDestroy&&mt.finished)&&J.destroy()}}typeof Symbol=="function"&&(g.from=function(ot,J){return D===void 0&&(D=LZ()),D(g,ot,J)});function xt(ot,J){for(var mt=0,dt=ot.length;mt{Y.exports=l;var f=bb().codes,y=f.ERR_METHOD_NOT_IMPLEMENTED,z=f.ERR_MULTIPLE_CALLBACK,P=f.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=f.ERR_TRANSFORM_WITH_LENGTH_0,i=wb();sy()(l,i);function a(s,h){var m=this._transformState;m.transforming=!1;var b=m.writecb;if(b===null)return this.emit("error",new z);m.writechunk=null,m.writecb=null,h!=null&&this.push(h),b(s);var x=this._readableState;x.reading=!1,(x.needReadable||x.length{Y.exports=y;var f=WP();sy()(y,f);function y(z){if(!(this instanceof y))return new y(z);f.call(this,z)}y.prototype._transform=function(z,P,n){n(null,z)}}),IZ=It((et,Y)=>{var f;function y(m){var b=!1;return function(){b||(b=!0,m.apply(void 0,arguments))}}var z=bb().codes,P=z.ERR_MISSING_ARGS,n=z.ERR_STREAM_DESTROYED;function i(m){if(m)throw m}function a(m){return m.setHeader&&typeof m.abort=="function"}function l(m,b,x,_){_=y(_);var A=!1;m.on("close",function(){A=!0}),f===void 0&&(f=uC()),f(m,{readable:b,writable:x},function(k){if(k)return _(k);A=!0,_()});var d=!1;return function(k){if(!A&&!d){if(d=!0,a(m))return m.abort();if(typeof m.destroy=="function")return m.destroy();_(k||new n("pipe"))}}}function o(m){m()}function c(m,b){return m.pipe(b)}function s(m){return!m.length||typeof m[m.length-1]!="function"?i:m.pop()}function h(){for(var m=arguments.length,b=new Array(m),x=0;x0;return l(k,D,E,function(I){A||(A=I),I&&d.forEach(o),!D&&(d.forEach(o),_(A))})});return b.reduce(c)}Y.exports=h}),DZ=It((et,Y)=>{Y.exports=z;var f=Wg().EventEmitter,y=sy();y(z,f),z.Readable=VP(),z.Writable=$P(),z.Duplex=wb(),z.Transform=WP(),z.PassThrough=PZ(),z.finished=uC(),z.pipeline=IZ(),z.Stream=z;function z(){f.call(this)}z.prototype.pipe=function(P,n){var i=this;function a(b){P.writable&&P.write(b)===!1&&i.pause&&i.pause()}i.on("data",a);function l(){i.readable&&i.resume&&i.resume()}P.on("drain",l),!P._isStdio&&(!n||n.end!==!1)&&(i.on("end",c),i.on("close",s));var o=!1;function c(){o||(o=!0,P.end())}function s(){o||(o=!0,typeof P.destroy=="function"&&P.destroy())}function h(b){if(m(),f.listenerCount(this,"error")===0)throw b}i.on("error",h),P.on("error",h);function m(){i.removeListener("data",a),P.removeListener("drain",l),i.removeListener("end",c),i.removeListener("close",s),i.removeListener("error",h),P.removeListener("error",h),i.removeListener("end",m),i.removeListener("close",m),P.removeListener("close",m)}return i.on("end",m),i.on("close",m),P.on("close",m),P.emit("pipe",i),P}}),jw=It(et=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var tt=Object.keys(G),ht={},bt=0;bt=vt)return it;switch(it){case"%s":return String(bt[ht++]);case"%d":return Number(bt[ht++]);case"%j":try{return JSON.stringify(bt[ht++])}catch{return"[Circular]"}default:return it}}),rt=bt[ht];ht"u")return function(){return et.deprecate(G,tt).apply(this,arguments)};var ht=!1;function bt(){if(!ht){if(process.throwDeprecation)throw new Error(tt);process.traceDeprecation?console.trace(tt):console.error(tt),ht=!0}return G.apply(this,arguments)}return bt};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;et.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var tt=process.pid;y[G]=function(){var ht=et.format.apply(et,arguments);console.error("%s %d: %s",G,tt,ht)}}else y[G]=function(){};return y[G]};function n(G,tt){var ht={seen:[],stylize:a};return arguments.length>=3&&(ht.depth=arguments[2]),arguments.length>=4&&(ht.colors=arguments[3]),_(tt)?ht.showHidden=tt:tt&&et._extend(ht,tt),E(ht.showHidden)&&(ht.showHidden=!1),E(ht.depth)&&(ht.depth=2),E(ht.colors)&&(ht.colors=!1),E(ht.customInspect)&&(ht.customInspect=!0),ht.colors&&(ht.stylize=i),o(ht,G,ht.depth)}et.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function i(G,tt){var ht=n.styles[tt];return ht?"\x1B["+n.colors[ht][0]+"m"+G+"\x1B["+n.colors[ht][1]+"m":G}function a(G,tt){return G}function l(G){var tt={};return G.forEach(function(ht,bt){tt[ht]=!0}),tt}function o(G,tt,ht){if(G.customInspect&&tt&&C(tt.inspect)&&tt.inspect!==et.inspect&&!(tt.constructor&&tt.constructor.prototype===tt)){var bt=tt.inspect(ht,G);return w(bt)||(bt=o(G,bt,ht)),bt}var vt=c(G,tt);if(vt)return vt;var ut=Object.keys(tt),rt=l(ut);if(G.showHidden&&(ut=Object.getOwnPropertyNames(tt)),g(tt)&&(ut.indexOf("message")>=0||ut.indexOf("description")>=0))return s(tt);if(ut.length===0){if(C(tt)){var gt=tt.name?": "+tt.name:"";return G.stylize("[Function"+gt+"]","special")}if(I(tt))return G.stylize(RegExp.prototype.toString.call(tt),"regexp");if(p(tt))return G.stylize(Date.prototype.toString.call(tt),"date");if(g(tt))return s(tt)}var it="",st=!1,xt=["{","}"];if(x(tt)&&(st=!0,xt=["[","]"]),C(tt)){var ot=tt.name?": "+tt.name:"";it=" [Function"+ot+"]"}if(I(tt)&&(it=" "+RegExp.prototype.toString.call(tt)),p(tt)&&(it=" "+Date.prototype.toUTCString.call(tt)),g(tt)&&(it=" "+s(tt)),ut.length===0&&(!st||tt.length==0))return xt[0]+it+xt[1];if(ht<0)return I(tt)?G.stylize(RegExp.prototype.toString.call(tt),"regexp"):G.stylize("[Object]","special");G.seen.push(tt);var J;return st?J=h(G,tt,ht,rt,ut):J=ut.map(function(mt){return m(G,tt,ht,rt,mt,st)}),G.seen.pop(),b(J,it,xt)}function c(G,tt){if(E(tt))return G.stylize("undefined","undefined");if(w(tt)){var ht="'"+JSON.stringify(tt).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(ht,"string")}if(k(tt))return G.stylize(""+tt,"number");if(_(tt))return G.stylize(""+tt,"boolean");if(A(tt))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,tt,ht,bt,vt){for(var ut=[],rt=0,gt=tt.length;rt-1&&(ut?gt=gt.split(` `).map(function(st){return" "+st}).join(` `).slice(2):gt=` @@ -204,9 +204,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `).concat(m(vt),` `));var ot=new s({actual:vt,expected:ut,message:rt,operator:it,stackStartFn:gt});throw ot.generatedMessage=xt,ot}}M.match=function vt(ut,rt,gt){ht(ut,rt,gt,vt,"match")},M.doesNotMatch=function vt(ut,rt,gt){ht(ut,rt,gt,vt,"doesNotMatch")};function bt(){for(var vt=arguments.length,ut=new Array(vt),rt=0;rt{var f=1e3,y=f*60,z=y*60,P=z*24,n=P*365.25;Y.exports=function(c,s){s=s||{};var h=typeof c;if(h==="string"&&c.length>0)return i(c);if(h==="number"&&isNaN(c)===!1)return s.long?l(c):a(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function i(c){if(c=String(c),!(c.length>100)){var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(c);if(s){var h=parseFloat(s[1]),m=(s[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return h*n;case"days":case"day":case"d":return h*P;case"hours":case"hour":case"hrs":case"hr":case"h":return h*z;case"minutes":case"minute":case"mins":case"min":case"m":return h*y;case"seconds":case"second":case"secs":case"sec":case"s":return h*f;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(c){return c>=P?Math.round(c/P)+"d":c>=z?Math.round(c/z)+"h":c>=y?Math.round(c/y)+"m":c>=f?Math.round(c/f)+"s":c+"ms"}function l(c){return o(c,P,"day")||o(c,z,"hour")||o(c,y,"minute")||o(c,f,"second")||c+" ms"}function o(c,s,h){if(!(c{et=Y.exports=z.debug=z.default=z,et.coerce=a,et.disable=n,et.enable=P,et.enabled=i,et.humanize=HZ(),et.names=[],et.skips=[],et.formatters={};var f;function y(l){var o=0,c;for(c in l)o=(o<<5)-o+l.charCodeAt(c),o|=0;return et.colors[Math.abs(o)%et.colors.length]}function z(l){function o(){if(o.enabled){var c=o,s=+new Date,h=s-(f||s);c.diff=h,c.prev=f,c.curr=s,f=s;for(var m=new Array(arguments.length),b=0;b{et=Y.exports=VZ(),et.log=z,et.formatArgs=y,et.save=P,et.load=n,et.useColors=f,et.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:i(),et.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function f(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}et.formatters.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}};function y(a){var l=this.useColors;if(a[0]=(l?"%c":"")+this.namespace+(l?" %c":" ")+a[0]+(l?"%c ":" ")+"+"+et.humanize(this.diff),!!l){var o="color: "+this.color;a.splice(1,0,o,"color: inherit");var c=0,s=0;a[0].replace(/%[a-zA-Z%]/g,function(h){h!=="%%"&&(c++,h==="%c"&&(s=c))}),a.splice(s,0,o)}}function z(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function P(a){try{a==null?et.storage.removeItem("debug"):et.storage.debug=a}catch{}}function n(){var a;try{a=et.storage.debug}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=t.DEBUG),a}et.enable(n());function i(){try{return window.localStorage}catch{}}}),qZ=It((et,Y)=>{var f=ok(),y=WZ()("stream-parser");Y.exports=a;var z=-1,P=0,n=1,i=2;function a(d){var k=d&&typeof d._transform=="function",w=d&&typeof d._write=="function";if(!k&&!w)throw new Error("must pass a Writable or Transform stream in");y("extending Parser into stream"),d._bytes=o,d._skipBytes=c,k&&(d._passthrough=s),k?d._transform=m:d._write=h}function l(d){y("initializing parser stream"),d._parserBytesLeft=0,d._parserBuffers=[],d._parserBuffered=0,d._parserState=z,d._parserCallback=null,typeof d.push=="function"&&(d._parserOutput=d.push.bind(d)),d._parserInit=!0}function o(d,k){f(!this._parserCallback,'there is already a "callback" set!'),f(isFinite(d)&&d>0,'can only buffer a finite number of bytes > 0, got "'+d+'"'),this._parserInit||l(this),y("buffering %o bytes",d),this._parserBytesLeft=d,this._parserCallback=k,this._parserState=P}function c(d,k){f(!this._parserCallback,'there is already a "callback" set!'),f(d>0,'can only skip > 0 bytes, got "'+d+'"'),this._parserInit||l(this),y("skipping %o bytes",d),this._parserBytesLeft=d,this._parserCallback=k,this._parserState=n}function s(d,k){f(!this._parserCallback,'There is already a "callback" set!'),f(d>0,'can only pass through > 0 bytes, got "'+d+'"'),this._parserInit||l(this),y("passing through %o bytes",d),this._parserBytesLeft=d,this._parserCallback=k,this._parserState=i}function h(d,k,w){this._parserInit||l(this),y("write(%o bytes)",d.length),typeof k=="function"&&(w=k),_(this,d,null,w)}function m(d,k,w){this._parserInit||l(this),y("transform(%o bytes)",d.length),typeof k!="function"&&(k=this._parserOutput),_(this,d,k,w)}function b(d,k,w,D){return d._parserBytesLeft<=0?D(new Error("got data but not currently parsing anything")):k.length<=d._parserBytesLeft?function(){return x(d,k,w,D)}:function(){var E=k.slice(0,d._parserBytesLeft);return x(d,E,w,function(I){if(I)return D(I);if(k.length>E.length)return function(){return b(d,k.slice(E.length),w,D)}})}}function x(d,k,w,D){if(d._parserBytesLeft-=k.length,y("%o bytes left for stream piece",d._parserBytesLeft),d._parserState===P?(d._parserBuffers.push(k),d._parserBuffered+=k.length):d._parserState===i&&w(k),d._parserBytesLeft===0){var E=d._parserCallback;if(E&&d._parserState===P&&d._parserBuffers.length>1&&(k=Buffer.concat(d._parserBuffers,d._parserBuffered)),d._parserState!==P&&(k=null),d._parserCallback=null,d._parserBuffered=0,d._parserState=z,d._parserBuffers.splice(0),E){var I=[];k&&I.push(k),w&&I.push(w);var M=E.length>I.length;M&&I.push(A(D));var p=E.apply(d,I);if(!M||D===p)return D}}else return D}var _=A(b);function A(d){return function(){for(var k=d.apply(this,arguments);typeof k=="function";)k=k();return k}}}),Ch=It(et=>{var Y=DZ().Transform,f=qZ();function y(){Y.call(this,{readableObjectMode:!0})}y.prototype=Object.create(Y.prototype),y.prototype.constructor=y,f(y.prototype),et.ParserStream=y,et.sliceEq=function(P,n,i){for(var a=n,l=0;l{var f=Ch().readUInt16BE,y=Ch().readUInt32BE;function z(s,h){if(s.length<4+h)return null;var m=y(s,h);return s.length>4&15,b=s[4]&15,x=s[5]>>4&15,_=f(s,6),A=8,d=0;d<_;d++){var k=f(s,A);A+=2;var w=f(s,A);A+=2;var D=n(s,A,x);A+=x;var E=f(s,A);if(A+=2,w===0&&E===1){var I=n(s,A,m),M=n(s,A+m,b);h.item_loc[k]={length:M,offset:I+D}}A+=E*(m+b)}}function a(s,h){for(var m=f(s,4),b=6,x=0;x_.width||x.width===_.width&&x.height>_.height?x:_}),m=s.reduce(function(x,_){return x.height>_.height||x.height===_.height&&x.width>_.width?x:_}),b;return h.width>m.height||h.width===m.height&&h.height>m.width?b=h:b=m,b}Y.exports.readSizeFromMeta=function(s){var h={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(o(s,h),!!h.sizes.length){var m=c(h.sizes),b=1;h.transforms.forEach(function(_){var A={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},d={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(_.type==="imir"&&(_.value===0?b=d[b]:(b=d[b],b=A[b],b=A[b])),_.type==="irot")for(var k=0;k<_.value;k++)b=A[b]});var x=null;return h.item_inf.Exif&&(x=h.item_loc[h.item_inf.Exif]),{width:m.width,height:m.height,orientation:h.transforms.length?b:null,variants:h.sizes,exif_location:x}}},Y.exports.getMimeType=function(s){var h=String.fromCharCode.apply(null,s.slice(0,4)),m={};m[h]=!0;for(var b=8;b{function f(P,n){var i=new Error(P);return i.code=n,i}function y(P){try{return decodeURIComponent(escape(P))}catch{return P}}function z(P,n,i){this.input=P.subarray(n,i),this.start=n;var a=String.fromCharCode.apply(null,this.input.subarray(0,4));if(a!=="II*\0"&&a!=="MM\0*")throw f("invalid TIFF signature","EBADDATA");this.big_endian=a[0]==="M"}z.prototype.each=function(P){this.aborted=!1;var n=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:n}];this.ifds_to_read.length>0&&!this.aborted;){var i=this.ifds_to_read.shift();i.offset&&this.scan_ifd(i.id,i.offset,P)}},z.prototype.read_uint16=function(P){var n=this.input;if(P+2>n.length)throw f("unexpected EOF","EBADDATA");return this.big_endian?n[P]*256+n[P+1]:n[P]+n[P+1]*256},z.prototype.read_uint32=function(P){var n=this.input;if(P+4>n.length)throw f("unexpected EOF","EBADDATA");return this.big_endian?n[P]*16777216+n[P+1]*65536+n[P+2]*256+n[P+3]:n[P]+n[P+1]*256+n[P+2]*65536+n[P+3]*16777216},z.prototype.is_subifd_link=function(P,n){return P===0&&n===34665||P===0&&n===34853||P===34665&&n===40965},z.prototype.exif_format_length=function(P){switch(P){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},z.prototype.exif_format_read=function(P,n){var i;switch(P){case 1:case 2:return i=this.input[n],i;case 6:return i=this.input[n],i|(i&128)*33554430;case 3:return i=this.read_uint16(n),i;case 8:return i=this.read_uint16(n),i|(i&32768)*131070;case 4:return i=this.read_uint32(n),i;case 9:return i=this.read_uint32(n),i|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},z.prototype.scan_ifd=function(P,n,i){var a=this.read_uint16(n);n+=2;for(var l=0;lthis.input.length)throw f("unexpected EOF","EBADDATA");for(var _=[],A=b,d=0;d0&&(this.ifds_to_read.push({id:o,offset:_[0]}),x=!0);var w={is_big_endian:this.big_endian,ifd:P,tag:o,format:c,count:s,entry_offset:n+this.start,data_length:m,data_offset:b+this.start,value:_,is_subifd_link:x};if(i(w)===!1){this.aborted=!0;return}n+=12}P===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(n)})},Y.exports.ExifParser=z,Y.exports.get_orientation=function(P){var n=0;try{return new z(P,0,P.length).each(function(i){if(i.ifd===0&&i.tag===274&&Array.isArray(i.value))return n=i.value[0],!1}),n}catch{return-1}}}),ZZ=It((et,Y)=>{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=GZ(),n=dC(),i=f("ftyp");Y.exports=function(a){if(y(a,4,i)){var l=P.unbox(a,0);if(l){var o=P.getMimeType(l.data);if(o){for(var c,s=l.end;;){var h=P.unbox(a,s);if(!h)break;if(s=h.end,h.boxtype==="mdat")return;if(h.boxtype==="meta"){c=h.data;break}}if(c){var m=P.readSizeFromMeta(c);if(m){var b={width:m.width,height:m.height,type:o.type,mime:o.mime,wUnits:"px",hUnits:"px"};if(m.variants.length>1&&(b.variants=m.variants),m.orientation&&(b.orientation=m.orientation),m.exif_location&&m.exif_location.offset+m.exif_location.length<=a.length){var x=z(a,m.exif_location.offset),_=a.slice(m.exif_location.offset+x+4,m.exif_location.offset+m.exif_location.length),A=n.get_orientation(_);A>0&&(b.orientation=A)}return b}}}}}}}),KZ=It((et,Y)=>{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=f("BM");Y.exports=function(n){if(!(n.length<26)&&y(n,0,P))return{width:z(n,18),height:z(n,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),YZ=It((et,Y)=>{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=f("GIF87a"),n=f("GIF89a");Y.exports=function(i){if(!(i.length<10)&&!(!y(i,0,P)&&!y(i,0,n)))return{width:z(i,6),height:z(i,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),XZ=It((et,Y)=>{var f=Ch().readUInt16LE,y=0,z=1,P=16;Y.exports=function(n){var i=f(n,0),a=f(n,2),l=f(n,4);if(!(i!==y||a!==z||!l)){for(var o=[],c={width:0,height:0},s=0;sc.width||m>c.height)&&(c=b)}return{width:c.width,height:c.height,variants:o,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),JZ=It((et,Y)=>{var f=Ch().readUInt16BE,y=Ch().str2arr,z=Ch().sliceEq,P=dC(),n=y("Exif\0\0");Y.exports=function(i){if(!(i.length<2)&&!(i[0]!==255||i[1]!==216||i[2]!==255))for(var a=2;;){for(;;){if(i.length-a<2)return;if(i[a++]===255)break}for(var l=i[a++],o;l===255;)l=i[a++];if(208<=l&&l<=217||l===1)o=0;else if(192<=l&&l<=254){if(i.length-a<2)return;o=f(i,a)-2,a+=2}else return;if(l===217||l===218)return;var c;if(l===225&&o>=10&&z(i,a,n)&&(c=P.get_orientation(i.slice(a+6,a+o))),o>=5&&192<=l&&l<=207&&l!==196&&l!==200&&l!==204){if(i.length-a0&&(s.orientation=c),s}a+=o}}}),QZ=It((et,Y)=>{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=f(`‰PNG\r  -`),n=f("IHDR");Y.exports=function(i){if(!(i.length<24)&&y(i,0,P)&&y(i,12,n))return{width:z(i,16),height:z(i,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}),tK=It((et,Y)=>{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=f("8BPS\0");Y.exports=function(n){if(!(n.length<22)&&y(n,0,P))return{width:z(n,18),height:z(n,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),eK=It((et,Y)=>{function f(h){return h===32||h===9||h===13||h===10}function y(h){return typeof h=="number"&&isFinite(h)&&h>0}function z(h){var m=0,b=h.length;for(h[0]===239&&h[1]===187&&h[2]===191&&(m=3);m]*>/,n=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,i=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,o=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(h){var m=h.match(i),b=h.match(a),x=h.match(l);return{width:m&&(m[1]||m[2]),height:b&&(b[1]||b[2]),viewbox:x&&(x[1]||x[2])}}function s(h){return o.test(h)?h.match(o)[0]:"px"}Y.exports=function(h){if(z(h)){for(var m="",b=0;b{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt16BE,n=Ch().readUInt32LE,i=Ch().readUInt32BE,a=f("II*\0"),l=f("MM\0*");function o(h,m,b){return b?P(h,m):z(h,m)}function c(h,m,b){return b?i(h,m):n(h,m)}function s(h,m,b){var x=o(h,m+2,b),_=c(h,m+4,b);return _!==1||x!==3&&x!==4?null:x===3?o(h,m+8,b):c(h,m+8,b)}Y.exports=function(h){if(!(h.length<8)&&!(!y(h,0,a)&&!y(h,0,l))){var m=h[0]===77,b=c(h,4,m)-8;if(!(b<0)){var x=b+8;if(!(h.length-x<2)){var _=o(h,x+0,m)*12;if(!(_<=0)&&(x+=2,!(h.length-x<_))){var A,d,k,w;for(A=0;A<_;A+=12)w=o(h,x+A,m),w===256?d=s(h,x+A,m):w===257&&(k=s(h,x+A,m));if(d&&k)return{width:d,height:k,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),nK=It((et,Y)=>{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt32LE,n=dC(),i=f("RIFF"),a=f("WEBP");function l(s,h){if(!(s[h+3]!==157||s[h+4]!==1||s[h+5]!==42))return{width:z(s,h+6)&16383,height:z(s,h+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function o(s,h){if(s[h]===47){var m=P(s,h+1);return{width:(m&16383)+1,height:(m>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function c(s,h){return{width:(s[h+6]<<16|s[h+5]<<8|s[h+4])+1,height:(s[h+9]<s.length)){for(;h+8=10?m=m||l(s,h+8):_==="VP8L"&&A>=9?m=m||o(s,h+8):_==="VP8X"&&A>=10?m=m||c(s,h+8):_==="EXIF"&&(b=n.get_orientation(s.slice(h+8,h+8+A)),h=1/0),h+=8+A}if(m)return b>0&&(m.orientation=b),m}}}}),iK=It((et,Y)=>{Y.exports={avif:ZZ(),bmp:KZ(),gif:YZ(),ico:XZ(),jpeg:JZ(),png:QZ(),psd:tK(),svg:eK(),tiff:rK(),webp:nK()}}),aK=It((et,Y)=>{var f=iK();function y(z){for(var P=Object.keys(f),n=0;n{var Y=aK(),f=K0().IMAGE_URL_PREFIX,y=yb().Buffer;et.getImageSize=function(z){var P=z.replace(f,""),n=new y(P,"base64");return Y(n)}}),sK=It((et,Y)=>{var f=jn(),y=Bw(),z=Sr(),P=Fs(),n=jn().maxRowLength,i=oK().getImageSize;Y.exports=function(c,s){var h,m;if(s._hasZ)h=s.z.length,m=n(s.z);else if(s._hasSource){var b=i(s.source);h=b.height,m=b.width}var x=P.getFromId(c,s.xaxis||"x"),_=P.getFromId(c,s.yaxis||"y"),A=x.d2c(s.x0)-s.dx/2,d=_.d2c(s.y0)-s.dy/2,k,w=[A,A+m*s.dx],D=[d,d+h*s.dy];if(x&&x.type==="log")for(k=0;k{var f=Br(),y=jn(),z=y.strTranslate,P=k0(),n=Bw(),i=eP(),a=G8().STYLE;Y.exports=function(l,o,c,s){var h=o.xaxis,m=o.yaxis,b=!l._context._exportedPlot&&i();y.makeTraceGroups(s,c,"im").each(function(x){var _=f.select(this),A=x[0],d=A.trace,k=(d.zsmooth==="fast"||d.zsmooth===!1&&b)&&!d._hasZ&&d._hasSource&&h.type==="linear"&&m.type==="linear";d._realImage=k;var w=A.z,D=A.x0,E=A.y0,I=A.w,M=A.h,p=d.dx,g=d.dy,C,S,N,B,U,V;for(V=0;C===void 0&&V0;)S=h.c2p(D+V*p),V--;for(V=0;B===void 0&&V0;)U=m.c2p(E+V*g),V--;if(Sut[0];if(rt||gt){var it=C+F/2,st=B+H/2;bt+="transform:"+z(it+"px",st+"px")+"scale("+(rt?-1:1)+","+(gt?-1:1)+")"+z(-it+"px",-st+"px")+";"}}ht.attr("style",bt);var xt=new Promise(function(ot){if(d._hasZ)ot();else if(d._hasSource)if(d._canvas&&d._canvas.el.width===I&&d._canvas.el.height===M&&d._canvas.source===d.source)ot();else{var J=document.createElement("canvas");J.width=I,J.height=M;var mt=J.getContext("2d",{willReadFrequently:!0});d._image=d._image||new Image;var dt=d._image;dt.onload=function(){mt.drawImage(dt,0,0),d._canvas={el:J,source:d.source},ot()},dt.setAttribute("src",d.source)}}).then(function(){var ot,J;if(d._hasZ)J=tt(function(Ct,Rt){var Bt=w[Rt][Ct];return y.isTypedArray(Bt)&&(Bt=Array.from(Bt)),Bt}),ot=J.toDataURL("image/png");else if(d._hasSource)if(k)ot=d.source;else{var mt=d._canvas.el.getContext("2d",{willReadFrequently:!0}),dt=mt.getImageData(0,0,I,M).data;J=tt(function(Ct,Rt){var Bt=4*(Rt*I+Ct);return[dt[Bt],dt[Bt+1],dt[Bt+2],dt[Bt+3]]}),ot=J.toDataURL("image/png")}ht.attr({"xlink:href":ot,height:H,width:F,x:C,y:B})});l._promises.push(xt)})}}),cK=It((et,Y)=>{var f=Br();Y.exports=function(y){f.select(y).selectAll(".im image").style("opacity",function(z){return z[0].trace.opacity})}}),uK=It((et,Y)=>{var f=hd(),y=jn(),z=y.isArrayOrTypedArray,P=Bw();Y.exports=function(n,i,a){var l=n.cd[0],o=l.trace,c=n.xa,s=n.ya;if(!(f.inbox(i-l.x0,i-(l.x0+l.w*o.dx),0)>0||f.inbox(a-l.y0,a-(l.y0+l.h*o.dy),0)>0)){var h=Math.floor((i-l.x0)/o.dx),m=Math.floor(Math.abs(a-l.y0)/o.dy),b;if(o._hasZ?b=l.z[m][h]:o._hasSource&&(b=o._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(h,m,1,1).data),!!b){var x=l.hi||o.hoverinfo,_;if(x){var A=x.split("+");A.indexOf("all")!==-1&&(A=["color"]),A.indexOf("color")!==-1&&(_=!0)}var d=P.colormodel[o.colormodel],k=d.colormodel||o.colormodel,w=k.length,D=o._scaler(b),E=d.suffix,I=[];(o.hovertemplate||_)&&(I.push("["+[D[0]+E[0],D[1]+E[1],D[2]+E[2]].join(", ")),w===4&&I.push(", "+D[3]+E[3]),I.push("]"),I=I.join(""),n.extraText=k.toUpperCase()+": "+I);var M;z(o.hovertext)&&z(o.hovertext[m])?M=o.hovertext[m][h]:z(o.text)&&z(o.text[m])&&(M=o.text[m][h]);var p=s.c2p(l.y0+(m+.5)*o.dy),g=l.x0+(h+.5)*o.dx,C=l.y0+(m+.5)*o.dy,S="["+b.slice(0,o.colormodel.length).join(", ")+"]";return[y.extendFlat(n,{index:[m,h],x0:c.c2p(l.x0+h*o.dx),x1:c.c2p(l.x0+(h+1)*o.dx),y0:p,y1:p,color:D,xVal:g,xLabelVal:g,yVal:C,yLabelVal:C,zLabelVal:S,text:M,hovertemplateLabels:{zLabel:S,colorLabel:I,"color[0]Label":D[0]+E[0],"color[1]Label":D[1]+E[1],"color[2]Label":D[2]+E[2],"color[3]Label":D[3]+E[3]}})]}}}}),hK=It((et,Y)=>{Y.exports=function(f,y){return"xVal"in y&&(f.x=y.xVal),"yVal"in y&&(f.y=y.yVal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f.color=y.color,f.colormodel=y.trace.colormodel,f.z||(f.z=y.color),f}}),dK=It((et,Y)=>{Y.exports={attributes:AP(),supplyDefaults:ZG(),calc:sK(),plot:lK(),style:cK(),hoverPoints:uK(),eventData:hK(),moduleType:"trace",name:"image",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),fK=It((et,Y)=>{Y.exports=dK()}),wb=It((et,Y)=>{var f=xa(),y=Jh().attributes,z=hi(),P=Sn(),{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=Yn().extendFlat,o=qf().pattern,c=z({editType:"plot",arrayOk:!0,colorEditType:"plot"});Y.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:P.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},f.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:n({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:a(),texttemplate:i({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:a({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},c,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},c,{}),outsidetextfont:l({},c,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},c,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:y({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),kb=It((et,Y)=>{var f=Sr(),y=jn(),z=wb(),P=Jh().defaults,n=eg().handleText,i=jn().coercePattern;function a(c,s){var h=y.isArrayOrTypedArray(c),m=y.isArrayOrTypedArray(s),b=Math.min(h?c.length:1/0,m?s.length:1/0);if(isFinite(b)||(b=0),b&&m){for(var x,_=0;_0){x=!0;break}}x||(b=0)}return{hasLabels:h,hasValues:m,len:b}}function l(c,s,h,m,b){var x=m("marker.line.width");x&&m("marker.line.color",b?void 0:h.paper_bgcolor);var _=m("marker.colors");i(m,"marker.pattern",_),c.marker&&!s.marker.pattern.fgcolor&&(s.marker.pattern.fgcolor=c.marker.colors),s.marker.pattern.bgcolor||(s.marker.pattern.bgcolor=h.paper_bgcolor)}function o(c,s,h,m){function b(S,N){return y.coerce(c,s,z,S,N)}var x=b("labels"),_=b("values"),A=a(x,_),d=A.len;if(s._hasLabels=A.hasLabels,s._hasValues=A.hasValues,!s._hasLabels&&s._hasValues&&(b("label0"),b("dlabel")),!d){s.visible=!1;return}s._length=d,l(c,s,m,b,!0),b("scalegroup");var k=b("text"),w=b("texttemplate");b("texttemplatefallback");var D;if(w||(D=b("textinfo",y.isArrayOrTypedArray(k)?"text+percent":"percent")),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),w||D&&D!=="none"){var E=b("textposition");n(c,s,m,b,E,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var I=Array.isArray(E)||E==="auto",M=I||E==="outside";M&&b("automargin"),(E==="inside"||E==="auto"||Array.isArray(E))&&b("insidetextorientation")}else D==="none"&&b("textposition","none");P(s,m,b);var p=b("hole"),g=b("title.text");if(g){var C=b("title.position",p?"middle center":"top center");!p&&C==="middle center"&&(s.title.position="top center"),y.coerceFont(b,"title.font",m.font)}b("sort"),b("direction"),b("rotation"),b("pull")}Y.exports={handleLabelsAndValues:a,handleMarkerDefaults:l,supplyDefaults:o}}),fC=It((et,Y)=>{Y.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),pK=It((et,Y)=>{var f=jn(),y=fC();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("hiddenlabels"),n("piecolorway",P.colorway),n("extendpiecolors")}}),Uw=It((et,Y)=>{var f=Sr(),y=Xi(),z=Hn(),P={};function n(o,c){var s=[],h=o._fullLayout,m=h.hiddenlabels||[],b=c.labels,x=c.marker.colors||[],_=c.values,A=c._length,d=c._hasValues&&A,k,w;if(c.dlabel)for(b=new Array(A),k=0;k=0});var N=c.type==="funnelarea"?M:c.sort;return N&&s.sort(function(B,U){return U.v-B.v}),s[0]&&(s[0].vTotal=I),s}function i(o){return function(c,s){return!c||(c=y(c),!c.isValid())?!1:(c=z.addOpacity(c,c.getAlpha()),o[s]||(o[s]=c),c)}}function a(o,c){var s=(c||{}).type;s||(s="pie");var h=o._fullLayout,m=o.calcdata,b=h[s+"colorway"],x=h["_"+s+"colormap"];h["extend"+s+"colors"]&&(b=l(b,P));for(var _=0,A=0;A{var f=T0().appendArrayMultiPointValues;Y.exports=function(y,z){var P={curveNumber:z.index,pointNumbers:y.pts,data:z._input,fullData:z,label:y.label,color:y.color,value:y.v,percent:y.percent,text:y.text,bbox:y.bbox,v:y.v};return y.pts.length===1&&(P.pointNumber=P.i=y.pts[0]),f(P,z,y.pts),z.type==="funnelarea"&&(delete P.v,delete P.i),P}}),pC=It((et,Y)=>{var f=Br(),y=lh(),z=hd(),P=Hn(),n=Js(),i=jn(),a=i.strScale,l=i.strTranslate,o=uu(),c=C0(),s=c.recordMinTextSize,h=c.clearMinTextSize,m=gb().TEXTPAD,b=Vv(),x=mK(),_=jn().isValidTextValue;function A(gt,it){var st=gt._context.staticPlot,xt=gt._fullLayout,ot=xt._size;h("pie",xt),E(it,gt),tt(it,ot);var J=i.makeTraceGroups(xt._pielayer,it,"trace").each(function(mt){var dt=f.select(this),Ct=mt[0],Rt=Ct.trace;bt(mt),dt.attr("stroke-linejoin","round"),dt.each(function(){var Bt=f.select(this).selectAll("g.slice").data(mt);Bt.enter().append("g").classed("slice",!0),Bt.exit().remove();var Zt=[[[],[]],[[],[]]],Gt=!1;Bt.each(function(Lt,ie){if(Lt.hidden){f.select(this).selectAll("path,g").remove();return}Lt.pointNumber=Lt.i,Lt.curveNumber=Rt.index,Zt[Lt.pxmid[1]<0?0:1][Lt.pxmid[0]<0?0:1].push(Lt);var be=Ct.cx,ce=Ct.cy,Le=f.select(this),Ze=Le.selectAll("path.surface").data([Lt]);if(Ze.enter().append("path").classed("surface",!0).style({"pointer-events":st?"none":"all"}),Le.call(k,gt,mt),Rt.pull){var Qe=+b.castOption(Rt.pull,Lt.pts)||0;Qe>0&&(be+=Qe*Lt.pxmid[0],ce+=Qe*Lt.pxmid[1])}Lt.cxFinal=be,Lt.cyFinal=ce;function mr(Oe,Xt,oe,zt){var _t=zt*(Xt[0]-Oe[0]),Pt=zt*(Xt[1]-Oe[1]);return"a"+zt*Ct.r+","+zt*Ct.r+" 0 "+Lt.largeArc+(oe?" 1 ":" 0 ")+_t+","+Pt}var fr=Rt.hole;if(Lt.v===Ct.vTotal){var Jr="M"+(be+Lt.px0[0])+","+(ce+Lt.px0[1])+mr(Lt.px0,Lt.pxmid,!0,1)+mr(Lt.pxmid,Lt.px0,!0,1)+"Z";fr?Ze.attr("d","M"+(be+fr*Lt.px0[0])+","+(ce+fr*Lt.px0[1])+mr(Lt.px0,Lt.pxmid,!1,fr)+mr(Lt.pxmid,Lt.px0,!1,fr)+"Z"+Jr):Ze.attr("d",Jr)}else{var an=mr(Lt.px0,Lt.px1,!0,1);if(fr){var Er=1-fr;Ze.attr("d","M"+(be+fr*Lt.px1[0])+","+(ce+fr*Lt.px1[1])+mr(Lt.px1,Lt.px0,!1,fr)+"l"+Er*Lt.px0[0]+","+Er*Lt.px0[1]+an+"Z")}else Ze.attr("d","M"+be+","+ce+"l"+Lt.px0[0]+","+Lt.px0[1]+an+"Z")}ut(gt,Lt,Ct);var dn=b.castOption(Rt.textposition,Lt.pts),_n=Le.selectAll("g.slicetext").data(Lt.text&&dn!=="none"?[0]:[]);_n.enter().append("g").classed("slicetext",!0),_n.exit().remove(),_n.each(function(){var Oe=i.ensureSingle(f.select(this),"text","",function(he){he.attr("data-notex",1)}),Xt=i.ensureUniformFontSize(gt,dn==="outside"?w(Rt,Lt,xt.font):D(Rt,Lt,xt.font));Oe.text(Lt.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,Xt).call(o.convertToTspans,gt);var oe=n.bBox(Oe.node()),zt;if(dn==="outside")zt=U(oe,Lt);else if(zt=I(oe,Lt,Ct),dn==="auto"&&zt.scale<1){var _t=i.ensureUniformFontSize(gt,Rt.outsidetextfont);Oe.call(n.font,_t),oe=n.bBox(Oe.node()),zt=U(oe,Lt)}var Pt=zt.textPosAngle,Ht=Pt===void 0?Lt.pxmid:vt(Ct.r,Pt);if(zt.targetX=be+Ht[0]*zt.rCenter+(zt.x||0),zt.targetY=ce+Ht[1]*zt.rCenter+(zt.y||0),rt(zt,oe),zt.outside){var ae=zt.targetY;Lt.yLabelMin=ae-oe.height/2,Lt.yLabelMid=ae,Lt.yLabelMax=ae+oe.height/2,Lt.labelExtraX=0,Lt.labelExtraY=0,Gt=!0}zt.fontSize=Xt.size,s(Rt.type,zt,xt),mt[ie].transform=zt,i.setTransormAndDisplay(Oe,zt)})});var ee=f.select(this).selectAll("g.titletext").data(Rt.title.text?[0]:[]);if(ee.enter().append("g").classed("titletext",!0),ee.exit().remove(),ee.each(function(){var Lt=i.ensureSingle(f.select(this),"text","",function(ce){ce.attr("data-notex",1)}),ie=Rt.title.text;Rt._meta&&(ie=i.templateString(ie,Rt._meta)),Lt.text(ie).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,Rt.title.font).call(o.convertToTspans,gt);var be;Rt.title.position==="middle center"?be=V(Ct):be=W(Ct,ot),Lt.attr("transform",l(be.x,be.y)+a(Math.min(1,be.scale))+l(be.tx,be.ty))}),Gt&&G(Zt,Rt),d(Bt,Rt),Gt&&Rt.automargin){var xe=n.bBox(dt.node()),ge=Rt.domain,ye=ot.w*(ge.x[1]-ge.x[0]),ue=ot.h*(ge.y[1]-ge.y[0]),Mt=(.5*ye-Ct.r)/ot.w,Ot=(.5*ue-Ct.r)/ot.h;y.autoMargin(gt,"pie."+Rt.uid+".automargin",{xl:ge.x[0]-Mt,xr:ge.x[1]+Mt,yb:ge.y[0]-Ot,yt:ge.y[1]+Ot,l:Math.max(Ct.cx-Ct.r-xe.left,0),r:Math.max(xe.right-(Ct.cx+Ct.r),0),b:Math.max(xe.bottom-(Ct.cy+Ct.r),0),t:Math.max(Ct.cy-Ct.r-xe.top,0),pad:5})}})});setTimeout(function(){J.selectAll("tspan").each(function(){var mt=f.select(this);mt.attr("dy")&&mt.attr("dy",mt.attr("dy"))})},0)}function d(gt,it){gt.each(function(st){var xt=f.select(this);if(!st.labelExtraX&&!st.labelExtraY){xt.select("path.textline").remove();return}var ot=xt.select("g.slicetext text");st.transform.targetX+=st.labelExtraX,st.transform.targetY+=st.labelExtraY,i.setTransormAndDisplay(ot,st.transform);var J=st.cxFinal+st.pxmid[0],mt=st.cyFinal+st.pxmid[1],dt="M"+J+","+mt,Ct=(st.yLabelMax-st.yLabelMin)*(st.pxmid[0]<0?-1:1)/4;if(st.labelExtraX){var Rt=st.labelExtraX*st.pxmid[1]/st.pxmid[0],Bt=st.yLabelMid+st.labelExtraY-(st.cyFinal+st.pxmid[1]);Math.abs(Rt)>Math.abs(Bt)?dt+="l"+Bt*st.pxmid[0]/st.pxmid[1]+","+Bt+"H"+(J+st.labelExtraX+Ct):dt+="l"+st.labelExtraX+","+Rt+"v"+(Bt-Rt)+"h"+Ct}else dt+="V"+(st.yLabelMid+st.labelExtraY)+"h"+Ct;i.ensureSingle(xt,"path","textline").call(P.stroke,it.outsidetextfont.color).attr({"stroke-width":Math.min(2,it.outsidetextfont.size/8),d:dt,fill:"none"})})}function k(gt,it,st){var xt=st[0],ot=xt.cx,J=xt.cy,mt=xt.trace,dt=mt.type==="funnelarea";"_hasHoverLabel"in mt||(mt._hasHoverLabel=!1),"_hasHoverEvent"in mt||(mt._hasHoverEvent=!1),gt.on("mouseover",function(Ct){var Rt=it._fullLayout,Bt=it._fullData[mt.index];if(!(it._dragging||Rt.hovermode===!1)){var Zt=Bt.hoverinfo;if(Array.isArray(Zt)&&(Zt=z.castHoverinfo({hoverinfo:[b.castOption(Zt,Ct.pts)],_module:mt._module},Rt,0)),Zt==="all"&&(Zt="label+text+value+percent+name"),Bt.hovertemplate||Zt!=="none"&&Zt!=="skip"&&Zt){var Gt=Ct.rInscribed||0,ee=ot+Ct.pxmid[0]*(1-Gt),xe=J+Ct.pxmid[1]*(1-Gt),ge=Rt.separators,ye=[];if(Zt&&Zt.indexOf("label")!==-1&&ye.push(Ct.label),Ct.text=b.castOption(Bt.hovertext||Bt.text,Ct.pts),Zt&&Zt.indexOf("text")!==-1){var ue=Ct.text;i.isValidTextValue(ue)&&ye.push(ue)}Ct.value=Ct.v,Ct.valueLabel=b.formatPieValue(Ct.v,ge),Zt&&Zt.indexOf("value")!==-1&&ye.push(Ct.valueLabel),Ct.percent=Ct.v/xt.vTotal,Ct.percentLabel=b.formatPiePercent(Ct.percent,ge),Zt&&Zt.indexOf("percent")!==-1&&ye.push(Ct.percentLabel);var Mt=Bt.hoverlabel,Ot=Mt.font,Lt=[];z.loneHover({trace:mt,x0:ee-Gt*xt.r,x1:ee+Gt*xt.r,y:xe,_x0:dt?ot+Ct.TL[0]:ee-Gt*xt.r,_x1:dt?ot+Ct.TR[0]:ee+Gt*xt.r,_y0:dt?J+Ct.TL[1]:xe-Gt*xt.r,_y1:dt?J+Ct.BL[1]:xe+Gt*xt.r,text:ye.join("
"),name:Bt.hovertemplate||Zt.indexOf("name")!==-1?Bt.name:void 0,idealAlign:Ct.pxmid[0]<0?"left":"right",color:b.castOption(Mt.bgcolor,Ct.pts)||Ct.color,borderColor:b.castOption(Mt.bordercolor,Ct.pts),fontFamily:b.castOption(Ot.family,Ct.pts),fontSize:b.castOption(Ot.size,Ct.pts),fontColor:b.castOption(Ot.color,Ct.pts),nameLength:b.castOption(Mt.namelength,Ct.pts),textAlign:b.castOption(Mt.align,Ct.pts),hovertemplate:b.castOption(Bt.hovertemplate,Ct.pts),hovertemplateLabels:Ct,eventData:[x(Ct,Bt)]},{container:Rt._hoverlayer.node(),outerContainer:Rt._paper.node(),gd:it,inOut_bbox:Lt}),Ct.bbox=Lt[0],mt._hasHoverLabel=!0}mt._hasHoverEvent=!0,it.emit("plotly_hover",{points:[x(Ct,Bt)],event:f.event})}}),gt.on("mouseout",function(Ct){var Rt=it._fullLayout,Bt=it._fullData[mt.index],Zt=f.select(this).datum();mt._hasHoverEvent&&(Ct.originalEvent=f.event,it.emit("plotly_unhover",{points:[x(Zt,Bt)],event:f.event}),mt._hasHoverEvent=!1),mt._hasHoverLabel&&(z.loneUnhover(Rt._hoverlayer.node()),mt._hasHoverLabel=!1)}),gt.on("click",function(Ct){var Rt=it._fullLayout,Bt=it._fullData[mt.index];it._dragging||Rt.hovermode===!1||(it._hoverdata=[x(Ct,Bt)],z.click(it,f.event))})}function w(gt,it,st){var xt=b.castOption(gt.outsidetextfont.color,it.pts)||b.castOption(gt.textfont.color,it.pts)||st.color,ot=b.castOption(gt.outsidetextfont.family,it.pts)||b.castOption(gt.textfont.family,it.pts)||st.family,J=b.castOption(gt.outsidetextfont.size,it.pts)||b.castOption(gt.textfont.size,it.pts)||st.size,mt=b.castOption(gt.outsidetextfont.weight,it.pts)||b.castOption(gt.textfont.weight,it.pts)||st.weight,dt=b.castOption(gt.outsidetextfont.style,it.pts)||b.castOption(gt.textfont.style,it.pts)||st.style,Ct=b.castOption(gt.outsidetextfont.variant,it.pts)||b.castOption(gt.textfont.variant,it.pts)||st.variant,Rt=b.castOption(gt.outsidetextfont.textcase,it.pts)||b.castOption(gt.textfont.textcase,it.pts)||st.textcase,Bt=b.castOption(gt.outsidetextfont.lineposition,it.pts)||b.castOption(gt.textfont.lineposition,it.pts)||st.lineposition,Zt=b.castOption(gt.outsidetextfont.shadow,it.pts)||b.castOption(gt.textfont.shadow,it.pts)||st.shadow;return{color:xt,family:ot,size:J,weight:mt,style:dt,variant:Ct,textcase:Rt,lineposition:Bt,shadow:Zt}}function D(gt,it,st){var xt=b.castOption(gt.insidetextfont.color,it.pts);!xt&>._input.textfont&&(xt=b.castOption(gt._input.textfont.color,it.pts));var ot=b.castOption(gt.insidetextfont.family,it.pts)||b.castOption(gt.textfont.family,it.pts)||st.family,J=b.castOption(gt.insidetextfont.size,it.pts)||b.castOption(gt.textfont.size,it.pts)||st.size,mt=b.castOption(gt.insidetextfont.weight,it.pts)||b.castOption(gt.textfont.weight,it.pts)||st.weight,dt=b.castOption(gt.insidetextfont.style,it.pts)||b.castOption(gt.textfont.style,it.pts)||st.style,Ct=b.castOption(gt.insidetextfont.variant,it.pts)||b.castOption(gt.textfont.variant,it.pts)||st.variant,Rt=b.castOption(gt.insidetextfont.textcase,it.pts)||b.castOption(gt.textfont.textcase,it.pts)||st.textcase,Bt=b.castOption(gt.insidetextfont.lineposition,it.pts)||b.castOption(gt.textfont.lineposition,it.pts)||st.lineposition,Zt=b.castOption(gt.insidetextfont.shadow,it.pts)||b.castOption(gt.textfont.shadow,it.pts)||st.shadow;return{color:xt||P.contrast(it.color),family:ot,size:J,weight:mt,style:dt,variant:Ct,textcase:Rt,lineposition:Bt,shadow:Zt}}function E(gt,it){for(var st,xt,ot=0;ot=-4;Mt-=2)ue(Math.PI*Mt,"tan");for(Mt=4;Mt>=-4;Mt-=2)ue(Math.PI*(Mt+1),"tan")}if(Zt||ee){for(Mt=4;Mt>=-4;Mt-=2)ue(Math.PI*(Mt+1.5),"rad");for(Mt=4;Mt>=-4;Mt-=2)ue(Math.PI*(Mt+.5),"rad")}}if(dt||xe||Zt){var Ot=Math.sqrt(gt.width*gt.width+gt.height*gt.height);if(ye={scale:ot*xt*2/Ot,rCenter:1-ot,rotate:0},ye.textPosAngle=(it.startangle+it.stopangle)/2,ye.scale>=1)return ye;ge.push(ye)}(xe||ee)&&(ye=p(gt,xt,mt,Ct,Rt),ye.textPosAngle=(it.startangle+it.stopangle)/2,ge.push(ye)),(xe||Gt)&&(ye=g(gt,xt,mt,Ct,Rt),ye.textPosAngle=(it.startangle+it.stopangle)/2,ge.push(ye));for(var Lt=0,ie=0,be=0;be=1)break}return ge[Lt]}function M(gt,it){var st=gt.startangle,xt=gt.stopangle;return st>it&&it>xt||st0?1:-1)/2,y:J/(1+st*st/(xt*xt)),outside:!0}}function V(gt){var it=Math.sqrt(gt.titleBox.width*gt.titleBox.width+gt.titleBox.height*gt.titleBox.height);return{x:gt.cx,y:gt.cy,scale:gt.trace.hole*gt.r*2/it,tx:0,ty:-gt.titleBox.height/2+gt.trace.title.font.size}}function W(gt,it){var st=1,xt=1,ot,J=gt.trace,mt={x:gt.cx,y:gt.cy},dt={tx:0,ty:0};dt.ty+=J.title.font.size,ot=q(J),J.title.position.indexOf("top")!==-1?(mt.y-=(1+ot)*gt.r,dt.ty-=gt.titleBox.height):J.title.position.indexOf("bottom")!==-1&&(mt.y+=(1+ot)*gt.r);var Ct=F(gt.r,gt.trace.aspectratio),Rt=it.w*(J.domain.x[1]-J.domain.x[0])/2;return J.title.position.indexOf("left")!==-1?(Rt=Rt+Ct,mt.x-=(1+ot)*Ct,dt.tx+=gt.titleBox.width/2):J.title.position.indexOf("center")!==-1?Rt*=2:J.title.position.indexOf("right")!==-1&&(Rt=Rt+Ct,mt.x+=(1+ot)*Ct,dt.tx-=gt.titleBox.width/2),st=Rt/gt.titleBox.width,xt=H(gt,it)/gt.titleBox.height,{x:mt.x,y:mt.y,scale:Math.min(st,xt),tx:dt.tx,ty:dt.ty}}function F(gt,it){return gt/(it===void 0?1:it)}function H(gt,it){var st=gt.trace,xt=it.h*(st.domain.y[1]-st.domain.y[0]);return Math.min(gt.titleBox.height,xt/2)}function q(gt){var it=gt.pull;if(!it)return 0;var st;if(i.isArrayOrTypedArray(it))for(it=0,st=0;stit&&(it=gt.pull[st]);return it}function G(gt,it){var st,xt,ot,J,mt,dt,Ct,Rt,Bt,Zt,Gt,ee,xe;function ge(Ot,Lt){return Ot.pxmid[1]-Lt.pxmid[1]}function ye(Ot,Lt){return Lt.pxmid[1]-Ot.pxmid[1]}function ue(Ot,Lt){Lt||(Lt={});var ie=Lt.labelExtraY+(xt?Lt.yLabelMax:Lt.yLabelMin),be=xt?Ot.yLabelMin:Ot.yLabelMax,ce=xt?Ot.yLabelMax:Ot.yLabelMin,Le=Ot.cyFinal+mt(Ot.px0[1],Ot.px1[1]),Ze=ie-be,Qe,mr,fr,Jr,an,Er;if(Ze*Ct>0&&(Ot.labelExtraY=Ze),!!i.isArrayOrTypedArray(it.pull))for(mr=0;mr=(b.castOption(it.pull,fr.pts)||0))&&((Ot.pxmid[1]-fr.pxmid[1])*Ct>0?(Jr=fr.cyFinal+mt(fr.px0[1],fr.px1[1]),Ze=Jr-be-Ot.labelExtraY,Ze*Ct>0&&(Ot.labelExtraY+=Ze)):(ce+Ot.labelExtraY-Le)*Ct>0&&(Qe=3*dt*Math.abs(mr-Zt.indexOf(Ot)),an=fr.cxFinal+J(fr.px0[0],fr.px1[0]),Er=an+Qe-(Ot.cxFinal+Ot.pxmid[0])-Ot.labelExtraX,Er*dt>0&&(Ot.labelExtraX+=Er)))}for(xt=0;xt<2;xt++)for(ot=xt?ge:ye,mt=xt?Math.max:Math.min,Ct=xt?1:-1,st=0;st<2;st++){for(J=st?Math.max:Math.min,dt=st?1:-1,Rt=gt[xt][st],Rt.sort(ot),Bt=gt[1-xt][st],Zt=Bt.concat(Rt),ee=[],Gt=0;Gt1?(Rt=st.r,Bt=Rt/ot.aspectratio):(Bt=st.r,Rt=Bt*ot.aspectratio),Rt*=(1+ot.baseratio)/2,Ct=Rt*Bt}mt=Math.min(mt,Ct/st.vTotal)}for(xt=0;xtit.vTotal/2?1:0,Rt.halfangle=Math.PI*Math.min(Rt.v/it.vTotal,.5),Rt.ring=1-xt.hole,Rt.rInscribed=B(Rt,it))}function vt(gt,it){return[gt*Math.sin(it),-gt*Math.cos(it)]}function ut(gt,it,st){var xt=gt._fullLayout,ot=st.trace,J=ot.texttemplate,mt=ot.textinfo;if(!J&&mt&&mt!=="none"){var dt=mt.split("+"),Ct=function(Lt){return dt.indexOf(Lt)!==-1},Rt=Ct("label"),Bt=Ct("text"),Zt=Ct("value"),Gt=Ct("percent"),ee=xt.separators,xe;if(xe=Rt?[it.label]:[],Bt){var ge=b.getFirstFilled(ot.text,it.pts);_(ge)&&xe.push(ge)}Zt&&xe.push(b.formatPieValue(it.v,ee)),Gt&&xe.push(b.formatPiePercent(it.v/st.vTotal,ee)),it.text=xe.join("
")}function ye(Lt){return{label:Lt.label,value:Lt.v,valueLabel:b.formatPieValue(Lt.v,xt.separators),percent:Lt.v/st.vTotal,percentLabel:b.formatPiePercent(Lt.v/st.vTotal,xt.separators),color:Lt.color,text:Lt.text,customdata:i.castOption(ot,Lt.i,"customdata")}}if(J){var ue=i.castOption(ot,it.i,"texttemplate");if(!ue)it.text="";else{var Mt=ye(it),Ot=b.getFirstFilled(ot.text,it.pts);(_(Ot)||Ot==="")&&(Mt.text=Ot),it.text=i.texttemplateString({data:[Mt,ot._meta],fallback:ot.texttemplatefallback,labels:Mt,locale:gt._fullLayout._d3locale,template:ue})}}}function rt(gt,it){var st=gt.rotate*Math.PI/180,xt=Math.cos(st),ot=Math.sin(st),J=(it.left+it.right)/2,mt=(it.top+it.bottom)/2;gt.textX=J*xt-mt*ot,gt.textY=J*ot+mt*xt,gt.noCenter=!0}Y.exports={plot:A,formatSliceLabel:ut,transformInsideText:I,determineInsideTextFont:D,positionTitleOutside:W,prerenderTitles:E,layoutAreas:tt,attachFxHandlers:k,computeTransform:rt}}),gK=It((et,Y)=>{var f=Br(),y=Wv(),z=C0().resizeText;Y.exports=function(P){var n=P._fullLayout._pielayer.selectAll(".trace");z(P,n,"pie"),n.each(function(i){var a=i[0],l=a.trace,o=f.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(c){f.select(this).call(y,c,l,P)})})}}),vK=It(et=>{var Y=lh();et.name="pie",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),yK=It((et,Y)=>{Y.exports={attributes:wb(),supplyDefaults:kb().supplyDefaults,supplyLayoutDefaults:pK(),layoutAttributes:fC(),calc:Uw().calc,crossTraceCalc:Uw().crossTraceCalc,plot:pC().plot,style:gK(),styleOne:Wv(),moduleType:"trace",name:"pie",basePlotModule:vK(),categories:["pie-like","pie","showLegend"],meta:{}}}),_K=It((et,Y)=>{Y.exports=yK()}),xK=It(et=>{var Y=lh();et.name="sunburst",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),JP=It((et,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),sk=It((et,Y)=>{var f=xa(),{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Ru(),i=Jh().attributes,a=wb(),l=JP(),o=Yn().extendFlat,c=qf().pattern;Y.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},a.marker.line.color,{dflt:null}),width:o({},a.marker.line.width,{dflt:1}),editType:"calc"},pattern:c,editType:"calc"},n("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:a.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:z({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:P({editType:"plot"}),hovertext:a.hovertext,hoverinfo:o({},f.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:y({},{keys:l.eventDataKeys}),hovertemplatefallback:P(),textfont:a.textfont,insidetextorientation:a.insidetextorientation,insidetextfont:a.insidetextfont,outsidetextfont:o({},a.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:a.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:i({name:"sunburst",trace:!0,editType:"calc"})}}),QP=It((et,Y)=>{Y.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),bK=It((et,Y)=>{var f=jn(),y=sk(),z=Jh().defaults,P=eg().handleText,n=kb().handleMarkerDefaults,i=ch(),a=i.hasColorscale,l=i.handleDefaults;Y.exports=function(o,c,s,h){function m(w,D){return f.coerce(o,c,y,w,D)}var b=m("labels"),x=m("parents");if(!b||!b.length||!x||!x.length){c.visible=!1;return}var _=m("values");_&&_.length?m("branchvalues"):m("count"),m("level"),m("maxdepth"),n(o,c,h,m);var A=c._hasColorscale=a(o,"marker","colors")||(o.marker||{}).coloraxis;A&&l(o,c,h,m,{prefix:"marker.",cLetter:"c"}),m("leaf.opacity",A?1:.7);var d=m("text");m("texttemplate"),m("texttemplatefallback"),c.texttemplate||m("textinfo",f.isArrayOrTypedArray(d)?"text+label":"label"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback");var k="auto";P(o,c,h,m,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),m("insidetextorientation"),m("sort"),m("rotation"),m("root.color"),z(c,h,m),c._length=null}}),wK=It((et,Y)=>{var f=jn(),y=QP();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("sunburstcolorway",P.colorway),n("extendsunburstcolors")}}),lk=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){function y(zt,_t){return zt.parent===_t.parent?1:2}function z(zt){return zt.reduce(P,0)/zt.length}function P(zt,_t){return zt+_t.x}function n(zt){return 1+zt.reduce(i,0)}function i(zt,_t){return Math.max(zt,_t.y)}function a(zt){for(var _t;_t=zt.children;)zt=_t[0];return zt}function l(zt){for(var _t;_t=zt.children;)zt=_t[_t.length-1];return zt}function o(){var zt=y,_t=1,Pt=1,Ht=!1;function ae(he){var Me,qe=0;he.eachAfter(function(xr){var pn=xr.children;pn?(xr.x=z(pn),xr.y=n(pn)):(xr.x=Me?qe+=zt(xr,Me):0,xr.y=0,Me=xr)});var Ye=a(he),ur=l(he),Rr=Ye.x-zt(Ye,ur)/2,zr=ur.x+zt(ur,Ye)/2;return he.eachAfter(Ht?function(xr){xr.x=(xr.x-he.x)*_t,xr.y=(he.y-xr.y)*Pt}:function(xr){xr.x=(xr.x-Rr)/(zr-Rr)*_t,xr.y=(1-(he.y?xr.y/he.y:1))*Pt})}return ae.separation=function(he){return arguments.length?(zt=he,ae):zt},ae.size=function(he){return arguments.length?(Ht=!1,_t=+he[0],Pt=+he[1],ae):Ht?null:[_t,Pt]},ae.nodeSize=function(he){return arguments.length?(Ht=!0,_t=+he[0],Pt=+he[1],ae):Ht?[_t,Pt]:null},ae}function c(zt){var _t=0,Pt=zt.children,Ht=Pt&&Pt.length;if(!Ht)_t=1;else for(;--Ht>=0;)_t+=Pt[Ht].value;zt.value=_t}function s(){return this.eachAfter(c)}function h(zt){var _t=this,Pt,Ht=[_t],ae,he,Me;do for(Pt=Ht.reverse(),Ht=[];_t=Pt.pop();)if(zt(_t),ae=_t.children,ae)for(he=0,Me=ae.length;he=0;--ae)Pt.push(Ht[ae]);return this}function b(zt){for(var _t=this,Pt=[_t],Ht=[],ae,he,Me;_t=Pt.pop();)if(Ht.push(_t),ae=_t.children,ae)for(he=0,Me=ae.length;he=0;)Pt+=Ht[ae].value;_t.value=Pt})}function _(zt){return this.eachBefore(function(_t){_t.children&&_t.children.sort(zt)})}function A(zt){for(var _t=this,Pt=d(_t,zt),Ht=[_t];_t!==Pt;)_t=_t.parent,Ht.push(_t);for(var ae=Ht.length;zt!==Pt;)Ht.splice(ae,0,zt),zt=zt.parent;return Ht}function d(zt,_t){if(zt===_t)return zt;var Pt=zt.ancestors(),Ht=_t.ancestors(),ae=null;for(zt=Pt.pop(),_t=Ht.pop();zt===_t;)ae=zt,zt=Pt.pop(),_t=Ht.pop();return ae}function k(){for(var zt=this,_t=[zt];zt=zt.parent;)_t.push(zt);return _t}function w(){var zt=[];return this.each(function(_t){zt.push(_t)}),zt}function D(){var zt=[];return this.eachBefore(function(_t){_t.children||zt.push(_t)}),zt}function E(){var zt=this,_t=[];return zt.each(function(Pt){Pt!==zt&&_t.push({source:Pt.parent,target:Pt})}),_t}function I(zt,_t){var Pt=new S(zt),Ht=+zt.value&&(Pt.value=zt.value),ae,he=[Pt],Me,qe,Ye,ur;for(_t==null&&(_t=p);ae=he.pop();)if(Ht&&(ae.value=+ae.data.value),(qe=_t(ae.data))&&(ur=qe.length))for(ae.children=new Array(ur),Ye=ur-1;Ye>=0;--Ye)he.push(Me=ae.children[Ye]=new S(qe[Ye])),Me.parent=ae,Me.depth=ae.depth+1;return Pt.eachBefore(C)}function M(){return I(this).eachBefore(g)}function p(zt){return zt.children}function g(zt){zt.data=zt.data.data}function C(zt){var _t=0;do zt.height=_t;while((zt=zt.parent)&&zt.height<++_t)}function S(zt){this.data=zt,this.depth=this.height=0,this.parent=null}S.prototype=I.prototype={constructor:S,count:s,each:h,eachAfter:b,eachBefore:m,sum:x,sort:_,path:A,ancestors:k,descendants:w,leaves:D,links:E,copy:M};var N=Array.prototype.slice;function B(zt){for(var _t=zt.length,Pt,Ht;_t;)Ht=Math.random()*_t--|0,Pt=zt[_t],zt[_t]=zt[Ht],zt[Ht]=Pt;return zt}function U(zt){for(var _t=0,Pt=(zt=B(N.call(zt))).length,Ht=[],ae,he;_t0&&Pt*Pt>Ht*Ht+ae*ae}function H(zt,_t){for(var Pt=0;Pt<_t.length;++Pt)if(!F(zt,_t[Pt]))return!1;return!0}function q(zt){switch(zt.length){case 1:return G(zt[0]);case 2:return tt(zt[0],zt[1]);case 3:return ht(zt[0],zt[1],zt[2])}}function G(zt){return{x:zt.x,y:zt.y,r:zt.r}}function tt(zt,_t){var Pt=zt.x,Ht=zt.y,ae=zt.r,he=_t.x,Me=_t.y,qe=_t.r,Ye=he-Pt,ur=Me-Ht,Rr=qe-ae,zr=Math.sqrt(Ye*Ye+ur*ur);return{x:(Pt+he+Ye/zr*Rr)/2,y:(Ht+Me+ur/zr*Rr)/2,r:(zr+ae+qe)/2}}function ht(zt,_t,Pt){var Ht=zt.x,ae=zt.y,he=zt.r,Me=_t.x,qe=_t.y,Ye=_t.r,ur=Pt.x,Rr=Pt.y,zr=Pt.r,xr=Ht-Me,pn=Ht-ur,ci=ae-qe,ui=ae-Rr,yi=Ye-he,Gi=zr-he,Ci=Ht*Ht+ae*ae-he*he,fi=Ci-Me*Me-qe*qe+Ye*Ye,ba=Ci-ur*ur-Rr*Rr+zr*zr,oa=pn*ci-xr*ui,Ke=(ci*ba-ui*fi)/(oa*2)-Ht,sr=(ui*yi-ci*Gi)/oa,vr=(pn*fi-xr*ba)/(oa*2)-ae,Ar=(xr*Gi-pn*yi)/oa,mn=sr*sr+Ar*Ar-1,Zn=2*(he+Ke*sr+vr*Ar),Un=Ke*Ke+vr*vr-he*he,Wn=-(mn?(Zn+Math.sqrt(Zn*Zn-4*mn*Un))/(2*mn):Un/Zn);return{x:Ht+Ke+sr*Wn,y:ae+vr+Ar*Wn,r:Wn}}function bt(zt,_t,Pt){var Ht=zt.x-_t.x,ae,he,Me=zt.y-_t.y,qe,Ye,ur=Ht*Ht+Me*Me;ur?(he=_t.r+Pt.r,he*=he,Ye=zt.r+Pt.r,Ye*=Ye,he>Ye?(ae=(ur+Ye-he)/(2*ur),qe=Math.sqrt(Math.max(0,Ye/ur-ae*ae)),Pt.x=zt.x-ae*Ht-qe*Me,Pt.y=zt.y-ae*Me+qe*Ht):(ae=(ur+he-Ye)/(2*ur),qe=Math.sqrt(Math.max(0,he/ur-ae*ae)),Pt.x=_t.x+ae*Ht-qe*Me,Pt.y=_t.y+ae*Me+qe*Ht)):(Pt.x=_t.x+Pt.r,Pt.y=_t.y)}function vt(zt,_t){var Pt=zt.r+_t.r-1e-6,Ht=_t.x-zt.x,ae=_t.y-zt.y;return Pt>0&&Pt*Pt>Ht*Ht+ae*ae}function ut(zt){var _t=zt._,Pt=zt.next._,Ht=_t.r+Pt.r,ae=(_t.x*Pt.r+Pt.x*_t.r)/Ht,he=(_t.y*Pt.r+Pt.y*_t.r)/Ht;return ae*ae+he*he}function rt(zt){this._=zt,this.next=null,this.previous=null}function gt(zt){if(!(ae=zt.length))return 0;var _t,Pt,Ht,ae,he,Me,qe,Ye,ur,Rr,zr;if(_t=zt[0],_t.x=0,_t.y=0,!(ae>1))return _t.r;if(Pt=zt[1],_t.x=-Pt.r,Pt.x=_t.r,Pt.y=0,!(ae>2))return _t.r+Pt.r;bt(Pt,_t,Ht=zt[2]),_t=new rt(_t),Pt=new rt(Pt),Ht=new rt(Ht),_t.next=Ht.previous=Pt,Pt.next=_t.previous=Ht,Ht.next=Pt.previous=_t;t:for(qe=3;qe0)throw new Error("cycle");return qe}return Pt.id=function(Ht){return arguments.length?(zt=xt(Ht),Pt):zt},Pt.parentId=function(Ht){return arguments.length?(_t=xt(Ht),Pt):_t},Pt}function Lt(zt,_t){return zt.parent===_t.parent?1:2}function ie(zt){var _t=zt.children;return _t?_t[0]:zt.t}function be(zt){var _t=zt.children;return _t?_t[_t.length-1]:zt.t}function ce(zt,_t,Pt){var Ht=Pt/(_t.i-zt.i);_t.c-=Ht,_t.s+=Pt,zt.c+=Ht,_t.z+=Pt,_t.m+=Pt}function Le(zt){for(var _t=0,Pt=0,Ht=zt.children,ae=Ht.length,he;--ae>=0;)he=Ht[ae],he.z+=_t,he.m+=_t,_t+=he.s+(Pt+=he.c)}function Ze(zt,_t,Pt){return zt.a.parent===_t.parent?zt.a:Pt}function Qe(zt,_t){this._=zt,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=_t}Qe.prototype=Object.create(S.prototype);function mr(zt){for(var _t=new Qe(zt,0),Pt,Ht=[_t],ae,he,Me,qe;Pt=Ht.pop();)if(he=Pt._.children)for(Pt.children=new Array(qe=he.length),Me=qe-1;Me>=0;--Me)Ht.push(ae=Pt.children[Me]=new Qe(he[Me],Me)),ae.parent=Pt;return(_t.parent=new Qe(null,0)).children=[_t],_t}function fr(){var zt=Lt,_t=1,Pt=1,Ht=null;function ae(ur){var Rr=mr(ur);if(Rr.eachAfter(he),Rr.parent.m=-Rr.z,Rr.eachBefore(Me),Ht)ur.eachBefore(Ye);else{var zr=ur,xr=ur,pn=ur;ur.eachBefore(function(Ci){Ci.xxr.x&&(xr=Ci),Ci.depth>pn.depth&&(pn=Ci)});var ci=zr===xr?1:zt(zr,xr)/2,ui=ci-zr.x,yi=_t/(xr.x+ci+ui),Gi=Pt/(pn.depth||1);ur.eachBefore(function(Ci){Ci.x=(Ci.x+ui)*yi,Ci.y=Ci.depth*Gi})}return ur}function he(ur){var Rr=ur.children,zr=ur.parent.children,xr=ur.i?zr[ur.i-1]:null;if(Rr){Le(ur);var pn=(Rr[0].z+Rr[Rr.length-1].z)/2;xr?(ur.z=xr.z+zt(ur._,xr._),ur.m=ur.z-pn):ur.z=pn}else xr&&(ur.z=xr.z+zt(ur._,xr._));ur.parent.A=qe(ur,xr,ur.parent.A||zr[0])}function Me(ur){ur._.x=ur.z+ur.parent.m,ur.m+=ur.parent.m}function qe(ur,Rr,zr){if(Rr){for(var xr=ur,pn=ur,ci=Rr,ui=xr.parent.children[0],yi=xr.m,Gi=pn.m,Ci=ci.m,fi=ui.m,ba;ci=be(ci),xr=ie(xr),ci&&xr;)ui=ie(ui),pn=be(pn),pn.a=ur,ba=ci.z+Ci-xr.z-yi+zt(ci._,xr._),ba>0&&(ce(Ze(ci,ur,zr),ur,ba),yi+=ba,Gi+=ba),Ci+=ci.m,yi+=xr.m,fi+=ui.m,Gi+=pn.m;ci&&!be(pn)&&(pn.t=ci,pn.m+=Ci-Gi),xr&&!ie(ui)&&(ui.t=xr,ui.m+=yi-fi,zr=ur)}return zr}function Ye(ur){ur.x*=_t,ur.y=ur.depth*Pt}return ae.separation=function(ur){return arguments.length?(zt=ur,ae):zt},ae.size=function(ur){return arguments.length?(Ht=!1,_t=+ur[0],Pt=+ur[1],ae):Ht?null:[_t,Pt]},ae.nodeSize=function(ur){return arguments.length?(Ht=!0,_t=+ur[0],Pt=+ur[1],ae):Ht?[_t,Pt]:null},ae}function Jr(zt,_t,Pt,Ht,ae){for(var he=zt.children,Me,qe=-1,Ye=he.length,ur=zt.value&&(ae-Pt)/zt.value;++qeCi&&(Ci=ur),Ke=yi*yi*oa,fi=Math.max(Ci/Ke,Ke/Gi),fi>ba){yi-=ur;break}ba=fi}Me.push(Ye={value:yi,dice:pn1?Ht:1)},Pt}(an);function _n(){var zt=dn,_t=!1,Pt=1,Ht=1,ae=[0],he=ot,Me=ot,qe=ot,Ye=ot,ur=ot;function Rr(xr){return xr.x0=xr.y0=0,xr.x1=Pt,xr.y1=Ht,xr.eachBefore(zr),ae=[0],_t&&xr.eachBefore(Zt),xr}function zr(xr){var pn=ae[xr.depth],ci=xr.x0+pn,ui=xr.y0+pn,yi=xr.x1-pn,Gi=xr.y1-pn;yi=xr-1){var Ci=he[zr];Ci.x0=ci,Ci.y0=ui,Ci.x1=yi,Ci.y1=Gi;return}for(var fi=ur[zr],ba=pn/2+fi,oa=zr+1,Ke=xr-1;oa>>1;ur[sr]Gi-ui){var mn=(ci*Ar+yi*vr)/pn;Rr(zr,oa,vr,ci,ui,mn,Gi),Rr(oa,xr,Ar,mn,ui,yi,Gi)}else{var Zn=(ui*Ar+Gi*vr)/pn;Rr(zr,oa,vr,ci,ui,yi,Zn),Rr(oa,xr,Ar,ci,Zn,yi,Gi)}}}function Xt(zt,_t,Pt,Ht,ae){(zt.depth&1?Jr:Gt)(zt,_t,Pt,Ht,ae)}var oe=function zt(_t){function Pt(Ht,ae,he,Me,qe){if((Ye=Ht._squarify)&&Ye.ratio===_t)for(var Ye,ur,Rr,zr,xr=-1,pn,ci=Ye.length,ui=Ht.value;++xr1?Ht:1)},Pt}(an);f.cluster=o,f.hierarchy=I,f.pack=dt,f.packEnclose=U,f.packSiblings=it,f.partition=ee,f.stratify=Ot,f.tree=fr,f.treemap=_n,f.treemapBinary=Oe,f.treemapDice=Gt,f.treemapResquarify=oe,f.treemapSlice=Jr,f.treemapSliceDice=Xt,f.treemapSquarify=dn,Object.defineProperty(f,"__esModule",{value:!0})})}),ck=It(et=>{var Y=lk(),f=Sr(),y=jn(),z=ch().makeColorScaleFuncFromTrace,P=Uw().makePullColorFn,n=Uw().generateExtendedColors,i=ch().calc,a=Dr().ALMOST_EQUAL,l={},o={},c={};et.calc=function(h,m){var b=h._fullLayout,x=m.ids,_=y.isArrayOrTypedArray(x),A=m.labels,d=m.parents,k=m.values,w=y.isArrayOrTypedArray(k),D=[],E={},I={},M=function(it,st){E[it]?E[it].push(st):E[it]=[st],I[st]=1},p=function(it){return it||typeof it=="number"},g=function(it){return!w||f(k[it])&&k[it]>=0},C,S,N;_?(C=Math.min(x.length,d.length),S=function(it){return p(x[it])&&g(it)},N=function(it){return String(x[it])}):(C=Math.min(A.length,d.length),S=function(it){return p(A[it])&&g(it)},N=function(it){return String(A[it])}),w&&(C=Math.min(C,k.length));for(var B=0;B1){for(var F=y.randstr(),H=0;H{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=f("8BPS\0");Y.exports=function(n){if(!(n.length<22)&&y(n,0,P))return{width:z(n,18),height:z(n,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),eK=It((et,Y)=>{function f(h){return h===32||h===9||h===13||h===10}function y(h){return typeof h=="number"&&isFinite(h)&&h>0}function z(h){var m=0,b=h.length;for(h[0]===239&&h[1]===187&&h[2]===191&&(m=3);m]*>/,n=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,i=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,o=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(h){var m=h.match(i),b=h.match(a),x=h.match(l);return{width:m&&(m[1]||m[2]),height:b&&(b[1]||b[2]),viewbox:x&&(x[1]||x[2])}}function s(h){return o.test(h)?h.match(o)[0]:"px"}Y.exports=function(h){if(z(h)){for(var m="",b=0;b{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt16BE,n=Ch().readUInt32LE,i=Ch().readUInt32BE,a=f("II*\0"),l=f("MM\0*");function o(h,m,b){return b?P(h,m):z(h,m)}function c(h,m,b){return b?i(h,m):n(h,m)}function s(h,m,b){var x=o(h,m+2,b),_=c(h,m+4,b);return _!==1||x!==3&&x!==4?null:x===3?o(h,m+8,b):c(h,m+8,b)}Y.exports=function(h){if(!(h.length<8)&&!(!y(h,0,a)&&!y(h,0,l))){var m=h[0]===77,b=c(h,4,m)-8;if(!(b<0)){var x=b+8;if(!(h.length-x<2)){var _=o(h,x+0,m)*12;if(!(_<=0)&&(x+=2,!(h.length-x<_))){var A,d,k,w;for(A=0;A<_;A+=12)w=o(h,x+A,m),w===256?d=s(h,x+A,m):w===257&&(k=s(h,x+A,m));if(d&&k)return{width:d,height:k,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),nK=It((et,Y)=>{var f=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt32LE,n=dC(),i=f("RIFF"),a=f("WEBP");function l(s,h){if(!(s[h+3]!==157||s[h+4]!==1||s[h+5]!==42))return{width:z(s,h+6)&16383,height:z(s,h+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function o(s,h){if(s[h]===47){var m=P(s,h+1);return{width:(m&16383)+1,height:(m>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function c(s,h){return{width:(s[h+6]<<16|s[h+5]<<8|s[h+4])+1,height:(s[h+9]<s.length)){for(;h+8=10?m=m||l(s,h+8):_==="VP8L"&&A>=9?m=m||o(s,h+8):_==="VP8X"&&A>=10?m=m||c(s,h+8):_==="EXIF"&&(b=n.get_orientation(s.slice(h+8,h+8+A)),h=1/0),h+=8+A}if(m)return b>0&&(m.orientation=b),m}}}}),iK=It((et,Y)=>{Y.exports={avif:ZZ(),bmp:KZ(),gif:YZ(),ico:XZ(),jpeg:JZ(),png:QZ(),psd:tK(),svg:eK(),tiff:rK(),webp:nK()}}),aK=It((et,Y)=>{var f=iK();function y(z){for(var P=Object.keys(f),n=0;n{var Y=aK(),f=K0().IMAGE_URL_PREFIX,y=_b().Buffer;et.getImageSize=function(z){var P=z.replace(f,""),n=new y(P,"base64");return Y(n)}}),sK=It((et,Y)=>{var f=jn(),y=Bw(),z=Sr(),P=Fs(),n=jn().maxRowLength,i=oK().getImageSize;Y.exports=function(c,s){var h,m;if(s._hasZ)h=s.z.length,m=n(s.z);else if(s._hasSource){var b=i(s.source);h=b.height,m=b.width}var x=P.getFromId(c,s.xaxis||"x"),_=P.getFromId(c,s.yaxis||"y"),A=x.d2c(s.x0)-s.dx/2,d=_.d2c(s.y0)-s.dy/2,k,w=[A,A+m*s.dx],D=[d,d+h*s.dy];if(x&&x.type==="log")for(k=0;k{var f=Br(),y=jn(),z=y.strTranslate,P=k0(),n=Bw(),i=eP(),a=G8().STYLE;Y.exports=function(l,o,c,s){var h=o.xaxis,m=o.yaxis,b=!l._context._exportedPlot&&i();y.makeTraceGroups(s,c,"im").each(function(x){var _=f.select(this),A=x[0],d=A.trace,k=(d.zsmooth==="fast"||d.zsmooth===!1&&b)&&!d._hasZ&&d._hasSource&&h.type==="linear"&&m.type==="linear";d._realImage=k;var w=A.z,D=A.x0,E=A.y0,I=A.w,M=A.h,p=d.dx,g=d.dy,C,S,N,B,U,V;for(V=0;C===void 0&&V0;)S=h.c2p(D+V*p),V--;for(V=0;B===void 0&&V0;)U=m.c2p(E+V*g),V--;if(Sut[0];if(rt||gt){var it=C+F/2,st=B+H/2;bt+="transform:"+z(it+"px",st+"px")+"scale("+(rt?-1:1)+","+(gt?-1:1)+")"+z(-it+"px",-st+"px")+";"}}ht.attr("style",bt);var xt=new Promise(function(ot){if(d._hasZ)ot();else if(d._hasSource)if(d._canvas&&d._canvas.el.width===I&&d._canvas.el.height===M&&d._canvas.source===d.source)ot();else{var J=document.createElement("canvas");J.width=I,J.height=M;var mt=J.getContext("2d",{willReadFrequently:!0});d._image=d._image||new Image;var dt=d._image;dt.onload=function(){mt.drawImage(dt,0,0),d._canvas={el:J,source:d.source},ot()},dt.setAttribute("src",d.source)}}).then(function(){var ot,J;if(d._hasZ)J=tt(function(Ct,Rt){var Bt=w[Rt][Ct];return y.isTypedArray(Bt)&&(Bt=Array.from(Bt)),Bt}),ot=J.toDataURL("image/png");else if(d._hasSource)if(k)ot=d.source;else{var mt=d._canvas.el.getContext("2d",{willReadFrequently:!0}),dt=mt.getImageData(0,0,I,M).data;J=tt(function(Ct,Rt){var Bt=4*(Rt*I+Ct);return[dt[Bt],dt[Bt+1],dt[Bt+2],dt[Bt+3]]}),ot=J.toDataURL("image/png")}ht.attr({"xlink:href":ot,height:H,width:F,x:C,y:B})});l._promises.push(xt)})}}),cK=It((et,Y)=>{var f=Br();Y.exports=function(y){f.select(y).selectAll(".im image").style("opacity",function(z){return z[0].trace.opacity})}}),uK=It((et,Y)=>{var f=hd(),y=jn(),z=y.isArrayOrTypedArray,P=Bw();Y.exports=function(n,i,a){var l=n.cd[0],o=l.trace,c=n.xa,s=n.ya;if(!(f.inbox(i-l.x0,i-(l.x0+l.w*o.dx),0)>0||f.inbox(a-l.y0,a-(l.y0+l.h*o.dy),0)>0)){var h=Math.floor((i-l.x0)/o.dx),m=Math.floor(Math.abs(a-l.y0)/o.dy),b;if(o._hasZ?b=l.z[m][h]:o._hasSource&&(b=o._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(h,m,1,1).data),!!b){var x=l.hi||o.hoverinfo,_;if(x){var A=x.split("+");A.indexOf("all")!==-1&&(A=["color"]),A.indexOf("color")!==-1&&(_=!0)}var d=P.colormodel[o.colormodel],k=d.colormodel||o.colormodel,w=k.length,D=o._scaler(b),E=d.suffix,I=[];(o.hovertemplate||_)&&(I.push("["+[D[0]+E[0],D[1]+E[1],D[2]+E[2]].join(", ")),w===4&&I.push(", "+D[3]+E[3]),I.push("]"),I=I.join(""),n.extraText=k.toUpperCase()+": "+I);var M;z(o.hovertext)&&z(o.hovertext[m])?M=o.hovertext[m][h]:z(o.text)&&z(o.text[m])&&(M=o.text[m][h]);var p=s.c2p(l.y0+(m+.5)*o.dy),g=l.x0+(h+.5)*o.dx,C=l.y0+(m+.5)*o.dy,S="["+b.slice(0,o.colormodel.length).join(", ")+"]";return[y.extendFlat(n,{index:[m,h],x0:c.c2p(l.x0+h*o.dx),x1:c.c2p(l.x0+(h+1)*o.dx),y0:p,y1:p,color:D,xVal:g,xLabelVal:g,yVal:C,yLabelVal:C,zLabelVal:S,text:M,hovertemplateLabels:{zLabel:S,colorLabel:I,"color[0]Label":D[0]+E[0],"color[1]Label":D[1]+E[1],"color[2]Label":D[2]+E[2],"color[3]Label":D[3]+E[3]}})]}}}}),hK=It((et,Y)=>{Y.exports=function(f,y){return"xVal"in y&&(f.x=y.xVal),"yVal"in y&&(f.y=y.yVal),y.xa&&(f.xaxis=y.xa),y.ya&&(f.yaxis=y.ya),f.color=y.color,f.colormodel=y.trace.colormodel,f.z||(f.z=y.color),f}}),dK=It((et,Y)=>{Y.exports={attributes:AP(),supplyDefaults:ZG(),calc:sK(),plot:lK(),style:cK(),hoverPoints:uK(),eventData:hK(),moduleType:"trace",name:"image",basePlotModule:Fd(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),fK=It((et,Y)=>{Y.exports=dK()}),kb=It((et,Y)=>{var f=xa(),y=Jh().attributes,z=hi(),P=Sn(),{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=Yn().extendFlat,o=qf().pattern,c=z({editType:"plot",arrayOk:!0,colorEditType:"plot"});Y.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:P.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},f.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:n({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:a(),texttemplate:i({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:a({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},c,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},c,{}),outsidetextfont:l({},c,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},c,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:y({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),Tb=It((et,Y)=>{var f=Sr(),y=jn(),z=kb(),P=Jh().defaults,n=eg().handleText,i=jn().coercePattern;function a(c,s){var h=y.isArrayOrTypedArray(c),m=y.isArrayOrTypedArray(s),b=Math.min(h?c.length:1/0,m?s.length:1/0);if(isFinite(b)||(b=0),b&&m){for(var x,_=0;_0){x=!0;break}}x||(b=0)}return{hasLabels:h,hasValues:m,len:b}}function l(c,s,h,m,b){var x=m("marker.line.width");x&&m("marker.line.color",b?void 0:h.paper_bgcolor);var _=m("marker.colors");i(m,"marker.pattern",_),c.marker&&!s.marker.pattern.fgcolor&&(s.marker.pattern.fgcolor=c.marker.colors),s.marker.pattern.bgcolor||(s.marker.pattern.bgcolor=h.paper_bgcolor)}function o(c,s,h,m){function b(S,N){return y.coerce(c,s,z,S,N)}var x=b("labels"),_=b("values"),A=a(x,_),d=A.len;if(s._hasLabels=A.hasLabels,s._hasValues=A.hasValues,!s._hasLabels&&s._hasValues&&(b("label0"),b("dlabel")),!d){s.visible=!1;return}s._length=d,l(c,s,m,b,!0),b("scalegroup");var k=b("text"),w=b("texttemplate");b("texttemplatefallback");var D;if(w||(D=b("textinfo",y.isArrayOrTypedArray(k)?"text+percent":"percent")),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),w||D&&D!=="none"){var E=b("textposition");n(c,s,m,b,E,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var I=Array.isArray(E)||E==="auto",M=I||E==="outside";M&&b("automargin"),(E==="inside"||E==="auto"||Array.isArray(E))&&b("insidetextorientation")}else D==="none"&&b("textposition","none");P(s,m,b);var p=b("hole"),g=b("title.text");if(g){var C=b("title.position",p?"middle center":"top center");!p&&C==="middle center"&&(s.title.position="top center"),y.coerceFont(b,"title.font",m.font)}b("sort"),b("direction"),b("rotation"),b("pull")}Y.exports={handleLabelsAndValues:a,handleMarkerDefaults:l,supplyDefaults:o}}),fC=It((et,Y)=>{Y.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),pK=It((et,Y)=>{var f=jn(),y=fC();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("hiddenlabels"),n("piecolorway",P.colorway),n("extendpiecolors")}}),Uw=It((et,Y)=>{var f=Sr(),y=Xi(),z=Hn(),P={};function n(o,c){var s=[],h=o._fullLayout,m=h.hiddenlabels||[],b=c.labels,x=c.marker.colors||[],_=c.values,A=c._length,d=c._hasValues&&A,k,w;if(c.dlabel)for(b=new Array(A),k=0;k=0});var N=c.type==="funnelarea"?M:c.sort;return N&&s.sort(function(B,U){return U.v-B.v}),s[0]&&(s[0].vTotal=I),s}function i(o){return function(c,s){return!c||(c=y(c),!c.isValid())?!1:(c=z.addOpacity(c,c.getAlpha()),o[s]||(o[s]=c),c)}}function a(o,c){var s=(c||{}).type;s||(s="pie");var h=o._fullLayout,m=o.calcdata,b=h[s+"colorway"],x=h["_"+s+"colormap"];h["extend"+s+"colors"]&&(b=l(b,P));for(var _=0,A=0;A{var f=T0().appendArrayMultiPointValues;Y.exports=function(y,z){var P={curveNumber:z.index,pointNumbers:y.pts,data:z._input,fullData:z,label:y.label,color:y.color,value:y.v,percent:y.percent,text:y.text,bbox:y.bbox,v:y.v};return y.pts.length===1&&(P.pointNumber=P.i=y.pts[0]),f(P,z,y.pts),z.type==="funnelarea"&&(delete P.v,delete P.i),P}}),pC=It((et,Y)=>{var f=Br(),y=lh(),z=hd(),P=Hn(),n=Js(),i=jn(),a=i.strScale,l=i.strTranslate,o=uu(),c=C0(),s=c.recordMinTextSize,h=c.clearMinTextSize,m=vb().TEXTPAD,b=Vv(),x=mK(),_=jn().isValidTextValue;function A(gt,it){var st=gt._context.staticPlot,xt=gt._fullLayout,ot=xt._size;h("pie",xt),E(it,gt),tt(it,ot);var J=i.makeTraceGroups(xt._pielayer,it,"trace").each(function(mt){var dt=f.select(this),Ct=mt[0],Rt=Ct.trace;bt(mt),dt.attr("stroke-linejoin","round"),dt.each(function(){var Bt=f.select(this).selectAll("g.slice").data(mt);Bt.enter().append("g").classed("slice",!0),Bt.exit().remove();var Zt=[[[],[]],[[],[]]],Gt=!1;Bt.each(function(Lt,ie){if(Lt.hidden){f.select(this).selectAll("path,g").remove();return}Lt.pointNumber=Lt.i,Lt.curveNumber=Rt.index,Zt[Lt.pxmid[1]<0?0:1][Lt.pxmid[0]<0?0:1].push(Lt);var be=Ct.cx,ce=Ct.cy,Le=f.select(this),Ze=Le.selectAll("path.surface").data([Lt]);if(Ze.enter().append("path").classed("surface",!0).style({"pointer-events":st?"none":"all"}),Le.call(k,gt,mt),Rt.pull){var Qe=+b.castOption(Rt.pull,Lt.pts)||0;Qe>0&&(be+=Qe*Lt.pxmid[0],ce+=Qe*Lt.pxmid[1])}Lt.cxFinal=be,Lt.cyFinal=ce;function mr(Oe,Xt,oe,zt){var _t=zt*(Xt[0]-Oe[0]),Pt=zt*(Xt[1]-Oe[1]);return"a"+zt*Ct.r+","+zt*Ct.r+" 0 "+Lt.largeArc+(oe?" 1 ":" 0 ")+_t+","+Pt}var fr=Rt.hole;if(Lt.v===Ct.vTotal){var Jr="M"+(be+Lt.px0[0])+","+(ce+Lt.px0[1])+mr(Lt.px0,Lt.pxmid,!0,1)+mr(Lt.pxmid,Lt.px0,!0,1)+"Z";fr?Ze.attr("d","M"+(be+fr*Lt.px0[0])+","+(ce+fr*Lt.px0[1])+mr(Lt.px0,Lt.pxmid,!1,fr)+mr(Lt.pxmid,Lt.px0,!1,fr)+"Z"+Jr):Ze.attr("d",Jr)}else{var an=mr(Lt.px0,Lt.px1,!0,1);if(fr){var Er=1-fr;Ze.attr("d","M"+(be+fr*Lt.px1[0])+","+(ce+fr*Lt.px1[1])+mr(Lt.px1,Lt.px0,!1,fr)+"l"+Er*Lt.px0[0]+","+Er*Lt.px0[1]+an+"Z")}else Ze.attr("d","M"+be+","+ce+"l"+Lt.px0[0]+","+Lt.px0[1]+an+"Z")}ut(gt,Lt,Ct);var dn=b.castOption(Rt.textposition,Lt.pts),_n=Le.selectAll("g.slicetext").data(Lt.text&&dn!=="none"?[0]:[]);_n.enter().append("g").classed("slicetext",!0),_n.exit().remove(),_n.each(function(){var Oe=i.ensureSingle(f.select(this),"text","",function(he){he.attr("data-notex",1)}),Xt=i.ensureUniformFontSize(gt,dn==="outside"?w(Rt,Lt,xt.font):D(Rt,Lt,xt.font));Oe.text(Lt.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,Xt).call(o.convertToTspans,gt);var oe=n.bBox(Oe.node()),zt;if(dn==="outside")zt=U(oe,Lt);else if(zt=I(oe,Lt,Ct),dn==="auto"&&zt.scale<1){var _t=i.ensureUniformFontSize(gt,Rt.outsidetextfont);Oe.call(n.font,_t),oe=n.bBox(Oe.node()),zt=U(oe,Lt)}var Pt=zt.textPosAngle,Ht=Pt===void 0?Lt.pxmid:vt(Ct.r,Pt);if(zt.targetX=be+Ht[0]*zt.rCenter+(zt.x||0),zt.targetY=ce+Ht[1]*zt.rCenter+(zt.y||0),rt(zt,oe),zt.outside){var ae=zt.targetY;Lt.yLabelMin=ae-oe.height/2,Lt.yLabelMid=ae,Lt.yLabelMax=ae+oe.height/2,Lt.labelExtraX=0,Lt.labelExtraY=0,Gt=!0}zt.fontSize=Xt.size,s(Rt.type,zt,xt),mt[ie].transform=zt,i.setTransormAndDisplay(Oe,zt)})});var ee=f.select(this).selectAll("g.titletext").data(Rt.title.text?[0]:[]);if(ee.enter().append("g").classed("titletext",!0),ee.exit().remove(),ee.each(function(){var Lt=i.ensureSingle(f.select(this),"text","",function(ce){ce.attr("data-notex",1)}),ie=Rt.title.text;Rt._meta&&(ie=i.templateString(ie,Rt._meta)),Lt.text(ie).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,Rt.title.font).call(o.convertToTspans,gt);var be;Rt.title.position==="middle center"?be=V(Ct):be=W(Ct,ot),Lt.attr("transform",l(be.x,be.y)+a(Math.min(1,be.scale))+l(be.tx,be.ty))}),Gt&&G(Zt,Rt),d(Bt,Rt),Gt&&Rt.automargin){var xe=n.bBox(dt.node()),ge=Rt.domain,ye=ot.w*(ge.x[1]-ge.x[0]),ue=ot.h*(ge.y[1]-ge.y[0]),Mt=(.5*ye-Ct.r)/ot.w,Ot=(.5*ue-Ct.r)/ot.h;y.autoMargin(gt,"pie."+Rt.uid+".automargin",{xl:ge.x[0]-Mt,xr:ge.x[1]+Mt,yb:ge.y[0]-Ot,yt:ge.y[1]+Ot,l:Math.max(Ct.cx-Ct.r-xe.left,0),r:Math.max(xe.right-(Ct.cx+Ct.r),0),b:Math.max(xe.bottom-(Ct.cy+Ct.r),0),t:Math.max(Ct.cy-Ct.r-xe.top,0),pad:5})}})});setTimeout(function(){J.selectAll("tspan").each(function(){var mt=f.select(this);mt.attr("dy")&&mt.attr("dy",mt.attr("dy"))})},0)}function d(gt,it){gt.each(function(st){var xt=f.select(this);if(!st.labelExtraX&&!st.labelExtraY){xt.select("path.textline").remove();return}var ot=xt.select("g.slicetext text");st.transform.targetX+=st.labelExtraX,st.transform.targetY+=st.labelExtraY,i.setTransormAndDisplay(ot,st.transform);var J=st.cxFinal+st.pxmid[0],mt=st.cyFinal+st.pxmid[1],dt="M"+J+","+mt,Ct=(st.yLabelMax-st.yLabelMin)*(st.pxmid[0]<0?-1:1)/4;if(st.labelExtraX){var Rt=st.labelExtraX*st.pxmid[1]/st.pxmid[0],Bt=st.yLabelMid+st.labelExtraY-(st.cyFinal+st.pxmid[1]);Math.abs(Rt)>Math.abs(Bt)?dt+="l"+Bt*st.pxmid[0]/st.pxmid[1]+","+Bt+"H"+(J+st.labelExtraX+Ct):dt+="l"+st.labelExtraX+","+Rt+"v"+(Bt-Rt)+"h"+Ct}else dt+="V"+(st.yLabelMid+st.labelExtraY)+"h"+Ct;i.ensureSingle(xt,"path","textline").call(P.stroke,it.outsidetextfont.color).attr({"stroke-width":Math.min(2,it.outsidetextfont.size/8),d:dt,fill:"none"})})}function k(gt,it,st){var xt=st[0],ot=xt.cx,J=xt.cy,mt=xt.trace,dt=mt.type==="funnelarea";"_hasHoverLabel"in mt||(mt._hasHoverLabel=!1),"_hasHoverEvent"in mt||(mt._hasHoverEvent=!1),gt.on("mouseover",function(Ct){var Rt=it._fullLayout,Bt=it._fullData[mt.index];if(!(it._dragging||Rt.hovermode===!1)){var Zt=Bt.hoverinfo;if(Array.isArray(Zt)&&(Zt=z.castHoverinfo({hoverinfo:[b.castOption(Zt,Ct.pts)],_module:mt._module},Rt,0)),Zt==="all"&&(Zt="label+text+value+percent+name"),Bt.hovertemplate||Zt!=="none"&&Zt!=="skip"&&Zt){var Gt=Ct.rInscribed||0,ee=ot+Ct.pxmid[0]*(1-Gt),xe=J+Ct.pxmid[1]*(1-Gt),ge=Rt.separators,ye=[];if(Zt&&Zt.indexOf("label")!==-1&&ye.push(Ct.label),Ct.text=b.castOption(Bt.hovertext||Bt.text,Ct.pts),Zt&&Zt.indexOf("text")!==-1){var ue=Ct.text;i.isValidTextValue(ue)&&ye.push(ue)}Ct.value=Ct.v,Ct.valueLabel=b.formatPieValue(Ct.v,ge),Zt&&Zt.indexOf("value")!==-1&&ye.push(Ct.valueLabel),Ct.percent=Ct.v/xt.vTotal,Ct.percentLabel=b.formatPiePercent(Ct.percent,ge),Zt&&Zt.indexOf("percent")!==-1&&ye.push(Ct.percentLabel);var Mt=Bt.hoverlabel,Ot=Mt.font,Lt=[];z.loneHover({trace:mt,x0:ee-Gt*xt.r,x1:ee+Gt*xt.r,y:xe,_x0:dt?ot+Ct.TL[0]:ee-Gt*xt.r,_x1:dt?ot+Ct.TR[0]:ee+Gt*xt.r,_y0:dt?J+Ct.TL[1]:xe-Gt*xt.r,_y1:dt?J+Ct.BL[1]:xe+Gt*xt.r,text:ye.join("
"),name:Bt.hovertemplate||Zt.indexOf("name")!==-1?Bt.name:void 0,idealAlign:Ct.pxmid[0]<0?"left":"right",color:b.castOption(Mt.bgcolor,Ct.pts)||Ct.color,borderColor:b.castOption(Mt.bordercolor,Ct.pts),fontFamily:b.castOption(Ot.family,Ct.pts),fontSize:b.castOption(Ot.size,Ct.pts),fontColor:b.castOption(Ot.color,Ct.pts),nameLength:b.castOption(Mt.namelength,Ct.pts),textAlign:b.castOption(Mt.align,Ct.pts),hovertemplate:b.castOption(Bt.hovertemplate,Ct.pts),hovertemplateLabels:Ct,eventData:[x(Ct,Bt)]},{container:Rt._hoverlayer.node(),outerContainer:Rt._paper.node(),gd:it,inOut_bbox:Lt}),Ct.bbox=Lt[0],mt._hasHoverLabel=!0}mt._hasHoverEvent=!0,it.emit("plotly_hover",{points:[x(Ct,Bt)],event:f.event})}}),gt.on("mouseout",function(Ct){var Rt=it._fullLayout,Bt=it._fullData[mt.index],Zt=f.select(this).datum();mt._hasHoverEvent&&(Ct.originalEvent=f.event,it.emit("plotly_unhover",{points:[x(Zt,Bt)],event:f.event}),mt._hasHoverEvent=!1),mt._hasHoverLabel&&(z.loneUnhover(Rt._hoverlayer.node()),mt._hasHoverLabel=!1)}),gt.on("click",function(Ct){var Rt=it._fullLayout,Bt=it._fullData[mt.index];it._dragging||Rt.hovermode===!1||(it._hoverdata=[x(Ct,Bt)],z.click(it,f.event))})}function w(gt,it,st){var xt=b.castOption(gt.outsidetextfont.color,it.pts)||b.castOption(gt.textfont.color,it.pts)||st.color,ot=b.castOption(gt.outsidetextfont.family,it.pts)||b.castOption(gt.textfont.family,it.pts)||st.family,J=b.castOption(gt.outsidetextfont.size,it.pts)||b.castOption(gt.textfont.size,it.pts)||st.size,mt=b.castOption(gt.outsidetextfont.weight,it.pts)||b.castOption(gt.textfont.weight,it.pts)||st.weight,dt=b.castOption(gt.outsidetextfont.style,it.pts)||b.castOption(gt.textfont.style,it.pts)||st.style,Ct=b.castOption(gt.outsidetextfont.variant,it.pts)||b.castOption(gt.textfont.variant,it.pts)||st.variant,Rt=b.castOption(gt.outsidetextfont.textcase,it.pts)||b.castOption(gt.textfont.textcase,it.pts)||st.textcase,Bt=b.castOption(gt.outsidetextfont.lineposition,it.pts)||b.castOption(gt.textfont.lineposition,it.pts)||st.lineposition,Zt=b.castOption(gt.outsidetextfont.shadow,it.pts)||b.castOption(gt.textfont.shadow,it.pts)||st.shadow;return{color:xt,family:ot,size:J,weight:mt,style:dt,variant:Ct,textcase:Rt,lineposition:Bt,shadow:Zt}}function D(gt,it,st){var xt=b.castOption(gt.insidetextfont.color,it.pts);!xt&>._input.textfont&&(xt=b.castOption(gt._input.textfont.color,it.pts));var ot=b.castOption(gt.insidetextfont.family,it.pts)||b.castOption(gt.textfont.family,it.pts)||st.family,J=b.castOption(gt.insidetextfont.size,it.pts)||b.castOption(gt.textfont.size,it.pts)||st.size,mt=b.castOption(gt.insidetextfont.weight,it.pts)||b.castOption(gt.textfont.weight,it.pts)||st.weight,dt=b.castOption(gt.insidetextfont.style,it.pts)||b.castOption(gt.textfont.style,it.pts)||st.style,Ct=b.castOption(gt.insidetextfont.variant,it.pts)||b.castOption(gt.textfont.variant,it.pts)||st.variant,Rt=b.castOption(gt.insidetextfont.textcase,it.pts)||b.castOption(gt.textfont.textcase,it.pts)||st.textcase,Bt=b.castOption(gt.insidetextfont.lineposition,it.pts)||b.castOption(gt.textfont.lineposition,it.pts)||st.lineposition,Zt=b.castOption(gt.insidetextfont.shadow,it.pts)||b.castOption(gt.textfont.shadow,it.pts)||st.shadow;return{color:xt||P.contrast(it.color),family:ot,size:J,weight:mt,style:dt,variant:Ct,textcase:Rt,lineposition:Bt,shadow:Zt}}function E(gt,it){for(var st,xt,ot=0;ot=-4;Mt-=2)ue(Math.PI*Mt,"tan");for(Mt=4;Mt>=-4;Mt-=2)ue(Math.PI*(Mt+1),"tan")}if(Zt||ee){for(Mt=4;Mt>=-4;Mt-=2)ue(Math.PI*(Mt+1.5),"rad");for(Mt=4;Mt>=-4;Mt-=2)ue(Math.PI*(Mt+.5),"rad")}}if(dt||xe||Zt){var Ot=Math.sqrt(gt.width*gt.width+gt.height*gt.height);if(ye={scale:ot*xt*2/Ot,rCenter:1-ot,rotate:0},ye.textPosAngle=(it.startangle+it.stopangle)/2,ye.scale>=1)return ye;ge.push(ye)}(xe||ee)&&(ye=p(gt,xt,mt,Ct,Rt),ye.textPosAngle=(it.startangle+it.stopangle)/2,ge.push(ye)),(xe||Gt)&&(ye=g(gt,xt,mt,Ct,Rt),ye.textPosAngle=(it.startangle+it.stopangle)/2,ge.push(ye));for(var Lt=0,ie=0,be=0;be=1)break}return ge[Lt]}function M(gt,it){var st=gt.startangle,xt=gt.stopangle;return st>it&&it>xt||st0?1:-1)/2,y:J/(1+st*st/(xt*xt)),outside:!0}}function V(gt){var it=Math.sqrt(gt.titleBox.width*gt.titleBox.width+gt.titleBox.height*gt.titleBox.height);return{x:gt.cx,y:gt.cy,scale:gt.trace.hole*gt.r*2/it,tx:0,ty:-gt.titleBox.height/2+gt.trace.title.font.size}}function W(gt,it){var st=1,xt=1,ot,J=gt.trace,mt={x:gt.cx,y:gt.cy},dt={tx:0,ty:0};dt.ty+=J.title.font.size,ot=q(J),J.title.position.indexOf("top")!==-1?(mt.y-=(1+ot)*gt.r,dt.ty-=gt.titleBox.height):J.title.position.indexOf("bottom")!==-1&&(mt.y+=(1+ot)*gt.r);var Ct=F(gt.r,gt.trace.aspectratio),Rt=it.w*(J.domain.x[1]-J.domain.x[0])/2;return J.title.position.indexOf("left")!==-1?(Rt=Rt+Ct,mt.x-=(1+ot)*Ct,dt.tx+=gt.titleBox.width/2):J.title.position.indexOf("center")!==-1?Rt*=2:J.title.position.indexOf("right")!==-1&&(Rt=Rt+Ct,mt.x+=(1+ot)*Ct,dt.tx-=gt.titleBox.width/2),st=Rt/gt.titleBox.width,xt=H(gt,it)/gt.titleBox.height,{x:mt.x,y:mt.y,scale:Math.min(st,xt),tx:dt.tx,ty:dt.ty}}function F(gt,it){return gt/(it===void 0?1:it)}function H(gt,it){var st=gt.trace,xt=it.h*(st.domain.y[1]-st.domain.y[0]);return Math.min(gt.titleBox.height,xt/2)}function q(gt){var it=gt.pull;if(!it)return 0;var st;if(i.isArrayOrTypedArray(it))for(it=0,st=0;stit&&(it=gt.pull[st]);return it}function G(gt,it){var st,xt,ot,J,mt,dt,Ct,Rt,Bt,Zt,Gt,ee,xe;function ge(Ot,Lt){return Ot.pxmid[1]-Lt.pxmid[1]}function ye(Ot,Lt){return Lt.pxmid[1]-Ot.pxmid[1]}function ue(Ot,Lt){Lt||(Lt={});var ie=Lt.labelExtraY+(xt?Lt.yLabelMax:Lt.yLabelMin),be=xt?Ot.yLabelMin:Ot.yLabelMax,ce=xt?Ot.yLabelMax:Ot.yLabelMin,Le=Ot.cyFinal+mt(Ot.px0[1],Ot.px1[1]),Ze=ie-be,Qe,mr,fr,Jr,an,Er;if(Ze*Ct>0&&(Ot.labelExtraY=Ze),!!i.isArrayOrTypedArray(it.pull))for(mr=0;mr=(b.castOption(it.pull,fr.pts)||0))&&((Ot.pxmid[1]-fr.pxmid[1])*Ct>0?(Jr=fr.cyFinal+mt(fr.px0[1],fr.px1[1]),Ze=Jr-be-Ot.labelExtraY,Ze*Ct>0&&(Ot.labelExtraY+=Ze)):(ce+Ot.labelExtraY-Le)*Ct>0&&(Qe=3*dt*Math.abs(mr-Zt.indexOf(Ot)),an=fr.cxFinal+J(fr.px0[0],fr.px1[0]),Er=an+Qe-(Ot.cxFinal+Ot.pxmid[0])-Ot.labelExtraX,Er*dt>0&&(Ot.labelExtraX+=Er)))}for(xt=0;xt<2;xt++)for(ot=xt?ge:ye,mt=xt?Math.max:Math.min,Ct=xt?1:-1,st=0;st<2;st++){for(J=st?Math.max:Math.min,dt=st?1:-1,Rt=gt[xt][st],Rt.sort(ot),Bt=gt[1-xt][st],Zt=Bt.concat(Rt),ee=[],Gt=0;Gt1?(Rt=st.r,Bt=Rt/ot.aspectratio):(Bt=st.r,Rt=Bt*ot.aspectratio),Rt*=(1+ot.baseratio)/2,Ct=Rt*Bt}mt=Math.min(mt,Ct/st.vTotal)}for(xt=0;xtit.vTotal/2?1:0,Rt.halfangle=Math.PI*Math.min(Rt.v/it.vTotal,.5),Rt.ring=1-xt.hole,Rt.rInscribed=B(Rt,it))}function vt(gt,it){return[gt*Math.sin(it),-gt*Math.cos(it)]}function ut(gt,it,st){var xt=gt._fullLayout,ot=st.trace,J=ot.texttemplate,mt=ot.textinfo;if(!J&&mt&&mt!=="none"){var dt=mt.split("+"),Ct=function(Lt){return dt.indexOf(Lt)!==-1},Rt=Ct("label"),Bt=Ct("text"),Zt=Ct("value"),Gt=Ct("percent"),ee=xt.separators,xe;if(xe=Rt?[it.label]:[],Bt){var ge=b.getFirstFilled(ot.text,it.pts);_(ge)&&xe.push(ge)}Zt&&xe.push(b.formatPieValue(it.v,ee)),Gt&&xe.push(b.formatPiePercent(it.v/st.vTotal,ee)),it.text=xe.join("
")}function ye(Lt){return{label:Lt.label,value:Lt.v,valueLabel:b.formatPieValue(Lt.v,xt.separators),percent:Lt.v/st.vTotal,percentLabel:b.formatPiePercent(Lt.v/st.vTotal,xt.separators),color:Lt.color,text:Lt.text,customdata:i.castOption(ot,Lt.i,"customdata")}}if(J){var ue=i.castOption(ot,it.i,"texttemplate");if(!ue)it.text="";else{var Mt=ye(it),Ot=b.getFirstFilled(ot.text,it.pts);(_(Ot)||Ot==="")&&(Mt.text=Ot),it.text=i.texttemplateString({data:[Mt,ot._meta],fallback:ot.texttemplatefallback,labels:Mt,locale:gt._fullLayout._d3locale,template:ue})}}}function rt(gt,it){var st=gt.rotate*Math.PI/180,xt=Math.cos(st),ot=Math.sin(st),J=(it.left+it.right)/2,mt=(it.top+it.bottom)/2;gt.textX=J*xt-mt*ot,gt.textY=J*ot+mt*xt,gt.noCenter=!0}Y.exports={plot:A,formatSliceLabel:ut,transformInsideText:I,determineInsideTextFont:D,positionTitleOutside:W,prerenderTitles:E,layoutAreas:tt,attachFxHandlers:k,computeTransform:rt}}),gK=It((et,Y)=>{var f=Br(),y=Wv(),z=C0().resizeText;Y.exports=function(P){var n=P._fullLayout._pielayer.selectAll(".trace");z(P,n,"pie"),n.each(function(i){var a=i[0],l=a.trace,o=f.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(c){f.select(this).call(y,c,l,P)})})}}),vK=It(et=>{var Y=lh();et.name="pie",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),yK=It((et,Y)=>{Y.exports={attributes:kb(),supplyDefaults:Tb().supplyDefaults,supplyLayoutDefaults:pK(),layoutAttributes:fC(),calc:Uw().calc,crossTraceCalc:Uw().crossTraceCalc,plot:pC().plot,style:gK(),styleOne:Wv(),moduleType:"trace",name:"pie",basePlotModule:vK(),categories:["pie-like","pie","showLegend"],meta:{}}}),_K=It((et,Y)=>{Y.exports=yK()}),xK=It(et=>{var Y=lh();et.name="sunburst",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),JP=It((et,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),sk=It((et,Y)=>{var f=xa(),{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Ru(),i=Jh().attributes,a=kb(),l=JP(),o=Yn().extendFlat,c=qf().pattern;Y.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},a.marker.line.color,{dflt:null}),width:o({},a.marker.line.width,{dflt:1}),editType:"calc"},pattern:c,editType:"calc"},n("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:a.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:z({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:P({editType:"plot"}),hovertext:a.hovertext,hoverinfo:o({},f.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:y({},{keys:l.eventDataKeys}),hovertemplatefallback:P(),textfont:a.textfont,insidetextorientation:a.insidetextorientation,insidetextfont:a.insidetextfont,outsidetextfont:o({},a.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:a.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:i({name:"sunburst",trace:!0,editType:"calc"})}}),QP=It((et,Y)=>{Y.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),bK=It((et,Y)=>{var f=jn(),y=sk(),z=Jh().defaults,P=eg().handleText,n=Tb().handleMarkerDefaults,i=ch(),a=i.hasColorscale,l=i.handleDefaults;Y.exports=function(o,c,s,h){function m(w,D){return f.coerce(o,c,y,w,D)}var b=m("labels"),x=m("parents");if(!b||!b.length||!x||!x.length){c.visible=!1;return}var _=m("values");_&&_.length?m("branchvalues"):m("count"),m("level"),m("maxdepth"),n(o,c,h,m);var A=c._hasColorscale=a(o,"marker","colors")||(o.marker||{}).coloraxis;A&&l(o,c,h,m,{prefix:"marker.",cLetter:"c"}),m("leaf.opacity",A?1:.7);var d=m("text");m("texttemplate"),m("texttemplatefallback"),c.texttemplate||m("textinfo",f.isArrayOrTypedArray(d)?"text+label":"label"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback");var k="auto";P(o,c,h,m,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),m("insidetextorientation"),m("sort"),m("rotation"),m("root.color"),z(c,h,m),c._length=null}}),wK=It((et,Y)=>{var f=jn(),y=QP();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("sunburstcolorway",P.colorway),n("extendsunburstcolors")}}),lk=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){function y(zt,_t){return zt.parent===_t.parent?1:2}function z(zt){return zt.reduce(P,0)/zt.length}function P(zt,_t){return zt+_t.x}function n(zt){return 1+zt.reduce(i,0)}function i(zt,_t){return Math.max(zt,_t.y)}function a(zt){for(var _t;_t=zt.children;)zt=_t[0];return zt}function l(zt){for(var _t;_t=zt.children;)zt=_t[_t.length-1];return zt}function o(){var zt=y,_t=1,Pt=1,Ht=!1;function ae(he){var Me,qe=0;he.eachAfter(function(xr){var pn=xr.children;pn?(xr.x=z(pn),xr.y=n(pn)):(xr.x=Me?qe+=zt(xr,Me):0,xr.y=0,Me=xr)});var Ye=a(he),ur=l(he),Rr=Ye.x-zt(Ye,ur)/2,zr=ur.x+zt(ur,Ye)/2;return he.eachAfter(Ht?function(xr){xr.x=(xr.x-he.x)*_t,xr.y=(he.y-xr.y)*Pt}:function(xr){xr.x=(xr.x-Rr)/(zr-Rr)*_t,xr.y=(1-(he.y?xr.y/he.y:1))*Pt})}return ae.separation=function(he){return arguments.length?(zt=he,ae):zt},ae.size=function(he){return arguments.length?(Ht=!1,_t=+he[0],Pt=+he[1],ae):Ht?null:[_t,Pt]},ae.nodeSize=function(he){return arguments.length?(Ht=!0,_t=+he[0],Pt=+he[1],ae):Ht?[_t,Pt]:null},ae}function c(zt){var _t=0,Pt=zt.children,Ht=Pt&&Pt.length;if(!Ht)_t=1;else for(;--Ht>=0;)_t+=Pt[Ht].value;zt.value=_t}function s(){return this.eachAfter(c)}function h(zt){var _t=this,Pt,Ht=[_t],ae,he,Me;do for(Pt=Ht.reverse(),Ht=[];_t=Pt.pop();)if(zt(_t),ae=_t.children,ae)for(he=0,Me=ae.length;he=0;--ae)Pt.push(Ht[ae]);return this}function b(zt){for(var _t=this,Pt=[_t],Ht=[],ae,he,Me;_t=Pt.pop();)if(Ht.push(_t),ae=_t.children,ae)for(he=0,Me=ae.length;he=0;)Pt+=Ht[ae].value;_t.value=Pt})}function _(zt){return this.eachBefore(function(_t){_t.children&&_t.children.sort(zt)})}function A(zt){for(var _t=this,Pt=d(_t,zt),Ht=[_t];_t!==Pt;)_t=_t.parent,Ht.push(_t);for(var ae=Ht.length;zt!==Pt;)Ht.splice(ae,0,zt),zt=zt.parent;return Ht}function d(zt,_t){if(zt===_t)return zt;var Pt=zt.ancestors(),Ht=_t.ancestors(),ae=null;for(zt=Pt.pop(),_t=Ht.pop();zt===_t;)ae=zt,zt=Pt.pop(),_t=Ht.pop();return ae}function k(){for(var zt=this,_t=[zt];zt=zt.parent;)_t.push(zt);return _t}function w(){var zt=[];return this.each(function(_t){zt.push(_t)}),zt}function D(){var zt=[];return this.eachBefore(function(_t){_t.children||zt.push(_t)}),zt}function E(){var zt=this,_t=[];return zt.each(function(Pt){Pt!==zt&&_t.push({source:Pt.parent,target:Pt})}),_t}function I(zt,_t){var Pt=new S(zt),Ht=+zt.value&&(Pt.value=zt.value),ae,he=[Pt],Me,qe,Ye,ur;for(_t==null&&(_t=p);ae=he.pop();)if(Ht&&(ae.value=+ae.data.value),(qe=_t(ae.data))&&(ur=qe.length))for(ae.children=new Array(ur),Ye=ur-1;Ye>=0;--Ye)he.push(Me=ae.children[Ye]=new S(qe[Ye])),Me.parent=ae,Me.depth=ae.depth+1;return Pt.eachBefore(C)}function M(){return I(this).eachBefore(g)}function p(zt){return zt.children}function g(zt){zt.data=zt.data.data}function C(zt){var _t=0;do zt.height=_t;while((zt=zt.parent)&&zt.height<++_t)}function S(zt){this.data=zt,this.depth=this.height=0,this.parent=null}S.prototype=I.prototype={constructor:S,count:s,each:h,eachAfter:b,eachBefore:m,sum:x,sort:_,path:A,ancestors:k,descendants:w,leaves:D,links:E,copy:M};var N=Array.prototype.slice;function B(zt){for(var _t=zt.length,Pt,Ht;_t;)Ht=Math.random()*_t--|0,Pt=zt[_t],zt[_t]=zt[Ht],zt[Ht]=Pt;return zt}function U(zt){for(var _t=0,Pt=(zt=B(N.call(zt))).length,Ht=[],ae,he;_t0&&Pt*Pt>Ht*Ht+ae*ae}function H(zt,_t){for(var Pt=0;Pt<_t.length;++Pt)if(!F(zt,_t[Pt]))return!1;return!0}function q(zt){switch(zt.length){case 1:return G(zt[0]);case 2:return tt(zt[0],zt[1]);case 3:return ht(zt[0],zt[1],zt[2])}}function G(zt){return{x:zt.x,y:zt.y,r:zt.r}}function tt(zt,_t){var Pt=zt.x,Ht=zt.y,ae=zt.r,he=_t.x,Me=_t.y,qe=_t.r,Ye=he-Pt,ur=Me-Ht,Rr=qe-ae,zr=Math.sqrt(Ye*Ye+ur*ur);return{x:(Pt+he+Ye/zr*Rr)/2,y:(Ht+Me+ur/zr*Rr)/2,r:(zr+ae+qe)/2}}function ht(zt,_t,Pt){var Ht=zt.x,ae=zt.y,he=zt.r,Me=_t.x,qe=_t.y,Ye=_t.r,ur=Pt.x,Rr=Pt.y,zr=Pt.r,xr=Ht-Me,pn=Ht-ur,ci=ae-qe,ui=ae-Rr,yi=Ye-he,Gi=zr-he,Ci=Ht*Ht+ae*ae-he*he,fi=Ci-Me*Me-qe*qe+Ye*Ye,ba=Ci-ur*ur-Rr*Rr+zr*zr,oa=pn*ci-xr*ui,Ke=(ci*ba-ui*fi)/(oa*2)-Ht,sr=(ui*yi-ci*Gi)/oa,vr=(pn*fi-xr*ba)/(oa*2)-ae,Ar=(xr*Gi-pn*yi)/oa,mn=sr*sr+Ar*Ar-1,Zn=2*(he+Ke*sr+vr*Ar),Un=Ke*Ke+vr*vr-he*he,Wn=-(mn?(Zn+Math.sqrt(Zn*Zn-4*mn*Un))/(2*mn):Un/Zn);return{x:Ht+Ke+sr*Wn,y:ae+vr+Ar*Wn,r:Wn}}function bt(zt,_t,Pt){var Ht=zt.x-_t.x,ae,he,Me=zt.y-_t.y,qe,Ye,ur=Ht*Ht+Me*Me;ur?(he=_t.r+Pt.r,he*=he,Ye=zt.r+Pt.r,Ye*=Ye,he>Ye?(ae=(ur+Ye-he)/(2*ur),qe=Math.sqrt(Math.max(0,Ye/ur-ae*ae)),Pt.x=zt.x-ae*Ht-qe*Me,Pt.y=zt.y-ae*Me+qe*Ht):(ae=(ur+he-Ye)/(2*ur),qe=Math.sqrt(Math.max(0,he/ur-ae*ae)),Pt.x=_t.x+ae*Ht-qe*Me,Pt.y=_t.y+ae*Me+qe*Ht)):(Pt.x=_t.x+Pt.r,Pt.y=_t.y)}function vt(zt,_t){var Pt=zt.r+_t.r-1e-6,Ht=_t.x-zt.x,ae=_t.y-zt.y;return Pt>0&&Pt*Pt>Ht*Ht+ae*ae}function ut(zt){var _t=zt._,Pt=zt.next._,Ht=_t.r+Pt.r,ae=(_t.x*Pt.r+Pt.x*_t.r)/Ht,he=(_t.y*Pt.r+Pt.y*_t.r)/Ht;return ae*ae+he*he}function rt(zt){this._=zt,this.next=null,this.previous=null}function gt(zt){if(!(ae=zt.length))return 0;var _t,Pt,Ht,ae,he,Me,qe,Ye,ur,Rr,zr;if(_t=zt[0],_t.x=0,_t.y=0,!(ae>1))return _t.r;if(Pt=zt[1],_t.x=-Pt.r,Pt.x=_t.r,Pt.y=0,!(ae>2))return _t.r+Pt.r;bt(Pt,_t,Ht=zt[2]),_t=new rt(_t),Pt=new rt(Pt),Ht=new rt(Ht),_t.next=Ht.previous=Pt,Pt.next=_t.previous=Ht,Ht.next=Pt.previous=_t;t:for(qe=3;qe0)throw new Error("cycle");return qe}return Pt.id=function(Ht){return arguments.length?(zt=xt(Ht),Pt):zt},Pt.parentId=function(Ht){return arguments.length?(_t=xt(Ht),Pt):_t},Pt}function Lt(zt,_t){return zt.parent===_t.parent?1:2}function ie(zt){var _t=zt.children;return _t?_t[0]:zt.t}function be(zt){var _t=zt.children;return _t?_t[_t.length-1]:zt.t}function ce(zt,_t,Pt){var Ht=Pt/(_t.i-zt.i);_t.c-=Ht,_t.s+=Pt,zt.c+=Ht,_t.z+=Pt,_t.m+=Pt}function Le(zt){for(var _t=0,Pt=0,Ht=zt.children,ae=Ht.length,he;--ae>=0;)he=Ht[ae],he.z+=_t,he.m+=_t,_t+=he.s+(Pt+=he.c)}function Ze(zt,_t,Pt){return zt.a.parent===_t.parent?zt.a:Pt}function Qe(zt,_t){this._=zt,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=_t}Qe.prototype=Object.create(S.prototype);function mr(zt){for(var _t=new Qe(zt,0),Pt,Ht=[_t],ae,he,Me,qe;Pt=Ht.pop();)if(he=Pt._.children)for(Pt.children=new Array(qe=he.length),Me=qe-1;Me>=0;--Me)Ht.push(ae=Pt.children[Me]=new Qe(he[Me],Me)),ae.parent=Pt;return(_t.parent=new Qe(null,0)).children=[_t],_t}function fr(){var zt=Lt,_t=1,Pt=1,Ht=null;function ae(ur){var Rr=mr(ur);if(Rr.eachAfter(he),Rr.parent.m=-Rr.z,Rr.eachBefore(Me),Ht)ur.eachBefore(Ye);else{var zr=ur,xr=ur,pn=ur;ur.eachBefore(function(Ci){Ci.xxr.x&&(xr=Ci),Ci.depth>pn.depth&&(pn=Ci)});var ci=zr===xr?1:zt(zr,xr)/2,ui=ci-zr.x,yi=_t/(xr.x+ci+ui),Gi=Pt/(pn.depth||1);ur.eachBefore(function(Ci){Ci.x=(Ci.x+ui)*yi,Ci.y=Ci.depth*Gi})}return ur}function he(ur){var Rr=ur.children,zr=ur.parent.children,xr=ur.i?zr[ur.i-1]:null;if(Rr){Le(ur);var pn=(Rr[0].z+Rr[Rr.length-1].z)/2;xr?(ur.z=xr.z+zt(ur._,xr._),ur.m=ur.z-pn):ur.z=pn}else xr&&(ur.z=xr.z+zt(ur._,xr._));ur.parent.A=qe(ur,xr,ur.parent.A||zr[0])}function Me(ur){ur._.x=ur.z+ur.parent.m,ur.m+=ur.parent.m}function qe(ur,Rr,zr){if(Rr){for(var xr=ur,pn=ur,ci=Rr,ui=xr.parent.children[0],yi=xr.m,Gi=pn.m,Ci=ci.m,fi=ui.m,ba;ci=be(ci),xr=ie(xr),ci&&xr;)ui=ie(ui),pn=be(pn),pn.a=ur,ba=ci.z+Ci-xr.z-yi+zt(ci._,xr._),ba>0&&(ce(Ze(ci,ur,zr),ur,ba),yi+=ba,Gi+=ba),Ci+=ci.m,yi+=xr.m,fi+=ui.m,Gi+=pn.m;ci&&!be(pn)&&(pn.t=ci,pn.m+=Ci-Gi),xr&&!ie(ui)&&(ui.t=xr,ui.m+=yi-fi,zr=ur)}return zr}function Ye(ur){ur.x*=_t,ur.y=ur.depth*Pt}return ae.separation=function(ur){return arguments.length?(zt=ur,ae):zt},ae.size=function(ur){return arguments.length?(Ht=!1,_t=+ur[0],Pt=+ur[1],ae):Ht?null:[_t,Pt]},ae.nodeSize=function(ur){return arguments.length?(Ht=!0,_t=+ur[0],Pt=+ur[1],ae):Ht?[_t,Pt]:null},ae}function Jr(zt,_t,Pt,Ht,ae){for(var he=zt.children,Me,qe=-1,Ye=he.length,ur=zt.value&&(ae-Pt)/zt.value;++qeCi&&(Ci=ur),Ke=yi*yi*oa,fi=Math.max(Ci/Ke,Ke/Gi),fi>ba){yi-=ur;break}ba=fi}Me.push(Ye={value:yi,dice:pn1?Ht:1)},Pt}(an);function _n(){var zt=dn,_t=!1,Pt=1,Ht=1,ae=[0],he=ot,Me=ot,qe=ot,Ye=ot,ur=ot;function Rr(xr){return xr.x0=xr.y0=0,xr.x1=Pt,xr.y1=Ht,xr.eachBefore(zr),ae=[0],_t&&xr.eachBefore(Zt),xr}function zr(xr){var pn=ae[xr.depth],ci=xr.x0+pn,ui=xr.y0+pn,yi=xr.x1-pn,Gi=xr.y1-pn;yi=xr-1){var Ci=he[zr];Ci.x0=ci,Ci.y0=ui,Ci.x1=yi,Ci.y1=Gi;return}for(var fi=ur[zr],ba=pn/2+fi,oa=zr+1,Ke=xr-1;oa>>1;ur[sr]Gi-ui){var mn=(ci*Ar+yi*vr)/pn;Rr(zr,oa,vr,ci,ui,mn,Gi),Rr(oa,xr,Ar,mn,ui,yi,Gi)}else{var Zn=(ui*Ar+Gi*vr)/pn;Rr(zr,oa,vr,ci,ui,yi,Zn),Rr(oa,xr,Ar,ci,Zn,yi,Gi)}}}function Xt(zt,_t,Pt,Ht,ae){(zt.depth&1?Jr:Gt)(zt,_t,Pt,Ht,ae)}var oe=function zt(_t){function Pt(Ht,ae,he,Me,qe){if((Ye=Ht._squarify)&&Ye.ratio===_t)for(var Ye,ur,Rr,zr,xr=-1,pn,ci=Ye.length,ui=Ht.value;++xr1?Ht:1)},Pt}(an);f.cluster=o,f.hierarchy=I,f.pack=dt,f.packEnclose=U,f.packSiblings=it,f.partition=ee,f.stratify=Ot,f.tree=fr,f.treemap=_n,f.treemapBinary=Oe,f.treemapDice=Gt,f.treemapResquarify=oe,f.treemapSlice=Jr,f.treemapSliceDice=Xt,f.treemapSquarify=dn,Object.defineProperty(f,"__esModule",{value:!0})})}),ck=It(et=>{var Y=lk(),f=Sr(),y=jn(),z=ch().makeColorScaleFuncFromTrace,P=Uw().makePullColorFn,n=Uw().generateExtendedColors,i=ch().calc,a=Dr().ALMOST_EQUAL,l={},o={},c={};et.calc=function(h,m){var b=h._fullLayout,x=m.ids,_=y.isArrayOrTypedArray(x),A=m.labels,d=m.parents,k=m.values,w=y.isArrayOrTypedArray(k),D=[],E={},I={},M=function(it,st){E[it]?E[it].push(st):E[it]=[st],I[st]=1},p=function(it){return it||typeof it=="number"},g=function(it){return!w||f(k[it])&&k[it]>=0},C,S,N;_?(C=Math.min(x.length,d.length),S=function(it){return p(x[it])&&g(it)},N=function(it){return String(x[it])}):(C=Math.min(A.length,d.length),S=function(it){return p(A[it])&&g(it)},N=function(it){return String(A[it])}),w&&(C=Math.min(C,k.length));for(var B=0;B1){for(var F=y.randstr(),H=0;H{});function ly(){}function tI(){return this.rgb().formatHex()}function kK(){return this.rgb().formatHex8()}function TK(){return oI(this).formatHsl()}function eI(){return this.rgb().formatRgb()}function Hw(et){var Y,f;return et=(et+"").trim().toLowerCase(),(Y=lI.exec(et))?(f=Y[1].length,Y=parseInt(Y[1],16),f===6?rI(Y):f===3?new $p(Y>>8&15|Y>>4&240,Y>>4&15|Y&240,(Y&15)<<4|Y&15,1):f===8?uk(Y>>24&255,Y>>16&255,Y>>8&255,(Y&255)/255):f===4?uk(Y>>12&15|Y>>8&240,Y>>8&15|Y>>4&240,Y>>4&15|Y&240,((Y&15)<<4|Y&15)/255):null):(Y=cI.exec(et))?new $p(Y[1],Y[2],Y[3],1):(Y=uI.exec(et))?new $p(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,1):(Y=hI.exec(et))?uk(Y[1],Y[2],Y[3],Y[4]):(Y=dI.exec(et))?uk(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,Y[4]):(Y=fI.exec(et))?aI(Y[1],Y[2]/100,Y[3]/100,1):(Y=pI.exec(et))?aI(Y[1],Y[2]/100,Y[3]/100,Y[4]):_C.hasOwnProperty(et)?rI(_C[et]):et==="transparent"?new $p(NaN,NaN,NaN,0):null}function rI(et){return new $p(et>>16&255,et>>8&255,et&255,1)}function uk(et,Y,f,y){return y<=0&&(et=Y=f=NaN),new $p(et,Y,f,y)}function gC(et){return et instanceof ly||(et=Hw(et)),et?(et=et.rgb(),new $p(et.r,et.g,et.b,et.opacity)):new $p}function hk(et,Y,f,y){return arguments.length===1?gC(et):new $p(et,Y,f,y??1)}function $p(et,Y,f,y){this.r=+et,this.g=+Y,this.b=+f,this.opacity=+y}function nI(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}`}function SK(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}${R_((isNaN(this.opacity)?1:this.opacity)*255)}`}function iI(){let et=dk(this.opacity);return`${et===1?"rgb(":"rgba("}${B_(this.r)}, ${B_(this.g)}, ${B_(this.b)}${et===1?")":`, ${et})`}`}function dk(et){return isNaN(et)?1:Math.max(0,Math.min(1,et))}function B_(et){return Math.max(0,Math.min(255,Math.round(et)||0))}function R_(et){return et=B_(et),(et<16?"0":"")+et.toString(16)}function aI(et,Y,f,y){return y<=0?et=Y=f=NaN:f<=0||f>=1?et=Y=NaN:Y<=0&&(et=NaN),new Ig(et,Y,f,y)}function oI(et){if(et instanceof Ig)return new Ig(et.h,et.s,et.l,et.opacity);if(et instanceof ly||(et=Hw(et)),!et)return new Ig;if(et instanceof Ig)return et;et=et.rgb();var Y=et.r/255,f=et.g/255,y=et.b/255,z=Math.min(Y,f,y),P=Math.max(Y,f,y),n=NaN,i=P-z,a=(P+z)/2;return i?(Y===P?n=(f-y)/i+(f0&&a<1?0:n,new Ig(n,i,a,et.opacity)}function vC(et,Y,f,y){return arguments.length===1?oI(et):new Ig(et,Y,f,y??1)}function Ig(et,Y,f,y){this.h=+et,this.s=+Y,this.l=+f,this.opacity=+y}function sI(et){return et=(et||0)%360,et<0?et+360:et}function fk(et){return Math.max(0,Math.min(1,et||0))}function yC(et,Y,f){return(et<60?Y+(f-Y)*et/60:et<180?f:et<240?Y+(f-Y)*(240-et)/60:Y)*255}var cy,F_,N_,Sb,Dg,lI,cI,uI,hI,dI,fI,pI,_C,xC=kr(()=>{mC(),cy=.7,F_=1/cy,N_="\\s*([+-]?\\d+)\\s*",Sb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lI=/^#([0-9a-f]{3,8})$/,cI=new RegExp(`^rgb\\(${N_},${N_},${N_}\\)$`),uI=new RegExp(`^rgb\\(${Dg},${Dg},${Dg}\\)$`),hI=new RegExp(`^rgba\\(${N_},${N_},${N_},${Sb}\\)$`),dI=new RegExp(`^rgba\\(${Dg},${Dg},${Dg},${Sb}\\)$`),fI=new RegExp(`^hsl\\(${Sb},${Dg},${Dg}\\)$`),pI=new RegExp(`^hsla\\(${Sb},${Dg},${Dg},${Sb}\\)$`),_C={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Tb(ly,Hw,{copy(et){return Object.assign(new this.constructor,this,et)},displayable(){return this.rgb().displayable()},hex:tI,formatHex:tI,formatHex8:kK,formatHsl:TK,formatRgb:eI,toString:eI}),Tb($p,hk,$w(ly,{brighter(et){return et=et==null?F_:Math.pow(F_,et),new $p(this.r*et,this.g*et,this.b*et,this.opacity)},darker(et){return et=et==null?cy:Math.pow(cy,et),new $p(this.r*et,this.g*et,this.b*et,this.opacity)},rgb(){return this},clamp(){return new $p(B_(this.r),B_(this.g),B_(this.b),dk(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:nI,formatHex:nI,formatHex8:SK,formatRgb:iI,toString:iI})),Tb(Ig,vC,$w(ly,{brighter(et){return et=et==null?F_:Math.pow(F_,et),new Ig(this.h,this.s,this.l*et,this.opacity)},darker(et){return et=et==null?cy:Math.pow(cy,et),new Ig(this.h,this.s,this.l*et,this.opacity)},rgb(){var et=this.h%360+(this.h<0)*360,Y=isNaN(et)||isNaN(this.s)?0:this.s,f=this.l,y=f+(f<.5?f:1-f)*Y,z=2*f-y;return new $p(yC(et>=240?et-240:et+120,z,y),yC(et,z,y),yC(et<120?et+240:et-120,z,y),this.opacity)},clamp(){return new Ig(sI(this.h),fk(this.s),fk(this.l),dk(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(){let et=dk(this.opacity);return`${et===1?"hsl(":"hsla("}${sI(this.h)}, ${fk(this.s)*100}%, ${fk(this.l)*100}%${et===1?")":`, ${et})`}`}}))}),bC,wC,mI=kr(()=>{bC=Math.PI/180,wC=180/Math.PI});function gI(et){if(et instanceof Qg)return new Qg(et.l,et.a,et.b,et.opacity);if(et instanceof Qv)return vI(et);et instanceof $p||(et=gC(et));var Y=AC(et.r),f=AC(et.g),y=AC(et.b),z=TC((.2225045*Y+.7168786*f+.0606169*y)/LC),P,n;return Y===f&&f===y?P=n=z:(P=TC((.4360747*Y+.3850649*f+.1430804*y)/EC),n=TC((.0139322*Y+.0971045*f+.7141733*y)/PC)),new Qg(116*z-16,500*(P-z),200*(z-n),et.opacity)}function kC(et,Y,f,y){return arguments.length===1?gI(et):new Qg(et,Y,f,y??1)}function Qg(et,Y,f,y){this.l=+et,this.a=+Y,this.b=+f,this.opacity=+y}function TC(et){return et>yI?Math.pow(et,.3333333333333333):et/DC+IC}function SC(et){return et>j_?et*et*et:DC*(et-IC)}function CC(et){return 255*(et<=.0031308?12.92*et:1.055*Math.pow(et,.4166666666666667)-.055)}function AC(et){return(et/=255)<=.04045?et/12.92:Math.pow((et+.055)/1.055,2.4)}function CK(et){if(et instanceof Qv)return new Qv(et.h,et.c,et.l,et.opacity);if(et instanceof Qg||(et=gI(et)),et.a===0&&et.b===0)return new Qv(NaN,0{mC(),xC(),mI(),Vw=18,EC=.96422,LC=1,PC=.82521,IC=4/29,j_=6/29,DC=3*j_*j_,yI=j_*j_*j_,Tb(Qg,kC,$w(ly,{brighter(et){return new Qg(this.l+Vw*(et??1),this.a,this.b,this.opacity)},darker(et){return new Qg(this.l-Vw*(et??1),this.a,this.b,this.opacity)},rgb(){var et=(this.l+16)/116,Y=isNaN(this.a)?et:et+this.a/500,f=isNaN(this.b)?et:et-this.b/200;return Y=EC*SC(Y),et=LC*SC(et),f=PC*SC(f),new $p(CC(3.1338561*Y-1.6168667*et-.4906146*f),CC(-.9787684*Y+1.9161415*et+.033454*f),CC(.0719453*Y-.2289914*et+1.4052427*f),this.opacity)}})),Tb(Qv,MC,$w(ly,{brighter(et){return new Qv(this.h,this.c,this.l+Vw*(et??1),this.opacity)},darker(et){return new Qv(this.h,this.c,this.l-Vw*(et??1),this.opacity)},rgb(){return vI(this).rgb()}}))});function MK(et){if(et instanceof U_)return new U_(et.h,et.s,et.l,et.opacity);et instanceof $p||(et=gC(et));var Y=et.r/255,f=et.g/255,y=et.b/255,z=(FC*y+BC*Y-RC*f)/(FC+BC-RC),P=y-z,n=(Cb*(f-z)-mk*P)/Ww,i=Math.sqrt(n*n+P*P)/(Cb*z*(1-z)),a=i?Math.atan2(n,P)*wC-120:NaN;return new U_(a<0?a+360:a,i,z,et.opacity)}function zC(et,Y,f,y){return arguments.length===1?MK(et):new U_(et,Y,f,y??1)}function U_(et,Y,f,y){this.h=+et,this.s=+Y,this.l=+f,this.opacity=+y}var OC,pk,mk,Ww,Cb,BC,RC,FC,EK=kr(()=>{mC(),xC(),mI(),OC=-.14861,pk=1.78277,mk=-.29227,Ww=-.90649,Cb=1.97294,BC=Cb*Ww,RC=Cb*pk,FC=pk*mk-Ww*OC,Tb(U_,zC,$w(ly,{brighter(et){return et=et==null?F_:Math.pow(F_,et),new U_(this.h,this.s,this.l*et,this.opacity)},darker(et){return et=et==null?cy:Math.pow(cy,et),new U_(this.h,this.s,this.l*et,this.opacity)},rgb(){var et=isNaN(this.h)?0:(this.h+120)*bC,Y=+this.l,f=isNaN(this.s)?0:this.s*Y*(1-Y),y=Math.cos(et),z=Math.sin(et);return new $p(255*(Y+f*(OC*y+pk*z)),255*(Y+f*(mk*y+Ww*z)),255*(Y+f*(Cb*y)),this.opacity)}}))}),Ab=kr(()=>{xC(),AK(),EK()});function _I(et,Y,f,y,z){var P=et*et,n=P*et;return((1-3*et+3*P-n)*Y+(4-6*P+3*n)*f+(1+3*et+3*P-3*n)*y+n*z)/6}function xI(et){var Y=et.length-1;return function(f){var y=f<=0?f=0:f>=1?(f=1,Y-1):Math.floor(f*Y),z=et[y],P=et[y+1],n=y>0?et[y-1]:2*z-P,i=y{});function bI(et){var Y=et.length;return function(f){var y=Math.floor(((f%=1)<0?++f:f)*Y),z=et[(y+Y-1)%Y],P=et[y%Y],n=et[(y+1)%Y],i=et[(y+2)%Y];return _I((f-y/Y)*Y,z,P,n,i)}}var wI=kr(()=>{NC()}),qw,kI=kr(()=>{qw=et=>()=>et});function TI(et,Y){return function(f){return et+f*Y}}function LK(et,Y,f){return et=Math.pow(et,f),Y=Math.pow(Y,f)-et,f=1/f,function(y){return Math.pow(et+y*Y,f)}}function gk(et,Y){var f=Y-et;return f?TI(et,f>180||f<-180?f-360*Math.round(f/360):f):qw(isNaN(et)?Y:et)}function PK(et){return(et=+et)==1?Hp:function(Y,f){return f-Y?LK(Y,f,et):qw(isNaN(Y)?f:Y)}}function Hp(et,Y){var f=Y-et;return f?TI(et,f):qw(isNaN(et)?Y:et)}var Mb=kr(()=>{kI()});function SI(et){return function(Y){var f=Y.length,y=new Array(f),z=new Array(f),P=new Array(f),n,i;for(n=0;n{Ab(),NC(),wI(),Mb(),vk=function et(Y){var f=PK(Y);function y(z,P){var n=f((z=hk(z)).r,(P=hk(P)).r),i=f(z.g,P.g),a=f(z.b,P.b),l=Hp(z.opacity,P.opacity);return function(o){return z.r=n(o),z.g=i(o),z.b=a(o),z.opacity=l(o),z+""}}return y.gamma=et,y}(1),CI=SI(xI),AI=SI(bI)});function jC(et,Y){Y||(Y=[]);var f=et?Math.min(Y.length,et.length):0,y=Y.slice(),z;return function(P){for(z=0;z{});function IK(et,Y){return(EI(Y)?jC:LI)(et,Y)}function LI(et,Y){var f=Y?Y.length:0,y=et?Math.min(f,et.length):0,z=new Array(y),P=new Array(f),n;for(n=0;n{wk(),UC()});function II(et,Y){var f=new Date;return et=+et,Y=+Y,function(y){return f.setTime(et*(1-y)+Y*y),f}}var DI=kr(()=>{});function tv(et,Y){return et=+et,Y=+Y,function(f){return et*(1-f)+Y*f}}var yk=kr(()=>{});function zI(et,Y){var f={},y={},z;(et===null||typeof et!="object")&&(et={}),(Y===null||typeof Y!="object")&&(Y={});for(z in Y)z in et?f[z]=bk(et[z],Y[z]):y[z]=Y[z];return function(P){for(z in f)y[z]=f[z](P);return y}}var OI=kr(()=>{wk()});function DK(et){return function(){return et}}function zK(et){return function(Y){return et(Y)+""}}function BI(et,Y){var f=_k.lastIndex=xk.lastIndex=0,y,z,P,n=-1,i=[],a=[];for(et=et+"",Y=Y+"";(y=_k.exec(et))&&(z=xk.exec(Y));)(P=z.index)>f&&(P=Y.slice(f,P),i[n]?i[n]+=P:i[++n]=P),(y=y[0])===(z=z[0])?i[n]?i[n]+=z:i[++n]=z:(i[++n]=null,a.push({i:n,x:tv(y,z)})),f=xk.lastIndex;return f{yk(),_k=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xk=new RegExp(_k.source,"g")});function bk(et,Y){var f=typeof Y,y;return Y==null||f==="boolean"?qw(Y):(f==="number"?tv:f==="string"?(y=Hw(Y))?(Y=y,vk):BI:Y instanceof Hw?vk:Y instanceof Date?II:EI(Y)?jC:Array.isArray(Y)?LI:typeof Y.valueOf!="function"&&typeof Y.toString!="function"||isNaN(Y)?zI:tv)(et,Y)}var wk=kr(()=>{Ab(),MI(),PI(),DI(),yk(),OI(),RI(),kI(),UC()});function OK(et){var Y=et.length;return function(f){return et[Math.max(0,Math.min(Y-1,Math.floor(f*Y)))]}}var BK=kr(()=>{});function RK(et,Y){var f=gk(+et,+Y);return function(y){var z=f(y);return z-360*Math.floor(z/360)}}var FK=kr(()=>{Mb()});function NK(et,Y){return et=+et,Y=+Y,function(f){return Math.round(et*(1-f)+Y*f)}}var jK=kr(()=>{});function FI(et,Y,f,y,z,P){var n,i,a;return(n=Math.sqrt(et*et+Y*Y))&&(et/=n,Y/=n),(a=et*f+Y*y)&&(f-=et*a,y-=Y*a),(i=Math.sqrt(f*f+y*y))&&(f/=i,y/=i,a/=i),et*y{$C=180/Math.PI,kk={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function $K(et){let Y=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(et+"");return Y.isIdentity?kk:FI(Y.a,Y.b,Y.c,Y.d,Y.e,Y.f)}function HK(et){return et==null?kk:(Tk||(Tk=document.createElementNS("http://www.w3.org/2000/svg","g")),Tk.setAttribute("transform",et),(et=Tk.transform.baseVal.consolidate())?(et=et.matrix,FI(et.a,et.b,et.c,et.d,et.e,et.f)):kk)}var Tk,VK=kr(()=>{UK()});function NI(et,Y,f,y){function z(l){return l.length?l.pop()+" ":""}function P(l,o,c,s,h,m){if(l!==c||o!==s){var b=h.push("translate(",null,Y,null,f);m.push({i:b-4,x:tv(l,c)},{i:b-2,x:tv(o,s)})}else(c||s)&&h.push("translate("+c+Y+s+f)}function n(l,o,c,s){l!==o?(l-o>180?o+=360:o-l>180&&(l+=360),s.push({i:c.push(z(c)+"rotate(",null,y)-2,x:tv(l,o)})):o&&c.push(z(c)+"rotate("+o+y)}function i(l,o,c,s){l!==o?s.push({i:c.push(z(c)+"skewX(",null,y)-2,x:tv(l,o)}):o&&c.push(z(c)+"skewX("+o+y)}function a(l,o,c,s,h,m){if(l!==c||o!==s){var b=h.push(z(h)+"scale(",null,",",null,")");m.push({i:b-4,x:tv(l,c)},{i:b-2,x:tv(o,s)})}else(c!==1||s!==1)&&h.push(z(h)+"scale("+c+","+s+")")}return function(l,o){var c=[],s=[];return l=et(l),o=et(o),P(l.translateX,l.translateY,o.translateX,o.translateY,c,s),n(l.rotate,o.rotate,c,s),i(l.skewX,o.skewX,c,s),a(l.scaleX,l.scaleY,o.scaleX,o.scaleY,c,s),l=o=null,function(h){for(var m=-1,b=s.length,x;++m{yk(),VK(),jI=NI($K,"px, ","px)","deg)"),UI=NI(HK,", ",")",")")});function $I(et){return((et=Math.exp(et))+1/et)/2}function qK(et){return((et=Math.exp(et))-1/et)/2}function GK(et){return((et=Math.exp(2*et))-1)/(et+1)}var HI,VI,ZK=kr(()=>{HI=1e-12,VI=function et(Y,f,y){function z(P,n){var i=P[0],a=P[1],l=P[2],o=n[0],c=n[1],s=n[2],h=o-i,m=c-a,b=h*h+m*m,x,_;if(b{Ab(),Mb(),qI=WI(gk),GI=WI(Hp)});function YK(et,Y){var f=Hp((et=kC(et)).l,(Y=kC(Y)).l),y=Hp(et.a,Y.a),z=Hp(et.b,Y.b),P=Hp(et.opacity,Y.opacity);return function(n){return et.l=f(n),et.a=y(n),et.b=z(n),et.opacity=P(n),et+""}}var XK=kr(()=>{Ab(),Mb()});function ZI(et){return function(Y,f){var y=et((Y=MC(Y)).h,(f=MC(f)).h),z=Hp(Y.c,f.c),P=Hp(Y.l,f.l),n=Hp(Y.opacity,f.opacity);return function(i){return Y.h=y(i),Y.c=z(i),Y.l=P(i),Y.opacity=n(i),Y+""}}}var KI,YI,JK=kr(()=>{Ab(),Mb(),KI=ZI(gk),YI=ZI(Hp)});function XI(et){return function Y(f){f=+f;function y(z,P){var n=et((z=zC(z)).h,(P=zC(P)).h),i=Hp(z.s,P.s),a=Hp(z.l,P.l),l=Hp(z.opacity,P.opacity);return function(o){return z.h=n(o),z.s=i(o),z.l=a(Math.pow(o,f)),z.opacity=l(o),z+""}}return y.gamma=Y,y}(1)}var JI,QI,QK=kr(()=>{Ab(),Mb(),JI=XI(gk),QI=XI(Hp)});function tY(et,Y){Y===void 0&&(Y=et,et=bk);for(var f=0,y=Y.length-1,z=Y[0],P=new Array(y<0?0:y);f{wk()});function rY(et,Y){for(var f=new Array(Y),y=0;y{}),$_={};rn($_,{interpolate:()=>bk,interpolateArray:()=>IK,interpolateBasis:()=>xI,interpolateBasisClosed:()=>bI,interpolateCubehelix:()=>JI,interpolateCubehelixLong:()=>QI,interpolateDate:()=>II,interpolateDiscrete:()=>OK,interpolateHcl:()=>KI,interpolateHclLong:()=>YI,interpolateHsl:()=>qI,interpolateHslLong:()=>GI,interpolateHue:()=>RK,interpolateLab:()=>YK,interpolateNumber:()=>tv,interpolateNumberArray:()=>jC,interpolateObject:()=>zI,interpolateRgb:()=>vk,interpolateRgbBasis:()=>CI,interpolateRgbBasisClosed:()=>AI,interpolateRound:()=>NK,interpolateString:()=>BI,interpolateTransformCss:()=>jI,interpolateTransformSvg:()=>UI,interpolateZoom:()=>VI,piecewise:()=>tY,quantize:()=>rY});var Eb=kr(()=>{wk(),PI(),NC(),wI(),DI(),BK(),FK(),yk(),UC(),OI(),jK(),RI(),WK(),ZK(),MI(),KK(),XK(),JK(),QK(),eY(),nY()}),HC=It((et,Y)=>{var f=Js(),y=Hn();Y.exports=function(z,P,n,i,a){var l=P.data.data,o=l.i,c=a||l.color;if(o>=0){P.i=l.i;var s=n.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=c,P.color=c):(s.color=c,P.color=c),f.pointStyle(z,n,i,P)}else y.fill(z,c)}}),tD=It((et,Y)=>{var f=Br(),y=Hn(),z=jn(),P=C0().resizeText,n=HC();function i(l){var o=l._fullLayout._sunburstlayer.selectAll(".trace");P(l,o,"sunburst"),o.each(function(c){var s=f.select(this),h=c[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){f.select(this).call(a,b,m,l)})})}function a(l,o,c,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(c,b,"marker.line.color")||y.defaultLine,_=z.castOption(c,b,"marker.line.width")||0;l.call(n,o,c,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?c.leaf.opacity:null)}Y.exports={style:i,styleOne:a}}),uy=It(et=>{var Y=jn(),f=Hn(),y=Mm(),z=Vv();et.findEntryWithLevel=function(a,l){var o;return l&&a.eachAfter(function(c){if(et.getPtId(c)===l)return o=c.copy()}),o||a},et.findEntryWithChild=function(a,l){var o;return a.eachAfter(function(c){for(var s=c.children||[],h=0;h0)},et.getMaxDepth=function(a){return a.maxdepth>=0?a.maxdepth:1/0},et.isHeader=function(a,l){return!(et.isLeaf(a)||a.depth===l._maxDepth-1)};function i(a){return a.data.data.pid}et.getParent=function(a,l){return et.findEntryWithLevel(a,i(l))},et.listPath=function(a,l){var o=a.parent;if(!o)return[];var c=l?[o.data[l]]:[o];return et.listPath(o,l).concat(c)},et.getPath=function(a){return et.listPath(a,"label").join("/")+"/"},et.formatValue=z.formatPieValue,et.formatPercent=function(a,l){var o=Y.formatPercent(a,0);return o==="0%"&&(o=z.formatPiePercent(a,l)),o}}),Sk=It((et,Y)=>{var f=Br(),y=ls(),z=T0().appendArrayPointValue,P=hd(),n=jn(),i=qg(),a=uy(),l=Vv(),o=l.formatPieValue;Y.exports=function(s,h,m,b,x){var _=b[0],A=_.trace,d=_.hierarchy,k=A.type==="sunburst",w=A.type==="treemap"||A.type==="icicle";"_hasHoverLabel"in A||(A._hasHoverLabel=!1),"_hasHoverEvent"in A||(A._hasHoverEvent=!1);var D=function(M){var p=m._fullLayout;if(!(m._dragging||p.hovermode===!1)){var g=m._fullData[A.index],C=M.data.data,S=C.i,N=a.isHierarchyRoot(M),B=a.getParent(d,M),U=a.getValue(M),V=function(J){return n.castOption(g,S,J)},W=V("hovertemplate"),F=P.castHoverinfo(g,p,S),H=p.separators,q;if(W||F&&F!=="none"&&F!=="skip"){var G,tt;k&&(G=_.cx+M.pxmid[0]*(1-M.rInscribed),tt=_.cy+M.pxmid[1]*(1-M.rInscribed)),w&&(G=M._hoverX,tt=M._hoverY);var ht={},bt=[],vt=[],ut=function(J){return bt.indexOf(J)!==-1};F&&(bt=F==="all"?g._module.attributes.hoverinfo.flags:F.split("+")),ht.label=C.label,ut("label")&&ht.label&&vt.push(ht.label),C.hasOwnProperty("v")&&(ht.value=C.v,ht.valueLabel=o(ht.value,H),ut("value")&&vt.push(ht.valueLabel)),ht.currentPath=M.currentPath=a.getPath(M.data),ut("current path")&&!N&&vt.push(ht.currentPath);var rt,gt=[],it=function(){gt.indexOf(rt)===-1&&(vt.push(rt),gt.push(rt))};ht.percentParent=M.percentParent=U/a.getValue(B),ht.parent=M.parentString=a.getPtLabel(B),ut("percent parent")&&(rt=a.formatPercent(ht.percentParent,H)+" of "+ht.parent,it()),ht.percentEntry=M.percentEntry=U/a.getValue(h),ht.entry=M.entry=a.getPtLabel(h),ut("percent entry")&&!N&&!M.onPathbar&&(rt=a.formatPercent(ht.percentEntry,H)+" of "+ht.entry,it()),ht.percentRoot=M.percentRoot=U/a.getValue(d),ht.root=M.root=a.getPtLabel(d),ut("percent root")&&!N&&(rt=a.formatPercent(ht.percentRoot,H)+" of "+ht.root,it()),ht.text=V("hovertext")||V("text"),ut("text")&&(rt=ht.text,n.isValidTextValue(rt)&&vt.push(rt)),q=[c(M,g,x.eventDataKeys)];var st={trace:g,y:tt,_x0:M._x0,_x1:M._x1,_y0:M._y0,_y1:M._y1,text:vt.join("
"),name:W||ut("name")?g.name:void 0,color:V("hoverlabel.bgcolor")||C.color,borderColor:V("hoverlabel.bordercolor"),fontFamily:V("hoverlabel.font.family"),fontSize:V("hoverlabel.font.size"),fontColor:V("hoverlabel.font.color"),fontWeight:V("hoverlabel.font.weight"),fontStyle:V("hoverlabel.font.style"),fontVariant:V("hoverlabel.font.variant"),nameLength:V("hoverlabel.namelength"),textAlign:V("hoverlabel.align"),hovertemplate:W,hovertemplateLabels:ht,eventData:q};k&&(st.x0=G-M.rInscribed*M.rpx1,st.x1=G+M.rInscribed*M.rpx1,st.idealAlign=M.pxmid[0]<0?"left":"right"),w&&(st.x=G,st.idealAlign=G<0?"left":"right");var xt=[];P.loneHover(st,{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:m,inOut_bbox:xt}),q[0].bbox=xt[0],A._hasHoverLabel=!0}if(w){var ot=s.select("path.surface");x.styleOne(ot,M,g,m,{hovered:!0})}A._hasHoverEvent=!0,m.emit("plotly_hover",{points:q||[c(M,g,x.eventDataKeys)],event:f.event})}},E=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=f.select(this).datum();if(A._hasHoverEvent&&(M.originalEvent=f.event,m.emit("plotly_unhover",{points:[c(C,g,x.eventDataKeys)],event:f.event}),A._hasHoverEvent=!1),A._hasHoverLabel&&(P.loneUnhover(p._hoverlayer.node()),A._hasHoverLabel=!1),w){var S=s.select("path.surface");x.styleOne(S,C,g,m,{hovered:!1})}},I=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=k&&(a.isHierarchyRoot(M)||a.isLeaf(M)),S=a.getPtId(M),N=a.isEntry(M)?a.findEntryWithChild(d,S):a.findEntryWithLevel(d,S),B=a.getPtId(N),U={points:[c(M,g,x.eventDataKeys)],event:f.event};C||(U.nextLevel=B);var V=i.triggerHandler(m,"plotly_"+A.type+"click",U);if(V!==!1&&p.hovermode&&(m._hoverdata=[c(M,g,x.eventDataKeys)],P.click(m,f.event)),!C&&V!==!1&&!m._dragging&&!m._transitioning){y.call("_storeDirectGUIEdit",g,p._tracePreGUI[g.uid],{level:g.level});var W={data:[{level:B}],traces:[A.index]},F={frame:{redraw:!1,duration:x.transitionTime},transition:{duration:x.transitionTime,easing:x.transitionEasing},mode:"immediate",fromcurrent:!0};P.loneUnhover(p._hoverlayer.node()),y.call("animate",m,W,F)}};s.on("mouseover",D),s.on("mouseout",E),s.on("click",I)};function c(s,h,m){for(var b=s.data.data,x={curveNumber:h.index,pointNumber:b.i,data:h._input,fullData:h},_=0;_{var Y=Br(),f=lk(),y=(Eb(),tn($_)).interpolate,z=Js(),P=jn(),n=uu(),i=C0(),a=i.recordMinTextSize,l=i.clearMinTextSize,o=pC(),c=Vv().getRotationAngle,s=o.computeTransform,h=o.transformInsideText,m=tD().styleOne,b=Pg().resizeText,x=Sk(),_=JP(),A=uy();et.plot=function(I,M,p,g){var C=I._fullLayout,S=C._sunburstlayer,N,B,U=!p,V=!C.uniformtext.mode&&A.hasTransition(p);if(l("sunburst",C),N=S.selectAll("g.trace.sunburst").data(M,function(F){return F[0].trace.uid}),N.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),N.order(),V){g&&(B=g());var W=Y.transition().duration(p.duration).ease(p.easing).each("end",function(){B&&B()}).each("interrupt",function(){B&&B()});W.each(function(){S.selectAll("g.trace").each(function(F){d(I,F,this,p)})})}else N.each(function(F){d(I,F,this,p)}),C.uniformtext.mode&&b(I,C._sunburstlayer.selectAll(".trace"),"sunburst");U&&N.exit().remove()};function d(I,M,p,g){var C=I._context.staticPlot,S=I._fullLayout,N=!S.uniformtext.mode&&A.hasTransition(g),B=Y.select(p),U=B.selectAll("g.slice"),V=M[0],W=V.trace,F=V.hierarchy,H=A.findEntryWithLevel(F,W.level),q=A.getMaxDepth(W),G=S._size,tt=W.domain,ht=G.w*(tt.x[1]-tt.x[0]),bt=G.h*(tt.y[1]-tt.y[0]),vt=.5*Math.min(ht,bt),ut=V.cx=G.l+G.w*(tt.x[1]+tt.x[0])/2,rt=V.cy=G.t+G.h*(1-tt.y[0])-bt/2;if(!H)return U.remove();var gt=null,it={};N&&U.each(function(Lt){it[A.getPtId(Lt)]={rpx0:Lt.rpx0,rpx1:Lt.rpx1,x0:Lt.x0,x1:Lt.x1,transform:Lt.transform},!gt&&A.isEntry(Lt)&&(gt=Lt)});var st=k(H).descendants(),xt=H.height+1,ot=0,J=q;V.hasMultipleRoots&&A.isHierarchyRoot(H)&&(st=st.slice(1),xt-=1,ot=1,J+=1),st=st.filter(function(Lt){return Lt.y1<=J});var mt=c(W.rotation);mt&&st.forEach(function(Lt){Lt.x0+=mt,Lt.x1+=mt});var dt=Math.min(xt,q),Ct=function(Lt){return(Lt-ot)/dt*vt},Rt=function(Lt,ie){return[Lt*Math.cos(ie),-Lt*Math.sin(ie)]},Bt=function(Lt){return P.pathAnnulus(Lt.rpx0,Lt.rpx1,Lt.x0,Lt.x1,ut,rt)},Zt=function(Lt){return ut+D(Lt)[0]*(Lt.transform.rCenter||0)+(Lt.transform.x||0)},Gt=function(Lt){return rt+D(Lt)[1]*(Lt.transform.rCenter||0)+(Lt.transform.y||0)};U=U.data(st,A.getPtId),U.enter().append("g").classed("slice",!0),N?U.exit().transition().each(function(){var Lt=Y.select(this),ie=Lt.select("path.surface");ie.transition().attrTween("d",function(ce){var Le=ye(ce);return function(Ze){return Bt(Le(Ze))}});var be=Lt.select("g.slicetext");be.attr("opacity",0)}).remove():U.exit().remove(),U.order();var ee=null;if(N&>){var xe=A.getPtId(gt);U.each(function(Lt){ee===null&&A.getPtId(Lt)===xe&&(ee=Lt.x1)})}var ge=U;N&&(ge=ge.transition().each("end",function(){var Lt=Y.select(this);A.setSliceCursor(Lt,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),ge.each(function(Lt){var ie=Y.select(this),be=P.ensureSingle(ie,"path","surface",function(fr){fr.style("pointer-events",C?"none":"all")});Lt.rpx0=Ct(Lt.y0),Lt.rpx1=Ct(Lt.y1),Lt.xmid=(Lt.x0+Lt.x1)/2,Lt.pxmid=Rt(Lt.rpx1,Lt.xmid),Lt.midangle=-(Lt.xmid-Math.PI/2),Lt.startangle=-(Lt.x0-Math.PI/2),Lt.stopangle=-(Lt.x1-Math.PI/2),Lt.halfangle=.5*Math.min(P.angleDelta(Lt.x0,Lt.x1)||Math.PI,Math.PI),Lt.ring=1-Lt.rpx0/Lt.rpx1,Lt.rInscribed=w(Lt),N?be.transition().attrTween("d",function(fr){var Jr=ue(fr);return function(an){return Bt(Jr(an))}}):be.attr("d",Bt),ie.call(x,H,I,M,{eventDataKeys:_.eventDataKeys,transitionTime:_.CLICK_TRANSITION_TIME,transitionEasing:_.CLICK_TRANSITION_EASING}).call(A.setSliceCursor,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:I._transitioning}),be.call(m,Lt,W,I);var ce=P.ensureSingle(ie,"g","slicetext"),Le=P.ensureSingle(ce,"text","",function(fr){fr.attr("data-notex",1)}),Ze=P.ensureUniformFontSize(I,A.determineTextFont(W,Lt,S.font));Le.text(et.formatSliceLabel(Lt,H,W,M,S)).classed("slicetext",!0).attr("text-anchor","middle").call(z.font,Ze).call(n.convertToTspans,I);var Qe=z.bBox(Le.node());Lt.transform=h(Qe,Lt,V),Lt.transform.targetX=Zt(Lt),Lt.transform.targetY=Gt(Lt);var mr=function(fr,Jr){var an=fr.transform;return s(an,Jr),an.fontSize=Ze.size,a(W.type,an,S),P.getTextTransform(an)};N?Le.transition().attrTween("transform",function(fr){var Jr=Mt(fr);return function(an){return mr(Jr(an),Qe)}}):Le.attr("transform",mr(Lt,Qe))});function ye(Lt){var ie=A.getPtId(Lt),be=it[ie],ce=it[A.getPtId(H)],Le;if(ce){var Ze=(Lt.x1>ce.x1?2*Math.PI:0)+mt;Le=Lt.rpx1ee?2*Math.PI:0)+mt;be={x0:Le,x1:Le}}else be={rpx0:vt,rpx1:vt},P.extendFlat(be,Ot(Lt));else be={rpx0:0,rpx1:0};else be={x0:mt,x1:mt};return y(be,ce)}function Mt(Lt){var ie=it[A.getPtId(Lt)],be,ce=Lt.transform;if(ie)be=ie;else if(be={rpx1:Lt.rpx1,transform:{textPosAngle:ce.textPosAngle,scale:0,rotate:ce.rotate,rCenter:ce.rCenter,x:ce.x,y:ce.y}},gt)if(Lt.parent)if(ee){var Le=Lt.x1>ee?2*Math.PI:0;be.x0=be.x1=Le}else P.extendFlat(be,Ot(Lt));else be.x0=be.x1=mt;else be.x0=be.x1=mt;var Ze=y(be.transform.textPosAngle,Lt.transform.textPosAngle),Qe=y(be.rpx1,Lt.rpx1),mr=y(be.x0,Lt.x0),fr=y(be.x1,Lt.x1),Jr=y(be.transform.scale,ce.scale),an=y(be.transform.rotate,ce.rotate),Er=ce.rCenter===0?3:be.transform.rCenter===0?1/3:1,dn=y(be.transform.rCenter,ce.rCenter),_n=function(Oe){return dn(Math.pow(Oe,Er))};return function(Oe){var Xt=Qe(Oe);mr(Oe),fr(Oe);var oe=_n(Oe),zt=Ze(Oe),_t={rpx1:Xt,transform:{textPosAngle:zt,rCenter:oe,x:ce.x,y:ce.y}};return a(W.type,ce,S),{transform:{targetX:Zt(_t),targetY:Gt(_t),scale:Jr(Oe),rotate:an(Oe),rCenter:oe}}}}function Ot(Lt){var ie=Lt.parent,be=it[A.getPtId(ie)],ce={};if(be){var Le=ie.children,Ze=Le.indexOf(Lt),Qe=Le.length,mr=y(be.x0,be.x1);ce.x0=mr(Ze/Qe),ce.x1=mr(Ze/Qe)}else ce.x0=ce.x1=0;return ce}}function k(I){return f.partition().size([2*Math.PI,I.height+1])(I)}et.formatSliceLabel=function(I,M,p,g,C){var S=p.texttemplate,N=p.textinfo;if(!S&&(!N||N==="none"))return"";var B=C.separators,U=g[0],V=I.data.data,W=U.hierarchy,F=A.isHierarchyRoot(I),H=A.getParent(W,I),q=A.getValue(I);if(!S){var G=N.split("+"),tt=function(ot){return G.indexOf(ot)!==-1},ht=[],bt;if(tt("label")&&V.label&&ht.push(V.label),V.hasOwnProperty("v")&&tt("value")&&ht.push(A.formatValue(V.v,B)),!F){tt("current path")&&ht.push(A.getPath(I.data));var vt=0;tt("percent parent")&&vt++,tt("percent entry")&&vt++,tt("percent root")&&vt++;var ut=vt>1;if(vt){var rt,gt=function(ot){bt=A.formatPercent(rt,B),ut&&(bt+=" of "+ot),ht.push(bt)};tt("percent parent")&&!F&&(rt=q/A.getValue(H),gt("parent")),tt("percent entry")&&(rt=q/A.getValue(M),gt("entry")),tt("percent root")&&(rt=q/A.getValue(W),gt("root"))}}return tt("text")&&(bt=P.castOption(p,V.i,"text"),P.isValidTextValue(bt)&&ht.push(bt)),ht.join("
")}var it=P.castOption(p,V.i,"texttemplate");if(!it)return"";var st={};V.label&&(st.label=V.label),V.hasOwnProperty("v")&&(st.value=V.v,st.valueLabel=A.formatValue(V.v,B)),st.currentPath=A.getPath(I.data),F||(st.percentParent=q/A.getValue(H),st.percentParentLabel=A.formatPercent(st.percentParent,B),st.parent=A.getPtLabel(H)),st.percentEntry=q/A.getValue(M),st.percentEntryLabel=A.formatPercent(st.percentEntry,B),st.entry=A.getPtLabel(M),st.percentRoot=q/A.getValue(W),st.percentRootLabel=A.formatPercent(st.percentRoot,B),st.root=A.getPtLabel(W),V.hasOwnProperty("color")&&(st.color=V.color);var xt=P.castOption(p,V.i,"text");return(P.isValidTextValue(xt)||xt==="")&&(st.text=xt),st.customdata=P.castOption(p,V.i,"customdata"),P.texttemplateString({data:[st,p._meta],fallback:p.texttemplatefallback,labels:st,locale:C._d3locale,template:it})};function w(I){return I.rpx0===0&&P.isFullCircle([I.x0,I.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(I.halfangle)),I.ring/2))}function D(I){return E(I.rpx1,I.transform.textPosAngle)}function E(I,M){return[I*Math.sin(M),-I*Math.cos(M)]}}),iY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"sunburst",basePlotModule:xK(),categories:[],animatable:!0,attributes:sk(),layoutAttributes:QP(),supplyDefaults:bK(),supplyLayoutDefaults:wK(),calc:ck().calc,crossTraceCalc:ck().crossTraceCalc,plot:VC().plot,style:tD().style,colorbar:Do(),meta:{}}}),aY=It((et,Y)=>{Y.exports=iY()}),oY=It(et=>{var Y=lh();et.name="treemap",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),Lb=It((et,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),WC=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Ru(),n=Jh().attributes,i=wb(),a=sk(),l=Lb(),o=Yn().extendFlat,c=qf().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:a.marker.colors,pattern:c,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:a.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},i.textfont,{}),editType:"calc"},text:i.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,hoverinfo:a.hoverinfo,hovertemplate:f({},{keys:l.eventDataKeys}),hovertemplatefallback:z(),textfont:i.textfont,insidetextfont:i.insidetextfont,outsidetextfont:o({},i.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:i.sort,root:a.root,domain:n({name:"treemap",trace:!0,editType:"calc"})}}),eD=It((et,Y)=>{Y.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),sY=It((et,Y)=>{var f=jn(),y=WC(),z=Hn(),P=Jh().defaults,n=eg().handleText,i=gb().TEXTPAD,a=kb().handleMarkerDefaults,l=ch(),o=l.hasColorscale,c=l.handleDefaults;Y.exports=function(s,h,m,b){function x(g,C){return f.coerce(s,h,y,g,C)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var d=x("values");d&&d.length?x("branchvalues"):x("count"),x("level"),x("maxdepth");var k=x("tiling.packing");k==="squarify"&&x("tiling.squarifyratio"),x("tiling.flip"),x("tiling.pad");var w=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",f.isArrayOrTypedArray(w)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var D=x("pathbar.visible"),E="auto";n(s,h,b,x,E,{hasPathbar:D,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition");var I=h.textposition.indexOf("bottom")!==-1;a(s,h,b,x);var M=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;M?c(s,h,b,x,{prefix:"marker.",cLetter:"c"}):x("marker.depthfade",!(h.marker.colors||[]).length);var p=h.textfont.size*2;x("marker.pad.t",I?p/4:p),x("marker.pad.l",p/4),x("marker.pad.r",p/4),x("marker.pad.b",I?p:p/4),x("marker.cornerradius"),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},D&&(x("pathbar.thickness",h.pathbar.textfont.size+2*i),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),lY=It((et,Y)=>{var f=jn(),y=eD();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("treemapcolorway",P.colorway),n("extendtreemapcolors")}}),rD=It(et=>{var Y=ck();et.calc=function(f,y){return Y.calc(f,y)},et.crossTraceCalc=function(f){return Y._runCrossTraceCalc("treemap",f)}}),nD=It((et,Y)=>{Y.exports=function f(y,z,P){var n;P.swapXY&&(n=y.x0,y.x0=y.y0,y.y0=n,n=y.x1,y.x1=y.y1,y.y1=n),P.flipX&&(n=y.x0,y.x0=z[0]-y.x1,y.x1=z[0]-n),P.flipY&&(n=y.y0,y.y0=z[1]-y.y1,y.y1=z[1]-n);var i=y.children;if(i)for(var a=0;a{var f=lk(),y=nD();Y.exports=function(P,n,i){var a=i.flipX,l=i.flipY,o=i.packing==="dice-slice",c=i.pad[l?"bottom":"top"],s=i.pad[a?"right":"left"],h=i.pad[a?"left":"right"],m=i.pad[l?"top":"bottom"],b;o&&(b=s,s=c,c=b,b=h,h=m,m=b);var x=f.treemap().tile(z(i.packing,i.squarifyratio)).paddingInner(i.pad.inner).paddingLeft(s).paddingRight(h).paddingTop(c).paddingBottom(m).size(o?[n[1],n[0]]:n)(P);return(o||a||l)&&y(x,n,{swapXY:o,flipX:a,flipY:l}),x};function z(P,n){switch(P){case"squarify":return f.treemapSquarify.ratio(n);case"binary":return f.treemapBinary;case"dice":return f.treemapDice;case"slice":return f.treemapSlice;default:return f.treemapSliceDice}}}),qC=It((et,Y)=>{var f=Br(),y=Hn(),z=jn(),P=uy(),n=C0().resizeText,i=HC();function a(o){var c=o._fullLayout._treemaplayer.selectAll(".trace");n(o,c,"treemap"),c.each(function(s){var h=f.select(this),m=s[0],b=m.trace;h.style("opacity",b.opacity),h.selectAll("path.surface").each(function(x){f.select(this).call(l,x,b,o,{hovered:!1})})})}function l(o,c,s,h,m){var b=(m||{}).hovered,x=c.data.data,_=x.i,A,d,k=x.color,w=P.isHierarchyRoot(c),D=1;if(b)A=s._hovered.marker.line.color,d=s._hovered.marker.line.width;else if(w&&k===s.root.color)D=100,A="rgba(0,0,0,0)",d=0;else if(A=z.castOption(s,_,"marker.line.color")||y.defaultLine,d=z.castOption(s,_,"marker.line.width")||0,!s._hasColorscale&&!c.onPathbar){var E=s.marker.depthfade;if(E){var I=y.combine(y.addOpacity(s._backgroundColor,.75),k),M;if(E===!0){var p=P.getMaxDepth(s);isFinite(p)?P.isLeaf(c)?M=0:M=s._maxVisibleLayers-(c.data.depth-s._entryDepth):M=c.data.height+1}else M=c.data.depth-s._entryDepth,s._atRootLevel||M++;if(M>0)for(var g=0;g{var f=Br(),y=jn(),z=Js(),P=uu(),n=iD(),i=qC().styleOne,a=Lb(),l=uy(),o=Sk(),c=!0;Y.exports=function(s,h,m,b,x){var _=x.barDifY,A=x.width,d=x.height,k=x.viewX,w=x.viewY,D=x.pathSlice,E=x.toMoveInsideSlice,I=x.strTransform,M=x.hasTransition,p=x.handleSlicesExit,g=x.makeUpdateSliceInterpolator,C=x.makeUpdateTextInterpolator,S={},N=s._context.staticPlot,B=s._fullLayout,U=h[0],V=U.trace,W=U.hierarchy,F=A/V._entryDepth,H=l.listPath(m.data,"id"),q=n(W.copy(),[A,d],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();q=q.filter(function(tt){var ht=H.indexOf(tt.data.id);return ht===-1?!1:(tt.x0=F*ht,tt.x1=F*(ht+1),tt.y0=_,tt.y1=_+d,tt.onPathbar=!0,!0)}),q.reverse(),b=b.data(q,l.getPtId),b.enter().append("g").classed("pathbar",!0),p(b,c,S,[A,d],D),b.order();var G=b;M&&(G=G.transition().each("end",function(){var tt=f.select(this);l.setSliceCursor(tt,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),G.each(function(tt){tt._x0=k(tt.x0),tt._x1=k(tt.x1),tt._y0=w(tt.y0),tt._y1=w(tt.y1),tt._hoverX=k(tt.x1-Math.min(A,d)/2),tt._hoverY=w(tt.y1-d/2);var ht=f.select(this),bt=y.ensureSingle(ht,"path","surface",function(gt){gt.style("pointer-events",N?"none":"all")});M?bt.transition().attrTween("d",function(gt){var it=g(gt,c,S,[A,d]);return function(st){return D(it(st))}}):bt.attr("d",D),ht.call(o,m,s,h,{styleOne:i,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:s._transitioning}),bt.call(i,tt,V,s,{hovered:!1}),tt._text=(l.getPtLabel(tt)||"").split("
").join(" ")||"";var vt=y.ensureSingle(ht,"g","slicetext"),ut=y.ensureSingle(vt,"text","",function(gt){gt.attr("data-notex",1)}),rt=y.ensureUniformFontSize(s,l.determineTextFont(V,tt,B.font,{onPathbar:!0}));ut.text(tt._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(z.font,rt).call(P.convertToTspans,s),tt.textBB=z.bBox(ut.node()),tt.transform=E(tt,{fontSize:rt.size,onPathbar:!0}),tt.transform.fontSize=rt.size,M?ut.transition().attrTween("transform",function(gt){var it=C(gt,c,S,[A,d]);return function(st){return I(it(st))}}):ut.attr("transform",I(tt))})}}),uY=It((et,Y)=>{var f=Br(),y=(Eb(),tn($_)).interpolate,z=uy(),P=jn(),n=gb().TEXTPAD,i=vb(),a=i.toMoveInsideBar,l=C0(),o=l.recordMinTextSize,c=Lb(),s=cY();function h(m){return z.isHierarchyRoot(m)?"":z.getPtId(m)}Y.exports=function(m,b,x,_,A){var d=m._fullLayout,k=b[0],w=k.trace,D=w.type,E=D==="icicle",I=k.hierarchy,M=z.findEntryWithLevel(I,w.level),p=f.select(x),g=p.selectAll("g.pathbar"),C=p.selectAll("g.slice");if(!M){g.remove(),C.remove();return}var S=z.isHierarchyRoot(M),N=!d.uniformtext.mode&&z.hasTransition(_),B=z.getMaxDepth(w),U=function(Er){return Er.data.depth-M.data.depth-1?H+tt:-(G+tt):0,bt={x0:q,x1:q,y0:ht,y1:ht+G},vt=function(Er,dn,_n){var Oe=w.tiling.pad,Xt=function(Pt){return Pt-Oe<=dn.x0},oe=function(Pt){return Pt+Oe>=dn.x1},zt=function(Pt){return Pt-Oe<=dn.y0},_t=function(Pt){return Pt+Oe>=dn.y1};return Er.x0===dn.x0&&Er.x1===dn.x1&&Er.y0===dn.y0&&Er.y1===dn.y1?{x0:Er.x0,x1:Er.x1,y0:Er.y0,y1:Er.y1}:{x0:Xt(Er.x0-Oe)?0:oe(Er.x0-Oe)?_n[0]:Er.x0,x1:Xt(Er.x1+Oe)?0:oe(Er.x1+Oe)?_n[0]:Er.x1,y0:zt(Er.y0-Oe)?0:_t(Er.y0-Oe)?_n[1]:Er.y0,y1:zt(Er.y1+Oe)?0:_t(Er.y1+Oe)?_n[1]:Er.y1}},ut=null,rt={},gt={},it=null,st=function(Er,dn){return dn?rt[h(Er)]:gt[h(Er)]},xt=function(Er,dn,_n,Oe){if(dn)return rt[h(I)]||bt;var Xt=gt[w.level]||_n;return U(Er)?vt(Er,Xt,Oe):{}};k.hasMultipleRoots&&S&&B++,w._maxDepth=B,w._backgroundColor=d.paper_bgcolor,w._entryDepth=M.data.depth,w._atRootLevel=S;var ot=-F/2+V.l+V.w*(W.x[1]+W.x[0])/2,J=-H/2+V.t+V.h*(1-(W.y[1]+W.y[0])/2),mt=function(Er){return ot+Er},dt=function(Er){return J+Er},Ct=dt(0),Rt=mt(0),Bt=function(Er){return Rt+Er},Zt=function(Er){return Ct+Er};function Gt(Er,dn){return Er+","+dn}var ee=Bt(0),xe=function(Er){Er.x=Math.max(ee,Er.x)},ge=w.pathbar.edgeshape,ye=function(Er){var dn=Bt(Math.max(Math.min(Er.x0,Er.x0),0)),_n=Bt(Math.min(Math.max(Er.x1,Er.x1),q)),Oe=Zt(Er.y0),Xt=Zt(Er.y1),oe=G/2,zt={},_t={};zt.x=dn,_t.x=_n,zt.y=_t.y=(Oe+Xt)/2;var Pt={x:dn,y:Oe},Ht={x:_n,y:Oe},ae={x:_n,y:Xt},he={x:dn,y:Xt};return ge===">"?(Pt.x-=oe,Ht.x-=oe,ae.x-=oe,he.x-=oe):ge==="/"?(ae.x-=oe,he.x-=oe,zt.x-=oe/2,_t.x-=oe/2):ge==="\\"?(Pt.x-=oe,Ht.x-=oe,zt.x-=oe/2,_t.x-=oe/2):ge==="<"&&(zt.x-=oe,_t.x-=oe),xe(Pt),xe(he),xe(zt),xe(Ht),xe(ae),xe(_t),"M"+Gt(Pt.x,Pt.y)+"L"+Gt(Ht.x,Ht.y)+"L"+Gt(_t.x,_t.y)+"L"+Gt(ae.x,ae.y)+"L"+Gt(he.x,he.y)+"L"+Gt(zt.x,zt.y)+"Z"},ue=w[E?"tiling":"marker"].pad,Mt=function(Er){return w.textposition.indexOf(Er)!==-1},Ot=Mt("top"),Lt=Mt("left"),ie=Mt("right"),be=Mt("bottom"),ce=function(Er){var dn=mt(Er.x0),_n=mt(Er.x1),Oe=dt(Er.y0),Xt=dt(Er.y1),oe=_n-dn,zt=Xt-Oe;if(!oe||!zt)return"";var _t=w.marker.cornerradius||0,Pt=Math.min(_t,oe/2,zt/2);Pt&&Er.data&&Er.data.data&&Er.data.data.label&&(Ot&&(Pt=Math.min(Pt,ue.t)),Lt&&(Pt=Math.min(Pt,ue.l)),ie&&(Pt=Math.min(Pt,ue.r)),be&&(Pt=Math.min(Pt,ue.b)));var Ht=function(ae,he){return Pt?"a"+Gt(Pt,Pt)+" 0 0 1 "+Gt(ae,he):""};return"M"+Gt(dn,Oe+Pt)+Ht(Pt,-Pt)+"L"+Gt(_n-Pt,Oe)+Ht(Pt,Pt)+"L"+Gt(_n,Xt-Pt)+Ht(-Pt,Pt)+"L"+Gt(dn+Pt,Xt)+Ht(-Pt,-Pt)+"Z"},Le=function(Er,dn){var _n=Er.x0,Oe=Er.x1,Xt=Er.y0,oe=Er.y1,zt=Er.textBB,_t=Ot||dn.isHeader&&!be,Pt=_t?"start":be?"end":"middle",Ht=Mt("right"),ae=Mt("left")||dn.onPathbar,he=ae?-1:Ht?1:0;if(dn.isHeader){if(_n+=(E?ue:ue.l)-n,Oe-=(E?ue:ue.r)-n,_n>=Oe){var Me=(_n+Oe)/2;_n=Me,Oe=Me}var qe;be?(qe=oe-(E?ue:ue.b),Xt{var f=Br(),y=uy(),z=C0(),P=z.clearMinTextSize,n=Pg().resizeText,i=uY();Y.exports=function(a,l,o,c,s){var h=s.type,m=s.drawDescendants,b=a._fullLayout,x=b["_"+h+"layer"],_,A,d=!o;if(P(h,b),_=x.selectAll("g.trace."+h).data(l,function(w){return w[0].trace.uid}),_.enter().append("g").classed("trace",!0).classed(h,!0),_.order(),!b.uniformtext.mode&&y.hasTransition(o)){c&&(A=c());var k=f.transition().duration(o.duration).ease(o.easing).each("end",function(){A&&A()}).each("interrupt",function(){A&&A()});k.each(function(){x.selectAll("g.trace").each(function(w){i(a,w,this,o,m)})})}else _.each(function(w){i(a,w,this,o,m)}),b.uniformtext.mode&&n(a,x.selectAll(".trace"),h);d&&_.exit().remove()}}),hY=It((et,Y)=>{var f=Br(),y=jn(),z=Js(),P=uu(),n=iD(),i=qC().styleOne,a=Lb(),l=uy(),o=Sk(),c=VC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,d=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,S=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,H=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=!q&&!W.marker.pad.t||q&&!W.marker.pad.b,tt=n(b,[A,d],{packing:W.tiling.packing,squarifyratio:W.tiling.squarifyratio,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,pad:{inner:W.tiling.pad,top:W.marker.pad.t,left:W.marker.pad.l,right:W.marker.pad.r,bottom:W.marker.pad.b}}),ht=tt.descendants(),bt=1/0,vt=-1/0;ht.forEach(function(st){var xt=st.depth;xt>=W._maxDepth?(st.x0=st.x1=(st.x0+st.x1)/2,st.y0=st.y1=(st.y0+st.y1)/2):(bt=Math.min(bt,xt),vt=Math.max(vt,xt))}),x=x.data(ht,l.getPtId),W._maxVisibleLayers=isFinite(vt)?vt-bt+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,d],D),x.order();var ut=null;if(M&&S){var rt=l.getPtId(S);x.each(function(st){ut===null&&l.getPtId(st)===rt&&(ut={x0:st.x0,x1:st.x1,y0:st.y0,y1:st.y1})})}var gt=function(){return ut||{x0:0,x1:A,y0:0,y1:d}},it=x;return M&&(it=it.transition().each("end",function(){var st=f.select(this);l.setSliceCursor(st,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),it.each(function(st){var xt=l.isHeader(st,W);st._x0=k(st.x0),st._x1=k(st.x1),st._y0=w(st.y0),st._y1=w(st.y1),st._hoverX=k(st.x1-W.marker.pad.r),st._hoverY=w(q?st.y1-W.marker.pad.b/2:st.y0+W.marker.pad.t/2);var ot=f.select(this),J=y.ensureSingle(ot,"path","surface",function(Zt){Zt.style("pointer-events",B?"none":"all")});M?J.transition().attrTween("d",function(Zt){var Gt=g(Zt,s,gt(),[A,d]);return function(ee){return D(Gt(ee))}}):J.attr("d",D),ot.call(o,b,h,m,{styleOne:i,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),J.call(i,st,W,h,{hovered:!1}),st.x0===st.x1||st.y0===st.y1?st._text="":xt?st._text=G?"":l.getPtLabel(st)||"":st._text=c(st,b,W,m,U)||"";var mt=y.ensureSingle(ot,"g","slicetext"),dt=y.ensureSingle(mt,"text","",function(Zt){Zt.attr("data-notex",1)}),Ct=y.ensureUniformFontSize(h,l.determineTextFont(W,st,U.font)),Rt=st._text||" ",Bt=xt&&Rt.indexOf("
")===-1;dt.text(Rt).classed("slicetext",!0).attr("text-anchor",H?"end":F||Bt?"start":"middle").call(z.font,Ct).call(P.convertToTspans,h),st.textBB=z.bBox(dt.node()),st.transform=E(st,{fontSize:Ct.size,isHeader:xt}),st.transform.fontSize=Ct.size,M?dt.transition().attrTween("transform",function(Zt){var Gt=C(Zt,s,gt(),[A,d]);return function(ee){return I(Gt(ee))}}):dt.attr("transform",I(st))}),ut}}),dY=It((et,Y)=>{var f=aD(),y=hY();Y.exports=function(z,P,n,i){return f(z,P,n,i,{type:"treemap",drawDescendants:y})}}),fY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"treemap",basePlotModule:oY(),categories:[],animatable:!0,attributes:WC(),layoutAttributes:eD(),supplyDefaults:sY(),supplyLayoutDefaults:lY(),calc:rD().calc,crossTraceCalc:rD().crossTraceCalc,plot:dY(),style:qC().style,colorbar:Do(),meta:{}}}),pY=It((et,Y)=>{Y.exports=fY()}),mY=It(et=>{var Y=lh();et.name="icicle",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),oD=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Ru(),n=Jh().attributes,i=wb(),a=sk(),l=WC(),o=Lb(),c=Yn().extendFlat,s=qf().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:c({colors:a.marker.colors,line:a.marker.line,pattern:s,editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),leaf:a.leaf,pathbar:l.pathbar,text:i.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,hoverinfo:a.hoverinfo,hovertemplate:f({},{keys:o.eventDataKeys}),hovertemplatefallback:z(),textfont:i.textfont,insidetextfont:i.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:i.sort,root:a.root,domain:n({name:"icicle",trace:!0,editType:"calc"})}}),sD=It((et,Y)=>{Y.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),gY=It((et,Y)=>{var f=jn(),y=oD(),z=Hn(),P=Jh().defaults,n=eg().handleText,i=gb().TEXTPAD,a=kb().handleMarkerDefaults,l=ch(),o=l.hasColorscale,c=l.handleDefaults;Y.exports=function(s,h,m,b){function x(I,M){return f.coerce(s,h,y,I,M)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var d=x("values");d&&d.length?x("branchvalues"):x("count"),x("level"),x("maxdepth"),x("tiling.orientation"),x("tiling.flip"),x("tiling.pad");var k=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",f.isArrayOrTypedArray(k)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var w=x("pathbar.visible"),D="auto";n(s,h,b,x,D,{hasPathbar:w,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition"),a(s,h,b,x);var E=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;E&&c(s,h,b,x,{prefix:"marker.",cLetter:"c"}),x("leaf.opacity",E?1:.7),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},w&&(x("pathbar.thickness",h.pathbar.textfont.size+2*i),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),vY=It((et,Y)=>{var f=jn(),y=sD();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("iciclecolorway",P.colorway),n("extendiciclecolors")}}),lD=It(et=>{var Y=ck();et.calc=function(f,y){return Y.calc(f,y)},et.crossTraceCalc=function(f){return Y._runCrossTraceCalc("icicle",f)}}),yY=It((et,Y)=>{var f=lk(),y=nD();Y.exports=function(z,P,n){var i=n.flipX,a=n.flipY,l=n.orientation==="h",o=n.maxDepth,c=P[0],s=P[1];o&&(c=(z.height+1)*P[0]/Math.min(z.height+1,o),s=(z.height+1)*P[1]/Math.min(z.height+1,o));var h=f.partition().padding(n.pad.inner).size(l?[P[1],c]:[P[0],s])(z);return(l||i||a)&&y(h,P,{swapXY:l,flipX:i,flipY:a}),h}}),cD=It((et,Y)=>{var f=Br(),y=Hn(),z=jn(),P=C0().resizeText,n=HC();function i(l){var o=l._fullLayout._iciclelayer.selectAll(".trace");P(l,o,"icicle"),o.each(function(c){var s=f.select(this),h=c[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){f.select(this).call(a,b,m,l)})})}function a(l,o,c,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(c,b,"marker.line.color")||y.defaultLine,_=z.castOption(c,b,"marker.line.width")||0;l.call(n,o,c,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?c.leaf.opacity:null)}Y.exports={style:i,styleOne:a}}),_Y=It((et,Y)=>{var f=Br(),y=jn(),z=Js(),P=uu(),n=yY(),i=cD().styleOne,a=Lb(),l=uy(),o=Sk(),c=VC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,d=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,S=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,H=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=n(b,[A,d],{flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,orientation:W.tiling.orientation,pad:{inner:W.tiling.pad},maxDepth:W._maxDepth}),tt=G.descendants(),ht=1/0,bt=-1/0;tt.forEach(function(it){var st=it.depth;st>=W._maxDepth?(it.x0=it.x1=(it.x0+it.x1)/2,it.y0=it.y1=(it.y0+it.y1)/2):(ht=Math.min(ht,st),bt=Math.max(bt,st))}),x=x.data(tt,l.getPtId),W._maxVisibleLayers=isFinite(bt)?bt-ht+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,d],D),x.order();var vt=null;if(M&&S){var ut=l.getPtId(S);x.each(function(it){vt===null&&l.getPtId(it)===ut&&(vt={x0:it.x0,x1:it.x1,y0:it.y0,y1:it.y1})})}var rt=function(){return vt||{x0:0,x1:A,y0:0,y1:d}},gt=x;return M&&(gt=gt.transition().each("end",function(){var it=f.select(this);l.setSliceCursor(it,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),gt.each(function(it){it._x0=k(it.x0),it._x1=k(it.x1),it._y0=w(it.y0),it._y1=w(it.y1),it._hoverX=k(it.x1-W.tiling.pad),it._hoverY=w(q?it.y1-W.tiling.pad/2:it.y0+W.tiling.pad/2);var st=f.select(this),xt=y.ensureSingle(st,"path","surface",function(dt){dt.style("pointer-events",B?"none":"all")});M?xt.transition().attrTween("d",function(dt){var Ct=g(dt,s,rt(),[A,d],{orientation:W.tiling.orientation,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1});return function(Rt){return D(Ct(Rt))}}):xt.attr("d",D),st.call(o,b,h,m,{styleOne:i,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),xt.call(i,it,W,h,{hovered:!1}),it.x0===it.x1||it.y0===it.y1?it._text="":it._text=c(it,b,W,m,U)||"";var ot=y.ensureSingle(st,"g","slicetext"),J=y.ensureSingle(ot,"text","",function(dt){dt.attr("data-notex",1)}),mt=y.ensureUniformFontSize(h,l.determineTextFont(W,it,U.font));J.text(it._text||" ").classed("slicetext",!0).attr("text-anchor",H?"end":F?"start":"middle").call(z.font,mt).call(P.convertToTspans,h),it.textBB=z.bBox(J.node()),it.transform=E(it,{fontSize:mt.size}),it.transform.fontSize=mt.size,M?J.transition().attrTween("transform",function(dt){var Ct=C(dt,s,rt(),[A,d]);return function(Rt){return I(Ct(Rt))}}):J.attr("transform",I(it))}),vt}}),xY=It((et,Y)=>{var f=aD(),y=_Y();Y.exports=function(z,P,n,i){return f(z,P,n,i,{type:"icicle",drawDescendants:y})}}),bY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"icicle",basePlotModule:mY(),categories:[],animatable:!0,attributes:oD(),layoutAttributes:sD(),supplyDefaults:gY(),supplyLayoutDefaults:vY(),calc:lD().calc,crossTraceCalc:lD().crossTraceCalc,plot:xY(),style:cD().style,colorbar:Do(),meta:{}}}),wY=It((et,Y)=>{Y.exports=bY()}),kY=It(et=>{var Y=lh();et.name="funnelarea",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),uD=It((et,Y)=>{var f=wb(),y=xa(),z=Jh().attributes,{hovertemplateAttrs:P,texttemplateAttrs:n,templatefallbackAttrs:i}=nu(),a=Yn().extendFlat;Y.exports={labels:f.labels,label0:f.label0,dlabel:f.dlabel,values:f.values,marker:{colors:f.marker.colors,line:{color:a({},f.marker.line.color,{dflt:null}),width:a({},f.marker.line.width,{dflt:1}),editType:"calc"},pattern:f.marker.pattern,editType:"calc"},text:f.text,hovertext:f.hovertext,scalegroup:a({},f.scalegroup,{}),textinfo:a({},f.textinfo,{flags:["label","text","value","percent"]}),texttemplate:n({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:i({editType:"plot"}),hoverinfo:a({},y.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:P({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:i(),textposition:a({},f.textposition,{values:["inside","none"],dflt:"inside"}),textfont:f.textfont,insidetextfont:f.insidetextfont,title:{text:f.title.text,font:f.title.font,position:a({},f.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:z({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}),hD=It((et,Y)=>{var f=fC().hiddenlabels;Y.exports={hiddenlabels:f,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),TY=It((et,Y)=>{var f=jn(),y=uD(),z=Jh().defaults,P=eg().handleText,n=kb().handleLabelsAndValues,i=kb().handleMarkerDefaults;Y.exports=function(a,l,o,c){function s(D,E){return f.coerce(a,l,y,D,E)}var h=s("labels"),m=s("values"),b=n(h,m),x=b.len;if(l._hasLabels=b.hasLabels,l._hasValues=b.hasValues,!l._hasLabels&&l._hasValues&&(s("label0"),s("dlabel")),!x){l.visible=!1;return}l._length=x,i(a,l,c,s),s("scalegroup");var _=s("text"),A=s("texttemplate");s("texttemplatefallback");var d;if(A||(d=s("textinfo",Array.isArray(_)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),A||d&&d!=="none"){var k=s("textposition");P(a,l,c,s,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else d==="none"&&s("textposition","none");z(l,c,s);var w=s("title.text");w&&(s("title.position"),f.coerceFont(s,"title.font",c.font)),s("aspectratio"),s("baseratio")}}),SY=It((et,Y)=>{var f=jn(),y=hD();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("hiddenlabels"),n("funnelareacolorway",P.colorway),n("extendfunnelareacolors")}}),dD=It((et,Y)=>{var f=Uw();function y(P,n){return f.calc(P,n)}function z(P){f.crossTraceCalc(P,{type:"funnelarea"})}Y.exports={calc:y,crossTraceCalc:z}}),CY=It((et,Y)=>{var f=Br(),y=Js(),z=jn(),P=z.strScale,n=z.strTranslate,i=uu(),a=vb(),l=a.toMoveInsideBar,o=C0(),c=o.recordMinTextSize,s=o.clearMinTextSize,h=Vv(),m=pC(),b=m.attachFxHandlers,x=m.determineInsideTextFont,_=m.layoutAreas,A=m.prerenderTitles,d=m.positionTitleOutside,k=m.formatSliceLabel;Y.exports=function(I,M){var p=I._context.staticPlot,g=I._fullLayout;s("funnelarea",g),A(M,I),_(M,g._size),z.makeTraceGroups(g._funnelarealayer,M,"trace").each(function(C){var S=f.select(this),N=C[0],B=N.trace;E(C),S.each(function(){var U=f.select(this).selectAll("g.slice").data(C);U.enter().append("g").classed("slice",!0),U.exit().remove(),U.each(function(W,F){if(W.hidden){f.select(this).selectAll("path,g").remove();return}W.pointNumber=W.i,W.curveNumber=B.index;var H=N.cx,q=N.cy,G=f.select(this),tt=G.selectAll("path.surface").data([W]);tt.enter().append("path").classed("surface",!0).style({"pointer-events":p?"none":"all"}),G.call(b,I,C);var ht="M"+(H+W.TR[0])+","+(q+W.TR[1])+w(W.TR,W.BR)+w(W.BR,W.BL)+w(W.BL,W.TL)+"Z";tt.attr("d",ht),k(I,W,N);var bt=h.castOption(B.textposition,W.pts),vt=G.selectAll("g.slicetext").data(W.text&&bt!=="none"?[0]:[]);vt.enter().append("g").classed("slicetext",!0),vt.exit().remove(),vt.each(function(){var ut=z.ensureSingle(f.select(this),"text","",function(mt){mt.attr("data-notex",1)}),rt=z.ensureUniformFontSize(I,x(B,W,g.font));ut.text(W.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(y.font,rt).call(i.convertToTspans,I);var gt=y.bBox(ut.node()),it,st,xt,ot=Math.min(W.BL[1],W.BR[1])+q,J=Math.max(W.TL[1],W.TR[1])+q;st=Math.max(W.TL[0],W.BL[0])+H,xt=Math.min(W.TR[0],W.BR[0])+H,it=l(st,xt,ot,J,gt,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),it.fontSize=rt.size,c(B.type,it,g),C[F].transform=it,z.setTransormAndDisplay(ut,it)})});var V=f.select(this).selectAll("g.titletext").data(B.title.text?[0]:[]);V.enter().append("g").classed("titletext",!0),V.exit().remove(),V.each(function(){var W=z.ensureSingle(f.select(this),"text","",function(q){q.attr("data-notex",1)}),F=B.title.text;B._meta&&(F=z.templateString(F,B._meta)),W.text(F).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(y.font,B.title.font).call(i.convertToTspans,I);var H=d(N,g._size);W.attr("transform",n(H.x,H.y)+P(Math.min(1,H.scale))+n(H.tx,H.ty))})})})};function w(I,M){var p=M[0]-I[0],g=M[1]-I[1];return"l"+p+","+g}function D(I,M){return[.5*(I[0]+M[0]),.5*(I[1]+M[1])]}function E(I){if(!I.length)return;var M=I[0],p=M.trace,g=p.aspectratio,C=p.baseratio;C>.999&&(C=.999);var S=Math.pow(C,2),N=M.vTotal,B=N*S/(1-S),U=N,V=B/N;function W(){var Ct=Math.sqrt(V);return{x:Ct,y:-Ct}}function F(){var Ct=W();return[Ct.x,Ct.y]}var H,q=[];q.push(F());var G,tt;for(G=I.length-1;G>-1;G--)if(tt=I[G],!tt.hidden){var ht=tt.v/U;V+=ht,q.push(F())}var bt=1/0,vt=-1/0;for(G=0;G-1;G--)if(tt=I[G],!tt.hidden){J+=1;var mt=q[J][0],dt=q[J][1];tt.TL=[-mt,dt],tt.TR=[mt,dt],tt.BL=xt,tt.BR=ot,tt.pxmid=D(tt.TR,tt.BR),xt=tt.TL,ot=tt.TR}}}),AY=It((et,Y)=>{var f=Br(),y=Wv(),z=C0().resizeText;Y.exports=function(P){var n=P._fullLayout._funnelarealayer.selectAll(".trace");z(P,n,"funnelarea"),n.each(function(i){var a=i[0],l=a.trace,o=f.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(c){f.select(this).call(y,c,l,P)})})}}),MY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"funnelarea",basePlotModule:kY(),categories:["pie-like","funnelarea","showLegend"],attributes:uD(),layoutAttributes:hD(),supplyDefaults:TY(),supplyLayoutDefaults:SY(),calc:dD().calc,crossTraceCalc:dD().crossTraceCalc,plot:CY(),style:AY(),styleOne:Wv(),meta:{}}}),EY=It((et,Y)=>{Y.exports=MY()}),Vp=It((et,Y)=>{(function(){var f={24:function(n){var i={left:0,top:0};n.exports=a;function a(o,c,s){c=c||o.currentTarget||o.srcElement,Array.isArray(s)||(s=[0,0]);var h=o.clientX||0,m=o.clientY||0,b=l(c);return s[0]=h-b.left,s[1]=m-b.top,s}function l(o){return o===window||o===document||o===document.body?i:o.getBoundingClientRect()}},109:function(n){n.exports=i;function i(a,l,o,c){var s=o[0],h=o[2],m=l[0]-s,b=l[2]-h,x=Math.sin(c),_=Math.cos(c);return a[0]=s+b*x+m*_,a[1]=l[1],a[2]=h+b*_-m*x,a}},160:function(n){n.exports=i;function i(a,l,o){return a[0]=Math.max(l[0],o[0]),a[1]=Math.max(l[1],o[1]),a[2]=Math.max(l[2],o[2]),a[3]=Math.max(l[3],o[3]),a}},216:function(n){n.exports=i;function i(a,l){for(var o={},c=0;c1){x[0]in m||(m[x[0]]=[]),m=m[x[0]];for(var _=1;_=0;--H){var gt=W[H];q=gt[0];var it=U[q],st=it[0],xt=it[1],ot=B[st],J=B[xt];if((ot[0]-J[0]||ot[1]-J[1])<0){var mt=st;st=xt,xt=mt}it[0]=st;var dt=it[1]=gt[1],Ct;for(F&&(Ct=it[2]);H>0&&W[H-1][0]===q;){var gt=W[--H],Rt=gt[1];F?U.push([dt,Rt,Ct]):U.push([dt,Rt]),dt=Rt}F?U.push([dt,xt,Ct]):U.push([dt,xt])}return G}function I(B,U,V){for(var W=U.length,F=new l(W),H=[],q=0;qU[2]?1:0)}function g(B,U,V){if(B.length!==0){if(U)for(var W=0;W0||q.length>0}function N(B,U,V){var W;if(V){W=U;for(var F=new Array(U.length),H=0;H{});function ly(){}function tI(){return this.rgb().formatHex()}function kK(){return this.rgb().formatHex8()}function TK(){return oI(this).formatHsl()}function eI(){return this.rgb().formatRgb()}function Hw(et){var Y,f;return et=(et+"").trim().toLowerCase(),(Y=lI.exec(et))?(f=Y[1].length,Y=parseInt(Y[1],16),f===6?rI(Y):f===3?new $p(Y>>8&15|Y>>4&240,Y>>4&15|Y&240,(Y&15)<<4|Y&15,1):f===8?uk(Y>>24&255,Y>>16&255,Y>>8&255,(Y&255)/255):f===4?uk(Y>>12&15|Y>>8&240,Y>>8&15|Y>>4&240,Y>>4&15|Y&240,((Y&15)<<4|Y&15)/255):null):(Y=cI.exec(et))?new $p(Y[1],Y[2],Y[3],1):(Y=uI.exec(et))?new $p(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,1):(Y=hI.exec(et))?uk(Y[1],Y[2],Y[3],Y[4]):(Y=dI.exec(et))?uk(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,Y[4]):(Y=fI.exec(et))?aI(Y[1],Y[2]/100,Y[3]/100,1):(Y=pI.exec(et))?aI(Y[1],Y[2]/100,Y[3]/100,Y[4]):_C.hasOwnProperty(et)?rI(_C[et]):et==="transparent"?new $p(NaN,NaN,NaN,0):null}function rI(et){return new $p(et>>16&255,et>>8&255,et&255,1)}function uk(et,Y,f,y){return y<=0&&(et=Y=f=NaN),new $p(et,Y,f,y)}function gC(et){return et instanceof ly||(et=Hw(et)),et?(et=et.rgb(),new $p(et.r,et.g,et.b,et.opacity)):new $p}function hk(et,Y,f,y){return arguments.length===1?gC(et):new $p(et,Y,f,y??1)}function $p(et,Y,f,y){this.r=+et,this.g=+Y,this.b=+f,this.opacity=+y}function nI(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}`}function SK(){return`#${R_(this.r)}${R_(this.g)}${R_(this.b)}${R_((isNaN(this.opacity)?1:this.opacity)*255)}`}function iI(){let et=dk(this.opacity);return`${et===1?"rgb(":"rgba("}${B_(this.r)}, ${B_(this.g)}, ${B_(this.b)}${et===1?")":`, ${et})`}`}function dk(et){return isNaN(et)?1:Math.max(0,Math.min(1,et))}function B_(et){return Math.max(0,Math.min(255,Math.round(et)||0))}function R_(et){return et=B_(et),(et<16?"0":"")+et.toString(16)}function aI(et,Y,f,y){return y<=0?et=Y=f=NaN:f<=0||f>=1?et=Y=NaN:Y<=0&&(et=NaN),new Ig(et,Y,f,y)}function oI(et){if(et instanceof Ig)return new Ig(et.h,et.s,et.l,et.opacity);if(et instanceof ly||(et=Hw(et)),!et)return new Ig;if(et instanceof Ig)return et;et=et.rgb();var Y=et.r/255,f=et.g/255,y=et.b/255,z=Math.min(Y,f,y),P=Math.max(Y,f,y),n=NaN,i=P-z,a=(P+z)/2;return i?(Y===P?n=(f-y)/i+(f0&&a<1?0:n,new Ig(n,i,a,et.opacity)}function vC(et,Y,f,y){return arguments.length===1?oI(et):new Ig(et,Y,f,y??1)}function Ig(et,Y,f,y){this.h=+et,this.s=+Y,this.l=+f,this.opacity=+y}function sI(et){return et=(et||0)%360,et<0?et+360:et}function fk(et){return Math.max(0,Math.min(1,et||0))}function yC(et,Y,f){return(et<60?Y+(f-Y)*et/60:et<180?f:et<240?Y+(f-Y)*(240-et)/60:Y)*255}var cy,F_,N_,Cb,Dg,lI,cI,uI,hI,dI,fI,pI,_C,xC=kr(()=>{mC(),cy=.7,F_=1/cy,N_="\\s*([+-]?\\d+)\\s*",Cb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lI=/^#([0-9a-f]{3,8})$/,cI=new RegExp(`^rgb\\(${N_},${N_},${N_}\\)$`),uI=new RegExp(`^rgb\\(${Dg},${Dg},${Dg}\\)$`),hI=new RegExp(`^rgba\\(${N_},${N_},${N_},${Cb}\\)$`),dI=new RegExp(`^rgba\\(${Dg},${Dg},${Dg},${Cb}\\)$`),fI=new RegExp(`^hsl\\(${Cb},${Dg},${Dg}\\)$`),pI=new RegExp(`^hsla\\(${Cb},${Dg},${Dg},${Cb}\\)$`),_C={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Sb(ly,Hw,{copy(et){return Object.assign(new this.constructor,this,et)},displayable(){return this.rgb().displayable()},hex:tI,formatHex:tI,formatHex8:kK,formatHsl:TK,formatRgb:eI,toString:eI}),Sb($p,hk,$w(ly,{brighter(et){return et=et==null?F_:Math.pow(F_,et),new $p(this.r*et,this.g*et,this.b*et,this.opacity)},darker(et){return et=et==null?cy:Math.pow(cy,et),new $p(this.r*et,this.g*et,this.b*et,this.opacity)},rgb(){return this},clamp(){return new $p(B_(this.r),B_(this.g),B_(this.b),dk(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:nI,formatHex:nI,formatHex8:SK,formatRgb:iI,toString:iI})),Sb(Ig,vC,$w(ly,{brighter(et){return et=et==null?F_:Math.pow(F_,et),new Ig(this.h,this.s,this.l*et,this.opacity)},darker(et){return et=et==null?cy:Math.pow(cy,et),new Ig(this.h,this.s,this.l*et,this.opacity)},rgb(){var et=this.h%360+(this.h<0)*360,Y=isNaN(et)||isNaN(this.s)?0:this.s,f=this.l,y=f+(f<.5?f:1-f)*Y,z=2*f-y;return new $p(yC(et>=240?et-240:et+120,z,y),yC(et,z,y),yC(et<120?et+240:et-120,z,y),this.opacity)},clamp(){return new Ig(sI(this.h),fk(this.s),fk(this.l),dk(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(){let et=dk(this.opacity);return`${et===1?"hsl(":"hsla("}${sI(this.h)}, ${fk(this.s)*100}%, ${fk(this.l)*100}%${et===1?")":`, ${et})`}`}}))}),bC,wC,mI=kr(()=>{bC=Math.PI/180,wC=180/Math.PI});function gI(et){if(et instanceof Qg)return new Qg(et.l,et.a,et.b,et.opacity);if(et instanceof Qv)return vI(et);et instanceof $p||(et=gC(et));var Y=AC(et.r),f=AC(et.g),y=AC(et.b),z=TC((.2225045*Y+.7168786*f+.0606169*y)/LC),P,n;return Y===f&&f===y?P=n=z:(P=TC((.4360747*Y+.3850649*f+.1430804*y)/EC),n=TC((.0139322*Y+.0971045*f+.7141733*y)/PC)),new Qg(116*z-16,500*(P-z),200*(z-n),et.opacity)}function kC(et,Y,f,y){return arguments.length===1?gI(et):new Qg(et,Y,f,y??1)}function Qg(et,Y,f,y){this.l=+et,this.a=+Y,this.b=+f,this.opacity=+y}function TC(et){return et>yI?Math.pow(et,.3333333333333333):et/DC+IC}function SC(et){return et>j_?et*et*et:DC*(et-IC)}function CC(et){return 255*(et<=.0031308?12.92*et:1.055*Math.pow(et,.4166666666666667)-.055)}function AC(et){return(et/=255)<=.04045?et/12.92:Math.pow((et+.055)/1.055,2.4)}function CK(et){if(et instanceof Qv)return new Qv(et.h,et.c,et.l,et.opacity);if(et instanceof Qg||(et=gI(et)),et.a===0&&et.b===0)return new Qv(NaN,0{mC(),xC(),mI(),Vw=18,EC=.96422,LC=1,PC=.82521,IC=4/29,j_=6/29,DC=3*j_*j_,yI=j_*j_*j_,Sb(Qg,kC,$w(ly,{brighter(et){return new Qg(this.l+Vw*(et??1),this.a,this.b,this.opacity)},darker(et){return new Qg(this.l-Vw*(et??1),this.a,this.b,this.opacity)},rgb(){var et=(this.l+16)/116,Y=isNaN(this.a)?et:et+this.a/500,f=isNaN(this.b)?et:et-this.b/200;return Y=EC*SC(Y),et=LC*SC(et),f=PC*SC(f),new $p(CC(3.1338561*Y-1.6168667*et-.4906146*f),CC(-.9787684*Y+1.9161415*et+.033454*f),CC(.0719453*Y-.2289914*et+1.4052427*f),this.opacity)}})),Sb(Qv,MC,$w(ly,{brighter(et){return new Qv(this.h,this.c,this.l+Vw*(et??1),this.opacity)},darker(et){return new Qv(this.h,this.c,this.l-Vw*(et??1),this.opacity)},rgb(){return vI(this).rgb()}}))});function MK(et){if(et instanceof U_)return new U_(et.h,et.s,et.l,et.opacity);et instanceof $p||(et=gC(et));var Y=et.r/255,f=et.g/255,y=et.b/255,z=(FC*y+BC*Y-RC*f)/(FC+BC-RC),P=y-z,n=(Ab*(f-z)-mk*P)/Ww,i=Math.sqrt(n*n+P*P)/(Ab*z*(1-z)),a=i?Math.atan2(n,P)*wC-120:NaN;return new U_(a<0?a+360:a,i,z,et.opacity)}function zC(et,Y,f,y){return arguments.length===1?MK(et):new U_(et,Y,f,y??1)}function U_(et,Y,f,y){this.h=+et,this.s=+Y,this.l=+f,this.opacity=+y}var OC,pk,mk,Ww,Ab,BC,RC,FC,EK=kr(()=>{mC(),xC(),mI(),OC=-.14861,pk=1.78277,mk=-.29227,Ww=-.90649,Ab=1.97294,BC=Ab*Ww,RC=Ab*pk,FC=pk*mk-Ww*OC,Sb(U_,zC,$w(ly,{brighter(et){return et=et==null?F_:Math.pow(F_,et),new U_(this.h,this.s,this.l*et,this.opacity)},darker(et){return et=et==null?cy:Math.pow(cy,et),new U_(this.h,this.s,this.l*et,this.opacity)},rgb(){var et=isNaN(this.h)?0:(this.h+120)*bC,Y=+this.l,f=isNaN(this.s)?0:this.s*Y*(1-Y),y=Math.cos(et),z=Math.sin(et);return new $p(255*(Y+f*(OC*y+pk*z)),255*(Y+f*(mk*y+Ww*z)),255*(Y+f*(Ab*y)),this.opacity)}}))}),Mb=kr(()=>{xC(),AK(),EK()});function _I(et,Y,f,y,z){var P=et*et,n=P*et;return((1-3*et+3*P-n)*Y+(4-6*P+3*n)*f+(1+3*et+3*P-3*n)*y+n*z)/6}function xI(et){var Y=et.length-1;return function(f){var y=f<=0?f=0:f>=1?(f=1,Y-1):Math.floor(f*Y),z=et[y],P=et[y+1],n=y>0?et[y-1]:2*z-P,i=y{});function bI(et){var Y=et.length;return function(f){var y=Math.floor(((f%=1)<0?++f:f)*Y),z=et[(y+Y-1)%Y],P=et[y%Y],n=et[(y+1)%Y],i=et[(y+2)%Y];return _I((f-y/Y)*Y,z,P,n,i)}}var wI=kr(()=>{NC()}),qw,kI=kr(()=>{qw=et=>()=>et});function TI(et,Y){return function(f){return et+f*Y}}function LK(et,Y,f){return et=Math.pow(et,f),Y=Math.pow(Y,f)-et,f=1/f,function(y){return Math.pow(et+y*Y,f)}}function gk(et,Y){var f=Y-et;return f?TI(et,f>180||f<-180?f-360*Math.round(f/360):f):qw(isNaN(et)?Y:et)}function PK(et){return(et=+et)==1?Hp:function(Y,f){return f-Y?LK(Y,f,et):qw(isNaN(Y)?f:Y)}}function Hp(et,Y){var f=Y-et;return f?TI(et,f):qw(isNaN(et)?Y:et)}var Eb=kr(()=>{kI()});function SI(et){return function(Y){var f=Y.length,y=new Array(f),z=new Array(f),P=new Array(f),n,i;for(n=0;n{Mb(),NC(),wI(),Eb(),vk=function et(Y){var f=PK(Y);function y(z,P){var n=f((z=hk(z)).r,(P=hk(P)).r),i=f(z.g,P.g),a=f(z.b,P.b),l=Hp(z.opacity,P.opacity);return function(o){return z.r=n(o),z.g=i(o),z.b=a(o),z.opacity=l(o),z+""}}return y.gamma=et,y}(1),CI=SI(xI),AI=SI(bI)});function jC(et,Y){Y||(Y=[]);var f=et?Math.min(Y.length,et.length):0,y=Y.slice(),z;return function(P){for(z=0;z{});function IK(et,Y){return(EI(Y)?jC:LI)(et,Y)}function LI(et,Y){var f=Y?Y.length:0,y=et?Math.min(f,et.length):0,z=new Array(y),P=new Array(f),n;for(n=0;n{wk(),UC()});function II(et,Y){var f=new Date;return et=+et,Y=+Y,function(y){return f.setTime(et*(1-y)+Y*y),f}}var DI=kr(()=>{});function tv(et,Y){return et=+et,Y=+Y,function(f){return et*(1-f)+Y*f}}var yk=kr(()=>{});function zI(et,Y){var f={},y={},z;(et===null||typeof et!="object")&&(et={}),(Y===null||typeof Y!="object")&&(Y={});for(z in Y)z in et?f[z]=bk(et[z],Y[z]):y[z]=Y[z];return function(P){for(z in f)y[z]=f[z](P);return y}}var OI=kr(()=>{wk()});function DK(et){return function(){return et}}function zK(et){return function(Y){return et(Y)+""}}function BI(et,Y){var f=_k.lastIndex=xk.lastIndex=0,y,z,P,n=-1,i=[],a=[];for(et=et+"",Y=Y+"";(y=_k.exec(et))&&(z=xk.exec(Y));)(P=z.index)>f&&(P=Y.slice(f,P),i[n]?i[n]+=P:i[++n]=P),(y=y[0])===(z=z[0])?i[n]?i[n]+=z:i[++n]=z:(i[++n]=null,a.push({i:n,x:tv(y,z)})),f=xk.lastIndex;return f{yk(),_k=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xk=new RegExp(_k.source,"g")});function bk(et,Y){var f=typeof Y,y;return Y==null||f==="boolean"?qw(Y):(f==="number"?tv:f==="string"?(y=Hw(Y))?(Y=y,vk):BI:Y instanceof Hw?vk:Y instanceof Date?II:EI(Y)?jC:Array.isArray(Y)?LI:typeof Y.valueOf!="function"&&typeof Y.toString!="function"||isNaN(Y)?zI:tv)(et,Y)}var wk=kr(()=>{Mb(),MI(),PI(),DI(),yk(),OI(),RI(),kI(),UC()});function OK(et){var Y=et.length;return function(f){return et[Math.max(0,Math.min(Y-1,Math.floor(f*Y)))]}}var BK=kr(()=>{});function RK(et,Y){var f=gk(+et,+Y);return function(y){var z=f(y);return z-360*Math.floor(z/360)}}var FK=kr(()=>{Eb()});function NK(et,Y){return et=+et,Y=+Y,function(f){return Math.round(et*(1-f)+Y*f)}}var jK=kr(()=>{});function FI(et,Y,f,y,z,P){var n,i,a;return(n=Math.sqrt(et*et+Y*Y))&&(et/=n,Y/=n),(a=et*f+Y*y)&&(f-=et*a,y-=Y*a),(i=Math.sqrt(f*f+y*y))&&(f/=i,y/=i,a/=i),et*y{$C=180/Math.PI,kk={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function $K(et){let Y=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(et+"");return Y.isIdentity?kk:FI(Y.a,Y.b,Y.c,Y.d,Y.e,Y.f)}function HK(et){return et==null?kk:(Tk||(Tk=document.createElementNS("http://www.w3.org/2000/svg","g")),Tk.setAttribute("transform",et),(et=Tk.transform.baseVal.consolidate())?(et=et.matrix,FI(et.a,et.b,et.c,et.d,et.e,et.f)):kk)}var Tk,VK=kr(()=>{UK()});function NI(et,Y,f,y){function z(l){return l.length?l.pop()+" ":""}function P(l,o,c,s,h,m){if(l!==c||o!==s){var b=h.push("translate(",null,Y,null,f);m.push({i:b-4,x:tv(l,c)},{i:b-2,x:tv(o,s)})}else(c||s)&&h.push("translate("+c+Y+s+f)}function n(l,o,c,s){l!==o?(l-o>180?o+=360:o-l>180&&(l+=360),s.push({i:c.push(z(c)+"rotate(",null,y)-2,x:tv(l,o)})):o&&c.push(z(c)+"rotate("+o+y)}function i(l,o,c,s){l!==o?s.push({i:c.push(z(c)+"skewX(",null,y)-2,x:tv(l,o)}):o&&c.push(z(c)+"skewX("+o+y)}function a(l,o,c,s,h,m){if(l!==c||o!==s){var b=h.push(z(h)+"scale(",null,",",null,")");m.push({i:b-4,x:tv(l,c)},{i:b-2,x:tv(o,s)})}else(c!==1||s!==1)&&h.push(z(h)+"scale("+c+","+s+")")}return function(l,o){var c=[],s=[];return l=et(l),o=et(o),P(l.translateX,l.translateY,o.translateX,o.translateY,c,s),n(l.rotate,o.rotate,c,s),i(l.skewX,o.skewX,c,s),a(l.scaleX,l.scaleY,o.scaleX,o.scaleY,c,s),l=o=null,function(h){for(var m=-1,b=s.length,x;++m{yk(),VK(),jI=NI($K,"px, ","px)","deg)"),UI=NI(HK,", ",")",")")});function $I(et){return((et=Math.exp(et))+1/et)/2}function qK(et){return((et=Math.exp(et))-1/et)/2}function GK(et){return((et=Math.exp(2*et))-1)/(et+1)}var HI,VI,ZK=kr(()=>{HI=1e-12,VI=function et(Y,f,y){function z(P,n){var i=P[0],a=P[1],l=P[2],o=n[0],c=n[1],s=n[2],h=o-i,m=c-a,b=h*h+m*m,x,_;if(b{Mb(),Eb(),qI=WI(gk),GI=WI(Hp)});function YK(et,Y){var f=Hp((et=kC(et)).l,(Y=kC(Y)).l),y=Hp(et.a,Y.a),z=Hp(et.b,Y.b),P=Hp(et.opacity,Y.opacity);return function(n){return et.l=f(n),et.a=y(n),et.b=z(n),et.opacity=P(n),et+""}}var XK=kr(()=>{Mb(),Eb()});function ZI(et){return function(Y,f){var y=et((Y=MC(Y)).h,(f=MC(f)).h),z=Hp(Y.c,f.c),P=Hp(Y.l,f.l),n=Hp(Y.opacity,f.opacity);return function(i){return Y.h=y(i),Y.c=z(i),Y.l=P(i),Y.opacity=n(i),Y+""}}}var KI,YI,JK=kr(()=>{Mb(),Eb(),KI=ZI(gk),YI=ZI(Hp)});function XI(et){return function Y(f){f=+f;function y(z,P){var n=et((z=zC(z)).h,(P=zC(P)).h),i=Hp(z.s,P.s),a=Hp(z.l,P.l),l=Hp(z.opacity,P.opacity);return function(o){return z.h=n(o),z.s=i(o),z.l=a(Math.pow(o,f)),z.opacity=l(o),z+""}}return y.gamma=Y,y}(1)}var JI,QI,QK=kr(()=>{Mb(),Eb(),JI=XI(gk),QI=XI(Hp)});function tY(et,Y){Y===void 0&&(Y=et,et=bk);for(var f=0,y=Y.length-1,z=Y[0],P=new Array(y<0?0:y);f{wk()});function rY(et,Y){for(var f=new Array(Y),y=0;y{}),$_={};rn($_,{interpolate:()=>bk,interpolateArray:()=>IK,interpolateBasis:()=>xI,interpolateBasisClosed:()=>bI,interpolateCubehelix:()=>JI,interpolateCubehelixLong:()=>QI,interpolateDate:()=>II,interpolateDiscrete:()=>OK,interpolateHcl:()=>KI,interpolateHclLong:()=>YI,interpolateHsl:()=>qI,interpolateHslLong:()=>GI,interpolateHue:()=>RK,interpolateLab:()=>YK,interpolateNumber:()=>tv,interpolateNumberArray:()=>jC,interpolateObject:()=>zI,interpolateRgb:()=>vk,interpolateRgbBasis:()=>CI,interpolateRgbBasisClosed:()=>AI,interpolateRound:()=>NK,interpolateString:()=>BI,interpolateTransformCss:()=>jI,interpolateTransformSvg:()=>UI,interpolateZoom:()=>VI,piecewise:()=>tY,quantize:()=>rY});var Lb=kr(()=>{wk(),PI(),NC(),wI(),DI(),BK(),FK(),yk(),UC(),OI(),jK(),RI(),WK(),ZK(),MI(),KK(),XK(),JK(),QK(),eY(),nY()}),HC=It((et,Y)=>{var f=Js(),y=Hn();Y.exports=function(z,P,n,i,a){var l=P.data.data,o=l.i,c=a||l.color;if(o>=0){P.i=l.i;var s=n.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=c,P.color=c):(s.color=c,P.color=c),f.pointStyle(z,n,i,P)}else y.fill(z,c)}}),tD=It((et,Y)=>{var f=Br(),y=Hn(),z=jn(),P=C0().resizeText,n=HC();function i(l){var o=l._fullLayout._sunburstlayer.selectAll(".trace");P(l,o,"sunburst"),o.each(function(c){var s=f.select(this),h=c[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){f.select(this).call(a,b,m,l)})})}function a(l,o,c,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(c,b,"marker.line.color")||y.defaultLine,_=z.castOption(c,b,"marker.line.width")||0;l.call(n,o,c,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?c.leaf.opacity:null)}Y.exports={style:i,styleOne:a}}),uy=It(et=>{var Y=jn(),f=Hn(),y=Mm(),z=Vv();et.findEntryWithLevel=function(a,l){var o;return l&&a.eachAfter(function(c){if(et.getPtId(c)===l)return o=c.copy()}),o||a},et.findEntryWithChild=function(a,l){var o;return a.eachAfter(function(c){for(var s=c.children||[],h=0;h0)},et.getMaxDepth=function(a){return a.maxdepth>=0?a.maxdepth:1/0},et.isHeader=function(a,l){return!(et.isLeaf(a)||a.depth===l._maxDepth-1)};function i(a){return a.data.data.pid}et.getParent=function(a,l){return et.findEntryWithLevel(a,i(l))},et.listPath=function(a,l){var o=a.parent;if(!o)return[];var c=l?[o.data[l]]:[o];return et.listPath(o,l).concat(c)},et.getPath=function(a){return et.listPath(a,"label").join("/")+"/"},et.formatValue=z.formatPieValue,et.formatPercent=function(a,l){var o=Y.formatPercent(a,0);return o==="0%"&&(o=z.formatPiePercent(a,l)),o}}),Sk=It((et,Y)=>{var f=Br(),y=ls(),z=T0().appendArrayPointValue,P=hd(),n=jn(),i=qg(),a=uy(),l=Vv(),o=l.formatPieValue;Y.exports=function(s,h,m,b,x){var _=b[0],A=_.trace,d=_.hierarchy,k=A.type==="sunburst",w=A.type==="treemap"||A.type==="icicle";"_hasHoverLabel"in A||(A._hasHoverLabel=!1),"_hasHoverEvent"in A||(A._hasHoverEvent=!1);var D=function(M){var p=m._fullLayout;if(!(m._dragging||p.hovermode===!1)){var g=m._fullData[A.index],C=M.data.data,S=C.i,N=a.isHierarchyRoot(M),B=a.getParent(d,M),U=a.getValue(M),V=function(J){return n.castOption(g,S,J)},W=V("hovertemplate"),F=P.castHoverinfo(g,p,S),H=p.separators,q;if(W||F&&F!=="none"&&F!=="skip"){var G,tt;k&&(G=_.cx+M.pxmid[0]*(1-M.rInscribed),tt=_.cy+M.pxmid[1]*(1-M.rInscribed)),w&&(G=M._hoverX,tt=M._hoverY);var ht={},bt=[],vt=[],ut=function(J){return bt.indexOf(J)!==-1};F&&(bt=F==="all"?g._module.attributes.hoverinfo.flags:F.split("+")),ht.label=C.label,ut("label")&&ht.label&&vt.push(ht.label),C.hasOwnProperty("v")&&(ht.value=C.v,ht.valueLabel=o(ht.value,H),ut("value")&&vt.push(ht.valueLabel)),ht.currentPath=M.currentPath=a.getPath(M.data),ut("current path")&&!N&&vt.push(ht.currentPath);var rt,gt=[],it=function(){gt.indexOf(rt)===-1&&(vt.push(rt),gt.push(rt))};ht.percentParent=M.percentParent=U/a.getValue(B),ht.parent=M.parentString=a.getPtLabel(B),ut("percent parent")&&(rt=a.formatPercent(ht.percentParent,H)+" of "+ht.parent,it()),ht.percentEntry=M.percentEntry=U/a.getValue(h),ht.entry=M.entry=a.getPtLabel(h),ut("percent entry")&&!N&&!M.onPathbar&&(rt=a.formatPercent(ht.percentEntry,H)+" of "+ht.entry,it()),ht.percentRoot=M.percentRoot=U/a.getValue(d),ht.root=M.root=a.getPtLabel(d),ut("percent root")&&!N&&(rt=a.formatPercent(ht.percentRoot,H)+" of "+ht.root,it()),ht.text=V("hovertext")||V("text"),ut("text")&&(rt=ht.text,n.isValidTextValue(rt)&&vt.push(rt)),q=[c(M,g,x.eventDataKeys)];var st={trace:g,y:tt,_x0:M._x0,_x1:M._x1,_y0:M._y0,_y1:M._y1,text:vt.join("
"),name:W||ut("name")?g.name:void 0,color:V("hoverlabel.bgcolor")||C.color,borderColor:V("hoverlabel.bordercolor"),fontFamily:V("hoverlabel.font.family"),fontSize:V("hoverlabel.font.size"),fontColor:V("hoverlabel.font.color"),fontWeight:V("hoverlabel.font.weight"),fontStyle:V("hoverlabel.font.style"),fontVariant:V("hoverlabel.font.variant"),nameLength:V("hoverlabel.namelength"),textAlign:V("hoverlabel.align"),hovertemplate:W,hovertemplateLabels:ht,eventData:q};k&&(st.x0=G-M.rInscribed*M.rpx1,st.x1=G+M.rInscribed*M.rpx1,st.idealAlign=M.pxmid[0]<0?"left":"right"),w&&(st.x=G,st.idealAlign=G<0?"left":"right");var xt=[];P.loneHover(st,{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:m,inOut_bbox:xt}),q[0].bbox=xt[0],A._hasHoverLabel=!0}if(w){var ot=s.select("path.surface");x.styleOne(ot,M,g,m,{hovered:!0})}A._hasHoverEvent=!0,m.emit("plotly_hover",{points:q||[c(M,g,x.eventDataKeys)],event:f.event})}},E=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=f.select(this).datum();if(A._hasHoverEvent&&(M.originalEvent=f.event,m.emit("plotly_unhover",{points:[c(C,g,x.eventDataKeys)],event:f.event}),A._hasHoverEvent=!1),A._hasHoverLabel&&(P.loneUnhover(p._hoverlayer.node()),A._hasHoverLabel=!1),w){var S=s.select("path.surface");x.styleOne(S,C,g,m,{hovered:!1})}},I=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=k&&(a.isHierarchyRoot(M)||a.isLeaf(M)),S=a.getPtId(M),N=a.isEntry(M)?a.findEntryWithChild(d,S):a.findEntryWithLevel(d,S),B=a.getPtId(N),U={points:[c(M,g,x.eventDataKeys)],event:f.event};C||(U.nextLevel=B);var V=i.triggerHandler(m,"plotly_"+A.type+"click",U);if(V!==!1&&p.hovermode&&(m._hoverdata=[c(M,g,x.eventDataKeys)],P.click(m,f.event)),!C&&V!==!1&&!m._dragging&&!m._transitioning){y.call("_storeDirectGUIEdit",g,p._tracePreGUI[g.uid],{level:g.level});var W={data:[{level:B}],traces:[A.index]},F={frame:{redraw:!1,duration:x.transitionTime},transition:{duration:x.transitionTime,easing:x.transitionEasing},mode:"immediate",fromcurrent:!0};P.loneUnhover(p._hoverlayer.node()),y.call("animate",m,W,F)}};s.on("mouseover",D),s.on("mouseout",E),s.on("click",I)};function c(s,h,m){for(var b=s.data.data,x={curveNumber:h.index,pointNumber:b.i,data:h._input,fullData:h},_=0;_{var Y=Br(),f=lk(),y=(Lb(),tn($_)).interpolate,z=Js(),P=jn(),n=uu(),i=C0(),a=i.recordMinTextSize,l=i.clearMinTextSize,o=pC(),c=Vv().getRotationAngle,s=o.computeTransform,h=o.transformInsideText,m=tD().styleOne,b=Pg().resizeText,x=Sk(),_=JP(),A=uy();et.plot=function(I,M,p,g){var C=I._fullLayout,S=C._sunburstlayer,N,B,U=!p,V=!C.uniformtext.mode&&A.hasTransition(p);if(l("sunburst",C),N=S.selectAll("g.trace.sunburst").data(M,function(F){return F[0].trace.uid}),N.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),N.order(),V){g&&(B=g());var W=Y.transition().duration(p.duration).ease(p.easing).each("end",function(){B&&B()}).each("interrupt",function(){B&&B()});W.each(function(){S.selectAll("g.trace").each(function(F){d(I,F,this,p)})})}else N.each(function(F){d(I,F,this,p)}),C.uniformtext.mode&&b(I,C._sunburstlayer.selectAll(".trace"),"sunburst");U&&N.exit().remove()};function d(I,M,p,g){var C=I._context.staticPlot,S=I._fullLayout,N=!S.uniformtext.mode&&A.hasTransition(g),B=Y.select(p),U=B.selectAll("g.slice"),V=M[0],W=V.trace,F=V.hierarchy,H=A.findEntryWithLevel(F,W.level),q=A.getMaxDepth(W),G=S._size,tt=W.domain,ht=G.w*(tt.x[1]-tt.x[0]),bt=G.h*(tt.y[1]-tt.y[0]),vt=.5*Math.min(ht,bt),ut=V.cx=G.l+G.w*(tt.x[1]+tt.x[0])/2,rt=V.cy=G.t+G.h*(1-tt.y[0])-bt/2;if(!H)return U.remove();var gt=null,it={};N&&U.each(function(Lt){it[A.getPtId(Lt)]={rpx0:Lt.rpx0,rpx1:Lt.rpx1,x0:Lt.x0,x1:Lt.x1,transform:Lt.transform},!gt&&A.isEntry(Lt)&&(gt=Lt)});var st=k(H).descendants(),xt=H.height+1,ot=0,J=q;V.hasMultipleRoots&&A.isHierarchyRoot(H)&&(st=st.slice(1),xt-=1,ot=1,J+=1),st=st.filter(function(Lt){return Lt.y1<=J});var mt=c(W.rotation);mt&&st.forEach(function(Lt){Lt.x0+=mt,Lt.x1+=mt});var dt=Math.min(xt,q),Ct=function(Lt){return(Lt-ot)/dt*vt},Rt=function(Lt,ie){return[Lt*Math.cos(ie),-Lt*Math.sin(ie)]},Bt=function(Lt){return P.pathAnnulus(Lt.rpx0,Lt.rpx1,Lt.x0,Lt.x1,ut,rt)},Zt=function(Lt){return ut+D(Lt)[0]*(Lt.transform.rCenter||0)+(Lt.transform.x||0)},Gt=function(Lt){return rt+D(Lt)[1]*(Lt.transform.rCenter||0)+(Lt.transform.y||0)};U=U.data(st,A.getPtId),U.enter().append("g").classed("slice",!0),N?U.exit().transition().each(function(){var Lt=Y.select(this),ie=Lt.select("path.surface");ie.transition().attrTween("d",function(ce){var Le=ye(ce);return function(Ze){return Bt(Le(Ze))}});var be=Lt.select("g.slicetext");be.attr("opacity",0)}).remove():U.exit().remove(),U.order();var ee=null;if(N&>){var xe=A.getPtId(gt);U.each(function(Lt){ee===null&&A.getPtId(Lt)===xe&&(ee=Lt.x1)})}var ge=U;N&&(ge=ge.transition().each("end",function(){var Lt=Y.select(this);A.setSliceCursor(Lt,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),ge.each(function(Lt){var ie=Y.select(this),be=P.ensureSingle(ie,"path","surface",function(fr){fr.style("pointer-events",C?"none":"all")});Lt.rpx0=Ct(Lt.y0),Lt.rpx1=Ct(Lt.y1),Lt.xmid=(Lt.x0+Lt.x1)/2,Lt.pxmid=Rt(Lt.rpx1,Lt.xmid),Lt.midangle=-(Lt.xmid-Math.PI/2),Lt.startangle=-(Lt.x0-Math.PI/2),Lt.stopangle=-(Lt.x1-Math.PI/2),Lt.halfangle=.5*Math.min(P.angleDelta(Lt.x0,Lt.x1)||Math.PI,Math.PI),Lt.ring=1-Lt.rpx0/Lt.rpx1,Lt.rInscribed=w(Lt),N?be.transition().attrTween("d",function(fr){var Jr=ue(fr);return function(an){return Bt(Jr(an))}}):be.attr("d",Bt),ie.call(x,H,I,M,{eventDataKeys:_.eventDataKeys,transitionTime:_.CLICK_TRANSITION_TIME,transitionEasing:_.CLICK_TRANSITION_EASING}).call(A.setSliceCursor,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:I._transitioning}),be.call(m,Lt,W,I);var ce=P.ensureSingle(ie,"g","slicetext"),Le=P.ensureSingle(ce,"text","",function(fr){fr.attr("data-notex",1)}),Ze=P.ensureUniformFontSize(I,A.determineTextFont(W,Lt,S.font));Le.text(et.formatSliceLabel(Lt,H,W,M,S)).classed("slicetext",!0).attr("text-anchor","middle").call(z.font,Ze).call(n.convertToTspans,I);var Qe=z.bBox(Le.node());Lt.transform=h(Qe,Lt,V),Lt.transform.targetX=Zt(Lt),Lt.transform.targetY=Gt(Lt);var mr=function(fr,Jr){var an=fr.transform;return s(an,Jr),an.fontSize=Ze.size,a(W.type,an,S),P.getTextTransform(an)};N?Le.transition().attrTween("transform",function(fr){var Jr=Mt(fr);return function(an){return mr(Jr(an),Qe)}}):Le.attr("transform",mr(Lt,Qe))});function ye(Lt){var ie=A.getPtId(Lt),be=it[ie],ce=it[A.getPtId(H)],Le;if(ce){var Ze=(Lt.x1>ce.x1?2*Math.PI:0)+mt;Le=Lt.rpx1ee?2*Math.PI:0)+mt;be={x0:Le,x1:Le}}else be={rpx0:vt,rpx1:vt},P.extendFlat(be,Ot(Lt));else be={rpx0:0,rpx1:0};else be={x0:mt,x1:mt};return y(be,ce)}function Mt(Lt){var ie=it[A.getPtId(Lt)],be,ce=Lt.transform;if(ie)be=ie;else if(be={rpx1:Lt.rpx1,transform:{textPosAngle:ce.textPosAngle,scale:0,rotate:ce.rotate,rCenter:ce.rCenter,x:ce.x,y:ce.y}},gt)if(Lt.parent)if(ee){var Le=Lt.x1>ee?2*Math.PI:0;be.x0=be.x1=Le}else P.extendFlat(be,Ot(Lt));else be.x0=be.x1=mt;else be.x0=be.x1=mt;var Ze=y(be.transform.textPosAngle,Lt.transform.textPosAngle),Qe=y(be.rpx1,Lt.rpx1),mr=y(be.x0,Lt.x0),fr=y(be.x1,Lt.x1),Jr=y(be.transform.scale,ce.scale),an=y(be.transform.rotate,ce.rotate),Er=ce.rCenter===0?3:be.transform.rCenter===0?1/3:1,dn=y(be.transform.rCenter,ce.rCenter),_n=function(Oe){return dn(Math.pow(Oe,Er))};return function(Oe){var Xt=Qe(Oe);mr(Oe),fr(Oe);var oe=_n(Oe),zt=Ze(Oe),_t={rpx1:Xt,transform:{textPosAngle:zt,rCenter:oe,x:ce.x,y:ce.y}};return a(W.type,ce,S),{transform:{targetX:Zt(_t),targetY:Gt(_t),scale:Jr(Oe),rotate:an(Oe),rCenter:oe}}}}function Ot(Lt){var ie=Lt.parent,be=it[A.getPtId(ie)],ce={};if(be){var Le=ie.children,Ze=Le.indexOf(Lt),Qe=Le.length,mr=y(be.x0,be.x1);ce.x0=mr(Ze/Qe),ce.x1=mr(Ze/Qe)}else ce.x0=ce.x1=0;return ce}}function k(I){return f.partition().size([2*Math.PI,I.height+1])(I)}et.formatSliceLabel=function(I,M,p,g,C){var S=p.texttemplate,N=p.textinfo;if(!S&&(!N||N==="none"))return"";var B=C.separators,U=g[0],V=I.data.data,W=U.hierarchy,F=A.isHierarchyRoot(I),H=A.getParent(W,I),q=A.getValue(I);if(!S){var G=N.split("+"),tt=function(ot){return G.indexOf(ot)!==-1},ht=[],bt;if(tt("label")&&V.label&&ht.push(V.label),V.hasOwnProperty("v")&&tt("value")&&ht.push(A.formatValue(V.v,B)),!F){tt("current path")&&ht.push(A.getPath(I.data));var vt=0;tt("percent parent")&&vt++,tt("percent entry")&&vt++,tt("percent root")&&vt++;var ut=vt>1;if(vt){var rt,gt=function(ot){bt=A.formatPercent(rt,B),ut&&(bt+=" of "+ot),ht.push(bt)};tt("percent parent")&&!F&&(rt=q/A.getValue(H),gt("parent")),tt("percent entry")&&(rt=q/A.getValue(M),gt("entry")),tt("percent root")&&(rt=q/A.getValue(W),gt("root"))}}return tt("text")&&(bt=P.castOption(p,V.i,"text"),P.isValidTextValue(bt)&&ht.push(bt)),ht.join("
")}var it=P.castOption(p,V.i,"texttemplate");if(!it)return"";var st={};V.label&&(st.label=V.label),V.hasOwnProperty("v")&&(st.value=V.v,st.valueLabel=A.formatValue(V.v,B)),st.currentPath=A.getPath(I.data),F||(st.percentParent=q/A.getValue(H),st.percentParentLabel=A.formatPercent(st.percentParent,B),st.parent=A.getPtLabel(H)),st.percentEntry=q/A.getValue(M),st.percentEntryLabel=A.formatPercent(st.percentEntry,B),st.entry=A.getPtLabel(M),st.percentRoot=q/A.getValue(W),st.percentRootLabel=A.formatPercent(st.percentRoot,B),st.root=A.getPtLabel(W),V.hasOwnProperty("color")&&(st.color=V.color);var xt=P.castOption(p,V.i,"text");return(P.isValidTextValue(xt)||xt==="")&&(st.text=xt),st.customdata=P.castOption(p,V.i,"customdata"),P.texttemplateString({data:[st,p._meta],fallback:p.texttemplatefallback,labels:st,locale:C._d3locale,template:it})};function w(I){return I.rpx0===0&&P.isFullCircle([I.x0,I.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(I.halfangle)),I.ring/2))}function D(I){return E(I.rpx1,I.transform.textPosAngle)}function E(I,M){return[I*Math.sin(M),-I*Math.cos(M)]}}),iY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"sunburst",basePlotModule:xK(),categories:[],animatable:!0,attributes:sk(),layoutAttributes:QP(),supplyDefaults:bK(),supplyLayoutDefaults:wK(),calc:ck().calc,crossTraceCalc:ck().crossTraceCalc,plot:VC().plot,style:tD().style,colorbar:Do(),meta:{}}}),aY=It((et,Y)=>{Y.exports=iY()}),oY=It(et=>{var Y=lh();et.name="treemap",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),Pb=It((et,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),WC=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Ru(),n=Jh().attributes,i=kb(),a=sk(),l=Pb(),o=Yn().extendFlat,c=qf().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:a.marker.colors,pattern:c,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:a.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},i.textfont,{}),editType:"calc"},text:i.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,hoverinfo:a.hoverinfo,hovertemplate:f({},{keys:l.eventDataKeys}),hovertemplatefallback:z(),textfont:i.textfont,insidetextfont:i.insidetextfont,outsidetextfont:o({},i.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:i.sort,root:a.root,domain:n({name:"treemap",trace:!0,editType:"calc"})}}),eD=It((et,Y)=>{Y.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),sY=It((et,Y)=>{var f=jn(),y=WC(),z=Hn(),P=Jh().defaults,n=eg().handleText,i=vb().TEXTPAD,a=Tb().handleMarkerDefaults,l=ch(),o=l.hasColorscale,c=l.handleDefaults;Y.exports=function(s,h,m,b){function x(g,C){return f.coerce(s,h,y,g,C)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var d=x("values");d&&d.length?x("branchvalues"):x("count"),x("level"),x("maxdepth");var k=x("tiling.packing");k==="squarify"&&x("tiling.squarifyratio"),x("tiling.flip"),x("tiling.pad");var w=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",f.isArrayOrTypedArray(w)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var D=x("pathbar.visible"),E="auto";n(s,h,b,x,E,{hasPathbar:D,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition");var I=h.textposition.indexOf("bottom")!==-1;a(s,h,b,x);var M=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;M?c(s,h,b,x,{prefix:"marker.",cLetter:"c"}):x("marker.depthfade",!(h.marker.colors||[]).length);var p=h.textfont.size*2;x("marker.pad.t",I?p/4:p),x("marker.pad.l",p/4),x("marker.pad.r",p/4),x("marker.pad.b",I?p:p/4),x("marker.cornerradius"),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},D&&(x("pathbar.thickness",h.pathbar.textfont.size+2*i),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),lY=It((et,Y)=>{var f=jn(),y=eD();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("treemapcolorway",P.colorway),n("extendtreemapcolors")}}),rD=It(et=>{var Y=ck();et.calc=function(f,y){return Y.calc(f,y)},et.crossTraceCalc=function(f){return Y._runCrossTraceCalc("treemap",f)}}),nD=It((et,Y)=>{Y.exports=function f(y,z,P){var n;P.swapXY&&(n=y.x0,y.x0=y.y0,y.y0=n,n=y.x1,y.x1=y.y1,y.y1=n),P.flipX&&(n=y.x0,y.x0=z[0]-y.x1,y.x1=z[0]-n),P.flipY&&(n=y.y0,y.y0=z[1]-y.y1,y.y1=z[1]-n);var i=y.children;if(i)for(var a=0;a{var f=lk(),y=nD();Y.exports=function(P,n,i){var a=i.flipX,l=i.flipY,o=i.packing==="dice-slice",c=i.pad[l?"bottom":"top"],s=i.pad[a?"right":"left"],h=i.pad[a?"left":"right"],m=i.pad[l?"top":"bottom"],b;o&&(b=s,s=c,c=b,b=h,h=m,m=b);var x=f.treemap().tile(z(i.packing,i.squarifyratio)).paddingInner(i.pad.inner).paddingLeft(s).paddingRight(h).paddingTop(c).paddingBottom(m).size(o?[n[1],n[0]]:n)(P);return(o||a||l)&&y(x,n,{swapXY:o,flipX:a,flipY:l}),x};function z(P,n){switch(P){case"squarify":return f.treemapSquarify.ratio(n);case"binary":return f.treemapBinary;case"dice":return f.treemapDice;case"slice":return f.treemapSlice;default:return f.treemapSliceDice}}}),qC=It((et,Y)=>{var f=Br(),y=Hn(),z=jn(),P=uy(),n=C0().resizeText,i=HC();function a(o){var c=o._fullLayout._treemaplayer.selectAll(".trace");n(o,c,"treemap"),c.each(function(s){var h=f.select(this),m=s[0],b=m.trace;h.style("opacity",b.opacity),h.selectAll("path.surface").each(function(x){f.select(this).call(l,x,b,o,{hovered:!1})})})}function l(o,c,s,h,m){var b=(m||{}).hovered,x=c.data.data,_=x.i,A,d,k=x.color,w=P.isHierarchyRoot(c),D=1;if(b)A=s._hovered.marker.line.color,d=s._hovered.marker.line.width;else if(w&&k===s.root.color)D=100,A="rgba(0,0,0,0)",d=0;else if(A=z.castOption(s,_,"marker.line.color")||y.defaultLine,d=z.castOption(s,_,"marker.line.width")||0,!s._hasColorscale&&!c.onPathbar){var E=s.marker.depthfade;if(E){var I=y.combine(y.addOpacity(s._backgroundColor,.75),k),M;if(E===!0){var p=P.getMaxDepth(s);isFinite(p)?P.isLeaf(c)?M=0:M=s._maxVisibleLayers-(c.data.depth-s._entryDepth):M=c.data.height+1}else M=c.data.depth-s._entryDepth,s._atRootLevel||M++;if(M>0)for(var g=0;g{var f=Br(),y=jn(),z=Js(),P=uu(),n=iD(),i=qC().styleOne,a=Pb(),l=uy(),o=Sk(),c=!0;Y.exports=function(s,h,m,b,x){var _=x.barDifY,A=x.width,d=x.height,k=x.viewX,w=x.viewY,D=x.pathSlice,E=x.toMoveInsideSlice,I=x.strTransform,M=x.hasTransition,p=x.handleSlicesExit,g=x.makeUpdateSliceInterpolator,C=x.makeUpdateTextInterpolator,S={},N=s._context.staticPlot,B=s._fullLayout,U=h[0],V=U.trace,W=U.hierarchy,F=A/V._entryDepth,H=l.listPath(m.data,"id"),q=n(W.copy(),[A,d],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();q=q.filter(function(tt){var ht=H.indexOf(tt.data.id);return ht===-1?!1:(tt.x0=F*ht,tt.x1=F*(ht+1),tt.y0=_,tt.y1=_+d,tt.onPathbar=!0,!0)}),q.reverse(),b=b.data(q,l.getPtId),b.enter().append("g").classed("pathbar",!0),p(b,c,S,[A,d],D),b.order();var G=b;M&&(G=G.transition().each("end",function(){var tt=f.select(this);l.setSliceCursor(tt,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),G.each(function(tt){tt._x0=k(tt.x0),tt._x1=k(tt.x1),tt._y0=w(tt.y0),tt._y1=w(tt.y1),tt._hoverX=k(tt.x1-Math.min(A,d)/2),tt._hoverY=w(tt.y1-d/2);var ht=f.select(this),bt=y.ensureSingle(ht,"path","surface",function(gt){gt.style("pointer-events",N?"none":"all")});M?bt.transition().attrTween("d",function(gt){var it=g(gt,c,S,[A,d]);return function(st){return D(it(st))}}):bt.attr("d",D),ht.call(o,m,s,h,{styleOne:i,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:s._transitioning}),bt.call(i,tt,V,s,{hovered:!1}),tt._text=(l.getPtLabel(tt)||"").split("
").join(" ")||"";var vt=y.ensureSingle(ht,"g","slicetext"),ut=y.ensureSingle(vt,"text","",function(gt){gt.attr("data-notex",1)}),rt=y.ensureUniformFontSize(s,l.determineTextFont(V,tt,B.font,{onPathbar:!0}));ut.text(tt._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(z.font,rt).call(P.convertToTspans,s),tt.textBB=z.bBox(ut.node()),tt.transform=E(tt,{fontSize:rt.size,onPathbar:!0}),tt.transform.fontSize=rt.size,M?ut.transition().attrTween("transform",function(gt){var it=C(gt,c,S,[A,d]);return function(st){return I(it(st))}}):ut.attr("transform",I(tt))})}}),uY=It((et,Y)=>{var f=Br(),y=(Lb(),tn($_)).interpolate,z=uy(),P=jn(),n=vb().TEXTPAD,i=yb(),a=i.toMoveInsideBar,l=C0(),o=l.recordMinTextSize,c=Pb(),s=cY();function h(m){return z.isHierarchyRoot(m)?"":z.getPtId(m)}Y.exports=function(m,b,x,_,A){var d=m._fullLayout,k=b[0],w=k.trace,D=w.type,E=D==="icicle",I=k.hierarchy,M=z.findEntryWithLevel(I,w.level),p=f.select(x),g=p.selectAll("g.pathbar"),C=p.selectAll("g.slice");if(!M){g.remove(),C.remove();return}var S=z.isHierarchyRoot(M),N=!d.uniformtext.mode&&z.hasTransition(_),B=z.getMaxDepth(w),U=function(Er){return Er.data.depth-M.data.depth-1?H+tt:-(G+tt):0,bt={x0:q,x1:q,y0:ht,y1:ht+G},vt=function(Er,dn,_n){var Oe=w.tiling.pad,Xt=function(Pt){return Pt-Oe<=dn.x0},oe=function(Pt){return Pt+Oe>=dn.x1},zt=function(Pt){return Pt-Oe<=dn.y0},_t=function(Pt){return Pt+Oe>=dn.y1};return Er.x0===dn.x0&&Er.x1===dn.x1&&Er.y0===dn.y0&&Er.y1===dn.y1?{x0:Er.x0,x1:Er.x1,y0:Er.y0,y1:Er.y1}:{x0:Xt(Er.x0-Oe)?0:oe(Er.x0-Oe)?_n[0]:Er.x0,x1:Xt(Er.x1+Oe)?0:oe(Er.x1+Oe)?_n[0]:Er.x1,y0:zt(Er.y0-Oe)?0:_t(Er.y0-Oe)?_n[1]:Er.y0,y1:zt(Er.y1+Oe)?0:_t(Er.y1+Oe)?_n[1]:Er.y1}},ut=null,rt={},gt={},it=null,st=function(Er,dn){return dn?rt[h(Er)]:gt[h(Er)]},xt=function(Er,dn,_n,Oe){if(dn)return rt[h(I)]||bt;var Xt=gt[w.level]||_n;return U(Er)?vt(Er,Xt,Oe):{}};k.hasMultipleRoots&&S&&B++,w._maxDepth=B,w._backgroundColor=d.paper_bgcolor,w._entryDepth=M.data.depth,w._atRootLevel=S;var ot=-F/2+V.l+V.w*(W.x[1]+W.x[0])/2,J=-H/2+V.t+V.h*(1-(W.y[1]+W.y[0])/2),mt=function(Er){return ot+Er},dt=function(Er){return J+Er},Ct=dt(0),Rt=mt(0),Bt=function(Er){return Rt+Er},Zt=function(Er){return Ct+Er};function Gt(Er,dn){return Er+","+dn}var ee=Bt(0),xe=function(Er){Er.x=Math.max(ee,Er.x)},ge=w.pathbar.edgeshape,ye=function(Er){var dn=Bt(Math.max(Math.min(Er.x0,Er.x0),0)),_n=Bt(Math.min(Math.max(Er.x1,Er.x1),q)),Oe=Zt(Er.y0),Xt=Zt(Er.y1),oe=G/2,zt={},_t={};zt.x=dn,_t.x=_n,zt.y=_t.y=(Oe+Xt)/2;var Pt={x:dn,y:Oe},Ht={x:_n,y:Oe},ae={x:_n,y:Xt},he={x:dn,y:Xt};return ge===">"?(Pt.x-=oe,Ht.x-=oe,ae.x-=oe,he.x-=oe):ge==="/"?(ae.x-=oe,he.x-=oe,zt.x-=oe/2,_t.x-=oe/2):ge==="\\"?(Pt.x-=oe,Ht.x-=oe,zt.x-=oe/2,_t.x-=oe/2):ge==="<"&&(zt.x-=oe,_t.x-=oe),xe(Pt),xe(he),xe(zt),xe(Ht),xe(ae),xe(_t),"M"+Gt(Pt.x,Pt.y)+"L"+Gt(Ht.x,Ht.y)+"L"+Gt(_t.x,_t.y)+"L"+Gt(ae.x,ae.y)+"L"+Gt(he.x,he.y)+"L"+Gt(zt.x,zt.y)+"Z"},ue=w[E?"tiling":"marker"].pad,Mt=function(Er){return w.textposition.indexOf(Er)!==-1},Ot=Mt("top"),Lt=Mt("left"),ie=Mt("right"),be=Mt("bottom"),ce=function(Er){var dn=mt(Er.x0),_n=mt(Er.x1),Oe=dt(Er.y0),Xt=dt(Er.y1),oe=_n-dn,zt=Xt-Oe;if(!oe||!zt)return"";var _t=w.marker.cornerradius||0,Pt=Math.min(_t,oe/2,zt/2);Pt&&Er.data&&Er.data.data&&Er.data.data.label&&(Ot&&(Pt=Math.min(Pt,ue.t)),Lt&&(Pt=Math.min(Pt,ue.l)),ie&&(Pt=Math.min(Pt,ue.r)),be&&(Pt=Math.min(Pt,ue.b)));var Ht=function(ae,he){return Pt?"a"+Gt(Pt,Pt)+" 0 0 1 "+Gt(ae,he):""};return"M"+Gt(dn,Oe+Pt)+Ht(Pt,-Pt)+"L"+Gt(_n-Pt,Oe)+Ht(Pt,Pt)+"L"+Gt(_n,Xt-Pt)+Ht(-Pt,Pt)+"L"+Gt(dn+Pt,Xt)+Ht(-Pt,-Pt)+"Z"},Le=function(Er,dn){var _n=Er.x0,Oe=Er.x1,Xt=Er.y0,oe=Er.y1,zt=Er.textBB,_t=Ot||dn.isHeader&&!be,Pt=_t?"start":be?"end":"middle",Ht=Mt("right"),ae=Mt("left")||dn.onPathbar,he=ae?-1:Ht?1:0;if(dn.isHeader){if(_n+=(E?ue:ue.l)-n,Oe-=(E?ue:ue.r)-n,_n>=Oe){var Me=(_n+Oe)/2;_n=Me,Oe=Me}var qe;be?(qe=oe-(E?ue:ue.b),Xt{var f=Br(),y=uy(),z=C0(),P=z.clearMinTextSize,n=Pg().resizeText,i=uY();Y.exports=function(a,l,o,c,s){var h=s.type,m=s.drawDescendants,b=a._fullLayout,x=b["_"+h+"layer"],_,A,d=!o;if(P(h,b),_=x.selectAll("g.trace."+h).data(l,function(w){return w[0].trace.uid}),_.enter().append("g").classed("trace",!0).classed(h,!0),_.order(),!b.uniformtext.mode&&y.hasTransition(o)){c&&(A=c());var k=f.transition().duration(o.duration).ease(o.easing).each("end",function(){A&&A()}).each("interrupt",function(){A&&A()});k.each(function(){x.selectAll("g.trace").each(function(w){i(a,w,this,o,m)})})}else _.each(function(w){i(a,w,this,o,m)}),b.uniformtext.mode&&n(a,x.selectAll(".trace"),h);d&&_.exit().remove()}}),hY=It((et,Y)=>{var f=Br(),y=jn(),z=Js(),P=uu(),n=iD(),i=qC().styleOne,a=Pb(),l=uy(),o=Sk(),c=VC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,d=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,S=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,H=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=!q&&!W.marker.pad.t||q&&!W.marker.pad.b,tt=n(b,[A,d],{packing:W.tiling.packing,squarifyratio:W.tiling.squarifyratio,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,pad:{inner:W.tiling.pad,top:W.marker.pad.t,left:W.marker.pad.l,right:W.marker.pad.r,bottom:W.marker.pad.b}}),ht=tt.descendants(),bt=1/0,vt=-1/0;ht.forEach(function(st){var xt=st.depth;xt>=W._maxDepth?(st.x0=st.x1=(st.x0+st.x1)/2,st.y0=st.y1=(st.y0+st.y1)/2):(bt=Math.min(bt,xt),vt=Math.max(vt,xt))}),x=x.data(ht,l.getPtId),W._maxVisibleLayers=isFinite(vt)?vt-bt+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,d],D),x.order();var ut=null;if(M&&S){var rt=l.getPtId(S);x.each(function(st){ut===null&&l.getPtId(st)===rt&&(ut={x0:st.x0,x1:st.x1,y0:st.y0,y1:st.y1})})}var gt=function(){return ut||{x0:0,x1:A,y0:0,y1:d}},it=x;return M&&(it=it.transition().each("end",function(){var st=f.select(this);l.setSliceCursor(st,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),it.each(function(st){var xt=l.isHeader(st,W);st._x0=k(st.x0),st._x1=k(st.x1),st._y0=w(st.y0),st._y1=w(st.y1),st._hoverX=k(st.x1-W.marker.pad.r),st._hoverY=w(q?st.y1-W.marker.pad.b/2:st.y0+W.marker.pad.t/2);var ot=f.select(this),J=y.ensureSingle(ot,"path","surface",function(Zt){Zt.style("pointer-events",B?"none":"all")});M?J.transition().attrTween("d",function(Zt){var Gt=g(Zt,s,gt(),[A,d]);return function(ee){return D(Gt(ee))}}):J.attr("d",D),ot.call(o,b,h,m,{styleOne:i,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),J.call(i,st,W,h,{hovered:!1}),st.x0===st.x1||st.y0===st.y1?st._text="":xt?st._text=G?"":l.getPtLabel(st)||"":st._text=c(st,b,W,m,U)||"";var mt=y.ensureSingle(ot,"g","slicetext"),dt=y.ensureSingle(mt,"text","",function(Zt){Zt.attr("data-notex",1)}),Ct=y.ensureUniformFontSize(h,l.determineTextFont(W,st,U.font)),Rt=st._text||" ",Bt=xt&&Rt.indexOf("
")===-1;dt.text(Rt).classed("slicetext",!0).attr("text-anchor",H?"end":F||Bt?"start":"middle").call(z.font,Ct).call(P.convertToTspans,h),st.textBB=z.bBox(dt.node()),st.transform=E(st,{fontSize:Ct.size,isHeader:xt}),st.transform.fontSize=Ct.size,M?dt.transition().attrTween("transform",function(Zt){var Gt=C(Zt,s,gt(),[A,d]);return function(ee){return I(Gt(ee))}}):dt.attr("transform",I(st))}),ut}}),dY=It((et,Y)=>{var f=aD(),y=hY();Y.exports=function(z,P,n,i){return f(z,P,n,i,{type:"treemap",drawDescendants:y})}}),fY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"treemap",basePlotModule:oY(),categories:[],animatable:!0,attributes:WC(),layoutAttributes:eD(),supplyDefaults:sY(),supplyLayoutDefaults:lY(),calc:rD().calc,crossTraceCalc:rD().crossTraceCalc,plot:dY(),style:qC().style,colorbar:Do(),meta:{}}}),pY=It((et,Y)=>{Y.exports=fY()}),mY=It(et=>{var Y=lh();et.name="icicle",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),oD=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Ru(),n=Jh().attributes,i=kb(),a=sk(),l=WC(),o=Pb(),c=Yn().extendFlat,s=qf().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:c({colors:a.marker.colors,line:a.marker.line,pattern:s,editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),leaf:a.leaf,pathbar:l.pathbar,text:i.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,hoverinfo:a.hoverinfo,hovertemplate:f({},{keys:o.eventDataKeys}),hovertemplatefallback:z(),textfont:i.textfont,insidetextfont:i.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:i.sort,root:a.root,domain:n({name:"icicle",trace:!0,editType:"calc"})}}),sD=It((et,Y)=>{Y.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),gY=It((et,Y)=>{var f=jn(),y=oD(),z=Hn(),P=Jh().defaults,n=eg().handleText,i=vb().TEXTPAD,a=Tb().handleMarkerDefaults,l=ch(),o=l.hasColorscale,c=l.handleDefaults;Y.exports=function(s,h,m,b){function x(I,M){return f.coerce(s,h,y,I,M)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var d=x("values");d&&d.length?x("branchvalues"):x("count"),x("level"),x("maxdepth"),x("tiling.orientation"),x("tiling.flip"),x("tiling.pad");var k=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",f.isArrayOrTypedArray(k)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var w=x("pathbar.visible"),D="auto";n(s,h,b,x,D,{hasPathbar:w,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition"),a(s,h,b,x);var E=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;E&&c(s,h,b,x,{prefix:"marker.",cLetter:"c"}),x("leaf.opacity",E?1:.7),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},w&&(x("pathbar.thickness",h.pathbar.textfont.size+2*i),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),vY=It((et,Y)=>{var f=jn(),y=sD();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("iciclecolorway",P.colorway),n("extendiciclecolors")}}),lD=It(et=>{var Y=ck();et.calc=function(f,y){return Y.calc(f,y)},et.crossTraceCalc=function(f){return Y._runCrossTraceCalc("icicle",f)}}),yY=It((et,Y)=>{var f=lk(),y=nD();Y.exports=function(z,P,n){var i=n.flipX,a=n.flipY,l=n.orientation==="h",o=n.maxDepth,c=P[0],s=P[1];o&&(c=(z.height+1)*P[0]/Math.min(z.height+1,o),s=(z.height+1)*P[1]/Math.min(z.height+1,o));var h=f.partition().padding(n.pad.inner).size(l?[P[1],c]:[P[0],s])(z);return(l||i||a)&&y(h,P,{swapXY:l,flipX:i,flipY:a}),h}}),cD=It((et,Y)=>{var f=Br(),y=Hn(),z=jn(),P=C0().resizeText,n=HC();function i(l){var o=l._fullLayout._iciclelayer.selectAll(".trace");P(l,o,"icicle"),o.each(function(c){var s=f.select(this),h=c[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){f.select(this).call(a,b,m,l)})})}function a(l,o,c,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(c,b,"marker.line.color")||y.defaultLine,_=z.castOption(c,b,"marker.line.width")||0;l.call(n,o,c,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?c.leaf.opacity:null)}Y.exports={style:i,styleOne:a}}),_Y=It((et,Y)=>{var f=Br(),y=jn(),z=Js(),P=uu(),n=yY(),i=cD().styleOne,a=Pb(),l=uy(),o=Sk(),c=VC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,d=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,S=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,H=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=n(b,[A,d],{flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,orientation:W.tiling.orientation,pad:{inner:W.tiling.pad},maxDepth:W._maxDepth}),tt=G.descendants(),ht=1/0,bt=-1/0;tt.forEach(function(it){var st=it.depth;st>=W._maxDepth?(it.x0=it.x1=(it.x0+it.x1)/2,it.y0=it.y1=(it.y0+it.y1)/2):(ht=Math.min(ht,st),bt=Math.max(bt,st))}),x=x.data(tt,l.getPtId),W._maxVisibleLayers=isFinite(bt)?bt-ht+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,d],D),x.order();var vt=null;if(M&&S){var ut=l.getPtId(S);x.each(function(it){vt===null&&l.getPtId(it)===ut&&(vt={x0:it.x0,x1:it.x1,y0:it.y0,y1:it.y1})})}var rt=function(){return vt||{x0:0,x1:A,y0:0,y1:d}},gt=x;return M&&(gt=gt.transition().each("end",function(){var it=f.select(this);l.setSliceCursor(it,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),gt.each(function(it){it._x0=k(it.x0),it._x1=k(it.x1),it._y0=w(it.y0),it._y1=w(it.y1),it._hoverX=k(it.x1-W.tiling.pad),it._hoverY=w(q?it.y1-W.tiling.pad/2:it.y0+W.tiling.pad/2);var st=f.select(this),xt=y.ensureSingle(st,"path","surface",function(dt){dt.style("pointer-events",B?"none":"all")});M?xt.transition().attrTween("d",function(dt){var Ct=g(dt,s,rt(),[A,d],{orientation:W.tiling.orientation,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1});return function(Rt){return D(Ct(Rt))}}):xt.attr("d",D),st.call(o,b,h,m,{styleOne:i,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),xt.call(i,it,W,h,{hovered:!1}),it.x0===it.x1||it.y0===it.y1?it._text="":it._text=c(it,b,W,m,U)||"";var ot=y.ensureSingle(st,"g","slicetext"),J=y.ensureSingle(ot,"text","",function(dt){dt.attr("data-notex",1)}),mt=y.ensureUniformFontSize(h,l.determineTextFont(W,it,U.font));J.text(it._text||" ").classed("slicetext",!0).attr("text-anchor",H?"end":F?"start":"middle").call(z.font,mt).call(P.convertToTspans,h),it.textBB=z.bBox(J.node()),it.transform=E(it,{fontSize:mt.size}),it.transform.fontSize=mt.size,M?J.transition().attrTween("transform",function(dt){var Ct=C(dt,s,rt(),[A,d]);return function(Rt){return I(Ct(Rt))}}):J.attr("transform",I(it))}),vt}}),xY=It((et,Y)=>{var f=aD(),y=_Y();Y.exports=function(z,P,n,i){return f(z,P,n,i,{type:"icicle",drawDescendants:y})}}),bY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"icicle",basePlotModule:mY(),categories:[],animatable:!0,attributes:oD(),layoutAttributes:sD(),supplyDefaults:gY(),supplyLayoutDefaults:vY(),calc:lD().calc,crossTraceCalc:lD().crossTraceCalc,plot:xY(),style:cD().style,colorbar:Do(),meta:{}}}),wY=It((et,Y)=>{Y.exports=bY()}),kY=It(et=>{var Y=lh();et.name="funnelarea",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),uD=It((et,Y)=>{var f=kb(),y=xa(),z=Jh().attributes,{hovertemplateAttrs:P,texttemplateAttrs:n,templatefallbackAttrs:i}=nu(),a=Yn().extendFlat;Y.exports={labels:f.labels,label0:f.label0,dlabel:f.dlabel,values:f.values,marker:{colors:f.marker.colors,line:{color:a({},f.marker.line.color,{dflt:null}),width:a({},f.marker.line.width,{dflt:1}),editType:"calc"},pattern:f.marker.pattern,editType:"calc"},text:f.text,hovertext:f.hovertext,scalegroup:a({},f.scalegroup,{}),textinfo:a({},f.textinfo,{flags:["label","text","value","percent"]}),texttemplate:n({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:i({editType:"plot"}),hoverinfo:a({},y.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:P({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:i(),textposition:a({},f.textposition,{values:["inside","none"],dflt:"inside"}),textfont:f.textfont,insidetextfont:f.insidetextfont,title:{text:f.title.text,font:f.title.font,position:a({},f.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:z({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}),hD=It((et,Y)=>{var f=fC().hiddenlabels;Y.exports={hiddenlabels:f,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),TY=It((et,Y)=>{var f=jn(),y=uD(),z=Jh().defaults,P=eg().handleText,n=Tb().handleLabelsAndValues,i=Tb().handleMarkerDefaults;Y.exports=function(a,l,o,c){function s(D,E){return f.coerce(a,l,y,D,E)}var h=s("labels"),m=s("values"),b=n(h,m),x=b.len;if(l._hasLabels=b.hasLabels,l._hasValues=b.hasValues,!l._hasLabels&&l._hasValues&&(s("label0"),s("dlabel")),!x){l.visible=!1;return}l._length=x,i(a,l,c,s),s("scalegroup");var _=s("text"),A=s("texttemplate");s("texttemplatefallback");var d;if(A||(d=s("textinfo",Array.isArray(_)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),A||d&&d!=="none"){var k=s("textposition");P(a,l,c,s,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else d==="none"&&s("textposition","none");z(l,c,s);var w=s("title.text");w&&(s("title.position"),f.coerceFont(s,"title.font",c.font)),s("aspectratio"),s("baseratio")}}),SY=It((et,Y)=>{var f=jn(),y=hD();Y.exports=function(z,P){function n(i,a){return f.coerce(z,P,y,i,a)}n("hiddenlabels"),n("funnelareacolorway",P.colorway),n("extendfunnelareacolors")}}),dD=It((et,Y)=>{var f=Uw();function y(P,n){return f.calc(P,n)}function z(P){f.crossTraceCalc(P,{type:"funnelarea"})}Y.exports={calc:y,crossTraceCalc:z}}),CY=It((et,Y)=>{var f=Br(),y=Js(),z=jn(),P=z.strScale,n=z.strTranslate,i=uu(),a=yb(),l=a.toMoveInsideBar,o=C0(),c=o.recordMinTextSize,s=o.clearMinTextSize,h=Vv(),m=pC(),b=m.attachFxHandlers,x=m.determineInsideTextFont,_=m.layoutAreas,A=m.prerenderTitles,d=m.positionTitleOutside,k=m.formatSliceLabel;Y.exports=function(I,M){var p=I._context.staticPlot,g=I._fullLayout;s("funnelarea",g),A(M,I),_(M,g._size),z.makeTraceGroups(g._funnelarealayer,M,"trace").each(function(C){var S=f.select(this),N=C[0],B=N.trace;E(C),S.each(function(){var U=f.select(this).selectAll("g.slice").data(C);U.enter().append("g").classed("slice",!0),U.exit().remove(),U.each(function(W,F){if(W.hidden){f.select(this).selectAll("path,g").remove();return}W.pointNumber=W.i,W.curveNumber=B.index;var H=N.cx,q=N.cy,G=f.select(this),tt=G.selectAll("path.surface").data([W]);tt.enter().append("path").classed("surface",!0).style({"pointer-events":p?"none":"all"}),G.call(b,I,C);var ht="M"+(H+W.TR[0])+","+(q+W.TR[1])+w(W.TR,W.BR)+w(W.BR,W.BL)+w(W.BL,W.TL)+"Z";tt.attr("d",ht),k(I,W,N);var bt=h.castOption(B.textposition,W.pts),vt=G.selectAll("g.slicetext").data(W.text&&bt!=="none"?[0]:[]);vt.enter().append("g").classed("slicetext",!0),vt.exit().remove(),vt.each(function(){var ut=z.ensureSingle(f.select(this),"text","",function(mt){mt.attr("data-notex",1)}),rt=z.ensureUniformFontSize(I,x(B,W,g.font));ut.text(W.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(y.font,rt).call(i.convertToTspans,I);var gt=y.bBox(ut.node()),it,st,xt,ot=Math.min(W.BL[1],W.BR[1])+q,J=Math.max(W.TL[1],W.TR[1])+q;st=Math.max(W.TL[0],W.BL[0])+H,xt=Math.min(W.TR[0],W.BR[0])+H,it=l(st,xt,ot,J,gt,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),it.fontSize=rt.size,c(B.type,it,g),C[F].transform=it,z.setTransormAndDisplay(ut,it)})});var V=f.select(this).selectAll("g.titletext").data(B.title.text?[0]:[]);V.enter().append("g").classed("titletext",!0),V.exit().remove(),V.each(function(){var W=z.ensureSingle(f.select(this),"text","",function(q){q.attr("data-notex",1)}),F=B.title.text;B._meta&&(F=z.templateString(F,B._meta)),W.text(F).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(y.font,B.title.font).call(i.convertToTspans,I);var H=d(N,g._size);W.attr("transform",n(H.x,H.y)+P(Math.min(1,H.scale))+n(H.tx,H.ty))})})})};function w(I,M){var p=M[0]-I[0],g=M[1]-I[1];return"l"+p+","+g}function D(I,M){return[.5*(I[0]+M[0]),.5*(I[1]+M[1])]}function E(I){if(!I.length)return;var M=I[0],p=M.trace,g=p.aspectratio,C=p.baseratio;C>.999&&(C=.999);var S=Math.pow(C,2),N=M.vTotal,B=N*S/(1-S),U=N,V=B/N;function W(){var Ct=Math.sqrt(V);return{x:Ct,y:-Ct}}function F(){var Ct=W();return[Ct.x,Ct.y]}var H,q=[];q.push(F());var G,tt;for(G=I.length-1;G>-1;G--)if(tt=I[G],!tt.hidden){var ht=tt.v/U;V+=ht,q.push(F())}var bt=1/0,vt=-1/0;for(G=0;G-1;G--)if(tt=I[G],!tt.hidden){J+=1;var mt=q[J][0],dt=q[J][1];tt.TL=[-mt,dt],tt.TR=[mt,dt],tt.BL=xt,tt.BR=ot,tt.pxmid=D(tt.TR,tt.BR),xt=tt.TL,ot=tt.TR}}}),AY=It((et,Y)=>{var f=Br(),y=Wv(),z=C0().resizeText;Y.exports=function(P){var n=P._fullLayout._funnelarealayer.selectAll(".trace");z(P,n,"funnelarea"),n.each(function(i){var a=i[0],l=a.trace,o=f.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(c){f.select(this).call(y,c,l,P)})})}}),MY=It((et,Y)=>{Y.exports={moduleType:"trace",name:"funnelarea",basePlotModule:kY(),categories:["pie-like","funnelarea","showLegend"],attributes:uD(),layoutAttributes:hD(),supplyDefaults:TY(),supplyLayoutDefaults:SY(),calc:dD().calc,crossTraceCalc:dD().crossTraceCalc,plot:CY(),style:AY(),styleOne:Wv(),meta:{}}}),EY=It((et,Y)=>{Y.exports=MY()}),Vp=It((et,Y)=>{(function(){var f={24:function(n){var i={left:0,top:0};n.exports=a;function a(o,c,s){c=c||o.currentTarget||o.srcElement,Array.isArray(s)||(s=[0,0]);var h=o.clientX||0,m=o.clientY||0,b=l(c);return s[0]=h-b.left,s[1]=m-b.top,s}function l(o){return o===window||o===document||o===document.body?i:o.getBoundingClientRect()}},109:function(n){n.exports=i;function i(a,l,o,c){var s=o[0],h=o[2],m=l[0]-s,b=l[2]-h,x=Math.sin(c),_=Math.cos(c);return a[0]=s+b*x+m*_,a[1]=l[1],a[2]=h+b*_-m*x,a}},160:function(n){n.exports=i;function i(a,l,o){return a[0]=Math.max(l[0],o[0]),a[1]=Math.max(l[1],o[1]),a[2]=Math.max(l[2],o[2]),a[3]=Math.max(l[3],o[3]),a}},216:function(n){n.exports=i;function i(a,l){for(var o={},c=0;c1){x[0]in m||(m[x[0]]=[]),m=m[x[0]];for(var _=1;_=0;--H){var gt=W[H];q=gt[0];var it=U[q],st=it[0],xt=it[1],ot=B[st],J=B[xt];if((ot[0]-J[0]||ot[1]-J[1])<0){var mt=st;st=xt,xt=mt}it[0]=st;var dt=it[1]=gt[1],Ct;for(F&&(Ct=it[2]);H>0&&W[H-1][0]===q;){var gt=W[--H],Rt=gt[1];F?U.push([dt,Rt,Ct]):U.push([dt,Rt]),dt=Rt}F?U.push([dt,xt,Ct]):U.push([dt,xt])}return G}function I(B,U,V){for(var W=U.length,F=new l(W),H=[],q=0;qU[2]?1:0)}function g(B,U,V){if(B.length!==0){if(U)for(var W=0;W0||q.length>0}function N(B,U,V){var W;if(V){W=U;for(var F=new Array(U.length),H=0;H/g," ");var G="",tt=[];for(J=0;J-1?parseInt(Lt[1+ce]):0,Qe=Le>-1?parseInt(ie[1+Le]):0;Ze!==Qe&&(be=be.replace(Gt(),"?px "),Ct*=Math.pow(.75,Qe-Ze),be=be.replace("?px ",Gt())),dt+=.25*rt*(Qe-Ze)}if(q.superscripts===!0){var mr=Lt.indexOf(k),fr=ie.indexOf(k),Jr=mr>-1?parseInt(Lt[1+mr]):0,an=fr>-1?parseInt(ie[1+fr]):0;Jr!==an&&(be=be.replace(Gt(),"?px "),Ct*=Math.pow(.75,an-Jr),be=be.replace("?px ",Gt())),dt-=.25*rt*(an-Jr)}if(q.bolds===!0){var Er=Lt.indexOf(x)>-1,dn=ie.indexOf(x)>-1;!Er&&dn&&(_n?be=be.replace("italic ","italic bold "):be="bold "+be),Er&&!dn&&(be=be.replace("bold ",""))}if(q.italics===!0){var _n=Lt.indexOf(A)>-1,Oe=ie.indexOf(A)>-1;!_n&&Oe&&(be="italic "+be),_n&&!Oe&&(be=be.replace("italic ",""))}V.font=be}for(ot=0;ot0&&(H=F.size),F.lineSpacing&&F.lineSpacing>0&&(q=F.lineSpacing),F.styletags&&F.styletags.breaklines&&(G.breaklines=!!F.styletags.breaklines),F.styletags&&F.styletags.bolds&&(G.bolds=!!F.styletags.bolds),F.styletags&&F.styletags.italics&&(G.italics=!!F.styletags.italics),F.styletags&&F.styletags.subscripts&&(G.subscripts=!!F.styletags.subscripts),F.styletags&&F.styletags.superscripts&&(G.superscripts=!!F.styletags.superscripts)),W.font=[F.fontStyle,F.fontVariant,F.fontWeight,H+"px",F.font].filter(function(ht){return ht}).join(" "),W.textAlign="start",W.textBaseline="alphabetic",W.direction="ltr";var tt=g(V,W,U,H,q,G);return N(tt,F,H)}},7721:function(n,i,a){var l=a(5716);n.exports=o;function o(c){return l(c[0])*l(c[1])}},7765:function(n,i,a){n.exports=d;var l=a(9618),o=a(1888),c=a(446),s=a(1570);function h(k){for(var w=k.length,D=0,E=0;E"u"&&(E=h(k));var I=k.length;if(I===0||E<1)return{cells:[],vertexIds:[],vertexWeights:[]};var M=m(w,+D),p=b(k,E),g=x(p,w,M,+D),C=_(p,w.length|0),S=s(E)(k,p.data,C,M),N=A(p),B=[].slice.call(g.data,0,g.shape[0]);return o.free(M),o.free(p.data),o.free(g.data),o.free(C),{cells:S,vertexIds:N,vertexWeights:B}}},7766:function(n,i,a){var l=a(9618),o=a(5298),c=a(1888);n.exports=g;var s=null,h=null,m=null;function b(C){s=[C.LINEAR,C.NEAREST_MIPMAP_LINEAR,C.LINEAR_MIPMAP_NEAREST,C.LINEAR_MIPMAP_NEAREST],h=[C.NEAREST,C.LINEAR,C.NEAREST_MIPMAP_NEAREST,C.NEAREST_MIPMAP_LINEAR,C.LINEAR_MIPMAP_NEAREST,C.LINEAR_MIPMAP_LINEAR],m=[C.REPEAT,C.CLAMP_TO_EDGE,C.MIRRORED_REPEAT]}function x(C){return typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&C instanceof HTMLVideoElement||typeof ImageData<"u"&&C instanceof ImageData}var _=function(C,S){o.muls(C,S,255)};function A(C,S,N){var B=C.gl,U=B.getParameter(B.MAX_TEXTURE_SIZE);if(S<0||S>U||N<0||N>U)throw new Error("gl-texture2d: Invalid texture size");return C._shape=[S,N],C.bind(),B.texImage2D(B.TEXTURE_2D,0,C.format,S,N,0,C.format,C.type,null),C._mipLevels=[0],C}function d(C,S,N,B,U,V){this.gl=C,this.handle=S,this.format=U,this.type=V,this._shape=[N,B],this._mipLevels=[0],this._magFilter=C.NEAREST,this._minFilter=C.NEAREST,this._wrapS=C.CLAMP_TO_EDGE,this._wrapT=C.CLAMP_TO_EDGE,this._anisoSamples=1;var W=this,F=[this._wrapS,this._wrapT];Object.defineProperties(F,[{get:function(){return W._wrapS},set:function(q){return W.wrapS=q}},{get:function(){return W._wrapT},set:function(q){return W.wrapT=q}}]),this._wrapVector=F;var H=[this._shape[0],this._shape[1]];Object.defineProperties(H,[{get:function(){return W._shape[0]},set:function(q){return W.width=q}},{get:function(){return W._shape[1]},set:function(q){return W.height=q}}]),this._shapeVector=H}var k=d.prototype;Object.defineProperties(k,{minFilter:{get:function(){return this._minFilter},set:function(C){this.bind();var S=this.gl;if(this.type===S.FLOAT&&s.indexOf(C)>=0&&(S.getExtension("OES_texture_float_linear")||(C=S.NEAREST)),h.indexOf(C)<0)throw new Error("gl-texture2d: Unknown filter mode "+C);return S.texParameteri(S.TEXTURE_2D,S.TEXTURE_MIN_FILTER,C),this._minFilter=C}},magFilter:{get:function(){return this._magFilter},set:function(C){this.bind();var S=this.gl;if(this.type===S.FLOAT&&s.indexOf(C)>=0&&(S.getExtension("OES_texture_float_linear")||(C=S.NEAREST)),h.indexOf(C)<0)throw new Error("gl-texture2d: Unknown filter mode "+C);return S.texParameteri(S.TEXTURE_2D,S.TEXTURE_MAG_FILTER,C),this._magFilter=C}},mipSamples:{get:function(){return this._anisoSamples},set:function(C){var S=this._anisoSamples;if(this._anisoSamples=Math.max(C,1)|0,S!==this._anisoSamples){var N=this.gl.getExtension("EXT_texture_filter_anisotropic");N&&this.gl.texParameterf(this.gl.TEXTURE_2D,N.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(C){if(this.bind(),m.indexOf(C)<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,C),this._wrapS=C}},wrapT:{get:function(){return this._wrapT},set:function(C){if(this.bind(),m.indexOf(C)<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,C),this._wrapT=C}},wrap:{get:function(){return this._wrapVector},set:function(C){if(Array.isArray(C)||(C=[C,C]),C.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var S=0;S<2;++S)if(m.indexOf(C[S])<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);this._wrapS=C[0],this._wrapT=C[1];var N=this.gl;return this.bind(),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,this._wrapS),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,this._wrapT),C}},shape:{get:function(){return this._shapeVector},set:function(C){if(!Array.isArray(C))C=[C|0,C|0];else if(C.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return A(this,C[0]|0,C[1]|0),[C[0]|0,C[1]|0]}},width:{get:function(){return this._shape[0]},set:function(C){return C=C|0,A(this,C,this._shape[1]),C}},height:{get:function(){return this._shape[1]},set:function(C){return C=C|0,A(this,this._shape[0],C),C}}}),k.bind=function(C){var S=this.gl;return C!==void 0&&S.activeTexture(S.TEXTURE0+(C|0)),S.bindTexture(S.TEXTURE_2D,this.handle),C!==void 0?C|0:S.getParameter(S.ACTIVE_TEXTURE)-S.TEXTURE0},k.dispose=function(){this.gl.deleteTexture(this.handle)},k.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var C=Math.min(this._shape[0],this._shape[1]),S=0;C>0;++S,C>>>=1)this._mipLevels.indexOf(S)<0&&this._mipLevels.push(S)},k.setPixels=function(C,S,N,B){var U=this.gl;this.bind(),Array.isArray(S)?(B=N,N=S[1]|0,S=S[0]|0):(S=S||0,N=N||0),B=B||0;var V=x(C)?C:C.raw;if(V){var W=this._mipLevels.indexOf(B)<0;W?(U.texImage2D(U.TEXTURE_2D,0,this.format,this.format,this.type,V),this._mipLevels.push(B)):U.texSubImage2D(U.TEXTURE_2D,B,S,N,this.format,this.type,V)}else if(C.shape&&C.stride&&C.data){if(C.shape.length<2||S+C.shape[1]>this._shape[1]>>>B||N+C.shape[0]>this._shape[0]>>>B||S<0||N<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");D(U,S,N,B,this.format,this.type,this._mipLevels,C)}else throw new Error("gl-texture2d: Unsupported data type")};function w(C,S){return C.length===3?S[2]===1&&S[1]===C[0]*C[2]&&S[0]===C[2]:S[0]===1&&S[1]===C[0]}function D(C,S,N,B,U,V,W,F){var H=F.dtype,q=F.shape.slice();if(q.length<2||q.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var G=0,tt=0,ht=w(q,F.stride.slice());if(H==="float32"?G=C.FLOAT:H==="float64"?(G=C.FLOAT,ht=!1,H="float32"):H==="uint8"?G=C.UNSIGNED_BYTE:(G=C.UNSIGNED_BYTE,ht=!1,H="uint8"),q.length===2)tt=C.LUMINANCE,q=[q[0],q[1],1],F=l(F.data,q,[F.stride[0],F.stride[1],1],F.offset);else if(q.length===3){if(q[2]===1)tt=C.ALPHA;else if(q[2]===2)tt=C.LUMINANCE_ALPHA;else if(q[2]===3)tt=C.RGB;else if(q[2]===4)tt=C.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");q[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((tt===C.LUMINANCE||tt===C.ALPHA)&&(U===C.LUMINANCE||U===C.ALPHA)&&(tt=U),tt!==U)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var bt=F.size,vt=W.indexOf(B)<0;if(vt&&W.push(B),G===V&&ht)F.offset===0&&F.data.length===bt?vt?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,F.data):C.texSubImage2D(C.TEXTURE_2D,B,S,N,q[0],q[1],U,V,F.data):vt?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,F.data.subarray(F.offset,F.offset+bt)):C.texSubImage2D(C.TEXTURE_2D,B,S,N,q[0],q[1],U,V,F.data.subarray(F.offset,F.offset+bt));else{var ut;V===C.FLOAT?ut=c.mallocFloat32(bt):ut=c.mallocUint8(bt);var rt=l(ut,q,[q[2],q[2]*q[0],1]);G===C.FLOAT&&V===C.UNSIGNED_BYTE?_(rt,F):o.assign(rt,F),vt?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,ut.subarray(0,bt)):C.texSubImage2D(C.TEXTURE_2D,B,S,N,q[0],q[1],U,V,ut.subarray(0,bt)),V===C.FLOAT?c.freeFloat32(ut):c.freeUint8(ut)}}function E(C){var S=C.createTexture();return C.bindTexture(C.TEXTURE_2D,S),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MIN_FILTER,C.NEAREST),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MAG_FILTER,C.NEAREST),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_S,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_T,C.CLAMP_TO_EDGE),S}function I(C,S,N,B,U){var V=C.getParameter(C.MAX_TEXTURE_SIZE);if(S<0||S>V||N<0||N>V)throw new Error("gl-texture2d: Invalid texture shape");if(U===C.FLOAT&&!C.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var W=E(C);return C.texImage2D(C.TEXTURE_2D,0,B,S,N,0,B,U,null),new d(C,W,S,N,B,U)}function M(C,S,N,B,U,V){var W=E(C);return C.texImage2D(C.TEXTURE_2D,0,U,U,V,S),new d(C,W,N,B,U,V)}function p(C,S){var N=S.dtype,B=S.shape.slice(),U=C.getParameter(C.MAX_TEXTURE_SIZE);if(B[0]<0||B[0]>U||B[1]<0||B[1]>U)throw new Error("gl-texture2d: Invalid texture size");var V=w(B,S.stride.slice()),W=0;N==="float32"?W=C.FLOAT:N==="float64"?(W=C.FLOAT,V=!1,N="float32"):N==="uint8"?W=C.UNSIGNED_BYTE:(W=C.UNSIGNED_BYTE,V=!1,N="uint8");var F=0;if(B.length===2)F=C.LUMINANCE,B=[B[0],B[1],1],S=l(S.data,B,[S.stride[0],S.stride[1],1],S.offset);else if(B.length===3)if(B[2]===1)F=C.ALPHA;else if(B[2]===2)F=C.LUMINANCE_ALPHA;else if(B[2]===3)F=C.RGB;else if(B[2]===4)F=C.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");W===C.FLOAT&&!C.getExtension("OES_texture_float")&&(W=C.UNSIGNED_BYTE,V=!1);var H,q,G=S.size;if(V)S.offset===0&&S.data.length===G?H=S.data:H=S.data.subarray(S.offset,S.offset+G);else{var tt=[B[2],B[2]*B[0],1];q=c.malloc(G,N);var ht=l(q,B,tt,0);(N==="float32"||N==="float64")&&W===C.UNSIGNED_BYTE?_(ht,S):o.assign(ht,S),H=q.subarray(0,G)}var bt=E(C);return C.texImage2D(C.TEXTURE_2D,0,F,B[0],B[1],0,F,W,H),V||c.free(q),new d(C,bt,B[0],B[1],F,W)}function g(C){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(s||b(C),typeof arguments[1]=="number")return I(C,arguments[1],arguments[2],arguments[3]||C.RGBA,arguments[4]||C.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return I(C,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||C.RGBA,arguments[3]||C.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var S=arguments[1],N=x(S)?S:S.raw;if(N)return M(C,N,S.width|0,S.height|0,arguments[2]||C.RGBA,arguments[3]||C.UNSIGNED_BYTE);if(S.shape&&S.data&&S.stride)return p(C,S)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},7790:function(){},7815:function(n,i,a){var l=a(2931),o=a(9970),c=["xyz","xzy","yxz","yzx","zxy","zyx"],s=function(w,D,E,I){for(var M=w.points,p=w.velocities,g=w.divergences,C=[],S=[],N=[],B=[],U=[],V=[],W=0,F=0,H=o.create(),q=o.create(),G=8,tt=0;tt0)for(var ut=0;utD)return I-1}return I},b=function(w,D,E){return wE?E:w},x=function(w,D,E){var I=D.vectors,M=D.meshgrid,p=w[0],g=w[1],C=w[2],S=M[0].length,N=M[1].length,B=M[2].length,U=m(M[0],p),V=m(M[1],g),W=m(M[2],C),F=U+1,H=V+1,q=W+1;if(U=b(U,0,S-1),F=b(F,0,S-1),V=b(V,0,N-1),H=b(H,0,N-1),W=b(W,0,B-1),q=b(q,0,B-1),U<0||V<0||W<0||F>S-1||H>N-1||q>B-1)return l.create();var G=M[0][U],tt=M[0][F],ht=M[1][V],bt=M[1][H],vt=M[2][W],ut=M[2][q],rt=(p-G)/(tt-G),gt=(g-ht)/(bt-ht),it=(C-vt)/(ut-vt);isFinite(rt)||(rt=.5),isFinite(gt)||(gt=.5),isFinite(it)||(it=.5);var st,xt,ot,J,mt,dt;switch(E.reversedX&&(U=S-1-U,F=S-1-F),E.reversedY&&(V=N-1-V,H=N-1-H),E.reversedZ&&(W=B-1-W,q=B-1-q),E.filled){case 5:mt=W,dt=q,ot=V*B,J=H*B,st=U*B*N,xt=F*B*N;break;case 4:mt=W,dt=q,st=U*B,xt=F*B,ot=V*B*S,J=H*B*S;break;case 3:ot=V,J=H,mt=W*N,dt=q*N,st=U*N*B,xt=F*N*B;break;case 2:ot=V,J=H,st=U*N,xt=F*N,mt=W*N*S,dt=q*N*S;break;case 1:st=U,xt=F,mt=W*S,dt=q*S,ot=V*S*B,J=H*S*B;break;default:st=U,xt=F,ot=V*S,J=H*S,mt=W*S*N,dt=q*S*N;break}var Ct=I[st+ot+mt],Rt=I[st+ot+dt],Bt=I[st+J+mt],Zt=I[st+J+dt],Gt=I[xt+ot+mt],ee=I[xt+ot+dt],xe=I[xt+J+mt],ge=I[xt+J+dt],ye=l.create(),ue=l.create(),Mt=l.create(),Ot=l.create();l.lerp(ye,Ct,Gt,rt),l.lerp(ue,Rt,ee,rt),l.lerp(Mt,Bt,xe,rt),l.lerp(Ot,Zt,ge,rt);var Lt=l.create(),ie=l.create();l.lerp(Lt,ye,Mt,gt),l.lerp(ie,ue,Ot,gt);var be=l.create();return l.lerp(be,Lt,ie,it),be},_=function(w){var D=1/0;w.sort(function(p,g){return p-g});for(var E=w.length,I=1;IF||geH||yeq)},tt=l.distance(D[0],D[1]),ht=10*tt/I,bt=ht*ht,vt=1,ut=0,rt=E.length;rt>1&&(vt=A(E));for(var gt=0;gtut&&(ut=Ct),mt.push(Ct),B.push({points:st,velocities:xt,divergences:mt});for(var Rt=0;Rtbt&&l.scale(Bt,Bt,ht/Math.sqrt(Zt)),l.add(Bt,Bt,it),ot=S(Bt),l.squaredDistance(J,Bt)-bt>-1e-4*bt){st.push(Bt),J=Bt,xt.push(ot);var dt=N(Bt,ot),Ct=l.length(dt);isFinite(Ct)&&Ct>ut&&(ut=Ct),mt.push(Ct)}it=Bt}}var Gt=h(B,w.colormap,ut,vt);return p?Gt.tubeScale=p:(ut===0&&(ut=1),Gt.tubeScale=M*.5*vt/ut),Gt};var d=a(6740),k=a(6405).createMesh;n.exports.createTubeMesh=function(w,D){return k(w,D,{shaders:d,traceType:"streamtube"})}},7827:function(n){n.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},7842:function(n,i,a){var l=a(6330),o=a(1533),c=a(2651),s=a(6768),h=a(869),m=a(8697);n.exports=b;function b(x,_){if(l(x))return _?m(x,b(_)):[x[0].clone(),x[1].clone()];var A=0,d,k;if(o(x))d=x.clone();else if(typeof x=="string")d=s(x);else{if(x===0)return[c(0),c(1)];if(x===Math.floor(x))d=c(x);else{for(;x!==Math.floor(x);)x=x*Math.pow(2,256),A-=256;d=c(x)}}if(l(_))d.mul(_[1]),k=_[0].clone();else if(o(_))k=_.clone();else if(typeof _=="string")k=s(_);else if(!_)k=c(1);else if(_===Math.floor(_))k=c(_);else{for(;_!==Math.floor(_);)_=_*Math.pow(2,256),A+=256;k=c(_)}return A>0?d=d.ushln(A):A<0&&(k=k.ushln(-A)),h(d,k)}},7894:function(n){n.exports=i;function i(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}},7932:function(n,i,a){var l=a(620);n.exports=l.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},7960:function(n){n.exports=i;function i(a,l){var o=l[0]-a[0],c=l[1]-a[1],s=l[2]-a[2],h=l[3]-a[3];return o*o+c*c+s*s+h*h}},8105:function(n){n.exports=a;var i={"lo===p0":l,"lo=p0)&&!(p1>=hi)":b};function a(x){return i[x]}function l(x,_,A,d,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,S=A;d>S;++S,I+=E){var N=k[I+g];if(N===D)if(p===S)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[S];w[S]=w[p],w[p++]=V}}return p}function o(x,_,A,d,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,S=A;d>S;++S,I+=E){var N=k[I+g];if(NB;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[S];w[S]=w[p],w[p++]=V}}return p}function c(x,_,A,d,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,S=A;d>S;++S,I+=E){var N=k[I+C];if(N<=D)if(p===S)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[S];w[S]=w[p],w[p++]=V}}return p}function s(x,_,A,d,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,S=A;d>S;++S,I+=E){var N=k[I+C];if(N<=D)if(p===S)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[S];w[S]=w[p],w[p++]=V}}return p}function h(x,_,A,d,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,S=A;d>S;++S,I+=E){var N=k[I+g],B=k[I+C];if(N<=D&&D<=B)if(p===S)p+=1,M+=E;else{for(var U=0;E>U;++U){var V=k[I+U];k[I+U]=k[M],k[M++]=V}var W=w[S];w[S]=w[p],w[p++]=W}}return p}function m(x,_,A,d,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,S=A;d>S;++S,I+=E){var N=k[I+g],B=k[I+C];if(NU;++U){var V=k[I+U];k[I+U]=k[M],k[M++]=V}var W=w[S];w[S]=w[p],w[p++]=W}}return p}function b(x,_,A,d,k,w,D,E){for(var I=2*x,M=I*A,p=M,g=A,C=_,S=x+_,N=A;d>N;++N,M+=I){var B=k[M+C],U=k[M+S];if(!(B>=D)&&!(E>=U))if(g===N)g+=1,p+=I;else{for(var V=0;I>V;++V){var W=k[M+V];k[M+V]=k[p],k[p++]=W}var F=w[N];w[N]=w[g],w[g++]=F}}return g}},8107:function(n){n.exports=i;function i(a,l,o){return a[0]=Math.min(l[0],o[0]),a[1]=Math.min(l[1],o[1]),a[2]=Math.min(l[2],o[2]),a}},8116:function(n,i,a){var l=a(7518),o=a(870);function c(h){this.bindVertexArrayOES=h.bindVertexArray.bind(h),this.createVertexArrayOES=h.createVertexArray.bind(h),this.deleteVertexArrayOES=h.deleteVertexArray.bind(h)}function s(h,m,b,x){var _=h.createVertexArray?new c(h):h.getExtension("OES_vertex_array_object"),A;return _?A=l(h,_):A=o(h),A.update(m,b,x),A}n.exports=s},8192:function(n,i,a){n.exports=s;var l=a(2825),o=a(3536),c=a(244);function s(h,m){var b=l(h[0],h[1],h[2]),x=l(m[0],m[1],m[2]);o(b,b),o(x,x);var _=c(b,x);return _>1?0:Math.acos(_)}},8210:function(n){n.exports=a;function i(l,o){var c=l+o,s=c-l,h=c-s,m=o-s,b=l-h,x=b+m;return x?[x,c]:[c]}function a(l,o){var c=l.length|0,s=o.length|0;if(c===1&&s===1)return i(l[0],o[0]);var h=c+s,m=new Array(h),b=0,x=0,_=0,A=Math.abs,d=l[x],k=A(d),w=o[_],D=A(w),E,I;k=s?(E=d,x+=1,xb)for(var N=m[d],B=1/Math.sqrt(p*C),S=0;S<3;++S){var U=(S+1)%3,V=(S+2)%3;N[S]+=B*(g[U]*M[V]-g[V]*M[U])}}for(var x=0;xb)for(var B=1/Math.sqrt(W),S=0;S<3;++S)N[S]*=B;else for(var S=0;S<3;++S)N[S]=0}return m},i.faceNormals=function(o,c,s){for(var h=o.length,m=new Array(h),b=s===void 0?l:s,x=0;xb?E=1/Math.sqrt(E):E=0;for(var d=0;d<3;++d)D[d]*=E;m[x]=D}return m}},8418:function(n,i,a){var l=a(5219),o=a(2762),c=a(8116),s=a(1888),h=a(6760),m=a(1283),b=a(9366),x=a(5964),_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=ArrayBuffer,d=DataView;function k(st){return A.isView(st)&&!(st instanceof d)}function w(st){return Array.isArray(st)||k(st)}n.exports=it;function D(st,xt){var ot=st[0],J=st[1],mt=st[2],dt=st[3];return st[0]=xt[0]*ot+xt[4]*J+xt[8]*mt+xt[12]*dt,st[1]=xt[1]*ot+xt[5]*J+xt[9]*mt+xt[13]*dt,st[2]=xt[2]*ot+xt[6]*J+xt[10]*mt+xt[14]*dt,st[3]=xt[3]*ot+xt[7]*J+xt[11]*mt+xt[15]*dt,st}function E(st,xt,ot,J){return D(J,J),D(J,J),D(J,J)}function I(st,xt){this.index=st,this.dataCoordinate=this.position=xt}function M(st){return st===!0||st>1?1:st}function p(st,xt,ot,J,mt,dt,Ct,Rt,Bt,Zt,Gt,ee){this.gl=st,this.pixelRatio=1,this.shader=xt,this.orthoShader=ot,this.projectShader=J,this.pointBuffer=mt,this.colorBuffer=dt,this.glyphBuffer=Ct,this.idBuffer=Rt,this.vao=Bt,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Zt,this.pickOrthoShader=Gt,this.pickProjectShader=ee,this.points=[],this._selectResult=new I(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var g=p.prototype;g.pickSlots=1,g.setPickBase=function(st){this.pickId=st},g.isTransparent=function(){if(this.hasAlpha)return!0;for(var st=0;st<3;++st)if(this.axesProject[st]&&this.projectHasAlpha)return!0;return!1},g.isOpaque=function(){if(!this.hasAlpha)return!0;for(var st=0;st<3;++st)if(this.axesProject[st]&&!this.projectHasAlpha)return!0;return!1};var C=[0,0],S=[0,0,0],N=[0,0,0],B=[0,0,0,1],U=[0,0,0,1],V=_.slice(),W=[0,0,0],F=[[0,0,0],[0,0,0]];function H(st){return st[0]=st[1]=st[2]=0,st}function q(st,xt){return st[0]=xt[0],st[1]=xt[1],st[2]=xt[2],st[3]=1,st}function G(st,xt,ot,J){return st[0]=xt[0],st[1]=xt[1],st[2]=xt[2],st[ot]=J,st}function tt(st){for(var xt=F,ot=0;ot<2;++ot)for(var J=0;J<3;++J)xt[ot][J]=Math.max(Math.min(st[ot][J],1e8),-1e8);return xt}function ht(st,xt,ot,J){var mt=xt.axesProject,dt=xt.gl,Ct=st.uniforms,Rt=ot.model||_,Bt=ot.view||_,Zt=ot.projection||_,Gt=xt.axesBounds,ee=tt(xt.clipBounds),xe;xt.axes&&xt.axes.lastCubeProps?xe=xt.axes.lastCubeProps.axis:xe=[1,1,1],C[0]=2/dt.drawingBufferWidth,C[1]=2/dt.drawingBufferHeight,st.bind(),Ct.view=Bt,Ct.projection=Zt,Ct.screenSize=C,Ct.highlightId=xt.highlightId,Ct.highlightScale=xt.highlightScale,Ct.clipBounds=ee,Ct.pickGroup=xt.pickId/255,Ct.pixelRatio=J;for(var ge=0;ge<3;++ge)if(mt[ge]){Ct.scale=xt.projectScale[ge],Ct.opacity=xt.projectOpacity[ge];for(var ye=V,ue=0;ue<16;++ue)ye[ue]=0;for(var ue=0;ue<4;++ue)ye[5*ue]=1;ye[5*ge]=0,xe[ge]<0?ye[12+ge]=Gt[0][ge]:ye[12+ge]=Gt[1][ge],h(ye,Rt,ye),Ct.model=ye;var Mt=(ge+1)%3,Ot=(ge+2)%3,Lt=H(S),ie=H(N);Lt[Mt]=1,ie[Ot]=1;var be=E(Zt,Bt,Rt,q(B,Lt)),ce=E(Zt,Bt,Rt,q(U,ie));if(Math.abs(be[1])>Math.abs(ce[1])){var Le=be;be=ce,ce=Le,Le=Lt,Lt=ie,ie=Le;var Ze=Mt;Mt=Ot,Ot=Ze}be[0]<0&&(Lt[Mt]=-1),ce[1]>0&&(ie[Ot]=-1);for(var Qe=0,mr=0,ue=0;ue<4;++ue)Qe+=Math.pow(Rt[4*Mt+ue],2),mr+=Math.pow(Rt[4*Ot+ue],2);Lt[Mt]/=Math.sqrt(Qe),ie[Ot]/=Math.sqrt(mr),Ct.axes[0]=Lt,Ct.axes[1]=ie,Ct.fragClipBounds[0]=G(W,ee[0],ge,-1e8),Ct.fragClipBounds[1]=G(W,ee[1],ge,1e8),xt.vao.bind(),xt.vao.draw(dt.TRIANGLES,xt.vertexCount),xt.lineWidth>0&&(dt.lineWidth(xt.lineWidth*J),xt.vao.draw(dt.LINES,xt.lineVertexCount,xt.vertexCount)),xt.vao.unbind()}}var bt=[-1e8,-1e8,-1e8],vt=[1e8,1e8,1e8],ut=[bt,vt];function rt(st,xt,ot,J,mt,dt,Ct){var Rt=ot.gl;if((dt===ot.projectHasAlpha||Ct)&&ht(xt,ot,J,mt),dt===ot.hasAlpha||Ct){st.bind();var Bt=st.uniforms;Bt.model=J.model||_,Bt.view=J.view||_,Bt.projection=J.projection||_,C[0]=2/Rt.drawingBufferWidth,C[1]=2/Rt.drawingBufferHeight,Bt.screenSize=C,Bt.highlightId=ot.highlightId,Bt.highlightScale=ot.highlightScale,Bt.fragClipBounds=ut,Bt.clipBounds=ot.axes.bounds,Bt.opacity=ot.opacity,Bt.pickGroup=ot.pickId/255,Bt.pixelRatio=mt,ot.vao.bind(),ot.vao.draw(Rt.TRIANGLES,ot.vertexCount),ot.lineWidth>0&&(Rt.lineWidth(ot.lineWidth*mt),ot.vao.draw(Rt.LINES,ot.lineVertexCount,ot.vertexCount)),ot.vao.unbind()}}g.draw=function(st){var xt=this.useOrtho?this.orthoShader:this.shader;rt(xt,this.projectShader,this,st,this.pixelRatio,!1,!1)},g.drawTransparent=function(st){var xt=this.useOrtho?this.orthoShader:this.shader;rt(xt,this.projectShader,this,st,this.pixelRatio,!0,!1)},g.drawPick=function(st){var xt=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;rt(xt,this.pickProjectShader,this,st,1,!0,!0)},g.pick=function(st){if(!st||st.id!==this.pickId)return null;var xt=st.value[2]+(st.value[1]<<8)+(st.value[0]<<16);if(xt>=this.pointCount||xt<0)return null;var ot=this.points[xt],J=this._selectResult;J.index=xt;for(var mt=0;mt<3;++mt)J.position[mt]=J.dataCoordinate[mt]=ot[mt];return J},g.highlight=function(st){if(!st)this.highlightId=[1,1,1,1];else{var xt=st.index,ot=xt&255,J=xt>>8&255,mt=xt>>16&255;this.highlightId=[ot/255,J/255,mt/255,0]}};function gt(st,xt,ot,J){var mt;w(st)?xt0){var _n=0,Oe=Ot,Xt=[0,0,0,1],oe=[0,0,0,1],zt=w(xe)&&w(xe[0]),_t=w(ue)&&w(ue[0]);t:for(var J=0;J0?1-mr[0][0]:Ye<0?1+mr[1][0]:1,ur*=ur>0?1-mr[0][1]:ur<0?1+mr[1][1]:1;for(var Rr=[Ye,ur],zr=Ze.cells||[],xr=Ze.positions||[],ce=0;ce=s?(E=d,x+=1,x0?1:0}},8648:function(n,i,a){n.exports=a(783)},8692:function(n){n.exports=i;function i(a,l,o,c){var s=o[0],h=o[1],m=l[0]-s,b=l[1]-h,x=Math.sin(c),_=Math.cos(c);return a[0]=s+m*_-b*x,a[1]=h+m*x+b*_,a[2]=l[2],a}},8697:function(n,i,a){var l=a(869);n.exports=o;function o(c,s){return l(c[0].mul(s[1]),c[1].mul(s[0]))}},8731:function(n,i,a){n.exports=b;var l=a(8866);function o(x,_,A,d,k,w){this._gl=x,this._wrapper=_,this._index=A,this._locations=d,this._dimension=k,this._constFunc=w}var c=o.prototype;c.pointer=function(x,_,A,d){var k=this,w=k._gl,D=k._locations[k._index];w.vertexAttribPointer(D,k._dimension,x||w.FLOAT,!!_,A||0,d||0),w.enableVertexAttribArray(D)},c.set=function(x,_,A,d){return this._constFunc(this._locations[this._index],x,_,A,d)},Object.defineProperty(c,"location",{get:function(){return this._locations[this._index]},set:function(x){return x!==this._locations[this._index]&&(this._locations[this._index]=x|0,this._wrapper.program=null),x|0}});var s=[function(x,_,A){return A.length===void 0?x.vertexAttrib1f(_,A):x.vertexAttrib1fv(_,A)},function(x,_,A,d){return A.length===void 0?x.vertexAttrib2f(_,A,d):x.vertexAttrib2fv(_,A)},function(x,_,A,d,k){return A.length===void 0?x.vertexAttrib3f(_,A,d,k):x.vertexAttrib3fv(_,A)},function(x,_,A,d,k,w){return A.length===void 0?x.vertexAttrib4f(_,A,d,k,w):x.vertexAttrib4fv(_,A)}];function h(x,_,A,d,k,w,D){var E=s[k],I=new o(x,_,A,d,k,E);Object.defineProperty(w,D,{set:function(M){return x.disableVertexAttribArray(d[A]),E(x,d[A],M),M},get:function(){return I},enumerable:!0})}function m(x,_,A,d,k,w,D){for(var E=new Array(k),I=new Array(k),M=0;M=0){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new l("","Invalid data type for attribute "+I+": "+M);h(x,_,p[0],d,g,k,I)}else if(M.indexOf("mat")>=0){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new l("","Invalid data type for attribute "+I+": "+M);m(x,_,p,d,g,k,I)}else throw new l("","Unknown data type for attribute "+I+": "+M);break}}return k}},8828:function(n,i){"use restrict";var a=32;i.INT_BITS=a,i.INT_MAX=2147483647,i.INT_MIN=-1<0)-(c<0)},i.abs=function(c){var s=c>>a-1;return(c^s)-s},i.min=function(c,s){return s^(c^s)&-(c65535)<<4,c>>>=s,h=(c>255)<<3,c>>>=h,s|=h,h=(c>15)<<2,c>>>=h,s|=h,h=(c>3)<<1,c>>>=h,s|=h,s|c>>1},i.log10=function(c){return c>=1e9?9:c>=1e8?8:c>=1e7?7:c>=1e6?6:c>=1e5?5:c>=1e4?4:c>=1e3?3:c>=100?2:c>=10?1:0},i.popCount=function(c){return c=c-(c>>>1&1431655765),c=(c&858993459)+(c>>>2&858993459),(c+(c>>>4)&252645135)*16843009>>>24};function l(c){var s=32;return c&=-c,c&&s--,c&65535&&(s-=16),c&16711935&&(s-=8),c&252645135&&(s-=4),c&858993459&&(s-=2),c&1431655765&&(s-=1),s}i.countTrailingZeros=l,i.nextPow2=function(c){return c+=c===0,--c,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c+1},i.prevPow2=function(c){return c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c-(c>>>1)},i.parity=function(c){return c^=c>>>16,c^=c>>>8,c^=c>>>4,c&=15,27030>>>c&1};var o=new Array(256);(function(c){for(var s=0;s<256;++s){var h=s,m=s,b=7;for(h>>>=1;h;h>>>=1)m<<=1,m|=h&1,--b;c[s]=m<>>8&255]<<16|o[c>>>16&255]<<8|o[c>>>24&255]},i.interleave2=function(c,s){return c&=65535,c=(c|c<<8)&16711935,c=(c|c<<4)&252645135,c=(c|c<<2)&858993459,c=(c|c<<1)&1431655765,s&=65535,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,c|s<<1},i.deinterleave2=function(c,s){return c=c>>>s&1431655765,c=(c|c>>>1)&858993459,c=(c|c>>>2)&252645135,c=(c|c>>>4)&16711935,c=(c|c>>>16)&65535,c<<16>>16},i.interleave3=function(c,s,h){return c&=1023,c=(c|c<<16)&4278190335,c=(c|c<<8)&251719695,c=(c|c<<4)&3272356035,c=(c|c<<2)&1227133513,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,c|=s<<1,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,c|h<<2},i.deinterleave3=function(c,s){return c=c>>>s&1227133513,c=(c|c>>>2)&3272356035,c=(c|c>>>4)&251719695,c=(c|c>>>8)&4278190335,c=(c|c>>>16)&1023,c<<22>>22},i.nextCombination=function(c){var s=c|c-1;return s+1|(~s&-~s)-1>>>l(c)+1}},8866:function(n){function i(a,l,o){this.shortMessage=l||"",this.longMessage=o||"",this.rawError=a||"",this.message="gl-shader: "+(l||a||"")+(o?` -`+o:""),this.stack=new Error().stack}i.prototype=new Error,i.prototype.name="GLError",i.prototype.constructor=i,n.exports=i},8902:function(n,i,a){var l=a(2478),o=a(3250)[3],c=0,s=1,h=2;n.exports=D;function m(E,I,M,p,g){this.a=E,this.b=I,this.idx=M,this.lowerIds=p,this.upperIds=g}function b(E,I,M,p){this.a=E,this.b=I,this.type=M,this.idx=p}function x(E,I){var M=E.a[0]-I.a[0]||E.a[1]-I.a[1]||E.type-I.type;return M||E.type!==c&&(M=o(E.a,E.b,I.b),M)?M:E.idx-I.idx}function _(E,I){return o(E.a,E.b,I)}function A(E,I,M,p,g){for(var C=l.lt(I,p,_),S=l.gt(I,p,_),N=C;N1&&o(M[U[V-2]],M[U[V-1]],p)>0;)E.push([U[V-1],U[V-2],g]),V-=1;U.length=V,U.push(g);for(var W=B.upperIds,V=W.length;V>1&&o(M[W[V-2]],M[W[V-1]],p)<0;)E.push([W[V-2],W[V-1],g]),V-=1;W.length=V,W.push(g)}}function d(E,I){var M;return E.a[0]B[0]&&g.push(new b(B,N,h,C),new b(N,B,s,C))}g.sort(x);for(var U=g[0].a[0]-(1+Math.abs(g[0].a[0]))*Math.pow(2,-52),V=[new m([U,1],[U,0],-1,[],[])],W=[],C=0,F=g.length;C0;){k=p.pop();for(var g=k.adjacent,C=0;C<=D;++C){var S=g[C];if(!(!S.boundary||S.lastVisited<=-E)){for(var N=S.vertices,B=0;B<=D;++B){var U=N[B];U<0?I[B]=w:I[B]=M[U]}var V=this.orient();if(V>0)return S;S.lastVisited=-E,V===0&&p.push(S)}}}return null},A.walk=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=w?this.interior.length*Math.random()|0:this.interior.length-1,g=this.interior[p];t:for(;!g.boundary;){for(var C=g.vertices,S=g.adjacent,N=0;N<=E;++N)M[N]=I[C[N]];g.lastVisited=D;for(var N=0;N<=E;++N){var B=S[N];if(!(B.lastVisited>=D)){var U=M[N];M[N]=k;var V=this.orient();if(M[N]=U,V<0){g=B;continue t}else B.boundary?B.lastVisited=-D:B.lastVisited=D}}return}return g},A.addPeaks=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=this.interior,g=this.simplices,C=[w];w.lastVisited=D,w.vertices[w.vertices.indexOf(-1)]=D,w.boundary=!1,p.push(w);for(var S=[];C.length>0;){var w=C.pop(),N=w.vertices,B=w.adjacent,U=N.indexOf(D);if(!(U<0)){for(var V=0;V<=E;++V)if(V!==U){var W=B[V];if(!(!W.boundary||W.lastVisited>=D)){var F=W.vertices;if(W.lastVisited!==-D){for(var H=0,q=0;q<=E;++q)F[q]<0?(H=q,M[q]=k):M[q]=I[F[q]];var G=this.orient();if(G>0){F[H]=D,W.boundary=!1,p.push(W),C.push(W),W.lastVisited=D;continue}else W.lastVisited=-D}var tt=W.adjacent,ht=N.slice(),bt=B.slice(),vt=new c(ht,bt,!0);g.push(vt);var ut=tt.indexOf(w);if(!(ut<0)){tt[ut]=vt,bt[U]=W,ht[V]=-1,bt[V]=w,B[V]=vt,vt.flip();for(var q=0;q<=E;++q){var rt=ht[q];if(!(rt<0||rt===D)){for(var gt=new Array(E-1),it=0,st=0;st<=E;++st){var xt=ht[st];xt<0||st===q||(gt[it++]=xt)}S.push(new s(gt,vt,q))}}}}}}}S.sort(h);for(var V=0;V+1=0?p[C++]=g[N]:S=N&1;if(S===(k&1)){var B=p[0];p[0]=p[1],p[1]=B}w.push(p)}}return w};function d(k,w){var D=k.length;if(D===0)throw new Error("Must have at least d+1 points");var E=k[0].length;if(D<=E)throw new Error("Must input at least d+1 points");var I=k.slice(0,E+1),M=l.apply(void 0,I);if(M===0)throw new Error("Input not in general position");for(var p=new Array(E+1),g=0;g<=E;++g)p[g]=g;M<0&&(p[0]=1,p[1]=0);for(var C=new c(p,new Array(E+1),!1),S=C.adjacent,N=new Array(E+2),g=0;g<=E;++g){for(var B=p.slice(),U=0;U<=E;++U)U===g&&(B[U]=-1);var V=B[0];B[0]=B[1],B[1]=V;var W=new c(B,new Array(E+1),!0);S[g]=W,N[g]=W}N[E+1]=C;for(var g=0;g<=E;++g)for(var B=S[g].vertices,F=S[g].adjacent,U=0;U<=E;++U){var H=B[U];if(H<0){F[U]=C;continue}for(var q=0;q<=E;++q)S[q].vertices.indexOf(H)<0&&(F[U]=S[q])}for(var G=new _(E,I,N),tt=!!w,g=E+1;g=1},d.isTransparent=function(){return this.opacity<1},d.pickSlots=1,d.setPickBase=function(M){this.pickId=M};function k(M){for(var p=x({colormap:M,nshades:256,format:"rgba"}),g=new Uint8Array(1024),C=0;C<256;++C){for(var S=p[C],N=0;N<3;++N)g[4*C+N]=S[N];g[4*C+3]=S[3]*255}return b(g,[256,256,4],[4,0,1])}function w(M){for(var p=M.length,g=new Array(p),C=0;C0){var q=this.triShader;q.bind(),q.uniforms=U,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},d.drawPick=function(M){M=M||{};for(var p=this.gl,g=M.model||_,C=M.view||_,S=M.projection||_,N=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],B=0;B<3;++B)N[0][B]=Math.max(N[0][B],this.clipBounds[0][B]),N[1][B]=Math.min(N[1][B],this.clipBounds[1][B]);this._model=[].slice.call(g),this._view=[].slice.call(C),this._projection=[].slice.call(S),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var U={model:g,view:C,projection:S,clipBounds:N,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},V=this.pickShader;V.bind(),V.uniforms=U,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},d.pick=function(M){if(!M||M.id!==this.pickId)return null;var p=M.value[0]+256*M.value[1]+65536*M.value[2],g=this.cells[p],C=this.positions[g[1]].slice(0,3),S={position:C,dataCoordinate:C,index:Math.floor(g[1]/48)};return this.traceType==="cone"?S.index=Math.floor(g[1]/48):this.traceType==="streamtube"&&(S.intensity=this.intensity[g[1]],S.velocity=this.vectors[g[1]].slice(0,3),S.divergence=this.vectors[g[1]][3],S.index=p),S},d.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function D(M,p){var g=l(M,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return g.attributes.position.location=0,g.attributes.color.location=2,g.attributes.uv.location=3,g.attributes.vector.location=4,g}function E(M,p){var g=l(M,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return g.attributes.position.location=0,g.attributes.id.location=1,g.attributes.vector.location=4,g}function I(M,p,g){var C=g.shaders;arguments.length===1&&(p=M,M=p.gl);var S=D(M,C),N=E(M,C),B=s(M,b(new Uint8Array([255,255,255,255]),[1,1,4]));B.generateMipmap(),B.minFilter=M.LINEAR_MIPMAP_LINEAR,B.magFilter=M.LINEAR;var U=o(M),V=o(M),W=o(M),F=o(M),H=o(M),q=c(M,[{buffer:U,type:M.FLOAT,size:4},{buffer:H,type:M.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:W,type:M.FLOAT,size:4},{buffer:F,type:M.FLOAT,size:2},{buffer:V,type:M.FLOAT,size:4}]),G=new A(M,B,S,N,U,V,H,W,F,q,g.traceType||"cone");return G.update(p),G}n.exports=I},9127:function(n,i,a){n.exports=c;var l=a(6204),o=a(5771);function c(s){return o(l(s))}},9131:function(n,i,a){var l=a(5177),o=a(9288);n.exports=c;function c(s,h){return h=h||1,s[0]=Math.random(),s[1]=Math.random(),s[2]=Math.random(),s[3]=Math.random(),l(s,s),o(s,s,h),s}},9165:function(n,i,a){n.exports=A;var l=a(2762),o=a(8116),c=a(3436),s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(d,k,w,D){this.gl=d,this.shader=D,this.buffer=k,this.vao=w,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var m=h.prototype;m.isOpaque=function(){return!this.hasAlpha},m.isTransparent=function(){return this.hasAlpha},m.drawTransparent=m.draw=function(d){var k=this.gl,w=this.shader.uniforms;this.shader.bind();var D=w.view=d.view||s,E=w.projection=d.projection||s;w.model=d.model||s,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var I=D[12],M=D[13],p=D[14],g=D[15],C=d._ortho||!1,S=C?2:1,N=S*this.pixelRatio*(E[3]*I+E[7]*M+E[11]*p+E[15]*g)/k.drawingBufferHeight;this.vao.bind();for(var B=0;B<3;++B)k.lineWidth(this.lineWidth[B]*this.pixelRatio),w.capSize=this.capSize[B]*N,this.lineCount[B]&&k.drawArrays(k.LINES,this.lineOffset[B],this.lineCount[B]);this.vao.unbind()};function b(d,k){for(var w=0;w<3;++w)d[0][w]=Math.min(d[0][w],k[w]),d[1][w]=Math.max(d[1][w],k[w])}var x=function(){for(var d=new Array(3),k=0;k<3;++k){for(var w=[],D=1;D<=2;++D)for(var E=-1;E<=1;E+=2){var I=(D+k)%3,M=[0,0,0];M[I]=E,w.push(M)}d[k]=w}return d}();function _(d,k,w,D){for(var E=x[D],I=0;I0){var U=C.slice();U[p]+=N[1][p],E.push(C[0],C[1],C[2],B[0],B[1],B[2],B[3],0,0,0,U[0],U[1],U[2],B[0],B[1],B[2],B[3],0,0,0),b(this.bounds,U),M+=2+_(E,U,B,p)}}}this.lineCount[p]=M-this.lineOffset[p]}this.buffer.update(E)}},m.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function A(d){var k=d.gl,w=l(k),D=o(k,[{buffer:w,type:k.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:k.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:k.FLOAT,size:3,offset:28,stride:40}]),E=c(k);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.offset.location=2;var I=new h(k,w,D,E);return I.update(d),I}},9215:function(n,i,a){n.exports=b;var l=a(4769),o=a(2478);function c(x,_,A){return Math.min(_,Math.max(x,A))}function s(x,_,A){this.dimension=x.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var d=0;d=A-1)for(var M=w.length-1,g=x-_[A-1],p=0;p=A-1)for(var I=w.length-1,M=x-_[A-1],p=0;p=0;--A)if(x[--_])return!1;return!0},h.jump=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var d=this._state,k=this._velocity,w=d.length-this.dimension,D=this.bounds,E=D[0],I=D[1];this._time.push(_,x);for(var M=0;M<2;++M)for(var p=0;p0;--p)d.push(c(E[p-1],I[p-1],arguments[p])),k.push(0)}},h.push=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var d=this._state,k=this._velocity,w=d.length-this.dimension,D=x-_,E=this.bounds,I=E[0],M=E[1],p=D>1e-6?1/D:0;this._time.push(x);for(var g=A;g>0;--g){var C=c(I[g-1],M[g-1],arguments[g]);d.push(C),k.push((C-d[w++])*p)}}},h.set=function(x){var _=this.dimension;if(!(x0;--E)A.push(c(w[E-1],D[E-1],arguments[E])),d.push(0)}},h.move=function(x){var _=this.lastT(),A=this.dimension;if(!(x<=_||arguments.length!==A+1)){var d=this._state,k=this._velocity,w=d.length-this.dimension,D=this.bounds,E=D[0],I=D[1],M=x-_,p=M>1e-6?1/M:0;this._time.push(x);for(var g=A;g>0;--g){var C=arguments[g];d.push(c(E[g-1],I[g-1],d[w++]+C)),k.push(C*p)}}},h.idle=function(x){var _=this.lastT();if(!(x<_)){var A=this.dimension,d=this._state,k=this._velocity,w=d.length-A,D=this.bounds,E=D[0],I=D[1],M=x-_;this._time.push(x);for(var p=A-1;p>=0;--p)d.push(c(E[p],I[p],d[w]+M*k[w])),k.push(0),w+=1}};function m(x){for(var _=new Array(x),A=0;A1&&s.indexOf("Macintosh")!==-1&&s.indexOf("Safari")!==-1&&(h=!0),h}},9226:function(n){n.exports=i;function i(a,l){return a[0]=Math.ceil(l[0]),a[1]=Math.ceil(l[1]),a[2]=Math.ceil(l[2]),a}},9265:function(n){n.exports=i;function i(a,l){return a[0]===l[0]&&a[1]===l[1]&&a[2]===l[2]}},9288:function(n){n.exports=i;function i(a,l,o){return a[0]=l[0]*o,a[1]=l[1]*o,a[2]=l[2]*o,a[3]=l[3]*o,a}},9346:function(n){var i=new Float64Array(4),a=new Float64Array(4),l=new Float64Array(4);function o(c,s,h,m,b){i.length=_?(g=1,S=_+2*k+D):(g=-k/_,S=k*g+D)):(g=0,w>=0?(C=0,S=D):-w>=d?(C=1,S=d+2*w+D):(C=-w/d,S=w*C+D));else if(C<0)C=0,k>=0?(g=0,S=D):-k>=_?(g=1,S=_+2*k+D):(g=-k/_,S=k*g+D);else{var N=1/p;g*=N,C*=N,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D}else{var B,U,V,W;g<0?(B=A+k,U=d+w,U>B?(V=U-B,W=_-2*A+d,V>=W?(g=1,C=0,S=_+2*k+D):(g=V/W,C=1-g,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D)):(g=0,U<=0?(C=1,S=d+2*w+D):w>=0?(C=0,S=D):(C=-w/d,S=w*C+D))):C<0?(B=A+w,U=_+k,U>B?(V=U-B,W=_-2*A+d,V>=W?(C=1,g=0,S=d+2*w+D):(C=V/W,g=1-C,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D)):(C=0,U<=0?(g=1,S=_+2*k+D):k>=0?(g=0,S=D):(g=-k/_,S=k*g+D))):(V=d+w-A-k,V<=0?(g=0,C=1,S=d+2*w+D):(W=_-2*A+d,V>=W?(g=1,C=0,S=_+2*k+D):(g=V/W,C=1-g,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D)))}for(var F=1-g-C,x=0;xw)for(d=w;dk)for(d=k;d=0){for(var F=W.type.charAt(W.type.length-1)|0,H=new Array(F),q=0;q=0;)G+=1;U[V]=G}var tt=new Array(w.length);function ht(){I.program=s.program(M,I._vref,I._fref,B,U);for(var bt=0;btot&&mt>0){var dt=(J[mt][0]-ot)/(J[mt][0]-J[mt-1][0]);return J[mt][1]*(1-dt)+dt*J[mt-1][1]}}return 1}var q=[0,0,0],G={showSurface:!1,showContour:!1,projections:[S.slice(),S.slice(),S.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function tt(ot,J){var mt,dt,Ct,Rt=J.axes&&J.axes.lastCubeProps.axis||q,Bt=J.showSurface,Zt=J.showContour;for(mt=0;mt<3;++mt)for(Bt=Bt||J.surfaceProject[mt],dt=0;dt<3;++dt)Zt=Zt||J.contourProject[mt][dt];for(mt=0;mt<3;++mt){var Gt=G.projections[mt];for(dt=0;dt<16;++dt)Gt[dt]=0;for(dt=0;dt<4;++dt)Gt[5*dt]=1;Gt[5*mt]=0,Gt[12+mt]=J.axesBounds[+(Rt[mt]>0)][mt],d(Gt,ot.model,Gt);var ee=G.clipBounds[mt];for(Ct=0;Ct<2;++Ct)for(dt=0;dt<3;++dt)ee[Ct][dt]=ot.clipBounds[Ct][dt];ee[0][mt]=-1e8,ee[1][mt]=1e8}return G.showSurface=Bt,G.showContour=Zt,G}var ht={model:S,view:S,projection:S,inverseModel:S.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},bt=S.slice(),vt=[1,0,0,0,1,0,0,0,1];function ut(ot,J){ot=ot||{};var mt=this.gl;mt.disable(mt.CULL_FACE),this._colorMap.bind(0);var dt=ht;dt.model=ot.model||S,dt.view=ot.view||S,dt.projection=ot.projection||S,dt.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],dt.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],dt.objectOffset=this.objectOffset,dt.contourColor=this.contourColor[0],dt.inverseModel=k(dt.inverseModel,dt.model);for(var Ct=0;Ct<2;++Ct)for(var Rt=dt.clipBounds[Ct],Bt=0;Bt<3;++Bt)Rt[Bt]=Math.min(Math.max(this.clipBounds[Ct][Bt],-1e8),1e8);dt.kambient=this.ambientLight,dt.kdiffuse=this.diffuseLight,dt.kspecular=this.specularLight,dt.roughness=this.roughness,dt.fresnel=this.fresnel,dt.opacity=this.opacity,dt.height=0,dt.permutation=vt,dt.vertexColor=this.vertexColor;var Zt=bt;for(d(Zt,dt.view,dt.model),d(Zt,dt.projection,Zt),k(Zt,Zt),Ct=0;Ct<3;++Ct)dt.eyePosition[Ct]=Zt[12+Ct]/Zt[15];var Gt=Zt[15];for(Ct=0;Ct<3;++Ct)Gt+=this.lightPosition[Ct]*Zt[4*Ct+3];for(Ct=0;Ct<3;++Ct){var ee=Zt[12+Ct];for(Bt=0;Bt<3;++Bt)ee+=Zt[4*Bt+Ct]*this.lightPosition[Bt];dt.lightPosition[Ct]=ee/Gt}var xe=tt(dt,this);if(xe.showSurface){for(this._shader.bind(),this._shader.uniforms=dt,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(mt.TRIANGLES,this._vertexCount),Ct=0;Ct<3;++Ct)!this.surfaceProject[Ct]||!this.vertexCount||(this._shader.uniforms.model=xe.projections[Ct],this._shader.uniforms.clipBounds=xe.clipBounds[Ct],this._vao.draw(mt.TRIANGLES,this._vertexCount));this._vao.unbind()}if(xe.showContour){var ge=this._contourShader;dt.kambient=1,dt.kdiffuse=0,dt.kspecular=0,dt.opacity=1,ge.bind(),ge.uniforms=dt;var ye=this._contourVAO;for(ye.bind(),Ct=0;Ct<3;++Ct)for(ge.uniforms.permutation=B[Ct],mt.lineWidth(this.contourWidth[Ct]*this.pixelRatio),Bt=0;Bt>4)/16)/255,Ct=Math.floor(dt),Rt=dt-Ct,Bt=J[1]*(ot.value[1]+(ot.value[2]&15)/16)/255,Zt=Math.floor(Bt),Gt=Bt-Zt;Ct+=1,Zt+=1;var ee=mt.position;ee[0]=ee[1]=ee[2]=0;for(var xe=0;xe<2;++xe)for(var ge=xe?Rt:1-Rt,ye=0;ye<2;++ye)for(var ue=ye?Gt:1-Gt,Mt=Ct+xe,Ot=Zt+ye,Lt=ge*ue,ie=0;ie<3;++ie)ee[ie]+=this._field[ie].get(Mt,Ot)*Lt;for(var be=this._pickResult.level,ce=0;ce<3;++ce)if(be[ce]=w.le(this.contourLevels[ce],ee[ce]),be[ce]<0)this.contourLevels[ce].length>0&&(be[ce]=0);else if(be[ce]Math.abs(Ze-ee[ce])&&(be[ce]+=1)}for(mt.index[0]=Rt<.5?Ct:Ct+1,mt.index[1]=Gt<.5?Zt:Zt+1,mt.uv[0]=dt/J[0],mt.uv[1]=Bt/J[1],ie=0;ie<3;++ie)mt.dataCoordinate[ie]=this._field[ie].get(mt.index[0],mt.index[1]);return mt},F.padField=function(ot,J){var mt=J.shape.slice(),dt=ot.shape.slice();b.assign(ot.lo(1,1).hi(mt[0],mt[1]),J),b.assign(ot.lo(1).hi(mt[0],1),J.hi(mt[0],1)),b.assign(ot.lo(1,dt[1]-1).hi(mt[0],1),J.lo(0,mt[1]-1).hi(mt[0],1)),b.assign(ot.lo(0,1).hi(1,mt[1]),J.hi(1)),b.assign(ot.lo(dt[0]-1,1).hi(1,mt[1]),J.lo(mt[0]-1)),ot.set(0,0,J.get(0,0)),ot.set(0,dt[1]-1,J.get(0,mt[1]-1)),ot.set(dt[0]-1,0,J.get(mt[0]-1,0)),ot.set(dt[0]-1,dt[1]-1,J.get(mt[0]-1,mt[1]-1))};function gt(ot,J){return Array.isArray(ot)?[J(ot[0]),J(ot[1]),J(ot[2])]:[J(ot),J(ot),J(ot)]}function it(ot){return Array.isArray(ot)?ot.length===3?[ot[0],ot[1],ot[2],1]:[ot[0],ot[1],ot[2],ot[3]]:[0,0,0,1]}function st(ot){if(Array.isArray(ot)){if(Array.isArray(ot))return[it(ot[0]),it(ot[1]),it(ot[2])];var J=it(ot);return[J.slice(),J.slice(),J.slice()]}}F.update=function(ot){ot=ot||{},this.objectOffset=ot.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ot&&(this.contourWidth=gt(ot.contourWidth,Number)),"showContour"in ot&&(this.showContour=gt(ot.showContour,Boolean)),"showSurface"in ot&&(this.showSurface=!!ot.showSurface),"contourTint"in ot&&(this.contourTint=gt(ot.contourTint,Boolean)),"contourColor"in ot&&(this.contourColor=st(ot.contourColor)),"contourProject"in ot&&(this.contourProject=gt(ot.contourProject,function(ca){return gt(ca,Boolean)})),"surfaceProject"in ot&&(this.surfaceProject=ot.surfaceProject),"dynamicColor"in ot&&(this.dynamicColor=st(ot.dynamicColor)),"dynamicTint"in ot&&(this.dynamicTint=gt(ot.dynamicTint,Number)),"dynamicWidth"in ot&&(this.dynamicWidth=gt(ot.dynamicWidth,Number)),"opacity"in ot&&(this.opacity=ot.opacity),"opacityscale"in ot&&(this.opacityscale=ot.opacityscale),"colorBounds"in ot&&(this.colorBounds=ot.colorBounds),"vertexColor"in ot&&(this.vertexColor=ot.vertexColor?1:0),"colormap"in ot&&this._colorMap.setPixels(this.genColormap(ot.colormap,this.opacityscale));var J=ot.field||ot.coords&&ot.coords[2]||null,mt=!1;if(J||(this._field[2].shape[0]||this._field[2].shape[2]?J=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):J=this._field[2].hi(0,0)),"field"in ot||"coords"in ot){var dt=(J.shape[0]+2)*(J.shape[1]+2);dt>this._field[2].data.length&&(h.freeFloat(this._field[2].data),this._field[2].data=h.mallocFloat(l.nextPow2(dt))),this._field[2]=_(this._field[2].data,[J.shape[0]+2,J.shape[1]+2]),this.padField(this._field[2],J),this.shape=J.shape.slice();for(var Ct=this.shape,Rt=0;Rt<2;++Rt)this._field[2].size>this._field[Rt].data.length&&(h.freeFloat(this._field[Rt].data),this._field[Rt].data=h.mallocFloat(this._field[2].size)),this._field[Rt]=_(this._field[Rt].data,[Ct[0]+2,Ct[1]+2]);if(ot.coords){var Bt=ot.coords;if(!Array.isArray(Bt)||Bt.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Rt=0;Rt<2;++Rt){var Zt=Bt[Rt];for(ye=0;ye<2;++ye)if(Zt.shape[ye]!==Ct[ye])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Rt],Zt)}}else if(ot.ticks){var Gt=ot.ticks;if(!Array.isArray(Gt)||Gt.length!==2)throw new Error("gl-surface: invalid ticks");for(Rt=0;Rt<2;++Rt){var ee=Gt[Rt];if((Array.isArray(ee)||ee.length)&&(ee=_(ee)),ee.shape[0]!==Ct[Rt])throw new Error("gl-surface: invalid tick length");var xe=_(ee.data,Ct);xe.stride[Rt]=ee.stride[0],xe.stride[Rt^1]=0,this.padField(this._field[Rt],xe)}}else{for(Rt=0;Rt<2;++Rt){var ge=[0,0];ge[Rt]=1,this._field[Rt]=_(this._field[Rt].data,[Ct[0]+2,Ct[1]+2],ge,0)}this._field[0].set(0,0,0);for(var ye=0;ye0){for(var Zi=0;Zi<5;++Zi)zr.pop();zt-=1}continue t}}}ui.push(zt)}this._contourOffsets[xr]=ci,this._contourCounts[xr]=ui}var Ji=h.mallocFloat(zr.length);for(Rt=0;Rt=0&&(M=E|0,I+=g*M,p-=M),new w(this.data,p,g,I)},D.step=function(E){var I=this.shape[0],M=this.stride[0],p=this.offset,g=0,C=Math.ceil;return typeof E=="number"&&(g=E|0,g<0?(p+=M*(I-1),I=C(-I/g)):I=C(I/g),M*=g),new w(this.data,I,M,p)},D.transpose=function(E){E=E===void 0?0:E|0;var I=this.shape,M=this.stride;return new w(this.data,I[E],M[E],this.offset)},D.pick=function(E){var I=[],M=[],p=this.offset;typeof E=="number"&&E>=0?p=p+this.stride[0]*E|0:(I.push(this.shape[0]),M.push(this.stride[0]));var g=d[I.length+1];return g(this.data,I,M,p)},function(E,I,M,p){return new w(E,I[0],M[0],p)}},2:function(A,d,k){function w(E,I,M,p,g,C){this.data=E,this.shape=[I,M],this.stride=[p,g],this.offset=C|0}var D=w.prototype;return D.dtype=A,D.dimension=2,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(D,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),D.set=function(E,I,M){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I,M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]=M},D.get=function(E,I){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]},D.index=function(E,I){return this.offset+this.stride[0]*E+this.stride[1]*I},D.hi=function(E,I){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,this.stride[0],this.stride[1],this.offset)},D.lo=function(E,I){var M=this.offset,p=0,g=this.shape[0],C=this.shape[1],S=this.stride[0],N=this.stride[1];return typeof E=="number"&&E>=0&&(p=E|0,M+=S*p,g-=p),typeof I=="number"&&I>=0&&(p=I|0,M+=N*p,C-=p),new w(this.data,g,C,S,N,M)},D.step=function(E,I){var M=this.shape[0],p=this.shape[1],g=this.stride[0],C=this.stride[1],S=this.offset,N=0,B=Math.ceil;return typeof E=="number"&&(N=E|0,N<0?(S+=g*(M-1),M=B(-M/N)):M=B(M/N),g*=N),typeof I=="number"&&(N=I|0,N<0?(S+=C*(p-1),p=B(-p/N)):p=B(p/N),C*=N),new w(this.data,M,p,g,C,S)},D.transpose=function(E,I){E=E===void 0?0:E|0,I=I===void 0?1:I|0;var M=this.shape,p=this.stride;return new w(this.data,M[E],M[I],p[E],p[I],this.offset)},D.pick=function(E,I){var M=[],p=[],g=this.offset;typeof E=="number"&&E>=0?g=g+this.stride[0]*E|0:(M.push(this.shape[0]),p.push(this.stride[0])),typeof I=="number"&&I>=0?g=g+this.stride[1]*I|0:(M.push(this.shape[1]),p.push(this.stride[1]));var C=d[M.length+1];return C(this.data,M,p,g)},function(E,I,M,p){return new w(E,I[0],I[1],M[0],M[1],p)}},3:function(A,d,k){function w(E,I,M,p,g,C,S,N){this.data=E,this.shape=[I,M,p],this.stride=[g,C,S],this.offset=N|0}var D=w.prototype;return D.dtype=A,D.dimension=3,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(D,"order",{get:function(){var E=Math.abs(this.stride[0]),I=Math.abs(this.stride[1]),M=Math.abs(this.stride[2]);return E>I?I>M?[2,1,0]:E>M?[1,2,0]:[1,0,2]:E>M?[2,0,1]:M>I?[0,1,2]:[0,2,1]}}),D.set=function(E,I,M,p){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M,p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]=p},D.get=function(E,I,M){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]},D.index=function(E,I,M){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M},D.hi=function(E,I,M){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},D.lo=function(E,I,M){var p=this.offset,g=0,C=this.shape[0],S=this.shape[1],N=this.shape[2],B=this.stride[0],U=this.stride[1],V=this.stride[2];return typeof E=="number"&&E>=0&&(g=E|0,p+=B*g,C-=g),typeof I=="number"&&I>=0&&(g=I|0,p+=U*g,S-=g),typeof M=="number"&&M>=0&&(g=M|0,p+=V*g,N-=g),new w(this.data,C,S,N,B,U,V,p)},D.step=function(E,I,M){var p=this.shape[0],g=this.shape[1],C=this.shape[2],S=this.stride[0],N=this.stride[1],B=this.stride[2],U=this.offset,V=0,W=Math.ceil;return typeof E=="number"&&(V=E|0,V<0?(U+=S*(p-1),p=W(-p/V)):p=W(p/V),S*=V),typeof I=="number"&&(V=I|0,V<0?(U+=N*(g-1),g=W(-g/V)):g=W(g/V),N*=V),typeof M=="number"&&(V=M|0,V<0?(U+=B*(C-1),C=W(-C/V)):C=W(C/V),B*=V),new w(this.data,p,g,C,S,N,B,U)},D.transpose=function(E,I,M){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0;var p=this.shape,g=this.stride;return new w(this.data,p[E],p[I],p[M],g[E],g[I],g[M],this.offset)},D.pick=function(E,I,M){var p=[],g=[],C=this.offset;typeof E=="number"&&E>=0?C=C+this.stride[0]*E|0:(p.push(this.shape[0]),g.push(this.stride[0])),typeof I=="number"&&I>=0?C=C+this.stride[1]*I|0:(p.push(this.shape[1]),g.push(this.stride[1])),typeof M=="number"&&M>=0?C=C+this.stride[2]*M|0:(p.push(this.shape[2]),g.push(this.stride[2]));var S=d[p.length+1];return S(this.data,p,g,C)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],M[0],M[1],M[2],p)}},4:function(A,d,k){function w(E,I,M,p,g,C,S,N,B,U){this.data=E,this.shape=[I,M,p,g],this.stride=[C,S,N,B],this.offset=U|0}var D=w.prototype;return D.dtype=A,D.dimension=4,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p,g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]=g},D.get=function(E,I,M,p){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]},D.index=function(E,I,M,p){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p},D.hi=function(E,I,M,p){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},D.lo=function(E,I,M,p){var g=this.offset,C=0,S=this.shape[0],N=this.shape[1],B=this.shape[2],U=this.shape[3],V=this.stride[0],W=this.stride[1],F=this.stride[2],H=this.stride[3];return typeof E=="number"&&E>=0&&(C=E|0,g+=V*C,S-=C),typeof I=="number"&&I>=0&&(C=I|0,g+=W*C,N-=C),typeof M=="number"&&M>=0&&(C=M|0,g+=F*C,B-=C),typeof p=="number"&&p>=0&&(C=p|0,g+=H*C,U-=C),new w(this.data,S,N,B,U,V,W,F,H,g)},D.step=function(E,I,M,p){var g=this.shape[0],C=this.shape[1],S=this.shape[2],N=this.shape[3],B=this.stride[0],U=this.stride[1],V=this.stride[2],W=this.stride[3],F=this.offset,H=0,q=Math.ceil;return typeof E=="number"&&(H=E|0,H<0?(F+=B*(g-1),g=q(-g/H)):g=q(g/H),B*=H),typeof I=="number"&&(H=I|0,H<0?(F+=U*(C-1),C=q(-C/H)):C=q(C/H),U*=H),typeof M=="number"&&(H=M|0,H<0?(F+=V*(S-1),S=q(-S/H)):S=q(S/H),V*=H),typeof p=="number"&&(H=p|0,H<0?(F+=W*(N-1),N=q(-N/H)):N=q(N/H),W*=H),new w(this.data,g,C,S,N,B,U,V,W,F)},D.transpose=function(E,I,M,p){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0;var g=this.shape,C=this.stride;return new w(this.data,g[E],g[I],g[M],g[p],C[E],C[I],C[M],C[p],this.offset)},D.pick=function(E,I,M,p){var g=[],C=[],S=this.offset;typeof E=="number"&&E>=0?S=S+this.stride[0]*E|0:(g.push(this.shape[0]),C.push(this.stride[0])),typeof I=="number"&&I>=0?S=S+this.stride[1]*I|0:(g.push(this.shape[1]),C.push(this.stride[1])),typeof M=="number"&&M>=0?S=S+this.stride[2]*M|0:(g.push(this.shape[2]),C.push(this.stride[2])),typeof p=="number"&&p>=0?S=S+this.stride[3]*p|0:(g.push(this.shape[3]),C.push(this.stride[3]));var N=d[g.length+1];return N(this.data,g,C,S)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],M[0],M[1],M[2],M[3],p)}},5:function(A,d,k){function w(E,I,M,p,g,C,S,N,B,U,V,W){this.data=E,this.shape=[I,M,p,g,C],this.stride=[S,N,B,U,V],this.offset=W|0}var D=w.prototype;return D.dtype=A,D.dimension=5,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g,C){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g,C):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]=C},D.get=function(E,I,M,p,g){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]},D.index=function(E,I,M,p,g){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g},D.hi=function(E,I,M,p,g){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,typeof g!="number"||g<0?this.shape[4]:g|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},D.lo=function(E,I,M,p,g){var C=this.offset,S=0,N=this.shape[0],B=this.shape[1],U=this.shape[2],V=this.shape[3],W=this.shape[4],F=this.stride[0],H=this.stride[1],q=this.stride[2],G=this.stride[3],tt=this.stride[4];return typeof E=="number"&&E>=0&&(S=E|0,C+=F*S,N-=S),typeof I=="number"&&I>=0&&(S=I|0,C+=H*S,B-=S),typeof M=="number"&&M>=0&&(S=M|0,C+=q*S,U-=S),typeof p=="number"&&p>=0&&(S=p|0,C+=G*S,V-=S),typeof g=="number"&&g>=0&&(S=g|0,C+=tt*S,W-=S),new w(this.data,N,B,U,V,W,F,H,q,G,tt,C)},D.step=function(E,I,M,p,g){var C=this.shape[0],S=this.shape[1],N=this.shape[2],B=this.shape[3],U=this.shape[4],V=this.stride[0],W=this.stride[1],F=this.stride[2],H=this.stride[3],q=this.stride[4],G=this.offset,tt=0,ht=Math.ceil;return typeof E=="number"&&(tt=E|0,tt<0?(G+=V*(C-1),C=ht(-C/tt)):C=ht(C/tt),V*=tt),typeof I=="number"&&(tt=I|0,tt<0?(G+=W*(S-1),S=ht(-S/tt)):S=ht(S/tt),W*=tt),typeof M=="number"&&(tt=M|0,tt<0?(G+=F*(N-1),N=ht(-N/tt)):N=ht(N/tt),F*=tt),typeof p=="number"&&(tt=p|0,tt<0?(G+=H*(B-1),B=ht(-B/tt)):B=ht(B/tt),H*=tt),typeof g=="number"&&(tt=g|0,tt<0?(G+=q*(U-1),U=ht(-U/tt)):U=ht(U/tt),q*=tt),new w(this.data,C,S,N,B,U,V,W,F,H,q,G)},D.transpose=function(E,I,M,p,g){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0,g=g===void 0?4:g|0;var C=this.shape,S=this.stride;return new w(this.data,C[E],C[I],C[M],C[p],C[g],S[E],S[I],S[M],S[p],S[g],this.offset)},D.pick=function(E,I,M,p,g){var C=[],S=[],N=this.offset;typeof E=="number"&&E>=0?N=N+this.stride[0]*E|0:(C.push(this.shape[0]),S.push(this.stride[0])),typeof I=="number"&&I>=0?N=N+this.stride[1]*I|0:(C.push(this.shape[1]),S.push(this.stride[1])),typeof M=="number"&&M>=0?N=N+this.stride[2]*M|0:(C.push(this.shape[2]),S.push(this.stride[2])),typeof p=="number"&&p>=0?N=N+this.stride[3]*p|0:(C.push(this.shape[3]),S.push(this.stride[3])),typeof g=="number"&&g>=0?N=N+this.stride[4]*g|0:(C.push(this.shape[4]),S.push(this.stride[4]));var B=d[C.length+1];return B(this.data,C,S,N)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],I[4],M[0],M[1],M[2],M[3],M[4],p)}}};function m(A,d){var k=d===-1?"T":String(d),w=h[k];return d===-1?w(A):d===0?w(A,x[A][0]):w(A,x[A],s)}function b(A){if(l(A))return"buffer";if(o)switch(Object.prototype.toString.call(A)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(A)?"array":"generic"}var x={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function _(A,d,k,w){if(A===void 0){var g=x.array[0];return g([])}else typeof A=="number"&&(A=[A]);d===void 0&&(d=[A.length]);var D=d.length;if(k===void 0){k=new Array(D);for(var E=D-1,I=1;E>=0;--E)k[E]=I,I*=d[E]}if(w===void 0){w=0;for(var E=0;E1e-6?(k[0]=D/p,k[1]=E/p,k[2]=I/p,k[3]=M/p):(k[0]=k[1]=k[2]=0,k[3]=1)}function _(k,w,D){this.radius=l([D]),this.center=l(w),this.rotation=l(k),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var A=_.prototype;A.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},A.recalcMatrix=function(k){this.radius.curve(k),this.center.curve(k),this.rotation.curve(k);var w=this.computedRotation;x(w,w);var D=this.computedMatrix;c(D,w);var E=this.computedCenter,I=this.computedEye,M=this.computedUp,p=Math.exp(this.computedRadius[0]);I[0]=E[0]+p*D[2],I[1]=E[1]+p*D[6],I[2]=E[2]+p*D[10],M[0]=D[1],M[1]=D[5],M[2]=D[9];for(var g=0;g<3;++g){for(var C=0,S=0;S<3;++S)C+=D[g+4*S]*I[S];D[12+g]=-C}},A.getMatrix=function(k,w){this.recalcMatrix(k);var D=this.computedMatrix;if(w){for(var E=0;E<16;++E)w[E]=D[E];return w}return D},A.idle=function(k){this.center.idle(k),this.radius.idle(k),this.rotation.idle(k)},A.flush=function(k){this.center.flush(k),this.radius.flush(k),this.rotation.flush(k)},A.pan=function(k,w,D,E){w=w||0,D=D||0,E=E||0,this.recalcMatrix(k);var I=this.computedMatrix,M=I[1],p=I[5],g=I[9],C=m(M,p,g);M/=C,p/=C,g/=C;var S=I[0],N=I[4],B=I[8],U=S*M+N*p+B*g;S-=M*U,N-=p*U,B-=g*U;var V=m(S,N,B);S/=V,N/=V,B/=V,I[2],I[6],I[10];var W=S*w+M*D,F=N*w+p*D,H=B*w+g*D;this.center.move(k,W,F,H);var q=Math.exp(this.computedRadius[0]);q=Math.max(1e-4,q+E),this.radius.set(k,Math.log(q))},A.rotate=function(k,w,D,E){this.recalcMatrix(k),w=w||0,D=D||0;var I=this.computedMatrix,M=I[0],p=I[4],g=I[8],C=I[1],S=I[5],N=I[9],B=I[2],U=I[6],V=I[10],W=w*M+D*C,F=w*p+D*S,H=w*g+D*N,q=-(U*H-V*F),G=-(V*W-B*H),tt=-(B*F-U*W),ht=Math.sqrt(Math.max(0,1-Math.pow(q,2)-Math.pow(G,2)-Math.pow(tt,2))),bt=b(q,G,tt,ht);bt>1e-6?(q/=bt,G/=bt,tt/=bt,ht/=bt):(q=G=tt=0,ht=1);var vt=this.computedRotation,ut=vt[0],rt=vt[1],gt=vt[2],it=vt[3],st=ut*ht+it*q+rt*tt-gt*G,xt=rt*ht+it*G+gt*q-ut*tt,ot=gt*ht+it*tt+ut*G-rt*q,J=it*ht-ut*q-rt*G-gt*tt;if(E){q=B,G=U,tt=V;var mt=Math.sin(E)/m(q,G,tt);q*=mt,G*=mt,tt*=mt,ht=Math.cos(w),st=st*ht+J*q+xt*tt-ot*G,xt=xt*ht+J*G+ot*q-st*tt,ot=ot*ht+J*tt+st*G-xt*q,J=J*ht-st*q-xt*G-ot*tt}var dt=b(st,xt,ot,J);dt>1e-6?(st/=dt,xt/=dt,ot/=dt,J/=dt):(st=xt=ot=0,J=1),this.rotation.set(k,st,xt,ot,J)},A.lookAt=function(k,w,D,E){this.recalcMatrix(k),D=D||this.computedCenter,w=w||this.computedEye,E=E||this.computedUp;var I=this.computedMatrix;o(I,w,D,E);var M=this.computedRotation;h(M,I[0],I[1],I[2],I[4],I[5],I[6],I[8],I[9],I[10]),x(M,M),this.rotation.set(k,M[0],M[1],M[2],M[3]);for(var p=0,g=0;g<3;++g)p+=Math.pow(D[g]-w[g],2);this.radius.set(k,.5*Math.log(Math.max(p,1e-6))),this.center.set(k,D[0],D[1],D[2])},A.translate=function(k,w,D,E){this.center.move(k,w||0,D||0,E||0)},A.setMatrix=function(k,w){var D=this.computedRotation;h(D,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),x(D,D),this.rotation.set(k,D[0],D[1],D[2],D[3]);var E=this.computedMatrix;s(E,w);var I=E[15];if(Math.abs(I)>1e-6){var M=E[12]/I,p=E[13]/I,g=E[14]/I;this.recalcMatrix(k);var C=Math.exp(this.computedRadius[0]);this.center.set(k,M-E[2]*C,p-E[6]*C,g-E[10]*C),this.radius.idle(k)}else this.center.idle(k),this.radius.idle(k)},A.setDistance=function(k,w){w>0&&this.radius.set(k,Math.log(w))},A.setDistanceLimits=function(k,w){k>0?k=Math.log(k):k=-1/0,w>0?w=Math.log(w):w=1/0,w=Math.max(w,k),this.radius.bounds[0][0]=k,this.radius.bounds[1][0]=w},A.getDistanceLimits=function(k){var w=this.radius.bounds;return k?(k[0]=Math.exp(w[0][0]),k[1]=Math.exp(w[1][0]),k):[Math.exp(w[0][0]),Math.exp(w[1][0])]},A.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},A.fromJSON=function(k){var w=this.lastT(),D=k.center;D&&this.center.set(w,D[0],D[1],D[2]);var E=k.rotation;E&&this.rotation.set(w,E[0],E[1],E[2],E[3]);var I=k.distance;I&&I>0&&this.radius.set(w,Math.log(I)),this.setDistanceLimits(k.zoomMin,k.zoomMax)};function d(k){k=k||{};var w=k.center||[0,0,0],D=k.rotation||[0,0,0,1],E=k.radius||1;w=[].slice.call(w,0,3),D=[].slice.call(D,0,4),x(D,D);var I=new _(D,w,Math.log(E));return I.setDistanceLimits(k.zoomMin,k.zoomMax),("eye"in k||"up"in k)&&I.lookAt(0,k.eye,k.center,k.up),I}},9994:function(n,i,a){var l=a(9618),o=a(8277);n.exports=function(c,s){for(var h=[],m=c,b=1;Array.isArray(m);)h.push(m.length),b*=m.length,m=m[0];return h.length===0?l():(s||(s=l(new Float64Array(b),h)),o(s,c),s)}}},y={};function z(n){var i=y[n];if(i!==void 0)return i.exports;var a=y[n]={id:n,loaded:!1,exports:{}};return f[n].call(a.exports,a,a.exports,z),a.loaded=!0,a.exports}(function(){z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){z.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n}}();var P=z(1964);Y.exports=P})()}),fD=It((et,Y)=>{Y.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),LY=It((et,Y)=>{var f=fD();Y.exports=z;var y={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function z(P){var n,i=[],a=1,l;if(typeof P=="string")if(P=P.toLowerCase(),f[P])i=f[P].slice(),l="rgb";else if(P==="transparent")a=0,l="rgb",i=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(P)){var o=P.slice(1),c=o.length,s=c<=4;a=1,s?(i=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],c===4&&(a=parseInt(o[3]+o[3],16)/255)):(i=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],c===8&&(a=parseInt(o[6]+o[7],16)/255)),i[0]||(i[0]=0),i[1]||(i[1]=0),i[2]||(i[2]=0),l="rgb"}else if(n=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(P)){var h=n[1],m=h==="rgb",o=h.replace(/a$/,"");l=o;var c=o==="cmyk"?4:o==="gray"?1:3;i=n[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(_,A){if(/%$/.test(_))return A===c?parseFloat(_)/100:o==="rgb"?parseFloat(_)*255/100:parseFloat(_);if(o[A]==="h"){if(/deg$/.test(_))return parseFloat(_);if(y[_]!==void 0)return y[_]}return parseFloat(_)}),h===o&&i.push(1),a=m||i[c]===void 0?1:i[c],i=i.slice(0,c)}else P.length>10&&/[0-9](?:\s|\/)/.test(P)&&(i=P.match(/([0-9]+)/g).map(function(b){return parseFloat(b)}),l=P.match(/([a-z])/ig).join("").toLowerCase());else isNaN(P)?Array.isArray(P)||P.length?(i=[P[0],P[1],P[2]],l="rgb",a=P.length===4?P[3]:1):P instanceof Object&&(P.r!=null||P.red!=null||P.R!=null?(l="rgb",i=[P.r||P.red||P.R||0,P.g||P.green||P.G||0,P.b||P.blue||P.B||0]):(l="hsl",i=[P.h||P.hue||P.H||0,P.s||P.saturation||P.S||0,P.l||P.lightness||P.L||P.b||P.brightness]),a=P.a||P.alpha||P.opacity||1,P.opacity!=null&&(a/=100)):(l="rgb",i=[P>>>16,(P&65280)>>>8,P&255]);return{space:l,values:i,alpha:a}}}),PY=It((et,Y)=>{var f=LY();Y.exports=function(z){Array.isArray(z)&&z.raw&&(z=String.raw.apply(null,arguments));var P,n=f(z);if(!n.space)return[];var i=[0,0,0],a=n.space[0]==="h"?[360,100,100]:[255,255,255];return P=Array(3),P[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),P[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),P[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),n.space[0]==="h"&&(P=y(P)),P.push(Math.min(Math.max(n.alpha,0),1)),P};function y(z){var P=z[0]/360,n=z[1]/100,i=z[2]/100,a,l,o,c,s,h=0;if(n===0)return s=i*255,[s,s,s];for(l=i<.5?i*(1+n):i+n-i*n,a=2*i-l,c=[0,0,0];h<3;)o=P+1/3*-(h-1),o<0?o++:o>1&&o--,s=6*o<1?a+(l-a)*6*o:2*o<1?l:3*o<2?a+(l-a)*(2/3-o)*6:a,c[h++]=s*255;return c}}),Ck=It((et,Y)=>{Y.exports=f;function f(y,z,P){return zP?P:y:yz?z:y}}),GC=It((et,Y)=>{Y.exports=function(f){switch(f){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),H_=It((et,Y)=>{var f=PY(),y=Ck(),z=GC();Y.exports=function(n,i){(i==="float"||!i)&&(i="array"),i==="uint"&&(i="uint8"),i==="uint_clamped"&&(i="uint8_clamped");var a=z(i),l=new a(4),o=i!=="uint8"&&i!=="uint8_clamped";return(!n.length||typeof n=="string")&&(n=f(n),n[0]/=255,n[1]/=255,n[2]/=255),P(n)?(l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3]!=null?n[3]:255,o&&(l[0]/=255,l[1]/=255,l[2]/=255,l[3]/=255),l):(o?(l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3]!=null?n[3]:1):(l[0]=y(Math.floor(n[0]*255),0,255),l[1]=y(Math.floor(n[1]*255),0,255),l[2]=y(Math.floor(n[2]*255),0,255),l[3]=n[3]==null?255:y(Math.floor(n[3]*255),0,255)),l)};function P(n){return!!(n instanceof Uint8Array||n instanceof Uint8ClampedArray||Array.isArray(n)&&(n[0]>1||n[0]===0)&&(n[1]>1||n[1]===0)&&(n[2]>1||n[2]===0)&&(!n[3]||n[3]>1))}}),hy=It((et,Y)=>{var f=H_();function y(z){return z?f(z):[0,0,0,1]}Y.exports=y}),dy=It((et,Y)=>{var f=Sr(),y=Xi(),z=H_(),P=ch(),n=Sn().defaultLine,i=Xn().isArrayOrTypedArray,a=z(n),l=1;function o(b,x){var _=b;return _[3]*=x,_}function c(b){if(f(b))return a;var x=z(b);return x.length?x:a}function s(b){return f(b)?b:l}function h(b,x,_){var A=b.color;A&&A._inputArray&&(A=A._inputArray);var d=i(A),k=i(x),w=P.extractOpts(b),D=[],E,I,M,p,g;if(w.colorscale!==void 0?E=P.makeColorScaleFuncFromTrace(b):E=c,d?I=function(S,N){return S[N]===void 0?a:z(E(S[N]))}:I=c,k?M=function(S,N){return S[N]===void 0?l:s(S[N])}:M=s,d||k)for(var C=0;C<_;C++)p=I(A,C),g=M(x,C),D[C]=o(p,g);else D=o(z(A),x);return D}function m(b){var x=P.extractOpts(b),_=x.colorscale;return x.reversescale&&(_=P.flipScale(x.colorscale)),_.map(function(A){var d=A[0],k=y(A[1]),w=k.toRgb();return{index:d,rgb:[w.r,w.g,w.b,w.a]}})}Y.exports={formatColor:h,parseColorScale:m}}),pD=It((et,Y)=>{Y.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}),ZC=It((et,Y)=>{Y.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),IY=It((et,Y)=>{var f=ls();function y(n,i,a,l){if(!i||!i.visible)return null;for(var o=f.getComponentMethod("errorbars","makeComputeError")(i),c=new Array(n.length),s=0;s0){var _=l.c2l(b);l._lowerLogErrorBound||(l._lowerLogErrorBound=_),l._lowerErrorBound=Math.min(l._lowerLogErrorBound,_)}}else c[s]=[-h[0]*a,h[1]*a]}return c}function z(n){for(var i=0;i{var f=Vp().gl_line3d,y=Vp().gl_scatter3d,z=Vp().gl_error3d,P=Vp().gl_mesh3d,n=Vp().delaunay_triangulate,i=jn(),a=hy(),l=dy().formatColor,o=Hv(),c=pD(),s=ZC(),h=Fs(),m=T0().appendArrayPointValue,b=IY();function x(N,B){this.scene=N,this.uid=B,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var _=x.prototype;_.handlePick=function(N){if(N.object&&(N.object===this.linePlot||N.object===this.delaunayMesh||N.object===this.textMarkers||N.object===this.scatterPlot)){var B=N.index=N.data.index;return N.object.highlight&&N.object.highlight(null),this.scatterPlot&&(N.object=this.scatterPlot,this.scatterPlot.highlight(N.data)),N.textLabel="",this.textLabels&&(i.isArrayOrTypedArray(this.textLabels)?(this.textLabels[B]||this.textLabels[B]===0)&&(N.textLabel=this.textLabels[B]):N.textLabel=this.textLabels),N.traceCoordinate=[this.data.x[B],this.data.y[B],this.data.z[B]],!0}};function A(N,B,U){var V=(U+1)%3,W=(U+2)%3,F=[],H=[],q;for(q=0;q-1?-1:N.indexOf("right")>-1?1:0}function w(N){return N==null?0:N.indexOf("top")>-1?-1:N.indexOf("bottom")>-1?1:0}function D(N){var B=0,U=0,V=[B,U];if(Array.isArray(N))for(var W=0;W=0){var tt=A(q.position,q.delaunayColor,q.delaunayAxis);tt.opacity=N.opacity,this.delaunayMesh?this.delaunayMesh.update(tt):(tt.gl=B,this.delaunayMesh=P(tt),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},_.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function S(N,B){var U=new x(N,B.uid);return U.update(B),U}Y.exports=S}),mD=It((et,Y)=>{var f=dd(),y=hi(),z=Ru(),P=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=xa(),o=pD(),c=ZC(),s=Yn().extendFlat,h=sh().overrideAll,m=Xm(),b=f.line,x=f.marker,_=x.line,A=s({width:b.width,dash:{valType:"enumerated",values:m(o),dflt:"solid"}},z("line"));function d(w){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var k=Y.exports=h({x:f.x,y:f.y,z:{valType:"data_array"},text:s({},f.text,{}),texttemplate:i(),texttemplatefallback:a({editType:"calc"}),hovertext:s({},f.hovertext,{}),hovertemplate:n(),hovertemplatefallback:a(),xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z"),mode:s({},f.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:d(),y:d(),z:d()},connectgaps:f.connectgaps,line:A,marker:s({symbol:{valType:"enumerated",values:m(c),dflt:"circle",arrayOk:!0},size:s({},x.size,{dflt:8}),sizeref:x.sizeref,sizemin:x.sizemin,sizemode:x.sizemode,opacity:s({},x.opacity,{arrayOk:!1}),colorbar:x.colorbar,line:s({width:s({},_.width,{arrayOk:!1})},z("marker.line"))},z("marker")),textposition:s({},f.textposition,{dflt:"top center"}),textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:s({},l.hoverinfo)},"calc","nested");k.x.editType=k.y.editType=k.z.editType="calc+clearAxisTypes"}),zY=It((et,Y)=>{var f=ls(),y=jn(),z=Fu(),P=Y0(),n=Lm(),i=pm(),a=mD();Y.exports=function(o,c,s,h){function m(D,E){return y.coerce(o,c,a,D,E)}var b=l(o,c,m,h);if(!b){c.visible=!1;return}m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("xhoverformat"),m("yhoverformat"),m("zhoverformat"),m("mode"),z.hasMarkers(c)&&P(o,c,s,h,m,{noSelect:!0,noAngle:!0}),z.hasLines(c)&&(m("connectgaps"),n(o,c,s,h,m)),z.hasText(c)&&(m("texttemplate"),m("texttemplatefallback"),i(o,c,h,m,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var x=(c.line||{}).color,_=(c.marker||{}).color;m("surfaceaxis")>=0&&m("surfacecolor",x||_);for(var A=["x","y","z"],d=0;d<3;++d){var k="projection."+A[d];m(k+".show")&&(m(k+".opacity"),m(k+".scale"))}var w=f.getComponentMethod("errorbars","supplyDefaults");w(o,c,x||_||s,{axis:"z"}),w(o,c,x||_||s,{axis:"y",inherit:"z"}),w(o,c,x||_||s,{axis:"x",inherit:"z"})};function l(o,c,s,h){var m=0,b=s("x"),x=s("y"),_=s("z"),A=f.getComponentMethod("calendars","handleTraceDefaults");return A(o,c,["x","y","z"],h),b&&x&&_&&(m=Math.min(b.length,x.length,_.length),c._length=c._xlength=c._ylength=c._zlength=m),m}}),OY=It((et,Y)=>{var f=ft(),y=Dm();Y.exports=function(z,P){var n=[{x:!1,y:!1,trace:P,t:{}}];return f(n,P),y(z,P),n}}),BY=It((et,Y)=>{Y.exports=f;function f(y,z){if(typeof y!="string")throw new TypeError("must specify type string");if(z=z||{},typeof document>"u"&&!z.canvas)return null;var P=z.canvas||document.createElement("canvas");typeof z.width=="number"&&(P.width=z.width),typeof z.height=="number"&&(P.height=z.height);var n=z,i;try{var a=[y];y.indexOf("webgl")===0&&a.push("experimental-"+y);for(var l=0;l{var f=BY();Y.exports=function(y){return f("webgl",y)}}),gD=It((et,Y)=>{var f=Hn(),y=function(){};Y.exports=function(z){for(var P in z)typeof z[P]=="function"&&(z[P]=y);z.destroy=function(){z.container.parentNode.removeChild(z.container)};var n=document.createElement("div");n.className="no-webgl",n.style.cursor="pointer",n.style.fontSize="24px",n.style.color=f.defaults[0],n.style.position="absolute",n.style.left=n.style.top="0px",n.style.width=n.style.height="100%",n.style["background-color"]=f.lightLine,n.style["z-index"]=30;var i=document.createElement("p");return i.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",i.style.position="relative",i.style.top="50%",i.style.left="50%",i.style.height="30%",i.style.width="50%",i.style.margin="-15% 0 0 -25%",n.appendChild(i),z.container.appendChild(n),z.container.style.background="#FFFFFF",z.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),FY=It((et,Y)=>{var f=hy(),y=jn(),z=["xaxis","yaxis","zaxis"];function P(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var n=P.prototype;n.merge=function(a,l){for(var o=this,c=0;c<3;++c){var s=l[z[c]];if(!s.visible){o.tickEnable[c]=!1,o.labelEnable[c]=!1,o.lineEnable[c]=!1,o.lineTickEnable[c]=!1,o.gridEnable[c]=!1,o.zeroEnable[c]=!1,o.backgroundEnable[c]=!1;continue}o.labels[c]=a._meta?y.templateString(s.title.text,a._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(o.labelColor[c]=f(s.title.font.color)),s.title.font.family&&(o.labelFont[c]=s.title.font.family),s.title.font.size&&(o.labelSize[c]=s.title.font.size),s.title.font.weight&&(o.labelFontWeight[c]=s.title.font.weight),s.title.font.style&&(o.labelFontStyle[c]=s.title.font.style),s.title.font.variant&&(o.labelFontVariant[c]=s.title.font.variant)),"showline"in s&&(o.lineEnable[c]=s.showline),"linecolor"in s&&(o.lineColor[c]=f(s.linecolor)),"linewidth"in s&&(o.lineWidth[c]=s.linewidth),"showgrid"in s&&(o.gridEnable[c]=s.showgrid),"gridcolor"in s&&(o.gridColor[c]=f(s.gridcolor)),"gridwidth"in s&&(o.gridWidth[c]=s.gridwidth),s.type==="log"?o.zeroEnable[c]=!1:"zeroline"in s&&(o.zeroEnable[c]=s.zeroline),"zerolinecolor"in s&&(o.zeroLineColor[c]=f(s.zerolinecolor)),"zerolinewidth"in s&&(o.zeroLineWidth[c]=s.zerolinewidth),"ticks"in s&&s.ticks?o.lineTickEnable[c]=!0:o.lineTickEnable[c]=!1,"ticklen"in s&&(o.lineTickLength[c]=o._defaultLineTickLength[c]=s.ticklen),"tickcolor"in s&&(o.lineTickColor[c]=f(s.tickcolor)),"tickwidth"in s&&(o.lineTickWidth[c]=s.tickwidth),"tickangle"in s&&(o.tickAngle[c]=s.tickangle==="auto"?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(o.tickEnable[c]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(o.tickColor[c]=f(s.tickfont.color)),s.tickfont.family&&(o.tickFont[c]=s.tickfont.family),s.tickfont.size&&(o.tickSize[c]=s.tickfont.size),s.tickfont.weight&&(o.tickFontWeight[c]=s.tickfont.weight),s.tickfont.style&&(o.tickFontStyle[c]=s.tickfont.style),s.tickfont.variant&&(o.tickFontVariant[c]=s.tickfont.variant)),"mirror"in s?["ticks","all","allticks"].indexOf(s.mirror)!==-1?(o.lineTickMirror[c]=!0,o.lineMirror[c]=!0):s.mirror===!0?(o.lineTickMirror[c]=!1,o.lineMirror[c]=!0):(o.lineTickMirror[c]=!1,o.lineMirror[c]=!1):o.lineMirror[c]=!1,"showbackground"in s&&s.showbackground!==!1?(o.backgroundEnable[c]=!0,o.backgroundColor[c]=f(s.backgroundcolor)):o.backgroundEnable[c]=!1}};function i(a,l){var o=new P;return o.merge(a,l),o}Y.exports=i}),NY=It((et,Y)=>{var f=hy(),y=["xaxis","yaxis","zaxis"];function z(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var P=z.prototype;P.merge=function(i){for(var a=0;a<3;++a){var l=i[y[a]];if(!l.visible){this.enabled[a]=!1,this.drawSides[a]=!1;continue}this.enabled[a]=l.showspikes,this.colors[a]=f(l.spikecolor),this.drawSides[a]=l.spikesides,this.lineWidth[a]=l.spikethickness}};function n(i){var a=new z;return a.merge(i),a}Y.exports=n}),jY=It((et,Y)=>{Y.exports=n;var f=Fs(),y=jn(),z=["xaxis","yaxis","zaxis"];function P(i){for(var a=new Array(3),l=0;l<3;++l){for(var o=i[l],c=new Array(o.length),s=0;s/g," "));c[s]=x,h.tickmode=m}}a.ticks=c;for(var s=0;s<3;++s){.5*(i.glplot.bounds[0][s]+i.glplot.bounds[1][s]);for(var _=0;_<2;++_)a.bounds[_][s]=i.glplot.bounds[_][s]}i.contourLevels=P(c)}}),UY=It((et,Y)=>{var f=Vp().gl_plot3d,y=f.createCamera,z=f.createScene,P=RY(),n=dw(),i=ls(),a=jn(),l=a.preserveDrawingBuffer(),o=Fs(),c=hd(),s=hy(),h=gD(),m=DL(),b=FY(),x=NY(),_=jY(),A=Jm().applyAutorangeOptions,d,k,w=!1;function D(U,V){var W=document.createElement("div"),F=U.container;this.graphDiv=U.graphDiv;var H=document.createElementNS("http://www.w3.org/2000/svg","svg");H.style.position="absolute",H.style.top=H.style.left="0px",H.style.width=H.style.height="100%",H.style["z-index"]=20,H.style["pointer-events"]="none",W.appendChild(H),this.svgContainer=H,W.id=U.id,W.style.position="absolute",W.style.top=W.style.left="0px",W.style.width=W.style.height="100%",F.appendChild(W),this.fullLayout=V,this.id=U.id||"scene",this.fullSceneLayout=V[this.id],this.plotArgs=[[],{},{}],this.axesOptions=b(V,V[this.id]),this.spikeOptions=x(V[this.id]),this.container=W,this.staticMode=!!U.staticPlot,this.pixelRatio=this.pixelRatio||U.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=i.getComponentMethod("annotations3d","convert"),this.drawAnnotations=i.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var E=D.prototype;E.prepareOptions=function(){var U=this,V={canvas:U.canvas,gl:U.gl,glOptions:{preserveDrawingBuffer:l,premultipliedAlpha:!0,antialias:!0},container:U.container,axes:U.axesOptions,spikes:U.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:U.camera,pixelRatio:U.pixelRatio};if(U.staticMode){if(!k&&(d=document.createElement("canvas"),k=P({canvas:d,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!k))throw new Error("error creating static canvas/context for image server");V.gl=k,V.canvas=d}return V};var I=!0;E.tryCreatePlot=function(){var U=this,V=U.prepareOptions(),W=!0;try{U.glplot=z(V)}catch{if(U.staticMode||!I||l)W=!1;else{a.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{l=V.glOptions.preserveDrawingBuffer=!0,U.glplot=z(V)}catch{l=V.glOptions.preserveDrawingBuffer=!1,W=!1}}}return I=!1,W},E.initializeGLCamera=function(){var U=this,V=U.fullSceneLayout.camera,W=V.projection.type==="orthographic";U.camera=y(U.container,{center:[V.center.x,V.center.y,V.center.z],eye:[V.eye.x,V.eye.y,V.eye.z],up:[V.up.x,V.up.y,V.up.z],_ortho:W,zoomMin:.01,zoomMax:100,mode:"orbit"})},E.initializeGLPlot=function(){var U=this;U.initializeGLCamera();var V=U.tryCreatePlot();if(!V)return h(U);U.traces={},U.make4thDimension();var W=U.graphDiv,F=W.layout,H=function(){var G={};return U.isCameraChanged(F)&&(G[U.id+".camera"]=U.getCamera()),U.isAspectChanged(F)&&(G[U.id+".aspectratio"]=U.glplot.getAspectratio(),F[U.id].aspectmode!=="manual"&&(U.fullSceneLayout.aspectmode=F[U.id].aspectmode=G[U.id+".aspectmode"]="manual")),G},q=function(G){if(G.fullSceneLayout.dragmode!==!1){var tt=H();G.saveLayout(F),G.graphDiv.emit("plotly_relayout",tt)}};return U.glplot.canvas&&(U.glplot.canvas.addEventListener("mouseup",function(){q(U)}),U.glplot.canvas.addEventListener("touchstart",function(){w=!0}),U.glplot.canvas.addEventListener("wheel",function(G){if(W._context._scrollZoom.gl3d){if(U.camera._ortho){var tt=G.deltaX>G.deltaY?1.1:.9090909090909091,ht=U.glplot.getAspectratio();U.glplot.setAspectratio({x:tt*ht.x,y:tt*ht.y,z:tt*ht.z})}q(U)}},n?{passive:!1}:!1),U.glplot.canvas.addEventListener("mousemove",function(){if(U.fullSceneLayout.dragmode!==!1&&U.camera.mouseListener.buttons!==0){var G=H();U.graphDiv.emit("plotly_relayouting",G)}}),U.staticMode||U.glplot.canvas.addEventListener("webglcontextlost",function(G){W&&W.emit&&W.emit("plotly_webglcontextlost",{event:G,layer:U.id})},!1)),U.glplot.oncontextloss=function(){U.recoverContext()},U.glplot.onrender=function(){U.render()},!0},E.render=function(){var U=this,V=U.graphDiv,W,F=U.svgContainer,H=U.container.getBoundingClientRect();V._fullLayout._calcInverseTransform(V);var q=V._fullLayout._invScaleX,G=V._fullLayout._invScaleY,tt=H.width*q,ht=H.height*G;F.setAttributeNS(null,"viewBox","0 0 "+tt+" "+ht),F.setAttributeNS(null,"width",tt),F.setAttributeNS(null,"height",ht),_(U),U.glplot.axes.update(U.axesOptions);for(var bt=Object.keys(U.traces),vt=null,ut=U.glplot.selection,rt=0;rt")):W.type==="isosurface"||W.type==="volume"?(ot.valueLabel=o.hoverLabelText(U._mockAxis,U._mockAxis.d2l(ut.traceCoordinate[3]),W.valuehoverformat),Rt.push("value: "+ot.valueLabel),ut.textLabel&&Rt.push(ut.textLabel),Ct=Rt.join("
")):Ct=ut.textLabel;var Bt={x:ut.traceCoordinate[0],y:ut.traceCoordinate[1],z:ut.traceCoordinate[2],data:st._input,fullData:st,curveNumber:st.index,pointNumber:xt};c.appendArrayPointValue(Bt,st,xt),W._module.eventData&&(Bt=st._module.eventData(Bt,ut,st,{},xt));var Zt={points:[Bt]};if(U.fullSceneLayout.hovermode){var Gt=[];c.loneHover({trace:st,x:(.5+.5*it[0]/it[3])*tt,y:(.5-.5*it[1]/it[3])*ht,xLabel:ot.xLabel,yLabel:ot.yLabel,zLabel:ot.zLabel,text:Ct,name:vt.name,color:c.castHoverOption(st,xt,"bgcolor")||vt.color,borderColor:c.castHoverOption(st,xt,"bordercolor"),fontFamily:c.castHoverOption(st,xt,"font.family"),fontSize:c.castHoverOption(st,xt,"font.size"),fontColor:c.castHoverOption(st,xt,"font.color"),nameLength:c.castHoverOption(st,xt,"namelength"),textAlign:c.castHoverOption(st,xt,"align"),hovertemplate:a.castOption(st,xt,"hovertemplate"),hovertemplateLabels:a.extendFlat({},Bt,ot),eventData:[Bt]},{container:F,gd:V,inOut_bbox:Gt}),Bt.bbox=Gt[0]}ut.distance<5&&(ut.buttons||w)?V.emit("plotly_click",Zt):V.emit("plotly_hover",Zt),this.oldEventData=Zt}else c.loneUnhover(F),this.oldEventData&&V.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;U.drawAnnotations(U)},E.recoverContext=function(){var U=this;U.glplot.dispose();var V=function(){if(U.glplot.gl.isContextLost()){requestAnimationFrame(V);return}if(!U.initializeGLPlot()){a.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}U.plot.apply(U,U.plotArgs)};requestAnimationFrame(V)};var M=["xaxis","yaxis","zaxis"];function p(U,V,W){for(var F=U.fullSceneLayout,H=0;H<3;H++){var q=M[H],G=q.charAt(0),tt=F[q],ht=V[G],bt=V[G+"calendar"],vt=V["_"+G+"length"];if(!a.isArrayOrTypedArray(ht))W[0][H]=Math.min(W[0][H],0),W[1][H]=Math.max(W[1][H],vt-1);else for(var ut,rt=0;rt<(vt||ht.length);rt++)if(a.isArrayOrTypedArray(ht[rt]))for(var gt=0;gtst[1][G])st[0][G]=-1,st[1][G]=1;else{var xe=st[1][G]-st[0][G];st[0][G]-=xe/32,st[1][G]+=xe/32}if(J=[st[0][G],st[1][G]],J=A(J,ht),st[0][G]=J[0],st[1][G]=J[1],ht.isReversed()){var ge=st[0][G];st[0][G]=st[1][G],st[1][G]=ge}}else J=ht.range,st[0][G]=ht.r2l(J[0]),st[1][G]=ht.r2l(J[1]);st[0][G]===st[1][G]&&(st[0][G]-=1,st[1][G]+=1),xt[G]=st[1][G]-st[0][G],ht.range=[st[0][G],st[1][G]],ht.limitRange(),F.glplot.setBounds(G,{min:ht.range[0]*gt[G],max:ht.range[1]*gt[G]})}var ye,ue=vt.aspectmode;if(ue==="cube")ye=[1,1,1];else if(ue==="manual"){var Mt=vt.aspectratio;ye=[Mt.x,Mt.y,Mt.z]}else if(ue==="auto"||ue==="data"){var Ot=[1,1,1];for(G=0;G<3;++G){ht=vt[M[G]],bt=ht.type;var Lt=ot[bt];Ot[G]=Math.pow(Lt.acc,1/Lt.count)/gt[G]}ue==="data"||Math.max.apply(null,Ot)/Math.min.apply(null,Ot)<=4?ye=Ot:ye=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");vt.aspectratio.x=ut.aspectratio.x=ye[0],vt.aspectratio.y=ut.aspectratio.y=ye[1],vt.aspectratio.z=ut.aspectratio.z=ye[2],F.glplot.setAspectratio(vt.aspectratio),F.viewInitial.aspectratio||(F.viewInitial.aspectratio={x:vt.aspectratio.x,y:vt.aspectratio.y,z:vt.aspectratio.z}),F.viewInitial.aspectmode||(F.viewInitial.aspectmode=vt.aspectmode);var ie=vt.domain||null,be=V._size||null;if(ie&&be){var ce=F.container.style;ce.position="absolute",ce.left=be.l+ie.x[0]*be.w+"px",ce.top=be.t+(1-ie.y[1])*be.h+"px",ce.width=be.w*(ie.x[1]-ie.x[0])+"px",ce.height=be.h*(ie.y[1]-ie.y[0])+"px"}F.glplot.redraw()}},E.destroy=function(){var U=this;U.glplot&&(U.camera.mouseListener.enabled=!1,U.container.removeEventListener("wheel",U.camera.wheelListener),U.camera=null,U.glplot.dispose(),U.container.parentNode.removeChild(U.container),U.glplot=null)};function C(U){return[[U.eye.x,U.eye.y,U.eye.z],[U.center.x,U.center.y,U.center.z],[U.up.x,U.up.y,U.up.z]]}function S(U){return{up:{x:U.up[0],y:U.up[1],z:U.up[2]},center:{x:U.center[0],y:U.center[1],z:U.center[2]},eye:{x:U.eye[0],y:U.eye[1],z:U.eye[2]},projection:{type:U._ortho===!0?"orthographic":"perspective"}}}E.getCamera=function(){var U=this;return U.camera.view.recalcMatrix(U.camera.view.lastT()),S(U.camera)},E.setViewport=function(U){var V=this,W=U.camera;V.camera.lookAt.apply(this,C(W)),V.glplot.setAspectratio(U.aspectratio);var F=W.projection.type==="orthographic",H=V.camera._ortho;F!==H&&(V.glplot.redraw(),V.glplot.clearRGBA(),V.glplot.dispose(),V.initializeGLPlot())},E.isCameraChanged=function(U){var V=this,W=V.getCamera(),F=a.nestedProperty(U,V.id+".camera"),H=F.get();function q(bt,vt,ut,rt){var gt=["up","center","eye"],it=["x","y","z"];return vt[gt[ut]]&&bt[gt[ut]][it[rt]]===vt[gt[ut]][it[rt]]}var G=!1;if(H===void 0)G=!0;else{for(var tt=0;tt<3;tt++)for(var ht=0;ht<3;ht++)if(!q(W,H,tt,ht)){G=!0;break}(!H.projection||W.projection&&W.projection.type!==H.projection.type)&&(G=!0)}return G},E.isAspectChanged=function(U){var V=this,W=V.glplot.getAspectratio(),F=a.nestedProperty(U,V.id+".aspectratio"),H=F.get();return H===void 0||H.x!==W.x||H.y!==W.y||H.z!==W.z},E.saveLayout=function(U){var V=this,W=V.fullLayout,F,H,q,G,tt,ht,bt=V.isCameraChanged(U),vt=V.isAspectChanged(U),ut=bt||vt;if(ut){var rt={};if(bt&&(F=V.getCamera(),H=a.nestedProperty(U,V.id+".camera"),q=H.get(),rt[V.id+".camera"]=q),vt&&(G=V.glplot.getAspectratio(),tt=a.nestedProperty(U,V.id+".aspectratio"),ht=tt.get(),rt[V.id+".aspectratio"]=ht),i.call("_storeDirectGUIEdit",U,W._preGUI,rt),bt){H.set(F);var gt=a.nestedProperty(W,V.id+".camera");gt.set(F)}if(vt){tt.set(G);var it=a.nestedProperty(W,V.id+".aspectratio");it.set(G),V.glplot.redraw()}}return ut},E.updateFx=function(U,V){var W=this,F=W.camera;if(F)if(U==="orbit")F.mode="orbit",F.keyBindingMode="rotate";else if(U==="turntable"){F.up=[0,0,1],F.mode="turntable",F.keyBindingMode="rotate";var H=W.graphDiv,q=H._fullLayout,G=W.fullSceneLayout.camera,tt=G.up.x,ht=G.up.y,bt=G.up.z;if(bt/Math.sqrt(tt*tt+ht*ht+bt*bt)<.999){var vt=W.id+".camera.up",ut={x:0,y:0,z:1},rt={};rt[vt]=ut;var gt=H.layout;i.call("_storeDirectGUIEdit",gt,q._preGUI,rt),G.up=ut,a.nestedProperty(gt,vt).set(ut)}}else F.keyBindingMode=U;W.fullSceneLayout.hovermode=V};function N(U,V,W){for(var F=0,H=W-1;F0)for(var tt=255/G,ht=0;ht<3;++ht)U[q+ht]=Math.min(tt*U[q+ht],255)}}E.toImage=function(U){var V=this;U||(U="png"),V.staticMode&&V.container.appendChild(d),V.glplot.redraw();var W=V.glplot.gl,F=W.drawingBufferWidth,H=W.drawingBufferHeight;W.bindFramebuffer(W.FRAMEBUFFER,null);var q=new Uint8Array(F*H*4);W.readPixels(0,0,F,H,W.RGBA,W.UNSIGNED_BYTE,q),N(q,F,H),B(q,F,H);var G=document.createElement("canvas");G.width=F,G.height=H;var tt=G.getContext("2d",{willReadFrequently:!0}),ht=tt.createImageData(F,H);ht.data.set(q),tt.putImageData(ht,0,0);var bt;switch(U){case"jpeg":bt=G.toDataURL("image/jpeg");break;case"webp":bt=G.toDataURL("image/webp");break;default:bt=G.toDataURL("image/png")}return V.staticMode&&V.container.removeChild(d),bt},E.setConvert=function(){for(var U=this,V=0;V<3;V++){var W=U.fullSceneLayout[M[V]];o.setConvert(W,U.fullLayout),W.setScale=a.noop}},E.make4thDimension=function(){var U=this,V=U.graphDiv,W=V._fullLayout;U._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(U._mockAxis,W)},Y.exports=D}),$Y=It((et,Y)=>{Y.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),vD=It((et,Y)=>{var f=Hn(),y=Gf(),z=Yn().extendFlat,P=sh().overrideAll;Y.exports=P({visible:y.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:f.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:y.color,categoryorder:y.categoryorder,categoryarray:y.categoryarray,title:{text:y.title.text,font:y.title.font},type:z({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorange:y.autorange,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},rangemode:y.rangemode,minallowed:y.minallowed,maxallowed:y.maxallowed,range:z({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,mirror:y.mirror,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,tickfont:y.tickfont,tickangle:y.tickangle,tickprefix:y.tickprefix,showtickprefix:y.showtickprefix,ticksuffix:y.ticksuffix,showticksuffix:y.showticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickformat:y.tickformat,tickformatstops:y.tickformatstops,hoverformat:y.hoverformat,showline:y.showline,linecolor:y.linecolor,linewidth:y.linewidth,showgrid:y.showgrid,gridcolor:z({},y.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:y.gridwidth,zeroline:y.zeroline,zerolinecolor:y.zerolinecolor,zerolinewidth:y.zerolinewidth},"plot","from-root")}),yD=It((et,Y)=>{var f=vD(),y=Jh().attributes,z=Yn().extendFlat,P=jn().counterRegex;function n(i,a,l){return{x:{valType:"number",dflt:i,editType:"camera"},y:{valType:"number",dflt:a,editType:"camera"},z:{valType:"number",dflt:l,editType:"camera"},editType:"camera"}}Y.exports={_arrayAttrRegexps:[P("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:z(n(0,0,1),{}),center:z(n(0,0,0),{}),eye:z(n(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:y({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:f,yaxis:f,zaxis:f,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),HY=It((et,Y)=>{var f=Xi().mix,y=jn(),z=Tc(),P=vD(),n=c0(),i=pb(),a=["xaxis","yaxis","zaxis"],l=13600/187;Y.exports=function(o,c,s){var h,m;function b(A,d){return y.coerce(h,m,P,A,d)}for(var x=0;x{var f=jn(),y=Hn(),z=ls(),P=O_(),n=HY(),i=yD(),a=Mf().getSubplotData,l="gl3d";Y.exports=function(c,s,h){var m=s._basePlotModules.length>1;function b(x){if(!m){var _=f.validate(c[x],i[x]);if(_)return c[x]}}P(c,s,h,{type:l,attributes:i,handleDefaults:o,fullLayout:s,font:s.font,fullData:h,getDfltFromLayout:b,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function o(c,s,h,m){for(var b=h("bgcolor"),x=y.combine(b,m.paper_bgcolor),_=["up","center","eye"],A=0;A<_.length;A++)h("camera."+_[A]+".x"),h("camera."+_[A]+".y"),h("camera."+_[A]+".z");h("camera.projection.type");var d=!!h("aspectratio.x")&&!!h("aspectratio.y")&&!!h("aspectratio.z"),k=d?"manual":"auto",w=h("aspectmode",k);d||(c.aspectratio=s.aspectratio={x:1,y:1,z:1},w==="manual"&&(s.aspectmode="auto"),c.aspectmode=s.aspectmode);var D=a(m.fullData,l,m.id);n(c,s,{font:m.font,scene:m.id,data:D,bgColor:x,calendar:m.calendar,autotypenumbersDflt:m.autotypenumbersDflt,fullLayout:m.fullLayout}),z.getComponentMethod("annotations3d","handleDefaults")(c,s,m);var E=m.getDfltFromLayout("dragmode");if(E!==!1&&!E)if(E="orbit",c.camera&&c.camera.up){var I=c.camera.up.x,M=c.camera.up.y,p=c.camera.up.z;p!==0&&(!I||!M||!p||p/Math.sqrt(I*I+M*M+p*p)>.999)&&(E="turntable")}else E="turntable";h("dragmode",E),h("hovermode",m.getDfltFromLayout("hovermode"))}}),V_=It(et=>{var Y=sh().overrideAll,f=io(),y=UY(),z=Mf().getSubplotData,P=jn(),n=k0(),i="gl3d",a="scene";et.name=i,et.attr=a,et.idRoot=a,et.idRegex=et.attrRegex=P.counterRegex("scene"),et.attributes=$Y(),et.layoutAttributes=yD(),et.baseLayoutAttrOverrides=Y({hoverlabel:f.hoverlabel},"plot","nested"),et.supplyLayoutDefaults=VY(),et.plot=function(l){for(var o=l._fullLayout,c=l._fullData,s=o._subplots[i],h=0;h{Y.exports={plot:DY(),attributes:mD(),markerSymbols:ZC(),supplyDefaults:zY(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:OY(),moduleType:"trace",name:"scatter3d",basePlotModule:V_(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),qY=It((et,Y)=>{Y.exports=WY()}),Ak=It((et,Y)=>{var f=Hn(),y=Ru(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=xa(),a=Yn().extendFlat,l=sh().overrideAll;function o(h){return{valType:"boolean",dflt:!1}}function c(h){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:o(),y:o(),z:o()},color:{valType:"color",dflt:f.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:f.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var s=Y.exports=l(a({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:P(),hovertemplatefallback:n(),xhoverformat:z("x"),yhoverformat:z("y"),zhoverformat:z("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},y("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05,description:"Represents the level that incident rays are reflected in a single direction, causing shine."},roughness:{valType:"number",min:0,max:1,dflt:.5,description:"Alters specular reflection; the rougher the surface, the wider and less contrasty the shine."},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:a({},i.hoverinfo),showlegend:a({},i.showlegend,{dflt:!1})}),"calc","nested");s.x.editType=s.y.editType=s.z.editType="calc+clearAxisTypes"}),_D=It((et,Y)=>{var f=ls(),y=jn(),z=Cu(),P=Ak(),n=.1;function i(c,s){for(var h=[],m=32,b=0;b{var f=Cp();Y.exports=function(y,z){z.surfacecolor?f(y,z,{vals:z.surfacecolor,containerStr:"",cLetter:"c"}):f(y,z,{vals:z.z,containerStr:"",cLetter:"c"})}}),ZY=It((et,Y)=>{var f=Vp().gl_surface3d,y=Vp().ndarray,z=Vp().ndarray_linear_interpolate.d2,P=V8(),n=W8(),i=jn().isArrayOrTypedArray,a=dy().parseColorScale,l=hy(),o=ch().extractOpts;function c(C,S,N){this.scene=C,this.uid=N,this.surface=S,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var s=c.prototype;s.getXat=function(C,S,N,B){var U=i(this.data.x)?i(this.data.x[0])?this.data.x[S][C]:this.data.x[C]:C;return N===void 0?U:B.d2l(U,0,N)},s.getYat=function(C,S,N,B){var U=i(this.data.y)?i(this.data.y[0])?this.data.y[S][C]:this.data.y[S]:S;return N===void 0?U:B.d2l(U,0,N)},s.getZat=function(C,S,N,B){var U=this.data.z[S][C];return U===null&&this.data.connectgaps&&this.data._interpolatedZ&&(U=this.data._interpolatedZ[S][C]),N===void 0?U:B.d2l(U,0,N)},s.handlePick=function(C){if(C.object===this.surface){var S=(C.data.index[0]-1)/this.dataScaleX-1,N=(C.data.index[1]-1)/this.dataScaleY-1,B=Math.max(Math.min(Math.round(S),this.data.z[0].length-1),0),U=Math.max(Math.min(Math.round(N),this.data._ylength-1),0);C.index=[B,U],C.traceCoordinate=[this.getXat(B,U),this.getYat(B,U),this.getZat(B,U)],C.dataCoordinate=[this.getXat(B,U,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(B,U,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(B,U,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var V=0;V<3;V++){var W=C.dataCoordinate[V];W!=null&&(C.dataCoordinate[V]*=this.scene.dataScale[V])}var F=this.data.hovertext||this.data.text;return i(F)&&F[U]&&F[U][B]!==void 0?C.textLabel=F[U][B]:F?C.textLabel=F:C.textLabel="",C.data.dataCoordinate=C.dataCoordinate.slice(),this.surface.highlight(C.data),this.scene.glplot.spikes.position=C.dataCoordinate,!0}};function h(C){var S=C[0].rgb,N=C[C.length-1].rgb;return S[0]===N[0]&&S[1]===N[1]&&S[2]===N[2]&&S[3]===N[3]}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function b(C,S){if(C0){N=m[B];break}return N}function A(C,S){if(!(C<1||S<1)){for(var N=x(C),B=x(S),U=1,V=0;VD;)B--,B/=_(B),B++,B1?U:1};function E(C,S,N){var B=N[8]+N[2]*S[0]+N[5]*S[1];return C[0]=(N[6]+N[0]*S[0]+N[3]*S[1])/B,C[1]=(N[7]+N[1]*S[0]+N[4]*S[1])/B,C}function I(C,S,N){return M(C,S,E,N),C}function M(C,S,N,B){for(var U=[0,0],V=C.shape[0],W=C.shape[1],F=0;F0&&this.contourStart[B]!==null&&this.contourEnd[B]!==null&&this.contourEnd[B]>this.contourStart[B]))for(S[B]=!0,U=this.contourStart[B];Uht&&(this.minValues[q]=ht),this.maxValues[q]{Y.exports={attributes:Ak(),supplyDefaults:_D().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:GY(),plot:ZY(),moduleType:"trace",name:"surface",basePlotModule:V_(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),YY=It((et,Y)=>{Y.exports=KY()}),Gw=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Ak(),i=xa(),a=Yn().extendFlat;Y.exports=a({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"}),hovertemplatefallback:P({editType:"calc"}),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},f("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:n.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:a({},n.contours.x.show,{}),color:n.contours.x.color,width:n.contours.x.width,editType:"calc"},lightposition:{x:a({},n.lightposition.x,{dflt:1e5}),y:a({},n.lightposition.y,{dflt:1e5}),z:a({},n.lightposition.z,{dflt:0}),editType:"calc"},lighting:a({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc",description:"Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry."},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc",description:"Epsilon for face normals calculation avoids math issues arising from degenerate geometry."},editType:"calc"},n.lighting),hoverinfo:a({},i.hoverinfo,{editType:"calc"}),showlegend:a({},i.showlegend,{dflt:!1})})}),KC=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Gw(),i=xa(),a=Yn().extendFlat,l=sh().overrideAll;function o(h){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function c(h){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var s=Y.exports=l(a({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:o(),y:o(),z:o()},caps:{x:c(),y:c(),z:c()},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:z(),hovertemplatefallback:P(),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),valuehoverformat:y("value",1),showlegend:a({},i.showlegend,{dflt:!1})},f("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:n.opacity,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:a({},i.hoverinfo)}),"calc","nested");s.flatshading.dflt=!0,s.lighting.facenormalsepsilon.dflt=0,s.x.editType=s.y.editType=s.z.editType=s.value.editType="calc+clearAxisTypes"}),xD=It((et,Y)=>{var f=jn(),y=ls(),z=KC(),P=Cu();function n(a,l,o,c){function s(h,m){return f.coerce(a,l,z,h,m)}i(a,l,o,c,s)}function i(a,l,o,c,s){var h=s("isomin"),m=s("isomax");m!=null&&h!==void 0&&h!==null&&h>m&&(l.isomin=null,l.isomax=null);var b=s("x"),x=s("y"),_=s("z"),A=s("value");if(!b||!b.length||!x||!x.length||!_||!_.length||!A||!A.length){l.visible=!1;return}var d=y.getComponentMethod("calendars","handleTraceDefaults");d(a,l,["x","y","z"],c),s("valuehoverformat"),["x","y","z"].forEach(function(E){s(E+"hoverformat");var I="caps."+E,M=s(I+".show");M&&s(I+".fill");var p="slices."+E,g=s(p+".show");g&&(s(p+".fill"),s(p+".locations"))});var k=s("spaceframe.show");k&&s("spaceframe.fill");var w=s("surface.show");w&&(s("surface.count"),s("surface.fill"),s("surface.pattern"));var D=s("contour.show");D&&(s("contour.color"),s("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(E){s(E)}),P(a,l,c,s,{prefix:"",cLetter:"c"}),l._length=null}Y.exports={supplyDefaults:n,supplyIsoDefaults:i}}),YC=It((et,Y)=>{var f=jn(),y=Cp();function z(a,l){l._len=Math.min(l.u.length,l.v.length,l.w.length,l.x.length,l.y.length,l.z.length),l._u=i(l.u,l._len),l._v=i(l.v,l._len),l._w=i(l.w,l._len),l._x=i(l.x,l._len),l._y=i(l.y,l._len),l._z=i(l.z,l._len);var o=P(l);l._gridFill=o.fill,l._Xs=o.Xs,l._Ys=o.Ys,l._Zs=o.Zs,l._len=o.len;var c=0,s,h,m;l.starts&&(s=i(l.starts.x||[]),h=i(l.starts.y||[]),m=i(l.starts.z||[]),c=Math.min(s.length,h.length,m.length)),l._startsX=s||[],l._startsY=h||[],l._startsZ=m||[];var b=0,x=1/0,_;for(_=0;_1&&(g=l[s-1],S=o[s-1],B=c[s-1]),h=0;hg?"-":"+")+"x"),D=D.replace("y",(C>S?"-":"+")+"y"),D=D.replace("z",(N>B?"-":"+")+"z");var F=function(){s=0,U=[],V=[],W=[]};(!s||s{var f=Cp(),y=YC().processGrid,z=YC().filter;Y.exports=function(P,n){n._len=Math.min(n.x.length,n.y.length,n.z.length,n.value.length),n._x=z(n.x,n._len),n._y=z(n.y,n._len),n._z=z(n.z,n._len),n._value=z(n.value,n._len);var i=y(n);n._gridFill=i.fill,n._Xs=i.Xs,n._Ys=i.Ys,n._Zs=i.Zs,n._len=i.len;for(var a=1/0,l=-1/0,o=0;o{Y.exports=function(f,y,z,P){P=P||f.length;for(var n=new Array(P),i=0;i{var f=Vp().gl_mesh3d,y=dy().parseColorScale,z=jn().isArrayOrTypedArray,P=hy(),n=ch().extractOpts,i=Zw(),a=function(m,b){for(var x=b.length-1;x>0;x--){var _=Math.min(b[x],b[x-1]),A=Math.max(b[x],b[x-1]);if(A>_&&_-1}function mt(Oe,Xt){return Oe===null?Xt:Oe}function dt(Oe,Xt,oe){bt();var zt=[Xt],_t=[oe];if(st>=1)zt=[Xt],_t=[oe];else if(st>0){var Pt=ot(Xt,oe);zt=Pt.xyzv,_t=Pt.abc}for(var Ht=0;Ht-1?oe[he]:ht(Me,qe,Ye);Rr>-1?ae[he]=Rr:ae[he]=ut(Me,qe,Ye,mt(Oe,ur))}rt(ae[0],ae[1],ae[2])}}function Ct(Oe,Xt,oe){var zt=function(_t,Pt,Ht){dt(Oe,[Xt[_t],Xt[Pt],Xt[Ht]],[oe[_t],oe[Pt],oe[Ht]])};zt(0,1,2),zt(2,3,0)}function Rt(Oe,Xt,oe){var zt=function(_t,Pt,Ht){dt(Oe,[Xt[_t],Xt[Pt],Xt[Ht]],[oe[_t],oe[Pt],oe[Ht]])};zt(0,1,2),zt(3,0,1),zt(2,3,0),zt(1,2,3)}function Bt(Oe,Xt,oe,zt){var _t=Oe[3];_tzt&&(_t=zt);for(var Pt=(Oe[3]-_t)/(Oe[3]-Xt[3]+1e-9),Ht=[],ae=0;ae<4;ae++)Ht[ae]=(1-Pt)*Oe[ae]+Pt*Xt[ae];return Ht}function Zt(Oe,Xt,oe){return Oe>=Xt&&Oe<=oe}function Gt(Oe){var Xt=.001*(F-W);return Oe>=W-Xt&&Oe<=F+Xt}function ee(Oe){for(var Xt=[],oe=0;oe<4;oe++){var zt=Oe[oe];Xt.push([m._x[zt],m._y[zt],m._z[zt],m._value[zt]])}return Xt}var xe=3;function ge(Oe,Xt,oe,zt,_t,Pt){Pt||(Pt=1),oe=[-1,-1,-1];var Ht=!1,ae=[Zt(Xt[0][3],zt,_t),Zt(Xt[1][3],zt,_t),Zt(Xt[2][3],zt,_t)];if(!ae[0]&&!ae[1]&&!ae[2])return!1;var he=function(qe,Ye,ur){return Gt(Ye[0][3])&&Gt(Ye[1][3])&&Gt(Ye[2][3])?(dt(qe,Ye,ur),!0):Ptae?[U,Pt]:[Pt,V];mr(Xt,he[0],he[1])}}var Me=[[Math.min(W,V),Math.max(W,V)],[Math.min(U,F),Math.max(U,F)]];["x","y","z"].forEach(function(qe){for(var Ye=[],ur=0;ur0&&(ui.push(Ci.id),qe==="x"?yi.push([Ci.distRatio,0,0]):qe==="y"?yi.push([0,Ci.distRatio,0]):yi.push([0,0,Ci.distRatio]))}else qe==="x"?ci=Er(1,g-1):qe==="y"?ci=Er(1,C-1):ci=Er(1,S-1);ui.length>0&&(qe==="x"?Ye[Rr]=fr(Oe,ui,zr,xr,yi,Ye[Rr]):qe==="y"?Ye[Rr]=Jr(Oe,ui,zr,xr,yi,Ye[Rr]):Ye[Rr]=an(Oe,ui,zr,xr,yi,Ye[Rr]),Rr++),ci.length>0&&(qe==="x"?Ye[Rr]=be(Oe,ci,zr,xr,Ye[Rr]):qe==="y"?Ye[Rr]=ce(Oe,ci,zr,xr,Ye[Rr]):Ye[Rr]=Le(Oe,ci,zr,xr,Ye[Rr]),Rr++)}var fi=m.caps[qe];fi.show&&fi.fill&&(xt(fi.fill),qe==="x"?Ye[Rr]=be(Oe,[0,g-1],zr,xr,Ye[Rr]):qe==="y"?Ye[Rr]=ce(Oe,[0,C-1],zr,xr,Ye[Rr]):Ye[Rr]=Le(Oe,[0,S-1],zr,xr,Ye[Rr]),Rr++)}}),w===0&&vt(),m._meshX=H,m._meshY=q,m._meshZ=G,m._meshIntensity=tt,m._Xs=I,m._Ys=M,m._Zs=p}return _n(),m}function h(m,b){var x=m.glplot.gl,_=f({gl:x}),A=new l(m,_,b.uid);return _._trace=A,A.update(b),m.glplot.add(_),A}Y.exports={findNearestOnAxis:a,generateIsoMeshes:s,createIsosurfaceTrace:h}}),XY=It((et,Y)=>{Y.exports={attributes:KC(),supplyDefaults:xD().supplyDefaults,calc:bD(),colorbar:{min:"cmin",max:"cmax"},plot:XC().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:V_(),categories:["gl3d","showLegend"],meta:{}}}),JY=It((et,Y)=>{Y.exports=XY()}),wD=It((et,Y)=>{var f=Ru(),y=KC(),z=Ak(),P=xa(),n=Yn().extendFlat,i=sh().overrideAll,a=Y.exports=i(n({x:y.x,y:y.y,z:y.z,value:y.value,isomin:y.isomin,isomax:y.isomax,surface:y.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:y.slices,caps:y.caps,text:y.text,hovertext:y.hovertext,xhoverformat:y.xhoverformat,yhoverformat:y.yhoverformat,zhoverformat:y.zhoverformat,valuehoverformat:y.valuehoverformat,hovertemplate:y.hovertemplate,hovertemplatefallback:y.hovertemplatefallback},f("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:y.colorbar,opacity:y.opacity,opacityscale:z.opacityscale,lightposition:y.lightposition,lighting:y.lighting,flatshading:y.flatshading,contour:y.contour,hoverinfo:n({},P.hoverinfo),showlegend:n({},P.showlegend,{dflt:!1})}),"calc","nested");a.x.editType=a.y.editType=a.z.editType=a.value.editType="calc+clearAxisTypes"}),QY=It((et,Y)=>{var f=jn(),y=wD(),z=xD().supplyIsoDefaults,P=_D().opacityscaleDefaults;Y.exports=function(n,i,a,l){function o(c,s){return f.coerce(n,i,y,c,s)}z(n,i,a,l,o),P(n,i,l,o)}}),tX=It((et,Y)=>{var f=Vp().gl_mesh3d,y=dy().parseColorScale,z=jn().isArrayOrTypedArray,P=hy(),n=ch().extractOpts,i=Zw(),a=XC().findNearestOnAxis,l=XC().generateIsoMeshes;function o(h,m,b){this.scene=h,this.uid=b,this.mesh=m,this.name="",this.data=null,this.showContour=!1}var c=o.prototype;c.handlePick=function(h){if(h.object===this.mesh){var m=h.data.index,b=this.data._meshX[m],x=this.data._meshY[m],_=this.data._meshZ[m],A=this.data._Ys.length,d=this.data._Zs.length,k=a(b,this.data._Xs).id,w=a(x,this.data._Ys).id,D=a(_,this.data._Zs).id,E=h.index=D+d*w+d*A*k;h.traceCoordinate=[this.data._meshX[E],this.data._meshY[E],this.data._meshZ[E],this.data._value[E]];var I=this.data.hovertext||this.data.text;return z(I)&&I[E]!==void 0?h.textLabel=I[E]:I&&(h.textLabel=I),!0}},c.update=function(h){var m=this.scene,b=m.fullSceneLayout;this.data=l(h);function x(w,D,E,I){return D.map(function(M){return w.d2l(M,0,I)*E})}var _=i(x(b.xaxis,h._meshX,m.dataScale[0],h.xcalendar),x(b.yaxis,h._meshY,m.dataScale[1],h.ycalendar),x(b.zaxis,h._meshZ,m.dataScale[2],h.zcalendar)),A=i(h._meshI,h._meshJ,h._meshK),d={positions:_,cells:A,lightPosition:[h.lightposition.x,h.lightposition.y,h.lightposition.z],ambient:h.lighting.ambient,diffuse:h.lighting.diffuse,specular:h.lighting.specular,roughness:h.lighting.roughness,fresnel:h.lighting.fresnel,vertexNormalsEpsilon:h.lighting.vertexnormalsepsilon,faceNormalsEpsilon:h.lighting.facenormalsepsilon,opacity:h.opacity,opacityscale:h.opacityscale,contourEnable:h.contour.show,contourColor:P(h.contour.color).slice(0,3),contourWidth:h.contour.width,useFacetNormals:h.flatshading},k=n(h);d.vertexIntensity=h._meshIntensity,d.vertexIntensityBounds=[k.min,k.max],d.colormap=y(h),this.mesh.update(d)},c.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function s(h,m){var b=h.glplot.gl,x=f({gl:b}),_=new o(h,x,m.uid);return x._trace=_,_.update(m),h.glplot.add(x),_}Y.exports=s}),eX=It((et,Y)=>{Y.exports={attributes:wD(),supplyDefaults:QY(),calc:bD(),colorbar:{min:"cmin",max:"cmax"},plot:tX(),moduleType:"trace",name:"volume",basePlotModule:V_(),categories:["gl3d","showLegend"],meta:{}}}),rX=It((et,Y)=>{Y.exports=eX()}),nX=It((et,Y)=>{var f=ls(),y=jn(),z=Cu(),P=Gw();Y.exports=function(n,i,a,l){function o(b,x){return y.coerce(n,i,P,b,x)}function c(b){var x=b.map(function(_){var A=o(_);return A&&y.isArrayOrTypedArray(A)?A:null});return x.every(function(_){return _&&_.length===x[0].length})&&x}var s=c(["x","y","z"]);if(!s){i.visible=!1;return}if(c(["i","j","k"]),i.i&&(!i.j||!i.k)||i.j&&(!i.k||!i.i)||i.k&&(!i.i||!i.j)){i.visible=!1;return}var h=f.getComponentMethod("calendars","handleTraceDefaults");h(n,i,["x","y","z"],l),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(b){o(b)});var m=o("contour.show");m&&(o("contour.color"),o("contour.width")),"intensity"in n?(o("intensity"),o("intensitymode"),z(n,i,l,o,{prefix:"",cLetter:"c"})):(i.showscale=!1,"facecolor"in n?o("facecolor"):"vertexcolor"in n?o("vertexcolor"):o("color",a)),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),o("xhoverformat"),o("yhoverformat"),o("zhoverformat"),i._length=null}}),iX=It((et,Y)=>{var f=Cp();Y.exports=function(y,z){z.intensity&&f(y,z,{vals:z.intensity,containerStr:"",cLetter:"c"})}}),aX=It((et,Y)=>{var f=Vp().gl_mesh3d,y=Vp().delaunay_triangulate,z=Vp().alpha_shape,P=Vp().convex_hull,n=dy().parseColorScale,i=jn().isArrayOrTypedArray,a=hy(),l=ch().extractOpts,o=Zw();function c(d,k,w){this.scene=d,this.uid=w,this.mesh=k,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var s=c.prototype;s.handlePick=function(d){if(d.object===this.mesh){var k=d.index=d.data.index;d.data._cellCenter?d.traceCoordinate=d.data.dataCoordinate:d.traceCoordinate=[this.data.x[k],this.data.y[k],this.data.z[k]];var w=this.data.hovertext||this.data.text;return i(w)&&w[k]!==void 0?d.textLabel=w[k]:w&&(d.textLabel=w),!0}};function h(d){for(var k=[],w=d.length,D=0;D=k-.5)return!1;return!0}s.update=function(d){var k=this.scene,w=k.fullSceneLayout;this.data=d;var D=d.x.length,E=o(m(w.xaxis,d.x,k.dataScale[0],d.xcalendar),m(w.yaxis,d.y,k.dataScale[1],d.ycalendar),m(w.zaxis,d.z,k.dataScale[2],d.zcalendar)),I;if(d.i&&d.j&&d.k){if(d.i.length!==d.j.length||d.j.length!==d.k.length||!_(d.i,D)||!_(d.j,D)||!_(d.k,D))return;I=o(b(d.i),b(d.j),b(d.k))}else d.alphahull===0?I=P(E):d.alphahull>0?I=z(d.alphahull,E):I=x(d.delaunayaxis,E);var M={positions:E,cells:I,lightPosition:[d.lightposition.x,d.lightposition.y,d.lightposition.z],ambient:d.lighting.ambient,diffuse:d.lighting.diffuse,specular:d.lighting.specular,roughness:d.lighting.roughness,fresnel:d.lighting.fresnel,vertexNormalsEpsilon:d.lighting.vertexnormalsepsilon,faceNormalsEpsilon:d.lighting.facenormalsepsilon,opacity:d.opacity,contourEnable:d.contour.show,contourColor:a(d.contour.color).slice(0,3),contourWidth:d.contour.width,useFacetNormals:d.flatshading};if(d.intensity){var p=l(d);this.color="#fff";var g=d.intensitymode;M[g+"Intensity"]=d.intensity,M[g+"IntensityBounds"]=[p.min,p.max],M.colormap=n(d)}else d.vertexcolor?(this.color=d.vertexcolor[0],M.vertexColors=h(d.vertexcolor)):d.facecolor?(this.color=d.facecolor[0],M.cellColors=h(d.facecolor)):(this.color=d.color,M.meshColor=a(d.color));this.mesh.update(M)},s.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function A(d,k){var w=d.glplot.gl,D=f({gl:w}),E=new c(d,D,k.uid);return D._trace=E,E.update(k),d.glplot.add(D),E}Y.exports=A}),oX=It((et,Y)=>{Y.exports={attributes:Gw(),supplyDefaults:nX(),calc:iX(),colorbar:{min:"cmin",max:"cmax"},plot:aX(),moduleType:"trace",name:"mesh3d",basePlotModule:V_(),categories:["gl3d","showLegend"],meta:{}}}),sX=It((et,Y)=>{Y.exports=oX()}),kD=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Gw(),i=xa(),a=Yn().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},i.showlegend,{dflt:!1})};a(l,f("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(c){l[c]=n[c]}),l.hoverinfo=a({},i.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),lX=It((et,Y)=>{var f=jn(),y=Cu(),z=kD();Y.exports=function(P,n,i,a){function l(_,A){return f.coerce(P,n,z,_,A)}var o=l("u"),c=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!c||!c.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){n.visible=!1;return}var x=l("sizemode");l("sizeref",x==="raw"?1:.5),l("anchor"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,n,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),n._length=null}}),cX=It((et,Y)=>{var f=Cp();Y.exports=function(y,z){for(var P=z.u,n=z.v,i=z.w,a=Math.min(z.x.length,z.y.length,z.z.length,P.length,n.length,i.length),l=-1/0,o=1/0,c=0;c{var f=Vp().gl_cone3d,y=Vp().gl_cone3d.createConeMesh,z=jn().simpleMap,P=dy().parseColorScale,n=ch().extractOpts,i=jn().isArrayOrTypedArray,a=Zw();function l(x,_){this.scene=x,this.uid=_,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(x){if(x.object===this.mesh){var _=x.index=x.data.index,A=this.data.x[_],d=this.data.y[_],k=this.data.z[_],w=this.data.u[_],D=this.data.v[_],E=this.data.w[_];x.traceCoordinate=[A,d,k,w,D,E,Math.sqrt(w*w+D*D+E*E)];var I=this.data.hovertext||this.data.text;return i(I)&&I[_]!==void 0?x.textLabel=I[_]:I&&(x.textLabel=I),!0}};var c={xaxis:0,yaxis:1,zaxis:2},s={tip:1,tail:0,cm:.25,center:.5},h={tip:1,tail:1,cm:.75,center:.5};function m(x,_){var A=x.fullSceneLayout,d=x.dataScale,k={};function w(p,g){var C=A[g],S=d[c[g]];return z(p,function(N){return C.d2l(N)*S})}k.vectors=a(w(_.u,"xaxis"),w(_.v,"yaxis"),w(_.w,"zaxis"),_._len),k.positions=a(w(_.x,"xaxis"),w(_.y,"yaxis"),w(_.z,"zaxis"),_._len);var D=n(_);k.colormap=P(_),k.vertexIntensityBounds=[D.min/_._normMax,D.max/_._normMax],k.coneOffset=s[_.anchor];var E=_.sizemode;E==="scaled"?k.coneSize=_.sizeref||.5:E==="absolute"?k.coneSize=_.sizeref&&_._normMax?_.sizeref/_._normMax:.5:E==="raw"&&(k.coneSize=_.sizeref),k.coneSizemode=E;var I=f(k),M=_.lightposition;return I.lightPosition=[M.x,M.y,M.z],I.ambient=_.lighting.ambient,I.diffuse=_.lighting.diffuse,I.specular=_.lighting.specular,I.roughness=_.lighting.roughness,I.fresnel=_.lighting.fresnel,I.opacity=_.opacity,_._pad=h[_.anchor]*I.vectorScale*I.coneScale*_._normMax,I}o.update=function(x){this.data=x;var _=m(this.scene,x);this.mesh.update(_)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function b(x,_){var A=x.glplot.gl,d=m(x,_),k=y(A,d),w=new l(x,_.uid);return w.mesh=k,w.data=_,k._trace=w,x.glplot.add(k),w}Y.exports=b}),hX=It((et,Y)=>{Y.exports={moduleType:"trace",name:"cone",basePlotModule:V_(),categories:["gl3d","showLegend"],attributes:kD(),supplyDefaults:lX(),colorbar:{min:"cmin",max:"cmax"},calc:cX(),plot:uX(),eventData:function(f,y){return f.norm=y.traceCoordinate[6],f},meta:{}}}),dX=It((et,Y)=>{Y.exports=hX()}),TD=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Gw(),i=xa(),a=Yn().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},i.showlegend,{dflt:!1})};a(l,f("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(c){l[c]=n[c]}),l.hoverinfo=a({},i.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),fX=It((et,Y)=>{var f=jn(),y=Cu(),z=TD();Y.exports=function(P,n,i,a){function l(x,_){return f.coerce(P,n,z,x,_)}var o=l("u"),c=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!c||!c.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){n.visible=!1;return}l("starts.x"),l("starts.y"),l("starts.z"),l("maxdisplayed"),l("sizeref"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,n,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),n._length=null}}),pX=It((et,Y)=>{var f=Vp().gl_streamtube3d,y=f.createTubeMesh,z=jn(),P=dy().parseColorScale,n=ch().extractOpts,i=Zw(),a={xaxis:0,yaxis:1,zaxis:2};function l(b,x){this.scene=b,this.uid=x,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(b){var x=this.scene.fullSceneLayout,_=this.scene.dataScale;function A(w,D){var E=x[D],I=_[a[D]];return E.l2c(w)/I}if(b.object===this.mesh){var d=b.data.position,k=b.data.velocity;return b.traceCoordinate=[A(d[0],"xaxis"),A(d[1],"yaxis"),A(d[2],"zaxis"),A(k[0],"xaxis"),A(k[1],"yaxis"),A(k[2],"zaxis"),b.data.intensity*this.data._normMax,b.data.divergence],b.textLabel=this.data.hovertext||this.data.text,!0}};function c(b){var x=b.length,_;return x>2?_=b.slice(1,x-1):x===2?_=[(b[0]+b[1])/2]:_=b,_}function s(b){var x=b.length;return x===1?[.5,.5]:[b[1]-b[0],b[x-1]-b[x-2]]}function h(b,x){var _=b.fullSceneLayout,A=b.dataScale,d=x._len,k={};function w(ut,rt){var gt=_[rt],it=A[a[rt]];return z.simpleMap(ut,function(st){return gt.d2l(st)*it})}if(k.vectors=i(w(x._u,"xaxis"),w(x._v,"yaxis"),w(x._w,"zaxis"),d),!d)return{positions:[],cells:[]};var D=w(x._Xs,"xaxis"),E=w(x._Ys,"yaxis"),I=w(x._Zs,"zaxis");k.meshgrid=[D,E,I],k.gridFill=x._gridFill;var M=x._slen;if(M)k.startingPositions=i(w(x._startsX,"xaxis"),w(x._startsY,"yaxis"),w(x._startsZ,"zaxis"));else{for(var p=E[0],g=c(D),C=c(I),S=new Array(g.length*C.length),N=0,B=0;B{Y.exports={moduleType:"trace",name:"streamtube",basePlotModule:V_(),categories:["gl3d","showLegend"],attributes:TD(),supplyDefaults:fX(),colorbar:{min:"cmin",max:"cmax"},calc:YC().calc,plot:pX(),eventData:function(f,y){return f.tubex=f.x,f.tubey=f.y,f.tubez=f.z,f.tubeu=y.traceCoordinate[3],f.tubev=y.traceCoordinate[4],f.tubew=y.traceCoordinate[5],f.norm=y.traceCoordinate[6],f.divergence=y.traceCoordinate[7],delete f.x,delete f.y,delete f.z,f},meta:{}}}),gX=It((et,Y)=>{Y.exports=mX()}),Pb=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=dd(),i=xa(),a=Ru(),l=qf().dash,o=Yn().extendFlat,c=sh().overrideAll,s=n.marker,h=n.line,m=s.line;Y.exports=c({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:o({},n.mode,{dflt:"markers"}),text:o({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","location","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},n.hovertext,{}),textfont:n.textfont,textposition:n.textposition,line:{color:h.color,width:h.width,dash:l},connectgaps:n.connectgaps,marker:o({symbol:s.symbol,opacity:s.opacity,angle:s.angle,angleref:o({},s.angleref,{values:["previous","up","north"]}),standoff:s.standoff,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,colorbar:s.colorbar,line:o({width:m.width},a("marker.line")),gradient:s.gradient},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:P(),selected:n.selected,unselected:n.unselected,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:f(),hovertemplatefallback:z()},"calc","nested")}),vX=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=pm(),i=Pm(),a=Pb(),l=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(o,c,s,h){function m(D,E){return f.coerce(o,c,a,D,E)}var b=m("locations"),x;if(b&&b.length){var _=m("geojson"),A;(typeof _=="string"&&_!==""||f.isPlainObject(_))&&(A="geojson-id");var d=m("locationmode",A);d==="country names"&&f.warn(l),d==="geojson-id"&&m("featureidkey"),x=b.length}else{var k=m("lon")||[],w=m("lat")||[];x=Math.min(k.length,w.length)}if(!x){c.visible=!1;return}c._length=x,m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),y.hasMarkers(c)&&z(o,c,s,h,m,{gradient:!0}),y.hasLines(c)&&(P(o,c,s,h,m),m("connectgaps")),y.hasText(c)&&(m("texttemplate"),m("texttemplatefallback"),n(o,c,h,m)),m("fill"),c.fill!=="none"&&i(o,c,s,m),f.coerceSelectionMarkerOpacity(c,m)}}),yX=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.geo]._subplot,a=i.mockAxis,l=y.lonlat;return n.lonLabel=f.tickText(a,a.c2l(l[0]),!0).text,n.latLabel=f.tickText(a,a.c2l(l[1]),!0).text,n}}),JC=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Dm(),P=ft(),n=$t(),i=jn().isArrayOrTypedArray,a=jn()._;function l(o){return o&&typeof o=="string"}Y.exports=function(o,c){var s=i(c.locations),h=s?c.locations.length:c._length,m=new Array(h),b;c.geojson?b=function(w){return l(w)||f(w)}:b=l;for(var x=0;x{et.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},et.axesNames=["lonaxis","lataxis"],et.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},et.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},et.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},et.clipPad=.001,et.precision=.1,et.landColor="#F0DC82",et.waterColor="#3399FF",et.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},et.sphereSVG={type:"Sphere"},et.fillLayers={ocean:1,land:1,lakes:1},et.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},et.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],et.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],et.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),SD=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.topojson=f.topojson||{}))})(et,function(f){function y(w){return w}function z(w){if(w==null)return y;var D,E,I=w.scale[0],M=w.scale[1],p=w.translate[0],g=w.translate[1];return function(C,S){S||(D=E=0);var N=2,B=C.length,U=new Array(B);for(U[0]=(D+=C[0])*I+p,U[1]=(E+=C[1])*M+g;Np&&(p=N[0]),N[1]g&&(g=N[1])}function S(N){switch(N.type){case"GeometryCollection":N.geometries.forEach(S);break;case"Point":C(N.coordinates);break;case"MultiPoint":N.coordinates.forEach(C);break}}w.arcs.forEach(function(N){for(var B=-1,U=N.length,V;++Bp&&(p=V[0]),V[1]g&&(g=V[1])});for(E in w.objects)S(w.objects[E]);return[I,M,p,g]}function n(w,D){for(var E,I=w.length,M=I-D;M<--I;)E=w[M],w[M++]=w[I],w[I]=E}function i(w,D){return typeof D=="string"&&(D=w.objects[D]),D.type==="GeometryCollection"?{type:"FeatureCollection",features:D.geometries.map(function(E){return a(w,E)})}:a(w,D)}function a(w,D){var E=D.id,I=D.bbox,M=D.properties==null?{}:D.properties,p=l(w,D);return E==null&&I==null?{type:"Feature",properties:M,geometry:p}:I==null?{type:"Feature",id:E,properties:M,geometry:p}:{type:"Feature",id:E,bbox:I,properties:M,geometry:p}}function l(w,D){var E=z(w.transform),I=w.arcs;function M(B,U){U.length&&U.pop();for(var V=I[B<0?~B:B],W=0,F=V.length;W1)I=h(w,D,E);else for(M=0,I=new Array(p=w.arcs.length);M1)for(var U=1,V=C(N[0]),W,F;UV&&(F=N[0],N[0]=N[U],N[U]=F,V=W);return N}).filter(function(S){return S.length>0})}}function _(w,D){for(var E=0,I=w.length;E>>1;w[M]=2))throw new Error("n must be ≥2");S=w.bbox||P(w);var E=S[0],I=S[1],M=S[2],p=S[3],g;D={scale:[M-E?(M-E)/(g-1):1,p-I?(p-I)/(g-1):1],translate:[E,I]}}else S=w.bbox;var C=d(D),S,N,B=w.objects,U={};function V(H){return C(H)}function W(H){var q;switch(H.type){case"GeometryCollection":q={type:"GeometryCollection",geometries:H.geometries.map(W)};break;case"Point":q={type:"Point",coordinates:V(H.coordinates)};break;case"MultiPoint":q={type:"MultiPoint",coordinates:H.coordinates.map(V)};break;default:return H}return H.id!=null&&(q.id=H.id),H.bbox!=null&&(q.bbox=H.bbox),H.properties!=null&&(q.properties=H.properties),q}function F(H){var q=0,G=1,tt=H.length,ht,bt=new Array(tt);for(bt[0]=C(H[0],0);++q{var f=Y.exports={},y=Mk().locationmodeToLayer,z=SD().feature;f.getTopojsonName=function(P){return[P.scope.replace(/ /g,"-"),"_",P.resolution.toString(),"m"].join("")},f.getTopojsonPath=function(P,n){return P+=P.endsWith("/")?"":"/",`${P}${n}.json`},f.getTopojsonFeatures=function(P,n){var i=y[P.locationmode],a=n.objects[i];return z(n,a).features}}),W_=It(et=>{var Y=Dr().BADNUM;et.calcTraceToLineCoords=function(f){for(var y=f[0].trace,z=y.connectgaps,P=[],n=[],i=0;i0&&(P.push(n),n=[])}return n.length>0&&P.push(n),P},et.makeLine=function(f){return f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}},et.makePolygon=function(f){if(f.length===1)return{type:"Polygon",coordinates:f};for(var y=new Array(f.length),z=0;z{Y.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}),tA=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=63710088e-1,f={centimeters:Y*100,centimetres:Y*100,degrees:360/(2*Math.PI),feet:Y*3.28084,inches:Y*39.37,kilometers:Y/1e3,kilometres:Y/1e3,meters:Y,metres:Y,miles:Y/1609.344,millimeters:Y*1e3,millimetres:Y*1e3,nauticalmiles:Y/1852,radians:1,yards:Y*1.0936},y={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function z(B,U,V={}){let W={type:"Feature"};return(V.id===0||V.id)&&(W.id=V.id),V.bbox&&(W.bbox=V.bbox),W.properties=U||{},W.geometry=B,W}function P(B,U,V={}){switch(B){case"Point":return n(U).geometry;case"LineString":return o(U).geometry;case"Polygon":return a(U).geometry;case"MultiPoint":return m(U).geometry;case"MultiLineString":return h(U).geometry;case"MultiPolygon":return b(U).geometry;default:throw new Error(B+" is invalid")}}function n(B,U,V={}){if(!B)throw new Error("coordinates is required");if(!Array.isArray(B))throw new Error("coordinates must be an Array");if(B.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g(B[0])||!g(B[1]))throw new Error("coordinates must contain numbers");return z({type:"Point",coordinates:B},U,V)}function i(B,U,V={}){return s(B.map(W=>n(W,U)),V)}function a(B,U,V={}){for(let W of B){if(W.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(W[W.length-1].length!==W[0].length)throw new Error("First and last Position are not equivalent.");for(let F=0;Fa(W,U)),V)}function o(B,U,V={}){if(B.length<2)throw new Error("coordinates must be an array of two or more positions");return z({type:"LineString",coordinates:B},U,V)}function c(B,U,V={}){return s(B.map(W=>o(W,U)),V)}function s(B,U={}){let V={type:"FeatureCollection"};return U.id&&(V.id=U.id),U.bbox&&(V.bbox=U.bbox),V.features=B,V}function h(B,U,V={}){return z({type:"MultiLineString",coordinates:B},U,V)}function m(B,U,V={}){return z({type:"MultiPoint",coordinates:B},U,V)}function b(B,U,V={}){return z({type:"MultiPolygon",coordinates:B},U,V)}function x(B,U,V={}){return z({type:"GeometryCollection",geometries:B},U,V)}function _(B,U=0){if(U&&!(U>=0))throw new Error("precision must be a positive number");let V=Math.pow(10,U||0);return Math.round(B*V)/V}function A(B,U="kilometers"){let V=f[U];if(!V)throw new Error(U+" units is invalid");return B*V}function d(B,U="kilometers"){let V=f[U];if(!V)throw new Error(U+" units is invalid");return B/V}function k(B,U){return E(d(B,U))}function w(B){let U=B%360;return U<0&&(U+=360),U}function D(B){return B=B%360,B>180?B-360:B<-180?B+360:B}function E(B){return B%(2*Math.PI)*180/Math.PI}function I(B){return B%360*Math.PI/180}function M(B,U="kilometers",V="kilometers"){if(!(B>=0))throw new Error("length must be a positive number");return A(d(B,U),V)}function p(B,U="meters",V="kilometers"){if(!(B>=0))throw new Error("area must be a positive number");let W=y[U];if(!W)throw new Error("invalid original units");let F=y[V];if(!F)throw new Error("invalid final units");return B/W*F}function g(B){return!isNaN(B)&&B!==null&&!Array.isArray(B)}function C(B){return B!==null&&typeof B=="object"&&!Array.isArray(B)}function S(B){if(!B)throw new Error("bbox is required");if(!Array.isArray(B))throw new Error("bbox must be an Array");if(B.length!==4&&B.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");B.forEach(U=>{if(!g(U))throw new Error("bbox must only contain numbers")})}function N(B){if(!B)throw new Error("id is required");if(["string","number"].indexOf(typeof B)===-1)throw new Error("id must be a number or a string")}et.areaFactors=y,et.azimuthToBearing=D,et.bearingToAzimuth=w,et.convertArea=p,et.convertLength=M,et.degreesToRadians=I,et.earthRadius=Y,et.factors=f,et.feature=z,et.featureCollection=s,et.geometry=P,et.geometryCollection=x,et.isNumber=g,et.isObject=C,et.lengthToDegrees=k,et.lengthToRadians=d,et.lineString=o,et.lineStrings=c,et.multiLineString=h,et.multiPoint=m,et.multiPolygon=b,et.point=n,et.points=i,et.polygon=a,et.polygons=l,et.radiansToDegrees=E,et.radiansToLength=A,et.round=_,et.validateBBox=S,et.validateId=N}),eA=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=tA();function f(d,k,w){if(d!==null)for(var D,E,I,M,p,g,C,S=0,N=0,B,U=d.type,V=U==="FeatureCollection",W=U==="Feature",F=V?d.features.length:1,H=0;Hg||V>C||W>S){p=N,g=D,C=V,S=W,I=0;return}var F=Y.lineString.call(void 0,[p,N],w.properties);if(k(F,D,E,W,I)===!1)return!1;I++,p=N})===!1)return!1}}})}function m(d,k,w){var D=w,E=!1;return h(d,function(I,M,p,g,C){E===!1&&w===void 0?D=I:D=k(D,I,M,p,g,C),E=!0}),D}function b(d,k){if(!d)throw new Error("geojson is required");c(d,function(w,D,E){if(w.geometry!==null){var I=w.geometry.type,M=w.geometry.coordinates;switch(I){case"LineString":if(k(w,D,E,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p{Object.defineProperty(et,"__esModule",{value:!0});var Y=tA(),f=eA();function y(o){return f.geomReduce.call(void 0,o,(c,s)=>c+z(s),0)}function z(o){let c=0,s;switch(o.type){case"Polygon":return P(o.coordinates);case"MultiPolygon":for(s=0;s0){c+=Math.abs(a(o[0]));for(let s=1;s=c?(h+2)%c:h+2],_=m[0]*i,A=b[1]*i,d=x[0]*i;s+=(d-_)*Math.sin(A),h++}return s*n}var l=y;et.area=y,et.default=l}),bX=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=tA(),f=eA();function y(P,n={}){let i=0,a=0,l=0;return f.coordEach.call(void 0,P,function(o){i+=o[0],a+=o[1],l++},!0),Y.point.call(void 0,[i/l,a/l],n.properties)}var z=y;et.centroid=y,et.default=z}),wX=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=eA();function f(z,P={}){if(z.bbox!=null&&P.recompute!==!0)return z.bbox;let n=[1/0,1/0,-1/0,-1/0];return Y.coordEach.call(void 0,z,i=>{n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]{var f=Br(),y=_X(),{area:z}=xX(),{centroid:P}=bX(),{bbox:n}=wX(),i=T_(),a=es(),l=Cn(),o=_i(),c=Ag(),s=Object.keys(y),h={"ISO-3":i,"USA-states":i,"country names":m};function m(D){for(var E=0;E0&&U[V+1][0]<0)return V;return null}switch(M==="RUS"||M==="FJI"?g=function(U){var V;if(B(U)===null)V=U;else for(V=new Array(U.length),N=0;NV?W[F++]=[U[N][0]+360,U[N][1]]:N===V?(W[F++]=U[N],W[F++]=[U[N][0],-90]):W[F++]=U[N];var H=c.tester(W);H.pts.pop(),p.push(H)}:g=function(U){p.push(c.tester(U))},E.type){case"MultiPolygon":for(C=0;C0?H.properties.ct=d(H):H.properties.ct=[NaN,NaN],W.fIn=U,W.fOut=H,p.push(H)}else a.log(["Location",W.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete M[V]}switch(I.type){case"FeatureCollection":var N=I.features;for(g=0;gp&&(p=S,I=C)}else I=E;return P(I).geometry.coordinates}function k(D){var E=window.PlotlyGeoAssets||{},I=[];function M(N){return new Promise(function(B,U){f.json(N,function(V,W){if(V){delete E[N];var F=V.status===404?'GeoJSON at URL "'+N+'" does not exist.':"Unexpected error while fetching from "+N;return U(new Error(F))}return E[N]=W,B(W)})})}function p(N){return new Promise(function(B,U){var V=0,W=setInterval(function(){if(E[N]&&E[N]!=="pending")return clearInterval(W),B(E[N]);if(V>100)return clearInterval(W),U("Unexpected error while fetching from "+N);V++},50)})}for(var g=0;g{var f=Br(),y=Js(),z=Hn(),P=Il(),n=P.stylePoints,i=P.styleText;Y.exports=function(l,o){o&&a(l,o)};function a(l,o){var c=o[0].trace,s=o[0].node3;s.style("opacity",o[0].trace.opacity),n(s,c,l),i(s,c,l),s.selectAll("path.js-line").style("fill","none").each(function(h){var m=f.select(this),b=h.trace,x=b.line||{};m.call(z.stroke,x.color).call(y.dashLine,x.dash||"",x.width||0),b.fill!=="none"&&m.call(z.fill,b.fillcolor)})}}),AD=It((et,Y)=>{var f=Br(),y=jn(),z=QC().getTopojsonFeatures,P=W_(),n=q_(),i=Jm().findExtremes,a=Dr().BADNUM,l=_e().calcMarkerSize,o=Fu(),c=CD();function s(m,b,x){var _=b.layers.frontplot.select(".scatterlayer"),A=y.makeTraceGroups(_,x,"trace scattergeo");function d(k,w){k.lonlat[0]===a&&f.select(w).remove()}A.selectAll("*").remove(),A.each(function(k){var w=f.select(this),D=k[0].trace;if(o.hasLines(D)||D.fill!=="none"){var E=P.calcTraceToLineCoords(k),I=D.fill!=="none"?P.makePolygon(E):P.makeLine(E);w.selectAll("path.js-line").data([{geojson:I,trace:D}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}o.hasMarkers(D)&&w.selectAll("path.point").data(y.identity).enter().append("path").classed("point",!0).each(function(M){d(M,this)}),o.hasText(D)&&w.selectAll("g").data(y.identity).enter().append("g").append("text").each(function(M){d(M,this)}),c(m,k)})}function h(m,b){var x=m[0].trace,_=b[x.geo],A=_._subplot,d=x._length,k,w;if(y.isArrayOrTypedArray(x.locations)){var D=x.locationmode,E=D==="geojson-id"?n.extractTraceFeature(m):z(x,A.topojson);for(k=0;k{var f=hd(),y=Dr().BADNUM,z=qc(),P=jn().fillText,n=Pb();Y.exports=function(a,l,o){var c=a.cd,s=c[0].trace,h=a.xa,m=a.ya,b=a.subplot,x=b.projection.isLonLatOverEdges,_=b.project;function A(M){var p=M.lonlat;if(p[0]===y||x(p))return 1/0;var g=_(p),C=_([l,o]),S=Math.abs(g[0]-C[0]),N=Math.abs(g[1]-C[1]),B=Math.max(3,M.mrc||0);return Math.max(Math.sqrt(S*S+N*N)-B,1-3/B)}if(f.getClosest(c,A,a),a.index!==!1){var d=c[a.index],k=d.lonlat,w=[h.c2p(k),m.c2p(k)],D=d.mrc||1;a.x0=w[0]-D,a.x1=w[0]+D,a.y0=w[1]-D,a.y1=w[1]+D,a.loc=d.loc,a.lon=k[0],a.lat=k[1];var E={};E[s.geo]={_subplot:b};var I=s._module.formatLabels(d,s,E);return a.lonLabel=I.lonLabel,a.latLabel=I.latLabel,a.color=z(s,d),a.extraText=i(s,d,a,c[0].t.labels),a.hovertemplate=s.hovertemplate,[a]}};function i(a,l,o,c){if(a.hovertemplate)return;var s=l.hi||a.hoverinfo,h=s==="all"?n.hoverinfo.flags:s.split("+"),m=h.indexOf("location")!==-1&&Array.isArray(a.locations),b=h.indexOf("lon")!==-1,x=h.indexOf("lat")!==-1,_=h.indexOf("text")!==-1,A=[];function d(k){return k+"°"}return m?A.push(l.loc):b&&x?A.push("("+d(o.latLabel)+", "+d(o.lonLabel)+")"):b?A.push(c.lon+d(o.lonLabel)):x&&A.push(c.lat+d(o.latLabel)),_&&P(l,a,A),A.join("
")}}),TX=It((et,Y)=>{Y.exports=function(f,y,z,P,n){f.lon=y.lon,f.lat=y.lat,f.location=y.loc?y.loc:null;var i=P[n];return i.fIn&&i.fIn.properties&&(f.properties=i.fIn.properties),f}}),SX=It((et,Y)=>{var f=Fu(),y=Dr().BADNUM;Y.exports=function(z,P){var n=z.cd,i=z.xaxis,a=z.yaxis,l=[],o=n[0].trace,c,s,h,m,b,x=!f.hasMarkers(o)&&!f.hasText(o);if(x)return[];if(P===!1)for(b=0;b{(function(f,y){y(typeof et=="object"&&typeof Y<"u"?et:f.d3=f.d3||{})})(et,function(f){function y(it,st){return itst?1:it>=st?0:NaN}function z(it){return it.length===1&&(it=P(it)),{left:function(st,xt,ot,J){for(ot==null&&(ot=0),J==null&&(J=st.length);ot>>1;it(st[mt],xt)<0?ot=mt+1:J=mt}return ot},right:function(st,xt,ot,J){for(ot==null&&(ot=0),J==null&&(J=st.length);ot>>1;it(st[mt],xt)>0?J=mt:ot=mt+1}return ot}}}function P(it){return function(st,xt){return y(it(st),xt)}}var n=z(y),i=n.right,a=n.left;function l(it,st){st==null&&(st=o);for(var xt=0,ot=it.length-1,J=it[0],mt=new Array(ot<0?0:ot);xtit?1:st>=it?0:NaN}function h(it){return it===null?NaN:+it}function m(it,st){var xt=it.length,ot=0,J=-1,mt=0,dt,Ct,Rt=0;if(st==null)for(;++J1)return Rt/(ot-1)}function b(it,st){var xt=m(it,st);return xt&&Math.sqrt(xt)}function x(it,st){var xt=it.length,ot=-1,J,mt,dt;if(st==null){for(;++ot=J)for(mt=dt=J;++otJ&&(mt=J),dt=J)for(mt=dt=J;++otJ&&(mt=J),dt0)return[it];if((ot=st0)for(it=Math.ceil(it/Ct),st=Math.floor(st/Ct),dt=new Array(mt=Math.ceil(st-it+1));++J=0?(mt>=E?10:mt>=I?5:mt>=M?2:1)*Math.pow(10,J):-Math.pow(10,-J)/(mt>=E?10:mt>=I?5:mt>=M?2:1)}function C(it,st,xt){var ot=Math.abs(st-it)/Math.max(0,xt),J=Math.pow(10,Math.floor(Math.log(ot)/Math.LN10)),mt=ot/J;return mt>=E?J*=10:mt>=I?J*=5:mt>=M&&(J*=2),stGt;)ee.pop(),--xe;var ge=new Array(xe+1),ye;for(mt=0;mt<=xe;++mt)ye=ge[mt]=[],ye.x0=mt>0?ee[mt-1]:Zt,ye.x1=mt=1)return+xt(it[ot-1],ot-1,it);var ot,J=(ot-1)*st,mt=Math.floor(J),dt=+xt(it[mt],mt,it),Ct=+xt(it[mt+1],mt+1,it);return dt+(Ct-dt)*(J-mt)}}function U(it,st,xt){return it=d.call(it,h).sort(y),Math.ceil((xt-st)/(2*(B(it,.75)-B(it,.25))*Math.pow(it.length,-1/3)))}function V(it,st,xt){return Math.ceil((xt-st)/(3.5*b(it)*Math.pow(it.length,-1/3)))}function W(it,st){var xt=it.length,ot=-1,J,mt;if(st==null){for(;++ot=J)for(mt=J;++otmt&&(mt=J)}else for(;++ot=J)for(mt=J;++otmt&&(mt=J);return mt}function F(it,st){var xt=it.length,ot=xt,J=-1,mt,dt=0;if(st==null)for(;++J=0;)for(dt=it[st],xt=dt.length;--xt>=0;)mt[--J]=dt[xt];return mt}function G(it,st){var xt=it.length,ot=-1,J,mt;if(st==null){for(;++ot=J)for(mt=J;++otJ&&(mt=J)}else for(;++ot=J)for(mt=J;++otJ&&(mt=J);return mt}function tt(it,st){for(var xt=st.length,ot=new Array(xt);xt--;)ot[xt]=it[st[xt]];return ot}function ht(it,st){if(xt=it.length){var xt,ot=0,J=0,mt,dt=it[J];for(st==null&&(st=y);++ot{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Ek()):(f=f||self,y(f.d3=f.d3||{},f.d3))})(et,function(f,y){function z(){return new P}function P(){this.reset()}P.prototype={constructor:P,reset:function(){this.s=this.t=0},add:function(br){i(n,br,this.t),i(this,n.s,this.s),this.s?this.t+=n.t:this.s=n.t},valueOf:function(){return this.s}};var n=new P;function i(br,Qr,Nn){var An=br.s=Qr+Nn,di=An-Qr,Pi=An-di;br.t=Qr-Pi+(Nn-di)}var a=1e-6,l=1e-12,o=Math.PI,c=o/2,s=o/4,h=o*2,m=180/o,b=o/180,x=Math.abs,_=Math.atan,A=Math.atan2,d=Math.cos,k=Math.ceil,w=Math.exp,D=Math.log,E=Math.pow,I=Math.sin,M=Math.sign||function(br){return br>0?1:br<0?-1:0},p=Math.sqrt,g=Math.tan;function C(br){return br>1?0:br<-1?o:Math.acos(br)}function S(br){return br>1?c:br<-1?-c:Math.asin(br)}function N(br){return(br=I(br/2))*br}function B(){}function U(br,Qr){br&&W.hasOwnProperty(br.type)&&W[br.type](br,Qr)}var V={Feature:function(br,Qr){U(br.geometry,Qr)},FeatureCollection:function(br,Qr){for(var Nn=br.features,An=-1,di=Nn.length;++An=0?1:-1,di=An*Nn,Pi=d(Qr),ga=I(Qr),Pa=rt*ga,Ja=ut*Pi+Pa*d(di),uo=Pa*An*I(di);G.add(A(uo,Ja)),vt=br,ut=Pi,rt=ga}function J(br){return tt.reset(),q(br,gt),tt*2}function mt(br){return[A(br[1],br[0]),S(br[2])]}function dt(br){var Qr=br[0],Nn=br[1],An=d(Nn);return[An*d(Qr),An*I(Qr),I(Nn)]}function Ct(br,Qr){return br[0]*Qr[0]+br[1]*Qr[1]+br[2]*Qr[2]}function Rt(br,Qr){return[br[1]*Qr[2]-br[2]*Qr[1],br[2]*Qr[0]-br[0]*Qr[2],br[0]*Qr[1]-br[1]*Qr[0]]}function Bt(br,Qr){br[0]+=Qr[0],br[1]+=Qr[1],br[2]+=Qr[2]}function Zt(br,Qr){return[br[0]*Qr,br[1]*Qr,br[2]*Qr]}function Gt(br){var Qr=p(br[0]*br[0]+br[1]*br[1]+br[2]*br[2]);br[0]/=Qr,br[1]/=Qr,br[2]/=Qr}var ee,xe,ge,ye,ue,Mt,Ot,Lt,ie=z(),be,ce,Le={point:Ze,lineStart:mr,lineEnd:fr,polygonStart:function(){Le.point=Jr,Le.lineStart=an,Le.lineEnd=Er,ie.reset(),gt.polygonStart()},polygonEnd:function(){gt.polygonEnd(),Le.point=Ze,Le.lineStart=mr,Le.lineEnd=fr,G<0?(ee=-(ge=180),xe=-(ye=90)):ie>a?ye=90:ie<-a&&(xe=-90),ce[0]=ee,ce[1]=ge},sphere:function(){ee=-(ge=180),xe=-(ye=90)}};function Ze(br,Qr){be.push(ce=[ee=br,ge=br]),Qrye&&(ye=Qr)}function Qe(br,Qr){var Nn=dt([br*b,Qr*b]);if(Lt){var An=Rt(Lt,Nn),di=[An[1],-An[0],0],Pi=Rt(di,An);Gt(Pi),Pi=mt(Pi);var ga=br-ue,Pa=ga>0?1:-1,Ja=Pi[0]*m*Pa,uo,Sa=x(ga)>180;Sa^(Pa*ueye&&(ye=uo)):(Ja=(Ja+360)%360-180,Sa^(Pa*ueye&&(ye=Qr))),Sa?brdn(ee,ge)&&(ge=br):dn(br,ge)>dn(ee,ge)&&(ee=br):ge>=ee?(brge&&(ge=br)):br>ue?dn(ee,br)>dn(ee,ge)&&(ge=br):dn(br,ge)>dn(ee,ge)&&(ee=br)}else be.push(ce=[ee=br,ge=br]);Qrye&&(ye=Qr),Lt=Nn,ue=br}function mr(){Le.point=Qe}function fr(){ce[0]=ee,ce[1]=ge,Le.point=Ze,Lt=null}function Jr(br,Qr){if(Lt){var Nn=br-ue;ie.add(x(Nn)>180?Nn+(Nn>0?360:-360):Nn)}else Mt=br,Ot=Qr;gt.point(br,Qr),Qe(br,Qr)}function an(){gt.lineStart()}function Er(){Jr(Mt,Ot),gt.lineEnd(),x(ie)>a&&(ee=-(ge=180)),ce[0]=ee,ce[1]=ge,Lt=null}function dn(br,Qr){return(Qr-=br)<0?Qr+360:Qr}function _n(br,Qr){return br[0]-Qr[0]}function Oe(br,Qr){return br[0]<=br[1]?br[0]<=Qr&&Qr<=br[1]:Qrdn(An[0],An[1])&&(An[1]=di[1]),dn(di[0],An[1])>dn(An[0],An[1])&&(An[0]=di[0])):Pi.push(An=di);for(ga=-1/0,Nn=Pi.length-1,Qr=0,An=Pi[Nn];Qr<=Nn;An=di,++Qr)di=Pi[Qr],(Pa=dn(An[1],di[0]))>ga&&(ga=Pa,ee=di[0],ge=An[1])}return be=ce=null,ee===1/0||xe===1/0?[[NaN,NaN],[NaN,NaN]]:[[ee,xe],[ge,ye]]}var oe,zt,_t,Pt,Ht,ae,he,Me,qe,Ye,ur,Rr,zr,xr,pn,ci,ui={sphere:B,point:yi,lineStart:Ci,lineEnd:oa,polygonStart:function(){ui.lineStart=Ke,ui.lineEnd=sr},polygonEnd:function(){ui.lineStart=Ci,ui.lineEnd=oa}};function yi(br,Qr){br*=b,Qr*=b;var Nn=d(Qr);Gi(Nn*d(br),Nn*I(br),I(Qr))}function Gi(br,Qr,Nn){++oe,_t+=(br-_t)/oe,Pt+=(Qr-Pt)/oe,Ht+=(Nn-Ht)/oe}function Ci(){ui.point=fi}function fi(br,Qr){br*=b,Qr*=b;var Nn=d(Qr);xr=Nn*d(br),pn=Nn*I(br),ci=I(Qr),ui.point=ba,Gi(xr,pn,ci)}function ba(br,Qr){br*=b,Qr*=b;var Nn=d(Qr),An=Nn*d(br),di=Nn*I(br),Pi=I(Qr),ga=A(p((ga=pn*Pi-ci*di)*ga+(ga=ci*An-xr*Pi)*ga+(ga=xr*di-pn*An)*ga),xr*An+pn*di+ci*Pi);zt+=ga,ae+=ga*(xr+(xr=An)),he+=ga*(pn+(pn=di)),Me+=ga*(ci+(ci=Pi)),Gi(xr,pn,ci)}function oa(){ui.point=yi}function Ke(){ui.point=vr}function sr(){Ar(Rr,zr),ui.point=yi}function vr(br,Qr){Rr=br,zr=Qr,br*=b,Qr*=b,ui.point=Ar;var Nn=d(Qr);xr=Nn*d(br),pn=Nn*I(br),ci=I(Qr),Gi(xr,pn,ci)}function Ar(br,Qr){br*=b,Qr*=b;var Nn=d(Qr),An=Nn*d(br),di=Nn*I(br),Pi=I(Qr),ga=pn*Pi-ci*di,Pa=ci*An-xr*Pi,Ja=xr*di-pn*An,uo=p(ga*ga+Pa*Pa+Ja*Ja),Sa=S(uo),Za=uo&&-Sa/uo;qe+=Za*ga,Ye+=Za*Pa,ur+=Za*Ja,zt+=Sa,ae+=Sa*(xr+(xr=An)),he+=Sa*(pn+(pn=di)),Me+=Sa*(ci+(ci=Pi)),Gi(xr,pn,ci)}function mn(br){oe=zt=_t=Pt=Ht=ae=he=Me=qe=Ye=ur=0,q(br,ui);var Qr=qe,Nn=Ye,An=ur,di=Qr*Qr+Nn*Nn+An*An;return dio?br+Math.round(-br/h)*h:br,Qr]}Wn.invert=Wn;function Li(br,Qr,Nn){return(br%=h)?Qr||Nn?Un(Zi(br),Ji(Qr,Nn)):Zi(br):Qr||Nn?Ji(Qr,Nn):Wn}function Fi(br){return function(Qr,Nn){return Qr+=br,[Qr>o?Qr-h:Qr<-o?Qr+h:Qr,Nn]}}function Zi(br){var Qr=Fi(br);return Qr.invert=Fi(-br),Qr}function Ji(br,Qr){var Nn=d(br),An=I(br),di=d(Qr),Pi=I(Qr);function ga(Pa,Ja){var uo=d(Ja),Sa=d(Pa)*uo,Za=I(Pa)*uo,Ra=I(Ja),pa=Ra*Nn+Sa*An;return[A(Za*di-pa*Pi,Sa*Nn-Ra*An),S(pa*di+Za*Pi)]}return ga.invert=function(Pa,Ja){var uo=d(Ja),Sa=d(Pa)*uo,Za=I(Pa)*uo,Ra=I(Ja),pa=Ra*di-Za*Pi;return[A(Za*di+Ra*Pi,Sa*Nn+pa*An),S(pa*Nn-Sa*An)]},ga}function ca(br){br=Li(br[0]*b,br[1]*b,br.length>2?br[2]*b:0);function Qr(Nn){return Nn=br(Nn[0]*b,Nn[1]*b),Nn[0]*=m,Nn[1]*=m,Nn}return Qr.invert=function(Nn){return Nn=br.invert(Nn[0]*b,Nn[1]*b),Nn[0]*=m,Nn[1]*=m,Nn},Qr}function Ei(br,Qr,Nn,An,di,Pi){if(Nn){var ga=d(Qr),Pa=I(Qr),Ja=An*Nn;di==null?(di=Qr+An*h,Pi=Qr-Ja/2):(di=Ga(ga,di),Pi=Ga(ga,Pi),(An>0?diPi)&&(di+=An*h));for(var uo,Sa=di;An>0?Sa>Pi:Sa1&&br.push(br.pop().concat(br.shift()))},result:function(){var Nn=br;return br=[],Qr=null,Nn}}}function Re(br,Qr){return x(br[0]-Qr[0])=0;--Pa)di.point((Za=Sa[Pa])[0],Za[1]);else An(Ra.x,Ra.p.x,-1,di);Ra=Ra.p}Ra=Ra.o,Sa=Ra.z,pa=!pa}while(!Ra.v);di.lineEnd()}}}function cn(br){if(Qr=br.length){for(var Qr,Nn=0,An=br[0],di;++Nn=0?1:-1,ec=gc*Vl,vc=ec>o,El=fs*ks;if(Yr.add(A(El*gc*I(ec),os*dl+El*d(ec))),ga+=vc?Vl+gc*h:Vl,vc^pa>=Nn^bo>=Nn){var tu=Rt(dt(Ra),dt(ws));Gt(tu);var $c=Rt(Pi,tu);Gt($c);var bc=(vc^Vl>=0?-1:1)*S($c[2]);(An>bc||An===bc&&(tu[0]||tu[1]))&&(Pa+=vc^Vl>=0?1:-1)}}return(ga<-a||ga0){for(Ja||(di.polygonStart(),Ja=!0),di.lineStart(),dl=0;dl1&&lo&2&&ks.push(ks.pop().concat(ks.shift())),Sa.push(ks.filter(ze))}}return Ra}}function ze(br){return br.length>1}function yr(br,Qr){return((br=br.x)[0]<0?br[1]-c-a:c-br[1])-((Qr=Qr.x)[0]<0?Qr[1]-c-a:c-Qr[1])}var en=bn(function(){return!0},Rn,xi,[-o,-c]);function Rn(br){var Qr=NaN,Nn=NaN,An=NaN,di;return{lineStart:function(){br.lineStart(),di=1},point:function(Pi,ga){var Pa=Pi>0?o:-o,Ja=x(Pi-Qr);x(Ja-o)0?c:-c),br.point(An,Nn),br.lineEnd(),br.lineStart(),br.point(Pa,Nn),br.point(Pi,Nn),di=0):An!==Pa&&Ja>=o&&(x(Qr-An)a?_((I(Qr)*(Pi=d(An))*I(Nn)-I(An)*(di=d(Qr))*I(br))/(di*Pi*ga)):(Qr+An)/2}function xi(br,Qr,Nn,An){var di;if(br==null)di=Nn*c,An.point(-o,di),An.point(0,di),An.point(o,di),An.point(o,0),An.point(o,-di),An.point(0,-di),An.point(-o,-di),An.point(-o,0),An.point(-o,di);else if(x(br[0]-Qr[0])>a){var Pi=br[0]0,di=x(Qr)>a;function Pi(Sa,Za,Ra,pa){Ei(pa,br,Nn,Ra,Sa,Za)}function ga(Sa,Za){return d(Sa)*d(Za)>Qr}function Pa(Sa){var Za,Ra,pa,_o,fs;return{lineStart:function(){_o=pa=!1,fs=1},point:function(os,gs){var ws=[os,gs],bo,lo=ga(os,gs),ks=An?lo?0:uo(os,gs):lo?uo(os+(os<0?o:-o),gs):0;if(!Za&&(_o=pa=lo)&&Sa.lineStart(),lo!==pa&&(bo=Ja(Za,ws),(!bo||Re(Za,bo)||Re(ws,bo))&&(ws[2]=1)),lo!==pa)fs=0,lo?(Sa.lineStart(),bo=Ja(ws,Za),Sa.point(bo[0],bo[1])):(bo=Ja(Za,ws),Sa.point(bo[0],bo[1],2),Sa.lineEnd()),Za=bo;else if(di&&Za&&An^lo){var dl;!(ks&Ra)&&(dl=Ja(ws,Za,!0))&&(fs=0,An?(Sa.lineStart(),Sa.point(dl[0][0],dl[0][1]),Sa.point(dl[1][0],dl[1][1]),Sa.lineEnd()):(Sa.point(dl[1][0],dl[1][1]),Sa.lineEnd(),Sa.lineStart(),Sa.point(dl[0][0],dl[0][1],3)))}lo&&(!Za||!Re(Za,ws))&&Sa.point(ws[0],ws[1]),Za=ws,pa=lo,Ra=ks},lineEnd:function(){pa&&Sa.lineEnd(),Za=null},clean:function(){return fs|(_o&&pa)<<1}}}function Ja(Sa,Za,Ra){var pa=dt(Sa),_o=dt(Za),fs=[1,0,0],os=Rt(pa,_o),gs=Ct(os,os),ws=os[0],bo=gs-ws*ws;if(!bo)return!Ra&&Sa;var lo=Qr*gs/bo,ks=-Qr*ws/bo,dl=Rt(fs,os),Vl=Zt(fs,lo),gc=Zt(os,ks);Bt(Vl,gc);var ec=dl,vc=Ct(Vl,ec),El=Ct(ec,ec),tu=vc*vc-El*(Ct(Vl,Vl)-1);if(!(tu<0)){var $c=p(tu),bc=Zt(ec,(-vc-$c)/El);if(Bt(bc,Vl),bc=mt(bc),!Ra)return bc;var qo=Sa[0],Bs=Za[0],ac=Sa[1],Zl=Za[1],Mu;Bs0^bc[1]<(x(bc[0]-qo)o^(qo<=bc[0]&&bc[0]<=Bs)){var rh=Zt(ec,(-vc+$c)/El);return Bt(rh,Vl),[bc,mt(rh)]}}}function uo(Sa,Za){var Ra=An?br:o-br,pa=0;return Sa<-Ra?pa|=1:Sa>Ra&&(pa|=2),Za<-Ra?pa|=4:Za>Ra&&(pa|=8),pa}return bn(ga,Pa,Pi,An?[0,-br]:[-o,br-o])}function Gn(br,Qr,Nn,An,di,Pi){var ga=br[0],Pa=br[1],Ja=Qr[0],uo=Qr[1],Sa=0,Za=1,Ra=Ja-ga,pa=uo-Pa,_o;if(_o=Nn-ga,!(!Ra&&_o>0)){if(_o/=Ra,Ra<0){if(_o0){if(_o>Za)return;_o>Sa&&(Sa=_o)}if(_o=di-ga,!(!Ra&&_o<0)){if(_o/=Ra,Ra<0){if(_o>Za)return;_o>Sa&&(Sa=_o)}else if(Ra>0){if(_o0)){if(_o/=pa,pa<0){if(_o0){if(_o>Za)return;_o>Sa&&(Sa=_o)}if(_o=Pi-Pa,!(!pa&&_o<0)){if(_o/=pa,pa<0){if(_o>Za)return;_o>Sa&&(Sa=_o)}else if(pa>0){if(_o0&&(br[0]=ga+Sa*Ra,br[1]=Pa+Sa*pa),Za<1&&(Qr[0]=ga+Za*Ra,Qr[1]=Pa+Za*pa),!0}}}}}var pi=1e9,Va=-pi;function ea(br,Qr,Nn,An){function di(uo,Sa){return br<=uo&&uo<=Nn&&Qr<=Sa&&Sa<=An}function Pi(uo,Sa,Za,Ra){var pa=0,_o=0;if(uo==null||(pa=ga(uo,Za))!==(_o=ga(Sa,Za))||Ja(uo,Sa)<0^Za>0)do Ra.point(pa===0||pa===3?br:Nn,pa>1?An:Qr);while((pa=(pa+Za+4)%4)!==_o);else Ra.point(Sa[0],Sa[1])}function ga(uo,Sa){return x(uo[0]-br)0?0:3:x(uo[0]-Nn)0?2:1:x(uo[1]-Qr)0?1:0:Sa>0?3:2}function Pa(uo,Sa){return Ja(uo.x,Sa.x)}function Ja(uo,Sa){var Za=ga(uo,1),Ra=ga(Sa,1);return Za!==Ra?Za-Ra:Za===0?Sa[1]-uo[1]:Za===1?uo[0]-Sa[0]:Za===2?uo[1]-Sa[1]:Sa[0]-uo[0]}return function(uo){var Sa=uo,Za=Fe(),Ra,pa,_o,fs,os,gs,ws,bo,lo,ks,dl,Vl={point:gc,lineStart:tu,lineEnd:$c,polygonStart:vc,polygonEnd:El};function gc(qo,Bs){di(qo,Bs)&&Sa.point(qo,Bs)}function ec(){for(var qo=0,Bs=0,ac=pa.length;BsAn&&(qh-Wh)*(An-rh)>(Wc-rh)*(br-Wh)&&++qo:Wc<=An&&(qh-Wh)*(An-rh)<(Wc-rh)*(br-Wh)&&--qo;return qo}function vc(){Sa=Za,Ra=[],pa=[],dl=!0}function El(){var qo=ec(),Bs=dl&&qo,ac=(Ra=y.merge(Ra)).length;(Bs||ac)&&(uo.polygonStart(),Bs&&(uo.lineStart(),Pi(null,null,1,uo),uo.lineEnd()),ac&&sn(Ra,Pa,qo,Pi,uo),uo.polygonEnd()),Sa=uo,Ra=pa=_o=null}function tu(){Vl.point=bc,pa&&pa.push(_o=[]),ks=!0,lo=!1,ws=bo=NaN}function $c(){Ra&&(bc(fs,os),gs&&lo&&Za.rejoin(),Ra.push(Za.result())),Vl.point=gc,lo&&Sa.lineEnd()}function bc(qo,Bs){var ac=di(qo,Bs);if(pa&&_o.push([qo,Bs]),ks)fs=qo,os=Bs,gs=ac,ks=!1,ac&&(Sa.lineStart(),Sa.point(qo,Bs));else if(ac&&lo)Sa.point(qo,Bs);else{var Zl=[ws=Math.max(Va,Math.min(pi,ws)),bo=Math.max(Va,Math.min(pi,bo))],Mu=[qo=Math.max(Va,Math.min(pi,qo)),Bs=Math.max(Va,Math.min(pi,Bs))];Gn(Zl,Mu,br,Qr,Nn,An)?(lo||(Sa.lineStart(),Sa.point(Zl[0],Zl[1])),Sa.point(Mu[0],Mu[1]),ac||Sa.lineEnd(),dl=!1):ac&&(Sa.lineStart(),Sa.point(qo,Bs),dl=!1)}ws=qo,bo=Bs,lo=ac}return Vl}}function go(){var br=0,Qr=0,Nn=960,An=500,di,Pi,ga;return ga={stream:function(Pa){return di&&Pi===Pa?di:di=ea(br,Qr,Nn,An)(Pi=Pa)},extent:function(Pa){return arguments.length?(br=+Pa[0][0],Qr=+Pa[0][1],Nn=+Pa[1][0],An=+Pa[1][1],di=Pi=null,ga):[[br,Qr],[Nn,An]]}}}var mo=z(),Go,Lo,Zo,Ka={sphere:B,point:B,lineStart:Cs,lineEnd:B,polygonStart:B,polygonEnd:B};function Cs(){Ka.point=wl,Ka.lineEnd=ps}function ps(){Ka.point=Ka.lineEnd=B}function wl(br,Qr){br*=b,Qr*=b,Go=br,Lo=I(Qr),Zo=d(Qr),Ka.point=is}function is(br,Qr){br*=b,Qr*=b;var Nn=I(Qr),An=d(Qr),di=x(br-Go),Pi=d(di),ga=I(di),Pa=An*ga,Ja=Zo*Nn-Lo*An*Pi,uo=Lo*Nn+Zo*An*Pi;mo.add(A(p(Pa*Pa+Ja*Ja),uo)),Go=br,Lo=Nn,Zo=An}function ol(br){return mo.reset(),q(br,Ka),+mo}var ms=[null,null],kl={type:"LineString",coordinates:ms};function ul(br,Qr){return ms[0]=br,ms[1]=Qr,ol(kl)}var Kl={Feature:function(br,Qr){return Ns(br.geometry,Qr)},FeatureCollection:function(br,Qr){for(var Nn=br.features,An=-1,di=Nn.length;++An0&&(di=ul(br[Pi],br[Pi-1]),di>0&&Nn<=di&&An<=di&&(Nn+An-di)*(1-Math.pow((Nn-An)/di,2))a}).map(Ra)).concat(y.range(k(Pi/uo)*uo,di,uo).filter(function(bo){return x(bo%Za)>a}).map(pa))}return gs.lines=function(){return ws().map(function(bo){return{type:"LineString",coordinates:bo}})},gs.outline=function(){return{type:"Polygon",coordinates:[_o(An).concat(fs(ga).slice(1),_o(Nn).reverse().slice(1),fs(Pa).reverse().slice(1))]}},gs.extent=function(bo){return arguments.length?gs.extentMajor(bo).extentMinor(bo):gs.extentMinor()},gs.extentMajor=function(bo){return arguments.length?(An=+bo[0][0],Nn=+bo[1][0],Pa=+bo[0][1],ga=+bo[1][1],An>Nn&&(bo=An,An=Nn,Nn=bo),Pa>ga&&(bo=Pa,Pa=ga,ga=bo),gs.precision(os)):[[An,Pa],[Nn,ga]]},gs.extentMinor=function(bo){return arguments.length?(Qr=+bo[0][0],br=+bo[1][0],Pi=+bo[0][1],di=+bo[1][1],Qr>br&&(bo=Qr,Qr=br,br=bo),Pi>di&&(bo=Pi,Pi=di,di=bo),gs.precision(os)):[[Qr,Pi],[br,di]]},gs.step=function(bo){return arguments.length?gs.stepMajor(bo).stepMinor(bo):gs.stepMinor()},gs.stepMajor=function(bo){return arguments.length?(Sa=+bo[0],Za=+bo[1],gs):[Sa,Za]},gs.stepMinor=function(bo){return arguments.length?(Ja=+bo[0],uo=+bo[1],gs):[Ja,uo]},gs.precision=function(bo){return arguments.length?(os=+bo,Ra=Wa(Pi,di,90),pa=Co(Qr,br,os),_o=Wa(Pa,ga,90),fs=Co(An,Nn,os),gs):os},gs.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function lc(){return el()()}function ss(br,Qr){var Nn=br[0]*b,An=br[1]*b,di=Qr[0]*b,Pi=Qr[1]*b,ga=d(An),Pa=I(An),Ja=d(Pi),uo=I(Pi),Sa=ga*d(Nn),Za=ga*I(Nn),Ra=Ja*d(di),pa=Ja*I(di),_o=2*S(p(N(Pi-An)+ga*Ja*N(di-Nn))),fs=I(_o),os=_o?function(gs){var ws=I(gs*=_o)/fs,bo=I(_o-gs)/fs,lo=bo*Sa+ws*Ra,ks=bo*Za+ws*pa,dl=bo*Pa+ws*uo;return[A(ks,lo)*m,A(dl,p(lo*lo+ks*ks))*m]}:function(){return[Nn*m,An*m]};return os.distance=_o,os}function nc(br){return br}var yl=z(),$l=z(),Gc,ko,zs,js,mc={point:B,lineStart:B,lineEnd:B,polygonStart:function(){mc.lineStart=Tl,mc.lineEnd=iu},polygonEnd:function(){mc.lineStart=mc.lineEnd=mc.point=B,yl.add(x($l)),$l.reset()},result:function(){var br=yl/2;return yl.reset(),br}};function Tl(){mc.point=us}function us(br,Qr){mc.point=Rc,Gc=zs=br,ko=js=Qr}function Rc(br,Qr){$l.add(js*br-zs*Qr),zs=br,js=Qr}function iu(){Rc(Gc,ko)}var Dl=1/0,ql=Dl,cc=-Dl,dc=cc,pu={point:Ah,lineStart:B,lineEnd:B,polygonStart:B,polygonEnd:B,result:function(){var br=[[Dl,ql],[cc,dc]];return cc=dc=-(ql=Dl=1/0),br}};function Ah(br,Qr){brcc&&(cc=br),Qrdc&&(dc=Qr)}var uh=0,yh=0,tf=0,Nd=0,Gl=0,Yu=0,ef=0,xu=0,mu=0,bu,_h,_c,gu,pl={point:ic,lineStart:jh,lineEnd:Lc,polygonStart:function(){pl.lineStart=Xf,pl.lineEnd=hl},polygonEnd:function(){pl.point=ic,pl.lineStart=jh,pl.lineEnd=Lc},result:function(){var br=mu?[ef/mu,xu/mu]:Yu?[Nd/Yu,Gl/Yu]:tf?[uh/tf,yh/tf]:[NaN,NaN];return uh=yh=tf=Nd=Gl=Yu=ef=xu=mu=0,br}};function ic(br,Qr){uh+=br,yh+=Qr,++tf}function jh(){pl.point=Hu}function Hu(br,Qr){pl.point=Qh,ic(_c=br,gu=Qr)}function Qh(br,Qr){var Nn=br-_c,An=Qr-gu,di=p(Nn*Nn+An*An);Nd+=di*(_c+br)/2,Gl+=di*(gu+Qr)/2,Yu+=di,ic(_c=br,gu=Qr)}function Lc(){pl.point=ic}function Xf(){pl.point=pp}function hl(){Hl(bu,_h)}function pp(br,Qr){pl.point=Hl,ic(bu=_c=br,_h=gu=Qr)}function Hl(br,Qr){var Nn=br-_c,An=Qr-gu,di=p(Nn*Nn+An*An);Nd+=di*(_c+br)/2,Gl+=di*(gu+Qr)/2,Yu+=di,di=gu*br-_c*Qr,ef+=di*(_c+br),xu+=di*(gu+Qr),mu+=di*3,ic(_c=br,gu=Qr)}function cs(br){this._context=br}cs.prototype={_radius:4.5,pointRadius:function(br){return this._radius=br,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(br,Qr){switch(this._point){case 0:{this._context.moveTo(br,Qr),this._point=1;break}case 1:{this._context.lineTo(br,Qr);break}default:{this._context.moveTo(br+this._radius,Qr),this._context.arc(br,Qr,this._radius,0,h);break}}},result:B};var _d=z(),xh,hu,rf,td,Ed,vu={point:B,lineStart:function(){vu.point=Lf},lineEnd:function(){xh&&hf(hu,rf),vu.point=B},polygonStart:function(){xh=!0},polygonEnd:function(){xh=null},result:function(){var br=+_d;return _d.reset(),br}};function Lf(br,Qr){vu.point=hf,hu=td=br,rf=Ed=Qr}function hf(br,Qr){td-=br,Ed-=Qr,_d.add(p(td*td+Ed*Ed)),td=br,Ed=Qr}function Ld(){this._string=[]}Ld.prototype={_radius:4.5,_circle:ed(4.5),pointRadius:function(br){return(br=+br)!==this._radius&&(this._radius=br,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(br,Qr){switch(this._point){case 0:{this._string.push("M",br,",",Qr),this._point=1;break}case 1:{this._string.push("L",br,",",Qr);break}default:{this._circle==null&&(this._circle=ed(this._radius)),this._string.push("M",br,",",Qr,this._circle);break}}},result:function(){if(this._string.length){var br=this._string.join("");return this._string=[],br}else return null}};function ed(br){return"m0,"+br+"a"+br+","+br+" 0 1,1 0,"+-2*br+"a"+br+","+br+" 0 1,1 0,"+2*br+"z"}function nf(br,Qr){var Nn=4.5,An,di;function Pi(ga){return ga&&(typeof Nn=="function"&&di.pointRadius(+Nn.apply(this,arguments)),q(ga,An(di))),di.result()}return Pi.area=function(ga){return q(ga,An(mc)),mc.result()},Pi.measure=function(ga){return q(ga,An(vu)),vu.result()},Pi.bounds=function(ga){return q(ga,An(pu)),pu.result()},Pi.centroid=function(ga){return q(ga,An(pl)),pl.result()},Pi.projection=function(ga){return arguments.length?(An=ga==null?(br=null,nc):(br=ga).stream,Pi):br},Pi.context=function(ga){return arguments.length?(di=ga==null?(Qr=null,new Ld):new cs(Qr=ga),typeof Nn!="function"&&di.pointRadius(Nn),Pi):Qr},Pi.pointRadius=function(ga){return arguments.length?(Nn=typeof ga=="function"?ga:(di.pointRadius(+ga),+ga),Pi):Nn},Pi.projection(br).context(Qr)}function af(br){return{stream:bh(br)}}function bh(br){return function(Qr){var Nn=new df;for(var An in br)Nn[An]=br[An];return Nn.stream=Qr,Nn}}function df(){}df.prototype={constructor:df,point:function(br,Qr){this.stream.point(br,Qr)},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()}};function Uh(br,Qr,Nn){var An=br.clipExtent&&br.clipExtent();return br.scale(150).translate([0,0]),An!=null&&br.clipExtent(null),q(Nn,br.stream(pu)),Qr(pu.result()),An!=null&&br.clipExtent(An),br}function Mh(br,Qr,Nn){return Uh(br,function(An){var di=Qr[1][0]-Qr[0][0],Pi=Qr[1][1]-Qr[0][1],ga=Math.min(di/(An[1][0]-An[0][0]),Pi/(An[1][1]-An[0][1])),Pa=+Qr[0][0]+(di-ga*(An[1][0]+An[0][0]))/2,Ja=+Qr[0][1]+(Pi-ga*(An[1][1]+An[0][1]))/2;br.scale(150*ga).translate([Pa,Ja])},Nn)}function yu(br,Qr,Nn){return Mh(br,[[0,0],Qr],Nn)}function fd(br,Qr,Nn){return Uh(br,function(An){var di=+Qr,Pi=di/(An[1][0]-An[0][0]),ga=(di-Pi*(An[1][0]+An[0][0]))/2,Pa=-Pi*An[0][1];br.scale(150*Pi).translate([ga,Pa])},Nn)}function of(br,Qr,Nn){return Uh(br,function(An){var di=+Qr,Pi=di/(An[1][1]-An[0][1]),ga=-Pi*An[0][0],Pa=(di-Pi*(An[1][1]+An[0][1]))/2;br.scale(150*Pi).translate([ga,Pa])},Nn)}var uc=16,jd=d(30*b);function Jf(br,Qr){return+Qr?Pd(br,Qr):ff(br)}function ff(br){return bh({point:function(Qr,Nn){Qr=br(Qr,Nn),this.stream.point(Qr[0],Qr[1])}})}function Pd(br,Qr){function Nn(An,di,Pi,ga,Pa,Ja,uo,Sa,Za,Ra,pa,_o,fs,os){var gs=uo-An,ws=Sa-di,bo=gs*gs+ws*ws;if(bo>4*Qr&&fs--){var lo=ga+Ra,ks=Pa+pa,dl=Ja+_o,Vl=p(lo*lo+ks*ks+dl*dl),gc=S(dl/=Vl),ec=x(x(dl)-1)Qr||x((gs*$c+ws*bc)/bo-.5)>.3||ga*Ra+Pa*pa+Ja*_o2?qo[2]%360*b:0,$c()):[Pa*m,Ja*m,uo*m]},El.angle=function(qo){return arguments.length?(Za=qo%360*b,$c()):Za*m},El.reflectX=function(qo){return arguments.length?(Ra=qo?-1:1,$c()):Ra<0},El.reflectY=function(qo){return arguments.length?(pa=qo?-1:1,$c()):pa<0},El.precision=function(qo){return arguments.length?(dl=Jf(Vl,ks=qo*qo),bc()):p(ks)},El.fitExtent=function(qo,Bs){return Mh(El,qo,Bs)},El.fitSize=function(qo,Bs){return yu(El,qo,Bs)},El.fitWidth=function(qo,Bs){return fd(El,qo,Bs)},El.fitHeight=function(qo,Bs){return of(El,qo,Bs)};function $c(){var qo=Vc(Nn,0,0,Ra,pa,Za).apply(null,Qr(Pi,ga)),Bs=(Za?Vc:mf)(Nn,An-qo[0],di-qo[1],Ra,pa,Za);return Sa=Li(Pa,Ja,uo),Vl=Un(Qr,Bs),gc=Un(Sa,Vl),dl=Jf(Vl,ks),bc()}function bc(){return ec=vc=null,El}return function(){return Qr=br.apply(this,arguments),El.invert=Qr.invert&&tu,$c()}}function xc(br){var Qr=0,Nn=o/3,An=rd(br),di=An(Qr,Nn);return di.parallels=function(Pi){return arguments.length?An(Qr=Pi[0]*b,Nn=Pi[1]*b):[Qr*m,Nn*m]},di}function $h(br){var Qr=d(br);function Nn(An,di){return[An*Qr,I(di)/Qr]}return Nn.invert=function(An,di){return[An/Qr,S(di*Qr)]},Nn}function ju(br,Qr){var Nn=I(br),An=(Nn+I(Qr))/2;if(x(An)=.12&&os<.234&&fs>=-.425&&fs<-.214?di:os>=.166&&os<.234&&fs>=-.214&&fs<-.115?ga:Nn).invert(Ra)},Sa.stream=function(Ra){return br&&Qr===Ra?br:br=xd([Nn.stream(Qr=Ra),di.stream(Ra),ga.stream(Ra)])},Sa.precision=function(Ra){return arguments.length?(Nn.precision(Ra),di.precision(Ra),ga.precision(Ra),Za()):Nn.precision()},Sa.scale=function(Ra){return arguments.length?(Nn.scale(Ra),di.scale(Ra*.35),ga.scale(Ra),Sa.translate(Nn.translate())):Nn.scale()},Sa.translate=function(Ra){if(!arguments.length)return Nn.translate();var pa=Nn.scale(),_o=+Ra[0],fs=+Ra[1];return An=Nn.translate(Ra).clipExtent([[_o-.455*pa,fs-.238*pa],[_o+.455*pa,fs+.238*pa]]).stream(uo),Pi=di.translate([_o-.307*pa,fs+.201*pa]).clipExtent([[_o-.425*pa+a,fs+.12*pa+a],[_o-.214*pa-a,fs+.234*pa-a]]).stream(uo),Pa=ga.translate([_o-.205*pa,fs+.212*pa]).clipExtent([[_o-.214*pa+a,fs+.166*pa+a],[_o-.115*pa-a,fs+.234*pa-a]]).stream(uo),Za()},Sa.fitExtent=function(Ra,pa){return Mh(Sa,Ra,pa)},Sa.fitSize=function(Ra,pa){return yu(Sa,Ra,pa)},Sa.fitWidth=function(Ra,pa){return fd(Sa,Ra,pa)},Sa.fitHeight=function(Ra,pa){return of(Sa,Ra,pa)};function Za(){return br=Qr=null,Sa}return Sa.scale(1070)}function nd(br){return function(Qr,Nn){var An=d(Qr),di=d(Nn),Pi=br(An*di);return[Pi*di*I(Qr),Pi*I(Nn)]}}function Ud(br){return function(Qr,Nn){var An=p(Qr*Qr+Nn*Nn),di=br(An),Pi=I(di),ga=d(di);return[A(Qr*Pi,An*ga),S(An&&Nn*Pi/An)]}}var Qf=nd(function(br){return p(2/(1+br))});Qf.invert=Ud(function(br){return 2*S(br/2)});function Ap(){return Ju(Qf).scale(124.75).clipAngle(180-.001)}var bd=nd(function(br){return(br=C(br))&&br/I(br)});bd.invert=Ud(function(br){return br});function $d(){return Ju(bd).scale(79.4188).clipAngle(180-.001)}function zu(br,Qr){return[br,D(g((c+Qr)/2))]}zu.invert=function(br,Qr){return[br,2*_(w(Qr))-c]};function wd(){return hh(zu).scale(961/h)}function hh(br){var Qr=Ju(br),Nn=Qr.center,An=Qr.scale,di=Qr.translate,Pi=Qr.clipExtent,ga=null,Pa,Ja,uo;Qr.scale=function(Za){return arguments.length?(An(Za),Sa()):An()},Qr.translate=function(Za){return arguments.length?(di(Za),Sa()):di()},Qr.center=function(Za){return arguments.length?(Nn(Za),Sa()):Nn()},Qr.clipExtent=function(Za){return arguments.length?(Za==null?ga=Pa=Ja=uo=null:(ga=+Za[0][0],Pa=+Za[0][1],Ja=+Za[1][0],uo=+Za[1][1]),Sa()):ga==null?null:[[ga,Pa],[Ja,uo]]};function Sa(){var Za=o*An(),Ra=Qr(ca(Qr.rotate()).invert([0,0]));return Pi(ga==null?[[Ra[0]-Za,Ra[1]-Za],[Ra[0]+Za,Ra[1]+Za]]:br===zu?[[Math.max(Ra[0]-Za,ga),Pa],[Math.min(Ra[0]+Za,Ja),uo]]:[[ga,Math.max(Ra[1]-Za,Pa)],[Ja,Math.min(Ra[1]+Za,uo)]])}return Sa()}function kd(br){return g((c+br)/2)}function Hd(br,Qr){var Nn=d(br),An=br===Qr?I(br):D(Nn/d(Qr))/D(kd(Qr)/kd(br)),di=Nn*E(kd(br),An)/An;if(!An)return zu;function Pi(ga,Pa){di>0?Pa<-c+a&&(Pa=-c+a):Pa>c-a&&(Pa=c-a);var Ja=di/E(kd(Pa),An);return[Ja*I(An*ga),di-Ja*d(An*ga)]}return Pi.invert=function(ga,Pa){var Ja=di-Pa,uo=M(An)*p(ga*ga+Ja*Ja),Sa=A(ga,x(Ja))*M(Ja);return Ja*An<0&&(Sa-=o*M(ga)*M(Ja)),[Sa/An,2*_(E(di/uo,1/An))-c]},Pi}function Lh(){return xc(Hd).scale(109.5).parallels([30,30])}function Ic(br,Qr){return[br,Qr]}Ic.invert=Ic;function Hh(){return Ju(Ic).scale(152.63)}function th(br,Qr){var Nn=d(br),An=br===Qr?I(br):(Nn-d(Qr))/(Qr-br),di=Nn/An+br;if(x(An)a&&--An>0);return[br/(.8707+(Pi=Nn*Nn)*(-.131979+Pi*(-.013791+Pi*Pi*Pi*(.003971-.001529*Pi)))),Nn]};function Ph(){return Ju(Vh).scale(175.295)}function Zc(br,Qr){return[d(Qr)*I(br),I(Qr)]}Zc.invert=Ud(S);function fc(){return Ju(Zc).scale(249.5).clipAngle(90+a)}function Ih(br,Qr){var Nn=d(Qr),An=1+d(br)*Nn;return[Nn*I(br)/An,I(Qr)/An]}Ih.invert=Ud(function(br){return 2*_(br)});function Td(){return Ju(Ih).scale(250).clipAngle(142)}function Dh(br,Qr){return[D(g((c+Qr)/2)),-br]}Dh.invert=function(br,Qr){return[-Qr,2*_(w(br))-c]};function sf(){var br=hh(Dh),Qr=br.center,Nn=br.rotate;return br.center=function(An){return arguments.length?Qr([-An[1],An[0]]):(An=Qr(),[An[1],-An[0]])},br.rotate=function(An){return arguments.length?Nn([An[0],An[1],An.length>2?An[2]+90:90]):(An=Nn(),[An[0],An[1],An[2]-90])},Nn([0,0,90]).scale(159.155)}f.geoAlbers=Pc,f.geoAlbersUsa=Eh,f.geoArea=J,f.geoAzimuthalEqualArea=Ap,f.geoAzimuthalEqualAreaRaw=Qf,f.geoAzimuthalEquidistant=$d,f.geoAzimuthalEquidistantRaw=bd,f.geoBounds=Xt,f.geoCentroid=mn,f.geoCircle=so,f.geoClipAntimeridian=en,f.geoClipCircle=Jn,f.geoClipExtent=go,f.geoClipRectangle=ea,f.geoConicConformal=Lh,f.geoConicConformalRaw=Hd,f.geoConicEqualArea=Qu,f.geoConicEqualAreaRaw=ju,f.geoConicEquidistant=Pf,f.geoConicEquidistantRaw=th,f.geoContains=Xs,f.geoDistance=ul,f.geoEqualEarth=tp,f.geoEqualEarthRaw=Dd,f.geoEquirectangular=Hh,f.geoEquirectangularRaw=Ic,f.geoGnomonic=gf,f.geoGnomonicRaw=Au,f.geoGraticule=el,f.geoGraticule10=lc,f.geoIdentity=fh,f.geoInterpolate=ss,f.geoLength=ol,f.geoMercator=wd,f.geoMercatorRaw=zu,f.geoNaturalEarth1=Ph,f.geoNaturalEarth1Raw=Vh,f.geoOrthographic=fc,f.geoOrthographicRaw=Zc,f.geoPath=nf,f.geoProjection=Ju,f.geoProjectionMutator=rd,f.geoRotation=ca,f.geoStereographic=Td,f.geoStereographicRaw=Ih,f.geoStream=q,f.geoTransform=af,f.geoTransverseMercator=sf,f.geoTransverseMercatorRaw=Dh,Object.defineProperty(f,"__esModule",{value:!0})})}),CX=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,MD(),Ek()):y(f.d3=f.d3||{},f.d3,f.d3)})(et,function(f,y,z){var P=Math.abs,n=Math.atan,i=Math.atan2,a=Math.cos,l=Math.exp,o=Math.floor,c=Math.log,s=Math.max,h=Math.min,m=Math.pow,b=Math.round,x=Math.sign||function(te){return te>0?1:te<0?-1:0},_=Math.sin,A=Math.tan,d=1e-6,k=1e-12,w=Math.PI,D=w/2,E=w/4,I=Math.SQRT1_2,M=V(2),p=V(w),g=w*2,C=180/w,S=w/180;function N(te){return te?te/Math.sin(te):1}function B(te){return te>1?D:te<-1?-D:Math.asin(te)}function U(te){return te>1?0:te<-1?w:Math.acos(te)}function V(te){return te>0?Math.sqrt(te):0}function W(te){return te=l(2*te),(te-1)/(te+1)}function F(te){return(l(te)-l(-te))/2}function H(te){return(l(te)+l(-te))/2}function q(te){return c(te+V(te*te+1))}function G(te){return c(te+V(te*te-1))}function tt(te){var le=A(te/2),Te=2*c(a(te/2))/(le*le);function Pe(We,Ne){var Xe=a(We),Pr=a(Ne),qr=_(Ne),Xr=Pr*Xe,gn=-((1-Xr?c((1+Xr)/2)/(1-Xr):-.5)+Te/(1+Xr));return[gn*Pr*_(We),gn*qr]}return Pe.invert=function(We,Ne){var Xe=V(We*We+Ne*Ne),Pr=-te/2,qr=50,Xr;if(!Xe)return[0,0];do{var gn=Pr/2,zn=a(gn),Qn=_(gn),ai=Qn/zn,Ti=-c(P(zn));Pr-=Xr=(2/ai*Ti-Te*ai-Xe)/(-Ti/(Qn*Qn)+1-Te/(2*zn*zn))*(zn<0?.7:1)}while(P(Xr)>d&&--qr>0);var Qi=_(Pr);return[i(We*Qi,Xe*a(Pr)),B(Ne*Qi/Xe)]},Pe}function ht(){var te=D,le=y.geoProjectionMutator(tt),Te=le(te);return Te.radius=function(Pe){return arguments.length?le(te=Pe*S):te*C},Te.scale(179.976).clipAngle(147)}function bt(te,le){var Te=a(le),Pe=N(U(Te*a(te/=2)));return[2*Te*_(te)*Pe,_(le)*Pe]}bt.invert=function(te,le){if(!(te*te+4*le*le>w*w+d)){var Te=te,Pe=le,We=25;do{var Ne=_(Te),Xe=_(Te/2),Pr=a(Te/2),qr=_(Pe),Xr=a(Pe),gn=_(2*Pe),zn=qr*qr,Qn=Xr*Xr,ai=Xe*Xe,Ti=1-Qn*Pr*Pr,Qi=Ti?U(Xr*Pr)*V(Ma=1/Ti):Ma=0,Ma,Aa=2*Qi*Xr*Xe-te,Fa=Qi*qr-le,wo=Ma*(Qn*ai+Qi*Xr*Pr*zn),Yo=Ma*(.5*Ne*gn-Qi*2*qr*Xe),Fo=Ma*.25*(gn*Xe-Qi*qr*Qn*Ne),xs=Ma*(zn*Pr+Qi*ai*Xr),Sl=Yo*Fo-xs*wo;if(!Sl)break;var Ll=(Fa*Yo-Aa*xs)/Sl,Ws=(Aa*Fo-Fa*wo)/Sl;Te-=Ll,Pe-=Ws}while((P(Ll)>d||P(Ws)>d)&&--We>0);return[Te,Pe]}};function vt(){return y.geoProjection(bt).scale(152.63)}function ut(te){var le=_(te),Te=a(te),Pe=te>=0?1:-1,We=A(Pe*te),Ne=(1+le-Te)/2;function Xe(Pr,qr){var Xr=a(qr),gn=a(Pr/=2);return[(1+Xr)*_(Pr),(Pe*qr>-i(gn,We)-.001?0:-Pe*10)+Ne+_(qr)*Te-(1+Xr)*le*gn]}return Xe.invert=function(Pr,qr){var Xr=0,gn=0,zn=50;do{var Qn=a(Xr),ai=_(Xr),Ti=a(gn),Qi=_(gn),Ma=1+Ti,Aa=Ma*ai-Pr,Fa=Ne+Qi*Te-Ma*le*Qn-qr,wo=Ma*Qn/2,Yo=-ai*Qi,Fo=le*Ma*ai/2,xs=Te*Ti+le*Qn*Qi,Sl=Yo*Fo-xs*wo,Ll=(Fa*Yo-Aa*xs)/Sl/2,Ws=(Aa*Fo-Fa*wo)/Sl;P(Ws)>2&&(Ws/=2),Xr-=Ll,gn-=Ws}while((P(Ll)>d||P(Ws)>d)&&--zn>0);return Pe*gn>-i(a(Xr),We)-.001?[Xr*2,gn]:null},Xe}function rt(){var te=20*S,le=te>=0?1:-1,Te=A(le*te),Pe=y.geoProjectionMutator(ut),We=Pe(te),Ne=We.stream;return We.parallel=function(Xe){return arguments.length?(Te=A((le=(te=Xe*S)>=0?1:-1)*te),Pe(te)):te*C},We.stream=function(Xe){var Pr=We.rotate(),qr=Ne(Xe),Xr=(We.rotate([0,0]),Ne(Xe)),gn=We.precision();return We.rotate(Pr),qr.sphere=function(){Xr.polygonStart(),Xr.lineStart();for(var zn=le*-180;le*zn<180;zn+=le*90)Xr.point(zn,le*90);if(te)for(;le*(zn-=3*le*gn)>=-180;)Xr.point(zn,le*-i(a(zn*S/2),Te)*C);Xr.lineEnd(),Xr.polygonEnd()},qr},We.scale(218.695).center([0,28.0974])}function gt(te,le){var Te=A(le/2),Pe=V(1-Te*Te),We=1+Pe*a(te/=2),Ne=_(te)*Pe/We,Xe=Te/We,Pr=Ne*Ne,qr=Xe*Xe;return[4/3*Ne*(3+Pr-3*qr),4/3*Xe*(3+3*Pr-qr)]}gt.invert=function(te,le){if(te*=3/8,le*=3/8,!te&&P(le)>1)return null;var Te=te*te,Pe=le*le,We=1+Te+Pe,Ne=V((We-V(We*We-4*le*le))/2),Xe=B(Ne)/3,Pr=Ne?G(P(le/Ne))/3:q(P(te))/3,qr=a(Xe),Xr=H(Pr),gn=Xr*Xr-qr*qr;return[x(te)*2*i(F(Pr)*qr,.25-gn),x(le)*2*i(Xr*_(Xe),.25+gn)]};function it(){return y.geoProjection(gt).scale(66.1603)}var st=V(8),xt=c(1+M);function ot(te,le){var Te=P(le);return Tek&&--Pe>0);return[te/(a(Te)*(st-1/_(Te))),x(le)*Te]};function J(){return y.geoProjection(ot).scale(112.314)}function mt(te){var le=2*w/te;function Te(Pe,We){var Ne=y.geoAzimuthalEquidistantRaw(Pe,We);if(P(Pe)>D){var Xe=i(Ne[1],Ne[0]),Pr=V(Ne[0]*Ne[0]+Ne[1]*Ne[1]),qr=le*b((Xe-D)/le)+D,Xr=i(_(Xe-=qr),2-a(Xe));Xe=qr+B(w/Pr*_(Xr))-Xr,Ne[0]=Pr*a(Xe),Ne[1]=Pr*_(Xe)}return Ne}return Te.invert=function(Pe,We){var Ne=V(Pe*Pe+We*We);if(Ne>D){var Xe=i(We,Pe),Pr=le*b((Xe-D)/le)+D,qr=Xe>Pr?-1:1,Xr=Ne*a(Pr-Xe),gn=1/A(qr*U((Xr-w)/V(w*(w-2*Xr)+Ne*Ne)));Xe=Pr+2*n((gn+qr*V(gn*gn-3))/3),Pe=Ne*a(Xe),We=Ne*_(Xe)}return y.geoAzimuthalEquidistantRaw.invert(Pe,We)},Te}function dt(){var te=5,le=y.geoProjectionMutator(mt),Te=le(te),Pe=Te.stream,We=.01,Ne=-a(We*S),Xe=_(We*S);return Te.lobes=function(Pr){return arguments.length?le(te=+Pr):te},Te.stream=function(Pr){var qr=Te.rotate(),Xr=Pe(Pr),gn=(Te.rotate([0,0]),Pe(Pr));return Te.rotate(qr),Xr.sphere=function(){gn.polygonStart(),gn.lineStart();for(var zn=0,Qn=360/te,ai=2*w/te,Ti=90-180/te,Qi=D;zn0&&P(We)>d);return Pe<0?NaN:Te}function Gt(te,le,Te){return le===void 0&&(le=40),Te===void 0&&(Te=k),function(Pe,We,Ne,Xe){var Pr,qr,Xr;Ne=Ne===void 0?0:+Ne,Xe=Xe===void 0?0:+Xe;for(var gn=0;gnPr){Ne-=qr/=2,Xe-=Xr/=2;continue}Pr=Ti;var Qi=(Ne>0?-1:1)*Te,Ma=(Xe>0?-1:1)*Te,Aa=te(Ne+Qi,Xe),Fa=te(Ne,Xe+Ma),wo=(Aa[0]-zn[0])/Qi,Yo=(Aa[1]-zn[1])/Qi,Fo=(Fa[0]-zn[0])/Ma,xs=(Fa[1]-zn[1])/Ma,Sl=xs*wo-Yo*Fo,Ll=(P(Sl)<.5?.5:1)/Sl;if(qr=(ai*Fo-Qn*xs)*Ll,Xr=(Qn*Yo-ai*wo)*Ll,Ne+=qr,Xe+=Xr,P(qr)0&&(Pr[1]*=1+qr/1.5*Pr[0]*Pr[0]),Pr}return Pe.invert=Gt(Pe),Pe}function xe(){return y.geoProjection(ee()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ge(te,le){var Te=te*_(le),Pe=30,We;do le-=We=(le+_(le)-Te)/(1+a(le));while(P(We)>d&&--Pe>0);return le/2}function ye(te,le,Te){function Pe(We,Ne){return[te*We*a(Ne=ge(Te,Ne)),le*_(Ne)]}return Pe.invert=function(We,Ne){return Ne=B(Ne/le),[We/(te*a(Ne)),B((2*Ne+_(2*Ne))/Te)]},Pe}var ue=ye(M/D,M,w);function Mt(){return y.geoProjection(ue).scale(169.529)}var Ot=2.00276,Lt=1.11072;function ie(te,le){var Te=ge(w,le);return[Ot*te/(1/a(le)+Lt/a(Te)),(le+M*_(Te))/Ot]}ie.invert=function(te,le){var Te=Ot*le,Pe=le<0?-E:E,We=25,Ne,Xe;do Xe=Te-M*_(Pe),Pe-=Ne=(_(2*Pe)+2*Pe-w*_(Xe))/(2*a(2*Pe)+2+w*a(Xe)*M*a(Pe));while(P(Ne)>d&&--We>0);return Xe=Te-M*_(Pe),[te*(1/a(Xe)+Lt/a(Pe))/Ot,Xe]};function be(){return y.geoProjection(ie).scale(160.857)}function ce(te){var le=0,Te=y.geoProjectionMutator(te),Pe=Te(le);return Pe.parallel=function(We){return arguments.length?Te(le=We*S):le*C},Pe}function Le(te,le){return[te*a(le),le]}Le.invert=function(te,le){return[te/a(le),le]};function Ze(){return y.geoProjection(Le).scale(152.63)}function Qe(te){if(!te)return Le;var le=1/A(te);function Te(Pe,We){var Ne=le+te-We,Xe=Ne&&Pe*a(We)/Ne;return[Ne*_(Xe),le-Ne*a(Xe)]}return Te.invert=function(Pe,We){var Ne=V(Pe*Pe+(We=le-We)*We),Xe=le+te-Ne;return[Ne/a(Xe)*i(Pe,We),Xe]},Te}function mr(){return ce(Qe).scale(123.082).center([0,26.1441]).parallel(45)}function fr(te){function le(Te,Pe){var We=D-Pe,Ne=We&&Te*te*_(We)/We;return[We*_(Ne)/te,D-We*a(Ne)]}return le.invert=function(Te,Pe){var We=Te*te,Ne=D-Pe,Xe=V(We*We+Ne*Ne),Pr=i(We,Ne);return[(Xe?Xe/_(Xe):1)*Pr/te,D-Xe]},le}function Jr(){var te=.5,le=y.geoProjectionMutator(fr),Te=le(te);return Te.fraction=function(Pe){return arguments.length?le(te=+Pe):te},Te.scale(158.837)}var an=ye(1,4/w,w);function Er(){return y.geoProjection(an).scale(152.63)}function dn(te,le,Te,Pe,We,Ne){var Xe=a(Ne),Pr;if(P(te)>1||P(Ne)>1)Pr=U(Te*We+le*Pe*Xe);else{var qr=_(te/2),Xr=_(Ne/2);Pr=2*B(V(qr*qr+le*Pe*Xr*Xr))}return P(Pr)>d?[Pr,i(Pe*_(Ne),le*We-Te*Pe*Xe)]:[0,0]}function _n(te,le,Te){return U((te*te+le*le-Te*Te)/(2*te*le))}function Oe(te){return te-2*w*o((te+w)/(2*w))}function Xt(te,le,Te){for(var Pe=[[te[0],te[1],_(te[1]),a(te[1])],[le[0],le[1],_(le[1]),a(le[1])],[Te[0],Te[1],_(Te[1]),a(Te[1])]],We=Pe[2],Ne,Xe=0;Xe<3;++Xe,We=Ne)Ne=Pe[Xe],We.v=dn(Ne[1]-We[1],We[3],We[2],Ne[3],Ne[2],Ne[0]-We[0]),We.point=[0,0];var Pr=_n(Pe[0].v[0],Pe[2].v[0],Pe[1].v[0]),qr=_n(Pe[0].v[0],Pe[1].v[0],Pe[2].v[0]),Xr=w-Pr;Pe[2].point[1]=0,Pe[0].point[0]=-(Pe[1].point[0]=Pe[0].v[0]/2);var gn=[Pe[2].point[0]=Pe[0].point[0]+Pe[2].v[0]*a(Pr),2*(Pe[0].point[1]=Pe[1].point[1]=Pe[2].v[0]*_(Pr))];function zn(Qn,ai){var Ti=_(ai),Qi=a(ai),Ma=new Array(3),Aa;for(Aa=0;Aa<3;++Aa){var Fa=Pe[Aa];if(Ma[Aa]=dn(ai-Fa[1],Fa[3],Fa[2],Qi,Ti,Qn-Fa[0]),!Ma[Aa][0])return Fa.point;Ma[Aa][1]=Oe(Ma[Aa][1]-Fa.v[1])}var wo=gn.slice();for(Aa=0;Aa<3;++Aa){var Yo=Aa==2?0:Aa+1,Fo=_n(Pe[Aa].v[0],Ma[Aa][0],Ma[Yo][0]);Ma[Aa][1]<0&&(Fo=-Fo),Aa?Aa==1?(Fo=qr-Fo,wo[0]-=Ma[Aa][0]*a(Fo),wo[1]-=Ma[Aa][0]*_(Fo)):(Fo=Xr-Fo,wo[0]+=Ma[Aa][0]*a(Fo),wo[1]+=Ma[Aa][0]*_(Fo)):(wo[0]+=Ma[Aa][0]*a(Fo),wo[1]-=Ma[Aa][0]*_(Fo))}return wo[0]/=3,wo[1]/=3,wo}return zn}function oe(te){return te[0]*=S,te[1]*=S,te}function zt(){return _t([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function _t(te,le,Te){var Pe=y.geoCentroid({type:"MultiPoint",coordinates:[te,le,Te]}),We=[-Pe[0],-Pe[1]],Ne=y.geoRotation(We),Xe=Xt(oe(Ne(te)),oe(Ne(le)),oe(Ne(Te)));Xe.invert=Gt(Xe);var Pr=y.geoProjection(Xe).rotate(We),qr=Pr.center;return delete Pr.rotate,Pr.center=function(Xr){return arguments.length?qr(Ne(Xr)):Ne.invert(qr())},Pr.clipAngle(90)}function Pt(te,le){var Te=V(1-_(le));return[2/p*te*Te,p*(1-Te)]}Pt.invert=function(te,le){var Te=(Te=le/p-1)*Te;return[Te>0?te*V(w/Te)/2:0,B(1-Te)]};function Ht(){return y.geoProjection(Pt).scale(95.6464).center([0,30])}function ae(te){var le=A(te);function Te(Pe,We){return[Pe,(Pe?Pe/_(Pe):1)*(_(We)*a(Pe)-le*a(We))]}return Te.invert=le?function(Pe,We){Pe&&(We*=_(Pe)/Pe);var Ne=a(Pe);return[Pe,2*i(V(Ne*Ne+le*le-We*We)-Ne,le-We)]}:function(Pe,We){return[Pe,B(Pe?We*A(Pe)/Pe:We)]},Te}function he(){return ce(ae).scale(249.828).clipAngle(90)}var Me=V(3);function qe(te,le){return[Me*te*(2*a(2*le/3)-1)/p,Me*p*_(le/3)]}qe.invert=function(te,le){var Te=3*B(le/(Me*p));return[p*te/(Me*(2*a(2*Te/3)-1)),Te]};function Ye(){return y.geoProjection(qe).scale(156.19)}function ur(te){var le=a(te);function Te(Pe,We){return[Pe*le,_(We)/le]}return Te.invert=function(Pe,We){return[Pe/le,B(We*le)]},Te}function Rr(){return ce(ur).parallel(38.58).scale(195.044)}function zr(te){var le=a(te);function Te(Pe,We){return[Pe*le,(1+le)*A(We/2)]}return Te.invert=function(Pe,We){return[Pe/le,n(We/(1+le))*2]},Te}function xr(){return ce(zr).scale(124.75)}function pn(te,le){var Te=V(8/(3*w));return[Te*te*(1-P(le)/w),Te*le]}pn.invert=function(te,le){var Te=V(8/(3*w)),Pe=le/Te;return[te/(Te*(1-P(Pe)/w)),Pe]};function ci(){return y.geoProjection(pn).scale(165.664)}function ui(te,le){var Te=V(4-3*_(P(le)));return[2/V(6*w)*te*Te,x(le)*V(2*w/3)*(2-Te)]}ui.invert=function(te,le){var Te=2-P(le)/V(2*w/3);return[te*V(6*w)/(2*Te),x(le)*B((4-Te*Te)/3)]};function yi(){return y.geoProjection(ui).scale(165.664)}function Gi(te,le){var Te=V(w*(4+w));return[2/Te*te*(1+V(1-4*le*le/(w*w))),4/Te*le]}Gi.invert=function(te,le){var Te=V(w*(4+w))/2;return[te*Te/(1+V(1-le*le*(4+w)/(4*w))),le*Te/2]};function Ci(){return y.geoProjection(Gi).scale(180.739)}function fi(te,le){var Te=(2+D)*_(le);le/=2;for(var Pe=0,We=1/0;Pe<10&&P(We)>d;Pe++){var Ne=a(le);le-=We=(le+_(le)*(Ne+2)-Te)/(2*Ne*(1+Ne))}return[2/V(w*(4+w))*te*(1+a(le)),2*V(w/(4+w))*_(le)]}fi.invert=function(te,le){var Te=le*V((4+w)/w)/2,Pe=B(Te),We=a(Pe);return[te/(2/V(w*(4+w))*(1+We)),B((Pe+Te*(We+2))/(2+D))]};function ba(){return y.geoProjection(fi).scale(180.739)}function oa(te,le){return[te*(1+a(le))/V(2+w),2*le/V(2+w)]}oa.invert=function(te,le){var Te=V(2+w),Pe=le*Te/2;return[Te*te/(1+a(Pe)),Pe]};function Ke(){return y.geoProjection(oa).scale(173.044)}function sr(te,le){for(var Te=(1+D)*_(le),Pe=0,We=1/0;Pe<10&&P(We)>d;Pe++)le-=We=(le+_(le)-Te)/(1+a(le));return Te=V(2+w),[te*(1+a(le))/Te,2*le/Te]}sr.invert=function(te,le){var Te=1+D,Pe=V(Te/2);return[te*2*Pe/(1+a(le*=Pe)),B((le+_(le))/Te)]};function vr(){return y.geoProjection(sr).scale(173.044)}var Ar=3+2*M;function mn(te,le){var Te=_(te/=2),Pe=a(te),We=V(a(le)),Ne=a(le/=2),Xe=_(le)/(Ne+M*Pe*We),Pr=V(2/(1+Xe*Xe)),qr=V((M*Ne+(Pe+Te)*We)/(M*Ne+(Pe-Te)*We));return[Ar*(Pr*(qr-1/qr)-2*c(qr)),Ar*(Pr*Xe*(qr+1/qr)-2*n(Xe))]}mn.invert=function(te,le){if(!(Ne=gt.invert(te/1.2,le*1.065)))return null;var Te=Ne[0],Pe=Ne[1],We=20,Ne;te/=Ar,le/=Ar;do{var Xe=Te/2,Pr=Pe/2,qr=_(Xe),Xr=a(Xe),gn=_(Pr),zn=a(Pr),Qn=a(Pe),ai=V(Qn),Ti=gn/(zn+M*Xr*ai),Qi=Ti*Ti,Ma=V(2/(1+Qi)),Aa=M*zn+(Xr+qr)*ai,Fa=M*zn+(Xr-qr)*ai,wo=Aa/Fa,Yo=V(wo),Fo=Yo-1/Yo,xs=Yo+1/Yo,Sl=Ma*Fo-2*c(Yo)-te,Ll=Ma*Ti*xs-2*n(Ti)-le,Ws=gn&&I*ai*qr*Qi/gn,zl=(M*Xr*zn+ai)/(2*(zn+M*Xr*ai)*(zn+M*Xr*ai)*ai),Fc=-.5*Ti*Ma*Ma*Ma,Sc=Fc*Ws,rl=Fc*zl,nl=(nl=2*zn+M*ai*(Xr-qr))*nl*Yo,au=(M*Xr*zn*ai+Qn)/nl,wu=-(M*qr*gn)/(ai*nl),ih=Fo*Sc-2*au/Yo+Ma*(au+au/wo),Et=Fo*rl-2*wu/Yo+Ma*(wu+wu/wo),Vt=Ti*xs*Sc-2*Ws/(1+Qi)+Ma*xs*Ws+Ma*Ti*(au-au/wo),de=Ti*xs*rl-2*zl/(1+Qi)+Ma*xs*zl+Ma*Ti*(wu-wu/wo),Ie=Et*Vt-de*ih;if(!Ie)break;var Be=(Ll*Et-Sl*de)/Ie,He=(Sl*Vt-Ll*ih)/Ie;Te-=Be,Pe=s(-D,h(D,Pe-He))}while((P(Be)>d||P(He)>d)&&--We>0);return P(P(Pe)-D)Pe){var zn=V(gn),Qn=i(Xr,qr),ai=Te*b(Qn/Te),Ti=Qn-ai,Qi=te*a(Ti),Ma=(te*_(Ti)-Ti*_(Qi))/(D-Qi),Aa=Re(Ti,Ma),Fa=(w-te)/Kr(Aa,Qi,w);qr=zn;var wo=50,Yo;do qr-=Yo=(te+Kr(Aa,Qi,qr)*Fa-zn)/(Aa(qr)*Fa);while(P(Yo)>d&&--wo>0);Xr=Ti*_(qr),qrPe){var qr=V(Pr),Xr=i(Xe,Ne),gn=Te*b(Xr/Te),zn=Xr-gn;Ne=qr*a(zn),Xe=qr*_(zn);for(var Qn=Ne-D,ai=_(Ne),Ti=Xe/ai,Qi=Ned||P(Ti)>d)&&--Qi>0);return[zn,Qn]},qr}var Yr=cn(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function un(){return y.geoProjection(Yr).scale(149.995)}var Pn=cn(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function bn(){return y.geoProjection(Pn).scale(153.93)}var ze=cn(5/6*w,-.62636,-.0344,0,1.3493,-.05524,0,.045);function yr(){return y.geoProjection(ze).scale(130.945)}function en(te,le){var Te=te*te,Pe=le*le;return[te*(1-.162388*Pe)*(.87-952426e-9*Te*Te),le*(1+Pe/12)]}en.invert=function(te,le){var Te=te,Pe=le,We=50,Ne;do{var Xe=Pe*Pe;Pe-=Ne=(Pe*(1+Xe/12)-le)/(1+Xe/4)}while(P(Ne)>d&&--We>0);We=50,te/=1-.162388*Xe;do{var Pr=(Pr=Te*Te)*Pr;Te-=Ne=(Te*(.87-952426e-9*Pr)-te)/(.87-.00476213*Pr)}while(P(Ne)>d&&--We>0);return[Te,Pe]};function Rn(){return y.geoProjection(en).scale(131.747)}var ni=cn(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function xi(){return y.geoProjection(ni).scale(131.087)}function Jn(te){var le=te(D,0)[0]-te(-D,0)[0];function Te(Pe,We){var Ne=Pe>0?-.5:.5,Xe=te(Pe+Ne*w,We);return Xe[0]-=Ne*le,Xe}return te.invert&&(Te.invert=function(Pe,We){var Ne=Pe>0?-.5:.5,Xe=te.invert(Pe+Ne*le,We),Pr=Xe[0]-Ne*w;return Pr<-w?Pr+=2*w:Pr>w&&(Pr-=2*w),Xe[0]=Pr,Xe}),Te}function Gn(te,le){var Te=x(te),Pe=x(le),We=a(le),Ne=a(te)*We,Xe=_(te)*We,Pr=_(Pe*le);te=P(i(Xe,Pr)),le=B(Ne),P(te-D)>d&&(te%=D);var qr=pi(te>w/4?D-te:te,le);return te>w/4&&(Pr=qr[0],qr[0]=-qr[1],qr[1]=-Pr),qr[0]*=Te,qr[1]*=-Pe,qr}Gn.invert=function(te,le){P(te)>1&&(te=x(te)*2-te),P(le)>1&&(le=x(le)*2-le);var Te=x(te),Pe=x(le),We=-Te*te,Ne=-Pe*le,Xe=Ne/We<1,Pr=Va(Xe?Ne:We,Xe?We:Ne),qr=Pr[0],Xr=Pr[1],gn=a(Xr);return Xe&&(qr=-D-qr),[Te*(i(_(qr)*gn,-_(Xr))+w),Pe*B(a(qr)*gn)]};function pi(te,le){if(le===D)return[0,0];var Te=_(le),Pe=Te*Te,We=Pe*Pe,Ne=1+We,Xe=1+3*We,Pr=1-We,qr=B(1/V(Ne)),Xr=Pr+Pe*Ne*qr,gn=(1-Te)/Xr,zn=V(gn),Qn=gn*Ne,ai=V(Qn),Ti=zn*Pr,Qi,Ma;if(te===0)return[0,-(Ti+Pe*ai)];var Aa=a(le),Fa=1/Aa,wo=2*Te*Aa,Yo=(-3*Pe+qr*Xe)*wo,Fo=(-Xr*Aa-(1-Te)*Yo)/(Xr*Xr),xs=.5*Fo/zn,Sl=Pr*xs-2*Pe*zn*wo,Ll=Pe*Ne*Fo+gn*Xe*wo,Ws=-Fa*wo,zl=-Fa*Ll,Fc=-2*Fa*Sl,Sc=4*te/w,rl;if(te>.222*w||le.175*w){if(Qi=(Ti+Pe*V(Qn*(1+We)-Ti*Ti))/(1+We),te>w/4)return[Qi,Qi];var nl=Qi,au=.5*Qi;Qi=.5*(au+nl),Ma=50;do{var wu=V(Qn-Qi*Qi),ih=Qi*(Fc+Ws*wu)+zl*B(Qi/ai)-Sc;if(!ih)break;ih<0?au=Qi:nl=Qi,Qi=.5*(au+nl)}while(P(nl-au)>d&&--Ma>0)}else{Qi=d,Ma=25;do{var Et=Qi*Qi,Vt=V(Qn-Et),de=Fc+Ws*Vt,Ie=Qi*de+zl*B(Qi/ai)-Sc,Be=de+(zl-Ws*Et)/Vt;Qi-=rl=Vt?Ie/Be:0}while(P(rl)>d&&--Ma>0)}return[Qi,-Ti-Pe*V(Qn-Qi*Qi)]}function Va(te,le){for(var Te=0,Pe=1,We=.5,Ne=50;;){var Xe=We*We,Pr=V(We),qr=B(1/V(1+Xe)),Xr=1-Xe+We*(1+Xe)*qr,gn=(1-Pr)/Xr,zn=V(gn),Qn=gn*(1+Xe),ai=zn*(1-Xe),Ti=Qn-te*te,Qi=V(Ti),Ma=le+ai+We*Qi;if(P(Pe-Te)0?Te=We:Pe=We,We=.5*(Te+Pe)}if(!Ne)return null;var Aa=B(Pr),Fa=a(Aa),wo=1/Fa,Yo=2*Pr*Fa,Fo=(-3*We+qr*(1+3*Xe))*Yo,xs=(-Xr*Fa-(1-Pr)*Fo)/(Xr*Xr),Sl=.5*xs/zn,Ll=(1-Xe)*Sl-2*We*zn*Yo,Ws=-2*wo*Ll,zl=-wo*Yo,Fc=-wo*(We*(1+Xe)*xs+gn*(1+3*Xe)*Yo);return[w/4*(te*(Ws+zl*Qi)+Fc*B(te/V(Qn))),Aa]}function ea(){return y.geoProjection(Jn(Gn)).scale(239.75)}function go(te,le,Te){var Pe,We,Ne;return te?(Pe=mo(te,Te),le?(We=mo(le,1-Te),Ne=We[1]*We[1]+Te*Pe[0]*Pe[0]*We[0]*We[0],[[Pe[0]*We[2]/Ne,Pe[1]*Pe[2]*We[0]*We[1]/Ne],[Pe[1]*We[1]/Ne,-Pe[0]*Pe[2]*We[0]*We[2]/Ne],[Pe[2]*We[1]*We[2]/Ne,-Te*Pe[0]*Pe[1]*We[0]/Ne]]):[[Pe[0],0],[Pe[1],0],[Pe[2],0]]):(We=mo(le,1-Te),[[0,We[0]/We[1]],[1/We[1],0],[We[2]/We[1],0]])}function mo(te,le){var Te,Pe,We,Ne,Xe;if(le=1-d)return Te=(1-le)/4,Pe=H(te),Ne=W(te),We=1/Pe,Xe=Pe*F(te),[Ne+Te*(Xe-te)/(Pe*Pe),We-Te*Ne*We*(Xe-te),We+Te*Ne*We*(Xe+te),2*n(l(te))-D+Te*(Xe-te)/Pe];var Pr=[1,0,0,0,0,0,0,0,0],qr=[V(le),0,0,0,0,0,0,0,0],Xr=0;for(Pe=V(1-le),Xe=1;P(qr[Xr]/Pr[Xr])>d&&Xr<8;)Te=Pr[Xr++],qr[Xr]=(Te-Pe)/2,Pr[Xr]=(Te+Pe)/2,Pe=V(Te*Pe),Xe*=2;We=Xe*Pr[Xr]*te;do Ne=qr[Xr]*_(Pe=We)/Pr[Xr],We=(B(Ne)+We)/2;while(--Xr);return[_(We),Ne=a(We),Ne/a(We-Pe),We]}function Go(te,le,Te){var Pe=P(te),We=P(le),Ne=F(We);if(Pe){var Xe=1/_(Pe),Pr=1/(A(Pe)*A(Pe)),qr=-(Pr+Te*(Ne*Ne*Xe*Xe)-1+Te),Xr=(Te-1)*Pr,gn=(-qr+V(qr*qr-4*Xr))/2;return[Lo(n(1/V(gn)),Te)*x(te),Lo(n(V((gn/Pr-1)/Te)),1-Te)*x(le)]}return[0,Lo(n(Ne),1-Te)*x(le)]}function Lo(te,le){if(!le)return te;if(le===1)return c(A(te/2+E));for(var Te=1,Pe=V(1-le),We=V(le),Ne=0;P(We)>d;Ne++){if(te%w){var Xe=n(Pe*A(te)/Te);Xe<0&&(Xe+=w),te+=Xe+~~(te/w)*w}else te+=te;We=(Te+Pe)/2,Pe=V(Te*Pe),We=((Te=We)-Pe)/2}return te/(m(2,Ne)*Te)}function Zo(te,le){var Te=(M-1)/(M+1),Pe=V(1-Te*Te),We=Lo(D,Pe*Pe),Ne=-1,Xe=c(A(w/4+P(le)/2)),Pr=l(Ne*Xe)/V(Te),qr=Ka(Pr*a(Ne*te),Pr*_(Ne*te)),Xr=Go(qr[0],qr[1],Pe*Pe);return[-Xr[1],(le>=0?1:-1)*(.5*We-Xr[0])]}function Ka(te,le){var Te=te*te,Pe=le+1,We=1-Te-le*le;return[.5*((te>=0?D:-D)-i(We,2*te)),-.25*c(We*We+4*Te)+.5*c(Pe*Pe+Te)]}function Cs(te,le){var Te=le[0]*le[0]+le[1]*le[1];return[(te[0]*le[0]+te[1]*le[1])/Te,(te[1]*le[0]-te[0]*le[1])/Te]}Zo.invert=function(te,le){var Te=(M-1)/(M+1),Pe=V(1-Te*Te),We=Lo(D,Pe*Pe),Ne=-1,Xe=go(.5*We-le,-te,Pe*Pe),Pr=Cs(Xe[0],Xe[1]),qr=i(Pr[1],Pr[0])/Ne;return[qr,2*n(l(.5/Ne*c(Te*Pr[0]*Pr[0]+Te*Pr[1]*Pr[1])))-D]};function ps(){return y.geoProjection(Jn(Zo)).scale(151.496)}function wl(te){var le=_(te),Te=a(te),Pe=is(te);Pe.invert=is(-te);function We(Ne,Xe){var Pr=Pe(Ne,Xe);Ne=Pr[0],Xe=Pr[1];var qr=_(Xe),Xr=a(Xe),gn=a(Ne),zn=U(le*qr+Te*Xr*gn),Qn=_(zn),ai=P(Qn)>d?zn/Qn:1;return[ai*Te*_(Ne),(P(Ne)>D?ai:-ai)*(le*Xr-Te*qr*gn)]}return We.invert=function(Ne,Xe){var Pr=V(Ne*Ne+Xe*Xe),qr=-_(Pr),Xr=a(Pr),gn=Pr*Xr,zn=-Xe*qr,Qn=Pr*le,ai=V(gn*gn+zn*zn-Qn*Qn),Ti=i(gn*Qn+zn*ai,zn*Qn-gn*ai),Qi=(Pr>D?-1:1)*i(Ne*qr,Pr*a(Ti)*Xr+Xe*_(Ti)*qr);return Pe.invert(Qi,Ti)},We}function is(te){var le=_(te),Te=a(te);return function(Pe,We){var Ne=a(We),Xe=a(Pe)*Ne,Pr=_(Pe)*Ne,qr=_(We);return[i(Pr,Xe*Te-qr*le),B(qr*Te+Xe*le)]}}function ol(){var te=0,le=y.geoProjectionMutator(wl),Te=le(te),Pe=Te.rotate,We=Te.stream,Ne=y.geoCircle();return Te.parallel=function(Xe){if(!arguments.length)return te*C;var Pr=Te.rotate();return le(te=Xe*S).rotate(Pr)},Te.rotate=function(Xe){return arguments.length?(Pe.call(Te,[Xe[0],Xe[1]-te*C]),Ne.center([-Xe[0],-Xe[1]]),Te):(Xe=Pe.call(Te),Xe[1]+=te*C,Xe)},Te.stream=function(Xe){return Xe=We(Xe),Xe.sphere=function(){Xe.polygonStart();var Pr=.01,qr=Ne.radius(90-Pr)().coordinates[0],Xr=qr.length-1,gn=-1,zn;for(Xe.lineStart();++gn=0;)Xe.point((zn=qr[gn])[0],zn[1]);Xe.lineEnd(),Xe.polygonEnd()},Xe},Te.scale(79.4187).parallel(45).clipAngle(180-.001)}var ms=3,kl=B(1-1/ms)*C,ul=ur(0);function Kl(te){var le=kl*S,Te=Pt(w,le)[0]-Pt(-w,le)[0],Pe=ul(0,le)[1],We=Pt(0,le)[1],Ne=p-We,Xe=g/te,Pr=4/g,qr=Pe+Ne*Ne*4/g;function Xr(gn,zn){var Qn,ai=P(zn);if(ai>le){var Ti=h(te-1,s(0,o((gn+w)/Xe)));gn+=w*(te-1)/te-Ti*Xe,Qn=Pt(gn,ai),Qn[0]=Qn[0]*g/Te-g*(te-1)/(2*te)+Ti*g/te,Qn[1]=Pe+(Qn[1]-We)*4*Ne/g,zn<0&&(Qn[1]=-Qn[1])}else Qn=ul(gn,zn);return Qn[0]*=Pr,Qn[1]/=qr,Qn}return Xr.invert=function(gn,zn){gn/=Pr,zn*=qr;var Qn=P(zn);if(Qn>Pe){var ai=h(te-1,s(0,o((gn+w)/Xe)));gn=(gn+w*(te-1)/te-ai*Xe)*Te/g;var Ti=Pt.invert(gn,.25*(Qn-Pe)*g/Ne+We);return Ti[0]-=w*(te-1)/te-ai*Xe,zn<0&&(Ti[1]=-Ti[1]),Ti}return ul.invert(gn,zn)},Xr}function vs(te,le){return[te,le&1?90-d:kl]}function Ns(te,le){return[te,le&1?-90+d:-kl]}function Uo(te){return[te[0]*(1-d),te[1]]}function Ds(te){var le=[].concat(z.range(-180,180+te/2,te).map(vs),z.range(180,-180-te/2,-te).map(Ns));return{type:"Polygon",coordinates:[te===180?le.map(Uo):le]}}function Ol(){var te=4,le=y.geoProjectionMutator(Kl),Te=le(te),Pe=Te.stream;return Te.lobes=function(We){return arguments.length?le(te=+We):te},Te.stream=function(We){var Ne=Te.rotate(),Xe=Pe(We),Pr=(Te.rotate([0,0]),Pe(We));return Te.rotate(Ne),Xe.sphere=function(){y.geoStream(Ds(180/te),Pr)},Xe},Te.scale(239.75)}function tc(te){var le=1+te,Te=_(1/le),Pe=B(Te),We=2*V(w/(Ne=w+4*Pe*le)),Ne,Xe=.5*We*(le+V(te*(2+te))),Pr=te*te,qr=le*le;function Xr(gn,zn){var Qn=1-_(zn),ai,Ti;if(Qn&&Qn<2){var Qi=D-zn,Ma=25,Aa;do{var Fa=_(Qi),wo=a(Qi),Yo=Pe+i(Fa,le-wo),Fo=1+qr-2*le*wo;Qi-=Aa=(Qi-Pr*Pe-le*Fa+Fo*Yo-.5*Qn*Ne)/(2*le*Fa*Yo)}while(P(Aa)>k&&--Ma>0);ai=We*V(Fo),Ti=gn*Yo/w}else ai=We*(te+Qn),Ti=gn*Pe/w;return[ai*_(Ti),Xe-ai*a(Ti)]}return Xr.invert=function(gn,zn){var Qn=gn*gn+(zn-=Xe)*zn,ai=(1+qr-Qn/(We*We))/(2*le),Ti=U(ai),Qi=_(Ti),Ma=Pe+i(Qi,le-ai);return[B(gn/V(Qn))*w/Ma,B(1-2*(Ti-Pr*Pe-le*Qi+(1+qr-2*le*ai)*Ma)/Ne)]},Xr}function sc(){var te=1,le=y.geoProjectionMutator(tc),Te=le(te);return Te.ratio=function(Pe){return arguments.length?le(te=+Pe):te},Te.scale(167.774).center([0,18.67])}var Xs=.7109889596207567,Wa=.0528035274542;function Co(te,le){return le>-Xs?(te=ue(te,le),te[1]+=Wa,te):Le(te,le)}Co.invert=function(te,le){return le>-Xs?ue.invert(te,le-Wa):Le.invert(te,le)};function el(){return y.geoProjection(Co).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function lc(te,le){return P(le)>Xs?(te=ue(te,le),te[1]-=le>0?Wa:-Wa,te):Le(te,le)}lc.invert=function(te,le){return P(le)>Xs?ue.invert(te,le+(le>0?Wa:-Wa)):Le.invert(te,le)};function ss(){return y.geoProjection(lc).scale(152.63)}function nc(te,le,Te,Pe){var We=V(4*w/(2*Te+(1+te-le/2)*_(2*Te)+(te+le)/2*_(4*Te)+le/2*_(6*Te))),Ne=V(Pe*_(Te)*V((1+te*a(2*Te)+le*a(4*Te))/(1+te+le))),Xe=Te*qr(1);function Pr(zn){return V(1+te*a(2*zn)+le*a(4*zn))}function qr(zn){var Qn=zn*Te;return(2*Qn+(1+te-le/2)*_(2*Qn)+(te+le)/2*_(4*Qn)+le/2*_(6*Qn))/Te}function Xr(zn){return Pr(zn)*_(zn)}var gn=function(zn,Qn){var ai=Te*Zt(qr,Xe*_(Qn)/Te,Qn/w);isNaN(ai)&&(ai=Te*x(Qn));var Ti=We*Pr(ai);return[Ti*Ne*zn/w*a(ai),Ti/Ne*_(ai)]};return gn.invert=function(zn,Qn){var ai=Zt(Xr,Qn*Ne/We);return[zn*w/(a(ai)*We*Ne*Pr(ai)),B(Te*qr(ai/Te)/Xe)]},Te===0&&(We=V(Pe/w),gn=function(zn,Qn){return[zn*We,_(Qn)/We]},gn.invert=function(zn,Qn){return[zn/We,B(Qn*We)]}),gn}function yl(){var te=1,le=0,Te=45*S,Pe=2,We=y.geoProjectionMutator(nc),Ne=We(te,le,Te,Pe);return Ne.a=function(Xe){return arguments.length?We(te=+Xe,le,Te,Pe):te},Ne.b=function(Xe){return arguments.length?We(te,le=+Xe,Te,Pe):le},Ne.psiMax=function(Xe){return arguments.length?We(te,le,Te=+Xe*S,Pe):Te*C},Ne.ratio=function(Xe){return arguments.length?We(te,le,Te,Pe=+Xe):Pe},Ne.scale(180.739)}function $l(te,le,Te,Pe,We,Ne,Xe,Pr,qr,Xr,gn){if(gn.nanEncountered)return NaN;var zn,Qn,ai,Ti,Qi,Ma,Aa,Fa,wo,Yo;if(zn=Te-le,Qn=te(le+zn*.25),ai=te(Te-zn*.25),isNaN(Qn)){gn.nanEncountered=!0;return}if(isNaN(ai)){gn.nanEncountered=!0;return}return Ti=zn*(Pe+4*Qn+We)/12,Qi=zn*(We+4*ai+Ne)/12,Ma=Ti+Qi,Yo=(Ma-Xe)/15,Xr>qr?(gn.maxDepthCount++,Ma+Yo):Math.abs(Yo)>1;do qr[Ma]>ai?Qi=Ma:Ti=Ma,Ma=Ti+Qi>>1;while(Ma>Ti);var Aa=qr[Ma+1]-qr[Ma];return Aa&&(Aa=(ai-qr[Ma+1])/Aa),(Ma+1+Aa)/Xe}var zn=2*gn(1)/w*Ne/Te,Qn=function(ai,Ti){var Qi=gn(P(_(Ti))),Ma=Pe(Qi)*ai;return Qi/=zn,[Ma,Ti>=0?Qi:-Qi]};return Qn.invert=function(ai,Ti){var Qi;return Ti*=zn,P(Ti)<1&&(Qi=x(Ti)*B(We(P(Ti))*Ne)),[ai/Pe(P(Ti)),Qi]},Qn}function zs(){var te=0,le=2.5,Te=1.183136,Pe=y.geoProjectionMutator(ko),We=Pe(te,le,Te);return We.alpha=function(Ne){return arguments.length?Pe(te=+Ne,le,Te):te},We.k=function(Ne){return arguments.length?Pe(te,le=+Ne,Te):le},We.gamma=function(Ne){return arguments.length?Pe(te,le,Te=+Ne):Te},We.scale(152.63)}function js(te,le){return P(te[0]-le[0])=0;--qr)Te=te[1][qr],Pe=Te[0][0],We=Te[0][1],Ne=Te[1][1],Xe=Te[2][0],Pr=Te[2][1],le.push(mc([[Xe-d,Pr-d],[Xe-d,Ne+d],[Pe+d,Ne+d],[Pe+d,We-d]],30));return{type:"Polygon",coordinates:[z.merge(le)]}}function us(te,le,Te){var Pe,We;function Ne(qr,Xr){for(var gn=Xr<0?-1:1,zn=le[+(Xr<0)],Qn=0,ai=zn.length-1;Qnzn[Qn][2][0];++Qn);var Ti=te(qr-zn[Qn][1][0],Xr);return Ti[0]+=te(zn[Qn][1][0],gn*Xr>gn*zn[Qn][0][1]?zn[Qn][0][1]:Xr)[0],Ti}Te?Ne.invert=Te(Ne):te.invert&&(Ne.invert=function(qr,Xr){for(var gn=We[+(Xr<0)],zn=le[+(Xr<0)],Qn=0,ai=gn.length;QnTi&&(Qi=ai,ai=Ti,Ti=Qi),[[zn,ai],[Qn,Ti]]})}),Xe):le.map(function(Xr){return Xr.map(function(gn){return[[gn[0][0]*C,gn[0][1]*C],[gn[1][0]*C,gn[1][1]*C],[gn[2][0]*C,gn[2][1]*C]]})})},le!=null&&Xe.lobes(le),Xe}var Rc=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function iu(){return us(ie,Rc).scale(160.857)}var Dl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function ql(){return us(lc,Dl).scale(152.63)}var cc=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function dc(){return us(ue,cc).scale(169.529)}var pu=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Ah(){return us(ue,pu).scale(169.529).rotate([20,0])}var uh=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function yh(){return us(Co,uh,Gt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var tf=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function Nd(){return us(Le,tf).scale(152.63).rotate([-20,0])}function Gl(te,le){return[3/g*te*V(w*w/3-le*le),le]}Gl.invert=function(te,le){return[g/3*te/V(w*w/3-le*le),le]};function Yu(){return y.geoProjection(Gl).scale(158.837)}function ef(te){function le(Te,Pe){if(P(P(Pe)-D)2)return null;Te/=2,Pe/=2;var Ne=Te*Te,Xe=Pe*Pe,Pr=2*Pe/(1+Ne+Xe);return Pr=m((1+Pr)/(1-Pr),1/te),[i(2*Te,1-Ne-Xe)/te,B((Pr-1)/(Pr+1))]},le}function xu(){var te=.5,le=y.geoProjectionMutator(ef),Te=le(te);return Te.spacing=function(Pe){return arguments.length?le(te=+Pe):te},Te.scale(124.75)}var mu=w/M;function bu(te,le){return[te*(1+V(a(le)))/2,le/(a(le/2)*a(te/6))]}bu.invert=function(te,le){var Te=P(te),Pe=P(le),We=d,Ne=D;Ped||P(Ma)>d)&&--We>0);return We&&[Te,Pe]};function gu(){return y.geoProjection(_c).scale(139.98)}function pl(te,le){return[_(te)/a(le),A(le)*a(te)]}pl.invert=function(te,le){var Te=te*te,Pe=le*le,We=Pe+1,Ne=Te+We,Xe=te?I*V((Ne-V(Ne*Ne-4*Te))/Te):1/V(We);return[B(te*Xe),x(le)*U(Xe)]};function ic(){return y.geoProjection(pl).scale(144.049).clipAngle(90-.001)}function jh(te){var le=a(te),Te=A(E+te/2);function Pe(We,Ne){var Xe=Ne-te,Pr=P(Xe)=0;)gn=te[Xr],zn=gn[0]+Pr*(ai=zn)-qr*Qn,Qn=gn[1]+Pr*Qn+qr*ai;return zn=Pr*(ai=zn)-qr*Qn,Qn=Pr*Qn+qr*ai,[zn,Qn]}return Te.invert=function(Pe,We){var Ne=20,Xe=Pe,Pr=We;do{for(var qr=le,Xr=te[qr],gn=Xr[0],zn=Xr[1],Qn=0,ai=0,Ti;--qr>=0;)Xr=te[qr],Qn=gn+Xe*(Ti=Qn)-Pr*ai,ai=zn+Xe*ai+Pr*Ti,gn=Xr[0]+Xe*(Ti=gn)-Pr*zn,zn=Xr[1]+Xe*zn+Pr*Ti;Qn=gn+Xe*(Ti=Qn)-Pr*ai,ai=zn+Xe*ai+Pr*Ti,gn=Xe*(Ti=gn)-Pr*zn-Pe,zn=Xe*zn+Pr*Ti-We;var Qi=Qn*Qn+ai*ai,Ma,Aa;Xe-=Ma=(gn*Qn+zn*ai)/Qi,Pr-=Aa=(zn*Qn-gn*ai)/Qi}while(P(Ma)+P(Aa)>d*d&&--Ne>0);if(Ne){var Fa=V(Xe*Xe+Pr*Pr),wo=2*n(Fa*.5),Yo=_(wo);return[i(Xe*Yo,Fa*a(wo)),Fa?B(Pr*Yo/Fa):0]}},Te}var hl=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],pp=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Hl=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],cs=[[.9245,0],[0,0],[.01943,0]],_d=[[.721316,0],[0,0],[-.00881625,-.00617325]];function xh(){return vu(hl,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function hu(){return vu(pp,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function rf(){return vu(Hl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function td(){return vu(cs,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Ed(){return vu(_d,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function vu(te,le){var Te=y.geoProjection(Xf(te)).rotate(le).clipAngle(90),Pe=y.geoRotation(le),We=Te.center;return delete Te.rotate,Te.center=function(Ne){return arguments.length?We(Pe(Ne)):Pe.invert(We())},Te}var Lf=V(6),hf=V(7);function Ld(te,le){var Te=B(7*_(le)/(3*Lf));return[Lf*te*(2*a(2*Te/3)-1)/hf,9*_(Te/3)/hf]}Ld.invert=function(te,le){var Te=3*B(le*hf/9);return[te*hf/(Lf*(2*a(2*Te/3)-1)),B(_(Te)*3*Lf/7)]};function ed(){return y.geoProjection(Ld).scale(164.859)}function nf(te,le){for(var Te=(1+I)*_(le),Pe=le,We=0,Ne;We<25&&(Pe-=Ne=(_(Pe/2)+_(Pe)-Te)/(.5*a(Pe/2)+a(Pe)),!(P(Ne)k&&--Pe>0);return Ne=Te*Te,Xe=Ne*Ne,Pr=Ne*Xe,[te/(.84719-.13063*Ne+Pr*Pr*(-.04515+.05494*Ne-.02326*Xe+.00331*Pr)),Te]};function Mh(){return y.geoProjection(Uh).scale(175.295)}function yu(te,le){return[te*(1+a(le))/2,2*(le-A(le/2))]}yu.invert=function(te,le){for(var Te=le/2,Pe=0,We=1/0;Pe<10&&P(We)>d;++Pe){var Ne=a(le/2);le-=We=(le-A(le/2)-Te)/(1-.5/(Ne*Ne))}return[2*te/(1+a(le)),le]};function fd(){return y.geoProjection(yu).scale(152.63)}var of=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function uc(){return us(Ct(1/0),of).rotate([20,0]).scale(152.63)}function jd(te,le){var Te=_(le),Pe=a(le),We=x(te);if(te===0||P(le)===D)return[0,le];if(le===0)return[te,0];if(P(te)===D)return[te*Pe,D*Te];var Ne=w/(2*te)-2*te/w,Xe=2*le/w,Pr=(1-Xe*Xe)/(Te-Xe),qr=Ne*Ne,Xr=Pr*Pr,gn=1+qr/Xr,zn=1+Xr/qr,Qn=(Ne*Te/Pr-Ne/2)/gn,ai=(Xr*Te/qr+Pr/2)/zn,Ti=Qn*Qn+Pe*Pe/gn,Qi=ai*ai-(Xr*Te*Te/qr+Pr*Te-1)/zn;return[D*(Qn+V(Ti)*We),D*(ai+V(Qi<0?0:Qi)*x(-le*Ne)*We)]}jd.invert=function(te,le){te/=D,le/=D;var Te=te*te,Pe=le*le,We=Te+Pe,Ne=w*w;return[te?(We-1+V((1-We)*(1-We)+4*Te))/(2*te)*D:0,Zt(function(Xe){return We*(w*_(Xe)-2*Xe)*w+4*Xe*Xe*(le-_(Xe))+2*w*Xe-Ne*le},0)]};function Jf(){return y.geoProjection(jd).scale(127.267)}var ff=1.0148,Pd=.23185,pf=-.14499,Xu=.02406,mf=ff,Vc=5*Pd,Ju=7*pf,rd=9*Xu,xc=1.790857183;function $h(te,le){var Te=le*le;return[te,le*(ff+Te*Te*(Pd+Te*(pf+Xu*Te)))]}$h.invert=function(te,le){le>xc?le=xc:le<-xc&&(le=-xc);var Te=le,Pe;do{var We=Te*Te;Te-=Pe=(Te*(ff+We*We*(Pd+We*(pf+Xu*We)))-le)/(mf+We*We*(Vc+We*(Ju+rd*We)))}while(P(Pe)>d);return[te,Te]};function ju(){return y.geoProjection($h).scale(139.319)}function Qu(te,le){if(P(le)d&&--We>0);return Xe=A(Pe),[(P(le)=0;)if(Pe=le[Pr],Te[0]===Pe[0]&&Te[1]===Pe[1]){if(Ne)return[Ne,Te];Ne=Te}}}function hh(te){for(var le=te.length,Te=[],Pe=te[le-1],We=0;We0?[-Pe[0],0]:[180-Pe[0],180])};var le=Lh.map(function(Te){return{face:Te,project:te(Te)}});return[-1,0,0,1,0,1,4,5].forEach(function(Te,Pe){var We=le[Te];We&&(We.children||(We.children=[])).push(le[Pe])}),bd(le[0],function(Te,Pe){return le[Te<-w/2?Pe<0?6:4:Te<0?Pe<0?2:0:TePe^ai>Pe&&Te<(Qn-Xr)*(Pe-gn)/(ai-gn)+Xr&&(We=!We)}return We}function Au(te,le){var Te=le.stream,Pe;if(!Te)throw new Error("invalid projection");switch(te&&te.type){case"Feature":Pe=fh;break;case"FeatureCollection":Pe=gf;break;default:Pe=Ph;break}return Pe(te,Te)}function gf(te,le){return{type:"FeatureCollection",features:te.features.map(function(Te){return fh(Te,le)})}}function fh(te,le){return{type:"Feature",id:te.id,properties:te.properties,geometry:Ph(te.geometry,le)}}function Vh(te,le){return{type:"GeometryCollection",geometries:te.geometries.map(function(Te){return Ph(Te,le)})}}function Ph(te,le){if(!te)return null;if(te.type==="GeometryCollection")return Vh(te,le);var Te;switch(te.type){case"Point":Te=Ih;break;case"MultiPoint":Te=Ih;break;case"LineString":Te=Td;break;case"MultiLineString":Te=Td;break;case"Polygon":Te=Dh;break;case"MultiPolygon":Te=Dh;break;case"Sphere":Te=Dh;break;default:return null}return y.geoStream(te,le(Te)),Te.result()}var Zc=[],fc=[],Ih={point:function(te,le){Zc.push([te,le])},result:function(){var te=Zc.length?Zc.length<2?{type:"Point",coordinates:Zc[0]}:{type:"MultiPoint",coordinates:Zc}:null;return Zc=[],te}},Td={lineStart:ad,point:function(te,le){Zc.push([te,le])},lineEnd:function(){Zc.length&&(fc.push(Zc),Zc=[])},result:function(){var te=fc.length?fc.length<2?{type:"LineString",coordinates:fc[0]}:{type:"MultiLineString",coordinates:fc}:null;return fc=[],te}},Dh={polygonStart:ad,lineStart:ad,point:function(te,le){Zc.push([te,le])},lineEnd:function(){var te=Zc.length;if(te){do Zc.push(Zc[0].slice());while(++te<4);fc.push(Zc),Zc=[]}},polygonEnd:ad,result:function(){if(!fc.length)return null;var te=[],le=[];return fc.forEach(function(Te){Dd(Te)?te.push([Te]):le.push(Te)}),le.forEach(function(Te){var Pe=Te[0];te.some(function(We){if(tp(We[0],Pe))return We.push(Te),!0})||te.push([Te])}),fc=[],te.length?te.length>1?{type:"MultiPolygon",coordinates:te}:{type:"Polygon",coordinates:te[0]}:null}};function sf(te){var le=te(D,0)[0]-te(-D,0)[0];function Te(Pe,We){var Ne=P(Pe)0?Pe-w:Pe+w,We),Pr=(Xe[0]-Xe[1])*I,qr=(Xe[0]+Xe[1])*I;if(Ne)return[Pr,qr];var Xr=le*I,gn=Pr>0^qr>0?-1:1;return[gn*Pr-x(qr)*Xr,gn*qr-x(Pr)*Xr]}return te.invert&&(Te.invert=function(Pe,We){var Ne=(Pe+We)*I,Xe=(We-Pe)*I,Pr=P(Ne)<.5*le&&P(Xe)<.5*le;if(!Pr){var qr=le*I,Xr=Ne>0^Xe>0?-1:1,gn=-Xr*Pe+(Xe>0?1:-1)*qr,zn=-Xr*We+(Ne>0?1:-1)*qr;Ne=(-gn-zn)*I,Xe=(gn-zn)*I}var Qn=te.invert(Ne,Xe);return Pr||(Qn[0]+=Ne>0?w:-w),Qn}),y.geoProjection(Te).rotate([-90,-90,45]).clipAngle(180-.001)}function br(){return sf(Gn).scale(176.423)}function Qr(){return sf(Zo).scale(111.48)}function Nn(te,le){if(!(0<=(le=+le)&&le<=20))throw new Error("invalid digits");function Te(Xr){var gn=Xr.length,zn=2,Qn=new Array(gn);for(Qn[0]=+Xr[0].toFixed(le),Qn[1]=+Xr[1].toFixed(le);zn2||ai[0]!=gn[0]||ai[1]!=gn[1])&&(zn.push(ai),gn=ai)}return zn.length===1&&Xr.length>1&&zn.push(Te(Xr[Xr.length-1])),zn}function Ne(Xr){return Xr.map(We)}function Xe(Xr){if(Xr==null)return Xr;var gn;switch(Xr.type){case"GeometryCollection":gn={type:"GeometryCollection",geometries:Xr.geometries.map(Xe)};break;case"Point":gn={type:"Point",coordinates:Te(Xr.coordinates)};break;case"MultiPoint":gn={type:Xr.type,coordinates:Pe(Xr.coordinates)};break;case"LineString":gn={type:Xr.type,coordinates:We(Xr.coordinates)};break;case"MultiLineString":case"Polygon":gn={type:Xr.type,coordinates:Ne(Xr.coordinates)};break;case"MultiPolygon":gn={type:"MultiPolygon",coordinates:Xr.coordinates.map(Ne)};break;default:return Xr}return Xr.bbox!=null&&(gn.bbox=Xr.bbox),gn}function Pr(Xr){var gn={type:"Feature",properties:Xr.properties,geometry:Xe(Xr.geometry)};return Xr.id!=null&&(gn.id=Xr.id),Xr.bbox!=null&&(gn.bbox=Xr.bbox),gn}if(te!=null)switch(te.type){case"Feature":return Pr(te);case"FeatureCollection":{var qr={type:"FeatureCollection",features:te.features.map(Pr)};return te.bbox!=null&&(qr.bbox=te.bbox),qr}default:return Xe(te)}return te}function An(te){var le=_(te);function Te(Pe,We){var Ne=le?A(Pe*le/2)/le:Pe/2;if(!We)return[2*Ne,-te];var Xe=2*n(Ne*_(We)),Pr=1/A(We);return[_(Xe)*Pr,We+(1-a(Xe))*Pr-te]}return Te.invert=function(Pe,We){if(P(We+=te)d&&--Pr>0);var Qn=Pe*(Xr=A(Xe)),ai=A(P(We)0?D:-D)*(qr+We*(gn-Xe)/2+We*We*(gn-2*qr+Xe)/2)]}ga.invert=function(te,le){var Te=le/D,Pe=Te*90,We=h(18,P(Pe/5)),Ne=s(0,o(We));do{var Xe=Pi[Ne][1],Pr=Pi[Ne+1][1],qr=Pi[h(19,Ne+2)][1],Xr=qr-Xe,gn=qr-2*Pr+Xe,zn=2*(P(Te)-Pr)/Xr,Qn=gn/Xr,ai=zn*(1-Qn*zn*(1-2*Qn*zn));if(ai>=0||Ne===1){Pe=(le>=0?5:-5)*(ai+We);var Ti=50,Qi;do We=h(18,P(Pe)/5),Ne=o(We),ai=We-Ne,Xe=Pi[Ne][1],Pr=Pi[Ne+1][1],qr=Pi[h(19,Ne+2)][1],Pe-=(Qi=(le>=0?D:-D)*(Pr+ai*(qr-Xe)/2+ai*ai*(qr-2*Pr+Xe)/2)-le)*C;while(P(Qi)>k&&--Ti>0);break}}while(--Ne>=0);var Ma=Pi[Ne][0],Aa=Pi[Ne+1][0],Fa=Pi[h(19,Ne+2)][0];return[te/(Aa+ai*(Fa-Ma)/2+ai*ai*(Fa-2*Aa+Ma)/2),Pe*S]};function Pa(){return y.geoProjection(ga).scale(152.63)}function Ja(te){function le(Te,Pe){var We=a(Pe),Ne=(te-1)/(te-We*a(Te));return[Ne*We*_(Te),Ne*_(Pe)]}return le.invert=function(Te,Pe){var We=Te*Te+Pe*Pe,Ne=V(We),Xe=(te-V(1-We*(te+1)/(te-1)))/((te-1)/Ne+Ne/(te-1));return[i(Te*Xe,Ne*V(1-Xe*Xe)),Ne?B(Pe*Xe/Ne):0]},le}function uo(te,le){var Te=Ja(te);if(!le)return Te;var Pe=a(le),We=_(le);function Ne(Xe,Pr){var qr=Te(Xe,Pr),Xr=qr[1],gn=Xr*We/(te-1)+Pe;return[qr[0]*Pe/gn,Xr/gn]}return Ne.invert=function(Xe,Pr){var qr=(te-1)/(te-1-Pr*We);return Te.invert(qr*Xe,qr*Pr*Pe)},Ne}function Sa(){var te=2,le=0,Te=y.geoProjectionMutator(uo),Pe=Te(te,le);return Pe.distance=function(We){return arguments.length?Te(te=+We,le):te},Pe.tilt=function(We){return arguments.length?Te(te,le=We*S):le*C},Pe.scale(432.147).clipAngle(U(1/te)*C-1e-6)}var Za=1e-4,Ra=1e4,pa=-180,_o=pa+Za,fs=180,os=fs-Za,gs=-90,ws=gs+Za,bo=90,lo=bo-Za;function ks(te){return te.length>0}function dl(te){return Math.floor(te*Ra)/Ra}function Vl(te){return te===gs||te===bo?[0,te]:[pa,dl(te)]}function gc(te){var le=te[0],Te=te[1],Pe=!1;return le<=_o?(le=pa,Pe=!0):le>=os&&(le=fs,Pe=!0),Te<=ws?(Te=gs,Pe=!0):Te>=lo&&(Te=bo,Pe=!0),Pe?[le,Te]:te}function ec(te){return te.map(gc)}function vc(te,le,Te){for(var Pe=0,We=te.length;Pe=os||gn<=ws||gn>=lo){Ne[Xe]=gc(qr);for(var zn=Xe+1;zn_o&&aiws&&Ti=Pr)break;Te.push({index:-1,polygon:le,ring:Ne=Ne.slice(zn-1)}),Ne[0]=Vl(Ne[0][1]),Xe=-1,Pr=Ne.length}}}}function El(te){var le,Te=te.length,Pe={},We={},Ne,Xe,Pr,qr,Xr;for(le=0;le0?w-Pr:Pr)*C],Xr=y.geoProjection(te(Xe)).rotate(qr),gn=y.geoRotation(qr),zn=Xr.center;return delete Xr.rotate,Xr.center=function(Qn){return arguments.length?zn(gn(Qn)):gn.invert(zn())},Xr.clipAngle(90)}function Zl(te){var le=a(te);function Te(Pe,We){var Ne=y.geoGnomonicRaw(Pe,We);return Ne[0]*=le,Ne}return Te.invert=function(Pe,We){return y.geoGnomonicRaw.invert(Pe/le,We)},Te}function Mu(){return eh([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function eh(te,le){return ac(Zl,te,le)}function Vu(te){if(!(te*=2))return y.geoAzimuthalEquidistantRaw;var le=-te/2,Te=-le,Pe=te*te,We=A(Te),Ne=.5/_(Te);function Xe(Pr,qr){var Xr=U(a(qr)*a(Pr-le)),gn=U(a(qr)*a(Pr-Te)),zn=qr<0?-1:1;return Xr*=Xr,gn*=gn,[(Xr-gn)/(2*te),zn*V(4*Pe*gn-(Pe-Xr+gn)*(Pe-Xr+gn))/(2*te)]}return Xe.invert=function(Pr,qr){var Xr=qr*qr,gn=a(V(Xr+(Qn=Pr+le)*Qn)),zn=a(V(Xr+(Qn=Pr+Te)*Qn)),Qn,ai;return[i(ai=gn-zn,Qn=(gn+zn)*We),(qr<0?-1:1)*U(V(Qn*Qn+ai*ai)*Ne)]},Xe}function Wh(){return rh([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function rh(te,le){return ac(Vu,te,le)}function qh(te,le){if(P(le)d&&--Pr>0);return[x(te)*(V(We*We+4)+We)*w/4,D*Xe]};function lf(){return y.geoProjection(eu).scale(127.16)}function Kt(te,le,Te,Pe,We){function Ne(Xe,Pr){var qr=Te*_(Pe*Pr),Xr=V(1-qr*qr),gn=V(2/(1+Xr*a(Xe*=We)));return[te*Xr*gn*_(Xe),le*qr*gn]}return Ne.invert=function(Xe,Pr){var qr=Xe/te,Xr=Pr/le,gn=V(qr*qr+Xr*Xr),zn=2*B(gn/2);return[i(Xe*A(zn),te*gn)/We,gn&&B(Pr*_(zn)/(le*Te*gn))/Pe]},Ne}function O(te,le,Te,Pe){var We=w/3;te=s(te,d),le=s(le,d),te=h(te,D),le=h(le,w-d),Te=s(Te,0),Te=h(Te,100-d),Pe=s(Pe,d);var Ne=Te/100+1,Xe=Pe/100,Pr=U(Ne*a(We))/We,qr=_(te)/_(Pr*D),Xr=le/w,gn=V(Xe*_(te/2)/_(le/2)),zn=gn/V(Xr*qr*Pr),Qn=1/(gn*V(Xr*qr*Pr));return Kt(zn,Qn,qr,Pr,Xr)}function pt(){var te=65*S,le=60*S,Te=20,Pe=200,We=y.geoProjectionMutator(O),Ne=We(te,le,Te,Pe);return Ne.poleline=function(Xe){return arguments.length?We(te=+Xe*S,le,Te,Pe):te*C},Ne.parallels=function(Xe){return arguments.length?We(te,le=+Xe*S,Te,Pe):le*C},Ne.inflation=function(Xe){return arguments.length?We(te,le,Te=+Xe,Pe):Te},Ne.ratio=function(Xe){return arguments.length?We(te,le,Te,Pe=+Xe):Pe},Ne.scale(163.775)}function Dt(){return pt().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Ft=4*w+3*V(3),qt=2*V(2*w*V(3)/Ft),Ee=ye(qt*V(3)/w,qt,Ft/6);function je(){return y.geoProjection(Ee).scale(176.84)}function er(te,le){return[te*V(1-3*le*le/(w*w)),le]}er.invert=function(te,le){return[te/V(1-3*le*le/(w*w)),le]};function wr(){return y.geoProjection(er).scale(152.63)}function Gr(te,le){var Te=a(le),Pe=a(te)*Te,We=1-Pe,Ne=a(te=i(_(te)*Te,-_(le))),Xe=_(te);return Te=V(1-Pe*Pe),[Xe*Te-Ne*We,-Ne*Te-Xe*We]}Gr.invert=function(te,le){var Te=(te*te+le*le)/-2,Pe=V(-Te*(2+Te)),We=le*Te+te*Pe,Ne=te*Te-le*Pe,Xe=V(Ne*Ne+We*We);return[i(Pe*We,Xe*(1+Te)),Xe?-B(Pe*Ne/Xe):0]};function Zr(){return y.geoProjection(Gr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Tn(te,le){var Te=bt(te,le);return[(Te[0]+te/D)/2,(Te[1]+le)/2]}Tn.invert=function(te,le){var Te=te,Pe=le,We=25;do{var Ne=a(Pe),Xe=_(Pe),Pr=_(2*Pe),qr=Xe*Xe,Xr=Ne*Ne,gn=_(Te),zn=a(Te/2),Qn=_(Te/2),ai=Qn*Qn,Ti=1-Xr*zn*zn,Qi=Ti?U(Ne*zn)*V(Ma=1/Ti):Ma=0,Ma,Aa=.5*(2*Qi*Ne*Qn+Te/D)-te,Fa=.5*(Qi*Xe+Pe)-le,wo=.5*Ma*(Xr*ai+Qi*Ne*zn*qr)+.5/D,Yo=Ma*(gn*Pr/4-Qi*Xe*Qn),Fo=.125*Ma*(Pr*Qn-Qi*Xe*Xr*gn),xs=.5*Ma*(qr*zn+Qi*ai*Ne)+.5,Sl=Yo*Fo-xs*wo,Ll=(Fa*Yo-Aa*xs)/Sl,Ws=(Aa*Fo-Fa*wo)/Sl;Te-=Ll,Pe-=Ws}while((P(Ll)>d||P(Ws)>d)&&--We>0);return[Te,Pe]};function qn(){return y.geoProjection(Tn).scale(158.837)}f.geoNaturalEarth=y.geoNaturalEarth1,f.geoNaturalEarthRaw=y.geoNaturalEarth1Raw,f.geoAiry=ht,f.geoAiryRaw=tt,f.geoAitoff=vt,f.geoAitoffRaw=bt,f.geoArmadillo=rt,f.geoArmadilloRaw=ut,f.geoAugust=it,f.geoAugustRaw=gt,f.geoBaker=J,f.geoBakerRaw=ot,f.geoBerghaus=dt,f.geoBerghausRaw=mt,f.geoBertin1953=xe,f.geoBertin1953Raw=ee,f.geoBoggs=be,f.geoBoggsRaw=ie,f.geoBonne=mr,f.geoBonneRaw=Qe,f.geoBottomley=Jr,f.geoBottomleyRaw=fr,f.geoBromley=Er,f.geoBromleyRaw=an,f.geoChamberlin=_t,f.geoChamberlinRaw=Xt,f.geoChamberlinAfrica=zt,f.geoCollignon=Ht,f.geoCollignonRaw=Pt,f.geoCraig=he,f.geoCraigRaw=ae,f.geoCraster=Ye,f.geoCrasterRaw=qe,f.geoCylindricalEqualArea=Rr,f.geoCylindricalEqualAreaRaw=ur,f.geoCylindricalStereographic=xr,f.geoCylindricalStereographicRaw=zr,f.geoEckert1=ci,f.geoEckert1Raw=pn,f.geoEckert2=yi,f.geoEckert2Raw=ui,f.geoEckert3=Ci,f.geoEckert3Raw=Gi,f.geoEckert4=ba,f.geoEckert4Raw=fi,f.geoEckert5=Ke,f.geoEckert5Raw=oa,f.geoEckert6=vr,f.geoEckert6Raw=sr,f.geoEisenlohr=Zn,f.geoEisenlohrRaw=mn,f.geoFahey=Li,f.geoFaheyRaw=Wn,f.geoFoucaut=Zi,f.geoFoucautRaw=Fi,f.geoFoucautSinusoidal=ca,f.geoFoucautSinusoidalRaw=Ji,f.geoGilbert=so,f.geoGingery=sn,f.geoGingeryRaw=Fe,f.geoGinzburg4=un,f.geoGinzburg4Raw=Yr,f.geoGinzburg5=bn,f.geoGinzburg5Raw=Pn,f.geoGinzburg6=yr,f.geoGinzburg6Raw=ze,f.geoGinzburg8=Rn,f.geoGinzburg8Raw=en,f.geoGinzburg9=xi,f.geoGinzburg9Raw=ni,f.geoGringorten=ea,f.geoGringortenRaw=Gn,f.geoGuyou=ps,f.geoGuyouRaw=Zo,f.geoHammer=Bt,f.geoHammerRaw=Ct,f.geoHammerRetroazimuthal=ol,f.geoHammerRetroazimuthalRaw=wl,f.geoHealpix=Ol,f.geoHealpixRaw=Kl,f.geoHill=sc,f.geoHillRaw=tc,f.geoHomolosine=ss,f.geoHomolosineRaw=lc,f.geoHufnagel=yl,f.geoHufnagelRaw=nc,f.geoHyperelliptical=zs,f.geoHyperellipticalRaw=ko,f.geoInterrupt=us,f.geoInterruptedBoggs=iu,f.geoInterruptedHomolosine=ql,f.geoInterruptedMollweide=dc,f.geoInterruptedMollweideHemispheres=Ah,f.geoInterruptedSinuMollweide=yh,f.geoInterruptedSinusoidal=Nd,f.geoKavrayskiy7=Yu,f.geoKavrayskiy7Raw=Gl,f.geoLagrange=xu,f.geoLagrangeRaw=ef,f.geoLarrivee=_h,f.geoLarriveeRaw=bu,f.geoLaskowski=gu,f.geoLaskowskiRaw=_c,f.geoLittrow=ic,f.geoLittrowRaw=pl,f.geoLoximuthal=Hu,f.geoLoximuthalRaw=jh,f.geoMiller=Lc,f.geoMillerRaw=Qh,f.geoModifiedStereographic=vu,f.geoModifiedStereographicRaw=Xf,f.geoModifiedStereographicAlaska=xh,f.geoModifiedStereographicGs48=hu,f.geoModifiedStereographicGs50=rf,f.geoModifiedStereographicMiller=td,f.geoModifiedStereographicLee=Ed,f.geoMollweide=Mt,f.geoMollweideRaw=ue,f.geoMtFlatPolarParabolic=ed,f.geoMtFlatPolarParabolicRaw=Ld,f.geoMtFlatPolarQuartic=af,f.geoMtFlatPolarQuarticRaw=nf,f.geoMtFlatPolarSinusoidal=df,f.geoMtFlatPolarSinusoidalRaw=bh,f.geoNaturalEarth2=Mh,f.geoNaturalEarth2Raw=Uh,f.geoNellHammer=fd,f.geoNellHammerRaw=yu,f.geoInterruptedQuarticAuthalic=uc,f.geoNicolosi=Jf,f.geoNicolosiRaw=jd,f.geoPatterson=ju,f.geoPattersonRaw=$h,f.geoPolyconic=Pc,f.geoPolyconicRaw=Qu,f.geoPolyhedral=bd,f.geoPolyhedralButterfly=Ic,f.geoPolyhedralCollignon=Pf,f.geoPolyhedralWaterman=Mc,f.geoProject=Au,f.geoGringortenQuincuncial=br,f.geoPeirceQuincuncial=Qr,f.geoPierceQuincuncial=Qr,f.geoQuantize=Nn,f.geoQuincuncial=sf,f.geoRectangularPolyconic=di,f.geoRectangularPolyconicRaw=An,f.geoRobinson=Pa,f.geoRobinsonRaw=ga,f.geoSatellite=Sa,f.geoSatelliteRaw=uo,f.geoSinuMollweide=el,f.geoSinuMollweideRaw=Co,f.geoSinusoidal=Ze,f.geoSinusoidalRaw=Le,f.geoStitch=bc,f.geoTimes=Bs,f.geoTimesRaw=qo,f.geoTwoPointAzimuthal=eh,f.geoTwoPointAzimuthalRaw=Zl,f.geoTwoPointAzimuthalUsa=Mu,f.geoTwoPointEquidistant=rh,f.geoTwoPointEquidistantRaw=Vu,f.geoTwoPointEquidistantUsa=Wh,f.geoVanDerGrinten=Wc,f.geoVanDerGrintenRaw=qh,f.geoVanDerGrinten2=ds,f.geoVanDerGrinten2Raw=Gh,f.geoVanDerGrinten3=nh,f.geoVanDerGrinten3Raw=$s,f.geoVanDerGrinten4=lf,f.geoVanDerGrinten4Raw=eu,f.geoWagner=pt,f.geoWagner7=Dt,f.geoWagnerRaw=O,f.geoWagner4=je,f.geoWagner4Raw=Ee,f.geoWagner6=wr,f.geoWagner6Raw=er,f.geoWiechel=Zr,f.geoWiechelRaw=Gr,f.geoWinkel3=qn,f.geoWinkel3Raw=Tn,Object.defineProperty(f,"__esModule",{value:!0})})}),AX=It((et,Y)=>{var f=Br(),y=jn(),z=ls(),P=Math.PI/180,n=180/Math.PI,i={cursor:"pointer"},a={cursor:"auto"};function l(C,S){var N=C.projection,B;return S._isScoped?B=s:S._isClipped?B=m:B=h,B(C,N)}Y.exports=l;function o(C,S){return f.behavior.zoom().translate(S.translate()).scale(S.scale())}function c(C,S,N){var B=C.id,U=C.graphDiv,V=U.layout,W=V[B],F=U._fullLayout,H=F[B],q={},G={};function tt(ht,bt){q[B+"."+ht]=y.nestedProperty(W,ht).get(),z.call("_storeDirectGUIEdit",V,F._preGUI,q);var vt=y.nestedProperty(H,ht);vt.get()!==bt&&(vt.set(bt),y.nestedProperty(W,ht).set(bt),G[B+"."+ht]=bt)}N(tt),tt("projection.scale",S.scale()/C.fitScale),tt("fitbounds",!1),U.emit("plotly_relayout",G)}function s(C,S){var N=o(C,S);function B(){f.select(this).style(i)}function U(){S.scale(f.event.scale).translate(f.event.translate),C.render(!0);var F=S.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":S.scale()/C.fitScale,"geo.center.lon":F[0],"geo.center.lat":F[1]})}function V(F){var H=S.invert(C.midPt);F("center.lon",H[0]),F("center.lat",H[1])}function W(){f.select(this).style(a),c(C,S,V)}return N.on("zoomstart",B).on("zoom",U).on("zoomend",W),N}function h(C,S){var N=o(C,S),B=2,U,V,W,F,H,q,G,tt,ht;function bt(st){return S.invert(st)}function vt(st){var xt=bt(st);if(!xt)return!0;var ot=S(xt);return Math.abs(ot[0]-st[0])>B||Math.abs(ot[1]-st[1])>B}function ut(){f.select(this).style(i),U=f.mouse(this),V=S.rotate(),W=S.translate(),F=V,H=bt(U)}function rt(){if(q=f.mouse(this),vt(U)){N.scale(S.scale()),N.translate(S.translate());return}S.scale(f.event.scale),S.translate([W[0],f.event.translate[1]]),H?bt(q)&&(tt=bt(q),G=[F[0]+(tt[0]-H[0]),V[1],V[2]],S.rotate(G),F=G):(U=q,H=bt(U)),ht=!0,C.render(!0);var st=S.rotate(),xt=S.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":S.scale()/C.fitScale,"geo.center.lon":xt[0],"geo.center.lat":xt[1],"geo.projection.rotation.lon":-st[0]})}function gt(){f.select(this).style(a),ht&&c(C,S,it)}function it(st){var xt=S.rotate(),ot=S.invert(C.midPt);st("projection.rotation.lon",-xt[0]),st("center.lon",ot[0]),st("center.lat",ot[1])}return N.on("zoomstart",ut).on("zoom",rt).on("zoomend",gt),N}function m(C,S){S.rotate(),S.scale();var N=o(C,S),B=g(N,"zoomstart","zoom","zoomend"),U=0,V=N.on,W;N.on("zoomstart",function(){f.select(this).style(i);var tt=f.mouse(this),ht=S.rotate(),bt=ht,vt=S.translate(),ut=x(ht);W=b(S,tt),V.call(N,"zoom",function(){var rt=f.mouse(this);if(S.scale(f.event.scale),!W)tt=rt,W=b(S,tt);else if(b(S,rt)){S.rotate(ht).translate(vt);var gt=b(S,rt),it=A(W,gt),st=E(_(ut,it)),xt=d(st,W,bt);(!isFinite(xt[0])||!isFinite(xt[1])||!isFinite(xt[2]))&&(xt=bt),S.rotate(xt),bt=xt}H(B.of(this,arguments))}),F(B.of(this,arguments))}).on("zoomend",function(){f.select(this).style(a),V.call(N,"zoom",null),q(B.of(this,arguments)),c(C,S,G)}).on("zoom.redraw",function(){C.render(!0);var tt=S.rotate();C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":S.scale()/C.fitScale,"geo.projection.rotation.lon":-tt[0],"geo.projection.rotation.lat":-tt[1]})});function F(tt){U++||tt({type:"zoomstart"})}function H(tt){tt({type:"zoom"})}function q(tt){--U||tt({type:"zoomend"})}function G(tt){var ht=S.rotate();tt("projection.rotation.lon",-ht[0]),tt("projection.rotation.lat",-ht[1])}return f.rebind(N,B,"on")}function b(C,S){var N=C.invert(S);return N&&isFinite(N[0])&&isFinite(N[1])&&I(N)}function x(C){var S=.5*C[0]*P,N=.5*C[1]*P,B=.5*C[2]*P,U=Math.sin(S),V=Math.cos(S),W=Math.sin(N),F=Math.cos(N),H=Math.sin(B),q=Math.cos(B);return[V*F*q+U*W*H,U*F*q-V*W*H,V*W*q+U*F*H,V*F*H-U*W*q]}function _(C,S){var N=C[0],B=C[1],U=C[2],V=C[3],W=S[0],F=S[1],H=S[2],q=S[3];return[N*W-B*F-U*H-V*q,N*F+B*W+U*q-V*H,N*H-B*q+U*W+V*F,N*q+B*H-U*F+V*W]}function A(C,S){if(!(!C||!S)){var N=p(C,S),B=Math.sqrt(M(N,N)),U=.5*Math.acos(Math.max(-1,Math.min(1,M(C,S)))),V=Math.sin(U)/B;return B&&[Math.cos(U),N[2]*V,-N[1]*V,N[0]*V]}}function d(C,S,N){var B=D(S,2,C[0]);B=D(B,1,C[1]),B=D(B,0,C[2]-N[2]);var U=S[0],V=S[1],W=S[2],F=B[0],H=B[1],q=B[2],G=Math.atan2(V,U)*n,tt=Math.sqrt(U*U+V*V),ht,bt;Math.abs(H)>tt?(bt=(H>0?90:-90)-G,ht=0):(bt=Math.asin(H/tt)*n-G,ht=Math.sqrt(tt*tt-H*H));var vt=180-bt-2*G,ut=(Math.atan2(q,F)-Math.atan2(W,ht))*n,rt=(Math.atan2(q,F)-Math.atan2(W,-ht))*n,gt=k(N[0],N[1],bt,ut),it=k(N[0],N[1],vt,rt);return gt<=it?[bt,ut,N[2]]:[vt,rt,N[2]]}function k(C,S,N,B){var U=w(N-C),V=w(B-S);return Math.sqrt(U*U+V*V)}function w(C){return(C%360+540)%360-180}function D(C,S,N){var B=N*P,U=C.slice(),V=S===0?1:0,W=S===2?1:2,F=Math.cos(B),H=Math.sin(B);return U[V]=C[V]*F-C[W]*H,U[W]=C[W]*F+C[V]*H,U}function E(C){return[Math.atan2(2*(C[0]*C[1]+C[2]*C[3]),1-2*(C[1]*C[1]+C[2]*C[2]))*n,Math.asin(Math.max(-1,Math.min(1,2*(C[0]*C[2]-C[3]*C[1]))))*n,Math.atan2(2*(C[0]*C[3]+C[1]*C[2]),1-2*(C[2]*C[2]+C[3]*C[3]))*n]}function I(C){var S=C[0]*P,N=C[1]*P,B=Math.cos(N);return[B*Math.cos(S),B*Math.sin(S),Math.sin(N)]}function M(C,S){for(var N=0,B=0,U=C.length;B{var f=Br(),y=MD(),z=y.geoPath,P=y.geoDistance,n=CX(),i=ls(),a=jn(),l=a.strTranslate,o=Hn(),c=Js(),s=hd(),h=lh(),m=Fs(),b=Jm().getAutoRange,x=Up(),_=Md().prepSelect,A=Md().clearOutline,d=Md().selectOnClick,k=AX(),w=Mk(),D=q_(),E=QC(),I=SD().feature;function M(N){this.id=N.id,this.graphDiv=N.graphDiv,this.container=N.container,this.topojsonURL=N.topojsonURL,this.isStatic=N.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var p=M.prototype;Y.exports=function(N){return new M(N)},p.plot=function(N,B,U,V){var W=this;if(V)return W.update(N,B,!0);W._geoCalcData=N,W._fullLayout=B;var F=B[this.id],H=[],q=!1;for(var G in w.layerNameToAdjective)if(G!=="frame"&&F["show"+G]){q=!0;break}for(var tt=!1,ht=0;ht0&&H._module.calcGeoJSON(F,B)}if(!U){var q=this.updateProjection(N,B);if(q)return;(!this.viewInitial||this.scope!==V.scope)&&this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(B,V),this.updateDims(B,V),this.updateFx(B,V),h.generalUpdatePerTraceModule(this.graphDiv,this,N,V);var G=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=G.selectAll(".point"),this.dataPoints.text=G.selectAll("text"),this.dataPaths.line=G.selectAll(".js-line");var tt=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=tt.selectAll("path"),this._render()},p.updateProjection=function(N,B){var U=this.graphDiv,V=B[this.id],W=B._size,F=V.domain,H=V.projection,q=V.lonaxis,G=V.lataxis,tt=q._ax,ht=G._ax,bt=this.projection=g(V),vt=[[W.l+W.w*F.x[0],W.t+W.h*(1-F.y[1])],[W.l+W.w*F.x[1],W.t+W.h*(1-F.y[0])]],ut=V.center||{},rt=H.rotation||{},gt=q.range||[],it=G.range||[];if(V.fitbounds){tt._length=vt[1][0]-vt[0][0],ht._length=vt[1][1]-vt[0][1],tt.range=b(U,tt),ht.range=b(U,ht);var st=(tt.range[0]+tt.range[1])/2,xt=(ht.range[0]+ht.range[1])/2;if(V._isScoped)ut={lon:st,lat:xt};else if(V._isClipped){ut={lon:st,lat:xt},rt={lon:st,lat:xt,roll:rt.roll};var ot=H.type,J=w.lonaxisSpan[ot]/2||180,mt=w.lataxisSpan[ot]/2||90;gt=[st-J,st+J],it=[xt-mt,xt+mt]}else ut={lon:st,lat:xt},rt={lon:st,lat:rt.lat,roll:rt.roll}}bt.center([ut.lon-rt.lon,ut.lat-rt.lat]).rotate([-rt.lon,-rt.lat,rt.roll]).parallels(H.parallels);var dt=S(gt,it);bt.fitExtent(vt,dt);var Ct=this.bounds=bt.getBounds(dt),Rt=this.fitScale=bt.scale(),Bt=bt.translate();if(V.fitbounds){var Zt=bt.getBounds(S(tt.range,ht.range)),Gt=Math.min((Ct[1][0]-Ct[0][0])/(Zt[1][0]-Zt[0][0]),(Ct[1][1]-Ct[0][1])/(Zt[1][1]-Zt[0][1]));isFinite(Gt)?bt.scale(Gt*Rt):a.warn("Something went wrong during"+this.id+"fitbounds computations.")}else bt.scale(H.scale*Rt);var ee=this.midPt=[(Ct[0][0]+Ct[1][0])/2,(Ct[0][1]+Ct[1][1])/2];if(bt.translate([Bt[0]+(ee[0]-Bt[0]),Bt[1]+(ee[1]-Bt[1])]).clipExtent(Ct),V._isAlbersUsa){var xe=bt([ut.lon,ut.lat]),ge=bt.translate();bt.translate([ge[0]-(xe[0]-ge[0]),ge[1]-(xe[1]-ge[1])])}},p.updateBaseLayers=function(N,B){var U=this,V=U.topojson,W=U.layers,F=U.basePaths;function H(vt){return vt==="lonaxis"||vt==="lataxis"}function q(vt){return!!w.lineLayers[vt]}function G(vt){return!!w.fillLayers[vt]}var tt=this.hasChoropleth?w.layersForChoropleth:w.layers,ht=tt.filter(function(vt){return q(vt)||G(vt)?B["show"+vt]:H(vt)?B[vt].showgrid:!0}),bt=U.framework.selectAll(".layer").data(ht,String);bt.exit().each(function(vt){delete W[vt],delete F[vt],f.select(this).remove()}),bt.enter().append("g").attr("class",function(vt){return"layer "+vt}).each(function(vt){var ut=W[vt]=f.select(this);vt==="bg"?U.bgRect=ut.append("rect").style("pointer-events","all"):H(vt)?F[vt]=ut.append("path").style("fill","none"):vt==="backplot"?ut.append("g").classed("choroplethlayer",!0):vt==="frontplot"?ut.append("g").classed("scatterlayer",!0):q(vt)?F[vt]=ut.append("path").style("fill","none").style("stroke-miterlimit",2):G(vt)&&(F[vt]=ut.append("path").style("stroke","none"))}),bt.order(),bt.each(function(vt){var ut=F[vt],rt=w.layerNameToAdjective[vt];vt==="frame"?ut.datum(w.sphereSVG):q(vt)||G(vt)?ut.datum(I(V,V.objects[vt])):H(vt)&&ut.datum(C(vt,B,N)).call(o.stroke,B[vt].gridcolor).call(c.dashLine,B[vt].griddash,B[vt].gridwidth),q(vt)?ut.call(o.stroke,B[rt+"color"]).call(c.dashLine,"",B[rt+"width"]):G(vt)&&ut.call(o.fill,B[rt+"color"])})},p.updateDims=function(N,B){var U=this.bounds,V=(B.framewidth||0)/2,W=U[0][0]-V,F=U[0][1]-V,H=U[1][0]-W+V,q=U[1][1]-F+V;c.setRect(this.clipRect,W,F,H,q),this.bgRect.call(c.setRect,W,F,H,q).call(o.fill,B.bgcolor),this.xaxis._offset=W,this.xaxis._length=H,this.yaxis._offset=F,this.yaxis._length=q},p.updateFx=function(N,B){var U=this,V=U.graphDiv,W=U.bgRect,F=N.dragmode,H=N.clickmode;if(U.isStatic)return;function q(){var bt=U.viewInitial,vt={};for(var ut in bt)vt[U.id+"."+ut]=bt[ut];i.call("_guiRelayout",V,vt),V.emit("plotly_doubleclick",null)}function G(bt){return U.projection.invert([bt[0]+U.xaxis._offset,bt[1]+U.yaxis._offset])}var tt=function(bt,vt){if(vt.isRect){var ut=bt.range={};ut[U.id]=[G([vt.xmin,vt.ymin]),G([vt.xmax,vt.ymax])]}else{var rt=bt.lassoPoints={};rt[U.id]=vt.map(G)}},ht={element:U.bgRect.node(),gd:V,plotinfo:{id:U.id,xaxis:U.xaxis,yaxis:U.yaxis,fillRangeItems:tt},xaxes:[U.xaxis],yaxes:[U.yaxis],subplot:U.id,clickFn:function(bt){bt===2&&A(V)}};F==="pan"?(W.node().onmousedown=null,W.call(k(U,B)),W.on("dblclick.zoom",q),V._context._scrollZoom.geo||W.on("wheel.zoom",null)):(F==="select"||F==="lasso")&&(W.on(".zoom",null),ht.prepFn=function(bt,vt,ut){_(bt,vt,ut,ht,F)},x.init(ht)),W.on("mousemove",function(){var bt=U.projection.invert(a.getPositionFromD3Event());if(!bt)return x.unhover(V,f.event);U.xaxis.p2c=function(){return bt[0]},U.yaxis.p2c=function(){return bt[1]},s.hover(V,f.event,U.id)}),W.on("mouseout",function(){V._dragging||x.unhover(V,f.event)}),W.on("click",function(){F!=="select"&&F!=="lasso"&&(H.indexOf("select")>-1&&d(f.event,V,[U.xaxis],[U.yaxis],U.id,ht),H.indexOf("event")>-1&&s.click(V,f.event))})},p.makeFramework=function(){var N=this,B=N.graphDiv,U=B._fullLayout,V="clip"+U._uid+N.id;N.clipDef=U._clips.append("clipPath").attr("id",V),N.clipRect=N.clipDef.append("rect"),N.framework=f.select(N.container).append("g").attr("class","geo "+N.id).call(c.setClipUrl,V,B),N.project=function(W){var F=N.projection(W);return F?[F[0]-N.xaxis._offset,F[1]-N.yaxis._offset]:[null,null]},N.xaxis={_id:"x",c2p:function(W){return N.project(W)[0]}},N.yaxis={_id:"y",c2p:function(W){return N.project(W)[1]}},N.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(N.mockAxis,U)},p.saveViewInitial=function(N){var B=N.center||{},U=N.projection,V=U.rotation||{};this.viewInitial={fitbounds:N.fitbounds,"projection.scale":U.scale};var W;N._isScoped?W={"center.lon":B.lon,"center.lat":B.lat}:N._isClipped?W={"projection.rotation.lon":V.lon,"projection.rotation.lat":V.lat}:W={"center.lon":B.lon,"center.lat":B.lat,"projection.rotation.lon":V.lon},a.extendFlat(this.viewInitial,W)},p.render=function(N){this._hasMarkerAngles&&N?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var N=this.projection,B=N.getPath(),U;function V(F){var H=N(F.lonlat);return H?l(H[0],H[1]):null}function W(F){return N.isLonLatOverEdges(F.lonlat)?"none":null}for(U in this.basePaths)this.basePaths[U].attr("d",B);for(U in this.dataPaths)this.dataPaths[U].attr("d",function(F){return B(F.geojson)});for(U in this.dataPoints)this.dataPoints[U].attr("display",W).attr("transform",V)};function g(N){var B=N.projection,U=B.type,V=w.projNames[U];V="geo"+a.titleCase(V);for(var W=y[V]||n[V],F=W(),H=N._isSatellite?Math.acos(1/B.distance)*180/Math.PI:N._isClipped?w.lonaxisSpan[U]/2:null,q=["center","rotate","parallels","clipExtent"],G=function(bt){return bt?F:[]},tt=0;ttrt}else return!1},F.getPath=function(){return z().projection(F)},F.getBounds=function(bt){return F.getPath().bounds(bt)},F.precision(w.precision),N._isSatellite&&F.tilt(B.tilt).distance(B.distance),H&&F.clipAngle(H-w.clipPad),F}function C(N,B,U){var V=1e-6,W=2.5,F=B[N],H=w.scopeDefaults[B.scope],q,G,tt;N==="lonaxis"?(q=H.lonaxisRange,G=H.lataxisRange,tt=function(xt,ot){return[xt,ot]}):N==="lataxis"&&(q=H.lataxisRange,G=H.lonaxisRange,tt=function(xt,ot){return[ot,xt]});var ht={type:"linear",range:[q[0],q[1]-V],tick0:F.tick0,dtick:F.dtick};m.setConvert(ht,U);var bt=m.calcTicks(ht);!B.isScoped&&N==="lonaxis"&&bt.pop();for(var vt=bt.length,ut=new Array(vt),rt=0;rt0&&W<0&&(W+=360);var q=(W-V)/4;return{type:"Polygon",coordinates:[[[V,F],[V,H],[V+q,H],[V+2*q,H],[V+3*q,H],[W,H],[W,F],[W-q,F],[W-2*q,F],[W-3*q,F],[V,F]]]}}}),ED=It((et,Y)=>{var f=Sn(),y=Jh().attributes,z=qf().dash,P=Mk(),n=sh().overrideAll,i=Xm(),a={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:f.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:z},l=Y.exports=n({domain:y({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:i(P.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:i(P.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:f.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:P.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:P.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:P.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:P.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:f.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:f.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:f.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:f.background},lonaxis:a,lataxis:a},"plot","from-root");l.uirevision={valType:"any",editType:"none"}}),EX=It((et,Y)=>{var f=jn(),y=O_(),z=Mf().getSubplotData,P=Mk(),n=ED(),i=P.axesNames;Y.exports=function(l,o,c){y(l,o,c,{type:"geo",attributes:n,handleDefaults:a,fullData:c,partition:"y"})};function a(l,o,c,s){var h=z(s.fullData,"geo",s.id),m=h.map(function(it){return it.index}),b=c("resolution"),x=c("scope"),_=P.scopeDefaults[x],A=c("projection.type",_.projType),d=o._isAlbersUsa=A==="albers usa";d&&(x=o.scope="usa");var k=o._isScoped=x!=="world",w=o._isSatellite=A==="satellite",D=o._isConic=A.indexOf("conic")!==-1||A==="albers",E=o._isClipped=!!P.lonaxisSpan[A];if(l.visible===!1){var I=f.extendDeep({},o._template);I.showcoastlines=!1,I.showcountries=!1,I.showframe=!1,I.showlakes=!1,I.showland=!1,I.showocean=!1,I.showrivers=!1,I.showsubunits=!1,I.lonaxis&&(I.lonaxis.showgrid=!1),I.lataxis&&(I.lataxis.showgrid=!1),o._template=I}for(var M=c("visible"),p,g=0;g0&&G<0&&(G+=360);var tt=(q+G)/2,ht;if(!d){var bt=k?_.projRotate:[tt,0,0];ht=c("projection.rotation.lon",bt[0]),c("projection.rotation.lat",bt[1]),c("projection.rotation.roll",bt[2]),p=c("showcoastlines",!k&&M),p&&(c("coastlinecolor"),c("coastlinewidth")),p=c("showocean",M?void 0:!1),p&&c("oceancolor")}var vt,ut;if(d?(vt=-96.6,ut=38.7):(vt=k?tt:ht,ut=(H[0]+H[1])/2),c("center.lon",vt),c("center.lat",ut),w&&(c("projection.tilt"),c("projection.distance")),D){var rt=_.projParallels||[0,60];c("projection.parallels",rt)}c("projection.scale"),p=c("showland",M?void 0:!1),p&&c("landcolor"),p=c("showlakes",M?void 0:!1),p&&c("lakecolor"),p=c("showrivers",M?void 0:!1),p&&(c("rivercolor"),c("riverwidth")),p=c("showcountries",k&&x!=="usa"&&M),p&&(c("countrycolor"),c("countrywidth")),(x==="usa"||x==="north america"&&b===50)&&(c("showsubunits",M),c("subunitcolor"),c("subunitwidth")),k||(p=c("showframe",M),p&&(c("framecolor"),c("framewidth"))),c("bgcolor");var gt=c("fitbounds");gt&&(delete o.projection.scale,k?(delete o.center.lon,delete o.center.lat):E?(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon,delete o.projection.rotation.lat,delete o.lonaxis.range,delete o.lataxis.range):(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon))}}),LD=It((et,Y)=>{var f=Mf().getSubplotCalcData,y=jn().counterRegex,z=MX(),P="geo",n=y(P),i={};i[P]={valType:"subplotid",dflt:P,editType:"calc"};function a(c){for(var s=c._fullLayout,h=c.calcdata,m=s._subplots[P],b=0;b{Y.exports={attributes:Pb(),supplyDefaults:vX(),colorbar:Do(),formatLabels:yX(),calc:JC(),calcGeoJSON:AD().calcGeoJSON,plot:AD().plot,style:CD(),styleOnSelect:Il().styleOnSelect,hoverPoints:kX(),eventData:TX(),selectPoints:SX(),moduleType:"trace",name:"scattergeo",basePlotModule:LD(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),PX=It((et,Y)=>{Y.exports=LX()}),Kw=It((et,Y)=>{var{hovertemplateAttrs:f,templatefallbackAttrs:y}=nu(),z=Pb(),P=Ru(),n=xa(),i=Sn().defaultLine,a=Yn().extendFlat,l=z.marker.line;Y.exports=a({locations:{valType:"data_array",editType:"calc"},locationmode:z.locationmode,z:{valType:"data_array",editType:"calc"},geojson:a({},z.geojson,{}),featureidkey:z.featureidkey,text:a({},z.text,{}),hovertext:a({},z.hovertext,{}),marker:{line:{color:a({},l.color,{dflt:i}),width:a({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:z.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:z.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:a({},n.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:f(),hovertemplatefallback:y(),showlegend:a({},n.showlegend,{dflt:!1})},P("",{cLetter:"z",editTypeOverride:"calc"}))}),IX=It((et,Y)=>{var f=jn(),y=Cu(),z=Kw(),P=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(n,i,a,l){function o(_,A){return f.coerce(n,i,z,_,A)}var c=o("locations"),s=o("z");if(!(c&&c.length&&f.isArrayOrTypedArray(s)&&s.length)){i.visible=!1;return}i._length=Math.min(c.length,s.length);var h=o("geojson"),m;(typeof h=="string"&&h!==""||f.isPlainObject(h))&&(m="geojson-id");var b=o("locationmode",m);b==="country names"&&f.warn(P),b==="geojson-id"&&o("featureidkey"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback");var x=o("marker.line.width");x&&o("marker.line.color"),o("marker.opacity"),y(n,i,l,o,{prefix:"",cLetter:"z"}),f.coerceSelectionMarkerOpacity(i,o)}}),rA=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Cp(),P=ft(),n=$t();function i(a){return a&&typeof a=="string"}Y.exports=function(a,l){var o=l._length,c=new Array(o),s;l.geojson?s=function(_){return i(_)||f(_)}:s=i;for(var h=0;h{var f=Br(),y=Hn(),z=Js(),P=ch();function n(l,o){o&&i(l,o)}function i(l,o){var c=o[0].trace,s=o[0].node3,h=s.selectAll(".choroplethlocation"),m=c.marker||{},b=m.line||{},x=P.makeColorScaleFuncFromTrace(c);h.each(function(_){f.select(this).attr("fill",x(_.z)).call(y.stroke,_.mlc||b.color).call(z.dashLine,"",_.mlw||b.width||0).style("opacity",m.opacity)}),z.selectedPointStyle(h,c)}function a(l,o){var c=o[0].node3,s=o[0].trace;s.selectedpoints?z.selectedPointStyle(c.selectAll(".choroplethlocation"),s):i(l,o)}Y.exports={style:n,styleOnSelect:a}}),PD=It((et,Y)=>{var f=Br(),y=jn(),z=q_(),P=QC().getTopojsonFeatures,n=Jm().findExtremes,i=nA().style;function a(o,c,s){var h=c.layers.backplot.select(".choroplethlayer");y.makeTraceGroups(h,s,"trace choropleth").each(function(m){var b=f.select(this),x=b.selectAll("path.choroplethlocation").data(y.identity);x.enter().append("path").classed("choroplethlocation",!0),x.exit().remove(),i(o,m)})}function l(o,c){for(var s=o[0].trace,h=c[s.geo],m=h._subplot,b=s.locationmode,x=s._length,_=b==="geojson-id"?z.extractTraceFeature(o):P(s,m.topojson),A=[],d=[],k=0;k{var f=Fs(),y=Kw(),z=jn().fillText;Y.exports=function(n,i,a){var l=n.cd,o=l[0].trace,c=n.subplot,s,h,m,b,x=[i,a],_=[i+360,a];for(h=0;h")}}}),aA=It((et,Y)=>{Y.exports=function(f,y,z,P,n){f.location=y.location,f.z=y.z;var i=P[n];return i.fIn&&i.fIn.properties&&(f.properties=i.fIn.properties),f.ct=i.ct,f}}),oA=It((et,Y)=>{Y.exports=function(f,y){var z=f.cd,P=f.xaxis,n=f.yaxis,i=[],a,l,o,c,s;if(y===!1)for(a=0;a{Y.exports={attributes:Kw(),supplyDefaults:IX(),colorbar:z_(),calc:rA(),calcGeoJSON:PD().calcGeoJSON,plot:PD().plot,style:nA().style,styleOnSelect:nA().styleOnSelect,hoverPoints:iA(),eventData:aA(),selectPoints:oA(),moduleType:"trace",name:"choropleth",basePlotModule:LD(),categories:["geo","noOpacity","showLegend"],meta:{}}}),zX=It((et,Y)=>{Y.exports=DX()}),sA=It((et,Y)=>{var f=ls(),y=jn(),z=qc();function P(i,a,l,o){var c=i.cd,s=c[0].t,h=c[0].trace,m=i.xa,b=i.ya,x=s.x,_=s.y,A=m.c2p(a),d=b.c2p(l),k=i.distance,w;if(s.tree){var D=m.p2c(A-k),E=m.p2c(A+k),I=b.p2c(d-k),M=b.p2c(d+k);o==="x"?w=s.tree.range(Math.min(D,E),Math.min(b._rl[0],b._rl[1]),Math.max(D,E),Math.max(b._rl[0],b._rl[1])):w=s.tree.range(Math.min(D,E),Math.min(I,M),Math.max(D,E),Math.max(I,M))}else w=s.ids;var p,g,C,S,N,B,U,V,W,F=k;if(o==="x"){var H=!!h.xperiodalignment,q=!!h.yperiodalignment;for(N=0;N=Math.min(G,tt)&&A<=Math.max(G,tt)?0:1/0}if(B=Math.min(ht,bt)&&d<=Math.max(ht,bt)?0:1/0}W=Math.sqrt(B*B+U*U),g=w[N]}}}else for(N=w.length-1;N>-1;N--)p=w[N],C=x[p],S=_[p],B=m.c2p(C)-A,U=b.c2p(S)-d,V=Math.sqrt(B*B+U*U),V{var f=20;Y.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:f,SYMBOL_STROKE:f/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),Lk=It((et,Y)=>{var f=xa(),y=hi(),z=Em(),P=dd(),n=Sh().axisHoverFormat,i=Ru(),a=Xm(),l=Yn().extendFlat,o=sh().overrideAll,c=G_().DASHES,s=P.line,h=P.marker,m=h.line,b=Y.exports=o({x:P.x,x0:P.x0,dx:P.dx,y:P.y,y0:P.y0,dy:P.dy,xperiod:P.xperiod,yperiod:P.yperiod,xperiod0:P.xperiod0,yperiod0:P.yperiod0,xperiodalignment:P.xperiodalignment,yperiodalignment:P.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),text:P.text,hovertext:P.hovertext,textposition:P.textposition,textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:s.color,width:s.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:a(c),dflt:"solid"}},marker:l({},i("marker"),{symbol:h.symbol,angle:h.angle,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:h.opacity,colorbar:h.colorbar,line:l({},i("marker.line"),{width:m.width})}),connectgaps:P.connectgaps,fill:l({},P.fill,{dflt:"none"}),fillcolor:z(),selected:{marker:P.selected.marker,textfont:P.selected.textfont},unselected:{marker:P.unselected.marker,textfont:P.unselected.textfont},opacity:f.opacity},"calc","nested");b.x.editType=b.y.editType=b.x0.editType=b.y0.editType="calc+clearAxisTypes",b.hovertemplate=P.hovertemplate,b.hovertemplatefallback=P.hovertemplatefallback,b.texttemplate=P.texttemplate,b.texttemplatefallback=P.texttemplatefallback}),lA=It(et=>{var Y=G_();et.isOpenSymbol=function(f){return typeof f=="string"?Y.OPEN_RE.test(f):f%200>100},et.isDotSymbol=function(f){return typeof f=="string"?Y.DOT_RE.test(f):f>200}}),OX=It((et,Y)=>{var f=jn(),y=ls(),z=lA(),P=Lk(),n=Eg(),i=Fu(),a=Xg(),l=S0(),o=Y0(),c=Lm(),s=Pm(),h=pm();Y.exports=function(m,b,x,_){function A(p,g){return f.coerce(m,b,P,p,g)}var d=m.marker?z.isOpenSymbol(m.marker.symbol):!1,k=i.isBubble(m),w=a(m,b,_,A);if(!w){b.visible=!1;return}l(m,b,_,A),A("xhoverformat"),A("yhoverformat");var D=w{var f=tl();Y.exports=function(y,z,P){var n=y.i;return"x"in y||(y.x=z._x[n]),"y"in y||(y.y=z._y[n]),f(y,z,P)}}),RX=It((et,Y)=>{function f(a,l,o,c,s){for(var h=s+1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>=0?(h=m,s=m-1):c=m+1}return h}function y(a,l,o,c,s){for(var h=s+1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>0?(h=m,s=m-1):c=m+1}return h}function z(a,l,o,c,s){for(var h=c-1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<0?(h=m,c=m+1):s=m-1}return h}function P(a,l,o,c,s){for(var h=c-1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<=0?(h=m,c=m+1):s=m-1}return h}function n(a,l,o,c,s){for(;c<=s;){var h=c+s>>>1,m=a[h],b=o!==void 0?o(m,l):m-l;if(b===0)return h;b<=0?c=h+1:s=h-1}return-1}function i(a,l,o,c,s,h){return typeof o=="function"?h(a,l,o,c===void 0?0:c|0,s===void 0?a.length-1:s|0):h(a,l,void 0,o===void 0?0:o|0,c===void 0?a.length-1:c|0)}Y.exports={ge:function(a,l,o,c,s){return i(a,l,o,c,s,f)},gt:function(a,l,o,c,s){return i(a,l,o,c,s,y)},lt:function(a,l,o,c,s){return i(a,l,o,c,s,z)},le:function(a,l,o,c,s){return i(a,l,o,c,s,P)},eq:function(a,l,o,c,s){return i(a,l,o,c,s,n)}}}),t1=It((et,Y)=>{Y.exports=function(z,P,n){var i={},a,l;if(typeof P=="string"&&(P=y(P)),Array.isArray(P)){var o={};for(l=0;l{var f=t1();Y.exports=y;function y(z){var P;return arguments.length>1&&(z=arguments),typeof z=="string"?z=z.split(/\s/).map(parseFloat):typeof z=="number"&&(z=[z]),z.length&&typeof z[0]=="number"?z.length===1?P={width:z[0],height:z[0],x:0,y:0}:z.length===2?P={width:z[0],height:z[1],x:0,y:0}:P={x:z[0],y:z[1],width:z[2]-z[0]||0,height:z[3]-z[1]||0}:z&&(z=f(z,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),P={x:z.left||0,y:z.top||0},z.width==null?z.right?P.width=z.right-P.x:P.width=0:P.width=z.width,z.height==null?z.bottom?P.height=z.bottom-P.y:P.height=0:P.height=z.height),P}}),Ib=It((et,Y)=>{Y.exports=f;function f(y,z){if(!y||y.length==null)throw Error("Argument should be an array");z==null?z=1:z=Math.floor(z);for(var P=Array(z*2),n=0;ni&&(i=y[l]),y[l]{Y.exports=function(){for(var f=0;f{var f=GC();Y.exports=y;function y(z,P,n){if(!z)throw new TypeError("must specify data as first parameter");if(n=+(n||0)|0,Array.isArray(z)&&z[0]&&typeof z[0][0]=="number"){var i=z[0].length,a=z.length*i,l,o,c,s;(!P||typeof P=="string")&&(P=new(f(P||"float32"))(a+n));var h=P.length-n;if(a!==h)throw new Error("source length "+a+" ("+i+"x"+z.length+") does not match destination length "+h);for(l=0,c=n;l{Y.exports=function(f){var y=typeof f;return f!==null&&(y==="object"||y==="function")}}),jX=It((et,Y)=>{Y.exports=Math.log2||function(f){return Math.log(f)*Math.LOG2E}}),UX=It((et,Y)=>{var f=RX(),y=Ck(),z=Yw(),P=Ib(),n=t1(),i=FX(),a=Db(),l=NX(),o=GC(),c=jX(),s=1073741824;Y.exports=function(m,b){b||(b={}),m=a(m,"float64"),b=n(b,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let x=i(b.maxDepth,255),_=i(b.bounds,P(m,2));_[0]===_[2]&&_[2]++,_[1]===_[3]&&_[3]++;let A=h(m,_),d=m.length>>>1,k;b.dtype||(b.dtype="array"),typeof b.dtype=="string"?k=new(o(b.dtype))(d):b.dtype&&(k=b.dtype,Array.isArray(k)&&(k.length=d));for(let N=0;Nx||F>s){for(let st=0;stmt||G>dt||tt=bt||ot===J)return;let Ct=w[xt];J===void 0&&(J=Ct.length);for(let ue=ot;ue=V&&Ot<=F&&Lt>=W&&Lt<=H&&vt.push(Mt)}let Rt=D[xt],Bt=Rt[ot*4+0],Zt=Rt[ot*4+1],Gt=Rt[ot*4+2],ee=Rt[ot*4+3],xe=rt(Rt,ot+1),ge=st*.5,ye=xt+1;ut(gt,it,ge,ye,Bt,Zt||Gt||ee||xe),ut(gt,it+ge,ge,ye,Zt,Gt||ee||xe),ut(gt+ge,it,ge,ye,Gt,ee||xe),ut(gt+ge,it+ge,ge,ye,ee,xe)}function rt(gt,it){let st=null,xt=0;for(;st===null;)if(st=gt[it*4+xt],xt++,xt>gt.length)return null;return st}return vt}function C(N,B,U,V,W){let F=[];for(let H=0;H{Y.exports=UX()}),ID=It((et,Y)=>{Y.exports=f;function f(y){var z=0,P=0,n=0,i=0;return y.map(function(a){a=a.slice();var l=a[0],o=l.toUpperCase();if(l!=o)switch(a[0]=o,l){case"a":a[6]+=n,a[7]+=i;break;case"v":a[1]+=i;break;case"h":a[1]+=n;break;default:for(var c=1;c{Object.defineProperty(et,"__esModule",{value:!0});var f=function(){function l(o,c){var s=[],h=!0,m=!1,b=void 0;try{for(var x=o[Symbol.iterator](),_;!(h=(_=x.next()).done)&&(s.push(_.value),!(c&&s.length===c));h=!0);}catch(A){m=!0,b=A}finally{try{!h&&x.return&&x.return()}finally{if(m)throw b}}return s}return function(o,c){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return l(o,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=Math.PI*2,z=function(l,o,c,s,h,m,b){var x=l.x,_=l.y;x*=o,_*=c;var A=s*x-h*_,d=h*x+s*_;return{x:A+m,y:d+b}},P=function(l,o){var c=o===1.5707963267948966?.551915024494:o===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(o/4),s=Math.cos(l),h=Math.sin(l),m=Math.cos(l+o),b=Math.sin(l+o);return[{x:s-h*c,y:h+s*c},{x:m+b*c,y:b-m*c},{x:m,y:b}]},n=function(l,o,c,s){var h=l*s-o*c<0?-1:1,m=l*c+o*s;return m>1&&(m=1),m<-1&&(m=-1),h*Math.acos(m)},i=function(l,o,c,s,h,m,b,x,_,A,d,k){var w=Math.pow(h,2),D=Math.pow(m,2),E=Math.pow(d,2),I=Math.pow(k,2),M=w*D-w*I-D*E;M<0&&(M=0),M/=w*I+D*E,M=Math.sqrt(M)*(b===x?-1:1);var p=M*h/m*k,g=M*-m/h*d,C=A*p-_*g+(l+c)/2,S=_*p+A*g+(o+s)/2,N=(d-p)/h,B=(k-g)/m,U=(-d-p)/h,V=(-k-g)/m,W=n(1,0,N,B),F=n(N,B,U,V);return x===0&&F>0&&(F-=y),x===1&&F<0&&(F+=y),[C,S,W,F]},a=function(l){var o=l.px,c=l.py,s=l.cx,h=l.cy,m=l.rx,b=l.ry,x=l.xAxisRotation,_=x===void 0?0:x,A=l.largeArcFlag,d=A===void 0?0:A,k=l.sweepFlag,w=k===void 0?0:k,D=[];if(m===0||b===0)return[];var E=Math.sin(_*y/360),I=Math.cos(_*y/360),M=I*(o-s)/2+E*(c-h)/2,p=-E*(o-s)/2+I*(c-h)/2;if(M===0&&p===0)return[];m=Math.abs(m),b=Math.abs(b);var g=Math.pow(M,2)/Math.pow(m,2)+Math.pow(p,2)/Math.pow(b,2);g>1&&(m*=Math.sqrt(g),b*=Math.sqrt(g));var C=i(o,c,s,h,m,b,d,w,E,I,M,p),S=f(C,4),N=S[0],B=S[1],U=S[2],V=S[3],W=Math.abs(V)/(y/4);Math.abs(1-W)<1e-7&&(W=1);var F=Math.max(Math.ceil(W),1);V/=F;for(var H=0;H{Y.exports=y;var f=$X();function y(n){for(var i,a=[],l=0,o=0,c=0,s=0,h=null,m=null,b=0,x=0,_=0,A=n.length;_4?(l=d[d.length-4],o=d[d.length-3]):(l=b,o=x),a.push(d)}return a}function z(n,i,a,l){return["C",n,i,a,l,a,l]}function P(n,i,a,l,o,c){return["C",n/3+2/3*a,i/3+2/3*l,o/3+2/3*a,c/3+2/3*l,o,c]}}),DD=It((et,Y)=>{Y.exports=function(f){return typeof f!="string"?!1:(f=f.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(f)&&/[\dz]$/i.test(f)&&f.length>4))}}),VX=It((et,Y)=>{var f=E_(),y=ID(),z=HX(),P=DD(),n=ok();Y.exports=i;function i(a){if(Array.isArray(a)&&a.length===1&&typeof a[0]=="string"&&(a=a[0]),typeof a=="string"&&(n(P(a),"String is not an SVG path."),a=f(a)),n(Array.isArray(a),"Argument should be a string or an array of path segments."),a=y(a),a=z(a),!a.length)return[0,0,0,0];for(var l=[1/0,1/0,-1/0,-1/0],o=0,c=a.length;ol[2]&&(l[2]=s[h+0]),s[h+1]>l[3]&&(l[3]=s[h+1]);return l}}),WX=It((et,Y)=>{var f=Math.PI,y=l(120);Y.exports=z;function z(o){for(var c,s=[],h=0,m=0,b=0,x=0,_=null,A=null,d=0,k=0,w=0,D=o.length;w7&&(s.push(E.splice(0,7)),E.unshift("C"));break;case"S":var M=d,p=k;(c=="C"||c=="S")&&(M+=M-h,p+=p-m),E=["C",M,p,E[1],E[2],E[3],E[4]];break;case"T":c=="Q"||c=="T"?(_=d*2-_,A=k*2-A):(_=d,A=k),E=n(d,k,_,A,E[1],E[2]);break;case"Q":_=E[1],A=E[2],E=n(d,k,E[1],E[2],E[3],E[4]);break;case"L":E=P(d,k,E[1],E[2]);break;case"H":E=P(d,k,E[1],k);break;case"V":E=P(d,k,d,E[1]);break;case"Z":E=P(d,k,b,x);break}c=I,d=E[E.length-2],k=E[E.length-1],E.length>4?(h=E[E.length-4],m=E[E.length-3]):(h=d,m=k),s.push(E)}return s}function P(o,c,s,h){return["C",o,c,s,h,s,h]}function n(o,c,s,h,m,b){return["C",o/3+2/3*s,c/3+2/3*h,m/3+2/3*s,b/3+2/3*h,m,b]}function i(o,c,s,h,m,b,x,_,A,d){if(d)S=d[0],N=d[1],g=d[2],C=d[3];else{var k=a(o,c,-m);o=k.x,c=k.y,k=a(_,A,-m),_=k.x,A=k.y;var w=(o-_)/2,D=(c-A)/2,E=w*w/(s*s)+D*D/(h*h);E>1&&(E=Math.sqrt(E),s=E*s,h=E*h);var I=s*s,M=h*h,p=(b==x?-1:1)*Math.sqrt(Math.abs((I*M-I*D*D-M*w*w)/(I*D*D+M*w*w)));p==1/0&&(p=1);var g=p*s*D/h+(o+_)/2,C=p*-h*w/s+(c+A)/2,S=Math.asin(((c-C)/h).toFixed(9)),N=Math.asin(((A-C)/h).toFixed(9));S=oN&&(S=S-f*2),!x&&N>S&&(N=N-f*2)}if(Math.abs(N-S)>y){var B=N,U=_,V=A;N=S+y*(x&&N>S?1:-1),_=g+s*Math.cos(N),A=C+h*Math.sin(N);var W=i(_,A,s,h,m,0,x,U,V,[N,B,g,C])}var F=Math.tan((N-S)/4),H=4/3*s*F,q=4/3*h*F,G=[2*o-(o+H*Math.sin(S)),2*c-(c-q*Math.cos(S)),_+H*Math.sin(N),A-q*Math.cos(N),_,A];if(d)return G;W&&(G=G.concat(W));for(var tt=0;tt{var f=ID(),y=WX(),z={M:"moveTo",C:"bezierCurveTo"};Y.exports=function(P,n){P.beginPath(),y(f(n)).forEach(function(i){var a=i[0],l=i.slice(1);P[z[a]].apply(P,l)}),P.closePath()}}),GX=It((et,Y)=>{var f=Ck();Y.exports=z;var y=1e20;function z(i,a){a||(a={});var l=a.cutoff==null?.25:a.cutoff,o=a.radius==null?8:a.radius,c=a.channel||0,s,h,m,b,x,_,A,d,k,w,D;if(ArrayBuffer.isView(i)||Array.isArray(i)){if(!a.width||!a.height)throw Error("For raw data width and height should be provided by options");s=a.width,h=a.height,b=i,a.stride?_=a.stride:_=Math.floor(i.length/s/h)}else window.HTMLCanvasElement&&i instanceof window.HTMLCanvasElement?(d=i,A=d.getContext("2d"),s=d.width,h=d.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.CanvasRenderingContext2D&&i instanceof window.CanvasRenderingContext2D?(d=i.canvas,A=i,s=d.width,h=d.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.ImageData&&i instanceof window.ImageData&&(k=i,s=i.width,h=i.height,b=k.data,_=4);if(m=Math.max(s,h),window.Uint8ClampedArray&&b instanceof window.Uint8ClampedArray||window.Uint8Array&&b instanceof window.Uint8Array)for(x=b,b=Array(s*h),w=0,D=x.length;w{var f=VX(),y=E_(),z=qX(),P=DD(),n=GX(),i=document.createElement("canvas"),a=i.getContext("2d");Y.exports=l;function l(s,h){if(!P(s))throw Error("Argument should be valid svg path string");h||(h={});var m,b;h.shape?(m=h.shape[0],b=h.shape[1]):(m=i.width=h.w||h.width||200,b=i.height=h.h||h.height||200);var x=Math.min(m,b),_=h.stroke||0,A=h.viewbox||h.viewBox||f(s),d=[m/(A[2]-A[0]),b/(A[3]-A[1])],k=Math.min(d[0]||0,d[1]||0)/2;if(a.fillStyle="black",a.fillRect(0,0,m,b),a.fillStyle="white",_&&(typeof _!="number"&&(_=1),_>0?a.strokeStyle="white":a.strokeStyle="black",a.lineWidth=Math.abs(_)),a.translate(m*.5,b*.5),a.scale(k,k),c()){var w=new Path2D(s);a.fill(w),_&&a.stroke(w)}else{var D=y(s);z(a,D),a.fill(),_&&a.stroke()}a.setTransform(1,0,0,1,0,0);var E=n(a,{cutoff:h.cutoff!=null?h.cutoff:.5,radius:h.radius!=null?h.radius:x*.5});return E}var o;function c(){if(o!=null)return o;var s=document.createElement("canvas").getContext("2d");if(s.canvas.width=s.canvas.height=1,!window.Path2D)return o=!1;var h=new Path2D("M0,0h1v1h-1v-1Z");s.fillStyle="black",s.fill(h);var m=s.getImageData(0,0,1,1);return o=m&&m.data&&m.data[3]===255}}),zb=It((et,Y)=>{var f=Sr(),y=ZX(),z=H_(),P=ls(),n=jn(),i=n.isArrayOrTypedArray,a=Js(),l=Ku(),o=dy().formatColor,c=Fu(),s=Hv(),h=lA(),m=G_(),b=Qa().DESELECTDIM,x={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},_=T0().appendArrayPointValue;function A(W,F){var H,q={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},G=W._context.plotGlPixelRatio;if(F.visible!==!0)return q;if(c.hasText(F)&&(q.text=d(W,F),q.textSel=E(W,F,F.selected),q.textUnsel=E(W,F,F.unselected)),c.hasMarkers(F)&&(q.marker=w(W,F),q.markerSel=D(W,F,F.selected),q.markerUnsel=D(W,F,F.unselected),!F.unselected&&i(F.marker.opacity))){var tt=F.marker.opacity;for(q.markerUnsel.opacity=new Array(tt.length),H=0;H500?"bold":"normal":W}function w(W,F){var H=F._length,q=F.marker,G={},tt,ht=i(q.symbol),bt=i(q.angle),vt=i(q.color),ut=i(q.line.color),rt=i(q.opacity),gt=i(q.size),it=i(q.line.width),st;if(ht||(st=h.isOpenSymbol(q.symbol)),ht||vt||ut||rt||bt){G.symbols=new Array(H),G.angles=new Array(H),G.colors=new Array(H),G.borderColors=new Array(H);var xt=q.symbol,ot=q.angle,J=o(q,q.opacity,H),mt=o(q.line,q.opacity,H);if(!i(mt[0])){var dt=mt;for(mt=Array(H),tt=0;ttm.TOO_MANY_POINTS||c.hasMarkers(F)?"rect":"round";if(ut&&F.connectgaps){var gt=tt[0],it=tt[1];for(ht=0;ht1?vt[ht]:vt[0]:vt,st=i(ut)?ut.length>1?ut[ht]:ut[0]:ut,xt=x[it],ot=x[st],J=rt?rt/.8+1:0,mt=-ot*J-ot*.5;tt.offset[ht]=[xt*J/gt,mt/gt]}}return tt}Y.exports={style:A,markerStyle:w,markerSelection:D,linePositions:B,errorBarPositions:U,textPosition:V}}),zD=It((et,Y)=>{var f=jn();Y.exports=function(y,z){var P=z._scene,n={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},i={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return z._scene||(P=z._scene={},P.init=function(){f.extendFlat(P,i,n)},P.init(),P.update=function(a){var l=f.repeat(a,P.count);if(P.fill2d&&P.fill2d.update(l),P.scatter2d&&P.scatter2d.update(l),P.line2d&&P.line2d.update(l),P.error2d&&P.error2d.update(l.concat(l)),P.select2d&&P.select2d.update(l),P.glText)for(var o=0;o{var f=cA(),y=jn(),z=Ku(),P=Jm().findExtremes,n=Im(),i=_e(),a=i.calcMarkerSize,l=i.calcAxisExpansion,o=i.setFirstScatter,c=Dm(),s=zb(),h=zD(),m=Dr().BADNUM,b=G_().TOO_MANY_POINTS;Y.exports=function(A,d){var k=A._fullLayout,w=d._xA=z.getFromId(A,d.xaxis,"x"),D=d._yA=z.getFromId(A,d.yaxis,"y"),E=k._plots[d.xaxis+d.yaxis],I=d._length,M=I>=b,p=I*2,g={},C,S=w.makeCalcdata(d,"x"),N=D.makeCalcdata(d,"y"),B=n(d,w,"x",S),U=n(d,D,"y",N),V=B.vals,W=U.vals;d._x=V,d._y=W,d.xperiodalignment&&(d._origX=S,d._xStarts=B.starts,d._xEnds=B.ends),d.yperiodalignment&&(d._origY=N,d._yStarts=U.starts,d._yEnds=U.ends);var F=new Array(p),H=new Array(I);for(C=0;C1&&y.extendFlat(I.line,s.linePositions(A,k,w)),I.errorX||I.errorY){var M=s.errorBarPositions(A,k,w,D,E);I.errorX&&y.extendFlat(I.errorX,M.x),I.errorY&&y.extendFlat(I.errorY,M.y)}return I.text&&(y.extendFlat(I.text,{positions:w},s.textPosition(A,k,I.text,I.marker)),y.extendFlat(I.textSel,{positions:w},s.textPosition(A,k,I.text,I.markerSel)),y.extendFlat(I.textUnsel,{positions:w},s.textPosition(A,k,I.text,I.markerUnsel))),I}}),OD=It((et,Y)=>{var f=jn(),y=Hn(),z=Qa().DESELECTDIM;function P(n){var i=n[0],a=i.trace,l=i.t,o=l._scene,c=l.index,s=o.selectBatch[c],h=o.unselectBatch[c],m=o.textOptions[c],b=o.textSelectedOptions[c]||{},x=o.textUnselectedOptions[c]||{},_=f.extendFlat({},m),A,d;if(s.length||h.length){var k=b.color,w=x.color,D=m.color,E=f.isArrayOrTypedArray(D);for(_.color=new Array(a._length),A=0;A{var f=Fu(),y=OD().styleTextSelection;Y.exports=function(z,P){var n=z.cd,i=z.xaxis,a=z.yaxis,l=[],o=n[0].trace,c=n[0].t,s=o._length,h=c.x,m=c.y,b=c._scene,x=c.index;if(!b)return l;var _=f.hasText(o),A=f.hasMarkers(o),d=!A&&!_;if(o.visible!==!0||d)return l;var k=[],w=[];if(P!==!1&&!P.degenerate)for(var D=0;D{var f=sA();Y.exports={moduleType:"trace",name:"scattergl",basePlotModule:Fd(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Lk(),supplyDefaults:OX(),crossTraceDefaults:$4(),colorbar:Do(),formatLabels:BX(),calc:KX(),hoverPoints:f.hoverPoints,selectPoints:BD(),meta:{}}}),XX=It((et,Y)=>{var f=Ck();Y.exports=y,Y.exports.to=y,Y.exports.from=z;function y(P,n){n==null&&(n=!0);var i=P[0],a=P[1],l=P[2],o=P[3];o==null&&(o=n?1:255),n&&(i*=255,a*=255,l*=255,o*=255),i=f(i,0,255)&255,a=f(a,0,255)&255,l=f(l,0,255)&255,o=f(o,0,255)&255;var c=i*16777216+(a<<16)+(l<<8)+o;return c}function z(P,n){P=+P;var i=P>>>24,a=(P&16711680)>>>16,l=(P&65280)>>>8,o=P&255;return n===!1?[i,a,l,o]:[i/255,a/255,l/255,o/255]}}),Yf=It((et,Y)=>{var f=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;function P(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function n(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var o=Object.getOwnPropertyNames(a).map(function(s){return a[s]});if(o.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(s){c[s]=s}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Y.exports=n()?Object.assign:function(i,a){for(var l,o=P(i),c,s=1;s{Y.exports=function(f){typeof f=="string"&&(f=[f]);for(var y=[].slice.call(arguments,1),z=[],P=0;P{Y.exports=function(f,y,z){Array.isArray(z)||(z=[].slice.call(arguments,2));for(var P=0,n=z.length;P{Y.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),uA=It((et,Y)=>{Y.exports=z,Y.exports.float32=Y.exports.float=z,Y.exports.fract32=Y.exports.fract=y;var f=new Float32Array(1);function y(P,n){if(P.length){if(P instanceof Float32Array)return new Float32Array(P.length);n instanceof Float32Array||(n=z(P));for(var i=0,a=n.length;i{function f(C,S){var N=C==null?null:typeof Symbol<"u"&&C[Symbol.iterator]||C["@@iterator"];if(N!=null){var B,U,V,W,F=[],H=!0,q=!1;try{if(V=(N=N.call(C)).next,S!==0)for(;!(H=(B=V.call(N)).done)&&(F.push(B.value),F.length!==S);H=!0);}catch(G){q=!0,U=G}finally{try{if(!H&&N.return!=null&&(W=N.return(),Object(W)!==W))return}finally{if(q)throw U}}return F}}function y(C,S){return n(C)||f(C,S)||a(C,S)||c()}function z(C){return P(C)||i(C)||a(C)||o()}function P(C){if(Array.isArray(C))return l(C)}function n(C){if(Array.isArray(C))return C}function i(C){if(typeof Symbol<"u"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function a(C,S){if(C){if(typeof C=="string")return l(C,S);var N=Object.prototype.toString.call(C).slice(8,-1);if(N==="Object"&&C.constructor&&(N=C.constructor.name),N==="Map"||N==="Set")return Array.from(C);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return l(C,S)}}function l(C,S){(S==null||S>C.length)&&(S=C.length);for(var N=0,B=new Array(S);N1&&o(M[U[V-2]],M[U[V-1]],p)>0;)E.push([U[V-1],U[V-2],g]),V-=1;U.length=V,U.push(g);for(var W=B.upperIds,V=W.length;V>1&&o(M[W[V-2]],M[W[V-1]],p)<0;)E.push([W[V-2],W[V-1],g]),V-=1;W.length=V,W.push(g)}}function d(E,I){var M;return E.a[0]B[0]&&g.push(new b(B,N,h,C),new b(N,B,s,C))}g.sort(x);for(var U=g[0].a[0]-(1+Math.abs(g[0].a[0]))*Math.pow(2,-52),V=[new m([U,1],[U,0],-1,[],[])],W=[],C=0,F=g.length;C0;){k=p.pop();for(var g=k.adjacent,C=0;C<=D;++C){var S=g[C];if(!(!S.boundary||S.lastVisited<=-E)){for(var N=S.vertices,B=0;B<=D;++B){var U=N[B];U<0?I[B]=w:I[B]=M[U]}var V=this.orient();if(V>0)return S;S.lastVisited=-E,V===0&&p.push(S)}}}return null},A.walk=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=w?this.interior.length*Math.random()|0:this.interior.length-1,g=this.interior[p];t:for(;!g.boundary;){for(var C=g.vertices,S=g.adjacent,N=0;N<=E;++N)M[N]=I[C[N]];g.lastVisited=D;for(var N=0;N<=E;++N){var B=S[N];if(!(B.lastVisited>=D)){var U=M[N];M[N]=k;var V=this.orient();if(M[N]=U,V<0){g=B;continue t}else B.boundary?B.lastVisited=-D:B.lastVisited=D}}return}return g},A.addPeaks=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=this.interior,g=this.simplices,C=[w];w.lastVisited=D,w.vertices[w.vertices.indexOf(-1)]=D,w.boundary=!1,p.push(w);for(var S=[];C.length>0;){var w=C.pop(),N=w.vertices,B=w.adjacent,U=N.indexOf(D);if(!(U<0)){for(var V=0;V<=E;++V)if(V!==U){var W=B[V];if(!(!W.boundary||W.lastVisited>=D)){var F=W.vertices;if(W.lastVisited!==-D){for(var H=0,q=0;q<=E;++q)F[q]<0?(H=q,M[q]=k):M[q]=I[F[q]];var G=this.orient();if(G>0){F[H]=D,W.boundary=!1,p.push(W),C.push(W),W.lastVisited=D;continue}else W.lastVisited=-D}var tt=W.adjacent,ht=N.slice(),bt=B.slice(),vt=new c(ht,bt,!0);g.push(vt);var ut=tt.indexOf(w);if(!(ut<0)){tt[ut]=vt,bt[U]=W,ht[V]=-1,bt[V]=w,B[V]=vt,vt.flip();for(var q=0;q<=E;++q){var rt=ht[q];if(!(rt<0||rt===D)){for(var gt=new Array(E-1),it=0,st=0;st<=E;++st){var xt=ht[st];xt<0||st===q||(gt[it++]=xt)}S.push(new s(gt,vt,q))}}}}}}}S.sort(h);for(var V=0;V+1=0?p[C++]=g[N]:S=N&1;if(S===(k&1)){var B=p[0];p[0]=p[1],p[1]=B}w.push(p)}}return w};function d(k,w){var D=k.length;if(D===0)throw new Error("Must have at least d+1 points");var E=k[0].length;if(D<=E)throw new Error("Must input at least d+1 points");var I=k.slice(0,E+1),M=l.apply(void 0,I);if(M===0)throw new Error("Input not in general position");for(var p=new Array(E+1),g=0;g<=E;++g)p[g]=g;M<0&&(p[0]=1,p[1]=0);for(var C=new c(p,new Array(E+1),!1),S=C.adjacent,N=new Array(E+2),g=0;g<=E;++g){for(var B=p.slice(),U=0;U<=E;++U)U===g&&(B[U]=-1);var V=B[0];B[0]=B[1],B[1]=V;var W=new c(B,new Array(E+1),!0);S[g]=W,N[g]=W}N[E+1]=C;for(var g=0;g<=E;++g)for(var B=S[g].vertices,F=S[g].adjacent,U=0;U<=E;++U){var H=B[U];if(H<0){F[U]=C;continue}for(var q=0;q<=E;++q)S[q].vertices.indexOf(H)<0&&(F[U]=S[q])}for(var G=new _(E,I,N),tt=!!w,g=E+1;g=1},d.isTransparent=function(){return this.opacity<1},d.pickSlots=1,d.setPickBase=function(M){this.pickId=M};function k(M){for(var p=x({colormap:M,nshades:256,format:"rgba"}),g=new Uint8Array(1024),C=0;C<256;++C){for(var S=p[C],N=0;N<3;++N)g[4*C+N]=S[N];g[4*C+3]=S[3]*255}return b(g,[256,256,4],[4,0,1])}function w(M){for(var p=M.length,g=new Array(p),C=0;C0){var q=this.triShader;q.bind(),q.uniforms=U,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},d.drawPick=function(M){M=M||{};for(var p=this.gl,g=M.model||_,C=M.view||_,S=M.projection||_,N=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],B=0;B<3;++B)N[0][B]=Math.max(N[0][B],this.clipBounds[0][B]),N[1][B]=Math.min(N[1][B],this.clipBounds[1][B]);this._model=[].slice.call(g),this._view=[].slice.call(C),this._projection=[].slice.call(S),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var U={model:g,view:C,projection:S,clipBounds:N,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},V=this.pickShader;V.bind(),V.uniforms=U,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},d.pick=function(M){if(!M||M.id!==this.pickId)return null;var p=M.value[0]+256*M.value[1]+65536*M.value[2],g=this.cells[p],C=this.positions[g[1]].slice(0,3),S={position:C,dataCoordinate:C,index:Math.floor(g[1]/48)};return this.traceType==="cone"?S.index=Math.floor(g[1]/48):this.traceType==="streamtube"&&(S.intensity=this.intensity[g[1]],S.velocity=this.vectors[g[1]].slice(0,3),S.divergence=this.vectors[g[1]][3],S.index=p),S},d.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function D(M,p){var g=l(M,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return g.attributes.position.location=0,g.attributes.color.location=2,g.attributes.uv.location=3,g.attributes.vector.location=4,g}function E(M,p){var g=l(M,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return g.attributes.position.location=0,g.attributes.id.location=1,g.attributes.vector.location=4,g}function I(M,p,g){var C=g.shaders;arguments.length===1&&(p=M,M=p.gl);var S=D(M,C),N=E(M,C),B=s(M,b(new Uint8Array([255,255,255,255]),[1,1,4]));B.generateMipmap(),B.minFilter=M.LINEAR_MIPMAP_LINEAR,B.magFilter=M.LINEAR;var U=o(M),V=o(M),W=o(M),F=o(M),H=o(M),q=c(M,[{buffer:U,type:M.FLOAT,size:4},{buffer:H,type:M.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:W,type:M.FLOAT,size:4},{buffer:F,type:M.FLOAT,size:2},{buffer:V,type:M.FLOAT,size:4}]),G=new A(M,B,S,N,U,V,H,W,F,q,g.traceType||"cone");return G.update(p),G}n.exports=I},9127:function(n,i,a){n.exports=c;var l=a(6204),o=a(5771);function c(s){return o(l(s))}},9131:function(n,i,a){var l=a(5177),o=a(9288);n.exports=c;function c(s,h){return h=h||1,s[0]=Math.random(),s[1]=Math.random(),s[2]=Math.random(),s[3]=Math.random(),l(s,s),o(s,s,h),s}},9165:function(n,i,a){n.exports=A;var l=a(2762),o=a(8116),c=a(3436),s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(d,k,w,D){this.gl=d,this.shader=D,this.buffer=k,this.vao=w,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var m=h.prototype;m.isOpaque=function(){return!this.hasAlpha},m.isTransparent=function(){return this.hasAlpha},m.drawTransparent=m.draw=function(d){var k=this.gl,w=this.shader.uniforms;this.shader.bind();var D=w.view=d.view||s,E=w.projection=d.projection||s;w.model=d.model||s,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var I=D[12],M=D[13],p=D[14],g=D[15],C=d._ortho||!1,S=C?2:1,N=S*this.pixelRatio*(E[3]*I+E[7]*M+E[11]*p+E[15]*g)/k.drawingBufferHeight;this.vao.bind();for(var B=0;B<3;++B)k.lineWidth(this.lineWidth[B]*this.pixelRatio),w.capSize=this.capSize[B]*N,this.lineCount[B]&&k.drawArrays(k.LINES,this.lineOffset[B],this.lineCount[B]);this.vao.unbind()};function b(d,k){for(var w=0;w<3;++w)d[0][w]=Math.min(d[0][w],k[w]),d[1][w]=Math.max(d[1][w],k[w])}var x=function(){for(var d=new Array(3),k=0;k<3;++k){for(var w=[],D=1;D<=2;++D)for(var E=-1;E<=1;E+=2){var I=(D+k)%3,M=[0,0,0];M[I]=E,w.push(M)}d[k]=w}return d}();function _(d,k,w,D){for(var E=x[D],I=0;I0){var U=C.slice();U[p]+=N[1][p],E.push(C[0],C[1],C[2],B[0],B[1],B[2],B[3],0,0,0,U[0],U[1],U[2],B[0],B[1],B[2],B[3],0,0,0),b(this.bounds,U),M+=2+_(E,U,B,p)}}}this.lineCount[p]=M-this.lineOffset[p]}this.buffer.update(E)}},m.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function A(d){var k=d.gl,w=l(k),D=o(k,[{buffer:w,type:k.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:k.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:k.FLOAT,size:3,offset:28,stride:40}]),E=c(k);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.offset.location=2;var I=new h(k,w,D,E);return I.update(d),I}},9215:function(n,i,a){n.exports=b;var l=a(4769),o=a(2478);function c(x,_,A){return Math.min(_,Math.max(x,A))}function s(x,_,A){this.dimension=x.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var d=0;d=A-1)for(var M=w.length-1,g=x-_[A-1],p=0;p=A-1)for(var I=w.length-1,M=x-_[A-1],p=0;p=0;--A)if(x[--_])return!1;return!0},h.jump=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var d=this._state,k=this._velocity,w=d.length-this.dimension,D=this.bounds,E=D[0],I=D[1];this._time.push(_,x);for(var M=0;M<2;++M)for(var p=0;p0;--p)d.push(c(E[p-1],I[p-1],arguments[p])),k.push(0)}},h.push=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var d=this._state,k=this._velocity,w=d.length-this.dimension,D=x-_,E=this.bounds,I=E[0],M=E[1],p=D>1e-6?1/D:0;this._time.push(x);for(var g=A;g>0;--g){var C=c(I[g-1],M[g-1],arguments[g]);d.push(C),k.push((C-d[w++])*p)}}},h.set=function(x){var _=this.dimension;if(!(x0;--E)A.push(c(w[E-1],D[E-1],arguments[E])),d.push(0)}},h.move=function(x){var _=this.lastT(),A=this.dimension;if(!(x<=_||arguments.length!==A+1)){var d=this._state,k=this._velocity,w=d.length-this.dimension,D=this.bounds,E=D[0],I=D[1],M=x-_,p=M>1e-6?1/M:0;this._time.push(x);for(var g=A;g>0;--g){var C=arguments[g];d.push(c(E[g-1],I[g-1],d[w++]+C)),k.push(C*p)}}},h.idle=function(x){var _=this.lastT();if(!(x<_)){var A=this.dimension,d=this._state,k=this._velocity,w=d.length-A,D=this.bounds,E=D[0],I=D[1],M=x-_;this._time.push(x);for(var p=A-1;p>=0;--p)d.push(c(E[p],I[p],d[w]+M*k[w])),k.push(0),w+=1}};function m(x){for(var _=new Array(x),A=0;A1&&s.indexOf("Macintosh")!==-1&&s.indexOf("Safari")!==-1&&(h=!0),h}},9226:function(n){n.exports=i;function i(a,l){return a[0]=Math.ceil(l[0]),a[1]=Math.ceil(l[1]),a[2]=Math.ceil(l[2]),a}},9265:function(n){n.exports=i;function i(a,l){return a[0]===l[0]&&a[1]===l[1]&&a[2]===l[2]}},9288:function(n){n.exports=i;function i(a,l,o){return a[0]=l[0]*o,a[1]=l[1]*o,a[2]=l[2]*o,a[3]=l[3]*o,a}},9346:function(n){var i=new Float64Array(4),a=new Float64Array(4),l=new Float64Array(4);function o(c,s,h,m,b){i.length=_?(g=1,S=_+2*k+D):(g=-k/_,S=k*g+D)):(g=0,w>=0?(C=0,S=D):-w>=d?(C=1,S=d+2*w+D):(C=-w/d,S=w*C+D));else if(C<0)C=0,k>=0?(g=0,S=D):-k>=_?(g=1,S=_+2*k+D):(g=-k/_,S=k*g+D);else{var N=1/p;g*=N,C*=N,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D}else{var B,U,V,W;g<0?(B=A+k,U=d+w,U>B?(V=U-B,W=_-2*A+d,V>=W?(g=1,C=0,S=_+2*k+D):(g=V/W,C=1-g,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D)):(g=0,U<=0?(C=1,S=d+2*w+D):w>=0?(C=0,S=D):(C=-w/d,S=w*C+D))):C<0?(B=A+w,U=_+k,U>B?(V=U-B,W=_-2*A+d,V>=W?(C=1,g=0,S=d+2*w+D):(C=V/W,g=1-C,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D)):(C=0,U<=0?(g=1,S=_+2*k+D):k>=0?(g=0,S=D):(g=-k/_,S=k*g+D))):(V=d+w-A-k,V<=0?(g=0,C=1,S=d+2*w+D):(W=_-2*A+d,V>=W?(g=1,C=0,S=_+2*k+D):(g=V/W,C=1-g,S=g*(_*g+A*C+2*k)+C*(A*g+d*C+2*w)+D)))}for(var F=1-g-C,x=0;xw)for(d=w;dk)for(d=k;d=0){for(var F=W.type.charAt(W.type.length-1)|0,H=new Array(F),q=0;q=0;)G+=1;U[V]=G}var tt=new Array(w.length);function ht(){I.program=s.program(M,I._vref,I._fref,B,U);for(var bt=0;btot&&mt>0){var dt=(J[mt][0]-ot)/(J[mt][0]-J[mt-1][0]);return J[mt][1]*(1-dt)+dt*J[mt-1][1]}}return 1}var q=[0,0,0],G={showSurface:!1,showContour:!1,projections:[S.slice(),S.slice(),S.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function tt(ot,J){var mt,dt,Ct,Rt=J.axes&&J.axes.lastCubeProps.axis||q,Bt=J.showSurface,Zt=J.showContour;for(mt=0;mt<3;++mt)for(Bt=Bt||J.surfaceProject[mt],dt=0;dt<3;++dt)Zt=Zt||J.contourProject[mt][dt];for(mt=0;mt<3;++mt){var Gt=G.projections[mt];for(dt=0;dt<16;++dt)Gt[dt]=0;for(dt=0;dt<4;++dt)Gt[5*dt]=1;Gt[5*mt]=0,Gt[12+mt]=J.axesBounds[+(Rt[mt]>0)][mt],d(Gt,ot.model,Gt);var ee=G.clipBounds[mt];for(Ct=0;Ct<2;++Ct)for(dt=0;dt<3;++dt)ee[Ct][dt]=ot.clipBounds[Ct][dt];ee[0][mt]=-1e8,ee[1][mt]=1e8}return G.showSurface=Bt,G.showContour=Zt,G}var ht={model:S,view:S,projection:S,inverseModel:S.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},bt=S.slice(),vt=[1,0,0,0,1,0,0,0,1];function ut(ot,J){ot=ot||{};var mt=this.gl;mt.disable(mt.CULL_FACE),this._colorMap.bind(0);var dt=ht;dt.model=ot.model||S,dt.view=ot.view||S,dt.projection=ot.projection||S,dt.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],dt.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],dt.objectOffset=this.objectOffset,dt.contourColor=this.contourColor[0],dt.inverseModel=k(dt.inverseModel,dt.model);for(var Ct=0;Ct<2;++Ct)for(var Rt=dt.clipBounds[Ct],Bt=0;Bt<3;++Bt)Rt[Bt]=Math.min(Math.max(this.clipBounds[Ct][Bt],-1e8),1e8);dt.kambient=this.ambientLight,dt.kdiffuse=this.diffuseLight,dt.kspecular=this.specularLight,dt.roughness=this.roughness,dt.fresnel=this.fresnel,dt.opacity=this.opacity,dt.height=0,dt.permutation=vt,dt.vertexColor=this.vertexColor;var Zt=bt;for(d(Zt,dt.view,dt.model),d(Zt,dt.projection,Zt),k(Zt,Zt),Ct=0;Ct<3;++Ct)dt.eyePosition[Ct]=Zt[12+Ct]/Zt[15];var Gt=Zt[15];for(Ct=0;Ct<3;++Ct)Gt+=this.lightPosition[Ct]*Zt[4*Ct+3];for(Ct=0;Ct<3;++Ct){var ee=Zt[12+Ct];for(Bt=0;Bt<3;++Bt)ee+=Zt[4*Bt+Ct]*this.lightPosition[Bt];dt.lightPosition[Ct]=ee/Gt}var xe=tt(dt,this);if(xe.showSurface){for(this._shader.bind(),this._shader.uniforms=dt,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(mt.TRIANGLES,this._vertexCount),Ct=0;Ct<3;++Ct)!this.surfaceProject[Ct]||!this.vertexCount||(this._shader.uniforms.model=xe.projections[Ct],this._shader.uniforms.clipBounds=xe.clipBounds[Ct],this._vao.draw(mt.TRIANGLES,this._vertexCount));this._vao.unbind()}if(xe.showContour){var ge=this._contourShader;dt.kambient=1,dt.kdiffuse=0,dt.kspecular=0,dt.opacity=1,ge.bind(),ge.uniforms=dt;var ye=this._contourVAO;for(ye.bind(),Ct=0;Ct<3;++Ct)for(ge.uniforms.permutation=B[Ct],mt.lineWidth(this.contourWidth[Ct]*this.pixelRatio),Bt=0;Bt>4)/16)/255,Ct=Math.floor(dt),Rt=dt-Ct,Bt=J[1]*(ot.value[1]+(ot.value[2]&15)/16)/255,Zt=Math.floor(Bt),Gt=Bt-Zt;Ct+=1,Zt+=1;var ee=mt.position;ee[0]=ee[1]=ee[2]=0;for(var xe=0;xe<2;++xe)for(var ge=xe?Rt:1-Rt,ye=0;ye<2;++ye)for(var ue=ye?Gt:1-Gt,Mt=Ct+xe,Ot=Zt+ye,Lt=ge*ue,ie=0;ie<3;++ie)ee[ie]+=this._field[ie].get(Mt,Ot)*Lt;for(var be=this._pickResult.level,ce=0;ce<3;++ce)if(be[ce]=w.le(this.contourLevels[ce],ee[ce]),be[ce]<0)this.contourLevels[ce].length>0&&(be[ce]=0);else if(be[ce]Math.abs(Ze-ee[ce])&&(be[ce]+=1)}for(mt.index[0]=Rt<.5?Ct:Ct+1,mt.index[1]=Gt<.5?Zt:Zt+1,mt.uv[0]=dt/J[0],mt.uv[1]=Bt/J[1],ie=0;ie<3;++ie)mt.dataCoordinate[ie]=this._field[ie].get(mt.index[0],mt.index[1]);return mt},F.padField=function(ot,J){var mt=J.shape.slice(),dt=ot.shape.slice();b.assign(ot.lo(1,1).hi(mt[0],mt[1]),J),b.assign(ot.lo(1).hi(mt[0],1),J.hi(mt[0],1)),b.assign(ot.lo(1,dt[1]-1).hi(mt[0],1),J.lo(0,mt[1]-1).hi(mt[0],1)),b.assign(ot.lo(0,1).hi(1,mt[1]),J.hi(1)),b.assign(ot.lo(dt[0]-1,1).hi(1,mt[1]),J.lo(mt[0]-1)),ot.set(0,0,J.get(0,0)),ot.set(0,dt[1]-1,J.get(0,mt[1]-1)),ot.set(dt[0]-1,0,J.get(mt[0]-1,0)),ot.set(dt[0]-1,dt[1]-1,J.get(mt[0]-1,mt[1]-1))};function gt(ot,J){return Array.isArray(ot)?[J(ot[0]),J(ot[1]),J(ot[2])]:[J(ot),J(ot),J(ot)]}function it(ot){return Array.isArray(ot)?ot.length===3?[ot[0],ot[1],ot[2],1]:[ot[0],ot[1],ot[2],ot[3]]:[0,0,0,1]}function st(ot){if(Array.isArray(ot)){if(Array.isArray(ot))return[it(ot[0]),it(ot[1]),it(ot[2])];var J=it(ot);return[J.slice(),J.slice(),J.slice()]}}F.update=function(ot){ot=ot||{},this.objectOffset=ot.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ot&&(this.contourWidth=gt(ot.contourWidth,Number)),"showContour"in ot&&(this.showContour=gt(ot.showContour,Boolean)),"showSurface"in ot&&(this.showSurface=!!ot.showSurface),"contourTint"in ot&&(this.contourTint=gt(ot.contourTint,Boolean)),"contourColor"in ot&&(this.contourColor=st(ot.contourColor)),"contourProject"in ot&&(this.contourProject=gt(ot.contourProject,function(ca){return gt(ca,Boolean)})),"surfaceProject"in ot&&(this.surfaceProject=ot.surfaceProject),"dynamicColor"in ot&&(this.dynamicColor=st(ot.dynamicColor)),"dynamicTint"in ot&&(this.dynamicTint=gt(ot.dynamicTint,Number)),"dynamicWidth"in ot&&(this.dynamicWidth=gt(ot.dynamicWidth,Number)),"opacity"in ot&&(this.opacity=ot.opacity),"opacityscale"in ot&&(this.opacityscale=ot.opacityscale),"colorBounds"in ot&&(this.colorBounds=ot.colorBounds),"vertexColor"in ot&&(this.vertexColor=ot.vertexColor?1:0),"colormap"in ot&&this._colorMap.setPixels(this.genColormap(ot.colormap,this.opacityscale));var J=ot.field||ot.coords&&ot.coords[2]||null,mt=!1;if(J||(this._field[2].shape[0]||this._field[2].shape[2]?J=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):J=this._field[2].hi(0,0)),"field"in ot||"coords"in ot){var dt=(J.shape[0]+2)*(J.shape[1]+2);dt>this._field[2].data.length&&(h.freeFloat(this._field[2].data),this._field[2].data=h.mallocFloat(l.nextPow2(dt))),this._field[2]=_(this._field[2].data,[J.shape[0]+2,J.shape[1]+2]),this.padField(this._field[2],J),this.shape=J.shape.slice();for(var Ct=this.shape,Rt=0;Rt<2;++Rt)this._field[2].size>this._field[Rt].data.length&&(h.freeFloat(this._field[Rt].data),this._field[Rt].data=h.mallocFloat(this._field[2].size)),this._field[Rt]=_(this._field[Rt].data,[Ct[0]+2,Ct[1]+2]);if(ot.coords){var Bt=ot.coords;if(!Array.isArray(Bt)||Bt.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Rt=0;Rt<2;++Rt){var Zt=Bt[Rt];for(ye=0;ye<2;++ye)if(Zt.shape[ye]!==Ct[ye])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Rt],Zt)}}else if(ot.ticks){var Gt=ot.ticks;if(!Array.isArray(Gt)||Gt.length!==2)throw new Error("gl-surface: invalid ticks");for(Rt=0;Rt<2;++Rt){var ee=Gt[Rt];if((Array.isArray(ee)||ee.length)&&(ee=_(ee)),ee.shape[0]!==Ct[Rt])throw new Error("gl-surface: invalid tick length");var xe=_(ee.data,Ct);xe.stride[Rt]=ee.stride[0],xe.stride[Rt^1]=0,this.padField(this._field[Rt],xe)}}else{for(Rt=0;Rt<2;++Rt){var ge=[0,0];ge[Rt]=1,this._field[Rt]=_(this._field[Rt].data,[Ct[0]+2,Ct[1]+2],ge,0)}this._field[0].set(0,0,0);for(var ye=0;ye0){for(var Zi=0;Zi<5;++Zi)zr.pop();zt-=1}continue t}}}ui.push(zt)}this._contourOffsets[xr]=ci,this._contourCounts[xr]=ui}var Ji=h.mallocFloat(zr.length);for(Rt=0;Rt=0&&(M=E|0,I+=g*M,p-=M),new w(this.data,p,g,I)},D.step=function(E){var I=this.shape[0],M=this.stride[0],p=this.offset,g=0,C=Math.ceil;return typeof E=="number"&&(g=E|0,g<0?(p+=M*(I-1),I=C(-I/g)):I=C(I/g),M*=g),new w(this.data,I,M,p)},D.transpose=function(E){E=E===void 0?0:E|0;var I=this.shape,M=this.stride;return new w(this.data,I[E],M[E],this.offset)},D.pick=function(E){var I=[],M=[],p=this.offset;typeof E=="number"&&E>=0?p=p+this.stride[0]*E|0:(I.push(this.shape[0]),M.push(this.stride[0]));var g=d[I.length+1];return g(this.data,I,M,p)},function(E,I,M,p){return new w(E,I[0],M[0],p)}},2:function(A,d,k){function w(E,I,M,p,g,C){this.data=E,this.shape=[I,M],this.stride=[p,g],this.offset=C|0}var D=w.prototype;return D.dtype=A,D.dimension=2,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(D,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),D.set=function(E,I,M){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I,M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]=M},D.get=function(E,I){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]},D.index=function(E,I){return this.offset+this.stride[0]*E+this.stride[1]*I},D.hi=function(E,I){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,this.stride[0],this.stride[1],this.offset)},D.lo=function(E,I){var M=this.offset,p=0,g=this.shape[0],C=this.shape[1],S=this.stride[0],N=this.stride[1];return typeof E=="number"&&E>=0&&(p=E|0,M+=S*p,g-=p),typeof I=="number"&&I>=0&&(p=I|0,M+=N*p,C-=p),new w(this.data,g,C,S,N,M)},D.step=function(E,I){var M=this.shape[0],p=this.shape[1],g=this.stride[0],C=this.stride[1],S=this.offset,N=0,B=Math.ceil;return typeof E=="number"&&(N=E|0,N<0?(S+=g*(M-1),M=B(-M/N)):M=B(M/N),g*=N),typeof I=="number"&&(N=I|0,N<0?(S+=C*(p-1),p=B(-p/N)):p=B(p/N),C*=N),new w(this.data,M,p,g,C,S)},D.transpose=function(E,I){E=E===void 0?0:E|0,I=I===void 0?1:I|0;var M=this.shape,p=this.stride;return new w(this.data,M[E],M[I],p[E],p[I],this.offset)},D.pick=function(E,I){var M=[],p=[],g=this.offset;typeof E=="number"&&E>=0?g=g+this.stride[0]*E|0:(M.push(this.shape[0]),p.push(this.stride[0])),typeof I=="number"&&I>=0?g=g+this.stride[1]*I|0:(M.push(this.shape[1]),p.push(this.stride[1]));var C=d[M.length+1];return C(this.data,M,p,g)},function(E,I,M,p){return new w(E,I[0],I[1],M[0],M[1],p)}},3:function(A,d,k){function w(E,I,M,p,g,C,S,N){this.data=E,this.shape=[I,M,p],this.stride=[g,C,S],this.offset=N|0}var D=w.prototype;return D.dtype=A,D.dimension=3,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(D,"order",{get:function(){var E=Math.abs(this.stride[0]),I=Math.abs(this.stride[1]),M=Math.abs(this.stride[2]);return E>I?I>M?[2,1,0]:E>M?[1,2,0]:[1,0,2]:E>M?[2,0,1]:M>I?[0,1,2]:[0,2,1]}}),D.set=function(E,I,M,p){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M,p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]=p},D.get=function(E,I,M){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]},D.index=function(E,I,M){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M},D.hi=function(E,I,M){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},D.lo=function(E,I,M){var p=this.offset,g=0,C=this.shape[0],S=this.shape[1],N=this.shape[2],B=this.stride[0],U=this.stride[1],V=this.stride[2];return typeof E=="number"&&E>=0&&(g=E|0,p+=B*g,C-=g),typeof I=="number"&&I>=0&&(g=I|0,p+=U*g,S-=g),typeof M=="number"&&M>=0&&(g=M|0,p+=V*g,N-=g),new w(this.data,C,S,N,B,U,V,p)},D.step=function(E,I,M){var p=this.shape[0],g=this.shape[1],C=this.shape[2],S=this.stride[0],N=this.stride[1],B=this.stride[2],U=this.offset,V=0,W=Math.ceil;return typeof E=="number"&&(V=E|0,V<0?(U+=S*(p-1),p=W(-p/V)):p=W(p/V),S*=V),typeof I=="number"&&(V=I|0,V<0?(U+=N*(g-1),g=W(-g/V)):g=W(g/V),N*=V),typeof M=="number"&&(V=M|0,V<0?(U+=B*(C-1),C=W(-C/V)):C=W(C/V),B*=V),new w(this.data,p,g,C,S,N,B,U)},D.transpose=function(E,I,M){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0;var p=this.shape,g=this.stride;return new w(this.data,p[E],p[I],p[M],g[E],g[I],g[M],this.offset)},D.pick=function(E,I,M){var p=[],g=[],C=this.offset;typeof E=="number"&&E>=0?C=C+this.stride[0]*E|0:(p.push(this.shape[0]),g.push(this.stride[0])),typeof I=="number"&&I>=0?C=C+this.stride[1]*I|0:(p.push(this.shape[1]),g.push(this.stride[1])),typeof M=="number"&&M>=0?C=C+this.stride[2]*M|0:(p.push(this.shape[2]),g.push(this.stride[2]));var S=d[p.length+1];return S(this.data,p,g,C)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],M[0],M[1],M[2],p)}},4:function(A,d,k){function w(E,I,M,p,g,C,S,N,B,U){this.data=E,this.shape=[I,M,p,g],this.stride=[C,S,N,B],this.offset=U|0}var D=w.prototype;return D.dtype=A,D.dimension=4,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p,g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]=g},D.get=function(E,I,M,p){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]},D.index=function(E,I,M,p){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p},D.hi=function(E,I,M,p){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},D.lo=function(E,I,M,p){var g=this.offset,C=0,S=this.shape[0],N=this.shape[1],B=this.shape[2],U=this.shape[3],V=this.stride[0],W=this.stride[1],F=this.stride[2],H=this.stride[3];return typeof E=="number"&&E>=0&&(C=E|0,g+=V*C,S-=C),typeof I=="number"&&I>=0&&(C=I|0,g+=W*C,N-=C),typeof M=="number"&&M>=0&&(C=M|0,g+=F*C,B-=C),typeof p=="number"&&p>=0&&(C=p|0,g+=H*C,U-=C),new w(this.data,S,N,B,U,V,W,F,H,g)},D.step=function(E,I,M,p){var g=this.shape[0],C=this.shape[1],S=this.shape[2],N=this.shape[3],B=this.stride[0],U=this.stride[1],V=this.stride[2],W=this.stride[3],F=this.offset,H=0,q=Math.ceil;return typeof E=="number"&&(H=E|0,H<0?(F+=B*(g-1),g=q(-g/H)):g=q(g/H),B*=H),typeof I=="number"&&(H=I|0,H<0?(F+=U*(C-1),C=q(-C/H)):C=q(C/H),U*=H),typeof M=="number"&&(H=M|0,H<0?(F+=V*(S-1),S=q(-S/H)):S=q(S/H),V*=H),typeof p=="number"&&(H=p|0,H<0?(F+=W*(N-1),N=q(-N/H)):N=q(N/H),W*=H),new w(this.data,g,C,S,N,B,U,V,W,F)},D.transpose=function(E,I,M,p){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0;var g=this.shape,C=this.stride;return new w(this.data,g[E],g[I],g[M],g[p],C[E],C[I],C[M],C[p],this.offset)},D.pick=function(E,I,M,p){var g=[],C=[],S=this.offset;typeof E=="number"&&E>=0?S=S+this.stride[0]*E|0:(g.push(this.shape[0]),C.push(this.stride[0])),typeof I=="number"&&I>=0?S=S+this.stride[1]*I|0:(g.push(this.shape[1]),C.push(this.stride[1])),typeof M=="number"&&M>=0?S=S+this.stride[2]*M|0:(g.push(this.shape[2]),C.push(this.stride[2])),typeof p=="number"&&p>=0?S=S+this.stride[3]*p|0:(g.push(this.shape[3]),C.push(this.stride[3]));var N=d[g.length+1];return N(this.data,g,C,S)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],M[0],M[1],M[2],M[3],p)}},5:function(A,d,k){function w(E,I,M,p,g,C,S,N,B,U,V,W){this.data=E,this.shape=[I,M,p,g,C],this.stride=[S,N,B,U,V],this.offset=W|0}var D=w.prototype;return D.dtype=A,D.dimension=5,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g,C){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g,C):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]=C},D.get=function(E,I,M,p,g){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]},D.index=function(E,I,M,p,g){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g},D.hi=function(E,I,M,p,g){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,typeof g!="number"||g<0?this.shape[4]:g|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},D.lo=function(E,I,M,p,g){var C=this.offset,S=0,N=this.shape[0],B=this.shape[1],U=this.shape[2],V=this.shape[3],W=this.shape[4],F=this.stride[0],H=this.stride[1],q=this.stride[2],G=this.stride[3],tt=this.stride[4];return typeof E=="number"&&E>=0&&(S=E|0,C+=F*S,N-=S),typeof I=="number"&&I>=0&&(S=I|0,C+=H*S,B-=S),typeof M=="number"&&M>=0&&(S=M|0,C+=q*S,U-=S),typeof p=="number"&&p>=0&&(S=p|0,C+=G*S,V-=S),typeof g=="number"&&g>=0&&(S=g|0,C+=tt*S,W-=S),new w(this.data,N,B,U,V,W,F,H,q,G,tt,C)},D.step=function(E,I,M,p,g){var C=this.shape[0],S=this.shape[1],N=this.shape[2],B=this.shape[3],U=this.shape[4],V=this.stride[0],W=this.stride[1],F=this.stride[2],H=this.stride[3],q=this.stride[4],G=this.offset,tt=0,ht=Math.ceil;return typeof E=="number"&&(tt=E|0,tt<0?(G+=V*(C-1),C=ht(-C/tt)):C=ht(C/tt),V*=tt),typeof I=="number"&&(tt=I|0,tt<0?(G+=W*(S-1),S=ht(-S/tt)):S=ht(S/tt),W*=tt),typeof M=="number"&&(tt=M|0,tt<0?(G+=F*(N-1),N=ht(-N/tt)):N=ht(N/tt),F*=tt),typeof p=="number"&&(tt=p|0,tt<0?(G+=H*(B-1),B=ht(-B/tt)):B=ht(B/tt),H*=tt),typeof g=="number"&&(tt=g|0,tt<0?(G+=q*(U-1),U=ht(-U/tt)):U=ht(U/tt),q*=tt),new w(this.data,C,S,N,B,U,V,W,F,H,q,G)},D.transpose=function(E,I,M,p,g){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0,g=g===void 0?4:g|0;var C=this.shape,S=this.stride;return new w(this.data,C[E],C[I],C[M],C[p],C[g],S[E],S[I],S[M],S[p],S[g],this.offset)},D.pick=function(E,I,M,p,g){var C=[],S=[],N=this.offset;typeof E=="number"&&E>=0?N=N+this.stride[0]*E|0:(C.push(this.shape[0]),S.push(this.stride[0])),typeof I=="number"&&I>=0?N=N+this.stride[1]*I|0:(C.push(this.shape[1]),S.push(this.stride[1])),typeof M=="number"&&M>=0?N=N+this.stride[2]*M|0:(C.push(this.shape[2]),S.push(this.stride[2])),typeof p=="number"&&p>=0?N=N+this.stride[3]*p|0:(C.push(this.shape[3]),S.push(this.stride[3])),typeof g=="number"&&g>=0?N=N+this.stride[4]*g|0:(C.push(this.shape[4]),S.push(this.stride[4]));var B=d[C.length+1];return B(this.data,C,S,N)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],I[4],M[0],M[1],M[2],M[3],M[4],p)}}};function m(A,d){var k=d===-1?"T":String(d),w=h[k];return d===-1?w(A):d===0?w(A,x[A][0]):w(A,x[A],s)}function b(A){if(l(A))return"buffer";if(o)switch(Object.prototype.toString.call(A)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(A)?"array":"generic"}var x={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function _(A,d,k,w){if(A===void 0){var g=x.array[0];return g([])}else typeof A=="number"&&(A=[A]);d===void 0&&(d=[A.length]);var D=d.length;if(k===void 0){k=new Array(D);for(var E=D-1,I=1;E>=0;--E)k[E]=I,I*=d[E]}if(w===void 0){w=0;for(var E=0;E1e-6?(k[0]=D/p,k[1]=E/p,k[2]=I/p,k[3]=M/p):(k[0]=k[1]=k[2]=0,k[3]=1)}function _(k,w,D){this.radius=l([D]),this.center=l(w),this.rotation=l(k),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var A=_.prototype;A.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},A.recalcMatrix=function(k){this.radius.curve(k),this.center.curve(k),this.rotation.curve(k);var w=this.computedRotation;x(w,w);var D=this.computedMatrix;c(D,w);var E=this.computedCenter,I=this.computedEye,M=this.computedUp,p=Math.exp(this.computedRadius[0]);I[0]=E[0]+p*D[2],I[1]=E[1]+p*D[6],I[2]=E[2]+p*D[10],M[0]=D[1],M[1]=D[5],M[2]=D[9];for(var g=0;g<3;++g){for(var C=0,S=0;S<3;++S)C+=D[g+4*S]*I[S];D[12+g]=-C}},A.getMatrix=function(k,w){this.recalcMatrix(k);var D=this.computedMatrix;if(w){for(var E=0;E<16;++E)w[E]=D[E];return w}return D},A.idle=function(k){this.center.idle(k),this.radius.idle(k),this.rotation.idle(k)},A.flush=function(k){this.center.flush(k),this.radius.flush(k),this.rotation.flush(k)},A.pan=function(k,w,D,E){w=w||0,D=D||0,E=E||0,this.recalcMatrix(k);var I=this.computedMatrix,M=I[1],p=I[5],g=I[9],C=m(M,p,g);M/=C,p/=C,g/=C;var S=I[0],N=I[4],B=I[8],U=S*M+N*p+B*g;S-=M*U,N-=p*U,B-=g*U;var V=m(S,N,B);S/=V,N/=V,B/=V,I[2],I[6],I[10];var W=S*w+M*D,F=N*w+p*D,H=B*w+g*D;this.center.move(k,W,F,H);var q=Math.exp(this.computedRadius[0]);q=Math.max(1e-4,q+E),this.radius.set(k,Math.log(q))},A.rotate=function(k,w,D,E){this.recalcMatrix(k),w=w||0,D=D||0;var I=this.computedMatrix,M=I[0],p=I[4],g=I[8],C=I[1],S=I[5],N=I[9],B=I[2],U=I[6],V=I[10],W=w*M+D*C,F=w*p+D*S,H=w*g+D*N,q=-(U*H-V*F),G=-(V*W-B*H),tt=-(B*F-U*W),ht=Math.sqrt(Math.max(0,1-Math.pow(q,2)-Math.pow(G,2)-Math.pow(tt,2))),bt=b(q,G,tt,ht);bt>1e-6?(q/=bt,G/=bt,tt/=bt,ht/=bt):(q=G=tt=0,ht=1);var vt=this.computedRotation,ut=vt[0],rt=vt[1],gt=vt[2],it=vt[3],st=ut*ht+it*q+rt*tt-gt*G,xt=rt*ht+it*G+gt*q-ut*tt,ot=gt*ht+it*tt+ut*G-rt*q,J=it*ht-ut*q-rt*G-gt*tt;if(E){q=B,G=U,tt=V;var mt=Math.sin(E)/m(q,G,tt);q*=mt,G*=mt,tt*=mt,ht=Math.cos(w),st=st*ht+J*q+xt*tt-ot*G,xt=xt*ht+J*G+ot*q-st*tt,ot=ot*ht+J*tt+st*G-xt*q,J=J*ht-st*q-xt*G-ot*tt}var dt=b(st,xt,ot,J);dt>1e-6?(st/=dt,xt/=dt,ot/=dt,J/=dt):(st=xt=ot=0,J=1),this.rotation.set(k,st,xt,ot,J)},A.lookAt=function(k,w,D,E){this.recalcMatrix(k),D=D||this.computedCenter,w=w||this.computedEye,E=E||this.computedUp;var I=this.computedMatrix;o(I,w,D,E);var M=this.computedRotation;h(M,I[0],I[1],I[2],I[4],I[5],I[6],I[8],I[9],I[10]),x(M,M),this.rotation.set(k,M[0],M[1],M[2],M[3]);for(var p=0,g=0;g<3;++g)p+=Math.pow(D[g]-w[g],2);this.radius.set(k,.5*Math.log(Math.max(p,1e-6))),this.center.set(k,D[0],D[1],D[2])},A.translate=function(k,w,D,E){this.center.move(k,w||0,D||0,E||0)},A.setMatrix=function(k,w){var D=this.computedRotation;h(D,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),x(D,D),this.rotation.set(k,D[0],D[1],D[2],D[3]);var E=this.computedMatrix;s(E,w);var I=E[15];if(Math.abs(I)>1e-6){var M=E[12]/I,p=E[13]/I,g=E[14]/I;this.recalcMatrix(k);var C=Math.exp(this.computedRadius[0]);this.center.set(k,M-E[2]*C,p-E[6]*C,g-E[10]*C),this.radius.idle(k)}else this.center.idle(k),this.radius.idle(k)},A.setDistance=function(k,w){w>0&&this.radius.set(k,Math.log(w))},A.setDistanceLimits=function(k,w){k>0?k=Math.log(k):k=-1/0,w>0?w=Math.log(w):w=1/0,w=Math.max(w,k),this.radius.bounds[0][0]=k,this.radius.bounds[1][0]=w},A.getDistanceLimits=function(k){var w=this.radius.bounds;return k?(k[0]=Math.exp(w[0][0]),k[1]=Math.exp(w[1][0]),k):[Math.exp(w[0][0]),Math.exp(w[1][0])]},A.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},A.fromJSON=function(k){var w=this.lastT(),D=k.center;D&&this.center.set(w,D[0],D[1],D[2]);var E=k.rotation;E&&this.rotation.set(w,E[0],E[1],E[2],E[3]);var I=k.distance;I&&I>0&&this.radius.set(w,Math.log(I)),this.setDistanceLimits(k.zoomMin,k.zoomMax)};function d(k){k=k||{};var w=k.center||[0,0,0],D=k.rotation||[0,0,0,1],E=k.radius||1;w=[].slice.call(w,0,3),D=[].slice.call(D,0,4),x(D,D);var I=new _(D,w,Math.log(E));return I.setDistanceLimits(k.zoomMin,k.zoomMax),("eye"in k||"up"in k)&&I.lookAt(0,k.eye,k.center,k.up),I}},9994:function(n,i,a){var l=a(9618),o=a(8277);n.exports=function(c,s){for(var h=[],m=c,b=1;Array.isArray(m);)h.push(m.length),b*=m.length,m=m[0];return h.length===0?l():(s||(s=l(new Float64Array(b),h)),o(s,c),s)}}},y={};function z(n){var i=y[n];if(i!==void 0)return i.exports;var a=y[n]={id:n,loaded:!1,exports:{}};return f[n].call(a.exports,a,a.exports,z),a.loaded=!0,a.exports}(function(){z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){z.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n}}();var P=z(1964);Y.exports=P})()}),fD=It((et,Y)=>{Y.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),LY=It((et,Y)=>{var f=fD();Y.exports=z;var y={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function z(P){var n,i=[],a=1,l;if(typeof P=="string")if(P=P.toLowerCase(),f[P])i=f[P].slice(),l="rgb";else if(P==="transparent")a=0,l="rgb",i=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(P)){var o=P.slice(1),c=o.length,s=c<=4;a=1,s?(i=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],c===4&&(a=parseInt(o[3]+o[3],16)/255)):(i=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],c===8&&(a=parseInt(o[6]+o[7],16)/255)),i[0]||(i[0]=0),i[1]||(i[1]=0),i[2]||(i[2]=0),l="rgb"}else if(n=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(P)){var h=n[1],m=h==="rgb",o=h.replace(/a$/,"");l=o;var c=o==="cmyk"?4:o==="gray"?1:3;i=n[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(_,A){if(/%$/.test(_))return A===c?parseFloat(_)/100:o==="rgb"?parseFloat(_)*255/100:parseFloat(_);if(o[A]==="h"){if(/deg$/.test(_))return parseFloat(_);if(y[_]!==void 0)return y[_]}return parseFloat(_)}),h===o&&i.push(1),a=m||i[c]===void 0?1:i[c],i=i.slice(0,c)}else P.length>10&&/[0-9](?:\s|\/)/.test(P)&&(i=P.match(/([0-9]+)/g).map(function(b){return parseFloat(b)}),l=P.match(/([a-z])/ig).join("").toLowerCase());else isNaN(P)?Array.isArray(P)||P.length?(i=[P[0],P[1],P[2]],l="rgb",a=P.length===4?P[3]:1):P instanceof Object&&(P.r!=null||P.red!=null||P.R!=null?(l="rgb",i=[P.r||P.red||P.R||0,P.g||P.green||P.G||0,P.b||P.blue||P.B||0]):(l="hsl",i=[P.h||P.hue||P.H||0,P.s||P.saturation||P.S||0,P.l||P.lightness||P.L||P.b||P.brightness]),a=P.a||P.alpha||P.opacity||1,P.opacity!=null&&(a/=100)):(l="rgb",i=[P>>>16,(P&65280)>>>8,P&255]);return{space:l,values:i,alpha:a}}}),PY=It((et,Y)=>{var f=LY();Y.exports=function(z){Array.isArray(z)&&z.raw&&(z=String.raw.apply(null,arguments));var P,n=f(z);if(!n.space)return[];var i=[0,0,0],a=n.space[0]==="h"?[360,100,100]:[255,255,255];return P=Array(3),P[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),P[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),P[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),n.space[0]==="h"&&(P=y(P)),P.push(Math.min(Math.max(n.alpha,0),1)),P};function y(z){var P=z[0]/360,n=z[1]/100,i=z[2]/100,a,l,o,c,s,h=0;if(n===0)return s=i*255,[s,s,s];for(l=i<.5?i*(1+n):i+n-i*n,a=2*i-l,c=[0,0,0];h<3;)o=P+1/3*-(h-1),o<0?o++:o>1&&o--,s=6*o<1?a+(l-a)*6*o:2*o<1?l:3*o<2?a+(l-a)*(2/3-o)*6:a,c[h++]=s*255;return c}}),Ck=It((et,Y)=>{Y.exports=f;function f(y,z,P){return zP?P:y:yz?z:y}}),GC=It((et,Y)=>{Y.exports=function(f){switch(f){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),H_=It((et,Y)=>{var f=PY(),y=Ck(),z=GC();Y.exports=function(n,i){(i==="float"||!i)&&(i="array"),i==="uint"&&(i="uint8"),i==="uint_clamped"&&(i="uint8_clamped");var a=z(i),l=new a(4),o=i!=="uint8"&&i!=="uint8_clamped";return(!n.length||typeof n=="string")&&(n=f(n),n[0]/=255,n[1]/=255,n[2]/=255),P(n)?(l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3]!=null?n[3]:255,o&&(l[0]/=255,l[1]/=255,l[2]/=255,l[3]/=255),l):(o?(l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3]!=null?n[3]:1):(l[0]=y(Math.floor(n[0]*255),0,255),l[1]=y(Math.floor(n[1]*255),0,255),l[2]=y(Math.floor(n[2]*255),0,255),l[3]=n[3]==null?255:y(Math.floor(n[3]*255),0,255)),l)};function P(n){return!!(n instanceof Uint8Array||n instanceof Uint8ClampedArray||Array.isArray(n)&&(n[0]>1||n[0]===0)&&(n[1]>1||n[1]===0)&&(n[2]>1||n[2]===0)&&(!n[3]||n[3]>1))}}),hy=It((et,Y)=>{var f=H_();function y(z){return z?f(z):[0,0,0,1]}Y.exports=y}),dy=It((et,Y)=>{var f=Sr(),y=Xi(),z=H_(),P=ch(),n=Sn().defaultLine,i=Xn().isArrayOrTypedArray,a=z(n),l=1;function o(b,x){var _=b;return _[3]*=x,_}function c(b){if(f(b))return a;var x=z(b);return x.length?x:a}function s(b){return f(b)?b:l}function h(b,x,_){var A=b.color;A&&A._inputArray&&(A=A._inputArray);var d=i(A),k=i(x),w=P.extractOpts(b),D=[],E,I,M,p,g;if(w.colorscale!==void 0?E=P.makeColorScaleFuncFromTrace(b):E=c,d?I=function(S,N){return S[N]===void 0?a:z(E(S[N]))}:I=c,k?M=function(S,N){return S[N]===void 0?l:s(S[N])}:M=s,d||k)for(var C=0;C<_;C++)p=I(A,C),g=M(x,C),D[C]=o(p,g);else D=o(z(A),x);return D}function m(b){var x=P.extractOpts(b),_=x.colorscale;return x.reversescale&&(_=P.flipScale(x.colorscale)),_.map(function(A){var d=A[0],k=y(A[1]),w=k.toRgb();return{index:d,rgb:[w.r,w.g,w.b,w.a]}})}Y.exports={formatColor:h,parseColorScale:m}}),pD=It((et,Y)=>{Y.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}),ZC=It((et,Y)=>{Y.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),IY=It((et,Y)=>{var f=ls();function y(n,i,a,l){if(!i||!i.visible)return null;for(var o=f.getComponentMethod("errorbars","makeComputeError")(i),c=new Array(n.length),s=0;s0){var _=l.c2l(b);l._lowerLogErrorBound||(l._lowerLogErrorBound=_),l._lowerErrorBound=Math.min(l._lowerLogErrorBound,_)}}else c[s]=[-h[0]*a,h[1]*a]}return c}function z(n){for(var i=0;i{var f=Vp().gl_line3d,y=Vp().gl_scatter3d,z=Vp().gl_error3d,P=Vp().gl_mesh3d,n=Vp().delaunay_triangulate,i=jn(),a=hy(),l=dy().formatColor,o=Hv(),c=pD(),s=ZC(),h=Fs(),m=T0().appendArrayPointValue,b=IY();function x(N,B){this.scene=N,this.uid=B,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var _=x.prototype;_.handlePick=function(N){if(N.object&&(N.object===this.linePlot||N.object===this.delaunayMesh||N.object===this.textMarkers||N.object===this.scatterPlot)){var B=N.index=N.data.index;return N.object.highlight&&N.object.highlight(null),this.scatterPlot&&(N.object=this.scatterPlot,this.scatterPlot.highlight(N.data)),N.textLabel="",this.textLabels&&(i.isArrayOrTypedArray(this.textLabels)?(this.textLabels[B]||this.textLabels[B]===0)&&(N.textLabel=this.textLabels[B]):N.textLabel=this.textLabels),N.traceCoordinate=[this.data.x[B],this.data.y[B],this.data.z[B]],!0}};function A(N,B,U){var V=(U+1)%3,W=(U+2)%3,F=[],H=[],q;for(q=0;q-1?-1:N.indexOf("right")>-1?1:0}function w(N){return N==null?0:N.indexOf("top")>-1?-1:N.indexOf("bottom")>-1?1:0}function D(N){var B=0,U=0,V=[B,U];if(Array.isArray(N))for(var W=0;W=0){var tt=A(q.position,q.delaunayColor,q.delaunayAxis);tt.opacity=N.opacity,this.delaunayMesh?this.delaunayMesh.update(tt):(tt.gl=B,this.delaunayMesh=P(tt),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},_.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function S(N,B){var U=new x(N,B.uid);return U.update(B),U}Y.exports=S}),mD=It((et,Y)=>{var f=dd(),y=hi(),z=Ru(),P=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=xa(),o=pD(),c=ZC(),s=Yn().extendFlat,h=sh().overrideAll,m=Xm(),b=f.line,x=f.marker,_=x.line,A=s({width:b.width,dash:{valType:"enumerated",values:m(o),dflt:"solid"}},z("line"));function d(w){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var k=Y.exports=h({x:f.x,y:f.y,z:{valType:"data_array"},text:s({},f.text,{}),texttemplate:i(),texttemplatefallback:a({editType:"calc"}),hovertext:s({},f.hovertext,{}),hovertemplate:n(),hovertemplatefallback:a(),xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z"),mode:s({},f.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:d(),y:d(),z:d()},connectgaps:f.connectgaps,line:A,marker:s({symbol:{valType:"enumerated",values:m(c),dflt:"circle",arrayOk:!0},size:s({},x.size,{dflt:8}),sizeref:x.sizeref,sizemin:x.sizemin,sizemode:x.sizemode,opacity:s({},x.opacity,{arrayOk:!1}),colorbar:x.colorbar,line:s({width:s({},_.width,{arrayOk:!1})},z("marker.line"))},z("marker")),textposition:s({},f.textposition,{dflt:"top center"}),textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:s({},l.hoverinfo)},"calc","nested");k.x.editType=k.y.editType=k.z.editType="calc+clearAxisTypes"}),zY=It((et,Y)=>{var f=ls(),y=jn(),z=Fu(),P=Y0(),n=Lm(),i=pm(),a=mD();Y.exports=function(o,c,s,h){function m(D,E){return y.coerce(o,c,a,D,E)}var b=l(o,c,m,h);if(!b){c.visible=!1;return}m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("xhoverformat"),m("yhoverformat"),m("zhoverformat"),m("mode"),z.hasMarkers(c)&&P(o,c,s,h,m,{noSelect:!0,noAngle:!0}),z.hasLines(c)&&(m("connectgaps"),n(o,c,s,h,m)),z.hasText(c)&&(m("texttemplate"),m("texttemplatefallback"),i(o,c,h,m,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var x=(c.line||{}).color,_=(c.marker||{}).color;m("surfaceaxis")>=0&&m("surfacecolor",x||_);for(var A=["x","y","z"],d=0;d<3;++d){var k="projection."+A[d];m(k+".show")&&(m(k+".opacity"),m(k+".scale"))}var w=f.getComponentMethod("errorbars","supplyDefaults");w(o,c,x||_||s,{axis:"z"}),w(o,c,x||_||s,{axis:"y",inherit:"z"}),w(o,c,x||_||s,{axis:"x",inherit:"z"})};function l(o,c,s,h){var m=0,b=s("x"),x=s("y"),_=s("z"),A=f.getComponentMethod("calendars","handleTraceDefaults");return A(o,c,["x","y","z"],h),b&&x&&_&&(m=Math.min(b.length,x.length,_.length),c._length=c._xlength=c._ylength=c._zlength=m),m}}),OY=It((et,Y)=>{var f=ft(),y=Dm();Y.exports=function(z,P){var n=[{x:!1,y:!1,trace:P,t:{}}];return f(n,P),y(z,P),n}}),BY=It((et,Y)=>{Y.exports=f;function f(y,z){if(typeof y!="string")throw new TypeError("must specify type string");if(z=z||{},typeof document>"u"&&!z.canvas)return null;var P=z.canvas||document.createElement("canvas");typeof z.width=="number"&&(P.width=z.width),typeof z.height=="number"&&(P.height=z.height);var n=z,i;try{var a=[y];y.indexOf("webgl")===0&&a.push("experimental-"+y);for(var l=0;l{var f=BY();Y.exports=function(y){return f("webgl",y)}}),gD=It((et,Y)=>{var f=Hn(),y=function(){};Y.exports=function(z){for(var P in z)typeof z[P]=="function"&&(z[P]=y);z.destroy=function(){z.container.parentNode.removeChild(z.container)};var n=document.createElement("div");n.className="no-webgl",n.style.cursor="pointer",n.style.fontSize="24px",n.style.color=f.defaults[0],n.style.position="absolute",n.style.left=n.style.top="0px",n.style.width=n.style.height="100%",n.style["background-color"]=f.lightLine,n.style["z-index"]=30;var i=document.createElement("p");return i.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",i.style.position="relative",i.style.top="50%",i.style.left="50%",i.style.height="30%",i.style.width="50%",i.style.margin="-15% 0 0 -25%",n.appendChild(i),z.container.appendChild(n),z.container.style.background="#FFFFFF",z.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),FY=It((et,Y)=>{var f=hy(),y=jn(),z=["xaxis","yaxis","zaxis"];function P(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var n=P.prototype;n.merge=function(a,l){for(var o=this,c=0;c<3;++c){var s=l[z[c]];if(!s.visible){o.tickEnable[c]=!1,o.labelEnable[c]=!1,o.lineEnable[c]=!1,o.lineTickEnable[c]=!1,o.gridEnable[c]=!1,o.zeroEnable[c]=!1,o.backgroundEnable[c]=!1;continue}o.labels[c]=a._meta?y.templateString(s.title.text,a._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(o.labelColor[c]=f(s.title.font.color)),s.title.font.family&&(o.labelFont[c]=s.title.font.family),s.title.font.size&&(o.labelSize[c]=s.title.font.size),s.title.font.weight&&(o.labelFontWeight[c]=s.title.font.weight),s.title.font.style&&(o.labelFontStyle[c]=s.title.font.style),s.title.font.variant&&(o.labelFontVariant[c]=s.title.font.variant)),"showline"in s&&(o.lineEnable[c]=s.showline),"linecolor"in s&&(o.lineColor[c]=f(s.linecolor)),"linewidth"in s&&(o.lineWidth[c]=s.linewidth),"showgrid"in s&&(o.gridEnable[c]=s.showgrid),"gridcolor"in s&&(o.gridColor[c]=f(s.gridcolor)),"gridwidth"in s&&(o.gridWidth[c]=s.gridwidth),s.type==="log"?o.zeroEnable[c]=!1:"zeroline"in s&&(o.zeroEnable[c]=s.zeroline),"zerolinecolor"in s&&(o.zeroLineColor[c]=f(s.zerolinecolor)),"zerolinewidth"in s&&(o.zeroLineWidth[c]=s.zerolinewidth),"ticks"in s&&s.ticks?o.lineTickEnable[c]=!0:o.lineTickEnable[c]=!1,"ticklen"in s&&(o.lineTickLength[c]=o._defaultLineTickLength[c]=s.ticklen),"tickcolor"in s&&(o.lineTickColor[c]=f(s.tickcolor)),"tickwidth"in s&&(o.lineTickWidth[c]=s.tickwidth),"tickangle"in s&&(o.tickAngle[c]=s.tickangle==="auto"?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(o.tickEnable[c]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(o.tickColor[c]=f(s.tickfont.color)),s.tickfont.family&&(o.tickFont[c]=s.tickfont.family),s.tickfont.size&&(o.tickSize[c]=s.tickfont.size),s.tickfont.weight&&(o.tickFontWeight[c]=s.tickfont.weight),s.tickfont.style&&(o.tickFontStyle[c]=s.tickfont.style),s.tickfont.variant&&(o.tickFontVariant[c]=s.tickfont.variant)),"mirror"in s?["ticks","all","allticks"].indexOf(s.mirror)!==-1?(o.lineTickMirror[c]=!0,o.lineMirror[c]=!0):s.mirror===!0?(o.lineTickMirror[c]=!1,o.lineMirror[c]=!0):(o.lineTickMirror[c]=!1,o.lineMirror[c]=!1):o.lineMirror[c]=!1,"showbackground"in s&&s.showbackground!==!1?(o.backgroundEnable[c]=!0,o.backgroundColor[c]=f(s.backgroundcolor)):o.backgroundEnable[c]=!1}};function i(a,l){var o=new P;return o.merge(a,l),o}Y.exports=i}),NY=It((et,Y)=>{var f=hy(),y=["xaxis","yaxis","zaxis"];function z(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var P=z.prototype;P.merge=function(i){for(var a=0;a<3;++a){var l=i[y[a]];if(!l.visible){this.enabled[a]=!1,this.drawSides[a]=!1;continue}this.enabled[a]=l.showspikes,this.colors[a]=f(l.spikecolor),this.drawSides[a]=l.spikesides,this.lineWidth[a]=l.spikethickness}};function n(i){var a=new z;return a.merge(i),a}Y.exports=n}),jY=It((et,Y)=>{Y.exports=n;var f=Fs(),y=jn(),z=["xaxis","yaxis","zaxis"];function P(i){for(var a=new Array(3),l=0;l<3;++l){for(var o=i[l],c=new Array(o.length),s=0;s/g," "));c[s]=x,h.tickmode=m}}a.ticks=c;for(var s=0;s<3;++s){.5*(i.glplot.bounds[0][s]+i.glplot.bounds[1][s]);for(var _=0;_<2;++_)a.bounds[_][s]=i.glplot.bounds[_][s]}i.contourLevels=P(c)}}),UY=It((et,Y)=>{var f=Vp().gl_plot3d,y=f.createCamera,z=f.createScene,P=RY(),n=dw(),i=ls(),a=jn(),l=a.preserveDrawingBuffer(),o=Fs(),c=hd(),s=hy(),h=gD(),m=DL(),b=FY(),x=NY(),_=jY(),A=Jm().applyAutorangeOptions,d,k,w=!1;function D(U,V){var W=document.createElement("div"),F=U.container;this.graphDiv=U.graphDiv;var H=document.createElementNS("http://www.w3.org/2000/svg","svg");H.style.position="absolute",H.style.top=H.style.left="0px",H.style.width=H.style.height="100%",H.style["z-index"]=20,H.style["pointer-events"]="none",W.appendChild(H),this.svgContainer=H,W.id=U.id,W.style.position="absolute",W.style.top=W.style.left="0px",W.style.width=W.style.height="100%",F.appendChild(W),this.fullLayout=V,this.id=U.id||"scene",this.fullSceneLayout=V[this.id],this.plotArgs=[[],{},{}],this.axesOptions=b(V,V[this.id]),this.spikeOptions=x(V[this.id]),this.container=W,this.staticMode=!!U.staticPlot,this.pixelRatio=this.pixelRatio||U.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=i.getComponentMethod("annotations3d","convert"),this.drawAnnotations=i.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var E=D.prototype;E.prepareOptions=function(){var U=this,V={canvas:U.canvas,gl:U.gl,glOptions:{preserveDrawingBuffer:l,premultipliedAlpha:!0,antialias:!0},container:U.container,axes:U.axesOptions,spikes:U.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:U.camera,pixelRatio:U.pixelRatio};if(U.staticMode){if(!k&&(d=document.createElement("canvas"),k=P({canvas:d,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!k))throw new Error("error creating static canvas/context for image server");V.gl=k,V.canvas=d}return V};var I=!0;E.tryCreatePlot=function(){var U=this,V=U.prepareOptions(),W=!0;try{U.glplot=z(V)}catch{if(U.staticMode||!I||l)W=!1;else{a.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{l=V.glOptions.preserveDrawingBuffer=!0,U.glplot=z(V)}catch{l=V.glOptions.preserveDrawingBuffer=!1,W=!1}}}return I=!1,W},E.initializeGLCamera=function(){var U=this,V=U.fullSceneLayout.camera,W=V.projection.type==="orthographic";U.camera=y(U.container,{center:[V.center.x,V.center.y,V.center.z],eye:[V.eye.x,V.eye.y,V.eye.z],up:[V.up.x,V.up.y,V.up.z],_ortho:W,zoomMin:.01,zoomMax:100,mode:"orbit"})},E.initializeGLPlot=function(){var U=this;U.initializeGLCamera();var V=U.tryCreatePlot();if(!V)return h(U);U.traces={},U.make4thDimension();var W=U.graphDiv,F=W.layout,H=function(){var G={};return U.isCameraChanged(F)&&(G[U.id+".camera"]=U.getCamera()),U.isAspectChanged(F)&&(G[U.id+".aspectratio"]=U.glplot.getAspectratio(),F[U.id].aspectmode!=="manual"&&(U.fullSceneLayout.aspectmode=F[U.id].aspectmode=G[U.id+".aspectmode"]="manual")),G},q=function(G){if(G.fullSceneLayout.dragmode!==!1){var tt=H();G.saveLayout(F),G.graphDiv.emit("plotly_relayout",tt)}};return U.glplot.canvas&&(U.glplot.canvas.addEventListener("mouseup",function(){q(U)}),U.glplot.canvas.addEventListener("touchstart",function(){w=!0}),U.glplot.canvas.addEventListener("wheel",function(G){if(W._context._scrollZoom.gl3d){if(U.camera._ortho){var tt=G.deltaX>G.deltaY?1.1:.9090909090909091,ht=U.glplot.getAspectratio();U.glplot.setAspectratio({x:tt*ht.x,y:tt*ht.y,z:tt*ht.z})}q(U)}},n?{passive:!1}:!1),U.glplot.canvas.addEventListener("mousemove",function(){if(U.fullSceneLayout.dragmode!==!1&&U.camera.mouseListener.buttons!==0){var G=H();U.graphDiv.emit("plotly_relayouting",G)}}),U.staticMode||U.glplot.canvas.addEventListener("webglcontextlost",function(G){W&&W.emit&&W.emit("plotly_webglcontextlost",{event:G,layer:U.id})},!1)),U.glplot.oncontextloss=function(){U.recoverContext()},U.glplot.onrender=function(){U.render()},!0},E.render=function(){var U=this,V=U.graphDiv,W,F=U.svgContainer,H=U.container.getBoundingClientRect();V._fullLayout._calcInverseTransform(V);var q=V._fullLayout._invScaleX,G=V._fullLayout._invScaleY,tt=H.width*q,ht=H.height*G;F.setAttributeNS(null,"viewBox","0 0 "+tt+" "+ht),F.setAttributeNS(null,"width",tt),F.setAttributeNS(null,"height",ht),_(U),U.glplot.axes.update(U.axesOptions);for(var bt=Object.keys(U.traces),vt=null,ut=U.glplot.selection,rt=0;rt")):W.type==="isosurface"||W.type==="volume"?(ot.valueLabel=o.hoverLabelText(U._mockAxis,U._mockAxis.d2l(ut.traceCoordinate[3]),W.valuehoverformat),Rt.push("value: "+ot.valueLabel),ut.textLabel&&Rt.push(ut.textLabel),Ct=Rt.join("
")):Ct=ut.textLabel;var Bt={x:ut.traceCoordinate[0],y:ut.traceCoordinate[1],z:ut.traceCoordinate[2],data:st._input,fullData:st,curveNumber:st.index,pointNumber:xt};c.appendArrayPointValue(Bt,st,xt),W._module.eventData&&(Bt=st._module.eventData(Bt,ut,st,{},xt));var Zt={points:[Bt]};if(U.fullSceneLayout.hovermode){var Gt=[];c.loneHover({trace:st,x:(.5+.5*it[0]/it[3])*tt,y:(.5-.5*it[1]/it[3])*ht,xLabel:ot.xLabel,yLabel:ot.yLabel,zLabel:ot.zLabel,text:Ct,name:vt.name,color:c.castHoverOption(st,xt,"bgcolor")||vt.color,borderColor:c.castHoverOption(st,xt,"bordercolor"),fontFamily:c.castHoverOption(st,xt,"font.family"),fontSize:c.castHoverOption(st,xt,"font.size"),fontColor:c.castHoverOption(st,xt,"font.color"),nameLength:c.castHoverOption(st,xt,"namelength"),textAlign:c.castHoverOption(st,xt,"align"),hovertemplate:a.castOption(st,xt,"hovertemplate"),hovertemplateLabels:a.extendFlat({},Bt,ot),eventData:[Bt]},{container:F,gd:V,inOut_bbox:Gt}),Bt.bbox=Gt[0]}ut.distance<5&&(ut.buttons||w)?V.emit("plotly_click",Zt):V.emit("plotly_hover",Zt),this.oldEventData=Zt}else c.loneUnhover(F),this.oldEventData&&V.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;U.drawAnnotations(U)},E.recoverContext=function(){var U=this;U.glplot.dispose();var V=function(){if(U.glplot.gl.isContextLost()){requestAnimationFrame(V);return}if(!U.initializeGLPlot()){a.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}U.plot.apply(U,U.plotArgs)};requestAnimationFrame(V)};var M=["xaxis","yaxis","zaxis"];function p(U,V,W){for(var F=U.fullSceneLayout,H=0;H<3;H++){var q=M[H],G=q.charAt(0),tt=F[q],ht=V[G],bt=V[G+"calendar"],vt=V["_"+G+"length"];if(!a.isArrayOrTypedArray(ht))W[0][H]=Math.min(W[0][H],0),W[1][H]=Math.max(W[1][H],vt-1);else for(var ut,rt=0;rt<(vt||ht.length);rt++)if(a.isArrayOrTypedArray(ht[rt]))for(var gt=0;gtst[1][G])st[0][G]=-1,st[1][G]=1;else{var xe=st[1][G]-st[0][G];st[0][G]-=xe/32,st[1][G]+=xe/32}if(J=[st[0][G],st[1][G]],J=A(J,ht),st[0][G]=J[0],st[1][G]=J[1],ht.isReversed()){var ge=st[0][G];st[0][G]=st[1][G],st[1][G]=ge}}else J=ht.range,st[0][G]=ht.r2l(J[0]),st[1][G]=ht.r2l(J[1]);st[0][G]===st[1][G]&&(st[0][G]-=1,st[1][G]+=1),xt[G]=st[1][G]-st[0][G],ht.range=[st[0][G],st[1][G]],ht.limitRange(),F.glplot.setBounds(G,{min:ht.range[0]*gt[G],max:ht.range[1]*gt[G]})}var ye,ue=vt.aspectmode;if(ue==="cube")ye=[1,1,1];else if(ue==="manual"){var Mt=vt.aspectratio;ye=[Mt.x,Mt.y,Mt.z]}else if(ue==="auto"||ue==="data"){var Ot=[1,1,1];for(G=0;G<3;++G){ht=vt[M[G]],bt=ht.type;var Lt=ot[bt];Ot[G]=Math.pow(Lt.acc,1/Lt.count)/gt[G]}ue==="data"||Math.max.apply(null,Ot)/Math.min.apply(null,Ot)<=4?ye=Ot:ye=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");vt.aspectratio.x=ut.aspectratio.x=ye[0],vt.aspectratio.y=ut.aspectratio.y=ye[1],vt.aspectratio.z=ut.aspectratio.z=ye[2],F.glplot.setAspectratio(vt.aspectratio),F.viewInitial.aspectratio||(F.viewInitial.aspectratio={x:vt.aspectratio.x,y:vt.aspectratio.y,z:vt.aspectratio.z}),F.viewInitial.aspectmode||(F.viewInitial.aspectmode=vt.aspectmode);var ie=vt.domain||null,be=V._size||null;if(ie&&be){var ce=F.container.style;ce.position="absolute",ce.left=be.l+ie.x[0]*be.w+"px",ce.top=be.t+(1-ie.y[1])*be.h+"px",ce.width=be.w*(ie.x[1]-ie.x[0])+"px",ce.height=be.h*(ie.y[1]-ie.y[0])+"px"}F.glplot.redraw()}},E.destroy=function(){var U=this;U.glplot&&(U.camera.mouseListener.enabled=!1,U.container.removeEventListener("wheel",U.camera.wheelListener),U.camera=null,U.glplot.dispose(),U.container.parentNode.removeChild(U.container),U.glplot=null)};function C(U){return[[U.eye.x,U.eye.y,U.eye.z],[U.center.x,U.center.y,U.center.z],[U.up.x,U.up.y,U.up.z]]}function S(U){return{up:{x:U.up[0],y:U.up[1],z:U.up[2]},center:{x:U.center[0],y:U.center[1],z:U.center[2]},eye:{x:U.eye[0],y:U.eye[1],z:U.eye[2]},projection:{type:U._ortho===!0?"orthographic":"perspective"}}}E.getCamera=function(){var U=this;return U.camera.view.recalcMatrix(U.camera.view.lastT()),S(U.camera)},E.setViewport=function(U){var V=this,W=U.camera;V.camera.lookAt.apply(this,C(W)),V.glplot.setAspectratio(U.aspectratio);var F=W.projection.type==="orthographic",H=V.camera._ortho;F!==H&&(V.glplot.redraw(),V.glplot.clearRGBA(),V.glplot.dispose(),V.initializeGLPlot())},E.isCameraChanged=function(U){var V=this,W=V.getCamera(),F=a.nestedProperty(U,V.id+".camera"),H=F.get();function q(bt,vt,ut,rt){var gt=["up","center","eye"],it=["x","y","z"];return vt[gt[ut]]&&bt[gt[ut]][it[rt]]===vt[gt[ut]][it[rt]]}var G=!1;if(H===void 0)G=!0;else{for(var tt=0;tt<3;tt++)for(var ht=0;ht<3;ht++)if(!q(W,H,tt,ht)){G=!0;break}(!H.projection||W.projection&&W.projection.type!==H.projection.type)&&(G=!0)}return G},E.isAspectChanged=function(U){var V=this,W=V.glplot.getAspectratio(),F=a.nestedProperty(U,V.id+".aspectratio"),H=F.get();return H===void 0||H.x!==W.x||H.y!==W.y||H.z!==W.z},E.saveLayout=function(U){var V=this,W=V.fullLayout,F,H,q,G,tt,ht,bt=V.isCameraChanged(U),vt=V.isAspectChanged(U),ut=bt||vt;if(ut){var rt={};if(bt&&(F=V.getCamera(),H=a.nestedProperty(U,V.id+".camera"),q=H.get(),rt[V.id+".camera"]=q),vt&&(G=V.glplot.getAspectratio(),tt=a.nestedProperty(U,V.id+".aspectratio"),ht=tt.get(),rt[V.id+".aspectratio"]=ht),i.call("_storeDirectGUIEdit",U,W._preGUI,rt),bt){H.set(F);var gt=a.nestedProperty(W,V.id+".camera");gt.set(F)}if(vt){tt.set(G);var it=a.nestedProperty(W,V.id+".aspectratio");it.set(G),V.glplot.redraw()}}return ut},E.updateFx=function(U,V){var W=this,F=W.camera;if(F)if(U==="orbit")F.mode="orbit",F.keyBindingMode="rotate";else if(U==="turntable"){F.up=[0,0,1],F.mode="turntable",F.keyBindingMode="rotate";var H=W.graphDiv,q=H._fullLayout,G=W.fullSceneLayout.camera,tt=G.up.x,ht=G.up.y,bt=G.up.z;if(bt/Math.sqrt(tt*tt+ht*ht+bt*bt)<.999){var vt=W.id+".camera.up",ut={x:0,y:0,z:1},rt={};rt[vt]=ut;var gt=H.layout;i.call("_storeDirectGUIEdit",gt,q._preGUI,rt),G.up=ut,a.nestedProperty(gt,vt).set(ut)}}else F.keyBindingMode=U;W.fullSceneLayout.hovermode=V};function N(U,V,W){for(var F=0,H=W-1;F0)for(var tt=255/G,ht=0;ht<3;++ht)U[q+ht]=Math.min(tt*U[q+ht],255)}}E.toImage=function(U){var V=this;U||(U="png"),V.staticMode&&V.container.appendChild(d),V.glplot.redraw();var W=V.glplot.gl,F=W.drawingBufferWidth,H=W.drawingBufferHeight;W.bindFramebuffer(W.FRAMEBUFFER,null);var q=new Uint8Array(F*H*4);W.readPixels(0,0,F,H,W.RGBA,W.UNSIGNED_BYTE,q),N(q,F,H),B(q,F,H);var G=document.createElement("canvas");G.width=F,G.height=H;var tt=G.getContext("2d",{willReadFrequently:!0}),ht=tt.createImageData(F,H);ht.data.set(q),tt.putImageData(ht,0,0);var bt;switch(U){case"jpeg":bt=G.toDataURL("image/jpeg");break;case"webp":bt=G.toDataURL("image/webp");break;default:bt=G.toDataURL("image/png")}return V.staticMode&&V.container.removeChild(d),bt},E.setConvert=function(){for(var U=this,V=0;V<3;V++){var W=U.fullSceneLayout[M[V]];o.setConvert(W,U.fullLayout),W.setScale=a.noop}},E.make4thDimension=function(){var U=this,V=U.graphDiv,W=V._fullLayout;U._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(U._mockAxis,W)},Y.exports=D}),$Y=It((et,Y)=>{Y.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),vD=It((et,Y)=>{var f=Hn(),y=Gf(),z=Yn().extendFlat,P=sh().overrideAll;Y.exports=P({visible:y.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:f.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:y.color,categoryorder:y.categoryorder,categoryarray:y.categoryarray,title:{text:y.title.text,font:y.title.font},type:z({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorange:y.autorange,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},rangemode:y.rangemode,minallowed:y.minallowed,maxallowed:y.maxallowed,range:z({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,mirror:y.mirror,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,tickfont:y.tickfont,tickangle:y.tickangle,tickprefix:y.tickprefix,showtickprefix:y.showtickprefix,ticksuffix:y.ticksuffix,showticksuffix:y.showticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickformat:y.tickformat,tickformatstops:y.tickformatstops,hoverformat:y.hoverformat,showline:y.showline,linecolor:y.linecolor,linewidth:y.linewidth,showgrid:y.showgrid,gridcolor:z({},y.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:y.gridwidth,zeroline:y.zeroline,zerolinecolor:y.zerolinecolor,zerolinewidth:y.zerolinewidth},"plot","from-root")}),yD=It((et,Y)=>{var f=vD(),y=Jh().attributes,z=Yn().extendFlat,P=jn().counterRegex;function n(i,a,l){return{x:{valType:"number",dflt:i,editType:"camera"},y:{valType:"number",dflt:a,editType:"camera"},z:{valType:"number",dflt:l,editType:"camera"},editType:"camera"}}Y.exports={_arrayAttrRegexps:[P("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:z(n(0,0,1),{}),center:z(n(0,0,0),{}),eye:z(n(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:y({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:f,yaxis:f,zaxis:f,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),HY=It((et,Y)=>{var f=Xi().mix,y=jn(),z=Tc(),P=vD(),n=c0(),i=mb(),a=["xaxis","yaxis","zaxis"],l=13600/187;Y.exports=function(o,c,s){var h,m;function b(A,d){return y.coerce(h,m,P,A,d)}for(var x=0;x{var f=jn(),y=Hn(),z=ls(),P=O_(),n=HY(),i=yD(),a=Mf().getSubplotData,l="gl3d";Y.exports=function(c,s,h){var m=s._basePlotModules.length>1;function b(x){if(!m){var _=f.validate(c[x],i[x]);if(_)return c[x]}}P(c,s,h,{type:l,attributes:i,handleDefaults:o,fullLayout:s,font:s.font,fullData:h,getDfltFromLayout:b,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function o(c,s,h,m){for(var b=h("bgcolor"),x=y.combine(b,m.paper_bgcolor),_=["up","center","eye"],A=0;A<_.length;A++)h("camera."+_[A]+".x"),h("camera."+_[A]+".y"),h("camera."+_[A]+".z");h("camera.projection.type");var d=!!h("aspectratio.x")&&!!h("aspectratio.y")&&!!h("aspectratio.z"),k=d?"manual":"auto",w=h("aspectmode",k);d||(c.aspectratio=s.aspectratio={x:1,y:1,z:1},w==="manual"&&(s.aspectmode="auto"),c.aspectmode=s.aspectmode);var D=a(m.fullData,l,m.id);n(c,s,{font:m.font,scene:m.id,data:D,bgColor:x,calendar:m.calendar,autotypenumbersDflt:m.autotypenumbersDflt,fullLayout:m.fullLayout}),z.getComponentMethod("annotations3d","handleDefaults")(c,s,m);var E=m.getDfltFromLayout("dragmode");if(E!==!1&&!E)if(E="orbit",c.camera&&c.camera.up){var I=c.camera.up.x,M=c.camera.up.y,p=c.camera.up.z;p!==0&&(!I||!M||!p||p/Math.sqrt(I*I+M*M+p*p)>.999)&&(E="turntable")}else E="turntable";h("dragmode",E),h("hovermode",m.getDfltFromLayout("hovermode"))}}),V_=It(et=>{var Y=sh().overrideAll,f=Xa(),y=UY(),z=Mf().getSubplotData,P=jn(),n=k0(),i="gl3d",a="scene";et.name=i,et.attr=a,et.idRoot=a,et.idRegex=et.attrRegex=P.counterRegex("scene"),et.attributes=$Y(),et.layoutAttributes=yD(),et.baseLayoutAttrOverrides=Y({hoverlabel:f.hoverlabel},"plot","nested"),et.supplyLayoutDefaults=VY(),et.plot=function(l){for(var o=l._fullLayout,c=l._fullData,s=o._subplots[i],h=0;h{Y.exports={plot:DY(),attributes:mD(),markerSymbols:ZC(),supplyDefaults:zY(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:OY(),moduleType:"trace",name:"scatter3d",basePlotModule:V_(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),qY=It((et,Y)=>{Y.exports=WY()}),Ak=It((et,Y)=>{var f=Hn(),y=Ru(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=xa(),a=Yn().extendFlat,l=sh().overrideAll;function o(h){return{valType:"boolean",dflt:!1}}function c(h){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:o(),y:o(),z:o()},color:{valType:"color",dflt:f.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:f.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var s=Y.exports=l(a({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:P(),hovertemplatefallback:n(),xhoverformat:z("x"),yhoverformat:z("y"),zhoverformat:z("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},y("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05,description:"Represents the level that incident rays are reflected in a single direction, causing shine."},roughness:{valType:"number",min:0,max:1,dflt:.5,description:"Alters specular reflection; the rougher the surface, the wider and less contrasty the shine."},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:a({},i.hoverinfo),showlegend:a({},i.showlegend,{dflt:!1})}),"calc","nested");s.x.editType=s.y.editType=s.z.editType="calc+clearAxisTypes"}),_D=It((et,Y)=>{var f=ls(),y=jn(),z=Cu(),P=Ak(),n=.1;function i(c,s){for(var h=[],m=32,b=0;b{var f=Cp();Y.exports=function(y,z){z.surfacecolor?f(y,z,{vals:z.surfacecolor,containerStr:"",cLetter:"c"}):f(y,z,{vals:z.z,containerStr:"",cLetter:"c"})}}),ZY=It((et,Y)=>{var f=Vp().gl_surface3d,y=Vp().ndarray,z=Vp().ndarray_linear_interpolate.d2,P=V8(),n=W8(),i=jn().isArrayOrTypedArray,a=dy().parseColorScale,l=hy(),o=ch().extractOpts;function c(C,S,N){this.scene=C,this.uid=N,this.surface=S,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var s=c.prototype;s.getXat=function(C,S,N,B){var U=i(this.data.x)?i(this.data.x[0])?this.data.x[S][C]:this.data.x[C]:C;return N===void 0?U:B.d2l(U,0,N)},s.getYat=function(C,S,N,B){var U=i(this.data.y)?i(this.data.y[0])?this.data.y[S][C]:this.data.y[S]:S;return N===void 0?U:B.d2l(U,0,N)},s.getZat=function(C,S,N,B){var U=this.data.z[S][C];return U===null&&this.data.connectgaps&&this.data._interpolatedZ&&(U=this.data._interpolatedZ[S][C]),N===void 0?U:B.d2l(U,0,N)},s.handlePick=function(C){if(C.object===this.surface){var S=(C.data.index[0]-1)/this.dataScaleX-1,N=(C.data.index[1]-1)/this.dataScaleY-1,B=Math.max(Math.min(Math.round(S),this.data.z[0].length-1),0),U=Math.max(Math.min(Math.round(N),this.data._ylength-1),0);C.index=[B,U],C.traceCoordinate=[this.getXat(B,U),this.getYat(B,U),this.getZat(B,U)],C.dataCoordinate=[this.getXat(B,U,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(B,U,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(B,U,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var V=0;V<3;V++){var W=C.dataCoordinate[V];W!=null&&(C.dataCoordinate[V]*=this.scene.dataScale[V])}var F=this.data.hovertext||this.data.text;return i(F)&&F[U]&&F[U][B]!==void 0?C.textLabel=F[U][B]:F?C.textLabel=F:C.textLabel="",C.data.dataCoordinate=C.dataCoordinate.slice(),this.surface.highlight(C.data),this.scene.glplot.spikes.position=C.dataCoordinate,!0}};function h(C){var S=C[0].rgb,N=C[C.length-1].rgb;return S[0]===N[0]&&S[1]===N[1]&&S[2]===N[2]&&S[3]===N[3]}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function b(C,S){if(C0){N=m[B];break}return N}function A(C,S){if(!(C<1||S<1)){for(var N=x(C),B=x(S),U=1,V=0;VD;)B--,B/=_(B),B++,B1?U:1};function E(C,S,N){var B=N[8]+N[2]*S[0]+N[5]*S[1];return C[0]=(N[6]+N[0]*S[0]+N[3]*S[1])/B,C[1]=(N[7]+N[1]*S[0]+N[4]*S[1])/B,C}function I(C,S,N){return M(C,S,E,N),C}function M(C,S,N,B){for(var U=[0,0],V=C.shape[0],W=C.shape[1],F=0;F0&&this.contourStart[B]!==null&&this.contourEnd[B]!==null&&this.contourEnd[B]>this.contourStart[B]))for(S[B]=!0,U=this.contourStart[B];Uht&&(this.minValues[q]=ht),this.maxValues[q]{Y.exports={attributes:Ak(),supplyDefaults:_D().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:GY(),plot:ZY(),moduleType:"trace",name:"surface",basePlotModule:V_(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),YY=It((et,Y)=>{Y.exports=KY()}),Gw=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Ak(),i=xa(),a=Yn().extendFlat;Y.exports=a({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"}),hovertemplatefallback:P({editType:"calc"}),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},f("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:n.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:a({},n.contours.x.show,{}),color:n.contours.x.color,width:n.contours.x.width,editType:"calc"},lightposition:{x:a({},n.lightposition.x,{dflt:1e5}),y:a({},n.lightposition.y,{dflt:1e5}),z:a({},n.lightposition.z,{dflt:0}),editType:"calc"},lighting:a({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc",description:"Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry."},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc",description:"Epsilon for face normals calculation avoids math issues arising from degenerate geometry."},editType:"calc"},n.lighting),hoverinfo:a({},i.hoverinfo,{editType:"calc"}),showlegend:a({},i.showlegend,{dflt:!1})})}),KC=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Gw(),i=xa(),a=Yn().extendFlat,l=sh().overrideAll;function o(h){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function c(h){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var s=Y.exports=l(a({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:o(),y:o(),z:o()},caps:{x:c(),y:c(),z:c()},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:z(),hovertemplatefallback:P(),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),valuehoverformat:y("value",1),showlegend:a({},i.showlegend,{dflt:!1})},f("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:n.opacity,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:a({},i.hoverinfo)}),"calc","nested");s.flatshading.dflt=!0,s.lighting.facenormalsepsilon.dflt=0,s.x.editType=s.y.editType=s.z.editType=s.value.editType="calc+clearAxisTypes"}),xD=It((et,Y)=>{var f=jn(),y=ls(),z=KC(),P=Cu();function n(a,l,o,c){function s(h,m){return f.coerce(a,l,z,h,m)}i(a,l,o,c,s)}function i(a,l,o,c,s){var h=s("isomin"),m=s("isomax");m!=null&&h!==void 0&&h!==null&&h>m&&(l.isomin=null,l.isomax=null);var b=s("x"),x=s("y"),_=s("z"),A=s("value");if(!b||!b.length||!x||!x.length||!_||!_.length||!A||!A.length){l.visible=!1;return}var d=y.getComponentMethod("calendars","handleTraceDefaults");d(a,l,["x","y","z"],c),s("valuehoverformat"),["x","y","z"].forEach(function(E){s(E+"hoverformat");var I="caps."+E,M=s(I+".show");M&&s(I+".fill");var p="slices."+E,g=s(p+".show");g&&(s(p+".fill"),s(p+".locations"))});var k=s("spaceframe.show");k&&s("spaceframe.fill");var w=s("surface.show");w&&(s("surface.count"),s("surface.fill"),s("surface.pattern"));var D=s("contour.show");D&&(s("contour.color"),s("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(E){s(E)}),P(a,l,c,s,{prefix:"",cLetter:"c"}),l._length=null}Y.exports={supplyDefaults:n,supplyIsoDefaults:i}}),YC=It((et,Y)=>{var f=jn(),y=Cp();function z(a,l){l._len=Math.min(l.u.length,l.v.length,l.w.length,l.x.length,l.y.length,l.z.length),l._u=i(l.u,l._len),l._v=i(l.v,l._len),l._w=i(l.w,l._len),l._x=i(l.x,l._len),l._y=i(l.y,l._len),l._z=i(l.z,l._len);var o=P(l);l._gridFill=o.fill,l._Xs=o.Xs,l._Ys=o.Ys,l._Zs=o.Zs,l._len=o.len;var c=0,s,h,m;l.starts&&(s=i(l.starts.x||[]),h=i(l.starts.y||[]),m=i(l.starts.z||[]),c=Math.min(s.length,h.length,m.length)),l._startsX=s||[],l._startsY=h||[],l._startsZ=m||[];var b=0,x=1/0,_;for(_=0;_1&&(g=l[s-1],S=o[s-1],B=c[s-1]),h=0;hg?"-":"+")+"x"),D=D.replace("y",(C>S?"-":"+")+"y"),D=D.replace("z",(N>B?"-":"+")+"z");var F=function(){s=0,U=[],V=[],W=[]};(!s||s{var f=Cp(),y=YC().processGrid,z=YC().filter;Y.exports=function(P,n){n._len=Math.min(n.x.length,n.y.length,n.z.length,n.value.length),n._x=z(n.x,n._len),n._y=z(n.y,n._len),n._z=z(n.z,n._len),n._value=z(n.value,n._len);var i=y(n);n._gridFill=i.fill,n._Xs=i.Xs,n._Ys=i.Ys,n._Zs=i.Zs,n._len=i.len;for(var a=1/0,l=-1/0,o=0;o{Y.exports=function(f,y,z,P){P=P||f.length;for(var n=new Array(P),i=0;i{var f=Vp().gl_mesh3d,y=dy().parseColorScale,z=jn().isArrayOrTypedArray,P=hy(),n=ch().extractOpts,i=Zw(),a=function(m,b){for(var x=b.length-1;x>0;x--){var _=Math.min(b[x],b[x-1]),A=Math.max(b[x],b[x-1]);if(A>_&&_-1}function mt(Oe,Xt){return Oe===null?Xt:Oe}function dt(Oe,Xt,oe){bt();var zt=[Xt],_t=[oe];if(st>=1)zt=[Xt],_t=[oe];else if(st>0){var Pt=ot(Xt,oe);zt=Pt.xyzv,_t=Pt.abc}for(var Ht=0;Ht-1?oe[he]:ht(Me,qe,Ye);Rr>-1?ae[he]=Rr:ae[he]=ut(Me,qe,Ye,mt(Oe,ur))}rt(ae[0],ae[1],ae[2])}}function Ct(Oe,Xt,oe){var zt=function(_t,Pt,Ht){dt(Oe,[Xt[_t],Xt[Pt],Xt[Ht]],[oe[_t],oe[Pt],oe[Ht]])};zt(0,1,2),zt(2,3,0)}function Rt(Oe,Xt,oe){var zt=function(_t,Pt,Ht){dt(Oe,[Xt[_t],Xt[Pt],Xt[Ht]],[oe[_t],oe[Pt],oe[Ht]])};zt(0,1,2),zt(3,0,1),zt(2,3,0),zt(1,2,3)}function Bt(Oe,Xt,oe,zt){var _t=Oe[3];_tzt&&(_t=zt);for(var Pt=(Oe[3]-_t)/(Oe[3]-Xt[3]+1e-9),Ht=[],ae=0;ae<4;ae++)Ht[ae]=(1-Pt)*Oe[ae]+Pt*Xt[ae];return Ht}function Zt(Oe,Xt,oe){return Oe>=Xt&&Oe<=oe}function Gt(Oe){var Xt=.001*(F-W);return Oe>=W-Xt&&Oe<=F+Xt}function ee(Oe){for(var Xt=[],oe=0;oe<4;oe++){var zt=Oe[oe];Xt.push([m._x[zt],m._y[zt],m._z[zt],m._value[zt]])}return Xt}var xe=3;function ge(Oe,Xt,oe,zt,_t,Pt){Pt||(Pt=1),oe=[-1,-1,-1];var Ht=!1,ae=[Zt(Xt[0][3],zt,_t),Zt(Xt[1][3],zt,_t),Zt(Xt[2][3],zt,_t)];if(!ae[0]&&!ae[1]&&!ae[2])return!1;var he=function(qe,Ye,ur){return Gt(Ye[0][3])&&Gt(Ye[1][3])&&Gt(Ye[2][3])?(dt(qe,Ye,ur),!0):Ptae?[U,Pt]:[Pt,V];mr(Xt,he[0],he[1])}}var Me=[[Math.min(W,V),Math.max(W,V)],[Math.min(U,F),Math.max(U,F)]];["x","y","z"].forEach(function(qe){for(var Ye=[],ur=0;ur0&&(ui.push(Ci.id),qe==="x"?yi.push([Ci.distRatio,0,0]):qe==="y"?yi.push([0,Ci.distRatio,0]):yi.push([0,0,Ci.distRatio]))}else qe==="x"?ci=Er(1,g-1):qe==="y"?ci=Er(1,C-1):ci=Er(1,S-1);ui.length>0&&(qe==="x"?Ye[Rr]=fr(Oe,ui,zr,xr,yi,Ye[Rr]):qe==="y"?Ye[Rr]=Jr(Oe,ui,zr,xr,yi,Ye[Rr]):Ye[Rr]=an(Oe,ui,zr,xr,yi,Ye[Rr]),Rr++),ci.length>0&&(qe==="x"?Ye[Rr]=be(Oe,ci,zr,xr,Ye[Rr]):qe==="y"?Ye[Rr]=ce(Oe,ci,zr,xr,Ye[Rr]):Ye[Rr]=Le(Oe,ci,zr,xr,Ye[Rr]),Rr++)}var fi=m.caps[qe];fi.show&&fi.fill&&(xt(fi.fill),qe==="x"?Ye[Rr]=be(Oe,[0,g-1],zr,xr,Ye[Rr]):qe==="y"?Ye[Rr]=ce(Oe,[0,C-1],zr,xr,Ye[Rr]):Ye[Rr]=Le(Oe,[0,S-1],zr,xr,Ye[Rr]),Rr++)}}),w===0&&vt(),m._meshX=H,m._meshY=q,m._meshZ=G,m._meshIntensity=tt,m._Xs=I,m._Ys=M,m._Zs=p}return _n(),m}function h(m,b){var x=m.glplot.gl,_=f({gl:x}),A=new l(m,_,b.uid);return _._trace=A,A.update(b),m.glplot.add(_),A}Y.exports={findNearestOnAxis:a,generateIsoMeshes:s,createIsosurfaceTrace:h}}),XY=It((et,Y)=>{Y.exports={attributes:KC(),supplyDefaults:xD().supplyDefaults,calc:bD(),colorbar:{min:"cmin",max:"cmax"},plot:XC().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:V_(),categories:["gl3d","showLegend"],meta:{}}}),JY=It((et,Y)=>{Y.exports=XY()}),wD=It((et,Y)=>{var f=Ru(),y=KC(),z=Ak(),P=xa(),n=Yn().extendFlat,i=sh().overrideAll,a=Y.exports=i(n({x:y.x,y:y.y,z:y.z,value:y.value,isomin:y.isomin,isomax:y.isomax,surface:y.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:y.slices,caps:y.caps,text:y.text,hovertext:y.hovertext,xhoverformat:y.xhoverformat,yhoverformat:y.yhoverformat,zhoverformat:y.zhoverformat,valuehoverformat:y.valuehoverformat,hovertemplate:y.hovertemplate,hovertemplatefallback:y.hovertemplatefallback},f("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:y.colorbar,opacity:y.opacity,opacityscale:z.opacityscale,lightposition:y.lightposition,lighting:y.lighting,flatshading:y.flatshading,contour:y.contour,hoverinfo:n({},P.hoverinfo),showlegend:n({},P.showlegend,{dflt:!1})}),"calc","nested");a.x.editType=a.y.editType=a.z.editType=a.value.editType="calc+clearAxisTypes"}),QY=It((et,Y)=>{var f=jn(),y=wD(),z=xD().supplyIsoDefaults,P=_D().opacityscaleDefaults;Y.exports=function(n,i,a,l){function o(c,s){return f.coerce(n,i,y,c,s)}z(n,i,a,l,o),P(n,i,l,o)}}),tX=It((et,Y)=>{var f=Vp().gl_mesh3d,y=dy().parseColorScale,z=jn().isArrayOrTypedArray,P=hy(),n=ch().extractOpts,i=Zw(),a=XC().findNearestOnAxis,l=XC().generateIsoMeshes;function o(h,m,b){this.scene=h,this.uid=b,this.mesh=m,this.name="",this.data=null,this.showContour=!1}var c=o.prototype;c.handlePick=function(h){if(h.object===this.mesh){var m=h.data.index,b=this.data._meshX[m],x=this.data._meshY[m],_=this.data._meshZ[m],A=this.data._Ys.length,d=this.data._Zs.length,k=a(b,this.data._Xs).id,w=a(x,this.data._Ys).id,D=a(_,this.data._Zs).id,E=h.index=D+d*w+d*A*k;h.traceCoordinate=[this.data._meshX[E],this.data._meshY[E],this.data._meshZ[E],this.data._value[E]];var I=this.data.hovertext||this.data.text;return z(I)&&I[E]!==void 0?h.textLabel=I[E]:I&&(h.textLabel=I),!0}},c.update=function(h){var m=this.scene,b=m.fullSceneLayout;this.data=l(h);function x(w,D,E,I){return D.map(function(M){return w.d2l(M,0,I)*E})}var _=i(x(b.xaxis,h._meshX,m.dataScale[0],h.xcalendar),x(b.yaxis,h._meshY,m.dataScale[1],h.ycalendar),x(b.zaxis,h._meshZ,m.dataScale[2],h.zcalendar)),A=i(h._meshI,h._meshJ,h._meshK),d={positions:_,cells:A,lightPosition:[h.lightposition.x,h.lightposition.y,h.lightposition.z],ambient:h.lighting.ambient,diffuse:h.lighting.diffuse,specular:h.lighting.specular,roughness:h.lighting.roughness,fresnel:h.lighting.fresnel,vertexNormalsEpsilon:h.lighting.vertexnormalsepsilon,faceNormalsEpsilon:h.lighting.facenormalsepsilon,opacity:h.opacity,opacityscale:h.opacityscale,contourEnable:h.contour.show,contourColor:P(h.contour.color).slice(0,3),contourWidth:h.contour.width,useFacetNormals:h.flatshading},k=n(h);d.vertexIntensity=h._meshIntensity,d.vertexIntensityBounds=[k.min,k.max],d.colormap=y(h),this.mesh.update(d)},c.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function s(h,m){var b=h.glplot.gl,x=f({gl:b}),_=new o(h,x,m.uid);return x._trace=_,_.update(m),h.glplot.add(x),_}Y.exports=s}),eX=It((et,Y)=>{Y.exports={attributes:wD(),supplyDefaults:QY(),calc:bD(),colorbar:{min:"cmin",max:"cmax"},plot:tX(),moduleType:"trace",name:"volume",basePlotModule:V_(),categories:["gl3d","showLegend"],meta:{}}}),rX=It((et,Y)=>{Y.exports=eX()}),nX=It((et,Y)=>{var f=ls(),y=jn(),z=Cu(),P=Gw();Y.exports=function(n,i,a,l){function o(b,x){return y.coerce(n,i,P,b,x)}function c(b){var x=b.map(function(_){var A=o(_);return A&&y.isArrayOrTypedArray(A)?A:null});return x.every(function(_){return _&&_.length===x[0].length})&&x}var s=c(["x","y","z"]);if(!s){i.visible=!1;return}if(c(["i","j","k"]),i.i&&(!i.j||!i.k)||i.j&&(!i.k||!i.i)||i.k&&(!i.i||!i.j)){i.visible=!1;return}var h=f.getComponentMethod("calendars","handleTraceDefaults");h(n,i,["x","y","z"],l),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(b){o(b)});var m=o("contour.show");m&&(o("contour.color"),o("contour.width")),"intensity"in n?(o("intensity"),o("intensitymode"),z(n,i,l,o,{prefix:"",cLetter:"c"})):(i.showscale=!1,"facecolor"in n?o("facecolor"):"vertexcolor"in n?o("vertexcolor"):o("color",a)),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),o("xhoverformat"),o("yhoverformat"),o("zhoverformat"),i._length=null}}),iX=It((et,Y)=>{var f=Cp();Y.exports=function(y,z){z.intensity&&f(y,z,{vals:z.intensity,containerStr:"",cLetter:"c"})}}),aX=It((et,Y)=>{var f=Vp().gl_mesh3d,y=Vp().delaunay_triangulate,z=Vp().alpha_shape,P=Vp().convex_hull,n=dy().parseColorScale,i=jn().isArrayOrTypedArray,a=hy(),l=ch().extractOpts,o=Zw();function c(d,k,w){this.scene=d,this.uid=w,this.mesh=k,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var s=c.prototype;s.handlePick=function(d){if(d.object===this.mesh){var k=d.index=d.data.index;d.data._cellCenter?d.traceCoordinate=d.data.dataCoordinate:d.traceCoordinate=[this.data.x[k],this.data.y[k],this.data.z[k]];var w=this.data.hovertext||this.data.text;return i(w)&&w[k]!==void 0?d.textLabel=w[k]:w&&(d.textLabel=w),!0}};function h(d){for(var k=[],w=d.length,D=0;D=k-.5)return!1;return!0}s.update=function(d){var k=this.scene,w=k.fullSceneLayout;this.data=d;var D=d.x.length,E=o(m(w.xaxis,d.x,k.dataScale[0],d.xcalendar),m(w.yaxis,d.y,k.dataScale[1],d.ycalendar),m(w.zaxis,d.z,k.dataScale[2],d.zcalendar)),I;if(d.i&&d.j&&d.k){if(d.i.length!==d.j.length||d.j.length!==d.k.length||!_(d.i,D)||!_(d.j,D)||!_(d.k,D))return;I=o(b(d.i),b(d.j),b(d.k))}else d.alphahull===0?I=P(E):d.alphahull>0?I=z(d.alphahull,E):I=x(d.delaunayaxis,E);var M={positions:E,cells:I,lightPosition:[d.lightposition.x,d.lightposition.y,d.lightposition.z],ambient:d.lighting.ambient,diffuse:d.lighting.diffuse,specular:d.lighting.specular,roughness:d.lighting.roughness,fresnel:d.lighting.fresnel,vertexNormalsEpsilon:d.lighting.vertexnormalsepsilon,faceNormalsEpsilon:d.lighting.facenormalsepsilon,opacity:d.opacity,contourEnable:d.contour.show,contourColor:a(d.contour.color).slice(0,3),contourWidth:d.contour.width,useFacetNormals:d.flatshading};if(d.intensity){var p=l(d);this.color="#fff";var g=d.intensitymode;M[g+"Intensity"]=d.intensity,M[g+"IntensityBounds"]=[p.min,p.max],M.colormap=n(d)}else d.vertexcolor?(this.color=d.vertexcolor[0],M.vertexColors=h(d.vertexcolor)):d.facecolor?(this.color=d.facecolor[0],M.cellColors=h(d.facecolor)):(this.color=d.color,M.meshColor=a(d.color));this.mesh.update(M)},s.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function A(d,k){var w=d.glplot.gl,D=f({gl:w}),E=new c(d,D,k.uid);return D._trace=E,E.update(k),d.glplot.add(D),E}Y.exports=A}),oX=It((et,Y)=>{Y.exports={attributes:Gw(),supplyDefaults:nX(),calc:iX(),colorbar:{min:"cmin",max:"cmax"},plot:aX(),moduleType:"trace",name:"mesh3d",basePlotModule:V_(),categories:["gl3d","showLegend"],meta:{}}}),sX=It((et,Y)=>{Y.exports=oX()}),kD=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Gw(),i=xa(),a=Yn().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},i.showlegend,{dflt:!1})};a(l,f("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(c){l[c]=n[c]}),l.hoverinfo=a({},i.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),lX=It((et,Y)=>{var f=jn(),y=Cu(),z=kD();Y.exports=function(P,n,i,a){function l(_,A){return f.coerce(P,n,z,_,A)}var o=l("u"),c=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!c||!c.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){n.visible=!1;return}var x=l("sizemode");l("sizeref",x==="raw"?1:.5),l("anchor"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,n,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),n._length=null}}),cX=It((et,Y)=>{var f=Cp();Y.exports=function(y,z){for(var P=z.u,n=z.v,i=z.w,a=Math.min(z.x.length,z.y.length,z.z.length,P.length,n.length,i.length),l=-1/0,o=1/0,c=0;c{var f=Vp().gl_cone3d,y=Vp().gl_cone3d.createConeMesh,z=jn().simpleMap,P=dy().parseColorScale,n=ch().extractOpts,i=jn().isArrayOrTypedArray,a=Zw();function l(x,_){this.scene=x,this.uid=_,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(x){if(x.object===this.mesh){var _=x.index=x.data.index,A=this.data.x[_],d=this.data.y[_],k=this.data.z[_],w=this.data.u[_],D=this.data.v[_],E=this.data.w[_];x.traceCoordinate=[A,d,k,w,D,E,Math.sqrt(w*w+D*D+E*E)];var I=this.data.hovertext||this.data.text;return i(I)&&I[_]!==void 0?x.textLabel=I[_]:I&&(x.textLabel=I),!0}};var c={xaxis:0,yaxis:1,zaxis:2},s={tip:1,tail:0,cm:.25,center:.5},h={tip:1,tail:1,cm:.75,center:.5};function m(x,_){var A=x.fullSceneLayout,d=x.dataScale,k={};function w(p,g){var C=A[g],S=d[c[g]];return z(p,function(N){return C.d2l(N)*S})}k.vectors=a(w(_.u,"xaxis"),w(_.v,"yaxis"),w(_.w,"zaxis"),_._len),k.positions=a(w(_.x,"xaxis"),w(_.y,"yaxis"),w(_.z,"zaxis"),_._len);var D=n(_);k.colormap=P(_),k.vertexIntensityBounds=[D.min/_._normMax,D.max/_._normMax],k.coneOffset=s[_.anchor];var E=_.sizemode;E==="scaled"?k.coneSize=_.sizeref||.5:E==="absolute"?k.coneSize=_.sizeref&&_._normMax?_.sizeref/_._normMax:.5:E==="raw"&&(k.coneSize=_.sizeref),k.coneSizemode=E;var I=f(k),M=_.lightposition;return I.lightPosition=[M.x,M.y,M.z],I.ambient=_.lighting.ambient,I.diffuse=_.lighting.diffuse,I.specular=_.lighting.specular,I.roughness=_.lighting.roughness,I.fresnel=_.lighting.fresnel,I.opacity=_.opacity,_._pad=h[_.anchor]*I.vectorScale*I.coneScale*_._normMax,I}o.update=function(x){this.data=x;var _=m(this.scene,x);this.mesh.update(_)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function b(x,_){var A=x.glplot.gl,d=m(x,_),k=y(A,d),w=new l(x,_.uid);return w.mesh=k,w.data=_,k._trace=w,x.glplot.add(k),w}Y.exports=b}),hX=It((et,Y)=>{Y.exports={moduleType:"trace",name:"cone",basePlotModule:V_(),categories:["gl3d","showLegend"],attributes:kD(),supplyDefaults:lX(),colorbar:{min:"cmin",max:"cmax"},calc:cX(),plot:uX(),eventData:function(f,y){return f.norm=y.traceCoordinate[6],f},meta:{}}}),dX=It((et,Y)=>{Y.exports=hX()}),TD=It((et,Y)=>{var f=Ru(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=Gw(),i=xa(),a=Yn().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},i.showlegend,{dflt:!1})};a(l,f("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(c){l[c]=n[c]}),l.hoverinfo=a({},i.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),fX=It((et,Y)=>{var f=jn(),y=Cu(),z=TD();Y.exports=function(P,n,i,a){function l(x,_){return f.coerce(P,n,z,x,_)}var o=l("u"),c=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!c||!c.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){n.visible=!1;return}l("starts.x"),l("starts.y"),l("starts.z"),l("maxdisplayed"),l("sizeref"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,n,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),n._length=null}}),pX=It((et,Y)=>{var f=Vp().gl_streamtube3d,y=f.createTubeMesh,z=jn(),P=dy().parseColorScale,n=ch().extractOpts,i=Zw(),a={xaxis:0,yaxis:1,zaxis:2};function l(b,x){this.scene=b,this.uid=x,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(b){var x=this.scene.fullSceneLayout,_=this.scene.dataScale;function A(w,D){var E=x[D],I=_[a[D]];return E.l2c(w)/I}if(b.object===this.mesh){var d=b.data.position,k=b.data.velocity;return b.traceCoordinate=[A(d[0],"xaxis"),A(d[1],"yaxis"),A(d[2],"zaxis"),A(k[0],"xaxis"),A(k[1],"yaxis"),A(k[2],"zaxis"),b.data.intensity*this.data._normMax,b.data.divergence],b.textLabel=this.data.hovertext||this.data.text,!0}};function c(b){var x=b.length,_;return x>2?_=b.slice(1,x-1):x===2?_=[(b[0]+b[1])/2]:_=b,_}function s(b){var x=b.length;return x===1?[.5,.5]:[b[1]-b[0],b[x-1]-b[x-2]]}function h(b,x){var _=b.fullSceneLayout,A=b.dataScale,d=x._len,k={};function w(ut,rt){var gt=_[rt],it=A[a[rt]];return z.simpleMap(ut,function(st){return gt.d2l(st)*it})}if(k.vectors=i(w(x._u,"xaxis"),w(x._v,"yaxis"),w(x._w,"zaxis"),d),!d)return{positions:[],cells:[]};var D=w(x._Xs,"xaxis"),E=w(x._Ys,"yaxis"),I=w(x._Zs,"zaxis");k.meshgrid=[D,E,I],k.gridFill=x._gridFill;var M=x._slen;if(M)k.startingPositions=i(w(x._startsX,"xaxis"),w(x._startsY,"yaxis"),w(x._startsZ,"zaxis"));else{for(var p=E[0],g=c(D),C=c(I),S=new Array(g.length*C.length),N=0,B=0;B{Y.exports={moduleType:"trace",name:"streamtube",basePlotModule:V_(),categories:["gl3d","showLegend"],attributes:TD(),supplyDefaults:fX(),colorbar:{min:"cmin",max:"cmax"},calc:YC().calc,plot:pX(),eventData:function(f,y){return f.tubex=f.x,f.tubey=f.y,f.tubez=f.z,f.tubeu=y.traceCoordinate[3],f.tubev=y.traceCoordinate[4],f.tubew=y.traceCoordinate[5],f.norm=y.traceCoordinate[6],f.divergence=y.traceCoordinate[7],delete f.x,delete f.y,delete f.z,f},meta:{}}}),gX=It((et,Y)=>{Y.exports=mX()}),Ib=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=dd(),i=xa(),a=Ru(),l=qf().dash,o=Yn().extendFlat,c=sh().overrideAll,s=n.marker,h=n.line,m=s.line;Y.exports=c({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:o({},n.mode,{dflt:"markers"}),text:o({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","location","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},n.hovertext,{}),textfont:n.textfont,textposition:n.textposition,line:{color:h.color,width:h.width,dash:l},connectgaps:n.connectgaps,marker:o({symbol:s.symbol,opacity:s.opacity,angle:s.angle,angleref:o({},s.angleref,{values:["previous","up","north"]}),standoff:s.standoff,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,colorbar:s.colorbar,line:o({width:m.width},a("marker.line")),gradient:s.gradient},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:P(),selected:n.selected,unselected:n.unselected,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:f(),hovertemplatefallback:z()},"calc","nested")}),vX=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=pm(),i=Pm(),a=Ib(),l=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(o,c,s,h){function m(D,E){return f.coerce(o,c,a,D,E)}var b=m("locations"),x;if(b&&b.length){var _=m("geojson"),A;(typeof _=="string"&&_!==""||f.isPlainObject(_))&&(A="geojson-id");var d=m("locationmode",A);d==="country names"&&f.warn(l),d==="geojson-id"&&m("featureidkey"),x=b.length}else{var k=m("lon")||[],w=m("lat")||[];x=Math.min(k.length,w.length)}if(!x){c.visible=!1;return}c._length=x,m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),y.hasMarkers(c)&&z(o,c,s,h,m,{gradient:!0}),y.hasLines(c)&&(P(o,c,s,h,m),m("connectgaps")),y.hasText(c)&&(m("texttemplate"),m("texttemplatefallback"),n(o,c,h,m)),m("fill"),c.fill!=="none"&&i(o,c,s,m),f.coerceSelectionMarkerOpacity(c,m)}}),yX=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.geo]._subplot,a=i.mockAxis,l=y.lonlat;return n.lonLabel=f.tickText(a,a.c2l(l[0]),!0).text,n.latLabel=f.tickText(a,a.c2l(l[1]),!0).text,n}}),JC=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Dm(),P=ft(),n=$t(),i=jn().isArrayOrTypedArray,a=jn()._;function l(o){return o&&typeof o=="string"}Y.exports=function(o,c){var s=i(c.locations),h=s?c.locations.length:c._length,m=new Array(h),b;c.geojson?b=function(w){return l(w)||f(w)}:b=l;for(var x=0;x{et.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},et.axesNames=["lonaxis","lataxis"],et.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},et.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},et.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},et.clipPad=.001,et.precision=.1,et.landColor="#F0DC82",et.waterColor="#3399FF",et.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},et.sphereSVG={type:"Sphere"},et.fillLayers={ocean:1,land:1,lakes:1},et.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},et.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],et.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],et.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),SD=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.topojson=f.topojson||{}))})(et,function(f){function y(w){return w}function z(w){if(w==null)return y;var D,E,I=w.scale[0],M=w.scale[1],p=w.translate[0],g=w.translate[1];return function(C,S){S||(D=E=0);var N=2,B=C.length,U=new Array(B);for(U[0]=(D+=C[0])*I+p,U[1]=(E+=C[1])*M+g;Np&&(p=N[0]),N[1]g&&(g=N[1])}function S(N){switch(N.type){case"GeometryCollection":N.geometries.forEach(S);break;case"Point":C(N.coordinates);break;case"MultiPoint":N.coordinates.forEach(C);break}}w.arcs.forEach(function(N){for(var B=-1,U=N.length,V;++Bp&&(p=V[0]),V[1]g&&(g=V[1])});for(E in w.objects)S(w.objects[E]);return[I,M,p,g]}function n(w,D){for(var E,I=w.length,M=I-D;M<--I;)E=w[M],w[M++]=w[I],w[I]=E}function i(w,D){return typeof D=="string"&&(D=w.objects[D]),D.type==="GeometryCollection"?{type:"FeatureCollection",features:D.geometries.map(function(E){return a(w,E)})}:a(w,D)}function a(w,D){var E=D.id,I=D.bbox,M=D.properties==null?{}:D.properties,p=l(w,D);return E==null&&I==null?{type:"Feature",properties:M,geometry:p}:I==null?{type:"Feature",id:E,properties:M,geometry:p}:{type:"Feature",id:E,bbox:I,properties:M,geometry:p}}function l(w,D){var E=z(w.transform),I=w.arcs;function M(B,U){U.length&&U.pop();for(var V=I[B<0?~B:B],W=0,F=V.length;W1)I=h(w,D,E);else for(M=0,I=new Array(p=w.arcs.length);M1)for(var U=1,V=C(N[0]),W,F;UV&&(F=N[0],N[0]=N[U],N[U]=F,V=W);return N}).filter(function(S){return S.length>0})}}function _(w,D){for(var E=0,I=w.length;E>>1;w[M]=2))throw new Error("n must be ≥2");S=w.bbox||P(w);var E=S[0],I=S[1],M=S[2],p=S[3],g;D={scale:[M-E?(M-E)/(g-1):1,p-I?(p-I)/(g-1):1],translate:[E,I]}}else S=w.bbox;var C=d(D),S,N,B=w.objects,U={};function V(H){return C(H)}function W(H){var q;switch(H.type){case"GeometryCollection":q={type:"GeometryCollection",geometries:H.geometries.map(W)};break;case"Point":q={type:"Point",coordinates:V(H.coordinates)};break;case"MultiPoint":q={type:"MultiPoint",coordinates:H.coordinates.map(V)};break;default:return H}return H.id!=null&&(q.id=H.id),H.bbox!=null&&(q.bbox=H.bbox),H.properties!=null&&(q.properties=H.properties),q}function F(H){var q=0,G=1,tt=H.length,ht,bt=new Array(tt);for(bt[0]=C(H[0],0);++q{var f=Y.exports={},y=Mk().locationmodeToLayer,z=SD().feature;f.getTopojsonName=function(P){return[P.scope.replace(/ /g,"-"),"_",P.resolution.toString(),"m"].join("")},f.getTopojsonPath=function(P,n){return P+=P.endsWith("/")?"":"/",`${P}${n}.json`},f.getTopojsonFeatures=function(P,n){var i=y[P.locationmode],a=n.objects[i];return z(n,a).features}}),W_=It(et=>{var Y=Dr().BADNUM;et.calcTraceToLineCoords=function(f){for(var y=f[0].trace,z=y.connectgaps,P=[],n=[],i=0;i0&&(P.push(n),n=[])}return n.length>0&&P.push(n),P},et.makeLine=function(f){return f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}},et.makePolygon=function(f){if(f.length===1)return{type:"Polygon",coordinates:f};for(var y=new Array(f.length),z=0;z{Y.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}),tA=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=63710088e-1,f={centimeters:Y*100,centimetres:Y*100,degrees:360/(2*Math.PI),feet:Y*3.28084,inches:Y*39.37,kilometers:Y/1e3,kilometres:Y/1e3,meters:Y,metres:Y,miles:Y/1609.344,millimeters:Y*1e3,millimetres:Y*1e3,nauticalmiles:Y/1852,radians:1,yards:Y*1.0936},y={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function z(B,U,V={}){let W={type:"Feature"};return(V.id===0||V.id)&&(W.id=V.id),V.bbox&&(W.bbox=V.bbox),W.properties=U||{},W.geometry=B,W}function P(B,U,V={}){switch(B){case"Point":return n(U).geometry;case"LineString":return o(U).geometry;case"Polygon":return a(U).geometry;case"MultiPoint":return m(U).geometry;case"MultiLineString":return h(U).geometry;case"MultiPolygon":return b(U).geometry;default:throw new Error(B+" is invalid")}}function n(B,U,V={}){if(!B)throw new Error("coordinates is required");if(!Array.isArray(B))throw new Error("coordinates must be an Array");if(B.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g(B[0])||!g(B[1]))throw new Error("coordinates must contain numbers");return z({type:"Point",coordinates:B},U,V)}function i(B,U,V={}){return s(B.map(W=>n(W,U)),V)}function a(B,U,V={}){for(let W of B){if(W.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(W[W.length-1].length!==W[0].length)throw new Error("First and last Position are not equivalent.");for(let F=0;Fa(W,U)),V)}function o(B,U,V={}){if(B.length<2)throw new Error("coordinates must be an array of two or more positions");return z({type:"LineString",coordinates:B},U,V)}function c(B,U,V={}){return s(B.map(W=>o(W,U)),V)}function s(B,U={}){let V={type:"FeatureCollection"};return U.id&&(V.id=U.id),U.bbox&&(V.bbox=U.bbox),V.features=B,V}function h(B,U,V={}){return z({type:"MultiLineString",coordinates:B},U,V)}function m(B,U,V={}){return z({type:"MultiPoint",coordinates:B},U,V)}function b(B,U,V={}){return z({type:"MultiPolygon",coordinates:B},U,V)}function x(B,U,V={}){return z({type:"GeometryCollection",geometries:B},U,V)}function _(B,U=0){if(U&&!(U>=0))throw new Error("precision must be a positive number");let V=Math.pow(10,U||0);return Math.round(B*V)/V}function A(B,U="kilometers"){let V=f[U];if(!V)throw new Error(U+" units is invalid");return B*V}function d(B,U="kilometers"){let V=f[U];if(!V)throw new Error(U+" units is invalid");return B/V}function k(B,U){return E(d(B,U))}function w(B){let U=B%360;return U<0&&(U+=360),U}function D(B){return B=B%360,B>180?B-360:B<-180?B+360:B}function E(B){return B%(2*Math.PI)*180/Math.PI}function I(B){return B%360*Math.PI/180}function M(B,U="kilometers",V="kilometers"){if(!(B>=0))throw new Error("length must be a positive number");return A(d(B,U),V)}function p(B,U="meters",V="kilometers"){if(!(B>=0))throw new Error("area must be a positive number");let W=y[U];if(!W)throw new Error("invalid original units");let F=y[V];if(!F)throw new Error("invalid final units");return B/W*F}function g(B){return!isNaN(B)&&B!==null&&!Array.isArray(B)}function C(B){return B!==null&&typeof B=="object"&&!Array.isArray(B)}function S(B){if(!B)throw new Error("bbox is required");if(!Array.isArray(B))throw new Error("bbox must be an Array");if(B.length!==4&&B.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");B.forEach(U=>{if(!g(U))throw new Error("bbox must only contain numbers")})}function N(B){if(!B)throw new Error("id is required");if(["string","number"].indexOf(typeof B)===-1)throw new Error("id must be a number or a string")}et.areaFactors=y,et.azimuthToBearing=D,et.bearingToAzimuth=w,et.convertArea=p,et.convertLength=M,et.degreesToRadians=I,et.earthRadius=Y,et.factors=f,et.feature=z,et.featureCollection=s,et.geometry=P,et.geometryCollection=x,et.isNumber=g,et.isObject=C,et.lengthToDegrees=k,et.lengthToRadians=d,et.lineString=o,et.lineStrings=c,et.multiLineString=h,et.multiPoint=m,et.multiPolygon=b,et.point=n,et.points=i,et.polygon=a,et.polygons=l,et.radiansToDegrees=E,et.radiansToLength=A,et.round=_,et.validateBBox=S,et.validateId=N}),eA=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=tA();function f(d,k,w){if(d!==null)for(var D,E,I,M,p,g,C,S=0,N=0,B,U=d.type,V=U==="FeatureCollection",W=U==="Feature",F=V?d.features.length:1,H=0;Hg||V>C||W>S){p=N,g=D,C=V,S=W,I=0;return}var F=Y.lineString.call(void 0,[p,N],w.properties);if(k(F,D,E,W,I)===!1)return!1;I++,p=N})===!1)return!1}}})}function m(d,k,w){var D=w,E=!1;return h(d,function(I,M,p,g,C){E===!1&&w===void 0?D=I:D=k(D,I,M,p,g,C),E=!0}),D}function b(d,k){if(!d)throw new Error("geojson is required");c(d,function(w,D,E){if(w.geometry!==null){var I=w.geometry.type,M=w.geometry.coordinates;switch(I){case"LineString":if(k(w,D,E,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p{Object.defineProperty(et,"__esModule",{value:!0});var Y=tA(),f=eA();function y(o){return f.geomReduce.call(void 0,o,(c,s)=>c+z(s),0)}function z(o){let c=0,s;switch(o.type){case"Polygon":return P(o.coordinates);case"MultiPolygon":for(s=0;s0){c+=Math.abs(a(o[0]));for(let s=1;s=c?(h+2)%c:h+2],_=m[0]*i,A=b[1]*i,d=x[0]*i;s+=(d-_)*Math.sin(A),h++}return s*n}var l=y;et.area=y,et.default=l}),bX=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=tA(),f=eA();function y(P,n={}){let i=0,a=0,l=0;return f.coordEach.call(void 0,P,function(o){i+=o[0],a+=o[1],l++},!0),Y.point.call(void 0,[i/l,a/l],n.properties)}var z=y;et.centroid=y,et.default=z}),wX=It(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Y=eA();function f(z,P={}){if(z.bbox!=null&&P.recompute!==!0)return z.bbox;let n=[1/0,1/0,-1/0,-1/0];return Y.coordEach.call(void 0,z,i=>{n[0]>i[0]&&(n[0]=i[0]),n[1]>i[1]&&(n[1]=i[1]),n[2]{var f=Br(),y=_X(),{area:z}=xX(),{centroid:P}=bX(),{bbox:n}=wX(),i=T_(),a=es(),l=Cn(),o=_i(),c=Ag(),s=Object.keys(y),h={"ISO-3":i,"USA-states":i,"country names":m};function m(D){for(var E=0;E0&&U[V+1][0]<0)return V;return null}switch(M==="RUS"||M==="FJI"?g=function(U){var V;if(B(U)===null)V=U;else for(V=new Array(U.length),N=0;NV?W[F++]=[U[N][0]+360,U[N][1]]:N===V?(W[F++]=U[N],W[F++]=[U[N][0],-90]):W[F++]=U[N];var H=c.tester(W);H.pts.pop(),p.push(H)}:g=function(U){p.push(c.tester(U))},E.type){case"MultiPolygon":for(C=0;C0?H.properties.ct=d(H):H.properties.ct=[NaN,NaN],W.fIn=U,W.fOut=H,p.push(H)}else a.log(["Location",W.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete M[V]}switch(I.type){case"FeatureCollection":var N=I.features;for(g=0;gp&&(p=S,I=C)}else I=E;return P(I).geometry.coordinates}function k(D){var E=window.PlotlyGeoAssets||{},I=[];function M(N){return new Promise(function(B,U){f.json(N,function(V,W){if(V){delete E[N];var F=V.status===404?'GeoJSON at URL "'+N+'" does not exist.':"Unexpected error while fetching from "+N;return U(new Error(F))}return E[N]=W,B(W)})})}function p(N){return new Promise(function(B,U){var V=0,W=setInterval(function(){if(E[N]&&E[N]!=="pending")return clearInterval(W),B(E[N]);if(V>100)return clearInterval(W),U("Unexpected error while fetching from "+N);V++},50)})}for(var g=0;g{var f=Br(),y=Js(),z=Hn(),P=Il(),n=P.stylePoints,i=P.styleText;Y.exports=function(l,o){o&&a(l,o)};function a(l,o){var c=o[0].trace,s=o[0].node3;s.style("opacity",o[0].trace.opacity),n(s,c,l),i(s,c,l),s.selectAll("path.js-line").style("fill","none").each(function(h){var m=f.select(this),b=h.trace,x=b.line||{};m.call(z.stroke,x.color).call(y.dashLine,x.dash||"",x.width||0),b.fill!=="none"&&m.call(z.fill,b.fillcolor)})}}),AD=It((et,Y)=>{var f=Br(),y=jn(),z=QC().getTopojsonFeatures,P=W_(),n=q_(),i=Jm().findExtremes,a=Dr().BADNUM,l=_e().calcMarkerSize,o=Fu(),c=CD();function s(m,b,x){var _=b.layers.frontplot.select(".scatterlayer"),A=y.makeTraceGroups(_,x,"trace scattergeo");function d(k,w){k.lonlat[0]===a&&f.select(w).remove()}A.selectAll("*").remove(),A.each(function(k){var w=f.select(this),D=k[0].trace;if(o.hasLines(D)||D.fill!=="none"){var E=P.calcTraceToLineCoords(k),I=D.fill!=="none"?P.makePolygon(E):P.makeLine(E);w.selectAll("path.js-line").data([{geojson:I,trace:D}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}o.hasMarkers(D)&&w.selectAll("path.point").data(y.identity).enter().append("path").classed("point",!0).each(function(M){d(M,this)}),o.hasText(D)&&w.selectAll("g").data(y.identity).enter().append("g").append("text").each(function(M){d(M,this)}),c(m,k)})}function h(m,b){var x=m[0].trace,_=b[x.geo],A=_._subplot,d=x._length,k,w;if(y.isArrayOrTypedArray(x.locations)){var D=x.locationmode,E=D==="geojson-id"?n.extractTraceFeature(m):z(x,A.topojson);for(k=0;k{var f=hd(),y=Dr().BADNUM,z=qc(),P=jn().fillText,n=Ib();Y.exports=function(a,l,o){var c=a.cd,s=c[0].trace,h=a.xa,m=a.ya,b=a.subplot,x=b.projection.isLonLatOverEdges,_=b.project;function A(M){var p=M.lonlat;if(p[0]===y||x(p))return 1/0;var g=_(p),C=_([l,o]),S=Math.abs(g[0]-C[0]),N=Math.abs(g[1]-C[1]),B=Math.max(3,M.mrc||0);return Math.max(Math.sqrt(S*S+N*N)-B,1-3/B)}if(f.getClosest(c,A,a),a.index!==!1){var d=c[a.index],k=d.lonlat,w=[h.c2p(k),m.c2p(k)],D=d.mrc||1;a.x0=w[0]-D,a.x1=w[0]+D,a.y0=w[1]-D,a.y1=w[1]+D,a.loc=d.loc,a.lon=k[0],a.lat=k[1];var E={};E[s.geo]={_subplot:b};var I=s._module.formatLabels(d,s,E);return a.lonLabel=I.lonLabel,a.latLabel=I.latLabel,a.color=z(s,d),a.extraText=i(s,d,a,c[0].t.labels),a.hovertemplate=s.hovertemplate,[a]}};function i(a,l,o,c){if(a.hovertemplate)return;var s=l.hi||a.hoverinfo,h=s==="all"?n.hoverinfo.flags:s.split("+"),m=h.indexOf("location")!==-1&&Array.isArray(a.locations),b=h.indexOf("lon")!==-1,x=h.indexOf("lat")!==-1,_=h.indexOf("text")!==-1,A=[];function d(k){return k+"°"}return m?A.push(l.loc):b&&x?A.push("("+d(o.latLabel)+", "+d(o.lonLabel)+")"):b?A.push(c.lon+d(o.lonLabel)):x&&A.push(c.lat+d(o.latLabel)),_&&P(l,a,A),A.join("
")}}),TX=It((et,Y)=>{Y.exports=function(f,y,z,P,n){f.lon=y.lon,f.lat=y.lat,f.location=y.loc?y.loc:null;var i=P[n];return i.fIn&&i.fIn.properties&&(f.properties=i.fIn.properties),f}}),SX=It((et,Y)=>{var f=Fu(),y=Dr().BADNUM;Y.exports=function(z,P){var n=z.cd,i=z.xaxis,a=z.yaxis,l=[],o=n[0].trace,c,s,h,m,b,x=!f.hasMarkers(o)&&!f.hasText(o);if(x)return[];if(P===!1)for(b=0;b{(function(f,y){y(typeof et=="object"&&typeof Y<"u"?et:f.d3=f.d3||{})})(et,function(f){function y(it,st){return itst?1:it>=st?0:NaN}function z(it){return it.length===1&&(it=P(it)),{left:function(st,xt,ot,J){for(ot==null&&(ot=0),J==null&&(J=st.length);ot>>1;it(st[mt],xt)<0?ot=mt+1:J=mt}return ot},right:function(st,xt,ot,J){for(ot==null&&(ot=0),J==null&&(J=st.length);ot>>1;it(st[mt],xt)>0?J=mt:ot=mt+1}return ot}}}function P(it){return function(st,xt){return y(it(st),xt)}}var n=z(y),i=n.right,a=n.left;function l(it,st){st==null&&(st=o);for(var xt=0,ot=it.length-1,J=it[0],mt=new Array(ot<0?0:ot);xtit?1:st>=it?0:NaN}function h(it){return it===null?NaN:+it}function m(it,st){var xt=it.length,ot=0,J=-1,mt=0,dt,Ct,Rt=0;if(st==null)for(;++J1)return Rt/(ot-1)}function b(it,st){var xt=m(it,st);return xt&&Math.sqrt(xt)}function x(it,st){var xt=it.length,ot=-1,J,mt,dt;if(st==null){for(;++ot=J)for(mt=dt=J;++otJ&&(mt=J),dt=J)for(mt=dt=J;++otJ&&(mt=J),dt0)return[it];if((ot=st0)for(it=Math.ceil(it/Ct),st=Math.floor(st/Ct),dt=new Array(mt=Math.ceil(st-it+1));++J=0?(mt>=E?10:mt>=I?5:mt>=M?2:1)*Math.pow(10,J):-Math.pow(10,-J)/(mt>=E?10:mt>=I?5:mt>=M?2:1)}function C(it,st,xt){var ot=Math.abs(st-it)/Math.max(0,xt),J=Math.pow(10,Math.floor(Math.log(ot)/Math.LN10)),mt=ot/J;return mt>=E?J*=10:mt>=I?J*=5:mt>=M&&(J*=2),stGt;)ee.pop(),--xe;var ge=new Array(xe+1),ye;for(mt=0;mt<=xe;++mt)ye=ge[mt]=[],ye.x0=mt>0?ee[mt-1]:Zt,ye.x1=mt=1)return+xt(it[ot-1],ot-1,it);var ot,J=(ot-1)*st,mt=Math.floor(J),dt=+xt(it[mt],mt,it),Ct=+xt(it[mt+1],mt+1,it);return dt+(Ct-dt)*(J-mt)}}function U(it,st,xt){return it=d.call(it,h).sort(y),Math.ceil((xt-st)/(2*(B(it,.75)-B(it,.25))*Math.pow(it.length,-1/3)))}function V(it,st,xt){return Math.ceil((xt-st)/(3.5*b(it)*Math.pow(it.length,-1/3)))}function W(it,st){var xt=it.length,ot=-1,J,mt;if(st==null){for(;++ot=J)for(mt=J;++otmt&&(mt=J)}else for(;++ot=J)for(mt=J;++otmt&&(mt=J);return mt}function F(it,st){var xt=it.length,ot=xt,J=-1,mt,dt=0;if(st==null)for(;++J=0;)for(dt=it[st],xt=dt.length;--xt>=0;)mt[--J]=dt[xt];return mt}function G(it,st){var xt=it.length,ot=-1,J,mt;if(st==null){for(;++ot=J)for(mt=J;++otJ&&(mt=J)}else for(;++ot=J)for(mt=J;++otJ&&(mt=J);return mt}function tt(it,st){for(var xt=st.length,ot=new Array(xt);xt--;)ot[xt]=it[st[xt]];return ot}function ht(it,st){if(xt=it.length){var xt,ot=0,J=0,mt,dt=it[J];for(st==null&&(st=y);++ot{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Ek()):(f=f||self,y(f.d3=f.d3||{},f.d3))})(et,function(f,y){function z(){return new P}function P(){this.reset()}P.prototype={constructor:P,reset:function(){this.s=this.t=0},add:function(br){i(n,br,this.t),i(this,n.s,this.s),this.s?this.t+=n.t:this.s=n.t},valueOf:function(){return this.s}};var n=new P;function i(br,Qr,Nn){var An=br.s=Qr+Nn,di=An-Qr,Pi=An-di;br.t=Qr-Pi+(Nn-di)}var a=1e-6,l=1e-12,o=Math.PI,c=o/2,s=o/4,h=o*2,m=180/o,b=o/180,x=Math.abs,_=Math.atan,A=Math.atan2,d=Math.cos,k=Math.ceil,w=Math.exp,D=Math.log,E=Math.pow,I=Math.sin,M=Math.sign||function(br){return br>0?1:br<0?-1:0},p=Math.sqrt,g=Math.tan;function C(br){return br>1?0:br<-1?o:Math.acos(br)}function S(br){return br>1?c:br<-1?-c:Math.asin(br)}function N(br){return(br=I(br/2))*br}function B(){}function U(br,Qr){br&&W.hasOwnProperty(br.type)&&W[br.type](br,Qr)}var V={Feature:function(br,Qr){U(br.geometry,Qr)},FeatureCollection:function(br,Qr){for(var Nn=br.features,An=-1,di=Nn.length;++An=0?1:-1,di=An*Nn,Pi=d(Qr),ga=I(Qr),Pa=rt*ga,Qa=ut*Pi+Pa*d(di),uo=Pa*An*I(di);G.add(A(uo,Qa)),vt=br,ut=Pi,rt=ga}function J(br){return tt.reset(),q(br,gt),tt*2}function mt(br){return[A(br[1],br[0]),S(br[2])]}function dt(br){var Qr=br[0],Nn=br[1],An=d(Nn);return[An*d(Qr),An*I(Qr),I(Nn)]}function Ct(br,Qr){return br[0]*Qr[0]+br[1]*Qr[1]+br[2]*Qr[2]}function Rt(br,Qr){return[br[1]*Qr[2]-br[2]*Qr[1],br[2]*Qr[0]-br[0]*Qr[2],br[0]*Qr[1]-br[1]*Qr[0]]}function Bt(br,Qr){br[0]+=Qr[0],br[1]+=Qr[1],br[2]+=Qr[2]}function Zt(br,Qr){return[br[0]*Qr,br[1]*Qr,br[2]*Qr]}function Gt(br){var Qr=p(br[0]*br[0]+br[1]*br[1]+br[2]*br[2]);br[0]/=Qr,br[1]/=Qr,br[2]/=Qr}var ee,xe,ge,ye,ue,Mt,Ot,Lt,ie=z(),be,ce,Le={point:Ze,lineStart:mr,lineEnd:fr,polygonStart:function(){Le.point=Jr,Le.lineStart=an,Le.lineEnd=Er,ie.reset(),gt.polygonStart()},polygonEnd:function(){gt.polygonEnd(),Le.point=Ze,Le.lineStart=mr,Le.lineEnd=fr,G<0?(ee=-(ge=180),xe=-(ye=90)):ie>a?ye=90:ie<-a&&(xe=-90),ce[0]=ee,ce[1]=ge},sphere:function(){ee=-(ge=180),xe=-(ye=90)}};function Ze(br,Qr){be.push(ce=[ee=br,ge=br]),Qrye&&(ye=Qr)}function Qe(br,Qr){var Nn=dt([br*b,Qr*b]);if(Lt){var An=Rt(Lt,Nn),di=[An[1],-An[0],0],Pi=Rt(di,An);Gt(Pi),Pi=mt(Pi);var ga=br-ue,Pa=ga>0?1:-1,Qa=Pi[0]*m*Pa,uo,Sa=x(ga)>180;Sa^(Pa*ueye&&(ye=uo)):(Qa=(Qa+360)%360-180,Sa^(Pa*ueye&&(ye=Qr))),Sa?brdn(ee,ge)&&(ge=br):dn(br,ge)>dn(ee,ge)&&(ee=br):ge>=ee?(brge&&(ge=br)):br>ue?dn(ee,br)>dn(ee,ge)&&(ge=br):dn(br,ge)>dn(ee,ge)&&(ee=br)}else be.push(ce=[ee=br,ge=br]);Qrye&&(ye=Qr),Lt=Nn,ue=br}function mr(){Le.point=Qe}function fr(){ce[0]=ee,ce[1]=ge,Le.point=Ze,Lt=null}function Jr(br,Qr){if(Lt){var Nn=br-ue;ie.add(x(Nn)>180?Nn+(Nn>0?360:-360):Nn)}else Mt=br,Ot=Qr;gt.point(br,Qr),Qe(br,Qr)}function an(){gt.lineStart()}function Er(){Jr(Mt,Ot),gt.lineEnd(),x(ie)>a&&(ee=-(ge=180)),ce[0]=ee,ce[1]=ge,Lt=null}function dn(br,Qr){return(Qr-=br)<0?Qr+360:Qr}function _n(br,Qr){return br[0]-Qr[0]}function Oe(br,Qr){return br[0]<=br[1]?br[0]<=Qr&&Qr<=br[1]:Qrdn(An[0],An[1])&&(An[1]=di[1]),dn(di[0],An[1])>dn(An[0],An[1])&&(An[0]=di[0])):Pi.push(An=di);for(ga=-1/0,Nn=Pi.length-1,Qr=0,An=Pi[Nn];Qr<=Nn;An=di,++Qr)di=Pi[Qr],(Pa=dn(An[1],di[0]))>ga&&(ga=Pa,ee=di[0],ge=An[1])}return be=ce=null,ee===1/0||xe===1/0?[[NaN,NaN],[NaN,NaN]]:[[ee,xe],[ge,ye]]}var oe,zt,_t,Pt,Ht,ae,he,Me,qe,Ye,ur,Rr,zr,xr,pn,ci,ui={sphere:B,point:yi,lineStart:Ci,lineEnd:oa,polygonStart:function(){ui.lineStart=Ke,ui.lineEnd=sr},polygonEnd:function(){ui.lineStart=Ci,ui.lineEnd=oa}};function yi(br,Qr){br*=b,Qr*=b;var Nn=d(Qr);Gi(Nn*d(br),Nn*I(br),I(Qr))}function Gi(br,Qr,Nn){++oe,_t+=(br-_t)/oe,Pt+=(Qr-Pt)/oe,Ht+=(Nn-Ht)/oe}function Ci(){ui.point=fi}function fi(br,Qr){br*=b,Qr*=b;var Nn=d(Qr);xr=Nn*d(br),pn=Nn*I(br),ci=I(Qr),ui.point=ba,Gi(xr,pn,ci)}function ba(br,Qr){br*=b,Qr*=b;var Nn=d(Qr),An=Nn*d(br),di=Nn*I(br),Pi=I(Qr),ga=A(p((ga=pn*Pi-ci*di)*ga+(ga=ci*An-xr*Pi)*ga+(ga=xr*di-pn*An)*ga),xr*An+pn*di+ci*Pi);zt+=ga,ae+=ga*(xr+(xr=An)),he+=ga*(pn+(pn=di)),Me+=ga*(ci+(ci=Pi)),Gi(xr,pn,ci)}function oa(){ui.point=yi}function Ke(){ui.point=vr}function sr(){Ar(Rr,zr),ui.point=yi}function vr(br,Qr){Rr=br,zr=Qr,br*=b,Qr*=b,ui.point=Ar;var Nn=d(Qr);xr=Nn*d(br),pn=Nn*I(br),ci=I(Qr),Gi(xr,pn,ci)}function Ar(br,Qr){br*=b,Qr*=b;var Nn=d(Qr),An=Nn*d(br),di=Nn*I(br),Pi=I(Qr),ga=pn*Pi-ci*di,Pa=ci*An-xr*Pi,Qa=xr*di-pn*An,uo=p(ga*ga+Pa*Pa+Qa*Qa),Sa=S(uo),Za=uo&&-Sa/uo;qe+=Za*ga,Ye+=Za*Pa,ur+=Za*Qa,zt+=Sa,ae+=Sa*(xr+(xr=An)),he+=Sa*(pn+(pn=di)),Me+=Sa*(ci+(ci=Pi)),Gi(xr,pn,ci)}function mn(br){oe=zt=_t=Pt=Ht=ae=he=Me=qe=Ye=ur=0,q(br,ui);var Qr=qe,Nn=Ye,An=ur,di=Qr*Qr+Nn*Nn+An*An;return dio?br+Math.round(-br/h)*h:br,Qr]}Wn.invert=Wn;function Li(br,Qr,Nn){return(br%=h)?Qr||Nn?Un(Zi(br),Ji(Qr,Nn)):Zi(br):Qr||Nn?Ji(Qr,Nn):Wn}function Fi(br){return function(Qr,Nn){return Qr+=br,[Qr>o?Qr-h:Qr<-o?Qr+h:Qr,Nn]}}function Zi(br){var Qr=Fi(br);return Qr.invert=Fi(-br),Qr}function Ji(br,Qr){var Nn=d(br),An=I(br),di=d(Qr),Pi=I(Qr);function ga(Pa,Qa){var uo=d(Qa),Sa=d(Pa)*uo,Za=I(Pa)*uo,Ra=I(Qa),pa=Ra*Nn+Sa*An;return[A(Za*di-pa*Pi,Sa*Nn-Ra*An),S(pa*di+Za*Pi)]}return ga.invert=function(Pa,Qa){var uo=d(Qa),Sa=d(Pa)*uo,Za=I(Pa)*uo,Ra=I(Qa),pa=Ra*di-Za*Pi;return[A(Za*di+Ra*Pi,Sa*Nn+pa*An),S(pa*Nn-Sa*An)]},ga}function ca(br){br=Li(br[0]*b,br[1]*b,br.length>2?br[2]*b:0);function Qr(Nn){return Nn=br(Nn[0]*b,Nn[1]*b),Nn[0]*=m,Nn[1]*=m,Nn}return Qr.invert=function(Nn){return Nn=br.invert(Nn[0]*b,Nn[1]*b),Nn[0]*=m,Nn[1]*=m,Nn},Qr}function Ei(br,Qr,Nn,An,di,Pi){if(Nn){var ga=d(Qr),Pa=I(Qr),Qa=An*Nn;di==null?(di=Qr+An*h,Pi=Qr-Qa/2):(di=Ga(ga,di),Pi=Ga(ga,Pi),(An>0?diPi)&&(di+=An*h));for(var uo,Sa=di;An>0?Sa>Pi:Sa1&&br.push(br.pop().concat(br.shift()))},result:function(){var Nn=br;return br=[],Qr=null,Nn}}}function Re(br,Qr){return x(br[0]-Qr[0])=0;--Pa)di.point((Za=Sa[Pa])[0],Za[1]);else An(Ra.x,Ra.p.x,-1,di);Ra=Ra.p}Ra=Ra.o,Sa=Ra.z,pa=!pa}while(!Ra.v);di.lineEnd()}}}function cn(br){if(Qr=br.length){for(var Qr,Nn=0,An=br[0],di;++Nn=0?1:-1,ec=gc*Vl,vc=ec>o,El=fs*ks;if(Yr.add(A(El*gc*I(ec),os*dl+El*d(ec))),ga+=vc?Vl+gc*h:Vl,vc^pa>=Nn^bo>=Nn){var tu=Rt(dt(Ra),dt(ws));Gt(tu);var $c=Rt(Pi,tu);Gt($c);var bc=(vc^Vl>=0?-1:1)*S($c[2]);(An>bc||An===bc&&(tu[0]||tu[1]))&&(Pa+=vc^Vl>=0?1:-1)}}return(ga<-a||ga0){for(Qa||(di.polygonStart(),Qa=!0),di.lineStart(),dl=0;dl1&&lo&2&&ks.push(ks.pop().concat(ks.shift())),Sa.push(ks.filter(ze))}}return Ra}}function ze(br){return br.length>1}function yr(br,Qr){return((br=br.x)[0]<0?br[1]-c-a:c-br[1])-((Qr=Qr.x)[0]<0?Qr[1]-c-a:c-Qr[1])}var en=bn(function(){return!0},Rn,xi,[-o,-c]);function Rn(br){var Qr=NaN,Nn=NaN,An=NaN,di;return{lineStart:function(){br.lineStart(),di=1},point:function(Pi,ga){var Pa=Pi>0?o:-o,Qa=x(Pi-Qr);x(Qa-o)0?c:-c),br.point(An,Nn),br.lineEnd(),br.lineStart(),br.point(Pa,Nn),br.point(Pi,Nn),di=0):An!==Pa&&Qa>=o&&(x(Qr-An)a?_((I(Qr)*(Pi=d(An))*I(Nn)-I(An)*(di=d(Qr))*I(br))/(di*Pi*ga)):(Qr+An)/2}function xi(br,Qr,Nn,An){var di;if(br==null)di=Nn*c,An.point(-o,di),An.point(0,di),An.point(o,di),An.point(o,0),An.point(o,-di),An.point(0,-di),An.point(-o,-di),An.point(-o,0),An.point(-o,di);else if(x(br[0]-Qr[0])>a){var Pi=br[0]0,di=x(Qr)>a;function Pi(Sa,Za,Ra,pa){Ei(pa,br,Nn,Ra,Sa,Za)}function ga(Sa,Za){return d(Sa)*d(Za)>Qr}function Pa(Sa){var Za,Ra,pa,_o,fs;return{lineStart:function(){_o=pa=!1,fs=1},point:function(os,gs){var ws=[os,gs],bo,lo=ga(os,gs),ks=An?lo?0:uo(os,gs):lo?uo(os+(os<0?o:-o),gs):0;if(!Za&&(_o=pa=lo)&&Sa.lineStart(),lo!==pa&&(bo=Qa(Za,ws),(!bo||Re(Za,bo)||Re(ws,bo))&&(ws[2]=1)),lo!==pa)fs=0,lo?(Sa.lineStart(),bo=Qa(ws,Za),Sa.point(bo[0],bo[1])):(bo=Qa(Za,ws),Sa.point(bo[0],bo[1],2),Sa.lineEnd()),Za=bo;else if(di&&Za&&An^lo){var dl;!(ks&Ra)&&(dl=Qa(ws,Za,!0))&&(fs=0,An?(Sa.lineStart(),Sa.point(dl[0][0],dl[0][1]),Sa.point(dl[1][0],dl[1][1]),Sa.lineEnd()):(Sa.point(dl[1][0],dl[1][1]),Sa.lineEnd(),Sa.lineStart(),Sa.point(dl[0][0],dl[0][1],3)))}lo&&(!Za||!Re(Za,ws))&&Sa.point(ws[0],ws[1]),Za=ws,pa=lo,Ra=ks},lineEnd:function(){pa&&Sa.lineEnd(),Za=null},clean:function(){return fs|(_o&&pa)<<1}}}function Qa(Sa,Za,Ra){var pa=dt(Sa),_o=dt(Za),fs=[1,0,0],os=Rt(pa,_o),gs=Ct(os,os),ws=os[0],bo=gs-ws*ws;if(!bo)return!Ra&&Sa;var lo=Qr*gs/bo,ks=-Qr*ws/bo,dl=Rt(fs,os),Vl=Zt(fs,lo),gc=Zt(os,ks);Bt(Vl,gc);var ec=dl,vc=Ct(Vl,ec),El=Ct(ec,ec),tu=vc*vc-El*(Ct(Vl,Vl)-1);if(!(tu<0)){var $c=p(tu),bc=Zt(ec,(-vc-$c)/El);if(Bt(bc,Vl),bc=mt(bc),!Ra)return bc;var qo=Sa[0],Bs=Za[0],ac=Sa[1],Zl=Za[1],Mu;Bs0^bc[1]<(x(bc[0]-qo)o^(qo<=bc[0]&&bc[0]<=Bs)){var rh=Zt(ec,(-vc+$c)/El);return Bt(rh,Vl),[bc,mt(rh)]}}}function uo(Sa,Za){var Ra=An?br:o-br,pa=0;return Sa<-Ra?pa|=1:Sa>Ra&&(pa|=2),Za<-Ra?pa|=4:Za>Ra&&(pa|=8),pa}return bn(ga,Pa,Pi,An?[0,-br]:[-o,br-o])}function Gn(br,Qr,Nn,An,di,Pi){var ga=br[0],Pa=br[1],Qa=Qr[0],uo=Qr[1],Sa=0,Za=1,Ra=Qa-ga,pa=uo-Pa,_o;if(_o=Nn-ga,!(!Ra&&_o>0)){if(_o/=Ra,Ra<0){if(_o0){if(_o>Za)return;_o>Sa&&(Sa=_o)}if(_o=di-ga,!(!Ra&&_o<0)){if(_o/=Ra,Ra<0){if(_o>Za)return;_o>Sa&&(Sa=_o)}else if(Ra>0){if(_o0)){if(_o/=pa,pa<0){if(_o0){if(_o>Za)return;_o>Sa&&(Sa=_o)}if(_o=Pi-Pa,!(!pa&&_o<0)){if(_o/=pa,pa<0){if(_o>Za)return;_o>Sa&&(Sa=_o)}else if(pa>0){if(_o0&&(br[0]=ga+Sa*Ra,br[1]=Pa+Sa*pa),Za<1&&(Qr[0]=ga+Za*Ra,Qr[1]=Pa+Za*pa),!0}}}}}var pi=1e9,Va=-pi;function ea(br,Qr,Nn,An){function di(uo,Sa){return br<=uo&&uo<=Nn&&Qr<=Sa&&Sa<=An}function Pi(uo,Sa,Za,Ra){var pa=0,_o=0;if(uo==null||(pa=ga(uo,Za))!==(_o=ga(Sa,Za))||Qa(uo,Sa)<0^Za>0)do Ra.point(pa===0||pa===3?br:Nn,pa>1?An:Qr);while((pa=(pa+Za+4)%4)!==_o);else Ra.point(Sa[0],Sa[1])}function ga(uo,Sa){return x(uo[0]-br)0?0:3:x(uo[0]-Nn)0?2:1:x(uo[1]-Qr)0?1:0:Sa>0?3:2}function Pa(uo,Sa){return Qa(uo.x,Sa.x)}function Qa(uo,Sa){var Za=ga(uo,1),Ra=ga(Sa,1);return Za!==Ra?Za-Ra:Za===0?Sa[1]-uo[1]:Za===1?uo[0]-Sa[0]:Za===2?uo[1]-Sa[1]:Sa[0]-uo[0]}return function(uo){var Sa=uo,Za=Fe(),Ra,pa,_o,fs,os,gs,ws,bo,lo,ks,dl,Vl={point:gc,lineStart:tu,lineEnd:$c,polygonStart:vc,polygonEnd:El};function gc(qo,Bs){di(qo,Bs)&&Sa.point(qo,Bs)}function ec(){for(var qo=0,Bs=0,ac=pa.length;BsAn&&(qh-Wh)*(An-rh)>(Wc-rh)*(br-Wh)&&++qo:Wc<=An&&(qh-Wh)*(An-rh)<(Wc-rh)*(br-Wh)&&--qo;return qo}function vc(){Sa=Za,Ra=[],pa=[],dl=!0}function El(){var qo=ec(),Bs=dl&&qo,ac=(Ra=y.merge(Ra)).length;(Bs||ac)&&(uo.polygonStart(),Bs&&(uo.lineStart(),Pi(null,null,1,uo),uo.lineEnd()),ac&&sn(Ra,Pa,qo,Pi,uo),uo.polygonEnd()),Sa=uo,Ra=pa=_o=null}function tu(){Vl.point=bc,pa&&pa.push(_o=[]),ks=!0,lo=!1,ws=bo=NaN}function $c(){Ra&&(bc(fs,os),gs&&lo&&Za.rejoin(),Ra.push(Za.result())),Vl.point=gc,lo&&Sa.lineEnd()}function bc(qo,Bs){var ac=di(qo,Bs);if(pa&&_o.push([qo,Bs]),ks)fs=qo,os=Bs,gs=ac,ks=!1,ac&&(Sa.lineStart(),Sa.point(qo,Bs));else if(ac&&lo)Sa.point(qo,Bs);else{var Zl=[ws=Math.max(Va,Math.min(pi,ws)),bo=Math.max(Va,Math.min(pi,bo))],Mu=[qo=Math.max(Va,Math.min(pi,qo)),Bs=Math.max(Va,Math.min(pi,Bs))];Gn(Zl,Mu,br,Qr,Nn,An)?(lo||(Sa.lineStart(),Sa.point(Zl[0],Zl[1])),Sa.point(Mu[0],Mu[1]),ac||Sa.lineEnd(),dl=!1):ac&&(Sa.lineStart(),Sa.point(qo,Bs),dl=!1)}ws=qo,bo=Bs,lo=ac}return Vl}}function go(){var br=0,Qr=0,Nn=960,An=500,di,Pi,ga;return ga={stream:function(Pa){return di&&Pi===Pa?di:di=ea(br,Qr,Nn,An)(Pi=Pa)},extent:function(Pa){return arguments.length?(br=+Pa[0][0],Qr=+Pa[0][1],Nn=+Pa[1][0],An=+Pa[1][1],di=Pi=null,ga):[[br,Qr],[Nn,An]]}}}var mo=z(),Go,Po,Zo,Ka={sphere:B,point:B,lineStart:Cs,lineEnd:B,polygonStart:B,polygonEnd:B};function Cs(){Ka.point=wl,Ka.lineEnd=ps}function ps(){Ka.point=Ka.lineEnd=B}function wl(br,Qr){br*=b,Qr*=b,Go=br,Po=I(Qr),Zo=d(Qr),Ka.point=is}function is(br,Qr){br*=b,Qr*=b;var Nn=I(Qr),An=d(Qr),di=x(br-Go),Pi=d(di),ga=I(di),Pa=An*ga,Qa=Zo*Nn-Po*An*Pi,uo=Po*Nn+Zo*An*Pi;mo.add(A(p(Pa*Pa+Qa*Qa),uo)),Go=br,Po=Nn,Zo=An}function ol(br){return mo.reset(),q(br,Ka),+mo}var ms=[null,null],kl={type:"LineString",coordinates:ms};function ul(br,Qr){return ms[0]=br,ms[1]=Qr,ol(kl)}var Kl={Feature:function(br,Qr){return Ns(br.geometry,Qr)},FeatureCollection:function(br,Qr){for(var Nn=br.features,An=-1,di=Nn.length;++An0&&(di=ul(br[Pi],br[Pi-1]),di>0&&Nn<=di&&An<=di&&(Nn+An-di)*(1-Math.pow((Nn-An)/di,2))a}).map(Ra)).concat(y.range(k(Pi/uo)*uo,di,uo).filter(function(bo){return x(bo%Za)>a}).map(pa))}return gs.lines=function(){return ws().map(function(bo){return{type:"LineString",coordinates:bo}})},gs.outline=function(){return{type:"Polygon",coordinates:[_o(An).concat(fs(ga).slice(1),_o(Nn).reverse().slice(1),fs(Pa).reverse().slice(1))]}},gs.extent=function(bo){return arguments.length?gs.extentMajor(bo).extentMinor(bo):gs.extentMinor()},gs.extentMajor=function(bo){return arguments.length?(An=+bo[0][0],Nn=+bo[1][0],Pa=+bo[0][1],ga=+bo[1][1],An>Nn&&(bo=An,An=Nn,Nn=bo),Pa>ga&&(bo=Pa,Pa=ga,ga=bo),gs.precision(os)):[[An,Pa],[Nn,ga]]},gs.extentMinor=function(bo){return arguments.length?(Qr=+bo[0][0],br=+bo[1][0],Pi=+bo[0][1],di=+bo[1][1],Qr>br&&(bo=Qr,Qr=br,br=bo),Pi>di&&(bo=Pi,Pi=di,di=bo),gs.precision(os)):[[Qr,Pi],[br,di]]},gs.step=function(bo){return arguments.length?gs.stepMajor(bo).stepMinor(bo):gs.stepMinor()},gs.stepMajor=function(bo){return arguments.length?(Sa=+bo[0],Za=+bo[1],gs):[Sa,Za]},gs.stepMinor=function(bo){return arguments.length?(Qa=+bo[0],uo=+bo[1],gs):[Qa,uo]},gs.precision=function(bo){return arguments.length?(os=+bo,Ra=Wa(Pi,di,90),pa=Co(Qr,br,os),_o=Wa(Pa,ga,90),fs=Co(An,Nn,os),gs):os},gs.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function lc(){return el()()}function ss(br,Qr){var Nn=br[0]*b,An=br[1]*b,di=Qr[0]*b,Pi=Qr[1]*b,ga=d(An),Pa=I(An),Qa=d(Pi),uo=I(Pi),Sa=ga*d(Nn),Za=ga*I(Nn),Ra=Qa*d(di),pa=Qa*I(di),_o=2*S(p(N(Pi-An)+ga*Qa*N(di-Nn))),fs=I(_o),os=_o?function(gs){var ws=I(gs*=_o)/fs,bo=I(_o-gs)/fs,lo=bo*Sa+ws*Ra,ks=bo*Za+ws*pa,dl=bo*Pa+ws*uo;return[A(ks,lo)*m,A(dl,p(lo*lo+ks*ks))*m]}:function(){return[Nn*m,An*m]};return os.distance=_o,os}function nc(br){return br}var yl=z(),$l=z(),Gc,ko,zs,js,mc={point:B,lineStart:B,lineEnd:B,polygonStart:function(){mc.lineStart=Tl,mc.lineEnd=iu},polygonEnd:function(){mc.lineStart=mc.lineEnd=mc.point=B,yl.add(x($l)),$l.reset()},result:function(){var br=yl/2;return yl.reset(),br}};function Tl(){mc.point=us}function us(br,Qr){mc.point=Rc,Gc=zs=br,ko=js=Qr}function Rc(br,Qr){$l.add(js*br-zs*Qr),zs=br,js=Qr}function iu(){Rc(Gc,ko)}var Dl=1/0,ql=Dl,cc=-Dl,dc=cc,pu={point:Ah,lineStart:B,lineEnd:B,polygonStart:B,polygonEnd:B,result:function(){var br=[[Dl,ql],[cc,dc]];return cc=dc=-(ql=Dl=1/0),br}};function Ah(br,Qr){brcc&&(cc=br),Qrdc&&(dc=Qr)}var uh=0,yh=0,tf=0,Nd=0,Gl=0,Yu=0,ef=0,xu=0,mu=0,bu,_h,_c,gu,pl={point:ic,lineStart:jh,lineEnd:Lc,polygonStart:function(){pl.lineStart=Xf,pl.lineEnd=hl},polygonEnd:function(){pl.point=ic,pl.lineStart=jh,pl.lineEnd=Lc},result:function(){var br=mu?[ef/mu,xu/mu]:Yu?[Nd/Yu,Gl/Yu]:tf?[uh/tf,yh/tf]:[NaN,NaN];return uh=yh=tf=Nd=Gl=Yu=ef=xu=mu=0,br}};function ic(br,Qr){uh+=br,yh+=Qr,++tf}function jh(){pl.point=Hu}function Hu(br,Qr){pl.point=Qh,ic(_c=br,gu=Qr)}function Qh(br,Qr){var Nn=br-_c,An=Qr-gu,di=p(Nn*Nn+An*An);Nd+=di*(_c+br)/2,Gl+=di*(gu+Qr)/2,Yu+=di,ic(_c=br,gu=Qr)}function Lc(){pl.point=ic}function Xf(){pl.point=pp}function hl(){Hl(bu,_h)}function pp(br,Qr){pl.point=Hl,ic(bu=_c=br,_h=gu=Qr)}function Hl(br,Qr){var Nn=br-_c,An=Qr-gu,di=p(Nn*Nn+An*An);Nd+=di*(_c+br)/2,Gl+=di*(gu+Qr)/2,Yu+=di,di=gu*br-_c*Qr,ef+=di*(_c+br),xu+=di*(gu+Qr),mu+=di*3,ic(_c=br,gu=Qr)}function cs(br){this._context=br}cs.prototype={_radius:4.5,pointRadius:function(br){return this._radius=br,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(br,Qr){switch(this._point){case 0:{this._context.moveTo(br,Qr),this._point=1;break}case 1:{this._context.lineTo(br,Qr);break}default:{this._context.moveTo(br+this._radius,Qr),this._context.arc(br,Qr,this._radius,0,h);break}}},result:B};var _d=z(),xh,hu,rf,td,Ed,vu={point:B,lineStart:function(){vu.point=Lf},lineEnd:function(){xh&&hf(hu,rf),vu.point=B},polygonStart:function(){xh=!0},polygonEnd:function(){xh=null},result:function(){var br=+_d;return _d.reset(),br}};function Lf(br,Qr){vu.point=hf,hu=td=br,rf=Ed=Qr}function hf(br,Qr){td-=br,Ed-=Qr,_d.add(p(td*td+Ed*Ed)),td=br,Ed=Qr}function Ld(){this._string=[]}Ld.prototype={_radius:4.5,_circle:ed(4.5),pointRadius:function(br){return(br=+br)!==this._radius&&(this._radius=br,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(br,Qr){switch(this._point){case 0:{this._string.push("M",br,",",Qr),this._point=1;break}case 1:{this._string.push("L",br,",",Qr);break}default:{this._circle==null&&(this._circle=ed(this._radius)),this._string.push("M",br,",",Qr,this._circle);break}}},result:function(){if(this._string.length){var br=this._string.join("");return this._string=[],br}else return null}};function ed(br){return"m0,"+br+"a"+br+","+br+" 0 1,1 0,"+-2*br+"a"+br+","+br+" 0 1,1 0,"+2*br+"z"}function nf(br,Qr){var Nn=4.5,An,di;function Pi(ga){return ga&&(typeof Nn=="function"&&di.pointRadius(+Nn.apply(this,arguments)),q(ga,An(di))),di.result()}return Pi.area=function(ga){return q(ga,An(mc)),mc.result()},Pi.measure=function(ga){return q(ga,An(vu)),vu.result()},Pi.bounds=function(ga){return q(ga,An(pu)),pu.result()},Pi.centroid=function(ga){return q(ga,An(pl)),pl.result()},Pi.projection=function(ga){return arguments.length?(An=ga==null?(br=null,nc):(br=ga).stream,Pi):br},Pi.context=function(ga){return arguments.length?(di=ga==null?(Qr=null,new Ld):new cs(Qr=ga),typeof Nn!="function"&&di.pointRadius(Nn),Pi):Qr},Pi.pointRadius=function(ga){return arguments.length?(Nn=typeof ga=="function"?ga:(di.pointRadius(+ga),+ga),Pi):Nn},Pi.projection(br).context(Qr)}function af(br){return{stream:bh(br)}}function bh(br){return function(Qr){var Nn=new df;for(var An in br)Nn[An]=br[An];return Nn.stream=Qr,Nn}}function df(){}df.prototype={constructor:df,point:function(br,Qr){this.stream.point(br,Qr)},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()}};function Uh(br,Qr,Nn){var An=br.clipExtent&&br.clipExtent();return br.scale(150).translate([0,0]),An!=null&&br.clipExtent(null),q(Nn,br.stream(pu)),Qr(pu.result()),An!=null&&br.clipExtent(An),br}function Mh(br,Qr,Nn){return Uh(br,function(An){var di=Qr[1][0]-Qr[0][0],Pi=Qr[1][1]-Qr[0][1],ga=Math.min(di/(An[1][0]-An[0][0]),Pi/(An[1][1]-An[0][1])),Pa=+Qr[0][0]+(di-ga*(An[1][0]+An[0][0]))/2,Qa=+Qr[0][1]+(Pi-ga*(An[1][1]+An[0][1]))/2;br.scale(150*ga).translate([Pa,Qa])},Nn)}function yu(br,Qr,Nn){return Mh(br,[[0,0],Qr],Nn)}function fd(br,Qr,Nn){return Uh(br,function(An){var di=+Qr,Pi=di/(An[1][0]-An[0][0]),ga=(di-Pi*(An[1][0]+An[0][0]))/2,Pa=-Pi*An[0][1];br.scale(150*Pi).translate([ga,Pa])},Nn)}function of(br,Qr,Nn){return Uh(br,function(An){var di=+Qr,Pi=di/(An[1][1]-An[0][1]),ga=-Pi*An[0][0],Pa=(di-Pi*(An[1][1]+An[0][1]))/2;br.scale(150*Pi).translate([ga,Pa])},Nn)}var uc=16,jd=d(30*b);function Jf(br,Qr){return+Qr?Pd(br,Qr):ff(br)}function ff(br){return bh({point:function(Qr,Nn){Qr=br(Qr,Nn),this.stream.point(Qr[0],Qr[1])}})}function Pd(br,Qr){function Nn(An,di,Pi,ga,Pa,Qa,uo,Sa,Za,Ra,pa,_o,fs,os){var gs=uo-An,ws=Sa-di,bo=gs*gs+ws*ws;if(bo>4*Qr&&fs--){var lo=ga+Ra,ks=Pa+pa,dl=Qa+_o,Vl=p(lo*lo+ks*ks+dl*dl),gc=S(dl/=Vl),ec=x(x(dl)-1)Qr||x((gs*$c+ws*bc)/bo-.5)>.3||ga*Ra+Pa*pa+Qa*_o2?qo[2]%360*b:0,$c()):[Pa*m,Qa*m,uo*m]},El.angle=function(qo){return arguments.length?(Za=qo%360*b,$c()):Za*m},El.reflectX=function(qo){return arguments.length?(Ra=qo?-1:1,$c()):Ra<0},El.reflectY=function(qo){return arguments.length?(pa=qo?-1:1,$c()):pa<0},El.precision=function(qo){return arguments.length?(dl=Jf(Vl,ks=qo*qo),bc()):p(ks)},El.fitExtent=function(qo,Bs){return Mh(El,qo,Bs)},El.fitSize=function(qo,Bs){return yu(El,qo,Bs)},El.fitWidth=function(qo,Bs){return fd(El,qo,Bs)},El.fitHeight=function(qo,Bs){return of(El,qo,Bs)};function $c(){var qo=Vc(Nn,0,0,Ra,pa,Za).apply(null,Qr(Pi,ga)),Bs=(Za?Vc:mf)(Nn,An-qo[0],di-qo[1],Ra,pa,Za);return Sa=Li(Pa,Qa,uo),Vl=Un(Qr,Bs),gc=Un(Sa,Vl),dl=Jf(Vl,ks),bc()}function bc(){return ec=vc=null,El}return function(){return Qr=br.apply(this,arguments),El.invert=Qr.invert&&tu,$c()}}function xc(br){var Qr=0,Nn=o/3,An=rd(br),di=An(Qr,Nn);return di.parallels=function(Pi){return arguments.length?An(Qr=Pi[0]*b,Nn=Pi[1]*b):[Qr*m,Nn*m]},di}function $h(br){var Qr=d(br);function Nn(An,di){return[An*Qr,I(di)/Qr]}return Nn.invert=function(An,di){return[An/Qr,S(di*Qr)]},Nn}function ju(br,Qr){var Nn=I(br),An=(Nn+I(Qr))/2;if(x(An)=.12&&os<.234&&fs>=-.425&&fs<-.214?di:os>=.166&&os<.234&&fs>=-.214&&fs<-.115?ga:Nn).invert(Ra)},Sa.stream=function(Ra){return br&&Qr===Ra?br:br=xd([Nn.stream(Qr=Ra),di.stream(Ra),ga.stream(Ra)])},Sa.precision=function(Ra){return arguments.length?(Nn.precision(Ra),di.precision(Ra),ga.precision(Ra),Za()):Nn.precision()},Sa.scale=function(Ra){return arguments.length?(Nn.scale(Ra),di.scale(Ra*.35),ga.scale(Ra),Sa.translate(Nn.translate())):Nn.scale()},Sa.translate=function(Ra){if(!arguments.length)return Nn.translate();var pa=Nn.scale(),_o=+Ra[0],fs=+Ra[1];return An=Nn.translate(Ra).clipExtent([[_o-.455*pa,fs-.238*pa],[_o+.455*pa,fs+.238*pa]]).stream(uo),Pi=di.translate([_o-.307*pa,fs+.201*pa]).clipExtent([[_o-.425*pa+a,fs+.12*pa+a],[_o-.214*pa-a,fs+.234*pa-a]]).stream(uo),Pa=ga.translate([_o-.205*pa,fs+.212*pa]).clipExtent([[_o-.214*pa+a,fs+.166*pa+a],[_o-.115*pa-a,fs+.234*pa-a]]).stream(uo),Za()},Sa.fitExtent=function(Ra,pa){return Mh(Sa,Ra,pa)},Sa.fitSize=function(Ra,pa){return yu(Sa,Ra,pa)},Sa.fitWidth=function(Ra,pa){return fd(Sa,Ra,pa)},Sa.fitHeight=function(Ra,pa){return of(Sa,Ra,pa)};function Za(){return br=Qr=null,Sa}return Sa.scale(1070)}function nd(br){return function(Qr,Nn){var An=d(Qr),di=d(Nn),Pi=br(An*di);return[Pi*di*I(Qr),Pi*I(Nn)]}}function Ud(br){return function(Qr,Nn){var An=p(Qr*Qr+Nn*Nn),di=br(An),Pi=I(di),ga=d(di);return[A(Qr*Pi,An*ga),S(An&&Nn*Pi/An)]}}var Qf=nd(function(br){return p(2/(1+br))});Qf.invert=Ud(function(br){return 2*S(br/2)});function Ap(){return Ju(Qf).scale(124.75).clipAngle(180-.001)}var bd=nd(function(br){return(br=C(br))&&br/I(br)});bd.invert=Ud(function(br){return br});function $d(){return Ju(bd).scale(79.4188).clipAngle(180-.001)}function zu(br,Qr){return[br,D(g((c+Qr)/2))]}zu.invert=function(br,Qr){return[br,2*_(w(Qr))-c]};function wd(){return hh(zu).scale(961/h)}function hh(br){var Qr=Ju(br),Nn=Qr.center,An=Qr.scale,di=Qr.translate,Pi=Qr.clipExtent,ga=null,Pa,Qa,uo;Qr.scale=function(Za){return arguments.length?(An(Za),Sa()):An()},Qr.translate=function(Za){return arguments.length?(di(Za),Sa()):di()},Qr.center=function(Za){return arguments.length?(Nn(Za),Sa()):Nn()},Qr.clipExtent=function(Za){return arguments.length?(Za==null?ga=Pa=Qa=uo=null:(ga=+Za[0][0],Pa=+Za[0][1],Qa=+Za[1][0],uo=+Za[1][1]),Sa()):ga==null?null:[[ga,Pa],[Qa,uo]]};function Sa(){var Za=o*An(),Ra=Qr(ca(Qr.rotate()).invert([0,0]));return Pi(ga==null?[[Ra[0]-Za,Ra[1]-Za],[Ra[0]+Za,Ra[1]+Za]]:br===zu?[[Math.max(Ra[0]-Za,ga),Pa],[Math.min(Ra[0]+Za,Qa),uo]]:[[ga,Math.max(Ra[1]-Za,Pa)],[Qa,Math.min(Ra[1]+Za,uo)]])}return Sa()}function kd(br){return g((c+br)/2)}function Hd(br,Qr){var Nn=d(br),An=br===Qr?I(br):D(Nn/d(Qr))/D(kd(Qr)/kd(br)),di=Nn*E(kd(br),An)/An;if(!An)return zu;function Pi(ga,Pa){di>0?Pa<-c+a&&(Pa=-c+a):Pa>c-a&&(Pa=c-a);var Qa=di/E(kd(Pa),An);return[Qa*I(An*ga),di-Qa*d(An*ga)]}return Pi.invert=function(ga,Pa){var Qa=di-Pa,uo=M(An)*p(ga*ga+Qa*Qa),Sa=A(ga,x(Qa))*M(Qa);return Qa*An<0&&(Sa-=o*M(ga)*M(Qa)),[Sa/An,2*_(E(di/uo,1/An))-c]},Pi}function Lh(){return xc(Hd).scale(109.5).parallels([30,30])}function Ic(br,Qr){return[br,Qr]}Ic.invert=Ic;function Hh(){return Ju(Ic).scale(152.63)}function th(br,Qr){var Nn=d(br),An=br===Qr?I(br):(Nn-d(Qr))/(Qr-br),di=Nn/An+br;if(x(An)a&&--An>0);return[br/(.8707+(Pi=Nn*Nn)*(-.131979+Pi*(-.013791+Pi*Pi*Pi*(.003971-.001529*Pi)))),Nn]};function Ph(){return Ju(Vh).scale(175.295)}function Zc(br,Qr){return[d(Qr)*I(br),I(Qr)]}Zc.invert=Ud(S);function fc(){return Ju(Zc).scale(249.5).clipAngle(90+a)}function Ih(br,Qr){var Nn=d(Qr),An=1+d(br)*Nn;return[Nn*I(br)/An,I(Qr)/An]}Ih.invert=Ud(function(br){return 2*_(br)});function Td(){return Ju(Ih).scale(250).clipAngle(142)}function Dh(br,Qr){return[D(g((c+Qr)/2)),-br]}Dh.invert=function(br,Qr){return[-Qr,2*_(w(br))-c]};function sf(){var br=hh(Dh),Qr=br.center,Nn=br.rotate;return br.center=function(An){return arguments.length?Qr([-An[1],An[0]]):(An=Qr(),[An[1],-An[0]])},br.rotate=function(An){return arguments.length?Nn([An[0],An[1],An.length>2?An[2]+90:90]):(An=Nn(),[An[0],An[1],An[2]-90])},Nn([0,0,90]).scale(159.155)}f.geoAlbers=Pc,f.geoAlbersUsa=Eh,f.geoArea=J,f.geoAzimuthalEqualArea=Ap,f.geoAzimuthalEqualAreaRaw=Qf,f.geoAzimuthalEquidistant=$d,f.geoAzimuthalEquidistantRaw=bd,f.geoBounds=Xt,f.geoCentroid=mn,f.geoCircle=so,f.geoClipAntimeridian=en,f.geoClipCircle=Jn,f.geoClipExtent=go,f.geoClipRectangle=ea,f.geoConicConformal=Lh,f.geoConicConformalRaw=Hd,f.geoConicEqualArea=Qu,f.geoConicEqualAreaRaw=ju,f.geoConicEquidistant=Pf,f.geoConicEquidistantRaw=th,f.geoContains=Xs,f.geoDistance=ul,f.geoEqualEarth=tp,f.geoEqualEarthRaw=Dd,f.geoEquirectangular=Hh,f.geoEquirectangularRaw=Ic,f.geoGnomonic=gf,f.geoGnomonicRaw=Au,f.geoGraticule=el,f.geoGraticule10=lc,f.geoIdentity=fh,f.geoInterpolate=ss,f.geoLength=ol,f.geoMercator=wd,f.geoMercatorRaw=zu,f.geoNaturalEarth1=Ph,f.geoNaturalEarth1Raw=Vh,f.geoOrthographic=fc,f.geoOrthographicRaw=Zc,f.geoPath=nf,f.geoProjection=Ju,f.geoProjectionMutator=rd,f.geoRotation=ca,f.geoStereographic=Td,f.geoStereographicRaw=Ih,f.geoStream=q,f.geoTransform=af,f.geoTransverseMercator=sf,f.geoTransverseMercatorRaw=Dh,Object.defineProperty(f,"__esModule",{value:!0})})}),CX=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,MD(),Ek()):y(f.d3=f.d3||{},f.d3,f.d3)})(et,function(f,y,z){var P=Math.abs,n=Math.atan,i=Math.atan2,a=Math.cos,l=Math.exp,o=Math.floor,c=Math.log,s=Math.max,h=Math.min,m=Math.pow,b=Math.round,x=Math.sign||function(te){return te>0?1:te<0?-1:0},_=Math.sin,A=Math.tan,d=1e-6,k=1e-12,w=Math.PI,D=w/2,E=w/4,I=Math.SQRT1_2,M=V(2),p=V(w),g=w*2,C=180/w,S=w/180;function N(te){return te?te/Math.sin(te):1}function B(te){return te>1?D:te<-1?-D:Math.asin(te)}function U(te){return te>1?0:te<-1?w:Math.acos(te)}function V(te){return te>0?Math.sqrt(te):0}function W(te){return te=l(2*te),(te-1)/(te+1)}function F(te){return(l(te)-l(-te))/2}function H(te){return(l(te)+l(-te))/2}function q(te){return c(te+V(te*te+1))}function G(te){return c(te+V(te*te-1))}function tt(te){var le=A(te/2),Te=2*c(a(te/2))/(le*le);function Pe(We,Ne){var Xe=a(We),Pr=a(Ne),qr=_(Ne),Xr=Pr*Xe,gn=-((1-Xr?c((1+Xr)/2)/(1-Xr):-.5)+Te/(1+Xr));return[gn*Pr*_(We),gn*qr]}return Pe.invert=function(We,Ne){var Xe=V(We*We+Ne*Ne),Pr=-te/2,qr=50,Xr;if(!Xe)return[0,0];do{var gn=Pr/2,zn=a(gn),Qn=_(gn),ai=Qn/zn,Ti=-c(P(zn));Pr-=Xr=(2/ai*Ti-Te*ai-Xe)/(-Ti/(Qn*Qn)+1-Te/(2*zn*zn))*(zn<0?.7:1)}while(P(Xr)>d&&--qr>0);var Qi=_(Pr);return[i(We*Qi,Xe*a(Pr)),B(Ne*Qi/Xe)]},Pe}function ht(){var te=D,le=y.geoProjectionMutator(tt),Te=le(te);return Te.radius=function(Pe){return arguments.length?le(te=Pe*S):te*C},Te.scale(179.976).clipAngle(147)}function bt(te,le){var Te=a(le),Pe=N(U(Te*a(te/=2)));return[2*Te*_(te)*Pe,_(le)*Pe]}bt.invert=function(te,le){if(!(te*te+4*le*le>w*w+d)){var Te=te,Pe=le,We=25;do{var Ne=_(Te),Xe=_(Te/2),Pr=a(Te/2),qr=_(Pe),Xr=a(Pe),gn=_(2*Pe),zn=qr*qr,Qn=Xr*Xr,ai=Xe*Xe,Ti=1-Qn*Pr*Pr,Qi=Ti?U(Xr*Pr)*V(Ma=1/Ti):Ma=0,Ma,Aa=2*Qi*Xr*Xe-te,Fa=Qi*qr-le,wo=Ma*(Qn*ai+Qi*Xr*Pr*zn),Yo=Ma*(.5*Ne*gn-Qi*2*qr*Xe),Fo=Ma*.25*(gn*Xe-Qi*qr*Qn*Ne),xs=Ma*(zn*Pr+Qi*ai*Xr),Sl=Yo*Fo-xs*wo;if(!Sl)break;var Ll=(Fa*Yo-Aa*xs)/Sl,Ws=(Aa*Fo-Fa*wo)/Sl;Te-=Ll,Pe-=Ws}while((P(Ll)>d||P(Ws)>d)&&--We>0);return[Te,Pe]}};function vt(){return y.geoProjection(bt).scale(152.63)}function ut(te){var le=_(te),Te=a(te),Pe=te>=0?1:-1,We=A(Pe*te),Ne=(1+le-Te)/2;function Xe(Pr,qr){var Xr=a(qr),gn=a(Pr/=2);return[(1+Xr)*_(Pr),(Pe*qr>-i(gn,We)-.001?0:-Pe*10)+Ne+_(qr)*Te-(1+Xr)*le*gn]}return Xe.invert=function(Pr,qr){var Xr=0,gn=0,zn=50;do{var Qn=a(Xr),ai=_(Xr),Ti=a(gn),Qi=_(gn),Ma=1+Ti,Aa=Ma*ai-Pr,Fa=Ne+Qi*Te-Ma*le*Qn-qr,wo=Ma*Qn/2,Yo=-ai*Qi,Fo=le*Ma*ai/2,xs=Te*Ti+le*Qn*Qi,Sl=Yo*Fo-xs*wo,Ll=(Fa*Yo-Aa*xs)/Sl/2,Ws=(Aa*Fo-Fa*wo)/Sl;P(Ws)>2&&(Ws/=2),Xr-=Ll,gn-=Ws}while((P(Ll)>d||P(Ws)>d)&&--zn>0);return Pe*gn>-i(a(Xr),We)-.001?[Xr*2,gn]:null},Xe}function rt(){var te=20*S,le=te>=0?1:-1,Te=A(le*te),Pe=y.geoProjectionMutator(ut),We=Pe(te),Ne=We.stream;return We.parallel=function(Xe){return arguments.length?(Te=A((le=(te=Xe*S)>=0?1:-1)*te),Pe(te)):te*C},We.stream=function(Xe){var Pr=We.rotate(),qr=Ne(Xe),Xr=(We.rotate([0,0]),Ne(Xe)),gn=We.precision();return We.rotate(Pr),qr.sphere=function(){Xr.polygonStart(),Xr.lineStart();for(var zn=le*-180;le*zn<180;zn+=le*90)Xr.point(zn,le*90);if(te)for(;le*(zn-=3*le*gn)>=-180;)Xr.point(zn,le*-i(a(zn*S/2),Te)*C);Xr.lineEnd(),Xr.polygonEnd()},qr},We.scale(218.695).center([0,28.0974])}function gt(te,le){var Te=A(le/2),Pe=V(1-Te*Te),We=1+Pe*a(te/=2),Ne=_(te)*Pe/We,Xe=Te/We,Pr=Ne*Ne,qr=Xe*Xe;return[4/3*Ne*(3+Pr-3*qr),4/3*Xe*(3+3*Pr-qr)]}gt.invert=function(te,le){if(te*=3/8,le*=3/8,!te&&P(le)>1)return null;var Te=te*te,Pe=le*le,We=1+Te+Pe,Ne=V((We-V(We*We-4*le*le))/2),Xe=B(Ne)/3,Pr=Ne?G(P(le/Ne))/3:q(P(te))/3,qr=a(Xe),Xr=H(Pr),gn=Xr*Xr-qr*qr;return[x(te)*2*i(F(Pr)*qr,.25-gn),x(le)*2*i(Xr*_(Xe),.25+gn)]};function it(){return y.geoProjection(gt).scale(66.1603)}var st=V(8),xt=c(1+M);function ot(te,le){var Te=P(le);return Tek&&--Pe>0);return[te/(a(Te)*(st-1/_(Te))),x(le)*Te]};function J(){return y.geoProjection(ot).scale(112.314)}function mt(te){var le=2*w/te;function Te(Pe,We){var Ne=y.geoAzimuthalEquidistantRaw(Pe,We);if(P(Pe)>D){var Xe=i(Ne[1],Ne[0]),Pr=V(Ne[0]*Ne[0]+Ne[1]*Ne[1]),qr=le*b((Xe-D)/le)+D,Xr=i(_(Xe-=qr),2-a(Xe));Xe=qr+B(w/Pr*_(Xr))-Xr,Ne[0]=Pr*a(Xe),Ne[1]=Pr*_(Xe)}return Ne}return Te.invert=function(Pe,We){var Ne=V(Pe*Pe+We*We);if(Ne>D){var Xe=i(We,Pe),Pr=le*b((Xe-D)/le)+D,qr=Xe>Pr?-1:1,Xr=Ne*a(Pr-Xe),gn=1/A(qr*U((Xr-w)/V(w*(w-2*Xr)+Ne*Ne)));Xe=Pr+2*n((gn+qr*V(gn*gn-3))/3),Pe=Ne*a(Xe),We=Ne*_(Xe)}return y.geoAzimuthalEquidistantRaw.invert(Pe,We)},Te}function dt(){var te=5,le=y.geoProjectionMutator(mt),Te=le(te),Pe=Te.stream,We=.01,Ne=-a(We*S),Xe=_(We*S);return Te.lobes=function(Pr){return arguments.length?le(te=+Pr):te},Te.stream=function(Pr){var qr=Te.rotate(),Xr=Pe(Pr),gn=(Te.rotate([0,0]),Pe(Pr));return Te.rotate(qr),Xr.sphere=function(){gn.polygonStart(),gn.lineStart();for(var zn=0,Qn=360/te,ai=2*w/te,Ti=90-180/te,Qi=D;zn0&&P(We)>d);return Pe<0?NaN:Te}function Gt(te,le,Te){return le===void 0&&(le=40),Te===void 0&&(Te=k),function(Pe,We,Ne,Xe){var Pr,qr,Xr;Ne=Ne===void 0?0:+Ne,Xe=Xe===void 0?0:+Xe;for(var gn=0;gnPr){Ne-=qr/=2,Xe-=Xr/=2;continue}Pr=Ti;var Qi=(Ne>0?-1:1)*Te,Ma=(Xe>0?-1:1)*Te,Aa=te(Ne+Qi,Xe),Fa=te(Ne,Xe+Ma),wo=(Aa[0]-zn[0])/Qi,Yo=(Aa[1]-zn[1])/Qi,Fo=(Fa[0]-zn[0])/Ma,xs=(Fa[1]-zn[1])/Ma,Sl=xs*wo-Yo*Fo,Ll=(P(Sl)<.5?.5:1)/Sl;if(qr=(ai*Fo-Qn*xs)*Ll,Xr=(Qn*Yo-ai*wo)*Ll,Ne+=qr,Xe+=Xr,P(qr)0&&(Pr[1]*=1+qr/1.5*Pr[0]*Pr[0]),Pr}return Pe.invert=Gt(Pe),Pe}function xe(){return y.geoProjection(ee()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function ge(te,le){var Te=te*_(le),Pe=30,We;do le-=We=(le+_(le)-Te)/(1+a(le));while(P(We)>d&&--Pe>0);return le/2}function ye(te,le,Te){function Pe(We,Ne){return[te*We*a(Ne=ge(Te,Ne)),le*_(Ne)]}return Pe.invert=function(We,Ne){return Ne=B(Ne/le),[We/(te*a(Ne)),B((2*Ne+_(2*Ne))/Te)]},Pe}var ue=ye(M/D,M,w);function Mt(){return y.geoProjection(ue).scale(169.529)}var Ot=2.00276,Lt=1.11072;function ie(te,le){var Te=ge(w,le);return[Ot*te/(1/a(le)+Lt/a(Te)),(le+M*_(Te))/Ot]}ie.invert=function(te,le){var Te=Ot*le,Pe=le<0?-E:E,We=25,Ne,Xe;do Xe=Te-M*_(Pe),Pe-=Ne=(_(2*Pe)+2*Pe-w*_(Xe))/(2*a(2*Pe)+2+w*a(Xe)*M*a(Pe));while(P(Ne)>d&&--We>0);return Xe=Te-M*_(Pe),[te*(1/a(Xe)+Lt/a(Pe))/Ot,Xe]};function be(){return y.geoProjection(ie).scale(160.857)}function ce(te){var le=0,Te=y.geoProjectionMutator(te),Pe=Te(le);return Pe.parallel=function(We){return arguments.length?Te(le=We*S):le*C},Pe}function Le(te,le){return[te*a(le),le]}Le.invert=function(te,le){return[te/a(le),le]};function Ze(){return y.geoProjection(Le).scale(152.63)}function Qe(te){if(!te)return Le;var le=1/A(te);function Te(Pe,We){var Ne=le+te-We,Xe=Ne&&Pe*a(We)/Ne;return[Ne*_(Xe),le-Ne*a(Xe)]}return Te.invert=function(Pe,We){var Ne=V(Pe*Pe+(We=le-We)*We),Xe=le+te-Ne;return[Ne/a(Xe)*i(Pe,We),Xe]},Te}function mr(){return ce(Qe).scale(123.082).center([0,26.1441]).parallel(45)}function fr(te){function le(Te,Pe){var We=D-Pe,Ne=We&&Te*te*_(We)/We;return[We*_(Ne)/te,D-We*a(Ne)]}return le.invert=function(Te,Pe){var We=Te*te,Ne=D-Pe,Xe=V(We*We+Ne*Ne),Pr=i(We,Ne);return[(Xe?Xe/_(Xe):1)*Pr/te,D-Xe]},le}function Jr(){var te=.5,le=y.geoProjectionMutator(fr),Te=le(te);return Te.fraction=function(Pe){return arguments.length?le(te=+Pe):te},Te.scale(158.837)}var an=ye(1,4/w,w);function Er(){return y.geoProjection(an).scale(152.63)}function dn(te,le,Te,Pe,We,Ne){var Xe=a(Ne),Pr;if(P(te)>1||P(Ne)>1)Pr=U(Te*We+le*Pe*Xe);else{var qr=_(te/2),Xr=_(Ne/2);Pr=2*B(V(qr*qr+le*Pe*Xr*Xr))}return P(Pr)>d?[Pr,i(Pe*_(Ne),le*We-Te*Pe*Xe)]:[0,0]}function _n(te,le,Te){return U((te*te+le*le-Te*Te)/(2*te*le))}function Oe(te){return te-2*w*o((te+w)/(2*w))}function Xt(te,le,Te){for(var Pe=[[te[0],te[1],_(te[1]),a(te[1])],[le[0],le[1],_(le[1]),a(le[1])],[Te[0],Te[1],_(Te[1]),a(Te[1])]],We=Pe[2],Ne,Xe=0;Xe<3;++Xe,We=Ne)Ne=Pe[Xe],We.v=dn(Ne[1]-We[1],We[3],We[2],Ne[3],Ne[2],Ne[0]-We[0]),We.point=[0,0];var Pr=_n(Pe[0].v[0],Pe[2].v[0],Pe[1].v[0]),qr=_n(Pe[0].v[0],Pe[1].v[0],Pe[2].v[0]),Xr=w-Pr;Pe[2].point[1]=0,Pe[0].point[0]=-(Pe[1].point[0]=Pe[0].v[0]/2);var gn=[Pe[2].point[0]=Pe[0].point[0]+Pe[2].v[0]*a(Pr),2*(Pe[0].point[1]=Pe[1].point[1]=Pe[2].v[0]*_(Pr))];function zn(Qn,ai){var Ti=_(ai),Qi=a(ai),Ma=new Array(3),Aa;for(Aa=0;Aa<3;++Aa){var Fa=Pe[Aa];if(Ma[Aa]=dn(ai-Fa[1],Fa[3],Fa[2],Qi,Ti,Qn-Fa[0]),!Ma[Aa][0])return Fa.point;Ma[Aa][1]=Oe(Ma[Aa][1]-Fa.v[1])}var wo=gn.slice();for(Aa=0;Aa<3;++Aa){var Yo=Aa==2?0:Aa+1,Fo=_n(Pe[Aa].v[0],Ma[Aa][0],Ma[Yo][0]);Ma[Aa][1]<0&&(Fo=-Fo),Aa?Aa==1?(Fo=qr-Fo,wo[0]-=Ma[Aa][0]*a(Fo),wo[1]-=Ma[Aa][0]*_(Fo)):(Fo=Xr-Fo,wo[0]+=Ma[Aa][0]*a(Fo),wo[1]+=Ma[Aa][0]*_(Fo)):(wo[0]+=Ma[Aa][0]*a(Fo),wo[1]-=Ma[Aa][0]*_(Fo))}return wo[0]/=3,wo[1]/=3,wo}return zn}function oe(te){return te[0]*=S,te[1]*=S,te}function zt(){return _t([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function _t(te,le,Te){var Pe=y.geoCentroid({type:"MultiPoint",coordinates:[te,le,Te]}),We=[-Pe[0],-Pe[1]],Ne=y.geoRotation(We),Xe=Xt(oe(Ne(te)),oe(Ne(le)),oe(Ne(Te)));Xe.invert=Gt(Xe);var Pr=y.geoProjection(Xe).rotate(We),qr=Pr.center;return delete Pr.rotate,Pr.center=function(Xr){return arguments.length?qr(Ne(Xr)):Ne.invert(qr())},Pr.clipAngle(90)}function Pt(te,le){var Te=V(1-_(le));return[2/p*te*Te,p*(1-Te)]}Pt.invert=function(te,le){var Te=(Te=le/p-1)*Te;return[Te>0?te*V(w/Te)/2:0,B(1-Te)]};function Ht(){return y.geoProjection(Pt).scale(95.6464).center([0,30])}function ae(te){var le=A(te);function Te(Pe,We){return[Pe,(Pe?Pe/_(Pe):1)*(_(We)*a(Pe)-le*a(We))]}return Te.invert=le?function(Pe,We){Pe&&(We*=_(Pe)/Pe);var Ne=a(Pe);return[Pe,2*i(V(Ne*Ne+le*le-We*We)-Ne,le-We)]}:function(Pe,We){return[Pe,B(Pe?We*A(Pe)/Pe:We)]},Te}function he(){return ce(ae).scale(249.828).clipAngle(90)}var Me=V(3);function qe(te,le){return[Me*te*(2*a(2*le/3)-1)/p,Me*p*_(le/3)]}qe.invert=function(te,le){var Te=3*B(le/(Me*p));return[p*te/(Me*(2*a(2*Te/3)-1)),Te]};function Ye(){return y.geoProjection(qe).scale(156.19)}function ur(te){var le=a(te);function Te(Pe,We){return[Pe*le,_(We)/le]}return Te.invert=function(Pe,We){return[Pe/le,B(We*le)]},Te}function Rr(){return ce(ur).parallel(38.58).scale(195.044)}function zr(te){var le=a(te);function Te(Pe,We){return[Pe*le,(1+le)*A(We/2)]}return Te.invert=function(Pe,We){return[Pe/le,n(We/(1+le))*2]},Te}function xr(){return ce(zr).scale(124.75)}function pn(te,le){var Te=V(8/(3*w));return[Te*te*(1-P(le)/w),Te*le]}pn.invert=function(te,le){var Te=V(8/(3*w)),Pe=le/Te;return[te/(Te*(1-P(Pe)/w)),Pe]};function ci(){return y.geoProjection(pn).scale(165.664)}function ui(te,le){var Te=V(4-3*_(P(le)));return[2/V(6*w)*te*Te,x(le)*V(2*w/3)*(2-Te)]}ui.invert=function(te,le){var Te=2-P(le)/V(2*w/3);return[te*V(6*w)/(2*Te),x(le)*B((4-Te*Te)/3)]};function yi(){return y.geoProjection(ui).scale(165.664)}function Gi(te,le){var Te=V(w*(4+w));return[2/Te*te*(1+V(1-4*le*le/(w*w))),4/Te*le]}Gi.invert=function(te,le){var Te=V(w*(4+w))/2;return[te*Te/(1+V(1-le*le*(4+w)/(4*w))),le*Te/2]};function Ci(){return y.geoProjection(Gi).scale(180.739)}function fi(te,le){var Te=(2+D)*_(le);le/=2;for(var Pe=0,We=1/0;Pe<10&&P(We)>d;Pe++){var Ne=a(le);le-=We=(le+_(le)*(Ne+2)-Te)/(2*Ne*(1+Ne))}return[2/V(w*(4+w))*te*(1+a(le)),2*V(w/(4+w))*_(le)]}fi.invert=function(te,le){var Te=le*V((4+w)/w)/2,Pe=B(Te),We=a(Pe);return[te/(2/V(w*(4+w))*(1+We)),B((Pe+Te*(We+2))/(2+D))]};function ba(){return y.geoProjection(fi).scale(180.739)}function oa(te,le){return[te*(1+a(le))/V(2+w),2*le/V(2+w)]}oa.invert=function(te,le){var Te=V(2+w),Pe=le*Te/2;return[Te*te/(1+a(Pe)),Pe]};function Ke(){return y.geoProjection(oa).scale(173.044)}function sr(te,le){for(var Te=(1+D)*_(le),Pe=0,We=1/0;Pe<10&&P(We)>d;Pe++)le-=We=(le+_(le)-Te)/(1+a(le));return Te=V(2+w),[te*(1+a(le))/Te,2*le/Te]}sr.invert=function(te,le){var Te=1+D,Pe=V(Te/2);return[te*2*Pe/(1+a(le*=Pe)),B((le+_(le))/Te)]};function vr(){return y.geoProjection(sr).scale(173.044)}var Ar=3+2*M;function mn(te,le){var Te=_(te/=2),Pe=a(te),We=V(a(le)),Ne=a(le/=2),Xe=_(le)/(Ne+M*Pe*We),Pr=V(2/(1+Xe*Xe)),qr=V((M*Ne+(Pe+Te)*We)/(M*Ne+(Pe-Te)*We));return[Ar*(Pr*(qr-1/qr)-2*c(qr)),Ar*(Pr*Xe*(qr+1/qr)-2*n(Xe))]}mn.invert=function(te,le){if(!(Ne=gt.invert(te/1.2,le*1.065)))return null;var Te=Ne[0],Pe=Ne[1],We=20,Ne;te/=Ar,le/=Ar;do{var Xe=Te/2,Pr=Pe/2,qr=_(Xe),Xr=a(Xe),gn=_(Pr),zn=a(Pr),Qn=a(Pe),ai=V(Qn),Ti=gn/(zn+M*Xr*ai),Qi=Ti*Ti,Ma=V(2/(1+Qi)),Aa=M*zn+(Xr+qr)*ai,Fa=M*zn+(Xr-qr)*ai,wo=Aa/Fa,Yo=V(wo),Fo=Yo-1/Yo,xs=Yo+1/Yo,Sl=Ma*Fo-2*c(Yo)-te,Ll=Ma*Ti*xs-2*n(Ti)-le,Ws=gn&&I*ai*qr*Qi/gn,zl=(M*Xr*zn+ai)/(2*(zn+M*Xr*ai)*(zn+M*Xr*ai)*ai),Fc=-.5*Ti*Ma*Ma*Ma,Sc=Fc*Ws,rl=Fc*zl,nl=(nl=2*zn+M*ai*(Xr-qr))*nl*Yo,au=(M*Xr*zn*ai+Qn)/nl,wu=-(M*qr*gn)/(ai*nl),ih=Fo*Sc-2*au/Yo+Ma*(au+au/wo),Et=Fo*rl-2*wu/Yo+Ma*(wu+wu/wo),Vt=Ti*xs*Sc-2*Ws/(1+Qi)+Ma*xs*Ws+Ma*Ti*(au-au/wo),de=Ti*xs*rl-2*zl/(1+Qi)+Ma*xs*zl+Ma*Ti*(wu-wu/wo),Ie=Et*Vt-de*ih;if(!Ie)break;var Be=(Ll*Et-Sl*de)/Ie,He=(Sl*Vt-Ll*ih)/Ie;Te-=Be,Pe=s(-D,h(D,Pe-He))}while((P(Be)>d||P(He)>d)&&--We>0);return P(P(Pe)-D)Pe){var zn=V(gn),Qn=i(Xr,qr),ai=Te*b(Qn/Te),Ti=Qn-ai,Qi=te*a(Ti),Ma=(te*_(Ti)-Ti*_(Qi))/(D-Qi),Aa=Re(Ti,Ma),Fa=(w-te)/Kr(Aa,Qi,w);qr=zn;var wo=50,Yo;do qr-=Yo=(te+Kr(Aa,Qi,qr)*Fa-zn)/(Aa(qr)*Fa);while(P(Yo)>d&&--wo>0);Xr=Ti*_(qr),qrPe){var qr=V(Pr),Xr=i(Xe,Ne),gn=Te*b(Xr/Te),zn=Xr-gn;Ne=qr*a(zn),Xe=qr*_(zn);for(var Qn=Ne-D,ai=_(Ne),Ti=Xe/ai,Qi=Ned||P(Ti)>d)&&--Qi>0);return[zn,Qn]},qr}var Yr=cn(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function un(){return y.geoProjection(Yr).scale(149.995)}var Pn=cn(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function bn(){return y.geoProjection(Pn).scale(153.93)}var ze=cn(5/6*w,-.62636,-.0344,0,1.3493,-.05524,0,.045);function yr(){return y.geoProjection(ze).scale(130.945)}function en(te,le){var Te=te*te,Pe=le*le;return[te*(1-.162388*Pe)*(.87-952426e-9*Te*Te),le*(1+Pe/12)]}en.invert=function(te,le){var Te=te,Pe=le,We=50,Ne;do{var Xe=Pe*Pe;Pe-=Ne=(Pe*(1+Xe/12)-le)/(1+Xe/4)}while(P(Ne)>d&&--We>0);We=50,te/=1-.162388*Xe;do{var Pr=(Pr=Te*Te)*Pr;Te-=Ne=(Te*(.87-952426e-9*Pr)-te)/(.87-.00476213*Pr)}while(P(Ne)>d&&--We>0);return[Te,Pe]};function Rn(){return y.geoProjection(en).scale(131.747)}var ni=cn(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function xi(){return y.geoProjection(ni).scale(131.087)}function Jn(te){var le=te(D,0)[0]-te(-D,0)[0];function Te(Pe,We){var Ne=Pe>0?-.5:.5,Xe=te(Pe+Ne*w,We);return Xe[0]-=Ne*le,Xe}return te.invert&&(Te.invert=function(Pe,We){var Ne=Pe>0?-.5:.5,Xe=te.invert(Pe+Ne*le,We),Pr=Xe[0]-Ne*w;return Pr<-w?Pr+=2*w:Pr>w&&(Pr-=2*w),Xe[0]=Pr,Xe}),Te}function Gn(te,le){var Te=x(te),Pe=x(le),We=a(le),Ne=a(te)*We,Xe=_(te)*We,Pr=_(Pe*le);te=P(i(Xe,Pr)),le=B(Ne),P(te-D)>d&&(te%=D);var qr=pi(te>w/4?D-te:te,le);return te>w/4&&(Pr=qr[0],qr[0]=-qr[1],qr[1]=-Pr),qr[0]*=Te,qr[1]*=-Pe,qr}Gn.invert=function(te,le){P(te)>1&&(te=x(te)*2-te),P(le)>1&&(le=x(le)*2-le);var Te=x(te),Pe=x(le),We=-Te*te,Ne=-Pe*le,Xe=Ne/We<1,Pr=Va(Xe?Ne:We,Xe?We:Ne),qr=Pr[0],Xr=Pr[1],gn=a(Xr);return Xe&&(qr=-D-qr),[Te*(i(_(qr)*gn,-_(Xr))+w),Pe*B(a(qr)*gn)]};function pi(te,le){if(le===D)return[0,0];var Te=_(le),Pe=Te*Te,We=Pe*Pe,Ne=1+We,Xe=1+3*We,Pr=1-We,qr=B(1/V(Ne)),Xr=Pr+Pe*Ne*qr,gn=(1-Te)/Xr,zn=V(gn),Qn=gn*Ne,ai=V(Qn),Ti=zn*Pr,Qi,Ma;if(te===0)return[0,-(Ti+Pe*ai)];var Aa=a(le),Fa=1/Aa,wo=2*Te*Aa,Yo=(-3*Pe+qr*Xe)*wo,Fo=(-Xr*Aa-(1-Te)*Yo)/(Xr*Xr),xs=.5*Fo/zn,Sl=Pr*xs-2*Pe*zn*wo,Ll=Pe*Ne*Fo+gn*Xe*wo,Ws=-Fa*wo,zl=-Fa*Ll,Fc=-2*Fa*Sl,Sc=4*te/w,rl;if(te>.222*w||le.175*w){if(Qi=(Ti+Pe*V(Qn*(1+We)-Ti*Ti))/(1+We),te>w/4)return[Qi,Qi];var nl=Qi,au=.5*Qi;Qi=.5*(au+nl),Ma=50;do{var wu=V(Qn-Qi*Qi),ih=Qi*(Fc+Ws*wu)+zl*B(Qi/ai)-Sc;if(!ih)break;ih<0?au=Qi:nl=Qi,Qi=.5*(au+nl)}while(P(nl-au)>d&&--Ma>0)}else{Qi=d,Ma=25;do{var Et=Qi*Qi,Vt=V(Qn-Et),de=Fc+Ws*Vt,Ie=Qi*de+zl*B(Qi/ai)-Sc,Be=de+(zl-Ws*Et)/Vt;Qi-=rl=Vt?Ie/Be:0}while(P(rl)>d&&--Ma>0)}return[Qi,-Ti-Pe*V(Qn-Qi*Qi)]}function Va(te,le){for(var Te=0,Pe=1,We=.5,Ne=50;;){var Xe=We*We,Pr=V(We),qr=B(1/V(1+Xe)),Xr=1-Xe+We*(1+Xe)*qr,gn=(1-Pr)/Xr,zn=V(gn),Qn=gn*(1+Xe),ai=zn*(1-Xe),Ti=Qn-te*te,Qi=V(Ti),Ma=le+ai+We*Qi;if(P(Pe-Te)0?Te=We:Pe=We,We=.5*(Te+Pe)}if(!Ne)return null;var Aa=B(Pr),Fa=a(Aa),wo=1/Fa,Yo=2*Pr*Fa,Fo=(-3*We+qr*(1+3*Xe))*Yo,xs=(-Xr*Fa-(1-Pr)*Fo)/(Xr*Xr),Sl=.5*xs/zn,Ll=(1-Xe)*Sl-2*We*zn*Yo,Ws=-2*wo*Ll,zl=-wo*Yo,Fc=-wo*(We*(1+Xe)*xs+gn*(1+3*Xe)*Yo);return[w/4*(te*(Ws+zl*Qi)+Fc*B(te/V(Qn))),Aa]}function ea(){return y.geoProjection(Jn(Gn)).scale(239.75)}function go(te,le,Te){var Pe,We,Ne;return te?(Pe=mo(te,Te),le?(We=mo(le,1-Te),Ne=We[1]*We[1]+Te*Pe[0]*Pe[0]*We[0]*We[0],[[Pe[0]*We[2]/Ne,Pe[1]*Pe[2]*We[0]*We[1]/Ne],[Pe[1]*We[1]/Ne,-Pe[0]*Pe[2]*We[0]*We[2]/Ne],[Pe[2]*We[1]*We[2]/Ne,-Te*Pe[0]*Pe[1]*We[0]/Ne]]):[[Pe[0],0],[Pe[1],0],[Pe[2],0]]):(We=mo(le,1-Te),[[0,We[0]/We[1]],[1/We[1],0],[We[2]/We[1],0]])}function mo(te,le){var Te,Pe,We,Ne,Xe;if(le=1-d)return Te=(1-le)/4,Pe=H(te),Ne=W(te),We=1/Pe,Xe=Pe*F(te),[Ne+Te*(Xe-te)/(Pe*Pe),We-Te*Ne*We*(Xe-te),We+Te*Ne*We*(Xe+te),2*n(l(te))-D+Te*(Xe-te)/Pe];var Pr=[1,0,0,0,0,0,0,0,0],qr=[V(le),0,0,0,0,0,0,0,0],Xr=0;for(Pe=V(1-le),Xe=1;P(qr[Xr]/Pr[Xr])>d&&Xr<8;)Te=Pr[Xr++],qr[Xr]=(Te-Pe)/2,Pr[Xr]=(Te+Pe)/2,Pe=V(Te*Pe),Xe*=2;We=Xe*Pr[Xr]*te;do Ne=qr[Xr]*_(Pe=We)/Pr[Xr],We=(B(Ne)+We)/2;while(--Xr);return[_(We),Ne=a(We),Ne/a(We-Pe),We]}function Go(te,le,Te){var Pe=P(te),We=P(le),Ne=F(We);if(Pe){var Xe=1/_(Pe),Pr=1/(A(Pe)*A(Pe)),qr=-(Pr+Te*(Ne*Ne*Xe*Xe)-1+Te),Xr=(Te-1)*Pr,gn=(-qr+V(qr*qr-4*Xr))/2;return[Po(n(1/V(gn)),Te)*x(te),Po(n(V((gn/Pr-1)/Te)),1-Te)*x(le)]}return[0,Po(n(Ne),1-Te)*x(le)]}function Po(te,le){if(!le)return te;if(le===1)return c(A(te/2+E));for(var Te=1,Pe=V(1-le),We=V(le),Ne=0;P(We)>d;Ne++){if(te%w){var Xe=n(Pe*A(te)/Te);Xe<0&&(Xe+=w),te+=Xe+~~(te/w)*w}else te+=te;We=(Te+Pe)/2,Pe=V(Te*Pe),We=((Te=We)-Pe)/2}return te/(m(2,Ne)*Te)}function Zo(te,le){var Te=(M-1)/(M+1),Pe=V(1-Te*Te),We=Po(D,Pe*Pe),Ne=-1,Xe=c(A(w/4+P(le)/2)),Pr=l(Ne*Xe)/V(Te),qr=Ka(Pr*a(Ne*te),Pr*_(Ne*te)),Xr=Go(qr[0],qr[1],Pe*Pe);return[-Xr[1],(le>=0?1:-1)*(.5*We-Xr[0])]}function Ka(te,le){var Te=te*te,Pe=le+1,We=1-Te-le*le;return[.5*((te>=0?D:-D)-i(We,2*te)),-.25*c(We*We+4*Te)+.5*c(Pe*Pe+Te)]}function Cs(te,le){var Te=le[0]*le[0]+le[1]*le[1];return[(te[0]*le[0]+te[1]*le[1])/Te,(te[1]*le[0]-te[0]*le[1])/Te]}Zo.invert=function(te,le){var Te=(M-1)/(M+1),Pe=V(1-Te*Te),We=Po(D,Pe*Pe),Ne=-1,Xe=go(.5*We-le,-te,Pe*Pe),Pr=Cs(Xe[0],Xe[1]),qr=i(Pr[1],Pr[0])/Ne;return[qr,2*n(l(.5/Ne*c(Te*Pr[0]*Pr[0]+Te*Pr[1]*Pr[1])))-D]};function ps(){return y.geoProjection(Jn(Zo)).scale(151.496)}function wl(te){var le=_(te),Te=a(te),Pe=is(te);Pe.invert=is(-te);function We(Ne,Xe){var Pr=Pe(Ne,Xe);Ne=Pr[0],Xe=Pr[1];var qr=_(Xe),Xr=a(Xe),gn=a(Ne),zn=U(le*qr+Te*Xr*gn),Qn=_(zn),ai=P(Qn)>d?zn/Qn:1;return[ai*Te*_(Ne),(P(Ne)>D?ai:-ai)*(le*Xr-Te*qr*gn)]}return We.invert=function(Ne,Xe){var Pr=V(Ne*Ne+Xe*Xe),qr=-_(Pr),Xr=a(Pr),gn=Pr*Xr,zn=-Xe*qr,Qn=Pr*le,ai=V(gn*gn+zn*zn-Qn*Qn),Ti=i(gn*Qn+zn*ai,zn*Qn-gn*ai),Qi=(Pr>D?-1:1)*i(Ne*qr,Pr*a(Ti)*Xr+Xe*_(Ti)*qr);return Pe.invert(Qi,Ti)},We}function is(te){var le=_(te),Te=a(te);return function(Pe,We){var Ne=a(We),Xe=a(Pe)*Ne,Pr=_(Pe)*Ne,qr=_(We);return[i(Pr,Xe*Te-qr*le),B(qr*Te+Xe*le)]}}function ol(){var te=0,le=y.geoProjectionMutator(wl),Te=le(te),Pe=Te.rotate,We=Te.stream,Ne=y.geoCircle();return Te.parallel=function(Xe){if(!arguments.length)return te*C;var Pr=Te.rotate();return le(te=Xe*S).rotate(Pr)},Te.rotate=function(Xe){return arguments.length?(Pe.call(Te,[Xe[0],Xe[1]-te*C]),Ne.center([-Xe[0],-Xe[1]]),Te):(Xe=Pe.call(Te),Xe[1]+=te*C,Xe)},Te.stream=function(Xe){return Xe=We(Xe),Xe.sphere=function(){Xe.polygonStart();var Pr=.01,qr=Ne.radius(90-Pr)().coordinates[0],Xr=qr.length-1,gn=-1,zn;for(Xe.lineStart();++gn=0;)Xe.point((zn=qr[gn])[0],zn[1]);Xe.lineEnd(),Xe.polygonEnd()},Xe},Te.scale(79.4187).parallel(45).clipAngle(180-.001)}var ms=3,kl=B(1-1/ms)*C,ul=ur(0);function Kl(te){var le=kl*S,Te=Pt(w,le)[0]-Pt(-w,le)[0],Pe=ul(0,le)[1],We=Pt(0,le)[1],Ne=p-We,Xe=g/te,Pr=4/g,qr=Pe+Ne*Ne*4/g;function Xr(gn,zn){var Qn,ai=P(zn);if(ai>le){var Ti=h(te-1,s(0,o((gn+w)/Xe)));gn+=w*(te-1)/te-Ti*Xe,Qn=Pt(gn,ai),Qn[0]=Qn[0]*g/Te-g*(te-1)/(2*te)+Ti*g/te,Qn[1]=Pe+(Qn[1]-We)*4*Ne/g,zn<0&&(Qn[1]=-Qn[1])}else Qn=ul(gn,zn);return Qn[0]*=Pr,Qn[1]/=qr,Qn}return Xr.invert=function(gn,zn){gn/=Pr,zn*=qr;var Qn=P(zn);if(Qn>Pe){var ai=h(te-1,s(0,o((gn+w)/Xe)));gn=(gn+w*(te-1)/te-ai*Xe)*Te/g;var Ti=Pt.invert(gn,.25*(Qn-Pe)*g/Ne+We);return Ti[0]-=w*(te-1)/te-ai*Xe,zn<0&&(Ti[1]=-Ti[1]),Ti}return ul.invert(gn,zn)},Xr}function vs(te,le){return[te,le&1?90-d:kl]}function Ns(te,le){return[te,le&1?-90+d:-kl]}function Uo(te){return[te[0]*(1-d),te[1]]}function Ds(te){var le=[].concat(z.range(-180,180+te/2,te).map(vs),z.range(180,-180-te/2,-te).map(Ns));return{type:"Polygon",coordinates:[te===180?le.map(Uo):le]}}function Ol(){var te=4,le=y.geoProjectionMutator(Kl),Te=le(te),Pe=Te.stream;return Te.lobes=function(We){return arguments.length?le(te=+We):te},Te.stream=function(We){var Ne=Te.rotate(),Xe=Pe(We),Pr=(Te.rotate([0,0]),Pe(We));return Te.rotate(Ne),Xe.sphere=function(){y.geoStream(Ds(180/te),Pr)},Xe},Te.scale(239.75)}function tc(te){var le=1+te,Te=_(1/le),Pe=B(Te),We=2*V(w/(Ne=w+4*Pe*le)),Ne,Xe=.5*We*(le+V(te*(2+te))),Pr=te*te,qr=le*le;function Xr(gn,zn){var Qn=1-_(zn),ai,Ti;if(Qn&&Qn<2){var Qi=D-zn,Ma=25,Aa;do{var Fa=_(Qi),wo=a(Qi),Yo=Pe+i(Fa,le-wo),Fo=1+qr-2*le*wo;Qi-=Aa=(Qi-Pr*Pe-le*Fa+Fo*Yo-.5*Qn*Ne)/(2*le*Fa*Yo)}while(P(Aa)>k&&--Ma>0);ai=We*V(Fo),Ti=gn*Yo/w}else ai=We*(te+Qn),Ti=gn*Pe/w;return[ai*_(Ti),Xe-ai*a(Ti)]}return Xr.invert=function(gn,zn){var Qn=gn*gn+(zn-=Xe)*zn,ai=(1+qr-Qn/(We*We))/(2*le),Ti=U(ai),Qi=_(Ti),Ma=Pe+i(Qi,le-ai);return[B(gn/V(Qn))*w/Ma,B(1-2*(Ti-Pr*Pe-le*Qi+(1+qr-2*le*ai)*Ma)/Ne)]},Xr}function sc(){var te=1,le=y.geoProjectionMutator(tc),Te=le(te);return Te.ratio=function(Pe){return arguments.length?le(te=+Pe):te},Te.scale(167.774).center([0,18.67])}var Xs=.7109889596207567,Wa=.0528035274542;function Co(te,le){return le>-Xs?(te=ue(te,le),te[1]+=Wa,te):Le(te,le)}Co.invert=function(te,le){return le>-Xs?ue.invert(te,le-Wa):Le.invert(te,le)};function el(){return y.geoProjection(Co).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function lc(te,le){return P(le)>Xs?(te=ue(te,le),te[1]-=le>0?Wa:-Wa,te):Le(te,le)}lc.invert=function(te,le){return P(le)>Xs?ue.invert(te,le+(le>0?Wa:-Wa)):Le.invert(te,le)};function ss(){return y.geoProjection(lc).scale(152.63)}function nc(te,le,Te,Pe){var We=V(4*w/(2*Te+(1+te-le/2)*_(2*Te)+(te+le)/2*_(4*Te)+le/2*_(6*Te))),Ne=V(Pe*_(Te)*V((1+te*a(2*Te)+le*a(4*Te))/(1+te+le))),Xe=Te*qr(1);function Pr(zn){return V(1+te*a(2*zn)+le*a(4*zn))}function qr(zn){var Qn=zn*Te;return(2*Qn+(1+te-le/2)*_(2*Qn)+(te+le)/2*_(4*Qn)+le/2*_(6*Qn))/Te}function Xr(zn){return Pr(zn)*_(zn)}var gn=function(zn,Qn){var ai=Te*Zt(qr,Xe*_(Qn)/Te,Qn/w);isNaN(ai)&&(ai=Te*x(Qn));var Ti=We*Pr(ai);return[Ti*Ne*zn/w*a(ai),Ti/Ne*_(ai)]};return gn.invert=function(zn,Qn){var ai=Zt(Xr,Qn*Ne/We);return[zn*w/(a(ai)*We*Ne*Pr(ai)),B(Te*qr(ai/Te)/Xe)]},Te===0&&(We=V(Pe/w),gn=function(zn,Qn){return[zn*We,_(Qn)/We]},gn.invert=function(zn,Qn){return[zn/We,B(Qn*We)]}),gn}function yl(){var te=1,le=0,Te=45*S,Pe=2,We=y.geoProjectionMutator(nc),Ne=We(te,le,Te,Pe);return Ne.a=function(Xe){return arguments.length?We(te=+Xe,le,Te,Pe):te},Ne.b=function(Xe){return arguments.length?We(te,le=+Xe,Te,Pe):le},Ne.psiMax=function(Xe){return arguments.length?We(te,le,Te=+Xe*S,Pe):Te*C},Ne.ratio=function(Xe){return arguments.length?We(te,le,Te,Pe=+Xe):Pe},Ne.scale(180.739)}function $l(te,le,Te,Pe,We,Ne,Xe,Pr,qr,Xr,gn){if(gn.nanEncountered)return NaN;var zn,Qn,ai,Ti,Qi,Ma,Aa,Fa,wo,Yo;if(zn=Te-le,Qn=te(le+zn*.25),ai=te(Te-zn*.25),isNaN(Qn)){gn.nanEncountered=!0;return}if(isNaN(ai)){gn.nanEncountered=!0;return}return Ti=zn*(Pe+4*Qn+We)/12,Qi=zn*(We+4*ai+Ne)/12,Ma=Ti+Qi,Yo=(Ma-Xe)/15,Xr>qr?(gn.maxDepthCount++,Ma+Yo):Math.abs(Yo)>1;do qr[Ma]>ai?Qi=Ma:Ti=Ma,Ma=Ti+Qi>>1;while(Ma>Ti);var Aa=qr[Ma+1]-qr[Ma];return Aa&&(Aa=(ai-qr[Ma+1])/Aa),(Ma+1+Aa)/Xe}var zn=2*gn(1)/w*Ne/Te,Qn=function(ai,Ti){var Qi=gn(P(_(Ti))),Ma=Pe(Qi)*ai;return Qi/=zn,[Ma,Ti>=0?Qi:-Qi]};return Qn.invert=function(ai,Ti){var Qi;return Ti*=zn,P(Ti)<1&&(Qi=x(Ti)*B(We(P(Ti))*Ne)),[ai/Pe(P(Ti)),Qi]},Qn}function zs(){var te=0,le=2.5,Te=1.183136,Pe=y.geoProjectionMutator(ko),We=Pe(te,le,Te);return We.alpha=function(Ne){return arguments.length?Pe(te=+Ne,le,Te):te},We.k=function(Ne){return arguments.length?Pe(te,le=+Ne,Te):le},We.gamma=function(Ne){return arguments.length?Pe(te,le,Te=+Ne):Te},We.scale(152.63)}function js(te,le){return P(te[0]-le[0])=0;--qr)Te=te[1][qr],Pe=Te[0][0],We=Te[0][1],Ne=Te[1][1],Xe=Te[2][0],Pr=Te[2][1],le.push(mc([[Xe-d,Pr-d],[Xe-d,Ne+d],[Pe+d,Ne+d],[Pe+d,We-d]],30));return{type:"Polygon",coordinates:[z.merge(le)]}}function us(te,le,Te){var Pe,We;function Ne(qr,Xr){for(var gn=Xr<0?-1:1,zn=le[+(Xr<0)],Qn=0,ai=zn.length-1;Qnzn[Qn][2][0];++Qn);var Ti=te(qr-zn[Qn][1][0],Xr);return Ti[0]+=te(zn[Qn][1][0],gn*Xr>gn*zn[Qn][0][1]?zn[Qn][0][1]:Xr)[0],Ti}Te?Ne.invert=Te(Ne):te.invert&&(Ne.invert=function(qr,Xr){for(var gn=We[+(Xr<0)],zn=le[+(Xr<0)],Qn=0,ai=gn.length;QnTi&&(Qi=ai,ai=Ti,Ti=Qi),[[zn,ai],[Qn,Ti]]})}),Xe):le.map(function(Xr){return Xr.map(function(gn){return[[gn[0][0]*C,gn[0][1]*C],[gn[1][0]*C,gn[1][1]*C],[gn[2][0]*C,gn[2][1]*C]]})})},le!=null&&Xe.lobes(le),Xe}var Rc=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function iu(){return us(ie,Rc).scale(160.857)}var Dl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function ql(){return us(lc,Dl).scale(152.63)}var cc=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function dc(){return us(ue,cc).scale(169.529)}var pu=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Ah(){return us(ue,pu).scale(169.529).rotate([20,0])}var uh=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function yh(){return us(Co,uh,Gt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var tf=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function Nd(){return us(Le,tf).scale(152.63).rotate([-20,0])}function Gl(te,le){return[3/g*te*V(w*w/3-le*le),le]}Gl.invert=function(te,le){return[g/3*te/V(w*w/3-le*le),le]};function Yu(){return y.geoProjection(Gl).scale(158.837)}function ef(te){function le(Te,Pe){if(P(P(Pe)-D)2)return null;Te/=2,Pe/=2;var Ne=Te*Te,Xe=Pe*Pe,Pr=2*Pe/(1+Ne+Xe);return Pr=m((1+Pr)/(1-Pr),1/te),[i(2*Te,1-Ne-Xe)/te,B((Pr-1)/(Pr+1))]},le}function xu(){var te=.5,le=y.geoProjectionMutator(ef),Te=le(te);return Te.spacing=function(Pe){return arguments.length?le(te=+Pe):te},Te.scale(124.75)}var mu=w/M;function bu(te,le){return[te*(1+V(a(le)))/2,le/(a(le/2)*a(te/6))]}bu.invert=function(te,le){var Te=P(te),Pe=P(le),We=d,Ne=D;Ped||P(Ma)>d)&&--We>0);return We&&[Te,Pe]};function gu(){return y.geoProjection(_c).scale(139.98)}function pl(te,le){return[_(te)/a(le),A(le)*a(te)]}pl.invert=function(te,le){var Te=te*te,Pe=le*le,We=Pe+1,Ne=Te+We,Xe=te?I*V((Ne-V(Ne*Ne-4*Te))/Te):1/V(We);return[B(te*Xe),x(le)*U(Xe)]};function ic(){return y.geoProjection(pl).scale(144.049).clipAngle(90-.001)}function jh(te){var le=a(te),Te=A(E+te/2);function Pe(We,Ne){var Xe=Ne-te,Pr=P(Xe)=0;)gn=te[Xr],zn=gn[0]+Pr*(ai=zn)-qr*Qn,Qn=gn[1]+Pr*Qn+qr*ai;return zn=Pr*(ai=zn)-qr*Qn,Qn=Pr*Qn+qr*ai,[zn,Qn]}return Te.invert=function(Pe,We){var Ne=20,Xe=Pe,Pr=We;do{for(var qr=le,Xr=te[qr],gn=Xr[0],zn=Xr[1],Qn=0,ai=0,Ti;--qr>=0;)Xr=te[qr],Qn=gn+Xe*(Ti=Qn)-Pr*ai,ai=zn+Xe*ai+Pr*Ti,gn=Xr[0]+Xe*(Ti=gn)-Pr*zn,zn=Xr[1]+Xe*zn+Pr*Ti;Qn=gn+Xe*(Ti=Qn)-Pr*ai,ai=zn+Xe*ai+Pr*Ti,gn=Xe*(Ti=gn)-Pr*zn-Pe,zn=Xe*zn+Pr*Ti-We;var Qi=Qn*Qn+ai*ai,Ma,Aa;Xe-=Ma=(gn*Qn+zn*ai)/Qi,Pr-=Aa=(zn*Qn-gn*ai)/Qi}while(P(Ma)+P(Aa)>d*d&&--Ne>0);if(Ne){var Fa=V(Xe*Xe+Pr*Pr),wo=2*n(Fa*.5),Yo=_(wo);return[i(Xe*Yo,Fa*a(wo)),Fa?B(Pr*Yo/Fa):0]}},Te}var hl=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],pp=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Hl=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],cs=[[.9245,0],[0,0],[.01943,0]],_d=[[.721316,0],[0,0],[-.00881625,-.00617325]];function xh(){return vu(hl,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function hu(){return vu(pp,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function rf(){return vu(Hl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function td(){return vu(cs,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Ed(){return vu(_d,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function vu(te,le){var Te=y.geoProjection(Xf(te)).rotate(le).clipAngle(90),Pe=y.geoRotation(le),We=Te.center;return delete Te.rotate,Te.center=function(Ne){return arguments.length?We(Pe(Ne)):Pe.invert(We())},Te}var Lf=V(6),hf=V(7);function Ld(te,le){var Te=B(7*_(le)/(3*Lf));return[Lf*te*(2*a(2*Te/3)-1)/hf,9*_(Te/3)/hf]}Ld.invert=function(te,le){var Te=3*B(le*hf/9);return[te*hf/(Lf*(2*a(2*Te/3)-1)),B(_(Te)*3*Lf/7)]};function ed(){return y.geoProjection(Ld).scale(164.859)}function nf(te,le){for(var Te=(1+I)*_(le),Pe=le,We=0,Ne;We<25&&(Pe-=Ne=(_(Pe/2)+_(Pe)-Te)/(.5*a(Pe/2)+a(Pe)),!(P(Ne)k&&--Pe>0);return Ne=Te*Te,Xe=Ne*Ne,Pr=Ne*Xe,[te/(.84719-.13063*Ne+Pr*Pr*(-.04515+.05494*Ne-.02326*Xe+.00331*Pr)),Te]};function Mh(){return y.geoProjection(Uh).scale(175.295)}function yu(te,le){return[te*(1+a(le))/2,2*(le-A(le/2))]}yu.invert=function(te,le){for(var Te=le/2,Pe=0,We=1/0;Pe<10&&P(We)>d;++Pe){var Ne=a(le/2);le-=We=(le-A(le/2)-Te)/(1-.5/(Ne*Ne))}return[2*te/(1+a(le)),le]};function fd(){return y.geoProjection(yu).scale(152.63)}var of=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function uc(){return us(Ct(1/0),of).rotate([20,0]).scale(152.63)}function jd(te,le){var Te=_(le),Pe=a(le),We=x(te);if(te===0||P(le)===D)return[0,le];if(le===0)return[te,0];if(P(te)===D)return[te*Pe,D*Te];var Ne=w/(2*te)-2*te/w,Xe=2*le/w,Pr=(1-Xe*Xe)/(Te-Xe),qr=Ne*Ne,Xr=Pr*Pr,gn=1+qr/Xr,zn=1+Xr/qr,Qn=(Ne*Te/Pr-Ne/2)/gn,ai=(Xr*Te/qr+Pr/2)/zn,Ti=Qn*Qn+Pe*Pe/gn,Qi=ai*ai-(Xr*Te*Te/qr+Pr*Te-1)/zn;return[D*(Qn+V(Ti)*We),D*(ai+V(Qi<0?0:Qi)*x(-le*Ne)*We)]}jd.invert=function(te,le){te/=D,le/=D;var Te=te*te,Pe=le*le,We=Te+Pe,Ne=w*w;return[te?(We-1+V((1-We)*(1-We)+4*Te))/(2*te)*D:0,Zt(function(Xe){return We*(w*_(Xe)-2*Xe)*w+4*Xe*Xe*(le-_(Xe))+2*w*Xe-Ne*le},0)]};function Jf(){return y.geoProjection(jd).scale(127.267)}var ff=1.0148,Pd=.23185,pf=-.14499,Xu=.02406,mf=ff,Vc=5*Pd,Ju=7*pf,rd=9*Xu,xc=1.790857183;function $h(te,le){var Te=le*le;return[te,le*(ff+Te*Te*(Pd+Te*(pf+Xu*Te)))]}$h.invert=function(te,le){le>xc?le=xc:le<-xc&&(le=-xc);var Te=le,Pe;do{var We=Te*Te;Te-=Pe=(Te*(ff+We*We*(Pd+We*(pf+Xu*We)))-le)/(mf+We*We*(Vc+We*(Ju+rd*We)))}while(P(Pe)>d);return[te,Te]};function ju(){return y.geoProjection($h).scale(139.319)}function Qu(te,le){if(P(le)d&&--We>0);return Xe=A(Pe),[(P(le)=0;)if(Pe=le[Pr],Te[0]===Pe[0]&&Te[1]===Pe[1]){if(Ne)return[Ne,Te];Ne=Te}}}function hh(te){for(var le=te.length,Te=[],Pe=te[le-1],We=0;We0?[-Pe[0],0]:[180-Pe[0],180])};var le=Lh.map(function(Te){return{face:Te,project:te(Te)}});return[-1,0,0,1,0,1,4,5].forEach(function(Te,Pe){var We=le[Te];We&&(We.children||(We.children=[])).push(le[Pe])}),bd(le[0],function(Te,Pe){return le[Te<-w/2?Pe<0?6:4:Te<0?Pe<0?2:0:TePe^ai>Pe&&Te<(Qn-Xr)*(Pe-gn)/(ai-gn)+Xr&&(We=!We)}return We}function Au(te,le){var Te=le.stream,Pe;if(!Te)throw new Error("invalid projection");switch(te&&te.type){case"Feature":Pe=fh;break;case"FeatureCollection":Pe=gf;break;default:Pe=Ph;break}return Pe(te,Te)}function gf(te,le){return{type:"FeatureCollection",features:te.features.map(function(Te){return fh(Te,le)})}}function fh(te,le){return{type:"Feature",id:te.id,properties:te.properties,geometry:Ph(te.geometry,le)}}function Vh(te,le){return{type:"GeometryCollection",geometries:te.geometries.map(function(Te){return Ph(Te,le)})}}function Ph(te,le){if(!te)return null;if(te.type==="GeometryCollection")return Vh(te,le);var Te;switch(te.type){case"Point":Te=Ih;break;case"MultiPoint":Te=Ih;break;case"LineString":Te=Td;break;case"MultiLineString":Te=Td;break;case"Polygon":Te=Dh;break;case"MultiPolygon":Te=Dh;break;case"Sphere":Te=Dh;break;default:return null}return y.geoStream(te,le(Te)),Te.result()}var Zc=[],fc=[],Ih={point:function(te,le){Zc.push([te,le])},result:function(){var te=Zc.length?Zc.length<2?{type:"Point",coordinates:Zc[0]}:{type:"MultiPoint",coordinates:Zc}:null;return Zc=[],te}},Td={lineStart:ad,point:function(te,le){Zc.push([te,le])},lineEnd:function(){Zc.length&&(fc.push(Zc),Zc=[])},result:function(){var te=fc.length?fc.length<2?{type:"LineString",coordinates:fc[0]}:{type:"MultiLineString",coordinates:fc}:null;return fc=[],te}},Dh={polygonStart:ad,lineStart:ad,point:function(te,le){Zc.push([te,le])},lineEnd:function(){var te=Zc.length;if(te){do Zc.push(Zc[0].slice());while(++te<4);fc.push(Zc),Zc=[]}},polygonEnd:ad,result:function(){if(!fc.length)return null;var te=[],le=[];return fc.forEach(function(Te){Dd(Te)?te.push([Te]):le.push(Te)}),le.forEach(function(Te){var Pe=Te[0];te.some(function(We){if(tp(We[0],Pe))return We.push(Te),!0})||te.push([Te])}),fc=[],te.length?te.length>1?{type:"MultiPolygon",coordinates:te}:{type:"Polygon",coordinates:te[0]}:null}};function sf(te){var le=te(D,0)[0]-te(-D,0)[0];function Te(Pe,We){var Ne=P(Pe)0?Pe-w:Pe+w,We),Pr=(Xe[0]-Xe[1])*I,qr=(Xe[0]+Xe[1])*I;if(Ne)return[Pr,qr];var Xr=le*I,gn=Pr>0^qr>0?-1:1;return[gn*Pr-x(qr)*Xr,gn*qr-x(Pr)*Xr]}return te.invert&&(Te.invert=function(Pe,We){var Ne=(Pe+We)*I,Xe=(We-Pe)*I,Pr=P(Ne)<.5*le&&P(Xe)<.5*le;if(!Pr){var qr=le*I,Xr=Ne>0^Xe>0?-1:1,gn=-Xr*Pe+(Xe>0?1:-1)*qr,zn=-Xr*We+(Ne>0?1:-1)*qr;Ne=(-gn-zn)*I,Xe=(gn-zn)*I}var Qn=te.invert(Ne,Xe);return Pr||(Qn[0]+=Ne>0?w:-w),Qn}),y.geoProjection(Te).rotate([-90,-90,45]).clipAngle(180-.001)}function br(){return sf(Gn).scale(176.423)}function Qr(){return sf(Zo).scale(111.48)}function Nn(te,le){if(!(0<=(le=+le)&&le<=20))throw new Error("invalid digits");function Te(Xr){var gn=Xr.length,zn=2,Qn=new Array(gn);for(Qn[0]=+Xr[0].toFixed(le),Qn[1]=+Xr[1].toFixed(le);zn2||ai[0]!=gn[0]||ai[1]!=gn[1])&&(zn.push(ai),gn=ai)}return zn.length===1&&Xr.length>1&&zn.push(Te(Xr[Xr.length-1])),zn}function Ne(Xr){return Xr.map(We)}function Xe(Xr){if(Xr==null)return Xr;var gn;switch(Xr.type){case"GeometryCollection":gn={type:"GeometryCollection",geometries:Xr.geometries.map(Xe)};break;case"Point":gn={type:"Point",coordinates:Te(Xr.coordinates)};break;case"MultiPoint":gn={type:Xr.type,coordinates:Pe(Xr.coordinates)};break;case"LineString":gn={type:Xr.type,coordinates:We(Xr.coordinates)};break;case"MultiLineString":case"Polygon":gn={type:Xr.type,coordinates:Ne(Xr.coordinates)};break;case"MultiPolygon":gn={type:"MultiPolygon",coordinates:Xr.coordinates.map(Ne)};break;default:return Xr}return Xr.bbox!=null&&(gn.bbox=Xr.bbox),gn}function Pr(Xr){var gn={type:"Feature",properties:Xr.properties,geometry:Xe(Xr.geometry)};return Xr.id!=null&&(gn.id=Xr.id),Xr.bbox!=null&&(gn.bbox=Xr.bbox),gn}if(te!=null)switch(te.type){case"Feature":return Pr(te);case"FeatureCollection":{var qr={type:"FeatureCollection",features:te.features.map(Pr)};return te.bbox!=null&&(qr.bbox=te.bbox),qr}default:return Xe(te)}return te}function An(te){var le=_(te);function Te(Pe,We){var Ne=le?A(Pe*le/2)/le:Pe/2;if(!We)return[2*Ne,-te];var Xe=2*n(Ne*_(We)),Pr=1/A(We);return[_(Xe)*Pr,We+(1-a(Xe))*Pr-te]}return Te.invert=function(Pe,We){if(P(We+=te)d&&--Pr>0);var Qn=Pe*(Xr=A(Xe)),ai=A(P(We)0?D:-D)*(qr+We*(gn-Xe)/2+We*We*(gn-2*qr+Xe)/2)]}ga.invert=function(te,le){var Te=le/D,Pe=Te*90,We=h(18,P(Pe/5)),Ne=s(0,o(We));do{var Xe=Pi[Ne][1],Pr=Pi[Ne+1][1],qr=Pi[h(19,Ne+2)][1],Xr=qr-Xe,gn=qr-2*Pr+Xe,zn=2*(P(Te)-Pr)/Xr,Qn=gn/Xr,ai=zn*(1-Qn*zn*(1-2*Qn*zn));if(ai>=0||Ne===1){Pe=(le>=0?5:-5)*(ai+We);var Ti=50,Qi;do We=h(18,P(Pe)/5),Ne=o(We),ai=We-Ne,Xe=Pi[Ne][1],Pr=Pi[Ne+1][1],qr=Pi[h(19,Ne+2)][1],Pe-=(Qi=(le>=0?D:-D)*(Pr+ai*(qr-Xe)/2+ai*ai*(qr-2*Pr+Xe)/2)-le)*C;while(P(Qi)>k&&--Ti>0);break}}while(--Ne>=0);var Ma=Pi[Ne][0],Aa=Pi[Ne+1][0],Fa=Pi[h(19,Ne+2)][0];return[te/(Aa+ai*(Fa-Ma)/2+ai*ai*(Fa-2*Aa+Ma)/2),Pe*S]};function Pa(){return y.geoProjection(ga).scale(152.63)}function Qa(te){function le(Te,Pe){var We=a(Pe),Ne=(te-1)/(te-We*a(Te));return[Ne*We*_(Te),Ne*_(Pe)]}return le.invert=function(Te,Pe){var We=Te*Te+Pe*Pe,Ne=V(We),Xe=(te-V(1-We*(te+1)/(te-1)))/((te-1)/Ne+Ne/(te-1));return[i(Te*Xe,Ne*V(1-Xe*Xe)),Ne?B(Pe*Xe/Ne):0]},le}function uo(te,le){var Te=Qa(te);if(!le)return Te;var Pe=a(le),We=_(le);function Ne(Xe,Pr){var qr=Te(Xe,Pr),Xr=qr[1],gn=Xr*We/(te-1)+Pe;return[qr[0]*Pe/gn,Xr/gn]}return Ne.invert=function(Xe,Pr){var qr=(te-1)/(te-1-Pr*We);return Te.invert(qr*Xe,qr*Pr*Pe)},Ne}function Sa(){var te=2,le=0,Te=y.geoProjectionMutator(uo),Pe=Te(te,le);return Pe.distance=function(We){return arguments.length?Te(te=+We,le):te},Pe.tilt=function(We){return arguments.length?Te(te,le=We*S):le*C},Pe.scale(432.147).clipAngle(U(1/te)*C-1e-6)}var Za=1e-4,Ra=1e4,pa=-180,_o=pa+Za,fs=180,os=fs-Za,gs=-90,ws=gs+Za,bo=90,lo=bo-Za;function ks(te){return te.length>0}function dl(te){return Math.floor(te*Ra)/Ra}function Vl(te){return te===gs||te===bo?[0,te]:[pa,dl(te)]}function gc(te){var le=te[0],Te=te[1],Pe=!1;return le<=_o?(le=pa,Pe=!0):le>=os&&(le=fs,Pe=!0),Te<=ws?(Te=gs,Pe=!0):Te>=lo&&(Te=bo,Pe=!0),Pe?[le,Te]:te}function ec(te){return te.map(gc)}function vc(te,le,Te){for(var Pe=0,We=te.length;Pe=os||gn<=ws||gn>=lo){Ne[Xe]=gc(qr);for(var zn=Xe+1;zn_o&&aiws&&Ti=Pr)break;Te.push({index:-1,polygon:le,ring:Ne=Ne.slice(zn-1)}),Ne[0]=Vl(Ne[0][1]),Xe=-1,Pr=Ne.length}}}}function El(te){var le,Te=te.length,Pe={},We={},Ne,Xe,Pr,qr,Xr;for(le=0;le0?w-Pr:Pr)*C],Xr=y.geoProjection(te(Xe)).rotate(qr),gn=y.geoRotation(qr),zn=Xr.center;return delete Xr.rotate,Xr.center=function(Qn){return arguments.length?zn(gn(Qn)):gn.invert(zn())},Xr.clipAngle(90)}function Zl(te){var le=a(te);function Te(Pe,We){var Ne=y.geoGnomonicRaw(Pe,We);return Ne[0]*=le,Ne}return Te.invert=function(Pe,We){return y.geoGnomonicRaw.invert(Pe/le,We)},Te}function Mu(){return eh([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function eh(te,le){return ac(Zl,te,le)}function Vu(te){if(!(te*=2))return y.geoAzimuthalEquidistantRaw;var le=-te/2,Te=-le,Pe=te*te,We=A(Te),Ne=.5/_(Te);function Xe(Pr,qr){var Xr=U(a(qr)*a(Pr-le)),gn=U(a(qr)*a(Pr-Te)),zn=qr<0?-1:1;return Xr*=Xr,gn*=gn,[(Xr-gn)/(2*te),zn*V(4*Pe*gn-(Pe-Xr+gn)*(Pe-Xr+gn))/(2*te)]}return Xe.invert=function(Pr,qr){var Xr=qr*qr,gn=a(V(Xr+(Qn=Pr+le)*Qn)),zn=a(V(Xr+(Qn=Pr+Te)*Qn)),Qn,ai;return[i(ai=gn-zn,Qn=(gn+zn)*We),(qr<0?-1:1)*U(V(Qn*Qn+ai*ai)*Ne)]},Xe}function Wh(){return rh([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function rh(te,le){return ac(Vu,te,le)}function qh(te,le){if(P(le)d&&--Pr>0);return[x(te)*(V(We*We+4)+We)*w/4,D*Xe]};function lf(){return y.geoProjection(eu).scale(127.16)}function Kt(te,le,Te,Pe,We){function Ne(Xe,Pr){var qr=Te*_(Pe*Pr),Xr=V(1-qr*qr),gn=V(2/(1+Xr*a(Xe*=We)));return[te*Xr*gn*_(Xe),le*qr*gn]}return Ne.invert=function(Xe,Pr){var qr=Xe/te,Xr=Pr/le,gn=V(qr*qr+Xr*Xr),zn=2*B(gn/2);return[i(Xe*A(zn),te*gn)/We,gn&&B(Pr*_(zn)/(le*Te*gn))/Pe]},Ne}function O(te,le,Te,Pe){var We=w/3;te=s(te,d),le=s(le,d),te=h(te,D),le=h(le,w-d),Te=s(Te,0),Te=h(Te,100-d),Pe=s(Pe,d);var Ne=Te/100+1,Xe=Pe/100,Pr=U(Ne*a(We))/We,qr=_(te)/_(Pr*D),Xr=le/w,gn=V(Xe*_(te/2)/_(le/2)),zn=gn/V(Xr*qr*Pr),Qn=1/(gn*V(Xr*qr*Pr));return Kt(zn,Qn,qr,Pr,Xr)}function pt(){var te=65*S,le=60*S,Te=20,Pe=200,We=y.geoProjectionMutator(O),Ne=We(te,le,Te,Pe);return Ne.poleline=function(Xe){return arguments.length?We(te=+Xe*S,le,Te,Pe):te*C},Ne.parallels=function(Xe){return arguments.length?We(te,le=+Xe*S,Te,Pe):le*C},Ne.inflation=function(Xe){return arguments.length?We(te,le,Te=+Xe,Pe):Te},Ne.ratio=function(Xe){return arguments.length?We(te,le,Te,Pe=+Xe):Pe},Ne.scale(163.775)}function Dt(){return pt().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Ft=4*w+3*V(3),qt=2*V(2*w*V(3)/Ft),Ee=ye(qt*V(3)/w,qt,Ft/6);function je(){return y.geoProjection(Ee).scale(176.84)}function er(te,le){return[te*V(1-3*le*le/(w*w)),le]}er.invert=function(te,le){return[te/V(1-3*le*le/(w*w)),le]};function wr(){return y.geoProjection(er).scale(152.63)}function Gr(te,le){var Te=a(le),Pe=a(te)*Te,We=1-Pe,Ne=a(te=i(_(te)*Te,-_(le))),Xe=_(te);return Te=V(1-Pe*Pe),[Xe*Te-Ne*We,-Ne*Te-Xe*We]}Gr.invert=function(te,le){var Te=(te*te+le*le)/-2,Pe=V(-Te*(2+Te)),We=le*Te+te*Pe,Ne=te*Te-le*Pe,Xe=V(Ne*Ne+We*We);return[i(Pe*We,Xe*(1+Te)),Xe?-B(Pe*Ne/Xe):0]};function Zr(){return y.geoProjection(Gr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Tn(te,le){var Te=bt(te,le);return[(Te[0]+te/D)/2,(Te[1]+le)/2]}Tn.invert=function(te,le){var Te=te,Pe=le,We=25;do{var Ne=a(Pe),Xe=_(Pe),Pr=_(2*Pe),qr=Xe*Xe,Xr=Ne*Ne,gn=_(Te),zn=a(Te/2),Qn=_(Te/2),ai=Qn*Qn,Ti=1-Xr*zn*zn,Qi=Ti?U(Ne*zn)*V(Ma=1/Ti):Ma=0,Ma,Aa=.5*(2*Qi*Ne*Qn+Te/D)-te,Fa=.5*(Qi*Xe+Pe)-le,wo=.5*Ma*(Xr*ai+Qi*Ne*zn*qr)+.5/D,Yo=Ma*(gn*Pr/4-Qi*Xe*Qn),Fo=.125*Ma*(Pr*Qn-Qi*Xe*Xr*gn),xs=.5*Ma*(qr*zn+Qi*ai*Ne)+.5,Sl=Yo*Fo-xs*wo,Ll=(Fa*Yo-Aa*xs)/Sl,Ws=(Aa*Fo-Fa*wo)/Sl;Te-=Ll,Pe-=Ws}while((P(Ll)>d||P(Ws)>d)&&--We>0);return[Te,Pe]};function qn(){return y.geoProjection(Tn).scale(158.837)}f.geoNaturalEarth=y.geoNaturalEarth1,f.geoNaturalEarthRaw=y.geoNaturalEarth1Raw,f.geoAiry=ht,f.geoAiryRaw=tt,f.geoAitoff=vt,f.geoAitoffRaw=bt,f.geoArmadillo=rt,f.geoArmadilloRaw=ut,f.geoAugust=it,f.geoAugustRaw=gt,f.geoBaker=J,f.geoBakerRaw=ot,f.geoBerghaus=dt,f.geoBerghausRaw=mt,f.geoBertin1953=xe,f.geoBertin1953Raw=ee,f.geoBoggs=be,f.geoBoggsRaw=ie,f.geoBonne=mr,f.geoBonneRaw=Qe,f.geoBottomley=Jr,f.geoBottomleyRaw=fr,f.geoBromley=Er,f.geoBromleyRaw=an,f.geoChamberlin=_t,f.geoChamberlinRaw=Xt,f.geoChamberlinAfrica=zt,f.geoCollignon=Ht,f.geoCollignonRaw=Pt,f.geoCraig=he,f.geoCraigRaw=ae,f.geoCraster=Ye,f.geoCrasterRaw=qe,f.geoCylindricalEqualArea=Rr,f.geoCylindricalEqualAreaRaw=ur,f.geoCylindricalStereographic=xr,f.geoCylindricalStereographicRaw=zr,f.geoEckert1=ci,f.geoEckert1Raw=pn,f.geoEckert2=yi,f.geoEckert2Raw=ui,f.geoEckert3=Ci,f.geoEckert3Raw=Gi,f.geoEckert4=ba,f.geoEckert4Raw=fi,f.geoEckert5=Ke,f.geoEckert5Raw=oa,f.geoEckert6=vr,f.geoEckert6Raw=sr,f.geoEisenlohr=Zn,f.geoEisenlohrRaw=mn,f.geoFahey=Li,f.geoFaheyRaw=Wn,f.geoFoucaut=Zi,f.geoFoucautRaw=Fi,f.geoFoucautSinusoidal=ca,f.geoFoucautSinusoidalRaw=Ji,f.geoGilbert=so,f.geoGingery=sn,f.geoGingeryRaw=Fe,f.geoGinzburg4=un,f.geoGinzburg4Raw=Yr,f.geoGinzburg5=bn,f.geoGinzburg5Raw=Pn,f.geoGinzburg6=yr,f.geoGinzburg6Raw=ze,f.geoGinzburg8=Rn,f.geoGinzburg8Raw=en,f.geoGinzburg9=xi,f.geoGinzburg9Raw=ni,f.geoGringorten=ea,f.geoGringortenRaw=Gn,f.geoGuyou=ps,f.geoGuyouRaw=Zo,f.geoHammer=Bt,f.geoHammerRaw=Ct,f.geoHammerRetroazimuthal=ol,f.geoHammerRetroazimuthalRaw=wl,f.geoHealpix=Ol,f.geoHealpixRaw=Kl,f.geoHill=sc,f.geoHillRaw=tc,f.geoHomolosine=ss,f.geoHomolosineRaw=lc,f.geoHufnagel=yl,f.geoHufnagelRaw=nc,f.geoHyperelliptical=zs,f.geoHyperellipticalRaw=ko,f.geoInterrupt=us,f.geoInterruptedBoggs=iu,f.geoInterruptedHomolosine=ql,f.geoInterruptedMollweide=dc,f.geoInterruptedMollweideHemispheres=Ah,f.geoInterruptedSinuMollweide=yh,f.geoInterruptedSinusoidal=Nd,f.geoKavrayskiy7=Yu,f.geoKavrayskiy7Raw=Gl,f.geoLagrange=xu,f.geoLagrangeRaw=ef,f.geoLarrivee=_h,f.geoLarriveeRaw=bu,f.geoLaskowski=gu,f.geoLaskowskiRaw=_c,f.geoLittrow=ic,f.geoLittrowRaw=pl,f.geoLoximuthal=Hu,f.geoLoximuthalRaw=jh,f.geoMiller=Lc,f.geoMillerRaw=Qh,f.geoModifiedStereographic=vu,f.geoModifiedStereographicRaw=Xf,f.geoModifiedStereographicAlaska=xh,f.geoModifiedStereographicGs48=hu,f.geoModifiedStereographicGs50=rf,f.geoModifiedStereographicMiller=td,f.geoModifiedStereographicLee=Ed,f.geoMollweide=Mt,f.geoMollweideRaw=ue,f.geoMtFlatPolarParabolic=ed,f.geoMtFlatPolarParabolicRaw=Ld,f.geoMtFlatPolarQuartic=af,f.geoMtFlatPolarQuarticRaw=nf,f.geoMtFlatPolarSinusoidal=df,f.geoMtFlatPolarSinusoidalRaw=bh,f.geoNaturalEarth2=Mh,f.geoNaturalEarth2Raw=Uh,f.geoNellHammer=fd,f.geoNellHammerRaw=yu,f.geoInterruptedQuarticAuthalic=uc,f.geoNicolosi=Jf,f.geoNicolosiRaw=jd,f.geoPatterson=ju,f.geoPattersonRaw=$h,f.geoPolyconic=Pc,f.geoPolyconicRaw=Qu,f.geoPolyhedral=bd,f.geoPolyhedralButterfly=Ic,f.geoPolyhedralCollignon=Pf,f.geoPolyhedralWaterman=Mc,f.geoProject=Au,f.geoGringortenQuincuncial=br,f.geoPeirceQuincuncial=Qr,f.geoPierceQuincuncial=Qr,f.geoQuantize=Nn,f.geoQuincuncial=sf,f.geoRectangularPolyconic=di,f.geoRectangularPolyconicRaw=An,f.geoRobinson=Pa,f.geoRobinsonRaw=ga,f.geoSatellite=Sa,f.geoSatelliteRaw=uo,f.geoSinuMollweide=el,f.geoSinuMollweideRaw=Co,f.geoSinusoidal=Ze,f.geoSinusoidalRaw=Le,f.geoStitch=bc,f.geoTimes=Bs,f.geoTimesRaw=qo,f.geoTwoPointAzimuthal=eh,f.geoTwoPointAzimuthalRaw=Zl,f.geoTwoPointAzimuthalUsa=Mu,f.geoTwoPointEquidistant=rh,f.geoTwoPointEquidistantRaw=Vu,f.geoTwoPointEquidistantUsa=Wh,f.geoVanDerGrinten=Wc,f.geoVanDerGrintenRaw=qh,f.geoVanDerGrinten2=ds,f.geoVanDerGrinten2Raw=Gh,f.geoVanDerGrinten3=nh,f.geoVanDerGrinten3Raw=$s,f.geoVanDerGrinten4=lf,f.geoVanDerGrinten4Raw=eu,f.geoWagner=pt,f.geoWagner7=Dt,f.geoWagnerRaw=O,f.geoWagner4=je,f.geoWagner4Raw=Ee,f.geoWagner6=wr,f.geoWagner6Raw=er,f.geoWiechel=Zr,f.geoWiechelRaw=Gr,f.geoWinkel3=qn,f.geoWinkel3Raw=Tn,Object.defineProperty(f,"__esModule",{value:!0})})}),AX=It((et,Y)=>{var f=Br(),y=jn(),z=ls(),P=Math.PI/180,n=180/Math.PI,i={cursor:"pointer"},a={cursor:"auto"};function l(C,S){var N=C.projection,B;return S._isScoped?B=s:S._isClipped?B=m:B=h,B(C,N)}Y.exports=l;function o(C,S){return f.behavior.zoom().translate(S.translate()).scale(S.scale())}function c(C,S,N){var B=C.id,U=C.graphDiv,V=U.layout,W=V[B],F=U._fullLayout,H=F[B],q={},G={};function tt(ht,bt){q[B+"."+ht]=y.nestedProperty(W,ht).get(),z.call("_storeDirectGUIEdit",V,F._preGUI,q);var vt=y.nestedProperty(H,ht);vt.get()!==bt&&(vt.set(bt),y.nestedProperty(W,ht).set(bt),G[B+"."+ht]=bt)}N(tt),tt("projection.scale",S.scale()/C.fitScale),tt("fitbounds",!1),U.emit("plotly_relayout",G)}function s(C,S){var N=o(C,S);function B(){f.select(this).style(i)}function U(){S.scale(f.event.scale).translate(f.event.translate),C.render(!0);var F=S.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":S.scale()/C.fitScale,"geo.center.lon":F[0],"geo.center.lat":F[1]})}function V(F){var H=S.invert(C.midPt);F("center.lon",H[0]),F("center.lat",H[1])}function W(){f.select(this).style(a),c(C,S,V)}return N.on("zoomstart",B).on("zoom",U).on("zoomend",W),N}function h(C,S){var N=o(C,S),B=2,U,V,W,F,H,q,G,tt,ht;function bt(st){return S.invert(st)}function vt(st){var xt=bt(st);if(!xt)return!0;var ot=S(xt);return Math.abs(ot[0]-st[0])>B||Math.abs(ot[1]-st[1])>B}function ut(){f.select(this).style(i),U=f.mouse(this),V=S.rotate(),W=S.translate(),F=V,H=bt(U)}function rt(){if(q=f.mouse(this),vt(U)){N.scale(S.scale()),N.translate(S.translate());return}S.scale(f.event.scale),S.translate([W[0],f.event.translate[1]]),H?bt(q)&&(tt=bt(q),G=[F[0]+(tt[0]-H[0]),V[1],V[2]],S.rotate(G),F=G):(U=q,H=bt(U)),ht=!0,C.render(!0);var st=S.rotate(),xt=S.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":S.scale()/C.fitScale,"geo.center.lon":xt[0],"geo.center.lat":xt[1],"geo.projection.rotation.lon":-st[0]})}function gt(){f.select(this).style(a),ht&&c(C,S,it)}function it(st){var xt=S.rotate(),ot=S.invert(C.midPt);st("projection.rotation.lon",-xt[0]),st("center.lon",ot[0]),st("center.lat",ot[1])}return N.on("zoomstart",ut).on("zoom",rt).on("zoomend",gt),N}function m(C,S){S.rotate(),S.scale();var N=o(C,S),B=g(N,"zoomstart","zoom","zoomend"),U=0,V=N.on,W;N.on("zoomstart",function(){f.select(this).style(i);var tt=f.mouse(this),ht=S.rotate(),bt=ht,vt=S.translate(),ut=x(ht);W=b(S,tt),V.call(N,"zoom",function(){var rt=f.mouse(this);if(S.scale(f.event.scale),!W)tt=rt,W=b(S,tt);else if(b(S,rt)){S.rotate(ht).translate(vt);var gt=b(S,rt),it=A(W,gt),st=E(_(ut,it)),xt=d(st,W,bt);(!isFinite(xt[0])||!isFinite(xt[1])||!isFinite(xt[2]))&&(xt=bt),S.rotate(xt),bt=xt}H(B.of(this,arguments))}),F(B.of(this,arguments))}).on("zoomend",function(){f.select(this).style(a),V.call(N,"zoom",null),q(B.of(this,arguments)),c(C,S,G)}).on("zoom.redraw",function(){C.render(!0);var tt=S.rotate();C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":S.scale()/C.fitScale,"geo.projection.rotation.lon":-tt[0],"geo.projection.rotation.lat":-tt[1]})});function F(tt){U++||tt({type:"zoomstart"})}function H(tt){tt({type:"zoom"})}function q(tt){--U||tt({type:"zoomend"})}function G(tt){var ht=S.rotate();tt("projection.rotation.lon",-ht[0]),tt("projection.rotation.lat",-ht[1])}return f.rebind(N,B,"on")}function b(C,S){var N=C.invert(S);return N&&isFinite(N[0])&&isFinite(N[1])&&I(N)}function x(C){var S=.5*C[0]*P,N=.5*C[1]*P,B=.5*C[2]*P,U=Math.sin(S),V=Math.cos(S),W=Math.sin(N),F=Math.cos(N),H=Math.sin(B),q=Math.cos(B);return[V*F*q+U*W*H,U*F*q-V*W*H,V*W*q+U*F*H,V*F*H-U*W*q]}function _(C,S){var N=C[0],B=C[1],U=C[2],V=C[3],W=S[0],F=S[1],H=S[2],q=S[3];return[N*W-B*F-U*H-V*q,N*F+B*W+U*q-V*H,N*H-B*q+U*W+V*F,N*q+B*H-U*F+V*W]}function A(C,S){if(!(!C||!S)){var N=p(C,S),B=Math.sqrt(M(N,N)),U=.5*Math.acos(Math.max(-1,Math.min(1,M(C,S)))),V=Math.sin(U)/B;return B&&[Math.cos(U),N[2]*V,-N[1]*V,N[0]*V]}}function d(C,S,N){var B=D(S,2,C[0]);B=D(B,1,C[1]),B=D(B,0,C[2]-N[2]);var U=S[0],V=S[1],W=S[2],F=B[0],H=B[1],q=B[2],G=Math.atan2(V,U)*n,tt=Math.sqrt(U*U+V*V),ht,bt;Math.abs(H)>tt?(bt=(H>0?90:-90)-G,ht=0):(bt=Math.asin(H/tt)*n-G,ht=Math.sqrt(tt*tt-H*H));var vt=180-bt-2*G,ut=(Math.atan2(q,F)-Math.atan2(W,ht))*n,rt=(Math.atan2(q,F)-Math.atan2(W,-ht))*n,gt=k(N[0],N[1],bt,ut),it=k(N[0],N[1],vt,rt);return gt<=it?[bt,ut,N[2]]:[vt,rt,N[2]]}function k(C,S,N,B){var U=w(N-C),V=w(B-S);return Math.sqrt(U*U+V*V)}function w(C){return(C%360+540)%360-180}function D(C,S,N){var B=N*P,U=C.slice(),V=S===0?1:0,W=S===2?1:2,F=Math.cos(B),H=Math.sin(B);return U[V]=C[V]*F-C[W]*H,U[W]=C[W]*F+C[V]*H,U}function E(C){return[Math.atan2(2*(C[0]*C[1]+C[2]*C[3]),1-2*(C[1]*C[1]+C[2]*C[2]))*n,Math.asin(Math.max(-1,Math.min(1,2*(C[0]*C[2]-C[3]*C[1]))))*n,Math.atan2(2*(C[0]*C[3]+C[1]*C[2]),1-2*(C[2]*C[2]+C[3]*C[3]))*n]}function I(C){var S=C[0]*P,N=C[1]*P,B=Math.cos(N);return[B*Math.cos(S),B*Math.sin(S),Math.sin(N)]}function M(C,S){for(var N=0,B=0,U=C.length;B{var f=Br(),y=MD(),z=y.geoPath,P=y.geoDistance,n=CX(),i=ls(),a=jn(),l=a.strTranslate,o=Hn(),c=Js(),s=hd(),h=lh(),m=Fs(),b=Jm().getAutoRange,x=Up(),_=Md().prepSelect,A=Md().clearOutline,d=Md().selectOnClick,k=AX(),w=Mk(),D=q_(),E=QC(),I=SD().feature;function M(N){this.id=N.id,this.graphDiv=N.graphDiv,this.container=N.container,this.topojsonURL=N.topojsonURL,this.isStatic=N.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var p=M.prototype;Y.exports=function(N){return new M(N)},p.plot=function(N,B,U,V){var W=this;if(V)return W.update(N,B,!0);W._geoCalcData=N,W._fullLayout=B;var F=B[this.id],H=[],q=!1;for(var G in w.layerNameToAdjective)if(G!=="frame"&&F["show"+G]){q=!0;break}for(var tt=!1,ht=0;ht0&&H._module.calcGeoJSON(F,B)}if(!U){var q=this.updateProjection(N,B);if(q)return;(!this.viewInitial||this.scope!==V.scope)&&this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(B,V),this.updateDims(B,V),this.updateFx(B,V),h.generalUpdatePerTraceModule(this.graphDiv,this,N,V);var G=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=G.selectAll(".point"),this.dataPoints.text=G.selectAll("text"),this.dataPaths.line=G.selectAll(".js-line");var tt=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=tt.selectAll("path"),this._render()},p.updateProjection=function(N,B){var U=this.graphDiv,V=B[this.id],W=B._size,F=V.domain,H=V.projection,q=V.lonaxis,G=V.lataxis,tt=q._ax,ht=G._ax,bt=this.projection=g(V),vt=[[W.l+W.w*F.x[0],W.t+W.h*(1-F.y[1])],[W.l+W.w*F.x[1],W.t+W.h*(1-F.y[0])]],ut=V.center||{},rt=H.rotation||{},gt=q.range||[],it=G.range||[];if(V.fitbounds){tt._length=vt[1][0]-vt[0][0],ht._length=vt[1][1]-vt[0][1],tt.range=b(U,tt),ht.range=b(U,ht);var st=(tt.range[0]+tt.range[1])/2,xt=(ht.range[0]+ht.range[1])/2;if(V._isScoped)ut={lon:st,lat:xt};else if(V._isClipped){ut={lon:st,lat:xt},rt={lon:st,lat:xt,roll:rt.roll};var ot=H.type,J=w.lonaxisSpan[ot]/2||180,mt=w.lataxisSpan[ot]/2||90;gt=[st-J,st+J],it=[xt-mt,xt+mt]}else ut={lon:st,lat:xt},rt={lon:st,lat:rt.lat,roll:rt.roll}}bt.center([ut.lon-rt.lon,ut.lat-rt.lat]).rotate([-rt.lon,-rt.lat,rt.roll]).parallels(H.parallels);var dt=S(gt,it);bt.fitExtent(vt,dt);var Ct=this.bounds=bt.getBounds(dt),Rt=this.fitScale=bt.scale(),Bt=bt.translate();if(V.fitbounds){var Zt=bt.getBounds(S(tt.range,ht.range)),Gt=Math.min((Ct[1][0]-Ct[0][0])/(Zt[1][0]-Zt[0][0]),(Ct[1][1]-Ct[0][1])/(Zt[1][1]-Zt[0][1]));isFinite(Gt)?bt.scale(Gt*Rt):a.warn("Something went wrong during"+this.id+"fitbounds computations.")}else bt.scale(H.scale*Rt);var ee=this.midPt=[(Ct[0][0]+Ct[1][0])/2,(Ct[0][1]+Ct[1][1])/2];if(bt.translate([Bt[0]+(ee[0]-Bt[0]),Bt[1]+(ee[1]-Bt[1])]).clipExtent(Ct),V._isAlbersUsa){var xe=bt([ut.lon,ut.lat]),ge=bt.translate();bt.translate([ge[0]-(xe[0]-ge[0]),ge[1]-(xe[1]-ge[1])])}},p.updateBaseLayers=function(N,B){var U=this,V=U.topojson,W=U.layers,F=U.basePaths;function H(vt){return vt==="lonaxis"||vt==="lataxis"}function q(vt){return!!w.lineLayers[vt]}function G(vt){return!!w.fillLayers[vt]}var tt=this.hasChoropleth?w.layersForChoropleth:w.layers,ht=tt.filter(function(vt){return q(vt)||G(vt)?B["show"+vt]:H(vt)?B[vt].showgrid:!0}),bt=U.framework.selectAll(".layer").data(ht,String);bt.exit().each(function(vt){delete W[vt],delete F[vt],f.select(this).remove()}),bt.enter().append("g").attr("class",function(vt){return"layer "+vt}).each(function(vt){var ut=W[vt]=f.select(this);vt==="bg"?U.bgRect=ut.append("rect").style("pointer-events","all"):H(vt)?F[vt]=ut.append("path").style("fill","none"):vt==="backplot"?ut.append("g").classed("choroplethlayer",!0):vt==="frontplot"?ut.append("g").classed("scatterlayer",!0):q(vt)?F[vt]=ut.append("path").style("fill","none").style("stroke-miterlimit",2):G(vt)&&(F[vt]=ut.append("path").style("stroke","none"))}),bt.order(),bt.each(function(vt){var ut=F[vt],rt=w.layerNameToAdjective[vt];vt==="frame"?ut.datum(w.sphereSVG):q(vt)||G(vt)?ut.datum(I(V,V.objects[vt])):H(vt)&&ut.datum(C(vt,B,N)).call(o.stroke,B[vt].gridcolor).call(c.dashLine,B[vt].griddash,B[vt].gridwidth),q(vt)?ut.call(o.stroke,B[rt+"color"]).call(c.dashLine,"",B[rt+"width"]):G(vt)&&ut.call(o.fill,B[rt+"color"])})},p.updateDims=function(N,B){var U=this.bounds,V=(B.framewidth||0)/2,W=U[0][0]-V,F=U[0][1]-V,H=U[1][0]-W+V,q=U[1][1]-F+V;c.setRect(this.clipRect,W,F,H,q),this.bgRect.call(c.setRect,W,F,H,q).call(o.fill,B.bgcolor),this.xaxis._offset=W,this.xaxis._length=H,this.yaxis._offset=F,this.yaxis._length=q},p.updateFx=function(N,B){var U=this,V=U.graphDiv,W=U.bgRect,F=N.dragmode,H=N.clickmode;if(U.isStatic)return;function q(){var bt=U.viewInitial,vt={};for(var ut in bt)vt[U.id+"."+ut]=bt[ut];i.call("_guiRelayout",V,vt),V.emit("plotly_doubleclick",null)}function G(bt){return U.projection.invert([bt[0]+U.xaxis._offset,bt[1]+U.yaxis._offset])}var tt=function(bt,vt){if(vt.isRect){var ut=bt.range={};ut[U.id]=[G([vt.xmin,vt.ymin]),G([vt.xmax,vt.ymax])]}else{var rt=bt.lassoPoints={};rt[U.id]=vt.map(G)}},ht={element:U.bgRect.node(),gd:V,plotinfo:{id:U.id,xaxis:U.xaxis,yaxis:U.yaxis,fillRangeItems:tt},xaxes:[U.xaxis],yaxes:[U.yaxis],subplot:U.id,clickFn:function(bt){bt===2&&A(V)}};F==="pan"?(W.node().onmousedown=null,W.call(k(U,B)),W.on("dblclick.zoom",q),V._context._scrollZoom.geo||W.on("wheel.zoom",null)):(F==="select"||F==="lasso")&&(W.on(".zoom",null),ht.prepFn=function(bt,vt,ut){_(bt,vt,ut,ht,F)},x.init(ht)),W.on("mousemove",function(){var bt=U.projection.invert(a.getPositionFromD3Event());if(!bt)return x.unhover(V,f.event);U.xaxis.p2c=function(){return bt[0]},U.yaxis.p2c=function(){return bt[1]},s.hover(V,f.event,U.id)}),W.on("mouseout",function(){V._dragging||x.unhover(V,f.event)}),W.on("click",function(){F!=="select"&&F!=="lasso"&&(H.indexOf("select")>-1&&d(f.event,V,[U.xaxis],[U.yaxis],U.id,ht),H.indexOf("event")>-1&&s.click(V,f.event))})},p.makeFramework=function(){var N=this,B=N.graphDiv,U=B._fullLayout,V="clip"+U._uid+N.id;N.clipDef=U._clips.append("clipPath").attr("id",V),N.clipRect=N.clipDef.append("rect"),N.framework=f.select(N.container).append("g").attr("class","geo "+N.id).call(c.setClipUrl,V,B),N.project=function(W){var F=N.projection(W);return F?[F[0]-N.xaxis._offset,F[1]-N.yaxis._offset]:[null,null]},N.xaxis={_id:"x",c2p:function(W){return N.project(W)[0]}},N.yaxis={_id:"y",c2p:function(W){return N.project(W)[1]}},N.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(N.mockAxis,U)},p.saveViewInitial=function(N){var B=N.center||{},U=N.projection,V=U.rotation||{};this.viewInitial={fitbounds:N.fitbounds,"projection.scale":U.scale};var W;N._isScoped?W={"center.lon":B.lon,"center.lat":B.lat}:N._isClipped?W={"projection.rotation.lon":V.lon,"projection.rotation.lat":V.lat}:W={"center.lon":B.lon,"center.lat":B.lat,"projection.rotation.lon":V.lon},a.extendFlat(this.viewInitial,W)},p.render=function(N){this._hasMarkerAngles&&N?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var N=this.projection,B=N.getPath(),U;function V(F){var H=N(F.lonlat);return H?l(H[0],H[1]):null}function W(F){return N.isLonLatOverEdges(F.lonlat)?"none":null}for(U in this.basePaths)this.basePaths[U].attr("d",B);for(U in this.dataPaths)this.dataPaths[U].attr("d",function(F){return B(F.geojson)});for(U in this.dataPoints)this.dataPoints[U].attr("display",W).attr("transform",V)};function g(N){var B=N.projection,U=B.type,V=w.projNames[U];V="geo"+a.titleCase(V);for(var W=y[V]||n[V],F=W(),H=N._isSatellite?Math.acos(1/B.distance)*180/Math.PI:N._isClipped?w.lonaxisSpan[U]/2:null,q=["center","rotate","parallels","clipExtent"],G=function(bt){return bt?F:[]},tt=0;ttrt}else return!1},F.getPath=function(){return z().projection(F)},F.getBounds=function(bt){return F.getPath().bounds(bt)},F.precision(w.precision),N._isSatellite&&F.tilt(B.tilt).distance(B.distance),H&&F.clipAngle(H-w.clipPad),F}function C(N,B,U){var V=1e-6,W=2.5,F=B[N],H=w.scopeDefaults[B.scope],q,G,tt;N==="lonaxis"?(q=H.lonaxisRange,G=H.lataxisRange,tt=function(xt,ot){return[xt,ot]}):N==="lataxis"&&(q=H.lataxisRange,G=H.lonaxisRange,tt=function(xt,ot){return[ot,xt]});var ht={type:"linear",range:[q[0],q[1]-V],tick0:F.tick0,dtick:F.dtick};m.setConvert(ht,U);var bt=m.calcTicks(ht);!B.isScoped&&N==="lonaxis"&&bt.pop();for(var vt=bt.length,ut=new Array(vt),rt=0;rt0&&W<0&&(W+=360);var q=(W-V)/4;return{type:"Polygon",coordinates:[[[V,F],[V,H],[V+q,H],[V+2*q,H],[V+3*q,H],[W,H],[W,F],[W-q,F],[W-2*q,F],[W-3*q,F],[V,F]]]}}}),ED=It((et,Y)=>{var f=Sn(),y=Jh().attributes,z=qf().dash,P=Mk(),n=sh().overrideAll,i=Xm(),a={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:f.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:z},l=Y.exports=n({domain:y({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:i(P.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:i(P.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:f.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:P.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:P.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:P.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:P.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:f.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:f.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:f.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:f.background},lonaxis:a,lataxis:a},"plot","from-root");l.uirevision={valType:"any",editType:"none"}}),EX=It((et,Y)=>{var f=jn(),y=O_(),z=Mf().getSubplotData,P=Mk(),n=ED(),i=P.axesNames;Y.exports=function(l,o,c){y(l,o,c,{type:"geo",attributes:n,handleDefaults:a,fullData:c,partition:"y"})};function a(l,o,c,s){var h=z(s.fullData,"geo",s.id),m=h.map(function(it){return it.index}),b=c("resolution"),x=c("scope"),_=P.scopeDefaults[x],A=c("projection.type",_.projType),d=o._isAlbersUsa=A==="albers usa";d&&(x=o.scope="usa");var k=o._isScoped=x!=="world",w=o._isSatellite=A==="satellite",D=o._isConic=A.indexOf("conic")!==-1||A==="albers",E=o._isClipped=!!P.lonaxisSpan[A];if(l.visible===!1){var I=f.extendDeep({},o._template);I.showcoastlines=!1,I.showcountries=!1,I.showframe=!1,I.showlakes=!1,I.showland=!1,I.showocean=!1,I.showrivers=!1,I.showsubunits=!1,I.lonaxis&&(I.lonaxis.showgrid=!1),I.lataxis&&(I.lataxis.showgrid=!1),o._template=I}for(var M=c("visible"),p,g=0;g0&&G<0&&(G+=360);var tt=(q+G)/2,ht;if(!d){var bt=k?_.projRotate:[tt,0,0];ht=c("projection.rotation.lon",bt[0]),c("projection.rotation.lat",bt[1]),c("projection.rotation.roll",bt[2]),p=c("showcoastlines",!k&&M),p&&(c("coastlinecolor"),c("coastlinewidth")),p=c("showocean",M?void 0:!1),p&&c("oceancolor")}var vt,ut;if(d?(vt=-96.6,ut=38.7):(vt=k?tt:ht,ut=(H[0]+H[1])/2),c("center.lon",vt),c("center.lat",ut),w&&(c("projection.tilt"),c("projection.distance")),D){var rt=_.projParallels||[0,60];c("projection.parallels",rt)}c("projection.scale"),p=c("showland",M?void 0:!1),p&&c("landcolor"),p=c("showlakes",M?void 0:!1),p&&c("lakecolor"),p=c("showrivers",M?void 0:!1),p&&(c("rivercolor"),c("riverwidth")),p=c("showcountries",k&&x!=="usa"&&M),p&&(c("countrycolor"),c("countrywidth")),(x==="usa"||x==="north america"&&b===50)&&(c("showsubunits",M),c("subunitcolor"),c("subunitwidth")),k||(p=c("showframe",M),p&&(c("framecolor"),c("framewidth"))),c("bgcolor");var gt=c("fitbounds");gt&&(delete o.projection.scale,k?(delete o.center.lon,delete o.center.lat):E?(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon,delete o.projection.rotation.lat,delete o.lonaxis.range,delete o.lataxis.range):(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon))}}),LD=It((et,Y)=>{var f=Mf().getSubplotCalcData,y=jn().counterRegex,z=MX(),P="geo",n=y(P),i={};i[P]={valType:"subplotid",dflt:P,editType:"calc"};function a(c){for(var s=c._fullLayout,h=c.calcdata,m=s._subplots[P],b=0;b{Y.exports={attributes:Ib(),supplyDefaults:vX(),colorbar:Do(),formatLabels:yX(),calc:JC(),calcGeoJSON:AD().calcGeoJSON,plot:AD().plot,style:CD(),styleOnSelect:Il().styleOnSelect,hoverPoints:kX(),eventData:TX(),selectPoints:SX(),moduleType:"trace",name:"scattergeo",basePlotModule:LD(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),PX=It((et,Y)=>{Y.exports=LX()}),Kw=It((et,Y)=>{var{hovertemplateAttrs:f,templatefallbackAttrs:y}=nu(),z=Ib(),P=Ru(),n=xa(),i=Sn().defaultLine,a=Yn().extendFlat,l=z.marker.line;Y.exports=a({locations:{valType:"data_array",editType:"calc"},locationmode:z.locationmode,z:{valType:"data_array",editType:"calc"},geojson:a({},z.geojson,{}),featureidkey:z.featureidkey,text:a({},z.text,{}),hovertext:a({},z.hovertext,{}),marker:{line:{color:a({},l.color,{dflt:i}),width:a({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:z.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:z.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:a({},n.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:f(),hovertemplatefallback:y(),showlegend:a({},n.showlegend,{dflt:!1})},P("",{cLetter:"z",editTypeOverride:"calc"}))}),IX=It((et,Y)=>{var f=jn(),y=Cu(),z=Kw(),P=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(n,i,a,l){function o(_,A){return f.coerce(n,i,z,_,A)}var c=o("locations"),s=o("z");if(!(c&&c.length&&f.isArrayOrTypedArray(s)&&s.length)){i.visible=!1;return}i._length=Math.min(c.length,s.length);var h=o("geojson"),m;(typeof h=="string"&&h!==""||f.isPlainObject(h))&&(m="geojson-id");var b=o("locationmode",m);b==="country names"&&f.warn(P),b==="geojson-id"&&o("featureidkey"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback");var x=o("marker.line.width");x&&o("marker.line.color"),o("marker.opacity"),y(n,i,l,o,{prefix:"",cLetter:"z"}),f.coerceSelectionMarkerOpacity(i,o)}}),rA=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Cp(),P=ft(),n=$t();function i(a){return a&&typeof a=="string"}Y.exports=function(a,l){var o=l._length,c=new Array(o),s;l.geojson?s=function(_){return i(_)||f(_)}:s=i;for(var h=0;h{var f=Br(),y=Hn(),z=Js(),P=ch();function n(l,o){o&&i(l,o)}function i(l,o){var c=o[0].trace,s=o[0].node3,h=s.selectAll(".choroplethlocation"),m=c.marker||{},b=m.line||{},x=P.makeColorScaleFuncFromTrace(c);h.each(function(_){f.select(this).attr("fill",x(_.z)).call(y.stroke,_.mlc||b.color).call(z.dashLine,"",_.mlw||b.width||0).style("opacity",m.opacity)}),z.selectedPointStyle(h,c)}function a(l,o){var c=o[0].node3,s=o[0].trace;s.selectedpoints?z.selectedPointStyle(c.selectAll(".choroplethlocation"),s):i(l,o)}Y.exports={style:n,styleOnSelect:a}}),PD=It((et,Y)=>{var f=Br(),y=jn(),z=q_(),P=QC().getTopojsonFeatures,n=Jm().findExtremes,i=nA().style;function a(o,c,s){var h=c.layers.backplot.select(".choroplethlayer");y.makeTraceGroups(h,s,"trace choropleth").each(function(m){var b=f.select(this),x=b.selectAll("path.choroplethlocation").data(y.identity);x.enter().append("path").classed("choroplethlocation",!0),x.exit().remove(),i(o,m)})}function l(o,c){for(var s=o[0].trace,h=c[s.geo],m=h._subplot,b=s.locationmode,x=s._length,_=b==="geojson-id"?z.extractTraceFeature(o):P(s,m.topojson),A=[],d=[],k=0;k{var f=Fs(),y=Kw(),z=jn().fillText;Y.exports=function(n,i,a){var l=n.cd,o=l[0].trace,c=n.subplot,s,h,m,b,x=[i,a],_=[i+360,a];for(h=0;h")}}}),aA=It((et,Y)=>{Y.exports=function(f,y,z,P,n){f.location=y.location,f.z=y.z;var i=P[n];return i.fIn&&i.fIn.properties&&(f.properties=i.fIn.properties),f.ct=i.ct,f}}),oA=It((et,Y)=>{Y.exports=function(f,y){var z=f.cd,P=f.xaxis,n=f.yaxis,i=[],a,l,o,c,s;if(y===!1)for(a=0;a{Y.exports={attributes:Kw(),supplyDefaults:IX(),colorbar:z_(),calc:rA(),calcGeoJSON:PD().calcGeoJSON,plot:PD().plot,style:nA().style,styleOnSelect:nA().styleOnSelect,hoverPoints:iA(),eventData:aA(),selectPoints:oA(),moduleType:"trace",name:"choropleth",basePlotModule:LD(),categories:["geo","noOpacity","showLegend"],meta:{}}}),zX=It((et,Y)=>{Y.exports=DX()}),sA=It((et,Y)=>{var f=ls(),y=jn(),z=qc();function P(i,a,l,o){var c=i.cd,s=c[0].t,h=c[0].trace,m=i.xa,b=i.ya,x=s.x,_=s.y,A=m.c2p(a),d=b.c2p(l),k=i.distance,w;if(s.tree){var D=m.p2c(A-k),E=m.p2c(A+k),I=b.p2c(d-k),M=b.p2c(d+k);o==="x"?w=s.tree.range(Math.min(D,E),Math.min(b._rl[0],b._rl[1]),Math.max(D,E),Math.max(b._rl[0],b._rl[1])):w=s.tree.range(Math.min(D,E),Math.min(I,M),Math.max(D,E),Math.max(I,M))}else w=s.ids;var p,g,C,S,N,B,U,V,W,F=k;if(o==="x"){var H=!!h.xperiodalignment,q=!!h.yperiodalignment;for(N=0;N=Math.min(G,tt)&&A<=Math.max(G,tt)?0:1/0}if(B=Math.min(ht,bt)&&d<=Math.max(ht,bt)?0:1/0}W=Math.sqrt(B*B+U*U),g=w[N]}}}else for(N=w.length-1;N>-1;N--)p=w[N],C=x[p],S=_[p],B=m.c2p(C)-A,U=b.c2p(S)-d,V=Math.sqrt(B*B+U*U),V{var f=20;Y.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:f,SYMBOL_STROKE:f/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),Lk=It((et,Y)=>{var f=xa(),y=hi(),z=Em(),P=dd(),n=Sh().axisHoverFormat,i=Ru(),a=Xm(),l=Yn().extendFlat,o=sh().overrideAll,c=G_().DASHES,s=P.line,h=P.marker,m=h.line,b=Y.exports=o({x:P.x,x0:P.x0,dx:P.dx,y:P.y,y0:P.y0,dy:P.dy,xperiod:P.xperiod,yperiod:P.yperiod,xperiod0:P.xperiod0,yperiod0:P.yperiod0,xperiodalignment:P.xperiodalignment,yperiodalignment:P.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),text:P.text,hovertext:P.hovertext,textposition:P.textposition,textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:s.color,width:s.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:a(c),dflt:"solid"}},marker:l({},i("marker"),{symbol:h.symbol,angle:h.angle,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:h.opacity,colorbar:h.colorbar,line:l({},i("marker.line"),{width:m.width})}),connectgaps:P.connectgaps,fill:l({},P.fill,{dflt:"none"}),fillcolor:z(),selected:{marker:P.selected.marker,textfont:P.selected.textfont},unselected:{marker:P.unselected.marker,textfont:P.unselected.textfont},opacity:f.opacity},"calc","nested");b.x.editType=b.y.editType=b.x0.editType=b.y0.editType="calc+clearAxisTypes",b.hovertemplate=P.hovertemplate,b.hovertemplatefallback=P.hovertemplatefallback,b.texttemplate=P.texttemplate,b.texttemplatefallback=P.texttemplatefallback}),lA=It(et=>{var Y=G_();et.isOpenSymbol=function(f){return typeof f=="string"?Y.OPEN_RE.test(f):f%200>100},et.isDotSymbol=function(f){return typeof f=="string"?Y.DOT_RE.test(f):f>200}}),OX=It((et,Y)=>{var f=jn(),y=ls(),z=lA(),P=Lk(),n=Eg(),i=Fu(),a=Xg(),l=S0(),o=Y0(),c=Lm(),s=Pm(),h=pm();Y.exports=function(m,b,x,_){function A(p,g){return f.coerce(m,b,P,p,g)}var d=m.marker?z.isOpenSymbol(m.marker.symbol):!1,k=i.isBubble(m),w=a(m,b,_,A);if(!w){b.visible=!1;return}l(m,b,_,A),A("xhoverformat"),A("yhoverformat");var D=w{var f=tl();Y.exports=function(y,z,P){var n=y.i;return"x"in y||(y.x=z._x[n]),"y"in y||(y.y=z._y[n]),f(y,z,P)}}),RX=It((et,Y)=>{function f(a,l,o,c,s){for(var h=s+1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>=0?(h=m,s=m-1):c=m+1}return h}function y(a,l,o,c,s){for(var h=s+1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>0?(h=m,s=m-1):c=m+1}return h}function z(a,l,o,c,s){for(var h=c-1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<0?(h=m,c=m+1):s=m-1}return h}function P(a,l,o,c,s){for(var h=c-1;c<=s;){var m=c+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<=0?(h=m,c=m+1):s=m-1}return h}function n(a,l,o,c,s){for(;c<=s;){var h=c+s>>>1,m=a[h],b=o!==void 0?o(m,l):m-l;if(b===0)return h;b<=0?c=h+1:s=h-1}return-1}function i(a,l,o,c,s,h){return typeof o=="function"?h(a,l,o,c===void 0?0:c|0,s===void 0?a.length-1:s|0):h(a,l,void 0,o===void 0?0:o|0,c===void 0?a.length-1:c|0)}Y.exports={ge:function(a,l,o,c,s){return i(a,l,o,c,s,f)},gt:function(a,l,o,c,s){return i(a,l,o,c,s,y)},lt:function(a,l,o,c,s){return i(a,l,o,c,s,z)},le:function(a,l,o,c,s){return i(a,l,o,c,s,P)},eq:function(a,l,o,c,s){return i(a,l,o,c,s,n)}}}),t1=It((et,Y)=>{Y.exports=function(z,P,n){var i={},a,l;if(typeof P=="string"&&(P=y(P)),Array.isArray(P)){var o={};for(l=0;l{var f=t1();Y.exports=y;function y(z){var P;return arguments.length>1&&(z=arguments),typeof z=="string"?z=z.split(/\s/).map(parseFloat):typeof z=="number"&&(z=[z]),z.length&&typeof z[0]=="number"?z.length===1?P={width:z[0],height:z[0],x:0,y:0}:z.length===2?P={width:z[0],height:z[1],x:0,y:0}:P={x:z[0],y:z[1],width:z[2]-z[0]||0,height:z[3]-z[1]||0}:z&&(z=f(z,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),P={x:z.left||0,y:z.top||0},z.width==null?z.right?P.width=z.right-P.x:P.width=0:P.width=z.width,z.height==null?z.bottom?P.height=z.bottom-P.y:P.height=0:P.height=z.height),P}}),Db=It((et,Y)=>{Y.exports=f;function f(y,z){if(!y||y.length==null)throw Error("Argument should be an array");z==null?z=1:z=Math.floor(z);for(var P=Array(z*2),n=0;ni&&(i=y[l]),y[l]{Y.exports=function(){for(var f=0;f{var f=GC();Y.exports=y;function y(z,P,n){if(!z)throw new TypeError("must specify data as first parameter");if(n=+(n||0)|0,Array.isArray(z)&&z[0]&&typeof z[0][0]=="number"){var i=z[0].length,a=z.length*i,l,o,c,s;(!P||typeof P=="string")&&(P=new(f(P||"float32"))(a+n));var h=P.length-n;if(a!==h)throw new Error("source length "+a+" ("+i+"x"+z.length+") does not match destination length "+h);for(l=0,c=n;l{Y.exports=function(f){var y=typeof f;return f!==null&&(y==="object"||y==="function")}}),jX=It((et,Y)=>{Y.exports=Math.log2||function(f){return Math.log(f)*Math.LOG2E}}),UX=It((et,Y)=>{var f=RX(),y=Ck(),z=Yw(),P=Db(),n=t1(),i=FX(),a=zb(),l=NX(),o=GC(),c=jX(),s=1073741824;Y.exports=function(m,b){b||(b={}),m=a(m,"float64"),b=n(b,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let x=i(b.maxDepth,255),_=i(b.bounds,P(m,2));_[0]===_[2]&&_[2]++,_[1]===_[3]&&_[3]++;let A=h(m,_),d=m.length>>>1,k;b.dtype||(b.dtype="array"),typeof b.dtype=="string"?k=new(o(b.dtype))(d):b.dtype&&(k=b.dtype,Array.isArray(k)&&(k.length=d));for(let N=0;Nx||F>s){for(let st=0;stmt||G>dt||tt=bt||ot===J)return;let Ct=w[xt];J===void 0&&(J=Ct.length);for(let ue=ot;ue=V&&Ot<=F&&Lt>=W&&Lt<=H&&vt.push(Mt)}let Rt=D[xt],Bt=Rt[ot*4+0],Zt=Rt[ot*4+1],Gt=Rt[ot*4+2],ee=Rt[ot*4+3],xe=rt(Rt,ot+1),ge=st*.5,ye=xt+1;ut(gt,it,ge,ye,Bt,Zt||Gt||ee||xe),ut(gt,it+ge,ge,ye,Zt,Gt||ee||xe),ut(gt+ge,it,ge,ye,Gt,ee||xe),ut(gt+ge,it+ge,ge,ye,ee,xe)}function rt(gt,it){let st=null,xt=0;for(;st===null;)if(st=gt[it*4+xt],xt++,xt>gt.length)return null;return st}return vt}function C(N,B,U,V,W){let F=[];for(let H=0;H{Y.exports=UX()}),ID=It((et,Y)=>{Y.exports=f;function f(y){var z=0,P=0,n=0,i=0;return y.map(function(a){a=a.slice();var l=a[0],o=l.toUpperCase();if(l!=o)switch(a[0]=o,l){case"a":a[6]+=n,a[7]+=i;break;case"v":a[1]+=i;break;case"h":a[1]+=n;break;default:for(var c=1;c{Object.defineProperty(et,"__esModule",{value:!0});var f=function(){function l(o,c){var s=[],h=!0,m=!1,b=void 0;try{for(var x=o[Symbol.iterator](),_;!(h=(_=x.next()).done)&&(s.push(_.value),!(c&&s.length===c));h=!0);}catch(A){m=!0,b=A}finally{try{!h&&x.return&&x.return()}finally{if(m)throw b}}return s}return function(o,c){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return l(o,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=Math.PI*2,z=function(l,o,c,s,h,m,b){var x=l.x,_=l.y;x*=o,_*=c;var A=s*x-h*_,d=h*x+s*_;return{x:A+m,y:d+b}},P=function(l,o){var c=o===1.5707963267948966?.551915024494:o===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(o/4),s=Math.cos(l),h=Math.sin(l),m=Math.cos(l+o),b=Math.sin(l+o);return[{x:s-h*c,y:h+s*c},{x:m+b*c,y:b-m*c},{x:m,y:b}]},n=function(l,o,c,s){var h=l*s-o*c<0?-1:1,m=l*c+o*s;return m>1&&(m=1),m<-1&&(m=-1),h*Math.acos(m)},i=function(l,o,c,s,h,m,b,x,_,A,d,k){var w=Math.pow(h,2),D=Math.pow(m,2),E=Math.pow(d,2),I=Math.pow(k,2),M=w*D-w*I-D*E;M<0&&(M=0),M/=w*I+D*E,M=Math.sqrt(M)*(b===x?-1:1);var p=M*h/m*k,g=M*-m/h*d,C=A*p-_*g+(l+c)/2,S=_*p+A*g+(o+s)/2,N=(d-p)/h,B=(k-g)/m,U=(-d-p)/h,V=(-k-g)/m,W=n(1,0,N,B),F=n(N,B,U,V);return x===0&&F>0&&(F-=y),x===1&&F<0&&(F+=y),[C,S,W,F]},a=function(l){var o=l.px,c=l.py,s=l.cx,h=l.cy,m=l.rx,b=l.ry,x=l.xAxisRotation,_=x===void 0?0:x,A=l.largeArcFlag,d=A===void 0?0:A,k=l.sweepFlag,w=k===void 0?0:k,D=[];if(m===0||b===0)return[];var E=Math.sin(_*y/360),I=Math.cos(_*y/360),M=I*(o-s)/2+E*(c-h)/2,p=-E*(o-s)/2+I*(c-h)/2;if(M===0&&p===0)return[];m=Math.abs(m),b=Math.abs(b);var g=Math.pow(M,2)/Math.pow(m,2)+Math.pow(p,2)/Math.pow(b,2);g>1&&(m*=Math.sqrt(g),b*=Math.sqrt(g));var C=i(o,c,s,h,m,b,d,w,E,I,M,p),S=f(C,4),N=S[0],B=S[1],U=S[2],V=S[3],W=Math.abs(V)/(y/4);Math.abs(1-W)<1e-7&&(W=1);var F=Math.max(Math.ceil(W),1);V/=F;for(var H=0;H{Y.exports=y;var f=$X();function y(n){for(var i,a=[],l=0,o=0,c=0,s=0,h=null,m=null,b=0,x=0,_=0,A=n.length;_4?(l=d[d.length-4],o=d[d.length-3]):(l=b,o=x),a.push(d)}return a}function z(n,i,a,l){return["C",n,i,a,l,a,l]}function P(n,i,a,l,o,c){return["C",n/3+2/3*a,i/3+2/3*l,o/3+2/3*a,c/3+2/3*l,o,c]}}),DD=It((et,Y)=>{Y.exports=function(f){return typeof f!="string"?!1:(f=f.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(f)&&/[\dz]$/i.test(f)&&f.length>4))}}),VX=It((et,Y)=>{var f=E_(),y=ID(),z=HX(),P=DD(),n=ok();Y.exports=i;function i(a){if(Array.isArray(a)&&a.length===1&&typeof a[0]=="string"&&(a=a[0]),typeof a=="string"&&(n(P(a),"String is not an SVG path."),a=f(a)),n(Array.isArray(a),"Argument should be a string or an array of path segments."),a=y(a),a=z(a),!a.length)return[0,0,0,0];for(var l=[1/0,1/0,-1/0,-1/0],o=0,c=a.length;ol[2]&&(l[2]=s[h+0]),s[h+1]>l[3]&&(l[3]=s[h+1]);return l}}),WX=It((et,Y)=>{var f=Math.PI,y=l(120);Y.exports=z;function z(o){for(var c,s=[],h=0,m=0,b=0,x=0,_=null,A=null,d=0,k=0,w=0,D=o.length;w7&&(s.push(E.splice(0,7)),E.unshift("C"));break;case"S":var M=d,p=k;(c=="C"||c=="S")&&(M+=M-h,p+=p-m),E=["C",M,p,E[1],E[2],E[3],E[4]];break;case"T":c=="Q"||c=="T"?(_=d*2-_,A=k*2-A):(_=d,A=k),E=n(d,k,_,A,E[1],E[2]);break;case"Q":_=E[1],A=E[2],E=n(d,k,E[1],E[2],E[3],E[4]);break;case"L":E=P(d,k,E[1],E[2]);break;case"H":E=P(d,k,E[1],k);break;case"V":E=P(d,k,d,E[1]);break;case"Z":E=P(d,k,b,x);break}c=I,d=E[E.length-2],k=E[E.length-1],E.length>4?(h=E[E.length-4],m=E[E.length-3]):(h=d,m=k),s.push(E)}return s}function P(o,c,s,h){return["C",o,c,s,h,s,h]}function n(o,c,s,h,m,b){return["C",o/3+2/3*s,c/3+2/3*h,m/3+2/3*s,b/3+2/3*h,m,b]}function i(o,c,s,h,m,b,x,_,A,d){if(d)S=d[0],N=d[1],g=d[2],C=d[3];else{var k=a(o,c,-m);o=k.x,c=k.y,k=a(_,A,-m),_=k.x,A=k.y;var w=(o-_)/2,D=(c-A)/2,E=w*w/(s*s)+D*D/(h*h);E>1&&(E=Math.sqrt(E),s=E*s,h=E*h);var I=s*s,M=h*h,p=(b==x?-1:1)*Math.sqrt(Math.abs((I*M-I*D*D-M*w*w)/(I*D*D+M*w*w)));p==1/0&&(p=1);var g=p*s*D/h+(o+_)/2,C=p*-h*w/s+(c+A)/2,S=Math.asin(((c-C)/h).toFixed(9)),N=Math.asin(((A-C)/h).toFixed(9));S=oN&&(S=S-f*2),!x&&N>S&&(N=N-f*2)}if(Math.abs(N-S)>y){var B=N,U=_,V=A;N=S+y*(x&&N>S?1:-1),_=g+s*Math.cos(N),A=C+h*Math.sin(N);var W=i(_,A,s,h,m,0,x,U,V,[N,B,g,C])}var F=Math.tan((N-S)/4),H=4/3*s*F,q=4/3*h*F,G=[2*o-(o+H*Math.sin(S)),2*c-(c-q*Math.cos(S)),_+H*Math.sin(N),A-q*Math.cos(N),_,A];if(d)return G;W&&(G=G.concat(W));for(var tt=0;tt{var f=ID(),y=WX(),z={M:"moveTo",C:"bezierCurveTo"};Y.exports=function(P,n){P.beginPath(),y(f(n)).forEach(function(i){var a=i[0],l=i.slice(1);P[z[a]].apply(P,l)}),P.closePath()}}),GX=It((et,Y)=>{var f=Ck();Y.exports=z;var y=1e20;function z(i,a){a||(a={});var l=a.cutoff==null?.25:a.cutoff,o=a.radius==null?8:a.radius,c=a.channel||0,s,h,m,b,x,_,A,d,k,w,D;if(ArrayBuffer.isView(i)||Array.isArray(i)){if(!a.width||!a.height)throw Error("For raw data width and height should be provided by options");s=a.width,h=a.height,b=i,a.stride?_=a.stride:_=Math.floor(i.length/s/h)}else window.HTMLCanvasElement&&i instanceof window.HTMLCanvasElement?(d=i,A=d.getContext("2d"),s=d.width,h=d.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.CanvasRenderingContext2D&&i instanceof window.CanvasRenderingContext2D?(d=i.canvas,A=i,s=d.width,h=d.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.ImageData&&i instanceof window.ImageData&&(k=i,s=i.width,h=i.height,b=k.data,_=4);if(m=Math.max(s,h),window.Uint8ClampedArray&&b instanceof window.Uint8ClampedArray||window.Uint8Array&&b instanceof window.Uint8Array)for(x=b,b=Array(s*h),w=0,D=x.length;w{var f=VX(),y=E_(),z=qX(),P=DD(),n=GX(),i=document.createElement("canvas"),a=i.getContext("2d");Y.exports=l;function l(s,h){if(!P(s))throw Error("Argument should be valid svg path string");h||(h={});var m,b;h.shape?(m=h.shape[0],b=h.shape[1]):(m=i.width=h.w||h.width||200,b=i.height=h.h||h.height||200);var x=Math.min(m,b),_=h.stroke||0,A=h.viewbox||h.viewBox||f(s),d=[m/(A[2]-A[0]),b/(A[3]-A[1])],k=Math.min(d[0]||0,d[1]||0)/2;if(a.fillStyle="black",a.fillRect(0,0,m,b),a.fillStyle="white",_&&(typeof _!="number"&&(_=1),_>0?a.strokeStyle="white":a.strokeStyle="black",a.lineWidth=Math.abs(_)),a.translate(m*.5,b*.5),a.scale(k,k),c()){var w=new Path2D(s);a.fill(w),_&&a.stroke(w)}else{var D=y(s);z(a,D),a.fill(),_&&a.stroke()}a.setTransform(1,0,0,1,0,0);var E=n(a,{cutoff:h.cutoff!=null?h.cutoff:.5,radius:h.radius!=null?h.radius:x*.5});return E}var o;function c(){if(o!=null)return o;var s=document.createElement("canvas").getContext("2d");if(s.canvas.width=s.canvas.height=1,!window.Path2D)return o=!1;var h=new Path2D("M0,0h1v1h-1v-1Z");s.fillStyle="black",s.fill(h);var m=s.getImageData(0,0,1,1);return o=m&&m.data&&m.data[3]===255}}),Ob=It((et,Y)=>{var f=Sr(),y=ZX(),z=H_(),P=ls(),n=jn(),i=n.isArrayOrTypedArray,a=Js(),l=Ku(),o=dy().formatColor,c=Fu(),s=Hv(),h=lA(),m=G_(),b=to().DESELECTDIM,x={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},_=T0().appendArrayPointValue;function A(W,F){var H,q={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},G=W._context.plotGlPixelRatio;if(F.visible!==!0)return q;if(c.hasText(F)&&(q.text=d(W,F),q.textSel=E(W,F,F.selected),q.textUnsel=E(W,F,F.unselected)),c.hasMarkers(F)&&(q.marker=w(W,F),q.markerSel=D(W,F,F.selected),q.markerUnsel=D(W,F,F.unselected),!F.unselected&&i(F.marker.opacity))){var tt=F.marker.opacity;for(q.markerUnsel.opacity=new Array(tt.length),H=0;H500?"bold":"normal":W}function w(W,F){var H=F._length,q=F.marker,G={},tt,ht=i(q.symbol),bt=i(q.angle),vt=i(q.color),ut=i(q.line.color),rt=i(q.opacity),gt=i(q.size),it=i(q.line.width),st;if(ht||(st=h.isOpenSymbol(q.symbol)),ht||vt||ut||rt||bt){G.symbols=new Array(H),G.angles=new Array(H),G.colors=new Array(H),G.borderColors=new Array(H);var xt=q.symbol,ot=q.angle,J=o(q,q.opacity,H),mt=o(q.line,q.opacity,H);if(!i(mt[0])){var dt=mt;for(mt=Array(H),tt=0;ttm.TOO_MANY_POINTS||c.hasMarkers(F)?"rect":"round";if(ut&&F.connectgaps){var gt=tt[0],it=tt[1];for(ht=0;ht1?vt[ht]:vt[0]:vt,st=i(ut)?ut.length>1?ut[ht]:ut[0]:ut,xt=x[it],ot=x[st],J=rt?rt/.8+1:0,mt=-ot*J-ot*.5;tt.offset[ht]=[xt*J/gt,mt/gt]}}return tt}Y.exports={style:A,markerStyle:w,markerSelection:D,linePositions:B,errorBarPositions:U,textPosition:V}}),zD=It((et,Y)=>{var f=jn();Y.exports=function(y,z){var P=z._scene,n={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},i={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return z._scene||(P=z._scene={},P.init=function(){f.extendFlat(P,i,n)},P.init(),P.update=function(a){var l=f.repeat(a,P.count);if(P.fill2d&&P.fill2d.update(l),P.scatter2d&&P.scatter2d.update(l),P.line2d&&P.line2d.update(l),P.error2d&&P.error2d.update(l.concat(l)),P.select2d&&P.select2d.update(l),P.glText)for(var o=0;o{var f=cA(),y=jn(),z=Ku(),P=Jm().findExtremes,n=Im(),i=_e(),a=i.calcMarkerSize,l=i.calcAxisExpansion,o=i.setFirstScatter,c=Dm(),s=Ob(),h=zD(),m=Dr().BADNUM,b=G_().TOO_MANY_POINTS;Y.exports=function(A,d){var k=A._fullLayout,w=d._xA=z.getFromId(A,d.xaxis,"x"),D=d._yA=z.getFromId(A,d.yaxis,"y"),E=k._plots[d.xaxis+d.yaxis],I=d._length,M=I>=b,p=I*2,g={},C,S=w.makeCalcdata(d,"x"),N=D.makeCalcdata(d,"y"),B=n(d,w,"x",S),U=n(d,D,"y",N),V=B.vals,W=U.vals;d._x=V,d._y=W,d.xperiodalignment&&(d._origX=S,d._xStarts=B.starts,d._xEnds=B.ends),d.yperiodalignment&&(d._origY=N,d._yStarts=U.starts,d._yEnds=U.ends);var F=new Array(p),H=new Array(I);for(C=0;C1&&y.extendFlat(I.line,s.linePositions(A,k,w)),I.errorX||I.errorY){var M=s.errorBarPositions(A,k,w,D,E);I.errorX&&y.extendFlat(I.errorX,M.x),I.errorY&&y.extendFlat(I.errorY,M.y)}return I.text&&(y.extendFlat(I.text,{positions:w},s.textPosition(A,k,I.text,I.marker)),y.extendFlat(I.textSel,{positions:w},s.textPosition(A,k,I.text,I.markerSel)),y.extendFlat(I.textUnsel,{positions:w},s.textPosition(A,k,I.text,I.markerUnsel))),I}}),OD=It((et,Y)=>{var f=jn(),y=Hn(),z=to().DESELECTDIM;function P(n){var i=n[0],a=i.trace,l=i.t,o=l._scene,c=l.index,s=o.selectBatch[c],h=o.unselectBatch[c],m=o.textOptions[c],b=o.textSelectedOptions[c]||{},x=o.textUnselectedOptions[c]||{},_=f.extendFlat({},m),A,d;if(s.length||h.length){var k=b.color,w=x.color,D=m.color,E=f.isArrayOrTypedArray(D);for(_.color=new Array(a._length),A=0;A{var f=Fu(),y=OD().styleTextSelection;Y.exports=function(z,P){var n=z.cd,i=z.xaxis,a=z.yaxis,l=[],o=n[0].trace,c=n[0].t,s=o._length,h=c.x,m=c.y,b=c._scene,x=c.index;if(!b)return l;var _=f.hasText(o),A=f.hasMarkers(o),d=!A&&!_;if(o.visible!==!0||d)return l;var k=[],w=[];if(P!==!1&&!P.degenerate)for(var D=0;D{var f=sA();Y.exports={moduleType:"trace",name:"scattergl",basePlotModule:Fd(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Lk(),supplyDefaults:OX(),crossTraceDefaults:$4(),colorbar:Do(),formatLabels:BX(),calc:KX(),hoverPoints:f.hoverPoints,selectPoints:BD(),meta:{}}}),XX=It((et,Y)=>{var f=Ck();Y.exports=y,Y.exports.to=y,Y.exports.from=z;function y(P,n){n==null&&(n=!0);var i=P[0],a=P[1],l=P[2],o=P[3];o==null&&(o=n?1:255),n&&(i*=255,a*=255,l*=255,o*=255),i=f(i,0,255)&255,a=f(a,0,255)&255,l=f(l,0,255)&255,o=f(o,0,255)&255;var c=i*16777216+(a<<16)+(l<<8)+o;return c}function z(P,n){P=+P;var i=P>>>24,a=(P&16711680)>>>16,l=(P&65280)>>>8,o=P&255;return n===!1?[i,a,l,o]:[i/255,a/255,l/255,o/255]}}),Yf=It((et,Y)=>{var f=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;function P(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function n(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var o=Object.getOwnPropertyNames(a).map(function(s){return a[s]});if(o.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(s){c[s]=s}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Y.exports=n()?Object.assign:function(i,a){for(var l,o=P(i),c,s=1;s{Y.exports=function(f){typeof f=="string"&&(f=[f]);for(var y=[].slice.call(arguments,1),z=[],P=0;P{Y.exports=function(f,y,z){Array.isArray(z)||(z=[].slice.call(arguments,2));for(var P=0,n=z.length;P{Y.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),uA=It((et,Y)=>{Y.exports=z,Y.exports.float32=Y.exports.float=z,Y.exports.fract32=Y.exports.fract=y;var f=new Float32Array(1);function y(P,n){if(P.length){if(P instanceof Float32Array)return new Float32Array(P.length);n instanceof Float32Array||(n=z(P));for(var i=0,a=n.length;i{function f(C,S){var N=C==null?null:typeof Symbol<"u"&&C[Symbol.iterator]||C["@@iterator"];if(N!=null){var B,U,V,W,F=[],H=!0,q=!1;try{if(V=(N=N.call(C)).next,S!==0)for(;!(H=(B=V.call(N)).done)&&(F.push(B.value),F.length!==S);H=!0);}catch(G){q=!0,U=G}finally{try{if(!H&&N.return!=null&&(W=N.return(),Object(W)!==W))return}finally{if(q)throw U}}return F}}function y(C,S){return n(C)||f(C,S)||a(C,S)||c()}function z(C){return P(C)||i(C)||a(C)||o()}function P(C){if(Array.isArray(C))return l(C)}function n(C){if(Array.isArray(C))return C}function i(C){if(typeof Symbol<"u"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function a(C,S){if(C){if(typeof C=="string")return l(C,S);var N=Object.prototype.toString.call(C).slice(8,-1);if(N==="Object"&&C.constructor&&(N=C.constructor.name),N==="Map"||N==="Set")return Array.from(C);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return l(C,S)}}function l(C,S){(S==null||S>C.length)&&(S=C.length);for(var N=0,B=new Array(S);NMt)?ye.tree=b(ge,{bounds:ce}):Mt&&Mt.length&&(ye.tree=Mt),ye.tree){var Le={primitive:"points",usage:"static",data:ye.tree,type:"uint32"};ye.elements?ye.elements(Le):ye.elements=W.elements(Le)}var Ze=D.float32(ge);Ot({data:Ze,usage:"dynamic"});var Qe=D.fract32(ge,Ze);return Lt({data:Qe,usage:"dynamic"}),ie({data:new Uint8Array(be),type:"uint8",usage:"stream"}),ge}},{marker:function(ge,ye,ue){var Mt=ye.activation;if(Mt.forEach(function(Qe){return Qe&&Qe.destroy&&Qe.destroy()}),Mt.length=0,!ge||typeof ge[0]=="number"){var Ot=C.addMarker(ge);Mt[Ot]=!0}else{for(var Lt=[],ie=0,be=Math.min(ge.length,ye.count);ie=0)return U;var V;if(C instanceof Uint8Array||C instanceof Uint8ClampedArray)V=C;else{V=new Uint8Array(C.length);for(var W=0,F=C.length;WB*4&&(this.tooManyColors=!0),this.updatePalette(N),U.length===1?U[0]:U},M.prototype.updatePalette=function(C){if(!this.tooManyColors){var S=this.maxColors,N=this.paletteTexture,B=Math.ceil(C.length*.25/S);if(B>1){C=C.slice();for(var U=C.length*.25%S;U{Y.exports=f,Y.exports.default=f;function f(W,F,H){H=H||2;var q=F&&F.length,G=q?F[0]*H:W.length,tt=y(W,0,G,H,!0),ht=[];if(!tt||tt.next===tt.prev)return ht;var bt,vt,ut,rt,gt,it,st;if(q&&(tt=o(W,F,tt,H)),W.length>80*H){bt=ut=W[0],vt=rt=W[1];for(var xt=H;xtut&&(ut=gt),it>rt&&(rt=it);st=Math.max(ut-bt,rt-vt),st=st!==0?32767/st:0}return P(tt,ht,H,bt,vt,st,0),ht}function y(W,F,H,q,G){var tt,ht;if(G===V(W,F,H,q)>0)for(tt=F;tt=F;tt-=q)ht=N(tt,W[tt],W[tt+1],ht);return ht&&D(ht,ht.next)&&(B(ht),ht=ht.next),ht}function z(W,F){if(!W)return W;F||(F=W);var H=W,q;do if(q=!1,!H.steiner&&(D(H,H.next)||w(H.prev,H,H.next)===0)){if(B(H),H=F=H.prev,H===H.next)break;q=!0}else H=H.next;while(q||H!==F);return F}function P(W,F,H,q,G,tt,ht){if(W){!ht&&tt&&b(W,q,G,tt);for(var bt=W,vt,ut;W.prev!==W.next;){if(vt=W.prev,ut=W.next,tt?i(W,q,G,tt):n(W)){F.push(vt.i/H|0),F.push(W.i/H|0),F.push(ut.i/H|0),B(W),W=ut.next,bt=ut.next;continue}if(W=ut,W===bt){ht?ht===1?(W=a(z(W),F,H),P(W,F,H,q,G,tt,2)):ht===2&&l(W,F,H,q,G,tt):P(z(W),F,H,q,G,tt,1);break}}}}function n(W){var F=W.prev,H=W,q=W.next;if(w(F,H,q)>=0)return!1;for(var G=F.x,tt=H.x,ht=q.x,bt=F.y,vt=H.y,ut=q.y,rt=Gtt?G>ht?G:ht:tt>ht?tt:ht,st=bt>vt?bt>ut?bt:ut:vt>ut?vt:ut,xt=q.next;xt!==F;){if(xt.x>=rt&&xt.x<=it&&xt.y>=gt&&xt.y<=st&&d(G,bt,tt,vt,ht,ut,xt.x,xt.y)&&w(xt.prev,xt,xt.next)>=0)return!1;xt=xt.next}return!0}function i(W,F,H,q){var G=W.prev,tt=W,ht=W.next;if(w(G,tt,ht)>=0)return!1;for(var bt=G.x,vt=tt.x,ut=ht.x,rt=G.y,gt=tt.y,it=ht.y,st=btvt?bt>ut?bt:ut:vt>ut?vt:ut,J=rt>gt?rt>it?rt:it:gt>it?gt:it,mt=_(st,xt,F,H,q),dt=_(ot,J,F,H,q),Ct=W.prevZ,Rt=W.nextZ;Ct&&Ct.z>=mt&&Rt&&Rt.z<=dt;){if(Ct.x>=st&&Ct.x<=ot&&Ct.y>=xt&&Ct.y<=J&&Ct!==G&&Ct!==ht&&d(bt,rt,vt,gt,ut,it,Ct.x,Ct.y)&&w(Ct.prev,Ct,Ct.next)>=0||(Ct=Ct.prevZ,Rt.x>=st&&Rt.x<=ot&&Rt.y>=xt&&Rt.y<=J&&Rt!==G&&Rt!==ht&&d(bt,rt,vt,gt,ut,it,Rt.x,Rt.y)&&w(Rt.prev,Rt,Rt.next)>=0))return!1;Rt=Rt.nextZ}for(;Ct&&Ct.z>=mt;){if(Ct.x>=st&&Ct.x<=ot&&Ct.y>=xt&&Ct.y<=J&&Ct!==G&&Ct!==ht&&d(bt,rt,vt,gt,ut,it,Ct.x,Ct.y)&&w(Ct.prev,Ct,Ct.next)>=0)return!1;Ct=Ct.prevZ}for(;Rt&&Rt.z<=dt;){if(Rt.x>=st&&Rt.x<=ot&&Rt.y>=xt&&Rt.y<=J&&Rt!==G&&Rt!==ht&&d(bt,rt,vt,gt,ut,it,Rt.x,Rt.y)&&w(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.nextZ}return!0}function a(W,F,H){var q=W;do{var G=q.prev,tt=q.next.next;!D(G,tt)&&E(G,q,q.next,tt)&&g(G,tt)&&g(tt,G)&&(F.push(G.i/H|0),F.push(q.i/H|0),F.push(tt.i/H|0),B(q),B(q.next),q=W=tt),q=q.next}while(q!==W);return z(q)}function l(W,F,H,q,G,tt){var ht=W;do{for(var bt=ht.next.next;bt!==ht.prev;){if(ht.i!==bt.i&&k(ht,bt)){var vt=S(ht,bt);ht=z(ht,ht.next),vt=z(vt,vt.next),P(ht,F,H,q,G,tt,0),P(vt,F,H,q,G,tt,0);return}bt=bt.next}ht=ht.next}while(ht!==W)}function o(W,F,H,q){var G=[],tt,ht,bt,vt,ut;for(tt=0,ht=F.length;tt=H.next.y&&H.next.y!==H.y){var bt=H.x+(G-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(bt<=q&&bt>tt&&(tt=bt,ht=H.x=H.x&&H.x>=ut&&q!==H.x&&d(Ght.x||H.x===ht.x&&m(ht,H)))&&(ht=H,gt=it)),H=H.next;while(H!==vt);return ht}function m(W,F){return w(W.prev,W,F.prev)<0&&w(F.next,W,W.next)<0}function b(W,F,H,q){var G=W;do G.z===0&&(G.z=_(G.x,G.y,F,H,q)),G.prevZ=G.prev,G.nextZ=G.next,G=G.next;while(G!==W);G.prevZ.nextZ=null,G.prevZ=null,x(G)}function x(W){var F,H,q,G,tt,ht,bt,vt,ut=1;do{for(H=W,W=null,tt=null,ht=0;H;){for(ht++,q=H,bt=0,F=0;F0||vt>0&&q;)bt!==0&&(vt===0||!q||H.z<=q.z)?(G=H,H=H.nextZ,bt--):(G=q,q=q.nextZ,vt--),tt?tt.nextZ=G:W=G,G.prevZ=tt,tt=G;H=q}tt.nextZ=null,ut*=2}while(ht>1);return W}function _(W,F,H,q,G){return W=(W-H)*G|0,F=(F-q)*G|0,W=(W|W<<8)&16711935,W=(W|W<<4)&252645135,W=(W|W<<2)&858993459,W=(W|W<<1)&1431655765,F=(F|F<<8)&16711935,F=(F|F<<4)&252645135,F=(F|F<<2)&858993459,F=(F|F<<1)&1431655765,W|F<<1}function A(W){var F=W,H=W;do(F.x=(W-ht)*(tt-bt)&&(W-ht)*(q-bt)>=(H-ht)*(F-bt)&&(H-ht)*(tt-bt)>=(G-ht)*(q-bt)}function k(W,F){return W.next.i!==F.i&&W.prev.i!==F.i&&!p(W,F)&&(g(W,F)&&g(F,W)&&C(W,F)&&(w(W.prev,W,F.prev)||w(W,F.prev,F))||D(W,F)&&w(W.prev,W,W.next)>0&&w(F.prev,F,F.next)>0)}function w(W,F,H){return(F.y-W.y)*(H.x-F.x)-(F.x-W.x)*(H.y-F.y)}function D(W,F){return W.x===F.x&&W.y===F.y}function E(W,F,H,q){var G=M(w(W,F,H)),tt=M(w(W,F,q)),ht=M(w(H,q,W)),bt=M(w(H,q,F));return!!(G!==tt&&ht!==bt||G===0&&I(W,H,F)||tt===0&&I(W,q,F)||ht===0&&I(H,W,q)||bt===0&&I(H,F,q))}function I(W,F,H){return F.x<=Math.max(W.x,H.x)&&F.x>=Math.min(W.x,H.x)&&F.y<=Math.max(W.y,H.y)&&F.y>=Math.min(W.y,H.y)}function M(W){return W>0?1:W<0?-1:0}function p(W,F){var H=W;do{if(H.i!==W.i&&H.next.i!==W.i&&H.i!==F.i&&H.next.i!==F.i&&E(H,H.next,W,F))return!0;H=H.next}while(H!==W);return!1}function g(W,F){return w(W.prev,W,W.next)<0?w(W,F,W.next)>=0&&w(W,W.prev,F)>=0:w(W,F,W.prev)<0||w(W,W.next,F)<0}function C(W,F){var H=W,q=!1,G=(W.x+F.x)/2,tt=(W.y+F.y)/2;do H.y>tt!=H.next.y>tt&&H.next.y!==H.y&&G<(H.next.x-H.x)*(tt-H.y)/(H.next.y-H.y)+H.x&&(q=!q),H=H.next;while(H!==W);return q}function S(W,F){var H=new U(W.i,W.x,W.y),q=new U(F.i,F.x,F.y),G=W.next,tt=F.prev;return W.next=F,F.prev=W,H.next=G,G.prev=H,q.next=H,H.prev=q,tt.next=q,q.prev=tt,q}function N(W,F,H,q){var G=new U(W,F,H);return q?(G.next=q.next,G.prev=q,q.next.prev=G,q.next=G):(G.prev=G,G.next=G),G}function B(W){W.next.prev=W.prev,W.prev.next=W.next,W.prevZ&&(W.prevZ.nextZ=W.nextZ),W.nextZ&&(W.nextZ.prevZ=W.prevZ)}function U(W,F,H){this.i=W,this.x=F,this.y=H,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}f.deviation=function(W,F,H,q){var G=F&&F.length,tt=G?F[0]*H:W.length,ht=Math.abs(V(W,0,tt,H));if(G)for(var bt=0,vt=F.length;bt0&&(q+=W[G-1].length,H.holes.push(q))}return H}}),eJ=It((et,Y)=>{var f=Ib();Y.exports=y;function y(z,P,n){if(!z||z.length==null)throw Error("Argument should be an array");P==null&&(P=1),n==null&&(n=f(z,P));for(var i=0;i{Y.exports=function(){var f,y;if(typeof WeakMap!="function")return!1;try{f=new WeakMap([[y={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(f)!=="[object WeakMap]"||typeof f.set!="function"||f.set({},1)!==f||typeof f.delete!="function"||typeof f.has!="function"||f.get(y)!=="one")}}),nJ=It((et,Y)=>{Y.exports=function(){}}),Z_=It((et,Y)=>{var f=nJ()();Y.exports=function(y){return y!==f&&y!==null}}),ND=It((et,Y)=>{var f=Object.create,y=Object.getPrototypeOf,z={};Y.exports=function(){var P=Object.setPrototypeOf,n=arguments[0]||f;return typeof P!="function"?!1:y(P(n(null),z))===z}}),jD=It((et,Y)=>{var f=Z_(),y={function:!0,object:!0};Y.exports=function(z){return f(z)&&y[typeof z]||!1}}),fy=It((et,Y)=>{var f=Z_();Y.exports=function(y){if(!f(y))throw new TypeError("Cannot use null or undefined");return y}}),iJ=It((et,Y)=>{var f=Object.create,y;ND()()||(y=UD()),Y.exports=function(){var z,P,n;return!y||y.level!==1?f:(z={},P={},n={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(i){if(i==="__proto__"){P[i]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}P[i]=n}),Object.defineProperties(z,P),Object.defineProperty(y,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:z}),function(i,a){return f(i===null?z:i,a)})}()}),UD=It((et,Y)=>{var f=jD(),y=fy(),z=Object.prototype.isPrototypeOf,P=Object.defineProperty,n={configurable:!0,enumerable:!1,writable:!0,value:void 0},i;i=function(a,l){if(y(a),l===null||f(l))return a;throw new TypeError("Prototype must be null or an object")},Y.exports=function(a){var l,o;return a?(a.level===2?a.set?(o=a.set,l=function(c,s){return o.call(i(c,s),s),c}):l=function(c,s){return i(c,s).__proto__=s,c}:l=function c(s,h){var m;return i(s,h),m=z.call(c.nullPolyfill,s),m&&delete c.nullPolyfill.__proto__,h===null&&(h=c.nullPolyfill),s.__proto__=h,m&&P(c.nullPolyfill,"__proto__",n),s},Object.defineProperty(l,"level",{configurable:!1,enumerable:!1,writable:!1,value:a.level})):null}(function(){var a=Object.create(null),l={},o,c=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(c){try{o=c.set,o.call(a,l)}catch{}if(Object.getPrototypeOf(a)===l)return{set:o,level:2}}return a.__proto__=l,Object.getPrototypeOf(a)===l?{level:2}:(a={},a.__proto__=l,Object.getPrototypeOf(a)===l?{level:1}:!1)}()),iJ()}),hA=It((et,Y)=>{Y.exports=ND()()?Object.setPrototypeOf:UD()}),aJ=It((et,Y)=>{var f=jD();Y.exports=function(y){if(!f(y))throw new TypeError(y+" is not an Object");return y}}),oJ=It((et,Y)=>{var f=Object.create(null),y=Math.random;Y.exports=function(){var z;do z=y().toString(36).slice(2);while(f[z]);return z}}),Ob=It((et,Y)=>{var f=void 0;Y.exports=function(y){return y!==f&&y!==null}}),dA=It((et,Y)=>{var f=Ob(),y={object:!0,function:!0,undefined:!0};Y.exports=function(z){return f(z)?hasOwnProperty.call(y,typeof z):!1}}),sJ=It((et,Y)=>{var f=dA();Y.exports=function(y){if(!f(y))return!1;try{return y.constructor?y.constructor.prototype===y:!1}catch{return!1}}}),lJ=It((et,Y)=>{var f=sJ();Y.exports=function(y){if(typeof y!="function"||!hasOwnProperty.call(y,"length"))return!1;try{if(typeof y.length!="number"||typeof y.call!="function"||typeof y.apply!="function")return!1}catch{return!1}return!f(y)}}),$D=It((et,Y)=>{var f=lJ(),y=/^\s*class[\s{/}]/,z=Function.prototype.toString;Y.exports=function(P){return!(!f(P)||y.test(z.call(P)))}}),cJ=It((et,Y)=>{Y.exports=function(){var f=Object.assign,y;return typeof f!="function"?!1:(y={foo:"raz"},f(y,{bar:"dwa"},{trzy:"trzy"}),y.foo+y.bar+y.trzy==="razdwatrzy")}}),uJ=It((et,Y)=>{Y.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),hJ=It((et,Y)=>{var f=Z_(),y=Object.keys;Y.exports=function(z){return y(f(z)?Object(z):z)}}),dJ=It((et,Y)=>{Y.exports=uJ()()?Object.keys:hJ()}),fJ=It((et,Y)=>{var f=dJ(),y=fy(),z=Math.max;Y.exports=function(P,n){var i,a,l=z(arguments.length,2),o;for(P=Object(y(P)),o=function(c){try{P[c]=n[c]}catch(s){i||(i=s)}},a=1;a{Y.exports=cJ()()?Object.assign:fJ()}),HD=It((et,Y)=>{var f=Z_(),y=Array.prototype.forEach,z=Object.create,P=function(n,i){var a;for(a in n)i[a]=n[a]};Y.exports=function(n){var i=z(null);return y.call(arguments,function(a){f(a)&&P(Object(a),i)}),i}}),pJ=It((et,Y)=>{var f="razdwatrzy";Y.exports=function(){return typeof f.contains!="function"?!1:f.contains("dwa")===!0&&f.contains("foo")===!1}}),mJ=It((et,Y)=>{var f=String.prototype.indexOf;Y.exports=function(y){return f.call(this,y,arguments[1])>-1}}),VD=It((et,Y)=>{Y.exports=pJ()()?String.prototype.contains:mJ()}),py=It((et,Y)=>{var f=Ob(),y=$D(),z=fA(),P=HD(),n=VD(),i=Y.exports=function(a,l){var o,c,s,h,m;return arguments.length<2||typeof a!="string"?(h=l,l=a,a=null):h=arguments[2],f(a)?(o=n.call(a,"c"),c=n.call(a,"e"),s=n.call(a,"w")):(o=s=!0,c=!1),m={value:l,configurable:o,enumerable:c,writable:s},h?z(P(h),m):m};i.gs=function(a,l,o){var c,s,h,m;return typeof a!="string"?(h=o,o=l,l=a,a=null):h=arguments[3],f(l)?y(l)?f(o)?y(o)||(h=o,o=void 0):o=void 0:(h=l,l=o=void 0):l=void 0,f(a)?(c=n.call(a,"c"),s=n.call(a,"e")):(c=!0,s=!1),m={get:l,set:o,configurable:c,enumerable:s},h?z(P(h),m):m}}),Pk=It((et,Y)=>{var f=Object.prototype.toString,y=f.call(function(){return arguments}());Y.exports=function(z){return f.call(z)===y}}),Ik=It((et,Y)=>{var f=Object.prototype.toString,y=f.call("");Y.exports=function(z){return typeof z=="string"||z&&typeof z=="object"&&(z instanceof String||f.call(z)===y)||!1}}),gJ=It((et,Y)=>{Y.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),vJ=It((et,Y)=>{var f=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};Y.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return f()}try{return __global__||f()}finally{delete Object.prototype.__global__}}()}),Dk=It((et,Y)=>{Y.exports=gJ()()?globalThis:vJ()}),yJ=It((et,Y)=>{var f=Dk(),y={object:!0,symbol:!0};Y.exports=function(){var z=f.Symbol,P;if(typeof z!="function")return!1;P=z("test symbol");try{String(P)}catch{return!1}return!(!y[typeof z.iterator]||!y[typeof z.toPrimitive]||!y[typeof z.toStringTag])}}),_J=It((et,Y)=>{Y.exports=function(f){return f?typeof f=="symbol"?!0:!f.constructor||f.constructor.name!=="Symbol"?!1:f[f.constructor.toStringTag]==="Symbol":!1}}),WD=It((et,Y)=>{var f=_J();Y.exports=function(y){if(!f(y))throw new TypeError(y+" is not a symbol");return y}}),xJ=It((et,Y)=>{var f=py(),y=Object.create,z=Object.defineProperty,P=Object.prototype,n=y(null);Y.exports=function(i){for(var a=0,l,o;n[i+(a||"")];)++a;return i+=a||"",n[i]=!0,l="@@"+i,z(P,l,f.gs(null,function(c){o||(o=!0,z(this,l,f(c)),o=!1)})),l}}),bJ=It((et,Y)=>{var f=py(),y=Dk().Symbol;Y.exports=function(z){return Object.defineProperties(z,{hasInstance:f("",y&&y.hasInstance||z("hasInstance")),isConcatSpreadable:f("",y&&y.isConcatSpreadable||z("isConcatSpreadable")),iterator:f("",y&&y.iterator||z("iterator")),match:f("",y&&y.match||z("match")),replace:f("",y&&y.replace||z("replace")),search:f("",y&&y.search||z("search")),species:f("",y&&y.species||z("species")),split:f("",y&&y.split||z("split")),toPrimitive:f("",y&&y.toPrimitive||z("toPrimitive")),toStringTag:f("",y&&y.toStringTag||z("toStringTag")),unscopables:f("",y&&y.unscopables||z("unscopables"))})}}),wJ=It((et,Y)=>{var f=py(),y=WD(),z=Object.create(null);Y.exports=function(P){return Object.defineProperties(P,{for:f(function(n){return z[n]?z[n]:z[n]=P(String(n))}),keyFor:f(function(n){var i;y(n);for(i in z)if(z[i]===n)return i})})}}),kJ=It((et,Y)=>{var f=py(),y=WD(),z=Dk().Symbol,P=xJ(),n=bJ(),i=wJ(),a=Object.create,l=Object.defineProperties,o=Object.defineProperty,c,s,h;if(typeof z=="function")try{String(z()),h=!0}catch{}else z=null;s=function(m){if(this instanceof s)throw new TypeError("Symbol is not a constructor");return c(m)},Y.exports=c=function m(b){var x;if(this instanceof m)throw new TypeError("Symbol is not a constructor");return h?z(b):(x=a(s.prototype),b=b===void 0?"":String(b),l(x,{__description__:f("",b),__name__:f("",P(b))}))},n(c),i(c),l(s.prototype,{constructor:f(c),toString:f("",function(){return this.__name__})}),l(c.prototype,{toString:f(function(){return"Symbol ("+y(this).__description__+")"}),valueOf:f(function(){return y(this)})}),o(c.prototype,c.toPrimitive,f("",function(){var m=y(this);return typeof m=="symbol"?m:m.toString()})),o(c.prototype,c.toStringTag,f("c","Symbol")),o(s.prototype,c.toStringTag,f("c",c.prototype[c.toStringTag])),o(s.prototype,c.toPrimitive,f("c",c.prototype[c.toPrimitive]))}),K_=It((et,Y)=>{Y.exports=yJ()()?Dk().Symbol:kJ()}),TJ=It((et,Y)=>{var f=fy();Y.exports=function(){return f(this).length=0,this}}),Xw=It((et,Y)=>{Y.exports=function(f){if(typeof f!="function")throw new TypeError(f+" is not a function");return f}}),SJ=It((et,Y)=>{var f=Ob(),y=dA(),z=Object.prototype.toString;Y.exports=function(P){if(!f(P))return null;if(y(P)){var n=P.toString;if(typeof n!="function"||n===z)return null}try{return""+P}catch{return null}}}),CJ=It((et,Y)=>{Y.exports=function(f){try{return f.toString()}catch{try{return String(f)}catch{return null}}}}),AJ=It((et,Y)=>{var f=CJ(),y=/[\n\r\u2028\u2029]/g;Y.exports=function(z){var P=f(z);return P===null?"":(P.length>100&&(P=P.slice(0,99)+"…"),P=P.replace(y,function(n){switch(n){case` -`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),P)}}),qD=It((et,Y)=>{var f=Ob(),y=dA(),z=SJ(),P=AJ(),n=function(i,a){return i.replace("%v",P(a))};Y.exports=function(i,a,l){if(!y(l))throw new TypeError(n(a,i));if(!f(i)){if("default"in l)return l.default;if(l.isOptional)return null}var o=z(l.errorMessage);throw f(o)||(o=a),new TypeError(n(o,i))}}),MJ=It((et,Y)=>{var f=qD(),y=Ob();Y.exports=function(z){return y(z)?z:f(z,"Cannot use %v",arguments[1])}}),EJ=It((et,Y)=>{var f=qD(),y=$D();Y.exports=function(z){return y(z)?z:f(z,"%v is not a plain function",arguments[1])}}),LJ=It((et,Y)=>{Y.exports=function(){var f=Array.from,y,z;return typeof f!="function"?!1:(y=["raz","dwa"],z=f(y),!!(z&&z!==y&&z[1]==="dwa"))}}),PJ=It((et,Y)=>{var f=Object.prototype.toString,y=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);Y.exports=function(z){return typeof z=="function"&&y(f.call(z))}}),IJ=It((et,Y)=>{Y.exports=function(){var f=Math.sign;return typeof f!="function"?!1:f(10)===1&&f(-20)===-1}}),DJ=It((et,Y)=>{Y.exports=function(f){return f=Number(f),isNaN(f)||f===0?f:f>0?1:-1}}),zJ=It((et,Y)=>{Y.exports=IJ()()?Math.sign:DJ()}),OJ=It((et,Y)=>{var f=zJ(),y=Math.abs,z=Math.floor;Y.exports=function(P){return isNaN(P)?0:(P=Number(P),P===0||!isFinite(P)?P:f(P)*z(y(P)))}}),BJ=It((et,Y)=>{var f=OJ(),y=Math.max;Y.exports=function(z){return y(0,f(z))}}),RJ=It((et,Y)=>{var f=K_().iterator,y=Pk(),z=PJ(),P=BJ(),n=Xw(),i=fy(),a=Z_(),l=Ik(),o=Array.isArray,c=Function.prototype.call,s={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;Y.exports=function(m){var b=arguments[1],x=arguments[2],_,A,d,k,w,D,E,I,M,p;if(m=Object(i(m)),a(b)&&n(b),!this||this===Array||!z(this)){if(!b){if(y(m))return w=m.length,w!==1?Array.apply(null,m):(k=new Array(1),k[0]=m[0],k);if(o(m)){for(k=new Array(w=m.length),A=0;A=55296&&D<=56319&&(p+=m[++A])),p=b?c.call(b,x,p,d):p,_?(s.value=p,h(k,d,s)):k[d]=p,++d;w=d}}if(w===void 0)for(w=P(m.length),_&&(k=new _(w)),A=0;A{Y.exports=LJ()()?Array.from:RJ()}),NJ=It((et,Y)=>{var f=FJ(),y=fA(),z=fy();Y.exports=function(P){var n=Object(z(P)),i=arguments[1],a=Object(arguments[2]);if(n!==P&&!i)return n;var l={};return i?f(i,function(o){(a.ensure||o in P)&&(l[o]=P[o])}):y(l,P),l}}),jJ=It((et,Y)=>{var f=Xw(),y=fy(),z=Function.prototype.bind,P=Function.prototype.call,n=Object.keys,i=Object.prototype.propertyIsEnumerable;Y.exports=function(a,l){return function(o,c){var s,h=arguments[2],m=arguments[3];return o=Object(y(o)),f(c),s=n(o),m&&s.sort(typeof m=="function"?z.call(m,o):void 0),typeof a!="function"&&(a=s[a]),P.call(a,s,function(b,x){return i.call(o,b)?P.call(c,h,o[b],b,o,x):l})}}}),UJ=It((et,Y)=>{Y.exports=jJ()("forEach")}),$J=It((et,Y)=>{var f=Xw(),y=UJ(),z=Function.prototype.call;Y.exports=function(P,n){var i={},a=arguments[2];return f(n),y(P,function(l,o,c,s){i[o]=z.call(n,a,l,o,c,s)}),i}}),HJ=It((et,Y)=>{var f=Ob(),y=MJ(),z=EJ(),P=NJ(),n=HD(),i=$J(),a=Function.prototype.bind,l=Object.defineProperty,o=Object.prototype.hasOwnProperty,c;c=function(s,h,m){var b=y(h)&&z(h.value),x;return x=P(h),delete x.writable,delete x.value,x.get=function(){return!m.overwriteDefinition&&o.call(this,s)?b:(h.value=a.call(b,m.resolveContext?m.resolveContext(this):this),l(this,s,h),this[s])},x},Y.exports=function(s){var h=n(arguments[1]);return f(h.resolveContext)&&z(h.resolveContext),i(s,function(m,b){return c(b,m,h)})}}),GD=It((et,Y)=>{var f=TJ(),y=fA(),z=Xw(),P=fy(),n=py(),i=HJ(),a=K_(),l=Object.defineProperty,o=Object.defineProperties,c;Y.exports=c=function(s,h){if(!(this instanceof c))throw new TypeError("Constructor requires 'new'");o(this,{__list__:n("w",P(s)),__context__:n("w",h),__nextIndex__:n("w",0)}),h&&(z(h.on),h.on("_add",this._onAdd),h.on("_delete",this._onDelete),h.on("_clear",this._onClear))},delete c.prototype.constructor,o(c.prototype,y({_next:n(function(){var s;if(this.__list__){if(this.__redo__&&(s=this.__redo__.shift(),s!==void 0))return s;if(this.__nextIndex__=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){l(this,"__redo__",n("c",[s]));return}this.__redo__.forEach(function(h,m){h>=s&&(this.__redo__[m]=++h)},this),this.__redo__.push(s)}}),_onDelete:n(function(s){var h;s>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(h=this.__redo__.indexOf(s),h!==-1&&this.__redo__.splice(h,1),this.__redo__.forEach(function(m,b){m>s&&(this.__redo__[b]=--m)},this)))}),_onClear:n(function(){this.__redo__&&f.call(this.__redo__),this.__nextIndex__=0})}))),l(c.prototype,a.iterator,n(function(){return this}))}),VJ=It((et,Y)=>{var f=hA(),y=VD(),z=py(),P=K_(),n=GD(),i=Object.defineProperty,a;a=Y.exports=function(l,o){if(!(this instanceof a))throw new TypeError("Constructor requires 'new'");n.call(this,l),o?y.call(o,"key+value")?o="key+value":y.call(o,"key")?o="key":o="value":o="value",i(this,"__kind__",z("",o))},f&&f(a,n),delete a.prototype.constructor,a.prototype=Object.create(n.prototype,{_resolve:z(function(l){return this.__kind__==="value"?this.__list__[l]:this.__kind__==="key+value"?[l,this.__list__[l]]:l})}),i(a.prototype,P.toStringTag,z("c","Array Iterator"))}),WJ=It((et,Y)=>{var f=hA(),y=py(),z=K_(),P=GD(),n=Object.defineProperty,i;i=Y.exports=function(a){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");a=String(a),P.call(this,a),n(this,"__length__",y("",a.length))},f&&f(i,P),delete i.prototype.constructor,i.prototype=Object.create(P.prototype,{_next:y(function(){if(this.__list__){if(this.__nextIndex__=55296&&o<=56319?l+this.__list__[this.__nextIndex__++]:l)})}),n(i.prototype,z.toStringTag,y("c","String Iterator"))}),qJ=It((et,Y)=>{var f=Pk(),y=Z_(),z=Ik(),P=K_().iterator,n=Array.isArray;Y.exports=function(i){return y(i)?n(i)||z(i)||f(i)?!0:typeof i[P]=="function":!1}}),GJ=It((et,Y)=>{var f=qJ();Y.exports=function(y){if(!f(y))throw new TypeError(y+" is not iterable");return y}}),ZD=It((et,Y)=>{var f=Pk(),y=Ik(),z=VJ(),P=WJ(),n=GJ(),i=K_().iterator;Y.exports=function(a){return typeof n(a)[i]=="function"?a[i]():f(a)?new z(a):y(a)?new P(a):new z(a)}}),ZJ=It((et,Y)=>{var f=Pk(),y=Xw(),z=Ik(),P=ZD(),n=Array.isArray,i=Function.prototype.call,a=Array.prototype.some;Y.exports=function(l,o){var c,s=arguments[2],h,m,b,x,_,A,d;if(n(l)||f(l)?c="array":z(l)?c="string":l=P(l),y(o),m=function(){b=!0},c==="array"){a.call(l,function(k){return i.call(o,s,k,m),b});return}if(c==="string"){for(_=l.length,x=0;x<_&&(A=l[x],x+1<_&&(d=A.charCodeAt(0),d>=55296&&d<=56319&&(A+=l[++x])),i.call(o,s,A,m),!b);++x);return}for(h=l.next();!h.done;){if(i.call(o,s,h.value,m),b)return;h=l.next()}}}),KJ=It((et,Y)=>{Y.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}),YJ=It((et,Y)=>{var f=Z_(),y=hA(),z=aJ(),P=fy(),n=oJ(),i=py(),a=ZD(),l=ZJ(),o=K_().toStringTag,c=KJ(),s=Array.isArray,h=Object.defineProperty,m=Object.prototype.hasOwnProperty,b=Object.getPrototypeOf,x;Y.exports=x=function(){var _=arguments[0],A;if(!(this instanceof x))throw new TypeError("Constructor requires 'new'");return A=c&&y&&WeakMap!==x?y(new WeakMap,b(this)):this,f(_)&&(s(_)||(_=a(_))),h(A,"__weakMapData__",i("c","$weakMap$"+n())),_&&l(_,function(d){P(d),A.set(d[0],d[1])}),A},c&&(y&&y(x,WeakMap),x.prototype=Object.create(WeakMap.prototype,{constructor:i(x)})),Object.defineProperties(x.prototype,{delete:i(function(_){return m.call(z(_),this.__weakMapData__)?(delete _[this.__weakMapData__],!0):!1}),get:i(function(_){if(m.call(z(_),this.__weakMapData__))return _[this.__weakMapData__]}),has:i(function(_){return m.call(z(_),this.__weakMapData__)}),set:i(function(_,A){return h(z(_),this.__weakMapData__,i("c",A)),this}),toString:i(function(){return"[object WeakMap]"})}),h(x.prototype,o,i("c","WeakMap"))}),KD=It((et,Y)=>{Y.exports=rJ()()?WeakMap:YJ()}),XJ=It((et,Y)=>{Y.exports=function(f,y,z){if(typeof Array.prototype.findIndex=="function")return f.findIndex(y,z);if(typeof y!="function")throw new TypeError("predicate must be a function");var P=Object(f),n=P.length;if(n===0)return-1;for(var i=0;i{var f=H_(),y=Ib(),z=Yf(),P=t1(),n=Db(),i=tJ(),a=eJ(),{float32:l,fract32:o}=uA(),c=KD(),s=Yw(),h=XJ(),m=` +`]),w&&(vt.frag=vt.frag.replace("smoothstep","smoothStep"),bt.frag=bt.frag.replace("smoothstep","smoothStep")),this.drawCircle=C(vt)}M.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},M.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},M.prototype.draw=function(){for(var C=this,S=arguments.length,N=new Array(S),B=0;BMt)?ye.tree=b(ge,{bounds:ce}):Mt&&Mt.length&&(ye.tree=Mt),ye.tree){var Le={primitive:"points",usage:"static",data:ye.tree,type:"uint32"};ye.elements?ye.elements(Le):ye.elements=W.elements(Le)}var Ze=D.float32(ge);Ot({data:Ze,usage:"dynamic"});var Qe=D.fract32(ge,Ze);return Lt({data:Qe,usage:"dynamic"}),ie({data:new Uint8Array(be),type:"uint8",usage:"stream"}),ge}},{marker:function(ge,ye,ue){var Mt=ye.activation;if(Mt.forEach(function(Qe){return Qe&&Qe.destroy&&Qe.destroy()}),Mt.length=0,!ge||typeof ge[0]=="number"){var Ot=C.addMarker(ge);Mt[Ot]=!0}else{for(var Lt=[],ie=0,be=Math.min(ge.length,ye.count);ie=0)return U;var V;if(C instanceof Uint8Array||C instanceof Uint8ClampedArray)V=C;else{V=new Uint8Array(C.length);for(var W=0,F=C.length;WB*4&&(this.tooManyColors=!0),this.updatePalette(N),U.length===1?U[0]:U},M.prototype.updatePalette=function(C){if(!this.tooManyColors){var S=this.maxColors,N=this.paletteTexture,B=Math.ceil(C.length*.25/S);if(B>1){C=C.slice();for(var U=C.length*.25%S;U{Y.exports=f,Y.exports.default=f;function f(W,F,H){H=H||2;var q=F&&F.length,G=q?F[0]*H:W.length,tt=y(W,0,G,H,!0),ht=[];if(!tt||tt.next===tt.prev)return ht;var bt,vt,ut,rt,gt,it,st;if(q&&(tt=o(W,F,tt,H)),W.length>80*H){bt=ut=W[0],vt=rt=W[1];for(var xt=H;xtut&&(ut=gt),it>rt&&(rt=it);st=Math.max(ut-bt,rt-vt),st=st!==0?32767/st:0}return P(tt,ht,H,bt,vt,st,0),ht}function y(W,F,H,q,G){var tt,ht;if(G===V(W,F,H,q)>0)for(tt=F;tt=F;tt-=q)ht=N(tt,W[tt],W[tt+1],ht);return ht&&D(ht,ht.next)&&(B(ht),ht=ht.next),ht}function z(W,F){if(!W)return W;F||(F=W);var H=W,q;do if(q=!1,!H.steiner&&(D(H,H.next)||w(H.prev,H,H.next)===0)){if(B(H),H=F=H.prev,H===H.next)break;q=!0}else H=H.next;while(q||H!==F);return F}function P(W,F,H,q,G,tt,ht){if(W){!ht&&tt&&b(W,q,G,tt);for(var bt=W,vt,ut;W.prev!==W.next;){if(vt=W.prev,ut=W.next,tt?i(W,q,G,tt):n(W)){F.push(vt.i/H|0),F.push(W.i/H|0),F.push(ut.i/H|0),B(W),W=ut.next,bt=ut.next;continue}if(W=ut,W===bt){ht?ht===1?(W=a(z(W),F,H),P(W,F,H,q,G,tt,2)):ht===2&&l(W,F,H,q,G,tt):P(z(W),F,H,q,G,tt,1);break}}}}function n(W){var F=W.prev,H=W,q=W.next;if(w(F,H,q)>=0)return!1;for(var G=F.x,tt=H.x,ht=q.x,bt=F.y,vt=H.y,ut=q.y,rt=Gtt?G>ht?G:ht:tt>ht?tt:ht,st=bt>vt?bt>ut?bt:ut:vt>ut?vt:ut,xt=q.next;xt!==F;){if(xt.x>=rt&&xt.x<=it&&xt.y>=gt&&xt.y<=st&&d(G,bt,tt,vt,ht,ut,xt.x,xt.y)&&w(xt.prev,xt,xt.next)>=0)return!1;xt=xt.next}return!0}function i(W,F,H,q){var G=W.prev,tt=W,ht=W.next;if(w(G,tt,ht)>=0)return!1;for(var bt=G.x,vt=tt.x,ut=ht.x,rt=G.y,gt=tt.y,it=ht.y,st=btvt?bt>ut?bt:ut:vt>ut?vt:ut,J=rt>gt?rt>it?rt:it:gt>it?gt:it,mt=_(st,xt,F,H,q),dt=_(ot,J,F,H,q),Ct=W.prevZ,Rt=W.nextZ;Ct&&Ct.z>=mt&&Rt&&Rt.z<=dt;){if(Ct.x>=st&&Ct.x<=ot&&Ct.y>=xt&&Ct.y<=J&&Ct!==G&&Ct!==ht&&d(bt,rt,vt,gt,ut,it,Ct.x,Ct.y)&&w(Ct.prev,Ct,Ct.next)>=0||(Ct=Ct.prevZ,Rt.x>=st&&Rt.x<=ot&&Rt.y>=xt&&Rt.y<=J&&Rt!==G&&Rt!==ht&&d(bt,rt,vt,gt,ut,it,Rt.x,Rt.y)&&w(Rt.prev,Rt,Rt.next)>=0))return!1;Rt=Rt.nextZ}for(;Ct&&Ct.z>=mt;){if(Ct.x>=st&&Ct.x<=ot&&Ct.y>=xt&&Ct.y<=J&&Ct!==G&&Ct!==ht&&d(bt,rt,vt,gt,ut,it,Ct.x,Ct.y)&&w(Ct.prev,Ct,Ct.next)>=0)return!1;Ct=Ct.prevZ}for(;Rt&&Rt.z<=dt;){if(Rt.x>=st&&Rt.x<=ot&&Rt.y>=xt&&Rt.y<=J&&Rt!==G&&Rt!==ht&&d(bt,rt,vt,gt,ut,it,Rt.x,Rt.y)&&w(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.nextZ}return!0}function a(W,F,H){var q=W;do{var G=q.prev,tt=q.next.next;!D(G,tt)&&E(G,q,q.next,tt)&&g(G,tt)&&g(tt,G)&&(F.push(G.i/H|0),F.push(q.i/H|0),F.push(tt.i/H|0),B(q),B(q.next),q=W=tt),q=q.next}while(q!==W);return z(q)}function l(W,F,H,q,G,tt){var ht=W;do{for(var bt=ht.next.next;bt!==ht.prev;){if(ht.i!==bt.i&&k(ht,bt)){var vt=S(ht,bt);ht=z(ht,ht.next),vt=z(vt,vt.next),P(ht,F,H,q,G,tt,0),P(vt,F,H,q,G,tt,0);return}bt=bt.next}ht=ht.next}while(ht!==W)}function o(W,F,H,q){var G=[],tt,ht,bt,vt,ut;for(tt=0,ht=F.length;tt=H.next.y&&H.next.y!==H.y){var bt=H.x+(G-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(bt<=q&&bt>tt&&(tt=bt,ht=H.x=H.x&&H.x>=ut&&q!==H.x&&d(Ght.x||H.x===ht.x&&m(ht,H)))&&(ht=H,gt=it)),H=H.next;while(H!==vt);return ht}function m(W,F){return w(W.prev,W,F.prev)<0&&w(F.next,W,W.next)<0}function b(W,F,H,q){var G=W;do G.z===0&&(G.z=_(G.x,G.y,F,H,q)),G.prevZ=G.prev,G.nextZ=G.next,G=G.next;while(G!==W);G.prevZ.nextZ=null,G.prevZ=null,x(G)}function x(W){var F,H,q,G,tt,ht,bt,vt,ut=1;do{for(H=W,W=null,tt=null,ht=0;H;){for(ht++,q=H,bt=0,F=0;F0||vt>0&&q;)bt!==0&&(vt===0||!q||H.z<=q.z)?(G=H,H=H.nextZ,bt--):(G=q,q=q.nextZ,vt--),tt?tt.nextZ=G:W=G,G.prevZ=tt,tt=G;H=q}tt.nextZ=null,ut*=2}while(ht>1);return W}function _(W,F,H,q,G){return W=(W-H)*G|0,F=(F-q)*G|0,W=(W|W<<8)&16711935,W=(W|W<<4)&252645135,W=(W|W<<2)&858993459,W=(W|W<<1)&1431655765,F=(F|F<<8)&16711935,F=(F|F<<4)&252645135,F=(F|F<<2)&858993459,F=(F|F<<1)&1431655765,W|F<<1}function A(W){var F=W,H=W;do(F.x=(W-ht)*(tt-bt)&&(W-ht)*(q-bt)>=(H-ht)*(F-bt)&&(H-ht)*(tt-bt)>=(G-ht)*(q-bt)}function k(W,F){return W.next.i!==F.i&&W.prev.i!==F.i&&!p(W,F)&&(g(W,F)&&g(F,W)&&C(W,F)&&(w(W.prev,W,F.prev)||w(W,F.prev,F))||D(W,F)&&w(W.prev,W,W.next)>0&&w(F.prev,F,F.next)>0)}function w(W,F,H){return(F.y-W.y)*(H.x-F.x)-(F.x-W.x)*(H.y-F.y)}function D(W,F){return W.x===F.x&&W.y===F.y}function E(W,F,H,q){var G=M(w(W,F,H)),tt=M(w(W,F,q)),ht=M(w(H,q,W)),bt=M(w(H,q,F));return!!(G!==tt&&ht!==bt||G===0&&I(W,H,F)||tt===0&&I(W,q,F)||ht===0&&I(H,W,q)||bt===0&&I(H,F,q))}function I(W,F,H){return F.x<=Math.max(W.x,H.x)&&F.x>=Math.min(W.x,H.x)&&F.y<=Math.max(W.y,H.y)&&F.y>=Math.min(W.y,H.y)}function M(W){return W>0?1:W<0?-1:0}function p(W,F){var H=W;do{if(H.i!==W.i&&H.next.i!==W.i&&H.i!==F.i&&H.next.i!==F.i&&E(H,H.next,W,F))return!0;H=H.next}while(H!==W);return!1}function g(W,F){return w(W.prev,W,W.next)<0?w(W,F,W.next)>=0&&w(W,W.prev,F)>=0:w(W,F,W.prev)<0||w(W,W.next,F)<0}function C(W,F){var H=W,q=!1,G=(W.x+F.x)/2,tt=(W.y+F.y)/2;do H.y>tt!=H.next.y>tt&&H.next.y!==H.y&&G<(H.next.x-H.x)*(tt-H.y)/(H.next.y-H.y)+H.x&&(q=!q),H=H.next;while(H!==W);return q}function S(W,F){var H=new U(W.i,W.x,W.y),q=new U(F.i,F.x,F.y),G=W.next,tt=F.prev;return W.next=F,F.prev=W,H.next=G,G.prev=H,q.next=H,H.prev=q,tt.next=q,q.prev=tt,q}function N(W,F,H,q){var G=new U(W,F,H);return q?(G.next=q.next,G.prev=q,q.next.prev=G,q.next=G):(G.prev=G,G.next=G),G}function B(W){W.next.prev=W.prev,W.prev.next=W.next,W.prevZ&&(W.prevZ.nextZ=W.nextZ),W.nextZ&&(W.nextZ.prevZ=W.prevZ)}function U(W,F,H){this.i=W,this.x=F,this.y=H,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}f.deviation=function(W,F,H,q){var G=F&&F.length,tt=G?F[0]*H:W.length,ht=Math.abs(V(W,0,tt,H));if(G)for(var bt=0,vt=F.length;bt0&&(q+=W[G-1].length,H.holes.push(q))}return H}}),eJ=It((et,Y)=>{var f=Db();Y.exports=y;function y(z,P,n){if(!z||z.length==null)throw Error("Argument should be an array");P==null&&(P=1),n==null&&(n=f(z,P));for(var i=0;i{Y.exports=function(){var f,y;if(typeof WeakMap!="function")return!1;try{f=new WeakMap([[y={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(f)!=="[object WeakMap]"||typeof f.set!="function"||f.set({},1)!==f||typeof f.delete!="function"||typeof f.has!="function"||f.get(y)!=="one")}}),nJ=It((et,Y)=>{Y.exports=function(){}}),Z_=It((et,Y)=>{var f=nJ()();Y.exports=function(y){return y!==f&&y!==null}}),ND=It((et,Y)=>{var f=Object.create,y=Object.getPrototypeOf,z={};Y.exports=function(){var P=Object.setPrototypeOf,n=arguments[0]||f;return typeof P!="function"?!1:y(P(n(null),z))===z}}),jD=It((et,Y)=>{var f=Z_(),y={function:!0,object:!0};Y.exports=function(z){return f(z)&&y[typeof z]||!1}}),fy=It((et,Y)=>{var f=Z_();Y.exports=function(y){if(!f(y))throw new TypeError("Cannot use null or undefined");return y}}),iJ=It((et,Y)=>{var f=Object.create,y;ND()()||(y=UD()),Y.exports=function(){var z,P,n;return!y||y.level!==1?f:(z={},P={},n={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(i){if(i==="__proto__"){P[i]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}P[i]=n}),Object.defineProperties(z,P),Object.defineProperty(y,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:z}),function(i,a){return f(i===null?z:i,a)})}()}),UD=It((et,Y)=>{var f=jD(),y=fy(),z=Object.prototype.isPrototypeOf,P=Object.defineProperty,n={configurable:!0,enumerable:!1,writable:!0,value:void 0},i;i=function(a,l){if(y(a),l===null||f(l))return a;throw new TypeError("Prototype must be null or an object")},Y.exports=function(a){var l,o;return a?(a.level===2?a.set?(o=a.set,l=function(c,s){return o.call(i(c,s),s),c}):l=function(c,s){return i(c,s).__proto__=s,c}:l=function c(s,h){var m;return i(s,h),m=z.call(c.nullPolyfill,s),m&&delete c.nullPolyfill.__proto__,h===null&&(h=c.nullPolyfill),s.__proto__=h,m&&P(c.nullPolyfill,"__proto__",n),s},Object.defineProperty(l,"level",{configurable:!1,enumerable:!1,writable:!1,value:a.level})):null}(function(){var a=Object.create(null),l={},o,c=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(c){try{o=c.set,o.call(a,l)}catch{}if(Object.getPrototypeOf(a)===l)return{set:o,level:2}}return a.__proto__=l,Object.getPrototypeOf(a)===l?{level:2}:(a={},a.__proto__=l,Object.getPrototypeOf(a)===l?{level:1}:!1)}()),iJ()}),hA=It((et,Y)=>{Y.exports=ND()()?Object.setPrototypeOf:UD()}),aJ=It((et,Y)=>{var f=jD();Y.exports=function(y){if(!f(y))throw new TypeError(y+" is not an Object");return y}}),oJ=It((et,Y)=>{var f=Object.create(null),y=Math.random;Y.exports=function(){var z;do z=y().toString(36).slice(2);while(f[z]);return z}}),Bb=It((et,Y)=>{var f=void 0;Y.exports=function(y){return y!==f&&y!==null}}),dA=It((et,Y)=>{var f=Bb(),y={object:!0,function:!0,undefined:!0};Y.exports=function(z){return f(z)?hasOwnProperty.call(y,typeof z):!1}}),sJ=It((et,Y)=>{var f=dA();Y.exports=function(y){if(!f(y))return!1;try{return y.constructor?y.constructor.prototype===y:!1}catch{return!1}}}),lJ=It((et,Y)=>{var f=sJ();Y.exports=function(y){if(typeof y!="function"||!hasOwnProperty.call(y,"length"))return!1;try{if(typeof y.length!="number"||typeof y.call!="function"||typeof y.apply!="function")return!1}catch{return!1}return!f(y)}}),$D=It((et,Y)=>{var f=lJ(),y=/^\s*class[\s{/}]/,z=Function.prototype.toString;Y.exports=function(P){return!(!f(P)||y.test(z.call(P)))}}),cJ=It((et,Y)=>{Y.exports=function(){var f=Object.assign,y;return typeof f!="function"?!1:(y={foo:"raz"},f(y,{bar:"dwa"},{trzy:"trzy"}),y.foo+y.bar+y.trzy==="razdwatrzy")}}),uJ=It((et,Y)=>{Y.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),hJ=It((et,Y)=>{var f=Z_(),y=Object.keys;Y.exports=function(z){return y(f(z)?Object(z):z)}}),dJ=It((et,Y)=>{Y.exports=uJ()()?Object.keys:hJ()}),fJ=It((et,Y)=>{var f=dJ(),y=fy(),z=Math.max;Y.exports=function(P,n){var i,a,l=z(arguments.length,2),o;for(P=Object(y(P)),o=function(c){try{P[c]=n[c]}catch(s){i||(i=s)}},a=1;a{Y.exports=cJ()()?Object.assign:fJ()}),HD=It((et,Y)=>{var f=Z_(),y=Array.prototype.forEach,z=Object.create,P=function(n,i){var a;for(a in n)i[a]=n[a]};Y.exports=function(n){var i=z(null);return y.call(arguments,function(a){f(a)&&P(Object(a),i)}),i}}),pJ=It((et,Y)=>{var f="razdwatrzy";Y.exports=function(){return typeof f.contains!="function"?!1:f.contains("dwa")===!0&&f.contains("foo")===!1}}),mJ=It((et,Y)=>{var f=String.prototype.indexOf;Y.exports=function(y){return f.call(this,y,arguments[1])>-1}}),VD=It((et,Y)=>{Y.exports=pJ()()?String.prototype.contains:mJ()}),py=It((et,Y)=>{var f=Bb(),y=$D(),z=fA(),P=HD(),n=VD(),i=Y.exports=function(a,l){var o,c,s,h,m;return arguments.length<2||typeof a!="string"?(h=l,l=a,a=null):h=arguments[2],f(a)?(o=n.call(a,"c"),c=n.call(a,"e"),s=n.call(a,"w")):(o=s=!0,c=!1),m={value:l,configurable:o,enumerable:c,writable:s},h?z(P(h),m):m};i.gs=function(a,l,o){var c,s,h,m;return typeof a!="string"?(h=o,o=l,l=a,a=null):h=arguments[3],f(l)?y(l)?f(o)?y(o)||(h=o,o=void 0):o=void 0:(h=l,l=o=void 0):l=void 0,f(a)?(c=n.call(a,"c"),s=n.call(a,"e")):(c=!0,s=!1),m={get:l,set:o,configurable:c,enumerable:s},h?z(P(h),m):m}}),Pk=It((et,Y)=>{var f=Object.prototype.toString,y=f.call(function(){return arguments}());Y.exports=function(z){return f.call(z)===y}}),Ik=It((et,Y)=>{var f=Object.prototype.toString,y=f.call("");Y.exports=function(z){return typeof z=="string"||z&&typeof z=="object"&&(z instanceof String||f.call(z)===y)||!1}}),gJ=It((et,Y)=>{Y.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),vJ=It((et,Y)=>{var f=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};Y.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return f()}try{return __global__||f()}finally{delete Object.prototype.__global__}}()}),Dk=It((et,Y)=>{Y.exports=gJ()()?globalThis:vJ()}),yJ=It((et,Y)=>{var f=Dk(),y={object:!0,symbol:!0};Y.exports=function(){var z=f.Symbol,P;if(typeof z!="function")return!1;P=z("test symbol");try{String(P)}catch{return!1}return!(!y[typeof z.iterator]||!y[typeof z.toPrimitive]||!y[typeof z.toStringTag])}}),_J=It((et,Y)=>{Y.exports=function(f){return f?typeof f=="symbol"?!0:!f.constructor||f.constructor.name!=="Symbol"?!1:f[f.constructor.toStringTag]==="Symbol":!1}}),WD=It((et,Y)=>{var f=_J();Y.exports=function(y){if(!f(y))throw new TypeError(y+" is not a symbol");return y}}),xJ=It((et,Y)=>{var f=py(),y=Object.create,z=Object.defineProperty,P=Object.prototype,n=y(null);Y.exports=function(i){for(var a=0,l,o;n[i+(a||"")];)++a;return i+=a||"",n[i]=!0,l="@@"+i,z(P,l,f.gs(null,function(c){o||(o=!0,z(this,l,f(c)),o=!1)})),l}}),bJ=It((et,Y)=>{var f=py(),y=Dk().Symbol;Y.exports=function(z){return Object.defineProperties(z,{hasInstance:f("",y&&y.hasInstance||z("hasInstance")),isConcatSpreadable:f("",y&&y.isConcatSpreadable||z("isConcatSpreadable")),iterator:f("",y&&y.iterator||z("iterator")),match:f("",y&&y.match||z("match")),replace:f("",y&&y.replace||z("replace")),search:f("",y&&y.search||z("search")),species:f("",y&&y.species||z("species")),split:f("",y&&y.split||z("split")),toPrimitive:f("",y&&y.toPrimitive||z("toPrimitive")),toStringTag:f("",y&&y.toStringTag||z("toStringTag")),unscopables:f("",y&&y.unscopables||z("unscopables"))})}}),wJ=It((et,Y)=>{var f=py(),y=WD(),z=Object.create(null);Y.exports=function(P){return Object.defineProperties(P,{for:f(function(n){return z[n]?z[n]:z[n]=P(String(n))}),keyFor:f(function(n){var i;y(n);for(i in z)if(z[i]===n)return i})})}}),kJ=It((et,Y)=>{var f=py(),y=WD(),z=Dk().Symbol,P=xJ(),n=bJ(),i=wJ(),a=Object.create,l=Object.defineProperties,o=Object.defineProperty,c,s,h;if(typeof z=="function")try{String(z()),h=!0}catch{}else z=null;s=function(m){if(this instanceof s)throw new TypeError("Symbol is not a constructor");return c(m)},Y.exports=c=function m(b){var x;if(this instanceof m)throw new TypeError("Symbol is not a constructor");return h?z(b):(x=a(s.prototype),b=b===void 0?"":String(b),l(x,{__description__:f("",b),__name__:f("",P(b))}))},n(c),i(c),l(s.prototype,{constructor:f(c),toString:f("",function(){return this.__name__})}),l(c.prototype,{toString:f(function(){return"Symbol ("+y(this).__description__+")"}),valueOf:f(function(){return y(this)})}),o(c.prototype,c.toPrimitive,f("",function(){var m=y(this);return typeof m=="symbol"?m:m.toString()})),o(c.prototype,c.toStringTag,f("c","Symbol")),o(s.prototype,c.toStringTag,f("c",c.prototype[c.toStringTag])),o(s.prototype,c.toPrimitive,f("c",c.prototype[c.toPrimitive]))}),K_=It((et,Y)=>{Y.exports=yJ()()?Dk().Symbol:kJ()}),TJ=It((et,Y)=>{var f=fy();Y.exports=function(){return f(this).length=0,this}}),Xw=It((et,Y)=>{Y.exports=function(f){if(typeof f!="function")throw new TypeError(f+" is not a function");return f}}),SJ=It((et,Y)=>{var f=Bb(),y=dA(),z=Object.prototype.toString;Y.exports=function(P){if(!f(P))return null;if(y(P)){var n=P.toString;if(typeof n!="function"||n===z)return null}try{return""+P}catch{return null}}}),CJ=It((et,Y)=>{Y.exports=function(f){try{return f.toString()}catch{try{return String(f)}catch{return null}}}}),AJ=It((et,Y)=>{var f=CJ(),y=/[\n\r\u2028\u2029]/g;Y.exports=function(z){var P=f(z);return P===null?"":(P.length>100&&(P=P.slice(0,99)+"…"),P=P.replace(y,function(n){switch(n){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),P)}}),qD=It((et,Y)=>{var f=Bb(),y=dA(),z=SJ(),P=AJ(),n=function(i,a){return i.replace("%v",P(a))};Y.exports=function(i,a,l){if(!y(l))throw new TypeError(n(a,i));if(!f(i)){if("default"in l)return l.default;if(l.isOptional)return null}var o=z(l.errorMessage);throw f(o)||(o=a),new TypeError(n(o,i))}}),MJ=It((et,Y)=>{var f=qD(),y=Bb();Y.exports=function(z){return y(z)?z:f(z,"Cannot use %v",arguments[1])}}),EJ=It((et,Y)=>{var f=qD(),y=$D();Y.exports=function(z){return y(z)?z:f(z,"%v is not a plain function",arguments[1])}}),LJ=It((et,Y)=>{Y.exports=function(){var f=Array.from,y,z;return typeof f!="function"?!1:(y=["raz","dwa"],z=f(y),!!(z&&z!==y&&z[1]==="dwa"))}}),PJ=It((et,Y)=>{var f=Object.prototype.toString,y=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);Y.exports=function(z){return typeof z=="function"&&y(f.call(z))}}),IJ=It((et,Y)=>{Y.exports=function(){var f=Math.sign;return typeof f!="function"?!1:f(10)===1&&f(-20)===-1}}),DJ=It((et,Y)=>{Y.exports=function(f){return f=Number(f),isNaN(f)||f===0?f:f>0?1:-1}}),zJ=It((et,Y)=>{Y.exports=IJ()()?Math.sign:DJ()}),OJ=It((et,Y)=>{var f=zJ(),y=Math.abs,z=Math.floor;Y.exports=function(P){return isNaN(P)?0:(P=Number(P),P===0||!isFinite(P)?P:f(P)*z(y(P)))}}),BJ=It((et,Y)=>{var f=OJ(),y=Math.max;Y.exports=function(z){return y(0,f(z))}}),RJ=It((et,Y)=>{var f=K_().iterator,y=Pk(),z=PJ(),P=BJ(),n=Xw(),i=fy(),a=Z_(),l=Ik(),o=Array.isArray,c=Function.prototype.call,s={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;Y.exports=function(m){var b=arguments[1],x=arguments[2],_,A,d,k,w,D,E,I,M,p;if(m=Object(i(m)),a(b)&&n(b),!this||this===Array||!z(this)){if(!b){if(y(m))return w=m.length,w!==1?Array.apply(null,m):(k=new Array(1),k[0]=m[0],k);if(o(m)){for(k=new Array(w=m.length),A=0;A=55296&&D<=56319&&(p+=m[++A])),p=b?c.call(b,x,p,d):p,_?(s.value=p,h(k,d,s)):k[d]=p,++d;w=d}}if(w===void 0)for(w=P(m.length),_&&(k=new _(w)),A=0;A{Y.exports=LJ()()?Array.from:RJ()}),NJ=It((et,Y)=>{var f=FJ(),y=fA(),z=fy();Y.exports=function(P){var n=Object(z(P)),i=arguments[1],a=Object(arguments[2]);if(n!==P&&!i)return n;var l={};return i?f(i,function(o){(a.ensure||o in P)&&(l[o]=P[o])}):y(l,P),l}}),jJ=It((et,Y)=>{var f=Xw(),y=fy(),z=Function.prototype.bind,P=Function.prototype.call,n=Object.keys,i=Object.prototype.propertyIsEnumerable;Y.exports=function(a,l){return function(o,c){var s,h=arguments[2],m=arguments[3];return o=Object(y(o)),f(c),s=n(o),m&&s.sort(typeof m=="function"?z.call(m,o):void 0),typeof a!="function"&&(a=s[a]),P.call(a,s,function(b,x){return i.call(o,b)?P.call(c,h,o[b],b,o,x):l})}}}),UJ=It((et,Y)=>{Y.exports=jJ()("forEach")}),$J=It((et,Y)=>{var f=Xw(),y=UJ(),z=Function.prototype.call;Y.exports=function(P,n){var i={},a=arguments[2];return f(n),y(P,function(l,o,c,s){i[o]=z.call(n,a,l,o,c,s)}),i}}),HJ=It((et,Y)=>{var f=Bb(),y=MJ(),z=EJ(),P=NJ(),n=HD(),i=$J(),a=Function.prototype.bind,l=Object.defineProperty,o=Object.prototype.hasOwnProperty,c;c=function(s,h,m){var b=y(h)&&z(h.value),x;return x=P(h),delete x.writable,delete x.value,x.get=function(){return!m.overwriteDefinition&&o.call(this,s)?b:(h.value=a.call(b,m.resolveContext?m.resolveContext(this):this),l(this,s,h),this[s])},x},Y.exports=function(s){var h=n(arguments[1]);return f(h.resolveContext)&&z(h.resolveContext),i(s,function(m,b){return c(b,m,h)})}}),GD=It((et,Y)=>{var f=TJ(),y=fA(),z=Xw(),P=fy(),n=py(),i=HJ(),a=K_(),l=Object.defineProperty,o=Object.defineProperties,c;Y.exports=c=function(s,h){if(!(this instanceof c))throw new TypeError("Constructor requires 'new'");o(this,{__list__:n("w",P(s)),__context__:n("w",h),__nextIndex__:n("w",0)}),h&&(z(h.on),h.on("_add",this._onAdd),h.on("_delete",this._onDelete),h.on("_clear",this._onClear))},delete c.prototype.constructor,o(c.prototype,y({_next:n(function(){var s;if(this.__list__){if(this.__redo__&&(s=this.__redo__.shift(),s!==void 0))return s;if(this.__nextIndex__=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){l(this,"__redo__",n("c",[s]));return}this.__redo__.forEach(function(h,m){h>=s&&(this.__redo__[m]=++h)},this),this.__redo__.push(s)}}),_onDelete:n(function(s){var h;s>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(h=this.__redo__.indexOf(s),h!==-1&&this.__redo__.splice(h,1),this.__redo__.forEach(function(m,b){m>s&&(this.__redo__[b]=--m)},this)))}),_onClear:n(function(){this.__redo__&&f.call(this.__redo__),this.__nextIndex__=0})}))),l(c.prototype,a.iterator,n(function(){return this}))}),VJ=It((et,Y)=>{var f=hA(),y=VD(),z=py(),P=K_(),n=GD(),i=Object.defineProperty,a;a=Y.exports=function(l,o){if(!(this instanceof a))throw new TypeError("Constructor requires 'new'");n.call(this,l),o?y.call(o,"key+value")?o="key+value":y.call(o,"key")?o="key":o="value":o="value",i(this,"__kind__",z("",o))},f&&f(a,n),delete a.prototype.constructor,a.prototype=Object.create(n.prototype,{_resolve:z(function(l){return this.__kind__==="value"?this.__list__[l]:this.__kind__==="key+value"?[l,this.__list__[l]]:l})}),i(a.prototype,P.toStringTag,z("c","Array Iterator"))}),WJ=It((et,Y)=>{var f=hA(),y=py(),z=K_(),P=GD(),n=Object.defineProperty,i;i=Y.exports=function(a){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");a=String(a),P.call(this,a),n(this,"__length__",y("",a.length))},f&&f(i,P),delete i.prototype.constructor,i.prototype=Object.create(P.prototype,{_next:y(function(){if(this.__list__){if(this.__nextIndex__=55296&&o<=56319?l+this.__list__[this.__nextIndex__++]:l)})}),n(i.prototype,z.toStringTag,y("c","String Iterator"))}),qJ=It((et,Y)=>{var f=Pk(),y=Z_(),z=Ik(),P=K_().iterator,n=Array.isArray;Y.exports=function(i){return y(i)?n(i)||z(i)||f(i)?!0:typeof i[P]=="function":!1}}),GJ=It((et,Y)=>{var f=qJ();Y.exports=function(y){if(!f(y))throw new TypeError(y+" is not iterable");return y}}),ZD=It((et,Y)=>{var f=Pk(),y=Ik(),z=VJ(),P=WJ(),n=GJ(),i=K_().iterator;Y.exports=function(a){return typeof n(a)[i]=="function"?a[i]():f(a)?new z(a):y(a)?new P(a):new z(a)}}),ZJ=It((et,Y)=>{var f=Pk(),y=Xw(),z=Ik(),P=ZD(),n=Array.isArray,i=Function.prototype.call,a=Array.prototype.some;Y.exports=function(l,o){var c,s=arguments[2],h,m,b,x,_,A,d;if(n(l)||f(l)?c="array":z(l)?c="string":l=P(l),y(o),m=function(){b=!0},c==="array"){a.call(l,function(k){return i.call(o,s,k,m),b});return}if(c==="string"){for(_=l.length,x=0;x<_&&(A=l[x],x+1<_&&(d=A.charCodeAt(0),d>=55296&&d<=56319&&(A+=l[++x])),i.call(o,s,A,m),!b);++x);return}for(h=l.next();!h.done;){if(i.call(o,s,h.value,m),b)return;h=l.next()}}}),KJ=It((et,Y)=>{Y.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}),YJ=It((et,Y)=>{var f=Z_(),y=hA(),z=aJ(),P=fy(),n=oJ(),i=py(),a=ZD(),l=ZJ(),o=K_().toStringTag,c=KJ(),s=Array.isArray,h=Object.defineProperty,m=Object.prototype.hasOwnProperty,b=Object.getPrototypeOf,x;Y.exports=x=function(){var _=arguments[0],A;if(!(this instanceof x))throw new TypeError("Constructor requires 'new'");return A=c&&y&&WeakMap!==x?y(new WeakMap,b(this)):this,f(_)&&(s(_)||(_=a(_))),h(A,"__weakMapData__",i("c","$weakMap$"+n())),_&&l(_,function(d){P(d),A.set(d[0],d[1])}),A},c&&(y&&y(x,WeakMap),x.prototype=Object.create(WeakMap.prototype,{constructor:i(x)})),Object.defineProperties(x.prototype,{delete:i(function(_){return m.call(z(_),this.__weakMapData__)?(delete _[this.__weakMapData__],!0):!1}),get:i(function(_){if(m.call(z(_),this.__weakMapData__))return _[this.__weakMapData__]}),has:i(function(_){return m.call(z(_),this.__weakMapData__)}),set:i(function(_,A){return h(z(_),this.__weakMapData__,i("c",A)),this}),toString:i(function(){return"[object WeakMap]"})}),h(x.prototype,o,i("c","WeakMap"))}),KD=It((et,Y)=>{Y.exports=rJ()()?WeakMap:YJ()}),XJ=It((et,Y)=>{Y.exports=function(f,y,z){if(typeof Array.prototype.findIndex=="function")return f.findIndex(y,z);if(typeof y!="function")throw new TypeError("predicate must be a function");var P=Object(f),n=P.length;if(n===0)return-1;for(var i=0;i{var f=H_(),y=Db(),z=Yf(),P=t1(),n=zb(),i=tJ(),a=eJ(),{float32:l,fract32:o}=uA(),c=KD(),s=Yw(),h=XJ(),m=` precision highp float; attribute vec2 aCoord, bCoord, aCoordFract, bCoordFract; @@ -2693,7 +2693,7 @@ void main() { gl_FragColor = fragColor; gl_FragColor.a *= alpha * opacity * dash; } -`;Y.exports=k;function k(w,D){if(!(this instanceof k))return new k(w,D);if(typeof w=="function"?(D||(D={}),D.regl=w):D=w,D.length&&(D.positions=D),w=D.regl,!w.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=w._gl,this.regl=w,this.passes=[],this.shaders=k.shaders.has(w)?k.shaders.get(w):k.shaders.set(w,k.createShaders(w)).get(w),this.update(D)}k.dashMult=2,k.maxPatternLength=256,k.precisionThreshold=3e6,k.maxPoints=1e4,k.maxLines=2048,k.shaders=new c,k.createShaders=function(w){let D=w.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:w.prop("count"),count:4,offset:0,uniforms:{miterMode:(p,g)=>g.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(p,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},I=w(z({vert:m,frag:b,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),M;try{M=w(z({cull:{enable:!0,face:"back"},vert:A,frag:d,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{M=I}return{fill:w({primitive:"triangle",elements:(p,g)=>g.triangles,offset:0,vert:x,frag:_,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.viewport}),rect:I,miter:M}},k.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},k.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},k.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((D,E)=>{if(D&&Array.isArray(D))return this.draw(...D);typeof D=="number"&&(D=this.passes[D]),D&&D.count>1&&D.opacity&&(this.regl._refresh(),D.fill&&D.triangles&&D.triangles.length>2&&this.shaders.fill(D),D.thickness&&(D.scale[0]*D.viewport.width>k.precisionThreshold||D.scale[1]*D.viewport.height>k.precisionThreshold?this.shaders.rect(D):D.join==="rect"||!D.join&&(D.thickness<=2||D.count>=k.maxPoints)?this.shaders.rect(D):this.shaders.miter(D)))}),this},k.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);let{regl:D,gl:E}=this;if(w.forEach((M,p)=>{let g=this.passes[p];if(M!==void 0){if(M===null){this.passes[p]=null;return}if(typeof M[0]=="number"&&(M={positions:M}),M=P(M,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[p]=g={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:D.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:D.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},M=z({},k.defaults,M)),M.thickness!=null&&(g.thickness=parseFloat(M.thickness)),M.opacity!=null&&(g.opacity=parseFloat(M.opacity)),M.miterLimit!=null&&(g.miterLimit=parseFloat(M.miterLimit)),M.overlay!=null&&(g.overlay=!!M.overlay,pvt-ut),tt=[],ht=0,bt=g.hole!=null?g.hole[0]:null;if(bt!=null){let vt=h(G,ut=>ut>=bt);G=G.slice(0,vt),G.push(bt)}for(let vt=0;vtit-bt+(G[vt]-ht)),gt=i(ut,rt);gt=gt.map(it=>it+ht+(it+ht{w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}),JJ=It((et,Y)=>{var f=Ib(),y=H_(),z=RD(),P=t1(),n=Yf(),i=Db(),{float32:a,fract32:l}=uA();Y.exports=c;var o=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function c(s,h){if(typeof s=="function"?(h||(h={}),h.regl=s):h=s,h.length&&(h.positions=h),s=h.regl,!s.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let m=s._gl,b,x,_,A,d,k,w={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},D=[];return A=s.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),x=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),d=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),k=s.buffer({usage:"static",type:"float",data:o}),p(h),b=s({vert:` +`;Y.exports=k;function k(w,D){if(!(this instanceof k))return new k(w,D);if(typeof w=="function"?(D||(D={}),D.regl=w):D=w,D.length&&(D.positions=D),w=D.regl,!w.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=w._gl,this.regl=w,this.passes=[],this.shaders=k.shaders.has(w)?k.shaders.get(w):k.shaders.set(w,k.createShaders(w)).get(w),this.update(D)}k.dashMult=2,k.maxPatternLength=256,k.precisionThreshold=3e6,k.maxPoints=1e4,k.maxLines=2048,k.shaders=new c,k.createShaders=function(w){let D=w.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:w.prop("count"),count:4,offset:0,uniforms:{miterMode:(p,g)=>g.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(p,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},I=w(z({vert:m,frag:b,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),M;try{M=w(z({cull:{enable:!0,face:"back"},vert:A,frag:d,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{M=I}return{fill:w({primitive:"triangle",elements:(p,g)=>g.triangles,offset:0,vert:x,frag:_,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.viewport}),rect:I,miter:M}},k.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},k.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},k.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((D,E)=>{if(D&&Array.isArray(D))return this.draw(...D);typeof D=="number"&&(D=this.passes[D]),D&&D.count>1&&D.opacity&&(this.regl._refresh(),D.fill&&D.triangles&&D.triangles.length>2&&this.shaders.fill(D),D.thickness&&(D.scale[0]*D.viewport.width>k.precisionThreshold||D.scale[1]*D.viewport.height>k.precisionThreshold?this.shaders.rect(D):D.join==="rect"||!D.join&&(D.thickness<=2||D.count>=k.maxPoints)?this.shaders.rect(D):this.shaders.miter(D)))}),this},k.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);let{regl:D,gl:E}=this;if(w.forEach((M,p)=>{let g=this.passes[p];if(M!==void 0){if(M===null){this.passes[p]=null;return}if(typeof M[0]=="number"&&(M={positions:M}),M=P(M,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[p]=g={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:D.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:D.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},M=z({},k.defaults,M)),M.thickness!=null&&(g.thickness=parseFloat(M.thickness)),M.opacity!=null&&(g.opacity=parseFloat(M.opacity)),M.miterLimit!=null&&(g.miterLimit=parseFloat(M.miterLimit)),M.overlay!=null&&(g.overlay=!!M.overlay,pvt-ut),tt=[],ht=0,bt=g.hole!=null?g.hole[0]:null;if(bt!=null){let vt=h(G,ut=>ut>=bt);G=G.slice(0,vt),G.push(bt)}for(let vt=0;vtit-bt+(G[vt]-ht)),gt=i(ut,rt);gt=gt.map(it=>it+ht+(it+ht{w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}),JJ=It((et,Y)=>{var f=Db(),y=H_(),z=RD(),P=t1(),n=Yf(),i=zb(),{float32:a,fract32:l}=uA();Y.exports=c;var o=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function c(s,h){if(typeof s=="function"?(h||(h={}),h.regl=s):h=s,h.length&&(h.positions=h),s=h.regl,!s.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let m=s._gl,b,x,_,A,d,k,w={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},D=[];return A=s.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),x=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),d=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),k=s.buffer({usage:"static",type:"float",data:o}),p(h),b=s({vert:` precision highp float; attribute vec2 position, positionFract; @@ -2737,10 +2737,10 @@ void main() { gl_FragColor = fragColor; gl_FragColor.a *= opacity; } - `,uniforms:{range:s.prop("range"),lineWidth:s.prop("lineWidth"),capSize:s.prop("capSize"),opacity:s.prop("opacity"),scale:s.prop("scale"),translate:s.prop("translate"),scaleFract:s.prop("scaleFract"),translateFract:s.prop("translateFract"),viewport:(C,S)=>[S.viewport.x,S.viewport.y,C.viewportWidth,C.viewportHeight]},attributes:{color:{buffer:A,offset:(C,S)=>S.offset*4,divisor:1},position:{buffer:x,offset:(C,S)=>S.offset*8,divisor:1},positionFract:{buffer:_,offset:(C,S)=>S.offset*8,divisor:1},error:{buffer:d,offset:(C,S)=>S.offset*16,divisor:1},direction:{buffer:k,stride:24,offset:0},lineOffset:{buffer:k,stride:24,offset:8},capOffset:{buffer:k,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:s.prop("viewport")},viewport:s.prop("viewport"),stencil:!1,instances:s.prop("count"),count:o.length}),n(E,{update:p,draw:I,destroy:g,regl:s,gl:m,canvas:m.canvas,groups:D}),E;function E(C){C?p(C):C===null&&g(),I()}function I(C){if(typeof C=="number")return M(C);C&&!Array.isArray(C)&&(C=[C]),s._refresh(),D.forEach((S,N)=>{if(S){if(C&&(C[N]?S.draw=!0:S.draw=!1),!S.draw){S.draw=!0;return}M(N)}})}function M(C){typeof C=="number"&&(C=D[C]),C!=null&&C&&C.count&&C.color&&C.opacity&&C.positions&&C.positions.length>1&&(C.scaleRatio=[C.scale[0]*C.viewport.width,C.scale[1]*C.viewport.height],b(C),C.after&&C.after(C))}function p(C){if(!C)return;C.length!=null?typeof C[0]=="number"&&(C=[{positions:C}]):Array.isArray(C)||(C=[C]);let S=0,N=0;if(E.groups=D=C.map((V,W)=>{let F=D[W];if(V)typeof V=="function"?V={after:V}:typeof V[0]=="number"&&(V={positions:V});else return F;return V=P(V,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),F||(D[W]=F={id:W,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},V=n({},w,V)),z(F,V,[{lineWidth:H=>+H*.5,capSize:H=>+H*.5,opacity:parseFloat,errors:H=>(H=i(H),N+=H.length,H),positions:(H,q)=>(H=i(H,"float64"),q.count=Math.floor(H.length/2),q.bounds=f(H,2),q.offset=S,S+=q.count,H)},{color:(H,q)=>{let G=q.count;if(H||(H="transparent"),!Array.isArray(H)||typeof H[0]=="number"){let ht=H;H=Array(G);for(let bt=0;bt{let tt=q.bounds;return H||(H=tt),q.scale=[1/(H[2]-H[0]),1/(H[3]-H[1])],q.translate=[-H[0],-H[1]],q.scaleFract=l(q.scale),q.translateFract=l(q.translate),H},viewport:H=>{let q;return Array.isArray(H)?q={x:H[0],y:H[1],width:H[2]-H[0],height:H[3]-H[1]}:H?(q={x:H.x||H.left||0,y:H.y||H.top||0},H.right?q.width=H.right-q.x:q.width=H.w||H.width||0,H.bottom?q.height=H.bottom-q.y:q.height=H.h||H.height||0):q={x:0,y:0,width:m.drawingBufferWidth,height:m.drawingBufferHeight},q}}]),F}),S||N){let V=D.reduce((q,G,tt)=>q+(G?G.count:0),0),W=new Float64Array(V*2),F=new Uint8Array(V*4),H=new Float32Array(V*4);D.forEach((q,G)=>{if(!q)return;let{positions:tt,count:ht,offset:bt,color:vt,errors:ut}=q;ht&&(F.set(vt,bt*4),H.set(ut,bt*4),W.set(tt,bt*2))});var B=a(W);x(B);var U=l(W,B);_(U),A(F),d(H)}}function g(){x.destroy(),_.destroy(),A.destroy(),d.destroy(),k.destroy()}}}),QJ=It((et,Y)=>{var f=/[\'\"]/;Y.exports=function(y){return y?(f.test(y.charAt(0))&&(y=y.substr(1)),f.test(y.charAt(y.length-1))&&(y=y.substr(0,y.length-1)),y):""}}),XD=It((et,Y)=>{Y.exports=["inherit","initial","unset"]}),JD=It((et,Y)=>{Y.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),QD=It((et,Y)=>{Y.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),tz=It((et,Y)=>{Y.exports=["normal","italic","oblique"]}),ez=It((et,Y)=>{Y.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),tQ=It((et,Y)=>{function f(P,n){if(typeof P!="string")return[P];var i=[P];typeof n=="string"||Array.isArray(n)?n={brackets:n}:n||(n={});var a=n.brackets?Array.isArray(n.brackets)?n.brackets:[n.brackets]:["{}","[]","()"],l=n.escape||"___",o=!!n.flat;a.forEach(function(h){var m=new RegExp(["\\",h[0],"[^\\",h[0],"\\",h[1],"]*\\",h[1]].join("")),b=[];function x(_,A,d){var k=i.push(_.slice(h[0].length,-h[1].length))-1;return b.push(k),l+k+l}i.forEach(function(_,A){for(var d,k=0;_!=d;)if(d=_,_=_.replace(m,x),k++>1e4)throw Error("References have circular dependency. Please, check them.");i[A]=_}),b=b.reverse(),i=i.map(function(_){return b.forEach(function(A){_=_.replace(new RegExp("(\\"+l+A+"\\"+l+")","g"),h[0]+"$1"+h[1])}),_})});var c=new RegExp("\\"+l+"([0-9]+)\\"+l);function s(h,m,b){for(var x=[],_,A=0;_=c.exec(h);){if(A++>1e4)throw Error("Circular references in parenthesis");x.push(h.slice(0,_.index)),x.push(s(m[_[1]],m)),h=h.slice(_.index+_[0].length)}return x.push(h),x}return o?i:s(i[0],i)}function y(P,n){if(n&&n.flat){var i=n&&n.escape||"___",a=P[0],l;if(!a)return"";for(var o=new RegExp("\\"+i+"([0-9]+)\\"+i),c=0;a!=l;){if(c++>1e4)throw Error("Circular references in "+P);l=a,a=a.replace(o,s)}return a}return P.reduce(function h(m,b){return Array.isArray(b)&&(b=b.reduce(h,"")),m+b},"");function s(h,m){if(P[m]==null)throw Error("Reference "+m+"is undefined");return P[m]}}function z(P,n){return Array.isArray(P)?y(P,n):f(P,n)}z.parse=f,z.stringify=y,Y.exports=z}),eQ=It((et,Y)=>{var f=tQ();Y.exports=function(y,z,P){if(y==null)throw Error("First argument should be a string");if(z==null)throw Error("Separator should be a string or a RegExp");P?(typeof P=="string"||Array.isArray(P))&&(P={ignore:P}):P={},P.escape==null&&(P.escape=!0),P.ignore==null?P.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof P.ignore=="string"&&(P.ignore=[P.ignore]),P.ignore=P.ignore.map(function(h){return h.length===1&&(h=h+h),h}));var n=f.parse(y,{flat:!0,brackets:P.ignore}),i=n[0],a=i.split(z);if(P.escape){for(var l=[],o=0;o{Y.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),rz=It((et,Y)=>{var f=rQ();Y.exports={isSize:function(y){return/^[\d\.]/.test(y)||y.indexOf("/")!==-1||f.indexOf(y)!==-1}}}),nQ=It((et,Y)=>{var f=QJ(),y=XD(),z=JD(),P=QD(),n=tz(),i=ez(),a=eQ(),l=rz().isSize;Y.exports=c;var o=c.cache={};function c(h){if(typeof h!="string")throw new Error("Font argument must be a string.");if(o[h])return o[h];if(h==="")throw new Error("Cannot parse an empty string.");if(z.indexOf(h)!==-1)return o[h]={system:h};for(var m={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},b=a(h,/\s+/),x;x=b.shift();){if(y.indexOf(x)!==-1)return["style","variant","weight","stretch"].forEach(function(A){m[A]=x}),o[h]=m;if(n.indexOf(x)!==-1){m.style=x;continue}if(x==="normal"||x==="small-caps"){m.variant=x;continue}if(i.indexOf(x)!==-1){m.stretch=x;continue}if(P.indexOf(x)!==-1){m.weight=x;continue}if(l(x)){var _=a(x,"/");if(m.size=_[0],_[1]!=null?m.lineHeight=s(_[1]):b[0]==="/"&&(b.shift(),m.lineHeight=s(b.shift())),!b.length)throw new Error("Missing required font-family.");return m.family=a(b.join(" "),/\s*,\s*/).map(f),o[h]=m}throw new Error("Unknown or unsupported font token: "+x)}throw new Error("Missing required font-size.")}function s(h){var m=parseFloat(h);return m.toString()===h?m:h}}),nz=It((et,Y)=>{var f=t1(),y=rz().isSize,z=h(XD()),P=h(JD()),n=h(QD()),i=h(tz()),a=h(ez()),l={normal:1,"small-caps":1},o={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},c={size:"1rem",family:"serif"};Y.exports=function(m){if(m=f(m,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"}),m.system)return m.system&&s(m.system,P),m.system;if(s(m.style,i),s(m.variant,l),s(m.weight,n),s(m.stretch,a),m.size==null&&(m.size=c.size),typeof m.size=="number"&&(m.size+="px"),!y)throw Error("Bad size value `"+m.size+"`");m.family||(m.family=c.family),Array.isArray(m.family)&&(m.family.length||(m.family=[c.family]),m.family=m.family.map(function(x){return o[x]?x:'"'+x+'"'}).join(", "));var b=[];return b.push(m.style),m.variant!==m.style&&b.push(m.variant),m.weight!==m.variant&&m.weight!==m.style&&b.push(m.weight),m.stretch!==m.weight&&m.stretch!==m.variant&&m.stretch!==m.style&&b.push(m.stretch),b.push(m.size+(m.lineHeight==null||m.lineHeight==="normal"||m.lineHeight+""=="1"?"":"/"+m.lineHeight)),b.push(m.family),b.filter(Boolean).join(" ")};function s(m,b){if(m&&!b[m]&&!z[m])throw Error("Unknown keyword `"+m+"`");return m}function h(m){for(var b={},x=0;x{Y.exports={parse:nQ(),stringify:nz()}}),aQ=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():f.createREGL=y()})(et,function(){var f=function(Se,Ir){for(var Vr=Object.keys(Ir),ri=0;ri1&&Ir===Vr&&(Ir==='"'||Ir==="'"))return['"'+a(Se.substr(1,Se.length-2))+'"'];var ri=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Se);if(ri)return l(Se.substr(0,ri.index)).concat(l(ri[1])).concat(l(Se.substr(ri.index+ri[0].length)));var Ai=Se.split(".");if(Ai.length===1)return['"'+a(Se)+'"'];for(var bi=[],On=0;On"u"?1:window.devicePixelRatio,Ia=!1,co={},to=function(En){},ma=function(){};if(typeof Ir=="string"?Vr=document.querySelector(Ir):typeof Ir=="object"&&(k(Ir)?Vr=Ir:w(Ir)?(bi=Ir,Ai=bi.canvas):("gl"in Ir?bi=Ir.gl:"canvas"in Ir?Ai=E(Ir.canvas):"container"in Ir&&(ri=E(Ir.container)),"attributes"in Ir&&(On=Ir.attributes),"extensions"in Ir&&(Si=D(Ir.extensions)),"optionalExtensions"in Ir&&(ha=D(Ir.optionalExtensions)),"onDone"in Ir&&(to=Ir.onDone),"profile"in Ir&&(Ia=!!Ir.profile),"pixelRatio"in Ir&&(ia=+Ir.pixelRatio),"cachedCode"in Ir&&(co=Ir.cachedCode))),Vr&&(Vr.nodeName.toLowerCase()==="canvas"?Ai=Vr:ri=Vr),!bi){if(!Ai){var ji=A(ri||document.body,to,ia);if(!ji)return null;Ai=ji.canvas,ma=ji.onDestroy}On.premultipliedAlpha===void 0&&(On.premultipliedAlpha=!0),bi=d(Ai,On)}return bi?{gl:bi,canvas:Ai,container:ri,extensions:Si,optionalExtensions:ha,pixelRatio:ia,profile:Ia,cachedCode:co,onDone:to,onDestroy:ma}:(ma(),to("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(Se,Ir){var Vr={};function ri(On){var Si=On.toLowerCase(),ha;try{ha=Vr[Si]=Se.getExtension(Si)}catch{}return!!ha}for(var Ai=0;Ai65535)<<4,Se>>>=Ir,Vr=(Se>255)<<3,Se>>>=Vr,Ir|=Vr,Vr=(Se>15)<<2,Se>>>=Vr,Ir|=Vr,Vr=(Se>3)<<1,Se>>>=Vr,Ir|=Vr,Ir|Se>>1}function H(){var Se=p(8,function(){return[]});function Ir(bi){var On=W(bi),Si=Se[F(On)>>2];return Si.length>0?Si.pop():new ArrayBuffer(On)}function Vr(bi){Se[F(bi.byteLength)>>2].push(bi)}function ri(bi,On){var Si=null;switch(bi){case g:Si=new Int8Array(Ir(On),0,On);break;case C:Si=new Uint8Array(Ir(On),0,On);break;case S:Si=new Int16Array(Ir(2*On),0,On);break;case N:Si=new Uint16Array(Ir(2*On),0,On);break;case B:Si=new Int32Array(Ir(4*On),0,On);break;case U:Si=new Uint32Array(Ir(4*On),0,On);break;case V:Si=new Float32Array(Ir(4*On),0,On);break;default:return null}return Si.length!==On?Si.subarray(0,On):Si}function Ai(bi){Vr(bi.buffer)}return{alloc:Ir,free:Vr,allocType:ri,freeType:Ai}}var q=H();q.zero=H();var G=3408,tt=3410,ht=3411,bt=3412,vt=3413,ut=3414,rt=3415,gt=33901,it=33902,st=3379,xt=3386,ot=34921,J=36347,mt=36348,dt=35661,Ct=35660,Rt=34930,Bt=36349,Zt=34076,Gt=34024,ee=7936,xe=7937,ge=7938,ye=35724,ue=34047,Mt=36063,Ot=34852,Lt=3553,ie=34067,be=34069,ce=33984,Le=6408,Ze=5126,Qe=5121,mr=36160,fr=36053,Jr=36064,an=16384,Er=function(Se,Ir){var Vr=1;Ir.ext_texture_filter_anisotropic&&(Vr=Se.getParameter(ue));var ri=1,Ai=1;Ir.webgl_draw_buffers&&(ri=Se.getParameter(Ot),Ai=Se.getParameter(Mt));var bi=!!Ir.oes_texture_float;if(bi){var On=Se.createTexture();Se.bindTexture(Lt,On),Se.texImage2D(Lt,0,Le,1,1,0,Le,Ze,null);var Si=Se.createFramebuffer();if(Se.bindFramebuffer(mr,Si),Se.framebufferTexture2D(mr,Jr,Lt,On,0),Se.bindTexture(Lt,null),Se.checkFramebufferStatus(mr)!==fr)bi=!1;else{Se.viewport(0,0,1,1),Se.clearColor(1,0,0,1),Se.clear(an);var ha=q.allocType(Ze,4);Se.readPixels(0,0,1,1,Le,Ze,ha),Se.getError()?bi=!1:(Se.deleteFramebuffer(Si),Se.deleteTexture(On),bi=ha[0]===1),q.freeType(ha)}}var ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ia=!0;if(!ia){var co=Se.createTexture(),to=q.allocType(Qe,36);Se.activeTexture(ce),Se.bindTexture(ie,co),Se.texImage2D(be,0,Le,3,3,0,Le,Qe,to),q.freeType(to),Se.bindTexture(ie,null),Se.deleteTexture(co),Ia=!Se.getError()}return{colorBits:[Se.getParameter(tt),Se.getParameter(ht),Se.getParameter(bt),Se.getParameter(vt)],depthBits:Se.getParameter(ut),stencilBits:Se.getParameter(rt),subpixelBits:Se.getParameter(G),extensions:Object.keys(Ir).filter(function(ma){return!!Ir[ma]}),maxAnisotropic:Vr,maxDrawbuffers:ri,maxColorAttachments:Ai,pointSizeDims:Se.getParameter(gt),lineWidthDims:Se.getParameter(it),maxViewportDims:Se.getParameter(xt),maxCombinedTextureUnits:Se.getParameter(dt),maxCubeMapSize:Se.getParameter(Zt),maxRenderbufferSize:Se.getParameter(Gt),maxTextureUnits:Se.getParameter(Rt),maxTextureSize:Se.getParameter(st),maxAttributes:Se.getParameter(ot),maxVertexUniforms:Se.getParameter(J),maxVertexTextureUnits:Se.getParameter(Ct),maxVaryingVectors:Se.getParameter(mt),maxFragmentUniforms:Se.getParameter(Bt),glsl:Se.getParameter(ye),renderer:Se.getParameter(xe),vendor:Se.getParameter(ee),version:Se.getParameter(ge),readFloat:bi,npotTextureCube:Ia}},dn=function(Se){return Se instanceof Uint8Array||Se instanceof Uint16Array||Se instanceof Uint32Array||Se instanceof Int8Array||Se instanceof Int16Array||Se instanceof Int32Array||Se instanceof Float32Array||Se instanceof Float64Array||Se instanceof Uint8ClampedArray};function _n(Se){return!!Se&&typeof Se=="object"&&Array.isArray(Se.shape)&&Array.isArray(Se.stride)&&typeof Se.offset=="number"&&Se.shape.length===Se.stride.length&&(Array.isArray(Se.data)||dn(Se.data))}var Oe=function(Se){return Object.keys(Se).map(function(Ir){return Se[Ir]})},Xt={shape:ae,flatten:Ht};function oe(Se,Ir,Vr){for(var ri=0;ri0){var no;if(Array.isArray(oi[0])){Ca=fi(oi);for(var Ri=1,ki=1;ki0){if(typeof Ri[0]=="number"){var la=q.allocType(wi.dtype,Ri.length);mn(la,Ri),Ca(la,$a),q.freeType(la)}else if(Array.isArray(Ri[0])||dn(Ri[0])){Ea=fi(Ri);var ua=Ci(Ri,Ea,wi.dtype);Ca(ua,$a),q.freeType(ua)}}}else if(_n(Ri)){Ea=Ri.shape;var Oa=Ri.stride,Vo=0,Bo=0,za=0,Ya=0;Ea.length===1?(Vo=Ea[0],Bo=1,za=Oa[0],Ya=0):Ea.length===2&&(Vo=Ea[0],Bo=Ea[1],za=Oa[0],Ya=Oa[1]);var Eo=Array.isArray(Ri.data)?wi.dtype:Ar(Ri.data),No=q.allocType(Eo,Vo*Bo);Zn(No,Ri.data,Vo,Bo,za,Ya,Ri.offset),Ca(No,$a),q.freeType(No)}return Ua}return Yi||Ua(En),Ua._reglType="buffer",Ua._buffer=wi,Ua.subdata=no,Vr.profile&&(Ua.stats=wi.stats),Ua.destroy=function(){to(wi)},Ua}function ji(){Oe(bi).forEach(function(En){En.buffer=Se.createBuffer(),Se.bindBuffer(En.type,En.buffer),Se.bufferData(En.type,En.persistentData||En.byteLength,En.usage)})}return Vr.profile&&(Ir.getTotalBufferSize=function(){var En=0;return Object.keys(bi).forEach(function(oi){En+=bi[oi].stats.size}),En}),{create:ma,createStream:ha,destroyStream:ia,clear:function(){Oe(bi).forEach(to),Si.forEach(to)},getBuffer:function(En){return En&&En._buffer instanceof On?En._buffer:null},restore:ji,_initBuffer:co}}var Wn=0,Li=0,Fi=1,Zi=1,Ji=4,ca=4,Ei={points:Wn,point:Li,lines:Fi,line:Zi,triangles:Ji,triangle:ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ga=0,so=1,Fe=4,Re=5120,Kr=5121,sn=5122,cn=5123,Yr=5124,un=5125,Pn=34963,bn=35040,ze=35044;function yr(Se,Ir,Vr,ri){var Ai={},bi=0,On={uint8:Kr,uint16:cn};Ir.oes_element_index_uint&&(On.uint32=un);function Si(ji){this.id=bi++,Ai[this.id]=this,this.buffer=ji,this.primType=Fe,this.vertCount=0,this.type=0}Si.prototype.bind=function(){this.buffer.bind()};var ha=[];function ia(ji){var En=ha.pop();return En||(En=new Si(Vr.create(null,Pn,!0,!1)._buffer)),co(En,ji,bn,-1,-1,0,0),En}function Ia(ji){ha.push(ji)}function co(ji,En,oi,Yi,Ni,wi,Ua){ji.buffer.bind();var Ca;if(En){var no=Ua;!Ua&&(!dn(En)||_n(En)&&!dn(En.data))&&(no=Ir.oes_element_index_uint?un:cn),Vr._initBuffer(ji.buffer,En,oi,no,3)}else Se.bufferData(Pn,wi,oi),ji.buffer.dtype=Ca||Kr,ji.buffer.usage=oi,ji.buffer.dimension=3,ji.buffer.byteLength=wi;if(Ca=Ua,!Ua){switch(ji.buffer.dtype){case Kr:case Re:Ca=Kr;break;case cn:case sn:Ca=cn;break;case un:case Yr:Ca=un;break}ji.buffer.dtype=Ca}ji.type=Ca;var Ri=Ni;Ri<0&&(Ri=ji.buffer.byteLength,Ca===cn?Ri>>=1:Ca===un&&(Ri>>=2)),ji.vertCount=Ri;var ki=Yi;if(Yi<0){ki=Fe;var $a=ji.buffer.dimension;$a===1&&(ki=Ga),$a===2&&(ki=so),$a===3&&(ki=Fe)}ji.primType=ki}function to(ji){ri.elementsCount--,delete Ai[ji.id],ji.buffer.destroy(),ji.buffer=null}function ma(ji,En){var oi=Vr.create(null,Pn,!0),Yi=new Si(oi._buffer);ri.elementsCount++;function Ni(wi){if(!wi)oi(),Yi.primType=Fe,Yi.vertCount=0,Yi.type=Kr;else if(typeof wi=="number")oi(wi),Yi.primType=Fe,Yi.vertCount=wi|0,Yi.type=Kr;else{var Ua=null,Ca=ze,no=-1,Ri=-1,ki=0,$a=0;Array.isArray(wi)||dn(wi)||_n(wi)?Ua=wi:("data"in wi&&(Ua=wi.data),"usage"in wi&&(Ca=Gi[wi.usage]),"primitive"in wi&&(no=Ei[wi.primitive]),"count"in wi&&(Ri=wi.count|0),"type"in wi&&($a=On[wi.type]),"length"in wi?ki=wi.length|0:(ki=Ri,$a===cn||$a===sn?ki*=2:($a===un||$a===Yr)&&(ki*=4))),co(Yi,Ua,Ca,no,Ri,ki,$a)}return Ni}return Ni(ji),Ni._reglType="elements",Ni._elements=Yi,Ni.subdata=function(wi,Ua){return oi.subdata(wi,Ua),Ni},Ni.destroy=function(){to(Yi)},Ni}return{create:ma,createStream:ia,destroyStream:Ia,getElements:function(ji){return typeof ji=="function"&&ji._elements instanceof Si?ji._elements:null},clear:function(){Oe(Ai).forEach(to)}}}var en=new Float32Array(1),Rn=new Uint32Array(en.buffer),ni=5123;function xi(Se){for(var Ir=q.allocType(ni,Se.length),Vr=0;Vr>>31<<15,bi=(ri<<1>>>24)-127,On=ri>>13&1023;if(bi<-24)Ir[Vr]=Ai;else if(bi<-14){var Si=-14-bi;Ir[Vr]=Ai+(On+1024>>Si)}else bi>15?Ir[Vr]=Ai+31744:Ir[Vr]=Ai+(bi+15<<10)+On}return Ir}function Jn(Se){return Array.isArray(Se)||dn(Se)}var Gn=34467,pi=3553,Va=34067,ea=34069,go=6408,mo=6406,Go=6407,Lo=6409,Zo=6410,Ka=32854,Cs=32855,ps=36194,wl=32819,is=32820,ol=33635,ms=34042,kl=6402,ul=34041,Kl=35904,vs=35906,Ns=36193,Uo=33776,Ds=33777,Ol=33778,tc=33779,sc=35986,Xs=35987,Wa=34798,Co=35840,el=35841,lc=35842,ss=35843,nc=36196,yl=5121,$l=5123,Gc=5125,ko=5126,zs=10242,js=10243,mc=10497,Tl=33071,us=33648,Rc=10240,iu=10241,Dl=9728,ql=9729,cc=9984,dc=9985,pu=9986,Ah=9987,uh=33170,yh=4352,tf=4353,Nd=4354,Gl=34046,Yu=3317,ef=37440,xu=37441,mu=37443,bu=37444,_h=33984,_c=[cc,pu,dc,Ah],gu=[0,Lo,Zo,Go,go],pl={};pl[Lo]=pl[mo]=pl[kl]=1,pl[ul]=pl[Zo]=2,pl[Go]=pl[Kl]=3,pl[go]=pl[vs]=4;function ic(Se){return"[object "+Se+"]"}var jh=ic("HTMLCanvasElement"),Hu=ic("OffscreenCanvas"),Qh=ic("CanvasRenderingContext2D"),Lc=ic("ImageBitmap"),Xf=ic("HTMLImageElement"),hl=ic("HTMLVideoElement"),pp=Object.keys(he).concat([jh,Hu,Qh,Lc,Xf,hl]),Hl=[];Hl[yl]=1,Hl[ko]=4,Hl[Ns]=2,Hl[$l]=2,Hl[Gc]=4;var cs=[];cs[Ka]=2,cs[Cs]=2,cs[ps]=2,cs[ul]=4,cs[Uo]=.5,cs[Ds]=.5,cs[Ol]=1,cs[tc]=1,cs[sc]=.5,cs[Xs]=1,cs[Wa]=1,cs[Co]=.5,cs[el]=.25,cs[lc]=.5,cs[ss]=.25,cs[nc]=.5;function _d(Se){return Array.isArray(Se)&&(Se.length===0||typeof Se[0]=="number")}function xh(Se){if(!Array.isArray(Se))return!1;var Ir=Se.length;return!(Ir===0||!Jn(Se[0]))}function hu(Se){return Object.prototype.toString.call(Se)}function rf(Se){return hu(Se)===jh}function td(Se){return hu(Se)===Hu}function Ed(Se){return hu(Se)===Qh}function vu(Se){return hu(Se)===Lc}function Lf(Se){return hu(Se)===Xf}function hf(Se){return hu(Se)===hl}function Ld(Se){if(!Se)return!1;var Ir=hu(Se);return pp.indexOf(Ir)>=0?!0:_d(Se)||xh(Se)||_n(Se)}function ed(Se){return he[Object.prototype.toString.call(Se)]|0}function nf(Se,Ir){var Vr=Ir.length;switch(Se.type){case yl:case $l:case Gc:case ko:var ri=q.allocType(Se.type,Vr);ri.set(Ir),Se.data=ri;break;case Ns:Se.data=xi(Ir);break}}function af(Se,Ir){return q.allocType(Se.type===Ns?ko:Se.type,Ir)}function bh(Se,Ir){Se.type===Ns?(Se.data=xi(Ir),q.freeType(Ir)):Se.data=Ir}function df(Se,Ir,Vr,ri,Ai,bi){for(var On=Se.width,Si=Se.height,ha=Se.channels,ia=On*Si*ha,Ia=af(Se,ia),co=0,to=0;to=1;)Si+=On*ha*ha,ha/=2;return Si}else return On*Vr*ri}function Mh(Se,Ir,Vr,ri,Ai,bi,On){var Si={"don't care":yh,"dont care":yh,nice:Nd,fast:tf},ha={repeat:mc,clamp:Tl,mirror:us},ia={nearest:Dl,linear:ql},Ia=f({mipmap:Ah,"nearest mipmap nearest":cc,"linear mipmap nearest":dc,"nearest mipmap linear":pu,"linear mipmap linear":Ah},ia),co={none:0,browser:bu},to={uint8:yl,rgba4:wl,rgb565:ol,"rgb5 a1":is},ma={alpha:mo,luminance:Lo,"luminance alpha":Zo,rgb:Go,rgba:go,rgba4:Ka,"rgb5 a1":Cs,rgb565:ps},ji={};Ir.ext_srgb&&(ma.srgb=Kl,ma.srgba=vs),Ir.oes_texture_float&&(to.float32=to.float=ko),Ir.oes_texture_half_float&&(to.float16=to["half float"]=Ns),Ir.webgl_depth_texture&&(f(ma,{depth:kl,"depth stencil":ul}),f(to,{uint16:$l,uint32:Gc,"depth stencil":ms})),Ir.webgl_compressed_texture_s3tc&&f(ji,{"rgb s3tc dxt1":Uo,"rgba s3tc dxt1":Ds,"rgba s3tc dxt3":Ol,"rgba s3tc dxt5":tc}),Ir.webgl_compressed_texture_atc&&f(ji,{"rgb atc":sc,"rgba atc explicit alpha":Xs,"rgba atc interpolated alpha":Wa}),Ir.webgl_compressed_texture_pvrtc&&f(ji,{"rgb pvrtc 4bppv1":Co,"rgb pvrtc 2bppv1":el,"rgba pvrtc 4bppv1":lc,"rgba pvrtc 2bppv1":ss}),Ir.webgl_compressed_texture_etc1&&(ji["rgb etc1"]=nc);var En=Array.prototype.slice.call(Se.getParameter(Gn));Object.keys(ji).forEach(function(Z){var lt=ji[Z];En.indexOf(lt)>=0&&(ma[Z]=lt)});var oi=Object.keys(ma);Vr.textureFormats=oi;var Yi=[];Object.keys(ma).forEach(function(Z){var lt=ma[Z];Yi[lt]=Z});var Ni=[];Object.keys(to).forEach(function(Z){var lt=to[Z];Ni[lt]=Z});var wi=[];Object.keys(ia).forEach(function(Z){var lt=ia[Z];wi[lt]=Z});var Ua=[];Object.keys(Ia).forEach(function(Z){var lt=Ia[Z];Ua[lt]=Z});var Ca=[];Object.keys(ha).forEach(function(Z){var lt=ha[Z];Ca[lt]=Z});var no=oi.reduce(function(Z,lt){var nt=ma[lt];return nt===Lo||nt===mo||nt===Lo||nt===Zo||nt===kl||nt===ul||Ir.ext_srgb&&(nt===Kl||nt===vs)?Z[nt]=nt:nt===Cs||lt.indexOf("rgba")>=0?Z[nt]=go:Z[nt]=Go,Z},{});function Ri(){this.internalformat=go,this.format=go,this.type=yl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bu,this.width=0,this.height=0,this.channels=0}function ki(Z,lt){Z.internalformat=lt.internalformat,Z.format=lt.format,Z.type=lt.type,Z.compressed=lt.compressed,Z.premultiplyAlpha=lt.premultiplyAlpha,Z.flipY=lt.flipY,Z.unpackAlignment=lt.unpackAlignment,Z.colorSpace=lt.colorSpace,Z.width=lt.width,Z.height=lt.height,Z.channels=lt.channels}function $a(Z,lt){if(!(typeof lt!="object"||!lt)){if("premultiplyAlpha"in lt&&(Z.premultiplyAlpha=lt.premultiplyAlpha),"flipY"in lt&&(Z.flipY=lt.flipY),"alignment"in lt&&(Z.unpackAlignment=lt.alignment),"colorSpace"in lt&&(Z.colorSpace=co[lt.colorSpace]),"type"in lt){var nt=lt.type;Z.type=to[nt]}var wt=Z.width,Wt=Z.height,ve=Z.channels,ke=!1;"shape"in lt?(wt=lt.shape[0],Wt=lt.shape[1],lt.shape.length===3&&(ve=lt.shape[2],ke=!0)):("radius"in lt&&(wt=Wt=lt.radius),"width"in lt&&(wt=lt.width),"height"in lt&&(Wt=lt.height),"channels"in lt&&(ve=lt.channels,ke=!0)),Z.width=wt|0,Z.height=Wt|0,Z.channels=ve|0;var Jt=!1;if("format"in lt){var fe=lt.format,De=Z.internalformat=ma[fe];Z.format=no[De],fe in to&&("type"in lt||(Z.type=to[fe])),fe in ji&&(Z.compressed=!0),Jt=!0}!ke&&Jt?Z.channels=pl[Z.format]:ke&&!Jt&&Z.channels!==gu[Z.format]&&(Z.format=Z.internalformat=gu[Z.channels])}}function Ea(Z){Se.pixelStorei(ef,Z.flipY),Se.pixelStorei(xu,Z.premultiplyAlpha),Se.pixelStorei(mu,Z.colorSpace),Se.pixelStorei(Yu,Z.unpackAlignment)}function la(){Ri.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ua(Z,lt){var nt=null;if(Ld(lt)?nt=lt:lt&&($a(Z,lt),"x"in lt&&(Z.xOffset=lt.x|0),"y"in lt&&(Z.yOffset=lt.y|0),Ld(lt.data)&&(nt=lt.data)),lt.copy){var wt=Ai.viewportWidth,Wt=Ai.viewportHeight;Z.width=Z.width||wt-Z.xOffset,Z.height=Z.height||Wt-Z.yOffset,Z.needsCopy=!0}else if(!nt)Z.width=Z.width||1,Z.height=Z.height||1,Z.channels=Z.channels||4;else if(dn(nt))Z.channels=Z.channels||4,Z.data=nt,!("type"in lt)&&Z.type===yl&&(Z.type=ed(nt));else if(_d(nt))Z.channels=Z.channels||4,nf(Z,nt),Z.alignment=1,Z.needsFree=!0;else if(_n(nt)){var ve=nt.data;!Array.isArray(ve)&&Z.type===yl&&(Z.type=ed(ve));var ke=nt.shape,Jt=nt.stride,fe,De,lr,tr,ar,dr;ke.length===3?(lr=ke[2],dr=Jt[2]):(lr=1,dr=1),fe=ke[0],De=ke[1],tr=Jt[0],ar=Jt[1],Z.alignment=1,Z.width=fe,Z.height=De,Z.channels=lr,Z.format=Z.internalformat=gu[lr],Z.needsFree=!0,df(Z,ve,tr,ar,dr,nt.offset)}else if(rf(nt)||td(nt)||Ed(nt))rf(nt)||td(nt)?Z.element=nt:Z.element=nt.canvas,Z.width=Z.element.width,Z.height=Z.element.height,Z.channels=4;else if(vu(nt))Z.element=nt,Z.width=nt.width,Z.height=nt.height,Z.channels=4;else if(Lf(nt))Z.element=nt,Z.width=nt.naturalWidth,Z.height=nt.naturalHeight,Z.channels=4;else if(hf(nt))Z.element=nt,Z.width=nt.videoWidth,Z.height=nt.videoHeight,Z.channels=4;else if(xh(nt)){var gr=Z.width||nt[0].length,Ge=Z.height||nt.length,rr=Z.channels;Jn(nt[0][0])?rr=rr||nt[0][0].length:rr=rr||1;for(var Je=Xt.shape(nt),Hr=1,wn=0;wn>=Wt,nt.height>>=Wt,ua(nt,wt[Wt]),Z.mipmask|=1<=0&&!("faces"in lt)&&(Z.genMipmaps=!0)}if("mag"in lt){var wt=lt.mag;Z.magFilter=ia[wt]}var Wt=Z.wrapS,ve=Z.wrapT;if("wrap"in lt){var ke=lt.wrap;typeof ke=="string"?Wt=ve=ha[ke]:Array.isArray(ke)&&(Wt=ha[ke[0]],ve=ha[ke[1]])}else{if("wrapS"in lt){var Jt=lt.wrapS;Wt=ha[Jt]}if("wrapT"in lt){var fe=lt.wrapT;ve=ha[fe]}}if(Z.wrapS=Wt,Z.wrapT=ve,"anisotropic"in lt&&(lt.anisotropic,Z.anisotropic=lt.anisotropic),"mipmap"in lt){var De=!1;switch(typeof lt.mipmap){case"string":Z.mipmapHint=Si[lt.mipmap],Z.genMipmaps=!0,De=!0;break;case"boolean":De=Z.genMipmaps=lt.mipmap;break;case"object":Z.genMipmaps=!1,De=!0;break}De&&!("min"in lt)&&(Z.minFilter=cc)}}function ku(Z,lt){Se.texParameteri(lt,iu,Z.minFilter),Se.texParameteri(lt,Rc,Z.magFilter),Se.texParameteri(lt,zs,Z.wrapS),Se.texParameteri(lt,js,Z.wrapT),Ir.ext_texture_filter_anisotropic&&Se.texParameteri(lt,Gl,Z.anisotropic),Z.genMipmaps&&(Se.hint(uh,Z.mipmapHint),Se.generateMipmap(lt))}var Eu=0,Ec={},kc=Vr.maxTextureUnits,zc=Array(kc).map(function(){return null});function Xo(Z){Ri.call(this),this.mipmask=0,this.internalformat=go,this.id=Eu++,this.refCount=1,this.target=Z,this.texture=Se.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Cl,On.profile&&(this.stats={size:0})}function Oc(Z){Se.activeTexture(_h),Se.bindTexture(Z.target,Z.texture)}function xl(){var Z=zc[0];Z?Se.bindTexture(Z.target,Z.texture):Se.bindTexture(pi,null)}function jc(Z){var lt=Z.texture,nt=Z.unit,wt=Z.target;nt>=0&&(Se.activeTexture(_h+nt),Se.bindTexture(wt,null),zc[nt]=null),Se.deleteTexture(lt),Z.texture=null,Z.params=null,Z.pixels=null,Z.refCount=0,delete Ec[Z.id],bi.textureCount--}f(Xo.prototype,{bind:function(){var Z=this;Z.bindCount+=1;var lt=Z.unit;if(lt<0){for(var nt=0;nt0)continue;wt.unit=-1}zc[nt]=Z,lt=nt;break}On.profile&&bi.maxTextureUnits>ar)-lr,dr.height=dr.height||(nt.height>>ar)-tr,Oc(nt),Vo(dr,pi,lr,tr,ar),xl(),Ya(dr),wt}function ve(ke,Jt){var fe=ke|0,De=Jt|0||fe;if(fe===nt.width&&De===nt.height)return wt;wt.width=nt.width=fe,wt.height=nt.height=De,Oc(nt);for(var lr=0;nt.mipmask>>lr;++lr){var tr=fe>>lr,ar=De>>lr;if(!tr||!ar)break;Se.texImage2D(pi,lr,nt.format,tr,ar,0,nt.format,nt.type,null)}return xl(),On.profile&&(nt.stats.size=Uh(nt.internalformat,nt.type,fe,De,!1,!1)),wt}return wt(Z,lt),wt.subimage=Wt,wt.resize=ve,wt._reglType="texture2d",wt._texture=nt,On.profile&&(wt.stats=nt.stats),wt.destroy=function(){nt.decRef()},wt}function jo(Z,lt,nt,wt,Wt,ve){var ke=new Xo(Va);Ec[ke.id]=ke,bi.cubeCount++;var Jt=new Array(6);function fe(tr,ar,dr,gr,Ge,rr){var Je,Hr=ke.texInfo;for(Cl.call(Hr),Je=0;Je<6;++Je)Jt[Je]=ys();if(typeof tr=="number"||!tr){var wn=tr|0||1;for(Je=0;Je<6;++Je)No(Jt[Je],wn,wn)}else if(typeof tr=="object")if(ar)hs(Jt[0],tr),hs(Jt[1],ar),hs(Jt[2],dr),hs(Jt[3],gr),hs(Jt[4],Ge),hs(Jt[5],rr);else if(Nc(Hr,tr),$a(ke,tr),"faces"in tr){var Ln=tr.faces;for(Je=0;Je<6;++Je)ki(Jt[Je],ke),hs(Jt[Je],Ln[Je])}else for(Je=0;Je<6;++Je)hs(Jt[Je],tr);for(ki(ke,Jt[0]),Hr.genMipmaps?ke.mipmask=(Jt[0].width<<1)-1:ke.mipmask=Jt[0].mipmask,ke.internalformat=Jt[0].internalformat,fe.width=Jt[0].width,fe.height=Jt[0].height,Oc(ke),Je=0;Je<6;++Je)Xl(Jt[Je],ea+Je);for(ku(Hr,Va),xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,Hr.genMipmaps,!0)),fe.format=Yi[ke.internalformat],fe.type=Ni[ke.type],fe.mag=wi[Hr.magFilter],fe.min=Ua[Hr.minFilter],fe.wrapS=Ca[Hr.wrapS],fe.wrapT=Ca[Hr.wrapT],Je=0;Je<6;++Je)Dc(Jt[Je]);return fe}function De(tr,ar,dr,gr,Ge){var rr=dr|0,Je=gr|0,Hr=Ge|0,wn=za();return ki(wn,ke),wn.width=0,wn.height=0,ua(wn,ar),wn.width=wn.width||(ke.width>>Hr)-rr,wn.height=wn.height||(ke.height>>Hr)-Je,Oc(ke),Vo(wn,ea+tr,rr,Je,Hr),xl(),Ya(wn),fe}function lr(tr){var ar=tr|0;if(ar!==ke.width){fe.width=ke.width=ar,fe.height=ke.height=ar,Oc(ke);for(var dr=0;dr<6;++dr)for(var gr=0;ke.mipmask>>gr;++gr)Se.texImage2D(ea+dr,gr,ke.format,ar>>gr,ar>>gr,0,ke.format,ke.type,null);return xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,!1,!0)),fe}}return fe(Z,lt,nt,wt,Wt,ve),fe.subimage=De,fe.resize=lr,fe._reglType="textureCube",fe._texture=ke,On.profile&&(fe.stats=ke.stats),fe.destroy=function(){ke.decRef()},fe}function Rs(){for(var Z=0;Z>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);else for(var Wt=0;Wt<6;++Wt)Se.texImage2D(ea+Wt,wt,nt.internalformat,nt.width>>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);ku(nt.texInfo,nt.target)})}function Pl(){for(var Z=0;Z=0?Dc=!0:ha.indexOf(Cl)>=0&&(Dc=!1))),("depthTexture"in Xo||"depthStencilTexture"in Xo)&&(zc=!!(Xo.depthTexture||Xo.depthStencilTexture)),"depth"in Xo&&(typeof Xo.depth=="boolean"?Xl=Xo.depth:(Eu=Xo.depth,Rl=!1)),"stencil"in Xo&&(typeof Xo.stencil=="boolean"?Rl=Xo.stencil:(Ec=Xo.stencil,Xl=!1)),"depthStencil"in Xo&&(typeof Xo.depthStencil=="boolean"?Xl=Rl=Xo.depthStencil:(kc=Xo.depthStencil,Xl=!1,Rl=!1))}var xl=null,jc=null,Lu=null,jo=null;if(Array.isArray(ys))xl=ys.map(ji);else if(ys)xl=[ji(ys)];else for(xl=new Array(ku),Eo=0;Eo0&&(Ya.depth=ua[0].depth,Ya.stencil=ua[0].stencil,Ya.depthStencil=ua[0].depthStencil),ua[za]?ua[za](Ya):ua[za]=ki(Ya)}return f(Oa,{width:Eo,height:Eo,color:Cl})}function Vo(Bo){var za,Ya=Bo|0;if(Ya===Oa.width)return Oa;var Eo=Oa.color;for(za=0;za=Eo.byteLength?No.subdata(Eo):(No.destroy(),ki.buffers[Bo]=null)),ki.buffers[Bo]||(No=ki.buffers[Bo]=Ai.create(za,Hd,!1,!0)),Ya.buffer=Ai.getBuffer(No),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,Oa[Bo]=1}else Ai.getBuffer(za)?(Ya.buffer=Ai.getBuffer(za),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):Ai.getBuffer(za.buffer)?(Ya.buffer=Ai.getBuffer(za.buffer),Ya.size=(+za.size||Ya.buffer.dimension)|0,Ya.normalized=!!za.normalized||!1,"type"in za?Ya.type=ci[za.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(za.offset||0)|0,Ya.stride=(za.stride||0)|0,Ya.divisor=(za.divisor||0)|0,Ya.state=1):"x"in za&&(Ya.x=+za.x||0,Ya.y=+za.y||0,Ya.z=+za.z||0,Ya.w=+za.w||0,Ya.state=2)}for(var hs=0;hs1)for(var Ea=0;EaEn&&(En=oi.stats.uniformsCount)}),En},Vr.getMaxAttributesCount=function(){var En=0;return Ia.forEach(function(oi){oi.stats.attributesCount>En&&(En=oi.stats.attributesCount)}),En});function ji(){Ai={},bi={};for(var En=0;En>>4&15)+Ir.charAt(ri&15);return Vr}function Vh(Se){for(var Ir="",Vr=-1,ri,Ai;++Vr>>6&31,128|ri&63):ri<=65535?Ir+=String.fromCharCode(224|ri>>>12&15,128|ri>>>6&63,128|ri&63):ri<=2097151&&(Ir+=String.fromCharCode(240|ri>>>18&7,128|ri>>>12&63,128|ri>>>6&63,128|ri&63));return Ir}function Ph(Se){for(var Ir=Array(Se.length>>2),Vr=0;Vr>5]|=(Se.charCodeAt(Vr/8)&255)<<24-Vr%32;return Ir}function Zc(Se){for(var Ir="",Vr=0;Vr>5]>>>24-Vr%32&255);return Ir}function fc(Se,Ir){return Se>>>Ir|Se<<32-Ir}function Ih(Se,Ir){return Se>>>Ir}function Td(Se,Ir,Vr){return Se&Ir^~Se&Vr}function Dh(Se,Ir,Vr){return Se&Ir^Se&Vr^Ir&Vr}function sf(Se){return fc(Se,2)^fc(Se,13)^fc(Se,22)}function br(Se){return fc(Se,6)^fc(Se,11)^fc(Se,25)}function Qr(Se){return fc(Se,7)^fc(Se,18)^Ih(Se,3)}function Nn(Se){return fc(Se,17)^fc(Se,19)^Ih(Se,10)}var An=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function di(Se,Ir){var Vr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ri=new Array(64),Ai,bi,On,Si,ha,ia,Ia,co,to,ma,ji,En;for(Se[Ir>>5]|=128<<24-Ir%32,Se[(Ir+64>>9<<4)+15]=Ir,to=0;to>16)+(Ir>>16)+(Vr>>16);return ri<<16|Vr&65535}function ga(Se){return Array.prototype.slice.call(Se)}function Pa(Se){return ga(Se).join("")}function Ja(Se){var Ir=Se&&Se.cache,Vr=0,ri=[],Ai=[],bi=[];function On(ji,En){var oi=En&&En.stable;if(!oi){for(var Yi=0;Yi0&&(ji.push(Ni,"="),ji.push.apply(ji,ga(arguments)),ji.push(";")),Ni}return f(En,{def:Yi,toString:function(){return Pa([oi.length>0?"var "+oi.join(",")+";":"",Pa(ji)])}})}function ha(){var ji=Si(),En=Si(),oi=ji.toString,Yi=En.toString;function Ni(wi,Ua){En(wi,Ua,"=",ji.def(wi,Ua),";")}return f(function(){ji.apply(ji,ga(arguments))},{def:ji.def,entry:ji,exit:En,save:Ni,set:function(wi,Ua,Ca){Ni(wi,Ua),ji(wi,Ua,"=",Ca,";")},toString:function(){return oi()+Yi()}})}function ia(){var ji=Pa(arguments),En=ha(),oi=ha(),Yi=En.toString,Ni=oi.toString;return f(En,{then:function(){return En.apply(En,ga(arguments)),this},else:function(){return oi.apply(oi,ga(arguments)),this},toString:function(){var wi=Ni();return wi&&(wi="else{"+wi+"}"),Pa(["if(",ji,"){",Yi(),"}",wi])}})}var Ia=Si(),co={};function to(ji,En){var oi=[];function Yi(){var no="a"+oi.length;return oi.push(no),no}En=En||0;for(var Ni=0;Ni[S.viewport.x,S.viewport.y,C.viewportWidth,C.viewportHeight]},attributes:{color:{buffer:A,offset:(C,S)=>S.offset*4,divisor:1},position:{buffer:x,offset:(C,S)=>S.offset*8,divisor:1},positionFract:{buffer:_,offset:(C,S)=>S.offset*8,divisor:1},error:{buffer:d,offset:(C,S)=>S.offset*16,divisor:1},direction:{buffer:k,stride:24,offset:0},lineOffset:{buffer:k,stride:24,offset:8},capOffset:{buffer:k,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:s.prop("viewport")},viewport:s.prop("viewport"),stencil:!1,instances:s.prop("count"),count:o.length}),n(E,{update:p,draw:I,destroy:g,regl:s,gl:m,canvas:m.canvas,groups:D}),E;function E(C){C?p(C):C===null&&g(),I()}function I(C){if(typeof C=="number")return M(C);C&&!Array.isArray(C)&&(C=[C]),s._refresh(),D.forEach((S,N)=>{if(S){if(C&&(C[N]?S.draw=!0:S.draw=!1),!S.draw){S.draw=!0;return}M(N)}})}function M(C){typeof C=="number"&&(C=D[C]),C!=null&&C&&C.count&&C.color&&C.opacity&&C.positions&&C.positions.length>1&&(C.scaleRatio=[C.scale[0]*C.viewport.width,C.scale[1]*C.viewport.height],b(C),C.after&&C.after(C))}function p(C){if(!C)return;C.length!=null?typeof C[0]=="number"&&(C=[{positions:C}]):Array.isArray(C)||(C=[C]);let S=0,N=0;if(E.groups=D=C.map((V,W)=>{let F=D[W];if(V)typeof V=="function"?V={after:V}:typeof V[0]=="number"&&(V={positions:V});else return F;return V=P(V,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),F||(D[W]=F={id:W,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},V=n({},w,V)),z(F,V,[{lineWidth:H=>+H*.5,capSize:H=>+H*.5,opacity:parseFloat,errors:H=>(H=i(H),N+=H.length,H),positions:(H,q)=>(H=i(H,"float64"),q.count=Math.floor(H.length/2),q.bounds=f(H,2),q.offset=S,S+=q.count,H)},{color:(H,q)=>{let G=q.count;if(H||(H="transparent"),!Array.isArray(H)||typeof H[0]=="number"){let ht=H;H=Array(G);for(let bt=0;bt{let tt=q.bounds;return H||(H=tt),q.scale=[1/(H[2]-H[0]),1/(H[3]-H[1])],q.translate=[-H[0],-H[1]],q.scaleFract=l(q.scale),q.translateFract=l(q.translate),H},viewport:H=>{let q;return Array.isArray(H)?q={x:H[0],y:H[1],width:H[2]-H[0],height:H[3]-H[1]}:H?(q={x:H.x||H.left||0,y:H.y||H.top||0},H.right?q.width=H.right-q.x:q.width=H.w||H.width||0,H.bottom?q.height=H.bottom-q.y:q.height=H.h||H.height||0):q={x:0,y:0,width:m.drawingBufferWidth,height:m.drawingBufferHeight},q}}]),F}),S||N){let V=D.reduce((q,G,tt)=>q+(G?G.count:0),0),W=new Float64Array(V*2),F=new Uint8Array(V*4),H=new Float32Array(V*4);D.forEach((q,G)=>{if(!q)return;let{positions:tt,count:ht,offset:bt,color:vt,errors:ut}=q;ht&&(F.set(vt,bt*4),H.set(ut,bt*4),W.set(tt,bt*2))});var B=a(W);x(B);var U=l(W,B);_(U),A(F),d(H)}}function g(){x.destroy(),_.destroy(),A.destroy(),d.destroy(),k.destroy()}}}),QJ=It((et,Y)=>{var f=/[\'\"]/;Y.exports=function(y){return y?(f.test(y.charAt(0))&&(y=y.substr(1)),f.test(y.charAt(y.length-1))&&(y=y.substr(0,y.length-1)),y):""}}),XD=It((et,Y)=>{Y.exports=["inherit","initial","unset"]}),JD=It((et,Y)=>{Y.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),QD=It((et,Y)=>{Y.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),tz=It((et,Y)=>{Y.exports=["normal","italic","oblique"]}),ez=It((et,Y)=>{Y.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),tQ=It((et,Y)=>{function f(P,n){if(typeof P!="string")return[P];var i=[P];typeof n=="string"||Array.isArray(n)?n={brackets:n}:n||(n={});var a=n.brackets?Array.isArray(n.brackets)?n.brackets:[n.brackets]:["{}","[]","()"],l=n.escape||"___",o=!!n.flat;a.forEach(function(h){var m=new RegExp(["\\",h[0],"[^\\",h[0],"\\",h[1],"]*\\",h[1]].join("")),b=[];function x(_,A,d){var k=i.push(_.slice(h[0].length,-h[1].length))-1;return b.push(k),l+k+l}i.forEach(function(_,A){for(var d,k=0;_!=d;)if(d=_,_=_.replace(m,x),k++>1e4)throw Error("References have circular dependency. Please, check them.");i[A]=_}),b=b.reverse(),i=i.map(function(_){return b.forEach(function(A){_=_.replace(new RegExp("(\\"+l+A+"\\"+l+")","g"),h[0]+"$1"+h[1])}),_})});var c=new RegExp("\\"+l+"([0-9]+)\\"+l);function s(h,m,b){for(var x=[],_,A=0;_=c.exec(h);){if(A++>1e4)throw Error("Circular references in parenthesis");x.push(h.slice(0,_.index)),x.push(s(m[_[1]],m)),h=h.slice(_.index+_[0].length)}return x.push(h),x}return o?i:s(i[0],i)}function y(P,n){if(n&&n.flat){var i=n&&n.escape||"___",a=P[0],l;if(!a)return"";for(var o=new RegExp("\\"+i+"([0-9]+)\\"+i),c=0;a!=l;){if(c++>1e4)throw Error("Circular references in "+P);l=a,a=a.replace(o,s)}return a}return P.reduce(function h(m,b){return Array.isArray(b)&&(b=b.reduce(h,"")),m+b},"");function s(h,m){if(P[m]==null)throw Error("Reference "+m+"is undefined");return P[m]}}function z(P,n){return Array.isArray(P)?y(P,n):f(P,n)}z.parse=f,z.stringify=y,Y.exports=z}),eQ=It((et,Y)=>{var f=tQ();Y.exports=function(y,z,P){if(y==null)throw Error("First argument should be a string");if(z==null)throw Error("Separator should be a string or a RegExp");P?(typeof P=="string"||Array.isArray(P))&&(P={ignore:P}):P={},P.escape==null&&(P.escape=!0),P.ignore==null?P.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof P.ignore=="string"&&(P.ignore=[P.ignore]),P.ignore=P.ignore.map(function(h){return h.length===1&&(h=h+h),h}));var n=f.parse(y,{flat:!0,brackets:P.ignore}),i=n[0],a=i.split(z);if(P.escape){for(var l=[],o=0;o{Y.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),rz=It((et,Y)=>{var f=rQ();Y.exports={isSize:function(y){return/^[\d\.]/.test(y)||y.indexOf("/")!==-1||f.indexOf(y)!==-1}}}),nQ=It((et,Y)=>{var f=QJ(),y=XD(),z=JD(),P=QD(),n=tz(),i=ez(),a=eQ(),l=rz().isSize;Y.exports=c;var o=c.cache={};function c(h){if(typeof h!="string")throw new Error("Font argument must be a string.");if(o[h])return o[h];if(h==="")throw new Error("Cannot parse an empty string.");if(z.indexOf(h)!==-1)return o[h]={system:h};for(var m={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},b=a(h,/\s+/),x;x=b.shift();){if(y.indexOf(x)!==-1)return["style","variant","weight","stretch"].forEach(function(A){m[A]=x}),o[h]=m;if(n.indexOf(x)!==-1){m.style=x;continue}if(x==="normal"||x==="small-caps"){m.variant=x;continue}if(i.indexOf(x)!==-1){m.stretch=x;continue}if(P.indexOf(x)!==-1){m.weight=x;continue}if(l(x)){var _=a(x,"/");if(m.size=_[0],_[1]!=null?m.lineHeight=s(_[1]):b[0]==="/"&&(b.shift(),m.lineHeight=s(b.shift())),!b.length)throw new Error("Missing required font-family.");return m.family=a(b.join(" "),/\s*,\s*/).map(f),o[h]=m}throw new Error("Unknown or unsupported font token: "+x)}throw new Error("Missing required font-size.")}function s(h){var m=parseFloat(h);return m.toString()===h?m:h}}),nz=It((et,Y)=>{var f=t1(),y=rz().isSize,z=h(XD()),P=h(JD()),n=h(QD()),i=h(tz()),a=h(ez()),l={normal:1,"small-caps":1},o={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},c={size:"1rem",family:"serif"};Y.exports=function(m){if(m=f(m,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"}),m.system)return m.system&&s(m.system,P),m.system;if(s(m.style,i),s(m.variant,l),s(m.weight,n),s(m.stretch,a),m.size==null&&(m.size=c.size),typeof m.size=="number"&&(m.size+="px"),!y)throw Error("Bad size value `"+m.size+"`");m.family||(m.family=c.family),Array.isArray(m.family)&&(m.family.length||(m.family=[c.family]),m.family=m.family.map(function(x){return o[x]?x:'"'+x+'"'}).join(", "));var b=[];return b.push(m.style),m.variant!==m.style&&b.push(m.variant),m.weight!==m.variant&&m.weight!==m.style&&b.push(m.weight),m.stretch!==m.weight&&m.stretch!==m.variant&&m.stretch!==m.style&&b.push(m.stretch),b.push(m.size+(m.lineHeight==null||m.lineHeight==="normal"||m.lineHeight+""=="1"?"":"/"+m.lineHeight)),b.push(m.family),b.filter(Boolean).join(" ")};function s(m,b){if(m&&!b[m]&&!z[m])throw Error("Unknown keyword `"+m+"`");return m}function h(m){for(var b={},x=0;x{Y.exports={parse:nQ(),stringify:nz()}}),aQ=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():f.createREGL=y()})(et,function(){var f=function(Se,Ir){for(var Vr=Object.keys(Ir),ri=0;ri1&&Ir===Vr&&(Ir==='"'||Ir==="'"))return['"'+a(Se.substr(1,Se.length-2))+'"'];var ri=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Se);if(ri)return l(Se.substr(0,ri.index)).concat(l(ri[1])).concat(l(Se.substr(ri.index+ri[0].length)));var Ai=Se.split(".");if(Ai.length===1)return['"'+a(Se)+'"'];for(var bi=[],On=0;On"u"?1:window.devicePixelRatio,Ia=!1,co={},eo=function(En){},ma=function(){};if(typeof Ir=="string"?Vr=document.querySelector(Ir):typeof Ir=="object"&&(k(Ir)?Vr=Ir:w(Ir)?(bi=Ir,Ai=bi.canvas):("gl"in Ir?bi=Ir.gl:"canvas"in Ir?Ai=E(Ir.canvas):"container"in Ir&&(ri=E(Ir.container)),"attributes"in Ir&&(On=Ir.attributes),"extensions"in Ir&&(Si=D(Ir.extensions)),"optionalExtensions"in Ir&&(ha=D(Ir.optionalExtensions)),"onDone"in Ir&&(eo=Ir.onDone),"profile"in Ir&&(Ia=!!Ir.profile),"pixelRatio"in Ir&&(aa=+Ir.pixelRatio),"cachedCode"in Ir&&(co=Ir.cachedCode))),Vr&&(Vr.nodeName.toLowerCase()==="canvas"?Ai=Vr:ri=Vr),!bi){if(!Ai){var ji=A(ri||document.body,eo,aa);if(!ji)return null;Ai=ji.canvas,ma=ji.onDestroy}On.premultipliedAlpha===void 0&&(On.premultipliedAlpha=!0),bi=d(Ai,On)}return bi?{gl:bi,canvas:Ai,container:ri,extensions:Si,optionalExtensions:ha,pixelRatio:aa,profile:Ia,cachedCode:co,onDone:eo,onDestroy:ma}:(ma(),eo("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(Se,Ir){var Vr={};function ri(On){var Si=On.toLowerCase(),ha;try{ha=Vr[Si]=Se.getExtension(Si)}catch{}return!!ha}for(var Ai=0;Ai65535)<<4,Se>>>=Ir,Vr=(Se>255)<<3,Se>>>=Vr,Ir|=Vr,Vr=(Se>15)<<2,Se>>>=Vr,Ir|=Vr,Vr=(Se>3)<<1,Se>>>=Vr,Ir|=Vr,Ir|Se>>1}function H(){var Se=p(8,function(){return[]});function Ir(bi){var On=W(bi),Si=Se[F(On)>>2];return Si.length>0?Si.pop():new ArrayBuffer(On)}function Vr(bi){Se[F(bi.byteLength)>>2].push(bi)}function ri(bi,On){var Si=null;switch(bi){case g:Si=new Int8Array(Ir(On),0,On);break;case C:Si=new Uint8Array(Ir(On),0,On);break;case S:Si=new Int16Array(Ir(2*On),0,On);break;case N:Si=new Uint16Array(Ir(2*On),0,On);break;case B:Si=new Int32Array(Ir(4*On),0,On);break;case U:Si=new Uint32Array(Ir(4*On),0,On);break;case V:Si=new Float32Array(Ir(4*On),0,On);break;default:return null}return Si.length!==On?Si.subarray(0,On):Si}function Ai(bi){Vr(bi.buffer)}return{alloc:Ir,free:Vr,allocType:ri,freeType:Ai}}var q=H();q.zero=H();var G=3408,tt=3410,ht=3411,bt=3412,vt=3413,ut=3414,rt=3415,gt=33901,it=33902,st=3379,xt=3386,ot=34921,J=36347,mt=36348,dt=35661,Ct=35660,Rt=34930,Bt=36349,Zt=34076,Gt=34024,ee=7936,xe=7937,ge=7938,ye=35724,ue=34047,Mt=36063,Ot=34852,Lt=3553,ie=34067,be=34069,ce=33984,Le=6408,Ze=5126,Qe=5121,mr=36160,fr=36053,Jr=36064,an=16384,Er=function(Se,Ir){var Vr=1;Ir.ext_texture_filter_anisotropic&&(Vr=Se.getParameter(ue));var ri=1,Ai=1;Ir.webgl_draw_buffers&&(ri=Se.getParameter(Ot),Ai=Se.getParameter(Mt));var bi=!!Ir.oes_texture_float;if(bi){var On=Se.createTexture();Se.bindTexture(Lt,On),Se.texImage2D(Lt,0,Le,1,1,0,Le,Ze,null);var Si=Se.createFramebuffer();if(Se.bindFramebuffer(mr,Si),Se.framebufferTexture2D(mr,Jr,Lt,On,0),Se.bindTexture(Lt,null),Se.checkFramebufferStatus(mr)!==fr)bi=!1;else{Se.viewport(0,0,1,1),Se.clearColor(1,0,0,1),Se.clear(an);var ha=q.allocType(Ze,4);Se.readPixels(0,0,1,1,Le,Ze,ha),Se.getError()?bi=!1:(Se.deleteFramebuffer(Si),Se.deleteTexture(On),bi=ha[0]===1),q.freeType(ha)}}var aa=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ia=!0;if(!aa){var co=Se.createTexture(),eo=q.allocType(Qe,36);Se.activeTexture(ce),Se.bindTexture(ie,co),Se.texImage2D(be,0,Le,3,3,0,Le,Qe,eo),q.freeType(eo),Se.bindTexture(ie,null),Se.deleteTexture(co),Ia=!Se.getError()}return{colorBits:[Se.getParameter(tt),Se.getParameter(ht),Se.getParameter(bt),Se.getParameter(vt)],depthBits:Se.getParameter(ut),stencilBits:Se.getParameter(rt),subpixelBits:Se.getParameter(G),extensions:Object.keys(Ir).filter(function(ma){return!!Ir[ma]}),maxAnisotropic:Vr,maxDrawbuffers:ri,maxColorAttachments:Ai,pointSizeDims:Se.getParameter(gt),lineWidthDims:Se.getParameter(it),maxViewportDims:Se.getParameter(xt),maxCombinedTextureUnits:Se.getParameter(dt),maxCubeMapSize:Se.getParameter(Zt),maxRenderbufferSize:Se.getParameter(Gt),maxTextureUnits:Se.getParameter(Rt),maxTextureSize:Se.getParameter(st),maxAttributes:Se.getParameter(ot),maxVertexUniforms:Se.getParameter(J),maxVertexTextureUnits:Se.getParameter(Ct),maxVaryingVectors:Se.getParameter(mt),maxFragmentUniforms:Se.getParameter(Bt),glsl:Se.getParameter(ye),renderer:Se.getParameter(xe),vendor:Se.getParameter(ee),version:Se.getParameter(ge),readFloat:bi,npotTextureCube:Ia}},dn=function(Se){return Se instanceof Uint8Array||Se instanceof Uint16Array||Se instanceof Uint32Array||Se instanceof Int8Array||Se instanceof Int16Array||Se instanceof Int32Array||Se instanceof Float32Array||Se instanceof Float64Array||Se instanceof Uint8ClampedArray};function _n(Se){return!!Se&&typeof Se=="object"&&Array.isArray(Se.shape)&&Array.isArray(Se.stride)&&typeof Se.offset=="number"&&Se.shape.length===Se.stride.length&&(Array.isArray(Se.data)||dn(Se.data))}var Oe=function(Se){return Object.keys(Se).map(function(Ir){return Se[Ir]})},Xt={shape:ae,flatten:Ht};function oe(Se,Ir,Vr){for(var ri=0;ri0){var io;if(Array.isArray(oi[0])){Ca=fi(oi);for(var Ri=1,ki=1;ki0){if(typeof Ri[0]=="number"){var la=q.allocType(wi.dtype,Ri.length);mn(la,Ri),Ca(la,$a),q.freeType(la)}else if(Array.isArray(Ri[0])||dn(Ri[0])){Ea=fi(Ri);var ua=Ci(Ri,Ea,wi.dtype);Ca(ua,$a),q.freeType(ua)}}}else if(_n(Ri)){Ea=Ri.shape;var Oa=Ri.stride,Vo=0,Bo=0,za=0,Ya=0;Ea.length===1?(Vo=Ea[0],Bo=1,za=Oa[0],Ya=0):Ea.length===2&&(Vo=Ea[0],Bo=Ea[1],za=Oa[0],Ya=Oa[1]);var Eo=Array.isArray(Ri.data)?wi.dtype:Ar(Ri.data),No=q.allocType(Eo,Vo*Bo);Zn(No,Ri.data,Vo,Bo,za,Ya,Ri.offset),Ca(No,$a),q.freeType(No)}return Ua}return Yi||Ua(En),Ua._reglType="buffer",Ua._buffer=wi,Ua.subdata=io,Vr.profile&&(Ua.stats=wi.stats),Ua.destroy=function(){eo(wi)},Ua}function ji(){Oe(bi).forEach(function(En){En.buffer=Se.createBuffer(),Se.bindBuffer(En.type,En.buffer),Se.bufferData(En.type,En.persistentData||En.byteLength,En.usage)})}return Vr.profile&&(Ir.getTotalBufferSize=function(){var En=0;return Object.keys(bi).forEach(function(oi){En+=bi[oi].stats.size}),En}),{create:ma,createStream:ha,destroyStream:aa,clear:function(){Oe(bi).forEach(eo),Si.forEach(eo)},getBuffer:function(En){return En&&En._buffer instanceof On?En._buffer:null},restore:ji,_initBuffer:co}}var Wn=0,Li=0,Fi=1,Zi=1,Ji=4,ca=4,Ei={points:Wn,point:Li,lines:Fi,line:Zi,triangles:Ji,triangle:ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ga=0,so=1,Fe=4,Re=5120,Kr=5121,sn=5122,cn=5123,Yr=5124,un=5125,Pn=34963,bn=35040,ze=35044;function yr(Se,Ir,Vr,ri){var Ai={},bi=0,On={uint8:Kr,uint16:cn};Ir.oes_element_index_uint&&(On.uint32=un);function Si(ji){this.id=bi++,Ai[this.id]=this,this.buffer=ji,this.primType=Fe,this.vertCount=0,this.type=0}Si.prototype.bind=function(){this.buffer.bind()};var ha=[];function aa(ji){var En=ha.pop();return En||(En=new Si(Vr.create(null,Pn,!0,!1)._buffer)),co(En,ji,bn,-1,-1,0,0),En}function Ia(ji){ha.push(ji)}function co(ji,En,oi,Yi,Ni,wi,Ua){ji.buffer.bind();var Ca;if(En){var io=Ua;!Ua&&(!dn(En)||_n(En)&&!dn(En.data))&&(io=Ir.oes_element_index_uint?un:cn),Vr._initBuffer(ji.buffer,En,oi,io,3)}else Se.bufferData(Pn,wi,oi),ji.buffer.dtype=Ca||Kr,ji.buffer.usage=oi,ji.buffer.dimension=3,ji.buffer.byteLength=wi;if(Ca=Ua,!Ua){switch(ji.buffer.dtype){case Kr:case Re:Ca=Kr;break;case cn:case sn:Ca=cn;break;case un:case Yr:Ca=un;break}ji.buffer.dtype=Ca}ji.type=Ca;var Ri=Ni;Ri<0&&(Ri=ji.buffer.byteLength,Ca===cn?Ri>>=1:Ca===un&&(Ri>>=2)),ji.vertCount=Ri;var ki=Yi;if(Yi<0){ki=Fe;var $a=ji.buffer.dimension;$a===1&&(ki=Ga),$a===2&&(ki=so),$a===3&&(ki=Fe)}ji.primType=ki}function eo(ji){ri.elementsCount--,delete Ai[ji.id],ji.buffer.destroy(),ji.buffer=null}function ma(ji,En){var oi=Vr.create(null,Pn,!0),Yi=new Si(oi._buffer);ri.elementsCount++;function Ni(wi){if(!wi)oi(),Yi.primType=Fe,Yi.vertCount=0,Yi.type=Kr;else if(typeof wi=="number")oi(wi),Yi.primType=Fe,Yi.vertCount=wi|0,Yi.type=Kr;else{var Ua=null,Ca=ze,io=-1,Ri=-1,ki=0,$a=0;Array.isArray(wi)||dn(wi)||_n(wi)?Ua=wi:("data"in wi&&(Ua=wi.data),"usage"in wi&&(Ca=Gi[wi.usage]),"primitive"in wi&&(io=Ei[wi.primitive]),"count"in wi&&(Ri=wi.count|0),"type"in wi&&($a=On[wi.type]),"length"in wi?ki=wi.length|0:(ki=Ri,$a===cn||$a===sn?ki*=2:($a===un||$a===Yr)&&(ki*=4))),co(Yi,Ua,Ca,io,Ri,ki,$a)}return Ni}return Ni(ji),Ni._reglType="elements",Ni._elements=Yi,Ni.subdata=function(wi,Ua){return oi.subdata(wi,Ua),Ni},Ni.destroy=function(){eo(Yi)},Ni}return{create:ma,createStream:aa,destroyStream:Ia,getElements:function(ji){return typeof ji=="function"&&ji._elements instanceof Si?ji._elements:null},clear:function(){Oe(Ai).forEach(eo)}}}var en=new Float32Array(1),Rn=new Uint32Array(en.buffer),ni=5123;function xi(Se){for(var Ir=q.allocType(ni,Se.length),Vr=0;Vr>>31<<15,bi=(ri<<1>>>24)-127,On=ri>>13&1023;if(bi<-24)Ir[Vr]=Ai;else if(bi<-14){var Si=-14-bi;Ir[Vr]=Ai+(On+1024>>Si)}else bi>15?Ir[Vr]=Ai+31744:Ir[Vr]=Ai+(bi+15<<10)+On}return Ir}function Jn(Se){return Array.isArray(Se)||dn(Se)}var Gn=34467,pi=3553,Va=34067,ea=34069,go=6408,mo=6406,Go=6407,Po=6409,Zo=6410,Ka=32854,Cs=32855,ps=36194,wl=32819,is=32820,ol=33635,ms=34042,kl=6402,ul=34041,Kl=35904,vs=35906,Ns=36193,Uo=33776,Ds=33777,Ol=33778,tc=33779,sc=35986,Xs=35987,Wa=34798,Co=35840,el=35841,lc=35842,ss=35843,nc=36196,yl=5121,$l=5123,Gc=5125,ko=5126,zs=10242,js=10243,mc=10497,Tl=33071,us=33648,Rc=10240,iu=10241,Dl=9728,ql=9729,cc=9984,dc=9985,pu=9986,Ah=9987,uh=33170,yh=4352,tf=4353,Nd=4354,Gl=34046,Yu=3317,ef=37440,xu=37441,mu=37443,bu=37444,_h=33984,_c=[cc,pu,dc,Ah],gu=[0,Po,Zo,Go,go],pl={};pl[Po]=pl[mo]=pl[kl]=1,pl[ul]=pl[Zo]=2,pl[Go]=pl[Kl]=3,pl[go]=pl[vs]=4;function ic(Se){return"[object "+Se+"]"}var jh=ic("HTMLCanvasElement"),Hu=ic("OffscreenCanvas"),Qh=ic("CanvasRenderingContext2D"),Lc=ic("ImageBitmap"),Xf=ic("HTMLImageElement"),hl=ic("HTMLVideoElement"),pp=Object.keys(he).concat([jh,Hu,Qh,Lc,Xf,hl]),Hl=[];Hl[yl]=1,Hl[ko]=4,Hl[Ns]=2,Hl[$l]=2,Hl[Gc]=4;var cs=[];cs[Ka]=2,cs[Cs]=2,cs[ps]=2,cs[ul]=4,cs[Uo]=.5,cs[Ds]=.5,cs[Ol]=1,cs[tc]=1,cs[sc]=.5,cs[Xs]=1,cs[Wa]=1,cs[Co]=.5,cs[el]=.25,cs[lc]=.5,cs[ss]=.25,cs[nc]=.5;function _d(Se){return Array.isArray(Se)&&(Se.length===0||typeof Se[0]=="number")}function xh(Se){if(!Array.isArray(Se))return!1;var Ir=Se.length;return!(Ir===0||!Jn(Se[0]))}function hu(Se){return Object.prototype.toString.call(Se)}function rf(Se){return hu(Se)===jh}function td(Se){return hu(Se)===Hu}function Ed(Se){return hu(Se)===Qh}function vu(Se){return hu(Se)===Lc}function Lf(Se){return hu(Se)===Xf}function hf(Se){return hu(Se)===hl}function Ld(Se){if(!Se)return!1;var Ir=hu(Se);return pp.indexOf(Ir)>=0?!0:_d(Se)||xh(Se)||_n(Se)}function ed(Se){return he[Object.prototype.toString.call(Se)]|0}function nf(Se,Ir){var Vr=Ir.length;switch(Se.type){case yl:case $l:case Gc:case ko:var ri=q.allocType(Se.type,Vr);ri.set(Ir),Se.data=ri;break;case Ns:Se.data=xi(Ir);break}}function af(Se,Ir){return q.allocType(Se.type===Ns?ko:Se.type,Ir)}function bh(Se,Ir){Se.type===Ns?(Se.data=xi(Ir),q.freeType(Ir)):Se.data=Ir}function df(Se,Ir,Vr,ri,Ai,bi){for(var On=Se.width,Si=Se.height,ha=Se.channels,aa=On*Si*ha,Ia=af(Se,aa),co=0,eo=0;eo=1;)Si+=On*ha*ha,ha/=2;return Si}else return On*Vr*ri}function Mh(Se,Ir,Vr,ri,Ai,bi,On){var Si={"don't care":yh,"dont care":yh,nice:Nd,fast:tf},ha={repeat:mc,clamp:Tl,mirror:us},aa={nearest:Dl,linear:ql},Ia=f({mipmap:Ah,"nearest mipmap nearest":cc,"linear mipmap nearest":dc,"nearest mipmap linear":pu,"linear mipmap linear":Ah},aa),co={none:0,browser:bu},eo={uint8:yl,rgba4:wl,rgb565:ol,"rgb5 a1":is},ma={alpha:mo,luminance:Po,"luminance alpha":Zo,rgb:Go,rgba:go,rgba4:Ka,"rgb5 a1":Cs,rgb565:ps},ji={};Ir.ext_srgb&&(ma.srgb=Kl,ma.srgba=vs),Ir.oes_texture_float&&(eo.float32=eo.float=ko),Ir.oes_texture_half_float&&(eo.float16=eo["half float"]=Ns),Ir.webgl_depth_texture&&(f(ma,{depth:kl,"depth stencil":ul}),f(eo,{uint16:$l,uint32:Gc,"depth stencil":ms})),Ir.webgl_compressed_texture_s3tc&&f(ji,{"rgb s3tc dxt1":Uo,"rgba s3tc dxt1":Ds,"rgba s3tc dxt3":Ol,"rgba s3tc dxt5":tc}),Ir.webgl_compressed_texture_atc&&f(ji,{"rgb atc":sc,"rgba atc explicit alpha":Xs,"rgba atc interpolated alpha":Wa}),Ir.webgl_compressed_texture_pvrtc&&f(ji,{"rgb pvrtc 4bppv1":Co,"rgb pvrtc 2bppv1":el,"rgba pvrtc 4bppv1":lc,"rgba pvrtc 2bppv1":ss}),Ir.webgl_compressed_texture_etc1&&(ji["rgb etc1"]=nc);var En=Array.prototype.slice.call(Se.getParameter(Gn));Object.keys(ji).forEach(function(Z){var lt=ji[Z];En.indexOf(lt)>=0&&(ma[Z]=lt)});var oi=Object.keys(ma);Vr.textureFormats=oi;var Yi=[];Object.keys(ma).forEach(function(Z){var lt=ma[Z];Yi[lt]=Z});var Ni=[];Object.keys(eo).forEach(function(Z){var lt=eo[Z];Ni[lt]=Z});var wi=[];Object.keys(aa).forEach(function(Z){var lt=aa[Z];wi[lt]=Z});var Ua=[];Object.keys(Ia).forEach(function(Z){var lt=Ia[Z];Ua[lt]=Z});var Ca=[];Object.keys(ha).forEach(function(Z){var lt=ha[Z];Ca[lt]=Z});var io=oi.reduce(function(Z,lt){var nt=ma[lt];return nt===Po||nt===mo||nt===Po||nt===Zo||nt===kl||nt===ul||Ir.ext_srgb&&(nt===Kl||nt===vs)?Z[nt]=nt:nt===Cs||lt.indexOf("rgba")>=0?Z[nt]=go:Z[nt]=Go,Z},{});function Ri(){this.internalformat=go,this.format=go,this.type=yl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bu,this.width=0,this.height=0,this.channels=0}function ki(Z,lt){Z.internalformat=lt.internalformat,Z.format=lt.format,Z.type=lt.type,Z.compressed=lt.compressed,Z.premultiplyAlpha=lt.premultiplyAlpha,Z.flipY=lt.flipY,Z.unpackAlignment=lt.unpackAlignment,Z.colorSpace=lt.colorSpace,Z.width=lt.width,Z.height=lt.height,Z.channels=lt.channels}function $a(Z,lt){if(!(typeof lt!="object"||!lt)){if("premultiplyAlpha"in lt&&(Z.premultiplyAlpha=lt.premultiplyAlpha),"flipY"in lt&&(Z.flipY=lt.flipY),"alignment"in lt&&(Z.unpackAlignment=lt.alignment),"colorSpace"in lt&&(Z.colorSpace=co[lt.colorSpace]),"type"in lt){var nt=lt.type;Z.type=eo[nt]}var wt=Z.width,Wt=Z.height,ve=Z.channels,ke=!1;"shape"in lt?(wt=lt.shape[0],Wt=lt.shape[1],lt.shape.length===3&&(ve=lt.shape[2],ke=!0)):("radius"in lt&&(wt=Wt=lt.radius),"width"in lt&&(wt=lt.width),"height"in lt&&(Wt=lt.height),"channels"in lt&&(ve=lt.channels,ke=!0)),Z.width=wt|0,Z.height=Wt|0,Z.channels=ve|0;var Jt=!1;if("format"in lt){var fe=lt.format,De=Z.internalformat=ma[fe];Z.format=io[De],fe in eo&&("type"in lt||(Z.type=eo[fe])),fe in ji&&(Z.compressed=!0),Jt=!0}!ke&&Jt?Z.channels=pl[Z.format]:ke&&!Jt&&Z.channels!==gu[Z.format]&&(Z.format=Z.internalformat=gu[Z.channels])}}function Ea(Z){Se.pixelStorei(ef,Z.flipY),Se.pixelStorei(xu,Z.premultiplyAlpha),Se.pixelStorei(mu,Z.colorSpace),Se.pixelStorei(Yu,Z.unpackAlignment)}function la(){Ri.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ua(Z,lt){var nt=null;if(Ld(lt)?nt=lt:lt&&($a(Z,lt),"x"in lt&&(Z.xOffset=lt.x|0),"y"in lt&&(Z.yOffset=lt.y|0),Ld(lt.data)&&(nt=lt.data)),lt.copy){var wt=Ai.viewportWidth,Wt=Ai.viewportHeight;Z.width=Z.width||wt-Z.xOffset,Z.height=Z.height||Wt-Z.yOffset,Z.needsCopy=!0}else if(!nt)Z.width=Z.width||1,Z.height=Z.height||1,Z.channels=Z.channels||4;else if(dn(nt))Z.channels=Z.channels||4,Z.data=nt,!("type"in lt)&&Z.type===yl&&(Z.type=ed(nt));else if(_d(nt))Z.channels=Z.channels||4,nf(Z,nt),Z.alignment=1,Z.needsFree=!0;else if(_n(nt)){var ve=nt.data;!Array.isArray(ve)&&Z.type===yl&&(Z.type=ed(ve));var ke=nt.shape,Jt=nt.stride,fe,De,lr,tr,ar,dr;ke.length===3?(lr=ke[2],dr=Jt[2]):(lr=1,dr=1),fe=ke[0],De=ke[1],tr=Jt[0],ar=Jt[1],Z.alignment=1,Z.width=fe,Z.height=De,Z.channels=lr,Z.format=Z.internalformat=gu[lr],Z.needsFree=!0,df(Z,ve,tr,ar,dr,nt.offset)}else if(rf(nt)||td(nt)||Ed(nt))rf(nt)||td(nt)?Z.element=nt:Z.element=nt.canvas,Z.width=Z.element.width,Z.height=Z.element.height,Z.channels=4;else if(vu(nt))Z.element=nt,Z.width=nt.width,Z.height=nt.height,Z.channels=4;else if(Lf(nt))Z.element=nt,Z.width=nt.naturalWidth,Z.height=nt.naturalHeight,Z.channels=4;else if(hf(nt))Z.element=nt,Z.width=nt.videoWidth,Z.height=nt.videoHeight,Z.channels=4;else if(xh(nt)){var gr=Z.width||nt[0].length,Ge=Z.height||nt.length,rr=Z.channels;Jn(nt[0][0])?rr=rr||nt[0][0].length:rr=rr||1;for(var Je=Xt.shape(nt),Hr=1,wn=0;wn>=Wt,nt.height>>=Wt,ua(nt,wt[Wt]),Z.mipmask|=1<=0&&!("faces"in lt)&&(Z.genMipmaps=!0)}if("mag"in lt){var wt=lt.mag;Z.magFilter=aa[wt]}var Wt=Z.wrapS,ve=Z.wrapT;if("wrap"in lt){var ke=lt.wrap;typeof ke=="string"?Wt=ve=ha[ke]:Array.isArray(ke)&&(Wt=ha[ke[0]],ve=ha[ke[1]])}else{if("wrapS"in lt){var Jt=lt.wrapS;Wt=ha[Jt]}if("wrapT"in lt){var fe=lt.wrapT;ve=ha[fe]}}if(Z.wrapS=Wt,Z.wrapT=ve,"anisotropic"in lt&&(lt.anisotropic,Z.anisotropic=lt.anisotropic),"mipmap"in lt){var De=!1;switch(typeof lt.mipmap){case"string":Z.mipmapHint=Si[lt.mipmap],Z.genMipmaps=!0,De=!0;break;case"boolean":De=Z.genMipmaps=lt.mipmap;break;case"object":Z.genMipmaps=!1,De=!0;break}De&&!("min"in lt)&&(Z.minFilter=cc)}}function ku(Z,lt){Se.texParameteri(lt,iu,Z.minFilter),Se.texParameteri(lt,Rc,Z.magFilter),Se.texParameteri(lt,zs,Z.wrapS),Se.texParameteri(lt,js,Z.wrapT),Ir.ext_texture_filter_anisotropic&&Se.texParameteri(lt,Gl,Z.anisotropic),Z.genMipmaps&&(Se.hint(uh,Z.mipmapHint),Se.generateMipmap(lt))}var Eu=0,Ec={},kc=Vr.maxTextureUnits,zc=Array(kc).map(function(){return null});function Xo(Z){Ri.call(this),this.mipmask=0,this.internalformat=go,this.id=Eu++,this.refCount=1,this.target=Z,this.texture=Se.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Cl,On.profile&&(this.stats={size:0})}function Oc(Z){Se.activeTexture(_h),Se.bindTexture(Z.target,Z.texture)}function xl(){var Z=zc[0];Z?Se.bindTexture(Z.target,Z.texture):Se.bindTexture(pi,null)}function jc(Z){var lt=Z.texture,nt=Z.unit,wt=Z.target;nt>=0&&(Se.activeTexture(_h+nt),Se.bindTexture(wt,null),zc[nt]=null),Se.deleteTexture(lt),Z.texture=null,Z.params=null,Z.pixels=null,Z.refCount=0,delete Ec[Z.id],bi.textureCount--}f(Xo.prototype,{bind:function(){var Z=this;Z.bindCount+=1;var lt=Z.unit;if(lt<0){for(var nt=0;nt0)continue;wt.unit=-1}zc[nt]=Z,lt=nt;break}On.profile&&bi.maxTextureUnits>ar)-lr,dr.height=dr.height||(nt.height>>ar)-tr,Oc(nt),Vo(dr,pi,lr,tr,ar),xl(),Ya(dr),wt}function ve(ke,Jt){var fe=ke|0,De=Jt|0||fe;if(fe===nt.width&&De===nt.height)return wt;wt.width=nt.width=fe,wt.height=nt.height=De,Oc(nt);for(var lr=0;nt.mipmask>>lr;++lr){var tr=fe>>lr,ar=De>>lr;if(!tr||!ar)break;Se.texImage2D(pi,lr,nt.format,tr,ar,0,nt.format,nt.type,null)}return xl(),On.profile&&(nt.stats.size=Uh(nt.internalformat,nt.type,fe,De,!1,!1)),wt}return wt(Z,lt),wt.subimage=Wt,wt.resize=ve,wt._reglType="texture2d",wt._texture=nt,On.profile&&(wt.stats=nt.stats),wt.destroy=function(){nt.decRef()},wt}function jo(Z,lt,nt,wt,Wt,ve){var ke=new Xo(Va);Ec[ke.id]=ke,bi.cubeCount++;var Jt=new Array(6);function fe(tr,ar,dr,gr,Ge,rr){var Je,Hr=ke.texInfo;for(Cl.call(Hr),Je=0;Je<6;++Je)Jt[Je]=ys();if(typeof tr=="number"||!tr){var wn=tr|0||1;for(Je=0;Je<6;++Je)No(Jt[Je],wn,wn)}else if(typeof tr=="object")if(ar)hs(Jt[0],tr),hs(Jt[1],ar),hs(Jt[2],dr),hs(Jt[3],gr),hs(Jt[4],Ge),hs(Jt[5],rr);else if(Nc(Hr,tr),$a(ke,tr),"faces"in tr){var Ln=tr.faces;for(Je=0;Je<6;++Je)ki(Jt[Je],ke),hs(Jt[Je],Ln[Je])}else for(Je=0;Je<6;++Je)hs(Jt[Je],tr);for(ki(ke,Jt[0]),Hr.genMipmaps?ke.mipmask=(Jt[0].width<<1)-1:ke.mipmask=Jt[0].mipmask,ke.internalformat=Jt[0].internalformat,fe.width=Jt[0].width,fe.height=Jt[0].height,Oc(ke),Je=0;Je<6;++Je)Xl(Jt[Je],ea+Je);for(ku(Hr,Va),xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,Hr.genMipmaps,!0)),fe.format=Yi[ke.internalformat],fe.type=Ni[ke.type],fe.mag=wi[Hr.magFilter],fe.min=Ua[Hr.minFilter],fe.wrapS=Ca[Hr.wrapS],fe.wrapT=Ca[Hr.wrapT],Je=0;Je<6;++Je)Dc(Jt[Je]);return fe}function De(tr,ar,dr,gr,Ge){var rr=dr|0,Je=gr|0,Hr=Ge|0,wn=za();return ki(wn,ke),wn.width=0,wn.height=0,ua(wn,ar),wn.width=wn.width||(ke.width>>Hr)-rr,wn.height=wn.height||(ke.height>>Hr)-Je,Oc(ke),Vo(wn,ea+tr,rr,Je,Hr),xl(),Ya(wn),fe}function lr(tr){var ar=tr|0;if(ar!==ke.width){fe.width=ke.width=ar,fe.height=ke.height=ar,Oc(ke);for(var dr=0;dr<6;++dr)for(var gr=0;ke.mipmask>>gr;++gr)Se.texImage2D(ea+dr,gr,ke.format,ar>>gr,ar>>gr,0,ke.format,ke.type,null);return xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,!1,!0)),fe}}return fe(Z,lt,nt,wt,Wt,ve),fe.subimage=De,fe.resize=lr,fe._reglType="textureCube",fe._texture=ke,On.profile&&(fe.stats=ke.stats),fe.destroy=function(){ke.decRef()},fe}function Rs(){for(var Z=0;Z>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);else for(var Wt=0;Wt<6;++Wt)Se.texImage2D(ea+Wt,wt,nt.internalformat,nt.width>>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);ku(nt.texInfo,nt.target)})}function Pl(){for(var Z=0;Z=0?Dc=!0:ha.indexOf(Cl)>=0&&(Dc=!1))),("depthTexture"in Xo||"depthStencilTexture"in Xo)&&(zc=!!(Xo.depthTexture||Xo.depthStencilTexture)),"depth"in Xo&&(typeof Xo.depth=="boolean"?Xl=Xo.depth:(Eu=Xo.depth,Rl=!1)),"stencil"in Xo&&(typeof Xo.stencil=="boolean"?Rl=Xo.stencil:(Ec=Xo.stencil,Xl=!1)),"depthStencil"in Xo&&(typeof Xo.depthStencil=="boolean"?Xl=Rl=Xo.depthStencil:(kc=Xo.depthStencil,Xl=!1,Rl=!1))}var xl=null,jc=null,Lu=null,jo=null;if(Array.isArray(ys))xl=ys.map(ji);else if(ys)xl=[ji(ys)];else for(xl=new Array(ku),Eo=0;Eo0&&(Ya.depth=ua[0].depth,Ya.stencil=ua[0].stencil,Ya.depthStencil=ua[0].depthStencil),ua[za]?ua[za](Ya):ua[za]=ki(Ya)}return f(Oa,{width:Eo,height:Eo,color:Cl})}function Vo(Bo){var za,Ya=Bo|0;if(Ya===Oa.width)return Oa;var Eo=Oa.color;for(za=0;za=Eo.byteLength?No.subdata(Eo):(No.destroy(),ki.buffers[Bo]=null)),ki.buffers[Bo]||(No=ki.buffers[Bo]=Ai.create(za,Hd,!1,!0)),Ya.buffer=Ai.getBuffer(No),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,Oa[Bo]=1}else Ai.getBuffer(za)?(Ya.buffer=Ai.getBuffer(za),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):Ai.getBuffer(za.buffer)?(Ya.buffer=Ai.getBuffer(za.buffer),Ya.size=(+za.size||Ya.buffer.dimension)|0,Ya.normalized=!!za.normalized||!1,"type"in za?Ya.type=ci[za.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(za.offset||0)|0,Ya.stride=(za.stride||0)|0,Ya.divisor=(za.divisor||0)|0,Ya.state=1):"x"in za&&(Ya.x=+za.x||0,Ya.y=+za.y||0,Ya.z=+za.z||0,Ya.w=+za.w||0,Ya.state=2)}for(var hs=0;hs1)for(var Ea=0;EaEn&&(En=oi.stats.uniformsCount)}),En},Vr.getMaxAttributesCount=function(){var En=0;return Ia.forEach(function(oi){oi.stats.attributesCount>En&&(En=oi.stats.attributesCount)}),En});function ji(){Ai={},bi={};for(var En=0;En>>4&15)+Ir.charAt(ri&15);return Vr}function Vh(Se){for(var Ir="",Vr=-1,ri,Ai;++Vr>>6&31,128|ri&63):ri<=65535?Ir+=String.fromCharCode(224|ri>>>12&15,128|ri>>>6&63,128|ri&63):ri<=2097151&&(Ir+=String.fromCharCode(240|ri>>>18&7,128|ri>>>12&63,128|ri>>>6&63,128|ri&63));return Ir}function Ph(Se){for(var Ir=Array(Se.length>>2),Vr=0;Vr>5]|=(Se.charCodeAt(Vr/8)&255)<<24-Vr%32;return Ir}function Zc(Se){for(var Ir="",Vr=0;Vr>5]>>>24-Vr%32&255);return Ir}function fc(Se,Ir){return Se>>>Ir|Se<<32-Ir}function Ih(Se,Ir){return Se>>>Ir}function Td(Se,Ir,Vr){return Se&Ir^~Se&Vr}function Dh(Se,Ir,Vr){return Se&Ir^Se&Vr^Ir&Vr}function sf(Se){return fc(Se,2)^fc(Se,13)^fc(Se,22)}function br(Se){return fc(Se,6)^fc(Se,11)^fc(Se,25)}function Qr(Se){return fc(Se,7)^fc(Se,18)^Ih(Se,3)}function Nn(Se){return fc(Se,17)^fc(Se,19)^Ih(Se,10)}var An=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function di(Se,Ir){var Vr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ri=new Array(64),Ai,bi,On,Si,ha,aa,Ia,co,eo,ma,ji,En;for(Se[Ir>>5]|=128<<24-Ir%32,Se[(Ir+64>>9<<4)+15]=Ir,eo=0;eo>16)+(Ir>>16)+(Vr>>16);return ri<<16|Vr&65535}function ga(Se){return Array.prototype.slice.call(Se)}function Pa(Se){return ga(Se).join("")}function Qa(Se){var Ir=Se&&Se.cache,Vr=0,ri=[],Ai=[],bi=[];function On(ji,En){var oi=En&&En.stable;if(!oi){for(var Yi=0;Yi0&&(ji.push(Ni,"="),ji.push.apply(ji,ga(arguments)),ji.push(";")),Ni}return f(En,{def:Yi,toString:function(){return Pa([oi.length>0?"var "+oi.join(",")+";":"",Pa(ji)])}})}function ha(){var ji=Si(),En=Si(),oi=ji.toString,Yi=En.toString;function Ni(wi,Ua){En(wi,Ua,"=",ji.def(wi,Ua),";")}return f(function(){ji.apply(ji,ga(arguments))},{def:ji.def,entry:ji,exit:En,save:Ni,set:function(wi,Ua,Ca){Ni(wi,Ua),ji(wi,Ua,"=",Ca,";")},toString:function(){return oi()+Yi()}})}function aa(){var ji=Pa(arguments),En=ha(),oi=ha(),Yi=En.toString,Ni=oi.toString;return f(En,{then:function(){return En.apply(En,ga(arguments)),this},else:function(){return oi.apply(oi,ga(arguments)),this},toString:function(){var wi=Ni();return wi&&(wi="else{"+wi+"}"),Pa(["if(",ji,"){",Yi(),"}",wi])}})}var Ia=Si(),co={};function eo(ji,En){var oi=[];function Yi(){var io="a"+oi.length;return oi.push(io),io}En=En||0;for(var Ni=0;Ni":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Oi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$i={cw:de,ccw:Ie};function Ki(Se){return Array.isArray(Se)||dn(Se)||_n(Se)}function sa(Se){return Se.sort(function(Ir,Vr){return Ir===eu?-1:Vr===eu?1:Ir=1,ri>=2,Ir)}else if(Vr===gs){var Ai=Se.data;return new vi(Ai.thisDep,Ai.contextDep,Ai.propDep,Ir)}else{if(Vr===ws)return new vi(!1,!1,!1,Ir);if(Vr===bo){for(var bi=!1,On=!1,Si=!1,ha=0;ha=1&&(On=!0),Ia>=2&&(Si=!0)}else ia.type===gs&&(bi=bi||ia.data.thisDep,On=On||ia.data.contextDep,Si=Si||ia.data.propDep)}return new vi(bi,On,Si,Ir)}else return new vi(Vr===os,Vr===fs,Vr===_o,Ir)}}var $o=new vi(!1,!1,!1,function(){});function Ko(Se,Ir,Vr,ri,Ai,bi,On,Si,ha,ia,Ia,co,to,ma,ji,En){var oi=ia.Record,Yi={add:32774,subtract:32778,"reverse subtract":32779};Vr.ext_blend_minmax&&(Yi.min=Be,Yi.max=He);var Ni=Vr.angle_instanced_arrays,wi=Vr.webgl_draw_buffers,Ua=Vr.oes_vertex_array_object,Ca={dirty:!0,profile:En.profile},no={},Ri=[],ki={},$a={};function Ea(Jt){return Jt.replace(".","_")}function la(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),no[lr]=Ca[lr]=!!De,ki[lr]=fe}function ua(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),Array.isArray(De)?(Ca[lr]=De.slice(),no[lr]=De.slice()):Ca[lr]=no[lr]=De,$a[lr]=fe}function Oa(Jt){return!!isNaN(Jt)}la(lo,Xr),la(ks,qr),ua(dl,"blendColor",[0,0,0,0]),ua(Vl,"blendEquationSeparate",[fn,fn]),ua(gc,"blendFuncSeparate",[vn,Fr,vn,Fr]),la(ec,zn,!0),ua(vc,"depthFunc",Bn),ua(El,"depthRange",[0,1]),ua(tu,"depthMask",!0),ua($c,$c,[!0,!0,!0,!0]),la(bc,Pr),ua(qo,"cullFace",Vt),ua(Bs,Bs,Ie),ua(ac,ac,1),la(Zl,ai),ua(Mu,"polygonOffset",[0,0]),la(eh,Ti),la(Vu,Qi),ua(Wh,"sampleCoverage",[1,!1]),la(rh,gn),ua(qh,"stencilMask",-1),ua(Wc,"stencilFunc",[hr,0,-1]),ua(Gh,"stencilOpSeparate",[Et,cr,cr,cr]),ua(ds,"stencilOpSeparate",[Vt,cr,cr,cr]),la($s,Qn),ua(nh,"scissor",[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]),ua(eu,eu,[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]);var Vo={gl:Se,context:to,strings:Ir,next:no,current:Ca,draw:co,elements:bi,buffer:Ai,shader:Ia,attributes:ia.state,vao:ia,uniforms:ha,framebuffer:Si,extensions:Vr,timer:ma,isBufferArgs:Ki},Bo={primTypes:Ei,compareFuncs:si,blendFuncs:ra,blendEquations:Yi,stencilOps:Oi,glTypes:ci,orientationType:$i};wi&&(Bo.backBuffer=[Vt],Bo.drawBuffer=p(ri.maxDrawbuffers,function(Jt){return Jt===0?[0]:p(Jt,function(fe){return ei+fe})}));var za=0;function Ya(){var Jt=Ja({cache:ji}),fe=Jt.link,De=Jt.global;Jt.id=za++,Jt.batchId="0";var lr=fe(Vo),tr=Jt.shared={props:"a0"};Object.keys(Vo).forEach(function(rr){tr[rr]=De.def(lr,".",rr)});var ar=Jt.next={},dr=Jt.current={};Object.keys($a).forEach(function(rr){Array.isArray(Ca[rr])&&(ar[rr]=De.def(tr.next,".",rr),dr[rr]=De.def(tr.current,".",rr))});var gr=Jt.constants={};Object.keys(Bo).forEach(function(rr){gr[rr]=De.def(JSON.stringify(Bo[rr]))}),Jt.invoke=function(rr,Je){switch(Je.type){case pa:var Hr=["this",tr.context,tr.props,Jt.batchId];return rr.def(fe(Je.data),".call(",Hr.slice(0,Math.max(Je.data.length+1,4)),")");case _o:return rr.def(tr.props,Je.data);case fs:return rr.def(tr.context,Je.data);case os:return rr.def("this",Je.data);case gs:return Je.data.append(Jt,rr),Je.data.ref;case ws:return Je.data.toString();case bo:return Je.data.map(function(wn){return Jt.invoke(rr,wn)})}},Jt.attribCache={};var Ge={};return Jt.scopeAttrib=function(rr){var Je=Ir.id(rr);if(Je in Ge)return Ge[Je];var Hr=ia.scope[Je];Hr||(Hr=ia.scope[Je]=new oi);var wn=Ge[Je]=fe(Hr);return wn},Jt}function Eo(Jt){var fe=Jt.static,De=Jt.dynamic,lr;if(lf in fe){var tr=!!fe[lf];lr=ao(function(dr,gr){return tr}),lr.enable=tr}else if(lf in De){var ar=De[lf];lr=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}return lr}function No(Jt,fe){var De=Jt.static,lr=Jt.dynamic;if(Kt in De){var tr=De[Kt];return tr?(tr=Si.getFramebuffer(tr),ao(function(dr,gr){var Ge=dr.link(tr),rr=dr.shared;gr.set(rr.framebuffer,".next",Ge);var Je=rr.context;return gr.set(Je,"."+Zr,Ge+".width"),gr.set(Je,"."+Tn,Ge+".height"),Ge})):ao(function(dr,gr){var Ge=dr.shared;gr.set(Ge.framebuffer,".next","null");var rr=Ge.context;return gr.set(rr,"."+Zr,rr+"."+Te),gr.set(rr,"."+Tn,rr+"."+Pe),"null"})}else if(Kt in lr){var ar=lr[Kt];return xo(ar,function(dr,gr){var Ge=dr.invoke(gr,ar),rr=dr.shared,Je=rr.framebuffer,Hr=gr.def(Je,".getFramebuffer(",Ge,")");gr.set(Je,".next",Hr);var wn=rr.context;return gr.set(wn,"."+Zr,Hr+"?"+Hr+".width:"+wn+"."+Te),gr.set(wn,"."+Tn,Hr+"?"+Hr+".height:"+wn+"."+Pe),Hr})}else return null}function hs(Jt,fe,De){var lr=Jt.static,tr=Jt.dynamic;function ar(Ge){if(Ge in lr){var rr=lr[Ge],Je=!0,Hr=rr.x|0,wn=rr.y|0,Ln,Ii;return"width"in rr?Ln=rr.width|0:Je=!1,"height"in rr?Ii=rr.height|0:Je=!1,new vi(!Je&&fe&&fe.thisDep,!Je&&fe&&fe.contextDep,!Je&&fe&&fe.propDep,function(Vi,Di){var da=Vi.shared.context,Hi=Ln;"width"in rr||(Hi=Di.def(da,".",Zr,"-",Hr));var Wi=Ii;return"height"in rr||(Wi=Di.def(da,".",Tn,"-",wn)),[Hr,wn,Hi,Wi]})}else if(Ge in tr){var Mi=tr[Ge],gi=xo(Mi,function(Vi,Di){var da=Vi.invoke(Di,Mi),Hi=Vi.shared.context,Wi=Di.def(da,".x|0"),wa=Di.def(da,".y|0"),vo=Di.def('"width" in ',da,"?",da,".width|0:","(",Hi,".",Zr,"-",Wi,")"),So=Di.def('"height" in ',da,"?",da,".height|0:","(",Hi,".",Tn,"-",wa,")");return[Wi,wa,vo,So]});return fe&&(gi.thisDep=gi.thisDep||fe.thisDep,gi.contextDep=gi.contextDep||fe.contextDep,gi.propDep=gi.propDep||fe.propDep),gi}else return fe?new vi(fe.thisDep,fe.contextDep,fe.propDep,function(Vi,Di){var da=Vi.shared.context;return[0,0,Di.def(da,".",Zr),Di.def(da,".",Tn)]}):null}var dr=ar(eu);if(dr){var gr=dr;dr=new vi(dr.thisDep,dr.contextDep,dr.propDep,function(Ge,rr){var Je=gr.append(Ge,rr),Hr=Ge.shared.context;return rr.set(Hr,"."+qn,Je[2]),rr.set(Hr,"."+te,Je[3]),Je})}return{viewport:dr,scissor_box:ar(nh)}}function Xl(Jt,fe){var De=Jt.static,lr=typeof De[pt]=="string"&&typeof De[O]=="string";if(lr){if(Object.keys(fe.dynamic).length>0)return null;var tr=fe.static,ar=Object.keys(tr);if(ar.length>0&&typeof tr[ar[0]]=="number"){for(var dr=[],gr=0;gr"+Wi+"?"+Je+".constant["+Wi+"]:0;"}).join(""),"}}else{","if(",Ln,"(",Je,".buffer)){",Vi,"=",Ii,".createStream(",Ne,",",Je,".buffer);","}else{",Vi,"=",Ii,".getBuffer(",Je,".buffer);","}",Di,'="type" in ',Je,"?",wn.glTypes,"[",Je,".type]:",Vi,".dtype;",Mi.normalized,"=!!",Je,".normalized;");function da(Hi){rr(Mi[Hi],"=",Je,".",Hi,"|0;")}return da("size"),da("offset"),da("stride"),da("divisor"),rr("}}"),rr.exit("if(",Mi.isStream,"){",Ii,".destroyStream(",Vi,");","}"),Mi}tr[ar]=xo(dr,gr)}),tr}function ku(Jt){var fe=Jt.static,De=Jt.dynamic,lr={};return Object.keys(fe).forEach(function(tr){var ar=fe[tr];lr[tr]=ao(function(dr,gr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:dr.link(ar)})}),Object.keys(De).forEach(function(tr){var ar=De[tr];lr[tr]=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}),lr}function Eu(Jt,fe,De,lr,tr){Jt.static,Jt.dynamic;var ar=Xl(Jt,fe),dr=No(Jt),gr=hs(Jt,dr),Ge=ys(Jt),rr=Dc(Jt),Je=Rl(Jt,tr,ar);function Hr(Vi){var Di=gr[Vi];Di&&(rr[Vi]=Di)}Hr(eu),Hr(Ea(nh));var wn=Object.keys(rr).length>0,Ln={framebuffer:dr,draw:Ge,shader:Je,state:rr,dirty:wn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ln.profile=Eo(Jt),Ln.uniforms=Cl(De),Ln.drawVAO=Ln.scopeVAO=Ge.vao,!Ln.drawVAO&&Je.program&&!ar&&Vr.angle_instanced_arrays&&Ge.static.elements){var Ii=!0,Mi=Je.program.attributes.map(function(Vi){var Di=fe.static[Vi];return Ii=Ii&&!!Di,Di});if(Ii&&Mi.length>0){var gi=ia.getVAO(ia.createVAO({attributes:Mi,elements:Ge.static.elements}));Ln.drawVAO=new vi(null,null,null,function(Vi,Di){return Vi.link(gi)}),Ln.useVAO=!0}}return ar?Ln.useVAO=!0:Ln.attributes=Nc(fe),Ln.context=ku(lr),Ln}function Ec(Jt,fe,De){var lr=Jt.shared,tr=lr.context,ar=Jt.scope();Object.keys(De).forEach(function(dr){fe.save(tr,"."+dr);var gr=De[dr],Ge=gr.append(Jt,fe);Array.isArray(Ge)?ar(tr,".",dr,"=[",Ge.join(),"];"):ar(tr,".",dr,"=",Ge,";")}),fe(ar)}function kc(Jt,fe,De,lr){var tr=Jt.shared,ar=tr.gl,dr=tr.framebuffer,gr;wi&&(gr=fe.def(tr.extensions,".webgl_draw_buffers"));var Ge=Jt.constants,rr=Ge.drawBuffer,Je=Ge.backBuffer,Hr;De?Hr=De.append(Jt,fe):Hr=fe.def(dr,".next"),lr||fe("if(",Hr,"!==",dr,".cur){"),fe("if(",Hr,"){",ar,".bindFramebuffer(",ti,",",Hr,".framebuffer);"),wi&&fe(gr,".drawBuffersWEBGL(",rr,"[",Hr,".colorAttachments.length]);"),fe("}else{",ar,".bindFramebuffer(",ti,",null);"),wi&&fe(gr,".drawBuffersWEBGL(",Je,");"),fe("}",dr,".cur=",Hr,";"),lr||fe("}")}function zc(Jt,fe,De){var lr=Jt.shared,tr=lr.gl,ar=Jt.current,dr=Jt.next,gr=lr.current,Ge=lr.next,rr=Jt.cond(gr,".dirty");Ri.forEach(function(Je){var Hr=Ea(Je);if(!(Hr in De.state)){var wn,Ln;if(Hr in dr){wn=dr[Hr],Ln=ar[Hr];var Ii=p(Ca[Hr].length,function(gi){return rr.def(wn,"[",gi,"]")});rr(Jt.cond(Ii.map(function(gi,Vi){return gi+"!=="+Ln+"["+Vi+"]"}).join("||")).then(tr,".",$a[Hr],"(",Ii,");",Ii.map(function(gi,Vi){return Ln+"["+Vi+"]="+gi}).join(";"),";"))}else{wn=rr.def(Ge,".",Hr);var Mi=Jt.cond(wn,"!==",gr,".",Hr);rr(Mi),Hr in ki?Mi(Jt.cond(wn).then(tr,".enable(",ki[Hr],");").else(tr,".disable(",ki[Hr],");"),gr,".",Hr,"=",wn,";"):Mi(tr,".",$a[Hr],"(",wn,");",gr,".",Hr,"=",wn,";")}}}),Object.keys(De.state).length===0&&rr(gr,".dirty=false;"),fe(rr)}function Xo(Jt,fe,De,lr){var tr=Jt.shared,ar=Jt.current,dr=tr.current,gr=tr.gl,Ge;sa(Object.keys(De)).forEach(function(rr){var Je=De[rr];if(!(lr&&!lr(Je))){var Hr=Je.append(Jt,fe);if(ki[rr]){var wn=ki[rr];ro(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(Jt.cond(Ge).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Ge,";")):(fe(Jt.cond(Hr).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Hr,";"))}else if(Jn(Hr)){var Ln=ar[rr];fe(gr,".",$a[rr],"(",Hr,");",Hr.map(function(Ii,Mi){return Ln+"["+Mi+"]="+Ii}).join(";"),";")}else ro(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(gr,".",$a[rr],"(",Ge,");",dr,".",rr,"=",Ge,";")):fe(gr,".",$a[rr],"(",Hr,");",dr,".",rr,"=",Hr,";")}})}function Oc(Jt,fe){Ni&&(Jt.instancing=fe.def(Jt.shared.extensions,".angle_instanced_arrays"))}function xl(Jt,fe,De,lr,tr){var ar=Jt.shared,dr=Jt.stats,gr=ar.current,Ge=ar.timer,rr=De.profile;function Je(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Hr,wn;function Ln(da){Hr=fe.def(),da(Hr,"=",Je(),";"),typeof tr=="string"?da(dr,".count+=",tr,";"):da(dr,".count++;"),ma&&(lr?(wn=fe.def(),da(wn,"=",Ge,".getNumPendingQueries();")):da(Ge,".beginQuery(",dr,");"))}function Ii(da){da(dr,".cpuTime+=",Je(),"-",Hr,";"),ma&&(lr?da(Ge,".pushScopeStats(",wn,",",Ge,".getNumPendingQueries(),",dr,");"):da(Ge,".endQuery();"))}function Mi(da){var Hi=fe.def(gr,".profile");fe(gr,".profile=",da,";"),fe.exit(gr,".profile=",Hi,";")}var gi;if(rr){if(ro(rr)){rr.enable?(Ln(fe),Ii(fe.exit),Mi("true")):Mi("false");return}gi=rr.append(Jt,fe),Mi(gi)}else gi=fe.def(gr,".profile");var Vi=Jt.block();Ln(Vi),fe("if(",gi,"){",Vi,"}");var Di=Jt.block();Ii(Di),fe.exit("if(",gi,"){",Di,"}")}function jc(Jt,fe,De,lr,tr){var ar=Jt.shared;function dr(Ge){switch(Ge){case Aa:case Fo:case Ws:return 2;case Fa:case xs:case zl:return 3;case wo:case Sl:case Fc:return 4;default:return 1}}function gr(Ge,rr,Je){var Hr=ar.gl,wn=fe.def(Ge,".location"),Ln=fe.def(ar.attributes,"[",wn,"]"),Ii=Je.state,Mi=Je.buffer,gi=[Je.x,Je.y,Je.z,Je.w],Vi=["buffer","normalized","offset","stride"];function Di(){fe("if(!",Ln,".buffer){",Hr,".enableVertexAttribArray(",wn,");}");var Hi=Je.type,Wi;if(Je.size?Wi=fe.def(Je.size,"||",rr):Wi=rr,fe("if(",Ln,".type!==",Hi,"||",Ln,".size!==",Wi,"||",Vi.map(function(vo){return Ln+"."+vo+"!=="+Je[vo]}).join("||"),"){",Hr,".bindBuffer(",Ne,",",Mi,".buffer);",Hr,".vertexAttribPointer(",[wn,Wi,Hi,Je.normalized,Je.stride,Je.offset],");",Ln,".type=",Hi,";",Ln,".size=",Wi,";",Vi.map(function(vo){return Ln+"."+vo+"="+Je[vo]+";"}).join(""),"}"),Ni){var wa=Je.divisor;fe("if(",Ln,".divisor!==",wa,"){",Jt.instancing,".vertexAttribDivisorANGLE(",[wn,wa],");",Ln,".divisor=",wa,";}")}}function da(){fe("if(",Ln,".buffer){",Hr,".disableVertexAttribArray(",wn,");",Ln,".buffer=null;","}if(",uo.map(function(Hi,Wi){return Ln+"."+Hi+"!=="+gi[Wi]}).join("||"),"){",Hr,".vertexAttrib4f(",wn,",",gi,");",uo.map(function(Hi,Wi){return Ln+"."+Hi+"="+gi[Wi]+";"}).join(""),"}")}Ii===Za?Di():Ii===Ra?da():(fe("if(",Ii,"===",Za,"){"),Di(),fe("}else{"),da(),fe("}"))}lr.forEach(function(Ge){var rr=Ge.name,Je=De.attributes[rr],Hr;if(Je){if(!tr(Je))return;Hr=Je.append(Jt,fe)}else{if(!tr($o))return;var wn=Jt.scopeAttrib(rr);Hr={},Object.keys(new oi).forEach(function(Ln){Hr[Ln]=fe.def(wn,".",Ln)})}gr(Jt.link(Ge),dr(Ge.info.type),Hr)})}function Lu(Jt,fe,De,lr,tr,ar){for(var dr=Jt.shared,gr=dr.gl,Ge,rr=0;rr1){for(var ns=[],As=[],Wl=0;Wl>1)",Mi],");")}function wa(){De(gi,".drawArraysInstancedANGLE(",[wn,Ln,Ii,Mi],");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}function Hi(){function Wi(){De(ar+".drawElements("+[wn,Ii,Vi,Ln+"<<(("+Vi+"-"+Sa+")>>1)"]+");")}function wa(){De(ar+".drawArrays("+[wn,Ln,Ii]+");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}Ni&&(typeof Mi!="number"||Mi>=0)?typeof Mi=="string"?(De("if(",Mi,">0){"),da(),De("}else if(",Mi,"<0){"),Hi(),De("}")):da():Hi()}function Rs(Jt,fe,De,lr,tr){var ar=Ya(),dr=ar.proc("body",tr);return Ni&&(ar.instancing=dr.def(ar.shared.extensions,".angle_instanced_arrays")),Jt(ar,dr,De,lr),ar.compile().body}function Fl(Jt,fe,De,lr){Oc(Jt,fe),De.useVAO?De.drawVAO?fe(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,fe),");"):fe(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(fe(Jt.shared.vao,".setVAO(null);"),jc(Jt,fe,De,lr.attributes,function(){return!0})),Lu(Jt,fe,De,lr.uniforms,function(){return!0},!1),jo(Jt,fe,fe,De)}function Pl(Jt,fe){var De=Jt.proc("draw",1);Oc(Jt,De),Ec(Jt,De,fe.context),kc(Jt,De,fe.framebuffer),zc(Jt,De,fe),Xo(Jt,De,fe.state),xl(Jt,De,fe,!1,!0);var lr=fe.shader.progVar.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",lr,".program);"),fe.shader.program)Fl(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var tr=Jt.global.def("{}"),ar=De.def(lr,".id"),dr=De.def(tr,"[",ar,"]");De(Jt.cond(dr).then(dr,".call(this,a0);").else(dr,"=",tr,"[",ar,"]=",Jt.link(function(gr){return Rs(Fl,Jt,fe,gr,1)}),"(",lr,");",dr,".call(this,a0);"))}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function Z(Jt,fe,De,lr){Jt.batchId="a1",Oc(Jt,fe);function tr(){return!0}jc(Jt,fe,De,lr.attributes,tr),Lu(Jt,fe,De,lr.uniforms,tr,!1),jo(Jt,fe,fe,De)}function lt(Jt,fe,De,lr){Oc(Jt,fe);var tr=De.contextDep,ar=fe.def(),dr="a0",gr="a1",Ge=fe.def();Jt.shared.props=Ge,Jt.batchId=ar;var rr=Jt.scope(),Je=Jt.scope();fe(rr.entry,"for(",ar,"=0;",ar,"<",gr,";++",ar,"){",Ge,"=",dr,"[",ar,"];",Je,"}",rr.exit);function Hr(Vi){return Vi.contextDep&&tr||Vi.propDep}function wn(Vi){return!Hr(Vi)}if(De.needsContext&&Ec(Jt,Je,De.context),De.needsFramebuffer&&kc(Jt,Je,De.framebuffer),Xo(Jt,Je,De.state,Hr),De.profile&&Hr(De.profile)&&xl(Jt,Je,De,!1,!0),lr)De.useVAO?De.drawVAO?Hr(De.drawVAO)?Je(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,Je),");"):rr(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,rr),");"):rr(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(rr(Jt.shared.vao,".setVAO(null);"),jc(Jt,rr,De,lr.attributes,wn),jc(Jt,Je,De,lr.attributes,Hr)),Lu(Jt,rr,De,lr.uniforms,wn,!1),Lu(Jt,Je,De,lr.uniforms,Hr,!0),jo(Jt,rr,Je,De);else{var Ln=Jt.global.def("{}"),Ii=De.shader.progVar.append(Jt,Je),Mi=Je.def(Ii,".id"),gi=Je.def(Ln,"[",Mi,"]");Je(Jt.shared.gl,".useProgram(",Ii,".program);","if(!",gi,"){",gi,"=",Ln,"[",Mi,"]=",Jt.link(function(Vi){return Rs(Z,Jt,De,Vi,2)}),"(",Ii,");}",gi,".call(this,a0[",ar,"],",ar,");")}}function nt(Jt,fe){var De=Jt.proc("batch",2);Jt.batchId="0",Oc(Jt,De);var lr=!1,tr=!0;Object.keys(fe.context).forEach(function(Ln){lr=lr||fe.context[Ln].propDep}),lr||(Ec(Jt,De,fe.context),tr=!1);var ar=fe.framebuffer,dr=!1;ar?(ar.propDep?lr=dr=!0:ar.contextDep&&lr&&(dr=!0),dr||kc(Jt,De,ar)):kc(Jt,De,null),fe.state.viewport&&fe.state.viewport.propDep&&(lr=!0);function gr(Ln){return Ln.contextDep&&lr||Ln.propDep}zc(Jt,De,fe),Xo(Jt,De,fe.state,function(Ln){return!gr(Ln)}),(!fe.profile||!gr(fe.profile))&&xl(Jt,De,fe,!1,"a1"),fe.contextDep=lr,fe.needsContext=tr,fe.needsFramebuffer=dr;var Ge=fe.shader.progVar;if(Ge.contextDep&&lr||Ge.propDep)lt(Jt,De,fe,null);else{var rr=Ge.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",rr,".program);"),fe.shader.program)lt(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var Je=Jt.global.def("{}"),Hr=De.def(rr,".id"),wn=De.def(Je,"[",Hr,"]");De(Jt.cond(wn).then(wn,".call(this,a0,a1);").else(wn,"=",Je,"[",Hr,"]=",Jt.link(function(Ln){return Rs(lt,Jt,fe,Ln,2)}),"(",rr,");",wn,".call(this,a0,a1);"))}}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function wt(Jt,fe){var De=Jt.proc("scope",3);Jt.batchId="a2";var lr=Jt.shared,tr=lr.current;if(Ec(Jt,De,fe.context),fe.framebuffer&&fe.framebuffer.append(Jt,De),sa(Object.keys(fe.state)).forEach(function(gr){var Ge=fe.state[gr],rr=Ge.append(Jt,De);Jn(rr)?rr.forEach(function(Je,Hr){Oa(Je)?De.set(Jt.next[gr],"["+Hr+"]",Je):De.set(Jt.next[gr],"["+Hr+"]",Jt.link(Je,{stable:!0}))}):ro(Ge)?De.set(lr.next,"."+gr,Jt.link(rr,{stable:!0})):De.set(lr.next,"."+gr,rr)}),xl(Jt,De,fe,!0,!0),[Dt,Ee,qt,je,Ft].forEach(function(gr){var Ge=fe.draw[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.draw,"."+gr,rr):De.set(lr.draw,"."+gr,Jt.link(rr),{stable:!0})}}),Object.keys(fe.uniforms).forEach(function(gr){var Ge=fe.uniforms[gr].append(Jt,De);Array.isArray(Ge)&&(Ge="["+Ge.map(function(rr){return Oa(rr)?rr:Jt.link(rr,{stable:!0})})+"]"),De.set(lr.uniforms,"["+Jt.link(Ir.id(gr),{stable:!0})+"]",Ge)}),Object.keys(fe.attributes).forEach(function(gr){var Ge=fe.attributes[gr].append(Jt,De),rr=Jt.scopeAttrib(gr);Object.keys(new oi).forEach(function(Je){De.set(rr,"."+Je,Ge[Je])})}),fe.scopeVAO){var ar=fe.scopeVAO.append(Jt,De);Oa(ar)?De.set(lr.vao,".targetVAO",ar):De.set(lr.vao,".targetVAO",Jt.link(ar,{stable:!0}))}function dr(gr){var Ge=fe.shader[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.shader,"."+gr,rr):De.set(lr.shader,"."+gr,Jt.link(rr,{stable:!0}))}}dr(O),dr(pt),Object.keys(fe.state).length>0&&(De(tr,".dirty=true;"),De.exit(tr,".dirty=true;")),De("a1(",Jt.shared.context,",a0,",Jt.batchId,");")}function Wt(Jt){if(!(typeof Jt!="object"||Jn(Jt))){for(var fe=Object.keys(Jt),De=0;De=0;--jo){var Rs=Oa[jo];Rs&&Rs(ma,null,0)}Vr.flush(),ia&&ia.update()}function No(){!Ya&&Oa.length>0&&(Ya=b.next(Eo))}function hs(){Ya&&(b.cancel(Eo),Ya=null)}function Xl(jo){jo.preventDefault(),hs(),Vo.forEach(function(Rs){Rs()})}function Rl(jo){Vr.getError(),Ai.restore(),Ca.restore(),Yi.restore(),no.restore(),Ri.restore(),ki.restore(),wi.restore(),ia&&ia.restore(),$a.procs.refresh(),No(),Bo.forEach(function(Rs){Rs()})}ua&&(ua.addEventListener(ml,Xl,!1),ua.addEventListener(yc,Rl,!1));function ys(){Oa.length=0,hs(),ua&&(ua.removeEventListener(ml,Xl),ua.removeEventListener(yc,Rl)),Ca.clear(),ki.clear(),Ri.clear(),wi.clear(),no.clear(),Ni.clear(),Yi.clear(),ia&&ia.clear(),za.forEach(function(jo){jo()})}function Dc(jo){function Rs(tr){var ar=f({},tr);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function dr(gr){if(gr in ar){var Ge=ar[gr];delete ar[gr],Object.keys(Ge).forEach(function(rr){ar[gr+"."+rr]=Ge[rr]})}}return dr("blend"),dr("depth"),dr("cull"),dr("stencil"),dr("polygonOffset"),dr("scissor"),dr("sample"),"vao"in tr&&(ar.vao=tr.vao),ar}function Fl(tr,ar){var dr={},gr={};return Object.keys(tr).forEach(function(Ge){var rr=tr[Ge];if(m.isDynamic(rr)){gr[Ge]=m.unbox(rr,Ge);return}else if(ar&&Array.isArray(rr)){for(var Je=0;Je0)return ke.call(this,De(tr|0),tr|0)}else if(Array.isArray(tr)){if(tr.length)return ke.call(this,tr,tr.length)}else return ve.call(this,tr)}return f(lr,{stats:wt,destroy:function(){Wt.destroy()}})}var Cl=ki.setFBO=Dc({framebuffer:m.define.call(null,oc,"framebuffer")});function Nc(jo,Rs){var Fl=0;$a.procs.poll();var Pl=Rs.color;Pl&&(Vr.clearColor(+Pl[0]||0,+Pl[1]||0,+Pl[2]||0,+Pl[3]||0),Fl|=ou),"depth"in Rs&&(Vr.clearDepth(+Rs.depth),Fl|=wc),"stencil"in Rs&&(Vr.clearStencil(Rs.stencil|0),Fl|=zo),Vr.clear(Fl)}function ku(jo){if("framebuffer"in jo)if(jo.framebuffer&&jo.framebuffer_reglType==="framebufferCube")for(var Rs=0;Rs<6;++Rs)Cl(f({framebuffer:jo.framebuffer.faces[Rs]},jo),Nc);else Cl(jo,Nc);else Nc(null,jo)}function Eu(jo){Oa.push(jo);function Rs(){var Fl=hc(Oa,jo);function Pl(){var Z=hc(Oa,Pl);Oa[Z]=Oa[Oa.length-1],Oa.length-=1,Oa.length<=0&&hs()}Oa[Fl]=Pl}return No(),{cancel:Rs}}function Ec(){var jo=la.viewport,Rs=la.scissor_box;jo[0]=jo[1]=Rs[0]=Rs[1]=0,ma.viewportWidth=ma.framebufferWidth=ma.drawingBufferWidth=jo[2]=Rs[2]=Vr.drawingBufferWidth,ma.viewportHeight=ma.framebufferHeight=ma.drawingBufferHeight=jo[3]=Rs[3]=Vr.drawingBufferHeight}function kc(){ma.tick+=1,ma.time=Xo(),Ec(),$a.procs.poll()}function zc(){no.refresh(),Ec(),$a.procs.refresh(),ia&&ia.update()}function Xo(){return(x()-Ia)/1e3}zc();function Oc(jo,Rs){var Fl;switch(jo){case"frame":return Eu(Rs);case"lost":Fl=Vo;break;case"restore":Fl=Bo;break;case"destroy":Fl=za;break}return Fl.push(Rs),{cancel:function(){for(var Pl=0;Pl=0},read:Ea,destroy:ys,_gl:Vr,_refresh:zc,poll:function(){kc(),ia&&ia.update()},now:Xo,stats:On,getCachedCode:xl,preloadCachedCode:jc});return Ir.onDone(null,Lu),Lu}return zh})}),oQ=It((et,Y)=>{var f=t1();Y.exports=function(a){if(a?typeof a=="string"&&(a={container:a}):a={},z(a)?a={container:a}:P(a)?a={container:a}:n(a)?a={gl:a}:a=f(a,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),a.pixelRatio||(a.pixelRatio=window.pixelRatio||1),a.gl)return a.gl;if(a.canvas&&(a.container=a.canvas.parentNode),a.container){if(typeof a.container=="string"){var l=document.querySelector(a.container);if(!l)throw Error("Element "+a.container+" is not found");a.container=l}z(a.container)?(a.canvas=a.container,a.container=a.canvas.parentNode):a.canvas||(a.canvas=i(),a.container.appendChild(a.canvas),y(a))}else if(!a.canvas)if(typeof document<"u")a.container=document.body||document.documentElement,a.canvas=i(),a.container.appendChild(a.canvas),y(a);else throw Error("Not DOM environment. Use headless-gl.");return a.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(o){try{a.gl=a.canvas.getContext(o,a.attrs)}catch{}return a.gl}),a.gl};function y(a){if(a.container)if(a.container==document.body)document.body.style.width||(a.canvas.width=a.width||a.pixelRatio*window.innerWidth),document.body.style.height||(a.canvas.height=a.height||a.pixelRatio*window.innerHeight);else{var l=a.container.getBoundingClientRect();a.canvas.width=a.width||l.right-l.left,a.canvas.height=a.height||l.bottom-l.top}}function z(a){return typeof a.getContext=="function"&&"width"in a&&"height"in a}function P(a){return typeof a.nodeName=="string"&&typeof a.appendChild=="function"&&typeof a.getBoundingClientRect=="function"}function n(a){return typeof a.drawArrays=="function"||typeof a.drawElements=="function"}function i(){var a=document.createElement("canvas");return a.style.position="absolute",a.style.top=0,a.style.left=0,a}}),sQ=It((et,Y)=>{var f=nz(),y=[32,126];Y.exports=z;function z(P){P=P||{};var n=P.shape?P.shape:P.canvas?[P.canvas.width,P.canvas.height]:[512,512],i=P.canvas||document.createElement("canvas"),a=P.font,l=typeof P.step=="number"?[P.step,P.step]:P.step||[32,32],o=P.chars||y;if(a&&typeof a!="string"&&(a=f(a)),!Array.isArray(o))o=String(o).split("");else if(o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"){for(var c=[],s=o[0],h=0;s<=o[1];s++)c[h++]=String.fromCharCode(s);o=c}n=n.slice(),i.width=n[0],i.height=n[1];var m=i.getContext("2d");m.fillStyle="#000",m.fillRect(0,0,i.width,i.height),m.font=a,m.textAlign="center",m.textBaseline="middle",m.fillStyle="#fff";for(var b=l[0]/2,x=l[1]/2,s=0;sn[0]-l[0]/2&&(b=l[0]/2,x+=l[1]);return i}}),iz=It(et=>{"use restrict";var Y=32;et.INT_BITS=Y,et.INT_MAX=2147483647,et.INT_MIN=-1<0)-(z<0)},et.abs=function(z){var P=z>>Y-1;return(z^P)-P},et.min=function(z,P){return P^(z^P)&-(z65535)<<4,z>>>=P,n=(z>255)<<3,z>>>=n,P|=n,n=(z>15)<<2,z>>>=n,P|=n,n=(z>3)<<1,z>>>=n,P|=n,P|z>>1},et.log10=function(z){return z>=1e9?9:z>=1e8?8:z>=1e7?7:z>=1e6?6:z>=1e5?5:z>=1e4?4:z>=1e3?3:z>=100?2:z>=10?1:0},et.popCount=function(z){return z=z-(z>>>1&1431655765),z=(z&858993459)+(z>>>2&858993459),(z+(z>>>4)&252645135)*16843009>>>24};function f(z){var P=32;return z&=-z,z&&P--,z&65535&&(P-=16),z&16711935&&(P-=8),z&252645135&&(P-=4),z&858993459&&(P-=2),z&1431655765&&(P-=1),P}et.countTrailingZeros=f,et.nextPow2=function(z){return z+=z===0,--z,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z+1},et.prevPow2=function(z){return z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z-(z>>>1)},et.parity=function(z){return z^=z>>>16,z^=z>>>8,z^=z>>>4,z&=15,27030>>>z&1};var y=new Array(256);(function(z){for(var P=0;P<256;++P){var n=P,i=P,a=7;for(n>>>=1;n;n>>>=1)i<<=1,i|=n&1,--a;z[P]=i<>>8&255]<<16|y[z>>>16&255]<<8|y[z>>>24&255]},et.interleave2=function(z,P){return z&=65535,z=(z|z<<8)&16711935,z=(z|z<<4)&252645135,z=(z|z<<2)&858993459,z=(z|z<<1)&1431655765,P&=65535,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,z|P<<1},et.deinterleave2=function(z,P){return z=z>>>P&1431655765,z=(z|z>>>1)&858993459,z=(z|z>>>2)&252645135,z=(z|z>>>4)&16711935,z=(z|z>>>16)&65535,z<<16>>16},et.interleave3=function(z,P,n){return z&=1023,z=(z|z<<16)&4278190335,z=(z|z<<8)&251719695,z=(z|z<<4)&3272356035,z=(z|z<<2)&1227133513,P&=1023,P=(P|P<<16)&4278190335,P=(P|P<<8)&251719695,P=(P|P<<4)&3272356035,P=(P|P<<2)&1227133513,z|=P<<1,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,z|n<<2},et.deinterleave3=function(z,P){return z=z>>>P&1227133513,z=(z|z>>>2)&3272356035,z=(z|z>>>4)&251719695,z=(z|z>>>8)&4278190335,z=(z|z>>>16)&1023,z<<22>>22},et.nextCombination=function(z){var P=z|z-1;return P+1|(~P&-~P)-1>>>f(z)+1}}),lQ=It((et,Y)=>{function f(P,n,i){var a=P[i]|0;if(a<=0)return[];var l=new Array(a),o;if(i===P.length-1)for(o=0;o"u"&&(n=0),typeof P){case"number":if(P>0)return y(P|0,n);break;case"object":if(typeof P.length=="number")return f(P,n,0);break}return[]}Y.exports=z}),cQ=It(et=>{var Y=iz(),f=lQ(),y=yb().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:f([32,0]),UINT16:f([32,0]),UINT32:f([32,0]),BIGUINT64:f([32,0]),INT8:f([32,0]),INT16:f([32,0]),INT32:f([32,0]),BIGINT64:f([32,0]),FLOAT:f([32,0]),DOUBLE:f([32,0]),DATA:f([32,0]),UINT8C:f([32,0]),BUFFER:f([32,0])});var z=typeof Uint8ClampedArray<"u",P=typeof BigUint64Array<"u",n=typeof BigInt64Array<"u",i=window.__TYPEDARRAY_POOL;i.UINT8C||(i.UINT8C=f([32,0])),i.BIGUINT64||(i.BIGUINT64=f([32,0])),i.BIGINT64||(i.BIGINT64=f([32,0])),i.BUFFER||(i.BUFFER=f([32,0]));var a=i.DATA,l=i.BUFFER;et.free=function(p){if(y.isBuffer(p))l[Y.log2(p.length)].push(p);else{if(Object.prototype.toString.call(p)!=="[object ArrayBuffer]"&&(p=p.buffer),!p)return;var g=p.length||p.byteLength,C=Y.log2(g)|0;a[C].push(p)}};function o(p){if(p){var g=p.length||p.byteLength,C=Y.log2(g);a[C].push(p)}}function c(p){o(p.buffer)}et.freeUint8=et.freeUint16=et.freeUint32=et.freeBigUint64=et.freeInt8=et.freeInt16=et.freeInt32=et.freeBigInt64=et.freeFloat32=et.freeFloat=et.freeFloat64=et.freeDouble=et.freeUint8Clamped=et.freeDataView=c,et.freeArrayBuffer=o,et.freeBuffer=function(p){l[Y.log2(p.length)].push(p)},et.malloc=function(p,g){if(g===void 0||g==="arraybuffer")return s(p);switch(g){case"uint8":return h(p);case"uint16":return m(p);case"uint32":return b(p);case"int8":return x(p);case"int16":return _(p);case"int32":return A(p);case"float":case"float32":return d(p);case"double":case"float64":return k(p);case"uint8_clamped":return w(p);case"bigint64":return E(p);case"biguint64":return D(p);case"buffer":return M(p);case"data":case"dataview":return I(p);default:return null}return null};function s(g){var g=Y.nextPow2(g),C=Y.log2(g),S=a[C];return S.length>0?S.pop():new ArrayBuffer(g)}et.mallocArrayBuffer=s;function h(p){return new Uint8Array(s(p),0,p)}et.mallocUint8=h;function m(p){return new Uint16Array(s(2*p),0,p)}et.mallocUint16=m;function b(p){return new Uint32Array(s(4*p),0,p)}et.mallocUint32=b;function x(p){return new Int8Array(s(p),0,p)}et.mallocInt8=x;function _(p){return new Int16Array(s(2*p),0,p)}et.mallocInt16=_;function A(p){return new Int32Array(s(4*p),0,p)}et.mallocInt32=A;function d(p){return new Float32Array(s(4*p),0,p)}et.mallocFloat32=et.mallocFloat=d;function k(p){return new Float64Array(s(8*p),0,p)}et.mallocFloat64=et.mallocDouble=k;function w(p){return z?new Uint8ClampedArray(s(p),0,p):h(p)}et.mallocUint8Clamped=w;function D(p){return P?new BigUint64Array(s(8*p),0,p):null}et.mallocBigUint64=D;function E(p){return n?new BigInt64Array(s(8*p),0,p):null}et.mallocBigInt64=E;function I(p){return new DataView(s(p),0,p)}et.mallocDataView=I;function M(p){p=Y.nextPow2(p);var g=Y.log2(p),C=l[g];return C.length>0?C.pop():new y(p)}et.mallocBuffer=M,et.clearCache=function(){for(var p=0;p<32;++p)i.UINT8[p].length=0,i.UINT16[p].length=0,i.UINT32[p].length=0,i.INT8[p].length=0,i.INT16[p].length=0,i.INT32[p].length=0,i.FLOAT[p].length=0,i.DOUBLE[p].length=0,i.BIGUINT64[p].length=0,i.BIGINT64[p].length=0,i.UINT8C[p].length=0,a[p].length=0,l[p].length=0}}),uQ=It((et,Y)=>{var f=Object.prototype.toString;Y.exports=function(y){var z;return f.call(y)==="[object Object]"&&(z=Object.getPrototypeOf(y),z===null||z===Object.getPrototypeOf({}))}}),az=It((et,Y)=>{Y.exports=function(f,y){y||(y=[0,""]),f=String(f);var z=parseFloat(f,10);return y[0]=z,y[1]=f.match(/[\d.\-\+]*\s*(.*)/)[1]||"",y}}),hQ=It((et,Y)=>{var f=az();Y.exports=n;var y=96;function z(i,a){var l=f(getComputedStyle(i).getPropertyValue(a));return l[0]*n(l[1],i)}function P(i,a){var l=document.createElement("div");l.style["font-size"]="128"+i,a.appendChild(l);var o=z(l,"font-size")/128;return a.removeChild(l),o}function n(i,a){switch(a=a||document.body,i=(i||"px").trim().toLowerCase(),(a===window||a===document)&&(a=document.body),i){case"%":return a.clientHeight/100;case"ch":case"ex":return P(i,a);case"em":return z(a,"font-size");case"rem":return z(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return y;case"cm":return y/2.54;case"mm":return y/25.4;case"pt":return y/72;case"pc":return y/6}return 1}}),dQ=It((et,Y)=>{Y.exports=P;var f=P.canvas=document.createElement("canvas"),y=f.getContext("2d"),z=n([32,126]);P.createPairs=n,P.ascii=z;function P(i,a){Array.isArray(i)&&(i=i.join(", "));var l={},o,c=16,s=.05;a&&(a.length===2&&typeof a[0]=="number"?o=n(a):Array.isArray(a)?o=a:(a.o?o=n(a.o):a.pairs&&(o=a.pairs),a.fontSize&&(c=a.fontSize),a.threshold!=null&&(s=a.threshold))),o||(o=z),y.font=c+"px "+i;for(var h=0;hc*s){var _=(x-b)/c;l[m]=_*1e3}}return l}function n(i){for(var a=[],l=i[0];l<=i[1];l++)for(var o=String.fromCharCode(l),c=i[0];c{Y.exports=f,f.canvas=document.createElement("canvas"),f.cache={};function f(s,i){i||(i={}),(typeof s=="string"||Array.isArray(s))&&(i.family=s);var a=Array.isArray(i.family)?i.family.join(", "):i.family;if(!a)throw Error("`family` must be defined");var l=i.size||i.fontSize||i.em||48,o=i.weight||i.fontWeight||"",c=i.style||i.fontStyle||"",s=[c,o,l].join(" ")+"px "+a,h=i.origin||"top";if(f.cache[a]&&l<=f.cache[a].em)return y(f.cache[a],h);var m=i.canvas||f.canvas,b=m.getContext("2d"),x={upper:i.upper!==void 0?i.upper:"H",lower:i.lower!==void 0?i.lower:"x",descent:i.descent!==void 0?i.descent:"p",ascent:i.ascent!==void 0?i.ascent:"h",tittle:i.tittle!==void 0?i.tittle:"i",overshoot:i.overshoot!==void 0?i.overshoot:"O"},_=Math.ceil(l*1.5);m.height=_,m.width=_*.5,b.font=s;var A="H",d={top:0};b.clearRect(0,0,_,_),b.textBaseline="top",b.fillStyle="black",b.fillText(A,0,0);var k=z(b.getImageData(0,0,_,_));b.clearRect(0,0,_,_),b.textBaseline="bottom",b.fillText(A,0,_);var w=z(b.getImageData(0,0,_,_));d.lineHeight=d.bottom=_-w+k,b.clearRect(0,0,_,_),b.textBaseline="alphabetic",b.fillText(A,0,_);var D=z(b.getImageData(0,0,_,_)),E=_-D-1+k;d.baseline=d.alphabetic=E,b.clearRect(0,0,_,_),b.textBaseline="middle",b.fillText(A,0,_*.5);var I=z(b.getImageData(0,0,_,_));d.median=d.middle=_-I-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="hanging",b.fillText(A,0,_*.5);var M=z(b.getImageData(0,0,_,_));d.hanging=_-M-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="ideographic",b.fillText(A,0,_);var p=z(b.getImageData(0,0,_,_));if(d.ideographic=_-p-1+k,x.upper&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.upper,0,0),d.upper=z(b.getImageData(0,0,_,_)),d.capHeight=d.baseline-d.upper),x.lower&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.lower,0,0),d.lower=z(b.getImageData(0,0,_,_)),d.xHeight=d.baseline-d.lower),x.tittle&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.tittle,0,0),d.tittle=z(b.getImageData(0,0,_,_))),x.ascent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.ascent,0,0),d.ascent=z(b.getImageData(0,0,_,_))),x.descent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.descent,0,0),d.descent=P(b.getImageData(0,0,_,_))),x.overshoot){b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.overshoot,0,0);var g=P(b.getImageData(0,0,_,_));d.overshoot=g-E}for(var C in d)d[C]/=l;return d.em=l,f.cache[a]=d,y(d,h)}function y(n,i){var a={};typeof i=="string"&&(i=n[i]);for(var l in n)l!=="em"&&(a[l]=n[l]-i);return a}function z(n){for(var i=n.height,a=n.data,l=3;l0;l-=4)if(a[l]!==0)return Math.floor((l-3)*.25/i)}}),pQ=It((et,Y)=>{var f=iQ(),y=t1(),z=aQ(),P=oQ(),n=KD(),i=H_(),a=sQ(),l=cQ(),o=Yw(),c=uQ(),s=az(),h=hQ(),m=dQ(),b=Yf(),x=fQ(),_=Db(),A=iz(),d=A.nextPow2,k=new n,w=!1;document.body&&(D=document.body.appendChild(document.createElement("div")),D.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(D).fontStretch&&(w=!0),document.body.removeChild(D));var D,E=function(M){I(M)?(M={regl:M},this.gl=M.regl._gl):this.gl=P(M),this.shader=k.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=M.regl||z({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),k.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(c(M)?M:{})};E.prototype.createShader=function(){var M=this.regl,p=M({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:M.prop("count"),offset:M.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:M.this("sizeBuffer")},width:{offset:0,stride:8,buffer:M.this("sizeBuffer")},char:M.this("charBuffer"),position:M.this("position")},uniforms:{atlasSize:function(C,S){return[S.atlas.width,S.atlas.height]},atlasDim:function(C,S){return[S.atlas.cols,S.atlas.rows]},atlas:function(C,S){return S.atlas.texture},charStep:function(C,S){return S.atlas.step},em:function(C,S){return S.atlas.em},color:M.prop("color"),opacity:M.prop("opacity"),viewport:M.this("viewportArray"),scale:M.this("scale"),align:M.prop("align"),baseline:M.prop("baseline"),translate:M.this("translate"),positionOffset:M.prop("positionOffset")},primitive:"points",viewport:M.this("viewport"),vert:` +`),oi;if(Ir&&(oi=Au(En),Ir[oi]))return Ir[oi].apply(null,Ai);var Yi=Function.apply(null,ri.concat(En));return Ir&&(Ir[oi]=Yi),Yi.apply(null,Ai)}return{global:Ia,link:On,block:Si,proc:eo,scope:ha,cond:aa,compile:ma}}var uo="xyzw".split(""),Sa=5121,Za=1,Ra=2,pa=0,_o=1,fs=2,os=3,gs=4,ws=5,bo=6,lo="dither",ks="blend.enable",dl="blend.color",Vl="blend.equation",gc="blend.func",ec="depth.enable",vc="depth.func",El="depth.range",tu="depth.mask",$c="colorMask",bc="cull.enable",qo="cull.face",Bs="frontFace",ac="lineWidth",Zl="polygonOffset.enable",Mu="polygonOffset.offset",eh="sample.alpha",Vu="sample.enable",Wh="sample.coverage",rh="stencil.enable",qh="stencil.mask",Wc="stencil.func",Gh="stencil.opFront",ds="stencil.opBack",$s="scissor.enable",nh="scissor.box",eu="viewport",lf="profile",Kt="framebuffer",O="vert",pt="frag",Dt="elements",Ft="primitive",qt="count",Ee="offset",je="instances",er="vao",wr="Width",Gr="Height",Zr=Kt+wr,Tn=Kt+Gr,qn=eu+wr,te=eu+Gr,le="drawingBuffer",Te=le+wr,Pe=le+Gr,We=[gc,Vl,Wc,Gh,ds,Wh,eu,nh,Mu],Ne=34962,Xe=34963,Pr=2884,qr=3042,Xr=3024,gn=2960,zn=2929,Qn=3089,ai=32823,Ti=32926,Qi=32928,Ma=5126,Aa=35664,Fa=35665,wo=35666,Yo=5124,Fo=35667,xs=35668,Sl=35669,Ll=35670,Ws=35671,zl=35672,Fc=35673,Sc=35674,rl=35675,nl=35676,au=35678,wu=35680,ih=4,Et=1028,Vt=1029,de=2304,Ie=2305,Be=32775,He=32776,hr=519,cr=7680,Fr=0,vn=1,fn=32774,Bn=513,ti=36160,ei=36064,ra={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},si={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Oi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$i={cw:de,ccw:Ie};function Ki(Se){return Array.isArray(Se)||dn(Se)||_n(Se)}function sa(Se){return Se.sort(function(Ir,Vr){return Ir===eu?-1:Vr===eu?1:Ir=1,ri>=2,Ir)}else if(Vr===gs){var Ai=Se.data;return new vi(Ai.thisDep,Ai.contextDep,Ai.propDep,Ir)}else{if(Vr===ws)return new vi(!1,!1,!1,Ir);if(Vr===bo){for(var bi=!1,On=!1,Si=!1,ha=0;ha=1&&(On=!0),Ia>=2&&(Si=!0)}else aa.type===gs&&(bi=bi||aa.data.thisDep,On=On||aa.data.contextDep,Si=Si||aa.data.propDep)}return new vi(bi,On,Si,Ir)}else return new vi(Vr===os,Vr===fs,Vr===_o,Ir)}}var $o=new vi(!1,!1,!1,function(){});function Ko(Se,Ir,Vr,ri,Ai,bi,On,Si,ha,aa,Ia,co,eo,ma,ji,En){var oi=aa.Record,Yi={add:32774,subtract:32778,"reverse subtract":32779};Vr.ext_blend_minmax&&(Yi.min=Be,Yi.max=He);var Ni=Vr.angle_instanced_arrays,wi=Vr.webgl_draw_buffers,Ua=Vr.oes_vertex_array_object,Ca={dirty:!0,profile:En.profile},io={},Ri=[],ki={},$a={};function Ea(Jt){return Jt.replace(".","_")}function la(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),io[lr]=Ca[lr]=!!De,ki[lr]=fe}function ua(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),Array.isArray(De)?(Ca[lr]=De.slice(),io[lr]=De.slice()):Ca[lr]=io[lr]=De,$a[lr]=fe}function Oa(Jt){return!!isNaN(Jt)}la(lo,Xr),la(ks,qr),ua(dl,"blendColor",[0,0,0,0]),ua(Vl,"blendEquationSeparate",[fn,fn]),ua(gc,"blendFuncSeparate",[vn,Fr,vn,Fr]),la(ec,zn,!0),ua(vc,"depthFunc",Bn),ua(El,"depthRange",[0,1]),ua(tu,"depthMask",!0),ua($c,$c,[!0,!0,!0,!0]),la(bc,Pr),ua(qo,"cullFace",Vt),ua(Bs,Bs,Ie),ua(ac,ac,1),la(Zl,ai),ua(Mu,"polygonOffset",[0,0]),la(eh,Ti),la(Vu,Qi),ua(Wh,"sampleCoverage",[1,!1]),la(rh,gn),ua(qh,"stencilMask",-1),ua(Wc,"stencilFunc",[hr,0,-1]),ua(Gh,"stencilOpSeparate",[Et,cr,cr,cr]),ua(ds,"stencilOpSeparate",[Vt,cr,cr,cr]),la($s,Qn),ua(nh,"scissor",[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]),ua(eu,eu,[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]);var Vo={gl:Se,context:eo,strings:Ir,next:io,current:Ca,draw:co,elements:bi,buffer:Ai,shader:Ia,attributes:aa.state,vao:aa,uniforms:ha,framebuffer:Si,extensions:Vr,timer:ma,isBufferArgs:Ki},Bo={primTypes:Ei,compareFuncs:si,blendFuncs:ra,blendEquations:Yi,stencilOps:Oi,glTypes:ci,orientationType:$i};wi&&(Bo.backBuffer=[Vt],Bo.drawBuffer=p(ri.maxDrawbuffers,function(Jt){return Jt===0?[0]:p(Jt,function(fe){return ei+fe})}));var za=0;function Ya(){var Jt=Qa({cache:ji}),fe=Jt.link,De=Jt.global;Jt.id=za++,Jt.batchId="0";var lr=fe(Vo),tr=Jt.shared={props:"a0"};Object.keys(Vo).forEach(function(rr){tr[rr]=De.def(lr,".",rr)});var ar=Jt.next={},dr=Jt.current={};Object.keys($a).forEach(function(rr){Array.isArray(Ca[rr])&&(ar[rr]=De.def(tr.next,".",rr),dr[rr]=De.def(tr.current,".",rr))});var gr=Jt.constants={};Object.keys(Bo).forEach(function(rr){gr[rr]=De.def(JSON.stringify(Bo[rr]))}),Jt.invoke=function(rr,Je){switch(Je.type){case pa:var Hr=["this",tr.context,tr.props,Jt.batchId];return rr.def(fe(Je.data),".call(",Hr.slice(0,Math.max(Je.data.length+1,4)),")");case _o:return rr.def(tr.props,Je.data);case fs:return rr.def(tr.context,Je.data);case os:return rr.def("this",Je.data);case gs:return Je.data.append(Jt,rr),Je.data.ref;case ws:return Je.data.toString();case bo:return Je.data.map(function(wn){return Jt.invoke(rr,wn)})}},Jt.attribCache={};var Ge={};return Jt.scopeAttrib=function(rr){var Je=Ir.id(rr);if(Je in Ge)return Ge[Je];var Hr=aa.scope[Je];Hr||(Hr=aa.scope[Je]=new oi);var wn=Ge[Je]=fe(Hr);return wn},Jt}function Eo(Jt){var fe=Jt.static,De=Jt.dynamic,lr;if(lf in fe){var tr=!!fe[lf];lr=ao(function(dr,gr){return tr}),lr.enable=tr}else if(lf in De){var ar=De[lf];lr=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}return lr}function No(Jt,fe){var De=Jt.static,lr=Jt.dynamic;if(Kt in De){var tr=De[Kt];return tr?(tr=Si.getFramebuffer(tr),ao(function(dr,gr){var Ge=dr.link(tr),rr=dr.shared;gr.set(rr.framebuffer,".next",Ge);var Je=rr.context;return gr.set(Je,"."+Zr,Ge+".width"),gr.set(Je,"."+Tn,Ge+".height"),Ge})):ao(function(dr,gr){var Ge=dr.shared;gr.set(Ge.framebuffer,".next","null");var rr=Ge.context;return gr.set(rr,"."+Zr,rr+"."+Te),gr.set(rr,"."+Tn,rr+"."+Pe),"null"})}else if(Kt in lr){var ar=lr[Kt];return xo(ar,function(dr,gr){var Ge=dr.invoke(gr,ar),rr=dr.shared,Je=rr.framebuffer,Hr=gr.def(Je,".getFramebuffer(",Ge,")");gr.set(Je,".next",Hr);var wn=rr.context;return gr.set(wn,"."+Zr,Hr+"?"+Hr+".width:"+wn+"."+Te),gr.set(wn,"."+Tn,Hr+"?"+Hr+".height:"+wn+"."+Pe),Hr})}else return null}function hs(Jt,fe,De){var lr=Jt.static,tr=Jt.dynamic;function ar(Ge){if(Ge in lr){var rr=lr[Ge],Je=!0,Hr=rr.x|0,wn=rr.y|0,Ln,Ii;return"width"in rr?Ln=rr.width|0:Je=!1,"height"in rr?Ii=rr.height|0:Je=!1,new vi(!Je&&fe&&fe.thisDep,!Je&&fe&&fe.contextDep,!Je&&fe&&fe.propDep,function(Vi,Di){var da=Vi.shared.context,Hi=Ln;"width"in rr||(Hi=Di.def(da,".",Zr,"-",Hr));var Wi=Ii;return"height"in rr||(Wi=Di.def(da,".",Tn,"-",wn)),[Hr,wn,Hi,Wi]})}else if(Ge in tr){var Mi=tr[Ge],gi=xo(Mi,function(Vi,Di){var da=Vi.invoke(Di,Mi),Hi=Vi.shared.context,Wi=Di.def(da,".x|0"),wa=Di.def(da,".y|0"),vo=Di.def('"width" in ',da,"?",da,".width|0:","(",Hi,".",Zr,"-",Wi,")"),So=Di.def('"height" in ',da,"?",da,".height|0:","(",Hi,".",Tn,"-",wa,")");return[Wi,wa,vo,So]});return fe&&(gi.thisDep=gi.thisDep||fe.thisDep,gi.contextDep=gi.contextDep||fe.contextDep,gi.propDep=gi.propDep||fe.propDep),gi}else return fe?new vi(fe.thisDep,fe.contextDep,fe.propDep,function(Vi,Di){var da=Vi.shared.context;return[0,0,Di.def(da,".",Zr),Di.def(da,".",Tn)]}):null}var dr=ar(eu);if(dr){var gr=dr;dr=new vi(dr.thisDep,dr.contextDep,dr.propDep,function(Ge,rr){var Je=gr.append(Ge,rr),Hr=Ge.shared.context;return rr.set(Hr,"."+qn,Je[2]),rr.set(Hr,"."+te,Je[3]),Je})}return{viewport:dr,scissor_box:ar(nh)}}function Xl(Jt,fe){var De=Jt.static,lr=typeof De[pt]=="string"&&typeof De[O]=="string";if(lr){if(Object.keys(fe.dynamic).length>0)return null;var tr=fe.static,ar=Object.keys(tr);if(ar.length>0&&typeof tr[ar[0]]=="number"){for(var dr=[],gr=0;gr"+Wi+"?"+Je+".constant["+Wi+"]:0;"}).join(""),"}}else{","if(",Ln,"(",Je,".buffer)){",Vi,"=",Ii,".createStream(",Ne,",",Je,".buffer);","}else{",Vi,"=",Ii,".getBuffer(",Je,".buffer);","}",Di,'="type" in ',Je,"?",wn.glTypes,"[",Je,".type]:",Vi,".dtype;",Mi.normalized,"=!!",Je,".normalized;");function da(Hi){rr(Mi[Hi],"=",Je,".",Hi,"|0;")}return da("size"),da("offset"),da("stride"),da("divisor"),rr("}}"),rr.exit("if(",Mi.isStream,"){",Ii,".destroyStream(",Vi,");","}"),Mi}tr[ar]=xo(dr,gr)}),tr}function ku(Jt){var fe=Jt.static,De=Jt.dynamic,lr={};return Object.keys(fe).forEach(function(tr){var ar=fe[tr];lr[tr]=ao(function(dr,gr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:dr.link(ar)})}),Object.keys(De).forEach(function(tr){var ar=De[tr];lr[tr]=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}),lr}function Eu(Jt,fe,De,lr,tr){Jt.static,Jt.dynamic;var ar=Xl(Jt,fe),dr=No(Jt),gr=hs(Jt,dr),Ge=ys(Jt),rr=Dc(Jt),Je=Rl(Jt,tr,ar);function Hr(Vi){var Di=gr[Vi];Di&&(rr[Vi]=Di)}Hr(eu),Hr(Ea(nh));var wn=Object.keys(rr).length>0,Ln={framebuffer:dr,draw:Ge,shader:Je,state:rr,dirty:wn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ln.profile=Eo(Jt),Ln.uniforms=Cl(De),Ln.drawVAO=Ln.scopeVAO=Ge.vao,!Ln.drawVAO&&Je.program&&!ar&&Vr.angle_instanced_arrays&&Ge.static.elements){var Ii=!0,Mi=Je.program.attributes.map(function(Vi){var Di=fe.static[Vi];return Ii=Ii&&!!Di,Di});if(Ii&&Mi.length>0){var gi=aa.getVAO(aa.createVAO({attributes:Mi,elements:Ge.static.elements}));Ln.drawVAO=new vi(null,null,null,function(Vi,Di){return Vi.link(gi)}),Ln.useVAO=!0}}return ar?Ln.useVAO=!0:Ln.attributes=Nc(fe),Ln.context=ku(lr),Ln}function Ec(Jt,fe,De){var lr=Jt.shared,tr=lr.context,ar=Jt.scope();Object.keys(De).forEach(function(dr){fe.save(tr,"."+dr);var gr=De[dr],Ge=gr.append(Jt,fe);Array.isArray(Ge)?ar(tr,".",dr,"=[",Ge.join(),"];"):ar(tr,".",dr,"=",Ge,";")}),fe(ar)}function kc(Jt,fe,De,lr){var tr=Jt.shared,ar=tr.gl,dr=tr.framebuffer,gr;wi&&(gr=fe.def(tr.extensions,".webgl_draw_buffers"));var Ge=Jt.constants,rr=Ge.drawBuffer,Je=Ge.backBuffer,Hr;De?Hr=De.append(Jt,fe):Hr=fe.def(dr,".next"),lr||fe("if(",Hr,"!==",dr,".cur){"),fe("if(",Hr,"){",ar,".bindFramebuffer(",ti,",",Hr,".framebuffer);"),wi&&fe(gr,".drawBuffersWEBGL(",rr,"[",Hr,".colorAttachments.length]);"),fe("}else{",ar,".bindFramebuffer(",ti,",null);"),wi&&fe(gr,".drawBuffersWEBGL(",Je,");"),fe("}",dr,".cur=",Hr,";"),lr||fe("}")}function zc(Jt,fe,De){var lr=Jt.shared,tr=lr.gl,ar=Jt.current,dr=Jt.next,gr=lr.current,Ge=lr.next,rr=Jt.cond(gr,".dirty");Ri.forEach(function(Je){var Hr=Ea(Je);if(!(Hr in De.state)){var wn,Ln;if(Hr in dr){wn=dr[Hr],Ln=ar[Hr];var Ii=p(Ca[Hr].length,function(gi){return rr.def(wn,"[",gi,"]")});rr(Jt.cond(Ii.map(function(gi,Vi){return gi+"!=="+Ln+"["+Vi+"]"}).join("||")).then(tr,".",$a[Hr],"(",Ii,");",Ii.map(function(gi,Vi){return Ln+"["+Vi+"]="+gi}).join(";"),";"))}else{wn=rr.def(Ge,".",Hr);var Mi=Jt.cond(wn,"!==",gr,".",Hr);rr(Mi),Hr in ki?Mi(Jt.cond(wn).then(tr,".enable(",ki[Hr],");").else(tr,".disable(",ki[Hr],");"),gr,".",Hr,"=",wn,";"):Mi(tr,".",$a[Hr],"(",wn,");",gr,".",Hr,"=",wn,";")}}}),Object.keys(De.state).length===0&&rr(gr,".dirty=false;"),fe(rr)}function Xo(Jt,fe,De,lr){var tr=Jt.shared,ar=Jt.current,dr=tr.current,gr=tr.gl,Ge;sa(Object.keys(De)).forEach(function(rr){var Je=De[rr];if(!(lr&&!lr(Je))){var Hr=Je.append(Jt,fe);if(ki[rr]){var wn=ki[rr];no(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(Jt.cond(Ge).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Ge,";")):(fe(Jt.cond(Hr).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Hr,";"))}else if(Jn(Hr)){var Ln=ar[rr];fe(gr,".",$a[rr],"(",Hr,");",Hr.map(function(Ii,Mi){return Ln+"["+Mi+"]="+Ii}).join(";"),";")}else no(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(gr,".",$a[rr],"(",Ge,");",dr,".",rr,"=",Ge,";")):fe(gr,".",$a[rr],"(",Hr,");",dr,".",rr,"=",Hr,";")}})}function Oc(Jt,fe){Ni&&(Jt.instancing=fe.def(Jt.shared.extensions,".angle_instanced_arrays"))}function xl(Jt,fe,De,lr,tr){var ar=Jt.shared,dr=Jt.stats,gr=ar.current,Ge=ar.timer,rr=De.profile;function Je(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Hr,wn;function Ln(da){Hr=fe.def(),da(Hr,"=",Je(),";"),typeof tr=="string"?da(dr,".count+=",tr,";"):da(dr,".count++;"),ma&&(lr?(wn=fe.def(),da(wn,"=",Ge,".getNumPendingQueries();")):da(Ge,".beginQuery(",dr,");"))}function Ii(da){da(dr,".cpuTime+=",Je(),"-",Hr,";"),ma&&(lr?da(Ge,".pushScopeStats(",wn,",",Ge,".getNumPendingQueries(),",dr,");"):da(Ge,".endQuery();"))}function Mi(da){var Hi=fe.def(gr,".profile");fe(gr,".profile=",da,";"),fe.exit(gr,".profile=",Hi,";")}var gi;if(rr){if(no(rr)){rr.enable?(Ln(fe),Ii(fe.exit),Mi("true")):Mi("false");return}gi=rr.append(Jt,fe),Mi(gi)}else gi=fe.def(gr,".profile");var Vi=Jt.block();Ln(Vi),fe("if(",gi,"){",Vi,"}");var Di=Jt.block();Ii(Di),fe.exit("if(",gi,"){",Di,"}")}function jc(Jt,fe,De,lr,tr){var ar=Jt.shared;function dr(Ge){switch(Ge){case Aa:case Fo:case Ws:return 2;case Fa:case xs:case zl:return 3;case wo:case Sl:case Fc:return 4;default:return 1}}function gr(Ge,rr,Je){var Hr=ar.gl,wn=fe.def(Ge,".location"),Ln=fe.def(ar.attributes,"[",wn,"]"),Ii=Je.state,Mi=Je.buffer,gi=[Je.x,Je.y,Je.z,Je.w],Vi=["buffer","normalized","offset","stride"];function Di(){fe("if(!",Ln,".buffer){",Hr,".enableVertexAttribArray(",wn,");}");var Hi=Je.type,Wi;if(Je.size?Wi=fe.def(Je.size,"||",rr):Wi=rr,fe("if(",Ln,".type!==",Hi,"||",Ln,".size!==",Wi,"||",Vi.map(function(vo){return Ln+"."+vo+"!=="+Je[vo]}).join("||"),"){",Hr,".bindBuffer(",Ne,",",Mi,".buffer);",Hr,".vertexAttribPointer(",[wn,Wi,Hi,Je.normalized,Je.stride,Je.offset],");",Ln,".type=",Hi,";",Ln,".size=",Wi,";",Vi.map(function(vo){return Ln+"."+vo+"="+Je[vo]+";"}).join(""),"}"),Ni){var wa=Je.divisor;fe("if(",Ln,".divisor!==",wa,"){",Jt.instancing,".vertexAttribDivisorANGLE(",[wn,wa],");",Ln,".divisor=",wa,";}")}}function da(){fe("if(",Ln,".buffer){",Hr,".disableVertexAttribArray(",wn,");",Ln,".buffer=null;","}if(",uo.map(function(Hi,Wi){return Ln+"."+Hi+"!=="+gi[Wi]}).join("||"),"){",Hr,".vertexAttrib4f(",wn,",",gi,");",uo.map(function(Hi,Wi){return Ln+"."+Hi+"="+gi[Wi]+";"}).join(""),"}")}Ii===Za?Di():Ii===Ra?da():(fe("if(",Ii,"===",Za,"){"),Di(),fe("}else{"),da(),fe("}"))}lr.forEach(function(Ge){var rr=Ge.name,Je=De.attributes[rr],Hr;if(Je){if(!tr(Je))return;Hr=Je.append(Jt,fe)}else{if(!tr($o))return;var wn=Jt.scopeAttrib(rr);Hr={},Object.keys(new oi).forEach(function(Ln){Hr[Ln]=fe.def(wn,".",Ln)})}gr(Jt.link(Ge),dr(Ge.info.type),Hr)})}function Lu(Jt,fe,De,lr,tr,ar){for(var dr=Jt.shared,gr=dr.gl,Ge,rr=0;rr1){for(var ns=[],As=[],Wl=0;Wl>1)",Mi],");")}function wa(){De(gi,".drawArraysInstancedANGLE(",[wn,Ln,Ii,Mi],");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}function Hi(){function Wi(){De(ar+".drawElements("+[wn,Ii,Vi,Ln+"<<(("+Vi+"-"+Sa+")>>1)"]+");")}function wa(){De(ar+".drawArrays("+[wn,Ln,Ii]+");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}Ni&&(typeof Mi!="number"||Mi>=0)?typeof Mi=="string"?(De("if(",Mi,">0){"),da(),De("}else if(",Mi,"<0){"),Hi(),De("}")):da():Hi()}function Rs(Jt,fe,De,lr,tr){var ar=Ya(),dr=ar.proc("body",tr);return Ni&&(ar.instancing=dr.def(ar.shared.extensions,".angle_instanced_arrays")),Jt(ar,dr,De,lr),ar.compile().body}function Fl(Jt,fe,De,lr){Oc(Jt,fe),De.useVAO?De.drawVAO?fe(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,fe),");"):fe(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(fe(Jt.shared.vao,".setVAO(null);"),jc(Jt,fe,De,lr.attributes,function(){return!0})),Lu(Jt,fe,De,lr.uniforms,function(){return!0},!1),jo(Jt,fe,fe,De)}function Pl(Jt,fe){var De=Jt.proc("draw",1);Oc(Jt,De),Ec(Jt,De,fe.context),kc(Jt,De,fe.framebuffer),zc(Jt,De,fe),Xo(Jt,De,fe.state),xl(Jt,De,fe,!1,!0);var lr=fe.shader.progVar.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",lr,".program);"),fe.shader.program)Fl(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var tr=Jt.global.def("{}"),ar=De.def(lr,".id"),dr=De.def(tr,"[",ar,"]");De(Jt.cond(dr).then(dr,".call(this,a0);").else(dr,"=",tr,"[",ar,"]=",Jt.link(function(gr){return Rs(Fl,Jt,fe,gr,1)}),"(",lr,");",dr,".call(this,a0);"))}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function Z(Jt,fe,De,lr){Jt.batchId="a1",Oc(Jt,fe);function tr(){return!0}jc(Jt,fe,De,lr.attributes,tr),Lu(Jt,fe,De,lr.uniforms,tr,!1),jo(Jt,fe,fe,De)}function lt(Jt,fe,De,lr){Oc(Jt,fe);var tr=De.contextDep,ar=fe.def(),dr="a0",gr="a1",Ge=fe.def();Jt.shared.props=Ge,Jt.batchId=ar;var rr=Jt.scope(),Je=Jt.scope();fe(rr.entry,"for(",ar,"=0;",ar,"<",gr,";++",ar,"){",Ge,"=",dr,"[",ar,"];",Je,"}",rr.exit);function Hr(Vi){return Vi.contextDep&&tr||Vi.propDep}function wn(Vi){return!Hr(Vi)}if(De.needsContext&&Ec(Jt,Je,De.context),De.needsFramebuffer&&kc(Jt,Je,De.framebuffer),Xo(Jt,Je,De.state,Hr),De.profile&&Hr(De.profile)&&xl(Jt,Je,De,!1,!0),lr)De.useVAO?De.drawVAO?Hr(De.drawVAO)?Je(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,Je),");"):rr(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,rr),");"):rr(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(rr(Jt.shared.vao,".setVAO(null);"),jc(Jt,rr,De,lr.attributes,wn),jc(Jt,Je,De,lr.attributes,Hr)),Lu(Jt,rr,De,lr.uniforms,wn,!1),Lu(Jt,Je,De,lr.uniforms,Hr,!0),jo(Jt,rr,Je,De);else{var Ln=Jt.global.def("{}"),Ii=De.shader.progVar.append(Jt,Je),Mi=Je.def(Ii,".id"),gi=Je.def(Ln,"[",Mi,"]");Je(Jt.shared.gl,".useProgram(",Ii,".program);","if(!",gi,"){",gi,"=",Ln,"[",Mi,"]=",Jt.link(function(Vi){return Rs(Z,Jt,De,Vi,2)}),"(",Ii,");}",gi,".call(this,a0[",ar,"],",ar,");")}}function nt(Jt,fe){var De=Jt.proc("batch",2);Jt.batchId="0",Oc(Jt,De);var lr=!1,tr=!0;Object.keys(fe.context).forEach(function(Ln){lr=lr||fe.context[Ln].propDep}),lr||(Ec(Jt,De,fe.context),tr=!1);var ar=fe.framebuffer,dr=!1;ar?(ar.propDep?lr=dr=!0:ar.contextDep&&lr&&(dr=!0),dr||kc(Jt,De,ar)):kc(Jt,De,null),fe.state.viewport&&fe.state.viewport.propDep&&(lr=!0);function gr(Ln){return Ln.contextDep&&lr||Ln.propDep}zc(Jt,De,fe),Xo(Jt,De,fe.state,function(Ln){return!gr(Ln)}),(!fe.profile||!gr(fe.profile))&&xl(Jt,De,fe,!1,"a1"),fe.contextDep=lr,fe.needsContext=tr,fe.needsFramebuffer=dr;var Ge=fe.shader.progVar;if(Ge.contextDep&&lr||Ge.propDep)lt(Jt,De,fe,null);else{var rr=Ge.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",rr,".program);"),fe.shader.program)lt(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var Je=Jt.global.def("{}"),Hr=De.def(rr,".id"),wn=De.def(Je,"[",Hr,"]");De(Jt.cond(wn).then(wn,".call(this,a0,a1);").else(wn,"=",Je,"[",Hr,"]=",Jt.link(function(Ln){return Rs(lt,Jt,fe,Ln,2)}),"(",rr,");",wn,".call(this,a0,a1);"))}}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function wt(Jt,fe){var De=Jt.proc("scope",3);Jt.batchId="a2";var lr=Jt.shared,tr=lr.current;if(Ec(Jt,De,fe.context),fe.framebuffer&&fe.framebuffer.append(Jt,De),sa(Object.keys(fe.state)).forEach(function(gr){var Ge=fe.state[gr],rr=Ge.append(Jt,De);Jn(rr)?rr.forEach(function(Je,Hr){Oa(Je)?De.set(Jt.next[gr],"["+Hr+"]",Je):De.set(Jt.next[gr],"["+Hr+"]",Jt.link(Je,{stable:!0}))}):no(Ge)?De.set(lr.next,"."+gr,Jt.link(rr,{stable:!0})):De.set(lr.next,"."+gr,rr)}),xl(Jt,De,fe,!0,!0),[Dt,Ee,qt,je,Ft].forEach(function(gr){var Ge=fe.draw[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.draw,"."+gr,rr):De.set(lr.draw,"."+gr,Jt.link(rr),{stable:!0})}}),Object.keys(fe.uniforms).forEach(function(gr){var Ge=fe.uniforms[gr].append(Jt,De);Array.isArray(Ge)&&(Ge="["+Ge.map(function(rr){return Oa(rr)?rr:Jt.link(rr,{stable:!0})})+"]"),De.set(lr.uniforms,"["+Jt.link(Ir.id(gr),{stable:!0})+"]",Ge)}),Object.keys(fe.attributes).forEach(function(gr){var Ge=fe.attributes[gr].append(Jt,De),rr=Jt.scopeAttrib(gr);Object.keys(new oi).forEach(function(Je){De.set(rr,"."+Je,Ge[Je])})}),fe.scopeVAO){var ar=fe.scopeVAO.append(Jt,De);Oa(ar)?De.set(lr.vao,".targetVAO",ar):De.set(lr.vao,".targetVAO",Jt.link(ar,{stable:!0}))}function dr(gr){var Ge=fe.shader[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.shader,"."+gr,rr):De.set(lr.shader,"."+gr,Jt.link(rr,{stable:!0}))}}dr(O),dr(pt),Object.keys(fe.state).length>0&&(De(tr,".dirty=true;"),De.exit(tr,".dirty=true;")),De("a1(",Jt.shared.context,",a0,",Jt.batchId,");")}function Wt(Jt){if(!(typeof Jt!="object"||Jn(Jt))){for(var fe=Object.keys(Jt),De=0;De=0;--jo){var Rs=Oa[jo];Rs&&Rs(ma,null,0)}Vr.flush(),aa&&aa.update()}function No(){!Ya&&Oa.length>0&&(Ya=b.next(Eo))}function hs(){Ya&&(b.cancel(Eo),Ya=null)}function Xl(jo){jo.preventDefault(),hs(),Vo.forEach(function(Rs){Rs()})}function Rl(jo){Vr.getError(),Ai.restore(),Ca.restore(),Yi.restore(),io.restore(),Ri.restore(),ki.restore(),wi.restore(),aa&&aa.restore(),$a.procs.refresh(),No(),Bo.forEach(function(Rs){Rs()})}ua&&(ua.addEventListener(ml,Xl,!1),ua.addEventListener(yc,Rl,!1));function ys(){Oa.length=0,hs(),ua&&(ua.removeEventListener(ml,Xl),ua.removeEventListener(yc,Rl)),Ca.clear(),ki.clear(),Ri.clear(),wi.clear(),io.clear(),Ni.clear(),Yi.clear(),aa&&aa.clear(),za.forEach(function(jo){jo()})}function Dc(jo){function Rs(tr){var ar=f({},tr);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function dr(gr){if(gr in ar){var Ge=ar[gr];delete ar[gr],Object.keys(Ge).forEach(function(rr){ar[gr+"."+rr]=Ge[rr]})}}return dr("blend"),dr("depth"),dr("cull"),dr("stencil"),dr("polygonOffset"),dr("scissor"),dr("sample"),"vao"in tr&&(ar.vao=tr.vao),ar}function Fl(tr,ar){var dr={},gr={};return Object.keys(tr).forEach(function(Ge){var rr=tr[Ge];if(m.isDynamic(rr)){gr[Ge]=m.unbox(rr,Ge);return}else if(ar&&Array.isArray(rr)){for(var Je=0;Je0)return ke.call(this,De(tr|0),tr|0)}else if(Array.isArray(tr)){if(tr.length)return ke.call(this,tr,tr.length)}else return ve.call(this,tr)}return f(lr,{stats:wt,destroy:function(){Wt.destroy()}})}var Cl=ki.setFBO=Dc({framebuffer:m.define.call(null,oc,"framebuffer")});function Nc(jo,Rs){var Fl=0;$a.procs.poll();var Pl=Rs.color;Pl&&(Vr.clearColor(+Pl[0]||0,+Pl[1]||0,+Pl[2]||0,+Pl[3]||0),Fl|=ou),"depth"in Rs&&(Vr.clearDepth(+Rs.depth),Fl|=wc),"stencil"in Rs&&(Vr.clearStencil(Rs.stencil|0),Fl|=zo),Vr.clear(Fl)}function ku(jo){if("framebuffer"in jo)if(jo.framebuffer&&jo.framebuffer_reglType==="framebufferCube")for(var Rs=0;Rs<6;++Rs)Cl(f({framebuffer:jo.framebuffer.faces[Rs]},jo),Nc);else Cl(jo,Nc);else Nc(null,jo)}function Eu(jo){Oa.push(jo);function Rs(){var Fl=hc(Oa,jo);function Pl(){var Z=hc(Oa,Pl);Oa[Z]=Oa[Oa.length-1],Oa.length-=1,Oa.length<=0&&hs()}Oa[Fl]=Pl}return No(),{cancel:Rs}}function Ec(){var jo=la.viewport,Rs=la.scissor_box;jo[0]=jo[1]=Rs[0]=Rs[1]=0,ma.viewportWidth=ma.framebufferWidth=ma.drawingBufferWidth=jo[2]=Rs[2]=Vr.drawingBufferWidth,ma.viewportHeight=ma.framebufferHeight=ma.drawingBufferHeight=jo[3]=Rs[3]=Vr.drawingBufferHeight}function kc(){ma.tick+=1,ma.time=Xo(),Ec(),$a.procs.poll()}function zc(){io.refresh(),Ec(),$a.procs.refresh(),aa&&aa.update()}function Xo(){return(x()-Ia)/1e3}zc();function Oc(jo,Rs){var Fl;switch(jo){case"frame":return Eu(Rs);case"lost":Fl=Vo;break;case"restore":Fl=Bo;break;case"destroy":Fl=za;break}return Fl.push(Rs),{cancel:function(){for(var Pl=0;Pl=0},read:Ea,destroy:ys,_gl:Vr,_refresh:zc,poll:function(){kc(),aa&&aa.update()},now:Xo,stats:On,getCachedCode:xl,preloadCachedCode:jc});return Ir.onDone(null,Lu),Lu}return zh})}),oQ=It((et,Y)=>{var f=t1();Y.exports=function(a){if(a?typeof a=="string"&&(a={container:a}):a={},z(a)?a={container:a}:P(a)?a={container:a}:n(a)?a={gl:a}:a=f(a,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),a.pixelRatio||(a.pixelRatio=window.pixelRatio||1),a.gl)return a.gl;if(a.canvas&&(a.container=a.canvas.parentNode),a.container){if(typeof a.container=="string"){var l=document.querySelector(a.container);if(!l)throw Error("Element "+a.container+" is not found");a.container=l}z(a.container)?(a.canvas=a.container,a.container=a.canvas.parentNode):a.canvas||(a.canvas=i(),a.container.appendChild(a.canvas),y(a))}else if(!a.canvas)if(typeof document<"u")a.container=document.body||document.documentElement,a.canvas=i(),a.container.appendChild(a.canvas),y(a);else throw Error("Not DOM environment. Use headless-gl.");return a.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(o){try{a.gl=a.canvas.getContext(o,a.attrs)}catch{}return a.gl}),a.gl};function y(a){if(a.container)if(a.container==document.body)document.body.style.width||(a.canvas.width=a.width||a.pixelRatio*window.innerWidth),document.body.style.height||(a.canvas.height=a.height||a.pixelRatio*window.innerHeight);else{var l=a.container.getBoundingClientRect();a.canvas.width=a.width||l.right-l.left,a.canvas.height=a.height||l.bottom-l.top}}function z(a){return typeof a.getContext=="function"&&"width"in a&&"height"in a}function P(a){return typeof a.nodeName=="string"&&typeof a.appendChild=="function"&&typeof a.getBoundingClientRect=="function"}function n(a){return typeof a.drawArrays=="function"||typeof a.drawElements=="function"}function i(){var a=document.createElement("canvas");return a.style.position="absolute",a.style.top=0,a.style.left=0,a}}),sQ=It((et,Y)=>{var f=nz(),y=[32,126];Y.exports=z;function z(P){P=P||{};var n=P.shape?P.shape:P.canvas?[P.canvas.width,P.canvas.height]:[512,512],i=P.canvas||document.createElement("canvas"),a=P.font,l=typeof P.step=="number"?[P.step,P.step]:P.step||[32,32],o=P.chars||y;if(a&&typeof a!="string"&&(a=f(a)),!Array.isArray(o))o=String(o).split("");else if(o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"){for(var c=[],s=o[0],h=0;s<=o[1];s++)c[h++]=String.fromCharCode(s);o=c}n=n.slice(),i.width=n[0],i.height=n[1];var m=i.getContext("2d");m.fillStyle="#000",m.fillRect(0,0,i.width,i.height),m.font=a,m.textAlign="center",m.textBaseline="middle",m.fillStyle="#fff";for(var b=l[0]/2,x=l[1]/2,s=0;sn[0]-l[0]/2&&(b=l[0]/2,x+=l[1]);return i}}),iz=It(et=>{"use restrict";var Y=32;et.INT_BITS=Y,et.INT_MAX=2147483647,et.INT_MIN=-1<0)-(z<0)},et.abs=function(z){var P=z>>Y-1;return(z^P)-P},et.min=function(z,P){return P^(z^P)&-(z65535)<<4,z>>>=P,n=(z>255)<<3,z>>>=n,P|=n,n=(z>15)<<2,z>>>=n,P|=n,n=(z>3)<<1,z>>>=n,P|=n,P|z>>1},et.log10=function(z){return z>=1e9?9:z>=1e8?8:z>=1e7?7:z>=1e6?6:z>=1e5?5:z>=1e4?4:z>=1e3?3:z>=100?2:z>=10?1:0},et.popCount=function(z){return z=z-(z>>>1&1431655765),z=(z&858993459)+(z>>>2&858993459),(z+(z>>>4)&252645135)*16843009>>>24};function f(z){var P=32;return z&=-z,z&&P--,z&65535&&(P-=16),z&16711935&&(P-=8),z&252645135&&(P-=4),z&858993459&&(P-=2),z&1431655765&&(P-=1),P}et.countTrailingZeros=f,et.nextPow2=function(z){return z+=z===0,--z,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z+1},et.prevPow2=function(z){return z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z-(z>>>1)},et.parity=function(z){return z^=z>>>16,z^=z>>>8,z^=z>>>4,z&=15,27030>>>z&1};var y=new Array(256);(function(z){for(var P=0;P<256;++P){var n=P,i=P,a=7;for(n>>>=1;n;n>>>=1)i<<=1,i|=n&1,--a;z[P]=i<>>8&255]<<16|y[z>>>16&255]<<8|y[z>>>24&255]},et.interleave2=function(z,P){return z&=65535,z=(z|z<<8)&16711935,z=(z|z<<4)&252645135,z=(z|z<<2)&858993459,z=(z|z<<1)&1431655765,P&=65535,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,z|P<<1},et.deinterleave2=function(z,P){return z=z>>>P&1431655765,z=(z|z>>>1)&858993459,z=(z|z>>>2)&252645135,z=(z|z>>>4)&16711935,z=(z|z>>>16)&65535,z<<16>>16},et.interleave3=function(z,P,n){return z&=1023,z=(z|z<<16)&4278190335,z=(z|z<<8)&251719695,z=(z|z<<4)&3272356035,z=(z|z<<2)&1227133513,P&=1023,P=(P|P<<16)&4278190335,P=(P|P<<8)&251719695,P=(P|P<<4)&3272356035,P=(P|P<<2)&1227133513,z|=P<<1,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,z|n<<2},et.deinterleave3=function(z,P){return z=z>>>P&1227133513,z=(z|z>>>2)&3272356035,z=(z|z>>>4)&251719695,z=(z|z>>>8)&4278190335,z=(z|z>>>16)&1023,z<<22>>22},et.nextCombination=function(z){var P=z|z-1;return P+1|(~P&-~P)-1>>>f(z)+1}}),lQ=It((et,Y)=>{function f(P,n,i){var a=P[i]|0;if(a<=0)return[];var l=new Array(a),o;if(i===P.length-1)for(o=0;o"u"&&(n=0),typeof P){case"number":if(P>0)return y(P|0,n);break;case"object":if(typeof P.length=="number")return f(P,n,0);break}return[]}Y.exports=z}),cQ=It(et=>{var Y=iz(),f=lQ(),y=_b().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:f([32,0]),UINT16:f([32,0]),UINT32:f([32,0]),BIGUINT64:f([32,0]),INT8:f([32,0]),INT16:f([32,0]),INT32:f([32,0]),BIGINT64:f([32,0]),FLOAT:f([32,0]),DOUBLE:f([32,0]),DATA:f([32,0]),UINT8C:f([32,0]),BUFFER:f([32,0])});var z=typeof Uint8ClampedArray<"u",P=typeof BigUint64Array<"u",n=typeof BigInt64Array<"u",i=window.__TYPEDARRAY_POOL;i.UINT8C||(i.UINT8C=f([32,0])),i.BIGUINT64||(i.BIGUINT64=f([32,0])),i.BIGINT64||(i.BIGINT64=f([32,0])),i.BUFFER||(i.BUFFER=f([32,0]));var a=i.DATA,l=i.BUFFER;et.free=function(p){if(y.isBuffer(p))l[Y.log2(p.length)].push(p);else{if(Object.prototype.toString.call(p)!=="[object ArrayBuffer]"&&(p=p.buffer),!p)return;var g=p.length||p.byteLength,C=Y.log2(g)|0;a[C].push(p)}};function o(p){if(p){var g=p.length||p.byteLength,C=Y.log2(g);a[C].push(p)}}function c(p){o(p.buffer)}et.freeUint8=et.freeUint16=et.freeUint32=et.freeBigUint64=et.freeInt8=et.freeInt16=et.freeInt32=et.freeBigInt64=et.freeFloat32=et.freeFloat=et.freeFloat64=et.freeDouble=et.freeUint8Clamped=et.freeDataView=c,et.freeArrayBuffer=o,et.freeBuffer=function(p){l[Y.log2(p.length)].push(p)},et.malloc=function(p,g){if(g===void 0||g==="arraybuffer")return s(p);switch(g){case"uint8":return h(p);case"uint16":return m(p);case"uint32":return b(p);case"int8":return x(p);case"int16":return _(p);case"int32":return A(p);case"float":case"float32":return d(p);case"double":case"float64":return k(p);case"uint8_clamped":return w(p);case"bigint64":return E(p);case"biguint64":return D(p);case"buffer":return M(p);case"data":case"dataview":return I(p);default:return null}return null};function s(g){var g=Y.nextPow2(g),C=Y.log2(g),S=a[C];return S.length>0?S.pop():new ArrayBuffer(g)}et.mallocArrayBuffer=s;function h(p){return new Uint8Array(s(p),0,p)}et.mallocUint8=h;function m(p){return new Uint16Array(s(2*p),0,p)}et.mallocUint16=m;function b(p){return new Uint32Array(s(4*p),0,p)}et.mallocUint32=b;function x(p){return new Int8Array(s(p),0,p)}et.mallocInt8=x;function _(p){return new Int16Array(s(2*p),0,p)}et.mallocInt16=_;function A(p){return new Int32Array(s(4*p),0,p)}et.mallocInt32=A;function d(p){return new Float32Array(s(4*p),0,p)}et.mallocFloat32=et.mallocFloat=d;function k(p){return new Float64Array(s(8*p),0,p)}et.mallocFloat64=et.mallocDouble=k;function w(p){return z?new Uint8ClampedArray(s(p),0,p):h(p)}et.mallocUint8Clamped=w;function D(p){return P?new BigUint64Array(s(8*p),0,p):null}et.mallocBigUint64=D;function E(p){return n?new BigInt64Array(s(8*p),0,p):null}et.mallocBigInt64=E;function I(p){return new DataView(s(p),0,p)}et.mallocDataView=I;function M(p){p=Y.nextPow2(p);var g=Y.log2(p),C=l[g];return C.length>0?C.pop():new y(p)}et.mallocBuffer=M,et.clearCache=function(){for(var p=0;p<32;++p)i.UINT8[p].length=0,i.UINT16[p].length=0,i.UINT32[p].length=0,i.INT8[p].length=0,i.INT16[p].length=0,i.INT32[p].length=0,i.FLOAT[p].length=0,i.DOUBLE[p].length=0,i.BIGUINT64[p].length=0,i.BIGINT64[p].length=0,i.UINT8C[p].length=0,a[p].length=0,l[p].length=0}}),uQ=It((et,Y)=>{var f=Object.prototype.toString;Y.exports=function(y){var z;return f.call(y)==="[object Object]"&&(z=Object.getPrototypeOf(y),z===null||z===Object.getPrototypeOf({}))}}),az=It((et,Y)=>{Y.exports=function(f,y){y||(y=[0,""]),f=String(f);var z=parseFloat(f,10);return y[0]=z,y[1]=f.match(/[\d.\-\+]*\s*(.*)/)[1]||"",y}}),hQ=It((et,Y)=>{var f=az();Y.exports=n;var y=96;function z(i,a){var l=f(getComputedStyle(i).getPropertyValue(a));return l[0]*n(l[1],i)}function P(i,a){var l=document.createElement("div");l.style["font-size"]="128"+i,a.appendChild(l);var o=z(l,"font-size")/128;return a.removeChild(l),o}function n(i,a){switch(a=a||document.body,i=(i||"px").trim().toLowerCase(),(a===window||a===document)&&(a=document.body),i){case"%":return a.clientHeight/100;case"ch":case"ex":return P(i,a);case"em":return z(a,"font-size");case"rem":return z(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return y;case"cm":return y/2.54;case"mm":return y/25.4;case"pt":return y/72;case"pc":return y/6}return 1}}),dQ=It((et,Y)=>{Y.exports=P;var f=P.canvas=document.createElement("canvas"),y=f.getContext("2d"),z=n([32,126]);P.createPairs=n,P.ascii=z;function P(i,a){Array.isArray(i)&&(i=i.join(", "));var l={},o,c=16,s=.05;a&&(a.length===2&&typeof a[0]=="number"?o=n(a):Array.isArray(a)?o=a:(a.o?o=n(a.o):a.pairs&&(o=a.pairs),a.fontSize&&(c=a.fontSize),a.threshold!=null&&(s=a.threshold))),o||(o=z),y.font=c+"px "+i;for(var h=0;hc*s){var _=(x-b)/c;l[m]=_*1e3}}return l}function n(i){for(var a=[],l=i[0];l<=i[1];l++)for(var o=String.fromCharCode(l),c=i[0];c{Y.exports=f,f.canvas=document.createElement("canvas"),f.cache={};function f(s,i){i||(i={}),(typeof s=="string"||Array.isArray(s))&&(i.family=s);var a=Array.isArray(i.family)?i.family.join(", "):i.family;if(!a)throw Error("`family` must be defined");var l=i.size||i.fontSize||i.em||48,o=i.weight||i.fontWeight||"",c=i.style||i.fontStyle||"",s=[c,o,l].join(" ")+"px "+a,h=i.origin||"top";if(f.cache[a]&&l<=f.cache[a].em)return y(f.cache[a],h);var m=i.canvas||f.canvas,b=m.getContext("2d"),x={upper:i.upper!==void 0?i.upper:"H",lower:i.lower!==void 0?i.lower:"x",descent:i.descent!==void 0?i.descent:"p",ascent:i.ascent!==void 0?i.ascent:"h",tittle:i.tittle!==void 0?i.tittle:"i",overshoot:i.overshoot!==void 0?i.overshoot:"O"},_=Math.ceil(l*1.5);m.height=_,m.width=_*.5,b.font=s;var A="H",d={top:0};b.clearRect(0,0,_,_),b.textBaseline="top",b.fillStyle="black",b.fillText(A,0,0);var k=z(b.getImageData(0,0,_,_));b.clearRect(0,0,_,_),b.textBaseline="bottom",b.fillText(A,0,_);var w=z(b.getImageData(0,0,_,_));d.lineHeight=d.bottom=_-w+k,b.clearRect(0,0,_,_),b.textBaseline="alphabetic",b.fillText(A,0,_);var D=z(b.getImageData(0,0,_,_)),E=_-D-1+k;d.baseline=d.alphabetic=E,b.clearRect(0,0,_,_),b.textBaseline="middle",b.fillText(A,0,_*.5);var I=z(b.getImageData(0,0,_,_));d.median=d.middle=_-I-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="hanging",b.fillText(A,0,_*.5);var M=z(b.getImageData(0,0,_,_));d.hanging=_-M-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="ideographic",b.fillText(A,0,_);var p=z(b.getImageData(0,0,_,_));if(d.ideographic=_-p-1+k,x.upper&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.upper,0,0),d.upper=z(b.getImageData(0,0,_,_)),d.capHeight=d.baseline-d.upper),x.lower&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.lower,0,0),d.lower=z(b.getImageData(0,0,_,_)),d.xHeight=d.baseline-d.lower),x.tittle&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.tittle,0,0),d.tittle=z(b.getImageData(0,0,_,_))),x.ascent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.ascent,0,0),d.ascent=z(b.getImageData(0,0,_,_))),x.descent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.descent,0,0),d.descent=P(b.getImageData(0,0,_,_))),x.overshoot){b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.overshoot,0,0);var g=P(b.getImageData(0,0,_,_));d.overshoot=g-E}for(var C in d)d[C]/=l;return d.em=l,f.cache[a]=d,y(d,h)}function y(n,i){var a={};typeof i=="string"&&(i=n[i]);for(var l in n)l!=="em"&&(a[l]=n[l]-i);return a}function z(n){for(var i=n.height,a=n.data,l=3;l0;l-=4)if(a[l]!==0)return Math.floor((l-3)*.25/i)}}),pQ=It((et,Y)=>{var f=iQ(),y=t1(),z=aQ(),P=oQ(),n=KD(),i=H_(),a=sQ(),l=cQ(),o=Yw(),c=uQ(),s=az(),h=hQ(),m=dQ(),b=Yf(),x=fQ(),_=zb(),A=iz(),d=A.nextPow2,k=new n,w=!1;document.body&&(D=document.body.appendChild(document.createElement("div")),D.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(D).fontStretch&&(w=!0),document.body.removeChild(D));var D,E=function(M){I(M)?(M={regl:M},this.gl=M.regl._gl):this.gl=P(M),this.shader=k.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=M.regl||z({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),k.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(c(M)?M:{})};E.prototype.createShader=function(){var M=this.regl,p=M({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:M.prop("count"),offset:M.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:M.this("sizeBuffer")},width:{offset:0,stride:8,buffer:M.this("sizeBuffer")},char:M.this("charBuffer"),position:M.this("position")},uniforms:{atlasSize:function(C,S){return[S.atlas.width,S.atlas.height]},atlasDim:function(C,S){return[S.atlas.cols,S.atlas.rows]},atlas:function(C,S){return S.atlas.texture},charStep:function(C,S){return S.atlas.step},em:function(C,S){return S.atlas.em},color:M.prop("color"),opacity:M.prop("opacity"),viewport:M.this("viewportArray"),scale:M.this("scale"),align:M.prop("align"),baseline:M.prop("baseline"),translate:M.this("translate"),positionOffset:M.prop("positionOffset")},primitive:"points",viewport:M.this("viewport"),vert:` precision highp float; attribute float width, charOffset, char; attribute vec2 position; @@ -2814,17 +2814,17 @@ void main() { // color.rgb += (1. - color.rgb) * (1. - mask.rgb); gl_FragColor = color; - }`}),g={};return{regl:M,draw:p,atlas:g}},E.prototype.update=function(M){var p=this;if(typeof M=="string")M={text:M};else if(!M)return;M=y(M,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),M.opacity!=null&&(Array.isArray(M.opacity)?this.opacity=M.opacity.map(function(Ot){return parseFloat(Ot)}):this.opacity=parseFloat(M.opacity)),M.viewport!=null&&(this.viewport=o(M.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),M.kerning!=null&&(this.kerning=M.kerning),M.offset!=null&&(typeof M.offset=="number"&&(M.offset=[M.offset,0]),this.positionOffset=_(M.offset)),M.direction&&(this.direction=M.direction),M.range&&(this.range=M.range,this.scale=[1/(M.range[2]-M.range[0]),1/(M.range[3]-M.range[1])],this.translate=[-M.range[0],-M.range[1]]),M.scale&&(this.scale=M.scale),M.translate&&(this.translate=M.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!M.font&&(M.font=E.baseFontSize+"px sans-serif");var g=!1,C=!1;if(M.font&&(Array.isArray(M.font)?M.font:[M.font]).forEach(function(Ot,Lt){if(typeof Ot=="string")try{Ot=f.parse(Ot)}catch{Ot=f.parse(E.baseFontSize+"px "+Ot)}else{var ie=Ot.style,be=Ot.weight,ce=Ot.stretch,Le=Ot.variant;Ot=f.parse(f.stringify(Ot)),ie&&(Ot.style=ie),be&&(Ot.weight=be),ce&&(Ot.stretch=ce),Le&&(Ot.variant=Le)}var Ze=f.stringify({size:E.baseFontSize,family:Ot.family,stretch:w?Ot.stretch:void 0,variant:Ot.variant,weight:Ot.weight,style:Ot.style}),Qe=s(Ot.size),mr=Math.round(Qe[0]*h(Qe[1]));if(mr!==p.fontSize[Lt]&&(C=!0,p.fontSize[Lt]=mr),(!p.font[Lt]||Ze!=p.font[Lt].baseString)&&(g=!0,p.font[Lt]=E.fonts[Ze],!p.font[Lt])){var fr=Ot.family.join(", "),Jr=[Ot.style];Ot.style!=Ot.variant&&Jr.push(Ot.variant),Ot.variant!=Ot.weight&&Jr.push(Ot.weight),w&&Ot.weight!=Ot.stretch&&Jr.push(Ot.stretch),p.font[Lt]={baseString:Ze,family:fr,weight:Ot.weight,stretch:Ot.stretch,style:Ot.style,variant:Ot.variant,width:{},kerning:{},metrics:x(fr,{origin:"top",fontSize:E.baseFontSize,fontStyle:Jr.join(" ")})},E.fonts[Ze]=p.font[Lt]}}),(g||C)&&this.font.forEach(function(Ot,Lt){var ie=f.stringify({size:p.fontSize[Lt],family:Ot.family,stretch:w?Ot.stretch:void 0,variant:Ot.variant,weight:Ot.weight,style:Ot.style});if(p.fontAtlas[Lt]=p.shader.atlas[ie],!p.fontAtlas[Lt]){var be=Ot.metrics;p.shader.atlas[ie]=p.fontAtlas[Lt]={fontString:ie,step:Math.ceil(p.fontSize[Lt]*be.bottom*.5)*2,em:p.fontSize[Lt],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:p.regl.texture()}}M.text==null&&(M.text=p.text)}),typeof M.text=="string"&&M.position&&M.position.length>2){for(var S=Array(M.position.length*.5),N=0;N2){for(var V=!M.position[0].length,W=l.mallocFloat(this.count*2),F=0,H=0;F1?p.align[Lt]:p.align[0]:p.align;if(typeof ie=="number")return ie;switch(ie){case"right":case"end":return-Ot;case"center":case"centre":case"middle":return-Ot*.5}return 0})),this.baseline==null&&M.baseline==null&&(M.baseline=0),M.baseline!=null&&(this.baseline=M.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(Ot,Lt){var ie=(p.font[Lt]||p.font[0]).metrics,be=0;return be+=ie.bottom*.5,typeof Ot=="number"?be+=Ot-ie.baseline:be+=-ie[Ot],be*=-1,be})),M.color!=null)if(M.color||(M.color="transparent"),typeof M.color=="string"||!isNaN(M.color))this.color=i(M.color,"uint8");else{var Bt;if(typeof M.color[0]=="number"&&M.color.length>this.counts.length){var Zt=M.color.length;Bt=l.mallocUint8(Zt);for(var Gt=(M.color.subarray||M.color.slice).bind(M.color),ee=0;ee4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ye){var ue=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(ue);for(var Mt=0;Mt1?this.counts[Mt]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Mt]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Mt*4,Mt*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Mt]:this.opacity,baseline:this.baselineOffset[Mt]!=null?this.baselineOffset[Mt]:this.baselineOffset[0],align:this.align?this.alignOffset[Mt]!=null?this.alignOffset[Mt]:this.alignOffset[0]:0,atlas:this.fontAtlas[Mt]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Mt*2,Mt*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},E.prototype.destroy=function(){},E.prototype.kerning=!0,E.prototype.position={constant:new Float32Array(2)},E.prototype.translate=null,E.prototype.scale=null,E.prototype.font=null,E.prototype.text="",E.prototype.positionOffset=[0,0],E.prototype.opacity=1,E.prototype.color=new Uint8Array([0,0,0,255]),E.prototype.alignOffset=[0,0],E.maxAtlasSize=1024,E.atlasCanvas=document.createElement("canvas"),E.atlasContext=E.atlasCanvas.getContext("2d",{alpha:!1}),E.baseFontSize=64,E.fonts={};function I(M){return typeof M=="function"&&M._gl&&M.prop&&M.texture&&M.buffer}Y.exports=E}),mQ=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():f.createREGL=y()})(et,function(){var f=function(Se,Ir){for(var Vr=Object.keys(Ir),ri=0;ri1&&Ir===Vr&&(Ir==='"'||Ir==="'"))return['"'+a(Se.substr(1,Se.length-2))+'"'];var ri=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Se);if(ri)return l(Se.substr(0,ri.index)).concat(l(ri[1])).concat(l(Se.substr(ri.index+ri[0].length)));var Ai=Se.split(".");if(Ai.length===1)return['"'+a(Se)+'"'];for(var bi=[],On=0;On"u"?1:window.devicePixelRatio,Ia=!1,co={},to=function(En){},ma=function(){};if(typeof Ir=="string"?Vr=document.querySelector(Ir):typeof Ir=="object"&&(k(Ir)?Vr=Ir:w(Ir)?(bi=Ir,Ai=bi.canvas):("gl"in Ir?bi=Ir.gl:"canvas"in Ir?Ai=E(Ir.canvas):"container"in Ir&&(ri=E(Ir.container)),"attributes"in Ir&&(On=Ir.attributes),"extensions"in Ir&&(Si=D(Ir.extensions)),"optionalExtensions"in Ir&&(ha=D(Ir.optionalExtensions)),"onDone"in Ir&&(to=Ir.onDone),"profile"in Ir&&(Ia=!!Ir.profile),"pixelRatio"in Ir&&(ia=+Ir.pixelRatio),"cachedCode"in Ir&&(co=Ir.cachedCode))),Vr&&(Vr.nodeName.toLowerCase()==="canvas"?Ai=Vr:ri=Vr),!bi){if(!Ai){var ji=A(ri||document.body,to,ia);if(!ji)return null;Ai=ji.canvas,ma=ji.onDestroy}On.premultipliedAlpha===void 0&&(On.premultipliedAlpha=!0),bi=d(Ai,On)}return bi?{gl:bi,canvas:Ai,container:ri,extensions:Si,optionalExtensions:ha,pixelRatio:ia,profile:Ia,cachedCode:co,onDone:to,onDestroy:ma}:(ma(),to("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(Se,Ir){var Vr={};function ri(On){var Si=On.toLowerCase(),ha;try{ha=Vr[Si]=Se.getExtension(Si)}catch{}return!!ha}for(var Ai=0;Ai65535)<<4,Se>>>=Ir,Vr=(Se>255)<<3,Se>>>=Vr,Ir|=Vr,Vr=(Se>15)<<2,Se>>>=Vr,Ir|=Vr,Vr=(Se>3)<<1,Se>>>=Vr,Ir|=Vr,Ir|Se>>1}function H(){var Se=p(8,function(){return[]});function Ir(bi){var On=W(bi),Si=Se[F(On)>>2];return Si.length>0?Si.pop():new ArrayBuffer(On)}function Vr(bi){Se[F(bi.byteLength)>>2].push(bi)}function ri(bi,On){var Si=null;switch(bi){case g:Si=new Int8Array(Ir(On),0,On);break;case C:Si=new Uint8Array(Ir(On),0,On);break;case S:Si=new Int16Array(Ir(2*On),0,On);break;case N:Si=new Uint16Array(Ir(2*On),0,On);break;case B:Si=new Int32Array(Ir(4*On),0,On);break;case U:Si=new Uint32Array(Ir(4*On),0,On);break;case V:Si=new Float32Array(Ir(4*On),0,On);break;default:return null}return Si.length!==On?Si.subarray(0,On):Si}function Ai(bi){Vr(bi.buffer)}return{alloc:Ir,free:Vr,allocType:ri,freeType:Ai}}var q=H();q.zero=H();var G=3408,tt=3410,ht=3411,bt=3412,vt=3413,ut=3414,rt=3415,gt=33901,it=33902,st=3379,xt=3386,ot=34921,J=36347,mt=36348,dt=35661,Ct=35660,Rt=34930,Bt=36349,Zt=34076,Gt=34024,ee=7936,xe=7937,ge=7938,ye=35724,ue=34047,Mt=36063,Ot=34852,Lt=3553,ie=34067,be=34069,ce=33984,Le=6408,Ze=5126,Qe=5121,mr=36160,fr=36053,Jr=36064,an=16384,Er=function(Se,Ir){var Vr=1;Ir.ext_texture_filter_anisotropic&&(Vr=Se.getParameter(ue));var ri=1,Ai=1;Ir.webgl_draw_buffers&&(ri=Se.getParameter(Ot),Ai=Se.getParameter(Mt));var bi=!!Ir.oes_texture_float;if(bi){var On=Se.createTexture();Se.bindTexture(Lt,On),Se.texImage2D(Lt,0,Le,1,1,0,Le,Ze,null);var Si=Se.createFramebuffer();if(Se.bindFramebuffer(mr,Si),Se.framebufferTexture2D(mr,Jr,Lt,On,0),Se.bindTexture(Lt,null),Se.checkFramebufferStatus(mr)!==fr)bi=!1;else{Se.viewport(0,0,1,1),Se.clearColor(1,0,0,1),Se.clear(an);var ha=q.allocType(Ze,4);Se.readPixels(0,0,1,1,Le,Ze,ha),Se.getError()?bi=!1:(Se.deleteFramebuffer(Si),Se.deleteTexture(On),bi=ha[0]===1),q.freeType(ha)}}var ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ia=!0;if(!ia){var co=Se.createTexture(),to=q.allocType(Qe,36);Se.activeTexture(ce),Se.bindTexture(ie,co),Se.texImage2D(be,0,Le,3,3,0,Le,Qe,to),q.freeType(to),Se.bindTexture(ie,null),Se.deleteTexture(co),Ia=!Se.getError()}return{colorBits:[Se.getParameter(tt),Se.getParameter(ht),Se.getParameter(bt),Se.getParameter(vt)],depthBits:Se.getParameter(ut),stencilBits:Se.getParameter(rt),subpixelBits:Se.getParameter(G),extensions:Object.keys(Ir).filter(function(ma){return!!Ir[ma]}),maxAnisotropic:Vr,maxDrawbuffers:ri,maxColorAttachments:Ai,pointSizeDims:Se.getParameter(gt),lineWidthDims:Se.getParameter(it),maxViewportDims:Se.getParameter(xt),maxCombinedTextureUnits:Se.getParameter(dt),maxCubeMapSize:Se.getParameter(Zt),maxRenderbufferSize:Se.getParameter(Gt),maxTextureUnits:Se.getParameter(Rt),maxTextureSize:Se.getParameter(st),maxAttributes:Se.getParameter(ot),maxVertexUniforms:Se.getParameter(J),maxVertexTextureUnits:Se.getParameter(Ct),maxVaryingVectors:Se.getParameter(mt),maxFragmentUniforms:Se.getParameter(Bt),glsl:Se.getParameter(ye),renderer:Se.getParameter(xe),vendor:Se.getParameter(ee),version:Se.getParameter(ge),readFloat:bi,npotTextureCube:Ia}},dn=function(Se){return Se instanceof Uint8Array||Se instanceof Uint16Array||Se instanceof Uint32Array||Se instanceof Int8Array||Se instanceof Int16Array||Se instanceof Int32Array||Se instanceof Float32Array||Se instanceof Float64Array||Se instanceof Uint8ClampedArray};function _n(Se){return!!Se&&typeof Se=="object"&&Array.isArray(Se.shape)&&Array.isArray(Se.stride)&&typeof Se.offset=="number"&&Se.shape.length===Se.stride.length&&(Array.isArray(Se.data)||dn(Se.data))}var Oe=function(Se){return Object.keys(Se).map(function(Ir){return Se[Ir]})},Xt={shape:ae,flatten:Ht};function oe(Se,Ir,Vr){for(var ri=0;ri0){var no;if(Array.isArray(oi[0])){Ca=fi(oi);for(var Ri=1,ki=1;ki0){if(typeof Ri[0]=="number"){var la=q.allocType(wi.dtype,Ri.length);mn(la,Ri),Ca(la,$a),q.freeType(la)}else if(Array.isArray(Ri[0])||dn(Ri[0])){Ea=fi(Ri);var ua=Ci(Ri,Ea,wi.dtype);Ca(ua,$a),q.freeType(ua)}}}else if(_n(Ri)){Ea=Ri.shape;var Oa=Ri.stride,Vo=0,Bo=0,za=0,Ya=0;Ea.length===1?(Vo=Ea[0],Bo=1,za=Oa[0],Ya=0):Ea.length===2&&(Vo=Ea[0],Bo=Ea[1],za=Oa[0],Ya=Oa[1]);var Eo=Array.isArray(Ri.data)?wi.dtype:Ar(Ri.data),No=q.allocType(Eo,Vo*Bo);Zn(No,Ri.data,Vo,Bo,za,Ya,Ri.offset),Ca(No,$a),q.freeType(No)}return Ua}return Yi||Ua(En),Ua._reglType="buffer",Ua._buffer=wi,Ua.subdata=no,Vr.profile&&(Ua.stats=wi.stats),Ua.destroy=function(){to(wi)},Ua}function ji(){Oe(bi).forEach(function(En){En.buffer=Se.createBuffer(),Se.bindBuffer(En.type,En.buffer),Se.bufferData(En.type,En.persistentData||En.byteLength,En.usage)})}return Vr.profile&&(Ir.getTotalBufferSize=function(){var En=0;return Object.keys(bi).forEach(function(oi){En+=bi[oi].stats.size}),En}),{create:ma,createStream:ha,destroyStream:ia,clear:function(){Oe(bi).forEach(to),Si.forEach(to)},getBuffer:function(En){return En&&En._buffer instanceof On?En._buffer:null},restore:ji,_initBuffer:co}}var Wn=0,Li=0,Fi=1,Zi=1,Ji=4,ca=4,Ei={points:Wn,point:Li,lines:Fi,line:Zi,triangles:Ji,triangle:ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ga=0,so=1,Fe=4,Re=5120,Kr=5121,sn=5122,cn=5123,Yr=5124,un=5125,Pn=34963,bn=35040,ze=35044;function yr(Se,Ir,Vr,ri){var Ai={},bi=0,On={uint8:Kr,uint16:cn};Ir.oes_element_index_uint&&(On.uint32=un);function Si(ji){this.id=bi++,Ai[this.id]=this,this.buffer=ji,this.primType=Fe,this.vertCount=0,this.type=0}Si.prototype.bind=function(){this.buffer.bind()};var ha=[];function ia(ji){var En=ha.pop();return En||(En=new Si(Vr.create(null,Pn,!0,!1)._buffer)),co(En,ji,bn,-1,-1,0,0),En}function Ia(ji){ha.push(ji)}function co(ji,En,oi,Yi,Ni,wi,Ua){ji.buffer.bind();var Ca;if(En){var no=Ua;!Ua&&(!dn(En)||_n(En)&&!dn(En.data))&&(no=Ir.oes_element_index_uint?un:cn),Vr._initBuffer(ji.buffer,En,oi,no,3)}else Se.bufferData(Pn,wi,oi),ji.buffer.dtype=Ca||Kr,ji.buffer.usage=oi,ji.buffer.dimension=3,ji.buffer.byteLength=wi;if(Ca=Ua,!Ua){switch(ji.buffer.dtype){case Kr:case Re:Ca=Kr;break;case cn:case sn:Ca=cn;break;case un:case Yr:Ca=un;break}ji.buffer.dtype=Ca}ji.type=Ca;var Ri=Ni;Ri<0&&(Ri=ji.buffer.byteLength,Ca===cn?Ri>>=1:Ca===un&&(Ri>>=2)),ji.vertCount=Ri;var ki=Yi;if(Yi<0){ki=Fe;var $a=ji.buffer.dimension;$a===1&&(ki=Ga),$a===2&&(ki=so),$a===3&&(ki=Fe)}ji.primType=ki}function to(ji){ri.elementsCount--,delete Ai[ji.id],ji.buffer.destroy(),ji.buffer=null}function ma(ji,En){var oi=Vr.create(null,Pn,!0),Yi=new Si(oi._buffer);ri.elementsCount++;function Ni(wi){if(!wi)oi(),Yi.primType=Fe,Yi.vertCount=0,Yi.type=Kr;else if(typeof wi=="number")oi(wi),Yi.primType=Fe,Yi.vertCount=wi|0,Yi.type=Kr;else{var Ua=null,Ca=ze,no=-1,Ri=-1,ki=0,$a=0;Array.isArray(wi)||dn(wi)||_n(wi)?Ua=wi:("data"in wi&&(Ua=wi.data),"usage"in wi&&(Ca=Gi[wi.usage]),"primitive"in wi&&(no=Ei[wi.primitive]),"count"in wi&&(Ri=wi.count|0),"type"in wi&&($a=On[wi.type]),"length"in wi?ki=wi.length|0:(ki=Ri,$a===cn||$a===sn?ki*=2:($a===un||$a===Yr)&&(ki*=4))),co(Yi,Ua,Ca,no,Ri,ki,$a)}return Ni}return Ni(ji),Ni._reglType="elements",Ni._elements=Yi,Ni.subdata=function(wi,Ua){return oi.subdata(wi,Ua),Ni},Ni.destroy=function(){to(Yi)},Ni}return{create:ma,createStream:ia,destroyStream:Ia,getElements:function(ji){return typeof ji=="function"&&ji._elements instanceof Si?ji._elements:null},clear:function(){Oe(Ai).forEach(to)}}}var en=new Float32Array(1),Rn=new Uint32Array(en.buffer),ni=5123;function xi(Se){for(var Ir=q.allocType(ni,Se.length),Vr=0;Vr>>31<<15,bi=(ri<<1>>>24)-127,On=ri>>13&1023;if(bi<-24)Ir[Vr]=Ai;else if(bi<-14){var Si=-14-bi;Ir[Vr]=Ai+(On+1024>>Si)}else bi>15?Ir[Vr]=Ai+31744:Ir[Vr]=Ai+(bi+15<<10)+On}return Ir}function Jn(Se){return Array.isArray(Se)||dn(Se)}var Gn=34467,pi=3553,Va=34067,ea=34069,go=6408,mo=6406,Go=6407,Lo=6409,Zo=6410,Ka=32854,Cs=32855,ps=36194,wl=32819,is=32820,ol=33635,ms=34042,kl=6402,ul=34041,Kl=35904,vs=35906,Ns=36193,Uo=33776,Ds=33777,Ol=33778,tc=33779,sc=35986,Xs=35987,Wa=34798,Co=35840,el=35841,lc=35842,ss=35843,nc=36196,yl=5121,$l=5123,Gc=5125,ko=5126,zs=10242,js=10243,mc=10497,Tl=33071,us=33648,Rc=10240,iu=10241,Dl=9728,ql=9729,cc=9984,dc=9985,pu=9986,Ah=9987,uh=33170,yh=4352,tf=4353,Nd=4354,Gl=34046,Yu=3317,ef=37440,xu=37441,mu=37443,bu=37444,_h=33984,_c=[cc,pu,dc,Ah],gu=[0,Lo,Zo,Go,go],pl={};pl[Lo]=pl[mo]=pl[kl]=1,pl[ul]=pl[Zo]=2,pl[Go]=pl[Kl]=3,pl[go]=pl[vs]=4;function ic(Se){return"[object "+Se+"]"}var jh=ic("HTMLCanvasElement"),Hu=ic("OffscreenCanvas"),Qh=ic("CanvasRenderingContext2D"),Lc=ic("ImageBitmap"),Xf=ic("HTMLImageElement"),hl=ic("HTMLVideoElement"),pp=Object.keys(he).concat([jh,Hu,Qh,Lc,Xf,hl]),Hl=[];Hl[yl]=1,Hl[ko]=4,Hl[Ns]=2,Hl[$l]=2,Hl[Gc]=4;var cs=[];cs[Ka]=2,cs[Cs]=2,cs[ps]=2,cs[ul]=4,cs[Uo]=.5,cs[Ds]=.5,cs[Ol]=1,cs[tc]=1,cs[sc]=.5,cs[Xs]=1,cs[Wa]=1,cs[Co]=.5,cs[el]=.25,cs[lc]=.5,cs[ss]=.25,cs[nc]=.5;function _d(Se){return Array.isArray(Se)&&(Se.length===0||typeof Se[0]=="number")}function xh(Se){if(!Array.isArray(Se))return!1;var Ir=Se.length;return!(Ir===0||!Jn(Se[0]))}function hu(Se){return Object.prototype.toString.call(Se)}function rf(Se){return hu(Se)===jh}function td(Se){return hu(Se)===Hu}function Ed(Se){return hu(Se)===Qh}function vu(Se){return hu(Se)===Lc}function Lf(Se){return hu(Se)===Xf}function hf(Se){return hu(Se)===hl}function Ld(Se){if(!Se)return!1;var Ir=hu(Se);return pp.indexOf(Ir)>=0?!0:_d(Se)||xh(Se)||_n(Se)}function ed(Se){return he[Object.prototype.toString.call(Se)]|0}function nf(Se,Ir){var Vr=Ir.length;switch(Se.type){case yl:case $l:case Gc:case ko:var ri=q.allocType(Se.type,Vr);ri.set(Ir),Se.data=ri;break;case Ns:Se.data=xi(Ir);break}}function af(Se,Ir){return q.allocType(Se.type===Ns?ko:Se.type,Ir)}function bh(Se,Ir){Se.type===Ns?(Se.data=xi(Ir),q.freeType(Ir)):Se.data=Ir}function df(Se,Ir,Vr,ri,Ai,bi){for(var On=Se.width,Si=Se.height,ha=Se.channels,ia=On*Si*ha,Ia=af(Se,ia),co=0,to=0;to=1;)Si+=On*ha*ha,ha/=2;return Si}else return On*Vr*ri}function Mh(Se,Ir,Vr,ri,Ai,bi,On){var Si={"don't care":yh,"dont care":yh,nice:Nd,fast:tf},ha={repeat:mc,clamp:Tl,mirror:us},ia={nearest:Dl,linear:ql},Ia=f({mipmap:Ah,"nearest mipmap nearest":cc,"linear mipmap nearest":dc,"nearest mipmap linear":pu,"linear mipmap linear":Ah},ia),co={none:0,browser:bu},to={uint8:yl,rgba4:wl,rgb565:ol,"rgb5 a1":is},ma={alpha:mo,luminance:Lo,"luminance alpha":Zo,rgb:Go,rgba:go,rgba4:Ka,"rgb5 a1":Cs,rgb565:ps},ji={};Ir.ext_srgb&&(ma.srgb=Kl,ma.srgba=vs),Ir.oes_texture_float&&(to.float32=to.float=ko),Ir.oes_texture_half_float&&(to.float16=to["half float"]=Ns),Ir.webgl_depth_texture&&(f(ma,{depth:kl,"depth stencil":ul}),f(to,{uint16:$l,uint32:Gc,"depth stencil":ms})),Ir.webgl_compressed_texture_s3tc&&f(ji,{"rgb s3tc dxt1":Uo,"rgba s3tc dxt1":Ds,"rgba s3tc dxt3":Ol,"rgba s3tc dxt5":tc}),Ir.webgl_compressed_texture_atc&&f(ji,{"rgb atc":sc,"rgba atc explicit alpha":Xs,"rgba atc interpolated alpha":Wa}),Ir.webgl_compressed_texture_pvrtc&&f(ji,{"rgb pvrtc 4bppv1":Co,"rgb pvrtc 2bppv1":el,"rgba pvrtc 4bppv1":lc,"rgba pvrtc 2bppv1":ss}),Ir.webgl_compressed_texture_etc1&&(ji["rgb etc1"]=nc);var En=Array.prototype.slice.call(Se.getParameter(Gn));Object.keys(ji).forEach(function(Z){var lt=ji[Z];En.indexOf(lt)>=0&&(ma[Z]=lt)});var oi=Object.keys(ma);Vr.textureFormats=oi;var Yi=[];Object.keys(ma).forEach(function(Z){var lt=ma[Z];Yi[lt]=Z});var Ni=[];Object.keys(to).forEach(function(Z){var lt=to[Z];Ni[lt]=Z});var wi=[];Object.keys(ia).forEach(function(Z){var lt=ia[Z];wi[lt]=Z});var Ua=[];Object.keys(Ia).forEach(function(Z){var lt=Ia[Z];Ua[lt]=Z});var Ca=[];Object.keys(ha).forEach(function(Z){var lt=ha[Z];Ca[lt]=Z});var no=oi.reduce(function(Z,lt){var nt=ma[lt];return nt===Lo||nt===mo||nt===Lo||nt===Zo||nt===kl||nt===ul||Ir.ext_srgb&&(nt===Kl||nt===vs)?Z[nt]=nt:nt===Cs||lt.indexOf("rgba")>=0?Z[nt]=go:Z[nt]=Go,Z},{});function Ri(){this.internalformat=go,this.format=go,this.type=yl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bu,this.width=0,this.height=0,this.channels=0}function ki(Z,lt){Z.internalformat=lt.internalformat,Z.format=lt.format,Z.type=lt.type,Z.compressed=lt.compressed,Z.premultiplyAlpha=lt.premultiplyAlpha,Z.flipY=lt.flipY,Z.unpackAlignment=lt.unpackAlignment,Z.colorSpace=lt.colorSpace,Z.width=lt.width,Z.height=lt.height,Z.channels=lt.channels}function $a(Z,lt){if(!(typeof lt!="object"||!lt)){if("premultiplyAlpha"in lt&&(Z.premultiplyAlpha=lt.premultiplyAlpha),"flipY"in lt&&(Z.flipY=lt.flipY),"alignment"in lt&&(Z.unpackAlignment=lt.alignment),"colorSpace"in lt&&(Z.colorSpace=co[lt.colorSpace]),"type"in lt){var nt=lt.type;Z.type=to[nt]}var wt=Z.width,Wt=Z.height,ve=Z.channels,ke=!1;"shape"in lt?(wt=lt.shape[0],Wt=lt.shape[1],lt.shape.length===3&&(ve=lt.shape[2],ke=!0)):("radius"in lt&&(wt=Wt=lt.radius),"width"in lt&&(wt=lt.width),"height"in lt&&(Wt=lt.height),"channels"in lt&&(ve=lt.channels,ke=!0)),Z.width=wt|0,Z.height=Wt|0,Z.channels=ve|0;var Jt=!1;if("format"in lt){var fe=lt.format,De=Z.internalformat=ma[fe];Z.format=no[De],fe in to&&("type"in lt||(Z.type=to[fe])),fe in ji&&(Z.compressed=!0),Jt=!0}!ke&&Jt?Z.channels=pl[Z.format]:ke&&!Jt&&Z.channels!==gu[Z.format]&&(Z.format=Z.internalformat=gu[Z.channels])}}function Ea(Z){Se.pixelStorei(ef,Z.flipY),Se.pixelStorei(xu,Z.premultiplyAlpha),Se.pixelStorei(mu,Z.colorSpace),Se.pixelStorei(Yu,Z.unpackAlignment)}function la(){Ri.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ua(Z,lt){var nt=null;if(Ld(lt)?nt=lt:lt&&($a(Z,lt),"x"in lt&&(Z.xOffset=lt.x|0),"y"in lt&&(Z.yOffset=lt.y|0),Ld(lt.data)&&(nt=lt.data)),lt.copy){var wt=Ai.viewportWidth,Wt=Ai.viewportHeight;Z.width=Z.width||wt-Z.xOffset,Z.height=Z.height||Wt-Z.yOffset,Z.needsCopy=!0}else if(!nt)Z.width=Z.width||1,Z.height=Z.height||1,Z.channels=Z.channels||4;else if(dn(nt))Z.channels=Z.channels||4,Z.data=nt,!("type"in lt)&&Z.type===yl&&(Z.type=ed(nt));else if(_d(nt))Z.channels=Z.channels||4,nf(Z,nt),Z.alignment=1,Z.needsFree=!0;else if(_n(nt)){var ve=nt.data;!Array.isArray(ve)&&Z.type===yl&&(Z.type=ed(ve));var ke=nt.shape,Jt=nt.stride,fe,De,lr,tr,ar,dr;ke.length===3?(lr=ke[2],dr=Jt[2]):(lr=1,dr=1),fe=ke[0],De=ke[1],tr=Jt[0],ar=Jt[1],Z.alignment=1,Z.width=fe,Z.height=De,Z.channels=lr,Z.format=Z.internalformat=gu[lr],Z.needsFree=!0,df(Z,ve,tr,ar,dr,nt.offset)}else if(rf(nt)||td(nt)||Ed(nt))rf(nt)||td(nt)?Z.element=nt:Z.element=nt.canvas,Z.width=Z.element.width,Z.height=Z.element.height,Z.channels=4;else if(vu(nt))Z.element=nt,Z.width=nt.width,Z.height=nt.height,Z.channels=4;else if(Lf(nt))Z.element=nt,Z.width=nt.naturalWidth,Z.height=nt.naturalHeight,Z.channels=4;else if(hf(nt))Z.element=nt,Z.width=nt.videoWidth,Z.height=nt.videoHeight,Z.channels=4;else if(xh(nt)){var gr=Z.width||nt[0].length,Ge=Z.height||nt.length,rr=Z.channels;Jn(nt[0][0])?rr=rr||nt[0][0].length:rr=rr||1;for(var Je=Xt.shape(nt),Hr=1,wn=0;wn>=Wt,nt.height>>=Wt,ua(nt,wt[Wt]),Z.mipmask|=1<=0&&!("faces"in lt)&&(Z.genMipmaps=!0)}if("mag"in lt){var wt=lt.mag;Z.magFilter=ia[wt]}var Wt=Z.wrapS,ve=Z.wrapT;if("wrap"in lt){var ke=lt.wrap;typeof ke=="string"?Wt=ve=ha[ke]:Array.isArray(ke)&&(Wt=ha[ke[0]],ve=ha[ke[1]])}else{if("wrapS"in lt){var Jt=lt.wrapS;Wt=ha[Jt]}if("wrapT"in lt){var fe=lt.wrapT;ve=ha[fe]}}if(Z.wrapS=Wt,Z.wrapT=ve,"anisotropic"in lt&&(lt.anisotropic,Z.anisotropic=lt.anisotropic),"mipmap"in lt){var De=!1;switch(typeof lt.mipmap){case"string":Z.mipmapHint=Si[lt.mipmap],Z.genMipmaps=!0,De=!0;break;case"boolean":De=Z.genMipmaps=lt.mipmap;break;case"object":Z.genMipmaps=!1,De=!0;break}De&&!("min"in lt)&&(Z.minFilter=cc)}}function ku(Z,lt){Se.texParameteri(lt,iu,Z.minFilter),Se.texParameteri(lt,Rc,Z.magFilter),Se.texParameteri(lt,zs,Z.wrapS),Se.texParameteri(lt,js,Z.wrapT),Ir.ext_texture_filter_anisotropic&&Se.texParameteri(lt,Gl,Z.anisotropic),Z.genMipmaps&&(Se.hint(uh,Z.mipmapHint),Se.generateMipmap(lt))}var Eu=0,Ec={},kc=Vr.maxTextureUnits,zc=Array(kc).map(function(){return null});function Xo(Z){Ri.call(this),this.mipmask=0,this.internalformat=go,this.id=Eu++,this.refCount=1,this.target=Z,this.texture=Se.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Cl,On.profile&&(this.stats={size:0})}function Oc(Z){Se.activeTexture(_h),Se.bindTexture(Z.target,Z.texture)}function xl(){var Z=zc[0];Z?Se.bindTexture(Z.target,Z.texture):Se.bindTexture(pi,null)}function jc(Z){var lt=Z.texture,nt=Z.unit,wt=Z.target;nt>=0&&(Se.activeTexture(_h+nt),Se.bindTexture(wt,null),zc[nt]=null),Se.deleteTexture(lt),Z.texture=null,Z.params=null,Z.pixels=null,Z.refCount=0,delete Ec[Z.id],bi.textureCount--}f(Xo.prototype,{bind:function(){var Z=this;Z.bindCount+=1;var lt=Z.unit;if(lt<0){for(var nt=0;nt0)continue;wt.unit=-1}zc[nt]=Z,lt=nt;break}On.profile&&bi.maxTextureUnits>ar)-lr,dr.height=dr.height||(nt.height>>ar)-tr,Oc(nt),Vo(dr,pi,lr,tr,ar),xl(),Ya(dr),wt}function ve(ke,Jt){var fe=ke|0,De=Jt|0||fe;if(fe===nt.width&&De===nt.height)return wt;wt.width=nt.width=fe,wt.height=nt.height=De,Oc(nt);for(var lr=0;nt.mipmask>>lr;++lr){var tr=fe>>lr,ar=De>>lr;if(!tr||!ar)break;Se.texImage2D(pi,lr,nt.format,tr,ar,0,nt.format,nt.type,null)}return xl(),On.profile&&(nt.stats.size=Uh(nt.internalformat,nt.type,fe,De,!1,!1)),wt}return wt(Z,lt),wt.subimage=Wt,wt.resize=ve,wt._reglType="texture2d",wt._texture=nt,On.profile&&(wt.stats=nt.stats),wt.destroy=function(){nt.decRef()},wt}function jo(Z,lt,nt,wt,Wt,ve){var ke=new Xo(Va);Ec[ke.id]=ke,bi.cubeCount++;var Jt=new Array(6);function fe(tr,ar,dr,gr,Ge,rr){var Je,Hr=ke.texInfo;for(Cl.call(Hr),Je=0;Je<6;++Je)Jt[Je]=ys();if(typeof tr=="number"||!tr){var wn=tr|0||1;for(Je=0;Je<6;++Je)No(Jt[Je],wn,wn)}else if(typeof tr=="object")if(ar)hs(Jt[0],tr),hs(Jt[1],ar),hs(Jt[2],dr),hs(Jt[3],gr),hs(Jt[4],Ge),hs(Jt[5],rr);else if(Nc(Hr,tr),$a(ke,tr),"faces"in tr){var Ln=tr.faces;for(Je=0;Je<6;++Je)ki(Jt[Je],ke),hs(Jt[Je],Ln[Je])}else for(Je=0;Je<6;++Je)hs(Jt[Je],tr);for(ki(ke,Jt[0]),Hr.genMipmaps?ke.mipmask=(Jt[0].width<<1)-1:ke.mipmask=Jt[0].mipmask,ke.internalformat=Jt[0].internalformat,fe.width=Jt[0].width,fe.height=Jt[0].height,Oc(ke),Je=0;Je<6;++Je)Xl(Jt[Je],ea+Je);for(ku(Hr,Va),xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,Hr.genMipmaps,!0)),fe.format=Yi[ke.internalformat],fe.type=Ni[ke.type],fe.mag=wi[Hr.magFilter],fe.min=Ua[Hr.minFilter],fe.wrapS=Ca[Hr.wrapS],fe.wrapT=Ca[Hr.wrapT],Je=0;Je<6;++Je)Dc(Jt[Je]);return fe}function De(tr,ar,dr,gr,Ge){var rr=dr|0,Je=gr|0,Hr=Ge|0,wn=za();return ki(wn,ke),wn.width=0,wn.height=0,ua(wn,ar),wn.width=wn.width||(ke.width>>Hr)-rr,wn.height=wn.height||(ke.height>>Hr)-Je,Oc(ke),Vo(wn,ea+tr,rr,Je,Hr),xl(),Ya(wn),fe}function lr(tr){var ar=tr|0;if(ar!==ke.width){fe.width=ke.width=ar,fe.height=ke.height=ar,Oc(ke);for(var dr=0;dr<6;++dr)for(var gr=0;ke.mipmask>>gr;++gr)Se.texImage2D(ea+dr,gr,ke.format,ar>>gr,ar>>gr,0,ke.format,ke.type,null);return xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,!1,!0)),fe}}return fe(Z,lt,nt,wt,Wt,ve),fe.subimage=De,fe.resize=lr,fe._reglType="textureCube",fe._texture=ke,On.profile&&(fe.stats=ke.stats),fe.destroy=function(){ke.decRef()},fe}function Rs(){for(var Z=0;Z>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);else for(var Wt=0;Wt<6;++Wt)Se.texImage2D(ea+Wt,wt,nt.internalformat,nt.width>>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);ku(nt.texInfo,nt.target)})}function Pl(){for(var Z=0;Z=0?Dc=!0:ha.indexOf(Cl)>=0&&(Dc=!1))),("depthTexture"in Xo||"depthStencilTexture"in Xo)&&(zc=!!(Xo.depthTexture||Xo.depthStencilTexture)),"depth"in Xo&&(typeof Xo.depth=="boolean"?Xl=Xo.depth:(Eu=Xo.depth,Rl=!1)),"stencil"in Xo&&(typeof Xo.stencil=="boolean"?Rl=Xo.stencil:(Ec=Xo.stencil,Xl=!1)),"depthStencil"in Xo&&(typeof Xo.depthStencil=="boolean"?Xl=Rl=Xo.depthStencil:(kc=Xo.depthStencil,Xl=!1,Rl=!1))}var xl=null,jc=null,Lu=null,jo=null;if(Array.isArray(ys))xl=ys.map(ji);else if(ys)xl=[ji(ys)];else for(xl=new Array(ku),Eo=0;Eo0&&(Ya.depth=ua[0].depth,Ya.stencil=ua[0].stencil,Ya.depthStencil=ua[0].depthStencil),ua[za]?ua[za](Ya):ua[za]=ki(Ya)}return f(Oa,{width:Eo,height:Eo,color:Cl})}function Vo(Bo){var za,Ya=Bo|0;if(Ya===Oa.width)return Oa;var Eo=Oa.color;for(za=0;za=Eo.byteLength?No.subdata(Eo):(No.destroy(),ki.buffers[Bo]=null)),ki.buffers[Bo]||(No=ki.buffers[Bo]=Ai.create(za,Hd,!1,!0)),Ya.buffer=Ai.getBuffer(No),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,Oa[Bo]=1}else Ai.getBuffer(za)?(Ya.buffer=Ai.getBuffer(za),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):Ai.getBuffer(za.buffer)?(Ya.buffer=Ai.getBuffer(za.buffer),Ya.size=(+za.size||Ya.buffer.dimension)|0,Ya.normalized=!!za.normalized||!1,"type"in za?Ya.type=ci[za.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(za.offset||0)|0,Ya.stride=(za.stride||0)|0,Ya.divisor=(za.divisor||0)|0,Ya.state=1):"x"in za&&(Ya.x=+za.x||0,Ya.y=+za.y||0,Ya.z=+za.z||0,Ya.w=+za.w||0,Ya.state=2)}for(var hs=0;hs1)for(var Ea=0;EaEn&&(En=oi.stats.uniformsCount)}),En},Vr.getMaxAttributesCount=function(){var En=0;return Ia.forEach(function(oi){oi.stats.attributesCount>En&&(En=oi.stats.attributesCount)}),En});function ji(){Ai={},bi={};for(var En=0;En>>4&15)+Ir.charAt(ri&15);return Vr}function Vh(Se){for(var Ir="",Vr=-1,ri,Ai;++Vr>>6&31,128|ri&63):ri<=65535?Ir+=String.fromCharCode(224|ri>>>12&15,128|ri>>>6&63,128|ri&63):ri<=2097151&&(Ir+=String.fromCharCode(240|ri>>>18&7,128|ri>>>12&63,128|ri>>>6&63,128|ri&63));return Ir}function Ph(Se){for(var Ir=Array(Se.length>>2),Vr=0;Vr>5]|=(Se.charCodeAt(Vr/8)&255)<<24-Vr%32;return Ir}function Zc(Se){for(var Ir="",Vr=0;Vr>5]>>>24-Vr%32&255);return Ir}function fc(Se,Ir){return Se>>>Ir|Se<<32-Ir}function Ih(Se,Ir){return Se>>>Ir}function Td(Se,Ir,Vr){return Se&Ir^~Se&Vr}function Dh(Se,Ir,Vr){return Se&Ir^Se&Vr^Ir&Vr}function sf(Se){return fc(Se,2)^fc(Se,13)^fc(Se,22)}function br(Se){return fc(Se,6)^fc(Se,11)^fc(Se,25)}function Qr(Se){return fc(Se,7)^fc(Se,18)^Ih(Se,3)}function Nn(Se){return fc(Se,17)^fc(Se,19)^Ih(Se,10)}var An=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function di(Se,Ir){var Vr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ri=new Array(64),Ai,bi,On,Si,ha,ia,Ia,co,to,ma,ji,En;for(Se[Ir>>5]|=128<<24-Ir%32,Se[(Ir+64>>9<<4)+15]=Ir,to=0;to>16)+(Ir>>16)+(Vr>>16);return ri<<16|Vr&65535}function ga(Se){return Array.prototype.slice.call(Se)}function Pa(Se){return ga(Se).join("")}function Ja(Se){var Ir=Se&&Se.cache,Vr=0,ri=[],Ai=[],bi=[];function On(ji,En){var oi=En&&En.stable;if(!oi){for(var Yi=0;Yi0&&(ji.push(Ni,"="),ji.push.apply(ji,ga(arguments)),ji.push(";")),Ni}return f(En,{def:Yi,toString:function(){return Pa([oi.length>0?"var "+oi.join(",")+";":"",Pa(ji)])}})}function ha(){var ji=Si(),En=Si(),oi=ji.toString,Yi=En.toString;function Ni(wi,Ua){En(wi,Ua,"=",ji.def(wi,Ua),";")}return f(function(){ji.apply(ji,ga(arguments))},{def:ji.def,entry:ji,exit:En,save:Ni,set:function(wi,Ua,Ca){Ni(wi,Ua),ji(wi,Ua,"=",Ca,";")},toString:function(){return oi()+Yi()}})}function ia(){var ji=Pa(arguments),En=ha(),oi=ha(),Yi=En.toString,Ni=oi.toString;return f(En,{then:function(){return En.apply(En,ga(arguments)),this},else:function(){return oi.apply(oi,ga(arguments)),this},toString:function(){var wi=Ni();return wi&&(wi="else{"+wi+"}"),Pa(["if(",ji,"){",Yi(),"}",wi])}})}var Ia=Si(),co={};function to(ji,En){var oi=[];function Yi(){var no="a"+oi.length;return oi.push(no),no}En=En||0;for(var Ni=0;Ni2){for(var S=Array(M.position.length*.5),N=0;N2){for(var V=!M.position[0].length,W=l.mallocFloat(this.count*2),F=0,H=0;F1?p.align[Lt]:p.align[0]:p.align;if(typeof ie=="number")return ie;switch(ie){case"right":case"end":return-Ot;case"center":case"centre":case"middle":return-Ot*.5}return 0})),this.baseline==null&&M.baseline==null&&(M.baseline=0),M.baseline!=null&&(this.baseline=M.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(Ot,Lt){var ie=(p.font[Lt]||p.font[0]).metrics,be=0;return be+=ie.bottom*.5,typeof Ot=="number"?be+=Ot-ie.baseline:be+=-ie[Ot],be*=-1,be})),M.color!=null)if(M.color||(M.color="transparent"),typeof M.color=="string"||!isNaN(M.color))this.color=i(M.color,"uint8");else{var Bt;if(typeof M.color[0]=="number"&&M.color.length>this.counts.length){var Zt=M.color.length;Bt=l.mallocUint8(Zt);for(var Gt=(M.color.subarray||M.color.slice).bind(M.color),ee=0;ee4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ye){var ue=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(ue);for(var Mt=0;Mt1?this.counts[Mt]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Mt]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Mt*4,Mt*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Mt]:this.opacity,baseline:this.baselineOffset[Mt]!=null?this.baselineOffset[Mt]:this.baselineOffset[0],align:this.align?this.alignOffset[Mt]!=null?this.alignOffset[Mt]:this.alignOffset[0]:0,atlas:this.fontAtlas[Mt]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Mt*2,Mt*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},E.prototype.destroy=function(){},E.prototype.kerning=!0,E.prototype.position={constant:new Float32Array(2)},E.prototype.translate=null,E.prototype.scale=null,E.prototype.font=null,E.prototype.text="",E.prototype.positionOffset=[0,0],E.prototype.opacity=1,E.prototype.color=new Uint8Array([0,0,0,255]),E.prototype.alignOffset=[0,0],E.maxAtlasSize=1024,E.atlasCanvas=document.createElement("canvas"),E.atlasContext=E.atlasCanvas.getContext("2d",{alpha:!1}),E.baseFontSize=64,E.fonts={};function I(M){return typeof M=="function"&&M._gl&&M.prop&&M.texture&&M.buffer}Y.exports=E}),mQ=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():f.createREGL=y()})(et,function(){var f=function(Se,Ir){for(var Vr=Object.keys(Ir),ri=0;ri1&&Ir===Vr&&(Ir==='"'||Ir==="'"))return['"'+a(Se.substr(1,Se.length-2))+'"'];var ri=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(Se);if(ri)return l(Se.substr(0,ri.index)).concat(l(ri[1])).concat(l(Se.substr(ri.index+ri[0].length)));var Ai=Se.split(".");if(Ai.length===1)return['"'+a(Se)+'"'];for(var bi=[],On=0;On"u"?1:window.devicePixelRatio,Ia=!1,co={},eo=function(En){},ma=function(){};if(typeof Ir=="string"?Vr=document.querySelector(Ir):typeof Ir=="object"&&(k(Ir)?Vr=Ir:w(Ir)?(bi=Ir,Ai=bi.canvas):("gl"in Ir?bi=Ir.gl:"canvas"in Ir?Ai=E(Ir.canvas):"container"in Ir&&(ri=E(Ir.container)),"attributes"in Ir&&(On=Ir.attributes),"extensions"in Ir&&(Si=D(Ir.extensions)),"optionalExtensions"in Ir&&(ha=D(Ir.optionalExtensions)),"onDone"in Ir&&(eo=Ir.onDone),"profile"in Ir&&(Ia=!!Ir.profile),"pixelRatio"in Ir&&(aa=+Ir.pixelRatio),"cachedCode"in Ir&&(co=Ir.cachedCode))),Vr&&(Vr.nodeName.toLowerCase()==="canvas"?Ai=Vr:ri=Vr),!bi){if(!Ai){var ji=A(ri||document.body,eo,aa);if(!ji)return null;Ai=ji.canvas,ma=ji.onDestroy}On.premultipliedAlpha===void 0&&(On.premultipliedAlpha=!0),bi=d(Ai,On)}return bi?{gl:bi,canvas:Ai,container:ri,extensions:Si,optionalExtensions:ha,pixelRatio:aa,profile:Ia,cachedCode:co,onDone:eo,onDestroy:ma}:(ma(),eo("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(Se,Ir){var Vr={};function ri(On){var Si=On.toLowerCase(),ha;try{ha=Vr[Si]=Se.getExtension(Si)}catch{}return!!ha}for(var Ai=0;Ai65535)<<4,Se>>>=Ir,Vr=(Se>255)<<3,Se>>>=Vr,Ir|=Vr,Vr=(Se>15)<<2,Se>>>=Vr,Ir|=Vr,Vr=(Se>3)<<1,Se>>>=Vr,Ir|=Vr,Ir|Se>>1}function H(){var Se=p(8,function(){return[]});function Ir(bi){var On=W(bi),Si=Se[F(On)>>2];return Si.length>0?Si.pop():new ArrayBuffer(On)}function Vr(bi){Se[F(bi.byteLength)>>2].push(bi)}function ri(bi,On){var Si=null;switch(bi){case g:Si=new Int8Array(Ir(On),0,On);break;case C:Si=new Uint8Array(Ir(On),0,On);break;case S:Si=new Int16Array(Ir(2*On),0,On);break;case N:Si=new Uint16Array(Ir(2*On),0,On);break;case B:Si=new Int32Array(Ir(4*On),0,On);break;case U:Si=new Uint32Array(Ir(4*On),0,On);break;case V:Si=new Float32Array(Ir(4*On),0,On);break;default:return null}return Si.length!==On?Si.subarray(0,On):Si}function Ai(bi){Vr(bi.buffer)}return{alloc:Ir,free:Vr,allocType:ri,freeType:Ai}}var q=H();q.zero=H();var G=3408,tt=3410,ht=3411,bt=3412,vt=3413,ut=3414,rt=3415,gt=33901,it=33902,st=3379,xt=3386,ot=34921,J=36347,mt=36348,dt=35661,Ct=35660,Rt=34930,Bt=36349,Zt=34076,Gt=34024,ee=7936,xe=7937,ge=7938,ye=35724,ue=34047,Mt=36063,Ot=34852,Lt=3553,ie=34067,be=34069,ce=33984,Le=6408,Ze=5126,Qe=5121,mr=36160,fr=36053,Jr=36064,an=16384,Er=function(Se,Ir){var Vr=1;Ir.ext_texture_filter_anisotropic&&(Vr=Se.getParameter(ue));var ri=1,Ai=1;Ir.webgl_draw_buffers&&(ri=Se.getParameter(Ot),Ai=Se.getParameter(Mt));var bi=!!Ir.oes_texture_float;if(bi){var On=Se.createTexture();Se.bindTexture(Lt,On),Se.texImage2D(Lt,0,Le,1,1,0,Le,Ze,null);var Si=Se.createFramebuffer();if(Se.bindFramebuffer(mr,Si),Se.framebufferTexture2D(mr,Jr,Lt,On,0),Se.bindTexture(Lt,null),Se.checkFramebufferStatus(mr)!==fr)bi=!1;else{Se.viewport(0,0,1,1),Se.clearColor(1,0,0,1),Se.clear(an);var ha=q.allocType(Ze,4);Se.readPixels(0,0,1,1,Le,Ze,ha),Se.getError()?bi=!1:(Se.deleteFramebuffer(Si),Se.deleteTexture(On),bi=ha[0]===1),q.freeType(ha)}}var aa=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Ia=!0;if(!aa){var co=Se.createTexture(),eo=q.allocType(Qe,36);Se.activeTexture(ce),Se.bindTexture(ie,co),Se.texImage2D(be,0,Le,3,3,0,Le,Qe,eo),q.freeType(eo),Se.bindTexture(ie,null),Se.deleteTexture(co),Ia=!Se.getError()}return{colorBits:[Se.getParameter(tt),Se.getParameter(ht),Se.getParameter(bt),Se.getParameter(vt)],depthBits:Se.getParameter(ut),stencilBits:Se.getParameter(rt),subpixelBits:Se.getParameter(G),extensions:Object.keys(Ir).filter(function(ma){return!!Ir[ma]}),maxAnisotropic:Vr,maxDrawbuffers:ri,maxColorAttachments:Ai,pointSizeDims:Se.getParameter(gt),lineWidthDims:Se.getParameter(it),maxViewportDims:Se.getParameter(xt),maxCombinedTextureUnits:Se.getParameter(dt),maxCubeMapSize:Se.getParameter(Zt),maxRenderbufferSize:Se.getParameter(Gt),maxTextureUnits:Se.getParameter(Rt),maxTextureSize:Se.getParameter(st),maxAttributes:Se.getParameter(ot),maxVertexUniforms:Se.getParameter(J),maxVertexTextureUnits:Se.getParameter(Ct),maxVaryingVectors:Se.getParameter(mt),maxFragmentUniforms:Se.getParameter(Bt),glsl:Se.getParameter(ye),renderer:Se.getParameter(xe),vendor:Se.getParameter(ee),version:Se.getParameter(ge),readFloat:bi,npotTextureCube:Ia}},dn=function(Se){return Se instanceof Uint8Array||Se instanceof Uint16Array||Se instanceof Uint32Array||Se instanceof Int8Array||Se instanceof Int16Array||Se instanceof Int32Array||Se instanceof Float32Array||Se instanceof Float64Array||Se instanceof Uint8ClampedArray};function _n(Se){return!!Se&&typeof Se=="object"&&Array.isArray(Se.shape)&&Array.isArray(Se.stride)&&typeof Se.offset=="number"&&Se.shape.length===Se.stride.length&&(Array.isArray(Se.data)||dn(Se.data))}var Oe=function(Se){return Object.keys(Se).map(function(Ir){return Se[Ir]})},Xt={shape:ae,flatten:Ht};function oe(Se,Ir,Vr){for(var ri=0;ri0){var io;if(Array.isArray(oi[0])){Ca=fi(oi);for(var Ri=1,ki=1;ki0){if(typeof Ri[0]=="number"){var la=q.allocType(wi.dtype,Ri.length);mn(la,Ri),Ca(la,$a),q.freeType(la)}else if(Array.isArray(Ri[0])||dn(Ri[0])){Ea=fi(Ri);var ua=Ci(Ri,Ea,wi.dtype);Ca(ua,$a),q.freeType(ua)}}}else if(_n(Ri)){Ea=Ri.shape;var Oa=Ri.stride,Vo=0,Bo=0,za=0,Ya=0;Ea.length===1?(Vo=Ea[0],Bo=1,za=Oa[0],Ya=0):Ea.length===2&&(Vo=Ea[0],Bo=Ea[1],za=Oa[0],Ya=Oa[1]);var Eo=Array.isArray(Ri.data)?wi.dtype:Ar(Ri.data),No=q.allocType(Eo,Vo*Bo);Zn(No,Ri.data,Vo,Bo,za,Ya,Ri.offset),Ca(No,$a),q.freeType(No)}return Ua}return Yi||Ua(En),Ua._reglType="buffer",Ua._buffer=wi,Ua.subdata=io,Vr.profile&&(Ua.stats=wi.stats),Ua.destroy=function(){eo(wi)},Ua}function ji(){Oe(bi).forEach(function(En){En.buffer=Se.createBuffer(),Se.bindBuffer(En.type,En.buffer),Se.bufferData(En.type,En.persistentData||En.byteLength,En.usage)})}return Vr.profile&&(Ir.getTotalBufferSize=function(){var En=0;return Object.keys(bi).forEach(function(oi){En+=bi[oi].stats.size}),En}),{create:ma,createStream:ha,destroyStream:aa,clear:function(){Oe(bi).forEach(eo),Si.forEach(eo)},getBuffer:function(En){return En&&En._buffer instanceof On?En._buffer:null},restore:ji,_initBuffer:co}}var Wn=0,Li=0,Fi=1,Zi=1,Ji=4,ca=4,Ei={points:Wn,point:Li,lines:Fi,line:Zi,triangles:Ji,triangle:ca,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ga=0,so=1,Fe=4,Re=5120,Kr=5121,sn=5122,cn=5123,Yr=5124,un=5125,Pn=34963,bn=35040,ze=35044;function yr(Se,Ir,Vr,ri){var Ai={},bi=0,On={uint8:Kr,uint16:cn};Ir.oes_element_index_uint&&(On.uint32=un);function Si(ji){this.id=bi++,Ai[this.id]=this,this.buffer=ji,this.primType=Fe,this.vertCount=0,this.type=0}Si.prototype.bind=function(){this.buffer.bind()};var ha=[];function aa(ji){var En=ha.pop();return En||(En=new Si(Vr.create(null,Pn,!0,!1)._buffer)),co(En,ji,bn,-1,-1,0,0),En}function Ia(ji){ha.push(ji)}function co(ji,En,oi,Yi,Ni,wi,Ua){ji.buffer.bind();var Ca;if(En){var io=Ua;!Ua&&(!dn(En)||_n(En)&&!dn(En.data))&&(io=Ir.oes_element_index_uint?un:cn),Vr._initBuffer(ji.buffer,En,oi,io,3)}else Se.bufferData(Pn,wi,oi),ji.buffer.dtype=Ca||Kr,ji.buffer.usage=oi,ji.buffer.dimension=3,ji.buffer.byteLength=wi;if(Ca=Ua,!Ua){switch(ji.buffer.dtype){case Kr:case Re:Ca=Kr;break;case cn:case sn:Ca=cn;break;case un:case Yr:Ca=un;break}ji.buffer.dtype=Ca}ji.type=Ca;var Ri=Ni;Ri<0&&(Ri=ji.buffer.byteLength,Ca===cn?Ri>>=1:Ca===un&&(Ri>>=2)),ji.vertCount=Ri;var ki=Yi;if(Yi<0){ki=Fe;var $a=ji.buffer.dimension;$a===1&&(ki=Ga),$a===2&&(ki=so),$a===3&&(ki=Fe)}ji.primType=ki}function eo(ji){ri.elementsCount--,delete Ai[ji.id],ji.buffer.destroy(),ji.buffer=null}function ma(ji,En){var oi=Vr.create(null,Pn,!0),Yi=new Si(oi._buffer);ri.elementsCount++;function Ni(wi){if(!wi)oi(),Yi.primType=Fe,Yi.vertCount=0,Yi.type=Kr;else if(typeof wi=="number")oi(wi),Yi.primType=Fe,Yi.vertCount=wi|0,Yi.type=Kr;else{var Ua=null,Ca=ze,io=-1,Ri=-1,ki=0,$a=0;Array.isArray(wi)||dn(wi)||_n(wi)?Ua=wi:("data"in wi&&(Ua=wi.data),"usage"in wi&&(Ca=Gi[wi.usage]),"primitive"in wi&&(io=Ei[wi.primitive]),"count"in wi&&(Ri=wi.count|0),"type"in wi&&($a=On[wi.type]),"length"in wi?ki=wi.length|0:(ki=Ri,$a===cn||$a===sn?ki*=2:($a===un||$a===Yr)&&(ki*=4))),co(Yi,Ua,Ca,io,Ri,ki,$a)}return Ni}return Ni(ji),Ni._reglType="elements",Ni._elements=Yi,Ni.subdata=function(wi,Ua){return oi.subdata(wi,Ua),Ni},Ni.destroy=function(){eo(Yi)},Ni}return{create:ma,createStream:aa,destroyStream:Ia,getElements:function(ji){return typeof ji=="function"&&ji._elements instanceof Si?ji._elements:null},clear:function(){Oe(Ai).forEach(eo)}}}var en=new Float32Array(1),Rn=new Uint32Array(en.buffer),ni=5123;function xi(Se){for(var Ir=q.allocType(ni,Se.length),Vr=0;Vr>>31<<15,bi=(ri<<1>>>24)-127,On=ri>>13&1023;if(bi<-24)Ir[Vr]=Ai;else if(bi<-14){var Si=-14-bi;Ir[Vr]=Ai+(On+1024>>Si)}else bi>15?Ir[Vr]=Ai+31744:Ir[Vr]=Ai+(bi+15<<10)+On}return Ir}function Jn(Se){return Array.isArray(Se)||dn(Se)}var Gn=34467,pi=3553,Va=34067,ea=34069,go=6408,mo=6406,Go=6407,Po=6409,Zo=6410,Ka=32854,Cs=32855,ps=36194,wl=32819,is=32820,ol=33635,ms=34042,kl=6402,ul=34041,Kl=35904,vs=35906,Ns=36193,Uo=33776,Ds=33777,Ol=33778,tc=33779,sc=35986,Xs=35987,Wa=34798,Co=35840,el=35841,lc=35842,ss=35843,nc=36196,yl=5121,$l=5123,Gc=5125,ko=5126,zs=10242,js=10243,mc=10497,Tl=33071,us=33648,Rc=10240,iu=10241,Dl=9728,ql=9729,cc=9984,dc=9985,pu=9986,Ah=9987,uh=33170,yh=4352,tf=4353,Nd=4354,Gl=34046,Yu=3317,ef=37440,xu=37441,mu=37443,bu=37444,_h=33984,_c=[cc,pu,dc,Ah],gu=[0,Po,Zo,Go,go],pl={};pl[Po]=pl[mo]=pl[kl]=1,pl[ul]=pl[Zo]=2,pl[Go]=pl[Kl]=3,pl[go]=pl[vs]=4;function ic(Se){return"[object "+Se+"]"}var jh=ic("HTMLCanvasElement"),Hu=ic("OffscreenCanvas"),Qh=ic("CanvasRenderingContext2D"),Lc=ic("ImageBitmap"),Xf=ic("HTMLImageElement"),hl=ic("HTMLVideoElement"),pp=Object.keys(he).concat([jh,Hu,Qh,Lc,Xf,hl]),Hl=[];Hl[yl]=1,Hl[ko]=4,Hl[Ns]=2,Hl[$l]=2,Hl[Gc]=4;var cs=[];cs[Ka]=2,cs[Cs]=2,cs[ps]=2,cs[ul]=4,cs[Uo]=.5,cs[Ds]=.5,cs[Ol]=1,cs[tc]=1,cs[sc]=.5,cs[Xs]=1,cs[Wa]=1,cs[Co]=.5,cs[el]=.25,cs[lc]=.5,cs[ss]=.25,cs[nc]=.5;function _d(Se){return Array.isArray(Se)&&(Se.length===0||typeof Se[0]=="number")}function xh(Se){if(!Array.isArray(Se))return!1;var Ir=Se.length;return!(Ir===0||!Jn(Se[0]))}function hu(Se){return Object.prototype.toString.call(Se)}function rf(Se){return hu(Se)===jh}function td(Se){return hu(Se)===Hu}function Ed(Se){return hu(Se)===Qh}function vu(Se){return hu(Se)===Lc}function Lf(Se){return hu(Se)===Xf}function hf(Se){return hu(Se)===hl}function Ld(Se){if(!Se)return!1;var Ir=hu(Se);return pp.indexOf(Ir)>=0?!0:_d(Se)||xh(Se)||_n(Se)}function ed(Se){return he[Object.prototype.toString.call(Se)]|0}function nf(Se,Ir){var Vr=Ir.length;switch(Se.type){case yl:case $l:case Gc:case ko:var ri=q.allocType(Se.type,Vr);ri.set(Ir),Se.data=ri;break;case Ns:Se.data=xi(Ir);break}}function af(Se,Ir){return q.allocType(Se.type===Ns?ko:Se.type,Ir)}function bh(Se,Ir){Se.type===Ns?(Se.data=xi(Ir),q.freeType(Ir)):Se.data=Ir}function df(Se,Ir,Vr,ri,Ai,bi){for(var On=Se.width,Si=Se.height,ha=Se.channels,aa=On*Si*ha,Ia=af(Se,aa),co=0,eo=0;eo=1;)Si+=On*ha*ha,ha/=2;return Si}else return On*Vr*ri}function Mh(Se,Ir,Vr,ri,Ai,bi,On){var Si={"don't care":yh,"dont care":yh,nice:Nd,fast:tf},ha={repeat:mc,clamp:Tl,mirror:us},aa={nearest:Dl,linear:ql},Ia=f({mipmap:Ah,"nearest mipmap nearest":cc,"linear mipmap nearest":dc,"nearest mipmap linear":pu,"linear mipmap linear":Ah},aa),co={none:0,browser:bu},eo={uint8:yl,rgba4:wl,rgb565:ol,"rgb5 a1":is},ma={alpha:mo,luminance:Po,"luminance alpha":Zo,rgb:Go,rgba:go,rgba4:Ka,"rgb5 a1":Cs,rgb565:ps},ji={};Ir.ext_srgb&&(ma.srgb=Kl,ma.srgba=vs),Ir.oes_texture_float&&(eo.float32=eo.float=ko),Ir.oes_texture_half_float&&(eo.float16=eo["half float"]=Ns),Ir.webgl_depth_texture&&(f(ma,{depth:kl,"depth stencil":ul}),f(eo,{uint16:$l,uint32:Gc,"depth stencil":ms})),Ir.webgl_compressed_texture_s3tc&&f(ji,{"rgb s3tc dxt1":Uo,"rgba s3tc dxt1":Ds,"rgba s3tc dxt3":Ol,"rgba s3tc dxt5":tc}),Ir.webgl_compressed_texture_atc&&f(ji,{"rgb atc":sc,"rgba atc explicit alpha":Xs,"rgba atc interpolated alpha":Wa}),Ir.webgl_compressed_texture_pvrtc&&f(ji,{"rgb pvrtc 4bppv1":Co,"rgb pvrtc 2bppv1":el,"rgba pvrtc 4bppv1":lc,"rgba pvrtc 2bppv1":ss}),Ir.webgl_compressed_texture_etc1&&(ji["rgb etc1"]=nc);var En=Array.prototype.slice.call(Se.getParameter(Gn));Object.keys(ji).forEach(function(Z){var lt=ji[Z];En.indexOf(lt)>=0&&(ma[Z]=lt)});var oi=Object.keys(ma);Vr.textureFormats=oi;var Yi=[];Object.keys(ma).forEach(function(Z){var lt=ma[Z];Yi[lt]=Z});var Ni=[];Object.keys(eo).forEach(function(Z){var lt=eo[Z];Ni[lt]=Z});var wi=[];Object.keys(aa).forEach(function(Z){var lt=aa[Z];wi[lt]=Z});var Ua=[];Object.keys(Ia).forEach(function(Z){var lt=Ia[Z];Ua[lt]=Z});var Ca=[];Object.keys(ha).forEach(function(Z){var lt=ha[Z];Ca[lt]=Z});var io=oi.reduce(function(Z,lt){var nt=ma[lt];return nt===Po||nt===mo||nt===Po||nt===Zo||nt===kl||nt===ul||Ir.ext_srgb&&(nt===Kl||nt===vs)?Z[nt]=nt:nt===Cs||lt.indexOf("rgba")>=0?Z[nt]=go:Z[nt]=Go,Z},{});function Ri(){this.internalformat=go,this.format=go,this.type=yl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bu,this.width=0,this.height=0,this.channels=0}function ki(Z,lt){Z.internalformat=lt.internalformat,Z.format=lt.format,Z.type=lt.type,Z.compressed=lt.compressed,Z.premultiplyAlpha=lt.premultiplyAlpha,Z.flipY=lt.flipY,Z.unpackAlignment=lt.unpackAlignment,Z.colorSpace=lt.colorSpace,Z.width=lt.width,Z.height=lt.height,Z.channels=lt.channels}function $a(Z,lt){if(!(typeof lt!="object"||!lt)){if("premultiplyAlpha"in lt&&(Z.premultiplyAlpha=lt.premultiplyAlpha),"flipY"in lt&&(Z.flipY=lt.flipY),"alignment"in lt&&(Z.unpackAlignment=lt.alignment),"colorSpace"in lt&&(Z.colorSpace=co[lt.colorSpace]),"type"in lt){var nt=lt.type;Z.type=eo[nt]}var wt=Z.width,Wt=Z.height,ve=Z.channels,ke=!1;"shape"in lt?(wt=lt.shape[0],Wt=lt.shape[1],lt.shape.length===3&&(ve=lt.shape[2],ke=!0)):("radius"in lt&&(wt=Wt=lt.radius),"width"in lt&&(wt=lt.width),"height"in lt&&(Wt=lt.height),"channels"in lt&&(ve=lt.channels,ke=!0)),Z.width=wt|0,Z.height=Wt|0,Z.channels=ve|0;var Jt=!1;if("format"in lt){var fe=lt.format,De=Z.internalformat=ma[fe];Z.format=io[De],fe in eo&&("type"in lt||(Z.type=eo[fe])),fe in ji&&(Z.compressed=!0),Jt=!0}!ke&&Jt?Z.channels=pl[Z.format]:ke&&!Jt&&Z.channels!==gu[Z.format]&&(Z.format=Z.internalformat=gu[Z.channels])}}function Ea(Z){Se.pixelStorei(ef,Z.flipY),Se.pixelStorei(xu,Z.premultiplyAlpha),Se.pixelStorei(mu,Z.colorSpace),Se.pixelStorei(Yu,Z.unpackAlignment)}function la(){Ri.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ua(Z,lt){var nt=null;if(Ld(lt)?nt=lt:lt&&($a(Z,lt),"x"in lt&&(Z.xOffset=lt.x|0),"y"in lt&&(Z.yOffset=lt.y|0),Ld(lt.data)&&(nt=lt.data)),lt.copy){var wt=Ai.viewportWidth,Wt=Ai.viewportHeight;Z.width=Z.width||wt-Z.xOffset,Z.height=Z.height||Wt-Z.yOffset,Z.needsCopy=!0}else if(!nt)Z.width=Z.width||1,Z.height=Z.height||1,Z.channels=Z.channels||4;else if(dn(nt))Z.channels=Z.channels||4,Z.data=nt,!("type"in lt)&&Z.type===yl&&(Z.type=ed(nt));else if(_d(nt))Z.channels=Z.channels||4,nf(Z,nt),Z.alignment=1,Z.needsFree=!0;else if(_n(nt)){var ve=nt.data;!Array.isArray(ve)&&Z.type===yl&&(Z.type=ed(ve));var ke=nt.shape,Jt=nt.stride,fe,De,lr,tr,ar,dr;ke.length===3?(lr=ke[2],dr=Jt[2]):(lr=1,dr=1),fe=ke[0],De=ke[1],tr=Jt[0],ar=Jt[1],Z.alignment=1,Z.width=fe,Z.height=De,Z.channels=lr,Z.format=Z.internalformat=gu[lr],Z.needsFree=!0,df(Z,ve,tr,ar,dr,nt.offset)}else if(rf(nt)||td(nt)||Ed(nt))rf(nt)||td(nt)?Z.element=nt:Z.element=nt.canvas,Z.width=Z.element.width,Z.height=Z.element.height,Z.channels=4;else if(vu(nt))Z.element=nt,Z.width=nt.width,Z.height=nt.height,Z.channels=4;else if(Lf(nt))Z.element=nt,Z.width=nt.naturalWidth,Z.height=nt.naturalHeight,Z.channels=4;else if(hf(nt))Z.element=nt,Z.width=nt.videoWidth,Z.height=nt.videoHeight,Z.channels=4;else if(xh(nt)){var gr=Z.width||nt[0].length,Ge=Z.height||nt.length,rr=Z.channels;Jn(nt[0][0])?rr=rr||nt[0][0].length:rr=rr||1;for(var Je=Xt.shape(nt),Hr=1,wn=0;wn>=Wt,nt.height>>=Wt,ua(nt,wt[Wt]),Z.mipmask|=1<=0&&!("faces"in lt)&&(Z.genMipmaps=!0)}if("mag"in lt){var wt=lt.mag;Z.magFilter=aa[wt]}var Wt=Z.wrapS,ve=Z.wrapT;if("wrap"in lt){var ke=lt.wrap;typeof ke=="string"?Wt=ve=ha[ke]:Array.isArray(ke)&&(Wt=ha[ke[0]],ve=ha[ke[1]])}else{if("wrapS"in lt){var Jt=lt.wrapS;Wt=ha[Jt]}if("wrapT"in lt){var fe=lt.wrapT;ve=ha[fe]}}if(Z.wrapS=Wt,Z.wrapT=ve,"anisotropic"in lt&&(lt.anisotropic,Z.anisotropic=lt.anisotropic),"mipmap"in lt){var De=!1;switch(typeof lt.mipmap){case"string":Z.mipmapHint=Si[lt.mipmap],Z.genMipmaps=!0,De=!0;break;case"boolean":De=Z.genMipmaps=lt.mipmap;break;case"object":Z.genMipmaps=!1,De=!0;break}De&&!("min"in lt)&&(Z.minFilter=cc)}}function ku(Z,lt){Se.texParameteri(lt,iu,Z.minFilter),Se.texParameteri(lt,Rc,Z.magFilter),Se.texParameteri(lt,zs,Z.wrapS),Se.texParameteri(lt,js,Z.wrapT),Ir.ext_texture_filter_anisotropic&&Se.texParameteri(lt,Gl,Z.anisotropic),Z.genMipmaps&&(Se.hint(uh,Z.mipmapHint),Se.generateMipmap(lt))}var Eu=0,Ec={},kc=Vr.maxTextureUnits,zc=Array(kc).map(function(){return null});function Xo(Z){Ri.call(this),this.mipmask=0,this.internalformat=go,this.id=Eu++,this.refCount=1,this.target=Z,this.texture=Se.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Cl,On.profile&&(this.stats={size:0})}function Oc(Z){Se.activeTexture(_h),Se.bindTexture(Z.target,Z.texture)}function xl(){var Z=zc[0];Z?Se.bindTexture(Z.target,Z.texture):Se.bindTexture(pi,null)}function jc(Z){var lt=Z.texture,nt=Z.unit,wt=Z.target;nt>=0&&(Se.activeTexture(_h+nt),Se.bindTexture(wt,null),zc[nt]=null),Se.deleteTexture(lt),Z.texture=null,Z.params=null,Z.pixels=null,Z.refCount=0,delete Ec[Z.id],bi.textureCount--}f(Xo.prototype,{bind:function(){var Z=this;Z.bindCount+=1;var lt=Z.unit;if(lt<0){for(var nt=0;nt0)continue;wt.unit=-1}zc[nt]=Z,lt=nt;break}On.profile&&bi.maxTextureUnits>ar)-lr,dr.height=dr.height||(nt.height>>ar)-tr,Oc(nt),Vo(dr,pi,lr,tr,ar),xl(),Ya(dr),wt}function ve(ke,Jt){var fe=ke|0,De=Jt|0||fe;if(fe===nt.width&&De===nt.height)return wt;wt.width=nt.width=fe,wt.height=nt.height=De,Oc(nt);for(var lr=0;nt.mipmask>>lr;++lr){var tr=fe>>lr,ar=De>>lr;if(!tr||!ar)break;Se.texImage2D(pi,lr,nt.format,tr,ar,0,nt.format,nt.type,null)}return xl(),On.profile&&(nt.stats.size=Uh(nt.internalformat,nt.type,fe,De,!1,!1)),wt}return wt(Z,lt),wt.subimage=Wt,wt.resize=ve,wt._reglType="texture2d",wt._texture=nt,On.profile&&(wt.stats=nt.stats),wt.destroy=function(){nt.decRef()},wt}function jo(Z,lt,nt,wt,Wt,ve){var ke=new Xo(Va);Ec[ke.id]=ke,bi.cubeCount++;var Jt=new Array(6);function fe(tr,ar,dr,gr,Ge,rr){var Je,Hr=ke.texInfo;for(Cl.call(Hr),Je=0;Je<6;++Je)Jt[Je]=ys();if(typeof tr=="number"||!tr){var wn=tr|0||1;for(Je=0;Je<6;++Je)No(Jt[Je],wn,wn)}else if(typeof tr=="object")if(ar)hs(Jt[0],tr),hs(Jt[1],ar),hs(Jt[2],dr),hs(Jt[3],gr),hs(Jt[4],Ge),hs(Jt[5],rr);else if(Nc(Hr,tr),$a(ke,tr),"faces"in tr){var Ln=tr.faces;for(Je=0;Je<6;++Je)ki(Jt[Je],ke),hs(Jt[Je],Ln[Je])}else for(Je=0;Je<6;++Je)hs(Jt[Je],tr);for(ki(ke,Jt[0]),Hr.genMipmaps?ke.mipmask=(Jt[0].width<<1)-1:ke.mipmask=Jt[0].mipmask,ke.internalformat=Jt[0].internalformat,fe.width=Jt[0].width,fe.height=Jt[0].height,Oc(ke),Je=0;Je<6;++Je)Xl(Jt[Je],ea+Je);for(ku(Hr,Va),xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,Hr.genMipmaps,!0)),fe.format=Yi[ke.internalformat],fe.type=Ni[ke.type],fe.mag=wi[Hr.magFilter],fe.min=Ua[Hr.minFilter],fe.wrapS=Ca[Hr.wrapS],fe.wrapT=Ca[Hr.wrapT],Je=0;Je<6;++Je)Dc(Jt[Je]);return fe}function De(tr,ar,dr,gr,Ge){var rr=dr|0,Je=gr|0,Hr=Ge|0,wn=za();return ki(wn,ke),wn.width=0,wn.height=0,ua(wn,ar),wn.width=wn.width||(ke.width>>Hr)-rr,wn.height=wn.height||(ke.height>>Hr)-Je,Oc(ke),Vo(wn,ea+tr,rr,Je,Hr),xl(),Ya(wn),fe}function lr(tr){var ar=tr|0;if(ar!==ke.width){fe.width=ke.width=ar,fe.height=ke.height=ar,Oc(ke);for(var dr=0;dr<6;++dr)for(var gr=0;ke.mipmask>>gr;++gr)Se.texImage2D(ea+dr,gr,ke.format,ar>>gr,ar>>gr,0,ke.format,ke.type,null);return xl(),On.profile&&(ke.stats.size=Uh(ke.internalformat,ke.type,fe.width,fe.height,!1,!0)),fe}}return fe(Z,lt,nt,wt,Wt,ve),fe.subimage=De,fe.resize=lr,fe._reglType="textureCube",fe._texture=ke,On.profile&&(fe.stats=ke.stats),fe.destroy=function(){ke.decRef()},fe}function Rs(){for(var Z=0;Z>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);else for(var Wt=0;Wt<6;++Wt)Se.texImage2D(ea+Wt,wt,nt.internalformat,nt.width>>wt,nt.height>>wt,0,nt.internalformat,nt.type,null);ku(nt.texInfo,nt.target)})}function Pl(){for(var Z=0;Z=0?Dc=!0:ha.indexOf(Cl)>=0&&(Dc=!1))),("depthTexture"in Xo||"depthStencilTexture"in Xo)&&(zc=!!(Xo.depthTexture||Xo.depthStencilTexture)),"depth"in Xo&&(typeof Xo.depth=="boolean"?Xl=Xo.depth:(Eu=Xo.depth,Rl=!1)),"stencil"in Xo&&(typeof Xo.stencil=="boolean"?Rl=Xo.stencil:(Ec=Xo.stencil,Xl=!1)),"depthStencil"in Xo&&(typeof Xo.depthStencil=="boolean"?Xl=Rl=Xo.depthStencil:(kc=Xo.depthStencil,Xl=!1,Rl=!1))}var xl=null,jc=null,Lu=null,jo=null;if(Array.isArray(ys))xl=ys.map(ji);else if(ys)xl=[ji(ys)];else for(xl=new Array(ku),Eo=0;Eo0&&(Ya.depth=ua[0].depth,Ya.stencil=ua[0].stencil,Ya.depthStencil=ua[0].depthStencil),ua[za]?ua[za](Ya):ua[za]=ki(Ya)}return f(Oa,{width:Eo,height:Eo,color:Cl})}function Vo(Bo){var za,Ya=Bo|0;if(Ya===Oa.width)return Oa;var Eo=Oa.color;for(za=0;za=Eo.byteLength?No.subdata(Eo):(No.destroy(),ki.buffers[Bo]=null)),ki.buffers[Bo]||(No=ki.buffers[Bo]=Ai.create(za,Hd,!1,!0)),Ya.buffer=Ai.getBuffer(No),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1,Oa[Bo]=1}else Ai.getBuffer(za)?(Ya.buffer=Ai.getBuffer(za),Ya.size=Ya.buffer.dimension|0,Ya.normalized=!1,Ya.type=Ya.buffer.dtype,Ya.offset=0,Ya.stride=0,Ya.divisor=0,Ya.state=1):Ai.getBuffer(za.buffer)?(Ya.buffer=Ai.getBuffer(za.buffer),Ya.size=(+za.size||Ya.buffer.dimension)|0,Ya.normalized=!!za.normalized||!1,"type"in za?Ya.type=ci[za.type]:Ya.type=Ya.buffer.dtype,Ya.offset=(za.offset||0)|0,Ya.stride=(za.stride||0)|0,Ya.divisor=(za.divisor||0)|0,Ya.state=1):"x"in za&&(Ya.x=+za.x||0,Ya.y=+za.y||0,Ya.z=+za.z||0,Ya.w=+za.w||0,Ya.state=2)}for(var hs=0;hs1)for(var Ea=0;EaEn&&(En=oi.stats.uniformsCount)}),En},Vr.getMaxAttributesCount=function(){var En=0;return Ia.forEach(function(oi){oi.stats.attributesCount>En&&(En=oi.stats.attributesCount)}),En});function ji(){Ai={},bi={};for(var En=0;En>>4&15)+Ir.charAt(ri&15);return Vr}function Vh(Se){for(var Ir="",Vr=-1,ri,Ai;++Vr>>6&31,128|ri&63):ri<=65535?Ir+=String.fromCharCode(224|ri>>>12&15,128|ri>>>6&63,128|ri&63):ri<=2097151&&(Ir+=String.fromCharCode(240|ri>>>18&7,128|ri>>>12&63,128|ri>>>6&63,128|ri&63));return Ir}function Ph(Se){for(var Ir=Array(Se.length>>2),Vr=0;Vr>5]|=(Se.charCodeAt(Vr/8)&255)<<24-Vr%32;return Ir}function Zc(Se){for(var Ir="",Vr=0;Vr>5]>>>24-Vr%32&255);return Ir}function fc(Se,Ir){return Se>>>Ir|Se<<32-Ir}function Ih(Se,Ir){return Se>>>Ir}function Td(Se,Ir,Vr){return Se&Ir^~Se&Vr}function Dh(Se,Ir,Vr){return Se&Ir^Se&Vr^Ir&Vr}function sf(Se){return fc(Se,2)^fc(Se,13)^fc(Se,22)}function br(Se){return fc(Se,6)^fc(Se,11)^fc(Se,25)}function Qr(Se){return fc(Se,7)^fc(Se,18)^Ih(Se,3)}function Nn(Se){return fc(Se,17)^fc(Se,19)^Ih(Se,10)}var An=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function di(Se,Ir){var Vr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),ri=new Array(64),Ai,bi,On,Si,ha,aa,Ia,co,eo,ma,ji,En;for(Se[Ir>>5]|=128<<24-Ir%32,Se[(Ir+64>>9<<4)+15]=Ir,eo=0;eo>16)+(Ir>>16)+(Vr>>16);return ri<<16|Vr&65535}function ga(Se){return Array.prototype.slice.call(Se)}function Pa(Se){return ga(Se).join("")}function Qa(Se){var Ir=Se&&Se.cache,Vr=0,ri=[],Ai=[],bi=[];function On(ji,En){var oi=En&&En.stable;if(!oi){for(var Yi=0;Yi0&&(ji.push(Ni,"="),ji.push.apply(ji,ga(arguments)),ji.push(";")),Ni}return f(En,{def:Yi,toString:function(){return Pa([oi.length>0?"var "+oi.join(",")+";":"",Pa(ji)])}})}function ha(){var ji=Si(),En=Si(),oi=ji.toString,Yi=En.toString;function Ni(wi,Ua){En(wi,Ua,"=",ji.def(wi,Ua),";")}return f(function(){ji.apply(ji,ga(arguments))},{def:ji.def,entry:ji,exit:En,save:Ni,set:function(wi,Ua,Ca){Ni(wi,Ua),ji(wi,Ua,"=",Ca,";")},toString:function(){return oi()+Yi()}})}function aa(){var ji=Pa(arguments),En=ha(),oi=ha(),Yi=En.toString,Ni=oi.toString;return f(En,{then:function(){return En.apply(En,ga(arguments)),this},else:function(){return oi.apply(oi,ga(arguments)),this},toString:function(){var wi=Ni();return wi&&(wi="else{"+wi+"}"),Pa(["if(",ji,"){",Yi(),"}",wi])}})}var Ia=Si(),co={};function eo(ji,En){var oi=[];function Yi(){var io="a"+oi.length;return oi.push(io),io}En=En||0;for(var Ni=0;Ni":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Oi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$i={cw:de,ccw:Ie};function Ki(Se){return Array.isArray(Se)||dn(Se)||_n(Se)}function sa(Se){return Se.sort(function(Ir,Vr){return Ir===eu?-1:Vr===eu?1:Ir=1,ri>=2,Ir)}else if(Vr===gs){var Ai=Se.data;return new vi(Ai.thisDep,Ai.contextDep,Ai.propDep,Ir)}else{if(Vr===ws)return new vi(!1,!1,!1,Ir);if(Vr===bo){for(var bi=!1,On=!1,Si=!1,ha=0;ha=1&&(On=!0),Ia>=2&&(Si=!0)}else ia.type===gs&&(bi=bi||ia.data.thisDep,On=On||ia.data.contextDep,Si=Si||ia.data.propDep)}return new vi(bi,On,Si,Ir)}else return new vi(Vr===os,Vr===fs,Vr===_o,Ir)}}var $o=new vi(!1,!1,!1,function(){});function Ko(Se,Ir,Vr,ri,Ai,bi,On,Si,ha,ia,Ia,co,to,ma,ji,En){var oi=ia.Record,Yi={add:32774,subtract:32778,"reverse subtract":32779};Vr.ext_blend_minmax&&(Yi.min=Be,Yi.max=He);var Ni=Vr.angle_instanced_arrays,wi=Vr.webgl_draw_buffers,Ua=Vr.oes_vertex_array_object,Ca={dirty:!0,profile:En.profile},no={},Ri=[],ki={},$a={};function Ea(Jt){return Jt.replace(".","_")}function la(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),no[lr]=Ca[lr]=!!De,ki[lr]=fe}function ua(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),Array.isArray(De)?(Ca[lr]=De.slice(),no[lr]=De.slice()):Ca[lr]=no[lr]=De,$a[lr]=fe}function Oa(Jt){return!!isNaN(Jt)}la(lo,Xr),la(ks,qr),ua(dl,"blendColor",[0,0,0,0]),ua(Vl,"blendEquationSeparate",[fn,fn]),ua(gc,"blendFuncSeparate",[vn,Fr,vn,Fr]),la(ec,zn,!0),ua(vc,"depthFunc",Bn),ua(El,"depthRange",[0,1]),ua(tu,"depthMask",!0),ua($c,$c,[!0,!0,!0,!0]),la(bc,Pr),ua(qo,"cullFace",Vt),ua(Bs,Bs,Ie),ua(ac,ac,1),la(Zl,ai),ua(Mu,"polygonOffset",[0,0]),la(eh,Ti),la(Vu,Qi),ua(Wh,"sampleCoverage",[1,!1]),la(rh,gn),ua(qh,"stencilMask",-1),ua(Wc,"stencilFunc",[hr,0,-1]),ua(Gh,"stencilOpSeparate",[Et,cr,cr,cr]),ua(ds,"stencilOpSeparate",[Vt,cr,cr,cr]),la($s,Qn),ua(nh,"scissor",[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]),ua(eu,eu,[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]);var Vo={gl:Se,context:to,strings:Ir,next:no,current:Ca,draw:co,elements:bi,buffer:Ai,shader:Ia,attributes:ia.state,vao:ia,uniforms:ha,framebuffer:Si,extensions:Vr,timer:ma,isBufferArgs:Ki},Bo={primTypes:Ei,compareFuncs:si,blendFuncs:ra,blendEquations:Yi,stencilOps:Oi,glTypes:ci,orientationType:$i};wi&&(Bo.backBuffer=[Vt],Bo.drawBuffer=p(ri.maxDrawbuffers,function(Jt){return Jt===0?[0]:p(Jt,function(fe){return ei+fe})}));var za=0;function Ya(){var Jt=Ja({cache:ji}),fe=Jt.link,De=Jt.global;Jt.id=za++,Jt.batchId="0";var lr=fe(Vo),tr=Jt.shared={props:"a0"};Object.keys(Vo).forEach(function(rr){tr[rr]=De.def(lr,".",rr)});var ar=Jt.next={},dr=Jt.current={};Object.keys($a).forEach(function(rr){Array.isArray(Ca[rr])&&(ar[rr]=De.def(tr.next,".",rr),dr[rr]=De.def(tr.current,".",rr))});var gr=Jt.constants={};Object.keys(Bo).forEach(function(rr){gr[rr]=De.def(JSON.stringify(Bo[rr]))}),Jt.invoke=function(rr,Je){switch(Je.type){case pa:var Hr=["this",tr.context,tr.props,Jt.batchId];return rr.def(fe(Je.data),".call(",Hr.slice(0,Math.max(Je.data.length+1,4)),")");case _o:return rr.def(tr.props,Je.data);case fs:return rr.def(tr.context,Je.data);case os:return rr.def("this",Je.data);case gs:return Je.data.append(Jt,rr),Je.data.ref;case ws:return Je.data.toString();case bo:return Je.data.map(function(wn){return Jt.invoke(rr,wn)})}},Jt.attribCache={};var Ge={};return Jt.scopeAttrib=function(rr){var Je=Ir.id(rr);if(Je in Ge)return Ge[Je];var Hr=ia.scope[Je];Hr||(Hr=ia.scope[Je]=new oi);var wn=Ge[Je]=fe(Hr);return wn},Jt}function Eo(Jt){var fe=Jt.static,De=Jt.dynamic,lr;if(lf in fe){var tr=!!fe[lf];lr=ao(function(dr,gr){return tr}),lr.enable=tr}else if(lf in De){var ar=De[lf];lr=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}return lr}function No(Jt,fe){var De=Jt.static,lr=Jt.dynamic;if(Kt in De){var tr=De[Kt];return tr?(tr=Si.getFramebuffer(tr),ao(function(dr,gr){var Ge=dr.link(tr),rr=dr.shared;gr.set(rr.framebuffer,".next",Ge);var Je=rr.context;return gr.set(Je,"."+Zr,Ge+".width"),gr.set(Je,"."+Tn,Ge+".height"),Ge})):ao(function(dr,gr){var Ge=dr.shared;gr.set(Ge.framebuffer,".next","null");var rr=Ge.context;return gr.set(rr,"."+Zr,rr+"."+Te),gr.set(rr,"."+Tn,rr+"."+Pe),"null"})}else if(Kt in lr){var ar=lr[Kt];return xo(ar,function(dr,gr){var Ge=dr.invoke(gr,ar),rr=dr.shared,Je=rr.framebuffer,Hr=gr.def(Je,".getFramebuffer(",Ge,")");gr.set(Je,".next",Hr);var wn=rr.context;return gr.set(wn,"."+Zr,Hr+"?"+Hr+".width:"+wn+"."+Te),gr.set(wn,"."+Tn,Hr+"?"+Hr+".height:"+wn+"."+Pe),Hr})}else return null}function hs(Jt,fe,De){var lr=Jt.static,tr=Jt.dynamic;function ar(Ge){if(Ge in lr){var rr=lr[Ge],Je=!0,Hr=rr.x|0,wn=rr.y|0,Ln,Ii;return"width"in rr?Ln=rr.width|0:Je=!1,"height"in rr?Ii=rr.height|0:Je=!1,new vi(!Je&&fe&&fe.thisDep,!Je&&fe&&fe.contextDep,!Je&&fe&&fe.propDep,function(Vi,Di){var da=Vi.shared.context,Hi=Ln;"width"in rr||(Hi=Di.def(da,".",Zr,"-",Hr));var Wi=Ii;return"height"in rr||(Wi=Di.def(da,".",Tn,"-",wn)),[Hr,wn,Hi,Wi]})}else if(Ge in tr){var Mi=tr[Ge],gi=xo(Mi,function(Vi,Di){var da=Vi.invoke(Di,Mi),Hi=Vi.shared.context,Wi=Di.def(da,".x|0"),wa=Di.def(da,".y|0"),vo=Di.def('"width" in ',da,"?",da,".width|0:","(",Hi,".",Zr,"-",Wi,")"),So=Di.def('"height" in ',da,"?",da,".height|0:","(",Hi,".",Tn,"-",wa,")");return[Wi,wa,vo,So]});return fe&&(gi.thisDep=gi.thisDep||fe.thisDep,gi.contextDep=gi.contextDep||fe.contextDep,gi.propDep=gi.propDep||fe.propDep),gi}else return fe?new vi(fe.thisDep,fe.contextDep,fe.propDep,function(Vi,Di){var da=Vi.shared.context;return[0,0,Di.def(da,".",Zr),Di.def(da,".",Tn)]}):null}var dr=ar(eu);if(dr){var gr=dr;dr=new vi(dr.thisDep,dr.contextDep,dr.propDep,function(Ge,rr){var Je=gr.append(Ge,rr),Hr=Ge.shared.context;return rr.set(Hr,"."+qn,Je[2]),rr.set(Hr,"."+te,Je[3]),Je})}return{viewport:dr,scissor_box:ar(nh)}}function Xl(Jt,fe){var De=Jt.static,lr=typeof De[pt]=="string"&&typeof De[O]=="string";if(lr){if(Object.keys(fe.dynamic).length>0)return null;var tr=fe.static,ar=Object.keys(tr);if(ar.length>0&&typeof tr[ar[0]]=="number"){for(var dr=[],gr=0;gr"+Wi+"?"+Je+".constant["+Wi+"]:0;"}).join(""),"}}else{","if(",Ln,"(",Je,".buffer)){",Vi,"=",Ii,".createStream(",Ne,",",Je,".buffer);","}else{",Vi,"=",Ii,".getBuffer(",Je,".buffer);","}",Di,'="type" in ',Je,"?",wn.glTypes,"[",Je,".type]:",Vi,".dtype;",Mi.normalized,"=!!",Je,".normalized;");function da(Hi){rr(Mi[Hi],"=",Je,".",Hi,"|0;")}return da("size"),da("offset"),da("stride"),da("divisor"),rr("}}"),rr.exit("if(",Mi.isStream,"){",Ii,".destroyStream(",Vi,");","}"),Mi}tr[ar]=xo(dr,gr)}),tr}function ku(Jt){var fe=Jt.static,De=Jt.dynamic,lr={};return Object.keys(fe).forEach(function(tr){var ar=fe[tr];lr[tr]=ao(function(dr,gr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:dr.link(ar)})}),Object.keys(De).forEach(function(tr){var ar=De[tr];lr[tr]=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}),lr}function Eu(Jt,fe,De,lr,tr){Jt.static,Jt.dynamic;var ar=Xl(Jt,fe),dr=No(Jt),gr=hs(Jt,dr),Ge=ys(Jt),rr=Dc(Jt),Je=Rl(Jt,tr,ar);function Hr(Vi){var Di=gr[Vi];Di&&(rr[Vi]=Di)}Hr(eu),Hr(Ea(nh));var wn=Object.keys(rr).length>0,Ln={framebuffer:dr,draw:Ge,shader:Je,state:rr,dirty:wn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ln.profile=Eo(Jt),Ln.uniforms=Cl(De),Ln.drawVAO=Ln.scopeVAO=Ge.vao,!Ln.drawVAO&&Je.program&&!ar&&Vr.angle_instanced_arrays&&Ge.static.elements){var Ii=!0,Mi=Je.program.attributes.map(function(Vi){var Di=fe.static[Vi];return Ii=Ii&&!!Di,Di});if(Ii&&Mi.length>0){var gi=ia.getVAO(ia.createVAO({attributes:Mi,elements:Ge.static.elements}));Ln.drawVAO=new vi(null,null,null,function(Vi,Di){return Vi.link(gi)}),Ln.useVAO=!0}}return ar?Ln.useVAO=!0:Ln.attributes=Nc(fe),Ln.context=ku(lr),Ln}function Ec(Jt,fe,De){var lr=Jt.shared,tr=lr.context,ar=Jt.scope();Object.keys(De).forEach(function(dr){fe.save(tr,"."+dr);var gr=De[dr],Ge=gr.append(Jt,fe);Array.isArray(Ge)?ar(tr,".",dr,"=[",Ge.join(),"];"):ar(tr,".",dr,"=",Ge,";")}),fe(ar)}function kc(Jt,fe,De,lr){var tr=Jt.shared,ar=tr.gl,dr=tr.framebuffer,gr;wi&&(gr=fe.def(tr.extensions,".webgl_draw_buffers"));var Ge=Jt.constants,rr=Ge.drawBuffer,Je=Ge.backBuffer,Hr;De?Hr=De.append(Jt,fe):Hr=fe.def(dr,".next"),lr||fe("if(",Hr,"!==",dr,".cur){"),fe("if(",Hr,"){",ar,".bindFramebuffer(",ti,",",Hr,".framebuffer);"),wi&&fe(gr,".drawBuffersWEBGL(",rr,"[",Hr,".colorAttachments.length]);"),fe("}else{",ar,".bindFramebuffer(",ti,",null);"),wi&&fe(gr,".drawBuffersWEBGL(",Je,");"),fe("}",dr,".cur=",Hr,";"),lr||fe("}")}function zc(Jt,fe,De){var lr=Jt.shared,tr=lr.gl,ar=Jt.current,dr=Jt.next,gr=lr.current,Ge=lr.next,rr=Jt.cond(gr,".dirty");Ri.forEach(function(Je){var Hr=Ea(Je);if(!(Hr in De.state)){var wn,Ln;if(Hr in dr){wn=dr[Hr],Ln=ar[Hr];var Ii=p(Ca[Hr].length,function(gi){return rr.def(wn,"[",gi,"]")});rr(Jt.cond(Ii.map(function(gi,Vi){return gi+"!=="+Ln+"["+Vi+"]"}).join("||")).then(tr,".",$a[Hr],"(",Ii,");",Ii.map(function(gi,Vi){return Ln+"["+Vi+"]="+gi}).join(";"),";"))}else{wn=rr.def(Ge,".",Hr);var Mi=Jt.cond(wn,"!==",gr,".",Hr);rr(Mi),Hr in ki?Mi(Jt.cond(wn).then(tr,".enable(",ki[Hr],");").else(tr,".disable(",ki[Hr],");"),gr,".",Hr,"=",wn,";"):Mi(tr,".",$a[Hr],"(",wn,");",gr,".",Hr,"=",wn,";")}}}),Object.keys(De.state).length===0&&rr(gr,".dirty=false;"),fe(rr)}function Xo(Jt,fe,De,lr){var tr=Jt.shared,ar=Jt.current,dr=tr.current,gr=tr.gl,Ge;sa(Object.keys(De)).forEach(function(rr){var Je=De[rr];if(!(lr&&!lr(Je))){var Hr=Je.append(Jt,fe);if(ki[rr]){var wn=ki[rr];ro(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(Jt.cond(Ge).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Ge,";")):(fe(Jt.cond(Hr).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Hr,";"))}else if(Jn(Hr)){var Ln=ar[rr];fe(gr,".",$a[rr],"(",Hr,");",Hr.map(function(Ii,Mi){return Ln+"["+Mi+"]="+Ii}).join(";"),";")}else ro(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(gr,".",$a[rr],"(",Ge,");",dr,".",rr,"=",Ge,";")):fe(gr,".",$a[rr],"(",Hr,");",dr,".",rr,"=",Hr,";")}})}function Oc(Jt,fe){Ni&&(Jt.instancing=fe.def(Jt.shared.extensions,".angle_instanced_arrays"))}function xl(Jt,fe,De,lr,tr){var ar=Jt.shared,dr=Jt.stats,gr=ar.current,Ge=ar.timer,rr=De.profile;function Je(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Hr,wn;function Ln(da){Hr=fe.def(),da(Hr,"=",Je(),";"),typeof tr=="string"?da(dr,".count+=",tr,";"):da(dr,".count++;"),ma&&(lr?(wn=fe.def(),da(wn,"=",Ge,".getNumPendingQueries();")):da(Ge,".beginQuery(",dr,");"))}function Ii(da){da(dr,".cpuTime+=",Je(),"-",Hr,";"),ma&&(lr?da(Ge,".pushScopeStats(",wn,",",Ge,".getNumPendingQueries(),",dr,");"):da(Ge,".endQuery();"))}function Mi(da){var Hi=fe.def(gr,".profile");fe(gr,".profile=",da,";"),fe.exit(gr,".profile=",Hi,";")}var gi;if(rr){if(ro(rr)){rr.enable?(Ln(fe),Ii(fe.exit),Mi("true")):Mi("false");return}gi=rr.append(Jt,fe),Mi(gi)}else gi=fe.def(gr,".profile");var Vi=Jt.block();Ln(Vi),fe("if(",gi,"){",Vi,"}");var Di=Jt.block();Ii(Di),fe.exit("if(",gi,"){",Di,"}")}function jc(Jt,fe,De,lr,tr){var ar=Jt.shared;function dr(Ge){switch(Ge){case Aa:case Fo:case Ws:return 2;case Fa:case xs:case zl:return 3;case wo:case Sl:case Fc:return 4;default:return 1}}function gr(Ge,rr,Je){var Hr=ar.gl,wn=fe.def(Ge,".location"),Ln=fe.def(ar.attributes,"[",wn,"]"),Ii=Je.state,Mi=Je.buffer,gi=[Je.x,Je.y,Je.z,Je.w],Vi=["buffer","normalized","offset","stride"];function Di(){fe("if(!",Ln,".buffer){",Hr,".enableVertexAttribArray(",wn,");}");var Hi=Je.type,Wi;if(Je.size?Wi=fe.def(Je.size,"||",rr):Wi=rr,fe("if(",Ln,".type!==",Hi,"||",Ln,".size!==",Wi,"||",Vi.map(function(vo){return Ln+"."+vo+"!=="+Je[vo]}).join("||"),"){",Hr,".bindBuffer(",Ne,",",Mi,".buffer);",Hr,".vertexAttribPointer(",[wn,Wi,Hi,Je.normalized,Je.stride,Je.offset],");",Ln,".type=",Hi,";",Ln,".size=",Wi,";",Vi.map(function(vo){return Ln+"."+vo+"="+Je[vo]+";"}).join(""),"}"),Ni){var wa=Je.divisor;fe("if(",Ln,".divisor!==",wa,"){",Jt.instancing,".vertexAttribDivisorANGLE(",[wn,wa],");",Ln,".divisor=",wa,";}")}}function da(){fe("if(",Ln,".buffer){",Hr,".disableVertexAttribArray(",wn,");",Ln,".buffer=null;","}if(",uo.map(function(Hi,Wi){return Ln+"."+Hi+"!=="+gi[Wi]}).join("||"),"){",Hr,".vertexAttrib4f(",wn,",",gi,");",uo.map(function(Hi,Wi){return Ln+"."+Hi+"="+gi[Wi]+";"}).join(""),"}")}Ii===Za?Di():Ii===Ra?da():(fe("if(",Ii,"===",Za,"){"),Di(),fe("}else{"),da(),fe("}"))}lr.forEach(function(Ge){var rr=Ge.name,Je=De.attributes[rr],Hr;if(Je){if(!tr(Je))return;Hr=Je.append(Jt,fe)}else{if(!tr($o))return;var wn=Jt.scopeAttrib(rr);Hr={},Object.keys(new oi).forEach(function(Ln){Hr[Ln]=fe.def(wn,".",Ln)})}gr(Jt.link(Ge),dr(Ge.info.type),Hr)})}function Lu(Jt,fe,De,lr,tr,ar){for(var dr=Jt.shared,gr=dr.gl,Ge,rr=0;rr1){for(var ns=[],As=[],Wl=0;Wl>1)",Mi],");")}function wa(){De(gi,".drawArraysInstancedANGLE(",[wn,Ln,Ii,Mi],");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}function Hi(){function Wi(){De(ar+".drawElements("+[wn,Ii,Vi,Ln+"<<(("+Vi+"-"+Sa+")>>1)"]+");")}function wa(){De(ar+".drawArrays("+[wn,Ln,Ii]+");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}Ni&&(typeof Mi!="number"||Mi>=0)?typeof Mi=="string"?(De("if(",Mi,">0){"),da(),De("}else if(",Mi,"<0){"),Hi(),De("}")):da():Hi()}function Rs(Jt,fe,De,lr,tr){var ar=Ya(),dr=ar.proc("body",tr);return Ni&&(ar.instancing=dr.def(ar.shared.extensions,".angle_instanced_arrays")),Jt(ar,dr,De,lr),ar.compile().body}function Fl(Jt,fe,De,lr){Oc(Jt,fe),De.useVAO?De.drawVAO?fe(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,fe),");"):fe(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(fe(Jt.shared.vao,".setVAO(null);"),jc(Jt,fe,De,lr.attributes,function(){return!0})),Lu(Jt,fe,De,lr.uniforms,function(){return!0},!1),jo(Jt,fe,fe,De)}function Pl(Jt,fe){var De=Jt.proc("draw",1);Oc(Jt,De),Ec(Jt,De,fe.context),kc(Jt,De,fe.framebuffer),zc(Jt,De,fe),Xo(Jt,De,fe.state),xl(Jt,De,fe,!1,!0);var lr=fe.shader.progVar.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",lr,".program);"),fe.shader.program)Fl(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var tr=Jt.global.def("{}"),ar=De.def(lr,".id"),dr=De.def(tr,"[",ar,"]");De(Jt.cond(dr).then(dr,".call(this,a0);").else(dr,"=",tr,"[",ar,"]=",Jt.link(function(gr){return Rs(Fl,Jt,fe,gr,1)}),"(",lr,");",dr,".call(this,a0);"))}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function Z(Jt,fe,De,lr){Jt.batchId="a1",Oc(Jt,fe);function tr(){return!0}jc(Jt,fe,De,lr.attributes,tr),Lu(Jt,fe,De,lr.uniforms,tr,!1),jo(Jt,fe,fe,De)}function lt(Jt,fe,De,lr){Oc(Jt,fe);var tr=De.contextDep,ar=fe.def(),dr="a0",gr="a1",Ge=fe.def();Jt.shared.props=Ge,Jt.batchId=ar;var rr=Jt.scope(),Je=Jt.scope();fe(rr.entry,"for(",ar,"=0;",ar,"<",gr,";++",ar,"){",Ge,"=",dr,"[",ar,"];",Je,"}",rr.exit);function Hr(Vi){return Vi.contextDep&&tr||Vi.propDep}function wn(Vi){return!Hr(Vi)}if(De.needsContext&&Ec(Jt,Je,De.context),De.needsFramebuffer&&kc(Jt,Je,De.framebuffer),Xo(Jt,Je,De.state,Hr),De.profile&&Hr(De.profile)&&xl(Jt,Je,De,!1,!0),lr)De.useVAO?De.drawVAO?Hr(De.drawVAO)?Je(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,Je),");"):rr(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,rr),");"):rr(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(rr(Jt.shared.vao,".setVAO(null);"),jc(Jt,rr,De,lr.attributes,wn),jc(Jt,Je,De,lr.attributes,Hr)),Lu(Jt,rr,De,lr.uniforms,wn,!1),Lu(Jt,Je,De,lr.uniforms,Hr,!0),jo(Jt,rr,Je,De);else{var Ln=Jt.global.def("{}"),Ii=De.shader.progVar.append(Jt,Je),Mi=Je.def(Ii,".id"),gi=Je.def(Ln,"[",Mi,"]");Je(Jt.shared.gl,".useProgram(",Ii,".program);","if(!",gi,"){",gi,"=",Ln,"[",Mi,"]=",Jt.link(function(Vi){return Rs(Z,Jt,De,Vi,2)}),"(",Ii,");}",gi,".call(this,a0[",ar,"],",ar,");")}}function nt(Jt,fe){var De=Jt.proc("batch",2);Jt.batchId="0",Oc(Jt,De);var lr=!1,tr=!0;Object.keys(fe.context).forEach(function(Ln){lr=lr||fe.context[Ln].propDep}),lr||(Ec(Jt,De,fe.context),tr=!1);var ar=fe.framebuffer,dr=!1;ar?(ar.propDep?lr=dr=!0:ar.contextDep&&lr&&(dr=!0),dr||kc(Jt,De,ar)):kc(Jt,De,null),fe.state.viewport&&fe.state.viewport.propDep&&(lr=!0);function gr(Ln){return Ln.contextDep&&lr||Ln.propDep}zc(Jt,De,fe),Xo(Jt,De,fe.state,function(Ln){return!gr(Ln)}),(!fe.profile||!gr(fe.profile))&&xl(Jt,De,fe,!1,"a1"),fe.contextDep=lr,fe.needsContext=tr,fe.needsFramebuffer=dr;var Ge=fe.shader.progVar;if(Ge.contextDep&&lr||Ge.propDep)lt(Jt,De,fe,null);else{var rr=Ge.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",rr,".program);"),fe.shader.program)lt(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var Je=Jt.global.def("{}"),Hr=De.def(rr,".id"),wn=De.def(Je,"[",Hr,"]");De(Jt.cond(wn).then(wn,".call(this,a0,a1);").else(wn,"=",Je,"[",Hr,"]=",Jt.link(function(Ln){return Rs(lt,Jt,fe,Ln,2)}),"(",rr,");",wn,".call(this,a0,a1);"))}}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function wt(Jt,fe){var De=Jt.proc("scope",3);Jt.batchId="a2";var lr=Jt.shared,tr=lr.current;if(Ec(Jt,De,fe.context),fe.framebuffer&&fe.framebuffer.append(Jt,De),sa(Object.keys(fe.state)).forEach(function(gr){var Ge=fe.state[gr],rr=Ge.append(Jt,De);Jn(rr)?rr.forEach(function(Je,Hr){Oa(Je)?De.set(Jt.next[gr],"["+Hr+"]",Je):De.set(Jt.next[gr],"["+Hr+"]",Jt.link(Je,{stable:!0}))}):ro(Ge)?De.set(lr.next,"."+gr,Jt.link(rr,{stable:!0})):De.set(lr.next,"."+gr,rr)}),xl(Jt,De,fe,!0,!0),[Dt,Ee,qt,je,Ft].forEach(function(gr){var Ge=fe.draw[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.draw,"."+gr,rr):De.set(lr.draw,"."+gr,Jt.link(rr),{stable:!0})}}),Object.keys(fe.uniforms).forEach(function(gr){var Ge=fe.uniforms[gr].append(Jt,De);Array.isArray(Ge)&&(Ge="["+Ge.map(function(rr){return Oa(rr)?rr:Jt.link(rr,{stable:!0})})+"]"),De.set(lr.uniforms,"["+Jt.link(Ir.id(gr),{stable:!0})+"]",Ge)}),Object.keys(fe.attributes).forEach(function(gr){var Ge=fe.attributes[gr].append(Jt,De),rr=Jt.scopeAttrib(gr);Object.keys(new oi).forEach(function(Je){De.set(rr,"."+Je,Ge[Je])})}),fe.scopeVAO){var ar=fe.scopeVAO.append(Jt,De);Oa(ar)?De.set(lr.vao,".targetVAO",ar):De.set(lr.vao,".targetVAO",Jt.link(ar,{stable:!0}))}function dr(gr){var Ge=fe.shader[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.shader,"."+gr,rr):De.set(lr.shader,"."+gr,Jt.link(rr,{stable:!0}))}}dr(O),dr(pt),Object.keys(fe.state).length>0&&(De(tr,".dirty=true;"),De.exit(tr,".dirty=true;")),De("a1(",Jt.shared.context,",a0,",Jt.batchId,");")}function Wt(Jt){if(!(typeof Jt!="object"||Jn(Jt))){for(var fe=Object.keys(Jt),De=0;De=0;--jo){var Rs=Oa[jo];Rs&&Rs(ma,null,0)}Vr.flush(),ia&&ia.update()}function No(){!Ya&&Oa.length>0&&(Ya=b.next(Eo))}function hs(){Ya&&(b.cancel(Eo),Ya=null)}function Xl(jo){jo.preventDefault(),hs(),Vo.forEach(function(Rs){Rs()})}function Rl(jo){Vr.getError(),Ai.restore(),Ca.restore(),Yi.restore(),no.restore(),Ri.restore(),ki.restore(),wi.restore(),ia&&ia.restore(),$a.procs.refresh(),No(),Bo.forEach(function(Rs){Rs()})}ua&&(ua.addEventListener(ml,Xl,!1),ua.addEventListener(yc,Rl,!1));function ys(){Oa.length=0,hs(),ua&&(ua.removeEventListener(ml,Xl),ua.removeEventListener(yc,Rl)),Ca.clear(),ki.clear(),Ri.clear(),wi.clear(),no.clear(),Ni.clear(),Yi.clear(),ia&&ia.clear(),za.forEach(function(jo){jo()})}function Dc(jo){function Rs(tr){var ar=f({},tr);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function dr(gr){if(gr in ar){var Ge=ar[gr];delete ar[gr],Object.keys(Ge).forEach(function(rr){ar[gr+"."+rr]=Ge[rr]})}}return dr("blend"),dr("depth"),dr("cull"),dr("stencil"),dr("polygonOffset"),dr("scissor"),dr("sample"),"vao"in tr&&(ar.vao=tr.vao),ar}function Fl(tr,ar){var dr={},gr={};return Object.keys(tr).forEach(function(Ge){var rr=tr[Ge];if(m.isDynamic(rr)){gr[Ge]=m.unbox(rr,Ge);return}else if(ar&&Array.isArray(rr)){for(var Je=0;Je0)return ke.call(this,De(tr|0),tr|0)}else if(Array.isArray(tr)){if(tr.length)return ke.call(this,tr,tr.length)}else return ve.call(this,tr)}return f(lr,{stats:wt,destroy:function(){Wt.destroy()}})}var Cl=ki.setFBO=Dc({framebuffer:m.define.call(null,oc,"framebuffer")});function Nc(jo,Rs){var Fl=0;$a.procs.poll();var Pl=Rs.color;Pl&&(Vr.clearColor(+Pl[0]||0,+Pl[1]||0,+Pl[2]||0,+Pl[3]||0),Fl|=ou),"depth"in Rs&&(Vr.clearDepth(+Rs.depth),Fl|=wc),"stencil"in Rs&&(Vr.clearStencil(Rs.stencil|0),Fl|=zo),Vr.clear(Fl)}function ku(jo){if("framebuffer"in jo)if(jo.framebuffer&&jo.framebuffer_reglType==="framebufferCube")for(var Rs=0;Rs<6;++Rs)Cl(f({framebuffer:jo.framebuffer.faces[Rs]},jo),Nc);else Cl(jo,Nc);else Nc(null,jo)}function Eu(jo){Oa.push(jo);function Rs(){var Fl=hc(Oa,jo);function Pl(){var Z=hc(Oa,Pl);Oa[Z]=Oa[Oa.length-1],Oa.length-=1,Oa.length<=0&&hs()}Oa[Fl]=Pl}return No(),{cancel:Rs}}function Ec(){var jo=la.viewport,Rs=la.scissor_box;jo[0]=jo[1]=Rs[0]=Rs[1]=0,ma.viewportWidth=ma.framebufferWidth=ma.drawingBufferWidth=jo[2]=Rs[2]=Vr.drawingBufferWidth,ma.viewportHeight=ma.framebufferHeight=ma.drawingBufferHeight=jo[3]=Rs[3]=Vr.drawingBufferHeight}function kc(){ma.tick+=1,ma.time=Xo(),Ec(),$a.procs.poll()}function zc(){no.refresh(),Ec(),$a.procs.refresh(),ia&&ia.update()}function Xo(){return(x()-Ia)/1e3}zc();function Oc(jo,Rs){var Fl;switch(jo){case"frame":return Eu(Rs);case"lost":Fl=Vo;break;case"restore":Fl=Bo;break;case"destroy":Fl=za;break}return Fl.push(Rs),{cancel:function(){for(var Pl=0;Pl=0},read:Ea,destroy:ys,_gl:Vr,_refresh:zc,poll:function(){kc(),ia&&ia.update()},now:Xo,stats:On,getCachedCode:xl,preloadCachedCode:jc});return Ir.onDone(null,Lu),Lu}return zh})}),pA=It((et,Y)=>{var f=gD(),y=mQ();Y.exports=function(z,P,n){var i=z._fullLayout,a=!0;return i._glcanvas.each(function(l){if(l.regl){l.regl.preloadCachedCode(n);return}if(!(l.pick&&!i._has("parcoords"))){try{l.regl=y({canvas:this,attributes:{antialias:!l.pick,preserveDrawingBuffer:!0},pixelRatio:z._context.plotGlPixelRatio||window.devicePixelRatio,extensions:P||[],cachedCode:n||{}})}catch{a=!1}l.regl||(a=!1),a&&this.addEventListener("webglcontextlost",function(o){z&&z.emit&&z.emit("plotly_webglcontextlost",{event:o,layer:l.key})},!1)}}),a||f({container:i._glcontainer.node()}),a}}),oz=It((m,Y)=>{var f=FD(),y=YD(),z=JJ(),P=pQ(),n=jn(),i=dm().selectMode,a=pA(),l=Fu(),o=eo(),c=OD().styleTextSelection,s={};function h(b,x,_,A){var d=b._size,k=b.width*A,w=b.height*A,D=d.l*A,E=d.b*A,I=d.r*A,M=d.t*A,p=d.w*A,g=d.h*A;return[D+x.domain[0]*p,E+_.domain[0]*g,k-I-(1-x.domain[1])*p,w-M-(1-_.domain[1])*g]}var m=Y.exports=function(b,x,_){if(_.length){var A=b._fullLayout,d=x._scene,k=x.xaxis,w=x.yaxis,D,E;if(d){var I=a(b,["ANGLE_instanced_arrays","OES_element_index_uint"],s);if(!I){d.init();return}var M=d.count,p=A._glcanvas.data()[0].regl;if(o(b,x,_),d.dirty){if((d.line2d||d.error2d)&&!(d.scatter2d||d.fill2d||d.glText)&&p.clear({color:!0,depth:!0}),d.error2d===!0&&(d.error2d=z(p)),d.line2d===!0&&(d.line2d=y(p)),d.scatter2d===!0&&(d.scatter2d=f(p)),d.fill2d===!0&&(d.fill2d=y(p)),d.glText===!0)for(d.glText=new Array(M),D=0;Dd.glText.length){var g=M-d.glText.length;for(D=0;Dmt&&(isNaN(J[dt])||isNaN(J[dt+1]));)dt-=2;ot.positions=J.slice(mt,dt+2)}return ot}),d.line2d.update(d.lineOptions)),d.error2d){var N=(d.errorXOptions||[]).concat(d.errorYOptions||[]);d.error2d.update(N)}d.scatter2d&&d.scatter2d.update(d.markerOptions),d.fillOrder=n.repeat(null,M),d.fill2d&&(d.fillOptions=d.fillOptions.map(function(ot,J){var mt=_[J];if(!(!ot||!mt||!mt[0]||!mt[0].trace)){var dt=mt[0],Ct=dt.trace,Rt=dt.t,Bt=d.lineOptions[J],Zt,Gt,ee=[];Ct._ownfill&&ee.push(J),Ct._nexttrace&&ee.push(J+1),ee.length&&(d.fillOrder[J]=ee);var xe=[],ge=Bt&&Bt.positions||Rt.positions,ye,ue;if(Ct.fill==="tozeroy"){for(ye=0;yeye&&isNaN(ge[ue+1]);)ue-=2;ge[ye+1]!==0&&(xe=[ge[ye],0]),xe=xe.concat(ge.slice(ye,ue+2)),ge[ue+1]!==0&&(xe=xe.concat([ge[ue],0]))}else if(Ct.fill==="tozerox"){for(ye=0;yeye&&isNaN(ge[ue]);)ue-=2;ge[ye]!==0&&(xe=[0,ge[ye+1]]),xe=xe.concat(ge.slice(ye,ue+2)),ge[ue]!==0&&(xe=xe.concat([0,ge[ue+1]]))}else if(Ct.fill==="toself"||Ct.fill==="tonext"){for(xe=[],Zt=0,ot.splitNull=!0,Gt=0;Gt-1;for(D=0;D{var f=YX();f.plot=oz(),Y.exports=f}),vQ=It((et,Y)=>{Y.exports=gQ()}),sz=It((et,Y)=>{var f=dd(),y=Ru(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=Lk(),a=fu().idRegex,l=Tc().templatedArray,o=Yn().extendFlat,c=f.marker,s=c.line,h=o(y("marker.line",{editTypeOverride:"calc"}),{width:o({},s.width,{editType:"calc"}),editType:"calc"}),m=o(y("marker"),{symbol:c.symbol,angle:c.angle,size:o({},c.size,{editType:"markerSize"}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:h,editType:"calc"});m.color.editType=m.cmin.editType=m.cmax.editType="style";function b(x){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:a[x],editType:"plot"}}}Y.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:o({},i.text,{}),hovertext:o({},i.hovertext,{}),hovertemplate:P(),hovertemplatefallback:n(),xhoverformat:z("x"),yhoverformat:z("y"),marker:m,xaxes:b("x"),yaxes:b("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:i.selected.marker,editType:"calc"},unselected:{marker:i.unselected.marker,editType:"calc"},opacity:i.opacity}}),mA=It((et,Y)=>{Y.exports=function(f,y,z,P){P||(P=1/0);var n,i;for(n=0;n{var f=jn(),y=Zf(),z=sz(),P=Fu(),n=Y0(),i=mA(),a=lA().isOpenSymbol;Y.exports=function(c,s,h,m){function b(E,I){return f.coerce(c,s,z,E,I)}var x=y(c,s,{name:"dimensions",handleItemDefaults:l}),_=b("diagonal.visible"),A=b("showupperhalf"),d=b("showlowerhalf"),k=i(s,x,"values");if(!k||!_&&!A&&!d){s.visible=!1;return}b("text"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("xhoverformat"),b("yhoverformat"),n(c,s,h,m,b,{noAngleRef:!0,noStandOff:!0});var w=a(s.marker.symbol),D=P.isBubble(s);b("marker.line.width",w||D?1:0),o(c,s,m,b),f.coerceSelectionMarkerOpacity(s,b)};function l(c,s){function h(b,x){return f.coerce(c,s,z.dimensions,b,x)}h("label");var m=h("values");m&&m.length?h("visible"):s.visible=!1,h("axis.type"),h("axis.matches")}function o(c,s,h,m){var b=s.dimensions,x=b.length,_=s.showupperhalf,A=s.showlowerhalf,d=s.diagonal.visible,k,w,D=new Array(x),E=new Array(x);for(k=0;kw&&_||k{var f=jn();Y.exports=function(y,z){var P=y._fullLayout,n=z.uid,i=P._splomScenes;i||(i=P._splomScenes={});var a={dirty:!0,selectBatch:[],unselectBatch:[]},l={matrix:!1,selectBatch:[],unselectBatch:[]},o=i[z.uid];return o||(o=i[n]=f.extendFlat({},a,l),o.draw=function(){o.matrix&&o.matrix.draw&&(o.selectBatch.length||o.unselectBatch.length?o.matrix.draw(o.unselectBatch,o.selectBatch):o.matrix.draw()),o.dirty=!1},o.destroy=function(){o.matrix&&o.matrix.destroy&&o.matrix.destroy(),o.matrixOptions=null,o.selectBatch=null,o.unselectBatch=null,o=null}),o.dirty||f.extendFlat(o,a),o}}),xQ=It((et,Y)=>{var f=jn(),y=Ku(),z=_e().calcMarkerSize,P=_e().calcAxisExpansion,n=Dm(),i=zb().markerSelection,a=zb().markerStyle,l=_Q(),o=Dr().BADNUM,c=G_().TOO_MANY_POINTS;Y.exports=function(s,h){var m=h.dimensions,b=h._length,x={},_=x.cdata=[],A=x.data=[],d=h._visibleDims=[],k,w,D,E,I;function M(N,B){for(var U=N.makeCalcdata({v:B.values,vcalendar:h.calendar},"v"),V=0;Vc,C;for(g?C=x.sizeAvg||Math.max(x.size,3):C=z(h,b),w=0;w{(function(){var f,y,z,P,n,i;typeof performance<"u"&&performance!==null&&performance.now?Y.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Y.exports=function(){return(f()-n)/1e6},y=process.hrtime,f=function(){var a;return a=y(),a[0]*1e9+a[1]},P=f(),i=process.uptime()*1e9,n=P-i):Date.now?(Y.exports=function(){return Date.now()-z},z=Date.now()):(Y.exports=function(){return new Date().getTime()-z},z=new Date().getTime())}).call(et)}),wQ=It((et,Y)=>{var f=bQ(),y=window,z=["moz","webkit"],P="AnimationFrame",n=y["request"+P],i=y["cancel"+P]||y["cancelRequest"+P];for(a=0;!n&&a{Y.exports=function(f,y){var z=typeof f=="number",P=typeof y=="number";z&&!P?(y=f,f=0):!z&&!P&&(f=0,y=0),f=f|0,y=y|0;var n=y-f;if(n<0)throw new Error("array length must be positive");for(var i=new Array(n),a=0,l=f;a{var f=FD(),y=t1(),z=Ib(),P=wQ(),n=kQ(),i=Yw(),a=Db();Y.exports=l;function l(h,m){if(!(this instanceof l))return new l(h);this.traces=[],this.passes={},this.regl=h,this.scatter=f(h),this.canvas=this.scatter.canvas}l.prototype.render=function(...h){return h.length&&this.update(...h),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=P(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,P(()=>{this.dirty=!1})),this)},l.prototype.update=function(...h){if(!h.length)return;for(let x=0;xS||!_.lower&&C{m[A+k]=x})}this.scatter.draw(...m)}return this},l.prototype.destroy=function(){return this.traces.forEach(h=>{h.buffer&&h.buffer.destroy&&h.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function o(h,m,b){let x=h.id!=null?h.id:h,_=m,A=b;return x<<16|(_&255)<<8|A&255}function c(h,m,b){let x,_,A,d,k=h[m],w=h[b];return k.length>2?(k[0],k[2],x=k[1],_=k[3]):k.length?(x=k[0],_=k[1]):(k.x,x=k.y,k.x+k.width,_=k.y+k.height),w.length>2?(A=w[0],d=w[2],w[1],w[3]):w.length?(A=w[0],d=w[1]):(A=w.x,w.y,d=w.x+w.width,w.y+w.height),[A,x,d,_]}function s(h){if(typeof h=="number")return[h,h,h,h];if(h.length===2)return[h[0],h[1],h[0],h[1]];{let m=i(h);return[m.x,m.y,m.x+m.width,m.y+m.height]}}}),SQ=It((et,Y)=>{var f=TQ(),y=jn(),z=Ku(),P=dm().selectMode;Y.exports=function(i,a,l){if(l.length)for(var o=0;o-1,W=P(_)||!!c.selectedpoints||V,F=!0;if(W){var H=c._length;if(c.selectedpoints){h.selectBatch=c.selectedpoints;var q=c.selectedpoints,G={};for(k=0;k{et.getDimIndex=function(Y,f){for(var y=f._id,z=y.charAt(0),P={x:0,y:1}[z],n=Y._visibleDims,i=0;i{var f=lz(),y=sA().calcHover,z=Fs().getFromId,P=Yn().extendFlat;function n(a,l,o,c,s){s||(s={});var h=(c||"").charAt(0)==="x",m=(c||"").charAt(0)==="y",b=i(a,l,o);if((h||m)&&s.hoversubplots==="axis"&&b[0])for(var x=(h?a.xa:a.ya)._subplotsWith,_=s.gd,A=P({},a),d=0;d{var f=jn(),y=f.pushUnique,z=Fu(),P=lz();Y.exports=function(n,i){var a=n.cd,l=a[0].trace,o=a[0].t,c=n.scene,s=c.matrixOptions.cdata,h=n.xaxis,m=n.yaxis,b=[];if(!c)return b;var x=!z.hasMarkers(l)&&!z.hasText(l);if(l.visible!==!0||x)return b;var _=P.getDimIndex(l,h),A=P.getDimIndex(l,m);if(_===!1||A===!1)return b;var d=o.xpx[_],k=o.ypx[A],w=s[_],D=s[A],E=(n.scene.selectBatch||[]).slice(),I=[];if(i!==!1&&!i.degenerate)for(var M=0;M{var f=jn(),y=Dm(),z=zb().markerStyle;Y.exports=function(P,n){var i=n.trace,a=P._fullLayout._splomScenes[i.uid];if(a){y(P,i),f.extendFlat(a.matrixOptions,z(P,i));var l=f.extendFlat({},a.matrixOptions,a.viewOpts);a.matrix.update(l,null)}}}),EQ=It((et,Y)=>{var f=ls(),y=jL();Y.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:sz(),supplyDefaults:yQ(),colorbar:Do(),calc:xQ(),plot:SQ(),hoverPoints:CQ().hoverPoints,selectPoints:AQ(),editStyle:MQ(),meta:{}},f.register(y)}),LQ=It((et,Y)=>{var f=YD(),y=ls(),z=pA(),P=Mf().getModuleCalcData,n=Fd(),i=Ku().getFromId,a=Fs().shouldShowZeroLine,l="splom",o={};function c(_){var A=_._fullLayout,d=y.getModule(l),k=P(_.calcdata,d)[0],w=z(_,["ANGLE_instanced_arrays","OES_element_index_uint"],o);w&&(A._hasOnlyLargeSploms&&m(_),d.plot(_,{},k))}function s(_){var A=_.calcdata,d=_._fullLayout;d._hasOnlyLargeSploms&&m(_);for(var k=0;k{var f=EQ();f.basePlotModule=LQ(),Y.exports=f}),IQ=It((et,Y)=>{Y.exports=PQ()}),cz=It((et,Y)=>{var f=Ru(),y=Gf(),z=hi(),P=Jh().attributes,n=Yn().extendFlat,i=Tc().templatedArray;Y.exports={domain:P({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:z({editType:"plot"}),tickfont:z({autoShadowDflt:!0,editType:"plot"}),rangefont:z({editType:"plot"}),dimensions:i("dimension",{label:{valType:"string",editType:"plot"},tickvals:n({},y.tickvals,{editType:"plot"}),ticktext:n({},y.ticktext,{editType:"plot"}),tickformat:n({},y.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:n({editType:"calc"},f("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),zk=It((et,Y)=>{Y.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}),e1=It((et,Y)=>{var f=T_();function y(z){return[z]}Y.exports={keyFun:function(z){return z.key},repeat:y,descend:f,wrap:y,unwrap:function(z){return z[0]}}}),uz=It((et,Y)=>{var f=zk(),y=Br(),z=e1().keyFun,P=e1().repeat,n=jn().sorterAsc,i=jn().strTranslate,a=f.bar.snapRatio;function l(G,tt){return G*(1-a)+tt*a}var o=f.bar.snapClose;function c(G,tt){return G*(1-o)+tt*o}function s(G,tt,ht,bt){if(h(ht,bt))return ht;var vt=G?-1:1,ut=0,rt=tt.length-1;if(vt<0){var gt=ut;ut=rt,rt=gt}for(var it=tt[ut],st=it,xt=ut;vt*xt=tt[ht][0]&&G<=tt[ht][1])return!0;return!1}function m(G){G.attr("x",-f.bar.captureWidth/2).attr("width",f.bar.captureWidth)}function b(G){G.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function x(G){if(!G.brush.filterSpecified)return"0,"+G.height;for(var tt=_(G.brush.filter.getConsolidated(),G.height),ht=[0],bt,vt,ut,rt=tt.length?tt[0][0]:null,gt=0;gtG[1]+ht||tt=.9*G[1]+.1*G[0]?"n":tt<=.9*G[0]+.1*G[1]?"s":"ns"}function d(){y.select(document.body).style("cursor",null)}function k(G){G.attr("stroke-dasharray",x)}function w(G,tt){var ht=y.select(G).selectAll(".highlight, .highlight-shadow"),bt=tt?ht.transition().duration(f.bar.snapDuration).each("end",tt):ht;k(bt)}function D(G,tt){var ht=G.brush,bt=ht.filterSpecified,vt=NaN,ut={},rt;if(bt){var gt=G.height,it=ht.filter.getConsolidated(),st=_(it,gt),xt=NaN,ot=NaN,J=NaN;for(rt=0;rt<=st.length;rt++){var mt=st[rt];if(mt&&mt[0]<=tt&&tt<=mt[1]){xt=rt;break}else if(ot=rt?rt-1:NaN,mt&&mt[0]>tt){J=rt;break}}if(vt=xt,isNaN(vt)&&(isNaN(ot)||isNaN(J)?vt=isNaN(ot)?J:ot:vt=tt-st[ot][1]=Zt[0]&&Bt<=Zt[1]){ut.clickableOrdinalRange=Zt;break}}}return ut}function E(G,tt){y.event.sourceEvent.stopPropagation();var ht=tt.height-y.mouse(G)[1]-2*f.verticalPadding,bt=tt.unitToPaddedPx.invert(ht),vt=tt.brush,ut=D(tt,ht),rt=ut.interval,gt=vt.svgBrush;if(gt.wasDragged=!1,gt.grabbingBar=ut.region==="ns",gt.grabbingBar){var it=rt.map(tt.unitToPaddedPx);gt.grabPoint=ht-it[0]-f.verticalPadding,gt.barLength=it[1]-it[0]}gt.clickableOrdinalRange=ut.clickableOrdinalRange,gt.stayingIntervals=tt.multiselect&&vt.filterSpecified?vt.filter.getConsolidated():[],rt&&(gt.stayingIntervals=gt.stayingIntervals.filter(function(st){return st[0]!==rt[0]&&st[1]!==rt[1]})),gt.startExtent=ut.region?rt[ut.region==="s"?1:0]:bt,tt.parent.inBrushDrag=!0,gt.brushStartCallback()}function I(G,tt){y.event.sourceEvent.stopPropagation();var ht=tt.height-y.mouse(G)[1]-2*f.verticalPadding,bt=tt.brush.svgBrush;bt.wasDragged=!0,bt._dragging=!0,bt.grabbingBar?bt.newExtent=[ht-bt.grabPoint,ht+bt.barLength-bt.grabPoint].map(tt.unitToPaddedPx.invert):bt.newExtent=[bt.startExtent,tt.unitToPaddedPx.invert(ht)].sort(n),tt.brush.filterSpecified=!0,bt.extent=bt.stayingIntervals.concat([bt.newExtent]),bt.brushCallback(tt),w(G.parentNode)}function M(G,tt){var ht=tt.brush,bt=ht.filter,vt=ht.svgBrush;vt._dragging||(p(G,tt),I(G,tt),tt.brush.svgBrush.wasDragged=!1),vt._dragging=!1;var ut=y.event;ut.sourceEvent.stopPropagation();var rt=vt.grabbingBar;if(vt.grabbingBar=!1,vt.grabLocation=void 0,tt.parent.inBrushDrag=!1,d(),!vt.wasDragged){vt.wasDragged=void 0,vt.clickableOrdinalRange?ht.filterSpecified&&tt.multiselect?vt.extent.push(vt.clickableOrdinalRange):(vt.extent=[vt.clickableOrdinalRange],ht.filterSpecified=!0):rt?(vt.extent=vt.stayingIntervals,vt.extent.length===0&&U(ht)):U(ht),vt.brushCallback(tt),w(G.parentNode),vt.brushEndCallback(ht.filterSpecified?bt.getConsolidated():[]);return}var gt=function(){bt.set(bt.getConsolidated())};if(tt.ordinal){var it=tt.unitTickvals;it[it.length-1]vt.newExtent[0];vt.extent=vt.stayingIntervals.concat(st?[vt.newExtent]:[]),vt.extent.length||U(ht),vt.brushCallback(tt),st?w(G.parentNode,gt):(gt(),w(G.parentNode))}else gt();vt.brushEndCallback(ht.filterSpecified?bt.getConsolidated():[])}function p(G,tt){var ht=tt.height-y.mouse(G)[1]-2*f.verticalPadding,bt=D(tt,ht),vt="crosshair";bt.clickableOrdinalRange?vt="pointer":bt.region&&(vt=bt.region+"-resize"),y.select(document.body).style("cursor",vt)}function g(G){G.on("mousemove",function(tt){y.event.preventDefault(),tt.parent.inBrushDrag||p(this,tt)}).on("mouseleave",function(tt){tt.parent.inBrushDrag||d()}).call(y.behavior.drag().on("dragstart",function(tt){E(this,tt)}).on("drag",function(tt){I(this,tt)}).on("dragend",function(tt){M(this,tt)}))}function C(G,tt){return G[0]-tt[0]}function S(G,tt,ht){var bt=ht._context.staticPlot,vt=G.selectAll(".background").data(P);vt.enter().append("rect").classed("background",!0).call(m).call(b).style("pointer-events",bt?"none":"auto").attr("transform",i(0,f.verticalPadding)),vt.call(g).attr("height",function(gt){return gt.height-f.verticalPadding});var ut=G.selectAll(".highlight-shadow").data(P);ut.enter().append("line").classed("highlight-shadow",!0).attr("x",-f.bar.width/2).attr("stroke-width",f.bar.width+f.bar.strokeWidth).attr("stroke",tt).attr("opacity",f.bar.strokeOpacity).attr("stroke-linecap","butt"),ut.attr("y1",function(gt){return gt.height}).call(k);var rt=G.selectAll(".highlight").data(P);rt.enter().append("line").classed("highlight",!0).attr("x",-f.bar.width/2).attr("stroke-width",f.bar.width-f.bar.strokeWidth).attr("stroke",f.bar.fillColor).attr("opacity",f.bar.fillOpacity).attr("stroke-linecap","butt"),rt.attr("y1",function(gt){return gt.height}).call(k)}function N(G,tt,ht){var bt=G.selectAll("."+f.cn.axisBrush).data(P,z);bt.enter().append("g").classed(f.cn.axisBrush,!0),S(bt,tt,ht)}function B(G){return G.svgBrush.extent.map(function(tt){return tt.slice()})}function U(G){G.filterSpecified=!1,G.svgBrush.extent=[[-1/0,1/0]]}function V(G){return function(tt){var ht=tt.brush,bt=B(ht),vt=bt.slice();ht.filter.set(vt),G()}}function W(G){for(var tt=G.slice(),ht=[],bt,vt=tt.shift();vt;){for(bt=vt.slice();(vt=tt.shift())&&vt[0]<=bt[1];)bt[1]=Math.max(bt[1],vt[1]);ht.push(bt)}return ht.length===1&&ht[0][0]>ht[0][1]&&(ht=[]),ht}function F(){var G=[],tt,ht;return{set:function(bt){G=bt.map(function(vt){return vt.slice().sort(n)}).sort(C),G.length===1&&G[0][0]===-1/0&&G[0][1]===1/0&&(G=[[0,-1]]),tt=W(G),ht=G.reduce(function(vt,ut){return[Math.min(vt[0],ut[0]),Math.max(vt[1],ut[1])]},[1/0,-1/0])},get:function(){return G.slice()},getConsolidated:function(){return tt},getBounds:function(){return ht}}}function H(G,tt,ht,bt,vt,ut){var rt=F();return rt.set(ht),{filter:rt,filterSpecified:tt,svgBrush:{extent:[],brushStartCallback:bt,brushCallback:V(vt),brushEndCallback:ut}}}function q(G,tt){if(Array.isArray(G[0])?(G=G.map(function(bt){return bt.sort(n)}),tt.multiselect?G=W(G.sort(C)):G=[G[0]]):G=[G.sort(n)],tt.tickvals){var ht=tt.tickvals.slice().sort(n);if(G=G.map(function(bt){var vt=[s(0,ht,bt[0],[]),s(1,ht,bt[1],[])];if(vt[1]>vt[0])return vt}).filter(function(bt){return bt}),!G.length)return}return G.length>1?G:G[0]}Y.exports={makeBrush:H,ensureAxisBrush:N,cleanRanges:q}}),DQ=It((et,Y)=>{var f=jn(),y=fp().hasColorscale,z=Cu(),P=Jh().defaults,n=Zf(),i=Fs(),a=cz(),l=uz(),o=zk().maxDimensionCount,c=mA();function s(m,b,x,_,A){var d=A("line.color",x);if(y(m,"line")&&f.isArrayOrTypedArray(d)){if(d.length)return A("line.colorscale"),z(m,b,_,A,{prefix:"line.",cLetter:"c"}),d.length;b.line.color=x}return 1/0}function h(m,b,x,_){function A(E,I){return f.coerce(m,b,a.dimensions,E,I)}var d=A("values"),k=A("visible");if(d&&d.length||(k=b.visible=!1),k){A("label"),A("tickvals"),A("ticktext"),A("tickformat");var w=A("range");b._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},i.setConvert(b._ax,_.layout),A("multiselect");var D=A("constraintrange");D&&(b.constraintrange=l.cleanRanges(D,b))}}Y.exports=function(m,b,x,_){function A(E,I){return f.coerce(m,b,a,E,I)}var d=m.dimensions;Array.isArray(d)&&d.length>o&&(f.log("parcoords traces support up to "+o+" dimensions at the moment"),d.splice(o));var k=n(m,b,{name:"dimensions",layout:_,handleItemDefaults:h}),w=s(m,b,x,_,A);P(b,_,A),(!Array.isArray(k)||!k.length)&&(b.visible=!1),c(b,k,"values",w);var D=f.extendFlat({},_.font,{size:Math.round(_.font.size/1.2)});f.coerceFont(A,"labelfont",D),f.coerceFont(A,"tickfont",D,{autoShadowDflt:!0}),f.coerceFont(A,"rangefont",D),A("labelangle"),A("labelside"),A("unselected.line.color"),A("unselected.line.opacity")}}),zQ=It((et,Y)=>{var f=jn().isArrayOrTypedArray,y=ch(),z=e1().wrap;Y.exports=function(n,i){var a,l;return y.hasColorscale(i,"line")&&f(i.line.color)?(a=i.line.color,l=y.extractOpts(i.line).colorscale,y.calc(n,i,{vals:a,containerStr:"line",cLetter:"c"})):(a=P(i._length),l=[[0,i.line.color],[1,i.line.color]]),z({lineColor:a,cscale:l})};function P(n){for(var i=new Array(n),a=0;a>>16,(et&65280)>>>8,et&255],alpha:1};if(typeof et=="number")return{space:"rgb",values:[et>>>16,(et&65280)>>>8,et&255],alpha:1};if(et=String(et).toLowerCase(),gA.default[et])z=gA.default[et].slice(),n="rgb";else if(et==="transparent")P=0,n="rgb",z=[0,0,0];else if(et[0]==="#"){var i=et.slice(1),a=i.length,l=a<=4;P=1,l?(z=[parseInt(i[0]+i[0],16),parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16)],a===4&&(P=parseInt(i[3]+i[3],16)/255)):(z=[parseInt(i[0]+i[1],16),parseInt(i[2]+i[3],16),parseInt(i[4]+i[5],16)],a===8&&(P=parseInt(i[6]+i[7],16)/255)),z[0]||(z[0]=0),z[1]||(z[1]=0),z[2]||(z[2]=0),n="rgb"}else if(y=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(et)){var o=y[1];n=o.replace(/a$/,"");var c=n==="cmyk"?4:n==="gray"?1:3;z=y[2].trim().split(/\s*[,\/]\s*|\s+/),n==="color"&&(n=z.shift()),z=z.map(function(s,h){if(s[s.length-1]==="%")return s=parseFloat(s)/100,h===3?s:n==="rgb"?s*255:n[0]==="h"||n[0]==="l"&&!h?s*100:n==="lab"?s*125:n==="lch"?h<2?s*150:s*360:n[0]==="o"&&!h?s:n==="oklab"?s*.4:n==="oklch"?h<2?s*.4:s*360:s;if(n[h]==="h"||h===2&&n[n.length-1]==="h"){if(vA[s]!==void 0)return vA[s];if(s.endsWith("deg"))return parseFloat(s);if(s.endsWith("turn"))return parseFloat(s)*360;if(s.endsWith("grad"))return parseFloat(s)*360/400;if(s.endsWith("rad"))return parseFloat(s)*180/Math.PI}return s==="none"?0:parseFloat(s)}),P=z.length>c?z.pop():1}else/[0-9](?:\s|\/|,)/.test(et)&&(z=et.match(/([0-9]+)/g).map(function(s){return parseFloat(s)}),n=((f=(Y=et.match(/([a-z])/ig))==null?void 0:Y.join(""))==null?void 0:f.toLowerCase())||"rgb");return{space:n,values:z,alpha:P}}var gA,hz,vA,BQ=kr(()=>{gA=Mr(fD()),hz=OQ,vA={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),Ok,dz=kr(()=>{Ok={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),Bk,RQ=kr(()=>{dz(),Bk={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(et){var Y=et[0]/360,f=et[1]/100,y=et[2]/100,z,P,n,i,a,l=0;if(f===0)return a=y*255,[a,a,a];for(P=y<.5?y*(1+f):y+f-y*f,z=2*y-P,i=[0,0,0];l<3;)n=Y+1/3*-(l-1),n<0?n++:n>1&&n--,a=6*n<1?z+(P-z)*6*n:2*n<1?P:3*n<2?z+(P-z)*(2/3-n)*6:z,i[l++]=a*255;return i}},Ok.hsl=function(et){var Y=et[0]/255,f=et[1]/255,y=et[2]/255,z=Math.min(Y,f,y),P=Math.max(Y,f,y),n=P-z,i,a,l;return P===z?i=0:Y===P?i=(f-y)/n:f===P?i=2+(y-Y)/n:y===P&&(i=4+(Y-f)/n),i=Math.min(i*60,360),i<0&&(i+=360),l=(z+P)/2,P===z?a=0:l<=.5?a=n/(P+z):a=n/(2-P-z),[i,a*100,l*100]}}),fz={};rn(fz,{default:()=>FQ});function FQ(et){Array.isArray(et)&&et.raw&&(et=String.raw(...arguments)),et instanceof Number&&(et=+et);var Y,f=hz(et);if(!f.space)return[];let y=f.space[0]==="h"?Bk.min:Ok.min,z=f.space[0]==="h"?Bk.max:Ok.max;return Y=Array(3),Y[0]=Math.min(Math.max(f.values[0],y[0]),z[0]),Y[1]=Math.min(Math.max(f.values[1],y[1]),z[1]),Y[2]=Math.min(Math.max(f.values[2],y[2]),z[2]),f.space[0]==="h"&&(Y=Bk.rgb(Y)),Y.push(Math.min(Math.max(f.alpha,0),1)),Y}var NQ=kr(()=>{BQ(),dz(),RQ()}),pz=It(et=>{var Y=jn().isTypedArray;et.convertTypedArray=function(f){return Y(f)?Array.prototype.slice.call(f):f},et.isOrdinal=function(f){return!!f.tickvals},et.isVisible=function(f){return f.visible||!("visible"in f)}}),jQ=It((et,Y)=>{var f=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),oi;if(Ir&&(oi=Au(En),Ir[oi]))return Ir[oi].apply(null,Ai);var Yi=Function.apply(null,ri.concat(En));return Ir&&(Ir[oi]=Yi),Yi.apply(null,Ai)}return{global:Ia,link:On,block:Si,proc:eo,scope:ha,cond:aa,compile:ma}}var uo="xyzw".split(""),Sa=5121,Za=1,Ra=2,pa=0,_o=1,fs=2,os=3,gs=4,ws=5,bo=6,lo="dither",ks="blend.enable",dl="blend.color",Vl="blend.equation",gc="blend.func",ec="depth.enable",vc="depth.func",El="depth.range",tu="depth.mask",$c="colorMask",bc="cull.enable",qo="cull.face",Bs="frontFace",ac="lineWidth",Zl="polygonOffset.enable",Mu="polygonOffset.offset",eh="sample.alpha",Vu="sample.enable",Wh="sample.coverage",rh="stencil.enable",qh="stencil.mask",Wc="stencil.func",Gh="stencil.opFront",ds="stencil.opBack",$s="scissor.enable",nh="scissor.box",eu="viewport",lf="profile",Kt="framebuffer",O="vert",pt="frag",Dt="elements",Ft="primitive",qt="count",Ee="offset",je="instances",er="vao",wr="Width",Gr="Height",Zr=Kt+wr,Tn=Kt+Gr,qn=eu+wr,te=eu+Gr,le="drawingBuffer",Te=le+wr,Pe=le+Gr,We=[gc,Vl,Wc,Gh,ds,Wh,eu,nh,Mu],Ne=34962,Xe=34963,Pr=2884,qr=3042,Xr=3024,gn=2960,zn=2929,Qn=3089,ai=32823,Ti=32926,Qi=32928,Ma=5126,Aa=35664,Fa=35665,wo=35666,Yo=5124,Fo=35667,xs=35668,Sl=35669,Ll=35670,Ws=35671,zl=35672,Fc=35673,Sc=35674,rl=35675,nl=35676,au=35678,wu=35680,ih=4,Et=1028,Vt=1029,de=2304,Ie=2305,Be=32775,He=32776,hr=519,cr=7680,Fr=0,vn=1,fn=32774,Bn=513,ti=36160,ei=36064,ra={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},si={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Oi={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$i={cw:de,ccw:Ie};function Ki(Se){return Array.isArray(Se)||dn(Se)||_n(Se)}function sa(Se){return Se.sort(function(Ir,Vr){return Ir===eu?-1:Vr===eu?1:Ir=1,ri>=2,Ir)}else if(Vr===gs){var Ai=Se.data;return new vi(Ai.thisDep,Ai.contextDep,Ai.propDep,Ir)}else{if(Vr===ws)return new vi(!1,!1,!1,Ir);if(Vr===bo){for(var bi=!1,On=!1,Si=!1,ha=0;ha=1&&(On=!0),Ia>=2&&(Si=!0)}else aa.type===gs&&(bi=bi||aa.data.thisDep,On=On||aa.data.contextDep,Si=Si||aa.data.propDep)}return new vi(bi,On,Si,Ir)}else return new vi(Vr===os,Vr===fs,Vr===_o,Ir)}}var $o=new vi(!1,!1,!1,function(){});function Ko(Se,Ir,Vr,ri,Ai,bi,On,Si,ha,aa,Ia,co,eo,ma,ji,En){var oi=aa.Record,Yi={add:32774,subtract:32778,"reverse subtract":32779};Vr.ext_blend_minmax&&(Yi.min=Be,Yi.max=He);var Ni=Vr.angle_instanced_arrays,wi=Vr.webgl_draw_buffers,Ua=Vr.oes_vertex_array_object,Ca={dirty:!0,profile:En.profile},io={},Ri=[],ki={},$a={};function Ea(Jt){return Jt.replace(".","_")}function la(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),io[lr]=Ca[lr]=!!De,ki[lr]=fe}function ua(Jt,fe,De){var lr=Ea(Jt);Ri.push(Jt),Array.isArray(De)?(Ca[lr]=De.slice(),io[lr]=De.slice()):Ca[lr]=io[lr]=De,$a[lr]=fe}function Oa(Jt){return!!isNaN(Jt)}la(lo,Xr),la(ks,qr),ua(dl,"blendColor",[0,0,0,0]),ua(Vl,"blendEquationSeparate",[fn,fn]),ua(gc,"blendFuncSeparate",[vn,Fr,vn,Fr]),la(ec,zn,!0),ua(vc,"depthFunc",Bn),ua(El,"depthRange",[0,1]),ua(tu,"depthMask",!0),ua($c,$c,[!0,!0,!0,!0]),la(bc,Pr),ua(qo,"cullFace",Vt),ua(Bs,Bs,Ie),ua(ac,ac,1),la(Zl,ai),ua(Mu,"polygonOffset",[0,0]),la(eh,Ti),la(Vu,Qi),ua(Wh,"sampleCoverage",[1,!1]),la(rh,gn),ua(qh,"stencilMask",-1),ua(Wc,"stencilFunc",[hr,0,-1]),ua(Gh,"stencilOpSeparate",[Et,cr,cr,cr]),ua(ds,"stencilOpSeparate",[Vt,cr,cr,cr]),la($s,Qn),ua(nh,"scissor",[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]),ua(eu,eu,[0,0,Se.drawingBufferWidth,Se.drawingBufferHeight]);var Vo={gl:Se,context:eo,strings:Ir,next:io,current:Ca,draw:co,elements:bi,buffer:Ai,shader:Ia,attributes:aa.state,vao:aa,uniforms:ha,framebuffer:Si,extensions:Vr,timer:ma,isBufferArgs:Ki},Bo={primTypes:Ei,compareFuncs:si,blendFuncs:ra,blendEquations:Yi,stencilOps:Oi,glTypes:ci,orientationType:$i};wi&&(Bo.backBuffer=[Vt],Bo.drawBuffer=p(ri.maxDrawbuffers,function(Jt){return Jt===0?[0]:p(Jt,function(fe){return ei+fe})}));var za=0;function Ya(){var Jt=Qa({cache:ji}),fe=Jt.link,De=Jt.global;Jt.id=za++,Jt.batchId="0";var lr=fe(Vo),tr=Jt.shared={props:"a0"};Object.keys(Vo).forEach(function(rr){tr[rr]=De.def(lr,".",rr)});var ar=Jt.next={},dr=Jt.current={};Object.keys($a).forEach(function(rr){Array.isArray(Ca[rr])&&(ar[rr]=De.def(tr.next,".",rr),dr[rr]=De.def(tr.current,".",rr))});var gr=Jt.constants={};Object.keys(Bo).forEach(function(rr){gr[rr]=De.def(JSON.stringify(Bo[rr]))}),Jt.invoke=function(rr,Je){switch(Je.type){case pa:var Hr=["this",tr.context,tr.props,Jt.batchId];return rr.def(fe(Je.data),".call(",Hr.slice(0,Math.max(Je.data.length+1,4)),")");case _o:return rr.def(tr.props,Je.data);case fs:return rr.def(tr.context,Je.data);case os:return rr.def("this",Je.data);case gs:return Je.data.append(Jt,rr),Je.data.ref;case ws:return Je.data.toString();case bo:return Je.data.map(function(wn){return Jt.invoke(rr,wn)})}},Jt.attribCache={};var Ge={};return Jt.scopeAttrib=function(rr){var Je=Ir.id(rr);if(Je in Ge)return Ge[Je];var Hr=aa.scope[Je];Hr||(Hr=aa.scope[Je]=new oi);var wn=Ge[Je]=fe(Hr);return wn},Jt}function Eo(Jt){var fe=Jt.static,De=Jt.dynamic,lr;if(lf in fe){var tr=!!fe[lf];lr=ao(function(dr,gr){return tr}),lr.enable=tr}else if(lf in De){var ar=De[lf];lr=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}return lr}function No(Jt,fe){var De=Jt.static,lr=Jt.dynamic;if(Kt in De){var tr=De[Kt];return tr?(tr=Si.getFramebuffer(tr),ao(function(dr,gr){var Ge=dr.link(tr),rr=dr.shared;gr.set(rr.framebuffer,".next",Ge);var Je=rr.context;return gr.set(Je,"."+Zr,Ge+".width"),gr.set(Je,"."+Tn,Ge+".height"),Ge})):ao(function(dr,gr){var Ge=dr.shared;gr.set(Ge.framebuffer,".next","null");var rr=Ge.context;return gr.set(rr,"."+Zr,rr+"."+Te),gr.set(rr,"."+Tn,rr+"."+Pe),"null"})}else if(Kt in lr){var ar=lr[Kt];return xo(ar,function(dr,gr){var Ge=dr.invoke(gr,ar),rr=dr.shared,Je=rr.framebuffer,Hr=gr.def(Je,".getFramebuffer(",Ge,")");gr.set(Je,".next",Hr);var wn=rr.context;return gr.set(wn,"."+Zr,Hr+"?"+Hr+".width:"+wn+"."+Te),gr.set(wn,"."+Tn,Hr+"?"+Hr+".height:"+wn+"."+Pe),Hr})}else return null}function hs(Jt,fe,De){var lr=Jt.static,tr=Jt.dynamic;function ar(Ge){if(Ge in lr){var rr=lr[Ge],Je=!0,Hr=rr.x|0,wn=rr.y|0,Ln,Ii;return"width"in rr?Ln=rr.width|0:Je=!1,"height"in rr?Ii=rr.height|0:Je=!1,new vi(!Je&&fe&&fe.thisDep,!Je&&fe&&fe.contextDep,!Je&&fe&&fe.propDep,function(Vi,Di){var da=Vi.shared.context,Hi=Ln;"width"in rr||(Hi=Di.def(da,".",Zr,"-",Hr));var Wi=Ii;return"height"in rr||(Wi=Di.def(da,".",Tn,"-",wn)),[Hr,wn,Hi,Wi]})}else if(Ge in tr){var Mi=tr[Ge],gi=xo(Mi,function(Vi,Di){var da=Vi.invoke(Di,Mi),Hi=Vi.shared.context,Wi=Di.def(da,".x|0"),wa=Di.def(da,".y|0"),vo=Di.def('"width" in ',da,"?",da,".width|0:","(",Hi,".",Zr,"-",Wi,")"),So=Di.def('"height" in ',da,"?",da,".height|0:","(",Hi,".",Tn,"-",wa,")");return[Wi,wa,vo,So]});return fe&&(gi.thisDep=gi.thisDep||fe.thisDep,gi.contextDep=gi.contextDep||fe.contextDep,gi.propDep=gi.propDep||fe.propDep),gi}else return fe?new vi(fe.thisDep,fe.contextDep,fe.propDep,function(Vi,Di){var da=Vi.shared.context;return[0,0,Di.def(da,".",Zr),Di.def(da,".",Tn)]}):null}var dr=ar(eu);if(dr){var gr=dr;dr=new vi(dr.thisDep,dr.contextDep,dr.propDep,function(Ge,rr){var Je=gr.append(Ge,rr),Hr=Ge.shared.context;return rr.set(Hr,"."+qn,Je[2]),rr.set(Hr,"."+te,Je[3]),Je})}return{viewport:dr,scissor_box:ar(nh)}}function Xl(Jt,fe){var De=Jt.static,lr=typeof De[pt]=="string"&&typeof De[O]=="string";if(lr){if(Object.keys(fe.dynamic).length>0)return null;var tr=fe.static,ar=Object.keys(tr);if(ar.length>0&&typeof tr[ar[0]]=="number"){for(var dr=[],gr=0;gr"+Wi+"?"+Je+".constant["+Wi+"]:0;"}).join(""),"}}else{","if(",Ln,"(",Je,".buffer)){",Vi,"=",Ii,".createStream(",Ne,",",Je,".buffer);","}else{",Vi,"=",Ii,".getBuffer(",Je,".buffer);","}",Di,'="type" in ',Je,"?",wn.glTypes,"[",Je,".type]:",Vi,".dtype;",Mi.normalized,"=!!",Je,".normalized;");function da(Hi){rr(Mi[Hi],"=",Je,".",Hi,"|0;")}return da("size"),da("offset"),da("stride"),da("divisor"),rr("}}"),rr.exit("if(",Mi.isStream,"){",Ii,".destroyStream(",Vi,");","}"),Mi}tr[ar]=xo(dr,gr)}),tr}function ku(Jt){var fe=Jt.static,De=Jt.dynamic,lr={};return Object.keys(fe).forEach(function(tr){var ar=fe[tr];lr[tr]=ao(function(dr,gr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:dr.link(ar)})}),Object.keys(De).forEach(function(tr){var ar=De[tr];lr[tr]=xo(ar,function(dr,gr){return dr.invoke(gr,ar)})}),lr}function Eu(Jt,fe,De,lr,tr){Jt.static,Jt.dynamic;var ar=Xl(Jt,fe),dr=No(Jt),gr=hs(Jt,dr),Ge=ys(Jt),rr=Dc(Jt),Je=Rl(Jt,tr,ar);function Hr(Vi){var Di=gr[Vi];Di&&(rr[Vi]=Di)}Hr(eu),Hr(Ea(nh));var wn=Object.keys(rr).length>0,Ln={framebuffer:dr,draw:Ge,shader:Je,state:rr,dirty:wn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ln.profile=Eo(Jt),Ln.uniforms=Cl(De),Ln.drawVAO=Ln.scopeVAO=Ge.vao,!Ln.drawVAO&&Je.program&&!ar&&Vr.angle_instanced_arrays&&Ge.static.elements){var Ii=!0,Mi=Je.program.attributes.map(function(Vi){var Di=fe.static[Vi];return Ii=Ii&&!!Di,Di});if(Ii&&Mi.length>0){var gi=aa.getVAO(aa.createVAO({attributes:Mi,elements:Ge.static.elements}));Ln.drawVAO=new vi(null,null,null,function(Vi,Di){return Vi.link(gi)}),Ln.useVAO=!0}}return ar?Ln.useVAO=!0:Ln.attributes=Nc(fe),Ln.context=ku(lr),Ln}function Ec(Jt,fe,De){var lr=Jt.shared,tr=lr.context,ar=Jt.scope();Object.keys(De).forEach(function(dr){fe.save(tr,"."+dr);var gr=De[dr],Ge=gr.append(Jt,fe);Array.isArray(Ge)?ar(tr,".",dr,"=[",Ge.join(),"];"):ar(tr,".",dr,"=",Ge,";")}),fe(ar)}function kc(Jt,fe,De,lr){var tr=Jt.shared,ar=tr.gl,dr=tr.framebuffer,gr;wi&&(gr=fe.def(tr.extensions,".webgl_draw_buffers"));var Ge=Jt.constants,rr=Ge.drawBuffer,Je=Ge.backBuffer,Hr;De?Hr=De.append(Jt,fe):Hr=fe.def(dr,".next"),lr||fe("if(",Hr,"!==",dr,".cur){"),fe("if(",Hr,"){",ar,".bindFramebuffer(",ti,",",Hr,".framebuffer);"),wi&&fe(gr,".drawBuffersWEBGL(",rr,"[",Hr,".colorAttachments.length]);"),fe("}else{",ar,".bindFramebuffer(",ti,",null);"),wi&&fe(gr,".drawBuffersWEBGL(",Je,");"),fe("}",dr,".cur=",Hr,";"),lr||fe("}")}function zc(Jt,fe,De){var lr=Jt.shared,tr=lr.gl,ar=Jt.current,dr=Jt.next,gr=lr.current,Ge=lr.next,rr=Jt.cond(gr,".dirty");Ri.forEach(function(Je){var Hr=Ea(Je);if(!(Hr in De.state)){var wn,Ln;if(Hr in dr){wn=dr[Hr],Ln=ar[Hr];var Ii=p(Ca[Hr].length,function(gi){return rr.def(wn,"[",gi,"]")});rr(Jt.cond(Ii.map(function(gi,Vi){return gi+"!=="+Ln+"["+Vi+"]"}).join("||")).then(tr,".",$a[Hr],"(",Ii,");",Ii.map(function(gi,Vi){return Ln+"["+Vi+"]="+gi}).join(";"),";"))}else{wn=rr.def(Ge,".",Hr);var Mi=Jt.cond(wn,"!==",gr,".",Hr);rr(Mi),Hr in ki?Mi(Jt.cond(wn).then(tr,".enable(",ki[Hr],");").else(tr,".disable(",ki[Hr],");"),gr,".",Hr,"=",wn,";"):Mi(tr,".",$a[Hr],"(",wn,");",gr,".",Hr,"=",wn,";")}}}),Object.keys(De.state).length===0&&rr(gr,".dirty=false;"),fe(rr)}function Xo(Jt,fe,De,lr){var tr=Jt.shared,ar=Jt.current,dr=tr.current,gr=tr.gl,Ge;sa(Object.keys(De)).forEach(function(rr){var Je=De[rr];if(!(lr&&!lr(Je))){var Hr=Je.append(Jt,fe);if(ki[rr]){var wn=ki[rr];no(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(Jt.cond(Ge).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Ge,";")):(fe(Jt.cond(Hr).then(gr,".enable(",wn,");").else(gr,".disable(",wn,");")),fe(dr,".",rr,"=",Hr,";"))}else if(Jn(Hr)){var Ln=ar[rr];fe(gr,".",$a[rr],"(",Hr,");",Hr.map(function(Ii,Mi){return Ln+"["+Mi+"]="+Ii}).join(";"),";")}else no(Je)?(Ge=Jt.link(Hr,{stable:!0}),fe(gr,".",$a[rr],"(",Ge,");",dr,".",rr,"=",Ge,";")):fe(gr,".",$a[rr],"(",Hr,");",dr,".",rr,"=",Hr,";")}})}function Oc(Jt,fe){Ni&&(Jt.instancing=fe.def(Jt.shared.extensions,".angle_instanced_arrays"))}function xl(Jt,fe,De,lr,tr){var ar=Jt.shared,dr=Jt.stats,gr=ar.current,Ge=ar.timer,rr=De.profile;function Je(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Hr,wn;function Ln(da){Hr=fe.def(),da(Hr,"=",Je(),";"),typeof tr=="string"?da(dr,".count+=",tr,";"):da(dr,".count++;"),ma&&(lr?(wn=fe.def(),da(wn,"=",Ge,".getNumPendingQueries();")):da(Ge,".beginQuery(",dr,");"))}function Ii(da){da(dr,".cpuTime+=",Je(),"-",Hr,";"),ma&&(lr?da(Ge,".pushScopeStats(",wn,",",Ge,".getNumPendingQueries(),",dr,");"):da(Ge,".endQuery();"))}function Mi(da){var Hi=fe.def(gr,".profile");fe(gr,".profile=",da,";"),fe.exit(gr,".profile=",Hi,";")}var gi;if(rr){if(no(rr)){rr.enable?(Ln(fe),Ii(fe.exit),Mi("true")):Mi("false");return}gi=rr.append(Jt,fe),Mi(gi)}else gi=fe.def(gr,".profile");var Vi=Jt.block();Ln(Vi),fe("if(",gi,"){",Vi,"}");var Di=Jt.block();Ii(Di),fe.exit("if(",gi,"){",Di,"}")}function jc(Jt,fe,De,lr,tr){var ar=Jt.shared;function dr(Ge){switch(Ge){case Aa:case Fo:case Ws:return 2;case Fa:case xs:case zl:return 3;case wo:case Sl:case Fc:return 4;default:return 1}}function gr(Ge,rr,Je){var Hr=ar.gl,wn=fe.def(Ge,".location"),Ln=fe.def(ar.attributes,"[",wn,"]"),Ii=Je.state,Mi=Je.buffer,gi=[Je.x,Je.y,Je.z,Je.w],Vi=["buffer","normalized","offset","stride"];function Di(){fe("if(!",Ln,".buffer){",Hr,".enableVertexAttribArray(",wn,");}");var Hi=Je.type,Wi;if(Je.size?Wi=fe.def(Je.size,"||",rr):Wi=rr,fe("if(",Ln,".type!==",Hi,"||",Ln,".size!==",Wi,"||",Vi.map(function(vo){return Ln+"."+vo+"!=="+Je[vo]}).join("||"),"){",Hr,".bindBuffer(",Ne,",",Mi,".buffer);",Hr,".vertexAttribPointer(",[wn,Wi,Hi,Je.normalized,Je.stride,Je.offset],");",Ln,".type=",Hi,";",Ln,".size=",Wi,";",Vi.map(function(vo){return Ln+"."+vo+"="+Je[vo]+";"}).join(""),"}"),Ni){var wa=Je.divisor;fe("if(",Ln,".divisor!==",wa,"){",Jt.instancing,".vertexAttribDivisorANGLE(",[wn,wa],");",Ln,".divisor=",wa,";}")}}function da(){fe("if(",Ln,".buffer){",Hr,".disableVertexAttribArray(",wn,");",Ln,".buffer=null;","}if(",uo.map(function(Hi,Wi){return Ln+"."+Hi+"!=="+gi[Wi]}).join("||"),"){",Hr,".vertexAttrib4f(",wn,",",gi,");",uo.map(function(Hi,Wi){return Ln+"."+Hi+"="+gi[Wi]+";"}).join(""),"}")}Ii===Za?Di():Ii===Ra?da():(fe("if(",Ii,"===",Za,"){"),Di(),fe("}else{"),da(),fe("}"))}lr.forEach(function(Ge){var rr=Ge.name,Je=De.attributes[rr],Hr;if(Je){if(!tr(Je))return;Hr=Je.append(Jt,fe)}else{if(!tr($o))return;var wn=Jt.scopeAttrib(rr);Hr={},Object.keys(new oi).forEach(function(Ln){Hr[Ln]=fe.def(wn,".",Ln)})}gr(Jt.link(Ge),dr(Ge.info.type),Hr)})}function Lu(Jt,fe,De,lr,tr,ar){for(var dr=Jt.shared,gr=dr.gl,Ge,rr=0;rr1){for(var ns=[],As=[],Wl=0;Wl>1)",Mi],");")}function wa(){De(gi,".drawArraysInstancedANGLE(",[wn,Ln,Ii,Mi],");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}function Hi(){function Wi(){De(ar+".drawElements("+[wn,Ii,Vi,Ln+"<<(("+Vi+"-"+Sa+")>>1)"]+");")}function wa(){De(ar+".drawArrays("+[wn,Ln,Ii]+");")}Je&&Je!=="null"?Di?Wi():(De("if(",Je,"){"),Wi(),De("}else{"),wa(),De("}")):wa()}Ni&&(typeof Mi!="number"||Mi>=0)?typeof Mi=="string"?(De("if(",Mi,">0){"),da(),De("}else if(",Mi,"<0){"),Hi(),De("}")):da():Hi()}function Rs(Jt,fe,De,lr,tr){var ar=Ya(),dr=ar.proc("body",tr);return Ni&&(ar.instancing=dr.def(ar.shared.extensions,".angle_instanced_arrays")),Jt(ar,dr,De,lr),ar.compile().body}function Fl(Jt,fe,De,lr){Oc(Jt,fe),De.useVAO?De.drawVAO?fe(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,fe),");"):fe(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(fe(Jt.shared.vao,".setVAO(null);"),jc(Jt,fe,De,lr.attributes,function(){return!0})),Lu(Jt,fe,De,lr.uniforms,function(){return!0},!1),jo(Jt,fe,fe,De)}function Pl(Jt,fe){var De=Jt.proc("draw",1);Oc(Jt,De),Ec(Jt,De,fe.context),kc(Jt,De,fe.framebuffer),zc(Jt,De,fe),Xo(Jt,De,fe.state),xl(Jt,De,fe,!1,!0);var lr=fe.shader.progVar.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",lr,".program);"),fe.shader.program)Fl(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var tr=Jt.global.def("{}"),ar=De.def(lr,".id"),dr=De.def(tr,"[",ar,"]");De(Jt.cond(dr).then(dr,".call(this,a0);").else(dr,"=",tr,"[",ar,"]=",Jt.link(function(gr){return Rs(Fl,Jt,fe,gr,1)}),"(",lr,");",dr,".call(this,a0);"))}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function Z(Jt,fe,De,lr){Jt.batchId="a1",Oc(Jt,fe);function tr(){return!0}jc(Jt,fe,De,lr.attributes,tr),Lu(Jt,fe,De,lr.uniforms,tr,!1),jo(Jt,fe,fe,De)}function lt(Jt,fe,De,lr){Oc(Jt,fe);var tr=De.contextDep,ar=fe.def(),dr="a0",gr="a1",Ge=fe.def();Jt.shared.props=Ge,Jt.batchId=ar;var rr=Jt.scope(),Je=Jt.scope();fe(rr.entry,"for(",ar,"=0;",ar,"<",gr,";++",ar,"){",Ge,"=",dr,"[",ar,"];",Je,"}",rr.exit);function Hr(Vi){return Vi.contextDep&&tr||Vi.propDep}function wn(Vi){return!Hr(Vi)}if(De.needsContext&&Ec(Jt,Je,De.context),De.needsFramebuffer&&kc(Jt,Je,De.framebuffer),Xo(Jt,Je,De.state,Hr),De.profile&&Hr(De.profile)&&xl(Jt,Je,De,!1,!0),lr)De.useVAO?De.drawVAO?Hr(De.drawVAO)?Je(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,Je),");"):rr(Jt.shared.vao,".setVAO(",De.drawVAO.append(Jt,rr),");"):rr(Jt.shared.vao,".setVAO(",Jt.shared.vao,".targetVAO);"):(rr(Jt.shared.vao,".setVAO(null);"),jc(Jt,rr,De,lr.attributes,wn),jc(Jt,Je,De,lr.attributes,Hr)),Lu(Jt,rr,De,lr.uniforms,wn,!1),Lu(Jt,Je,De,lr.uniforms,Hr,!0),jo(Jt,rr,Je,De);else{var Ln=Jt.global.def("{}"),Ii=De.shader.progVar.append(Jt,Je),Mi=Je.def(Ii,".id"),gi=Je.def(Ln,"[",Mi,"]");Je(Jt.shared.gl,".useProgram(",Ii,".program);","if(!",gi,"){",gi,"=",Ln,"[",Mi,"]=",Jt.link(function(Vi){return Rs(Z,Jt,De,Vi,2)}),"(",Ii,");}",gi,".call(this,a0[",ar,"],",ar,");")}}function nt(Jt,fe){var De=Jt.proc("batch",2);Jt.batchId="0",Oc(Jt,De);var lr=!1,tr=!0;Object.keys(fe.context).forEach(function(Ln){lr=lr||fe.context[Ln].propDep}),lr||(Ec(Jt,De,fe.context),tr=!1);var ar=fe.framebuffer,dr=!1;ar?(ar.propDep?lr=dr=!0:ar.contextDep&&lr&&(dr=!0),dr||kc(Jt,De,ar)):kc(Jt,De,null),fe.state.viewport&&fe.state.viewport.propDep&&(lr=!0);function gr(Ln){return Ln.contextDep&&lr||Ln.propDep}zc(Jt,De,fe),Xo(Jt,De,fe.state,function(Ln){return!gr(Ln)}),(!fe.profile||!gr(fe.profile))&&xl(Jt,De,fe,!1,"a1"),fe.contextDep=lr,fe.needsContext=tr,fe.needsFramebuffer=dr;var Ge=fe.shader.progVar;if(Ge.contextDep&&lr||Ge.propDep)lt(Jt,De,fe,null);else{var rr=Ge.append(Jt,De);if(De(Jt.shared.gl,".useProgram(",rr,".program);"),fe.shader.program)lt(Jt,De,fe,fe.shader.program);else{De(Jt.shared.vao,".setVAO(null);");var Je=Jt.global.def("{}"),Hr=De.def(rr,".id"),wn=De.def(Je,"[",Hr,"]");De(Jt.cond(wn).then(wn,".call(this,a0,a1);").else(wn,"=",Je,"[",Hr,"]=",Jt.link(function(Ln){return Rs(lt,Jt,fe,Ln,2)}),"(",rr,");",wn,".call(this,a0,a1);"))}}Object.keys(fe.state).length>0&&De(Jt.shared.current,".dirty=true;"),Jt.shared.vao&&De(Jt.shared.vao,".setVAO(null);")}function wt(Jt,fe){var De=Jt.proc("scope",3);Jt.batchId="a2";var lr=Jt.shared,tr=lr.current;if(Ec(Jt,De,fe.context),fe.framebuffer&&fe.framebuffer.append(Jt,De),sa(Object.keys(fe.state)).forEach(function(gr){var Ge=fe.state[gr],rr=Ge.append(Jt,De);Jn(rr)?rr.forEach(function(Je,Hr){Oa(Je)?De.set(Jt.next[gr],"["+Hr+"]",Je):De.set(Jt.next[gr],"["+Hr+"]",Jt.link(Je,{stable:!0}))}):no(Ge)?De.set(lr.next,"."+gr,Jt.link(rr,{stable:!0})):De.set(lr.next,"."+gr,rr)}),xl(Jt,De,fe,!0,!0),[Dt,Ee,qt,je,Ft].forEach(function(gr){var Ge=fe.draw[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.draw,"."+gr,rr):De.set(lr.draw,"."+gr,Jt.link(rr),{stable:!0})}}),Object.keys(fe.uniforms).forEach(function(gr){var Ge=fe.uniforms[gr].append(Jt,De);Array.isArray(Ge)&&(Ge="["+Ge.map(function(rr){return Oa(rr)?rr:Jt.link(rr,{stable:!0})})+"]"),De.set(lr.uniforms,"["+Jt.link(Ir.id(gr),{stable:!0})+"]",Ge)}),Object.keys(fe.attributes).forEach(function(gr){var Ge=fe.attributes[gr].append(Jt,De),rr=Jt.scopeAttrib(gr);Object.keys(new oi).forEach(function(Je){De.set(rr,"."+Je,Ge[Je])})}),fe.scopeVAO){var ar=fe.scopeVAO.append(Jt,De);Oa(ar)?De.set(lr.vao,".targetVAO",ar):De.set(lr.vao,".targetVAO",Jt.link(ar,{stable:!0}))}function dr(gr){var Ge=fe.shader[gr];if(Ge){var rr=Ge.append(Jt,De);Oa(rr)?De.set(lr.shader,"."+gr,rr):De.set(lr.shader,"."+gr,Jt.link(rr,{stable:!0}))}}dr(O),dr(pt),Object.keys(fe.state).length>0&&(De(tr,".dirty=true;"),De.exit(tr,".dirty=true;")),De("a1(",Jt.shared.context,",a0,",Jt.batchId,");")}function Wt(Jt){if(!(typeof Jt!="object"||Jn(Jt))){for(var fe=Object.keys(Jt),De=0;De=0;--jo){var Rs=Oa[jo];Rs&&Rs(ma,null,0)}Vr.flush(),aa&&aa.update()}function No(){!Ya&&Oa.length>0&&(Ya=b.next(Eo))}function hs(){Ya&&(b.cancel(Eo),Ya=null)}function Xl(jo){jo.preventDefault(),hs(),Vo.forEach(function(Rs){Rs()})}function Rl(jo){Vr.getError(),Ai.restore(),Ca.restore(),Yi.restore(),io.restore(),Ri.restore(),ki.restore(),wi.restore(),aa&&aa.restore(),$a.procs.refresh(),No(),Bo.forEach(function(Rs){Rs()})}ua&&(ua.addEventListener(ml,Xl,!1),ua.addEventListener(yc,Rl,!1));function ys(){Oa.length=0,hs(),ua&&(ua.removeEventListener(ml,Xl),ua.removeEventListener(yc,Rl)),Ca.clear(),ki.clear(),Ri.clear(),wi.clear(),io.clear(),Ni.clear(),Yi.clear(),aa&&aa.clear(),za.forEach(function(jo){jo()})}function Dc(jo){function Rs(tr){var ar=f({},tr);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function dr(gr){if(gr in ar){var Ge=ar[gr];delete ar[gr],Object.keys(Ge).forEach(function(rr){ar[gr+"."+rr]=Ge[rr]})}}return dr("blend"),dr("depth"),dr("cull"),dr("stencil"),dr("polygonOffset"),dr("scissor"),dr("sample"),"vao"in tr&&(ar.vao=tr.vao),ar}function Fl(tr,ar){var dr={},gr={};return Object.keys(tr).forEach(function(Ge){var rr=tr[Ge];if(m.isDynamic(rr)){gr[Ge]=m.unbox(rr,Ge);return}else if(ar&&Array.isArray(rr)){for(var Je=0;Je0)return ke.call(this,De(tr|0),tr|0)}else if(Array.isArray(tr)){if(tr.length)return ke.call(this,tr,tr.length)}else return ve.call(this,tr)}return f(lr,{stats:wt,destroy:function(){Wt.destroy()}})}var Cl=ki.setFBO=Dc({framebuffer:m.define.call(null,oc,"framebuffer")});function Nc(jo,Rs){var Fl=0;$a.procs.poll();var Pl=Rs.color;Pl&&(Vr.clearColor(+Pl[0]||0,+Pl[1]||0,+Pl[2]||0,+Pl[3]||0),Fl|=ou),"depth"in Rs&&(Vr.clearDepth(+Rs.depth),Fl|=wc),"stencil"in Rs&&(Vr.clearStencil(Rs.stencil|0),Fl|=zo),Vr.clear(Fl)}function ku(jo){if("framebuffer"in jo)if(jo.framebuffer&&jo.framebuffer_reglType==="framebufferCube")for(var Rs=0;Rs<6;++Rs)Cl(f({framebuffer:jo.framebuffer.faces[Rs]},jo),Nc);else Cl(jo,Nc);else Nc(null,jo)}function Eu(jo){Oa.push(jo);function Rs(){var Fl=hc(Oa,jo);function Pl(){var Z=hc(Oa,Pl);Oa[Z]=Oa[Oa.length-1],Oa.length-=1,Oa.length<=0&&hs()}Oa[Fl]=Pl}return No(),{cancel:Rs}}function Ec(){var jo=la.viewport,Rs=la.scissor_box;jo[0]=jo[1]=Rs[0]=Rs[1]=0,ma.viewportWidth=ma.framebufferWidth=ma.drawingBufferWidth=jo[2]=Rs[2]=Vr.drawingBufferWidth,ma.viewportHeight=ma.framebufferHeight=ma.drawingBufferHeight=jo[3]=Rs[3]=Vr.drawingBufferHeight}function kc(){ma.tick+=1,ma.time=Xo(),Ec(),$a.procs.poll()}function zc(){io.refresh(),Ec(),$a.procs.refresh(),aa&&aa.update()}function Xo(){return(x()-Ia)/1e3}zc();function Oc(jo,Rs){var Fl;switch(jo){case"frame":return Eu(Rs);case"lost":Fl=Vo;break;case"restore":Fl=Bo;break;case"destroy":Fl=za;break}return Fl.push(Rs),{cancel:function(){for(var Pl=0;Pl=0},read:Ea,destroy:ys,_gl:Vr,_refresh:zc,poll:function(){kc(),aa&&aa.update()},now:Xo,stats:On,getCachedCode:xl,preloadCachedCode:jc});return Ir.onDone(null,Lu),Lu}return zh})}),pA=It((et,Y)=>{var f=gD(),y=mQ();Y.exports=function(z,P,n){var i=z._fullLayout,a=!0;return i._glcanvas.each(function(l){if(l.regl){l.regl.preloadCachedCode(n);return}if(!(l.pick&&!i._has("parcoords"))){try{l.regl=y({canvas:this,attributes:{antialias:!l.pick,preserveDrawingBuffer:!0},pixelRatio:z._context.plotGlPixelRatio||window.devicePixelRatio,extensions:P||[],cachedCode:n||{}})}catch{a=!1}l.regl||(a=!1),a&&this.addEventListener("webglcontextlost",function(o){z&&z.emit&&z.emit("plotly_webglcontextlost",{event:o,layer:l.key})},!1)}}),a||f({container:i._glcontainer.node()}),a}}),oz=It((m,Y)=>{var f=FD(),y=YD(),z=JJ(),P=pQ(),n=jn(),i=dm().selectMode,a=pA(),l=Fu(),o=ro(),c=OD().styleTextSelection,s={};function h(b,x,_,A){var d=b._size,k=b.width*A,w=b.height*A,D=d.l*A,E=d.b*A,I=d.r*A,M=d.t*A,p=d.w*A,g=d.h*A;return[D+x.domain[0]*p,E+_.domain[0]*g,k-I-(1-x.domain[1])*p,w-M-(1-_.domain[1])*g]}var m=Y.exports=function(b,x,_){if(_.length){var A=b._fullLayout,d=x._scene,k=x.xaxis,w=x.yaxis,D,E;if(d){var I=a(b,["ANGLE_instanced_arrays","OES_element_index_uint"],s);if(!I){d.init();return}var M=d.count,p=A._glcanvas.data()[0].regl;if(o(b,x,_),d.dirty){if((d.line2d||d.error2d)&&!(d.scatter2d||d.fill2d||d.glText)&&p.clear({color:!0,depth:!0}),d.error2d===!0&&(d.error2d=z(p)),d.line2d===!0&&(d.line2d=y(p)),d.scatter2d===!0&&(d.scatter2d=f(p)),d.fill2d===!0&&(d.fill2d=y(p)),d.glText===!0)for(d.glText=new Array(M),D=0;Dd.glText.length){var g=M-d.glText.length;for(D=0;Dmt&&(isNaN(J[dt])||isNaN(J[dt+1]));)dt-=2;ot.positions=J.slice(mt,dt+2)}return ot}),d.line2d.update(d.lineOptions)),d.error2d){var N=(d.errorXOptions||[]).concat(d.errorYOptions||[]);d.error2d.update(N)}d.scatter2d&&d.scatter2d.update(d.markerOptions),d.fillOrder=n.repeat(null,M),d.fill2d&&(d.fillOptions=d.fillOptions.map(function(ot,J){var mt=_[J];if(!(!ot||!mt||!mt[0]||!mt[0].trace)){var dt=mt[0],Ct=dt.trace,Rt=dt.t,Bt=d.lineOptions[J],Zt,Gt,ee=[];Ct._ownfill&&ee.push(J),Ct._nexttrace&&ee.push(J+1),ee.length&&(d.fillOrder[J]=ee);var xe=[],ge=Bt&&Bt.positions||Rt.positions,ye,ue;if(Ct.fill==="tozeroy"){for(ye=0;yeye&&isNaN(ge[ue+1]);)ue-=2;ge[ye+1]!==0&&(xe=[ge[ye],0]),xe=xe.concat(ge.slice(ye,ue+2)),ge[ue+1]!==0&&(xe=xe.concat([ge[ue],0]))}else if(Ct.fill==="tozerox"){for(ye=0;yeye&&isNaN(ge[ue]);)ue-=2;ge[ye]!==0&&(xe=[0,ge[ye+1]]),xe=xe.concat(ge.slice(ye,ue+2)),ge[ue]!==0&&(xe=xe.concat([0,ge[ue+1]]))}else if(Ct.fill==="toself"||Ct.fill==="tonext"){for(xe=[],Zt=0,ot.splitNull=!0,Gt=0;Gt-1;for(D=0;D{var f=YX();f.plot=oz(),Y.exports=f}),vQ=It((et,Y)=>{Y.exports=gQ()}),sz=It((et,Y)=>{var f=dd(),y=Ru(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:n}=nu(),i=Lk(),a=fu().idRegex,l=Tc().templatedArray,o=Yn().extendFlat,c=f.marker,s=c.line,h=o(y("marker.line",{editTypeOverride:"calc"}),{width:o({},s.width,{editType:"calc"}),editType:"calc"}),m=o(y("marker"),{symbol:c.symbol,angle:c.angle,size:o({},c.size,{editType:"markerSize"}),sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,opacity:c.opacity,colorbar:c.colorbar,line:h,editType:"calc"});m.color.editType=m.cmin.editType=m.cmax.editType="style";function b(x){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:a[x],editType:"plot"}}}Y.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:o({},i.text,{}),hovertext:o({},i.hovertext,{}),hovertemplate:P(),hovertemplatefallback:n(),xhoverformat:z("x"),yhoverformat:z("y"),marker:m,xaxes:b("x"),yaxes:b("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:i.selected.marker,editType:"calc"},unselected:{marker:i.unselected.marker,editType:"calc"},opacity:i.opacity}}),mA=It((et,Y)=>{Y.exports=function(f,y,z,P){P||(P=1/0);var n,i;for(n=0;n{var f=jn(),y=Zf(),z=sz(),P=Fu(),n=Y0(),i=mA(),a=lA().isOpenSymbol;Y.exports=function(c,s,h,m){function b(E,I){return f.coerce(c,s,z,E,I)}var x=y(c,s,{name:"dimensions",handleItemDefaults:l}),_=b("diagonal.visible"),A=b("showupperhalf"),d=b("showlowerhalf"),k=i(s,x,"values");if(!k||!_&&!A&&!d){s.visible=!1;return}b("text"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("xhoverformat"),b("yhoverformat"),n(c,s,h,m,b,{noAngleRef:!0,noStandOff:!0});var w=a(s.marker.symbol),D=P.isBubble(s);b("marker.line.width",w||D?1:0),o(c,s,m,b),f.coerceSelectionMarkerOpacity(s,b)};function l(c,s){function h(b,x){return f.coerce(c,s,z.dimensions,b,x)}h("label");var m=h("values");m&&m.length?h("visible"):s.visible=!1,h("axis.type"),h("axis.matches")}function o(c,s,h,m){var b=s.dimensions,x=b.length,_=s.showupperhalf,A=s.showlowerhalf,d=s.diagonal.visible,k,w,D=new Array(x),E=new Array(x);for(k=0;kw&&_||k{var f=jn();Y.exports=function(y,z){var P=y._fullLayout,n=z.uid,i=P._splomScenes;i||(i=P._splomScenes={});var a={dirty:!0,selectBatch:[],unselectBatch:[]},l={matrix:!1,selectBatch:[],unselectBatch:[]},o=i[z.uid];return o||(o=i[n]=f.extendFlat({},a,l),o.draw=function(){o.matrix&&o.matrix.draw&&(o.selectBatch.length||o.unselectBatch.length?o.matrix.draw(o.unselectBatch,o.selectBatch):o.matrix.draw()),o.dirty=!1},o.destroy=function(){o.matrix&&o.matrix.destroy&&o.matrix.destroy(),o.matrixOptions=null,o.selectBatch=null,o.unselectBatch=null,o=null}),o.dirty||f.extendFlat(o,a),o}}),xQ=It((et,Y)=>{var f=jn(),y=Ku(),z=_e().calcMarkerSize,P=_e().calcAxisExpansion,n=Dm(),i=Ob().markerSelection,a=Ob().markerStyle,l=_Q(),o=Dr().BADNUM,c=G_().TOO_MANY_POINTS;Y.exports=function(s,h){var m=h.dimensions,b=h._length,x={},_=x.cdata=[],A=x.data=[],d=h._visibleDims=[],k,w,D,E,I;function M(N,B){for(var U=N.makeCalcdata({v:B.values,vcalendar:h.calendar},"v"),V=0;Vc,C;for(g?C=x.sizeAvg||Math.max(x.size,3):C=z(h,b),w=0;w{(function(){var f,y,z,P,n,i;typeof performance<"u"&&performance!==null&&performance.now?Y.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Y.exports=function(){return(f()-n)/1e6},y=process.hrtime,f=function(){var a;return a=y(),a[0]*1e9+a[1]},P=f(),i=process.uptime()*1e9,n=P-i):Date.now?(Y.exports=function(){return Date.now()-z},z=Date.now()):(Y.exports=function(){return new Date().getTime()-z},z=new Date().getTime())}).call(et)}),wQ=It((et,Y)=>{var f=bQ(),y=window,z=["moz","webkit"],P="AnimationFrame",n=y["request"+P],i=y["cancel"+P]||y["cancelRequest"+P];for(a=0;!n&&a{Y.exports=function(f,y){var z=typeof f=="number",P=typeof y=="number";z&&!P?(y=f,f=0):!z&&!P&&(f=0,y=0),f=f|0,y=y|0;var n=y-f;if(n<0)throw new Error("array length must be positive");for(var i=new Array(n),a=0,l=f;a{var f=FD(),y=t1(),z=Db(),P=wQ(),n=kQ(),i=Yw(),a=zb();Y.exports=l;function l(h,m){if(!(this instanceof l))return new l(h);this.traces=[],this.passes={},this.regl=h,this.scatter=f(h),this.canvas=this.scatter.canvas}l.prototype.render=function(...h){return h.length&&this.update(...h),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=P(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,P(()=>{this.dirty=!1})),this)},l.prototype.update=function(...h){if(!h.length)return;for(let x=0;xS||!_.lower&&C{m[A+k]=x})}this.scatter.draw(...m)}return this},l.prototype.destroy=function(){return this.traces.forEach(h=>{h.buffer&&h.buffer.destroy&&h.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function o(h,m,b){let x=h.id!=null?h.id:h,_=m,A=b;return x<<16|(_&255)<<8|A&255}function c(h,m,b){let x,_,A,d,k=h[m],w=h[b];return k.length>2?(k[0],k[2],x=k[1],_=k[3]):k.length?(x=k[0],_=k[1]):(k.x,x=k.y,k.x+k.width,_=k.y+k.height),w.length>2?(A=w[0],d=w[2],w[1],w[3]):w.length?(A=w[0],d=w[1]):(A=w.x,w.y,d=w.x+w.width,w.y+w.height),[A,x,d,_]}function s(h){if(typeof h=="number")return[h,h,h,h];if(h.length===2)return[h[0],h[1],h[0],h[1]];{let m=i(h);return[m.x,m.y,m.x+m.width,m.y+m.height]}}}),SQ=It((et,Y)=>{var f=TQ(),y=jn(),z=Ku(),P=dm().selectMode;Y.exports=function(i,a,l){if(l.length)for(var o=0;o-1,W=P(_)||!!c.selectedpoints||V,F=!0;if(W){var H=c._length;if(c.selectedpoints){h.selectBatch=c.selectedpoints;var q=c.selectedpoints,G={};for(k=0;k{et.getDimIndex=function(Y,f){for(var y=f._id,z=y.charAt(0),P={x:0,y:1}[z],n=Y._visibleDims,i=0;i{var f=lz(),y=sA().calcHover,z=Fs().getFromId,P=Yn().extendFlat;function n(a,l,o,c,s){s||(s={});var h=(c||"").charAt(0)==="x",m=(c||"").charAt(0)==="y",b=i(a,l,o);if((h||m)&&s.hoversubplots==="axis"&&b[0])for(var x=(h?a.xa:a.ya)._subplotsWith,_=s.gd,A=P({},a),d=0;d{var f=jn(),y=f.pushUnique,z=Fu(),P=lz();Y.exports=function(n,i){var a=n.cd,l=a[0].trace,o=a[0].t,c=n.scene,s=c.matrixOptions.cdata,h=n.xaxis,m=n.yaxis,b=[];if(!c)return b;var x=!z.hasMarkers(l)&&!z.hasText(l);if(l.visible!==!0||x)return b;var _=P.getDimIndex(l,h),A=P.getDimIndex(l,m);if(_===!1||A===!1)return b;var d=o.xpx[_],k=o.ypx[A],w=s[_],D=s[A],E=(n.scene.selectBatch||[]).slice(),I=[];if(i!==!1&&!i.degenerate)for(var M=0;M{var f=jn(),y=Dm(),z=Ob().markerStyle;Y.exports=function(P,n){var i=n.trace,a=P._fullLayout._splomScenes[i.uid];if(a){y(P,i),f.extendFlat(a.matrixOptions,z(P,i));var l=f.extendFlat({},a.matrixOptions,a.viewOpts);a.matrix.update(l,null)}}}),EQ=It((et,Y)=>{var f=ls(),y=jL();Y.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:sz(),supplyDefaults:yQ(),colorbar:Do(),calc:xQ(),plot:SQ(),hoverPoints:CQ().hoverPoints,selectPoints:AQ(),editStyle:MQ(),meta:{}},f.register(y)}),LQ=It((et,Y)=>{var f=YD(),y=ls(),z=pA(),P=Mf().getModuleCalcData,n=Fd(),i=Ku().getFromId,a=Fs().shouldShowZeroLine,l="splom",o={};function c(_){var A=_._fullLayout,d=y.getModule(l),k=P(_.calcdata,d)[0],w=z(_,["ANGLE_instanced_arrays","OES_element_index_uint"],o);w&&(A._hasOnlyLargeSploms&&m(_),d.plot(_,{},k))}function s(_){var A=_.calcdata,d=_._fullLayout;d._hasOnlyLargeSploms&&m(_);for(var k=0;k{var f=EQ();f.basePlotModule=LQ(),Y.exports=f}),IQ=It((et,Y)=>{Y.exports=PQ()}),cz=It((et,Y)=>{var f=Ru(),y=Gf(),z=hi(),P=Jh().attributes,n=Yn().extendFlat,i=Tc().templatedArray;Y.exports={domain:P({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:z({editType:"plot"}),tickfont:z({autoShadowDflt:!0,editType:"plot"}),rangefont:z({editType:"plot"}),dimensions:i("dimension",{label:{valType:"string",editType:"plot"},tickvals:n({},y.tickvals,{editType:"plot"}),ticktext:n({},y.ticktext,{editType:"plot"}),tickformat:n({},y.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:n({editType:"calc"},f("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),zk=It((et,Y)=>{Y.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}),e1=It((et,Y)=>{var f=T_();function y(z){return[z]}Y.exports={keyFun:function(z){return z.key},repeat:y,descend:f,wrap:y,unwrap:function(z){return z[0]}}}),uz=It((et,Y)=>{var f=zk(),y=Br(),z=e1().keyFun,P=e1().repeat,n=jn().sorterAsc,i=jn().strTranslate,a=f.bar.snapRatio;function l(G,tt){return G*(1-a)+tt*a}var o=f.bar.snapClose;function c(G,tt){return G*(1-o)+tt*o}function s(G,tt,ht,bt){if(h(ht,bt))return ht;var vt=G?-1:1,ut=0,rt=tt.length-1;if(vt<0){var gt=ut;ut=rt,rt=gt}for(var it=tt[ut],st=it,xt=ut;vt*xt=tt[ht][0]&&G<=tt[ht][1])return!0;return!1}function m(G){G.attr("x",-f.bar.captureWidth/2).attr("width",f.bar.captureWidth)}function b(G){G.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function x(G){if(!G.brush.filterSpecified)return"0,"+G.height;for(var tt=_(G.brush.filter.getConsolidated(),G.height),ht=[0],bt,vt,ut,rt=tt.length?tt[0][0]:null,gt=0;gtG[1]+ht||tt=.9*G[1]+.1*G[0]?"n":tt<=.9*G[0]+.1*G[1]?"s":"ns"}function d(){y.select(document.body).style("cursor",null)}function k(G){G.attr("stroke-dasharray",x)}function w(G,tt){var ht=y.select(G).selectAll(".highlight, .highlight-shadow"),bt=tt?ht.transition().duration(f.bar.snapDuration).each("end",tt):ht;k(bt)}function D(G,tt){var ht=G.brush,bt=ht.filterSpecified,vt=NaN,ut={},rt;if(bt){var gt=G.height,it=ht.filter.getConsolidated(),st=_(it,gt),xt=NaN,ot=NaN,J=NaN;for(rt=0;rt<=st.length;rt++){var mt=st[rt];if(mt&&mt[0]<=tt&&tt<=mt[1]){xt=rt;break}else if(ot=rt?rt-1:NaN,mt&&mt[0]>tt){J=rt;break}}if(vt=xt,isNaN(vt)&&(isNaN(ot)||isNaN(J)?vt=isNaN(ot)?J:ot:vt=tt-st[ot][1]=Zt[0]&&Bt<=Zt[1]){ut.clickableOrdinalRange=Zt;break}}}return ut}function E(G,tt){y.event.sourceEvent.stopPropagation();var ht=tt.height-y.mouse(G)[1]-2*f.verticalPadding,bt=tt.unitToPaddedPx.invert(ht),vt=tt.brush,ut=D(tt,ht),rt=ut.interval,gt=vt.svgBrush;if(gt.wasDragged=!1,gt.grabbingBar=ut.region==="ns",gt.grabbingBar){var it=rt.map(tt.unitToPaddedPx);gt.grabPoint=ht-it[0]-f.verticalPadding,gt.barLength=it[1]-it[0]}gt.clickableOrdinalRange=ut.clickableOrdinalRange,gt.stayingIntervals=tt.multiselect&&vt.filterSpecified?vt.filter.getConsolidated():[],rt&&(gt.stayingIntervals=gt.stayingIntervals.filter(function(st){return st[0]!==rt[0]&&st[1]!==rt[1]})),gt.startExtent=ut.region?rt[ut.region==="s"?1:0]:bt,tt.parent.inBrushDrag=!0,gt.brushStartCallback()}function I(G,tt){y.event.sourceEvent.stopPropagation();var ht=tt.height-y.mouse(G)[1]-2*f.verticalPadding,bt=tt.brush.svgBrush;bt.wasDragged=!0,bt._dragging=!0,bt.grabbingBar?bt.newExtent=[ht-bt.grabPoint,ht+bt.barLength-bt.grabPoint].map(tt.unitToPaddedPx.invert):bt.newExtent=[bt.startExtent,tt.unitToPaddedPx.invert(ht)].sort(n),tt.brush.filterSpecified=!0,bt.extent=bt.stayingIntervals.concat([bt.newExtent]),bt.brushCallback(tt),w(G.parentNode)}function M(G,tt){var ht=tt.brush,bt=ht.filter,vt=ht.svgBrush;vt._dragging||(p(G,tt),I(G,tt),tt.brush.svgBrush.wasDragged=!1),vt._dragging=!1;var ut=y.event;ut.sourceEvent.stopPropagation();var rt=vt.grabbingBar;if(vt.grabbingBar=!1,vt.grabLocation=void 0,tt.parent.inBrushDrag=!1,d(),!vt.wasDragged){vt.wasDragged=void 0,vt.clickableOrdinalRange?ht.filterSpecified&&tt.multiselect?vt.extent.push(vt.clickableOrdinalRange):(vt.extent=[vt.clickableOrdinalRange],ht.filterSpecified=!0):rt?(vt.extent=vt.stayingIntervals,vt.extent.length===0&&U(ht)):U(ht),vt.brushCallback(tt),w(G.parentNode),vt.brushEndCallback(ht.filterSpecified?bt.getConsolidated():[]);return}var gt=function(){bt.set(bt.getConsolidated())};if(tt.ordinal){var it=tt.unitTickvals;it[it.length-1]vt.newExtent[0];vt.extent=vt.stayingIntervals.concat(st?[vt.newExtent]:[]),vt.extent.length||U(ht),vt.brushCallback(tt),st?w(G.parentNode,gt):(gt(),w(G.parentNode))}else gt();vt.brushEndCallback(ht.filterSpecified?bt.getConsolidated():[])}function p(G,tt){var ht=tt.height-y.mouse(G)[1]-2*f.verticalPadding,bt=D(tt,ht),vt="crosshair";bt.clickableOrdinalRange?vt="pointer":bt.region&&(vt=bt.region+"-resize"),y.select(document.body).style("cursor",vt)}function g(G){G.on("mousemove",function(tt){y.event.preventDefault(),tt.parent.inBrushDrag||p(this,tt)}).on("mouseleave",function(tt){tt.parent.inBrushDrag||d()}).call(y.behavior.drag().on("dragstart",function(tt){E(this,tt)}).on("drag",function(tt){I(this,tt)}).on("dragend",function(tt){M(this,tt)}))}function C(G,tt){return G[0]-tt[0]}function S(G,tt,ht){var bt=ht._context.staticPlot,vt=G.selectAll(".background").data(P);vt.enter().append("rect").classed("background",!0).call(m).call(b).style("pointer-events",bt?"none":"auto").attr("transform",i(0,f.verticalPadding)),vt.call(g).attr("height",function(gt){return gt.height-f.verticalPadding});var ut=G.selectAll(".highlight-shadow").data(P);ut.enter().append("line").classed("highlight-shadow",!0).attr("x",-f.bar.width/2).attr("stroke-width",f.bar.width+f.bar.strokeWidth).attr("stroke",tt).attr("opacity",f.bar.strokeOpacity).attr("stroke-linecap","butt"),ut.attr("y1",function(gt){return gt.height}).call(k);var rt=G.selectAll(".highlight").data(P);rt.enter().append("line").classed("highlight",!0).attr("x",-f.bar.width/2).attr("stroke-width",f.bar.width-f.bar.strokeWidth).attr("stroke",f.bar.fillColor).attr("opacity",f.bar.fillOpacity).attr("stroke-linecap","butt"),rt.attr("y1",function(gt){return gt.height}).call(k)}function N(G,tt,ht){var bt=G.selectAll("."+f.cn.axisBrush).data(P,z);bt.enter().append("g").classed(f.cn.axisBrush,!0),S(bt,tt,ht)}function B(G){return G.svgBrush.extent.map(function(tt){return tt.slice()})}function U(G){G.filterSpecified=!1,G.svgBrush.extent=[[-1/0,1/0]]}function V(G){return function(tt){var ht=tt.brush,bt=B(ht),vt=bt.slice();ht.filter.set(vt),G()}}function W(G){for(var tt=G.slice(),ht=[],bt,vt=tt.shift();vt;){for(bt=vt.slice();(vt=tt.shift())&&vt[0]<=bt[1];)bt[1]=Math.max(bt[1],vt[1]);ht.push(bt)}return ht.length===1&&ht[0][0]>ht[0][1]&&(ht=[]),ht}function F(){var G=[],tt,ht;return{set:function(bt){G=bt.map(function(vt){return vt.slice().sort(n)}).sort(C),G.length===1&&G[0][0]===-1/0&&G[0][1]===1/0&&(G=[[0,-1]]),tt=W(G),ht=G.reduce(function(vt,ut){return[Math.min(vt[0],ut[0]),Math.max(vt[1],ut[1])]},[1/0,-1/0])},get:function(){return G.slice()},getConsolidated:function(){return tt},getBounds:function(){return ht}}}function H(G,tt,ht,bt,vt,ut){var rt=F();return rt.set(ht),{filter:rt,filterSpecified:tt,svgBrush:{extent:[],brushStartCallback:bt,brushCallback:V(vt),brushEndCallback:ut}}}function q(G,tt){if(Array.isArray(G[0])?(G=G.map(function(bt){return bt.sort(n)}),tt.multiselect?G=W(G.sort(C)):G=[G[0]]):G=[G.sort(n)],tt.tickvals){var ht=tt.tickvals.slice().sort(n);if(G=G.map(function(bt){var vt=[s(0,ht,bt[0],[]),s(1,ht,bt[1],[])];if(vt[1]>vt[0])return vt}).filter(function(bt){return bt}),!G.length)return}return G.length>1?G:G[0]}Y.exports={makeBrush:H,ensureAxisBrush:N,cleanRanges:q}}),DQ=It((et,Y)=>{var f=jn(),y=fp().hasColorscale,z=Cu(),P=Jh().defaults,n=Zf(),i=Fs(),a=cz(),l=uz(),o=zk().maxDimensionCount,c=mA();function s(m,b,x,_,A){var d=A("line.color",x);if(y(m,"line")&&f.isArrayOrTypedArray(d)){if(d.length)return A("line.colorscale"),z(m,b,_,A,{prefix:"line.",cLetter:"c"}),d.length;b.line.color=x}return 1/0}function h(m,b,x,_){function A(E,I){return f.coerce(m,b,a.dimensions,E,I)}var d=A("values"),k=A("visible");if(d&&d.length||(k=b.visible=!1),k){A("label"),A("tickvals"),A("ticktext"),A("tickformat");var w=A("range");b._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},i.setConvert(b._ax,_.layout),A("multiselect");var D=A("constraintrange");D&&(b.constraintrange=l.cleanRanges(D,b))}}Y.exports=function(m,b,x,_){function A(E,I){return f.coerce(m,b,a,E,I)}var d=m.dimensions;Array.isArray(d)&&d.length>o&&(f.log("parcoords traces support up to "+o+" dimensions at the moment"),d.splice(o));var k=n(m,b,{name:"dimensions",layout:_,handleItemDefaults:h}),w=s(m,b,x,_,A);P(b,_,A),(!Array.isArray(k)||!k.length)&&(b.visible=!1),c(b,k,"values",w);var D=f.extendFlat({},_.font,{size:Math.round(_.font.size/1.2)});f.coerceFont(A,"labelfont",D),f.coerceFont(A,"tickfont",D,{autoShadowDflt:!0}),f.coerceFont(A,"rangefont",D),A("labelangle"),A("labelside"),A("unselected.line.color"),A("unselected.line.opacity")}}),zQ=It((et,Y)=>{var f=jn().isArrayOrTypedArray,y=ch(),z=e1().wrap;Y.exports=function(n,i){var a,l;return y.hasColorscale(i,"line")&&f(i.line.color)?(a=i.line.color,l=y.extractOpts(i.line).colorscale,y.calc(n,i,{vals:a,containerStr:"line",cLetter:"c"})):(a=P(i._length),l=[[0,i.line.color],[1,i.line.color]]),z({lineColor:a,cscale:l})};function P(n){for(var i=new Array(n),a=0;a>>16,(et&65280)>>>8,et&255],alpha:1};if(typeof et=="number")return{space:"rgb",values:[et>>>16,(et&65280)>>>8,et&255],alpha:1};if(et=String(et).toLowerCase(),gA.default[et])z=gA.default[et].slice(),n="rgb";else if(et==="transparent")P=0,n="rgb",z=[0,0,0];else if(et[0]==="#"){var i=et.slice(1),a=i.length,l=a<=4;P=1,l?(z=[parseInt(i[0]+i[0],16),parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16)],a===4&&(P=parseInt(i[3]+i[3],16)/255)):(z=[parseInt(i[0]+i[1],16),parseInt(i[2]+i[3],16),parseInt(i[4]+i[5],16)],a===8&&(P=parseInt(i[6]+i[7],16)/255)),z[0]||(z[0]=0),z[1]||(z[1]=0),z[2]||(z[2]=0),n="rgb"}else if(y=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(et)){var o=y[1];n=o.replace(/a$/,"");var c=n==="cmyk"?4:n==="gray"?1:3;z=y[2].trim().split(/\s*[,\/]\s*|\s+/),n==="color"&&(n=z.shift()),z=z.map(function(s,h){if(s[s.length-1]==="%")return s=parseFloat(s)/100,h===3?s:n==="rgb"?s*255:n[0]==="h"||n[0]==="l"&&!h?s*100:n==="lab"?s*125:n==="lch"?h<2?s*150:s*360:n[0]==="o"&&!h?s:n==="oklab"?s*.4:n==="oklch"?h<2?s*.4:s*360:s;if(n[h]==="h"||h===2&&n[n.length-1]==="h"){if(vA[s]!==void 0)return vA[s];if(s.endsWith("deg"))return parseFloat(s);if(s.endsWith("turn"))return parseFloat(s)*360;if(s.endsWith("grad"))return parseFloat(s)*360/400;if(s.endsWith("rad"))return parseFloat(s)*180/Math.PI}return s==="none"?0:parseFloat(s)}),P=z.length>c?z.pop():1}else/[0-9](?:\s|\/|,)/.test(et)&&(z=et.match(/([0-9]+)/g).map(function(s){return parseFloat(s)}),n=((f=(Y=et.match(/([a-z])/ig))==null?void 0:Y.join(""))==null?void 0:f.toLowerCase())||"rgb");return{space:n,values:z,alpha:P}}var gA,hz,vA,BQ=kr(()=>{gA=Mr(fD()),hz=OQ,vA={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),Ok,dz=kr(()=>{Ok={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),Bk,RQ=kr(()=>{dz(),Bk={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(et){var Y=et[0]/360,f=et[1]/100,y=et[2]/100,z,P,n,i,a,l=0;if(f===0)return a=y*255,[a,a,a];for(P=y<.5?y*(1+f):y+f-y*f,z=2*y-P,i=[0,0,0];l<3;)n=Y+1/3*-(l-1),n<0?n++:n>1&&n--,a=6*n<1?z+(P-z)*6*n:2*n<1?P:3*n<2?z+(P-z)*(2/3-n)*6:z,i[l++]=a*255;return i}},Ok.hsl=function(et){var Y=et[0]/255,f=et[1]/255,y=et[2]/255,z=Math.min(Y,f,y),P=Math.max(Y,f,y),n=P-z,i,a,l;return P===z?i=0:Y===P?i=(f-y)/n:f===P?i=2+(y-Y)/n:y===P&&(i=4+(Y-f)/n),i=Math.min(i*60,360),i<0&&(i+=360),l=(z+P)/2,P===z?a=0:l<=.5?a=n/(P+z):a=n/(2-P-z),[i,a*100,l*100]}}),fz={};rn(fz,{default:()=>FQ});function FQ(et){Array.isArray(et)&&et.raw&&(et=String.raw(...arguments)),et instanceof Number&&(et=+et);var Y,f=hz(et);if(!f.space)return[];let y=f.space[0]==="h"?Bk.min:Ok.min,z=f.space[0]==="h"?Bk.max:Ok.max;return Y=Array(3),Y[0]=Math.min(Math.max(f.values[0],y[0]),z[0]),Y[1]=Math.min(Math.max(f.values[1],y[1]),z[1]),Y[2]=Math.min(Math.max(f.values[2],y[2]),z[2]),f.space[0]==="h"&&(Y=Bk.rgb(Y)),Y.push(Math.min(Math.max(f.alpha,0),1)),Y}var NQ=kr(()=>{BQ(),dz(),RQ()}),pz=It(et=>{var Y=jn().isTypedArray;et.convertTypedArray=function(f){return Y(f)?Array.prototype.slice.call(f):f},et.isOrdinal=function(f){return!!f.tickvals},et.isVisible=function(f){return f.visible||!("visible"in f)}}),jQ=It((et,Y)=>{var f=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` `),y=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),z=zk().maxDimensionCount,P=jn(),n=1e-6,i=2048,a=new Uint8Array(4),l=new Uint8Array(4),o={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function c(M){M.read({x:0,y:0,width:1,height:1,data:a})}function s(M,p,g,C,S){var N=M._gl;N.enable(N.SCISSOR_TEST),N.scissor(p,g,C,S),M.clear({color:[0,0,0,0],depth:1})}function h(M,p,g,C,S,N){var B=N.key;function U(V){var W=Math.min(C,S-V*C);V===0&&(window.cancelAnimationFrame(g.currentRafs[B]),delete g.currentRafs[B],s(M,N.scissorX,N.scissorY,N.scissorWidth,N.viewBoxSize[1])),!g.clearOnly&&(N.count=2*W,N.offset=2*V*C,p(N),V*C+W>>8*p)%256/255}function _(M,p,g){for(var C=new Array(M*(z+4)),S=0,N=0;NGt&&(Gt=ot[Ct].dim1.canvasX,Bt=Ct);dt===0&&s(S,0,0,W.canvasWidth,W.canvasHeight);var ee=rt(g);for(Ct=0;Ct{var f=Br(),y=jn(),z=y.isArrayOrTypedArray,P=y.numberFormat,n=(NQ(),tn(fz)).default,i=Fs(),a=y.strRotate,l=y.strTranslate,o=uu(),c=Js(),s=ch(),h=e1(),m=h.keyFun,b=h.repeat,x=h.unwrap,_=pz(),A=zk(),d=uz(),k=jQ();function w(bt,vt,ut){return y.aggNums(bt,null,vt,ut)}function D(bt,vt){return I(w(Math.min,bt,vt),w(Math.max,bt,vt))}function E(bt){var vt=bt.range;return vt?I(vt[0],vt[1]):D(bt.values,bt._length)}function I(bt,vt){return(isNaN(bt)||!isFinite(bt))&&(bt=0),(isNaN(vt)||!isFinite(vt))&&(vt=0),bt===vt&&(bt===0?(bt-=1,vt+=1):(bt*=.9,vt*=1.1)),[bt,vt]}function M(bt,vt){return vt?function(ut,rt){var gt=vt[rt];return gt??bt(ut)}:bt}function p(bt,vt,ut,rt,gt){var it=E(ut);return rt?f.scale.ordinal().domain(rt.map(M(P(ut.tickformat),gt))).range(rt.map(function(st){var xt=(st-it[0])/(it[1]-it[0]);return bt-vt+xt*(2*vt-bt)})):f.scale.linear().domain(it).range([bt-vt,vt])}function g(bt,vt){return f.scale.linear().range([vt,bt-vt])}function C(bt,vt){return f.scale.linear().domain(E(bt)).range([vt,1-vt])}function S(bt){if(bt.tickvals){var vt=E(bt);return f.scale.ordinal().domain(bt.tickvals).range(bt.tickvals.map(function(ut){return(ut-vt[0])/(vt[1]-vt[0])}))}}function N(bt){var vt=bt.map(function(it){return it[0]}),ut=bt.map(function(it){var st=n(it[1]);return f.rgb("rgb("+st[0]+","+st[1]+","+st[2]+")")}),rt=function(it){return function(st){return st[it]}},gt="rgb".split("").map(function(it){return f.scale.linear().clamp(!0).domain(vt).range(ut.map(rt(it)))});return function(it){return gt.map(function(st){return st(it)})}}function B(bt){return bt.dimensions.some(function(vt){return vt.brush.filterSpecified})}function U(bt,vt,ut){var rt=x(vt),gt=rt.trace,it=_.convertTypedArray(rt.lineColor),st=gt.line,xt={color:n(gt.unselected.line.color),opacity:gt.unselected.line.opacity},ot=s.extractOpts(st),J=ot.reversescale?s.flipScale(rt.cscale):rt.cscale,mt=gt.domain,dt=gt.dimensions,Ct=bt.width,Rt=gt.labelangle,Bt=gt.labelside,Zt=gt.labelfont,Gt=gt.tickfont,ee=gt.rangefont,xe=y.extendDeepNoArrays({},st,{color:it.map(f.scale.linear().domain(E({values:it,range:[ot.min,ot.max],_length:gt._length}))),blockLineCount:A.blockLineCount,canvasOverdrag:A.overdrag*A.canvasPixelRatio}),ge=Math.floor(Ct*(mt.x[1]-mt.x[0])),ye=Math.floor(bt.height*(mt.y[1]-mt.y[0])),ue=bt.margin||{l:80,r:80,t:100,b:80},Mt=ge,Ot=ye;return{key:ut,colCount:dt.filter(_.isVisible).length,dimensions:dt,tickDistance:A.tickDistance,unitToColor:N(J),lines:xe,deselectedLines:xt,labelAngle:Rt,labelSide:Bt,labelFont:Zt,tickFont:Gt,rangeFont:ee,layoutWidth:Ct,layoutHeight:bt.height,domain:mt,translateX:mt.x[0]*Ct,translateY:bt.height-mt.y[1]*bt.height,pad:ue,canvasWidth:Mt*A.canvasPixelRatio+2*xe.canvasOverdrag,canvasHeight:Ot*A.canvasPixelRatio,width:Mt,height:Ot,canvasPixelRatio:A.canvasPixelRatio}}function V(bt,vt,ut){var rt=ut.width,gt=ut.height,it=ut.dimensions,st=ut.canvasPixelRatio,xt=function(Ct){return rt*Ct/Math.max(1,ut.colCount-1)},ot=A.verticalPadding/gt,J=g(gt,A.verticalPadding),mt={key:ut.key,xScale:xt,model:ut,inBrushDrag:!1},dt={};return mt.dimensions=it.filter(_.isVisible).map(function(Ct,Rt){var Bt=C(Ct,ot),Zt=dt[Ct.label];dt[Ct.label]=(Zt||0)+1;var Gt=Ct.label+(Zt?"__"+Zt:""),ee=Ct.constraintrange,xe=ee&&ee.length;xe&&!z(ee[0])&&(ee=[ee]);var ge=xe?ee.map(function(Ze){return Ze.map(Bt)}):[[-1/0,1/0]],ye=function(){var Ze=mt;Ze.focusLayer&&Ze.focusLayer.render(Ze.panels,!0);var Qe=B(Ze);!bt.contextShown()&&Qe?(Ze.contextLayer&&Ze.contextLayer.render(Ze.panels,!0),bt.contextShown(!0)):bt.contextShown()&&!Qe&&(Ze.contextLayer&&Ze.contextLayer.render(Ze.panels,!0,!0),bt.contextShown(!1))},ue=Ct.values;ue.length>Ct._length&&(ue=ue.slice(0,Ct._length));var Mt=Ct.tickvals,Ot;function Lt(Ze,Qe){return{val:Ze,text:Ot[Qe]}}function ie(Ze,Qe){return Ze.val-Qe.val}if(z(Mt)&&Mt.length){y.isTypedArray(Mt)&&(Mt=Array.from(Mt)),Ot=Ct.ticktext,!z(Ot)||!Ot.length?Ot=Mt.map(P(Ct.tickformat)):Ot.length>Mt.length?Ot=Ot.slice(0,Mt.length):Mt.length>Ot.length&&(Mt=Mt.slice(0,Ot.length));for(var be=1;be=Ze||Jr>=Qe)return;var an=ce.lineLayer.readPixel(fr,Qe-1-Jr),Er=an[3]!==0,dn=Er?an[2]+256*(an[1]+256*an[0]):null,_n={x:fr,y:Jr,clientX:Le.clientX,clientY:Le.clientY,dataIndex:ce.model.key,curveNumber:dn};dn!==Rt&&(Er?rt.hover(_n):rt.unhover&&rt.unhover(_n),Rt=dn)}}),Ct.style("opacity",function(ce){return ce.pick?0:1}),st.style("background","rgba(255, 255, 255, 0)");var Zt=st.selectAll("."+A.cn.parcoords).data(dt,m);Zt.exit().remove(),Zt.enter().append("g").classed(A.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Zt.attr("transform",function(ce){return l(ce.model.translateX,ce.model.translateY)});var Gt=Zt.selectAll("."+A.cn.parcoordsControlView).data(b,m);Gt.enter().append("g").classed(A.cn.parcoordsControlView,!0),Gt.attr("transform",function(ce){return l(ce.model.pad.l,ce.model.pad.t)});var ee=Gt.selectAll("."+A.cn.yAxis).data(function(ce){return ce.dimensions},m);ee.enter().append("g").classed(A.cn.yAxis,!0),Gt.each(function(ce){q(ee,ce,ot)}),Ct.each(function(ce){if(ce.viewModel){!ce.lineLayer||rt?ce.lineLayer=k(this,ce):ce.lineLayer.update(ce),(ce.key||ce.key===0)&&(ce.viewModel[ce.key]=ce.lineLayer);var Le=!ce.context||rt;ce.lineLayer.render(ce.viewModel.panels,Le)}}),ee.attr("transform",function(ce){return l(ce.xScale(ce.xIndex),0)}),ee.call(f.behavior.drag().origin(function(ce){return ce}).on("drag",function(ce){var Le=ce.parent;mt.linePickActive(!1),ce.x=Math.max(-A.overdrag,Math.min(ce.model.width+A.overdrag,f.event.x)),ce.canvasX=ce.x*ce.model.canvasPixelRatio,ee.sort(function(Ze,Qe){return Ze.x-Qe.x}).each(function(Ze,Qe){Ze.xIndex=Qe,Ze.x=ce===Ze?Ze.x:Ze.xScale(Ze.xIndex),Ze.canvasX=Ze.x*Ze.model.canvasPixelRatio}),q(ee,Le,ot),ee.filter(function(Ze){return Math.abs(ce.xIndex-Ze.xIndex)!==0}).attr("transform",function(Ze){return l(Ze.xScale(Ze.xIndex),0)}),f.select(this).attr("transform",l(ce.x,0)),ee.each(function(Ze,Qe,mr){mr===ce.parent.key&&(Le.dimensions[Qe]=Ze)}),Le.contextLayer&&Le.contextLayer.render(Le.panels,!1,!B(Le)),Le.focusLayer.render&&Le.focusLayer.render(Le.panels)}).on("dragend",function(ce){var Le=ce.parent;ce.x=ce.xScale(ce.xIndex),ce.canvasX=ce.x*ce.model.canvasPixelRatio,q(ee,Le,ot),f.select(this).attr("transform",function(Ze){return l(Ze.x,0)}),Le.contextLayer&&Le.contextLayer.render(Le.panels,!1,!B(Le)),Le.focusLayer&&Le.focusLayer.render(Le.panels),Le.pickLayer&&Le.pickLayer.render(Le.panels,!0),mt.linePickActive(!0),rt&&rt.axesMoved&&rt.axesMoved(Le.key,Le.dimensions.map(function(Ze){return Ze.crossfilterDimensionIndex}))})),ee.exit().remove();var xe=ee.selectAll("."+A.cn.axisOverlays).data(b,m);xe.enter().append("g").classed(A.cn.axisOverlays,!0),xe.selectAll("."+A.cn.axis).remove();var ge=xe.selectAll("."+A.cn.axis).data(b,m);ge.enter().append("g").classed(A.cn.axis,!0),ge.each(function(ce){var Le=ce.model.height/ce.model.tickDistance,Ze=ce.domainScale,Qe=Ze.domain();f.select(this).call(f.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Le,ce.tickFormat).tickValues(ce.ordinal?Qe:null).tickFormat(function(mr){return _.isOrdinal(ce)?mr:tt(ce.model.dimensions[ce.visibleIndex],mr)}).scale(Ze)),c.font(ge.selectAll("text"),ce.model.tickFont)}),ge.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),ge.selectAll("text").style("cursor","default");var ye=xe.selectAll("."+A.cn.axisHeading).data(b,m);ye.enter().append("g").classed(A.cn.axisHeading,!0);var ue=ye.selectAll("."+A.cn.axisTitle).data(b,m);ue.enter().append("text").classed(A.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",gt?"none":"auto"),ue.text(function(ce){return ce.label}).each(function(ce){var Le=f.select(this);c.font(Le,ce.model.labelFont),o.convertToTspans(Le,bt)}).attr("transform",function(ce){var Le=H(ce.model.labelAngle,ce.model.labelSide),Ze=A.axisTitleOffset;return(Le.dir>0?"":l(0,2*Ze+ce.model.height))+a(Le.degrees)+l(-Ze*Le.dx,-Ze*Le.dy)}).attr("text-anchor",function(ce){var Le=H(ce.model.labelAngle,ce.model.labelSide),Ze=Math.abs(Le.dx),Qe=Math.abs(Le.dy);return 2*Ze>Qe?Le.dir*Le.dx<0?"start":"end":"middle"});var Mt=xe.selectAll("."+A.cn.axisExtent).data(b,m);Mt.enter().append("g").classed(A.cn.axisExtent,!0);var Ot=Mt.selectAll("."+A.cn.axisExtentTop).data(b,m);Ot.enter().append("g").classed(A.cn.axisExtentTop,!0),Ot.attr("transform",l(0,-A.axisExtentOffset));var Lt=Ot.selectAll("."+A.cn.axisExtentTopText).data(b,m);Lt.enter().append("text").classed(A.cn.axisExtentTopText,!0).call(W),Lt.text(function(ce){return ht(ce,!0)}).each(function(ce){c.font(f.select(this),ce.model.rangeFont)});var ie=Mt.selectAll("."+A.cn.axisExtentBottom).data(b,m);ie.enter().append("g").classed(A.cn.axisExtentBottom,!0),ie.attr("transform",function(ce){return l(0,ce.model.height+A.axisExtentOffset)});var be=ie.selectAll("."+A.cn.axisExtentBottomText).data(b,m);be.enter().append("text").classed(A.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(W),be.text(function(ce){return ht(ce,!1)}).each(function(ce){c.font(f.select(this),ce.model.rangeFont)}),d.ensureAxisBrush(xe,J,bt)}}),mz=It((a,Y)=>{var f=UQ(),y=pA(),z=pz().isVisible,P={};function n(l,o,c){var s=o.indexOf(c),h=l.indexOf(s);return h===-1&&(h+=o.length),h}function i(l,o){return function(c,s){return n(l,o,c)-n(l,o,s)}}var a=Y.exports=function(l,o){var c=l._fullLayout,s=y(l,[],P);if(s){var h={},m={},b={},x={},_=c._size;o.forEach(function(D,E){var I=D[0].trace;b[E]=I.index;var M=x[E]=I.index;h[E]=l.data[M].dimensions,m[E]=l.data[M].dimensions.slice()});var A=function(D,E,I){var M=m[D][E],p=I.map(function(U){return U.slice()}),g="dimensions["+E+"].constraintrange",C=c._tracePreGUI[l._fullData[b[D]]._fullInput.uid];if(C[g]===void 0){var S=M.constraintrange;C[g]=S||null}var N=l._fullData[b[D]].dimensions[E];p.length?(p.length===1&&(p=p[0]),M.constraintrange=p,N.constraintrange=p.slice(),p=[p]):(delete M.constraintrange,delete N.constraintrange,p=null);var B={};B[g]=p,l.emit("plotly_restyle",[B,[x[D]]])},d=function(D){l.emit("plotly_hover",D)},k=function(D){l.emit("plotly_unhover",D)},w=function(D,E){var I=i(E,m[D].filter(z));h[D].sort(I),m[D].filter(function(M){return!z(M)}).sort(function(M){return m[D].indexOf(M)}).forEach(function(M){h[D].splice(h[D].indexOf(M),1),h[D].splice(m[D].indexOf(M),0,M)}),l.emit("plotly_restyle",[{dimensions:[h[D]]},[x[D]]])};f(l,o,{width:_.w,height:_.h,margin:{t:_.t,r:_.r,b:_.b,l:_.l}},{filterChanged:A,hover:d,unhover:k,axesMoved:w})}};a.reglPrecompiled=P}),$Q=It(et=>{var Y=Br(),f=Mf().getModuleCalcData,y=mz(),z=k0();et.name="parcoords",et.plot=function(P){var n=f(P.calcdata,"parcoords")[0];n.length&&y(P,n)},et.clean=function(P,n,i,a){var l=a._has&&a._has("parcoords"),o=n._has&&n._has("parcoords");l&&!o&&(a._paperdiv.selectAll(".parcoords").remove(),a._glimages.selectAll("*").remove())},et.toSVG=function(P){var n=P._fullLayout._glimages,i=Y.select(P).selectAll(".svg-container"),a=i.filter(function(o,c){return c===i.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function l(){var o=this,c=o.toDataURL("image/png"),s=n.append("svg:image");s.attr({xmlns:z.svg,"xlink:href":c,preserveAspectRatio:"none",x:0,y:0,width:o.style.width,height:o.style.height})}a.each(l),window.setTimeout(function(){Y.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),HQ=It((et,Y)=>{Y.exports={attributes:cz(),supplyDefaults:DQ(),calc:zQ(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:$Q(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),VQ=It((et,Y)=>{var f=HQ();f.plot=mz(),Y.exports=f}),WQ=It((et,Y)=>{Y.exports=VQ()}),gz=It((et,Y)=>{var f=Yn().extendFlat,y=xa(),z=hi(),P=Ru(),{hovertemplateAttrs:n,templatefallbackAttrs:i}=nu(),a=Jh().attributes,l=f({editType:"calc"},P("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:n({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:i({editType:"plot"})});Y.exports={domain:a({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:f({},y.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:n({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:i({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:z({editType:"calc"}),tickfont:z({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}),qQ=It((et,Y)=>{var f=jn(),y=fp().hasColorscale,z=Cu(),P=Jh().defaults,n=Zf(),i=gz(),a=mA(),l=Xn().isTypedArraySpec;function o(s,h,m,b,x){x("line.shape"),x("line.hovertemplate"),x("line.hovertemplatefallback");var _=x("line.color",b.colorway[0]);if(y(s,"line")&&f.isArrayOrTypedArray(_)){if(_.length)return x("line.colorscale"),z(s,h,b,x,{prefix:"line.",cLetter:"c"}),_.length;h.line.color=m}return 1/0}function c(s,h){function m(w,D){return f.coerce(s,h,i.dimensions,w,D)}var b=m("values"),x=m("visible");if(b&&b.length||(x=h.visible=!1),x){m("label"),m("displayindex",h._index);var _=s.categoryarray,A=f.isArrayOrTypedArray(_)&&_.length>0||l(_),d;A&&(d="array");var k=m("categoryorder",d);k==="array"?(m("categoryarray"),m("ticktext")):(delete s.categoryarray,delete s.ticktext),!A&&k==="array"&&(h.categoryorder="trace")}}Y.exports=function(s,h,m,b){function x(k,w){return f.coerce(s,h,i,k,w)}var _=n(s,h,{name:"dimensions",handleItemDefaults:c}),A=o(s,h,m,b,x);P(h,b,x),(!Array.isArray(_)||!_.length)&&(h.visible=!1),a(h,_,"values",A),x("hoveron"),x("hovertemplate"),x("hovertemplatefallback"),x("arrangement"),x("bundlecolors"),x("sortpaths"),x("counts");var d=b.font;f.coerceFont(x,"labelfont",d,{overrideDflt:{size:Math.round(d.size)}}),f.coerceFont(x,"tickfont",d,{autoShadowDflt:!0,overrideDflt:{size:Math.round(d.size/1.2)}})}}),GQ=It((et,Y)=>{var f=e1().wrap,y=fp().hasColorscale,z=Cp(),P=$u(),n=Js(),i=jn(),a=Sr();Y.exports=function(d,k){var w=i.filterVisible(k.dimensions);if(w.length===0)return[];var D=w.map(function(ut){var rt;if(ut.categoryorder==="trace")rt=null;else if(ut.categoryorder==="array")rt=ut.categoryarray;else{rt=P(ut.values);for(var gt=!0,it=0;it=d.length||k[d[w]]!==void 0)return!1;k[d[w]]=!0}return!0}}),ZQ=It((et,Y)=>{var f=Br(),y=(Eb(),tn($_)).interpolateNumber,z=Aw(),P=hd(),n=jn(),i=n.strTranslate,a=Js(),l=Xi(),o=uu();function c(st,xt,ot,J){var mt=xt._context.staticPlot,dt=st.map(vt.bind(0,xt,ot)),Ct=J.selectAll("g.parcatslayer").data([null]);Ct.enter().append("g").attr("class","parcatslayer").style("pointer-events",mt?"none":"all");var Rt=Ct.selectAll("g.trace.parcats").data(dt,s),Bt=Rt.enter().append("g").attr("class","trace parcats");Rt.attr("transform",function(Lt){return i(Lt.x,Lt.y)}),Bt.append("g").attr("class","paths");var Zt=Rt.select("g.paths"),Gt=Zt.selectAll("path.path").data(function(Lt){return Lt.paths},s);Gt.attr("fill",function(Lt){return Lt.model.color});var ee=Gt.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Lt){return Lt.model.color}).attr("fill-opacity",0);k(ee),Gt.attr("d",function(Lt){return Lt.svgD}),ee.empty()||Gt.sort(m),Gt.exit().remove(),Gt.on("mouseover",b).on("mouseout",x).on("click",d),Bt.append("g").attr("class","dimensions");var xe=Rt.select("g.dimensions"),ge=xe.selectAll("g.dimension").data(function(Lt){return Lt.dimensions},s);ge.enter().append("g").attr("class","dimension"),ge.attr("transform",function(Lt){return i(Lt.x,0)}),ge.exit().remove();var ye=ge.selectAll("g.category").data(function(Lt){return Lt.categories},s),ue=ye.enter().append("g").attr("class","category");ye.attr("transform",function(Lt){return i(0,Lt.y)}),ue.append("rect").attr("class","catrect").attr("pointer-events","none"),ye.select("rect.catrect").attr("fill","none").attr("width",function(Lt){return Lt.width}).attr("height",function(Lt){return Lt.height}),E(ue);var Mt=ye.selectAll("rect.bandrect").data(function(Lt){return Lt.bands},s);Mt.each(function(){n.raiseToTop(this)}),Mt.attr("fill",function(Lt){return Lt.color});var Ot=Mt.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Lt){return Lt.color}).attr("fill-opacity",0);Mt.attr("fill",function(Lt){return Lt.color}).attr("width",function(Lt){return Lt.width}).attr("height",function(Lt){return Lt.height}).attr("y",function(Lt){return Lt.y}).attr("cursor",function(Lt){return Lt.parcatsViewModel.arrangement==="fixed"?"default":Lt.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),M(Ot),Mt.exit().remove(),ue.append("text").attr("class","catlabel").attr("pointer-events","none"),ye.select("text.catlabel").attr("text-anchor",function(Lt){return h(Lt)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Lt){return h(Lt)?Lt.width+5:-5}).attr("y",function(Lt){return Lt.height/2}).text(function(Lt){return Lt.model.categoryLabel}).each(function(Lt){a.font(f.select(this),Lt.parcatsViewModel.categorylabelfont),o.convertToTspans(f.select(this),xt)}),ue.append("text").attr("class","dimlabel"),ye.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Lt){return Lt.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Lt){return Lt.width/2}).attr("y",-5).text(function(Lt,ie){return ie===0?Lt.parcatsViewModel.model.dimensions[Lt.model.dimensionInd].dimensionLabel:null}).each(function(Lt){a.font(f.select(this),Lt.parcatsViewModel.labelfont)}),ye.selectAll("rect.bandrect").on("mouseover",W).on("mouseout",F),ye.exit().remove(),ge.call(f.behavior.drag().origin(function(Lt){return{x:Lt.x,y:0}}).on("dragstart",H).on("drag",q).on("dragend",G)),Rt.each(function(Lt){Lt.traceSelection=f.select(this),Lt.pathSelection=f.select(this).selectAll("g.paths").selectAll("path.path"),Lt.dimensionSelection=f.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Rt.exit().remove()}Y.exports=function(st,xt,ot,J){c(ot,st,J,xt)};function s(st){return st.key}function h(st){var xt=st.parcatsViewModel.dimensions.length,ot=st.parcatsViewModel.dimensions[xt-1].model.dimensionInd;return st.model.dimensionInd===ot}function m(st,xt){return st.model.rawColor>xt.model.rawColor?1:st.model.rawColor"),Le=f.mouse(mt)[0];P.loneHover({trace:dt,x:ye-Rt.left+Bt.left,y:ue-Rt.top+Bt.top,text:ce,color:st.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Mt,idealAlign:Le1&&Zt.displayInd===Bt.dimensions.length-1?(xe=Ct.left,ge="left"):(xe=Ct.left+Ct.width,ge="right");var ye=Rt.model.count,ue=Rt.model.categoryLabel,Mt=ye/Rt.parcatsViewModel.model.count,Ot={countLabel:ye,categoryLabel:ue,probabilityLabel:Mt.toFixed(3)},Lt=[];Rt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Lt.push(["Count:",Ot.countLabel].join(" ")),Rt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Lt.push(["P("+Ot.categoryLabel+"):",Ot.probabilityLabel].join(" "));var ie=Lt.join("
");return{trace:Gt,x:J*(xe-xt.left),y:mt*(ee-xt.top),text:ie,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:ge,hovertemplate:Gt.hovertemplate,hovertemplateLabels:Ot,eventData:[{data:Gt._input,fullData:Gt,count:ye,category:ue,probability:Mt}]}}function U(st,xt,ot){var J=[];return f.select(ot.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var mt=this;J.push(B(st,xt,mt))}),J}function V(st,xt,ot){st._fullLayout._calcInverseTransform(st);var J=st._fullLayout._invScaleX,mt=st._fullLayout._invScaleY,dt=ot.getBoundingClientRect(),Ct=f.select(ot).datum(),Rt=Ct.categoryViewModel,Bt=Rt.parcatsViewModel,Zt=Bt.model.dimensions[Rt.model.dimensionInd],Gt=Bt.trace,ee=dt.y+dt.height/2,xe,ge;Bt.dimensions.length>1&&Zt.displayInd===Bt.dimensions.length-1?(xe=dt.left,ge="left"):(xe=dt.left+dt.width,ge="right");var ye=Rt.model.categoryLabel,ue=Ct.parcatsViewModel.model.count,Mt=0;Ct.categoryViewModel.bands.forEach(function(fr){fr.color===Ct.color&&(Mt+=fr.count)});var Ot=Rt.model.count,Lt=0;Bt.pathSelection.each(function(fr){fr.model.color===Ct.color&&(Lt+=fr.model.count)});var ie=Mt/ue,be=Mt/Lt,ce=Mt/Ot,Le={countLabel:Mt,categoryLabel:ye,probabilityLabel:ie.toFixed(3)},Ze=[];Rt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ze.push(["Count:",Le.countLabel].join(" ")),Rt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ze.push("P(color ∩ "+ye+"): "+Le.probabilityLabel),Ze.push("P("+ye+" | color): "+be.toFixed(3)),Ze.push("P(color | "+ye+"): "+ce.toFixed(3)));var Qe=Ze.join("
"),mr=l.mostReadable(Ct.color,["black","white"]);return{trace:Gt,x:J*(xe-xt.left),y:mt*(ee-xt.top),text:Qe,color:Ct.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:mr,fontSize:10,idealAlign:ge,hovertemplate:Gt.hovertemplate,hovertemplateLabels:Le,eventData:[{data:Gt._input,fullData:Gt,category:ye,count:ue,probability:ie,categorycount:Ot,colorcount:Lt,bandcolorcount:Mt}]}}function W(st){if(!st.parcatsViewModel.dragDimension&&st.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var xt=f.mouse(this)[1];if(xt<-1)return;var ot=st.parcatsViewModel.graphDiv,J=ot._fullLayout,mt=J._paperdiv.node().getBoundingClientRect(),dt=st.parcatsViewModel.hoveron,Ct=this;if(dt==="color"?(C(Ct),N(Ct,"plotly_hover",f.event)):(g(Ct),S(Ct,"plotly_hover",f.event)),st.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Rt;dt==="category"?Rt=B(ot,mt,Ct):dt==="color"?Rt=V(ot,mt,Ct):dt==="dimension"&&(Rt=U(ot,mt,Ct)),Rt&&P.loneHover(Rt,{container:J._hoverlayer.node(),outerContainer:J._paper.node(),gd:ot})}}}function F(st){var xt=st.parcatsViewModel;if(!xt.dragDimension&&(k(xt.pathSelection),E(xt.dimensionSelection.selectAll("g.category")),M(xt.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),P.loneUnhover(xt.graphDiv._fullLayout._hoverlayer.node()),xt.pathSelection.sort(m),xt.hoverinfoItems.indexOf("skip")===-1)){var ot=st.parcatsViewModel.hoveron,J=this;ot==="color"?N(J,"plotly_unhover",f.event):S(J,"plotly_unhover",f.event)}}function H(st){st.parcatsViewModel.arrangement!=="fixed"&&(st.dragDimensionDisplayInd=st.model.displayInd,st.initialDragDimensionDisplayInds=st.parcatsViewModel.model.dimensions.map(function(xt){return xt.displayInd}),st.dragHasMoved=!1,st.dragCategoryDisplayInd=null,f.select(this).selectAll("g.category").select("rect.catrect").each(function(xt){var ot=f.mouse(this)[0],J=f.mouse(this)[1];-2<=ot&&ot<=xt.width+2&&-2<=J&&J<=xt.height+2&&(st.dragCategoryDisplayInd=xt.model.displayInd,st.initialDragCategoryDisplayInds=st.model.categories.map(function(mt){return mt.displayInd}),xt.model.dragY=xt.y,n.raiseToTop(this.parentNode),f.select(this.parentNode).selectAll("rect.bandrect").each(function(mt){mt.yGt.y+Gt.height/2&&(dt.model.displayInd=Gt.model.displayInd,Gt.model.displayInd=Rt),st.dragCategoryDisplayInd=dt.model.displayInd}if(st.dragCategoryDisplayInd===null||st.parcatsViewModel.arrangement==="freeform"){mt.model.dragX=f.event.x;var ee=st.parcatsViewModel.dimensions[ot],xe=st.parcatsViewModel.dimensions[J];ee!==void 0&&mt.model.dragXxe.x&&(mt.model.displayInd=xe.model.displayInd,xe.model.displayInd=st.dragDimensionDisplayInd),st.dragDimensionDisplayInd=mt.model.displayInd}gt(st.parcatsViewModel),rt(st.parcatsViewModel),bt(st.parcatsViewModel),ht(st.parcatsViewModel)}}function G(st){if(st.parcatsViewModel.arrangement!=="fixed"&&st.dragDimensionDisplayInd!==null){f.select(this).selectAll("text").attr("font-weight","normal");var xt={},ot=tt(st.parcatsViewModel),J=st.parcatsViewModel.model.dimensions.map(function(xe){return xe.displayInd}),mt=st.initialDragDimensionDisplayInds.some(function(xe,ge){return xe!==J[ge]});mt&&J.forEach(function(xe,ge){var ye=st.parcatsViewModel.model.dimensions[ge].containerInd;xt["dimensions["+ye+"].displayindex"]=xe});var dt=!1;if(st.dragCategoryDisplayInd!==null){var Ct=st.model.categories.map(function(xe){return xe.displayInd});if(dt=st.initialDragCategoryDisplayInds.some(function(xe,ge){return xe!==Ct[ge]}),dt){var Rt=st.model.categories.slice().sort(function(xe,ge){return xe.displayInd-ge.displayInd}),Bt=Rt.map(function(xe){return xe.categoryValue}),Zt=Rt.map(function(xe){return xe.categoryLabel});xt["dimensions["+st.model.containerInd+"].categoryarray"]=[Bt],xt["dimensions["+st.model.containerInd+"].ticktext"]=[Zt],xt["dimensions["+st.model.containerInd+"].categoryorder"]="array"}}if(st.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!st.dragHasMoved&&st.potentialClickBand&&(st.parcatsViewModel.hoveron==="color"?N(st.potentialClickBand,"plotly_click",f.event.sourceEvent):S(st.potentialClickBand,"plotly_click",f.event.sourceEvent)),st.model.dragX=null,st.dragCategoryDisplayInd!==null){var Gt=st.parcatsViewModel.dimensions[st.dragDimensionDisplayInd].categories[st.dragCategoryDisplayInd];Gt.model.dragY=null,st.dragCategoryDisplayInd=null}st.dragDimensionDisplayInd=null,st.parcatsViewModel.dragDimension=null,st.dragHasMoved=null,st.potentialClickBand=null,gt(st.parcatsViewModel),rt(st.parcatsViewModel);var ee=f.transition().duration(300).ease("cubic-in-out");ee.each(function(){bt(st.parcatsViewModel,!0),ht(st.parcatsViewModel,!0)}).each("end",function(){(mt||dt)&&z.restyle(st.parcatsViewModel.graphDiv,xt,[ot])})}}function tt(st){for(var xt,ot=st.graphDiv._fullData,J=0;J=0;Bt--)Zt+="C"+Ct[Bt]+","+(xt[Bt+1]+J)+" "+dt[Bt]+","+(xt[Bt]+J)+" "+(st[Bt]+ot[Bt])+","+(xt[Bt]+J),Zt+="l-"+ot[Bt]+",0 ";return Zt+="Z",Zt}function rt(st){var xt=st.dimensions,ot=st.model,J=xt.map(function(Er){return Er.categories.map(function(dn){return dn.y})}),mt=st.model.dimensions.map(function(Er){return Er.categories.map(function(dn){return dn.displayInd})}),dt=st.model.dimensions.map(function(Er){return Er.displayInd}),Ct=st.dimensions.map(function(Er){return Er.model.dimensionInd}),Rt=xt.map(function(Er){return Er.x}),Bt=xt.map(function(Er){return Er.width}),Zt=[];for(var Gt in ot.paths)ot.paths.hasOwnProperty(Gt)&&Zt.push(ot.paths[Gt]);function ee(Er){var dn=Er.categoryInds.map(function(Oe,Xt){return mt[Xt][Oe]}),_n=Ct.map(function(Oe){return dn[Oe]});return _n}Zt.sort(function(Er,dn){var _n=ee(Er),Oe=ee(dn);return st.sortpaths==="backward"&&(_n.reverse(),Oe.reverse()),_n.push(Er.valueInds[0]),Oe.push(dn.valueInds[0]),st.bundlecolors&&(_n.unshift(Er.rawColor),Oe.unshift(dn.rawColor)),_nOe?1:0});for(var xe=new Array(Zt.length),ge=xt[0].model.count,ye=xt[0].categories.map(function(Er){return Er.height}).reduce(function(Er,dn){return Er+dn}),ue=0;ue0?Ot=ye*(Mt.count/ge):Ot=0;for(var Lt=new Array(J.length),ie=0;ie1?Ct=(st.width-2*ot-J)/(mt-1):Ct=0,Rt=ot,Bt=Rt+Ct*dt;var Zt=[],Gt=st.model.maxCats,ee=xt.categories.length,xe=8,ge=xt.count,ye=st.height-xe*(Gt-1),ue,Mt,Ot,Lt,ie,be=(Gt-ee)*xe/2,ce=xt.categories.map(function(Le){return{displayInd:Le.displayInd,categoryInd:Le.categoryInd}});for(ce.sort(function(Le,Ze){return Le.displayInd-Ze.displayInd}),ie=0;ie0?ue=Mt.count/ge*ye:ue=0,Ot={key:Mt.valueInds[0],model:Mt,width:J,height:ue,y:Mt.dragY!==null?Mt.dragY:be,bands:[],parcatsViewModel:st},be=be+ue+xe,Zt.push(Ot);return{key:xt.dimensionInd,x:xt.dragX!==null?xt.dragX:Bt,y:0,width:J,model:xt,categories:Zt,parcatsViewModel:st,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),vz=It((et,Y)=>{var f=ZQ();Y.exports=function(y,z,P,n){var i=y._fullLayout,a=i._paper,l=i._size;f(y,a,z,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},P,n)}}),KQ=It(et=>{var Y=Mf().getModuleCalcData,f=vz(),y="parcats";et.name=y,et.plot=function(z,P,n,i){var a=Y(z.calcdata,y);if(a.length){var l=a[0];f(z,l,n,i)}},et.clean=function(z,P,n,i){var a=i._has&&i._has("parcats"),l=P._has&&P._has("parcats");a&&!l&&i._paperdiv.selectAll(".parcats").remove()}}),YQ=It((et,Y)=>{Y.exports={attributes:gz(),supplyDefaults:qQ(),calc:GQ(),plot:vz(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:KQ(),categories:["noOpacity"],meta:{}}}),XQ=It((et,Y)=>{Y.exports=YQ()}),my=It((et,Y)=>{var f=Xm(),y="1.13.4",z='© OpenStreetMap contributors',P=['© Carto',z].join(" "),n=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),i=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),a={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:z,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:n,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:n,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:i,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=f(a);Y.exports={requiredVersion:y,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:a,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+y+"."].join(` +`),z=zk().maxDimensionCount,P=jn(),n=1e-6,i=2048,a=new Uint8Array(4),l=new Uint8Array(4),o={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function c(M){M.read({x:0,y:0,width:1,height:1,data:a})}function s(M,p,g,C,S){var N=M._gl;N.enable(N.SCISSOR_TEST),N.scissor(p,g,C,S),M.clear({color:[0,0,0,0],depth:1})}function h(M,p,g,C,S,N){var B=N.key;function U(V){var W=Math.min(C,S-V*C);V===0&&(window.cancelAnimationFrame(g.currentRafs[B]),delete g.currentRafs[B],s(M,N.scissorX,N.scissorY,N.scissorWidth,N.viewBoxSize[1])),!g.clearOnly&&(N.count=2*W,N.offset=2*V*C,p(N),V*C+W>>8*p)%256/255}function _(M,p,g){for(var C=new Array(M*(z+4)),S=0,N=0;NGt&&(Gt=ot[Ct].dim1.canvasX,Bt=Ct);dt===0&&s(S,0,0,W.canvasWidth,W.canvasHeight);var ee=rt(g);for(Ct=0;Ct{var f=Br(),y=jn(),z=y.isArrayOrTypedArray,P=y.numberFormat,n=(NQ(),tn(fz)).default,i=Fs(),a=y.strRotate,l=y.strTranslate,o=uu(),c=Js(),s=ch(),h=e1(),m=h.keyFun,b=h.repeat,x=h.unwrap,_=pz(),A=zk(),d=uz(),k=jQ();function w(bt,vt,ut){return y.aggNums(bt,null,vt,ut)}function D(bt,vt){return I(w(Math.min,bt,vt),w(Math.max,bt,vt))}function E(bt){var vt=bt.range;return vt?I(vt[0],vt[1]):D(bt.values,bt._length)}function I(bt,vt){return(isNaN(bt)||!isFinite(bt))&&(bt=0),(isNaN(vt)||!isFinite(vt))&&(vt=0),bt===vt&&(bt===0?(bt-=1,vt+=1):(bt*=.9,vt*=1.1)),[bt,vt]}function M(bt,vt){return vt?function(ut,rt){var gt=vt[rt];return gt??bt(ut)}:bt}function p(bt,vt,ut,rt,gt){var it=E(ut);return rt?f.scale.ordinal().domain(rt.map(M(P(ut.tickformat),gt))).range(rt.map(function(st){var xt=(st-it[0])/(it[1]-it[0]);return bt-vt+xt*(2*vt-bt)})):f.scale.linear().domain(it).range([bt-vt,vt])}function g(bt,vt){return f.scale.linear().range([vt,bt-vt])}function C(bt,vt){return f.scale.linear().domain(E(bt)).range([vt,1-vt])}function S(bt){if(bt.tickvals){var vt=E(bt);return f.scale.ordinal().domain(bt.tickvals).range(bt.tickvals.map(function(ut){return(ut-vt[0])/(vt[1]-vt[0])}))}}function N(bt){var vt=bt.map(function(it){return it[0]}),ut=bt.map(function(it){var st=n(it[1]);return f.rgb("rgb("+st[0]+","+st[1]+","+st[2]+")")}),rt=function(it){return function(st){return st[it]}},gt="rgb".split("").map(function(it){return f.scale.linear().clamp(!0).domain(vt).range(ut.map(rt(it)))});return function(it){return gt.map(function(st){return st(it)})}}function B(bt){return bt.dimensions.some(function(vt){return vt.brush.filterSpecified})}function U(bt,vt,ut){var rt=x(vt),gt=rt.trace,it=_.convertTypedArray(rt.lineColor),st=gt.line,xt={color:n(gt.unselected.line.color),opacity:gt.unselected.line.opacity},ot=s.extractOpts(st),J=ot.reversescale?s.flipScale(rt.cscale):rt.cscale,mt=gt.domain,dt=gt.dimensions,Ct=bt.width,Rt=gt.labelangle,Bt=gt.labelside,Zt=gt.labelfont,Gt=gt.tickfont,ee=gt.rangefont,xe=y.extendDeepNoArrays({},st,{color:it.map(f.scale.linear().domain(E({values:it,range:[ot.min,ot.max],_length:gt._length}))),blockLineCount:A.blockLineCount,canvasOverdrag:A.overdrag*A.canvasPixelRatio}),ge=Math.floor(Ct*(mt.x[1]-mt.x[0])),ye=Math.floor(bt.height*(mt.y[1]-mt.y[0])),ue=bt.margin||{l:80,r:80,t:100,b:80},Mt=ge,Ot=ye;return{key:ut,colCount:dt.filter(_.isVisible).length,dimensions:dt,tickDistance:A.tickDistance,unitToColor:N(J),lines:xe,deselectedLines:xt,labelAngle:Rt,labelSide:Bt,labelFont:Zt,tickFont:Gt,rangeFont:ee,layoutWidth:Ct,layoutHeight:bt.height,domain:mt,translateX:mt.x[0]*Ct,translateY:bt.height-mt.y[1]*bt.height,pad:ue,canvasWidth:Mt*A.canvasPixelRatio+2*xe.canvasOverdrag,canvasHeight:Ot*A.canvasPixelRatio,width:Mt,height:Ot,canvasPixelRatio:A.canvasPixelRatio}}function V(bt,vt,ut){var rt=ut.width,gt=ut.height,it=ut.dimensions,st=ut.canvasPixelRatio,xt=function(Ct){return rt*Ct/Math.max(1,ut.colCount-1)},ot=A.verticalPadding/gt,J=g(gt,A.verticalPadding),mt={key:ut.key,xScale:xt,model:ut,inBrushDrag:!1},dt={};return mt.dimensions=it.filter(_.isVisible).map(function(Ct,Rt){var Bt=C(Ct,ot),Zt=dt[Ct.label];dt[Ct.label]=(Zt||0)+1;var Gt=Ct.label+(Zt?"__"+Zt:""),ee=Ct.constraintrange,xe=ee&&ee.length;xe&&!z(ee[0])&&(ee=[ee]);var ge=xe?ee.map(function(Ze){return Ze.map(Bt)}):[[-1/0,1/0]],ye=function(){var Ze=mt;Ze.focusLayer&&Ze.focusLayer.render(Ze.panels,!0);var Qe=B(Ze);!bt.contextShown()&&Qe?(Ze.contextLayer&&Ze.contextLayer.render(Ze.panels,!0),bt.contextShown(!0)):bt.contextShown()&&!Qe&&(Ze.contextLayer&&Ze.contextLayer.render(Ze.panels,!0,!0),bt.contextShown(!1))},ue=Ct.values;ue.length>Ct._length&&(ue=ue.slice(0,Ct._length));var Mt=Ct.tickvals,Ot;function Lt(Ze,Qe){return{val:Ze,text:Ot[Qe]}}function ie(Ze,Qe){return Ze.val-Qe.val}if(z(Mt)&&Mt.length){y.isTypedArray(Mt)&&(Mt=Array.from(Mt)),Ot=Ct.ticktext,!z(Ot)||!Ot.length?Ot=Mt.map(P(Ct.tickformat)):Ot.length>Mt.length?Ot=Ot.slice(0,Mt.length):Mt.length>Ot.length&&(Mt=Mt.slice(0,Ot.length));for(var be=1;be=Ze||Jr>=Qe)return;var an=ce.lineLayer.readPixel(fr,Qe-1-Jr),Er=an[3]!==0,dn=Er?an[2]+256*(an[1]+256*an[0]):null,_n={x:fr,y:Jr,clientX:Le.clientX,clientY:Le.clientY,dataIndex:ce.model.key,curveNumber:dn};dn!==Rt&&(Er?rt.hover(_n):rt.unhover&&rt.unhover(_n),Rt=dn)}}),Ct.style("opacity",function(ce){return ce.pick?0:1}),st.style("background","rgba(255, 255, 255, 0)");var Zt=st.selectAll("."+A.cn.parcoords).data(dt,m);Zt.exit().remove(),Zt.enter().append("g").classed(A.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Zt.attr("transform",function(ce){return l(ce.model.translateX,ce.model.translateY)});var Gt=Zt.selectAll("."+A.cn.parcoordsControlView).data(b,m);Gt.enter().append("g").classed(A.cn.parcoordsControlView,!0),Gt.attr("transform",function(ce){return l(ce.model.pad.l,ce.model.pad.t)});var ee=Gt.selectAll("."+A.cn.yAxis).data(function(ce){return ce.dimensions},m);ee.enter().append("g").classed(A.cn.yAxis,!0),Gt.each(function(ce){q(ee,ce,ot)}),Ct.each(function(ce){if(ce.viewModel){!ce.lineLayer||rt?ce.lineLayer=k(this,ce):ce.lineLayer.update(ce),(ce.key||ce.key===0)&&(ce.viewModel[ce.key]=ce.lineLayer);var Le=!ce.context||rt;ce.lineLayer.render(ce.viewModel.panels,Le)}}),ee.attr("transform",function(ce){return l(ce.xScale(ce.xIndex),0)}),ee.call(f.behavior.drag().origin(function(ce){return ce}).on("drag",function(ce){var Le=ce.parent;mt.linePickActive(!1),ce.x=Math.max(-A.overdrag,Math.min(ce.model.width+A.overdrag,f.event.x)),ce.canvasX=ce.x*ce.model.canvasPixelRatio,ee.sort(function(Ze,Qe){return Ze.x-Qe.x}).each(function(Ze,Qe){Ze.xIndex=Qe,Ze.x=ce===Ze?Ze.x:Ze.xScale(Ze.xIndex),Ze.canvasX=Ze.x*Ze.model.canvasPixelRatio}),q(ee,Le,ot),ee.filter(function(Ze){return Math.abs(ce.xIndex-Ze.xIndex)!==0}).attr("transform",function(Ze){return l(Ze.xScale(Ze.xIndex),0)}),f.select(this).attr("transform",l(ce.x,0)),ee.each(function(Ze,Qe,mr){mr===ce.parent.key&&(Le.dimensions[Qe]=Ze)}),Le.contextLayer&&Le.contextLayer.render(Le.panels,!1,!B(Le)),Le.focusLayer.render&&Le.focusLayer.render(Le.panels)}).on("dragend",function(ce){var Le=ce.parent;ce.x=ce.xScale(ce.xIndex),ce.canvasX=ce.x*ce.model.canvasPixelRatio,q(ee,Le,ot),f.select(this).attr("transform",function(Ze){return l(Ze.x,0)}),Le.contextLayer&&Le.contextLayer.render(Le.panels,!1,!B(Le)),Le.focusLayer&&Le.focusLayer.render(Le.panels),Le.pickLayer&&Le.pickLayer.render(Le.panels,!0),mt.linePickActive(!0),rt&&rt.axesMoved&&rt.axesMoved(Le.key,Le.dimensions.map(function(Ze){return Ze.crossfilterDimensionIndex}))})),ee.exit().remove();var xe=ee.selectAll("."+A.cn.axisOverlays).data(b,m);xe.enter().append("g").classed(A.cn.axisOverlays,!0),xe.selectAll("."+A.cn.axis).remove();var ge=xe.selectAll("."+A.cn.axis).data(b,m);ge.enter().append("g").classed(A.cn.axis,!0),ge.each(function(ce){var Le=ce.model.height/ce.model.tickDistance,Ze=ce.domainScale,Qe=Ze.domain();f.select(this).call(f.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Le,ce.tickFormat).tickValues(ce.ordinal?Qe:null).tickFormat(function(mr){return _.isOrdinal(ce)?mr:tt(ce.model.dimensions[ce.visibleIndex],mr)}).scale(Ze)),c.font(ge.selectAll("text"),ce.model.tickFont)}),ge.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),ge.selectAll("text").style("cursor","default");var ye=xe.selectAll("."+A.cn.axisHeading).data(b,m);ye.enter().append("g").classed(A.cn.axisHeading,!0);var ue=ye.selectAll("."+A.cn.axisTitle).data(b,m);ue.enter().append("text").classed(A.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",gt?"none":"auto"),ue.text(function(ce){return ce.label}).each(function(ce){var Le=f.select(this);c.font(Le,ce.model.labelFont),o.convertToTspans(Le,bt)}).attr("transform",function(ce){var Le=H(ce.model.labelAngle,ce.model.labelSide),Ze=A.axisTitleOffset;return(Le.dir>0?"":l(0,2*Ze+ce.model.height))+a(Le.degrees)+l(-Ze*Le.dx,-Ze*Le.dy)}).attr("text-anchor",function(ce){var Le=H(ce.model.labelAngle,ce.model.labelSide),Ze=Math.abs(Le.dx),Qe=Math.abs(Le.dy);return 2*Ze>Qe?Le.dir*Le.dx<0?"start":"end":"middle"});var Mt=xe.selectAll("."+A.cn.axisExtent).data(b,m);Mt.enter().append("g").classed(A.cn.axisExtent,!0);var Ot=Mt.selectAll("."+A.cn.axisExtentTop).data(b,m);Ot.enter().append("g").classed(A.cn.axisExtentTop,!0),Ot.attr("transform",l(0,-A.axisExtentOffset));var Lt=Ot.selectAll("."+A.cn.axisExtentTopText).data(b,m);Lt.enter().append("text").classed(A.cn.axisExtentTopText,!0).call(W),Lt.text(function(ce){return ht(ce,!0)}).each(function(ce){c.font(f.select(this),ce.model.rangeFont)});var ie=Mt.selectAll("."+A.cn.axisExtentBottom).data(b,m);ie.enter().append("g").classed(A.cn.axisExtentBottom,!0),ie.attr("transform",function(ce){return l(0,ce.model.height+A.axisExtentOffset)});var be=ie.selectAll("."+A.cn.axisExtentBottomText).data(b,m);be.enter().append("text").classed(A.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(W),be.text(function(ce){return ht(ce,!1)}).each(function(ce){c.font(f.select(this),ce.model.rangeFont)}),d.ensureAxisBrush(xe,J,bt)}}),mz=It((a,Y)=>{var f=UQ(),y=pA(),z=pz().isVisible,P={};function n(l,o,c){var s=o.indexOf(c),h=l.indexOf(s);return h===-1&&(h+=o.length),h}function i(l,o){return function(c,s){return n(l,o,c)-n(l,o,s)}}var a=Y.exports=function(l,o){var c=l._fullLayout,s=y(l,[],P);if(s){var h={},m={},b={},x={},_=c._size;o.forEach(function(D,E){var I=D[0].trace;b[E]=I.index;var M=x[E]=I.index;h[E]=l.data[M].dimensions,m[E]=l.data[M].dimensions.slice()});var A=function(D,E,I){var M=m[D][E],p=I.map(function(U){return U.slice()}),g="dimensions["+E+"].constraintrange",C=c._tracePreGUI[l._fullData[b[D]]._fullInput.uid];if(C[g]===void 0){var S=M.constraintrange;C[g]=S||null}var N=l._fullData[b[D]].dimensions[E];p.length?(p.length===1&&(p=p[0]),M.constraintrange=p,N.constraintrange=p.slice(),p=[p]):(delete M.constraintrange,delete N.constraintrange,p=null);var B={};B[g]=p,l.emit("plotly_restyle",[B,[x[D]]])},d=function(D){l.emit("plotly_hover",D)},k=function(D){l.emit("plotly_unhover",D)},w=function(D,E){var I=i(E,m[D].filter(z));h[D].sort(I),m[D].filter(function(M){return!z(M)}).sort(function(M){return m[D].indexOf(M)}).forEach(function(M){h[D].splice(h[D].indexOf(M),1),h[D].splice(m[D].indexOf(M),0,M)}),l.emit("plotly_restyle",[{dimensions:[h[D]]},[x[D]]])};f(l,o,{width:_.w,height:_.h,margin:{t:_.t,r:_.r,b:_.b,l:_.l}},{filterChanged:A,hover:d,unhover:k,axesMoved:w})}};a.reglPrecompiled=P}),$Q=It(et=>{var Y=Br(),f=Mf().getModuleCalcData,y=mz(),z=k0();et.name="parcoords",et.plot=function(P){var n=f(P.calcdata,"parcoords")[0];n.length&&y(P,n)},et.clean=function(P,n,i,a){var l=a._has&&a._has("parcoords"),o=n._has&&n._has("parcoords");l&&!o&&(a._paperdiv.selectAll(".parcoords").remove(),a._glimages.selectAll("*").remove())},et.toSVG=function(P){var n=P._fullLayout._glimages,i=Y.select(P).selectAll(".svg-container"),a=i.filter(function(o,c){return c===i.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function l(){var o=this,c=o.toDataURL("image/png"),s=n.append("svg:image");s.attr({xmlns:z.svg,"xlink:href":c,preserveAspectRatio:"none",x:0,y:0,width:o.style.width,height:o.style.height})}a.each(l),window.setTimeout(function(){Y.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),HQ=It((et,Y)=>{Y.exports={attributes:cz(),supplyDefaults:DQ(),calc:zQ(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:$Q(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),VQ=It((et,Y)=>{var f=HQ();f.plot=mz(),Y.exports=f}),WQ=It((et,Y)=>{Y.exports=VQ()}),gz=It((et,Y)=>{var f=Yn().extendFlat,y=xa(),z=hi(),P=Ru(),{hovertemplateAttrs:n,templatefallbackAttrs:i}=nu(),a=Jh().attributes,l=f({editType:"calc"},P("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:n({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:i({editType:"plot"})});Y.exports={domain:a({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:f({},y.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:n({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:i({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:z({editType:"calc"}),tickfont:z({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}),qQ=It((et,Y)=>{var f=jn(),y=fp().hasColorscale,z=Cu(),P=Jh().defaults,n=Zf(),i=gz(),a=mA(),l=Xn().isTypedArraySpec;function o(s,h,m,b,x){x("line.shape"),x("line.hovertemplate"),x("line.hovertemplatefallback");var _=x("line.color",b.colorway[0]);if(y(s,"line")&&f.isArrayOrTypedArray(_)){if(_.length)return x("line.colorscale"),z(s,h,b,x,{prefix:"line.",cLetter:"c"}),_.length;h.line.color=m}return 1/0}function c(s,h){function m(w,D){return f.coerce(s,h,i.dimensions,w,D)}var b=m("values"),x=m("visible");if(b&&b.length||(x=h.visible=!1),x){m("label"),m("displayindex",h._index);var _=s.categoryarray,A=f.isArrayOrTypedArray(_)&&_.length>0||l(_),d;A&&(d="array");var k=m("categoryorder",d);k==="array"?(m("categoryarray"),m("ticktext")):(delete s.categoryarray,delete s.ticktext),!A&&k==="array"&&(h.categoryorder="trace")}}Y.exports=function(s,h,m,b){function x(k,w){return f.coerce(s,h,i,k,w)}var _=n(s,h,{name:"dimensions",handleItemDefaults:c}),A=o(s,h,m,b,x);P(h,b,x),(!Array.isArray(_)||!_.length)&&(h.visible=!1),a(h,_,"values",A),x("hoveron"),x("hovertemplate"),x("hovertemplatefallback"),x("arrangement"),x("bundlecolors"),x("sortpaths"),x("counts");var d=b.font;f.coerceFont(x,"labelfont",d,{overrideDflt:{size:Math.round(d.size)}}),f.coerceFont(x,"tickfont",d,{autoShadowDflt:!0,overrideDflt:{size:Math.round(d.size/1.2)}})}}),GQ=It((et,Y)=>{var f=e1().wrap,y=fp().hasColorscale,z=Cp(),P=$u(),n=Js(),i=jn(),a=Sr();Y.exports=function(d,k){var w=i.filterVisible(k.dimensions);if(w.length===0)return[];var D=w.map(function(ut){var rt;if(ut.categoryorder==="trace")rt=null;else if(ut.categoryorder==="array")rt=ut.categoryarray;else{rt=P(ut.values);for(var gt=!0,it=0;it=d.length||k[d[w]]!==void 0)return!1;k[d[w]]=!0}return!0}}),ZQ=It((et,Y)=>{var f=Br(),y=(Lb(),tn($_)).interpolateNumber,z=Aw(),P=hd(),n=jn(),i=n.strTranslate,a=Js(),l=Xi(),o=uu();function c(st,xt,ot,J){var mt=xt._context.staticPlot,dt=st.map(vt.bind(0,xt,ot)),Ct=J.selectAll("g.parcatslayer").data([null]);Ct.enter().append("g").attr("class","parcatslayer").style("pointer-events",mt?"none":"all");var Rt=Ct.selectAll("g.trace.parcats").data(dt,s),Bt=Rt.enter().append("g").attr("class","trace parcats");Rt.attr("transform",function(Lt){return i(Lt.x,Lt.y)}),Bt.append("g").attr("class","paths");var Zt=Rt.select("g.paths"),Gt=Zt.selectAll("path.path").data(function(Lt){return Lt.paths},s);Gt.attr("fill",function(Lt){return Lt.model.color});var ee=Gt.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Lt){return Lt.model.color}).attr("fill-opacity",0);k(ee),Gt.attr("d",function(Lt){return Lt.svgD}),ee.empty()||Gt.sort(m),Gt.exit().remove(),Gt.on("mouseover",b).on("mouseout",x).on("click",d),Bt.append("g").attr("class","dimensions");var xe=Rt.select("g.dimensions"),ge=xe.selectAll("g.dimension").data(function(Lt){return Lt.dimensions},s);ge.enter().append("g").attr("class","dimension"),ge.attr("transform",function(Lt){return i(Lt.x,0)}),ge.exit().remove();var ye=ge.selectAll("g.category").data(function(Lt){return Lt.categories},s),ue=ye.enter().append("g").attr("class","category");ye.attr("transform",function(Lt){return i(0,Lt.y)}),ue.append("rect").attr("class","catrect").attr("pointer-events","none"),ye.select("rect.catrect").attr("fill","none").attr("width",function(Lt){return Lt.width}).attr("height",function(Lt){return Lt.height}),E(ue);var Mt=ye.selectAll("rect.bandrect").data(function(Lt){return Lt.bands},s);Mt.each(function(){n.raiseToTop(this)}),Mt.attr("fill",function(Lt){return Lt.color});var Ot=Mt.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Lt){return Lt.color}).attr("fill-opacity",0);Mt.attr("fill",function(Lt){return Lt.color}).attr("width",function(Lt){return Lt.width}).attr("height",function(Lt){return Lt.height}).attr("y",function(Lt){return Lt.y}).attr("cursor",function(Lt){return Lt.parcatsViewModel.arrangement==="fixed"?"default":Lt.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),M(Ot),Mt.exit().remove(),ue.append("text").attr("class","catlabel").attr("pointer-events","none"),ye.select("text.catlabel").attr("text-anchor",function(Lt){return h(Lt)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Lt){return h(Lt)?Lt.width+5:-5}).attr("y",function(Lt){return Lt.height/2}).text(function(Lt){return Lt.model.categoryLabel}).each(function(Lt){a.font(f.select(this),Lt.parcatsViewModel.categorylabelfont),o.convertToTspans(f.select(this),xt)}),ue.append("text").attr("class","dimlabel"),ye.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Lt){return Lt.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Lt){return Lt.width/2}).attr("y",-5).text(function(Lt,ie){return ie===0?Lt.parcatsViewModel.model.dimensions[Lt.model.dimensionInd].dimensionLabel:null}).each(function(Lt){a.font(f.select(this),Lt.parcatsViewModel.labelfont)}),ye.selectAll("rect.bandrect").on("mouseover",W).on("mouseout",F),ye.exit().remove(),ge.call(f.behavior.drag().origin(function(Lt){return{x:Lt.x,y:0}}).on("dragstart",H).on("drag",q).on("dragend",G)),Rt.each(function(Lt){Lt.traceSelection=f.select(this),Lt.pathSelection=f.select(this).selectAll("g.paths").selectAll("path.path"),Lt.dimensionSelection=f.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Rt.exit().remove()}Y.exports=function(st,xt,ot,J){c(ot,st,J,xt)};function s(st){return st.key}function h(st){var xt=st.parcatsViewModel.dimensions.length,ot=st.parcatsViewModel.dimensions[xt-1].model.dimensionInd;return st.model.dimensionInd===ot}function m(st,xt){return st.model.rawColor>xt.model.rawColor?1:st.model.rawColor"),Le=f.mouse(mt)[0];P.loneHover({trace:dt,x:ye-Rt.left+Bt.left,y:ue-Rt.top+Bt.top,text:ce,color:st.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Mt,idealAlign:Le1&&Zt.displayInd===Bt.dimensions.length-1?(xe=Ct.left,ge="left"):(xe=Ct.left+Ct.width,ge="right");var ye=Rt.model.count,ue=Rt.model.categoryLabel,Mt=ye/Rt.parcatsViewModel.model.count,Ot={countLabel:ye,categoryLabel:ue,probabilityLabel:Mt.toFixed(3)},Lt=[];Rt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Lt.push(["Count:",Ot.countLabel].join(" ")),Rt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Lt.push(["P("+Ot.categoryLabel+"):",Ot.probabilityLabel].join(" "));var ie=Lt.join("
");return{trace:Gt,x:J*(xe-xt.left),y:mt*(ee-xt.top),text:ie,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:ge,hovertemplate:Gt.hovertemplate,hovertemplateLabels:Ot,eventData:[{data:Gt._input,fullData:Gt,count:ye,category:ue,probability:Mt}]}}function U(st,xt,ot){var J=[];return f.select(ot.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var mt=this;J.push(B(st,xt,mt))}),J}function V(st,xt,ot){st._fullLayout._calcInverseTransform(st);var J=st._fullLayout._invScaleX,mt=st._fullLayout._invScaleY,dt=ot.getBoundingClientRect(),Ct=f.select(ot).datum(),Rt=Ct.categoryViewModel,Bt=Rt.parcatsViewModel,Zt=Bt.model.dimensions[Rt.model.dimensionInd],Gt=Bt.trace,ee=dt.y+dt.height/2,xe,ge;Bt.dimensions.length>1&&Zt.displayInd===Bt.dimensions.length-1?(xe=dt.left,ge="left"):(xe=dt.left+dt.width,ge="right");var ye=Rt.model.categoryLabel,ue=Ct.parcatsViewModel.model.count,Mt=0;Ct.categoryViewModel.bands.forEach(function(fr){fr.color===Ct.color&&(Mt+=fr.count)});var Ot=Rt.model.count,Lt=0;Bt.pathSelection.each(function(fr){fr.model.color===Ct.color&&(Lt+=fr.model.count)});var ie=Mt/ue,be=Mt/Lt,ce=Mt/Ot,Le={countLabel:Mt,categoryLabel:ye,probabilityLabel:ie.toFixed(3)},Ze=[];Rt.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ze.push(["Count:",Le.countLabel].join(" ")),Rt.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ze.push("P(color ∩ "+ye+"): "+Le.probabilityLabel),Ze.push("P("+ye+" | color): "+be.toFixed(3)),Ze.push("P(color | "+ye+"): "+ce.toFixed(3)));var Qe=Ze.join("
"),mr=l.mostReadable(Ct.color,["black","white"]);return{trace:Gt,x:J*(xe-xt.left),y:mt*(ee-xt.top),text:Qe,color:Ct.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:mr,fontSize:10,idealAlign:ge,hovertemplate:Gt.hovertemplate,hovertemplateLabels:Le,eventData:[{data:Gt._input,fullData:Gt,category:ye,count:ue,probability:ie,categorycount:Ot,colorcount:Lt,bandcolorcount:Mt}]}}function W(st){if(!st.parcatsViewModel.dragDimension&&st.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var xt=f.mouse(this)[1];if(xt<-1)return;var ot=st.parcatsViewModel.graphDiv,J=ot._fullLayout,mt=J._paperdiv.node().getBoundingClientRect(),dt=st.parcatsViewModel.hoveron,Ct=this;if(dt==="color"?(C(Ct),N(Ct,"plotly_hover",f.event)):(g(Ct),S(Ct,"plotly_hover",f.event)),st.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Rt;dt==="category"?Rt=B(ot,mt,Ct):dt==="color"?Rt=V(ot,mt,Ct):dt==="dimension"&&(Rt=U(ot,mt,Ct)),Rt&&P.loneHover(Rt,{container:J._hoverlayer.node(),outerContainer:J._paper.node(),gd:ot})}}}function F(st){var xt=st.parcatsViewModel;if(!xt.dragDimension&&(k(xt.pathSelection),E(xt.dimensionSelection.selectAll("g.category")),M(xt.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),P.loneUnhover(xt.graphDiv._fullLayout._hoverlayer.node()),xt.pathSelection.sort(m),xt.hoverinfoItems.indexOf("skip")===-1)){var ot=st.parcatsViewModel.hoveron,J=this;ot==="color"?N(J,"plotly_unhover",f.event):S(J,"plotly_unhover",f.event)}}function H(st){st.parcatsViewModel.arrangement!=="fixed"&&(st.dragDimensionDisplayInd=st.model.displayInd,st.initialDragDimensionDisplayInds=st.parcatsViewModel.model.dimensions.map(function(xt){return xt.displayInd}),st.dragHasMoved=!1,st.dragCategoryDisplayInd=null,f.select(this).selectAll("g.category").select("rect.catrect").each(function(xt){var ot=f.mouse(this)[0],J=f.mouse(this)[1];-2<=ot&&ot<=xt.width+2&&-2<=J&&J<=xt.height+2&&(st.dragCategoryDisplayInd=xt.model.displayInd,st.initialDragCategoryDisplayInds=st.model.categories.map(function(mt){return mt.displayInd}),xt.model.dragY=xt.y,n.raiseToTop(this.parentNode),f.select(this.parentNode).selectAll("rect.bandrect").each(function(mt){mt.yGt.y+Gt.height/2&&(dt.model.displayInd=Gt.model.displayInd,Gt.model.displayInd=Rt),st.dragCategoryDisplayInd=dt.model.displayInd}if(st.dragCategoryDisplayInd===null||st.parcatsViewModel.arrangement==="freeform"){mt.model.dragX=f.event.x;var ee=st.parcatsViewModel.dimensions[ot],xe=st.parcatsViewModel.dimensions[J];ee!==void 0&&mt.model.dragXxe.x&&(mt.model.displayInd=xe.model.displayInd,xe.model.displayInd=st.dragDimensionDisplayInd),st.dragDimensionDisplayInd=mt.model.displayInd}gt(st.parcatsViewModel),rt(st.parcatsViewModel),bt(st.parcatsViewModel),ht(st.parcatsViewModel)}}function G(st){if(st.parcatsViewModel.arrangement!=="fixed"&&st.dragDimensionDisplayInd!==null){f.select(this).selectAll("text").attr("font-weight","normal");var xt={},ot=tt(st.parcatsViewModel),J=st.parcatsViewModel.model.dimensions.map(function(xe){return xe.displayInd}),mt=st.initialDragDimensionDisplayInds.some(function(xe,ge){return xe!==J[ge]});mt&&J.forEach(function(xe,ge){var ye=st.parcatsViewModel.model.dimensions[ge].containerInd;xt["dimensions["+ye+"].displayindex"]=xe});var dt=!1;if(st.dragCategoryDisplayInd!==null){var Ct=st.model.categories.map(function(xe){return xe.displayInd});if(dt=st.initialDragCategoryDisplayInds.some(function(xe,ge){return xe!==Ct[ge]}),dt){var Rt=st.model.categories.slice().sort(function(xe,ge){return xe.displayInd-ge.displayInd}),Bt=Rt.map(function(xe){return xe.categoryValue}),Zt=Rt.map(function(xe){return xe.categoryLabel});xt["dimensions["+st.model.containerInd+"].categoryarray"]=[Bt],xt["dimensions["+st.model.containerInd+"].ticktext"]=[Zt],xt["dimensions["+st.model.containerInd+"].categoryorder"]="array"}}if(st.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!st.dragHasMoved&&st.potentialClickBand&&(st.parcatsViewModel.hoveron==="color"?N(st.potentialClickBand,"plotly_click",f.event.sourceEvent):S(st.potentialClickBand,"plotly_click",f.event.sourceEvent)),st.model.dragX=null,st.dragCategoryDisplayInd!==null){var Gt=st.parcatsViewModel.dimensions[st.dragDimensionDisplayInd].categories[st.dragCategoryDisplayInd];Gt.model.dragY=null,st.dragCategoryDisplayInd=null}st.dragDimensionDisplayInd=null,st.parcatsViewModel.dragDimension=null,st.dragHasMoved=null,st.potentialClickBand=null,gt(st.parcatsViewModel),rt(st.parcatsViewModel);var ee=f.transition().duration(300).ease("cubic-in-out");ee.each(function(){bt(st.parcatsViewModel,!0),ht(st.parcatsViewModel,!0)}).each("end",function(){(mt||dt)&&z.restyle(st.parcatsViewModel.graphDiv,xt,[ot])})}}function tt(st){for(var xt,ot=st.graphDiv._fullData,J=0;J=0;Bt--)Zt+="C"+Ct[Bt]+","+(xt[Bt+1]+J)+" "+dt[Bt]+","+(xt[Bt]+J)+" "+(st[Bt]+ot[Bt])+","+(xt[Bt]+J),Zt+="l-"+ot[Bt]+",0 ";return Zt+="Z",Zt}function rt(st){var xt=st.dimensions,ot=st.model,J=xt.map(function(Er){return Er.categories.map(function(dn){return dn.y})}),mt=st.model.dimensions.map(function(Er){return Er.categories.map(function(dn){return dn.displayInd})}),dt=st.model.dimensions.map(function(Er){return Er.displayInd}),Ct=st.dimensions.map(function(Er){return Er.model.dimensionInd}),Rt=xt.map(function(Er){return Er.x}),Bt=xt.map(function(Er){return Er.width}),Zt=[];for(var Gt in ot.paths)ot.paths.hasOwnProperty(Gt)&&Zt.push(ot.paths[Gt]);function ee(Er){var dn=Er.categoryInds.map(function(Oe,Xt){return mt[Xt][Oe]}),_n=Ct.map(function(Oe){return dn[Oe]});return _n}Zt.sort(function(Er,dn){var _n=ee(Er),Oe=ee(dn);return st.sortpaths==="backward"&&(_n.reverse(),Oe.reverse()),_n.push(Er.valueInds[0]),Oe.push(dn.valueInds[0]),st.bundlecolors&&(_n.unshift(Er.rawColor),Oe.unshift(dn.rawColor)),_nOe?1:0});for(var xe=new Array(Zt.length),ge=xt[0].model.count,ye=xt[0].categories.map(function(Er){return Er.height}).reduce(function(Er,dn){return Er+dn}),ue=0;ue0?Ot=ye*(Mt.count/ge):Ot=0;for(var Lt=new Array(J.length),ie=0;ie1?Ct=(st.width-2*ot-J)/(mt-1):Ct=0,Rt=ot,Bt=Rt+Ct*dt;var Zt=[],Gt=st.model.maxCats,ee=xt.categories.length,xe=8,ge=xt.count,ye=st.height-xe*(Gt-1),ue,Mt,Ot,Lt,ie,be=(Gt-ee)*xe/2,ce=xt.categories.map(function(Le){return{displayInd:Le.displayInd,categoryInd:Le.categoryInd}});for(ce.sort(function(Le,Ze){return Le.displayInd-Ze.displayInd}),ie=0;ie0?ue=Mt.count/ge*ye:ue=0,Ot={key:Mt.valueInds[0],model:Mt,width:J,height:ue,y:Mt.dragY!==null?Mt.dragY:be,bands:[],parcatsViewModel:st},be=be+ue+xe,Zt.push(Ot);return{key:xt.dimensionInd,x:xt.dragX!==null?xt.dragX:Bt,y:0,width:J,model:xt,categories:Zt,parcatsViewModel:st,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),vz=It((et,Y)=>{var f=ZQ();Y.exports=function(y,z,P,n){var i=y._fullLayout,a=i._paper,l=i._size;f(y,a,z,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},P,n)}}),KQ=It(et=>{var Y=Mf().getModuleCalcData,f=vz(),y="parcats";et.name=y,et.plot=function(z,P,n,i){var a=Y(z.calcdata,y);if(a.length){var l=a[0];f(z,l,n,i)}},et.clean=function(z,P,n,i){var a=i._has&&i._has("parcats"),l=P._has&&P._has("parcats");a&&!l&&i._paperdiv.selectAll(".parcats").remove()}}),YQ=It((et,Y)=>{Y.exports={attributes:gz(),supplyDefaults:qQ(),calc:GQ(),plot:vz(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:KQ(),categories:["noOpacity"],meta:{}}}),XQ=It((et,Y)=>{Y.exports=YQ()}),my=It((et,Y)=>{var f=Xm(),y="1.13.4",z='© OpenStreetMap contributors',P=['© Carto',z].join(" "),n=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),i=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),a={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:z,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:n,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:n,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:i,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=f(a);Y.exports={requiredVersion:y,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:a,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+y+"."].join(` `),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` `),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` `),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` -`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}),Rk=It((et,Y)=>{var f=jn(),y=Hn().defaultLine,z=Jh().attributes,P=hi(),n=dd().textposition,i=sh().overrideAll,a=Tc().templatedArray,l=my(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var c=Y.exports=i({_arrayAttrRegexps:[f.counterRegex("mapbox",".layers",!0)],domain:z({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:l.styleValuesMapbox.concat(l.styleValuesNonMapbox),dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:f.extendFlat({},n,{arrayOk:!1})}})},"plot","from-root");c.uirevision={valType:"any",editType:"none"}}),yA=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=Pb(),i=dd(),a=Rk(),l=xa(),o=Ru(),c=Yn().extendFlat,s=sh().overrideAll,h=Rk(),m=n.line,b=n.marker;Y.exports=s({lon:n.lon,lat:n.lat,cluster:{enabled:{valType:"boolean"},maxzoom:c({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:c({},b.opacity,{dflt:1})},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:c({},i.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:i.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:n.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:i.selected.marker},unselected:{marker:i.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:f(),hovertemplatefallback:z()},"calc","nested")}),yz=It((et,Y)=>{var f=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return f.indexOf(y)!==-1}}}),JQ=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=pm(),i=Pm(),a=yA(),l=yz().isSupportedFont;Y.exports=function(c,s,h,m){function b(g,C){return f.coerce(c,s,a,g,C)}function x(g,C){return f.coerce2(c,s,a,g,C)}var _=o(c,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(c,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(f.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),f.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(c,s,h,m,b,{noDash:!0}),b("connectgaps"));var d=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=d!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;n(c,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&i(c,s,h,b),f.coerceSelectionMarkerOpacity(s,b)};function o(c,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),_z=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot,a=i.mockAxis,l=y.lonlat;return n.lonLabel=f.tickText(a,a.c2l(l[0]),!0).text,n.latLabel=f.tickText(a,a.c2l(l[1]),!0).text,n}}),xz=It((et,Y)=>{var f=jn();Y.exports=function(y,z){var P=y.split(" "),n=P[0],i=P[1],a=f.isArrayOrTypedArray(z)?f.mean(z):z,l=.5+a/100,o=1.5+a/100,c=["",""],s=[0,0];switch(n){case"top":c[0]="top",s[1]=-o;break;case"bottom":c[0]="bottom",s[1]=o;break}switch(i){case"left":c[1]="right",s[0]=-l;break;case"right":c[1]="left",s[0]=l;break}var h;return c[0]&&c[1]?h=c.join("-"):c[0]?h=c[0]:c[1]?h=c[1]:h="center",{anchor:h,offset:s}}}),QQ=It((et,Y)=>{var f=Sr(),y=jn(),z=Dr().BADNUM,P=W_(),n=ch(),i=Js(),a=Hv(),l=Fu(),o=yz().isSupportedFont,c=xz(),s=T0().appendArrayPointValue,h=uu().NEWLINES,m=uu().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),S=l.hasMarkers(M),N=l.hasText(M),B=S&&M.marker.symbol==="circle",U=S&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),H=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:H,symbol:q};if(!p)return G;var tt;if((g||C)&&(tt=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(tt),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(tt),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var ht=x(I);H.geojson=ht.geojson,H.layout.visibility="visible",V&&(H.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat(H.paint,{"circle-color":ht.mcc,"circle-radius":ht.mrc,"circle-opacity":ht.mo})}if(B&&V&&(H.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var bt=(M.marker||{}).size,vt=c(M.textposition,bt);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":vt.anchor,"text-offset":vt.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),S=y.isArrayOrTypedArray(M.opacity),N;function B(vt){return I.opacity*vt}function U(vt){return vt/2}var V;g&&(n.hasColorscale(I,"marker")?V=n.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;S&&(F=function(vt){var ut=f(vt)?+y.constrain(vt,0,1):0;return B(ut)});var H=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),S&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),ttt=It((et,Y)=>{var f=jn(),y=QQ(),z=my().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function n(a,l,o,c){this.type="scattermapbox",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=c,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var i=n.prototype;i.addSource=function(a,l,o){var c={type:"geojson",data:l.geojson};o&&o.enabled&&f.extendFlat(c,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],c)},i.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},i.addLayer=function(a,l,o){var c={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(c.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var S=g[C];c.removeLayer(x.layerIds[S])}p||c.removeSource(x.sourceIds.circle)}function d(p){for(var g=P.nonCluster,C=0;C=0;C--){var S=g[C];c.removeLayer(x.layerIds[S]),p||c.removeSource(x.sourceIds[S])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):d(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var c=l[o];a.removeLayer(this.layerIds[c]),a.removeSource(this.sourceIds[c])}},Y.exports=function(a,l){var o=l[0].trace,c=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new n(a,o.uid,c,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(c)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var f=hd(),y=jn(),z=qc(),P=y.fillText,n=Dr().BADNUM,i=my().traceLayerPrefix;function a(o,c,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],d=i+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[d]});A=w.map(function(W){return W.id})}var D=c>=0?Math.floor((c+180)/360):Math.ceil((c-180)/360),E=D*360,I=c-E;function M(W){var F=W.lonlat;if(F[0]===n||k&&A.indexOf(W.i+1)===-1)return 1/0;var H=y.modHalf(F[0],360),q=F[1],G=_.project([H,q]),tt=G.x-b.c2p([I,q]),ht=G.y-x.c2p([H,s]),bt=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(tt*tt+ht*ht)-bt,1-3/bt)}if(f.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],S=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=S-B,o.x1=S+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,c,s){if(o.hovertemplate)return;var h=c.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=c.lonlat,d=[];function k(w){return w+"°"}return b||x&&_?d.push("("+k(A[1])+", "+k(A[0])+")"):x?d.push(s.lon+k(A[0])):_&&d.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(c,o,d),d.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),ett=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f}}),rtt=It((et,Y)=>{var f=jn(),y=Fu(),z=Dr().BADNUM;Y.exports=function(P,n){var i=P.cd,a=P.xaxis,l=P.yaxis,o=[],c=i[0].trace,s;if(!y.hasMarkers(c))return[];if(n===!1)for(s=0;s{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():(f=f||self,f.mapboxgl=y())})(et,function(){var f,y,z;function P(n,i){if(!f)f=i;else if(!y)y=i;else{var a="var sharedChunk = {}; ("+f+")(sharedChunk); ("+y+")(sharedChunk);",l={};f(l),z=i(l),typeof window<"u"&&(z.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}}return P(["exports"],function(n){function i(v,j){return j={exports:{}},v(j,j.exports),j.exports}var a="1.13.4",l=o;function o(v,j,Q,Tt){this.cx=3*v,this.bx=3*(Q-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*j,this.by=3*(Tt-j)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=Tt,this.p2x=Q,this.p2y=Tt}o.prototype.sampleCurveX=function(v){return((this.ax*v+this.bx)*v+this.cx)*v},o.prototype.sampleCurveY=function(v){return((this.ay*v+this.by)*v+this.cy)*v},o.prototype.sampleCurveDerivativeX=function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},o.prototype.solveCurveX=function(v,j){typeof j>"u"&&(j=1e-6);var Q,Tt,Nt,Yt,se;for(Nt=v,se=0;se<8;se++){if(Yt=this.sampleCurveX(Nt)-v,Math.abs(Yt)Tt)return Tt;for(;QYt?Q=Nt:Tt=Nt,Nt=(Tt-Q)*.5+Q}return Nt},o.prototype.solve=function(v,j){return this.sampleCurveY(this.solveCurveX(v,j))};var c=s;function s(v,j){this.x=v,this.y=j}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(v){return this.clone()._add(v)},sub:function(v){return this.clone()._sub(v)},multByPoint:function(v){return this.clone()._multByPoint(v)},divByPoint:function(v){return this.clone()._divByPoint(v)},mult:function(v){return this.clone()._mult(v)},div:function(v){return this.clone()._div(v)},rotate:function(v){return this.clone()._rotate(v)},rotateAround:function(v,j){return this.clone()._rotateAround(v,j)},matMult:function(v){return this.clone()._matMult(v)},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(v){return this.x===v.x&&this.y===v.y},dist:function(v){return Math.sqrt(this.distSqr(v))},distSqr:function(v){var j=v.x-this.x,Q=v.y-this.y;return j*j+Q*Q},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(v){return Math.atan2(this.y-v.y,this.x-v.x)},angleWith:function(v){return this.angleWithSep(v.x,v.y)},angleWithSep:function(v,j){return Math.atan2(this.x*j-this.y*v,this.x*v+this.y*j)},_matMult:function(v){var j=v[0]*this.x+v[1]*this.y,Q=v[2]*this.x+v[3]*this.y;return this.x=j,this.y=Q,this},_add:function(v){return this.x+=v.x,this.y+=v.y,this},_sub:function(v){return this.x-=v.x,this.y-=v.y,this},_mult:function(v){return this.x*=v,this.y*=v,this},_div:function(v){return this.x/=v,this.y/=v,this},_multByPoint:function(v){return this.x*=v.x,this.y*=v.y,this},_divByPoint:function(v){return this.x/=v.x,this.y/=v.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var v=this.y;return this.y=this.x,this.x=-v,this},_rotate:function(v){var j=Math.cos(v),Q=Math.sin(v),Tt=j*this.x-Q*this.y,Nt=Q*this.x+j*this.y;return this.x=Tt,this.y=Nt,this},_rotateAround:function(v,j){var Q=Math.cos(v),Tt=Math.sin(v),Nt=j.x+Q*(this.x-j.x)-Tt*(this.y-j.y),Yt=j.y+Tt*(this.x-j.x)+Q*(this.y-j.y);return this.x=Nt,this.y=Yt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(v){return v instanceof s?v:Array.isArray(v)?new s(v[0],v[1]):v};var h=typeof self<"u"?self:{};function m(v,j){if(Array.isArray(v)){if(!Array.isArray(j)||v.length!==j.length)return!1;for(var Q=0;Q=1)return 1;var j=v*v,Q=j*v;return 4*(v<.5?Q:3*(v-j)+Q-.75)}function _(v,j,Q,Tt){var Nt=new l(v,j,Q,Tt);return function(Yt){return Nt.solve(Yt)}}var A=_(.25,.1,.25,1);function d(v,j,Q){return Math.min(Q,Math.max(j,v))}function k(v,j,Q){var Tt=Q-j,Nt=((v-j)%Tt+Tt)%Tt+j;return Nt===j?Q:Nt}function w(v,j,Q){if(!v.length)return Q(null,[]);var Tt=v.length,Nt=new Array(v.length),Yt=null;v.forEach(function(se,Ue){j(se,function(nr,Tr){nr&&(Yt=nr),Nt[Ue]=Tr,--Tt===0&&Q(Yt,Nt)})})}function D(v){var j=[];for(var Q in v)j.push(v[Q]);return j}function E(v,j){var Q=[];for(var Tt in v)Tt in j||Q.push(Tt);return Q}function I(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Tt=0,Nt=j;Tt>j/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,v)}return v()}function S(v){return v<=1?1:Math.pow(2,Math.ceil(Math.log(v)/Math.LN2))}function N(v){return v?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(v):!1}function B(v,j){v.forEach(function(Q){j[Q]&&(j[Q]=j[Q].bind(j))})}function U(v,j){return v.indexOf(j,v.length-j.length)!==-1}function V(v,j,Q){var Tt={};for(var Nt in v)Tt[Nt]=j.call(Q||this,v[Nt],Nt,v);return Tt}function W(v,j,Q){var Tt={};for(var Nt in v)j.call(Q||this,v[Nt],Nt,v)&&(Tt[Nt]=v[Nt]);return Tt}function F(v){return Array.isArray(v)?v.map(F):typeof v=="object"&&v?V(v,F):v}function H(v,j){for(var Q=0;Q=0)return!0;return!1}var q={};function G(v){q[v]||(typeof console<"u"&&console.warn(v),q[v]=!0)}function tt(v,j,Q){return(Q.y-v.y)*(j.x-v.x)>(j.y-v.y)*(Q.x-v.x)}function ht(v){for(var j=0,Q=0,Tt=v.length,Nt=Tt-1,Yt=void 0,se=void 0;Q@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,Q={};if(v.replace(j,function(Nt,Yt,se,Ue){var nr=se||Ue;return Q[Yt]=nr?nr.toLowerCase():!0,""}),Q["max-age"]){var Tt=parseInt(Q["max-age"],10);isNaN(Tt)?delete Q["max-age"]:Q["max-age"]=Tt}return Q}var rt=null;function gt(v){if(rt==null){var j=v.navigator?v.navigator.userAgent:null;rt=!!v.safari||!!(j&&(/\b(iPad|iPhone|iPod)\b/.test(j)||j.match("Safari")&&!j.match("Chrome")))}return rt}function it(v){try{var j=h[v];return j.setItem("_mapbox_test_",1),j.removeItem("_mapbox_test_"),!0}catch{return!1}}function st(v){return h.btoa(encodeURIComponent(v).replace(/%([0-9A-F]{2})/g,function(j,Q){return String.fromCharCode(+("0x"+Q))}))}function xt(v){return decodeURIComponent(h.atob(v).split("").map(function(j){return"%"+("00"+j.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ot=h.performance&&h.performance.now?h.performance.now.bind(h.performance):Date.now.bind(Date),J=h.requestAnimationFrame||h.mozRequestAnimationFrame||h.webkitRequestAnimationFrame||h.msRequestAnimationFrame,mt=h.cancelAnimationFrame||h.mozCancelAnimationFrame||h.webkitCancelAnimationFrame||h.msCancelAnimationFrame,dt,Ct,Rt={now:ot,frame:function(v){var j=J(v);return{cancel:function(){return mt(j)}}},getImageData:function(v,j){j===void 0&&(j=0);var Q=h.document.createElement("canvas"),Tt=Q.getContext("2d");if(!Tt)throw new Error("failed to create canvas 2d context");return Q.width=v.width,Q.height=v.height,Tt.drawImage(v,0,0,v.width,v.height),Tt.getImageData(-j,-j,v.width+2*j,v.height+2*j)},resolveURL:function(v){return dt||(dt=h.document.createElement("a")),dt.href=v,dt.href},hardwareConcurrency:h.navigator&&h.navigator.hardwareConcurrency||4,get devicePixelRatio(){return h.devicePixelRatio},get prefersReducedMotion(){return h.matchMedia?(Ct==null&&(Ct=h.matchMedia("(prefers-reduced-motion: reduce)")),Ct.matches):!1}},Bt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Zt={supported:!1,testSupport:ye},Gt,ee=!1,xe,ge=!1;h.document&&(xe=h.document.createElement("img"),xe.onload=function(){Gt&&ue(Gt),Gt=null,ge=!0},xe.onerror=function(){ee=!0,Gt=null},xe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function ye(v){ee||!xe||(ge?ue(v):Gt=v)}function ue(v){var j=v.createTexture();v.bindTexture(v.TEXTURE_2D,j);try{if(v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,xe),v.isContextLost())return;Zt.supported=!0}catch{}v.deleteTexture(j),ee=!0}var Mt="01";function Ot(){for(var v="1",j="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",Q="",Tt=0;Tt<10;Tt++)Q+=j[Math.floor(Math.random()*62)];var Nt=720*60*1e3,Yt=[v,Mt,Q].join(""),se=Date.now()+Nt;return{token:Yt,tokenExpiresAt:se}}var Lt=function(v,j){this._transformRequestFn=v,this._customAccessToken=j,this._createSkuToken()};Lt.prototype._createSkuToken=function(){var v=Ot();this._skuToken=v.token,this._skuTokenExpiresAt=v.tokenExpiresAt},Lt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Lt.prototype.transformRequest=function(v,j){return this._transformRequestFn?this._transformRequestFn(v,j)||{url:v}:{url:v}},Lt.prototype.normalizeStyleURL=function(v,j){if(!ie(v))return v;var Q=mr(v);return Q.path="/styles/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Lt.prototype.normalizeGlyphsURL=function(v,j){if(!ie(v))return v;var Q=mr(v);return Q.path="/fonts/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Lt.prototype.normalizeSourceURL=function(v,j){if(!ie(v))return v;var Q=mr(v);return Q.path="/v4/"+Q.authority+".json",Q.params.push("secure"),this._makeAPIURL(Q,this._customAccessToken||j)},Lt.prototype.normalizeSpriteURL=function(v,j,Q,Tt){var Nt=mr(v);return ie(v)?(Nt.path="/styles/v1"+Nt.path+"/sprite"+j+Q,this._makeAPIURL(Nt,this._customAccessToken||Tt)):(Nt.path+=""+j+Q,fr(Nt))},Lt.prototype.normalizeTileURL=function(v,j){if(this._isSkuTokenExpired()&&this._createSkuToken(),v&&!ie(v))return v;var Q=mr(v),Tt=/(\.(png|jpg)\d*)(?=$)/,Nt=/^.+\/v4\//,Yt=Rt.devicePixelRatio>=2||j===512?"@2x":"",se=Zt.supported?".webp":"$1";Q.path=Q.path.replace(Tt,""+Yt+se),Q.path=Q.path.replace(Nt,"/"),Q.path="/v4"+Q.path;var Ue=this._customAccessToken||Ze(Q.params)||Bt.ACCESS_TOKEN;return Bt.REQUIRE_ACCESS_TOKEN&&Ue&&this._skuToken&&Q.params.push("sku="+this._skuToken),this._makeAPIURL(Q,Ue)},Lt.prototype.canonicalizeTileURL=function(v,j){var Q="/v4/",Tt=/\.[\w]+$/,Nt=mr(v);if(!Nt.path.match(/(^\/v4\/)/)||!Nt.path.match(Tt))return v;var Yt="mapbox://tiles/";Yt+=Nt.path.replace(Q,"");var se=Nt.params;return j&&(se=se.filter(function(Ue){return!Ue.match(/^access_token=/)})),se.length&&(Yt+="?"+se.join("&")),Yt},Lt.prototype.canonicalizeTileset=function(v,j){for(var Q=j?ie(j):!1,Tt=[],Nt=0,Yt=v.tiles||[];Nt=0&&v.params.splice(Nt,1)}if(Tt.path!=="/"&&(v.path=""+Tt.path+v.path),!Bt.REQUIRE_ACCESS_TOKEN)return fr(v);if(j=j||Bt.ACCESS_TOKEN,!j)throw new Error("An API access token is required to use Mapbox GL. "+Q);if(j[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+Q);return v.params=v.params.filter(function(Yt){return Yt.indexOf("access_token")===-1}),v.params.push("access_token="+j),fr(v)};function ie(v){return v.indexOf("mapbox:")===0}var be=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ce(v){return be.test(v)}function Le(v){return v.indexOf("sku=")>0&&ce(v)}function Ze(v){for(var j=0,Q=v;j=1&&h.localStorage.setItem(j,JSON.stringify(this.eventData))}catch{G("Unable to write to LocalStorage")}},Er.prototype.processRequests=function(v){},Er.prototype.postEvent=function(v,j,Q,Tt){var Nt=this;if(Bt.EVENTS_URL){var Yt=mr(Bt.EVENTS_URL);Yt.params.push("access_token="+(Tt||Bt.ACCESS_TOKEN||""));var se={event:this.type,created:new Date(v).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:a,skuId:Mt,userId:this.anonId},Ue=j?I(se,j):se,nr={url:fr(Yt),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Ue])};this.pendingRequest=Wn(nr,function(Tr){Nt.pendingRequest=null,Q(Tr),Nt.saveEventData(),Nt.processRequests(Tt)})}},Er.prototype.queueRequest=function(v,j){this.queue.push(v),this.processRequests(j)};var dn=function(v){function j(){v.call(this,"map.load"),this.success={},this.skuToken=""}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postMapLoadEvent=function(Q,Tt,Nt,Yt){this.skuToken=Nt,(Bt.EVENTS_URL&&Yt||Bt.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(se){return ie(se)||ce(se)}))&&this.queueRequest({id:Tt,timestamp:Date.now()},Yt)},j.prototype.processRequests=function(Q){var Tt=this;if(!(this.pendingRequest||this.queue.length===0)){var Nt=this.queue.shift(),Yt=Nt.id,se=Nt.timestamp;Yt&&this.success[Yt]||(this.anonId||this.fetchEventData(),N(this.anonId)||(this.anonId=C()),this.postEvent(se,{skuToken:this.skuToken},function(Ue){Ue||Yt&&(Tt.success[Yt]=!0)},Q))}},j}(Er),_n=function(v){function j(Q){v.call(this,"appUserTurnstile"),this._customAccessToken=Q}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postTurnstileEvent=function(Q,Tt){Bt.EVENTS_URL&&Bt.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(Nt){return ie(Nt)||ce(Nt)})&&this.queueRequest(Date.now(),Tt)},j.prototype.processRequests=function(Q){var Tt=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Nt=an(Bt.ACCESS_TOKEN),Yt=Nt?Nt.u:Bt.ACCESS_TOKEN,se=Yt!==this.eventData.tokenU;N(this.anonId)||(this.anonId=C(),se=!0);var Ue=this.queue.shift();if(this.eventData.lastSuccess){var nr=new Date(this.eventData.lastSuccess),Tr=new Date(Ue),jr=(Ue-this.eventData.lastSuccess)/(1440*60*1e3);se=se||jr>=1||jr<-1||nr.getDate()!==Tr.getDate()}else se=!0;if(!se)return this.processRequests();this.postEvent(Ue,{"enabled.telemetry":!1},function(hn){hn||(Tt.eventData.lastSuccess=Ue,Tt.eventData.tokenU=Yt)},Q)}},j}(Er),Oe=new _n,Xt=Oe.postTurnstileEvent.bind(Oe),oe=new dn,zt=oe.postMapLoadEvent.bind(oe),_t="mapbox-tiles",Pt=500,Ht=50,ae=1e3*60*7,he;function Me(){h.caches&&!he&&(he=h.caches.open(_t))}var qe;function Ye(v,j){if(qe===void 0)try{new Response(new ReadableStream),qe=!0}catch{qe=!1}qe?j(v.body):v.blob().then(j)}function ur(v,j,Q){if(Me(),!!he){var Tt={status:j.status,statusText:j.statusText,headers:new h.Headers};j.headers.forEach(function(se,Ue){return Tt.headers.set(Ue,se)});var Nt=ut(j.headers.get("Cache-Control")||"");if(!Nt["no-store"]){Nt["max-age"]&&Tt.headers.set("Expires",new Date(Q+Nt["max-age"]*1e3).toUTCString());var Yt=new Date(Tt.headers.get("Expires")).getTime()-Q;YtDate.now()&&!Q["no-cache"]}var pn=1/0;function ci(v){pn++,pn>Ht&&(v.getActor().send("enforceCacheSizeLimit",Pt),pn=0)}function ui(v){Me(),he&&he.then(function(j){j.keys().then(function(Q){for(var Tt=0;Tt=200&&Q.status<300||Q.status===0)&&Q.response!==null){var Nt=Q.response;if(v.type==="json")try{Nt=JSON.parse(Q.response)}catch(Yt){return j(Yt)}j(null,Nt,Q.getResponseHeader("Cache-Control"),Q.getResponseHeader("Expires"))}else j(new oa(Q.statusText,Q.status,v.url))},Q.send(v.body),{cancel:function(){return Q.abort()}}}var mn=function(v,j){if(!sr(v.url)){if(h.fetch&&h.Request&&h.AbortController&&h.Request.prototype.hasOwnProperty("signal"))return vr(v,j);if(vt()&&self.worker&&self.worker.actor){var Q=!0;return self.worker.actor.send("getResource",v,j,void 0,Q)}}return Ar(v,j)},Zn=function(v,j){return mn(I(v,{type:"json"}),j)},Un=function(v,j){return mn(I(v,{type:"arrayBuffer"}),j)},Wn=function(v,j){return mn(I(v,{method:"POST"}),j)};function Li(v){var j=h.document.createElement("a");return j.href=v,j.protocol===h.document.location.protocol&&j.host===h.document.location.host}var Fi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Zi(v,j,Q,Tt){var Nt=new h.Image,Yt=h.URL;Nt.onload=function(){j(null,Nt),Yt.revokeObjectURL(Nt.src),Nt.onload=null,h.requestAnimationFrame(function(){Nt.src=Fi})},Nt.onerror=function(){return j(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."))};var se=new h.Blob([new Uint8Array(v)],{type:"image/png"});Nt.cacheControl=Q,Nt.expires=Tt,Nt.src=v.byteLength?Yt.createObjectURL(se):Fi}function Ji(v,j){var Q=new h.Blob([new Uint8Array(v)],{type:"image/png"});h.createImageBitmap(Q).then(function(Tt){j(null,Tt)}).catch(function(Tt){j(new Error("Could not load image because of "+Tt.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var ca,Ei,Ga=function(){ca=[],Ei=0};Ga();var so=function(v,j){if(Zt.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*"),Ei>=Bt.MAX_PARALLEL_IMAGE_REQUESTS){var Q={requestParameters:v,callback:j,cancelled:!1,cancel:function(){this.cancelled=!0}};return ca.push(Q),Q}Ei++;var Tt=!1,Nt=function(){if(!Tt)for(Tt=!0,Ei--;ca.length&&Ei0||this._oneTimeListeners&&this._oneTimeListeners[v]&&this._oneTimeListeners[v].length>0||this._eventedParent&&this._eventedParent.listens(v)},Yr.prototype.setEventedParent=function(v,j){return this._eventedParent=v,this._eventedParentData=j,this};var un=8,Pn={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"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},bn={"*":{type:"source"}},ze=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],yr={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:"*"}},en={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:"*"}},Rn={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:"*"}},ni={type:{required:!0,type:"enum",values:{geojson:{}}},data:{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"}},xi={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"}}},Jn={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"}}},Gn={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"}},pi=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Va={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ea={"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"}},go={"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"}},mo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Go={"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"}},Lo={"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"],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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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"],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"}},Zo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ka={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Cs={type:"array",value:"*"},ps={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},wl={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},is={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ol={type:"array",value:"*",minimum:1},ms={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}},kl=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],ul={"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"}},Kl={"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"}},vs={"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"}},Ns={"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"}},Uo={"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"}},Ds={"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"}},Ol={"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"}},tc={"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"}},sc={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Xs={"*":{type:"string"}},Wa={$version:un,$root:Pn,sources:bn,source:ze,source_vector:yr,source_raster:en,source_raster_dem:Rn,source_geojson:ni,source_video:xi,source_image:Jn,layer:Gn,layout:pi,layout_background:Va,layout_fill:ea,layout_circle:go,layout_heatmap:mo,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Go,layout_symbol:Lo,layout_raster:Zo,layout_hillshade:Ka,filter:Cs,filter_operator:ps,geometry_type:wl,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:is,expression:ol,light:ms,paint:kl,paint_fill:ul,"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:Kl,paint_circle:vs,paint_heatmap:Ns,paint_symbol:Uo,paint_raster:Ds,paint_hillshade:Ol,paint_background:tc,transition:sc,"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:Xs},Co=function(v,j,Q,Tt){this.message=(v?v+": ":"")+Q,Tt&&(this.identifier=Tt),j!=null&&j.__line__&&(this.line=j.__line__)};function el(v){var j=v.key,Q=v.value;return Q?[new Co(j,Q,"constants have been deprecated as of v8")]:[]}function lc(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Tt=0,Nt=j;Tt":v.itemType.kind==="value"?"array":"array<"+j+">"}else return v.kind}var pu=[Gc,ko,zs,js,mc,Dl,Tl,cc(us),ql];function Ah(v,j){if(j.kind==="error")return null;if(v.kind==="array"){if(j.kind==="array"&&(j.N===0&&j.itemType.kind==="value"||!Ah(v.itemType,j.itemType))&&(typeof v.N!="number"||v.N===j.N))return null}else{if(v.kind===j.kind)return null;if(v.kind==="value")for(var Q=0,Tt=pu;Q255?255:Tr}function Nt(Tr){return Tr<0?0:Tr>1?1:Tr}function Yt(Tr){return Tr[Tr.length-1]==="%"?Tt(parseFloat(Tr)/100*255):Tt(parseInt(Tr))}function se(Tr){return Tr[Tr.length-1]==="%"?Nt(parseFloat(Tr)/100):Nt(parseFloat(Tr))}function Ue(Tr,jr,hn){return hn<0?hn+=1:hn>1&&(hn-=1),hn*6<1?Tr+(jr-Tr)*hn*6:hn*2<1?jr:hn*3<2?Tr+(jr-Tr)*(2/3-hn)*6:Tr}function nr(Tr){var jr=Tr.replace(/ /g,"").toLowerCase();if(jr in Q)return Q[jr].slice();if(jr[0]==="#"){if(jr.length===4){var hn=parseInt(jr.substr(1),16);return hn>=0&&hn<=4095?[(hn&3840)>>4|(hn&3840)>>8,hn&240|(hn&240)>>4,hn&15|(hn&15)<<4,1]:null}else if(jr.length===7){var hn=parseInt(jr.substr(1),16);return hn>=0&&hn<=16777215?[(hn&16711680)>>16,(hn&65280)>>8,hn&255,1]:null}return null}var xn=jr.indexOf("("),In=jr.indexOf(")");if(xn!==-1&&In+1===jr.length){var ii=jr.substr(0,xn),zi=jr.substr(xn+1,In-(xn+1)).split(","),ka=1;switch(ii){case"rgba":if(zi.length!==4)return null;ka=se(zi.pop());case"rgb":return zi.length!==3?null:[Yt(zi[0]),Yt(zi[1]),Yt(zi[2]),ka];case"hsla":if(zi.length!==4)return null;ka=se(zi.pop());case"hsl":if(zi.length!==3)return null;var ya=(parseFloat(zi[0])%360+360)%360/360,Ba=se(zi[1]),Xa=se(zi[2]),Da=Xa<=.5?Xa*(Ba+1):Xa+Ba-Xa*Ba,po=Xa*2-Da;return[Tt(Ue(po,Da,ya+1/3)*255),Tt(Ue(po,Da,ya)*255),Tt(Ue(po,Da,ya-1/3)*255),ka];default:return null}}return null}try{j.parseCSSColor=nr}catch{}}),Nd=tf.parseCSSColor,Gl=function(v,j,Q,Tt){Tt===void 0&&(Tt=1),this.r=v,this.g=j,this.b=Q,this.a=Tt};Gl.parse=function(v){if(v){if(v instanceof Gl)return v;if(typeof v=="string"){var j=Nd(v);if(j)return new Gl(j[0]/255*j[3],j[1]/255*j[3],j[2]/255*j[3],j[3])}}},Gl.prototype.toString=function(){var v=this.toArray(),j=v[0],Q=v[1],Tt=v[2],Nt=v[3];return"rgba("+Math.round(j)+","+Math.round(Q)+","+Math.round(Tt)+","+Nt+")"},Gl.prototype.toArray=function(){var v=this,j=v.r,Q=v.g,Tt=v.b,Nt=v.a;return Nt===0?[0,0,0,0]:[j*255/Nt,Q*255/Nt,Tt*255/Nt,Nt]},Gl.black=new Gl(0,0,0,1),Gl.white=new Gl(1,1,1,1),Gl.transparent=new Gl(0,0,0,0),Gl.red=new Gl(1,0,0,1);var Yu=function(v,j,Q){v?this.sensitivity=j?"variant":"case":this.sensitivity=j?"accent":"base",this.locale=Q,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Yu.prototype.compare=function(v,j){return this.collator.compare(v,j)},Yu.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ef=function(v,j,Q,Tt,Nt){this.text=v,this.image=j,this.scale=Q,this.fontStack=Tt,this.textColor=Nt},xu=function(v){this.sections=v};xu.fromString=function(v){return new xu([new ef(v,null,null,null,null)])},xu.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(v){return v.text.length!==0||v.image&&v.image.name.length!==0})},xu.factory=function(v){return v instanceof xu?v:xu.fromString(v)},xu.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(v){return v.text}).join("")},xu.prototype.serialize=function(){for(var v=["format"],j=0,Q=this.sections;j=0&&v<=255&&typeof j=="number"&&j>=0&&j<=255&&typeof Q=="number"&&Q>=0&&Q<=255)){var Nt=typeof Tt=="number"?[v,j,Q,Tt]:[v,j,Q];return"Invalid rgba value ["+Nt.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof Tt>"u"||typeof Tt=="number"&&Tt>=0&&Tt<=1?null:"Invalid rgba value ["+[v,j,Q,Tt].join(", ")+"]: 'a' must be between 0 and 1."}function _h(v){if(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number"||v instanceof Gl||v instanceof Yu||v instanceof xu||v instanceof mu)return!0;if(Array.isArray(v)){for(var j=0,Q=v;j2){var se=v[1];if(typeof se!="string"||!(se in jh)||se==="object")return j.error('The item type argument of "array" must be one of string, number, boolean',1);Yt=jh[se],Q++}else Yt=us;var Ue;if(v.length>3){if(v[2]!==null&&(typeof v[2]!="number"||v[2]<0||v[2]!==Math.floor(v[2])))return j.error('The length argument to "array" must be a positive integer literal',2);Ue=v[2],Q++}Tt=cc(Yt,Ue)}else Tt=jh[Nt];for(var nr=[];Q1)&&j.push(Tt)}}return j.concat(this.args.map(function(Nt){return Nt.serialize()}))};var Qh=function(v){this.type=Dl,this.sections=v};Qh.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[1];if(!Array.isArray(Q)&&typeof Q=="object")return j.error("First argument must be an image or text section.");for(var Tt=[],Nt=!1,Yt=1;Yt<=v.length-1;++Yt){var se=v[Yt];if(Nt&&typeof se=="object"&&!Array.isArray(se)){Nt=!1;var Ue=null;if(se["font-scale"]&&(Ue=j.parse(se["font-scale"],1,ko),!Ue))return null;var nr=null;if(se["text-font"]&&(nr=j.parse(se["text-font"],1,cc(zs)),!nr))return null;var Tr=null;if(se["text-color"]&&(Tr=j.parse(se["text-color"],1,mc),!Tr))return null;var jr=Tt[Tt.length-1];jr.scale=Ue,jr.font=nr,jr.textColor=Tr}else{var hn=j.parse(v[Yt],1,us);if(!hn)return null;var xn=hn.type.kind;if(xn!=="string"&&xn!=="value"&&xn!=="null"&&xn!=="resolvedImage")return j.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Nt=!0,Tt.push({content:hn,scale:null,font:null,textColor:null})}}return new Qh(Tt)},Qh.prototype.evaluate=function(v){var j=function(Q){var Tt=Q.content.evaluate(v);return _c(Tt)===ql?new ef("",Tt,null,null,null):new ef(gu(Tt),null,Q.scale?Q.scale.evaluate(v):null,Q.font?Q.font.evaluate(v).join(","):null,Q.textColor?Q.textColor.evaluate(v):null)};return new xu(this.sections.map(j))},Qh.prototype.eachChild=function(v){for(var j=0,Q=this.sections;j-1),Q},Lc.prototype.eachChild=function(v){v(this.input)},Lc.prototype.outputDefined=function(){return!1},Lc.prototype.serialize=function(){return["image",this.input.serialize()]};var Xf={"to-boolean":js,"to-color":mc,"to-number":ko,"to-string":zs},hl=function(v,j){this.type=v,this.args=j};hl.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[0];if((Q==="to-boolean"||Q==="to-string")&&v.length!==2)return j.error("Expected one argument.");for(var Tt=Xf[Q],Nt=[],Yt=1;Yt4?Q="Invalid rbga value "+JSON.stringify(j)+": expected an array containing either three or four numeric values.":Q=bu(j[0],j[1],j[2],j[3]),!Q))return new Gl(j[0]/255,j[1]/255,j[2]/255,j[3])}throw new ic(Q||"Could not parse color from value '"+(typeof j=="string"?j:String(JSON.stringify(j)))+"'")}else if(this.type.kind==="number"){for(var Ue=null,nr=0,Tr=this.args;nr=j[2]||v[1]<=j[1]||v[3]>=j[3])}function Lf(v,j){var Q=td(v[0]),Tt=Ed(v[1]),Nt=Math.pow(2,j.z);return[Math.round(Q*Nt*hu),Math.round(Tt*Nt*hu)]}function hf(v,j,Q){var Tt=v[0]-j[0],Nt=v[1]-j[1],Yt=v[0]-Q[0],se=v[1]-Q[1];return Tt*se-Yt*Nt===0&&Tt*Yt<=0&&Nt*se<=0}function Ld(v,j,Q){return j[1]>v[1]!=Q[1]>v[1]&&v[0]<(Q[0]-j[0])*(v[1]-j[1])/(Q[1]-j[1])+j[0]}function ed(v,j){for(var Q=!1,Tt=0,Nt=j.length;Tt0&&hn<0||jr<0&&hn>0}function df(v,j,Q,Tt){var Nt=[j[0]-v[0],j[1]-v[1]],Yt=[Tt[0]-Q[0],Tt[1]-Q[1]];return af(Yt,Nt)===0?!1:!!(bh(v,j,Q,Tt)&&bh(Q,Tt,v,j))}function Uh(v,j,Q){for(var Tt=0,Nt=Q;TtQ[2]){var Nt=Tt*.5,Yt=v[0]-Q[0]>Nt?-Tt:Q[0]-v[0]>Nt?Tt:0;Yt===0&&(Yt=v[0]-Q[2]>Nt?-Tt:Q[2]-v[0]>Nt?Tt:0),v[0]+=Yt}rf(j,v)}function jd(v){v[0]=v[1]=1/0,v[2]=v[3]=-1/0}function Jf(v,j,Q,Tt){for(var Nt=Math.pow(2,Tt.z)*hu,Yt=[Tt.x*hu,Tt.y*hu],se=[],Ue=0,nr=v;Ue=0)return!1;var Q=!0;return v.eachChild(function(Tt){Q&&!Ju(Tt,j)&&(Q=!1)}),Q}var rd=function(v,j){this.type=j.type,this.name=v,this.boundExpression=j};rd.parse=function(v,j){if(v.length!==2||typeof v[1]!="string")return j.error("'var' expression requires exactly one string literal argument.");var Q=v[1];return j.scope.has(Q)?new rd(Q,j.scope.get(Q)):j.error('Unknown variable "'+Q+'". Make sure "'+Q+'" has been bound in an enclosing "let" expression before using it.',1)},rd.prototype.evaluate=function(v){return this.boundExpression.evaluate(v)},rd.prototype.eachChild=function(){},rd.prototype.outputDefined=function(){return!1},rd.prototype.serialize=function(){return["var",this.name]};var xc=function(v,j,Q,Tt,Nt){j===void 0&&(j=[]),Tt===void 0&&(Tt=new $l),Nt===void 0&&(Nt=[]),this.registry=v,this.path=j,this.key=j.map(function(Yt){return"["+Yt+"]"}).join(""),this.scope=Tt,this.errors=Nt,this.expectedType=Q};xc.prototype.parse=function(v,j,Q,Tt,Nt){return Nt===void 0&&(Nt={}),j?this.concat(j,Q,Tt)._parse(v,Nt):this._parse(v,Nt)},xc.prototype._parse=function(v,j){(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number")&&(v=["literal",v]);function Q(Tr,jr,hn){return hn==="assert"?new Hu(jr,[Tr]):hn==="coerce"?new hl(jr,[Tr]):Tr}if(Array.isArray(v)){if(v.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var Tt=v[0];if(typeof Tt!="string")return this.error("Expression name must be a string, but found "+typeof Tt+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Nt=this.registry[Tt];if(Nt){var Yt=Nt.parse(v,this);if(!Yt)return null;if(this.expectedType){var se=this.expectedType,Ue=Yt.type;if((se.kind==="string"||se.kind==="number"||se.kind==="boolean"||se.kind==="object"||se.kind==="array")&&Ue.kind==="value")Yt=Q(Yt,se,j.typeAnnotation||"assert");else if((se.kind==="color"||se.kind==="formatted"||se.kind==="resolvedImage")&&(Ue.kind==="value"||Ue.kind==="string"))Yt=Q(Yt,se,j.typeAnnotation||"coerce");else if(this.checkSubtype(se,Ue))return null}if(!(Yt instanceof pl)&&Yt.type.kind!=="resolvedImage"&&$h(Yt)){var nr=new Hl;try{Yt=new pl(Yt.type,Yt.evaluate(nr))}catch(Tr){return this.error(Tr.message),null}}return Yt}return this.error('Unknown expression "'+Tt+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof v>"u"?this.error("'undefined' value invalid. Use null instead."):typeof v=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof v+" instead.")},xc.prototype.concat=function(v,j,Q){var Tt=typeof v=="number"?this.path.concat(v):this.path,Nt=Q?this.scope.concat(Q):this.scope;return new xc(this.registry,Tt,j||null,Nt,this.errors)},xc.prototype.error=function(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];var Tt=""+this.key+j.map(function(Nt){return"["+Nt+"]"}).join("");this.errors.push(new yl(Tt,v))},xc.prototype.checkSubtype=function(v,j){var Q=Ah(v,j);return Q&&this.error(Q),Q};function $h(v){if(v instanceof rd)return $h(v.boundExpression);if(v instanceof cs&&v.name==="error"||v instanceof xh||v instanceof Xu)return!1;var j=v instanceof hl||v instanceof Hu,Q=!0;return v.eachChild(function(Tt){j?Q=Q&&$h(Tt):Q=Q&&Tt instanceof pl}),Q?mf(v)&&Ju(v,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function ju(v,j){for(var Q=v.length-1,Tt=0,Nt=Q,Yt=0,se,Ue;Tt<=Nt;)if(Yt=Math.floor((Tt+Nt)/2),se=v[Yt],Ue=v[Yt+1],se<=j){if(Yt===Q||jj)Nt=Yt-1;else throw new ic("Input is not a number.");return 0}var Qu=function(v,j,Q){this.type=v,this.input=j,this.labels=[],this.outputs=[];for(var Tt=0,Nt=Q;Tt=se)return j.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',nr);var jr=j.parse(Ue,Tr,Nt);if(!jr)return null;Nt=Nt||jr.type,Tt.push([se,jr])}return new Qu(Nt,Q,Tt)},Qu.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Tt=this.input.evaluate(v);if(Tt<=j[0])return Q[0].evaluate(v);var Nt=j.length;if(Tt>=j[Nt-1])return Q[Nt-1].evaluate(v);var Yt=ju(j,Tt);return Q[Yt].evaluate(v)},Qu.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j0&&v.push(this.labels[j]),v.push(this.outputs[j].serialize());return v};function Pc(v,j,Q){return v*(1-Q)+j*Q}function xd(v,j,Q){return new Gl(Pc(v.r,j.r,Q),Pc(v.g,j.g,Q),Pc(v.b,j.b,Q),Pc(v.a,j.a,Q))}function Eh(v,j,Q){return v.map(function(Tt,Nt){return Pc(Tt,j[Nt],Q)})}var nd=Object.freeze({__proto__:null,number:Pc,color:xd,array:Eh}),Ud=.95047,Qf=1,Ap=1.08883,bd=4/29,$d=6/29,zu=3*$d*$d,wd=$d*$d*$d,hh=Math.PI/180,kd=180/Math.PI;function Hd(v){return v>wd?Math.pow(v,1/3):v/zu+bd}function Lh(v){return v>$d?v*v*v:zu*(v-bd)}function Ic(v){return 255*(v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055)}function Hh(v){return v/=255,v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)}function th(v){var j=Hh(v.r),Q=Hh(v.g),Tt=Hh(v.b),Nt=Hd((.4124564*j+.3575761*Q+.1804375*Tt)/Ud),Yt=Hd((.2126729*j+.7151522*Q+.072175*Tt)/Qf),se=Hd((.0193339*j+.119192*Q+.9503041*Tt)/Ap);return{l:116*Yt-16,a:500*(Nt-Yt),b:200*(Yt-se),alpha:v.a}}function Pf(v){var j=(v.l+16)/116,Q=isNaN(v.a)?j:j+v.a/500,Tt=isNaN(v.b)?j:j-v.b/200;return j=Qf*Lh(j),Q=Ud*Lh(Q),Tt=Ap*Lh(Tt),new Gl(Ic(3.2404542*Q-1.5371385*j-.4985314*Tt),Ic(-.969266*Q+1.8760108*j+.041556*Tt),Ic(.0556434*Q-.2040259*j+1.0572252*Tt),v.alpha)}function Mc(v,j,Q){return{l:Pc(v.l,j.l,Q),a:Pc(v.a,j.a,Q),b:Pc(v.b,j.b,Q),alpha:Pc(v.alpha,j.alpha,Q)}}function Id(v){var j=th(v),Q=j.l,Tt=j.a,Nt=j.b,Yt=Math.atan2(Nt,Tt)*kd;return{h:Yt<0?Yt+360:Yt,c:Math.sqrt(Tt*Tt+Nt*Nt),l:Q,alpha:v.a}}function id(v){var j=v.h*hh,Q=v.c,Tt=v.l;return Pf({l:Tt,a:Math.cos(j)*Q,b:Math.sin(j)*Q,alpha:v.alpha})}function dh(v,j,Q){var Tt=j-v;return v+Q*(Tt>180||Tt<-180?Tt-360*Math.round(Tt/360):Tt)}function pd(v,j,Q){return{h:dh(v.h,j.h,Q),c:Pc(v.c,j.c,Q),l:Pc(v.l,j.l,Q),alpha:Pc(v.alpha,j.alpha,Q)}}var ad={forward:th,reverse:Pf,interpolate:Mc},Dd={forward:Id,reverse:id,interpolate:pd},tp=Object.freeze({__proto__:null,lab:ad,hcl:Dd}),Au=function(v,j,Q,Tt,Nt){this.type=v,this.operator=j,this.interpolation=Q,this.input=Tt,this.labels=[],this.outputs=[];for(var Yt=0,se=Nt;Yt1}))return j.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Tt={name:"cubic-bezier",controlPoints:Ue}}else return j.error("Unknown interpolation type "+String(Tt[0]),1,0);if(v.length-1<4)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if((v.length-1)%2!==0)return j.error("Expected an even number of arguments.");if(Nt=j.parse(Nt,2,ko),!Nt)return null;var nr=[],Tr=null;Q==="interpolate-hcl"||Q==="interpolate-lab"?Tr=mc:j.expectedType&&j.expectedType.kind!=="value"&&(Tr=j.expectedType);for(var jr=0;jr=hn)return j.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',In);var zi=j.parse(xn,ii,Tr);if(!zi)return null;Tr=Tr||zi.type,nr.push([hn,zi])}return Tr.kind!=="number"&&Tr.kind!=="color"&&!(Tr.kind==="array"&&Tr.itemType.kind==="number"&&typeof Tr.N=="number")?j.error("Type "+dc(Tr)+" is not interpolatable."):new Au(Tr,Q,Tt,Nt,nr)},Au.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Tt=this.input.evaluate(v);if(Tt<=j[0])return Q[0].evaluate(v);var Nt=j.length;if(Tt>=j[Nt-1])return Q[Nt-1].evaluate(v);var Yt=ju(j,Tt),se=j[Yt],Ue=j[Yt+1],nr=Au.interpolationFactor(this.interpolation,Tt,se,Ue),Tr=Q[Yt].evaluate(v),jr=Q[Yt+1].evaluate(v);return this.operator==="interpolate"?nd[this.type.kind.toLowerCase()](Tr,jr,nr):this.operator==="interpolate-hcl"?Dd.reverse(Dd.interpolate(Dd.forward(Tr),Dd.forward(jr),nr)):ad.reverse(ad.interpolate(ad.forward(Tr),ad.forward(jr),nr))},Au.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j=Q.length)throw new ic("Array index out of bounds: "+j+" > "+(Q.length-1)+".");if(j!==Math.floor(j))throw new ic("Array index must be an integer, but found "+j+" instead.");return Q[j]},Ph.prototype.eachChild=function(v){v(this.index),v(this.input)},Ph.prototype.outputDefined=function(){return!1},Ph.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Zc=function(v,j){this.type=js,this.needle=v,this.haystack=j};Zc.parse=function(v,j){if(v.length!==3)return j.error("Expected 2 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,us),Tt=j.parse(v[2],2,us);return!Q||!Tt?null:uh(Q.type,[js,zs,ko,Gc,us])?new Zc(Q,Tt):j.error("Expected first argument to be of type boolean, string, number or null, but found "+dc(Q.type)+" instead")},Zc.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!Q)return!1;if(!yh(j,["boolean","string","number","null"]))throw new ic("Expected first argument to be of type boolean, string, number or null, but found "+dc(_c(j))+" instead.");if(!yh(Q,["string","array"]))throw new ic("Expected second argument to be of type array or string, but found "+dc(_c(Q))+" instead.");return Q.indexOf(j)>=0},Zc.prototype.eachChild=function(v){v(this.needle),v(this.haystack)},Zc.prototype.outputDefined=function(){return!0},Zc.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fc=function(v,j,Q){this.type=ko,this.needle=v,this.haystack=j,this.fromIndex=Q};fc.parse=function(v,j){if(v.length<=2||v.length>=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,us),Tt=j.parse(v[2],2,us);if(!Q||!Tt)return null;if(!uh(Q.type,[js,zs,ko,Gc,us]))return j.error("Expected first argument to be of type boolean, string, number or null, but found "+dc(Q.type)+" instead");if(v.length===4){var Nt=j.parse(v[3],3,ko);return Nt?new fc(Q,Tt,Nt):null}else return new fc(Q,Tt)},fc.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!yh(j,["boolean","string","number","null"]))throw new ic("Expected first argument to be of type boolean, string, number or null, but found "+dc(_c(j))+" instead.");if(!yh(Q,["string","array"]))throw new ic("Expected second argument to be of type array or string, but found "+dc(_c(Q))+" instead.");if(this.fromIndex){var Tt=this.fromIndex.evaluate(v);return Q.indexOf(j,Tt)}return Q.indexOf(j)},fc.prototype.eachChild=function(v){v(this.needle),v(this.haystack),this.fromIndex&&v(this.fromIndex)},fc.prototype.outputDefined=function(){return!1},fc.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var v=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),v]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ih=function(v,j,Q,Tt,Nt,Yt){this.inputType=v,this.type=j,this.input=Q,this.cases=Tt,this.outputs=Nt,this.otherwise=Yt};Ih.parse=function(v,j){if(v.length<5)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if(v.length%2!==1)return j.error("Expected an even number of arguments.");var Q,Tt;j.expectedType&&j.expectedType.kind!=="value"&&(Tt=j.expectedType);for(var Nt={},Yt=[],se=2;seNumber.MAX_SAFE_INTEGER)return Tr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof xn=="number"&&Math.floor(xn)!==xn)return Tr.error("Numeric branch labels must be integer values.");if(!Q)Q=_c(xn);else if(Tr.checkSubtype(Q,_c(xn)))return null;if(typeof Nt[String(xn)]<"u")return Tr.error("Branch labels must be unique.");Nt[String(xn)]=Yt.length}var In=j.parse(nr,se,Tt);if(!In)return null;Tt=Tt||In.type,Yt.push(In)}var ii=j.parse(v[1],1,us);if(!ii)return null;var zi=j.parse(v[v.length-1],v.length-1,Tt);return!zi||ii.type.kind!=="value"&&j.concat(1).checkSubtype(Q,ii.type)?null:new Ih(Q,Tt,ii,Nt,Yt,zi)},Ih.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=_c(j)===this.inputType&&this.outputs[this.cases[j]]||this.otherwise;return Q.evaluate(v)},Ih.prototype.eachChild=function(v){v(this.input),this.outputs.forEach(v),v(this.otherwise)},Ih.prototype.outputDefined=function(){return this.outputs.every(function(v){return v.outputDefined()})&&this.otherwise.outputDefined()},Ih.prototype.serialize=function(){for(var v=this,j=["match",this.input.serialize()],Q=Object.keys(this.cases).sort(),Tt=[],Nt={},Yt=0,se=Q;Yt=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,us),Tt=j.parse(v[2],2,ko);if(!Q||!Tt)return null;if(!uh(Q.type,[cc(us),zs,us]))return j.error("Expected first argument to be of type array or string, but found "+dc(Q.type)+" instead");if(v.length===4){var Nt=j.parse(v[3],3,ko);return Nt?new Dh(Q.type,Q,Tt,Nt):null}else return new Dh(Q.type,Q,Tt)},Dh.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=this.beginIndex.evaluate(v);if(!yh(j,["string","array"]))throw new ic("Expected first argument to be of type array or string, but found "+dc(_c(j))+" instead.");if(this.endIndex){var Tt=this.endIndex.evaluate(v);return j.slice(Q,Tt)}return j.slice(Q)},Dh.prototype.eachChild=function(v){v(this.input),v(this.beginIndex),this.endIndex&&v(this.endIndex)},Dh.prototype.outputDefined=function(){return!1},Dh.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var v=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),v]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function sf(v,j){return v==="=="||v==="!="?j.kind==="boolean"||j.kind==="string"||j.kind==="number"||j.kind==="null"||j.kind==="value":j.kind==="string"||j.kind==="number"||j.kind==="value"}function br(v,j,Q){return j===Q}function Qr(v,j,Q){return j!==Q}function Nn(v,j,Q){return jQ}function di(v,j,Q){return j<=Q}function Pi(v,j,Q){return j>=Q}function ga(v,j,Q,Tt){return Tt.compare(j,Q)===0}function Pa(v,j,Q,Tt){return!ga(v,j,Q,Tt)}function Ja(v,j,Q,Tt){return Tt.compare(j,Q)<0}function uo(v,j,Q,Tt){return Tt.compare(j,Q)>0}function Sa(v,j,Q,Tt){return Tt.compare(j,Q)<=0}function Za(v,j,Q,Tt){return Tt.compare(j,Q)>=0}function Ra(v,j,Q){var Tt=v!=="=="&&v!=="!=";return function(){function Nt(Yt,se,Ue){this.type=js,this.lhs=Yt,this.rhs=se,this.collator=Ue,this.hasUntypedArgument=Yt.type.kind==="value"||se.type.kind==="value"}return Nt.parse=function(Yt,se){if(Yt.length!==3&&Yt.length!==4)return se.error("Expected two or three arguments.");var Ue=Yt[0],nr=se.parse(Yt[1],1,us);if(!nr)return null;if(!sf(Ue,nr.type))return se.concat(1).error('"'+Ue+`" comparisons are not supported for type '`+dc(nr.type)+"'.");var Tr=se.parse(Yt[2],2,us);if(!Tr)return null;if(!sf(Ue,Tr.type))return se.concat(2).error('"'+Ue+`" comparisons are not supported for type '`+dc(Tr.type)+"'.");if(nr.type.kind!==Tr.type.kind&&nr.type.kind!=="value"&&Tr.type.kind!=="value")return se.error("Cannot compare types '"+dc(nr.type)+"' and '"+dc(Tr.type)+"'.");Tt&&(nr.type.kind==="value"&&Tr.type.kind!=="value"?nr=new Hu(Tr.type,[nr]):nr.type.kind!=="value"&&Tr.type.kind==="value"&&(Tr=new Hu(nr.type,[Tr])));var jr=null;if(Yt.length===4){if(nr.type.kind!=="string"&&Tr.type.kind!=="string"&&nr.type.kind!=="value"&&Tr.type.kind!=="value")return se.error("Cannot use collator to compare non-string types.");if(jr=se.parse(Yt[3],3,iu),!jr)return null}return new Nt(nr,Tr,jr)},Nt.prototype.evaluate=function(Yt){var se=this.lhs.evaluate(Yt),Ue=this.rhs.evaluate(Yt);if(Tt&&this.hasUntypedArgument){var nr=_c(se),Tr=_c(Ue);if(nr.kind!==Tr.kind||!(nr.kind==="string"||nr.kind==="number"))throw new ic('Expected arguments for "'+v+'" to be (string, string) or (number, number), but found ('+nr.kind+", "+Tr.kind+") instead.")}if(this.collator&&!Tt&&this.hasUntypedArgument){var jr=_c(se),hn=_c(Ue);if(jr.kind!=="string"||hn.kind!=="string")return j(Yt,se,Ue)}return this.collator?Q(Yt,se,Ue,this.collator.evaluate(Yt)):j(Yt,se,Ue)},Nt.prototype.eachChild=function(Yt){Yt(this.lhs),Yt(this.rhs),this.collator&&Yt(this.collator)},Nt.prototype.outputDefined=function(){return!0},Nt.prototype.serialize=function(){var Yt=[v];return this.eachChild(function(se){Yt.push(se.serialize())}),Yt},Nt}()}var pa=Ra("==",br,ga),_o=Ra("!=",Qr,Pa),fs=Ra("<",Nn,Ja),os=Ra(">",An,uo),gs=Ra("<=",di,Sa),ws=Ra(">=",Pi,Za),bo=function(v,j,Q,Tt,Nt){this.type=zs,this.number=v,this.locale=j,this.currency=Q,this.minFractionDigits=Tt,this.maxFractionDigits=Nt};bo.parse=function(v,j){if(v.length!==3)return j.error("Expected two arguments.");var Q=j.parse(v[1],1,ko);if(!Q)return null;var Tt=v[2];if(typeof Tt!="object"||Array.isArray(Tt))return j.error("NumberFormat options argument must be an object.");var Nt=null;if(Tt.locale&&(Nt=j.parse(Tt.locale,1,zs),!Nt))return null;var Yt=null;if(Tt.currency&&(Yt=j.parse(Tt.currency,1,zs),!Yt))return null;var se=null;if(Tt["min-fraction-digits"]&&(se=j.parse(Tt["min-fraction-digits"],1,ko),!se))return null;var Ue=null;return Tt["max-fraction-digits"]&&(Ue=j.parse(Tt["max-fraction-digits"],1,ko),!Ue)?null:new bo(Q,Nt,Yt,se,Ue)},bo.prototype.evaluate=function(v){return new Intl.NumberFormat(this.locale?this.locale.evaluate(v):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(v):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(v):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(v):void 0}).format(this.number.evaluate(v))},bo.prototype.eachChild=function(v){v(this.number),this.locale&&v(this.locale),this.currency&&v(this.currency),this.minFractionDigits&&v(this.minFractionDigits),this.maxFractionDigits&&v(this.maxFractionDigits)},bo.prototype.outputDefined=function(){return!1},bo.prototype.serialize=function(){var v={};return this.locale&&(v.locale=this.locale.serialize()),this.currency&&(v.currency=this.currency.serialize()),this.minFractionDigits&&(v["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(v["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),v]};var lo=function(v){this.type=ko,this.input=v};lo.parse=function(v,j){if(v.length!==2)return j.error("Expected 1 argument, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1);return Q?Q.type.kind!=="array"&&Q.type.kind!=="string"&&Q.type.kind!=="value"?j.error("Expected argument of type string or array, but found "+dc(Q.type)+" instead."):new lo(Q):null},lo.prototype.evaluate=function(v){var j=this.input.evaluate(v);if(typeof j=="string"||Array.isArray(j))return j.length;throw new ic("Expected value to be of type string or array, but found "+dc(_c(j))+" instead.")},lo.prototype.eachChild=function(v){v(this.input)},lo.prototype.outputDefined=function(){return!1},lo.prototype.serialize=function(){var v=["length"];return this.eachChild(function(j){v.push(j.serialize())}),v};var ks={"==":pa,"!=":_o,">":os,"<":fs,">=":ws,"<=":gs,array:Hu,at:Ph,boolean:Hu,case:Td,coalesce:fh,collator:xh,format:Qh,image:Lc,in:Zc,"index-of":fc,interpolate:Au,"interpolate-hcl":Au,"interpolate-lab":Au,length:lo,let:Vh,literal:pl,match:Ih,number:Hu,"number-format":bo,object:Hu,slice:Dh,step:Qu,string:Hu,"to-boolean":hl,"to-color":hl,"to-number":hl,"to-string":hl,var:rd,within:Xu};function dl(v,j){var Q=j[0],Tt=j[1],Nt=j[2],Yt=j[3];Q=Q.evaluate(v),Tt=Tt.evaluate(v),Nt=Nt.evaluate(v);var se=Yt?Yt.evaluate(v):1,Ue=bu(Q,Tt,Nt,se);if(Ue)throw new ic(Ue);return new Gl(Q/255*se,Tt/255*se,Nt/255*se,se)}function Vl(v,j){return v in j}function gc(v,j){var Q=j[v];return typeof Q>"u"?null:Q}function ec(v,j,Q,Tt){for(;Q<=Tt;){var Nt=Q+Tt>>1;if(j[Nt]===v)return!0;j[Nt]>v?Tt=Nt-1:Q=Nt+1}return!1}function vc(v){return{type:v}}cs.register(ks,{error:[Rc,[zs],function(v,j){var Q=j[0];throw new ic(Q.evaluate(v))}],typeof:[zs,[us],function(v,j){var Q=j[0];return dc(_c(Q.evaluate(v)))}],"to-rgba":[cc(ko,4),[mc],function(v,j){var Q=j[0];return Q.evaluate(v).toArray()}],rgb:[mc,[ko,ko,ko],dl],rgba:[mc,[ko,ko,ko,ko],dl],has:{type:js,overloads:[[[zs],function(v,j){var Q=j[0];return Vl(Q.evaluate(v),v.properties())}],[[zs,Tl],function(v,j){var Q=j[0],Tt=j[1];return Vl(Q.evaluate(v),Tt.evaluate(v))}]]},get:{type:us,overloads:[[[zs],function(v,j){var Q=j[0];return gc(Q.evaluate(v),v.properties())}],[[zs,Tl],function(v,j){var Q=j[0],Tt=j[1];return gc(Q.evaluate(v),Tt.evaluate(v))}]]},"feature-state":[us,[zs],function(v,j){var Q=j[0];return gc(Q.evaluate(v),v.featureState||{})}],properties:[Tl,[],function(v){return v.properties()}],"geometry-type":[zs,[],function(v){return v.geometryType()}],id:[us,[],function(v){return v.id()}],zoom:[ko,[],function(v){return v.globals.zoom}],"heatmap-density":[ko,[],function(v){return v.globals.heatmapDensity||0}],"line-progress":[ko,[],function(v){return v.globals.lineProgress||0}],accumulated:[us,[],function(v){return v.globals.accumulated===void 0?null:v.globals.accumulated}],"+":[ko,vc(ko),function(v,j){for(var Q=0,Tt=0,Nt=j;Tt":[js,[zs,us],function(v,j){var Q=j[0],Tt=j[1],Nt=v.properties()[Q.value],Yt=Tt.value;return typeof Nt==typeof Yt&&Nt>Yt}],"filter-id->":[js,[us],function(v,j){var Q=j[0],Tt=v.id(),Nt=Q.value;return typeof Tt==typeof Nt&&Tt>Nt}],"filter-<=":[js,[zs,us],function(v,j){var Q=j[0],Tt=j[1],Nt=v.properties()[Q.value],Yt=Tt.value;return typeof Nt==typeof Yt&&Nt<=Yt}],"filter-id-<=":[js,[us],function(v,j){var Q=j[0],Tt=v.id(),Nt=Q.value;return typeof Tt==typeof Nt&&Tt<=Nt}],"filter->=":[js,[zs,us],function(v,j){var Q=j[0],Tt=j[1],Nt=v.properties()[Q.value],Yt=Tt.value;return typeof Nt==typeof Yt&&Nt>=Yt}],"filter-id->=":[js,[us],function(v,j){var Q=j[0],Tt=v.id(),Nt=Q.value;return typeof Tt==typeof Nt&&Tt>=Nt}],"filter-has":[js,[us],function(v,j){var Q=j[0];return Q.value in v.properties()}],"filter-has-id":[js,[],function(v){return v.id()!==null&&v.id()!==void 0}],"filter-type-in":[js,[cc(zs)],function(v,j){var Q=j[0];return Q.value.indexOf(v.geometryType())>=0}],"filter-id-in":[js,[cc(us)],function(v,j){var Q=j[0];return Q.value.indexOf(v.id())>=0}],"filter-in-small":[js,[zs,cc(us)],function(v,j){var Q=j[0],Tt=j[1];return Tt.value.indexOf(v.properties()[Q.value])>=0}],"filter-in-large":[js,[zs,cc(us)],function(v,j){var Q=j[0],Tt=j[1];return ec(v.properties()[Q.value],Tt.value,0,Tt.value.length-1)}],all:{type:js,overloads:[[[js,js],function(v,j){var Q=j[0],Tt=j[1];return Q.evaluate(v)&&Tt.evaluate(v)}],[vc(js),function(v,j){for(var Q=0,Tt=j;Q-1}function qo(v){return!!v.expression&&v.expression.interpolated}function Bs(v){return v instanceof Number?"number":v instanceof String?"string":v instanceof Boolean?"boolean":Array.isArray(v)?"array":v===null?"null":typeof v}function ac(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function Zl(v){return v}function Mu(v,j){var Q=j.type==="color",Tt=v.stops&&typeof v.stops[0][0]=="object",Nt=Tt||v.property!==void 0,Yt=Tt||!Nt,se=v.type||(qo(j)?"exponential":"interval");if(Q&&(v=lc({},v),v.stops&&(v.stops=v.stops.map(function(ts){return[ts[0],Gl.parse(ts[1])]})),v.default?v.default=Gl.parse(v.default):v.default=Gl.parse(j.default)),v.colorSpace&&v.colorSpace!=="rgb"&&!tp[v.colorSpace])throw new Error("Unknown color space: "+v.colorSpace);var Ue,nr,Tr;if(se==="exponential")Ue=rh;else if(se==="interval")Ue=Wh;else if(se==="categorical"){Ue=Vu,nr=Object.create(null);for(var jr=0,hn=v.stops;jr=v.stops[Tt-1][0])return v.stops[Tt-1][1];var Nt=ju(v.stops.map(function(Yt){return Yt[0]}),Q);return v.stops[Nt][1]}function rh(v,j,Q){var Tt=v.base!==void 0?v.base:1;if(Bs(Q)!=="number")return eh(v.default,j.default);var Nt=v.stops.length;if(Nt===1||Q<=v.stops[0][0])return v.stops[0][1];if(Q>=v.stops[Nt-1][0])return v.stops[Nt-1][1];var Yt=ju(v.stops.map(function(hn){return hn[0]}),Q),se=Wc(Q,Tt,v.stops[Yt][0],v.stops[Yt+1][0]),Ue=v.stops[Yt][1],nr=v.stops[Yt+1][1],Tr=nd[j.type]||Zl;if(v.colorSpace&&v.colorSpace!=="rgb"){var jr=tp[v.colorSpace];Tr=function(hn,xn){return jr.reverse(jr.interpolate(jr.forward(hn),jr.forward(xn),se))}}return typeof Ue.evaluate=="function"?{evaluate:function(){for(var hn=[],xn=arguments.length;xn--;)hn[xn]=arguments[xn];var In=Ue.evaluate.apply(void 0,hn),ii=nr.evaluate.apply(void 0,hn);if(!(In===void 0||ii===void 0))return Tr(In,ii,se)}}:Tr(Ue,nr,se)}function qh(v,j,Q){return j.type==="color"?Q=Gl.parse(Q):j.type==="formatted"?Q=xu.fromString(Q.toString()):j.type==="resolvedImage"?Q=mu.fromString(Q.toString()):Bs(Q)!==j.type&&(j.type!=="enum"||!j.values[Q])&&(Q=void 0),eh(Q,v.default,j.default)}function Wc(v,j,Q,Tt){var Nt=Tt-Q,Yt=v-Q;return Nt===0?0:j===1?Yt/Nt:(Math.pow(j,Yt)-1)/(Math.pow(j,Nt)-1)}var Gh=function(v,j){this.expression=v,this._warningHistory={},this._evaluator=new Hl,this._defaultValue=j?Ft(j):null,this._enumValues=j&&j.type==="enum"?j.values:null};Gh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Tt,Nt,Yt){return this._evaluator.globals=v,this._evaluator.feature=j,this._evaluator.featureState=Q,this._evaluator.canonical=Tt,this._evaluator.availableImages=Nt||null,this._evaluator.formattedSection=Yt,this.expression.evaluate(this._evaluator)},Gh.prototype.evaluate=function(v,j,Q,Tt,Nt,Yt){this._evaluator.globals=v,this._evaluator.feature=j||null,this._evaluator.featureState=Q||null,this._evaluator.canonical=Tt,this._evaluator.availableImages=Nt||null,this._evaluator.formattedSection=Yt||null;try{var se=this.expression.evaluate(this._evaluator);if(se==null||typeof se=="number"&&se!==se)return this._defaultValue;if(this._enumValues&&!(se in this._enumValues))throw new ic("Expected value to be one of "+Object.keys(this._enumValues).map(function(Ue){return JSON.stringify(Ue)}).join(", ")+", but found "+JSON.stringify(se)+" instead.");return se}catch(Ue){return this._warningHistory[Ue.message]||(this._warningHistory[Ue.message]=!0,typeof console<"u"&&console.warn(Ue.message)),this._defaultValue}};function ds(v){return Array.isArray(v)&&v.length>0&&typeof v[0]=="string"&&v[0]in ks}function $s(v,j){var Q=new xc(ks,[],j?Dt(j):void 0),Tt=Q.parse(v,void 0,void 0,void 0,j&&j.type==="string"?{typeAnnotation:"coerce"}:void 0);return Tt?El(new Gh(Tt,j)):tu(Q.errors)}var nh=function(v,j){this.kind=v,this._styleExpression=j,this.isStateDependent=v!=="constant"&&!Vc(j.expression)};nh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Tt,Nt,Yt)},nh.prototype.evaluate=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluate(v,j,Q,Tt,Nt,Yt)};var eu=function(v,j,Q,Tt){this.kind=v,this.zoomStops=Q,this._styleExpression=j,this.isStateDependent=v!=="camera"&&!Vc(j.expression),this.interpolationType=Tt};eu.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Tt,Nt,Yt)},eu.prototype.evaluate=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluate(v,j,Q,Tt,Nt,Yt)},eu.prototype.interpolationFactor=function(v,j,Q){return this.interpolationType?Au.interpolationFactor(this.interpolationType,v,j,Q):0};function lf(v,j){if(v=$s(v,j),v.result==="error")return v;var Q=v.value.expression,Tt=mf(Q);if(!Tt&&!$c(j))return tu([new yl("","data expressions not supported")]);var Nt=Ju(Q,["zoom"]);if(!Nt&&!bc(j))return tu([new yl("","zoom expressions not supported")]);var Yt=pt(Q);if(!Yt&&!Nt)return tu([new yl("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Yt instanceof yl)return tu([Yt]);if(Yt instanceof Au&&!qo(j))return tu([new yl("",'"interpolate" expressions cannot be used with this property')]);if(!Yt)return El(Tt?new nh("constant",v.value):new nh("source",v.value));var se=Yt instanceof Au?Yt.interpolation:void 0;return El(Tt?new eu("camera",v.value,Yt.labels,se):new eu("composite",v.value,Yt.labels,se))}var Kt=function(v,j){this._parameters=v,this._specification=j,lc(this,Mu(this._parameters,this._specification))};Kt.deserialize=function(v){return new Kt(v._parameters,v._specification)},Kt.serialize=function(v){return{_parameters:v._parameters,_specification:v._specification}};function O(v,j){if(ac(v))return new Kt(v,j);if(ds(v)){var Q=lf(v,j);if(Q.result==="error")throw new Error(Q.value.map(function(Nt){return Nt.key+": "+Nt.message}).join(", "));return Q.value}else{var Tt=v;return typeof v=="string"&&j.type==="color"&&(Tt=Gl.parse(v)),{kind:"constant",evaluate:function(){return Tt}}}}function pt(v){var j=null;if(v instanceof Vh)j=pt(v.result);else if(v instanceof fh)for(var Q=0,Tt=v.args;QTt.maximum?[new Co(j,Q,Q+" is greater than the maximum value "+Tt.maximum)]:[]}function er(v){var j=v.valueSpec,Q=ss(v.value.type),Tt,Nt={},Yt,se,Ue=Q!=="categorical"&&v.value.property===void 0,nr=!Ue,Tr=Bs(v.value.stops)==="array"&&Bs(v.value.stops[0])==="array"&&Bs(v.value.stops[0][0])==="object",jr=qt({key:v.key,value:v.value,valueSpec:v.styleSpec.function,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{stops:hn,default:ii}});return Q==="identity"&&Ue&&jr.push(new Co(v.key,v.value,'missing required property "property"')),Q!=="identity"&&!v.value.stops&&jr.push(new Co(v.key,v.value,'missing required property "stops"')),Q==="exponential"&&v.valueSpec.expression&&!qo(v.valueSpec)&&jr.push(new Co(v.key,v.value,"exponential functions not supported")),v.styleSpec.$version>=8&&(nr&&!$c(v.valueSpec)?jr.push(new Co(v.key,v.value,"property functions not supported")):Ue&&!bc(v.valueSpec)&&jr.push(new Co(v.key,v.value,"zoom functions not supported"))),(Q==="categorical"||Tr)&&v.value.property===void 0&&jr.push(new Co(v.key,v.value,'"property" property is required')),jr;function hn(zi){if(Q==="identity")return[new Co(zi.key,zi.value,'identity function may not have a "stops" property')];var ka=[],ya=zi.value;return ka=ka.concat(Ee({key:zi.key,value:ya,valueSpec:zi.valueSpec,style:zi.style,styleSpec:zi.styleSpec,arrayElementValidator:xn})),Bs(ya)==="array"&&ya.length===0&&ka.push(new Co(zi.key,ya,"array must have at least one stop")),ka}function xn(zi){var ka=[],ya=zi.value,Ba=zi.key;if(Bs(ya)!=="array")return[new Co(Ba,ya,"array expected, "+Bs(ya)+" found")];if(ya.length!==2)return[new Co(Ba,ya,"array length 2 expected, length "+ya.length+" found")];if(Tr){if(Bs(ya[0])!=="object")return[new Co(Ba,ya,"object expected, "+Bs(ya[0])+" found")];if(ya[0].zoom===void 0)return[new Co(Ba,ya,"object stop key must have zoom")];if(ya[0].value===void 0)return[new Co(Ba,ya,"object stop key must have value")];if(se&&se>ss(ya[0].zoom))return[new Co(Ba,ya[0].zoom,"stop zoom values must appear in ascending order")];ss(ya[0].zoom)!==se&&(se=ss(ya[0].zoom),Yt=void 0,Nt={}),ka=ka.concat(qt({key:Ba+"[0]",value:ya[0],valueSpec:{zoom:{}},style:zi.style,styleSpec:zi.styleSpec,objectElementValidators:{zoom:je,value:In}}))}else ka=ka.concat(In({key:Ba+"[0]",value:ya[0],style:zi.style,styleSpec:zi.styleSpec},ya));return ds(nc(ya[1]))?ka.concat([new Co(Ba+"[1]",ya[1],"expressions are not allowed in function stops.")]):ka.concat(Ll({key:Ba+"[1]",value:ya[1],valueSpec:j,style:zi.style,styleSpec:zi.styleSpec}))}function In(zi,ka){var ya=Bs(zi.value),Ba=ss(zi.value),Xa=zi.value!==null?zi.value:ka;if(!Tt)Tt=ya;else if(ya!==Tt)return[new Co(zi.key,Xa,ya+" stop domain type must match previous stop domain type "+Tt)];if(ya!=="number"&&ya!=="string"&&ya!=="boolean")return[new Co(zi.key,Xa,"stop domain value must be a number, string, or boolean")];if(ya!=="number"&&Q!=="categorical"){var Da="number expected, "+ya+" found";return $c(j)&&Q===void 0&&(Da+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Co(zi.key,Xa,Da)]}return Q==="categorical"&&ya==="number"&&(!isFinite(Ba)||Math.floor(Ba)!==Ba)?[new Co(zi.key,Xa,"integer expected, found "+Ba)]:Q!=="categorical"&&ya==="number"&&Yt!==void 0&&Ba=2&&v[1]!=="$id"&&v[1]!=="$type";case"in":return v.length>=3&&(typeof v[1]!="string"||Array.isArray(v[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return v.length!==3||Array.isArray(v[1])||Array.isArray(v[2]);case"any":case"all":for(var j=0,Q=v.slice(1);jj?1:0}function Pe(v){if(!Array.isArray(v))return!1;if(v[0]==="within")return!0;for(var j=1;j"||j==="<="||j===">="?Ne(v[1],v[2],j):j==="any"?Xe(v.slice(1)):j==="all"?["all"].concat(v.slice(1).map(We)):j==="none"?["all"].concat(v.slice(1).map(We).map(Xr)):j==="in"?Pr(v[1],v.slice(2)):j==="!in"?Xr(Pr(v[1],v.slice(2))):j==="has"?qr(v[1]):j==="!has"?Xr(qr(v[1])):j==="within"?v:!0;return Q}function Ne(v,j,Q){switch(v){case"$type":return["filter-type-"+Q,j];case"$id":return["filter-id-"+Q,j];default:return["filter-"+Q,v,j]}}function Xe(v){return["any"].concat(v.map(We))}function Pr(v,j){if(j.length===0)return!1;switch(v){case"$type":return["filter-type-in",["literal",j]];case"$id":return["filter-id-in",["literal",j]];default:return j.length>200&&!j.some(function(Q){return typeof Q!=typeof j[0]})?["filter-in-large",v,["literal",j.sort(Te)]]:["filter-in-small",v,["literal",j]]}}function qr(v){switch(v){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",v]}}function Xr(v){return["!",v]}function gn(v){return qn(nc(v.value))?wr(lc({},v,{expressionContext:"filter",valueSpec:{value:"boolean"}})):zn(v)}function zn(v){var j=v.value,Q=v.key;if(Bs(j)!=="array")return[new Co(Q,j,"array expected, "+Bs(j)+" found")];var Tt=v.styleSpec,Nt,Yt=[];if(j.length<1)return[new Co(Q,j,"filter array must have at least 1 element")];switch(Yt=Yt.concat(Tn({key:Q+"[0]",value:j[0],valueSpec:Tt.filter_operator,style:v.style,styleSpec:v.styleSpec})),ss(j[0])){case"<":case"<=":case">":case">=":j.length>=2&&ss(j[1])==="$type"&&Yt.push(new Co(Q,j,'"$type" cannot be use with operator "'+j[0]+'"'));case"==":case"!=":j.length!==3&&Yt.push(new Co(Q,j,'filter array for operator "'+j[0]+'" must have 3 elements'));case"in":case"!in":j.length>=2&&(Nt=Bs(j[1]),Nt!=="string"&&Yt.push(new Co(Q+"[1]",j[1],"string expected, "+Nt+" found")));for(var se=2;se=jr[In+0]&&Tt>=jr[In+1])?(se[xn]=!0,Yt.push(Tr[xn])):se[xn]=!1}}},de.prototype._forEachCell=function(v,j,Q,Tt,Nt,Yt,se,Ue){for(var nr=this._convertToCellCoord(v),Tr=this._convertToCellCoord(j),jr=this._convertToCellCoord(Q),hn=this._convertToCellCoord(Tt),xn=nr;xn<=jr;xn++)for(var In=Tr;In<=hn;In++){var ii=this.d*In+xn;if(!(Ue&&!Ue(this._convertFromCellCoord(xn),this._convertFromCellCoord(In),this._convertFromCellCoord(xn+1),this._convertFromCellCoord(In+1)))&&Nt.call(this,v,j,Q,Tt,ii,Yt,se,Ue))return}},de.prototype._convertFromCellCoord=function(v){return(v-this.padding)/this.scale},de.prototype._convertToCellCoord=function(v){return Math.max(0,Math.min(this.d-1,Math.floor(v*this.scale)+this.padding))},de.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var v=this.cells,j=Vt+this.cells.length+1+1,Q=0,Tt=0;Tt=0)){var hn=v[jr];Tr[jr]=He[nr].shallow.indexOf(jr)>=0?hn:fn(hn,j)}v instanceof Error&&(Tr.message=v.message)}if(Tr.$name)throw new Error("$name property is reserved for worker serialization logic.");return nr!=="Object"&&(Tr.$name=nr),Tr}throw new Error("can't serialize object of type "+typeof v)}function Bn(v){if(v==null||typeof v=="boolean"||typeof v=="number"||typeof v=="string"||v instanceof Boolean||v instanceof Number||v instanceof String||v instanceof Date||v instanceof RegExp||Fr(v)||vn(v)||ArrayBuffer.isView(v)||v instanceof Ie)return v;if(Array.isArray(v))return v.map(Bn);if(typeof v=="object"){var j=v.$name||"Object",Q=He[j],Tt=Q.klass;if(!Tt)throw new Error("can't deserialize unregistered class "+j);if(Tt.deserialize)return Tt.deserialize(v);for(var Nt=Object.create(Tt.prototype),Yt=0,se=Object.keys(v);Yt=0?nr:Bn(nr)}}return Nt}throw new Error("can't deserialize object of type "+typeof v)}var ti=function(){this.first=!0};ti.prototype.update=function(v,j){var Q=Math.floor(v);return this.first?(this.first=!1,this.lastIntegerZoom=Q,this.lastIntegerZoomTime=0,this.lastZoom=v,this.lastFloorZoom=Q,!0):(this.lastFloorZoom>Q?(this.lastIntegerZoom=Q+1,this.lastIntegerZoomTime=j):this.lastFloorZoom=128&&v<=255},Arabic:function(v){return v>=1536&&v<=1791},"Arabic Supplement":function(v){return v>=1872&&v<=1919},"Arabic Extended-A":function(v){return v>=2208&&v<=2303},"Hangul Jamo":function(v){return v>=4352&&v<=4607},"Unified Canadian Aboriginal Syllabics":function(v){return v>=5120&&v<=5759},Khmer:function(v){return v>=6016&&v<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(v){return v>=6320&&v<=6399},"General Punctuation":function(v){return v>=8192&&v<=8303},"Letterlike Symbols":function(v){return v>=8448&&v<=8527},"Number Forms":function(v){return v>=8528&&v<=8591},"Miscellaneous Technical":function(v){return v>=8960&&v<=9215},"Control Pictures":function(v){return v>=9216&&v<=9279},"Optical Character Recognition":function(v){return v>=9280&&v<=9311},"Enclosed Alphanumerics":function(v){return v>=9312&&v<=9471},"Geometric Shapes":function(v){return v>=9632&&v<=9727},"Miscellaneous Symbols":function(v){return v>=9728&&v<=9983},"Miscellaneous Symbols and Arrows":function(v){return v>=11008&&v<=11263},"CJK Radicals Supplement":function(v){return v>=11904&&v<=12031},"Kangxi Radicals":function(v){return v>=12032&&v<=12255},"Ideographic Description Characters":function(v){return v>=12272&&v<=12287},"CJK Symbols and Punctuation":function(v){return v>=12288&&v<=12351},Hiragana:function(v){return v>=12352&&v<=12447},Katakana:function(v){return v>=12448&&v<=12543},Bopomofo:function(v){return v>=12544&&v<=12591},"Hangul Compatibility Jamo":function(v){return v>=12592&&v<=12687},Kanbun:function(v){return v>=12688&&v<=12703},"Bopomofo Extended":function(v){return v>=12704&&v<=12735},"CJK Strokes":function(v){return v>=12736&&v<=12783},"Katakana Phonetic Extensions":function(v){return v>=12784&&v<=12799},"Enclosed CJK Letters and Months":function(v){return v>=12800&&v<=13055},"CJK Compatibility":function(v){return v>=13056&&v<=13311},"CJK Unified Ideographs Extension A":function(v){return v>=13312&&v<=19903},"Yijing Hexagram Symbols":function(v){return v>=19904&&v<=19967},"CJK Unified Ideographs":function(v){return v>=19968&&v<=40959},"Yi Syllables":function(v){return v>=40960&&v<=42127},"Yi Radicals":function(v){return v>=42128&&v<=42191},"Hangul Jamo Extended-A":function(v){return v>=43360&&v<=43391},"Hangul Syllables":function(v){return v>=44032&&v<=55215},"Hangul Jamo Extended-B":function(v){return v>=55216&&v<=55295},"Private Use Area":function(v){return v>=57344&&v<=63743},"CJK Compatibility Ideographs":function(v){return v>=63744&&v<=64255},"Arabic Presentation Forms-A":function(v){return v>=64336&&v<=65023},"Vertical Forms":function(v){return v>=65040&&v<=65055},"CJK Compatibility Forms":function(v){return v>=65072&&v<=65103},"Small Form Variants":function(v){return v>=65104&&v<=65135},"Arabic Presentation Forms-B":function(v){return v>=65136&&v<=65279},"Halfwidth and Fullwidth Forms":function(v){return v>=65280&&v<=65519}};function ra(v){for(var j=0,Q=v;j=65097&&v<=65103)||ei["CJK Compatibility Ideographs"](v)||ei["CJK Compatibility"](v)||ei["CJK Radicals Supplement"](v)||ei["CJK Strokes"](v)||ei["CJK Symbols and Punctuation"](v)&&!(v>=12296&&v<=12305)&&!(v>=12308&&v<=12319)&&v!==12336||ei["CJK Unified Ideographs Extension A"](v)||ei["CJK Unified Ideographs"](v)||ei["Enclosed CJK Letters and Months"](v)||ei["Hangul Compatibility Jamo"](v)||ei["Hangul Jamo Extended-A"](v)||ei["Hangul Jamo Extended-B"](v)||ei["Hangul Jamo"](v)||ei["Hangul Syllables"](v)||ei.Hiragana(v)||ei["Ideographic Description Characters"](v)||ei.Kanbun(v)||ei["Kangxi Radicals"](v)||ei["Katakana Phonetic Extensions"](v)||ei.Katakana(v)&&v!==12540||ei["Halfwidth and Fullwidth Forms"](v)&&v!==65288&&v!==65289&&v!==65293&&!(v>=65306&&v<=65310)&&v!==65339&&v!==65341&&v!==65343&&!(v>=65371&&v<=65503)&&v!==65507&&!(v>=65512&&v<=65519)||ei["Small Form Variants"](v)&&!(v>=65112&&v<=65118)&&!(v>=65123&&v<=65126)||ei["Unified Canadian Aboriginal Syllabics"](v)||ei["Unified Canadian Aboriginal Syllabics Extended"](v)||ei["Vertical Forms"](v)||ei["Yijing Hexagram Symbols"](v)||ei["Yi Syllables"](v)||ei["Yi Radicals"](v))}function sa(v){return!!(ei["Latin-1 Supplement"](v)&&(v===167||v===169||v===174||v===177||v===188||v===189||v===190||v===215||v===247)||ei["General Punctuation"](v)&&(v===8214||v===8224||v===8225||v===8240||v===8241||v===8251||v===8252||v===8258||v===8263||v===8264||v===8265||v===8273)||ei["Letterlike Symbols"](v)||ei["Number Forms"](v)||ei["Miscellaneous Technical"](v)&&(v>=8960&&v<=8967||v>=8972&&v<=8991||v>=8996&&v<=9e3||v===9003||v>=9085&&v<=9114||v>=9150&&v<=9165||v===9167||v>=9169&&v<=9179||v>=9186&&v<=9215)||ei["Control Pictures"](v)&&v!==9251||ei["Optical Character Recognition"](v)||ei["Enclosed Alphanumerics"](v)||ei["Geometric Shapes"](v)||ei["Miscellaneous Symbols"](v)&&!(v>=9754&&v<=9759)||ei["Miscellaneous Symbols and Arrows"](v)&&(v>=11026&&v<=11055||v>=11088&&v<=11097||v>=11192&&v<=11243)||ei["CJK Symbols and Punctuation"](v)||ei.Katakana(v)||ei["Private Use Area"](v)||ei["CJK Compatibility Forms"](v)||ei["Small Form Variants"](v)||ei["Halfwidth and Fullwidth Forms"](v)||v===8734||v===8756||v===8757||v>=9984&&v<=10087||v>=10102&&v<=10131||v===65532||v===65533)}function vi(v){return!(Ki(v)||sa(v))}function ro(v){return ei.Arabic(v)||ei["Arabic Supplement"](v)||ei["Arabic Extended-A"](v)||ei["Arabic Presentation Forms-A"](v)||ei["Arabic Presentation Forms-B"](v)}function ao(v){return v>=1424&&v<=2303||ei["Arabic Presentation Forms-A"](v)||ei["Arabic Presentation Forms-B"](v)}function xo(v,j){return!(!j&&ao(v)||v>=2304&&v<=3583||v>=3840&&v<=4255||ei.Khmer(v))}function $o(v){for(var j=0,Q=v;j-1&&(as=rs.error),_l&&_l(v)};function ou(){wc.fire(new sn("pluginStateChange",{pluginStatus:as,pluginURL:Ts}))}var wc=new Yr,zo=function(){return as},il=function(v){return v({pluginStatus:as,pluginURL:Ts}),wc.on("pluginStateChange",v),v},ml=function(v,j,Q){if(Q===void 0&&(Q=!1),as===rs.deferred||as===rs.loading||as===rs.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ts=Rt.resolveURL(v),as=rs.deferred,_l=j,ou(),Q||yc()},yc=function(){if(as!==rs.deferred||!Ts)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");as=rs.loading,ou(),Ts&&Un({url:Ts},function(v){v?Bl(v):(as=rs.loaded,ou())})},oc={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return as===rs.loaded||oc.applyArabicShaping!=null},isLoading:function(){return as===rs.loading},setState:function(v){as=v.pluginStatus,Ts=v.pluginURL},isParsed:function(){return oc.applyArabicShaping!=null&&oc.processBidirectionalText!=null&&oc.processStyledBidirectionalText!=null},getPluginURL:function(){return Ts}},ph=function(){!oc.isLoading()&&!oc.isLoaded()&&zo()==="deferred"&&yc()},Yl=function(v,j){this.zoom=v,j?(this.now=j.now,this.fadeDuration=j.fadeDuration,this.zoomHistory=j.zoomHistory,this.transition=j.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ti,this.transition={})};Yl.prototype.isSupportedScript=function(v){return Ko(v,oc.isLoaded())},Yl.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Yl.prototype.getCrossfadeParameters=function(){var v=this.zoom,j=v-Math.floor(v),Q=this.crossFadingFactor();return v>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:j+(1-j)*Q}:{fromScale:.5,toScale:1,t:1-(1-Q)*j}};var hc=function(v,j){this.property=v,this.value=j,this.expression=O(j===void 0?v.specification.default:j,v.specification)};hc.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},hc.prototype.possiblyEvaluate=function(v,j,Q){return this.property.possiblyEvaluate(this,v,j,Q)};var zh=function(v){this.property=v,this.value=new hc(v,void 0)};zh.prototype.transitioned=function(v,j){return new Ir(this.property,this.value,j,I({},v.transition,this.transition),v.now)},zh.prototype.untransitioned=function(){return new Ir(this.property,this.value,null,{},0)};var Se=function(v){this._properties=v,this._values=Object.create(v.defaultTransitionablePropertyValues)};Se.prototype.getValue=function(v){return F(this._values[v].value.value)},Se.prototype.setValue=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].value=new hc(this._values[v].property,j===null?void 0:F(j))},Se.prototype.getTransition=function(v){return F(this._values[v].transition)},Se.prototype.setTransition=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].transition=F(j)||void 0},Se.prototype.serialize=function(){for(var v={},j=0,Q=Object.keys(this._values);jthis.end)return this.prior=null,Nt;if(this.value.isDataDriven())return this.prior=null,Nt;if(TtYt.zoomHistory.lastIntegerZoom?{from:Q,to:Tt}:{from:Nt,to:Tt}},j.prototype.interpolate=function(Q){return Q},j}(Si),ia=function(v){this.specification=v};ia.prototype.possiblyEvaluate=function(v,j,Q,Tt){if(v.value!==void 0)if(v.expression.kind==="constant"){var Nt=v.expression.evaluate(j,null,{},Q,Tt);return this._calculate(Nt,Nt,Nt,j)}else return this._calculate(v.expression.evaluate(new Yl(Math.floor(j.zoom-1),j)),v.expression.evaluate(new Yl(Math.floor(j.zoom),j)),v.expression.evaluate(new Yl(Math.floor(j.zoom+1),j)),j)},ia.prototype._calculate=function(v,j,Q,Tt){var Nt=Tt.zoom;return Nt>Tt.zoomHistory.lastIntegerZoom?{from:v,to:j}:{from:Q,to:j}},ia.prototype.interpolate=function(v){return v};var Ia=function(v){this.specification=v};Ia.prototype.possiblyEvaluate=function(v,j,Q,Tt){return!!v.expression.evaluate(j,null,{},Q,Tt)},Ia.prototype.interpolate=function(){return!1};var co=function(v){this.properties=v,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var j in v){var Q=v[j];Q.specification.overridable&&this.overridableProperties.push(j);var Tt=this.defaultPropertyValues[j]=new hc(Q,void 0),Nt=this.defaultTransitionablePropertyValues[j]=new zh(Q);this.defaultTransitioningPropertyValues[j]=Nt.untransitioned(),this.defaultPossiblyEvaluatedValues[j]=Tt.possiblyEvaluate({})}};hr("DataDrivenProperty",Si),hr("DataConstantProperty",On),hr("CrossFadedDataDrivenProperty",ha),hr("CrossFadedProperty",ia),hr("ColorRampProperty",Ia);var to="-transition",ma=function(v){function j(Q,Tt){if(v.call(this),this.id=Q.id,this.type=Q.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},Q.type!=="custom"&&(Q=Q,this.metadata=Q.metadata,this.minzoom=Q.minzoom,this.maxzoom=Q.maxzoom,Q.type!=="background"&&(this.source=Q.source,this.sourceLayer=Q["source-layer"],this.filter=Q.filter),Tt.layout&&(this._unevaluatedLayout=new ri(Tt.layout)),Tt.paint)){this._transitionablePaint=new Se(Tt.paint);for(var Nt in Q.paint)this.setPaintProperty(Nt,Q.paint[Nt],{validate:!1});for(var Yt in Q.layout)this.setLayoutProperty(Yt,Q.layout[Yt],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new bi(Tt.paint)}}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},j.prototype.getLayoutProperty=function(Q){return Q==="visibility"?this.visibility:this._unevaluatedLayout.getValue(Q)},j.prototype.setLayoutProperty=function(Q,Tt,Nt){if(Nt===void 0&&(Nt={}),Tt!=null){var Yt="layers."+this.id+".layout."+Q;if(this._validate(wu,Yt,Q,Tt,Nt))return}if(Q==="visibility"){this.visibility=Tt;return}this._unevaluatedLayout.setValue(Q,Tt)},j.prototype.getPaintProperty=function(Q){return U(Q,to)?this._transitionablePaint.getTransition(Q.slice(0,-to.length)):this._transitionablePaint.getValue(Q)},j.prototype.setPaintProperty=function(Q,Tt,Nt){if(Nt===void 0&&(Nt={}),Tt!=null){var Yt="layers."+this.id+".paint."+Q;if(this._validate(au,Yt,Q,Tt,Nt))return!1}if(U(Q,to))return this._transitionablePaint.setTransition(Q.slice(0,-to.length),Tt||void 0),!1;var se=this._transitionablePaint._values[Q],Ue=se.property.specification["property-type"]==="cross-faded-data-driven",nr=se.value.isDataDriven(),Tr=se.value;this._transitionablePaint.setValue(Q,Tt),this._handleSpecialPaintPropertyUpdate(Q);var jr=this._transitionablePaint._values[Q].value,hn=jr.isDataDriven();return hn||nr||Ue||this._handleOverridablePaintPropertyUpdate(Q,Tr,jr)},j.prototype._handleSpecialPaintPropertyUpdate=function(Q){},j.prototype._handleOverridablePaintPropertyUpdate=function(Q,Tt,Nt){return!1},j.prototype.isHidden=function(Q){return this.minzoom&&Q=this.maxzoom?!0:this.visibility==="none"},j.prototype.updateTransitions=function(Q){this._transitioningPaint=this._transitionablePaint.transitioned(Q,this._transitioningPaint)},j.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},j.prototype.recalculate=function(Q,Tt){Q.getCrossfadeParameters&&(this._crossfadeParameters=Q.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(Q,void 0,Tt)),this.paint=this._transitioningPaint.possiblyEvaluate(Q,void 0,Tt)},j.prototype.serialize=function(){var Q={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&&(Q.layout=Q.layout||{},Q.layout.visibility=this.visibility),W(Q,function(Tt,Nt){return Tt!==void 0&&!(Nt==="layout"&&!Object.keys(Tt).length)&&!(Nt==="paint"&&!Object.keys(Tt).length)})},j.prototype._validate=function(Q,Tt,Nt,Yt,se){return se===void 0&&(se={}),se&&se.validate===!1?!1:ih(this,Q.call(rl,{key:Tt,layerType:this.type,objectKey:Nt,value:Yt,styleSpec:Wa,style:{glyphs:!0,sprite:!0}}))},j.prototype.is3D=function(){return!1},j.prototype.isTileClipped=function(){return!1},j.prototype.hasOffscreenPass=function(){return!1},j.prototype.resize=function(){},j.prototype.isStateDependent=function(){for(var Q in this.paint._values){var Tt=this.paint.get(Q);if(!(!(Tt instanceof Ai)||!$c(Tt.property.specification))&&(Tt.value.kind==="source"||Tt.value.kind==="composite")&&Tt.value.isStateDependent)return!0}return!1},j}(Yr),ji={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},En=function(v,j){this._structArray=v,this._pos1=j*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},oi=128,Yi=5,Ni=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Ni.serialize=function(v,j){return v._trim(),j&&(v.isTransferred=!0,j.push(v.arrayBuffer)),{length:v.length,arrayBuffer:v.arrayBuffer}},Ni.deserialize=function(v){var j=Object.create(this.prototype);return j.arrayBuffer=v.arrayBuffer,j.length=v.length,j.capacity=v.arrayBuffer.byteLength/j.bytesPerElement,j._refreshViews(),j},Ni.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ni.prototype.clear=function(){this.length=0},Ni.prototype.resize=function(v){this.reserve(v),this.length=v},Ni.prototype.reserve=function(v){if(v>this.capacity){this.capacity=Math.max(v,Math.floor(this.capacity*Yi),oi),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var j=this.uint8;this._refreshViews(),j&&this.uint8.set(j)}},Ni.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function wi(v,j){j===void 0&&(j=1);var Q=0,Tt=0,Nt=v.map(function(se){var Ue=Ua(se.type),nr=Q=Ca(Q,Math.max(j,Ue)),Tr=se.components||1;return Tt=Math.max(Tt,Ue),Q+=Ue*Tr,{name:se.name,type:se.type,components:Tr,offset:nr}}),Yt=Ca(Q,Math.max(Tt,j));return{members:Nt,size:Yt,alignment:j}}function Ua(v){return ji[v].BYTES_PER_ELEMENT}function Ca(v,j){return Math.ceil(v/j)*j}var no=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt){var Nt=this.length;return this.resize(Nt+1),this.emplace(Nt,Q,Tt)},j.prototype.emplace=function(Q,Tt,Nt){var Yt=Q*2;return this.int16[Yt+0]=Tt,this.int16[Yt+1]=Nt,Q},j}(Ni);no.prototype.bytesPerElement=4,hr("StructArrayLayout2i4",no);var Ri=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt){var se=this.length;return this.resize(se+1),this.emplace(se,Q,Tt,Nt,Yt)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se){var Ue=Q*4;return this.int16[Ue+0]=Tt,this.int16[Ue+1]=Nt,this.int16[Ue+2]=Yt,this.int16[Ue+3]=se,Q},j}(Ni);Ri.prototype.bytesPerElement=8,hr("StructArrayLayout4i8",Ri);var ki=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue){var nr=this.length;return this.resize(nr+1),this.emplace(nr,Q,Tt,Nt,Yt,se,Ue)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Q*6;return this.int16[Tr+0]=Tt,this.int16[Tr+1]=Nt,this.int16[Tr+2]=Yt,this.int16[Tr+3]=se,this.int16[Tr+4]=Ue,this.int16[Tr+5]=nr,Q},j}(Ni);ki.prototype.bytesPerElement=12,hr("StructArrayLayout2i4i12",ki);var $a=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue){var nr=this.length;return this.resize(nr+1),this.emplace(nr,Q,Tt,Nt,Yt,se,Ue)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Q*4,jr=Q*8;return this.int16[Tr+0]=Tt,this.int16[Tr+1]=Nt,this.uint8[jr+4]=Yt,this.uint8[jr+5]=se,this.uint8[jr+6]=Ue,this.uint8[jr+7]=nr,Q},j}(Ni);$a.prototype.bytesPerElement=8,hr("StructArrayLayout2i4ub8",$a);var Ea=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt){var Nt=this.length;return this.resize(Nt+1),this.emplace(Nt,Q,Tt)},j.prototype.emplace=function(Q,Tt,Nt){var Yt=Q*2;return this.float32[Yt+0]=Tt,this.float32[Yt+1]=Nt,Q},j}(Ni);Ea.prototype.bytesPerElement=8,hr("StructArrayLayout2f8",Ea);var la=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn){var xn=this.length;return this.resize(xn+1),this.emplace(xn,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn){var In=Q*10;return this.uint16[In+0]=Tt,this.uint16[In+1]=Nt,this.uint16[In+2]=Yt,this.uint16[In+3]=se,this.uint16[In+4]=Ue,this.uint16[In+5]=nr,this.uint16[In+6]=Tr,this.uint16[In+7]=jr,this.uint16[In+8]=hn,this.uint16[In+9]=xn,Q},j}(Ni);la.prototype.bytesPerElement=20,hr("StructArrayLayout10ui20",la);var ua=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In){var ii=this.length;return this.resize(ii+1),this.emplace(ii,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii){var zi=Q*12;return this.int16[zi+0]=Tt,this.int16[zi+1]=Nt,this.int16[zi+2]=Yt,this.int16[zi+3]=se,this.uint16[zi+4]=Ue,this.uint16[zi+5]=nr,this.uint16[zi+6]=Tr,this.uint16[zi+7]=jr,this.int16[zi+8]=hn,this.int16[zi+9]=xn,this.int16[zi+10]=In,this.int16[zi+11]=ii,Q},j}(Ni);ua.prototype.bytesPerElement=24,hr("StructArrayLayout4i4ui4i24",ua);var Oa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*3;return this.float32[se+0]=Tt,this.float32[se+1]=Nt,this.float32[se+2]=Yt,Q},j}(Ni);Oa.prototype.bytesPerElement=12,hr("StructArrayLayout3f12",Oa);var Vo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Tt=this.length;return this.resize(Tt+1),this.emplace(Tt,Q)},j.prototype.emplace=function(Q,Tt){var Nt=Q*1;return this.uint32[Nt+0]=Tt,Q},j}(Ni);Vo.prototype.bytesPerElement=4,hr("StructArrayLayout1ul4",Vo);var Bo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr){var hn=this.length;return this.resize(hn+1),this.emplace(hn,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn){var xn=Q*10,In=Q*5;return this.int16[xn+0]=Tt,this.int16[xn+1]=Nt,this.int16[xn+2]=Yt,this.int16[xn+3]=se,this.int16[xn+4]=Ue,this.int16[xn+5]=nr,this.uint32[In+3]=Tr,this.uint16[xn+8]=jr,this.uint16[xn+9]=hn,Q},j}(Ni);Bo.prototype.bytesPerElement=20,hr("StructArrayLayout6i1ul2ui20",Bo);var za=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue){var nr=this.length;return this.resize(nr+1),this.emplace(nr,Q,Tt,Nt,Yt,se,Ue)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Q*6;return this.int16[Tr+0]=Tt,this.int16[Tr+1]=Nt,this.int16[Tr+2]=Yt,this.int16[Tr+3]=se,this.int16[Tr+4]=Ue,this.int16[Tr+5]=nr,Q},j}(Ni);za.prototype.bytesPerElement=12,hr("StructArrayLayout2i2i2i12",za);var Ya=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se){var Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,Q,Tt,Nt,Yt,se)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue){var nr=Q*4,Tr=Q*8;return this.float32[nr+0]=Tt,this.float32[nr+1]=Nt,this.float32[nr+2]=Yt,this.int16[Tr+6]=se,this.int16[Tr+7]=Ue,Q},j}(Ni);Ya.prototype.bytesPerElement=16,hr("StructArrayLayout2f1f2i16",Ya);var Eo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt){var se=this.length;return this.resize(se+1),this.emplace(se,Q,Tt,Nt,Yt)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se){var Ue=Q*12,nr=Q*3;return this.uint8[Ue+0]=Tt,this.uint8[Ue+1]=Nt,this.float32[nr+1]=Yt,this.float32[nr+2]=se,Q},j}(Ni);Eo.prototype.bytesPerElement=12,hr("StructArrayLayout2ub2f12",Eo);var No=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*3;return this.uint16[se+0]=Tt,this.uint16[se+1]=Nt,this.uint16[se+2]=Yt,Q},j}(Ni);No.prototype.bytesPerElement=6,hr("StructArrayLayout3ui6",No);var hs=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){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)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba){var Xa=this.length;return this.resize(Xa+1),this.emplace(Xa,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Xa){var Da=Q*24,po=Q*12,Oo=Q*48;return this.int16[Da+0]=Tt,this.int16[Da+1]=Nt,this.uint16[Da+2]=Yt,this.uint16[Da+3]=se,this.uint32[po+2]=Ue,this.uint32[po+3]=nr,this.uint32[po+4]=Tr,this.uint16[Da+10]=jr,this.uint16[Da+11]=hn,this.uint16[Da+12]=xn,this.float32[po+7]=In,this.float32[po+8]=ii,this.uint8[Oo+36]=zi,this.uint8[Oo+37]=ka,this.uint8[Oo+38]=ya,this.uint32[po+10]=Ba,this.int16[Da+22]=Xa,Q},j}(Ni);hs.prototype.bytesPerElement=48,hr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",hs);var Xl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){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)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Xa,Da,po,Oo,Qo,ts,Ls,Ps,Gs,al,bl){var Zs=this.length;return this.resize(Zs+1),this.emplace(Zs,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Xa,Da,po,Oo,Qo,ts,Ls,Ps,Gs,al,bl)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Xa,Da,po,Oo,Qo,ts,Ls,Ps,Gs,al,bl,Zs){var Qs=Q*34,Kc=Q*17;return this.int16[Qs+0]=Tt,this.int16[Qs+1]=Nt,this.int16[Qs+2]=Yt,this.int16[Qs+3]=se,this.int16[Qs+4]=Ue,this.int16[Qs+5]=nr,this.int16[Qs+6]=Tr,this.int16[Qs+7]=jr,this.uint16[Qs+8]=hn,this.uint16[Qs+9]=xn,this.uint16[Qs+10]=In,this.uint16[Qs+11]=ii,this.uint16[Qs+12]=zi,this.uint16[Qs+13]=ka,this.uint16[Qs+14]=ya,this.uint16[Qs+15]=Ba,this.uint16[Qs+16]=Xa,this.uint16[Qs+17]=Da,this.uint16[Qs+18]=po,this.uint16[Qs+19]=Oo,this.uint16[Qs+20]=Qo,this.uint16[Qs+21]=ts,this.uint16[Qs+22]=Ls,this.uint32[Kc+12]=Ps,this.float32[Kc+13]=Gs,this.float32[Kc+14]=al,this.float32[Kc+15]=bl,this.float32[Kc+16]=Zs,Q},j}(Ni);Xl.prototype.bytesPerElement=68,hr("StructArrayLayout8i15ui1ul4f68",Xl);var Rl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Tt=this.length;return this.resize(Tt+1),this.emplace(Tt,Q)},j.prototype.emplace=function(Q,Tt){var Nt=Q*1;return this.float32[Nt+0]=Tt,Q},j}(Ni);Rl.prototype.bytesPerElement=4,hr("StructArrayLayout1f4",Rl);var ys=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*3;return this.int16[se+0]=Tt,this.int16[se+1]=Nt,this.int16[se+2]=Yt,Q},j}(Ni);ys.prototype.bytesPerElement=6,hr("StructArrayLayout3i6",ys);var Dc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*2,Ue=Q*4;return this.uint32[se+0]=Tt,this.uint16[Ue+2]=Nt,this.uint16[Ue+3]=Yt,Q},j}(Ni);Dc.prototype.bytesPerElement=8,hr("StructArrayLayout1ul2ui8",Dc);var Cl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt){var Nt=this.length;return this.resize(Nt+1),this.emplace(Nt,Q,Tt)},j.prototype.emplace=function(Q,Tt,Nt){var Yt=Q*2;return this.uint16[Yt+0]=Tt,this.uint16[Yt+1]=Nt,Q},j}(Ni);Cl.prototype.bytesPerElement=4,hr("StructArrayLayout2ui4",Cl);var Nc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Tt=this.length;return this.resize(Tt+1),this.emplace(Tt,Q)},j.prototype.emplace=function(Q,Tt){var Nt=Q*1;return this.uint16[Nt+0]=Tt,Q},j}(Ni);Nc.prototype.bytesPerElement=2,hr("StructArrayLayout1ui2",Nc);var ku=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt){var se=this.length;return this.resize(se+1),this.emplace(se,Q,Tt,Nt,Yt)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se){var Ue=Q*4;return this.float32[Ue+0]=Tt,this.float32[Ue+1]=Nt,this.float32[Ue+2]=Yt,this.float32[Ue+3]=se,Q},j}(Ni);ku.prototype.bytesPerElement=16,hr("StructArrayLayout4f16",ku);var Eu=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return Q.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},Q.x1.get=function(){return this._structArray.int16[this._pos2+2]},Q.y1.get=function(){return this._structArray.int16[this._pos2+3]},Q.x2.get=function(){return this._structArray.int16[this._pos2+4]},Q.y2.get=function(){return this._structArray.int16[this._pos2+5]},Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.anchorPoint.get=function(){return new c(this.anchorPointX,this.anchorPointY)},Object.defineProperties(j.prototype,Q),j}(En);Eu.prototype.size=20;var Ec=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Eu(this,Q)},j}(Bo);hr("CollisionBoxArray",Ec);var kc=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},Q.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},Q.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},Q.segment.get=function(){return this._structArray.uint16[this._pos2+10]},Q.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},Q.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},Q.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},Q.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},Q.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},Q.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},Q.placedOrientation.set=function(Tt){this._structArray.uint8[this._pos1+37]=Tt},Q.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},Q.hidden.set=function(Tt){this._structArray.uint8[this._pos1+38]=Tt},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},Q.crossTileID.set=function(Tt){this._structArray.uint32[this._pos4+10]=Tt},Q.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(j.prototype,Q),j}(En);kc.prototype.size=48;var zc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new kc(this,Q)},j}(hs);hr("PlacedSymbolArray",zc);var Xo=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},Q.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},Q.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},Q.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},Q.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},Q.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},Q.key.get=function(){return this._structArray.uint16[this._pos2+8]},Q.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},Q.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},Q.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},Q.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},Q.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},Q.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},Q.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},Q.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},Q.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},Q.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},Q.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},Q.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},Q.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},Q.crossTileID.set=function(Tt){this._structArray.uint32[this._pos4+12]=Tt},Q.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},Q.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},Q.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},Q.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(j.prototype,Q),j}(En);Xo.prototype.size=68;var Oc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Xo(this,Q)},j}(Xl);hr("SymbolInstanceArray",Oc);var xl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getoffsetX=function(Q){return this.float32[Q*1+0]},j}(Rl);hr("GlyphOffsetArray",xl);var jc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getx=function(Q){return this.int16[Q*3+0]},j.prototype.gety=function(Q){return this.int16[Q*3+1]},j.prototype.gettileUnitDistanceFromAnchor=function(Q){return this.int16[Q*3+2]},j}(ys);hr("SymbolLineVertexArray",jc);var Lu=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(j.prototype,Q),j}(En);Lu.prototype.size=8;var jo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Lu(this,Q)},j}(Dc);hr("FeatureIndexArray",jo);var Rs=wi([{name:"a_pos",components:2,type:"Int16"}],4),Fl=Rs.members,Pl=function(v){v===void 0&&(v=[]),this.segments=v};Pl.prototype.prepareSegment=function(v,j,Q,Tt){var Nt=this.segments[this.segments.length-1];return v>Pl.MAX_VERTEX_ARRAY_LENGTH&&G("Max vertices per segment is "+Pl.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+v),(!Nt||Nt.vertexLength+v>Pl.MAX_VERTEX_ARRAY_LENGTH||Nt.sortKey!==Tt)&&(Nt={vertexOffset:j.length,primitiveOffset:Q.length,vertexLength:0,primitiveLength:0},Tt!==void 0&&(Nt.sortKey=Tt),this.segments.push(Nt)),Nt},Pl.prototype.get=function(){return this.segments},Pl.prototype.destroy=function(){for(var v=0,j=this.segments;v>>16)*nr&65535)<<16)&4294967295,jr=jr<<15|jr>>>17,jr=(jr&65535)*Tr+(((jr>>>16)*Tr&65535)<<16)&4294967295,se^=jr,se=se<<13|se>>>19,Ue=(se&65535)*5+(((se>>>16)*5&65535)<<16)&4294967295,se=(Ue&65535)+27492+(((Ue>>>16)+58964&65535)<<16);switch(jr=0,Nt){case 3:jr^=(Q.charCodeAt(hn+2)&255)<<16;case 2:jr^=(Q.charCodeAt(hn+1)&255)<<8;case 1:jr^=Q.charCodeAt(hn)&255,jr=(jr&65535)*nr+(((jr>>>16)*nr&65535)<<16)&4294967295,jr=jr<<15|jr>>>17,jr=(jr&65535)*Tr+(((jr>>>16)*Tr&65535)<<16)&4294967295,se^=jr}return se^=Q.length,se^=se>>>16,se=(se&65535)*2246822507+(((se>>>16)*2246822507&65535)<<16)&4294967295,se^=se>>>13,se=(se&65535)*3266489909+(((se>>>16)*3266489909&65535)<<16)&4294967295,se^=se>>>16,se>>>0}v.exports=j}),wt=i(function(v){function j(Q,Tt){for(var Nt=Q.length,Yt=Tt^Nt,se=0,Ue;Nt>=4;)Ue=Q.charCodeAt(se)&255|(Q.charCodeAt(++se)&255)<<8|(Q.charCodeAt(++se)&255)<<16|(Q.charCodeAt(++se)&255)<<24,Ue=(Ue&65535)*1540483477+(((Ue>>>16)*1540483477&65535)<<16),Ue^=Ue>>>24,Ue=(Ue&65535)*1540483477+(((Ue>>>16)*1540483477&65535)<<16),Yt=(Yt&65535)*1540483477+(((Yt>>>16)*1540483477&65535)<<16)^Ue,Nt-=4,++se;switch(Nt){case 3:Yt^=(Q.charCodeAt(se+2)&255)<<16;case 2:Yt^=(Q.charCodeAt(se+1)&255)<<8;case 1:Yt^=Q.charCodeAt(se)&255,Yt=(Yt&65535)*1540483477+(((Yt>>>16)*1540483477&65535)<<16)}return Yt^=Yt>>>13,Yt=(Yt&65535)*1540483477+(((Yt>>>16)*1540483477&65535)<<16),Yt^=Yt>>>15,Yt>>>0}v.exports=j}),Wt=nt,ve=nt,ke=wt;Wt.murmur3=ve,Wt.murmur2=ke;var Jt=function(){this.ids=[],this.positions=[],this.indexed=!1};Jt.prototype.add=function(v,j,Q,Tt){this.ids.push(De(v)),this.positions.push(j,Q,Tt)},Jt.prototype.getPositions=function(v){for(var j=De(v),Q=0,Tt=this.ids.length-1;Q>1;this.ids[Nt]>=j?Tt=Nt:Q=Nt+1}for(var Yt=[];this.ids[Q]===j;){var se=this.positions[3*Q],Ue=this.positions[3*Q+1],nr=this.positions[3*Q+2];Yt.push({index:se,start:Ue,end:nr}),Q++}return Yt},Jt.serialize=function(v,j){var Q=new Float64Array(v.ids),Tt=new Uint32Array(v.positions);return lr(Q,Tt,0,Q.length-1),j&&j.push(Q.buffer,Tt.buffer),{ids:Q,positions:Tt}},Jt.deserialize=function(v){var j=new Jt;return j.ids=v.ids,j.positions=v.positions,j.indexed=!0,j};var fe=Math.pow(2,53)-1;function De(v){var j=+v;return!isNaN(j)&&j<=fe?j:Wt(String(v))}function lr(v,j,Q,Tt){for(;Q>1],Yt=Q-1,se=Tt+1;;){do Yt++;while(v[Yt]Nt);if(Yt>=se)break;tr(v,Yt,se),tr(j,3*Yt,3*se),tr(j,3*Yt+1,3*se+1),tr(j,3*Yt+2,3*se+2)}se-Qse.x+1||nrse.y+1)&&G("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return Q}function Ql(v,j){return{type:v.type,id:v.id,properties:v.properties,geometry:j?Al(v):[]}}function Pu(v,j,Q,Tt,Nt){v.emplaceBack(j*2+(Tt+1)/2,Q*2+(Nt+1)/2)}var qs=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new no,this.indexArray=new No,this.segments=new Pl,this.programConfigurations=new Wi(v.layers,v.zoom),this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};qs.prototype.populate=function(v,j,Q){var Tt=this.layers[0],Nt=[],Yt=null;Tt.type==="circle"&&(Yt=Tt.layout.get("circle-sort-key"));for(var se=0,Ue=v;se=ns||hn<0||hn>=ns)){var xn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,v.sortKey),In=xn.vertexLength;Pu(this.layoutVertexArray,jr,hn,-1,-1),Pu(this.layoutVertexArray,jr,hn,1,-1),Pu(this.layoutVertexArray,jr,hn,1,1),Pu(this.layoutVertexArray,jr,hn,-1,1),this.indexArray.emplaceBack(In,In+1,In+2),this.indexArray.emplaceBack(In,In+3,In+2),xn.vertexLength+=4,xn.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,Q,{},Tt)},hr("CircleBucket",qs,{omit:["layers"]});function Bc(v,j){for(var Q=0;Q=3){for(var Yt=0;Yt1){if(u0(v,j))return!0;for(var Tt=0;Tt1?v.distSqr(Q):v.distSqr(Q.sub(j)._mult(Nt)._add(j))}function d0(v,j){for(var Q=!1,Tt,Nt,Yt,se=0;sej.y!=Yt.y>j.y&&j.x<(Yt.x-Nt.x)*(j.y-Nt.y)/(Yt.y-Nt.y)+Nt.x&&(Q=!Q)}return Q}function mp(v,j){for(var Q=!1,Tt=0,Nt=v.length-1;Ttj.y!=se.y>j.y&&j.x<(se.x-Yt.x)*(j.y-Yt.y)/(se.y-Yt.y)+Yt.x&&(Q=!Q)}return Q}function rg(v,j,Q,Tt,Nt){for(var Yt=0,se=v;Yt=Ue.x&&Nt>=Ue.y)return!0}var nr=[new c(j,Q),new c(j,Nt),new c(Tt,Nt),new c(Tt,Q)];if(v.length>2)for(var Tr=0,jr=nr;TrNt.x&&j.x>Nt.x||v.yNt.y&&j.y>Nt.y)return!1;var Yt=tt(v,j,Q[0]);return Yt!==tt(v,j,Q[1])||Yt!==tt(v,j,Q[2])||Yt!==tt(v,j,Q[3])}function f0(v,j,Q){var Tt=j.paint.get(v).value;return Tt.kind==="constant"?Tt.value:Q.programConfigurations.get(j.id).getMaxValue(v)}function p0(v){return Math.sqrt(v[0]*v[0]+v[1]*v[1])}function Ep(v,j,Q,Tt,Nt){if(!j[0]&&!j[1])return v;var Yt=c.convert(j)._mult(Nt);Q==="viewport"&&Yt._rotate(-Tt);for(var se=[],Ue=0;Ue0&&(Yt=1/Math.sqrt(Yt)),v[0]=j[0]*Yt,v[1]=j[1]*Yt,v[2]=j[2]*Yt,v}function OA(v,j){return v[0]*j[0]+v[1]*j[1]+v[2]*j[2]}function BA(v,j,Q){var Tt=j[0],Nt=j[1],Yt=j[2],se=Q[0],Ue=Q[1],nr=Q[2];return v[0]=Nt*nr-Yt*Ue,v[1]=Yt*se-Tt*nr,v[2]=Tt*Ue-Nt*se,v}function RA(v,j,Q){var Tt=j[0],Nt=j[1],Yt=j[2];return v[0]=Tt*Q[0]+Nt*Q[3]+Yt*Q[6],v[1]=Tt*Q[1]+Nt*Q[4]+Yt*Q[7],v[2]=Tt*Q[2]+Nt*Q[5]+Yt*Q[8],v}var FA=Jw;(function(){var v=Rb();return function(j,Q,Tt,Nt,Yt,se){var Ue,nr;for(Q||(Q=3),Tt||(Tt=0),Nt?nr=Math.min(Nt*Q+Tt,j.length):nr=j.length,Ue=Tt;Uev.width||Nt.height>v.height||Q.x>v.width-Nt.width||Q.y>v.height-Nt.height)throw new RangeError("out of range source coordinates for image copy");if(Nt.width>j.width||Nt.height>j.height||Tt.x>j.width-Nt.width||Tt.y>j.height-Nt.height)throw new RangeError("out of range destination coordinates for image copy");for(var se=v.data,Ue=j.data,nr=0;nr80*Q){Ue=Tr=v[0],nr=jr=v[1];for(var ii=Q;iiTr&&(Tr=hn),xn>jr&&(jr=xn);In=Math.max(Tr-Ue,jr-nr),In=In!==0?1/In:0}return s1(Yt,se,Q,Ue,nr,In),se}function r3(v,j,Q,Tt,Nt){var Yt,se;if(Nt===l3(v,j,Q,Tt)>0)for(Yt=j;Yt=j;Yt-=Tt)se=Gk(Yt,v[Yt],v[Yt+1],se);return se&&ky(se,se.next)&&(ex(se),se=se.next),se}function Bg(v,j){if(!v)return v;j||(j=v);var Q=v,Tt;do if(Tt=!1,!Q.steiner&&(ky(Q,Q.next)||Sd(Q.prev,Q,Q.next)===0)){if(ex(Q),Q=j=Q.prev,Q===Q.next)break;Tt=!0}else Q=Q.next;while(Tt||Q!==j);return j}function s1(v,j,Q,Tt,Nt,Yt,se){if(v){!se&&Yt&&i3(v,Tt,Nt,Yt);for(var Ue=v,nr,Tr;v.prev!==v.next;){if(nr=v.prev,Tr=v.next,Yt?WA(v,Tt,Nt,Yt):n3(v)){j.push(nr.i/Q),j.push(v.i/Q),j.push(Tr.i/Q),ex(v),v=Tr.next,Ue=Tr.next;continue}if(v=Tr,v===Ue){se?se===1?(v=qA(Bg(v),j,Q),s1(v,j,Q,Tt,Nt,Yt,2)):se===2&&Vk(v,j,Q,Tt,Nt,Yt):s1(Bg(v),j,Q,Tt,Nt,Yt,1);break}}}}function n3(v){var j=v.prev,Q=v,Tt=v.next;if(Sd(j,Q,Tt)>=0)return!1;for(var Nt=v.next.next;Nt!==v.prev;){if(sv(j.x,j.y,Q.x,Q.y,Tt.x,Tt.y,Nt.x,Nt.y)&&Sd(Nt.prev,Nt,Nt.next)>=0)return!1;Nt=Nt.next}return!0}function WA(v,j,Q,Tt){var Nt=v.prev,Yt=v,se=v.next;if(Sd(Nt,Yt,se)>=0)return!1;for(var Ue=Nt.xYt.x?Nt.x>se.x?Nt.x:se.x:Yt.x>se.x?Yt.x:se.x,jr=Nt.y>Yt.y?Nt.y>se.y?Nt.y:se.y:Yt.y>se.y?Yt.y:se.y,hn=a3(Ue,nr,j,Q,Tt),xn=a3(Tr,jr,j,Q,Tt),In=v.prevZ,ii=v.nextZ;In&&In.z>=hn&&ii&&ii.z<=xn;){if(In!==v.prev&&In!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,In.x,In.y)&&Sd(In.prev,In,In.next)>=0||(In=In.prevZ,ii!==v.prev&&ii!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,ii.x,ii.y)&&Sd(ii.prev,ii,ii.next)>=0))return!1;ii=ii.nextZ}for(;In&&In.z>=hn;){if(In!==v.prev&&In!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,In.x,In.y)&&Sd(In.prev,In,In.next)>=0)return!1;In=In.prevZ}for(;ii&&ii.z<=xn;){if(ii!==v.prev&&ii!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,ii.x,ii.y)&&Sd(ii.prev,ii,ii.next)>=0)return!1;ii=ii.nextZ}return!0}function qA(v,j,Q){var Tt=v;do{var Nt=Tt.prev,Yt=Tt.next.next;!ky(Nt,Yt)&&l1(Nt,Tt,Tt.next,Yt)&&Ty(Nt,Yt)&&Ty(Yt,Nt)&&(j.push(Nt.i/Q),j.push(Tt.i/Q),j.push(Yt.i/Q),ex(Tt),ex(Tt.next),Tt=v=Yt),Tt=Tt.next}while(Tt!==v);return Bg(Tt)}function Vk(v,j,Q,Tt,Nt,Yt){var se=v;do{for(var Ue=se.next.next;Ue!==se.prev;){if(se.i!==Ue.i&&ZA(se,Ue)){var nr=s3(se,Ue);se=Bg(se,se.next),nr=Bg(nr,nr.next),s1(se,j,Q,Tt,Nt,Yt),s1(nr,j,Q,Tt,Nt,Yt);return}Ue=Ue.next}se=se.next}while(se!==v)}function Wk(v,j,Q,Tt){var Nt=[],Yt,se,Ue,nr,Tr;for(Yt=0,se=j.length;Yt=Q.next.y&&Q.next.y!==Q.y){var Ue=Q.x+(Nt-Q.y)*(Q.next.x-Q.x)/(Q.next.y-Q.y);if(Ue<=Tt&&Ue>Yt){if(Yt=Ue,Ue===Tt){if(Nt===Q.y)return Q;if(Nt===Q.next.y)return Q.next}se=Q.x=Q.x&&Q.x>=Tr&&Tt!==Q.x&&sv(Ntse.x||Q.x===se.x&&qk(se,Q)))&&(se=Q,hn=xn)),Q=Q.next;while(Q!==nr);return se}function qk(v,j){return Sd(v.prev,v,j.prev)<0&&Sd(j.next,v,v.next)<0}function i3(v,j,Q,Tt){var Nt=v;do Nt.z===null&&(Nt.z=a3(Nt.x,Nt.y,j,Q,Tt)),Nt.prevZ=Nt.prev,Nt.nextZ=Nt.next,Nt=Nt.next;while(Nt!==v);Nt.prevZ.nextZ=null,Nt.prevZ=null,GA(Nt)}function GA(v){var j,Q,Tt,Nt,Yt,se,Ue,nr,Tr=1;do{for(Q=v,v=null,Yt=null,se=0;Q;){for(se++,Tt=Q,Ue=0,j=0;j0||nr>0&&Tt;)Ue!==0&&(nr===0||!Tt||Q.z<=Tt.z)?(Nt=Q,Q=Q.nextZ,Ue--):(Nt=Tt,Tt=Tt.nextZ,nr--),Yt?Yt.nextZ=Nt:v=Nt,Nt.prevZ=Yt,Yt=Nt;Q=Tt}Yt.nextZ=null,Tr*=2}while(se>1);return v}function a3(v,j,Q,Tt,Nt){return v=32767*(v-Q)*Nt,j=32767*(j-Tt)*Nt,v=(v|v<<8)&16711935,v=(v|v<<4)&252645135,v=(v|v<<2)&858993459,v=(v|v<<1)&1431655765,j=(j|j<<8)&16711935,j=(j|j<<4)&252645135,j=(j|j<<2)&858993459,j=(j|j<<1)&1431655765,v|j<<1}function qb(v){var j=v,Q=v;do(j.x=0&&(v-se)*(Tt-Ue)-(Q-se)*(j-Ue)>=0&&(Q-se)*(Yt-Ue)-(Nt-se)*(Tt-Ue)>=0}function ZA(v,j){return v.next.i!==j.i&&v.prev.i!==j.i&&!o3(v,j)&&(Ty(v,j)&&Ty(j,v)&&Gb(v,j)&&(Sd(v.prev,v,j.prev)||Sd(v,j.prev,j))||ky(v,j)&&Sd(v.prev,v,v.next)>0&&Sd(j.prev,j,j.next)>0)}function Sd(v,j,Q){return(j.y-v.y)*(Q.x-j.x)-(j.x-v.x)*(Q.y-j.y)}function ky(v,j){return v.x===j.x&&v.y===j.y}function l1(v,j,Q,Tt){var Nt=tx(Sd(v,j,Q)),Yt=tx(Sd(v,j,Tt)),se=tx(Sd(Q,Tt,v)),Ue=tx(Sd(Q,Tt,j));return!!(Nt!==Yt&&se!==Ue||Nt===0&&Q_(v,Q,j)||Yt===0&&Q_(v,Tt,j)||se===0&&Q_(Q,v,Tt)||Ue===0&&Q_(Q,j,Tt))}function Q_(v,j,Q){return j.x<=Math.max(v.x,Q.x)&&j.x>=Math.min(v.x,Q.x)&&j.y<=Math.max(v.y,Q.y)&&j.y>=Math.min(v.y,Q.y)}function tx(v){return v>0?1:v<0?-1:0}function o3(v,j){var Q=v;do{if(Q.i!==v.i&&Q.next.i!==v.i&&Q.i!==j.i&&Q.next.i!==j.i&&l1(Q,Q.next,v,j))return!0;Q=Q.next}while(Q!==v);return!1}function Ty(v,j){return Sd(v.prev,v,v.next)<0?Sd(v,j,v.next)>=0&&Sd(v,v.prev,j)>=0:Sd(v,j,v.prev)<0||Sd(v,v.next,j)<0}function Gb(v,j){var Q=v,Tt=!1,Nt=(v.x+j.x)/2,Yt=(v.y+j.y)/2;do Q.y>Yt!=Q.next.y>Yt&&Q.next.y!==Q.y&&Nt<(Q.next.x-Q.x)*(Yt-Q.y)/(Q.next.y-Q.y)+Q.x&&(Tt=!Tt),Q=Q.next;while(Q!==v);return Tt}function s3(v,j){var Q=new Zb(v.i,v.x,v.y),Tt=new Zb(j.i,j.x,j.y),Nt=v.next,Yt=j.prev;return v.next=j,j.prev=v,Q.next=Nt,Nt.prev=Q,Tt.next=Q,Q.prev=Tt,Yt.next=Tt,Tt.prev=Yt,Tt}function Gk(v,j,Q,Tt){var Nt=new Zb(v,j,Q);return Tt?(Nt.next=Tt.next,Nt.prev=Tt,Tt.next.prev=Nt,Tt.next=Nt):(Nt.prev=Nt,Nt.next=Nt),Nt}function ex(v){v.next.prev=v.prev,v.prev.next=v.next,v.prevZ&&(v.prevZ.nextZ=v.nextZ),v.nextZ&&(v.nextZ.prevZ=v.prevZ)}function Zb(v,j,Q){this.i=v,this.x=j,this.y=Q,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Wb.deviation=function(v,j,Q,Tt){var Nt=j&&j.length,Yt=Nt?j[0]*Q:v.length,se=Math.abs(l3(v,0,Yt,Q));if(Nt)for(var Ue=0,nr=j.length;Ue0&&(Tt+=v[Nt-1].length,Q.holes.push(Tt))}return Q},Vb.default=Hk;function KA(v,j,Q,Tt,Nt){Zk(v,j,Q,Tt||v.length-1,Nt||c3)}function Zk(v,j,Q,Tt,Nt){for(;Tt>Q;){if(Tt-Q>600){var Yt=Tt-Q+1,se=j-Q+1,Ue=Math.log(Yt),nr=.5*Math.exp(2*Ue/3),Tr=.5*Math.sqrt(Ue*nr*(Yt-nr)/Yt)*(se-Yt/2<0?-1:1),jr=Math.max(Q,Math.floor(j-se*nr/Yt+Tr)),hn=Math.min(Tt,Math.floor(j+(Yt-se)*nr/Yt+Tr));Zk(v,j,jr,hn,Nt)}var xn=v[j],In=Q,ii=Tt;for(rx(v,Q,j),Nt(v[Tt],xn)>0&&rx(v,Q,Tt);In0;)ii--}Nt(v[Q],xn)===0?rx(v,Q,ii):(ii++,rx(v,ii,Tt)),ii<=j&&(Q=ii+1),j<=ii&&(Tt=ii-1)}}function rx(v,j,Q){var Tt=v[j];v[j]=v[Q],v[Q]=Tt}function c3(v,j){return vj?1:0}function ig(v,j){var Q=v.length;if(Q<=1)return[v];for(var Tt=[],Nt,Yt,se=0;se1)for(var nr=0;nr>3}if(Tt--,Q===1||Q===2)Nt+=v.readSVarint(),Yt+=v.readSVarint(),Q===1&&(Ue&&se.push(Ue),Ue=[]),Ue.push(new c(Nt,Yt));else if(Q===7)Ue&&Ue.push(Ue[0].clone());else throw new Error("unknown command "+Q)}return Ue&&se.push(Ue),se},c1.prototype.bbox=function(){var v=this._pbf;v.pos=this._geometry;for(var j=v.readVarint()+v.pos,Q=1,Tt=0,Nt=0,Yt=0,se=1/0,Ue=-1/0,nr=1/0,Tr=-1/0;v.pos>3}if(Tt--,Q===1||Q===2)Nt+=v.readSVarint(),Yt+=v.readSVarint(),NtUe&&(Ue=Nt),YtTr&&(Tr=Yt);else if(Q!==7)throw new Error("unknown command "+Q)}return[se,nr,Ue,Tr]},c1.prototype.toGeoJSON=function(v,j,Q){var Tt=this.extent*Math.pow(2,Q),Nt=this.extent*v,Yt=this.extent*j,se=this.loadGeometry(),Ue=c1.types[this.type],nr,Tr;function jr(In){for(var ii=0;ii>3;j=Tt===1?v.readString():Tt===2?v.readFloat():Tt===3?v.readDouble():Tt===4?v.readVarint64():Tt===5?v.readVarint():Tt===6?v.readSVarint():Tt===7?v.readBoolean():null}return j}n6.prototype.feature=function(v){if(v<0||v>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[v];var j=this._pbf.readVarint()+this._pbf.pos;return new Sy(this._pbf,j,this.extent,this._keys,this._values)};var a6=o6;function o6(v,j){this.layers=v.readFields(s6,{},j)}function s6(v,j,Q){if(v===3){var Tt=new d3(Q,Q.readVarint()+Q.pos);Tt.length&&(j[Tt.name]=Tt)}}var l6=a6,YA=Sy,XA=d3,u1={VectorTile:l6,VectorTileFeature:YA,VectorTileLayer:XA},Cy=u1.VectorTileFeature.types,c6=500,Ay=Math.pow(2,13);function My(v,j,Q,Tt,Nt,Yt,se,Ue){v.emplaceBack(j,Q,Math.floor(Tt*Ay)*2+se,Nt*Ay*2,Yt*Ay*2,Math.round(Ue))}var E0=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new ki,this.indexArray=new No,this.programConfigurations=new Wi(v.layers,v.zoom),this.segments=new Pl,this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};E0.prototype.populate=function(v,j,Q){this.features=[],this.hasPattern=Kb("fill-extrusion",this.layers,j);for(var Tt=0,Nt=v;Tt=1){var Xa=zi[ya-1];if(!Xb(Ba,Xa)){xn.vertexLength+4>Pl.MAX_VERTEX_ARRAY_LENGTH&&(xn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Da=Ba.sub(Xa)._perp()._unit(),po=Xa.dist(Ba);ka+po>32768&&(ka=0),My(this.layoutVertexArray,Ba.x,Ba.y,Da.x,Da.y,0,0,ka),My(this.layoutVertexArray,Ba.x,Ba.y,Da.x,Da.y,0,1,ka),ka+=po,My(this.layoutVertexArray,Xa.x,Xa.y,Da.x,Da.y,0,0,ka),My(this.layoutVertexArray,Xa.x,Xa.y,Da.x,Da.y,0,1,ka);var Oo=xn.vertexLength;this.indexArray.emplaceBack(Oo,Oo+2,Oo+1),this.indexArray.emplaceBack(Oo+1,Oo+2,Oo+3),xn.vertexLength+=4,xn.primitiveLength+=2}}}}if(xn.vertexLength+nr>Pl.MAX_VERTEX_ARRAY_LENGTH&&(xn=this.segments.prepareSegment(nr,this.layoutVertexArray,this.indexArray)),Cy[v.type]==="Polygon"){for(var Qo=[],ts=[],Ls=xn.vertexLength,Ps=0,Gs=Ue;Psns)||v.y===j.y&&(v.y<0||v.y>ns)}function Jb(v){return v.every(function(j){return j.x<0})||v.every(function(j){return j.x>ns})||v.every(function(j){return j.y<0})||v.every(function(j){return j.y>ns})}var JA=new co({"fill-extrusion-opacity":new On(Wa["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Si(Wa["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new On(Wa["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new On(Wa["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ha(Wa["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Si(Wa["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Si(Wa["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new On(Wa["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),QA={paint:JA},t7=function(v){function j(Q){v.call(this,Q,QA)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.createBucket=function(Q){return new E0(Q)},j.prototype.queryRadius=function(){return p0(this.paint.get("fill-extrusion-translate"))},j.prototype.is3D=function(){return!0},j.prototype.queryIntersectsFeature=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr){var jr=Ep(Q,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ue.angle,nr),hn=this.paint.get("fill-extrusion-height").evaluate(Tt,Nt),xn=this.paint.get("fill-extrusion-base").evaluate(Tt,Nt),In=u6(jr,Tr,Ue,0),ii=f3(Yt,xn,hn,Tr),zi=ii[0],ka=ii[1];return cv(zi,ka,In)},j}(ma);function ag(v,j){return v.x*j.x+v.y*j.y}function ep(v,j){if(v.length===1){for(var Q=0,Tt=j[Q++],Nt;!Nt||Tt.equals(Nt);)if(Nt=j[Q++],!Nt)return 1/0;for(;Q=2&&v[nr-1].equals(v[nr-2]);)nr--;for(var Tr=0;Tr0;if(Qo&&ya>Tr){var Ls=xn.dist(In);if(Ls>2*jr){var Ps=xn.sub(xn.sub(In)._mult(jr/Ls)._round());this.updateDistance(In,Ps),this.addCurrentVertex(Ps,zi,0,0,hn),In=Ps}}var Gs=In&&ii,al=Gs?Q:Ue?"butt":Tt;if(Gs&&al==="round"&&(poNt&&(al="bevel"),al==="bevel"&&(po>2&&(al="flipbevel"),po100)Ba=ka.mult(-1);else{var bl=po*zi.add(ka).mag()/zi.sub(ka).mag();Ba._perp()._mult(bl*(ts?-1:1))}this.addCurrentVertex(xn,Ba,0,0,hn),this.addCurrentVertex(xn,Ba.mult(-1),0,0,hn)}else if(al==="bevel"||al==="fakeround"){var Zs=-Math.sqrt(po*po-1),Qs=ts?Zs:0,Kc=ts?0:Zs;if(In&&this.addCurrentVertex(xn,zi,Qs,Kc,hn),al==="fakeround")for(var Gu=Math.round(Oo*180/Math.PI/g3),Th=1;Th2*jr){var wf=xn.add(ii.sub(xn)._mult(jr/xp)._round());this.updateDistance(xn,wf),this.addCurrentVertex(wf,ka,0,0,hn),xn=wf}}}}},vp.prototype.addCurrentVertex=function(v,j,Q,Tt,Nt,Yt){Yt===void 0&&(Yt=!1);var se=j.x+j.y*Q,Ue=j.y-j.x*Q,nr=-j.x+j.y*Tt,Tr=-j.y-j.x*Tt;this.addHalfVertex(v,se,Ue,Yt,!1,Q,Nt),this.addHalfVertex(v,nr,Tr,Yt,!0,-Tt,Nt),this.distance>Qb/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(v,j,Q,Tt,Nt,Yt))},vp.prototype.addHalfVertex=function(v,j,Q,Tt,Nt,Yt,se){var Ue=v.x,nr=v.y,Tr=this.lineClips?this.scaledDistance*(Qb-1):this.scaledDistance,jr=Tr*Ey;if(this.layoutVertexArray.emplaceBack((Ue<<1)+(Tt?1:0),(nr<<1)+(Nt?1:0),Math.round(p6*j)+128,Math.round(p6*Q)+128,(Yt===0?0:Yt<0?-1:1)+1|(jr&63)<<2,jr>>6),this.lineClips){var hn=this.scaledDistance-this.lineClips.start,xn=this.lineClips.end-this.lineClips.start,In=hn/xn;this.layoutVertexArray2.emplaceBack(In,this.lineClipsArray.length)}var ii=se.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ii),se.primitiveLength++),Nt?this.e2=ii:this.e1=ii},vp.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},vp.prototype.updateDistance=function(v,j){this.distance+=v.dist(j),this.updateScaledDistance()},hr("LineBucket",vp,{omit:["layers","patternFeatures"]});var v3=new co({"line-cap":new On(Wa.layout_line["line-cap"]),"line-join":new Si(Wa.layout_line["line-join"]),"line-miter-limit":new On(Wa.layout_line["line-miter-limit"]),"line-round-limit":new On(Wa.layout_line["line-round-limit"]),"line-sort-key":new Si(Wa.layout_line["line-sort-key"])}),t2=new co({"line-opacity":new Si(Wa.paint_line["line-opacity"]),"line-color":new Si(Wa.paint_line["line-color"]),"line-translate":new On(Wa.paint_line["line-translate"]),"line-translate-anchor":new On(Wa.paint_line["line-translate-anchor"]),"line-width":new Si(Wa.paint_line["line-width"]),"line-gap-width":new Si(Wa.paint_line["line-gap-width"]),"line-offset":new Si(Wa.paint_line["line-offset"]),"line-blur":new Si(Wa.paint_line["line-blur"]),"line-dasharray":new ia(Wa.paint_line["line-dasharray"]),"line-pattern":new ha(Wa.paint_line["line-pattern"]),"line-gradient":new Ia(Wa.paint_line["line-gradient"])}),Ly={paint:t2,layout:v3},y3=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.possiblyEvaluate=function(Q,Tt){return Tt=new Yl(Math.floor(Tt.zoom),{now:Tt.now,fadeDuration:Tt.fadeDuration,zoomHistory:Tt.zoomHistory,transition:Tt.transition}),v.prototype.possiblyEvaluate.call(this,Q,Tt)},j.prototype.evaluate=function(Q,Tt,Nt,Yt){return Tt=I({},Tt,{zoom:Math.floor(Tt.zoom)}),v.prototype.evaluate.call(this,Q,Tt,Nt,Yt)},j}(Si),e2=new y3(Ly.paint.properties["line-width"].specification);e2.useIntegerZoom=!0;var _3=function(v){function j(Q){v.call(this,Q,Ly),this.gradientVersion=0}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._handleSpecialPaintPropertyUpdate=function(Q){if(Q==="line-gradient"){var Tt=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=Tt._styleExpression.expression instanceof Qu,this.gradientVersion=(this.gradientVersion+1)%b}},j.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},j.prototype.recalculate=function(Q,Tt){v.prototype.recalculate.call(this,Q,Tt),this.paint._values["line-floorwidth"]=e2.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,Q)},j.prototype.createBucket=function(Q){return new vp(Q)},j.prototype.queryRadius=function(Q){var Tt=Q,Nt=v6(f0("line-width",this,Tt),f0("line-gap-width",this,Tt)),Yt=f0("line-offset",this,Tt);return Nt/2+Math.abs(Yt)+p0(this.paint.get("line-translate"))},j.prototype.queryIntersectsFeature=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Ep(Q,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ue.angle,nr),jr=nr/2*v6(this.paint.get("line-width").evaluate(Tt,Nt),this.paint.get("line-gap-width").evaluate(Tt,Nt)),hn=this.paint.get("line-offset").evaluate(Tt,Nt);return hn&&(Yt=X(Yt,hn*nr)),M0(Tr,Yt,jr)},j.prototype.isTileClipped=function(){return!0},j}(ma);function v6(v,j){return j>0?j+2*v:v}function X(v,j){for(var Q=[],Tt=new c(0,0),Nt=0;Nt":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Cr(v){for(var j="",Q=0;Q>1,jr=-7,hn=Q?Nt-1:0,xn=Q?-1:1,In=v[j+hn];for(hn+=xn,Yt=In&(1<<-jr)-1,In>>=-jr,jr+=Ue;jr>0;Yt=Yt*256+v[j+hn],hn+=xn,jr-=8);for(se=Yt&(1<<-jr)-1,Yt>>=-jr,jr+=Tt;jr>0;se=se*256+v[j+hn],hn+=xn,jr-=8);if(Yt===0)Yt=1-Tr;else{if(Yt===nr)return se?NaN:(In?-1:1)*(1/0);se=se+Math.pow(2,Tt),Yt=Yt-Tr}return(In?-1:1)*se*Math.pow(2,Yt-Tt)},kn=function(v,j,Q,Tt,Nt,Yt){var se,Ue,nr,Tr=Yt*8-Nt-1,jr=(1<>1,xn=Nt===23?Math.pow(2,-24)-Math.pow(2,-77):0,In=Tt?0:Yt-1,ii=Tt?1:-1,zi=j<0||j===0&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(Ue=isNaN(j)?1:0,se=jr):(se=Math.floor(Math.log(j)/Math.LN2),j*(nr=Math.pow(2,-se))<1&&(se--,nr*=2),se+hn>=1?j+=xn/nr:j+=xn*Math.pow(2,1-hn),j*nr>=2&&(se++,nr/=2),se+hn>=jr?(Ue=0,se=jr):se+hn>=1?(Ue=(j*nr-1)*Math.pow(2,Nt),se=se+hn):(Ue=j*Math.pow(2,hn-1)*Math.pow(2,Nt),se=0));Nt>=8;v[Q+In]=Ue&255,In+=ii,Ue/=256,Nt-=8);for(se=se<0;v[Q+In]=se&255,In+=ii,se/=256,Tr-=8);v[Q+In-ii]|=zi*128},Fn={read:ln,write:kn},Kn=mi;function mi(v){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(v)?v:new Uint8Array(v||0),this.pos=0,this.type=0,this.length=this.buf.length}mi.Varint=0,mi.Fixed64=1,mi.Bytes=2,mi.Fixed32=5;var Ui=65536*65536,Na=1/Ui,fa=12,La=typeof TextDecoder>"u"?null:new TextDecoder("utf8");mi.prototype={destroy:function(){this.buf=null},readFields:function(v,j,Q){for(Q=Q||this.length;this.pos>3,Yt=this.pos;this.type=Tt&7,v(Nt,j,this),this.pos===Yt&&this.skip(Tt)}return j},readMessage:function(v,j){return this.readFields(v,j,this.readVarint()+this.pos)},readFixed32:function(){var v=m0(this.buf,this.pos);return this.pos+=4,v},readSFixed32:function(){var v=yf(this.buf,this.pos);return this.pos+=4,v},readFixed64:function(){var v=m0(this.buf,this.pos)+m0(this.buf,this.pos+4)*Ui;return this.pos+=8,v},readSFixed64:function(){var v=m0(this.buf,this.pos)+yf(this.buf,this.pos+4)*Ui;return this.pos+=8,v},readFloat:function(){var v=Fn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,v},readDouble:function(){var v=Fn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,v},readVarint:function(v){var j=this.buf,Q,Tt;return Tt=j[this.pos++],Q=Tt&127,Tt<128||(Tt=j[this.pos++],Q|=(Tt&127)<<7,Tt<128)||(Tt=j[this.pos++],Q|=(Tt&127)<<14,Tt<128)||(Tt=j[this.pos++],Q|=(Tt&127)<<21,Tt<128)?Q:(Tt=j[this.pos],Q|=(Tt&15)<<28,ho(Q,v,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var v=this.readVarint();return v%2===1?(v+1)/-2:v/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var v=this.readVarint()+this.pos,j=this.pos;return this.pos=v,v-j>=fa&&La?qp(this.buf,j,v):Wp(this.buf,j,v)},readBytes:function(){var v=this.readVarint()+this.pos,j=this.buf.subarray(this.pos,v);return this.pos=v,j},readPackedVarint:function(v,j){if(this.type!==mi.Bytes)return v.push(this.readVarint(j));var Q=Ro(this);for(v=v||[];this.pos127;);else if(j===mi.Bytes)this.pos=this.readVarint()+this.pos;else if(j===mi.Fixed32)this.pos+=4;else if(j===mi.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+j)},writeTag:function(v,j){this.writeVarint(v<<3|j)},realloc:function(v){for(var j=this.length||16;j268435455||v<0){Nl(v,this);return}this.realloc(4),this.buf[this.pos++]=v&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=v>>>7&127)))},writeSVarint:function(v){this.writeVarint(v<0?-v*2-1:v*2)},writeBoolean:function(v){this.writeVarint(!!v)},writeString:function(v){v=String(v),this.realloc(v.length*4),this.pos++;var j=this.pos;this.pos=Gp(this.buf,v,this.pos);var Q=this.pos-j;Q>=128&&sl(j,Q,this),this.pos=j-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(v){this.realloc(4),Fn.write(this.buf,v,this.pos,!0,23,4),this.pos+=4},writeDouble:function(v){this.realloc(8),Fn.write(this.buf,v,this.pos,!0,52,8),this.pos+=8},writeBytes:function(v){var j=v.length;this.writeVarint(j),this.realloc(j);for(var Q=0;Q=128&&sl(Q,Tt,this),this.pos=Q-1,this.writeVarint(Tt),this.pos+=Tt},writeMessage:function(v,j,Q){this.writeTag(v,mi.Bytes),this.writeRawMessage(j,Q)},writePackedVarint:function(v,j){j.length&&this.writeMessage(v,Ks,j)},writePackedSVarint:function(v,j){j.length&&this.writeMessage(v,Hs,j)},writePackedBoolean:function(v,j){j.length&&this.writeMessage(v,ll,j)},writePackedFloat:function(v,j){j.length&&this.writeMessage(v,To,j)},writePackedDouble:function(v,j){j.length&&this.writeMessage(v,vl,j)},writePackedFixed32:function(v,j){j.length&&this.writeMessage(v,rc,j)},writePackedSFixed32:function(v,j){j.length&&this.writeMessage(v,wh,j)},writePackedFixed64:function(v,j){j.length&&this.writeMessage(v,mh,j)},writePackedSFixed64:function(v,j){j.length&&this.writeMessage(v,Of,j)},writeBytesField:function(v,j){this.writeTag(v,mi.Bytes),this.writeBytes(j)},writeFixed32Field:function(v,j){this.writeTag(v,mi.Fixed32),this.writeFixed32(j)},writeSFixed32Field:function(v,j){this.writeTag(v,mi.Fixed32),this.writeSFixed32(j)},writeFixed64Field:function(v,j){this.writeTag(v,mi.Fixed64),this.writeFixed64(j)},writeSFixed64Field:function(v,j){this.writeTag(v,mi.Fixed64),this.writeSFixed64(j)},writeVarintField:function(v,j){this.writeTag(v,mi.Varint),this.writeVarint(j)},writeSVarintField:function(v,j){this.writeTag(v,mi.Varint),this.writeSVarint(j)},writeStringField:function(v,j){this.writeTag(v,mi.Bytes),this.writeString(j)},writeFloatField:function(v,j){this.writeTag(v,mi.Fixed32),this.writeFloat(j)},writeDoubleField:function(v,j){this.writeTag(v,mi.Fixed64),this.writeDouble(j)},writeBooleanField:function(v,j){this.writeVarintField(v,!!j)}};function ho(v,j,Q){var Tt=Q.buf,Nt,Yt;if(Yt=Tt[Q.pos++],Nt=(Yt&112)>>4,Yt<128||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<3,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<10,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<17,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<24,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&1)<<31,Yt<128))return Os(v,Nt,j);throw new Error("Expected varint not more than 10 bytes")}function Ro(v){return v.type===mi.Bytes?v.readVarint()+v.pos:v.pos+1}function Os(v,j,Q){return Q?j*4294967296+(v>>>0):(j>>>0)*4294967296+(v>>>0)}function Nl(v,j){var Q,Tt;if(v>=0?(Q=v%4294967296|0,Tt=v/4294967296|0):(Q=~(-v%4294967296),Tt=~(-v/4294967296),Q^4294967295?Q=Q+1|0:(Q=0,Tt=Tt+1|0)),v>=18446744073709552e3||v<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");j.realloc(10),Ms(Q,Tt,j),_s(Tt,j)}function Ms(v,j,Q){Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos]=v&127}function _s(v,j){var Q=(v&7)<<4;j.buf[j.pos++]|=Q|((v>>>=3)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127)))))}function sl(v,j,Q){var Tt=j<=16383?1:j<=2097151?2:j<=268435455?3:Math.floor(Math.log(j)/(Math.LN2*7));Q.realloc(Tt);for(var Nt=Q.pos-1;Nt>=v;Nt--)Q.buf[Nt+Tt]=Q.buf[Nt]}function Ks(v,j){for(var Q=0;Q>>8,v[Q+2]=j>>>16,v[Q+3]=j>>>24}function yf(v,j){return(v[j]|v[j+1]<<8|v[j+2]<<16)+(v[j+3]<<24)}function Wp(v,j,Q){for(var Tt="",Nt=j;Nt239?4:Yt>223?3:Yt>191?2:1;if(Nt+Ue>Q)break;var nr,Tr,jr;Ue===1?Yt<128&&(se=Yt):Ue===2?(nr=v[Nt+1],(nr&192)===128&&(se=(Yt&31)<<6|nr&63,se<=127&&(se=null))):Ue===3?(nr=v[Nt+1],Tr=v[Nt+2],(nr&192)===128&&(Tr&192)===128&&(se=(Yt&15)<<12|(nr&63)<<6|Tr&63,(se<=2047||se>=55296&&se<=57343)&&(se=null))):Ue===4&&(nr=v[Nt+1],Tr=v[Nt+2],jr=v[Nt+3],(nr&192)===128&&(Tr&192)===128&&(jr&192)===128&&(se=(Yt&15)<<18|(nr&63)<<12|(Tr&63)<<6|jr&63,(se<=65535||se>=1114112)&&(se=null))),se===null?(se=65533,Ue=1):se>65535&&(se-=65536,Tt+=String.fromCharCode(se>>>10&1023|55296),se=56320|se&1023),Tt+=String.fromCharCode(se),Nt+=Ue}return Tt}function qp(v,j,Q){return La.decode(v.subarray(j,Q))}function Gp(v,j,Q){for(var Tt=0,Nt,Yt;Tt55295&&Nt<57344)if(Yt)if(Nt<56320){v[Q++]=239,v[Q++]=191,v[Q++]=189,Yt=Nt;continue}else Nt=Yt-55296<<10|Nt-56320|65536,Yt=null;else{Nt>56319||Tt+1===j.length?(v[Q++]=239,v[Q++]=191,v[Q++]=189):Yt=Nt;continue}else Yt&&(v[Q++]=239,v[Q++]=191,v[Q++]=189,Yt=null);Nt<128?v[Q++]=Nt:(Nt<2048?v[Q++]=Nt>>6|192:(Nt<65536?v[Q++]=Nt>>12|224:(v[Q++]=Nt>>18|240,v[Q++]=Nt>>12&63|128),v[Q++]=Nt>>6&63|128),v[Q++]=Nt&63|128)}return Q}var vd=3;function Bf(v,j,Q){v===1&&Q.readMessage(Lp,j)}function Lp(v,j,Q){if(v===3){var Tt=Q.readMessage(yp,{}),Nt=Tt.id,Yt=Tt.bitmap,se=Tt.width,Ue=Tt.height,nr=Tt.left,Tr=Tt.top,jr=Tt.advance;j.push({id:Nt,bitmap:new vf({width:se+2*vd,height:Ue+2*vd},Yt),metrics:{width:se,height:Ue,left:nr,top:Tr,advance:jr}})}}function yp(v,j,Q){v===1?j.id=Q.readVarint():v===2?j.bitmap=Q.readBytes():v===3?j.width=Q.readVarint():v===4?j.height=Q.readVarint():v===5?j.left=Q.readSVarint():v===6?j.top=Q.readSVarint():v===7&&(j.advance=Q.readVarint())}function Zp(v){return new Kn(v).readFields(Bf,[])}var rp=vd;function L0(v){for(var j=0,Q=0,Tt=0,Nt=v;Tt=0;In--){var ii=Ue[In];if(!(xn.w>ii.w||xn.h>ii.h)){if(xn.x=ii.x,xn.y=ii.y,Tr=Math.max(Tr,xn.y+xn.h),nr=Math.max(nr,xn.x+xn.w),xn.w===ii.w&&xn.h===ii.h){var zi=Ue.pop();In=0&&Tt>=v&&P0[this.text.charCodeAt(Tt)];Tt--)Q--;this.text=this.text.substring(v,Q),this.sectionIndex=this.sectionIndex.slice(v,Q)},kh.prototype.substring=function(v,j){var Q=new kh;return Q.text=this.text.substring(v,j),Q.sectionIndex=this.sectionIndex.slice(v,j),Q.sections=this.sections,Q},kh.prototype.toString=function(){return this.text},kh.prototype.getMaxScale=function(){var v=this;return this.sectionIndex.reduce(function(j,Q){return Math.max(j,v.sections[Q].scale)},0)},kh.prototype.addTextSection=function(v,j){this.text+=v.text,this.sections.push(Pp.forText(v.scale,v.fontStack||j));for(var Q=this.sections.length-1,Tt=0;Tt=Fm?null:++this.imageSectionID:(this.imageSectionID=Rm,this.imageSectionID)};function np(v,j){for(var Q=[],Tt=v.text,Nt=0,Yt=0,se=j;Yt=0,jr=0,hn=0;hn0&&gh>Ls&&(Ls=gh)}else{var qd=Q[Gs.fontStack],xp=qd&&qd[bl];if(xp&&xp.rect)Kc=xp.rect,Qs=xp.metrics;else{var wf=j[Gs.fontStack],Yp=wf&&wf[bl];if(!Yp)continue;Qs=Yp.metrics}Zs=(po-Gs.scale)*$r}su?(v.verticalizable=!0,ts.push({glyph:bl,imageName:Gu,x:xn,y:In+Zs,vertical:su,scale:Gs.scale,fontStack:Gs.fontStack,sectionIndex:al,metrics:Qs,rect:Kc}),xn+=Th*Gs.scale+Tr):(ts.push({glyph:bl,imageName:Gu,x:xn,y:In+Zs,vertical:su,scale:Gs.scale,fontStack:Gs.fontStack,sectionIndex:al,metrics:Qs,rect:Kc}),xn+=Qs.advance*Gs.scale+Tr)}if(ts.length!==0){var Xp=xn-Tr;ii=Math.max(Xp,ii),n7(ts,0,ts.length-1,ka,Ls)}xn=0;var Jp=Yt*po+Ls;Qo.lineOffset=Math.max(Ls,Oo),In+=Jp,zi=Math.max(Jp,zi),++ya}var ap=In-Bh,g0=S3(se),v0=g0.horizontalAlign,Rf=g0.verticalAlign;i7(v.positionedLines,ka,v0,Rf,ii,zi,Yt,ap,Nt.length),v.top+=-Rf*ap,v.bottom=v.top+ap,v.left+=-v0*ii,v.right=v.left+ii}function n7(v,j,Q,Tt,Nt){if(!(!Tt&&!Nt))for(var Yt=v[Q],se=Yt.metrics.advance*Yt.scale,Ue=(v[Q].x+se)*Tt,nr=j;nr<=Q;nr++)v[nr].x-=Ue,v[nr].y+=Nt}function i7(v,j,Q,Tt,Nt,Yt,se,Ue,nr){var Tr=(j-Q)*Nt,jr=0;Yt!==se?jr=-Ue*Tt-Bh:jr=(-Tt*nr+.5)*se;for(var hn=0,xn=v;hn-Q/2;){if(se--,se<0)return!1;Ue-=v[se].dist(Yt),Yt=v[se]}Ue+=v[se].dist(v[se+1]),se++;for(var nr=[],Tr=0;UeTt;)Tr-=nr.shift().angleDelta;if(Tr>Nt)return!1;se++,Ue+=hn.dist(xn)}return!0}function _p(v){for(var j=0,Q=0;QTr){var ii=(Tr-nr)/In,zi=Pc(hn.x,xn.x,ii),ka=Pc(hn.y,xn.y,ii),ya=new Iy(zi,ka,xn.angleTo(hn),jr);return ya._round(),!se||x6(v,ya,Ue,se,j)?ya:void 0}nr+=In}}function h1(v,j,Q,Tt,Nt,Yt,se,Ue,nr){var Tr=I0(Tt,Yt,se),jr=uv(Tt,Nt),hn=jr*se,xn=v[0].x===0||v[0].x===nr||v[0].y===0||v[0].y===nr;j-hn=0&&Da=0&&po=0&&xn+Tr<=jr){var Oo=new Iy(Da,po,Ba,ii);Oo._round(),(!Tt||x6(v,Oo,Yt,Tt,Nt))&&In.push(Oo)}}hn+=ya}return!Ue&&!In.length&&!se&&(In=jm(v,hn/2,Q,Tt,Nt,Yt,se,!0,nr)),In}function lO(v,j,Q,Tt,Nt){for(var Yt=[],se=0;se=Tt&&hn.x>=Tt)&&(jr.x>=Tt?jr=new c(Tt,jr.y+(hn.y-jr.y)*((Tt-jr.x)/(hn.x-jr.x)))._round():hn.x>=Tt&&(hn=new c(Tt,jr.y+(hn.y-jr.y)*((Tt-jr.x)/(hn.x-jr.x)))._round()),!(jr.y>=Nt&&hn.y>=Nt)&&(jr.y>=Nt?jr=new c(jr.x+(hn.x-jr.x)*((Nt-jr.y)/(hn.y-jr.y)),Nt)._round():hn.y>=Nt&&(hn=new c(jr.x+(hn.x-jr.x)*((Nt-jr.y)/(hn.y-jr.y)),Nt)._round()),(!nr||!jr.equals(nr[nr.length-1]))&&(nr=[jr],Yt.push(nr)),nr.push(hn)))))}return Yt}var n2=Oh;function cO(v,j,Q,Tt){var Nt=[],Yt=v.image,se=Yt.pixelRatio,Ue=Yt.paddedRect.w-2*n2,nr=Yt.paddedRect.h-2*n2,Tr=v.right-v.left,jr=v.bottom-v.top,hn=Yt.stretchX||[[0,Ue]],xn=Yt.stretchY||[[0,nr]],In=function(Zu,Yc){return Zu+Yc[1]-Yc[0]},ii=hn.reduce(In,0),zi=xn.reduce(In,0),ka=Ue-ii,ya=nr-zi,Ba=0,Xa=ii,Da=0,po=zi,Oo=0,Qo=ka,ts=0,Ls=ya;if(Yt.content&&Tt){var Ps=Yt.content;Ba=b6(hn,0,Ps[0]),Da=b6(xn,0,Ps[1]),Xa=b6(hn,Ps[0],Ps[2]),po=b6(xn,Ps[1],Ps[3]),Oo=Ps[0]-Ba,ts=Ps[1]-Da,Qo=Ps[2]-Ps[0]-Xa,Ls=Ps[3]-Ps[1]-po}var Gs=function(Zu,Yc,Zh,gh){var qd=w6(Zu.stretch-Ba,Xa,Tr,v.left),xp=k6(Zu.fixed-Oo,Qo,Zu.stretch,ii),wf=w6(Yc.stretch-Da,po,jr,v.top),Yp=k6(Yc.fixed-ts,Ls,Yc.stretch,zi),Xp=w6(Zh.stretch-Ba,Xa,Tr,v.left),Jp=k6(Zh.fixed-Oo,Qo,Zh.stretch,ii),ap=w6(gh.stretch-Da,po,jr,v.top),g0=k6(gh.fixed-ts,Ls,gh.stretch,zi),v0=new c(qd,wf),Rf=new c(Xp,wf),y0=new c(Xp,ap),_m=new c(qd,ap),p1=new c(xp/se,Yp/se),By=new c(Jp/se,g0/se),Ry=j*Math.PI/180;if(Ry){var Fy=Math.sin(Ry),h2=Math.cos(Ry),og=[h2,-Fy,Fy,h2];v0._matMult(og),Rf._matMult(og),_m._matMult(og),y0._matMult(og)}var E6=Zu.stretch+Zu.fixed,p7=Zh.stretch+Zh.fixed,L6=Yc.stretch+Yc.fixed,m7=gh.stretch+gh.fixed,Um={x:Yt.paddedRect.x+n2+E6,y:Yt.paddedRect.y+n2+L6,w:p7-E6,h:m7-L6},d2=Qo/se/Tr,P6=Ls/se/jr;return{tl:v0,tr:Rf,bl:_m,br:y0,tex:Um,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:p1,pixelOffsetBR:By,minFontScaleX:d2,minFontScaleY:P6,isSDF:Q}};if(!Tt||!Yt.stretchX&&!Yt.stretchY)Nt.push(Gs({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:Ue+1},{fixed:0,stretch:nr+1}));else for(var al=uO(hn,ka,ii),bl=uO(xn,ya,zi),Zs=0;Zs0&&(In=Math.max(10,In),this.circleDiameter=In)}else{var ii=Yt.top*se-Ue,zi=Yt.bottom*se+Ue,ka=Yt.left*se-Ue,ya=Yt.right*se+Ue,Ba=Yt.collisionPadding;if(Ba&&(ka-=Ba[0]*se,ii-=Ba[1]*se,ya+=Ba[2]*se,zi+=Ba[3]*se),Tr){var Xa=new c(ka,ii),Da=new c(ya,ii),po=new c(ka,zi),Oo=new c(ya,zi),Qo=Tr*Math.PI/180;Xa._rotate(Qo),Da._rotate(Qo),po._rotate(Qo),Oo._rotate(Qo),ka=Math.min(Xa.x,Da.x,po.x,Oo.x),ya=Math.max(Xa.x,Da.x,po.x,Oo.x),ii=Math.min(Xa.y,Da.y,po.y,Oo.y),zi=Math.max(Xa.y,Da.y,po.y,Oo.y)}v.emplaceBack(j.x,j.y,ka,ii,ya,zi,Q,Tt,Nt)}this.boxEndIndex=v.length},i2=function(v,j){if(v===void 0&&(v=[]),j===void 0&&(j=ont),this.data=v,this.length=this.data.length,this.compare=j,this.length>0)for(var Q=(this.length>>1)-1;Q>=0;Q--)this._down(Q)};i2.prototype.push=function(v){this.data.push(v),this.length++,this._up(this.length-1)},i2.prototype.pop=function(){if(this.length!==0){var v=this.data[0],j=this.data.pop();return this.length--,this.length>0&&(this.data[0]=j,this._down(0)),v}},i2.prototype.peek=function(){return this.data[0]},i2.prototype._up=function(v){for(var j=this,Q=j.data,Tt=j.compare,Nt=Q[v];v>0;){var Yt=v-1>>1,se=Q[Yt];if(Tt(Nt,se)>=0)break;Q[v]=se,v=Yt}Q[v]=Nt},i2.prototype._down=function(v){for(var j=this,Q=j.data,Tt=j.compare,Nt=this.length>>1,Yt=Q[v];v=0)break;Q[v]=Ue,v=se}Q[v]=Yt};function ont(v,j){return vj?1:0}function snt(v,j,Q){Q===void 0&&(Q=!1);for(var Tt=1/0,Nt=1/0,Yt=-1/0,se=-1/0,Ue=v[0],nr=0;nrYt)&&(Yt=Tr.x),(!nr||Tr.y>se)&&(se=Tr.y)}var jr=Yt-Tt,hn=se-Nt,xn=Math.min(jr,hn),In=xn/2,ii=new i2([],lnt);if(xn===0)return new c(Tt,Nt);for(var zi=Tt;ziya.d||!ya.d)&&(ya=Xa,Q&&console.log("found best %d after %d probes",Math.round(1e4*Xa.d)/1e4,Ba)),!(Xa.max-ya.d<=j)&&(In=Xa.h/2,ii.push(new a2(Xa.p.x-In,Xa.p.y-In,In,v)),ii.push(new a2(Xa.p.x+In,Xa.p.y-In,In,v)),ii.push(new a2(Xa.p.x-In,Xa.p.y+In,In,v)),ii.push(new a2(Xa.p.x+In,Xa.p.y+In,In,v)),Ba+=4)}return Q&&(console.log("num probes: "+Ba),console.log("best distance: "+ya.d)),ya.p}function lnt(v,j){return j.max-v.max}function a2(v,j,Q,Tt){this.p=new c(v,j),this.h=Q,this.d=cnt(this.p,Tt),this.max=this.d+this.h*Math.SQRT2}function cnt(v,j){for(var Q=!1,Tt=1/0,Nt=0;Ntv.y!=jr.y>v.y&&v.x<(jr.x-Tr.x)*(v.y-Tr.y)/(jr.y-Tr.y)+Tr.x&&(Q=!Q),Tt=Math.min(Tt,Mp(v,Tr,jr))}return(Q?1:-1)*Math.sqrt(Tt)}function unt(v){for(var j=0,Q=0,Tt=0,Nt=v[0],Yt=0,se=Nt.length,Ue=se-1;Yt=ns||og.y<0||og.y>=ns||fnt(v,og,h2,Q,Tt,Nt,bl,v.layers[0],v.collisionBoxArray,j.index,j.sourceLayerIndex,v.index,ya,po,ts,nr,Xa,Oo,Ls,In,j,Yt,Tr,jr,se)};if(Ps==="line")for(var Qs=0,Kc=lO(j.geometry,0,0,ns,ns);Qs1){var wf=Nm(xp,Qo,Q.vertical||ii,Tt,zi,Ba);wf&&Zs(xp,wf)}}else if(j.type==="Polygon")for(var Yp=0,Xp=ig(j.geometry,0);Ypzy&&G(v.layerIds[0]+': Value for "text-size" is >= '+A3+'. Reduce your "text-size".')):ka.kind==="composite"&&(ya=[_f*In.compositeTextSizes[0].evaluate(se,{},ii),_f*In.compositeTextSizes[1].evaluate(se,{},ii)],(ya[0]>zy||ya[1]>zy)&&G(v.layerIds[0]+': Value for "text-size" is >= '+A3+'. Reduce your "text-size".')),v.addSymbols(v.text,zi,ya,Ue,Yt,se,Tr,j,nr.lineStartIndex,nr.lineLength,xn,ii);for(var Ba=0,Xa=jr;Bazy&&G(v.layerIds[0]+': Value for "icon-size" is >= '+A3+'. Reduce your "icon-size".')):v0.kind==="composite"&&(Rf=[_f*po.compositeIconSizes[0].evaluate(Da,{},Qo),_f*po.compositeIconSizes[1].evaluate(Da,{},Qo)],(Rf[0]>zy||Rf[1]>zy)&&G(v.layerIds[0]+': Value for "icon-size" is >= '+A3+'. Reduce your "icon-size".')),v.addSymbols(v.icon,ap,Rf,Xa,Ba,Da,!1,j,Ps.lineStartIndex,Ps.lineLength,-1,Qo),su=v.icon.placedSymbolArray.length-1,g0&&(Kc=g0.length*4,v.addSymbols(v.icon,g0,Rf,Xa,Ba,Da,od.vertical,j,Ps.lineStartIndex,Ps.lineLength,-1,Qo),Zu=v.icon.placedSymbolArray.length-1)}for(var y0 in Tt.horizontal){var _m=Tt.horizontal[y0];if(!Gs){Zh=Wt(_m.text);var p1=Ue.layout.get("text-rotate").evaluate(Da,{},Qo);Gs=new T6(nr,j,Tr,jr,hn,_m,xn,In,ii,p1)}var By=_m.positionedLines.length===1;if(Gu+=dO(v,j,_m,Yt,Ue,ii,Da,zi,Ps,Tt.vertical?od.horizontal:od.horizontalOnly,By?Object.keys(Tt.horizontal):[y0],Yc,su,po,Qo),By)break}Tt.vertical&&(Th+=dO(v,j,Tt.vertical,Yt,Ue,ii,Da,zi,Ps,od.vertical,["vertical"],Yc,Zu,po,Qo));var Ry=Gs?Gs.boxStartIndex:v.collisionBoxArray.length,Fy=Gs?Gs.boxEndIndex:v.collisionBoxArray.length,h2=bl?bl.boxStartIndex:v.collisionBoxArray.length,og=bl?bl.boxEndIndex:v.collisionBoxArray.length,E6=al?al.boxStartIndex:v.collisionBoxArray.length,p7=al?al.boxEndIndex:v.collisionBoxArray.length,L6=Zs?Zs.boxStartIndex:v.collisionBoxArray.length,m7=Zs?Zs.boxEndIndex:v.collisionBoxArray.length,Um=-1,d2=function(L3,EO){return L3&&L3.circleDiameter?Math.max(L3.circleDiameter,EO):EO};Um=d2(Gs,Um),Um=d2(bl,Um),Um=d2(al,Um),Um=d2(Zs,Um);var P6=Um>-1?1:0;P6&&(Um*=ts/$r),v.glyphOffsetArray.length>=oh.MAX_GLYPHS&&G("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Da.sortKey!==void 0&&v.addToSortKeyRanges(v.symbolInstances.length,Da.sortKey),v.symbolInstances.emplaceBack(j.x,j.y,Yc.right>=0?Yc.right:-1,Yc.center>=0?Yc.center:-1,Yc.left>=0?Yc.left:-1,Yc.vertical||-1,su,Zu,Zh,Ry,Fy,h2,og,E6,p7,L6,m7,Tr,Gu,Th,Qs,Kc,P6,0,xn,gh,qd,Um)}function pnt(v,j,Q,Tt){var Nt=v.compareText;if(!(j in Nt))Nt[j]=[];else for(var Yt=Nt[j],se=Yt.length-1;se>=0;se--)if(Tt.dist(Yt[se])0)&&(Yt.value.kind!=="constant"||Yt.value.value.length>0),Tr=Ue.value.kind!=="constant"||!!Ue.value.value||Object.keys(Ue.parameters).length>0,jr=Nt.get("symbol-sort-key");if(this.features=[],!(!nr&&!Tr)){for(var hn=j.iconDependencies,xn=j.glyphDependencies,In=j.availableImages,ii=new Yl(this.zoom),zi=0,ka=v;zi=0;for(var Gu=0,Th=ts.sections;Gu=0;Ue--)Yt[Ue]={x:j[Ue].x,y:j[Ue].y,tileUnitDistanceFromAnchor:Nt},Ue>0&&(Nt+=j[Ue-1].dist(j[Ue]));for(var nr=0;nr0},oh.prototype.hasIconData=function(){return this.icon.segments.get().length>0},oh.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},oh.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},oh.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},oh.prototype.addIndicesForPlacedSymbol=function(v,j){for(var Q=v.placedSymbolArray.get(j),Tt=Q.vertexStartIndex+Q.numGlyphs*4,Nt=Q.vertexStartIndex;Nt1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(v),this.sortedAngle=v,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var Q=0,Tt=this.symbolInstanceIndexes;Q=0&&nr.indexOf(se)===Ue&&j.addIndicesForPlacedSymbol(j.text,se)}),Yt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Yt.verticalPlacedTextSymbolIndex),Yt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Yt.placedIconSymbolIndex),Yt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Yt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},hr("SymbolBucket",oh,{omit:["layers","collisionBoxArray","features","compareText"]}),oh.MAX_GLYPHS=65535,oh.addDynamicAttributes=c7;function ynt(v,j){return j.replace(/{([^{}]+)}/g,function(Q,Tt){return Tt in v?String(v[Tt]):""})}var _nt=new co({"symbol-placement":new On(Wa.layout_symbol["symbol-placement"]),"symbol-spacing":new On(Wa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new On(Wa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Si(Wa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new On(Wa.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new On(Wa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new On(Wa.layout_symbol["icon-ignore-placement"]),"icon-optional":new On(Wa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new On(Wa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Si(Wa.layout_symbol["icon-size"]),"icon-text-fit":new On(Wa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new On(Wa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Si(Wa.layout_symbol["icon-image"]),"icon-rotate":new Si(Wa.layout_symbol["icon-rotate"]),"icon-padding":new On(Wa.layout_symbol["icon-padding"]),"icon-keep-upright":new On(Wa.layout_symbol["icon-keep-upright"]),"icon-offset":new Si(Wa.layout_symbol["icon-offset"]),"icon-anchor":new Si(Wa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new On(Wa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new On(Wa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new On(Wa.layout_symbol["text-rotation-alignment"]),"text-field":new Si(Wa.layout_symbol["text-field"]),"text-font":new Si(Wa.layout_symbol["text-font"]),"text-size":new Si(Wa.layout_symbol["text-size"]),"text-max-width":new Si(Wa.layout_symbol["text-max-width"]),"text-line-height":new On(Wa.layout_symbol["text-line-height"]),"text-letter-spacing":new Si(Wa.layout_symbol["text-letter-spacing"]),"text-justify":new Si(Wa.layout_symbol["text-justify"]),"text-radial-offset":new Si(Wa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new On(Wa.layout_symbol["text-variable-anchor"]),"text-anchor":new Si(Wa.layout_symbol["text-anchor"]),"text-max-angle":new On(Wa.layout_symbol["text-max-angle"]),"text-writing-mode":new On(Wa.layout_symbol["text-writing-mode"]),"text-rotate":new Si(Wa.layout_symbol["text-rotate"]),"text-padding":new On(Wa.layout_symbol["text-padding"]),"text-keep-upright":new On(Wa.layout_symbol["text-keep-upright"]),"text-transform":new Si(Wa.layout_symbol["text-transform"]),"text-offset":new Si(Wa.layout_symbol["text-offset"]),"text-allow-overlap":new On(Wa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new On(Wa.layout_symbol["text-ignore-placement"]),"text-optional":new On(Wa.layout_symbol["text-optional"])}),xnt=new co({"icon-opacity":new Si(Wa.paint_symbol["icon-opacity"]),"icon-color":new Si(Wa.paint_symbol["icon-color"]),"icon-halo-color":new Si(Wa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Si(Wa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Si(Wa.paint_symbol["icon-halo-blur"]),"icon-translate":new On(Wa.paint_symbol["icon-translate"]),"icon-translate-anchor":new On(Wa.paint_symbol["icon-translate-anchor"]),"text-opacity":new Si(Wa.paint_symbol["text-opacity"]),"text-color":new Si(Wa.paint_symbol["text-color"],{runtimeType:mc,getOverride:function(v){return v.textColor},hasOverride:function(v){return!!v.textColor}}),"text-halo-color":new Si(Wa.paint_symbol["text-halo-color"]),"text-halo-width":new Si(Wa.paint_symbol["text-halo-width"]),"text-halo-blur":new Si(Wa.paint_symbol["text-halo-blur"]),"text-translate":new On(Wa.paint_symbol["text-translate"]),"text-translate-anchor":new On(Wa.paint_symbol["text-translate-anchor"])}),u7={paint:xnt,layout:_nt},l2=function(v){this.type=v.property.overrides?v.property.overrides.runtimeType:Gc,this.defaultValue=v};l2.prototype.evaluate=function(v){if(v.formattedSection){var j=this.defaultValue.property.overrides;if(j&&j.hasOverride(v.formattedSection))return j.getOverride(v.formattedSection)}return v.feature&&v.featureState?this.defaultValue.evaluate(v.feature,v.featureState):this.defaultValue.property.specification.default},l2.prototype.eachChild=function(v){if(!this.defaultValue.isConstant()){var j=this.defaultValue.value;v(j._styleExpression.expression)}},l2.prototype.outputDefined=function(){return!1},l2.prototype.serialize=function(){return null},hr("FormatSectionOverride",l2,{omit:["defaultValue"]});var bnt=function(v){function j(Q){v.call(this,Q,u7)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.recalculate=function(Q,Tt){if(v.prototype.recalculate.call(this,Q,Tt),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var Nt=this.layout.get("text-writing-mode");if(Nt){for(var Yt=[],se=0,Ue=Nt;se",targetMapId:Tt,sourceMapId:Yt.mapId})}}},c2.prototype.receive=function(v){var j=v.data,Q=j.id;if(Q&&!(j.targetMapId&&this.mapId!==j.targetMapId))if(j.type===""){delete this.tasks[Q];var Tt=this.cancelCallbacks[Q];delete this.cancelCallbacks[Q],Tt&&Tt()}else vt()||j.mustQueue?(this.tasks[Q]=j,this.taskQueue.push(Q),this.invoker.trigger()):this.processTask(Q,j)},c2.prototype.process=function(){if(this.taskQueue.length){var v=this.taskQueue.shift(),j=this.tasks[v];delete this.tasks[v],this.taskQueue.length&&this.invoker.trigger(),j&&this.processTask(v,j)}},c2.prototype.processTask=function(v,j){var Q=this;if(j.type===""){var Tt=this.callbacks[v];delete this.callbacks[v],Tt&&(j.error?Tt(Bn(j.error)):Tt(null,Bn(j.data)))}else{var Nt=!1,Yt=gt(this.globalScope)?void 0:[],se=j.hasCallback?function(hn,xn){Nt=!0,delete Q.cancelCallbacks[v],Q.target.postMessage({id:v,type:"",sourceMapId:Q.mapId,error:hn?fn(hn):null,data:fn(xn,Yt)},Yt)}:function(hn){Nt=!0},Ue=null,nr=Bn(j.data);if(this.parent[j.type])Ue=this.parent[j.type](j.sourceMapId,nr,se);else if(this.parent.getWorkerSource){var Tr=j.type.split("."),jr=this.parent.getWorkerSource(j.sourceMapId,Tr[0],nr.source);Ue=jr[Tr[1]](nr,se)}else se(new Error("Could not find function "+j.type));!Nt&&Ue&&Ue.cancel&&(this.cancelCallbacks[v]=Ue.cancel)}},c2.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function Int(v,j,Q){j=Math.pow(2,Q)-j-1;var Tt=yO(v*256,j*256,Q),Nt=yO((v+1)*256,(j+1)*256,Q);return Tt[0]+","+Tt[1]+","+Nt[0]+","+Nt[1]}function yO(v,j,Q){var Tt=2*Math.PI*6378137/256/Math.pow(2,Q),Nt=v*Tt-2*Math.PI*6378137/2,Yt=j*Tt-2*Math.PI*6378137/2;return[Nt,Yt]}var xf=function(v,j){v&&(j?this.setSouthWest(v).setNorthEast(j):v.length===4?this.setSouthWest([v[0],v[1]]).setNorthEast([v[2],v[3]]):this.setSouthWest(v[0]).setNorthEast(v[1]))};xf.prototype.setNorthEast=function(v){return this._ne=v instanceof sd?new sd(v.lng,v.lat):sd.convert(v),this},xf.prototype.setSouthWest=function(v){return this._sw=v instanceof sd?new sd(v.lng,v.lat):sd.convert(v),this},xf.prototype.extend=function(v){var j=this._sw,Q=this._ne,Tt,Nt;if(v instanceof sd)Tt=v,Nt=v;else if(v instanceof xf){if(Tt=v._sw,Nt=v._ne,!Tt||!Nt)return this}else{if(Array.isArray(v))if(v.length===4||v.every(Array.isArray)){var Yt=v;return this.extend(xf.convert(Yt))}else{var se=v;return this.extend(sd.convert(se))}return this}return!j&&!Q?(this._sw=new sd(Tt.lng,Tt.lat),this._ne=new sd(Nt.lng,Nt.lat)):(j.lng=Math.min(Tt.lng,j.lng),j.lat=Math.min(Tt.lat,j.lat),Q.lng=Math.max(Nt.lng,Q.lng),Q.lat=Math.max(Nt.lat,Q.lat)),this},xf.prototype.getCenter=function(){return new sd((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},xf.prototype.getSouthWest=function(){return this._sw},xf.prototype.getNorthEast=function(){return this._ne},xf.prototype.getNorthWest=function(){return new sd(this.getWest(),this.getNorth())},xf.prototype.getSouthEast=function(){return new sd(this.getEast(),this.getSouth())},xf.prototype.getWest=function(){return this._sw.lng},xf.prototype.getSouth=function(){return this._sw.lat},xf.prototype.getEast=function(){return this._ne.lng},xf.prototype.getNorth=function(){return this._ne.lat},xf.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},xf.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},xf.prototype.isEmpty=function(){return!(this._sw&&this._ne)},xf.prototype.contains=function(v){var j=sd.convert(v),Q=j.lng,Tt=j.lat,Nt=this._sw.lat<=Tt&&Tt<=this._ne.lat,Yt=this._sw.lng<=Q&&Q<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Yt=this._sw.lng>=Q&&Q>=this._ne.lng),Nt&&Yt},xf.convert=function(v){return!v||v instanceof xf?v:new xf(v)};var _O=63710088e-1,sd=function(v,j){if(isNaN(v)||isNaN(j))throw new Error("Invalid LngLat object: ("+v+", "+j+")");if(this.lng=+v,this.lat=+j,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};sd.prototype.wrap=function(){return new sd(k(this.lng,-180,180),this.lat)},sd.prototype.toArray=function(){return[this.lng,this.lat]},sd.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},sd.prototype.distanceTo=function(v){var j=Math.PI/180,Q=this.lat*j,Tt=v.lat*j,Nt=Math.sin(Q)*Math.sin(Tt)+Math.cos(Q)*Math.cos(Tt)*Math.cos((v.lng-this.lng)*j),Yt=_O*Math.acos(Math.min(Nt,1));return Yt},sd.prototype.toBounds=function(v){v===void 0&&(v=0);var j=40075017,Q=360*v/j,Tt=Q/Math.cos(Math.PI/180*this.lat);return new xf(new sd(this.lng-Tt,this.lat-Q),new sd(this.lng+Tt,this.lat+Q))},sd.convert=function(v){if(v instanceof sd)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new sd(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&typeof v=="object"&&v!==null)return new sd(Number("lng"in v?v.lng:v.lon),Number(v.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 [, ]")};var xO=2*Math.PI*_O;function bO(v){return xO*Math.cos(v*Math.PI/180)}function wO(v){return(180+v)/360}function kO(v){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+v*Math.PI/360)))/360}function TO(v,j){return v/bO(j)}function Dnt(v){return v*360-180}function d7(v){var j=180-v*360;return 360/Math.PI*Math.atan(Math.exp(j*Math.PI/180))-90}function znt(v,j){return v*bO(d7(j))}function Ont(v){return 1/Math.cos(v*Math.PI/180)}var ax=function(v,j,Q){Q===void 0&&(Q=0),this.x=+v,this.y=+j,this.z=+Q};ax.fromLngLat=function(v,j){j===void 0&&(j=0);var Q=sd.convert(v);return new ax(wO(Q.lng),kO(Q.lat),TO(j,Q.lat))},ax.prototype.toLngLat=function(){return new sd(Dnt(this.x),d7(this.y))},ax.prototype.toAltitude=function(){return znt(this.z,this.y)},ax.prototype.meterInMercatorCoordinateUnits=function(){return 1/xO*Ont(d7(this.y))};var ox=function(v,j,Q){this.z=v,this.x=j,this.y=Q,this.key=E3(0,v,v,j,Q)};ox.prototype.equals=function(v){return this.z===v.z&&this.x===v.x&&this.y===v.y},ox.prototype.url=function(v,j){var Q=Int(this.x,this.y,this.z),Tt=Bnt(this.z,this.x,this.y);return v[(this.x+this.y)%v.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(j==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",Tt).replace("{bbox-epsg-3857}",Q)},ox.prototype.getTilePoint=function(v){var j=Math.pow(2,this.z);return new c((v.x*j-this.x)*ns,(v.y*j-this.y)*ns)},ox.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var SO=function(v,j){this.wrap=v,this.canonical=j,this.key=E3(v,j.z,j.z,j.x,j.y)},bf=function(v,j,Q,Tt,Nt){this.overscaledZ=v,this.wrap=j,this.canonical=new ox(Q,+Tt,+Nt),this.key=E3(j,v,Q,Tt,Nt)};bf.prototype.equals=function(v){return this.overscaledZ===v.overscaledZ&&this.wrap===v.wrap&&this.canonical.equals(v.canonical)},bf.prototype.scaledTo=function(v){var j=this.canonical.z-v;return v>this.canonical.z?new bf(v,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new bf(v,this.wrap,v,this.canonical.x>>j,this.canonical.y>>j)},bf.prototype.calculateScaledKey=function(v,j){var Q=this.canonical.z-v;return v>this.canonical.z?E3(this.wrap*+j,v,this.canonical.z,this.canonical.x,this.canonical.y):E3(this.wrap*+j,v,v,this.canonical.x>>Q,this.canonical.y>>Q)},bf.prototype.isChildOf=function(v){if(v.wrap!==this.wrap)return!1;var j=this.canonical.z-v.canonical.z;return v.overscaledZ===0||v.overscaledZ>j&&v.canonical.y===this.canonical.y>>j},bf.prototype.children=function(v){if(this.overscaledZ>=v)return[new bf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var j=this.canonical.z+1,Q=this.canonical.x*2,Tt=this.canonical.y*2;return[new bf(j,this.wrap,j,Q,Tt),new bf(j,this.wrap,j,Q+1,Tt),new bf(j,this.wrap,j,Q,Tt+1),new bf(j,this.wrap,j,Q+1,Tt+1)]},bf.prototype.isLessThan=function(v){return this.wrapv.wrap?!1:this.overscaledZv.overscaledZ?!1:this.canonical.xv.canonical.x?!1:this.canonical.y0;Yt--)Nt=1<=this.dim+1||j<-1||j>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(j+1)*this.stride+(v+1)},d1.prototype._unpackMapbox=function(v,j,Q){return(v*256*256+j*256+Q)/10-1e4},d1.prototype._unpackTerrarium=function(v,j,Q){return v*256+j+Q/256-32768},d1.prototype.getPixels=function(){return new gp({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},d1.prototype.backfillBorder=function(v,j,Q){if(this.dim!==v.dim)throw new Error("dem dimension mismatch");var Tt=j*this.dim,Nt=j*this.dim+this.dim,Yt=Q*this.dim,se=Q*this.dim+this.dim;switch(j){case-1:Tt=Nt-1;break;case 1:Nt=Tt+1;break}switch(Q){case-1:Yt=se-1;break;case 1:se=Yt+1;break}for(var Ue=-j*this.dim,nr=-Q*this.dim,Tr=Yt;Tr=0&&jr[3]>=0&&Ue.insert(se,jr[0],jr[1],jr[2],jr[3])}},f1.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new u1.VectorTile(new Kn(this.rawTileData)).layers,this.sourceLayerCoder=new A6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},f1.prototype.query=function(v,j,Q,Tt){var Nt=this;this.loadVTLayers();for(var Yt=v.params||{},se=ns/v.tileSize/v.scale,Ue=le(Yt.filter),nr=v.queryGeometry,Tr=v.queryPadding*se,jr=AO(nr),hn=this.grid.query(jr.minX-Tr,jr.minY-Tr,jr.maxX+Tr,jr.maxY+Tr),xn=AO(v.cameraQueryGeometry),In=this.grid3D.query(xn.minX-Tr,xn.minY-Tr,xn.maxX+Tr,xn.maxY+Tr,function(po,Oo,Qo,ts){return rg(v.cameraQueryGeometry,po-Tr,Oo-Tr,Qo+Tr,ts+Tr)}),ii=0,zi=In;iiTt)Nt=!1;else if(!j)Nt=!0;else if(this.expirationTime=Yr.maxzoom)&&Yr.visibility!=="none"){m(cn,this.zoom,vr);var un=Li[Yr.id]=Yr.createBucket({index:Wn.bucketLayerIDs.length,layers:cn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ei,sourceID:this.source});un.populate(Ga,Fi,this.tileID.canonical),Wn.bucketLayerIDs.push(cn.map(function(Jn){return Jn.id}))}}}}var Pn,bn,ze,yr,en=n.mapObject(Fi.glyphDependencies,function(Jn){return Object.keys(Jn).map(Number)});Object.keys(en).length?Ar.send("getGlyphs",{uid:this.uid,stacks:en},function(Jn,Gn){Pn||(Pn=Jn,bn=Gn,xi.call(Zn))}):bn={};var Rn=Object.keys(Fi.iconDependencies);Rn.length?Ar.send("getImages",{icons:Rn,source:this.source,tileID:this.tileID,type:"icons"},function(Jn,Gn){Pn||(Pn=Jn,ze=Gn,xi.call(Zn))}):ze={};var ni=Object.keys(Fi.patternDependencies);ni.length?Ar.send("getImages",{icons:ni,source:this.source,tileID:this.tileID,type:"patterns"},function(Jn,Gn){Pn||(Pn=Jn,yr=Gn,xi.call(Zn))}):yr={},xi.call(this);function xi(){if(Pn)return mn(Pn);if(bn&&ze&&yr){var Jn=new s(bn),Gn=new n.ImageAtlas(ze,yr);for(var pi in Li){var Va=Li[pi];Va instanceof n.SymbolBucket?(m(Va.layers,this.zoom,vr),n.performSymbolLayout(Va,bn,Jn.positions,ze,Gn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Va.hasPattern&&(Va instanceof n.LineBucket||Va instanceof n.FillBucket||Va instanceof n.FillExtrusionBucket)&&(m(Va.layers,this.zoom,vr),Va.addFeatures(Fi,this.tileID.canonical,Gn.patternPositions))}this.status="done",mn(null,{buckets:n.values(Li).filter(function(ea){return!ea.isEmpty()}),featureIndex:Wn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Jn.image,imageAtlas:Gn,glyphMap:this.returnDependencies?bn:null,iconMap:this.returnDependencies?ze:null,glyphPositions:this.returnDependencies?Jn.positions:null})}}};function m(Ke,sr,vr){for(var Ar=new n.EvaluationParameters(sr),mn=0,Zn=Ke;mn=0!=!!sr&&Ke.reverse()}var E=n.vectorTile.VectorTileFeature.prototype.toGeoJSON,I=function(Ke){this._feature=Ke,this.extent=n.EXTENT,this.type=Ke.type,this.properties=Ke.tags,"id"in Ke&&!isNaN(Ke.id)&&(this.id=parseInt(Ke.id,10))};I.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Ke=[],sr=0,vr=this._feature.geometry;sr"u"&&(Ar.push(Wn),Li=Ar.length-1,Zn[Wn]=Li),sr.writeVarint(Li);var Fi=vr.properties[Wn],Zi=typeof Fi;Zi!=="string"&&Zi!=="boolean"&&Zi!=="number"&&(Fi=JSON.stringify(Fi));var Ji=Zi+":"+Fi,ca=Un[Ji];typeof ca>"u"&&(mn.push(Fi),ca=mn.length-1,Un[Ji]=ca),sr.writeVarint(ca)}}function ht(Ke,sr){return(sr<<3)+(Ke&7)}function bt(Ke){return Ke<<1^Ke>>31}function vt(Ke,sr){for(var vr=Ke.loadGeometry(),Ar=Ke.type,mn=0,Zn=0,Un=vr.length,Wn=0;Wn>1;gt(Ke,sr,Un,Ar,mn,Zn%2),rt(Ke,sr,vr,Ar,Un-1,Zn+1),rt(Ke,sr,vr,Un+1,mn,Zn+1)}}function gt(Ke,sr,vr,Ar,mn,Zn){for(;mn>Ar;){if(mn-Ar>600){var Un=mn-Ar+1,Wn=vr-Ar+1,Li=Math.log(Un),Fi=.5*Math.exp(2*Li/3),Zi=.5*Math.sqrt(Li*Fi*(Un-Fi)/Un)*(Wn-Un/2<0?-1:1),Ji=Math.max(Ar,Math.floor(vr-Wn*Fi/Un+Zi)),ca=Math.min(mn,Math.floor(vr+(Un-Wn)*Fi/Un+Zi));gt(Ke,sr,vr,Ji,ca,Zn)}var Ei=sr[2*vr+Zn],Ga=Ar,so=mn;for(it(Ke,sr,Ar,vr),sr[2*mn+Zn]>Ei&&it(Ke,sr,Ar,mn);GaEi;)so--}sr[2*Ar+Zn]===Ei?it(Ke,sr,Ar,so):(so++,it(Ke,sr,so,mn)),so<=vr&&(Ar=so+1),vr<=so&&(mn=so-1)}}function it(Ke,sr,vr,Ar){st(Ke,vr,Ar),st(sr,2*vr,2*Ar),st(sr,2*vr+1,2*Ar+1)}function st(Ke,sr,vr){var Ar=Ke[sr];Ke[sr]=Ke[vr],Ke[vr]=Ar}function xt(Ke,sr,vr,Ar,mn,Zn,Un){for(var Wn=[0,Ke.length-1,0],Li=[],Fi,Zi;Wn.length;){var Ji=Wn.pop(),ca=Wn.pop(),Ei=Wn.pop();if(ca-Ei<=Un){for(var Ga=Ei;Ga<=ca;Ga++)Fi=sr[2*Ga],Zi=sr[2*Ga+1],Fi>=vr&&Fi<=mn&&Zi>=Ar&&Zi<=Zn&&Li.push(Ke[Ga]);continue}var so=Math.floor((Ei+ca)/2);Fi=sr[2*so],Zi=sr[2*so+1],Fi>=vr&&Fi<=mn&&Zi>=Ar&&Zi<=Zn&&Li.push(Ke[so]);var Fe=(Ji+1)%2;(Ji===0?vr<=Fi:Ar<=Zi)&&(Wn.push(Ei),Wn.push(so-1),Wn.push(Fe)),(Ji===0?mn>=Fi:Zn>=Zi)&&(Wn.push(so+1),Wn.push(ca),Wn.push(Fe))}return Li}function ot(Ke,sr,vr,Ar,mn,Zn){for(var Un=[0,Ke.length-1,0],Wn=[],Li=mn*mn;Un.length;){var Fi=Un.pop(),Zi=Un.pop(),Ji=Un.pop();if(Zi-Ji<=Zn){for(var ca=Ji;ca<=Zi;ca++)J(sr[2*ca],sr[2*ca+1],vr,Ar)<=Li&&Wn.push(Ke[ca]);continue}var Ei=Math.floor((Ji+Zi)/2),Ga=sr[2*Ei],so=sr[2*Ei+1];J(Ga,so,vr,Ar)<=Li&&Wn.push(Ke[Ei]);var Fe=(Fi+1)%2;(Fi===0?vr-mn<=Ga:Ar-mn<=so)&&(Un.push(Ji),Un.push(Ei-1),Un.push(Fe)),(Fi===0?vr+mn>=Ga:Ar+mn>=so)&&(Un.push(Ei+1),Un.push(Zi),Un.push(Fe))}return Wn}function J(Ke,sr,vr,Ar){var mn=Ke-vr,Zn=sr-Ar;return mn*mn+Zn*Zn}var mt=function(Ke){return Ke[0]},dt=function(Ke){return Ke[1]},Ct=function(Ke,sr,vr,Ar,mn){sr===void 0&&(sr=mt),vr===void 0&&(vr=dt),Ar===void 0&&(Ar=64),mn===void 0&&(mn=Float64Array),this.nodeSize=Ar,this.points=Ke;for(var Zn=Ke.length<65536?Uint16Array:Uint32Array,Un=this.ids=new Zn(Ke.length),Wn=this.coords=new mn(Ke.length*2),Li=0;Li=Ar;Fi--){var Zi=+Date.now();Wn=this._cluster(Wn,Fi),this.trees[Fi]=new Ct(Wn,Lt,ie,Zn,Float32Array),vr&&console.log("z%d: %d clusters in %dms",Fi,Wn.length,+Date.now()-Zi)}return vr&&console.timeEnd("total time"),this},Bt.prototype.getClusters=function(Ke,sr){var vr=((Ke[0]+180)%360+360)%360-180,Ar=Math.max(-90,Math.min(90,Ke[1])),mn=Ke[2]===180?180:((Ke[2]+180)%360+360)%360-180,Zn=Math.max(-90,Math.min(90,Ke[3]));if(Ke[2]-Ke[0]>=360)vr=-180,mn=180;else if(vr>mn){var Un=this.getClusters([vr,Ar,180,Zn],sr),Wn=this.getClusters([-180,Ar,mn,Zn],sr);return Un.concat(Wn)}for(var Li=this.trees[this._limitZoom(sr)],Fi=Li.range(ge(vr),ye(Zn),ge(mn),ye(Ar)),Zi=[],Ji=0,ca=Fi;Jisr&&(Ga+=Kr.numPoints||1)}if(Ga>=Wn){for(var sn=Zi.x*Ei,cn=Zi.y*Ei,Yr=Un&&Ei>1?this._map(Zi,!0):null,un=(Fi<<5)+(sr+1)+this.points.length,Pn=0,bn=ca;Pn1)for(var Rn=0,ni=ca;Rn>5},Bt.prototype._getOriginZoom=function(Ke){return(Ke-this.points.length)%32},Bt.prototype._map=function(Ke,sr){if(Ke.numPoints)return sr?Ot({},Ke.properties):Ke.properties;var vr=this.points[Ke.index].properties,Ar=this.options.map(vr);return sr&&Ar===vr?Ot({},Ar):Ar};function Zt(Ke,sr,vr,Ar,mn){return{x:Ke,y:sr,zoom:1/0,id:vr,parentId:-1,numPoints:Ar,properties:mn}}function Gt(Ke,sr){var vr=Ke.geometry.coordinates,Ar=vr[0],mn=vr[1];return{x:ge(Ar),y:ye(mn),zoom:1/0,index:sr,parentId:-1}}function ee(Ke){return{type:"Feature",id:Ke.id,properties:xe(Ke),geometry:{type:"Point",coordinates:[ue(Ke.x),Mt(Ke.y)]}}}function xe(Ke){var sr=Ke.numPoints,vr=sr>=1e4?Math.round(sr/1e3)+"k":sr>=1e3?Math.round(sr/100)/10+"k":sr;return Ot(Ot({},Ke.properties),{cluster:!0,cluster_id:Ke.id,point_count:sr,point_count_abbreviated:vr})}function ge(Ke){return Ke/360+.5}function ye(Ke){var sr=Math.sin(Ke*Math.PI/180),vr=.5-.25*Math.log((1+sr)/(1-sr))/Math.PI;return vr<0?0:vr>1?1:vr}function ue(Ke){return(Ke-.5)*360}function Mt(Ke){var sr=(180-Ke*360)*Math.PI/180;return 360*Math.atan(Math.exp(sr))/Math.PI-90}function Ot(Ke,sr){for(var vr in sr)Ke[vr]=sr[vr];return Ke}function Lt(Ke){return Ke.x}function ie(Ke){return Ke.y}function be(Ke,sr,vr,Ar){for(var mn=Ar,Zn=vr-sr>>1,Un=vr-sr,Wn,Li=Ke[sr],Fi=Ke[sr+1],Zi=Ke[vr],Ji=Ke[vr+1],ca=sr+3;camn)Wn=ca,mn=Ei;else if(Ei===mn){var Ga=Math.abs(ca-Zn);GaAr&&(Wn-sr>3&&be(Ke,sr,Wn,Ar),Ke[Wn+2]=mn,vr-Wn>3&&be(Ke,Wn,vr,Ar))}function ce(Ke,sr,vr,Ar,mn,Zn){var Un=mn-vr,Wn=Zn-Ar;if(Un!==0||Wn!==0){var Li=((Ke-vr)*Un+(sr-Ar)*Wn)/(Un*Un+Wn*Wn);Li>1?(vr=mn,Ar=Zn):Li>0&&(vr+=Un*Li,Ar+=Wn*Li)}return Un=Ke-vr,Wn=sr-Ar,Un*Un+Wn*Wn}function Le(Ke,sr,vr,Ar){var mn={id:typeof Ke>"u"?null:Ke,type:sr,geometry:vr,tags:Ar,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ze(mn),mn}function Ze(Ke){var sr=Ke.geometry,vr=Ke.type;if(vr==="Point"||vr==="MultiPoint"||vr==="LineString")Qe(Ke,sr);else if(vr==="Polygon"||vr==="MultiLineString")for(var Ar=0;Ar0&&(Ar?Un+=(mn*Fi-Li*Zn)/2:Un+=Math.sqrt(Math.pow(Li-mn,2)+Math.pow(Fi-Zn,2))),mn=Li,Zn=Fi}var Zi=sr.length-3;sr[2]=1,be(sr,0,Zi,vr),sr[Zi+2]=1,sr.size=Math.abs(Un),sr.start=0,sr.end=sr.size}function Er(Ke,sr,vr,Ar){for(var mn=0;mn1?1:vr}function Oe(Ke,sr,vr,Ar,mn,Zn,Un,Wn){if(vr/=sr,Ar/=sr,Zn>=vr&&Un=Ar)return null;for(var Li=[],Fi=0;Fi=vr&&Ga=Ar)continue;var so=[];if(ca==="Point"||ca==="MultiPoint")Xt(Ji,so,vr,Ar,mn);else if(ca==="LineString")oe(Ji,so,vr,Ar,mn,!1,Wn.lineMetrics);else if(ca==="MultiLineString")_t(Ji,so,vr,Ar,mn,!1);else if(ca==="Polygon")_t(Ji,so,vr,Ar,mn,!0);else if(ca==="MultiPolygon")for(var Fe=0;Fe=vr&&Un<=Ar&&(sr.push(Ke[Zn]),sr.push(Ke[Zn+1]),sr.push(Ke[Zn+2]))}}function oe(Ke,sr,vr,Ar,mn,Zn,Un){for(var Wn=zt(Ke),Li=mn===0?Ht:ae,Fi=Ke.start,Zi,Ji,ca=0;cavr&&(Ji=Li(Wn,Ei,Ga,Fe,Re,vr),Un&&(Wn.start=Fi+Zi*Ji)):Kr>Ar?sn=vr&&(Ji=Li(Wn,Ei,Ga,Fe,Re,vr),cn=!0),sn>Ar&&Kr<=Ar&&(Ji=Li(Wn,Ei,Ga,Fe,Re,Ar),cn=!0),!Zn&&cn&&(Un&&(Wn.end=Fi+Zi*Ji),sr.push(Wn),Wn=zt(Ke)),Un&&(Fi+=Zi)}var Yr=Ke.length-3;Ei=Ke[Yr],Ga=Ke[Yr+1],so=Ke[Yr+2],Kr=mn===0?Ei:Ga,Kr>=vr&&Kr<=Ar&&Pt(Wn,Ei,Ga,so),Yr=Wn.length-3,Zn&&Yr>=3&&(Wn[Yr]!==Wn[0]||Wn[Yr+1]!==Wn[1])&&Pt(Wn,Wn[0],Wn[1],Wn[2]),Wn.length&&sr.push(Wn)}function zt(Ke){var sr=[];return sr.size=Ke.size,sr.start=Ke.start,sr.end=Ke.end,sr}function _t(Ke,sr,vr,Ar,mn,Zn){for(var Un=0;UnUn.maxX&&(Un.maxX=Zi),Ji>Un.maxY&&(Un.maxY=Ji)}return Un}function zr(Ke,sr,vr,Ar){var mn=sr.geometry,Zn=sr.type,Un=[];if(Zn==="Point"||Zn==="MultiPoint")for(var Wn=0;Wn0&&sr.size<(mn?Un:Ar)){vr.numPoints+=sr.length/3;return}for(var Wn=[],Li=0;LiUn)&&(vr.numSimplified++,Wn.push(sr[Li]),Wn.push(sr[Li+1])),vr.numPoints++;mn&&pn(Wn,Zn),Ke.push(Wn)}function pn(Ke,sr){for(var vr=0,Ar=0,mn=Ke.length,Zn=mn-2;Ar0===sr)for(Ar=0,mn=Ke.length;Ar24)throw new Error("maxZoom should be in the 0-24 range");if(sr.promoteId&&sr.generateId)throw new Error("promoteId and generateId cannot be used together.");var Ar=mr(Ke,sr);this.tiles={},this.tileCoords=[],vr&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",sr.indexMaxZoom,sr.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ar=he(Ar,sr),Ar.length&&this.splitTile(Ar,0,0,0),vr&&(Ar.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}ui.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ui.prototype.splitTile=function(Ke,sr,vr,Ar,mn,Zn,Un){for(var Wn=[Ke,sr,vr,Ar],Li=this.options,Fi=Li.debug;Wn.length;){Ar=Wn.pop(),vr=Wn.pop(),sr=Wn.pop(),Ke=Wn.pop();var Zi=1<1&&console.time("creation"),ca=this.tiles[Ji]=Rr(Ke,sr,vr,Ar,Li),this.tileCoords.push({z:sr,x:vr,y:Ar}),Fi)){Fi>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",sr,vr,Ar,ca.numFeatures,ca.numPoints,ca.numSimplified),console.timeEnd("creation"));var Ei="z"+sr;this.stats[Ei]=(this.stats[Ei]||0)+1,this.total++}if(ca.source=Ke,mn){if(sr===Li.maxZoom||sr===mn)continue;var Ga=1<1&&console.time("clipping");var so=.5*Li.buffer/Li.extent,Fe=.5-so,Re=.5+so,Kr=1+so,sn,cn,Yr,un,Pn,bn;sn=cn=Yr=un=null,Pn=Oe(Ke,Zi,vr-so,vr+Re,0,ca.minX,ca.maxX,Li),bn=Oe(Ke,Zi,vr+Fe,vr+Kr,0,ca.minX,ca.maxX,Li),Ke=null,Pn&&(sn=Oe(Pn,Zi,Ar-so,Ar+Re,1,ca.minY,ca.maxY,Li),cn=Oe(Pn,Zi,Ar+Fe,Ar+Kr,1,ca.minY,ca.maxY,Li),Pn=null),bn&&(Yr=Oe(bn,Zi,Ar-so,Ar+Re,1,ca.minY,ca.maxY,Li),un=Oe(bn,Zi,Ar+Fe,Ar+Kr,1,ca.minY,ca.maxY,Li),bn=null),Fi>1&&console.timeEnd("clipping"),Wn.push(sn||[],sr+1,vr*2,Ar*2),Wn.push(cn||[],sr+1,vr*2,Ar*2+1),Wn.push(Yr||[],sr+1,vr*2+1,Ar*2),Wn.push(un||[],sr+1,vr*2+1,Ar*2+1)}}},ui.prototype.getTile=function(Ke,sr,vr){var Ar=this.options,mn=Ar.extent,Zn=Ar.debug;if(Ke<0||Ke>24)return null;var Un=1<1&&console.log("drilling down to z%d-%d-%d",Ke,sr,vr);for(var Li=Ke,Fi=sr,Zi=vr,Ji;!Ji&&Li>0;)Li--,Fi=Math.floor(Fi/2),Zi=Math.floor(Zi/2),Ji=this.tiles[yi(Li,Fi,Zi)];return!Ji||!Ji.source?null:(Zn>1&&console.log("found parent tile z%d-%d-%d",Li,Fi,Zi),Zn>1&&console.time("drilling down"),this.splitTile(Ji.source,Li,Fi,Zi,Ke,sr,vr),Zn>1&&console.timeEnd("drilling down"),this.tiles[Wn]?Ye(this.tiles[Wn],mn):null)};function yi(Ke,sr,vr){return((1<=0?0:Z.button},a.remove=function(Z){Z.parentNode&&Z.parentNode.removeChild(Z)};function _(Z,lt,nt){var wt,Wt,ve,ke=n.browser.devicePixelRatio>1?"@2x":"",Jt=n.getJSON(lt.transformRequest(lt.normalizeSpriteURL(Z,ke,".json"),n.ResourceType.SpriteJSON),function(lr,tr){Jt=null,ve||(ve=lr,wt=tr,De())}),fe=n.getImage(lt.transformRequest(lt.normalizeSpriteURL(Z,ke,".png"),n.ResourceType.SpriteImage),function(lr,tr){fe=null,ve||(ve=lr,Wt=tr,De())});function De(){if(ve)nt(ve);else if(wt&&Wt){var lr=n.browser.getImageData(Wt),tr={};for(var ar in wt){var dr=wt[ar],gr=dr.width,Ge=dr.height,rr=dr.x,Je=dr.y,Hr=dr.sdf,wn=dr.pixelRatio,Ln=dr.stretchX,Ii=dr.stretchY,Mi=dr.content,gi=new n.RGBAImage({width:gr,height:Ge});n.RGBAImage.copy(lr,gi,{x:rr,y:Je},{x:0,y:0},{width:gr,height:Ge}),tr[ar]={data:gi,pixelRatio:wn,sdf:Hr,stretchX:Ln,stretchY:Ii,content:Mi}}nt(null,tr)}}return{cancel:function(){Jt&&(Jt.cancel(),Jt=null),fe&&(fe.cancel(),fe=null)}}}function A(Z){var lt=Z.userImage;if(lt&<.render){var nt=lt.render();if(nt)return Z.data.replace(new Uint8Array(lt.data.buffer)),!0}return!1}var d=1,k=function(Z){function lt(){Z.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new n.RGBAImage({width:1,height:1}),this.dirty=!0}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.isLoaded=function(){return this.loaded},lt.prototype.setLoaded=function(nt){if(this.loaded!==nt&&(this.loaded=nt,nt)){for(var wt=0,Wt=this.requestors;wt=0?1.2:1))}M.prototype.draw=function(Z){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(Z,this.buffer,this.middle);for(var lt=this.ctx.getImageData(0,0,this.size,this.size),nt=new Uint8ClampedArray(this.size*this.size),wt=0;wt65535){De(new Error("glyphs > 65535 not supported"));return}if(ar.ranges[gr]){De(null,{stack:lr,id:tr,glyph:dr});return}var Ge=ar.requests[gr];Ge||(Ge=ar.requests[gr]=[],C.loadGlyphRange(lr,gr,nt.url,nt.requestManager,function(rr,Je){if(Je){for(var Hr in Je)nt._doesCharSupportLocalGlyph(+Hr)||(ar.glyphs[+Hr]=Je[+Hr]);ar.ranges[gr]=!0}for(var wn=0,Ln=Ge;wn1&&(fe=Z[++Jt]);var lr=Math.abs(De-fe.left),tr=Math.abs(De-fe.right),ar=Math.min(lr,tr),dr=void 0,gr=Wt/nt*(wt+1);if(fe.isDash){var Ge=wt-Math.abs(gr);dr=Math.sqrt(ar*ar+Ge*Ge)}else dr=wt-Math.sqrt(ar*ar+gr*gr);this.data[ke+De]=Math.max(0,Math.min(255,dr+128))}},V.prototype.addRegularDash=function(Z){for(var lt=Z.length-1;lt>=0;--lt){var nt=Z[lt],wt=Z[lt+1];nt.zeroLength?Z.splice(lt,1):wt&&wt.isDash===nt.isDash&&(wt.left=nt.left,Z.splice(lt,1))}var Wt=Z[0],ve=Z[Z.length-1];Wt.isDash===ve.isDash&&(Wt.left=ve.left-this.width,ve.right=Wt.right+this.width);for(var ke=this.width*this.nextRow,Jt=0,fe=Z[Jt],De=0;De1&&(fe=Z[++Jt]);var lr=Math.abs(De-fe.left),tr=Math.abs(De-fe.right),ar=Math.min(lr,tr),dr=fe.isDash?ar:-ar;this.data[ke+De]=Math.max(0,Math.min(255,dr+128))}},V.prototype.addDash=function(Z,lt){var nt=lt?7:0,wt=2*nt+1;if(this.nextRow+wt>this.height)return n.warnOnce("LineAtlas out of space"),null;for(var Wt=0,ve=0;ve=nt.minX&&Z.x=nt.minY&&Z.y0&&(De[new n.OverscaledTileID(nt.overscaledZ,ke,wt.z,ve,wt.y-1).key]={backfilled:!1},De[new n.OverscaledTileID(nt.overscaledZ,nt.wrap,wt.z,wt.x,wt.y-1).key]={backfilled:!1},De[new n.OverscaledTileID(nt.overscaledZ,fe,wt.z,Jt,wt.y-1).key]={backfilled:!1}),wt.y+10&&(Wt.resourceTiming=nt._resourceTiming,nt._resourceTiming=[]),nt.fire(new n.Event("data",Wt))})},lt.prototype.onAdd=function(nt){this.map=nt,this.load()},lt.prototype.setData=function(nt){var wt=this;return this._data=nt,this.fire(new n.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Wt){if(Wt){wt.fire(new n.ErrorEvent(Wt));return}var ve={dataType:"source",sourceDataType:"content"};wt._collectResourceTiming&&wt._resourceTiming&&wt._resourceTiming.length>0&&(ve.resourceTiming=wt._resourceTiming,wt._resourceTiming=[]),wt.fire(new n.Event("data",ve))}),this},lt.prototype.getClusterExpansionZoom=function(nt,wt){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:nt,source:this.id},wt),this},lt.prototype.getClusterChildren=function(nt,wt){return this.actor.send("geojson.getClusterChildren",{clusterId:nt,source:this.id},wt),this},lt.prototype.getClusterLeaves=function(nt,wt,Wt,ve){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:nt,limit:wt,offset:Wt},ve),this},lt.prototype._updateWorkerData=function(nt){var wt=this;this._loaded=!1;var Wt=n.extend({},this.workerOptions),ve=this._data;typeof ve=="string"?(Wt.request=this.map._requestManager.transformRequest(n.browser.resolveURL(ve),n.ResourceType.Source),Wt.request.collectResourceTiming=this._collectResourceTiming):Wt.data=JSON.stringify(ve),this.actor.send(this.type+".loadData",Wt,function(ke,Jt){wt._removed||Jt&&Jt.abandoned||(wt._loaded=!0,Jt&&Jt.resourceTiming&&Jt.resourceTiming[wt.id]&&(wt._resourceTiming=Jt.resourceTiming[wt.id].slice(0)),wt.actor.send(wt.type+".coalesce",{source:Wt.source},null),nt(ke))})},lt.prototype.loaded=function(){return this._loaded},lt.prototype.loadTile=function(nt,wt){var Wt=this,ve=nt.actor?"reloadTile":"loadTile";nt.actor=this.actor;var ke={type:this.type,uid:nt.uid,tileID:nt.tileID,zoom:nt.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:n.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};nt.request=this.actor.send(ve,ke,function(Jt,fe){return delete nt.request,nt.unloadVectorData(),nt.aborted?wt(null):Jt?wt(Jt):(nt.loadVectorData(fe,Wt.map.painter,ve==="reloadTile"),wt(null))})},lt.prototype.abortTile=function(nt){nt.request&&(nt.request.cancel(),delete nt.request),nt.aborted=!0},lt.prototype.unloadTile=function(nt){nt.unloadVectorData(),this.actor.send("removeTile",{uid:nt.uid,type:this.type,source:this.id})},lt.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},lt.prototype.serialize=function(){return n.extend({},this._options,{type:this.type,data:this._data})},lt.prototype.hasTransition=function(){return!1},lt}(n.Evented),bt=n.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),vt=function(Z){function lt(nt,wt,Wt,ve){Z.call(this),this.id=nt,this.dispatcher=Wt,this.coordinates=wt.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(ve),this.options=wt}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.load=function(nt,wt){var Wt=this;this._loaded=!1,this.fire(new n.Event("dataloading",{dataType:"source"})),this.url=this.options.url,n.getImage(this.map._requestManager.transformRequest(this.url,n.ResourceType.Image),function(ve,ke){Wt._loaded=!0,ve?Wt.fire(new n.ErrorEvent(ve)):ke&&(Wt.image=ke,nt&&(Wt.coordinates=nt),wt&&wt(),Wt._finishLoading())})},lt.prototype.loaded=function(){return this._loaded},lt.prototype.updateImage=function(nt){var wt=this;return!this.image||!nt.url?this:(this.options.url=nt.url,this.load(nt.coordinates,function(){wt.texture=null}),this)},lt.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"metadata"})))},lt.prototype.onAdd=function(nt){this.map=nt,this.load()},lt.prototype.setCoordinates=function(nt){var wt=this;this.coordinates=nt;var Wt=nt.map(n.MercatorCoordinate.fromLngLat);this.tileID=ut(Wt),this.minzoom=this.maxzoom=this.tileID.z;var ve=Wt.map(function(ke){return wt.tileID.getTilePoint(ke)._round()});return this._boundsArray=new n.StructArrayLayout4i8,this._boundsArray.emplaceBack(ve[0].x,ve[0].y,0,0),this._boundsArray.emplaceBack(ve[1].x,ve[1].y,n.EXTENT,0),this._boundsArray.emplaceBack(ve[3].x,ve[3].y,0,n.EXTENT),this._boundsArray.emplaceBack(ve[2].x,ve[2].y,n.EXTENT,n.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"content"})),this},lt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var nt=this.map.painter.context,wt=nt.gl;this.boundsBuffer||(this.boundsBuffer=nt.createVertexBuffer(this._boundsArray,bt.members)),this.boundsSegments||(this.boundsSegments=n.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new n.Texture(nt,this.image,wt.RGBA),this.texture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE));for(var Wt in this.tiles){var ve=this.tiles[Wt];ve.state!=="loaded"&&(ve.state="loaded",ve.texture=this.texture)}}},lt.prototype.loadTile=function(nt,wt){this.tileID&&this.tileID.equals(nt.tileID.canonical)?(this.tiles[String(nt.tileID.wrap)]=nt,nt.buckets={},wt(null)):(nt.state="errored",wt(null))},lt.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},lt.prototype.hasTransition=function(){return!1},lt}(n.Evented);function ut(Z){for(var lt=1/0,nt=1/0,wt=-1/0,Wt=-1/0,ve=0,ke=Z;vewt.end(0)?this.fire(new n.ErrorEvent(new n.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+wt.start(0)+" and "+wt.end(0)+"-second mark."))):this.video.currentTime=nt}},lt.prototype.getVideo=function(){return this.video},lt.prototype.onAdd=function(nt){this.map||(this.map=nt,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},lt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var nt=this.map.painter.context,wt=nt.gl;this.boundsBuffer||(this.boundsBuffer=nt.createVertexBuffer(this._boundsArray,bt.members)),this.boundsSegments||(this.boundsSegments=n.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE),wt.texSubImage2D(wt.TEXTURE_2D,0,0,0,wt.RGBA,wt.UNSIGNED_BYTE,this.video)):(this.texture=new n.Texture(nt,this.video,wt.RGBA),this.texture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE));for(var Wt in this.tiles){var ve=this.tiles[Wt];ve.state!=="loaded"&&(ve.state="loaded",ve.texture=this.texture)}}},lt.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},lt.prototype.hasTransition=function(){return this.video&&!this.video.paused},lt}(vt),gt=function(Z){function lt(nt,wt,Wt,ve){Z.call(this,nt,wt,Wt,ve),wt.coordinates?(!Array.isArray(wt.coordinates)||wt.coordinates.length!==4||wt.coordinates.some(function(ke){return!Array.isArray(ke)||ke.length!==2||ke.some(function(Jt){return typeof Jt!="number"})}))&&this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,null,'missing required property "coordinates"'))),wt.animate&&typeof wt.animate!="boolean"&&this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,null,'optional "animate" property must be a boolean value'))),wt.canvas?typeof wt.canvas!="string"&&!(wt.canvas instanceof n.window.HTMLCanvasElement)&&this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,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 n.ErrorEvent(new n.ValidationError("sources."+nt,null,'missing required property "canvas"'))),this.options=wt,this.animate=wt.animate!==void 0?wt.animate:!0}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof n.window.HTMLCanvasElement?this.options.canvas:n.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new n.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},lt.prototype.getCanvas=function(){return this.canvas},lt.prototype.onAdd=function(nt){this.map=nt,this.load(),this.canvas&&this.animate&&this.play()},lt.prototype.onRemove=function(){this.pause()},lt.prototype.prepare=function(){var nt=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,nt=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,nt=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var wt=this.map.painter.context,Wt=wt.gl;this.boundsBuffer||(this.boundsBuffer=wt.createVertexBuffer(this._boundsArray,bt.members)),this.boundsSegments||(this.boundsSegments=n.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(nt||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new n.Texture(wt,this.canvas,Wt.RGBA,{premultiply:!0});for(var ve in this.tiles){var ke=this.tiles[ve];ke.state!=="loaded"&&(ke.state="loaded",ke.texture=this.texture)}}},lt.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},lt.prototype.hasTransition=function(){return this._playing},lt.prototype._hasInvalidDimensions=function(){for(var nt=0,wt=[this.canvas.width,this.canvas.height];ntthis.max){var ke=this._getAndRemoveByKey(this.order[0]);ke&&this.onRemove(ke)}return this},Gt.prototype.has=function(Z){return Z.wrapped().key in this.data},Gt.prototype.getAndRemove=function(Z){return this.has(Z)?this._getAndRemoveByKey(Z.wrapped().key):null},Gt.prototype._getAndRemoveByKey=function(Z){var lt=this.data[Z].shift();return lt.timeout&&clearTimeout(lt.timeout),this.data[Z].length===0&&delete this.data[Z],this.order.splice(this.order.indexOf(Z),1),lt.value},Gt.prototype.getByKey=function(Z){var lt=this.data[Z];return lt?lt[0].value:null},Gt.prototype.get=function(Z){if(!this.has(Z))return null;var lt=this.data[Z.wrapped().key][0];return lt.value},Gt.prototype.remove=function(Z,lt){if(!this.has(Z))return this;var nt=Z.wrapped().key,wt=lt===void 0?0:this.data[nt].indexOf(lt),Wt=this.data[nt][wt];return this.data[nt].splice(wt,1),Wt.timeout&&clearTimeout(Wt.timeout),this.data[nt].length===0&&delete this.data[nt],this.onRemove(Wt.value),this.order.splice(this.order.indexOf(nt),1),this},Gt.prototype.setMaxSize=function(Z){for(this.max=Z;this.order.length>this.max;){var lt=this._getAndRemoveByKey(this.order[0]);lt&&this.onRemove(lt)}return this},Gt.prototype.filter=function(Z){var lt=[];for(var nt in this.data)for(var wt=0,Wt=this.data[nt];wt1||(Math.abs(lr)>1&&(Math.abs(lr+ar)===1?lr+=ar:Math.abs(lr-ar)===1&&(lr-=ar)),!(!De.dem||!fe.dem)&&(fe.dem.backfillBorder(De.dem,lr,tr),fe.neighboringTiles&&fe.neighboringTiles[dr]&&(fe.neighboringTiles[dr].backfilled=!0)))}},lt.prototype.getTile=function(nt){return this.getTileByID(nt.key)},lt.prototype.getTileByID=function(nt){return this._tiles[nt]},lt.prototype._retainLoadedChildren=function(nt,wt,Wt,ve){for(var ke in this._tiles){var Jt=this._tiles[ke];if(!(ve[ke]||!Jt.hasData()||Jt.tileID.overscaledZ<=wt||Jt.tileID.overscaledZ>Wt)){for(var fe=Jt.tileID;Jt&&Jt.tileID.overscaledZ>wt+1;){var De=Jt.tileID.scaledTo(Jt.tileID.overscaledZ-1);Jt=this._tiles[De.key],Jt&&Jt.hasData()&&(fe=De)}for(var lr=fe;lr.overscaledZ>wt;)if(lr=lr.scaledTo(lr.overscaledZ-1),nt[lr.key]){ve[fe.key]=fe;break}}}},lt.prototype.findLoadedParent=function(nt,wt){if(nt.key in this._loadedParentTiles){var Wt=this._loadedParentTiles[nt.key];return Wt&&Wt.tileID.overscaledZ>=wt?Wt:null}for(var ve=nt.overscaledZ-1;ve>=wt;ve--){var ke=nt.scaledTo(ve),Jt=this._getLoadedTile(ke);if(Jt)return Jt}},lt.prototype._getLoadedTile=function(nt){var wt=this._tiles[nt.key];if(wt&&wt.hasData())return wt;var Wt=this._cache.getByKey(nt.wrapped().key);return Wt},lt.prototype.updateCacheSize=function(nt){var wt=Math.ceil(nt.width/this._source.tileSize)+1,Wt=Math.ceil(nt.height/this._source.tileSize)+1,ve=wt*Wt,ke=5,Jt=Math.floor(ve*ke),fe=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Jt):Jt;this._cache.setMaxSize(fe)},lt.prototype.handleWrapJump=function(nt){var wt=this._prevLng===void 0?nt:this._prevLng,Wt=nt-wt,ve=Wt/360,ke=Math.round(ve);if(this._prevLng=nt,ke){var Jt={};for(var fe in this._tiles){var De=this._tiles[fe];De.tileID=De.tileID.unwrapTo(De.tileID.wrap+ke),Jt[De.tileID.key]=De}this._tiles=Jt;for(var lr in this._timers)clearTimeout(this._timers[lr]),delete this._timers[lr];for(var tr in this._tiles){var ar=this._tiles[tr];this._setTileReloadTimer(tr,ar)}}},lt.prototype.update=function(nt){var wt=this;if(this.transform=nt,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(nt),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Wt;this.used?this._source.tileID?Wt=nt.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Di){return new n.OverscaledTileID(Di.canonical.z,Di.wrap,Di.canonical.z,Di.canonical.x,Di.canonical.y)}):(Wt=nt.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Wt=Wt.filter(function(Di){return wt._source.hasTile(Di)}))):Wt=[];var ve=nt.coveringZoomLevel(this._source),ke=Math.max(ve-lt.maxOverzooming,this._source.minzoom),Jt=Math.max(ve+lt.maxUnderzooming,this._source.minzoom),fe=this._updateRetainedTiles(Wt,ve);if(Li(this._source.type)){for(var De={},lr={},tr=Object.keys(fe),ar=0,dr=tr;arthis._source.maxzoom){var Je=Ge.children(this._source.maxzoom)[0],Hr=this.getTile(Je);if(Hr&&Hr.hasData()){Wt[Je.key]=Je;continue}}else{var wn=Ge.children(this._source.maxzoom);if(Wt[wn[0].key]&&Wt[wn[1].key]&&Wt[wn[2].key]&&Wt[wn[3].key])continue}for(var Ln=rr.wasRequested(),Ii=Ge.overscaledZ-1;Ii>=ke;--Ii){var Mi=Ge.scaledTo(Ii);if(ve[Mi.key]||(ve[Mi.key]=!0,rr=this.getTile(Mi),!rr&&Ln&&(rr=this._addTile(Mi)),rr&&(Wt[Mi.key]=Mi,Ln=rr.wasRequested(),rr.hasData())))break}}}return Wt},lt.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var nt in this._tiles){for(var wt=[],Wt=void 0,ve=this._tiles[nt].tileID;ve.overscaledZ>0;){if(ve.key in this._loadedParentTiles){Wt=this._loadedParentTiles[ve.key];break}wt.push(ve.key);var ke=ve.scaledTo(ve.overscaledZ-1);if(Wt=this._getLoadedTile(ke),Wt)break;ve=ke}for(var Jt=0,fe=wt;Jt0)&&(wt.hasData()&&wt.state!=="reloading"?this._cache.add(wt.tileID,wt,wt.getExpiryTimeout()):(wt.aborted=!0,this._abortTile(wt),this._unloadTile(wt))))},lt.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var nt in this._tiles)this._removeTile(nt);this._cache.reset()},lt.prototype.tilesIn=function(nt,wt,Wt){var ve=this,ke=[],Jt=this.transform;if(!Jt)return ke;for(var fe=Wt?Jt.getCameraQueryGeometry(nt):nt,De=nt.map(function(Ii){return Jt.pointCoordinate(Ii)}),lr=fe.map(function(Ii){return Jt.pointCoordinate(Ii)}),tr=this.getIds(),ar=1/0,dr=1/0,gr=-1/0,Ge=-1/0,rr=0,Je=lr;rr=0&&da[1].y+Di>=0){var Hi=De.map(function(wa){return gi.getTilePoint(wa)}),Wi=lr.map(function(wa){return gi.getTilePoint(wa)});ke.push({tile:Mi,tileID:gi,queryGeometry:Hi,cameraQueryGeometry:Wi,scale:Vi})}}},Ln=0;Ln=n.browser.now())return!0}return!1},lt.prototype.setFeatureState=function(nt,wt,Wt){nt=nt||"_geojsonTileLayer",this._state.updateState(nt,wt,Wt)},lt.prototype.removeFeatureState=function(nt,wt,Wt){nt=nt||"_geojsonTileLayer",this._state.removeFeatureState(nt,wt,Wt)},lt.prototype.getFeatureState=function(nt,wt){return nt=nt||"_geojsonTileLayer",this._state.getState(nt,wt)},lt.prototype.setDependencies=function(nt,wt,Wt){var ve=this._tiles[nt];ve&&ve.setDependencies(wt,Wt)},lt.prototype.reloadTilesForDependencies=function(nt,wt){for(var Wt in this._tiles){var ve=this._tiles[Wt];ve.hasDependency(nt,wt)&&this._reloadTile(Wt,"reloading")}this._cache.filter(function(ke){return!ke.hasDependency(nt,wt)})},lt}(n.Evented);Un.maxOverzooming=10,Un.maxUnderzooming=3;function Wn(Z,lt){var nt=Math.abs(Z.wrap*2)-+(Z.wrap<0),wt=Math.abs(lt.wrap*2)-+(lt.wrap<0);return Z.overscaledZ-lt.overscaledZ||wt-nt||lt.canonical.y-Z.canonical.y||lt.canonical.x-Z.canonical.x}function Li(Z){return Z==="raster"||Z==="image"||Z==="video"}function Fi(){return new n.window.Worker(Pl.workerUrl)}var Zi="mapboxgl_preloaded_worker_pool",Ji=function(){this.active={}};Ji.prototype.acquire=function(Z){if(!this.workers)for(this.workers=[];this.workers.length0?(wt-ve)/ke:0;return this.points[Wt].mult(1-Jt).add(this.points[lt].mult(Jt))};var Gn=function(Z,lt,nt){var wt=this.boxCells=[],Wt=this.circleCells=[];this.xCellCount=Math.ceil(Z/nt),this.yCellCount=Math.ceil(lt/nt);for(var ve=0;vethis.width||wt<0||lt>this.height)return Wt?!1:[];var ke=[];if(Z<=0&<<=0&&this.width<=nt&&this.height<=wt){if(Wt)return!0;for(var Jt=0;Jt0:ke}},Gn.prototype._queryCircle=function(Z,lt,nt,wt,Wt){var ve=Z-nt,ke=Z+nt,Jt=lt-nt,fe=lt+nt;if(ke<0||ve>this.width||fe<0||Jt>this.height)return wt?!1:[];var De=[],lr={hitTest:wt,circle:{x:Z,y:lt,radius:nt},seenUids:{box:{},circle:{}}};return this._forEachCell(ve,Jt,ke,fe,this._queryCellCircle,De,lr,Wt),wt?De.length>0:De},Gn.prototype.query=function(Z,lt,nt,wt,Wt){return this._query(Z,lt,nt,wt,!1,Wt)},Gn.prototype.hitTest=function(Z,lt,nt,wt,Wt){return this._query(Z,lt,nt,wt,!0,Wt)},Gn.prototype.hitTestCircle=function(Z,lt,nt,wt){return this._queryCircle(Z,lt,nt,!0,wt)},Gn.prototype._queryCell=function(Z,lt,nt,wt,Wt,ve,ke,Jt){var fe=ke.seenUids,De=this.boxCells[Wt];if(De!==null)for(var lr=this.bboxes,tr=0,ar=De;tr=lr[gr+0]&&wt>=lr[gr+1]&&(!Jt||Jt(this.boxKeys[dr]))){if(ke.hitTest)return ve.push(!0),!0;ve.push({key:this.boxKeys[dr],x1:lr[gr],y1:lr[gr+1],x2:lr[gr+2],y2:lr[gr+3]})}}}var Ge=this.circleCells[Wt];if(Ge!==null)for(var rr=this.circles,Je=0,Hr=Ge;Jeke*ke+Jt*Jt},Gn.prototype._circleAndRectCollide=function(Z,lt,nt,wt,Wt,ve,ke){var Jt=(ve-wt)/2,fe=Math.abs(Z-(wt+Jt));if(fe>Jt+nt)return!1;var De=(ke-Wt)/2,lr=Math.abs(lt-(Wt+De));if(lr>De+nt)return!1;if(fe<=Jt||lr<=De)return!0;var tr=fe-Jt,ar=lr-De;return tr*tr+ar*ar<=nt*nt};function pi(Z,lt,nt,wt,Wt){var ve=n.create();return lt?(n.scale(ve,ve,[1/Wt,1/Wt,1]),nt||n.rotateZ(ve,ve,wt.angle)):n.multiply(ve,wt.labelPlaneMatrix,Z),ve}function Va(Z,lt,nt,wt,Wt){if(lt){var ve=n.clone(Z);return n.scale(ve,ve,[Wt,Wt,1]),nt||n.rotateZ(ve,ve,-wt.angle),ve}else return wt.glCoordMatrix}function ea(Z,lt){var nt=[Z.x,Z.y,0,1];ol(nt,nt,lt);var wt=nt[3];return{point:new n.Point(nt[0]/wt,nt[1]/wt),signedDistanceFromCamera:wt}}function go(Z,lt){return .5+.5*(Z/lt)}function mo(Z,lt){var nt=Z[0]/Z[3],wt=Z[1]/Z[3],Wt=nt>=-lt[0]&&nt<=lt[0]&&wt>=-lt[1]&&wt<=lt[1];return Wt}function Go(Z,lt,nt,wt,Wt,ve,ke,Jt){var fe=wt?Z.textSizeData:Z.iconSizeData,De=n.evaluateSizeForZoom(fe,nt.transform.zoom),lr=[256/nt.width*2+1,256/nt.height*2+1],tr=wt?Z.text.dynamicLayoutVertexArray:Z.icon.dynamicLayoutVertexArray;tr.clear();for(var ar=Z.lineVertexArray,dr=wt?Z.text.placedSymbolArray:Z.icon.placedSymbolArray,gr=nt.transform.width/nt.transform.height,Ge=!1,rr=0;rrve)return{useVertical:!0}}return(Z===n.WritingMode.vertical?lt.ynt.x)?{needsFlipping:!0}:null}function Ka(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De,lr,tr,ar,dr){var gr=lt/24,Ge=Z.lineOffsetX*gr,rr=Z.lineOffsetY*gr,Je;if(Z.numGlyphs>1){var Hr=Z.glyphStartIndex+Z.numGlyphs,wn=Z.lineStartIndex,Ln=Z.lineStartIndex+Z.lineLength,Ii=Lo(gr,Jt,Ge,rr,nt,lr,tr,Z,fe,ve,ar);if(!Ii)return{notEnoughRoom:!0};var Mi=ea(Ii.first.point,ke).point,gi=ea(Ii.last.point,ke).point;if(wt&&!nt){var Vi=Zo(Z.writingMode,Mi,gi,dr);if(Vi)return Vi}Je=[Ii.first];for(var Di=Z.glyphStartIndex+1;Di0?wa.point:Cs(tr,Wi,da,1,Wt),So=Zo(Z.writingMode,da,vo,dr);if(So)return So}var ns=ps(gr*Jt.getoffsetX(Z.glyphStartIndex),Ge,rr,nt,lr,tr,Z.segment,Z.lineStartIndex,Z.lineStartIndex+Z.lineLength,fe,ve,ar);if(!ns)return{notEnoughRoom:!0};Je=[ns]}for(var As=0,Wl=Je;As0?1:-1,gr=0;wt&&(dr*=-1,gr=Math.PI),dr<0&&(gr+=Math.PI);for(var Ge=dr>0?Jt+ke:Jt+ke+1,rr=Wt,Je=Wt,Hr=0,wn=0,Ln=Math.abs(ar),Ii=[];Hr+wn<=Ln;){if(Ge+=dr,Ge=fe)return null;if(Je=rr,Ii.push(rr),rr=tr[Ge],rr===void 0){var Mi=new n.Point(De.getx(Ge),De.gety(Ge)),gi=ea(Mi,lr);if(gi.signedDistanceFromCamera>0)rr=tr[Ge]=gi.point;else{var Vi=Ge-dr,Di=Hr===0?ve:new n.Point(De.getx(Vi),De.gety(Vi));rr=Cs(Di,Mi,Je,Ln-Hr+1,lr)}}Hr+=wn,wn=Je.dist(rr)}var da=(Ln-Hr)/wn,Hi=rr.sub(Je),Wi=Hi.mult(da)._add(Je);Wi._add(Hi._unit()._perp()._mult(nt*dr));var wa=gr+Math.atan2(rr.y-Je.y,rr.x-Je.x);return Ii.push(Wi),{point:Wi,angle:wa,path:Ii}}var wl=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function is(Z,lt){for(var nt=0;nt=1;Wl--)As.push(So.path[Wl]);for(var Jl=1;Jl0){for(var qs=As[0].clone(),Bc=As[0].clone(),md=1;md=Wi.x&&Bc.x<=wa.x&&qs.y>=Wi.y&&Bc.y<=wa.y?Pu=[As]:Bc.xwa.x||Bc.ywa.y?Pu=[]:Pu=n.clipLine([As],Wi.x,Wi.y,wa.x,wa.y)}for(var Vd=0,M0=Pu;Vd=this.screenRightBoundary||wtthis.screenBottomBoundary},kl.prototype.isInsideGrid=function(Z,lt,nt,wt){return nt>=0&&Z=0&<0){var wn;return this.prevPlacement&&this.prevPlacement.variableOffsets[tr.crossTileID]&&this.prevPlacement.placements[tr.crossTileID]&&this.prevPlacement.placements[tr.crossTileID].text&&(wn=this.prevPlacement.variableOffsets[tr.crossTileID].anchor),this.variableOffsets[tr.crossTileID]={textOffset:Ge,width:nt,height:wt,anchor:Z,textBoxScale:Wt,prevAnchor:wn},this.markUsedJustification(ar,Z,tr,dr),ar.allowVerticalPlacement&&(this.markUsedOrientation(ar,dr,tr),this.placedOrientations[tr.crossTileID]=dr),{shift:rr,placedGlyphBoxes:Je}}},Xs.prototype.placeLayerBucketPart=function(Z,lt,nt){var wt=this,Wt=Z.parameters,ve=Wt.bucket,ke=Wt.layout,Jt=Wt.posMatrix,fe=Wt.textLabelPlaneMatrix,De=Wt.labelToScreenMatrix,lr=Wt.textPixelRatio,tr=Wt.holdingForFade,ar=Wt.collisionBoxArray,dr=Wt.partiallyEvaluatedTextSize,gr=Wt.collisionGroup,Ge=ke.get("text-optional"),rr=ke.get("icon-optional"),Je=ke.get("text-allow-overlap"),Hr=ke.get("icon-allow-overlap"),wn=ke.get("text-rotation-alignment")==="map",Ln=ke.get("text-pitch-alignment")==="map",Ii=ke.get("icon-text-fit")!=="none",Mi=ke.get("symbol-z-order")==="viewport-y",gi=Je&&(Hr||!ve.hasIconData()||rr),Vi=Hr&&(Je||!ve.hasTextData()||Ge);!ve.collisionArrays&&ar&&ve.deserializeCollisionBoxes(ar);var Di=function(So,ns){if(!lt[So.crossTileID]){if(tr){wt.placements[So.crossTileID]=new Ns(!1,!1,!1);return}var As=!1,Wl=!1,Jl=!0,Al=null,Ql={box:null,offscreen:null},Pu={box:null,offscreen:null},qs=null,Bc=null,md=null,Vd=0,M0=0,gm=0;ns.textFeatureIndex?Vd=ns.textFeatureIndex:So.useRuntimeCollisionCircles&&(Vd=So.featureIndex),ns.verticalTextFeatureIndex&&(M0=ns.verticalTextFeatureIndex);var u0=ns.textBox;if(u0){var h0=function(gd){var zf=n.WritingMode.horizontal;if(ve.allowVerticalPlacement&&!gd&&wt.prevPlacement){var Iu=wt.prevPlacement.placedOrientations[So.crossTileID];Iu&&(wt.placedOrientations[So.crossTileID]=Iu,zf=Iu,wt.markUsedOrientation(ve,zf,So))}return zf},zm=function(gd,zf){if(ve.allowVerticalPlacement&&So.numVerticalGlyphVertices>0&&ns.verticalTextBox)for(var Iu=0,a1=ve.writingModes;Iu0&&(Mp=Mp.filter(function(gd){return gd!==d0.anchor}),Mp.unshift(d0.anchor))}var mp=function(gd,zf,Iu){for(var a1=gd.x2-gd.x1,yy=gd.y2-gd.y1,Bb=So.textBoxScale,Wu=Ii&&!Hr?zf:null,Og={box:[],offscreen:!1},Rb=Je?Mp.length*2:Mp.length,o1=0;o1=Mp.length,_y=wt.attemptAnchorPlacement(Bm,gd,a1,yy,Bb,wn,Ln,lr,Jt,gr,Jw,So,ve,Iu,Wu);if(_y&&(Og=_y.placedGlyphBoxes,Og&&Og.box&&Og.box.length)){As=!0,Al=_y.shift;break}}return Og},rg=function(){return mp(u0,ns.iconBox,n.WritingMode.horizontal)},ev=function(){var gd=ns.verticalTextBox,zf=Ql&&Ql.box&&Ql.box.length;return ve.allowVerticalPlacement&&!zf&&So.numVerticalGlyphVertices>0&&gd?mp(gd,ns.verticalIconBox,n.WritingMode.vertical):{box:null,offscreen:null}};zm(rg,ev),Ql&&(As=Ql.box,Jl=Ql.offscreen);var f0=h0(Ql&&Ql.box);if(!As&&wt.prevPlacement){var p0=wt.prevPlacement.variableOffsets[So.crossTileID];p0&&(wt.variableOffsets[So.crossTileID]=p0,wt.markUsedJustification(ve,p0.anchor,So,f0))}}else{var Ep=function(gd,zf){var Iu=wt.collisionIndex.placeCollisionBox(gd,Je,lr,Jt,gr.predicate);return Iu&&Iu.box&&Iu.box.length&&(wt.markUsedOrientation(ve,zf,So),wt.placedOrientations[So.crossTileID]=zf),Iu},rv=function(){return Ep(u0,n.WritingMode.horizontal)},r1=function(){var gd=ns.verticalTextBox;return ve.allowVerticalPlacement&&So.numVerticalGlyphVertices>0&&gd?Ep(gd,n.WritingMode.vertical):{box:null,offscreen:null}};zm(rv,r1),h0(Ql&&Ql.box&&Ql.box.length)}}if(qs=Ql,As=qs&&qs.box&&qs.box.length>0,Jl=qs&&qs.offscreen,So.useRuntimeCollisionCircles){var nv=ve.text.placedSymbolArray.get(So.centerJustifiedTextSymbolIndex),If=n.evaluateSizeForFeature(ve.textSizeData,dr,nv),zg=ke.get("text-padding"),n1=So.collisionCircleDiameter;Bc=wt.collisionIndex.placeCollisionCircles(Je,nv,ve.lineVertexArray,ve.glyphOffsetArray,If,Jt,fe,De,nt,Ln,gr.predicate,n1,zg),As=Je||Bc.circles.length>0&&!Bc.collisionDetected,Jl=Jl&&Bc.offscreen}if(ns.iconFeatureIndex&&(gm=ns.iconFeatureIndex),ns.iconBox){var Df=function(gd){var zf=Ii&&Al?sc(gd,Al.x,Al.y,wn,Ln,wt.transform.angle):gd;return wt.collisionIndex.placeCollisionBox(zf,Hr,lr,Jt,gr.predicate)};Pu&&Pu.box&&Pu.box.length&&ns.verticalIconBox?(md=Df(ns.verticalIconBox),Wl=md.box.length>0):(md=Df(ns.iconBox),Wl=md.box.length>0),Jl=Jl&&md.offscreen}var iv=Ge||So.numHorizontalGlyphVertices===0&&So.numVerticalGlyphVertices===0,gy=rr||So.numIconVertices===0;if(!iv&&!gy?Wl=As=Wl&&As:gy?iv||(Wl=Wl&&As):As=Wl&&As,As&&qs&&qs.box&&(Pu&&Pu.box&&M0?wt.collisionIndex.insertCollisionBox(qs.box,ke.get("text-ignore-placement"),ve.bucketInstanceId,M0,gr.ID):wt.collisionIndex.insertCollisionBox(qs.box,ke.get("text-ignore-placement"),ve.bucketInstanceId,Vd,gr.ID)),Wl&&md&&wt.collisionIndex.insertCollisionBox(md.box,ke.get("icon-ignore-placement"),ve.bucketInstanceId,gm,gr.ID),Bc&&(As&&wt.collisionIndex.insertCollisionCircles(Bc.circles,ke.get("text-ignore-placement"),ve.bucketInstanceId,Vd,gr.ID),nt)){var vy=ve.bucketInstanceId,Om=wt.collisionCircleArrays[vy];Om===void 0&&(Om=wt.collisionCircleArrays[vy]=new Uo);for(var i1=0;i1=0;--Hi){var Wi=da[Hi];Di(ve.symbolInstances.get(Wi),ve.collisionArrays[Wi])}else for(var wa=Z.symbolInstanceStart;wa=0&&(ve>=0&&De!==ve?Z.text.placedSymbolArray.get(De).crossTileID=0:Z.text.placedSymbolArray.get(De).crossTileID=nt.crossTileID)}},Xs.prototype.markUsedOrientation=function(Z,lt,nt){for(var wt=lt===n.WritingMode.horizontal||lt===n.WritingMode.horizontalOnly?lt:0,Wt=lt===n.WritingMode.vertical?lt:0,ve=[nt.leftJustifiedTextSymbolIndex,nt.centerJustifiedTextSymbolIndex,nt.rightJustifiedTextSymbolIndex],ke=0,Jt=ve;ke0||Ln>0,Di=Hr.numIconVertices>0,da=wt.placedOrientations[Hr.crossTileID],Hi=da===n.WritingMode.vertical,Wi=da===n.WritingMode.horizontal||da===n.WritingMode.horizontalOnly;if(Vi){var wa=Gc(gi.text),vo=Hi?ko:wa;dr(Z.text,wn,vo);var So=Wi?ko:wa;dr(Z.text,Ln,So);var ns=gi.text.isHidden();[Hr.rightJustifiedTextSymbolIndex,Hr.centerJustifiedTextSymbolIndex,Hr.leftJustifiedTextSymbolIndex].forEach(function(gm){gm>=0&&(Z.text.placedSymbolArray.get(gm).hidden=ns||Hi?1:0)}),Hr.verticalPlacedTextSymbolIndex>=0&&(Z.text.placedSymbolArray.get(Hr.verticalPlacedTextSymbolIndex).hidden=ns||Wi?1:0);var As=wt.variableOffsets[Hr.crossTileID];As&&wt.markUsedJustification(Z,As.anchor,Hr,da);var Wl=wt.placedOrientations[Hr.crossTileID];Wl&&(wt.markUsedJustification(Z,"left",Hr,Wl),wt.markUsedOrientation(Z,Wl,Hr))}if(Di){var Jl=Gc(gi.icon),Al=!(tr&&Hr.verticalPlacedIconSymbolIndex&&Hi);if(Hr.placedIconSymbolIndex>=0){var Ql=Al?Jl:ko;dr(Z.icon,Hr.numIconVertices,Ql),Z.icon.placedSymbolArray.get(Hr.placedIconSymbolIndex).hidden=gi.icon.isHidden()}if(Hr.verticalPlacedIconSymbolIndex>=0){var Pu=Al?ko:Jl;dr(Z.icon,Hr.numVerticalIconVertices,Pu),Z.icon.placedSymbolArray.get(Hr.verticalPlacedIconSymbolIndex).hidden=gi.icon.isHidden()}}if(Z.hasIconCollisionBoxData()||Z.hasTextCollisionBoxData()){var qs=Z.collisionArrays[Je];if(qs){var Bc=new n.Point(0,0);if(qs.textBox||qs.verticalTextBox){var md=!0;if(fe){var Vd=wt.variableOffsets[Ii];Vd?(Bc=tc(Vd.anchor,Vd.width,Vd.height,Vd.textOffset,Vd.textBoxScale),De&&Bc._rotate(lr?wt.transform.angle:-wt.transform.angle)):md=!1}qs.textBox&&Wa(Z.textCollisionBox.collisionVertexArray,gi.text.placed,!md||Hi,Bc.x,Bc.y),qs.verticalTextBox&&Wa(Z.textCollisionBox.collisionVertexArray,gi.text.placed,!md||Wi,Bc.x,Bc.y)}var M0=!!(!Wi&&qs.verticalIconBox);qs.iconBox&&Wa(Z.iconCollisionBox.collisionVertexArray,gi.icon.placed,M0,tr?Bc.x:0,tr?Bc.y:0),qs.verticalIconBox&&Wa(Z.iconCollisionBox.collisionVertexArray,gi.icon.placed,!M0,tr?Bc.x:0,tr?Bc.y:0)}}},Ge=0;GeZ},Xs.prototype.setStale=function(){this.stale=!0};function Wa(Z,lt,nt,wt,Wt){Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0),Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0),Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0),Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0)}var Co=Math.pow(2,25),el=Math.pow(2,24),lc=Math.pow(2,17),ss=Math.pow(2,16),nc=Math.pow(2,9),yl=Math.pow(2,8),$l=Math.pow(2,1);function Gc(Z){if(Z.opacity===0&&!Z.placed)return 0;if(Z.opacity===1&&Z.placed)return 4294967295;var lt=Z.placed?1:0,nt=Math.floor(Z.opacity*127);return nt*Co+lt*el+nt*lc+lt*ss+nt*nc+lt*yl+nt*$l+lt}var ko=0,zs=function(Z){this._sortAcrossTiles=Z.layout.get("symbol-z-order")!=="viewport-y"&&Z.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};zs.prototype.continuePlacement=function(Z,lt,nt,wt,Wt){for(var ve=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var ke=Z[this._currentPlacementIndex],Jt=lt[ke],fe=this.placement.collisionIndex.transform.zoom;if(Jt.type==="symbol"&&(!Jt.minzoom||Jt.minzoom<=fe)&&(!Jt.maxzoom||Jt.maxzoom>fe)){this._inProgressLayer||(this._inProgressLayer=new zs(Jt));var De=this._inProgressLayer.continuePlacement(nt[Jt.source],this.placement,this._showCollisionBoxes,Jt,ve);if(De)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},js.prototype.commit=function(Z){return this.placement.commit(Z),this.placement};var mc=512/n.EXTENT/2,Tl=function(Z,lt,nt){this.tileID=Z,this.indexedSymbolInstances={},this.bucketInstanceId=nt;for(var wt=0;wtZ.overscaledZ)for(var fe in Jt){var De=Jt[fe];De.tileID.isChildOf(Z)&&De.findMatches(lt.symbolInstances,Z,ve)}else{var lr=Z.scaledTo(Number(ke)),tr=Jt[lr.key];tr&&tr.findMatches(lt.symbolInstances,Z,ve)}}for(var ar=0;ar0)throw new Error("Unimplemented: "+ve.map(function(ke){return ke.command}).join(", ")+".");return Wt.forEach(function(ke){ke.command!=="setTransition"&&wt[ke.command].apply(wt,ke.args)}),this.stylesheet=nt,!0},lt.prototype.addImage=function(nt,wt){if(this.getImage(nt))return this.fire(new n.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(nt,wt),this._afterImageUpdated(nt)},lt.prototype.updateImage=function(nt,wt){this.imageManager.updateImage(nt,wt)},lt.prototype.getImage=function(nt){return this.imageManager.getImage(nt)},lt.prototype.removeImage=function(nt){if(!this.getImage(nt))return this.fire(new n.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(nt),this._afterImageUpdated(nt)},lt.prototype._afterImageUpdated=function(nt){this._availableImages=this.imageManager.listImages(),this._changedImages[nt]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new n.Event("data",{dataType:"style"}))},lt.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},lt.prototype.addSource=function(nt,wt,Wt){var ve=this;if(Wt===void 0&&(Wt={}),this._checkLoaded(),this.sourceCaches[nt]!==void 0)throw new Error("There is already a source with this ID");if(!wt.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(wt).join(", ")+".");var ke=["vector","raster","geojson","video","image"],Jt=ke.indexOf(wt.type)>=0;if(!(Jt&&this._validate(n.validateStyle.source,"sources."+nt,wt,null,Wt))){this.map&&this.map._collectResourceTiming&&(wt.collectResourceTiming=!0);var fe=this.sourceCaches[nt]=new Un(nt,wt,this.dispatcher);fe.style=this,fe.setEventedParent(this,function(){return{isSourceLoaded:ve.loaded(),source:fe.serialize(),sourceId:nt}}),fe.onAdd(this.map),this._changed=!0}},lt.prototype.removeSource=function(nt){if(this._checkLoaded(),this.sourceCaches[nt]===void 0)throw new Error("There is no source with this ID");for(var wt in this._layers)if(this._layers[wt].source===nt)return this.fire(new n.ErrorEvent(new Error('Source "'+nt+'" cannot be removed while layer "'+wt+'" is using it.')));var Wt=this.sourceCaches[nt];delete this.sourceCaches[nt],delete this._updatedSources[nt],Wt.fire(new n.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:nt})),Wt.setEventedParent(null),Wt.clearTiles(),Wt.onRemove&&Wt.onRemove(this.map),this._changed=!0},lt.prototype.setGeoJSONSourceData=function(nt,wt){this._checkLoaded();var Wt=this.sourceCaches[nt].getSource();Wt.setData(wt),this._changed=!0},lt.prototype.getSource=function(nt){return this.sourceCaches[nt]&&this.sourceCaches[nt].getSource()},lt.prototype.addLayer=function(nt,wt,Wt){Wt===void 0&&(Wt={}),this._checkLoaded();var ve=nt.id;if(this.getLayer(ve)){this.fire(new n.ErrorEvent(new Error('Layer with id "'+ve+'" already exists on this map')));return}var ke;if(nt.type==="custom"){if(Dl(this,n.validateCustomStyleLayer(nt)))return;ke=n.createStyleLayer(nt)}else{if(typeof nt.source=="object"&&(this.addSource(ve,nt.source),nt=n.clone$1(nt),nt=n.extend(nt,{source:ve})),this._validate(n.validateStyle.layer,"layers."+ve,nt,{arrayIndex:-1},Wt))return;ke=n.createStyleLayer(nt),this._validateLayer(ke),ke.setEventedParent(this,{layer:{id:ve}}),this._serializedLayers[ke.id]=ke.serialize()}var Jt=wt?this._order.indexOf(wt):this._order.length;if(wt&&Jt===-1){this.fire(new n.ErrorEvent(new Error('Layer with id "'+wt+'" does not exist on this map.')));return}if(this._order.splice(Jt,0,ve),this._layerOrderChanged=!0,this._layers[ve]=ke,this._removedLayers[ve]&&ke.source&&ke.type!=="custom"){var fe=this._removedLayers[ve];delete this._removedLayers[ve],fe.type!==ke.type?this._updatedSources[ke.source]="clear":(this._updatedSources[ke.source]="reload",this.sourceCaches[ke.source].pause())}this._updateLayer(ke),ke.onAdd&&ke.onAdd(this.map)},lt.prototype.moveLayer=function(nt,wt){this._checkLoaded(),this._changed=!0;var Wt=this._layers[nt];if(!Wt){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be moved.")));return}if(nt!==wt){var ve=this._order.indexOf(nt);this._order.splice(ve,1);var ke=wt?this._order.indexOf(wt):this._order.length;if(wt&&ke===-1){this.fire(new n.ErrorEvent(new Error('Layer with id "'+wt+'" does not exist on this map.')));return}this._order.splice(ke,0,nt),this._layerOrderChanged=!0}},lt.prototype.removeLayer=function(nt){this._checkLoaded();var wt=this._layers[nt];if(!wt){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be removed.")));return}wt.setEventedParent(null);var Wt=this._order.indexOf(nt);this._order.splice(Wt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[nt]=wt,delete this._layers[nt],delete this._serializedLayers[nt],delete this._updatedLayers[nt],delete this._updatedPaintProps[nt],wt.onRemove&&wt.onRemove(this.map)},lt.prototype.getLayer=function(nt){return this._layers[nt]},lt.prototype.hasLayer=function(nt){return nt in this._layers},lt.prototype.setLayerZoomRange=function(nt,wt,Wt){this._checkLoaded();var ve=this.getLayer(nt);if(!ve){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot have zoom extent.")));return}ve.minzoom===wt&&ve.maxzoom===Wt||(wt!=null&&(ve.minzoom=wt),Wt!=null&&(ve.maxzoom=Wt),this._updateLayer(ve))},lt.prototype.setFilter=function(nt,wt,Wt){Wt===void 0&&(Wt={}),this._checkLoaded();var ve=this.getLayer(nt);if(!ve){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be filtered.")));return}if(!n.deepEqual(ve.filter,wt)){if(wt==null){ve.filter=void 0,this._updateLayer(ve);return}this._validate(n.validateStyle.filter,"layers."+ve.id+".filter",wt,null,Wt)||(ve.filter=n.clone$1(wt),this._updateLayer(ve))}},lt.prototype.getFilter=function(nt){return n.clone$1(this.getLayer(nt).filter)},lt.prototype.setLayoutProperty=function(nt,wt,Wt,ve){ve===void 0&&(ve={}),this._checkLoaded();var ke=this.getLayer(nt);if(!ke){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be styled.")));return}n.deepEqual(ke.getLayoutProperty(wt),Wt)||(ke.setLayoutProperty(wt,Wt,ve),this._updateLayer(ke))},lt.prototype.getLayoutProperty=function(nt,wt){var Wt=this.getLayer(nt);if(!Wt){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style.")));return}return Wt.getLayoutProperty(wt)},lt.prototype.setPaintProperty=function(nt,wt,Wt,ve){ve===void 0&&(ve={}),this._checkLoaded();var ke=this.getLayer(nt);if(!ke){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be styled.")));return}if(!n.deepEqual(ke.getPaintProperty(wt),Wt)){var Jt=ke.setPaintProperty(wt,Wt,ve);Jt&&this._updateLayer(ke),this._changed=!0,this._updatedPaintProps[nt]=!0}},lt.prototype.getPaintProperty=function(nt,wt){return this.getLayer(nt).getPaintProperty(wt)},lt.prototype.setFeatureState=function(nt,wt){this._checkLoaded();var Wt=nt.source,ve=nt.sourceLayer,ke=this.sourceCaches[Wt];if(ke===void 0){this.fire(new n.ErrorEvent(new Error("The source '"+Wt+"' does not exist in the map's style.")));return}var Jt=ke.getSource().type;if(Jt==="geojson"&&ve){this.fire(new n.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Jt==="vector"&&!ve){this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}nt.id===void 0&&this.fire(new n.ErrorEvent(new Error("The feature id parameter must be provided."))),ke.setFeatureState(ve,nt.id,wt)},lt.prototype.removeFeatureState=function(nt,wt){this._checkLoaded();var Wt=nt.source,ve=this.sourceCaches[Wt];if(ve===void 0){this.fire(new n.ErrorEvent(new Error("The source '"+Wt+"' does not exist in the map's style.")));return}var ke=ve.getSource().type,Jt=ke==="vector"?nt.sourceLayer:void 0;if(ke==="vector"&&!Jt){this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(wt&&typeof nt.id!="string"&&typeof nt.id!="number"){this.fire(new n.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}ve.removeFeatureState(Jt,nt.id,wt)},lt.prototype.getFeatureState=function(nt){this._checkLoaded();var wt=nt.source,Wt=nt.sourceLayer,ve=this.sourceCaches[wt];if(ve===void 0){this.fire(new n.ErrorEvent(new Error("The source '"+wt+"' does not exist in the map's style.")));return}var ke=ve.getSource().type;if(ke==="vector"&&!Wt){this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return nt.id===void 0&&this.fire(new n.ErrorEvent(new Error("The feature id parameter must be provided."))),ve.getFeatureState(Wt,nt.id)},lt.prototype.getTransition=function(){return n.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},lt.prototype.serialize=function(){return n.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:n.mapObject(this.sourceCaches,function(nt){return nt.serialize()}),layers:this._serializeLayers(this._order)},function(nt){return nt!==void 0})},lt.prototype._updateLayer=function(nt){this._updatedLayers[nt.id]=!0,nt.source&&!this._updatedSources[nt.source]&&this.sourceCaches[nt.source].getSource().type!=="raster"&&(this._updatedSources[nt.source]="reload",this.sourceCaches[nt.source].pause()),this._changed=!0},lt.prototype._flattenAndSortRenderedFeatures=function(nt){for(var wt=this,Wt=function(Wi){return wt._layers[Wi].type==="fill-extrusion"},ve={},ke=[],Jt=this._order.length-1;Jt>=0;Jt--){var fe=this._order[Jt];if(Wt(fe)){ve[fe]=Jt;for(var De=0,lr=nt;De=0;Je--){var Hr=this._order[Je];if(Wt(Hr))for(var wn=ke.length-1;wn>=0;wn--){var Ln=ke[wn].feature;if(ve[Ln.layer.id] .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}),Rk=It((et,Y)=>{var f=jn(),y=Hn().defaultLine,z=Jh().attributes,P=hi(),n=dd().textposition,i=sh().overrideAll,a=Tc().templatedArray,l=my(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var c=Y.exports=i({_arrayAttrRegexps:[f.counterRegex("mapbox",".layers",!0)],domain:z({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:l.styleValuesMapbox.concat(l.styleValuesNonMapbox),dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:f.extendFlat({},n,{arrayOk:!1})}})},"plot","from-root");c.uirevision={valType:"any",editType:"none"}}),yA=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=Ib(),i=dd(),a=Rk(),l=xa(),o=Ru(),c=Yn().extendFlat,s=sh().overrideAll,h=Rk(),m=n.line,b=n.marker;Y.exports=s({lon:n.lon,lat:n.lat,cluster:{enabled:{valType:"boolean"},maxzoom:c({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:c({},b.opacity,{dflt:1})},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:c({},i.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:i.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:n.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:i.selected.marker},unselected:{marker:i.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:f(),hovertemplatefallback:z()},"calc","nested")}),yz=It((et,Y)=>{var f=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return f.indexOf(y)!==-1}}}),JQ=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=pm(),i=Pm(),a=yA(),l=yz().isSupportedFont;Y.exports=function(c,s,h,m){function b(g,C){return f.coerce(c,s,a,g,C)}function x(g,C){return f.coerce2(c,s,a,g,C)}var _=o(c,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(c,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(f.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),f.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(c,s,h,m,b,{noDash:!0}),b("connectgaps"));var d=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=d!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;n(c,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&i(c,s,h,b),f.coerceSelectionMarkerOpacity(s,b)};function o(c,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),_z=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot,a=i.mockAxis,l=y.lonlat;return n.lonLabel=f.tickText(a,a.c2l(l[0]),!0).text,n.latLabel=f.tickText(a,a.c2l(l[1]),!0).text,n}}),xz=It((et,Y)=>{var f=jn();Y.exports=function(y,z){var P=y.split(" "),n=P[0],i=P[1],a=f.isArrayOrTypedArray(z)?f.mean(z):z,l=.5+a/100,o=1.5+a/100,c=["",""],s=[0,0];switch(n){case"top":c[0]="top",s[1]=-o;break;case"bottom":c[0]="bottom",s[1]=o;break}switch(i){case"left":c[1]="right",s[0]=-l;break;case"right":c[1]="left",s[0]=l;break}var h;return c[0]&&c[1]?h=c.join("-"):c[0]?h=c[0]:c[1]?h=c[1]:h="center",{anchor:h,offset:s}}}),QQ=It((et,Y)=>{var f=Sr(),y=jn(),z=Dr().BADNUM,P=W_(),n=ch(),i=Js(),a=Hv(),l=Fu(),o=yz().isSupportedFont,c=xz(),s=T0().appendArrayPointValue,h=uu().NEWLINES,m=uu().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),S=l.hasMarkers(M),N=l.hasText(M),B=S&&M.marker.symbol==="circle",U=S&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),H=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:H,symbol:q};if(!p)return G;var tt;if((g||C)&&(tt=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(tt),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(tt),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var ht=x(I);H.geojson=ht.geojson,H.layout.visibility="visible",V&&(H.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat(H.paint,{"circle-color":ht.mcc,"circle-radius":ht.mrc,"circle-opacity":ht.mo})}if(B&&V&&(H.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var bt=(M.marker||{}).size,vt=c(M.textposition,bt);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":vt.anchor,"text-offset":vt.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),S=y.isArrayOrTypedArray(M.opacity),N;function B(vt){return I.opacity*vt}function U(vt){return vt/2}var V;g&&(n.hasColorscale(I,"marker")?V=n.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;S&&(F=function(vt){var ut=f(vt)?+y.constrain(vt,0,1):0;return B(ut)});var H=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),S&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),ttt=It((et,Y)=>{var f=jn(),y=QQ(),z=my().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function n(a,l,o,c){this.type="scattermapbox",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=c,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var i=n.prototype;i.addSource=function(a,l,o){var c={type:"geojson",data:l.geojson};o&&o.enabled&&f.extendFlat(c,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],c)},i.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},i.addLayer=function(a,l,o){var c={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(c.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var S=g[C];c.removeLayer(x.layerIds[S])}p||c.removeSource(x.sourceIds.circle)}function d(p){for(var g=P.nonCluster,C=0;C=0;C--){var S=g[C];c.removeLayer(x.layerIds[S]),p||c.removeSource(x.sourceIds[S])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):d(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var c=l[o];a.removeLayer(this.layerIds[c]),a.removeSource(this.sourceIds[c])}},Y.exports=function(a,l){var o=l[0].trace,c=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new n(a,o.uid,c,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(c)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var f=hd(),y=jn(),z=qc(),P=y.fillText,n=Dr().BADNUM,i=my().traceLayerPrefix;function a(o,c,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],d=i+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[d]});A=w.map(function(W){return W.id})}var D=c>=0?Math.floor((c+180)/360):Math.ceil((c-180)/360),E=D*360,I=c-E;function M(W){var F=W.lonlat;if(F[0]===n||k&&A.indexOf(W.i+1)===-1)return 1/0;var H=y.modHalf(F[0],360),q=F[1],G=_.project([H,q]),tt=G.x-b.c2p([I,q]),ht=G.y-x.c2p([H,s]),bt=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(tt*tt+ht*ht)-bt,1-3/bt)}if(f.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],S=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=S-B,o.x1=S+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,c,s){if(o.hovertemplate)return;var h=c.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=c.lonlat,d=[];function k(w){return w+"°"}return b||x&&_?d.push("("+k(A[1])+", "+k(A[0])+")"):x?d.push(s.lon+k(A[0])):_&&d.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(c,o,d),d.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),ett=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f}}),rtt=It((et,Y)=>{var f=jn(),y=Fu(),z=Dr().BADNUM;Y.exports=function(P,n){var i=P.cd,a=P.xaxis,l=P.yaxis,o=[],c=i[0].trace,s;if(!y.hasMarkers(c))return[];if(n===!1)for(s=0;s{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():(f=f||self,f.mapboxgl=y())})(et,function(){var f,y,z;function P(n,i){if(!f)f=i;else if(!y)y=i;else{var a="var sharedChunk = {}; ("+f+")(sharedChunk); ("+y+")(sharedChunk);",l={};f(l),z=i(l),typeof window<"u"&&(z.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}}return P(["exports"],function(n){function i(v,j){return j={exports:{}},v(j,j.exports),j.exports}var a="1.13.4",l=o;function o(v,j,Q,Tt){this.cx=3*v,this.bx=3*(Q-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*j,this.by=3*(Tt-j)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=Tt,this.p2x=Q,this.p2y=Tt}o.prototype.sampleCurveX=function(v){return((this.ax*v+this.bx)*v+this.cx)*v},o.prototype.sampleCurveY=function(v){return((this.ay*v+this.by)*v+this.cy)*v},o.prototype.sampleCurveDerivativeX=function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},o.prototype.solveCurveX=function(v,j){typeof j>"u"&&(j=1e-6);var Q,Tt,Nt,Yt,se;for(Nt=v,se=0;se<8;se++){if(Yt=this.sampleCurveX(Nt)-v,Math.abs(Yt)Tt)return Tt;for(;QYt?Q=Nt:Tt=Nt,Nt=(Tt-Q)*.5+Q}return Nt},o.prototype.solve=function(v,j){return this.sampleCurveY(this.solveCurveX(v,j))};var c=s;function s(v,j){this.x=v,this.y=j}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(v){return this.clone()._add(v)},sub:function(v){return this.clone()._sub(v)},multByPoint:function(v){return this.clone()._multByPoint(v)},divByPoint:function(v){return this.clone()._divByPoint(v)},mult:function(v){return this.clone()._mult(v)},div:function(v){return this.clone()._div(v)},rotate:function(v){return this.clone()._rotate(v)},rotateAround:function(v,j){return this.clone()._rotateAround(v,j)},matMult:function(v){return this.clone()._matMult(v)},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(v){return this.x===v.x&&this.y===v.y},dist:function(v){return Math.sqrt(this.distSqr(v))},distSqr:function(v){var j=v.x-this.x,Q=v.y-this.y;return j*j+Q*Q},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(v){return Math.atan2(this.y-v.y,this.x-v.x)},angleWith:function(v){return this.angleWithSep(v.x,v.y)},angleWithSep:function(v,j){return Math.atan2(this.x*j-this.y*v,this.x*v+this.y*j)},_matMult:function(v){var j=v[0]*this.x+v[1]*this.y,Q=v[2]*this.x+v[3]*this.y;return this.x=j,this.y=Q,this},_add:function(v){return this.x+=v.x,this.y+=v.y,this},_sub:function(v){return this.x-=v.x,this.y-=v.y,this},_mult:function(v){return this.x*=v,this.y*=v,this},_div:function(v){return this.x/=v,this.y/=v,this},_multByPoint:function(v){return this.x*=v.x,this.y*=v.y,this},_divByPoint:function(v){return this.x/=v.x,this.y/=v.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var v=this.y;return this.y=this.x,this.x=-v,this},_rotate:function(v){var j=Math.cos(v),Q=Math.sin(v),Tt=j*this.x-Q*this.y,Nt=Q*this.x+j*this.y;return this.x=Tt,this.y=Nt,this},_rotateAround:function(v,j){var Q=Math.cos(v),Tt=Math.sin(v),Nt=j.x+Q*(this.x-j.x)-Tt*(this.y-j.y),Yt=j.y+Tt*(this.x-j.x)+Q*(this.y-j.y);return this.x=Nt,this.y=Yt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(v){return v instanceof s?v:Array.isArray(v)?new s(v[0],v[1]):v};var h=typeof self<"u"?self:{};function m(v,j){if(Array.isArray(v)){if(!Array.isArray(j)||v.length!==j.length)return!1;for(var Q=0;Q=1)return 1;var j=v*v,Q=j*v;return 4*(v<.5?Q:3*(v-j)+Q-.75)}function _(v,j,Q,Tt){var Nt=new l(v,j,Q,Tt);return function(Yt){return Nt.solve(Yt)}}var A=_(.25,.1,.25,1);function d(v,j,Q){return Math.min(Q,Math.max(j,v))}function k(v,j,Q){var Tt=Q-j,Nt=((v-j)%Tt+Tt)%Tt+j;return Nt===j?Q:Nt}function w(v,j,Q){if(!v.length)return Q(null,[]);var Tt=v.length,Nt=new Array(v.length),Yt=null;v.forEach(function(se,Ue){j(se,function(nr,Tr){nr&&(Yt=nr),Nt[Ue]=Tr,--Tt===0&&Q(Yt,Nt)})})}function D(v){var j=[];for(var Q in v)j.push(v[Q]);return j}function E(v,j){var Q=[];for(var Tt in v)Tt in j||Q.push(Tt);return Q}function I(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Tt=0,Nt=j;Tt>j/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,v)}return v()}function S(v){return v<=1?1:Math.pow(2,Math.ceil(Math.log(v)/Math.LN2))}function N(v){return v?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(v):!1}function B(v,j){v.forEach(function(Q){j[Q]&&(j[Q]=j[Q].bind(j))})}function U(v,j){return v.indexOf(j,v.length-j.length)!==-1}function V(v,j,Q){var Tt={};for(var Nt in v)Tt[Nt]=j.call(Q||this,v[Nt],Nt,v);return Tt}function W(v,j,Q){var Tt={};for(var Nt in v)j.call(Q||this,v[Nt],Nt,v)&&(Tt[Nt]=v[Nt]);return Tt}function F(v){return Array.isArray(v)?v.map(F):typeof v=="object"&&v?V(v,F):v}function H(v,j){for(var Q=0;Q=0)return!0;return!1}var q={};function G(v){q[v]||(typeof console<"u"&&console.warn(v),q[v]=!0)}function tt(v,j,Q){return(Q.y-v.y)*(j.x-v.x)>(j.y-v.y)*(Q.x-v.x)}function ht(v){for(var j=0,Q=0,Tt=v.length,Nt=Tt-1,Yt=void 0,se=void 0;Q@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,Q={};if(v.replace(j,function(Nt,Yt,se,Ue){var nr=se||Ue;return Q[Yt]=nr?nr.toLowerCase():!0,""}),Q["max-age"]){var Tt=parseInt(Q["max-age"],10);isNaN(Tt)?delete Q["max-age"]:Q["max-age"]=Tt}return Q}var rt=null;function gt(v){if(rt==null){var j=v.navigator?v.navigator.userAgent:null;rt=!!v.safari||!!(j&&(/\b(iPad|iPhone|iPod)\b/.test(j)||j.match("Safari")&&!j.match("Chrome")))}return rt}function it(v){try{var j=h[v];return j.setItem("_mapbox_test_",1),j.removeItem("_mapbox_test_"),!0}catch{return!1}}function st(v){return h.btoa(encodeURIComponent(v).replace(/%([0-9A-F]{2})/g,function(j,Q){return String.fromCharCode(+("0x"+Q))}))}function xt(v){return decodeURIComponent(h.atob(v).split("").map(function(j){return"%"+("00"+j.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ot=h.performance&&h.performance.now?h.performance.now.bind(h.performance):Date.now.bind(Date),J=h.requestAnimationFrame||h.mozRequestAnimationFrame||h.webkitRequestAnimationFrame||h.msRequestAnimationFrame,mt=h.cancelAnimationFrame||h.mozCancelAnimationFrame||h.webkitCancelAnimationFrame||h.msCancelAnimationFrame,dt,Ct,Rt={now:ot,frame:function(v){var j=J(v);return{cancel:function(){return mt(j)}}},getImageData:function(v,j){j===void 0&&(j=0);var Q=h.document.createElement("canvas"),Tt=Q.getContext("2d");if(!Tt)throw new Error("failed to create canvas 2d context");return Q.width=v.width,Q.height=v.height,Tt.drawImage(v,0,0,v.width,v.height),Tt.getImageData(-j,-j,v.width+2*j,v.height+2*j)},resolveURL:function(v){return dt||(dt=h.document.createElement("a")),dt.href=v,dt.href},hardwareConcurrency:h.navigator&&h.navigator.hardwareConcurrency||4,get devicePixelRatio(){return h.devicePixelRatio},get prefersReducedMotion(){return h.matchMedia?(Ct==null&&(Ct=h.matchMedia("(prefers-reduced-motion: reduce)")),Ct.matches):!1}},Bt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Zt={supported:!1,testSupport:ye},Gt,ee=!1,xe,ge=!1;h.document&&(xe=h.document.createElement("img"),xe.onload=function(){Gt&&ue(Gt),Gt=null,ge=!0},xe.onerror=function(){ee=!0,Gt=null},xe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function ye(v){ee||!xe||(ge?ue(v):Gt=v)}function ue(v){var j=v.createTexture();v.bindTexture(v.TEXTURE_2D,j);try{if(v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,xe),v.isContextLost())return;Zt.supported=!0}catch{}v.deleteTexture(j),ee=!0}var Mt="01";function Ot(){for(var v="1",j="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",Q="",Tt=0;Tt<10;Tt++)Q+=j[Math.floor(Math.random()*62)];var Nt=720*60*1e3,Yt=[v,Mt,Q].join(""),se=Date.now()+Nt;return{token:Yt,tokenExpiresAt:se}}var Lt=function(v,j){this._transformRequestFn=v,this._customAccessToken=j,this._createSkuToken()};Lt.prototype._createSkuToken=function(){var v=Ot();this._skuToken=v.token,this._skuTokenExpiresAt=v.tokenExpiresAt},Lt.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Lt.prototype.transformRequest=function(v,j){return this._transformRequestFn?this._transformRequestFn(v,j)||{url:v}:{url:v}},Lt.prototype.normalizeStyleURL=function(v,j){if(!ie(v))return v;var Q=mr(v);return Q.path="/styles/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Lt.prototype.normalizeGlyphsURL=function(v,j){if(!ie(v))return v;var Q=mr(v);return Q.path="/fonts/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Lt.prototype.normalizeSourceURL=function(v,j){if(!ie(v))return v;var Q=mr(v);return Q.path="/v4/"+Q.authority+".json",Q.params.push("secure"),this._makeAPIURL(Q,this._customAccessToken||j)},Lt.prototype.normalizeSpriteURL=function(v,j,Q,Tt){var Nt=mr(v);return ie(v)?(Nt.path="/styles/v1"+Nt.path+"/sprite"+j+Q,this._makeAPIURL(Nt,this._customAccessToken||Tt)):(Nt.path+=""+j+Q,fr(Nt))},Lt.prototype.normalizeTileURL=function(v,j){if(this._isSkuTokenExpired()&&this._createSkuToken(),v&&!ie(v))return v;var Q=mr(v),Tt=/(\.(png|jpg)\d*)(?=$)/,Nt=/^.+\/v4\//,Yt=Rt.devicePixelRatio>=2||j===512?"@2x":"",se=Zt.supported?".webp":"$1";Q.path=Q.path.replace(Tt,""+Yt+se),Q.path=Q.path.replace(Nt,"/"),Q.path="/v4"+Q.path;var Ue=this._customAccessToken||Ze(Q.params)||Bt.ACCESS_TOKEN;return Bt.REQUIRE_ACCESS_TOKEN&&Ue&&this._skuToken&&Q.params.push("sku="+this._skuToken),this._makeAPIURL(Q,Ue)},Lt.prototype.canonicalizeTileURL=function(v,j){var Q="/v4/",Tt=/\.[\w]+$/,Nt=mr(v);if(!Nt.path.match(/(^\/v4\/)/)||!Nt.path.match(Tt))return v;var Yt="mapbox://tiles/";Yt+=Nt.path.replace(Q,"");var se=Nt.params;return j&&(se=se.filter(function(Ue){return!Ue.match(/^access_token=/)})),se.length&&(Yt+="?"+se.join("&")),Yt},Lt.prototype.canonicalizeTileset=function(v,j){for(var Q=j?ie(j):!1,Tt=[],Nt=0,Yt=v.tiles||[];Nt=0&&v.params.splice(Nt,1)}if(Tt.path!=="/"&&(v.path=""+Tt.path+v.path),!Bt.REQUIRE_ACCESS_TOKEN)return fr(v);if(j=j||Bt.ACCESS_TOKEN,!j)throw new Error("An API access token is required to use Mapbox GL. "+Q);if(j[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+Q);return v.params=v.params.filter(function(Yt){return Yt.indexOf("access_token")===-1}),v.params.push("access_token="+j),fr(v)};function ie(v){return v.indexOf("mapbox:")===0}var be=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ce(v){return be.test(v)}function Le(v){return v.indexOf("sku=")>0&&ce(v)}function Ze(v){for(var j=0,Q=v;j=1&&h.localStorage.setItem(j,JSON.stringify(this.eventData))}catch{G("Unable to write to LocalStorage")}},Er.prototype.processRequests=function(v){},Er.prototype.postEvent=function(v,j,Q,Tt){var Nt=this;if(Bt.EVENTS_URL){var Yt=mr(Bt.EVENTS_URL);Yt.params.push("access_token="+(Tt||Bt.ACCESS_TOKEN||""));var se={event:this.type,created:new Date(v).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:a,skuId:Mt,userId:this.anonId},Ue=j?I(se,j):se,nr={url:fr(Yt),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Ue])};this.pendingRequest=Wn(nr,function(Tr){Nt.pendingRequest=null,Q(Tr),Nt.saveEventData(),Nt.processRequests(Tt)})}},Er.prototype.queueRequest=function(v,j){this.queue.push(v),this.processRequests(j)};var dn=function(v){function j(){v.call(this,"map.load"),this.success={},this.skuToken=""}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postMapLoadEvent=function(Q,Tt,Nt,Yt){this.skuToken=Nt,(Bt.EVENTS_URL&&Yt||Bt.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(se){return ie(se)||ce(se)}))&&this.queueRequest({id:Tt,timestamp:Date.now()},Yt)},j.prototype.processRequests=function(Q){var Tt=this;if(!(this.pendingRequest||this.queue.length===0)){var Nt=this.queue.shift(),Yt=Nt.id,se=Nt.timestamp;Yt&&this.success[Yt]||(this.anonId||this.fetchEventData(),N(this.anonId)||(this.anonId=C()),this.postEvent(se,{skuToken:this.skuToken},function(Ue){Ue||Yt&&(Tt.success[Yt]=!0)},Q))}},j}(Er),_n=function(v){function j(Q){v.call(this,"appUserTurnstile"),this._customAccessToken=Q}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postTurnstileEvent=function(Q,Tt){Bt.EVENTS_URL&&Bt.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(Nt){return ie(Nt)||ce(Nt)})&&this.queueRequest(Date.now(),Tt)},j.prototype.processRequests=function(Q){var Tt=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var Nt=an(Bt.ACCESS_TOKEN),Yt=Nt?Nt.u:Bt.ACCESS_TOKEN,se=Yt!==this.eventData.tokenU;N(this.anonId)||(this.anonId=C(),se=!0);var Ue=this.queue.shift();if(this.eventData.lastSuccess){var nr=new Date(this.eventData.lastSuccess),Tr=new Date(Ue),jr=(Ue-this.eventData.lastSuccess)/(1440*60*1e3);se=se||jr>=1||jr<-1||nr.getDate()!==Tr.getDate()}else se=!0;if(!se)return this.processRequests();this.postEvent(Ue,{"enabled.telemetry":!1},function(hn){hn||(Tt.eventData.lastSuccess=Ue,Tt.eventData.tokenU=Yt)},Q)}},j}(Er),Oe=new _n,Xt=Oe.postTurnstileEvent.bind(Oe),oe=new dn,zt=oe.postMapLoadEvent.bind(oe),_t="mapbox-tiles",Pt=500,Ht=50,ae=1e3*60*7,he;function Me(){h.caches&&!he&&(he=h.caches.open(_t))}var qe;function Ye(v,j){if(qe===void 0)try{new Response(new ReadableStream),qe=!0}catch{qe=!1}qe?j(v.body):v.blob().then(j)}function ur(v,j,Q){if(Me(),!!he){var Tt={status:j.status,statusText:j.statusText,headers:new h.Headers};j.headers.forEach(function(se,Ue){return Tt.headers.set(Ue,se)});var Nt=ut(j.headers.get("Cache-Control")||"");if(!Nt["no-store"]){Nt["max-age"]&&Tt.headers.set("Expires",new Date(Q+Nt["max-age"]*1e3).toUTCString());var Yt=new Date(Tt.headers.get("Expires")).getTime()-Q;YtDate.now()&&!Q["no-cache"]}var pn=1/0;function ci(v){pn++,pn>Ht&&(v.getActor().send("enforceCacheSizeLimit",Pt),pn=0)}function ui(v){Me(),he&&he.then(function(j){j.keys().then(function(Q){for(var Tt=0;Tt=200&&Q.status<300||Q.status===0)&&Q.response!==null){var Nt=Q.response;if(v.type==="json")try{Nt=JSON.parse(Q.response)}catch(Yt){return j(Yt)}j(null,Nt,Q.getResponseHeader("Cache-Control"),Q.getResponseHeader("Expires"))}else j(new oa(Q.statusText,Q.status,v.url))},Q.send(v.body),{cancel:function(){return Q.abort()}}}var mn=function(v,j){if(!sr(v.url)){if(h.fetch&&h.Request&&h.AbortController&&h.Request.prototype.hasOwnProperty("signal"))return vr(v,j);if(vt()&&self.worker&&self.worker.actor){var Q=!0;return self.worker.actor.send("getResource",v,j,void 0,Q)}}return Ar(v,j)},Zn=function(v,j){return mn(I(v,{type:"json"}),j)},Un=function(v,j){return mn(I(v,{type:"arrayBuffer"}),j)},Wn=function(v,j){return mn(I(v,{method:"POST"}),j)};function Li(v){var j=h.document.createElement("a");return j.href=v,j.protocol===h.document.location.protocol&&j.host===h.document.location.host}var Fi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Zi(v,j,Q,Tt){var Nt=new h.Image,Yt=h.URL;Nt.onload=function(){j(null,Nt),Yt.revokeObjectURL(Nt.src),Nt.onload=null,h.requestAnimationFrame(function(){Nt.src=Fi})},Nt.onerror=function(){return j(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."))};var se=new h.Blob([new Uint8Array(v)],{type:"image/png"});Nt.cacheControl=Q,Nt.expires=Tt,Nt.src=v.byteLength?Yt.createObjectURL(se):Fi}function Ji(v,j){var Q=new h.Blob([new Uint8Array(v)],{type:"image/png"});h.createImageBitmap(Q).then(function(Tt){j(null,Tt)}).catch(function(Tt){j(new Error("Could not load image because of "+Tt.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var ca,Ei,Ga=function(){ca=[],Ei=0};Ga();var so=function(v,j){if(Zt.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*"),Ei>=Bt.MAX_PARALLEL_IMAGE_REQUESTS){var Q={requestParameters:v,callback:j,cancelled:!1,cancel:function(){this.cancelled=!0}};return ca.push(Q),Q}Ei++;var Tt=!1,Nt=function(){if(!Tt)for(Tt=!0,Ei--;ca.length&&Ei0||this._oneTimeListeners&&this._oneTimeListeners[v]&&this._oneTimeListeners[v].length>0||this._eventedParent&&this._eventedParent.listens(v)},Yr.prototype.setEventedParent=function(v,j){return this._eventedParent=v,this._eventedParentData=j,this};var un=8,Pn={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"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},bn={"*":{type:"source"}},ze=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],yr={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:"*"}},en={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:"*"}},Rn={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:"*"}},ni={type:{required:!0,type:"enum",values:{geojson:{}}},data:{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"}},xi={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"}}},Jn={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"}}},Gn={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"}},pi=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Va={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ea={"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"}},go={"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"}},mo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Go={"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"}},Po={"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"],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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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"],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"}},Zo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ka={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Cs={type:"array",value:"*"},ps={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},wl={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},is={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ol={type:"array",value:"*",minimum:1},ms={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}},kl=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],ul={"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"}},Kl={"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"}},vs={"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"}},Ns={"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"}},Uo={"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"}},Ds={"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"}},Ol={"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"}},tc={"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"}},sc={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Xs={"*":{type:"string"}},Wa={$version:un,$root:Pn,sources:bn,source:ze,source_vector:yr,source_raster:en,source_raster_dem:Rn,source_geojson:ni,source_video:xi,source_image:Jn,layer:Gn,layout:pi,layout_background:Va,layout_fill:ea,layout_circle:go,layout_heatmap:mo,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Go,layout_symbol:Po,layout_raster:Zo,layout_hillshade:Ka,filter:Cs,filter_operator:ps,geometry_type:wl,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:is,expression:ol,light:ms,paint:kl,paint_fill:ul,"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:Kl,paint_circle:vs,paint_heatmap:Ns,paint_symbol:Uo,paint_raster:Ds,paint_hillshade:Ol,paint_background:tc,transition:sc,"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:Xs},Co=function(v,j,Q,Tt){this.message=(v?v+": ":"")+Q,Tt&&(this.identifier=Tt),j!=null&&j.__line__&&(this.line=j.__line__)};function el(v){var j=v.key,Q=v.value;return Q?[new Co(j,Q,"constants have been deprecated as of v8")]:[]}function lc(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Tt=0,Nt=j;Tt":v.itemType.kind==="value"?"array":"array<"+j+">"}else return v.kind}var pu=[Gc,ko,zs,js,mc,Dl,Tl,cc(us),ql];function Ah(v,j){if(j.kind==="error")return null;if(v.kind==="array"){if(j.kind==="array"&&(j.N===0&&j.itemType.kind==="value"||!Ah(v.itemType,j.itemType))&&(typeof v.N!="number"||v.N===j.N))return null}else{if(v.kind===j.kind)return null;if(v.kind==="value")for(var Q=0,Tt=pu;Q255?255:Tr}function Nt(Tr){return Tr<0?0:Tr>1?1:Tr}function Yt(Tr){return Tr[Tr.length-1]==="%"?Tt(parseFloat(Tr)/100*255):Tt(parseInt(Tr))}function se(Tr){return Tr[Tr.length-1]==="%"?Nt(parseFloat(Tr)/100):Nt(parseFloat(Tr))}function Ue(Tr,jr,hn){return hn<0?hn+=1:hn>1&&(hn-=1),hn*6<1?Tr+(jr-Tr)*hn*6:hn*2<1?jr:hn*3<2?Tr+(jr-Tr)*(2/3-hn)*6:Tr}function nr(Tr){var jr=Tr.replace(/ /g,"").toLowerCase();if(jr in Q)return Q[jr].slice();if(jr[0]==="#"){if(jr.length===4){var hn=parseInt(jr.substr(1),16);return hn>=0&&hn<=4095?[(hn&3840)>>4|(hn&3840)>>8,hn&240|(hn&240)>>4,hn&15|(hn&15)<<4,1]:null}else if(jr.length===7){var hn=parseInt(jr.substr(1),16);return hn>=0&&hn<=16777215?[(hn&16711680)>>16,(hn&65280)>>8,hn&255,1]:null}return null}var xn=jr.indexOf("("),In=jr.indexOf(")");if(xn!==-1&&In+1===jr.length){var ii=jr.substr(0,xn),zi=jr.substr(xn+1,In-(xn+1)).split(","),ka=1;switch(ii){case"rgba":if(zi.length!==4)return null;ka=se(zi.pop());case"rgb":return zi.length!==3?null:[Yt(zi[0]),Yt(zi[1]),Yt(zi[2]),ka];case"hsla":if(zi.length!==4)return null;ka=se(zi.pop());case"hsl":if(zi.length!==3)return null;var ya=(parseFloat(zi[0])%360+360)%360/360,Ba=se(zi[1]),Ja=se(zi[2]),Da=Ja<=.5?Ja*(Ba+1):Ja+Ba-Ja*Ba,po=Ja*2-Da;return[Tt(Ue(po,Da,ya+1/3)*255),Tt(Ue(po,Da,ya)*255),Tt(Ue(po,Da,ya-1/3)*255),ka];default:return null}}return null}try{j.parseCSSColor=nr}catch{}}),Nd=tf.parseCSSColor,Gl=function(v,j,Q,Tt){Tt===void 0&&(Tt=1),this.r=v,this.g=j,this.b=Q,this.a=Tt};Gl.parse=function(v){if(v){if(v instanceof Gl)return v;if(typeof v=="string"){var j=Nd(v);if(j)return new Gl(j[0]/255*j[3],j[1]/255*j[3],j[2]/255*j[3],j[3])}}},Gl.prototype.toString=function(){var v=this.toArray(),j=v[0],Q=v[1],Tt=v[2],Nt=v[3];return"rgba("+Math.round(j)+","+Math.round(Q)+","+Math.round(Tt)+","+Nt+")"},Gl.prototype.toArray=function(){var v=this,j=v.r,Q=v.g,Tt=v.b,Nt=v.a;return Nt===0?[0,0,0,0]:[j*255/Nt,Q*255/Nt,Tt*255/Nt,Nt]},Gl.black=new Gl(0,0,0,1),Gl.white=new Gl(1,1,1,1),Gl.transparent=new Gl(0,0,0,0),Gl.red=new Gl(1,0,0,1);var Yu=function(v,j,Q){v?this.sensitivity=j?"variant":"case":this.sensitivity=j?"accent":"base",this.locale=Q,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Yu.prototype.compare=function(v,j){return this.collator.compare(v,j)},Yu.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ef=function(v,j,Q,Tt,Nt){this.text=v,this.image=j,this.scale=Q,this.fontStack=Tt,this.textColor=Nt},xu=function(v){this.sections=v};xu.fromString=function(v){return new xu([new ef(v,null,null,null,null)])},xu.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(v){return v.text.length!==0||v.image&&v.image.name.length!==0})},xu.factory=function(v){return v instanceof xu?v:xu.fromString(v)},xu.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(v){return v.text}).join("")},xu.prototype.serialize=function(){for(var v=["format"],j=0,Q=this.sections;j=0&&v<=255&&typeof j=="number"&&j>=0&&j<=255&&typeof Q=="number"&&Q>=0&&Q<=255)){var Nt=typeof Tt=="number"?[v,j,Q,Tt]:[v,j,Q];return"Invalid rgba value ["+Nt.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof Tt>"u"||typeof Tt=="number"&&Tt>=0&&Tt<=1?null:"Invalid rgba value ["+[v,j,Q,Tt].join(", ")+"]: 'a' must be between 0 and 1."}function _h(v){if(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number"||v instanceof Gl||v instanceof Yu||v instanceof xu||v instanceof mu)return!0;if(Array.isArray(v)){for(var j=0,Q=v;j2){var se=v[1];if(typeof se!="string"||!(se in jh)||se==="object")return j.error('The item type argument of "array" must be one of string, number, boolean',1);Yt=jh[se],Q++}else Yt=us;var Ue;if(v.length>3){if(v[2]!==null&&(typeof v[2]!="number"||v[2]<0||v[2]!==Math.floor(v[2])))return j.error('The length argument to "array" must be a positive integer literal',2);Ue=v[2],Q++}Tt=cc(Yt,Ue)}else Tt=jh[Nt];for(var nr=[];Q1)&&j.push(Tt)}}return j.concat(this.args.map(function(Nt){return Nt.serialize()}))};var Qh=function(v){this.type=Dl,this.sections=v};Qh.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[1];if(!Array.isArray(Q)&&typeof Q=="object")return j.error("First argument must be an image or text section.");for(var Tt=[],Nt=!1,Yt=1;Yt<=v.length-1;++Yt){var se=v[Yt];if(Nt&&typeof se=="object"&&!Array.isArray(se)){Nt=!1;var Ue=null;if(se["font-scale"]&&(Ue=j.parse(se["font-scale"],1,ko),!Ue))return null;var nr=null;if(se["text-font"]&&(nr=j.parse(se["text-font"],1,cc(zs)),!nr))return null;var Tr=null;if(se["text-color"]&&(Tr=j.parse(se["text-color"],1,mc),!Tr))return null;var jr=Tt[Tt.length-1];jr.scale=Ue,jr.font=nr,jr.textColor=Tr}else{var hn=j.parse(v[Yt],1,us);if(!hn)return null;var xn=hn.type.kind;if(xn!=="string"&&xn!=="value"&&xn!=="null"&&xn!=="resolvedImage")return j.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Nt=!0,Tt.push({content:hn,scale:null,font:null,textColor:null})}}return new Qh(Tt)},Qh.prototype.evaluate=function(v){var j=function(Q){var Tt=Q.content.evaluate(v);return _c(Tt)===ql?new ef("",Tt,null,null,null):new ef(gu(Tt),null,Q.scale?Q.scale.evaluate(v):null,Q.font?Q.font.evaluate(v).join(","):null,Q.textColor?Q.textColor.evaluate(v):null)};return new xu(this.sections.map(j))},Qh.prototype.eachChild=function(v){for(var j=0,Q=this.sections;j-1),Q},Lc.prototype.eachChild=function(v){v(this.input)},Lc.prototype.outputDefined=function(){return!1},Lc.prototype.serialize=function(){return["image",this.input.serialize()]};var Xf={"to-boolean":js,"to-color":mc,"to-number":ko,"to-string":zs},hl=function(v,j){this.type=v,this.args=j};hl.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[0];if((Q==="to-boolean"||Q==="to-string")&&v.length!==2)return j.error("Expected one argument.");for(var Tt=Xf[Q],Nt=[],Yt=1;Yt4?Q="Invalid rbga value "+JSON.stringify(j)+": expected an array containing either three or four numeric values.":Q=bu(j[0],j[1],j[2],j[3]),!Q))return new Gl(j[0]/255,j[1]/255,j[2]/255,j[3])}throw new ic(Q||"Could not parse color from value '"+(typeof j=="string"?j:String(JSON.stringify(j)))+"'")}else if(this.type.kind==="number"){for(var Ue=null,nr=0,Tr=this.args;nr=j[2]||v[1]<=j[1]||v[3]>=j[3])}function Lf(v,j){var Q=td(v[0]),Tt=Ed(v[1]),Nt=Math.pow(2,j.z);return[Math.round(Q*Nt*hu),Math.round(Tt*Nt*hu)]}function hf(v,j,Q){var Tt=v[0]-j[0],Nt=v[1]-j[1],Yt=v[0]-Q[0],se=v[1]-Q[1];return Tt*se-Yt*Nt===0&&Tt*Yt<=0&&Nt*se<=0}function Ld(v,j,Q){return j[1]>v[1]!=Q[1]>v[1]&&v[0]<(Q[0]-j[0])*(v[1]-j[1])/(Q[1]-j[1])+j[0]}function ed(v,j){for(var Q=!1,Tt=0,Nt=j.length;Tt0&&hn<0||jr<0&&hn>0}function df(v,j,Q,Tt){var Nt=[j[0]-v[0],j[1]-v[1]],Yt=[Tt[0]-Q[0],Tt[1]-Q[1]];return af(Yt,Nt)===0?!1:!!(bh(v,j,Q,Tt)&&bh(Q,Tt,v,j))}function Uh(v,j,Q){for(var Tt=0,Nt=Q;TtQ[2]){var Nt=Tt*.5,Yt=v[0]-Q[0]>Nt?-Tt:Q[0]-v[0]>Nt?Tt:0;Yt===0&&(Yt=v[0]-Q[2]>Nt?-Tt:Q[2]-v[0]>Nt?Tt:0),v[0]+=Yt}rf(j,v)}function jd(v){v[0]=v[1]=1/0,v[2]=v[3]=-1/0}function Jf(v,j,Q,Tt){for(var Nt=Math.pow(2,Tt.z)*hu,Yt=[Tt.x*hu,Tt.y*hu],se=[],Ue=0,nr=v;Ue=0)return!1;var Q=!0;return v.eachChild(function(Tt){Q&&!Ju(Tt,j)&&(Q=!1)}),Q}var rd=function(v,j){this.type=j.type,this.name=v,this.boundExpression=j};rd.parse=function(v,j){if(v.length!==2||typeof v[1]!="string")return j.error("'var' expression requires exactly one string literal argument.");var Q=v[1];return j.scope.has(Q)?new rd(Q,j.scope.get(Q)):j.error('Unknown variable "'+Q+'". Make sure "'+Q+'" has been bound in an enclosing "let" expression before using it.',1)},rd.prototype.evaluate=function(v){return this.boundExpression.evaluate(v)},rd.prototype.eachChild=function(){},rd.prototype.outputDefined=function(){return!1},rd.prototype.serialize=function(){return["var",this.name]};var xc=function(v,j,Q,Tt,Nt){j===void 0&&(j=[]),Tt===void 0&&(Tt=new $l),Nt===void 0&&(Nt=[]),this.registry=v,this.path=j,this.key=j.map(function(Yt){return"["+Yt+"]"}).join(""),this.scope=Tt,this.errors=Nt,this.expectedType=Q};xc.prototype.parse=function(v,j,Q,Tt,Nt){return Nt===void 0&&(Nt={}),j?this.concat(j,Q,Tt)._parse(v,Nt):this._parse(v,Nt)},xc.prototype._parse=function(v,j){(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number")&&(v=["literal",v]);function Q(Tr,jr,hn){return hn==="assert"?new Hu(jr,[Tr]):hn==="coerce"?new hl(jr,[Tr]):Tr}if(Array.isArray(v)){if(v.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var Tt=v[0];if(typeof Tt!="string")return this.error("Expression name must be a string, but found "+typeof Tt+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var Nt=this.registry[Tt];if(Nt){var Yt=Nt.parse(v,this);if(!Yt)return null;if(this.expectedType){var se=this.expectedType,Ue=Yt.type;if((se.kind==="string"||se.kind==="number"||se.kind==="boolean"||se.kind==="object"||se.kind==="array")&&Ue.kind==="value")Yt=Q(Yt,se,j.typeAnnotation||"assert");else if((se.kind==="color"||se.kind==="formatted"||se.kind==="resolvedImage")&&(Ue.kind==="value"||Ue.kind==="string"))Yt=Q(Yt,se,j.typeAnnotation||"coerce");else if(this.checkSubtype(se,Ue))return null}if(!(Yt instanceof pl)&&Yt.type.kind!=="resolvedImage"&&$h(Yt)){var nr=new Hl;try{Yt=new pl(Yt.type,Yt.evaluate(nr))}catch(Tr){return this.error(Tr.message),null}}return Yt}return this.error('Unknown expression "'+Tt+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof v>"u"?this.error("'undefined' value invalid. Use null instead."):typeof v=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof v+" instead.")},xc.prototype.concat=function(v,j,Q){var Tt=typeof v=="number"?this.path.concat(v):this.path,Nt=Q?this.scope.concat(Q):this.scope;return new xc(this.registry,Tt,j||null,Nt,this.errors)},xc.prototype.error=function(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];var Tt=""+this.key+j.map(function(Nt){return"["+Nt+"]"}).join("");this.errors.push(new yl(Tt,v))},xc.prototype.checkSubtype=function(v,j){var Q=Ah(v,j);return Q&&this.error(Q),Q};function $h(v){if(v instanceof rd)return $h(v.boundExpression);if(v instanceof cs&&v.name==="error"||v instanceof xh||v instanceof Xu)return!1;var j=v instanceof hl||v instanceof Hu,Q=!0;return v.eachChild(function(Tt){j?Q=Q&&$h(Tt):Q=Q&&Tt instanceof pl}),Q?mf(v)&&Ju(v,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function ju(v,j){for(var Q=v.length-1,Tt=0,Nt=Q,Yt=0,se,Ue;Tt<=Nt;)if(Yt=Math.floor((Tt+Nt)/2),se=v[Yt],Ue=v[Yt+1],se<=j){if(Yt===Q||jj)Nt=Yt-1;else throw new ic("Input is not a number.");return 0}var Qu=function(v,j,Q){this.type=v,this.input=j,this.labels=[],this.outputs=[];for(var Tt=0,Nt=Q;Tt=se)return j.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',nr);var jr=j.parse(Ue,Tr,Nt);if(!jr)return null;Nt=Nt||jr.type,Tt.push([se,jr])}return new Qu(Nt,Q,Tt)},Qu.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Tt=this.input.evaluate(v);if(Tt<=j[0])return Q[0].evaluate(v);var Nt=j.length;if(Tt>=j[Nt-1])return Q[Nt-1].evaluate(v);var Yt=ju(j,Tt);return Q[Yt].evaluate(v)},Qu.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j0&&v.push(this.labels[j]),v.push(this.outputs[j].serialize());return v};function Pc(v,j,Q){return v*(1-Q)+j*Q}function xd(v,j,Q){return new Gl(Pc(v.r,j.r,Q),Pc(v.g,j.g,Q),Pc(v.b,j.b,Q),Pc(v.a,j.a,Q))}function Eh(v,j,Q){return v.map(function(Tt,Nt){return Pc(Tt,j[Nt],Q)})}var nd=Object.freeze({__proto__:null,number:Pc,color:xd,array:Eh}),Ud=.95047,Qf=1,Ap=1.08883,bd=4/29,$d=6/29,zu=3*$d*$d,wd=$d*$d*$d,hh=Math.PI/180,kd=180/Math.PI;function Hd(v){return v>wd?Math.pow(v,1/3):v/zu+bd}function Lh(v){return v>$d?v*v*v:zu*(v-bd)}function Ic(v){return 255*(v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055)}function Hh(v){return v/=255,v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)}function th(v){var j=Hh(v.r),Q=Hh(v.g),Tt=Hh(v.b),Nt=Hd((.4124564*j+.3575761*Q+.1804375*Tt)/Ud),Yt=Hd((.2126729*j+.7151522*Q+.072175*Tt)/Qf),se=Hd((.0193339*j+.119192*Q+.9503041*Tt)/Ap);return{l:116*Yt-16,a:500*(Nt-Yt),b:200*(Yt-se),alpha:v.a}}function Pf(v){var j=(v.l+16)/116,Q=isNaN(v.a)?j:j+v.a/500,Tt=isNaN(v.b)?j:j-v.b/200;return j=Qf*Lh(j),Q=Ud*Lh(Q),Tt=Ap*Lh(Tt),new Gl(Ic(3.2404542*Q-1.5371385*j-.4985314*Tt),Ic(-.969266*Q+1.8760108*j+.041556*Tt),Ic(.0556434*Q-.2040259*j+1.0572252*Tt),v.alpha)}function Mc(v,j,Q){return{l:Pc(v.l,j.l,Q),a:Pc(v.a,j.a,Q),b:Pc(v.b,j.b,Q),alpha:Pc(v.alpha,j.alpha,Q)}}function Id(v){var j=th(v),Q=j.l,Tt=j.a,Nt=j.b,Yt=Math.atan2(Nt,Tt)*kd;return{h:Yt<0?Yt+360:Yt,c:Math.sqrt(Tt*Tt+Nt*Nt),l:Q,alpha:v.a}}function id(v){var j=v.h*hh,Q=v.c,Tt=v.l;return Pf({l:Tt,a:Math.cos(j)*Q,b:Math.sin(j)*Q,alpha:v.alpha})}function dh(v,j,Q){var Tt=j-v;return v+Q*(Tt>180||Tt<-180?Tt-360*Math.round(Tt/360):Tt)}function pd(v,j,Q){return{h:dh(v.h,j.h,Q),c:Pc(v.c,j.c,Q),l:Pc(v.l,j.l,Q),alpha:Pc(v.alpha,j.alpha,Q)}}var ad={forward:th,reverse:Pf,interpolate:Mc},Dd={forward:Id,reverse:id,interpolate:pd},tp=Object.freeze({__proto__:null,lab:ad,hcl:Dd}),Au=function(v,j,Q,Tt,Nt){this.type=v,this.operator=j,this.interpolation=Q,this.input=Tt,this.labels=[],this.outputs=[];for(var Yt=0,se=Nt;Yt1}))return j.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Tt={name:"cubic-bezier",controlPoints:Ue}}else return j.error("Unknown interpolation type "+String(Tt[0]),1,0);if(v.length-1<4)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if((v.length-1)%2!==0)return j.error("Expected an even number of arguments.");if(Nt=j.parse(Nt,2,ko),!Nt)return null;var nr=[],Tr=null;Q==="interpolate-hcl"||Q==="interpolate-lab"?Tr=mc:j.expectedType&&j.expectedType.kind!=="value"&&(Tr=j.expectedType);for(var jr=0;jr=hn)return j.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',In);var zi=j.parse(xn,ii,Tr);if(!zi)return null;Tr=Tr||zi.type,nr.push([hn,zi])}return Tr.kind!=="number"&&Tr.kind!=="color"&&!(Tr.kind==="array"&&Tr.itemType.kind==="number"&&typeof Tr.N=="number")?j.error("Type "+dc(Tr)+" is not interpolatable."):new Au(Tr,Q,Tt,Nt,nr)},Au.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Tt=this.input.evaluate(v);if(Tt<=j[0])return Q[0].evaluate(v);var Nt=j.length;if(Tt>=j[Nt-1])return Q[Nt-1].evaluate(v);var Yt=ju(j,Tt),se=j[Yt],Ue=j[Yt+1],nr=Au.interpolationFactor(this.interpolation,Tt,se,Ue),Tr=Q[Yt].evaluate(v),jr=Q[Yt+1].evaluate(v);return this.operator==="interpolate"?nd[this.type.kind.toLowerCase()](Tr,jr,nr):this.operator==="interpolate-hcl"?Dd.reverse(Dd.interpolate(Dd.forward(Tr),Dd.forward(jr),nr)):ad.reverse(ad.interpolate(ad.forward(Tr),ad.forward(jr),nr))},Au.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j=Q.length)throw new ic("Array index out of bounds: "+j+" > "+(Q.length-1)+".");if(j!==Math.floor(j))throw new ic("Array index must be an integer, but found "+j+" instead.");return Q[j]},Ph.prototype.eachChild=function(v){v(this.index),v(this.input)},Ph.prototype.outputDefined=function(){return!1},Ph.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Zc=function(v,j){this.type=js,this.needle=v,this.haystack=j};Zc.parse=function(v,j){if(v.length!==3)return j.error("Expected 2 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,us),Tt=j.parse(v[2],2,us);return!Q||!Tt?null:uh(Q.type,[js,zs,ko,Gc,us])?new Zc(Q,Tt):j.error("Expected first argument to be of type boolean, string, number or null, but found "+dc(Q.type)+" instead")},Zc.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!Q)return!1;if(!yh(j,["boolean","string","number","null"]))throw new ic("Expected first argument to be of type boolean, string, number or null, but found "+dc(_c(j))+" instead.");if(!yh(Q,["string","array"]))throw new ic("Expected second argument to be of type array or string, but found "+dc(_c(Q))+" instead.");return Q.indexOf(j)>=0},Zc.prototype.eachChild=function(v){v(this.needle),v(this.haystack)},Zc.prototype.outputDefined=function(){return!0},Zc.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fc=function(v,j,Q){this.type=ko,this.needle=v,this.haystack=j,this.fromIndex=Q};fc.parse=function(v,j){if(v.length<=2||v.length>=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,us),Tt=j.parse(v[2],2,us);if(!Q||!Tt)return null;if(!uh(Q.type,[js,zs,ko,Gc,us]))return j.error("Expected first argument to be of type boolean, string, number or null, but found "+dc(Q.type)+" instead");if(v.length===4){var Nt=j.parse(v[3],3,ko);return Nt?new fc(Q,Tt,Nt):null}else return new fc(Q,Tt)},fc.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!yh(j,["boolean","string","number","null"]))throw new ic("Expected first argument to be of type boolean, string, number or null, but found "+dc(_c(j))+" instead.");if(!yh(Q,["string","array"]))throw new ic("Expected second argument to be of type array or string, but found "+dc(_c(Q))+" instead.");if(this.fromIndex){var Tt=this.fromIndex.evaluate(v);return Q.indexOf(j,Tt)}return Q.indexOf(j)},fc.prototype.eachChild=function(v){v(this.needle),v(this.haystack),this.fromIndex&&v(this.fromIndex)},fc.prototype.outputDefined=function(){return!1},fc.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var v=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),v]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ih=function(v,j,Q,Tt,Nt,Yt){this.inputType=v,this.type=j,this.input=Q,this.cases=Tt,this.outputs=Nt,this.otherwise=Yt};Ih.parse=function(v,j){if(v.length<5)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if(v.length%2!==1)return j.error("Expected an even number of arguments.");var Q,Tt;j.expectedType&&j.expectedType.kind!=="value"&&(Tt=j.expectedType);for(var Nt={},Yt=[],se=2;seNumber.MAX_SAFE_INTEGER)return Tr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof xn=="number"&&Math.floor(xn)!==xn)return Tr.error("Numeric branch labels must be integer values.");if(!Q)Q=_c(xn);else if(Tr.checkSubtype(Q,_c(xn)))return null;if(typeof Nt[String(xn)]<"u")return Tr.error("Branch labels must be unique.");Nt[String(xn)]=Yt.length}var In=j.parse(nr,se,Tt);if(!In)return null;Tt=Tt||In.type,Yt.push(In)}var ii=j.parse(v[1],1,us);if(!ii)return null;var zi=j.parse(v[v.length-1],v.length-1,Tt);return!zi||ii.type.kind!=="value"&&j.concat(1).checkSubtype(Q,ii.type)?null:new Ih(Q,Tt,ii,Nt,Yt,zi)},Ih.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=_c(j)===this.inputType&&this.outputs[this.cases[j]]||this.otherwise;return Q.evaluate(v)},Ih.prototype.eachChild=function(v){v(this.input),this.outputs.forEach(v),v(this.otherwise)},Ih.prototype.outputDefined=function(){return this.outputs.every(function(v){return v.outputDefined()})&&this.otherwise.outputDefined()},Ih.prototype.serialize=function(){for(var v=this,j=["match",this.input.serialize()],Q=Object.keys(this.cases).sort(),Tt=[],Nt={},Yt=0,se=Q;Yt=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,us),Tt=j.parse(v[2],2,ko);if(!Q||!Tt)return null;if(!uh(Q.type,[cc(us),zs,us]))return j.error("Expected first argument to be of type array or string, but found "+dc(Q.type)+" instead");if(v.length===4){var Nt=j.parse(v[3],3,ko);return Nt?new Dh(Q.type,Q,Tt,Nt):null}else return new Dh(Q.type,Q,Tt)},Dh.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=this.beginIndex.evaluate(v);if(!yh(j,["string","array"]))throw new ic("Expected first argument to be of type array or string, but found "+dc(_c(j))+" instead.");if(this.endIndex){var Tt=this.endIndex.evaluate(v);return j.slice(Q,Tt)}return j.slice(Q)},Dh.prototype.eachChild=function(v){v(this.input),v(this.beginIndex),this.endIndex&&v(this.endIndex)},Dh.prototype.outputDefined=function(){return!1},Dh.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var v=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),v]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function sf(v,j){return v==="=="||v==="!="?j.kind==="boolean"||j.kind==="string"||j.kind==="number"||j.kind==="null"||j.kind==="value":j.kind==="string"||j.kind==="number"||j.kind==="value"}function br(v,j,Q){return j===Q}function Qr(v,j,Q){return j!==Q}function Nn(v,j,Q){return jQ}function di(v,j,Q){return j<=Q}function Pi(v,j,Q){return j>=Q}function ga(v,j,Q,Tt){return Tt.compare(j,Q)===0}function Pa(v,j,Q,Tt){return!ga(v,j,Q,Tt)}function Qa(v,j,Q,Tt){return Tt.compare(j,Q)<0}function uo(v,j,Q,Tt){return Tt.compare(j,Q)>0}function Sa(v,j,Q,Tt){return Tt.compare(j,Q)<=0}function Za(v,j,Q,Tt){return Tt.compare(j,Q)>=0}function Ra(v,j,Q){var Tt=v!=="=="&&v!=="!=";return function(){function Nt(Yt,se,Ue){this.type=js,this.lhs=Yt,this.rhs=se,this.collator=Ue,this.hasUntypedArgument=Yt.type.kind==="value"||se.type.kind==="value"}return Nt.parse=function(Yt,se){if(Yt.length!==3&&Yt.length!==4)return se.error("Expected two or three arguments.");var Ue=Yt[0],nr=se.parse(Yt[1],1,us);if(!nr)return null;if(!sf(Ue,nr.type))return se.concat(1).error('"'+Ue+`" comparisons are not supported for type '`+dc(nr.type)+"'.");var Tr=se.parse(Yt[2],2,us);if(!Tr)return null;if(!sf(Ue,Tr.type))return se.concat(2).error('"'+Ue+`" comparisons are not supported for type '`+dc(Tr.type)+"'.");if(nr.type.kind!==Tr.type.kind&&nr.type.kind!=="value"&&Tr.type.kind!=="value")return se.error("Cannot compare types '"+dc(nr.type)+"' and '"+dc(Tr.type)+"'.");Tt&&(nr.type.kind==="value"&&Tr.type.kind!=="value"?nr=new Hu(Tr.type,[nr]):nr.type.kind!=="value"&&Tr.type.kind==="value"&&(Tr=new Hu(nr.type,[Tr])));var jr=null;if(Yt.length===4){if(nr.type.kind!=="string"&&Tr.type.kind!=="string"&&nr.type.kind!=="value"&&Tr.type.kind!=="value")return se.error("Cannot use collator to compare non-string types.");if(jr=se.parse(Yt[3],3,iu),!jr)return null}return new Nt(nr,Tr,jr)},Nt.prototype.evaluate=function(Yt){var se=this.lhs.evaluate(Yt),Ue=this.rhs.evaluate(Yt);if(Tt&&this.hasUntypedArgument){var nr=_c(se),Tr=_c(Ue);if(nr.kind!==Tr.kind||!(nr.kind==="string"||nr.kind==="number"))throw new ic('Expected arguments for "'+v+'" to be (string, string) or (number, number), but found ('+nr.kind+", "+Tr.kind+") instead.")}if(this.collator&&!Tt&&this.hasUntypedArgument){var jr=_c(se),hn=_c(Ue);if(jr.kind!=="string"||hn.kind!=="string")return j(Yt,se,Ue)}return this.collator?Q(Yt,se,Ue,this.collator.evaluate(Yt)):j(Yt,se,Ue)},Nt.prototype.eachChild=function(Yt){Yt(this.lhs),Yt(this.rhs),this.collator&&Yt(this.collator)},Nt.prototype.outputDefined=function(){return!0},Nt.prototype.serialize=function(){var Yt=[v];return this.eachChild(function(se){Yt.push(se.serialize())}),Yt},Nt}()}var pa=Ra("==",br,ga),_o=Ra("!=",Qr,Pa),fs=Ra("<",Nn,Qa),os=Ra(">",An,uo),gs=Ra("<=",di,Sa),ws=Ra(">=",Pi,Za),bo=function(v,j,Q,Tt,Nt){this.type=zs,this.number=v,this.locale=j,this.currency=Q,this.minFractionDigits=Tt,this.maxFractionDigits=Nt};bo.parse=function(v,j){if(v.length!==3)return j.error("Expected two arguments.");var Q=j.parse(v[1],1,ko);if(!Q)return null;var Tt=v[2];if(typeof Tt!="object"||Array.isArray(Tt))return j.error("NumberFormat options argument must be an object.");var Nt=null;if(Tt.locale&&(Nt=j.parse(Tt.locale,1,zs),!Nt))return null;var Yt=null;if(Tt.currency&&(Yt=j.parse(Tt.currency,1,zs),!Yt))return null;var se=null;if(Tt["min-fraction-digits"]&&(se=j.parse(Tt["min-fraction-digits"],1,ko),!se))return null;var Ue=null;return Tt["max-fraction-digits"]&&(Ue=j.parse(Tt["max-fraction-digits"],1,ko),!Ue)?null:new bo(Q,Nt,Yt,se,Ue)},bo.prototype.evaluate=function(v){return new Intl.NumberFormat(this.locale?this.locale.evaluate(v):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(v):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(v):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(v):void 0}).format(this.number.evaluate(v))},bo.prototype.eachChild=function(v){v(this.number),this.locale&&v(this.locale),this.currency&&v(this.currency),this.minFractionDigits&&v(this.minFractionDigits),this.maxFractionDigits&&v(this.maxFractionDigits)},bo.prototype.outputDefined=function(){return!1},bo.prototype.serialize=function(){var v={};return this.locale&&(v.locale=this.locale.serialize()),this.currency&&(v.currency=this.currency.serialize()),this.minFractionDigits&&(v["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(v["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),v]};var lo=function(v){this.type=ko,this.input=v};lo.parse=function(v,j){if(v.length!==2)return j.error("Expected 1 argument, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1);return Q?Q.type.kind!=="array"&&Q.type.kind!=="string"&&Q.type.kind!=="value"?j.error("Expected argument of type string or array, but found "+dc(Q.type)+" instead."):new lo(Q):null},lo.prototype.evaluate=function(v){var j=this.input.evaluate(v);if(typeof j=="string"||Array.isArray(j))return j.length;throw new ic("Expected value to be of type string or array, but found "+dc(_c(j))+" instead.")},lo.prototype.eachChild=function(v){v(this.input)},lo.prototype.outputDefined=function(){return!1},lo.prototype.serialize=function(){var v=["length"];return this.eachChild(function(j){v.push(j.serialize())}),v};var ks={"==":pa,"!=":_o,">":os,"<":fs,">=":ws,"<=":gs,array:Hu,at:Ph,boolean:Hu,case:Td,coalesce:fh,collator:xh,format:Qh,image:Lc,in:Zc,"index-of":fc,interpolate:Au,"interpolate-hcl":Au,"interpolate-lab":Au,length:lo,let:Vh,literal:pl,match:Ih,number:Hu,"number-format":bo,object:Hu,slice:Dh,step:Qu,string:Hu,"to-boolean":hl,"to-color":hl,"to-number":hl,"to-string":hl,var:rd,within:Xu};function dl(v,j){var Q=j[0],Tt=j[1],Nt=j[2],Yt=j[3];Q=Q.evaluate(v),Tt=Tt.evaluate(v),Nt=Nt.evaluate(v);var se=Yt?Yt.evaluate(v):1,Ue=bu(Q,Tt,Nt,se);if(Ue)throw new ic(Ue);return new Gl(Q/255*se,Tt/255*se,Nt/255*se,se)}function Vl(v,j){return v in j}function gc(v,j){var Q=j[v];return typeof Q>"u"?null:Q}function ec(v,j,Q,Tt){for(;Q<=Tt;){var Nt=Q+Tt>>1;if(j[Nt]===v)return!0;j[Nt]>v?Tt=Nt-1:Q=Nt+1}return!1}function vc(v){return{type:v}}cs.register(ks,{error:[Rc,[zs],function(v,j){var Q=j[0];throw new ic(Q.evaluate(v))}],typeof:[zs,[us],function(v,j){var Q=j[0];return dc(_c(Q.evaluate(v)))}],"to-rgba":[cc(ko,4),[mc],function(v,j){var Q=j[0];return Q.evaluate(v).toArray()}],rgb:[mc,[ko,ko,ko],dl],rgba:[mc,[ko,ko,ko,ko],dl],has:{type:js,overloads:[[[zs],function(v,j){var Q=j[0];return Vl(Q.evaluate(v),v.properties())}],[[zs,Tl],function(v,j){var Q=j[0],Tt=j[1];return Vl(Q.evaluate(v),Tt.evaluate(v))}]]},get:{type:us,overloads:[[[zs],function(v,j){var Q=j[0];return gc(Q.evaluate(v),v.properties())}],[[zs,Tl],function(v,j){var Q=j[0],Tt=j[1];return gc(Q.evaluate(v),Tt.evaluate(v))}]]},"feature-state":[us,[zs],function(v,j){var Q=j[0];return gc(Q.evaluate(v),v.featureState||{})}],properties:[Tl,[],function(v){return v.properties()}],"geometry-type":[zs,[],function(v){return v.geometryType()}],id:[us,[],function(v){return v.id()}],zoom:[ko,[],function(v){return v.globals.zoom}],"heatmap-density":[ko,[],function(v){return v.globals.heatmapDensity||0}],"line-progress":[ko,[],function(v){return v.globals.lineProgress||0}],accumulated:[us,[],function(v){return v.globals.accumulated===void 0?null:v.globals.accumulated}],"+":[ko,vc(ko),function(v,j){for(var Q=0,Tt=0,Nt=j;Tt":[js,[zs,us],function(v,j){var Q=j[0],Tt=j[1],Nt=v.properties()[Q.value],Yt=Tt.value;return typeof Nt==typeof Yt&&Nt>Yt}],"filter-id->":[js,[us],function(v,j){var Q=j[0],Tt=v.id(),Nt=Q.value;return typeof Tt==typeof Nt&&Tt>Nt}],"filter-<=":[js,[zs,us],function(v,j){var Q=j[0],Tt=j[1],Nt=v.properties()[Q.value],Yt=Tt.value;return typeof Nt==typeof Yt&&Nt<=Yt}],"filter-id-<=":[js,[us],function(v,j){var Q=j[0],Tt=v.id(),Nt=Q.value;return typeof Tt==typeof Nt&&Tt<=Nt}],"filter->=":[js,[zs,us],function(v,j){var Q=j[0],Tt=j[1],Nt=v.properties()[Q.value],Yt=Tt.value;return typeof Nt==typeof Yt&&Nt>=Yt}],"filter-id->=":[js,[us],function(v,j){var Q=j[0],Tt=v.id(),Nt=Q.value;return typeof Tt==typeof Nt&&Tt>=Nt}],"filter-has":[js,[us],function(v,j){var Q=j[0];return Q.value in v.properties()}],"filter-has-id":[js,[],function(v){return v.id()!==null&&v.id()!==void 0}],"filter-type-in":[js,[cc(zs)],function(v,j){var Q=j[0];return Q.value.indexOf(v.geometryType())>=0}],"filter-id-in":[js,[cc(us)],function(v,j){var Q=j[0];return Q.value.indexOf(v.id())>=0}],"filter-in-small":[js,[zs,cc(us)],function(v,j){var Q=j[0],Tt=j[1];return Tt.value.indexOf(v.properties()[Q.value])>=0}],"filter-in-large":[js,[zs,cc(us)],function(v,j){var Q=j[0],Tt=j[1];return ec(v.properties()[Q.value],Tt.value,0,Tt.value.length-1)}],all:{type:js,overloads:[[[js,js],function(v,j){var Q=j[0],Tt=j[1];return Q.evaluate(v)&&Tt.evaluate(v)}],[vc(js),function(v,j){for(var Q=0,Tt=j;Q-1}function qo(v){return!!v.expression&&v.expression.interpolated}function Bs(v){return v instanceof Number?"number":v instanceof String?"string":v instanceof Boolean?"boolean":Array.isArray(v)?"array":v===null?"null":typeof v}function ac(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function Zl(v){return v}function Mu(v,j){var Q=j.type==="color",Tt=v.stops&&typeof v.stops[0][0]=="object",Nt=Tt||v.property!==void 0,Yt=Tt||!Nt,se=v.type||(qo(j)?"exponential":"interval");if(Q&&(v=lc({},v),v.stops&&(v.stops=v.stops.map(function(ts){return[ts[0],Gl.parse(ts[1])]})),v.default?v.default=Gl.parse(v.default):v.default=Gl.parse(j.default)),v.colorSpace&&v.colorSpace!=="rgb"&&!tp[v.colorSpace])throw new Error("Unknown color space: "+v.colorSpace);var Ue,nr,Tr;if(se==="exponential")Ue=rh;else if(se==="interval")Ue=Wh;else if(se==="categorical"){Ue=Vu,nr=Object.create(null);for(var jr=0,hn=v.stops;jr=v.stops[Tt-1][0])return v.stops[Tt-1][1];var Nt=ju(v.stops.map(function(Yt){return Yt[0]}),Q);return v.stops[Nt][1]}function rh(v,j,Q){var Tt=v.base!==void 0?v.base:1;if(Bs(Q)!=="number")return eh(v.default,j.default);var Nt=v.stops.length;if(Nt===1||Q<=v.stops[0][0])return v.stops[0][1];if(Q>=v.stops[Nt-1][0])return v.stops[Nt-1][1];var Yt=ju(v.stops.map(function(hn){return hn[0]}),Q),se=Wc(Q,Tt,v.stops[Yt][0],v.stops[Yt+1][0]),Ue=v.stops[Yt][1],nr=v.stops[Yt+1][1],Tr=nd[j.type]||Zl;if(v.colorSpace&&v.colorSpace!=="rgb"){var jr=tp[v.colorSpace];Tr=function(hn,xn){return jr.reverse(jr.interpolate(jr.forward(hn),jr.forward(xn),se))}}return typeof Ue.evaluate=="function"?{evaluate:function(){for(var hn=[],xn=arguments.length;xn--;)hn[xn]=arguments[xn];var In=Ue.evaluate.apply(void 0,hn),ii=nr.evaluate.apply(void 0,hn);if(!(In===void 0||ii===void 0))return Tr(In,ii,se)}}:Tr(Ue,nr,se)}function qh(v,j,Q){return j.type==="color"?Q=Gl.parse(Q):j.type==="formatted"?Q=xu.fromString(Q.toString()):j.type==="resolvedImage"?Q=mu.fromString(Q.toString()):Bs(Q)!==j.type&&(j.type!=="enum"||!j.values[Q])&&(Q=void 0),eh(Q,v.default,j.default)}function Wc(v,j,Q,Tt){var Nt=Tt-Q,Yt=v-Q;return Nt===0?0:j===1?Yt/Nt:(Math.pow(j,Yt)-1)/(Math.pow(j,Nt)-1)}var Gh=function(v,j){this.expression=v,this._warningHistory={},this._evaluator=new Hl,this._defaultValue=j?Ft(j):null,this._enumValues=j&&j.type==="enum"?j.values:null};Gh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Tt,Nt,Yt){return this._evaluator.globals=v,this._evaluator.feature=j,this._evaluator.featureState=Q,this._evaluator.canonical=Tt,this._evaluator.availableImages=Nt||null,this._evaluator.formattedSection=Yt,this.expression.evaluate(this._evaluator)},Gh.prototype.evaluate=function(v,j,Q,Tt,Nt,Yt){this._evaluator.globals=v,this._evaluator.feature=j||null,this._evaluator.featureState=Q||null,this._evaluator.canonical=Tt,this._evaluator.availableImages=Nt||null,this._evaluator.formattedSection=Yt||null;try{var se=this.expression.evaluate(this._evaluator);if(se==null||typeof se=="number"&&se!==se)return this._defaultValue;if(this._enumValues&&!(se in this._enumValues))throw new ic("Expected value to be one of "+Object.keys(this._enumValues).map(function(Ue){return JSON.stringify(Ue)}).join(", ")+", but found "+JSON.stringify(se)+" instead.");return se}catch(Ue){return this._warningHistory[Ue.message]||(this._warningHistory[Ue.message]=!0,typeof console<"u"&&console.warn(Ue.message)),this._defaultValue}};function ds(v){return Array.isArray(v)&&v.length>0&&typeof v[0]=="string"&&v[0]in ks}function $s(v,j){var Q=new xc(ks,[],j?Dt(j):void 0),Tt=Q.parse(v,void 0,void 0,void 0,j&&j.type==="string"?{typeAnnotation:"coerce"}:void 0);return Tt?El(new Gh(Tt,j)):tu(Q.errors)}var nh=function(v,j){this.kind=v,this._styleExpression=j,this.isStateDependent=v!=="constant"&&!Vc(j.expression)};nh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Tt,Nt,Yt)},nh.prototype.evaluate=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluate(v,j,Q,Tt,Nt,Yt)};var eu=function(v,j,Q,Tt){this.kind=v,this.zoomStops=Q,this._styleExpression=j,this.isStateDependent=v!=="camera"&&!Vc(j.expression),this.interpolationType=Tt};eu.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Tt,Nt,Yt)},eu.prototype.evaluate=function(v,j,Q,Tt,Nt,Yt){return this._styleExpression.evaluate(v,j,Q,Tt,Nt,Yt)},eu.prototype.interpolationFactor=function(v,j,Q){return this.interpolationType?Au.interpolationFactor(this.interpolationType,v,j,Q):0};function lf(v,j){if(v=$s(v,j),v.result==="error")return v;var Q=v.value.expression,Tt=mf(Q);if(!Tt&&!$c(j))return tu([new yl("","data expressions not supported")]);var Nt=Ju(Q,["zoom"]);if(!Nt&&!bc(j))return tu([new yl("","zoom expressions not supported")]);var Yt=pt(Q);if(!Yt&&!Nt)return tu([new yl("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Yt instanceof yl)return tu([Yt]);if(Yt instanceof Au&&!qo(j))return tu([new yl("",'"interpolate" expressions cannot be used with this property')]);if(!Yt)return El(Tt?new nh("constant",v.value):new nh("source",v.value));var se=Yt instanceof Au?Yt.interpolation:void 0;return El(Tt?new eu("camera",v.value,Yt.labels,se):new eu("composite",v.value,Yt.labels,se))}var Kt=function(v,j){this._parameters=v,this._specification=j,lc(this,Mu(this._parameters,this._specification))};Kt.deserialize=function(v){return new Kt(v._parameters,v._specification)},Kt.serialize=function(v){return{_parameters:v._parameters,_specification:v._specification}};function O(v,j){if(ac(v))return new Kt(v,j);if(ds(v)){var Q=lf(v,j);if(Q.result==="error")throw new Error(Q.value.map(function(Nt){return Nt.key+": "+Nt.message}).join(", "));return Q.value}else{var Tt=v;return typeof v=="string"&&j.type==="color"&&(Tt=Gl.parse(v)),{kind:"constant",evaluate:function(){return Tt}}}}function pt(v){var j=null;if(v instanceof Vh)j=pt(v.result);else if(v instanceof fh)for(var Q=0,Tt=v.args;QTt.maximum?[new Co(j,Q,Q+" is greater than the maximum value "+Tt.maximum)]:[]}function er(v){var j=v.valueSpec,Q=ss(v.value.type),Tt,Nt={},Yt,se,Ue=Q!=="categorical"&&v.value.property===void 0,nr=!Ue,Tr=Bs(v.value.stops)==="array"&&Bs(v.value.stops[0])==="array"&&Bs(v.value.stops[0][0])==="object",jr=qt({key:v.key,value:v.value,valueSpec:v.styleSpec.function,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{stops:hn,default:ii}});return Q==="identity"&&Ue&&jr.push(new Co(v.key,v.value,'missing required property "property"')),Q!=="identity"&&!v.value.stops&&jr.push(new Co(v.key,v.value,'missing required property "stops"')),Q==="exponential"&&v.valueSpec.expression&&!qo(v.valueSpec)&&jr.push(new Co(v.key,v.value,"exponential functions not supported")),v.styleSpec.$version>=8&&(nr&&!$c(v.valueSpec)?jr.push(new Co(v.key,v.value,"property functions not supported")):Ue&&!bc(v.valueSpec)&&jr.push(new Co(v.key,v.value,"zoom functions not supported"))),(Q==="categorical"||Tr)&&v.value.property===void 0&&jr.push(new Co(v.key,v.value,'"property" property is required')),jr;function hn(zi){if(Q==="identity")return[new Co(zi.key,zi.value,'identity function may not have a "stops" property')];var ka=[],ya=zi.value;return ka=ka.concat(Ee({key:zi.key,value:ya,valueSpec:zi.valueSpec,style:zi.style,styleSpec:zi.styleSpec,arrayElementValidator:xn})),Bs(ya)==="array"&&ya.length===0&&ka.push(new Co(zi.key,ya,"array must have at least one stop")),ka}function xn(zi){var ka=[],ya=zi.value,Ba=zi.key;if(Bs(ya)!=="array")return[new Co(Ba,ya,"array expected, "+Bs(ya)+" found")];if(ya.length!==2)return[new Co(Ba,ya,"array length 2 expected, length "+ya.length+" found")];if(Tr){if(Bs(ya[0])!=="object")return[new Co(Ba,ya,"object expected, "+Bs(ya[0])+" found")];if(ya[0].zoom===void 0)return[new Co(Ba,ya,"object stop key must have zoom")];if(ya[0].value===void 0)return[new Co(Ba,ya,"object stop key must have value")];if(se&&se>ss(ya[0].zoom))return[new Co(Ba,ya[0].zoom,"stop zoom values must appear in ascending order")];ss(ya[0].zoom)!==se&&(se=ss(ya[0].zoom),Yt=void 0,Nt={}),ka=ka.concat(qt({key:Ba+"[0]",value:ya[0],valueSpec:{zoom:{}},style:zi.style,styleSpec:zi.styleSpec,objectElementValidators:{zoom:je,value:In}}))}else ka=ka.concat(In({key:Ba+"[0]",value:ya[0],style:zi.style,styleSpec:zi.styleSpec},ya));return ds(nc(ya[1]))?ka.concat([new Co(Ba+"[1]",ya[1],"expressions are not allowed in function stops.")]):ka.concat(Ll({key:Ba+"[1]",value:ya[1],valueSpec:j,style:zi.style,styleSpec:zi.styleSpec}))}function In(zi,ka){var ya=Bs(zi.value),Ba=ss(zi.value),Ja=zi.value!==null?zi.value:ka;if(!Tt)Tt=ya;else if(ya!==Tt)return[new Co(zi.key,Ja,ya+" stop domain type must match previous stop domain type "+Tt)];if(ya!=="number"&&ya!=="string"&&ya!=="boolean")return[new Co(zi.key,Ja,"stop domain value must be a number, string, or boolean")];if(ya!=="number"&&Q!=="categorical"){var Da="number expected, "+ya+" found";return $c(j)&&Q===void 0&&(Da+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Co(zi.key,Ja,Da)]}return Q==="categorical"&&ya==="number"&&(!isFinite(Ba)||Math.floor(Ba)!==Ba)?[new Co(zi.key,Ja,"integer expected, found "+Ba)]:Q!=="categorical"&&ya==="number"&&Yt!==void 0&&Ba=2&&v[1]!=="$id"&&v[1]!=="$type";case"in":return v.length>=3&&(typeof v[1]!="string"||Array.isArray(v[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return v.length!==3||Array.isArray(v[1])||Array.isArray(v[2]);case"any":case"all":for(var j=0,Q=v.slice(1);jj?1:0}function Pe(v){if(!Array.isArray(v))return!1;if(v[0]==="within")return!0;for(var j=1;j"||j==="<="||j===">="?Ne(v[1],v[2],j):j==="any"?Xe(v.slice(1)):j==="all"?["all"].concat(v.slice(1).map(We)):j==="none"?["all"].concat(v.slice(1).map(We).map(Xr)):j==="in"?Pr(v[1],v.slice(2)):j==="!in"?Xr(Pr(v[1],v.slice(2))):j==="has"?qr(v[1]):j==="!has"?Xr(qr(v[1])):j==="within"?v:!0;return Q}function Ne(v,j,Q){switch(v){case"$type":return["filter-type-"+Q,j];case"$id":return["filter-id-"+Q,j];default:return["filter-"+Q,v,j]}}function Xe(v){return["any"].concat(v.map(We))}function Pr(v,j){if(j.length===0)return!1;switch(v){case"$type":return["filter-type-in",["literal",j]];case"$id":return["filter-id-in",["literal",j]];default:return j.length>200&&!j.some(function(Q){return typeof Q!=typeof j[0]})?["filter-in-large",v,["literal",j.sort(Te)]]:["filter-in-small",v,["literal",j]]}}function qr(v){switch(v){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",v]}}function Xr(v){return["!",v]}function gn(v){return qn(nc(v.value))?wr(lc({},v,{expressionContext:"filter",valueSpec:{value:"boolean"}})):zn(v)}function zn(v){var j=v.value,Q=v.key;if(Bs(j)!=="array")return[new Co(Q,j,"array expected, "+Bs(j)+" found")];var Tt=v.styleSpec,Nt,Yt=[];if(j.length<1)return[new Co(Q,j,"filter array must have at least 1 element")];switch(Yt=Yt.concat(Tn({key:Q+"[0]",value:j[0],valueSpec:Tt.filter_operator,style:v.style,styleSpec:v.styleSpec})),ss(j[0])){case"<":case"<=":case">":case">=":j.length>=2&&ss(j[1])==="$type"&&Yt.push(new Co(Q,j,'"$type" cannot be use with operator "'+j[0]+'"'));case"==":case"!=":j.length!==3&&Yt.push(new Co(Q,j,'filter array for operator "'+j[0]+'" must have 3 elements'));case"in":case"!in":j.length>=2&&(Nt=Bs(j[1]),Nt!=="string"&&Yt.push(new Co(Q+"[1]",j[1],"string expected, "+Nt+" found")));for(var se=2;se=jr[In+0]&&Tt>=jr[In+1])?(se[xn]=!0,Yt.push(Tr[xn])):se[xn]=!1}}},de.prototype._forEachCell=function(v,j,Q,Tt,Nt,Yt,se,Ue){for(var nr=this._convertToCellCoord(v),Tr=this._convertToCellCoord(j),jr=this._convertToCellCoord(Q),hn=this._convertToCellCoord(Tt),xn=nr;xn<=jr;xn++)for(var In=Tr;In<=hn;In++){var ii=this.d*In+xn;if(!(Ue&&!Ue(this._convertFromCellCoord(xn),this._convertFromCellCoord(In),this._convertFromCellCoord(xn+1),this._convertFromCellCoord(In+1)))&&Nt.call(this,v,j,Q,Tt,ii,Yt,se,Ue))return}},de.prototype._convertFromCellCoord=function(v){return(v-this.padding)/this.scale},de.prototype._convertToCellCoord=function(v){return Math.max(0,Math.min(this.d-1,Math.floor(v*this.scale)+this.padding))},de.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var v=this.cells,j=Vt+this.cells.length+1+1,Q=0,Tt=0;Tt=0)){var hn=v[jr];Tr[jr]=He[nr].shallow.indexOf(jr)>=0?hn:fn(hn,j)}v instanceof Error&&(Tr.message=v.message)}if(Tr.$name)throw new Error("$name property is reserved for worker serialization logic.");return nr!=="Object"&&(Tr.$name=nr),Tr}throw new Error("can't serialize object of type "+typeof v)}function Bn(v){if(v==null||typeof v=="boolean"||typeof v=="number"||typeof v=="string"||v instanceof Boolean||v instanceof Number||v instanceof String||v instanceof Date||v instanceof RegExp||Fr(v)||vn(v)||ArrayBuffer.isView(v)||v instanceof Ie)return v;if(Array.isArray(v))return v.map(Bn);if(typeof v=="object"){var j=v.$name||"Object",Q=He[j],Tt=Q.klass;if(!Tt)throw new Error("can't deserialize unregistered class "+j);if(Tt.deserialize)return Tt.deserialize(v);for(var Nt=Object.create(Tt.prototype),Yt=0,se=Object.keys(v);Yt=0?nr:Bn(nr)}}return Nt}throw new Error("can't deserialize object of type "+typeof v)}var ti=function(){this.first=!0};ti.prototype.update=function(v,j){var Q=Math.floor(v);return this.first?(this.first=!1,this.lastIntegerZoom=Q,this.lastIntegerZoomTime=0,this.lastZoom=v,this.lastFloorZoom=Q,!0):(this.lastFloorZoom>Q?(this.lastIntegerZoom=Q+1,this.lastIntegerZoomTime=j):this.lastFloorZoom=128&&v<=255},Arabic:function(v){return v>=1536&&v<=1791},"Arabic Supplement":function(v){return v>=1872&&v<=1919},"Arabic Extended-A":function(v){return v>=2208&&v<=2303},"Hangul Jamo":function(v){return v>=4352&&v<=4607},"Unified Canadian Aboriginal Syllabics":function(v){return v>=5120&&v<=5759},Khmer:function(v){return v>=6016&&v<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(v){return v>=6320&&v<=6399},"General Punctuation":function(v){return v>=8192&&v<=8303},"Letterlike Symbols":function(v){return v>=8448&&v<=8527},"Number Forms":function(v){return v>=8528&&v<=8591},"Miscellaneous Technical":function(v){return v>=8960&&v<=9215},"Control Pictures":function(v){return v>=9216&&v<=9279},"Optical Character Recognition":function(v){return v>=9280&&v<=9311},"Enclosed Alphanumerics":function(v){return v>=9312&&v<=9471},"Geometric Shapes":function(v){return v>=9632&&v<=9727},"Miscellaneous Symbols":function(v){return v>=9728&&v<=9983},"Miscellaneous Symbols and Arrows":function(v){return v>=11008&&v<=11263},"CJK Radicals Supplement":function(v){return v>=11904&&v<=12031},"Kangxi Radicals":function(v){return v>=12032&&v<=12255},"Ideographic Description Characters":function(v){return v>=12272&&v<=12287},"CJK Symbols and Punctuation":function(v){return v>=12288&&v<=12351},Hiragana:function(v){return v>=12352&&v<=12447},Katakana:function(v){return v>=12448&&v<=12543},Bopomofo:function(v){return v>=12544&&v<=12591},"Hangul Compatibility Jamo":function(v){return v>=12592&&v<=12687},Kanbun:function(v){return v>=12688&&v<=12703},"Bopomofo Extended":function(v){return v>=12704&&v<=12735},"CJK Strokes":function(v){return v>=12736&&v<=12783},"Katakana Phonetic Extensions":function(v){return v>=12784&&v<=12799},"Enclosed CJK Letters and Months":function(v){return v>=12800&&v<=13055},"CJK Compatibility":function(v){return v>=13056&&v<=13311},"CJK Unified Ideographs Extension A":function(v){return v>=13312&&v<=19903},"Yijing Hexagram Symbols":function(v){return v>=19904&&v<=19967},"CJK Unified Ideographs":function(v){return v>=19968&&v<=40959},"Yi Syllables":function(v){return v>=40960&&v<=42127},"Yi Radicals":function(v){return v>=42128&&v<=42191},"Hangul Jamo Extended-A":function(v){return v>=43360&&v<=43391},"Hangul Syllables":function(v){return v>=44032&&v<=55215},"Hangul Jamo Extended-B":function(v){return v>=55216&&v<=55295},"Private Use Area":function(v){return v>=57344&&v<=63743},"CJK Compatibility Ideographs":function(v){return v>=63744&&v<=64255},"Arabic Presentation Forms-A":function(v){return v>=64336&&v<=65023},"Vertical Forms":function(v){return v>=65040&&v<=65055},"CJK Compatibility Forms":function(v){return v>=65072&&v<=65103},"Small Form Variants":function(v){return v>=65104&&v<=65135},"Arabic Presentation Forms-B":function(v){return v>=65136&&v<=65279},"Halfwidth and Fullwidth Forms":function(v){return v>=65280&&v<=65519}};function ra(v){for(var j=0,Q=v;j=65097&&v<=65103)||ei["CJK Compatibility Ideographs"](v)||ei["CJK Compatibility"](v)||ei["CJK Radicals Supplement"](v)||ei["CJK Strokes"](v)||ei["CJK Symbols and Punctuation"](v)&&!(v>=12296&&v<=12305)&&!(v>=12308&&v<=12319)&&v!==12336||ei["CJK Unified Ideographs Extension A"](v)||ei["CJK Unified Ideographs"](v)||ei["Enclosed CJK Letters and Months"](v)||ei["Hangul Compatibility Jamo"](v)||ei["Hangul Jamo Extended-A"](v)||ei["Hangul Jamo Extended-B"](v)||ei["Hangul Jamo"](v)||ei["Hangul Syllables"](v)||ei.Hiragana(v)||ei["Ideographic Description Characters"](v)||ei.Kanbun(v)||ei["Kangxi Radicals"](v)||ei["Katakana Phonetic Extensions"](v)||ei.Katakana(v)&&v!==12540||ei["Halfwidth and Fullwidth Forms"](v)&&v!==65288&&v!==65289&&v!==65293&&!(v>=65306&&v<=65310)&&v!==65339&&v!==65341&&v!==65343&&!(v>=65371&&v<=65503)&&v!==65507&&!(v>=65512&&v<=65519)||ei["Small Form Variants"](v)&&!(v>=65112&&v<=65118)&&!(v>=65123&&v<=65126)||ei["Unified Canadian Aboriginal Syllabics"](v)||ei["Unified Canadian Aboriginal Syllabics Extended"](v)||ei["Vertical Forms"](v)||ei["Yijing Hexagram Symbols"](v)||ei["Yi Syllables"](v)||ei["Yi Radicals"](v))}function sa(v){return!!(ei["Latin-1 Supplement"](v)&&(v===167||v===169||v===174||v===177||v===188||v===189||v===190||v===215||v===247)||ei["General Punctuation"](v)&&(v===8214||v===8224||v===8225||v===8240||v===8241||v===8251||v===8252||v===8258||v===8263||v===8264||v===8265||v===8273)||ei["Letterlike Symbols"](v)||ei["Number Forms"](v)||ei["Miscellaneous Technical"](v)&&(v>=8960&&v<=8967||v>=8972&&v<=8991||v>=8996&&v<=9e3||v===9003||v>=9085&&v<=9114||v>=9150&&v<=9165||v===9167||v>=9169&&v<=9179||v>=9186&&v<=9215)||ei["Control Pictures"](v)&&v!==9251||ei["Optical Character Recognition"](v)||ei["Enclosed Alphanumerics"](v)||ei["Geometric Shapes"](v)||ei["Miscellaneous Symbols"](v)&&!(v>=9754&&v<=9759)||ei["Miscellaneous Symbols and Arrows"](v)&&(v>=11026&&v<=11055||v>=11088&&v<=11097||v>=11192&&v<=11243)||ei["CJK Symbols and Punctuation"](v)||ei.Katakana(v)||ei["Private Use Area"](v)||ei["CJK Compatibility Forms"](v)||ei["Small Form Variants"](v)||ei["Halfwidth and Fullwidth Forms"](v)||v===8734||v===8756||v===8757||v>=9984&&v<=10087||v>=10102&&v<=10131||v===65532||v===65533)}function vi(v){return!(Ki(v)||sa(v))}function no(v){return ei.Arabic(v)||ei["Arabic Supplement"](v)||ei["Arabic Extended-A"](v)||ei["Arabic Presentation Forms-A"](v)||ei["Arabic Presentation Forms-B"](v)}function ao(v){return v>=1424&&v<=2303||ei["Arabic Presentation Forms-A"](v)||ei["Arabic Presentation Forms-B"](v)}function xo(v,j){return!(!j&&ao(v)||v>=2304&&v<=3583||v>=3840&&v<=4255||ei.Khmer(v))}function $o(v){for(var j=0,Q=v;j-1&&(as=rs.error),_l&&_l(v)};function ou(){wc.fire(new sn("pluginStateChange",{pluginStatus:as,pluginURL:Ts}))}var wc=new Yr,zo=function(){return as},il=function(v){return v({pluginStatus:as,pluginURL:Ts}),wc.on("pluginStateChange",v),v},ml=function(v,j,Q){if(Q===void 0&&(Q=!1),as===rs.deferred||as===rs.loading||as===rs.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ts=Rt.resolveURL(v),as=rs.deferred,_l=j,ou(),Q||yc()},yc=function(){if(as!==rs.deferred||!Ts)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");as=rs.loading,ou(),Ts&&Un({url:Ts},function(v){v?Bl(v):(as=rs.loaded,ou())})},oc={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return as===rs.loaded||oc.applyArabicShaping!=null},isLoading:function(){return as===rs.loading},setState:function(v){as=v.pluginStatus,Ts=v.pluginURL},isParsed:function(){return oc.applyArabicShaping!=null&&oc.processBidirectionalText!=null&&oc.processStyledBidirectionalText!=null},getPluginURL:function(){return Ts}},ph=function(){!oc.isLoading()&&!oc.isLoaded()&&zo()==="deferred"&&yc()},Yl=function(v,j){this.zoom=v,j?(this.now=j.now,this.fadeDuration=j.fadeDuration,this.zoomHistory=j.zoomHistory,this.transition=j.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ti,this.transition={})};Yl.prototype.isSupportedScript=function(v){return Ko(v,oc.isLoaded())},Yl.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Yl.prototype.getCrossfadeParameters=function(){var v=this.zoom,j=v-Math.floor(v),Q=this.crossFadingFactor();return v>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:j+(1-j)*Q}:{fromScale:.5,toScale:1,t:1-(1-Q)*j}};var hc=function(v,j){this.property=v,this.value=j,this.expression=O(j===void 0?v.specification.default:j,v.specification)};hc.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},hc.prototype.possiblyEvaluate=function(v,j,Q){return this.property.possiblyEvaluate(this,v,j,Q)};var zh=function(v){this.property=v,this.value=new hc(v,void 0)};zh.prototype.transitioned=function(v,j){return new Ir(this.property,this.value,j,I({},v.transition,this.transition),v.now)},zh.prototype.untransitioned=function(){return new Ir(this.property,this.value,null,{},0)};var Se=function(v){this._properties=v,this._values=Object.create(v.defaultTransitionablePropertyValues)};Se.prototype.getValue=function(v){return F(this._values[v].value.value)},Se.prototype.setValue=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].value=new hc(this._values[v].property,j===null?void 0:F(j))},Se.prototype.getTransition=function(v){return F(this._values[v].transition)},Se.prototype.setTransition=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].transition=F(j)||void 0},Se.prototype.serialize=function(){for(var v={},j=0,Q=Object.keys(this._values);jthis.end)return this.prior=null,Nt;if(this.value.isDataDriven())return this.prior=null,Nt;if(TtYt.zoomHistory.lastIntegerZoom?{from:Q,to:Tt}:{from:Nt,to:Tt}},j.prototype.interpolate=function(Q){return Q},j}(Si),aa=function(v){this.specification=v};aa.prototype.possiblyEvaluate=function(v,j,Q,Tt){if(v.value!==void 0)if(v.expression.kind==="constant"){var Nt=v.expression.evaluate(j,null,{},Q,Tt);return this._calculate(Nt,Nt,Nt,j)}else return this._calculate(v.expression.evaluate(new Yl(Math.floor(j.zoom-1),j)),v.expression.evaluate(new Yl(Math.floor(j.zoom),j)),v.expression.evaluate(new Yl(Math.floor(j.zoom+1),j)),j)},aa.prototype._calculate=function(v,j,Q,Tt){var Nt=Tt.zoom;return Nt>Tt.zoomHistory.lastIntegerZoom?{from:v,to:j}:{from:Q,to:j}},aa.prototype.interpolate=function(v){return v};var Ia=function(v){this.specification=v};Ia.prototype.possiblyEvaluate=function(v,j,Q,Tt){return!!v.expression.evaluate(j,null,{},Q,Tt)},Ia.prototype.interpolate=function(){return!1};var co=function(v){this.properties=v,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var j in v){var Q=v[j];Q.specification.overridable&&this.overridableProperties.push(j);var Tt=this.defaultPropertyValues[j]=new hc(Q,void 0),Nt=this.defaultTransitionablePropertyValues[j]=new zh(Q);this.defaultTransitioningPropertyValues[j]=Nt.untransitioned(),this.defaultPossiblyEvaluatedValues[j]=Tt.possiblyEvaluate({})}};hr("DataDrivenProperty",Si),hr("DataConstantProperty",On),hr("CrossFadedDataDrivenProperty",ha),hr("CrossFadedProperty",aa),hr("ColorRampProperty",Ia);var eo="-transition",ma=function(v){function j(Q,Tt){if(v.call(this),this.id=Q.id,this.type=Q.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},Q.type!=="custom"&&(Q=Q,this.metadata=Q.metadata,this.minzoom=Q.minzoom,this.maxzoom=Q.maxzoom,Q.type!=="background"&&(this.source=Q.source,this.sourceLayer=Q["source-layer"],this.filter=Q.filter),Tt.layout&&(this._unevaluatedLayout=new ri(Tt.layout)),Tt.paint)){this._transitionablePaint=new Se(Tt.paint);for(var Nt in Q.paint)this.setPaintProperty(Nt,Q.paint[Nt],{validate:!1});for(var Yt in Q.layout)this.setLayoutProperty(Yt,Q.layout[Yt],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new bi(Tt.paint)}}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},j.prototype.getLayoutProperty=function(Q){return Q==="visibility"?this.visibility:this._unevaluatedLayout.getValue(Q)},j.prototype.setLayoutProperty=function(Q,Tt,Nt){if(Nt===void 0&&(Nt={}),Tt!=null){var Yt="layers."+this.id+".layout."+Q;if(this._validate(wu,Yt,Q,Tt,Nt))return}if(Q==="visibility"){this.visibility=Tt;return}this._unevaluatedLayout.setValue(Q,Tt)},j.prototype.getPaintProperty=function(Q){return U(Q,eo)?this._transitionablePaint.getTransition(Q.slice(0,-eo.length)):this._transitionablePaint.getValue(Q)},j.prototype.setPaintProperty=function(Q,Tt,Nt){if(Nt===void 0&&(Nt={}),Tt!=null){var Yt="layers."+this.id+".paint."+Q;if(this._validate(au,Yt,Q,Tt,Nt))return!1}if(U(Q,eo))return this._transitionablePaint.setTransition(Q.slice(0,-eo.length),Tt||void 0),!1;var se=this._transitionablePaint._values[Q],Ue=se.property.specification["property-type"]==="cross-faded-data-driven",nr=se.value.isDataDriven(),Tr=se.value;this._transitionablePaint.setValue(Q,Tt),this._handleSpecialPaintPropertyUpdate(Q);var jr=this._transitionablePaint._values[Q].value,hn=jr.isDataDriven();return hn||nr||Ue||this._handleOverridablePaintPropertyUpdate(Q,Tr,jr)},j.prototype._handleSpecialPaintPropertyUpdate=function(Q){},j.prototype._handleOverridablePaintPropertyUpdate=function(Q,Tt,Nt){return!1},j.prototype.isHidden=function(Q){return this.minzoom&&Q=this.maxzoom?!0:this.visibility==="none"},j.prototype.updateTransitions=function(Q){this._transitioningPaint=this._transitionablePaint.transitioned(Q,this._transitioningPaint)},j.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},j.prototype.recalculate=function(Q,Tt){Q.getCrossfadeParameters&&(this._crossfadeParameters=Q.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(Q,void 0,Tt)),this.paint=this._transitioningPaint.possiblyEvaluate(Q,void 0,Tt)},j.prototype.serialize=function(){var Q={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&&(Q.layout=Q.layout||{},Q.layout.visibility=this.visibility),W(Q,function(Tt,Nt){return Tt!==void 0&&!(Nt==="layout"&&!Object.keys(Tt).length)&&!(Nt==="paint"&&!Object.keys(Tt).length)})},j.prototype._validate=function(Q,Tt,Nt,Yt,se){return se===void 0&&(se={}),se&&se.validate===!1?!1:ih(this,Q.call(rl,{key:Tt,layerType:this.type,objectKey:Nt,value:Yt,styleSpec:Wa,style:{glyphs:!0,sprite:!0}}))},j.prototype.is3D=function(){return!1},j.prototype.isTileClipped=function(){return!1},j.prototype.hasOffscreenPass=function(){return!1},j.prototype.resize=function(){},j.prototype.isStateDependent=function(){for(var Q in this.paint._values){var Tt=this.paint.get(Q);if(!(!(Tt instanceof Ai)||!$c(Tt.property.specification))&&(Tt.value.kind==="source"||Tt.value.kind==="composite")&&Tt.value.isStateDependent)return!0}return!1},j}(Yr),ji={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},En=function(v,j){this._structArray=v,this._pos1=j*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},oi=128,Yi=5,Ni=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Ni.serialize=function(v,j){return v._trim(),j&&(v.isTransferred=!0,j.push(v.arrayBuffer)),{length:v.length,arrayBuffer:v.arrayBuffer}},Ni.deserialize=function(v){var j=Object.create(this.prototype);return j.arrayBuffer=v.arrayBuffer,j.length=v.length,j.capacity=v.arrayBuffer.byteLength/j.bytesPerElement,j._refreshViews(),j},Ni.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ni.prototype.clear=function(){this.length=0},Ni.prototype.resize=function(v){this.reserve(v),this.length=v},Ni.prototype.reserve=function(v){if(v>this.capacity){this.capacity=Math.max(v,Math.floor(this.capacity*Yi),oi),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var j=this.uint8;this._refreshViews(),j&&this.uint8.set(j)}},Ni.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function wi(v,j){j===void 0&&(j=1);var Q=0,Tt=0,Nt=v.map(function(se){var Ue=Ua(se.type),nr=Q=Ca(Q,Math.max(j,Ue)),Tr=se.components||1;return Tt=Math.max(Tt,Ue),Q+=Ue*Tr,{name:se.name,type:se.type,components:Tr,offset:nr}}),Yt=Ca(Q,Math.max(Tt,j));return{members:Nt,size:Yt,alignment:j}}function Ua(v){return ji[v].BYTES_PER_ELEMENT}function Ca(v,j){return Math.ceil(v/j)*j}var io=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt){var Nt=this.length;return this.resize(Nt+1),this.emplace(Nt,Q,Tt)},j.prototype.emplace=function(Q,Tt,Nt){var Yt=Q*2;return this.int16[Yt+0]=Tt,this.int16[Yt+1]=Nt,Q},j}(Ni);io.prototype.bytesPerElement=4,hr("StructArrayLayout2i4",io);var Ri=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt){var se=this.length;return this.resize(se+1),this.emplace(se,Q,Tt,Nt,Yt)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se){var Ue=Q*4;return this.int16[Ue+0]=Tt,this.int16[Ue+1]=Nt,this.int16[Ue+2]=Yt,this.int16[Ue+3]=se,Q},j}(Ni);Ri.prototype.bytesPerElement=8,hr("StructArrayLayout4i8",Ri);var ki=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue){var nr=this.length;return this.resize(nr+1),this.emplace(nr,Q,Tt,Nt,Yt,se,Ue)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Q*6;return this.int16[Tr+0]=Tt,this.int16[Tr+1]=Nt,this.int16[Tr+2]=Yt,this.int16[Tr+3]=se,this.int16[Tr+4]=Ue,this.int16[Tr+5]=nr,Q},j}(Ni);ki.prototype.bytesPerElement=12,hr("StructArrayLayout2i4i12",ki);var $a=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue){var nr=this.length;return this.resize(nr+1),this.emplace(nr,Q,Tt,Nt,Yt,se,Ue)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Q*4,jr=Q*8;return this.int16[Tr+0]=Tt,this.int16[Tr+1]=Nt,this.uint8[jr+4]=Yt,this.uint8[jr+5]=se,this.uint8[jr+6]=Ue,this.uint8[jr+7]=nr,Q},j}(Ni);$a.prototype.bytesPerElement=8,hr("StructArrayLayout2i4ub8",$a);var Ea=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt){var Nt=this.length;return this.resize(Nt+1),this.emplace(Nt,Q,Tt)},j.prototype.emplace=function(Q,Tt,Nt){var Yt=Q*2;return this.float32[Yt+0]=Tt,this.float32[Yt+1]=Nt,Q},j}(Ni);Ea.prototype.bytesPerElement=8,hr("StructArrayLayout2f8",Ea);var la=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn){var xn=this.length;return this.resize(xn+1),this.emplace(xn,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn){var In=Q*10;return this.uint16[In+0]=Tt,this.uint16[In+1]=Nt,this.uint16[In+2]=Yt,this.uint16[In+3]=se,this.uint16[In+4]=Ue,this.uint16[In+5]=nr,this.uint16[In+6]=Tr,this.uint16[In+7]=jr,this.uint16[In+8]=hn,this.uint16[In+9]=xn,Q},j}(Ni);la.prototype.bytesPerElement=20,hr("StructArrayLayout10ui20",la);var ua=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In){var ii=this.length;return this.resize(ii+1),this.emplace(ii,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii){var zi=Q*12;return this.int16[zi+0]=Tt,this.int16[zi+1]=Nt,this.int16[zi+2]=Yt,this.int16[zi+3]=se,this.uint16[zi+4]=Ue,this.uint16[zi+5]=nr,this.uint16[zi+6]=Tr,this.uint16[zi+7]=jr,this.int16[zi+8]=hn,this.int16[zi+9]=xn,this.int16[zi+10]=In,this.int16[zi+11]=ii,Q},j}(Ni);ua.prototype.bytesPerElement=24,hr("StructArrayLayout4i4ui4i24",ua);var Oa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*3;return this.float32[se+0]=Tt,this.float32[se+1]=Nt,this.float32[se+2]=Yt,Q},j}(Ni);Oa.prototype.bytesPerElement=12,hr("StructArrayLayout3f12",Oa);var Vo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Tt=this.length;return this.resize(Tt+1),this.emplace(Tt,Q)},j.prototype.emplace=function(Q,Tt){var Nt=Q*1;return this.uint32[Nt+0]=Tt,Q},j}(Ni);Vo.prototype.bytesPerElement=4,hr("StructArrayLayout1ul4",Vo);var Bo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr){var hn=this.length;return this.resize(hn+1),this.emplace(hn,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn){var xn=Q*10,In=Q*5;return this.int16[xn+0]=Tt,this.int16[xn+1]=Nt,this.int16[xn+2]=Yt,this.int16[xn+3]=se,this.int16[xn+4]=Ue,this.int16[xn+5]=nr,this.uint32[In+3]=Tr,this.uint16[xn+8]=jr,this.uint16[xn+9]=hn,Q},j}(Ni);Bo.prototype.bytesPerElement=20,hr("StructArrayLayout6i1ul2ui20",Bo);var za=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue){var nr=this.length;return this.resize(nr+1),this.emplace(nr,Q,Tt,Nt,Yt,se,Ue)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Q*6;return this.int16[Tr+0]=Tt,this.int16[Tr+1]=Nt,this.int16[Tr+2]=Yt,this.int16[Tr+3]=se,this.int16[Tr+4]=Ue,this.int16[Tr+5]=nr,Q},j}(Ni);za.prototype.bytesPerElement=12,hr("StructArrayLayout2i2i2i12",za);var Ya=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se){var Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,Q,Tt,Nt,Yt,se)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue){var nr=Q*4,Tr=Q*8;return this.float32[nr+0]=Tt,this.float32[nr+1]=Nt,this.float32[nr+2]=Yt,this.int16[Tr+6]=se,this.int16[Tr+7]=Ue,Q},j}(Ni);Ya.prototype.bytesPerElement=16,hr("StructArrayLayout2f1f2i16",Ya);var Eo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt){var se=this.length;return this.resize(se+1),this.emplace(se,Q,Tt,Nt,Yt)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se){var Ue=Q*12,nr=Q*3;return this.uint8[Ue+0]=Tt,this.uint8[Ue+1]=Nt,this.float32[nr+1]=Yt,this.float32[nr+2]=se,Q},j}(Ni);Eo.prototype.bytesPerElement=12,hr("StructArrayLayout2ub2f12",Eo);var No=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*3;return this.uint16[se+0]=Tt,this.uint16[se+1]=Nt,this.uint16[se+2]=Yt,Q},j}(Ni);No.prototype.bytesPerElement=6,hr("StructArrayLayout3ui6",No);var hs=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){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)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba){var Ja=this.length;return this.resize(Ja+1),this.emplace(Ja,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Ja){var Da=Q*24,po=Q*12,Oo=Q*48;return this.int16[Da+0]=Tt,this.int16[Da+1]=Nt,this.uint16[Da+2]=Yt,this.uint16[Da+3]=se,this.uint32[po+2]=Ue,this.uint32[po+3]=nr,this.uint32[po+4]=Tr,this.uint16[Da+10]=jr,this.uint16[Da+11]=hn,this.uint16[Da+12]=xn,this.float32[po+7]=In,this.float32[po+8]=ii,this.uint8[Oo+36]=zi,this.uint8[Oo+37]=ka,this.uint8[Oo+38]=ya,this.uint32[po+10]=Ba,this.int16[Da+22]=Ja,Q},j}(Ni);hs.prototype.bytesPerElement=48,hr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",hs);var Xl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){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)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Ja,Da,po,Oo,Qo,ts,Ls,Ps,Gs,al,bl){var Zs=this.length;return this.resize(Zs+1),this.emplace(Zs,Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Ja,Da,po,Oo,Qo,ts,Ls,Ps,Gs,al,bl)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr,jr,hn,xn,In,ii,zi,ka,ya,Ba,Ja,Da,po,Oo,Qo,ts,Ls,Ps,Gs,al,bl,Zs){var Qs=Q*34,Kc=Q*17;return this.int16[Qs+0]=Tt,this.int16[Qs+1]=Nt,this.int16[Qs+2]=Yt,this.int16[Qs+3]=se,this.int16[Qs+4]=Ue,this.int16[Qs+5]=nr,this.int16[Qs+6]=Tr,this.int16[Qs+7]=jr,this.uint16[Qs+8]=hn,this.uint16[Qs+9]=xn,this.uint16[Qs+10]=In,this.uint16[Qs+11]=ii,this.uint16[Qs+12]=zi,this.uint16[Qs+13]=ka,this.uint16[Qs+14]=ya,this.uint16[Qs+15]=Ba,this.uint16[Qs+16]=Ja,this.uint16[Qs+17]=Da,this.uint16[Qs+18]=po,this.uint16[Qs+19]=Oo,this.uint16[Qs+20]=Qo,this.uint16[Qs+21]=ts,this.uint16[Qs+22]=Ls,this.uint32[Kc+12]=Ps,this.float32[Kc+13]=Gs,this.float32[Kc+14]=al,this.float32[Kc+15]=bl,this.float32[Kc+16]=Zs,Q},j}(Ni);Xl.prototype.bytesPerElement=68,hr("StructArrayLayout8i15ui1ul4f68",Xl);var Rl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Tt=this.length;return this.resize(Tt+1),this.emplace(Tt,Q)},j.prototype.emplace=function(Q,Tt){var Nt=Q*1;return this.float32[Nt+0]=Tt,Q},j}(Ni);Rl.prototype.bytesPerElement=4,hr("StructArrayLayout1f4",Rl);var ys=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*3;return this.int16[se+0]=Tt,this.int16[se+1]=Nt,this.int16[se+2]=Yt,Q},j}(Ni);ys.prototype.bytesPerElement=6,hr("StructArrayLayout3i6",ys);var Dc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt){var Yt=this.length;return this.resize(Yt+1),this.emplace(Yt,Q,Tt,Nt)},j.prototype.emplace=function(Q,Tt,Nt,Yt){var se=Q*2,Ue=Q*4;return this.uint32[se+0]=Tt,this.uint16[Ue+2]=Nt,this.uint16[Ue+3]=Yt,Q},j}(Ni);Dc.prototype.bytesPerElement=8,hr("StructArrayLayout1ul2ui8",Dc);var Cl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt){var Nt=this.length;return this.resize(Nt+1),this.emplace(Nt,Q,Tt)},j.prototype.emplace=function(Q,Tt,Nt){var Yt=Q*2;return this.uint16[Yt+0]=Tt,this.uint16[Yt+1]=Nt,Q},j}(Ni);Cl.prototype.bytesPerElement=4,hr("StructArrayLayout2ui4",Cl);var Nc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Tt=this.length;return this.resize(Tt+1),this.emplace(Tt,Q)},j.prototype.emplace=function(Q,Tt){var Nt=Q*1;return this.uint16[Nt+0]=Tt,Q},j}(Ni);Nc.prototype.bytesPerElement=2,hr("StructArrayLayout1ui2",Nc);var ku=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Tt,Nt,Yt){var se=this.length;return this.resize(se+1),this.emplace(se,Q,Tt,Nt,Yt)},j.prototype.emplace=function(Q,Tt,Nt,Yt,se){var Ue=Q*4;return this.float32[Ue+0]=Tt,this.float32[Ue+1]=Nt,this.float32[Ue+2]=Yt,this.float32[Ue+3]=se,Q},j}(Ni);ku.prototype.bytesPerElement=16,hr("StructArrayLayout4f16",ku);var Eu=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return Q.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},Q.x1.get=function(){return this._structArray.int16[this._pos2+2]},Q.y1.get=function(){return this._structArray.int16[this._pos2+3]},Q.x2.get=function(){return this._structArray.int16[this._pos2+4]},Q.y2.get=function(){return this._structArray.int16[this._pos2+5]},Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.anchorPoint.get=function(){return new c(this.anchorPointX,this.anchorPointY)},Object.defineProperties(j.prototype,Q),j}(En);Eu.prototype.size=20;var Ec=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Eu(this,Q)},j}(Bo);hr("CollisionBoxArray",Ec);var kc=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},Q.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},Q.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},Q.segment.get=function(){return this._structArray.uint16[this._pos2+10]},Q.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},Q.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},Q.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},Q.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},Q.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},Q.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},Q.placedOrientation.set=function(Tt){this._structArray.uint8[this._pos1+37]=Tt},Q.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},Q.hidden.set=function(Tt){this._structArray.uint8[this._pos1+38]=Tt},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},Q.crossTileID.set=function(Tt){this._structArray.uint32[this._pos4+10]=Tt},Q.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(j.prototype,Q),j}(En);kc.prototype.size=48;var zc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new kc(this,Q)},j}(hs);hr("PlacedSymbolArray",zc);var Xo=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},Q.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},Q.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},Q.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},Q.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},Q.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},Q.key.get=function(){return this._structArray.uint16[this._pos2+8]},Q.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},Q.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},Q.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},Q.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},Q.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},Q.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},Q.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},Q.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},Q.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},Q.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},Q.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},Q.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},Q.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},Q.crossTileID.set=function(Tt){this._structArray.uint32[this._pos4+12]=Tt},Q.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},Q.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},Q.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},Q.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(j.prototype,Q),j}(En);Xo.prototype.size=68;var Oc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Xo(this,Q)},j}(Xl);hr("SymbolInstanceArray",Oc);var xl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getoffsetX=function(Q){return this.float32[Q*1+0]},j}(Rl);hr("GlyphOffsetArray",xl);var jc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getx=function(Q){return this.int16[Q*3+0]},j.prototype.gety=function(Q){return this.int16[Q*3+1]},j.prototype.gettileUnitDistanceFromAnchor=function(Q){return this.int16[Q*3+2]},j}(ys);hr("SymbolLineVertexArray",jc);var Lu=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(j.prototype,Q),j}(En);Lu.prototype.size=8;var jo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Lu(this,Q)},j}(Dc);hr("FeatureIndexArray",jo);var Rs=wi([{name:"a_pos",components:2,type:"Int16"}],4),Fl=Rs.members,Pl=function(v){v===void 0&&(v=[]),this.segments=v};Pl.prototype.prepareSegment=function(v,j,Q,Tt){var Nt=this.segments[this.segments.length-1];return v>Pl.MAX_VERTEX_ARRAY_LENGTH&&G("Max vertices per segment is "+Pl.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+v),(!Nt||Nt.vertexLength+v>Pl.MAX_VERTEX_ARRAY_LENGTH||Nt.sortKey!==Tt)&&(Nt={vertexOffset:j.length,primitiveOffset:Q.length,vertexLength:0,primitiveLength:0},Tt!==void 0&&(Nt.sortKey=Tt),this.segments.push(Nt)),Nt},Pl.prototype.get=function(){return this.segments},Pl.prototype.destroy=function(){for(var v=0,j=this.segments;v>>16)*nr&65535)<<16)&4294967295,jr=jr<<15|jr>>>17,jr=(jr&65535)*Tr+(((jr>>>16)*Tr&65535)<<16)&4294967295,se^=jr,se=se<<13|se>>>19,Ue=(se&65535)*5+(((se>>>16)*5&65535)<<16)&4294967295,se=(Ue&65535)+27492+(((Ue>>>16)+58964&65535)<<16);switch(jr=0,Nt){case 3:jr^=(Q.charCodeAt(hn+2)&255)<<16;case 2:jr^=(Q.charCodeAt(hn+1)&255)<<8;case 1:jr^=Q.charCodeAt(hn)&255,jr=(jr&65535)*nr+(((jr>>>16)*nr&65535)<<16)&4294967295,jr=jr<<15|jr>>>17,jr=(jr&65535)*Tr+(((jr>>>16)*Tr&65535)<<16)&4294967295,se^=jr}return se^=Q.length,se^=se>>>16,se=(se&65535)*2246822507+(((se>>>16)*2246822507&65535)<<16)&4294967295,se^=se>>>13,se=(se&65535)*3266489909+(((se>>>16)*3266489909&65535)<<16)&4294967295,se^=se>>>16,se>>>0}v.exports=j}),wt=i(function(v){function j(Q,Tt){for(var Nt=Q.length,Yt=Tt^Nt,se=0,Ue;Nt>=4;)Ue=Q.charCodeAt(se)&255|(Q.charCodeAt(++se)&255)<<8|(Q.charCodeAt(++se)&255)<<16|(Q.charCodeAt(++se)&255)<<24,Ue=(Ue&65535)*1540483477+(((Ue>>>16)*1540483477&65535)<<16),Ue^=Ue>>>24,Ue=(Ue&65535)*1540483477+(((Ue>>>16)*1540483477&65535)<<16),Yt=(Yt&65535)*1540483477+(((Yt>>>16)*1540483477&65535)<<16)^Ue,Nt-=4,++se;switch(Nt){case 3:Yt^=(Q.charCodeAt(se+2)&255)<<16;case 2:Yt^=(Q.charCodeAt(se+1)&255)<<8;case 1:Yt^=Q.charCodeAt(se)&255,Yt=(Yt&65535)*1540483477+(((Yt>>>16)*1540483477&65535)<<16)}return Yt^=Yt>>>13,Yt=(Yt&65535)*1540483477+(((Yt>>>16)*1540483477&65535)<<16),Yt^=Yt>>>15,Yt>>>0}v.exports=j}),Wt=nt,ve=nt,ke=wt;Wt.murmur3=ve,Wt.murmur2=ke;var Jt=function(){this.ids=[],this.positions=[],this.indexed=!1};Jt.prototype.add=function(v,j,Q,Tt){this.ids.push(De(v)),this.positions.push(j,Q,Tt)},Jt.prototype.getPositions=function(v){for(var j=De(v),Q=0,Tt=this.ids.length-1;Q>1;this.ids[Nt]>=j?Tt=Nt:Q=Nt+1}for(var Yt=[];this.ids[Q]===j;){var se=this.positions[3*Q],Ue=this.positions[3*Q+1],nr=this.positions[3*Q+2];Yt.push({index:se,start:Ue,end:nr}),Q++}return Yt},Jt.serialize=function(v,j){var Q=new Float64Array(v.ids),Tt=new Uint32Array(v.positions);return lr(Q,Tt,0,Q.length-1),j&&j.push(Q.buffer,Tt.buffer),{ids:Q,positions:Tt}},Jt.deserialize=function(v){var j=new Jt;return j.ids=v.ids,j.positions=v.positions,j.indexed=!0,j};var fe=Math.pow(2,53)-1;function De(v){var j=+v;return!isNaN(j)&&j<=fe?j:Wt(String(v))}function lr(v,j,Q,Tt){for(;Q>1],Yt=Q-1,se=Tt+1;;){do Yt++;while(v[Yt]Nt);if(Yt>=se)break;tr(v,Yt,se),tr(j,3*Yt,3*se),tr(j,3*Yt+1,3*se+1),tr(j,3*Yt+2,3*se+2)}se-Qse.x+1||nrse.y+1)&&G("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return Q}function Ql(v,j){return{type:v.type,id:v.id,properties:v.properties,geometry:j?Al(v):[]}}function Pu(v,j,Q,Tt,Nt){v.emplaceBack(j*2+(Tt+1)/2,Q*2+(Nt+1)/2)}var qs=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new io,this.indexArray=new No,this.segments=new Pl,this.programConfigurations=new Wi(v.layers,v.zoom),this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};qs.prototype.populate=function(v,j,Q){var Tt=this.layers[0],Nt=[],Yt=null;Tt.type==="circle"&&(Yt=Tt.layout.get("circle-sort-key"));for(var se=0,Ue=v;se=ns||hn<0||hn>=ns)){var xn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,v.sortKey),In=xn.vertexLength;Pu(this.layoutVertexArray,jr,hn,-1,-1),Pu(this.layoutVertexArray,jr,hn,1,-1),Pu(this.layoutVertexArray,jr,hn,1,1),Pu(this.layoutVertexArray,jr,hn,-1,1),this.indexArray.emplaceBack(In,In+1,In+2),this.indexArray.emplaceBack(In,In+3,In+2),xn.vertexLength+=4,xn.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,Q,{},Tt)},hr("CircleBucket",qs,{omit:["layers"]});function Bc(v,j){for(var Q=0;Q=3){for(var Yt=0;Yt1){if(u0(v,j))return!0;for(var Tt=0;Tt1?v.distSqr(Q):v.distSqr(Q.sub(j)._mult(Nt)._add(j))}function d0(v,j){for(var Q=!1,Tt,Nt,Yt,se=0;sej.y!=Yt.y>j.y&&j.x<(Yt.x-Nt.x)*(j.y-Nt.y)/(Yt.y-Nt.y)+Nt.x&&(Q=!Q)}return Q}function mp(v,j){for(var Q=!1,Tt=0,Nt=v.length-1;Ttj.y!=se.y>j.y&&j.x<(se.x-Yt.x)*(j.y-Yt.y)/(se.y-Yt.y)+Yt.x&&(Q=!Q)}return Q}function rg(v,j,Q,Tt,Nt){for(var Yt=0,se=v;Yt=Ue.x&&Nt>=Ue.y)return!0}var nr=[new c(j,Q),new c(j,Nt),new c(Tt,Nt),new c(Tt,Q)];if(v.length>2)for(var Tr=0,jr=nr;TrNt.x&&j.x>Nt.x||v.yNt.y&&j.y>Nt.y)return!1;var Yt=tt(v,j,Q[0]);return Yt!==tt(v,j,Q[1])||Yt!==tt(v,j,Q[2])||Yt!==tt(v,j,Q[3])}function f0(v,j,Q){var Tt=j.paint.get(v).value;return Tt.kind==="constant"?Tt.value:Q.programConfigurations.get(j.id).getMaxValue(v)}function p0(v){return Math.sqrt(v[0]*v[0]+v[1]*v[1])}function Ep(v,j,Q,Tt,Nt){if(!j[0]&&!j[1])return v;var Yt=c.convert(j)._mult(Nt);Q==="viewport"&&Yt._rotate(-Tt);for(var se=[],Ue=0;Ue0&&(Yt=1/Math.sqrt(Yt)),v[0]=j[0]*Yt,v[1]=j[1]*Yt,v[2]=j[2]*Yt,v}function OA(v,j){return v[0]*j[0]+v[1]*j[1]+v[2]*j[2]}function BA(v,j,Q){var Tt=j[0],Nt=j[1],Yt=j[2],se=Q[0],Ue=Q[1],nr=Q[2];return v[0]=Nt*nr-Yt*Ue,v[1]=Yt*se-Tt*nr,v[2]=Tt*Ue-Nt*se,v}function RA(v,j,Q){var Tt=j[0],Nt=j[1],Yt=j[2];return v[0]=Tt*Q[0]+Nt*Q[3]+Yt*Q[6],v[1]=Tt*Q[1]+Nt*Q[4]+Yt*Q[7],v[2]=Tt*Q[2]+Nt*Q[5]+Yt*Q[8],v}var FA=Jw;(function(){var v=Fb();return function(j,Q,Tt,Nt,Yt,se){var Ue,nr;for(Q||(Q=3),Tt||(Tt=0),Nt?nr=Math.min(Nt*Q+Tt,j.length):nr=j.length,Ue=Tt;Uev.width||Nt.height>v.height||Q.x>v.width-Nt.width||Q.y>v.height-Nt.height)throw new RangeError("out of range source coordinates for image copy");if(Nt.width>j.width||Nt.height>j.height||Tt.x>j.width-Nt.width||Tt.y>j.height-Nt.height)throw new RangeError("out of range destination coordinates for image copy");for(var se=v.data,Ue=j.data,nr=0;nr80*Q){Ue=Tr=v[0],nr=jr=v[1];for(var ii=Q;iiTr&&(Tr=hn),xn>jr&&(jr=xn);In=Math.max(Tr-Ue,jr-nr),In=In!==0?1/In:0}return s1(Yt,se,Q,Ue,nr,In),se}function r3(v,j,Q,Tt,Nt){var Yt,se;if(Nt===l3(v,j,Q,Tt)>0)for(Yt=j;Yt=j;Yt-=Tt)se=Gk(Yt,v[Yt],v[Yt+1],se);return se&&ky(se,se.next)&&(ex(se),se=se.next),se}function Bg(v,j){if(!v)return v;j||(j=v);var Q=v,Tt;do if(Tt=!1,!Q.steiner&&(ky(Q,Q.next)||Sd(Q.prev,Q,Q.next)===0)){if(ex(Q),Q=j=Q.prev,Q===Q.next)break;Tt=!0}else Q=Q.next;while(Tt||Q!==j);return j}function s1(v,j,Q,Tt,Nt,Yt,se){if(v){!se&&Yt&&i3(v,Tt,Nt,Yt);for(var Ue=v,nr,Tr;v.prev!==v.next;){if(nr=v.prev,Tr=v.next,Yt?WA(v,Tt,Nt,Yt):n3(v)){j.push(nr.i/Q),j.push(v.i/Q),j.push(Tr.i/Q),ex(v),v=Tr.next,Ue=Tr.next;continue}if(v=Tr,v===Ue){se?se===1?(v=qA(Bg(v),j,Q),s1(v,j,Q,Tt,Nt,Yt,2)):se===2&&Vk(v,j,Q,Tt,Nt,Yt):s1(Bg(v),j,Q,Tt,Nt,Yt,1);break}}}}function n3(v){var j=v.prev,Q=v,Tt=v.next;if(Sd(j,Q,Tt)>=0)return!1;for(var Nt=v.next.next;Nt!==v.prev;){if(sv(j.x,j.y,Q.x,Q.y,Tt.x,Tt.y,Nt.x,Nt.y)&&Sd(Nt.prev,Nt,Nt.next)>=0)return!1;Nt=Nt.next}return!0}function WA(v,j,Q,Tt){var Nt=v.prev,Yt=v,se=v.next;if(Sd(Nt,Yt,se)>=0)return!1;for(var Ue=Nt.xYt.x?Nt.x>se.x?Nt.x:se.x:Yt.x>se.x?Yt.x:se.x,jr=Nt.y>Yt.y?Nt.y>se.y?Nt.y:se.y:Yt.y>se.y?Yt.y:se.y,hn=a3(Ue,nr,j,Q,Tt),xn=a3(Tr,jr,j,Q,Tt),In=v.prevZ,ii=v.nextZ;In&&In.z>=hn&&ii&&ii.z<=xn;){if(In!==v.prev&&In!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,In.x,In.y)&&Sd(In.prev,In,In.next)>=0||(In=In.prevZ,ii!==v.prev&&ii!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,ii.x,ii.y)&&Sd(ii.prev,ii,ii.next)>=0))return!1;ii=ii.nextZ}for(;In&&In.z>=hn;){if(In!==v.prev&&In!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,In.x,In.y)&&Sd(In.prev,In,In.next)>=0)return!1;In=In.prevZ}for(;ii&&ii.z<=xn;){if(ii!==v.prev&&ii!==v.next&&sv(Nt.x,Nt.y,Yt.x,Yt.y,se.x,se.y,ii.x,ii.y)&&Sd(ii.prev,ii,ii.next)>=0)return!1;ii=ii.nextZ}return!0}function qA(v,j,Q){var Tt=v;do{var Nt=Tt.prev,Yt=Tt.next.next;!ky(Nt,Yt)&&l1(Nt,Tt,Tt.next,Yt)&&Ty(Nt,Yt)&&Ty(Yt,Nt)&&(j.push(Nt.i/Q),j.push(Tt.i/Q),j.push(Yt.i/Q),ex(Tt),ex(Tt.next),Tt=v=Yt),Tt=Tt.next}while(Tt!==v);return Bg(Tt)}function Vk(v,j,Q,Tt,Nt,Yt){var se=v;do{for(var Ue=se.next.next;Ue!==se.prev;){if(se.i!==Ue.i&&ZA(se,Ue)){var nr=s3(se,Ue);se=Bg(se,se.next),nr=Bg(nr,nr.next),s1(se,j,Q,Tt,Nt,Yt),s1(nr,j,Q,Tt,Nt,Yt);return}Ue=Ue.next}se=se.next}while(se!==v)}function Wk(v,j,Q,Tt){var Nt=[],Yt,se,Ue,nr,Tr;for(Yt=0,se=j.length;Yt=Q.next.y&&Q.next.y!==Q.y){var Ue=Q.x+(Nt-Q.y)*(Q.next.x-Q.x)/(Q.next.y-Q.y);if(Ue<=Tt&&Ue>Yt){if(Yt=Ue,Ue===Tt){if(Nt===Q.y)return Q;if(Nt===Q.next.y)return Q.next}se=Q.x=Q.x&&Q.x>=Tr&&Tt!==Q.x&&sv(Ntse.x||Q.x===se.x&&qk(se,Q)))&&(se=Q,hn=xn)),Q=Q.next;while(Q!==nr);return se}function qk(v,j){return Sd(v.prev,v,j.prev)<0&&Sd(j.next,v,v.next)<0}function i3(v,j,Q,Tt){var Nt=v;do Nt.z===null&&(Nt.z=a3(Nt.x,Nt.y,j,Q,Tt)),Nt.prevZ=Nt.prev,Nt.nextZ=Nt.next,Nt=Nt.next;while(Nt!==v);Nt.prevZ.nextZ=null,Nt.prevZ=null,GA(Nt)}function GA(v){var j,Q,Tt,Nt,Yt,se,Ue,nr,Tr=1;do{for(Q=v,v=null,Yt=null,se=0;Q;){for(se++,Tt=Q,Ue=0,j=0;j0||nr>0&&Tt;)Ue!==0&&(nr===0||!Tt||Q.z<=Tt.z)?(Nt=Q,Q=Q.nextZ,Ue--):(Nt=Tt,Tt=Tt.nextZ,nr--),Yt?Yt.nextZ=Nt:v=Nt,Nt.prevZ=Yt,Yt=Nt;Q=Tt}Yt.nextZ=null,Tr*=2}while(se>1);return v}function a3(v,j,Q,Tt,Nt){return v=32767*(v-Q)*Nt,j=32767*(j-Tt)*Nt,v=(v|v<<8)&16711935,v=(v|v<<4)&252645135,v=(v|v<<2)&858993459,v=(v|v<<1)&1431655765,j=(j|j<<8)&16711935,j=(j|j<<4)&252645135,j=(j|j<<2)&858993459,j=(j|j<<1)&1431655765,v|j<<1}function Gb(v){var j=v,Q=v;do(j.x=0&&(v-se)*(Tt-Ue)-(Q-se)*(j-Ue)>=0&&(Q-se)*(Yt-Ue)-(Nt-se)*(Tt-Ue)>=0}function ZA(v,j){return v.next.i!==j.i&&v.prev.i!==j.i&&!o3(v,j)&&(Ty(v,j)&&Ty(j,v)&&Zb(v,j)&&(Sd(v.prev,v,j.prev)||Sd(v,j.prev,j))||ky(v,j)&&Sd(v.prev,v,v.next)>0&&Sd(j.prev,j,j.next)>0)}function Sd(v,j,Q){return(j.y-v.y)*(Q.x-j.x)-(j.x-v.x)*(Q.y-j.y)}function ky(v,j){return v.x===j.x&&v.y===j.y}function l1(v,j,Q,Tt){var Nt=tx(Sd(v,j,Q)),Yt=tx(Sd(v,j,Tt)),se=tx(Sd(Q,Tt,v)),Ue=tx(Sd(Q,Tt,j));return!!(Nt!==Yt&&se!==Ue||Nt===0&&Q_(v,Q,j)||Yt===0&&Q_(v,Tt,j)||se===0&&Q_(Q,v,Tt)||Ue===0&&Q_(Q,j,Tt))}function Q_(v,j,Q){return j.x<=Math.max(v.x,Q.x)&&j.x>=Math.min(v.x,Q.x)&&j.y<=Math.max(v.y,Q.y)&&j.y>=Math.min(v.y,Q.y)}function tx(v){return v>0?1:v<0?-1:0}function o3(v,j){var Q=v;do{if(Q.i!==v.i&&Q.next.i!==v.i&&Q.i!==j.i&&Q.next.i!==j.i&&l1(Q,Q.next,v,j))return!0;Q=Q.next}while(Q!==v);return!1}function Ty(v,j){return Sd(v.prev,v,v.next)<0?Sd(v,j,v.next)>=0&&Sd(v,v.prev,j)>=0:Sd(v,j,v.prev)<0||Sd(v,v.next,j)<0}function Zb(v,j){var Q=v,Tt=!1,Nt=(v.x+j.x)/2,Yt=(v.y+j.y)/2;do Q.y>Yt!=Q.next.y>Yt&&Q.next.y!==Q.y&&Nt<(Q.next.x-Q.x)*(Yt-Q.y)/(Q.next.y-Q.y)+Q.x&&(Tt=!Tt),Q=Q.next;while(Q!==v);return Tt}function s3(v,j){var Q=new Kb(v.i,v.x,v.y),Tt=new Kb(j.i,j.x,j.y),Nt=v.next,Yt=j.prev;return v.next=j,j.prev=v,Q.next=Nt,Nt.prev=Q,Tt.next=Q,Q.prev=Tt,Yt.next=Tt,Tt.prev=Yt,Tt}function Gk(v,j,Q,Tt){var Nt=new Kb(v,j,Q);return Tt?(Nt.next=Tt.next,Nt.prev=Tt,Tt.next.prev=Nt,Tt.next=Nt):(Nt.prev=Nt,Nt.next=Nt),Nt}function ex(v){v.next.prev=v.prev,v.prev.next=v.next,v.prevZ&&(v.prevZ.nextZ=v.nextZ),v.nextZ&&(v.nextZ.prevZ=v.prevZ)}function Kb(v,j,Q){this.i=v,this.x=j,this.y=Q,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}qb.deviation=function(v,j,Q,Tt){var Nt=j&&j.length,Yt=Nt?j[0]*Q:v.length,se=Math.abs(l3(v,0,Yt,Q));if(Nt)for(var Ue=0,nr=j.length;Ue0&&(Tt+=v[Nt-1].length,Q.holes.push(Tt))}return Q},Wb.default=Hk;function KA(v,j,Q,Tt,Nt){Zk(v,j,Q,Tt||v.length-1,Nt||c3)}function Zk(v,j,Q,Tt,Nt){for(;Tt>Q;){if(Tt-Q>600){var Yt=Tt-Q+1,se=j-Q+1,Ue=Math.log(Yt),nr=.5*Math.exp(2*Ue/3),Tr=.5*Math.sqrt(Ue*nr*(Yt-nr)/Yt)*(se-Yt/2<0?-1:1),jr=Math.max(Q,Math.floor(j-se*nr/Yt+Tr)),hn=Math.min(Tt,Math.floor(j+(Yt-se)*nr/Yt+Tr));Zk(v,j,jr,hn,Nt)}var xn=v[j],In=Q,ii=Tt;for(rx(v,Q,j),Nt(v[Tt],xn)>0&&rx(v,Q,Tt);In0;)ii--}Nt(v[Q],xn)===0?rx(v,Q,ii):(ii++,rx(v,ii,Tt)),ii<=j&&(Q=ii+1),j<=ii&&(Tt=ii-1)}}function rx(v,j,Q){var Tt=v[j];v[j]=v[Q],v[Q]=Tt}function c3(v,j){return vj?1:0}function ig(v,j){var Q=v.length;if(Q<=1)return[v];for(var Tt=[],Nt,Yt,se=0;se1)for(var nr=0;nr>3}if(Tt--,Q===1||Q===2)Nt+=v.readSVarint(),Yt+=v.readSVarint(),Q===1&&(Ue&&se.push(Ue),Ue=[]),Ue.push(new c(Nt,Yt));else if(Q===7)Ue&&Ue.push(Ue[0].clone());else throw new Error("unknown command "+Q)}return Ue&&se.push(Ue),se},c1.prototype.bbox=function(){var v=this._pbf;v.pos=this._geometry;for(var j=v.readVarint()+v.pos,Q=1,Tt=0,Nt=0,Yt=0,se=1/0,Ue=-1/0,nr=1/0,Tr=-1/0;v.pos>3}if(Tt--,Q===1||Q===2)Nt+=v.readSVarint(),Yt+=v.readSVarint(),NtUe&&(Ue=Nt),YtTr&&(Tr=Yt);else if(Q!==7)throw new Error("unknown command "+Q)}return[se,nr,Ue,Tr]},c1.prototype.toGeoJSON=function(v,j,Q){var Tt=this.extent*Math.pow(2,Q),Nt=this.extent*v,Yt=this.extent*j,se=this.loadGeometry(),Ue=c1.types[this.type],nr,Tr;function jr(In){for(var ii=0;ii>3;j=Tt===1?v.readString():Tt===2?v.readFloat():Tt===3?v.readDouble():Tt===4?v.readVarint64():Tt===5?v.readVarint():Tt===6?v.readSVarint():Tt===7?v.readBoolean():null}return j}n6.prototype.feature=function(v){if(v<0||v>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[v];var j=this._pbf.readVarint()+this._pbf.pos;return new Sy(this._pbf,j,this.extent,this._keys,this._values)};var a6=o6;function o6(v,j){this.layers=v.readFields(s6,{},j)}function s6(v,j,Q){if(v===3){var Tt=new d3(Q,Q.readVarint()+Q.pos);Tt.length&&(j[Tt.name]=Tt)}}var l6=a6,YA=Sy,XA=d3,u1={VectorTile:l6,VectorTileFeature:YA,VectorTileLayer:XA},Cy=u1.VectorTileFeature.types,c6=500,Ay=Math.pow(2,13);function My(v,j,Q,Tt,Nt,Yt,se,Ue){v.emplaceBack(j,Q,Math.floor(Tt*Ay)*2+se,Nt*Ay*2,Yt*Ay*2,Math.round(Ue))}var E0=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new ki,this.indexArray=new No,this.programConfigurations=new Wi(v.layers,v.zoom),this.segments=new Pl,this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};E0.prototype.populate=function(v,j,Q){this.features=[],this.hasPattern=Yb("fill-extrusion",this.layers,j);for(var Tt=0,Nt=v;Tt=1){var Ja=zi[ya-1];if(!Jb(Ba,Ja)){xn.vertexLength+4>Pl.MAX_VERTEX_ARRAY_LENGTH&&(xn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Da=Ba.sub(Ja)._perp()._unit(),po=Ja.dist(Ba);ka+po>32768&&(ka=0),My(this.layoutVertexArray,Ba.x,Ba.y,Da.x,Da.y,0,0,ka),My(this.layoutVertexArray,Ba.x,Ba.y,Da.x,Da.y,0,1,ka),ka+=po,My(this.layoutVertexArray,Ja.x,Ja.y,Da.x,Da.y,0,0,ka),My(this.layoutVertexArray,Ja.x,Ja.y,Da.x,Da.y,0,1,ka);var Oo=xn.vertexLength;this.indexArray.emplaceBack(Oo,Oo+2,Oo+1),this.indexArray.emplaceBack(Oo+1,Oo+2,Oo+3),xn.vertexLength+=4,xn.primitiveLength+=2}}}}if(xn.vertexLength+nr>Pl.MAX_VERTEX_ARRAY_LENGTH&&(xn=this.segments.prepareSegment(nr,this.layoutVertexArray,this.indexArray)),Cy[v.type]==="Polygon"){for(var Qo=[],ts=[],Ls=xn.vertexLength,Ps=0,Gs=Ue;Psns)||v.y===j.y&&(v.y<0||v.y>ns)}function Qb(v){return v.every(function(j){return j.x<0})||v.every(function(j){return j.x>ns})||v.every(function(j){return j.y<0})||v.every(function(j){return j.y>ns})}var JA=new co({"fill-extrusion-opacity":new On(Wa["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Si(Wa["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new On(Wa["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new On(Wa["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ha(Wa["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Si(Wa["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Si(Wa["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new On(Wa["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),QA={paint:JA},t7=function(v){function j(Q){v.call(this,Q,QA)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.createBucket=function(Q){return new E0(Q)},j.prototype.queryRadius=function(){return p0(this.paint.get("fill-extrusion-translate"))},j.prototype.is3D=function(){return!0},j.prototype.queryIntersectsFeature=function(Q,Tt,Nt,Yt,se,Ue,nr,Tr){var jr=Ep(Q,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ue.angle,nr),hn=this.paint.get("fill-extrusion-height").evaluate(Tt,Nt),xn=this.paint.get("fill-extrusion-base").evaluate(Tt,Nt),In=u6(jr,Tr,Ue,0),ii=f3(Yt,xn,hn,Tr),zi=ii[0],ka=ii[1];return cv(zi,ka,In)},j}(ma);function ag(v,j){return v.x*j.x+v.y*j.y}function ep(v,j){if(v.length===1){for(var Q=0,Tt=j[Q++],Nt;!Nt||Tt.equals(Nt);)if(Nt=j[Q++],!Nt)return 1/0;for(;Q=2&&v[nr-1].equals(v[nr-2]);)nr--;for(var Tr=0;Tr0;if(Qo&&ya>Tr){var Ls=xn.dist(In);if(Ls>2*jr){var Ps=xn.sub(xn.sub(In)._mult(jr/Ls)._round());this.updateDistance(In,Ps),this.addCurrentVertex(Ps,zi,0,0,hn),In=Ps}}var Gs=In&&ii,al=Gs?Q:Ue?"butt":Tt;if(Gs&&al==="round"&&(poNt&&(al="bevel"),al==="bevel"&&(po>2&&(al="flipbevel"),po100)Ba=ka.mult(-1);else{var bl=po*zi.add(ka).mag()/zi.sub(ka).mag();Ba._perp()._mult(bl*(ts?-1:1))}this.addCurrentVertex(xn,Ba,0,0,hn),this.addCurrentVertex(xn,Ba.mult(-1),0,0,hn)}else if(al==="bevel"||al==="fakeround"){var Zs=-Math.sqrt(po*po-1),Qs=ts?Zs:0,Kc=ts?0:Zs;if(In&&this.addCurrentVertex(xn,zi,Qs,Kc,hn),al==="fakeround")for(var Gu=Math.round(Oo*180/Math.PI/g3),Th=1;Th2*jr){var wf=xn.add(ii.sub(xn)._mult(jr/xp)._round());this.updateDistance(xn,wf),this.addCurrentVertex(wf,ka,0,0,hn),xn=wf}}}}},vp.prototype.addCurrentVertex=function(v,j,Q,Tt,Nt,Yt){Yt===void 0&&(Yt=!1);var se=j.x+j.y*Q,Ue=j.y-j.x*Q,nr=-j.x+j.y*Tt,Tr=-j.y-j.x*Tt;this.addHalfVertex(v,se,Ue,Yt,!1,Q,Nt),this.addHalfVertex(v,nr,Tr,Yt,!0,-Tt,Nt),this.distance>t2/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(v,j,Q,Tt,Nt,Yt))},vp.prototype.addHalfVertex=function(v,j,Q,Tt,Nt,Yt,se){var Ue=v.x,nr=v.y,Tr=this.lineClips?this.scaledDistance*(t2-1):this.scaledDistance,jr=Tr*Ey;if(this.layoutVertexArray.emplaceBack((Ue<<1)+(Tt?1:0),(nr<<1)+(Nt?1:0),Math.round(p6*j)+128,Math.round(p6*Q)+128,(Yt===0?0:Yt<0?-1:1)+1|(jr&63)<<2,jr>>6),this.lineClips){var hn=this.scaledDistance-this.lineClips.start,xn=this.lineClips.end-this.lineClips.start,In=hn/xn;this.layoutVertexArray2.emplaceBack(In,this.lineClipsArray.length)}var ii=se.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ii),se.primitiveLength++),Nt?this.e2=ii:this.e1=ii},vp.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},vp.prototype.updateDistance=function(v,j){this.distance+=v.dist(j),this.updateScaledDistance()},hr("LineBucket",vp,{omit:["layers","patternFeatures"]});var v3=new co({"line-cap":new On(Wa.layout_line["line-cap"]),"line-join":new Si(Wa.layout_line["line-join"]),"line-miter-limit":new On(Wa.layout_line["line-miter-limit"]),"line-round-limit":new On(Wa.layout_line["line-round-limit"]),"line-sort-key":new Si(Wa.layout_line["line-sort-key"])}),e2=new co({"line-opacity":new Si(Wa.paint_line["line-opacity"]),"line-color":new Si(Wa.paint_line["line-color"]),"line-translate":new On(Wa.paint_line["line-translate"]),"line-translate-anchor":new On(Wa.paint_line["line-translate-anchor"]),"line-width":new Si(Wa.paint_line["line-width"]),"line-gap-width":new Si(Wa.paint_line["line-gap-width"]),"line-offset":new Si(Wa.paint_line["line-offset"]),"line-blur":new Si(Wa.paint_line["line-blur"]),"line-dasharray":new aa(Wa.paint_line["line-dasharray"]),"line-pattern":new ha(Wa.paint_line["line-pattern"]),"line-gradient":new Ia(Wa.paint_line["line-gradient"])}),Ly={paint:e2,layout:v3},y3=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.possiblyEvaluate=function(Q,Tt){return Tt=new Yl(Math.floor(Tt.zoom),{now:Tt.now,fadeDuration:Tt.fadeDuration,zoomHistory:Tt.zoomHistory,transition:Tt.transition}),v.prototype.possiblyEvaluate.call(this,Q,Tt)},j.prototype.evaluate=function(Q,Tt,Nt,Yt){return Tt=I({},Tt,{zoom:Math.floor(Tt.zoom)}),v.prototype.evaluate.call(this,Q,Tt,Nt,Yt)},j}(Si),r2=new y3(Ly.paint.properties["line-width"].specification);r2.useIntegerZoom=!0;var _3=function(v){function j(Q){v.call(this,Q,Ly),this.gradientVersion=0}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._handleSpecialPaintPropertyUpdate=function(Q){if(Q==="line-gradient"){var Tt=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=Tt._styleExpression.expression instanceof Qu,this.gradientVersion=(this.gradientVersion+1)%b}},j.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},j.prototype.recalculate=function(Q,Tt){v.prototype.recalculate.call(this,Q,Tt),this.paint._values["line-floorwidth"]=r2.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,Q)},j.prototype.createBucket=function(Q){return new vp(Q)},j.prototype.queryRadius=function(Q){var Tt=Q,Nt=v6(f0("line-width",this,Tt),f0("line-gap-width",this,Tt)),Yt=f0("line-offset",this,Tt);return Nt/2+Math.abs(Yt)+p0(this.paint.get("line-translate"))},j.prototype.queryIntersectsFeature=function(Q,Tt,Nt,Yt,se,Ue,nr){var Tr=Ep(Q,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ue.angle,nr),jr=nr/2*v6(this.paint.get("line-width").evaluate(Tt,Nt),this.paint.get("line-gap-width").evaluate(Tt,Nt)),hn=this.paint.get("line-offset").evaluate(Tt,Nt);return hn&&(Yt=X(Yt,hn*nr)),M0(Tr,Yt,jr)},j.prototype.isTileClipped=function(){return!0},j}(ma);function v6(v,j){return j>0?j+2*v:v}function X(v,j){for(var Q=[],Tt=new c(0,0),Nt=0;Nt":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Cr(v){for(var j="",Q=0;Q>1,jr=-7,hn=Q?Nt-1:0,xn=Q?-1:1,In=v[j+hn];for(hn+=xn,Yt=In&(1<<-jr)-1,In>>=-jr,jr+=Ue;jr>0;Yt=Yt*256+v[j+hn],hn+=xn,jr-=8);for(se=Yt&(1<<-jr)-1,Yt>>=-jr,jr+=Tt;jr>0;se=se*256+v[j+hn],hn+=xn,jr-=8);if(Yt===0)Yt=1-Tr;else{if(Yt===nr)return se?NaN:(In?-1:1)*(1/0);se=se+Math.pow(2,Tt),Yt=Yt-Tr}return(In?-1:1)*se*Math.pow(2,Yt-Tt)},kn=function(v,j,Q,Tt,Nt,Yt){var se,Ue,nr,Tr=Yt*8-Nt-1,jr=(1<>1,xn=Nt===23?Math.pow(2,-24)-Math.pow(2,-77):0,In=Tt?0:Yt-1,ii=Tt?1:-1,zi=j<0||j===0&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(Ue=isNaN(j)?1:0,se=jr):(se=Math.floor(Math.log(j)/Math.LN2),j*(nr=Math.pow(2,-se))<1&&(se--,nr*=2),se+hn>=1?j+=xn/nr:j+=xn*Math.pow(2,1-hn),j*nr>=2&&(se++,nr/=2),se+hn>=jr?(Ue=0,se=jr):se+hn>=1?(Ue=(j*nr-1)*Math.pow(2,Nt),se=se+hn):(Ue=j*Math.pow(2,hn-1)*Math.pow(2,Nt),se=0));Nt>=8;v[Q+In]=Ue&255,In+=ii,Ue/=256,Nt-=8);for(se=se<0;v[Q+In]=se&255,In+=ii,se/=256,Tr-=8);v[Q+In-ii]|=zi*128},Fn={read:ln,write:kn},Kn=mi;function mi(v){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(v)?v:new Uint8Array(v||0),this.pos=0,this.type=0,this.length=this.buf.length}mi.Varint=0,mi.Fixed64=1,mi.Bytes=2,mi.Fixed32=5;var Ui=65536*65536,Na=1/Ui,fa=12,La=typeof TextDecoder>"u"?null:new TextDecoder("utf8");mi.prototype={destroy:function(){this.buf=null},readFields:function(v,j,Q){for(Q=Q||this.length;this.pos>3,Yt=this.pos;this.type=Tt&7,v(Nt,j,this),this.pos===Yt&&this.skip(Tt)}return j},readMessage:function(v,j){return this.readFields(v,j,this.readVarint()+this.pos)},readFixed32:function(){var v=m0(this.buf,this.pos);return this.pos+=4,v},readSFixed32:function(){var v=yf(this.buf,this.pos);return this.pos+=4,v},readFixed64:function(){var v=m0(this.buf,this.pos)+m0(this.buf,this.pos+4)*Ui;return this.pos+=8,v},readSFixed64:function(){var v=m0(this.buf,this.pos)+yf(this.buf,this.pos+4)*Ui;return this.pos+=8,v},readFloat:function(){var v=Fn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,v},readDouble:function(){var v=Fn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,v},readVarint:function(v){var j=this.buf,Q,Tt;return Tt=j[this.pos++],Q=Tt&127,Tt<128||(Tt=j[this.pos++],Q|=(Tt&127)<<7,Tt<128)||(Tt=j[this.pos++],Q|=(Tt&127)<<14,Tt<128)||(Tt=j[this.pos++],Q|=(Tt&127)<<21,Tt<128)?Q:(Tt=j[this.pos],Q|=(Tt&15)<<28,ho(Q,v,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var v=this.readVarint();return v%2===1?(v+1)/-2:v/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var v=this.readVarint()+this.pos,j=this.pos;return this.pos=v,v-j>=fa&&La?qp(this.buf,j,v):Wp(this.buf,j,v)},readBytes:function(){var v=this.readVarint()+this.pos,j=this.buf.subarray(this.pos,v);return this.pos=v,j},readPackedVarint:function(v,j){if(this.type!==mi.Bytes)return v.push(this.readVarint(j));var Q=Ro(this);for(v=v||[];this.pos127;);else if(j===mi.Bytes)this.pos=this.readVarint()+this.pos;else if(j===mi.Fixed32)this.pos+=4;else if(j===mi.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+j)},writeTag:function(v,j){this.writeVarint(v<<3|j)},realloc:function(v){for(var j=this.length||16;j268435455||v<0){Nl(v,this);return}this.realloc(4),this.buf[this.pos++]=v&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=v>>>7&127)))},writeSVarint:function(v){this.writeVarint(v<0?-v*2-1:v*2)},writeBoolean:function(v){this.writeVarint(!!v)},writeString:function(v){v=String(v),this.realloc(v.length*4),this.pos++;var j=this.pos;this.pos=Gp(this.buf,v,this.pos);var Q=this.pos-j;Q>=128&&sl(j,Q,this),this.pos=j-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(v){this.realloc(4),Fn.write(this.buf,v,this.pos,!0,23,4),this.pos+=4},writeDouble:function(v){this.realloc(8),Fn.write(this.buf,v,this.pos,!0,52,8),this.pos+=8},writeBytes:function(v){var j=v.length;this.writeVarint(j),this.realloc(j);for(var Q=0;Q=128&&sl(Q,Tt,this),this.pos=Q-1,this.writeVarint(Tt),this.pos+=Tt},writeMessage:function(v,j,Q){this.writeTag(v,mi.Bytes),this.writeRawMessage(j,Q)},writePackedVarint:function(v,j){j.length&&this.writeMessage(v,Ks,j)},writePackedSVarint:function(v,j){j.length&&this.writeMessage(v,Hs,j)},writePackedBoolean:function(v,j){j.length&&this.writeMessage(v,ll,j)},writePackedFloat:function(v,j){j.length&&this.writeMessage(v,To,j)},writePackedDouble:function(v,j){j.length&&this.writeMessage(v,vl,j)},writePackedFixed32:function(v,j){j.length&&this.writeMessage(v,rc,j)},writePackedSFixed32:function(v,j){j.length&&this.writeMessage(v,wh,j)},writePackedFixed64:function(v,j){j.length&&this.writeMessage(v,mh,j)},writePackedSFixed64:function(v,j){j.length&&this.writeMessage(v,Of,j)},writeBytesField:function(v,j){this.writeTag(v,mi.Bytes),this.writeBytes(j)},writeFixed32Field:function(v,j){this.writeTag(v,mi.Fixed32),this.writeFixed32(j)},writeSFixed32Field:function(v,j){this.writeTag(v,mi.Fixed32),this.writeSFixed32(j)},writeFixed64Field:function(v,j){this.writeTag(v,mi.Fixed64),this.writeFixed64(j)},writeSFixed64Field:function(v,j){this.writeTag(v,mi.Fixed64),this.writeSFixed64(j)},writeVarintField:function(v,j){this.writeTag(v,mi.Varint),this.writeVarint(j)},writeSVarintField:function(v,j){this.writeTag(v,mi.Varint),this.writeSVarint(j)},writeStringField:function(v,j){this.writeTag(v,mi.Bytes),this.writeString(j)},writeFloatField:function(v,j){this.writeTag(v,mi.Fixed32),this.writeFloat(j)},writeDoubleField:function(v,j){this.writeTag(v,mi.Fixed64),this.writeDouble(j)},writeBooleanField:function(v,j){this.writeVarintField(v,!!j)}};function ho(v,j,Q){var Tt=Q.buf,Nt,Yt;if(Yt=Tt[Q.pos++],Nt=(Yt&112)>>4,Yt<128||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<3,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<10,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<17,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&127)<<24,Yt<128)||(Yt=Tt[Q.pos++],Nt|=(Yt&1)<<31,Yt<128))return Os(v,Nt,j);throw new Error("Expected varint not more than 10 bytes")}function Ro(v){return v.type===mi.Bytes?v.readVarint()+v.pos:v.pos+1}function Os(v,j,Q){return Q?j*4294967296+(v>>>0):(j>>>0)*4294967296+(v>>>0)}function Nl(v,j){var Q,Tt;if(v>=0?(Q=v%4294967296|0,Tt=v/4294967296|0):(Q=~(-v%4294967296),Tt=~(-v/4294967296),Q^4294967295?Q=Q+1|0:(Q=0,Tt=Tt+1|0)),v>=18446744073709552e3||v<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");j.realloc(10),Ms(Q,Tt,j),_s(Tt,j)}function Ms(v,j,Q){Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos]=v&127}function _s(v,j){var Q=(v&7)<<4;j.buf[j.pos++]|=Q|((v>>>=3)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127)))))}function sl(v,j,Q){var Tt=j<=16383?1:j<=2097151?2:j<=268435455?3:Math.floor(Math.log(j)/(Math.LN2*7));Q.realloc(Tt);for(var Nt=Q.pos-1;Nt>=v;Nt--)Q.buf[Nt+Tt]=Q.buf[Nt]}function Ks(v,j){for(var Q=0;Q>>8,v[Q+2]=j>>>16,v[Q+3]=j>>>24}function yf(v,j){return(v[j]|v[j+1]<<8|v[j+2]<<16)+(v[j+3]<<24)}function Wp(v,j,Q){for(var Tt="",Nt=j;Nt239?4:Yt>223?3:Yt>191?2:1;if(Nt+Ue>Q)break;var nr,Tr,jr;Ue===1?Yt<128&&(se=Yt):Ue===2?(nr=v[Nt+1],(nr&192)===128&&(se=(Yt&31)<<6|nr&63,se<=127&&(se=null))):Ue===3?(nr=v[Nt+1],Tr=v[Nt+2],(nr&192)===128&&(Tr&192)===128&&(se=(Yt&15)<<12|(nr&63)<<6|Tr&63,(se<=2047||se>=55296&&se<=57343)&&(se=null))):Ue===4&&(nr=v[Nt+1],Tr=v[Nt+2],jr=v[Nt+3],(nr&192)===128&&(Tr&192)===128&&(jr&192)===128&&(se=(Yt&15)<<18|(nr&63)<<12|(Tr&63)<<6|jr&63,(se<=65535||se>=1114112)&&(se=null))),se===null?(se=65533,Ue=1):se>65535&&(se-=65536,Tt+=String.fromCharCode(se>>>10&1023|55296),se=56320|se&1023),Tt+=String.fromCharCode(se),Nt+=Ue}return Tt}function qp(v,j,Q){return La.decode(v.subarray(j,Q))}function Gp(v,j,Q){for(var Tt=0,Nt,Yt;Tt55295&&Nt<57344)if(Yt)if(Nt<56320){v[Q++]=239,v[Q++]=191,v[Q++]=189,Yt=Nt;continue}else Nt=Yt-55296<<10|Nt-56320|65536,Yt=null;else{Nt>56319||Tt+1===j.length?(v[Q++]=239,v[Q++]=191,v[Q++]=189):Yt=Nt;continue}else Yt&&(v[Q++]=239,v[Q++]=191,v[Q++]=189,Yt=null);Nt<128?v[Q++]=Nt:(Nt<2048?v[Q++]=Nt>>6|192:(Nt<65536?v[Q++]=Nt>>12|224:(v[Q++]=Nt>>18|240,v[Q++]=Nt>>12&63|128),v[Q++]=Nt>>6&63|128),v[Q++]=Nt&63|128)}return Q}var vd=3;function Bf(v,j,Q){v===1&&Q.readMessage(Lp,j)}function Lp(v,j,Q){if(v===3){var Tt=Q.readMessage(yp,{}),Nt=Tt.id,Yt=Tt.bitmap,se=Tt.width,Ue=Tt.height,nr=Tt.left,Tr=Tt.top,jr=Tt.advance;j.push({id:Nt,bitmap:new vf({width:se+2*vd,height:Ue+2*vd},Yt),metrics:{width:se,height:Ue,left:nr,top:Tr,advance:jr}})}}function yp(v,j,Q){v===1?j.id=Q.readVarint():v===2?j.bitmap=Q.readBytes():v===3?j.width=Q.readVarint():v===4?j.height=Q.readVarint():v===5?j.left=Q.readSVarint():v===6?j.top=Q.readSVarint():v===7&&(j.advance=Q.readVarint())}function Zp(v){return new Kn(v).readFields(Bf,[])}var rp=vd;function L0(v){for(var j=0,Q=0,Tt=0,Nt=v;Tt=0;In--){var ii=Ue[In];if(!(xn.w>ii.w||xn.h>ii.h)){if(xn.x=ii.x,xn.y=ii.y,Tr=Math.max(Tr,xn.y+xn.h),nr=Math.max(nr,xn.x+xn.w),xn.w===ii.w&&xn.h===ii.h){var zi=Ue.pop();In=0&&Tt>=v&&P0[this.text.charCodeAt(Tt)];Tt--)Q--;this.text=this.text.substring(v,Q),this.sectionIndex=this.sectionIndex.slice(v,Q)},kh.prototype.substring=function(v,j){var Q=new kh;return Q.text=this.text.substring(v,j),Q.sectionIndex=this.sectionIndex.slice(v,j),Q.sections=this.sections,Q},kh.prototype.toString=function(){return this.text},kh.prototype.getMaxScale=function(){var v=this;return this.sectionIndex.reduce(function(j,Q){return Math.max(j,v.sections[Q].scale)},0)},kh.prototype.addTextSection=function(v,j){this.text+=v.text,this.sections.push(Pp.forText(v.scale,v.fontStack||j));for(var Q=this.sections.length-1,Tt=0;Tt=Fm?null:++this.imageSectionID:(this.imageSectionID=Rm,this.imageSectionID)};function np(v,j){for(var Q=[],Tt=v.text,Nt=0,Yt=0,se=j;Yt=0,jr=0,hn=0;hn0&&gh>Ls&&(Ls=gh)}else{var qd=Q[Gs.fontStack],xp=qd&&qd[bl];if(xp&&xp.rect)Kc=xp.rect,Qs=xp.metrics;else{var wf=j[Gs.fontStack],Yp=wf&&wf[bl];if(!Yp)continue;Qs=Yp.metrics}Zs=(po-Gs.scale)*$r}su?(v.verticalizable=!0,ts.push({glyph:bl,imageName:Gu,x:xn,y:In+Zs,vertical:su,scale:Gs.scale,fontStack:Gs.fontStack,sectionIndex:al,metrics:Qs,rect:Kc}),xn+=Th*Gs.scale+Tr):(ts.push({glyph:bl,imageName:Gu,x:xn,y:In+Zs,vertical:su,scale:Gs.scale,fontStack:Gs.fontStack,sectionIndex:al,metrics:Qs,rect:Kc}),xn+=Qs.advance*Gs.scale+Tr)}if(ts.length!==0){var Xp=xn-Tr;ii=Math.max(Xp,ii),n7(ts,0,ts.length-1,ka,Ls)}xn=0;var Jp=Yt*po+Ls;Qo.lineOffset=Math.max(Ls,Oo),In+=Jp,zi=Math.max(Jp,zi),++ya}var ap=In-Bh,g0=S3(se),v0=g0.horizontalAlign,Rf=g0.verticalAlign;i7(v.positionedLines,ka,v0,Rf,ii,zi,Yt,ap,Nt.length),v.top+=-Rf*ap,v.bottom=v.top+ap,v.left+=-v0*ii,v.right=v.left+ii}function n7(v,j,Q,Tt,Nt){if(!(!Tt&&!Nt))for(var Yt=v[Q],se=Yt.metrics.advance*Yt.scale,Ue=(v[Q].x+se)*Tt,nr=j;nr<=Q;nr++)v[nr].x-=Ue,v[nr].y+=Nt}function i7(v,j,Q,Tt,Nt,Yt,se,Ue,nr){var Tr=(j-Q)*Nt,jr=0;Yt!==se?jr=-Ue*Tt-Bh:jr=(-Tt*nr+.5)*se;for(var hn=0,xn=v;hn-Q/2;){if(se--,se<0)return!1;Ue-=v[se].dist(Yt),Yt=v[se]}Ue+=v[se].dist(v[se+1]),se++;for(var nr=[],Tr=0;UeTt;)Tr-=nr.shift().angleDelta;if(Tr>Nt)return!1;se++,Ue+=hn.dist(xn)}return!0}function _p(v){for(var j=0,Q=0;QTr){var ii=(Tr-nr)/In,zi=Pc(hn.x,xn.x,ii),ka=Pc(hn.y,xn.y,ii),ya=new Iy(zi,ka,xn.angleTo(hn),jr);return ya._round(),!se||x6(v,ya,Ue,se,j)?ya:void 0}nr+=In}}function h1(v,j,Q,Tt,Nt,Yt,se,Ue,nr){var Tr=I0(Tt,Yt,se),jr=uv(Tt,Nt),hn=jr*se,xn=v[0].x===0||v[0].x===nr||v[0].y===0||v[0].y===nr;j-hn=0&&Da=0&&po=0&&xn+Tr<=jr){var Oo=new Iy(Da,po,Ba,ii);Oo._round(),(!Tt||x6(v,Oo,Yt,Tt,Nt))&&In.push(Oo)}}hn+=ya}return!Ue&&!In.length&&!se&&(In=jm(v,hn/2,Q,Tt,Nt,Yt,se,!0,nr)),In}function lO(v,j,Q,Tt,Nt){for(var Yt=[],se=0;se=Tt&&hn.x>=Tt)&&(jr.x>=Tt?jr=new c(Tt,jr.y+(hn.y-jr.y)*((Tt-jr.x)/(hn.x-jr.x)))._round():hn.x>=Tt&&(hn=new c(Tt,jr.y+(hn.y-jr.y)*((Tt-jr.x)/(hn.x-jr.x)))._round()),!(jr.y>=Nt&&hn.y>=Nt)&&(jr.y>=Nt?jr=new c(jr.x+(hn.x-jr.x)*((Nt-jr.y)/(hn.y-jr.y)),Nt)._round():hn.y>=Nt&&(hn=new c(jr.x+(hn.x-jr.x)*((Nt-jr.y)/(hn.y-jr.y)),Nt)._round()),(!nr||!jr.equals(nr[nr.length-1]))&&(nr=[jr],Yt.push(nr)),nr.push(hn)))))}return Yt}var i2=Oh;function cO(v,j,Q,Tt){var Nt=[],Yt=v.image,se=Yt.pixelRatio,Ue=Yt.paddedRect.w-2*i2,nr=Yt.paddedRect.h-2*i2,Tr=v.right-v.left,jr=v.bottom-v.top,hn=Yt.stretchX||[[0,Ue]],xn=Yt.stretchY||[[0,nr]],In=function(Zu,Yc){return Zu+Yc[1]-Yc[0]},ii=hn.reduce(In,0),zi=xn.reduce(In,0),ka=Ue-ii,ya=nr-zi,Ba=0,Ja=ii,Da=0,po=zi,Oo=0,Qo=ka,ts=0,Ls=ya;if(Yt.content&&Tt){var Ps=Yt.content;Ba=b6(hn,0,Ps[0]),Da=b6(xn,0,Ps[1]),Ja=b6(hn,Ps[0],Ps[2]),po=b6(xn,Ps[1],Ps[3]),Oo=Ps[0]-Ba,ts=Ps[1]-Da,Qo=Ps[2]-Ps[0]-Ja,Ls=Ps[3]-Ps[1]-po}var Gs=function(Zu,Yc,Zh,gh){var qd=w6(Zu.stretch-Ba,Ja,Tr,v.left),xp=k6(Zu.fixed-Oo,Qo,Zu.stretch,ii),wf=w6(Yc.stretch-Da,po,jr,v.top),Yp=k6(Yc.fixed-ts,Ls,Yc.stretch,zi),Xp=w6(Zh.stretch-Ba,Ja,Tr,v.left),Jp=k6(Zh.fixed-Oo,Qo,Zh.stretch,ii),ap=w6(gh.stretch-Da,po,jr,v.top),g0=k6(gh.fixed-ts,Ls,gh.stretch,zi),v0=new c(qd,wf),Rf=new c(Xp,wf),y0=new c(Xp,ap),_m=new c(qd,ap),p1=new c(xp/se,Yp/se),By=new c(Jp/se,g0/se),Ry=j*Math.PI/180;if(Ry){var Fy=Math.sin(Ry),d2=Math.cos(Ry),og=[d2,-Fy,Fy,d2];v0._matMult(og),Rf._matMult(og),_m._matMult(og),y0._matMult(og)}var E6=Zu.stretch+Zu.fixed,p7=Zh.stretch+Zh.fixed,L6=Yc.stretch+Yc.fixed,m7=gh.stretch+gh.fixed,Um={x:Yt.paddedRect.x+i2+E6,y:Yt.paddedRect.y+i2+L6,w:p7-E6,h:m7-L6},f2=Qo/se/Tr,P6=Ls/se/jr;return{tl:v0,tr:Rf,bl:_m,br:y0,tex:Um,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:p1,pixelOffsetBR:By,minFontScaleX:f2,minFontScaleY:P6,isSDF:Q}};if(!Tt||!Yt.stretchX&&!Yt.stretchY)Nt.push(Gs({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:Ue+1},{fixed:0,stretch:nr+1}));else for(var al=uO(hn,ka,ii),bl=uO(xn,ya,zi),Zs=0;Zs0&&(In=Math.max(10,In),this.circleDiameter=In)}else{var ii=Yt.top*se-Ue,zi=Yt.bottom*se+Ue,ka=Yt.left*se-Ue,ya=Yt.right*se+Ue,Ba=Yt.collisionPadding;if(Ba&&(ka-=Ba[0]*se,ii-=Ba[1]*se,ya+=Ba[2]*se,zi+=Ba[3]*se),Tr){var Ja=new c(ka,ii),Da=new c(ya,ii),po=new c(ka,zi),Oo=new c(ya,zi),Qo=Tr*Math.PI/180;Ja._rotate(Qo),Da._rotate(Qo),po._rotate(Qo),Oo._rotate(Qo),ka=Math.min(Ja.x,Da.x,po.x,Oo.x),ya=Math.max(Ja.x,Da.x,po.x,Oo.x),ii=Math.min(Ja.y,Da.y,po.y,Oo.y),zi=Math.max(Ja.y,Da.y,po.y,Oo.y)}v.emplaceBack(j.x,j.y,ka,ii,ya,zi,Q,Tt,Nt)}this.boxEndIndex=v.length},a2=function(v,j){if(v===void 0&&(v=[]),j===void 0&&(j=ont),this.data=v,this.length=this.data.length,this.compare=j,this.length>0)for(var Q=(this.length>>1)-1;Q>=0;Q--)this._down(Q)};a2.prototype.push=function(v){this.data.push(v),this.length++,this._up(this.length-1)},a2.prototype.pop=function(){if(this.length!==0){var v=this.data[0],j=this.data.pop();return this.length--,this.length>0&&(this.data[0]=j,this._down(0)),v}},a2.prototype.peek=function(){return this.data[0]},a2.prototype._up=function(v){for(var j=this,Q=j.data,Tt=j.compare,Nt=Q[v];v>0;){var Yt=v-1>>1,se=Q[Yt];if(Tt(Nt,se)>=0)break;Q[v]=se,v=Yt}Q[v]=Nt},a2.prototype._down=function(v){for(var j=this,Q=j.data,Tt=j.compare,Nt=this.length>>1,Yt=Q[v];v=0)break;Q[v]=Ue,v=se}Q[v]=Yt};function ont(v,j){return vj?1:0}function snt(v,j,Q){Q===void 0&&(Q=!1);for(var Tt=1/0,Nt=1/0,Yt=-1/0,se=-1/0,Ue=v[0],nr=0;nrYt)&&(Yt=Tr.x),(!nr||Tr.y>se)&&(se=Tr.y)}var jr=Yt-Tt,hn=se-Nt,xn=Math.min(jr,hn),In=xn/2,ii=new a2([],lnt);if(xn===0)return new c(Tt,Nt);for(var zi=Tt;ziya.d||!ya.d)&&(ya=Ja,Q&&console.log("found best %d after %d probes",Math.round(1e4*Ja.d)/1e4,Ba)),!(Ja.max-ya.d<=j)&&(In=Ja.h/2,ii.push(new o2(Ja.p.x-In,Ja.p.y-In,In,v)),ii.push(new o2(Ja.p.x+In,Ja.p.y-In,In,v)),ii.push(new o2(Ja.p.x-In,Ja.p.y+In,In,v)),ii.push(new o2(Ja.p.x+In,Ja.p.y+In,In,v)),Ba+=4)}return Q&&(console.log("num probes: "+Ba),console.log("best distance: "+ya.d)),ya.p}function lnt(v,j){return j.max-v.max}function o2(v,j,Q,Tt){this.p=new c(v,j),this.h=Q,this.d=cnt(this.p,Tt),this.max=this.d+this.h*Math.SQRT2}function cnt(v,j){for(var Q=!1,Tt=1/0,Nt=0;Ntv.y!=jr.y>v.y&&v.x<(jr.x-Tr.x)*(v.y-Tr.y)/(jr.y-Tr.y)+Tr.x&&(Q=!Q),Tt=Math.min(Tt,Mp(v,Tr,jr))}return(Q?1:-1)*Math.sqrt(Tt)}function unt(v){for(var j=0,Q=0,Tt=0,Nt=v[0],Yt=0,se=Nt.length,Ue=se-1;Yt=ns||og.y<0||og.y>=ns||fnt(v,og,d2,Q,Tt,Nt,bl,v.layers[0],v.collisionBoxArray,j.index,j.sourceLayerIndex,v.index,ya,po,ts,nr,Ja,Oo,Ls,In,j,Yt,Tr,jr,se)};if(Ps==="line")for(var Qs=0,Kc=lO(j.geometry,0,0,ns,ns);Qs1){var wf=Nm(xp,Qo,Q.vertical||ii,Tt,zi,Ba);wf&&Zs(xp,wf)}}else if(j.type==="Polygon")for(var Yp=0,Xp=ig(j.geometry,0);Ypzy&&G(v.layerIds[0]+': Value for "text-size" is >= '+A3+'. Reduce your "text-size".')):ka.kind==="composite"&&(ya=[_f*In.compositeTextSizes[0].evaluate(se,{},ii),_f*In.compositeTextSizes[1].evaluate(se,{},ii)],(ya[0]>zy||ya[1]>zy)&&G(v.layerIds[0]+': Value for "text-size" is >= '+A3+'. Reduce your "text-size".')),v.addSymbols(v.text,zi,ya,Ue,Yt,se,Tr,j,nr.lineStartIndex,nr.lineLength,xn,ii);for(var Ba=0,Ja=jr;Bazy&&G(v.layerIds[0]+': Value for "icon-size" is >= '+A3+'. Reduce your "icon-size".')):v0.kind==="composite"&&(Rf=[_f*po.compositeIconSizes[0].evaluate(Da,{},Qo),_f*po.compositeIconSizes[1].evaluate(Da,{},Qo)],(Rf[0]>zy||Rf[1]>zy)&&G(v.layerIds[0]+': Value for "icon-size" is >= '+A3+'. Reduce your "icon-size".')),v.addSymbols(v.icon,ap,Rf,Ja,Ba,Da,!1,j,Ps.lineStartIndex,Ps.lineLength,-1,Qo),su=v.icon.placedSymbolArray.length-1,g0&&(Kc=g0.length*4,v.addSymbols(v.icon,g0,Rf,Ja,Ba,Da,od.vertical,j,Ps.lineStartIndex,Ps.lineLength,-1,Qo),Zu=v.icon.placedSymbolArray.length-1)}for(var y0 in Tt.horizontal){var _m=Tt.horizontal[y0];if(!Gs){Zh=Wt(_m.text);var p1=Ue.layout.get("text-rotate").evaluate(Da,{},Qo);Gs=new T6(nr,j,Tr,jr,hn,_m,xn,In,ii,p1)}var By=_m.positionedLines.length===1;if(Gu+=dO(v,j,_m,Yt,Ue,ii,Da,zi,Ps,Tt.vertical?od.horizontal:od.horizontalOnly,By?Object.keys(Tt.horizontal):[y0],Yc,su,po,Qo),By)break}Tt.vertical&&(Th+=dO(v,j,Tt.vertical,Yt,Ue,ii,Da,zi,Ps,od.vertical,["vertical"],Yc,Zu,po,Qo));var Ry=Gs?Gs.boxStartIndex:v.collisionBoxArray.length,Fy=Gs?Gs.boxEndIndex:v.collisionBoxArray.length,d2=bl?bl.boxStartIndex:v.collisionBoxArray.length,og=bl?bl.boxEndIndex:v.collisionBoxArray.length,E6=al?al.boxStartIndex:v.collisionBoxArray.length,p7=al?al.boxEndIndex:v.collisionBoxArray.length,L6=Zs?Zs.boxStartIndex:v.collisionBoxArray.length,m7=Zs?Zs.boxEndIndex:v.collisionBoxArray.length,Um=-1,f2=function(L3,EO){return L3&&L3.circleDiameter?Math.max(L3.circleDiameter,EO):EO};Um=f2(Gs,Um),Um=f2(bl,Um),Um=f2(al,Um),Um=f2(Zs,Um);var P6=Um>-1?1:0;P6&&(Um*=ts/$r),v.glyphOffsetArray.length>=oh.MAX_GLYPHS&&G("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Da.sortKey!==void 0&&v.addToSortKeyRanges(v.symbolInstances.length,Da.sortKey),v.symbolInstances.emplaceBack(j.x,j.y,Yc.right>=0?Yc.right:-1,Yc.center>=0?Yc.center:-1,Yc.left>=0?Yc.left:-1,Yc.vertical||-1,su,Zu,Zh,Ry,Fy,d2,og,E6,p7,L6,m7,Tr,Gu,Th,Qs,Kc,P6,0,xn,gh,qd,Um)}function pnt(v,j,Q,Tt){var Nt=v.compareText;if(!(j in Nt))Nt[j]=[];else for(var Yt=Nt[j],se=Yt.length-1;se>=0;se--)if(Tt.dist(Yt[se])0)&&(Yt.value.kind!=="constant"||Yt.value.value.length>0),Tr=Ue.value.kind!=="constant"||!!Ue.value.value||Object.keys(Ue.parameters).length>0,jr=Nt.get("symbol-sort-key");if(this.features=[],!(!nr&&!Tr)){for(var hn=j.iconDependencies,xn=j.glyphDependencies,In=j.availableImages,ii=new Yl(this.zoom),zi=0,ka=v;zi=0;for(var Gu=0,Th=ts.sections;Gu=0;Ue--)Yt[Ue]={x:j[Ue].x,y:j[Ue].y,tileUnitDistanceFromAnchor:Nt},Ue>0&&(Nt+=j[Ue-1].dist(j[Ue]));for(var nr=0;nr0},oh.prototype.hasIconData=function(){return this.icon.segments.get().length>0},oh.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},oh.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},oh.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},oh.prototype.addIndicesForPlacedSymbol=function(v,j){for(var Q=v.placedSymbolArray.get(j),Tt=Q.vertexStartIndex+Q.numGlyphs*4,Nt=Q.vertexStartIndex;Nt1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(v),this.sortedAngle=v,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var Q=0,Tt=this.symbolInstanceIndexes;Q=0&&nr.indexOf(se)===Ue&&j.addIndicesForPlacedSymbol(j.text,se)}),Yt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Yt.verticalPlacedTextSymbolIndex),Yt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Yt.placedIconSymbolIndex),Yt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Yt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},hr("SymbolBucket",oh,{omit:["layers","collisionBoxArray","features","compareText"]}),oh.MAX_GLYPHS=65535,oh.addDynamicAttributes=c7;function ynt(v,j){return j.replace(/{([^{}]+)}/g,function(Q,Tt){return Tt in v?String(v[Tt]):""})}var _nt=new co({"symbol-placement":new On(Wa.layout_symbol["symbol-placement"]),"symbol-spacing":new On(Wa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new On(Wa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Si(Wa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new On(Wa.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new On(Wa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new On(Wa.layout_symbol["icon-ignore-placement"]),"icon-optional":new On(Wa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new On(Wa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Si(Wa.layout_symbol["icon-size"]),"icon-text-fit":new On(Wa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new On(Wa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Si(Wa.layout_symbol["icon-image"]),"icon-rotate":new Si(Wa.layout_symbol["icon-rotate"]),"icon-padding":new On(Wa.layout_symbol["icon-padding"]),"icon-keep-upright":new On(Wa.layout_symbol["icon-keep-upright"]),"icon-offset":new Si(Wa.layout_symbol["icon-offset"]),"icon-anchor":new Si(Wa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new On(Wa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new On(Wa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new On(Wa.layout_symbol["text-rotation-alignment"]),"text-field":new Si(Wa.layout_symbol["text-field"]),"text-font":new Si(Wa.layout_symbol["text-font"]),"text-size":new Si(Wa.layout_symbol["text-size"]),"text-max-width":new Si(Wa.layout_symbol["text-max-width"]),"text-line-height":new On(Wa.layout_symbol["text-line-height"]),"text-letter-spacing":new Si(Wa.layout_symbol["text-letter-spacing"]),"text-justify":new Si(Wa.layout_symbol["text-justify"]),"text-radial-offset":new Si(Wa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new On(Wa.layout_symbol["text-variable-anchor"]),"text-anchor":new Si(Wa.layout_symbol["text-anchor"]),"text-max-angle":new On(Wa.layout_symbol["text-max-angle"]),"text-writing-mode":new On(Wa.layout_symbol["text-writing-mode"]),"text-rotate":new Si(Wa.layout_symbol["text-rotate"]),"text-padding":new On(Wa.layout_symbol["text-padding"]),"text-keep-upright":new On(Wa.layout_symbol["text-keep-upright"]),"text-transform":new Si(Wa.layout_symbol["text-transform"]),"text-offset":new Si(Wa.layout_symbol["text-offset"]),"text-allow-overlap":new On(Wa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new On(Wa.layout_symbol["text-ignore-placement"]),"text-optional":new On(Wa.layout_symbol["text-optional"])}),xnt=new co({"icon-opacity":new Si(Wa.paint_symbol["icon-opacity"]),"icon-color":new Si(Wa.paint_symbol["icon-color"]),"icon-halo-color":new Si(Wa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Si(Wa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Si(Wa.paint_symbol["icon-halo-blur"]),"icon-translate":new On(Wa.paint_symbol["icon-translate"]),"icon-translate-anchor":new On(Wa.paint_symbol["icon-translate-anchor"]),"text-opacity":new Si(Wa.paint_symbol["text-opacity"]),"text-color":new Si(Wa.paint_symbol["text-color"],{runtimeType:mc,getOverride:function(v){return v.textColor},hasOverride:function(v){return!!v.textColor}}),"text-halo-color":new Si(Wa.paint_symbol["text-halo-color"]),"text-halo-width":new Si(Wa.paint_symbol["text-halo-width"]),"text-halo-blur":new Si(Wa.paint_symbol["text-halo-blur"]),"text-translate":new On(Wa.paint_symbol["text-translate"]),"text-translate-anchor":new On(Wa.paint_symbol["text-translate-anchor"])}),u7={paint:xnt,layout:_nt},c2=function(v){this.type=v.property.overrides?v.property.overrides.runtimeType:Gc,this.defaultValue=v};c2.prototype.evaluate=function(v){if(v.formattedSection){var j=this.defaultValue.property.overrides;if(j&&j.hasOverride(v.formattedSection))return j.getOverride(v.formattedSection)}return v.feature&&v.featureState?this.defaultValue.evaluate(v.feature,v.featureState):this.defaultValue.property.specification.default},c2.prototype.eachChild=function(v){if(!this.defaultValue.isConstant()){var j=this.defaultValue.value;v(j._styleExpression.expression)}},c2.prototype.outputDefined=function(){return!1},c2.prototype.serialize=function(){return null},hr("FormatSectionOverride",c2,{omit:["defaultValue"]});var bnt=function(v){function j(Q){v.call(this,Q,u7)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.recalculate=function(Q,Tt){if(v.prototype.recalculate.call(this,Q,Tt),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var Nt=this.layout.get("text-writing-mode");if(Nt){for(var Yt=[],se=0,Ue=Nt;se",targetMapId:Tt,sourceMapId:Yt.mapId})}}},u2.prototype.receive=function(v){var j=v.data,Q=j.id;if(Q&&!(j.targetMapId&&this.mapId!==j.targetMapId))if(j.type===""){delete this.tasks[Q];var Tt=this.cancelCallbacks[Q];delete this.cancelCallbacks[Q],Tt&&Tt()}else vt()||j.mustQueue?(this.tasks[Q]=j,this.taskQueue.push(Q),this.invoker.trigger()):this.processTask(Q,j)},u2.prototype.process=function(){if(this.taskQueue.length){var v=this.taskQueue.shift(),j=this.tasks[v];delete this.tasks[v],this.taskQueue.length&&this.invoker.trigger(),j&&this.processTask(v,j)}},u2.prototype.processTask=function(v,j){var Q=this;if(j.type===""){var Tt=this.callbacks[v];delete this.callbacks[v],Tt&&(j.error?Tt(Bn(j.error)):Tt(null,Bn(j.data)))}else{var Nt=!1,Yt=gt(this.globalScope)?void 0:[],se=j.hasCallback?function(hn,xn){Nt=!0,delete Q.cancelCallbacks[v],Q.target.postMessage({id:v,type:"",sourceMapId:Q.mapId,error:hn?fn(hn):null,data:fn(xn,Yt)},Yt)}:function(hn){Nt=!0},Ue=null,nr=Bn(j.data);if(this.parent[j.type])Ue=this.parent[j.type](j.sourceMapId,nr,se);else if(this.parent.getWorkerSource){var Tr=j.type.split("."),jr=this.parent.getWorkerSource(j.sourceMapId,Tr[0],nr.source);Ue=jr[Tr[1]](nr,se)}else se(new Error("Could not find function "+j.type));!Nt&&Ue&&Ue.cancel&&(this.cancelCallbacks[v]=Ue.cancel)}},u2.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function Int(v,j,Q){j=Math.pow(2,Q)-j-1;var Tt=yO(v*256,j*256,Q),Nt=yO((v+1)*256,(j+1)*256,Q);return Tt[0]+","+Tt[1]+","+Nt[0]+","+Nt[1]}function yO(v,j,Q){var Tt=2*Math.PI*6378137/256/Math.pow(2,Q),Nt=v*Tt-2*Math.PI*6378137/2,Yt=j*Tt-2*Math.PI*6378137/2;return[Nt,Yt]}var xf=function(v,j){v&&(j?this.setSouthWest(v).setNorthEast(j):v.length===4?this.setSouthWest([v[0],v[1]]).setNorthEast([v[2],v[3]]):this.setSouthWest(v[0]).setNorthEast(v[1]))};xf.prototype.setNorthEast=function(v){return this._ne=v instanceof sd?new sd(v.lng,v.lat):sd.convert(v),this},xf.prototype.setSouthWest=function(v){return this._sw=v instanceof sd?new sd(v.lng,v.lat):sd.convert(v),this},xf.prototype.extend=function(v){var j=this._sw,Q=this._ne,Tt,Nt;if(v instanceof sd)Tt=v,Nt=v;else if(v instanceof xf){if(Tt=v._sw,Nt=v._ne,!Tt||!Nt)return this}else{if(Array.isArray(v))if(v.length===4||v.every(Array.isArray)){var Yt=v;return this.extend(xf.convert(Yt))}else{var se=v;return this.extend(sd.convert(se))}return this}return!j&&!Q?(this._sw=new sd(Tt.lng,Tt.lat),this._ne=new sd(Nt.lng,Nt.lat)):(j.lng=Math.min(Tt.lng,j.lng),j.lat=Math.min(Tt.lat,j.lat),Q.lng=Math.max(Nt.lng,Q.lng),Q.lat=Math.max(Nt.lat,Q.lat)),this},xf.prototype.getCenter=function(){return new sd((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},xf.prototype.getSouthWest=function(){return this._sw},xf.prototype.getNorthEast=function(){return this._ne},xf.prototype.getNorthWest=function(){return new sd(this.getWest(),this.getNorth())},xf.prototype.getSouthEast=function(){return new sd(this.getEast(),this.getSouth())},xf.prototype.getWest=function(){return this._sw.lng},xf.prototype.getSouth=function(){return this._sw.lat},xf.prototype.getEast=function(){return this._ne.lng},xf.prototype.getNorth=function(){return this._ne.lat},xf.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},xf.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},xf.prototype.isEmpty=function(){return!(this._sw&&this._ne)},xf.prototype.contains=function(v){var j=sd.convert(v),Q=j.lng,Tt=j.lat,Nt=this._sw.lat<=Tt&&Tt<=this._ne.lat,Yt=this._sw.lng<=Q&&Q<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Yt=this._sw.lng>=Q&&Q>=this._ne.lng),Nt&&Yt},xf.convert=function(v){return!v||v instanceof xf?v:new xf(v)};var _O=63710088e-1,sd=function(v,j){if(isNaN(v)||isNaN(j))throw new Error("Invalid LngLat object: ("+v+", "+j+")");if(this.lng=+v,this.lat=+j,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};sd.prototype.wrap=function(){return new sd(k(this.lng,-180,180),this.lat)},sd.prototype.toArray=function(){return[this.lng,this.lat]},sd.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},sd.prototype.distanceTo=function(v){var j=Math.PI/180,Q=this.lat*j,Tt=v.lat*j,Nt=Math.sin(Q)*Math.sin(Tt)+Math.cos(Q)*Math.cos(Tt)*Math.cos((v.lng-this.lng)*j),Yt=_O*Math.acos(Math.min(Nt,1));return Yt},sd.prototype.toBounds=function(v){v===void 0&&(v=0);var j=40075017,Q=360*v/j,Tt=Q/Math.cos(Math.PI/180*this.lat);return new xf(new sd(this.lng-Tt,this.lat-Q),new sd(this.lng+Tt,this.lat+Q))},sd.convert=function(v){if(v instanceof sd)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new sd(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&typeof v=="object"&&v!==null)return new sd(Number("lng"in v?v.lng:v.lon),Number(v.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 [, ]")};var xO=2*Math.PI*_O;function bO(v){return xO*Math.cos(v*Math.PI/180)}function wO(v){return(180+v)/360}function kO(v){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+v*Math.PI/360)))/360}function TO(v,j){return v/bO(j)}function Dnt(v){return v*360-180}function d7(v){var j=180-v*360;return 360/Math.PI*Math.atan(Math.exp(j*Math.PI/180))-90}function znt(v,j){return v*bO(d7(j))}function Ont(v){return 1/Math.cos(v*Math.PI/180)}var ax=function(v,j,Q){Q===void 0&&(Q=0),this.x=+v,this.y=+j,this.z=+Q};ax.fromLngLat=function(v,j){j===void 0&&(j=0);var Q=sd.convert(v);return new ax(wO(Q.lng),kO(Q.lat),TO(j,Q.lat))},ax.prototype.toLngLat=function(){return new sd(Dnt(this.x),d7(this.y))},ax.prototype.toAltitude=function(){return znt(this.z,this.y)},ax.prototype.meterInMercatorCoordinateUnits=function(){return 1/xO*Ont(d7(this.y))};var ox=function(v,j,Q){this.z=v,this.x=j,this.y=Q,this.key=E3(0,v,v,j,Q)};ox.prototype.equals=function(v){return this.z===v.z&&this.x===v.x&&this.y===v.y},ox.prototype.url=function(v,j){var Q=Int(this.x,this.y,this.z),Tt=Bnt(this.z,this.x,this.y);return v[(this.x+this.y)%v.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(j==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",Tt).replace("{bbox-epsg-3857}",Q)},ox.prototype.getTilePoint=function(v){var j=Math.pow(2,this.z);return new c((v.x*j-this.x)*ns,(v.y*j-this.y)*ns)},ox.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var SO=function(v,j){this.wrap=v,this.canonical=j,this.key=E3(v,j.z,j.z,j.x,j.y)},bf=function(v,j,Q,Tt,Nt){this.overscaledZ=v,this.wrap=j,this.canonical=new ox(Q,+Tt,+Nt),this.key=E3(j,v,Q,Tt,Nt)};bf.prototype.equals=function(v){return this.overscaledZ===v.overscaledZ&&this.wrap===v.wrap&&this.canonical.equals(v.canonical)},bf.prototype.scaledTo=function(v){var j=this.canonical.z-v;return v>this.canonical.z?new bf(v,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new bf(v,this.wrap,v,this.canonical.x>>j,this.canonical.y>>j)},bf.prototype.calculateScaledKey=function(v,j){var Q=this.canonical.z-v;return v>this.canonical.z?E3(this.wrap*+j,v,this.canonical.z,this.canonical.x,this.canonical.y):E3(this.wrap*+j,v,v,this.canonical.x>>Q,this.canonical.y>>Q)},bf.prototype.isChildOf=function(v){if(v.wrap!==this.wrap)return!1;var j=this.canonical.z-v.canonical.z;return v.overscaledZ===0||v.overscaledZ>j&&v.canonical.y===this.canonical.y>>j},bf.prototype.children=function(v){if(this.overscaledZ>=v)return[new bf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var j=this.canonical.z+1,Q=this.canonical.x*2,Tt=this.canonical.y*2;return[new bf(j,this.wrap,j,Q,Tt),new bf(j,this.wrap,j,Q+1,Tt),new bf(j,this.wrap,j,Q,Tt+1),new bf(j,this.wrap,j,Q+1,Tt+1)]},bf.prototype.isLessThan=function(v){return this.wrapv.wrap?!1:this.overscaledZv.overscaledZ?!1:this.canonical.xv.canonical.x?!1:this.canonical.y0;Yt--)Nt=1<=this.dim+1||j<-1||j>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(j+1)*this.stride+(v+1)},d1.prototype._unpackMapbox=function(v,j,Q){return(v*256*256+j*256+Q)/10-1e4},d1.prototype._unpackTerrarium=function(v,j,Q){return v*256+j+Q/256-32768},d1.prototype.getPixels=function(){return new gp({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},d1.prototype.backfillBorder=function(v,j,Q){if(this.dim!==v.dim)throw new Error("dem dimension mismatch");var Tt=j*this.dim,Nt=j*this.dim+this.dim,Yt=Q*this.dim,se=Q*this.dim+this.dim;switch(j){case-1:Tt=Nt-1;break;case 1:Nt=Tt+1;break}switch(Q){case-1:Yt=se-1;break;case 1:se=Yt+1;break}for(var Ue=-j*this.dim,nr=-Q*this.dim,Tr=Yt;Tr=0&&jr[3]>=0&&Ue.insert(se,jr[0],jr[1],jr[2],jr[3])}},f1.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new u1.VectorTile(new Kn(this.rawTileData)).layers,this.sourceLayerCoder=new A6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},f1.prototype.query=function(v,j,Q,Tt){var Nt=this;this.loadVTLayers();for(var Yt=v.params||{},se=ns/v.tileSize/v.scale,Ue=le(Yt.filter),nr=v.queryGeometry,Tr=v.queryPadding*se,jr=AO(nr),hn=this.grid.query(jr.minX-Tr,jr.minY-Tr,jr.maxX+Tr,jr.maxY+Tr),xn=AO(v.cameraQueryGeometry),In=this.grid3D.query(xn.minX-Tr,xn.minY-Tr,xn.maxX+Tr,xn.maxY+Tr,function(po,Oo,Qo,ts){return rg(v.cameraQueryGeometry,po-Tr,Oo-Tr,Qo+Tr,ts+Tr)}),ii=0,zi=In;iiTt)Nt=!1;else if(!j)Nt=!0;else if(this.expirationTime=Yr.maxzoom)&&Yr.visibility!=="none"){m(cn,this.zoom,vr);var un=Li[Yr.id]=Yr.createBucket({index:Wn.bucketLayerIDs.length,layers:cn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Ei,sourceID:this.source});un.populate(Ga,Fi,this.tileID.canonical),Wn.bucketLayerIDs.push(cn.map(function(Jn){return Jn.id}))}}}}var Pn,bn,ze,yr,en=n.mapObject(Fi.glyphDependencies,function(Jn){return Object.keys(Jn).map(Number)});Object.keys(en).length?Ar.send("getGlyphs",{uid:this.uid,stacks:en},function(Jn,Gn){Pn||(Pn=Jn,bn=Gn,xi.call(Zn))}):bn={};var Rn=Object.keys(Fi.iconDependencies);Rn.length?Ar.send("getImages",{icons:Rn,source:this.source,tileID:this.tileID,type:"icons"},function(Jn,Gn){Pn||(Pn=Jn,ze=Gn,xi.call(Zn))}):ze={};var ni=Object.keys(Fi.patternDependencies);ni.length?Ar.send("getImages",{icons:ni,source:this.source,tileID:this.tileID,type:"patterns"},function(Jn,Gn){Pn||(Pn=Jn,yr=Gn,xi.call(Zn))}):yr={},xi.call(this);function xi(){if(Pn)return mn(Pn);if(bn&&ze&&yr){var Jn=new s(bn),Gn=new n.ImageAtlas(ze,yr);for(var pi in Li){var Va=Li[pi];Va instanceof n.SymbolBucket?(m(Va.layers,this.zoom,vr),n.performSymbolLayout(Va,bn,Jn.positions,ze,Gn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Va.hasPattern&&(Va instanceof n.LineBucket||Va instanceof n.FillBucket||Va instanceof n.FillExtrusionBucket)&&(m(Va.layers,this.zoom,vr),Va.addFeatures(Fi,this.tileID.canonical,Gn.patternPositions))}this.status="done",mn(null,{buckets:n.values(Li).filter(function(ea){return!ea.isEmpty()}),featureIndex:Wn,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Jn.image,imageAtlas:Gn,glyphMap:this.returnDependencies?bn:null,iconMap:this.returnDependencies?ze:null,glyphPositions:this.returnDependencies?Jn.positions:null})}}};function m(Ke,sr,vr){for(var Ar=new n.EvaluationParameters(sr),mn=0,Zn=Ke;mn=0!=!!sr&&Ke.reverse()}var E=n.vectorTile.VectorTileFeature.prototype.toGeoJSON,I=function(Ke){this._feature=Ke,this.extent=n.EXTENT,this.type=Ke.type,this.properties=Ke.tags,"id"in Ke&&!isNaN(Ke.id)&&(this.id=parseInt(Ke.id,10))};I.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Ke=[],sr=0,vr=this._feature.geometry;sr"u"&&(Ar.push(Wn),Li=Ar.length-1,Zn[Wn]=Li),sr.writeVarint(Li);var Fi=vr.properties[Wn],Zi=typeof Fi;Zi!=="string"&&Zi!=="boolean"&&Zi!=="number"&&(Fi=JSON.stringify(Fi));var Ji=Zi+":"+Fi,ca=Un[Ji];typeof ca>"u"&&(mn.push(Fi),ca=mn.length-1,Un[Ji]=ca),sr.writeVarint(ca)}}function ht(Ke,sr){return(sr<<3)+(Ke&7)}function bt(Ke){return Ke<<1^Ke>>31}function vt(Ke,sr){for(var vr=Ke.loadGeometry(),Ar=Ke.type,mn=0,Zn=0,Un=vr.length,Wn=0;Wn>1;gt(Ke,sr,Un,Ar,mn,Zn%2),rt(Ke,sr,vr,Ar,Un-1,Zn+1),rt(Ke,sr,vr,Un+1,mn,Zn+1)}}function gt(Ke,sr,vr,Ar,mn,Zn){for(;mn>Ar;){if(mn-Ar>600){var Un=mn-Ar+1,Wn=vr-Ar+1,Li=Math.log(Un),Fi=.5*Math.exp(2*Li/3),Zi=.5*Math.sqrt(Li*Fi*(Un-Fi)/Un)*(Wn-Un/2<0?-1:1),Ji=Math.max(Ar,Math.floor(vr-Wn*Fi/Un+Zi)),ca=Math.min(mn,Math.floor(vr+(Un-Wn)*Fi/Un+Zi));gt(Ke,sr,vr,Ji,ca,Zn)}var Ei=sr[2*vr+Zn],Ga=Ar,so=mn;for(it(Ke,sr,Ar,vr),sr[2*mn+Zn]>Ei&&it(Ke,sr,Ar,mn);GaEi;)so--}sr[2*Ar+Zn]===Ei?it(Ke,sr,Ar,so):(so++,it(Ke,sr,so,mn)),so<=vr&&(Ar=so+1),vr<=so&&(mn=so-1)}}function it(Ke,sr,vr,Ar){st(Ke,vr,Ar),st(sr,2*vr,2*Ar),st(sr,2*vr+1,2*Ar+1)}function st(Ke,sr,vr){var Ar=Ke[sr];Ke[sr]=Ke[vr],Ke[vr]=Ar}function xt(Ke,sr,vr,Ar,mn,Zn,Un){for(var Wn=[0,Ke.length-1,0],Li=[],Fi,Zi;Wn.length;){var Ji=Wn.pop(),ca=Wn.pop(),Ei=Wn.pop();if(ca-Ei<=Un){for(var Ga=Ei;Ga<=ca;Ga++)Fi=sr[2*Ga],Zi=sr[2*Ga+1],Fi>=vr&&Fi<=mn&&Zi>=Ar&&Zi<=Zn&&Li.push(Ke[Ga]);continue}var so=Math.floor((Ei+ca)/2);Fi=sr[2*so],Zi=sr[2*so+1],Fi>=vr&&Fi<=mn&&Zi>=Ar&&Zi<=Zn&&Li.push(Ke[so]);var Fe=(Ji+1)%2;(Ji===0?vr<=Fi:Ar<=Zi)&&(Wn.push(Ei),Wn.push(so-1),Wn.push(Fe)),(Ji===0?mn>=Fi:Zn>=Zi)&&(Wn.push(so+1),Wn.push(ca),Wn.push(Fe))}return Li}function ot(Ke,sr,vr,Ar,mn,Zn){for(var Un=[0,Ke.length-1,0],Wn=[],Li=mn*mn;Un.length;){var Fi=Un.pop(),Zi=Un.pop(),Ji=Un.pop();if(Zi-Ji<=Zn){for(var ca=Ji;ca<=Zi;ca++)J(sr[2*ca],sr[2*ca+1],vr,Ar)<=Li&&Wn.push(Ke[ca]);continue}var Ei=Math.floor((Ji+Zi)/2),Ga=sr[2*Ei],so=sr[2*Ei+1];J(Ga,so,vr,Ar)<=Li&&Wn.push(Ke[Ei]);var Fe=(Fi+1)%2;(Fi===0?vr-mn<=Ga:Ar-mn<=so)&&(Un.push(Ji),Un.push(Ei-1),Un.push(Fe)),(Fi===0?vr+mn>=Ga:Ar+mn>=so)&&(Un.push(Ei+1),Un.push(Zi),Un.push(Fe))}return Wn}function J(Ke,sr,vr,Ar){var mn=Ke-vr,Zn=sr-Ar;return mn*mn+Zn*Zn}var mt=function(Ke){return Ke[0]},dt=function(Ke){return Ke[1]},Ct=function(Ke,sr,vr,Ar,mn){sr===void 0&&(sr=mt),vr===void 0&&(vr=dt),Ar===void 0&&(Ar=64),mn===void 0&&(mn=Float64Array),this.nodeSize=Ar,this.points=Ke;for(var Zn=Ke.length<65536?Uint16Array:Uint32Array,Un=this.ids=new Zn(Ke.length),Wn=this.coords=new mn(Ke.length*2),Li=0;Li=Ar;Fi--){var Zi=+Date.now();Wn=this._cluster(Wn,Fi),this.trees[Fi]=new Ct(Wn,Lt,ie,Zn,Float32Array),vr&&console.log("z%d: %d clusters in %dms",Fi,Wn.length,+Date.now()-Zi)}return vr&&console.timeEnd("total time"),this},Bt.prototype.getClusters=function(Ke,sr){var vr=((Ke[0]+180)%360+360)%360-180,Ar=Math.max(-90,Math.min(90,Ke[1])),mn=Ke[2]===180?180:((Ke[2]+180)%360+360)%360-180,Zn=Math.max(-90,Math.min(90,Ke[3]));if(Ke[2]-Ke[0]>=360)vr=-180,mn=180;else if(vr>mn){var Un=this.getClusters([vr,Ar,180,Zn],sr),Wn=this.getClusters([-180,Ar,mn,Zn],sr);return Un.concat(Wn)}for(var Li=this.trees[this._limitZoom(sr)],Fi=Li.range(ge(vr),ye(Zn),ge(mn),ye(Ar)),Zi=[],Ji=0,ca=Fi;Jisr&&(Ga+=Kr.numPoints||1)}if(Ga>=Wn){for(var sn=Zi.x*Ei,cn=Zi.y*Ei,Yr=Un&&Ei>1?this._map(Zi,!0):null,un=(Fi<<5)+(sr+1)+this.points.length,Pn=0,bn=ca;Pn1)for(var Rn=0,ni=ca;Rn>5},Bt.prototype._getOriginZoom=function(Ke){return(Ke-this.points.length)%32},Bt.prototype._map=function(Ke,sr){if(Ke.numPoints)return sr?Ot({},Ke.properties):Ke.properties;var vr=this.points[Ke.index].properties,Ar=this.options.map(vr);return sr&&Ar===vr?Ot({},Ar):Ar};function Zt(Ke,sr,vr,Ar,mn){return{x:Ke,y:sr,zoom:1/0,id:vr,parentId:-1,numPoints:Ar,properties:mn}}function Gt(Ke,sr){var vr=Ke.geometry.coordinates,Ar=vr[0],mn=vr[1];return{x:ge(Ar),y:ye(mn),zoom:1/0,index:sr,parentId:-1}}function ee(Ke){return{type:"Feature",id:Ke.id,properties:xe(Ke),geometry:{type:"Point",coordinates:[ue(Ke.x),Mt(Ke.y)]}}}function xe(Ke){var sr=Ke.numPoints,vr=sr>=1e4?Math.round(sr/1e3)+"k":sr>=1e3?Math.round(sr/100)/10+"k":sr;return Ot(Ot({},Ke.properties),{cluster:!0,cluster_id:Ke.id,point_count:sr,point_count_abbreviated:vr})}function ge(Ke){return Ke/360+.5}function ye(Ke){var sr=Math.sin(Ke*Math.PI/180),vr=.5-.25*Math.log((1+sr)/(1-sr))/Math.PI;return vr<0?0:vr>1?1:vr}function ue(Ke){return(Ke-.5)*360}function Mt(Ke){var sr=(180-Ke*360)*Math.PI/180;return 360*Math.atan(Math.exp(sr))/Math.PI-90}function Ot(Ke,sr){for(var vr in sr)Ke[vr]=sr[vr];return Ke}function Lt(Ke){return Ke.x}function ie(Ke){return Ke.y}function be(Ke,sr,vr,Ar){for(var mn=Ar,Zn=vr-sr>>1,Un=vr-sr,Wn,Li=Ke[sr],Fi=Ke[sr+1],Zi=Ke[vr],Ji=Ke[vr+1],ca=sr+3;camn)Wn=ca,mn=Ei;else if(Ei===mn){var Ga=Math.abs(ca-Zn);GaAr&&(Wn-sr>3&&be(Ke,sr,Wn,Ar),Ke[Wn+2]=mn,vr-Wn>3&&be(Ke,Wn,vr,Ar))}function ce(Ke,sr,vr,Ar,mn,Zn){var Un=mn-vr,Wn=Zn-Ar;if(Un!==0||Wn!==0){var Li=((Ke-vr)*Un+(sr-Ar)*Wn)/(Un*Un+Wn*Wn);Li>1?(vr=mn,Ar=Zn):Li>0&&(vr+=Un*Li,Ar+=Wn*Li)}return Un=Ke-vr,Wn=sr-Ar,Un*Un+Wn*Wn}function Le(Ke,sr,vr,Ar){var mn={id:typeof Ke>"u"?null:Ke,type:sr,geometry:vr,tags:Ar,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Ze(mn),mn}function Ze(Ke){var sr=Ke.geometry,vr=Ke.type;if(vr==="Point"||vr==="MultiPoint"||vr==="LineString")Qe(Ke,sr);else if(vr==="Polygon"||vr==="MultiLineString")for(var Ar=0;Ar0&&(Ar?Un+=(mn*Fi-Li*Zn)/2:Un+=Math.sqrt(Math.pow(Li-mn,2)+Math.pow(Fi-Zn,2))),mn=Li,Zn=Fi}var Zi=sr.length-3;sr[2]=1,be(sr,0,Zi,vr),sr[Zi+2]=1,sr.size=Math.abs(Un),sr.start=0,sr.end=sr.size}function Er(Ke,sr,vr,Ar){for(var mn=0;mn1?1:vr}function Oe(Ke,sr,vr,Ar,mn,Zn,Un,Wn){if(vr/=sr,Ar/=sr,Zn>=vr&&Un=Ar)return null;for(var Li=[],Fi=0;Fi=vr&&Ga=Ar)continue;var so=[];if(ca==="Point"||ca==="MultiPoint")Xt(Ji,so,vr,Ar,mn);else if(ca==="LineString")oe(Ji,so,vr,Ar,mn,!1,Wn.lineMetrics);else if(ca==="MultiLineString")_t(Ji,so,vr,Ar,mn,!1);else if(ca==="Polygon")_t(Ji,so,vr,Ar,mn,!0);else if(ca==="MultiPolygon")for(var Fe=0;Fe=vr&&Un<=Ar&&(sr.push(Ke[Zn]),sr.push(Ke[Zn+1]),sr.push(Ke[Zn+2]))}}function oe(Ke,sr,vr,Ar,mn,Zn,Un){for(var Wn=zt(Ke),Li=mn===0?Ht:ae,Fi=Ke.start,Zi,Ji,ca=0;cavr&&(Ji=Li(Wn,Ei,Ga,Fe,Re,vr),Un&&(Wn.start=Fi+Zi*Ji)):Kr>Ar?sn=vr&&(Ji=Li(Wn,Ei,Ga,Fe,Re,vr),cn=!0),sn>Ar&&Kr<=Ar&&(Ji=Li(Wn,Ei,Ga,Fe,Re,Ar),cn=!0),!Zn&&cn&&(Un&&(Wn.end=Fi+Zi*Ji),sr.push(Wn),Wn=zt(Ke)),Un&&(Fi+=Zi)}var Yr=Ke.length-3;Ei=Ke[Yr],Ga=Ke[Yr+1],so=Ke[Yr+2],Kr=mn===0?Ei:Ga,Kr>=vr&&Kr<=Ar&&Pt(Wn,Ei,Ga,so),Yr=Wn.length-3,Zn&&Yr>=3&&(Wn[Yr]!==Wn[0]||Wn[Yr+1]!==Wn[1])&&Pt(Wn,Wn[0],Wn[1],Wn[2]),Wn.length&&sr.push(Wn)}function zt(Ke){var sr=[];return sr.size=Ke.size,sr.start=Ke.start,sr.end=Ke.end,sr}function _t(Ke,sr,vr,Ar,mn,Zn){for(var Un=0;UnUn.maxX&&(Un.maxX=Zi),Ji>Un.maxY&&(Un.maxY=Ji)}return Un}function zr(Ke,sr,vr,Ar){var mn=sr.geometry,Zn=sr.type,Un=[];if(Zn==="Point"||Zn==="MultiPoint")for(var Wn=0;Wn0&&sr.size<(mn?Un:Ar)){vr.numPoints+=sr.length/3;return}for(var Wn=[],Li=0;LiUn)&&(vr.numSimplified++,Wn.push(sr[Li]),Wn.push(sr[Li+1])),vr.numPoints++;mn&&pn(Wn,Zn),Ke.push(Wn)}function pn(Ke,sr){for(var vr=0,Ar=0,mn=Ke.length,Zn=mn-2;Ar0===sr)for(Ar=0,mn=Ke.length;Ar24)throw new Error("maxZoom should be in the 0-24 range");if(sr.promoteId&&sr.generateId)throw new Error("promoteId and generateId cannot be used together.");var Ar=mr(Ke,sr);this.tiles={},this.tileCoords=[],vr&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",sr.indexMaxZoom,sr.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ar=he(Ar,sr),Ar.length&&this.splitTile(Ar,0,0,0),vr&&(Ar.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}ui.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ui.prototype.splitTile=function(Ke,sr,vr,Ar,mn,Zn,Un){for(var Wn=[Ke,sr,vr,Ar],Li=this.options,Fi=Li.debug;Wn.length;){Ar=Wn.pop(),vr=Wn.pop(),sr=Wn.pop(),Ke=Wn.pop();var Zi=1<1&&console.time("creation"),ca=this.tiles[Ji]=Rr(Ke,sr,vr,Ar,Li),this.tileCoords.push({z:sr,x:vr,y:Ar}),Fi)){Fi>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",sr,vr,Ar,ca.numFeatures,ca.numPoints,ca.numSimplified),console.timeEnd("creation"));var Ei="z"+sr;this.stats[Ei]=(this.stats[Ei]||0)+1,this.total++}if(ca.source=Ke,mn){if(sr===Li.maxZoom||sr===mn)continue;var Ga=1<1&&console.time("clipping");var so=.5*Li.buffer/Li.extent,Fe=.5-so,Re=.5+so,Kr=1+so,sn,cn,Yr,un,Pn,bn;sn=cn=Yr=un=null,Pn=Oe(Ke,Zi,vr-so,vr+Re,0,ca.minX,ca.maxX,Li),bn=Oe(Ke,Zi,vr+Fe,vr+Kr,0,ca.minX,ca.maxX,Li),Ke=null,Pn&&(sn=Oe(Pn,Zi,Ar-so,Ar+Re,1,ca.minY,ca.maxY,Li),cn=Oe(Pn,Zi,Ar+Fe,Ar+Kr,1,ca.minY,ca.maxY,Li),Pn=null),bn&&(Yr=Oe(bn,Zi,Ar-so,Ar+Re,1,ca.minY,ca.maxY,Li),un=Oe(bn,Zi,Ar+Fe,Ar+Kr,1,ca.minY,ca.maxY,Li),bn=null),Fi>1&&console.timeEnd("clipping"),Wn.push(sn||[],sr+1,vr*2,Ar*2),Wn.push(cn||[],sr+1,vr*2,Ar*2+1),Wn.push(Yr||[],sr+1,vr*2+1,Ar*2),Wn.push(un||[],sr+1,vr*2+1,Ar*2+1)}}},ui.prototype.getTile=function(Ke,sr,vr){var Ar=this.options,mn=Ar.extent,Zn=Ar.debug;if(Ke<0||Ke>24)return null;var Un=1<1&&console.log("drilling down to z%d-%d-%d",Ke,sr,vr);for(var Li=Ke,Fi=sr,Zi=vr,Ji;!Ji&&Li>0;)Li--,Fi=Math.floor(Fi/2),Zi=Math.floor(Zi/2),Ji=this.tiles[yi(Li,Fi,Zi)];return!Ji||!Ji.source?null:(Zn>1&&console.log("found parent tile z%d-%d-%d",Li,Fi,Zi),Zn>1&&console.time("drilling down"),this.splitTile(Ji.source,Li,Fi,Zi,Ke,sr,vr),Zn>1&&console.timeEnd("drilling down"),this.tiles[Wn]?Ye(this.tiles[Wn],mn):null)};function yi(Ke,sr,vr){return((1<=0?0:Z.button},a.remove=function(Z){Z.parentNode&&Z.parentNode.removeChild(Z)};function _(Z,lt,nt){var wt,Wt,ve,ke=n.browser.devicePixelRatio>1?"@2x":"",Jt=n.getJSON(lt.transformRequest(lt.normalizeSpriteURL(Z,ke,".json"),n.ResourceType.SpriteJSON),function(lr,tr){Jt=null,ve||(ve=lr,wt=tr,De())}),fe=n.getImage(lt.transformRequest(lt.normalizeSpriteURL(Z,ke,".png"),n.ResourceType.SpriteImage),function(lr,tr){fe=null,ve||(ve=lr,Wt=tr,De())});function De(){if(ve)nt(ve);else if(wt&&Wt){var lr=n.browser.getImageData(Wt),tr={};for(var ar in wt){var dr=wt[ar],gr=dr.width,Ge=dr.height,rr=dr.x,Je=dr.y,Hr=dr.sdf,wn=dr.pixelRatio,Ln=dr.stretchX,Ii=dr.stretchY,Mi=dr.content,gi=new n.RGBAImage({width:gr,height:Ge});n.RGBAImage.copy(lr,gi,{x:rr,y:Je},{x:0,y:0},{width:gr,height:Ge}),tr[ar]={data:gi,pixelRatio:wn,sdf:Hr,stretchX:Ln,stretchY:Ii,content:Mi}}nt(null,tr)}}return{cancel:function(){Jt&&(Jt.cancel(),Jt=null),fe&&(fe.cancel(),fe=null)}}}function A(Z){var lt=Z.userImage;if(lt&<.render){var nt=lt.render();if(nt)return Z.data.replace(new Uint8Array(lt.data.buffer)),!0}return!1}var d=1,k=function(Z){function lt(){Z.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new n.RGBAImage({width:1,height:1}),this.dirty=!0}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.isLoaded=function(){return this.loaded},lt.prototype.setLoaded=function(nt){if(this.loaded!==nt&&(this.loaded=nt,nt)){for(var wt=0,Wt=this.requestors;wt=0?1.2:1))}M.prototype.draw=function(Z){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(Z,this.buffer,this.middle);for(var lt=this.ctx.getImageData(0,0,this.size,this.size),nt=new Uint8ClampedArray(this.size*this.size),wt=0;wt65535){De(new Error("glyphs > 65535 not supported"));return}if(ar.ranges[gr]){De(null,{stack:lr,id:tr,glyph:dr});return}var Ge=ar.requests[gr];Ge||(Ge=ar.requests[gr]=[],C.loadGlyphRange(lr,gr,nt.url,nt.requestManager,function(rr,Je){if(Je){for(var Hr in Je)nt._doesCharSupportLocalGlyph(+Hr)||(ar.glyphs[+Hr]=Je[+Hr]);ar.ranges[gr]=!0}for(var wn=0,Ln=Ge;wn1&&(fe=Z[++Jt]);var lr=Math.abs(De-fe.left),tr=Math.abs(De-fe.right),ar=Math.min(lr,tr),dr=void 0,gr=Wt/nt*(wt+1);if(fe.isDash){var Ge=wt-Math.abs(gr);dr=Math.sqrt(ar*ar+Ge*Ge)}else dr=wt-Math.sqrt(ar*ar+gr*gr);this.data[ke+De]=Math.max(0,Math.min(255,dr+128))}},V.prototype.addRegularDash=function(Z){for(var lt=Z.length-1;lt>=0;--lt){var nt=Z[lt],wt=Z[lt+1];nt.zeroLength?Z.splice(lt,1):wt&&wt.isDash===nt.isDash&&(wt.left=nt.left,Z.splice(lt,1))}var Wt=Z[0],ve=Z[Z.length-1];Wt.isDash===ve.isDash&&(Wt.left=ve.left-this.width,ve.right=Wt.right+this.width);for(var ke=this.width*this.nextRow,Jt=0,fe=Z[Jt],De=0;De1&&(fe=Z[++Jt]);var lr=Math.abs(De-fe.left),tr=Math.abs(De-fe.right),ar=Math.min(lr,tr),dr=fe.isDash?ar:-ar;this.data[ke+De]=Math.max(0,Math.min(255,dr+128))}},V.prototype.addDash=function(Z,lt){var nt=lt?7:0,wt=2*nt+1;if(this.nextRow+wt>this.height)return n.warnOnce("LineAtlas out of space"),null;for(var Wt=0,ve=0;ve=nt.minX&&Z.x=nt.minY&&Z.y0&&(De[new n.OverscaledTileID(nt.overscaledZ,ke,wt.z,ve,wt.y-1).key]={backfilled:!1},De[new n.OverscaledTileID(nt.overscaledZ,nt.wrap,wt.z,wt.x,wt.y-1).key]={backfilled:!1},De[new n.OverscaledTileID(nt.overscaledZ,fe,wt.z,Jt,wt.y-1).key]={backfilled:!1}),wt.y+10&&(Wt.resourceTiming=nt._resourceTiming,nt._resourceTiming=[]),nt.fire(new n.Event("data",Wt))})},lt.prototype.onAdd=function(nt){this.map=nt,this.load()},lt.prototype.setData=function(nt){var wt=this;return this._data=nt,this.fire(new n.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Wt){if(Wt){wt.fire(new n.ErrorEvent(Wt));return}var ve={dataType:"source",sourceDataType:"content"};wt._collectResourceTiming&&wt._resourceTiming&&wt._resourceTiming.length>0&&(ve.resourceTiming=wt._resourceTiming,wt._resourceTiming=[]),wt.fire(new n.Event("data",ve))}),this},lt.prototype.getClusterExpansionZoom=function(nt,wt){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:nt,source:this.id},wt),this},lt.prototype.getClusterChildren=function(nt,wt){return this.actor.send("geojson.getClusterChildren",{clusterId:nt,source:this.id},wt),this},lt.prototype.getClusterLeaves=function(nt,wt,Wt,ve){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:nt,limit:wt,offset:Wt},ve),this},lt.prototype._updateWorkerData=function(nt){var wt=this;this._loaded=!1;var Wt=n.extend({},this.workerOptions),ve=this._data;typeof ve=="string"?(Wt.request=this.map._requestManager.transformRequest(n.browser.resolveURL(ve),n.ResourceType.Source),Wt.request.collectResourceTiming=this._collectResourceTiming):Wt.data=JSON.stringify(ve),this.actor.send(this.type+".loadData",Wt,function(ke,Jt){wt._removed||Jt&&Jt.abandoned||(wt._loaded=!0,Jt&&Jt.resourceTiming&&Jt.resourceTiming[wt.id]&&(wt._resourceTiming=Jt.resourceTiming[wt.id].slice(0)),wt.actor.send(wt.type+".coalesce",{source:Wt.source},null),nt(ke))})},lt.prototype.loaded=function(){return this._loaded},lt.prototype.loadTile=function(nt,wt){var Wt=this,ve=nt.actor?"reloadTile":"loadTile";nt.actor=this.actor;var ke={type:this.type,uid:nt.uid,tileID:nt.tileID,zoom:nt.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:n.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};nt.request=this.actor.send(ve,ke,function(Jt,fe){return delete nt.request,nt.unloadVectorData(),nt.aborted?wt(null):Jt?wt(Jt):(nt.loadVectorData(fe,Wt.map.painter,ve==="reloadTile"),wt(null))})},lt.prototype.abortTile=function(nt){nt.request&&(nt.request.cancel(),delete nt.request),nt.aborted=!0},lt.prototype.unloadTile=function(nt){nt.unloadVectorData(),this.actor.send("removeTile",{uid:nt.uid,type:this.type,source:this.id})},lt.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},lt.prototype.serialize=function(){return n.extend({},this._options,{type:this.type,data:this._data})},lt.prototype.hasTransition=function(){return!1},lt}(n.Evented),bt=n.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),vt=function(Z){function lt(nt,wt,Wt,ve){Z.call(this),this.id=nt,this.dispatcher=Wt,this.coordinates=wt.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(ve),this.options=wt}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.load=function(nt,wt){var Wt=this;this._loaded=!1,this.fire(new n.Event("dataloading",{dataType:"source"})),this.url=this.options.url,n.getImage(this.map._requestManager.transformRequest(this.url,n.ResourceType.Image),function(ve,ke){Wt._loaded=!0,ve?Wt.fire(new n.ErrorEvent(ve)):ke&&(Wt.image=ke,nt&&(Wt.coordinates=nt),wt&&wt(),Wt._finishLoading())})},lt.prototype.loaded=function(){return this._loaded},lt.prototype.updateImage=function(nt){var wt=this;return!this.image||!nt.url?this:(this.options.url=nt.url,this.load(nt.coordinates,function(){wt.texture=null}),this)},lt.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"metadata"})))},lt.prototype.onAdd=function(nt){this.map=nt,this.load()},lt.prototype.setCoordinates=function(nt){var wt=this;this.coordinates=nt;var Wt=nt.map(n.MercatorCoordinate.fromLngLat);this.tileID=ut(Wt),this.minzoom=this.maxzoom=this.tileID.z;var ve=Wt.map(function(ke){return wt.tileID.getTilePoint(ke)._round()});return this._boundsArray=new n.StructArrayLayout4i8,this._boundsArray.emplaceBack(ve[0].x,ve[0].y,0,0),this._boundsArray.emplaceBack(ve[1].x,ve[1].y,n.EXTENT,0),this._boundsArray.emplaceBack(ve[3].x,ve[3].y,0,n.EXTENT),this._boundsArray.emplaceBack(ve[2].x,ve[2].y,n.EXTENT,n.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new n.Event("data",{dataType:"source",sourceDataType:"content"})),this},lt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var nt=this.map.painter.context,wt=nt.gl;this.boundsBuffer||(this.boundsBuffer=nt.createVertexBuffer(this._boundsArray,bt.members)),this.boundsSegments||(this.boundsSegments=n.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new n.Texture(nt,this.image,wt.RGBA),this.texture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE));for(var Wt in this.tiles){var ve=this.tiles[Wt];ve.state!=="loaded"&&(ve.state="loaded",ve.texture=this.texture)}}},lt.prototype.loadTile=function(nt,wt){this.tileID&&this.tileID.equals(nt.tileID.canonical)?(this.tiles[String(nt.tileID.wrap)]=nt,nt.buckets={},wt(null)):(nt.state="errored",wt(null))},lt.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},lt.prototype.hasTransition=function(){return!1},lt}(n.Evented);function ut(Z){for(var lt=1/0,nt=1/0,wt=-1/0,Wt=-1/0,ve=0,ke=Z;vewt.end(0)?this.fire(new n.ErrorEvent(new n.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+wt.start(0)+" and "+wt.end(0)+"-second mark."))):this.video.currentTime=nt}},lt.prototype.getVideo=function(){return this.video},lt.prototype.onAdd=function(nt){this.map||(this.map=nt,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},lt.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var nt=this.map.painter.context,wt=nt.gl;this.boundsBuffer||(this.boundsBuffer=nt.createVertexBuffer(this._boundsArray,bt.members)),this.boundsSegments||(this.boundsSegments=n.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE),wt.texSubImage2D(wt.TEXTURE_2D,0,0,0,wt.RGBA,wt.UNSIGNED_BYTE,this.video)):(this.texture=new n.Texture(nt,this.video,wt.RGBA),this.texture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE));for(var Wt in this.tiles){var ve=this.tiles[Wt];ve.state!=="loaded"&&(ve.state="loaded",ve.texture=this.texture)}}},lt.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},lt.prototype.hasTransition=function(){return this.video&&!this.video.paused},lt}(vt),gt=function(Z){function lt(nt,wt,Wt,ve){Z.call(this,nt,wt,Wt,ve),wt.coordinates?(!Array.isArray(wt.coordinates)||wt.coordinates.length!==4||wt.coordinates.some(function(ke){return!Array.isArray(ke)||ke.length!==2||ke.some(function(Jt){return typeof Jt!="number"})}))&&this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,null,'missing required property "coordinates"'))),wt.animate&&typeof wt.animate!="boolean"&&this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,null,'optional "animate" property must be a boolean value'))),wt.canvas?typeof wt.canvas!="string"&&!(wt.canvas instanceof n.window.HTMLCanvasElement)&&this.fire(new n.ErrorEvent(new n.ValidationError("sources."+nt,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 n.ErrorEvent(new n.ValidationError("sources."+nt,null,'missing required property "canvas"'))),this.options=wt,this.animate=wt.animate!==void 0?wt.animate:!0}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof n.window.HTMLCanvasElement?this.options.canvas:n.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new n.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},lt.prototype.getCanvas=function(){return this.canvas},lt.prototype.onAdd=function(nt){this.map=nt,this.load(),this.canvas&&this.animate&&this.play()},lt.prototype.onRemove=function(){this.pause()},lt.prototype.prepare=function(){var nt=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,nt=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,nt=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var wt=this.map.painter.context,Wt=wt.gl;this.boundsBuffer||(this.boundsBuffer=wt.createVertexBuffer(this._boundsArray,bt.members)),this.boundsSegments||(this.boundsSegments=n.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(nt||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new n.Texture(wt,this.canvas,Wt.RGBA,{premultiply:!0});for(var ve in this.tiles){var ke=this.tiles[ve];ke.state!=="loaded"&&(ke.state="loaded",ke.texture=this.texture)}}},lt.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},lt.prototype.hasTransition=function(){return this._playing},lt.prototype._hasInvalidDimensions=function(){for(var nt=0,wt=[this.canvas.width,this.canvas.height];ntthis.max){var ke=this._getAndRemoveByKey(this.order[0]);ke&&this.onRemove(ke)}return this},Gt.prototype.has=function(Z){return Z.wrapped().key in this.data},Gt.prototype.getAndRemove=function(Z){return this.has(Z)?this._getAndRemoveByKey(Z.wrapped().key):null},Gt.prototype._getAndRemoveByKey=function(Z){var lt=this.data[Z].shift();return lt.timeout&&clearTimeout(lt.timeout),this.data[Z].length===0&&delete this.data[Z],this.order.splice(this.order.indexOf(Z),1),lt.value},Gt.prototype.getByKey=function(Z){var lt=this.data[Z];return lt?lt[0].value:null},Gt.prototype.get=function(Z){if(!this.has(Z))return null;var lt=this.data[Z.wrapped().key][0];return lt.value},Gt.prototype.remove=function(Z,lt){if(!this.has(Z))return this;var nt=Z.wrapped().key,wt=lt===void 0?0:this.data[nt].indexOf(lt),Wt=this.data[nt][wt];return this.data[nt].splice(wt,1),Wt.timeout&&clearTimeout(Wt.timeout),this.data[nt].length===0&&delete this.data[nt],this.onRemove(Wt.value),this.order.splice(this.order.indexOf(nt),1),this},Gt.prototype.setMaxSize=function(Z){for(this.max=Z;this.order.length>this.max;){var lt=this._getAndRemoveByKey(this.order[0]);lt&&this.onRemove(lt)}return this},Gt.prototype.filter=function(Z){var lt=[];for(var nt in this.data)for(var wt=0,Wt=this.data[nt];wt1||(Math.abs(lr)>1&&(Math.abs(lr+ar)===1?lr+=ar:Math.abs(lr-ar)===1&&(lr-=ar)),!(!De.dem||!fe.dem)&&(fe.dem.backfillBorder(De.dem,lr,tr),fe.neighboringTiles&&fe.neighboringTiles[dr]&&(fe.neighboringTiles[dr].backfilled=!0)))}},lt.prototype.getTile=function(nt){return this.getTileByID(nt.key)},lt.prototype.getTileByID=function(nt){return this._tiles[nt]},lt.prototype._retainLoadedChildren=function(nt,wt,Wt,ve){for(var ke in this._tiles){var Jt=this._tiles[ke];if(!(ve[ke]||!Jt.hasData()||Jt.tileID.overscaledZ<=wt||Jt.tileID.overscaledZ>Wt)){for(var fe=Jt.tileID;Jt&&Jt.tileID.overscaledZ>wt+1;){var De=Jt.tileID.scaledTo(Jt.tileID.overscaledZ-1);Jt=this._tiles[De.key],Jt&&Jt.hasData()&&(fe=De)}for(var lr=fe;lr.overscaledZ>wt;)if(lr=lr.scaledTo(lr.overscaledZ-1),nt[lr.key]){ve[fe.key]=fe;break}}}},lt.prototype.findLoadedParent=function(nt,wt){if(nt.key in this._loadedParentTiles){var Wt=this._loadedParentTiles[nt.key];return Wt&&Wt.tileID.overscaledZ>=wt?Wt:null}for(var ve=nt.overscaledZ-1;ve>=wt;ve--){var ke=nt.scaledTo(ve),Jt=this._getLoadedTile(ke);if(Jt)return Jt}},lt.prototype._getLoadedTile=function(nt){var wt=this._tiles[nt.key];if(wt&&wt.hasData())return wt;var Wt=this._cache.getByKey(nt.wrapped().key);return Wt},lt.prototype.updateCacheSize=function(nt){var wt=Math.ceil(nt.width/this._source.tileSize)+1,Wt=Math.ceil(nt.height/this._source.tileSize)+1,ve=wt*Wt,ke=5,Jt=Math.floor(ve*ke),fe=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Jt):Jt;this._cache.setMaxSize(fe)},lt.prototype.handleWrapJump=function(nt){var wt=this._prevLng===void 0?nt:this._prevLng,Wt=nt-wt,ve=Wt/360,ke=Math.round(ve);if(this._prevLng=nt,ke){var Jt={};for(var fe in this._tiles){var De=this._tiles[fe];De.tileID=De.tileID.unwrapTo(De.tileID.wrap+ke),Jt[De.tileID.key]=De}this._tiles=Jt;for(var lr in this._timers)clearTimeout(this._timers[lr]),delete this._timers[lr];for(var tr in this._tiles){var ar=this._tiles[tr];this._setTileReloadTimer(tr,ar)}}},lt.prototype.update=function(nt){var wt=this;if(this.transform=nt,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(nt),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Wt;this.used?this._source.tileID?Wt=nt.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Di){return new n.OverscaledTileID(Di.canonical.z,Di.wrap,Di.canonical.z,Di.canonical.x,Di.canonical.y)}):(Wt=nt.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Wt=Wt.filter(function(Di){return wt._source.hasTile(Di)}))):Wt=[];var ve=nt.coveringZoomLevel(this._source),ke=Math.max(ve-lt.maxOverzooming,this._source.minzoom),Jt=Math.max(ve+lt.maxUnderzooming,this._source.minzoom),fe=this._updateRetainedTiles(Wt,ve);if(Li(this._source.type)){for(var De={},lr={},tr=Object.keys(fe),ar=0,dr=tr;arthis._source.maxzoom){var Je=Ge.children(this._source.maxzoom)[0],Hr=this.getTile(Je);if(Hr&&Hr.hasData()){Wt[Je.key]=Je;continue}}else{var wn=Ge.children(this._source.maxzoom);if(Wt[wn[0].key]&&Wt[wn[1].key]&&Wt[wn[2].key]&&Wt[wn[3].key])continue}for(var Ln=rr.wasRequested(),Ii=Ge.overscaledZ-1;Ii>=ke;--Ii){var Mi=Ge.scaledTo(Ii);if(ve[Mi.key]||(ve[Mi.key]=!0,rr=this.getTile(Mi),!rr&&Ln&&(rr=this._addTile(Mi)),rr&&(Wt[Mi.key]=Mi,Ln=rr.wasRequested(),rr.hasData())))break}}}return Wt},lt.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var nt in this._tiles){for(var wt=[],Wt=void 0,ve=this._tiles[nt].tileID;ve.overscaledZ>0;){if(ve.key in this._loadedParentTiles){Wt=this._loadedParentTiles[ve.key];break}wt.push(ve.key);var ke=ve.scaledTo(ve.overscaledZ-1);if(Wt=this._getLoadedTile(ke),Wt)break;ve=ke}for(var Jt=0,fe=wt;Jt0)&&(wt.hasData()&&wt.state!=="reloading"?this._cache.add(wt.tileID,wt,wt.getExpiryTimeout()):(wt.aborted=!0,this._abortTile(wt),this._unloadTile(wt))))},lt.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var nt in this._tiles)this._removeTile(nt);this._cache.reset()},lt.prototype.tilesIn=function(nt,wt,Wt){var ve=this,ke=[],Jt=this.transform;if(!Jt)return ke;for(var fe=Wt?Jt.getCameraQueryGeometry(nt):nt,De=nt.map(function(Ii){return Jt.pointCoordinate(Ii)}),lr=fe.map(function(Ii){return Jt.pointCoordinate(Ii)}),tr=this.getIds(),ar=1/0,dr=1/0,gr=-1/0,Ge=-1/0,rr=0,Je=lr;rr=0&&da[1].y+Di>=0){var Hi=De.map(function(wa){return gi.getTilePoint(wa)}),Wi=lr.map(function(wa){return gi.getTilePoint(wa)});ke.push({tile:Mi,tileID:gi,queryGeometry:Hi,cameraQueryGeometry:Wi,scale:Vi})}}},Ln=0;Ln=n.browser.now())return!0}return!1},lt.prototype.setFeatureState=function(nt,wt,Wt){nt=nt||"_geojsonTileLayer",this._state.updateState(nt,wt,Wt)},lt.prototype.removeFeatureState=function(nt,wt,Wt){nt=nt||"_geojsonTileLayer",this._state.removeFeatureState(nt,wt,Wt)},lt.prototype.getFeatureState=function(nt,wt){return nt=nt||"_geojsonTileLayer",this._state.getState(nt,wt)},lt.prototype.setDependencies=function(nt,wt,Wt){var ve=this._tiles[nt];ve&&ve.setDependencies(wt,Wt)},lt.prototype.reloadTilesForDependencies=function(nt,wt){for(var Wt in this._tiles){var ve=this._tiles[Wt];ve.hasDependency(nt,wt)&&this._reloadTile(Wt,"reloading")}this._cache.filter(function(ke){return!ke.hasDependency(nt,wt)})},lt}(n.Evented);Un.maxOverzooming=10,Un.maxUnderzooming=3;function Wn(Z,lt){var nt=Math.abs(Z.wrap*2)-+(Z.wrap<0),wt=Math.abs(lt.wrap*2)-+(lt.wrap<0);return Z.overscaledZ-lt.overscaledZ||wt-nt||lt.canonical.y-Z.canonical.y||lt.canonical.x-Z.canonical.x}function Li(Z){return Z==="raster"||Z==="image"||Z==="video"}function Fi(){return new n.window.Worker(Pl.workerUrl)}var Zi="mapboxgl_preloaded_worker_pool",Ji=function(){this.active={}};Ji.prototype.acquire=function(Z){if(!this.workers)for(this.workers=[];this.workers.length0?(wt-ve)/ke:0;return this.points[Wt].mult(1-Jt).add(this.points[lt].mult(Jt))};var Gn=function(Z,lt,nt){var wt=this.boxCells=[],Wt=this.circleCells=[];this.xCellCount=Math.ceil(Z/nt),this.yCellCount=Math.ceil(lt/nt);for(var ve=0;vethis.width||wt<0||lt>this.height)return Wt?!1:[];var ke=[];if(Z<=0&<<=0&&this.width<=nt&&this.height<=wt){if(Wt)return!0;for(var Jt=0;Jt0:ke}},Gn.prototype._queryCircle=function(Z,lt,nt,wt,Wt){var ve=Z-nt,ke=Z+nt,Jt=lt-nt,fe=lt+nt;if(ke<0||ve>this.width||fe<0||Jt>this.height)return wt?!1:[];var De=[],lr={hitTest:wt,circle:{x:Z,y:lt,radius:nt},seenUids:{box:{},circle:{}}};return this._forEachCell(ve,Jt,ke,fe,this._queryCellCircle,De,lr,Wt),wt?De.length>0:De},Gn.prototype.query=function(Z,lt,nt,wt,Wt){return this._query(Z,lt,nt,wt,!1,Wt)},Gn.prototype.hitTest=function(Z,lt,nt,wt,Wt){return this._query(Z,lt,nt,wt,!0,Wt)},Gn.prototype.hitTestCircle=function(Z,lt,nt,wt){return this._queryCircle(Z,lt,nt,!0,wt)},Gn.prototype._queryCell=function(Z,lt,nt,wt,Wt,ve,ke,Jt){var fe=ke.seenUids,De=this.boxCells[Wt];if(De!==null)for(var lr=this.bboxes,tr=0,ar=De;tr=lr[gr+0]&&wt>=lr[gr+1]&&(!Jt||Jt(this.boxKeys[dr]))){if(ke.hitTest)return ve.push(!0),!0;ve.push({key:this.boxKeys[dr],x1:lr[gr],y1:lr[gr+1],x2:lr[gr+2],y2:lr[gr+3]})}}}var Ge=this.circleCells[Wt];if(Ge!==null)for(var rr=this.circles,Je=0,Hr=Ge;Jeke*ke+Jt*Jt},Gn.prototype._circleAndRectCollide=function(Z,lt,nt,wt,Wt,ve,ke){var Jt=(ve-wt)/2,fe=Math.abs(Z-(wt+Jt));if(fe>Jt+nt)return!1;var De=(ke-Wt)/2,lr=Math.abs(lt-(Wt+De));if(lr>De+nt)return!1;if(fe<=Jt||lr<=De)return!0;var tr=fe-Jt,ar=lr-De;return tr*tr+ar*ar<=nt*nt};function pi(Z,lt,nt,wt,Wt){var ve=n.create();return lt?(n.scale(ve,ve,[1/Wt,1/Wt,1]),nt||n.rotateZ(ve,ve,wt.angle)):n.multiply(ve,wt.labelPlaneMatrix,Z),ve}function Va(Z,lt,nt,wt,Wt){if(lt){var ve=n.clone(Z);return n.scale(ve,ve,[Wt,Wt,1]),nt||n.rotateZ(ve,ve,-wt.angle),ve}else return wt.glCoordMatrix}function ea(Z,lt){var nt=[Z.x,Z.y,0,1];ol(nt,nt,lt);var wt=nt[3];return{point:new n.Point(nt[0]/wt,nt[1]/wt),signedDistanceFromCamera:wt}}function go(Z,lt){return .5+.5*(Z/lt)}function mo(Z,lt){var nt=Z[0]/Z[3],wt=Z[1]/Z[3],Wt=nt>=-lt[0]&&nt<=lt[0]&&wt>=-lt[1]&&wt<=lt[1];return Wt}function Go(Z,lt,nt,wt,Wt,ve,ke,Jt){var fe=wt?Z.textSizeData:Z.iconSizeData,De=n.evaluateSizeForZoom(fe,nt.transform.zoom),lr=[256/nt.width*2+1,256/nt.height*2+1],tr=wt?Z.text.dynamicLayoutVertexArray:Z.icon.dynamicLayoutVertexArray;tr.clear();for(var ar=Z.lineVertexArray,dr=wt?Z.text.placedSymbolArray:Z.icon.placedSymbolArray,gr=nt.transform.width/nt.transform.height,Ge=!1,rr=0;rrve)return{useVertical:!0}}return(Z===n.WritingMode.vertical?lt.ynt.x)?{needsFlipping:!0}:null}function Ka(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De,lr,tr,ar,dr){var gr=lt/24,Ge=Z.lineOffsetX*gr,rr=Z.lineOffsetY*gr,Je;if(Z.numGlyphs>1){var Hr=Z.glyphStartIndex+Z.numGlyphs,wn=Z.lineStartIndex,Ln=Z.lineStartIndex+Z.lineLength,Ii=Po(gr,Jt,Ge,rr,nt,lr,tr,Z,fe,ve,ar);if(!Ii)return{notEnoughRoom:!0};var Mi=ea(Ii.first.point,ke).point,gi=ea(Ii.last.point,ke).point;if(wt&&!nt){var Vi=Zo(Z.writingMode,Mi,gi,dr);if(Vi)return Vi}Je=[Ii.first];for(var Di=Z.glyphStartIndex+1;Di0?wa.point:Cs(tr,Wi,da,1,Wt),So=Zo(Z.writingMode,da,vo,dr);if(So)return So}var ns=ps(gr*Jt.getoffsetX(Z.glyphStartIndex),Ge,rr,nt,lr,tr,Z.segment,Z.lineStartIndex,Z.lineStartIndex+Z.lineLength,fe,ve,ar);if(!ns)return{notEnoughRoom:!0};Je=[ns]}for(var As=0,Wl=Je;As0?1:-1,gr=0;wt&&(dr*=-1,gr=Math.PI),dr<0&&(gr+=Math.PI);for(var Ge=dr>0?Jt+ke:Jt+ke+1,rr=Wt,Je=Wt,Hr=0,wn=0,Ln=Math.abs(ar),Ii=[];Hr+wn<=Ln;){if(Ge+=dr,Ge=fe)return null;if(Je=rr,Ii.push(rr),rr=tr[Ge],rr===void 0){var Mi=new n.Point(De.getx(Ge),De.gety(Ge)),gi=ea(Mi,lr);if(gi.signedDistanceFromCamera>0)rr=tr[Ge]=gi.point;else{var Vi=Ge-dr,Di=Hr===0?ve:new n.Point(De.getx(Vi),De.gety(Vi));rr=Cs(Di,Mi,Je,Ln-Hr+1,lr)}}Hr+=wn,wn=Je.dist(rr)}var da=(Ln-Hr)/wn,Hi=rr.sub(Je),Wi=Hi.mult(da)._add(Je);Wi._add(Hi._unit()._perp()._mult(nt*dr));var wa=gr+Math.atan2(rr.y-Je.y,rr.x-Je.x);return Ii.push(Wi),{point:Wi,angle:wa,path:Ii}}var wl=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function is(Z,lt){for(var nt=0;nt=1;Wl--)As.push(So.path[Wl]);for(var Jl=1;Jl0){for(var qs=As[0].clone(),Bc=As[0].clone(),md=1;md=Wi.x&&Bc.x<=wa.x&&qs.y>=Wi.y&&Bc.y<=wa.y?Pu=[As]:Bc.xwa.x||Bc.ywa.y?Pu=[]:Pu=n.clipLine([As],Wi.x,Wi.y,wa.x,wa.y)}for(var Vd=0,M0=Pu;Vd=this.screenRightBoundary||wtthis.screenBottomBoundary},kl.prototype.isInsideGrid=function(Z,lt,nt,wt){return nt>=0&&Z=0&<0){var wn;return this.prevPlacement&&this.prevPlacement.variableOffsets[tr.crossTileID]&&this.prevPlacement.placements[tr.crossTileID]&&this.prevPlacement.placements[tr.crossTileID].text&&(wn=this.prevPlacement.variableOffsets[tr.crossTileID].anchor),this.variableOffsets[tr.crossTileID]={textOffset:Ge,width:nt,height:wt,anchor:Z,textBoxScale:Wt,prevAnchor:wn},this.markUsedJustification(ar,Z,tr,dr),ar.allowVerticalPlacement&&(this.markUsedOrientation(ar,dr,tr),this.placedOrientations[tr.crossTileID]=dr),{shift:rr,placedGlyphBoxes:Je}}},Xs.prototype.placeLayerBucketPart=function(Z,lt,nt){var wt=this,Wt=Z.parameters,ve=Wt.bucket,ke=Wt.layout,Jt=Wt.posMatrix,fe=Wt.textLabelPlaneMatrix,De=Wt.labelToScreenMatrix,lr=Wt.textPixelRatio,tr=Wt.holdingForFade,ar=Wt.collisionBoxArray,dr=Wt.partiallyEvaluatedTextSize,gr=Wt.collisionGroup,Ge=ke.get("text-optional"),rr=ke.get("icon-optional"),Je=ke.get("text-allow-overlap"),Hr=ke.get("icon-allow-overlap"),wn=ke.get("text-rotation-alignment")==="map",Ln=ke.get("text-pitch-alignment")==="map",Ii=ke.get("icon-text-fit")!=="none",Mi=ke.get("symbol-z-order")==="viewport-y",gi=Je&&(Hr||!ve.hasIconData()||rr),Vi=Hr&&(Je||!ve.hasTextData()||Ge);!ve.collisionArrays&&ar&&ve.deserializeCollisionBoxes(ar);var Di=function(So,ns){if(!lt[So.crossTileID]){if(tr){wt.placements[So.crossTileID]=new Ns(!1,!1,!1);return}var As=!1,Wl=!1,Jl=!0,Al=null,Ql={box:null,offscreen:null},Pu={box:null,offscreen:null},qs=null,Bc=null,md=null,Vd=0,M0=0,gm=0;ns.textFeatureIndex?Vd=ns.textFeatureIndex:So.useRuntimeCollisionCircles&&(Vd=So.featureIndex),ns.verticalTextFeatureIndex&&(M0=ns.verticalTextFeatureIndex);var u0=ns.textBox;if(u0){var h0=function(gd){var zf=n.WritingMode.horizontal;if(ve.allowVerticalPlacement&&!gd&&wt.prevPlacement){var Iu=wt.prevPlacement.placedOrientations[So.crossTileID];Iu&&(wt.placedOrientations[So.crossTileID]=Iu,zf=Iu,wt.markUsedOrientation(ve,zf,So))}return zf},zm=function(gd,zf){if(ve.allowVerticalPlacement&&So.numVerticalGlyphVertices>0&&ns.verticalTextBox)for(var Iu=0,a1=ve.writingModes;Iu0&&(Mp=Mp.filter(function(gd){return gd!==d0.anchor}),Mp.unshift(d0.anchor))}var mp=function(gd,zf,Iu){for(var a1=gd.x2-gd.x1,yy=gd.y2-gd.y1,Rb=So.textBoxScale,Wu=Ii&&!Hr?zf:null,Og={box:[],offscreen:!1},Fb=Je?Mp.length*2:Mp.length,o1=0;o1=Mp.length,_y=wt.attemptAnchorPlacement(Bm,gd,a1,yy,Rb,wn,Ln,lr,Jt,gr,Jw,So,ve,Iu,Wu);if(_y&&(Og=_y.placedGlyphBoxes,Og&&Og.box&&Og.box.length)){As=!0,Al=_y.shift;break}}return Og},rg=function(){return mp(u0,ns.iconBox,n.WritingMode.horizontal)},ev=function(){var gd=ns.verticalTextBox,zf=Ql&&Ql.box&&Ql.box.length;return ve.allowVerticalPlacement&&!zf&&So.numVerticalGlyphVertices>0&&gd?mp(gd,ns.verticalIconBox,n.WritingMode.vertical):{box:null,offscreen:null}};zm(rg,ev),Ql&&(As=Ql.box,Jl=Ql.offscreen);var f0=h0(Ql&&Ql.box);if(!As&&wt.prevPlacement){var p0=wt.prevPlacement.variableOffsets[So.crossTileID];p0&&(wt.variableOffsets[So.crossTileID]=p0,wt.markUsedJustification(ve,p0.anchor,So,f0))}}else{var Ep=function(gd,zf){var Iu=wt.collisionIndex.placeCollisionBox(gd,Je,lr,Jt,gr.predicate);return Iu&&Iu.box&&Iu.box.length&&(wt.markUsedOrientation(ve,zf,So),wt.placedOrientations[So.crossTileID]=zf),Iu},rv=function(){return Ep(u0,n.WritingMode.horizontal)},r1=function(){var gd=ns.verticalTextBox;return ve.allowVerticalPlacement&&So.numVerticalGlyphVertices>0&&gd?Ep(gd,n.WritingMode.vertical):{box:null,offscreen:null}};zm(rv,r1),h0(Ql&&Ql.box&&Ql.box.length)}}if(qs=Ql,As=qs&&qs.box&&qs.box.length>0,Jl=qs&&qs.offscreen,So.useRuntimeCollisionCircles){var nv=ve.text.placedSymbolArray.get(So.centerJustifiedTextSymbolIndex),If=n.evaluateSizeForFeature(ve.textSizeData,dr,nv),zg=ke.get("text-padding"),n1=So.collisionCircleDiameter;Bc=wt.collisionIndex.placeCollisionCircles(Je,nv,ve.lineVertexArray,ve.glyphOffsetArray,If,Jt,fe,De,nt,Ln,gr.predicate,n1,zg),As=Je||Bc.circles.length>0&&!Bc.collisionDetected,Jl=Jl&&Bc.offscreen}if(ns.iconFeatureIndex&&(gm=ns.iconFeatureIndex),ns.iconBox){var Df=function(gd){var zf=Ii&&Al?sc(gd,Al.x,Al.y,wn,Ln,wt.transform.angle):gd;return wt.collisionIndex.placeCollisionBox(zf,Hr,lr,Jt,gr.predicate)};Pu&&Pu.box&&Pu.box.length&&ns.verticalIconBox?(md=Df(ns.verticalIconBox),Wl=md.box.length>0):(md=Df(ns.iconBox),Wl=md.box.length>0),Jl=Jl&&md.offscreen}var iv=Ge||So.numHorizontalGlyphVertices===0&&So.numVerticalGlyphVertices===0,gy=rr||So.numIconVertices===0;if(!iv&&!gy?Wl=As=Wl&&As:gy?iv||(Wl=Wl&&As):As=Wl&&As,As&&qs&&qs.box&&(Pu&&Pu.box&&M0?wt.collisionIndex.insertCollisionBox(qs.box,ke.get("text-ignore-placement"),ve.bucketInstanceId,M0,gr.ID):wt.collisionIndex.insertCollisionBox(qs.box,ke.get("text-ignore-placement"),ve.bucketInstanceId,Vd,gr.ID)),Wl&&md&&wt.collisionIndex.insertCollisionBox(md.box,ke.get("icon-ignore-placement"),ve.bucketInstanceId,gm,gr.ID),Bc&&(As&&wt.collisionIndex.insertCollisionCircles(Bc.circles,ke.get("text-ignore-placement"),ve.bucketInstanceId,Vd,gr.ID),nt)){var vy=ve.bucketInstanceId,Om=wt.collisionCircleArrays[vy];Om===void 0&&(Om=wt.collisionCircleArrays[vy]=new Uo);for(var i1=0;i1=0;--Hi){var Wi=da[Hi];Di(ve.symbolInstances.get(Wi),ve.collisionArrays[Wi])}else for(var wa=Z.symbolInstanceStart;wa=0&&(ve>=0&&De!==ve?Z.text.placedSymbolArray.get(De).crossTileID=0:Z.text.placedSymbolArray.get(De).crossTileID=nt.crossTileID)}},Xs.prototype.markUsedOrientation=function(Z,lt,nt){for(var wt=lt===n.WritingMode.horizontal||lt===n.WritingMode.horizontalOnly?lt:0,Wt=lt===n.WritingMode.vertical?lt:0,ve=[nt.leftJustifiedTextSymbolIndex,nt.centerJustifiedTextSymbolIndex,nt.rightJustifiedTextSymbolIndex],ke=0,Jt=ve;ke0||Ln>0,Di=Hr.numIconVertices>0,da=wt.placedOrientations[Hr.crossTileID],Hi=da===n.WritingMode.vertical,Wi=da===n.WritingMode.horizontal||da===n.WritingMode.horizontalOnly;if(Vi){var wa=Gc(gi.text),vo=Hi?ko:wa;dr(Z.text,wn,vo);var So=Wi?ko:wa;dr(Z.text,Ln,So);var ns=gi.text.isHidden();[Hr.rightJustifiedTextSymbolIndex,Hr.centerJustifiedTextSymbolIndex,Hr.leftJustifiedTextSymbolIndex].forEach(function(gm){gm>=0&&(Z.text.placedSymbolArray.get(gm).hidden=ns||Hi?1:0)}),Hr.verticalPlacedTextSymbolIndex>=0&&(Z.text.placedSymbolArray.get(Hr.verticalPlacedTextSymbolIndex).hidden=ns||Wi?1:0);var As=wt.variableOffsets[Hr.crossTileID];As&&wt.markUsedJustification(Z,As.anchor,Hr,da);var Wl=wt.placedOrientations[Hr.crossTileID];Wl&&(wt.markUsedJustification(Z,"left",Hr,Wl),wt.markUsedOrientation(Z,Wl,Hr))}if(Di){var Jl=Gc(gi.icon),Al=!(tr&&Hr.verticalPlacedIconSymbolIndex&&Hi);if(Hr.placedIconSymbolIndex>=0){var Ql=Al?Jl:ko;dr(Z.icon,Hr.numIconVertices,Ql),Z.icon.placedSymbolArray.get(Hr.placedIconSymbolIndex).hidden=gi.icon.isHidden()}if(Hr.verticalPlacedIconSymbolIndex>=0){var Pu=Al?ko:Jl;dr(Z.icon,Hr.numVerticalIconVertices,Pu),Z.icon.placedSymbolArray.get(Hr.verticalPlacedIconSymbolIndex).hidden=gi.icon.isHidden()}}if(Z.hasIconCollisionBoxData()||Z.hasTextCollisionBoxData()){var qs=Z.collisionArrays[Je];if(qs){var Bc=new n.Point(0,0);if(qs.textBox||qs.verticalTextBox){var md=!0;if(fe){var Vd=wt.variableOffsets[Ii];Vd?(Bc=tc(Vd.anchor,Vd.width,Vd.height,Vd.textOffset,Vd.textBoxScale),De&&Bc._rotate(lr?wt.transform.angle:-wt.transform.angle)):md=!1}qs.textBox&&Wa(Z.textCollisionBox.collisionVertexArray,gi.text.placed,!md||Hi,Bc.x,Bc.y),qs.verticalTextBox&&Wa(Z.textCollisionBox.collisionVertexArray,gi.text.placed,!md||Wi,Bc.x,Bc.y)}var M0=!!(!Wi&&qs.verticalIconBox);qs.iconBox&&Wa(Z.iconCollisionBox.collisionVertexArray,gi.icon.placed,M0,tr?Bc.x:0,tr?Bc.y:0),qs.verticalIconBox&&Wa(Z.iconCollisionBox.collisionVertexArray,gi.icon.placed,!M0,tr?Bc.x:0,tr?Bc.y:0)}}},Ge=0;GeZ},Xs.prototype.setStale=function(){this.stale=!0};function Wa(Z,lt,nt,wt,Wt){Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0),Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0),Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0),Z.emplaceBack(lt?1:0,nt?1:0,wt||0,Wt||0)}var Co=Math.pow(2,25),el=Math.pow(2,24),lc=Math.pow(2,17),ss=Math.pow(2,16),nc=Math.pow(2,9),yl=Math.pow(2,8),$l=Math.pow(2,1);function Gc(Z){if(Z.opacity===0&&!Z.placed)return 0;if(Z.opacity===1&&Z.placed)return 4294967295;var lt=Z.placed?1:0,nt=Math.floor(Z.opacity*127);return nt*Co+lt*el+nt*lc+lt*ss+nt*nc+lt*yl+nt*$l+lt}var ko=0,zs=function(Z){this._sortAcrossTiles=Z.layout.get("symbol-z-order")!=="viewport-y"&&Z.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};zs.prototype.continuePlacement=function(Z,lt,nt,wt,Wt){for(var ve=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var ke=Z[this._currentPlacementIndex],Jt=lt[ke],fe=this.placement.collisionIndex.transform.zoom;if(Jt.type==="symbol"&&(!Jt.minzoom||Jt.minzoom<=fe)&&(!Jt.maxzoom||Jt.maxzoom>fe)){this._inProgressLayer||(this._inProgressLayer=new zs(Jt));var De=this._inProgressLayer.continuePlacement(nt[Jt.source],this.placement,this._showCollisionBoxes,Jt,ve);if(De)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},js.prototype.commit=function(Z){return this.placement.commit(Z),this.placement};var mc=512/n.EXTENT/2,Tl=function(Z,lt,nt){this.tileID=Z,this.indexedSymbolInstances={},this.bucketInstanceId=nt;for(var wt=0;wtZ.overscaledZ)for(var fe in Jt){var De=Jt[fe];De.tileID.isChildOf(Z)&&De.findMatches(lt.symbolInstances,Z,ve)}else{var lr=Z.scaledTo(Number(ke)),tr=Jt[lr.key];tr&&tr.findMatches(lt.symbolInstances,Z,ve)}}for(var ar=0;ar0)throw new Error("Unimplemented: "+ve.map(function(ke){return ke.command}).join(", ")+".");return Wt.forEach(function(ke){ke.command!=="setTransition"&&wt[ke.command].apply(wt,ke.args)}),this.stylesheet=nt,!0},lt.prototype.addImage=function(nt,wt){if(this.getImage(nt))return this.fire(new n.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(nt,wt),this._afterImageUpdated(nt)},lt.prototype.updateImage=function(nt,wt){this.imageManager.updateImage(nt,wt)},lt.prototype.getImage=function(nt){return this.imageManager.getImage(nt)},lt.prototype.removeImage=function(nt){if(!this.getImage(nt))return this.fire(new n.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(nt),this._afterImageUpdated(nt)},lt.prototype._afterImageUpdated=function(nt){this._availableImages=this.imageManager.listImages(),this._changedImages[nt]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new n.Event("data",{dataType:"style"}))},lt.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},lt.prototype.addSource=function(nt,wt,Wt){var ve=this;if(Wt===void 0&&(Wt={}),this._checkLoaded(),this.sourceCaches[nt]!==void 0)throw new Error("There is already a source with this ID");if(!wt.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(wt).join(", ")+".");var ke=["vector","raster","geojson","video","image"],Jt=ke.indexOf(wt.type)>=0;if(!(Jt&&this._validate(n.validateStyle.source,"sources."+nt,wt,null,Wt))){this.map&&this.map._collectResourceTiming&&(wt.collectResourceTiming=!0);var fe=this.sourceCaches[nt]=new Un(nt,wt,this.dispatcher);fe.style=this,fe.setEventedParent(this,function(){return{isSourceLoaded:ve.loaded(),source:fe.serialize(),sourceId:nt}}),fe.onAdd(this.map),this._changed=!0}},lt.prototype.removeSource=function(nt){if(this._checkLoaded(),this.sourceCaches[nt]===void 0)throw new Error("There is no source with this ID");for(var wt in this._layers)if(this._layers[wt].source===nt)return this.fire(new n.ErrorEvent(new Error('Source "'+nt+'" cannot be removed while layer "'+wt+'" is using it.')));var Wt=this.sourceCaches[nt];delete this.sourceCaches[nt],delete this._updatedSources[nt],Wt.fire(new n.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:nt})),Wt.setEventedParent(null),Wt.clearTiles(),Wt.onRemove&&Wt.onRemove(this.map),this._changed=!0},lt.prototype.setGeoJSONSourceData=function(nt,wt){this._checkLoaded();var Wt=this.sourceCaches[nt].getSource();Wt.setData(wt),this._changed=!0},lt.prototype.getSource=function(nt){return this.sourceCaches[nt]&&this.sourceCaches[nt].getSource()},lt.prototype.addLayer=function(nt,wt,Wt){Wt===void 0&&(Wt={}),this._checkLoaded();var ve=nt.id;if(this.getLayer(ve)){this.fire(new n.ErrorEvent(new Error('Layer with id "'+ve+'" already exists on this map')));return}var ke;if(nt.type==="custom"){if(Dl(this,n.validateCustomStyleLayer(nt)))return;ke=n.createStyleLayer(nt)}else{if(typeof nt.source=="object"&&(this.addSource(ve,nt.source),nt=n.clone$1(nt),nt=n.extend(nt,{source:ve})),this._validate(n.validateStyle.layer,"layers."+ve,nt,{arrayIndex:-1},Wt))return;ke=n.createStyleLayer(nt),this._validateLayer(ke),ke.setEventedParent(this,{layer:{id:ve}}),this._serializedLayers[ke.id]=ke.serialize()}var Jt=wt?this._order.indexOf(wt):this._order.length;if(wt&&Jt===-1){this.fire(new n.ErrorEvent(new Error('Layer with id "'+wt+'" does not exist on this map.')));return}if(this._order.splice(Jt,0,ve),this._layerOrderChanged=!0,this._layers[ve]=ke,this._removedLayers[ve]&&ke.source&&ke.type!=="custom"){var fe=this._removedLayers[ve];delete this._removedLayers[ve],fe.type!==ke.type?this._updatedSources[ke.source]="clear":(this._updatedSources[ke.source]="reload",this.sourceCaches[ke.source].pause())}this._updateLayer(ke),ke.onAdd&&ke.onAdd(this.map)},lt.prototype.moveLayer=function(nt,wt){this._checkLoaded(),this._changed=!0;var Wt=this._layers[nt];if(!Wt){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be moved.")));return}if(nt!==wt){var ve=this._order.indexOf(nt);this._order.splice(ve,1);var ke=wt?this._order.indexOf(wt):this._order.length;if(wt&&ke===-1){this.fire(new n.ErrorEvent(new Error('Layer with id "'+wt+'" does not exist on this map.')));return}this._order.splice(ke,0,nt),this._layerOrderChanged=!0}},lt.prototype.removeLayer=function(nt){this._checkLoaded();var wt=this._layers[nt];if(!wt){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be removed.")));return}wt.setEventedParent(null);var Wt=this._order.indexOf(nt);this._order.splice(Wt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[nt]=wt,delete this._layers[nt],delete this._serializedLayers[nt],delete this._updatedLayers[nt],delete this._updatedPaintProps[nt],wt.onRemove&&wt.onRemove(this.map)},lt.prototype.getLayer=function(nt){return this._layers[nt]},lt.prototype.hasLayer=function(nt){return nt in this._layers},lt.prototype.setLayerZoomRange=function(nt,wt,Wt){this._checkLoaded();var ve=this.getLayer(nt);if(!ve){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot have zoom extent.")));return}ve.minzoom===wt&&ve.maxzoom===Wt||(wt!=null&&(ve.minzoom=wt),Wt!=null&&(ve.maxzoom=Wt),this._updateLayer(ve))},lt.prototype.setFilter=function(nt,wt,Wt){Wt===void 0&&(Wt={}),this._checkLoaded();var ve=this.getLayer(nt);if(!ve){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be filtered.")));return}if(!n.deepEqual(ve.filter,wt)){if(wt==null){ve.filter=void 0,this._updateLayer(ve);return}this._validate(n.validateStyle.filter,"layers."+ve.id+".filter",wt,null,Wt)||(ve.filter=n.clone$1(wt),this._updateLayer(ve))}},lt.prototype.getFilter=function(nt){return n.clone$1(this.getLayer(nt).filter)},lt.prototype.setLayoutProperty=function(nt,wt,Wt,ve){ve===void 0&&(ve={}),this._checkLoaded();var ke=this.getLayer(nt);if(!ke){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be styled.")));return}n.deepEqual(ke.getLayoutProperty(wt),Wt)||(ke.setLayoutProperty(wt,Wt,ve),this._updateLayer(ke))},lt.prototype.getLayoutProperty=function(nt,wt){var Wt=this.getLayer(nt);if(!Wt){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style.")));return}return Wt.getLayoutProperty(wt)},lt.prototype.setPaintProperty=function(nt,wt,Wt,ve){ve===void 0&&(ve={}),this._checkLoaded();var ke=this.getLayer(nt);if(!ke){this.fire(new n.ErrorEvent(new Error("The layer '"+nt+"' does not exist in the map's style and cannot be styled.")));return}if(!n.deepEqual(ke.getPaintProperty(wt),Wt)){var Jt=ke.setPaintProperty(wt,Wt,ve);Jt&&this._updateLayer(ke),this._changed=!0,this._updatedPaintProps[nt]=!0}},lt.prototype.getPaintProperty=function(nt,wt){return this.getLayer(nt).getPaintProperty(wt)},lt.prototype.setFeatureState=function(nt,wt){this._checkLoaded();var Wt=nt.source,ve=nt.sourceLayer,ke=this.sourceCaches[Wt];if(ke===void 0){this.fire(new n.ErrorEvent(new Error("The source '"+Wt+"' does not exist in the map's style.")));return}var Jt=ke.getSource().type;if(Jt==="geojson"&&ve){this.fire(new n.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Jt==="vector"&&!ve){this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}nt.id===void 0&&this.fire(new n.ErrorEvent(new Error("The feature id parameter must be provided."))),ke.setFeatureState(ve,nt.id,wt)},lt.prototype.removeFeatureState=function(nt,wt){this._checkLoaded();var Wt=nt.source,ve=this.sourceCaches[Wt];if(ve===void 0){this.fire(new n.ErrorEvent(new Error("The source '"+Wt+"' does not exist in the map's style.")));return}var ke=ve.getSource().type,Jt=ke==="vector"?nt.sourceLayer:void 0;if(ke==="vector"&&!Jt){this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(wt&&typeof nt.id!="string"&&typeof nt.id!="number"){this.fire(new n.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}ve.removeFeatureState(Jt,nt.id,wt)},lt.prototype.getFeatureState=function(nt){this._checkLoaded();var wt=nt.source,Wt=nt.sourceLayer,ve=this.sourceCaches[wt];if(ve===void 0){this.fire(new n.ErrorEvent(new Error("The source '"+wt+"' does not exist in the map's style.")));return}var ke=ve.getSource().type;if(ke==="vector"&&!Wt){this.fire(new n.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return nt.id===void 0&&this.fire(new n.ErrorEvent(new Error("The feature id parameter must be provided."))),ve.getFeatureState(Wt,nt.id)},lt.prototype.getTransition=function(){return n.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},lt.prototype.serialize=function(){return n.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:n.mapObject(this.sourceCaches,function(nt){return nt.serialize()}),layers:this._serializeLayers(this._order)},function(nt){return nt!==void 0})},lt.prototype._updateLayer=function(nt){this._updatedLayers[nt.id]=!0,nt.source&&!this._updatedSources[nt.source]&&this.sourceCaches[nt.source].getSource().type!=="raster"&&(this._updatedSources[nt.source]="reload",this.sourceCaches[nt.source].pause()),this._changed=!0},lt.prototype._flattenAndSortRenderedFeatures=function(nt){for(var wt=this,Wt=function(Wi){return wt._layers[Wi].type==="fill-extrusion"},ve={},ke=[],Jt=this._order.length-1;Jt>=0;Jt--){var fe=this._order[Jt];if(Wt(fe)){ve[fe]=Jt;for(var De=0,lr=nt;De=0;Je--){var Hr=this._order[Je];if(Wt(Hr))for(var wn=ke.length-1;wn>=0;wn--){var Ln=ke[wn].feature;if(ve[Ln.layer.id]>16,Jt>>16],u_pixel_coord_lower:[ke&65535,Jt&65535]}}function Dd(Z,lt,nt,wt){var Wt=nt.imageManager.getPattern(Z.from.toString()),ve=nt.imageManager.getPattern(Z.to.toString()),ke=nt.imageManager.getPixelSize(),Jt=ke.width,fe=ke.height,De=Math.pow(2,wt.tileID.overscaledZ),lr=wt.tileSize*Math.pow(2,nt.transform.tileZoom)/De,tr=lr*(wt.tileID.canonical.x+wt.tileID.wrap*De),ar=lr*wt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Wt.tl,u_pattern_br_a:Wt.br,u_pattern_tl_b:ve.tl,u_pattern_br_b:ve.br,u_texsize:[Jt,fe],u_mix:lt.t,u_pattern_size_a:Wt.displaySize,u_pattern_size_b:ve.displaySize,u_scale_a:lt.fromScale,u_scale_b:lt.toScale,u_tile_units_to_pixels:1/ul(wt,1,nt.transform.tileZoom),u_pixel_coord_upper:[tr>>16,ar>>16],u_pixel_coord_lower:[tr&65535,ar&65535]}}var tp=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_lightpos:new n.Uniform3f(Z,lt.u_lightpos),u_lightintensity:new n.Uniform1f(Z,lt.u_lightintensity),u_lightcolor:new n.Uniform3f(Z,lt.u_lightcolor),u_vertical_gradient:new n.Uniform1f(Z,lt.u_vertical_gradient),u_opacity:new n.Uniform1f(Z,lt.u_opacity)}},Au=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_lightpos:new n.Uniform3f(Z,lt.u_lightpos),u_lightintensity:new n.Uniform1f(Z,lt.u_lightintensity),u_lightcolor:new n.Uniform3f(Z,lt.u_lightcolor),u_vertical_gradient:new n.Uniform1f(Z,lt.u_vertical_gradient),u_height_factor:new n.Uniform1f(Z,lt.u_height_factor),u_image:new n.Uniform1i(Z,lt.u_image),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade),u_opacity:new n.Uniform1f(Z,lt.u_opacity)}},gf=function(Z,lt,nt,wt){var Wt=lt.style.light,ve=Wt.properties.get("position"),ke=[ve.x,ve.y,ve.z],Jt=n.create$1();Wt.properties.get("anchor")==="viewport"&&n.fromRotation(Jt,-lt.transform.angle),n.transformMat3(ke,ke,Jt);var fe=Wt.properties.get("color");return{u_matrix:Z,u_lightpos:ke,u_lightintensity:Wt.properties.get("intensity"),u_lightcolor:[fe.r,fe.g,fe.b],u_vertical_gradient:+nt,u_opacity:wt}},fh=function(Z,lt,nt,wt,Wt,ve,ke){return n.extend(gf(Z,lt,nt,wt),ad(ve,lt,ke),{u_height_factor:-Math.pow(2,Wt.overscaledZ)/ke.tileSize/8})},Vh=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},Ph=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_image:new n.Uniform1i(Z,lt.u_image),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade)}},Zc=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_world:new n.Uniform2f(Z,lt.u_world)}},fc=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_world:new n.Uniform2f(Z,lt.u_world),u_image:new n.Uniform1i(Z,lt.u_image),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade)}},Ih=function(Z){return{u_matrix:Z}},Td=function(Z,lt,nt,wt){return n.extend(Ih(Z),ad(nt,lt,wt))},Dh=function(Z,lt){return{u_matrix:Z,u_world:lt}},sf=function(Z,lt,nt,wt,Wt){return n.extend(Td(Z,lt,nt,wt),{u_world:Wt})},br=function(Z,lt){return{u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_scale_with_map:new n.Uniform1i(Z,lt.u_scale_with_map),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_extrude_scale:new n.Uniform2f(Z,lt.u_extrude_scale),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},Qr=function(Z,lt,nt,wt){var Wt=Z.transform,ve,ke;if(wt.paint.get("circle-pitch-alignment")==="map"){var Jt=ul(nt,1,Wt.zoom);ve=!0,ke=[Jt,Jt]}else ve=!1,ke=Wt.pixelsToGLUnits;return{u_camera_to_center_distance:Wt.cameraToCenterDistance,u_scale_with_map:+(wt.paint.get("circle-pitch-scale")==="map"),u_matrix:Z.translatePosMatrix(lt.posMatrix,nt,wt.paint.get("circle-translate"),wt.paint.get("circle-translate-anchor")),u_pitch_with_map:+ve,u_device_pixel_ratio:n.browser.devicePixelRatio,u_extrude_scale:ke}},Nn=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pixels_to_tile_units:new n.Uniform1f(Z,lt.u_pixels_to_tile_units),u_extrude_scale:new n.Uniform2f(Z,lt.u_extrude_scale),u_overscale_factor:new n.Uniform1f(Z,lt.u_overscale_factor)}},An=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_inv_matrix:new n.UniformMatrix4f(Z,lt.u_inv_matrix),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_viewport_size:new n.Uniform2f(Z,lt.u_viewport_size)}},di=function(Z,lt,nt){var wt=ul(nt,1,lt.zoom),Wt=Math.pow(2,lt.zoom-nt.tileID.overscaledZ),ve=nt.tileID.overscaleFactor();return{u_matrix:Z,u_camera_to_center_distance:lt.cameraToCenterDistance,u_pixels_to_tile_units:wt,u_extrude_scale:[lt.pixelsToGLUnits[0]/(wt*Wt),lt.pixelsToGLUnits[1]/(wt*Wt)],u_overscale_factor:ve}},Pi=function(Z,lt,nt){return{u_matrix:Z,u_inv_matrix:lt,u_camera_to_center_distance:nt.cameraToCenterDistance,u_viewport_size:[nt.width,nt.height]}},ga=function(Z,lt){return{u_color:new n.UniformColor(Z,lt.u_color),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_overlay:new n.Uniform1i(Z,lt.u_overlay),u_overlay_scale:new n.Uniform1f(Z,lt.u_overlay_scale)}},Pa=function(Z,lt,nt){return nt===void 0&&(nt=1),{u_matrix:Z,u_color:lt,u_overlay:0,u_overlay_scale:nt}},Ja=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},uo=function(Z){return{u_matrix:Z}},Sa=function(Z,lt){return{u_extrude_scale:new n.Uniform1f(Z,lt.u_extrude_scale),u_intensity:new n.Uniform1f(Z,lt.u_intensity),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},Za=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_world:new n.Uniform2f(Z,lt.u_world),u_image:new n.Uniform1i(Z,lt.u_image),u_color_ramp:new n.Uniform1i(Z,lt.u_color_ramp),u_opacity:new n.Uniform1f(Z,lt.u_opacity)}},Ra=function(Z,lt,nt,wt){return{u_matrix:Z,u_extrude_scale:ul(lt,1,nt),u_intensity:wt}},pa=function(Z,lt,nt,wt){var Wt=n.create();n.ortho(Wt,0,Z.width,Z.height,0,0,1);var ve=Z.context.gl;return{u_matrix:Wt,u_world:[ve.drawingBufferWidth,ve.drawingBufferHeight],u_image:nt,u_color_ramp:wt,u_opacity:lt.paint.get("heatmap-opacity")}},_o=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_image:new n.Uniform1i(Z,lt.u_image),u_latrange:new n.Uniform2f(Z,lt.u_latrange),u_light:new n.Uniform2f(Z,lt.u_light),u_shadow:new n.UniformColor(Z,lt.u_shadow),u_highlight:new n.UniformColor(Z,lt.u_highlight),u_accent:new n.UniformColor(Z,lt.u_accent)}},fs=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_image:new n.Uniform1i(Z,lt.u_image),u_dimension:new n.Uniform2f(Z,lt.u_dimension),u_zoom:new n.Uniform1f(Z,lt.u_zoom),u_unpack:new n.Uniform4f(Z,lt.u_unpack)}},os=function(Z,lt,nt){var wt=nt.paint.get("hillshade-shadow-color"),Wt=nt.paint.get("hillshade-highlight-color"),ve=nt.paint.get("hillshade-accent-color"),ke=nt.paint.get("hillshade-illumination-direction")*(Math.PI/180);nt.paint.get("hillshade-illumination-anchor")==="viewport"&&(ke-=Z.transform.angle);var Jt=!Z.options.moving;return{u_matrix:Z.transform.calculatePosMatrix(lt.tileID.toUnwrapped(),Jt),u_image:0,u_latrange:ws(Z,lt.tileID),u_light:[nt.paint.get("hillshade-exaggeration"),ke],u_shadow:wt,u_highlight:Wt,u_accent:ve}},gs=function(Z,lt){var nt=lt.stride,wt=n.create();return n.ortho(wt,0,n.EXTENT,-n.EXTENT,0,0,1),n.translate(wt,wt,[0,-n.EXTENT,0]),{u_matrix:wt,u_image:1,u_dimension:[nt,nt],u_zoom:Z.overscaledZ,u_unpack:lt.getUnpackVector()}};function ws(Z,lt){var nt=Math.pow(2,lt.canonical.z),wt=lt.canonical.y;return[new n.MercatorCoordinate(0,wt/nt).toLngLat().lat,new n.MercatorCoordinate(0,(wt+1)/nt).toLngLat().lat]}var bo=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels)}},lo=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels),u_image:new n.Uniform1i(Z,lt.u_image),u_image_height:new n.Uniform1f(Z,lt.u_image_height)}},ks=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_image:new n.Uniform1i(Z,lt.u_image),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade)}},dl=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels),u_patternscale_a:new n.Uniform2f(Z,lt.u_patternscale_a),u_patternscale_b:new n.Uniform2f(Z,lt.u_patternscale_b),u_sdfgamma:new n.Uniform1f(Z,lt.u_sdfgamma),u_image:new n.Uniform1i(Z,lt.u_image),u_tex_y_a:new n.Uniform1f(Z,lt.u_tex_y_a),u_tex_y_b:new n.Uniform1f(Z,lt.u_tex_y_b),u_mix:new n.Uniform1f(Z,lt.u_mix)}},Vl=function(Z,lt,nt){var wt=Z.transform;return{u_matrix:tu(Z,lt,nt),u_ratio:1/ul(lt,1,wt.zoom),u_device_pixel_ratio:n.browser.devicePixelRatio,u_units_to_pixels:[1/wt.pixelsToGLUnits[0],1/wt.pixelsToGLUnits[1]]}},gc=function(Z,lt,nt,wt){return n.extend(Vl(Z,lt,nt),{u_image:0,u_image_height:wt})},ec=function(Z,lt,nt,wt){var Wt=Z.transform,ve=El(lt,Wt);return{u_matrix:tu(Z,lt,nt),u_texsize:lt.imageAtlasTexture.size,u_ratio:1/ul(lt,1,Wt.zoom),u_device_pixel_ratio:n.browser.devicePixelRatio,u_image:0,u_scale:[ve,wt.fromScale,wt.toScale],u_fade:wt.t,u_units_to_pixels:[1/Wt.pixelsToGLUnits[0],1/Wt.pixelsToGLUnits[1]]}},vc=function(Z,lt,nt,wt,Wt){var ve=Z.transform,ke=Z.lineAtlas,Jt=El(lt,ve),fe=nt.layout.get("line-cap")==="round",De=ke.getDash(wt.from,fe),lr=ke.getDash(wt.to,fe),tr=De.width*Wt.fromScale,ar=lr.width*Wt.toScale;return n.extend(Vl(Z,lt,nt),{u_patternscale_a:[Jt/tr,-De.height/2],u_patternscale_b:[Jt/ar,-lr.height/2],u_sdfgamma:ke.width/(Math.min(tr,ar)*256*n.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:De.y,u_tex_y_b:lr.y,u_mix:Wt.t})};function El(Z,lt){return 1/ul(Z,1,lt.tileZoom)}function tu(Z,lt,nt){return Z.translatePosMatrix(lt.tileID.posMatrix,lt,nt.paint.get("line-translate"),nt.paint.get("line-translate-anchor"))}var $c=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_tl_parent:new n.Uniform2f(Z,lt.u_tl_parent),u_scale_parent:new n.Uniform1f(Z,lt.u_scale_parent),u_buffer_scale:new n.Uniform1f(Z,lt.u_buffer_scale),u_fade_t:new n.Uniform1f(Z,lt.u_fade_t),u_opacity:new n.Uniform1f(Z,lt.u_opacity),u_image0:new n.Uniform1i(Z,lt.u_image0),u_image1:new n.Uniform1i(Z,lt.u_image1),u_brightness_low:new n.Uniform1f(Z,lt.u_brightness_low),u_brightness_high:new n.Uniform1f(Z,lt.u_brightness_high),u_saturation_factor:new n.Uniform1f(Z,lt.u_saturation_factor),u_contrast_factor:new n.Uniform1f(Z,lt.u_contrast_factor),u_spin_weights:new n.Uniform3f(Z,lt.u_spin_weights)}},bc=function(Z,lt,nt,wt,Wt){return{u_matrix:Z,u_tl_parent:lt,u_scale_parent:nt,u_buffer_scale:1,u_fade_t:wt.mix,u_opacity:wt.opacity*Wt.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Wt.paint.get("raster-brightness-min"),u_brightness_high:Wt.paint.get("raster-brightness-max"),u_saturation_factor:ac(Wt.paint.get("raster-saturation")),u_contrast_factor:Bs(Wt.paint.get("raster-contrast")),u_spin_weights:qo(Wt.paint.get("raster-hue-rotate"))}};function qo(Z){Z*=Math.PI/180;var lt=Math.sin(Z),nt=Math.cos(Z);return[(2*nt+1)/3,(-Math.sqrt(3)*lt-nt+1)/3,(Math.sqrt(3)*lt-nt+1)/3]}function Bs(Z){return Z>0?1/(1-Z):1+Z}function ac(Z){return Z>0?1-1/(1.001-Z):-Z}var Zl=function(Z,lt){return{u_is_size_zoom_constant:new n.Uniform1i(Z,lt.u_is_size_zoom_constant),u_is_size_feature_constant:new n.Uniform1i(Z,lt.u_is_size_feature_constant),u_size_t:new n.Uniform1f(Z,lt.u_size_t),u_size:new n.Uniform1f(Z,lt.u_size),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pitch:new n.Uniform1f(Z,lt.u_pitch),u_rotate_symbol:new n.Uniform1i(Z,lt.u_rotate_symbol),u_aspect_ratio:new n.Uniform1f(Z,lt.u_aspect_ratio),u_fade_change:new n.Uniform1f(Z,lt.u_fade_change),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_label_plane_matrix:new n.UniformMatrix4f(Z,lt.u_label_plane_matrix),u_coord_matrix:new n.UniformMatrix4f(Z,lt.u_coord_matrix),u_is_text:new n.Uniform1i(Z,lt.u_is_text),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_texture:new n.Uniform1i(Z,lt.u_texture)}},Mu=function(Z,lt){return{u_is_size_zoom_constant:new n.Uniform1i(Z,lt.u_is_size_zoom_constant),u_is_size_feature_constant:new n.Uniform1i(Z,lt.u_is_size_feature_constant),u_size_t:new n.Uniform1f(Z,lt.u_size_t),u_size:new n.Uniform1f(Z,lt.u_size),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pitch:new n.Uniform1f(Z,lt.u_pitch),u_rotate_symbol:new n.Uniform1i(Z,lt.u_rotate_symbol),u_aspect_ratio:new n.Uniform1f(Z,lt.u_aspect_ratio),u_fade_change:new n.Uniform1f(Z,lt.u_fade_change),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_label_plane_matrix:new n.UniformMatrix4f(Z,lt.u_label_plane_matrix),u_coord_matrix:new n.UniformMatrix4f(Z,lt.u_coord_matrix),u_is_text:new n.Uniform1i(Z,lt.u_is_text),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_texture:new n.Uniform1i(Z,lt.u_texture),u_gamma_scale:new n.Uniform1f(Z,lt.u_gamma_scale),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_is_halo:new n.Uniform1i(Z,lt.u_is_halo)}},eh=function(Z,lt){return{u_is_size_zoom_constant:new n.Uniform1i(Z,lt.u_is_size_zoom_constant),u_is_size_feature_constant:new n.Uniform1i(Z,lt.u_is_size_feature_constant),u_size_t:new n.Uniform1f(Z,lt.u_size_t),u_size:new n.Uniform1f(Z,lt.u_size),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pitch:new n.Uniform1f(Z,lt.u_pitch),u_rotate_symbol:new n.Uniform1i(Z,lt.u_rotate_symbol),u_aspect_ratio:new n.Uniform1f(Z,lt.u_aspect_ratio),u_fade_change:new n.Uniform1f(Z,lt.u_fade_change),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_label_plane_matrix:new n.UniformMatrix4f(Z,lt.u_label_plane_matrix),u_coord_matrix:new n.UniformMatrix4f(Z,lt.u_coord_matrix),u_is_text:new n.Uniform1i(Z,lt.u_is_text),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_texsize_icon:new n.Uniform2f(Z,lt.u_texsize_icon),u_texture:new n.Uniform1i(Z,lt.u_texture),u_texture_icon:new n.Uniform1i(Z,lt.u_texture_icon),u_gamma_scale:new n.Uniform1f(Z,lt.u_gamma_scale),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_is_halo:new n.Uniform1i(Z,lt.u_is_halo)}},Vu=function(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De){var lr=Wt.transform;return{u_is_size_zoom_constant:+(Z==="constant"||Z==="source"),u_is_size_feature_constant:+(Z==="constant"||Z==="camera"),u_size_t:lt?lt.uSizeT:0,u_size:lt?lt.uSize:0,u_camera_to_center_distance:lr.cameraToCenterDistance,u_pitch:lr.pitch/360*2*Math.PI,u_rotate_symbol:+nt,u_aspect_ratio:lr.width/lr.height,u_fade_change:Wt.options.fadeDuration?Wt.symbolFadeChange:1,u_matrix:ve,u_label_plane_matrix:ke,u_coord_matrix:Jt,u_is_text:+fe,u_pitch_with_map:+wt,u_texsize:De,u_texture:0}},Wh=function(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De,lr){var tr=Wt.transform;return n.extend(Vu(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De),{u_gamma_scale:wt?Math.cos(tr._pitch)*tr.cameraToCenterDistance:1,u_device_pixel_ratio:n.browser.devicePixelRatio,u_is_halo:1})},rh=function(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De){return n.extend(Wh(Z,lt,nt,wt,Wt,ve,ke,Jt,!0,fe),{u_texsize_icon:De,u_texture_icon:1})},qh=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_opacity:new n.Uniform1f(Z,lt.u_opacity),u_color:new n.UniformColor(Z,lt.u_color)}},Wc=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_opacity:new n.Uniform1f(Z,lt.u_opacity),u_image:new n.Uniform1i(Z,lt.u_image),u_pattern_tl_a:new n.Uniform2f(Z,lt.u_pattern_tl_a),u_pattern_br_a:new n.Uniform2f(Z,lt.u_pattern_br_a),u_pattern_tl_b:new n.Uniform2f(Z,lt.u_pattern_tl_b),u_pattern_br_b:new n.Uniform2f(Z,lt.u_pattern_br_b),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_mix:new n.Uniform1f(Z,lt.u_mix),u_pattern_size_a:new n.Uniform2f(Z,lt.u_pattern_size_a),u_pattern_size_b:new n.Uniform2f(Z,lt.u_pattern_size_b),u_scale_a:new n.Uniform1f(Z,lt.u_scale_a),u_scale_b:new n.Uniform1f(Z,lt.u_scale_b),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_tile_units_to_pixels:new n.Uniform1f(Z,lt.u_tile_units_to_pixels)}},Gh=function(Z,lt,nt){return{u_matrix:Z,u_opacity:lt,u_color:nt}},ds=function(Z,lt,nt,wt,Wt,ve){return n.extend(Dd(wt,ve,nt,Wt),{u_matrix:Z,u_opacity:lt})},$s={fillExtrusion:tp,fillExtrusionPattern:Au,fill:Vh,fillPattern:Ph,fillOutline:Zc,fillOutlinePattern:fc,circle:br,collisionBox:Nn,collisionCircle:An,debug:ga,clippingMask:Ja,heatmap:Sa,heatmapTexture:Za,hillshade:_o,hillshadePrepare:fs,line:bo,lineGradient:lo,linePattern:ks,lineSDF:dl,raster:$c,symbolIcon:Zl,symbolSDF:Mu,symbolTextAndIcon:eh,background:qh,backgroundPattern:Wc},nh;function eu(Z,lt,nt,wt,Wt,ve,ke){for(var Jt=Z.context,fe=Jt.gl,De=Z.useProgram("collisionBox"),lr=[],tr=0,ar=0,dr=0;dr0){var Ln=n.create(),Ii=Je;n.mul(Ln,rr.placementInvProjMatrix,Z.transform.glCoordMatrix),n.mul(Ln,Ln,rr.placementViewportMatrix),lr.push({circleArray:wn,circleOffset:ar,transform:Ii,invTransform:Ln}),tr+=wn.length/4,ar=tr}Hr&&De.draw(Jt,fe.LINES,yi.disabled,fi.disabled,Z.colorModeForRenderPass(),mn.disabled,di(Je,Z.transform,Ge),nt.id,Hr.layoutVertexBuffer,Hr.indexBuffer,Hr.segments,null,Z.transform.zoom,null,null,Hr.collisionVertexBuffer)}}if(!(!ke||!lr.length)){var Mi=Z.useProgram("collisionCircle"),gi=new n.StructArrayLayout2f1f2i16;gi.resize(tr*4),gi._trim();for(var Vi=0,Di=0,da=lr;Di=0&&(gr[rr.associatedIconIndex]={shiftedAnchor:wa,angle:vo})}}if(lr){dr.clear();for(var ns=Z.icon.placedSymbolArray,As=0;As0){var ke=n.browser.now(),Jt=(ke-Z.timeAdded)/ve,fe=lt?(ke-lt.timeAdded)/ve:-1,De=nt.getSource(),lr=Wt.coveringZoomLevel({tileSize:De.tileSize,roundZoom:De.roundZoom}),tr=!lt||Math.abs(lt.tileID.overscaledZ-lr)>Math.abs(Z.tileID.overscaledZ-lr),ar=tr&&Z.refreshedUponExpiration?1:n.clamp(tr?Jt:1-fe,0,1);return Z.refreshedUponExpiration&&Jt>=1&&(Z.refreshedUponExpiration=!1),lt?{opacity:1,mix:1-ar}:{opacity:ar,mix:0}}else return{opacity:1,mix:0}}function Xr(Z,lt,nt){var wt=nt.paint.get("background-color"),Wt=nt.paint.get("background-opacity");if(Wt!==0){var ve=Z.context,ke=ve.gl,Jt=Z.transform,fe=Jt.tileSize,De=nt.paint.get("background-pattern");if(!Z.isPatternMissing(De)){var lr=!De&&wt.a===1&&Wt===1&&Z.opaquePassEnabledForLayer()?"opaque":"translucent";if(Z.renderPass===lr){var tr=fi.disabled,ar=Z.depthModeForSublayer(0,lr==="opaque"?yi.ReadWrite:yi.ReadOnly),dr=Z.colorModeForRenderPass(),gr=Z.useProgram(De?"backgroundPattern":"background"),Ge=Jt.coveringTiles({tileSize:fe});De&&(ve.activeTexture.set(ke.TEXTURE0),Z.imageManager.bind(Z.context));for(var rr=nt.getCrossfadeParameters(),Je=0,Hr=Ge;Je "+nt.overscaledZ);var Je=rr+" "+dr+"kb";xs(Z,Je),ke.draw(wt,Wt.TRIANGLES,Jt,fe,sr.alphaBlended,mn.disabled,Pa(ve,n.Color.transparent,Ge),lr,Z.debugBuffer,Z.quadTriangleIndexBuffer,Z.debugSegments)}function xs(Z,lt){Z.initDebugOverlayCanvas();var nt=Z.debugOverlayCanvas,wt=Z.context.gl,Wt=Z.debugOverlayCanvas.getContext("2d");Wt.clearRect(0,0,nt.width,nt.height),Wt.shadowColor="white",Wt.shadowBlur=2,Wt.lineWidth=1.5,Wt.strokeStyle="white",Wt.textBaseline="top",Wt.font="bold 36px Open Sans, sans-serif",Wt.fillText(lt,5,5),Wt.strokeText(lt,5,5),Z.debugOverlayTexture.update(nt),Z.debugOverlayTexture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE)}function Sl(Z,lt,nt){var wt=Z.context,Wt=nt.implementation;if(Z.renderPass==="offscreen"){var ve=Wt.prerender;ve&&(Z.setCustomLayerDefaults(),wt.setColorMode(Z.colorModeForRenderPass()),ve.call(Wt,wt.gl,Z.transform.customLayerMatrix()),wt.setDirty(),Z.setBaseState())}else if(Z.renderPass==="translucent"){Z.setCustomLayerDefaults(),wt.setColorMode(Z.colorModeForRenderPass()),wt.setStencilMode(fi.disabled);var ke=Wt.renderingMode==="3d"?new yi(Z.context.gl.LEQUAL,yi.ReadWrite,Z.depthRangeFor3D):Z.depthModeForSublayer(0,yi.ReadOnly);wt.setDepthMode(ke),Wt.render(wt.gl,Z.transform.customLayerMatrix()),wt.setDirty(),Z.setBaseState(),wt.bindFramebuffer.set(null)}}var Ll={symbol:O,circle:er,heatmap:wr,line:qn,fill:te,"fill-extrusion":Te,hillshade:We,raster:Pr,background:Xr,debug:Yo,custom:Sl},Ws=function(Z,lt){this.context=new Zn(Z),this.transform=lt,this._tileTextures={},this.setup(),this.numSublayers=Un.maxUnderzooming+Un.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new iu,this.gpuTimers={}};Ws.prototype.resize=function(Z,lt){if(this.width=Z*n.browser.devicePixelRatio,this.height=lt*n.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var nt=0,wt=this.style._order;nt256&&this.clearStencil(),nt.setColorMode(sr.disabled),nt.setDepthMode(yi.disabled);var Wt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var ve=0,ke=lt;ve256&&this.clearStencil();var Z=this.nextStencilID++,lt=this.context.gl;return new fi({func:lt.NOTEQUAL,mask:255},Z,255,lt.KEEP,lt.KEEP,lt.REPLACE)},Ws.prototype.stencilModeForClipping=function(Z){var lt=this.context.gl;return new fi({func:lt.EQUAL,mask:255},this._tileClippingMaskIDs[Z.key],0,lt.KEEP,lt.KEEP,lt.REPLACE)},Ws.prototype.stencilConfigForOverlap=function(Z){var lt,nt=this.context.gl,wt=Z.sort(function(fe,De){return De.overscaledZ-fe.overscaledZ}),Wt=wt[wt.length-1].overscaledZ,ve=wt[0].overscaledZ-Wt+1;if(ve>1){this.currentStencilSource=void 0,this.nextStencilID+ve>256&&this.clearStencil();for(var ke={},Jt=0;Jt=0;this.currentLayer--){var wn=this.style._layers[wt[this.currentLayer]],Ln=Wt[wn.source],Ii=Jt[wn.source];this._renderTileClippingMasks(wn,Ii),this.renderLayer(this,Ln,wn,Ii)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?lt.pop():null},Ws.prototype.isPatternMissing=function(Z){if(!Z)return!1;if(!Z.from||!Z.to)return!0;var lt=this.imageManager.getPattern(Z.from.toString()),nt=this.imageManager.getPattern(Z.to.toString());return!lt||!nt},Ws.prototype.useProgram=function(Z,lt){this.cache=this.cache||{};var nt=""+Z+(lt?lt.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[nt]||(this.cache[nt]=new pd(this.context,Z,Id[Z],lt,$s[Z],this._showOverdrawInspector)),this.cache[nt]},Ws.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Ws.prototype.setBaseState=function(){var Z=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(Z.FUNC_ADD)},Ws.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=n.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var Z=this.context.gl;this.debugOverlayTexture=new n.Texture(this.context,this.debugOverlayCanvas,Z.RGBA)}},Ws.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var zl=function(Z,lt){this.points=Z,this.planes=lt};zl.fromInvProjectionMatrix=function(Z,lt,nt){var wt=[[-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]],Wt=Math.pow(2,nt),ve=wt.map(function(fe){return n.transformMat4([],fe,Z)}).map(function(fe){return n.scale$1([],fe,1/fe[3]/lt*Wt)}),ke=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Jt=ke.map(function(fe){var De=n.sub([],ve[fe[0]],ve[fe[1]]),lr=n.sub([],ve[fe[2]],ve[fe[1]]),tr=n.normalize([],n.cross([],De,lr)),ar=-n.dot(tr,ve[fe[1]]);return tr.concat(ar)});return new zl(ve,Jt)};var Fc=function(Z,lt){this.min=Z,this.max=lt,this.center=n.scale$2([],n.add([],this.min,this.max),.5)};Fc.prototype.quadrant=function(Z){for(var lt=[Z%2===0,Z<2],nt=n.clone$2(this.min),wt=n.clone$2(this.max),Wt=0;Wt=0;if(ve===0)return 0;ve!==lt.length&&(nt=!1)}if(nt)return 2;for(var Jt=0;Jt<3;Jt++){for(var fe=Number.MAX_VALUE,De=-Number.MAX_VALUE,lr=0;lrthis.max[Jt]-this.min[Jt])return 0}return 1};var Sc=function(Z,lt,nt,wt){if(Z===void 0&&(Z=0),lt===void 0&&(lt=0),nt===void 0&&(nt=0),wt===void 0&&(wt=0),isNaN(Z)||Z<0||isNaN(lt)||lt<0||isNaN(nt)||nt<0||isNaN(wt)||wt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=Z,this.bottom=lt,this.left=nt,this.right=wt};Sc.prototype.interpolate=function(Z,lt,nt){return lt.top!=null&&Z.top!=null&&(this.top=n.number(Z.top,lt.top,nt)),lt.bottom!=null&&Z.bottom!=null&&(this.bottom=n.number(Z.bottom,lt.bottom,nt)),lt.left!=null&&Z.left!=null&&(this.left=n.number(Z.left,lt.left,nt)),lt.right!=null&&Z.right!=null&&(this.right=n.number(Z.right,lt.right,nt)),this},Sc.prototype.getCenter=function(Z,lt){var nt=n.clamp((this.left+Z-this.right)/2,0,Z),wt=n.clamp((this.top+lt-this.bottom)/2,0,lt);return new n.Point(nt,wt)},Sc.prototype.equals=function(Z){return this.top===Z.top&&this.bottom===Z.bottom&&this.left===Z.left&&this.right===Z.right},Sc.prototype.clone=function(){return new Sc(this.top,this.bottom,this.left,this.right)},Sc.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var rl=function(Z,lt,nt,wt,Wt){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Wt===void 0?!0:Wt,this._minZoom=Z||0,this._maxZoom=lt||22,this._minPitch=nt??0,this._maxPitch=wt??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new n.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Sc,this._posMatrixCache={},this._alignedPosMatrixCache={}},nl={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};rl.prototype.clone=function(){var Z=new rl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return Z.tileSize=this.tileSize,Z.latRange=this.latRange,Z.width=this.width,Z.height=this.height,Z._center=this._center,Z.zoom=this.zoom,Z.angle=this.angle,Z._fov=this._fov,Z._pitch=this._pitch,Z._unmodified=this._unmodified,Z._edgeInsets=this._edgeInsets.clone(),Z._calcMatrices(),Z},nl.minZoom.get=function(){return this._minZoom},nl.minZoom.set=function(Z){this._minZoom!==Z&&(this._minZoom=Z,this.zoom=Math.max(this.zoom,Z))},nl.maxZoom.get=function(){return this._maxZoom},nl.maxZoom.set=function(Z){this._maxZoom!==Z&&(this._maxZoom=Z,this.zoom=Math.min(this.zoom,Z))},nl.minPitch.get=function(){return this._minPitch},nl.minPitch.set=function(Z){this._minPitch!==Z&&(this._minPitch=Z,this.pitch=Math.max(this.pitch,Z))},nl.maxPitch.get=function(){return this._maxPitch},nl.maxPitch.set=function(Z){this._maxPitch!==Z&&(this._maxPitch=Z,this.pitch=Math.min(this.pitch,Z))},nl.renderWorldCopies.get=function(){return this._renderWorldCopies},nl.renderWorldCopies.set=function(Z){Z===void 0?Z=!0:Z===null&&(Z=!1),this._renderWorldCopies=Z},nl.worldSize.get=function(){return this.tileSize*this.scale},nl.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},nl.size.get=function(){return new n.Point(this.width,this.height)},nl.bearing.get=function(){return-this.angle/Math.PI*180},nl.bearing.set=function(Z){var lt=-n.wrap(Z,-180,180)*Math.PI/180;this.angle!==lt&&(this._unmodified=!1,this.angle=lt,this._calcMatrices(),this.rotationMatrix=n.create$2(),n.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},nl.pitch.get=function(){return this._pitch/Math.PI*180},nl.pitch.set=function(Z){var lt=n.clamp(Z,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==lt&&(this._unmodified=!1,this._pitch=lt,this._calcMatrices())},nl.fov.get=function(){return this._fov/Math.PI*180},nl.fov.set=function(Z){Z=Math.max(.01,Math.min(60,Z)),this._fov!==Z&&(this._unmodified=!1,this._fov=Z/180*Math.PI,this._calcMatrices())},nl.zoom.get=function(){return this._zoom},nl.zoom.set=function(Z){var lt=Math.min(Math.max(Z,this.minZoom),this.maxZoom);this._zoom!==lt&&(this._unmodified=!1,this._zoom=lt,this.scale=this.zoomScale(lt),this.tileZoom=Math.floor(lt),this.zoomFraction=lt-this.tileZoom,this._constrain(),this._calcMatrices())},nl.center.get=function(){return this._center},nl.center.set=function(Z){Z.lat===this._center.lat&&Z.lng===this._center.lng||(this._unmodified=!1,this._center=Z,this._constrain(),this._calcMatrices())},nl.padding.get=function(){return this._edgeInsets.toJSON()},nl.padding.set=function(Z){this._edgeInsets.equals(Z)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,Z,1),this._calcMatrices())},nl.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},rl.prototype.isPaddingEqual=function(Z){return this._edgeInsets.equals(Z)},rl.prototype.interpolatePadding=function(Z,lt,nt){this._unmodified=!1,this._edgeInsets.interpolate(Z,lt,nt),this._constrain(),this._calcMatrices()},rl.prototype.coveringZoomLevel=function(Z){var lt=(Z.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/Z.tileSize));return Math.max(0,lt)},rl.prototype.getVisibleUnwrappedCoordinates=function(Z){var lt=[new n.UnwrappedTileID(0,Z)];if(this._renderWorldCopies)for(var nt=this.pointCoordinate(new n.Point(0,0)),wt=this.pointCoordinate(new n.Point(this.width,0)),Wt=this.pointCoordinate(new n.Point(this.width,this.height)),ve=this.pointCoordinate(new n.Point(0,this.height)),ke=Math.floor(Math.min(nt.x,wt.x,Wt.x,ve.x)),Jt=Math.floor(Math.max(nt.x,wt.x,Wt.x,ve.x)),fe=1,De=ke-fe;De<=Jt+fe;De++)De!==0&<.push(new n.UnwrappedTileID(De,Z));return lt},rl.prototype.coveringTiles=function(Z){var lt=this.coveringZoomLevel(Z),nt=lt;if(Z.minzoom!==void 0&<Z.maxzoom&&(lt=Z.maxzoom);var wt=n.MercatorCoordinate.fromLngLat(this.center),Wt=Math.pow(2,lt),ve=[Wt*wt.x,Wt*wt.y,0],ke=zl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,lt),Jt=Z.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Jt=lt);var fe=3,De=function(Hi){return{aabb:new Fc([Hi*Wt,0,0],[(Hi+1)*Wt,Wt,0]),zoom:0,x:0,y:0,wrap:Hi,fullyVisible:!1}},lr=[],tr=[],ar=lt,dr=Z.reparseOverscaled?nt:lt;if(this._renderWorldCopies)for(var gr=1;gr<=3;gr++)lr.push(De(-gr)),lr.push(De(gr));for(lr.push(De(0));lr.length>0;){var Ge=lr.pop(),rr=Ge.x,Je=Ge.y,Hr=Ge.fullyVisible;if(!Hr){var wn=Ge.aabb.intersects(ke);if(wn===0)continue;Hr=wn===2}var Ln=Ge.aabb.distanceX(ve),Ii=Ge.aabb.distanceY(ve),Mi=Math.max(Math.abs(Ln),Math.abs(Ii)),gi=fe+(1<gi&&Ge.zoom>=Jt){tr.push({tileID:new n.OverscaledTileID(Ge.zoom===ar?dr:Ge.zoom,Ge.wrap,Ge.zoom,rr,Je),distanceSq:n.sqrLen([ve[0]-.5-rr,ve[1]-.5-Je])});continue}for(var Vi=0;Vi<4;Vi++){var Di=(rr<<1)+Vi%2,da=(Je<<1)+(Vi>>1);lr.push({aabb:Ge.aabb.quadrant(Vi),zoom:Ge.zoom+1,x:Di,y:da,wrap:Ge.wrap,fullyVisible:Hr})}}return tr.sort(function(Hi,Wi){return Hi.distanceSq-Wi.distanceSq}).map(function(Hi){return Hi.tileID})},rl.prototype.resize=function(Z,lt){this.width=Z,this.height=lt,this.pixelsToGLUnits=[2/Z,-2/lt],this._constrain(),this._calcMatrices()},nl.unmodified.get=function(){return this._unmodified},rl.prototype.zoomScale=function(Z){return Math.pow(2,Z)},rl.prototype.scaleZoom=function(Z){return Math.log(Z)/Math.LN2},rl.prototype.project=function(Z){var lt=n.clamp(Z.lat,-this.maxValidLatitude,this.maxValidLatitude);return new n.Point(n.mercatorXfromLng(Z.lng)*this.worldSize,n.mercatorYfromLat(lt)*this.worldSize)},rl.prototype.unproject=function(Z){return new n.MercatorCoordinate(Z.x/this.worldSize,Z.y/this.worldSize).toLngLat()},nl.point.get=function(){return this.project(this.center)},rl.prototype.setLocationAtPoint=function(Z,lt){var nt=this.pointCoordinate(lt),wt=this.pointCoordinate(this.centerPoint),Wt=this.locationCoordinate(Z),ve=new n.MercatorCoordinate(Wt.x-(nt.x-wt.x),Wt.y-(nt.y-wt.y));this.center=this.coordinateLocation(ve),this._renderWorldCopies&&(this.center=this.center.wrap())},rl.prototype.locationPoint=function(Z){return this.coordinatePoint(this.locationCoordinate(Z))},rl.prototype.pointLocation=function(Z){return this.coordinateLocation(this.pointCoordinate(Z))},rl.prototype.locationCoordinate=function(Z){return n.MercatorCoordinate.fromLngLat(Z)},rl.prototype.coordinateLocation=function(Z){return Z.toLngLat()},rl.prototype.pointCoordinate=function(Z){var lt=0,nt=[Z.x,Z.y,0,1],wt=[Z.x,Z.y,1,1];n.transformMat4(nt,nt,this.pixelMatrixInverse),n.transformMat4(wt,wt,this.pixelMatrixInverse);var Wt=nt[3],ve=wt[3],ke=nt[0]/Wt,Jt=wt[0]/ve,fe=nt[1]/Wt,De=wt[1]/ve,lr=nt[2]/Wt,tr=wt[2]/ve,ar=lr===tr?0:(lt-lr)/(tr-lr);return new n.MercatorCoordinate(n.number(ke,Jt,ar)/this.worldSize,n.number(fe,De,ar)/this.worldSize)},rl.prototype.coordinatePoint=function(Z){var lt=[Z.x*this.worldSize,Z.y*this.worldSize,0,1];return n.transformMat4(lt,lt,this.pixelMatrix),new n.Point(lt[0]/lt[3],lt[1]/lt[3])},rl.prototype.getBounds=function(){return new n.LngLatBounds().extend(this.pointLocation(new n.Point(0,0))).extend(this.pointLocation(new n.Point(this.width,0))).extend(this.pointLocation(new n.Point(this.width,this.height))).extend(this.pointLocation(new n.Point(0,this.height)))},rl.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new n.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},rl.prototype.setMaxBounds=function(Z){Z?(this.lngRange=[Z.getWest(),Z.getEast()],this.latRange=[Z.getSouth(),Z.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},rl.prototype.calculatePosMatrix=function(Z,lt){lt===void 0&&(lt=!1);var nt=Z.key,wt=lt?this._alignedPosMatrixCache:this._posMatrixCache;if(wt[nt])return wt[nt];var Wt=Z.canonical,ve=this.worldSize/this.zoomScale(Wt.z),ke=Wt.x+Math.pow(2,Wt.z)*Z.wrap,Jt=n.identity(new Float64Array(16));return n.translate(Jt,Jt,[ke*ve,Wt.y*ve,0]),n.scale(Jt,Jt,[ve/n.EXTENT,ve/n.EXTENT,1]),n.multiply(Jt,lt?this.alignedProjMatrix:this.projMatrix,Jt),wt[nt]=new Float32Array(Jt),wt[nt]},rl.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},rl.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var Z=-90,lt=90,nt=-180,wt=180,Wt,ve,ke,Jt,fe=this.size,De=this._unmodified;if(this.latRange){var lr=this.latRange;Z=n.mercatorYfromLat(lr[1])*this.worldSize,lt=n.mercatorYfromLat(lr[0])*this.worldSize,Wt=lt-Zlt&&(Jt=lt-Ge)}if(this.lngRange){var rr=ar.x,Je=fe.x/2;rr-Jewt&&(ke=wt-Je)}(ke!==void 0||Jt!==void 0)&&(this.center=this.unproject(new n.Point(ke!==void 0?ke:ar.x,Jt!==void 0?Jt:ar.y))),this._unmodified=De,this._constraining=!1}},rl.prototype._calcMatrices=function(){if(this.height){var Z=this._fov/2,lt=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(Z)*this.height;var nt=Math.PI/2+this._pitch,wt=this._fov*(.5+lt.y/this.height),Wt=Math.sin(wt)*this.cameraToCenterDistance/Math.sin(n.clamp(Math.PI-nt-wt,.01,Math.PI-.01)),ve=this.point,ke=ve.x,Jt=ve.y,fe=Math.cos(Math.PI/2-this._pitch)*Wt+this.cameraToCenterDistance,De=fe*1.01,lr=this.height/50,tr=new Float64Array(16);n.perspective(tr,this._fov,this.width/this.height,lr,De),tr[8]=-lt.x*2/this.width,tr[9]=lt.y*2/this.height,n.scale(tr,tr,[1,-1,1]),n.translate(tr,tr,[0,0,-this.cameraToCenterDistance]),n.rotateX(tr,tr,this._pitch),n.rotateZ(tr,tr,this.angle),n.translate(tr,tr,[-ke,-Jt,0]),this.mercatorMatrix=n.scale([],tr,[this.worldSize,this.worldSize,this.worldSize]),n.scale(tr,tr,[1,1,n.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=tr,this.invProjMatrix=n.invert([],this.projMatrix);var ar=this.width%2/2,dr=this.height%2/2,gr=Math.cos(this.angle),Ge=Math.sin(this.angle),rr=ke-Math.round(ke)+gr*ar+Ge*dr,Je=Jt-Math.round(Jt)+gr*dr+Ge*ar,Hr=new Float64Array(tr);if(n.translate(Hr,Hr,[rr>.5?rr-1:rr,Je>.5?Je-1:Je,0]),this.alignedProjMatrix=Hr,tr=n.create(),n.scale(tr,tr,[this.width/2,-this.height/2,1]),n.translate(tr,tr,[1,-1,0]),this.labelPlaneMatrix=tr,tr=n.create(),n.scale(tr,tr,[1,-1,1]),n.translate(tr,tr,[-1,-1,0]),n.scale(tr,tr,[2/this.width,2/this.height,1]),this.glCoordMatrix=tr,this.pixelMatrix=n.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),tr=n.invert(new Float64Array(16),this.pixelMatrix),!tr)throw new Error("failed to invert matrix");this.pixelMatrixInverse=tr,this._posMatrixCache={},this._alignedPosMatrixCache={}}},rl.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var Z=this.pointCoordinate(new n.Point(0,0)),lt=[Z.x*this.worldSize,Z.y*this.worldSize,0,1],nt=n.transformMat4(lt,lt,this.pixelMatrix);return nt[3]/this.cameraToCenterDistance},rl.prototype.getCameraPoint=function(){var Z=this._pitch,lt=Math.tan(Z)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.Point(0,lt))},rl.prototype.getCameraQueryGeometry=function(Z){var lt=this.getCameraPoint();if(Z.length===1)return[Z[0],lt];for(var nt=lt.x,wt=lt.y,Wt=lt.x,ve=lt.y,ke=0,Jt=Z;ke=3&&!Z.some(function(nt){return isNaN(nt)})){var lt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(Z[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+Z[2],+Z[1]],zoom:+Z[0],bearing:lt,pitch:+(Z[4]||0)}),!0}return!1},wu.prototype._updateHashUnthrottled=function(){var Z=n.window.location.href.replace(/(#.+)?$/,this.getHashString());try{n.window.history.replaceState(n.window.history.state,null,Z)}catch{}};var ih={linearity:.3,easing:n.bezier(0,0,.3,1)},Et=n.extend({deceleration:2500,maxSpeed:1400},ih),Vt=n.extend({deceleration:20,maxSpeed:1400},ih),de=n.extend({deceleration:1e3,maxSpeed:360},ih),Ie=n.extend({deceleration:1e3,maxSpeed:90},ih),Be=function(Z){this._map=Z,this.clear()};Be.prototype.clear=function(){this._inertiaBuffer=[]},Be.prototype.record=function(Z){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:n.browser.now(),settings:Z})},Be.prototype._drainInertiaBuffer=function(){for(var Z=this._inertiaBuffer,lt=n.browser.now(),nt=160;Z.length>0&<-Z[0].time>nt;)Z.shift()},Be.prototype._onMoveEnd=function(Z){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var lt={zoom:0,bearing:0,pitch:0,pan:new n.Point(0,0),pinchAround:void 0,around:void 0},nt=0,wt=this._inertiaBuffer;nt=this._clickTolerance||this._map.fire(new cr(Z.type,this._map,Z))},fn.prototype.dblclick=function(Z){return this._firePreventable(new cr(Z.type,this._map,Z))},fn.prototype.mouseover=function(Z){this._map.fire(new cr(Z.type,this._map,Z))},fn.prototype.mouseout=function(Z){this._map.fire(new cr(Z.type,this._map,Z))},fn.prototype.touchstart=function(Z){return this._firePreventable(new Fr(Z.type,this._map,Z))},fn.prototype.touchmove=function(Z){this._map.fire(new Fr(Z.type,this._map,Z))},fn.prototype.touchend=function(Z){this._map.fire(new Fr(Z.type,this._map,Z))},fn.prototype.touchcancel=function(Z){this._map.fire(new Fr(Z.type,this._map,Z))},fn.prototype._firePreventable=function(Z){if(this._map.fire(Z),Z.defaultPrevented)return{}},fn.prototype.isEnabled=function(){return!0},fn.prototype.isActive=function(){return!1},fn.prototype.enable=function(){},fn.prototype.disable=function(){};var Bn=function(Z){this._map=Z};Bn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bn.prototype.mousemove=function(Z){this._map.fire(new cr(Z.type,this._map,Z))},Bn.prototype.mousedown=function(){this._delayContextMenu=!0},Bn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new cr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bn.prototype.contextmenu=function(Z){this._delayContextMenu?this._contextMenuEvent=Z:this._map.fire(new cr(Z.type,this._map,Z)),this._map.listens("contextmenu")&&Z.preventDefault()},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){};var ti=function(Z,lt){this._map=Z,this._el=Z.getCanvasContainer(),this._container=Z.getContainer(),this._clickTolerance=lt.clickTolerance||1};ti.prototype.isEnabled=function(){return!!this._enabled},ti.prototype.isActive=function(){return!!this._active},ti.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ti.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ti.prototype.mousedown=function(Z,lt){this.isEnabled()&&Z.shiftKey&&Z.button===0&&(a.disableDrag(),this._startPos=this._lastPos=lt,this._active=!0)},ti.prototype.mousemoveWindow=function(Z,lt){if(this._active){var nt=lt;if(!(this._lastPos.equals(nt)||!this._box&&nt.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=Z.timeStamp),nt.length===this.numTouches&&(this.centroid=ra(lt),this.touches=ei(nt,lt)))},Ki.prototype.touchmove=function(Z,lt,nt){if(!(this.aborted||!this.centroid)){var wt=ei(nt,lt);for(var Wt in this.touches){var ve=this.touches[Wt],ke=wt[Wt];(!ke||ke.dist(ve)>$i)&&(this.aborted=!0)}}},Ki.prototype.touchend=function(Z,lt,nt){if((!this.centroid||Z.timeStamp-this.startTime>Oi)&&(this.aborted=!0),nt.length===0){var wt=!this.aborted&&this.centroid;if(this.reset(),wt)return wt}};var sa=function(Z){this.singleTap=new Ki(Z),this.numTaps=Z.numTaps,this.reset()};sa.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},sa.prototype.touchstart=function(Z,lt,nt){this.singleTap.touchstart(Z,lt,nt)},sa.prototype.touchmove=function(Z,lt,nt){this.singleTap.touchmove(Z,lt,nt)},sa.prototype.touchend=function(Z,lt,nt){var wt=this.singleTap.touchend(Z,lt,nt);if(wt){var Wt=Z.timeStamp-this.lastTime0&&(this._active=!0);var wt=ei(nt,lt),Wt=new n.Point(0,0),ve=new n.Point(0,0),ke=0;for(var Jt in wt){var fe=wt[Jt],De=this._touches[Jt];De&&(Wt._add(fe),ve._add(fe.sub(De)),ke++,wt[Jt]=fe)}if(this._touches=wt,!(keMath.abs(Z.x)}var Yl=100,hc=function(Z){function lt(){Z.apply(this,arguments)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.reset=function(){Z.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},lt.prototype._start=function(nt){this._lastPoints=nt,ph(nt[0].sub(nt[1]))&&(this._valid=!1)},lt.prototype._move=function(nt,wt,Wt){var ve=nt[0].sub(this._lastPoints[0]),ke=nt[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(ve,ke,Wt.timeStamp),!!this._valid){this._lastPoints=nt,this._active=!0;var Jt=(ve.y+ke.y)/2,fe=-.5;return{pitchDelta:Jt*fe}}},lt.prototype.gestureBeginsVertically=function(nt,wt,Wt){if(this._valid!==void 0)return this._valid;var ve=2,ke=nt.mag()>=ve,Jt=wt.mag()>=ve;if(!(!ke&&!Jt)){if(!ke||!Jt)return this._firstMove===void 0&&(this._firstMove=Wt),Wt-this._firstMove0==wt.y>0;return ph(nt)&&ph(wt)&&fe}},lt}(Bl),zh={panStep:100,bearingStep:15,pitchStep:10},Se=function(){var Z=zh;this._panStep=Z.panStep,this._bearingStep=Z.bearingStep,this._pitchStep=Z.pitchStep,this._rotationDisabled=!1};Se.prototype.reset=function(){this._active=!1},Se.prototype.keydown=function(Z){var lt=this;if(!(Z.altKey||Z.ctrlKey||Z.metaKey)){var nt=0,wt=0,Wt=0,ve=0,ke=0;switch(Z.keyCode){case 61:case 107:case 171:case 187:nt=1;break;case 189:case 109:case 173:nt=-1;break;case 37:Z.shiftKey?wt=-1:(Z.preventDefault(),ve=-1);break;case 39:Z.shiftKey?wt=1:(Z.preventDefault(),ve=1);break;case 38:Z.shiftKey?Wt=1:(Z.preventDefault(),ke=-1);break;case 40:Z.shiftKey?Wt=-1:(Z.preventDefault(),ke=1);break;default:return}return this._rotationDisabled&&(wt=0,Wt=0),{cameraAnimation:function(Jt){var fe=Jt.getZoom();Jt.easeTo({duration:300,easeId:"keyboardHandler",easing:Ir,zoom:nt?Math.round(fe)+nt*(Z.shiftKey?2:1):fe,bearing:Jt.getBearing()+wt*lt._bearingStep,pitch:Jt.getPitch()+Wt*lt._pitchStep,offset:[-ve*lt._panStep,-ke*lt._panStep],center:Jt.getCenter()},{originalEvent:Z})}}}},Se.prototype.enable=function(){this._enabled=!0},Se.prototype.disable=function(){this._enabled=!1,this.reset()},Se.prototype.isEnabled=function(){return this._enabled},Se.prototype.isActive=function(){return this._active},Se.prototype.disableRotation=function(){this._rotationDisabled=!0},Se.prototype.enableRotation=function(){this._rotationDisabled=!1};function Ir(Z){return Z*(2-Z)}var Vr=4.000244140625,ri=1/100,Ai=1/450,bi=2,On=function(Z,lt){this._map=Z,this._el=Z.getCanvasContainer(),this._handler=lt,this._delta=0,this._defaultZoomRate=ri,this._wheelZoomRate=Ai,n.bindAll(["_onTimeout"],this)};On.prototype.setZoomRate=function(Z){this._defaultZoomRate=Z},On.prototype.setWheelZoomRate=function(Z){this._wheelZoomRate=Z},On.prototype.isEnabled=function(){return!!this._enabled},On.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},On.prototype.isZooming=function(){return!!this._zooming},On.prototype.enable=function(Z){this.isEnabled()||(this._enabled=!0,this._aroundCenter=Z&&Z.around==="center")},On.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},On.prototype.wheel=function(Z){if(this.isEnabled()){var lt=Z.deltaMode===n.window.WheelEvent.DOM_DELTA_LINE?Z.deltaY*40:Z.deltaY,nt=n.browser.now(),wt=nt-(this._lastWheelEventTime||0);this._lastWheelEventTime=nt,lt!==0&<%Vr===0?this._type="wheel":lt!==0&&Math.abs(lt)<4?this._type="trackpad":wt>400?(this._type=null,this._lastValue=lt,this._timeout=setTimeout(this._onTimeout,40,Z)):this._type||(this._type=Math.abs(wt*lt)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,lt+=this._lastValue)),Z.shiftKey&<&&(lt=lt/4),this._type&&(this._lastWheelEvent=Z,this._delta-=lt,this._active||this._start(Z)),Z.preventDefault()}},On.prototype._onTimeout=function(Z){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Z)},On.prototype._start=function(Z){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var lt=a.mousePos(this._el,Z);this._around=n.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(lt)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},On.prototype.renderFrame=function(){var Z=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var lt=this._map.transform;if(this._delta!==0){var nt=this._type==="wheel"&&Math.abs(this._delta)>Vr?this._wheelZoomRate:this._defaultZoomRate,wt=bi/(1+Math.exp(-Math.abs(this._delta*nt)));this._delta<0&&wt!==0&&(wt=1/wt);var Wt=typeof this._targetZoom=="number"?lt.zoomScale(this._targetZoom):lt.scale;this._targetZoom=Math.min(lt.maxZoom,Math.max(lt.minZoom,lt.scaleZoom(Wt*wt))),this._type==="wheel"&&(this._startZoom=lt.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var ve=typeof this._targetZoom=="number"?this._targetZoom:lt.zoom,ke=this._startZoom,Jt=this._easing,fe=!1,De;if(this._type==="wheel"&&ke&&Jt){var lr=Math.min((n.browser.now()-this._lastWheelEventTime)/200,1),tr=Jt(lr);De=n.number(ke,ve,tr),lr<1?this._frameId||(this._frameId=!0):fe=!0}else De=ve,fe=!0;return this._active=!0,fe&&(this._active=!1,this._finishTimeout=setTimeout(function(){Z._zooming=!1,Z._handler._triggerRenderFrame(),delete Z._targetZoom,delete Z._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!fe,zoomDelta:De-lt.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},On.prototype._smoothOutEasing=function(Z){var lt=n.ease;if(this._prevEase){var nt=this._prevEase,wt=(n.browser.now()-nt.start)/nt.duration,Wt=nt.easing(wt+.01)-nt.easing(wt),ve=.27/Math.sqrt(Wt*Wt+1e-4)*.01,ke=Math.sqrt(.27*.27-ve*ve);lt=n.bezier(ve,ke,.25,1)}return this._prevEase={start:n.browser.now(),duration:Z,easing:lt},lt},On.prototype.reset=function(){this._active=!1};var Si=function(Z,lt){this._clickZoom=Z,this._tapZoom=lt};Si.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Si.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Si.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Si.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ha=function(){this.reset()};ha.prototype.reset=function(){this._active=!1},ha.prototype.dblclick=function(Z,lt){return Z.preventDefault(),{cameraAnimation:function(nt){nt.easeTo({duration:300,zoom:nt.getZoom()+(Z.shiftKey?-1:1),around:nt.unproject(lt)},{originalEvent:Z})}}},ha.prototype.enable=function(){this._enabled=!0},ha.prototype.disable=function(){this._enabled=!1,this.reset()},ha.prototype.isEnabled=function(){return this._enabled},ha.prototype.isActive=function(){return this._active};var ia=function(){this._tap=new sa({numTouches:1,numTaps:1}),this.reset()};ia.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ia.prototype.touchstart=function(Z,lt,nt){this._swipePoint||(this._tapTime&&Z.timeStamp-this._tapTime>si&&this.reset(),this._tapTime?nt.length>0&&(this._swipePoint=lt[0],this._swipeTouch=nt[0].identifier):this._tap.touchstart(Z,lt,nt))},ia.prototype.touchmove=function(Z,lt,nt){if(!this._tapTime)this._tap.touchmove(Z,lt,nt);else if(this._swipePoint){if(nt[0].identifier!==this._swipeTouch)return;var wt=lt[0],Wt=wt.y-this._swipePoint.y;return this._swipePoint=wt,Z.preventDefault(),this._active=!0,{zoomDelta:Wt/128}}},ia.prototype.touchend=function(Z,lt,nt){if(this._tapTime)this._swipePoint&&nt.length===0&&this.reset();else{var wt=this._tap.touchend(Z,lt,nt);wt&&(this._tapTime=Z.timeStamp)}},ia.prototype.touchcancel=function(){this.reset()},ia.prototype.enable=function(){this._enabled=!0},ia.prototype.disable=function(){this._enabled=!1,this.reset()},ia.prototype.isEnabled=function(){return this._enabled},ia.prototype.isActive=function(){return this._active};var Ia=function(Z,lt,nt){this._el=Z,this._mousePan=lt,this._touchPan=nt};Ia.prototype.enable=function(Z){this._inertiaOptions=Z||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Ia.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Ia.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Ia.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var co=function(Z,lt,nt){this._pitchWithRotate=Z.pitchWithRotate,this._mouseRotate=lt,this._mousePitch=nt};co.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},co.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},co.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},co.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var to=function(Z,lt,nt,wt){this._el=Z,this._touchZoom=lt,this._touchRotate=nt,this._tapDragZoom=wt,this._rotationDisabled=!1,this._enabled=!0};to.prototype.enable=function(Z){this._touchZoom.enable(Z),this._rotationDisabled||this._touchRotate.enable(Z),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},to.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},to.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},to.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},to.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},to.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ma=function(Z){return Z.zoom||Z.drag||Z.pitch||Z.rotate},ji=function(Z){function lt(){Z.apply(this,arguments)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt}(n.Event);function En(Z){return Z.panDelta&&Z.panDelta.mag()||Z.zoomDelta||Z.bearingDelta||Z.pitchDelta}var oi=function(Z,lt){this._map=Z,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Be(Z),this._bearingSnap=lt.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(lt),n.bindAll(["handleEvent","handleWindowEvent"],this);var nt=this._el;this._listeners=[[nt,"touchstart",{passive:!0}],[nt,"touchmove",{passive:!1}],[nt,"touchend",void 0],[nt,"touchcancel",void 0],[nt,"mousedown",void 0],[nt,"mousemove",void 0],[nt,"mouseup",void 0],[n.window.document,"mousemove",{capture:!0}],[n.window.document,"mouseup",void 0],[nt,"mouseover",void 0],[nt,"mouseout",void 0],[nt,"dblclick",void 0],[nt,"click",void 0],[nt,"keydown",{capture:!1}],[nt,"keyup",void 0],[nt,"wheel",{passive:!1}],[nt,"contextmenu",void 0],[n.window,"blur",void 0]];for(var wt=0,Wt=this._listeners;wtke?Math.min(2,Ln):Math.max(.5,Ln),Hi=Math.pow(da,1-Vi),Wi=ve.unproject(Hr.add(wn.mult(Vi*Hi)).mult(Di));ve.setLocationAtPoint(ve.renderWorldCopies?Wi.wrap():Wi,Ge)}Wt._fireMoveEvents(wt)},function(Vi){Wt._afterEase(wt,Vi)},nt),this},lt.prototype._prepareEase=function(nt,wt,Wt){Wt===void 0&&(Wt={}),this._moving=!0,!wt&&!Wt.moving&&this.fire(new n.Event("movestart",nt)),this._zooming&&!Wt.zooming&&this.fire(new n.Event("zoomstart",nt)),this._rotating&&!Wt.rotating&&this.fire(new n.Event("rotatestart",nt)),this._pitching&&!Wt.pitching&&this.fire(new n.Event("pitchstart",nt))},lt.prototype._fireMoveEvents=function(nt){this.fire(new n.Event("move",nt)),this._zooming&&this.fire(new n.Event("zoom",nt)),this._rotating&&this.fire(new n.Event("rotate",nt)),this._pitching&&this.fire(new n.Event("pitch",nt))},lt.prototype._afterEase=function(nt,wt){if(!(this._easeId&&wt&&this._easeId===wt)){delete this._easeId;var Wt=this._zooming,ve=this._rotating,ke=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Wt&&this.fire(new n.Event("zoomend",nt)),ve&&this.fire(new n.Event("rotateend",nt)),ke&&this.fire(new n.Event("pitchend",nt)),this.fire(new n.Event("moveend",nt))}},lt.prototype.flyTo=function(nt,wt){var Wt=this;if(!nt.essential&&n.browser.prefersReducedMotion){var ve=n.pick(nt,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ve,wt)}this.stop(),nt=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},nt);var ke=this.transform,Jt=this.getZoom(),fe=this.getBearing(),De=this.getPitch(),lr=this.getPadding(),tr="zoom"in nt?n.clamp(+nt.zoom,ke.minZoom,ke.maxZoom):Jt,ar="bearing"in nt?this._normalizeBearing(nt.bearing,fe):fe,dr="pitch"in nt?+nt.pitch:De,gr="padding"in nt?nt.padding:ke.padding,Ge=ke.zoomScale(tr-Jt),rr=n.Point.convert(nt.offset),Je=ke.centerPoint.add(rr),Hr=ke.pointLocation(Je),wn=n.LngLat.convert(nt.center||Hr);this._normalizeCenter(wn);var Ln=ke.project(Hr),Ii=ke.project(wn).sub(Ln),Mi=nt.curve,gi=Math.max(ke.width,ke.height),Vi=gi/Ge,Di=Ii.mag();if("minZoom"in nt){var da=n.clamp(Math.min(nt.minZoom,Jt,tr),ke.minZoom,ke.maxZoom),Hi=gi/ke.zoomScale(da-Jt);Mi=Math.sqrt(Hi/Di*2)}var Wi=Mi*Mi;function wa(qs){var Bc=(Vi*Vi-gi*gi+(qs?-1:1)*Wi*Wi*Di*Di)/(2*(qs?Vi:gi)*Wi*Di);return Math.log(Math.sqrt(Bc*Bc+1)-Bc)}function vo(qs){return(Math.exp(qs)-Math.exp(-qs))/2}function So(qs){return(Math.exp(qs)+Math.exp(-qs))/2}function ns(qs){return vo(qs)/So(qs)}var As=wa(0),Wl=function(qs){return So(As)/So(As+Mi*qs)},Jl=function(qs){return gi*((So(As)*ns(As+Mi*qs)-vo(As))/Wi)/Di},Al=(wa(1)-As)/Mi;if(Math.abs(Di)<1e-6||!isFinite(Al)){if(Math.abs(gi-Vi)<1e-6)return this.easeTo(nt,wt);var Ql=Vint.maxDuration&&(nt.duration=0),this._zooming=!0,this._rotating=fe!==ar,this._pitching=dr!==De,this._padding=!ke.isPaddingEqual(gr),this._prepareEase(wt,!1),this._ease(function(qs){var Bc=qs*Al,md=1/Wl(Bc);ke.zoom=qs===1?tr:Jt+ke.scaleZoom(md),Wt._rotating&&(ke.bearing=n.number(fe,ar,qs)),Wt._pitching&&(ke.pitch=n.number(De,dr,qs)),Wt._padding&&(ke.interpolatePadding(lr,gr,qs),Je=ke.centerPoint.add(rr));var Vd=qs===1?wn:ke.unproject(Ln.add(Ii.mult(Jl(Bc))).mult(md));ke.setLocationAtPoint(ke.renderWorldCopies?Vd.wrap():Vd,Je),Wt._fireMoveEvents(wt)},function(){return Wt._afterEase(wt)},nt),this},lt.prototype.isEasing=function(){return!!this._easeFrameId},lt.prototype.stop=function(){return this._stop()},lt.prototype._stop=function(nt,wt){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Wt=this._onEaseEnd;delete this._onEaseEnd,Wt.call(this,wt)}if(!nt){var ve=this.handlers;ve&&ve.stop(!1)}return this},lt.prototype._ease=function(nt,wt,Wt){Wt.animate===!1||Wt.duration===0?(nt(1),wt()):(this._easeStart=n.browser.now(),this._easeOptions=Wt,this._onEaseFrame=nt,this._onEaseEnd=wt,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},lt.prototype._renderFrameCallback=function(){var nt=Math.min((n.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(nt)),nt<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},lt.prototype._normalizeBearing=function(nt,wt){nt=n.wrap(nt,-180,180);var Wt=Math.abs(nt-wt);return Math.abs(nt-360-wt)180?-360:Wt<-180?360:0}},lt}(n.Evented),Ni=function(Z){Z===void 0&&(Z={}),this.options=Z,n.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Ni.prototype.getDefaultPosition=function(){return"bottom-right"},Ni.prototype.onAdd=function(Z){var lt=this.options&&this.options.compact;return this._map=Z,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),lt&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),lt===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ni.prototype.onRemove=function(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Ni.prototype._setElementTitle=function(Z,lt){var nt=this._map._getUIString("AttributionControl."+lt);Z.title=nt,Z.setAttribute("aria-label",nt)},Ni.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ni.prototype._updateEditLink=function(){var Z=this._editLink;Z||(Z=this._editLink=this._container.querySelector(".mapbox-improve-map"));var lt=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||n.config.ACCESS_TOKEN}];if(Z){var nt=lt.reduce(function(wt,Wt,ve){return Wt.value&&(wt+=Wt.key+"="+Wt.value+(ve=0)return!1;return!0});var ke=Z.join(" | ");ke!==this._attribHTML&&(this._attribHTML=ke,Z.length?(this._innerContainer.innerHTML=ke,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ni.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var wi=function(){n.bindAll(["_updateLogo"],this),n.bindAll(["_updateCompact"],this)};wi.prototype.onAdd=function(Z){this._map=Z,this._container=a.create("div","mapboxgl-ctrl");var lt=a.create("a","mapboxgl-ctrl-logo");return lt.target="_blank",lt.rel="noopener nofollow",lt.href="https://www.mapbox.com/",lt.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),lt.setAttribute("rel","noopener nofollow"),this._container.appendChild(lt),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},wi.prototype.onRemove=function(){a.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},wi.prototype.getDefaultPosition=function(){return"bottom-left"},wi.prototype._updateLogo=function(Z){(!Z||Z.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},wi.prototype._logoRequired=function(){if(this._map.style){var Z=this._map.style.sourceCaches;for(var lt in Z){var nt=Z[lt].getSource();if(nt.mapbox_logo)return!0}return!1}},wi.prototype._updateCompact=function(){var Z=this._container.children;if(Z.length){var lt=Z[0];this._map.getCanvasContainer().offsetWidth<250?lt.classList.add("mapboxgl-compact"):lt.classList.remove("mapboxgl-compact")}};var Ua=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ua.prototype.add=function(Z){var lt=++this._id,nt=this._queue;return nt.push({callback:Z,id:lt,cancelled:!1}),lt},Ua.prototype.remove=function(Z){for(var lt=this._currentlyRunning,nt=lt?this._queue.concat(lt):this._queue,wt=0,Wt=nt;wtwt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(wt.minPitch!=null&&wt.maxPitch!=null&&wt.minPitch>wt.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(wt.minPitch!=null&&wt.minPitchua)throw new Error("maxPitch must be less than or equal to "+ua);var ve=new rl(wt.minZoom,wt.maxZoom,wt.minPitch,wt.maxPitch,wt.renderWorldCopies);if(Z.call(this,ve,wt),this._interactive=wt.interactive,this._maxTileCacheSize=wt.maxTileCacheSize,this._failIfMajorPerformanceCaveat=wt.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=wt.preserveDrawingBuffer,this._antialias=wt.antialias,this._trackResize=wt.trackResize,this._bearingSnap=wt.bearingSnap,this._refreshExpiredTiles=wt.refreshExpiredTiles,this._fadeDuration=wt.fadeDuration,this._crossSourceCollisions=wt.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=wt.collectResourceTiming,this._renderTaskQueue=new Ua,this._controls=[],this._mapId=n.uniqueId(),this._locale=n.extend({},Ca,wt.locale),this._clickTolerance=wt.clickTolerance,this._requestManager=new n.RequestManager(wt.transformRequest,wt.accessToken),typeof wt.container=="string"){if(this._container=n.window.document.getElementById(wt.container),!this._container)throw new Error("Container '"+wt.container+"' not found.")}else if(wt.container instanceof Ri)this._container=wt.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(wt.maxBounds&&this.setMaxBounds(wt.maxBounds),n.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return Wt._update(!1)}),this.on("moveend",function(){return Wt._update(!1)}),this.on("zoom",function(){return Wt._update(!0)}),typeof n.window<"u"&&(n.window.addEventListener("online",this._onWindowOnline,!1),n.window.addEventListener("resize",this._onWindowResize,!1),n.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new oi(this,wt);var ke=typeof wt.hash=="string"&&wt.hash||void 0;this._hash=wt.hash&&new wu(ke).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:wt.center,zoom:wt.zoom,bearing:wt.bearing,pitch:wt.pitch}),wt.bounds&&(this.resize(),this.fitBounds(wt.bounds,n.extend({},wt.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=wt.localIdeographFontFamily,wt.style&&this.setStyle(wt.style,{localIdeographFontFamily:wt.localIdeographFontFamily}),wt.attributionControl&&this.addControl(new Ni({customAttribution:wt.customAttribution})),this.addControl(new wi,wt.logoPosition),this.on("style.load",function(){Wt.transform.unmodified&&Wt.jumpTo(Wt.style.stylesheet)}),this.on("data",function(Jt){Wt._update(Jt.dataType==="style"),Wt.fire(new n.Event(Jt.dataType+"data",Jt))}),this.on("dataloading",function(Jt){Wt.fire(new n.Event(Jt.dataType+"dataloading",Jt))})}Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt;var nt={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return lt.prototype._getMapId=function(){return this._mapId},lt.prototype.addControl=function(wt,Wt){if(Wt===void 0&&(wt.getDefaultPosition?Wt=wt.getDefaultPosition():Wt="top-right"),!wt||!wt.onAdd)return this.fire(new n.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var ve=wt.onAdd(this);this._controls.push(wt);var ke=this._controlPositions[Wt];return Wt.indexOf("bottom")!==-1?ke.insertBefore(ve,ke.firstChild):ke.appendChild(ve),this},lt.prototype.removeControl=function(wt){if(!wt||!wt.onRemove)return this.fire(new n.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Wt=this._controls.indexOf(wt);return Wt>-1&&this._controls.splice(Wt,1),wt.onRemove(this),this},lt.prototype.hasControl=function(wt){return this._controls.indexOf(wt)>-1},lt.prototype.resize=function(wt){var Wt=this._containerDimensions(),ve=Wt[0],ke=Wt[1];this._resizeCanvas(ve,ke),this.transform.resize(ve,ke),this.painter.resize(ve,ke);var Jt=!this._moving;return Jt&&(this.stop(),this.fire(new n.Event("movestart",wt)).fire(new n.Event("move",wt))),this.fire(new n.Event("resize",wt)),Jt&&this.fire(new n.Event("moveend",wt)),this},lt.prototype.getBounds=function(){return this.transform.getBounds()},lt.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},lt.prototype.setMaxBounds=function(wt){return this.transform.setMaxBounds(n.LngLatBounds.convert(wt)),this._update()},lt.prototype.setMinZoom=function(wt){if(wt=wt??$a,wt>=$a&&wt<=this.transform.maxZoom)return this.transform.minZoom=wt,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=wt,this._update(),this.getZoom()>wt&&this.setZoom(wt),this;throw new Error("maxZoom must be greater than the current minZoom")},lt.prototype.getMaxZoom=function(){return this.transform.maxZoom},lt.prototype.setMinPitch=function(wt){if(wt=wt??la,wt=la&&wt<=this.transform.maxPitch)return this.transform.minPitch=wt,this._update(),this.getPitch()ua)throw new Error("maxPitch must be less than or equal to "+ua);if(wt>=this.transform.minPitch)return this.transform.maxPitch=wt,this._update(),this.getPitch()>wt&&this.setPitch(wt),this;throw new Error("maxPitch must be greater than the current minPitch")},lt.prototype.getMaxPitch=function(){return this.transform.maxPitch},lt.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},lt.prototype.setRenderWorldCopies=function(wt){return this.transform.renderWorldCopies=wt,this._update()},lt.prototype.project=function(wt){return this.transform.locationPoint(n.LngLat.convert(wt))},lt.prototype.unproject=function(wt){return this.transform.pointLocation(n.Point.convert(wt))},lt.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},lt.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},lt.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},lt.prototype._createDelegatedListener=function(wt,Wt,ve){var ke=this,Jt;if(wt==="mouseenter"||wt==="mouseover"){var fe=!1,De=function(Ge){var rr=ke.getLayer(Wt)?ke.queryRenderedFeatures(Ge.point,{layers:[Wt]}):[];rr.length?fe||(fe=!0,ve.call(ke,new cr(wt,ke,Ge.originalEvent,{features:rr}))):fe=!1},lr=function(){fe=!1};return{layer:Wt,listener:ve,delegates:{mousemove:De,mouseout:lr}}}else if(wt==="mouseleave"||wt==="mouseout"){var tr=!1,ar=function(Ge){var rr=ke.getLayer(Wt)?ke.queryRenderedFeatures(Ge.point,{layers:[Wt]}):[];rr.length?tr=!0:tr&&(tr=!1,ve.call(ke,new cr(wt,ke,Ge.originalEvent)))},dr=function(Ge){tr&&(tr=!1,ve.call(ke,new cr(wt,ke,Ge.originalEvent)))};return{layer:Wt,listener:ve,delegates:{mousemove:ar,mouseout:dr}}}else{var gr=function(Ge){var rr=ke.getLayer(Wt)?ke.queryRenderedFeatures(Ge.point,{layers:[Wt]}):[];rr.length&&(Ge.features=rr,ve.call(ke,Ge),delete Ge.features)};return{layer:Wt,listener:ve,delegates:(Jt={},Jt[wt]=gr,Jt)}}},lt.prototype.on=function(wt,Wt,ve){if(ve===void 0)return Z.prototype.on.call(this,wt,Wt);var ke=this._createDelegatedListener(wt,Wt,ve);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[wt]=this._delegatedListeners[wt]||[],this._delegatedListeners[wt].push(ke);for(var Jt in ke.delegates)this.on(Jt,ke.delegates[Jt]);return this},lt.prototype.once=function(wt,Wt,ve){if(ve===void 0)return Z.prototype.once.call(this,wt,Wt);var ke=this._createDelegatedListener(wt,Wt,ve);for(var Jt in ke.delegates)this.once(Jt,ke.delegates[Jt]);return this},lt.prototype.off=function(wt,Wt,ve){var ke=this;if(ve===void 0)return Z.prototype.off.call(this,wt,Wt);var Jt=function(fe){for(var De=fe[wt],lr=0;lr180;){var ke=nt.locationPoint(Z);if(ke.x>=0&&ke.y>=0&&ke.x<=nt.width&&ke.y<=nt.height)break;Z.lng>nt.center.lng?Z.lng-=360:Z.lng+=360}return Z}var hs={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 Xl(Z,lt,nt){var wt=Z.classList;for(var Wt in hs)wt.remove("mapboxgl-"+nt+"-anchor-"+Wt);wt.add("mapboxgl-"+nt+"-anchor-"+lt)}var Rl=function(Z){function lt(nt,wt){if(Z.call(this),(nt instanceof n.window.HTMLElement||wt)&&(nt=n.extend({element:nt},wt)),n.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=nt&&nt.anchor||"center",this._color=nt&&nt.color||"#3FB1CE",this._scale=nt&&nt.scale||1,this._draggable=nt&&nt.draggable||!1,this._clickTolerance=nt&&nt.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=nt&&nt.rotation||0,this._rotationAlignment=nt&&nt.rotationAlignment||"auto",this._pitchAlignment=nt&&nt.pitchAlignment&&nt.pitchAlignment!=="auto"?nt.pitchAlignment:this._rotationAlignment,!nt||!nt.element){this._defaultMarker=!0,this._element=a.create("div"),this._element.setAttribute("aria-label","Map marker");var Wt=a.createNS("http://www.w3.org/2000/svg","svg"),ve=41,ke=27;Wt.setAttributeNS(null,"display","block"),Wt.setAttributeNS(null,"height",ve+"px"),Wt.setAttributeNS(null,"width",ke+"px"),Wt.setAttributeNS(null,"viewBox","0 0 "+ke+" "+ve);var Jt=a.createNS("http://www.w3.org/2000/svg","g");Jt.setAttributeNS(null,"stroke","none"),Jt.setAttributeNS(null,"stroke-width","1"),Jt.setAttributeNS(null,"fill","none"),Jt.setAttributeNS(null,"fill-rule","evenodd");var fe=a.createNS("http://www.w3.org/2000/svg","g");fe.setAttributeNS(null,"fill-rule","nonzero");var De=a.createNS("http://www.w3.org/2000/svg","g");De.setAttributeNS(null,"transform","translate(3.0, 29.0)"),De.setAttributeNS(null,"fill","#000000");for(var lr=[{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"}],tr=0,ar=lr;tr=wt}this._isDragging&&(this._pos=nt.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new n.Event("dragstart"))),this.fire(new n.Event("drag")))},lt.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new n.Event("dragend")),this._state="inactive"},lt.prototype._addDragHandler=function(nt){this._element.contains(nt.originalEvent.target)&&(nt.preventDefault(),this._positionDelta=nt.point.sub(this._pos).add(this._offset),this._pointerdownPos=nt.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))},lt.prototype.setDraggable=function(nt){return this._draggable=!!nt,this._map&&(nt?(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},lt.prototype.isDraggable=function(){return this._draggable},lt.prototype.setRotation=function(nt){return this._rotation=nt||0,this._update(),this},lt.prototype.getRotation=function(){return this._rotation},lt.prototype.setRotationAlignment=function(nt){return this._rotationAlignment=nt||"auto",this._update(),this},lt.prototype.getRotationAlignment=function(){return this._rotationAlignment},lt.prototype.setPitchAlignment=function(nt){return this._pitchAlignment=nt&&nt!=="auto"?nt:this._rotationAlignment,this._update(),this},lt.prototype.getPitchAlignment=function(){return this._pitchAlignment},lt}(n.Evented),ys={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Dc;function Cl(Z){Dc!==void 0?Z(Dc):n.window.navigator.permissions!==void 0?n.window.navigator.permissions.query({name:"geolocation"}).then(function(lt){Dc=lt.state!=="denied",Z(Dc)}):(Dc=!!n.window.navigator.geolocation,Z(Dc))}var Nc=0,ku=!1,Eu=function(Z){function lt(nt){Z.call(this),this.options=n.extend({},ys,nt),n.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.onAdd=function(nt){return this._map=nt,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Cl(this._setupUI),this._container},lt.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(n.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(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Nc=0,ku=!1},lt.prototype._isOutOfMapMaxBounds=function(nt){var wt=this._map.getMaxBounds(),Wt=nt.coords;return wt&&(Wt.longitudewt.getEast()||Wt.latitudewt.getNorth())},lt.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},lt.prototype._onSuccess=function(nt){if(this._map){if(this._isOutOfMapMaxBounds(nt)){this._setErrorState(),this.fire(new n.Event("outofmaxbounds",nt)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=nt,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(nt),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(nt),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new n.Event("geolocate",nt)),this._finish()}},lt.prototype._updateCamera=function(nt){var wt=new n.LngLat(nt.coords.longitude,nt.coords.latitude),Wt=nt.coords.accuracy,ve=this._map.getBearing(),ke=n.extend({bearing:ve},this.options.fitBoundsOptions);this._map.fitBounds(wt.toBounds(Wt),ke,{geolocateSource:!0})},lt.prototype._updateMarker=function(nt){if(nt){var wt=new n.LngLat(nt.coords.longitude,nt.coords.latitude);this._accuracyCircleMarker.setLngLat(wt).addTo(this._map),this._userLocationDotMarker.setLngLat(wt).addTo(this._map),this._accuracy=nt.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},lt.prototype._updateCircleRadius=function(){var nt=this._map._container.clientHeight/2,wt=this._map.unproject([0,nt]),Wt=this._map.unproject([1,nt]),ve=wt.distanceTo(Wt),ke=Math.ceil(2*this._accuracy/ve);this._circleElement.style.width=ke+"px",this._circleElement.style.height=ke+"px"},lt.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},lt.prototype._onError=function(nt){if(this._map){if(this.options.trackUserLocation)if(nt.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var wt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=wt,this._geolocateButton.setAttribute("aria-label",wt),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(nt.code===3&&ku)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new n.Event("error",nt)),this._finish()}},lt.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},lt.prototype._setupUI=function(nt){var wt=this;if(this._container.addEventListener("contextmenu",function(ke){return ke.preventDefault()}),this._geolocateButton=a.create("button","mapboxgl-ctrl-geolocate",this._container),a.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",nt===!1){n.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Wt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Wt,this._geolocateButton.setAttribute("aria-label",Wt)}else{var ve=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=ve,this._geolocateButton.setAttribute("aria-label",ve)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Rl(this._dotElement),this._circleElement=a.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Rl({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",function(ke){var Jt=ke.originalEvent&&ke.originalEvent.type==="resize";!ke.geolocateSource&&wt._watchState==="ACTIVE_LOCK"&&!Jt&&(wt._watchState="BACKGROUND",wt._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),wt._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),wt.fire(new n.Event("trackuserlocationend")))})},lt.prototype.trigger=function(){if(!this._setup)return n.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 n.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Nc--,ku=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new n.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Nc++;var nt;Nc>1?(nt={maximumAge:6e5,timeout:0},ku=!0):(nt=this.options.positionOptions,ku=!1),this._geolocationWatchID=n.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,nt)}}else n.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},lt.prototype._clearWatch=function(){n.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},lt}(n.Evented),Ec={maxWidth:100,unit:"metric"},kc=function(Z){this.options=n.extend({},Ec,Z),n.bindAll(["_onMove","setUnit"],this)};kc.prototype.getDefaultPosition=function(){return"bottom-left"},kc.prototype._onMove=function(){zc(this._map,this._container,this.options)},kc.prototype.onAdd=function(Z){return this._map=Z,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",Z.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},kc.prototype.onRemove=function(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},kc.prototype.setUnit=function(Z){this.options.unit=Z,zc(this._map,this._container,this.options)};function zc(Z,lt,nt){var wt=nt&&nt.maxWidth||100,Wt=Z._container.clientHeight/2,ve=Z.unproject([0,Wt]),ke=Z.unproject([wt,Wt]),Jt=ve.distanceTo(ke);if(nt&&nt.unit==="imperial"){var fe=3.2808*Jt;if(fe>5280){var De=fe/5280;Xo(lt,wt,De,Z._getUIString("ScaleControl.Miles"))}else Xo(lt,wt,fe,Z._getUIString("ScaleControl.Feet"))}else if(nt&&nt.unit==="nautical"){var lr=Jt/1852;Xo(lt,wt,lr,Z._getUIString("ScaleControl.NauticalMiles"))}else Jt>=1e3?Xo(lt,wt,Jt/1e3,Z._getUIString("ScaleControl.Kilometers")):Xo(lt,wt,Jt,Z._getUIString("ScaleControl.Meters"))}function Xo(Z,lt,nt,wt){var Wt=xl(nt),ve=Wt/nt;Z.style.width=lt*ve+"px",Z.innerHTML=Wt+" "+wt}function Oc(Z){var lt=Math.pow(10,Math.ceil(-Math.log(Z)/Math.LN10));return Math.round(Z*lt)/lt}function xl(Z){var lt=Math.pow(10,(""+Math.floor(Z)).length-1),nt=Z/lt;return nt=nt>=10?10:nt>=5?5:nt>=3?3:nt>=2?2:nt>=1?1:Oc(nt),lt*nt}var jc=function(Z){this._fullscreen=!1,Z&&Z.container&&(Z.container instanceof n.window.HTMLElement?this._container=Z.container:n.warnOnce("Full screen control 'container' must be a DOM element.")),n.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in n.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in n.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in n.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in n.window.document&&(this._fullscreenchange="MSFullscreenChange")};jc.prototype.onAdd=function(Z){return this._map=Z,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",n.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},jc.prototype.onRemove=function(){a.remove(this._controlContainer),this._map=null,n.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},jc.prototype._checkFullscreenSupport=function(){return!!(n.window.document.fullscreenEnabled||n.window.document.mozFullScreenEnabled||n.window.document.msFullscreenEnabled||n.window.document.webkitFullscreenEnabled)},jc.prototype._setupUI=function(){var Z=this._fullscreenButton=a.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);a.create("span","mapboxgl-ctrl-icon",Z).setAttribute("aria-hidden",!0),Z.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),n.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},jc.prototype._updateTitle=function(){var Z=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Z),this._fullscreenButton.title=Z},jc.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},jc.prototype._isFullscreen=function(){return this._fullscreen},jc.prototype._changeIcon=function(){var Z=n.window.document.fullscreenElement||n.window.document.mozFullScreenElement||n.window.document.webkitFullscreenElement||n.window.document.msFullscreenElement;Z===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},jc.prototype._onClickFullscreen=function(){this._isFullscreen()?n.window.document.exitFullscreen?n.window.document.exitFullscreen():n.window.document.mozCancelFullScreen?n.window.document.mozCancelFullScreen():n.window.document.msExitFullscreen?n.window.document.msExitFullscreen():n.window.document.webkitCancelFullScreen&&n.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Lu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},jo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Rs=function(Z){function lt(nt){Z.call(this),this.options=n.extend(Object.create(Lu),nt),n.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.addTo=function(nt){return this._map&&this.remove(),this._map=nt,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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new n.Event("open")),this},lt.prototype.isOpen=function(){return!!this._map},lt.prototype.remove=function(){return this._content&&a.remove(this._content),this._container&&(a.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 n.Event("close")),this},lt.prototype.getLngLat=function(){return this._lngLat},lt.prototype.setLngLat=function(nt){return this._lngLat=n.LngLat.convert(nt),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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},lt.prototype.trackPointer=function(){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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},lt.prototype.getElement=function(){return this._container},lt.prototype.setText=function(nt){return this.setDOMContent(n.window.document.createTextNode(nt))},lt.prototype.setHTML=function(nt){var wt=n.window.document.createDocumentFragment(),Wt=n.window.document.createElement("body"),ve;for(Wt.innerHTML=nt;ve=Wt.firstChild,!!ve;)wt.appendChild(ve);return this.setDOMContent(wt)},lt.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},lt.prototype.setMaxWidth=function(nt){return this.options.maxWidth=nt,this._update(),this},lt.prototype.setDOMContent=function(nt){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(nt),this._createCloseButton(),this._update(),this._focusFirstElement(),this},lt.prototype.addClassName=function(nt){this._container&&this._container.classList.add(nt)},lt.prototype.removeClassName=function(nt){this._container&&this._container.classList.remove(nt)},lt.prototype.setOffset=function(nt){return this.options.offset=nt,this._update(),this},lt.prototype.toggleClassName=function(nt){if(this._container)return this._container.classList.toggle(nt)},lt.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-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))},lt.prototype._onMouseUp=function(nt){this._update(nt.point)},lt.prototype._onMouseMove=function(nt){this._update(nt.point)},lt.prototype._onDrag=function(nt){this._update(nt.point)},lt.prototype._update=function(nt){var wt=this,Wt=this._lngLat||this._trackPointer;if(!(!this._map||!Wt||!this._content)&&(this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(ar){return wt._container.classList.add(ar)}),this._trackPointer&&this._container.classList.add("mapboxgl-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=No(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!nt))){var ve=this._pos=this._trackPointer&&nt?nt:this._map.project(this._lngLat),ke=this.options.anchor,Jt=Fl(this.options.offset);if(!ke){var fe=this._container.offsetWidth,De=this._container.offsetHeight,lr;ve.y+Jt.bottom.ythis._map.transform.height-De?lr=["bottom"]:lr=[],ve.xthis._map.transform.width-fe/2&&lr.push("right"),lr.length===0?ke="bottom":ke=lr.join("-")}var tr=ve.add(Jt[ke]).round();a.setTransform(this._container,hs[ke]+" translate("+tr.x+"px,"+tr.y+"px)"),Xl(this._container,ke,"popup")}},lt.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var nt=this._container.querySelector(jo);nt&&nt.focus()}},lt.prototype._onClose=function(){this.remove()},lt}(n.Evented);function Fl(Z){if(Z)if(typeof Z=="number"){var lt=Math.round(Math.sqrt(.5*Math.pow(Z,2)));return{center:new n.Point(0,0),top:new n.Point(0,Z),"top-left":new n.Point(lt,lt),"top-right":new n.Point(-lt,lt),bottom:new n.Point(0,-Z),"bottom-left":new n.Point(lt,-lt),"bottom-right":new n.Point(-lt,-lt),left:new n.Point(Z,0),right:new n.Point(-Z,0)}}else if(Z instanceof n.Point||Array.isArray(Z)){var nt=n.Point.convert(Z);return{center:nt,top:nt,"top-left":nt,"top-right":nt,bottom:nt,"bottom-left":nt,"bottom-right":nt,left:nt,right:nt}}else return{center:n.Point.convert(Z.center||[0,0]),top:n.Point.convert(Z.top||[0,0]),"top-left":n.Point.convert(Z["top-left"]||[0,0]),"top-right":n.Point.convert(Z["top-right"]||[0,0]),bottom:n.Point.convert(Z.bottom||[0,0]),"bottom-left":n.Point.convert(Z["bottom-left"]||[0,0]),"bottom-right":n.Point.convert(Z["bottom-right"]||[0,0]),left:n.Point.convert(Z.left||[0,0]),right:n.Point.convert(Z.right||[0,0])};else return Fl(new n.Point(0,0))}var Pl={version:n.version,supported:i,setRTLTextPlugin:n.setRTLTextPlugin,getRTLTextPluginStatus:n.getRTLTextPluginStatus,Map:Vo,NavigationControl:Ya,GeolocateControl:Eu,AttributionControl:Ni,ScaleControl:kc,FullscreenControl:jc,Popup:Rs,Marker:Rl,Style:pu,LngLat:n.LngLat,LngLatBounds:n.LngLatBounds,Point:n.Point,MercatorCoordinate:n.MercatorCoordinate,Evented:n.Evented,config:n.config,prewarm:so,clearPrewarmedResources:Fe,get accessToken(){return n.config.ACCESS_TOKEN},set accessToken(Z){n.config.ACCESS_TOKEN=Z},get baseApiUrl(){return n.config.API_URL},set baseApiUrl(Z){n.config.API_URL=Z},get workerCount(){return Ji.workerCount},set workerCount(Z){Ji.workerCount=Z},get maxParallelImageRequests(){return n.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(Z){n.config.MAX_PARALLEL_IMAGE_REQUESTS=Z},clearStorage:function(Z){n.clearTileCache(Z)},workerUrl:""};return Pl}),z})}),ntt=It((et,Y)=>{var f=jn(),y=uu().sanitizeHTML,z=xz(),P=my();function n(c,s){this.subplot=c,this.uid=c.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var i=n.prototype;i.update=function(c){this.visible?this.needsNewImage(c)?this.updateImage(c):this.needsNewSource(c)?(this.removeLayer(),this.updateSource(c),this.updateLayer(c)):this.needsNewLayer(c)?this.updateLayer(c):this.updateStyle(c):(this.updateSource(c),this.updateLayer(c)),this.visible=a(c)},i.needsNewImage=function(c){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&c.sourcetype==="image"&&(this.source!==c.source||JSON.stringify(this.coordinates)!==JSON.stringify(c.coordinates))},i.needsNewSource=function(c){return this.sourceType!==c.sourcetype||JSON.stringify(this.source)!==JSON.stringify(c.source)||this.layerType!==c.type},i.needsNewLayer=function(c){return this.layerType!==c.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},i.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},i.updateImage=function(c){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:c.source,coordinates:c.coordinates});var h=this.findFollowingMapboxLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},i.updateSource=function(c){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=c.sourcetype,this.source=c.source,!!a(c)){var h=o(c);s.addSource(this.idSource,h)}},i.findFollowingMapboxLayerId=function(c){if(c==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(c){var s={},h={};switch(c.type){case"circle":f.extendFlat(h,{"circle-radius":c.circle.radius,"circle-color":c.color,"circle-opacity":c.opacity});break;case"line":f.extendFlat(h,{"line-width":c.line.width,"line-color":c.color,"line-opacity":c.opacity,"line-dasharray":c.line.dash});break;case"fill":f.extendFlat(h,{"fill-color":c.color,"fill-outline-color":c.fill.outlinecolor,"fill-opacity":c.opacity});break;case"symbol":var m=c.symbol,b=z(m.textposition,m.iconsize);f.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),f.extendFlat(h,{"icon-color":c.color,"text-color":m.textfont.color,"text-opacity":c.opacity});break;case"raster":f.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":c.opacity});break}return{layout:s,paint:h}}function o(c){var s=c.sourcetype,h=c.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=c.coordinates),m[b]=h,c.sourceattribution&&(m.attribution=y(c.sourceattribution)),m}Y.exports=function(c,s,h){var m=new n(c,s);return m.update(h),m}}),itt=It((et,Y)=>{var f=bz(),y=jn(),z=q_(),P=ls(),n=Fs(),i=Up(),a=hd(),l=dm(),o=l.drawMode,c=l.selectMode,s=Md().prepSelect,h=Md().clearOutline,m=Md().clearSelectionsCache,b=Md().selectOnClick,x=my(),_=ntt();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var d=A.prototype;d.plot=function(I,M,p){var g=this,C=M[g.id];g.map&&C.accesstoken!==g.accessToken&&(g.map.remove(),g.map=null,g.styleObj=null,g.traceHash={},g.layerList=[]);var S;g.map?S=new Promise(function(N,B){g.updateMap(I,M,N,B)}):S=new Promise(function(N,B){g.createMap(I,M,N,B)}),p.push(S)},d.createMap=function(I,M,p,g){var C=this,S=M[C.id],N=C.styleObj=w(S.style,M);C.accessToken=S.accesstoken;var B=S.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new f.Map({container:C.div,style:N.style,center:E(S.center),zoom:S.zoom,bearing:S.bearing,pitch:S.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new f.AttributionControl({compact:!0}));V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var W=[];W.push(new Promise(function(F){V.once("load",F)})),W=W.concat(z.fetchTraceGeoData(I)),Promise.all(W).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.updateMap=function(I,M,p,g){var C=this,S=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style,M);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,S.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){S.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,S,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},d.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var S=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),c(S)||o(S)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,S)},i.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},d.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},d.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var f=jn(),y=O_(),z=Zf(),P=Rk();Y.exports=function(a,l,o){y(a,l,o,{type:"mapbox",attributes:P,handleDefaults:n,partition:"y",accessToken:l._mapboxAccessToken})};function n(a,l,o,c){o("accesstoken",c.accessToken),o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var s=o("bounds.west"),h=o("bounds.east"),m=o("bounds.south"),b=o("bounds.north");(s===void 0||h===void 0||m===void 0||b===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:i}),l._input=a}function i(a,l){function o(x,_){return f.coerce(a,l,P.layers,x,_)}var c=o("visible");if(c){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",f.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),f.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),xA=It(et=>{var Y=bz(),f=jn(),y=f.strTranslate,z=f.strScale,P=Mf().getSubplotCalcData,n=k0(),i=Br(),a=Js(),l=uu(),o=itt(),c="mapbox",s=et.constants=my();et.name=c,et.attr="subplot",et.idRoot=c,et.idRegex=et.attrRegex=f.counterRegex(c);var h=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");et.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},et.layoutAttributes=Rk(),et.supplyLayoutDefaults=att();var m=!0;et.plot=function(_){m&&(m=!1,f.warn(h));var A=_._fullLayout,d=_.calcdata,k=A._subplots[c];if(Y.version!==s.requiredVersion)throw new Error(s.wrongVersionErrorMsg);var w=b(_,k);Y.accessToken=w;for(var D=0;DW/2){var F=N.split("|").join("
");U.text(F).attr("data-unformatted",F).call(l.convertToTspans,_),V=a.bBox(U.node())}U.attr("transform",y(-3,-V.height+8)),B.insert("rect",".static-attribution").attr({x:-V.width-6,y:-V.height-3,width:V.width+6,height:V.height+3,fill:"rgba(255, 255, 255, 0.75)"});var H=1;V.width+6>W&&(H=W/(V.width+6));var q=[k.l+k.w*E.x[1],k.t+k.h*(1-E.y[0])];B.attr("transform",y(q[0],q[1])+z(H))}};function b(_,A){var d=_._fullLayout,k=_._context;if(k.mapboxAccessToken==="")return"";for(var w=[],D=[],E=!1,I=!1,M=0;M1&&f.warn(s.multipleTokensErrorMsg),w[0]):(D.length&&f.log(["Listed mapbox access token(s)",D.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function x(_){return typeof _=="string"&&(s.styleValuesMapbox.indexOf(_)!==-1||_.indexOf("mapbox://")===0||_.indexOf("stamen")===0)}et.updateFx=function(_){for(var A=_._fullLayout,d=A._subplots[c],k=0;k{Y.exports={attributes:yA(),supplyDefaults:JQ(),colorbar:Do(),formatLabels:_z(),calc:JC(),plot:ttt(),hoverPoints:_A().hoverPoints,eventData:ett(),selectPoints:rtt(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermapbox",basePlotModule:xA(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),stt=It((et,Y)=>{Y.exports=ott()}),wz=It((et,Y)=>{var f=Kw(),y=Ru(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=xa(),i=Yn().extendFlat;Y.exports=i({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:i({},f.featureidkey,{}),below:{valType:"string",editType:"plot"},text:f.text,hovertext:f.hovertext,marker:{line:{color:i({},f.marker.line.color,{editType:"plot"}),width:i({},f.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:i({},f.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:i({},f.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i({},f.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:f.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:i({},n.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),ltt=It((et,Y)=>{var f=jn(),y=Cu(),z=wz();Y.exports=function(P,n,i,a){function l(m,b){return f.coerce(P,n,z,m,b)}var o=l("locations"),c=l("z"),s=l("geojson");if(!f.isArrayOrTypedArray(o)||!o.length||!f.isArrayOrTypedArray(c)||!c.length||!(typeof s=="string"&&s!==""||f.isPlainObject(s))){n.visible=!1;return}l("featureidkey"),n._length=Math.min(o.length,c.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,n,a,l,{prefix:"",cLetter:"z"}),f.coerceSelectionMarkerOpacity(n,l)}}),kz=It((et,Y)=>{var f=Sr(),y=jn(),z=ch(),P=Js(),n=W_().makeBlank,i=q_();function a(o){var c=o[0].trace,s=c.visible===!0&&c._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=c._opts={fill:h,line:m,geojson:n()};if(!s)return b;var x=i.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(c),A=c.marker,d=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var S=C.mo;return f(S)?+y.constrain(S,0,1):0});var w;y.isArrayOrTypedArray(d.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(d.width)&&(D=function(C){return C.mlw});for(var E=0;E{var f=kz().convert,y=kz().convertOnSelect,z=my().traceLayerPrefix;function P(i,a){this.type="choroplethmapbox",this.subplot=i,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var n=P.prototype;n.update=function(i){this._update(f(i)),i[0].trace._glTrace=this},n.updateOnSelect=function(i){this._update(y(i))},n._update=function(i){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(i.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(i,o),this.below=o);for(var c=0;c=0;l--)i.removeLayer(a[l][1])},n.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,a){var l=a[0].trace,o=new P(i,l.uid),c=o.sourceId,s=f(a),h=o.below=i.belowLookup["trace-"+l.uid];return i.map.addSource(c,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),utt=It((et,Y)=>{Y.exports={attributes:wz(),supplyDefaults:ltt(),colorbar:z_(),calc:rA(),plot:ctt(),hoverPoints:iA(),eventData:aA(),selectPoints:oA(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(f,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var n=z[P].id;if(typeof n=="string"&&n.indexOf("water")===0){for(var i=P+1;i{Y.exports=utt()}),Tz=It((et,Y)=>{var f=Ru(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=xa(),n=yA(),i=Yn().extendFlat;Y.exports=i({lon:n.lon,lat:n.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,hoverinfo:i({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:i({},P.showlegend,{dflt:!1})},f("",{cLetter:"z",editTypeOverride:"calc"}))}),dtt=It((et,Y)=>{var f=jn(),y=Cu(),z=Tz();Y.exports=function(P,n,i,a){function l(h,m){return f.coerce(P,n,z,h,m)}var o=l("lon")||[],c=l("lat")||[],s=Math.min(o.length,c.length);if(!s){n.visible=!1;return}n._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,n,a,l,{prefix:"",cLetter:"z"})}}),ftt=It((et,Y)=>{var f=Sr(),y=jn().isArrayOrTypedArray,z=Dr().BADNUM,P=Cp(),n=jn()._;Y.exports=function(i,a){for(var l=a._length,o=new Array(l),c=a.z,s=y(c)&&c.length,h=0;h{var f=Sr(),y=jn(),z=Hn(),P=ch(),n=Dr().BADNUM,i=W_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,c={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:c,geojson:i()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var f=ptt(),y=my().traceLayerPrefix;function z(n,i){this.type="densitymapbox",this.subplot=n,this.uid=i,this.sourceId="source-"+i,this.layerList=[["heatmap",y+i+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(n){var i=this.subplot,a=this.layerList,l=f(n),o=i.belowLookup["trace-"+this.uid];i.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var c=0;c=0;a--)n.removeLayer(i[a][1])},P.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,i){var a=i[0].trace,l=new z(n,a.uid),o=l.sourceId,c=f(i),s=l.below=n.belowLookup["trace-"+a.uid];return n.map.addSource(o,{type:"geojson",data:c.geojson}),l._addLayers(c,s),l}}),gtt=It((et,Y)=>{var f=Fs(),y=_A().hoverPoints,z=_A().getExtraText;Y.exports=function(P,n,i){var a=y(P,n,i);if(a){var l=a[0],o=l.cd,c=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=f.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(c,s,o[0].t.labels),[l]}}}),vtt=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f.z=y.z,f}}),ytt=It((et,Y)=>{Y.exports={attributes:Tz(),supplyDefaults:dtt(),colorbar:z_(),formatLabels:_z(),calc:ftt(),plot:mtt(),hoverPoints:gtt(),eventData:vtt(),getBelow:function(f,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=ytt()}),xtt=It((et,Y)=>{Y.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +`),Ln=ke.createShader(ke.FRAGMENT_SHADER);if(ke.isContextLost()){this.failedToCreate=!0;return}ke.shaderSource(Ln,Hr),ke.compileShader(Ln),ke.attachShader(this.program,Ln);var Ii=ke.createShader(ke.VERTEX_SHADER);if(ke.isContextLost()){this.failedToCreate=!0;return}ke.shaderSource(Ii,wn),ke.compileShader(Ii),ke.attachShader(this.program,Ii),this.attributes={};var Mi={};this.numAttributes=De.length;for(var gi=0;gi>16,Jt>>16],u_pixel_coord_lower:[ke&65535,Jt&65535]}}function Dd(Z,lt,nt,wt){var Wt=nt.imageManager.getPattern(Z.from.toString()),ve=nt.imageManager.getPattern(Z.to.toString()),ke=nt.imageManager.getPixelSize(),Jt=ke.width,fe=ke.height,De=Math.pow(2,wt.tileID.overscaledZ),lr=wt.tileSize*Math.pow(2,nt.transform.tileZoom)/De,tr=lr*(wt.tileID.canonical.x+wt.tileID.wrap*De),ar=lr*wt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Wt.tl,u_pattern_br_a:Wt.br,u_pattern_tl_b:ve.tl,u_pattern_br_b:ve.br,u_texsize:[Jt,fe],u_mix:lt.t,u_pattern_size_a:Wt.displaySize,u_pattern_size_b:ve.displaySize,u_scale_a:lt.fromScale,u_scale_b:lt.toScale,u_tile_units_to_pixels:1/ul(wt,1,nt.transform.tileZoom),u_pixel_coord_upper:[tr>>16,ar>>16],u_pixel_coord_lower:[tr&65535,ar&65535]}}var tp=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_lightpos:new n.Uniform3f(Z,lt.u_lightpos),u_lightintensity:new n.Uniform1f(Z,lt.u_lightintensity),u_lightcolor:new n.Uniform3f(Z,lt.u_lightcolor),u_vertical_gradient:new n.Uniform1f(Z,lt.u_vertical_gradient),u_opacity:new n.Uniform1f(Z,lt.u_opacity)}},Au=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_lightpos:new n.Uniform3f(Z,lt.u_lightpos),u_lightintensity:new n.Uniform1f(Z,lt.u_lightintensity),u_lightcolor:new n.Uniform3f(Z,lt.u_lightcolor),u_vertical_gradient:new n.Uniform1f(Z,lt.u_vertical_gradient),u_height_factor:new n.Uniform1f(Z,lt.u_height_factor),u_image:new n.Uniform1i(Z,lt.u_image),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade),u_opacity:new n.Uniform1f(Z,lt.u_opacity)}},gf=function(Z,lt,nt,wt){var Wt=lt.style.light,ve=Wt.properties.get("position"),ke=[ve.x,ve.y,ve.z],Jt=n.create$1();Wt.properties.get("anchor")==="viewport"&&n.fromRotation(Jt,-lt.transform.angle),n.transformMat3(ke,ke,Jt);var fe=Wt.properties.get("color");return{u_matrix:Z,u_lightpos:ke,u_lightintensity:Wt.properties.get("intensity"),u_lightcolor:[fe.r,fe.g,fe.b],u_vertical_gradient:+nt,u_opacity:wt}},fh=function(Z,lt,nt,wt,Wt,ve,ke){return n.extend(gf(Z,lt,nt,wt),ad(ve,lt,ke),{u_height_factor:-Math.pow(2,Wt.overscaledZ)/ke.tileSize/8})},Vh=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},Ph=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_image:new n.Uniform1i(Z,lt.u_image),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade)}},Zc=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_world:new n.Uniform2f(Z,lt.u_world)}},fc=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_world:new n.Uniform2f(Z,lt.u_world),u_image:new n.Uniform1i(Z,lt.u_image),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade)}},Ih=function(Z){return{u_matrix:Z}},Td=function(Z,lt,nt,wt){return n.extend(Ih(Z),ad(nt,lt,wt))},Dh=function(Z,lt){return{u_matrix:Z,u_world:lt}},sf=function(Z,lt,nt,wt,Wt){return n.extend(Td(Z,lt,nt,wt),{u_world:Wt})},br=function(Z,lt){return{u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_scale_with_map:new n.Uniform1i(Z,lt.u_scale_with_map),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_extrude_scale:new n.Uniform2f(Z,lt.u_extrude_scale),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},Qr=function(Z,lt,nt,wt){var Wt=Z.transform,ve,ke;if(wt.paint.get("circle-pitch-alignment")==="map"){var Jt=ul(nt,1,Wt.zoom);ve=!0,ke=[Jt,Jt]}else ve=!1,ke=Wt.pixelsToGLUnits;return{u_camera_to_center_distance:Wt.cameraToCenterDistance,u_scale_with_map:+(wt.paint.get("circle-pitch-scale")==="map"),u_matrix:Z.translatePosMatrix(lt.posMatrix,nt,wt.paint.get("circle-translate"),wt.paint.get("circle-translate-anchor")),u_pitch_with_map:+ve,u_device_pixel_ratio:n.browser.devicePixelRatio,u_extrude_scale:ke}},Nn=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pixels_to_tile_units:new n.Uniform1f(Z,lt.u_pixels_to_tile_units),u_extrude_scale:new n.Uniform2f(Z,lt.u_extrude_scale),u_overscale_factor:new n.Uniform1f(Z,lt.u_overscale_factor)}},An=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_inv_matrix:new n.UniformMatrix4f(Z,lt.u_inv_matrix),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_viewport_size:new n.Uniform2f(Z,lt.u_viewport_size)}},di=function(Z,lt,nt){var wt=ul(nt,1,lt.zoom),Wt=Math.pow(2,lt.zoom-nt.tileID.overscaledZ),ve=nt.tileID.overscaleFactor();return{u_matrix:Z,u_camera_to_center_distance:lt.cameraToCenterDistance,u_pixels_to_tile_units:wt,u_extrude_scale:[lt.pixelsToGLUnits[0]/(wt*Wt),lt.pixelsToGLUnits[1]/(wt*Wt)],u_overscale_factor:ve}},Pi=function(Z,lt,nt){return{u_matrix:Z,u_inv_matrix:lt,u_camera_to_center_distance:nt.cameraToCenterDistance,u_viewport_size:[nt.width,nt.height]}},ga=function(Z,lt){return{u_color:new n.UniformColor(Z,lt.u_color),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_overlay:new n.Uniform1i(Z,lt.u_overlay),u_overlay_scale:new n.Uniform1f(Z,lt.u_overlay_scale)}},Pa=function(Z,lt,nt){return nt===void 0&&(nt=1),{u_matrix:Z,u_color:lt,u_overlay:0,u_overlay_scale:nt}},Qa=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},uo=function(Z){return{u_matrix:Z}},Sa=function(Z,lt){return{u_extrude_scale:new n.Uniform1f(Z,lt.u_extrude_scale),u_intensity:new n.Uniform1f(Z,lt.u_intensity),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix)}},Za=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_world:new n.Uniform2f(Z,lt.u_world),u_image:new n.Uniform1i(Z,lt.u_image),u_color_ramp:new n.Uniform1i(Z,lt.u_color_ramp),u_opacity:new n.Uniform1f(Z,lt.u_opacity)}},Ra=function(Z,lt,nt,wt){return{u_matrix:Z,u_extrude_scale:ul(lt,1,nt),u_intensity:wt}},pa=function(Z,lt,nt,wt){var Wt=n.create();n.ortho(Wt,0,Z.width,Z.height,0,0,1);var ve=Z.context.gl;return{u_matrix:Wt,u_world:[ve.drawingBufferWidth,ve.drawingBufferHeight],u_image:nt,u_color_ramp:wt,u_opacity:lt.paint.get("heatmap-opacity")}},_o=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_image:new n.Uniform1i(Z,lt.u_image),u_latrange:new n.Uniform2f(Z,lt.u_latrange),u_light:new n.Uniform2f(Z,lt.u_light),u_shadow:new n.UniformColor(Z,lt.u_shadow),u_highlight:new n.UniformColor(Z,lt.u_highlight),u_accent:new n.UniformColor(Z,lt.u_accent)}},fs=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_image:new n.Uniform1i(Z,lt.u_image),u_dimension:new n.Uniform2f(Z,lt.u_dimension),u_zoom:new n.Uniform1f(Z,lt.u_zoom),u_unpack:new n.Uniform4f(Z,lt.u_unpack)}},os=function(Z,lt,nt){var wt=nt.paint.get("hillshade-shadow-color"),Wt=nt.paint.get("hillshade-highlight-color"),ve=nt.paint.get("hillshade-accent-color"),ke=nt.paint.get("hillshade-illumination-direction")*(Math.PI/180);nt.paint.get("hillshade-illumination-anchor")==="viewport"&&(ke-=Z.transform.angle);var Jt=!Z.options.moving;return{u_matrix:Z.transform.calculatePosMatrix(lt.tileID.toUnwrapped(),Jt),u_image:0,u_latrange:ws(Z,lt.tileID),u_light:[nt.paint.get("hillshade-exaggeration"),ke],u_shadow:wt,u_highlight:Wt,u_accent:ve}},gs=function(Z,lt){var nt=lt.stride,wt=n.create();return n.ortho(wt,0,n.EXTENT,-n.EXTENT,0,0,1),n.translate(wt,wt,[0,-n.EXTENT,0]),{u_matrix:wt,u_image:1,u_dimension:[nt,nt],u_zoom:Z.overscaledZ,u_unpack:lt.getUnpackVector()}};function ws(Z,lt){var nt=Math.pow(2,lt.canonical.z),wt=lt.canonical.y;return[new n.MercatorCoordinate(0,wt/nt).toLngLat().lat,new n.MercatorCoordinate(0,(wt+1)/nt).toLngLat().lat]}var bo=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels)}},lo=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels),u_image:new n.Uniform1i(Z,lt.u_image),u_image_height:new n.Uniform1f(Z,lt.u_image_height)}},ks=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_image:new n.Uniform1i(Z,lt.u_image),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels),u_scale:new n.Uniform3f(Z,lt.u_scale),u_fade:new n.Uniform1f(Z,lt.u_fade)}},dl=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_ratio:new n.Uniform1f(Z,lt.u_ratio),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_units_to_pixels:new n.Uniform2f(Z,lt.u_units_to_pixels),u_patternscale_a:new n.Uniform2f(Z,lt.u_patternscale_a),u_patternscale_b:new n.Uniform2f(Z,lt.u_patternscale_b),u_sdfgamma:new n.Uniform1f(Z,lt.u_sdfgamma),u_image:new n.Uniform1i(Z,lt.u_image),u_tex_y_a:new n.Uniform1f(Z,lt.u_tex_y_a),u_tex_y_b:new n.Uniform1f(Z,lt.u_tex_y_b),u_mix:new n.Uniform1f(Z,lt.u_mix)}},Vl=function(Z,lt,nt){var wt=Z.transform;return{u_matrix:tu(Z,lt,nt),u_ratio:1/ul(lt,1,wt.zoom),u_device_pixel_ratio:n.browser.devicePixelRatio,u_units_to_pixels:[1/wt.pixelsToGLUnits[0],1/wt.pixelsToGLUnits[1]]}},gc=function(Z,lt,nt,wt){return n.extend(Vl(Z,lt,nt),{u_image:0,u_image_height:wt})},ec=function(Z,lt,nt,wt){var Wt=Z.transform,ve=El(lt,Wt);return{u_matrix:tu(Z,lt,nt),u_texsize:lt.imageAtlasTexture.size,u_ratio:1/ul(lt,1,Wt.zoom),u_device_pixel_ratio:n.browser.devicePixelRatio,u_image:0,u_scale:[ve,wt.fromScale,wt.toScale],u_fade:wt.t,u_units_to_pixels:[1/Wt.pixelsToGLUnits[0],1/Wt.pixelsToGLUnits[1]]}},vc=function(Z,lt,nt,wt,Wt){var ve=Z.transform,ke=Z.lineAtlas,Jt=El(lt,ve),fe=nt.layout.get("line-cap")==="round",De=ke.getDash(wt.from,fe),lr=ke.getDash(wt.to,fe),tr=De.width*Wt.fromScale,ar=lr.width*Wt.toScale;return n.extend(Vl(Z,lt,nt),{u_patternscale_a:[Jt/tr,-De.height/2],u_patternscale_b:[Jt/ar,-lr.height/2],u_sdfgamma:ke.width/(Math.min(tr,ar)*256*n.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:De.y,u_tex_y_b:lr.y,u_mix:Wt.t})};function El(Z,lt){return 1/ul(Z,1,lt.tileZoom)}function tu(Z,lt,nt){return Z.translatePosMatrix(lt.tileID.posMatrix,lt,nt.paint.get("line-translate"),nt.paint.get("line-translate-anchor"))}var $c=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_tl_parent:new n.Uniform2f(Z,lt.u_tl_parent),u_scale_parent:new n.Uniform1f(Z,lt.u_scale_parent),u_buffer_scale:new n.Uniform1f(Z,lt.u_buffer_scale),u_fade_t:new n.Uniform1f(Z,lt.u_fade_t),u_opacity:new n.Uniform1f(Z,lt.u_opacity),u_image0:new n.Uniform1i(Z,lt.u_image0),u_image1:new n.Uniform1i(Z,lt.u_image1),u_brightness_low:new n.Uniform1f(Z,lt.u_brightness_low),u_brightness_high:new n.Uniform1f(Z,lt.u_brightness_high),u_saturation_factor:new n.Uniform1f(Z,lt.u_saturation_factor),u_contrast_factor:new n.Uniform1f(Z,lt.u_contrast_factor),u_spin_weights:new n.Uniform3f(Z,lt.u_spin_weights)}},bc=function(Z,lt,nt,wt,Wt){return{u_matrix:Z,u_tl_parent:lt,u_scale_parent:nt,u_buffer_scale:1,u_fade_t:wt.mix,u_opacity:wt.opacity*Wt.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Wt.paint.get("raster-brightness-min"),u_brightness_high:Wt.paint.get("raster-brightness-max"),u_saturation_factor:ac(Wt.paint.get("raster-saturation")),u_contrast_factor:Bs(Wt.paint.get("raster-contrast")),u_spin_weights:qo(Wt.paint.get("raster-hue-rotate"))}};function qo(Z){Z*=Math.PI/180;var lt=Math.sin(Z),nt=Math.cos(Z);return[(2*nt+1)/3,(-Math.sqrt(3)*lt-nt+1)/3,(Math.sqrt(3)*lt-nt+1)/3]}function Bs(Z){return Z>0?1/(1-Z):1+Z}function ac(Z){return Z>0?1-1/(1.001-Z):-Z}var Zl=function(Z,lt){return{u_is_size_zoom_constant:new n.Uniform1i(Z,lt.u_is_size_zoom_constant),u_is_size_feature_constant:new n.Uniform1i(Z,lt.u_is_size_feature_constant),u_size_t:new n.Uniform1f(Z,lt.u_size_t),u_size:new n.Uniform1f(Z,lt.u_size),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pitch:new n.Uniform1f(Z,lt.u_pitch),u_rotate_symbol:new n.Uniform1i(Z,lt.u_rotate_symbol),u_aspect_ratio:new n.Uniform1f(Z,lt.u_aspect_ratio),u_fade_change:new n.Uniform1f(Z,lt.u_fade_change),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_label_plane_matrix:new n.UniformMatrix4f(Z,lt.u_label_plane_matrix),u_coord_matrix:new n.UniformMatrix4f(Z,lt.u_coord_matrix),u_is_text:new n.Uniform1i(Z,lt.u_is_text),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_texture:new n.Uniform1i(Z,lt.u_texture)}},Mu=function(Z,lt){return{u_is_size_zoom_constant:new n.Uniform1i(Z,lt.u_is_size_zoom_constant),u_is_size_feature_constant:new n.Uniform1i(Z,lt.u_is_size_feature_constant),u_size_t:new n.Uniform1f(Z,lt.u_size_t),u_size:new n.Uniform1f(Z,lt.u_size),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pitch:new n.Uniform1f(Z,lt.u_pitch),u_rotate_symbol:new n.Uniform1i(Z,lt.u_rotate_symbol),u_aspect_ratio:new n.Uniform1f(Z,lt.u_aspect_ratio),u_fade_change:new n.Uniform1f(Z,lt.u_fade_change),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_label_plane_matrix:new n.UniformMatrix4f(Z,lt.u_label_plane_matrix),u_coord_matrix:new n.UniformMatrix4f(Z,lt.u_coord_matrix),u_is_text:new n.Uniform1i(Z,lt.u_is_text),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_texture:new n.Uniform1i(Z,lt.u_texture),u_gamma_scale:new n.Uniform1f(Z,lt.u_gamma_scale),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_is_halo:new n.Uniform1i(Z,lt.u_is_halo)}},eh=function(Z,lt){return{u_is_size_zoom_constant:new n.Uniform1i(Z,lt.u_is_size_zoom_constant),u_is_size_feature_constant:new n.Uniform1i(Z,lt.u_is_size_feature_constant),u_size_t:new n.Uniform1f(Z,lt.u_size_t),u_size:new n.Uniform1f(Z,lt.u_size),u_camera_to_center_distance:new n.Uniform1f(Z,lt.u_camera_to_center_distance),u_pitch:new n.Uniform1f(Z,lt.u_pitch),u_rotate_symbol:new n.Uniform1i(Z,lt.u_rotate_symbol),u_aspect_ratio:new n.Uniform1f(Z,lt.u_aspect_ratio),u_fade_change:new n.Uniform1f(Z,lt.u_fade_change),u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_label_plane_matrix:new n.UniformMatrix4f(Z,lt.u_label_plane_matrix),u_coord_matrix:new n.UniformMatrix4f(Z,lt.u_coord_matrix),u_is_text:new n.Uniform1i(Z,lt.u_is_text),u_pitch_with_map:new n.Uniform1i(Z,lt.u_pitch_with_map),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_texsize_icon:new n.Uniform2f(Z,lt.u_texsize_icon),u_texture:new n.Uniform1i(Z,lt.u_texture),u_texture_icon:new n.Uniform1i(Z,lt.u_texture_icon),u_gamma_scale:new n.Uniform1f(Z,lt.u_gamma_scale),u_device_pixel_ratio:new n.Uniform1f(Z,lt.u_device_pixel_ratio),u_is_halo:new n.Uniform1i(Z,lt.u_is_halo)}},Vu=function(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De){var lr=Wt.transform;return{u_is_size_zoom_constant:+(Z==="constant"||Z==="source"),u_is_size_feature_constant:+(Z==="constant"||Z==="camera"),u_size_t:lt?lt.uSizeT:0,u_size:lt?lt.uSize:0,u_camera_to_center_distance:lr.cameraToCenterDistance,u_pitch:lr.pitch/360*2*Math.PI,u_rotate_symbol:+nt,u_aspect_ratio:lr.width/lr.height,u_fade_change:Wt.options.fadeDuration?Wt.symbolFadeChange:1,u_matrix:ve,u_label_plane_matrix:ke,u_coord_matrix:Jt,u_is_text:+fe,u_pitch_with_map:+wt,u_texsize:De,u_texture:0}},Wh=function(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De,lr){var tr=Wt.transform;return n.extend(Vu(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De),{u_gamma_scale:wt?Math.cos(tr._pitch)*tr.cameraToCenterDistance:1,u_device_pixel_ratio:n.browser.devicePixelRatio,u_is_halo:1})},rh=function(Z,lt,nt,wt,Wt,ve,ke,Jt,fe,De){return n.extend(Wh(Z,lt,nt,wt,Wt,ve,ke,Jt,!0,fe),{u_texsize_icon:De,u_texture_icon:1})},qh=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_opacity:new n.Uniform1f(Z,lt.u_opacity),u_color:new n.UniformColor(Z,lt.u_color)}},Wc=function(Z,lt){return{u_matrix:new n.UniformMatrix4f(Z,lt.u_matrix),u_opacity:new n.Uniform1f(Z,lt.u_opacity),u_image:new n.Uniform1i(Z,lt.u_image),u_pattern_tl_a:new n.Uniform2f(Z,lt.u_pattern_tl_a),u_pattern_br_a:new n.Uniform2f(Z,lt.u_pattern_br_a),u_pattern_tl_b:new n.Uniform2f(Z,lt.u_pattern_tl_b),u_pattern_br_b:new n.Uniform2f(Z,lt.u_pattern_br_b),u_texsize:new n.Uniform2f(Z,lt.u_texsize),u_mix:new n.Uniform1f(Z,lt.u_mix),u_pattern_size_a:new n.Uniform2f(Z,lt.u_pattern_size_a),u_pattern_size_b:new n.Uniform2f(Z,lt.u_pattern_size_b),u_scale_a:new n.Uniform1f(Z,lt.u_scale_a),u_scale_b:new n.Uniform1f(Z,lt.u_scale_b),u_pixel_coord_upper:new n.Uniform2f(Z,lt.u_pixel_coord_upper),u_pixel_coord_lower:new n.Uniform2f(Z,lt.u_pixel_coord_lower),u_tile_units_to_pixels:new n.Uniform1f(Z,lt.u_tile_units_to_pixels)}},Gh=function(Z,lt,nt){return{u_matrix:Z,u_opacity:lt,u_color:nt}},ds=function(Z,lt,nt,wt,Wt,ve){return n.extend(Dd(wt,ve,nt,Wt),{u_matrix:Z,u_opacity:lt})},$s={fillExtrusion:tp,fillExtrusionPattern:Au,fill:Vh,fillPattern:Ph,fillOutline:Zc,fillOutlinePattern:fc,circle:br,collisionBox:Nn,collisionCircle:An,debug:ga,clippingMask:Qa,heatmap:Sa,heatmapTexture:Za,hillshade:_o,hillshadePrepare:fs,line:bo,lineGradient:lo,linePattern:ks,lineSDF:dl,raster:$c,symbolIcon:Zl,symbolSDF:Mu,symbolTextAndIcon:eh,background:qh,backgroundPattern:Wc},nh;function eu(Z,lt,nt,wt,Wt,ve,ke){for(var Jt=Z.context,fe=Jt.gl,De=Z.useProgram("collisionBox"),lr=[],tr=0,ar=0,dr=0;dr0){var Ln=n.create(),Ii=Je;n.mul(Ln,rr.placementInvProjMatrix,Z.transform.glCoordMatrix),n.mul(Ln,Ln,rr.placementViewportMatrix),lr.push({circleArray:wn,circleOffset:ar,transform:Ii,invTransform:Ln}),tr+=wn.length/4,ar=tr}Hr&&De.draw(Jt,fe.LINES,yi.disabled,fi.disabled,Z.colorModeForRenderPass(),mn.disabled,di(Je,Z.transform,Ge),nt.id,Hr.layoutVertexBuffer,Hr.indexBuffer,Hr.segments,null,Z.transform.zoom,null,null,Hr.collisionVertexBuffer)}}if(!(!ke||!lr.length)){var Mi=Z.useProgram("collisionCircle"),gi=new n.StructArrayLayout2f1f2i16;gi.resize(tr*4),gi._trim();for(var Vi=0,Di=0,da=lr;Di=0&&(gr[rr.associatedIconIndex]={shiftedAnchor:wa,angle:vo})}}if(lr){dr.clear();for(var ns=Z.icon.placedSymbolArray,As=0;As0){var ke=n.browser.now(),Jt=(ke-Z.timeAdded)/ve,fe=lt?(ke-lt.timeAdded)/ve:-1,De=nt.getSource(),lr=Wt.coveringZoomLevel({tileSize:De.tileSize,roundZoom:De.roundZoom}),tr=!lt||Math.abs(lt.tileID.overscaledZ-lr)>Math.abs(Z.tileID.overscaledZ-lr),ar=tr&&Z.refreshedUponExpiration?1:n.clamp(tr?Jt:1-fe,0,1);return Z.refreshedUponExpiration&&Jt>=1&&(Z.refreshedUponExpiration=!1),lt?{opacity:1,mix:1-ar}:{opacity:ar,mix:0}}else return{opacity:1,mix:0}}function Xr(Z,lt,nt){var wt=nt.paint.get("background-color"),Wt=nt.paint.get("background-opacity");if(Wt!==0){var ve=Z.context,ke=ve.gl,Jt=Z.transform,fe=Jt.tileSize,De=nt.paint.get("background-pattern");if(!Z.isPatternMissing(De)){var lr=!De&&wt.a===1&&Wt===1&&Z.opaquePassEnabledForLayer()?"opaque":"translucent";if(Z.renderPass===lr){var tr=fi.disabled,ar=Z.depthModeForSublayer(0,lr==="opaque"?yi.ReadWrite:yi.ReadOnly),dr=Z.colorModeForRenderPass(),gr=Z.useProgram(De?"backgroundPattern":"background"),Ge=Jt.coveringTiles({tileSize:fe});De&&(ve.activeTexture.set(ke.TEXTURE0),Z.imageManager.bind(Z.context));for(var rr=nt.getCrossfadeParameters(),Je=0,Hr=Ge;Je "+nt.overscaledZ);var Je=rr+" "+dr+"kb";xs(Z,Je),ke.draw(wt,Wt.TRIANGLES,Jt,fe,sr.alphaBlended,mn.disabled,Pa(ve,n.Color.transparent,Ge),lr,Z.debugBuffer,Z.quadTriangleIndexBuffer,Z.debugSegments)}function xs(Z,lt){Z.initDebugOverlayCanvas();var nt=Z.debugOverlayCanvas,wt=Z.context.gl,Wt=Z.debugOverlayCanvas.getContext("2d");Wt.clearRect(0,0,nt.width,nt.height),Wt.shadowColor="white",Wt.shadowBlur=2,Wt.lineWidth=1.5,Wt.strokeStyle="white",Wt.textBaseline="top",Wt.font="bold 36px Open Sans, sans-serif",Wt.fillText(lt,5,5),Wt.strokeText(lt,5,5),Z.debugOverlayTexture.update(nt),Z.debugOverlayTexture.bind(wt.LINEAR,wt.CLAMP_TO_EDGE)}function Sl(Z,lt,nt){var wt=Z.context,Wt=nt.implementation;if(Z.renderPass==="offscreen"){var ve=Wt.prerender;ve&&(Z.setCustomLayerDefaults(),wt.setColorMode(Z.colorModeForRenderPass()),ve.call(Wt,wt.gl,Z.transform.customLayerMatrix()),wt.setDirty(),Z.setBaseState())}else if(Z.renderPass==="translucent"){Z.setCustomLayerDefaults(),wt.setColorMode(Z.colorModeForRenderPass()),wt.setStencilMode(fi.disabled);var ke=Wt.renderingMode==="3d"?new yi(Z.context.gl.LEQUAL,yi.ReadWrite,Z.depthRangeFor3D):Z.depthModeForSublayer(0,yi.ReadOnly);wt.setDepthMode(ke),Wt.render(wt.gl,Z.transform.customLayerMatrix()),wt.setDirty(),Z.setBaseState(),wt.bindFramebuffer.set(null)}}var Ll={symbol:O,circle:er,heatmap:wr,line:qn,fill:te,"fill-extrusion":Te,hillshade:We,raster:Pr,background:Xr,debug:Yo,custom:Sl},Ws=function(Z,lt){this.context=new Zn(Z),this.transform=lt,this._tileTextures={},this.setup(),this.numSublayers=Un.maxUnderzooming+Un.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new iu,this.gpuTimers={}};Ws.prototype.resize=function(Z,lt){if(this.width=Z*n.browser.devicePixelRatio,this.height=lt*n.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var nt=0,wt=this.style._order;nt256&&this.clearStencil(),nt.setColorMode(sr.disabled),nt.setDepthMode(yi.disabled);var Wt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var ve=0,ke=lt;ve256&&this.clearStencil();var Z=this.nextStencilID++,lt=this.context.gl;return new fi({func:lt.NOTEQUAL,mask:255},Z,255,lt.KEEP,lt.KEEP,lt.REPLACE)},Ws.prototype.stencilModeForClipping=function(Z){var lt=this.context.gl;return new fi({func:lt.EQUAL,mask:255},this._tileClippingMaskIDs[Z.key],0,lt.KEEP,lt.KEEP,lt.REPLACE)},Ws.prototype.stencilConfigForOverlap=function(Z){var lt,nt=this.context.gl,wt=Z.sort(function(fe,De){return De.overscaledZ-fe.overscaledZ}),Wt=wt[wt.length-1].overscaledZ,ve=wt[0].overscaledZ-Wt+1;if(ve>1){this.currentStencilSource=void 0,this.nextStencilID+ve>256&&this.clearStencil();for(var ke={},Jt=0;Jt=0;this.currentLayer--){var wn=this.style._layers[wt[this.currentLayer]],Ln=Wt[wn.source],Ii=Jt[wn.source];this._renderTileClippingMasks(wn,Ii),this.renderLayer(this,Ln,wn,Ii)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?lt.pop():null},Ws.prototype.isPatternMissing=function(Z){if(!Z)return!1;if(!Z.from||!Z.to)return!0;var lt=this.imageManager.getPattern(Z.from.toString()),nt=this.imageManager.getPattern(Z.to.toString());return!lt||!nt},Ws.prototype.useProgram=function(Z,lt){this.cache=this.cache||{};var nt=""+Z+(lt?lt.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[nt]||(this.cache[nt]=new pd(this.context,Z,Id[Z],lt,$s[Z],this._showOverdrawInspector)),this.cache[nt]},Ws.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Ws.prototype.setBaseState=function(){var Z=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(Z.FUNC_ADD)},Ws.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=n.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var Z=this.context.gl;this.debugOverlayTexture=new n.Texture(this.context,this.debugOverlayCanvas,Z.RGBA)}},Ws.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var zl=function(Z,lt){this.points=Z,this.planes=lt};zl.fromInvProjectionMatrix=function(Z,lt,nt){var wt=[[-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]],Wt=Math.pow(2,nt),ve=wt.map(function(fe){return n.transformMat4([],fe,Z)}).map(function(fe){return n.scale$1([],fe,1/fe[3]/lt*Wt)}),ke=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Jt=ke.map(function(fe){var De=n.sub([],ve[fe[0]],ve[fe[1]]),lr=n.sub([],ve[fe[2]],ve[fe[1]]),tr=n.normalize([],n.cross([],De,lr)),ar=-n.dot(tr,ve[fe[1]]);return tr.concat(ar)});return new zl(ve,Jt)};var Fc=function(Z,lt){this.min=Z,this.max=lt,this.center=n.scale$2([],n.add([],this.min,this.max),.5)};Fc.prototype.quadrant=function(Z){for(var lt=[Z%2===0,Z<2],nt=n.clone$2(this.min),wt=n.clone$2(this.max),Wt=0;Wt=0;if(ve===0)return 0;ve!==lt.length&&(nt=!1)}if(nt)return 2;for(var Jt=0;Jt<3;Jt++){for(var fe=Number.MAX_VALUE,De=-Number.MAX_VALUE,lr=0;lrthis.max[Jt]-this.min[Jt])return 0}return 1};var Sc=function(Z,lt,nt,wt){if(Z===void 0&&(Z=0),lt===void 0&&(lt=0),nt===void 0&&(nt=0),wt===void 0&&(wt=0),isNaN(Z)||Z<0||isNaN(lt)||lt<0||isNaN(nt)||nt<0||isNaN(wt)||wt<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=Z,this.bottom=lt,this.left=nt,this.right=wt};Sc.prototype.interpolate=function(Z,lt,nt){return lt.top!=null&&Z.top!=null&&(this.top=n.number(Z.top,lt.top,nt)),lt.bottom!=null&&Z.bottom!=null&&(this.bottom=n.number(Z.bottom,lt.bottom,nt)),lt.left!=null&&Z.left!=null&&(this.left=n.number(Z.left,lt.left,nt)),lt.right!=null&&Z.right!=null&&(this.right=n.number(Z.right,lt.right,nt)),this},Sc.prototype.getCenter=function(Z,lt){var nt=n.clamp((this.left+Z-this.right)/2,0,Z),wt=n.clamp((this.top+lt-this.bottom)/2,0,lt);return new n.Point(nt,wt)},Sc.prototype.equals=function(Z){return this.top===Z.top&&this.bottom===Z.bottom&&this.left===Z.left&&this.right===Z.right},Sc.prototype.clone=function(){return new Sc(this.top,this.bottom,this.left,this.right)},Sc.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var rl=function(Z,lt,nt,wt,Wt){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Wt===void 0?!0:Wt,this._minZoom=Z||0,this._maxZoom=lt||22,this._minPitch=nt??0,this._maxPitch=wt??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new n.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Sc,this._posMatrixCache={},this._alignedPosMatrixCache={}},nl={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};rl.prototype.clone=function(){var Z=new rl(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return Z.tileSize=this.tileSize,Z.latRange=this.latRange,Z.width=this.width,Z.height=this.height,Z._center=this._center,Z.zoom=this.zoom,Z.angle=this.angle,Z._fov=this._fov,Z._pitch=this._pitch,Z._unmodified=this._unmodified,Z._edgeInsets=this._edgeInsets.clone(),Z._calcMatrices(),Z},nl.minZoom.get=function(){return this._minZoom},nl.minZoom.set=function(Z){this._minZoom!==Z&&(this._minZoom=Z,this.zoom=Math.max(this.zoom,Z))},nl.maxZoom.get=function(){return this._maxZoom},nl.maxZoom.set=function(Z){this._maxZoom!==Z&&(this._maxZoom=Z,this.zoom=Math.min(this.zoom,Z))},nl.minPitch.get=function(){return this._minPitch},nl.minPitch.set=function(Z){this._minPitch!==Z&&(this._minPitch=Z,this.pitch=Math.max(this.pitch,Z))},nl.maxPitch.get=function(){return this._maxPitch},nl.maxPitch.set=function(Z){this._maxPitch!==Z&&(this._maxPitch=Z,this.pitch=Math.min(this.pitch,Z))},nl.renderWorldCopies.get=function(){return this._renderWorldCopies},nl.renderWorldCopies.set=function(Z){Z===void 0?Z=!0:Z===null&&(Z=!1),this._renderWorldCopies=Z},nl.worldSize.get=function(){return this.tileSize*this.scale},nl.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},nl.size.get=function(){return new n.Point(this.width,this.height)},nl.bearing.get=function(){return-this.angle/Math.PI*180},nl.bearing.set=function(Z){var lt=-n.wrap(Z,-180,180)*Math.PI/180;this.angle!==lt&&(this._unmodified=!1,this.angle=lt,this._calcMatrices(),this.rotationMatrix=n.create$2(),n.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},nl.pitch.get=function(){return this._pitch/Math.PI*180},nl.pitch.set=function(Z){var lt=n.clamp(Z,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==lt&&(this._unmodified=!1,this._pitch=lt,this._calcMatrices())},nl.fov.get=function(){return this._fov/Math.PI*180},nl.fov.set=function(Z){Z=Math.max(.01,Math.min(60,Z)),this._fov!==Z&&(this._unmodified=!1,this._fov=Z/180*Math.PI,this._calcMatrices())},nl.zoom.get=function(){return this._zoom},nl.zoom.set=function(Z){var lt=Math.min(Math.max(Z,this.minZoom),this.maxZoom);this._zoom!==lt&&(this._unmodified=!1,this._zoom=lt,this.scale=this.zoomScale(lt),this.tileZoom=Math.floor(lt),this.zoomFraction=lt-this.tileZoom,this._constrain(),this._calcMatrices())},nl.center.get=function(){return this._center},nl.center.set=function(Z){Z.lat===this._center.lat&&Z.lng===this._center.lng||(this._unmodified=!1,this._center=Z,this._constrain(),this._calcMatrices())},nl.padding.get=function(){return this._edgeInsets.toJSON()},nl.padding.set=function(Z){this._edgeInsets.equals(Z)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,Z,1),this._calcMatrices())},nl.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},rl.prototype.isPaddingEqual=function(Z){return this._edgeInsets.equals(Z)},rl.prototype.interpolatePadding=function(Z,lt,nt){this._unmodified=!1,this._edgeInsets.interpolate(Z,lt,nt),this._constrain(),this._calcMatrices()},rl.prototype.coveringZoomLevel=function(Z){var lt=(Z.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/Z.tileSize));return Math.max(0,lt)},rl.prototype.getVisibleUnwrappedCoordinates=function(Z){var lt=[new n.UnwrappedTileID(0,Z)];if(this._renderWorldCopies)for(var nt=this.pointCoordinate(new n.Point(0,0)),wt=this.pointCoordinate(new n.Point(this.width,0)),Wt=this.pointCoordinate(new n.Point(this.width,this.height)),ve=this.pointCoordinate(new n.Point(0,this.height)),ke=Math.floor(Math.min(nt.x,wt.x,Wt.x,ve.x)),Jt=Math.floor(Math.max(nt.x,wt.x,Wt.x,ve.x)),fe=1,De=ke-fe;De<=Jt+fe;De++)De!==0&<.push(new n.UnwrappedTileID(De,Z));return lt},rl.prototype.coveringTiles=function(Z){var lt=this.coveringZoomLevel(Z),nt=lt;if(Z.minzoom!==void 0&<Z.maxzoom&&(lt=Z.maxzoom);var wt=n.MercatorCoordinate.fromLngLat(this.center),Wt=Math.pow(2,lt),ve=[Wt*wt.x,Wt*wt.y,0],ke=zl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,lt),Jt=Z.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Jt=lt);var fe=3,De=function(Hi){return{aabb:new Fc([Hi*Wt,0,0],[(Hi+1)*Wt,Wt,0]),zoom:0,x:0,y:0,wrap:Hi,fullyVisible:!1}},lr=[],tr=[],ar=lt,dr=Z.reparseOverscaled?nt:lt;if(this._renderWorldCopies)for(var gr=1;gr<=3;gr++)lr.push(De(-gr)),lr.push(De(gr));for(lr.push(De(0));lr.length>0;){var Ge=lr.pop(),rr=Ge.x,Je=Ge.y,Hr=Ge.fullyVisible;if(!Hr){var wn=Ge.aabb.intersects(ke);if(wn===0)continue;Hr=wn===2}var Ln=Ge.aabb.distanceX(ve),Ii=Ge.aabb.distanceY(ve),Mi=Math.max(Math.abs(Ln),Math.abs(Ii)),gi=fe+(1<gi&&Ge.zoom>=Jt){tr.push({tileID:new n.OverscaledTileID(Ge.zoom===ar?dr:Ge.zoom,Ge.wrap,Ge.zoom,rr,Je),distanceSq:n.sqrLen([ve[0]-.5-rr,ve[1]-.5-Je])});continue}for(var Vi=0;Vi<4;Vi++){var Di=(rr<<1)+Vi%2,da=(Je<<1)+(Vi>>1);lr.push({aabb:Ge.aabb.quadrant(Vi),zoom:Ge.zoom+1,x:Di,y:da,wrap:Ge.wrap,fullyVisible:Hr})}}return tr.sort(function(Hi,Wi){return Hi.distanceSq-Wi.distanceSq}).map(function(Hi){return Hi.tileID})},rl.prototype.resize=function(Z,lt){this.width=Z,this.height=lt,this.pixelsToGLUnits=[2/Z,-2/lt],this._constrain(),this._calcMatrices()},nl.unmodified.get=function(){return this._unmodified},rl.prototype.zoomScale=function(Z){return Math.pow(2,Z)},rl.prototype.scaleZoom=function(Z){return Math.log(Z)/Math.LN2},rl.prototype.project=function(Z){var lt=n.clamp(Z.lat,-this.maxValidLatitude,this.maxValidLatitude);return new n.Point(n.mercatorXfromLng(Z.lng)*this.worldSize,n.mercatorYfromLat(lt)*this.worldSize)},rl.prototype.unproject=function(Z){return new n.MercatorCoordinate(Z.x/this.worldSize,Z.y/this.worldSize).toLngLat()},nl.point.get=function(){return this.project(this.center)},rl.prototype.setLocationAtPoint=function(Z,lt){var nt=this.pointCoordinate(lt),wt=this.pointCoordinate(this.centerPoint),Wt=this.locationCoordinate(Z),ve=new n.MercatorCoordinate(Wt.x-(nt.x-wt.x),Wt.y-(nt.y-wt.y));this.center=this.coordinateLocation(ve),this._renderWorldCopies&&(this.center=this.center.wrap())},rl.prototype.locationPoint=function(Z){return this.coordinatePoint(this.locationCoordinate(Z))},rl.prototype.pointLocation=function(Z){return this.coordinateLocation(this.pointCoordinate(Z))},rl.prototype.locationCoordinate=function(Z){return n.MercatorCoordinate.fromLngLat(Z)},rl.prototype.coordinateLocation=function(Z){return Z.toLngLat()},rl.prototype.pointCoordinate=function(Z){var lt=0,nt=[Z.x,Z.y,0,1],wt=[Z.x,Z.y,1,1];n.transformMat4(nt,nt,this.pixelMatrixInverse),n.transformMat4(wt,wt,this.pixelMatrixInverse);var Wt=nt[3],ve=wt[3],ke=nt[0]/Wt,Jt=wt[0]/ve,fe=nt[1]/Wt,De=wt[1]/ve,lr=nt[2]/Wt,tr=wt[2]/ve,ar=lr===tr?0:(lt-lr)/(tr-lr);return new n.MercatorCoordinate(n.number(ke,Jt,ar)/this.worldSize,n.number(fe,De,ar)/this.worldSize)},rl.prototype.coordinatePoint=function(Z){var lt=[Z.x*this.worldSize,Z.y*this.worldSize,0,1];return n.transformMat4(lt,lt,this.pixelMatrix),new n.Point(lt[0]/lt[3],lt[1]/lt[3])},rl.prototype.getBounds=function(){return new n.LngLatBounds().extend(this.pointLocation(new n.Point(0,0))).extend(this.pointLocation(new n.Point(this.width,0))).extend(this.pointLocation(new n.Point(this.width,this.height))).extend(this.pointLocation(new n.Point(0,this.height)))},rl.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new n.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},rl.prototype.setMaxBounds=function(Z){Z?(this.lngRange=[Z.getWest(),Z.getEast()],this.latRange=[Z.getSouth(),Z.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},rl.prototype.calculatePosMatrix=function(Z,lt){lt===void 0&&(lt=!1);var nt=Z.key,wt=lt?this._alignedPosMatrixCache:this._posMatrixCache;if(wt[nt])return wt[nt];var Wt=Z.canonical,ve=this.worldSize/this.zoomScale(Wt.z),ke=Wt.x+Math.pow(2,Wt.z)*Z.wrap,Jt=n.identity(new Float64Array(16));return n.translate(Jt,Jt,[ke*ve,Wt.y*ve,0]),n.scale(Jt,Jt,[ve/n.EXTENT,ve/n.EXTENT,1]),n.multiply(Jt,lt?this.alignedProjMatrix:this.projMatrix,Jt),wt[nt]=new Float32Array(Jt),wt[nt]},rl.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},rl.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var Z=-90,lt=90,nt=-180,wt=180,Wt,ve,ke,Jt,fe=this.size,De=this._unmodified;if(this.latRange){var lr=this.latRange;Z=n.mercatorYfromLat(lr[1])*this.worldSize,lt=n.mercatorYfromLat(lr[0])*this.worldSize,Wt=lt-Zlt&&(Jt=lt-Ge)}if(this.lngRange){var rr=ar.x,Je=fe.x/2;rr-Jewt&&(ke=wt-Je)}(ke!==void 0||Jt!==void 0)&&(this.center=this.unproject(new n.Point(ke!==void 0?ke:ar.x,Jt!==void 0?Jt:ar.y))),this._unmodified=De,this._constraining=!1}},rl.prototype._calcMatrices=function(){if(this.height){var Z=this._fov/2,lt=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(Z)*this.height;var nt=Math.PI/2+this._pitch,wt=this._fov*(.5+lt.y/this.height),Wt=Math.sin(wt)*this.cameraToCenterDistance/Math.sin(n.clamp(Math.PI-nt-wt,.01,Math.PI-.01)),ve=this.point,ke=ve.x,Jt=ve.y,fe=Math.cos(Math.PI/2-this._pitch)*Wt+this.cameraToCenterDistance,De=fe*1.01,lr=this.height/50,tr=new Float64Array(16);n.perspective(tr,this._fov,this.width/this.height,lr,De),tr[8]=-lt.x*2/this.width,tr[9]=lt.y*2/this.height,n.scale(tr,tr,[1,-1,1]),n.translate(tr,tr,[0,0,-this.cameraToCenterDistance]),n.rotateX(tr,tr,this._pitch),n.rotateZ(tr,tr,this.angle),n.translate(tr,tr,[-ke,-Jt,0]),this.mercatorMatrix=n.scale([],tr,[this.worldSize,this.worldSize,this.worldSize]),n.scale(tr,tr,[1,1,n.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=tr,this.invProjMatrix=n.invert([],this.projMatrix);var ar=this.width%2/2,dr=this.height%2/2,gr=Math.cos(this.angle),Ge=Math.sin(this.angle),rr=ke-Math.round(ke)+gr*ar+Ge*dr,Je=Jt-Math.round(Jt)+gr*dr+Ge*ar,Hr=new Float64Array(tr);if(n.translate(Hr,Hr,[rr>.5?rr-1:rr,Je>.5?Je-1:Je,0]),this.alignedProjMatrix=Hr,tr=n.create(),n.scale(tr,tr,[this.width/2,-this.height/2,1]),n.translate(tr,tr,[1,-1,0]),this.labelPlaneMatrix=tr,tr=n.create(),n.scale(tr,tr,[1,-1,1]),n.translate(tr,tr,[-1,-1,0]),n.scale(tr,tr,[2/this.width,2/this.height,1]),this.glCoordMatrix=tr,this.pixelMatrix=n.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),tr=n.invert(new Float64Array(16),this.pixelMatrix),!tr)throw new Error("failed to invert matrix");this.pixelMatrixInverse=tr,this._posMatrixCache={},this._alignedPosMatrixCache={}}},rl.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var Z=this.pointCoordinate(new n.Point(0,0)),lt=[Z.x*this.worldSize,Z.y*this.worldSize,0,1],nt=n.transformMat4(lt,lt,this.pixelMatrix);return nt[3]/this.cameraToCenterDistance},rl.prototype.getCameraPoint=function(){var Z=this._pitch,lt=Math.tan(Z)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.Point(0,lt))},rl.prototype.getCameraQueryGeometry=function(Z){var lt=this.getCameraPoint();if(Z.length===1)return[Z[0],lt];for(var nt=lt.x,wt=lt.y,Wt=lt.x,ve=lt.y,ke=0,Jt=Z;ke=3&&!Z.some(function(nt){return isNaN(nt)})){var lt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(Z[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+Z[2],+Z[1]],zoom:+Z[0],bearing:lt,pitch:+(Z[4]||0)}),!0}return!1},wu.prototype._updateHashUnthrottled=function(){var Z=n.window.location.href.replace(/(#.+)?$/,this.getHashString());try{n.window.history.replaceState(n.window.history.state,null,Z)}catch{}};var ih={linearity:.3,easing:n.bezier(0,0,.3,1)},Et=n.extend({deceleration:2500,maxSpeed:1400},ih),Vt=n.extend({deceleration:20,maxSpeed:1400},ih),de=n.extend({deceleration:1e3,maxSpeed:360},ih),Ie=n.extend({deceleration:1e3,maxSpeed:90},ih),Be=function(Z){this._map=Z,this.clear()};Be.prototype.clear=function(){this._inertiaBuffer=[]},Be.prototype.record=function(Z){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:n.browser.now(),settings:Z})},Be.prototype._drainInertiaBuffer=function(){for(var Z=this._inertiaBuffer,lt=n.browser.now(),nt=160;Z.length>0&<-Z[0].time>nt;)Z.shift()},Be.prototype._onMoveEnd=function(Z){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var lt={zoom:0,bearing:0,pitch:0,pan:new n.Point(0,0),pinchAround:void 0,around:void 0},nt=0,wt=this._inertiaBuffer;nt=this._clickTolerance||this._map.fire(new cr(Z.type,this._map,Z))},fn.prototype.dblclick=function(Z){return this._firePreventable(new cr(Z.type,this._map,Z))},fn.prototype.mouseover=function(Z){this._map.fire(new cr(Z.type,this._map,Z))},fn.prototype.mouseout=function(Z){this._map.fire(new cr(Z.type,this._map,Z))},fn.prototype.touchstart=function(Z){return this._firePreventable(new Fr(Z.type,this._map,Z))},fn.prototype.touchmove=function(Z){this._map.fire(new Fr(Z.type,this._map,Z))},fn.prototype.touchend=function(Z){this._map.fire(new Fr(Z.type,this._map,Z))},fn.prototype.touchcancel=function(Z){this._map.fire(new Fr(Z.type,this._map,Z))},fn.prototype._firePreventable=function(Z){if(this._map.fire(Z),Z.defaultPrevented)return{}},fn.prototype.isEnabled=function(){return!0},fn.prototype.isActive=function(){return!1},fn.prototype.enable=function(){},fn.prototype.disable=function(){};var Bn=function(Z){this._map=Z};Bn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bn.prototype.mousemove=function(Z){this._map.fire(new cr(Z.type,this._map,Z))},Bn.prototype.mousedown=function(){this._delayContextMenu=!0},Bn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new cr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bn.prototype.contextmenu=function(Z){this._delayContextMenu?this._contextMenuEvent=Z:this._map.fire(new cr(Z.type,this._map,Z)),this._map.listens("contextmenu")&&Z.preventDefault()},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){};var ti=function(Z,lt){this._map=Z,this._el=Z.getCanvasContainer(),this._container=Z.getContainer(),this._clickTolerance=lt.clickTolerance||1};ti.prototype.isEnabled=function(){return!!this._enabled},ti.prototype.isActive=function(){return!!this._active},ti.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ti.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ti.prototype.mousedown=function(Z,lt){this.isEnabled()&&Z.shiftKey&&Z.button===0&&(a.disableDrag(),this._startPos=this._lastPos=lt,this._active=!0)},ti.prototype.mousemoveWindow=function(Z,lt){if(this._active){var nt=lt;if(!(this._lastPos.equals(nt)||!this._box&&nt.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=Z.timeStamp),nt.length===this.numTouches&&(this.centroid=ra(lt),this.touches=ei(nt,lt)))},Ki.prototype.touchmove=function(Z,lt,nt){if(!(this.aborted||!this.centroid)){var wt=ei(nt,lt);for(var Wt in this.touches){var ve=this.touches[Wt],ke=wt[Wt];(!ke||ke.dist(ve)>$i)&&(this.aborted=!0)}}},Ki.prototype.touchend=function(Z,lt,nt){if((!this.centroid||Z.timeStamp-this.startTime>Oi)&&(this.aborted=!0),nt.length===0){var wt=!this.aborted&&this.centroid;if(this.reset(),wt)return wt}};var sa=function(Z){this.singleTap=new Ki(Z),this.numTaps=Z.numTaps,this.reset()};sa.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},sa.prototype.touchstart=function(Z,lt,nt){this.singleTap.touchstart(Z,lt,nt)},sa.prototype.touchmove=function(Z,lt,nt){this.singleTap.touchmove(Z,lt,nt)},sa.prototype.touchend=function(Z,lt,nt){var wt=this.singleTap.touchend(Z,lt,nt);if(wt){var Wt=Z.timeStamp-this.lastTime0&&(this._active=!0);var wt=ei(nt,lt),Wt=new n.Point(0,0),ve=new n.Point(0,0),ke=0;for(var Jt in wt){var fe=wt[Jt],De=this._touches[Jt];De&&(Wt._add(fe),ve._add(fe.sub(De)),ke++,wt[Jt]=fe)}if(this._touches=wt,!(keMath.abs(Z.x)}var Yl=100,hc=function(Z){function lt(){Z.apply(this,arguments)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.reset=function(){Z.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},lt.prototype._start=function(nt){this._lastPoints=nt,ph(nt[0].sub(nt[1]))&&(this._valid=!1)},lt.prototype._move=function(nt,wt,Wt){var ve=nt[0].sub(this._lastPoints[0]),ke=nt[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(ve,ke,Wt.timeStamp),!!this._valid){this._lastPoints=nt,this._active=!0;var Jt=(ve.y+ke.y)/2,fe=-.5;return{pitchDelta:Jt*fe}}},lt.prototype.gestureBeginsVertically=function(nt,wt,Wt){if(this._valid!==void 0)return this._valid;var ve=2,ke=nt.mag()>=ve,Jt=wt.mag()>=ve;if(!(!ke&&!Jt)){if(!ke||!Jt)return this._firstMove===void 0&&(this._firstMove=Wt),Wt-this._firstMove0==wt.y>0;return ph(nt)&&ph(wt)&&fe}},lt}(Bl),zh={panStep:100,bearingStep:15,pitchStep:10},Se=function(){var Z=zh;this._panStep=Z.panStep,this._bearingStep=Z.bearingStep,this._pitchStep=Z.pitchStep,this._rotationDisabled=!1};Se.prototype.reset=function(){this._active=!1},Se.prototype.keydown=function(Z){var lt=this;if(!(Z.altKey||Z.ctrlKey||Z.metaKey)){var nt=0,wt=0,Wt=0,ve=0,ke=0;switch(Z.keyCode){case 61:case 107:case 171:case 187:nt=1;break;case 189:case 109:case 173:nt=-1;break;case 37:Z.shiftKey?wt=-1:(Z.preventDefault(),ve=-1);break;case 39:Z.shiftKey?wt=1:(Z.preventDefault(),ve=1);break;case 38:Z.shiftKey?Wt=1:(Z.preventDefault(),ke=-1);break;case 40:Z.shiftKey?Wt=-1:(Z.preventDefault(),ke=1);break;default:return}return this._rotationDisabled&&(wt=0,Wt=0),{cameraAnimation:function(Jt){var fe=Jt.getZoom();Jt.easeTo({duration:300,easeId:"keyboardHandler",easing:Ir,zoom:nt?Math.round(fe)+nt*(Z.shiftKey?2:1):fe,bearing:Jt.getBearing()+wt*lt._bearingStep,pitch:Jt.getPitch()+Wt*lt._pitchStep,offset:[-ve*lt._panStep,-ke*lt._panStep],center:Jt.getCenter()},{originalEvent:Z})}}}},Se.prototype.enable=function(){this._enabled=!0},Se.prototype.disable=function(){this._enabled=!1,this.reset()},Se.prototype.isEnabled=function(){return this._enabled},Se.prototype.isActive=function(){return this._active},Se.prototype.disableRotation=function(){this._rotationDisabled=!0},Se.prototype.enableRotation=function(){this._rotationDisabled=!1};function Ir(Z){return Z*(2-Z)}var Vr=4.000244140625,ri=1/100,Ai=1/450,bi=2,On=function(Z,lt){this._map=Z,this._el=Z.getCanvasContainer(),this._handler=lt,this._delta=0,this._defaultZoomRate=ri,this._wheelZoomRate=Ai,n.bindAll(["_onTimeout"],this)};On.prototype.setZoomRate=function(Z){this._defaultZoomRate=Z},On.prototype.setWheelZoomRate=function(Z){this._wheelZoomRate=Z},On.prototype.isEnabled=function(){return!!this._enabled},On.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},On.prototype.isZooming=function(){return!!this._zooming},On.prototype.enable=function(Z){this.isEnabled()||(this._enabled=!0,this._aroundCenter=Z&&Z.around==="center")},On.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},On.prototype.wheel=function(Z){if(this.isEnabled()){var lt=Z.deltaMode===n.window.WheelEvent.DOM_DELTA_LINE?Z.deltaY*40:Z.deltaY,nt=n.browser.now(),wt=nt-(this._lastWheelEventTime||0);this._lastWheelEventTime=nt,lt!==0&<%Vr===0?this._type="wheel":lt!==0&&Math.abs(lt)<4?this._type="trackpad":wt>400?(this._type=null,this._lastValue=lt,this._timeout=setTimeout(this._onTimeout,40,Z)):this._type||(this._type=Math.abs(wt*lt)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,lt+=this._lastValue)),Z.shiftKey&<&&(lt=lt/4),this._type&&(this._lastWheelEvent=Z,this._delta-=lt,this._active||this._start(Z)),Z.preventDefault()}},On.prototype._onTimeout=function(Z){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Z)},On.prototype._start=function(Z){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var lt=a.mousePos(this._el,Z);this._around=n.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(lt)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},On.prototype.renderFrame=function(){var Z=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var lt=this._map.transform;if(this._delta!==0){var nt=this._type==="wheel"&&Math.abs(this._delta)>Vr?this._wheelZoomRate:this._defaultZoomRate,wt=bi/(1+Math.exp(-Math.abs(this._delta*nt)));this._delta<0&&wt!==0&&(wt=1/wt);var Wt=typeof this._targetZoom=="number"?lt.zoomScale(this._targetZoom):lt.scale;this._targetZoom=Math.min(lt.maxZoom,Math.max(lt.minZoom,lt.scaleZoom(Wt*wt))),this._type==="wheel"&&(this._startZoom=lt.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var ve=typeof this._targetZoom=="number"?this._targetZoom:lt.zoom,ke=this._startZoom,Jt=this._easing,fe=!1,De;if(this._type==="wheel"&&ke&&Jt){var lr=Math.min((n.browser.now()-this._lastWheelEventTime)/200,1),tr=Jt(lr);De=n.number(ke,ve,tr),lr<1?this._frameId||(this._frameId=!0):fe=!0}else De=ve,fe=!0;return this._active=!0,fe&&(this._active=!1,this._finishTimeout=setTimeout(function(){Z._zooming=!1,Z._handler._triggerRenderFrame(),delete Z._targetZoom,delete Z._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!fe,zoomDelta:De-lt.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},On.prototype._smoothOutEasing=function(Z){var lt=n.ease;if(this._prevEase){var nt=this._prevEase,wt=(n.browser.now()-nt.start)/nt.duration,Wt=nt.easing(wt+.01)-nt.easing(wt),ve=.27/Math.sqrt(Wt*Wt+1e-4)*.01,ke=Math.sqrt(.27*.27-ve*ve);lt=n.bezier(ve,ke,.25,1)}return this._prevEase={start:n.browser.now(),duration:Z,easing:lt},lt},On.prototype.reset=function(){this._active=!1};var Si=function(Z,lt){this._clickZoom=Z,this._tapZoom=lt};Si.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Si.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Si.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Si.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ha=function(){this.reset()};ha.prototype.reset=function(){this._active=!1},ha.prototype.dblclick=function(Z,lt){return Z.preventDefault(),{cameraAnimation:function(nt){nt.easeTo({duration:300,zoom:nt.getZoom()+(Z.shiftKey?-1:1),around:nt.unproject(lt)},{originalEvent:Z})}}},ha.prototype.enable=function(){this._enabled=!0},ha.prototype.disable=function(){this._enabled=!1,this.reset()},ha.prototype.isEnabled=function(){return this._enabled},ha.prototype.isActive=function(){return this._active};var aa=function(){this._tap=new sa({numTouches:1,numTaps:1}),this.reset()};aa.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},aa.prototype.touchstart=function(Z,lt,nt){this._swipePoint||(this._tapTime&&Z.timeStamp-this._tapTime>si&&this.reset(),this._tapTime?nt.length>0&&(this._swipePoint=lt[0],this._swipeTouch=nt[0].identifier):this._tap.touchstart(Z,lt,nt))},aa.prototype.touchmove=function(Z,lt,nt){if(!this._tapTime)this._tap.touchmove(Z,lt,nt);else if(this._swipePoint){if(nt[0].identifier!==this._swipeTouch)return;var wt=lt[0],Wt=wt.y-this._swipePoint.y;return this._swipePoint=wt,Z.preventDefault(),this._active=!0,{zoomDelta:Wt/128}}},aa.prototype.touchend=function(Z,lt,nt){if(this._tapTime)this._swipePoint&&nt.length===0&&this.reset();else{var wt=this._tap.touchend(Z,lt,nt);wt&&(this._tapTime=Z.timeStamp)}},aa.prototype.touchcancel=function(){this.reset()},aa.prototype.enable=function(){this._enabled=!0},aa.prototype.disable=function(){this._enabled=!1,this.reset()},aa.prototype.isEnabled=function(){return this._enabled},aa.prototype.isActive=function(){return this._active};var Ia=function(Z,lt,nt){this._el=Z,this._mousePan=lt,this._touchPan=nt};Ia.prototype.enable=function(Z){this._inertiaOptions=Z||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Ia.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Ia.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Ia.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var co=function(Z,lt,nt){this._pitchWithRotate=Z.pitchWithRotate,this._mouseRotate=lt,this._mousePitch=nt};co.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},co.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},co.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},co.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var eo=function(Z,lt,nt,wt){this._el=Z,this._touchZoom=lt,this._touchRotate=nt,this._tapDragZoom=wt,this._rotationDisabled=!1,this._enabled=!0};eo.prototype.enable=function(Z){this._touchZoom.enable(Z),this._rotationDisabled||this._touchRotate.enable(Z),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},eo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},eo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},eo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},eo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},eo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var ma=function(Z){return Z.zoom||Z.drag||Z.pitch||Z.rotate},ji=function(Z){function lt(){Z.apply(this,arguments)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt}(n.Event);function En(Z){return Z.panDelta&&Z.panDelta.mag()||Z.zoomDelta||Z.bearingDelta||Z.pitchDelta}var oi=function(Z,lt){this._map=Z,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Be(Z),this._bearingSnap=lt.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(lt),n.bindAll(["handleEvent","handleWindowEvent"],this);var nt=this._el;this._listeners=[[nt,"touchstart",{passive:!0}],[nt,"touchmove",{passive:!1}],[nt,"touchend",void 0],[nt,"touchcancel",void 0],[nt,"mousedown",void 0],[nt,"mousemove",void 0],[nt,"mouseup",void 0],[n.window.document,"mousemove",{capture:!0}],[n.window.document,"mouseup",void 0],[nt,"mouseover",void 0],[nt,"mouseout",void 0],[nt,"dblclick",void 0],[nt,"click",void 0],[nt,"keydown",{capture:!1}],[nt,"keyup",void 0],[nt,"wheel",{passive:!1}],[nt,"contextmenu",void 0],[n.window,"blur",void 0]];for(var wt=0,Wt=this._listeners;wtke?Math.min(2,Ln):Math.max(.5,Ln),Hi=Math.pow(da,1-Vi),Wi=ve.unproject(Hr.add(wn.mult(Vi*Hi)).mult(Di));ve.setLocationAtPoint(ve.renderWorldCopies?Wi.wrap():Wi,Ge)}Wt._fireMoveEvents(wt)},function(Vi){Wt._afterEase(wt,Vi)},nt),this},lt.prototype._prepareEase=function(nt,wt,Wt){Wt===void 0&&(Wt={}),this._moving=!0,!wt&&!Wt.moving&&this.fire(new n.Event("movestart",nt)),this._zooming&&!Wt.zooming&&this.fire(new n.Event("zoomstart",nt)),this._rotating&&!Wt.rotating&&this.fire(new n.Event("rotatestart",nt)),this._pitching&&!Wt.pitching&&this.fire(new n.Event("pitchstart",nt))},lt.prototype._fireMoveEvents=function(nt){this.fire(new n.Event("move",nt)),this._zooming&&this.fire(new n.Event("zoom",nt)),this._rotating&&this.fire(new n.Event("rotate",nt)),this._pitching&&this.fire(new n.Event("pitch",nt))},lt.prototype._afterEase=function(nt,wt){if(!(this._easeId&&wt&&this._easeId===wt)){delete this._easeId;var Wt=this._zooming,ve=this._rotating,ke=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Wt&&this.fire(new n.Event("zoomend",nt)),ve&&this.fire(new n.Event("rotateend",nt)),ke&&this.fire(new n.Event("pitchend",nt)),this.fire(new n.Event("moveend",nt))}},lt.prototype.flyTo=function(nt,wt){var Wt=this;if(!nt.essential&&n.browser.prefersReducedMotion){var ve=n.pick(nt,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ve,wt)}this.stop(),nt=n.extend({offset:[0,0],speed:1.2,curve:1.42,easing:n.ease},nt);var ke=this.transform,Jt=this.getZoom(),fe=this.getBearing(),De=this.getPitch(),lr=this.getPadding(),tr="zoom"in nt?n.clamp(+nt.zoom,ke.minZoom,ke.maxZoom):Jt,ar="bearing"in nt?this._normalizeBearing(nt.bearing,fe):fe,dr="pitch"in nt?+nt.pitch:De,gr="padding"in nt?nt.padding:ke.padding,Ge=ke.zoomScale(tr-Jt),rr=n.Point.convert(nt.offset),Je=ke.centerPoint.add(rr),Hr=ke.pointLocation(Je),wn=n.LngLat.convert(nt.center||Hr);this._normalizeCenter(wn);var Ln=ke.project(Hr),Ii=ke.project(wn).sub(Ln),Mi=nt.curve,gi=Math.max(ke.width,ke.height),Vi=gi/Ge,Di=Ii.mag();if("minZoom"in nt){var da=n.clamp(Math.min(nt.minZoom,Jt,tr),ke.minZoom,ke.maxZoom),Hi=gi/ke.zoomScale(da-Jt);Mi=Math.sqrt(Hi/Di*2)}var Wi=Mi*Mi;function wa(qs){var Bc=(Vi*Vi-gi*gi+(qs?-1:1)*Wi*Wi*Di*Di)/(2*(qs?Vi:gi)*Wi*Di);return Math.log(Math.sqrt(Bc*Bc+1)-Bc)}function vo(qs){return(Math.exp(qs)-Math.exp(-qs))/2}function So(qs){return(Math.exp(qs)+Math.exp(-qs))/2}function ns(qs){return vo(qs)/So(qs)}var As=wa(0),Wl=function(qs){return So(As)/So(As+Mi*qs)},Jl=function(qs){return gi*((So(As)*ns(As+Mi*qs)-vo(As))/Wi)/Di},Al=(wa(1)-As)/Mi;if(Math.abs(Di)<1e-6||!isFinite(Al)){if(Math.abs(gi-Vi)<1e-6)return this.easeTo(nt,wt);var Ql=Vint.maxDuration&&(nt.duration=0),this._zooming=!0,this._rotating=fe!==ar,this._pitching=dr!==De,this._padding=!ke.isPaddingEqual(gr),this._prepareEase(wt,!1),this._ease(function(qs){var Bc=qs*Al,md=1/Wl(Bc);ke.zoom=qs===1?tr:Jt+ke.scaleZoom(md),Wt._rotating&&(ke.bearing=n.number(fe,ar,qs)),Wt._pitching&&(ke.pitch=n.number(De,dr,qs)),Wt._padding&&(ke.interpolatePadding(lr,gr,qs),Je=ke.centerPoint.add(rr));var Vd=qs===1?wn:ke.unproject(Ln.add(Ii.mult(Jl(Bc))).mult(md));ke.setLocationAtPoint(ke.renderWorldCopies?Vd.wrap():Vd,Je),Wt._fireMoveEvents(wt)},function(){return Wt._afterEase(wt)},nt),this},lt.prototype.isEasing=function(){return!!this._easeFrameId},lt.prototype.stop=function(){return this._stop()},lt.prototype._stop=function(nt,wt){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Wt=this._onEaseEnd;delete this._onEaseEnd,Wt.call(this,wt)}if(!nt){var ve=this.handlers;ve&&ve.stop(!1)}return this},lt.prototype._ease=function(nt,wt,Wt){Wt.animate===!1||Wt.duration===0?(nt(1),wt()):(this._easeStart=n.browser.now(),this._easeOptions=Wt,this._onEaseFrame=nt,this._onEaseEnd=wt,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},lt.prototype._renderFrameCallback=function(){var nt=Math.min((n.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(nt)),nt<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},lt.prototype._normalizeBearing=function(nt,wt){nt=n.wrap(nt,-180,180);var Wt=Math.abs(nt-wt);return Math.abs(nt-360-wt)180?-360:Wt<-180?360:0}},lt}(n.Evented),Ni=function(Z){Z===void 0&&(Z={}),this.options=Z,n.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Ni.prototype.getDefaultPosition=function(){return"bottom-right"},Ni.prototype.onAdd=function(Z){var lt=this.options&&this.options.compact;return this._map=Z,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),lt&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),lt===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ni.prototype.onRemove=function(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Ni.prototype._setElementTitle=function(Z,lt){var nt=this._map._getUIString("AttributionControl."+lt);Z.title=nt,Z.setAttribute("aria-label",nt)},Ni.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ni.prototype._updateEditLink=function(){var Z=this._editLink;Z||(Z=this._editLink=this._container.querySelector(".mapbox-improve-map"));var lt=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||n.config.ACCESS_TOKEN}];if(Z){var nt=lt.reduce(function(wt,Wt,ve){return Wt.value&&(wt+=Wt.key+"="+Wt.value+(ve=0)return!1;return!0});var ke=Z.join(" | ");ke!==this._attribHTML&&(this._attribHTML=ke,Z.length?(this._innerContainer.innerHTML=ke,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Ni.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var wi=function(){n.bindAll(["_updateLogo"],this),n.bindAll(["_updateCompact"],this)};wi.prototype.onAdd=function(Z){this._map=Z,this._container=a.create("div","mapboxgl-ctrl");var lt=a.create("a","mapboxgl-ctrl-logo");return lt.target="_blank",lt.rel="noopener nofollow",lt.href="https://www.mapbox.com/",lt.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),lt.setAttribute("rel","noopener nofollow"),this._container.appendChild(lt),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},wi.prototype.onRemove=function(){a.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},wi.prototype.getDefaultPosition=function(){return"bottom-left"},wi.prototype._updateLogo=function(Z){(!Z||Z.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},wi.prototype._logoRequired=function(){if(this._map.style){var Z=this._map.style.sourceCaches;for(var lt in Z){var nt=Z[lt].getSource();if(nt.mapbox_logo)return!0}return!1}},wi.prototype._updateCompact=function(){var Z=this._container.children;if(Z.length){var lt=Z[0];this._map.getCanvasContainer().offsetWidth<250?lt.classList.add("mapboxgl-compact"):lt.classList.remove("mapboxgl-compact")}};var Ua=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ua.prototype.add=function(Z){var lt=++this._id,nt=this._queue;return nt.push({callback:Z,id:lt,cancelled:!1}),lt},Ua.prototype.remove=function(Z){for(var lt=this._currentlyRunning,nt=lt?this._queue.concat(lt):this._queue,wt=0,Wt=nt;wtwt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(wt.minPitch!=null&&wt.maxPitch!=null&&wt.minPitch>wt.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(wt.minPitch!=null&&wt.minPitchua)throw new Error("maxPitch must be less than or equal to "+ua);var ve=new rl(wt.minZoom,wt.maxZoom,wt.minPitch,wt.maxPitch,wt.renderWorldCopies);if(Z.call(this,ve,wt),this._interactive=wt.interactive,this._maxTileCacheSize=wt.maxTileCacheSize,this._failIfMajorPerformanceCaveat=wt.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=wt.preserveDrawingBuffer,this._antialias=wt.antialias,this._trackResize=wt.trackResize,this._bearingSnap=wt.bearingSnap,this._refreshExpiredTiles=wt.refreshExpiredTiles,this._fadeDuration=wt.fadeDuration,this._crossSourceCollisions=wt.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=wt.collectResourceTiming,this._renderTaskQueue=new Ua,this._controls=[],this._mapId=n.uniqueId(),this._locale=n.extend({},Ca,wt.locale),this._clickTolerance=wt.clickTolerance,this._requestManager=new n.RequestManager(wt.transformRequest,wt.accessToken),typeof wt.container=="string"){if(this._container=n.window.document.getElementById(wt.container),!this._container)throw new Error("Container '"+wt.container+"' not found.")}else if(wt.container instanceof Ri)this._container=wt.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(wt.maxBounds&&this.setMaxBounds(wt.maxBounds),n.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return Wt._update(!1)}),this.on("moveend",function(){return Wt._update(!1)}),this.on("zoom",function(){return Wt._update(!0)}),typeof n.window<"u"&&(n.window.addEventListener("online",this._onWindowOnline,!1),n.window.addEventListener("resize",this._onWindowResize,!1),n.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new oi(this,wt);var ke=typeof wt.hash=="string"&&wt.hash||void 0;this._hash=wt.hash&&new wu(ke).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:wt.center,zoom:wt.zoom,bearing:wt.bearing,pitch:wt.pitch}),wt.bounds&&(this.resize(),this.fitBounds(wt.bounds,n.extend({},wt.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=wt.localIdeographFontFamily,wt.style&&this.setStyle(wt.style,{localIdeographFontFamily:wt.localIdeographFontFamily}),wt.attributionControl&&this.addControl(new Ni({customAttribution:wt.customAttribution})),this.addControl(new wi,wt.logoPosition),this.on("style.load",function(){Wt.transform.unmodified&&Wt.jumpTo(Wt.style.stylesheet)}),this.on("data",function(Jt){Wt._update(Jt.dataType==="style"),Wt.fire(new n.Event(Jt.dataType+"data",Jt))}),this.on("dataloading",function(Jt){Wt.fire(new n.Event(Jt.dataType+"dataloading",Jt))})}Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt;var nt={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return lt.prototype._getMapId=function(){return this._mapId},lt.prototype.addControl=function(wt,Wt){if(Wt===void 0&&(wt.getDefaultPosition?Wt=wt.getDefaultPosition():Wt="top-right"),!wt||!wt.onAdd)return this.fire(new n.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var ve=wt.onAdd(this);this._controls.push(wt);var ke=this._controlPositions[Wt];return Wt.indexOf("bottom")!==-1?ke.insertBefore(ve,ke.firstChild):ke.appendChild(ve),this},lt.prototype.removeControl=function(wt){if(!wt||!wt.onRemove)return this.fire(new n.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Wt=this._controls.indexOf(wt);return Wt>-1&&this._controls.splice(Wt,1),wt.onRemove(this),this},lt.prototype.hasControl=function(wt){return this._controls.indexOf(wt)>-1},lt.prototype.resize=function(wt){var Wt=this._containerDimensions(),ve=Wt[0],ke=Wt[1];this._resizeCanvas(ve,ke),this.transform.resize(ve,ke),this.painter.resize(ve,ke);var Jt=!this._moving;return Jt&&(this.stop(),this.fire(new n.Event("movestart",wt)).fire(new n.Event("move",wt))),this.fire(new n.Event("resize",wt)),Jt&&this.fire(new n.Event("moveend",wt)),this},lt.prototype.getBounds=function(){return this.transform.getBounds()},lt.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},lt.prototype.setMaxBounds=function(wt){return this.transform.setMaxBounds(n.LngLatBounds.convert(wt)),this._update()},lt.prototype.setMinZoom=function(wt){if(wt=wt??$a,wt>=$a&&wt<=this.transform.maxZoom)return this.transform.minZoom=wt,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=wt,this._update(),this.getZoom()>wt&&this.setZoom(wt),this;throw new Error("maxZoom must be greater than the current minZoom")},lt.prototype.getMaxZoom=function(){return this.transform.maxZoom},lt.prototype.setMinPitch=function(wt){if(wt=wt??la,wt=la&&wt<=this.transform.maxPitch)return this.transform.minPitch=wt,this._update(),this.getPitch()ua)throw new Error("maxPitch must be less than or equal to "+ua);if(wt>=this.transform.minPitch)return this.transform.maxPitch=wt,this._update(),this.getPitch()>wt&&this.setPitch(wt),this;throw new Error("maxPitch must be greater than the current minPitch")},lt.prototype.getMaxPitch=function(){return this.transform.maxPitch},lt.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},lt.prototype.setRenderWorldCopies=function(wt){return this.transform.renderWorldCopies=wt,this._update()},lt.prototype.project=function(wt){return this.transform.locationPoint(n.LngLat.convert(wt))},lt.prototype.unproject=function(wt){return this.transform.pointLocation(n.Point.convert(wt))},lt.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},lt.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},lt.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},lt.prototype._createDelegatedListener=function(wt,Wt,ve){var ke=this,Jt;if(wt==="mouseenter"||wt==="mouseover"){var fe=!1,De=function(Ge){var rr=ke.getLayer(Wt)?ke.queryRenderedFeatures(Ge.point,{layers:[Wt]}):[];rr.length?fe||(fe=!0,ve.call(ke,new cr(wt,ke,Ge.originalEvent,{features:rr}))):fe=!1},lr=function(){fe=!1};return{layer:Wt,listener:ve,delegates:{mousemove:De,mouseout:lr}}}else if(wt==="mouseleave"||wt==="mouseout"){var tr=!1,ar=function(Ge){var rr=ke.getLayer(Wt)?ke.queryRenderedFeatures(Ge.point,{layers:[Wt]}):[];rr.length?tr=!0:tr&&(tr=!1,ve.call(ke,new cr(wt,ke,Ge.originalEvent)))},dr=function(Ge){tr&&(tr=!1,ve.call(ke,new cr(wt,ke,Ge.originalEvent)))};return{layer:Wt,listener:ve,delegates:{mousemove:ar,mouseout:dr}}}else{var gr=function(Ge){var rr=ke.getLayer(Wt)?ke.queryRenderedFeatures(Ge.point,{layers:[Wt]}):[];rr.length&&(Ge.features=rr,ve.call(ke,Ge),delete Ge.features)};return{layer:Wt,listener:ve,delegates:(Jt={},Jt[wt]=gr,Jt)}}},lt.prototype.on=function(wt,Wt,ve){if(ve===void 0)return Z.prototype.on.call(this,wt,Wt);var ke=this._createDelegatedListener(wt,Wt,ve);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[wt]=this._delegatedListeners[wt]||[],this._delegatedListeners[wt].push(ke);for(var Jt in ke.delegates)this.on(Jt,ke.delegates[Jt]);return this},lt.prototype.once=function(wt,Wt,ve){if(ve===void 0)return Z.prototype.once.call(this,wt,Wt);var ke=this._createDelegatedListener(wt,Wt,ve);for(var Jt in ke.delegates)this.once(Jt,ke.delegates[Jt]);return this},lt.prototype.off=function(wt,Wt,ve){var ke=this;if(ve===void 0)return Z.prototype.off.call(this,wt,Wt);var Jt=function(fe){for(var De=fe[wt],lr=0;lr180;){var ke=nt.locationPoint(Z);if(ke.x>=0&&ke.y>=0&&ke.x<=nt.width&&ke.y<=nt.height)break;Z.lng>nt.center.lng?Z.lng-=360:Z.lng+=360}return Z}var hs={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 Xl(Z,lt,nt){var wt=Z.classList;for(var Wt in hs)wt.remove("mapboxgl-"+nt+"-anchor-"+Wt);wt.add("mapboxgl-"+nt+"-anchor-"+lt)}var Rl=function(Z){function lt(nt,wt){if(Z.call(this),(nt instanceof n.window.HTMLElement||wt)&&(nt=n.extend({element:nt},wt)),n.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=nt&&nt.anchor||"center",this._color=nt&&nt.color||"#3FB1CE",this._scale=nt&&nt.scale||1,this._draggable=nt&&nt.draggable||!1,this._clickTolerance=nt&&nt.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=nt&&nt.rotation||0,this._rotationAlignment=nt&&nt.rotationAlignment||"auto",this._pitchAlignment=nt&&nt.pitchAlignment&&nt.pitchAlignment!=="auto"?nt.pitchAlignment:this._rotationAlignment,!nt||!nt.element){this._defaultMarker=!0,this._element=a.create("div"),this._element.setAttribute("aria-label","Map marker");var Wt=a.createNS("http://www.w3.org/2000/svg","svg"),ve=41,ke=27;Wt.setAttributeNS(null,"display","block"),Wt.setAttributeNS(null,"height",ve+"px"),Wt.setAttributeNS(null,"width",ke+"px"),Wt.setAttributeNS(null,"viewBox","0 0 "+ke+" "+ve);var Jt=a.createNS("http://www.w3.org/2000/svg","g");Jt.setAttributeNS(null,"stroke","none"),Jt.setAttributeNS(null,"stroke-width","1"),Jt.setAttributeNS(null,"fill","none"),Jt.setAttributeNS(null,"fill-rule","evenodd");var fe=a.createNS("http://www.w3.org/2000/svg","g");fe.setAttributeNS(null,"fill-rule","nonzero");var De=a.createNS("http://www.w3.org/2000/svg","g");De.setAttributeNS(null,"transform","translate(3.0, 29.0)"),De.setAttributeNS(null,"fill","#000000");for(var lr=[{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"}],tr=0,ar=lr;tr=wt}this._isDragging&&(this._pos=nt.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new n.Event("dragstart"))),this.fire(new n.Event("drag")))},lt.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new n.Event("dragend")),this._state="inactive"},lt.prototype._addDragHandler=function(nt){this._element.contains(nt.originalEvent.target)&&(nt.preventDefault(),this._positionDelta=nt.point.sub(this._pos).add(this._offset),this._pointerdownPos=nt.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))},lt.prototype.setDraggable=function(nt){return this._draggable=!!nt,this._map&&(nt?(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},lt.prototype.isDraggable=function(){return this._draggable},lt.prototype.setRotation=function(nt){return this._rotation=nt||0,this._update(),this},lt.prototype.getRotation=function(){return this._rotation},lt.prototype.setRotationAlignment=function(nt){return this._rotationAlignment=nt||"auto",this._update(),this},lt.prototype.getRotationAlignment=function(){return this._rotationAlignment},lt.prototype.setPitchAlignment=function(nt){return this._pitchAlignment=nt&&nt!=="auto"?nt:this._rotationAlignment,this._update(),this},lt.prototype.getPitchAlignment=function(){return this._pitchAlignment},lt}(n.Evented),ys={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Dc;function Cl(Z){Dc!==void 0?Z(Dc):n.window.navigator.permissions!==void 0?n.window.navigator.permissions.query({name:"geolocation"}).then(function(lt){Dc=lt.state!=="denied",Z(Dc)}):(Dc=!!n.window.navigator.geolocation,Z(Dc))}var Nc=0,ku=!1,Eu=function(Z){function lt(nt){Z.call(this),this.options=n.extend({},ys,nt),n.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.onAdd=function(nt){return this._map=nt,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Cl(this._setupUI),this._container},lt.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(n.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(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Nc=0,ku=!1},lt.prototype._isOutOfMapMaxBounds=function(nt){var wt=this._map.getMaxBounds(),Wt=nt.coords;return wt&&(Wt.longitudewt.getEast()||Wt.latitudewt.getNorth())},lt.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},lt.prototype._onSuccess=function(nt){if(this._map){if(this._isOutOfMapMaxBounds(nt)){this._setErrorState(),this.fire(new n.Event("outofmaxbounds",nt)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=nt,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(nt),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(nt),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new n.Event("geolocate",nt)),this._finish()}},lt.prototype._updateCamera=function(nt){var wt=new n.LngLat(nt.coords.longitude,nt.coords.latitude),Wt=nt.coords.accuracy,ve=this._map.getBearing(),ke=n.extend({bearing:ve},this.options.fitBoundsOptions);this._map.fitBounds(wt.toBounds(Wt),ke,{geolocateSource:!0})},lt.prototype._updateMarker=function(nt){if(nt){var wt=new n.LngLat(nt.coords.longitude,nt.coords.latitude);this._accuracyCircleMarker.setLngLat(wt).addTo(this._map),this._userLocationDotMarker.setLngLat(wt).addTo(this._map),this._accuracy=nt.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},lt.prototype._updateCircleRadius=function(){var nt=this._map._container.clientHeight/2,wt=this._map.unproject([0,nt]),Wt=this._map.unproject([1,nt]),ve=wt.distanceTo(Wt),ke=Math.ceil(2*this._accuracy/ve);this._circleElement.style.width=ke+"px",this._circleElement.style.height=ke+"px"},lt.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},lt.prototype._onError=function(nt){if(this._map){if(this.options.trackUserLocation)if(nt.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var wt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=wt,this._geolocateButton.setAttribute("aria-label",wt),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(nt.code===3&&ku)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new n.Event("error",nt)),this._finish()}},lt.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},lt.prototype._setupUI=function(nt){var wt=this;if(this._container.addEventListener("contextmenu",function(ke){return ke.preventDefault()}),this._geolocateButton=a.create("button","mapboxgl-ctrl-geolocate",this._container),a.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",nt===!1){n.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Wt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Wt,this._geolocateButton.setAttribute("aria-label",Wt)}else{var ve=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=ve,this._geolocateButton.setAttribute("aria-label",ve)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Rl(this._dotElement),this._circleElement=a.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Rl({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",function(ke){var Jt=ke.originalEvent&&ke.originalEvent.type==="resize";!ke.geolocateSource&&wt._watchState==="ACTIVE_LOCK"&&!Jt&&(wt._watchState="BACKGROUND",wt._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),wt._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),wt.fire(new n.Event("trackuserlocationend")))})},lt.prototype.trigger=function(){if(!this._setup)return n.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 n.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Nc--,ku=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new n.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Nc++;var nt;Nc>1?(nt={maximumAge:6e5,timeout:0},ku=!0):(nt=this.options.positionOptions,ku=!1),this._geolocationWatchID=n.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,nt)}}else n.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},lt.prototype._clearWatch=function(){n.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},lt}(n.Evented),Ec={maxWidth:100,unit:"metric"},kc=function(Z){this.options=n.extend({},Ec,Z),n.bindAll(["_onMove","setUnit"],this)};kc.prototype.getDefaultPosition=function(){return"bottom-left"},kc.prototype._onMove=function(){zc(this._map,this._container,this.options)},kc.prototype.onAdd=function(Z){return this._map=Z,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",Z.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},kc.prototype.onRemove=function(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},kc.prototype.setUnit=function(Z){this.options.unit=Z,zc(this._map,this._container,this.options)};function zc(Z,lt,nt){var wt=nt&&nt.maxWidth||100,Wt=Z._container.clientHeight/2,ve=Z.unproject([0,Wt]),ke=Z.unproject([wt,Wt]),Jt=ve.distanceTo(ke);if(nt&&nt.unit==="imperial"){var fe=3.2808*Jt;if(fe>5280){var De=fe/5280;Xo(lt,wt,De,Z._getUIString("ScaleControl.Miles"))}else Xo(lt,wt,fe,Z._getUIString("ScaleControl.Feet"))}else if(nt&&nt.unit==="nautical"){var lr=Jt/1852;Xo(lt,wt,lr,Z._getUIString("ScaleControl.NauticalMiles"))}else Jt>=1e3?Xo(lt,wt,Jt/1e3,Z._getUIString("ScaleControl.Kilometers")):Xo(lt,wt,Jt,Z._getUIString("ScaleControl.Meters"))}function Xo(Z,lt,nt,wt){var Wt=xl(nt),ve=Wt/nt;Z.style.width=lt*ve+"px",Z.innerHTML=Wt+" "+wt}function Oc(Z){var lt=Math.pow(10,Math.ceil(-Math.log(Z)/Math.LN10));return Math.round(Z*lt)/lt}function xl(Z){var lt=Math.pow(10,(""+Math.floor(Z)).length-1),nt=Z/lt;return nt=nt>=10?10:nt>=5?5:nt>=3?3:nt>=2?2:nt>=1?1:Oc(nt),lt*nt}var jc=function(Z){this._fullscreen=!1,Z&&Z.container&&(Z.container instanceof n.window.HTMLElement?this._container=Z.container:n.warnOnce("Full screen control 'container' must be a DOM element.")),n.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in n.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in n.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in n.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in n.window.document&&(this._fullscreenchange="MSFullscreenChange")};jc.prototype.onAdd=function(Z){return this._map=Z,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",n.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},jc.prototype.onRemove=function(){a.remove(this._controlContainer),this._map=null,n.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},jc.prototype._checkFullscreenSupport=function(){return!!(n.window.document.fullscreenEnabled||n.window.document.mozFullScreenEnabled||n.window.document.msFullscreenEnabled||n.window.document.webkitFullscreenEnabled)},jc.prototype._setupUI=function(){var Z=this._fullscreenButton=a.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);a.create("span","mapboxgl-ctrl-icon",Z).setAttribute("aria-hidden",!0),Z.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),n.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},jc.prototype._updateTitle=function(){var Z=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Z),this._fullscreenButton.title=Z},jc.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},jc.prototype._isFullscreen=function(){return this._fullscreen},jc.prototype._changeIcon=function(){var Z=n.window.document.fullscreenElement||n.window.document.mozFullScreenElement||n.window.document.webkitFullscreenElement||n.window.document.msFullscreenElement;Z===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},jc.prototype._onClickFullscreen=function(){this._isFullscreen()?n.window.document.exitFullscreen?n.window.document.exitFullscreen():n.window.document.mozCancelFullScreen?n.window.document.mozCancelFullScreen():n.window.document.msExitFullscreen?n.window.document.msExitFullscreen():n.window.document.webkitCancelFullScreen&&n.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Lu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},jo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Rs=function(Z){function lt(nt){Z.call(this),this.options=n.extend(Object.create(Lu),nt),n.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return Z&&(lt.__proto__=Z),lt.prototype=Object.create(Z&&Z.prototype),lt.prototype.constructor=lt,lt.prototype.addTo=function(nt){return this._map&&this.remove(),this._map=nt,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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new n.Event("open")),this},lt.prototype.isOpen=function(){return!!this._map},lt.prototype.remove=function(){return this._content&&a.remove(this._content),this._container&&(a.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 n.Event("close")),this},lt.prototype.getLngLat=function(){return this._lngLat},lt.prototype.setLngLat=function(nt){return this._lngLat=n.LngLat.convert(nt),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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},lt.prototype.trackPointer=function(){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("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},lt.prototype.getElement=function(){return this._container},lt.prototype.setText=function(nt){return this.setDOMContent(n.window.document.createTextNode(nt))},lt.prototype.setHTML=function(nt){var wt=n.window.document.createDocumentFragment(),Wt=n.window.document.createElement("body"),ve;for(Wt.innerHTML=nt;ve=Wt.firstChild,!!ve;)wt.appendChild(ve);return this.setDOMContent(wt)},lt.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},lt.prototype.setMaxWidth=function(nt){return this.options.maxWidth=nt,this._update(),this},lt.prototype.setDOMContent=function(nt){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(nt),this._createCloseButton(),this._update(),this._focusFirstElement(),this},lt.prototype.addClassName=function(nt){this._container&&this._container.classList.add(nt)},lt.prototype.removeClassName=function(nt){this._container&&this._container.classList.remove(nt)},lt.prototype.setOffset=function(nt){return this.options.offset=nt,this._update(),this},lt.prototype.toggleClassName=function(nt){if(this._container)return this._container.classList.toggle(nt)},lt.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-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))},lt.prototype._onMouseUp=function(nt){this._update(nt.point)},lt.prototype._onMouseMove=function(nt){this._update(nt.point)},lt.prototype._onDrag=function(nt){this._update(nt.point)},lt.prototype._update=function(nt){var wt=this,Wt=this._lngLat||this._trackPointer;if(!(!this._map||!Wt||!this._content)&&(this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(ar){return wt._container.classList.add(ar)}),this._trackPointer&&this._container.classList.add("mapboxgl-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=No(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!nt))){var ve=this._pos=this._trackPointer&&nt?nt:this._map.project(this._lngLat),ke=this.options.anchor,Jt=Fl(this.options.offset);if(!ke){var fe=this._container.offsetWidth,De=this._container.offsetHeight,lr;ve.y+Jt.bottom.ythis._map.transform.height-De?lr=["bottom"]:lr=[],ve.xthis._map.transform.width-fe/2&&lr.push("right"),lr.length===0?ke="bottom":ke=lr.join("-")}var tr=ve.add(Jt[ke]).round();a.setTransform(this._container,hs[ke]+" translate("+tr.x+"px,"+tr.y+"px)"),Xl(this._container,ke,"popup")}},lt.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var nt=this._container.querySelector(jo);nt&&nt.focus()}},lt.prototype._onClose=function(){this.remove()},lt}(n.Evented);function Fl(Z){if(Z)if(typeof Z=="number"){var lt=Math.round(Math.sqrt(.5*Math.pow(Z,2)));return{center:new n.Point(0,0),top:new n.Point(0,Z),"top-left":new n.Point(lt,lt),"top-right":new n.Point(-lt,lt),bottom:new n.Point(0,-Z),"bottom-left":new n.Point(lt,-lt),"bottom-right":new n.Point(-lt,-lt),left:new n.Point(Z,0),right:new n.Point(-Z,0)}}else if(Z instanceof n.Point||Array.isArray(Z)){var nt=n.Point.convert(Z);return{center:nt,top:nt,"top-left":nt,"top-right":nt,bottom:nt,"bottom-left":nt,"bottom-right":nt,left:nt,right:nt}}else return{center:n.Point.convert(Z.center||[0,0]),top:n.Point.convert(Z.top||[0,0]),"top-left":n.Point.convert(Z["top-left"]||[0,0]),"top-right":n.Point.convert(Z["top-right"]||[0,0]),bottom:n.Point.convert(Z.bottom||[0,0]),"bottom-left":n.Point.convert(Z["bottom-left"]||[0,0]),"bottom-right":n.Point.convert(Z["bottom-right"]||[0,0]),left:n.Point.convert(Z.left||[0,0]),right:n.Point.convert(Z.right||[0,0])};else return Fl(new n.Point(0,0))}var Pl={version:n.version,supported:i,setRTLTextPlugin:n.setRTLTextPlugin,getRTLTextPluginStatus:n.getRTLTextPluginStatus,Map:Vo,NavigationControl:Ya,GeolocateControl:Eu,AttributionControl:Ni,ScaleControl:kc,FullscreenControl:jc,Popup:Rs,Marker:Rl,Style:pu,LngLat:n.LngLat,LngLatBounds:n.LngLatBounds,Point:n.Point,MercatorCoordinate:n.MercatorCoordinate,Evented:n.Evented,config:n.config,prewarm:so,clearPrewarmedResources:Fe,get accessToken(){return n.config.ACCESS_TOKEN},set accessToken(Z){n.config.ACCESS_TOKEN=Z},get baseApiUrl(){return n.config.API_URL},set baseApiUrl(Z){n.config.API_URL=Z},get workerCount(){return Ji.workerCount},set workerCount(Z){Ji.workerCount=Z},get maxParallelImageRequests(){return n.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(Z){n.config.MAX_PARALLEL_IMAGE_REQUESTS=Z},clearStorage:function(Z){n.clearTileCache(Z)},workerUrl:""};return Pl}),z})}),ntt=It((et,Y)=>{var f=jn(),y=uu().sanitizeHTML,z=xz(),P=my();function n(c,s){this.subplot=c,this.uid=c.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var i=n.prototype;i.update=function(c){this.visible?this.needsNewImage(c)?this.updateImage(c):this.needsNewSource(c)?(this.removeLayer(),this.updateSource(c),this.updateLayer(c)):this.needsNewLayer(c)?this.updateLayer(c):this.updateStyle(c):(this.updateSource(c),this.updateLayer(c)),this.visible=a(c)},i.needsNewImage=function(c){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&c.sourcetype==="image"&&(this.source!==c.source||JSON.stringify(this.coordinates)!==JSON.stringify(c.coordinates))},i.needsNewSource=function(c){return this.sourceType!==c.sourcetype||JSON.stringify(this.source)!==JSON.stringify(c.source)||this.layerType!==c.type},i.needsNewLayer=function(c){return this.layerType!==c.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},i.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},i.updateImage=function(c){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:c.source,coordinates:c.coordinates});var h=this.findFollowingMapboxLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},i.updateSource=function(c){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=c.sourcetype,this.source=c.source,!!a(c)){var h=o(c);s.addSource(this.idSource,h)}},i.findFollowingMapboxLayerId=function(c){if(c==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(c){var s={},h={};switch(c.type){case"circle":f.extendFlat(h,{"circle-radius":c.circle.radius,"circle-color":c.color,"circle-opacity":c.opacity});break;case"line":f.extendFlat(h,{"line-width":c.line.width,"line-color":c.color,"line-opacity":c.opacity,"line-dasharray":c.line.dash});break;case"fill":f.extendFlat(h,{"fill-color":c.color,"fill-outline-color":c.fill.outlinecolor,"fill-opacity":c.opacity});break;case"symbol":var m=c.symbol,b=z(m.textposition,m.iconsize);f.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),f.extendFlat(h,{"icon-color":c.color,"text-color":m.textfont.color,"text-opacity":c.opacity});break;case"raster":f.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":c.opacity});break}return{layout:s,paint:h}}function o(c){var s=c.sourcetype,h=c.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=c.coordinates),m[b]=h,c.sourceattribution&&(m.attribution=y(c.sourceattribution)),m}Y.exports=function(c,s,h){var m=new n(c,s);return m.update(h),m}}),itt=It((et,Y)=>{var f=bz(),y=jn(),z=q_(),P=ls(),n=Fs(),i=Up(),a=hd(),l=dm(),o=l.drawMode,c=l.selectMode,s=Md().prepSelect,h=Md().clearOutline,m=Md().clearSelectionsCache,b=Md().selectOnClick,x=my(),_=ntt();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var d=A.prototype;d.plot=function(I,M,p){var g=this,C=M[g.id];g.map&&C.accesstoken!==g.accessToken&&(g.map.remove(),g.map=null,g.styleObj=null,g.traceHash={},g.layerList=[]);var S;g.map?S=new Promise(function(N,B){g.updateMap(I,M,N,B)}):S=new Promise(function(N,B){g.createMap(I,M,N,B)}),p.push(S)},d.createMap=function(I,M,p,g){var C=this,S=M[C.id],N=C.styleObj=w(S.style,M);C.accessToken=S.accesstoken;var B=S.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new f.Map({container:C.div,style:N.style,center:E(S.center),zoom:S.zoom,bearing:S.bearing,pitch:S.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new f.AttributionControl({compact:!0}));V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var W=[];W.push(new Promise(function(F){V.once("load",F)})),W=W.concat(z.fetchTraceGeoData(I)),Promise.all(W).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.updateMap=function(I,M,p,g){var C=this,S=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style,M);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,S.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){S.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,S,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},d.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var S=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),c(S)||o(S)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,S)},i.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},d.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},d.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var f=jn(),y=O_(),z=Zf(),P=Rk();Y.exports=function(a,l,o){y(a,l,o,{type:"mapbox",attributes:P,handleDefaults:n,partition:"y",accessToken:l._mapboxAccessToken})};function n(a,l,o,c){o("accesstoken",c.accessToken),o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var s=o("bounds.west"),h=o("bounds.east"),m=o("bounds.south"),b=o("bounds.north");(s===void 0||h===void 0||m===void 0||b===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:i}),l._input=a}function i(a,l){function o(x,_){return f.coerce(a,l,P.layers,x,_)}var c=o("visible");if(c){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",f.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),f.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),xA=It(et=>{var Y=bz(),f=jn(),y=f.strTranslate,z=f.strScale,P=Mf().getSubplotCalcData,n=k0(),i=Br(),a=Js(),l=uu(),o=itt(),c="mapbox",s=et.constants=my();et.name=c,et.attr="subplot",et.idRoot=c,et.idRegex=et.attrRegex=f.counterRegex(c);var h=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");et.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},et.layoutAttributes=Rk(),et.supplyLayoutDefaults=att();var m=!0;et.plot=function(_){m&&(m=!1,f.warn(h));var A=_._fullLayout,d=_.calcdata,k=A._subplots[c];if(Y.version!==s.requiredVersion)throw new Error(s.wrongVersionErrorMsg);var w=b(_,k);Y.accessToken=w;for(var D=0;DW/2){var F=N.split("|").join("
");U.text(F).attr("data-unformatted",F).call(l.convertToTspans,_),V=a.bBox(U.node())}U.attr("transform",y(-3,-V.height+8)),B.insert("rect",".static-attribution").attr({x:-V.width-6,y:-V.height-3,width:V.width+6,height:V.height+3,fill:"rgba(255, 255, 255, 0.75)"});var H=1;V.width+6>W&&(H=W/(V.width+6));var q=[k.l+k.w*E.x[1],k.t+k.h*(1-E.y[0])];B.attr("transform",y(q[0],q[1])+z(H))}};function b(_,A){var d=_._fullLayout,k=_._context;if(k.mapboxAccessToken==="")return"";for(var w=[],D=[],E=!1,I=!1,M=0;M1&&f.warn(s.multipleTokensErrorMsg),w[0]):(D.length&&f.log(["Listed mapbox access token(s)",D.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function x(_){return typeof _=="string"&&(s.styleValuesMapbox.indexOf(_)!==-1||_.indexOf("mapbox://")===0||_.indexOf("stamen")===0)}et.updateFx=function(_){for(var A=_._fullLayout,d=A._subplots[c],k=0;k{Y.exports={attributes:yA(),supplyDefaults:JQ(),colorbar:Do(),formatLabels:_z(),calc:JC(),plot:ttt(),hoverPoints:_A().hoverPoints,eventData:ett(),selectPoints:rtt(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermapbox",basePlotModule:xA(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),stt=It((et,Y)=>{Y.exports=ott()}),wz=It((et,Y)=>{var f=Kw(),y=Ru(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=xa(),i=Yn().extendFlat;Y.exports=i({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:i({},f.featureidkey,{}),below:{valType:"string",editType:"plot"},text:f.text,hovertext:f.hovertext,marker:{line:{color:i({},f.marker.line.color,{editType:"plot"}),width:i({},f.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:i({},f.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:i({},f.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i({},f.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:f.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:i({},n.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),ltt=It((et,Y)=>{var f=jn(),y=Cu(),z=wz();Y.exports=function(P,n,i,a){function l(m,b){return f.coerce(P,n,z,m,b)}var o=l("locations"),c=l("z"),s=l("geojson");if(!f.isArrayOrTypedArray(o)||!o.length||!f.isArrayOrTypedArray(c)||!c.length||!(typeof s=="string"&&s!==""||f.isPlainObject(s))){n.visible=!1;return}l("featureidkey"),n._length=Math.min(o.length,c.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,n,a,l,{prefix:"",cLetter:"z"}),f.coerceSelectionMarkerOpacity(n,l)}}),kz=It((et,Y)=>{var f=Sr(),y=jn(),z=ch(),P=Js(),n=W_().makeBlank,i=q_();function a(o){var c=o[0].trace,s=c.visible===!0&&c._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=c._opts={fill:h,line:m,geojson:n()};if(!s)return b;var x=i.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(c),A=c.marker,d=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var S=C.mo;return f(S)?+y.constrain(S,0,1):0});var w;y.isArrayOrTypedArray(d.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(d.width)&&(D=function(C){return C.mlw});for(var E=0;E{var f=kz().convert,y=kz().convertOnSelect,z=my().traceLayerPrefix;function P(i,a){this.type="choroplethmapbox",this.subplot=i,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var n=P.prototype;n.update=function(i){this._update(f(i)),i[0].trace._glTrace=this},n.updateOnSelect=function(i){this._update(y(i))},n._update=function(i){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(i.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(i,o),this.below=o);for(var c=0;c=0;l--)i.removeLayer(a[l][1])},n.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,a){var l=a[0].trace,o=new P(i,l.uid),c=o.sourceId,s=f(a),h=o.below=i.belowLookup["trace-"+l.uid];return i.map.addSource(c,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),utt=It((et,Y)=>{Y.exports={attributes:wz(),supplyDefaults:ltt(),colorbar:z_(),calc:rA(),plot:ctt(),hoverPoints:iA(),eventData:aA(),selectPoints:oA(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(f,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var n=z[P].id;if(typeof n=="string"&&n.indexOf("water")===0){for(var i=P+1;i{Y.exports=utt()}),Tz=It((et,Y)=>{var f=Ru(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=xa(),n=yA(),i=Yn().extendFlat;Y.exports=i({lon:n.lon,lat:n.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,hoverinfo:i({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:i({},P.showlegend,{dflt:!1})},f("",{cLetter:"z",editTypeOverride:"calc"}))}),dtt=It((et,Y)=>{var f=jn(),y=Cu(),z=Tz();Y.exports=function(P,n,i,a){function l(h,m){return f.coerce(P,n,z,h,m)}var o=l("lon")||[],c=l("lat")||[],s=Math.min(o.length,c.length);if(!s){n.visible=!1;return}n._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,n,a,l,{prefix:"",cLetter:"z"})}}),ftt=It((et,Y)=>{var f=Sr(),y=jn().isArrayOrTypedArray,z=Dr().BADNUM,P=Cp(),n=jn()._;Y.exports=function(i,a){for(var l=a._length,o=new Array(l),c=a.z,s=y(c)&&c.length,h=0;h{var f=Sr(),y=jn(),z=Hn(),P=ch(),n=Dr().BADNUM,i=W_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,c={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:c,geojson:i()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var f=ptt(),y=my().traceLayerPrefix;function z(n,i){this.type="densitymapbox",this.subplot=n,this.uid=i,this.sourceId="source-"+i,this.layerList=[["heatmap",y+i+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(n){var i=this.subplot,a=this.layerList,l=f(n),o=i.belowLookup["trace-"+this.uid];i.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var c=0;c=0;a--)n.removeLayer(i[a][1])},P.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,i){var a=i[0].trace,l=new z(n,a.uid),o=l.sourceId,c=f(i),s=l.below=n.belowLookup["trace-"+a.uid];return n.map.addSource(o,{type:"geojson",data:c.geojson}),l._addLayers(c,s),l}}),gtt=It((et,Y)=>{var f=Fs(),y=_A().hoverPoints,z=_A().getExtraText;Y.exports=function(P,n,i){var a=y(P,n,i);if(a){var l=a[0],o=l.cd,c=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=f.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(c,s,o[0].t.labels),[l]}}}),vtt=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f.z=y.z,f}}),ytt=It((et,Y)=>{Y.exports={attributes:Tz(),supplyDefaults:dtt(),colorbar:z_(),formatLabels:_z(),calc:ftt(),plot:mtt(),hoverPoints:gtt(),eventData:vtt(),getBelow:function(f,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=ytt()}),xtt=It((et,Y)=>{Y.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} @@ -3332,9 +3332,9 @@ uniform `+lr+" "+tr+" u_"+ar+`; {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}),btt=It((et,Y)=>{Y.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}),Y_=It((et,Y)=>{var f=Xm(),y=xtt(),z=btt(),P='© OpenStreetMap contributors',n="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",l="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",c="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",s={basic:a,streets:a,outdoors:a,light:n,dark:i,satellite:z,"satellite-streets":y,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:P,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":n,"carto-darkmatter":i,"carto-voyager":a,"carto-positron-nolabels":l,"carto-darkmatter-nolabels":o,"carto-voyager-nolabels":c},h=f(s);Y.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:h,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",h.join(", "),"or use a tile service."].join(` -`),mapOnErrorMsg:"Map error."}}),Fk=It((et,Y)=>{var f=jn(),y=Hn().defaultLine,z=Jh().attributes,P=hi(),n=dd().textposition,i=sh().overrideAll,a=Tc().templatedArray,l=Y_(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var c=Y.exports=i({_arrayAttrRegexps:[f.counterRegex("map",".layers",!0)],domain:z({name:"map"}),style:{valType:"any",values:l.styleValuesMap,dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:f.extendFlat({},n,{arrayOk:!1})}})},"plot","from-root");c.uirevision={valType:"any",editType:"none"}}),bA=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=Pb(),i=dd(),a=Fk(),l=xa(),o=Ru(),c=Yn().extendFlat,s=sh().overrideAll,h=Fk(),m=n.line,b=n.marker;Y.exports=s({lon:n.lon,lat:n.lat,cluster:{enabled:{valType:"boolean"},maxzoom:c({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:c({},b.opacity,{dflt:1})},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:c({},i.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:i.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:n.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:i.selected.marker},unselected:{marker:i.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:f(),hovertemplatefallback:z()},"calc","nested")}),Sz=It((et,Y)=>{var f=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return f.indexOf(y)!==-1}}}),wtt=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=pm(),i=Pm(),a=bA(),l=Sz().isSupportedFont;Y.exports=function(c,s,h,m){function b(g,C){return f.coerce(c,s,a,g,C)}function x(g,C){return f.coerce2(c,s,a,g,C)}var _=o(c,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(c,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(f.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),f.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(c,s,h,m,b,{noDash:!0}),b("connectgaps"));var d=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=d!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;n(c,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&i(c,s,h,b),f.coerceSelectionMarkerOpacity(s,b)};function o(c,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),Cz=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot,a=i.mockAxis,l=y.lonlat;return n.lonLabel=f.tickText(a,a.c2l(l[0]),!0).text,n.latLabel=f.tickText(a,a.c2l(l[1]),!0).text,n}}),Az=It((et,Y)=>{var f=jn();Y.exports=function(y,z){var P=y.split(" "),n=P[0],i=P[1],a=f.isArrayOrTypedArray(z)?f.mean(z):z,l=.5+a/100,o=1.5+a/100,c=["",""],s=[0,0];switch(n){case"top":c[0]="top",s[1]=-o;break;case"bottom":c[0]="bottom",s[1]=o;break}switch(i){case"left":c[1]="right",s[0]=-l;break;case"right":c[1]="left",s[0]=l;break}var h;return c[0]&&c[1]?h=c.join("-"):c[0]?h=c[0]:c[1]?h=c[1]:h="center",{anchor:h,offset:s}}}),ktt=It((et,Y)=>{var f=Sr(),y=jn(),z=Dr().BADNUM,P=W_(),n=ch(),i=Js(),a=Hv(),l=Fu(),o=Sz().isSupportedFont,c=Az(),s=T0().appendArrayPointValue,h=uu().NEWLINES,m=uu().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),S=l.hasMarkers(M),N=l.hasText(M),B=S&&M.marker.symbol==="circle",U=S&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),H=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:H,symbol:q};if(!p)return G;var tt;if((g||C)&&(tt=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(tt),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(tt),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var ht=x(I);H.geojson=ht.geojson,H.layout.visibility="visible",V&&(H.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat(H.paint,{"circle-color":ht.mcc,"circle-radius":ht.mrc,"circle-opacity":ht.mo})}if(B&&V&&(H.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var bt=(M.marker||{}).size,vt=c(M.textposition,bt);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":vt.anchor,"text-offset":vt.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),S=y.isArrayOrTypedArray(M.opacity),N;function B(vt){return I.opacity*vt}function U(vt){return vt/2}var V;g&&(n.hasColorscale(I,"marker")?V=n.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;S&&(F=function(vt){var ut=f(vt)?+y.constrain(vt,0,1):0;return B(ut)});var H=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),S&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),Ttt=It((et,Y)=>{var f=jn(),y=ktt(),z=Y_().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function n(a,l,o,c){this.type="scattermap",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=c,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var i=n.prototype;i.addSource=function(a,l,o){var c={type:"geojson",data:l.geojson};o&&o.enabled&&f.extendFlat(c,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],c)},i.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},i.addLayer=function(a,l,o){var c={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(c.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var S=g[C];c.removeLayer(x.layerIds[S])}p||c.removeSource(x.sourceIds.circle)}function d(p){for(var g=P.nonCluster,C=0;C=0;C--){var S=g[C];c.removeLayer(x.layerIds[S]),p||c.removeSource(x.sourceIds[S])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):d(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var c=l[o];a.removeLayer(this.layerIds[c]),a.removeSource(this.sourceIds[c])}},Y.exports=function(a,l){var o=l[0].trace,c=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new n(a,o.uid,c,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(c)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var f=hd(),y=jn(),z=qc(),P=y.fillText,n=Dr().BADNUM,i=Y_().traceLayerPrefix;function a(o,c,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],d=i+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[d]});A=w.map(function(W){return W.id})}var D=c>=0?Math.floor((c+180)/360):Math.ceil((c-180)/360),E=D*360,I=c-E;function M(W){var F=W.lonlat;if(F[0]===n||k&&A.indexOf(W.i+1)===-1)return 1/0;var H=y.modHalf(F[0],360),q=F[1],G=_.project([H,q]),tt=G.x-b.c2p([I,q]),ht=G.y-x.c2p([H,s]),bt=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(tt*tt+ht*ht)-bt,1-3/bt)}if(f.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],S=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=S-B,o.x1=S+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,c,s){if(o.hovertemplate)return;var h=c.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=c.lonlat,d=[];function k(w){return w+"°"}return b||x&&_?d.push("("+k(A[1])+", "+k(A[0])+")"):x?d.push(s.lon+k(A[0])):_&&d.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(c,o,d),d.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),Stt=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f}}),Ctt=It((et,Y)=>{var f=jn(),y=Fu(),z=Dr().BADNUM;Y.exports=function(P,n){var i=P.cd,a=P.xaxis,l=P.yaxis,o=[],c=i[0].trace,s;if(!y.hasMarkers(c))return[];if(n===!1)for(s=0;s{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():(f=typeof globalThis<"u"?globalThis:f||self,f.maplibregl=y())})(et,function(){var f={},y={};function z(n,i,a){if(y[n]=a,n==="index"){var l="var sharedModule = {}; ("+y.shared+")(sharedModule); ("+y.worker+")(sharedModule);",o={};return y.shared(o),y.index(f,o),typeof window<"u"&&f.setWorkerUrl(window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}))),f}}z("shared",["exports"],function(n){function i(X,R,at,kt){return new(at||(at=Promise))(function(jt,Qt){function re(or){try{$e(kt.next(or))}catch(Cr){Qt(Cr)}}function Ae(or){try{$e(kt.throw(or))}catch(Cr){Qt(Cr)}}function $e(or){var Cr;or.done?jt(or.value):(Cr=or.value,Cr instanceof at?Cr:new at(function($r){$r(Cr)})).then(re,Ae)}$e((kt=kt.apply(X,R||[])).next())})}function a(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}typeof SuppressedError=="function"&&SuppressedError;var l=o;function o(X,R){this.x=X,this.y=R}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(X){return this.clone()._add(X)},sub:function(X){return this.clone()._sub(X)},multByPoint:function(X){return this.clone()._multByPoint(X)},divByPoint:function(X){return this.clone()._divByPoint(X)},mult:function(X){return this.clone()._mult(X)},div:function(X){return this.clone()._div(X)},rotate:function(X){return this.clone()._rotate(X)},rotateAround:function(X,R){return this.clone()._rotateAround(X,R)},matMult:function(X){return this.clone()._matMult(X)},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(X){return this.x===X.x&&this.y===X.y},dist:function(X){return Math.sqrt(this.distSqr(X))},distSqr:function(X){var R=X.x-this.x,at=X.y-this.y;return R*R+at*at},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(X){return Math.atan2(this.y-X.y,this.x-X.x)},angleWith:function(X){return this.angleWithSep(X.x,X.y)},angleWithSep:function(X,R){return Math.atan2(this.x*R-this.y*X,this.x*X+this.y*R)},_matMult:function(X){var R=X[2]*this.x+X[3]*this.y;return this.x=X[0]*this.x+X[1]*this.y,this.y=R,this},_add:function(X){return this.x+=X.x,this.y+=X.y,this},_sub:function(X){return this.x-=X.x,this.y-=X.y,this},_mult:function(X){return this.x*=X,this.y*=X,this},_div:function(X){return this.x/=X,this.y/=X,this},_multByPoint:function(X){return this.x*=X.x,this.y*=X.y,this},_divByPoint:function(X){return this.x/=X.x,this.y/=X.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var X=this.y;return this.y=this.x,this.x=-X,this},_rotate:function(X){var R=Math.cos(X),at=Math.sin(X),kt=at*this.x+R*this.y;return this.x=R*this.x-at*this.y,this.y=kt,this},_rotateAround:function(X,R){var at=Math.cos(X),kt=Math.sin(X),jt=R.y+kt*(this.x-R.x)+at*(this.y-R.y);return this.x=R.x+at*(this.x-R.x)-kt*(this.y-R.y),this.y=jt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(X){return X instanceof o?X:Array.isArray(X)?new o(X[0],X[1]):X};var c=a(l),s=h;function h(X,R,at,kt){this.cx=3*X,this.bx=3*(at-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(kt-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=at,this.p2y=kt}h.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var at=X,kt=0;kt<8;kt++){var jt=this.sampleCurveX(at)-X;if(Math.abs(jt)jt?re=at:Ae=at,at=.5*(Ae-re)+re;return at},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var m=a(s);let b,x;function _(){return b==null&&(b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),b}function A(){if(x==null&&(x=!1,_())){let X=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(X){for(let at=0;at<25;at++){let kt=4*at;X.fillStyle=`rgb(${kt},${kt+1},${kt+2})`,X.fillRect(at%5,Math.floor(at/5),1,1)}let R=X.getImageData(0,0,5,5).data;for(let at=0;at<100;at++)if(at%4!=3&&R[at]!==at){x=!0;break}}}return x||!1}function d(X,R,at,kt){let jt=new m(X,R,at,kt);return Qt=>jt.solve(Qt)}let k=d(.25,.1,.25,1);function w(X,R,at){return Math.min(at,Math.max(R,X))}function D(X,R,at){let kt=at-R,jt=((X-R)%kt+kt)%kt+R;return jt===R?at:jt}function E(X,...R){for(let at of R)for(let kt in at)X[kt]=at[kt];return X}let I=1;function M(X,R,at){let kt={};for(let jt in X)kt[jt]=R.call(this,X[jt],jt,X);return kt}function p(X,R,at){let kt={};for(let jt in X)R.call(this,X[jt],jt,X)&&(kt[jt]=X[jt]);return kt}function g(X){return Array.isArray(X)?X.map(g):typeof X=="object"&&X?M(X,g):X}let C={};function S(X){C[X]||(typeof console<"u"&&console.warn(X),C[X]=!0)}function N(X,R,at){return(at.y-X.y)*(R.x-X.x)>(R.y-X.y)*(at.x-X.x)}function B(X){return typeof WorkerGlobalScope<"u"&&X!==void 0&&X instanceof WorkerGlobalScope}let U=null;function V(X){return typeof ImageBitmap<"u"&&X instanceof ImageBitmap}let W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function F(X,R,at,kt,jt){return i(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Qt=new VideoFrame(X,{timestamp:0});try{let re=Qt?.format;if(!re||!re.startsWith("BGR")&&!re.startsWith("RGB"))throw new Error(`Unrecognized format ${re}`);let Ae=re.startsWith("BGR"),$e=new Uint8ClampedArray(kt*jt*4);if(yield Qt.copyTo($e,function(or,Cr,$r,ln,kn){let Fn=4*Math.max(-Cr,0),Kn=(Math.max(0,$r)-$r)*ln*4+Fn,mi=4*ln,Ui=Math.max(0,Cr),Na=Math.max(0,$r);return{rect:{x:Ui,y:Na,width:Math.min(or.width,Cr+ln)-Ui,height:Math.min(or.height,$r+kn)-Na},layout:[{offset:Kn,stride:mi}]}}(X,R,at,kt,jt)),Ae)for(let or=0;or<$e.length;or+=4){let Cr=$e[or];$e[or]=$e[or+2],$e[or+2]=Cr}return $e}finally{Qt.close()}})}let H,q,G="AbortError";function tt(){return new Error(G)}let ht={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function bt(X){return ht.REGISTERED_PROTOCOLS[X.substring(0,X.indexOf("://"))]}let vt="global-dispatcher";class ut extends Error{constructor(R,at,kt,jt){super(`AJAXError: ${at} (${R}): ${kt}`),this.status=R,this.statusText=at,this.url=kt,this.body=jt}}let rt=()=>B(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,gt=function(X,R){if(/:\/\//.test(X.url)&&!/^https?:|^file:/.test(X.url)){let kt=bt(X.url);if(kt)return kt(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,targetMapId:vt},R)}if(!(/^file:/.test(at=X.url)||/^file:/.test(rt())&&!/^\w+:/.test(at))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(kt,jt){return i(this,void 0,void 0,function*(){let Qt=new Request(kt.url,{method:kt.method||"GET",body:kt.body,credentials:kt.credentials,headers:kt.headers,cache:kt.cache,referrer:rt(),signal:jt.signal});kt.type!=="json"||Qt.headers.has("Accept")||Qt.headers.set("Accept","application/json");let re=yield fetch(Qt);if(!re.ok){let or=yield re.blob();throw new ut(re.status,re.statusText,kt.url,or)}let Ae;Ae=kt.type==="arrayBuffer"||kt.type==="image"?re.arrayBuffer():kt.type==="json"?re.json():re.text();let $e=yield Ae;if(jt.signal.aborted)throw tt();return{data:$e,cacheControl:re.headers.get("Cache-Control"),expires:re.headers.get("Expires")}})}(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,mustQueue:!0,targetMapId:vt},R)}var at;return function(kt,jt){return new Promise((Qt,re)=>{var Ae;let $e=new XMLHttpRequest;$e.open(kt.method||"GET",kt.url,!0),kt.type!=="arrayBuffer"&&kt.type!=="image"||($e.responseType="arraybuffer");for(let or in kt.headers)$e.setRequestHeader(or,kt.headers[or]);kt.type==="json"&&($e.responseType="text",!((Ae=kt.headers)===null||Ae===void 0)&&Ae.Accept||$e.setRequestHeader("Accept","application/json")),$e.withCredentials=kt.credentials==="include",$e.onerror=()=>{re(new Error($e.statusText))},$e.onload=()=>{if(!jt.signal.aborted)if(($e.status>=200&&$e.status<300||$e.status===0)&&$e.response!==null){let or=$e.response;if(kt.type==="json")try{or=JSON.parse($e.response)}catch(Cr){return void re(Cr)}Qt({data:or,cacheControl:$e.getResponseHeader("Cache-Control"),expires:$e.getResponseHeader("Expires")})}else{let or=new Blob([$e.response],{type:$e.getResponseHeader("Content-Type")});re(new ut($e.status,$e.statusText,kt.url,or))}},jt.signal.addEventListener("abort",()=>{$e.abort(),re(tt())}),$e.send(kt.body)})}(X,R)};function it(X){if(!X||X.indexOf("://")<=0||X.indexOf("data:image/")===0||X.indexOf("blob:")===0)return!0;let R=new URL(X),at=window.location;return R.protocol===at.protocol&&R.host===at.host}function st(X,R,at){at[X]&&at[X].indexOf(R)!==-1||(at[X]=at[X]||[],at[X].push(R))}function xt(X,R,at){if(at&&at[X]){let kt=at[X].indexOf(R);kt!==-1&&at[X].splice(kt,1)}}class ot{constructor(R,at={}){E(this,at),this.type=R}}class J extends ot{constructor(R,at={}){super("error",E({error:R},at))}}class mt{on(R,at){return this._listeners=this._listeners||{},st(R,at,this._listeners),this}off(R,at){return xt(R,at,this._listeners),xt(R,at,this._oneTimeListeners),this}once(R,at){return at?(this._oneTimeListeners=this._oneTimeListeners||{},st(R,at,this._oneTimeListeners),this):new Promise(kt=>this.once(R,kt))}fire(R,at){typeof R=="string"&&(R=new ot(R,at||{}));let kt=R.type;if(this.listens(kt)){R.target=this;let jt=this._listeners&&this._listeners[kt]?this._listeners[kt].slice():[];for(let Ae of jt)Ae.call(this,R);let Qt=this._oneTimeListeners&&this._oneTimeListeners[kt]?this._oneTimeListeners[kt].slice():[];for(let Ae of Qt)xt(kt,Ae,this._oneTimeListeners),Ae.call(this,R);let re=this._eventedParent;re&&(E(R,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),re.fire(R))}else R instanceof J&&console.error(R.error);return this}listens(R){return this._listeners&&this._listeners[R]&&this._listeners[R].length>0||this._oneTimeListeners&&this._oneTimeListeners[R]&&this._oneTimeListeners[R].length>0||this._eventedParent&&this._eventedParent.listens(R)}setEventedParent(R,at){return this._eventedParent=R,this._eventedParentData=at,this}}var dt={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};let Ct=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Rt(X,R){let at={};for(let kt in X)kt!=="ref"&&(at[kt]=X[kt]);return Ct.forEach(kt=>{kt in R&&(at[kt]=R[kt])}),at}function Bt(X,R){if(Array.isArray(X)){if(!Array.isArray(R)||X.length!==R.length)return!1;for(let at=0;at`:X.itemType.kind==="value"?"array":`array<${R}>`}return X.kind}let zt=[ce,Le,Ze,Qe,mr,Er,fr,Xt(Jr),dn,_n,Oe];function _t(X,R){if(R.kind==="error")return null;if(X.kind==="array"){if(R.kind==="array"&&(R.N===0&&R.itemType.kind==="value"||!_t(X.itemType,R.itemType))&&(typeof X.N!="number"||X.N===R.N))return null}else{if(X.kind===R.kind)return null;if(X.kind==="value"){for(let at of zt)if(!_t(at,R))return null}}return`Expected ${oe(X)} but found ${oe(R)} instead.`}function Pt(X,R){return R.some(at=>at.kind===X.kind)}function Ht(X,R){return R.some(at=>at==="null"?X===null:at==="array"?Array.isArray(X):at==="object"?X&&!Array.isArray(X)&&typeof X=="object":at===typeof X)}function ae(X,R){return X.kind==="array"&&R.kind==="array"?X.itemType.kind===R.itemType.kind&&typeof X.N=="number":X.kind===R.kind}let he=.96422,Me=.82521,qe=4/29,Ye=6/29,ur=3*Ye*Ye,Rr=Ye*Ye*Ye,zr=Math.PI/180,xr=180/Math.PI;function pn(X){return(X%=360)<0&&(X+=360),X}function ci([X,R,at,kt]){let jt,Qt,re=yi((.2225045*(X=ui(X))+.7168786*(R=ui(R))+.0606169*(at=ui(at)))/1);X===R&&R===at?jt=Qt=re:(jt=yi((.4360747*X+.3850649*R+.1430804*at)/he),Qt=yi((.0139322*X+.0971045*R+.7141733*at)/Me));let Ae=116*re-16;return[Ae<0?0:Ae,500*(jt-re),200*(re-Qt),kt]}function ui(X){return X<=.04045?X/12.92:Math.pow((X+.055)/1.055,2.4)}function yi(X){return X>Rr?Math.pow(X,1/3):X/ur+qe}function Gi([X,R,at,kt]){let jt=(X+16)/116,Qt=isNaN(R)?jt:jt+R/500,re=isNaN(at)?jt:jt-at/200;return jt=1*fi(jt),Qt=he*fi(Qt),re=Me*fi(re),[Ci(3.1338561*Qt-1.6168667*jt-.4906146*re),Ci(-.9787684*Qt+1.9161415*jt+.033454*re),Ci(.0719453*Qt-.2289914*jt+1.4052427*re),kt]}function Ci(X){return(X=X<=.00304?12.92*X:1.055*Math.pow(X,1/2.4)-.055)<0?0:X>1?1:X}function fi(X){return X>Ye?X*X*X:ur*(X-qe)}function ba(X){return parseInt(X.padEnd(2,X),16)/255}function oa(X,R){return Ke(R?X/100:X,0,1)}function Ke(X,R,at){return Math.min(Math.max(R,X),at)}function sr(X){return!X.some(Number.isNaN)}let vr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Ar{constructor(R,at,kt,jt=1,Qt=!0){this.r=R,this.g=at,this.b=kt,this.a=jt,Qt||(this.r*=jt,this.g*=jt,this.b*=jt,jt||this.overwriteGetter("rgb",[R,at,kt,jt]))}static parse(R){if(R instanceof Ar)return R;if(typeof R!="string")return;let at=function(kt){if((kt=kt.toLowerCase().trim())==="transparent")return[0,0,0,0];let jt=vr[kt];if(jt){let[re,Ae,$e]=jt;return[re/255,Ae/255,$e/255,1]}if(kt.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(kt)){let re=kt.length<6?1:2,Ae=1;return[ba(kt.slice(Ae,Ae+=re)),ba(kt.slice(Ae,Ae+=re)),ba(kt.slice(Ae,Ae+=re)),ba(kt.slice(Ae,Ae+re)||"ff")]}if(kt.startsWith("rgb")){let re=kt.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(re){let[Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na]=re,fa=[Cr||" ",kn||" ",mi].join("");if(fa===" "||fa===" /"||fa===",,"||fa===",,,"){let La=[or,ln,Kn].join(""),ho=La==="%%%"?100:La===""?255:0;if(ho){let Ro=[Ke(+$e/ho,0,1),Ke(+$r/ho,0,1),Ke(+Fn/ho,0,1),Ui?oa(+Ui,Na):1];if(sr(Ro))return Ro}}return}}let Qt=kt.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Qt){let[re,Ae,$e,or,Cr,$r,ln,kn,Fn]=Qt,Kn=[$e||" ",Cr||" ",ln].join("");if(Kn===" "||Kn===" /"||Kn===",,"||Kn===",,,"){let mi=[+Ae,Ke(+or,0,100),Ke(+$r,0,100),kn?oa(+kn,Fn):1];if(sr(mi))return function([Ui,Na,fa,La]){function ho(Ro){let Os=(Ro+Ui/30)%12,Nl=Na*Math.min(fa,1-fa);return fa-Nl*Math.max(-1,Math.min(Os-3,9-Os,1))}return Ui=pn(Ui),Na/=100,fa/=100,[ho(0),ho(8),ho(4),La]}(mi)}}}(R);return at?new Ar(...at,!1):void 0}get rgb(){let{r:R,g:at,b:kt,a:jt}=this,Qt=jt||1/0;return this.overwriteGetter("rgb",[R/Qt,at/Qt,kt/Qt,jt])}get hcl(){return this.overwriteGetter("hcl",function(R){let[at,kt,jt,Qt]=ci(R),re=Math.sqrt(kt*kt+jt*jt);return[Math.round(1e4*re)?pn(Math.atan2(jt,kt)*xr):NaN,re,at,Qt]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ci(this.rgb))}overwriteGetter(R,at){return Object.defineProperty(this,R,{value:at}),at}toString(){let[R,at,kt,jt]=this.rgb;return`rgba(${[R,at,kt].map(Qt=>Math.round(255*Qt)).join(",")},${jt})`}}Ar.black=new Ar(0,0,0,1),Ar.white=new Ar(1,1,1,1),Ar.transparent=new Ar(0,0,0,0),Ar.red=new Ar(1,0,0,1);class mn{constructor(R,at,kt){this.sensitivity=R?at?"variant":"case":at?"accent":"base",this.locale=kt,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(R,at){return this.collator.compare(R,at)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Zn{constructor(R,at,kt,jt,Qt){this.text=R,this.image=at,this.scale=kt,this.fontStack=jt,this.textColor=Qt}}class Un{constructor(R){this.sections=R}static fromString(R){return new Un([new Zn(R,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(R=>R.text.length!==0||R.image&&R.image.name.length!==0)}static factory(R){return R instanceof Un?R:Un.fromString(R)}toString(){return this.sections.length===0?"":this.sections.map(R=>R.text).join("")}}class Wn{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Wn)return R;if(typeof R=="number")return new Wn([R,R,R,R]);if(Array.isArray(R)&&!(R.length<1||R.length>4)){for(let at of R)if(typeof at!="number")return;switch(R.length){case 1:R=[R[0],R[0],R[0],R[0]];break;case 2:R=[R[0],R[1],R[0],R[1]];break;case 3:R=[R[0],R[1],R[2],R[1]]}return new Wn(R)}}toString(){return JSON.stringify(this.values)}}let Li=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Fi{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Fi)return R;if(Array.isArray(R)&&!(R.length<1)&&R.length%2==0){for(let at=0;at=0&&X<=255&&typeof R=="number"&&R>=0&&R<=255&&typeof at=="number"&&at>=0&&at<=255?kt===void 0||typeof kt=="number"&&kt>=0&&kt<=1?null:`Invalid rgba value [${[X,R,at,kt].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof kt=="number"?[X,R,at,kt]:[X,R,at]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ca(X){if(X===null||typeof X=="string"||typeof X=="boolean"||typeof X=="number"||X instanceof Ar||X instanceof mn||X instanceof Un||X instanceof Wn||X instanceof Fi||X instanceof Zi)return!0;if(Array.isArray(X)){for(let R of X)if(!ca(R))return!1;return!0}if(typeof X=="object"){for(let R in X)if(!ca(X[R]))return!1;return!0}return!1}function Ei(X){if(X===null)return ce;if(typeof X=="string")return Ze;if(typeof X=="boolean")return Qe;if(typeof X=="number")return Le;if(X instanceof Ar)return mr;if(X instanceof mn)return an;if(X instanceof Un)return Er;if(X instanceof Wn)return dn;if(X instanceof Fi)return Oe;if(X instanceof Zi)return _n;if(Array.isArray(X)){let R=X.length,at;for(let kt of X){let jt=Ei(kt);if(at){if(at===jt)continue;at=Jr;break}at=jt}return Xt(at||Jr,R)}return fr}function Ga(X){let R=typeof X;return X===null?"":R==="string"||R==="number"||R==="boolean"?String(X):X instanceof Ar||X instanceof Un||X instanceof Wn||X instanceof Fi||X instanceof Zi?X.toString():JSON.stringify(X)}class so{constructor(R,at){this.type=R,this.value=at}static parse(R,at){if(R.length!==2)return at.error(`'literal' expression requires exactly one argument, but found ${R.length-1} instead.`);if(!ca(R[1]))return at.error("invalid value");let kt=R[1],jt=Ei(kt),Qt=at.expectedType;return jt.kind!=="array"||jt.N!==0||!Qt||Qt.kind!=="array"||typeof Qt.N=="number"&&Qt.N!==0||(jt=Qt),new so(jt,kt)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Fe{constructor(R){this.name="ExpressionEvaluationError",this.message=R}toJSON(){return this.message}}let Re={string:Ze,number:Le,boolean:Qe,object:fr};class Kr{constructor(R,at){this.type=R,this.args=at}static parse(R,at){if(R.length<2)return at.error("Expected at least one argument.");let kt,jt=1,Qt=R[0];if(Qt==="array"){let Ae,$e;if(R.length>2){let or=R[1];if(typeof or!="string"||!(or in Re)||or==="object")return at.error('The item type argument of "array" must be one of string, number, boolean',1);Ae=Re[or],jt++}else Ae=Jr;if(R.length>3){if(R[2]!==null&&(typeof R[2]!="number"||R[2]<0||R[2]!==Math.floor(R[2])))return at.error('The length argument to "array" must be a positive integer literal',2);$e=R[2],jt++}kt=Xt(Ae,$e)}else{if(!Re[Qt])throw new Error(`Types doesn't contain name = ${Qt}`);kt=Re[Qt]}let re=[];for(;jtR.outputDefined())}}let sn={"to-boolean":Qe,"to-color":mr,"to-number":Le,"to-string":Ze};class cn{constructor(R,at){this.type=R,this.args=at}static parse(R,at){if(R.length<2)return at.error("Expected at least one argument.");let kt=R[0];if(!sn[kt])throw new Error(`Can't parse ${kt} as it is not part of the known types`);if((kt==="to-boolean"||kt==="to-string")&&R.length!==2)return at.error("Expected one argument.");let jt=sn[kt],Qt=[];for(let re=1;re4?`Invalid rbga value ${JSON.stringify(at)}: expected an array containing either three or four numeric values.`:Ji(at[0],at[1],at[2],at[3]),!kt))return new Ar(at[0]/255,at[1]/255,at[2]/255,at[3])}throw new Fe(kt||`Could not parse color from value '${typeof at=="string"?at:JSON.stringify(at)}'`)}case"padding":{let at;for(let kt of this.args){at=kt.evaluate(R);let jt=Wn.parse(at);if(jt)return jt}throw new Fe(`Could not parse padding from value '${typeof at=="string"?at:JSON.stringify(at)}'`)}case"variableAnchorOffsetCollection":{let at;for(let kt of this.args){at=kt.evaluate(R);let jt=Fi.parse(at);if(jt)return jt}throw new Fe(`Could not parse variableAnchorOffsetCollection from value '${typeof at=="string"?at:JSON.stringify(at)}'`)}case"number":{let at=null;for(let kt of this.args){if(at=kt.evaluate(R),at===null)return 0;let jt=Number(at);if(!isNaN(jt))return jt}throw new Fe(`Could not convert ${JSON.stringify(at)} to number.`)}case"formatted":return Un.fromString(Ga(this.args[0].evaluate(R)));case"resolvedImage":return Zi.fromString(Ga(this.args[0].evaluate(R)));default:return Ga(this.args[0].evaluate(R))}}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}let Yr=["Unknown","Point","LineString","Polygon"];class un{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Yr[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(R){let at=this._parseColorCache[R];return at||(at=this._parseColorCache[R]=Ar.parse(R)),at}}class Pn{constructor(R,at,kt=[],jt,Qt=new be,re=[]){this.registry=R,this.path=kt,this.key=kt.map(Ae=>`[${Ae}]`).join(""),this.scope=Qt,this.errors=re,this.expectedType=jt,this._isConstant=at}parse(R,at,kt,jt,Qt={}){return at?this.concat(at,kt,jt)._parse(R,Qt):this._parse(R,Qt)}_parse(R,at){function kt(jt,Qt,re){return re==="assert"?new Kr(Qt,[jt]):re==="coerce"?new cn(Qt,[jt]):jt}if(R!==null&&typeof R!="string"&&typeof R!="boolean"&&typeof R!="number"||(R=["literal",R]),Array.isArray(R)){if(R.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let jt=R[0];if(typeof jt!="string")return this.error(`Expression name must be a string, but found ${typeof jt} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Qt=this.registry[jt];if(Qt){let re=Qt.parse(R,this);if(!re)return null;if(this.expectedType){let Ae=this.expectedType,$e=re.type;if(Ae.kind!=="string"&&Ae.kind!=="number"&&Ae.kind!=="boolean"&&Ae.kind!=="object"&&Ae.kind!=="array"||$e.kind!=="value")if(Ae.kind!=="color"&&Ae.kind!=="formatted"&&Ae.kind!=="resolvedImage"||$e.kind!=="value"&&$e.kind!=="string")if(Ae.kind!=="padding"||$e.kind!=="value"&&$e.kind!=="number"&&$e.kind!=="array")if(Ae.kind!=="variableAnchorOffsetCollection"||$e.kind!=="value"&&$e.kind!=="array"){if(this.checkSubtype(Ae,$e))return null}else re=kt(re,Ae,at.typeAnnotation||"coerce");else re=kt(re,Ae,at.typeAnnotation||"coerce");else re=kt(re,Ae,at.typeAnnotation||"coerce");else re=kt(re,Ae,at.typeAnnotation||"assert")}if(!(re instanceof so)&&re.type.kind!=="resolvedImage"&&this._isConstant(re)){let Ae=new un;try{re=new so(re.type,re.evaluate(Ae))}catch($e){return this.error($e.message),null}}return re}return this.error(`Unknown expression "${jt}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(R===void 0?"'undefined' value invalid. Use null instead.":typeof R=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof R} instead.`)}concat(R,at,kt){let jt=typeof R=="number"?this.path.concat(R):this.path,Qt=kt?this.scope.concat(kt):this.scope;return new Pn(this.registry,this._isConstant,jt,at||null,Qt,this.errors)}error(R,...at){let kt=`${this.key}${at.map(jt=>`[${jt}]`).join("")}`;this.errors.push(new ie(kt,R))}checkSubtype(R,at){let kt=_t(R,at);return kt&&this.error(kt),kt}}class bn{constructor(R,at){this.type=at.type,this.bindings=[].concat(R),this.result=at}evaluate(R){return this.result.evaluate(R)}eachChild(R){for(let at of this.bindings)R(at[1]);R(this.result)}static parse(R,at){if(R.length<4)return at.error(`Expected at least 3 arguments, but found ${R.length-1} instead.`);let kt=[];for(let Qt=1;Qt=kt.length)throw new Fe(`Array index out of bounds: ${at} > ${kt.length-1}.`);if(at!==Math.floor(at))throw new Fe(`Array index must be an integer, but found ${at} instead.`);return kt[at]}eachChild(R){R(this.index),R(this.input)}outputDefined(){return!1}}class en{constructor(R,at){this.type=Qe,this.needle=R,this.haystack=at}static parse(R,at){if(R.length!==3)return at.error(`Expected 2 arguments, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1,Jr),jt=at.parse(R[2],2,Jr);return kt&&jt?Pt(kt.type,[Qe,Ze,Le,ce,Jr])?new en(kt,jt):at.error(`Expected first argument to be of type boolean, string, number or null, but found ${oe(kt.type)} instead`):null}evaluate(R){let at=this.needle.evaluate(R),kt=this.haystack.evaluate(R);if(!kt)return!1;if(!Ht(at,["boolean","string","number","null"]))throw new Fe(`Expected first argument to be of type boolean, string, number or null, but found ${oe(Ei(at))} instead.`);if(!Ht(kt,["string","array"]))throw new Fe(`Expected second argument to be of type array or string, but found ${oe(Ei(kt))} instead.`);return kt.indexOf(at)>=0}eachChild(R){R(this.needle),R(this.haystack)}outputDefined(){return!0}}class Rn{constructor(R,at,kt){this.type=Le,this.needle=R,this.haystack=at,this.fromIndex=kt}static parse(R,at){if(R.length<=2||R.length>=5)return at.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1,Jr),jt=at.parse(R[2],2,Jr);if(!kt||!jt)return null;if(!Pt(kt.type,[Qe,Ze,Le,ce,Jr]))return at.error(`Expected first argument to be of type boolean, string, number or null, but found ${oe(kt.type)} instead`);if(R.length===4){let Qt=at.parse(R[3],3,Le);return Qt?new Rn(kt,jt,Qt):null}return new Rn(kt,jt)}evaluate(R){let at=this.needle.evaluate(R),kt=this.haystack.evaluate(R);if(!Ht(at,["boolean","string","number","null"]))throw new Fe(`Expected first argument to be of type boolean, string, number or null, but found ${oe(Ei(at))} instead.`);let jt;if(this.fromIndex&&(jt=this.fromIndex.evaluate(R)),Ht(kt,["string"])){let Qt=kt.indexOf(at,jt);return Qt===-1?-1:[...kt.slice(0,Qt)].length}if(Ht(kt,["array"]))return kt.indexOf(at,jt);throw new Fe(`Expected second argument to be of type array or string, but found ${oe(Ei(kt))} instead.`)}eachChild(R){R(this.needle),R(this.haystack),this.fromIndex&&R(this.fromIndex)}outputDefined(){return!1}}class ni{constructor(R,at,kt,jt,Qt,re){this.inputType=R,this.type=at,this.input=kt,this.cases=jt,this.outputs=Qt,this.otherwise=re}static parse(R,at){if(R.length<5)return at.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if(R.length%2!=1)return at.error("Expected an even number of arguments.");let kt,jt;at.expectedType&&at.expectedType.kind!=="value"&&(jt=at.expectedType);let Qt={},re=[];for(let or=2;orNumber.MAX_SAFE_INTEGER)return ln.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Fn=="number"&&Math.floor(Fn)!==Fn)return ln.error("Numeric branch labels must be integer values.");if(kt){if(ln.checkSubtype(kt,Ei(Fn)))return null}else kt=Ei(Fn);if(Qt[String(Fn)]!==void 0)return ln.error("Branch labels must be unique.");Qt[String(Fn)]=re.length}let kn=at.parse($r,or,jt);if(!kn)return null;jt=jt||kn.type,re.push(kn)}let Ae=at.parse(R[1],1,Jr);if(!Ae)return null;let $e=at.parse(R[R.length-1],R.length-1,jt);return $e?Ae.type.kind!=="value"&&at.concat(1).checkSubtype(kt,Ae.type)?null:new ni(kt,jt,Ae,Qt,re,$e):null}evaluate(R){let at=this.input.evaluate(R);return(Ei(at)===this.inputType&&this.outputs[this.cases[at]]||this.otherwise).evaluate(R)}eachChild(R){R(this.input),this.outputs.forEach(R),R(this.otherwise)}outputDefined(){return this.outputs.every(R=>R.outputDefined())&&this.otherwise.outputDefined()}}class xi{constructor(R,at,kt){this.type=R,this.branches=at,this.otherwise=kt}static parse(R,at){if(R.length<4)return at.error(`Expected at least 3 arguments, but found only ${R.length-1}.`);if(R.length%2!=0)return at.error("Expected an odd number of arguments.");let kt;at.expectedType&&at.expectedType.kind!=="value"&&(kt=at.expectedType);let jt=[];for(let re=1;reat.outputDefined())&&this.otherwise.outputDefined()}}class Jn{constructor(R,at,kt,jt){this.type=R,this.input=at,this.beginIndex=kt,this.endIndex=jt}static parse(R,at){if(R.length<=2||R.length>=5)return at.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1,Jr),jt=at.parse(R[2],2,Le);if(!kt||!jt)return null;if(!Pt(kt.type,[Xt(Jr),Ze,Jr]))return at.error(`Expected first argument to be of type array or string, but found ${oe(kt.type)} instead`);if(R.length===4){let Qt=at.parse(R[3],3,Le);return Qt?new Jn(kt.type,kt,jt,Qt):null}return new Jn(kt.type,kt,jt)}evaluate(R){let at=this.input.evaluate(R),kt=this.beginIndex.evaluate(R),jt;if(this.endIndex&&(jt=this.endIndex.evaluate(R)),Ht(at,["string"]))return[...at].slice(kt,jt).join("");if(Ht(at,["array"]))return at.slice(kt,jt);throw new Fe(`Expected first argument to be of type array or string, but found ${oe(Ei(at))} instead.`)}eachChild(R){R(this.input),R(this.beginIndex),this.endIndex&&R(this.endIndex)}outputDefined(){return!1}}function Gn(X,R){let at=X.length-1,kt,jt,Qt=0,re=at,Ae=0;for(;Qt<=re;)if(Ae=Math.floor((Qt+re)/2),kt=X[Ae],jt=X[Ae+1],kt<=R){if(Ae===at||RR))throw new Fe("Input is not a number.");re=Ae-1}return 0}class pi{constructor(R,at,kt){this.type=R,this.input=at,this.labels=[],this.outputs=[];for(let[jt,Qt]of kt)this.labels.push(jt),this.outputs.push(Qt)}static parse(R,at){if(R.length-1<4)return at.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return at.error("Expected an even number of arguments.");let kt=at.parse(R[1],1,Le);if(!kt)return null;let jt=[],Qt=null;at.expectedType&&at.expectedType.kind!=="value"&&(Qt=at.expectedType);for(let re=1;re=Ae)return at.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',or);let $r=at.parse($e,Cr,Qt);if(!$r)return null;Qt=Qt||$r.type,jt.push([Ae,$r])}return new pi(Qt,kt,jt)}evaluate(R){let at=this.labels,kt=this.outputs;if(at.length===1)return kt[0].evaluate(R);let jt=this.input.evaluate(R);if(jt<=at[0])return kt[0].evaluate(R);let Qt=at.length;return jt>=at[Qt-1]?kt[Qt-1].evaluate(R):kt[Gn(at,jt)].evaluate(R)}eachChild(R){R(this.input);for(let at of this.outputs)R(at)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function Va(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}var ea=go;function go(X,R,at,kt){this.cx=3*X,this.bx=3*(at-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(kt-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=at,this.p2y=kt}go.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var at=X,kt=0;kt<8;kt++){var jt=this.sampleCurveX(at)-X;if(Math.abs(jt)jt?re=at:Ae=at,at=.5*(Ae-re)+re;return at},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var mo=Va(ea);function Go(X,R,at){return X+at*(R-X)}function Lo(X,R,at){return X.map((kt,jt)=>Go(kt,R[jt],at))}let Zo={number:Go,color:function(X,R,at,kt="rgb"){switch(kt){case"rgb":{let[jt,Qt,re,Ae]=Lo(X.rgb,R.rgb,at);return new Ar(jt,Qt,re,Ae,!1)}case"hcl":{let[jt,Qt,re,Ae]=X.hcl,[$e,or,Cr,$r]=R.hcl,ln,kn;if(isNaN(jt)||isNaN($e))isNaN(jt)?isNaN($e)?ln=NaN:(ln=$e,re!==1&&re!==0||(kn=or)):(ln=jt,Cr!==1&&Cr!==0||(kn=Qt));else{let Na=$e-jt;$e>jt&&Na>180?Na-=360:$e180&&(Na+=360),ln=jt+at*Na}let[Fn,Kn,mi,Ui]=function([Na,fa,La,ho]){return Na=isNaN(Na)?0:Na*zr,Gi([La,Math.cos(Na)*fa,Math.sin(Na)*fa,ho])}([ln,kn??Go(Qt,or,at),Go(re,Cr,at),Go(Ae,$r,at)]);return new Ar(Fn,Kn,mi,Ui,!1)}case"lab":{let[jt,Qt,re,Ae]=Gi(Lo(X.lab,R.lab,at));return new Ar(jt,Qt,re,Ae,!1)}}},array:Lo,padding:function(X,R,at){return new Wn(Lo(X.values,R.values,at))},variableAnchorOffsetCollection:function(X,R,at){let kt=X.values,jt=R.values;if(kt.length!==jt.length)throw new Fe(`Cannot interpolate values of different length. from: ${X.toString()}, to: ${R.toString()}`);let Qt=[];for(let re=0;retypeof Cr!="number"||Cr<0||Cr>1))return at.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);jt={name:"cubic-bezier",controlPoints:or}}}if(R.length-1<4)return at.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return at.error("Expected an even number of arguments.");if(Qt=at.parse(Qt,2,Le),!Qt)return null;let Ae=[],$e=null;kt==="interpolate-hcl"||kt==="interpolate-lab"?$e=mr:at.expectedType&&at.expectedType.kind!=="value"&&($e=at.expectedType);for(let or=0;or=Cr)return at.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ln);let Fn=at.parse($r,kn,$e);if(!Fn)return null;$e=$e||Fn.type,Ae.push([Cr,Fn])}return ae($e,Le)||ae($e,mr)||ae($e,dn)||ae($e,Oe)||ae($e,Xt(Le))?new Ka($e,kt,jt,Qt,Ae):at.error(`Type ${oe($e)} is not interpolatable.`)}evaluate(R){let at=this.labels,kt=this.outputs;if(at.length===1)return kt[0].evaluate(R);let jt=this.input.evaluate(R);if(jt<=at[0])return kt[0].evaluate(R);let Qt=at.length;if(jt>=at[Qt-1])return kt[Qt-1].evaluate(R);let re=Gn(at,jt),Ae=Ka.interpolationFactor(this.interpolation,jt,at[re],at[re+1]),$e=kt[re].evaluate(R),or=kt[re+1].evaluate(R);switch(this.operator){case"interpolate":return Zo[this.type.kind]($e,or,Ae);case"interpolate-hcl":return Zo.color($e,or,Ae,"hcl");case"interpolate-lab":return Zo.color($e,or,Ae,"lab")}}eachChild(R){R(this.input);for(let at of this.outputs)R(at)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function Cs(X,R,at,kt){let jt=kt-at,Qt=X-at;return jt===0?0:R===1?Qt/jt:(Math.pow(R,Qt)-1)/(Math.pow(R,jt)-1)}class ps{constructor(R,at){this.type=R,this.args=at}static parse(R,at){if(R.length<2)return at.error("Expectected at least one argument.");let kt=null,jt=at.expectedType;jt&&jt.kind!=="value"&&(kt=jt);let Qt=[];for(let Ae of R.slice(1)){let $e=at.parse(Ae,1+Qt.length,kt,void 0,{typeAnnotation:"omit"});if(!$e)return null;kt=kt||$e.type,Qt.push($e)}if(!kt)throw new Error("No output type");let re=jt&&Qt.some(Ae=>_t(jt,Ae.type));return new ps(re?Jr:kt,Qt)}evaluate(R){let at,kt=null,jt=0;for(let Qt of this.args)if(jt++,kt=Qt.evaluate(R),kt&&kt instanceof Zi&&!kt.available&&(at||(at=kt.name),kt=null,jt===this.args.length&&(kt=at)),kt!==null)break;return kt}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}function wl(X,R){return X==="=="||X==="!="?R.kind==="boolean"||R.kind==="string"||R.kind==="number"||R.kind==="null"||R.kind==="value":R.kind==="string"||R.kind==="number"||R.kind==="value"}function is(X,R,at,kt){return kt.compare(R,at)===0}function ol(X,R,at){let kt=X!=="=="&&X!=="!=";return class HH{constructor(Qt,re,Ae){this.type=Qe,this.lhs=Qt,this.rhs=re,this.collator=Ae,this.hasUntypedArgument=Qt.type.kind==="value"||re.type.kind==="value"}static parse(Qt,re){if(Qt.length!==3&&Qt.length!==4)return re.error("Expected two or three arguments.");let Ae=Qt[0],$e=re.parse(Qt[1],1,Jr);if(!$e)return null;if(!wl(Ae,$e.type))return re.concat(1).error(`"${Ae}" comparisons are not supported for type '${oe($e.type)}'.`);let or=re.parse(Qt[2],2,Jr);if(!or)return null;if(!wl(Ae,or.type))return re.concat(2).error(`"${Ae}" comparisons are not supported for type '${oe(or.type)}'.`);if($e.type.kind!==or.type.kind&&$e.type.kind!=="value"&&or.type.kind!=="value")return re.error(`Cannot compare types '${oe($e.type)}' and '${oe(or.type)}'.`);kt&&($e.type.kind==="value"&&or.type.kind!=="value"?$e=new Kr(or.type,[$e]):$e.type.kind!=="value"&&or.type.kind==="value"&&(or=new Kr($e.type,[or])));let Cr=null;if(Qt.length===4){if($e.type.kind!=="string"&&or.type.kind!=="string"&&$e.type.kind!=="value"&&or.type.kind!=="value")return re.error("Cannot use collator to compare non-string types.");if(Cr=re.parse(Qt[3],3,an),!Cr)return null}return new HH($e,or,Cr)}evaluate(Qt){let re=this.lhs.evaluate(Qt),Ae=this.rhs.evaluate(Qt);if(kt&&this.hasUntypedArgument){let $e=Ei(re),or=Ei(Ae);if($e.kind!==or.kind||$e.kind!=="string"&&$e.kind!=="number")throw new Fe(`Expected arguments for "${X}" to be (string, string) or (number, number), but found (${$e.kind}, ${or.kind}) instead.`)}if(this.collator&&!kt&&this.hasUntypedArgument){let $e=Ei(re),or=Ei(Ae);if($e.kind!=="string"||or.kind!=="string")return R(Qt,re,Ae)}return this.collator?at(Qt,re,Ae,this.collator.evaluate(Qt)):R(Qt,re,Ae)}eachChild(Qt){Qt(this.lhs),Qt(this.rhs),this.collator&&Qt(this.collator)}outputDefined(){return!0}}}let ms=ol("==",function(X,R,at){return R===at},is),kl=ol("!=",function(X,R,at){return R!==at},function(X,R,at,kt){return!is(0,R,at,kt)}),ul=ol("<",function(X,R,at){return R",function(X,R,at){return R>at},function(X,R,at,kt){return kt.compare(R,at)>0}),vs=ol("<=",function(X,R,at){return R<=at},function(X,R,at,kt){return kt.compare(R,at)<=0}),Ns=ol(">=",function(X,R,at){return R>=at},function(X,R,at,kt){return kt.compare(R,at)>=0});class Uo{constructor(R,at,kt){this.type=an,this.locale=kt,this.caseSensitive=R,this.diacriticSensitive=at}static parse(R,at){if(R.length!==2)return at.error("Expected one argument.");let kt=R[1];if(typeof kt!="object"||Array.isArray(kt))return at.error("Collator options argument must be an object.");let jt=at.parse(kt["case-sensitive"]!==void 0&&kt["case-sensitive"],1,Qe);if(!jt)return null;let Qt=at.parse(kt["diacritic-sensitive"]!==void 0&&kt["diacritic-sensitive"],1,Qe);if(!Qt)return null;let re=null;return kt.locale&&(re=at.parse(kt.locale,1,Ze),!re)?null:new Uo(jt,Qt,re)}evaluate(R){return new mn(this.caseSensitive.evaluate(R),this.diacriticSensitive.evaluate(R),this.locale?this.locale.evaluate(R):null)}eachChild(R){R(this.caseSensitive),R(this.diacriticSensitive),this.locale&&R(this.locale)}outputDefined(){return!1}}class Ds{constructor(R,at,kt,jt,Qt){this.type=Ze,this.number=R,this.locale=at,this.currency=kt,this.minFractionDigits=jt,this.maxFractionDigits=Qt}static parse(R,at){if(R.length!==3)return at.error("Expected two arguments.");let kt=at.parse(R[1],1,Le);if(!kt)return null;let jt=R[2];if(typeof jt!="object"||Array.isArray(jt))return at.error("NumberFormat options argument must be an object.");let Qt=null;if(jt.locale&&(Qt=at.parse(jt.locale,1,Ze),!Qt))return null;let re=null;if(jt.currency&&(re=at.parse(jt.currency,1,Ze),!re))return null;let Ae=null;if(jt["min-fraction-digits"]&&(Ae=at.parse(jt["min-fraction-digits"],1,Le),!Ae))return null;let $e=null;return jt["max-fraction-digits"]&&($e=at.parse(jt["max-fraction-digits"],1,Le),!$e)?null:new Ds(kt,Qt,re,Ae,$e)}evaluate(R){return new Intl.NumberFormat(this.locale?this.locale.evaluate(R):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(R):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(R):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(R):void 0}).format(this.number.evaluate(R))}eachChild(R){R(this.number),this.locale&&R(this.locale),this.currency&&R(this.currency),this.minFractionDigits&&R(this.minFractionDigits),this.maxFractionDigits&&R(this.maxFractionDigits)}outputDefined(){return!1}}class Ol{constructor(R){this.type=Er,this.sections=R}static parse(R,at){if(R.length<2)return at.error("Expected at least one argument.");let kt=R[1];if(!Array.isArray(kt)&&typeof kt=="object")return at.error("First argument must be an image or text section.");let jt=[],Qt=!1;for(let re=1;re<=R.length-1;++re){let Ae=R[re];if(Qt&&typeof Ae=="object"&&!Array.isArray(Ae)){Qt=!1;let $e=null;if(Ae["font-scale"]&&($e=at.parse(Ae["font-scale"],1,Le),!$e))return null;let or=null;if(Ae["text-font"]&&(or=at.parse(Ae["text-font"],1,Xt(Ze)),!or))return null;let Cr=null;if(Ae["text-color"]&&(Cr=at.parse(Ae["text-color"],1,mr),!Cr))return null;let $r=jt[jt.length-1];$r.scale=$e,$r.font=or,$r.textColor=Cr}else{let $e=at.parse(R[re],1,Jr);if(!$e)return null;let or=$e.type.kind;if(or!=="string"&&or!=="value"&&or!=="null"&&or!=="resolvedImage")return at.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Qt=!0,jt.push({content:$e,scale:null,font:null,textColor:null})}}return new Ol(jt)}evaluate(R){return new Un(this.sections.map(at=>{let kt=at.content.evaluate(R);return Ei(kt)===_n?new Zn("",kt,null,null,null):new Zn(Ga(kt),null,at.scale?at.scale.evaluate(R):null,at.font?at.font.evaluate(R).join(","):null,at.textColor?at.textColor.evaluate(R):null)}))}eachChild(R){for(let at of this.sections)R(at.content),at.scale&&R(at.scale),at.font&&R(at.font),at.textColor&&R(at.textColor)}outputDefined(){return!1}}class tc{constructor(R){this.type=_n,this.input=R}static parse(R,at){if(R.length!==2)return at.error("Expected two arguments.");let kt=at.parse(R[1],1,Ze);return kt?new tc(kt):at.error("No image name provided.")}evaluate(R){let at=this.input.evaluate(R),kt=Zi.fromString(at);return kt&&R.availableImages&&(kt.available=R.availableImages.indexOf(at)>-1),kt}eachChild(R){R(this.input)}outputDefined(){return!1}}class sc{constructor(R){this.type=Le,this.input=R}static parse(R,at){if(R.length!==2)return at.error(`Expected 1 argument, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1);return kt?kt.type.kind!=="array"&&kt.type.kind!=="string"&&kt.type.kind!=="value"?at.error(`Expected argument of type string or array, but found ${oe(kt.type)} instead.`):new sc(kt):null}evaluate(R){let at=this.input.evaluate(R);if(typeof at=="string")return[...at].length;if(Array.isArray(at))return at.length;throw new Fe(`Expected value to be of type string or array, but found ${oe(Ei(at))} instead.`)}eachChild(R){R(this.input)}outputDefined(){return!1}}let Xs=8192;function Wa(X,R){let at=(180+X[0])/360,kt=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X[1]*Math.PI/360)))/360,jt=Math.pow(2,R.z);return[Math.round(at*jt*Xs),Math.round(kt*jt*Xs)]}function Co(X,R){let at=Math.pow(2,R.z);return[(jt=(X[0]/Xs+R.x)/at,360*jt-180),(kt=(X[1]/Xs+R.y)/at,360/Math.PI*Math.atan(Math.exp((180-360*kt)*Math.PI/180))-90)];var kt,jt}function el(X,R){X[0]=Math.min(X[0],R[0]),X[1]=Math.min(X[1],R[1]),X[2]=Math.max(X[2],R[0]),X[3]=Math.max(X[3],R[1])}function lc(X,R){return!(X[0]<=R[0]||X[2]>=R[2]||X[1]<=R[1]||X[3]>=R[3])}function ss(X,R,at){let kt=X[0]-R[0],jt=X[1]-R[1],Qt=X[0]-at[0],re=X[1]-at[1];return kt*re-Qt*jt==0&&kt*Qt<=0&&jt*re<=0}function nc(X,R,at,kt){return(jt=[kt[0]-at[0],kt[1]-at[1]])[0]*(Qt=[R[0]-X[0],R[1]-X[1]])[1]-jt[1]*Qt[0]!=0&&!(!js(X,R,at,kt)||!js(at,kt,X,R));var jt,Qt}function yl(X,R,at){for(let kt of at)for(let jt=0;jt(jt=X)[1]!=(re=Ae[$e+1])[1]>jt[1]&&jt[0]<(re[0]-Qt[0])*(jt[1]-Qt[1])/(re[1]-Qt[1])+Qt[0]&&(kt=!kt)}var jt,Qt,re;return kt}function Gc(X,R){for(let at of R)if($l(X,at))return!0;return!1}function ko(X,R){for(let at of X)if(!$l(at,R))return!1;for(let at=0;at0&&Ae<0||re<0&&Ae>0}function mc(X,R,at){let kt=[];for(let jt=0;jtat[2]){let jt=.5*kt,Qt=X[0]-at[0]>jt?-kt:at[0]-X[0]>jt?kt:0;Qt===0&&(Qt=X[0]-at[2]>jt?-kt:at[2]-X[0]>jt?kt:0),X[0]+=Qt}el(R,X)}function Rc(X,R,at,kt){let jt=Math.pow(2,kt.z)*Xs,Qt=[kt.x*Xs,kt.y*Xs],re=[];for(let Ae of X)for(let $e of Ae){let or=[$e.x+Qt[0],$e.y+Qt[1]];us(or,R,at,jt),re.push(or)}return re}function iu(X,R,at,kt){let jt=Math.pow(2,kt.z)*Xs,Qt=[kt.x*Xs,kt.y*Xs],re=[];for(let $e of X){let or=[];for(let Cr of $e){let $r=[Cr.x+Qt[0],Cr.y+Qt[1]];el(R,$r),or.push($r)}re.push(or)}if(R[2]-R[0]<=jt/2){(Ae=R)[0]=Ae[1]=1/0,Ae[2]=Ae[3]=-1/0;for(let $e of re)for(let or of $e)us(or,R,at,jt)}var Ae;return re}class Dl{constructor(R,at){this.type=Qe,this.geojson=R,this.geometries=at}static parse(R,at){if(R.length!==2)return at.error(`'within' expression requires exactly one argument, but found ${R.length-1} instead.`);if(ca(R[1])){let kt=R[1];if(kt.type==="FeatureCollection"){let jt=[];for(let Qt of kt.features){let{type:re,coordinates:Ae}=Qt.geometry;re==="Polygon"&&jt.push(Ae),re==="MultiPolygon"&&jt.push(...Ae)}if(jt.length)return new Dl(kt,{type:"MultiPolygon",coordinates:jt})}else if(kt.type==="Feature"){let jt=kt.geometry.type;if(jt==="Polygon"||jt==="MultiPolygon")return new Dl(kt,kt.geometry)}else if(kt.type==="Polygon"||kt.type==="MultiPolygon")return new Dl(kt,kt)}return at.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(at,kt){let jt=[1/0,1/0,-1/0,-1/0],Qt=[1/0,1/0,-1/0,-1/0],re=at.canonicalID();if(kt.type==="Polygon"){let Ae=mc(kt.coordinates,Qt,re),$e=Rc(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!$l(or,Ae))return!1}if(kt.type==="MultiPolygon"){let Ae=Tl(kt.coordinates,Qt,re),$e=Rc(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!Gc(or,Ae))return!1}return!0}(R,this.geometries);if(R.geometryType()==="LineString")return function(at,kt){let jt=[1/0,1/0,-1/0,-1/0],Qt=[1/0,1/0,-1/0,-1/0],re=at.canonicalID();if(kt.type==="Polygon"){let Ae=mc(kt.coordinates,Qt,re),$e=iu(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!ko(or,Ae))return!1}if(kt.type==="MultiPolygon"){let Ae=Tl(kt.coordinates,Qt,re),$e=iu(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!zs(or,Ae))return!1}return!0}(R,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let ql=class{constructor(X=[],R=(at,kt)=>atkt?1:0){if(this.data=X,this.length=this.data.length,this.compare=R,this.length>0)for(let at=(this.length>>1)-1;at>=0;at--)this._down(at)}push(X){this.data.push(X),this._up(this.length++)}pop(){if(this.length===0)return;let X=this.data[0],R=this.data.pop();return--this.length>0&&(this.data[0]=R,this._down(0)),X}peek(){return this.data[0]}_up(X){let{data:R,compare:at}=this,kt=R[X];for(;X>0;){let jt=X-1>>1,Qt=R[jt];if(at(kt,Qt)>=0)break;R[X]=Qt,X=jt}R[X]=kt}_down(X){let{data:R,compare:at}=this,kt=this.length>>1,jt=R[X];for(;X=0)break;R[X]=R[Qt],X=Qt}R[X]=jt}};function cc(X,R,at,kt,jt){dc(X,R,at,kt||X.length-1,jt||Ah)}function dc(X,R,at,kt,jt){for(;kt>at;){if(kt-at>600){var Qt=kt-at+1,re=R-at+1,Ae=Math.log(Qt),$e=.5*Math.exp(2*Ae/3),or=.5*Math.sqrt(Ae*$e*(Qt-$e)/Qt)*(re-Qt/2<0?-1:1);dc(X,R,Math.max(at,Math.floor(R-re*$e/Qt+or)),Math.min(kt,Math.floor(R+(Qt-re)*$e/Qt+or)),jt)}var Cr=X[R],$r=at,ln=kt;for(pu(X,at,R),jt(X[kt],Cr)>0&&pu(X,at,kt);$r0;)ln--}jt(X[at],Cr)===0?pu(X,at,ln):pu(X,++ln,kt),ln<=R&&(at=ln+1),R<=ln&&(kt=ln-1)}}function pu(X,R,at){var kt=X[R];X[R]=X[at],X[at]=kt}function Ah(X,R){return XR?1:0}function uh(X,R){if(X.length<=1)return[X];let at=[],kt,jt;for(let Qt of X){let re=tf(Qt);re!==0&&(Qt.area=Math.abs(re),jt===void 0&&(jt=re<0),jt===re<0?(kt&&at.push(kt),kt=[Qt]):kt.push(Qt))}if(kt&&at.push(kt),R>1)for(let Qt=0;Qt1?(or=R[$e+1][0],Cr=R[$e+1][1]):kn>0&&(or+=$r/this.kx*kn,Cr+=ln/this.ky*kn)),$r=this.wrap(at[0]-or)*this.kx,ln=(at[1]-Cr)*this.ky;let Fn=$r*$r+ln*ln;Fn180;)R-=360;return R}}function xu(X,R){return R[0]-X[0]}function mu(X){return X[1]-X[0]+1}function bu(X,R){return X[1]>=X[0]&&X[1]X[1])return[null,null];let at=mu(X);if(R){if(at===2)return[X,null];let jt=Math.floor(at/2);return[[X[0],X[0]+jt],[X[0]+jt,X[1]]]}if(at===1)return[X,null];let kt=Math.floor(at/2)-1;return[[X[0],X[0]+kt],[X[0]+kt+1,X[1]]]}function _c(X,R){if(!bu(R,X.length))return[1/0,1/0,-1/0,-1/0];let at=[1/0,1/0,-1/0,-1/0];for(let kt=R[0];kt<=R[1];++kt)el(at,X[kt]);return at}function gu(X){let R=[1/0,1/0,-1/0,-1/0];for(let at of X)for(let kt of at)el(R,kt);return R}function pl(X){return X[0]!==-1/0&&X[1]!==-1/0&&X[2]!==1/0&&X[3]!==1/0}function ic(X,R,at){if(!pl(X)||!pl(R))return NaN;let kt=0,jt=0;return X[2]R[2]&&(kt=X[0]-R[2]),X[1]>R[3]&&(jt=X[1]-R[3]),X[3]=kt)return kt;if(lc(jt,Qt)){if(pp(X,R))return 0}else if(pp(R,X))return 0;let re=1/0;for(let Ae of X)for(let $e=0,or=Ae.length,Cr=or-1;$e0;){let $e=re.pop();if($e[0]>=Qt)continue;let or=$e[1],Cr=R?50:100;if(mu(or)<=Cr){if(!bu(or,X.length))return NaN;if(R){let $r=hl(X,or,at,kt);if(isNaN($r)||$r===0)return $r;Qt=Math.min(Qt,$r)}else for(let $r=or[0];$r<=or[1];++$r){let ln=Xf(X[$r],at,kt);if(Qt=Math.min(Qt,ln),Qt===0)return 0}}else{let $r=_h(or,R);cs(re,Qt,kt,X,Ae,$r[0]),cs(re,Qt,kt,X,Ae,$r[1])}}return Qt}function hu(X,R,at,kt,jt,Qt=1/0){let re=Math.min(Qt,jt.distance(X[0],at[0]));if(re===0)return re;let Ae=new ql([[0,[0,X.length-1],[0,at.length-1]]],xu);for(;Ae.length>0;){let $e=Ae.pop();if($e[0]>=re)continue;let or=$e[1],Cr=$e[2],$r=R?50:100,ln=kt?50:100;if(mu(or)<=$r&&mu(Cr)<=ln){if(!bu(or,X.length)&&bu(Cr,at.length))return NaN;let kn;if(R&&kt)kn=Qh(X,or,at,Cr,jt),re=Math.min(re,kn);else if(R&&!kt){let Fn=X.slice(or[0],or[1]+1);for(let Kn=Cr[0];Kn<=Cr[1];++Kn)if(kn=jh(at[Kn],Fn,jt),re=Math.min(re,kn),re===0)return re}else if(!R&&kt){let Fn=at.slice(Cr[0],Cr[1]+1);for(let Kn=or[0];Kn<=or[1];++Kn)if(kn=jh(X[Kn],Fn,jt),re=Math.min(re,kn),re===0)return re}else kn=Lc(X,or,at,Cr,jt),re=Math.min(re,kn)}else{let kn=_h(or,R),Fn=_h(Cr,kt);_d(Ae,re,jt,X,at,kn[0],Fn[0]),_d(Ae,re,jt,X,at,kn[0],Fn[1]),_d(Ae,re,jt,X,at,kn[1],Fn[0]),_d(Ae,re,jt,X,at,kn[1],Fn[1])}}return re}function rf(X){return X.type==="MultiPolygon"?X.coordinates.map(R=>({type:"Polygon",coordinates:R})):X.type==="MultiLineString"?X.coordinates.map(R=>({type:"LineString",coordinates:R})):X.type==="MultiPoint"?X.coordinates.map(R=>({type:"Point",coordinates:R})):[X]}class td{constructor(R,at){this.type=Le,this.geojson=R,this.geometries=at}static parse(R,at){if(R.length!==2)return at.error(`'distance' expression requires exactly one argument, but found ${R.length-1} instead.`);if(ca(R[1])){let kt=R[1];if(kt.type==="FeatureCollection")return new td(kt,kt.features.map(jt=>rf(jt.geometry)).flat());if(kt.type==="Feature")return new td(kt,rf(kt.geometry));if("type"in kt&&"coordinates"in kt)return new td(kt,rf(kt))}return at.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(at,kt){let jt=at.geometry(),Qt=jt.flat().map($e=>Co([$e.x,$e.y],at.canonical));if(jt.length===0)return NaN;let re=new ef(Qt[0][1]),Ae=1/0;for(let $e of kt){switch($e.type){case"Point":Ae=Math.min(Ae,hu(Qt,!1,[$e.coordinates],!1,re,Ae));break;case"LineString":Ae=Math.min(Ae,hu(Qt,!1,$e.coordinates,!0,re,Ae));break;case"Polygon":Ae=Math.min(Ae,xh(Qt,!1,$e.coordinates,re,Ae))}if(Ae===0)return Ae}return Ae}(R,this.geometries);if(R.geometryType()==="LineString")return function(at,kt){let jt=at.geometry(),Qt=jt.flat().map($e=>Co([$e.x,$e.y],at.canonical));if(jt.length===0)return NaN;let re=new ef(Qt[0][1]),Ae=1/0;for(let $e of kt){switch($e.type){case"Point":Ae=Math.min(Ae,hu(Qt,!0,[$e.coordinates],!1,re,Ae));break;case"LineString":Ae=Math.min(Ae,hu(Qt,!0,$e.coordinates,!0,re,Ae));break;case"Polygon":Ae=Math.min(Ae,xh(Qt,!0,$e.coordinates,re,Ae))}if(Ae===0)return Ae}return Ae}(R,this.geometries);if(R.geometryType()==="Polygon")return function(at,kt){let jt=at.geometry();if(jt.length===0||jt[0].length===0)return NaN;let Qt=uh(jt,0).map($e=>$e.map(or=>or.map(Cr=>Co([Cr.x,Cr.y],at.canonical)))),re=new ef(Qt[0][0][0][1]),Ae=1/0;for(let $e of kt)for(let or of Qt){switch($e.type){case"Point":Ae=Math.min(Ae,xh([$e.coordinates],!1,or,re,Ae));break;case"LineString":Ae=Math.min(Ae,xh($e.coordinates,!0,or,re,Ae));break;case"Polygon":Ae=Math.min(Ae,Hl(or,$e.coordinates,re,Ae))}if(Ae===0)return Ae}return Ae}(R,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Ed={"==":ms,"!=":kl,">":Kl,"<":ul,">=":Ns,"<=":vs,array:Kr,at:yr,boolean:Kr,case:xi,coalesce:ps,collator:Uo,format:Ol,image:tc,in:en,"index-of":Rn,interpolate:Ka,"interpolate-hcl":Ka,"interpolate-lab":Ka,length:sc,let:bn,literal:so,match:ni,number:Kr,"number-format":Ds,object:Kr,slice:Jn,step:pi,string:Kr,"to-boolean":cn,"to-color":cn,"to-number":cn,"to-string":cn,var:ze,within:Dl,distance:td};class vu{constructor(R,at,kt,jt){this.name=R,this.type=at,this._evaluate=kt,this.args=jt}evaluate(R){return this._evaluate(R,this.args)}eachChild(R){this.args.forEach(R)}outputDefined(){return!1}static parse(R,at){let kt=R[0],jt=vu.definitions[kt];if(!jt)return at.error(`Unknown expression "${kt}". If you wanted a literal array, use ["literal", [...]].`,0);let Qt=Array.isArray(jt)?jt[0]:jt.type,re=Array.isArray(jt)?[[jt[1],jt[2]]]:jt.overloads,Ae=re.filter(([or])=>!Array.isArray(or)||or.length===R.length-1),$e=null;for(let[or,Cr]of Ae){$e=new Pn(at.registry,nf,at.path,null,at.scope);let $r=[],ln=!1;for(let kn=1;kn{return ln=$r,Array.isArray(ln)?`(${ln.map(oe).join(", ")})`:`(${oe(ln.type)}...)`;var ln}).join(" | "),Cr=[];for(let $r=1;$r{at=R?at&&nf(kt):at&&kt instanceof so}),!!at&&af(X)&&df(X,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function af(X){if(X instanceof vu&&(X.name==="get"&&X.args.length===1||X.name==="feature-state"||X.name==="has"&&X.args.length===1||X.name==="properties"||X.name==="geometry-type"||X.name==="id"||/^filter-/.test(X.name))||X instanceof Dl||X instanceof td)return!1;let R=!0;return X.eachChild(at=>{R&&!af(at)&&(R=!1)}),R}function bh(X){if(X instanceof vu&&X.name==="feature-state")return!1;let R=!0;return X.eachChild(at=>{R&&!bh(at)&&(R=!1)}),R}function df(X,R){if(X instanceof vu&&R.indexOf(X.name)>=0)return!1;let at=!0;return X.eachChild(kt=>{at&&!df(kt,R)&&(at=!1)}),at}function Uh(X){return{result:"success",value:X}}function Mh(X){return{result:"error",value:X}}function yu(X){return X["property-type"]==="data-driven"||X["property-type"]==="cross-faded-data-driven"}function fd(X){return!!X.expression&&X.expression.parameters.indexOf("zoom")>-1}function of(X){return!!X.expression&&X.expression.interpolated}function uc(X){return X instanceof Number?"number":X instanceof String?"string":X instanceof Boolean?"boolean":Array.isArray(X)?"array":X===null?"null":typeof X}function jd(X){return typeof X=="object"&&X!==null&&!Array.isArray(X)}function Jf(X){return X}function ff(X,R){let at=R.type==="color",kt=X.stops&&typeof X.stops[0][0]=="object",jt=kt||!(kt||X.property!==void 0),Qt=X.type||(of(R)?"exponential":"interval");if(at||R.type==="padding"){let Cr=at?Ar.parse:Wn.parse;(X=Lt({},X)).stops&&(X.stops=X.stops.map($r=>[$r[0],Cr($r[1])])),X.default=Cr(X.default?X.default:R.default)}if(X.colorSpace&&(re=X.colorSpace)!=="rgb"&&re!=="hcl"&&re!=="lab")throw new Error(`Unknown color space: "${X.colorSpace}"`);var re;let Ae,$e,or;if(Qt==="exponential")Ae=mf;else if(Qt==="interval")Ae=Xu;else if(Qt==="categorical"){Ae=pf,$e=Object.create(null);for(let Cr of X.stops)$e[Cr[0]]=Cr[1];or=typeof X.stops[0][0]}else{if(Qt!=="identity")throw new Error(`Unknown function type "${Qt}"`);Ae=Vc}if(kt){let Cr={},$r=[];for(let Fn=0;FnFn[0]),evaluate:({zoom:Fn},Kn)=>mf({stops:ln,base:X.base},R,Fn).evaluate(Fn,Kn)}}if(jt){let Cr=Qt==="exponential"?{name:"exponential",base:X.base!==void 0?X.base:1}:null;return{kind:"camera",interpolationType:Cr,interpolationFactor:Ka.interpolationFactor.bind(void 0,Cr),zoomStops:X.stops.map($r=>$r[0]),evaluate:({zoom:$r})=>Ae(X,R,$r,$e,or)}}return{kind:"source",evaluate(Cr,$r){let ln=$r&&$r.properties?$r.properties[X.property]:void 0;return ln===void 0?Pd(X.default,R.default):Ae(X,R,ln,$e,or)}}}function Pd(X,R,at){return X!==void 0?X:R!==void 0?R:at!==void 0?at:void 0}function pf(X,R,at,kt,jt){return Pd(typeof at===jt?kt[at]:void 0,X.default,R.default)}function Xu(X,R,at){if(uc(at)!=="number")return Pd(X.default,R.default);let kt=X.stops.length;if(kt===1||at<=X.stops[0][0])return X.stops[0][1];if(at>=X.stops[kt-1][0])return X.stops[kt-1][1];let jt=Gn(X.stops.map(Qt=>Qt[0]),at);return X.stops[jt][1]}function mf(X,R,at){let kt=X.base!==void 0?X.base:1;if(uc(at)!=="number")return Pd(X.default,R.default);let jt=X.stops.length;if(jt===1||at<=X.stops[0][0])return X.stops[0][1];if(at>=X.stops[jt-1][0])return X.stops[jt-1][1];let Qt=Gn(X.stops.map(Cr=>Cr[0]),at),re=function(Cr,$r,ln,kn){let Fn=kn-ln,Kn=Cr-ln;return Fn===0?0:$r===1?Kn/Fn:(Math.pow($r,Kn)-1)/(Math.pow($r,Fn)-1)}(at,kt,X.stops[Qt][0],X.stops[Qt+1][0]),Ae=X.stops[Qt][1],$e=X.stops[Qt+1][1],or=Zo[R.type]||Jf;return typeof Ae.evaluate=="function"?{evaluate(...Cr){let $r=Ae.evaluate.apply(void 0,Cr),ln=$e.evaluate.apply(void 0,Cr);if($r!==void 0&&ln!==void 0)return or($r,ln,re,X.colorSpace)}}:or(Ae,$e,re,X.colorSpace)}function Vc(X,R,at){switch(R.type){case"color":at=Ar.parse(at);break;case"formatted":at=Un.fromString(at.toString());break;case"resolvedImage":at=Zi.fromString(at.toString());break;case"padding":at=Wn.parse(at);break;default:uc(at)===R.type||R.type==="enum"&&R.values[at]||(at=void 0)}return Pd(at,X.default,R.default)}vu.register(Ed,{error:[{kind:"error"},[Ze],(X,[R])=>{throw new Fe(R.evaluate(X))}],typeof:[Ze,[Jr],(X,[R])=>oe(Ei(R.evaluate(X)))],"to-rgba":[Xt(Le,4),[mr],(X,[R])=>{let[at,kt,jt,Qt]=R.evaluate(X).rgb;return[255*at,255*kt,255*jt,Qt]}],rgb:[mr,[Le,Le,Le],Lf],rgba:[mr,[Le,Le,Le,Le],Lf],has:{type:Qe,overloads:[[[Ze],(X,[R])=>hf(R.evaluate(X),X.properties())],[[Ze,fr],(X,[R,at])=>hf(R.evaluate(X),at.evaluate(X))]]},get:{type:Jr,overloads:[[[Ze],(X,[R])=>Ld(R.evaluate(X),X.properties())],[[Ze,fr],(X,[R,at])=>Ld(R.evaluate(X),at.evaluate(X))]]},"feature-state":[Jr,[Ze],(X,[R])=>Ld(R.evaluate(X),X.featureState||{})],properties:[fr,[],X=>X.properties()],"geometry-type":[Ze,[],X=>X.geometryType()],id:[Jr,[],X=>X.id()],zoom:[Le,[],X=>X.globals.zoom],"heatmap-density":[Le,[],X=>X.globals.heatmapDensity||0],"line-progress":[Le,[],X=>X.globals.lineProgress||0],accumulated:[Jr,[],X=>X.globals.accumulated===void 0?null:X.globals.accumulated],"+":[Le,ed(Le),(X,R)=>{let at=0;for(let kt of R)at+=kt.evaluate(X);return at}],"*":[Le,ed(Le),(X,R)=>{let at=1;for(let kt of R)at*=kt.evaluate(X);return at}],"-":{type:Le,overloads:[[[Le,Le],(X,[R,at])=>R.evaluate(X)-at.evaluate(X)],[[Le],(X,[R])=>-R.evaluate(X)]]},"/":[Le,[Le,Le],(X,[R,at])=>R.evaluate(X)/at.evaluate(X)],"%":[Le,[Le,Le],(X,[R,at])=>R.evaluate(X)%at.evaluate(X)],ln2:[Le,[],()=>Math.LN2],pi:[Le,[],()=>Math.PI],e:[Le,[],()=>Math.E],"^":[Le,[Le,Le],(X,[R,at])=>Math.pow(R.evaluate(X),at.evaluate(X))],sqrt:[Le,[Le],(X,[R])=>Math.sqrt(R.evaluate(X))],log10:[Le,[Le],(X,[R])=>Math.log(R.evaluate(X))/Math.LN10],ln:[Le,[Le],(X,[R])=>Math.log(R.evaluate(X))],log2:[Le,[Le],(X,[R])=>Math.log(R.evaluate(X))/Math.LN2],sin:[Le,[Le],(X,[R])=>Math.sin(R.evaluate(X))],cos:[Le,[Le],(X,[R])=>Math.cos(R.evaluate(X))],tan:[Le,[Le],(X,[R])=>Math.tan(R.evaluate(X))],asin:[Le,[Le],(X,[R])=>Math.asin(R.evaluate(X))],acos:[Le,[Le],(X,[R])=>Math.acos(R.evaluate(X))],atan:[Le,[Le],(X,[R])=>Math.atan(R.evaluate(X))],min:[Le,ed(Le),(X,R)=>Math.min(...R.map(at=>at.evaluate(X)))],max:[Le,ed(Le),(X,R)=>Math.max(...R.map(at=>at.evaluate(X)))],abs:[Le,[Le],(X,[R])=>Math.abs(R.evaluate(X))],round:[Le,[Le],(X,[R])=>{let at=R.evaluate(X);return at<0?-Math.round(-at):Math.round(at)}],floor:[Le,[Le],(X,[R])=>Math.floor(R.evaluate(X))],ceil:[Le,[Le],(X,[R])=>Math.ceil(R.evaluate(X))],"filter-==":[Qe,[Ze,Jr],(X,[R,at])=>X.properties()[R.value]===at.value],"filter-id-==":[Qe,[Jr],(X,[R])=>X.id()===R.value],"filter-type-==":[Qe,[Ze],(X,[R])=>X.geometryType()===R.value],"filter-<":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt>jt}],"filter-id->":[Qe,[Jr],(X,[R])=>{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at>kt}],"filter-<=":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt<=jt}],"filter-id-<=":[Qe,[Jr],(X,[R])=>{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at<=kt}],"filter->=":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt>=jt}],"filter-id->=":[Qe,[Jr],(X,[R])=>{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at>=kt}],"filter-has":[Qe,[Jr],(X,[R])=>R.value in X.properties()],"filter-has-id":[Qe,[],X=>X.id()!==null&&X.id()!==void 0],"filter-type-in":[Qe,[Xt(Ze)],(X,[R])=>R.value.indexOf(X.geometryType())>=0],"filter-id-in":[Qe,[Xt(Jr)],(X,[R])=>R.value.indexOf(X.id())>=0],"filter-in-small":[Qe,[Ze,Xt(Jr)],(X,[R,at])=>at.value.indexOf(X.properties()[R.value])>=0],"filter-in-large":[Qe,[Ze,Xt(Jr)],(X,[R,at])=>function(kt,jt,Qt,re){for(;Qt<=re;){let Ae=Qt+re>>1;if(jt[Ae]===kt)return!0;jt[Ae]>kt?re=Ae-1:Qt=Ae+1}return!1}(X.properties()[R.value],at.value,0,at.value.length-1)],all:{type:Qe,overloads:[[[Qe,Qe],(X,[R,at])=>R.evaluate(X)&&at.evaluate(X)],[ed(Qe),(X,R)=>{for(let at of R)if(!at.evaluate(X))return!1;return!0}]]},any:{type:Qe,overloads:[[[Qe,Qe],(X,[R,at])=>R.evaluate(X)||at.evaluate(X)],[ed(Qe),(X,R)=>{for(let at of R)if(at.evaluate(X))return!0;return!1}]]},"!":[Qe,[Qe],(X,[R])=>!R.evaluate(X)],"is-supported-script":[Qe,[Ze],(X,[R])=>{let at=X.globals&&X.globals.isSupportedScript;return!at||at(R.evaluate(X))}],upcase:[Ze,[Ze],(X,[R])=>R.evaluate(X).toUpperCase()],downcase:[Ze,[Ze],(X,[R])=>R.evaluate(X).toLowerCase()],concat:[Ze,ed(Jr),(X,R)=>R.map(at=>Ga(at.evaluate(X))).join("")],"resolved-locale":[Ze,[an],(X,[R])=>R.evaluate(X).resolvedLocale()]});class Ju{constructor(R,at){var kt;this.expression=R,this._warningHistory={},this._evaluator=new un,this._defaultValue=at?(kt=at).type==="color"&&jd(kt.default)?new Ar(0,0,0,0):kt.type==="color"?Ar.parse(kt.default)||null:kt.type==="padding"?Wn.parse(kt.default)||null:kt.type==="variableAnchorOffsetCollection"?Fi.parse(kt.default)||null:kt.default===void 0?null:kt.default:null,this._enumValues=at&&at.type==="enum"?at.values:null}evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re){return this._evaluator.globals=R,this._evaluator.feature=at,this._evaluator.featureState=kt,this._evaluator.canonical=jt,this._evaluator.availableImages=Qt||null,this._evaluator.formattedSection=re,this.expression.evaluate(this._evaluator)}evaluate(R,at,kt,jt,Qt,re){this._evaluator.globals=R,this._evaluator.feature=at||null,this._evaluator.featureState=kt||null,this._evaluator.canonical=jt,this._evaluator.availableImages=Qt||null,this._evaluator.formattedSection=re||null;try{let Ae=this.expression.evaluate(this._evaluator);if(Ae==null||typeof Ae=="number"&&Ae!=Ae)return this._defaultValue;if(this._enumValues&&!(Ae in this._enumValues))throw new Fe(`Expected value to be one of ${Object.keys(this._enumValues).map($e=>JSON.stringify($e)).join(", ")}, but found ${JSON.stringify(Ae)} instead.`);return Ae}catch(Ae){return this._warningHistory[Ae.message]||(this._warningHistory[Ae.message]=!0,typeof console<"u"&&console.warn(Ae.message)),this._defaultValue}}}function rd(X){return Array.isArray(X)&&X.length>0&&typeof X[0]=="string"&&X[0]in Ed}function xc(X,R){let at=new Pn(Ed,nf,[],R?function(jt){let Qt={color:mr,string:Ze,number:Le,enum:Ze,boolean:Qe,formatted:Er,padding:dn,resolvedImage:_n,variableAnchorOffsetCollection:Oe};return jt.type==="array"?Xt(Qt[jt.value]||Jr,jt.length):Qt[jt.type]}(R):void 0),kt=at.parse(X,void 0,void 0,void 0,R&&R.type==="string"?{typeAnnotation:"coerce"}:void 0);return kt?Uh(new Ju(kt,R)):Mh(at.errors)}class $h{constructor(R,at){this.kind=R,this._styleExpression=at,this.isStateDependent=R!=="constant"&&!bh(at.expression)}evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re){return this._styleExpression.evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re)}evaluate(R,at,kt,jt,Qt,re){return this._styleExpression.evaluate(R,at,kt,jt,Qt,re)}}class ju{constructor(R,at,kt,jt){this.kind=R,this.zoomStops=kt,this._styleExpression=at,this.isStateDependent=R!=="camera"&&!bh(at.expression),this.interpolationType=jt}evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re){return this._styleExpression.evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re)}evaluate(R,at,kt,jt,Qt,re){return this._styleExpression.evaluate(R,at,kt,jt,Qt,re)}interpolationFactor(R,at,kt){return this.interpolationType?Ka.interpolationFactor(this.interpolationType,R,at,kt):0}}function Qu(X,R){let at=xc(X,R);if(at.result==="error")return at;let kt=at.value.expression,jt=af(kt);if(!jt&&!yu(R))return Mh([new ie("","data expressions not supported")]);let Qt=df(kt,["zoom"]);if(!Qt&&!fd(R))return Mh([new ie("","zoom expressions not supported")]);let re=xd(kt);return re||Qt?re instanceof ie?Mh([re]):re instanceof Ka&&!of(R)?Mh([new ie("",'"interpolate" expressions cannot be used with this property')]):Uh(re?new ju(jt?"camera":"composite",at.value,re.labels,re instanceof Ka?re.interpolation:void 0):new $h(jt?"constant":"source",at.value)):Mh([new ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Pc{constructor(R,at){this._parameters=R,this._specification=at,Lt(this,ff(this._parameters,this._specification))}static deserialize(R){return new Pc(R._parameters,R._specification)}static serialize(R){return{_parameters:R._parameters,_specification:R._specification}}}function xd(X){let R=null;if(X instanceof bn)R=xd(X.result);else if(X instanceof ps){for(let at of X.args)if(R=xd(at),R)break}else(X instanceof pi||X instanceof Ka)&&X.input instanceof vu&&X.input.name==="zoom"&&(R=X);return R instanceof ie||X.eachChild(at=>{let kt=xd(at);kt instanceof ie?R=kt:!R&&kt?R=new ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):R&&kt&&R!==kt&&(R=new ie("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),R}function Eh(X){if(X===!0||X===!1)return!0;if(!Array.isArray(X)||X.length===0)return!1;switch(X[0]){case"has":return X.length>=2&&X[1]!=="$id"&&X[1]!=="$type";case"in":return X.length>=3&&(typeof X[1]!="string"||Array.isArray(X[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return X.length!==3||Array.isArray(X[1])||Array.isArray(X[2]);case"any":case"all":for(let R of X.slice(1))if(!Eh(R)&&typeof R!="boolean")return!1;return!0;default:return!0}}let nd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ud(X){if(X==null)return{filter:()=>!0,needGeometry:!1};Eh(X)||(X=bd(X));let R=xc(X,nd);if(R.result==="error")throw new Error(R.value.map(at=>`${at.key}: ${at.message}`).join(", "));return{filter:(at,kt,jt)=>R.value.evaluate(at,kt,{},jt),needGeometry:Ap(X)}}function Qf(X,R){return XR?1:0}function Ap(X){if(!Array.isArray(X))return!1;if(X[0]==="within"||X[0]==="distance")return!0;for(let R=1;R"||R==="<="||R===">="?$d(X[1],X[2],R):R==="any"?(at=X.slice(1),["any"].concat(at.map(bd))):R==="all"?["all"].concat(X.slice(1).map(bd)):R==="none"?["all"].concat(X.slice(1).map(bd).map(hh)):R==="in"?zu(X[1],X.slice(2)):R==="!in"?hh(zu(X[1],X.slice(2))):R==="has"?wd(X[1]):R!=="!has"||hh(wd(X[1]));var at}function $d(X,R,at){switch(X){case"$type":return[`filter-type-${at}`,R];case"$id":return[`filter-id-${at}`,R];default:return[`filter-${at}`,X,R]}}function zu(X,R){if(R.length===0)return!1;switch(X){case"$type":return["filter-type-in",["literal",R]];case"$id":return["filter-id-in",["literal",R]];default:return R.length>200&&!R.some(at=>typeof at!=typeof R[0])?["filter-in-large",X,["literal",R.sort(Qf)]]:["filter-in-small",X,["literal",R]]}}function wd(X){switch(X){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",X]}}function hh(X){return["!",X]}function kd(X){let R=typeof X;if(R==="number"||R==="boolean"||R==="string"||X==null)return JSON.stringify(X);if(Array.isArray(X)){let jt="[";for(let Qt of X)jt+=`${kd(Qt)},`;return`${jt}]`}let at=Object.keys(X).sort(),kt="{";for(let jt=0;jtkt.maximum?[new Ot(R,at,`${at} is greater than the maximum value ${kt.maximum}`)]:[]}function Id(X){let R=X.valueSpec,at=Ic(X.value.type),kt,jt,Qt,re={},Ae=at!=="categorical"&&X.value.property===void 0,$e=!Ae,or=uc(X.value.stops)==="array"&&uc(X.value.stops[0])==="array"&&uc(X.value.stops[0][0])==="object",Cr=th({key:X.key,value:X.value,valueSpec:X.styleSpec.function,validateSpec:X.validateSpec,style:X.style,styleSpec:X.styleSpec,objectElementValidators:{stops:function(kn){if(at==="identity")return[new Ot(kn.key,kn.value,'identity function may not have a "stops" property')];let Fn=[],Kn=kn.value;return Fn=Fn.concat(Pf({key:kn.key,value:Kn,valueSpec:kn.valueSpec,validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec,arrayElementValidator:$r})),uc(Kn)==="array"&&Kn.length===0&&Fn.push(new Ot(kn.key,Kn,"array must have at least one stop")),Fn},default:function(kn){return kn.validateSpec({key:kn.key,value:kn.value,valueSpec:R,validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec})}}});return at==="identity"&&Ae&&Cr.push(new Ot(X.key,X.value,'missing required property "property"')),at==="identity"||X.value.stops||Cr.push(new Ot(X.key,X.value,'missing required property "stops"')),at==="exponential"&&X.valueSpec.expression&&!of(X.valueSpec)&&Cr.push(new Ot(X.key,X.value,"exponential functions not supported")),X.styleSpec.$version>=8&&($e&&!yu(X.valueSpec)?Cr.push(new Ot(X.key,X.value,"property functions not supported")):Ae&&!fd(X.valueSpec)&&Cr.push(new Ot(X.key,X.value,"zoom functions not supported"))),at!=="categorical"&&!or||X.value.property!==void 0||Cr.push(new Ot(X.key,X.value,'"property" property is required')),Cr;function $r(kn){let Fn=[],Kn=kn.value,mi=kn.key;if(uc(Kn)!=="array")return[new Ot(mi,Kn,`array expected, ${uc(Kn)} found`)];if(Kn.length!==2)return[new Ot(mi,Kn,`array length 2 expected, length ${Kn.length} found`)];if(or){if(uc(Kn[0])!=="object")return[new Ot(mi,Kn,`object expected, ${uc(Kn[0])} found`)];if(Kn[0].zoom===void 0)return[new Ot(mi,Kn,"object stop key must have zoom")];if(Kn[0].value===void 0)return[new Ot(mi,Kn,"object stop key must have value")];if(Qt&&Qt>Ic(Kn[0].zoom))return[new Ot(mi,Kn[0].zoom,"stop zoom values must appear in ascending order")];Ic(Kn[0].zoom)!==Qt&&(Qt=Ic(Kn[0].zoom),jt=void 0,re={}),Fn=Fn.concat(th({key:`${mi}[0]`,value:Kn[0],valueSpec:{zoom:{}},validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec,objectElementValidators:{zoom:Mc,value:ln}}))}else Fn=Fn.concat(ln({key:`${mi}[0]`,value:Kn[0],validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec},Kn));return rd(Hh(Kn[1]))?Fn.concat([new Ot(`${mi}[1]`,Kn[1],"expressions are not allowed in function stops.")]):Fn.concat(kn.validateSpec({key:`${mi}[1]`,value:Kn[1],valueSpec:R,validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec}))}function ln(kn,Fn){let Kn=uc(kn.value),mi=Ic(kn.value),Ui=kn.value!==null?kn.value:Fn;if(kt){if(Kn!==kt)return[new Ot(kn.key,Ui,`${Kn} stop domain type must match previous stop domain type ${kt}`)]}else kt=Kn;if(Kn!=="number"&&Kn!=="string"&&Kn!=="boolean")return[new Ot(kn.key,Ui,"stop domain value must be a number, string, or boolean")];if(Kn!=="number"&&at!=="categorical"){let Na=`number expected, ${Kn} found`;return yu(R)&&at===void 0&&(Na+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ot(kn.key,Ui,Na)]}return at!=="categorical"||Kn!=="number"||isFinite(mi)&&Math.floor(mi)===mi?at!=="categorical"&&Kn==="number"&&jt!==void 0&&minew Ot(`${X.key}${kt.key}`,X.value,kt.message));let at=R.value.expression||R.value._styleExpression.expression;if(X.expressionContext==="property"&&X.propertyKey==="text-font"&&!at.outputDefined())return[new Ot(X.key,X.value,`Invalid data expression for "${X.propertyKey}". Output values must be contained as literals within the expression.`)];if(X.expressionContext==="property"&&X.propertyType==="layout"&&!bh(at))return[new Ot(X.key,X.value,'"feature-state" data expressions are not supported with layout properties.')];if(X.expressionContext==="filter"&&!bh(at))return[new Ot(X.key,X.value,'"feature-state" data expressions are not supported with filters.')];if(X.expressionContext&&X.expressionContext.indexOf("cluster")===0){if(!df(at,["zoom","feature-state"]))return[new Ot(X.key,X.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(X.expressionContext==="cluster-initial"&&!af(at))return[new Ot(X.key,X.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function dh(X){let R=X.key,at=X.value,kt=X.valueSpec,jt=[];return Array.isArray(kt.values)?kt.values.indexOf(Ic(at))===-1&&jt.push(new Ot(R,at,`expected one of [${kt.values.join(", ")}], ${JSON.stringify(at)} found`)):Object.keys(kt.values).indexOf(Ic(at))===-1&&jt.push(new Ot(R,at,`expected one of [${Object.keys(kt.values).join(", ")}], ${JSON.stringify(at)} found`)),jt}function pd(X){return Eh(Hh(X.value))?id(Lt({},X,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ad(X)}function ad(X){let R=X.value,at=X.key;if(uc(R)!=="array")return[new Ot(at,R,`array expected, ${uc(R)} found`)];let kt=X.styleSpec,jt,Qt=[];if(R.length<1)return[new Ot(at,R,"filter array must have at least 1 element")];switch(Qt=Qt.concat(dh({key:`${at}[0]`,value:R[0],valueSpec:kt.filter_operator,style:X.style,styleSpec:X.styleSpec})),Ic(R[0])){case"<":case"<=":case">":case">=":R.length>=2&&Ic(R[1])==="$type"&&Qt.push(new Ot(at,R,`"$type" cannot be use with operator "${R[0]}"`));case"==":case"!=":R.length!==3&&Qt.push(new Ot(at,R,`filter array for operator "${R[0]}" must have 3 elements`));case"in":case"!in":R.length>=2&&(jt=uc(R[1]),jt!=="string"&&Qt.push(new Ot(`${at}[1]`,R[1],`string expected, ${jt} found`)));for(let re=2;re{or in at&&R.push(new Ot(kt,at[or],`"${or}" is prohibited for ref layers`))}),jt.layers.forEach(or=>{Ic(or.id)===Ae&&($e=or)}),$e?$e.ref?R.push(new Ot(kt,at.ref,"ref cannot reference another ref layer")):re=Ic($e.type):R.push(new Ot(kt,at.ref,`ref layer "${Ae}" not found`))}else if(re!=="background")if(at.source){let $e=jt.sources&&jt.sources[at.source],or=$e&&Ic($e.type);$e?or==="vector"&&re==="raster"?R.push(new Ot(kt,at.source,`layer "${at.id}" requires a raster source`)):or!=="raster-dem"&&re==="hillshade"?R.push(new Ot(kt,at.source,`layer "${at.id}" requires a raster-dem source`)):or==="raster"&&re!=="raster"?R.push(new Ot(kt,at.source,`layer "${at.id}" requires a vector source`)):or!=="vector"||at["source-layer"]?or==="raster-dem"&&re!=="hillshade"?R.push(new Ot(kt,at.source,"raster-dem source can only be used with layer type 'hillshade'.")):re!=="line"||!at.paint||!at.paint["line-gradient"]||or==="geojson"&&$e.lineMetrics||R.push(new Ot(kt,at,`layer "${at.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):R.push(new Ot(kt,at,`layer "${at.id}" must specify a "source-layer"`)):R.push(new Ot(kt,at.source,`source "${at.source}" not found`))}else R.push(new Ot(kt,at,'missing required property "source"'));return R=R.concat(th({key:kt,value:at,valueSpec:Qt.layer,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,objectElementValidators:{"*":()=>[],type:()=>X.validateSpec({key:`${kt}.type`,value:at.type,valueSpec:Qt.layer.type,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,object:at,objectKey:"type"}),filter:pd,layout:$e=>th({layer:at,key:$e.key,value:$e.value,style:$e.style,styleSpec:$e.styleSpec,validateSpec:$e.validateSpec,objectElementValidators:{"*":or=>Au(Lt({layerType:re},or))}}),paint:$e=>th({layer:at,key:$e.key,value:$e.value,style:$e.style,styleSpec:$e.styleSpec,validateSpec:$e.validateSpec,objectElementValidators:{"*":or=>tp(Lt({layerType:re},or))}})}})),R}function fh(X){let R=X.value,at=X.key,kt=uc(R);return kt!=="string"?[new Ot(at,R,`string expected, ${kt} found`)]:[]}let Vh={promoteId:function({key:X,value:R}){if(uc(R)==="string")return fh({key:X,value:R});{let at=[];for(let kt in R)at.push(...fh({key:`${X}.${kt}`,value:R[kt]}));return at}}};function Ph(X){let R=X.value,at=X.key,kt=X.styleSpec,jt=X.style,Qt=X.validateSpec;if(!R.type)return[new Ot(at,R,'"type" is required')];let re=Ic(R.type),Ae;switch(re){case"vector":case"raster":return Ae=th({key:at,value:R,valueSpec:kt[`source_${re.replace("-","_")}`],style:X.style,styleSpec:kt,objectElementValidators:Vh,validateSpec:Qt}),Ae;case"raster-dem":return Ae=function($e){var or;let Cr=(or=$e.sourceName)!==null&&or!==void 0?or:"",$r=$e.value,ln=$e.styleSpec,kn=ln.source_raster_dem,Fn=$e.style,Kn=[],mi=uc($r);if($r===void 0)return Kn;if(mi!=="object")return Kn.push(new Ot("source_raster_dem",$r,`object expected, ${mi} found`)),Kn;let Ui=Ic($r.encoding)==="custom",Na=["redFactor","greenFactor","blueFactor","baseShift"],fa=$e.value.encoding?`"${$e.value.encoding}"`:"Default";for(let La in $r)!Ui&&Na.includes(La)?Kn.push(new Ot(La,$r[La],`In "${Cr}": "${La}" is only valid when "encoding" is set to "custom". ${fa} encoding found`)):kn[La]?Kn=Kn.concat($e.validateSpec({key:La,value:$r[La],valueSpec:kn[La],validateSpec:$e.validateSpec,style:Fn,styleSpec:ln})):Kn.push(new Ot(La,$r[La],`unknown property "${La}"`));return Kn}({sourceName:at,value:R,style:X.style,styleSpec:kt,validateSpec:Qt}),Ae;case"geojson":if(Ae=th({key:at,value:R,valueSpec:kt.source_geojson,style:jt,styleSpec:kt,validateSpec:Qt,objectElementValidators:Vh}),R.cluster)for(let $e in R.clusterProperties){let[or,Cr]=R.clusterProperties[$e],$r=typeof or=="string"?[or,["accumulated"],["get",$e]]:or;Ae.push(...id({key:`${at}.${$e}.map`,value:Cr,expressionContext:"cluster-map"})),Ae.push(...id({key:`${at}.${$e}.reduce`,value:$r,expressionContext:"cluster-reduce"}))}return Ae;case"video":return th({key:at,value:R,valueSpec:kt.source_video,style:jt,validateSpec:Qt,styleSpec:kt});case"image":return th({key:at,value:R,valueSpec:kt.source_image,style:jt,validateSpec:Qt,styleSpec:kt});case"canvas":return[new Ot(at,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return dh({key:`${at}.type`,value:R.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Zc(X){let R=X.value,at=X.styleSpec,kt=at.light,jt=X.style,Qt=[],re=uc(R);if(R===void 0)return Qt;if(re!=="object")return Qt=Qt.concat([new Ot("light",R,`object expected, ${re} found`)]),Qt;for(let Ae in R){let $e=Ae.match(/^(.*)-transition$/);Qt=Qt.concat($e&&kt[$e[1]]&&kt[$e[1]].transition?X.validateSpec({key:Ae,value:R[Ae],valueSpec:at.transition,validateSpec:X.validateSpec,style:jt,styleSpec:at}):kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],validateSpec:X.validateSpec,style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)])}return Qt}function fc(X){let R=X.value,at=X.styleSpec,kt=at.sky,jt=X.style,Qt=uc(R);if(R===void 0)return[];if(Qt!=="object")return[new Ot("sky",R,`object expected, ${Qt} found`)];let re=[];for(let Ae in R)re=re.concat(kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)]);return re}function Ih(X){let R=X.value,at=X.styleSpec,kt=at.terrain,jt=X.style,Qt=[],re=uc(R);if(R===void 0)return Qt;if(re!=="object")return Qt=Qt.concat([new Ot("terrain",R,`object expected, ${re} found`)]),Qt;for(let Ae in R)Qt=Qt.concat(kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],validateSpec:X.validateSpec,style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)]);return Qt}function Td(X){let R=[],at=X.value,kt=X.key;if(Array.isArray(at)){let jt=[],Qt=[];for(let re in at)at[re].id&&jt.includes(at[re].id)&&R.push(new Ot(kt,at,`all the sprites' ids must be unique, but ${at[re].id} is duplicated`)),jt.push(at[re].id),at[re].url&&Qt.includes(at[re].url)&&R.push(new Ot(kt,at,`all the sprites' URLs must be unique, but ${at[re].url} is duplicated`)),Qt.push(at[re].url),R=R.concat(th({key:`${kt}[${re}]`,value:at[re],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:X.validateSpec}));return R}return fh({key:kt,value:at})}let Dh={"*":()=>[],array:Pf,boolean:function(X){let R=X.value,at=X.key,kt=uc(R);return kt!=="boolean"?[new Ot(at,R,`boolean expected, ${kt} found`)]:[]},number:Mc,color:function(X){let R=X.key,at=X.value,kt=uc(at);return kt!=="string"?[new Ot(R,at,`color expected, ${kt} found`)]:Ar.parse(String(at))?[]:[new Ot(R,at,`color expected, "${at}" found`)]},constants:Lh,enum:dh,filter:pd,function:Id,layer:gf,object:th,source:Ph,light:Zc,sky:fc,terrain:Ih,projection:function(X){let R=X.value,at=X.styleSpec,kt=at.projection,jt=X.style,Qt=uc(R);if(R===void 0)return[];if(Qt!=="object")return[new Ot("projection",R,`object expected, ${Qt} found`)];let re=[];for(let Ae in R)re=re.concat(kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)]);return re},string:fh,formatted:function(X){return fh(X).length===0?[]:id(X)},resolvedImage:function(X){return fh(X).length===0?[]:id(X)},padding:function(X){let R=X.key,at=X.value;if(uc(at)==="array"){if(at.length<1||at.length>4)return[new Ot(R,at,`padding requires 1 to 4 values; ${at.length} values found`)];let kt={type:"number"},jt=[];for(let Qt=0;Qt[]}})),X.constants&&(at=at.concat(Lh({key:"constants",value:X.constants}))),An(at)}function Nn(X){return function(R){return X(Ce(we({},R),{validateSpec:sf}))}}function An(X){return[].concat(X).sort((R,at)=>R.line-at.line)}function di(X){return function(...R){return An(X.apply(this,R))}}Qr.source=di(Nn(Ph)),Qr.sprite=di(Nn(Td)),Qr.glyphs=di(Nn(br)),Qr.light=di(Nn(Zc)),Qr.sky=di(Nn(fc)),Qr.terrain=di(Nn(Ih)),Qr.layer=di(Nn(gf)),Qr.filter=di(Nn(pd)),Qr.paintProperty=di(Nn(tp)),Qr.layoutProperty=di(Nn(Au));let Pi=Qr,ga=Pi.light,Pa=Pi.sky,Ja=Pi.paintProperty,uo=Pi.layoutProperty;function Sa(X,R){let at=!1;if(R&&R.length)for(let kt of R)X.fire(new J(new Error(kt.message))),at=!0;return at}class Za{constructor(R,at,kt){let jt=this.cells=[];if(R instanceof ArrayBuffer){this.arrayBuffer=R;let re=new Int32Array(this.arrayBuffer);R=re[0],this.d=(at=re[1])+2*(kt=re[2]);for(let $e=0;$e=$r[Fn+0]&&jt>=$r[Fn+1])?(Ae[kn]=!0,re.push(Cr[kn])):Ae[kn]=!1}}}}_forEachCell(R,at,kt,jt,Qt,re,Ae,$e){let or=this._convertToCellCoord(R),Cr=this._convertToCellCoord(at),$r=this._convertToCellCoord(kt),ln=this._convertToCellCoord(jt);for(let kn=or;kn<=$r;kn++)for(let Fn=Cr;Fn<=ln;Fn++){let Kn=this.d*Fn+kn;if((!$e||$e(this._convertFromCellCoord(kn),this._convertFromCellCoord(Fn),this._convertFromCellCoord(kn+1),this._convertFromCellCoord(Fn+1)))&&Qt.call(this,R,at,kt,jt,Kn,re,Ae,$e))return}}_convertFromCellCoord(R){return(R-this.padding)/this.scale}_convertToCellCoord(R){return Math.max(0,Math.min(this.d-1,Math.floor(R*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let R=this.cells,at=3+this.cells.length+1+1,kt=0;for(let re=0;re=0)continue;let re=X[Qt];jt[Qt]=Ra[at].shallow.indexOf(Qt)>=0?re:gs(re,R)}X instanceof Error&&(jt.message=X.message)}if(jt.$name)throw new Error("$name property is reserved for worker serialization logic.");return at!=="Object"&&(jt.$name=at),jt}function ws(X){if(os(X))return X;if(Array.isArray(X))return X.map(ws);if(typeof X!="object")throw new Error("can't deserialize object of type "+typeof X);let R=fs(X)||"Object";if(!Ra[R])throw new Error(`can't deserialize unregistered class ${R}`);let{klass:at}=Ra[R];if(!at)throw new Error(`can't deserialize unregistered class ${R}`);if(at.deserialize)return at.deserialize(X);let kt=Object.create(at.prototype);for(let jt of Object.keys(X)){if(jt==="$name")continue;let Qt=X[jt];kt[jt]=Ra[R].shallow.indexOf(jt)>=0?Qt:ws(Qt)}return kt}class bo{constructor(){this.first=!0}update(R,at){let kt=Math.floor(R);return this.first?(this.first=!1,this.lastIntegerZoom=kt,this.lastIntegerZoomTime=0,this.lastZoom=R,this.lastFloorZoom=kt,!0):(this.lastFloorZoom>kt?(this.lastIntegerZoom=kt+1,this.lastIntegerZoomTime=at):this.lastFloorZoomX>=128&&X<=255,"Hangul Jamo":X=>X>=4352&&X<=4607,Khmer:X=>X>=6016&&X<=6143,"General Punctuation":X=>X>=8192&&X<=8303,"Letterlike Symbols":X=>X>=8448&&X<=8527,"Number Forms":X=>X>=8528&&X<=8591,"Miscellaneous Technical":X=>X>=8960&&X<=9215,"Control Pictures":X=>X>=9216&&X<=9279,"Optical Character Recognition":X=>X>=9280&&X<=9311,"Enclosed Alphanumerics":X=>X>=9312&&X<=9471,"Geometric Shapes":X=>X>=9632&&X<=9727,"Miscellaneous Symbols":X=>X>=9728&&X<=9983,"Miscellaneous Symbols and Arrows":X=>X>=11008&&X<=11263,"Ideographic Description Characters":X=>X>=12272&&X<=12287,"CJK Symbols and Punctuation":X=>X>=12288&&X<=12351,Katakana:X=>X>=12448&&X<=12543,Kanbun:X=>X>=12688&&X<=12703,"CJK Strokes":X=>X>=12736&&X<=12783,"Enclosed CJK Letters and Months":X=>X>=12800&&X<=13055,"CJK Compatibility":X=>X>=13056&&X<=13311,"Yijing Hexagram Symbols":X=>X>=19904&&X<=19967,"Private Use Area":X=>X>=57344&&X<=63743,"Vertical Forms":X=>X>=65040&&X<=65055,"CJK Compatibility Forms":X=>X>=65072&&X<=65103,"Small Form Variants":X=>X>=65104&&X<=65135,"Halfwidth and Fullwidth Forms":X=>X>=65280&&X<=65519};function ks(X){for(let R of X)if(El(R.charCodeAt(0)))return!0;return!1}function dl(X){for(let R of X)if(!ec(R.charCodeAt(0)))return!1;return!0}function Vl(X){let R=X.map(at=>{try{return new RegExp(`\\p{sc=${at}}`,"u").source}catch{return null}}).filter(at=>at);return new RegExp(R.join("|"),"u")}let gc=Vl(["Arab","Dupl","Mong","Ougr","Syrc"]);function ec(X){return!gc.test(String.fromCodePoint(X))}let vc=Vl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function El(X){return!(X!==746&&X!==747&&(X<4352||!(lo["CJK Compatibility Forms"](X)&&!(X>=65097&&X<=65103)||lo["CJK Compatibility"](X)||lo["CJK Strokes"](X)||!(!lo["CJK Symbols and Punctuation"](X)||X>=12296&&X<=12305||X>=12308&&X<=12319||X===12336)||lo["Enclosed CJK Letters and Months"](X)||lo["Ideographic Description Characters"](X)||lo.Kanbun(X)||lo.Katakana(X)&&X!==12540||!(!lo["Halfwidth and Fullwidth Forms"](X)||X===65288||X===65289||X===65293||X>=65306&&X<=65310||X===65339||X===65341||X===65343||X>=65371&&X<=65503||X===65507||X>=65512&&X<=65519)||!(!lo["Small Form Variants"](X)||X>=65112&&X<=65118||X>=65123&&X<=65126)||lo["Vertical Forms"](X)||lo["Yijing Hexagram Symbols"](X)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(X))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(X))||vc.test(String.fromCodePoint(X)))))}function tu(X){return!(El(X)||function(R){return!!(lo["Latin-1 Supplement"](R)&&(R===167||R===169||R===174||R===177||R===188||R===189||R===190||R===215||R===247)||lo["General Punctuation"](R)&&(R===8214||R===8224||R===8225||R===8240||R===8241||R===8251||R===8252||R===8258||R===8263||R===8264||R===8265||R===8273)||lo["Letterlike Symbols"](R)||lo["Number Forms"](R)||lo["Miscellaneous Technical"](R)&&(R>=8960&&R<=8967||R>=8972&&R<=8991||R>=8996&&R<=9e3||R===9003||R>=9085&&R<=9114||R>=9150&&R<=9165||R===9167||R>=9169&&R<=9179||R>=9186&&R<=9215)||lo["Control Pictures"](R)&&R!==9251||lo["Optical Character Recognition"](R)||lo["Enclosed Alphanumerics"](R)||lo["Geometric Shapes"](R)||lo["Miscellaneous Symbols"](R)&&!(R>=9754&&R<=9759)||lo["Miscellaneous Symbols and Arrows"](R)&&(R>=11026&&R<=11055||R>=11088&&R<=11097||R>=11192&&R<=11243)||lo["CJK Symbols and Punctuation"](R)||lo.Katakana(R)||lo["Private Use Area"](R)||lo["CJK Compatibility Forms"](R)||lo["Small Form Variants"](R)||lo["Halfwidth and Fullwidth Forms"](R)||R===8734||R===8756||R===8757||R>=9984&&R<=10087||R>=10102&&R<=10131||R===65532||R===65533)}(X))}let $c=Vl(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function bc(X){return $c.test(String.fromCodePoint(X))}function qo(X,R){return!(!R&&bc(X)||X>=2304&&X<=3583||X>=3840&&X<=4255||lo.Khmer(X))}function Bs(X){for(let R of X)if(bc(R.charCodeAt(0)))return!0;return!1}let ac=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(X){this.pluginStatus=X.pluginStatus,this.pluginURL=X.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(X){this.applyArabicShaping=X.applyArabicShaping,this.processBidirectionalText=X.processBidirectionalText,this.processStyledBidirectionalText=X.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Zl{constructor(R,at){this.zoom=R,at?(this.now=at.now,this.fadeDuration=at.fadeDuration,this.zoomHistory=at.zoomHistory,this.transition=at.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new bo,this.transition={})}isSupportedScript(R){return function(at,kt){for(let jt of at)if(!qo(jt.charCodeAt(0),kt))return!1;return!0}(R,ac.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let R=this.zoom,at=R-Math.floor(R),kt=this.crossFadingFactor();return R>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:at+(1-at)*kt}:{fromScale:.5,toScale:1,t:1-(1-kt)*at}}}class Mu{constructor(R,at){this.property=R,this.value=at,this.expression=function(kt,jt){if(jd(kt))return new Pc(kt,jt);if(rd(kt)){let Qt=Qu(kt,jt);if(Qt.result==="error")throw new Error(Qt.value.map(re=>`${re.key}: ${re.message}`).join(", "));return Qt.value}{let Qt=kt;return jt.type==="color"&&typeof kt=="string"?Qt=Ar.parse(kt):jt.type!=="padding"||typeof kt!="number"&&!Array.isArray(kt)?jt.type==="variableAnchorOffsetCollection"&&Array.isArray(kt)&&(Qt=Fi.parse(kt)):Qt=Wn.parse(kt),{kind:"constant",evaluate:()=>Qt}}}(at===void 0?R.specification.default:at,R.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(R,at,kt){return this.property.possiblyEvaluate(this,R,at,kt)}}class eh{constructor(R){this.property=R,this.value=new Mu(R,void 0)}transitioned(R,at){return new Wh(this.property,this.value,at,E({},R.transition,this.transition),R.now)}untransitioned(){return new Wh(this.property,this.value,null,{},0)}}class Vu{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitionablePropertyValues)}getValue(R){return g(this._values[R].value.value)}setValue(R,at){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].value=new Mu(this._values[R].property,at===null?void 0:g(at))}getTransition(R){return g(this._values[R].transition)}setTransition(R,at){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].transition=g(at)||void 0}serialize(){let R={};for(let at of Object.keys(this._values)){let kt=this.getValue(at);kt!==void 0&&(R[at]=kt);let jt=this.getTransition(at);jt!==void 0&&(R[`${at}-transition`]=jt)}return R}transitioned(R,at){let kt=new rh(this._properties);for(let jt of Object.keys(this._values))kt._values[jt]=this._values[jt].transitioned(R,at._values[jt]);return kt}untransitioned(){let R=new rh(this._properties);for(let at of Object.keys(this._values))R._values[at]=this._values[at].untransitioned();return R}}class Wh{constructor(R,at,kt,jt,Qt){this.property=R,this.value=at,this.begin=Qt+jt.delay||0,this.end=this.begin+jt.duration||0,R.specification.transition&&(jt.delay||jt.duration)&&(this.prior=kt)}possiblyEvaluate(R,at,kt){let jt=R.now||0,Qt=this.value.possiblyEvaluate(R,at,kt),re=this.prior;if(re){if(jt>this.end)return this.prior=null,Qt;if(this.value.isDataDriven())return this.prior=null,Qt;if(jt=1)return 1;let or=$e*$e,Cr=or*$e;return 4*($e<.5?Cr:3*($e-or)+Cr-.75)}(Ae))}}return Qt}}class rh{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitioningPropertyValues)}possiblyEvaluate(R,at,kt){let jt=new Gh(this._properties);for(let Qt of Object.keys(this._values))jt._values[Qt]=this._values[Qt].possiblyEvaluate(R,at,kt);return jt}hasTransition(){for(let R of Object.keys(this._values))if(this._values[R].prior)return!0;return!1}}class qh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPropertyValues)}hasValue(R){return this._values[R].value!==void 0}getValue(R){return g(this._values[R].value)}setValue(R,at){this._values[R]=new Mu(this._values[R].property,at===null?void 0:g(at))}serialize(){let R={};for(let at of Object.keys(this._values)){let kt=this.getValue(at);kt!==void 0&&(R[at]=kt)}return R}possiblyEvaluate(R,at,kt){let jt=new Gh(this._properties);for(let Qt of Object.keys(this._values))jt._values[Qt]=this._values[Qt].possiblyEvaluate(R,at,kt);return jt}}class Wc{constructor(R,at,kt){this.property=R,this.value=at,this.parameters=kt}isConstant(){return this.value.kind==="constant"}constantOr(R){return this.value.kind==="constant"?this.value.value:R}evaluate(R,at,kt,jt){return this.property.evaluate(this.value,this.parameters,R,at,kt,jt)}}class Gh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPossiblyEvaluatedValues)}get(R){return this._values[R]}}class ds{constructor(R){this.specification=R}possiblyEvaluate(R,at){if(R.isDataDriven())throw new Error("Value should not be data driven");return R.expression.evaluate(at)}interpolate(R,at,kt){let jt=Zo[this.specification.type];return jt?jt(R,at,kt):R}}class $s{constructor(R,at){this.specification=R,this.overrides=at}possiblyEvaluate(R,at,kt,jt){return new Wc(this,R.expression.kind==="constant"||R.expression.kind==="camera"?{kind:"constant",value:R.expression.evaluate(at,null,{},kt,jt)}:R.expression,at)}interpolate(R,at,kt){if(R.value.kind!=="constant"||at.value.kind!=="constant")return R;if(R.value.value===void 0||at.value.value===void 0)return new Wc(this,{kind:"constant",value:void 0},R.parameters);let jt=Zo[this.specification.type];if(jt){let Qt=jt(R.value.value,at.value.value,kt);return new Wc(this,{kind:"constant",value:Qt},R.parameters)}return R}evaluate(R,at,kt,jt,Qt,re){return R.kind==="constant"?R.value:R.evaluate(at,kt,jt,Qt,re)}}class nh extends $s{possiblyEvaluate(R,at,kt,jt){if(R.value===void 0)return new Wc(this,{kind:"constant",value:void 0},at);if(R.expression.kind==="constant"){let Qt=R.expression.evaluate(at,null,{},kt,jt),re=R.property.specification.type==="resolvedImage"&&typeof Qt!="string"?Qt.name:Qt,Ae=this._calculate(re,re,re,at);return new Wc(this,{kind:"constant",value:Ae},at)}if(R.expression.kind==="camera"){let Qt=this._calculate(R.expression.evaluate({zoom:at.zoom-1}),R.expression.evaluate({zoom:at.zoom}),R.expression.evaluate({zoom:at.zoom+1}),at);return new Wc(this,{kind:"constant",value:Qt},at)}return new Wc(this,R.expression,at)}evaluate(R,at,kt,jt,Qt,re){if(R.kind==="source"){let Ae=R.evaluate(at,kt,jt,Qt,re);return this._calculate(Ae,Ae,Ae,at)}return R.kind==="composite"?this._calculate(R.evaluate({zoom:Math.floor(at.zoom)-1},kt,jt),R.evaluate({zoom:Math.floor(at.zoom)},kt,jt),R.evaluate({zoom:Math.floor(at.zoom)+1},kt,jt),at):R.value}_calculate(R,at,kt,jt){return jt.zoom>jt.zoomHistory.lastIntegerZoom?{from:R,to:at}:{from:kt,to:at}}interpolate(R){return R}}class eu{constructor(R){this.specification=R}possiblyEvaluate(R,at,kt,jt){if(R.value!==void 0){if(R.expression.kind==="constant"){let Qt=R.expression.evaluate(at,null,{},kt,jt);return this._calculate(Qt,Qt,Qt,at)}return this._calculate(R.expression.evaluate(new Zl(Math.floor(at.zoom-1),at)),R.expression.evaluate(new Zl(Math.floor(at.zoom),at)),R.expression.evaluate(new Zl(Math.floor(at.zoom+1),at)),at)}}_calculate(R,at,kt,jt){return jt.zoom>jt.zoomHistory.lastIntegerZoom?{from:R,to:at}:{from:kt,to:at}}interpolate(R){return R}}class lf{constructor(R){this.specification=R}possiblyEvaluate(R,at,kt,jt){return!!R.expression.evaluate(at,null,{},kt,jt)}interpolate(){return!1}}class Kt{constructor(R){this.properties=R,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let at in R){let kt=R[at];kt.specification.overridable&&this.overridableProperties.push(at);let jt=this.defaultPropertyValues[at]=new Mu(kt,void 0),Qt=this.defaultTransitionablePropertyValues[at]=new eh(kt);this.defaultTransitioningPropertyValues[at]=Qt.untransitioned(),this.defaultPossiblyEvaluatedValues[at]=jt.possiblyEvaluate({})}}}pa("DataDrivenProperty",$s),pa("DataConstantProperty",ds),pa("CrossFadedDataDrivenProperty",nh),pa("CrossFadedProperty",eu),pa("ColorRampProperty",lf);let O="-transition";class pt extends mt{constructor(R,at){if(super(),this.id=R.id,this.type=R.type,this._featureFilter={filter:()=>!0,needGeometry:!1},R.type!=="custom"&&(this.metadata=R.metadata,this.minzoom=R.minzoom,this.maxzoom=R.maxzoom,R.type!=="background"&&(this.source=R.source,this.sourceLayer=R["source-layer"],this.filter=R.filter),at.layout&&(this._unevaluatedLayout=new qh(at.layout)),at.paint)){this._transitionablePaint=new Vu(at.paint);for(let kt in R.paint)this.setPaintProperty(kt,R.paint[kt],{validate:!1});for(let kt in R.layout)this.setLayoutProperty(kt,R.layout[kt],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Gh(at.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(R){return R==="visibility"?this.visibility:this._unevaluatedLayout.getValue(R)}setLayoutProperty(R,at,kt={}){at!=null&&this._validate(uo,`layers.${this.id}.layout.${R}`,R,at,kt)||(R!=="visibility"?this._unevaluatedLayout.setValue(R,at):this.visibility=at)}getPaintProperty(R){return R.endsWith(O)?this._transitionablePaint.getTransition(R.slice(0,-11)):this._transitionablePaint.getValue(R)}setPaintProperty(R,at,kt={}){if(at!=null&&this._validate(Ja,`layers.${this.id}.paint.${R}`,R,at,kt))return!1;if(R.endsWith(O))return this._transitionablePaint.setTransition(R.slice(0,-11),at||void 0),!1;{let jt=this._transitionablePaint._values[R],Qt=jt.property.specification["property-type"]==="cross-faded-data-driven",re=jt.value.isDataDriven(),Ae=jt.value;this._transitionablePaint.setValue(R,at),this._handleSpecialPaintPropertyUpdate(R);let $e=this._transitionablePaint._values[R].value;return $e.isDataDriven()||re||Qt||this._handleOverridablePaintPropertyUpdate(R,Ae,$e)}}_handleSpecialPaintPropertyUpdate(R){}_handleOverridablePaintPropertyUpdate(R,at,kt){return!1}isHidden(R){return!!(this.minzoom&&R=this.maxzoom)||this.visibility==="none"}updateTransitions(R){this._transitioningPaint=this._transitionablePaint.transitioned(R,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(R,at){R.getCrossfadeParameters&&(this._crossfadeParameters=R.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(R,void 0,at)),this.paint=this._transitioningPaint.possiblyEvaluate(R,void 0,at)}serialize(){let R={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&&(R.layout=R.layout||{},R.layout.visibility=this.visibility),p(R,(at,kt)=>!(at===void 0||kt==="layout"&&!Object.keys(at).length||kt==="paint"&&!Object.keys(at).length))}_validate(R,at,kt,jt,Qt={}){return(!Qt||Qt.validate!==!1)&&Sa(this,R.call(Pi,{key:at,layerType:this.type,objectKey:kt,value:jt,styleSpec:dt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let R in this.paint._values){let at=this.paint.get(R);if(at instanceof Wc&&yu(at.property.specification)&&(at.value.kind==="source"||at.value.kind==="composite")&&at.value.isStateDependent)return!0}return!1}}let Dt={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ft{constructor(R,at){this._structArray=R,this._pos1=at*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class qt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(R,at){return R._trim(),at&&(R.isTransferred=!0,at.push(R.arrayBuffer)),{length:R.length,arrayBuffer:R.arrayBuffer}}static deserialize(R){let at=Object.create(this.prototype);return at.arrayBuffer=R.arrayBuffer,at.length=R.length,at.capacity=R.arrayBuffer.byteLength/at.bytesPerElement,at._refreshViews(),at}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(R){this.reserve(R),this.length=R}reserve(R){if(R>this.capacity){this.capacity=Math.max(R,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let at=this.uint8;this._refreshViews(),at&&this.uint8.set(at)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ee(X,R=1){let at=0,kt=0;return{members:X.map(jt=>{let Qt=Dt[jt.type].BYTES_PER_ELEMENT,re=at=je(at,Math.max(R,Qt)),Ae=jt.components||1;return kt=Math.max(kt,Qt),at+=Qt*Ae,{name:jt.name,type:jt.type,components:Ae,offset:re}}),size:je(at,Math.max(kt,R)),alignment:R}}function je(X,R){return Math.ceil(X/R)*R}class er extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at){let kt=this.length;return this.resize(kt+1),this.emplace(kt,R,at)}emplace(R,at,kt){let jt=2*R;return this.int16[jt+0]=at,this.int16[jt+1]=kt,R}}er.prototype.bytesPerElement=4,pa("StructArrayLayout2i4",er);class wr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.int16[Qt+0]=at,this.int16[Qt+1]=kt,this.int16[Qt+2]=jt,R}}wr.prototype.bytesPerElement=6,pa("StructArrayLayout3i6",wr);class Gr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt){let Qt=this.length;return this.resize(Qt+1),this.emplace(Qt,R,at,kt,jt)}emplace(R,at,kt,jt,Qt){let re=4*R;return this.int16[re+0]=at,this.int16[re+1]=kt,this.int16[re+2]=jt,this.int16[re+3]=Qt,R}}Gr.prototype.bytesPerElement=8,pa("StructArrayLayout4i8",Gr);class Zr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=6*R;return this.int16[$e+0]=at,this.int16[$e+1]=kt,this.int16[$e+2]=jt,this.int16[$e+3]=Qt,this.int16[$e+4]=re,this.int16[$e+5]=Ae,R}}Zr.prototype.bytesPerElement=12,pa("StructArrayLayout2i4i12",Zr);class Tn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=4*R,or=8*R;return this.int16[$e+0]=at,this.int16[$e+1]=kt,this.uint8[or+4]=jt,this.uint8[or+5]=Qt,this.uint8[or+6]=re,this.uint8[or+7]=Ae,R}}Tn.prototype.bytesPerElement=8,pa("StructArrayLayout2i4ub8",Tn);class qn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at){let kt=this.length;return this.resize(kt+1),this.emplace(kt,R,at)}emplace(R,at,kt){let jt=2*R;return this.float32[jt+0]=at,this.float32[jt+1]=kt,R}}qn.prototype.bytesPerElement=8,pa("StructArrayLayout2f8",qn);class te extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re,Ae,$e,or,Cr){let $r=this.length;return this.resize($r+1),this.emplace($r,R,at,kt,jt,Qt,re,Ae,$e,or,Cr)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r){let ln=10*R;return this.uint16[ln+0]=at,this.uint16[ln+1]=kt,this.uint16[ln+2]=jt,this.uint16[ln+3]=Qt,this.uint16[ln+4]=re,this.uint16[ln+5]=Ae,this.uint16[ln+6]=$e,this.uint16[ln+7]=or,this.uint16[ln+8]=Cr,this.uint16[ln+9]=$r,R}}te.prototype.bytesPerElement=20,pa("StructArrayLayout10ui20",te);class le extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln){let kn=this.length;return this.resize(kn+1),this.emplace(kn,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn){let Fn=12*R;return this.int16[Fn+0]=at,this.int16[Fn+1]=kt,this.int16[Fn+2]=jt,this.int16[Fn+3]=Qt,this.uint16[Fn+4]=re,this.uint16[Fn+5]=Ae,this.uint16[Fn+6]=$e,this.uint16[Fn+7]=or,this.int16[Fn+8]=Cr,this.int16[Fn+9]=$r,this.int16[Fn+10]=ln,this.int16[Fn+11]=kn,R}}le.prototype.bytesPerElement=24,pa("StructArrayLayout4i4ui4i24",le);class Te extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.float32[Qt+0]=at,this.float32[Qt+1]=kt,this.float32[Qt+2]=jt,R}}Te.prototype.bytesPerElement=12,pa("StructArrayLayout3f12",Te);class Pe extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(R){let at=this.length;return this.resize(at+1),this.emplace(at,R)}emplace(R,at){return this.uint32[1*R+0]=at,R}}Pe.prototype.bytesPerElement=4,pa("StructArrayLayout1ul4",Pe);class We extends qt{_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(R,at,kt,jt,Qt,re,Ae,$e,or){let Cr=this.length;return this.resize(Cr+1),this.emplace(Cr,R,at,kt,jt,Qt,re,Ae,$e,or)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr){let $r=10*R,ln=5*R;return this.int16[$r+0]=at,this.int16[$r+1]=kt,this.int16[$r+2]=jt,this.int16[$r+3]=Qt,this.int16[$r+4]=re,this.int16[$r+5]=Ae,this.uint32[ln+3]=$e,this.uint16[$r+8]=or,this.uint16[$r+9]=Cr,R}}We.prototype.bytesPerElement=20,pa("StructArrayLayout6i1ul2ui20",We);class Ne extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=6*R;return this.int16[$e+0]=at,this.int16[$e+1]=kt,this.int16[$e+2]=jt,this.int16[$e+3]=Qt,this.int16[$e+4]=re,this.int16[$e+5]=Ae,R}}Ne.prototype.bytesPerElement=12,pa("StructArrayLayout2i2i2i12",Ne);class Xe extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt){let re=this.length;return this.resize(re+1),this.emplace(re,R,at,kt,jt,Qt)}emplace(R,at,kt,jt,Qt,re){let Ae=4*R,$e=8*R;return this.float32[Ae+0]=at,this.float32[Ae+1]=kt,this.float32[Ae+2]=jt,this.int16[$e+6]=Qt,this.int16[$e+7]=re,R}}Xe.prototype.bytesPerElement=16,pa("StructArrayLayout2f1f2i16",Xe);class Pr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=16*R,or=4*R,Cr=8*R;return this.uint8[$e+0]=at,this.uint8[$e+1]=kt,this.float32[or+1]=jt,this.float32[or+2]=Qt,this.int16[Cr+6]=re,this.int16[Cr+7]=Ae,R}}Pr.prototype.bytesPerElement=16,pa("StructArrayLayout2ub2f2i16",Pr);class qr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.uint16[Qt+0]=at,this.uint16[Qt+1]=kt,this.uint16[Qt+2]=jt,R}}qr.prototype.bytesPerElement=6,pa("StructArrayLayout3ui6",qr);class Xr extends qt{_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(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui){let Na=this.length;return this.resize(Na+1),this.emplace(Na,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na){let fa=24*R,La=12*R,ho=48*R;return this.int16[fa+0]=at,this.int16[fa+1]=kt,this.uint16[fa+2]=jt,this.uint16[fa+3]=Qt,this.uint32[La+2]=re,this.uint32[La+3]=Ae,this.uint32[La+4]=$e,this.uint16[fa+10]=or,this.uint16[fa+11]=Cr,this.uint16[fa+12]=$r,this.float32[La+7]=ln,this.float32[La+8]=kn,this.uint8[ho+36]=Fn,this.uint8[ho+37]=Kn,this.uint8[ho+38]=mi,this.uint32[La+10]=Ui,this.int16[fa+22]=Na,R}}Xr.prototype.bytesPerElement=48,pa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Xr);class gn extends qt{_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(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na,fa,La,ho,Ro,Os,Nl,Ms,_s,sl,Ks){let Hs=this.length;return this.resize(Hs+1),this.emplace(Hs,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na,fa,La,ho,Ro,Os,Nl,Ms,_s,sl,Ks)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na,fa,La,ho,Ro,Os,Nl,Ms,_s,sl,Ks,Hs){let To=32*R,vl=16*R;return this.int16[To+0]=at,this.int16[To+1]=kt,this.int16[To+2]=jt,this.int16[To+3]=Qt,this.int16[To+4]=re,this.int16[To+5]=Ae,this.int16[To+6]=$e,this.int16[To+7]=or,this.uint16[To+8]=Cr,this.uint16[To+9]=$r,this.uint16[To+10]=ln,this.uint16[To+11]=kn,this.uint16[To+12]=Fn,this.uint16[To+13]=Kn,this.uint16[To+14]=mi,this.uint16[To+15]=Ui,this.uint16[To+16]=Na,this.uint16[To+17]=fa,this.uint16[To+18]=La,this.uint16[To+19]=ho,this.uint16[To+20]=Ro,this.uint16[To+21]=Os,this.uint16[To+22]=Nl,this.uint32[vl+12]=Ms,this.float32[vl+13]=_s,this.float32[vl+14]=sl,this.uint16[To+30]=Ks,this.uint16[To+31]=Hs,R}}gn.prototype.bytesPerElement=64,pa("StructArrayLayout8i15ui1ul2f2ui64",gn);class zn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R){let at=this.length;return this.resize(at+1),this.emplace(at,R)}emplace(R,at){return this.float32[1*R+0]=at,R}}zn.prototype.bytesPerElement=4,pa("StructArrayLayout1f4",zn);class Qn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.uint16[6*R+0]=at,this.float32[Qt+1]=kt,this.float32[Qt+2]=jt,R}}Qn.prototype.bytesPerElement=12,pa("StructArrayLayout1ui2f12",Qn);class ai extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=4*R;return this.uint32[2*R+0]=at,this.uint16[Qt+2]=kt,this.uint16[Qt+3]=jt,R}}ai.prototype.bytesPerElement=8,pa("StructArrayLayout1ul2ui8",ai);class Ti extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at){let kt=this.length;return this.resize(kt+1),this.emplace(kt,R,at)}emplace(R,at,kt){let jt=2*R;return this.uint16[jt+0]=at,this.uint16[jt+1]=kt,R}}Ti.prototype.bytesPerElement=4,pa("StructArrayLayout2ui4",Ti);class Qi extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R){let at=this.length;return this.resize(at+1),this.emplace(at,R)}emplace(R,at){return this.uint16[1*R+0]=at,R}}Qi.prototype.bytesPerElement=2,pa("StructArrayLayout1ui2",Qi);class Ma extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt){let Qt=this.length;return this.resize(Qt+1),this.emplace(Qt,R,at,kt,jt)}emplace(R,at,kt,jt,Qt){let re=4*R;return this.float32[re+0]=at,this.float32[re+1]=kt,this.float32[re+2]=jt,this.float32[re+3]=Qt,R}}Ma.prototype.bytesPerElement=16,pa("StructArrayLayout4f16",Ma);class Aa extends Ft{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new c(this.anchorPointX,this.anchorPointY)}}Aa.prototype.size=20;class Fa extends We{get(R){return new Aa(this,R)}}pa("CollisionBoxArray",Fa);class wo extends Ft{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(R){this._structArray.uint8[this._pos1+37]=R}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(R){this._structArray.uint8[this._pos1+38]=R}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(R){this._structArray.uint32[this._pos4+10]=R}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}wo.prototype.size=48;class Yo extends Xr{get(R){return new wo(this,R)}}pa("PlacedSymbolArray",Yo);class Fo extends Ft{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(R){this._structArray.uint32[this._pos4+12]=R}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Fo.prototype.size=64;class xs extends gn{get(R){return new Fo(this,R)}}pa("SymbolInstanceArray",xs);class Sl extends zn{getoffsetX(R){return this.float32[1*R+0]}}pa("GlyphOffsetArray",Sl);class Ll extends wr{getx(R){return this.int16[3*R+0]}gety(R){return this.int16[3*R+1]}gettileUnitDistanceFromAnchor(R){return this.int16[3*R+2]}}pa("SymbolLineVertexArray",Ll);class Ws extends Ft{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Ws.prototype.size=12;class zl extends Qn{get(R){return new Ws(this,R)}}pa("TextAnchorOffsetArray",zl);class Fc extends Ft{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]}}Fc.prototype.size=8;class Sc extends ai{get(R){return new Fc(this,R)}}pa("FeatureIndexArray",Sc);class rl extends er{}class nl extends er{}class au extends er{}class wu extends Zr{}class ih extends Tn{}class Et extends qn{}class Vt extends te{}class de extends le{}class Ie extends Te{}class Be extends Pe{}class He extends Ne{}class hr extends Pr{}class cr extends qr{}class Fr extends Ti{}let vn=Ee([{name:"a_pos",components:2,type:"Int16"}],4),{members:fn}=vn;class Bn{constructor(R=[]){this.segments=R}prepareSegment(R,at,kt,jt){let Qt=this.segments[this.segments.length-1];return R>Bn.MAX_VERTEX_ARRAY_LENGTH&&S(`Max vertices per segment is ${Bn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${R}`),(!Qt||Qt.vertexLength+R>Bn.MAX_VERTEX_ARRAY_LENGTH||Qt.sortKey!==jt)&&(Qt={vertexOffset:at.length,primitiveOffset:kt.length,vertexLength:0,primitiveLength:0},jt!==void 0&&(Qt.sortKey=jt),this.segments.push(Qt)),Qt}get(){return this.segments}destroy(){for(let R of this.segments)for(let at in R.vaos)R.vaos[at].destroy()}static simpleSegment(R,at,kt,jt){return new Bn([{vertexOffset:R,primitiveOffset:at,vertexLength:kt,primitiveLength:jt,vaos:{},sortKey:0}])}}function ti(X,R){return 256*(X=w(Math.floor(X),0,255))+w(Math.floor(R),0,255)}Bn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,pa("SegmentVector",Bn);let ei=Ee([{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 ra={exports:{}},si={exports:{}};si.exports=function(X,R){var at,kt,jt,Qt,re,Ae,$e,or;for(kt=X.length-(at=3&X.length),jt=R,re=3432918353,Ae=461845907,or=0;or>>16)*re&65535)<<16)&4294967295)<<15|$e>>>17))*Ae+((($e>>>16)*Ae&65535)<<16)&4294967295)<<13|jt>>>19))+((5*(jt>>>16)&65535)<<16)&4294967295))+((58964+(Qt>>>16)&65535)<<16);switch($e=0,at){case 3:$e^=(255&X.charCodeAt(or+2))<<16;case 2:$e^=(255&X.charCodeAt(or+1))<<8;case 1:jt^=$e=(65535&($e=($e=(65535&($e^=255&X.charCodeAt(or)))*re+((($e>>>16)*re&65535)<<16)&4294967295)<<15|$e>>>17))*Ae+((($e>>>16)*Ae&65535)<<16)&4294967295}return jt^=X.length,jt=2246822507*(65535&(jt^=jt>>>16))+((2246822507*(jt>>>16)&65535)<<16)&4294967295,jt=3266489909*(65535&(jt^=jt>>>13))+((3266489909*(jt>>>16)&65535)<<16)&4294967295,(jt^=jt>>>16)>>>0};var Oi=si.exports,$i={exports:{}};$i.exports=function(X,R){for(var at,kt=X.length,jt=R^kt,Qt=0;kt>=4;)at=1540483477*(65535&(at=255&X.charCodeAt(Qt)|(255&X.charCodeAt(++Qt))<<8|(255&X.charCodeAt(++Qt))<<16|(255&X.charCodeAt(++Qt))<<24))+((1540483477*(at>>>16)&65535)<<16),jt=1540483477*(65535&jt)+((1540483477*(jt>>>16)&65535)<<16)^(at=1540483477*(65535&(at^=at>>>24))+((1540483477*(at>>>16)&65535)<<16)),kt-=4,++Qt;switch(kt){case 3:jt^=(255&X.charCodeAt(Qt+2))<<16;case 2:jt^=(255&X.charCodeAt(Qt+1))<<8;case 1:jt=1540483477*(65535&(jt^=255&X.charCodeAt(Qt)))+((1540483477*(jt>>>16)&65535)<<16)}return jt=1540483477*(65535&(jt^=jt>>>13))+((1540483477*(jt>>>16)&65535)<<16),(jt^=jt>>>15)>>>0};var Ki=Oi,sa=$i.exports;ra.exports=Ki,ra.exports.murmur3=Ki,ra.exports.murmur2=sa;var vi=a(ra.exports);class ro{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(R,at,kt,jt){this.ids.push(ao(R)),this.positions.push(at,kt,jt)}getPositions(R){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let at=ao(R),kt=0,jt=this.ids.length-1;for(;kt>1;this.ids[re]>=at?jt=re:kt=re+1}let Qt=[];for(;this.ids[kt]===at;)Qt.push({index:this.positions[3*kt],start:this.positions[3*kt+1],end:this.positions[3*kt+2]}),kt++;return Qt}static serialize(R,at){let kt=new Float64Array(R.ids),jt=new Uint32Array(R.positions);return xo(kt,jt,0,kt.length-1),at&&at.push(kt.buffer,jt.buffer),{ids:kt,positions:jt}}static deserialize(R){let at=new ro;return at.ids=R.ids,at.positions=R.positions,at.indexed=!0,at}}function ao(X){let R=+X;return!isNaN(R)&&R<=Number.MAX_SAFE_INTEGER?R:vi(String(X))}function xo(X,R,at,kt){for(;at>1],Qt=at-1,re=kt+1;for(;;){do Qt++;while(X[Qt]jt);if(Qt>=re)break;$o(X,Qt,re),$o(R,3*Qt,3*re),$o(R,3*Qt+1,3*re+1),$o(R,3*Qt+2,3*re+2)}re-at`u_${jt}`),this.type=kt}setUniform(R,at,kt){R.set(kt.constantOr(this.value))}getBinding(R,at,kt){return this.type==="color"?new as(R,at):new rs(R,at)}}class wc{constructor(R,at){this.uniformNames=at.map(kt=>`u_${kt}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(R,at){this.pixelRatioFrom=at.pixelRatio,this.pixelRatioTo=R.pixelRatio,this.patternFrom=at.tlbr,this.patternTo=R.tlbr}setUniform(R,at,kt,jt){let Qt=jt==="u_pattern_to"?this.patternTo:jt==="u_pattern_from"?this.patternFrom:jt==="u_pixel_ratio_to"?this.pixelRatioTo:jt==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Qt&&R.set(Qt)}getBinding(R,at,kt){return kt.substr(0,9)==="u_pattern"?new _l(R,at):new rs(R,at)}}class zo{constructor(R,at,kt,jt){this.expression=R,this.type=kt,this.maxValue=0,this.paintVertexAttributes=at.map(Qt=>({name:`a_${Qt}`,type:"Float32",components:kt==="color"?2:1,offset:0})),this.paintVertexArray=new jt}populatePaintArray(R,at,kt,jt,Qt){let re=this.paintVertexArray.length,Ae=this.expression.evaluate(new Zl(0),at,{},jt,[],Qt);this.paintVertexArray.resize(R),this._setPaintValue(re,R,Ae)}updatePaintArray(R,at,kt,jt){let Qt=this.expression.evaluate({zoom:0},kt,jt);this._setPaintValue(R,at,Qt)}_setPaintValue(R,at,kt){if(this.type==="color"){let jt=Bl(kt);for(let Qt=R;Qt`u_${Ae}_t`),this.type=kt,this.useIntegerZoom=jt,this.zoom=Qt,this.maxValue=0,this.paintVertexAttributes=at.map(Ae=>({name:`a_${Ae}`,type:"Float32",components:kt==="color"?4:2,offset:0})),this.paintVertexArray=new re}populatePaintArray(R,at,kt,jt,Qt){let re=this.expression.evaluate(new Zl(this.zoom),at,{},jt,[],Qt),Ae=this.expression.evaluate(new Zl(this.zoom+1),at,{},jt,[],Qt),$e=this.paintVertexArray.length;this.paintVertexArray.resize(R),this._setPaintValue($e,R,re,Ae)}updatePaintArray(R,at,kt,jt){let Qt=this.expression.evaluate({zoom:this.zoom},kt,jt),re=this.expression.evaluate({zoom:this.zoom+1},kt,jt);this._setPaintValue(R,at,Qt,re)}_setPaintValue(R,at,kt,jt){if(this.type==="color"){let Qt=Bl(kt),re=Bl(jt);for(let Ae=R;Ae`#define HAS_UNIFORM_${jt}`))}return R}getBinderAttributes(){let R=[];for(let at in this.binders){let kt=this.binders[at];if(kt instanceof zo||kt instanceof il)for(let jt=0;jt!0){this.programConfigurations={};for(let jt of R)this.programConfigurations[jt.id]=new yc(jt,at,kt);this.needsUpload=!1,this._featureMap=new ro,this._bufferOffset=0}populatePaintArrays(R,at,kt,jt,Qt,re){for(let Ae in this.programConfigurations)this.programConfigurations[Ae].populatePaintArrays(R,at,jt,Qt,re);at.id!==void 0&&this._featureMap.add(at.id,kt,this._bufferOffset,R),this._bufferOffset=R,this.needsUpload=!0}updatePaintArrays(R,at,kt,jt){for(let Qt of kt)this.needsUpload=this.programConfigurations[Qt.id].updatePaintArrays(R,this._featureMap,at,Qt,jt)||this.needsUpload}get(R){return this.programConfigurations[R]}upload(R){if(this.needsUpload){for(let at in this.programConfigurations)this.programConfigurations[at].upload(R);this.needsUpload=!1}}destroy(){for(let R in this.programConfigurations)this.programConfigurations[R].destroy()}}function ph(X,R){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"]}[X]||[X.replace(`${R}-`,"").replace(/-/g,"_")]}function Yl(X,R,at){let kt={color:{source:qn,composite:Ma},number:{source:zn,composite:qn}},jt=function(Qt){return{"line-pattern":{source:Vt,composite:Vt},"fill-pattern":{source:Vt,composite:Vt},"fill-extrusion-pattern":{source:Vt,composite:Vt}}[Qt]}(X);return jt&&jt[at]||kt[R][at]}pa("ConstantBinder",ou),pa("CrossFadedConstantBinder",wc),pa("SourceExpressionBinder",zo),pa("CrossFadedCompositeBinder",ml),pa("CompositeExpressionBinder",il),pa("ProgramConfiguration",yc,{omit:["_buffers"]}),pa("ProgramConfigurationSet",oc);let hc=8192,zh=Math.pow(2,14)-1,Se=-zh-1;function Ir(X){let R=hc/X.extent,at=X.loadGeometry();for(let kt=0;ktre.x+1||$ere.y+1)&&S("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return at}function Vr(X,R){return{type:X.type,id:X.id,properties:X.properties,geometry:R?Ir(X):[]}}function ri(X,R,at,kt,jt){X.emplaceBack(2*R+(kt+1)/2,2*at+(jt+1)/2)}class Ai{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(at=>at.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new nl,this.indexArray=new cr,this.segments=new Bn,this.programConfigurations=new oc(R.layers,R.zoom),this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){let jt=this.layers[0],Qt=[],re=null,Ae=!1;jt.type==="circle"&&(re=jt.layout.get("circle-sort-key"),Ae=!re.isConstant());for(let{feature:$e,id:or,index:Cr,sourceLayerIndex:$r}of R){let ln=this.layers[0]._featureFilter.needGeometry,kn=Vr($e,ln);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),kn,kt))continue;let Fn=Ae?re.evaluate(kn,{},kt):void 0,Kn={id:or,properties:$e.properties,type:$e.type,sourceLayerIndex:$r,index:Cr,geometry:ln?kn.geometry:Ir($e),patterns:{},sortKey:Fn};Qt.push(Kn)}Ae&&Qt.sort(($e,or)=>$e.sortKey-or.sortKey);for(let $e of Qt){let{geometry:or,index:Cr,sourceLayerIndex:$r}=$e,ln=R[Cr].feature;this.addFeature($e,or,Cr,kt),at.featureIndex.insert(ln,or,Cr,$r,this.index)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,fn),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(R,at,kt,jt){for(let Qt of at)for(let re of Qt){let Ae=re.x,$e=re.y;if(Ae<0||Ae>=hc||$e<0||$e>=hc)continue;let or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,R.sortKey),Cr=or.vertexLength;ri(this.layoutVertexArray,Ae,$e,-1,-1),ri(this.layoutVertexArray,Ae,$e,1,-1),ri(this.layoutVertexArray,Ae,$e,1,1),ri(this.layoutVertexArray,Ae,$e,-1,1),this.indexArray.emplaceBack(Cr,Cr+1,Cr+2),this.indexArray.emplaceBack(Cr,Cr+3,Cr+2),or.vertexLength+=4,or.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,kt,{},jt)}}function bi(X,R){for(let at=0;at1){if(ia(X,R))return!0;for(let kt=0;kt1?at:at.sub(R)._mult(jt)._add(R))}function ma(X,R){let at,kt,jt,Qt=!1;for(let re=0;reR.y!=jt.y>R.y&&R.x<(jt.x-kt.x)*(R.y-kt.y)/(jt.y-kt.y)+kt.x&&(Qt=!Qt)}return Qt}function ji(X,R){let at=!1;for(let kt=0,jt=X.length-1;ktR.y!=re.y>R.y&&R.x<(re.x-Qt.x)*(R.y-Qt.y)/(re.y-Qt.y)+Qt.x&&(at=!at)}return at}function En(X,R,at){let kt=at[0],jt=at[2];if(X.xjt.x&&R.x>jt.x||X.yjt.y&&R.y>jt.y)return!1;let Qt=N(X,R,at[0]);return Qt!==N(X,R,at[1])||Qt!==N(X,R,at[2])||Qt!==N(X,R,at[3])}function oi(X,R,at){let kt=R.paint.get(X).value;return kt.kind==="constant"?kt.value:at.programConfigurations.get(R.id).getMaxValue(X)}function Yi(X){return Math.sqrt(X[0]*X[0]+X[1]*X[1])}function Ni(X,R,at,kt,jt){if(!R[0]&&!R[1])return X;let Qt=c.convert(R)._mult(jt);at==="viewport"&&Qt._rotate(-kt);let re=[];for(let Ae=0;AeVo(mi,Kn))}(or,$e),kn=$r?Cr*Ae:Cr;for(let Fn of jt)for(let Kn of Fn){let mi=$r?Kn:Vo(Kn,$e),Ui=kn,Na=ua([],[Kn.x,Kn.y,0,1],$e);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ui*=Na[3]/re.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ui*=re.cameraToCenterDistance/Na[3]),On(ln,mi,Ui))return!0}return!1}}function Vo(X,R){let at=ua([],[X.x,X.y,0,1],R);return new c(at[0]/at[3],at[1]/at[3])}class Bo extends Ai{}let za;pa("HeatmapBucket",Bo,{omit:["layers"]});var Ya={get paint(){return za=za||new Kt({"heatmap-radius":new $s(dt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new $s(dt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ds(dt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new lf(dt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ds(dt.paint_heatmap["heatmap-opacity"])})}};function Eo(X,{width:R,height:at},kt,jt){if(jt){if(jt instanceof Uint8ClampedArray)jt=new Uint8Array(jt.buffer);else if(jt.length!==R*at*kt)throw new RangeError(`mismatched image size. expected: ${jt.length} but got: ${R*at*kt}`)}else jt=new Uint8Array(R*at*kt);return X.width=R,X.height=at,X.data=jt,X}function No(X,{width:R,height:at},kt){if(R===X.width&&at===X.height)return;let jt=Eo({},{width:R,height:at},kt);hs(X,jt,{x:0,y:0},{x:0,y:0},{width:Math.min(X.width,R),height:Math.min(X.height,at)},kt),X.width=R,X.height=at,X.data=jt.data}function hs(X,R,at,kt,jt,Qt){if(jt.width===0||jt.height===0)return R;if(jt.width>X.width||jt.height>X.height||at.x>X.width-jt.width||at.y>X.height-jt.height)throw new RangeError("out of range source coordinates for image copy");if(jt.width>R.width||jt.height>R.height||kt.x>R.width-jt.width||kt.y>R.height-jt.height)throw new RangeError("out of range destination coordinates for image copy");let re=X.data,Ae=R.data;if(re===Ae)throw new Error("srcData equals dstData, so image is already copied");for(let $e=0;$e{R[X.evaluationKey]=$e;let or=X.expression.evaluate(R);jt.data[re+Ae+0]=Math.floor(255*or.r/or.a),jt.data[re+Ae+1]=Math.floor(255*or.g/or.a),jt.data[re+Ae+2]=Math.floor(255*or.b/or.a),jt.data[re+Ae+3]=Math.floor(255*or.a)};if(X.clips)for(let re=0,Ae=0;re80*at){Ae=1/0,$e=1/0;let Cr=-1/0,$r=-1/0;for(let ln=at;lnCr&&(Cr=kn),Fn>$r&&($r=Fn)}or=Math.max(Cr-Ae,$r-$e),or=or!==0?32767/or:0}return xl(Qt,re,at,Ae,$e,or,0),re}function Xo(X,R,at,kt,jt){let Qt;if(jt===function(re,Ae,$e,or){let Cr=0;for(let $r=Ae,ln=$e-or;$r<$e;$r+=or)Cr+=(re[ln]-re[$r])*(re[$r+1]+re[ln+1]),ln=$r;return Cr}(X,R,at,kt)>0)for(let re=R;re=R;re-=kt)Qt=ar(re/kt|0,X[re],X[re+1],Qt);return Qt&&ke(Qt,Qt.next)&&(dr(Qt),Qt=Qt.next),Qt}function Oc(X,R){if(!X)return X;R||(R=X);let at,kt=X;do if(at=!1,kt.steiner||!ke(kt,kt.next)&&ve(kt.prev,kt,kt.next)!==0)kt=kt.next;else{if(dr(kt),kt=R=kt.prev,kt===kt.next)break;at=!0}while(at||kt!==R);return R}function xl(X,R,at,kt,jt,Qt,re){if(!X)return;!re&&Qt&&function($e,or,Cr,$r){let ln=$e;do ln.z===0&&(ln.z=lt(ln.x,ln.y,or,Cr,$r)),ln.prevZ=ln.prev,ln.nextZ=ln.next,ln=ln.next;while(ln!==$e);ln.prevZ.nextZ=null,ln.prevZ=null,function(kn){let Fn,Kn=1;do{let mi,Ui=kn;kn=null;let Na=null;for(Fn=0;Ui;){Fn++;let fa=Ui,La=0;for(let Ro=0;Ro0||ho>0&&fa;)La!==0&&(ho===0||!fa||Ui.z<=fa.z)?(mi=Ui,Ui=Ui.nextZ,La--):(mi=fa,fa=fa.nextZ,ho--),Na?Na.nextZ=mi:kn=mi,mi.prevZ=Na,Na=mi;Ui=fa}Na.nextZ=null,Kn*=2}while(Fn>1)}(ln)}(X,kt,jt,Qt);let Ae=X;for(;X.prev!==X.next;){let $e=X.prev,or=X.next;if(Qt?Lu(X,kt,jt,Qt):jc(X))R.push($e.i,X.i,or.i),dr(X),X=or.next,Ae=or.next;else if((X=or)===Ae){re?re===1?xl(X=jo(Oc(X),R),R,at,kt,jt,Qt,2):re===2&&Rs(X,R,at,kt,jt,Qt):xl(Oc(X),R,at,kt,jt,Qt,1);break}}}function jc(X){let R=X.prev,at=X,kt=X.next;if(ve(R,at,kt)>=0)return!1;let jt=R.x,Qt=at.x,re=kt.x,Ae=R.y,$e=at.y,or=kt.y,Cr=jtQt?jt>re?jt:re:Qt>re?Qt:re,kn=Ae>$e?Ae>or?Ae:or:$e>or?$e:or,Fn=kt.next;for(;Fn!==R;){if(Fn.x>=Cr&&Fn.x<=ln&&Fn.y>=$r&&Fn.y<=kn&&wt(jt,Ae,Qt,$e,re,or,Fn.x,Fn.y)&&ve(Fn.prev,Fn,Fn.next)>=0)return!1;Fn=Fn.next}return!0}function Lu(X,R,at,kt){let jt=X.prev,Qt=X,re=X.next;if(ve(jt,Qt,re)>=0)return!1;let Ae=jt.x,$e=Qt.x,or=re.x,Cr=jt.y,$r=Qt.y,ln=re.y,kn=Ae<$e?Ae$e?Ae>or?Ae:or:$e>or?$e:or,mi=Cr>$r?Cr>ln?Cr:ln:$r>ln?$r:ln,Ui=lt(kn,Fn,R,at,kt),Na=lt(Kn,mi,R,at,kt),fa=X.prevZ,La=X.nextZ;for(;fa&&fa.z>=Ui&&La&&La.z<=Na;){if(fa.x>=kn&&fa.x<=Kn&&fa.y>=Fn&&fa.y<=mi&&fa!==jt&&fa!==re&&wt(Ae,Cr,$e,$r,or,ln,fa.x,fa.y)&&ve(fa.prev,fa,fa.next)>=0||(fa=fa.prevZ,La.x>=kn&&La.x<=Kn&&La.y>=Fn&&La.y<=mi&&La!==jt&&La!==re&&wt(Ae,Cr,$e,$r,or,ln,La.x,La.y)&&ve(La.prev,La,La.next)>=0))return!1;La=La.nextZ}for(;fa&&fa.z>=Ui;){if(fa.x>=kn&&fa.x<=Kn&&fa.y>=Fn&&fa.y<=mi&&fa!==jt&&fa!==re&&wt(Ae,Cr,$e,$r,or,ln,fa.x,fa.y)&&ve(fa.prev,fa,fa.next)>=0)return!1;fa=fa.prevZ}for(;La&&La.z<=Na;){if(La.x>=kn&&La.x<=Kn&&La.y>=Fn&&La.y<=mi&&La!==jt&&La!==re&&wt(Ae,Cr,$e,$r,or,ln,La.x,La.y)&&ve(La.prev,La,La.next)>=0)return!1;La=La.nextZ}return!0}function jo(X,R){let at=X;do{let kt=at.prev,jt=at.next.next;!ke(kt,jt)&&Jt(kt,at,at.next,jt)&&lr(kt,jt)&&lr(jt,kt)&&(R.push(kt.i,at.i,jt.i),dr(at),dr(at.next),at=X=jt),at=at.next}while(at!==X);return Oc(at)}function Rs(X,R,at,kt,jt,Qt){let re=X;do{let Ae=re.next.next;for(;Ae!==re.prev;){if(re.i!==Ae.i&&Wt(re,Ae)){let $e=tr(re,Ae);return re=Oc(re,re.next),$e=Oc($e,$e.next),xl(re,R,at,kt,jt,Qt,0),void xl($e,R,at,kt,jt,Qt,0)}Ae=Ae.next}re=re.next}while(re!==X)}function Fl(X,R){return X.x-R.x}function Pl(X,R){let at=function(jt,Qt){let re=Qt,Ae=jt.x,$e=jt.y,or,Cr=-1/0;do{if($e<=re.y&&$e>=re.next.y&&re.next.y!==re.y){let Kn=re.x+($e-re.y)*(re.next.x-re.x)/(re.next.y-re.y);if(Kn<=Ae&&Kn>Cr&&(Cr=Kn,or=re.x=re.x&&re.x>=ln&&Ae!==re.x&&wt($eor.x||re.x===or.x&&Z(or,re)))&&(or=re,Fn=Kn)}re=re.next}while(re!==$r);return or}(X,R);if(!at)return R;let kt=tr(at,X);return Oc(kt,kt.next),Oc(at,at.next)}function Z(X,R){return ve(X.prev,X,R.prev)<0&&ve(R.next,X,X.next)<0}function lt(X,R,at,kt,jt){return(X=1431655765&((X=858993459&((X=252645135&((X=16711935&((X=(X-at)*jt|0)|X<<8))|X<<4))|X<<2))|X<<1))|(R=1431655765&((R=858993459&((R=252645135&((R=16711935&((R=(R-kt)*jt|0)|R<<8))|R<<4))|R<<2))|R<<1))<<1}function nt(X){let R=X,at=X;do(R.x=(X-re)*(Qt-Ae)&&(X-re)*(kt-Ae)>=(at-re)*(R-Ae)&&(at-re)*(Qt-Ae)>=(jt-re)*(kt-Ae)}function Wt(X,R){return X.next.i!==R.i&&X.prev.i!==R.i&&!function(at,kt){let jt=at;do{if(jt.i!==at.i&&jt.next.i!==at.i&&jt.i!==kt.i&&jt.next.i!==kt.i&&Jt(jt,jt.next,at,kt))return!0;jt=jt.next}while(jt!==at);return!1}(X,R)&&(lr(X,R)&&lr(R,X)&&function(at,kt){let jt=at,Qt=!1,re=(at.x+kt.x)/2,Ae=(at.y+kt.y)/2;do jt.y>Ae!=jt.next.y>Ae&&jt.next.y!==jt.y&&re<(jt.next.x-jt.x)*(Ae-jt.y)/(jt.next.y-jt.y)+jt.x&&(Qt=!Qt),jt=jt.next;while(jt!==at);return Qt}(X,R)&&(ve(X.prev,X,R.prev)||ve(X,R.prev,R))||ke(X,R)&&ve(X.prev,X,X.next)>0&&ve(R.prev,R,R.next)>0)}function ve(X,R,at){return(R.y-X.y)*(at.x-R.x)-(R.x-X.x)*(at.y-R.y)}function ke(X,R){return X.x===R.x&&X.y===R.y}function Jt(X,R,at,kt){let jt=De(ve(X,R,at)),Qt=De(ve(X,R,kt)),re=De(ve(at,kt,X)),Ae=De(ve(at,kt,R));return jt!==Qt&&re!==Ae||!(jt!==0||!fe(X,at,R))||!(Qt!==0||!fe(X,kt,R))||!(re!==0||!fe(at,X,kt))||!(Ae!==0||!fe(at,R,kt))}function fe(X,R,at){return R.x<=Math.max(X.x,at.x)&&R.x>=Math.min(X.x,at.x)&&R.y<=Math.max(X.y,at.y)&&R.y>=Math.min(X.y,at.y)}function De(X){return X>0?1:X<0?-1:0}function lr(X,R){return ve(X.prev,X,X.next)<0?ve(X,R,X.next)>=0&&ve(X,X.prev,R)>=0:ve(X,R,X.prev)<0||ve(X,X.next,R)<0}function tr(X,R){let at=gr(X.i,X.x,X.y),kt=gr(R.i,R.x,R.y),jt=X.next,Qt=R.prev;return X.next=R,R.prev=X,at.next=jt,jt.prev=at,kt.next=at,at.prev=kt,Qt.next=kt,kt.prev=Qt,kt}function ar(X,R,at,kt){let jt=gr(X,R,at);return kt?(jt.next=kt.next,jt.prev=kt,kt.next.prev=jt,kt.next=jt):(jt.prev=jt,jt.next=jt),jt}function dr(X){X.next.prev=X.prev,X.prev.next=X.next,X.prevZ&&(X.prevZ.nextZ=X.nextZ),X.nextZ&&(X.nextZ.prevZ=X.prevZ)}function gr(X,R,at){return{i:X,x:R,y:at,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ge(X,R,at){let kt=at.patternDependencies,jt=!1;for(let Qt of R){let re=Qt.paint.get(`${X}-pattern`);re.isConstant()||(jt=!0);let Ae=re.constantOr(null);Ae&&(jt=!0,kt[Ae.to]=!0,kt[Ae.from]=!0)}return jt}function rr(X,R,at,kt,jt){let Qt=jt.patternDependencies;for(let re of R){let Ae=re.paint.get(`${X}-pattern`).value;if(Ae.kind!=="constant"){let $e=Ae.evaluate({zoom:kt-1},at,{},jt.availableImages),or=Ae.evaluate({zoom:kt},at,{},jt.availableImages),Cr=Ae.evaluate({zoom:kt+1},at,{},jt.availableImages);$e=$e&&$e.name?$e.name:$e,or=or&&or.name?or.name:or,Cr=Cr&&Cr.name?Cr.name:Cr,Qt[$e]=!0,Qt[or]=!0,Qt[Cr]=!0,at.patterns[re.id]={min:$e,mid:or,max:Cr}}}return at}class Je{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(at=>at.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new au,this.indexArray=new cr,this.indexArray2=new Fr,this.programConfigurations=new oc(R.layers,R.zoom),this.segments=new Bn,this.segments2=new Bn,this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){this.hasPattern=Ge("fill",this.layers,at);let jt=this.layers[0].layout.get("fill-sort-key"),Qt=!jt.isConstant(),re=[];for(let{feature:Ae,id:$e,index:or,sourceLayerIndex:Cr}of R){let $r=this.layers[0]._featureFilter.needGeometry,ln=Vr(Ae,$r);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),ln,kt))continue;let kn=Qt?jt.evaluate(ln,{},kt,at.availableImages):void 0,Fn={id:$e,properties:Ae.properties,type:Ae.type,sourceLayerIndex:Cr,index:or,geometry:$r?ln.geometry:Ir(Ae),patterns:{},sortKey:kn};re.push(Fn)}Qt&&re.sort((Ae,$e)=>Ae.sortKey-$e.sortKey);for(let Ae of re){let{geometry:$e,index:or,sourceLayerIndex:Cr}=Ae;if(this.hasPattern){let $r=rr("fill",this.layers,Ae,this.zoom,at);this.patternFeatures.push($r)}else this.addFeature(Ae,$e,or,kt,{});at.featureIndex.insert(R[or].feature,$e,or,Cr,this.index)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}addFeatures(R,at,kt){for(let jt of this.patternFeatures)this.addFeature(jt,jt.geometry,jt.index,at,kt)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,kc),this.indexBuffer=R.createIndexBuffer(this.indexArray),this.indexBuffer2=R.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(R),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(R,at,kt,jt,Qt){for(let re of uh(at,500)){let Ae=0;for(let kn of re)Ae+=kn.length;let $e=this.segments.prepareSegment(Ae,this.layoutVertexArray,this.indexArray),or=$e.vertexLength,Cr=[],$r=[];for(let kn of re){if(kn.length===0)continue;kn!==re[0]&&$r.push(Cr.length/2);let Fn=this.segments2.prepareSegment(kn.length,this.layoutVertexArray,this.indexArray2),Kn=Fn.vertexLength;this.layoutVertexArray.emplaceBack(kn[0].x,kn[0].y),this.indexArray2.emplaceBack(Kn+kn.length-1,Kn),Cr.push(kn[0].x),Cr.push(kn[0].y);for(let mi=1;mi>3}if(jt--,kt===1||kt===2)Qt+=X.readSVarint(),re+=X.readSVarint(),kt===1&&(R&&Ae.push(R),R=[]),R.push(new da(Qt,re));else{if(kt!==7)throw new Error("unknown command "+kt);R&&R.push(R[0].clone())}}return R&&Ae.push(R),Ae},Wi.prototype.bbox=function(){var X=this._pbf;X.pos=this._geometry;for(var R=X.readVarint()+X.pos,at=1,kt=0,jt=0,Qt=0,re=1/0,Ae=-1/0,$e=1/0,or=-1/0;X.pos>3}if(kt--,at===1||at===2)(jt+=X.readSVarint())Ae&&(Ae=jt),(Qt+=X.readSVarint())<$e&&($e=Qt),Qt>or&&(or=Qt);else if(at!==7)throw new Error("unknown command "+at)}return[re,$e,Ae,or]},Wi.prototype.toGeoJSON=function(X,R,at){var kt,jt,Qt=this.extent*Math.pow(2,at),re=this.extent*X,Ae=this.extent*R,$e=this.loadGeometry(),or=Wi.types[this.type];function Cr(kn){for(var Fn=0;Fn>3;jt=re===1?kt.readString():re===2?kt.readFloat():re===3?kt.readDouble():re===4?kt.readVarint64():re===5?kt.readVarint():re===6?kt.readSVarint():re===7?kt.readBoolean():null}return jt}(at))}As.prototype.feature=function(X){if(X<0||X>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[X];var R=this._pbf.readVarint()+this._pbf.pos;return new So(this._pbf,R,this.extent,this._keys,this._values)};var Jl=ns;function Al(X,R,at){if(X===3){var kt=new Jl(at,at.readVarint()+at.pos);kt.length&&(R[kt.name]=kt)}}Di.VectorTile=function(X,R){this.layers=X.readFields(Al,{},R)},Di.VectorTileFeature=Hi,Di.VectorTileLayer=ns;let Ql=Di.VectorTileFeature.types,Pu=Math.pow(2,13);function qs(X,R,at,kt,jt,Qt,re,Ae){X.emplaceBack(R,at,2*Math.floor(kt*Pu)+re,jt*Pu*2,Qt*Pu*2,Math.round(Ae))}class Bc{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(at=>at.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new wu,this.centroidVertexArray=new rl,this.indexArray=new cr,this.programConfigurations=new oc(R.layers,R.zoom),this.segments=new Bn,this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){this.features=[],this.hasPattern=Ge("fill-extrusion",this.layers,at);for(let{feature:jt,id:Qt,index:re,sourceLayerIndex:Ae}of R){let $e=this.layers[0]._featureFilter.needGeometry,or=Vr(jt,$e);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),or,kt))continue;let Cr={id:Qt,sourceLayerIndex:Ae,index:re,geometry:$e?or.geometry:Ir(jt),properties:jt.properties,type:jt.type,patterns:{}};this.hasPattern?this.features.push(rr("fill-extrusion",this.layers,Cr,this.zoom,at)):this.addFeature(Cr,Cr.geometry,re,kt,{}),at.featureIndex.insert(jt,Cr.geometry,re,Ae,this.index,!0)}}addFeatures(R,at,kt){for(let jt of this.features){let{geometry:Qt}=jt;this.addFeature(jt,Qt,jt.index,at,kt)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,Vi),this.centroidVertexBuffer=R.createVertexBuffer(this.centroidVertexArray,gi.members,!0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(R,at,kt,jt,Qt){for(let re of uh(at,500)){let Ae={x:0,y:0,vertexCount:0},$e=0;for(let Fn of re)$e+=Fn.length;let or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let Fn of re){if(Fn.length===0||Vd(Fn))continue;let Kn=0;for(let mi=0;mi=1){let Na=Fn[mi-1];if(!md(Ui,Na)){or.vertexLength+4>Bn.MAX_VERTEX_ARRAY_LENGTH&&(or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let fa=Ui.sub(Na)._perp()._unit(),La=Na.dist(Ui);Kn+La>32768&&(Kn=0),qs(this.layoutVertexArray,Ui.x,Ui.y,fa.x,fa.y,0,0,Kn),qs(this.layoutVertexArray,Ui.x,Ui.y,fa.x,fa.y,0,1,Kn),Ae.x+=2*Ui.x,Ae.y+=2*Ui.y,Ae.vertexCount+=2,Kn+=La,qs(this.layoutVertexArray,Na.x,Na.y,fa.x,fa.y,0,0,Kn),qs(this.layoutVertexArray,Na.x,Na.y,fa.x,fa.y,0,1,Kn),Ae.x+=2*Na.x,Ae.y+=2*Na.y,Ae.vertexCount+=2;let ho=or.vertexLength;this.indexArray.emplaceBack(ho,ho+2,ho+1),this.indexArray.emplaceBack(ho+1,ho+2,ho+3),or.vertexLength+=4,or.primitiveLength+=2}}}}if(or.vertexLength+$e>Bn.MAX_VERTEX_ARRAY_LENGTH&&(or=this.segments.prepareSegment($e,this.layoutVertexArray,this.indexArray)),Ql[R.type]!=="Polygon")continue;let Cr=[],$r=[],ln=or.vertexLength;for(let Fn of re)if(Fn.length!==0){Fn!==re[0]&&$r.push(Cr.length/2);for(let Kn=0;Knhc)||X.y===R.y&&(X.y<0||X.y>hc)}function Vd(X){return X.every(R=>R.x<0)||X.every(R=>R.x>hc)||X.every(R=>R.y<0)||X.every(R=>R.y>hc)}let M0;pa("FillExtrusionBucket",Bc,{omit:["layers","features"]});var gm={get paint(){return M0=M0||new Kt({"fill-extrusion-opacity":new ds(dt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new $s(dt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ds(dt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ds(dt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new nh(dt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new $s(dt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new $s(dt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ds(dt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class u0 extends pt{constructor(R){super(R,gm)}createBucket(R){return new Bc(R)}queryRadius(){return Yi(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(R,at,kt,jt,Qt,re,Ae,$e){let or=Ni(R,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),re.angle,Ae),Cr=this.paint.get("fill-extrusion-height").evaluate(at,kt),$r=this.paint.get("fill-extrusion-base").evaluate(at,kt),ln=function(Fn,Kn,mi,Ui){let Na=[];for(let fa of Fn){let La=[fa.x,fa.y,0,1];ua(La,La,Kn),Na.push(new c(La[0]/La[3],La[1]/La[3]))}return Na}(or,$e),kn=function(Fn,Kn,mi,Ui){let Na=[],fa=[],La=Ui[8]*Kn,ho=Ui[9]*Kn,Ro=Ui[10]*Kn,Os=Ui[11]*Kn,Nl=Ui[8]*mi,Ms=Ui[9]*mi,_s=Ui[10]*mi,sl=Ui[11]*mi;for(let Ks of Fn){let Hs=[],To=[];for(let vl of Ks){let ll=vl.x,rc=vl.y,wh=Ui[0]*ll+Ui[4]*rc+Ui[12],mh=Ui[1]*ll+Ui[5]*rc+Ui[13],Of=Ui[2]*ll+Ui[6]*rc+Ui[14],m0=Ui[3]*ll+Ui[7]*rc+Ui[15],Wd=Of+Ro,yf=m0+Os,Wp=wh+Nl,qp=mh+Ms,Gp=Of+_s,vd=m0+sl,Bf=new c((wh+La)/yf,(mh+ho)/yf);Bf.z=Wd/yf,Hs.push(Bf);let Lp=new c(Wp/vd,qp/vd);Lp.z=Gp/vd,To.push(Lp)}Na.push(Hs),fa.push(To)}return[Na,fa]}(jt,$r,Cr,$e);return function(Fn,Kn,mi){let Ui=1/0;Si(mi,Kn)&&(Ui=zm(mi,Kn[0]));for(let Na=0;Naat.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(at=>{this.gradients[at.id]={}}),this.layoutVertexArray=new ih,this.layoutVertexArray2=new Et,this.indexArray=new cr,this.programConfigurations=new oc(R.layers,R.zoom),this.segments=new Bn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){this.hasPattern=Ge("line",this.layers,at);let jt=this.layers[0].layout.get("line-sort-key"),Qt=!jt.isConstant(),re=[];for(let{feature:Ae,id:$e,index:or,sourceLayerIndex:Cr}of R){let $r=this.layers[0]._featureFilter.needGeometry,ln=Vr(Ae,$r);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),ln,kt))continue;let kn=Qt?jt.evaluate(ln,{},kt):void 0,Fn={id:$e,properties:Ae.properties,type:Ae.type,sourceLayerIndex:Cr,index:or,geometry:$r?ln.geometry:Ir(Ae),patterns:{},sortKey:kn};re.push(Fn)}Qt&&re.sort((Ae,$e)=>Ae.sortKey-$e.sortKey);for(let Ae of re){let{geometry:$e,index:or,sourceLayerIndex:Cr}=Ae;if(this.hasPattern){let $r=rr("line",this.layers,Ae,this.zoom,at);this.patternFeatures.push($r)}else this.addFeature(Ae,$e,or,kt,{});at.featureIndex.insert(R[or].feature,$e,or,Cr,this.index)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}addFeatures(R,at,kt){for(let jt of this.patternFeatures)this.addFeature(jt,jt.geometry,jt.index,at,kt)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=R.createVertexBuffer(this.layoutVertexArray2,rg)),this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,d0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(R){if(R.properties&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_end"))return{start:+R.properties.mapbox_clip_start,end:+R.properties.mapbox_clip_end}}addFeature(R,at,kt,jt,Qt){let re=this.layers[0].layout,Ae=re.get("line-join").evaluate(R,{}),$e=re.get("line-cap"),or=re.get("line-miter-limit"),Cr=re.get("line-round-limit");this.lineClips=this.lineFeatureClips(R);for(let $r of at)this.addLine($r,R,Ae,$e,or,Cr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,kt,Qt,jt)}addLine(R,at,kt,jt,Qt,re){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ui=0;Ui=2&&R[$e-1].equals(R[$e-2]);)$e--;let or=0;for(;or<$e-1&&R[or].equals(R[or+1]);)or++;if($e<(Ae?3:2))return;kt==="bevel"&&(Qt=1.05);let Cr=this.overscaling<=16?15*hc/(512*this.overscaling):0,$r=this.segments.prepareSegment(10*$e,this.layoutVertexArray,this.indexArray),ln,kn,Fn,Kn,mi;this.e1=this.e2=-1,Ae&&(ln=R[$e-2],mi=R[or].sub(ln)._unit()._perp());for(let Ui=or;Ui<$e;Ui++){if(Fn=Ui===$e-1?Ae?R[or+1]:void 0:R[Ui+1],Fn&&R[Ui].equals(Fn))continue;mi&&(Kn=mi),ln&&(kn=ln),ln=R[Ui],mi=Fn?Fn.sub(ln)._unit()._perp():Kn,Kn=Kn||mi;let Na=Kn.add(mi);Na.x===0&&Na.y===0||Na._unit();let fa=Kn.x*mi.x+Kn.y*mi.y,La=Na.x*mi.x+Na.y*mi.y,ho=La!==0?1/La:1/0,Ro=2*Math.sqrt(2-2*La),Os=La0;if(Os&&Ui>or){let sl=ln.dist(kn);if(sl>2*Cr){let Ks=ln.sub(ln.sub(kn)._mult(Cr/sl)._round());this.updateDistance(kn,Ks),this.addCurrentVertex(Ks,Kn,0,0,$r),kn=Ks}}let Ms=kn&&Fn,_s=Ms?kt:Ae?"butt":jt;if(Ms&&_s==="round"&&(hoQt&&(_s="bevel"),_s==="bevel"&&(ho>2&&(_s="flipbevel"),ho100)Na=mi.mult(-1);else{let sl=ho*Kn.add(mi).mag()/Kn.sub(mi).mag();Na._perp()._mult(sl*(Nl?-1:1))}this.addCurrentVertex(ln,Na,0,0,$r),this.addCurrentVertex(ln,Na.mult(-1),0,0,$r)}else if(_s==="bevel"||_s==="fakeround"){let sl=-Math.sqrt(ho*ho-1),Ks=Nl?sl:0,Hs=Nl?0:sl;if(kn&&this.addCurrentVertex(ln,Kn,Ks,Hs,$r),_s==="fakeround"){let To=Math.round(180*Ro/Math.PI/20);for(let vl=1;vl2*Cr){let Ks=ln.add(Fn.sub(ln)._mult(Cr/sl)._round());this.updateDistance(ln,Ks),this.addCurrentVertex(Ks,mi,0,0,$r),ln=Ks}}}}addCurrentVertex(R,at,kt,jt,Qt,re=!1){let Ae=at.y*jt-at.x,$e=-at.y-at.x*jt;this.addHalfVertex(R,at.x+at.y*kt,at.y-at.x*kt,re,!1,kt,Qt),this.addHalfVertex(R,Ae,$e,re,!0,-jt,Qt),this.distance>p0/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(R,at,kt,jt,Qt,re))}addHalfVertex({x:R,y:at},kt,jt,Qt,re,Ae,$e){let or=.5*(this.lineClips?this.scaledDistance*(p0-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((R<<1)+(Qt?1:0),(at<<1)+(re?1:0),Math.round(63*kt)+128,Math.round(63*jt)+128,1+(Ae===0?0:Ae<0?-1:1)|(63&or)<<2,or>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Cr=$e.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Cr),$e.primitiveLength++),re?this.e2=Cr:this.e1=Cr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(R,at){this.distance+=R.dist(at),this.updateScaledDistance()}}let rv,r1;pa("LineBucket",Ep,{omit:["layers","patternFeatures"]});var nv={get paint(){return r1=r1||new Kt({"line-opacity":new $s(dt.paint_line["line-opacity"]),"line-color":new $s(dt.paint_line["line-color"]),"line-translate":new ds(dt.paint_line["line-translate"]),"line-translate-anchor":new ds(dt.paint_line["line-translate-anchor"]),"line-width":new $s(dt.paint_line["line-width"]),"line-gap-width":new $s(dt.paint_line["line-gap-width"]),"line-offset":new $s(dt.paint_line["line-offset"]),"line-blur":new $s(dt.paint_line["line-blur"]),"line-dasharray":new eu(dt.paint_line["line-dasharray"]),"line-pattern":new nh(dt.paint_line["line-pattern"]),"line-gradient":new lf(dt.paint_line["line-gradient"])})},get layout(){return rv=rv||new Kt({"line-cap":new ds(dt.layout_line["line-cap"]),"line-join":new $s(dt.layout_line["line-join"]),"line-miter-limit":new ds(dt.layout_line["line-miter-limit"]),"line-round-limit":new ds(dt.layout_line["line-round-limit"]),"line-sort-key":new $s(dt.layout_line["line-sort-key"])})}};class If extends $s{possiblyEvaluate(R,at){return at=new Zl(Math.floor(at.zoom),{now:at.now,fadeDuration:at.fadeDuration,zoomHistory:at.zoomHistory,transition:at.transition}),super.possiblyEvaluate(R,at)}evaluate(R,at,kt,jt){return at=E({},at,{zoom:Math.floor(at.zoom)}),super.evaluate(R,at,kt,jt)}}let zg;class n1 extends pt{constructor(R){super(R,nv),this.gradientVersion=0,zg||(zg=new If(nv.paint.properties["line-width"].specification),zg.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(R){if(R==="line-gradient"){let at=this.gradientExpression();this.stepInterpolant=!!function(kt){return kt._styleExpression!==void 0}(at)&&at._styleExpression.expression instanceof pi,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(R,at){super.recalculate(R,at),this.paint._values["line-floorwidth"]=zg.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,R)}createBucket(R){return new Ep(R)}queryRadius(R){let at=R,kt=Df(oi("line-width",this,at),oi("line-gap-width",this,at)),jt=oi("line-offset",this,at);return kt/2+Math.abs(jt)+Yi(this.paint.get("line-translate"))}queryIntersectsFeature(R,at,kt,jt,Qt,re,Ae){let $e=Ni(R,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),re.angle,Ae),or=Ae/2*Df(this.paint.get("line-width").evaluate(at,kt),this.paint.get("line-gap-width").evaluate(at,kt)),Cr=this.paint.get("line-offset").evaluate(at,kt);return Cr&&(jt=function($r,ln){let kn=[];for(let Fn=0;Fn<$r.length;Fn++){let Kn=$r[Fn],mi=[];for(let Ui=0;Ui=3){for(let mi=0;mi0?R+2*X:X}let iv=Ee([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),gy=Ee([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ee([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let vy=Ee([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ee([{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"}]);let Om=Ee([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),i1=Ee([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function gd(X,R,at){return X.sections.forEach(kt=>{kt.text=function(jt,Qt,re){let Ae=Qt.layout.get("text-transform").evaluate(re,{});return Ae==="uppercase"?jt=jt.toLocaleUpperCase():Ae==="lowercase"&&(jt=jt.toLocaleLowerCase()),ac.applyArabicShaping&&(jt=ac.applyArabicShaping(jt)),jt}(kt.text,R,at)}),X}Ee([{name:"triangle",components:3,type:"Uint16"}]),Ee([{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"}]),Ee([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Ee([{type:"Float32",name:"offsetX"}]),Ee([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ee([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let zf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Iu=24,a1=Wu,yy=function(X,R,at,kt,jt){var Qt,re,Ae=8*jt-kt-1,$e=(1<>1,Cr=-7,$r=jt-1,ln=-1,kn=X[R+$r];for($r+=ln,Qt=kn&(1<<-Cr)-1,kn>>=-Cr,Cr+=Ae;Cr>0;Qt=256*Qt+X[R+$r],$r+=ln,Cr-=8);for(re=Qt&(1<<-Cr)-1,Qt>>=-Cr,Cr+=kt;Cr>0;re=256*re+X[R+$r],$r+=ln,Cr-=8);if(Qt===0)Qt=1-or;else{if(Qt===$e)return re?NaN:1/0*(kn?-1:1);re+=Math.pow(2,kt),Qt-=or}return(kn?-1:1)*re*Math.pow(2,Qt-kt)},Bb=function(X,R,at,kt,jt,Qt){var re,Ae,$e,or=8*Qt-jt-1,Cr=(1<>1,ln=jt===23?Math.pow(2,-24)-Math.pow(2,-77):0,kn=0,Fn=1,Kn=R<0||R===0&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(Ae=isNaN(R)?1:0,re=Cr):(re=Math.floor(Math.log(R)/Math.LN2),R*($e=Math.pow(2,-re))<1&&(re--,$e*=2),(R+=re+$r>=1?ln/$e:ln*Math.pow(2,1-$r))*$e>=2&&(re++,$e/=2),re+$r>=Cr?(Ae=0,re=Cr):re+$r>=1?(Ae=(R*$e-1)*Math.pow(2,jt),re+=$r):(Ae=R*Math.pow(2,$r-1)*Math.pow(2,jt),re=0));jt>=8;X[at+kn]=255&Ae,kn+=Fn,Ae/=256,jt-=8);for(re=re<0;X[at+kn]=255&re,kn+=Fn,re/=256,or-=8);X[at+kn-Fn]|=128*Kn};function Wu(X){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(X)?X:new Uint8Array(X||0),this.pos=0,this.type=0,this.length=this.buf.length}Wu.Varint=0,Wu.Fixed64=1,Wu.Bytes=2,Wu.Fixed32=5;var Og=4294967296,Rb=1/Og,o1=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Bm(X){return X.type===Wu.Bytes?X.readVarint()+X.pos:X.pos+1}function Jw(X,R,at){return at?4294967296*R+(X>>>0):4294967296*(R>>>0)+(X>>>0)}function _y(X,R,at){var kt=R<=16383?1:R<=2097151?2:R<=268435455?3:Math.floor(Math.log(R)/(7*Math.LN2));at.realloc(kt);for(var jt=at.pos-1;jt>=X;jt--)at.buf[jt+kt]=at.buf[jt]}function zA(X,R){for(var at=0;at>>8,X[at+2]=R>>>16,X[at+3]=R>>>24}function jk(X,R){return(X[R]|X[R+1]<<8|X[R+2]<<16)+(X[R+3]<<24)}Wu.prototype={destroy:function(){this.buf=null},readFields:function(X,R,at){for(at=at||this.length;this.pos>3,Qt=this.pos;this.type=7&kt,X(jt,R,this),this.pos===Qt&&this.skip(kt)}return R},readMessage:function(X,R){return this.readFields(X,R,this.readVarint()+this.pos)},readFixed32:function(){var X=Nb(this.buf,this.pos);return this.pos+=4,X},readSFixed32:function(){var X=jk(this.buf,this.pos);return this.pos+=4,X},readFixed64:function(){var X=Nb(this.buf,this.pos)+Nb(this.buf,this.pos+4)*Og;return this.pos+=8,X},readSFixed64:function(){var X=Nb(this.buf,this.pos)+jk(this.buf,this.pos+4)*Og;return this.pos+=8,X},readFloat:function(){var X=yy(this.buf,this.pos,!0,23,4);return this.pos+=4,X},readDouble:function(){var X=yy(this.buf,this.pos,!0,52,8);return this.pos+=8,X},readVarint:function(X){var R,at,kt=this.buf;return R=127&(at=kt[this.pos++]),at<128?R:(R|=(127&(at=kt[this.pos++]))<<7,at<128?R:(R|=(127&(at=kt[this.pos++]))<<14,at<128?R:(R|=(127&(at=kt[this.pos++]))<<21,at<128?R:function(jt,Qt,re){var Ae,$e,or=re.buf;if(Ae=(112&($e=or[re.pos++]))>>4,$e<128||(Ae|=(127&($e=or[re.pos++]))<<3,$e<128)||(Ae|=(127&($e=or[re.pos++]))<<10,$e<128)||(Ae|=(127&($e=or[re.pos++]))<<17,$e<128)||(Ae|=(127&($e=or[re.pos++]))<<24,$e<128)||(Ae|=(1&($e=or[re.pos++]))<<31,$e<128))return Jw(jt,Ae,Qt);throw new Error("Expected varint not more than 10 bytes")}(R|=(15&(at=kt[this.pos]))<<28,X,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var X=this.readVarint();return X%2==1?(X+1)/-2:X/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var X=this.readVarint()+this.pos,R=this.pos;return this.pos=X,X-R>=12&&o1?function(at,kt,jt){return o1.decode(at.subarray(kt,jt))}(this.buf,R,X):function(at,kt,jt){for(var Qt="",re=kt;re239?4:Cr>223?3:Cr>191?2:1;if(re+ln>jt)break;ln===1?Cr<128&&($r=Cr):ln===2?(192&(Ae=at[re+1]))==128&&($r=(31&Cr)<<6|63&Ae)<=127&&($r=null):ln===3?($e=at[re+2],(192&(Ae=at[re+1]))==128&&(192&$e)==128&&(($r=(15&Cr)<<12|(63&Ae)<<6|63&$e)<=2047||$r>=55296&&$r<=57343)&&($r=null)):ln===4&&($e=at[re+2],or=at[re+3],(192&(Ae=at[re+1]))==128&&(192&$e)==128&&(192&or)==128&&(($r=(15&Cr)<<18|(63&Ae)<<12|(63&$e)<<6|63&or)<=65535||$r>=1114112)&&($r=null)),$r===null?($r=65533,ln=1):$r>65535&&($r-=65536,Qt+=String.fromCharCode($r>>>10&1023|55296),$r=56320|1023&$r),Qt+=String.fromCharCode($r),re+=ln}return Qt}(this.buf,R,X)},readBytes:function(){var X=this.readVarint()+this.pos,R=this.buf.subarray(this.pos,X);return this.pos=X,R},readPackedVarint:function(X,R){if(this.type!==Wu.Bytes)return X.push(this.readVarint(R));var at=Bm(this);for(X=X||[];this.pos127;);else if(R===Wu.Bytes)this.pos=this.readVarint()+this.pos;else if(R===Wu.Fixed32)this.pos+=4;else{if(R!==Wu.Fixed64)throw new Error("Unimplemented type: "+R);this.pos+=8}},writeTag:function(X,R){this.writeVarint(X<<3|R)},realloc:function(X){for(var R=this.length||16;R268435455||X<0?function(R,at){var kt,jt;if(R>=0?(kt=R%4294967296|0,jt=R/4294967296|0):(jt=~(-R/4294967296),4294967295^(kt=~(-R%4294967296))?kt=kt+1|0:(kt=0,jt=jt+1|0)),R>=18446744073709552e3||R<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");at.realloc(10),function(Qt,re,Ae){Ae.buf[Ae.pos++]=127&Qt|128,Qt>>>=7,Ae.buf[Ae.pos++]=127&Qt|128,Qt>>>=7,Ae.buf[Ae.pos++]=127&Qt|128,Qt>>>=7,Ae.buf[Ae.pos++]=127&Qt|128,Ae.buf[Ae.pos]=127&(Qt>>>=7)}(kt,0,at),function(Qt,re){var Ae=(7&Qt)<<4;re.buf[re.pos++]|=Ae|((Qt>>>=3)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt)))))}(jt,at)}(X,this):(this.realloc(4),this.buf[this.pos++]=127&X|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=X>>>7&127))))},writeSVarint:function(X){this.writeVarint(X<0?2*-X-1:2*X)},writeBoolean:function(X){this.writeVarint(!!X)},writeString:function(X){X=String(X),this.realloc(4*X.length),this.pos++;var R=this.pos;this.pos=function(kt,jt,Qt){for(var re,Ae,$e=0;$e55295&&re<57344){if(!Ae){re>56319||$e+1===jt.length?(kt[Qt++]=239,kt[Qt++]=191,kt[Qt++]=189):Ae=re;continue}if(re<56320){kt[Qt++]=239,kt[Qt++]=191,kt[Qt++]=189,Ae=re;continue}re=Ae-55296<<10|re-56320|65536,Ae=null}else Ae&&(kt[Qt++]=239,kt[Qt++]=191,kt[Qt++]=189,Ae=null);re<128?kt[Qt++]=re:(re<2048?kt[Qt++]=re>>6|192:(re<65536?kt[Qt++]=re>>12|224:(kt[Qt++]=re>>18|240,kt[Qt++]=re>>12&63|128),kt[Qt++]=re>>6&63|128),kt[Qt++]=63&re|128)}return Qt}(this.buf,X,this.pos);var at=this.pos-R;at>=128&&_y(R,at,this),this.pos=R-1,this.writeVarint(at),this.pos+=at},writeFloat:function(X){this.realloc(4),Bb(this.buf,X,this.pos,!0,23,4),this.pos+=4},writeDouble:function(X){this.realloc(8),Bb(this.buf,X,this.pos,!0,52,8),this.pos+=8},writeBytes:function(X){var R=X.length;this.writeVarint(R),this.realloc(R);for(var at=0;at=128&&_y(at,kt,this),this.pos=at-1,this.writeVarint(kt),this.pos+=kt},writeMessage:function(X,R,at){this.writeTag(X,Wu.Bytes),this.writeRawMessage(R,at)},writePackedVarint:function(X,R){R.length&&this.writeMessage(X,zA,R)},writePackedSVarint:function(X,R){R.length&&this.writeMessage(X,OA,R)},writePackedBoolean:function(X,R){R.length&&this.writeMessage(X,FA,R)},writePackedFloat:function(X,R){R.length&&this.writeMessage(X,BA,R)},writePackedDouble:function(X,R){R.length&&this.writeMessage(X,RA,R)},writePackedFixed32:function(X,R){R.length&&this.writeMessage(X,NA,R)},writePackedSFixed32:function(X,R){R.length&&this.writeMessage(X,jA,R)},writePackedFixed64:function(X,R){R.length&&this.writeMessage(X,UA,R)},writePackedSFixed64:function(X,R){R.length&&this.writeMessage(X,Fb,R)},writeBytesField:function(X,R){this.writeTag(X,Wu.Bytes),this.writeBytes(R)},writeFixed32Field:function(X,R){this.writeTag(X,Wu.Fixed32),this.writeFixed32(R)},writeSFixed32Field:function(X,R){this.writeTag(X,Wu.Fixed32),this.writeSFixed32(R)},writeFixed64Field:function(X,R){this.writeTag(X,Wu.Fixed64),this.writeFixed64(R)},writeSFixed64Field:function(X,R){this.writeTag(X,Wu.Fixed64),this.writeSFixed64(R)},writeVarintField:function(X,R){this.writeTag(X,Wu.Varint),this.writeVarint(R)},writeSVarintField:function(X,R){this.writeTag(X,Wu.Varint),this.writeSVarint(R)},writeStringField:function(X,R){this.writeTag(X,Wu.Bytes),this.writeString(R)},writeFloatField:function(X,R){this.writeTag(X,Wu.Fixed32),this.writeFloat(R)},writeDoubleField:function(X,R){this.writeTag(X,Wu.Fixed64),this.writeDouble(R)},writeBooleanField:function(X,R){this.writeVarintField(X,!!R)}};var Qw=a(a1);let jb=3;function $A(X,R,at){X===1&&at.readMessage(Uk,R)}function Uk(X,R,at){if(X===3){let{id:kt,bitmap:jt,width:Qt,height:re,left:Ae,top:$e,advance:or}=at.readMessage(t3,{});R.push({id:kt,bitmap:new Xl({width:Qt+2*jb,height:re+2*jb},jt),metrics:{width:Qt,height:re,left:Ae,top:$e,advance:or}})}}function t3(X,R,at){X===1?R.id=at.readVarint():X===2?R.bitmap=at.readBytes():X===3?R.width=at.readVarint():X===4?R.height=at.readVarint():X===5?R.left=at.readSVarint():X===6?R.top=at.readSVarint():X===7&&(R.advance=at.readVarint())}let e3=jb;function Ub(X){let R=0,at=0;for(let re of X)R+=re.w*re.h,at=Math.max(at,re.w);X.sort((re,Ae)=>Ae.h-re.h);let kt=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(R/.95)),at),h:1/0}],jt=0,Qt=0;for(let re of X)for(let Ae=kt.length-1;Ae>=0;Ae--){let $e=kt[Ae];if(!(re.w>$e.w||re.h>$e.h)){if(re.x=$e.x,re.y=$e.y,Qt=Math.max(Qt,re.y+re.h),jt=Math.max(jt,re.x+re.w),re.w===$e.w&&re.h===$e.h){let or=kt.pop();Ae=0&&kt>=R&&Hb[this.text.charCodeAt(kt)];kt--)at--;this.text=this.text.substring(R,at),this.sectionIndex=this.sectionIndex.slice(R,at)}substring(R,at){let kt=new wy;return kt.text=this.text.substring(R,at),kt.sectionIndex=this.sectionIndex.slice(R,at),kt.sections=this.sections,kt}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((R,at)=>Math.max(R,this.sections[at].scale),0)}addTextSection(R,at){this.text+=R.text,this.sections.push(X_.forText(R.scale,R.fontStack||at));let kt=this.sections.length-1;for(let jt=0;jt=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function $b(X,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn){let Kn=wy.fromFeature(X,jt),mi;$r===n.ah.vertical&&Kn.verticalizePunctuation();let{processBidirectionalText:Ui,processStyledBidirectionalText:Na}=ac;if(Ui&&Kn.sections.length===1){mi=[];let ho=Ui(Kn.toString(),s1(Kn,or,Qt,R,kt,kn));for(let Ro of ho){let Os=new wy;Os.text=Ro,Os.sections=Kn.sections;for(let Nl=0;Nl0&&ym>rp&&(rp=ym)}else{let kh=Os[du.fontStack],np=kh&&kh[ah];if(np&&np.rect)Py=np.rect,Bh=np.metrics;else{let ym=Ro[du.fontStack],P0=ym&&ym[ah];if(!P0)continue;Bh=P0.metrics}od=(Bf-du.scale)*Iu}Pp?(ho.verticalizable=!0,Zp.push({glyph:ah,imageName:Rm,x:rc,y:wh+od,vertical:Pp,scale:du.scale,fontStack:du.fontStack,sectionIndex:qu,metrics:Bh,rect:Py}),rc+=Fm*du.scale+To):(Zp.push({glyph:ah,imageName:Rm,x:rc,y:wh+od,vertical:Pp,scale:du.scale,fontStack:du.fontStack,sectionIndex:qu,metrics:Bh,rect:Py}),rc+=Bh.advance*du.scale+To)}Zp.length!==0&&(mh=Math.max(rc-To,mh),WA(Zp,0,Zp.length-1,m0,rp)),rc=0;let L0=_s*Bf+rp;yp.lineOffset=Math.max(rp,Lp),wh+=L0,Of=Math.max(L0,Of),++Wd}var yf;let Wp=wh-by,{horizontalAlign:qp,verticalAlign:Gp}=n3(sl);(function(vd,Bf,Lp,yp,Zp,rp,L0,Oh,du){let qu=(Bf-Lp)*Zp,ah=0;ah=rp!==L0?-Oh*yp-by:(-yp*du+.5)*L0;for(let od of vd)for(let Bh of od.positionedGlyphs)Bh.x+=qu,Bh.y+=ah})(ho.positionedLines,m0,qp,Gp,mh,Of,_s,Wp,Ms.length),ho.top+=-Gp*Wp,ho.bottom=ho.top+Wp,ho.left+=-qp*mh,ho.right=ho.left+mh}(La,R,at,kt,mi,re,Ae,$e,$r,or,ln,Fn),!function(ho){for(let Ro of ho)if(Ro.positionedGlyphs.length!==0)return!1;return!0}(fa)&&La}let Hb={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},HA={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},VA={40:!0};function Vb(X,R,at,kt,jt,Qt){if(R.imageName){let re=kt[R.imageName];return re?re.displaySize[0]*R.scale*Iu/Qt+jt:0}{let re=at[R.fontStack],Ae=re&&re[X];return Ae?Ae.metrics.advance*R.scale+jt:0}}function Hk(X,R,at,kt){let jt=Math.pow(X-R,2);return kt?X=0,or=0;for(let $r=0;$ror){let Cr=Math.ceil(Qt/or);jt*=Cr/re,re=Cr}return{x1:kt,y1:jt,x2:kt+Qt,y2:jt+re}}function Wk(X,R,at,kt,jt,Qt){let re=X.image,Ae;if(re.content){let mi=re.content,Ui=re.pixelRatio||1;Ae=[mi[0]/Ui,mi[1]/Ui,re.displaySize[0]-mi[2]/Ui,re.displaySize[1]-mi[3]/Ui]}let $e=R.left*Qt,or=R.right*Qt,Cr,$r,ln,kn;at==="width"||at==="both"?(kn=jt[0]+$e-kt[3],$r=jt[0]+or+kt[1]):(kn=jt[0]+($e+or-re.displaySize[0])/2,$r=kn+re.displaySize[0]);let Fn=R.top*Qt,Kn=R.bottom*Qt;return at==="height"||at==="both"?(Cr=jt[1]+Fn-kt[0],ln=jt[1]+Kn+kt[2]):(Cr=jt[1]+(Fn+Kn-re.displaySize[1])/2,ln=Cr+re.displaySize[1]),{image:re,top:Cr,right:$r,bottom:ln,left:kn,collisionPadding:Ae}}let J_=255,ng=128,ov=J_*ng;function qk(X,R){let{expression:at}=R;if(at.kind==="constant")return{kind:"constant",layoutSize:at.evaluate(new Zl(X+1))};if(at.kind==="source")return{kind:"source"};{let{zoomStops:kt,interpolationType:jt}=at,Qt=0;for(;Qtre.id),this.index=R.index,this.pixelRatio=R.pixelRatio,this.sourceLayerIndex=R.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ki([]),this.placementViewportMatrix=ki([]);let at=this.layers[0]._unevaluatedLayout._values;this.textSizeData=qk(this.zoom,at["text-size"]),this.iconSizeData=qk(this.zoom,at["icon-size"]);let kt=this.layers[0].layout,jt=kt.get("symbol-sort-key"),Qt=kt.get("symbol-z-order");this.canOverlap=i3(kt,"text-overlap","text-allow-overlap")!=="never"||i3(kt,"icon-overlap","icon-allow-overlap")!=="never"||kt.get("text-ignore-placement")||kt.get("icon-ignore-placement"),this.sortFeaturesByKey=Qt!=="viewport-y"&&!jt.isConstant(),this.sortFeaturesByY=(Qt==="viewport-y"||Qt==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,kt.get("symbol-placement")==="point"&&(this.writingModes=kt.get("text-writing-mode").map(re=>n.ah[re])),this.stateDependentLayerIds=this.layers.filter(re=>re.isStateDependent()).map(re=>re.id),this.sourceID=R.sourceID}createArrays(){this.text=new Sd(new oc(this.layers,this.zoom,R=>/^text/.test(R))),this.icon=new Sd(new oc(this.layers,this.zoom,R=>/^icon/.test(R))),this.glyphOffsetArray=new Sl,this.lineVertexArray=new Ll,this.symbolInstances=new xs,this.textAnchorOffsets=new zl}calculateGlyphDependencies(R,at,kt,jt,Qt){for(let re=0;re0)&&(re.value.kind!=="constant"||re.value.value.length>0),Cr=$e.value.kind!=="constant"||!!$e.value.value||Object.keys($e.parameters).length>0,$r=Qt.get("symbol-sort-key");if(this.features=[],!or&&!Cr)return;let ln=at.iconDependencies,kn=at.glyphDependencies,Fn=at.availableImages,Kn=new Zl(this.zoom);for(let{feature:mi,id:Ui,index:Na,sourceLayerIndex:fa}of R){let La=jt._featureFilter.needGeometry,ho=Vr(mi,La);if(!jt._featureFilter.filter(Kn,ho,kt))continue;let Ro,Os;if(La||(ho.geometry=Ir(mi)),or){let Ms=jt.getValueAndResolveTokens("text-field",ho,kt,Fn),_s=Un.factory(Ms),sl=this.hasRTLText=this.hasRTLText||ZA(_s);(!sl||ac.getRTLTextPluginStatus()==="unavailable"||sl&&ac.isParsed())&&(Ro=gd(_s,jt,ho))}if(Cr){let Ms=jt.getValueAndResolveTokens("icon-image",ho,kt,Fn);Os=Ms instanceof Zi?Ms:Zi.fromString(Ms)}if(!Ro&&!Os)continue;let Nl=this.sortFeaturesByKey?$r.evaluate(ho,{},kt):void 0;if(this.features.push({id:Ui,text:Ro,icon:Os,index:Na,sourceLayerIndex:fa,geometry:ho.geometry,properties:mi.properties,type:GA[mi.type],sortKey:Nl}),Os&&(ln[Os.name]=!0),Ro){let Ms=re.evaluate(ho,{},kt).join(","),_s=Qt.get("text-rotation-alignment")!=="viewport"&&Qt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(n.ah.vertical)>=0;for(let sl of Ro.sections)if(sl.image)ln[sl.image.name]=!0;else{let Ks=ks(Ro.toString()),Hs=sl.fontStack||Ms,To=kn[Hs]=kn[Hs]||{};this.calculateGlyphDependencies(sl.text,To,_s,this.allowVerticalPlacement,Ks)}}}Qt.get("symbol-placement")==="line"&&(this.features=function(mi){let Ui={},Na={},fa=[],La=0;function ho(Ms){fa.push(mi[Ms]),La++}function Ro(Ms,_s,sl){let Ks=Na[Ms];return delete Na[Ms],Na[_s]=Ks,fa[Ks].geometry[0].pop(),fa[Ks].geometry[0]=fa[Ks].geometry[0].concat(sl[0]),Ks}function Os(Ms,_s,sl){let Ks=Ui[_s];return delete Ui[_s],Ui[Ms]=Ks,fa[Ks].geometry[0].shift(),fa[Ks].geometry[0]=sl[0].concat(fa[Ks].geometry[0]),Ks}function Nl(Ms,_s,sl){let Ks=sl?_s[0][_s[0].length-1]:_s[0][0];return`${Ms}:${Ks.x}:${Ks.y}`}for(let Ms=0;MsMs.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((mi,Ui)=>mi.sortKey-Ui.sortKey)}update(R,at,kt){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(R,at,this.layers,kt),this.icon.programConfigurations.updatePaintArrays(R,at,this.layers,kt))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(R){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(R),this.iconCollisionBox.upload(R)),this.text.upload(R,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(R,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(R,at){let kt=this.lineVertexArray.length;if(R.segment!==void 0){let jt=R.dist(at[R.segment+1]),Qt=R.dist(at[R.segment]),re={};for(let Ae=R.segment+1;Ae=0;Ae--)re[Ae]={x:at[Ae].x,y:at[Ae].y,tileUnitDistanceFromAnchor:Qt},Ae>0&&(Qt+=at[Ae-1].dist(at[Ae]));for(let Ae=0;Ae0}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(R,at){let kt=R.placedSymbolArray.get(at),jt=kt.vertexStartIndex+4*kt.numGlyphs;for(let Qt=kt.vertexStartIndex;Qtjt[Ae]-jt[$e]||Qt[$e]-Qt[Ae]),re}addToSortKeyRanges(R,at){let kt=this.sortKeyRanges[this.sortKeyRanges.length-1];kt&&kt.sortKey===at?kt.symbolInstanceEnd=R+1:this.sortKeyRanges.push({sortKey:at,symbolInstanceStart:R,symbolInstanceEnd:R+1})}sortFeatures(R){if(this.sortFeaturesByY&&this.sortedAngle!==R&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(R),this.sortedAngle=R,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let at of this.symbolInstanceIndexes){let kt=this.symbolInstances.get(at);this.featureSortOrder.push(kt.featureIndex),[kt.rightJustifiedTextSymbolIndex,kt.centerJustifiedTextSymbolIndex,kt.leftJustifiedTextSymbolIndex].forEach((jt,Qt,re)=>{jt>=0&&re.indexOf(jt)===Qt&&this.addIndicesForPlacedSymbol(this.text,jt)}),kt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,kt.verticalPlacedTextSymbolIndex),kt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,kt.placedIconSymbolIndex),kt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,kt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Q_,tx;pa("SymbolBucket",l1,{omit:["layers","collisionBoxArray","features","compareText"]}),l1.MAX_GLYPHS=65535,l1.addDynamicAttributes=sv;var o3={get paint(){return tx=tx||new Kt({"icon-opacity":new $s(dt.paint_symbol["icon-opacity"]),"icon-color":new $s(dt.paint_symbol["icon-color"]),"icon-halo-color":new $s(dt.paint_symbol["icon-halo-color"]),"icon-halo-width":new $s(dt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new $s(dt.paint_symbol["icon-halo-blur"]),"icon-translate":new ds(dt.paint_symbol["icon-translate"]),"icon-translate-anchor":new ds(dt.paint_symbol["icon-translate-anchor"]),"text-opacity":new $s(dt.paint_symbol["text-opacity"]),"text-color":new $s(dt.paint_symbol["text-color"],{runtimeType:mr,getOverride:X=>X.textColor,hasOverride:X=>!!X.textColor}),"text-halo-color":new $s(dt.paint_symbol["text-halo-color"]),"text-halo-width":new $s(dt.paint_symbol["text-halo-width"]),"text-halo-blur":new $s(dt.paint_symbol["text-halo-blur"]),"text-translate":new ds(dt.paint_symbol["text-translate"]),"text-translate-anchor":new ds(dt.paint_symbol["text-translate-anchor"])})},get layout(){return Q_=Q_||new Kt({"symbol-placement":new ds(dt.layout_symbol["symbol-placement"]),"symbol-spacing":new ds(dt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ds(dt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new $s(dt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ds(dt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ds(dt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ds(dt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ds(dt.layout_symbol["icon-ignore-placement"]),"icon-optional":new ds(dt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ds(dt.layout_symbol["icon-rotation-alignment"]),"icon-size":new $s(dt.layout_symbol["icon-size"]),"icon-text-fit":new ds(dt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ds(dt.layout_symbol["icon-text-fit-padding"]),"icon-image":new $s(dt.layout_symbol["icon-image"]),"icon-rotate":new $s(dt.layout_symbol["icon-rotate"]),"icon-padding":new $s(dt.layout_symbol["icon-padding"]),"icon-keep-upright":new ds(dt.layout_symbol["icon-keep-upright"]),"icon-offset":new $s(dt.layout_symbol["icon-offset"]),"icon-anchor":new $s(dt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ds(dt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ds(dt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ds(dt.layout_symbol["text-rotation-alignment"]),"text-field":new $s(dt.layout_symbol["text-field"]),"text-font":new $s(dt.layout_symbol["text-font"]),"text-size":new $s(dt.layout_symbol["text-size"]),"text-max-width":new $s(dt.layout_symbol["text-max-width"]),"text-line-height":new ds(dt.layout_symbol["text-line-height"]),"text-letter-spacing":new $s(dt.layout_symbol["text-letter-spacing"]),"text-justify":new $s(dt.layout_symbol["text-justify"]),"text-radial-offset":new $s(dt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ds(dt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new $s(dt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new $s(dt.layout_symbol["text-anchor"]),"text-max-angle":new ds(dt.layout_symbol["text-max-angle"]),"text-writing-mode":new ds(dt.layout_symbol["text-writing-mode"]),"text-rotate":new $s(dt.layout_symbol["text-rotate"]),"text-padding":new ds(dt.layout_symbol["text-padding"]),"text-keep-upright":new ds(dt.layout_symbol["text-keep-upright"]),"text-transform":new $s(dt.layout_symbol["text-transform"]),"text-offset":new $s(dt.layout_symbol["text-offset"]),"text-allow-overlap":new ds(dt.layout_symbol["text-allow-overlap"]),"text-overlap":new ds(dt.layout_symbol["text-overlap"]),"text-ignore-placement":new ds(dt.layout_symbol["text-ignore-placement"]),"text-optional":new ds(dt.layout_symbol["text-optional"])})}};class Ty{constructor(R){if(R.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=R.property.overrides?R.property.overrides.runtimeType:ce,this.defaultValue=R}evaluate(R){if(R.formattedSection){let at=this.defaultValue.property.overrides;if(at&&at.hasOverride(R.formattedSection))return at.getOverride(R.formattedSection)}return R.feature&&R.featureState?this.defaultValue.evaluate(R.feature,R.featureState):this.defaultValue.property.specification.default}eachChild(R){this.defaultValue.isConstant()||R(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}pa("FormatSectionOverride",Ty,{omit:["defaultValue"]});class Gb extends pt{constructor(R){super(R,o3)}recalculate(R,at){if(super.recalculate(R,at),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let kt=this.layout.get("text-writing-mode");if(kt){let jt=[];for(let Qt of kt)jt.indexOf(Qt)<0&&jt.push(Qt);this.layout._values["text-writing-mode"]=jt}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(R,at,kt,jt){let Qt=this.layout.get(R).evaluate(at,{},kt,jt),re=this._unevaluatedLayout._values[R];return re.isDataDriven()||rd(re.value)||!Qt?Qt:function(Ae,$e){return $e.replace(/{([^{}]+)}/g,(or,Cr)=>Ae&&Cr in Ae?String(Ae[Cr]):"")}(at.properties,Qt)}createBucket(R){return new l1(R)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let R of o3.paint.overridableProperties){if(!Gb.hasPaintOverride(this.layout,R))continue;let at=this.paint.get(R),kt=new Ty(at),jt=new Ju(kt,at.property.specification),Qt=null;Qt=at.value.kind==="constant"||at.value.kind==="source"?new $h("source",jt):new ju("composite",jt,at.value.zoomStops),this.paint._values[R]=new Wc(at.property,Qt,at.parameters)}}_handleOverridablePaintPropertyUpdate(R,at,kt){return!(!this.layout||at.isDataDriven()||kt.isDataDriven())&&Gb.hasPaintOverride(this.layout,R)}static hasPaintOverride(R,at){let kt=R.get("text-field"),jt=o3.paint.properties[at],Qt=!1,re=Ae=>{for(let $e of Ae)if(jt.overrides&&jt.overrides.hasOverride($e))return void(Qt=!0)};if(kt.value.kind==="constant"&&kt.value.value instanceof Un)re(kt.value.value.sections);else if(kt.value.kind==="source"){let Ae=or=>{Qt||(or instanceof so&&Ei(or.value)===Er?re(or.value.sections):or instanceof Ol?re(or.sections):or.eachChild(Ae))},$e=kt.value;$e._styleExpression&&Ae($e._styleExpression.expression)}return Qt}}let s3;var Gk={get paint(){return s3=s3||new Kt({"background-color":new ds(dt.paint_background["background-color"]),"background-pattern":new eu(dt.paint_background["background-pattern"]),"background-opacity":new ds(dt.paint_background["background-opacity"])})}};class ex extends pt{constructor(R){super(R,Gk)}}let Zb;var l3={get paint(){return Zb=Zb||new Kt({"raster-opacity":new ds(dt.paint_raster["raster-opacity"]),"raster-hue-rotate":new ds(dt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ds(dt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ds(dt.paint_raster["raster-brightness-max"]),"raster-saturation":new ds(dt.paint_raster["raster-saturation"]),"raster-contrast":new ds(dt.paint_raster["raster-contrast"]),"raster-resampling":new ds(dt.paint_raster["raster-resampling"]),"raster-fade-duration":new ds(dt.paint_raster["raster-fade-duration"])})}};class KA extends pt{constructor(R){super(R,l3)}}class Zk extends pt{constructor(R){super(R,{}),this.onAdd=at=>{this.implementation.onAdd&&this.implementation.onAdd(at,at.painter.context.gl)},this.onRemove=at=>{this.implementation.onRemove&&this.implementation.onRemove(at,at.painter.context.gl)},this.implementation=R}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class rx{constructor(R){this._methodToThrottle=R,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let c3=63710088e-1;class ig{constructor(R,at){if(isNaN(R)||isNaN(at))throw new Error(`Invalid LngLat object: (${R}, ${at})`);if(this.lng=+R,this.lat=+at,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ig(D(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(R){let at=Math.PI/180,kt=this.lat*at,jt=R.lat*at,Qt=Math.sin(kt)*Math.sin(jt)+Math.cos(kt)*Math.cos(jt)*Math.cos((R.lng-this.lng)*at);return c3*Math.acos(Math.min(Qt,1))}static convert(R){if(R instanceof ig)return R;if(Array.isArray(R)&&(R.length===2||R.length===3))return new ig(Number(R[0]),Number(R[1]));if(!Array.isArray(R)&&typeof R=="object"&&R!==null)return new ig(Number("lng"in R?R.lng:R.lon),Number(R.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let Kk=2*Math.PI*c3;function Kb(X){return Kk*Math.cos(X*Math.PI/180)}function Yb(X){return(180+X)/360}function Yk(X){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X*Math.PI/360)))/360}function vm(X,R){return X/Kb(R)}function u3(X){return 360/Math.PI*Math.atan(Math.exp((180-360*X)*Math.PI/180))-90}class nx{constructor(R,at,kt=0){this.x=+R,this.y=+at,this.z=+kt}static fromLngLat(R,at=0){let kt=ig.convert(R);return new nx(Yb(kt.lng),Yk(kt.lat),vm(at,kt.lat))}toLngLat(){return new ig(360*this.x-180,u3(this.y))}toAltitude(){return this.z*Kb(u3(this.y))}meterInMercatorCoordinateUnits(){return 1/Kk*(R=u3(this.y),1/Math.cos(R*Math.PI/180));var R}}function Xk(X,R,at){var kt=2*Math.PI*6378137/256/Math.pow(2,at);return[X*kt-2*Math.PI*6378137/2,R*kt-2*Math.PI*6378137/2]}class h3{constructor(R,at,kt){if(!function(jt,Qt,re){return!(jt<0||jt>25||re<0||re>=Math.pow(2,jt)||Qt<0||Qt>=Math.pow(2,jt))}(R,at,kt))throw new Error(`x=${at}, y=${kt}, z=${R} outside of bounds. 0<=x<${Math.pow(2,R)}, 0<=y<${Math.pow(2,R)} 0<=z<=25 `);this.z=R,this.x=at,this.y=kt,this.key=Sy(0,R,R,at,kt)}equals(R){return this.z===R.z&&this.x===R.x&&this.y===R.y}url(R,at,kt){let jt=(re=this.y,Ae=this.z,$e=Xk(256*(Qt=this.x),256*(re=Math.pow(2,Ae)-re-1),Ae),or=Xk(256*(Qt+1),256*(re+1),Ae),$e[0]+","+$e[1]+","+or[0]+","+or[1]);var Qt,re,Ae,$e,or;let Cr=function($r,ln,kn){let Fn,Kn="";for(let mi=$r;mi>0;mi--)Fn=1<1?"@2x":"").replace(/{quadkey}/g,Cr).replace(/{bbox-epsg-3857}/g,jt)}isChildOf(R){let at=this.z-R.z;return at>0&&R.x===this.x>>at&&R.y===this.y>>at}getTilePoint(R){let at=Math.pow(2,this.z);return new c((R.x*at-this.x)*hc,(R.y*at-this.y)*hc)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Jk{constructor(R,at){this.wrap=R,this.canonical=at,this.key=Sy(R,at.z,at.z,at.x,at.y)}}class X0{constructor(R,at,kt,jt,Qt){if(R= z; overscaledZ = ${R}; z = ${kt}`);this.overscaledZ=R,this.wrap=at,this.canonical=new h3(kt,+jt,+Qt),this.key=Sy(at,R,kt,jt,Qt)}clone(){return new X0(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(R){return this.overscaledZ===R.overscaledZ&&this.wrap===R.wrap&&this.canonical.equals(R.canonical)}scaledTo(R){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let at=this.canonical.z-R;return R>this.canonical.z?new X0(R,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new X0(R,this.wrap,R,this.canonical.x>>at,this.canonical.y>>at)}calculateScaledKey(R,at){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let kt=this.canonical.z-R;return R>this.canonical.z?Sy(this.wrap*+at,R,this.canonical.z,this.canonical.x,this.canonical.y):Sy(this.wrap*+at,R,R,this.canonical.x>>kt,this.canonical.y>>kt)}isChildOf(R){if(R.wrap!==this.wrap)return!1;let at=this.canonical.z-R.canonical.z;return R.overscaledZ===0||R.overscaledZ>at&&R.canonical.y===this.canonical.y>>at}children(R){if(this.overscaledZ>=R)return[new X0(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let at=this.canonical.z+1,kt=2*this.canonical.x,jt=2*this.canonical.y;return[new X0(at,this.wrap,at,kt,jt),new X0(at,this.wrap,at,kt+1,jt),new X0(at,this.wrap,at,kt,jt+1),new X0(at,this.wrap,at,kt+1,jt+1)]}isLessThan(R){return this.wrapR.wrap)&&(this.overscaledZR.overscaledZ)&&(this.canonical.xR.canonical.x)&&this.canonical.ythis.max&&(this.max=$r),$r=this.dim+1||at<-1||at>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(at+1)*this.stride+(R+1)}unpack(R,at,kt){return R*this.redFactor+at*this.greenFactor+kt*this.blueFactor-this.baseShift}getPixels(){return new Rl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(R,at,kt){if(this.dim!==R.dim)throw new Error("dem dimension mismatch");let jt=at*this.dim,Qt=at*this.dim+this.dim,re=kt*this.dim,Ae=kt*this.dim+this.dim;switch(at){case-1:jt=Qt-1;break;case 1:Qt=jt+1}switch(kt){case-1:re=Ae-1;break;case 1:Ae=re+1}let $e=-at*this.dim,or=-kt*this.dim;for(let Cr=re;Cr=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${R} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[R]}}class t6{constructor(R,at,kt,jt,Qt){this.type="Feature",this._vectorTileFeature=R,R._z=at,R._x=kt,R._y=jt,this.properties=R.properties,this.id=Qt}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(R){this._geometry=R}toJSON(){let R={geometry:this.geometry};for(let at in this)at!=="_geometry"&&at!=="_vectorTileFeature"&&(R[at]=this[at]);return R}}class e6{constructor(R,at){this.tileID=R,this.x=R.canonical.x,this.y=R.canonical.y,this.z=R.canonical.z,this.grid=new Za(hc,16,0),this.grid3D=new Za(hc,16,0),this.featureIndexArray=new Sc,this.promoteId=at}insert(R,at,kt,jt,Qt,re){let Ae=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(kt,jt,Qt);let $e=re?this.grid3D:this.grid;for(let or=0;or=0&&$r[3]>=0&&$e.insert(Ae,$r[0],$r[1],$r[2],$r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Di.VectorTile(new Qw(this.rawTileData)).layers,this.sourceLayerCoder=new Qk(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(R,at,kt,jt){this.loadVTLayers();let Qt=R.params||{},re=hc/R.tileSize/R.scale,Ae=Ud(Qt.filter),$e=R.queryGeometry,or=R.queryPadding*re,Cr=d3($e),$r=this.grid.query(Cr.minX-or,Cr.minY-or,Cr.maxX+or,Cr.maxY+or),ln=d3(R.cameraQueryGeometry),kn=this.grid3D.query(ln.minX-or,ln.minY-or,ln.maxX+or,ln.maxY+or,(mi,Ui,Na,fa)=>function(La,ho,Ro,Os,Nl){for(let _s of La)if(ho<=_s.x&&Ro<=_s.y&&Os>=_s.x&&Nl>=_s.y)return!0;let Ms=[new c(ho,Ro),new c(ho,Nl),new c(Os,Nl),new c(Os,Ro)];if(La.length>2){for(let _s of Ms)if(ji(La,_s))return!0}for(let _s=0;_s(fa||(fa=Ir(La)),ho.queryIntersectsFeature($e,La,Ro,fa,this.z,R.transform,re,R.pixelPosMatrix)))}return Fn}loadMatchingFeature(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r){let ln=this.bucketLayerIDs[at];if(re&&!function(mi,Ui){for(let Na=0;Na=0)return!0;return!1}(re,ln))return;let kn=this.sourceLayerCoder.decode(kt),Fn=this.vtLayers[kn].feature(jt);if(Qt.needGeometry){let mi=Vr(Fn,!0);if(!Qt.filter(new Zl(this.tileID.overscaledZ),mi,this.tileID.canonical))return}else if(!Qt.filter(new Zl(this.tileID.overscaledZ),Fn))return;let Kn=this.getId(Fn,kn);for(let mi=0;mi{let Ae=R instanceof Gh?R.get(re):null;return Ae&&Ae.evaluate?Ae.evaluate(at,kt,jt):Ae})}function d3(X){let R=1/0,at=1/0,kt=-1/0,jt=-1/0;for(let Qt of X)R=Math.min(R,Qt.x),at=Math.min(at,Qt.y),kt=Math.max(kt,Qt.x),jt=Math.max(jt,Qt.y);return{minX:R,minY:at,maxX:kt,maxY:jt}}function n6(X,R){return R-X}function i6(X,R,at,kt,jt){let Qt=[];for(let re=0;re=kt&&$r.x>=kt||(Cr.x>=kt?Cr=new c(kt,Cr.y+(kt-Cr.x)/($r.x-Cr.x)*($r.y-Cr.y))._round():$r.x>=kt&&($r=new c(kt,Cr.y+(kt-Cr.x)/($r.x-Cr.x)*($r.y-Cr.y))._round()),Cr.y>=jt&&$r.y>=jt||(Cr.y>=jt?Cr=new c(Cr.x+(jt-Cr.y)/($r.y-Cr.y)*($r.x-Cr.x),jt)._round():$r.y>=jt&&($r=new c(Cr.x+(jt-Cr.y)/($r.y-Cr.y)*($r.x-Cr.x),jt)._round()),$e&&Cr.equals($e[$e.length-1])||($e=[Cr],Qt.push($e)),$e.push($r)))))}}return Qt}pa("FeatureIndex",e6,{omit:["rawTileData","sourceLayerCoder"]});class lv extends c{constructor(R,at,kt,jt){super(R,at),this.angle=kt,jt!==void 0&&(this.segment=jt)}clone(){return new lv(this.x,this.y,this.angle,this.segment)}}function a6(X,R,at,kt,jt){if(R.segment===void 0||at===0)return!0;let Qt=R,re=R.segment+1,Ae=0;for(;Ae>-at/2;){if(re--,re<0)return!1;Ae-=X[re].dist(Qt),Qt=X[re]}Ae+=X[re].dist(X[re+1]),re++;let $e=[],or=0;for(;Aekt;)or-=$e.shift().angleDelta;if(or>jt)return!1;re++,Ae+=Cr.dist($r)}return!0}function o6(X){let R=0;for(let at=0;ator){let Fn=(or-$e)/kn,Kn=Zo.number($r.x,ln.x,Fn),mi=Zo.number($r.y,ln.y,Fn),Ui=new lv(Kn,mi,ln.angleTo($r),Cr);return Ui._round(),!re||a6(X,Ui,Ae,re,R)?Ui:void 0}$e+=kn}}function XA(X,R,at,kt,jt,Qt,re,Ae,$e){let or=s6(kt,Qt,re),Cr=l6(kt,jt),$r=Cr*re,ln=X[0].x===0||X[0].x===$e||X[0].y===0||X[0].y===$e;return R-$r=0&&La<$e&&ho>=0&&ho<$e&&ln-or>=0&&ln+or<=Cr){let Ro=new lv(La,ho,Na,Fn);Ro._round(),kt&&!a6(X,Ro,Qt,kt,jt)||kn.push(Ro)}}$r+=Ui}return Ae||kn.length||re||(kn=u1(X,$r/2,at,kt,jt,Qt,re,!0,$e)),kn}pa("Anchor",lv);let Cy=vf;function c6(X,R,at,kt){let jt=[],Qt=X.image,re=Qt.pixelRatio,Ae=Qt.paddedRect.w-2*Cy,$e=Qt.paddedRect.h-2*Cy,or={x1:X.left,y1:X.top,x2:X.right,y2:X.bottom},Cr=Qt.stretchX||[[0,Ae]],$r=Qt.stretchY||[[0,$e]],ln=(To,vl)=>To+vl[1]-vl[0],kn=Cr.reduce(ln,0),Fn=$r.reduce(ln,0),Kn=Ae-kn,mi=$e-Fn,Ui=0,Na=kn,fa=0,La=Fn,ho=0,Ro=Kn,Os=0,Nl=mi;if(Qt.content&&kt){let To=Qt.content,vl=To[2]-To[0],ll=To[3]-To[1];(Qt.textFitWidth||Qt.textFitHeight)&&(or=Vk(X)),Ui=Ay(Cr,0,To[0]),fa=Ay($r,0,To[1]),Na=Ay(Cr,To[0],To[2]),La=Ay($r,To[1],To[3]),ho=To[0]-Ui,Os=To[1]-fa,Ro=vl-Na,Nl=ll-La}let Ms=or.x1,_s=or.y1,sl=or.x2-Ms,Ks=or.y2-_s,Hs=(To,vl,ll,rc)=>{let wh=E0(To.stretch-Ui,Na,sl,Ms),mh=Xb(To.fixed-ho,Ro,To.stretch,kn),Of=E0(vl.stretch-fa,La,Ks,_s),m0=Xb(vl.fixed-Os,Nl,vl.stretch,Fn),Wd=E0(ll.stretch-Ui,Na,sl,Ms),yf=Xb(ll.fixed-ho,Ro,ll.stretch,kn),Wp=E0(rc.stretch-fa,La,Ks,_s),qp=Xb(rc.fixed-Os,Nl,rc.stretch,Fn),Gp=new c(wh,Of),vd=new c(Wd,Of),Bf=new c(Wd,Wp),Lp=new c(wh,Wp),yp=new c(mh/re,m0/re),Zp=new c(yf/re,qp/re),rp=R*Math.PI/180;if(rp){let du=Math.sin(rp),qu=Math.cos(rp),ah=[qu,-du,du,qu];Gp._matMult(ah),vd._matMult(ah),Lp._matMult(ah),Bf._matMult(ah)}let L0=To.stretch+To.fixed,Oh=vl.stretch+vl.fixed;return{tl:Gp,tr:vd,bl:Lp,br:Bf,tex:{x:Qt.paddedRect.x+Cy+L0,y:Qt.paddedRect.y+Cy+Oh,w:ll.stretch+ll.fixed-L0,h:rc.stretch+rc.fixed-Oh},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:yp,pixelOffsetBR:Zp,minFontScaleX:Ro/re/sl,minFontScaleY:Nl/re/Ks,isSDF:at}};if(kt&&(Qt.stretchX||Qt.stretchY)){let To=My(Cr,Kn,kn),vl=My($r,mi,Fn);for(let ll=0;ll0&&(Kn=Math.max(10,Kn),this.circleDiameter=Kn)}else{let ln=!(($r=re.image)===null||$r===void 0)&&$r.content&&(re.image.textFitWidth||re.image.textFitHeight)?Vk(re):{x1:re.left,y1:re.top,x2:re.right,y2:re.bottom};ln.y1=ln.y1*Ae-$e[0],ln.y2=ln.y2*Ae+$e[2],ln.x1=ln.x1*Ae-$e[3],ln.x2=ln.x2*Ae+$e[1];let kn=re.collisionPadding;if(kn&&(ln.x1-=kn[0]*Ae,ln.y1-=kn[1]*Ae,ln.x2+=kn[2]*Ae,ln.y2+=kn[3]*Ae),Cr){let Fn=new c(ln.x1,ln.y1),Kn=new c(ln.x2,ln.y1),mi=new c(ln.x1,ln.y2),Ui=new c(ln.x2,ln.y2),Na=Cr*Math.PI/180;Fn._rotate(Na),Kn._rotate(Na),mi._rotate(Na),Ui._rotate(Na),ln.x1=Math.min(Fn.x,Kn.x,mi.x,Ui.x),ln.x2=Math.max(Fn.x,Kn.x,mi.x,Ui.x),ln.y1=Math.min(Fn.y,Kn.y,mi.y,Ui.y),ln.y2=Math.max(Fn.y,Kn.y,mi.y,Ui.y)}R.emplaceBack(at.x,at.y,ln.x1,ln.y1,ln.x2,ln.y2,kt,jt,Qt)}this.boxEndIndex=R.length}}class JA{constructor(R=[],at=(kt,jt)=>ktjt?1:0){if(this.data=R,this.length=this.data.length,this.compare=at,this.length>0)for(let kt=(this.length>>1)-1;kt>=0;kt--)this._down(kt)}push(R){this.data.push(R),this._up(this.length++)}pop(){if(this.length===0)return;let R=this.data[0],at=this.data.pop();return--this.length>0&&(this.data[0]=at,this._down(0)),R}peek(){return this.data[0]}_up(R){let{data:at,compare:kt}=this,jt=at[R];for(;R>0;){let Qt=R-1>>1,re=at[Qt];if(kt(jt,re)>=0)break;at[R]=re,R=Qt}at[R]=jt}_down(R){let{data:at,compare:kt}=this,jt=this.length>>1,Qt=at[R];for(;R=0)break;at[R]=at[re],R=re}at[R]=Qt}}function QA(X,R=1,at=!1){let kt=1/0,jt=1/0,Qt=-1/0,re=-1/0,Ae=X[0];for(let kn=0;knQt)&&(Qt=Fn.x),(!kn||Fn.y>re)&&(re=Fn.y)}let $e=Math.min(Qt-kt,re-jt),or=$e/2,Cr=new JA([],t7);if($e===0)return new c(kt,jt);for(let kn=kt;kn$r.d||!$r.d)&&($r=kn,at&&console.log("found best %d after %d probes",Math.round(1e4*kn.d)/1e4,ln)),kn.max-$r.d<=R||(or=kn.h/2,Cr.push(new ag(kn.p.x-or,kn.p.y-or,or,X)),Cr.push(new ag(kn.p.x+or,kn.p.y-or,or,X)),Cr.push(new ag(kn.p.x-or,kn.p.y+or,or,X)),Cr.push(new ag(kn.p.x+or,kn.p.y+or,or,X)),ln+=4)}return at&&(console.log(`num probes: ${ln}`),console.log(`best distance: ${$r.d}`)),$r.p}function t7(X,R){return R.max-X.max}function ag(X,R,at,kt){this.p=new c(X,R),this.h=at,this.d=function(jt,Qt){let re=!1,Ae=1/0;for(let $e=0;$ejt.y!=Fn.y>jt.y&&jt.x<(Fn.x-kn.x)*(jt.y-kn.y)/(Fn.y-kn.y)+kn.x&&(re=!re),Ae=Math.min(Ae,to(jt,kn,Fn))}}return(re?1:-1)*Math.sqrt(Ae)}(this.p,kt),this.max=this.d+this.h*Math.SQRT2}var ep;n.aq=void 0,(ep=n.aq||(n.aq={}))[ep.center=1]="center",ep[ep.left=2]="left",ep[ep.right=3]="right",ep[ep.top=4]="top",ep[ep.bottom=5]="bottom",ep[ep["top-left"]=6]="top-left",ep[ep["top-right"]=7]="top-right",ep[ep["bottom-left"]=8]="bottom-left",ep[ep["bottom-right"]=9]="bottom-right";let cv=7,f3=Number.POSITIVE_INFINITY;function u6(X,R){return R[1]!==f3?function(at,kt,jt){let Qt=0,re=0;switch(kt=Math.abs(kt),jt=Math.abs(jt),at){case"top-right":case"top-left":case"top":re=jt-cv;break;case"bottom-right":case"bottom-left":case"bottom":re=-jt+cv}switch(at){case"top-right":case"bottom-right":case"right":Qt=-kt;break;case"top-left":case"bottom-left":case"left":Qt=kt}return[Qt,re]}(X,R[0],R[1]):function(at,kt){let jt=0,Qt=0;kt<0&&(kt=0);let re=kt/Math.SQRT2;switch(at){case"top-right":case"top-left":Qt=re-cv;break;case"bottom-right":case"bottom-left":Qt=-re+cv;break;case"bottom":Qt=-kt+cv;break;case"top":Qt=kt-cv}switch(at){case"top-right":case"bottom-right":jt=-re;break;case"top-left":case"bottom-left":jt=re;break;case"left":jt=kt;break;case"right":jt=-kt}return[jt,Qt]}(X,R[0])}function h6(X,R,at){var kt;let jt=X.layout,Qt=(kt=jt.get("text-variable-anchor-offset"))===null||kt===void 0?void 0:kt.evaluate(R,{},at);if(Qt){let Ae=Qt.values,$e=[];for(let or=0;orln*Iu);Cr.startsWith("top")?$r[1]-=cv:Cr.startsWith("bottom")&&($r[1]+=cv),$e[or+1]=$r}return new Fi($e)}let re=jt.get("text-variable-anchor");if(re){let Ae;Ae=X._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[jt.get("text-radial-offset").evaluate(R,{},at)*Iu,f3]:jt.get("text-offset").evaluate(R,{},at).map(or=>or*Iu);let $e=[];for(let or of re)$e.push(or,u6(or,Ae));return new Fi($e)}return null}function p3(X){switch(X){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function e7(X,R,at,kt,jt,Qt,re,Ae,$e,or,Cr){let $r=Qt.textMaxSize.evaluate(R,{});$r===void 0&&($r=re);let ln=X.layers[0].layout,kn=ln.get("icon-offset").evaluate(R,{},Cr),Fn=f6(at.horizontal),Kn=re/24,mi=X.tilePixelRatio*Kn,Ui=X.tilePixelRatio*$r/24,Na=X.tilePixelRatio*Ae,fa=X.tilePixelRatio*ln.get("symbol-spacing"),La=ln.get("text-padding")*X.tilePixelRatio,ho=function(To,vl,ll,rc=1){let wh=To.get("icon-padding").evaluate(vl,{},ll),mh=wh&&wh.values;return[mh[0]*rc,mh[1]*rc,mh[2]*rc,mh[3]*rc]}(ln,R,Cr,X.tilePixelRatio),Ro=ln.get("text-max-angle")/180*Math.PI,Os=ln.get("text-rotation-alignment")!=="viewport"&&ln.get("symbol-placement")!=="point",Nl=ln.get("icon-rotation-alignment")==="map"&&ln.get("symbol-placement")!=="point",Ms=ln.get("symbol-placement"),_s=fa/2,sl=ln.get("icon-text-fit"),Ks;kt&&sl!=="none"&&(X.allowVerticalPlacement&&at.vertical&&(Ks=Wk(kt,at.vertical,sl,ln.get("icon-text-fit-padding"),kn,Kn)),Fn&&(kt=Wk(kt,Fn,sl,ln.get("icon-text-fit-padding"),kn,Kn)));let Hs=(To,vl)=>{vl.x<0||vl.x>=hc||vl.y<0||vl.y>=hc||function(ll,rc,wh,mh,Of,m0,Wd,yf,Wp,qp,Gp,vd,Bf,Lp,yp,Zp,rp,L0,Oh,du,qu,ah,od,Bh,Py){let Rm=ll.addToLineVertexArray(rc,wh),Fm,Pp,kh,np,ym=0,P0=0,Kp=0,x3=0,b3=-1,r2=-1,Rg={},w3=vi("");if(ll.allowVerticalPlacement&&mh.vertical){let _p=yf.layout.get("text-rotate").evaluate(qu,{},Bh)+90;kh=new Jb(Wp,rc,qp,Gp,vd,mh.vertical,Bf,Lp,yp,_p),Wd&&(np=new Jb(Wp,rc,qp,Gp,vd,Wd,rp,L0,yp,_p))}if(Of){let _p=yf.layout.get("icon-rotate").evaluate(qu,{}),I0=yf.layout.get("icon-text-fit")!=="none",uv=c6(Of,_p,od,I0),Nm=Wd?c6(Wd,_p,od,I0):void 0;Pp=new Jb(Wp,rc,qp,Gp,vd,Of,rp,L0,!1,_p),ym=4*uv.length;let h1=ll.iconSizeData,jm=null;h1.kind==="source"?(jm=[ng*yf.layout.get("icon-size").evaluate(qu,{})],jm[0]>ov&&S(`${ll.layerIds[0]}: Value for "icon-size" is >= ${J_}. Reduce your "icon-size".`)):h1.kind==="composite"&&(jm=[ng*ah.compositeIconSizes[0].evaluate(qu,{},Bh),ng*ah.compositeIconSizes[1].evaluate(qu,{},Bh)],(jm[0]>ov||jm[1]>ov)&&S(`${ll.layerIds[0]}: Value for "icon-size" is >= ${J_}. Reduce your "icon-size".`)),ll.addSymbols(ll.icon,uv,jm,du,Oh,qu,n.ah.none,rc,Rm.lineStartIndex,Rm.lineLength,-1,Bh),b3=ll.icon.placedSymbolArray.length-1,Nm&&(P0=4*Nm.length,ll.addSymbols(ll.icon,Nm,jm,du,Oh,qu,n.ah.vertical,rc,Rm.lineStartIndex,Rm.lineLength,-1,Bh),r2=ll.icon.placedSymbolArray.length-1)}let k3=Object.keys(mh.horizontal);for(let _p of k3){let I0=mh.horizontal[_p];if(!Fm){w3=vi(I0.text);let Nm=yf.layout.get("text-rotate").evaluate(qu,{},Bh);Fm=new Jb(Wp,rc,qp,Gp,vd,I0,Bf,Lp,yp,Nm)}let uv=I0.positionedLines.length===1;if(Kp+=d6(ll,rc,I0,m0,yf,yp,qu,Zp,Rm,mh.vertical?n.ah.horizontal:n.ah.horizontalOnly,uv?k3:[_p],Rg,b3,ah,Bh),uv)break}mh.vertical&&(x3+=d6(ll,rc,mh.vertical,m0,yf,yp,qu,Zp,Rm,n.ah.vertical,["vertical"],Rg,r2,ah,Bh));let T3=Fm?Fm.boxStartIndex:ll.collisionBoxArray.length,S3=Fm?Fm.boxEndIndex:ll.collisionBoxArray.length,r7=kh?kh.boxStartIndex:ll.collisionBoxArray.length,n7=kh?kh.boxEndIndex:ll.collisionBoxArray.length,i7=Pp?Pp.boxStartIndex:ll.collisionBoxArray.length,a7=Pp?Pp.boxEndIndex:ll.collisionBoxArray.length,y6=np?np.boxStartIndex:ll.collisionBoxArray.length,Iy=np?np.boxEndIndex:ll.collisionBoxArray.length,_f=-1,Dy=(_p,I0)=>_p&&_p.circleDiameter?Math.max(_p.circleDiameter,I0):I0;_f=Dy(Fm,_f),_f=Dy(kh,_f),_f=Dy(Pp,_f),_f=Dy(np,_f);let C3=_f>-1?1:0;C3&&(_f*=Py/Iu),ll.glyphOffsetArray.length>=l1.MAX_GLYPHS&&S("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),qu.sortKey!==void 0&&ll.addToSortKeyRanges(ll.symbolInstances.length,qu.sortKey);let _6=h6(yf,qu,Bh),[o7,x6]=function(_p,I0){let uv=_p.length,Nm=I0?.values;if(Nm?.length>0)for(let h1=0;h1=0?Rg.right:-1,Rg.center>=0?Rg.center:-1,Rg.left>=0?Rg.left:-1,Rg.vertical||-1,b3,r2,w3,T3,S3,r7,n7,i7,a7,y6,Iy,qp,Kp,x3,ym,P0,C3,0,Bf,_f,o7,x6)}(X,vl,To,at,kt,jt,Ks,X.layers[0],X.collisionBoxArray,R.index,R.sourceLayerIndex,X.index,mi,[La,La,La,La],Os,$e,Na,ho,Nl,kn,R,Qt,or,Cr,re)};if(Ms==="line")for(let To of i6(R.geometry,0,0,hc,hc)){let vl=XA(To,fa,Ro,at.vertical||Fn,kt,24,Ui,X.overscaling,hc);for(let ll of vl)Fn&&p6(X,Fn.text,_s,ll)||Hs(To,ll)}else if(Ms==="line-center"){for(let To of R.geometry)if(To.length>1){let vl=YA(To,Ro,at.vertical||Fn,kt,24,Ui);vl&&Hs(To,vl)}}else if(R.type==="Polygon")for(let To of uh(R.geometry,0)){let vl=QA(To,16);Hs(To[0],new lv(vl.x,vl.y,0))}else if(R.type==="LineString")for(let To of R.geometry)Hs(To,new lv(To[0].x,To[0].y,0));else if(R.type==="Point")for(let To of R.geometry)for(let vl of To)Hs([vl],new lv(vl.x,vl.y,0))}function d6(X,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn){let Kn=function(Na,fa,La,ho,Ro,Os,Nl,Ms){let _s=ho.layout.get("text-rotate").evaluate(Os,{})*Math.PI/180,sl=[];for(let Ks of fa.positionedLines)for(let Hs of Ks.positionedGlyphs){if(!Hs.rect)continue;let To=Hs.rect||{},vl=e3+1,ll=!0,rc=1,wh=0,mh=(Ro||Ms)&&Hs.vertical,Of=Hs.metrics.advance*Hs.scale/2;if(Ms&&fa.verticalizable&&(wh=Ks.lineOffset/2-(Hs.imageName?-(Iu-Hs.metrics.width*Hs.scale)/2:(Hs.scale-1)*Iu)),Hs.imageName){let du=Nl[Hs.imageName];ll=du.sdf,rc=du.pixelRatio,vl=vf/rc}let m0=Ro?[Hs.x+Of,Hs.y]:[0,0],Wd=Ro?[0,0]:[Hs.x+Of+La[0],Hs.y+La[1]-wh],yf=[0,0];mh&&(yf=Wd,Wd=[0,0]);let Wp=Hs.metrics.isDoubleResolution?2:1,qp=(Hs.metrics.left-vl)*Hs.scale-Of+Wd[0],Gp=(-Hs.metrics.top-vl)*Hs.scale+Wd[1],vd=qp+To.w/Wp*Hs.scale/rc,Bf=Gp+To.h/Wp*Hs.scale/rc,Lp=new c(qp,Gp),yp=new c(vd,Gp),Zp=new c(qp,Bf),rp=new c(vd,Bf);if(mh){let du=new c(-Of,Of-by),qu=-Math.PI/2,ah=Iu/2-Of,od=new c(5-by-ah,-(Hs.imageName?ah:0)),Bh=new c(...yf);Lp._rotateAround(qu,du)._add(od)._add(Bh),yp._rotateAround(qu,du)._add(od)._add(Bh),Zp._rotateAround(qu,du)._add(od)._add(Bh),rp._rotateAround(qu,du)._add(od)._add(Bh)}if(_s){let du=Math.sin(_s),qu=Math.cos(_s),ah=[qu,-du,du,qu];Lp._matMult(ah),yp._matMult(ah),Zp._matMult(ah),rp._matMult(ah)}let L0=new c(0,0),Oh=new c(0,0);sl.push({tl:Lp,tr:yp,bl:Zp,br:rp,tex:To,writingMode:fa.writingMode,glyphOffset:m0,sectionIndex:Hs.sectionIndex,isSDF:ll,pixelOffsetTL:L0,pixelOffsetBR:Oh,minFontScaleX:0,minFontScaleY:0})}return sl}(0,at,Ae,jt,Qt,re,kt,X.allowVerticalPlacement),mi=X.textSizeData,Ui=null;mi.kind==="source"?(Ui=[ng*jt.layout.get("text-size").evaluate(re,{})],Ui[0]>ov&&S(`${X.layerIds[0]}: Value for "text-size" is >= ${J_}. Reduce your "text-size".`)):mi.kind==="composite"&&(Ui=[ng*kn.compositeTextSizes[0].evaluate(re,{},Fn),ng*kn.compositeTextSizes[1].evaluate(re,{},Fn)],(Ui[0]>ov||Ui[1]>ov)&&S(`${X.layerIds[0]}: Value for "text-size" is >= ${J_}. Reduce your "text-size".`)),X.addSymbols(X.text,Kn,Ui,Ae,Qt,re,or,R,$e.lineStartIndex,$e.lineLength,ln,Fn);for(let Na of Cr)$r[Na]=X.text.placedSymbolArray.length-1;return 4*Kn.length}function f6(X){for(let R in X)return X[R];return null}function p6(X,R,at,kt){let jt=X.compareText;if(R in jt){let Qt=jt[R];for(let re=Qt.length-1;re>=0;re--)if(kt.dist(Qt[re])>4;if(jt!==1)throw new Error(`Got v${jt} data when expected v1.`);let Qt=m6[15&kt];if(!Qt)throw new Error("Unrecognized array type.");let[re]=new Uint16Array(R,2,1),[Ae]=new Uint32Array(R,4,1);return new m3(Ae,re,Qt,R)}constructor(R,at=64,kt=Float64Array,jt){if(isNaN(R)||R<0)throw new Error(`Unpexpected numItems value: ${R}.`);this.numItems=+R,this.nodeSize=Math.min(Math.max(+at,2),65535),this.ArrayType=kt,this.IndexArrayType=R<65536?Uint16Array:Uint32Array;let Qt=m6.indexOf(this.ArrayType),re=2*R*this.ArrayType.BYTES_PER_ELEMENT,Ae=R*this.IndexArrayType.BYTES_PER_ELEMENT,$e=(8-Ae%8)%8;if(Qt<0)throw new Error(`Unexpected typed array class: ${kt}.`);jt&&jt instanceof ArrayBuffer?(this.data=jt,this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ae+$e,2*R),this._pos=2*R,this._finished=!0):(this.data=new ArrayBuffer(8+re+Ae+$e),this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ae+$e,2*R),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Qt]),new Uint16Array(this.data,2,1)[0]=at,new Uint32Array(this.data,4,1)[0]=R)}add(R,at){let kt=this._pos>>1;return this.ids[kt]=kt,this.coords[this._pos++]=R,this.coords[this._pos++]=at,kt}finish(){let R=this._pos>>1;if(R!==this.numItems)throw new Error(`Added ${R} items when expected ${this.numItems}.`);return g3(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(R,at,kt,jt){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Qt,coords:re,nodeSize:Ae}=this,$e=[0,Qt.length-1,0],or=[];for(;$e.length;){let Cr=$e.pop()||0,$r=$e.pop()||0,ln=$e.pop()||0;if($r-ln<=Ae){for(let mi=ln;mi<=$r;mi++){let Ui=re[2*mi],Na=re[2*mi+1];Ui>=R&&Ui<=kt&&Na>=at&&Na<=jt&&or.push(Qt[mi])}continue}let kn=ln+$r>>1,Fn=re[2*kn],Kn=re[2*kn+1];Fn>=R&&Fn<=kt&&Kn>=at&&Kn<=jt&&or.push(Qt[kn]),(Cr===0?R<=Fn:at<=Kn)&&($e.push(ln),$e.push(kn-1),$e.push(1-Cr)),(Cr===0?kt>=Fn:jt>=Kn)&&($e.push(kn+1),$e.push($r),$e.push(1-Cr))}return or}within(R,at,kt){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:jt,coords:Qt,nodeSize:re}=this,Ae=[0,jt.length-1,0],$e=[],or=kt*kt;for(;Ae.length;){let Cr=Ae.pop()||0,$r=Ae.pop()||0,ln=Ae.pop()||0;if($r-ln<=re){for(let mi=ln;mi<=$r;mi++)vp(Qt[2*mi],Qt[2*mi+1],R,at)<=or&&$e.push(jt[mi]);continue}let kn=ln+$r>>1,Fn=Qt[2*kn],Kn=Qt[2*kn+1];vp(Fn,Kn,R,at)<=or&&$e.push(jt[kn]),(Cr===0?R-kt<=Fn:at-kt<=Kn)&&(Ae.push(ln),Ae.push(kn-1),Ae.push(1-Cr)),(Cr===0?R+kt>=Fn:at+kt>=Kn)&&(Ae.push(kn+1),Ae.push($r),Ae.push(1-Cr))}return $e}}function g3(X,R,at,kt,jt,Qt){if(jt-kt<=at)return;let re=kt+jt>>1;g6(X,R,re,kt,jt,Qt),g3(X,R,at,kt,re-1,1-Qt),g3(X,R,at,re+1,jt,1-Qt)}function g6(X,R,at,kt,jt,Qt){for(;jt>kt;){if(jt-kt>600){let or=jt-kt+1,Cr=at-kt+1,$r=Math.log(or),ln=.5*Math.exp(2*$r/3),kn=.5*Math.sqrt($r*ln*(or-ln)/or)*(Cr-or/2<0?-1:1);g6(X,R,at,Math.max(kt,Math.floor(at-Cr*ln/or+kn)),Math.min(jt,Math.floor(at+(or-Cr)*ln/or+kn)),Qt)}let re=R[2*at+Qt],Ae=kt,$e=jt;for(Ey(X,R,kt,at),R[2*jt+Qt]>re&&Ey(X,R,kt,jt);Ae<$e;){for(Ey(X,R,Ae,$e),Ae++,$e--;R[2*Ae+Qt]re;)$e--}R[2*kt+Qt]===re?Ey(X,R,kt,$e):($e++,Ey(X,R,$e,jt)),$e<=at&&(kt=$e+1),at<=$e&&(jt=$e-1)}}function Ey(X,R,at,kt){Qb(X,at,kt),Qb(R,2*at,2*kt),Qb(R,2*at+1,2*kt+1)}function Qb(X,R,at){let kt=X[R];X[R]=X[at],X[at]=kt}function vp(X,R,at,kt){let jt=X-at,Qt=R-kt;return jt*jt+Qt*Qt}var v3;n.bg=void 0,(v3=n.bg||(n.bg={})).create="create",v3.load="load",v3.fullLoad="fullLoad";let t2=null,Ly=[],y3=1e3/60,e2="loadTime",_3="fullLoadTime",v6={mark(X){performance.mark(X)},frame(X){let R=X;t2!=null&&Ly.push(R-t2),t2=R},clearMetrics(){t2=null,Ly=[],performance.clearMeasures(e2),performance.clearMeasures(_3);for(let X in n.bg)performance.clearMarks(n.bg[X])},getPerformanceMetrics(){performance.measure(e2,n.bg.create,n.bg.load),performance.measure(_3,n.bg.create,n.bg.fullLoad);let X=performance.getEntriesByName(e2)[0].duration,R=performance.getEntriesByName(_3)[0].duration,at=Ly.length,kt=1/(Ly.reduce((Qt,re)=>Qt+re,0)/at/1e3),jt=Ly.filter(Qt=>Qt>y3).reduce((Qt,re)=>Qt+(re-y3)/y3,0);return{loadTime:X,fullLoadTime:R,fps:kt,percentDroppedFrames:jt/(at+jt)*100,totalFrames:at}}};n.$=class extends Gr{},n.A=Ri,n.B=Pa,n.C=function(X){if(U==null){let R=X.navigator?X.navigator.userAgent:null;U=!!X.safari||!(!R||!(/\b(iPad|iPhone|iPod)\b/.test(R)||R.match("Safari")&&!R.match("Chrome")))}return U},n.D=ds,n.E=mt,n.F=class{constructor(X,R){this.target=X,this.mapId=R,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new rx(()=>this.process()),this.subscription=function(at,kt,jt,Qt){return at.addEventListener(kt,jt,!1),{unsubscribe:()=>{at.removeEventListener(kt,jt,!1)}}}(this.target,"message",at=>this.receive(at)),this.globalScope=B(self)?X:window}registerMessageHandler(X,R){this.messageHandlers[X]=R}sendAsync(X,R){return new Promise((at,kt)=>{let jt=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[jt]={resolve:at,reject:kt},R&&R.signal.addEventListener("abort",()=>{delete this.resolveRejects[jt];let Ae={id:jt,type:"",origin:location.origin,targetMapId:X.targetMapId,sourceMapId:this.mapId};this.target.postMessage(Ae)},{once:!0});let Qt=[],re=Object.assign(Object.assign({},X),{id:jt,sourceMapId:this.mapId,origin:location.origin,data:gs(X.data,Qt)});this.target.postMessage(re,{transfer:Qt})})}receive(X){let R=X.data,at=R.id;if(!(R.origin!=="file://"&&location.origin!=="file://"&&R.origin!=="resource://android"&&location.origin!=="resource://android"&&R.origin!==location.origin||R.targetMapId&&this.mapId!==R.targetMapId)){if(R.type===""){delete this.tasks[at];let kt=this.abortControllers[at];return delete this.abortControllers[at],void(kt&&kt.abort())}if(B(self)||R.mustQueue)return this.tasks[at]=R,this.taskQueue.push(at),void this.invoker.trigger();this.processTask(at,R)}}process(){if(this.taskQueue.length===0)return;let X=this.taskQueue.shift(),R=this.tasks[X];delete this.tasks[X],this.taskQueue.length>0&&this.invoker.trigger(),R&&this.processTask(X,R)}processTask(X,R){return i(this,void 0,void 0,function*(){if(R.type===""){let jt=this.resolveRejects[X];return delete this.resolveRejects[X],jt?void(R.error?jt.reject(ws(R.error)):jt.resolve(ws(R.data))):void 0}if(!this.messageHandlers[R.type])return void this.completeTask(X,new Error(`Could not find a registered handler for ${R.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let at=ws(R.data),kt=new AbortController;this.abortControllers[X]=kt;try{let jt=yield this.messageHandlers[R.type](R.sourceMapId,at,kt);this.completeTask(X,null,jt)}catch(jt){this.completeTask(X,jt)}})}completeTask(X,R,at){let kt=[];delete this.abortControllers[X];let jt={id:X,type:"",sourceMapId:this.mapId,origin:location.origin,error:R?gs(R):null,data:gs(at,kt)};this.target.postMessage(jt,{transfer:kt})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},n.G=vt,n.H=function(){var X=new Ri(16);return Ri!=Float32Array&&(X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[11]=0,X[12]=0,X[13]=0,X[14]=0),X[0]=1,X[5]=1,X[10]=1,X[15]=1,X},n.I=gp,n.J=function(X,R,at){var kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn=at[0],mi=at[1],Ui=at[2];return R===X?(X[12]=R[0]*Kn+R[4]*mi+R[8]*Ui+R[12],X[13]=R[1]*Kn+R[5]*mi+R[9]*Ui+R[13],X[14]=R[2]*Kn+R[6]*mi+R[10]*Ui+R[14],X[15]=R[3]*Kn+R[7]*mi+R[11]*Ui+R[15]):(jt=R[1],Qt=R[2],re=R[3],Ae=R[4],$e=R[5],or=R[6],Cr=R[7],$r=R[8],ln=R[9],kn=R[10],Fn=R[11],X[0]=kt=R[0],X[1]=jt,X[2]=Qt,X[3]=re,X[4]=Ae,X[5]=$e,X[6]=or,X[7]=Cr,X[8]=$r,X[9]=ln,X[10]=kn,X[11]=Fn,X[12]=kt*Kn+Ae*mi+$r*Ui+R[12],X[13]=jt*Kn+$e*mi+ln*Ui+R[13],X[14]=Qt*Kn+or*mi+kn*Ui+R[14],X[15]=re*Kn+Cr*mi+Fn*Ui+R[15]),X},n.K=function(X,R,at){var kt=at[0],jt=at[1],Qt=at[2];return X[0]=R[0]*kt,X[1]=R[1]*kt,X[2]=R[2]*kt,X[3]=R[3]*kt,X[4]=R[4]*jt,X[5]=R[5]*jt,X[6]=R[6]*jt,X[7]=R[7]*jt,X[8]=R[8]*Qt,X[9]=R[9]*Qt,X[10]=R[10]*Qt,X[11]=R[11]*Qt,X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15],X},n.L=$a,n.M=function(X,R){let at={};for(let kt=0;kt{let R=window.document.createElement("video");return R.muted=!0,new Promise(at=>{R.onloadstart=()=>{at(R)};for(let kt of X){let jt=window.document.createElement("source");it(kt)||(R.crossOrigin="Anonymous"),jt.src=kt,R.appendChild(jt)}})},n.a4=function(){return I++},n.a5=Fa,n.a6=l1,n.a7=Ud,n.a8=Vr,n.a9=t6,n.aA=function(X){if(X.type==="custom")return new Zk(X);switch(X.type){case"background":return new ex(X);case"circle":return new Oa(X);case"fill":return new Ii(X);case"fill-extrusion":return new u0(X);case"heatmap":return new Cl(X);case"hillshade":return new Eu(X);case"line":return new n1(X);case"raster":return new KA(X);case"symbol":return new Gb(X)}},n.aB=g,n.aC=function(X,R){if(!X)return[{command:"setStyle",args:[R]}];let at=[];try{if(!Bt(X.version,R.version))return[{command:"setStyle",args:[R]}];Bt(X.center,R.center)||at.push({command:"setCenter",args:[R.center]}),Bt(X.zoom,R.zoom)||at.push({command:"setZoom",args:[R.zoom]}),Bt(X.bearing,R.bearing)||at.push({command:"setBearing",args:[R.bearing]}),Bt(X.pitch,R.pitch)||at.push({command:"setPitch",args:[R.pitch]}),Bt(X.sprite,R.sprite)||at.push({command:"setSprite",args:[R.sprite]}),Bt(X.glyphs,R.glyphs)||at.push({command:"setGlyphs",args:[R.glyphs]}),Bt(X.transition,R.transition)||at.push({command:"setTransition",args:[R.transition]}),Bt(X.light,R.light)||at.push({command:"setLight",args:[R.light]}),Bt(X.terrain,R.terrain)||at.push({command:"setTerrain",args:[R.terrain]}),Bt(X.sky,R.sky)||at.push({command:"setSky",args:[R.sky]}),Bt(X.projection,R.projection)||at.push({command:"setProjection",args:[R.projection]});let kt={},jt=[];(function(re,Ae,$e,or){let Cr;for(Cr in Ae=Ae||{},re=re||{})Object.prototype.hasOwnProperty.call(re,Cr)&&(Object.prototype.hasOwnProperty.call(Ae,Cr)||ee(Cr,$e,or));for(Cr in Ae)Object.prototype.hasOwnProperty.call(Ae,Cr)&&(Object.prototype.hasOwnProperty.call(re,Cr)?Bt(re[Cr],Ae[Cr])||(re[Cr].type==="geojson"&&Ae[Cr].type==="geojson"&&ge(re,Ae,Cr)?Zt($e,{command:"setGeoJSONSourceData",args:[Cr,Ae[Cr].data]}):xe(Cr,Ae,$e,or)):Gt(Cr,Ae,$e))})(X.sources,R.sources,jt,kt);let Qt=[];X.layers&&X.layers.forEach(re=>{"source"in re&&kt[re.source]?at.push({command:"removeLayer",args:[re.id]}):Qt.push(re)}),at=at.concat(jt),function(re,Ae,$e){Ae=Ae||[];let or=(re=re||[]).map(ue),Cr=Ae.map(ue),$r=re.reduce(Mt,{}),ln=Ae.reduce(Mt,{}),kn=or.slice(),Fn=Object.create(null),Kn,mi,Ui,Na,fa;for(let La=0,ho=0;La@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(at,kt,jt,Qt)=>{let re=jt||Qt;return R[kt]=!re||re.toLowerCase(),""}),R["max-age"]){let at=parseInt(R["max-age"],10);isNaN(at)?delete R["max-age"]:R["max-age"]=at}return R},n.ab=function(X,R){let at=[];for(let kt in X)kt in R||at.push(kt);return at},n.ac=w,n.ad=function(X,R,at){var kt=Math.sin(at),jt=Math.cos(at),Qt=R[0],re=R[1],Ae=R[2],$e=R[3],or=R[4],Cr=R[5],$r=R[6],ln=R[7];return R!==X&&(X[8]=R[8],X[9]=R[9],X[10]=R[10],X[11]=R[11],X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15]),X[0]=Qt*jt+or*kt,X[1]=re*jt+Cr*kt,X[2]=Ae*jt+$r*kt,X[3]=$e*jt+ln*kt,X[4]=or*jt-Qt*kt,X[5]=Cr*jt-re*kt,X[6]=$r*jt-Ae*kt,X[7]=ln*jt-$e*kt,X},n.ae=function(X){var R=new Ri(16);return R[0]=X[0],R[1]=X[1],R[2]=X[2],R[3]=X[3],R[4]=X[4],R[5]=X[5],R[6]=X[6],R[7]=X[7],R[8]=X[8],R[9]=X[9],R[10]=X[10],R[11]=X[11],R[12]=X[12],R[13]=X[13],R[14]=X[14],R[15]=X[15],R},n.af=ua,n.ag=function(X,R){let at=0,kt=0;if(X.kind==="constant")kt=X.layoutSize;else if(X.kind!=="source"){let{interpolationType:jt,minZoom:Qt,maxZoom:re}=X,Ae=jt?w(Ka.interpolationFactor(jt,R,Qt,re),0,1):0;X.kind==="camera"?kt=Zo.number(X.minSize,X.maxSize,Ae):at=Ae}return{uSizeT:at,uSize:kt}},n.ai=function(X,{uSize:R,uSizeT:at},{lowerSize:kt,upperSize:jt}){return X.kind==="source"?kt/ng:X.kind==="composite"?Zo.number(kt/ng,jt/ng,at):R},n.aj=sv,n.ak=function(X,R,at,kt){let jt=R.y-X.y,Qt=R.x-X.x,re=kt.y-at.y,Ae=kt.x-at.x,$e=re*Qt-Ae*jt;if($e===0)return null;let or=(Ae*(X.y-at.y)-re*(X.x-at.x))/$e;return new c(X.x+or*Qt,X.y+or*jt)},n.al=i6,n.am=bi,n.an=ki,n.ao=function(X){let R=1/0,at=1/0,kt=-1/0,jt=-1/0;for(let Qt of X)R=Math.min(R,Qt.x),at=Math.min(at,Qt.y),kt=Math.max(kt,Qt.x),jt=Math.max(jt,Qt.y);return[R,at,kt,jt]},n.ap=Iu,n.ar=i3,n.as=function(X,R){var at=R[0],kt=R[1],jt=R[2],Qt=R[3],re=R[4],Ae=R[5],$e=R[6],or=R[7],Cr=R[8],$r=R[9],ln=R[10],kn=R[11],Fn=R[12],Kn=R[13],mi=R[14],Ui=R[15],Na=at*Ae-kt*re,fa=at*$e-jt*re,La=at*or-Qt*re,ho=kt*$e-jt*Ae,Ro=kt*or-Qt*Ae,Os=jt*or-Qt*$e,Nl=Cr*Kn-$r*Fn,Ms=Cr*mi-ln*Fn,_s=Cr*Ui-kn*Fn,sl=$r*mi-ln*Kn,Ks=$r*Ui-kn*Kn,Hs=ln*Ui-kn*mi,To=Na*Hs-fa*Ks+La*sl+ho*_s-Ro*Ms+Os*Nl;return To?(X[0]=(Ae*Hs-$e*Ks+or*sl)*(To=1/To),X[1]=(jt*Ks-kt*Hs-Qt*sl)*To,X[2]=(Kn*Os-mi*Ro+Ui*ho)*To,X[3]=(ln*Ro-$r*Os-kn*ho)*To,X[4]=($e*_s-re*Hs-or*Ms)*To,X[5]=(at*Hs-jt*_s+Qt*Ms)*To,X[6]=(mi*La-Fn*Os-Ui*fa)*To,X[7]=(Cr*Os-ln*La+kn*fa)*To,X[8]=(re*Ks-Ae*_s+or*Nl)*To,X[9]=(kt*_s-at*Ks-Qt*Nl)*To,X[10]=(Fn*Ro-Kn*La+Ui*Na)*To,X[11]=($r*La-Cr*Ro-kn*Na)*To,X[12]=(Ae*Ms-re*sl-$e*Nl)*To,X[13]=(at*sl-kt*Ms+jt*Nl)*To,X[14]=(Kn*fa-Fn*ho-mi*Na)*To,X[15]=(Cr*ho-$r*fa+ln*Na)*To,X):null},n.at=p3,n.au=n3,n.av=m3,n.aw=function(){let X={},R=dt.$version;for(let at in dt.$root){let kt=dt.$root[at];if(kt.required){let jt=null;jt=at==="version"?R:kt.type==="array"?[]:{},jt!=null&&(X[at]=jt)}}return X},n.ax=bo,n.ay=rt,n.az=function(X){X=X.slice();let R=Object.create(null);for(let at=0;at25||kt<0||kt>=1||at<0||at>=1)},n.bc=function(X,R){return X[0]=R[0],X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[5]=R[1],X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[10]=R[2],X[11]=0,X[12]=0,X[13]=0,X[14]=0,X[15]=1,X},n.bd=class extends wr{},n.be=c3,n.bf=v6,n.bh=ut,n.bi=function(X,R){ht.REGISTERED_PROTOCOLS[X]=R},n.bj=function(X){delete ht.REGISTERED_PROTOCOLS[X]},n.bk=function(X,R){let at={};for(let jt=0;jtHs*Iu)}let Ms=re?"center":at.get("text-justify").evaluate(or,{},X.canonical),_s=at.get("symbol-placement")==="point"?at.get("text-max-width").evaluate(or,{},X.canonical)*Iu:1/0,sl=()=>{X.bucket.allowVerticalPlacement&&ks(La)&&(Fn.vertical=$b(Kn,X.glyphMap,X.glyphPositions,X.imagePositions,Cr,_s,Qt,Os,"left",Ro,Ui,n.ah.vertical,!0,ln,$r))};if(!re&&Nl){let Ks=new Set;if(Ms==="auto")for(let To=0;Toi(void 0,void 0,void 0,function*(){if(X.byteLength===0)return createImageBitmap(new ImageData(1,1));let R=new Blob([new Uint8Array(X)],{type:"image/png"});try{return createImageBitmap(R)}catch(at){throw new Error(`Could not load image because of ${at.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),n.e=E,n.f=X=>new Promise((R,at)=>{let kt=new Image;kt.onload=()=>{R(kt),URL.revokeObjectURL(kt.src),kt.onload=null,window.requestAnimationFrame(()=>{kt.src=W})},kt.onerror=()=>at(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."));let jt=new Blob([new Uint8Array(X)],{type:"image/png"});kt.src=X.byteLength?URL.createObjectURL(jt):W}),n.g=bt,n.h=(X,R)=>gt(E(X,{type:"json"}),R),n.i=B,n.j=J,n.k=ot,n.l=(X,R)=>gt(E(X,{type:"arrayBuffer"}),R),n.m=gt,n.n=function(X){return new Qw(X).readFields($A,[])},n.o=Xl,n.p=Ub,n.q=Kt,n.r=ga,n.s=it,n.t=Sa,n.u=Pi,n.v=dt,n.w=S,n.x=function([X,R,at]){return R+=90,R*=Math.PI/180,at*=Math.PI/180,{x:X*Math.cos(R)*Math.sin(at),y:X*Math.sin(R)*Math.sin(at),z:X*Math.cos(at)}},n.y=Zo,n.z=Zl}),z("worker",["./shared"],function(n){class i{constructor(Xt){this.keyCache={},Xt&&this.replace(Xt)}replace(Xt){this._layerConfigs={},this._layers={},this.update(Xt,[])}update(Xt,oe){for(let _t of Xt){this._layerConfigs[_t.id]=_t;let Pt=this._layers[_t.id]=n.aA(_t);Pt._featureFilter=n.a7(Pt.filter),this.keyCache[_t.id]&&delete this.keyCache[_t.id]}for(let _t of oe)delete this.keyCache[_t],delete this._layerConfigs[_t],delete this._layers[_t];this.familiesBySource={};let zt=n.bk(Object.values(this._layerConfigs),this.keyCache);for(let _t of zt){let Pt=_t.map(Ye=>this._layers[Ye.id]),Ht=Pt[0];if(Ht.visibility==="none")continue;let ae=Ht.source||"",he=this.familiesBySource[ae];he||(he=this.familiesBySource[ae]={});let Me=Ht.sourceLayer||"_geojsonTileLayer",qe=he[Me];qe||(qe=he[Me]=[]),qe.push(Pt)}}}class a{constructor(Xt){let oe={},zt=[];for(let ae in Xt){let he=Xt[ae],Me=oe[ae]={};for(let qe in he){let Ye=he[+qe];if(!Ye||Ye.bitmap.width===0||Ye.bitmap.height===0)continue;let ur={x:0,y:0,w:Ye.bitmap.width+2,h:Ye.bitmap.height+2};zt.push(ur),Me[qe]={rect:ur,metrics:Ye.metrics}}}let{w:_t,h:Pt}=n.p(zt),Ht=new n.o({width:_t||1,height:Pt||1});for(let ae in Xt){let he=Xt[ae];for(let Me in he){let qe=he[+Me];if(!qe||qe.bitmap.width===0||qe.bitmap.height===0)continue;let Ye=oe[ae][Me].rect;n.o.copy(qe.bitmap,Ht,{x:0,y:0},{x:Ye.x+1,y:Ye.y+1},qe.bitmap)}}this.image=Ht,this.positions=oe}}n.bl("GlyphAtlas",a);class l{constructor(Xt){this.tileID=new n.S(Xt.tileID.overscaledZ,Xt.tileID.wrap,Xt.tileID.canonical.z,Xt.tileID.canonical.x,Xt.tileID.canonical.y),this.uid=Xt.uid,this.zoom=Xt.zoom,this.pixelRatio=Xt.pixelRatio,this.tileSize=Xt.tileSize,this.source=Xt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Xt.showCollisionBoxes,this.collectResourceTiming=!!Xt.collectResourceTiming,this.returnDependencies=!!Xt.returnDependencies,this.promoteId=Xt.promoteId,this.inFlightDependencies=[]}parse(Xt,oe,zt,_t){return n._(this,void 0,void 0,function*(){this.status="parsing",this.data=Xt,this.collisionBoxArray=new n.a5;let Pt=new n.bm(Object.keys(Xt.layers).sort()),Ht=new n.bn(this.tileID,this.promoteId);Ht.bucketLayerIDs=[];let ae={},he={featureIndex:Ht,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:zt},Me=oe.familiesBySource[this.source];for(let Ci in Me){let fi=Xt.layers[Ci];if(!fi)continue;fi.version===1&&n.w(`Vector tile source "${this.source}" layer "${Ci}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let ba=Pt.encode(Ci),oa=[];for(let Ke=0;Ke=sr.maxzoom||sr.visibility!=="none"&&(o(Ke,this.zoom,zt),(ae[sr.id]=sr.createBucket({index:Ht.bucketLayerIDs.length,layers:Ke,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ba,sourceID:this.source})).populate(oa,he,this.tileID.canonical),Ht.bucketLayerIDs.push(Ke.map(vr=>vr.id)))}}let qe=n.aF(he.glyphDependencies,Ci=>Object.keys(Ci).map(Number));this.inFlightDependencies.forEach(Ci=>Ci?.abort()),this.inFlightDependencies=[];let Ye=Promise.resolve({});if(Object.keys(qe).length){let Ci=new AbortController;this.inFlightDependencies.push(Ci),Ye=_t.sendAsync({type:"GG",data:{stacks:qe,source:this.source,tileID:this.tileID,type:"glyphs"}},Ci)}let ur=Object.keys(he.iconDependencies),Rr=Promise.resolve({});if(ur.length){let Ci=new AbortController;this.inFlightDependencies.push(Ci),Rr=_t.sendAsync({type:"GI",data:{icons:ur,source:this.source,tileID:this.tileID,type:"icons"}},Ci)}let zr=Object.keys(he.patternDependencies),xr=Promise.resolve({});if(zr.length){let Ci=new AbortController;this.inFlightDependencies.push(Ci),xr=_t.sendAsync({type:"GI",data:{icons:zr,source:this.source,tileID:this.tileID,type:"patterns"}},Ci)}let[pn,ci,ui]=yield Promise.all([Ye,Rr,xr]),yi=new a(pn),Gi=new n.bo(ci,ui);for(let Ci in ae){let fi=ae[Ci];fi instanceof n.a6?(o(fi.layers,this.zoom,zt),n.bp({bucket:fi,glyphMap:pn,glyphPositions:yi.positions,imageMap:ci,imagePositions:Gi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):fi.hasPattern&&(fi instanceof n.bq||fi instanceof n.br||fi instanceof n.bs)&&(o(fi.layers,this.zoom,zt),fi.addFeatures(he,this.tileID.canonical,Gi.patternPositions))}return this.status="done",{buckets:Object.values(ae).filter(Ci=>!Ci.isEmpty()),featureIndex:Ht,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:yi.image,imageAtlas:Gi,glyphMap:this.returnDependencies?pn:null,iconMap:this.returnDependencies?ci:null,glyphPositions:this.returnDependencies?yi.positions:null}})}}function o(Oe,Xt,oe){let zt=new n.z(Xt);for(let _t of Oe)_t.recalculate(zt,oe)}class c{constructor(Xt,oe,zt){this.actor=Xt,this.layerIndex=oe,this.availableImages=zt,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Xt,oe){return n._(this,void 0,void 0,function*(){let zt=yield n.l(Xt.request,oe);try{return{vectorTile:new n.bt.VectorTile(new n.bu(zt.data)),rawData:zt.data,cacheControl:zt.cacheControl,expires:zt.expires}}catch(_t){let Pt=new Uint8Array(zt.data),Ht=`Unable to parse the tile at ${Xt.request.url}, `;throw Ht+=Pt[0]===31&&Pt[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${_t.message}`,new Error(Ht)}})}loadTile(Xt){return n._(this,void 0,void 0,function*(){let oe=Xt.uid,zt=!!(Xt&&Xt.request&&Xt.request.collectResourceTiming)&&new n.bv(Xt.request),_t=new l(Xt);this.loading[oe]=_t;let Pt=new AbortController;_t.abort=Pt;try{let Ht=yield this.loadVectorTile(Xt,Pt);if(delete this.loading[oe],!Ht)return null;let ae=Ht.rawData,he={};Ht.expires&&(he.expires=Ht.expires),Ht.cacheControl&&(he.cacheControl=Ht.cacheControl);let Me={};if(zt){let Ye=zt.finish();Ye&&(Me.resourceTiming=JSON.parse(JSON.stringify(Ye)))}_t.vectorTile=Ht.vectorTile;let qe=_t.parse(Ht.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[oe]=_t,this.fetching[oe]={rawTileData:ae,cacheControl:he,resourceTiming:Me};try{let Ye=yield qe;return n.e({rawTileData:ae.slice(0)},Ye,he,Me)}finally{delete this.fetching[oe]}}catch(Ht){throw delete this.loading[oe],_t.status="done",this.loaded[oe]=_t,Ht}})}reloadTile(Xt){return n._(this,void 0,void 0,function*(){let oe=Xt.uid;if(!this.loaded||!this.loaded[oe])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let zt=this.loaded[oe];if(zt.showCollisionBoxes=Xt.showCollisionBoxes,zt.status==="parsing"){let _t=yield zt.parse(zt.vectorTile,this.layerIndex,this.availableImages,this.actor),Pt;if(this.fetching[oe]){let{rawTileData:Ht,cacheControl:ae,resourceTiming:he}=this.fetching[oe];delete this.fetching[oe],Pt=n.e({rawTileData:Ht.slice(0)},_t,ae,he)}else Pt=_t;return Pt}if(zt.status==="done"&&zt.vectorTile)return zt.parse(zt.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Xt){return n._(this,void 0,void 0,function*(){let oe=this.loading,zt=Xt.uid;oe&&oe[zt]&&oe[zt].abort&&(oe[zt].abort.abort(),delete oe[zt])})}removeTile(Xt){return n._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Xt.uid]&&delete this.loaded[Xt.uid]})}}class s{constructor(){this.loaded={}}loadTile(Xt){return n._(this,void 0,void 0,function*(){let{uid:oe,encoding:zt,rawImageData:_t,redFactor:Pt,greenFactor:Ht,blueFactor:ae,baseShift:he}=Xt,Me=_t.width+2,qe=_t.height+2,Ye=n.b(_t)?new n.R({width:Me,height:qe},yield n.bw(_t,-1,-1,Me,qe)):_t,ur=new n.bx(oe,Ye,zt,Pt,Ht,ae,he);return this.loaded=this.loaded||{},this.loaded[oe]=ur,ur})}removeTile(Xt){let oe=this.loaded,zt=Xt.uid;oe&&oe[zt]&&delete oe[zt]}}function h(Oe,Xt){if(Oe.length!==0){m(Oe[0],Xt);for(var oe=1;oe=Math.abs(ae)?oe-he+ae:ae-he+oe,oe=he}oe+zt>=0!=!!Xt&&Oe.reverse()}var b=n.by(function Oe(Xt,oe){var zt,_t=Xt&&Xt.type;if(_t==="FeatureCollection")for(zt=0;zt>31}function B(Oe,Xt){for(var oe=Oe.loadGeometry(),zt=Oe.type,_t=0,Pt=0,Ht=oe.length,ae=0;aeOe},F=Math.fround||(H=new Float32Array(1),Oe=>(H[0]=+Oe,H[0]));var H;let q=3,G=5,tt=6;class ht{constructor(Xt){this.options=Object.assign(Object.create(W),Xt),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Xt){let{log:oe,minZoom:zt,maxZoom:_t}=this.options;oe&&console.time("total time");let Pt=`prepare ${Xt.length} points`;oe&&console.time(Pt),this.points=Xt;let Ht=[];for(let he=0;he=zt;he--){let Me=+Date.now();ae=this.trees[he]=this._createTree(this._cluster(ae,he)),oe&&console.log("z%d: %d clusters in %dms",he,ae.numItems,+Date.now()-Me)}return oe&&console.timeEnd("total time"),this}getClusters(Xt,oe){let zt=((Xt[0]+180)%360+360)%360-180,_t=Math.max(-90,Math.min(90,Xt[1])),Pt=Xt[2]===180?180:((Xt[2]+180)%360+360)%360-180,Ht=Math.max(-90,Math.min(90,Xt[3]));if(Xt[2]-Xt[0]>=360)zt=-180,Pt=180;else if(zt>Pt){let Ye=this.getClusters([zt,_t,180,Ht],oe),ur=this.getClusters([-180,_t,Pt,Ht],oe);return Ye.concat(ur)}let ae=this.trees[this._limitZoom(oe)],he=ae.range(ut(zt),rt(Ht),ut(Pt),rt(_t)),Me=ae.data,qe=[];for(let Ye of he){let ur=this.stride*Ye;qe.push(Me[ur+G]>1?bt(Me,ur,this.clusterProps):this.points[Me[ur+q]])}return qe}getChildren(Xt){let oe=this._getOriginId(Xt),zt=this._getOriginZoom(Xt),_t="No cluster with the specified id.",Pt=this.trees[zt];if(!Pt)throw new Error(_t);let Ht=Pt.data;if(oe*this.stride>=Ht.length)throw new Error(_t);let ae=this.options.radius/(this.options.extent*Math.pow(2,zt-1)),he=Pt.within(Ht[oe*this.stride],Ht[oe*this.stride+1],ae),Me=[];for(let qe of he){let Ye=qe*this.stride;Ht[Ye+4]===Xt&&Me.push(Ht[Ye+G]>1?bt(Ht,Ye,this.clusterProps):this.points[Ht[Ye+q]])}if(Me.length===0)throw new Error(_t);return Me}getLeaves(Xt,oe,zt){let _t=[];return this._appendLeaves(_t,Xt,oe=oe||10,zt=zt||0,0),_t}getTile(Xt,oe,zt){let _t=this.trees[this._limitZoom(Xt)],Pt=Math.pow(2,Xt),{extent:Ht,radius:ae}=this.options,he=ae/Ht,Me=(zt-he)/Pt,qe=(zt+1+he)/Pt,Ye={features:[]};return this._addTileFeatures(_t.range((oe-he)/Pt,Me,(oe+1+he)/Pt,qe),_t.data,oe,zt,Pt,Ye),oe===0&&this._addTileFeatures(_t.range(1-he/Pt,Me,1,qe),_t.data,Pt,zt,Pt,Ye),oe===Pt-1&&this._addTileFeatures(_t.range(0,Me,he/Pt,qe),_t.data,-1,zt,Pt,Ye),Ye.features.length?Ye:null}getClusterExpansionZoom(Xt){let oe=this._getOriginZoom(Xt)-1;for(;oe<=this.options.maxZoom;){let zt=this.getChildren(Xt);if(oe++,zt.length!==1)break;Xt=zt[0].properties.cluster_id}return oe}_appendLeaves(Xt,oe,zt,_t,Pt){let Ht=this.getChildren(oe);for(let ae of Ht){let he=ae.properties;if(he&&he.cluster?Pt+he.point_count<=_t?Pt+=he.point_count:Pt=this._appendLeaves(Xt,he.cluster_id,zt,_t,Pt):Pt<_t?Pt++:Xt.push(ae),Xt.length===zt)break}return Pt}_createTree(Xt){let oe=new n.av(Xt.length/this.stride|0,this.options.nodeSize,Float32Array);for(let zt=0;zt1,qe,Ye,ur;if(Me)qe=vt(oe,he,this.clusterProps),Ye=oe[he],ur=oe[he+1];else{let xr=this.points[oe[he+q]];qe=xr.properties;let[pn,ci]=xr.geometry.coordinates;Ye=ut(pn),ur=rt(ci)}let Rr={type:1,geometry:[[Math.round(this.options.extent*(Ye*Pt-zt)),Math.round(this.options.extent*(ur*Pt-_t))]],tags:qe},zr;zr=Me||this.options.generateId?oe[he+q]:this.points[oe[he+q]].id,zr!==void 0&&(Rr.id=zr),Ht.features.push(Rr)}}_limitZoom(Xt){return Math.max(this.options.minZoom,Math.min(Math.floor(+Xt),this.options.maxZoom+1))}_cluster(Xt,oe){let{radius:zt,extent:_t,reduce:Pt,minPoints:Ht}=this.options,ae=zt/(_t*Math.pow(2,oe)),he=Xt.data,Me=[],qe=this.stride;for(let Ye=0;Yeoe&&(pn+=he[ui+G])}if(pn>xr&&pn>=Ht){let ci,ui=ur*xr,yi=Rr*xr,Gi=-1,Ci=((Ye/qe|0)<<5)+(oe+1)+this.points.length;for(let fi of zr){let ba=fi*qe;if(he[ba+2]<=oe)continue;he[ba+2]=oe;let oa=he[ba+G];ui+=he[ba]*oa,yi+=he[ba+1]*oa,he[ba+4]=Ci,Pt&&(ci||(ci=this._map(he,Ye,!0),Gi=this.clusterProps.length,this.clusterProps.push(ci)),Pt(ci,this._map(he,ba)))}he[Ye+4]=Ci,Me.push(ui/pn,yi/pn,1/0,Ci,-1,pn),Pt&&Me.push(Gi)}else{for(let ci=0;ci1)for(let ci of zr){let ui=ci*qe;if(!(he[ui+2]<=oe)){he[ui+2]=oe;for(let yi=0;yi>5}_getOriginZoom(Xt){return(Xt-this.points.length)%32}_map(Xt,oe,zt){if(Xt[oe+G]>1){let Ht=this.clusterProps[Xt[oe+tt]];return zt?Object.assign({},Ht):Ht}let _t=this.points[Xt[oe+q]].properties,Pt=this.options.map(_t);return zt&&Pt===_t?Object.assign({},Pt):Pt}}function bt(Oe,Xt,oe){return{type:"Feature",id:Oe[Xt+q],properties:vt(Oe,Xt,oe),geometry:{type:"Point",coordinates:[(zt=Oe[Xt],360*(zt-.5)),gt(Oe[Xt+1])]}};var zt}function vt(Oe,Xt,oe){let zt=Oe[Xt+G],_t=zt>=1e4?`${Math.round(zt/1e3)}k`:zt>=1e3?Math.round(zt/100)/10+"k":zt,Pt=Oe[Xt+tt],Ht=Pt===-1?{}:Object.assign({},oe[Pt]);return Object.assign(Ht,{cluster:!0,cluster_id:Oe[Xt+q],point_count:zt,point_count_abbreviated:_t})}function ut(Oe){return Oe/360+.5}function rt(Oe){let Xt=Math.sin(Oe*Math.PI/180),oe=.5-.25*Math.log((1+Xt)/(1-Xt))/Math.PI;return oe<0?0:oe>1?1:oe}function gt(Oe){let Xt=(180-360*Oe)*Math.PI/180;return 360*Math.atan(Math.exp(Xt))/Math.PI-90}function it(Oe,Xt,oe,zt){let _t=zt,Pt=Xt+(oe-Xt>>1),Ht,ae=oe-Xt,he=Oe[Xt],Me=Oe[Xt+1],qe=Oe[oe],Ye=Oe[oe+1];for(let ur=Xt+3;ur_t)Ht=ur,_t=Rr;else if(Rr===_t){let zr=Math.abs(ur-Pt);zrzt&&(Ht-Xt>3&&it(Oe,Xt,Ht,zt),Oe[Ht+2]=_t,oe-Ht>3&&it(Oe,Ht,oe,zt))}function st(Oe,Xt,oe,zt,_t,Pt){let Ht=_t-oe,ae=Pt-zt;if(Ht!==0||ae!==0){let he=((Oe-oe)*Ht+(Xt-zt)*ae)/(Ht*Ht+ae*ae);he>1?(oe=_t,zt=Pt):he>0&&(oe+=Ht*he,zt+=ae*he)}return Ht=Oe-oe,ae=Xt-zt,Ht*Ht+ae*ae}function xt(Oe,Xt,oe,zt){let _t={id:Oe??null,type:Xt,geometry:oe,tags:zt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Xt==="Point"||Xt==="MultiPoint"||Xt==="LineString")ot(_t,oe);else if(Xt==="Polygon")ot(_t,oe[0]);else if(Xt==="MultiLineString")for(let Pt of oe)ot(_t,Pt);else if(Xt==="MultiPolygon")for(let Pt of oe)ot(_t,Pt[0]);return _t}function ot(Oe,Xt){for(let oe=0;oe0&&(Ht+=zt?(_t*qe-Me*Pt)/2:Math.sqrt(Math.pow(Me-_t,2)+Math.pow(qe-Pt,2))),_t=Me,Pt=qe}let ae=Xt.length-3;Xt[2]=1,it(Xt,0,ae,oe),Xt[ae+2]=1,Xt.size=Math.abs(Ht),Xt.start=0,Xt.end=Xt.size}function Ct(Oe,Xt,oe,zt){for(let _t=0;_t1?1:oe}function Zt(Oe,Xt,oe,zt,_t,Pt,Ht,ae){if(zt/=Xt,Pt>=(oe/=Xt)&&Ht=zt)return null;let he=[];for(let Me of Oe){let qe=Me.geometry,Ye=Me.type,ur=_t===0?Me.minX:Me.minY,Rr=_t===0?Me.maxX:Me.maxY;if(ur>=oe&&Rr=zt)continue;let zr=[];if(Ye==="Point"||Ye==="MultiPoint")Gt(qe,zr,oe,zt,_t);else if(Ye==="LineString")ee(qe,zr,oe,zt,_t,!1,ae.lineMetrics);else if(Ye==="MultiLineString")ge(qe,zr,oe,zt,_t,!1);else if(Ye==="Polygon")ge(qe,zr,oe,zt,_t,!0);else if(Ye==="MultiPolygon")for(let xr of qe){let pn=[];ge(xr,pn,oe,zt,_t,!0),pn.length&&zr.push(pn)}if(zr.length){if(ae.lineMetrics&&Ye==="LineString"){for(let xr of zr)he.push(xt(Me.id,Ye,xr,Me.tags));continue}Ye!=="LineString"&&Ye!=="MultiLineString"||(zr.length===1?(Ye="LineString",zr=zr[0]):Ye="MultiLineString"),Ye!=="Point"&&Ye!=="MultiPoint"||(Ye=zr.length===3?"Point":"MultiPoint"),he.push(xt(Me.id,Ye,zr,Me.tags))}}return he.length?he:null}function Gt(Oe,Xt,oe,zt,_t){for(let Pt=0;Pt=oe&&Ht<=zt&&ye(Xt,Oe[Pt],Oe[Pt+1],Oe[Pt+2])}}function ee(Oe,Xt,oe,zt,_t,Pt,Ht){let ae=xe(Oe),he=_t===0?ue:Mt,Me,qe,Ye=Oe.start;for(let pn=0;pnoe&&(qe=he(ae,ci,ui,Gi,Ci,oe),Ht&&(ae.start=Ye+Me*qe)):fi>zt?ba=oe&&(qe=he(ae,ci,ui,Gi,Ci,oe),oa=!0),ba>zt&&fi<=zt&&(qe=he(ae,ci,ui,Gi,Ci,zt),oa=!0),!Pt&&oa&&(Ht&&(ae.end=Ye+Me*qe),Xt.push(ae),ae=xe(Oe)),Ht&&(Ye+=Me)}let ur=Oe.length-3,Rr=Oe[ur],zr=Oe[ur+1],xr=_t===0?Rr:zr;xr>=oe&&xr<=zt&&ye(ae,Rr,zr,Oe[ur+2]),ur=ae.length-3,Pt&&ur>=3&&(ae[ur]!==ae[0]||ae[ur+1]!==ae[1])&&ye(ae,ae[0],ae[1],ae[2]),ae.length&&Xt.push(ae)}function xe(Oe){let Xt=[];return Xt.size=Oe.size,Xt.start=Oe.start,Xt.end=Oe.end,Xt}function ge(Oe,Xt,oe,zt,_t,Pt){for(let Ht of Oe)ee(Ht,Xt,oe,zt,_t,Pt,!1)}function ye(Oe,Xt,oe,zt){Oe.push(Xt,oe,zt)}function ue(Oe,Xt,oe,zt,_t,Pt){let Ht=(Pt-Xt)/(zt-Xt);return ye(Oe,Pt,oe+(_t-oe)*Ht,1),Ht}function Mt(Oe,Xt,oe,zt,_t,Pt){let Ht=(Pt-oe)/(_t-oe);return ye(Oe,Xt+(zt-Xt)*Ht,Pt,1),Ht}function Ot(Oe,Xt){let oe=[];for(let zt=0;zt0&&Xt.size<(_t?Ht:zt))return void(oe.numPoints+=Xt.length/3);let ae=[];for(let he=0;heHt)&&(oe.numSimplified++,ae.push(Xt[he],Xt[he+1])),oe.numPoints++;_t&&function(he,Me){let qe=0;for(let Ye=0,ur=he.length,Rr=ur-2;Ye0===Me)for(let Ye=0,ur=he.length;Ye24)throw new Error("maxZoom should be in the 0-24 range");if(oe.promoteId&&oe.generateId)throw new Error("promoteId and generateId cannot be used together.");let _t=function(Pt,Ht){let ae=[];if(Pt.type==="FeatureCollection")for(let he=0;he1&&console.time("creation"),Rr=this.tiles[ur]=ce(Xt,oe,zt,_t,Me),this.tileCoords.push({z:oe,x:zt,y:_t}),qe)){qe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",oe,zt,_t,Rr.numFeatures,Rr.numPoints,Rr.numSimplified),console.timeEnd("creation"));let oa=`z${oe}`;this.stats[oa]=(this.stats[oa]||0)+1,this.total++}if(Rr.source=Xt,Pt==null){if(oe===Me.indexMaxZoom||Rr.numPoints<=Me.indexMaxPoints)continue}else{if(oe===Me.maxZoom||oe===Pt)continue;if(Pt!=null){let oa=Pt-oe;if(zt!==Ht>>oa||_t!==ae>>oa)continue}}if(Rr.source=null,Xt.length===0)continue;qe>1&&console.time("clipping");let zr=.5*Me.buffer/Me.extent,xr=.5-zr,pn=.5+zr,ci=1+zr,ui=null,yi=null,Gi=null,Ci=null,fi=Zt(Xt,Ye,zt-zr,zt+pn,0,Rr.minX,Rr.maxX,Me),ba=Zt(Xt,Ye,zt+xr,zt+ci,0,Rr.minX,Rr.maxX,Me);Xt=null,fi&&(ui=Zt(fi,Ye,_t-zr,_t+pn,1,Rr.minY,Rr.maxY,Me),yi=Zt(fi,Ye,_t+xr,_t+ci,1,Rr.minY,Rr.maxY,Me),fi=null),ba&&(Gi=Zt(ba,Ye,_t-zr,_t+pn,1,Rr.minY,Rr.maxY,Me),Ci=Zt(ba,Ye,_t+xr,_t+ci,1,Rr.minY,Rr.maxY,Me),ba=null),qe>1&&console.timeEnd("clipping"),he.push(ui||[],oe+1,2*zt,2*_t),he.push(yi||[],oe+1,2*zt,2*_t+1),he.push(Gi||[],oe+1,2*zt+1,2*_t),he.push(Ci||[],oe+1,2*zt+1,2*_t+1)}}getTile(Xt,oe,zt){Xt=+Xt,oe=+oe,zt=+zt;let _t=this.options,{extent:Pt,debug:Ht}=_t;if(Xt<0||Xt>24)return null;let ae=1<1&&console.log("drilling down to z%d-%d-%d",Xt,oe,zt);let Me,qe=Xt,Ye=oe,ur=zt;for(;!Me&&qe>0;)qe--,Ye>>=1,ur>>=1,Me=this.tiles[fr(qe,Ye,ur)];return Me&&Me.source?(Ht>1&&(console.log("found parent tile z%d-%d-%d",qe,Ye,ur),console.time("drilling down")),this.splitTile(Me.source,qe,Ye,ur,Xt,oe,zt),Ht>1&&console.timeEnd("drilling down"),this.tiles[he]?ie(this.tiles[he],Pt):null):null}}function fr(Oe,Xt,oe){return 32*((1<{Ye.properties=Rr;let zr={};for(let xr of ur)zr[xr]=he[xr].evaluate(qe,Ye);return zr},Ht.reduce=(Rr,zr)=>{Ye.properties=zr;for(let xr of ur)qe.accumulated=Rr[xr],Rr[xr]=Me[xr].evaluate(qe,Ye)},Ht}(Xt)).load((yield this._pendingData).features):(_t=yield this._pendingData,new mr(_t,Xt.geojsonVtOptions)),this.loaded={};let Pt={};if(zt){let Ht=zt.finish();Ht&&(Pt.resourceTiming={},Pt.resourceTiming[Xt.source]=JSON.parse(JSON.stringify(Ht)))}return Pt}catch(Pt){if(delete this._pendingRequest,n.bB(Pt))return{abandoned:!0};throw Pt}var _t})}getData(){return n._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Xt){let oe=this.loaded;return oe&&oe[Xt.uid]?super.reloadTile(Xt):this.loadTile(Xt)}loadAndProcessGeoJSON(Xt,oe){return n._(this,void 0,void 0,function*(){let zt=yield this.loadGeoJSON(Xt,oe);if(delete this._pendingRequest,typeof zt!="object")throw new Error(`Input data given to '${Xt.source}' is not a valid GeoJSON object.`);if(b(zt,!0),Xt.filter){let _t=n.bC(Xt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(_t.result==="error")throw new Error(_t.value.map(Pt=>`${Pt.key}: ${Pt.message}`).join(", "));zt={type:"FeatureCollection",features:zt.features.filter(Pt=>_t.value.evaluate({zoom:0},Pt))}}return zt})}loadGeoJSON(Xt,oe){return n._(this,void 0,void 0,function*(){let{promoteId:zt}=Xt;if(Xt.request){let _t=yield n.h(Xt.request,oe);return this._dataUpdateable=an(_t.data,zt)?Er(_t.data,zt):void 0,_t.data}if(typeof Xt.data=="string")try{let _t=JSON.parse(Xt.data);return this._dataUpdateable=an(_t,zt)?Er(_t,zt):void 0,_t}catch{throw new Error(`Input data given to '${Xt.source}' is not a valid GeoJSON object.`)}if(!Xt.dataDiff)throw new Error(`Input data given to '${Xt.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Xt.source}`);return function(_t,Pt,Ht){var ae,he,Me,qe;if(Pt.removeAll&&_t.clear(),Pt.remove)for(let Ye of Pt.remove)_t.delete(Ye);if(Pt.add)for(let Ye of Pt.add){let ur=Jr(Ye,Ht);ur!=null&&_t.set(ur,Ye)}if(Pt.update)for(let Ye of Pt.update){let ur=_t.get(Ye.id);if(ur==null)continue;let Rr=!Ye.removeAllProperties&&(((ae=Ye.removeProperties)===null||ae===void 0?void 0:ae.length)>0||((he=Ye.addOrUpdateProperties)===null||he===void 0?void 0:he.length)>0);if((Ye.newGeometry||Ye.removeAllProperties||Rr)&&(ur=Object.assign({},ur),_t.set(Ye.id,ur),Rr&&(ur.properties=Object.assign({},ur.properties))),Ye.newGeometry&&(ur.geometry=Ye.newGeometry),Ye.removeAllProperties)ur.properties={};else if(((Me=Ye.removeProperties)===null||Me===void 0?void 0:Me.length)>0)for(let zr of Ye.removeProperties)Object.prototype.hasOwnProperty.call(ur.properties,zr)&&delete ur.properties[zr];if(((qe=Ye.addOrUpdateProperties)===null||qe===void 0?void 0:qe.length)>0)for(let{key:zr,value:xr}of Ye.addOrUpdateProperties)ur.properties[zr]=xr}}(this._dataUpdateable,Xt.dataDiff,zt),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Xt){return n._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Xt){return this._geoJSONIndex.getClusterExpansionZoom(Xt.clusterId)}getClusterChildren(Xt){return this._geoJSONIndex.getChildren(Xt.clusterId)}getClusterLeaves(Xt){return this._geoJSONIndex.getLeaves(Xt.clusterId,Xt.limit,Xt.offset)}}class _n{constructor(Xt){this.self=Xt,this.actor=new n.F(Xt),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(oe,zt)=>{if(this.externalWorkerSourceTypes[oe])throw new Error(`Worker source with name "${oe}" already registered.`);this.externalWorkerSourceTypes[oe]=zt},this.self.addProtocol=n.bi,this.self.removeProtocol=n.bj,this.self.registerRTLTextPlugin=oe=>{if(n.bD.isParsed())throw new Error("RTL text plugin already registered.");n.bD.setMethods(oe)},this.actor.registerMessageHandler("LDT",(oe,zt)=>this._getDEMWorkerSource(oe,zt.source).loadTile(zt)),this.actor.registerMessageHandler("RDT",(oe,zt)=>n._(this,void 0,void 0,function*(){this._getDEMWorkerSource(oe,zt.source).removeTile(zt)})),this.actor.registerMessageHandler("GCEZ",(oe,zt)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(oe,zt.type,zt.source).getClusterExpansionZoom(zt)})),this.actor.registerMessageHandler("GCC",(oe,zt)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(oe,zt.type,zt.source).getClusterChildren(zt)})),this.actor.registerMessageHandler("GCL",(oe,zt)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(oe,zt.type,zt.source).getClusterLeaves(zt)})),this.actor.registerMessageHandler("LD",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).loadData(zt)),this.actor.registerMessageHandler("GD",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).getData()),this.actor.registerMessageHandler("LT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).loadTile(zt)),this.actor.registerMessageHandler("RT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).reloadTile(zt)),this.actor.registerMessageHandler("AT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).abortTile(zt)),this.actor.registerMessageHandler("RMT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).removeTile(zt)),this.actor.registerMessageHandler("RS",(oe,zt)=>n._(this,void 0,void 0,function*(){if(!this.workerSources[oe]||!this.workerSources[oe][zt.type]||!this.workerSources[oe][zt.type][zt.source])return;let _t=this.workerSources[oe][zt.type][zt.source];delete this.workerSources[oe][zt.type][zt.source],_t.removeSource!==void 0&&_t.removeSource(zt)})),this.actor.registerMessageHandler("RM",oe=>n._(this,void 0,void 0,function*(){delete this.layerIndexes[oe],delete this.availableImages[oe],delete this.workerSources[oe],delete this.demWorkerSources[oe]})),this.actor.registerMessageHandler("SR",(oe,zt)=>n._(this,void 0,void 0,function*(){this.referrer=zt})),this.actor.registerMessageHandler("SRPS",(oe,zt)=>this._syncRTLPluginState(oe,zt)),this.actor.registerMessageHandler("IS",(oe,zt)=>n._(this,void 0,void 0,function*(){this.self.importScripts(zt)})),this.actor.registerMessageHandler("SI",(oe,zt)=>this._setImages(oe,zt)),this.actor.registerMessageHandler("UL",(oe,zt)=>n._(this,void 0,void 0,function*(){this._getLayerIndex(oe).update(zt.layers,zt.removedIds)})),this.actor.registerMessageHandler("SL",(oe,zt)=>n._(this,void 0,void 0,function*(){this._getLayerIndex(oe).replace(zt)}))}_setImages(Xt,oe){return n._(this,void 0,void 0,function*(){this.availableImages[Xt]=oe;for(let zt in this.workerSources[Xt]){let _t=this.workerSources[Xt][zt];for(let Pt in _t)_t[Pt].availableImages=oe}})}_syncRTLPluginState(Xt,oe){return n._(this,void 0,void 0,function*(){if(n.bD.isParsed())return n.bD.getState();if(oe.pluginStatus!=="loading")return n.bD.setState(oe),oe;let zt=oe.pluginURL;if(this.self.importScripts(zt),n.bD.isParsed()){let _t={pluginStatus:"loaded",pluginURL:zt};return n.bD.setState(_t),_t}throw n.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${zt}`)})}_getAvailableImages(Xt){let oe=this.availableImages[Xt];return oe||(oe=[]),oe}_getLayerIndex(Xt){let oe=this.layerIndexes[Xt];return oe||(oe=this.layerIndexes[Xt]=new i),oe}_getWorkerSource(Xt,oe,zt){if(this.workerSources[Xt]||(this.workerSources[Xt]={}),this.workerSources[Xt][oe]||(this.workerSources[Xt][oe]={}),!this.workerSources[Xt][oe][zt]){let _t={sendAsync:(Pt,Ht)=>(Pt.targetMapId=Xt,this.actor.sendAsync(Pt,Ht))};switch(oe){case"vector":this.workerSources[Xt][oe][zt]=new c(_t,this._getLayerIndex(Xt),this._getAvailableImages(Xt));break;case"geojson":this.workerSources[Xt][oe][zt]=new dn(_t,this._getLayerIndex(Xt),this._getAvailableImages(Xt));break;default:this.workerSources[Xt][oe][zt]=new this.externalWorkerSourceTypes[oe](_t,this._getLayerIndex(Xt),this._getAvailableImages(Xt))}}return this.workerSources[Xt][oe][zt]}_getDEMWorkerSource(Xt,oe){return this.demWorkerSources[Xt]||(this.demWorkerSources[Xt]={}),this.demWorkerSources[Xt][oe]||(this.demWorkerSources[Xt][oe]=new s),this.demWorkerSources[Xt][oe]}}return n.i(self)&&(self.worker=new _n(self)),_n}),z("index",["exports","./shared"],function(n,i){var a="4.7.1";let l,o,c={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Kt=>new Promise((O,pt)=>{let Dt=requestAnimationFrame(O);Kt.signal.addEventListener("abort",()=>{cancelAnimationFrame(Dt),pt(i.c())})}),getImageData(Kt,O=0){return this.getImageCanvasContext(Kt).getImageData(-O,-O,Kt.width+2*O,Kt.height+2*O)},getImageCanvasContext(Kt){let O=window.document.createElement("canvas"),pt=O.getContext("2d",{willReadFrequently:!0});if(!pt)throw new Error("failed to create canvas 2d context");return O.width=Kt.width,O.height=Kt.height,pt.drawImage(Kt,0,0,Kt.width,Kt.height),pt},resolveURL:Kt=>(l||(l=document.createElement("a")),l.href=Kt,l.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(o==null&&(o=matchMedia("(prefers-reduced-motion: reduce)")),o.matches)}};class s{static testProp(O){if(!s.docStyle)return O[0];for(let pt=0;pt{window.removeEventListener("click",s.suppressClickInternal,!0)},0)}static getScale(O){let pt=O.getBoundingClientRect();return{x:pt.width/O.offsetWidth||1,y:pt.height/O.offsetHeight||1,boundingClientRect:pt}}static getPoint(O,pt,Dt){let Ft=pt.boundingClientRect;return new i.P((Dt.clientX-Ft.left)/pt.x-O.clientLeft,(Dt.clientY-Ft.top)/pt.y-O.clientTop)}static mousePos(O,pt){let Dt=s.getScale(O);return s.getPoint(O,Dt,pt)}static touchPos(O,pt){let Dt=[],Ft=s.getScale(O);for(let qt=0;qt{m&&A(m),m=null,_=!0},b.onerror=()=>{x=!0,m=null},b.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Kt){let O,pt,Dt,Ft;Kt.resetRequestQueue=()=>{O=[],pt=0,Dt=0,Ft={}},Kt.addThrottleControl=er=>{let wr=Dt++;return Ft[wr]=er,wr},Kt.removeThrottleControl=er=>{delete Ft[er],Ee()},Kt.getImage=(er,wr,Gr=!0)=>new Promise((Zr,Tn)=>{h.supported&&(er.headers||(er.headers={}),er.headers.accept="image/webp,*/*"),i.e(er,{type:"image"}),O.push({abortController:wr,requestParameters:er,supportImageRefresh:Gr,state:"queued",onError:qn=>{Tn(qn)},onSuccess:qn=>{Zr(qn)}}),Ee()});let qt=er=>i._(this,void 0,void 0,function*(){er.state="running";let{requestParameters:wr,supportImageRefresh:Gr,onError:Zr,onSuccess:Tn,abortController:qn}=er,te=Gr===!1&&!i.i(self)&&!i.g(wr.url)&&(!wr.headers||Object.keys(wr.headers).reduce((Pe,We)=>Pe&&We==="accept",!0));pt++;let le=te?je(wr,qn):i.m(wr,qn);try{let Pe=yield le;delete er.abortController,er.state="completed",Pe.data instanceof HTMLImageElement||i.b(Pe.data)?Tn(Pe):Pe.data&&Tn({data:yield(Te=Pe.data,typeof createImageBitmap=="function"?i.d(Te):i.f(Te)),cacheControl:Pe.cacheControl,expires:Pe.expires})}catch(Pe){delete er.abortController,Zr(Pe)}finally{pt--,Ee()}var Te}),Ee=()=>{let er=(()=>{for(let wr of Object.keys(Ft))if(Ft[wr]())return!0;return!1})()?i.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:i.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let wr=pt;wr0;wr++){let Gr=O.shift();Gr.abortController.signal.aborted?wr--:qt(Gr)}},je=(er,wr)=>new Promise((Gr,Zr)=>{let Tn=new Image,qn=er.url,te=er.credentials;te&&te==="include"?Tn.crossOrigin="use-credentials":(te&&te==="same-origin"||!i.s(qn))&&(Tn.crossOrigin="anonymous"),wr.signal.addEventListener("abort",()=>{Tn.src="",Zr(i.c())}),Tn.fetchPriority="high",Tn.onload=()=>{Tn.onerror=Tn.onload=null,Gr({data:Tn})},Tn.onerror=()=>{Tn.onerror=Tn.onload=null,wr.signal.aborted||Zr(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."))},Tn.src=qn})}(d||(d={})),d.resetRequestQueue();class k{constructor(O){this._transformRequestFn=O}transformRequest(O,pt){return this._transformRequestFn&&this._transformRequestFn(O,pt)||{url:O}}setTransformRequest(O){this._transformRequestFn=O}}function w(Kt){var O=new i.A(3);return O[0]=Kt[0],O[1]=Kt[1],O[2]=Kt[2],O}var D,E=function(Kt,O,pt){return Kt[0]=O[0]-pt[0],Kt[1]=O[1]-pt[1],Kt[2]=O[2]-pt[2],Kt};D=new i.A(3),i.A!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0);var I=function(Kt){var O=Kt[0],pt=Kt[1];return O*O+pt*pt};function M(Kt){let O=[];if(typeof Kt=="string")O.push({id:"default",url:Kt});else if(Kt&&Kt.length>0){let pt=[];for(let{id:Dt,url:Ft}of Kt){let qt=`${Dt}${Ft}`;pt.indexOf(qt)===-1&&(pt.push(qt),O.push({id:Dt,url:Ft}))}}return O}function p(Kt,O,pt){let Dt=Kt.split("?");return Dt[0]+=`${O}${pt}`,Dt.join("?")}(function(){var Kt=new i.A(2);i.A!=Float32Array&&(Kt[0]=0,Kt[1]=0)})();class g{constructor(O,pt,Dt,Ft){this.context=O,this.format=Dt,this.texture=O.gl.createTexture(),this.update(pt,Ft)}update(O,pt,Dt){let{width:Ft,height:qt}=O,Ee=!(this.size&&this.size[0]===Ft&&this.size[1]===qt||Dt),{context:je}=this,{gl:er}=je;if(this.useMipmap=!!(pt&&pt.useMipmap),er.bindTexture(er.TEXTURE_2D,this.texture),je.pixelStoreUnpackFlipY.set(!1),je.pixelStoreUnpack.set(1),je.pixelStoreUnpackPremultiplyAlpha.set(this.format===er.RGBA&&(!pt||pt.premultiply!==!1)),Ee)this.size=[Ft,qt],O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||i.b(O)?er.texImage2D(er.TEXTURE_2D,0,this.format,this.format,er.UNSIGNED_BYTE,O):er.texImage2D(er.TEXTURE_2D,0,this.format,Ft,qt,0,this.format,er.UNSIGNED_BYTE,O.data);else{let{x:wr,y:Gr}=Dt||{x:0,y:0};O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||i.b(O)?er.texSubImage2D(er.TEXTURE_2D,0,wr,Gr,er.RGBA,er.UNSIGNED_BYTE,O):er.texSubImage2D(er.TEXTURE_2D,0,wr,Gr,Ft,qt,er.RGBA,er.UNSIGNED_BYTE,O.data)}this.useMipmap&&this.isSizePowerOfTwo()&&er.generateMipmap(er.TEXTURE_2D)}bind(O,pt,Dt){let{context:Ft}=this,{gl:qt}=Ft;qt.bindTexture(qt.TEXTURE_2D,this.texture),Dt!==qt.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Dt=qt.LINEAR),O!==this.filter&&(qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MAG_FILTER,O),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,Dt||O),this.filter=O),pt!==this.wrap&&(qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,pt),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,pt),this.wrap=pt)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:O}=this.context;O.deleteTexture(this.texture),this.texture=null}}function C(Kt){let{userImage:O}=Kt;return!!(O&&O.render&&O.render())&&(Kt.data.replace(new Uint8Array(O.data.buffer)),!0)}class S extends i.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(O){if(this.loaded!==O&&(this.loaded=O,O)){for(let{ids:pt,promiseResolve:Dt}of this.requestors)Dt(this._getImagesForIds(pt));this.requestors=[]}}getImage(O){let pt=this.images[O];if(pt&&!pt.data&&pt.spriteData){let Dt=pt.spriteData;pt.data=new i.R({width:Dt.width,height:Dt.height},Dt.context.getImageData(Dt.x,Dt.y,Dt.width,Dt.height).data),pt.spriteData=null}return pt}addImage(O,pt){if(this.images[O])throw new Error(`Image id ${O} already exist, use updateImage instead`);this._validate(O,pt)&&(this.images[O]=pt)}_validate(O,pt){let Dt=!0,Ft=pt.data||pt.spriteData;return this._validateStretch(pt.stretchX,Ft&&Ft.width)||(this.fire(new i.j(new Error(`Image "${O}" has invalid "stretchX" value`))),Dt=!1),this._validateStretch(pt.stretchY,Ft&&Ft.height)||(this.fire(new i.j(new Error(`Image "${O}" has invalid "stretchY" value`))),Dt=!1),this._validateContent(pt.content,pt)||(this.fire(new i.j(new Error(`Image "${O}" has invalid "content" value`))),Dt=!1),Dt}_validateStretch(O,pt){if(!O)return!0;let Dt=0;for(let Ft of O){if(Ft[0]{let Ft=!0;if(!this.isLoaded())for(let qt of O)this.images[qt]||(Ft=!1);this.isLoaded()||Ft?pt(this._getImagesForIds(O)):this.requestors.push({ids:O,promiseResolve:pt})})}_getImagesForIds(O){let pt={};for(let Dt of O){let Ft=this.getImage(Dt);Ft||(this.fire(new i.k("styleimagemissing",{id:Dt})),Ft=this.getImage(Dt)),Ft?pt[Dt]={data:Ft.data.clone(),pixelRatio:Ft.pixelRatio,sdf:Ft.sdf,version:Ft.version,stretchX:Ft.stretchX,stretchY:Ft.stretchY,content:Ft.content,textFitWidth:Ft.textFitWidth,textFitHeight:Ft.textFitHeight,hasRenderCallback:!!(Ft.userImage&&Ft.userImage.render)}:i.w(`Image "${Dt}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return pt}getPixelSize(){let{width:O,height:pt}=this.atlasImage;return{width:O,height:pt}}getPattern(O){let pt=this.patterns[O],Dt=this.getImage(O);if(!Dt)return null;if(pt&&pt.position.version===Dt.version)return pt.position;if(pt)pt.position.version=Dt.version;else{let Ft={w:Dt.data.width+2,h:Dt.data.height+2,x:0,y:0},qt=new i.I(Ft,Dt);this.patterns[O]={bin:Ft,position:qt}}return this._updatePatternAtlas(),this.patterns[O].position}bind(O){let pt=O.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new g(O,this.atlasImage,pt.RGBA),this.atlasTexture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE)}_updatePatternAtlas(){let O=[];for(let qt in this.patterns)O.push(this.patterns[qt].bin);let{w:pt,h:Dt}=i.p(O),Ft=this.atlasImage;Ft.resize({width:pt||1,height:Dt||1});for(let qt in this.patterns){let{bin:Ee}=this.patterns[qt],je=Ee.x+1,er=Ee.y+1,wr=this.getImage(qt).data,Gr=wr.width,Zr=wr.height;i.R.copy(wr,Ft,{x:0,y:0},{x:je,y:er},{width:Gr,height:Zr}),i.R.copy(wr,Ft,{x:0,y:Zr-1},{x:je,y:er-1},{width:Gr,height:1}),i.R.copy(wr,Ft,{x:0,y:0},{x:je,y:er+Zr},{width:Gr,height:1}),i.R.copy(wr,Ft,{x:Gr-1,y:0},{x:je-1,y:er},{width:1,height:Zr}),i.R.copy(wr,Ft,{x:0,y:0},{x:je+Gr,y:er},{width:1,height:Zr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(O){for(let pt of O){if(this.callbackDispatchedThisFrame[pt])continue;this.callbackDispatchedThisFrame[pt]=!0;let Dt=this.getImage(pt);Dt||i.w(`Image with ID: "${pt}" was not found`),C(Dt)&&this.updateImage(pt,Dt)}}}let N=1e20;function B(Kt,O,pt,Dt,Ft,qt,Ee,je,er){for(let wr=O;wr-1);er++,qt[er]=je,Ee[er]=wr,Ee[er+1]=N}for(let je=0,er=0;je65535)throw new Error("glyphs > 65535 not supported");if(Dt.ranges[qt])return{stack:O,id:pt,glyph:Ft};if(!this.url)throw new Error("glyphsUrl is not set");if(!Dt.requests[qt]){let je=V.loadGlyphRange(O,qt,this.url,this.requestManager);Dt.requests[qt]=je}let Ee=yield Dt.requests[qt];for(let je in Ee)this._doesCharSupportLocalGlyph(+je)||(Dt.glyphs[+je]=Ee[+je]);return Dt.ranges[qt]=!0,{stack:O,id:pt,glyph:Ee[pt]||null}})}_doesCharSupportLocalGlyph(O){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(O))}_tinySDF(O,pt,Dt){let Ft=this.localIdeographFontFamily;if(!Ft||!this._doesCharSupportLocalGlyph(Dt))return;let qt=O.tinySDF;if(!qt){let je="400";/bold/i.test(pt)?je="900":/medium/i.test(pt)?je="500":/light/i.test(pt)&&(je="200"),qt=O.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Ft,fontWeight:je})}let Ee=qt.draw(String.fromCharCode(Dt));return{id:Dt,bitmap:new i.o({width:Ee.width||60,height:Ee.height||60},Ee.data),metrics:{width:Ee.glyphWidth/2||24,height:Ee.glyphHeight/2||24,left:Ee.glyphLeft/2+.5||0,top:Ee.glyphTop/2-27.5||-8,advance:Ee.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(Kt,O,pt,Dt){return i._(this,void 0,void 0,function*(){let Ft=256*O,qt=Ft+255,Ee=Dt.transformRequest(pt.replace("{fontstack}",Kt).replace("{range}",`${Ft}-${qt}`),"Glyphs"),je=yield i.l(Ee,new AbortController);if(!je||!je.data)throw new Error(`Could not load glyph range. range: ${O}, ${Ft}-${qt}`);let er={};for(let wr of i.n(je.data))er[wr.id]=wr;return er})},V.TinySDF=class{constructor({fontSize:Kt=24,buffer:O=3,radius:pt=8,cutoff:Dt=.25,fontFamily:Ft="sans-serif",fontWeight:qt="normal",fontStyle:Ee="normal"}={}){this.buffer=O,this.cutoff=Dt,this.radius=pt;let je=this.size=Kt+4*O,er=this._createCanvas(je),wr=this.ctx=er.getContext("2d",{willReadFrequently:!0});wr.font=`${Ee} ${qt} ${Kt}px ${Ft}`,wr.textBaseline="alphabetic",wr.textAlign="left",wr.fillStyle="black",this.gridOuter=new Float64Array(je*je),this.gridInner=new Float64Array(je*je),this.f=new Float64Array(je),this.z=new Float64Array(je+1),this.v=new Uint16Array(je)}_createCanvas(Kt){let O=document.createElement("canvas");return O.width=O.height=Kt,O}draw(Kt){let{width:O,actualBoundingBoxAscent:pt,actualBoundingBoxDescent:Dt,actualBoundingBoxLeft:Ft,actualBoundingBoxRight:qt}=this.ctx.measureText(Kt),Ee=Math.ceil(pt),je=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(qt-Ft))),er=Math.min(this.size-this.buffer,Ee+Math.ceil(Dt)),wr=je+2*this.buffer,Gr=er+2*this.buffer,Zr=Math.max(wr*Gr,0),Tn=new Uint8ClampedArray(Zr),qn={data:Tn,width:wr,height:Gr,glyphWidth:je,glyphHeight:er,glyphTop:Ee,glyphLeft:0,glyphAdvance:O};if(je===0||er===0)return qn;let{ctx:te,buffer:le,gridInner:Te,gridOuter:Pe}=this;te.clearRect(le,le,je,er),te.fillText(Kt,le,le+Ee);let We=te.getImageData(le,le,je,er);Pe.fill(N,0,Zr),Te.fill(0,0,Zr);for(let Ne=0;Ne0?Xr*Xr:0,Te[qr]=Xr<0?Xr*Xr:0}}B(Pe,0,0,wr,Gr,wr,this.f,this.v,this.z),B(Te,le,le,je,er,wr,this.f,this.v,this.z);for(let Ne=0;Ne1&&(er=O[++je]);let Gr=Math.abs(wr-er.left),Zr=Math.abs(wr-er.right),Tn=Math.min(Gr,Zr),qn,te=qt/Dt*(Ft+1);if(er.isDash){let le=Ft-Math.abs(te);qn=Math.sqrt(Tn*Tn+le*le)}else qn=Ft-Math.sqrt(Tn*Tn+te*te);this.data[Ee+wr]=Math.max(0,Math.min(255,qn+128))}}}addRegularDash(O){for(let je=O.length-1;je>=0;--je){let er=O[je],wr=O[je+1];er.zeroLength?O.splice(je,1):wr&&wr.isDash===er.isDash&&(wr.left=er.left,O.splice(je,1))}let pt=O[0],Dt=O[O.length-1];pt.isDash===Dt.isDash&&(pt.left=Dt.left-this.width,Dt.right=pt.right+this.width);let Ft=this.width*this.nextRow,qt=0,Ee=O[qt];for(let je=0;je1&&(Ee=O[++qt]);let er=Math.abs(je-Ee.left),wr=Math.abs(je-Ee.right),Gr=Math.min(er,wr);this.data[Ft+je]=Math.max(0,Math.min(255,(Ee.isDash?Gr:-Gr)+128))}}addDash(O,pt){let Dt=pt?7:0,Ft=2*Dt+1;if(this.nextRow+Ft>this.height)return i.w("LineAtlas out of space"),null;let qt=0;for(let je=0;je{pt.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ht]}numActive(){return Object.keys(this.active).length}}let vt=Math.floor(c.hardwareConcurrency/2),ut,rt;function gt(){return ut||(ut=new bt),ut}bt.workerCount=i.C(globalThis)?Math.max(Math.min(vt,3),1):1;class it{constructor(O,pt){this.workerPool=O,this.actors=[],this.currentActor=0,this.id=pt;let Dt=this.workerPool.acquire(pt);for(let Ft=0;Ft{pt.remove()}),this.actors=[],O&&this.workerPool.release(this.id)}registerMessageHandler(O,pt){for(let Dt of this.actors)Dt.registerMessageHandler(O,pt)}}function st(){return rt||(rt=new it(gt(),i.G),rt.registerMessageHandler("GR",(Kt,O,pt)=>i.m(O,pt))),rt}function xt(Kt,O){let pt=i.H();return i.J(pt,pt,[1,1,0]),i.K(pt,pt,[.5*Kt.width,.5*Kt.height,1]),i.L(pt,pt,Kt.calculatePosMatrix(O.toUnwrapped()))}function ot(Kt,O,pt,Dt,Ft,qt){let Ee=function(Zr,Tn,qn){if(Zr)for(let te of Zr){let le=Tn[te];if(le&&le.source===qn&&le.type==="fill-extrusion")return!0}else for(let te in Tn){let le=Tn[te];if(le.source===qn&&le.type==="fill-extrusion")return!0}return!1}(Ft&&Ft.layers,O,Kt.id),je=qt.maxPitchScaleFactor(),er=Kt.tilesIn(Dt,je,Ee);er.sort(J);let wr=[];for(let Zr of er)wr.push({wrappedTileID:Zr.tileID.wrapped().key,queryResults:Zr.tile.queryRenderedFeatures(O,pt,Kt._state,Zr.queryGeometry,Zr.cameraQueryGeometry,Zr.scale,Ft,qt,je,xt(Kt.transform,Zr.tileID))});let Gr=function(Zr){let Tn={},qn={};for(let te of Zr){let le=te.queryResults,Te=te.wrappedTileID,Pe=qn[Te]=qn[Te]||{};for(let We in le){let Ne=le[We],Xe=Pe[We]=Pe[We]||{},Pr=Tn[We]=Tn[We]||[];for(let qr of Ne)Xe[qr.featureIndex]||(Xe[qr.featureIndex]=!0,Pr.push(qr))}}return Tn}(wr);for(let Zr in Gr)Gr[Zr].forEach(Tn=>{let qn=Tn.feature,te=Kt.getFeatureState(qn.layer["source-layer"],qn.id);qn.source=qn.layer.source,qn.layer["source-layer"]&&(qn.sourceLayer=qn.layer["source-layer"]),qn.state=te});return Gr}function J(Kt,O){let pt=Kt.tileID,Dt=O.tileID;return pt.overscaledZ-Dt.overscaledZ||pt.canonical.y-Dt.canonical.y||pt.wrap-Dt.wrap||pt.canonical.x-Dt.canonical.x}function mt(Kt,O,pt){return i._(this,void 0,void 0,function*(){let Dt=Kt;if(Kt.url?Dt=(yield i.h(O.transformRequest(Kt.url,"Source"),pt)).data:yield c.frameAsync(pt),!Dt)return null;let Ft=i.M(i.e(Dt,Kt),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Dt&&Dt.vector_layers&&(Ft.vectorLayerIds=Dt.vector_layers.map(qt=>qt.id)),Ft})}class dt{constructor(O,pt){O&&(pt?this.setSouthWest(O).setNorthEast(pt):Array.isArray(O)&&(O.length===4?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 i.N?new i.N(O.lng,O.lat):i.N.convert(O),this}setSouthWest(O){return this._sw=O instanceof i.N?new i.N(O.lng,O.lat):i.N.convert(O),this}extend(O){let pt=this._sw,Dt=this._ne,Ft,qt;if(O instanceof i.N)Ft=O,qt=O;else{if(!(O instanceof dt))return Array.isArray(O)?O.length===4||O.every(Array.isArray)?this.extend(dt.convert(O)):this.extend(i.N.convert(O)):O&&("lng"in O||"lon"in O)&&"lat"in O?this.extend(i.N.convert(O)):this;if(Ft=O._sw,qt=O._ne,!Ft||!qt)return this}return pt||Dt?(pt.lng=Math.min(Ft.lng,pt.lng),pt.lat=Math.min(Ft.lat,pt.lat),Dt.lng=Math.max(qt.lng,Dt.lng),Dt.lat=Math.max(qt.lat,Dt.lat)):(this._sw=new i.N(Ft.lng,Ft.lat),this._ne=new i.N(qt.lng,qt.lat)),this}getCenter(){return new i.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new i.N(this.getWest(),this.getNorth())}getSouthEast(){return new i.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(O){let{lng:pt,lat:Dt}=i.N.convert(O),Ft=this._sw.lng<=pt&&pt<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ft=this._sw.lng>=pt&&pt>=this._ne.lng),this._sw.lat<=Dt&&Dt<=this._ne.lat&&Ft}static convert(O){return O instanceof dt?O:O&&new dt(O)}static fromLngLat(O,pt=0){let Dt=360*pt/40075017,Ft=Dt/Math.cos(Math.PI/180*O.lat);return new dt(new i.N(O.lng-Ft,O.lat-Dt),new i.N(O.lng+Ft,O.lat+Dt))}adjustAntiMeridian(){let O=new i.N(this._sw.lng,this._sw.lat),pt=new i.N(this._ne.lng,this._ne.lat);return new dt(O,O.lng>pt.lng?new i.N(pt.lng+360,pt.lat):pt)}}class Ct{constructor(O,pt,Dt){this.bounds=dt.convert(this.validateBounds(O)),this.minzoom=pt||0,this.maxzoom=Dt||24}validateBounds(O){return Array.isArray(O)&&O.length===4?[Math.max(-180,O[0]),Math.max(-90,O[1]),Math.min(180,O[2]),Math.min(90,O[3])]:[-180,-90,180,90]}contains(O){let pt=Math.pow(2,O.z),Dt=Math.floor(i.O(this.bounds.getWest())*pt),Ft=Math.floor(i.Q(this.bounds.getNorth())*pt),qt=Math.ceil(i.O(this.bounds.getEast())*pt),Ee=Math.ceil(i.Q(this.bounds.getSouth())*pt);return O.x>=Dt&&O.x=Ft&&O.y{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return i.e({},this._options)}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Dt={request:this.map._requestManager.transformRequest(pt,"Tile"),uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,tileSize:this.tileSize*O.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Dt.request.collectResourceTiming=this._collectResourceTiming;let Ft="RT";if(O.actor&&O.state!=="expired"){if(O.state==="loading")return new Promise((qt,Ee)=>{O.reloadPromise={resolve:qt,reject:Ee}})}else O.actor=this.dispatcher.getActor(),Ft="LT";O.abortController=new AbortController;try{let qt=yield O.actor.sendAsync({type:Ft,data:Dt},O.abortController);if(delete O.abortController,O.aborted)return;this._afterTileLoadWorkerResponse(O,qt)}catch(qt){if(delete O.abortController,O.aborted)return;if(qt&&qt.status!==404)throw qt;this._afterTileLoadWorkerResponse(O,null)}})}_afterTileLoadWorkerResponse(O,pt){if(pt&&pt.resourceTiming&&(O.resourceTiming=pt.resourceTiming),pt&&this.map._refreshExpiredTiles&&O.setExpiryData(pt),O.loadVectorData(pt,this.map.painter),O.reloadPromise){let Dt=O.reloadPromise;O.reloadPromise=null,this.loadTile(O).then(Dt.resolve).catch(Dt.reject)}}abortTile(O){return i._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.actor&&(yield O.actor.sendAsync({type:"AT",data:{uid:O.uid,type:this.type,source:this.id}}))})}unloadTile(O){return i._(this,void 0,void 0,function*(){O.unloadVectorData(),O.actor&&(yield O.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Bt extends i.E{constructor(O,pt,Dt,Ft){super(),this.id=O,this.dispatcher=Dt,this.setEventedParent(Ft),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=i.e({type:"raster"},pt),i.e(this,i.M(pt,["url","scheme","tileSize"]))}load(){return i._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new i.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let O=yield mt(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,O&&(i.e(this,O),O.bounds&&(this.tileBounds=new Ct(O.bounds,this.minzoom,this.maxzoom)),this.fire(new i.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new i.k("data",{dataType:"source",sourceDataType:"content"})))}catch(O){this._tileJSONRequest=null,this.fire(new i.j(O))}})}loaded(){return this._loaded}onAdd(O){this.map=O,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(O){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),O(),this.load()}setTiles(O){return this.setSourceProperty(()=>{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}serialize(){return i.e({},this._options)}hasTile(O){return!this.tileBounds||this.tileBounds.contains(O.canonical)}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);O.abortController=new AbortController;try{let Dt=yield d.getImage(this.map._requestManager.transformRequest(pt,"Tile"),O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Dt&&Dt.data){this.map._refreshExpiredTiles&&Dt.cacheControl&&Dt.expires&&O.setExpiryData({cacheControl:Dt.cacheControl,expires:Dt.expires});let Ft=this.map.painter.context,qt=Ft.gl,Ee=Dt.data;O.texture=this.map.painter.getTileTexture(Ee.width),O.texture?O.texture.update(Ee,{useMipmap:!0}):(O.texture=new g(Ft,Ee,qt.RGBA,{useMipmap:!0}),O.texture.bind(qt.LINEAR,qt.CLAMP_TO_EDGE,qt.LINEAR_MIPMAP_NEAREST)),O.state="loaded"}}catch(Dt){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Dt)throw O.state="errored",Dt}})}abortTile(O){return i._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController)})}unloadTile(O){return i._(this,void 0,void 0,function*(){O.texture&&this.map.painter.saveTileTexture(O.texture)})}hasTransition(){return!1}}class Zt extends Bt{constructor(O,pt,Dt,Ft){super(O,pt,Dt,Ft),this.type="raster-dem",this.maxzoom=22,this._options=i.e({type:"raster-dem"},pt),this.encoding=pt.encoding||"mapbox",this.redFactor=pt.redFactor,this.greenFactor=pt.greenFactor,this.blueFactor=pt.blueFactor,this.baseShift=pt.baseShift}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Dt=this.map._requestManager.transformRequest(pt,"Tile");O.neighboringTiles=this._getNeighboringTiles(O.tileID),O.abortController=new AbortController;try{let Ft=yield d.getImage(Dt,O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Ft&&Ft.data){let qt=Ft.data;this.map._refreshExpiredTiles&&Ft.cacheControl&&Ft.expires&&O.setExpiryData({cacheControl:Ft.cacheControl,expires:Ft.expires});let Ee=i.b(qt)&&i.U()?qt:yield this.readImageNow(qt),je={type:this.type,uid:O.uid,source:this.id,rawImageData:Ee,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!O.actor||O.state==="expired"){O.actor=this.dispatcher.getActor();let er=yield O.actor.sendAsync({type:"LDT",data:je});O.dem=er,O.needsHillshadePrepare=!0,O.needsTerrainPrepare=!0,O.state="loaded"}}}catch(Ft){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Ft)throw O.state="errored",Ft}})}readImageNow(O){return i._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&i.V()){let pt=O.width+2,Dt=O.height+2;try{return new i.R({width:pt,height:Dt},yield i.W(O,-1,-1,pt,Dt))}catch{}}return c.getImageData(O,1)})}_getNeighboringTiles(O){let pt=O.canonical,Dt=Math.pow(2,pt.z),Ft=(pt.x-1+Dt)%Dt,qt=pt.x===0?O.wrap-1:O.wrap,Ee=(pt.x+1+Dt)%Dt,je=pt.x+1===Dt?O.wrap+1:O.wrap,er={};return er[new i.S(O.overscaledZ,qt,pt.z,Ft,pt.y).key]={backfilled:!1},er[new i.S(O.overscaledZ,je,pt.z,Ee,pt.y).key]={backfilled:!1},pt.y>0&&(er[new i.S(O.overscaledZ,qt,pt.z,Ft,pt.y-1).key]={backfilled:!1},er[new i.S(O.overscaledZ,O.wrap,pt.z,pt.x,pt.y-1).key]={backfilled:!1},er[new i.S(O.overscaledZ,je,pt.z,Ee,pt.y-1).key]={backfilled:!1}),pt.y+10&&i.e(qt,{resourceTiming:Ft}),this.fire(new i.k("data",Object.assign(Object.assign({},qt),{sourceDataType:"metadata"}))),this.fire(new i.k("data",Object.assign(Object.assign({},qt),{sourceDataType:"content"})))}catch(Dt){if(this._pendingLoads--,this._removed)return void this.fire(new i.k("dataabort",{dataType:"source"}));this.fire(new i.j(Dt))}})}loaded(){return this._pendingLoads===0}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.actor?"RT":"LT";O.actor=this.actor;let Dt={type:this.type,uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};O.abortController=new AbortController;let Ft=yield this.actor.sendAsync({type:pt,data:Dt},O.abortController);delete O.abortController,O.unloadVectorData(),O.aborted||O.loadVectorData(Ft,this.map.painter,pt==="RT")})}abortTile(O){return i._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.aborted=!0})}unloadTile(O){return i._(this,void 0,void 0,function*(){O.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return i.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var ee=i.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class xe extends i.E{constructor(O,pt,Dt,Ft){super(),this.id=O,this.dispatcher=Dt,this.coordinates=pt.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ft),this.options=pt}load(O){return i._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new i.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let pt=yield d.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,pt&&pt.data&&(this.image=pt.data,O&&(this.coordinates=O),this._finishLoading())}catch(pt){this._request=null,this._loaded=!0,this.fire(new i.j(pt))}})}loaded(){return this._loaded}updateImage(O){return O.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=O.url,this.load(O.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(O){this.map=O,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(O){this.coordinates=O;let pt=O.map(i.Z.fromLngLat);this.tileID=function(Ft){let qt=1/0,Ee=1/0,je=-1/0,er=-1/0;for(let Tn of Ft)qt=Math.min(qt,Tn.x),Ee=Math.min(Ee,Tn.y),je=Math.max(je,Tn.x),er=Math.max(er,Tn.y);let wr=Math.max(je-qt,er-Ee),Gr=Math.max(0,Math.floor(-Math.log(wr)/Math.LN2)),Zr=Math.pow(2,Gr);return new i.a1(Gr,Math.floor((qt+je)/2*Zr),Math.floor((Ee+er)/2*Zr))}(pt),this.minzoom=this.maxzoom=this.tileID.z;let Dt=pt.map(Ft=>this.tileID.getTilePoint(Ft)._round());return this._boundsArray=new i.$,this._boundsArray.emplaceBack(Dt[0].x,Dt[0].y,0,0),this._boundsArray.emplaceBack(Dt[1].x,Dt[1].y,i.X,0),this._boundsArray.emplaceBack(Dt[3].x,Dt[3].y,0,i.X),this._boundsArray.emplaceBack(Dt[2].x,Dt[2].y,i.X,i.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new i.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let O=this.map.painter.context,pt=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,ee.members)),this.boundsSegments||(this.boundsSegments=i.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new g(O,this.image,pt.RGBA),this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE));let Dt=!1;for(let Ft in this.tiles){let qt=this.tiles[Ft];qt.state!=="loaded"&&(qt.state="loaded",qt.texture=this.texture,Dt=!0)}Dt&&this.fire(new i.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(O){return i._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(O.tileID.canonical)?(this.tiles[String(O.tileID.wrap)]=O,O.buckets={}):O.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ge extends xe{constructor(O,pt,Dt,Ft){super(O,pt,Dt,Ft),this.roundZoom=!0,this.type="video",this.options=pt}load(){return i._(this,void 0,void 0,function*(){this._loaded=!1;let O=this.options;this.urls=[];for(let pt of O.urls)this.urls.push(this.map._requestManager.transformRequest(pt,"Source").url);try{let pt=yield i.a3(this.urls);if(this._loaded=!0,!pt)return;this.video=pt,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(pt){this.fire(new i.j(pt))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(O){if(this.video){let pt=this.video.seekable;Opt.end(0)?this.fire(new i.j(new i.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${pt.start(0)} and ${pt.end(0)}-second mark.`))):this.video.currentTime=O}}getVideo(){return this.video}onAdd(O){this.map||(this.map=O,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let O=this.map.painter.context,pt=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,ee.members)),this.boundsSegments||(this.boundsSegments=i.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE),pt.texSubImage2D(pt.TEXTURE_2D,0,0,0,pt.RGBA,pt.UNSIGNED_BYTE,this.video)):(this.texture=new g(O,this.video,pt.RGBA),this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE));let Dt=!1;for(let Ft in this.tiles){let qt=this.tiles[Ft];qt.state!=="loaded"&&(qt.state="loaded",qt.texture=this.texture,Dt=!0)}Dt&&this.fire(new i.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class ye extends xe{constructor(O,pt,Dt,Ft){super(O,pt,Dt,Ft),pt.coordinates?Array.isArray(pt.coordinates)&&pt.coordinates.length===4&&!pt.coordinates.some(qt=>!Array.isArray(qt)||qt.length!==2||qt.some(Ee=>typeof Ee!="number"))||this.fire(new i.j(new i.a2(`sources.${O}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.j(new i.a2(`sources.${O}`,null,'missing required property "coordinates"'))),pt.animate&&typeof pt.animate!="boolean"&&this.fire(new i.j(new i.a2(`sources.${O}`,null,'optional "animate" property must be a boolean value'))),pt.canvas?typeof pt.canvas=="string"||pt.canvas instanceof HTMLCanvasElement||this.fire(new i.j(new i.a2(`sources.${O}`,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 i.j(new i.a2(`sources.${O}`,null,'missing required property "canvas"'))),this.options=pt,this.animate=pt.animate===void 0||pt.animate}load(){return i._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new i.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(O){this.map=O,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let O=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,O=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,O=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let pt=this.map.painter.context,Dt=pt.gl;this.boundsBuffer||(this.boundsBuffer=pt.createVertexBuffer(this._boundsArray,ee.members)),this.boundsSegments||(this.boundsSegments=i.a0.simpleSegment(0,0,4,2)),this.texture?(O||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new g(pt,this.canvas,Dt.RGBA,{premultiply:!0});let Ft=!1;for(let qt in this.tiles){let Ee=this.tiles[qt];Ee.state!=="loaded"&&(Ee.state="loaded",Ee.texture=this.texture,Ft=!0)}Ft&&this.fire(new i.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let O of[this.canvas.width,this.canvas.height])if(isNaN(O)||O<=0)return!0;return!1}}let ue={},Mt=Kt=>{switch(Kt){case"geojson":return Gt;case"image":return xe;case"raster":return Bt;case"raster-dem":return Zt;case"vector":return Rt;case"video":return ge;case"canvas":return ye}return ue[Kt]},Ot="RTLPluginLoaded";class Lt extends i.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=st()}_syncState(O){return this.status=O,this.dispatcher.broadcast("SRPS",{pluginStatus:O,pluginURL:this.url}).catch(pt=>{throw this.status="error",pt})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(O){return i._(this,arguments,void 0,function*(pt,Dt=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=c.resolveURL(pt),!this.url)throw new Error(`requested url ${pt} is invalid`);if(this.status==="unavailable"){if(!Dt)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return i._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new i.k(Ot))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let ie=null;function be(){return ie||(ie=new Lt),ie}class ce{constructor(O,pt){this.timeAdded=0,this.fadeEndTime=0,this.tileID=O,this.uid=i.a4(),this.uses=0,this.tileSize=pt,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(O){let pt=O+this.timeAdded;ptqt.getLayer(wr)).filter(Boolean);if(er.length!==0){je.layers=er,je.stateDependentLayerIds&&(je.stateDependentLayers=je.stateDependentLayerIds.map(wr=>er.filter(Gr=>Gr.id===wr)[0]));for(let wr of er)Ee[wr.id]=je}}return Ee}(O.buckets,pt.style),this.hasSymbolBuckets=!1;for(let Ft in this.buckets){let qt=this.buckets[Ft];if(qt instanceof i.a6){if(this.hasSymbolBuckets=!0,!Dt)break;qt.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let Ft in this.buckets){let qt=this.buckets[Ft];if(qt instanceof i.a6&&qt.hasRTLText){this.hasRTLText=!0,be().lazyLoad();break}}this.queryPadding=0;for(let Ft in this.buckets){let qt=this.buckets[Ft];this.queryPadding=Math.max(this.queryPadding,pt.style.getLayer(Ft).queryRadius(qt))}O.imageAtlas&&(this.imageAtlas=O.imageAtlas),O.glyphAtlasImage&&(this.glyphAtlasImage=O.glyphAtlasImage)}else this.collisionBoxArray=new i.a5}unloadVectorData(){for(let O in this.buckets)this.buckets[O].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(O){return this.buckets[O.id]}upload(O){for(let Dt in this.buckets){let Ft=this.buckets[Dt];Ft.uploadPending()&&Ft.upload(O)}let pt=O.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new g(O,this.imageAtlas.image,pt.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new g(O,this.glyphAtlasImage,pt.ALPHA),this.glyphAtlasImage=null)}prepare(O){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(O,this.imageAtlasTexture)}queryRenderedFeatures(O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ft,cameraQueryGeometry:qt,scale:Ee,tileSize:this.tileSize,pixelPosMatrix:Gr,transform:er,params:je,queryPadding:this.queryPadding*wr},O,pt,Dt):{}}querySourceFeatures(O,pt){let Dt=this.latestFeatureIndex;if(!Dt||!Dt.rawTileData)return;let Ft=Dt.loadVTLayers(),qt=pt&&pt.sourceLayer?pt.sourceLayer:"",Ee=Ft._geojsonTileLayer||Ft[qt];if(!Ee)return;let je=i.a7(pt&&pt.filter),{z:er,x:wr,y:Gr}=this.tileID.canonical,Zr={z:er,x:wr,y:Gr};for(let Tn=0;TnDt)Ft=!1;else if(pt)if(this.expirationTime{this.remove(O,qt)},Dt)),this.data[Ft].push(qt),this.order.push(Ft),this.order.length>this.max){let Ee=this._getAndRemoveByKey(this.order[0]);Ee&&this.onRemove(Ee)}return this}has(O){return O.wrapped().key in this.data}getAndRemove(O){return this.has(O)?this._getAndRemoveByKey(O.wrapped().key):null}_getAndRemoveByKey(O){let pt=this.data[O].shift();return pt.timeout&&clearTimeout(pt.timeout),this.data[O].length===0&&delete this.data[O],this.order.splice(this.order.indexOf(O),1),pt.value}getByKey(O){let pt=this.data[O];return pt?pt[0].value:null}get(O){return this.has(O)?this.data[O.wrapped().key][0].value:null}remove(O,pt){if(!this.has(O))return this;let Dt=O.wrapped().key,Ft=pt===void 0?0:this.data[Dt].indexOf(pt),qt=this.data[Dt][Ft];return this.data[Dt].splice(Ft,1),qt.timeout&&clearTimeout(qt.timeout),this.data[Dt].length===0&&delete this.data[Dt],this.onRemove(qt.value),this.order.splice(this.order.indexOf(Dt),1),this}setMaxSize(O){for(this.max=O;this.order.length>this.max;){let pt=this._getAndRemoveByKey(this.order[0]);pt&&this.onRemove(pt)}return this}filter(O){let pt=[];for(let Dt in this.data)for(let Ft of this.data[Dt])O(Ft.value)||pt.push(Ft);for(let Dt of pt)this.remove(Dt.value.tileID,Dt)}}class Ze{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(O,pt,Dt){let Ft=String(pt);if(this.stateChanges[O]=this.stateChanges[O]||{},this.stateChanges[O][Ft]=this.stateChanges[O][Ft]||{},i.e(this.stateChanges[O][Ft],Dt),this.deletedStates[O]===null){this.deletedStates[O]={};for(let qt in this.state[O])qt!==Ft&&(this.deletedStates[O][qt]=null)}else if(this.deletedStates[O]&&this.deletedStates[O][Ft]===null){this.deletedStates[O][Ft]={};for(let qt in this.state[O][Ft])Dt[qt]||(this.deletedStates[O][Ft][qt]=null)}else for(let qt in Dt)this.deletedStates[O]&&this.deletedStates[O][Ft]&&this.deletedStates[O][Ft][qt]===null&&delete this.deletedStates[O][Ft][qt]}removeFeatureState(O,pt,Dt){if(this.deletedStates[O]===null)return;let Ft=String(pt);if(this.deletedStates[O]=this.deletedStates[O]||{},Dt&&pt!==void 0)this.deletedStates[O][Ft]!==null&&(this.deletedStates[O][Ft]=this.deletedStates[O][Ft]||{},this.deletedStates[O][Ft][Dt]=null);else if(pt!==void 0)if(this.stateChanges[O]&&this.stateChanges[O][Ft])for(Dt in this.deletedStates[O][Ft]={},this.stateChanges[O][Ft])this.deletedStates[O][Ft][Dt]=null;else this.deletedStates[O][Ft]=null;else this.deletedStates[O]=null}getState(O,pt){let Dt=String(pt),Ft=i.e({},(this.state[O]||{})[Dt],(this.stateChanges[O]||{})[Dt]);if(this.deletedStates[O]===null)return{};if(this.deletedStates[O]){let qt=this.deletedStates[O][pt];if(qt===null)return{};for(let Ee in qt)delete Ft[Ee]}return Ft}initializeTileState(O,pt){O.setFeatureState(this.state,pt)}coalesceChanges(O,pt){let Dt={};for(let Ft in this.stateChanges){this.state[Ft]=this.state[Ft]||{};let qt={};for(let Ee in this.stateChanges[Ft])this.state[Ft][Ee]||(this.state[Ft][Ee]={}),i.e(this.state[Ft][Ee],this.stateChanges[Ft][Ee]),qt[Ee]=this.state[Ft][Ee];Dt[Ft]=qt}for(let Ft in this.deletedStates){this.state[Ft]=this.state[Ft]||{};let qt={};if(this.deletedStates[Ft]===null)for(let Ee in this.state[Ft])qt[Ee]={},this.state[Ft][Ee]={};else for(let Ee in this.deletedStates[Ft]){if(this.deletedStates[Ft][Ee]===null)this.state[Ft][Ee]={};else for(let je of Object.keys(this.deletedStates[Ft][Ee]))delete this.state[Ft][Ee][je];qt[Ee]=this.state[Ft][Ee]}Dt[Ft]=Dt[Ft]||{},i.e(Dt[Ft],qt)}if(this.stateChanges={},this.deletedStates={},Object.keys(Dt).length!==0)for(let Ft in O)O[Ft].setFeatureState(Dt,pt)}}class Qe extends i.E{constructor(O,pt,Dt){super(),this.id=O,this.dispatcher=Dt,this.on("data",Ft=>this._dataHandler(Ft)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Ft,qt,Ee,je)=>{let er=new(Mt(qt.type))(Ft,qt,Ee,je);if(er.id!==Ft)throw new Error(`Expected Source id to be ${Ft} instead of ${er.id}`);return er})(O,pt,Dt,this),this._tiles={},this._cache=new Le(0,Ft=>this._unloadTile(Ft)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ze,this._didEmitContent=!1,this._updated=!1}onAdd(O){this.map=O,this._maxTileCacheSize=O?O._maxTileCacheSize:null,this._maxTileCacheZoomLevels=O?O._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(O)}onRemove(O){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(O)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let O in this._tiles){let pt=this._tiles[O];if(pt.state!=="loaded"&&pt.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let O=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,O&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(O,pt,Dt){return i._(this,void 0,void 0,function*(){try{yield this._source.loadTile(O),this._tileLoaded(O,pt,Dt)}catch(Ft){O.state="errored",Ft.status!==404?this._source.fire(new i.j(Ft,{tile:O})):this.update(this.transform,this.terrain)}})}_unloadTile(O){this._source.unloadTile&&this._source.unloadTile(O)}_abortTile(O){this._source.abortTile&&this._source.abortTile(O),this._source.fire(new i.k("dataabort",{tile:O,coord:O.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(O){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let pt in this._tiles){let Dt=this._tiles[pt];Dt.upload(O),Dt.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(O=>O.tileID).sort(mr).map(O=>O.key)}getRenderableIds(O){let pt=[];for(let Dt in this._tiles)this._isIdRenderable(Dt,O)&&pt.push(this._tiles[Dt]);return O?pt.sort((Dt,Ft)=>{let qt=Dt.tileID,Ee=Ft.tileID,je=new i.P(qt.canonical.x,qt.canonical.y)._rotate(this.transform.angle),er=new i.P(Ee.canonical.x,Ee.canonical.y)._rotate(this.transform.angle);return qt.overscaledZ-Ee.overscaledZ||er.y-je.y||er.x-je.x}).map(Dt=>Dt.tileID.key):pt.map(Dt=>Dt.tileID).sort(mr).map(Dt=>Dt.key)}hasRenderableParent(O){let pt=this.findLoadedParent(O,0);return!!pt&&this._isIdRenderable(pt.tileID.key)}_isIdRenderable(O,pt){return this._tiles[O]&&this._tiles[O].hasData()&&!this._coveredTiles[O]&&(pt||!this._tiles[O].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let O in this._tiles)this._tiles[O].state!=="errored"&&this._reloadTile(O,"reloading")}}_reloadTile(O,pt){return i._(this,void 0,void 0,function*(){let Dt=this._tiles[O];Dt&&(Dt.state!=="loading"&&(Dt.state=pt),yield this._loadTile(Dt,O,pt))})}_tileLoaded(O,pt,Dt){O.timeAdded=c.now(),Dt==="expired"&&(O.refreshedUponExpiration=!0),this._setTileReloadTimer(pt,O),this.getSource().type==="raster-dem"&&O.dem&&this._backfillDEM(O),this._state.initializeTileState(O,this.map?this.map.painter:null),O.aborted||this._source.fire(new i.k("data",{dataType:"source",tile:O,coord:O.tileID}))}_backfillDEM(O){let pt=this.getRenderableIds();for(let Ft=0;Ft1||(Math.abs(Ee)>1&&(Math.abs(Ee+er)===1?Ee+=er:Math.abs(Ee-er)===1&&(Ee-=er)),qt.dem&&Ft.dem&&(Ft.dem.backfillBorder(qt.dem,Ee,je),Ft.neighboringTiles&&Ft.neighboringTiles[wr]&&(Ft.neighboringTiles[wr].backfilled=!0)))}}getTile(O){return this.getTileByID(O.key)}getTileByID(O){return this._tiles[O]}_retainLoadedChildren(O,pt,Dt,Ft){for(let qt in this._tiles){let Ee=this._tiles[qt];if(Ft[qt]||!Ee.hasData()||Ee.tileID.overscaledZ<=pt||Ee.tileID.overscaledZ>Dt)continue;let je=Ee.tileID;for(;Ee&&Ee.tileID.overscaledZ>pt+1;){let wr=Ee.tileID.scaledTo(Ee.tileID.overscaledZ-1);Ee=this._tiles[wr.key],Ee&&Ee.hasData()&&(je=wr)}let er=je;for(;er.overscaledZ>pt;)if(er=er.scaledTo(er.overscaledZ-1),O[er.key]){Ft[je.key]=je;break}}}findLoadedParent(O,pt){if(O.key in this._loadedParentTiles){let Dt=this._loadedParentTiles[O.key];return Dt&&Dt.tileID.overscaledZ>=pt?Dt:null}for(let Dt=O.overscaledZ-1;Dt>=pt;Dt--){let Ft=O.scaledTo(Dt),qt=this._getLoadedTile(Ft);if(qt)return qt}}findLoadedSibling(O){return this._getLoadedTile(O)}_getLoadedTile(O){let pt=this._tiles[O.key];return pt&&pt.hasData()?pt:this._cache.getByKey(O.wrapped().key)}updateCacheSize(O){let pt=Math.ceil(O.width/this._source.tileSize)+1,Dt=Math.ceil(O.height/this._source.tileSize)+1,Ft=Math.floor(pt*Dt*(this._maxTileCacheZoomLevels===null?i.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),qt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ft):Ft;this._cache.setMaxSize(qt)}handleWrapJump(O){let pt=Math.round((O-(this._prevLng===void 0?O:this._prevLng))/360);if(this._prevLng=O,pt){let Dt={};for(let Ft in this._tiles){let qt=this._tiles[Ft];qt.tileID=qt.tileID.unwrapTo(qt.tileID.wrap+pt),Dt[qt.tileID.key]=qt}this._tiles=Dt;for(let Ft in this._timers)clearTimeout(this._timers[Ft]),delete this._timers[Ft];for(let Ft in this._tiles)this._setTileReloadTimer(Ft,this._tiles[Ft])}}_updateCoveredAndRetainedTiles(O,pt,Dt,Ft,qt,Ee){let je={},er={},wr=Object.keys(O),Gr=c.now();for(let Zr of wr){let Tn=O[Zr],qn=this._tiles[Zr];if(!qn||qn.fadeEndTime!==0&&qn.fadeEndTime<=Gr)continue;let te=this.findLoadedParent(Tn,pt),le=this.findLoadedSibling(Tn),Te=te||le||null;Te&&(this._addTile(Te.tileID),je[Te.tileID.key]=Te.tileID),er[Zr]=Tn}this._retainLoadedChildren(er,Ft,Dt,O);for(let Zr in je)O[Zr]||(this._coveredTiles[Zr]=!0,O[Zr]=je[Zr]);if(Ee){let Zr={},Tn={};for(let qn of qt)this._tiles[qn.key].hasData()?Zr[qn.key]=qn:Tn[qn.key]=qn;for(let qn in Tn){let te=Tn[qn].children(this._source.maxzoom);this._tiles[te[0].key]&&this._tiles[te[1].key]&&this._tiles[te[2].key]&&this._tiles[te[3].key]&&(Zr[te[0].key]=O[te[0].key]=te[0],Zr[te[1].key]=O[te[1].key]=te[1],Zr[te[2].key]=O[te[2].key]=te[2],Zr[te[3].key]=O[te[3].key]=te[3],delete Tn[qn])}for(let qn in Tn){let te=Tn[qn],le=this.findLoadedParent(te,this._source.minzoom),Te=this.findLoadedSibling(te),Pe=le||Te||null;if(Pe){Zr[Pe.tileID.key]=O[Pe.tileID.key]=Pe.tileID;for(let We in Zr)Zr[We].isChildOf(Pe.tileID)&&delete Zr[We]}}for(let qn in this._tiles)Zr[qn]||(this._coveredTiles[qn]=!0)}}update(O,pt){if(!this._sourceLoaded||this._paused)return;let Dt;this.transform=O,this.terrain=pt,this.updateCacheSize(O),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Dt=O.getVisibleUnwrappedCoordinates(this._source.tileID).map(Gr=>new i.S(Gr.canonical.z,Gr.wrap,Gr.canonical.z,Gr.canonical.x,Gr.canonical.y)):(Dt=O.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:pt}),this._source.hasTile&&(Dt=Dt.filter(Gr=>this._source.hasTile(Gr)))):Dt=[];let Ft=O.coveringZoomLevel(this._source),qt=Math.max(Ft-Qe.maxOverzooming,this._source.minzoom),Ee=Math.max(Ft+Qe.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let Gr={};for(let Zr of Dt)if(Zr.canonical.z>this._source.minzoom){let Tn=Zr.scaledTo(Zr.canonical.z-1);Gr[Tn.key]=Tn;let qn=Zr.scaledTo(Math.max(this._source.minzoom,Math.min(Zr.canonical.z,5)));Gr[qn.key]=qn}Dt=Dt.concat(Object.values(Gr))}let je=Dt.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,je&&this.fire(new i.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let er=this._updateRetainedTiles(Dt,Ft);fr(this._source.type)&&this._updateCoveredAndRetainedTiles(er,qt,Ee,Ft,Dt,pt);for(let Gr in er)this._tiles[Gr].clearFadeHold();let wr=i.ab(this._tiles,er);for(let Gr of wr){let Zr=this._tiles[Gr];Zr.hasSymbolBuckets&&!Zr.holdingForFade()?Zr.setHoldDuration(this.map._fadeDuration):Zr.hasSymbolBuckets&&!Zr.symbolFadeFinished()||this._removeTile(Gr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let O in this._tiles)this._tiles[O].holdingForFade()&&this._removeTile(O)}_updateRetainedTiles(O,pt){var Dt;let Ft={},qt={},Ee=Math.max(pt-Qe.maxOverzooming,this._source.minzoom),je=Math.max(pt+Qe.maxUnderzooming,this._source.minzoom),er={};for(let wr of O){let Gr=this._addTile(wr);Ft[wr.key]=wr,Gr.hasData()||ptthis._source.maxzoom){let Tn=wr.children(this._source.maxzoom)[0],qn=this.getTile(Tn);if(qn&&qn.hasData()){Ft[Tn.key]=Tn;continue}}else{let Tn=wr.children(this._source.maxzoom);if(Ft[Tn[0].key]&&Ft[Tn[1].key]&&Ft[Tn[2].key]&&Ft[Tn[3].key])continue}let Zr=Gr.wasRequested();for(let Tn=wr.overscaledZ-1;Tn>=Ee;--Tn){let qn=wr.scaledTo(Tn);if(qt[qn.key])break;if(qt[qn.key]=!0,Gr=this.getTile(qn),!Gr&&Zr&&(Gr=this._addTile(qn)),Gr){let te=Gr.hasData();if((te||!(!((Dt=this.map)===null||Dt===void 0)&&Dt.cancelPendingTileRequestsWhileZooming)||Zr)&&(Ft[qn.key]=qn),Zr=Gr.wasRequested(),te)break}}}return Ft}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let O in this._tiles){let pt=[],Dt,Ft=this._tiles[O].tileID;for(;Ft.overscaledZ>0;){if(Ft.key in this._loadedParentTiles){Dt=this._loadedParentTiles[Ft.key];break}pt.push(Ft.key);let qt=Ft.scaledTo(Ft.overscaledZ-1);if(Dt=this._getLoadedTile(qt),Dt)break;Ft=qt}for(let qt of pt)this._loadedParentTiles[qt]=Dt}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let O in this._tiles){let pt=this._tiles[O].tileID,Dt=this._getLoadedTile(pt);this._loadedSiblingTiles[pt.key]=Dt}}_addTile(O){let pt=this._tiles[O.key];if(pt)return pt;pt=this._cache.getAndRemove(O),pt&&(this._setTileReloadTimer(O.key,pt),pt.tileID=O,this._state.initializeTileState(pt,this.map?this.map.painter:null),this._cacheTimers[O.key]&&(clearTimeout(this._cacheTimers[O.key]),delete this._cacheTimers[O.key],this._setTileReloadTimer(O.key,pt)));let Dt=pt;return pt||(pt=new ce(O,this._source.tileSize*O.overscaleFactor()),this._loadTile(pt,O.key,pt.state)),pt.uses++,this._tiles[O.key]=pt,Dt||this._source.fire(new i.k("dataloading",{tile:pt,coord:pt.tileID,dataType:"source"})),pt}_setTileReloadTimer(O,pt){O in this._timers&&(clearTimeout(this._timers[O]),delete this._timers[O]);let Dt=pt.getExpiryTimeout();Dt&&(this._timers[O]=setTimeout(()=>{this._reloadTile(O,"expired"),delete this._timers[O]},Dt))}_removeTile(O){let pt=this._tiles[O];pt&&(pt.uses--,delete this._tiles[O],this._timers[O]&&(clearTimeout(this._timers[O]),delete this._timers[O]),pt.uses>0||(pt.hasData()&&pt.state!=="reloading"?this._cache.add(pt.tileID,pt,pt.getExpiryTimeout()):(pt.aborted=!0,this._abortTile(pt),this._unloadTile(pt))))}_dataHandler(O){let pt=O.sourceDataType;O.dataType==="source"&&pt==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&O.dataType==="source"&&pt==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let O in this._tiles)this._removeTile(O);this._cache.reset()}tilesIn(O,pt,Dt){let Ft=[],qt=this.transform;if(!qt)return Ft;let Ee=Dt?qt.getCameraQueryGeometry(O):O,je=O.map(te=>qt.pointCoordinate(te,this.terrain)),er=Ee.map(te=>qt.pointCoordinate(te,this.terrain)),wr=this.getIds(),Gr=1/0,Zr=1/0,Tn=-1/0,qn=-1/0;for(let te of er)Gr=Math.min(Gr,te.x),Zr=Math.min(Zr,te.y),Tn=Math.max(Tn,te.x),qn=Math.max(qn,te.y);for(let te=0;te=0&&Ne[1].y+We>=0){let Xe=je.map(qr=>Te.getTilePoint(qr)),Pr=er.map(qr=>Te.getTilePoint(qr));Ft.push({tile:le,tileID:Te,queryGeometry:Xe,cameraQueryGeometry:Pr,scale:Pe})}}return Ft}getVisibleCoordinates(O){let pt=this.getRenderableIds(O).map(Dt=>this._tiles[Dt].tileID);for(let Dt of pt)Dt.posMatrix=this.transform.calculatePosMatrix(Dt.toUnwrapped());return pt}hasTransition(){if(this._source.hasTransition())return!0;if(fr(this._source.type)){let O=c.now();for(let pt in this._tiles)if(this._tiles[pt].fadeEndTime>=O)return!0}return!1}setFeatureState(O,pt,Dt){this._state.updateState(O=O||"_geojsonTileLayer",pt,Dt)}removeFeatureState(O,pt,Dt){this._state.removeFeatureState(O=O||"_geojsonTileLayer",pt,Dt)}getFeatureState(O,pt){return this._state.getState(O=O||"_geojsonTileLayer",pt)}setDependencies(O,pt,Dt){let Ft=this._tiles[O];Ft&&Ft.setDependencies(pt,Dt)}reloadTilesForDependencies(O,pt){for(let Dt in this._tiles)this._tiles[Dt].hasDependency(O,pt)&&this._reloadTile(Dt,"reloading");this._cache.filter(Dt=>!Dt.hasDependency(O,pt))}}function mr(Kt,O){let pt=Math.abs(2*Kt.wrap)-+(Kt.wrap<0),Dt=Math.abs(2*O.wrap)-+(O.wrap<0);return Kt.overscaledZ-O.overscaledZ||Dt-pt||O.canonical.y-Kt.canonical.y||O.canonical.x-Kt.canonical.x}function fr(Kt){return Kt==="raster"||Kt==="image"||Kt==="video"}Qe.maxOverzooming=10,Qe.maxUnderzooming=3;class Jr{constructor(O,pt){this.reset(O,pt)}reset(O,pt){this.points=O||[],this._distances=[0];for(let Dt=1;Dt0?(Ft-Ee)/je:0;return this.points[qt].mult(1-er).add(this.points[pt].mult(er))}}function an(Kt,O){let pt=!0;return Kt==="always"||Kt!=="never"&&O!=="never"||(pt=!1),pt}class Er{constructor(O,pt,Dt){let Ft=this.boxCells=[],qt=this.circleCells=[];this.xCellCount=Math.ceil(O/Dt),this.yCellCount=Math.ceil(pt/Dt);for(let Ee=0;Eethis.width||Ft<0||pt>this.height)return[];let er=[];if(O<=0&&pt<=0&&this.width<=Dt&&this.height<=Ft){if(qt)return[{key:null,x1:O,y1:pt,x2:Dt,y2:Ft}];for(let wr=0;wr0}hitTestCircle(O,pt,Dt,Ft,qt){let Ee=O-Dt,je=O+Dt,er=pt-Dt,wr=pt+Dt;if(je<0||Ee>this.width||wr<0||er>this.height)return!1;let Gr=[];return this._forEachCell(Ee,er,je,wr,this._queryCellCircle,Gr,{hitTest:!0,overlapMode:Ft,circle:{x:O,y:pt,radius:Dt},seenUids:{box:{},circle:{}}},qt),Gr.length>0}_queryCell(O,pt,Dt,Ft,qt,Ee,je,er){let{seenUids:wr,hitTest:Gr,overlapMode:Zr}=je,Tn=this.boxCells[qt];if(Tn!==null){let te=this.bboxes;for(let le of Tn)if(!wr.box[le]){wr.box[le]=!0;let Te=4*le,Pe=this.boxKeys[le];if(O<=te[Te+2]&&pt<=te[Te+3]&&Dt>=te[Te+0]&&Ft>=te[Te+1]&&(!er||er(Pe))&&(!Gr||!an(Zr,Pe.overlapMode))&&(Ee.push({key:Pe,x1:te[Te],y1:te[Te+1],x2:te[Te+2],y2:te[Te+3]}),Gr))return!0}}let qn=this.circleCells[qt];if(qn!==null){let te=this.circles;for(let le of qn)if(!wr.circle[le]){wr.circle[le]=!0;let Te=3*le,Pe=this.circleKeys[le];if(this._circleAndRectCollide(te[Te],te[Te+1],te[Te+2],O,pt,Dt,Ft)&&(!er||er(Pe))&&(!Gr||!an(Zr,Pe.overlapMode))){let We=te[Te],Ne=te[Te+1],Xe=te[Te+2];if(Ee.push({key:Pe,x1:We-Xe,y1:Ne-Xe,x2:We+Xe,y2:Ne+Xe}),Gr)return!0}}}return!1}_queryCellCircle(O,pt,Dt,Ft,qt,Ee,je,er){let{circle:wr,seenUids:Gr,overlapMode:Zr}=je,Tn=this.boxCells[qt];if(Tn!==null){let te=this.bboxes;for(let le of Tn)if(!Gr.box[le]){Gr.box[le]=!0;let Te=4*le,Pe=this.boxKeys[le];if(this._circleAndRectCollide(wr.x,wr.y,wr.radius,te[Te+0],te[Te+1],te[Te+2],te[Te+3])&&(!er||er(Pe))&&!an(Zr,Pe.overlapMode))return Ee.push(!0),!0}}let qn=this.circleCells[qt];if(qn!==null){let te=this.circles;for(let le of qn)if(!Gr.circle[le]){Gr.circle[le]=!0;let Te=3*le,Pe=this.circleKeys[le];if(this._circlesCollide(te[Te],te[Te+1],te[Te+2],wr.x,wr.y,wr.radius)&&(!er||er(Pe))&&!an(Zr,Pe.overlapMode))return Ee.push(!0),!0}}}_forEachCell(O,pt,Dt,Ft,qt,Ee,je,er){let wr=this._convertToXCellCoord(O),Gr=this._convertToYCellCoord(pt),Zr=this._convertToXCellCoord(Dt),Tn=this._convertToYCellCoord(Ft);for(let qn=wr;qn<=Zr;qn++)for(let te=Gr;te<=Tn;te++)if(qt.call(this,O,pt,Dt,Ft,this.xCellCount*te+qn,Ee,je,er))return}_convertToXCellCoord(O){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(O*this.xScale)))}_convertToYCellCoord(O){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(O*this.yScale)))}_circlesCollide(O,pt,Dt,Ft,qt,Ee){let je=Ft-O,er=qt-pt,wr=Dt+Ee;return wr*wr>je*je+er*er}_circleAndRectCollide(O,pt,Dt,Ft,qt,Ee,je){let er=(Ee-Ft)/2,wr=Math.abs(O-(Ft+er));if(wr>er+Dt)return!1;let Gr=(je-qt)/2,Zr=Math.abs(pt-(qt+Gr));if(Zr>Gr+Dt)return!1;if(wr<=er||Zr<=Gr)return!0;let Tn=wr-er,qn=Zr-Gr;return Tn*Tn+qn*qn<=Dt*Dt}}function dn(Kt,O,pt,Dt,Ft){let qt=i.H();return O?(i.K(qt,qt,[1/Ft,1/Ft,1]),pt||i.ad(qt,qt,Dt.angle)):i.L(qt,Dt.labelPlaneMatrix,Kt),qt}function _n(Kt,O,pt,Dt,Ft){if(O){let qt=i.ae(Kt);return i.K(qt,qt,[Ft,Ft,1]),pt||i.ad(qt,qt,-Dt.angle),qt}return Dt.glCoordMatrix}function Oe(Kt,O,pt,Dt){let Ft;Dt?(Ft=[Kt,O,Dt(Kt,O),1],i.af(Ft,Ft,pt)):(Ft=[Kt,O,0,1],xr(Ft,Ft,pt));let qt=Ft[3];return{point:new i.P(Ft[0]/qt,Ft[1]/qt),signedDistanceFromCamera:qt,isOccluded:!1}}function Xt(Kt,O){return .5+Kt/O*.5}function oe(Kt,O){return Kt.x>=-O[0]&&Kt.x<=O[0]&&Kt.y>=-O[1]&&Kt.y<=O[1]}function zt(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te){let le=Dt?Kt.textSizeData:Kt.iconSizeData,Te=i.ag(le,pt.transform.zoom),Pe=[256/pt.width*2+1,256/pt.height*2+1],We=Dt?Kt.text.dynamicLayoutVertexArray:Kt.icon.dynamicLayoutVertexArray;We.clear();let Ne=Kt.lineVertexArray,Xe=Dt?Kt.text.placedSymbolArray:Kt.icon.placedSymbolArray,Pr=pt.transform.width/pt.transform.height,qr=!1;for(let Xr=0;XrMath.abs(pt.x-O.x)*Dt?{useVertical:!0}:(Kt===i.ah.vertical?O.ypt.x)?{needsFlipping:!0}:null}function Ht(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr){let Zr=pt/24,Tn=O.lineOffsetX*Zr,qn=O.lineOffsetY*Zr,te;if(O.numGlyphs>1){let le=O.glyphStartIndex+O.numGlyphs,Te=O.lineStartIndex,Pe=O.lineStartIndex+O.lineLength,We=_t(Zr,je,Tn,qn,Dt,O,Gr,Kt);if(!We)return{notEnoughRoom:!0};let Ne=Oe(We.first.point.x,We.first.point.y,Ee,Kt.getElevation).point,Xe=Oe(We.last.point.x,We.last.point.y,Ee,Kt.getElevation).point;if(Ft&&!Dt){let Pr=Pt(O.writingMode,Ne,Xe,wr);if(Pr)return Pr}te=[We.first];for(let Pr=O.glyphStartIndex+1;Pr0?Ne.point:function(qr,Xr,gn,zn,Qn,ai){return ae(qr,Xr,gn,1,Qn,ai)}(Kt.tileAnchorPoint,We,Te,0,qt,Kt),Pr=Pt(O.writingMode,Te,Xe,wr);if(Pr)return Pr}let le=ur(Zr*je.getoffsetX(O.glyphStartIndex),Tn,qn,Dt,O.segment,O.lineStartIndex,O.lineStartIndex+O.lineLength,Kt,Gr);if(!le||Kt.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};te=[le]}for(let le of te)i.aj(er,le.point,le.angle);return{}}function ae(Kt,O,pt,Dt,Ft,qt){let Ee=Kt.add(Kt.sub(O)._unit()),je=Ft!==void 0?Oe(Ee.x,Ee.y,Ft,qt.getElevation).point:Me(Ee.x,Ee.y,qt).point,er=pt.sub(je);return pt.add(er._mult(Dt/er.mag()))}function he(Kt,O,pt){let Dt=O.projectionCache;if(Dt.projections[Kt])return Dt.projections[Kt];let Ft=new i.P(O.lineVertexArray.getx(Kt),O.lineVertexArray.gety(Kt)),qt=Me(Ft.x,Ft.y,O);if(qt.signedDistanceFromCamera>0)return Dt.projections[Kt]=qt.point,Dt.anyProjectionOccluded=Dt.anyProjectionOccluded||qt.isOccluded,qt.point;let Ee=Kt-pt.direction;return function(je,er,wr,Gr,Zr){return ae(je,er,wr,Gr,void 0,Zr)}(pt.distanceFromAnchor===0?O.tileAnchorPoint:new i.P(O.lineVertexArray.getx(Ee),O.lineVertexArray.gety(Ee)),Ft,pt.previousVertex,pt.absOffsetX-pt.distanceFromAnchor+1,O)}function Me(Kt,O,pt){let Dt=Kt+pt.translation[0],Ft=O+pt.translation[1],qt;return!pt.pitchWithMap&&pt.projection.useSpecialProjectionForSymbols?(qt=pt.projection.projectTileCoordinates(Dt,Ft,pt.unwrappedTileID,pt.getElevation),qt.point.x=(.5*qt.point.x+.5)*pt.width,qt.point.y=(.5*-qt.point.y+.5)*pt.height):(qt=Oe(Dt,Ft,pt.labelPlaneMatrix,pt.getElevation),qt.isOccluded=!1),qt}function qe(Kt,O,pt){return Kt._unit()._perp()._mult(O*pt)}function Ye(Kt,O,pt,Dt,Ft,qt,Ee,je,er){if(je.projectionCache.offsets[Kt])return je.projectionCache.offsets[Kt];let wr=pt.add(O);if(Kt+er.direction=Ft)return je.projectionCache.offsets[Kt]=wr,wr;let Gr=he(Kt+er.direction,je,er),Zr=qe(Gr.sub(pt),Ee,er.direction),Tn=pt.add(Zr),qn=Gr.add(Zr);return je.projectionCache.offsets[Kt]=i.ak(qt,wr,Tn,qn)||wr,je.projectionCache.offsets[Kt]}function ur(Kt,O,pt,Dt,Ft,qt,Ee,je,er){let wr=Dt?Kt-O:Kt+O,Gr=wr>0?1:-1,Zr=0;Dt&&(Gr*=-1,Zr=Math.PI),Gr<0&&(Zr+=Math.PI);let Tn,qn=Gr>0?qt+Ft:qt+Ft+1;je.projectionCache.cachedAnchorPoint?Tn=je.projectionCache.cachedAnchorPoint:(Tn=Me(je.tileAnchorPoint.x,je.tileAnchorPoint.y,je).point,je.projectionCache.cachedAnchorPoint=Tn);let te,le,Te=Tn,Pe=Tn,We=0,Ne=0,Xe=Math.abs(wr),Pr=[],qr;for(;We+Ne<=Xe;){if(qn+=Gr,qn=Ee)return null;We+=Ne,Pe=Te,le=te;let zn={absOffsetX:Xe,direction:Gr,distanceFromAnchor:We,previousVertex:Pe};if(Te=he(qn,je,zn),pt===0)Pr.push(Pe),qr=Te.sub(Pe);else{let Qn,ai=Te.sub(Pe);Qn=ai.mag()===0?qe(he(qn+Gr,je,zn).sub(Te),pt,Gr):qe(ai,pt,Gr),le||(le=Pe.add(Qn)),te=Ye(qn,Qn,Te,qt,Ee,le,pt,je,zn),Pr.push(le),qr=te.sub(le)}Ne=qr.mag()}let Xr=qr._mult((Xe-We)/Ne)._add(le||Pe),gn=Zr+Math.atan2(Te.y-Pe.y,Te.x-Pe.x);return Pr.push(Xr),{point:Xr,angle:er?gn:0,path:Pr}}let Rr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function zr(Kt,O){for(let pt=0;pt=1;Fo--)Fa.push(Ma.path[Fo]);for(let Fo=1;Foxs.signedDistanceFromCamera<=0)?[]:Fo.map(xs=>xs.point)}let Yo=[];if(Fa.length>0){let Fo=Fa[0].clone(),xs=Fa[0].clone();for(let Sl=1;Sl=ai.x&&xs.x<=Ti.x&&Fo.y>=ai.y&&xs.y<=Ti.y?[Fa]:xs.xTi.x||xs.yTi.y?[]:i.al([Fa],ai.x,ai.y,Ti.x,Ti.y)}for(let Fo of Yo){Qi.reset(Fo,.25*Qn);let xs=0;xs=Qi.length<=.5*Qn?1:Math.ceil(Qi.paddedLength/wo)+1;for(let Sl=0;SlOe(Ft.x,Ft.y,Dt,pt.getElevation))}queryRenderedSymbols(O){if(O.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let pt=[],Dt=1/0,Ft=1/0,qt=-1/0,Ee=-1/0;for(let Gr of O){let Zr=new i.P(Gr.x+pn,Gr.y+pn);Dt=Math.min(Dt,Zr.x),Ft=Math.min(Ft,Zr.y),qt=Math.max(qt,Zr.x),Ee=Math.max(Ee,Zr.y),pt.push(Zr)}let je=this.grid.query(Dt,Ft,qt,Ee).concat(this.ignoredGrid.query(Dt,Ft,qt,Ee)),er={},wr={};for(let Gr of je){let Zr=Gr.key;if(er[Zr.bucketInstanceId]===void 0&&(er[Zr.bucketInstanceId]={}),er[Zr.bucketInstanceId][Zr.featureIndex])continue;let Tn=[new i.P(Gr.x1,Gr.y1),new i.P(Gr.x2,Gr.y1),new i.P(Gr.x2,Gr.y2),new i.P(Gr.x1,Gr.y2)];i.am(pt,Tn)&&(er[Zr.bucketInstanceId][Zr.featureIndex]=!0,wr[Zr.bucketInstanceId]===void 0&&(wr[Zr.bucketInstanceId]=[]),wr[Zr.bucketInstanceId].push(Zr.featureIndex))}return wr}insertCollisionBox(O,pt,Dt,Ft,qt,Ee){(Dt?this.ignoredGrid:this.grid).insert({bucketInstanceId:Ft,featureIndex:qt,collisionGroupID:Ee,overlapMode:pt},O[0],O[1],O[2],O[3])}insertCollisionCircles(O,pt,Dt,Ft,qt,Ee){let je=Dt?this.ignoredGrid:this.grid,er={bucketInstanceId:Ft,featureIndex:qt,collisionGroupID:Ee,overlapMode:pt};for(let wr=0;wr=this.screenRightBoundary||Ftthis.screenBottomBoundary}isInsideGrid(O,pt,Dt,Ft){return Dt>=0&&O=0&&ptthis.projectAndGetPerspectiveRatio(Dt,Qn.x,Qn.y,Ft,wr));gn=zn.some(Qn=>!Qn.isOccluded),Xr=zn.map(Qn=>Qn.point)}else gn=!0;return{box:i.ao(Xr),allPointsOccluded:!gn}}}function ui(Kt,O,pt){return O*(i.X/(Kt.tileSize*Math.pow(2,pt-Kt.tileID.overscaledZ)))}class yi{constructor(O,pt,Dt,Ft){this.opacity=O?Math.max(0,Math.min(1,O.opacity+(O.placed?pt:-pt))):Ft&&Dt?1:0,this.placed=Dt}isHidden(){return this.opacity===0&&!this.placed}}class Gi{constructor(O,pt,Dt,Ft,qt){this.text=new yi(O?O.text:null,pt,Dt,qt),this.icon=new yi(O?O.icon:null,pt,Ft,qt)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ci{constructor(O,pt,Dt){this.text=O,this.icon=pt,this.skipFade=Dt}}class fi{constructor(){this.invProjMatrix=i.H(),this.viewportMatrix=i.H(),this.circles=[]}}class ba{constructor(O,pt,Dt,Ft,qt){this.bucketInstanceId=O,this.featureIndex=pt,this.sourceLayerIndex=Dt,this.bucketIndex=Ft,this.tileID=qt}}class oa{constructor(O){this.crossSourceCollisions=O,this.maxGroupID=0,this.collisionGroups={}}get(O){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[O]){let pt=++this.maxGroupID;this.collisionGroups[O]={ID:pt,predicate:Dt=>Dt.collisionGroupID===pt}}return this.collisionGroups[O]}}function Ke(Kt,O,pt,Dt,Ft){let{horizontalAlign:qt,verticalAlign:Ee}=i.au(Kt);return new i.P(-(qt-.5)*O+Dt[0]*Ft,-(Ee-.5)*pt+Dt[1]*Ft)}class sr{constructor(O,pt,Dt,Ft,qt,Ee){this.transform=O.clone(),this.terrain=Dt,this.collisionIndex=new ci(this.transform,pt),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Ft,this.retainedQueryData={},this.collisionGroups=new oa(qt),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=Ee,Ee&&(Ee.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(O){let pt=this.terrain;return pt?(Dt,Ft)=>pt.getElevation(O,Dt,Ft):null}getBucketParts(O,pt,Dt,Ft){let qt=Dt.getBucket(pt),Ee=Dt.latestFeatureIndex;if(!qt||!Ee||pt.id!==qt.layerIds[0])return;let je=Dt.collisionBoxArray,er=qt.layers[0].layout,wr=qt.layers[0].paint,Gr=Math.pow(2,this.transform.zoom-Dt.tileID.overscaledZ),Zr=Dt.tileSize/i.X,Tn=Dt.tileID.toUnwrapped(),qn=this.transform.calculatePosMatrix(Tn),te=er.get("text-pitch-alignment")==="map",le=er.get("text-rotation-alignment")==="map",Te=ui(Dt,1,this.transform.zoom),Pe=this.collisionIndex.mapProjection.translatePosition(this.transform,Dt,wr.get("text-translate"),wr.get("text-translate-anchor")),We=this.collisionIndex.mapProjection.translatePosition(this.transform,Dt,wr.get("icon-translate"),wr.get("icon-translate-anchor")),Ne=dn(qn,te,le,this.transform,Te),Xe=null;if(te){let qr=_n(qn,te,le,this.transform,Te);Xe=i.L([],this.transform.labelPlaneMatrix,qr)}this.retainedQueryData[qt.bucketInstanceId]=new ba(qt.bucketInstanceId,Ee,qt.sourceLayerIndex,qt.index,Dt.tileID);let Pr={bucket:qt,layout:er,translationText:Pe,translationIcon:We,posMatrix:qn,unwrappedTileID:Tn,textLabelPlaneMatrix:Ne,labelToScreenMatrix:Xe,scale:Gr,textPixelRatio:Zr,holdingForFade:Dt.holdingForFade(),collisionBoxArray:je,partiallyEvaluatedTextSize:i.ag(qt.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(qt.sourceID)};if(Ft)for(let qr of qt.sortKeyRanges){let{sortKey:Xr,symbolInstanceStart:gn,symbolInstanceEnd:zn}=qr;O.push({sortKey:Xr,symbolInstanceStart:gn,symbolInstanceEnd:zn,parameters:Pr})}else O.push({symbolInstanceStart:0,symbolInstanceEnd:qt.symbolInstances.length,parameters:Pr})}attemptAnchorPlacement(O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te,le,Te,Pe,We,Ne){let Xe=i.aq[O.textAnchor],Pr=[O.textOffset0,O.textOffset1],qr=Ke(Xe,Dt,Ft,Pr,qt),Xr=this.collisionIndex.placeCollisionBox(pt,Tn,er,wr,Gr,je,Ee,Te,Zr.predicate,Ne,qr);if((!We||this.collisionIndex.placeCollisionBox(We,Tn,er,wr,Gr,je,Ee,Pe,Zr.predicate,Ne,qr).placeable)&&Xr.placeable){let gn;if(this.prevPlacement&&this.prevPlacement.variableOffsets[qn.crossTileID]&&this.prevPlacement.placements[qn.crossTileID]&&this.prevPlacement.placements[qn.crossTileID].text&&(gn=this.prevPlacement.variableOffsets[qn.crossTileID].anchor),qn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[qn.crossTileID]={textOffset:Pr,width:Dt,height:Ft,anchor:Xe,textBoxScale:qt,prevAnchor:gn},this.markUsedJustification(te,Xe,qn,le),te.allowVerticalPlacement&&(this.markUsedOrientation(te,le,qn),this.placedOrientations[qn.crossTileID]=le),{shift:qr,placedGlyphBoxes:Xr}}}placeLayerBucketPart(O,pt,Dt){let{bucket:Ft,layout:qt,translationText:Ee,translationIcon:je,posMatrix:er,unwrappedTileID:wr,textLabelPlaneMatrix:Gr,labelToScreenMatrix:Zr,textPixelRatio:Tn,holdingForFade:qn,collisionBoxArray:te,partiallyEvaluatedTextSize:le,collisionGroup:Te}=O.parameters,Pe=qt.get("text-optional"),We=qt.get("icon-optional"),Ne=i.ar(qt,"text-overlap","text-allow-overlap"),Xe=Ne==="always",Pr=i.ar(qt,"icon-overlap","icon-allow-overlap"),qr=Pr==="always",Xr=qt.get("text-rotation-alignment")==="map",gn=qt.get("text-pitch-alignment")==="map",zn=qt.get("icon-text-fit")!=="none",Qn=qt.get("symbol-z-order")==="viewport-y",ai=Xe&&(qr||!Ft.hasIconData()||We),Ti=qr&&(Xe||!Ft.hasTextData()||Pe);!Ft.collisionArrays&&te&&Ft.deserializeCollisionBoxes(te);let Qi=this._getTerrainElevationFunc(this.retainedQueryData[Ft.bucketInstanceId].tileID),Ma=(Aa,Fa,wo)=>{var Yo,Fo;if(pt[Aa.crossTileID])return;if(qn)return void(this.placements[Aa.crossTileID]=new Ci(!1,!1,!1));let xs=!1,Sl=!1,Ll=!0,Ws=null,zl={box:null,placeable:!1,offscreen:null},Fc={placeable:!1},Sc=null,rl=null,nl=null,au=0,wu=0,ih=0;Fa.textFeatureIndex?au=Fa.textFeatureIndex:Aa.useRuntimeCollisionCircles&&(au=Aa.featureIndex),Fa.verticalTextFeatureIndex&&(wu=Fa.verticalTextFeatureIndex);let Et=Fa.textBox;if(Et){let Be=Fr=>{let vn=i.ah.horizontal;if(Ft.allowVerticalPlacement&&!Fr&&this.prevPlacement){let fn=this.prevPlacement.placedOrientations[Aa.crossTileID];fn&&(this.placedOrientations[Aa.crossTileID]=fn,vn=fn,this.markUsedOrientation(Ft,vn,Aa))}return vn},He=(Fr,vn)=>{if(Ft.allowVerticalPlacement&&Aa.numVerticalGlyphVertices>0&&Fa.verticalTextBox){for(let fn of Ft.writingModes)if(fn===i.ah.vertical?(zl=vn(),Fc=zl):zl=Fr(),zl&&zl.placeable)break}else zl=Fr()},hr=Aa.textAnchorOffsetStartIndex,cr=Aa.textAnchorOffsetEndIndex;if(cr===hr){let Fr=(vn,fn)=>{let Bn=this.collisionIndex.placeCollisionBox(vn,Ne,Tn,er,wr,gn,Xr,Ee,Te.predicate,Qi);return Bn&&Bn.placeable&&(this.markUsedOrientation(Ft,fn,Aa),this.placedOrientations[Aa.crossTileID]=fn),Bn};He(()=>Fr(Et,i.ah.horizontal),()=>{let vn=Fa.verticalTextBox;return Ft.allowVerticalPlacement&&Aa.numVerticalGlyphVertices>0&&vn?Fr(vn,i.ah.vertical):{box:null,offscreen:null}}),Be(zl&&zl.placeable)}else{let Fr=i.aq[(Fo=(Yo=this.prevPlacement)===null||Yo===void 0?void 0:Yo.variableOffsets[Aa.crossTileID])===null||Fo===void 0?void 0:Fo.anchor],vn=(Bn,ti,ei)=>{let ra=Bn.x2-Bn.x1,si=Bn.y2-Bn.y1,Oi=Aa.textBoxScale,$i=zn&&Pr==="never"?ti:null,Ki=null,sa=Ne==="never"?1:2,vi="never";Fr&&sa++;for(let ro=0;rovn(Et,Fa.iconBox,i.ah.horizontal),()=>{let Bn=Fa.verticalTextBox;return Ft.allowVerticalPlacement&&(!zl||!zl.placeable)&&Aa.numVerticalGlyphVertices>0&&Bn?vn(Bn,Fa.verticalIconBox,i.ah.vertical):{box:null,occluded:!0,offscreen:null}}),zl&&(xs=zl.placeable,Ll=zl.offscreen);let fn=Be(zl&&zl.placeable);if(!xs&&this.prevPlacement){let Bn=this.prevPlacement.variableOffsets[Aa.crossTileID];Bn&&(this.variableOffsets[Aa.crossTileID]=Bn,this.markUsedJustification(Ft,Bn.anchor,Aa,fn))}}}if(Sc=zl,xs=Sc&&Sc.placeable,Ll=Sc&&Sc.offscreen,Aa.useRuntimeCollisionCircles){let Be=Ft.text.placedSymbolArray.get(Aa.centerJustifiedTextSymbolIndex),He=i.ai(Ft.textSizeData,le,Be),hr=qt.get("text-padding");rl=this.collisionIndex.placeCollisionCircles(Ne,Be,Ft.lineVertexArray,Ft.glyphOffsetArray,He,er,wr,Gr,Zr,Dt,gn,Te.predicate,Aa.collisionCircleDiameter,hr,Ee,Qi),rl.circles.length&&rl.collisionDetected&&!Dt&&i.w("Collisions detected, but collision boxes are not shown"),xs=Xe||rl.circles.length>0&&!rl.collisionDetected,Ll=Ll&&rl.offscreen}if(Fa.iconFeatureIndex&&(ih=Fa.iconFeatureIndex),Fa.iconBox){let Be=He=>this.collisionIndex.placeCollisionBox(He,Pr,Tn,er,wr,gn,Xr,je,Te.predicate,Qi,zn&&Ws?Ws:void 0);Fc&&Fc.placeable&&Fa.verticalIconBox?(nl=Be(Fa.verticalIconBox),Sl=nl.placeable):(nl=Be(Fa.iconBox),Sl=nl.placeable),Ll=Ll&&nl.offscreen}let Vt=Pe||Aa.numHorizontalGlyphVertices===0&&Aa.numVerticalGlyphVertices===0,de=We||Aa.numIconVertices===0;Vt||de?de?Vt||(Sl=Sl&&xs):xs=Sl&&xs:Sl=xs=Sl&&xs;let Ie=Sl&&nl.placeable;if(xs&&Sc.placeable&&this.collisionIndex.insertCollisionBox(Sc.box,Ne,qt.get("text-ignore-placement"),Ft.bucketInstanceId,Fc&&Fc.placeable&&wu?wu:au,Te.ID),Ie&&this.collisionIndex.insertCollisionBox(nl.box,Pr,qt.get("icon-ignore-placement"),Ft.bucketInstanceId,ih,Te.ID),rl&&xs&&this.collisionIndex.insertCollisionCircles(rl.circles,Ne,qt.get("text-ignore-placement"),Ft.bucketInstanceId,au,Te.ID),Dt&&this.storeCollisionData(Ft.bucketInstanceId,wo,Fa,Sc,nl,rl),Aa.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Ft.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Aa.crossTileID]=new Ci(xs||ai,Sl||Ti,Ll||Ft.justReloaded),pt[Aa.crossTileID]=!0};if(Qn){if(O.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Aa=Ft.getSortedSymbolIndexes(this.transform.angle);for(let Fa=Aa.length-1;Fa>=0;--Fa){let wo=Aa[Fa];Ma(Ft.symbolInstances.get(wo),Ft.collisionArrays[wo],wo)}}else for(let Aa=O.symbolInstanceStart;Aa=0&&(O.text.placedSymbolArray.get(je).crossTileID=qt>=0&&je!==qt?0:Dt.crossTileID)}markUsedOrientation(O,pt,Dt){let Ft=pt===i.ah.horizontal||pt===i.ah.horizontalOnly?pt:0,qt=pt===i.ah.vertical?pt:0,Ee=[Dt.leftJustifiedTextSymbolIndex,Dt.centerJustifiedTextSymbolIndex,Dt.rightJustifiedTextSymbolIndex];for(let je of Ee)O.text.placedSymbolArray.get(je).placedOrientation=Ft;Dt.verticalPlacedTextSymbolIndex&&(O.text.placedSymbolArray.get(Dt.verticalPlacedTextSymbolIndex).placedOrientation=qt)}commit(O){this.commitTime=O,this.zoomAtLastRecencyCheck=this.transform.zoom;let pt=this.prevPlacement,Dt=!1;this.prevZoomAdjustment=pt?pt.zoomAdjustment(this.transform.zoom):0;let Ft=pt?pt.symbolFadeChange(O):1,qt=pt?pt.opacities:{},Ee=pt?pt.variableOffsets:{},je=pt?pt.placedOrientations:{};for(let er in this.placements){let wr=this.placements[er],Gr=qt[er];Gr?(this.opacities[er]=new Gi(Gr,Ft,wr.text,wr.icon),Dt=Dt||wr.text!==Gr.text.placed||wr.icon!==Gr.icon.placed):(this.opacities[er]=new Gi(null,Ft,wr.text,wr.icon,wr.skipFade),Dt=Dt||wr.text||wr.icon)}for(let er in qt){let wr=qt[er];if(!this.opacities[er]){let Gr=new Gi(wr,Ft,!1,!1);Gr.isHidden()||(this.opacities[er]=Gr,Dt=Dt||wr.text.placed||wr.icon.placed)}}for(let er in Ee)this.variableOffsets[er]||!this.opacities[er]||this.opacities[er].isHidden()||(this.variableOffsets[er]=Ee[er]);for(let er in je)this.placedOrientations[er]||!this.opacities[er]||this.opacities[er].isHidden()||(this.placedOrientations[er]=je[er]);if(pt&&pt.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Dt?this.lastPlacementChangeTime=O:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=pt?pt.lastPlacementChangeTime:O)}updateLayerOpacities(O,pt){let Dt={};for(let Ft of pt){let qt=Ft.getBucket(O);qt&&Ft.latestFeatureIndex&&O.id===qt.layerIds[0]&&this.updateBucketOpacities(qt,Ft.tileID,Dt,Ft.collisionBoxArray)}}updateBucketOpacities(O,pt,Dt,Ft){O.hasTextData()&&(O.text.opacityVertexArray.clear(),O.text.hasVisibleVertices=!1),O.hasIconData()&&(O.icon.opacityVertexArray.clear(),O.icon.hasVisibleVertices=!1),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexArray.clear(),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexArray.clear();let qt=O.layers[0],Ee=qt.layout,je=new Gi(null,0,!1,!1,!0),er=Ee.get("text-allow-overlap"),wr=Ee.get("icon-allow-overlap"),Gr=qt._unevaluatedLayout.hasValue("text-variable-anchor")||qt._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Zr=Ee.get("text-rotation-alignment")==="map",Tn=Ee.get("text-pitch-alignment")==="map",qn=Ee.get("icon-text-fit")!=="none",te=new Gi(null,0,er&&(wr||!O.hasIconData()||Ee.get("icon-optional")),wr&&(er||!O.hasTextData()||Ee.get("text-optional")),!0);!O.collisionArrays&&Ft&&(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData())&&O.deserializeCollisionBoxes(Ft);let le=(Pe,We,Ne)=>{for(let Xe=0;Xe0,gn=this.placedOrientations[We.crossTileID],zn=gn===i.ah.vertical,Qn=gn===i.ah.horizontal||gn===i.ah.horizontalOnly;if(Ne>0||Xe>0){let Ti=Zi(qr.text);le(O.text,Ne,zn?Ji:Ti),le(O.text,Xe,Qn?Ji:Ti);let Qi=qr.text.isHidden();[We.rightJustifiedTextSymbolIndex,We.centerJustifiedTextSymbolIndex,We.leftJustifiedTextSymbolIndex].forEach(Fa=>{Fa>=0&&(O.text.placedSymbolArray.get(Fa).hidden=Qi||zn?1:0)}),We.verticalPlacedTextSymbolIndex>=0&&(O.text.placedSymbolArray.get(We.verticalPlacedTextSymbolIndex).hidden=Qi||Qn?1:0);let Ma=this.variableOffsets[We.crossTileID];Ma&&this.markUsedJustification(O,Ma.anchor,We,gn);let Aa=this.placedOrientations[We.crossTileID];Aa&&(this.markUsedJustification(O,"left",We,Aa),this.markUsedOrientation(O,Aa,We))}if(Xr){let Ti=Zi(qr.icon),Qi=!(qn&&We.verticalPlacedIconSymbolIndex&&zn);We.placedIconSymbolIndex>=0&&(le(O.icon,We.numIconVertices,Qi?Ti:Ji),O.icon.placedSymbolArray.get(We.placedIconSymbolIndex).hidden=qr.icon.isHidden()),We.verticalPlacedIconSymbolIndex>=0&&(le(O.icon,We.numVerticalIconVertices,Qi?Ji:Ti),O.icon.placedSymbolArray.get(We.verticalPlacedIconSymbolIndex).hidden=qr.icon.isHidden())}let ai=Te&&Te.has(Pe)?Te.get(Pe):{text:null,icon:null};if(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData()){let Ti=O.collisionArrays[Pe];if(Ti){let Qi=new i.P(0,0);if(Ti.textBox||Ti.verticalTextBox){let Ma=!0;if(Gr){let Aa=this.variableOffsets[Pr];Aa?(Qi=Ke(Aa.anchor,Aa.width,Aa.height,Aa.textOffset,Aa.textBoxScale),Zr&&Qi._rotate(Tn?this.transform.angle:-this.transform.angle)):Ma=!1}if(Ti.textBox||Ti.verticalTextBox){let Aa;Ti.textBox&&(Aa=zn),Ti.verticalTextBox&&(Aa=Qn),vr(O.textCollisionBox.collisionVertexArray,qr.text.placed,!Ma||Aa,ai.text,Qi.x,Qi.y)}}if(Ti.iconBox||Ti.verticalIconBox){let Ma=!!(!Qn&&Ti.verticalIconBox),Aa;Ti.iconBox&&(Aa=Ma),Ti.verticalIconBox&&(Aa=!Ma),vr(O.iconCollisionBox.collisionVertexArray,qr.icon.placed,Aa,ai.icon,qn?Qi.x:0,qn?Qi.y:0)}}}}if(O.sortFeatures(this.transform.angle),this.retainedQueryData[O.bucketInstanceId]&&(this.retainedQueryData[O.bucketInstanceId].featureSortOrder=O.featureSortOrder),O.hasTextData()&&O.text.opacityVertexBuffer&&O.text.opacityVertexBuffer.updateData(O.text.opacityVertexArray),O.hasIconData()&&O.icon.opacityVertexBuffer&&O.icon.opacityVertexBuffer.updateData(O.icon.opacityVertexArray),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexBuffer&&O.iconCollisionBox.collisionVertexBuffer.updateData(O.iconCollisionBox.collisionVertexArray),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexBuffer&&O.textCollisionBox.collisionVertexBuffer.updateData(O.textCollisionBox.collisionVertexArray),O.text.opacityVertexArray.length!==O.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${O.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${O.text.layoutVertexArray.length}) / 4`);if(O.icon.opacityVertexArray.length!==O.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${O.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${O.icon.layoutVertexArray.length}) / 4`);if(O.bucketInstanceId in this.collisionCircleArrays){let Pe=this.collisionCircleArrays[O.bucketInstanceId];O.placementInvProjMatrix=Pe.invProjMatrix,O.placementViewportMatrix=Pe.viewportMatrix,O.collisionCircleArray=Pe.circles,delete this.collisionCircleArrays[O.bucketInstanceId]}}symbolFadeChange(O){return this.fadeDuration===0?1:(O-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(O){return Math.max(0,(this.transform.zoom-O)/1.5)}hasTransitions(O){return this.stale||O-this.lastPlacementChangeTimeO}setStale(){this.stale=!0}}function vr(Kt,O,pt,Dt,Ft,qt){Dt&&Dt.length!==0||(Dt=[0,0,0,0]);let Ee=Dt[0]-pn,je=Dt[1]-pn,er=Dt[2]-pn,wr=Dt[3]-pn;Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,Ee,je),Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,er,je),Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,er,wr),Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,Ee,wr)}let Ar=Math.pow(2,25),mn=Math.pow(2,24),Zn=Math.pow(2,17),Un=Math.pow(2,16),Wn=Math.pow(2,9),Li=Math.pow(2,8),Fi=Math.pow(2,1);function Zi(Kt){if(Kt.opacity===0&&!Kt.placed)return 0;if(Kt.opacity===1&&Kt.placed)return 4294967295;let O=Kt.placed?1:0,pt=Math.floor(127*Kt.opacity);return pt*Ar+O*mn+pt*Zn+O*Un+pt*Wn+O*Li+pt*Fi+O}let Ji=0;function ca(){return{isOccluded:(Kt,O,pt)=>!1,getPitchedTextCorrection:(Kt,O,pt)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Kt,O,pt,Dt){throw new Error("Not implemented.")},translatePosition:(Kt,O,pt,Dt)=>function(Ft,qt,Ee,je,er=!1){if(!Ee[0]&&!Ee[1])return[0,0];let wr=er?je==="map"?Ft.angle:0:je==="viewport"?-Ft.angle:0;if(wr){let Gr=Math.sin(wr),Zr=Math.cos(wr);Ee=[Ee[0]*Zr-Ee[1]*Gr,Ee[0]*Gr+Ee[1]*Zr]}return[er?Ee[0]:ui(qt,Ee[0],Ft.zoom),er?Ee[1]:ui(qt,Ee[1],Ft.zoom)]}(Kt,O,pt,Dt),getCircleRadiusCorrection:Kt=>1}}class Ei{constructor(O){this._sortAcrossTiles=O.layout.get("symbol-z-order")!=="viewport-y"&&!O.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(O,pt,Dt,Ft,qt){let Ee=this._bucketParts;for(;this._currentTileIndexje.sortKey-er.sortKey));this._currentPartIndex!this._forceFullPlacement&&c.now()-Ft>2;for(;this._currentPlacementIndex>=0;){let Ee=pt[O[this._currentPlacementIndex]],je=this.placement.collisionIndex.transform.zoom;if(Ee.type==="symbol"&&(!Ee.minzoom||Ee.minzoom<=je)&&(!Ee.maxzoom||Ee.maxzoom>je)){if(this._inProgressLayer||(this._inProgressLayer=new Ei(Ee)),this._inProgressLayer.continuePlacement(Dt[Ee.source],this.placement,this._showCollisionBoxes,Ee,qt))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(O){return this.placement.commit(O),this.placement}}let so=512/i.X/2;class Fe{constructor(O,pt,Dt){this.tileID=O,this.bucketInstanceId=Dt,this._symbolsByKey={};let Ft=new Map;for(let qt=0;qt({x:Math.floor(er.anchorX*so),y:Math.floor(er.anchorY*so)})),crossTileIDs:Ee.map(er=>er.crossTileID)};if(je.positions.length>128){let er=new i.av(je.positions.length,16,Uint16Array);for(let{x:wr,y:Gr}of je.positions)er.add(wr,Gr);er.finish(),delete je.positions,je.index=er}this._symbolsByKey[qt]=je}}getScaledCoordinates(O,pt){let{x:Dt,y:Ft,z:qt}=this.tileID.canonical,{x:Ee,y:je,z:er}=pt.canonical,wr=so/Math.pow(2,er-qt),Gr=(je*i.X+O.anchorY)*wr,Zr=Ft*i.X*so;return{x:Math.floor((Ee*i.X+O.anchorX)*wr-Dt*i.X*so),y:Math.floor(Gr-Zr)}}findMatches(O,pt,Dt){let Ft=this.tileID.canonical.zO)}}class Re{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Kr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(O){let pt=Math.round((O-this.lng)/360);if(pt!==0)for(let Dt in this.indexes){let Ft=this.indexes[Dt],qt={};for(let Ee in Ft){let je=Ft[Ee];je.tileID=je.tileID.unwrapTo(je.tileID.wrap+pt),qt[je.tileID.key]=je}this.indexes[Dt]=qt}this.lng=O}addBucket(O,pt,Dt){if(this.indexes[O.overscaledZ]&&this.indexes[O.overscaledZ][O.key]){if(this.indexes[O.overscaledZ][O.key].bucketInstanceId===pt.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(O.overscaledZ,this.indexes[O.overscaledZ][O.key])}for(let qt=0;qtO.overscaledZ)for(let je in Ee){let er=Ee[je];er.tileID.isChildOf(O)&&er.findMatches(pt.symbolInstances,O,Ft)}else{let je=Ee[O.scaledTo(Number(qt)).key];je&&je.findMatches(pt.symbolInstances,O,Ft)}}for(let qt=0;qt{pt[Dt]=!0});for(let Dt in this.layerIndexes)pt[Dt]||delete this.layerIndexes[Dt]}}let cn=(Kt,O)=>i.t(Kt,O&&O.filter(pt=>pt.identifier!=="source.canvas")),Yr=i.aw();class un extends i.E{constructor(O,pt={}){super(),this._rtlPluginLoaded=()=>{for(let Dt in this.sourceCaches){let Ft=this.sourceCaches[Dt].getSource().type;Ft!=="vector"&&Ft!=="geojson"||this.sourceCaches[Dt].reload()}},this.map=O,this.dispatcher=new it(gt(),O._getMapId()),this.dispatcher.registerMessageHandler("GG",(Dt,Ft)=>this.getGlyphs(Dt,Ft)),this.dispatcher.registerMessageHandler("GI",(Dt,Ft)=>this.getImages(Dt,Ft)),this.imageManager=new S,this.imageManager.setEventedParent(this),this.glyphManager=new V(O._requestManager,pt.localIdeographFontFamily),this.lineAtlas=new tt(256,512),this.crossTileSymbolIndex=new sn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new i.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",i.ay()),be().on(Ot,this._rtlPluginLoaded),this.on("data",Dt=>{if(Dt.dataType!=="source"||Dt.sourceDataType!=="metadata")return;let Ft=this.sourceCaches[Dt.sourceId];if(!Ft)return;let qt=Ft.getSource();if(qt&&qt.vectorLayerIds)for(let Ee in this._layers){let je=this._layers[Ee];je.source===qt.id&&this._validateLayer(je)}})}loadURL(O,pt={},Dt){this.fire(new i.k("dataloading",{dataType:"style"})),pt.validate=typeof pt.validate!="boolean"||pt.validate;let Ft=this.map._requestManager.transformRequest(O,"Style");this._loadStyleRequest=new AbortController;let qt=this._loadStyleRequest;i.h(Ft,this._loadStyleRequest).then(Ee=>{this._loadStyleRequest=null,this._load(Ee.data,pt,Dt)}).catch(Ee=>{this._loadStyleRequest=null,Ee&&!qt.signal.aborted&&this.fire(new i.j(Ee))})}loadJSON(O,pt={},Dt){this.fire(new i.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,c.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,pt.validate=pt.validate!==!1,this._load(O,pt,Dt)}).catch(()=>{})}loadEmpty(){this.fire(new i.k("dataloading",{dataType:"style"})),this._load(Yr,{validate:!1})}_load(O,pt,Dt){var Ft;let qt=pt.transformStyle?pt.transformStyle(Dt,O):O;if(!pt.validate||!cn(this,i.u(qt))){this._loaded=!0,this.stylesheet=qt;for(let Ee in qt.sources)this.addSource(Ee,qt.sources[Ee],{validate:!1});qt.sprite?this._loadSprite(qt.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(qt.glyphs),this._createLayers(),this.light=new H(this.stylesheet.light),this.sky=new G(this.stylesheet.sky),this.map.setTerrain((Ft=this.stylesheet.terrain)!==null&&Ft!==void 0?Ft:null),this.fire(new i.k("data",{dataType:"style"})),this.fire(new i.k("style.load"))}}_createLayers(){let O=i.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",O),this._order=O.map(pt=>pt.id),this._layers={},this._serializedLayers=null;for(let pt of O){let Dt=i.aA(pt);Dt.setEventedParent(this,{layer:{id:pt.id}}),this._layers[pt.id]=Dt}}_loadSprite(O,pt=!1,Dt=void 0){let Ft;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(qt,Ee,je,er){return i._(this,void 0,void 0,function*(){let wr=M(qt),Gr=je>1?"@2x":"",Zr={},Tn={};for(let{id:qn,url:te}of wr){let le=Ee.transformRequest(p(te,Gr,".json"),"SpriteJSON");Zr[qn]=i.h(le,er);let Te=Ee.transformRequest(p(te,Gr,".png"),"SpriteImage");Tn[qn]=d.getImage(Te,er)}return yield Promise.all([...Object.values(Zr),...Object.values(Tn)]),function(qn,te){return i._(this,void 0,void 0,function*(){let le={};for(let Te in qn){le[Te]={};let Pe=c.getImageCanvasContext((yield te[Te]).data),We=(yield qn[Te]).data;for(let Ne in We){let{width:Xe,height:Pr,x:qr,y:Xr,sdf:gn,pixelRatio:zn,stretchX:Qn,stretchY:ai,content:Ti,textFitWidth:Qi,textFitHeight:Ma}=We[Ne];le[Te][Ne]={data:null,pixelRatio:zn,sdf:gn,stretchX:Qn,stretchY:ai,content:Ti,textFitWidth:Qi,textFitHeight:Ma,spriteData:{width:Xe,height:Pr,x:qr,y:Xr,context:Pe}}}}return le})}(Zr,Tn)})}(O,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(qt=>{if(this._spriteRequest=null,qt)for(let Ee in qt){this._spritesImagesIds[Ee]=[];let je=this._spritesImagesIds[Ee]?this._spritesImagesIds[Ee].filter(er=>!(er in qt)):[];for(let er of je)this.imageManager.removeImage(er),this._changedImages[er]=!0;for(let er in qt[Ee]){let wr=Ee==="default"?er:`${Ee}:${er}`;this._spritesImagesIds[Ee].push(wr),wr in this.imageManager.images?this.imageManager.updateImage(wr,qt[Ee][er],!1):this.imageManager.addImage(wr,qt[Ee][er]),pt&&(this._changedImages[wr]=!0)}}}).catch(qt=>{this._spriteRequest=null,Ft=qt,this.fire(new i.j(Ft))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),pt&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"})),Dt&&Dt(Ft)})}_unloadSprite(){for(let O of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(O),this._changedImages[O]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"}))}_validateLayer(O){let pt=this.sourceCaches[O.source];if(!pt)return;let Dt=O.sourceLayer;if(!Dt)return;let Ft=pt.getSource();(Ft.type==="geojson"||Ft.vectorLayerIds&&Ft.vectorLayerIds.indexOf(Dt)===-1)&&this.fire(new i.j(new Error(`Source layer "${Dt}" does not exist on source "${Ft.id}" as specified by style layer "${O.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let O in this.sourceCaches)if(!this.sourceCaches[O].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(O,pt=!1){let Dt=this._serializedAllLayers();if(!O||O.length===0)return Object.values(pt?i.aB(Dt):Dt);let Ft=[];for(let qt of O)if(Dt[qt]){let Ee=pt?i.aB(Dt[qt]):Dt[qt];Ft.push(Ee)}return Ft}_serializedAllLayers(){let O=this._serializedLayers;if(O)return O;O=this._serializedLayers={};let pt=Object.keys(this._layers);for(let Dt of pt){let Ft=this._layers[Dt];Ft.type!=="custom"&&(O[Dt]=Ft.serialize())}return O}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let O in this.sourceCaches)if(this.sourceCaches[O].hasTransition())return!0;for(let O in this._layers)if(this._layers[O].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(O){if(!this._loaded)return;let pt=this._changed;if(pt){let Ft=Object.keys(this._updatedLayers),qt=Object.keys(this._removedLayers);(Ft.length||qt.length)&&this._updateWorkerLayers(Ft,qt);for(let Ee in this._updatedSources){let je=this._updatedSources[Ee];if(je==="reload")this._reloadSource(Ee);else{if(je!=="clear")throw new Error(`Invalid action ${je}`);this._clearSource(Ee)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let Ee in this._updatedPaintProps)this._layers[Ee].updateTransitions(O);this.light.updateTransitions(O),this.sky.updateTransitions(O),this._resetUpdates()}let Dt={};for(let Ft in this.sourceCaches){let qt=this.sourceCaches[Ft];Dt[Ft]=qt.used,qt.used=!1}for(let Ft of this._order){let qt=this._layers[Ft];qt.recalculate(O,this._availableImages),!qt.isHidden(O.zoom)&&qt.source&&(this.sourceCaches[qt.source].used=!0)}for(let Ft in Dt){let qt=this.sourceCaches[Ft];!!Dt[Ft]!=!!qt.used&&qt.fire(new i.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Ft}))}this.light.recalculate(O),this.sky.recalculate(O),this.z=O.zoom,pt&&this.fire(new i.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let O=Object.keys(this._changedImages);if(O.length){for(let pt in this.sourceCaches)this.sourceCaches[pt].reloadTilesForDependencies(["icons","patterns"],O);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let O in this.sourceCaches)this.sourceCaches[O].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(O,pt){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(O,!1),removedIds:pt})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(O,pt={}){var Dt;this._checkLoaded();let Ft=this.serialize();if(O=pt.transformStyle?pt.transformStyle(Ft,O):O,((Dt=pt.validate)===null||Dt===void 0||Dt)&&cn(this,i.u(O)))return!1;(O=i.aB(O)).layers=i.az(O.layers);let qt=i.aC(Ft,O),Ee=this._getOperationsToPerform(qt);if(Ee.unimplemented.length>0)throw new Error(`Unimplemented: ${Ee.unimplemented.join(", ")}.`);if(Ee.operations.length===0)return!1;for(let je of Ee.operations)je();return this.stylesheet=O,this._serializedLayers=null,!0}_getOperationsToPerform(O){let pt=[],Dt=[];for(let Ft of O)switch(Ft.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":pt.push(()=>this.addLayer.apply(this,Ft.args));break;case"removeLayer":pt.push(()=>this.removeLayer.apply(this,Ft.args));break;case"setPaintProperty":pt.push(()=>this.setPaintProperty.apply(this,Ft.args));break;case"setLayoutProperty":pt.push(()=>this.setLayoutProperty.apply(this,Ft.args));break;case"setFilter":pt.push(()=>this.setFilter.apply(this,Ft.args));break;case"addSource":pt.push(()=>this.addSource.apply(this,Ft.args));break;case"removeSource":pt.push(()=>this.removeSource.apply(this,Ft.args));break;case"setLayerZoomRange":pt.push(()=>this.setLayerZoomRange.apply(this,Ft.args));break;case"setLight":pt.push(()=>this.setLight.apply(this,Ft.args));break;case"setGeoJSONSourceData":pt.push(()=>this.setGeoJSONSourceData.apply(this,Ft.args));break;case"setGlyphs":pt.push(()=>this.setGlyphs.apply(this,Ft.args));break;case"setSprite":pt.push(()=>this.setSprite.apply(this,Ft.args));break;case"setSky":pt.push(()=>this.setSky.apply(this,Ft.args));break;case"setTerrain":pt.push(()=>this.map.setTerrain.apply(this,Ft.args));break;case"setTransition":pt.push(()=>{});break;default:Dt.push(Ft.command)}return{operations:pt,unimplemented:Dt}}addImage(O,pt){if(this.getImage(O))return this.fire(new i.j(new Error(`An image named "${O}" already exists.`)));this.imageManager.addImage(O,pt),this._afterImageUpdated(O)}updateImage(O,pt){this.imageManager.updateImage(O,pt)}getImage(O){return this.imageManager.getImage(O)}removeImage(O){if(!this.getImage(O))return this.fire(new i.j(new Error(`An image named "${O}" does not exist.`)));this.imageManager.removeImage(O),this._afterImageUpdated(O)}_afterImageUpdated(O){this._availableImages=this.imageManager.listImages(),this._changedImages[O]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(O,pt,Dt={}){if(this._checkLoaded(),this.sourceCaches[O]!==void 0)throw new Error(`Source "${O}" already exists.`);if(!pt.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(pt).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(pt.type)>=0&&this._validate(i.u.source,`sources.${O}`,pt,null,Dt))return;this.map&&this.map._collectResourceTiming&&(pt.collectResourceTiming=!0);let Ft=this.sourceCaches[O]=new Qe(O,pt,this.dispatcher);Ft.style=this,Ft.setEventedParent(this,()=>({isSourceLoaded:Ft.loaded(),source:Ft.serialize(),sourceId:O})),Ft.onAdd(this.map),this._changed=!0}removeSource(O){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error("There is no source with this ID");for(let Dt in this._layers)if(this._layers[Dt].source===O)return this.fire(new i.j(new Error(`Source "${O}" cannot be removed while layer "${Dt}" is using it.`)));let pt=this.sourceCaches[O];delete this.sourceCaches[O],delete this._updatedSources[O],pt.fire(new i.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:O})),pt.setEventedParent(null),pt.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(O,pt){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error(`There is no source with this ID=${O}`);let Dt=this.sourceCaches[O].getSource();if(Dt.type!=="geojson")throw new Error(`geojsonSource.type is ${Dt.type}, which is !== 'geojson`);Dt.setData(pt),this._changed=!0}getSource(O){return this.sourceCaches[O]&&this.sourceCaches[O].getSource()}addLayer(O,pt,Dt={}){this._checkLoaded();let Ft=O.id;if(this.getLayer(Ft))return void this.fire(new i.j(new Error(`Layer "${Ft}" already exists on this map.`)));let qt;if(O.type==="custom"){if(cn(this,i.aD(O)))return;qt=i.aA(O)}else{if("source"in O&&typeof O.source=="object"&&(this.addSource(Ft,O.source),O=i.aB(O),O=i.e(O,{source:Ft})),this._validate(i.u.layer,`layers.${Ft}`,O,{arrayIndex:-1},Dt))return;qt=i.aA(O),this._validateLayer(qt),qt.setEventedParent(this,{layer:{id:Ft}})}let Ee=pt?this._order.indexOf(pt):this._order.length;if(pt&&Ee===-1)this.fire(new i.j(new Error(`Cannot add layer "${Ft}" before non-existing layer "${pt}".`)));else{if(this._order.splice(Ee,0,Ft),this._layerOrderChanged=!0,this._layers[Ft]=qt,this._removedLayers[Ft]&&qt.source&&qt.type!=="custom"){let je=this._removedLayers[Ft];delete this._removedLayers[Ft],je.type!==qt.type?this._updatedSources[qt.source]="clear":(this._updatedSources[qt.source]="reload",this.sourceCaches[qt.source].pause())}this._updateLayer(qt),qt.onAdd&&qt.onAdd(this.map)}}moveLayer(O,pt){if(this._checkLoaded(),this._changed=!0,!this._layers[O])return void this.fire(new i.j(new Error(`The layer '${O}' does not exist in the map's style and cannot be moved.`)));if(O===pt)return;let Dt=this._order.indexOf(O);this._order.splice(Dt,1);let Ft=pt?this._order.indexOf(pt):this._order.length;pt&&Ft===-1?this.fire(new i.j(new Error(`Cannot move layer "${O}" before non-existing layer "${pt}".`))):(this._order.splice(Ft,0,O),this._layerOrderChanged=!0)}removeLayer(O){this._checkLoaded();let pt=this._layers[O];if(!pt)return void this.fire(new i.j(new Error(`Cannot remove non-existing layer "${O}".`)));pt.setEventedParent(null);let Dt=this._order.indexOf(O);this._order.splice(Dt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[O]=pt,delete this._layers[O],this._serializedLayers&&delete this._serializedLayers[O],delete this._updatedLayers[O],delete this._updatedPaintProps[O],pt.onRemove&&pt.onRemove(this.map)}getLayer(O){return this._layers[O]}getLayersOrder(){return[...this._order]}hasLayer(O){return O in this._layers}setLayerZoomRange(O,pt,Dt){this._checkLoaded();let Ft=this.getLayer(O);Ft?Ft.minzoom===pt&&Ft.maxzoom===Dt||(pt!=null&&(Ft.minzoom=pt),Dt!=null&&(Ft.maxzoom=Dt),this._updateLayer(Ft)):this.fire(new i.j(new Error(`Cannot set the zoom range of non-existing layer "${O}".`)))}setFilter(O,pt,Dt={}){this._checkLoaded();let Ft=this.getLayer(O);if(Ft){if(!i.aE(Ft.filter,pt))return pt==null?(Ft.filter=void 0,void this._updateLayer(Ft)):void(this._validate(i.u.filter,`layers.${Ft.id}.filter`,pt,null,Dt)||(Ft.filter=i.aB(pt),this._updateLayer(Ft)))}else this.fire(new i.j(new Error(`Cannot filter non-existing layer "${O}".`)))}getFilter(O){return i.aB(this.getLayer(O).filter)}setLayoutProperty(O,pt,Dt,Ft={}){this._checkLoaded();let qt=this.getLayer(O);qt?i.aE(qt.getLayoutProperty(pt),Dt)||(qt.setLayoutProperty(pt,Dt,Ft),this._updateLayer(qt)):this.fire(new i.j(new Error(`Cannot style non-existing layer "${O}".`)))}getLayoutProperty(O,pt){let Dt=this.getLayer(O);if(Dt)return Dt.getLayoutProperty(pt);this.fire(new i.j(new Error(`Cannot get style of non-existing layer "${O}".`)))}setPaintProperty(O,pt,Dt,Ft={}){this._checkLoaded();let qt=this.getLayer(O);qt?i.aE(qt.getPaintProperty(pt),Dt)||(qt.setPaintProperty(pt,Dt,Ft)&&this._updateLayer(qt),this._changed=!0,this._updatedPaintProps[O]=!0,this._serializedLayers=null):this.fire(new i.j(new Error(`Cannot style non-existing layer "${O}".`)))}getPaintProperty(O,pt){return this.getLayer(O).getPaintProperty(pt)}setFeatureState(O,pt){this._checkLoaded();let Dt=O.source,Ft=O.sourceLayer,qt=this.sourceCaches[Dt];if(qt===void 0)return void this.fire(new i.j(new Error(`The source '${Dt}' does not exist in the map's style.`)));let Ee=qt.getSource().type;Ee==="geojson"&&Ft?this.fire(new i.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):Ee!=="vector"||Ft?(O.id===void 0&&this.fire(new i.j(new Error("The feature id parameter must be provided."))),qt.setFeatureState(Ft,O.id,pt)):this.fire(new i.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(O,pt){this._checkLoaded();let Dt=O.source,Ft=this.sourceCaches[Dt];if(Ft===void 0)return void this.fire(new i.j(new Error(`The source '${Dt}' does not exist in the map's style.`)));let qt=Ft.getSource().type,Ee=qt==="vector"?O.sourceLayer:void 0;qt!=="vector"||Ee?pt&&typeof O.id!="string"&&typeof O.id!="number"?this.fire(new i.j(new Error("A feature id is required to remove its specific state property."))):Ft.removeFeatureState(Ee,O.id,pt):this.fire(new i.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(O){this._checkLoaded();let pt=O.source,Dt=O.sourceLayer,Ft=this.sourceCaches[pt];if(Ft!==void 0)return Ft.getSource().type!=="vector"||Dt?(O.id===void 0&&this.fire(new i.j(new Error("The feature id parameter must be provided."))),Ft.getFeatureState(Dt,O.id)):void this.fire(new i.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new i.j(new Error(`The source '${pt}' does not exist in the map's style.`)))}getTransition(){return i.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let O=i.aF(this.sourceCaches,qt=>qt.serialize()),pt=this._serializeByIds(this._order,!0),Dt=this.map.getTerrain()||void 0,Ft=this.stylesheet;return i.aG({version:Ft.version,name:Ft.name,metadata:Ft.metadata,light:Ft.light,sky:Ft.sky,center:Ft.center,zoom:Ft.zoom,bearing:Ft.bearing,pitch:Ft.pitch,sprite:Ft.sprite,glyphs:Ft.glyphs,transition:Ft.transition,sources:O,layers:pt,terrain:Dt},qt=>qt!==void 0)}_updateLayer(O){this._updatedLayers[O.id]=!0,O.source&&!this._updatedSources[O.source]&&this.sourceCaches[O.source].getSource().type!=="raster"&&(this._updatedSources[O.source]="reload",this.sourceCaches[O.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(O){let pt=Ee=>this._layers[Ee].type==="fill-extrusion",Dt={},Ft=[];for(let Ee=this._order.length-1;Ee>=0;Ee--){let je=this._order[Ee];if(pt(je)){Dt[je]=Ee;for(let er of O){let wr=er[je];if(wr)for(let Gr of wr)Ft.push(Gr)}}}Ft.sort((Ee,je)=>je.intersectionZ-Ee.intersectionZ);let qt=[];for(let Ee=this._order.length-1;Ee>=0;Ee--){let je=this._order[Ee];if(pt(je))for(let er=Ft.length-1;er>=0;er--){let wr=Ft[er].feature;if(Dt[wr.layer.id]{let gn=Pe.featureSortOrder;if(gn){let zn=gn.indexOf(qr.featureIndex);return gn.indexOf(Xr.featureIndex)-zn}return Xr.featureIndex-qr.featureIndex});for(let qr of Pr)Xe.push(qr)}}for(let Pe in te)te[Pe].forEach(We=>{let Ne=We.feature,Xe=wr[je[Pe].source].getFeatureState(Ne.layer["source-layer"],Ne.id);Ne.source=Ne.layer.source,Ne.layer["source-layer"]&&(Ne.sourceLayer=Ne.layer["source-layer"]),Ne.state=Xe});return te}(this._layers,Ee,this.sourceCaches,O,pt,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(qt)}querySourceFeatures(O,pt){pt&&pt.filter&&this._validate(i.u.filter,"querySourceFeatures.filter",pt.filter,null,pt);let Dt=this.sourceCaches[O];return Dt?function(Ft,qt){let Ee=Ft.getRenderableIds().map(wr=>Ft.getTileByID(wr)),je=[],er={};for(let wr=0;wrTn.getTileByID(qn)).sort((qn,te)=>te.tileID.overscaledZ-qn.tileID.overscaledZ||(qn.tileID.isLessThan(te.tileID)?-1:1))}let Zr=this.crossTileSymbolIndex.addLayer(Gr,er[Gr.source],O.center.lng);Ee=Ee||Zr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((qt=qt||this._layerOrderChanged||Dt===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c.now(),O.zoom))&&(this.pauseablePlacement=new Ga(O,this.map.terrain,this._order,qt,pt,Dt,Ft,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,er),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c.now()),je=!0),Ee&&this.pauseablePlacement.placement.setStale()),je||Ee)for(let wr of this._order){let Gr=this._layers[wr];Gr.type==="symbol"&&this.placement.updateLayerOpacities(Gr,er[Gr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c.now())}_releaseSymbolFadeTiles(){for(let O in this.sourceCaches)this.sourceCaches[O].releaseSymbolFadeTiles()}getImages(O,pt){return i._(this,void 0,void 0,function*(){let Dt=yield this.imageManager.getImages(pt.icons);this._updateTilesForChangedImages();let Ft=this.sourceCaches[pt.source];return Ft&&Ft.setDependencies(pt.tileID.key,pt.type,pt.icons),Dt})}getGlyphs(O,pt){return i._(this,void 0,void 0,function*(){let Dt=yield this.glyphManager.getGlyphs(pt.stacks),Ft=this.sourceCaches[pt.source];return Ft&&Ft.setDependencies(pt.tileID.key,pt.type,[""]),Dt})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(O,pt={}){this._checkLoaded(),O&&this._validate(i.u.glyphs,"glyphs",O,null,pt)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=O,this.glyphManager.entries={},this.glyphManager.setURL(O))}addSprite(O,pt,Dt={},Ft){this._checkLoaded();let qt=[{id:O,url:pt}],Ee=[...M(this.stylesheet.sprite),...qt];this._validate(i.u.sprite,"sprite",Ee,null,Dt)||(this.stylesheet.sprite=Ee,this._loadSprite(qt,!0,Ft))}removeSprite(O){this._checkLoaded();let pt=M(this.stylesheet.sprite);if(pt.find(Dt=>Dt.id===O)){if(this._spritesImagesIds[O])for(let Dt of this._spritesImagesIds[O])this.imageManager.removeImage(Dt),this._changedImages[Dt]=!0;pt.splice(pt.findIndex(Dt=>Dt.id===O),1),this.stylesheet.sprite=pt.length>0?pt:void 0,delete this._spritesImagesIds[O],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"}))}else this.fire(new i.j(new Error(`Sprite "${O}" doesn't exists on this map.`)))}getSprite(){return M(this.stylesheet.sprite)}setSprite(O,pt={},Dt){this._checkLoaded(),O&&this._validate(i.u.sprite,"sprite",O,null,pt)||(this.stylesheet.sprite=O,O?this._loadSprite(O,!0,Dt):(this._unloadSprite(),Dt&&Dt(null)))}}var Pn=i.Y([{name:"a_pos",type:"Int16",components:2}]);let bn={prelude:ze(`#ifdef GL_ES +`),mapOnErrorMsg:"Map error."}}),Fk=It((et,Y)=>{var f=jn(),y=Hn().defaultLine,z=Jh().attributes,P=hi(),n=dd().textposition,i=sh().overrideAll,a=Tc().templatedArray,l=Y_(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var c=Y.exports=i({_arrayAttrRegexps:[f.counterRegex("map",".layers",!0)],domain:z({name:"map"}),style:{valType:"any",values:l.styleValuesMap,dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:f.extendFlat({},n,{arrayOk:!1})}})},"plot","from-root");c.uirevision={valType:"any",editType:"none"}}),bA=It((et,Y)=>{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Em(),n=Ib(),i=dd(),a=Fk(),l=xa(),o=Ru(),c=Yn().extendFlat,s=sh().overrideAll,h=Fk(),m=n.line,b=n.marker;Y.exports=s({lon:n.lon,lat:n.lat,cluster:{enabled:{valType:"boolean"},maxzoom:c({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:c({},b.opacity,{dflt:1})},mode:c({},i.mode,{dflt:"markers"}),text:c({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:c({},i.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:i.connectgaps,marker:c({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:n.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:i.selected.marker},unselected:{marker:i.unselected.marker},hoverinfo:c({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:f(),hovertemplatefallback:z()},"calc","nested")}),Sz=It((et,Y)=>{var f=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return f.indexOf(y)!==-1}}}),wtt=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=pm(),i=Pm(),a=bA(),l=Sz().isSupportedFont;Y.exports=function(c,s,h,m){function b(g,C){return f.coerce(c,s,a,g,C)}function x(g,C){return f.coerce2(c,s,a,g,C)}var _=o(c,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(c,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(f.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),f.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(c,s,h,m,b,{noDash:!0}),b("connectgaps"));var d=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=d!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;n(c,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&i(c,s,h,b),f.coerceSelectionMarkerOpacity(s,b)};function o(c,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),Cz=It((et,Y)=>{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot,a=i.mockAxis,l=y.lonlat;return n.lonLabel=f.tickText(a,a.c2l(l[0]),!0).text,n.latLabel=f.tickText(a,a.c2l(l[1]),!0).text,n}}),Az=It((et,Y)=>{var f=jn();Y.exports=function(y,z){var P=y.split(" "),n=P[0],i=P[1],a=f.isArrayOrTypedArray(z)?f.mean(z):z,l=.5+a/100,o=1.5+a/100,c=["",""],s=[0,0];switch(n){case"top":c[0]="top",s[1]=-o;break;case"bottom":c[0]="bottom",s[1]=o;break}switch(i){case"left":c[1]="right",s[0]=-l;break;case"right":c[1]="left",s[0]=l;break}var h;return c[0]&&c[1]?h=c.join("-"):c[0]?h=c[0]:c[1]?h=c[1]:h="center",{anchor:h,offset:s}}}),ktt=It((et,Y)=>{var f=Sr(),y=jn(),z=Dr().BADNUM,P=W_(),n=ch(),i=Js(),a=Hv(),l=Fu(),o=Sz().isSupportedFont,c=Az(),s=T0().appendArrayPointValue,h=uu().NEWLINES,m=uu().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),S=l.hasMarkers(M),N=l.hasText(M),B=S&&M.marker.symbol==="circle",U=S&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),H=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:H,symbol:q};if(!p)return G;var tt;if((g||C)&&(tt=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(tt),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(tt),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var ht=x(I);H.geojson=ht.geojson,H.layout.visibility="visible",V&&(H.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat(H.paint,{"circle-color":ht.mcc,"circle-radius":ht.mrc,"circle-opacity":ht.mo})}if(B&&V&&(H.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var bt=(M.marker||{}).size,vt=c(M.textposition,bt);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":vt.anchor,"text-offset":vt.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),S=y.isArrayOrTypedArray(M.opacity),N;function B(vt){return I.opacity*vt}function U(vt){return vt/2}var V;g&&(n.hasColorscale(I,"marker")?V=n.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;S&&(F=function(vt){var ut=f(vt)?+y.constrain(vt,0,1):0;return B(ut)});var H=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),S&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),Ttt=It((et,Y)=>{var f=jn(),y=ktt(),z=Y_().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function n(a,l,o,c){this.type="scattermap",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=c,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var i=n.prototype;i.addSource=function(a,l,o){var c={type:"geojson",data:l.geojson};o&&o.enabled&&f.extendFlat(c,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],c)},i.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},i.addLayer=function(a,l,o){var c={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(c.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var S=g[C];c.removeLayer(x.layerIds[S])}p||c.removeSource(x.sourceIds.circle)}function d(p){for(var g=P.nonCluster,C=0;C=0;C--){var S=g[C];c.removeLayer(x.layerIds[S]),p||c.removeSource(x.sourceIds[S])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):d(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var c=l[o];a.removeLayer(this.layerIds[c]),a.removeSource(this.sourceIds[c])}},Y.exports=function(a,l){var o=l[0].trace,c=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new n(a,o.uid,c,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(c)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var f=hd(),y=jn(),z=qc(),P=y.fillText,n=Dr().BADNUM,i=Y_().traceLayerPrefix;function a(o,c,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],d=i+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[d]});A=w.map(function(W){return W.id})}var D=c>=0?Math.floor((c+180)/360):Math.ceil((c-180)/360),E=D*360,I=c-E;function M(W){var F=W.lonlat;if(F[0]===n||k&&A.indexOf(W.i+1)===-1)return 1/0;var H=y.modHalf(F[0],360),q=F[1],G=_.project([H,q]),tt=G.x-b.c2p([I,q]),ht=G.y-x.c2p([H,s]),bt=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(tt*tt+ht*ht)-bt,1-3/bt)}if(f.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],S=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=S-B,o.x1=S+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,c,s){if(o.hovertemplate)return;var h=c.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=c.lonlat,d=[];function k(w){return w+"°"}return b||x&&_?d.push("("+k(A[1])+", "+k(A[0])+")"):x?d.push(s.lon+k(A[0])):_&&d.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(c,o,d),d.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),Stt=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f}}),Ctt=It((et,Y)=>{var f=jn(),y=Fu(),z=Dr().BADNUM;Y.exports=function(P,n){var i=P.cd,a=P.xaxis,l=P.yaxis,o=[],c=i[0].trace,s;if(!y.hasMarkers(c))return[];if(n===!1)for(s=0;s{(function(f,y){typeof et=="object"&&typeof Y<"u"?Y.exports=y():(f=typeof globalThis<"u"?globalThis:f||self,f.maplibregl=y())})(et,function(){var f={},y={};function z(n,i,a){if(y[n]=a,n==="index"){var l="var sharedModule = {}; ("+y.shared+")(sharedModule); ("+y.worker+")(sharedModule);",o={};return y.shared(o),y.index(f,o),typeof window<"u"&&f.setWorkerUrl(window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}))),f}}z("shared",["exports"],function(n){function i(X,R,at,kt){return new(at||(at=Promise))(function(jt,Qt){function re(or){try{$e(kt.next(or))}catch(Cr){Qt(Cr)}}function Ae(or){try{$e(kt.throw(or))}catch(Cr){Qt(Cr)}}function $e(or){var Cr;or.done?jt(or.value):(Cr=or.value,Cr instanceof at?Cr:new at(function($r){$r(Cr)})).then(re,Ae)}$e((kt=kt.apply(X,R||[])).next())})}function a(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}typeof SuppressedError=="function"&&SuppressedError;var l=o;function o(X,R){this.x=X,this.y=R}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(X){return this.clone()._add(X)},sub:function(X){return this.clone()._sub(X)},multByPoint:function(X){return this.clone()._multByPoint(X)},divByPoint:function(X){return this.clone()._divByPoint(X)},mult:function(X){return this.clone()._mult(X)},div:function(X){return this.clone()._div(X)},rotate:function(X){return this.clone()._rotate(X)},rotateAround:function(X,R){return this.clone()._rotateAround(X,R)},matMult:function(X){return this.clone()._matMult(X)},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(X){return this.x===X.x&&this.y===X.y},dist:function(X){return Math.sqrt(this.distSqr(X))},distSqr:function(X){var R=X.x-this.x,at=X.y-this.y;return R*R+at*at},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(X){return Math.atan2(this.y-X.y,this.x-X.x)},angleWith:function(X){return this.angleWithSep(X.x,X.y)},angleWithSep:function(X,R){return Math.atan2(this.x*R-this.y*X,this.x*X+this.y*R)},_matMult:function(X){var R=X[2]*this.x+X[3]*this.y;return this.x=X[0]*this.x+X[1]*this.y,this.y=R,this},_add:function(X){return this.x+=X.x,this.y+=X.y,this},_sub:function(X){return this.x-=X.x,this.y-=X.y,this},_mult:function(X){return this.x*=X,this.y*=X,this},_div:function(X){return this.x/=X,this.y/=X,this},_multByPoint:function(X){return this.x*=X.x,this.y*=X.y,this},_divByPoint:function(X){return this.x/=X.x,this.y/=X.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var X=this.y;return this.y=this.x,this.x=-X,this},_rotate:function(X){var R=Math.cos(X),at=Math.sin(X),kt=at*this.x+R*this.y;return this.x=R*this.x-at*this.y,this.y=kt,this},_rotateAround:function(X,R){var at=Math.cos(X),kt=Math.sin(X),jt=R.y+kt*(this.x-R.x)+at*(this.y-R.y);return this.x=R.x+at*(this.x-R.x)-kt*(this.y-R.y),this.y=jt,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(X){return X instanceof o?X:Array.isArray(X)?new o(X[0],X[1]):X};var c=a(l),s=h;function h(X,R,at,kt){this.cx=3*X,this.bx=3*(at-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(kt-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=at,this.p2y=kt}h.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var at=X,kt=0;kt<8;kt++){var jt=this.sampleCurveX(at)-X;if(Math.abs(jt)jt?re=at:Ae=at,at=.5*(Ae-re)+re;return at},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var m=a(s);let b,x;function _(){return b==null&&(b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),b}function A(){if(x==null&&(x=!1,_())){let X=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(X){for(let at=0;at<25;at++){let kt=4*at;X.fillStyle=`rgb(${kt},${kt+1},${kt+2})`,X.fillRect(at%5,Math.floor(at/5),1,1)}let R=X.getImageData(0,0,5,5).data;for(let at=0;at<100;at++)if(at%4!=3&&R[at]!==at){x=!0;break}}}return x||!1}function d(X,R,at,kt){let jt=new m(X,R,at,kt);return Qt=>jt.solve(Qt)}let k=d(.25,.1,.25,1);function w(X,R,at){return Math.min(at,Math.max(R,X))}function D(X,R,at){let kt=at-R,jt=((X-R)%kt+kt)%kt+R;return jt===R?at:jt}function E(X,...R){for(let at of R)for(let kt in at)X[kt]=at[kt];return X}let I=1;function M(X,R,at){let kt={};for(let jt in X)kt[jt]=R.call(this,X[jt],jt,X);return kt}function p(X,R,at){let kt={};for(let jt in X)R.call(this,X[jt],jt,X)&&(kt[jt]=X[jt]);return kt}function g(X){return Array.isArray(X)?X.map(g):typeof X=="object"&&X?M(X,g):X}let C={};function S(X){C[X]||(typeof console<"u"&&console.warn(X),C[X]=!0)}function N(X,R,at){return(at.y-X.y)*(R.x-X.x)>(R.y-X.y)*(at.x-X.x)}function B(X){return typeof WorkerGlobalScope<"u"&&X!==void 0&&X instanceof WorkerGlobalScope}let U=null;function V(X){return typeof ImageBitmap<"u"&&X instanceof ImageBitmap}let W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function F(X,R,at,kt,jt){return i(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Qt=new VideoFrame(X,{timestamp:0});try{let re=Qt?.format;if(!re||!re.startsWith("BGR")&&!re.startsWith("RGB"))throw new Error(`Unrecognized format ${re}`);let Ae=re.startsWith("BGR"),$e=new Uint8ClampedArray(kt*jt*4);if(yield Qt.copyTo($e,function(or,Cr,$r,ln,kn){let Fn=4*Math.max(-Cr,0),Kn=(Math.max(0,$r)-$r)*ln*4+Fn,mi=4*ln,Ui=Math.max(0,Cr),Na=Math.max(0,$r);return{rect:{x:Ui,y:Na,width:Math.min(or.width,Cr+ln)-Ui,height:Math.min(or.height,$r+kn)-Na},layout:[{offset:Kn,stride:mi}]}}(X,R,at,kt,jt)),Ae)for(let or=0;or<$e.length;or+=4){let Cr=$e[or];$e[or]=$e[or+2],$e[or+2]=Cr}return $e}finally{Qt.close()}})}let H,q,G="AbortError";function tt(){return new Error(G)}let ht={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function bt(X){return ht.REGISTERED_PROTOCOLS[X.substring(0,X.indexOf("://"))]}let vt="global-dispatcher";class ut extends Error{constructor(R,at,kt,jt){super(`AJAXError: ${at} (${R}): ${kt}`),this.status=R,this.statusText=at,this.url=kt,this.body=jt}}let rt=()=>B(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,gt=function(X,R){if(/:\/\//.test(X.url)&&!/^https?:|^file:/.test(X.url)){let kt=bt(X.url);if(kt)return kt(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,targetMapId:vt},R)}if(!(/^file:/.test(at=X.url)||/^file:/.test(rt())&&!/^\w+:/.test(at))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(kt,jt){return i(this,void 0,void 0,function*(){let Qt=new Request(kt.url,{method:kt.method||"GET",body:kt.body,credentials:kt.credentials,headers:kt.headers,cache:kt.cache,referrer:rt(),signal:jt.signal});kt.type!=="json"||Qt.headers.has("Accept")||Qt.headers.set("Accept","application/json");let re=yield fetch(Qt);if(!re.ok){let or=yield re.blob();throw new ut(re.status,re.statusText,kt.url,or)}let Ae;Ae=kt.type==="arrayBuffer"||kt.type==="image"?re.arrayBuffer():kt.type==="json"?re.json():re.text();let $e=yield Ae;if(jt.signal.aborted)throw tt();return{data:$e,cacheControl:re.headers.get("Cache-Control"),expires:re.headers.get("Expires")}})}(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,mustQueue:!0,targetMapId:vt},R)}var at;return function(kt,jt){return new Promise((Qt,re)=>{var Ae;let $e=new XMLHttpRequest;$e.open(kt.method||"GET",kt.url,!0),kt.type!=="arrayBuffer"&&kt.type!=="image"||($e.responseType="arraybuffer");for(let or in kt.headers)$e.setRequestHeader(or,kt.headers[or]);kt.type==="json"&&($e.responseType="text",!((Ae=kt.headers)===null||Ae===void 0)&&Ae.Accept||$e.setRequestHeader("Accept","application/json")),$e.withCredentials=kt.credentials==="include",$e.onerror=()=>{re(new Error($e.statusText))},$e.onload=()=>{if(!jt.signal.aborted)if(($e.status>=200&&$e.status<300||$e.status===0)&&$e.response!==null){let or=$e.response;if(kt.type==="json")try{or=JSON.parse($e.response)}catch(Cr){return void re(Cr)}Qt({data:or,cacheControl:$e.getResponseHeader("Cache-Control"),expires:$e.getResponseHeader("Expires")})}else{let or=new Blob([$e.response],{type:$e.getResponseHeader("Content-Type")});re(new ut($e.status,$e.statusText,kt.url,or))}},jt.signal.addEventListener("abort",()=>{$e.abort(),re(tt())}),$e.send(kt.body)})}(X,R)};function it(X){if(!X||X.indexOf("://")<=0||X.indexOf("data:image/")===0||X.indexOf("blob:")===0)return!0;let R=new URL(X),at=window.location;return R.protocol===at.protocol&&R.host===at.host}function st(X,R,at){at[X]&&at[X].indexOf(R)!==-1||(at[X]=at[X]||[],at[X].push(R))}function xt(X,R,at){if(at&&at[X]){let kt=at[X].indexOf(R);kt!==-1&&at[X].splice(kt,1)}}class ot{constructor(R,at={}){E(this,at),this.type=R}}class J extends ot{constructor(R,at={}){super("error",E({error:R},at))}}class mt{on(R,at){return this._listeners=this._listeners||{},st(R,at,this._listeners),this}off(R,at){return xt(R,at,this._listeners),xt(R,at,this._oneTimeListeners),this}once(R,at){return at?(this._oneTimeListeners=this._oneTimeListeners||{},st(R,at,this._oneTimeListeners),this):new Promise(kt=>this.once(R,kt))}fire(R,at){typeof R=="string"&&(R=new ot(R,at||{}));let kt=R.type;if(this.listens(kt)){R.target=this;let jt=this._listeners&&this._listeners[kt]?this._listeners[kt].slice():[];for(let Ae of jt)Ae.call(this,R);let Qt=this._oneTimeListeners&&this._oneTimeListeners[kt]?this._oneTimeListeners[kt].slice():[];for(let Ae of Qt)xt(kt,Ae,this._oneTimeListeners),Ae.call(this,R);let re=this._eventedParent;re&&(E(R,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),re.fire(R))}else R instanceof J&&console.error(R.error);return this}listens(R){return this._listeners&&this._listeners[R]&&this._listeners[R].length>0||this._oneTimeListeners&&this._oneTimeListeners[R]&&this._oneTimeListeners[R].length>0||this._eventedParent&&this._eventedParent.listens(R)}setEventedParent(R,at){return this._eventedParent=R,this._eventedParentData=at,this}}var dt={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};let Ct=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Rt(X,R){let at={};for(let kt in X)kt!=="ref"&&(at[kt]=X[kt]);return Ct.forEach(kt=>{kt in R&&(at[kt]=R[kt])}),at}function Bt(X,R){if(Array.isArray(X)){if(!Array.isArray(R)||X.length!==R.length)return!1;for(let at=0;at`:X.itemType.kind==="value"?"array":`array<${R}>`}return X.kind}let zt=[ce,Le,Ze,Qe,mr,Er,fr,Xt(Jr),dn,_n,Oe];function _t(X,R){if(R.kind==="error")return null;if(X.kind==="array"){if(R.kind==="array"&&(R.N===0&&R.itemType.kind==="value"||!_t(X.itemType,R.itemType))&&(typeof X.N!="number"||X.N===R.N))return null}else{if(X.kind===R.kind)return null;if(X.kind==="value"){for(let at of zt)if(!_t(at,R))return null}}return`Expected ${oe(X)} but found ${oe(R)} instead.`}function Pt(X,R){return R.some(at=>at.kind===X.kind)}function Ht(X,R){return R.some(at=>at==="null"?X===null:at==="array"?Array.isArray(X):at==="object"?X&&!Array.isArray(X)&&typeof X=="object":at===typeof X)}function ae(X,R){return X.kind==="array"&&R.kind==="array"?X.itemType.kind===R.itemType.kind&&typeof X.N=="number":X.kind===R.kind}let he=.96422,Me=.82521,qe=4/29,Ye=6/29,ur=3*Ye*Ye,Rr=Ye*Ye*Ye,zr=Math.PI/180,xr=180/Math.PI;function pn(X){return(X%=360)<0&&(X+=360),X}function ci([X,R,at,kt]){let jt,Qt,re=yi((.2225045*(X=ui(X))+.7168786*(R=ui(R))+.0606169*(at=ui(at)))/1);X===R&&R===at?jt=Qt=re:(jt=yi((.4360747*X+.3850649*R+.1430804*at)/he),Qt=yi((.0139322*X+.0971045*R+.7141733*at)/Me));let Ae=116*re-16;return[Ae<0?0:Ae,500*(jt-re),200*(re-Qt),kt]}function ui(X){return X<=.04045?X/12.92:Math.pow((X+.055)/1.055,2.4)}function yi(X){return X>Rr?Math.pow(X,1/3):X/ur+qe}function Gi([X,R,at,kt]){let jt=(X+16)/116,Qt=isNaN(R)?jt:jt+R/500,re=isNaN(at)?jt:jt-at/200;return jt=1*fi(jt),Qt=he*fi(Qt),re=Me*fi(re),[Ci(3.1338561*Qt-1.6168667*jt-.4906146*re),Ci(-.9787684*Qt+1.9161415*jt+.033454*re),Ci(.0719453*Qt-.2289914*jt+1.4052427*re),kt]}function Ci(X){return(X=X<=.00304?12.92*X:1.055*Math.pow(X,1/2.4)-.055)<0?0:X>1?1:X}function fi(X){return X>Ye?X*X*X:ur*(X-qe)}function ba(X){return parseInt(X.padEnd(2,X),16)/255}function oa(X,R){return Ke(R?X/100:X,0,1)}function Ke(X,R,at){return Math.min(Math.max(R,X),at)}function sr(X){return!X.some(Number.isNaN)}let vr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Ar{constructor(R,at,kt,jt=1,Qt=!0){this.r=R,this.g=at,this.b=kt,this.a=jt,Qt||(this.r*=jt,this.g*=jt,this.b*=jt,jt||this.overwriteGetter("rgb",[R,at,kt,jt]))}static parse(R){if(R instanceof Ar)return R;if(typeof R!="string")return;let at=function(kt){if((kt=kt.toLowerCase().trim())==="transparent")return[0,0,0,0];let jt=vr[kt];if(jt){let[re,Ae,$e]=jt;return[re/255,Ae/255,$e/255,1]}if(kt.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(kt)){let re=kt.length<6?1:2,Ae=1;return[ba(kt.slice(Ae,Ae+=re)),ba(kt.slice(Ae,Ae+=re)),ba(kt.slice(Ae,Ae+=re)),ba(kt.slice(Ae,Ae+re)||"ff")]}if(kt.startsWith("rgb")){let re=kt.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(re){let[Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na]=re,fa=[Cr||" ",kn||" ",mi].join("");if(fa===" "||fa===" /"||fa===",,"||fa===",,,"){let La=[or,ln,Kn].join(""),ho=La==="%%%"?100:La===""?255:0;if(ho){let Ro=[Ke(+$e/ho,0,1),Ke(+$r/ho,0,1),Ke(+Fn/ho,0,1),Ui?oa(+Ui,Na):1];if(sr(Ro))return Ro}}return}}let Qt=kt.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Qt){let[re,Ae,$e,or,Cr,$r,ln,kn,Fn]=Qt,Kn=[$e||" ",Cr||" ",ln].join("");if(Kn===" "||Kn===" /"||Kn===",,"||Kn===",,,"){let mi=[+Ae,Ke(+or,0,100),Ke(+$r,0,100),kn?oa(+kn,Fn):1];if(sr(mi))return function([Ui,Na,fa,La]){function ho(Ro){let Os=(Ro+Ui/30)%12,Nl=Na*Math.min(fa,1-fa);return fa-Nl*Math.max(-1,Math.min(Os-3,9-Os,1))}return Ui=pn(Ui),Na/=100,fa/=100,[ho(0),ho(8),ho(4),La]}(mi)}}}(R);return at?new Ar(...at,!1):void 0}get rgb(){let{r:R,g:at,b:kt,a:jt}=this,Qt=jt||1/0;return this.overwriteGetter("rgb",[R/Qt,at/Qt,kt/Qt,jt])}get hcl(){return this.overwriteGetter("hcl",function(R){let[at,kt,jt,Qt]=ci(R),re=Math.sqrt(kt*kt+jt*jt);return[Math.round(1e4*re)?pn(Math.atan2(jt,kt)*xr):NaN,re,at,Qt]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ci(this.rgb))}overwriteGetter(R,at){return Object.defineProperty(this,R,{value:at}),at}toString(){let[R,at,kt,jt]=this.rgb;return`rgba(${[R,at,kt].map(Qt=>Math.round(255*Qt)).join(",")},${jt})`}}Ar.black=new Ar(0,0,0,1),Ar.white=new Ar(1,1,1,1),Ar.transparent=new Ar(0,0,0,0),Ar.red=new Ar(1,0,0,1);class mn{constructor(R,at,kt){this.sensitivity=R?at?"variant":"case":at?"accent":"base",this.locale=kt,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(R,at){return this.collator.compare(R,at)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Zn{constructor(R,at,kt,jt,Qt){this.text=R,this.image=at,this.scale=kt,this.fontStack=jt,this.textColor=Qt}}class Un{constructor(R){this.sections=R}static fromString(R){return new Un([new Zn(R,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(R=>R.text.length!==0||R.image&&R.image.name.length!==0)}static factory(R){return R instanceof Un?R:Un.fromString(R)}toString(){return this.sections.length===0?"":this.sections.map(R=>R.text).join("")}}class Wn{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Wn)return R;if(typeof R=="number")return new Wn([R,R,R,R]);if(Array.isArray(R)&&!(R.length<1||R.length>4)){for(let at of R)if(typeof at!="number")return;switch(R.length){case 1:R=[R[0],R[0],R[0],R[0]];break;case 2:R=[R[0],R[1],R[0],R[1]];break;case 3:R=[R[0],R[1],R[2],R[1]]}return new Wn(R)}}toString(){return JSON.stringify(this.values)}}let Li=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Fi{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Fi)return R;if(Array.isArray(R)&&!(R.length<1)&&R.length%2==0){for(let at=0;at=0&&X<=255&&typeof R=="number"&&R>=0&&R<=255&&typeof at=="number"&&at>=0&&at<=255?kt===void 0||typeof kt=="number"&&kt>=0&&kt<=1?null:`Invalid rgba value [${[X,R,at,kt].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof kt=="number"?[X,R,at,kt]:[X,R,at]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ca(X){if(X===null||typeof X=="string"||typeof X=="boolean"||typeof X=="number"||X instanceof Ar||X instanceof mn||X instanceof Un||X instanceof Wn||X instanceof Fi||X instanceof Zi)return!0;if(Array.isArray(X)){for(let R of X)if(!ca(R))return!1;return!0}if(typeof X=="object"){for(let R in X)if(!ca(X[R]))return!1;return!0}return!1}function Ei(X){if(X===null)return ce;if(typeof X=="string")return Ze;if(typeof X=="boolean")return Qe;if(typeof X=="number")return Le;if(X instanceof Ar)return mr;if(X instanceof mn)return an;if(X instanceof Un)return Er;if(X instanceof Wn)return dn;if(X instanceof Fi)return Oe;if(X instanceof Zi)return _n;if(Array.isArray(X)){let R=X.length,at;for(let kt of X){let jt=Ei(kt);if(at){if(at===jt)continue;at=Jr;break}at=jt}return Xt(at||Jr,R)}return fr}function Ga(X){let R=typeof X;return X===null?"":R==="string"||R==="number"||R==="boolean"?String(X):X instanceof Ar||X instanceof Un||X instanceof Wn||X instanceof Fi||X instanceof Zi?X.toString():JSON.stringify(X)}class so{constructor(R,at){this.type=R,this.value=at}static parse(R,at){if(R.length!==2)return at.error(`'literal' expression requires exactly one argument, but found ${R.length-1} instead.`);if(!ca(R[1]))return at.error("invalid value");let kt=R[1],jt=Ei(kt),Qt=at.expectedType;return jt.kind!=="array"||jt.N!==0||!Qt||Qt.kind!=="array"||typeof Qt.N=="number"&&Qt.N!==0||(jt=Qt),new so(jt,kt)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Fe{constructor(R){this.name="ExpressionEvaluationError",this.message=R}toJSON(){return this.message}}let Re={string:Ze,number:Le,boolean:Qe,object:fr};class Kr{constructor(R,at){this.type=R,this.args=at}static parse(R,at){if(R.length<2)return at.error("Expected at least one argument.");let kt,jt=1,Qt=R[0];if(Qt==="array"){let Ae,$e;if(R.length>2){let or=R[1];if(typeof or!="string"||!(or in Re)||or==="object")return at.error('The item type argument of "array" must be one of string, number, boolean',1);Ae=Re[or],jt++}else Ae=Jr;if(R.length>3){if(R[2]!==null&&(typeof R[2]!="number"||R[2]<0||R[2]!==Math.floor(R[2])))return at.error('The length argument to "array" must be a positive integer literal',2);$e=R[2],jt++}kt=Xt(Ae,$e)}else{if(!Re[Qt])throw new Error(`Types doesn't contain name = ${Qt}`);kt=Re[Qt]}let re=[];for(;jtR.outputDefined())}}let sn={"to-boolean":Qe,"to-color":mr,"to-number":Le,"to-string":Ze};class cn{constructor(R,at){this.type=R,this.args=at}static parse(R,at){if(R.length<2)return at.error("Expected at least one argument.");let kt=R[0];if(!sn[kt])throw new Error(`Can't parse ${kt} as it is not part of the known types`);if((kt==="to-boolean"||kt==="to-string")&&R.length!==2)return at.error("Expected one argument.");let jt=sn[kt],Qt=[];for(let re=1;re4?`Invalid rbga value ${JSON.stringify(at)}: expected an array containing either three or four numeric values.`:Ji(at[0],at[1],at[2],at[3]),!kt))return new Ar(at[0]/255,at[1]/255,at[2]/255,at[3])}throw new Fe(kt||`Could not parse color from value '${typeof at=="string"?at:JSON.stringify(at)}'`)}case"padding":{let at;for(let kt of this.args){at=kt.evaluate(R);let jt=Wn.parse(at);if(jt)return jt}throw new Fe(`Could not parse padding from value '${typeof at=="string"?at:JSON.stringify(at)}'`)}case"variableAnchorOffsetCollection":{let at;for(let kt of this.args){at=kt.evaluate(R);let jt=Fi.parse(at);if(jt)return jt}throw new Fe(`Could not parse variableAnchorOffsetCollection from value '${typeof at=="string"?at:JSON.stringify(at)}'`)}case"number":{let at=null;for(let kt of this.args){if(at=kt.evaluate(R),at===null)return 0;let jt=Number(at);if(!isNaN(jt))return jt}throw new Fe(`Could not convert ${JSON.stringify(at)} to number.`)}case"formatted":return Un.fromString(Ga(this.args[0].evaluate(R)));case"resolvedImage":return Zi.fromString(Ga(this.args[0].evaluate(R)));default:return Ga(this.args[0].evaluate(R))}}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}let Yr=["Unknown","Point","LineString","Polygon"];class un{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Yr[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(R){let at=this._parseColorCache[R];return at||(at=this._parseColorCache[R]=Ar.parse(R)),at}}class Pn{constructor(R,at,kt=[],jt,Qt=new be,re=[]){this.registry=R,this.path=kt,this.key=kt.map(Ae=>`[${Ae}]`).join(""),this.scope=Qt,this.errors=re,this.expectedType=jt,this._isConstant=at}parse(R,at,kt,jt,Qt={}){return at?this.concat(at,kt,jt)._parse(R,Qt):this._parse(R,Qt)}_parse(R,at){function kt(jt,Qt,re){return re==="assert"?new Kr(Qt,[jt]):re==="coerce"?new cn(Qt,[jt]):jt}if(R!==null&&typeof R!="string"&&typeof R!="boolean"&&typeof R!="number"||(R=["literal",R]),Array.isArray(R)){if(R.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let jt=R[0];if(typeof jt!="string")return this.error(`Expression name must be a string, but found ${typeof jt} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Qt=this.registry[jt];if(Qt){let re=Qt.parse(R,this);if(!re)return null;if(this.expectedType){let Ae=this.expectedType,$e=re.type;if(Ae.kind!=="string"&&Ae.kind!=="number"&&Ae.kind!=="boolean"&&Ae.kind!=="object"&&Ae.kind!=="array"||$e.kind!=="value")if(Ae.kind!=="color"&&Ae.kind!=="formatted"&&Ae.kind!=="resolvedImage"||$e.kind!=="value"&&$e.kind!=="string")if(Ae.kind!=="padding"||$e.kind!=="value"&&$e.kind!=="number"&&$e.kind!=="array")if(Ae.kind!=="variableAnchorOffsetCollection"||$e.kind!=="value"&&$e.kind!=="array"){if(this.checkSubtype(Ae,$e))return null}else re=kt(re,Ae,at.typeAnnotation||"coerce");else re=kt(re,Ae,at.typeAnnotation||"coerce");else re=kt(re,Ae,at.typeAnnotation||"coerce");else re=kt(re,Ae,at.typeAnnotation||"assert")}if(!(re instanceof so)&&re.type.kind!=="resolvedImage"&&this._isConstant(re)){let Ae=new un;try{re=new so(re.type,re.evaluate(Ae))}catch($e){return this.error($e.message),null}}return re}return this.error(`Unknown expression "${jt}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(R===void 0?"'undefined' value invalid. Use null instead.":typeof R=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof R} instead.`)}concat(R,at,kt){let jt=typeof R=="number"?this.path.concat(R):this.path,Qt=kt?this.scope.concat(kt):this.scope;return new Pn(this.registry,this._isConstant,jt,at||null,Qt,this.errors)}error(R,...at){let kt=`${this.key}${at.map(jt=>`[${jt}]`).join("")}`;this.errors.push(new ie(kt,R))}checkSubtype(R,at){let kt=_t(R,at);return kt&&this.error(kt),kt}}class bn{constructor(R,at){this.type=at.type,this.bindings=[].concat(R),this.result=at}evaluate(R){return this.result.evaluate(R)}eachChild(R){for(let at of this.bindings)R(at[1]);R(this.result)}static parse(R,at){if(R.length<4)return at.error(`Expected at least 3 arguments, but found ${R.length-1} instead.`);let kt=[];for(let Qt=1;Qt=kt.length)throw new Fe(`Array index out of bounds: ${at} > ${kt.length-1}.`);if(at!==Math.floor(at))throw new Fe(`Array index must be an integer, but found ${at} instead.`);return kt[at]}eachChild(R){R(this.index),R(this.input)}outputDefined(){return!1}}class en{constructor(R,at){this.type=Qe,this.needle=R,this.haystack=at}static parse(R,at){if(R.length!==3)return at.error(`Expected 2 arguments, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1,Jr),jt=at.parse(R[2],2,Jr);return kt&&jt?Pt(kt.type,[Qe,Ze,Le,ce,Jr])?new en(kt,jt):at.error(`Expected first argument to be of type boolean, string, number or null, but found ${oe(kt.type)} instead`):null}evaluate(R){let at=this.needle.evaluate(R),kt=this.haystack.evaluate(R);if(!kt)return!1;if(!Ht(at,["boolean","string","number","null"]))throw new Fe(`Expected first argument to be of type boolean, string, number or null, but found ${oe(Ei(at))} instead.`);if(!Ht(kt,["string","array"]))throw new Fe(`Expected second argument to be of type array or string, but found ${oe(Ei(kt))} instead.`);return kt.indexOf(at)>=0}eachChild(R){R(this.needle),R(this.haystack)}outputDefined(){return!0}}class Rn{constructor(R,at,kt){this.type=Le,this.needle=R,this.haystack=at,this.fromIndex=kt}static parse(R,at){if(R.length<=2||R.length>=5)return at.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1,Jr),jt=at.parse(R[2],2,Jr);if(!kt||!jt)return null;if(!Pt(kt.type,[Qe,Ze,Le,ce,Jr]))return at.error(`Expected first argument to be of type boolean, string, number or null, but found ${oe(kt.type)} instead`);if(R.length===4){let Qt=at.parse(R[3],3,Le);return Qt?new Rn(kt,jt,Qt):null}return new Rn(kt,jt)}evaluate(R){let at=this.needle.evaluate(R),kt=this.haystack.evaluate(R);if(!Ht(at,["boolean","string","number","null"]))throw new Fe(`Expected first argument to be of type boolean, string, number or null, but found ${oe(Ei(at))} instead.`);let jt;if(this.fromIndex&&(jt=this.fromIndex.evaluate(R)),Ht(kt,["string"])){let Qt=kt.indexOf(at,jt);return Qt===-1?-1:[...kt.slice(0,Qt)].length}if(Ht(kt,["array"]))return kt.indexOf(at,jt);throw new Fe(`Expected second argument to be of type array or string, but found ${oe(Ei(kt))} instead.`)}eachChild(R){R(this.needle),R(this.haystack),this.fromIndex&&R(this.fromIndex)}outputDefined(){return!1}}class ni{constructor(R,at,kt,jt,Qt,re){this.inputType=R,this.type=at,this.input=kt,this.cases=jt,this.outputs=Qt,this.otherwise=re}static parse(R,at){if(R.length<5)return at.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if(R.length%2!=1)return at.error("Expected an even number of arguments.");let kt,jt;at.expectedType&&at.expectedType.kind!=="value"&&(jt=at.expectedType);let Qt={},re=[];for(let or=2;orNumber.MAX_SAFE_INTEGER)return ln.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Fn=="number"&&Math.floor(Fn)!==Fn)return ln.error("Numeric branch labels must be integer values.");if(kt){if(ln.checkSubtype(kt,Ei(Fn)))return null}else kt=Ei(Fn);if(Qt[String(Fn)]!==void 0)return ln.error("Branch labels must be unique.");Qt[String(Fn)]=re.length}let kn=at.parse($r,or,jt);if(!kn)return null;jt=jt||kn.type,re.push(kn)}let Ae=at.parse(R[1],1,Jr);if(!Ae)return null;let $e=at.parse(R[R.length-1],R.length-1,jt);return $e?Ae.type.kind!=="value"&&at.concat(1).checkSubtype(kt,Ae.type)?null:new ni(kt,jt,Ae,Qt,re,$e):null}evaluate(R){let at=this.input.evaluate(R);return(Ei(at)===this.inputType&&this.outputs[this.cases[at]]||this.otherwise).evaluate(R)}eachChild(R){R(this.input),this.outputs.forEach(R),R(this.otherwise)}outputDefined(){return this.outputs.every(R=>R.outputDefined())&&this.otherwise.outputDefined()}}class xi{constructor(R,at,kt){this.type=R,this.branches=at,this.otherwise=kt}static parse(R,at){if(R.length<4)return at.error(`Expected at least 3 arguments, but found only ${R.length-1}.`);if(R.length%2!=0)return at.error("Expected an odd number of arguments.");let kt;at.expectedType&&at.expectedType.kind!=="value"&&(kt=at.expectedType);let jt=[];for(let re=1;reat.outputDefined())&&this.otherwise.outputDefined()}}class Jn{constructor(R,at,kt,jt){this.type=R,this.input=at,this.beginIndex=kt,this.endIndex=jt}static parse(R,at){if(R.length<=2||R.length>=5)return at.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1,Jr),jt=at.parse(R[2],2,Le);if(!kt||!jt)return null;if(!Pt(kt.type,[Xt(Jr),Ze,Jr]))return at.error(`Expected first argument to be of type array or string, but found ${oe(kt.type)} instead`);if(R.length===4){let Qt=at.parse(R[3],3,Le);return Qt?new Jn(kt.type,kt,jt,Qt):null}return new Jn(kt.type,kt,jt)}evaluate(R){let at=this.input.evaluate(R),kt=this.beginIndex.evaluate(R),jt;if(this.endIndex&&(jt=this.endIndex.evaluate(R)),Ht(at,["string"]))return[...at].slice(kt,jt).join("");if(Ht(at,["array"]))return at.slice(kt,jt);throw new Fe(`Expected first argument to be of type array or string, but found ${oe(Ei(at))} instead.`)}eachChild(R){R(this.input),R(this.beginIndex),this.endIndex&&R(this.endIndex)}outputDefined(){return!1}}function Gn(X,R){let at=X.length-1,kt,jt,Qt=0,re=at,Ae=0;for(;Qt<=re;)if(Ae=Math.floor((Qt+re)/2),kt=X[Ae],jt=X[Ae+1],kt<=R){if(Ae===at||RR))throw new Fe("Input is not a number.");re=Ae-1}return 0}class pi{constructor(R,at,kt){this.type=R,this.input=at,this.labels=[],this.outputs=[];for(let[jt,Qt]of kt)this.labels.push(jt),this.outputs.push(Qt)}static parse(R,at){if(R.length-1<4)return at.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return at.error("Expected an even number of arguments.");let kt=at.parse(R[1],1,Le);if(!kt)return null;let jt=[],Qt=null;at.expectedType&&at.expectedType.kind!=="value"&&(Qt=at.expectedType);for(let re=1;re=Ae)return at.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',or);let $r=at.parse($e,Cr,Qt);if(!$r)return null;Qt=Qt||$r.type,jt.push([Ae,$r])}return new pi(Qt,kt,jt)}evaluate(R){let at=this.labels,kt=this.outputs;if(at.length===1)return kt[0].evaluate(R);let jt=this.input.evaluate(R);if(jt<=at[0])return kt[0].evaluate(R);let Qt=at.length;return jt>=at[Qt-1]?kt[Qt-1].evaluate(R):kt[Gn(at,jt)].evaluate(R)}eachChild(R){R(this.input);for(let at of this.outputs)R(at)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function Va(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}var ea=go;function go(X,R,at,kt){this.cx=3*X,this.bx=3*(at-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(kt-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=at,this.p2y=kt}go.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var at=X,kt=0;kt<8;kt++){var jt=this.sampleCurveX(at)-X;if(Math.abs(jt)jt?re=at:Ae=at,at=.5*(Ae-re)+re;return at},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var mo=Va(ea);function Go(X,R,at){return X+at*(R-X)}function Po(X,R,at){return X.map((kt,jt)=>Go(kt,R[jt],at))}let Zo={number:Go,color:function(X,R,at,kt="rgb"){switch(kt){case"rgb":{let[jt,Qt,re,Ae]=Po(X.rgb,R.rgb,at);return new Ar(jt,Qt,re,Ae,!1)}case"hcl":{let[jt,Qt,re,Ae]=X.hcl,[$e,or,Cr,$r]=R.hcl,ln,kn;if(isNaN(jt)||isNaN($e))isNaN(jt)?isNaN($e)?ln=NaN:(ln=$e,re!==1&&re!==0||(kn=or)):(ln=jt,Cr!==1&&Cr!==0||(kn=Qt));else{let Na=$e-jt;$e>jt&&Na>180?Na-=360:$e180&&(Na+=360),ln=jt+at*Na}let[Fn,Kn,mi,Ui]=function([Na,fa,La,ho]){return Na=isNaN(Na)?0:Na*zr,Gi([La,Math.cos(Na)*fa,Math.sin(Na)*fa,ho])}([ln,kn??Go(Qt,or,at),Go(re,Cr,at),Go(Ae,$r,at)]);return new Ar(Fn,Kn,mi,Ui,!1)}case"lab":{let[jt,Qt,re,Ae]=Gi(Po(X.lab,R.lab,at));return new Ar(jt,Qt,re,Ae,!1)}}},array:Po,padding:function(X,R,at){return new Wn(Po(X.values,R.values,at))},variableAnchorOffsetCollection:function(X,R,at){let kt=X.values,jt=R.values;if(kt.length!==jt.length)throw new Fe(`Cannot interpolate values of different length. from: ${X.toString()}, to: ${R.toString()}`);let Qt=[];for(let re=0;retypeof Cr!="number"||Cr<0||Cr>1))return at.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);jt={name:"cubic-bezier",controlPoints:or}}}if(R.length-1<4)return at.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return at.error("Expected an even number of arguments.");if(Qt=at.parse(Qt,2,Le),!Qt)return null;let Ae=[],$e=null;kt==="interpolate-hcl"||kt==="interpolate-lab"?$e=mr:at.expectedType&&at.expectedType.kind!=="value"&&($e=at.expectedType);for(let or=0;or=Cr)return at.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ln);let Fn=at.parse($r,kn,$e);if(!Fn)return null;$e=$e||Fn.type,Ae.push([Cr,Fn])}return ae($e,Le)||ae($e,mr)||ae($e,dn)||ae($e,Oe)||ae($e,Xt(Le))?new Ka($e,kt,jt,Qt,Ae):at.error(`Type ${oe($e)} is not interpolatable.`)}evaluate(R){let at=this.labels,kt=this.outputs;if(at.length===1)return kt[0].evaluate(R);let jt=this.input.evaluate(R);if(jt<=at[0])return kt[0].evaluate(R);let Qt=at.length;if(jt>=at[Qt-1])return kt[Qt-1].evaluate(R);let re=Gn(at,jt),Ae=Ka.interpolationFactor(this.interpolation,jt,at[re],at[re+1]),$e=kt[re].evaluate(R),or=kt[re+1].evaluate(R);switch(this.operator){case"interpolate":return Zo[this.type.kind]($e,or,Ae);case"interpolate-hcl":return Zo.color($e,or,Ae,"hcl");case"interpolate-lab":return Zo.color($e,or,Ae,"lab")}}eachChild(R){R(this.input);for(let at of this.outputs)R(at)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function Cs(X,R,at,kt){let jt=kt-at,Qt=X-at;return jt===0?0:R===1?Qt/jt:(Math.pow(R,Qt)-1)/(Math.pow(R,jt)-1)}class ps{constructor(R,at){this.type=R,this.args=at}static parse(R,at){if(R.length<2)return at.error("Expectected at least one argument.");let kt=null,jt=at.expectedType;jt&&jt.kind!=="value"&&(kt=jt);let Qt=[];for(let Ae of R.slice(1)){let $e=at.parse(Ae,1+Qt.length,kt,void 0,{typeAnnotation:"omit"});if(!$e)return null;kt=kt||$e.type,Qt.push($e)}if(!kt)throw new Error("No output type");let re=jt&&Qt.some(Ae=>_t(jt,Ae.type));return new ps(re?Jr:kt,Qt)}evaluate(R){let at,kt=null,jt=0;for(let Qt of this.args)if(jt++,kt=Qt.evaluate(R),kt&&kt instanceof Zi&&!kt.available&&(at||(at=kt.name),kt=null,jt===this.args.length&&(kt=at)),kt!==null)break;return kt}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}function wl(X,R){return X==="=="||X==="!="?R.kind==="boolean"||R.kind==="string"||R.kind==="number"||R.kind==="null"||R.kind==="value":R.kind==="string"||R.kind==="number"||R.kind==="value"}function is(X,R,at,kt){return kt.compare(R,at)===0}function ol(X,R,at){let kt=X!=="=="&&X!=="!=";return class HH{constructor(Qt,re,Ae){this.type=Qe,this.lhs=Qt,this.rhs=re,this.collator=Ae,this.hasUntypedArgument=Qt.type.kind==="value"||re.type.kind==="value"}static parse(Qt,re){if(Qt.length!==3&&Qt.length!==4)return re.error("Expected two or three arguments.");let Ae=Qt[0],$e=re.parse(Qt[1],1,Jr);if(!$e)return null;if(!wl(Ae,$e.type))return re.concat(1).error(`"${Ae}" comparisons are not supported for type '${oe($e.type)}'.`);let or=re.parse(Qt[2],2,Jr);if(!or)return null;if(!wl(Ae,or.type))return re.concat(2).error(`"${Ae}" comparisons are not supported for type '${oe(or.type)}'.`);if($e.type.kind!==or.type.kind&&$e.type.kind!=="value"&&or.type.kind!=="value")return re.error(`Cannot compare types '${oe($e.type)}' and '${oe(or.type)}'.`);kt&&($e.type.kind==="value"&&or.type.kind!=="value"?$e=new Kr(or.type,[$e]):$e.type.kind!=="value"&&or.type.kind==="value"&&(or=new Kr($e.type,[or])));let Cr=null;if(Qt.length===4){if($e.type.kind!=="string"&&or.type.kind!=="string"&&$e.type.kind!=="value"&&or.type.kind!=="value")return re.error("Cannot use collator to compare non-string types.");if(Cr=re.parse(Qt[3],3,an),!Cr)return null}return new HH($e,or,Cr)}evaluate(Qt){let re=this.lhs.evaluate(Qt),Ae=this.rhs.evaluate(Qt);if(kt&&this.hasUntypedArgument){let $e=Ei(re),or=Ei(Ae);if($e.kind!==or.kind||$e.kind!=="string"&&$e.kind!=="number")throw new Fe(`Expected arguments for "${X}" to be (string, string) or (number, number), but found (${$e.kind}, ${or.kind}) instead.`)}if(this.collator&&!kt&&this.hasUntypedArgument){let $e=Ei(re),or=Ei(Ae);if($e.kind!=="string"||or.kind!=="string")return R(Qt,re,Ae)}return this.collator?at(Qt,re,Ae,this.collator.evaluate(Qt)):R(Qt,re,Ae)}eachChild(Qt){Qt(this.lhs),Qt(this.rhs),this.collator&&Qt(this.collator)}outputDefined(){return!0}}}let ms=ol("==",function(X,R,at){return R===at},is),kl=ol("!=",function(X,R,at){return R!==at},function(X,R,at,kt){return!is(0,R,at,kt)}),ul=ol("<",function(X,R,at){return R",function(X,R,at){return R>at},function(X,R,at,kt){return kt.compare(R,at)>0}),vs=ol("<=",function(X,R,at){return R<=at},function(X,R,at,kt){return kt.compare(R,at)<=0}),Ns=ol(">=",function(X,R,at){return R>=at},function(X,R,at,kt){return kt.compare(R,at)>=0});class Uo{constructor(R,at,kt){this.type=an,this.locale=kt,this.caseSensitive=R,this.diacriticSensitive=at}static parse(R,at){if(R.length!==2)return at.error("Expected one argument.");let kt=R[1];if(typeof kt!="object"||Array.isArray(kt))return at.error("Collator options argument must be an object.");let jt=at.parse(kt["case-sensitive"]!==void 0&&kt["case-sensitive"],1,Qe);if(!jt)return null;let Qt=at.parse(kt["diacritic-sensitive"]!==void 0&&kt["diacritic-sensitive"],1,Qe);if(!Qt)return null;let re=null;return kt.locale&&(re=at.parse(kt.locale,1,Ze),!re)?null:new Uo(jt,Qt,re)}evaluate(R){return new mn(this.caseSensitive.evaluate(R),this.diacriticSensitive.evaluate(R),this.locale?this.locale.evaluate(R):null)}eachChild(R){R(this.caseSensitive),R(this.diacriticSensitive),this.locale&&R(this.locale)}outputDefined(){return!1}}class Ds{constructor(R,at,kt,jt,Qt){this.type=Ze,this.number=R,this.locale=at,this.currency=kt,this.minFractionDigits=jt,this.maxFractionDigits=Qt}static parse(R,at){if(R.length!==3)return at.error("Expected two arguments.");let kt=at.parse(R[1],1,Le);if(!kt)return null;let jt=R[2];if(typeof jt!="object"||Array.isArray(jt))return at.error("NumberFormat options argument must be an object.");let Qt=null;if(jt.locale&&(Qt=at.parse(jt.locale,1,Ze),!Qt))return null;let re=null;if(jt.currency&&(re=at.parse(jt.currency,1,Ze),!re))return null;let Ae=null;if(jt["min-fraction-digits"]&&(Ae=at.parse(jt["min-fraction-digits"],1,Le),!Ae))return null;let $e=null;return jt["max-fraction-digits"]&&($e=at.parse(jt["max-fraction-digits"],1,Le),!$e)?null:new Ds(kt,Qt,re,Ae,$e)}evaluate(R){return new Intl.NumberFormat(this.locale?this.locale.evaluate(R):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(R):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(R):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(R):void 0}).format(this.number.evaluate(R))}eachChild(R){R(this.number),this.locale&&R(this.locale),this.currency&&R(this.currency),this.minFractionDigits&&R(this.minFractionDigits),this.maxFractionDigits&&R(this.maxFractionDigits)}outputDefined(){return!1}}class Ol{constructor(R){this.type=Er,this.sections=R}static parse(R,at){if(R.length<2)return at.error("Expected at least one argument.");let kt=R[1];if(!Array.isArray(kt)&&typeof kt=="object")return at.error("First argument must be an image or text section.");let jt=[],Qt=!1;for(let re=1;re<=R.length-1;++re){let Ae=R[re];if(Qt&&typeof Ae=="object"&&!Array.isArray(Ae)){Qt=!1;let $e=null;if(Ae["font-scale"]&&($e=at.parse(Ae["font-scale"],1,Le),!$e))return null;let or=null;if(Ae["text-font"]&&(or=at.parse(Ae["text-font"],1,Xt(Ze)),!or))return null;let Cr=null;if(Ae["text-color"]&&(Cr=at.parse(Ae["text-color"],1,mr),!Cr))return null;let $r=jt[jt.length-1];$r.scale=$e,$r.font=or,$r.textColor=Cr}else{let $e=at.parse(R[re],1,Jr);if(!$e)return null;let or=$e.type.kind;if(or!=="string"&&or!=="value"&&or!=="null"&&or!=="resolvedImage")return at.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Qt=!0,jt.push({content:$e,scale:null,font:null,textColor:null})}}return new Ol(jt)}evaluate(R){return new Un(this.sections.map(at=>{let kt=at.content.evaluate(R);return Ei(kt)===_n?new Zn("",kt,null,null,null):new Zn(Ga(kt),null,at.scale?at.scale.evaluate(R):null,at.font?at.font.evaluate(R).join(","):null,at.textColor?at.textColor.evaluate(R):null)}))}eachChild(R){for(let at of this.sections)R(at.content),at.scale&&R(at.scale),at.font&&R(at.font),at.textColor&&R(at.textColor)}outputDefined(){return!1}}class tc{constructor(R){this.type=_n,this.input=R}static parse(R,at){if(R.length!==2)return at.error("Expected two arguments.");let kt=at.parse(R[1],1,Ze);return kt?new tc(kt):at.error("No image name provided.")}evaluate(R){let at=this.input.evaluate(R),kt=Zi.fromString(at);return kt&&R.availableImages&&(kt.available=R.availableImages.indexOf(at)>-1),kt}eachChild(R){R(this.input)}outputDefined(){return!1}}class sc{constructor(R){this.type=Le,this.input=R}static parse(R,at){if(R.length!==2)return at.error(`Expected 1 argument, but found ${R.length-1} instead.`);let kt=at.parse(R[1],1);return kt?kt.type.kind!=="array"&&kt.type.kind!=="string"&&kt.type.kind!=="value"?at.error(`Expected argument of type string or array, but found ${oe(kt.type)} instead.`):new sc(kt):null}evaluate(R){let at=this.input.evaluate(R);if(typeof at=="string")return[...at].length;if(Array.isArray(at))return at.length;throw new Fe(`Expected value to be of type string or array, but found ${oe(Ei(at))} instead.`)}eachChild(R){R(this.input)}outputDefined(){return!1}}let Xs=8192;function Wa(X,R){let at=(180+X[0])/360,kt=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X[1]*Math.PI/360)))/360,jt=Math.pow(2,R.z);return[Math.round(at*jt*Xs),Math.round(kt*jt*Xs)]}function Co(X,R){let at=Math.pow(2,R.z);return[(jt=(X[0]/Xs+R.x)/at,360*jt-180),(kt=(X[1]/Xs+R.y)/at,360/Math.PI*Math.atan(Math.exp((180-360*kt)*Math.PI/180))-90)];var kt,jt}function el(X,R){X[0]=Math.min(X[0],R[0]),X[1]=Math.min(X[1],R[1]),X[2]=Math.max(X[2],R[0]),X[3]=Math.max(X[3],R[1])}function lc(X,R){return!(X[0]<=R[0]||X[2]>=R[2]||X[1]<=R[1]||X[3]>=R[3])}function ss(X,R,at){let kt=X[0]-R[0],jt=X[1]-R[1],Qt=X[0]-at[0],re=X[1]-at[1];return kt*re-Qt*jt==0&&kt*Qt<=0&&jt*re<=0}function nc(X,R,at,kt){return(jt=[kt[0]-at[0],kt[1]-at[1]])[0]*(Qt=[R[0]-X[0],R[1]-X[1]])[1]-jt[1]*Qt[0]!=0&&!(!js(X,R,at,kt)||!js(at,kt,X,R));var jt,Qt}function yl(X,R,at){for(let kt of at)for(let jt=0;jt(jt=X)[1]!=(re=Ae[$e+1])[1]>jt[1]&&jt[0]<(re[0]-Qt[0])*(jt[1]-Qt[1])/(re[1]-Qt[1])+Qt[0]&&(kt=!kt)}var jt,Qt,re;return kt}function Gc(X,R){for(let at of R)if($l(X,at))return!0;return!1}function ko(X,R){for(let at of X)if(!$l(at,R))return!1;for(let at=0;at0&&Ae<0||re<0&&Ae>0}function mc(X,R,at){let kt=[];for(let jt=0;jtat[2]){let jt=.5*kt,Qt=X[0]-at[0]>jt?-kt:at[0]-X[0]>jt?kt:0;Qt===0&&(Qt=X[0]-at[2]>jt?-kt:at[2]-X[0]>jt?kt:0),X[0]+=Qt}el(R,X)}function Rc(X,R,at,kt){let jt=Math.pow(2,kt.z)*Xs,Qt=[kt.x*Xs,kt.y*Xs],re=[];for(let Ae of X)for(let $e of Ae){let or=[$e.x+Qt[0],$e.y+Qt[1]];us(or,R,at,jt),re.push(or)}return re}function iu(X,R,at,kt){let jt=Math.pow(2,kt.z)*Xs,Qt=[kt.x*Xs,kt.y*Xs],re=[];for(let $e of X){let or=[];for(let Cr of $e){let $r=[Cr.x+Qt[0],Cr.y+Qt[1]];el(R,$r),or.push($r)}re.push(or)}if(R[2]-R[0]<=jt/2){(Ae=R)[0]=Ae[1]=1/0,Ae[2]=Ae[3]=-1/0;for(let $e of re)for(let or of $e)us(or,R,at,jt)}var Ae;return re}class Dl{constructor(R,at){this.type=Qe,this.geojson=R,this.geometries=at}static parse(R,at){if(R.length!==2)return at.error(`'within' expression requires exactly one argument, but found ${R.length-1} instead.`);if(ca(R[1])){let kt=R[1];if(kt.type==="FeatureCollection"){let jt=[];for(let Qt of kt.features){let{type:re,coordinates:Ae}=Qt.geometry;re==="Polygon"&&jt.push(Ae),re==="MultiPolygon"&&jt.push(...Ae)}if(jt.length)return new Dl(kt,{type:"MultiPolygon",coordinates:jt})}else if(kt.type==="Feature"){let jt=kt.geometry.type;if(jt==="Polygon"||jt==="MultiPolygon")return new Dl(kt,kt.geometry)}else if(kt.type==="Polygon"||kt.type==="MultiPolygon")return new Dl(kt,kt)}return at.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(at,kt){let jt=[1/0,1/0,-1/0,-1/0],Qt=[1/0,1/0,-1/0,-1/0],re=at.canonicalID();if(kt.type==="Polygon"){let Ae=mc(kt.coordinates,Qt,re),$e=Rc(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!$l(or,Ae))return!1}if(kt.type==="MultiPolygon"){let Ae=Tl(kt.coordinates,Qt,re),$e=Rc(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!Gc(or,Ae))return!1}return!0}(R,this.geometries);if(R.geometryType()==="LineString")return function(at,kt){let jt=[1/0,1/0,-1/0,-1/0],Qt=[1/0,1/0,-1/0,-1/0],re=at.canonicalID();if(kt.type==="Polygon"){let Ae=mc(kt.coordinates,Qt,re),$e=iu(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!ko(or,Ae))return!1}if(kt.type==="MultiPolygon"){let Ae=Tl(kt.coordinates,Qt,re),$e=iu(at.geometry(),jt,Qt,re);if(!lc(jt,Qt))return!1;for(let or of $e)if(!zs(or,Ae))return!1}return!0}(R,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let ql=class{constructor(X=[],R=(at,kt)=>atkt?1:0){if(this.data=X,this.length=this.data.length,this.compare=R,this.length>0)for(let at=(this.length>>1)-1;at>=0;at--)this._down(at)}push(X){this.data.push(X),this._up(this.length++)}pop(){if(this.length===0)return;let X=this.data[0],R=this.data.pop();return--this.length>0&&(this.data[0]=R,this._down(0)),X}peek(){return this.data[0]}_up(X){let{data:R,compare:at}=this,kt=R[X];for(;X>0;){let jt=X-1>>1,Qt=R[jt];if(at(kt,Qt)>=0)break;R[X]=Qt,X=jt}R[X]=kt}_down(X){let{data:R,compare:at}=this,kt=this.length>>1,jt=R[X];for(;X=0)break;R[X]=R[Qt],X=Qt}R[X]=jt}};function cc(X,R,at,kt,jt){dc(X,R,at,kt||X.length-1,jt||Ah)}function dc(X,R,at,kt,jt){for(;kt>at;){if(kt-at>600){var Qt=kt-at+1,re=R-at+1,Ae=Math.log(Qt),$e=.5*Math.exp(2*Ae/3),or=.5*Math.sqrt(Ae*$e*(Qt-$e)/Qt)*(re-Qt/2<0?-1:1);dc(X,R,Math.max(at,Math.floor(R-re*$e/Qt+or)),Math.min(kt,Math.floor(R+(Qt-re)*$e/Qt+or)),jt)}var Cr=X[R],$r=at,ln=kt;for(pu(X,at,R),jt(X[kt],Cr)>0&&pu(X,at,kt);$r0;)ln--}jt(X[at],Cr)===0?pu(X,at,ln):pu(X,++ln,kt),ln<=R&&(at=ln+1),R<=ln&&(kt=ln-1)}}function pu(X,R,at){var kt=X[R];X[R]=X[at],X[at]=kt}function Ah(X,R){return XR?1:0}function uh(X,R){if(X.length<=1)return[X];let at=[],kt,jt;for(let Qt of X){let re=tf(Qt);re!==0&&(Qt.area=Math.abs(re),jt===void 0&&(jt=re<0),jt===re<0?(kt&&at.push(kt),kt=[Qt]):kt.push(Qt))}if(kt&&at.push(kt),R>1)for(let Qt=0;Qt1?(or=R[$e+1][0],Cr=R[$e+1][1]):kn>0&&(or+=$r/this.kx*kn,Cr+=ln/this.ky*kn)),$r=this.wrap(at[0]-or)*this.kx,ln=(at[1]-Cr)*this.ky;let Fn=$r*$r+ln*ln;Fn180;)R-=360;return R}}function xu(X,R){return R[0]-X[0]}function mu(X){return X[1]-X[0]+1}function bu(X,R){return X[1]>=X[0]&&X[1]X[1])return[null,null];let at=mu(X);if(R){if(at===2)return[X,null];let jt=Math.floor(at/2);return[[X[0],X[0]+jt],[X[0]+jt,X[1]]]}if(at===1)return[X,null];let kt=Math.floor(at/2)-1;return[[X[0],X[0]+kt],[X[0]+kt+1,X[1]]]}function _c(X,R){if(!bu(R,X.length))return[1/0,1/0,-1/0,-1/0];let at=[1/0,1/0,-1/0,-1/0];for(let kt=R[0];kt<=R[1];++kt)el(at,X[kt]);return at}function gu(X){let R=[1/0,1/0,-1/0,-1/0];for(let at of X)for(let kt of at)el(R,kt);return R}function pl(X){return X[0]!==-1/0&&X[1]!==-1/0&&X[2]!==1/0&&X[3]!==1/0}function ic(X,R,at){if(!pl(X)||!pl(R))return NaN;let kt=0,jt=0;return X[2]R[2]&&(kt=X[0]-R[2]),X[1]>R[3]&&(jt=X[1]-R[3]),X[3]=kt)return kt;if(lc(jt,Qt)){if(pp(X,R))return 0}else if(pp(R,X))return 0;let re=1/0;for(let Ae of X)for(let $e=0,or=Ae.length,Cr=or-1;$e0;){let $e=re.pop();if($e[0]>=Qt)continue;let or=$e[1],Cr=R?50:100;if(mu(or)<=Cr){if(!bu(or,X.length))return NaN;if(R){let $r=hl(X,or,at,kt);if(isNaN($r)||$r===0)return $r;Qt=Math.min(Qt,$r)}else for(let $r=or[0];$r<=or[1];++$r){let ln=Xf(X[$r],at,kt);if(Qt=Math.min(Qt,ln),Qt===0)return 0}}else{let $r=_h(or,R);cs(re,Qt,kt,X,Ae,$r[0]),cs(re,Qt,kt,X,Ae,$r[1])}}return Qt}function hu(X,R,at,kt,jt,Qt=1/0){let re=Math.min(Qt,jt.distance(X[0],at[0]));if(re===0)return re;let Ae=new ql([[0,[0,X.length-1],[0,at.length-1]]],xu);for(;Ae.length>0;){let $e=Ae.pop();if($e[0]>=re)continue;let or=$e[1],Cr=$e[2],$r=R?50:100,ln=kt?50:100;if(mu(or)<=$r&&mu(Cr)<=ln){if(!bu(or,X.length)&&bu(Cr,at.length))return NaN;let kn;if(R&&kt)kn=Qh(X,or,at,Cr,jt),re=Math.min(re,kn);else if(R&&!kt){let Fn=X.slice(or[0],or[1]+1);for(let Kn=Cr[0];Kn<=Cr[1];++Kn)if(kn=jh(at[Kn],Fn,jt),re=Math.min(re,kn),re===0)return re}else if(!R&&kt){let Fn=at.slice(Cr[0],Cr[1]+1);for(let Kn=or[0];Kn<=or[1];++Kn)if(kn=jh(X[Kn],Fn,jt),re=Math.min(re,kn),re===0)return re}else kn=Lc(X,or,at,Cr,jt),re=Math.min(re,kn)}else{let kn=_h(or,R),Fn=_h(Cr,kt);_d(Ae,re,jt,X,at,kn[0],Fn[0]),_d(Ae,re,jt,X,at,kn[0],Fn[1]),_d(Ae,re,jt,X,at,kn[1],Fn[0]),_d(Ae,re,jt,X,at,kn[1],Fn[1])}}return re}function rf(X){return X.type==="MultiPolygon"?X.coordinates.map(R=>({type:"Polygon",coordinates:R})):X.type==="MultiLineString"?X.coordinates.map(R=>({type:"LineString",coordinates:R})):X.type==="MultiPoint"?X.coordinates.map(R=>({type:"Point",coordinates:R})):[X]}class td{constructor(R,at){this.type=Le,this.geojson=R,this.geometries=at}static parse(R,at){if(R.length!==2)return at.error(`'distance' expression requires exactly one argument, but found ${R.length-1} instead.`);if(ca(R[1])){let kt=R[1];if(kt.type==="FeatureCollection")return new td(kt,kt.features.map(jt=>rf(jt.geometry)).flat());if(kt.type==="Feature")return new td(kt,rf(kt.geometry));if("type"in kt&&"coordinates"in kt)return new td(kt,rf(kt))}return at.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(at,kt){let jt=at.geometry(),Qt=jt.flat().map($e=>Co([$e.x,$e.y],at.canonical));if(jt.length===0)return NaN;let re=new ef(Qt[0][1]),Ae=1/0;for(let $e of kt){switch($e.type){case"Point":Ae=Math.min(Ae,hu(Qt,!1,[$e.coordinates],!1,re,Ae));break;case"LineString":Ae=Math.min(Ae,hu(Qt,!1,$e.coordinates,!0,re,Ae));break;case"Polygon":Ae=Math.min(Ae,xh(Qt,!1,$e.coordinates,re,Ae))}if(Ae===0)return Ae}return Ae}(R,this.geometries);if(R.geometryType()==="LineString")return function(at,kt){let jt=at.geometry(),Qt=jt.flat().map($e=>Co([$e.x,$e.y],at.canonical));if(jt.length===0)return NaN;let re=new ef(Qt[0][1]),Ae=1/0;for(let $e of kt){switch($e.type){case"Point":Ae=Math.min(Ae,hu(Qt,!0,[$e.coordinates],!1,re,Ae));break;case"LineString":Ae=Math.min(Ae,hu(Qt,!0,$e.coordinates,!0,re,Ae));break;case"Polygon":Ae=Math.min(Ae,xh(Qt,!0,$e.coordinates,re,Ae))}if(Ae===0)return Ae}return Ae}(R,this.geometries);if(R.geometryType()==="Polygon")return function(at,kt){let jt=at.geometry();if(jt.length===0||jt[0].length===0)return NaN;let Qt=uh(jt,0).map($e=>$e.map(or=>or.map(Cr=>Co([Cr.x,Cr.y],at.canonical)))),re=new ef(Qt[0][0][0][1]),Ae=1/0;for(let $e of kt)for(let or of Qt){switch($e.type){case"Point":Ae=Math.min(Ae,xh([$e.coordinates],!1,or,re,Ae));break;case"LineString":Ae=Math.min(Ae,xh($e.coordinates,!0,or,re,Ae));break;case"Polygon":Ae=Math.min(Ae,Hl(or,$e.coordinates,re,Ae))}if(Ae===0)return Ae}return Ae}(R,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Ed={"==":ms,"!=":kl,">":Kl,"<":ul,">=":Ns,"<=":vs,array:Kr,at:yr,boolean:Kr,case:xi,coalesce:ps,collator:Uo,format:Ol,image:tc,in:en,"index-of":Rn,interpolate:Ka,"interpolate-hcl":Ka,"interpolate-lab":Ka,length:sc,let:bn,literal:so,match:ni,number:Kr,"number-format":Ds,object:Kr,slice:Jn,step:pi,string:Kr,"to-boolean":cn,"to-color":cn,"to-number":cn,"to-string":cn,var:ze,within:Dl,distance:td};class vu{constructor(R,at,kt,jt){this.name=R,this.type=at,this._evaluate=kt,this.args=jt}evaluate(R){return this._evaluate(R,this.args)}eachChild(R){this.args.forEach(R)}outputDefined(){return!1}static parse(R,at){let kt=R[0],jt=vu.definitions[kt];if(!jt)return at.error(`Unknown expression "${kt}". If you wanted a literal array, use ["literal", [...]].`,0);let Qt=Array.isArray(jt)?jt[0]:jt.type,re=Array.isArray(jt)?[[jt[1],jt[2]]]:jt.overloads,Ae=re.filter(([or])=>!Array.isArray(or)||or.length===R.length-1),$e=null;for(let[or,Cr]of Ae){$e=new Pn(at.registry,nf,at.path,null,at.scope);let $r=[],ln=!1;for(let kn=1;kn{return ln=$r,Array.isArray(ln)?`(${ln.map(oe).join(", ")})`:`(${oe(ln.type)}...)`;var ln}).join(" | "),Cr=[];for(let $r=1;$r{at=R?at&&nf(kt):at&&kt instanceof so}),!!at&&af(X)&&df(X,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function af(X){if(X instanceof vu&&(X.name==="get"&&X.args.length===1||X.name==="feature-state"||X.name==="has"&&X.args.length===1||X.name==="properties"||X.name==="geometry-type"||X.name==="id"||/^filter-/.test(X.name))||X instanceof Dl||X instanceof td)return!1;let R=!0;return X.eachChild(at=>{R&&!af(at)&&(R=!1)}),R}function bh(X){if(X instanceof vu&&X.name==="feature-state")return!1;let R=!0;return X.eachChild(at=>{R&&!bh(at)&&(R=!1)}),R}function df(X,R){if(X instanceof vu&&R.indexOf(X.name)>=0)return!1;let at=!0;return X.eachChild(kt=>{at&&!df(kt,R)&&(at=!1)}),at}function Uh(X){return{result:"success",value:X}}function Mh(X){return{result:"error",value:X}}function yu(X){return X["property-type"]==="data-driven"||X["property-type"]==="cross-faded-data-driven"}function fd(X){return!!X.expression&&X.expression.parameters.indexOf("zoom")>-1}function of(X){return!!X.expression&&X.expression.interpolated}function uc(X){return X instanceof Number?"number":X instanceof String?"string":X instanceof Boolean?"boolean":Array.isArray(X)?"array":X===null?"null":typeof X}function jd(X){return typeof X=="object"&&X!==null&&!Array.isArray(X)}function Jf(X){return X}function ff(X,R){let at=R.type==="color",kt=X.stops&&typeof X.stops[0][0]=="object",jt=kt||!(kt||X.property!==void 0),Qt=X.type||(of(R)?"exponential":"interval");if(at||R.type==="padding"){let Cr=at?Ar.parse:Wn.parse;(X=Lt({},X)).stops&&(X.stops=X.stops.map($r=>[$r[0],Cr($r[1])])),X.default=Cr(X.default?X.default:R.default)}if(X.colorSpace&&(re=X.colorSpace)!=="rgb"&&re!=="hcl"&&re!=="lab")throw new Error(`Unknown color space: "${X.colorSpace}"`);var re;let Ae,$e,or;if(Qt==="exponential")Ae=mf;else if(Qt==="interval")Ae=Xu;else if(Qt==="categorical"){Ae=pf,$e=Object.create(null);for(let Cr of X.stops)$e[Cr[0]]=Cr[1];or=typeof X.stops[0][0]}else{if(Qt!=="identity")throw new Error(`Unknown function type "${Qt}"`);Ae=Vc}if(kt){let Cr={},$r=[];for(let Fn=0;FnFn[0]),evaluate:({zoom:Fn},Kn)=>mf({stops:ln,base:X.base},R,Fn).evaluate(Fn,Kn)}}if(jt){let Cr=Qt==="exponential"?{name:"exponential",base:X.base!==void 0?X.base:1}:null;return{kind:"camera",interpolationType:Cr,interpolationFactor:Ka.interpolationFactor.bind(void 0,Cr),zoomStops:X.stops.map($r=>$r[0]),evaluate:({zoom:$r})=>Ae(X,R,$r,$e,or)}}return{kind:"source",evaluate(Cr,$r){let ln=$r&&$r.properties?$r.properties[X.property]:void 0;return ln===void 0?Pd(X.default,R.default):Ae(X,R,ln,$e,or)}}}function Pd(X,R,at){return X!==void 0?X:R!==void 0?R:at!==void 0?at:void 0}function pf(X,R,at,kt,jt){return Pd(typeof at===jt?kt[at]:void 0,X.default,R.default)}function Xu(X,R,at){if(uc(at)!=="number")return Pd(X.default,R.default);let kt=X.stops.length;if(kt===1||at<=X.stops[0][0])return X.stops[0][1];if(at>=X.stops[kt-1][0])return X.stops[kt-1][1];let jt=Gn(X.stops.map(Qt=>Qt[0]),at);return X.stops[jt][1]}function mf(X,R,at){let kt=X.base!==void 0?X.base:1;if(uc(at)!=="number")return Pd(X.default,R.default);let jt=X.stops.length;if(jt===1||at<=X.stops[0][0])return X.stops[0][1];if(at>=X.stops[jt-1][0])return X.stops[jt-1][1];let Qt=Gn(X.stops.map(Cr=>Cr[0]),at),re=function(Cr,$r,ln,kn){let Fn=kn-ln,Kn=Cr-ln;return Fn===0?0:$r===1?Kn/Fn:(Math.pow($r,Kn)-1)/(Math.pow($r,Fn)-1)}(at,kt,X.stops[Qt][0],X.stops[Qt+1][0]),Ae=X.stops[Qt][1],$e=X.stops[Qt+1][1],or=Zo[R.type]||Jf;return typeof Ae.evaluate=="function"?{evaluate(...Cr){let $r=Ae.evaluate.apply(void 0,Cr),ln=$e.evaluate.apply(void 0,Cr);if($r!==void 0&&ln!==void 0)return or($r,ln,re,X.colorSpace)}}:or(Ae,$e,re,X.colorSpace)}function Vc(X,R,at){switch(R.type){case"color":at=Ar.parse(at);break;case"formatted":at=Un.fromString(at.toString());break;case"resolvedImage":at=Zi.fromString(at.toString());break;case"padding":at=Wn.parse(at);break;default:uc(at)===R.type||R.type==="enum"&&R.values[at]||(at=void 0)}return Pd(at,X.default,R.default)}vu.register(Ed,{error:[{kind:"error"},[Ze],(X,[R])=>{throw new Fe(R.evaluate(X))}],typeof:[Ze,[Jr],(X,[R])=>oe(Ei(R.evaluate(X)))],"to-rgba":[Xt(Le,4),[mr],(X,[R])=>{let[at,kt,jt,Qt]=R.evaluate(X).rgb;return[255*at,255*kt,255*jt,Qt]}],rgb:[mr,[Le,Le,Le],Lf],rgba:[mr,[Le,Le,Le,Le],Lf],has:{type:Qe,overloads:[[[Ze],(X,[R])=>hf(R.evaluate(X),X.properties())],[[Ze,fr],(X,[R,at])=>hf(R.evaluate(X),at.evaluate(X))]]},get:{type:Jr,overloads:[[[Ze],(X,[R])=>Ld(R.evaluate(X),X.properties())],[[Ze,fr],(X,[R,at])=>Ld(R.evaluate(X),at.evaluate(X))]]},"feature-state":[Jr,[Ze],(X,[R])=>Ld(R.evaluate(X),X.featureState||{})],properties:[fr,[],X=>X.properties()],"geometry-type":[Ze,[],X=>X.geometryType()],id:[Jr,[],X=>X.id()],zoom:[Le,[],X=>X.globals.zoom],"heatmap-density":[Le,[],X=>X.globals.heatmapDensity||0],"line-progress":[Le,[],X=>X.globals.lineProgress||0],accumulated:[Jr,[],X=>X.globals.accumulated===void 0?null:X.globals.accumulated],"+":[Le,ed(Le),(X,R)=>{let at=0;for(let kt of R)at+=kt.evaluate(X);return at}],"*":[Le,ed(Le),(X,R)=>{let at=1;for(let kt of R)at*=kt.evaluate(X);return at}],"-":{type:Le,overloads:[[[Le,Le],(X,[R,at])=>R.evaluate(X)-at.evaluate(X)],[[Le],(X,[R])=>-R.evaluate(X)]]},"/":[Le,[Le,Le],(X,[R,at])=>R.evaluate(X)/at.evaluate(X)],"%":[Le,[Le,Le],(X,[R,at])=>R.evaluate(X)%at.evaluate(X)],ln2:[Le,[],()=>Math.LN2],pi:[Le,[],()=>Math.PI],e:[Le,[],()=>Math.E],"^":[Le,[Le,Le],(X,[R,at])=>Math.pow(R.evaluate(X),at.evaluate(X))],sqrt:[Le,[Le],(X,[R])=>Math.sqrt(R.evaluate(X))],log10:[Le,[Le],(X,[R])=>Math.log(R.evaluate(X))/Math.LN10],ln:[Le,[Le],(X,[R])=>Math.log(R.evaluate(X))],log2:[Le,[Le],(X,[R])=>Math.log(R.evaluate(X))/Math.LN2],sin:[Le,[Le],(X,[R])=>Math.sin(R.evaluate(X))],cos:[Le,[Le],(X,[R])=>Math.cos(R.evaluate(X))],tan:[Le,[Le],(X,[R])=>Math.tan(R.evaluate(X))],asin:[Le,[Le],(X,[R])=>Math.asin(R.evaluate(X))],acos:[Le,[Le],(X,[R])=>Math.acos(R.evaluate(X))],atan:[Le,[Le],(X,[R])=>Math.atan(R.evaluate(X))],min:[Le,ed(Le),(X,R)=>Math.min(...R.map(at=>at.evaluate(X)))],max:[Le,ed(Le),(X,R)=>Math.max(...R.map(at=>at.evaluate(X)))],abs:[Le,[Le],(X,[R])=>Math.abs(R.evaluate(X))],round:[Le,[Le],(X,[R])=>{let at=R.evaluate(X);return at<0?-Math.round(-at):Math.round(at)}],floor:[Le,[Le],(X,[R])=>Math.floor(R.evaluate(X))],ceil:[Le,[Le],(X,[R])=>Math.ceil(R.evaluate(X))],"filter-==":[Qe,[Ze,Jr],(X,[R,at])=>X.properties()[R.value]===at.value],"filter-id-==":[Qe,[Jr],(X,[R])=>X.id()===R.value],"filter-type-==":[Qe,[Ze],(X,[R])=>X.geometryType()===R.value],"filter-<":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt>jt}],"filter-id->":[Qe,[Jr],(X,[R])=>{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at>kt}],"filter-<=":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt<=jt}],"filter-id-<=":[Qe,[Jr],(X,[R])=>{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at<=kt}],"filter->=":[Qe,[Ze,Jr],(X,[R,at])=>{let kt=X.properties()[R.value],jt=at.value;return typeof kt==typeof jt&&kt>=jt}],"filter-id->=":[Qe,[Jr],(X,[R])=>{let at=X.id(),kt=R.value;return typeof at==typeof kt&&at>=kt}],"filter-has":[Qe,[Jr],(X,[R])=>R.value in X.properties()],"filter-has-id":[Qe,[],X=>X.id()!==null&&X.id()!==void 0],"filter-type-in":[Qe,[Xt(Ze)],(X,[R])=>R.value.indexOf(X.geometryType())>=0],"filter-id-in":[Qe,[Xt(Jr)],(X,[R])=>R.value.indexOf(X.id())>=0],"filter-in-small":[Qe,[Ze,Xt(Jr)],(X,[R,at])=>at.value.indexOf(X.properties()[R.value])>=0],"filter-in-large":[Qe,[Ze,Xt(Jr)],(X,[R,at])=>function(kt,jt,Qt,re){for(;Qt<=re;){let Ae=Qt+re>>1;if(jt[Ae]===kt)return!0;jt[Ae]>kt?re=Ae-1:Qt=Ae+1}return!1}(X.properties()[R.value],at.value,0,at.value.length-1)],all:{type:Qe,overloads:[[[Qe,Qe],(X,[R,at])=>R.evaluate(X)&&at.evaluate(X)],[ed(Qe),(X,R)=>{for(let at of R)if(!at.evaluate(X))return!1;return!0}]]},any:{type:Qe,overloads:[[[Qe,Qe],(X,[R,at])=>R.evaluate(X)||at.evaluate(X)],[ed(Qe),(X,R)=>{for(let at of R)if(at.evaluate(X))return!0;return!1}]]},"!":[Qe,[Qe],(X,[R])=>!R.evaluate(X)],"is-supported-script":[Qe,[Ze],(X,[R])=>{let at=X.globals&&X.globals.isSupportedScript;return!at||at(R.evaluate(X))}],upcase:[Ze,[Ze],(X,[R])=>R.evaluate(X).toUpperCase()],downcase:[Ze,[Ze],(X,[R])=>R.evaluate(X).toLowerCase()],concat:[Ze,ed(Jr),(X,R)=>R.map(at=>Ga(at.evaluate(X))).join("")],"resolved-locale":[Ze,[an],(X,[R])=>R.evaluate(X).resolvedLocale()]});class Ju{constructor(R,at){var kt;this.expression=R,this._warningHistory={},this._evaluator=new un,this._defaultValue=at?(kt=at).type==="color"&&jd(kt.default)?new Ar(0,0,0,0):kt.type==="color"?Ar.parse(kt.default)||null:kt.type==="padding"?Wn.parse(kt.default)||null:kt.type==="variableAnchorOffsetCollection"?Fi.parse(kt.default)||null:kt.default===void 0?null:kt.default:null,this._enumValues=at&&at.type==="enum"?at.values:null}evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re){return this._evaluator.globals=R,this._evaluator.feature=at,this._evaluator.featureState=kt,this._evaluator.canonical=jt,this._evaluator.availableImages=Qt||null,this._evaluator.formattedSection=re,this.expression.evaluate(this._evaluator)}evaluate(R,at,kt,jt,Qt,re){this._evaluator.globals=R,this._evaluator.feature=at||null,this._evaluator.featureState=kt||null,this._evaluator.canonical=jt,this._evaluator.availableImages=Qt||null,this._evaluator.formattedSection=re||null;try{let Ae=this.expression.evaluate(this._evaluator);if(Ae==null||typeof Ae=="number"&&Ae!=Ae)return this._defaultValue;if(this._enumValues&&!(Ae in this._enumValues))throw new Fe(`Expected value to be one of ${Object.keys(this._enumValues).map($e=>JSON.stringify($e)).join(", ")}, but found ${JSON.stringify(Ae)} instead.`);return Ae}catch(Ae){return this._warningHistory[Ae.message]||(this._warningHistory[Ae.message]=!0,typeof console<"u"&&console.warn(Ae.message)),this._defaultValue}}}function rd(X){return Array.isArray(X)&&X.length>0&&typeof X[0]=="string"&&X[0]in Ed}function xc(X,R){let at=new Pn(Ed,nf,[],R?function(jt){let Qt={color:mr,string:Ze,number:Le,enum:Ze,boolean:Qe,formatted:Er,padding:dn,resolvedImage:_n,variableAnchorOffsetCollection:Oe};return jt.type==="array"?Xt(Qt[jt.value]||Jr,jt.length):Qt[jt.type]}(R):void 0),kt=at.parse(X,void 0,void 0,void 0,R&&R.type==="string"?{typeAnnotation:"coerce"}:void 0);return kt?Uh(new Ju(kt,R)):Mh(at.errors)}class $h{constructor(R,at){this.kind=R,this._styleExpression=at,this.isStateDependent=R!=="constant"&&!bh(at.expression)}evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re){return this._styleExpression.evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re)}evaluate(R,at,kt,jt,Qt,re){return this._styleExpression.evaluate(R,at,kt,jt,Qt,re)}}class ju{constructor(R,at,kt,jt){this.kind=R,this.zoomStops=kt,this._styleExpression=at,this.isStateDependent=R!=="camera"&&!bh(at.expression),this.interpolationType=jt}evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re){return this._styleExpression.evaluateWithoutErrorHandling(R,at,kt,jt,Qt,re)}evaluate(R,at,kt,jt,Qt,re){return this._styleExpression.evaluate(R,at,kt,jt,Qt,re)}interpolationFactor(R,at,kt){return this.interpolationType?Ka.interpolationFactor(this.interpolationType,R,at,kt):0}}function Qu(X,R){let at=xc(X,R);if(at.result==="error")return at;let kt=at.value.expression,jt=af(kt);if(!jt&&!yu(R))return Mh([new ie("","data expressions not supported")]);let Qt=df(kt,["zoom"]);if(!Qt&&!fd(R))return Mh([new ie("","zoom expressions not supported")]);let re=xd(kt);return re||Qt?re instanceof ie?Mh([re]):re instanceof Ka&&!of(R)?Mh([new ie("",'"interpolate" expressions cannot be used with this property')]):Uh(re?new ju(jt?"camera":"composite",at.value,re.labels,re instanceof Ka?re.interpolation:void 0):new $h(jt?"constant":"source",at.value)):Mh([new ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Pc{constructor(R,at){this._parameters=R,this._specification=at,Lt(this,ff(this._parameters,this._specification))}static deserialize(R){return new Pc(R._parameters,R._specification)}static serialize(R){return{_parameters:R._parameters,_specification:R._specification}}}function xd(X){let R=null;if(X instanceof bn)R=xd(X.result);else if(X instanceof ps){for(let at of X.args)if(R=xd(at),R)break}else(X instanceof pi||X instanceof Ka)&&X.input instanceof vu&&X.input.name==="zoom"&&(R=X);return R instanceof ie||X.eachChild(at=>{let kt=xd(at);kt instanceof ie?R=kt:!R&&kt?R=new ie("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):R&&kt&&R!==kt&&(R=new ie("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),R}function Eh(X){if(X===!0||X===!1)return!0;if(!Array.isArray(X)||X.length===0)return!1;switch(X[0]){case"has":return X.length>=2&&X[1]!=="$id"&&X[1]!=="$type";case"in":return X.length>=3&&(typeof X[1]!="string"||Array.isArray(X[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return X.length!==3||Array.isArray(X[1])||Array.isArray(X[2]);case"any":case"all":for(let R of X.slice(1))if(!Eh(R)&&typeof R!="boolean")return!1;return!0;default:return!0}}let nd={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ud(X){if(X==null)return{filter:()=>!0,needGeometry:!1};Eh(X)||(X=bd(X));let R=xc(X,nd);if(R.result==="error")throw new Error(R.value.map(at=>`${at.key}: ${at.message}`).join(", "));return{filter:(at,kt,jt)=>R.value.evaluate(at,kt,{},jt),needGeometry:Ap(X)}}function Qf(X,R){return XR?1:0}function Ap(X){if(!Array.isArray(X))return!1;if(X[0]==="within"||X[0]==="distance")return!0;for(let R=1;R"||R==="<="||R===">="?$d(X[1],X[2],R):R==="any"?(at=X.slice(1),["any"].concat(at.map(bd))):R==="all"?["all"].concat(X.slice(1).map(bd)):R==="none"?["all"].concat(X.slice(1).map(bd).map(hh)):R==="in"?zu(X[1],X.slice(2)):R==="!in"?hh(zu(X[1],X.slice(2))):R==="has"?wd(X[1]):R!=="!has"||hh(wd(X[1]));var at}function $d(X,R,at){switch(X){case"$type":return[`filter-type-${at}`,R];case"$id":return[`filter-id-${at}`,R];default:return[`filter-${at}`,X,R]}}function zu(X,R){if(R.length===0)return!1;switch(X){case"$type":return["filter-type-in",["literal",R]];case"$id":return["filter-id-in",["literal",R]];default:return R.length>200&&!R.some(at=>typeof at!=typeof R[0])?["filter-in-large",X,["literal",R.sort(Qf)]]:["filter-in-small",X,["literal",R]]}}function wd(X){switch(X){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",X]}}function hh(X){return["!",X]}function kd(X){let R=typeof X;if(R==="number"||R==="boolean"||R==="string"||X==null)return JSON.stringify(X);if(Array.isArray(X)){let jt="[";for(let Qt of X)jt+=`${kd(Qt)},`;return`${jt}]`}let at=Object.keys(X).sort(),kt="{";for(let jt=0;jtkt.maximum?[new Ot(R,at,`${at} is greater than the maximum value ${kt.maximum}`)]:[]}function Id(X){let R=X.valueSpec,at=Ic(X.value.type),kt,jt,Qt,re={},Ae=at!=="categorical"&&X.value.property===void 0,$e=!Ae,or=uc(X.value.stops)==="array"&&uc(X.value.stops[0])==="array"&&uc(X.value.stops[0][0])==="object",Cr=th({key:X.key,value:X.value,valueSpec:X.styleSpec.function,validateSpec:X.validateSpec,style:X.style,styleSpec:X.styleSpec,objectElementValidators:{stops:function(kn){if(at==="identity")return[new Ot(kn.key,kn.value,'identity function may not have a "stops" property')];let Fn=[],Kn=kn.value;return Fn=Fn.concat(Pf({key:kn.key,value:Kn,valueSpec:kn.valueSpec,validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec,arrayElementValidator:$r})),uc(Kn)==="array"&&Kn.length===0&&Fn.push(new Ot(kn.key,Kn,"array must have at least one stop")),Fn},default:function(kn){return kn.validateSpec({key:kn.key,value:kn.value,valueSpec:R,validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec})}}});return at==="identity"&&Ae&&Cr.push(new Ot(X.key,X.value,'missing required property "property"')),at==="identity"||X.value.stops||Cr.push(new Ot(X.key,X.value,'missing required property "stops"')),at==="exponential"&&X.valueSpec.expression&&!of(X.valueSpec)&&Cr.push(new Ot(X.key,X.value,"exponential functions not supported")),X.styleSpec.$version>=8&&($e&&!yu(X.valueSpec)?Cr.push(new Ot(X.key,X.value,"property functions not supported")):Ae&&!fd(X.valueSpec)&&Cr.push(new Ot(X.key,X.value,"zoom functions not supported"))),at!=="categorical"&&!or||X.value.property!==void 0||Cr.push(new Ot(X.key,X.value,'"property" property is required')),Cr;function $r(kn){let Fn=[],Kn=kn.value,mi=kn.key;if(uc(Kn)!=="array")return[new Ot(mi,Kn,`array expected, ${uc(Kn)} found`)];if(Kn.length!==2)return[new Ot(mi,Kn,`array length 2 expected, length ${Kn.length} found`)];if(or){if(uc(Kn[0])!=="object")return[new Ot(mi,Kn,`object expected, ${uc(Kn[0])} found`)];if(Kn[0].zoom===void 0)return[new Ot(mi,Kn,"object stop key must have zoom")];if(Kn[0].value===void 0)return[new Ot(mi,Kn,"object stop key must have value")];if(Qt&&Qt>Ic(Kn[0].zoom))return[new Ot(mi,Kn[0].zoom,"stop zoom values must appear in ascending order")];Ic(Kn[0].zoom)!==Qt&&(Qt=Ic(Kn[0].zoom),jt=void 0,re={}),Fn=Fn.concat(th({key:`${mi}[0]`,value:Kn[0],valueSpec:{zoom:{}},validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec,objectElementValidators:{zoom:Mc,value:ln}}))}else Fn=Fn.concat(ln({key:`${mi}[0]`,value:Kn[0],validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec},Kn));return rd(Hh(Kn[1]))?Fn.concat([new Ot(`${mi}[1]`,Kn[1],"expressions are not allowed in function stops.")]):Fn.concat(kn.validateSpec({key:`${mi}[1]`,value:Kn[1],valueSpec:R,validateSpec:kn.validateSpec,style:kn.style,styleSpec:kn.styleSpec}))}function ln(kn,Fn){let Kn=uc(kn.value),mi=Ic(kn.value),Ui=kn.value!==null?kn.value:Fn;if(kt){if(Kn!==kt)return[new Ot(kn.key,Ui,`${Kn} stop domain type must match previous stop domain type ${kt}`)]}else kt=Kn;if(Kn!=="number"&&Kn!=="string"&&Kn!=="boolean")return[new Ot(kn.key,Ui,"stop domain value must be a number, string, or boolean")];if(Kn!=="number"&&at!=="categorical"){let Na=`number expected, ${Kn} found`;return yu(R)&&at===void 0&&(Na+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ot(kn.key,Ui,Na)]}return at!=="categorical"||Kn!=="number"||isFinite(mi)&&Math.floor(mi)===mi?at!=="categorical"&&Kn==="number"&&jt!==void 0&&minew Ot(`${X.key}${kt.key}`,X.value,kt.message));let at=R.value.expression||R.value._styleExpression.expression;if(X.expressionContext==="property"&&X.propertyKey==="text-font"&&!at.outputDefined())return[new Ot(X.key,X.value,`Invalid data expression for "${X.propertyKey}". Output values must be contained as literals within the expression.`)];if(X.expressionContext==="property"&&X.propertyType==="layout"&&!bh(at))return[new Ot(X.key,X.value,'"feature-state" data expressions are not supported with layout properties.')];if(X.expressionContext==="filter"&&!bh(at))return[new Ot(X.key,X.value,'"feature-state" data expressions are not supported with filters.')];if(X.expressionContext&&X.expressionContext.indexOf("cluster")===0){if(!df(at,["zoom","feature-state"]))return[new Ot(X.key,X.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(X.expressionContext==="cluster-initial"&&!af(at))return[new Ot(X.key,X.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function dh(X){let R=X.key,at=X.value,kt=X.valueSpec,jt=[];return Array.isArray(kt.values)?kt.values.indexOf(Ic(at))===-1&&jt.push(new Ot(R,at,`expected one of [${kt.values.join(", ")}], ${JSON.stringify(at)} found`)):Object.keys(kt.values).indexOf(Ic(at))===-1&&jt.push(new Ot(R,at,`expected one of [${Object.keys(kt.values).join(", ")}], ${JSON.stringify(at)} found`)),jt}function pd(X){return Eh(Hh(X.value))?id(Lt({},X,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ad(X)}function ad(X){let R=X.value,at=X.key;if(uc(R)!=="array")return[new Ot(at,R,`array expected, ${uc(R)} found`)];let kt=X.styleSpec,jt,Qt=[];if(R.length<1)return[new Ot(at,R,"filter array must have at least 1 element")];switch(Qt=Qt.concat(dh({key:`${at}[0]`,value:R[0],valueSpec:kt.filter_operator,style:X.style,styleSpec:X.styleSpec})),Ic(R[0])){case"<":case"<=":case">":case">=":R.length>=2&&Ic(R[1])==="$type"&&Qt.push(new Ot(at,R,`"$type" cannot be use with operator "${R[0]}"`));case"==":case"!=":R.length!==3&&Qt.push(new Ot(at,R,`filter array for operator "${R[0]}" must have 3 elements`));case"in":case"!in":R.length>=2&&(jt=uc(R[1]),jt!=="string"&&Qt.push(new Ot(`${at}[1]`,R[1],`string expected, ${jt} found`)));for(let re=2;re{or in at&&R.push(new Ot(kt,at[or],`"${or}" is prohibited for ref layers`))}),jt.layers.forEach(or=>{Ic(or.id)===Ae&&($e=or)}),$e?$e.ref?R.push(new Ot(kt,at.ref,"ref cannot reference another ref layer")):re=Ic($e.type):R.push(new Ot(kt,at.ref,`ref layer "${Ae}" not found`))}else if(re!=="background")if(at.source){let $e=jt.sources&&jt.sources[at.source],or=$e&&Ic($e.type);$e?or==="vector"&&re==="raster"?R.push(new Ot(kt,at.source,`layer "${at.id}" requires a raster source`)):or!=="raster-dem"&&re==="hillshade"?R.push(new Ot(kt,at.source,`layer "${at.id}" requires a raster-dem source`)):or==="raster"&&re!=="raster"?R.push(new Ot(kt,at.source,`layer "${at.id}" requires a vector source`)):or!=="vector"||at["source-layer"]?or==="raster-dem"&&re!=="hillshade"?R.push(new Ot(kt,at.source,"raster-dem source can only be used with layer type 'hillshade'.")):re!=="line"||!at.paint||!at.paint["line-gradient"]||or==="geojson"&&$e.lineMetrics||R.push(new Ot(kt,at,`layer "${at.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):R.push(new Ot(kt,at,`layer "${at.id}" must specify a "source-layer"`)):R.push(new Ot(kt,at.source,`source "${at.source}" not found`))}else R.push(new Ot(kt,at,'missing required property "source"'));return R=R.concat(th({key:kt,value:at,valueSpec:Qt.layer,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,objectElementValidators:{"*":()=>[],type:()=>X.validateSpec({key:`${kt}.type`,value:at.type,valueSpec:Qt.layer.type,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,object:at,objectKey:"type"}),filter:pd,layout:$e=>th({layer:at,key:$e.key,value:$e.value,style:$e.style,styleSpec:$e.styleSpec,validateSpec:$e.validateSpec,objectElementValidators:{"*":or=>Au(Lt({layerType:re},or))}}),paint:$e=>th({layer:at,key:$e.key,value:$e.value,style:$e.style,styleSpec:$e.styleSpec,validateSpec:$e.validateSpec,objectElementValidators:{"*":or=>tp(Lt({layerType:re},or))}})}})),R}function fh(X){let R=X.value,at=X.key,kt=uc(R);return kt!=="string"?[new Ot(at,R,`string expected, ${kt} found`)]:[]}let Vh={promoteId:function({key:X,value:R}){if(uc(R)==="string")return fh({key:X,value:R});{let at=[];for(let kt in R)at.push(...fh({key:`${X}.${kt}`,value:R[kt]}));return at}}};function Ph(X){let R=X.value,at=X.key,kt=X.styleSpec,jt=X.style,Qt=X.validateSpec;if(!R.type)return[new Ot(at,R,'"type" is required')];let re=Ic(R.type),Ae;switch(re){case"vector":case"raster":return Ae=th({key:at,value:R,valueSpec:kt[`source_${re.replace("-","_")}`],style:X.style,styleSpec:kt,objectElementValidators:Vh,validateSpec:Qt}),Ae;case"raster-dem":return Ae=function($e){var or;let Cr=(or=$e.sourceName)!==null&&or!==void 0?or:"",$r=$e.value,ln=$e.styleSpec,kn=ln.source_raster_dem,Fn=$e.style,Kn=[],mi=uc($r);if($r===void 0)return Kn;if(mi!=="object")return Kn.push(new Ot("source_raster_dem",$r,`object expected, ${mi} found`)),Kn;let Ui=Ic($r.encoding)==="custom",Na=["redFactor","greenFactor","blueFactor","baseShift"],fa=$e.value.encoding?`"${$e.value.encoding}"`:"Default";for(let La in $r)!Ui&&Na.includes(La)?Kn.push(new Ot(La,$r[La],`In "${Cr}": "${La}" is only valid when "encoding" is set to "custom". ${fa} encoding found`)):kn[La]?Kn=Kn.concat($e.validateSpec({key:La,value:$r[La],valueSpec:kn[La],validateSpec:$e.validateSpec,style:Fn,styleSpec:ln})):Kn.push(new Ot(La,$r[La],`unknown property "${La}"`));return Kn}({sourceName:at,value:R,style:X.style,styleSpec:kt,validateSpec:Qt}),Ae;case"geojson":if(Ae=th({key:at,value:R,valueSpec:kt.source_geojson,style:jt,styleSpec:kt,validateSpec:Qt,objectElementValidators:Vh}),R.cluster)for(let $e in R.clusterProperties){let[or,Cr]=R.clusterProperties[$e],$r=typeof or=="string"?[or,["accumulated"],["get",$e]]:or;Ae.push(...id({key:`${at}.${$e}.map`,value:Cr,expressionContext:"cluster-map"})),Ae.push(...id({key:`${at}.${$e}.reduce`,value:$r,expressionContext:"cluster-reduce"}))}return Ae;case"video":return th({key:at,value:R,valueSpec:kt.source_video,style:jt,validateSpec:Qt,styleSpec:kt});case"image":return th({key:at,value:R,valueSpec:kt.source_image,style:jt,validateSpec:Qt,styleSpec:kt});case"canvas":return[new Ot(at,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return dh({key:`${at}.type`,value:R.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Zc(X){let R=X.value,at=X.styleSpec,kt=at.light,jt=X.style,Qt=[],re=uc(R);if(R===void 0)return Qt;if(re!=="object")return Qt=Qt.concat([new Ot("light",R,`object expected, ${re} found`)]),Qt;for(let Ae in R){let $e=Ae.match(/^(.*)-transition$/);Qt=Qt.concat($e&&kt[$e[1]]&&kt[$e[1]].transition?X.validateSpec({key:Ae,value:R[Ae],valueSpec:at.transition,validateSpec:X.validateSpec,style:jt,styleSpec:at}):kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],validateSpec:X.validateSpec,style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)])}return Qt}function fc(X){let R=X.value,at=X.styleSpec,kt=at.sky,jt=X.style,Qt=uc(R);if(R===void 0)return[];if(Qt!=="object")return[new Ot("sky",R,`object expected, ${Qt} found`)];let re=[];for(let Ae in R)re=re.concat(kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)]);return re}function Ih(X){let R=X.value,at=X.styleSpec,kt=at.terrain,jt=X.style,Qt=[],re=uc(R);if(R===void 0)return Qt;if(re!=="object")return Qt=Qt.concat([new Ot("terrain",R,`object expected, ${re} found`)]),Qt;for(let Ae in R)Qt=Qt.concat(kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],validateSpec:X.validateSpec,style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)]);return Qt}function Td(X){let R=[],at=X.value,kt=X.key;if(Array.isArray(at)){let jt=[],Qt=[];for(let re in at)at[re].id&&jt.includes(at[re].id)&&R.push(new Ot(kt,at,`all the sprites' ids must be unique, but ${at[re].id} is duplicated`)),jt.push(at[re].id),at[re].url&&Qt.includes(at[re].url)&&R.push(new Ot(kt,at,`all the sprites' URLs must be unique, but ${at[re].url} is duplicated`)),Qt.push(at[re].url),R=R.concat(th({key:`${kt}[${re}]`,value:at[re],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:X.validateSpec}));return R}return fh({key:kt,value:at})}let Dh={"*":()=>[],array:Pf,boolean:function(X){let R=X.value,at=X.key,kt=uc(R);return kt!=="boolean"?[new Ot(at,R,`boolean expected, ${kt} found`)]:[]},number:Mc,color:function(X){let R=X.key,at=X.value,kt=uc(at);return kt!=="string"?[new Ot(R,at,`color expected, ${kt} found`)]:Ar.parse(String(at))?[]:[new Ot(R,at,`color expected, "${at}" found`)]},constants:Lh,enum:dh,filter:pd,function:Id,layer:gf,object:th,source:Ph,light:Zc,sky:fc,terrain:Ih,projection:function(X){let R=X.value,at=X.styleSpec,kt=at.projection,jt=X.style,Qt=uc(R);if(R===void 0)return[];if(Qt!=="object")return[new Ot("projection",R,`object expected, ${Qt} found`)];let re=[];for(let Ae in R)re=re.concat(kt[Ae]?X.validateSpec({key:Ae,value:R[Ae],valueSpec:kt[Ae],style:jt,styleSpec:at}):[new Ot(Ae,R[Ae],`unknown property "${Ae}"`)]);return re},string:fh,formatted:function(X){return fh(X).length===0?[]:id(X)},resolvedImage:function(X){return fh(X).length===0?[]:id(X)},padding:function(X){let R=X.key,at=X.value;if(uc(at)==="array"){if(at.length<1||at.length>4)return[new Ot(R,at,`padding requires 1 to 4 values; ${at.length} values found`)];let kt={type:"number"},jt=[];for(let Qt=0;Qt[]}})),X.constants&&(at=at.concat(Lh({key:"constants",value:X.constants}))),An(at)}function Nn(X){return function(R){return X(Ce(we({},R),{validateSpec:sf}))}}function An(X){return[].concat(X).sort((R,at)=>R.line-at.line)}function di(X){return function(...R){return An(X.apply(this,R))}}Qr.source=di(Nn(Ph)),Qr.sprite=di(Nn(Td)),Qr.glyphs=di(Nn(br)),Qr.light=di(Nn(Zc)),Qr.sky=di(Nn(fc)),Qr.terrain=di(Nn(Ih)),Qr.layer=di(Nn(gf)),Qr.filter=di(Nn(pd)),Qr.paintProperty=di(Nn(tp)),Qr.layoutProperty=di(Nn(Au));let Pi=Qr,ga=Pi.light,Pa=Pi.sky,Qa=Pi.paintProperty,uo=Pi.layoutProperty;function Sa(X,R){let at=!1;if(R&&R.length)for(let kt of R)X.fire(new J(new Error(kt.message))),at=!0;return at}class Za{constructor(R,at,kt){let jt=this.cells=[];if(R instanceof ArrayBuffer){this.arrayBuffer=R;let re=new Int32Array(this.arrayBuffer);R=re[0],this.d=(at=re[1])+2*(kt=re[2]);for(let $e=0;$e=$r[Fn+0]&&jt>=$r[Fn+1])?(Ae[kn]=!0,re.push(Cr[kn])):Ae[kn]=!1}}}}_forEachCell(R,at,kt,jt,Qt,re,Ae,$e){let or=this._convertToCellCoord(R),Cr=this._convertToCellCoord(at),$r=this._convertToCellCoord(kt),ln=this._convertToCellCoord(jt);for(let kn=or;kn<=$r;kn++)for(let Fn=Cr;Fn<=ln;Fn++){let Kn=this.d*Fn+kn;if((!$e||$e(this._convertFromCellCoord(kn),this._convertFromCellCoord(Fn),this._convertFromCellCoord(kn+1),this._convertFromCellCoord(Fn+1)))&&Qt.call(this,R,at,kt,jt,Kn,re,Ae,$e))return}}_convertFromCellCoord(R){return(R-this.padding)/this.scale}_convertToCellCoord(R){return Math.max(0,Math.min(this.d-1,Math.floor(R*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let R=this.cells,at=3+this.cells.length+1+1,kt=0;for(let re=0;re=0)continue;let re=X[Qt];jt[Qt]=Ra[at].shallow.indexOf(Qt)>=0?re:gs(re,R)}X instanceof Error&&(jt.message=X.message)}if(jt.$name)throw new Error("$name property is reserved for worker serialization logic.");return at!=="Object"&&(jt.$name=at),jt}function ws(X){if(os(X))return X;if(Array.isArray(X))return X.map(ws);if(typeof X!="object")throw new Error("can't deserialize object of type "+typeof X);let R=fs(X)||"Object";if(!Ra[R])throw new Error(`can't deserialize unregistered class ${R}`);let{klass:at}=Ra[R];if(!at)throw new Error(`can't deserialize unregistered class ${R}`);if(at.deserialize)return at.deserialize(X);let kt=Object.create(at.prototype);for(let jt of Object.keys(X)){if(jt==="$name")continue;let Qt=X[jt];kt[jt]=Ra[R].shallow.indexOf(jt)>=0?Qt:ws(Qt)}return kt}class bo{constructor(){this.first=!0}update(R,at){let kt=Math.floor(R);return this.first?(this.first=!1,this.lastIntegerZoom=kt,this.lastIntegerZoomTime=0,this.lastZoom=R,this.lastFloorZoom=kt,!0):(this.lastFloorZoom>kt?(this.lastIntegerZoom=kt+1,this.lastIntegerZoomTime=at):this.lastFloorZoomX>=128&&X<=255,"Hangul Jamo":X=>X>=4352&&X<=4607,Khmer:X=>X>=6016&&X<=6143,"General Punctuation":X=>X>=8192&&X<=8303,"Letterlike Symbols":X=>X>=8448&&X<=8527,"Number Forms":X=>X>=8528&&X<=8591,"Miscellaneous Technical":X=>X>=8960&&X<=9215,"Control Pictures":X=>X>=9216&&X<=9279,"Optical Character Recognition":X=>X>=9280&&X<=9311,"Enclosed Alphanumerics":X=>X>=9312&&X<=9471,"Geometric Shapes":X=>X>=9632&&X<=9727,"Miscellaneous Symbols":X=>X>=9728&&X<=9983,"Miscellaneous Symbols and Arrows":X=>X>=11008&&X<=11263,"Ideographic Description Characters":X=>X>=12272&&X<=12287,"CJK Symbols and Punctuation":X=>X>=12288&&X<=12351,Katakana:X=>X>=12448&&X<=12543,Kanbun:X=>X>=12688&&X<=12703,"CJK Strokes":X=>X>=12736&&X<=12783,"Enclosed CJK Letters and Months":X=>X>=12800&&X<=13055,"CJK Compatibility":X=>X>=13056&&X<=13311,"Yijing Hexagram Symbols":X=>X>=19904&&X<=19967,"Private Use Area":X=>X>=57344&&X<=63743,"Vertical Forms":X=>X>=65040&&X<=65055,"CJK Compatibility Forms":X=>X>=65072&&X<=65103,"Small Form Variants":X=>X>=65104&&X<=65135,"Halfwidth and Fullwidth Forms":X=>X>=65280&&X<=65519};function ks(X){for(let R of X)if(El(R.charCodeAt(0)))return!0;return!1}function dl(X){for(let R of X)if(!ec(R.charCodeAt(0)))return!1;return!0}function Vl(X){let R=X.map(at=>{try{return new RegExp(`\\p{sc=${at}}`,"u").source}catch{return null}}).filter(at=>at);return new RegExp(R.join("|"),"u")}let gc=Vl(["Arab","Dupl","Mong","Ougr","Syrc"]);function ec(X){return!gc.test(String.fromCodePoint(X))}let vc=Vl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function El(X){return!(X!==746&&X!==747&&(X<4352||!(lo["CJK Compatibility Forms"](X)&&!(X>=65097&&X<=65103)||lo["CJK Compatibility"](X)||lo["CJK Strokes"](X)||!(!lo["CJK Symbols and Punctuation"](X)||X>=12296&&X<=12305||X>=12308&&X<=12319||X===12336)||lo["Enclosed CJK Letters and Months"](X)||lo["Ideographic Description Characters"](X)||lo.Kanbun(X)||lo.Katakana(X)&&X!==12540||!(!lo["Halfwidth and Fullwidth Forms"](X)||X===65288||X===65289||X===65293||X>=65306&&X<=65310||X===65339||X===65341||X===65343||X>=65371&&X<=65503||X===65507||X>=65512&&X<=65519)||!(!lo["Small Form Variants"](X)||X>=65112&&X<=65118||X>=65123&&X<=65126)||lo["Vertical Forms"](X)||lo["Yijing Hexagram Symbols"](X)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(X))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(X))||vc.test(String.fromCodePoint(X)))))}function tu(X){return!(El(X)||function(R){return!!(lo["Latin-1 Supplement"](R)&&(R===167||R===169||R===174||R===177||R===188||R===189||R===190||R===215||R===247)||lo["General Punctuation"](R)&&(R===8214||R===8224||R===8225||R===8240||R===8241||R===8251||R===8252||R===8258||R===8263||R===8264||R===8265||R===8273)||lo["Letterlike Symbols"](R)||lo["Number Forms"](R)||lo["Miscellaneous Technical"](R)&&(R>=8960&&R<=8967||R>=8972&&R<=8991||R>=8996&&R<=9e3||R===9003||R>=9085&&R<=9114||R>=9150&&R<=9165||R===9167||R>=9169&&R<=9179||R>=9186&&R<=9215)||lo["Control Pictures"](R)&&R!==9251||lo["Optical Character Recognition"](R)||lo["Enclosed Alphanumerics"](R)||lo["Geometric Shapes"](R)||lo["Miscellaneous Symbols"](R)&&!(R>=9754&&R<=9759)||lo["Miscellaneous Symbols and Arrows"](R)&&(R>=11026&&R<=11055||R>=11088&&R<=11097||R>=11192&&R<=11243)||lo["CJK Symbols and Punctuation"](R)||lo.Katakana(R)||lo["Private Use Area"](R)||lo["CJK Compatibility Forms"](R)||lo["Small Form Variants"](R)||lo["Halfwidth and Fullwidth Forms"](R)||R===8734||R===8756||R===8757||R>=9984&&R<=10087||R>=10102&&R<=10131||R===65532||R===65533)}(X))}let $c=Vl(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function bc(X){return $c.test(String.fromCodePoint(X))}function qo(X,R){return!(!R&&bc(X)||X>=2304&&X<=3583||X>=3840&&X<=4255||lo.Khmer(X))}function Bs(X){for(let R of X)if(bc(R.charCodeAt(0)))return!0;return!1}let ac=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(X){this.pluginStatus=X.pluginStatus,this.pluginURL=X.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(X){this.applyArabicShaping=X.applyArabicShaping,this.processBidirectionalText=X.processBidirectionalText,this.processStyledBidirectionalText=X.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Zl{constructor(R,at){this.zoom=R,at?(this.now=at.now,this.fadeDuration=at.fadeDuration,this.zoomHistory=at.zoomHistory,this.transition=at.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new bo,this.transition={})}isSupportedScript(R){return function(at,kt){for(let jt of at)if(!qo(jt.charCodeAt(0),kt))return!1;return!0}(R,ac.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let R=this.zoom,at=R-Math.floor(R),kt=this.crossFadingFactor();return R>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:at+(1-at)*kt}:{fromScale:.5,toScale:1,t:1-(1-kt)*at}}}class Mu{constructor(R,at){this.property=R,this.value=at,this.expression=function(kt,jt){if(jd(kt))return new Pc(kt,jt);if(rd(kt)){let Qt=Qu(kt,jt);if(Qt.result==="error")throw new Error(Qt.value.map(re=>`${re.key}: ${re.message}`).join(", "));return Qt.value}{let Qt=kt;return jt.type==="color"&&typeof kt=="string"?Qt=Ar.parse(kt):jt.type!=="padding"||typeof kt!="number"&&!Array.isArray(kt)?jt.type==="variableAnchorOffsetCollection"&&Array.isArray(kt)&&(Qt=Fi.parse(kt)):Qt=Wn.parse(kt),{kind:"constant",evaluate:()=>Qt}}}(at===void 0?R.specification.default:at,R.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(R,at,kt){return this.property.possiblyEvaluate(this,R,at,kt)}}class eh{constructor(R){this.property=R,this.value=new Mu(R,void 0)}transitioned(R,at){return new Wh(this.property,this.value,at,E({},R.transition,this.transition),R.now)}untransitioned(){return new Wh(this.property,this.value,null,{},0)}}class Vu{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitionablePropertyValues)}getValue(R){return g(this._values[R].value.value)}setValue(R,at){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].value=new Mu(this._values[R].property,at===null?void 0:g(at))}getTransition(R){return g(this._values[R].transition)}setTransition(R,at){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].transition=g(at)||void 0}serialize(){let R={};for(let at of Object.keys(this._values)){let kt=this.getValue(at);kt!==void 0&&(R[at]=kt);let jt=this.getTransition(at);jt!==void 0&&(R[`${at}-transition`]=jt)}return R}transitioned(R,at){let kt=new rh(this._properties);for(let jt of Object.keys(this._values))kt._values[jt]=this._values[jt].transitioned(R,at._values[jt]);return kt}untransitioned(){let R=new rh(this._properties);for(let at of Object.keys(this._values))R._values[at]=this._values[at].untransitioned();return R}}class Wh{constructor(R,at,kt,jt,Qt){this.property=R,this.value=at,this.begin=Qt+jt.delay||0,this.end=this.begin+jt.duration||0,R.specification.transition&&(jt.delay||jt.duration)&&(this.prior=kt)}possiblyEvaluate(R,at,kt){let jt=R.now||0,Qt=this.value.possiblyEvaluate(R,at,kt),re=this.prior;if(re){if(jt>this.end)return this.prior=null,Qt;if(this.value.isDataDriven())return this.prior=null,Qt;if(jt=1)return 1;let or=$e*$e,Cr=or*$e;return 4*($e<.5?Cr:3*($e-or)+Cr-.75)}(Ae))}}return Qt}}class rh{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitioningPropertyValues)}possiblyEvaluate(R,at,kt){let jt=new Gh(this._properties);for(let Qt of Object.keys(this._values))jt._values[Qt]=this._values[Qt].possiblyEvaluate(R,at,kt);return jt}hasTransition(){for(let R of Object.keys(this._values))if(this._values[R].prior)return!0;return!1}}class qh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPropertyValues)}hasValue(R){return this._values[R].value!==void 0}getValue(R){return g(this._values[R].value)}setValue(R,at){this._values[R]=new Mu(this._values[R].property,at===null?void 0:g(at))}serialize(){let R={};for(let at of Object.keys(this._values)){let kt=this.getValue(at);kt!==void 0&&(R[at]=kt)}return R}possiblyEvaluate(R,at,kt){let jt=new Gh(this._properties);for(let Qt of Object.keys(this._values))jt._values[Qt]=this._values[Qt].possiblyEvaluate(R,at,kt);return jt}}class Wc{constructor(R,at,kt){this.property=R,this.value=at,this.parameters=kt}isConstant(){return this.value.kind==="constant"}constantOr(R){return this.value.kind==="constant"?this.value.value:R}evaluate(R,at,kt,jt){return this.property.evaluate(this.value,this.parameters,R,at,kt,jt)}}class Gh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPossiblyEvaluatedValues)}get(R){return this._values[R]}}class ds{constructor(R){this.specification=R}possiblyEvaluate(R,at){if(R.isDataDriven())throw new Error("Value should not be data driven");return R.expression.evaluate(at)}interpolate(R,at,kt){let jt=Zo[this.specification.type];return jt?jt(R,at,kt):R}}class $s{constructor(R,at){this.specification=R,this.overrides=at}possiblyEvaluate(R,at,kt,jt){return new Wc(this,R.expression.kind==="constant"||R.expression.kind==="camera"?{kind:"constant",value:R.expression.evaluate(at,null,{},kt,jt)}:R.expression,at)}interpolate(R,at,kt){if(R.value.kind!=="constant"||at.value.kind!=="constant")return R;if(R.value.value===void 0||at.value.value===void 0)return new Wc(this,{kind:"constant",value:void 0},R.parameters);let jt=Zo[this.specification.type];if(jt){let Qt=jt(R.value.value,at.value.value,kt);return new Wc(this,{kind:"constant",value:Qt},R.parameters)}return R}evaluate(R,at,kt,jt,Qt,re){return R.kind==="constant"?R.value:R.evaluate(at,kt,jt,Qt,re)}}class nh extends $s{possiblyEvaluate(R,at,kt,jt){if(R.value===void 0)return new Wc(this,{kind:"constant",value:void 0},at);if(R.expression.kind==="constant"){let Qt=R.expression.evaluate(at,null,{},kt,jt),re=R.property.specification.type==="resolvedImage"&&typeof Qt!="string"?Qt.name:Qt,Ae=this._calculate(re,re,re,at);return new Wc(this,{kind:"constant",value:Ae},at)}if(R.expression.kind==="camera"){let Qt=this._calculate(R.expression.evaluate({zoom:at.zoom-1}),R.expression.evaluate({zoom:at.zoom}),R.expression.evaluate({zoom:at.zoom+1}),at);return new Wc(this,{kind:"constant",value:Qt},at)}return new Wc(this,R.expression,at)}evaluate(R,at,kt,jt,Qt,re){if(R.kind==="source"){let Ae=R.evaluate(at,kt,jt,Qt,re);return this._calculate(Ae,Ae,Ae,at)}return R.kind==="composite"?this._calculate(R.evaluate({zoom:Math.floor(at.zoom)-1},kt,jt),R.evaluate({zoom:Math.floor(at.zoom)},kt,jt),R.evaluate({zoom:Math.floor(at.zoom)+1},kt,jt),at):R.value}_calculate(R,at,kt,jt){return jt.zoom>jt.zoomHistory.lastIntegerZoom?{from:R,to:at}:{from:kt,to:at}}interpolate(R){return R}}class eu{constructor(R){this.specification=R}possiblyEvaluate(R,at,kt,jt){if(R.value!==void 0){if(R.expression.kind==="constant"){let Qt=R.expression.evaluate(at,null,{},kt,jt);return this._calculate(Qt,Qt,Qt,at)}return this._calculate(R.expression.evaluate(new Zl(Math.floor(at.zoom-1),at)),R.expression.evaluate(new Zl(Math.floor(at.zoom),at)),R.expression.evaluate(new Zl(Math.floor(at.zoom+1),at)),at)}}_calculate(R,at,kt,jt){return jt.zoom>jt.zoomHistory.lastIntegerZoom?{from:R,to:at}:{from:kt,to:at}}interpolate(R){return R}}class lf{constructor(R){this.specification=R}possiblyEvaluate(R,at,kt,jt){return!!R.expression.evaluate(at,null,{},kt,jt)}interpolate(){return!1}}class Kt{constructor(R){this.properties=R,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let at in R){let kt=R[at];kt.specification.overridable&&this.overridableProperties.push(at);let jt=this.defaultPropertyValues[at]=new Mu(kt,void 0),Qt=this.defaultTransitionablePropertyValues[at]=new eh(kt);this.defaultTransitioningPropertyValues[at]=Qt.untransitioned(),this.defaultPossiblyEvaluatedValues[at]=jt.possiblyEvaluate({})}}}pa("DataDrivenProperty",$s),pa("DataConstantProperty",ds),pa("CrossFadedDataDrivenProperty",nh),pa("CrossFadedProperty",eu),pa("ColorRampProperty",lf);let O="-transition";class pt extends mt{constructor(R,at){if(super(),this.id=R.id,this.type=R.type,this._featureFilter={filter:()=>!0,needGeometry:!1},R.type!=="custom"&&(this.metadata=R.metadata,this.minzoom=R.minzoom,this.maxzoom=R.maxzoom,R.type!=="background"&&(this.source=R.source,this.sourceLayer=R["source-layer"],this.filter=R.filter),at.layout&&(this._unevaluatedLayout=new qh(at.layout)),at.paint)){this._transitionablePaint=new Vu(at.paint);for(let kt in R.paint)this.setPaintProperty(kt,R.paint[kt],{validate:!1});for(let kt in R.layout)this.setLayoutProperty(kt,R.layout[kt],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Gh(at.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(R){return R==="visibility"?this.visibility:this._unevaluatedLayout.getValue(R)}setLayoutProperty(R,at,kt={}){at!=null&&this._validate(uo,`layers.${this.id}.layout.${R}`,R,at,kt)||(R!=="visibility"?this._unevaluatedLayout.setValue(R,at):this.visibility=at)}getPaintProperty(R){return R.endsWith(O)?this._transitionablePaint.getTransition(R.slice(0,-11)):this._transitionablePaint.getValue(R)}setPaintProperty(R,at,kt={}){if(at!=null&&this._validate(Qa,`layers.${this.id}.paint.${R}`,R,at,kt))return!1;if(R.endsWith(O))return this._transitionablePaint.setTransition(R.slice(0,-11),at||void 0),!1;{let jt=this._transitionablePaint._values[R],Qt=jt.property.specification["property-type"]==="cross-faded-data-driven",re=jt.value.isDataDriven(),Ae=jt.value;this._transitionablePaint.setValue(R,at),this._handleSpecialPaintPropertyUpdate(R);let $e=this._transitionablePaint._values[R].value;return $e.isDataDriven()||re||Qt||this._handleOverridablePaintPropertyUpdate(R,Ae,$e)}}_handleSpecialPaintPropertyUpdate(R){}_handleOverridablePaintPropertyUpdate(R,at,kt){return!1}isHidden(R){return!!(this.minzoom&&R=this.maxzoom)||this.visibility==="none"}updateTransitions(R){this._transitioningPaint=this._transitionablePaint.transitioned(R,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(R,at){R.getCrossfadeParameters&&(this._crossfadeParameters=R.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(R,void 0,at)),this.paint=this._transitioningPaint.possiblyEvaluate(R,void 0,at)}serialize(){let R={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&&(R.layout=R.layout||{},R.layout.visibility=this.visibility),p(R,(at,kt)=>!(at===void 0||kt==="layout"&&!Object.keys(at).length||kt==="paint"&&!Object.keys(at).length))}_validate(R,at,kt,jt,Qt={}){return(!Qt||Qt.validate!==!1)&&Sa(this,R.call(Pi,{key:at,layerType:this.type,objectKey:kt,value:jt,styleSpec:dt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let R in this.paint._values){let at=this.paint.get(R);if(at instanceof Wc&&yu(at.property.specification)&&(at.value.kind==="source"||at.value.kind==="composite")&&at.value.isStateDependent)return!0}return!1}}let Dt={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ft{constructor(R,at){this._structArray=R,this._pos1=at*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class qt{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(R,at){return R._trim(),at&&(R.isTransferred=!0,at.push(R.arrayBuffer)),{length:R.length,arrayBuffer:R.arrayBuffer}}static deserialize(R){let at=Object.create(this.prototype);return at.arrayBuffer=R.arrayBuffer,at.length=R.length,at.capacity=R.arrayBuffer.byteLength/at.bytesPerElement,at._refreshViews(),at}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(R){this.reserve(R),this.length=R}reserve(R){if(R>this.capacity){this.capacity=Math.max(R,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let at=this.uint8;this._refreshViews(),at&&this.uint8.set(at)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Ee(X,R=1){let at=0,kt=0;return{members:X.map(jt=>{let Qt=Dt[jt.type].BYTES_PER_ELEMENT,re=at=je(at,Math.max(R,Qt)),Ae=jt.components||1;return kt=Math.max(kt,Qt),at+=Qt*Ae,{name:jt.name,type:jt.type,components:Ae,offset:re}}),size:je(at,Math.max(kt,R)),alignment:R}}function je(X,R){return Math.ceil(X/R)*R}class er extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at){let kt=this.length;return this.resize(kt+1),this.emplace(kt,R,at)}emplace(R,at,kt){let jt=2*R;return this.int16[jt+0]=at,this.int16[jt+1]=kt,R}}er.prototype.bytesPerElement=4,pa("StructArrayLayout2i4",er);class wr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.int16[Qt+0]=at,this.int16[Qt+1]=kt,this.int16[Qt+2]=jt,R}}wr.prototype.bytesPerElement=6,pa("StructArrayLayout3i6",wr);class Gr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt){let Qt=this.length;return this.resize(Qt+1),this.emplace(Qt,R,at,kt,jt)}emplace(R,at,kt,jt,Qt){let re=4*R;return this.int16[re+0]=at,this.int16[re+1]=kt,this.int16[re+2]=jt,this.int16[re+3]=Qt,R}}Gr.prototype.bytesPerElement=8,pa("StructArrayLayout4i8",Gr);class Zr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=6*R;return this.int16[$e+0]=at,this.int16[$e+1]=kt,this.int16[$e+2]=jt,this.int16[$e+3]=Qt,this.int16[$e+4]=re,this.int16[$e+5]=Ae,R}}Zr.prototype.bytesPerElement=12,pa("StructArrayLayout2i4i12",Zr);class Tn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=4*R,or=8*R;return this.int16[$e+0]=at,this.int16[$e+1]=kt,this.uint8[or+4]=jt,this.uint8[or+5]=Qt,this.uint8[or+6]=re,this.uint8[or+7]=Ae,R}}Tn.prototype.bytesPerElement=8,pa("StructArrayLayout2i4ub8",Tn);class qn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at){let kt=this.length;return this.resize(kt+1),this.emplace(kt,R,at)}emplace(R,at,kt){let jt=2*R;return this.float32[jt+0]=at,this.float32[jt+1]=kt,R}}qn.prototype.bytesPerElement=8,pa("StructArrayLayout2f8",qn);class te extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re,Ae,$e,or,Cr){let $r=this.length;return this.resize($r+1),this.emplace($r,R,at,kt,jt,Qt,re,Ae,$e,or,Cr)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r){let ln=10*R;return this.uint16[ln+0]=at,this.uint16[ln+1]=kt,this.uint16[ln+2]=jt,this.uint16[ln+3]=Qt,this.uint16[ln+4]=re,this.uint16[ln+5]=Ae,this.uint16[ln+6]=$e,this.uint16[ln+7]=or,this.uint16[ln+8]=Cr,this.uint16[ln+9]=$r,R}}te.prototype.bytesPerElement=20,pa("StructArrayLayout10ui20",te);class le extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln){let kn=this.length;return this.resize(kn+1),this.emplace(kn,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn){let Fn=12*R;return this.int16[Fn+0]=at,this.int16[Fn+1]=kt,this.int16[Fn+2]=jt,this.int16[Fn+3]=Qt,this.uint16[Fn+4]=re,this.uint16[Fn+5]=Ae,this.uint16[Fn+6]=$e,this.uint16[Fn+7]=or,this.int16[Fn+8]=Cr,this.int16[Fn+9]=$r,this.int16[Fn+10]=ln,this.int16[Fn+11]=kn,R}}le.prototype.bytesPerElement=24,pa("StructArrayLayout4i4ui4i24",le);class Te extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.float32[Qt+0]=at,this.float32[Qt+1]=kt,this.float32[Qt+2]=jt,R}}Te.prototype.bytesPerElement=12,pa("StructArrayLayout3f12",Te);class Pe extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(R){let at=this.length;return this.resize(at+1),this.emplace(at,R)}emplace(R,at){return this.uint32[1*R+0]=at,R}}Pe.prototype.bytesPerElement=4,pa("StructArrayLayout1ul4",Pe);class We extends qt{_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(R,at,kt,jt,Qt,re,Ae,$e,or){let Cr=this.length;return this.resize(Cr+1),this.emplace(Cr,R,at,kt,jt,Qt,re,Ae,$e,or)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr){let $r=10*R,ln=5*R;return this.int16[$r+0]=at,this.int16[$r+1]=kt,this.int16[$r+2]=jt,this.int16[$r+3]=Qt,this.int16[$r+4]=re,this.int16[$r+5]=Ae,this.uint32[ln+3]=$e,this.uint16[$r+8]=or,this.uint16[$r+9]=Cr,R}}We.prototype.bytesPerElement=20,pa("StructArrayLayout6i1ul2ui20",We);class Ne extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=6*R;return this.int16[$e+0]=at,this.int16[$e+1]=kt,this.int16[$e+2]=jt,this.int16[$e+3]=Qt,this.int16[$e+4]=re,this.int16[$e+5]=Ae,R}}Ne.prototype.bytesPerElement=12,pa("StructArrayLayout2i2i2i12",Ne);class Xe extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt){let re=this.length;return this.resize(re+1),this.emplace(re,R,at,kt,jt,Qt)}emplace(R,at,kt,jt,Qt,re){let Ae=4*R,$e=8*R;return this.float32[Ae+0]=at,this.float32[Ae+1]=kt,this.float32[Ae+2]=jt,this.int16[$e+6]=Qt,this.int16[$e+7]=re,R}}Xe.prototype.bytesPerElement=16,pa("StructArrayLayout2f1f2i16",Xe);class Pr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt,Qt,re){let Ae=this.length;return this.resize(Ae+1),this.emplace(Ae,R,at,kt,jt,Qt,re)}emplace(R,at,kt,jt,Qt,re,Ae){let $e=16*R,or=4*R,Cr=8*R;return this.uint8[$e+0]=at,this.uint8[$e+1]=kt,this.float32[or+1]=jt,this.float32[or+2]=Qt,this.int16[Cr+6]=re,this.int16[Cr+7]=Ae,R}}Pr.prototype.bytesPerElement=16,pa("StructArrayLayout2ub2f2i16",Pr);class qr extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.uint16[Qt+0]=at,this.uint16[Qt+1]=kt,this.uint16[Qt+2]=jt,R}}qr.prototype.bytesPerElement=6,pa("StructArrayLayout3ui6",qr);class Xr extends qt{_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(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui){let Na=this.length;return this.resize(Na+1),this.emplace(Na,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na){let fa=24*R,La=12*R,ho=48*R;return this.int16[fa+0]=at,this.int16[fa+1]=kt,this.uint16[fa+2]=jt,this.uint16[fa+3]=Qt,this.uint32[La+2]=re,this.uint32[La+3]=Ae,this.uint32[La+4]=$e,this.uint16[fa+10]=or,this.uint16[fa+11]=Cr,this.uint16[fa+12]=$r,this.float32[La+7]=ln,this.float32[La+8]=kn,this.uint8[ho+36]=Fn,this.uint8[ho+37]=Kn,this.uint8[ho+38]=mi,this.uint32[La+10]=Ui,this.int16[fa+22]=Na,R}}Xr.prototype.bytesPerElement=48,pa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Xr);class gn extends qt{_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(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na,fa,La,ho,Ro,Os,Nl,Ms,_s,sl,Ks){let Hs=this.length;return this.resize(Hs+1),this.emplace(Hs,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na,fa,La,ho,Ro,Os,Nl,Ms,_s,sl,Ks)}emplace(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn,mi,Ui,Na,fa,La,ho,Ro,Os,Nl,Ms,_s,sl,Ks,Hs){let To=32*R,vl=16*R;return this.int16[To+0]=at,this.int16[To+1]=kt,this.int16[To+2]=jt,this.int16[To+3]=Qt,this.int16[To+4]=re,this.int16[To+5]=Ae,this.int16[To+6]=$e,this.int16[To+7]=or,this.uint16[To+8]=Cr,this.uint16[To+9]=$r,this.uint16[To+10]=ln,this.uint16[To+11]=kn,this.uint16[To+12]=Fn,this.uint16[To+13]=Kn,this.uint16[To+14]=mi,this.uint16[To+15]=Ui,this.uint16[To+16]=Na,this.uint16[To+17]=fa,this.uint16[To+18]=La,this.uint16[To+19]=ho,this.uint16[To+20]=Ro,this.uint16[To+21]=Os,this.uint16[To+22]=Nl,this.uint32[vl+12]=Ms,this.float32[vl+13]=_s,this.float32[vl+14]=sl,this.uint16[To+30]=Ks,this.uint16[To+31]=Hs,R}}gn.prototype.bytesPerElement=64,pa("StructArrayLayout8i15ui1ul2f2ui64",gn);class zn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R){let at=this.length;return this.resize(at+1),this.emplace(at,R)}emplace(R,at){return this.float32[1*R+0]=at,R}}zn.prototype.bytesPerElement=4,pa("StructArrayLayout1f4",zn);class Qn extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=3*R;return this.uint16[6*R+0]=at,this.float32[Qt+1]=kt,this.float32[Qt+2]=jt,R}}Qn.prototype.bytesPerElement=12,pa("StructArrayLayout1ui2f12",Qn);class ai extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at,kt){let jt=this.length;return this.resize(jt+1),this.emplace(jt,R,at,kt)}emplace(R,at,kt,jt){let Qt=4*R;return this.uint32[2*R+0]=at,this.uint16[Qt+2]=kt,this.uint16[Qt+3]=jt,R}}ai.prototype.bytesPerElement=8,pa("StructArrayLayout1ul2ui8",ai);class Ti extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,at){let kt=this.length;return this.resize(kt+1),this.emplace(kt,R,at)}emplace(R,at,kt){let jt=2*R;return this.uint16[jt+0]=at,this.uint16[jt+1]=kt,R}}Ti.prototype.bytesPerElement=4,pa("StructArrayLayout2ui4",Ti);class Qi extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R){let at=this.length;return this.resize(at+1),this.emplace(at,R)}emplace(R,at){return this.uint16[1*R+0]=at,R}}Qi.prototype.bytesPerElement=2,pa("StructArrayLayout1ui2",Qi);class Ma extends qt{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,at,kt,jt){let Qt=this.length;return this.resize(Qt+1),this.emplace(Qt,R,at,kt,jt)}emplace(R,at,kt,jt,Qt){let re=4*R;return this.float32[re+0]=at,this.float32[re+1]=kt,this.float32[re+2]=jt,this.float32[re+3]=Qt,R}}Ma.prototype.bytesPerElement=16,pa("StructArrayLayout4f16",Ma);class Aa extends Ft{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new c(this.anchorPointX,this.anchorPointY)}}Aa.prototype.size=20;class Fa extends We{get(R){return new Aa(this,R)}}pa("CollisionBoxArray",Fa);class wo extends Ft{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(R){this._structArray.uint8[this._pos1+37]=R}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(R){this._structArray.uint8[this._pos1+38]=R}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(R){this._structArray.uint32[this._pos4+10]=R}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}wo.prototype.size=48;class Yo extends Xr{get(R){return new wo(this,R)}}pa("PlacedSymbolArray",Yo);class Fo extends Ft{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(R){this._structArray.uint32[this._pos4+12]=R}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Fo.prototype.size=64;class xs extends gn{get(R){return new Fo(this,R)}}pa("SymbolInstanceArray",xs);class Sl extends zn{getoffsetX(R){return this.float32[1*R+0]}}pa("GlyphOffsetArray",Sl);class Ll extends wr{getx(R){return this.int16[3*R+0]}gety(R){return this.int16[3*R+1]}gettileUnitDistanceFromAnchor(R){return this.int16[3*R+2]}}pa("SymbolLineVertexArray",Ll);class Ws extends Ft{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Ws.prototype.size=12;class zl extends Qn{get(R){return new Ws(this,R)}}pa("TextAnchorOffsetArray",zl);class Fc extends Ft{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]}}Fc.prototype.size=8;class Sc extends ai{get(R){return new Fc(this,R)}}pa("FeatureIndexArray",Sc);class rl extends er{}class nl extends er{}class au extends er{}class wu extends Zr{}class ih extends Tn{}class Et extends qn{}class Vt extends te{}class de extends le{}class Ie extends Te{}class Be extends Pe{}class He extends Ne{}class hr extends Pr{}class cr extends qr{}class Fr extends Ti{}let vn=Ee([{name:"a_pos",components:2,type:"Int16"}],4),{members:fn}=vn;class Bn{constructor(R=[]){this.segments=R}prepareSegment(R,at,kt,jt){let Qt=this.segments[this.segments.length-1];return R>Bn.MAX_VERTEX_ARRAY_LENGTH&&S(`Max vertices per segment is ${Bn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${R}`),(!Qt||Qt.vertexLength+R>Bn.MAX_VERTEX_ARRAY_LENGTH||Qt.sortKey!==jt)&&(Qt={vertexOffset:at.length,primitiveOffset:kt.length,vertexLength:0,primitiveLength:0},jt!==void 0&&(Qt.sortKey=jt),this.segments.push(Qt)),Qt}get(){return this.segments}destroy(){for(let R of this.segments)for(let at in R.vaos)R.vaos[at].destroy()}static simpleSegment(R,at,kt,jt){return new Bn([{vertexOffset:R,primitiveOffset:at,vertexLength:kt,primitiveLength:jt,vaos:{},sortKey:0}])}}function ti(X,R){return 256*(X=w(Math.floor(X),0,255))+w(Math.floor(R),0,255)}Bn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,pa("SegmentVector",Bn);let ei=Ee([{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 ra={exports:{}},si={exports:{}};si.exports=function(X,R){var at,kt,jt,Qt,re,Ae,$e,or;for(kt=X.length-(at=3&X.length),jt=R,re=3432918353,Ae=461845907,or=0;or>>16)*re&65535)<<16)&4294967295)<<15|$e>>>17))*Ae+((($e>>>16)*Ae&65535)<<16)&4294967295)<<13|jt>>>19))+((5*(jt>>>16)&65535)<<16)&4294967295))+((58964+(Qt>>>16)&65535)<<16);switch($e=0,at){case 3:$e^=(255&X.charCodeAt(or+2))<<16;case 2:$e^=(255&X.charCodeAt(or+1))<<8;case 1:jt^=$e=(65535&($e=($e=(65535&($e^=255&X.charCodeAt(or)))*re+((($e>>>16)*re&65535)<<16)&4294967295)<<15|$e>>>17))*Ae+((($e>>>16)*Ae&65535)<<16)&4294967295}return jt^=X.length,jt=2246822507*(65535&(jt^=jt>>>16))+((2246822507*(jt>>>16)&65535)<<16)&4294967295,jt=3266489909*(65535&(jt^=jt>>>13))+((3266489909*(jt>>>16)&65535)<<16)&4294967295,(jt^=jt>>>16)>>>0};var Oi=si.exports,$i={exports:{}};$i.exports=function(X,R){for(var at,kt=X.length,jt=R^kt,Qt=0;kt>=4;)at=1540483477*(65535&(at=255&X.charCodeAt(Qt)|(255&X.charCodeAt(++Qt))<<8|(255&X.charCodeAt(++Qt))<<16|(255&X.charCodeAt(++Qt))<<24))+((1540483477*(at>>>16)&65535)<<16),jt=1540483477*(65535&jt)+((1540483477*(jt>>>16)&65535)<<16)^(at=1540483477*(65535&(at^=at>>>24))+((1540483477*(at>>>16)&65535)<<16)),kt-=4,++Qt;switch(kt){case 3:jt^=(255&X.charCodeAt(Qt+2))<<16;case 2:jt^=(255&X.charCodeAt(Qt+1))<<8;case 1:jt=1540483477*(65535&(jt^=255&X.charCodeAt(Qt)))+((1540483477*(jt>>>16)&65535)<<16)}return jt=1540483477*(65535&(jt^=jt>>>13))+((1540483477*(jt>>>16)&65535)<<16),(jt^=jt>>>15)>>>0};var Ki=Oi,sa=$i.exports;ra.exports=Ki,ra.exports.murmur3=Ki,ra.exports.murmur2=sa;var vi=a(ra.exports);class no{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(R,at,kt,jt){this.ids.push(ao(R)),this.positions.push(at,kt,jt)}getPositions(R){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let at=ao(R),kt=0,jt=this.ids.length-1;for(;kt>1;this.ids[re]>=at?jt=re:kt=re+1}let Qt=[];for(;this.ids[kt]===at;)Qt.push({index:this.positions[3*kt],start:this.positions[3*kt+1],end:this.positions[3*kt+2]}),kt++;return Qt}static serialize(R,at){let kt=new Float64Array(R.ids),jt=new Uint32Array(R.positions);return xo(kt,jt,0,kt.length-1),at&&at.push(kt.buffer,jt.buffer),{ids:kt,positions:jt}}static deserialize(R){let at=new no;return at.ids=R.ids,at.positions=R.positions,at.indexed=!0,at}}function ao(X){let R=+X;return!isNaN(R)&&R<=Number.MAX_SAFE_INTEGER?R:vi(String(X))}function xo(X,R,at,kt){for(;at>1],Qt=at-1,re=kt+1;for(;;){do Qt++;while(X[Qt]jt);if(Qt>=re)break;$o(X,Qt,re),$o(R,3*Qt,3*re),$o(R,3*Qt+1,3*re+1),$o(R,3*Qt+2,3*re+2)}re-at`u_${jt}`),this.type=kt}setUniform(R,at,kt){R.set(kt.constantOr(this.value))}getBinding(R,at,kt){return this.type==="color"?new as(R,at):new rs(R,at)}}class wc{constructor(R,at){this.uniformNames=at.map(kt=>`u_${kt}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(R,at){this.pixelRatioFrom=at.pixelRatio,this.pixelRatioTo=R.pixelRatio,this.patternFrom=at.tlbr,this.patternTo=R.tlbr}setUniform(R,at,kt,jt){let Qt=jt==="u_pattern_to"?this.patternTo:jt==="u_pattern_from"?this.patternFrom:jt==="u_pixel_ratio_to"?this.pixelRatioTo:jt==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Qt&&R.set(Qt)}getBinding(R,at,kt){return kt.substr(0,9)==="u_pattern"?new _l(R,at):new rs(R,at)}}class zo{constructor(R,at,kt,jt){this.expression=R,this.type=kt,this.maxValue=0,this.paintVertexAttributes=at.map(Qt=>({name:`a_${Qt}`,type:"Float32",components:kt==="color"?2:1,offset:0})),this.paintVertexArray=new jt}populatePaintArray(R,at,kt,jt,Qt){let re=this.paintVertexArray.length,Ae=this.expression.evaluate(new Zl(0),at,{},jt,[],Qt);this.paintVertexArray.resize(R),this._setPaintValue(re,R,Ae)}updatePaintArray(R,at,kt,jt){let Qt=this.expression.evaluate({zoom:0},kt,jt);this._setPaintValue(R,at,Qt)}_setPaintValue(R,at,kt){if(this.type==="color"){let jt=Bl(kt);for(let Qt=R;Qt`u_${Ae}_t`),this.type=kt,this.useIntegerZoom=jt,this.zoom=Qt,this.maxValue=0,this.paintVertexAttributes=at.map(Ae=>({name:`a_${Ae}`,type:"Float32",components:kt==="color"?4:2,offset:0})),this.paintVertexArray=new re}populatePaintArray(R,at,kt,jt,Qt){let re=this.expression.evaluate(new Zl(this.zoom),at,{},jt,[],Qt),Ae=this.expression.evaluate(new Zl(this.zoom+1),at,{},jt,[],Qt),$e=this.paintVertexArray.length;this.paintVertexArray.resize(R),this._setPaintValue($e,R,re,Ae)}updatePaintArray(R,at,kt,jt){let Qt=this.expression.evaluate({zoom:this.zoom},kt,jt),re=this.expression.evaluate({zoom:this.zoom+1},kt,jt);this._setPaintValue(R,at,Qt,re)}_setPaintValue(R,at,kt,jt){if(this.type==="color"){let Qt=Bl(kt),re=Bl(jt);for(let Ae=R;Ae`#define HAS_UNIFORM_${jt}`))}return R}getBinderAttributes(){let R=[];for(let at in this.binders){let kt=this.binders[at];if(kt instanceof zo||kt instanceof il)for(let jt=0;jt!0){this.programConfigurations={};for(let jt of R)this.programConfigurations[jt.id]=new yc(jt,at,kt);this.needsUpload=!1,this._featureMap=new no,this._bufferOffset=0}populatePaintArrays(R,at,kt,jt,Qt,re){for(let Ae in this.programConfigurations)this.programConfigurations[Ae].populatePaintArrays(R,at,jt,Qt,re);at.id!==void 0&&this._featureMap.add(at.id,kt,this._bufferOffset,R),this._bufferOffset=R,this.needsUpload=!0}updatePaintArrays(R,at,kt,jt){for(let Qt of kt)this.needsUpload=this.programConfigurations[Qt.id].updatePaintArrays(R,this._featureMap,at,Qt,jt)||this.needsUpload}get(R){return this.programConfigurations[R]}upload(R){if(this.needsUpload){for(let at in this.programConfigurations)this.programConfigurations[at].upload(R);this.needsUpload=!1}}destroy(){for(let R in this.programConfigurations)this.programConfigurations[R].destroy()}}function ph(X,R){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"]}[X]||[X.replace(`${R}-`,"").replace(/-/g,"_")]}function Yl(X,R,at){let kt={color:{source:qn,composite:Ma},number:{source:zn,composite:qn}},jt=function(Qt){return{"line-pattern":{source:Vt,composite:Vt},"fill-pattern":{source:Vt,composite:Vt},"fill-extrusion-pattern":{source:Vt,composite:Vt}}[Qt]}(X);return jt&&jt[at]||kt[R][at]}pa("ConstantBinder",ou),pa("CrossFadedConstantBinder",wc),pa("SourceExpressionBinder",zo),pa("CrossFadedCompositeBinder",ml),pa("CompositeExpressionBinder",il),pa("ProgramConfiguration",yc,{omit:["_buffers"]}),pa("ProgramConfigurationSet",oc);let hc=8192,zh=Math.pow(2,14)-1,Se=-zh-1;function Ir(X){let R=hc/X.extent,at=X.loadGeometry();for(let kt=0;ktre.x+1||$ere.y+1)&&S("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return at}function Vr(X,R){return{type:X.type,id:X.id,properties:X.properties,geometry:R?Ir(X):[]}}function ri(X,R,at,kt,jt){X.emplaceBack(2*R+(kt+1)/2,2*at+(jt+1)/2)}class Ai{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(at=>at.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new nl,this.indexArray=new cr,this.segments=new Bn,this.programConfigurations=new oc(R.layers,R.zoom),this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){let jt=this.layers[0],Qt=[],re=null,Ae=!1;jt.type==="circle"&&(re=jt.layout.get("circle-sort-key"),Ae=!re.isConstant());for(let{feature:$e,id:or,index:Cr,sourceLayerIndex:$r}of R){let ln=this.layers[0]._featureFilter.needGeometry,kn=Vr($e,ln);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),kn,kt))continue;let Fn=Ae?re.evaluate(kn,{},kt):void 0,Kn={id:or,properties:$e.properties,type:$e.type,sourceLayerIndex:$r,index:Cr,geometry:ln?kn.geometry:Ir($e),patterns:{},sortKey:Fn};Qt.push(Kn)}Ae&&Qt.sort(($e,or)=>$e.sortKey-or.sortKey);for(let $e of Qt){let{geometry:or,index:Cr,sourceLayerIndex:$r}=$e,ln=R[Cr].feature;this.addFeature($e,or,Cr,kt),at.featureIndex.insert(ln,or,Cr,$r,this.index)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,fn),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(R,at,kt,jt){for(let Qt of at)for(let re of Qt){let Ae=re.x,$e=re.y;if(Ae<0||Ae>=hc||$e<0||$e>=hc)continue;let or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,R.sortKey),Cr=or.vertexLength;ri(this.layoutVertexArray,Ae,$e,-1,-1),ri(this.layoutVertexArray,Ae,$e,1,-1),ri(this.layoutVertexArray,Ae,$e,1,1),ri(this.layoutVertexArray,Ae,$e,-1,1),this.indexArray.emplaceBack(Cr,Cr+1,Cr+2),this.indexArray.emplaceBack(Cr,Cr+3,Cr+2),or.vertexLength+=4,or.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,kt,{},jt)}}function bi(X,R){for(let at=0;at1){if(aa(X,R))return!0;for(let kt=0;kt1?at:at.sub(R)._mult(jt)._add(R))}function ma(X,R){let at,kt,jt,Qt=!1;for(let re=0;reR.y!=jt.y>R.y&&R.x<(jt.x-kt.x)*(R.y-kt.y)/(jt.y-kt.y)+kt.x&&(Qt=!Qt)}return Qt}function ji(X,R){let at=!1;for(let kt=0,jt=X.length-1;ktR.y!=re.y>R.y&&R.x<(re.x-Qt.x)*(R.y-Qt.y)/(re.y-Qt.y)+Qt.x&&(at=!at)}return at}function En(X,R,at){let kt=at[0],jt=at[2];if(X.xjt.x&&R.x>jt.x||X.yjt.y&&R.y>jt.y)return!1;let Qt=N(X,R,at[0]);return Qt!==N(X,R,at[1])||Qt!==N(X,R,at[2])||Qt!==N(X,R,at[3])}function oi(X,R,at){let kt=R.paint.get(X).value;return kt.kind==="constant"?kt.value:at.programConfigurations.get(R.id).getMaxValue(X)}function Yi(X){return Math.sqrt(X[0]*X[0]+X[1]*X[1])}function Ni(X,R,at,kt,jt){if(!R[0]&&!R[1])return X;let Qt=c.convert(R)._mult(jt);at==="viewport"&&Qt._rotate(-kt);let re=[];for(let Ae=0;AeVo(mi,Kn))}(or,$e),kn=$r?Cr*Ae:Cr;for(let Fn of jt)for(let Kn of Fn){let mi=$r?Kn:Vo(Kn,$e),Ui=kn,Na=ua([],[Kn.x,Kn.y,0,1],$e);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ui*=Na[3]/re.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ui*=re.cameraToCenterDistance/Na[3]),On(ln,mi,Ui))return!0}return!1}}function Vo(X,R){let at=ua([],[X.x,X.y,0,1],R);return new c(at[0]/at[3],at[1]/at[3])}class Bo extends Ai{}let za;pa("HeatmapBucket",Bo,{omit:["layers"]});var Ya={get paint(){return za=za||new Kt({"heatmap-radius":new $s(dt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new $s(dt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ds(dt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new lf(dt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ds(dt.paint_heatmap["heatmap-opacity"])})}};function Eo(X,{width:R,height:at},kt,jt){if(jt){if(jt instanceof Uint8ClampedArray)jt=new Uint8Array(jt.buffer);else if(jt.length!==R*at*kt)throw new RangeError(`mismatched image size. expected: ${jt.length} but got: ${R*at*kt}`)}else jt=new Uint8Array(R*at*kt);return X.width=R,X.height=at,X.data=jt,X}function No(X,{width:R,height:at},kt){if(R===X.width&&at===X.height)return;let jt=Eo({},{width:R,height:at},kt);hs(X,jt,{x:0,y:0},{x:0,y:0},{width:Math.min(X.width,R),height:Math.min(X.height,at)},kt),X.width=R,X.height=at,X.data=jt.data}function hs(X,R,at,kt,jt,Qt){if(jt.width===0||jt.height===0)return R;if(jt.width>X.width||jt.height>X.height||at.x>X.width-jt.width||at.y>X.height-jt.height)throw new RangeError("out of range source coordinates for image copy");if(jt.width>R.width||jt.height>R.height||kt.x>R.width-jt.width||kt.y>R.height-jt.height)throw new RangeError("out of range destination coordinates for image copy");let re=X.data,Ae=R.data;if(re===Ae)throw new Error("srcData equals dstData, so image is already copied");for(let $e=0;$e{R[X.evaluationKey]=$e;let or=X.expression.evaluate(R);jt.data[re+Ae+0]=Math.floor(255*or.r/or.a),jt.data[re+Ae+1]=Math.floor(255*or.g/or.a),jt.data[re+Ae+2]=Math.floor(255*or.b/or.a),jt.data[re+Ae+3]=Math.floor(255*or.a)};if(X.clips)for(let re=0,Ae=0;re80*at){Ae=1/0,$e=1/0;let Cr=-1/0,$r=-1/0;for(let ln=at;lnCr&&(Cr=kn),Fn>$r&&($r=Fn)}or=Math.max(Cr-Ae,$r-$e),or=or!==0?32767/or:0}return xl(Qt,re,at,Ae,$e,or,0),re}function Xo(X,R,at,kt,jt){let Qt;if(jt===function(re,Ae,$e,or){let Cr=0;for(let $r=Ae,ln=$e-or;$r<$e;$r+=or)Cr+=(re[ln]-re[$r])*(re[$r+1]+re[ln+1]),ln=$r;return Cr}(X,R,at,kt)>0)for(let re=R;re=R;re-=kt)Qt=ar(re/kt|0,X[re],X[re+1],Qt);return Qt&&ke(Qt,Qt.next)&&(dr(Qt),Qt=Qt.next),Qt}function Oc(X,R){if(!X)return X;R||(R=X);let at,kt=X;do if(at=!1,kt.steiner||!ke(kt,kt.next)&&ve(kt.prev,kt,kt.next)!==0)kt=kt.next;else{if(dr(kt),kt=R=kt.prev,kt===kt.next)break;at=!0}while(at||kt!==R);return R}function xl(X,R,at,kt,jt,Qt,re){if(!X)return;!re&&Qt&&function($e,or,Cr,$r){let ln=$e;do ln.z===0&&(ln.z=lt(ln.x,ln.y,or,Cr,$r)),ln.prevZ=ln.prev,ln.nextZ=ln.next,ln=ln.next;while(ln!==$e);ln.prevZ.nextZ=null,ln.prevZ=null,function(kn){let Fn,Kn=1;do{let mi,Ui=kn;kn=null;let Na=null;for(Fn=0;Ui;){Fn++;let fa=Ui,La=0;for(let Ro=0;Ro0||ho>0&&fa;)La!==0&&(ho===0||!fa||Ui.z<=fa.z)?(mi=Ui,Ui=Ui.nextZ,La--):(mi=fa,fa=fa.nextZ,ho--),Na?Na.nextZ=mi:kn=mi,mi.prevZ=Na,Na=mi;Ui=fa}Na.nextZ=null,Kn*=2}while(Fn>1)}(ln)}(X,kt,jt,Qt);let Ae=X;for(;X.prev!==X.next;){let $e=X.prev,or=X.next;if(Qt?Lu(X,kt,jt,Qt):jc(X))R.push($e.i,X.i,or.i),dr(X),X=or.next,Ae=or.next;else if((X=or)===Ae){re?re===1?xl(X=jo(Oc(X),R),R,at,kt,jt,Qt,2):re===2&&Rs(X,R,at,kt,jt,Qt):xl(Oc(X),R,at,kt,jt,Qt,1);break}}}function jc(X){let R=X.prev,at=X,kt=X.next;if(ve(R,at,kt)>=0)return!1;let jt=R.x,Qt=at.x,re=kt.x,Ae=R.y,$e=at.y,or=kt.y,Cr=jtQt?jt>re?jt:re:Qt>re?Qt:re,kn=Ae>$e?Ae>or?Ae:or:$e>or?$e:or,Fn=kt.next;for(;Fn!==R;){if(Fn.x>=Cr&&Fn.x<=ln&&Fn.y>=$r&&Fn.y<=kn&&wt(jt,Ae,Qt,$e,re,or,Fn.x,Fn.y)&&ve(Fn.prev,Fn,Fn.next)>=0)return!1;Fn=Fn.next}return!0}function Lu(X,R,at,kt){let jt=X.prev,Qt=X,re=X.next;if(ve(jt,Qt,re)>=0)return!1;let Ae=jt.x,$e=Qt.x,or=re.x,Cr=jt.y,$r=Qt.y,ln=re.y,kn=Ae<$e?Ae$e?Ae>or?Ae:or:$e>or?$e:or,mi=Cr>$r?Cr>ln?Cr:ln:$r>ln?$r:ln,Ui=lt(kn,Fn,R,at,kt),Na=lt(Kn,mi,R,at,kt),fa=X.prevZ,La=X.nextZ;for(;fa&&fa.z>=Ui&&La&&La.z<=Na;){if(fa.x>=kn&&fa.x<=Kn&&fa.y>=Fn&&fa.y<=mi&&fa!==jt&&fa!==re&&wt(Ae,Cr,$e,$r,or,ln,fa.x,fa.y)&&ve(fa.prev,fa,fa.next)>=0||(fa=fa.prevZ,La.x>=kn&&La.x<=Kn&&La.y>=Fn&&La.y<=mi&&La!==jt&&La!==re&&wt(Ae,Cr,$e,$r,or,ln,La.x,La.y)&&ve(La.prev,La,La.next)>=0))return!1;La=La.nextZ}for(;fa&&fa.z>=Ui;){if(fa.x>=kn&&fa.x<=Kn&&fa.y>=Fn&&fa.y<=mi&&fa!==jt&&fa!==re&&wt(Ae,Cr,$e,$r,or,ln,fa.x,fa.y)&&ve(fa.prev,fa,fa.next)>=0)return!1;fa=fa.prevZ}for(;La&&La.z<=Na;){if(La.x>=kn&&La.x<=Kn&&La.y>=Fn&&La.y<=mi&&La!==jt&&La!==re&&wt(Ae,Cr,$e,$r,or,ln,La.x,La.y)&&ve(La.prev,La,La.next)>=0)return!1;La=La.nextZ}return!0}function jo(X,R){let at=X;do{let kt=at.prev,jt=at.next.next;!ke(kt,jt)&&Jt(kt,at,at.next,jt)&&lr(kt,jt)&&lr(jt,kt)&&(R.push(kt.i,at.i,jt.i),dr(at),dr(at.next),at=X=jt),at=at.next}while(at!==X);return Oc(at)}function Rs(X,R,at,kt,jt,Qt){let re=X;do{let Ae=re.next.next;for(;Ae!==re.prev;){if(re.i!==Ae.i&&Wt(re,Ae)){let $e=tr(re,Ae);return re=Oc(re,re.next),$e=Oc($e,$e.next),xl(re,R,at,kt,jt,Qt,0),void xl($e,R,at,kt,jt,Qt,0)}Ae=Ae.next}re=re.next}while(re!==X)}function Fl(X,R){return X.x-R.x}function Pl(X,R){let at=function(jt,Qt){let re=Qt,Ae=jt.x,$e=jt.y,or,Cr=-1/0;do{if($e<=re.y&&$e>=re.next.y&&re.next.y!==re.y){let Kn=re.x+($e-re.y)*(re.next.x-re.x)/(re.next.y-re.y);if(Kn<=Ae&&Kn>Cr&&(Cr=Kn,or=re.x=re.x&&re.x>=ln&&Ae!==re.x&&wt($eor.x||re.x===or.x&&Z(or,re)))&&(or=re,Fn=Kn)}re=re.next}while(re!==$r);return or}(X,R);if(!at)return R;let kt=tr(at,X);return Oc(kt,kt.next),Oc(at,at.next)}function Z(X,R){return ve(X.prev,X,R.prev)<0&&ve(R.next,X,X.next)<0}function lt(X,R,at,kt,jt){return(X=1431655765&((X=858993459&((X=252645135&((X=16711935&((X=(X-at)*jt|0)|X<<8))|X<<4))|X<<2))|X<<1))|(R=1431655765&((R=858993459&((R=252645135&((R=16711935&((R=(R-kt)*jt|0)|R<<8))|R<<4))|R<<2))|R<<1))<<1}function nt(X){let R=X,at=X;do(R.x=(X-re)*(Qt-Ae)&&(X-re)*(kt-Ae)>=(at-re)*(R-Ae)&&(at-re)*(Qt-Ae)>=(jt-re)*(kt-Ae)}function Wt(X,R){return X.next.i!==R.i&&X.prev.i!==R.i&&!function(at,kt){let jt=at;do{if(jt.i!==at.i&&jt.next.i!==at.i&&jt.i!==kt.i&&jt.next.i!==kt.i&&Jt(jt,jt.next,at,kt))return!0;jt=jt.next}while(jt!==at);return!1}(X,R)&&(lr(X,R)&&lr(R,X)&&function(at,kt){let jt=at,Qt=!1,re=(at.x+kt.x)/2,Ae=(at.y+kt.y)/2;do jt.y>Ae!=jt.next.y>Ae&&jt.next.y!==jt.y&&re<(jt.next.x-jt.x)*(Ae-jt.y)/(jt.next.y-jt.y)+jt.x&&(Qt=!Qt),jt=jt.next;while(jt!==at);return Qt}(X,R)&&(ve(X.prev,X,R.prev)||ve(X,R.prev,R))||ke(X,R)&&ve(X.prev,X,X.next)>0&&ve(R.prev,R,R.next)>0)}function ve(X,R,at){return(R.y-X.y)*(at.x-R.x)-(R.x-X.x)*(at.y-R.y)}function ke(X,R){return X.x===R.x&&X.y===R.y}function Jt(X,R,at,kt){let jt=De(ve(X,R,at)),Qt=De(ve(X,R,kt)),re=De(ve(at,kt,X)),Ae=De(ve(at,kt,R));return jt!==Qt&&re!==Ae||!(jt!==0||!fe(X,at,R))||!(Qt!==0||!fe(X,kt,R))||!(re!==0||!fe(at,X,kt))||!(Ae!==0||!fe(at,R,kt))}function fe(X,R,at){return R.x<=Math.max(X.x,at.x)&&R.x>=Math.min(X.x,at.x)&&R.y<=Math.max(X.y,at.y)&&R.y>=Math.min(X.y,at.y)}function De(X){return X>0?1:X<0?-1:0}function lr(X,R){return ve(X.prev,X,X.next)<0?ve(X,R,X.next)>=0&&ve(X,X.prev,R)>=0:ve(X,R,X.prev)<0||ve(X,X.next,R)<0}function tr(X,R){let at=gr(X.i,X.x,X.y),kt=gr(R.i,R.x,R.y),jt=X.next,Qt=R.prev;return X.next=R,R.prev=X,at.next=jt,jt.prev=at,kt.next=at,at.prev=kt,Qt.next=kt,kt.prev=Qt,kt}function ar(X,R,at,kt){let jt=gr(X,R,at);return kt?(jt.next=kt.next,jt.prev=kt,kt.next.prev=jt,kt.next=jt):(jt.prev=jt,jt.next=jt),jt}function dr(X){X.next.prev=X.prev,X.prev.next=X.next,X.prevZ&&(X.prevZ.nextZ=X.nextZ),X.nextZ&&(X.nextZ.prevZ=X.prevZ)}function gr(X,R,at){return{i:X,x:R,y:at,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ge(X,R,at){let kt=at.patternDependencies,jt=!1;for(let Qt of R){let re=Qt.paint.get(`${X}-pattern`);re.isConstant()||(jt=!0);let Ae=re.constantOr(null);Ae&&(jt=!0,kt[Ae.to]=!0,kt[Ae.from]=!0)}return jt}function rr(X,R,at,kt,jt){let Qt=jt.patternDependencies;for(let re of R){let Ae=re.paint.get(`${X}-pattern`).value;if(Ae.kind!=="constant"){let $e=Ae.evaluate({zoom:kt-1},at,{},jt.availableImages),or=Ae.evaluate({zoom:kt},at,{},jt.availableImages),Cr=Ae.evaluate({zoom:kt+1},at,{},jt.availableImages);$e=$e&&$e.name?$e.name:$e,or=or&&or.name?or.name:or,Cr=Cr&&Cr.name?Cr.name:Cr,Qt[$e]=!0,Qt[or]=!0,Qt[Cr]=!0,at.patterns[re.id]={min:$e,mid:or,max:Cr}}}return at}class Je{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(at=>at.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new au,this.indexArray=new cr,this.indexArray2=new Fr,this.programConfigurations=new oc(R.layers,R.zoom),this.segments=new Bn,this.segments2=new Bn,this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){this.hasPattern=Ge("fill",this.layers,at);let jt=this.layers[0].layout.get("fill-sort-key"),Qt=!jt.isConstant(),re=[];for(let{feature:Ae,id:$e,index:or,sourceLayerIndex:Cr}of R){let $r=this.layers[0]._featureFilter.needGeometry,ln=Vr(Ae,$r);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),ln,kt))continue;let kn=Qt?jt.evaluate(ln,{},kt,at.availableImages):void 0,Fn={id:$e,properties:Ae.properties,type:Ae.type,sourceLayerIndex:Cr,index:or,geometry:$r?ln.geometry:Ir(Ae),patterns:{},sortKey:kn};re.push(Fn)}Qt&&re.sort((Ae,$e)=>Ae.sortKey-$e.sortKey);for(let Ae of re){let{geometry:$e,index:or,sourceLayerIndex:Cr}=Ae;if(this.hasPattern){let $r=rr("fill",this.layers,Ae,this.zoom,at);this.patternFeatures.push($r)}else this.addFeature(Ae,$e,or,kt,{});at.featureIndex.insert(R[or].feature,$e,or,Cr,this.index)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}addFeatures(R,at,kt){for(let jt of this.patternFeatures)this.addFeature(jt,jt.geometry,jt.index,at,kt)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,kc),this.indexBuffer=R.createIndexBuffer(this.indexArray),this.indexBuffer2=R.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(R),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(R,at,kt,jt,Qt){for(let re of uh(at,500)){let Ae=0;for(let kn of re)Ae+=kn.length;let $e=this.segments.prepareSegment(Ae,this.layoutVertexArray,this.indexArray),or=$e.vertexLength,Cr=[],$r=[];for(let kn of re){if(kn.length===0)continue;kn!==re[0]&&$r.push(Cr.length/2);let Fn=this.segments2.prepareSegment(kn.length,this.layoutVertexArray,this.indexArray2),Kn=Fn.vertexLength;this.layoutVertexArray.emplaceBack(kn[0].x,kn[0].y),this.indexArray2.emplaceBack(Kn+kn.length-1,Kn),Cr.push(kn[0].x),Cr.push(kn[0].y);for(let mi=1;mi>3}if(jt--,kt===1||kt===2)Qt+=X.readSVarint(),re+=X.readSVarint(),kt===1&&(R&&Ae.push(R),R=[]),R.push(new da(Qt,re));else{if(kt!==7)throw new Error("unknown command "+kt);R&&R.push(R[0].clone())}}return R&&Ae.push(R),Ae},Wi.prototype.bbox=function(){var X=this._pbf;X.pos=this._geometry;for(var R=X.readVarint()+X.pos,at=1,kt=0,jt=0,Qt=0,re=1/0,Ae=-1/0,$e=1/0,or=-1/0;X.pos>3}if(kt--,at===1||at===2)(jt+=X.readSVarint())Ae&&(Ae=jt),(Qt+=X.readSVarint())<$e&&($e=Qt),Qt>or&&(or=Qt);else if(at!==7)throw new Error("unknown command "+at)}return[re,$e,Ae,or]},Wi.prototype.toGeoJSON=function(X,R,at){var kt,jt,Qt=this.extent*Math.pow(2,at),re=this.extent*X,Ae=this.extent*R,$e=this.loadGeometry(),or=Wi.types[this.type];function Cr(kn){for(var Fn=0;Fn>3;jt=re===1?kt.readString():re===2?kt.readFloat():re===3?kt.readDouble():re===4?kt.readVarint64():re===5?kt.readVarint():re===6?kt.readSVarint():re===7?kt.readBoolean():null}return jt}(at))}As.prototype.feature=function(X){if(X<0||X>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[X];var R=this._pbf.readVarint()+this._pbf.pos;return new So(this._pbf,R,this.extent,this._keys,this._values)};var Jl=ns;function Al(X,R,at){if(X===3){var kt=new Jl(at,at.readVarint()+at.pos);kt.length&&(R[kt.name]=kt)}}Di.VectorTile=function(X,R){this.layers=X.readFields(Al,{},R)},Di.VectorTileFeature=Hi,Di.VectorTileLayer=ns;let Ql=Di.VectorTileFeature.types,Pu=Math.pow(2,13);function qs(X,R,at,kt,jt,Qt,re,Ae){X.emplaceBack(R,at,2*Math.floor(kt*Pu)+re,jt*Pu*2,Qt*Pu*2,Math.round(Ae))}class Bc{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(at=>at.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new wu,this.centroidVertexArray=new rl,this.indexArray=new cr,this.programConfigurations=new oc(R.layers,R.zoom),this.segments=new Bn,this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){this.features=[],this.hasPattern=Ge("fill-extrusion",this.layers,at);for(let{feature:jt,id:Qt,index:re,sourceLayerIndex:Ae}of R){let $e=this.layers[0]._featureFilter.needGeometry,or=Vr(jt,$e);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),or,kt))continue;let Cr={id:Qt,sourceLayerIndex:Ae,index:re,geometry:$e?or.geometry:Ir(jt),properties:jt.properties,type:jt.type,patterns:{}};this.hasPattern?this.features.push(rr("fill-extrusion",this.layers,Cr,this.zoom,at)):this.addFeature(Cr,Cr.geometry,re,kt,{}),at.featureIndex.insert(jt,Cr.geometry,re,Ae,this.index,!0)}}addFeatures(R,at,kt){for(let jt of this.features){let{geometry:Qt}=jt;this.addFeature(jt,Qt,jt.index,at,kt)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,Vi),this.centroidVertexBuffer=R.createVertexBuffer(this.centroidVertexArray,gi.members,!0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(R,at,kt,jt,Qt){for(let re of uh(at,500)){let Ae={x:0,y:0,vertexCount:0},$e=0;for(let Fn of re)$e+=Fn.length;let or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let Fn of re){if(Fn.length===0||Vd(Fn))continue;let Kn=0;for(let mi=0;mi=1){let Na=Fn[mi-1];if(!md(Ui,Na)){or.vertexLength+4>Bn.MAX_VERTEX_ARRAY_LENGTH&&(or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let fa=Ui.sub(Na)._perp()._unit(),La=Na.dist(Ui);Kn+La>32768&&(Kn=0),qs(this.layoutVertexArray,Ui.x,Ui.y,fa.x,fa.y,0,0,Kn),qs(this.layoutVertexArray,Ui.x,Ui.y,fa.x,fa.y,0,1,Kn),Ae.x+=2*Ui.x,Ae.y+=2*Ui.y,Ae.vertexCount+=2,Kn+=La,qs(this.layoutVertexArray,Na.x,Na.y,fa.x,fa.y,0,0,Kn),qs(this.layoutVertexArray,Na.x,Na.y,fa.x,fa.y,0,1,Kn),Ae.x+=2*Na.x,Ae.y+=2*Na.y,Ae.vertexCount+=2;let ho=or.vertexLength;this.indexArray.emplaceBack(ho,ho+2,ho+1),this.indexArray.emplaceBack(ho+1,ho+2,ho+3),or.vertexLength+=4,or.primitiveLength+=2}}}}if(or.vertexLength+$e>Bn.MAX_VERTEX_ARRAY_LENGTH&&(or=this.segments.prepareSegment($e,this.layoutVertexArray,this.indexArray)),Ql[R.type]!=="Polygon")continue;let Cr=[],$r=[],ln=or.vertexLength;for(let Fn of re)if(Fn.length!==0){Fn!==re[0]&&$r.push(Cr.length/2);for(let Kn=0;Knhc)||X.y===R.y&&(X.y<0||X.y>hc)}function Vd(X){return X.every(R=>R.x<0)||X.every(R=>R.x>hc)||X.every(R=>R.y<0)||X.every(R=>R.y>hc)}let M0;pa("FillExtrusionBucket",Bc,{omit:["layers","features"]});var gm={get paint(){return M0=M0||new Kt({"fill-extrusion-opacity":new ds(dt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new $s(dt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ds(dt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ds(dt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new nh(dt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new $s(dt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new $s(dt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ds(dt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class u0 extends pt{constructor(R){super(R,gm)}createBucket(R){return new Bc(R)}queryRadius(){return Yi(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(R,at,kt,jt,Qt,re,Ae,$e){let or=Ni(R,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),re.angle,Ae),Cr=this.paint.get("fill-extrusion-height").evaluate(at,kt),$r=this.paint.get("fill-extrusion-base").evaluate(at,kt),ln=function(Fn,Kn,mi,Ui){let Na=[];for(let fa of Fn){let La=[fa.x,fa.y,0,1];ua(La,La,Kn),Na.push(new c(La[0]/La[3],La[1]/La[3]))}return Na}(or,$e),kn=function(Fn,Kn,mi,Ui){let Na=[],fa=[],La=Ui[8]*Kn,ho=Ui[9]*Kn,Ro=Ui[10]*Kn,Os=Ui[11]*Kn,Nl=Ui[8]*mi,Ms=Ui[9]*mi,_s=Ui[10]*mi,sl=Ui[11]*mi;for(let Ks of Fn){let Hs=[],To=[];for(let vl of Ks){let ll=vl.x,rc=vl.y,wh=Ui[0]*ll+Ui[4]*rc+Ui[12],mh=Ui[1]*ll+Ui[5]*rc+Ui[13],Of=Ui[2]*ll+Ui[6]*rc+Ui[14],m0=Ui[3]*ll+Ui[7]*rc+Ui[15],Wd=Of+Ro,yf=m0+Os,Wp=wh+Nl,qp=mh+Ms,Gp=Of+_s,vd=m0+sl,Bf=new c((wh+La)/yf,(mh+ho)/yf);Bf.z=Wd/yf,Hs.push(Bf);let Lp=new c(Wp/vd,qp/vd);Lp.z=Gp/vd,To.push(Lp)}Na.push(Hs),fa.push(To)}return[Na,fa]}(jt,$r,Cr,$e);return function(Fn,Kn,mi){let Ui=1/0;Si(mi,Kn)&&(Ui=zm(mi,Kn[0]));for(let Na=0;Naat.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(at=>{this.gradients[at.id]={}}),this.layoutVertexArray=new ih,this.layoutVertexArray2=new Et,this.indexArray=new cr,this.programConfigurations=new oc(R.layers,R.zoom),this.segments=new Bn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(at=>at.isStateDependent()).map(at=>at.id)}populate(R,at,kt){this.hasPattern=Ge("line",this.layers,at);let jt=this.layers[0].layout.get("line-sort-key"),Qt=!jt.isConstant(),re=[];for(let{feature:Ae,id:$e,index:or,sourceLayerIndex:Cr}of R){let $r=this.layers[0]._featureFilter.needGeometry,ln=Vr(Ae,$r);if(!this.layers[0]._featureFilter.filter(new Zl(this.zoom),ln,kt))continue;let kn=Qt?jt.evaluate(ln,{},kt):void 0,Fn={id:$e,properties:Ae.properties,type:Ae.type,sourceLayerIndex:Cr,index:or,geometry:$r?ln.geometry:Ir(Ae),patterns:{},sortKey:kn};re.push(Fn)}Qt&&re.sort((Ae,$e)=>Ae.sortKey-$e.sortKey);for(let Ae of re){let{geometry:$e,index:or,sourceLayerIndex:Cr}=Ae;if(this.hasPattern){let $r=rr("line",this.layers,Ae,this.zoom,at);this.patternFeatures.push($r)}else this.addFeature(Ae,$e,or,kt,{});at.featureIndex.insert(R[or].feature,$e,or,Cr,this.index)}}update(R,at,kt){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,at,this.stateDependentLayers,kt)}addFeatures(R,at,kt){for(let jt of this.patternFeatures)this.addFeature(jt,jt.geometry,jt.index,at,kt)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=R.createVertexBuffer(this.layoutVertexArray2,rg)),this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,d0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(R){if(R.properties&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_end"))return{start:+R.properties.mapbox_clip_start,end:+R.properties.mapbox_clip_end}}addFeature(R,at,kt,jt,Qt){let re=this.layers[0].layout,Ae=re.get("line-join").evaluate(R,{}),$e=re.get("line-cap"),or=re.get("line-miter-limit"),Cr=re.get("line-round-limit");this.lineClips=this.lineFeatureClips(R);for(let $r of at)this.addLine($r,R,Ae,$e,or,Cr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,kt,Qt,jt)}addLine(R,at,kt,jt,Qt,re){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ui=0;Ui=2&&R[$e-1].equals(R[$e-2]);)$e--;let or=0;for(;or<$e-1&&R[or].equals(R[or+1]);)or++;if($e<(Ae?3:2))return;kt==="bevel"&&(Qt=1.05);let Cr=this.overscaling<=16?15*hc/(512*this.overscaling):0,$r=this.segments.prepareSegment(10*$e,this.layoutVertexArray,this.indexArray),ln,kn,Fn,Kn,mi;this.e1=this.e2=-1,Ae&&(ln=R[$e-2],mi=R[or].sub(ln)._unit()._perp());for(let Ui=or;Ui<$e;Ui++){if(Fn=Ui===$e-1?Ae?R[or+1]:void 0:R[Ui+1],Fn&&R[Ui].equals(Fn))continue;mi&&(Kn=mi),ln&&(kn=ln),ln=R[Ui],mi=Fn?Fn.sub(ln)._unit()._perp():Kn,Kn=Kn||mi;let Na=Kn.add(mi);Na.x===0&&Na.y===0||Na._unit();let fa=Kn.x*mi.x+Kn.y*mi.y,La=Na.x*mi.x+Na.y*mi.y,ho=La!==0?1/La:1/0,Ro=2*Math.sqrt(2-2*La),Os=La0;if(Os&&Ui>or){let sl=ln.dist(kn);if(sl>2*Cr){let Ks=ln.sub(ln.sub(kn)._mult(Cr/sl)._round());this.updateDistance(kn,Ks),this.addCurrentVertex(Ks,Kn,0,0,$r),kn=Ks}}let Ms=kn&&Fn,_s=Ms?kt:Ae?"butt":jt;if(Ms&&_s==="round"&&(hoQt&&(_s="bevel"),_s==="bevel"&&(ho>2&&(_s="flipbevel"),ho100)Na=mi.mult(-1);else{let sl=ho*Kn.add(mi).mag()/Kn.sub(mi).mag();Na._perp()._mult(sl*(Nl?-1:1))}this.addCurrentVertex(ln,Na,0,0,$r),this.addCurrentVertex(ln,Na.mult(-1),0,0,$r)}else if(_s==="bevel"||_s==="fakeround"){let sl=-Math.sqrt(ho*ho-1),Ks=Nl?sl:0,Hs=Nl?0:sl;if(kn&&this.addCurrentVertex(ln,Kn,Ks,Hs,$r),_s==="fakeround"){let To=Math.round(180*Ro/Math.PI/20);for(let vl=1;vl2*Cr){let Ks=ln.add(Fn.sub(ln)._mult(Cr/sl)._round());this.updateDistance(ln,Ks),this.addCurrentVertex(Ks,mi,0,0,$r),ln=Ks}}}}addCurrentVertex(R,at,kt,jt,Qt,re=!1){let Ae=at.y*jt-at.x,$e=-at.y-at.x*jt;this.addHalfVertex(R,at.x+at.y*kt,at.y-at.x*kt,re,!1,kt,Qt),this.addHalfVertex(R,Ae,$e,re,!0,-jt,Qt),this.distance>p0/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(R,at,kt,jt,Qt,re))}addHalfVertex({x:R,y:at},kt,jt,Qt,re,Ae,$e){let or=.5*(this.lineClips?this.scaledDistance*(p0-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((R<<1)+(Qt?1:0),(at<<1)+(re?1:0),Math.round(63*kt)+128,Math.round(63*jt)+128,1+(Ae===0?0:Ae<0?-1:1)|(63&or)<<2,or>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Cr=$e.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Cr),$e.primitiveLength++),re?this.e2=Cr:this.e1=Cr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(R,at){this.distance+=R.dist(at),this.updateScaledDistance()}}let rv,r1;pa("LineBucket",Ep,{omit:["layers","patternFeatures"]});var nv={get paint(){return r1=r1||new Kt({"line-opacity":new $s(dt.paint_line["line-opacity"]),"line-color":new $s(dt.paint_line["line-color"]),"line-translate":new ds(dt.paint_line["line-translate"]),"line-translate-anchor":new ds(dt.paint_line["line-translate-anchor"]),"line-width":new $s(dt.paint_line["line-width"]),"line-gap-width":new $s(dt.paint_line["line-gap-width"]),"line-offset":new $s(dt.paint_line["line-offset"]),"line-blur":new $s(dt.paint_line["line-blur"]),"line-dasharray":new eu(dt.paint_line["line-dasharray"]),"line-pattern":new nh(dt.paint_line["line-pattern"]),"line-gradient":new lf(dt.paint_line["line-gradient"])})},get layout(){return rv=rv||new Kt({"line-cap":new ds(dt.layout_line["line-cap"]),"line-join":new $s(dt.layout_line["line-join"]),"line-miter-limit":new ds(dt.layout_line["line-miter-limit"]),"line-round-limit":new ds(dt.layout_line["line-round-limit"]),"line-sort-key":new $s(dt.layout_line["line-sort-key"])})}};class If extends $s{possiblyEvaluate(R,at){return at=new Zl(Math.floor(at.zoom),{now:at.now,fadeDuration:at.fadeDuration,zoomHistory:at.zoomHistory,transition:at.transition}),super.possiblyEvaluate(R,at)}evaluate(R,at,kt,jt){return at=E({},at,{zoom:Math.floor(at.zoom)}),super.evaluate(R,at,kt,jt)}}let zg;class n1 extends pt{constructor(R){super(R,nv),this.gradientVersion=0,zg||(zg=new If(nv.paint.properties["line-width"].specification),zg.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(R){if(R==="line-gradient"){let at=this.gradientExpression();this.stepInterpolant=!!function(kt){return kt._styleExpression!==void 0}(at)&&at._styleExpression.expression instanceof pi,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(R,at){super.recalculate(R,at),this.paint._values["line-floorwidth"]=zg.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,R)}createBucket(R){return new Ep(R)}queryRadius(R){let at=R,kt=Df(oi("line-width",this,at),oi("line-gap-width",this,at)),jt=oi("line-offset",this,at);return kt/2+Math.abs(jt)+Yi(this.paint.get("line-translate"))}queryIntersectsFeature(R,at,kt,jt,Qt,re,Ae){let $e=Ni(R,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),re.angle,Ae),or=Ae/2*Df(this.paint.get("line-width").evaluate(at,kt),this.paint.get("line-gap-width").evaluate(at,kt)),Cr=this.paint.get("line-offset").evaluate(at,kt);return Cr&&(jt=function($r,ln){let kn=[];for(let Fn=0;Fn<$r.length;Fn++){let Kn=$r[Fn],mi=[];for(let Ui=0;Ui=3){for(let mi=0;mi0?R+2*X:X}let iv=Ee([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),gy=Ee([{name:"a_projected_pos",components:3,type:"Float32"}],4);Ee([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let vy=Ee([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Ee([{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"}]);let Om=Ee([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),i1=Ee([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function gd(X,R,at){return X.sections.forEach(kt=>{kt.text=function(jt,Qt,re){let Ae=Qt.layout.get("text-transform").evaluate(re,{});return Ae==="uppercase"?jt=jt.toLocaleUpperCase():Ae==="lowercase"&&(jt=jt.toLocaleLowerCase()),ac.applyArabicShaping&&(jt=ac.applyArabicShaping(jt)),jt}(kt.text,R,at)}),X}Ee([{name:"triangle",components:3,type:"Uint16"}]),Ee([{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"}]),Ee([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Ee([{type:"Float32",name:"offsetX"}]),Ee([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Ee([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let zf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Iu=24,a1=Wu,yy=function(X,R,at,kt,jt){var Qt,re,Ae=8*jt-kt-1,$e=(1<>1,Cr=-7,$r=jt-1,ln=-1,kn=X[R+$r];for($r+=ln,Qt=kn&(1<<-Cr)-1,kn>>=-Cr,Cr+=Ae;Cr>0;Qt=256*Qt+X[R+$r],$r+=ln,Cr-=8);for(re=Qt&(1<<-Cr)-1,Qt>>=-Cr,Cr+=kt;Cr>0;re=256*re+X[R+$r],$r+=ln,Cr-=8);if(Qt===0)Qt=1-or;else{if(Qt===$e)return re?NaN:1/0*(kn?-1:1);re+=Math.pow(2,kt),Qt-=or}return(kn?-1:1)*re*Math.pow(2,Qt-kt)},Rb=function(X,R,at,kt,jt,Qt){var re,Ae,$e,or=8*Qt-jt-1,Cr=(1<>1,ln=jt===23?Math.pow(2,-24)-Math.pow(2,-77):0,kn=0,Fn=1,Kn=R<0||R===0&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(Ae=isNaN(R)?1:0,re=Cr):(re=Math.floor(Math.log(R)/Math.LN2),R*($e=Math.pow(2,-re))<1&&(re--,$e*=2),(R+=re+$r>=1?ln/$e:ln*Math.pow(2,1-$r))*$e>=2&&(re++,$e/=2),re+$r>=Cr?(Ae=0,re=Cr):re+$r>=1?(Ae=(R*$e-1)*Math.pow(2,jt),re+=$r):(Ae=R*Math.pow(2,$r-1)*Math.pow(2,jt),re=0));jt>=8;X[at+kn]=255&Ae,kn+=Fn,Ae/=256,jt-=8);for(re=re<0;X[at+kn]=255&re,kn+=Fn,re/=256,or-=8);X[at+kn-Fn]|=128*Kn};function Wu(X){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(X)?X:new Uint8Array(X||0),this.pos=0,this.type=0,this.length=this.buf.length}Wu.Varint=0,Wu.Fixed64=1,Wu.Bytes=2,Wu.Fixed32=5;var Og=4294967296,Fb=1/Og,o1=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Bm(X){return X.type===Wu.Bytes?X.readVarint()+X.pos:X.pos+1}function Jw(X,R,at){return at?4294967296*R+(X>>>0):4294967296*(R>>>0)+(X>>>0)}function _y(X,R,at){var kt=R<=16383?1:R<=2097151?2:R<=268435455?3:Math.floor(Math.log(R)/(7*Math.LN2));at.realloc(kt);for(var jt=at.pos-1;jt>=X;jt--)at.buf[jt+kt]=at.buf[jt]}function zA(X,R){for(var at=0;at>>8,X[at+2]=R>>>16,X[at+3]=R>>>24}function jk(X,R){return(X[R]|X[R+1]<<8|X[R+2]<<16)+(X[R+3]<<24)}Wu.prototype={destroy:function(){this.buf=null},readFields:function(X,R,at){for(at=at||this.length;this.pos>3,Qt=this.pos;this.type=7&kt,X(jt,R,this),this.pos===Qt&&this.skip(kt)}return R},readMessage:function(X,R){return this.readFields(X,R,this.readVarint()+this.pos)},readFixed32:function(){var X=jb(this.buf,this.pos);return this.pos+=4,X},readSFixed32:function(){var X=jk(this.buf,this.pos);return this.pos+=4,X},readFixed64:function(){var X=jb(this.buf,this.pos)+jb(this.buf,this.pos+4)*Og;return this.pos+=8,X},readSFixed64:function(){var X=jb(this.buf,this.pos)+jk(this.buf,this.pos+4)*Og;return this.pos+=8,X},readFloat:function(){var X=yy(this.buf,this.pos,!0,23,4);return this.pos+=4,X},readDouble:function(){var X=yy(this.buf,this.pos,!0,52,8);return this.pos+=8,X},readVarint:function(X){var R,at,kt=this.buf;return R=127&(at=kt[this.pos++]),at<128?R:(R|=(127&(at=kt[this.pos++]))<<7,at<128?R:(R|=(127&(at=kt[this.pos++]))<<14,at<128?R:(R|=(127&(at=kt[this.pos++]))<<21,at<128?R:function(jt,Qt,re){var Ae,$e,or=re.buf;if(Ae=(112&($e=or[re.pos++]))>>4,$e<128||(Ae|=(127&($e=or[re.pos++]))<<3,$e<128)||(Ae|=(127&($e=or[re.pos++]))<<10,$e<128)||(Ae|=(127&($e=or[re.pos++]))<<17,$e<128)||(Ae|=(127&($e=or[re.pos++]))<<24,$e<128)||(Ae|=(1&($e=or[re.pos++]))<<31,$e<128))return Jw(jt,Ae,Qt);throw new Error("Expected varint not more than 10 bytes")}(R|=(15&(at=kt[this.pos]))<<28,X,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var X=this.readVarint();return X%2==1?(X+1)/-2:X/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var X=this.readVarint()+this.pos,R=this.pos;return this.pos=X,X-R>=12&&o1?function(at,kt,jt){return o1.decode(at.subarray(kt,jt))}(this.buf,R,X):function(at,kt,jt){for(var Qt="",re=kt;re239?4:Cr>223?3:Cr>191?2:1;if(re+ln>jt)break;ln===1?Cr<128&&($r=Cr):ln===2?(192&(Ae=at[re+1]))==128&&($r=(31&Cr)<<6|63&Ae)<=127&&($r=null):ln===3?($e=at[re+2],(192&(Ae=at[re+1]))==128&&(192&$e)==128&&(($r=(15&Cr)<<12|(63&Ae)<<6|63&$e)<=2047||$r>=55296&&$r<=57343)&&($r=null)):ln===4&&($e=at[re+2],or=at[re+3],(192&(Ae=at[re+1]))==128&&(192&$e)==128&&(192&or)==128&&(($r=(15&Cr)<<18|(63&Ae)<<12|(63&$e)<<6|63&or)<=65535||$r>=1114112)&&($r=null)),$r===null?($r=65533,ln=1):$r>65535&&($r-=65536,Qt+=String.fromCharCode($r>>>10&1023|55296),$r=56320|1023&$r),Qt+=String.fromCharCode($r),re+=ln}return Qt}(this.buf,R,X)},readBytes:function(){var X=this.readVarint()+this.pos,R=this.buf.subarray(this.pos,X);return this.pos=X,R},readPackedVarint:function(X,R){if(this.type!==Wu.Bytes)return X.push(this.readVarint(R));var at=Bm(this);for(X=X||[];this.pos127;);else if(R===Wu.Bytes)this.pos=this.readVarint()+this.pos;else if(R===Wu.Fixed32)this.pos+=4;else{if(R!==Wu.Fixed64)throw new Error("Unimplemented type: "+R);this.pos+=8}},writeTag:function(X,R){this.writeVarint(X<<3|R)},realloc:function(X){for(var R=this.length||16;R268435455||X<0?function(R,at){var kt,jt;if(R>=0?(kt=R%4294967296|0,jt=R/4294967296|0):(jt=~(-R/4294967296),4294967295^(kt=~(-R%4294967296))?kt=kt+1|0:(kt=0,jt=jt+1|0)),R>=18446744073709552e3||R<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");at.realloc(10),function(Qt,re,Ae){Ae.buf[Ae.pos++]=127&Qt|128,Qt>>>=7,Ae.buf[Ae.pos++]=127&Qt|128,Qt>>>=7,Ae.buf[Ae.pos++]=127&Qt|128,Qt>>>=7,Ae.buf[Ae.pos++]=127&Qt|128,Ae.buf[Ae.pos]=127&(Qt>>>=7)}(kt,0,at),function(Qt,re){var Ae=(7&Qt)<<4;re.buf[re.pos++]|=Ae|((Qt>>>=3)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt|((Qt>>>=7)?128:0),Qt&&(re.buf[re.pos++]=127&Qt)))))}(jt,at)}(X,this):(this.realloc(4),this.buf[this.pos++]=127&X|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=X>>>7&127))))},writeSVarint:function(X){this.writeVarint(X<0?2*-X-1:2*X)},writeBoolean:function(X){this.writeVarint(!!X)},writeString:function(X){X=String(X),this.realloc(4*X.length),this.pos++;var R=this.pos;this.pos=function(kt,jt,Qt){for(var re,Ae,$e=0;$e55295&&re<57344){if(!Ae){re>56319||$e+1===jt.length?(kt[Qt++]=239,kt[Qt++]=191,kt[Qt++]=189):Ae=re;continue}if(re<56320){kt[Qt++]=239,kt[Qt++]=191,kt[Qt++]=189,Ae=re;continue}re=Ae-55296<<10|re-56320|65536,Ae=null}else Ae&&(kt[Qt++]=239,kt[Qt++]=191,kt[Qt++]=189,Ae=null);re<128?kt[Qt++]=re:(re<2048?kt[Qt++]=re>>6|192:(re<65536?kt[Qt++]=re>>12|224:(kt[Qt++]=re>>18|240,kt[Qt++]=re>>12&63|128),kt[Qt++]=re>>6&63|128),kt[Qt++]=63&re|128)}return Qt}(this.buf,X,this.pos);var at=this.pos-R;at>=128&&_y(R,at,this),this.pos=R-1,this.writeVarint(at),this.pos+=at},writeFloat:function(X){this.realloc(4),Rb(this.buf,X,this.pos,!0,23,4),this.pos+=4},writeDouble:function(X){this.realloc(8),Rb(this.buf,X,this.pos,!0,52,8),this.pos+=8},writeBytes:function(X){var R=X.length;this.writeVarint(R),this.realloc(R);for(var at=0;at=128&&_y(at,kt,this),this.pos=at-1,this.writeVarint(kt),this.pos+=kt},writeMessage:function(X,R,at){this.writeTag(X,Wu.Bytes),this.writeRawMessage(R,at)},writePackedVarint:function(X,R){R.length&&this.writeMessage(X,zA,R)},writePackedSVarint:function(X,R){R.length&&this.writeMessage(X,OA,R)},writePackedBoolean:function(X,R){R.length&&this.writeMessage(X,FA,R)},writePackedFloat:function(X,R){R.length&&this.writeMessage(X,BA,R)},writePackedDouble:function(X,R){R.length&&this.writeMessage(X,RA,R)},writePackedFixed32:function(X,R){R.length&&this.writeMessage(X,NA,R)},writePackedSFixed32:function(X,R){R.length&&this.writeMessage(X,jA,R)},writePackedFixed64:function(X,R){R.length&&this.writeMessage(X,UA,R)},writePackedSFixed64:function(X,R){R.length&&this.writeMessage(X,Nb,R)},writeBytesField:function(X,R){this.writeTag(X,Wu.Bytes),this.writeBytes(R)},writeFixed32Field:function(X,R){this.writeTag(X,Wu.Fixed32),this.writeFixed32(R)},writeSFixed32Field:function(X,R){this.writeTag(X,Wu.Fixed32),this.writeSFixed32(R)},writeFixed64Field:function(X,R){this.writeTag(X,Wu.Fixed64),this.writeFixed64(R)},writeSFixed64Field:function(X,R){this.writeTag(X,Wu.Fixed64),this.writeSFixed64(R)},writeVarintField:function(X,R){this.writeTag(X,Wu.Varint),this.writeVarint(R)},writeSVarintField:function(X,R){this.writeTag(X,Wu.Varint),this.writeSVarint(R)},writeStringField:function(X,R){this.writeTag(X,Wu.Bytes),this.writeString(R)},writeFloatField:function(X,R){this.writeTag(X,Wu.Fixed32),this.writeFloat(R)},writeDoubleField:function(X,R){this.writeTag(X,Wu.Fixed64),this.writeDouble(R)},writeBooleanField:function(X,R){this.writeVarintField(X,!!R)}};var Qw=a(a1);let Ub=3;function $A(X,R,at){X===1&&at.readMessage(Uk,R)}function Uk(X,R,at){if(X===3){let{id:kt,bitmap:jt,width:Qt,height:re,left:Ae,top:$e,advance:or}=at.readMessage(t3,{});R.push({id:kt,bitmap:new Xl({width:Qt+2*Ub,height:re+2*Ub},jt),metrics:{width:Qt,height:re,left:Ae,top:$e,advance:or}})}}function t3(X,R,at){X===1?R.id=at.readVarint():X===2?R.bitmap=at.readBytes():X===3?R.width=at.readVarint():X===4?R.height=at.readVarint():X===5?R.left=at.readSVarint():X===6?R.top=at.readSVarint():X===7&&(R.advance=at.readVarint())}let e3=Ub;function $b(X){let R=0,at=0;for(let re of X)R+=re.w*re.h,at=Math.max(at,re.w);X.sort((re,Ae)=>Ae.h-re.h);let kt=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(R/.95)),at),h:1/0}],jt=0,Qt=0;for(let re of X)for(let Ae=kt.length-1;Ae>=0;Ae--){let $e=kt[Ae];if(!(re.w>$e.w||re.h>$e.h)){if(re.x=$e.x,re.y=$e.y,Qt=Math.max(Qt,re.y+re.h),jt=Math.max(jt,re.x+re.w),re.w===$e.w&&re.h===$e.h){let or=kt.pop();Ae=0&&kt>=R&&Vb[this.text.charCodeAt(kt)];kt--)at--;this.text=this.text.substring(R,at),this.sectionIndex=this.sectionIndex.slice(R,at)}substring(R,at){let kt=new wy;return kt.text=this.text.substring(R,at),kt.sectionIndex=this.sectionIndex.slice(R,at),kt.sections=this.sections,kt}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((R,at)=>Math.max(R,this.sections[at].scale),0)}addTextSection(R,at){this.text+=R.text,this.sections.push(X_.forText(R.scale,R.fontStack||at));let kt=this.sections.length-1;for(let jt=0;jt=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Hb(X,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn){let Kn=wy.fromFeature(X,jt),mi;$r===n.ah.vertical&&Kn.verticalizePunctuation();let{processBidirectionalText:Ui,processStyledBidirectionalText:Na}=ac;if(Ui&&Kn.sections.length===1){mi=[];let ho=Ui(Kn.toString(),s1(Kn,or,Qt,R,kt,kn));for(let Ro of ho){let Os=new wy;Os.text=Ro,Os.sections=Kn.sections;for(let Nl=0;Nl0&&ym>rp&&(rp=ym)}else{let kh=Os[du.fontStack],np=kh&&kh[ah];if(np&&np.rect)Py=np.rect,Bh=np.metrics;else{let ym=Ro[du.fontStack],P0=ym&&ym[ah];if(!P0)continue;Bh=P0.metrics}od=(Bf-du.scale)*Iu}Pp?(ho.verticalizable=!0,Zp.push({glyph:ah,imageName:Rm,x:rc,y:wh+od,vertical:Pp,scale:du.scale,fontStack:du.fontStack,sectionIndex:qu,metrics:Bh,rect:Py}),rc+=Fm*du.scale+To):(Zp.push({glyph:ah,imageName:Rm,x:rc,y:wh+od,vertical:Pp,scale:du.scale,fontStack:du.fontStack,sectionIndex:qu,metrics:Bh,rect:Py}),rc+=Bh.advance*du.scale+To)}Zp.length!==0&&(mh=Math.max(rc-To,mh),WA(Zp,0,Zp.length-1,m0,rp)),rc=0;let L0=_s*Bf+rp;yp.lineOffset=Math.max(rp,Lp),wh+=L0,Of=Math.max(L0,Of),++Wd}var yf;let Wp=wh-by,{horizontalAlign:qp,verticalAlign:Gp}=n3(sl);(function(vd,Bf,Lp,yp,Zp,rp,L0,Oh,du){let qu=(Bf-Lp)*Zp,ah=0;ah=rp!==L0?-Oh*yp-by:(-yp*du+.5)*L0;for(let od of vd)for(let Bh of od.positionedGlyphs)Bh.x+=qu,Bh.y+=ah})(ho.positionedLines,m0,qp,Gp,mh,Of,_s,Wp,Ms.length),ho.top+=-Gp*Wp,ho.bottom=ho.top+Wp,ho.left+=-qp*mh,ho.right=ho.left+mh}(La,R,at,kt,mi,re,Ae,$e,$r,or,ln,Fn),!function(ho){for(let Ro of ho)if(Ro.positionedGlyphs.length!==0)return!1;return!0}(fa)&&La}let Vb={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},HA={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},VA={40:!0};function Wb(X,R,at,kt,jt,Qt){if(R.imageName){let re=kt[R.imageName];return re?re.displaySize[0]*R.scale*Iu/Qt+jt:0}{let re=at[R.fontStack],Ae=re&&re[X];return Ae?Ae.metrics.advance*R.scale+jt:0}}function Hk(X,R,at,kt){let jt=Math.pow(X-R,2);return kt?X=0,or=0;for(let $r=0;$ror){let Cr=Math.ceil(Qt/or);jt*=Cr/re,re=Cr}return{x1:kt,y1:jt,x2:kt+Qt,y2:jt+re}}function Wk(X,R,at,kt,jt,Qt){let re=X.image,Ae;if(re.content){let mi=re.content,Ui=re.pixelRatio||1;Ae=[mi[0]/Ui,mi[1]/Ui,re.displaySize[0]-mi[2]/Ui,re.displaySize[1]-mi[3]/Ui]}let $e=R.left*Qt,or=R.right*Qt,Cr,$r,ln,kn;at==="width"||at==="both"?(kn=jt[0]+$e-kt[3],$r=jt[0]+or+kt[1]):(kn=jt[0]+($e+or-re.displaySize[0])/2,$r=kn+re.displaySize[0]);let Fn=R.top*Qt,Kn=R.bottom*Qt;return at==="height"||at==="both"?(Cr=jt[1]+Fn-kt[0],ln=jt[1]+Kn+kt[2]):(Cr=jt[1]+(Fn+Kn-re.displaySize[1])/2,ln=Cr+re.displaySize[1]),{image:re,top:Cr,right:$r,bottom:ln,left:kn,collisionPadding:Ae}}let J_=255,ng=128,ov=J_*ng;function qk(X,R){let{expression:at}=R;if(at.kind==="constant")return{kind:"constant",layoutSize:at.evaluate(new Zl(X+1))};if(at.kind==="source")return{kind:"source"};{let{zoomStops:kt,interpolationType:jt}=at,Qt=0;for(;Qtre.id),this.index=R.index,this.pixelRatio=R.pixelRatio,this.sourceLayerIndex=R.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ki([]),this.placementViewportMatrix=ki([]);let at=this.layers[0]._unevaluatedLayout._values;this.textSizeData=qk(this.zoom,at["text-size"]),this.iconSizeData=qk(this.zoom,at["icon-size"]);let kt=this.layers[0].layout,jt=kt.get("symbol-sort-key"),Qt=kt.get("symbol-z-order");this.canOverlap=i3(kt,"text-overlap","text-allow-overlap")!=="never"||i3(kt,"icon-overlap","icon-allow-overlap")!=="never"||kt.get("text-ignore-placement")||kt.get("icon-ignore-placement"),this.sortFeaturesByKey=Qt!=="viewport-y"&&!jt.isConstant(),this.sortFeaturesByY=(Qt==="viewport-y"||Qt==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,kt.get("symbol-placement")==="point"&&(this.writingModes=kt.get("text-writing-mode").map(re=>n.ah[re])),this.stateDependentLayerIds=this.layers.filter(re=>re.isStateDependent()).map(re=>re.id),this.sourceID=R.sourceID}createArrays(){this.text=new Sd(new oc(this.layers,this.zoom,R=>/^text/.test(R))),this.icon=new Sd(new oc(this.layers,this.zoom,R=>/^icon/.test(R))),this.glyphOffsetArray=new Sl,this.lineVertexArray=new Ll,this.symbolInstances=new xs,this.textAnchorOffsets=new zl}calculateGlyphDependencies(R,at,kt,jt,Qt){for(let re=0;re0)&&(re.value.kind!=="constant"||re.value.value.length>0),Cr=$e.value.kind!=="constant"||!!$e.value.value||Object.keys($e.parameters).length>0,$r=Qt.get("symbol-sort-key");if(this.features=[],!or&&!Cr)return;let ln=at.iconDependencies,kn=at.glyphDependencies,Fn=at.availableImages,Kn=new Zl(this.zoom);for(let{feature:mi,id:Ui,index:Na,sourceLayerIndex:fa}of R){let La=jt._featureFilter.needGeometry,ho=Vr(mi,La);if(!jt._featureFilter.filter(Kn,ho,kt))continue;let Ro,Os;if(La||(ho.geometry=Ir(mi)),or){let Ms=jt.getValueAndResolveTokens("text-field",ho,kt,Fn),_s=Un.factory(Ms),sl=this.hasRTLText=this.hasRTLText||ZA(_s);(!sl||ac.getRTLTextPluginStatus()==="unavailable"||sl&&ac.isParsed())&&(Ro=gd(_s,jt,ho))}if(Cr){let Ms=jt.getValueAndResolveTokens("icon-image",ho,kt,Fn);Os=Ms instanceof Zi?Ms:Zi.fromString(Ms)}if(!Ro&&!Os)continue;let Nl=this.sortFeaturesByKey?$r.evaluate(ho,{},kt):void 0;if(this.features.push({id:Ui,text:Ro,icon:Os,index:Na,sourceLayerIndex:fa,geometry:ho.geometry,properties:mi.properties,type:GA[mi.type],sortKey:Nl}),Os&&(ln[Os.name]=!0),Ro){let Ms=re.evaluate(ho,{},kt).join(","),_s=Qt.get("text-rotation-alignment")!=="viewport"&&Qt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(n.ah.vertical)>=0;for(let sl of Ro.sections)if(sl.image)ln[sl.image.name]=!0;else{let Ks=ks(Ro.toString()),Hs=sl.fontStack||Ms,To=kn[Hs]=kn[Hs]||{};this.calculateGlyphDependencies(sl.text,To,_s,this.allowVerticalPlacement,Ks)}}}Qt.get("symbol-placement")==="line"&&(this.features=function(mi){let Ui={},Na={},fa=[],La=0;function ho(Ms){fa.push(mi[Ms]),La++}function Ro(Ms,_s,sl){let Ks=Na[Ms];return delete Na[Ms],Na[_s]=Ks,fa[Ks].geometry[0].pop(),fa[Ks].geometry[0]=fa[Ks].geometry[0].concat(sl[0]),Ks}function Os(Ms,_s,sl){let Ks=Ui[_s];return delete Ui[_s],Ui[Ms]=Ks,fa[Ks].geometry[0].shift(),fa[Ks].geometry[0]=sl[0].concat(fa[Ks].geometry[0]),Ks}function Nl(Ms,_s,sl){let Ks=sl?_s[0][_s[0].length-1]:_s[0][0];return`${Ms}:${Ks.x}:${Ks.y}`}for(let Ms=0;MsMs.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((mi,Ui)=>mi.sortKey-Ui.sortKey)}update(R,at,kt){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(R,at,this.layers,kt),this.icon.programConfigurations.updatePaintArrays(R,at,this.layers,kt))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(R){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(R),this.iconCollisionBox.upload(R)),this.text.upload(R,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(R,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(R,at){let kt=this.lineVertexArray.length;if(R.segment!==void 0){let jt=R.dist(at[R.segment+1]),Qt=R.dist(at[R.segment]),re={};for(let Ae=R.segment+1;Ae=0;Ae--)re[Ae]={x:at[Ae].x,y:at[Ae].y,tileUnitDistanceFromAnchor:Qt},Ae>0&&(Qt+=at[Ae-1].dist(at[Ae]));for(let Ae=0;Ae0}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(R,at){let kt=R.placedSymbolArray.get(at),jt=kt.vertexStartIndex+4*kt.numGlyphs;for(let Qt=kt.vertexStartIndex;Qtjt[Ae]-jt[$e]||Qt[$e]-Qt[Ae]),re}addToSortKeyRanges(R,at){let kt=this.sortKeyRanges[this.sortKeyRanges.length-1];kt&&kt.sortKey===at?kt.symbolInstanceEnd=R+1:this.sortKeyRanges.push({sortKey:at,symbolInstanceStart:R,symbolInstanceEnd:R+1})}sortFeatures(R){if(this.sortFeaturesByY&&this.sortedAngle!==R&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(R),this.sortedAngle=R,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let at of this.symbolInstanceIndexes){let kt=this.symbolInstances.get(at);this.featureSortOrder.push(kt.featureIndex),[kt.rightJustifiedTextSymbolIndex,kt.centerJustifiedTextSymbolIndex,kt.leftJustifiedTextSymbolIndex].forEach((jt,Qt,re)=>{jt>=0&&re.indexOf(jt)===Qt&&this.addIndicesForPlacedSymbol(this.text,jt)}),kt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,kt.verticalPlacedTextSymbolIndex),kt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,kt.placedIconSymbolIndex),kt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,kt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Q_,tx;pa("SymbolBucket",l1,{omit:["layers","collisionBoxArray","features","compareText"]}),l1.MAX_GLYPHS=65535,l1.addDynamicAttributes=sv;var o3={get paint(){return tx=tx||new Kt({"icon-opacity":new $s(dt.paint_symbol["icon-opacity"]),"icon-color":new $s(dt.paint_symbol["icon-color"]),"icon-halo-color":new $s(dt.paint_symbol["icon-halo-color"]),"icon-halo-width":new $s(dt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new $s(dt.paint_symbol["icon-halo-blur"]),"icon-translate":new ds(dt.paint_symbol["icon-translate"]),"icon-translate-anchor":new ds(dt.paint_symbol["icon-translate-anchor"]),"text-opacity":new $s(dt.paint_symbol["text-opacity"]),"text-color":new $s(dt.paint_symbol["text-color"],{runtimeType:mr,getOverride:X=>X.textColor,hasOverride:X=>!!X.textColor}),"text-halo-color":new $s(dt.paint_symbol["text-halo-color"]),"text-halo-width":new $s(dt.paint_symbol["text-halo-width"]),"text-halo-blur":new $s(dt.paint_symbol["text-halo-blur"]),"text-translate":new ds(dt.paint_symbol["text-translate"]),"text-translate-anchor":new ds(dt.paint_symbol["text-translate-anchor"])})},get layout(){return Q_=Q_||new Kt({"symbol-placement":new ds(dt.layout_symbol["symbol-placement"]),"symbol-spacing":new ds(dt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ds(dt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new $s(dt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ds(dt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ds(dt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ds(dt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ds(dt.layout_symbol["icon-ignore-placement"]),"icon-optional":new ds(dt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ds(dt.layout_symbol["icon-rotation-alignment"]),"icon-size":new $s(dt.layout_symbol["icon-size"]),"icon-text-fit":new ds(dt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ds(dt.layout_symbol["icon-text-fit-padding"]),"icon-image":new $s(dt.layout_symbol["icon-image"]),"icon-rotate":new $s(dt.layout_symbol["icon-rotate"]),"icon-padding":new $s(dt.layout_symbol["icon-padding"]),"icon-keep-upright":new ds(dt.layout_symbol["icon-keep-upright"]),"icon-offset":new $s(dt.layout_symbol["icon-offset"]),"icon-anchor":new $s(dt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ds(dt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ds(dt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ds(dt.layout_symbol["text-rotation-alignment"]),"text-field":new $s(dt.layout_symbol["text-field"]),"text-font":new $s(dt.layout_symbol["text-font"]),"text-size":new $s(dt.layout_symbol["text-size"]),"text-max-width":new $s(dt.layout_symbol["text-max-width"]),"text-line-height":new ds(dt.layout_symbol["text-line-height"]),"text-letter-spacing":new $s(dt.layout_symbol["text-letter-spacing"]),"text-justify":new $s(dt.layout_symbol["text-justify"]),"text-radial-offset":new $s(dt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ds(dt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new $s(dt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new $s(dt.layout_symbol["text-anchor"]),"text-max-angle":new ds(dt.layout_symbol["text-max-angle"]),"text-writing-mode":new ds(dt.layout_symbol["text-writing-mode"]),"text-rotate":new $s(dt.layout_symbol["text-rotate"]),"text-padding":new ds(dt.layout_symbol["text-padding"]),"text-keep-upright":new ds(dt.layout_symbol["text-keep-upright"]),"text-transform":new $s(dt.layout_symbol["text-transform"]),"text-offset":new $s(dt.layout_symbol["text-offset"]),"text-allow-overlap":new ds(dt.layout_symbol["text-allow-overlap"]),"text-overlap":new ds(dt.layout_symbol["text-overlap"]),"text-ignore-placement":new ds(dt.layout_symbol["text-ignore-placement"]),"text-optional":new ds(dt.layout_symbol["text-optional"])})}};class Ty{constructor(R){if(R.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=R.property.overrides?R.property.overrides.runtimeType:ce,this.defaultValue=R}evaluate(R){if(R.formattedSection){let at=this.defaultValue.property.overrides;if(at&&at.hasOverride(R.formattedSection))return at.getOverride(R.formattedSection)}return R.feature&&R.featureState?this.defaultValue.evaluate(R.feature,R.featureState):this.defaultValue.property.specification.default}eachChild(R){this.defaultValue.isConstant()||R(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}pa("FormatSectionOverride",Ty,{omit:["defaultValue"]});class Zb extends pt{constructor(R){super(R,o3)}recalculate(R,at){if(super.recalculate(R,at),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let kt=this.layout.get("text-writing-mode");if(kt){let jt=[];for(let Qt of kt)jt.indexOf(Qt)<0&&jt.push(Qt);this.layout._values["text-writing-mode"]=jt}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(R,at,kt,jt){let Qt=this.layout.get(R).evaluate(at,{},kt,jt),re=this._unevaluatedLayout._values[R];return re.isDataDriven()||rd(re.value)||!Qt?Qt:function(Ae,$e){return $e.replace(/{([^{}]+)}/g,(or,Cr)=>Ae&&Cr in Ae?String(Ae[Cr]):"")}(at.properties,Qt)}createBucket(R){return new l1(R)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let R of o3.paint.overridableProperties){if(!Zb.hasPaintOverride(this.layout,R))continue;let at=this.paint.get(R),kt=new Ty(at),jt=new Ju(kt,at.property.specification),Qt=null;Qt=at.value.kind==="constant"||at.value.kind==="source"?new $h("source",jt):new ju("composite",jt,at.value.zoomStops),this.paint._values[R]=new Wc(at.property,Qt,at.parameters)}}_handleOverridablePaintPropertyUpdate(R,at,kt){return!(!this.layout||at.isDataDriven()||kt.isDataDriven())&&Zb.hasPaintOverride(this.layout,R)}static hasPaintOverride(R,at){let kt=R.get("text-field"),jt=o3.paint.properties[at],Qt=!1,re=Ae=>{for(let $e of Ae)if(jt.overrides&&jt.overrides.hasOverride($e))return void(Qt=!0)};if(kt.value.kind==="constant"&&kt.value.value instanceof Un)re(kt.value.value.sections);else if(kt.value.kind==="source"){let Ae=or=>{Qt||(or instanceof so&&Ei(or.value)===Er?re(or.value.sections):or instanceof Ol?re(or.sections):or.eachChild(Ae))},$e=kt.value;$e._styleExpression&&Ae($e._styleExpression.expression)}return Qt}}let s3;var Gk={get paint(){return s3=s3||new Kt({"background-color":new ds(dt.paint_background["background-color"]),"background-pattern":new eu(dt.paint_background["background-pattern"]),"background-opacity":new ds(dt.paint_background["background-opacity"])})}};class ex extends pt{constructor(R){super(R,Gk)}}let Kb;var l3={get paint(){return Kb=Kb||new Kt({"raster-opacity":new ds(dt.paint_raster["raster-opacity"]),"raster-hue-rotate":new ds(dt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ds(dt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ds(dt.paint_raster["raster-brightness-max"]),"raster-saturation":new ds(dt.paint_raster["raster-saturation"]),"raster-contrast":new ds(dt.paint_raster["raster-contrast"]),"raster-resampling":new ds(dt.paint_raster["raster-resampling"]),"raster-fade-duration":new ds(dt.paint_raster["raster-fade-duration"])})}};class KA extends pt{constructor(R){super(R,l3)}}class Zk extends pt{constructor(R){super(R,{}),this.onAdd=at=>{this.implementation.onAdd&&this.implementation.onAdd(at,at.painter.context.gl)},this.onRemove=at=>{this.implementation.onRemove&&this.implementation.onRemove(at,at.painter.context.gl)},this.implementation=R}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class rx{constructor(R){this._methodToThrottle=R,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let c3=63710088e-1;class ig{constructor(R,at){if(isNaN(R)||isNaN(at))throw new Error(`Invalid LngLat object: (${R}, ${at})`);if(this.lng=+R,this.lat=+at,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ig(D(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(R){let at=Math.PI/180,kt=this.lat*at,jt=R.lat*at,Qt=Math.sin(kt)*Math.sin(jt)+Math.cos(kt)*Math.cos(jt)*Math.cos((R.lng-this.lng)*at);return c3*Math.acos(Math.min(Qt,1))}static convert(R){if(R instanceof ig)return R;if(Array.isArray(R)&&(R.length===2||R.length===3))return new ig(Number(R[0]),Number(R[1]));if(!Array.isArray(R)&&typeof R=="object"&&R!==null)return new ig(Number("lng"in R?R.lng:R.lon),Number(R.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let Kk=2*Math.PI*c3;function Yb(X){return Kk*Math.cos(X*Math.PI/180)}function Xb(X){return(180+X)/360}function Yk(X){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X*Math.PI/360)))/360}function vm(X,R){return X/Yb(R)}function u3(X){return 360/Math.PI*Math.atan(Math.exp((180-360*X)*Math.PI/180))-90}class nx{constructor(R,at,kt=0){this.x=+R,this.y=+at,this.z=+kt}static fromLngLat(R,at=0){let kt=ig.convert(R);return new nx(Xb(kt.lng),Yk(kt.lat),vm(at,kt.lat))}toLngLat(){return new ig(360*this.x-180,u3(this.y))}toAltitude(){return this.z*Yb(u3(this.y))}meterInMercatorCoordinateUnits(){return 1/Kk*(R=u3(this.y),1/Math.cos(R*Math.PI/180));var R}}function Xk(X,R,at){var kt=2*Math.PI*6378137/256/Math.pow(2,at);return[X*kt-2*Math.PI*6378137/2,R*kt-2*Math.PI*6378137/2]}class h3{constructor(R,at,kt){if(!function(jt,Qt,re){return!(jt<0||jt>25||re<0||re>=Math.pow(2,jt)||Qt<0||Qt>=Math.pow(2,jt))}(R,at,kt))throw new Error(`x=${at}, y=${kt}, z=${R} outside of bounds. 0<=x<${Math.pow(2,R)}, 0<=y<${Math.pow(2,R)} 0<=z<=25 `);this.z=R,this.x=at,this.y=kt,this.key=Sy(0,R,R,at,kt)}equals(R){return this.z===R.z&&this.x===R.x&&this.y===R.y}url(R,at,kt){let jt=(re=this.y,Ae=this.z,$e=Xk(256*(Qt=this.x),256*(re=Math.pow(2,Ae)-re-1),Ae),or=Xk(256*(Qt+1),256*(re+1),Ae),$e[0]+","+$e[1]+","+or[0]+","+or[1]);var Qt,re,Ae,$e,or;let Cr=function($r,ln,kn){let Fn,Kn="";for(let mi=$r;mi>0;mi--)Fn=1<1?"@2x":"").replace(/{quadkey}/g,Cr).replace(/{bbox-epsg-3857}/g,jt)}isChildOf(R){let at=this.z-R.z;return at>0&&R.x===this.x>>at&&R.y===this.y>>at}getTilePoint(R){let at=Math.pow(2,this.z);return new c((R.x*at-this.x)*hc,(R.y*at-this.y)*hc)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Jk{constructor(R,at){this.wrap=R,this.canonical=at,this.key=Sy(R,at.z,at.z,at.x,at.y)}}class X0{constructor(R,at,kt,jt,Qt){if(R= z; overscaledZ = ${R}; z = ${kt}`);this.overscaledZ=R,this.wrap=at,this.canonical=new h3(kt,+jt,+Qt),this.key=Sy(at,R,kt,jt,Qt)}clone(){return new X0(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(R){return this.overscaledZ===R.overscaledZ&&this.wrap===R.wrap&&this.canonical.equals(R.canonical)}scaledTo(R){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let at=this.canonical.z-R;return R>this.canonical.z?new X0(R,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new X0(R,this.wrap,R,this.canonical.x>>at,this.canonical.y>>at)}calculateScaledKey(R,at){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let kt=this.canonical.z-R;return R>this.canonical.z?Sy(this.wrap*+at,R,this.canonical.z,this.canonical.x,this.canonical.y):Sy(this.wrap*+at,R,R,this.canonical.x>>kt,this.canonical.y>>kt)}isChildOf(R){if(R.wrap!==this.wrap)return!1;let at=this.canonical.z-R.canonical.z;return R.overscaledZ===0||R.overscaledZ>at&&R.canonical.y===this.canonical.y>>at}children(R){if(this.overscaledZ>=R)return[new X0(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let at=this.canonical.z+1,kt=2*this.canonical.x,jt=2*this.canonical.y;return[new X0(at,this.wrap,at,kt,jt),new X0(at,this.wrap,at,kt+1,jt),new X0(at,this.wrap,at,kt,jt+1),new X0(at,this.wrap,at,kt+1,jt+1)]}isLessThan(R){return this.wrapR.wrap)&&(this.overscaledZR.overscaledZ)&&(this.canonical.xR.canonical.x)&&this.canonical.ythis.max&&(this.max=$r),$r=this.dim+1||at<-1||at>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(at+1)*this.stride+(R+1)}unpack(R,at,kt){return R*this.redFactor+at*this.greenFactor+kt*this.blueFactor-this.baseShift}getPixels(){return new Rl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(R,at,kt){if(this.dim!==R.dim)throw new Error("dem dimension mismatch");let jt=at*this.dim,Qt=at*this.dim+this.dim,re=kt*this.dim,Ae=kt*this.dim+this.dim;switch(at){case-1:jt=Qt-1;break;case 1:Qt=jt+1}switch(kt){case-1:re=Ae-1;break;case 1:Ae=re+1}let $e=-at*this.dim,or=-kt*this.dim;for(let Cr=re;Cr=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${R} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[R]}}class t6{constructor(R,at,kt,jt,Qt){this.type="Feature",this._vectorTileFeature=R,R._z=at,R._x=kt,R._y=jt,this.properties=R.properties,this.id=Qt}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(R){this._geometry=R}toJSON(){let R={geometry:this.geometry};for(let at in this)at!=="_geometry"&&at!=="_vectorTileFeature"&&(R[at]=this[at]);return R}}class e6{constructor(R,at){this.tileID=R,this.x=R.canonical.x,this.y=R.canonical.y,this.z=R.canonical.z,this.grid=new Za(hc,16,0),this.grid3D=new Za(hc,16,0),this.featureIndexArray=new Sc,this.promoteId=at}insert(R,at,kt,jt,Qt,re){let Ae=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(kt,jt,Qt);let $e=re?this.grid3D:this.grid;for(let or=0;or=0&&$r[3]>=0&&$e.insert(Ae,$r[0],$r[1],$r[2],$r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Di.VectorTile(new Qw(this.rawTileData)).layers,this.sourceLayerCoder=new Qk(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(R,at,kt,jt){this.loadVTLayers();let Qt=R.params||{},re=hc/R.tileSize/R.scale,Ae=Ud(Qt.filter),$e=R.queryGeometry,or=R.queryPadding*re,Cr=d3($e),$r=this.grid.query(Cr.minX-or,Cr.minY-or,Cr.maxX+or,Cr.maxY+or),ln=d3(R.cameraQueryGeometry),kn=this.grid3D.query(ln.minX-or,ln.minY-or,ln.maxX+or,ln.maxY+or,(mi,Ui,Na,fa)=>function(La,ho,Ro,Os,Nl){for(let _s of La)if(ho<=_s.x&&Ro<=_s.y&&Os>=_s.x&&Nl>=_s.y)return!0;let Ms=[new c(ho,Ro),new c(ho,Nl),new c(Os,Nl),new c(Os,Ro)];if(La.length>2){for(let _s of Ms)if(ji(La,_s))return!0}for(let _s=0;_s(fa||(fa=Ir(La)),ho.queryIntersectsFeature($e,La,Ro,fa,this.z,R.transform,re,R.pixelPosMatrix)))}return Fn}loadMatchingFeature(R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r){let ln=this.bucketLayerIDs[at];if(re&&!function(mi,Ui){for(let Na=0;Na=0)return!0;return!1}(re,ln))return;let kn=this.sourceLayerCoder.decode(kt),Fn=this.vtLayers[kn].feature(jt);if(Qt.needGeometry){let mi=Vr(Fn,!0);if(!Qt.filter(new Zl(this.tileID.overscaledZ),mi,this.tileID.canonical))return}else if(!Qt.filter(new Zl(this.tileID.overscaledZ),Fn))return;let Kn=this.getId(Fn,kn);for(let mi=0;mi{let Ae=R instanceof Gh?R.get(re):null;return Ae&&Ae.evaluate?Ae.evaluate(at,kt,jt):Ae})}function d3(X){let R=1/0,at=1/0,kt=-1/0,jt=-1/0;for(let Qt of X)R=Math.min(R,Qt.x),at=Math.min(at,Qt.y),kt=Math.max(kt,Qt.x),jt=Math.max(jt,Qt.y);return{minX:R,minY:at,maxX:kt,maxY:jt}}function n6(X,R){return R-X}function i6(X,R,at,kt,jt){let Qt=[];for(let re=0;re=kt&&$r.x>=kt||(Cr.x>=kt?Cr=new c(kt,Cr.y+(kt-Cr.x)/($r.x-Cr.x)*($r.y-Cr.y))._round():$r.x>=kt&&($r=new c(kt,Cr.y+(kt-Cr.x)/($r.x-Cr.x)*($r.y-Cr.y))._round()),Cr.y>=jt&&$r.y>=jt||(Cr.y>=jt?Cr=new c(Cr.x+(jt-Cr.y)/($r.y-Cr.y)*($r.x-Cr.x),jt)._round():$r.y>=jt&&($r=new c(Cr.x+(jt-Cr.y)/($r.y-Cr.y)*($r.x-Cr.x),jt)._round()),$e&&Cr.equals($e[$e.length-1])||($e=[Cr],Qt.push($e)),$e.push($r)))))}}return Qt}pa("FeatureIndex",e6,{omit:["rawTileData","sourceLayerCoder"]});class lv extends c{constructor(R,at,kt,jt){super(R,at),this.angle=kt,jt!==void 0&&(this.segment=jt)}clone(){return new lv(this.x,this.y,this.angle,this.segment)}}function a6(X,R,at,kt,jt){if(R.segment===void 0||at===0)return!0;let Qt=R,re=R.segment+1,Ae=0;for(;Ae>-at/2;){if(re--,re<0)return!1;Ae-=X[re].dist(Qt),Qt=X[re]}Ae+=X[re].dist(X[re+1]),re++;let $e=[],or=0;for(;Aekt;)or-=$e.shift().angleDelta;if(or>jt)return!1;re++,Ae+=Cr.dist($r)}return!0}function o6(X){let R=0;for(let at=0;ator){let Fn=(or-$e)/kn,Kn=Zo.number($r.x,ln.x,Fn),mi=Zo.number($r.y,ln.y,Fn),Ui=new lv(Kn,mi,ln.angleTo($r),Cr);return Ui._round(),!re||a6(X,Ui,Ae,re,R)?Ui:void 0}$e+=kn}}function XA(X,R,at,kt,jt,Qt,re,Ae,$e){let or=s6(kt,Qt,re),Cr=l6(kt,jt),$r=Cr*re,ln=X[0].x===0||X[0].x===$e||X[0].y===0||X[0].y===$e;return R-$r=0&&La<$e&&ho>=0&&ho<$e&&ln-or>=0&&ln+or<=Cr){let Ro=new lv(La,ho,Na,Fn);Ro._round(),kt&&!a6(X,Ro,Qt,kt,jt)||kn.push(Ro)}}$r+=Ui}return Ae||kn.length||re||(kn=u1(X,$r/2,at,kt,jt,Qt,re,!0,$e)),kn}pa("Anchor",lv);let Cy=vf;function c6(X,R,at,kt){let jt=[],Qt=X.image,re=Qt.pixelRatio,Ae=Qt.paddedRect.w-2*Cy,$e=Qt.paddedRect.h-2*Cy,or={x1:X.left,y1:X.top,x2:X.right,y2:X.bottom},Cr=Qt.stretchX||[[0,Ae]],$r=Qt.stretchY||[[0,$e]],ln=(To,vl)=>To+vl[1]-vl[0],kn=Cr.reduce(ln,0),Fn=$r.reduce(ln,0),Kn=Ae-kn,mi=$e-Fn,Ui=0,Na=kn,fa=0,La=Fn,ho=0,Ro=Kn,Os=0,Nl=mi;if(Qt.content&&kt){let To=Qt.content,vl=To[2]-To[0],ll=To[3]-To[1];(Qt.textFitWidth||Qt.textFitHeight)&&(or=Vk(X)),Ui=Ay(Cr,0,To[0]),fa=Ay($r,0,To[1]),Na=Ay(Cr,To[0],To[2]),La=Ay($r,To[1],To[3]),ho=To[0]-Ui,Os=To[1]-fa,Ro=vl-Na,Nl=ll-La}let Ms=or.x1,_s=or.y1,sl=or.x2-Ms,Ks=or.y2-_s,Hs=(To,vl,ll,rc)=>{let wh=E0(To.stretch-Ui,Na,sl,Ms),mh=Jb(To.fixed-ho,Ro,To.stretch,kn),Of=E0(vl.stretch-fa,La,Ks,_s),m0=Jb(vl.fixed-Os,Nl,vl.stretch,Fn),Wd=E0(ll.stretch-Ui,Na,sl,Ms),yf=Jb(ll.fixed-ho,Ro,ll.stretch,kn),Wp=E0(rc.stretch-fa,La,Ks,_s),qp=Jb(rc.fixed-Os,Nl,rc.stretch,Fn),Gp=new c(wh,Of),vd=new c(Wd,Of),Bf=new c(Wd,Wp),Lp=new c(wh,Wp),yp=new c(mh/re,m0/re),Zp=new c(yf/re,qp/re),rp=R*Math.PI/180;if(rp){let du=Math.sin(rp),qu=Math.cos(rp),ah=[qu,-du,du,qu];Gp._matMult(ah),vd._matMult(ah),Lp._matMult(ah),Bf._matMult(ah)}let L0=To.stretch+To.fixed,Oh=vl.stretch+vl.fixed;return{tl:Gp,tr:vd,bl:Lp,br:Bf,tex:{x:Qt.paddedRect.x+Cy+L0,y:Qt.paddedRect.y+Cy+Oh,w:ll.stretch+ll.fixed-L0,h:rc.stretch+rc.fixed-Oh},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:yp,pixelOffsetBR:Zp,minFontScaleX:Ro/re/sl,minFontScaleY:Nl/re/Ks,isSDF:at}};if(kt&&(Qt.stretchX||Qt.stretchY)){let To=My(Cr,Kn,kn),vl=My($r,mi,Fn);for(let ll=0;ll0&&(Kn=Math.max(10,Kn),this.circleDiameter=Kn)}else{let ln=!(($r=re.image)===null||$r===void 0)&&$r.content&&(re.image.textFitWidth||re.image.textFitHeight)?Vk(re):{x1:re.left,y1:re.top,x2:re.right,y2:re.bottom};ln.y1=ln.y1*Ae-$e[0],ln.y2=ln.y2*Ae+$e[2],ln.x1=ln.x1*Ae-$e[3],ln.x2=ln.x2*Ae+$e[1];let kn=re.collisionPadding;if(kn&&(ln.x1-=kn[0]*Ae,ln.y1-=kn[1]*Ae,ln.x2+=kn[2]*Ae,ln.y2+=kn[3]*Ae),Cr){let Fn=new c(ln.x1,ln.y1),Kn=new c(ln.x2,ln.y1),mi=new c(ln.x1,ln.y2),Ui=new c(ln.x2,ln.y2),Na=Cr*Math.PI/180;Fn._rotate(Na),Kn._rotate(Na),mi._rotate(Na),Ui._rotate(Na),ln.x1=Math.min(Fn.x,Kn.x,mi.x,Ui.x),ln.x2=Math.max(Fn.x,Kn.x,mi.x,Ui.x),ln.y1=Math.min(Fn.y,Kn.y,mi.y,Ui.y),ln.y2=Math.max(Fn.y,Kn.y,mi.y,Ui.y)}R.emplaceBack(at.x,at.y,ln.x1,ln.y1,ln.x2,ln.y2,kt,jt,Qt)}this.boxEndIndex=R.length}}class JA{constructor(R=[],at=(kt,jt)=>ktjt?1:0){if(this.data=R,this.length=this.data.length,this.compare=at,this.length>0)for(let kt=(this.length>>1)-1;kt>=0;kt--)this._down(kt)}push(R){this.data.push(R),this._up(this.length++)}pop(){if(this.length===0)return;let R=this.data[0],at=this.data.pop();return--this.length>0&&(this.data[0]=at,this._down(0)),R}peek(){return this.data[0]}_up(R){let{data:at,compare:kt}=this,jt=at[R];for(;R>0;){let Qt=R-1>>1,re=at[Qt];if(kt(jt,re)>=0)break;at[R]=re,R=Qt}at[R]=jt}_down(R){let{data:at,compare:kt}=this,jt=this.length>>1,Qt=at[R];for(;R=0)break;at[R]=at[re],R=re}at[R]=Qt}}function QA(X,R=1,at=!1){let kt=1/0,jt=1/0,Qt=-1/0,re=-1/0,Ae=X[0];for(let kn=0;knQt)&&(Qt=Fn.x),(!kn||Fn.y>re)&&(re=Fn.y)}let $e=Math.min(Qt-kt,re-jt),or=$e/2,Cr=new JA([],t7);if($e===0)return new c(kt,jt);for(let kn=kt;kn$r.d||!$r.d)&&($r=kn,at&&console.log("found best %d after %d probes",Math.round(1e4*kn.d)/1e4,ln)),kn.max-$r.d<=R||(or=kn.h/2,Cr.push(new ag(kn.p.x-or,kn.p.y-or,or,X)),Cr.push(new ag(kn.p.x+or,kn.p.y-or,or,X)),Cr.push(new ag(kn.p.x-or,kn.p.y+or,or,X)),Cr.push(new ag(kn.p.x+or,kn.p.y+or,or,X)),ln+=4)}return at&&(console.log(`num probes: ${ln}`),console.log(`best distance: ${$r.d}`)),$r.p}function t7(X,R){return R.max-X.max}function ag(X,R,at,kt){this.p=new c(X,R),this.h=at,this.d=function(jt,Qt){let re=!1,Ae=1/0;for(let $e=0;$ejt.y!=Fn.y>jt.y&&jt.x<(Fn.x-kn.x)*(jt.y-kn.y)/(Fn.y-kn.y)+kn.x&&(re=!re),Ae=Math.min(Ae,eo(jt,kn,Fn))}}return(re?1:-1)*Math.sqrt(Ae)}(this.p,kt),this.max=this.d+this.h*Math.SQRT2}var ep;n.aq=void 0,(ep=n.aq||(n.aq={}))[ep.center=1]="center",ep[ep.left=2]="left",ep[ep.right=3]="right",ep[ep.top=4]="top",ep[ep.bottom=5]="bottom",ep[ep["top-left"]=6]="top-left",ep[ep["top-right"]=7]="top-right",ep[ep["bottom-left"]=8]="bottom-left",ep[ep["bottom-right"]=9]="bottom-right";let cv=7,f3=Number.POSITIVE_INFINITY;function u6(X,R){return R[1]!==f3?function(at,kt,jt){let Qt=0,re=0;switch(kt=Math.abs(kt),jt=Math.abs(jt),at){case"top-right":case"top-left":case"top":re=jt-cv;break;case"bottom-right":case"bottom-left":case"bottom":re=-jt+cv}switch(at){case"top-right":case"bottom-right":case"right":Qt=-kt;break;case"top-left":case"bottom-left":case"left":Qt=kt}return[Qt,re]}(X,R[0],R[1]):function(at,kt){let jt=0,Qt=0;kt<0&&(kt=0);let re=kt/Math.SQRT2;switch(at){case"top-right":case"top-left":Qt=re-cv;break;case"bottom-right":case"bottom-left":Qt=-re+cv;break;case"bottom":Qt=-kt+cv;break;case"top":Qt=kt-cv}switch(at){case"top-right":case"bottom-right":jt=-re;break;case"top-left":case"bottom-left":jt=re;break;case"left":jt=kt;break;case"right":jt=-kt}return[jt,Qt]}(X,R[0])}function h6(X,R,at){var kt;let jt=X.layout,Qt=(kt=jt.get("text-variable-anchor-offset"))===null||kt===void 0?void 0:kt.evaluate(R,{},at);if(Qt){let Ae=Qt.values,$e=[];for(let or=0;orln*Iu);Cr.startsWith("top")?$r[1]-=cv:Cr.startsWith("bottom")&&($r[1]+=cv),$e[or+1]=$r}return new Fi($e)}let re=jt.get("text-variable-anchor");if(re){let Ae;Ae=X._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[jt.get("text-radial-offset").evaluate(R,{},at)*Iu,f3]:jt.get("text-offset").evaluate(R,{},at).map(or=>or*Iu);let $e=[];for(let or of re)$e.push(or,u6(or,Ae));return new Fi($e)}return null}function p3(X){switch(X){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function e7(X,R,at,kt,jt,Qt,re,Ae,$e,or,Cr){let $r=Qt.textMaxSize.evaluate(R,{});$r===void 0&&($r=re);let ln=X.layers[0].layout,kn=ln.get("icon-offset").evaluate(R,{},Cr),Fn=f6(at.horizontal),Kn=re/24,mi=X.tilePixelRatio*Kn,Ui=X.tilePixelRatio*$r/24,Na=X.tilePixelRatio*Ae,fa=X.tilePixelRatio*ln.get("symbol-spacing"),La=ln.get("text-padding")*X.tilePixelRatio,ho=function(To,vl,ll,rc=1){let wh=To.get("icon-padding").evaluate(vl,{},ll),mh=wh&&wh.values;return[mh[0]*rc,mh[1]*rc,mh[2]*rc,mh[3]*rc]}(ln,R,Cr,X.tilePixelRatio),Ro=ln.get("text-max-angle")/180*Math.PI,Os=ln.get("text-rotation-alignment")!=="viewport"&&ln.get("symbol-placement")!=="point",Nl=ln.get("icon-rotation-alignment")==="map"&&ln.get("symbol-placement")!=="point",Ms=ln.get("symbol-placement"),_s=fa/2,sl=ln.get("icon-text-fit"),Ks;kt&&sl!=="none"&&(X.allowVerticalPlacement&&at.vertical&&(Ks=Wk(kt,at.vertical,sl,ln.get("icon-text-fit-padding"),kn,Kn)),Fn&&(kt=Wk(kt,Fn,sl,ln.get("icon-text-fit-padding"),kn,Kn)));let Hs=(To,vl)=>{vl.x<0||vl.x>=hc||vl.y<0||vl.y>=hc||function(ll,rc,wh,mh,Of,m0,Wd,yf,Wp,qp,Gp,vd,Bf,Lp,yp,Zp,rp,L0,Oh,du,qu,ah,od,Bh,Py){let Rm=ll.addToLineVertexArray(rc,wh),Fm,Pp,kh,np,ym=0,P0=0,Kp=0,x3=0,b3=-1,n2=-1,Rg={},w3=vi("");if(ll.allowVerticalPlacement&&mh.vertical){let _p=yf.layout.get("text-rotate").evaluate(qu,{},Bh)+90;kh=new Qb(Wp,rc,qp,Gp,vd,mh.vertical,Bf,Lp,yp,_p),Wd&&(np=new Qb(Wp,rc,qp,Gp,vd,Wd,rp,L0,yp,_p))}if(Of){let _p=yf.layout.get("icon-rotate").evaluate(qu,{}),I0=yf.layout.get("icon-text-fit")!=="none",uv=c6(Of,_p,od,I0),Nm=Wd?c6(Wd,_p,od,I0):void 0;Pp=new Qb(Wp,rc,qp,Gp,vd,Of,rp,L0,!1,_p),ym=4*uv.length;let h1=ll.iconSizeData,jm=null;h1.kind==="source"?(jm=[ng*yf.layout.get("icon-size").evaluate(qu,{})],jm[0]>ov&&S(`${ll.layerIds[0]}: Value for "icon-size" is >= ${J_}. Reduce your "icon-size".`)):h1.kind==="composite"&&(jm=[ng*ah.compositeIconSizes[0].evaluate(qu,{},Bh),ng*ah.compositeIconSizes[1].evaluate(qu,{},Bh)],(jm[0]>ov||jm[1]>ov)&&S(`${ll.layerIds[0]}: Value for "icon-size" is >= ${J_}. Reduce your "icon-size".`)),ll.addSymbols(ll.icon,uv,jm,du,Oh,qu,n.ah.none,rc,Rm.lineStartIndex,Rm.lineLength,-1,Bh),b3=ll.icon.placedSymbolArray.length-1,Nm&&(P0=4*Nm.length,ll.addSymbols(ll.icon,Nm,jm,du,Oh,qu,n.ah.vertical,rc,Rm.lineStartIndex,Rm.lineLength,-1,Bh),n2=ll.icon.placedSymbolArray.length-1)}let k3=Object.keys(mh.horizontal);for(let _p of k3){let I0=mh.horizontal[_p];if(!Fm){w3=vi(I0.text);let Nm=yf.layout.get("text-rotate").evaluate(qu,{},Bh);Fm=new Qb(Wp,rc,qp,Gp,vd,I0,Bf,Lp,yp,Nm)}let uv=I0.positionedLines.length===1;if(Kp+=d6(ll,rc,I0,m0,yf,yp,qu,Zp,Rm,mh.vertical?n.ah.horizontal:n.ah.horizontalOnly,uv?k3:[_p],Rg,b3,ah,Bh),uv)break}mh.vertical&&(x3+=d6(ll,rc,mh.vertical,m0,yf,yp,qu,Zp,Rm,n.ah.vertical,["vertical"],Rg,n2,ah,Bh));let T3=Fm?Fm.boxStartIndex:ll.collisionBoxArray.length,S3=Fm?Fm.boxEndIndex:ll.collisionBoxArray.length,r7=kh?kh.boxStartIndex:ll.collisionBoxArray.length,n7=kh?kh.boxEndIndex:ll.collisionBoxArray.length,i7=Pp?Pp.boxStartIndex:ll.collisionBoxArray.length,a7=Pp?Pp.boxEndIndex:ll.collisionBoxArray.length,y6=np?np.boxStartIndex:ll.collisionBoxArray.length,Iy=np?np.boxEndIndex:ll.collisionBoxArray.length,_f=-1,Dy=(_p,I0)=>_p&&_p.circleDiameter?Math.max(_p.circleDiameter,I0):I0;_f=Dy(Fm,_f),_f=Dy(kh,_f),_f=Dy(Pp,_f),_f=Dy(np,_f);let C3=_f>-1?1:0;C3&&(_f*=Py/Iu),ll.glyphOffsetArray.length>=l1.MAX_GLYPHS&&S("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),qu.sortKey!==void 0&&ll.addToSortKeyRanges(ll.symbolInstances.length,qu.sortKey);let _6=h6(yf,qu,Bh),[o7,x6]=function(_p,I0){let uv=_p.length,Nm=I0?.values;if(Nm?.length>0)for(let h1=0;h1=0?Rg.right:-1,Rg.center>=0?Rg.center:-1,Rg.left>=0?Rg.left:-1,Rg.vertical||-1,b3,n2,w3,T3,S3,r7,n7,i7,a7,y6,Iy,qp,Kp,x3,ym,P0,C3,0,Bf,_f,o7,x6)}(X,vl,To,at,kt,jt,Ks,X.layers[0],X.collisionBoxArray,R.index,R.sourceLayerIndex,X.index,mi,[La,La,La,La],Os,$e,Na,ho,Nl,kn,R,Qt,or,Cr,re)};if(Ms==="line")for(let To of i6(R.geometry,0,0,hc,hc)){let vl=XA(To,fa,Ro,at.vertical||Fn,kt,24,Ui,X.overscaling,hc);for(let ll of vl)Fn&&p6(X,Fn.text,_s,ll)||Hs(To,ll)}else if(Ms==="line-center"){for(let To of R.geometry)if(To.length>1){let vl=YA(To,Ro,at.vertical||Fn,kt,24,Ui);vl&&Hs(To,vl)}}else if(R.type==="Polygon")for(let To of uh(R.geometry,0)){let vl=QA(To,16);Hs(To[0],new lv(vl.x,vl.y,0))}else if(R.type==="LineString")for(let To of R.geometry)Hs(To,new lv(To[0].x,To[0].y,0));else if(R.type==="Point")for(let To of R.geometry)for(let vl of To)Hs([vl],new lv(vl.x,vl.y,0))}function d6(X,R,at,kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn){let Kn=function(Na,fa,La,ho,Ro,Os,Nl,Ms){let _s=ho.layout.get("text-rotate").evaluate(Os,{})*Math.PI/180,sl=[];for(let Ks of fa.positionedLines)for(let Hs of Ks.positionedGlyphs){if(!Hs.rect)continue;let To=Hs.rect||{},vl=e3+1,ll=!0,rc=1,wh=0,mh=(Ro||Ms)&&Hs.vertical,Of=Hs.metrics.advance*Hs.scale/2;if(Ms&&fa.verticalizable&&(wh=Ks.lineOffset/2-(Hs.imageName?-(Iu-Hs.metrics.width*Hs.scale)/2:(Hs.scale-1)*Iu)),Hs.imageName){let du=Nl[Hs.imageName];ll=du.sdf,rc=du.pixelRatio,vl=vf/rc}let m0=Ro?[Hs.x+Of,Hs.y]:[0,0],Wd=Ro?[0,0]:[Hs.x+Of+La[0],Hs.y+La[1]-wh],yf=[0,0];mh&&(yf=Wd,Wd=[0,0]);let Wp=Hs.metrics.isDoubleResolution?2:1,qp=(Hs.metrics.left-vl)*Hs.scale-Of+Wd[0],Gp=(-Hs.metrics.top-vl)*Hs.scale+Wd[1],vd=qp+To.w/Wp*Hs.scale/rc,Bf=Gp+To.h/Wp*Hs.scale/rc,Lp=new c(qp,Gp),yp=new c(vd,Gp),Zp=new c(qp,Bf),rp=new c(vd,Bf);if(mh){let du=new c(-Of,Of-by),qu=-Math.PI/2,ah=Iu/2-Of,od=new c(5-by-ah,-(Hs.imageName?ah:0)),Bh=new c(...yf);Lp._rotateAround(qu,du)._add(od)._add(Bh),yp._rotateAround(qu,du)._add(od)._add(Bh),Zp._rotateAround(qu,du)._add(od)._add(Bh),rp._rotateAround(qu,du)._add(od)._add(Bh)}if(_s){let du=Math.sin(_s),qu=Math.cos(_s),ah=[qu,-du,du,qu];Lp._matMult(ah),yp._matMult(ah),Zp._matMult(ah),rp._matMult(ah)}let L0=new c(0,0),Oh=new c(0,0);sl.push({tl:Lp,tr:yp,bl:Zp,br:rp,tex:To,writingMode:fa.writingMode,glyphOffset:m0,sectionIndex:Hs.sectionIndex,isSDF:ll,pixelOffsetTL:L0,pixelOffsetBR:Oh,minFontScaleX:0,minFontScaleY:0})}return sl}(0,at,Ae,jt,Qt,re,kt,X.allowVerticalPlacement),mi=X.textSizeData,Ui=null;mi.kind==="source"?(Ui=[ng*jt.layout.get("text-size").evaluate(re,{})],Ui[0]>ov&&S(`${X.layerIds[0]}: Value for "text-size" is >= ${J_}. Reduce your "text-size".`)):mi.kind==="composite"&&(Ui=[ng*kn.compositeTextSizes[0].evaluate(re,{},Fn),ng*kn.compositeTextSizes[1].evaluate(re,{},Fn)],(Ui[0]>ov||Ui[1]>ov)&&S(`${X.layerIds[0]}: Value for "text-size" is >= ${J_}. Reduce your "text-size".`)),X.addSymbols(X.text,Kn,Ui,Ae,Qt,re,or,R,$e.lineStartIndex,$e.lineLength,ln,Fn);for(let Na of Cr)$r[Na]=X.text.placedSymbolArray.length-1;return 4*Kn.length}function f6(X){for(let R in X)return X[R];return null}function p6(X,R,at,kt){let jt=X.compareText;if(R in jt){let Qt=jt[R];for(let re=Qt.length-1;re>=0;re--)if(kt.dist(Qt[re])>4;if(jt!==1)throw new Error(`Got v${jt} data when expected v1.`);let Qt=m6[15&kt];if(!Qt)throw new Error("Unrecognized array type.");let[re]=new Uint16Array(R,2,1),[Ae]=new Uint32Array(R,4,1);return new m3(Ae,re,Qt,R)}constructor(R,at=64,kt=Float64Array,jt){if(isNaN(R)||R<0)throw new Error(`Unpexpected numItems value: ${R}.`);this.numItems=+R,this.nodeSize=Math.min(Math.max(+at,2),65535),this.ArrayType=kt,this.IndexArrayType=R<65536?Uint16Array:Uint32Array;let Qt=m6.indexOf(this.ArrayType),re=2*R*this.ArrayType.BYTES_PER_ELEMENT,Ae=R*this.IndexArrayType.BYTES_PER_ELEMENT,$e=(8-Ae%8)%8;if(Qt<0)throw new Error(`Unexpected typed array class: ${kt}.`);jt&&jt instanceof ArrayBuffer?(this.data=jt,this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ae+$e,2*R),this._pos=2*R,this._finished=!0):(this.data=new ArrayBuffer(8+re+Ae+$e),this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ae+$e,2*R),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Qt]),new Uint16Array(this.data,2,1)[0]=at,new Uint32Array(this.data,4,1)[0]=R)}add(R,at){let kt=this._pos>>1;return this.ids[kt]=kt,this.coords[this._pos++]=R,this.coords[this._pos++]=at,kt}finish(){let R=this._pos>>1;if(R!==this.numItems)throw new Error(`Added ${R} items when expected ${this.numItems}.`);return g3(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(R,at,kt,jt){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Qt,coords:re,nodeSize:Ae}=this,$e=[0,Qt.length-1,0],or=[];for(;$e.length;){let Cr=$e.pop()||0,$r=$e.pop()||0,ln=$e.pop()||0;if($r-ln<=Ae){for(let mi=ln;mi<=$r;mi++){let Ui=re[2*mi],Na=re[2*mi+1];Ui>=R&&Ui<=kt&&Na>=at&&Na<=jt&&or.push(Qt[mi])}continue}let kn=ln+$r>>1,Fn=re[2*kn],Kn=re[2*kn+1];Fn>=R&&Fn<=kt&&Kn>=at&&Kn<=jt&&or.push(Qt[kn]),(Cr===0?R<=Fn:at<=Kn)&&($e.push(ln),$e.push(kn-1),$e.push(1-Cr)),(Cr===0?kt>=Fn:jt>=Kn)&&($e.push(kn+1),$e.push($r),$e.push(1-Cr))}return or}within(R,at,kt){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:jt,coords:Qt,nodeSize:re}=this,Ae=[0,jt.length-1,0],$e=[],or=kt*kt;for(;Ae.length;){let Cr=Ae.pop()||0,$r=Ae.pop()||0,ln=Ae.pop()||0;if($r-ln<=re){for(let mi=ln;mi<=$r;mi++)vp(Qt[2*mi],Qt[2*mi+1],R,at)<=or&&$e.push(jt[mi]);continue}let kn=ln+$r>>1,Fn=Qt[2*kn],Kn=Qt[2*kn+1];vp(Fn,Kn,R,at)<=or&&$e.push(jt[kn]),(Cr===0?R-kt<=Fn:at-kt<=Kn)&&(Ae.push(ln),Ae.push(kn-1),Ae.push(1-Cr)),(Cr===0?R+kt>=Fn:at+kt>=Kn)&&(Ae.push(kn+1),Ae.push($r),Ae.push(1-Cr))}return $e}}function g3(X,R,at,kt,jt,Qt){if(jt-kt<=at)return;let re=kt+jt>>1;g6(X,R,re,kt,jt,Qt),g3(X,R,at,kt,re-1,1-Qt),g3(X,R,at,re+1,jt,1-Qt)}function g6(X,R,at,kt,jt,Qt){for(;jt>kt;){if(jt-kt>600){let or=jt-kt+1,Cr=at-kt+1,$r=Math.log(or),ln=.5*Math.exp(2*$r/3),kn=.5*Math.sqrt($r*ln*(or-ln)/or)*(Cr-or/2<0?-1:1);g6(X,R,at,Math.max(kt,Math.floor(at-Cr*ln/or+kn)),Math.min(jt,Math.floor(at+(or-Cr)*ln/or+kn)),Qt)}let re=R[2*at+Qt],Ae=kt,$e=jt;for(Ey(X,R,kt,at),R[2*jt+Qt]>re&&Ey(X,R,kt,jt);Ae<$e;){for(Ey(X,R,Ae,$e),Ae++,$e--;R[2*Ae+Qt]re;)$e--}R[2*kt+Qt]===re?Ey(X,R,kt,$e):($e++,Ey(X,R,$e,jt)),$e<=at&&(kt=$e+1),at<=$e&&(jt=$e-1)}}function Ey(X,R,at,kt){t2(X,at,kt),t2(R,2*at,2*kt),t2(R,2*at+1,2*kt+1)}function t2(X,R,at){let kt=X[R];X[R]=X[at],X[at]=kt}function vp(X,R,at,kt){let jt=X-at,Qt=R-kt;return jt*jt+Qt*Qt}var v3;n.bg=void 0,(v3=n.bg||(n.bg={})).create="create",v3.load="load",v3.fullLoad="fullLoad";let e2=null,Ly=[],y3=1e3/60,r2="loadTime",_3="fullLoadTime",v6={mark(X){performance.mark(X)},frame(X){let R=X;e2!=null&&Ly.push(R-e2),e2=R},clearMetrics(){e2=null,Ly=[],performance.clearMeasures(r2),performance.clearMeasures(_3);for(let X in n.bg)performance.clearMarks(n.bg[X])},getPerformanceMetrics(){performance.measure(r2,n.bg.create,n.bg.load),performance.measure(_3,n.bg.create,n.bg.fullLoad);let X=performance.getEntriesByName(r2)[0].duration,R=performance.getEntriesByName(_3)[0].duration,at=Ly.length,kt=1/(Ly.reduce((Qt,re)=>Qt+re,0)/at/1e3),jt=Ly.filter(Qt=>Qt>y3).reduce((Qt,re)=>Qt+(re-y3)/y3,0);return{loadTime:X,fullLoadTime:R,fps:kt,percentDroppedFrames:jt/(at+jt)*100,totalFrames:at}}};n.$=class extends Gr{},n.A=Ri,n.B=Pa,n.C=function(X){if(U==null){let R=X.navigator?X.navigator.userAgent:null;U=!!X.safari||!(!R||!(/\b(iPad|iPhone|iPod)\b/.test(R)||R.match("Safari")&&!R.match("Chrome")))}return U},n.D=ds,n.E=mt,n.F=class{constructor(X,R){this.target=X,this.mapId=R,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new rx(()=>this.process()),this.subscription=function(at,kt,jt,Qt){return at.addEventListener(kt,jt,!1),{unsubscribe:()=>{at.removeEventListener(kt,jt,!1)}}}(this.target,"message",at=>this.receive(at)),this.globalScope=B(self)?X:window}registerMessageHandler(X,R){this.messageHandlers[X]=R}sendAsync(X,R){return new Promise((at,kt)=>{let jt=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[jt]={resolve:at,reject:kt},R&&R.signal.addEventListener("abort",()=>{delete this.resolveRejects[jt];let Ae={id:jt,type:"",origin:location.origin,targetMapId:X.targetMapId,sourceMapId:this.mapId};this.target.postMessage(Ae)},{once:!0});let Qt=[],re=Object.assign(Object.assign({},X),{id:jt,sourceMapId:this.mapId,origin:location.origin,data:gs(X.data,Qt)});this.target.postMessage(re,{transfer:Qt})})}receive(X){let R=X.data,at=R.id;if(!(R.origin!=="file://"&&location.origin!=="file://"&&R.origin!=="resource://android"&&location.origin!=="resource://android"&&R.origin!==location.origin||R.targetMapId&&this.mapId!==R.targetMapId)){if(R.type===""){delete this.tasks[at];let kt=this.abortControllers[at];return delete this.abortControllers[at],void(kt&&kt.abort())}if(B(self)||R.mustQueue)return this.tasks[at]=R,this.taskQueue.push(at),void this.invoker.trigger();this.processTask(at,R)}}process(){if(this.taskQueue.length===0)return;let X=this.taskQueue.shift(),R=this.tasks[X];delete this.tasks[X],this.taskQueue.length>0&&this.invoker.trigger(),R&&this.processTask(X,R)}processTask(X,R){return i(this,void 0,void 0,function*(){if(R.type===""){let jt=this.resolveRejects[X];return delete this.resolveRejects[X],jt?void(R.error?jt.reject(ws(R.error)):jt.resolve(ws(R.data))):void 0}if(!this.messageHandlers[R.type])return void this.completeTask(X,new Error(`Could not find a registered handler for ${R.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let at=ws(R.data),kt=new AbortController;this.abortControllers[X]=kt;try{let jt=yield this.messageHandlers[R.type](R.sourceMapId,at,kt);this.completeTask(X,null,jt)}catch(jt){this.completeTask(X,jt)}})}completeTask(X,R,at){let kt=[];delete this.abortControllers[X];let jt={id:X,type:"",sourceMapId:this.mapId,origin:location.origin,error:R?gs(R):null,data:gs(at,kt)};this.target.postMessage(jt,{transfer:kt})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},n.G=vt,n.H=function(){var X=new Ri(16);return Ri!=Float32Array&&(X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[11]=0,X[12]=0,X[13]=0,X[14]=0),X[0]=1,X[5]=1,X[10]=1,X[15]=1,X},n.I=gp,n.J=function(X,R,at){var kt,jt,Qt,re,Ae,$e,or,Cr,$r,ln,kn,Fn,Kn=at[0],mi=at[1],Ui=at[2];return R===X?(X[12]=R[0]*Kn+R[4]*mi+R[8]*Ui+R[12],X[13]=R[1]*Kn+R[5]*mi+R[9]*Ui+R[13],X[14]=R[2]*Kn+R[6]*mi+R[10]*Ui+R[14],X[15]=R[3]*Kn+R[7]*mi+R[11]*Ui+R[15]):(jt=R[1],Qt=R[2],re=R[3],Ae=R[4],$e=R[5],or=R[6],Cr=R[7],$r=R[8],ln=R[9],kn=R[10],Fn=R[11],X[0]=kt=R[0],X[1]=jt,X[2]=Qt,X[3]=re,X[4]=Ae,X[5]=$e,X[6]=or,X[7]=Cr,X[8]=$r,X[9]=ln,X[10]=kn,X[11]=Fn,X[12]=kt*Kn+Ae*mi+$r*Ui+R[12],X[13]=jt*Kn+$e*mi+ln*Ui+R[13],X[14]=Qt*Kn+or*mi+kn*Ui+R[14],X[15]=re*Kn+Cr*mi+Fn*Ui+R[15]),X},n.K=function(X,R,at){var kt=at[0],jt=at[1],Qt=at[2];return X[0]=R[0]*kt,X[1]=R[1]*kt,X[2]=R[2]*kt,X[3]=R[3]*kt,X[4]=R[4]*jt,X[5]=R[5]*jt,X[6]=R[6]*jt,X[7]=R[7]*jt,X[8]=R[8]*Qt,X[9]=R[9]*Qt,X[10]=R[10]*Qt,X[11]=R[11]*Qt,X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15],X},n.L=$a,n.M=function(X,R){let at={};for(let kt=0;kt{let R=window.document.createElement("video");return R.muted=!0,new Promise(at=>{R.onloadstart=()=>{at(R)};for(let kt of X){let jt=window.document.createElement("source");it(kt)||(R.crossOrigin="Anonymous"),jt.src=kt,R.appendChild(jt)}})},n.a4=function(){return I++},n.a5=Fa,n.a6=l1,n.a7=Ud,n.a8=Vr,n.a9=t6,n.aA=function(X){if(X.type==="custom")return new Zk(X);switch(X.type){case"background":return new ex(X);case"circle":return new Oa(X);case"fill":return new Ii(X);case"fill-extrusion":return new u0(X);case"heatmap":return new Cl(X);case"hillshade":return new Eu(X);case"line":return new n1(X);case"raster":return new KA(X);case"symbol":return new Zb(X)}},n.aB=g,n.aC=function(X,R){if(!X)return[{command:"setStyle",args:[R]}];let at=[];try{if(!Bt(X.version,R.version))return[{command:"setStyle",args:[R]}];Bt(X.center,R.center)||at.push({command:"setCenter",args:[R.center]}),Bt(X.zoom,R.zoom)||at.push({command:"setZoom",args:[R.zoom]}),Bt(X.bearing,R.bearing)||at.push({command:"setBearing",args:[R.bearing]}),Bt(X.pitch,R.pitch)||at.push({command:"setPitch",args:[R.pitch]}),Bt(X.sprite,R.sprite)||at.push({command:"setSprite",args:[R.sprite]}),Bt(X.glyphs,R.glyphs)||at.push({command:"setGlyphs",args:[R.glyphs]}),Bt(X.transition,R.transition)||at.push({command:"setTransition",args:[R.transition]}),Bt(X.light,R.light)||at.push({command:"setLight",args:[R.light]}),Bt(X.terrain,R.terrain)||at.push({command:"setTerrain",args:[R.terrain]}),Bt(X.sky,R.sky)||at.push({command:"setSky",args:[R.sky]}),Bt(X.projection,R.projection)||at.push({command:"setProjection",args:[R.projection]});let kt={},jt=[];(function(re,Ae,$e,or){let Cr;for(Cr in Ae=Ae||{},re=re||{})Object.prototype.hasOwnProperty.call(re,Cr)&&(Object.prototype.hasOwnProperty.call(Ae,Cr)||ee(Cr,$e,or));for(Cr in Ae)Object.prototype.hasOwnProperty.call(Ae,Cr)&&(Object.prototype.hasOwnProperty.call(re,Cr)?Bt(re[Cr],Ae[Cr])||(re[Cr].type==="geojson"&&Ae[Cr].type==="geojson"&&ge(re,Ae,Cr)?Zt($e,{command:"setGeoJSONSourceData",args:[Cr,Ae[Cr].data]}):xe(Cr,Ae,$e,or)):Gt(Cr,Ae,$e))})(X.sources,R.sources,jt,kt);let Qt=[];X.layers&&X.layers.forEach(re=>{"source"in re&&kt[re.source]?at.push({command:"removeLayer",args:[re.id]}):Qt.push(re)}),at=at.concat(jt),function(re,Ae,$e){Ae=Ae||[];let or=(re=re||[]).map(ue),Cr=Ae.map(ue),$r=re.reduce(Mt,{}),ln=Ae.reduce(Mt,{}),kn=or.slice(),Fn=Object.create(null),Kn,mi,Ui,Na,fa;for(let La=0,ho=0;La@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(at,kt,jt,Qt)=>{let re=jt||Qt;return R[kt]=!re||re.toLowerCase(),""}),R["max-age"]){let at=parseInt(R["max-age"],10);isNaN(at)?delete R["max-age"]:R["max-age"]=at}return R},n.ab=function(X,R){let at=[];for(let kt in X)kt in R||at.push(kt);return at},n.ac=w,n.ad=function(X,R,at){var kt=Math.sin(at),jt=Math.cos(at),Qt=R[0],re=R[1],Ae=R[2],$e=R[3],or=R[4],Cr=R[5],$r=R[6],ln=R[7];return R!==X&&(X[8]=R[8],X[9]=R[9],X[10]=R[10],X[11]=R[11],X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15]),X[0]=Qt*jt+or*kt,X[1]=re*jt+Cr*kt,X[2]=Ae*jt+$r*kt,X[3]=$e*jt+ln*kt,X[4]=or*jt-Qt*kt,X[5]=Cr*jt-re*kt,X[6]=$r*jt-Ae*kt,X[7]=ln*jt-$e*kt,X},n.ae=function(X){var R=new Ri(16);return R[0]=X[0],R[1]=X[1],R[2]=X[2],R[3]=X[3],R[4]=X[4],R[5]=X[5],R[6]=X[6],R[7]=X[7],R[8]=X[8],R[9]=X[9],R[10]=X[10],R[11]=X[11],R[12]=X[12],R[13]=X[13],R[14]=X[14],R[15]=X[15],R},n.af=ua,n.ag=function(X,R){let at=0,kt=0;if(X.kind==="constant")kt=X.layoutSize;else if(X.kind!=="source"){let{interpolationType:jt,minZoom:Qt,maxZoom:re}=X,Ae=jt?w(Ka.interpolationFactor(jt,R,Qt,re),0,1):0;X.kind==="camera"?kt=Zo.number(X.minSize,X.maxSize,Ae):at=Ae}return{uSizeT:at,uSize:kt}},n.ai=function(X,{uSize:R,uSizeT:at},{lowerSize:kt,upperSize:jt}){return X.kind==="source"?kt/ng:X.kind==="composite"?Zo.number(kt/ng,jt/ng,at):R},n.aj=sv,n.ak=function(X,R,at,kt){let jt=R.y-X.y,Qt=R.x-X.x,re=kt.y-at.y,Ae=kt.x-at.x,$e=re*Qt-Ae*jt;if($e===0)return null;let or=(Ae*(X.y-at.y)-re*(X.x-at.x))/$e;return new c(X.x+or*Qt,X.y+or*jt)},n.al=i6,n.am=bi,n.an=ki,n.ao=function(X){let R=1/0,at=1/0,kt=-1/0,jt=-1/0;for(let Qt of X)R=Math.min(R,Qt.x),at=Math.min(at,Qt.y),kt=Math.max(kt,Qt.x),jt=Math.max(jt,Qt.y);return[R,at,kt,jt]},n.ap=Iu,n.ar=i3,n.as=function(X,R){var at=R[0],kt=R[1],jt=R[2],Qt=R[3],re=R[4],Ae=R[5],$e=R[6],or=R[7],Cr=R[8],$r=R[9],ln=R[10],kn=R[11],Fn=R[12],Kn=R[13],mi=R[14],Ui=R[15],Na=at*Ae-kt*re,fa=at*$e-jt*re,La=at*or-Qt*re,ho=kt*$e-jt*Ae,Ro=kt*or-Qt*Ae,Os=jt*or-Qt*$e,Nl=Cr*Kn-$r*Fn,Ms=Cr*mi-ln*Fn,_s=Cr*Ui-kn*Fn,sl=$r*mi-ln*Kn,Ks=$r*Ui-kn*Kn,Hs=ln*Ui-kn*mi,To=Na*Hs-fa*Ks+La*sl+ho*_s-Ro*Ms+Os*Nl;return To?(X[0]=(Ae*Hs-$e*Ks+or*sl)*(To=1/To),X[1]=(jt*Ks-kt*Hs-Qt*sl)*To,X[2]=(Kn*Os-mi*Ro+Ui*ho)*To,X[3]=(ln*Ro-$r*Os-kn*ho)*To,X[4]=($e*_s-re*Hs-or*Ms)*To,X[5]=(at*Hs-jt*_s+Qt*Ms)*To,X[6]=(mi*La-Fn*Os-Ui*fa)*To,X[7]=(Cr*Os-ln*La+kn*fa)*To,X[8]=(re*Ks-Ae*_s+or*Nl)*To,X[9]=(kt*_s-at*Ks-Qt*Nl)*To,X[10]=(Fn*Ro-Kn*La+Ui*Na)*To,X[11]=($r*La-Cr*Ro-kn*Na)*To,X[12]=(Ae*Ms-re*sl-$e*Nl)*To,X[13]=(at*sl-kt*Ms+jt*Nl)*To,X[14]=(Kn*fa-Fn*ho-mi*Na)*To,X[15]=(Cr*ho-$r*fa+ln*Na)*To,X):null},n.at=p3,n.au=n3,n.av=m3,n.aw=function(){let X={},R=dt.$version;for(let at in dt.$root){let kt=dt.$root[at];if(kt.required){let jt=null;jt=at==="version"?R:kt.type==="array"?[]:{},jt!=null&&(X[at]=jt)}}return X},n.ax=bo,n.ay=rt,n.az=function(X){X=X.slice();let R=Object.create(null);for(let at=0;at25||kt<0||kt>=1||at<0||at>=1)},n.bc=function(X,R){return X[0]=R[0],X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[5]=R[1],X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[10]=R[2],X[11]=0,X[12]=0,X[13]=0,X[14]=0,X[15]=1,X},n.bd=class extends wr{},n.be=c3,n.bf=v6,n.bh=ut,n.bi=function(X,R){ht.REGISTERED_PROTOCOLS[X]=R},n.bj=function(X){delete ht.REGISTERED_PROTOCOLS[X]},n.bk=function(X,R){let at={};for(let jt=0;jtHs*Iu)}let Ms=re?"center":at.get("text-justify").evaluate(or,{},X.canonical),_s=at.get("symbol-placement")==="point"?at.get("text-max-width").evaluate(or,{},X.canonical)*Iu:1/0,sl=()=>{X.bucket.allowVerticalPlacement&&ks(La)&&(Fn.vertical=Hb(Kn,X.glyphMap,X.glyphPositions,X.imagePositions,Cr,_s,Qt,Os,"left",Ro,Ui,n.ah.vertical,!0,ln,$r))};if(!re&&Nl){let Ks=new Set;if(Ms==="auto")for(let To=0;Toi(void 0,void 0,void 0,function*(){if(X.byteLength===0)return createImageBitmap(new ImageData(1,1));let R=new Blob([new Uint8Array(X)],{type:"image/png"});try{return createImageBitmap(R)}catch(at){throw new Error(`Could not load image because of ${at.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),n.e=E,n.f=X=>new Promise((R,at)=>{let kt=new Image;kt.onload=()=>{R(kt),URL.revokeObjectURL(kt.src),kt.onload=null,window.requestAnimationFrame(()=>{kt.src=W})},kt.onerror=()=>at(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."));let jt=new Blob([new Uint8Array(X)],{type:"image/png"});kt.src=X.byteLength?URL.createObjectURL(jt):W}),n.g=bt,n.h=(X,R)=>gt(E(X,{type:"json"}),R),n.i=B,n.j=J,n.k=ot,n.l=(X,R)=>gt(E(X,{type:"arrayBuffer"}),R),n.m=gt,n.n=function(X){return new Qw(X).readFields($A,[])},n.o=Xl,n.p=$b,n.q=Kt,n.r=ga,n.s=it,n.t=Sa,n.u=Pi,n.v=dt,n.w=S,n.x=function([X,R,at]){return R+=90,R*=Math.PI/180,at*=Math.PI/180,{x:X*Math.cos(R)*Math.sin(at),y:X*Math.sin(R)*Math.sin(at),z:X*Math.cos(at)}},n.y=Zo,n.z=Zl}),z("worker",["./shared"],function(n){class i{constructor(Xt){this.keyCache={},Xt&&this.replace(Xt)}replace(Xt){this._layerConfigs={},this._layers={},this.update(Xt,[])}update(Xt,oe){for(let _t of Xt){this._layerConfigs[_t.id]=_t;let Pt=this._layers[_t.id]=n.aA(_t);Pt._featureFilter=n.a7(Pt.filter),this.keyCache[_t.id]&&delete this.keyCache[_t.id]}for(let _t of oe)delete this.keyCache[_t],delete this._layerConfigs[_t],delete this._layers[_t];this.familiesBySource={};let zt=n.bk(Object.values(this._layerConfigs),this.keyCache);for(let _t of zt){let Pt=_t.map(Ye=>this._layers[Ye.id]),Ht=Pt[0];if(Ht.visibility==="none")continue;let ae=Ht.source||"",he=this.familiesBySource[ae];he||(he=this.familiesBySource[ae]={});let Me=Ht.sourceLayer||"_geojsonTileLayer",qe=he[Me];qe||(qe=he[Me]=[]),qe.push(Pt)}}}class a{constructor(Xt){let oe={},zt=[];for(let ae in Xt){let he=Xt[ae],Me=oe[ae]={};for(let qe in he){let Ye=he[+qe];if(!Ye||Ye.bitmap.width===0||Ye.bitmap.height===0)continue;let ur={x:0,y:0,w:Ye.bitmap.width+2,h:Ye.bitmap.height+2};zt.push(ur),Me[qe]={rect:ur,metrics:Ye.metrics}}}let{w:_t,h:Pt}=n.p(zt),Ht=new n.o({width:_t||1,height:Pt||1});for(let ae in Xt){let he=Xt[ae];for(let Me in he){let qe=he[+Me];if(!qe||qe.bitmap.width===0||qe.bitmap.height===0)continue;let Ye=oe[ae][Me].rect;n.o.copy(qe.bitmap,Ht,{x:0,y:0},{x:Ye.x+1,y:Ye.y+1},qe.bitmap)}}this.image=Ht,this.positions=oe}}n.bl("GlyphAtlas",a);class l{constructor(Xt){this.tileID=new n.S(Xt.tileID.overscaledZ,Xt.tileID.wrap,Xt.tileID.canonical.z,Xt.tileID.canonical.x,Xt.tileID.canonical.y),this.uid=Xt.uid,this.zoom=Xt.zoom,this.pixelRatio=Xt.pixelRatio,this.tileSize=Xt.tileSize,this.source=Xt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Xt.showCollisionBoxes,this.collectResourceTiming=!!Xt.collectResourceTiming,this.returnDependencies=!!Xt.returnDependencies,this.promoteId=Xt.promoteId,this.inFlightDependencies=[]}parse(Xt,oe,zt,_t){return n._(this,void 0,void 0,function*(){this.status="parsing",this.data=Xt,this.collisionBoxArray=new n.a5;let Pt=new n.bm(Object.keys(Xt.layers).sort()),Ht=new n.bn(this.tileID,this.promoteId);Ht.bucketLayerIDs=[];let ae={},he={featureIndex:Ht,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:zt},Me=oe.familiesBySource[this.source];for(let Ci in Me){let fi=Xt.layers[Ci];if(!fi)continue;fi.version===1&&n.w(`Vector tile source "${this.source}" layer "${Ci}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let ba=Pt.encode(Ci),oa=[];for(let Ke=0;Ke=sr.maxzoom||sr.visibility!=="none"&&(o(Ke,this.zoom,zt),(ae[sr.id]=sr.createBucket({index:Ht.bucketLayerIDs.length,layers:Ke,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ba,sourceID:this.source})).populate(oa,he,this.tileID.canonical),Ht.bucketLayerIDs.push(Ke.map(vr=>vr.id)))}}let qe=n.aF(he.glyphDependencies,Ci=>Object.keys(Ci).map(Number));this.inFlightDependencies.forEach(Ci=>Ci?.abort()),this.inFlightDependencies=[];let Ye=Promise.resolve({});if(Object.keys(qe).length){let Ci=new AbortController;this.inFlightDependencies.push(Ci),Ye=_t.sendAsync({type:"GG",data:{stacks:qe,source:this.source,tileID:this.tileID,type:"glyphs"}},Ci)}let ur=Object.keys(he.iconDependencies),Rr=Promise.resolve({});if(ur.length){let Ci=new AbortController;this.inFlightDependencies.push(Ci),Rr=_t.sendAsync({type:"GI",data:{icons:ur,source:this.source,tileID:this.tileID,type:"icons"}},Ci)}let zr=Object.keys(he.patternDependencies),xr=Promise.resolve({});if(zr.length){let Ci=new AbortController;this.inFlightDependencies.push(Ci),xr=_t.sendAsync({type:"GI",data:{icons:zr,source:this.source,tileID:this.tileID,type:"patterns"}},Ci)}let[pn,ci,ui]=yield Promise.all([Ye,Rr,xr]),yi=new a(pn),Gi=new n.bo(ci,ui);for(let Ci in ae){let fi=ae[Ci];fi instanceof n.a6?(o(fi.layers,this.zoom,zt),n.bp({bucket:fi,glyphMap:pn,glyphPositions:yi.positions,imageMap:ci,imagePositions:Gi.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):fi.hasPattern&&(fi instanceof n.bq||fi instanceof n.br||fi instanceof n.bs)&&(o(fi.layers,this.zoom,zt),fi.addFeatures(he,this.tileID.canonical,Gi.patternPositions))}return this.status="done",{buckets:Object.values(ae).filter(Ci=>!Ci.isEmpty()),featureIndex:Ht,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:yi.image,imageAtlas:Gi,glyphMap:this.returnDependencies?pn:null,iconMap:this.returnDependencies?ci:null,glyphPositions:this.returnDependencies?yi.positions:null}})}}function o(Oe,Xt,oe){let zt=new n.z(Xt);for(let _t of Oe)_t.recalculate(zt,oe)}class c{constructor(Xt,oe,zt){this.actor=Xt,this.layerIndex=oe,this.availableImages=zt,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Xt,oe){return n._(this,void 0,void 0,function*(){let zt=yield n.l(Xt.request,oe);try{return{vectorTile:new n.bt.VectorTile(new n.bu(zt.data)),rawData:zt.data,cacheControl:zt.cacheControl,expires:zt.expires}}catch(_t){let Pt=new Uint8Array(zt.data),Ht=`Unable to parse the tile at ${Xt.request.url}, `;throw Ht+=Pt[0]===31&&Pt[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${_t.message}`,new Error(Ht)}})}loadTile(Xt){return n._(this,void 0,void 0,function*(){let oe=Xt.uid,zt=!!(Xt&&Xt.request&&Xt.request.collectResourceTiming)&&new n.bv(Xt.request),_t=new l(Xt);this.loading[oe]=_t;let Pt=new AbortController;_t.abort=Pt;try{let Ht=yield this.loadVectorTile(Xt,Pt);if(delete this.loading[oe],!Ht)return null;let ae=Ht.rawData,he={};Ht.expires&&(he.expires=Ht.expires),Ht.cacheControl&&(he.cacheControl=Ht.cacheControl);let Me={};if(zt){let Ye=zt.finish();Ye&&(Me.resourceTiming=JSON.parse(JSON.stringify(Ye)))}_t.vectorTile=Ht.vectorTile;let qe=_t.parse(Ht.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[oe]=_t,this.fetching[oe]={rawTileData:ae,cacheControl:he,resourceTiming:Me};try{let Ye=yield qe;return n.e({rawTileData:ae.slice(0)},Ye,he,Me)}finally{delete this.fetching[oe]}}catch(Ht){throw delete this.loading[oe],_t.status="done",this.loaded[oe]=_t,Ht}})}reloadTile(Xt){return n._(this,void 0,void 0,function*(){let oe=Xt.uid;if(!this.loaded||!this.loaded[oe])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let zt=this.loaded[oe];if(zt.showCollisionBoxes=Xt.showCollisionBoxes,zt.status==="parsing"){let _t=yield zt.parse(zt.vectorTile,this.layerIndex,this.availableImages,this.actor),Pt;if(this.fetching[oe]){let{rawTileData:Ht,cacheControl:ae,resourceTiming:he}=this.fetching[oe];delete this.fetching[oe],Pt=n.e({rawTileData:Ht.slice(0)},_t,ae,he)}else Pt=_t;return Pt}if(zt.status==="done"&&zt.vectorTile)return zt.parse(zt.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Xt){return n._(this,void 0,void 0,function*(){let oe=this.loading,zt=Xt.uid;oe&&oe[zt]&&oe[zt].abort&&(oe[zt].abort.abort(),delete oe[zt])})}removeTile(Xt){return n._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Xt.uid]&&delete this.loaded[Xt.uid]})}}class s{constructor(){this.loaded={}}loadTile(Xt){return n._(this,void 0,void 0,function*(){let{uid:oe,encoding:zt,rawImageData:_t,redFactor:Pt,greenFactor:Ht,blueFactor:ae,baseShift:he}=Xt,Me=_t.width+2,qe=_t.height+2,Ye=n.b(_t)?new n.R({width:Me,height:qe},yield n.bw(_t,-1,-1,Me,qe)):_t,ur=new n.bx(oe,Ye,zt,Pt,Ht,ae,he);return this.loaded=this.loaded||{},this.loaded[oe]=ur,ur})}removeTile(Xt){let oe=this.loaded,zt=Xt.uid;oe&&oe[zt]&&delete oe[zt]}}function h(Oe,Xt){if(Oe.length!==0){m(Oe[0],Xt);for(var oe=1;oe=Math.abs(ae)?oe-he+ae:ae-he+oe,oe=he}oe+zt>=0!=!!Xt&&Oe.reverse()}var b=n.by(function Oe(Xt,oe){var zt,_t=Xt&&Xt.type;if(_t==="FeatureCollection")for(zt=0;zt>31}function B(Oe,Xt){for(var oe=Oe.loadGeometry(),zt=Oe.type,_t=0,Pt=0,Ht=oe.length,ae=0;aeOe},F=Math.fround||(H=new Float32Array(1),Oe=>(H[0]=+Oe,H[0]));var H;let q=3,G=5,tt=6;class ht{constructor(Xt){this.options=Object.assign(Object.create(W),Xt),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Xt){let{log:oe,minZoom:zt,maxZoom:_t}=this.options;oe&&console.time("total time");let Pt=`prepare ${Xt.length} points`;oe&&console.time(Pt),this.points=Xt;let Ht=[];for(let he=0;he=zt;he--){let Me=+Date.now();ae=this.trees[he]=this._createTree(this._cluster(ae,he)),oe&&console.log("z%d: %d clusters in %dms",he,ae.numItems,+Date.now()-Me)}return oe&&console.timeEnd("total time"),this}getClusters(Xt,oe){let zt=((Xt[0]+180)%360+360)%360-180,_t=Math.max(-90,Math.min(90,Xt[1])),Pt=Xt[2]===180?180:((Xt[2]+180)%360+360)%360-180,Ht=Math.max(-90,Math.min(90,Xt[3]));if(Xt[2]-Xt[0]>=360)zt=-180,Pt=180;else if(zt>Pt){let Ye=this.getClusters([zt,_t,180,Ht],oe),ur=this.getClusters([-180,_t,Pt,Ht],oe);return Ye.concat(ur)}let ae=this.trees[this._limitZoom(oe)],he=ae.range(ut(zt),rt(Ht),ut(Pt),rt(_t)),Me=ae.data,qe=[];for(let Ye of he){let ur=this.stride*Ye;qe.push(Me[ur+G]>1?bt(Me,ur,this.clusterProps):this.points[Me[ur+q]])}return qe}getChildren(Xt){let oe=this._getOriginId(Xt),zt=this._getOriginZoom(Xt),_t="No cluster with the specified id.",Pt=this.trees[zt];if(!Pt)throw new Error(_t);let Ht=Pt.data;if(oe*this.stride>=Ht.length)throw new Error(_t);let ae=this.options.radius/(this.options.extent*Math.pow(2,zt-1)),he=Pt.within(Ht[oe*this.stride],Ht[oe*this.stride+1],ae),Me=[];for(let qe of he){let Ye=qe*this.stride;Ht[Ye+4]===Xt&&Me.push(Ht[Ye+G]>1?bt(Ht,Ye,this.clusterProps):this.points[Ht[Ye+q]])}if(Me.length===0)throw new Error(_t);return Me}getLeaves(Xt,oe,zt){let _t=[];return this._appendLeaves(_t,Xt,oe=oe||10,zt=zt||0,0),_t}getTile(Xt,oe,zt){let _t=this.trees[this._limitZoom(Xt)],Pt=Math.pow(2,Xt),{extent:Ht,radius:ae}=this.options,he=ae/Ht,Me=(zt-he)/Pt,qe=(zt+1+he)/Pt,Ye={features:[]};return this._addTileFeatures(_t.range((oe-he)/Pt,Me,(oe+1+he)/Pt,qe),_t.data,oe,zt,Pt,Ye),oe===0&&this._addTileFeatures(_t.range(1-he/Pt,Me,1,qe),_t.data,Pt,zt,Pt,Ye),oe===Pt-1&&this._addTileFeatures(_t.range(0,Me,he/Pt,qe),_t.data,-1,zt,Pt,Ye),Ye.features.length?Ye:null}getClusterExpansionZoom(Xt){let oe=this._getOriginZoom(Xt)-1;for(;oe<=this.options.maxZoom;){let zt=this.getChildren(Xt);if(oe++,zt.length!==1)break;Xt=zt[0].properties.cluster_id}return oe}_appendLeaves(Xt,oe,zt,_t,Pt){let Ht=this.getChildren(oe);for(let ae of Ht){let he=ae.properties;if(he&&he.cluster?Pt+he.point_count<=_t?Pt+=he.point_count:Pt=this._appendLeaves(Xt,he.cluster_id,zt,_t,Pt):Pt<_t?Pt++:Xt.push(ae),Xt.length===zt)break}return Pt}_createTree(Xt){let oe=new n.av(Xt.length/this.stride|0,this.options.nodeSize,Float32Array);for(let zt=0;zt1,qe,Ye,ur;if(Me)qe=vt(oe,he,this.clusterProps),Ye=oe[he],ur=oe[he+1];else{let xr=this.points[oe[he+q]];qe=xr.properties;let[pn,ci]=xr.geometry.coordinates;Ye=ut(pn),ur=rt(ci)}let Rr={type:1,geometry:[[Math.round(this.options.extent*(Ye*Pt-zt)),Math.round(this.options.extent*(ur*Pt-_t))]],tags:qe},zr;zr=Me||this.options.generateId?oe[he+q]:this.points[oe[he+q]].id,zr!==void 0&&(Rr.id=zr),Ht.features.push(Rr)}}_limitZoom(Xt){return Math.max(this.options.minZoom,Math.min(Math.floor(+Xt),this.options.maxZoom+1))}_cluster(Xt,oe){let{radius:zt,extent:_t,reduce:Pt,minPoints:Ht}=this.options,ae=zt/(_t*Math.pow(2,oe)),he=Xt.data,Me=[],qe=this.stride;for(let Ye=0;Yeoe&&(pn+=he[ui+G])}if(pn>xr&&pn>=Ht){let ci,ui=ur*xr,yi=Rr*xr,Gi=-1,Ci=((Ye/qe|0)<<5)+(oe+1)+this.points.length;for(let fi of zr){let ba=fi*qe;if(he[ba+2]<=oe)continue;he[ba+2]=oe;let oa=he[ba+G];ui+=he[ba]*oa,yi+=he[ba+1]*oa,he[ba+4]=Ci,Pt&&(ci||(ci=this._map(he,Ye,!0),Gi=this.clusterProps.length,this.clusterProps.push(ci)),Pt(ci,this._map(he,ba)))}he[Ye+4]=Ci,Me.push(ui/pn,yi/pn,1/0,Ci,-1,pn),Pt&&Me.push(Gi)}else{for(let ci=0;ci1)for(let ci of zr){let ui=ci*qe;if(!(he[ui+2]<=oe)){he[ui+2]=oe;for(let yi=0;yi>5}_getOriginZoom(Xt){return(Xt-this.points.length)%32}_map(Xt,oe,zt){if(Xt[oe+G]>1){let Ht=this.clusterProps[Xt[oe+tt]];return zt?Object.assign({},Ht):Ht}let _t=this.points[Xt[oe+q]].properties,Pt=this.options.map(_t);return zt&&Pt===_t?Object.assign({},Pt):Pt}}function bt(Oe,Xt,oe){return{type:"Feature",id:Oe[Xt+q],properties:vt(Oe,Xt,oe),geometry:{type:"Point",coordinates:[(zt=Oe[Xt],360*(zt-.5)),gt(Oe[Xt+1])]}};var zt}function vt(Oe,Xt,oe){let zt=Oe[Xt+G],_t=zt>=1e4?`${Math.round(zt/1e3)}k`:zt>=1e3?Math.round(zt/100)/10+"k":zt,Pt=Oe[Xt+tt],Ht=Pt===-1?{}:Object.assign({},oe[Pt]);return Object.assign(Ht,{cluster:!0,cluster_id:Oe[Xt+q],point_count:zt,point_count_abbreviated:_t})}function ut(Oe){return Oe/360+.5}function rt(Oe){let Xt=Math.sin(Oe*Math.PI/180),oe=.5-.25*Math.log((1+Xt)/(1-Xt))/Math.PI;return oe<0?0:oe>1?1:oe}function gt(Oe){let Xt=(180-360*Oe)*Math.PI/180;return 360*Math.atan(Math.exp(Xt))/Math.PI-90}function it(Oe,Xt,oe,zt){let _t=zt,Pt=Xt+(oe-Xt>>1),Ht,ae=oe-Xt,he=Oe[Xt],Me=Oe[Xt+1],qe=Oe[oe],Ye=Oe[oe+1];for(let ur=Xt+3;ur_t)Ht=ur,_t=Rr;else if(Rr===_t){let zr=Math.abs(ur-Pt);zrzt&&(Ht-Xt>3&&it(Oe,Xt,Ht,zt),Oe[Ht+2]=_t,oe-Ht>3&&it(Oe,Ht,oe,zt))}function st(Oe,Xt,oe,zt,_t,Pt){let Ht=_t-oe,ae=Pt-zt;if(Ht!==0||ae!==0){let he=((Oe-oe)*Ht+(Xt-zt)*ae)/(Ht*Ht+ae*ae);he>1?(oe=_t,zt=Pt):he>0&&(oe+=Ht*he,zt+=ae*he)}return Ht=Oe-oe,ae=Xt-zt,Ht*Ht+ae*ae}function xt(Oe,Xt,oe,zt){let _t={id:Oe??null,type:Xt,geometry:oe,tags:zt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Xt==="Point"||Xt==="MultiPoint"||Xt==="LineString")ot(_t,oe);else if(Xt==="Polygon")ot(_t,oe[0]);else if(Xt==="MultiLineString")for(let Pt of oe)ot(_t,Pt);else if(Xt==="MultiPolygon")for(let Pt of oe)ot(_t,Pt[0]);return _t}function ot(Oe,Xt){for(let oe=0;oe0&&(Ht+=zt?(_t*qe-Me*Pt)/2:Math.sqrt(Math.pow(Me-_t,2)+Math.pow(qe-Pt,2))),_t=Me,Pt=qe}let ae=Xt.length-3;Xt[2]=1,it(Xt,0,ae,oe),Xt[ae+2]=1,Xt.size=Math.abs(Ht),Xt.start=0,Xt.end=Xt.size}function Ct(Oe,Xt,oe,zt){for(let _t=0;_t1?1:oe}function Zt(Oe,Xt,oe,zt,_t,Pt,Ht,ae){if(zt/=Xt,Pt>=(oe/=Xt)&&Ht=zt)return null;let he=[];for(let Me of Oe){let qe=Me.geometry,Ye=Me.type,ur=_t===0?Me.minX:Me.minY,Rr=_t===0?Me.maxX:Me.maxY;if(ur>=oe&&Rr=zt)continue;let zr=[];if(Ye==="Point"||Ye==="MultiPoint")Gt(qe,zr,oe,zt,_t);else if(Ye==="LineString")ee(qe,zr,oe,zt,_t,!1,ae.lineMetrics);else if(Ye==="MultiLineString")ge(qe,zr,oe,zt,_t,!1);else if(Ye==="Polygon")ge(qe,zr,oe,zt,_t,!0);else if(Ye==="MultiPolygon")for(let xr of qe){let pn=[];ge(xr,pn,oe,zt,_t,!0),pn.length&&zr.push(pn)}if(zr.length){if(ae.lineMetrics&&Ye==="LineString"){for(let xr of zr)he.push(xt(Me.id,Ye,xr,Me.tags));continue}Ye!=="LineString"&&Ye!=="MultiLineString"||(zr.length===1?(Ye="LineString",zr=zr[0]):Ye="MultiLineString"),Ye!=="Point"&&Ye!=="MultiPoint"||(Ye=zr.length===3?"Point":"MultiPoint"),he.push(xt(Me.id,Ye,zr,Me.tags))}}return he.length?he:null}function Gt(Oe,Xt,oe,zt,_t){for(let Pt=0;Pt=oe&&Ht<=zt&&ye(Xt,Oe[Pt],Oe[Pt+1],Oe[Pt+2])}}function ee(Oe,Xt,oe,zt,_t,Pt,Ht){let ae=xe(Oe),he=_t===0?ue:Mt,Me,qe,Ye=Oe.start;for(let pn=0;pnoe&&(qe=he(ae,ci,ui,Gi,Ci,oe),Ht&&(ae.start=Ye+Me*qe)):fi>zt?ba=oe&&(qe=he(ae,ci,ui,Gi,Ci,oe),oa=!0),ba>zt&&fi<=zt&&(qe=he(ae,ci,ui,Gi,Ci,zt),oa=!0),!Pt&&oa&&(Ht&&(ae.end=Ye+Me*qe),Xt.push(ae),ae=xe(Oe)),Ht&&(Ye+=Me)}let ur=Oe.length-3,Rr=Oe[ur],zr=Oe[ur+1],xr=_t===0?Rr:zr;xr>=oe&&xr<=zt&&ye(ae,Rr,zr,Oe[ur+2]),ur=ae.length-3,Pt&&ur>=3&&(ae[ur]!==ae[0]||ae[ur+1]!==ae[1])&&ye(ae,ae[0],ae[1],ae[2]),ae.length&&Xt.push(ae)}function xe(Oe){let Xt=[];return Xt.size=Oe.size,Xt.start=Oe.start,Xt.end=Oe.end,Xt}function ge(Oe,Xt,oe,zt,_t,Pt){for(let Ht of Oe)ee(Ht,Xt,oe,zt,_t,Pt,!1)}function ye(Oe,Xt,oe,zt){Oe.push(Xt,oe,zt)}function ue(Oe,Xt,oe,zt,_t,Pt){let Ht=(Pt-Xt)/(zt-Xt);return ye(Oe,Pt,oe+(_t-oe)*Ht,1),Ht}function Mt(Oe,Xt,oe,zt,_t,Pt){let Ht=(Pt-oe)/(_t-oe);return ye(Oe,Xt+(zt-Xt)*Ht,Pt,1),Ht}function Ot(Oe,Xt){let oe=[];for(let zt=0;zt0&&Xt.size<(_t?Ht:zt))return void(oe.numPoints+=Xt.length/3);let ae=[];for(let he=0;heHt)&&(oe.numSimplified++,ae.push(Xt[he],Xt[he+1])),oe.numPoints++;_t&&function(he,Me){let qe=0;for(let Ye=0,ur=he.length,Rr=ur-2;Ye0===Me)for(let Ye=0,ur=he.length;Ye24)throw new Error("maxZoom should be in the 0-24 range");if(oe.promoteId&&oe.generateId)throw new Error("promoteId and generateId cannot be used together.");let _t=function(Pt,Ht){let ae=[];if(Pt.type==="FeatureCollection")for(let he=0;he1&&console.time("creation"),Rr=this.tiles[ur]=ce(Xt,oe,zt,_t,Me),this.tileCoords.push({z:oe,x:zt,y:_t}),qe)){qe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",oe,zt,_t,Rr.numFeatures,Rr.numPoints,Rr.numSimplified),console.timeEnd("creation"));let oa=`z${oe}`;this.stats[oa]=(this.stats[oa]||0)+1,this.total++}if(Rr.source=Xt,Pt==null){if(oe===Me.indexMaxZoom||Rr.numPoints<=Me.indexMaxPoints)continue}else{if(oe===Me.maxZoom||oe===Pt)continue;if(Pt!=null){let oa=Pt-oe;if(zt!==Ht>>oa||_t!==ae>>oa)continue}}if(Rr.source=null,Xt.length===0)continue;qe>1&&console.time("clipping");let zr=.5*Me.buffer/Me.extent,xr=.5-zr,pn=.5+zr,ci=1+zr,ui=null,yi=null,Gi=null,Ci=null,fi=Zt(Xt,Ye,zt-zr,zt+pn,0,Rr.minX,Rr.maxX,Me),ba=Zt(Xt,Ye,zt+xr,zt+ci,0,Rr.minX,Rr.maxX,Me);Xt=null,fi&&(ui=Zt(fi,Ye,_t-zr,_t+pn,1,Rr.minY,Rr.maxY,Me),yi=Zt(fi,Ye,_t+xr,_t+ci,1,Rr.minY,Rr.maxY,Me),fi=null),ba&&(Gi=Zt(ba,Ye,_t-zr,_t+pn,1,Rr.minY,Rr.maxY,Me),Ci=Zt(ba,Ye,_t+xr,_t+ci,1,Rr.minY,Rr.maxY,Me),ba=null),qe>1&&console.timeEnd("clipping"),he.push(ui||[],oe+1,2*zt,2*_t),he.push(yi||[],oe+1,2*zt,2*_t+1),he.push(Gi||[],oe+1,2*zt+1,2*_t),he.push(Ci||[],oe+1,2*zt+1,2*_t+1)}}getTile(Xt,oe,zt){Xt=+Xt,oe=+oe,zt=+zt;let _t=this.options,{extent:Pt,debug:Ht}=_t;if(Xt<0||Xt>24)return null;let ae=1<1&&console.log("drilling down to z%d-%d-%d",Xt,oe,zt);let Me,qe=Xt,Ye=oe,ur=zt;for(;!Me&&qe>0;)qe--,Ye>>=1,ur>>=1,Me=this.tiles[fr(qe,Ye,ur)];return Me&&Me.source?(Ht>1&&(console.log("found parent tile z%d-%d-%d",qe,Ye,ur),console.time("drilling down")),this.splitTile(Me.source,qe,Ye,ur,Xt,oe,zt),Ht>1&&console.timeEnd("drilling down"),this.tiles[he]?ie(this.tiles[he],Pt):null):null}}function fr(Oe,Xt,oe){return 32*((1<{Ye.properties=Rr;let zr={};for(let xr of ur)zr[xr]=he[xr].evaluate(qe,Ye);return zr},Ht.reduce=(Rr,zr)=>{Ye.properties=zr;for(let xr of ur)qe.accumulated=Rr[xr],Rr[xr]=Me[xr].evaluate(qe,Ye)},Ht}(Xt)).load((yield this._pendingData).features):(_t=yield this._pendingData,new mr(_t,Xt.geojsonVtOptions)),this.loaded={};let Pt={};if(zt){let Ht=zt.finish();Ht&&(Pt.resourceTiming={},Pt.resourceTiming[Xt.source]=JSON.parse(JSON.stringify(Ht)))}return Pt}catch(Pt){if(delete this._pendingRequest,n.bB(Pt))return{abandoned:!0};throw Pt}var _t})}getData(){return n._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Xt){let oe=this.loaded;return oe&&oe[Xt.uid]?super.reloadTile(Xt):this.loadTile(Xt)}loadAndProcessGeoJSON(Xt,oe){return n._(this,void 0,void 0,function*(){let zt=yield this.loadGeoJSON(Xt,oe);if(delete this._pendingRequest,typeof zt!="object")throw new Error(`Input data given to '${Xt.source}' is not a valid GeoJSON object.`);if(b(zt,!0),Xt.filter){let _t=n.bC(Xt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(_t.result==="error")throw new Error(_t.value.map(Pt=>`${Pt.key}: ${Pt.message}`).join(", "));zt={type:"FeatureCollection",features:zt.features.filter(Pt=>_t.value.evaluate({zoom:0},Pt))}}return zt})}loadGeoJSON(Xt,oe){return n._(this,void 0,void 0,function*(){let{promoteId:zt}=Xt;if(Xt.request){let _t=yield n.h(Xt.request,oe);return this._dataUpdateable=an(_t.data,zt)?Er(_t.data,zt):void 0,_t.data}if(typeof Xt.data=="string")try{let _t=JSON.parse(Xt.data);return this._dataUpdateable=an(_t,zt)?Er(_t,zt):void 0,_t}catch{throw new Error(`Input data given to '${Xt.source}' is not a valid GeoJSON object.`)}if(!Xt.dataDiff)throw new Error(`Input data given to '${Xt.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Xt.source}`);return function(_t,Pt,Ht){var ae,he,Me,qe;if(Pt.removeAll&&_t.clear(),Pt.remove)for(let Ye of Pt.remove)_t.delete(Ye);if(Pt.add)for(let Ye of Pt.add){let ur=Jr(Ye,Ht);ur!=null&&_t.set(ur,Ye)}if(Pt.update)for(let Ye of Pt.update){let ur=_t.get(Ye.id);if(ur==null)continue;let Rr=!Ye.removeAllProperties&&(((ae=Ye.removeProperties)===null||ae===void 0?void 0:ae.length)>0||((he=Ye.addOrUpdateProperties)===null||he===void 0?void 0:he.length)>0);if((Ye.newGeometry||Ye.removeAllProperties||Rr)&&(ur=Object.assign({},ur),_t.set(Ye.id,ur),Rr&&(ur.properties=Object.assign({},ur.properties))),Ye.newGeometry&&(ur.geometry=Ye.newGeometry),Ye.removeAllProperties)ur.properties={};else if(((Me=Ye.removeProperties)===null||Me===void 0?void 0:Me.length)>0)for(let zr of Ye.removeProperties)Object.prototype.hasOwnProperty.call(ur.properties,zr)&&delete ur.properties[zr];if(((qe=Ye.addOrUpdateProperties)===null||qe===void 0?void 0:qe.length)>0)for(let{key:zr,value:xr}of Ye.addOrUpdateProperties)ur.properties[zr]=xr}}(this._dataUpdateable,Xt.dataDiff,zt),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Xt){return n._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Xt){return this._geoJSONIndex.getClusterExpansionZoom(Xt.clusterId)}getClusterChildren(Xt){return this._geoJSONIndex.getChildren(Xt.clusterId)}getClusterLeaves(Xt){return this._geoJSONIndex.getLeaves(Xt.clusterId,Xt.limit,Xt.offset)}}class _n{constructor(Xt){this.self=Xt,this.actor=new n.F(Xt),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(oe,zt)=>{if(this.externalWorkerSourceTypes[oe])throw new Error(`Worker source with name "${oe}" already registered.`);this.externalWorkerSourceTypes[oe]=zt},this.self.addProtocol=n.bi,this.self.removeProtocol=n.bj,this.self.registerRTLTextPlugin=oe=>{if(n.bD.isParsed())throw new Error("RTL text plugin already registered.");n.bD.setMethods(oe)},this.actor.registerMessageHandler("LDT",(oe,zt)=>this._getDEMWorkerSource(oe,zt.source).loadTile(zt)),this.actor.registerMessageHandler("RDT",(oe,zt)=>n._(this,void 0,void 0,function*(){this._getDEMWorkerSource(oe,zt.source).removeTile(zt)})),this.actor.registerMessageHandler("GCEZ",(oe,zt)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(oe,zt.type,zt.source).getClusterExpansionZoom(zt)})),this.actor.registerMessageHandler("GCC",(oe,zt)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(oe,zt.type,zt.source).getClusterChildren(zt)})),this.actor.registerMessageHandler("GCL",(oe,zt)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(oe,zt.type,zt.source).getClusterLeaves(zt)})),this.actor.registerMessageHandler("LD",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).loadData(zt)),this.actor.registerMessageHandler("GD",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).getData()),this.actor.registerMessageHandler("LT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).loadTile(zt)),this.actor.registerMessageHandler("RT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).reloadTile(zt)),this.actor.registerMessageHandler("AT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).abortTile(zt)),this.actor.registerMessageHandler("RMT",(oe,zt)=>this._getWorkerSource(oe,zt.type,zt.source).removeTile(zt)),this.actor.registerMessageHandler("RS",(oe,zt)=>n._(this,void 0,void 0,function*(){if(!this.workerSources[oe]||!this.workerSources[oe][zt.type]||!this.workerSources[oe][zt.type][zt.source])return;let _t=this.workerSources[oe][zt.type][zt.source];delete this.workerSources[oe][zt.type][zt.source],_t.removeSource!==void 0&&_t.removeSource(zt)})),this.actor.registerMessageHandler("RM",oe=>n._(this,void 0,void 0,function*(){delete this.layerIndexes[oe],delete this.availableImages[oe],delete this.workerSources[oe],delete this.demWorkerSources[oe]})),this.actor.registerMessageHandler("SR",(oe,zt)=>n._(this,void 0,void 0,function*(){this.referrer=zt})),this.actor.registerMessageHandler("SRPS",(oe,zt)=>this._syncRTLPluginState(oe,zt)),this.actor.registerMessageHandler("IS",(oe,zt)=>n._(this,void 0,void 0,function*(){this.self.importScripts(zt)})),this.actor.registerMessageHandler("SI",(oe,zt)=>this._setImages(oe,zt)),this.actor.registerMessageHandler("UL",(oe,zt)=>n._(this,void 0,void 0,function*(){this._getLayerIndex(oe).update(zt.layers,zt.removedIds)})),this.actor.registerMessageHandler("SL",(oe,zt)=>n._(this,void 0,void 0,function*(){this._getLayerIndex(oe).replace(zt)}))}_setImages(Xt,oe){return n._(this,void 0,void 0,function*(){this.availableImages[Xt]=oe;for(let zt in this.workerSources[Xt]){let _t=this.workerSources[Xt][zt];for(let Pt in _t)_t[Pt].availableImages=oe}})}_syncRTLPluginState(Xt,oe){return n._(this,void 0,void 0,function*(){if(n.bD.isParsed())return n.bD.getState();if(oe.pluginStatus!=="loading")return n.bD.setState(oe),oe;let zt=oe.pluginURL;if(this.self.importScripts(zt),n.bD.isParsed()){let _t={pluginStatus:"loaded",pluginURL:zt};return n.bD.setState(_t),_t}throw n.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${zt}`)})}_getAvailableImages(Xt){let oe=this.availableImages[Xt];return oe||(oe=[]),oe}_getLayerIndex(Xt){let oe=this.layerIndexes[Xt];return oe||(oe=this.layerIndexes[Xt]=new i),oe}_getWorkerSource(Xt,oe,zt){if(this.workerSources[Xt]||(this.workerSources[Xt]={}),this.workerSources[Xt][oe]||(this.workerSources[Xt][oe]={}),!this.workerSources[Xt][oe][zt]){let _t={sendAsync:(Pt,Ht)=>(Pt.targetMapId=Xt,this.actor.sendAsync(Pt,Ht))};switch(oe){case"vector":this.workerSources[Xt][oe][zt]=new c(_t,this._getLayerIndex(Xt),this._getAvailableImages(Xt));break;case"geojson":this.workerSources[Xt][oe][zt]=new dn(_t,this._getLayerIndex(Xt),this._getAvailableImages(Xt));break;default:this.workerSources[Xt][oe][zt]=new this.externalWorkerSourceTypes[oe](_t,this._getLayerIndex(Xt),this._getAvailableImages(Xt))}}return this.workerSources[Xt][oe][zt]}_getDEMWorkerSource(Xt,oe){return this.demWorkerSources[Xt]||(this.demWorkerSources[Xt]={}),this.demWorkerSources[Xt][oe]||(this.demWorkerSources[Xt][oe]=new s),this.demWorkerSources[Xt][oe]}}return n.i(self)&&(self.worker=new _n(self)),_n}),z("index",["exports","./shared"],function(n,i){var a="4.7.1";let l,o,c={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Kt=>new Promise((O,pt)=>{let Dt=requestAnimationFrame(O);Kt.signal.addEventListener("abort",()=>{cancelAnimationFrame(Dt),pt(i.c())})}),getImageData(Kt,O=0){return this.getImageCanvasContext(Kt).getImageData(-O,-O,Kt.width+2*O,Kt.height+2*O)},getImageCanvasContext(Kt){let O=window.document.createElement("canvas"),pt=O.getContext("2d",{willReadFrequently:!0});if(!pt)throw new Error("failed to create canvas 2d context");return O.width=Kt.width,O.height=Kt.height,pt.drawImage(Kt,0,0,Kt.width,Kt.height),pt},resolveURL:Kt=>(l||(l=document.createElement("a")),l.href=Kt,l.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(o==null&&(o=matchMedia("(prefers-reduced-motion: reduce)")),o.matches)}};class s{static testProp(O){if(!s.docStyle)return O[0];for(let pt=0;pt{window.removeEventListener("click",s.suppressClickInternal,!0)},0)}static getScale(O){let pt=O.getBoundingClientRect();return{x:pt.width/O.offsetWidth||1,y:pt.height/O.offsetHeight||1,boundingClientRect:pt}}static getPoint(O,pt,Dt){let Ft=pt.boundingClientRect;return new i.P((Dt.clientX-Ft.left)/pt.x-O.clientLeft,(Dt.clientY-Ft.top)/pt.y-O.clientTop)}static mousePos(O,pt){let Dt=s.getScale(O);return s.getPoint(O,Dt,pt)}static touchPos(O,pt){let Dt=[],Ft=s.getScale(O);for(let qt=0;qt{m&&A(m),m=null,_=!0},b.onerror=()=>{x=!0,m=null},b.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Kt){let O,pt,Dt,Ft;Kt.resetRequestQueue=()=>{O=[],pt=0,Dt=0,Ft={}},Kt.addThrottleControl=er=>{let wr=Dt++;return Ft[wr]=er,wr},Kt.removeThrottleControl=er=>{delete Ft[er],Ee()},Kt.getImage=(er,wr,Gr=!0)=>new Promise((Zr,Tn)=>{h.supported&&(er.headers||(er.headers={}),er.headers.accept="image/webp,*/*"),i.e(er,{type:"image"}),O.push({abortController:wr,requestParameters:er,supportImageRefresh:Gr,state:"queued",onError:qn=>{Tn(qn)},onSuccess:qn=>{Zr(qn)}}),Ee()});let qt=er=>i._(this,void 0,void 0,function*(){er.state="running";let{requestParameters:wr,supportImageRefresh:Gr,onError:Zr,onSuccess:Tn,abortController:qn}=er,te=Gr===!1&&!i.i(self)&&!i.g(wr.url)&&(!wr.headers||Object.keys(wr.headers).reduce((Pe,We)=>Pe&&We==="accept",!0));pt++;let le=te?je(wr,qn):i.m(wr,qn);try{let Pe=yield le;delete er.abortController,er.state="completed",Pe.data instanceof HTMLImageElement||i.b(Pe.data)?Tn(Pe):Pe.data&&Tn({data:yield(Te=Pe.data,typeof createImageBitmap=="function"?i.d(Te):i.f(Te)),cacheControl:Pe.cacheControl,expires:Pe.expires})}catch(Pe){delete er.abortController,Zr(Pe)}finally{pt--,Ee()}var Te}),Ee=()=>{let er=(()=>{for(let wr of Object.keys(Ft))if(Ft[wr]())return!0;return!1})()?i.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:i.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let wr=pt;wr0;wr++){let Gr=O.shift();Gr.abortController.signal.aborted?wr--:qt(Gr)}},je=(er,wr)=>new Promise((Gr,Zr)=>{let Tn=new Image,qn=er.url,te=er.credentials;te&&te==="include"?Tn.crossOrigin="use-credentials":(te&&te==="same-origin"||!i.s(qn))&&(Tn.crossOrigin="anonymous"),wr.signal.addEventListener("abort",()=>{Tn.src="",Zr(i.c())}),Tn.fetchPriority="high",Tn.onload=()=>{Tn.onerror=Tn.onload=null,Gr({data:Tn})},Tn.onerror=()=>{Tn.onerror=Tn.onload=null,wr.signal.aborted||Zr(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."))},Tn.src=qn})}(d||(d={})),d.resetRequestQueue();class k{constructor(O){this._transformRequestFn=O}transformRequest(O,pt){return this._transformRequestFn&&this._transformRequestFn(O,pt)||{url:O}}setTransformRequest(O){this._transformRequestFn=O}}function w(Kt){var O=new i.A(3);return O[0]=Kt[0],O[1]=Kt[1],O[2]=Kt[2],O}var D,E=function(Kt,O,pt){return Kt[0]=O[0]-pt[0],Kt[1]=O[1]-pt[1],Kt[2]=O[2]-pt[2],Kt};D=new i.A(3),i.A!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0);var I=function(Kt){var O=Kt[0],pt=Kt[1];return O*O+pt*pt};function M(Kt){let O=[];if(typeof Kt=="string")O.push({id:"default",url:Kt});else if(Kt&&Kt.length>0){let pt=[];for(let{id:Dt,url:Ft}of Kt){let qt=`${Dt}${Ft}`;pt.indexOf(qt)===-1&&(pt.push(qt),O.push({id:Dt,url:Ft}))}}return O}function p(Kt,O,pt){let Dt=Kt.split("?");return Dt[0]+=`${O}${pt}`,Dt.join("?")}(function(){var Kt=new i.A(2);i.A!=Float32Array&&(Kt[0]=0,Kt[1]=0)})();class g{constructor(O,pt,Dt,Ft){this.context=O,this.format=Dt,this.texture=O.gl.createTexture(),this.update(pt,Ft)}update(O,pt,Dt){let{width:Ft,height:qt}=O,Ee=!(this.size&&this.size[0]===Ft&&this.size[1]===qt||Dt),{context:je}=this,{gl:er}=je;if(this.useMipmap=!!(pt&&pt.useMipmap),er.bindTexture(er.TEXTURE_2D,this.texture),je.pixelStoreUnpackFlipY.set(!1),je.pixelStoreUnpack.set(1),je.pixelStoreUnpackPremultiplyAlpha.set(this.format===er.RGBA&&(!pt||pt.premultiply!==!1)),Ee)this.size=[Ft,qt],O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||i.b(O)?er.texImage2D(er.TEXTURE_2D,0,this.format,this.format,er.UNSIGNED_BYTE,O):er.texImage2D(er.TEXTURE_2D,0,this.format,Ft,qt,0,this.format,er.UNSIGNED_BYTE,O.data);else{let{x:wr,y:Gr}=Dt||{x:0,y:0};O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||i.b(O)?er.texSubImage2D(er.TEXTURE_2D,0,wr,Gr,er.RGBA,er.UNSIGNED_BYTE,O):er.texSubImage2D(er.TEXTURE_2D,0,wr,Gr,Ft,qt,er.RGBA,er.UNSIGNED_BYTE,O.data)}this.useMipmap&&this.isSizePowerOfTwo()&&er.generateMipmap(er.TEXTURE_2D)}bind(O,pt,Dt){let{context:Ft}=this,{gl:qt}=Ft;qt.bindTexture(qt.TEXTURE_2D,this.texture),Dt!==qt.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Dt=qt.LINEAR),O!==this.filter&&(qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MAG_FILTER,O),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,Dt||O),this.filter=O),pt!==this.wrap&&(qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,pt),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,pt),this.wrap=pt)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:O}=this.context;O.deleteTexture(this.texture),this.texture=null}}function C(Kt){let{userImage:O}=Kt;return!!(O&&O.render&&O.render())&&(Kt.data.replace(new Uint8Array(O.data.buffer)),!0)}class S extends i.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(O){if(this.loaded!==O&&(this.loaded=O,O)){for(let{ids:pt,promiseResolve:Dt}of this.requestors)Dt(this._getImagesForIds(pt));this.requestors=[]}}getImage(O){let pt=this.images[O];if(pt&&!pt.data&&pt.spriteData){let Dt=pt.spriteData;pt.data=new i.R({width:Dt.width,height:Dt.height},Dt.context.getImageData(Dt.x,Dt.y,Dt.width,Dt.height).data),pt.spriteData=null}return pt}addImage(O,pt){if(this.images[O])throw new Error(`Image id ${O} already exist, use updateImage instead`);this._validate(O,pt)&&(this.images[O]=pt)}_validate(O,pt){let Dt=!0,Ft=pt.data||pt.spriteData;return this._validateStretch(pt.stretchX,Ft&&Ft.width)||(this.fire(new i.j(new Error(`Image "${O}" has invalid "stretchX" value`))),Dt=!1),this._validateStretch(pt.stretchY,Ft&&Ft.height)||(this.fire(new i.j(new Error(`Image "${O}" has invalid "stretchY" value`))),Dt=!1),this._validateContent(pt.content,pt)||(this.fire(new i.j(new Error(`Image "${O}" has invalid "content" value`))),Dt=!1),Dt}_validateStretch(O,pt){if(!O)return!0;let Dt=0;for(let Ft of O){if(Ft[0]{let Ft=!0;if(!this.isLoaded())for(let qt of O)this.images[qt]||(Ft=!1);this.isLoaded()||Ft?pt(this._getImagesForIds(O)):this.requestors.push({ids:O,promiseResolve:pt})})}_getImagesForIds(O){let pt={};for(let Dt of O){let Ft=this.getImage(Dt);Ft||(this.fire(new i.k("styleimagemissing",{id:Dt})),Ft=this.getImage(Dt)),Ft?pt[Dt]={data:Ft.data.clone(),pixelRatio:Ft.pixelRatio,sdf:Ft.sdf,version:Ft.version,stretchX:Ft.stretchX,stretchY:Ft.stretchY,content:Ft.content,textFitWidth:Ft.textFitWidth,textFitHeight:Ft.textFitHeight,hasRenderCallback:!!(Ft.userImage&&Ft.userImage.render)}:i.w(`Image "${Dt}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return pt}getPixelSize(){let{width:O,height:pt}=this.atlasImage;return{width:O,height:pt}}getPattern(O){let pt=this.patterns[O],Dt=this.getImage(O);if(!Dt)return null;if(pt&&pt.position.version===Dt.version)return pt.position;if(pt)pt.position.version=Dt.version;else{let Ft={w:Dt.data.width+2,h:Dt.data.height+2,x:0,y:0},qt=new i.I(Ft,Dt);this.patterns[O]={bin:Ft,position:qt}}return this._updatePatternAtlas(),this.patterns[O].position}bind(O){let pt=O.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new g(O,this.atlasImage,pt.RGBA),this.atlasTexture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE)}_updatePatternAtlas(){let O=[];for(let qt in this.patterns)O.push(this.patterns[qt].bin);let{w:pt,h:Dt}=i.p(O),Ft=this.atlasImage;Ft.resize({width:pt||1,height:Dt||1});for(let qt in this.patterns){let{bin:Ee}=this.patterns[qt],je=Ee.x+1,er=Ee.y+1,wr=this.getImage(qt).data,Gr=wr.width,Zr=wr.height;i.R.copy(wr,Ft,{x:0,y:0},{x:je,y:er},{width:Gr,height:Zr}),i.R.copy(wr,Ft,{x:0,y:Zr-1},{x:je,y:er-1},{width:Gr,height:1}),i.R.copy(wr,Ft,{x:0,y:0},{x:je,y:er+Zr},{width:Gr,height:1}),i.R.copy(wr,Ft,{x:Gr-1,y:0},{x:je-1,y:er},{width:1,height:Zr}),i.R.copy(wr,Ft,{x:0,y:0},{x:je+Gr,y:er},{width:1,height:Zr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(O){for(let pt of O){if(this.callbackDispatchedThisFrame[pt])continue;this.callbackDispatchedThisFrame[pt]=!0;let Dt=this.getImage(pt);Dt||i.w(`Image with ID: "${pt}" was not found`),C(Dt)&&this.updateImage(pt,Dt)}}}let N=1e20;function B(Kt,O,pt,Dt,Ft,qt,Ee,je,er){for(let wr=O;wr-1);er++,qt[er]=je,Ee[er]=wr,Ee[er+1]=N}for(let je=0,er=0;je65535)throw new Error("glyphs > 65535 not supported");if(Dt.ranges[qt])return{stack:O,id:pt,glyph:Ft};if(!this.url)throw new Error("glyphsUrl is not set");if(!Dt.requests[qt]){let je=V.loadGlyphRange(O,qt,this.url,this.requestManager);Dt.requests[qt]=je}let Ee=yield Dt.requests[qt];for(let je in Ee)this._doesCharSupportLocalGlyph(+je)||(Dt.glyphs[+je]=Ee[+je]);return Dt.ranges[qt]=!0,{stack:O,id:pt,glyph:Ee[pt]||null}})}_doesCharSupportLocalGlyph(O){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(O))}_tinySDF(O,pt,Dt){let Ft=this.localIdeographFontFamily;if(!Ft||!this._doesCharSupportLocalGlyph(Dt))return;let qt=O.tinySDF;if(!qt){let je="400";/bold/i.test(pt)?je="900":/medium/i.test(pt)?je="500":/light/i.test(pt)&&(je="200"),qt=O.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Ft,fontWeight:je})}let Ee=qt.draw(String.fromCharCode(Dt));return{id:Dt,bitmap:new i.o({width:Ee.width||60,height:Ee.height||60},Ee.data),metrics:{width:Ee.glyphWidth/2||24,height:Ee.glyphHeight/2||24,left:Ee.glyphLeft/2+.5||0,top:Ee.glyphTop/2-27.5||-8,advance:Ee.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(Kt,O,pt,Dt){return i._(this,void 0,void 0,function*(){let Ft=256*O,qt=Ft+255,Ee=Dt.transformRequest(pt.replace("{fontstack}",Kt).replace("{range}",`${Ft}-${qt}`),"Glyphs"),je=yield i.l(Ee,new AbortController);if(!je||!je.data)throw new Error(`Could not load glyph range. range: ${O}, ${Ft}-${qt}`);let er={};for(let wr of i.n(je.data))er[wr.id]=wr;return er})},V.TinySDF=class{constructor({fontSize:Kt=24,buffer:O=3,radius:pt=8,cutoff:Dt=.25,fontFamily:Ft="sans-serif",fontWeight:qt="normal",fontStyle:Ee="normal"}={}){this.buffer=O,this.cutoff=Dt,this.radius=pt;let je=this.size=Kt+4*O,er=this._createCanvas(je),wr=this.ctx=er.getContext("2d",{willReadFrequently:!0});wr.font=`${Ee} ${qt} ${Kt}px ${Ft}`,wr.textBaseline="alphabetic",wr.textAlign="left",wr.fillStyle="black",this.gridOuter=new Float64Array(je*je),this.gridInner=new Float64Array(je*je),this.f=new Float64Array(je),this.z=new Float64Array(je+1),this.v=new Uint16Array(je)}_createCanvas(Kt){let O=document.createElement("canvas");return O.width=O.height=Kt,O}draw(Kt){let{width:O,actualBoundingBoxAscent:pt,actualBoundingBoxDescent:Dt,actualBoundingBoxLeft:Ft,actualBoundingBoxRight:qt}=this.ctx.measureText(Kt),Ee=Math.ceil(pt),je=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(qt-Ft))),er=Math.min(this.size-this.buffer,Ee+Math.ceil(Dt)),wr=je+2*this.buffer,Gr=er+2*this.buffer,Zr=Math.max(wr*Gr,0),Tn=new Uint8ClampedArray(Zr),qn={data:Tn,width:wr,height:Gr,glyphWidth:je,glyphHeight:er,glyphTop:Ee,glyphLeft:0,glyphAdvance:O};if(je===0||er===0)return qn;let{ctx:te,buffer:le,gridInner:Te,gridOuter:Pe}=this;te.clearRect(le,le,je,er),te.fillText(Kt,le,le+Ee);let We=te.getImageData(le,le,je,er);Pe.fill(N,0,Zr),Te.fill(0,0,Zr);for(let Ne=0;Ne0?Xr*Xr:0,Te[qr]=Xr<0?Xr*Xr:0}}B(Pe,0,0,wr,Gr,wr,this.f,this.v,this.z),B(Te,le,le,je,er,wr,this.f,this.v,this.z);for(let Ne=0;Ne1&&(er=O[++je]);let Gr=Math.abs(wr-er.left),Zr=Math.abs(wr-er.right),Tn=Math.min(Gr,Zr),qn,te=qt/Dt*(Ft+1);if(er.isDash){let le=Ft-Math.abs(te);qn=Math.sqrt(Tn*Tn+le*le)}else qn=Ft-Math.sqrt(Tn*Tn+te*te);this.data[Ee+wr]=Math.max(0,Math.min(255,qn+128))}}}addRegularDash(O){for(let je=O.length-1;je>=0;--je){let er=O[je],wr=O[je+1];er.zeroLength?O.splice(je,1):wr&&wr.isDash===er.isDash&&(wr.left=er.left,O.splice(je,1))}let pt=O[0],Dt=O[O.length-1];pt.isDash===Dt.isDash&&(pt.left=Dt.left-this.width,Dt.right=pt.right+this.width);let Ft=this.width*this.nextRow,qt=0,Ee=O[qt];for(let je=0;je1&&(Ee=O[++qt]);let er=Math.abs(je-Ee.left),wr=Math.abs(je-Ee.right),Gr=Math.min(er,wr);this.data[Ft+je]=Math.max(0,Math.min(255,(Ee.isDash?Gr:-Gr)+128))}}addDash(O,pt){let Dt=pt?7:0,Ft=2*Dt+1;if(this.nextRow+Ft>this.height)return i.w("LineAtlas out of space"),null;let qt=0;for(let je=0;je{pt.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ht]}numActive(){return Object.keys(this.active).length}}let vt=Math.floor(c.hardwareConcurrency/2),ut,rt;function gt(){return ut||(ut=new bt),ut}bt.workerCount=i.C(globalThis)?Math.max(Math.min(vt,3),1):1;class it{constructor(O,pt){this.workerPool=O,this.actors=[],this.currentActor=0,this.id=pt;let Dt=this.workerPool.acquire(pt);for(let Ft=0;Ft{pt.remove()}),this.actors=[],O&&this.workerPool.release(this.id)}registerMessageHandler(O,pt){for(let Dt of this.actors)Dt.registerMessageHandler(O,pt)}}function st(){return rt||(rt=new it(gt(),i.G),rt.registerMessageHandler("GR",(Kt,O,pt)=>i.m(O,pt))),rt}function xt(Kt,O){let pt=i.H();return i.J(pt,pt,[1,1,0]),i.K(pt,pt,[.5*Kt.width,.5*Kt.height,1]),i.L(pt,pt,Kt.calculatePosMatrix(O.toUnwrapped()))}function ot(Kt,O,pt,Dt,Ft,qt){let Ee=function(Zr,Tn,qn){if(Zr)for(let te of Zr){let le=Tn[te];if(le&&le.source===qn&&le.type==="fill-extrusion")return!0}else for(let te in Tn){let le=Tn[te];if(le.source===qn&&le.type==="fill-extrusion")return!0}return!1}(Ft&&Ft.layers,O,Kt.id),je=qt.maxPitchScaleFactor(),er=Kt.tilesIn(Dt,je,Ee);er.sort(J);let wr=[];for(let Zr of er)wr.push({wrappedTileID:Zr.tileID.wrapped().key,queryResults:Zr.tile.queryRenderedFeatures(O,pt,Kt._state,Zr.queryGeometry,Zr.cameraQueryGeometry,Zr.scale,Ft,qt,je,xt(Kt.transform,Zr.tileID))});let Gr=function(Zr){let Tn={},qn={};for(let te of Zr){let le=te.queryResults,Te=te.wrappedTileID,Pe=qn[Te]=qn[Te]||{};for(let We in le){let Ne=le[We],Xe=Pe[We]=Pe[We]||{},Pr=Tn[We]=Tn[We]||[];for(let qr of Ne)Xe[qr.featureIndex]||(Xe[qr.featureIndex]=!0,Pr.push(qr))}}return Tn}(wr);for(let Zr in Gr)Gr[Zr].forEach(Tn=>{let qn=Tn.feature,te=Kt.getFeatureState(qn.layer["source-layer"],qn.id);qn.source=qn.layer.source,qn.layer["source-layer"]&&(qn.sourceLayer=qn.layer["source-layer"]),qn.state=te});return Gr}function J(Kt,O){let pt=Kt.tileID,Dt=O.tileID;return pt.overscaledZ-Dt.overscaledZ||pt.canonical.y-Dt.canonical.y||pt.wrap-Dt.wrap||pt.canonical.x-Dt.canonical.x}function mt(Kt,O,pt){return i._(this,void 0,void 0,function*(){let Dt=Kt;if(Kt.url?Dt=(yield i.h(O.transformRequest(Kt.url,"Source"),pt)).data:yield c.frameAsync(pt),!Dt)return null;let Ft=i.M(i.e(Dt,Kt),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Dt&&Dt.vector_layers&&(Ft.vectorLayerIds=Dt.vector_layers.map(qt=>qt.id)),Ft})}class dt{constructor(O,pt){O&&(pt?this.setSouthWest(O).setNorthEast(pt):Array.isArray(O)&&(O.length===4?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 i.N?new i.N(O.lng,O.lat):i.N.convert(O),this}setSouthWest(O){return this._sw=O instanceof i.N?new i.N(O.lng,O.lat):i.N.convert(O),this}extend(O){let pt=this._sw,Dt=this._ne,Ft,qt;if(O instanceof i.N)Ft=O,qt=O;else{if(!(O instanceof dt))return Array.isArray(O)?O.length===4||O.every(Array.isArray)?this.extend(dt.convert(O)):this.extend(i.N.convert(O)):O&&("lng"in O||"lon"in O)&&"lat"in O?this.extend(i.N.convert(O)):this;if(Ft=O._sw,qt=O._ne,!Ft||!qt)return this}return pt||Dt?(pt.lng=Math.min(Ft.lng,pt.lng),pt.lat=Math.min(Ft.lat,pt.lat),Dt.lng=Math.max(qt.lng,Dt.lng),Dt.lat=Math.max(qt.lat,Dt.lat)):(this._sw=new i.N(Ft.lng,Ft.lat),this._ne=new i.N(qt.lng,qt.lat)),this}getCenter(){return new i.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new i.N(this.getWest(),this.getNorth())}getSouthEast(){return new i.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(O){let{lng:pt,lat:Dt}=i.N.convert(O),Ft=this._sw.lng<=pt&&pt<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ft=this._sw.lng>=pt&&pt>=this._ne.lng),this._sw.lat<=Dt&&Dt<=this._ne.lat&&Ft}static convert(O){return O instanceof dt?O:O&&new dt(O)}static fromLngLat(O,pt=0){let Dt=360*pt/40075017,Ft=Dt/Math.cos(Math.PI/180*O.lat);return new dt(new i.N(O.lng-Ft,O.lat-Dt),new i.N(O.lng+Ft,O.lat+Dt))}adjustAntiMeridian(){let O=new i.N(this._sw.lng,this._sw.lat),pt=new i.N(this._ne.lng,this._ne.lat);return new dt(O,O.lng>pt.lng?new i.N(pt.lng+360,pt.lat):pt)}}class Ct{constructor(O,pt,Dt){this.bounds=dt.convert(this.validateBounds(O)),this.minzoom=pt||0,this.maxzoom=Dt||24}validateBounds(O){return Array.isArray(O)&&O.length===4?[Math.max(-180,O[0]),Math.max(-90,O[1]),Math.min(180,O[2]),Math.min(90,O[3])]:[-180,-90,180,90]}contains(O){let pt=Math.pow(2,O.z),Dt=Math.floor(i.O(this.bounds.getWest())*pt),Ft=Math.floor(i.Q(this.bounds.getNorth())*pt),qt=Math.ceil(i.O(this.bounds.getEast())*pt),Ee=Math.ceil(i.Q(this.bounds.getSouth())*pt);return O.x>=Dt&&O.x=Ft&&O.y{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return i.e({},this._options)}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Dt={request:this.map._requestManager.transformRequest(pt,"Tile"),uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,tileSize:this.tileSize*O.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Dt.request.collectResourceTiming=this._collectResourceTiming;let Ft="RT";if(O.actor&&O.state!=="expired"){if(O.state==="loading")return new Promise((qt,Ee)=>{O.reloadPromise={resolve:qt,reject:Ee}})}else O.actor=this.dispatcher.getActor(),Ft="LT";O.abortController=new AbortController;try{let qt=yield O.actor.sendAsync({type:Ft,data:Dt},O.abortController);if(delete O.abortController,O.aborted)return;this._afterTileLoadWorkerResponse(O,qt)}catch(qt){if(delete O.abortController,O.aborted)return;if(qt&&qt.status!==404)throw qt;this._afterTileLoadWorkerResponse(O,null)}})}_afterTileLoadWorkerResponse(O,pt){if(pt&&pt.resourceTiming&&(O.resourceTiming=pt.resourceTiming),pt&&this.map._refreshExpiredTiles&&O.setExpiryData(pt),O.loadVectorData(pt,this.map.painter),O.reloadPromise){let Dt=O.reloadPromise;O.reloadPromise=null,this.loadTile(O).then(Dt.resolve).catch(Dt.reject)}}abortTile(O){return i._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.actor&&(yield O.actor.sendAsync({type:"AT",data:{uid:O.uid,type:this.type,source:this.id}}))})}unloadTile(O){return i._(this,void 0,void 0,function*(){O.unloadVectorData(),O.actor&&(yield O.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Bt extends i.E{constructor(O,pt,Dt,Ft){super(),this.id=O,this.dispatcher=Dt,this.setEventedParent(Ft),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=i.e({type:"raster"},pt),i.e(this,i.M(pt,["url","scheme","tileSize"]))}load(){return i._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new i.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let O=yield mt(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,O&&(i.e(this,O),O.bounds&&(this.tileBounds=new Ct(O.bounds,this.minzoom,this.maxzoom)),this.fire(new i.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new i.k("data",{dataType:"source",sourceDataType:"content"})))}catch(O){this._tileJSONRequest=null,this.fire(new i.j(O))}})}loaded(){return this._loaded}onAdd(O){this.map=O,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(O){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),O(),this.load()}setTiles(O){return this.setSourceProperty(()=>{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}serialize(){return i.e({},this._options)}hasTile(O){return!this.tileBounds||this.tileBounds.contains(O.canonical)}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);O.abortController=new AbortController;try{let Dt=yield d.getImage(this.map._requestManager.transformRequest(pt,"Tile"),O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Dt&&Dt.data){this.map._refreshExpiredTiles&&Dt.cacheControl&&Dt.expires&&O.setExpiryData({cacheControl:Dt.cacheControl,expires:Dt.expires});let Ft=this.map.painter.context,qt=Ft.gl,Ee=Dt.data;O.texture=this.map.painter.getTileTexture(Ee.width),O.texture?O.texture.update(Ee,{useMipmap:!0}):(O.texture=new g(Ft,Ee,qt.RGBA,{useMipmap:!0}),O.texture.bind(qt.LINEAR,qt.CLAMP_TO_EDGE,qt.LINEAR_MIPMAP_NEAREST)),O.state="loaded"}}catch(Dt){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Dt)throw O.state="errored",Dt}})}abortTile(O){return i._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController)})}unloadTile(O){return i._(this,void 0,void 0,function*(){O.texture&&this.map.painter.saveTileTexture(O.texture)})}hasTransition(){return!1}}class Zt extends Bt{constructor(O,pt,Dt,Ft){super(O,pt,Dt,Ft),this.type="raster-dem",this.maxzoom=22,this._options=i.e({type:"raster-dem"},pt),this.encoding=pt.encoding||"mapbox",this.redFactor=pt.redFactor,this.greenFactor=pt.greenFactor,this.blueFactor=pt.blueFactor,this.baseShift=pt.baseShift}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Dt=this.map._requestManager.transformRequest(pt,"Tile");O.neighboringTiles=this._getNeighboringTiles(O.tileID),O.abortController=new AbortController;try{let Ft=yield d.getImage(Dt,O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Ft&&Ft.data){let qt=Ft.data;this.map._refreshExpiredTiles&&Ft.cacheControl&&Ft.expires&&O.setExpiryData({cacheControl:Ft.cacheControl,expires:Ft.expires});let Ee=i.b(qt)&&i.U()?qt:yield this.readImageNow(qt),je={type:this.type,uid:O.uid,source:this.id,rawImageData:Ee,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!O.actor||O.state==="expired"){O.actor=this.dispatcher.getActor();let er=yield O.actor.sendAsync({type:"LDT",data:je});O.dem=er,O.needsHillshadePrepare=!0,O.needsTerrainPrepare=!0,O.state="loaded"}}}catch(Ft){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Ft)throw O.state="errored",Ft}})}readImageNow(O){return i._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&i.V()){let pt=O.width+2,Dt=O.height+2;try{return new i.R({width:pt,height:Dt},yield i.W(O,-1,-1,pt,Dt))}catch{}}return c.getImageData(O,1)})}_getNeighboringTiles(O){let pt=O.canonical,Dt=Math.pow(2,pt.z),Ft=(pt.x-1+Dt)%Dt,qt=pt.x===0?O.wrap-1:O.wrap,Ee=(pt.x+1+Dt)%Dt,je=pt.x+1===Dt?O.wrap+1:O.wrap,er={};return er[new i.S(O.overscaledZ,qt,pt.z,Ft,pt.y).key]={backfilled:!1},er[new i.S(O.overscaledZ,je,pt.z,Ee,pt.y).key]={backfilled:!1},pt.y>0&&(er[new i.S(O.overscaledZ,qt,pt.z,Ft,pt.y-1).key]={backfilled:!1},er[new i.S(O.overscaledZ,O.wrap,pt.z,pt.x,pt.y-1).key]={backfilled:!1},er[new i.S(O.overscaledZ,je,pt.z,Ee,pt.y-1).key]={backfilled:!1}),pt.y+10&&i.e(qt,{resourceTiming:Ft}),this.fire(new i.k("data",Object.assign(Object.assign({},qt),{sourceDataType:"metadata"}))),this.fire(new i.k("data",Object.assign(Object.assign({},qt),{sourceDataType:"content"})))}catch(Dt){if(this._pendingLoads--,this._removed)return void this.fire(new i.k("dataabort",{dataType:"source"}));this.fire(new i.j(Dt))}})}loaded(){return this._pendingLoads===0}loadTile(O){return i._(this,void 0,void 0,function*(){let pt=O.actor?"RT":"LT";O.actor=this.actor;let Dt={type:this.type,uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};O.abortController=new AbortController;let Ft=yield this.actor.sendAsync({type:pt,data:Dt},O.abortController);delete O.abortController,O.unloadVectorData(),O.aborted||O.loadVectorData(Ft,this.map.painter,pt==="RT")})}abortTile(O){return i._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.aborted=!0})}unloadTile(O){return i._(this,void 0,void 0,function*(){O.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return i.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var ee=i.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class xe extends i.E{constructor(O,pt,Dt,Ft){super(),this.id=O,this.dispatcher=Dt,this.coordinates=pt.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ft),this.options=pt}load(O){return i._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new i.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let pt=yield d.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,pt&&pt.data&&(this.image=pt.data,O&&(this.coordinates=O),this._finishLoading())}catch(pt){this._request=null,this._loaded=!0,this.fire(new i.j(pt))}})}loaded(){return this._loaded}updateImage(O){return O.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=O.url,this.load(O.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(O){this.map=O,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(O){this.coordinates=O;let pt=O.map(i.Z.fromLngLat);this.tileID=function(Ft){let qt=1/0,Ee=1/0,je=-1/0,er=-1/0;for(let Tn of Ft)qt=Math.min(qt,Tn.x),Ee=Math.min(Ee,Tn.y),je=Math.max(je,Tn.x),er=Math.max(er,Tn.y);let wr=Math.max(je-qt,er-Ee),Gr=Math.max(0,Math.floor(-Math.log(wr)/Math.LN2)),Zr=Math.pow(2,Gr);return new i.a1(Gr,Math.floor((qt+je)/2*Zr),Math.floor((Ee+er)/2*Zr))}(pt),this.minzoom=this.maxzoom=this.tileID.z;let Dt=pt.map(Ft=>this.tileID.getTilePoint(Ft)._round());return this._boundsArray=new i.$,this._boundsArray.emplaceBack(Dt[0].x,Dt[0].y,0,0),this._boundsArray.emplaceBack(Dt[1].x,Dt[1].y,i.X,0),this._boundsArray.emplaceBack(Dt[3].x,Dt[3].y,0,i.X),this._boundsArray.emplaceBack(Dt[2].x,Dt[2].y,i.X,i.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new i.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let O=this.map.painter.context,pt=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,ee.members)),this.boundsSegments||(this.boundsSegments=i.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new g(O,this.image,pt.RGBA),this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE));let Dt=!1;for(let Ft in this.tiles){let qt=this.tiles[Ft];qt.state!=="loaded"&&(qt.state="loaded",qt.texture=this.texture,Dt=!0)}Dt&&this.fire(new i.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(O){return i._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(O.tileID.canonical)?(this.tiles[String(O.tileID.wrap)]=O,O.buckets={}):O.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ge extends xe{constructor(O,pt,Dt,Ft){super(O,pt,Dt,Ft),this.roundZoom=!0,this.type="video",this.options=pt}load(){return i._(this,void 0,void 0,function*(){this._loaded=!1;let O=this.options;this.urls=[];for(let pt of O.urls)this.urls.push(this.map._requestManager.transformRequest(pt,"Source").url);try{let pt=yield i.a3(this.urls);if(this._loaded=!0,!pt)return;this.video=pt,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(pt){this.fire(new i.j(pt))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(O){if(this.video){let pt=this.video.seekable;Opt.end(0)?this.fire(new i.j(new i.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${pt.start(0)} and ${pt.end(0)}-second mark.`))):this.video.currentTime=O}}getVideo(){return this.video}onAdd(O){this.map||(this.map=O,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let O=this.map.painter.context,pt=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,ee.members)),this.boundsSegments||(this.boundsSegments=i.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE),pt.texSubImage2D(pt.TEXTURE_2D,0,0,0,pt.RGBA,pt.UNSIGNED_BYTE,this.video)):(this.texture=new g(O,this.video,pt.RGBA),this.texture.bind(pt.LINEAR,pt.CLAMP_TO_EDGE));let Dt=!1;for(let Ft in this.tiles){let qt=this.tiles[Ft];qt.state!=="loaded"&&(qt.state="loaded",qt.texture=this.texture,Dt=!0)}Dt&&this.fire(new i.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class ye extends xe{constructor(O,pt,Dt,Ft){super(O,pt,Dt,Ft),pt.coordinates?Array.isArray(pt.coordinates)&&pt.coordinates.length===4&&!pt.coordinates.some(qt=>!Array.isArray(qt)||qt.length!==2||qt.some(Ee=>typeof Ee!="number"))||this.fire(new i.j(new i.a2(`sources.${O}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.j(new i.a2(`sources.${O}`,null,'missing required property "coordinates"'))),pt.animate&&typeof pt.animate!="boolean"&&this.fire(new i.j(new i.a2(`sources.${O}`,null,'optional "animate" property must be a boolean value'))),pt.canvas?typeof pt.canvas=="string"||pt.canvas instanceof HTMLCanvasElement||this.fire(new i.j(new i.a2(`sources.${O}`,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 i.j(new i.a2(`sources.${O}`,null,'missing required property "canvas"'))),this.options=pt,this.animate=pt.animate===void 0||pt.animate}load(){return i._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new i.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(O){this.map=O,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let O=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,O=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,O=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let pt=this.map.painter.context,Dt=pt.gl;this.boundsBuffer||(this.boundsBuffer=pt.createVertexBuffer(this._boundsArray,ee.members)),this.boundsSegments||(this.boundsSegments=i.a0.simpleSegment(0,0,4,2)),this.texture?(O||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new g(pt,this.canvas,Dt.RGBA,{premultiply:!0});let Ft=!1;for(let qt in this.tiles){let Ee=this.tiles[qt];Ee.state!=="loaded"&&(Ee.state="loaded",Ee.texture=this.texture,Ft=!0)}Ft&&this.fire(new i.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let O of[this.canvas.width,this.canvas.height])if(isNaN(O)||O<=0)return!0;return!1}}let ue={},Mt=Kt=>{switch(Kt){case"geojson":return Gt;case"image":return xe;case"raster":return Bt;case"raster-dem":return Zt;case"vector":return Rt;case"video":return ge;case"canvas":return ye}return ue[Kt]},Ot="RTLPluginLoaded";class Lt extends i.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=st()}_syncState(O){return this.status=O,this.dispatcher.broadcast("SRPS",{pluginStatus:O,pluginURL:this.url}).catch(pt=>{throw this.status="error",pt})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(O){return i._(this,arguments,void 0,function*(pt,Dt=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=c.resolveURL(pt),!this.url)throw new Error(`requested url ${pt} is invalid`);if(this.status==="unavailable"){if(!Dt)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return i._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new i.k(Ot))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let ie=null;function be(){return ie||(ie=new Lt),ie}class ce{constructor(O,pt){this.timeAdded=0,this.fadeEndTime=0,this.tileID=O,this.uid=i.a4(),this.uses=0,this.tileSize=pt,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(O){let pt=O+this.timeAdded;ptqt.getLayer(wr)).filter(Boolean);if(er.length!==0){je.layers=er,je.stateDependentLayerIds&&(je.stateDependentLayers=je.stateDependentLayerIds.map(wr=>er.filter(Gr=>Gr.id===wr)[0]));for(let wr of er)Ee[wr.id]=je}}return Ee}(O.buckets,pt.style),this.hasSymbolBuckets=!1;for(let Ft in this.buckets){let qt=this.buckets[Ft];if(qt instanceof i.a6){if(this.hasSymbolBuckets=!0,!Dt)break;qt.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let Ft in this.buckets){let qt=this.buckets[Ft];if(qt instanceof i.a6&&qt.hasRTLText){this.hasRTLText=!0,be().lazyLoad();break}}this.queryPadding=0;for(let Ft in this.buckets){let qt=this.buckets[Ft];this.queryPadding=Math.max(this.queryPadding,pt.style.getLayer(Ft).queryRadius(qt))}O.imageAtlas&&(this.imageAtlas=O.imageAtlas),O.glyphAtlasImage&&(this.glyphAtlasImage=O.glyphAtlasImage)}else this.collisionBoxArray=new i.a5}unloadVectorData(){for(let O in this.buckets)this.buckets[O].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(O){return this.buckets[O.id]}upload(O){for(let Dt in this.buckets){let Ft=this.buckets[Dt];Ft.uploadPending()&&Ft.upload(O)}let pt=O.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new g(O,this.imageAtlas.image,pt.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new g(O,this.glyphAtlasImage,pt.ALPHA),this.glyphAtlasImage=null)}prepare(O){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(O,this.imageAtlasTexture)}queryRenderedFeatures(O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ft,cameraQueryGeometry:qt,scale:Ee,tileSize:this.tileSize,pixelPosMatrix:Gr,transform:er,params:je,queryPadding:this.queryPadding*wr},O,pt,Dt):{}}querySourceFeatures(O,pt){let Dt=this.latestFeatureIndex;if(!Dt||!Dt.rawTileData)return;let Ft=Dt.loadVTLayers(),qt=pt&&pt.sourceLayer?pt.sourceLayer:"",Ee=Ft._geojsonTileLayer||Ft[qt];if(!Ee)return;let je=i.a7(pt&&pt.filter),{z:er,x:wr,y:Gr}=this.tileID.canonical,Zr={z:er,x:wr,y:Gr};for(let Tn=0;TnDt)Ft=!1;else if(pt)if(this.expirationTime{this.remove(O,qt)},Dt)),this.data[Ft].push(qt),this.order.push(Ft),this.order.length>this.max){let Ee=this._getAndRemoveByKey(this.order[0]);Ee&&this.onRemove(Ee)}return this}has(O){return O.wrapped().key in this.data}getAndRemove(O){return this.has(O)?this._getAndRemoveByKey(O.wrapped().key):null}_getAndRemoveByKey(O){let pt=this.data[O].shift();return pt.timeout&&clearTimeout(pt.timeout),this.data[O].length===0&&delete this.data[O],this.order.splice(this.order.indexOf(O),1),pt.value}getByKey(O){let pt=this.data[O];return pt?pt[0].value:null}get(O){return this.has(O)?this.data[O.wrapped().key][0].value:null}remove(O,pt){if(!this.has(O))return this;let Dt=O.wrapped().key,Ft=pt===void 0?0:this.data[Dt].indexOf(pt),qt=this.data[Dt][Ft];return this.data[Dt].splice(Ft,1),qt.timeout&&clearTimeout(qt.timeout),this.data[Dt].length===0&&delete this.data[Dt],this.onRemove(qt.value),this.order.splice(this.order.indexOf(Dt),1),this}setMaxSize(O){for(this.max=O;this.order.length>this.max;){let pt=this._getAndRemoveByKey(this.order[0]);pt&&this.onRemove(pt)}return this}filter(O){let pt=[];for(let Dt in this.data)for(let Ft of this.data[Dt])O(Ft.value)||pt.push(Ft);for(let Dt of pt)this.remove(Dt.value.tileID,Dt)}}class Ze{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(O,pt,Dt){let Ft=String(pt);if(this.stateChanges[O]=this.stateChanges[O]||{},this.stateChanges[O][Ft]=this.stateChanges[O][Ft]||{},i.e(this.stateChanges[O][Ft],Dt),this.deletedStates[O]===null){this.deletedStates[O]={};for(let qt in this.state[O])qt!==Ft&&(this.deletedStates[O][qt]=null)}else if(this.deletedStates[O]&&this.deletedStates[O][Ft]===null){this.deletedStates[O][Ft]={};for(let qt in this.state[O][Ft])Dt[qt]||(this.deletedStates[O][Ft][qt]=null)}else for(let qt in Dt)this.deletedStates[O]&&this.deletedStates[O][Ft]&&this.deletedStates[O][Ft][qt]===null&&delete this.deletedStates[O][Ft][qt]}removeFeatureState(O,pt,Dt){if(this.deletedStates[O]===null)return;let Ft=String(pt);if(this.deletedStates[O]=this.deletedStates[O]||{},Dt&&pt!==void 0)this.deletedStates[O][Ft]!==null&&(this.deletedStates[O][Ft]=this.deletedStates[O][Ft]||{},this.deletedStates[O][Ft][Dt]=null);else if(pt!==void 0)if(this.stateChanges[O]&&this.stateChanges[O][Ft])for(Dt in this.deletedStates[O][Ft]={},this.stateChanges[O][Ft])this.deletedStates[O][Ft][Dt]=null;else this.deletedStates[O][Ft]=null;else this.deletedStates[O]=null}getState(O,pt){let Dt=String(pt),Ft=i.e({},(this.state[O]||{})[Dt],(this.stateChanges[O]||{})[Dt]);if(this.deletedStates[O]===null)return{};if(this.deletedStates[O]){let qt=this.deletedStates[O][pt];if(qt===null)return{};for(let Ee in qt)delete Ft[Ee]}return Ft}initializeTileState(O,pt){O.setFeatureState(this.state,pt)}coalesceChanges(O,pt){let Dt={};for(let Ft in this.stateChanges){this.state[Ft]=this.state[Ft]||{};let qt={};for(let Ee in this.stateChanges[Ft])this.state[Ft][Ee]||(this.state[Ft][Ee]={}),i.e(this.state[Ft][Ee],this.stateChanges[Ft][Ee]),qt[Ee]=this.state[Ft][Ee];Dt[Ft]=qt}for(let Ft in this.deletedStates){this.state[Ft]=this.state[Ft]||{};let qt={};if(this.deletedStates[Ft]===null)for(let Ee in this.state[Ft])qt[Ee]={},this.state[Ft][Ee]={};else for(let Ee in this.deletedStates[Ft]){if(this.deletedStates[Ft][Ee]===null)this.state[Ft][Ee]={};else for(let je of Object.keys(this.deletedStates[Ft][Ee]))delete this.state[Ft][Ee][je];qt[Ee]=this.state[Ft][Ee]}Dt[Ft]=Dt[Ft]||{},i.e(Dt[Ft],qt)}if(this.stateChanges={},this.deletedStates={},Object.keys(Dt).length!==0)for(let Ft in O)O[Ft].setFeatureState(Dt,pt)}}class Qe extends i.E{constructor(O,pt,Dt){super(),this.id=O,this.dispatcher=Dt,this.on("data",Ft=>this._dataHandler(Ft)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Ft,qt,Ee,je)=>{let er=new(Mt(qt.type))(Ft,qt,Ee,je);if(er.id!==Ft)throw new Error(`Expected Source id to be ${Ft} instead of ${er.id}`);return er})(O,pt,Dt,this),this._tiles={},this._cache=new Le(0,Ft=>this._unloadTile(Ft)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ze,this._didEmitContent=!1,this._updated=!1}onAdd(O){this.map=O,this._maxTileCacheSize=O?O._maxTileCacheSize:null,this._maxTileCacheZoomLevels=O?O._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(O)}onRemove(O){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(O)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let O in this._tiles){let pt=this._tiles[O];if(pt.state!=="loaded"&&pt.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let O=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,O&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(O,pt,Dt){return i._(this,void 0,void 0,function*(){try{yield this._source.loadTile(O),this._tileLoaded(O,pt,Dt)}catch(Ft){O.state="errored",Ft.status!==404?this._source.fire(new i.j(Ft,{tile:O})):this.update(this.transform,this.terrain)}})}_unloadTile(O){this._source.unloadTile&&this._source.unloadTile(O)}_abortTile(O){this._source.abortTile&&this._source.abortTile(O),this._source.fire(new i.k("dataabort",{tile:O,coord:O.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(O){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let pt in this._tiles){let Dt=this._tiles[pt];Dt.upload(O),Dt.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(O=>O.tileID).sort(mr).map(O=>O.key)}getRenderableIds(O){let pt=[];for(let Dt in this._tiles)this._isIdRenderable(Dt,O)&&pt.push(this._tiles[Dt]);return O?pt.sort((Dt,Ft)=>{let qt=Dt.tileID,Ee=Ft.tileID,je=new i.P(qt.canonical.x,qt.canonical.y)._rotate(this.transform.angle),er=new i.P(Ee.canonical.x,Ee.canonical.y)._rotate(this.transform.angle);return qt.overscaledZ-Ee.overscaledZ||er.y-je.y||er.x-je.x}).map(Dt=>Dt.tileID.key):pt.map(Dt=>Dt.tileID).sort(mr).map(Dt=>Dt.key)}hasRenderableParent(O){let pt=this.findLoadedParent(O,0);return!!pt&&this._isIdRenderable(pt.tileID.key)}_isIdRenderable(O,pt){return this._tiles[O]&&this._tiles[O].hasData()&&!this._coveredTiles[O]&&(pt||!this._tiles[O].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let O in this._tiles)this._tiles[O].state!=="errored"&&this._reloadTile(O,"reloading")}}_reloadTile(O,pt){return i._(this,void 0,void 0,function*(){let Dt=this._tiles[O];Dt&&(Dt.state!=="loading"&&(Dt.state=pt),yield this._loadTile(Dt,O,pt))})}_tileLoaded(O,pt,Dt){O.timeAdded=c.now(),Dt==="expired"&&(O.refreshedUponExpiration=!0),this._setTileReloadTimer(pt,O),this.getSource().type==="raster-dem"&&O.dem&&this._backfillDEM(O),this._state.initializeTileState(O,this.map?this.map.painter:null),O.aborted||this._source.fire(new i.k("data",{dataType:"source",tile:O,coord:O.tileID}))}_backfillDEM(O){let pt=this.getRenderableIds();for(let Ft=0;Ft1||(Math.abs(Ee)>1&&(Math.abs(Ee+er)===1?Ee+=er:Math.abs(Ee-er)===1&&(Ee-=er)),qt.dem&&Ft.dem&&(Ft.dem.backfillBorder(qt.dem,Ee,je),Ft.neighboringTiles&&Ft.neighboringTiles[wr]&&(Ft.neighboringTiles[wr].backfilled=!0)))}}getTile(O){return this.getTileByID(O.key)}getTileByID(O){return this._tiles[O]}_retainLoadedChildren(O,pt,Dt,Ft){for(let qt in this._tiles){let Ee=this._tiles[qt];if(Ft[qt]||!Ee.hasData()||Ee.tileID.overscaledZ<=pt||Ee.tileID.overscaledZ>Dt)continue;let je=Ee.tileID;for(;Ee&&Ee.tileID.overscaledZ>pt+1;){let wr=Ee.tileID.scaledTo(Ee.tileID.overscaledZ-1);Ee=this._tiles[wr.key],Ee&&Ee.hasData()&&(je=wr)}let er=je;for(;er.overscaledZ>pt;)if(er=er.scaledTo(er.overscaledZ-1),O[er.key]){Ft[je.key]=je;break}}}findLoadedParent(O,pt){if(O.key in this._loadedParentTiles){let Dt=this._loadedParentTiles[O.key];return Dt&&Dt.tileID.overscaledZ>=pt?Dt:null}for(let Dt=O.overscaledZ-1;Dt>=pt;Dt--){let Ft=O.scaledTo(Dt),qt=this._getLoadedTile(Ft);if(qt)return qt}}findLoadedSibling(O){return this._getLoadedTile(O)}_getLoadedTile(O){let pt=this._tiles[O.key];return pt&&pt.hasData()?pt:this._cache.getByKey(O.wrapped().key)}updateCacheSize(O){let pt=Math.ceil(O.width/this._source.tileSize)+1,Dt=Math.ceil(O.height/this._source.tileSize)+1,Ft=Math.floor(pt*Dt*(this._maxTileCacheZoomLevels===null?i.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),qt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ft):Ft;this._cache.setMaxSize(qt)}handleWrapJump(O){let pt=Math.round((O-(this._prevLng===void 0?O:this._prevLng))/360);if(this._prevLng=O,pt){let Dt={};for(let Ft in this._tiles){let qt=this._tiles[Ft];qt.tileID=qt.tileID.unwrapTo(qt.tileID.wrap+pt),Dt[qt.tileID.key]=qt}this._tiles=Dt;for(let Ft in this._timers)clearTimeout(this._timers[Ft]),delete this._timers[Ft];for(let Ft in this._tiles)this._setTileReloadTimer(Ft,this._tiles[Ft])}}_updateCoveredAndRetainedTiles(O,pt,Dt,Ft,qt,Ee){let je={},er={},wr=Object.keys(O),Gr=c.now();for(let Zr of wr){let Tn=O[Zr],qn=this._tiles[Zr];if(!qn||qn.fadeEndTime!==0&&qn.fadeEndTime<=Gr)continue;let te=this.findLoadedParent(Tn,pt),le=this.findLoadedSibling(Tn),Te=te||le||null;Te&&(this._addTile(Te.tileID),je[Te.tileID.key]=Te.tileID),er[Zr]=Tn}this._retainLoadedChildren(er,Ft,Dt,O);for(let Zr in je)O[Zr]||(this._coveredTiles[Zr]=!0,O[Zr]=je[Zr]);if(Ee){let Zr={},Tn={};for(let qn of qt)this._tiles[qn.key].hasData()?Zr[qn.key]=qn:Tn[qn.key]=qn;for(let qn in Tn){let te=Tn[qn].children(this._source.maxzoom);this._tiles[te[0].key]&&this._tiles[te[1].key]&&this._tiles[te[2].key]&&this._tiles[te[3].key]&&(Zr[te[0].key]=O[te[0].key]=te[0],Zr[te[1].key]=O[te[1].key]=te[1],Zr[te[2].key]=O[te[2].key]=te[2],Zr[te[3].key]=O[te[3].key]=te[3],delete Tn[qn])}for(let qn in Tn){let te=Tn[qn],le=this.findLoadedParent(te,this._source.minzoom),Te=this.findLoadedSibling(te),Pe=le||Te||null;if(Pe){Zr[Pe.tileID.key]=O[Pe.tileID.key]=Pe.tileID;for(let We in Zr)Zr[We].isChildOf(Pe.tileID)&&delete Zr[We]}}for(let qn in this._tiles)Zr[qn]||(this._coveredTiles[qn]=!0)}}update(O,pt){if(!this._sourceLoaded||this._paused)return;let Dt;this.transform=O,this.terrain=pt,this.updateCacheSize(O),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Dt=O.getVisibleUnwrappedCoordinates(this._source.tileID).map(Gr=>new i.S(Gr.canonical.z,Gr.wrap,Gr.canonical.z,Gr.canonical.x,Gr.canonical.y)):(Dt=O.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:pt}),this._source.hasTile&&(Dt=Dt.filter(Gr=>this._source.hasTile(Gr)))):Dt=[];let Ft=O.coveringZoomLevel(this._source),qt=Math.max(Ft-Qe.maxOverzooming,this._source.minzoom),Ee=Math.max(Ft+Qe.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let Gr={};for(let Zr of Dt)if(Zr.canonical.z>this._source.minzoom){let Tn=Zr.scaledTo(Zr.canonical.z-1);Gr[Tn.key]=Tn;let qn=Zr.scaledTo(Math.max(this._source.minzoom,Math.min(Zr.canonical.z,5)));Gr[qn.key]=qn}Dt=Dt.concat(Object.values(Gr))}let je=Dt.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,je&&this.fire(new i.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let er=this._updateRetainedTiles(Dt,Ft);fr(this._source.type)&&this._updateCoveredAndRetainedTiles(er,qt,Ee,Ft,Dt,pt);for(let Gr in er)this._tiles[Gr].clearFadeHold();let wr=i.ab(this._tiles,er);for(let Gr of wr){let Zr=this._tiles[Gr];Zr.hasSymbolBuckets&&!Zr.holdingForFade()?Zr.setHoldDuration(this.map._fadeDuration):Zr.hasSymbolBuckets&&!Zr.symbolFadeFinished()||this._removeTile(Gr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let O in this._tiles)this._tiles[O].holdingForFade()&&this._removeTile(O)}_updateRetainedTiles(O,pt){var Dt;let Ft={},qt={},Ee=Math.max(pt-Qe.maxOverzooming,this._source.minzoom),je=Math.max(pt+Qe.maxUnderzooming,this._source.minzoom),er={};for(let wr of O){let Gr=this._addTile(wr);Ft[wr.key]=wr,Gr.hasData()||ptthis._source.maxzoom){let Tn=wr.children(this._source.maxzoom)[0],qn=this.getTile(Tn);if(qn&&qn.hasData()){Ft[Tn.key]=Tn;continue}}else{let Tn=wr.children(this._source.maxzoom);if(Ft[Tn[0].key]&&Ft[Tn[1].key]&&Ft[Tn[2].key]&&Ft[Tn[3].key])continue}let Zr=Gr.wasRequested();for(let Tn=wr.overscaledZ-1;Tn>=Ee;--Tn){let qn=wr.scaledTo(Tn);if(qt[qn.key])break;if(qt[qn.key]=!0,Gr=this.getTile(qn),!Gr&&Zr&&(Gr=this._addTile(qn)),Gr){let te=Gr.hasData();if((te||!(!((Dt=this.map)===null||Dt===void 0)&&Dt.cancelPendingTileRequestsWhileZooming)||Zr)&&(Ft[qn.key]=qn),Zr=Gr.wasRequested(),te)break}}}return Ft}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let O in this._tiles){let pt=[],Dt,Ft=this._tiles[O].tileID;for(;Ft.overscaledZ>0;){if(Ft.key in this._loadedParentTiles){Dt=this._loadedParentTiles[Ft.key];break}pt.push(Ft.key);let qt=Ft.scaledTo(Ft.overscaledZ-1);if(Dt=this._getLoadedTile(qt),Dt)break;Ft=qt}for(let qt of pt)this._loadedParentTiles[qt]=Dt}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let O in this._tiles){let pt=this._tiles[O].tileID,Dt=this._getLoadedTile(pt);this._loadedSiblingTiles[pt.key]=Dt}}_addTile(O){let pt=this._tiles[O.key];if(pt)return pt;pt=this._cache.getAndRemove(O),pt&&(this._setTileReloadTimer(O.key,pt),pt.tileID=O,this._state.initializeTileState(pt,this.map?this.map.painter:null),this._cacheTimers[O.key]&&(clearTimeout(this._cacheTimers[O.key]),delete this._cacheTimers[O.key],this._setTileReloadTimer(O.key,pt)));let Dt=pt;return pt||(pt=new ce(O,this._source.tileSize*O.overscaleFactor()),this._loadTile(pt,O.key,pt.state)),pt.uses++,this._tiles[O.key]=pt,Dt||this._source.fire(new i.k("dataloading",{tile:pt,coord:pt.tileID,dataType:"source"})),pt}_setTileReloadTimer(O,pt){O in this._timers&&(clearTimeout(this._timers[O]),delete this._timers[O]);let Dt=pt.getExpiryTimeout();Dt&&(this._timers[O]=setTimeout(()=>{this._reloadTile(O,"expired"),delete this._timers[O]},Dt))}_removeTile(O){let pt=this._tiles[O];pt&&(pt.uses--,delete this._tiles[O],this._timers[O]&&(clearTimeout(this._timers[O]),delete this._timers[O]),pt.uses>0||(pt.hasData()&&pt.state!=="reloading"?this._cache.add(pt.tileID,pt,pt.getExpiryTimeout()):(pt.aborted=!0,this._abortTile(pt),this._unloadTile(pt))))}_dataHandler(O){let pt=O.sourceDataType;O.dataType==="source"&&pt==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&O.dataType==="source"&&pt==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let O in this._tiles)this._removeTile(O);this._cache.reset()}tilesIn(O,pt,Dt){let Ft=[],qt=this.transform;if(!qt)return Ft;let Ee=Dt?qt.getCameraQueryGeometry(O):O,je=O.map(te=>qt.pointCoordinate(te,this.terrain)),er=Ee.map(te=>qt.pointCoordinate(te,this.terrain)),wr=this.getIds(),Gr=1/0,Zr=1/0,Tn=-1/0,qn=-1/0;for(let te of er)Gr=Math.min(Gr,te.x),Zr=Math.min(Zr,te.y),Tn=Math.max(Tn,te.x),qn=Math.max(qn,te.y);for(let te=0;te=0&&Ne[1].y+We>=0){let Xe=je.map(qr=>Te.getTilePoint(qr)),Pr=er.map(qr=>Te.getTilePoint(qr));Ft.push({tile:le,tileID:Te,queryGeometry:Xe,cameraQueryGeometry:Pr,scale:Pe})}}return Ft}getVisibleCoordinates(O){let pt=this.getRenderableIds(O).map(Dt=>this._tiles[Dt].tileID);for(let Dt of pt)Dt.posMatrix=this.transform.calculatePosMatrix(Dt.toUnwrapped());return pt}hasTransition(){if(this._source.hasTransition())return!0;if(fr(this._source.type)){let O=c.now();for(let pt in this._tiles)if(this._tiles[pt].fadeEndTime>=O)return!0}return!1}setFeatureState(O,pt,Dt){this._state.updateState(O=O||"_geojsonTileLayer",pt,Dt)}removeFeatureState(O,pt,Dt){this._state.removeFeatureState(O=O||"_geojsonTileLayer",pt,Dt)}getFeatureState(O,pt){return this._state.getState(O=O||"_geojsonTileLayer",pt)}setDependencies(O,pt,Dt){let Ft=this._tiles[O];Ft&&Ft.setDependencies(pt,Dt)}reloadTilesForDependencies(O,pt){for(let Dt in this._tiles)this._tiles[Dt].hasDependency(O,pt)&&this._reloadTile(Dt,"reloading");this._cache.filter(Dt=>!Dt.hasDependency(O,pt))}}function mr(Kt,O){let pt=Math.abs(2*Kt.wrap)-+(Kt.wrap<0),Dt=Math.abs(2*O.wrap)-+(O.wrap<0);return Kt.overscaledZ-O.overscaledZ||Dt-pt||O.canonical.y-Kt.canonical.y||O.canonical.x-Kt.canonical.x}function fr(Kt){return Kt==="raster"||Kt==="image"||Kt==="video"}Qe.maxOverzooming=10,Qe.maxUnderzooming=3;class Jr{constructor(O,pt){this.reset(O,pt)}reset(O,pt){this.points=O||[],this._distances=[0];for(let Dt=1;Dt0?(Ft-Ee)/je:0;return this.points[qt].mult(1-er).add(this.points[pt].mult(er))}}function an(Kt,O){let pt=!0;return Kt==="always"||Kt!=="never"&&O!=="never"||(pt=!1),pt}class Er{constructor(O,pt,Dt){let Ft=this.boxCells=[],qt=this.circleCells=[];this.xCellCount=Math.ceil(O/Dt),this.yCellCount=Math.ceil(pt/Dt);for(let Ee=0;Eethis.width||Ft<0||pt>this.height)return[];let er=[];if(O<=0&&pt<=0&&this.width<=Dt&&this.height<=Ft){if(qt)return[{key:null,x1:O,y1:pt,x2:Dt,y2:Ft}];for(let wr=0;wr0}hitTestCircle(O,pt,Dt,Ft,qt){let Ee=O-Dt,je=O+Dt,er=pt-Dt,wr=pt+Dt;if(je<0||Ee>this.width||wr<0||er>this.height)return!1;let Gr=[];return this._forEachCell(Ee,er,je,wr,this._queryCellCircle,Gr,{hitTest:!0,overlapMode:Ft,circle:{x:O,y:pt,radius:Dt},seenUids:{box:{},circle:{}}},qt),Gr.length>0}_queryCell(O,pt,Dt,Ft,qt,Ee,je,er){let{seenUids:wr,hitTest:Gr,overlapMode:Zr}=je,Tn=this.boxCells[qt];if(Tn!==null){let te=this.bboxes;for(let le of Tn)if(!wr.box[le]){wr.box[le]=!0;let Te=4*le,Pe=this.boxKeys[le];if(O<=te[Te+2]&&pt<=te[Te+3]&&Dt>=te[Te+0]&&Ft>=te[Te+1]&&(!er||er(Pe))&&(!Gr||!an(Zr,Pe.overlapMode))&&(Ee.push({key:Pe,x1:te[Te],y1:te[Te+1],x2:te[Te+2],y2:te[Te+3]}),Gr))return!0}}let qn=this.circleCells[qt];if(qn!==null){let te=this.circles;for(let le of qn)if(!wr.circle[le]){wr.circle[le]=!0;let Te=3*le,Pe=this.circleKeys[le];if(this._circleAndRectCollide(te[Te],te[Te+1],te[Te+2],O,pt,Dt,Ft)&&(!er||er(Pe))&&(!Gr||!an(Zr,Pe.overlapMode))){let We=te[Te],Ne=te[Te+1],Xe=te[Te+2];if(Ee.push({key:Pe,x1:We-Xe,y1:Ne-Xe,x2:We+Xe,y2:Ne+Xe}),Gr)return!0}}}return!1}_queryCellCircle(O,pt,Dt,Ft,qt,Ee,je,er){let{circle:wr,seenUids:Gr,overlapMode:Zr}=je,Tn=this.boxCells[qt];if(Tn!==null){let te=this.bboxes;for(let le of Tn)if(!Gr.box[le]){Gr.box[le]=!0;let Te=4*le,Pe=this.boxKeys[le];if(this._circleAndRectCollide(wr.x,wr.y,wr.radius,te[Te+0],te[Te+1],te[Te+2],te[Te+3])&&(!er||er(Pe))&&!an(Zr,Pe.overlapMode))return Ee.push(!0),!0}}let qn=this.circleCells[qt];if(qn!==null){let te=this.circles;for(let le of qn)if(!Gr.circle[le]){Gr.circle[le]=!0;let Te=3*le,Pe=this.circleKeys[le];if(this._circlesCollide(te[Te],te[Te+1],te[Te+2],wr.x,wr.y,wr.radius)&&(!er||er(Pe))&&!an(Zr,Pe.overlapMode))return Ee.push(!0),!0}}}_forEachCell(O,pt,Dt,Ft,qt,Ee,je,er){let wr=this._convertToXCellCoord(O),Gr=this._convertToYCellCoord(pt),Zr=this._convertToXCellCoord(Dt),Tn=this._convertToYCellCoord(Ft);for(let qn=wr;qn<=Zr;qn++)for(let te=Gr;te<=Tn;te++)if(qt.call(this,O,pt,Dt,Ft,this.xCellCount*te+qn,Ee,je,er))return}_convertToXCellCoord(O){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(O*this.xScale)))}_convertToYCellCoord(O){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(O*this.yScale)))}_circlesCollide(O,pt,Dt,Ft,qt,Ee){let je=Ft-O,er=qt-pt,wr=Dt+Ee;return wr*wr>je*je+er*er}_circleAndRectCollide(O,pt,Dt,Ft,qt,Ee,je){let er=(Ee-Ft)/2,wr=Math.abs(O-(Ft+er));if(wr>er+Dt)return!1;let Gr=(je-qt)/2,Zr=Math.abs(pt-(qt+Gr));if(Zr>Gr+Dt)return!1;if(wr<=er||Zr<=Gr)return!0;let Tn=wr-er,qn=Zr-Gr;return Tn*Tn+qn*qn<=Dt*Dt}}function dn(Kt,O,pt,Dt,Ft){let qt=i.H();return O?(i.K(qt,qt,[1/Ft,1/Ft,1]),pt||i.ad(qt,qt,Dt.angle)):i.L(qt,Dt.labelPlaneMatrix,Kt),qt}function _n(Kt,O,pt,Dt,Ft){if(O){let qt=i.ae(Kt);return i.K(qt,qt,[Ft,Ft,1]),pt||i.ad(qt,qt,-Dt.angle),qt}return Dt.glCoordMatrix}function Oe(Kt,O,pt,Dt){let Ft;Dt?(Ft=[Kt,O,Dt(Kt,O),1],i.af(Ft,Ft,pt)):(Ft=[Kt,O,0,1],xr(Ft,Ft,pt));let qt=Ft[3];return{point:new i.P(Ft[0]/qt,Ft[1]/qt),signedDistanceFromCamera:qt,isOccluded:!1}}function Xt(Kt,O){return .5+Kt/O*.5}function oe(Kt,O){return Kt.x>=-O[0]&&Kt.x<=O[0]&&Kt.y>=-O[1]&&Kt.y<=O[1]}function zt(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te){let le=Dt?Kt.textSizeData:Kt.iconSizeData,Te=i.ag(le,pt.transform.zoom),Pe=[256/pt.width*2+1,256/pt.height*2+1],We=Dt?Kt.text.dynamicLayoutVertexArray:Kt.icon.dynamicLayoutVertexArray;We.clear();let Ne=Kt.lineVertexArray,Xe=Dt?Kt.text.placedSymbolArray:Kt.icon.placedSymbolArray,Pr=pt.transform.width/pt.transform.height,qr=!1;for(let Xr=0;XrMath.abs(pt.x-O.x)*Dt?{useVertical:!0}:(Kt===i.ah.vertical?O.ypt.x)?{needsFlipping:!0}:null}function Ht(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr){let Zr=pt/24,Tn=O.lineOffsetX*Zr,qn=O.lineOffsetY*Zr,te;if(O.numGlyphs>1){let le=O.glyphStartIndex+O.numGlyphs,Te=O.lineStartIndex,Pe=O.lineStartIndex+O.lineLength,We=_t(Zr,je,Tn,qn,Dt,O,Gr,Kt);if(!We)return{notEnoughRoom:!0};let Ne=Oe(We.first.point.x,We.first.point.y,Ee,Kt.getElevation).point,Xe=Oe(We.last.point.x,We.last.point.y,Ee,Kt.getElevation).point;if(Ft&&!Dt){let Pr=Pt(O.writingMode,Ne,Xe,wr);if(Pr)return Pr}te=[We.first];for(let Pr=O.glyphStartIndex+1;Pr0?Ne.point:function(qr,Xr,gn,zn,Qn,ai){return ae(qr,Xr,gn,1,Qn,ai)}(Kt.tileAnchorPoint,We,Te,0,qt,Kt),Pr=Pt(O.writingMode,Te,Xe,wr);if(Pr)return Pr}let le=ur(Zr*je.getoffsetX(O.glyphStartIndex),Tn,qn,Dt,O.segment,O.lineStartIndex,O.lineStartIndex+O.lineLength,Kt,Gr);if(!le||Kt.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};te=[le]}for(let le of te)i.aj(er,le.point,le.angle);return{}}function ae(Kt,O,pt,Dt,Ft,qt){let Ee=Kt.add(Kt.sub(O)._unit()),je=Ft!==void 0?Oe(Ee.x,Ee.y,Ft,qt.getElevation).point:Me(Ee.x,Ee.y,qt).point,er=pt.sub(je);return pt.add(er._mult(Dt/er.mag()))}function he(Kt,O,pt){let Dt=O.projectionCache;if(Dt.projections[Kt])return Dt.projections[Kt];let Ft=new i.P(O.lineVertexArray.getx(Kt),O.lineVertexArray.gety(Kt)),qt=Me(Ft.x,Ft.y,O);if(qt.signedDistanceFromCamera>0)return Dt.projections[Kt]=qt.point,Dt.anyProjectionOccluded=Dt.anyProjectionOccluded||qt.isOccluded,qt.point;let Ee=Kt-pt.direction;return function(je,er,wr,Gr,Zr){return ae(je,er,wr,Gr,void 0,Zr)}(pt.distanceFromAnchor===0?O.tileAnchorPoint:new i.P(O.lineVertexArray.getx(Ee),O.lineVertexArray.gety(Ee)),Ft,pt.previousVertex,pt.absOffsetX-pt.distanceFromAnchor+1,O)}function Me(Kt,O,pt){let Dt=Kt+pt.translation[0],Ft=O+pt.translation[1],qt;return!pt.pitchWithMap&&pt.projection.useSpecialProjectionForSymbols?(qt=pt.projection.projectTileCoordinates(Dt,Ft,pt.unwrappedTileID,pt.getElevation),qt.point.x=(.5*qt.point.x+.5)*pt.width,qt.point.y=(.5*-qt.point.y+.5)*pt.height):(qt=Oe(Dt,Ft,pt.labelPlaneMatrix,pt.getElevation),qt.isOccluded=!1),qt}function qe(Kt,O,pt){return Kt._unit()._perp()._mult(O*pt)}function Ye(Kt,O,pt,Dt,Ft,qt,Ee,je,er){if(je.projectionCache.offsets[Kt])return je.projectionCache.offsets[Kt];let wr=pt.add(O);if(Kt+er.direction=Ft)return je.projectionCache.offsets[Kt]=wr,wr;let Gr=he(Kt+er.direction,je,er),Zr=qe(Gr.sub(pt),Ee,er.direction),Tn=pt.add(Zr),qn=Gr.add(Zr);return je.projectionCache.offsets[Kt]=i.ak(qt,wr,Tn,qn)||wr,je.projectionCache.offsets[Kt]}function ur(Kt,O,pt,Dt,Ft,qt,Ee,je,er){let wr=Dt?Kt-O:Kt+O,Gr=wr>0?1:-1,Zr=0;Dt&&(Gr*=-1,Zr=Math.PI),Gr<0&&(Zr+=Math.PI);let Tn,qn=Gr>0?qt+Ft:qt+Ft+1;je.projectionCache.cachedAnchorPoint?Tn=je.projectionCache.cachedAnchorPoint:(Tn=Me(je.tileAnchorPoint.x,je.tileAnchorPoint.y,je).point,je.projectionCache.cachedAnchorPoint=Tn);let te,le,Te=Tn,Pe=Tn,We=0,Ne=0,Xe=Math.abs(wr),Pr=[],qr;for(;We+Ne<=Xe;){if(qn+=Gr,qn=Ee)return null;We+=Ne,Pe=Te,le=te;let zn={absOffsetX:Xe,direction:Gr,distanceFromAnchor:We,previousVertex:Pe};if(Te=he(qn,je,zn),pt===0)Pr.push(Pe),qr=Te.sub(Pe);else{let Qn,ai=Te.sub(Pe);Qn=ai.mag()===0?qe(he(qn+Gr,je,zn).sub(Te),pt,Gr):qe(ai,pt,Gr),le||(le=Pe.add(Qn)),te=Ye(qn,Qn,Te,qt,Ee,le,pt,je,zn),Pr.push(le),qr=te.sub(le)}Ne=qr.mag()}let Xr=qr._mult((Xe-We)/Ne)._add(le||Pe),gn=Zr+Math.atan2(Te.y-Pe.y,Te.x-Pe.x);return Pr.push(Xr),{point:Xr,angle:er?gn:0,path:Pr}}let Rr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function zr(Kt,O){for(let pt=0;pt=1;Fo--)Fa.push(Ma.path[Fo]);for(let Fo=1;Foxs.signedDistanceFromCamera<=0)?[]:Fo.map(xs=>xs.point)}let Yo=[];if(Fa.length>0){let Fo=Fa[0].clone(),xs=Fa[0].clone();for(let Sl=1;Sl=ai.x&&xs.x<=Ti.x&&Fo.y>=ai.y&&xs.y<=Ti.y?[Fa]:xs.xTi.x||xs.yTi.y?[]:i.al([Fa],ai.x,ai.y,Ti.x,Ti.y)}for(let Fo of Yo){Qi.reset(Fo,.25*Qn);let xs=0;xs=Qi.length<=.5*Qn?1:Math.ceil(Qi.paddedLength/wo)+1;for(let Sl=0;SlOe(Ft.x,Ft.y,Dt,pt.getElevation))}queryRenderedSymbols(O){if(O.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let pt=[],Dt=1/0,Ft=1/0,qt=-1/0,Ee=-1/0;for(let Gr of O){let Zr=new i.P(Gr.x+pn,Gr.y+pn);Dt=Math.min(Dt,Zr.x),Ft=Math.min(Ft,Zr.y),qt=Math.max(qt,Zr.x),Ee=Math.max(Ee,Zr.y),pt.push(Zr)}let je=this.grid.query(Dt,Ft,qt,Ee).concat(this.ignoredGrid.query(Dt,Ft,qt,Ee)),er={},wr={};for(let Gr of je){let Zr=Gr.key;if(er[Zr.bucketInstanceId]===void 0&&(er[Zr.bucketInstanceId]={}),er[Zr.bucketInstanceId][Zr.featureIndex])continue;let Tn=[new i.P(Gr.x1,Gr.y1),new i.P(Gr.x2,Gr.y1),new i.P(Gr.x2,Gr.y2),new i.P(Gr.x1,Gr.y2)];i.am(pt,Tn)&&(er[Zr.bucketInstanceId][Zr.featureIndex]=!0,wr[Zr.bucketInstanceId]===void 0&&(wr[Zr.bucketInstanceId]=[]),wr[Zr.bucketInstanceId].push(Zr.featureIndex))}return wr}insertCollisionBox(O,pt,Dt,Ft,qt,Ee){(Dt?this.ignoredGrid:this.grid).insert({bucketInstanceId:Ft,featureIndex:qt,collisionGroupID:Ee,overlapMode:pt},O[0],O[1],O[2],O[3])}insertCollisionCircles(O,pt,Dt,Ft,qt,Ee){let je=Dt?this.ignoredGrid:this.grid,er={bucketInstanceId:Ft,featureIndex:qt,collisionGroupID:Ee,overlapMode:pt};for(let wr=0;wr=this.screenRightBoundary||Ftthis.screenBottomBoundary}isInsideGrid(O,pt,Dt,Ft){return Dt>=0&&O=0&&ptthis.projectAndGetPerspectiveRatio(Dt,Qn.x,Qn.y,Ft,wr));gn=zn.some(Qn=>!Qn.isOccluded),Xr=zn.map(Qn=>Qn.point)}else gn=!0;return{box:i.ao(Xr),allPointsOccluded:!gn}}}function ui(Kt,O,pt){return O*(i.X/(Kt.tileSize*Math.pow(2,pt-Kt.tileID.overscaledZ)))}class yi{constructor(O,pt,Dt,Ft){this.opacity=O?Math.max(0,Math.min(1,O.opacity+(O.placed?pt:-pt))):Ft&&Dt?1:0,this.placed=Dt}isHidden(){return this.opacity===0&&!this.placed}}class Gi{constructor(O,pt,Dt,Ft,qt){this.text=new yi(O?O.text:null,pt,Dt,qt),this.icon=new yi(O?O.icon:null,pt,Ft,qt)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ci{constructor(O,pt,Dt){this.text=O,this.icon=pt,this.skipFade=Dt}}class fi{constructor(){this.invProjMatrix=i.H(),this.viewportMatrix=i.H(),this.circles=[]}}class ba{constructor(O,pt,Dt,Ft,qt){this.bucketInstanceId=O,this.featureIndex=pt,this.sourceLayerIndex=Dt,this.bucketIndex=Ft,this.tileID=qt}}class oa{constructor(O){this.crossSourceCollisions=O,this.maxGroupID=0,this.collisionGroups={}}get(O){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[O]){let pt=++this.maxGroupID;this.collisionGroups[O]={ID:pt,predicate:Dt=>Dt.collisionGroupID===pt}}return this.collisionGroups[O]}}function Ke(Kt,O,pt,Dt,Ft){let{horizontalAlign:qt,verticalAlign:Ee}=i.au(Kt);return new i.P(-(qt-.5)*O+Dt[0]*Ft,-(Ee-.5)*pt+Dt[1]*Ft)}class sr{constructor(O,pt,Dt,Ft,qt,Ee){this.transform=O.clone(),this.terrain=Dt,this.collisionIndex=new ci(this.transform,pt),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Ft,this.retainedQueryData={},this.collisionGroups=new oa(qt),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=Ee,Ee&&(Ee.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(O){let pt=this.terrain;return pt?(Dt,Ft)=>pt.getElevation(O,Dt,Ft):null}getBucketParts(O,pt,Dt,Ft){let qt=Dt.getBucket(pt),Ee=Dt.latestFeatureIndex;if(!qt||!Ee||pt.id!==qt.layerIds[0])return;let je=Dt.collisionBoxArray,er=qt.layers[0].layout,wr=qt.layers[0].paint,Gr=Math.pow(2,this.transform.zoom-Dt.tileID.overscaledZ),Zr=Dt.tileSize/i.X,Tn=Dt.tileID.toUnwrapped(),qn=this.transform.calculatePosMatrix(Tn),te=er.get("text-pitch-alignment")==="map",le=er.get("text-rotation-alignment")==="map",Te=ui(Dt,1,this.transform.zoom),Pe=this.collisionIndex.mapProjection.translatePosition(this.transform,Dt,wr.get("text-translate"),wr.get("text-translate-anchor")),We=this.collisionIndex.mapProjection.translatePosition(this.transform,Dt,wr.get("icon-translate"),wr.get("icon-translate-anchor")),Ne=dn(qn,te,le,this.transform,Te),Xe=null;if(te){let qr=_n(qn,te,le,this.transform,Te);Xe=i.L([],this.transform.labelPlaneMatrix,qr)}this.retainedQueryData[qt.bucketInstanceId]=new ba(qt.bucketInstanceId,Ee,qt.sourceLayerIndex,qt.index,Dt.tileID);let Pr={bucket:qt,layout:er,translationText:Pe,translationIcon:We,posMatrix:qn,unwrappedTileID:Tn,textLabelPlaneMatrix:Ne,labelToScreenMatrix:Xe,scale:Gr,textPixelRatio:Zr,holdingForFade:Dt.holdingForFade(),collisionBoxArray:je,partiallyEvaluatedTextSize:i.ag(qt.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(qt.sourceID)};if(Ft)for(let qr of qt.sortKeyRanges){let{sortKey:Xr,symbolInstanceStart:gn,symbolInstanceEnd:zn}=qr;O.push({sortKey:Xr,symbolInstanceStart:gn,symbolInstanceEnd:zn,parameters:Pr})}else O.push({symbolInstanceStart:0,symbolInstanceEnd:qt.symbolInstances.length,parameters:Pr})}attemptAnchorPlacement(O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te,le,Te,Pe,We,Ne){let Xe=i.aq[O.textAnchor],Pr=[O.textOffset0,O.textOffset1],qr=Ke(Xe,Dt,Ft,Pr,qt),Xr=this.collisionIndex.placeCollisionBox(pt,Tn,er,wr,Gr,je,Ee,Te,Zr.predicate,Ne,qr);if((!We||this.collisionIndex.placeCollisionBox(We,Tn,er,wr,Gr,je,Ee,Pe,Zr.predicate,Ne,qr).placeable)&&Xr.placeable){let gn;if(this.prevPlacement&&this.prevPlacement.variableOffsets[qn.crossTileID]&&this.prevPlacement.placements[qn.crossTileID]&&this.prevPlacement.placements[qn.crossTileID].text&&(gn=this.prevPlacement.variableOffsets[qn.crossTileID].anchor),qn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[qn.crossTileID]={textOffset:Pr,width:Dt,height:Ft,anchor:Xe,textBoxScale:qt,prevAnchor:gn},this.markUsedJustification(te,Xe,qn,le),te.allowVerticalPlacement&&(this.markUsedOrientation(te,le,qn),this.placedOrientations[qn.crossTileID]=le),{shift:qr,placedGlyphBoxes:Xr}}}placeLayerBucketPart(O,pt,Dt){let{bucket:Ft,layout:qt,translationText:Ee,translationIcon:je,posMatrix:er,unwrappedTileID:wr,textLabelPlaneMatrix:Gr,labelToScreenMatrix:Zr,textPixelRatio:Tn,holdingForFade:qn,collisionBoxArray:te,partiallyEvaluatedTextSize:le,collisionGroup:Te}=O.parameters,Pe=qt.get("text-optional"),We=qt.get("icon-optional"),Ne=i.ar(qt,"text-overlap","text-allow-overlap"),Xe=Ne==="always",Pr=i.ar(qt,"icon-overlap","icon-allow-overlap"),qr=Pr==="always",Xr=qt.get("text-rotation-alignment")==="map",gn=qt.get("text-pitch-alignment")==="map",zn=qt.get("icon-text-fit")!=="none",Qn=qt.get("symbol-z-order")==="viewport-y",ai=Xe&&(qr||!Ft.hasIconData()||We),Ti=qr&&(Xe||!Ft.hasTextData()||Pe);!Ft.collisionArrays&&te&&Ft.deserializeCollisionBoxes(te);let Qi=this._getTerrainElevationFunc(this.retainedQueryData[Ft.bucketInstanceId].tileID),Ma=(Aa,Fa,wo)=>{var Yo,Fo;if(pt[Aa.crossTileID])return;if(qn)return void(this.placements[Aa.crossTileID]=new Ci(!1,!1,!1));let xs=!1,Sl=!1,Ll=!0,Ws=null,zl={box:null,placeable:!1,offscreen:null},Fc={placeable:!1},Sc=null,rl=null,nl=null,au=0,wu=0,ih=0;Fa.textFeatureIndex?au=Fa.textFeatureIndex:Aa.useRuntimeCollisionCircles&&(au=Aa.featureIndex),Fa.verticalTextFeatureIndex&&(wu=Fa.verticalTextFeatureIndex);let Et=Fa.textBox;if(Et){let Be=Fr=>{let vn=i.ah.horizontal;if(Ft.allowVerticalPlacement&&!Fr&&this.prevPlacement){let fn=this.prevPlacement.placedOrientations[Aa.crossTileID];fn&&(this.placedOrientations[Aa.crossTileID]=fn,vn=fn,this.markUsedOrientation(Ft,vn,Aa))}return vn},He=(Fr,vn)=>{if(Ft.allowVerticalPlacement&&Aa.numVerticalGlyphVertices>0&&Fa.verticalTextBox){for(let fn of Ft.writingModes)if(fn===i.ah.vertical?(zl=vn(),Fc=zl):zl=Fr(),zl&&zl.placeable)break}else zl=Fr()},hr=Aa.textAnchorOffsetStartIndex,cr=Aa.textAnchorOffsetEndIndex;if(cr===hr){let Fr=(vn,fn)=>{let Bn=this.collisionIndex.placeCollisionBox(vn,Ne,Tn,er,wr,gn,Xr,Ee,Te.predicate,Qi);return Bn&&Bn.placeable&&(this.markUsedOrientation(Ft,fn,Aa),this.placedOrientations[Aa.crossTileID]=fn),Bn};He(()=>Fr(Et,i.ah.horizontal),()=>{let vn=Fa.verticalTextBox;return Ft.allowVerticalPlacement&&Aa.numVerticalGlyphVertices>0&&vn?Fr(vn,i.ah.vertical):{box:null,offscreen:null}}),Be(zl&&zl.placeable)}else{let Fr=i.aq[(Fo=(Yo=this.prevPlacement)===null||Yo===void 0?void 0:Yo.variableOffsets[Aa.crossTileID])===null||Fo===void 0?void 0:Fo.anchor],vn=(Bn,ti,ei)=>{let ra=Bn.x2-Bn.x1,si=Bn.y2-Bn.y1,Oi=Aa.textBoxScale,$i=zn&&Pr==="never"?ti:null,Ki=null,sa=Ne==="never"?1:2,vi="never";Fr&&sa++;for(let no=0;novn(Et,Fa.iconBox,i.ah.horizontal),()=>{let Bn=Fa.verticalTextBox;return Ft.allowVerticalPlacement&&(!zl||!zl.placeable)&&Aa.numVerticalGlyphVertices>0&&Bn?vn(Bn,Fa.verticalIconBox,i.ah.vertical):{box:null,occluded:!0,offscreen:null}}),zl&&(xs=zl.placeable,Ll=zl.offscreen);let fn=Be(zl&&zl.placeable);if(!xs&&this.prevPlacement){let Bn=this.prevPlacement.variableOffsets[Aa.crossTileID];Bn&&(this.variableOffsets[Aa.crossTileID]=Bn,this.markUsedJustification(Ft,Bn.anchor,Aa,fn))}}}if(Sc=zl,xs=Sc&&Sc.placeable,Ll=Sc&&Sc.offscreen,Aa.useRuntimeCollisionCircles){let Be=Ft.text.placedSymbolArray.get(Aa.centerJustifiedTextSymbolIndex),He=i.ai(Ft.textSizeData,le,Be),hr=qt.get("text-padding");rl=this.collisionIndex.placeCollisionCircles(Ne,Be,Ft.lineVertexArray,Ft.glyphOffsetArray,He,er,wr,Gr,Zr,Dt,gn,Te.predicate,Aa.collisionCircleDiameter,hr,Ee,Qi),rl.circles.length&&rl.collisionDetected&&!Dt&&i.w("Collisions detected, but collision boxes are not shown"),xs=Xe||rl.circles.length>0&&!rl.collisionDetected,Ll=Ll&&rl.offscreen}if(Fa.iconFeatureIndex&&(ih=Fa.iconFeatureIndex),Fa.iconBox){let Be=He=>this.collisionIndex.placeCollisionBox(He,Pr,Tn,er,wr,gn,Xr,je,Te.predicate,Qi,zn&&Ws?Ws:void 0);Fc&&Fc.placeable&&Fa.verticalIconBox?(nl=Be(Fa.verticalIconBox),Sl=nl.placeable):(nl=Be(Fa.iconBox),Sl=nl.placeable),Ll=Ll&&nl.offscreen}let Vt=Pe||Aa.numHorizontalGlyphVertices===0&&Aa.numVerticalGlyphVertices===0,de=We||Aa.numIconVertices===0;Vt||de?de?Vt||(Sl=Sl&&xs):xs=Sl&&xs:Sl=xs=Sl&&xs;let Ie=Sl&&nl.placeable;if(xs&&Sc.placeable&&this.collisionIndex.insertCollisionBox(Sc.box,Ne,qt.get("text-ignore-placement"),Ft.bucketInstanceId,Fc&&Fc.placeable&&wu?wu:au,Te.ID),Ie&&this.collisionIndex.insertCollisionBox(nl.box,Pr,qt.get("icon-ignore-placement"),Ft.bucketInstanceId,ih,Te.ID),rl&&xs&&this.collisionIndex.insertCollisionCircles(rl.circles,Ne,qt.get("text-ignore-placement"),Ft.bucketInstanceId,au,Te.ID),Dt&&this.storeCollisionData(Ft.bucketInstanceId,wo,Fa,Sc,nl,rl),Aa.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Ft.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Aa.crossTileID]=new Ci(xs||ai,Sl||Ti,Ll||Ft.justReloaded),pt[Aa.crossTileID]=!0};if(Qn){if(O.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Aa=Ft.getSortedSymbolIndexes(this.transform.angle);for(let Fa=Aa.length-1;Fa>=0;--Fa){let wo=Aa[Fa];Ma(Ft.symbolInstances.get(wo),Ft.collisionArrays[wo],wo)}}else for(let Aa=O.symbolInstanceStart;Aa=0&&(O.text.placedSymbolArray.get(je).crossTileID=qt>=0&&je!==qt?0:Dt.crossTileID)}markUsedOrientation(O,pt,Dt){let Ft=pt===i.ah.horizontal||pt===i.ah.horizontalOnly?pt:0,qt=pt===i.ah.vertical?pt:0,Ee=[Dt.leftJustifiedTextSymbolIndex,Dt.centerJustifiedTextSymbolIndex,Dt.rightJustifiedTextSymbolIndex];for(let je of Ee)O.text.placedSymbolArray.get(je).placedOrientation=Ft;Dt.verticalPlacedTextSymbolIndex&&(O.text.placedSymbolArray.get(Dt.verticalPlacedTextSymbolIndex).placedOrientation=qt)}commit(O){this.commitTime=O,this.zoomAtLastRecencyCheck=this.transform.zoom;let pt=this.prevPlacement,Dt=!1;this.prevZoomAdjustment=pt?pt.zoomAdjustment(this.transform.zoom):0;let Ft=pt?pt.symbolFadeChange(O):1,qt=pt?pt.opacities:{},Ee=pt?pt.variableOffsets:{},je=pt?pt.placedOrientations:{};for(let er in this.placements){let wr=this.placements[er],Gr=qt[er];Gr?(this.opacities[er]=new Gi(Gr,Ft,wr.text,wr.icon),Dt=Dt||wr.text!==Gr.text.placed||wr.icon!==Gr.icon.placed):(this.opacities[er]=new Gi(null,Ft,wr.text,wr.icon,wr.skipFade),Dt=Dt||wr.text||wr.icon)}for(let er in qt){let wr=qt[er];if(!this.opacities[er]){let Gr=new Gi(wr,Ft,!1,!1);Gr.isHidden()||(this.opacities[er]=Gr,Dt=Dt||wr.text.placed||wr.icon.placed)}}for(let er in Ee)this.variableOffsets[er]||!this.opacities[er]||this.opacities[er].isHidden()||(this.variableOffsets[er]=Ee[er]);for(let er in je)this.placedOrientations[er]||!this.opacities[er]||this.opacities[er].isHidden()||(this.placedOrientations[er]=je[er]);if(pt&&pt.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Dt?this.lastPlacementChangeTime=O:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=pt?pt.lastPlacementChangeTime:O)}updateLayerOpacities(O,pt){let Dt={};for(let Ft of pt){let qt=Ft.getBucket(O);qt&&Ft.latestFeatureIndex&&O.id===qt.layerIds[0]&&this.updateBucketOpacities(qt,Ft.tileID,Dt,Ft.collisionBoxArray)}}updateBucketOpacities(O,pt,Dt,Ft){O.hasTextData()&&(O.text.opacityVertexArray.clear(),O.text.hasVisibleVertices=!1),O.hasIconData()&&(O.icon.opacityVertexArray.clear(),O.icon.hasVisibleVertices=!1),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexArray.clear(),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexArray.clear();let qt=O.layers[0],Ee=qt.layout,je=new Gi(null,0,!1,!1,!0),er=Ee.get("text-allow-overlap"),wr=Ee.get("icon-allow-overlap"),Gr=qt._unevaluatedLayout.hasValue("text-variable-anchor")||qt._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Zr=Ee.get("text-rotation-alignment")==="map",Tn=Ee.get("text-pitch-alignment")==="map",qn=Ee.get("icon-text-fit")!=="none",te=new Gi(null,0,er&&(wr||!O.hasIconData()||Ee.get("icon-optional")),wr&&(er||!O.hasTextData()||Ee.get("text-optional")),!0);!O.collisionArrays&&Ft&&(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData())&&O.deserializeCollisionBoxes(Ft);let le=(Pe,We,Ne)=>{for(let Xe=0;Xe0,gn=this.placedOrientations[We.crossTileID],zn=gn===i.ah.vertical,Qn=gn===i.ah.horizontal||gn===i.ah.horizontalOnly;if(Ne>0||Xe>0){let Ti=Zi(qr.text);le(O.text,Ne,zn?Ji:Ti),le(O.text,Xe,Qn?Ji:Ti);let Qi=qr.text.isHidden();[We.rightJustifiedTextSymbolIndex,We.centerJustifiedTextSymbolIndex,We.leftJustifiedTextSymbolIndex].forEach(Fa=>{Fa>=0&&(O.text.placedSymbolArray.get(Fa).hidden=Qi||zn?1:0)}),We.verticalPlacedTextSymbolIndex>=0&&(O.text.placedSymbolArray.get(We.verticalPlacedTextSymbolIndex).hidden=Qi||Qn?1:0);let Ma=this.variableOffsets[We.crossTileID];Ma&&this.markUsedJustification(O,Ma.anchor,We,gn);let Aa=this.placedOrientations[We.crossTileID];Aa&&(this.markUsedJustification(O,"left",We,Aa),this.markUsedOrientation(O,Aa,We))}if(Xr){let Ti=Zi(qr.icon),Qi=!(qn&&We.verticalPlacedIconSymbolIndex&&zn);We.placedIconSymbolIndex>=0&&(le(O.icon,We.numIconVertices,Qi?Ti:Ji),O.icon.placedSymbolArray.get(We.placedIconSymbolIndex).hidden=qr.icon.isHidden()),We.verticalPlacedIconSymbolIndex>=0&&(le(O.icon,We.numVerticalIconVertices,Qi?Ji:Ti),O.icon.placedSymbolArray.get(We.verticalPlacedIconSymbolIndex).hidden=qr.icon.isHidden())}let ai=Te&&Te.has(Pe)?Te.get(Pe):{text:null,icon:null};if(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData()){let Ti=O.collisionArrays[Pe];if(Ti){let Qi=new i.P(0,0);if(Ti.textBox||Ti.verticalTextBox){let Ma=!0;if(Gr){let Aa=this.variableOffsets[Pr];Aa?(Qi=Ke(Aa.anchor,Aa.width,Aa.height,Aa.textOffset,Aa.textBoxScale),Zr&&Qi._rotate(Tn?this.transform.angle:-this.transform.angle)):Ma=!1}if(Ti.textBox||Ti.verticalTextBox){let Aa;Ti.textBox&&(Aa=zn),Ti.verticalTextBox&&(Aa=Qn),vr(O.textCollisionBox.collisionVertexArray,qr.text.placed,!Ma||Aa,ai.text,Qi.x,Qi.y)}}if(Ti.iconBox||Ti.verticalIconBox){let Ma=!!(!Qn&&Ti.verticalIconBox),Aa;Ti.iconBox&&(Aa=Ma),Ti.verticalIconBox&&(Aa=!Ma),vr(O.iconCollisionBox.collisionVertexArray,qr.icon.placed,Aa,ai.icon,qn?Qi.x:0,qn?Qi.y:0)}}}}if(O.sortFeatures(this.transform.angle),this.retainedQueryData[O.bucketInstanceId]&&(this.retainedQueryData[O.bucketInstanceId].featureSortOrder=O.featureSortOrder),O.hasTextData()&&O.text.opacityVertexBuffer&&O.text.opacityVertexBuffer.updateData(O.text.opacityVertexArray),O.hasIconData()&&O.icon.opacityVertexBuffer&&O.icon.opacityVertexBuffer.updateData(O.icon.opacityVertexArray),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexBuffer&&O.iconCollisionBox.collisionVertexBuffer.updateData(O.iconCollisionBox.collisionVertexArray),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexBuffer&&O.textCollisionBox.collisionVertexBuffer.updateData(O.textCollisionBox.collisionVertexArray),O.text.opacityVertexArray.length!==O.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${O.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${O.text.layoutVertexArray.length}) / 4`);if(O.icon.opacityVertexArray.length!==O.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${O.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${O.icon.layoutVertexArray.length}) / 4`);if(O.bucketInstanceId in this.collisionCircleArrays){let Pe=this.collisionCircleArrays[O.bucketInstanceId];O.placementInvProjMatrix=Pe.invProjMatrix,O.placementViewportMatrix=Pe.viewportMatrix,O.collisionCircleArray=Pe.circles,delete this.collisionCircleArrays[O.bucketInstanceId]}}symbolFadeChange(O){return this.fadeDuration===0?1:(O-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(O){return Math.max(0,(this.transform.zoom-O)/1.5)}hasTransitions(O){return this.stale||O-this.lastPlacementChangeTimeO}setStale(){this.stale=!0}}function vr(Kt,O,pt,Dt,Ft,qt){Dt&&Dt.length!==0||(Dt=[0,0,0,0]);let Ee=Dt[0]-pn,je=Dt[1]-pn,er=Dt[2]-pn,wr=Dt[3]-pn;Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,Ee,je),Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,er,je),Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,er,wr),Kt.emplaceBack(O?1:0,pt?1:0,Ft||0,qt||0,Ee,wr)}let Ar=Math.pow(2,25),mn=Math.pow(2,24),Zn=Math.pow(2,17),Un=Math.pow(2,16),Wn=Math.pow(2,9),Li=Math.pow(2,8),Fi=Math.pow(2,1);function Zi(Kt){if(Kt.opacity===0&&!Kt.placed)return 0;if(Kt.opacity===1&&Kt.placed)return 4294967295;let O=Kt.placed?1:0,pt=Math.floor(127*Kt.opacity);return pt*Ar+O*mn+pt*Zn+O*Un+pt*Wn+O*Li+pt*Fi+O}let Ji=0;function ca(){return{isOccluded:(Kt,O,pt)=>!1,getPitchedTextCorrection:(Kt,O,pt)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Kt,O,pt,Dt){throw new Error("Not implemented.")},translatePosition:(Kt,O,pt,Dt)=>function(Ft,qt,Ee,je,er=!1){if(!Ee[0]&&!Ee[1])return[0,0];let wr=er?je==="map"?Ft.angle:0:je==="viewport"?-Ft.angle:0;if(wr){let Gr=Math.sin(wr),Zr=Math.cos(wr);Ee=[Ee[0]*Zr-Ee[1]*Gr,Ee[0]*Gr+Ee[1]*Zr]}return[er?Ee[0]:ui(qt,Ee[0],Ft.zoom),er?Ee[1]:ui(qt,Ee[1],Ft.zoom)]}(Kt,O,pt,Dt),getCircleRadiusCorrection:Kt=>1}}class Ei{constructor(O){this._sortAcrossTiles=O.layout.get("symbol-z-order")!=="viewport-y"&&!O.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(O,pt,Dt,Ft,qt){let Ee=this._bucketParts;for(;this._currentTileIndexje.sortKey-er.sortKey));this._currentPartIndex!this._forceFullPlacement&&c.now()-Ft>2;for(;this._currentPlacementIndex>=0;){let Ee=pt[O[this._currentPlacementIndex]],je=this.placement.collisionIndex.transform.zoom;if(Ee.type==="symbol"&&(!Ee.minzoom||Ee.minzoom<=je)&&(!Ee.maxzoom||Ee.maxzoom>je)){if(this._inProgressLayer||(this._inProgressLayer=new Ei(Ee)),this._inProgressLayer.continuePlacement(Dt[Ee.source],this.placement,this._showCollisionBoxes,Ee,qt))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(O){return this.placement.commit(O),this.placement}}let so=512/i.X/2;class Fe{constructor(O,pt,Dt){this.tileID=O,this.bucketInstanceId=Dt,this._symbolsByKey={};let Ft=new Map;for(let qt=0;qt({x:Math.floor(er.anchorX*so),y:Math.floor(er.anchorY*so)})),crossTileIDs:Ee.map(er=>er.crossTileID)};if(je.positions.length>128){let er=new i.av(je.positions.length,16,Uint16Array);for(let{x:wr,y:Gr}of je.positions)er.add(wr,Gr);er.finish(),delete je.positions,je.index=er}this._symbolsByKey[qt]=je}}getScaledCoordinates(O,pt){let{x:Dt,y:Ft,z:qt}=this.tileID.canonical,{x:Ee,y:je,z:er}=pt.canonical,wr=so/Math.pow(2,er-qt),Gr=(je*i.X+O.anchorY)*wr,Zr=Ft*i.X*so;return{x:Math.floor((Ee*i.X+O.anchorX)*wr-Dt*i.X*so),y:Math.floor(Gr-Zr)}}findMatches(O,pt,Dt){let Ft=this.tileID.canonical.zO)}}class Re{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Kr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(O){let pt=Math.round((O-this.lng)/360);if(pt!==0)for(let Dt in this.indexes){let Ft=this.indexes[Dt],qt={};for(let Ee in Ft){let je=Ft[Ee];je.tileID=je.tileID.unwrapTo(je.tileID.wrap+pt),qt[je.tileID.key]=je}this.indexes[Dt]=qt}this.lng=O}addBucket(O,pt,Dt){if(this.indexes[O.overscaledZ]&&this.indexes[O.overscaledZ][O.key]){if(this.indexes[O.overscaledZ][O.key].bucketInstanceId===pt.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(O.overscaledZ,this.indexes[O.overscaledZ][O.key])}for(let qt=0;qtO.overscaledZ)for(let je in Ee){let er=Ee[je];er.tileID.isChildOf(O)&&er.findMatches(pt.symbolInstances,O,Ft)}else{let je=Ee[O.scaledTo(Number(qt)).key];je&&je.findMatches(pt.symbolInstances,O,Ft)}}for(let qt=0;qt{pt[Dt]=!0});for(let Dt in this.layerIndexes)pt[Dt]||delete this.layerIndexes[Dt]}}let cn=(Kt,O)=>i.t(Kt,O&&O.filter(pt=>pt.identifier!=="source.canvas")),Yr=i.aw();class un extends i.E{constructor(O,pt={}){super(),this._rtlPluginLoaded=()=>{for(let Dt in this.sourceCaches){let Ft=this.sourceCaches[Dt].getSource().type;Ft!=="vector"&&Ft!=="geojson"||this.sourceCaches[Dt].reload()}},this.map=O,this.dispatcher=new it(gt(),O._getMapId()),this.dispatcher.registerMessageHandler("GG",(Dt,Ft)=>this.getGlyphs(Dt,Ft)),this.dispatcher.registerMessageHandler("GI",(Dt,Ft)=>this.getImages(Dt,Ft)),this.imageManager=new S,this.imageManager.setEventedParent(this),this.glyphManager=new V(O._requestManager,pt.localIdeographFontFamily),this.lineAtlas=new tt(256,512),this.crossTileSymbolIndex=new sn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new i.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",i.ay()),be().on(Ot,this._rtlPluginLoaded),this.on("data",Dt=>{if(Dt.dataType!=="source"||Dt.sourceDataType!=="metadata")return;let Ft=this.sourceCaches[Dt.sourceId];if(!Ft)return;let qt=Ft.getSource();if(qt&&qt.vectorLayerIds)for(let Ee in this._layers){let je=this._layers[Ee];je.source===qt.id&&this._validateLayer(je)}})}loadURL(O,pt={},Dt){this.fire(new i.k("dataloading",{dataType:"style"})),pt.validate=typeof pt.validate!="boolean"||pt.validate;let Ft=this.map._requestManager.transformRequest(O,"Style");this._loadStyleRequest=new AbortController;let qt=this._loadStyleRequest;i.h(Ft,this._loadStyleRequest).then(Ee=>{this._loadStyleRequest=null,this._load(Ee.data,pt,Dt)}).catch(Ee=>{this._loadStyleRequest=null,Ee&&!qt.signal.aborted&&this.fire(new i.j(Ee))})}loadJSON(O,pt={},Dt){this.fire(new i.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,c.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,pt.validate=pt.validate!==!1,this._load(O,pt,Dt)}).catch(()=>{})}loadEmpty(){this.fire(new i.k("dataloading",{dataType:"style"})),this._load(Yr,{validate:!1})}_load(O,pt,Dt){var Ft;let qt=pt.transformStyle?pt.transformStyle(Dt,O):O;if(!pt.validate||!cn(this,i.u(qt))){this._loaded=!0,this.stylesheet=qt;for(let Ee in qt.sources)this.addSource(Ee,qt.sources[Ee],{validate:!1});qt.sprite?this._loadSprite(qt.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(qt.glyphs),this._createLayers(),this.light=new H(this.stylesheet.light),this.sky=new G(this.stylesheet.sky),this.map.setTerrain((Ft=this.stylesheet.terrain)!==null&&Ft!==void 0?Ft:null),this.fire(new i.k("data",{dataType:"style"})),this.fire(new i.k("style.load"))}}_createLayers(){let O=i.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",O),this._order=O.map(pt=>pt.id),this._layers={},this._serializedLayers=null;for(let pt of O){let Dt=i.aA(pt);Dt.setEventedParent(this,{layer:{id:pt.id}}),this._layers[pt.id]=Dt}}_loadSprite(O,pt=!1,Dt=void 0){let Ft;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(qt,Ee,je,er){return i._(this,void 0,void 0,function*(){let wr=M(qt),Gr=je>1?"@2x":"",Zr={},Tn={};for(let{id:qn,url:te}of wr){let le=Ee.transformRequest(p(te,Gr,".json"),"SpriteJSON");Zr[qn]=i.h(le,er);let Te=Ee.transformRequest(p(te,Gr,".png"),"SpriteImage");Tn[qn]=d.getImage(Te,er)}return yield Promise.all([...Object.values(Zr),...Object.values(Tn)]),function(qn,te){return i._(this,void 0,void 0,function*(){let le={};for(let Te in qn){le[Te]={};let Pe=c.getImageCanvasContext((yield te[Te]).data),We=(yield qn[Te]).data;for(let Ne in We){let{width:Xe,height:Pr,x:qr,y:Xr,sdf:gn,pixelRatio:zn,stretchX:Qn,stretchY:ai,content:Ti,textFitWidth:Qi,textFitHeight:Ma}=We[Ne];le[Te][Ne]={data:null,pixelRatio:zn,sdf:gn,stretchX:Qn,stretchY:ai,content:Ti,textFitWidth:Qi,textFitHeight:Ma,spriteData:{width:Xe,height:Pr,x:qr,y:Xr,context:Pe}}}}return le})}(Zr,Tn)})}(O,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(qt=>{if(this._spriteRequest=null,qt)for(let Ee in qt){this._spritesImagesIds[Ee]=[];let je=this._spritesImagesIds[Ee]?this._spritesImagesIds[Ee].filter(er=>!(er in qt)):[];for(let er of je)this.imageManager.removeImage(er),this._changedImages[er]=!0;for(let er in qt[Ee]){let wr=Ee==="default"?er:`${Ee}:${er}`;this._spritesImagesIds[Ee].push(wr),wr in this.imageManager.images?this.imageManager.updateImage(wr,qt[Ee][er],!1):this.imageManager.addImage(wr,qt[Ee][er]),pt&&(this._changedImages[wr]=!0)}}}).catch(qt=>{this._spriteRequest=null,Ft=qt,this.fire(new i.j(Ft))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),pt&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"})),Dt&&Dt(Ft)})}_unloadSprite(){for(let O of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(O),this._changedImages[O]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"}))}_validateLayer(O){let pt=this.sourceCaches[O.source];if(!pt)return;let Dt=O.sourceLayer;if(!Dt)return;let Ft=pt.getSource();(Ft.type==="geojson"||Ft.vectorLayerIds&&Ft.vectorLayerIds.indexOf(Dt)===-1)&&this.fire(new i.j(new Error(`Source layer "${Dt}" does not exist on source "${Ft.id}" as specified by style layer "${O.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let O in this.sourceCaches)if(!this.sourceCaches[O].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(O,pt=!1){let Dt=this._serializedAllLayers();if(!O||O.length===0)return Object.values(pt?i.aB(Dt):Dt);let Ft=[];for(let qt of O)if(Dt[qt]){let Ee=pt?i.aB(Dt[qt]):Dt[qt];Ft.push(Ee)}return Ft}_serializedAllLayers(){let O=this._serializedLayers;if(O)return O;O=this._serializedLayers={};let pt=Object.keys(this._layers);for(let Dt of pt){let Ft=this._layers[Dt];Ft.type!=="custom"&&(O[Dt]=Ft.serialize())}return O}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let O in this.sourceCaches)if(this.sourceCaches[O].hasTransition())return!0;for(let O in this._layers)if(this._layers[O].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(O){if(!this._loaded)return;let pt=this._changed;if(pt){let Ft=Object.keys(this._updatedLayers),qt=Object.keys(this._removedLayers);(Ft.length||qt.length)&&this._updateWorkerLayers(Ft,qt);for(let Ee in this._updatedSources){let je=this._updatedSources[Ee];if(je==="reload")this._reloadSource(Ee);else{if(je!=="clear")throw new Error(`Invalid action ${je}`);this._clearSource(Ee)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let Ee in this._updatedPaintProps)this._layers[Ee].updateTransitions(O);this.light.updateTransitions(O),this.sky.updateTransitions(O),this._resetUpdates()}let Dt={};for(let Ft in this.sourceCaches){let qt=this.sourceCaches[Ft];Dt[Ft]=qt.used,qt.used=!1}for(let Ft of this._order){let qt=this._layers[Ft];qt.recalculate(O,this._availableImages),!qt.isHidden(O.zoom)&&qt.source&&(this.sourceCaches[qt.source].used=!0)}for(let Ft in Dt){let qt=this.sourceCaches[Ft];!!Dt[Ft]!=!!qt.used&&qt.fire(new i.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Ft}))}this.light.recalculate(O),this.sky.recalculate(O),this.z=O.zoom,pt&&this.fire(new i.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let O=Object.keys(this._changedImages);if(O.length){for(let pt in this.sourceCaches)this.sourceCaches[pt].reloadTilesForDependencies(["icons","patterns"],O);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let O in this.sourceCaches)this.sourceCaches[O].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(O,pt){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(O,!1),removedIds:pt})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(O,pt={}){var Dt;this._checkLoaded();let Ft=this.serialize();if(O=pt.transformStyle?pt.transformStyle(Ft,O):O,((Dt=pt.validate)===null||Dt===void 0||Dt)&&cn(this,i.u(O)))return!1;(O=i.aB(O)).layers=i.az(O.layers);let qt=i.aC(Ft,O),Ee=this._getOperationsToPerform(qt);if(Ee.unimplemented.length>0)throw new Error(`Unimplemented: ${Ee.unimplemented.join(", ")}.`);if(Ee.operations.length===0)return!1;for(let je of Ee.operations)je();return this.stylesheet=O,this._serializedLayers=null,!0}_getOperationsToPerform(O){let pt=[],Dt=[];for(let Ft of O)switch(Ft.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":pt.push(()=>this.addLayer.apply(this,Ft.args));break;case"removeLayer":pt.push(()=>this.removeLayer.apply(this,Ft.args));break;case"setPaintProperty":pt.push(()=>this.setPaintProperty.apply(this,Ft.args));break;case"setLayoutProperty":pt.push(()=>this.setLayoutProperty.apply(this,Ft.args));break;case"setFilter":pt.push(()=>this.setFilter.apply(this,Ft.args));break;case"addSource":pt.push(()=>this.addSource.apply(this,Ft.args));break;case"removeSource":pt.push(()=>this.removeSource.apply(this,Ft.args));break;case"setLayerZoomRange":pt.push(()=>this.setLayerZoomRange.apply(this,Ft.args));break;case"setLight":pt.push(()=>this.setLight.apply(this,Ft.args));break;case"setGeoJSONSourceData":pt.push(()=>this.setGeoJSONSourceData.apply(this,Ft.args));break;case"setGlyphs":pt.push(()=>this.setGlyphs.apply(this,Ft.args));break;case"setSprite":pt.push(()=>this.setSprite.apply(this,Ft.args));break;case"setSky":pt.push(()=>this.setSky.apply(this,Ft.args));break;case"setTerrain":pt.push(()=>this.map.setTerrain.apply(this,Ft.args));break;case"setTransition":pt.push(()=>{});break;default:Dt.push(Ft.command)}return{operations:pt,unimplemented:Dt}}addImage(O,pt){if(this.getImage(O))return this.fire(new i.j(new Error(`An image named "${O}" already exists.`)));this.imageManager.addImage(O,pt),this._afterImageUpdated(O)}updateImage(O,pt){this.imageManager.updateImage(O,pt)}getImage(O){return this.imageManager.getImage(O)}removeImage(O){if(!this.getImage(O))return this.fire(new i.j(new Error(`An image named "${O}" does not exist.`)));this.imageManager.removeImage(O),this._afterImageUpdated(O)}_afterImageUpdated(O){this._availableImages=this.imageManager.listImages(),this._changedImages[O]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(O,pt,Dt={}){if(this._checkLoaded(),this.sourceCaches[O]!==void 0)throw new Error(`Source "${O}" already exists.`);if(!pt.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(pt).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(pt.type)>=0&&this._validate(i.u.source,`sources.${O}`,pt,null,Dt))return;this.map&&this.map._collectResourceTiming&&(pt.collectResourceTiming=!0);let Ft=this.sourceCaches[O]=new Qe(O,pt,this.dispatcher);Ft.style=this,Ft.setEventedParent(this,()=>({isSourceLoaded:Ft.loaded(),source:Ft.serialize(),sourceId:O})),Ft.onAdd(this.map),this._changed=!0}removeSource(O){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error("There is no source with this ID");for(let Dt in this._layers)if(this._layers[Dt].source===O)return this.fire(new i.j(new Error(`Source "${O}" cannot be removed while layer "${Dt}" is using it.`)));let pt=this.sourceCaches[O];delete this.sourceCaches[O],delete this._updatedSources[O],pt.fire(new i.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:O})),pt.setEventedParent(null),pt.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(O,pt){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error(`There is no source with this ID=${O}`);let Dt=this.sourceCaches[O].getSource();if(Dt.type!=="geojson")throw new Error(`geojsonSource.type is ${Dt.type}, which is !== 'geojson`);Dt.setData(pt),this._changed=!0}getSource(O){return this.sourceCaches[O]&&this.sourceCaches[O].getSource()}addLayer(O,pt,Dt={}){this._checkLoaded();let Ft=O.id;if(this.getLayer(Ft))return void this.fire(new i.j(new Error(`Layer "${Ft}" already exists on this map.`)));let qt;if(O.type==="custom"){if(cn(this,i.aD(O)))return;qt=i.aA(O)}else{if("source"in O&&typeof O.source=="object"&&(this.addSource(Ft,O.source),O=i.aB(O),O=i.e(O,{source:Ft})),this._validate(i.u.layer,`layers.${Ft}`,O,{arrayIndex:-1},Dt))return;qt=i.aA(O),this._validateLayer(qt),qt.setEventedParent(this,{layer:{id:Ft}})}let Ee=pt?this._order.indexOf(pt):this._order.length;if(pt&&Ee===-1)this.fire(new i.j(new Error(`Cannot add layer "${Ft}" before non-existing layer "${pt}".`)));else{if(this._order.splice(Ee,0,Ft),this._layerOrderChanged=!0,this._layers[Ft]=qt,this._removedLayers[Ft]&&qt.source&&qt.type!=="custom"){let je=this._removedLayers[Ft];delete this._removedLayers[Ft],je.type!==qt.type?this._updatedSources[qt.source]="clear":(this._updatedSources[qt.source]="reload",this.sourceCaches[qt.source].pause())}this._updateLayer(qt),qt.onAdd&&qt.onAdd(this.map)}}moveLayer(O,pt){if(this._checkLoaded(),this._changed=!0,!this._layers[O])return void this.fire(new i.j(new Error(`The layer '${O}' does not exist in the map's style and cannot be moved.`)));if(O===pt)return;let Dt=this._order.indexOf(O);this._order.splice(Dt,1);let Ft=pt?this._order.indexOf(pt):this._order.length;pt&&Ft===-1?this.fire(new i.j(new Error(`Cannot move layer "${O}" before non-existing layer "${pt}".`))):(this._order.splice(Ft,0,O),this._layerOrderChanged=!0)}removeLayer(O){this._checkLoaded();let pt=this._layers[O];if(!pt)return void this.fire(new i.j(new Error(`Cannot remove non-existing layer "${O}".`)));pt.setEventedParent(null);let Dt=this._order.indexOf(O);this._order.splice(Dt,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[O]=pt,delete this._layers[O],this._serializedLayers&&delete this._serializedLayers[O],delete this._updatedLayers[O],delete this._updatedPaintProps[O],pt.onRemove&&pt.onRemove(this.map)}getLayer(O){return this._layers[O]}getLayersOrder(){return[...this._order]}hasLayer(O){return O in this._layers}setLayerZoomRange(O,pt,Dt){this._checkLoaded();let Ft=this.getLayer(O);Ft?Ft.minzoom===pt&&Ft.maxzoom===Dt||(pt!=null&&(Ft.minzoom=pt),Dt!=null&&(Ft.maxzoom=Dt),this._updateLayer(Ft)):this.fire(new i.j(new Error(`Cannot set the zoom range of non-existing layer "${O}".`)))}setFilter(O,pt,Dt={}){this._checkLoaded();let Ft=this.getLayer(O);if(Ft){if(!i.aE(Ft.filter,pt))return pt==null?(Ft.filter=void 0,void this._updateLayer(Ft)):void(this._validate(i.u.filter,`layers.${Ft.id}.filter`,pt,null,Dt)||(Ft.filter=i.aB(pt),this._updateLayer(Ft)))}else this.fire(new i.j(new Error(`Cannot filter non-existing layer "${O}".`)))}getFilter(O){return i.aB(this.getLayer(O).filter)}setLayoutProperty(O,pt,Dt,Ft={}){this._checkLoaded();let qt=this.getLayer(O);qt?i.aE(qt.getLayoutProperty(pt),Dt)||(qt.setLayoutProperty(pt,Dt,Ft),this._updateLayer(qt)):this.fire(new i.j(new Error(`Cannot style non-existing layer "${O}".`)))}getLayoutProperty(O,pt){let Dt=this.getLayer(O);if(Dt)return Dt.getLayoutProperty(pt);this.fire(new i.j(new Error(`Cannot get style of non-existing layer "${O}".`)))}setPaintProperty(O,pt,Dt,Ft={}){this._checkLoaded();let qt=this.getLayer(O);qt?i.aE(qt.getPaintProperty(pt),Dt)||(qt.setPaintProperty(pt,Dt,Ft)&&this._updateLayer(qt),this._changed=!0,this._updatedPaintProps[O]=!0,this._serializedLayers=null):this.fire(new i.j(new Error(`Cannot style non-existing layer "${O}".`)))}getPaintProperty(O,pt){return this.getLayer(O).getPaintProperty(pt)}setFeatureState(O,pt){this._checkLoaded();let Dt=O.source,Ft=O.sourceLayer,qt=this.sourceCaches[Dt];if(qt===void 0)return void this.fire(new i.j(new Error(`The source '${Dt}' does not exist in the map's style.`)));let Ee=qt.getSource().type;Ee==="geojson"&&Ft?this.fire(new i.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):Ee!=="vector"||Ft?(O.id===void 0&&this.fire(new i.j(new Error("The feature id parameter must be provided."))),qt.setFeatureState(Ft,O.id,pt)):this.fire(new i.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(O,pt){this._checkLoaded();let Dt=O.source,Ft=this.sourceCaches[Dt];if(Ft===void 0)return void this.fire(new i.j(new Error(`The source '${Dt}' does not exist in the map's style.`)));let qt=Ft.getSource().type,Ee=qt==="vector"?O.sourceLayer:void 0;qt!=="vector"||Ee?pt&&typeof O.id!="string"&&typeof O.id!="number"?this.fire(new i.j(new Error("A feature id is required to remove its specific state property."))):Ft.removeFeatureState(Ee,O.id,pt):this.fire(new i.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(O){this._checkLoaded();let pt=O.source,Dt=O.sourceLayer,Ft=this.sourceCaches[pt];if(Ft!==void 0)return Ft.getSource().type!=="vector"||Dt?(O.id===void 0&&this.fire(new i.j(new Error("The feature id parameter must be provided."))),Ft.getFeatureState(Dt,O.id)):void this.fire(new i.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new i.j(new Error(`The source '${pt}' does not exist in the map's style.`)))}getTransition(){return i.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let O=i.aF(this.sourceCaches,qt=>qt.serialize()),pt=this._serializeByIds(this._order,!0),Dt=this.map.getTerrain()||void 0,Ft=this.stylesheet;return i.aG({version:Ft.version,name:Ft.name,metadata:Ft.metadata,light:Ft.light,sky:Ft.sky,center:Ft.center,zoom:Ft.zoom,bearing:Ft.bearing,pitch:Ft.pitch,sprite:Ft.sprite,glyphs:Ft.glyphs,transition:Ft.transition,sources:O,layers:pt,terrain:Dt},qt=>qt!==void 0)}_updateLayer(O){this._updatedLayers[O.id]=!0,O.source&&!this._updatedSources[O.source]&&this.sourceCaches[O.source].getSource().type!=="raster"&&(this._updatedSources[O.source]="reload",this.sourceCaches[O.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(O){let pt=Ee=>this._layers[Ee].type==="fill-extrusion",Dt={},Ft=[];for(let Ee=this._order.length-1;Ee>=0;Ee--){let je=this._order[Ee];if(pt(je)){Dt[je]=Ee;for(let er of O){let wr=er[je];if(wr)for(let Gr of wr)Ft.push(Gr)}}}Ft.sort((Ee,je)=>je.intersectionZ-Ee.intersectionZ);let qt=[];for(let Ee=this._order.length-1;Ee>=0;Ee--){let je=this._order[Ee];if(pt(je))for(let er=Ft.length-1;er>=0;er--){let wr=Ft[er].feature;if(Dt[wr.layer.id]{let gn=Pe.featureSortOrder;if(gn){let zn=gn.indexOf(qr.featureIndex);return gn.indexOf(Xr.featureIndex)-zn}return Xr.featureIndex-qr.featureIndex});for(let qr of Pr)Xe.push(qr)}}for(let Pe in te)te[Pe].forEach(We=>{let Ne=We.feature,Xe=wr[je[Pe].source].getFeatureState(Ne.layer["source-layer"],Ne.id);Ne.source=Ne.layer.source,Ne.layer["source-layer"]&&(Ne.sourceLayer=Ne.layer["source-layer"]),Ne.state=Xe});return te}(this._layers,Ee,this.sourceCaches,O,pt,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(qt)}querySourceFeatures(O,pt){pt&&pt.filter&&this._validate(i.u.filter,"querySourceFeatures.filter",pt.filter,null,pt);let Dt=this.sourceCaches[O];return Dt?function(Ft,qt){let Ee=Ft.getRenderableIds().map(wr=>Ft.getTileByID(wr)),je=[],er={};for(let wr=0;wrTn.getTileByID(qn)).sort((qn,te)=>te.tileID.overscaledZ-qn.tileID.overscaledZ||(qn.tileID.isLessThan(te.tileID)?-1:1))}let Zr=this.crossTileSymbolIndex.addLayer(Gr,er[Gr.source],O.center.lng);Ee=Ee||Zr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((qt=qt||this._layerOrderChanged||Dt===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c.now(),O.zoom))&&(this.pauseablePlacement=new Ga(O,this.map.terrain,this._order,qt,pt,Dt,Ft,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,er),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c.now()),je=!0),Ee&&this.pauseablePlacement.placement.setStale()),je||Ee)for(let wr of this._order){let Gr=this._layers[wr];Gr.type==="symbol"&&this.placement.updateLayerOpacities(Gr,er[Gr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c.now())}_releaseSymbolFadeTiles(){for(let O in this.sourceCaches)this.sourceCaches[O].releaseSymbolFadeTiles()}getImages(O,pt){return i._(this,void 0,void 0,function*(){let Dt=yield this.imageManager.getImages(pt.icons);this._updateTilesForChangedImages();let Ft=this.sourceCaches[pt.source];return Ft&&Ft.setDependencies(pt.tileID.key,pt.type,pt.icons),Dt})}getGlyphs(O,pt){return i._(this,void 0,void 0,function*(){let Dt=yield this.glyphManager.getGlyphs(pt.stacks),Ft=this.sourceCaches[pt.source];return Ft&&Ft.setDependencies(pt.tileID.key,pt.type,[""]),Dt})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(O,pt={}){this._checkLoaded(),O&&this._validate(i.u.glyphs,"glyphs",O,null,pt)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=O,this.glyphManager.entries={},this.glyphManager.setURL(O))}addSprite(O,pt,Dt={},Ft){this._checkLoaded();let qt=[{id:O,url:pt}],Ee=[...M(this.stylesheet.sprite),...qt];this._validate(i.u.sprite,"sprite",Ee,null,Dt)||(this.stylesheet.sprite=Ee,this._loadSprite(qt,!0,Ft))}removeSprite(O){this._checkLoaded();let pt=M(this.stylesheet.sprite);if(pt.find(Dt=>Dt.id===O)){if(this._spritesImagesIds[O])for(let Dt of this._spritesImagesIds[O])this.imageManager.removeImage(Dt),this._changedImages[Dt]=!0;pt.splice(pt.findIndex(Dt=>Dt.id===O),1),this.stylesheet.sprite=pt.length>0?pt:void 0,delete this._spritesImagesIds[O],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new i.k("data",{dataType:"style"}))}else this.fire(new i.j(new Error(`Sprite "${O}" doesn't exists on this map.`)))}getSprite(){return M(this.stylesheet.sprite)}setSprite(O,pt={},Dt){this._checkLoaded(),O&&this._validate(i.u.sprite,"sprite",O,null,pt)||(this.stylesheet.sprite=O,O?this._loadSprite(O,!0,Dt):(this._unloadSprite(),Dt&&Dt(null)))}}var Pn=i.Y([{name:"a_pos",type:"Int16",components:2}]);let bn={prelude:ze(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -3909,7 +3909,7 @@ uniform ${Gr} ${Zr} u_${Tn}; #endif `}),staticAttributes:Dt,staticUniforms:Ee}}class yr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(O,pt,Dt,Ft,qt,Ee,je,er,wr){this.context=O;let Gr=this.boundPaintVertexBuffers.length!==Ft.length;for(let Zr=0;!Gr&&Zr({u_matrix:Kt,u_texture:0,u_ele_delta:O,u_fog_matrix:pt,u_fog_color:Dt?Dt.properties.get("fog-color"):i.aM.white,u_fog_ground_blend:Dt?Dt.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Dt?Dt.calculateFogBlendOpacity(Ft):0,u_horizon_color:Dt?Dt.properties.get("horizon-color"):i.aM.white,u_horizon_fog_blend:Dt?Dt.properties.get("horizon-fog-blend"):1});function Rn(Kt){let O=[];for(let pt=0;pt({u_depth:new i.aH(qr,Xr.u_depth),u_terrain:new i.aH(qr,Xr.u_terrain),u_terrain_dim:new i.aI(qr,Xr.u_terrain_dim),u_terrain_matrix:new i.aJ(qr,Xr.u_terrain_matrix),u_terrain_unpack:new i.aK(qr,Xr.u_terrain_unpack),u_terrain_exaggeration:new i.aI(qr,Xr.u_terrain_exaggeration)}))(O,Pr),this.binderUniforms=Dt?Dt.getUniforms(O,Pr):[]}draw(O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te,le,Te,Pe,We){let Ne=O.gl;if(this.failedToCreate)return;if(O.program.set(this.program),O.setDepthMode(Dt),O.setStencilMode(Ft),O.setColorMode(qt),O.setCullFace(Ee),er){O.activeTexture.set(Ne.TEXTURE2),Ne.bindTexture(Ne.TEXTURE_2D,er.depthTexture),O.activeTexture.set(Ne.TEXTURE3),Ne.bindTexture(Ne.TEXTURE_2D,er.texture);for(let Pr in this.terrainUniforms)this.terrainUniforms[Pr].set(er[Pr])}for(let Pr in this.fixedUniforms)this.fixedUniforms[Pr].set(je[Pr]);le&&le.setUniforms(O,this.binderUniforms,qn,{zoom:te});let Xe=0;switch(pt){case Ne.LINES:Xe=2;break;case Ne.TRIANGLES:Xe=3;break;case Ne.LINE_STRIP:Xe=1}for(let Pr of Tn.get()){let qr=Pr.vaos||(Pr.vaos={});(qr[wr]||(qr[wr]=new yr)).bind(O,this,Gr,le?le.getPaintVertexBuffers():[],Zr,Pr.vertexOffset,Te,Pe,We),Ne.drawElements(pt,Pr.primitiveLength*Xe,Ne.UNSIGNED_SHORT,Pr.primitiveOffset*Xe*2)}}}function xi(Kt,O,pt){let Dt=1/ui(pt,1,O.transform.tileZoom),Ft=Math.pow(2,pt.tileID.overscaledZ),qt=pt.tileSize*Math.pow(2,O.transform.tileZoom)/Ft,Ee=qt*(pt.tileID.canonical.x+pt.tileID.wrap*Ft),je=qt*pt.tileID.canonical.y;return{u_image:0,u_texsize:pt.imageAtlasTexture.size,u_scale:[Dt,Kt.fromScale,Kt.toScale],u_fade:Kt.t,u_pixel_coord_upper:[Ee>>16,je>>16],u_pixel_coord_lower:[65535&Ee,65535&je]}}let Jn=(Kt,O,pt,Dt)=>{let Ft=O.style.light,qt=Ft.properties.get("position"),Ee=[qt.x,qt.y,qt.z],je=function(){var wr=new i.A(9);return i.A!=Float32Array&&(wr[1]=0,wr[2]=0,wr[3]=0,wr[5]=0,wr[6]=0,wr[7]=0),wr[0]=1,wr[4]=1,wr[8]=1,wr}();Ft.properties.get("anchor")==="viewport"&&function(wr,Gr){var Zr=Math.sin(Gr),Tn=Math.cos(Gr);wr[0]=Tn,wr[1]=Zr,wr[2]=0,wr[3]=-Zr,wr[4]=Tn,wr[5]=0,wr[6]=0,wr[7]=0,wr[8]=1}(je,-O.transform.angle),function(wr,Gr,Zr){var Tn=Gr[0],qn=Gr[1],te=Gr[2];wr[0]=Tn*Zr[0]+qn*Zr[3]+te*Zr[6],wr[1]=Tn*Zr[1]+qn*Zr[4]+te*Zr[7],wr[2]=Tn*Zr[2]+qn*Zr[5]+te*Zr[8]}(Ee,Ee,je);let er=Ft.properties.get("color");return{u_matrix:Kt,u_lightpos:Ee,u_lightintensity:Ft.properties.get("intensity"),u_lightcolor:[er.r,er.g,er.b],u_vertical_gradient:+pt,u_opacity:Dt}},Gn=(Kt,O,pt,Dt,Ft,qt,Ee)=>i.e(Jn(Kt,O,pt,Dt),xi(qt,O,Ee),{u_height_factor:-Math.pow(2,Ft.overscaledZ)/Ee.tileSize/8}),pi=Kt=>({u_matrix:Kt}),Va=(Kt,O,pt,Dt)=>i.e(pi(Kt),xi(pt,O,Dt)),ea=(Kt,O)=>({u_matrix:Kt,u_world:O}),go=(Kt,O,pt,Dt,Ft)=>i.e(Va(Kt,O,pt,Dt),{u_world:Ft}),mo=(Kt,O,pt,Dt)=>{let Ft=Kt.transform,qt,Ee;if(Dt.paint.get("circle-pitch-alignment")==="map"){let je=ui(pt,1,Ft.zoom);qt=!0,Ee=[je,je]}else qt=!1,Ee=Ft.pixelsToGLUnits;return{u_camera_to_center_distance:Ft.cameraToCenterDistance,u_scale_with_map:+(Dt.paint.get("circle-pitch-scale")==="map"),u_matrix:Kt.translatePosMatrix(O.posMatrix,pt,Dt.paint.get("circle-translate"),Dt.paint.get("circle-translate-anchor")),u_pitch_with_map:+qt,u_device_pixel_ratio:Kt.pixelRatio,u_extrude_scale:Ee}},Go=(Kt,O,pt)=>({u_matrix:Kt,u_inv_matrix:O,u_camera_to_center_distance:pt.cameraToCenterDistance,u_viewport_size:[pt.width,pt.height]}),Lo=(Kt,O,pt=1)=>({u_matrix:Kt,u_color:O,u_overlay:0,u_overlay_scale:pt}),Zo=Kt=>({u_matrix:Kt}),Ka=(Kt,O,pt,Dt)=>({u_matrix:Kt,u_extrude_scale:ui(O,1,pt),u_intensity:Dt}),Cs=(Kt,O,pt,Dt)=>{let Ft=i.H();i.aP(Ft,0,Kt.width,Kt.height,0,0,1);let qt=Kt.context.gl;return{u_matrix:Ft,u_world:[qt.drawingBufferWidth,qt.drawingBufferHeight],u_image:pt,u_color_ramp:Dt,u_opacity:O.paint.get("heatmap-opacity")}};function ps(Kt,O){let pt=Math.pow(2,O.canonical.z),Dt=O.canonical.y;return[new i.Z(0,Dt/pt).toLngLat().lat,new i.Z(0,(Dt+1)/pt).toLngLat().lat]}let wl=(Kt,O,pt,Dt)=>{let Ft=Kt.transform;return{u_matrix:ul(Kt,O,pt,Dt),u_ratio:1/ui(O,1,Ft.zoom),u_device_pixel_ratio:Kt.pixelRatio,u_units_to_pixels:[1/Ft.pixelsToGLUnits[0],1/Ft.pixelsToGLUnits[1]]}},is=(Kt,O,pt,Dt,Ft)=>i.e(wl(Kt,O,pt,Ft),{u_image:0,u_image_height:Dt}),ol=(Kt,O,pt,Dt,Ft)=>{let qt=Kt.transform,Ee=kl(O,qt);return{u_matrix:ul(Kt,O,pt,Ft),u_texsize:O.imageAtlasTexture.size,u_ratio:1/ui(O,1,qt.zoom),u_device_pixel_ratio:Kt.pixelRatio,u_image:0,u_scale:[Ee,Dt.fromScale,Dt.toScale],u_fade:Dt.t,u_units_to_pixels:[1/qt.pixelsToGLUnits[0],1/qt.pixelsToGLUnits[1]]}},ms=(Kt,O,pt,Dt,Ft,qt)=>{let Ee=Kt.lineAtlas,je=kl(O,Kt.transform),er=pt.layout.get("line-cap")==="round",wr=Ee.getDash(Dt.from,er),Gr=Ee.getDash(Dt.to,er),Zr=wr.width*Ft.fromScale,Tn=Gr.width*Ft.toScale;return i.e(wl(Kt,O,pt,qt),{u_patternscale_a:[je/Zr,-wr.height/2],u_patternscale_b:[je/Tn,-Gr.height/2],u_sdfgamma:Ee.width/(256*Math.min(Zr,Tn)*Kt.pixelRatio)/2,u_image:0,u_tex_y_a:wr.y,u_tex_y_b:Gr.y,u_mix:Ft.t})};function kl(Kt,O){return 1/ui(Kt,1,O.tileZoom)}function ul(Kt,O,pt,Dt){return Kt.translatePosMatrix(Dt?Dt.posMatrix:O.tileID.posMatrix,O,pt.paint.get("line-translate"),pt.paint.get("line-translate-anchor"))}let Kl=(Kt,O,pt,Dt,Ft)=>{return{u_matrix:Kt,u_tl_parent:O,u_scale_parent:pt,u_buffer_scale:1,u_fade_t:Dt.mix,u_opacity:Dt.opacity*Ft.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ft.paint.get("raster-brightness-min"),u_brightness_high:Ft.paint.get("raster-brightness-max"),u_saturation_factor:(Ee=Ft.paint.get("raster-saturation"),Ee>0?1-1/(1.001-Ee):-Ee),u_contrast_factor:(qt=Ft.paint.get("raster-contrast"),qt>0?1/(1-qt):1+qt),u_spin_weights:vs(Ft.paint.get("raster-hue-rotate"))};var qt,Ee};function vs(Kt){Kt*=Math.PI/180;let O=Math.sin(Kt),pt=Math.cos(Kt);return[(2*pt+1)/3,(-Math.sqrt(3)*O-pt+1)/3,(Math.sqrt(3)*O-pt+1)/3]}let Ns=(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn)=>{let te=Ee.transform;return{u_is_size_zoom_constant:+(Kt==="constant"||Kt==="source"),u_is_size_feature_constant:+(Kt==="constant"||Kt==="camera"),u_size_t:O?O.uSizeT:0,u_size:O?O.uSize:0,u_camera_to_center_distance:te.cameraToCenterDistance,u_pitch:te.pitch/360*2*Math.PI,u_rotate_symbol:+pt,u_aspect_ratio:te.width/te.height,u_fade_change:Ee.options.fadeDuration?Ee.symbolFadeChange:1,u_matrix:je,u_label_plane_matrix:er,u_coord_matrix:wr,u_is_text:+Zr,u_pitch_with_map:+Dt,u_is_along_line:Ft,u_is_variable_anchor:qt,u_texsize:Tn,u_texture:0,u_translation:Gr,u_pitched_scale:qn}},Uo=(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te)=>{let le=Ee.transform;return i.e(Ns(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,te),{u_gamma_scale:Dt?Math.cos(le._pitch)*le.cameraToCenterDistance:1,u_device_pixel_ratio:Ee.pixelRatio,u_is_halo:1})},Ds=(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn)=>i.e(Uo(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,!0,Zr,!0,qn),{u_texsize_icon:Tn,u_texture_icon:1}),Ol=(Kt,O,pt)=>({u_matrix:Kt,u_opacity:O,u_color:pt}),tc=(Kt,O,pt,Dt,Ft,qt)=>i.e(function(Ee,je,er,wr){let Gr=er.imageManager.getPattern(Ee.from.toString()),Zr=er.imageManager.getPattern(Ee.to.toString()),{width:Tn,height:qn}=er.imageManager.getPixelSize(),te=Math.pow(2,wr.tileID.overscaledZ),le=wr.tileSize*Math.pow(2,er.transform.tileZoom)/te,Te=le*(wr.tileID.canonical.x+wr.tileID.wrap*te),Pe=le*wr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Gr.tl,u_pattern_br_a:Gr.br,u_pattern_tl_b:Zr.tl,u_pattern_br_b:Zr.br,u_texsize:[Tn,qn],u_mix:je.t,u_pattern_size_a:Gr.displaySize,u_pattern_size_b:Zr.displaySize,u_scale_a:je.fromScale,u_scale_b:je.toScale,u_tile_units_to_pixels:1/ui(wr,1,er.transform.tileZoom),u_pixel_coord_upper:[Te>>16,Pe>>16],u_pixel_coord_lower:[65535&Te,65535&Pe]}}(Dt,qt,pt,Ft),{u_matrix:Kt,u_opacity:O}),sc={fillExtrusion:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_lightpos:new i.aN(Kt,O.u_lightpos),u_lightintensity:new i.aI(Kt,O.u_lightintensity),u_lightcolor:new i.aN(Kt,O.u_lightcolor),u_vertical_gradient:new i.aI(Kt,O.u_vertical_gradient),u_opacity:new i.aI(Kt,O.u_opacity)}),fillExtrusionPattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_lightpos:new i.aN(Kt,O.u_lightpos),u_lightintensity:new i.aI(Kt,O.u_lightintensity),u_lightcolor:new i.aN(Kt,O.u_lightcolor),u_vertical_gradient:new i.aI(Kt,O.u_vertical_gradient),u_height_factor:new i.aI(Kt,O.u_height_factor),u_image:new i.aH(Kt,O.u_image),u_texsize:new i.aO(Kt,O.u_texsize),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade),u_opacity:new i.aI(Kt,O.u_opacity)}),fill:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix)}),fillPattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_image:new i.aH(Kt,O.u_image),u_texsize:new i.aO(Kt,O.u_texsize),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade)}),fillOutline:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_world:new i.aO(Kt,O.u_world)}),fillOutlinePattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_world:new i.aO(Kt,O.u_world),u_image:new i.aH(Kt,O.u_image),u_texsize:new i.aO(Kt,O.u_texsize),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade)}),circle:(Kt,O)=>({u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_scale_with_map:new i.aH(Kt,O.u_scale_with_map),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_extrude_scale:new i.aO(Kt,O.u_extrude_scale),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_matrix:new i.aJ(Kt,O.u_matrix)}),collisionBox:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_pixel_extrude_scale:new i.aO(Kt,O.u_pixel_extrude_scale)}),collisionCircle:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_inv_matrix:new i.aJ(Kt,O.u_inv_matrix),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_viewport_size:new i.aO(Kt,O.u_viewport_size)}),debug:(Kt,O)=>({u_color:new i.aL(Kt,O.u_color),u_matrix:new i.aJ(Kt,O.u_matrix),u_overlay:new i.aH(Kt,O.u_overlay),u_overlay_scale:new i.aI(Kt,O.u_overlay_scale)}),clippingMask:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix)}),heatmap:(Kt,O)=>({u_extrude_scale:new i.aI(Kt,O.u_extrude_scale),u_intensity:new i.aI(Kt,O.u_intensity),u_matrix:new i.aJ(Kt,O.u_matrix)}),heatmapTexture:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_world:new i.aO(Kt,O.u_world),u_image:new i.aH(Kt,O.u_image),u_color_ramp:new i.aH(Kt,O.u_color_ramp),u_opacity:new i.aI(Kt,O.u_opacity)}),hillshade:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_image:new i.aH(Kt,O.u_image),u_latrange:new i.aO(Kt,O.u_latrange),u_light:new i.aO(Kt,O.u_light),u_shadow:new i.aL(Kt,O.u_shadow),u_highlight:new i.aL(Kt,O.u_highlight),u_accent:new i.aL(Kt,O.u_accent)}),hillshadePrepare:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_image:new i.aH(Kt,O.u_image),u_dimension:new i.aO(Kt,O.u_dimension),u_zoom:new i.aI(Kt,O.u_zoom),u_unpack:new i.aK(Kt,O.u_unpack)}),line:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels)}),lineGradient:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels),u_image:new i.aH(Kt,O.u_image),u_image_height:new i.aI(Kt,O.u_image_height)}),linePattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_texsize:new i.aO(Kt,O.u_texsize),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_image:new i.aH(Kt,O.u_image),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade)}),lineSDF:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels),u_patternscale_a:new i.aO(Kt,O.u_patternscale_a),u_patternscale_b:new i.aO(Kt,O.u_patternscale_b),u_sdfgamma:new i.aI(Kt,O.u_sdfgamma),u_image:new i.aH(Kt,O.u_image),u_tex_y_a:new i.aI(Kt,O.u_tex_y_a),u_tex_y_b:new i.aI(Kt,O.u_tex_y_b),u_mix:new i.aI(Kt,O.u_mix)}),raster:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_tl_parent:new i.aO(Kt,O.u_tl_parent),u_scale_parent:new i.aI(Kt,O.u_scale_parent),u_buffer_scale:new i.aI(Kt,O.u_buffer_scale),u_fade_t:new i.aI(Kt,O.u_fade_t),u_opacity:new i.aI(Kt,O.u_opacity),u_image0:new i.aH(Kt,O.u_image0),u_image1:new i.aH(Kt,O.u_image1),u_brightness_low:new i.aI(Kt,O.u_brightness_low),u_brightness_high:new i.aI(Kt,O.u_brightness_high),u_saturation_factor:new i.aI(Kt,O.u_saturation_factor),u_contrast_factor:new i.aI(Kt,O.u_contrast_factor),u_spin_weights:new i.aN(Kt,O.u_spin_weights)}),symbolIcon:(Kt,O)=>({u_is_size_zoom_constant:new i.aH(Kt,O.u_is_size_zoom_constant),u_is_size_feature_constant:new i.aH(Kt,O.u_is_size_feature_constant),u_size_t:new i.aI(Kt,O.u_size_t),u_size:new i.aI(Kt,O.u_size),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_pitch:new i.aI(Kt,O.u_pitch),u_rotate_symbol:new i.aH(Kt,O.u_rotate_symbol),u_aspect_ratio:new i.aI(Kt,O.u_aspect_ratio),u_fade_change:new i.aI(Kt,O.u_fade_change),u_matrix:new i.aJ(Kt,O.u_matrix),u_label_plane_matrix:new i.aJ(Kt,O.u_label_plane_matrix),u_coord_matrix:new i.aJ(Kt,O.u_coord_matrix),u_is_text:new i.aH(Kt,O.u_is_text),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_is_along_line:new i.aH(Kt,O.u_is_along_line),u_is_variable_anchor:new i.aH(Kt,O.u_is_variable_anchor),u_texsize:new i.aO(Kt,O.u_texsize),u_texture:new i.aH(Kt,O.u_texture),u_translation:new i.aO(Kt,O.u_translation),u_pitched_scale:new i.aI(Kt,O.u_pitched_scale)}),symbolSDF:(Kt,O)=>({u_is_size_zoom_constant:new i.aH(Kt,O.u_is_size_zoom_constant),u_is_size_feature_constant:new i.aH(Kt,O.u_is_size_feature_constant),u_size_t:new i.aI(Kt,O.u_size_t),u_size:new i.aI(Kt,O.u_size),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_pitch:new i.aI(Kt,O.u_pitch),u_rotate_symbol:new i.aH(Kt,O.u_rotate_symbol),u_aspect_ratio:new i.aI(Kt,O.u_aspect_ratio),u_fade_change:new i.aI(Kt,O.u_fade_change),u_matrix:new i.aJ(Kt,O.u_matrix),u_label_plane_matrix:new i.aJ(Kt,O.u_label_plane_matrix),u_coord_matrix:new i.aJ(Kt,O.u_coord_matrix),u_is_text:new i.aH(Kt,O.u_is_text),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_is_along_line:new i.aH(Kt,O.u_is_along_line),u_is_variable_anchor:new i.aH(Kt,O.u_is_variable_anchor),u_texsize:new i.aO(Kt,O.u_texsize),u_texture:new i.aH(Kt,O.u_texture),u_gamma_scale:new i.aI(Kt,O.u_gamma_scale),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_is_halo:new i.aH(Kt,O.u_is_halo),u_translation:new i.aO(Kt,O.u_translation),u_pitched_scale:new i.aI(Kt,O.u_pitched_scale)}),symbolTextAndIcon:(Kt,O)=>({u_is_size_zoom_constant:new i.aH(Kt,O.u_is_size_zoom_constant),u_is_size_feature_constant:new i.aH(Kt,O.u_is_size_feature_constant),u_size_t:new i.aI(Kt,O.u_size_t),u_size:new i.aI(Kt,O.u_size),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_pitch:new i.aI(Kt,O.u_pitch),u_rotate_symbol:new i.aH(Kt,O.u_rotate_symbol),u_aspect_ratio:new i.aI(Kt,O.u_aspect_ratio),u_fade_change:new i.aI(Kt,O.u_fade_change),u_matrix:new i.aJ(Kt,O.u_matrix),u_label_plane_matrix:new i.aJ(Kt,O.u_label_plane_matrix),u_coord_matrix:new i.aJ(Kt,O.u_coord_matrix),u_is_text:new i.aH(Kt,O.u_is_text),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_is_along_line:new i.aH(Kt,O.u_is_along_line),u_is_variable_anchor:new i.aH(Kt,O.u_is_variable_anchor),u_texsize:new i.aO(Kt,O.u_texsize),u_texsize_icon:new i.aO(Kt,O.u_texsize_icon),u_texture:new i.aH(Kt,O.u_texture),u_texture_icon:new i.aH(Kt,O.u_texture_icon),u_gamma_scale:new i.aI(Kt,O.u_gamma_scale),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_is_halo:new i.aH(Kt,O.u_is_halo),u_translation:new i.aO(Kt,O.u_translation),u_pitched_scale:new i.aI(Kt,O.u_pitched_scale)}),background:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_opacity:new i.aI(Kt,O.u_opacity),u_color:new i.aL(Kt,O.u_color)}),backgroundPattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_opacity:new i.aI(Kt,O.u_opacity),u_image:new i.aH(Kt,O.u_image),u_pattern_tl_a:new i.aO(Kt,O.u_pattern_tl_a),u_pattern_br_a:new i.aO(Kt,O.u_pattern_br_a),u_pattern_tl_b:new i.aO(Kt,O.u_pattern_tl_b),u_pattern_br_b:new i.aO(Kt,O.u_pattern_br_b),u_texsize:new i.aO(Kt,O.u_texsize),u_mix:new i.aI(Kt,O.u_mix),u_pattern_size_a:new i.aO(Kt,O.u_pattern_size_a),u_pattern_size_b:new i.aO(Kt,O.u_pattern_size_b),u_scale_a:new i.aI(Kt,O.u_scale_a),u_scale_b:new i.aI(Kt,O.u_scale_b),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_tile_units_to_pixels:new i.aI(Kt,O.u_tile_units_to_pixels)}),terrain:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_texture:new i.aH(Kt,O.u_texture),u_ele_delta:new i.aI(Kt,O.u_ele_delta),u_fog_matrix:new i.aJ(Kt,O.u_fog_matrix),u_fog_color:new i.aL(Kt,O.u_fog_color),u_fog_ground_blend:new i.aI(Kt,O.u_fog_ground_blend),u_fog_ground_blend_opacity:new i.aI(Kt,O.u_fog_ground_blend_opacity),u_horizon_color:new i.aL(Kt,O.u_horizon_color),u_horizon_fog_blend:new i.aI(Kt,O.u_horizon_fog_blend)}),terrainDepth:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ele_delta:new i.aI(Kt,O.u_ele_delta)}),terrainCoords:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_texture:new i.aH(Kt,O.u_texture),u_terrain_coords_id:new i.aI(Kt,O.u_terrain_coords_id),u_ele_delta:new i.aI(Kt,O.u_ele_delta)}),sky:(Kt,O)=>({u_sky_color:new i.aL(Kt,O.u_sky_color),u_horizon_color:new i.aL(Kt,O.u_horizon_color),u_horizon:new i.aI(Kt,O.u_horizon),u_sky_horizon_blend:new i.aI(Kt,O.u_sky_horizon_blend)})};class Xs{constructor(O,pt,Dt){this.context=O;let Ft=O.gl;this.buffer=Ft.createBuffer(),this.dynamicDraw=!!Dt,this.context.unbindVAO(),O.bindElementBuffer.set(this.buffer),Ft.bufferData(Ft.ELEMENT_ARRAY_BUFFER,pt.arrayBuffer,this.dynamicDraw?Ft.DYNAMIC_DRAW:Ft.STATIC_DRAW),this.dynamicDraw||delete pt.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(O){let pt=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),pt.bufferSubData(pt.ELEMENT_ARRAY_BUFFER,0,O.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Wa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Co{constructor(O,pt,Dt,Ft){this.length=pt.length,this.attributes=Dt,this.itemSize=pt.bytesPerElement,this.dynamicDraw=Ft,this.context=O;let qt=O.gl;this.buffer=qt.createBuffer(),O.bindVertexBuffer.set(this.buffer),qt.bufferData(qt.ARRAY_BUFFER,pt.arrayBuffer,this.dynamicDraw?qt.DYNAMIC_DRAW:qt.STATIC_DRAW),this.dynamicDraw||delete pt.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(O){if(O.length!==this.length)throw new Error(`Length of new data is ${O.length}, which doesn't match current length of ${this.length}`);let pt=this.context.gl;this.bind(),pt.bufferSubData(pt.ARRAY_BUFFER,0,O.arrayBuffer)}enableAttributes(O,pt){for(let Dt=0;Dt0){let qr=i.H();i.aQ(qr,Ne.placementInvProjMatrix,Kt.transform.glCoordMatrix),i.aQ(qr,qr,Ne.placementViewportMatrix),er.push({circleArray:Pr,circleOffset:Gr,transform:We.posMatrix,invTransform:qr,coord:We}),wr+=Pr.length/4,Gr=wr}Xe&&je.draw(qt,Ee.LINES,hl.disabled,Hl.disabled,Kt.colorModeForRenderPass(),cs.disabled,{u_matrix:We.posMatrix,u_pixel_extrude_scale:[1/(Zr=Kt.transform).width,1/Zr.height]},Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(We),pt.id,Xe.layoutVertexBuffer,Xe.indexBuffer,Xe.segments,null,Kt.transform.zoom,null,null,Xe.collisionVertexBuffer)}var Zr;if(!Ft||!er.length)return;let Tn=Kt.useProgram("collisionCircle"),qn=new i.aR;qn.resize(4*wr),qn._trim();let te=0;for(let Pe of er)for(let We=0;We=0&&(Pe[Ne.associatedIconIndex]={shiftedAnchor:wo,angle:Yo})}else zr(Ne.numGlyphs,le)}if(wr){Te.clear();let We=Kt.icon.placedSymbolArray;for(let Ne=0;NeKt.style.map.terrain.getElevation(ai,ei,ra):null,ti=pt.layout.get("text-rotation-alignment")==="map";zt(Qi,ai.posMatrix,Kt,Ft,wu,Et,Pe,wr,ti,le,ai.toUnwrapped(),te.width,te.height,Vt,Bn)}let Be=ai.posMatrix,He=Ft&&gn||Ie,hr=We||He?hu:wu,cr=ih,Fr=Fa&&pt.paint.get(Ft?"text-halo-width":"icon-halo-width").constantOr(1)!==0,vn;vn=Fa?Qi.iconsInText?Ds(wo.kind,xs,Ne,Pe,We,He,Kt,Be,hr,cr,Vt,Ll,Sc,Qn):Uo(wo.kind,xs,Ne,Pe,We,He,Kt,Be,hr,cr,Vt,Ft,Ll,!0,Qn):Ns(wo.kind,xs,Ne,Pe,We,He,Kt,Be,hr,cr,Vt,Ft,Ll,Qn);let fn={program:Fo,buffers:Ma,uniformValues:vn,atlasTexture:Ws,atlasTextureIcon:rl,atlasInterpolation:zl,atlasInterpolationIcon:Fc,isSDF:Fa,hasHalo:Fr};if(Pr&&Qi.canOverlap){qr=!0;let Bn=Ma.segments.get();for(let ti of Bn)zn.push({segments:new i.a0([ti]),sortKey:ti.sortKey,state:fn,terrainData:Sl})}else zn.push({segments:Ma.segments,sortKey:0,state:fn,terrainData:Sl})}qr&&zn.sort((ai,Ti)=>ai.sortKey-Ti.sortKey);for(let ai of zn){let Ti=ai.state;if(Tn.activeTexture.set(qn.TEXTURE0),Ti.atlasTexture.bind(Ti.atlasInterpolation,qn.CLAMP_TO_EDGE),Ti.atlasTextureIcon&&(Tn.activeTexture.set(qn.TEXTURE1),Ti.atlasTextureIcon&&Ti.atlasTextureIcon.bind(Ti.atlasInterpolationIcon,qn.CLAMP_TO_EDGE)),Ti.isSDF){let Qi=Ti.uniformValues;Ti.hasHalo&&(Qi.u_is_halo=1,hf(Ti.buffers,ai.segments,pt,Kt,Ti.program,Xr,Gr,Zr,Qi,ai.terrainData)),Qi.u_is_halo=0}hf(Ti.buffers,ai.segments,pt,Kt,Ti.program,Xr,Gr,Zr,Ti.uniformValues,ai.terrainData)}}function hf(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr){let Gr=Dt.context;Ft.draw(Gr,Gr.gl.TRIANGLES,qt,Ee,je,cs.disabled,er,wr,pt.id,Kt.layoutVertexBuffer,Kt.indexBuffer,O,pt.paint,Dt.transform.zoom,Kt.programConfigurations.get(pt.id),Kt.dynamicLayoutVertexBuffer,Kt.opacityVertexBuffer)}function Ld(Kt,O,pt,Dt){let Ft=Kt.context,qt=Ft.gl,Ee=Hl.disabled,je=new Lc([qt.ONE,qt.ONE],i.aM.transparent,[!0,!0,!0,!0]),er=O.getBucket(pt);if(!er)return;let wr=Dt.key,Gr=pt.heatmapFbos.get(wr);Gr||(Gr=nf(Ft,O.tileSize,O.tileSize),pt.heatmapFbos.set(wr,Gr)),Ft.bindFramebuffer.set(Gr.framebuffer),Ft.viewport.set([0,0,O.tileSize,O.tileSize]),Ft.clear({color:i.aM.transparent});let Zr=er.programConfigurations.get(pt.id),Tn=Kt.useProgram("heatmap",Zr),qn=Kt.style.map.terrain.getTerrainData(Dt);Tn.draw(Ft,qt.TRIANGLES,hl.disabled,Ee,je,cs.disabled,Ka(Dt.posMatrix,O,Kt.transform.zoom,pt.paint.get("heatmap-intensity")),qn,pt.id,er.layoutVertexBuffer,er.indexBuffer,er.segments,pt.paint,Kt.transform.zoom,Zr)}function ed(Kt,O,pt){let Dt=Kt.context,Ft=Dt.gl;Dt.setColorMode(Kt.colorModeForRenderPass());let qt=af(Dt,O),Ee=pt.key,je=O.heatmapFbos.get(Ee);je&&(Dt.activeTexture.set(Ft.TEXTURE0),Ft.bindTexture(Ft.TEXTURE_2D,je.colorAttachment.get()),Dt.activeTexture.set(Ft.TEXTURE1),qt.bind(Ft.LINEAR,Ft.CLAMP_TO_EDGE),Kt.useProgram("heatmapTexture").draw(Dt,Ft.TRIANGLES,hl.disabled,Hl.disabled,Kt.colorModeForRenderPass(),cs.disabled,Cs(Kt,O,0,1),null,O.id,Kt.rasterBoundsBuffer,Kt.quadTriangleIndexBuffer,Kt.rasterBoundsSegments,O.paint,Kt.transform.zoom),je.destroy(),O.heatmapFbos.delete(Ee))}function nf(Kt,O,pt){var Dt,Ft;let qt=Kt.gl,Ee=qt.createTexture();qt.bindTexture(qt.TEXTURE_2D,Ee),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,qt.CLAMP_TO_EDGE),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,qt.CLAMP_TO_EDGE),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,qt.LINEAR),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MAG_FILTER,qt.LINEAR);let je=(Dt=Kt.HALF_FLOAT)!==null&&Dt!==void 0?Dt:qt.UNSIGNED_BYTE,er=(Ft=Kt.RGBA16F)!==null&&Ft!==void 0?Ft:qt.RGBA;qt.texImage2D(qt.TEXTURE_2D,0,er,O,pt,0,qt.RGBA,je,null);let wr=Kt.createFramebuffer(O,pt,!1,!1);return wr.colorAttachment.set(Ee),wr}function af(Kt,O){return O.colorRampTexture||(O.colorRampTexture=new g(Kt,O.colorRamp,Kt.gl.RGBA)),O.colorRampTexture}function bh(Kt,O,pt,Dt,Ft){if(!pt||!Dt||!Dt.imageAtlas)return;let qt=Dt.imageAtlas.patternPositions,Ee=qt[pt.to.toString()],je=qt[pt.from.toString()];if(!Ee&&je&&(Ee=je),!je&&Ee&&(je=Ee),!Ee||!je){let er=Ft.getPaintProperty(O);Ee=qt[er],je=qt[er]}Ee&&je&&Kt.setConstantPatternPositions(Ee,je)}function df(Kt,O,pt,Dt,Ft,qt,Ee){let je=Kt.context.gl,er="fill-pattern",wr=pt.paint.get(er),Gr=wr&&wr.constantOr(1),Zr=pt.getCrossfadeParameters(),Tn,qn,te,le,Te;Ee?(qn=Gr&&!pt.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Tn=je.LINES):(qn=Gr?"fillPattern":"fill",Tn=je.TRIANGLES);let Pe=wr.constantOr(null);for(let We of Dt){let Ne=O.getTile(We);if(Gr&&!Ne.patternsLoaded())continue;let Xe=Ne.getBucket(pt);if(!Xe)continue;let Pr=Xe.programConfigurations.get(pt.id),qr=Kt.useProgram(qn,Pr),Xr=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(We);Gr&&(Kt.context.activeTexture.set(je.TEXTURE0),Ne.imageAtlasTexture.bind(je.LINEAR,je.CLAMP_TO_EDGE),Pr.updatePaintBuffers(Zr)),bh(Pr,er,Pe,Ne,pt);let gn=Xr?We:null,zn=Kt.translatePosMatrix(gn?gn.posMatrix:We.posMatrix,Ne,pt.paint.get("fill-translate"),pt.paint.get("fill-translate-anchor"));if(Ee){le=Xe.indexBuffer2,Te=Xe.segments2;let Qn=[je.drawingBufferWidth,je.drawingBufferHeight];te=qn==="fillOutlinePattern"&&Gr?go(zn,Kt,Zr,Ne,Qn):ea(zn,Qn)}else le=Xe.indexBuffer,Te=Xe.segments,te=Gr?Va(zn,Kt,Zr,Ne):pi(zn);qr.draw(Kt.context,Tn,Ft,Kt.stencilModeForClipping(We),qt,cs.disabled,te,Xr,pt.id,Xe.layoutVertexBuffer,le,Te,pt.paint,Kt.transform.zoom,Pr)}}function Uh(Kt,O,pt,Dt,Ft,qt,Ee){let je=Kt.context,er=je.gl,wr="fill-extrusion-pattern",Gr=pt.paint.get(wr),Zr=Gr.constantOr(1),Tn=pt.getCrossfadeParameters(),qn=pt.paint.get("fill-extrusion-opacity"),te=Gr.constantOr(null);for(let le of Dt){let Te=O.getTile(le),Pe=Te.getBucket(pt);if(!Pe)continue;let We=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(le),Ne=Pe.programConfigurations.get(pt.id),Xe=Kt.useProgram(Zr?"fillExtrusionPattern":"fillExtrusion",Ne);Zr&&(Kt.context.activeTexture.set(er.TEXTURE0),Te.imageAtlasTexture.bind(er.LINEAR,er.CLAMP_TO_EDGE),Ne.updatePaintBuffers(Tn)),bh(Ne,wr,te,Te,pt);let Pr=Kt.translatePosMatrix(le.posMatrix,Te,pt.paint.get("fill-extrusion-translate"),pt.paint.get("fill-extrusion-translate-anchor")),qr=pt.paint.get("fill-extrusion-vertical-gradient"),Xr=Zr?Gn(Pr,Kt,qr,qn,le,Tn,Te):Jn(Pr,Kt,qr,qn);Xe.draw(je,je.gl.TRIANGLES,Ft,qt,Ee,cs.backCCW,Xr,We,pt.id,Pe.layoutVertexBuffer,Pe.indexBuffer,Pe.segments,pt.paint,Kt.transform.zoom,Ne,Kt.style.map.terrain&&Pe.centroidVertexBuffer)}}function Mh(Kt,O,pt,Dt,Ft,qt,Ee){let je=Kt.context,er=je.gl,wr=pt.fbo;if(!wr)return;let Gr=Kt.useProgram("hillshade"),Zr=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(O);je.activeTexture.set(er.TEXTURE0),er.bindTexture(er.TEXTURE_2D,wr.colorAttachment.get()),Gr.draw(je,er.TRIANGLES,Ft,qt,Ee,cs.disabled,((Tn,qn,te,le)=>{let Te=te.paint.get("hillshade-shadow-color"),Pe=te.paint.get("hillshade-highlight-color"),We=te.paint.get("hillshade-accent-color"),Ne=te.paint.get("hillshade-illumination-direction")*(Math.PI/180);te.paint.get("hillshade-illumination-anchor")==="viewport"&&(Ne-=Tn.transform.angle);let Xe=!Tn.options.moving;return{u_matrix:le?le.posMatrix:Tn.transform.calculatePosMatrix(qn.tileID.toUnwrapped(),Xe),u_image:0,u_latrange:ps(0,qn.tileID),u_light:[te.paint.get("hillshade-exaggeration"),Ne],u_shadow:Te,u_highlight:Pe,u_accent:We}})(Kt,pt,Dt,Zr?O:null),Zr,Dt.id,Kt.rasterBoundsBuffer,Kt.quadTriangleIndexBuffer,Kt.rasterBoundsSegments)}function yu(Kt,O,pt,Dt,Ft,qt){let Ee=Kt.context,je=Ee.gl,er=O.dem;if(er&&er.data){let wr=er.dim,Gr=er.stride,Zr=er.getPixels();if(Ee.activeTexture.set(je.TEXTURE1),Ee.pixelStoreUnpackPremultiplyAlpha.set(!1),O.demTexture=O.demTexture||Kt.getTileTexture(Gr),O.demTexture){let qn=O.demTexture;qn.update(Zr,{premultiply:!1}),qn.bind(je.NEAREST,je.CLAMP_TO_EDGE)}else O.demTexture=new g(Ee,Zr,je.RGBA,{premultiply:!1}),O.demTexture.bind(je.NEAREST,je.CLAMP_TO_EDGE);Ee.activeTexture.set(je.TEXTURE0);let Tn=O.fbo;if(!Tn){let qn=new g(Ee,{width:wr,height:wr,data:null},je.RGBA);qn.bind(je.LINEAR,je.CLAMP_TO_EDGE),Tn=O.fbo=Ee.createFramebuffer(wr,wr,!0,!1),Tn.colorAttachment.set(qn.texture)}Ee.bindFramebuffer.set(Tn.framebuffer),Ee.viewport.set([0,0,wr,wr]),Kt.useProgram("hillshadePrepare").draw(Ee,je.TRIANGLES,Dt,Ft,qt,cs.disabled,((qn,te)=>{let le=te.stride,Te=i.H();return i.aP(Te,0,i.X,-i.X,0,0,1),i.J(Te,Te,[0,-i.X,0]),{u_matrix:Te,u_image:1,u_dimension:[le,le],u_zoom:qn.overscaledZ,u_unpack:te.getUnpackVector()}})(O.tileID,er),null,pt.id,Kt.rasterBoundsBuffer,Kt.quadTriangleIndexBuffer,Kt.rasterBoundsSegments),O.needsHillshadePrepare=!1}}function fd(Kt,O,pt,Dt,Ft,qt){let Ee=Dt.paint.get("raster-fade-duration");if(!qt&&Ee>0){let je=c.now(),er=(je-Kt.timeAdded)/Ee,wr=O?(je-O.timeAdded)/Ee:-1,Gr=pt.getSource(),Zr=Ft.coveringZoomLevel({tileSize:Gr.tileSize,roundZoom:Gr.roundZoom}),Tn=!O||Math.abs(O.tileID.overscaledZ-Zr)>Math.abs(Kt.tileID.overscaledZ-Zr),qn=Tn&&Kt.refreshedUponExpiration?1:i.ac(Tn?er:1-wr,0,1);return Kt.refreshedUponExpiration&&er>=1&&(Kt.refreshedUponExpiration=!1),O?{opacity:1,mix:1-qn}:{opacity:qn,mix:0}}return{opacity:1,mix:0}}let of=new i.aM(1,0,0,1),uc=new i.aM(0,1,0,1),jd=new i.aM(0,0,1,1),Jf=new i.aM(1,0,1,1),ff=new i.aM(0,1,1,1);function Pd(Kt,O,pt,Dt){Xu(Kt,0,O+pt/2,Kt.transform.width,pt,Dt)}function pf(Kt,O,pt,Dt){Xu(Kt,O-pt/2,0,pt,Kt.transform.height,Dt)}function Xu(Kt,O,pt,Dt,Ft,qt){let Ee=Kt.context,je=Ee.gl;je.enable(je.SCISSOR_TEST),je.scissor(O*Kt.pixelRatio,pt*Kt.pixelRatio,Dt*Kt.pixelRatio,Ft*Kt.pixelRatio),Ee.clear({color:qt}),je.disable(je.SCISSOR_TEST)}function mf(Kt,O,pt){let Dt=Kt.context,Ft=Dt.gl,qt=pt.posMatrix,Ee=Kt.useProgram("debug"),je=hl.disabled,er=Hl.disabled,wr=Kt.colorModeForRenderPass(),Gr="$debug",Zr=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(pt);Dt.activeTexture.set(Ft.TEXTURE0);let Tn=O.getTileByID(pt.key).latestRawTileData,qn=Math.floor((Tn&&Tn.byteLength||0)/1024),te=O.getTile(pt).tileSize,le=512/Math.min(te,512)*(pt.overscaledZ/Kt.transform.zoom)*.5,Te=pt.canonical.toString();pt.overscaledZ!==pt.canonical.z&&(Te+=` => ${pt.overscaledZ}`),function(Pe,We){Pe.initDebugOverlayCanvas();let Ne=Pe.debugOverlayCanvas,Xe=Pe.context.gl,Pr=Pe.debugOverlayCanvas.getContext("2d");Pr.clearRect(0,0,Ne.width,Ne.height),Pr.shadowColor="white",Pr.shadowBlur=2,Pr.lineWidth=1.5,Pr.strokeStyle="white",Pr.textBaseline="top",Pr.font="bold 36px Open Sans, sans-serif",Pr.fillText(We,5,5),Pr.strokeText(We,5,5),Pe.debugOverlayTexture.update(Ne),Pe.debugOverlayTexture.bind(Xe.LINEAR,Xe.CLAMP_TO_EDGE)}(Kt,`${Te} ${qn}kB`),Ee.draw(Dt,Ft.TRIANGLES,je,er,Lc.alphaBlended,cs.disabled,Lo(qt,i.aM.transparent,le),null,Gr,Kt.debugBuffer,Kt.quadTriangleIndexBuffer,Kt.debugSegments),Ee.draw(Dt,Ft.LINE_STRIP,je,er,wr,cs.disabled,Lo(qt,i.aM.red),Zr,Gr,Kt.debugBuffer,Kt.tileBorderIndexBuffer,Kt.debugSegments)}function Vc(Kt,O,pt){let Dt=Kt.context,Ft=Dt.gl,qt=Kt.colorModeForRenderPass(),Ee=new hl(Ft.LEQUAL,hl.ReadWrite,Kt.depthRangeFor3D),je=Kt.useProgram("terrain"),er=O.getTerrainMesh();Dt.bindFramebuffer.set(null),Dt.viewport.set([0,0,Kt.width,Kt.height]);for(let wr of pt){let Gr=Kt.renderToTexture.getTexture(wr),Zr=O.getTerrainData(wr.tileID);Dt.activeTexture.set(Ft.TEXTURE0),Ft.bindTexture(Ft.TEXTURE_2D,Gr.texture);let Tn=Kt.transform.calculatePosMatrix(wr.tileID.toUnwrapped()),qn=O.getMeshFrameDelta(Kt.transform.zoom),te=Kt.transform.calculateFogMatrix(wr.tileID.toUnwrapped()),le=en(Tn,qn,te,Kt.style.sky,Kt.transform.pitch);je.draw(Dt,Ft.TRIANGLES,Ee,Hl.disabled,qt,cs.backCCW,le,Zr,"terrain",er.vertexBuffer,er.indexBuffer,er.segments)}}class Ju{constructor(O,pt,Dt){this.vertexBuffer=O,this.indexBuffer=pt,this.segments=Dt}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class rd{constructor(O,pt){this.context=new Xf(O),this.transform=pt,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:i.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Qe.maxUnderzooming+Qe.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new sn}resize(O,pt,Dt){if(this.width=Math.floor(O*Dt),this.height=Math.floor(pt*Dt),this.pixelRatio=Dt,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Ft of this.style._order)this.style._layers[Ft].resize()}setup(){let O=this.context,pt=new i.aX;pt.emplaceBack(0,0),pt.emplaceBack(i.X,0),pt.emplaceBack(0,i.X),pt.emplaceBack(i.X,i.X),this.tileExtentBuffer=O.createVertexBuffer(pt,Pn.members),this.tileExtentSegments=i.a0.simpleSegment(0,0,4,2);let Dt=new i.aX;Dt.emplaceBack(0,0),Dt.emplaceBack(i.X,0),Dt.emplaceBack(0,i.X),Dt.emplaceBack(i.X,i.X),this.debugBuffer=O.createVertexBuffer(Dt,Pn.members),this.debugSegments=i.a0.simpleSegment(0,0,4,5);let Ft=new i.$;Ft.emplaceBack(0,0,0,0),Ft.emplaceBack(i.X,0,i.X,0),Ft.emplaceBack(0,i.X,0,i.X),Ft.emplaceBack(i.X,i.X,i.X,i.X),this.rasterBoundsBuffer=O.createVertexBuffer(Ft,ee.members),this.rasterBoundsSegments=i.a0.simpleSegment(0,0,4,2);let qt=new i.aX;qt.emplaceBack(0,0),qt.emplaceBack(1,0),qt.emplaceBack(0,1),qt.emplaceBack(1,1),this.viewportBuffer=O.createVertexBuffer(qt,Pn.members),this.viewportSegments=i.a0.simpleSegment(0,0,4,2);let Ee=new i.aZ;Ee.emplaceBack(0),Ee.emplaceBack(1),Ee.emplaceBack(3),Ee.emplaceBack(2),Ee.emplaceBack(0),this.tileBorderIndexBuffer=O.createIndexBuffer(Ee);let je=new i.aY;je.emplaceBack(0,1,2),je.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=O.createIndexBuffer(je);let er=this.context.gl;this.stencilClearMode=new Hl({func:er.ALWAYS,mask:0},0,255,er.ZERO,er.ZERO,er.ZERO)}clearStencil(){let O=this.context,pt=O.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let Dt=i.H();i.aP(Dt,0,this.width,this.height,0,0,1),i.K(Dt,Dt,[pt.drawingBufferWidth,pt.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(O,pt.TRIANGLES,hl.disabled,this.stencilClearMode,Lc.disabled,cs.disabled,Zo(Dt),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(O,pt){if(this.currentStencilSource===O.source||!O.isTileClipped()||!pt||!pt.length)return;this.currentStencilSource=O.source;let Dt=this.context,Ft=Dt.gl;this.nextStencilID+pt.length>256&&this.clearStencil(),Dt.setColorMode(Lc.disabled),Dt.setDepthMode(hl.disabled);let qt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let Ee of pt){let je=this._tileClippingMaskIDs[Ee.key]=this.nextStencilID++,er=this.style.map.terrain&&this.style.map.terrain.getTerrainData(Ee);qt.draw(Dt,Ft.TRIANGLES,hl.disabled,new Hl({func:Ft.ALWAYS,mask:0},je,255,Ft.KEEP,Ft.KEEP,Ft.REPLACE),Lc.disabled,cs.disabled,Zo(Ee.posMatrix),er,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let O=this.nextStencilID++,pt=this.context.gl;return new Hl({func:pt.NOTEQUAL,mask:255},O,255,pt.KEEP,pt.KEEP,pt.REPLACE)}stencilModeForClipping(O){let pt=this.context.gl;return new Hl({func:pt.EQUAL,mask:255},this._tileClippingMaskIDs[O.key],0,pt.KEEP,pt.KEEP,pt.REPLACE)}stencilConfigForOverlap(O){let pt=this.context.gl,Dt=O.sort((Ee,je)=>je.overscaledZ-Ee.overscaledZ),Ft=Dt[Dt.length-1].overscaledZ,qt=Dt[0].overscaledZ-Ft+1;if(qt>1){this.currentStencilSource=void 0,this.nextStencilID+qt>256&&this.clearStencil();let Ee={};for(let je=0;je({u_sky_color:Pe.properties.get("sky-color"),u_horizon_color:Pe.properties.get("horizon-color"),u_horizon:(We.height/2+We.getHorizon())*Ne,u_sky_horizon_blend:Pe.properties.get("sky-horizon-blend")*We.height/2*Ne}))(wr,er.style.map.transform,er.pixelRatio),qn=new hl(Zr.LEQUAL,hl.ReadWrite,[0,1]),te=Hl.disabled,le=er.colorModeForRenderPass(),Te=er.useProgram("sky");if(!wr.mesh){let Pe=new i.aX;Pe.emplaceBack(-1,-1),Pe.emplaceBack(1,-1),Pe.emplaceBack(1,1),Pe.emplaceBack(-1,1);let We=new i.aY;We.emplaceBack(0,1,2),We.emplaceBack(0,2,3),wr.mesh=new Ju(Gr.createVertexBuffer(Pe,Pn.members),Gr.createIndexBuffer(We),i.a0.simpleSegment(0,0,Pe.length,We.length))}Te.draw(Gr,Zr.TRIANGLES,qn,te,le,cs.disabled,Tn,void 0,"sky",wr.mesh.vertexBuffer,wr.mesh.indexBuffer,wr.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=pt.showOverdrawInspector,this.depthRangeFor3D=[0,1-(O._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Dt.length-1;this.currentLayer>=0;this.currentLayer--){let er=this.style._layers[Dt[this.currentLayer]],wr=Ft[er.source],Gr=qt[er.source];this._renderTileClippingMasks(er,Gr),this.renderLayer(this,wr,er,Gr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerTe.source&&!Te.isHidden(Gr)?[wr.sourceCaches[Te.source]]:[]),qn=Tn.filter(Te=>Te.getSource().type==="vector"),te=Tn.filter(Te=>Te.getSource().type!=="vector"),le=Te=>{(!Zr||Zr.getSource().maxzoomle(Te)),Zr||te.forEach(Te=>le(Te)),Zr}(this.style,this.transform.zoom);er&&function(wr,Gr,Zr){for(let Tn=0;Tn0),Ft&&(i.b0(pt,Dt),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(qt,Ee){let je=qt.context,er=je.gl,wr=Lc.unblended,Gr=new hl(er.LEQUAL,hl.ReadWrite,[0,1]),Zr=Ee.getTerrainMesh(),Tn=Ee.sourceCache.getRenderableTiles(),qn=qt.useProgram("terrainDepth");je.bindFramebuffer.set(Ee.getFramebuffer("depth").framebuffer),je.viewport.set([0,0,qt.width/devicePixelRatio,qt.height/devicePixelRatio]),je.clear({color:i.aM.transparent,depth:1});for(let te of Tn){let le=Ee.getTerrainData(te.tileID),Te={u_matrix:qt.transform.calculatePosMatrix(te.tileID.toUnwrapped()),u_ele_delta:Ee.getMeshFrameDelta(qt.transform.zoom)};qn.draw(je,er.TRIANGLES,Gr,Hl.disabled,wr,cs.backCCW,Te,le,"terrain",Zr.vertexBuffer,Zr.indexBuffer,Zr.segments)}je.bindFramebuffer.set(null),je.viewport.set([0,0,qt.width,qt.height])}(this,this.style.map.terrain),function(qt,Ee){let je=qt.context,er=je.gl,wr=Lc.unblended,Gr=new hl(er.LEQUAL,hl.ReadWrite,[0,1]),Zr=Ee.getTerrainMesh(),Tn=Ee.getCoordsTexture(),qn=Ee.sourceCache.getRenderableTiles(),te=qt.useProgram("terrainCoords");je.bindFramebuffer.set(Ee.getFramebuffer("coords").framebuffer),je.viewport.set([0,0,qt.width/devicePixelRatio,qt.height/devicePixelRatio]),je.clear({color:i.aM.transparent,depth:1}),Ee.coordsIndex=[];for(let le of qn){let Te=Ee.getTerrainData(le.tileID);je.activeTexture.set(er.TEXTURE0),er.bindTexture(er.TEXTURE_2D,Tn.texture);let Pe={u_matrix:qt.transform.calculatePosMatrix(le.tileID.toUnwrapped()),u_terrain_coords_id:(255-Ee.coordsIndex.length)/255,u_texture:0,u_ele_delta:Ee.getMeshFrameDelta(qt.transform.zoom)};te.draw(je,er.TRIANGLES,Gr,Hl.disabled,wr,cs.backCCW,Pe,Te,"terrain",Zr.vertexBuffer,Zr.indexBuffer,Zr.segments),Ee.coordsIndex.push(le.tileID.key)}je.bindFramebuffer.set(null),je.viewport.set([0,0,qt.width,qt.height])}(this,this.style.map.terrain))}renderLayer(O,pt,Dt,Ft){if(!Dt.isHidden(this.transform.zoom)&&(Dt.type==="background"||Dt.type==="custom"||(Ft||[]).length))switch(this.id=Dt.id,Dt.type){case"symbol":(function(qt,Ee,je,er,wr){if(qt.renderPass!=="translucent")return;let Gr=Hl.disabled,Zr=qt.colorModeForRenderPass();(je._unevaluatedLayout.hasValue("text-variable-anchor")||je._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Tn,qn,te,le,Te,Pe,We,Ne,Xe){let Pr=qn.transform,qr=ca(),Xr=Te==="map",gn=Pe==="map";for(let zn of Tn){let Qn=le.getTile(zn),ai=Qn.getBucket(te);if(!ai||!ai.text||!ai.text.segments.get().length)continue;let Ti=i.ag(ai.textSizeData,Pr.zoom),Qi=ui(Qn,1,qn.transform.zoom),Ma=dn(zn.posMatrix,gn,Xr,qn.transform,Qi),Aa=te.layout.get("icon-text-fit")!=="none"&&ai.hasIconData();if(Ti){let Fa=Math.pow(2,Pr.zoom-Qn.tileID.overscaledZ),wo=qn.style.map.terrain?(Fo,xs)=>qn.style.map.terrain.getElevation(zn,Fo,xs):null,Yo=qr.translatePosition(Pr,Qn,We,Ne);Ed(ai,Xr,gn,Xe,Pr,Ma,zn.posMatrix,Fa,Ti,Aa,qr,Yo,zn.toUnwrapped(),wo)}}}(er,qt,je,Ee,je.layout.get("text-rotation-alignment"),je.layout.get("text-pitch-alignment"),je.paint.get("text-translate"),je.paint.get("text-translate-anchor"),wr),je.paint.get("icon-opacity").constantOr(1)!==0&&Lf(qt,Ee,je,er,!1,je.paint.get("icon-translate"),je.paint.get("icon-translate-anchor"),je.layout.get("icon-rotation-alignment"),je.layout.get("icon-pitch-alignment"),je.layout.get("icon-keep-upright"),Gr,Zr),je.paint.get("text-opacity").constantOr(1)!==0&&Lf(qt,Ee,je,er,!0,je.paint.get("text-translate"),je.paint.get("text-translate-anchor"),je.layout.get("text-rotation-alignment"),je.layout.get("text-pitch-alignment"),je.layout.get("text-keep-upright"),Gr,Zr),Ee.map.showCollisionBoxes&&(xh(qt,Ee,je,er,!0),xh(qt,Ee,je,er,!1))})(O,pt,Dt,Ft,this.style.placement.variableOffsets);break;case"circle":(function(qt,Ee,je,er){if(qt.renderPass!=="translucent")return;let wr=je.paint.get("circle-opacity"),Gr=je.paint.get("circle-stroke-width"),Zr=je.paint.get("circle-stroke-opacity"),Tn=!je.layout.get("circle-sort-key").isConstant();if(wr.constantOr(1)===0&&(Gr.constantOr(1)===0||Zr.constantOr(1)===0))return;let qn=qt.context,te=qn.gl,le=qt.depthModeForSublayer(0,hl.ReadOnly),Te=Hl.disabled,Pe=qt.colorModeForRenderPass(),We=[];for(let Ne=0;NeNe.sortKey-Xe.sortKey);for(let Ne of We){let{programConfiguration:Xe,program:Pr,layoutVertexBuffer:qr,indexBuffer:Xr,uniformValues:gn,terrainData:zn}=Ne.state;Pr.draw(qn,te.TRIANGLES,le,Te,Pe,cs.disabled,gn,zn,je.id,qr,Xr,Ne.segments,je.paint,qt.transform.zoom,Xe)}})(O,pt,Dt,Ft);break;case"heatmap":(function(qt,Ee,je,er){if(je.paint.get("heatmap-opacity")===0)return;let wr=qt.context;if(qt.style.map.terrain){for(let Gr of er){let Zr=Ee.getTile(Gr);Ee.hasRenderableParent(Gr)||(qt.renderPass==="offscreen"?Ld(qt,Zr,je,Gr):qt.renderPass==="translucent"&&ed(qt,je,Gr))}wr.viewport.set([0,0,qt.width,qt.height])}else qt.renderPass==="offscreen"?function(Gr,Zr,Tn,qn){let te=Gr.context,le=te.gl,Te=Hl.disabled,Pe=new Lc([le.ONE,le.ONE],i.aM.transparent,[!0,!0,!0,!0]);(function(We,Ne,Xe){let Pr=We.gl;We.activeTexture.set(Pr.TEXTURE1),We.viewport.set([0,0,Ne.width/4,Ne.height/4]);let qr=Xe.heatmapFbos.get(i.aU);qr?(Pr.bindTexture(Pr.TEXTURE_2D,qr.colorAttachment.get()),We.bindFramebuffer.set(qr.framebuffer)):(qr=nf(We,Ne.width/4,Ne.height/4),Xe.heatmapFbos.set(i.aU,qr))})(te,Gr,Tn),te.clear({color:i.aM.transparent});for(let We=0;We20&&Gr.texParameterf(Gr.TEXTURE_2D,wr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,wr.extTextureFilterAnisotropicMax);let ai=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(We),Ti=ai?We:null,Qi=Ti?Ti.posMatrix:qt.transform.calculatePosMatrix(We.toUnwrapped(),Pe),Ma=Kl(Qi,zn||[0,0],gn||1,Xr,je);Zr instanceof xe?Tn.draw(wr,Gr.TRIANGLES,Ne,Hl.disabled,qn,cs.disabled,Ma,ai,je.id,Zr.boundsBuffer,qt.quadTriangleIndexBuffer,Zr.boundsSegments):Tn.draw(wr,Gr.TRIANGLES,Ne,te[We.overscaledZ],qn,cs.disabled,Ma,ai,je.id,qt.rasterBoundsBuffer,qt.quadTriangleIndexBuffer,qt.rasterBoundsSegments)}})(O,pt,Dt,Ft);break;case"background":(function(qt,Ee,je,er){let wr=je.paint.get("background-color"),Gr=je.paint.get("background-opacity");if(Gr===0)return;let Zr=qt.context,Tn=Zr.gl,qn=qt.transform,te=qn.tileSize,le=je.paint.get("background-pattern");if(qt.isPatternMissing(le))return;let Te=!le&&wr.a===1&&Gr===1&&qt.opaquePassEnabledForLayer()?"opaque":"translucent";if(qt.renderPass!==Te)return;let Pe=Hl.disabled,We=qt.depthModeForSublayer(0,Te==="opaque"?hl.ReadWrite:hl.ReadOnly),Ne=qt.colorModeForRenderPass(),Xe=qt.useProgram(le?"backgroundPattern":"background"),Pr=er||qn.coveringTiles({tileSize:te,terrain:qt.style.map.terrain});le&&(Zr.activeTexture.set(Tn.TEXTURE0),qt.imageManager.bind(qt.context));let qr=je.getCrossfadeParameters();for(let Xr of Pr){let gn=er?Xr.posMatrix:qt.transform.calculatePosMatrix(Xr.toUnwrapped()),zn=le?tc(gn,Gr,qt,le,{tileID:Xr,tileSize:te},qr):Ol(gn,Gr,wr),Qn=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(Xr);Xe.draw(Zr,Tn.TRIANGLES,We,Pe,Ne,cs.disabled,zn,Qn,je.id,qt.tileExtentBuffer,qt.quadTriangleIndexBuffer,qt.tileExtentSegments)}})(O,0,Dt,Ft);break;case"custom":(function(qt,Ee,je){let er=qt.context,wr=je.implementation;if(qt.renderPass==="offscreen"){let Gr=wr.prerender;Gr&&(qt.setCustomLayerDefaults(),er.setColorMode(qt.colorModeForRenderPass()),Gr.call(wr,er.gl,qt.transform.customLayerMatrix()),er.setDirty(),qt.setBaseState())}else if(qt.renderPass==="translucent"){qt.setCustomLayerDefaults(),er.setColorMode(qt.colorModeForRenderPass()),er.setStencilMode(Hl.disabled);let Gr=wr.renderingMode==="3d"?new hl(qt.context.gl.LEQUAL,hl.ReadWrite,qt.depthRangeFor3D):qt.depthModeForSublayer(0,hl.ReadOnly);er.setDepthMode(Gr),wr.render(er.gl,qt.transform.customLayerMatrix(),{farZ:qt.transform.farZ,nearZ:qt.transform.nearZ,fov:qt.transform._fov,modelViewProjectionMatrix:qt.transform.modelViewProjectionMatrix,projectionMatrix:qt.transform.projectionMatrix}),er.setDirty(),qt.setBaseState(),er.bindFramebuffer.set(null)}})(O,0,Dt)}}translatePosMatrix(O,pt,Dt,Ft,qt){if(!Dt[0]&&!Dt[1])return O;let Ee=qt?Ft==="map"?this.transform.angle:0:Ft==="viewport"?-this.transform.angle:0;if(Ee){let wr=Math.sin(Ee),Gr=Math.cos(Ee);Dt=[Dt[0]*Gr-Dt[1]*wr,Dt[0]*wr+Dt[1]*Gr]}let je=[qt?Dt[0]:ui(pt,Dt[0],this.transform.zoom),qt?Dt[1]:ui(pt,Dt[1],this.transform.zoom),0],er=new Float32Array(16);return i.J(er,O,je),er}saveTileTexture(O){let pt=this._tileTextures[O.size[0]];pt?pt.push(O):this._tileTextures[O.size[0]]=[O]}getTileTexture(O){let pt=this._tileTextures[O];return pt&&pt.length>0?pt.pop():null}isPatternMissing(O){if(!O)return!1;if(!O.from||!O.to)return!0;let pt=this.imageManager.getPattern(O.from.toString()),Dt=this.imageManager.getPattern(O.to.toString());return!pt||!Dt}useProgram(O,pt){this.cache=this.cache||{};let Dt=O+(pt?pt.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Dt]||(this.cache[Dt]=new ni(this.context,bn[O],pt,sc[O],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Dt]}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(){let O=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(O.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new g(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:O,drawingBufferHeight:pt}=this.context.gl;return this.width!==O||this.height!==pt}}class xc{constructor(O,pt){this.points=O,this.planes=pt}static fromInvProjectionMatrix(O,pt,Dt){let Ft=Math.pow(2,Dt),qt=[[-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(je=>{let er=1/(je=i.af([],je,O))[3]/pt*Ft;return i.b1(je,je,[er,er,1/je[3],er])}),Ee=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(je=>{let er=function(Tn,qn){var te=qn[0],le=qn[1],Te=qn[2],Pe=te*te+le*le+Te*Te;return Pe>0&&(Pe=1/Math.sqrt(Pe)),Tn[0]=qn[0]*Pe,Tn[1]=qn[1]*Pe,Tn[2]=qn[2]*Pe,Tn}([],function(Tn,qn,te){var le=qn[0],Te=qn[1],Pe=qn[2],We=te[0],Ne=te[1],Xe=te[2];return Tn[0]=Te*Xe-Pe*Ne,Tn[1]=Pe*We-le*Xe,Tn[2]=le*Ne-Te*We,Tn}([],E([],qt[je[0]],qt[je[1]]),E([],qt[je[2]],qt[je[1]]))),wr=-((Gr=er)[0]*(Zr=qt[je[1]])[0]+Gr[1]*Zr[1]+Gr[2]*Zr[2]);var Gr,Zr;return er.concat(wr)});return new xc(qt,Ee)}}class $h{constructor(O,pt){this.min=O,this.max=pt,this.center=function(Dt,Ft,qt){return Dt[0]=.5*Ft[0],Dt[1]=.5*Ft[1],Dt[2]=.5*Ft[2],Dt}([],function(Dt,Ft,qt){return Dt[0]=Ft[0]+qt[0],Dt[1]=Ft[1]+qt[1],Dt[2]=Ft[2]+qt[2],Dt}([],this.min,this.max))}quadrant(O){let pt=[O%2==0,O<2],Dt=w(this.min),Ft=w(this.max);for(let qt=0;qt=0&&Ee++;if(Ee===0)return 0;Ee!==pt.length&&(Dt=!1)}if(Dt)return 2;for(let Ft=0;Ft<3;Ft++){let qt=Number.MAX_VALUE,Ee=-Number.MAX_VALUE;for(let je=0;jethis.max[Ft]-this.min[Ft])return 0}return 1}}class ju{constructor(O=0,pt=0,Dt=0,Ft=0){if(isNaN(O)||O<0||isNaN(pt)||pt<0||isNaN(Dt)||Dt<0||isNaN(Ft)||Ft<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=O,this.bottom=pt,this.left=Dt,this.right=Ft}interpolate(O,pt,Dt){return pt.top!=null&&O.top!=null&&(this.top=i.y.number(O.top,pt.top,Dt)),pt.bottom!=null&&O.bottom!=null&&(this.bottom=i.y.number(O.bottom,pt.bottom,Dt)),pt.left!=null&&O.left!=null&&(this.left=i.y.number(O.left,pt.left,Dt)),pt.right!=null&&O.right!=null&&(this.right=i.y.number(O.right,pt.right,Dt)),this}getCenter(O,pt){let Dt=i.ac((this.left+O-this.right)/2,0,O),Ft=i.ac((this.top+pt-this.bottom)/2,0,pt);return new i.P(Dt,Ft)}equals(O){return this.top===O.top&&this.bottom===O.bottom&&this.left===O.left&&this.right===O.right}clone(){return new ju(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Qu=85.051129;class Pc{constructor(O,pt,Dt,Ft,qt){this.tileSize=512,this._renderWorldCopies=qt===void 0||!!qt,this._minZoom=O||0,this._maxZoom=pt||22,this._minPitch=Dt??0,this._maxPitch=Ft??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new i.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ju,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let O=new Pc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return O.apply(this),O}apply(O){this.tileSize=O.tileSize,this.latRange=O.latRange,this.lngRange=O.lngRange,this.width=O.width,this.height=O.height,this._center=O._center,this._elevation=O._elevation,this.minElevationForCurrentTile=O.minElevationForCurrentTile,this.zoom=O.zoom,this.angle=O.angle,this._fov=O._fov,this._pitch=O._pitch,this._unmodified=O._unmodified,this._edgeInsets=O._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(O){this._minZoom!==O&&(this._minZoom=O,this.zoom=Math.max(this.zoom,O))}get maxZoom(){return this._maxZoom}set maxZoom(O){this._maxZoom!==O&&(this._maxZoom=O,this.zoom=Math.min(this.zoom,O))}get minPitch(){return this._minPitch}set minPitch(O){this._minPitch!==O&&(this._minPitch=O,this.pitch=Math.max(this.pitch,O))}get maxPitch(){return this._maxPitch}set maxPitch(O){this._maxPitch!==O&&(this._maxPitch=O,this.pitch=Math.min(this.pitch,O))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(O){O===void 0?O=!0:O===null&&(O=!1),this._renderWorldCopies=O}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new i.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(O){let pt=-i.b3(O,-180,180)*Math.PI/180;this.angle!==pt&&(this._unmodified=!1,this.angle=pt,this._calcMatrices(),this.rotationMatrix=function(){var Dt=new i.A(4);return i.A!=Float32Array&&(Dt[1]=0,Dt[2]=0),Dt[0]=1,Dt[3]=1,Dt}(),function(Dt,Ft,qt){var Ee=Ft[0],je=Ft[1],er=Ft[2],wr=Ft[3],Gr=Math.sin(qt),Zr=Math.cos(qt);Dt[0]=Ee*Zr+er*Gr,Dt[1]=je*Zr+wr*Gr,Dt[2]=Ee*-Gr+er*Zr,Dt[3]=je*-Gr+wr*Zr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(O){let pt=i.ac(O,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==pt&&(this._unmodified=!1,this._pitch=pt,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(O){O=Math.max(.01,Math.min(60,O)),this._fov!==O&&(this._unmodified=!1,this._fov=O/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(O){let pt=Math.min(Math.max(O,this.minZoom),this.maxZoom);this._zoom!==pt&&(this._unmodified=!1,this._zoom=pt,this.tileZoom=Math.max(0,Math.floor(pt)),this.scale=this.zoomScale(pt),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(O){O.lat===this._center.lat&&O.lng===this._center.lng||(this._unmodified=!1,this._center=O,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(O){O!==this._elevation&&(this._elevation=O,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(O){this._edgeInsets.equals(O)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,O,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(O){return this._edgeInsets.equals(O)}interpolatePadding(O,pt,Dt){this._unmodified=!1,this._edgeInsets.interpolate(O,pt,Dt),this._constrain(),this._calcMatrices()}coveringZoomLevel(O){let pt=(O.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/O.tileSize));return Math.max(0,pt)}getVisibleUnwrappedCoordinates(O){let pt=[new i.b4(0,O)];if(this._renderWorldCopies){let Dt=this.pointCoordinate(new i.P(0,0)),Ft=this.pointCoordinate(new i.P(this.width,0)),qt=this.pointCoordinate(new i.P(this.width,this.height)),Ee=this.pointCoordinate(new i.P(0,this.height)),je=Math.floor(Math.min(Dt.x,Ft.x,qt.x,Ee.x)),er=Math.floor(Math.max(Dt.x,Ft.x,qt.x,Ee.x)),wr=1;for(let Gr=je-wr;Gr<=er+wr;Gr++)Gr!==0&&pt.push(new i.b4(Gr,O))}return pt}coveringTiles(O){var pt,Dt;let Ft=this.coveringZoomLevel(O),qt=Ft;if(O.minzoom!==void 0&&FtO.maxzoom&&(Ft=O.maxzoom);let Ee=this.pointCoordinate(this.getCameraPoint()),je=i.Z.fromLngLat(this.center),er=Math.pow(2,Ft),wr=[er*Ee.x,er*Ee.y,0],Gr=[er*je.x,er*je.y,0],Zr=xc.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ft),Tn=O.minzoom||0;!O.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Tn=Ft);let qn=O.terrain?2/Math.min(this.tileSize,O.tileSize)*this.tileSize:3,te=Ne=>({aabb:new $h([Ne*er,0,0],[(Ne+1)*er,er,0]),zoom:0,x:0,y:0,wrap:Ne,fullyVisible:!1}),le=[],Te=[],Pe=Ft,We=O.reparseOverscaled?qt:Ft;if(this._renderWorldCopies)for(let Ne=1;Ne<=3;Ne++)le.push(te(-Ne)),le.push(te(Ne));for(le.push(te(0));le.length>0;){let Ne=le.pop(),Xe=Ne.x,Pr=Ne.y,qr=Ne.fullyVisible;if(!qr){let ai=Ne.aabb.intersects(Zr);if(ai===0)continue;qr=ai===2}let Xr=O.terrain?wr:Gr,gn=Ne.aabb.distanceX(Xr),zn=Ne.aabb.distanceY(Xr),Qn=Math.max(Math.abs(gn),Math.abs(zn));if(Ne.zoom===Pe||Qn>qn+(1<=Tn){let ai=Pe-Ne.zoom,Ti=wr[0]-.5-(Xe<>1),Ma=Ne.zoom+1,Aa=Ne.aabb.quadrant(ai);if(O.terrain){let Fa=new i.S(Ma,Ne.wrap,Ma,Ti,Qi),wo=O.terrain.getMinMaxElevation(Fa),Yo=(pt=wo.minElevation)!==null&&pt!==void 0?pt:this.elevation,Fo=(Dt=wo.maxElevation)!==null&&Dt!==void 0?Dt:this.elevation;Aa=new $h([Aa.min[0],Aa.min[1],Yo],[Aa.max[0],Aa.max[1],Fo])}le.push({aabb:Aa,zoom:Ma,x:Ti,y:Qi,wrap:Ne.wrap,fullyVisible:qr})}}return Te.sort((Ne,Xe)=>Ne.distanceSq-Xe.distanceSq).map(Ne=>Ne.tileID)}resize(O,pt){this.width=O,this.height=pt,this.pixelsToGLUnits=[2/O,-2/pt],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(O){return Math.pow(2,O)}scaleZoom(O){return Math.log(O)/Math.LN2}project(O){let pt=i.ac(O.lat,-85.051129,Qu);return new i.P(i.O(O.lng)*this.worldSize,i.Q(pt)*this.worldSize)}unproject(O){return new i.Z(O.x/this.worldSize,O.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(O){let pt=this.elevation,Dt=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Ft=this.pointLocation(this.centerPoint,O),qt=O.getElevationForLngLatZoom(Ft,this.tileZoom);if(!(this.elevation-qt))return;let Ee=Dt+pt-qt,je=Math.cos(this._pitch)*this.cameraToCenterDistance/Ee/i.b5(1,Ft.lat),er=this.scaleZoom(je/this.tileSize);this._elevation=qt,this._center=Ft,this.zoom=er}setLocationAtPoint(O,pt){let Dt=this.pointCoordinate(pt),Ft=this.pointCoordinate(this.centerPoint),qt=this.locationCoordinate(O),Ee=new i.Z(qt.x-(Dt.x-Ft.x),qt.y-(Dt.y-Ft.y));this.center=this.coordinateLocation(Ee),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(O,pt){return pt?this.coordinatePoint(this.locationCoordinate(O),pt.getElevationForLngLatZoom(O,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(O))}pointLocation(O,pt){return this.coordinateLocation(this.pointCoordinate(O,pt))}locationCoordinate(O){return i.Z.fromLngLat(O)}coordinateLocation(O){return O&&O.toLngLat()}pointCoordinate(O,pt){if(pt){let Tn=pt.pointCoordinate(O);if(Tn!=null)return Tn}let Dt=[O.x,O.y,0,1],Ft=[O.x,O.y,1,1];i.af(Dt,Dt,this.pixelMatrixInverse),i.af(Ft,Ft,this.pixelMatrixInverse);let qt=Dt[3],Ee=Ft[3],je=Dt[1]/qt,er=Ft[1]/Ee,wr=Dt[2]/qt,Gr=Ft[2]/Ee,Zr=wr===Gr?0:(0-wr)/(Gr-wr);return new i.Z(i.y.number(Dt[0]/qt,Ft[0]/Ee,Zr)/this.worldSize,i.y.number(je,er,Zr)/this.worldSize)}coordinatePoint(O,pt=0,Dt=this.pixelMatrix){let Ft=[O.x*this.worldSize,O.y*this.worldSize,pt,1];return i.af(Ft,Ft,Dt),new i.P(Ft[0]/Ft[3],Ft[1]/Ft[3])}getBounds(){let O=Math.max(0,this.height/2-this.getHorizon());return new dt().extend(this.pointLocation(new i.P(0,O))).extend(this.pointLocation(new i.P(this.width,O))).extend(this.pointLocation(new i.P(this.width,this.height))).extend(this.pointLocation(new i.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new dt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(O){O?(this.lngRange=[O.getWest(),O.getEast()],this.latRange=[O.getSouth(),O.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Qu])}calculateTileMatrix(O){let pt=O.canonical,Dt=this.worldSize/this.zoomScale(pt.z),Ft=pt.x+Math.pow(2,pt.z)*O.wrap,qt=i.an(new Float64Array(16));return i.J(qt,qt,[Ft*Dt,pt.y*Dt,0]),i.K(qt,qt,[Dt/i.X,Dt/i.X,1]),qt}calculatePosMatrix(O,pt=!1){let Dt=O.key,Ft=pt?this._alignedPosMatrixCache:this._posMatrixCache;if(Ft[Dt])return Ft[Dt];let qt=this.calculateTileMatrix(O);return i.L(qt,pt?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,qt),Ft[Dt]=new Float32Array(qt),Ft[Dt]}calculateFogMatrix(O){let pt=O.key,Dt=this._fogMatrixCache;if(Dt[pt])return Dt[pt];let Ft=this.calculateTileMatrix(O);return i.L(Ft,this.fogMatrix,Ft),Dt[pt]=new Float32Array(Ft),Dt[pt]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(O,pt){pt=i.ac(+pt,this.minZoom,this.maxZoom);let Dt={center:new i.N(O.lng,O.lat),zoom:pt},Ft=this.lngRange;if(!this._renderWorldCopies&&Ft===null){let Ne=179.9999999999;Ft=[-Ne,Ne]}let qt=this.tileSize*this.zoomScale(Dt.zoom),Ee=0,je=qt,er=0,wr=qt,Gr=0,Zr=0,{x:Tn,y:qn}=this.size;if(this.latRange){let Ne=this.latRange;Ee=i.Q(Ne[1])*qt,je=i.Q(Ne[0])*qt,je-Eeje&&(Pe=je-Ne)}if(Ft){let Ne=(er+wr)/2,Xe=te;this._renderWorldCopies&&(Xe=i.b3(te,Ne-qt/2,Ne+qt/2));let Pr=Tn/2;Xe-Prwr&&(Te=wr-Pr)}if(Te!==void 0||Pe!==void 0){let Ne=new i.P(Te??te,Pe??le);Dt.center=this.unproject.call({worldSize:qt},Ne).wrap()}return Dt}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let O=this._unmodified,{center:pt,zoom:Dt}=this.getConstrained(this.center,this.zoom);this.center=pt,this.zoom=Dt,this._unmodified=O,this._constraining=!1}_calcMatrices(){if(!this.height)return;let O=this.centerOffset,pt=this.point.x,Dt=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=i.b5(1,this.center.lat)*this.worldSize;let Ft=i.an(new Float64Array(16));i.K(Ft,Ft,[this.width/2,-this.height/2,1]),i.J(Ft,Ft,[1,-1,0]),this.labelPlaneMatrix=Ft,Ft=i.an(new Float64Array(16)),i.K(Ft,Ft,[1,-1,1]),i.J(Ft,Ft,[-1,-1,0]),i.K(Ft,Ft,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ft;let qt=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),Ee=Math.min(this.elevation,this.minElevationForCurrentTile),je=qt-Ee*this._pixelPerMeter/Math.cos(this._pitch),er=Ee<0?je:qt,wr=Math.PI/2+this._pitch,Gr=this._fov*(.5+O.y/this.height),Zr=Math.sin(Gr)*er/Math.sin(i.ac(Math.PI-wr-Gr,.01,Math.PI-.01)),Tn=this.getHorizon(),qn=2*Math.atan(Tn/this.cameraToCenterDistance)*(.5+O.y/(2*Tn)),te=Math.sin(qn)*er/Math.sin(i.ac(Math.PI-wr-qn,.01,Math.PI-.01)),le=Math.min(Zr,te);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*le+er),this.nearZ=this.height/50,Ft=new Float64Array(16),i.b6(Ft,this._fov,this.width/this.height,this.nearZ,this.farZ),Ft[8]=2*-O.x/this.width,Ft[9]=2*O.y/this.height,this.projectionMatrix=i.ae(Ft),i.K(Ft,Ft,[1,-1,1]),i.J(Ft,Ft,[0,0,-this.cameraToCenterDistance]),i.b7(Ft,Ft,this._pitch),i.ad(Ft,Ft,this.angle),i.J(Ft,Ft,[-pt,-Dt,0]),this.mercatorMatrix=i.K([],Ft,[this.worldSize,this.worldSize,this.worldSize]),i.K(Ft,Ft,[1,1,this._pixelPerMeter]),this.pixelMatrix=i.L(new Float64Array(16),this.labelPlaneMatrix,Ft),i.J(Ft,Ft,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Ft,this.invModelViewProjectionMatrix=i.as([],Ft),this.fogMatrix=new Float64Array(16),i.b6(this.fogMatrix,this._fov,this.width/this.height,qt,this.farZ),this.fogMatrix[8]=2*-O.x/this.width,this.fogMatrix[9]=2*O.y/this.height,i.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),i.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),i.b7(this.fogMatrix,this.fogMatrix,this._pitch),i.ad(this.fogMatrix,this.fogMatrix,this.angle),i.J(this.fogMatrix,this.fogMatrix,[-pt,-Dt,0]),i.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),i.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=i.L(new Float64Array(16),this.labelPlaneMatrix,Ft);let Te=this.width%2/2,Pe=this.height%2/2,We=Math.cos(this.angle),Ne=Math.sin(this.angle),Xe=pt-Math.round(pt)+We*Te+Ne*Pe,Pr=Dt-Math.round(Dt)+We*Pe+Ne*Te,qr=new Float64Array(Ft);if(i.J(qr,qr,[Xe>.5?Xe-1:Xe,Pr>.5?Pr-1:Pr,0]),this.alignedModelViewProjectionMatrix=qr,Ft=i.as(new Float64Array(16),this.pixelMatrix),!Ft)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ft,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let O=this.pointCoordinate(new i.P(0,0)),pt=[O.x*this.worldSize,O.y*this.worldSize,0,1];return i.af(pt,pt,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let O=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i.P(0,O))}getCameraQueryGeometry(O){let pt=this.getCameraPoint();if(O.length===1)return[O[0],pt];{let Dt=pt.x,Ft=pt.y,qt=pt.x,Ee=pt.y;for(let je of O)Dt=Math.min(Dt,je.x),Ft=Math.min(Ft,je.y),qt=Math.max(qt,je.x),Ee=Math.max(Ee,je.y);return[new i.P(Dt,Ft),new i.P(qt,Ft),new i.P(qt,Ee),new i.P(Dt,Ee),new i.P(Dt,Ft)]}}lngLatToCameraDepth(O,pt){let Dt=this.locationCoordinate(O),Ft=[Dt.x*this.worldSize,Dt.y*this.worldSize,pt,1];return i.af(Ft,Ft,this.modelViewProjectionMatrix),Ft[2]/Ft[3]}}function xd(Kt,O){let pt,Dt=!1,Ft=null,qt=null,Ee=()=>{Ft=null,Dt&&(Kt.apply(qt,pt),Ft=setTimeout(Ee,O),Dt=!1)};return(...je)=>(Dt=!0,qt=this,pt=je,Ft||Ee(),Ft)}class Eh{constructor(O){this._getCurrentHash=()=>{let pt=window.location.hash.replace("#","");if(this._hashName){let Dt;return pt.split("&").map(Ft=>Ft.split("=")).forEach(Ft=>{Ft[0]===this._hashName&&(Dt=Ft)}),(Dt&&Dt[1]||"").split("/")}return pt.split("/")},this._onHashChange=()=>{let pt=this._getCurrentHash();if(pt.length>=3&&!pt.some(Dt=>isNaN(Dt))){let Dt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(pt[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+pt[2],+pt[1]],zoom:+pt[0],bearing:Dt,pitch:+(pt[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let pt=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,pt)},this._removeHash=()=>{let pt=this._getCurrentHash();if(pt.length===0)return;let Dt=pt.join("/"),Ft=Dt;Ft.split("&").length>0&&(Ft=Ft.split("&")[0]),this._hashName&&(Ft=`${this._hashName}=${Dt}`);let qt=window.location.hash.replace(Ft,"");qt.startsWith("#&")?qt=qt.slice(0,1)+qt.slice(2):qt==="#"&&(qt="");let Ee=window.location.href.replace(/(#.+)?$/,qt);Ee=Ee.replace("&&","&"),window.history.replaceState(window.history.state,null,Ee)},this._updateHash=xd(this._updateHashUnthrottled,300),this._hashName=O&&encodeURIComponent(O)}addTo(O){return this._map=O,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(O){let pt=this._map.getCenter(),Dt=Math.round(100*this._map.getZoom())/100,Ft=Math.ceil((Dt*Math.LN2+Math.log(512/360/.5))/Math.LN10),qt=Math.pow(10,Ft),Ee=Math.round(pt.lng*qt)/qt,je=Math.round(pt.lat*qt)/qt,er=this._map.getBearing(),wr=this._map.getPitch(),Gr="";if(Gr+=O?`/${Ee}/${je}/${Dt}`:`${Dt}/${je}/${Ee}`,(er||wr)&&(Gr+="/"+Math.round(10*er)/10),wr&&(Gr+=`/${Math.round(wr)}`),this._hashName){let Zr=this._hashName,Tn=!1,qn=window.location.hash.slice(1).split("&").map(te=>{let le=te.split("=")[0];return le===Zr?(Tn=!0,`${le}=${Gr}`):te}).filter(te=>te);return Tn||qn.push(`${Zr}=${Gr}`),`#${qn.join("&")}`}return`#${Gr}`}}let nd={linearity:.3,easing:i.b8(0,0,.3,1)},Ud=i.e({deceleration:2500,maxSpeed:1400},nd),Qf=i.e({deceleration:20,maxSpeed:1400},nd),Ap=i.e({deceleration:1e3,maxSpeed:360},nd),bd=i.e({deceleration:1e3,maxSpeed:90},nd);class $d{constructor(O){this._map=O,this.clear()}clear(){this._inertiaBuffer=[]}record(O){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.now(),settings:O})}_drainInertiaBuffer(){let O=this._inertiaBuffer,pt=c.now();for(;O.length>0&&pt-O[0].time>160;)O.shift()}_onMoveEnd(O){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let pt={zoom:0,bearing:0,pitch:0,pan:new i.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:qt}of this._inertiaBuffer)pt.zoom+=qt.zoomDelta||0,pt.bearing+=qt.bearingDelta||0,pt.pitch+=qt.pitchDelta||0,qt.panDelta&&pt.pan._add(qt.panDelta),qt.around&&(pt.around=qt.around),qt.pinchAround&&(pt.pinchAround=qt.pinchAround);let Dt=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Ft={};if(pt.pan.mag()){let qt=wd(pt.pan.mag(),Dt,i.e({},Ud,O||{}));Ft.offset=pt.pan.mult(qt.amount/pt.pan.mag()),Ft.center=this._map.transform.center,zu(Ft,qt)}if(pt.zoom){let qt=wd(pt.zoom,Dt,Qf);Ft.zoom=this._map.transform.zoom+qt.amount,zu(Ft,qt)}if(pt.bearing){let qt=wd(pt.bearing,Dt,Ap);Ft.bearing=this._map.transform.bearing+i.ac(qt.amount,-179,179),zu(Ft,qt)}if(pt.pitch){let qt=wd(pt.pitch,Dt,bd);Ft.pitch=this._map.transform.pitch+qt.amount,zu(Ft,qt)}if(Ft.zoom||Ft.bearing){let qt=pt.pinchAround===void 0?pt.around:pt.pinchAround;Ft.around=qt?this._map.unproject(qt):this._map.getCenter()}return this.clear(),i.e(Ft,{noMoveStart:!0})}}function zu(Kt,O){(!Kt.duration||Kt.durationpt.unproject(er)),je=qt.reduce((er,wr,Gr,Zr)=>er.add(wr.div(Zr.length)),new i.P(0,0));super(O,{points:qt,point:je,lngLats:Ee,lngLat:pt.unproject(je),originalEvent:Dt}),this._defaultPrevented=!1}}class Hd extends i.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(O,pt,Dt){super(O,{originalEvent:Dt}),this._defaultPrevented=!1}}class Lh{constructor(O,pt){this._map=O,this._clickTolerance=pt.clickTolerance}reset(){delete this._mousedownPos}wheel(O){return this._firePreventable(new Hd(O.type,this._map,O))}mousedown(O,pt){return this._mousedownPos=pt,this._firePreventable(new hh(O.type,this._map,O))}mouseup(O){this._map.fire(new hh(O.type,this._map,O))}click(O,pt){this._mousedownPos&&this._mousedownPos.dist(pt)>=this._clickTolerance||this._map.fire(new hh(O.type,this._map,O))}dblclick(O){return this._firePreventable(new hh(O.type,this._map,O))}mouseover(O){this._map.fire(new hh(O.type,this._map,O))}mouseout(O){this._map.fire(new hh(O.type,this._map,O))}touchstart(O){return this._firePreventable(new kd(O.type,this._map,O))}touchmove(O){this._map.fire(new kd(O.type,this._map,O))}touchend(O){this._map.fire(new kd(O.type,this._map,O))}touchcancel(O){this._map.fire(new kd(O.type,this._map,O))}_firePreventable(O){if(this._map.fire(O),O.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ic{constructor(O){this._map=O}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(O){this._map.fire(new hh(O.type,this._map,O))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hh("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(O){this._delayContextMenu?this._contextMenuEvent=O:this._ignoreContextMenu||this._map.fire(new hh(O.type,this._map,O)),this._map.listens("contextmenu")&&O.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Hh{constructor(O){this._map=O}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(O){return this.transform.pointLocation(i.P.convert(O),this._map.terrain)}}class th{constructor(O,pt){this._map=O,this._tr=new Hh(O),this._el=O.getCanvasContainer(),this._container=O.getContainer(),this._clickTolerance=pt.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(O,pt){this.isEnabled()&&O.shiftKey&&O.button===0&&(s.disableDrag(),this._startPos=this._lastPos=pt,this._active=!0)}mousemoveWindow(O,pt){if(!this._active)return;let Dt=pt;if(this._lastPos.equals(Dt)||!this._box&&Dt.dist(this._startPos)qt.fitScreenCoordinates(Dt,Ft,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",O)}keydown(O){this._active&&O.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",O))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(O,pt){return this._map.fire(new i.k(O,{originalEvent:pt}))}}function Pf(Kt,O){if(Kt.length!==O.length)throw new Error(`The number of touches and points are not equal - touches ${Kt.length}, points ${O.length}`);let pt={};for(let Dt=0;Dtthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=O.timeStamp),Dt.length===this.numTouches&&(this.centroid=function(Ft){let qt=new i.P(0,0);for(let Ee of Ft)qt._add(Ee);return qt.div(Ft.length)}(pt),this.touches=Pf(Dt,pt)))}touchmove(O,pt,Dt){if(this.aborted||!this.centroid)return;let Ft=Pf(Dt,pt);for(let qt in this.touches){let Ee=Ft[qt];(!Ee||Ee.dist(this.touches[qt])>30)&&(this.aborted=!0)}}touchend(O,pt,Dt){if((!this.centroid||O.timeStamp-this.startTime>500)&&(this.aborted=!0),Dt.length===0){let Ft=!this.aborted&&this.centroid;if(this.reset(),Ft)return Ft}}}class Id{constructor(O){this.singleTap=new Mc(O),this.numTaps=O.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(O,pt,Dt){this.singleTap.touchstart(O,pt,Dt)}touchmove(O,pt,Dt){this.singleTap.touchmove(O,pt,Dt)}touchend(O,pt,Dt){let Ft=this.singleTap.touchend(O,pt,Dt);if(Ft){let qt=O.timeStamp-this.lastTime<500,Ee=!this.lastTap||this.lastTap.dist(Ft)<30;if(qt&&Ee||this.reset(),this.count++,this.lastTime=O.timeStamp,this.lastTap=Ft,this.count===this.numTaps)return this.reset(),Ft}}}class id{constructor(O){this._tr=new Hh(O),this._zoomIn=new Id({numTouches:1,numTaps:2}),this._zoomOut=new Id({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(O,pt,Dt){this._zoomIn.touchstart(O,pt,Dt),this._zoomOut.touchstart(O,pt,Dt)}touchmove(O,pt,Dt){this._zoomIn.touchmove(O,pt,Dt),this._zoomOut.touchmove(O,pt,Dt)}touchend(O,pt,Dt){let Ft=this._zoomIn.touchend(O,pt,Dt),qt=this._zoomOut.touchend(O,pt,Dt),Ee=this._tr;return Ft?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:je=>je.easeTo({duration:300,zoom:Ee.zoom+1,around:Ee.unproject(Ft)},{originalEvent:O})}):qt?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:je=>je.easeTo({duration:300,zoom:Ee.zoom-1,around:Ee.unproject(qt)},{originalEvent:O})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class dh{constructor(O){this._enabled=!!O.enable,this._moveStateManager=O.moveStateManager,this._clickTolerance=O.clickTolerance||1,this._moveFunction=O.move,this._activateOnStart=!!O.activateOnStart,O.assignEvents(this),this.reset()}reset(O){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(O)}_move(...O){let pt=this._moveFunction(...O);if(pt.bearingDelta||pt.pitchDelta||pt.around||pt.panDelta)return this._active=!0,pt}dragStart(O,pt){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(O)&&(this._moveStateManager.startMove(O),this._lastPoint=pt.length?pt[0]:pt,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(O,pt){if(!this.isEnabled())return;let Dt=this._lastPoint;if(!Dt)return;if(O.preventDefault(),!this._moveStateManager.isValidMoveEvent(O))return void this.reset(O);let Ft=pt.length?pt[0]:pt;return!this._moved&&Ft.dist(Dt){Kt.mousedown=Kt.dragStart,Kt.mousemoveWindow=Kt.dragMove,Kt.mouseup=Kt.dragEnd,Kt.contextmenu=O=>{O.preventDefault()}},Au=({enable:Kt,clickTolerance:O,bearingDegreesPerPixelMoved:pt=.8})=>{let Dt=new ad({checkCorrectEvent:Ft=>s.mouseButton(Ft)===0&&Ft.ctrlKey||s.mouseButton(Ft)===2});return new dh({clickTolerance:O,move:(Ft,qt)=>({bearingDelta:(qt.x-Ft.x)*pt}),moveStateManager:Dt,enable:Kt,assignEvents:tp})},gf=({enable:Kt,clickTolerance:O,pitchDegreesPerPixelMoved:pt=-.5})=>{let Dt=new ad({checkCorrectEvent:Ft=>s.mouseButton(Ft)===0&&Ft.ctrlKey||s.mouseButton(Ft)===2});return new dh({clickTolerance:O,move:(Ft,qt)=>({pitchDelta:(qt.y-Ft.y)*pt}),moveStateManager:Dt,enable:Kt,assignEvents:tp})};class fh{constructor(O,pt){this._clickTolerance=O.clickTolerance||1,this._map=pt,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new i.P(0,0)}_shouldBePrevented(O){return O<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(O,pt,Dt){return this._calculateTransform(O,pt,Dt)}touchmove(O,pt,Dt){if(this._active){if(!this._shouldBePrevented(Dt.length))return O.preventDefault(),this._calculateTransform(O,pt,Dt);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",O)}}touchend(O,pt,Dt){this._calculateTransform(O,pt,Dt),this._active&&this._shouldBePrevented(Dt.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(O,pt,Dt){Dt.length>0&&(this._active=!0);let Ft=Pf(Dt,pt),qt=new i.P(0,0),Ee=new i.P(0,0),je=0;for(let wr in Ft){let Gr=Ft[wr],Zr=this._touches[wr];Zr&&(qt._add(Gr),Ee._add(Gr.sub(Zr)),je++,Ft[wr]=Gr)}if(this._touches=Ft,this._shouldBePrevented(je)||!Ee.mag())return;let er=Ee.div(je);return this._sum._add(er),this._sum.mag()Math.abs(Kt.x)}class sf extends Vh{constructor(O){super(),this._currentTouchCount=0,this._map=O}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(O,pt,Dt){super.touchstart(O,pt,Dt),this._currentTouchCount=Dt.length}_start(O){this._lastPoints=O,Dh(O[0].sub(O[1]))&&(this._valid=!1)}_move(O,pt,Dt){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Ft=O[0].sub(this._lastPoints[0]),qt=O[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Ft,qt,Dt.timeStamp),this._valid?(this._lastPoints=O,this._active=!0,{pitchDelta:(Ft.y+qt.y)/2*-.5}):void 0}gestureBeginsVertically(O,pt,Dt){if(this._valid!==void 0)return this._valid;let Ft=O.mag()>=2,qt=pt.mag()>=2;if(!Ft&&!qt)return;if(!Ft||!qt)return this._firstMove===void 0&&(this._firstMove=Dt),Dt-this._firstMove<100&&void 0;let Ee=O.y>0==pt.y>0;return Dh(O)&&Dh(pt)&&Ee}}let br={panStep:100,bearingStep:15,pitchStep:10};class Qr{constructor(O){this._tr=new Hh(O);let pt=br;this._panStep=pt.panStep,this._bearingStep=pt.bearingStep,this._pitchStep=pt.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(O){if(O.altKey||O.ctrlKey||O.metaKey)return;let pt=0,Dt=0,Ft=0,qt=0,Ee=0;switch(O.keyCode){case 61:case 107:case 171:case 187:pt=1;break;case 189:case 109:case 173:pt=-1;break;case 37:O.shiftKey?Dt=-1:(O.preventDefault(),qt=-1);break;case 39:O.shiftKey?Dt=1:(O.preventDefault(),qt=1);break;case 38:O.shiftKey?Ft=1:(O.preventDefault(),Ee=-1);break;case 40:O.shiftKey?Ft=-1:(O.preventDefault(),Ee=1);break;default:return}return this._rotationDisabled&&(Dt=0,Ft=0),{cameraAnimation:je=>{let er=this._tr;je.easeTo({duration:300,easeId:"keyboardHandler",easing:Nn,zoom:pt?Math.round(er.zoom)+pt*(O.shiftKey?2:1):er.zoom,bearing:er.bearing+Dt*this._bearingStep,pitch:er.pitch+Ft*this._pitchStep,offset:[-qt*this._panStep,-Ee*this._panStep],center:er.center},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Nn(Kt){return Kt*(2-Kt)}let An=4.000244140625;class di{constructor(O,pt){this._onTimeout=Dt=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Dt)},this._map=O,this._tr=new Hh(O),this._triggerRenderFrame=pt,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(O){this._defaultZoomRate=O}setWheelZoomRate(O){this._wheelZoomRate=O}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(O){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!O&&O.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(O){return!!this._map.cooperativeGestures.isEnabled()&&!(O.ctrlKey||this._map.cooperativeGestures.isBypassed(O))}wheel(O){if(!this.isEnabled())return;if(this._shouldBePrevented(O))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",O);let pt=O.deltaMode===WheelEvent.DOM_DELTA_LINE?40*O.deltaY:O.deltaY,Dt=c.now(),Ft=Dt-(this._lastWheelEventTime||0);this._lastWheelEventTime=Dt,pt!==0&&pt%An==0?this._type="wheel":pt!==0&&Math.abs(pt)<4?this._type="trackpad":Ft>400?(this._type=null,this._lastValue=pt,this._timeout=setTimeout(this._onTimeout,40,O)):this._type||(this._type=Math.abs(Ft*pt)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,pt+=this._lastValue)),O.shiftKey&&pt&&(pt/=4),this._type&&(this._lastWheelEvent=O,this._delta-=pt,this._active||this._start(O)),O.preventDefault()}_start(O){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let pt=s.mousePos(this._map.getCanvas(),O),Dt=this._tr;this._around=pt.y>Dt.transform.height/2-Dt.transform.getHorizon()?i.N.convert(this._aroundCenter?Dt.center:Dt.unproject(pt)):i.N.convert(Dt.center),this._aroundPoint=Dt.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let O=this._tr.transform;if(this._delta!==0){let er=this._type==="wheel"&&Math.abs(this._delta)>An?this._wheelZoomRate:this._defaultZoomRate,wr=2/(1+Math.exp(-Math.abs(this._delta*er)));this._delta<0&&wr!==0&&(wr=1/wr);let Gr=typeof this._targetZoom=="number"?O.zoomScale(this._targetZoom):O.scale;this._targetZoom=Math.min(O.maxZoom,Math.max(O.minZoom,O.scaleZoom(Gr*wr))),this._type==="wheel"&&(this._startZoom=O.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let pt=typeof this._targetZoom=="number"?this._targetZoom:O.zoom,Dt=this._startZoom,Ft=this._easing,qt,Ee=!1,je=c.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Dt&&Ft&&je){let er=Math.min(je/200,1),wr=Ft(er);qt=i.y.number(Dt,pt,wr),er<1?this._frameId||(this._frameId=!0):Ee=!0}else qt=pt,Ee=!0;return this._active=!0,Ee&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Ee,zoomDelta:qt-O.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(O){let pt=i.b9;if(this._prevEase){let Dt=this._prevEase,Ft=(c.now()-Dt.start)/Dt.duration,qt=Dt.easing(Ft+.01)-Dt.easing(Ft),Ee=.27/Math.sqrt(qt*qt+1e-4)*.01,je=Math.sqrt(.0729-Ee*Ee);pt=i.b8(Ee,je,.25,1)}return this._prevEase={start:c.now(),duration:O,easing:pt},pt}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Pi{constructor(O,pt){this._clickZoom=O,this._tapZoom=pt}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 ga{constructor(O){this._tr=new Hh(O),this.reset()}reset(){this._active=!1}dblclick(O,pt){return O.preventDefault(),{cameraAnimation:Dt=>{Dt.easeTo({duration:300,zoom:this._tr.zoom+(O.shiftKey?-1:1),around:this._tr.unproject(pt)},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Pa{constructor(){this._tap=new Id({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(O,pt,Dt){if(!this._swipePoint)if(this._tapTime){let Ft=pt[0],qt=O.timeStamp-this._tapTime<500,Ee=this._tapPoint.dist(Ft)<30;qt&&Ee?Dt.length>0&&(this._swipePoint=Ft,this._swipeTouch=Dt[0].identifier):this.reset()}else this._tap.touchstart(O,pt,Dt)}touchmove(O,pt,Dt){if(this._tapTime){if(this._swipePoint){if(Dt[0].identifier!==this._swipeTouch)return;let Ft=pt[0],qt=Ft.y-this._swipePoint.y;return this._swipePoint=Ft,O.preventDefault(),this._active=!0,{zoomDelta:qt/128}}}else this._tap.touchmove(O,pt,Dt)}touchend(O,pt,Dt){if(this._tapTime)this._swipePoint&&Dt.length===0&&this.reset();else{let Ft=this._tap.touchend(O,pt,Dt);Ft&&(this._tapTime=O.timeStamp,this._tapPoint=Ft)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ja{constructor(O,pt,Dt){this._el=O,this._mousePan=pt,this._touchPan=Dt}enable(O){this._inertiaOptions=O||{},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 uo{constructor(O,pt,Dt){this._pitchWithRotate=O.pitchWithRotate,this._mouseRotate=pt,this._mousePitch=Dt}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 Sa{constructor(O,pt,Dt,Ft){this._el=O,this._touchZoom=pt,this._touchRotate=Dt,this._tapDragZoom=Ft,this._rotationDisabled=!1,this._enabled=!0}enable(O){this._touchZoom.enable(O),this._rotationDisabled||this._touchRotate.enable(O),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Za{constructor(O,pt){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=O,this._options=pt,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let O=this._map.getCanvasContainer();O.classList.add("maplibregl-cooperative-gestures"),this._container=s.create("div","maplibregl-cooperative-gesture-screen",O);let pt=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(pt=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let Dt=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Ft=document.createElement("div");Ft.className="maplibregl-desktop-message",Ft.textContent=pt,this._container.appendChild(Ft);let qt=document.createElement("div");qt.className="maplibregl-mobile-message",qt.textContent=Dt,this._container.appendChild(qt),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(s.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(O){return O[this._bypassKey]}notifyGestureBlocked(O,pt){this._enabled&&(this._map.fire(new i.k("cooperativegestureprevented",{gestureType:O,originalEvent:pt})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Ra=Kt=>Kt.zoom||Kt.drag||Kt.pitch||Kt.rotate;class pa extends i.k{}function _o(Kt){return Kt.panDelta&&Kt.panDelta.mag()||Kt.zoomDelta||Kt.bearingDelta||Kt.pitchDelta}class fs{constructor(O,pt){this.handleWindowEvent=Ft=>{this.handleEvent(Ft,`${Ft.type}Window`)},this.handleEvent=(Ft,qt)=>{if(Ft.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let Ee=Ft.type==="renderFrame"?void 0:Ft,je={needsRenderFrame:!1},er={},wr={},Gr=Ft.touches,Zr=Gr?this._getMapTouches(Gr):void 0,Tn=Zr?s.touchPos(this._map.getCanvas(),Zr):s.mousePos(this._map.getCanvas(),Ft);for(let{handlerName:le,handler:Te,allowed:Pe}of this._handlers){if(!Te.isEnabled())continue;let We;this._blockedByActive(wr,Pe,le)?Te.reset():Te[qt||Ft.type]&&(We=Te[qt||Ft.type](Ft,Tn,Zr),this.mergeHandlerResult(je,er,We,le,Ee),We&&We.needsRenderFrame&&this._triggerRenderFrame()),(We||Te.isActive())&&(wr[le]=Te)}let qn={};for(let le in this._previousActiveHandlers)wr[le]||(qn[le]=Ee);this._previousActiveHandlers=wr,(Object.keys(qn).length||_o(je))&&(this._changes.push([je,er,qn]),this._triggerRenderFrame()),(Object.keys(wr).length||_o(je))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:te}=je;te&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],te(this._map))},this._map=O,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new $d(O),this._bearingSnap=pt.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(pt);let Dt=this._el;this._listeners=[[Dt,"touchstart",{passive:!0}],[Dt,"touchmove",{passive:!1}],[Dt,"touchend",void 0],[Dt,"touchcancel",void 0],[Dt,"mousedown",void 0],[Dt,"mousemove",void 0],[Dt,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Dt,"mouseover",void 0],[Dt,"mouseout",void 0],[Dt,"dblclick",void 0],[Dt,"click",void 0],[Dt,"keydown",{capture:!1}],[Dt,"keyup",void 0],[Dt,"wheel",{passive:!1}],[Dt,"contextmenu",void 0],[window,"blur",void 0]];for(let[Ft,qt,Ee]of this._listeners)s.addEventListener(Ft,qt,Ft===document?this.handleWindowEvent:this.handleEvent,Ee)}destroy(){for(let[O,pt,Dt]of this._listeners)s.removeEventListener(O,pt,O===document?this.handleWindowEvent:this.handleEvent,Dt)}_addDefaultHandlers(O){let pt=this._map,Dt=pt.getCanvasContainer();this._add("mapEvent",new Lh(pt,O));let Ft=pt.boxZoom=new th(pt,O);this._add("boxZoom",Ft),O.interactive&&O.boxZoom&&Ft.enable();let qt=pt.cooperativeGestures=new Za(pt,O.cooperativeGestures);this._add("cooperativeGestures",qt),O.cooperativeGestures&&qt.enable();let Ee=new id(pt),je=new ga(pt);pt.doubleClickZoom=new Pi(je,Ee),this._add("tapZoom",Ee),this._add("clickZoom",je),O.interactive&&O.doubleClickZoom&&pt.doubleClickZoom.enable();let er=new Pa;this._add("tapDragZoom",er);let wr=pt.touchPitch=new sf(pt);this._add("touchPitch",wr),O.interactive&&O.touchPitch&&pt.touchPitch.enable(O.touchPitch);let Gr=Au(O),Zr=gf(O);pt.dragRotate=new uo(O,Gr,Zr),this._add("mouseRotate",Gr,["mousePitch"]),this._add("mousePitch",Zr,["mouseRotate"]),O.interactive&&O.dragRotate&&pt.dragRotate.enable();let Tn=(({enable:We,clickTolerance:Ne})=>{let Xe=new ad({checkCorrectEvent:Pr=>s.mouseButton(Pr)===0&&!Pr.ctrlKey});return new dh({clickTolerance:Ne,move:(Pr,qr)=>({around:qr,panDelta:qr.sub(Pr)}),activateOnStart:!0,moveStateManager:Xe,enable:We,assignEvents:tp})})(O),qn=new fh(O,pt);pt.dragPan=new Ja(Dt,Tn,qn),this._add("mousePan",Tn),this._add("touchPan",qn,["touchZoom","touchRotate"]),O.interactive&&O.dragPan&&pt.dragPan.enable(O.dragPan);let te=new Td,le=new fc;pt.touchZoomRotate=new Sa(Dt,le,te,er),this._add("touchRotate",te,["touchPan","touchZoom"]),this._add("touchZoom",le,["touchPan","touchRotate"]),O.interactive&&O.touchZoomRotate&&pt.touchZoomRotate.enable(O.touchZoomRotate);let Te=pt.scrollZoom=new di(pt,()=>this._triggerRenderFrame());this._add("scrollZoom",Te,["mousePan"]),O.interactive&&O.scrollZoom&&pt.scrollZoom.enable(O.scrollZoom);let Pe=pt.keyboard=new Qr(pt);this._add("keyboard",Pe),O.interactive&&O.keyboard&&pt.keyboard.enable(),this._add("blockableMapEvent",new Ic(pt))}_add(O,pt,Dt){this._handlers.push({handlerName:O,handler:pt,allowed:Dt}),this._handlersById[O]=pt}stop(O){if(!this._updatingCamera){for(let{handler:pt}of this._handlers)pt.reset();this._inertia.clear(),this._fireEvents({},{},O),this._changes=[]}}isActive(){for(let{handler:O}of this._handlers)if(O.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ra(this._eventsInProgress)||this.isZooming()}_blockedByActive(O,pt,Dt){for(let Ft in O)if(Ft!==Dt&&(!pt||pt.indexOf(Ft)<0))return!0;return!1}_getMapTouches(O){let pt=[];for(let Dt of O)this._el.contains(Dt.target)&&pt.push(Dt);return pt}mergeHandlerResult(O,pt,Dt,Ft,qt){if(!Dt)return;i.e(O,Dt);let Ee={handlerName:Ft,originalEvent:Dt.originalEvent||qt};Dt.zoomDelta!==void 0&&(pt.zoom=Ee),Dt.panDelta!==void 0&&(pt.drag=Ee),Dt.pitchDelta!==void 0&&(pt.pitch=Ee),Dt.bearingDelta!==void 0&&(pt.rotate=Ee)}_applyChanges(){let O={},pt={},Dt={};for(let[Ft,qt,Ee]of this._changes)Ft.panDelta&&(O.panDelta=(O.panDelta||new i.P(0,0))._add(Ft.panDelta)),Ft.zoomDelta&&(O.zoomDelta=(O.zoomDelta||0)+Ft.zoomDelta),Ft.bearingDelta&&(O.bearingDelta=(O.bearingDelta||0)+Ft.bearingDelta),Ft.pitchDelta&&(O.pitchDelta=(O.pitchDelta||0)+Ft.pitchDelta),Ft.around!==void 0&&(O.around=Ft.around),Ft.pinchAround!==void 0&&(O.pinchAround=Ft.pinchAround),Ft.noInertia&&(O.noInertia=Ft.noInertia),i.e(pt,qt),i.e(Dt,Ee);this._updateMapTransform(O,pt,Dt),this._changes=[]}_updateMapTransform(O,pt,Dt){let Ft=this._map,qt=Ft._getTransformForUpdate(),Ee=Ft.terrain;if(!(_o(O)||Ee&&this._terrainMovement))return this._fireEvents(pt,Dt,!0);let{panDelta:je,zoomDelta:er,bearingDelta:wr,pitchDelta:Gr,around:Zr,pinchAround:Tn}=O;Tn!==void 0&&(Zr=Tn),Ft._stop(!0),Zr=Zr||Ft.transform.centerPoint;let qn=qt.pointLocation(je?Zr.sub(je):Zr);wr&&(qt.bearing+=wr),Gr&&(qt.pitch+=Gr),er&&(qt.zoom+=er),Ee?this._terrainMovement||!pt.drag&&!pt.zoom?pt.drag&&this._terrainMovement?qt.center=qt.pointLocation(qt.centerPoint.sub(je)):qt.setLocationAtPoint(qn,Zr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,qt.setLocationAtPoint(qn,Zr)):qt.setLocationAtPoint(qn,Zr),Ft._applyUpdatedTransform(qt),this._map._update(),O.noInertia||this._inertia.record(O),this._fireEvents(pt,Dt,!0)}_fireEvents(O,pt,Dt){let Ft=Ra(this._eventsInProgress),qt=Ra(O),Ee={};for(let Zr in O){let{originalEvent:Tn}=O[Zr];this._eventsInProgress[Zr]||(Ee[`${Zr}start`]=Tn),this._eventsInProgress[Zr]=O[Zr]}!Ft&&qt&&this._fireEvent("movestart",qt.originalEvent);for(let Zr in Ee)this._fireEvent(Zr,Ee[Zr]);qt&&this._fireEvent("move",qt.originalEvent);for(let Zr in O){let{originalEvent:Tn}=O[Zr];this._fireEvent(Zr,Tn)}let je={},er;for(let Zr in this._eventsInProgress){let{handlerName:Tn,originalEvent:qn}=this._eventsInProgress[Zr];this._handlersById[Tn].isActive()||(delete this._eventsInProgress[Zr],er=pt[Tn]||qn,je[`${Zr}end`]=er)}for(let Zr in je)this._fireEvent(Zr,je[Zr]);let wr=Ra(this._eventsInProgress),Gr=(Ft||qt)&&!wr;if(Gr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Zr=this._map._getTransformForUpdate();Zr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Zr)}if(Dt&&Gr){this._updatingCamera=!0;let Zr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Tn=qn=>qn!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new pa("renderFrame",{timeStamp:O})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class os extends i.E{constructor(O,pt){super(),this._renderFrameCallback=()=>{let Dt=Math.min((c.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Dt)),Dt<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=O,this._bearingSnap=pt.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new i.N(this.transform.center.lng,this.transform.center.lat)}setCenter(O,pt){return this.jumpTo({center:O},pt)}panBy(O,pt,Dt){return O=i.P.convert(O).mult(-1),this.panTo(this.transform.center,i.e({offset:O},pt),Dt)}panTo(O,pt,Dt){return this.easeTo(i.e({center:O},pt),Dt)}getZoom(){return this.transform.zoom}setZoom(O,pt){return this.jumpTo({zoom:O},pt),this}zoomTo(O,pt,Dt){return this.easeTo(i.e({zoom:O},pt),Dt)}zoomIn(O,pt){return this.zoomTo(this.getZoom()+1,O,pt),this}zoomOut(O,pt){return this.zoomTo(this.getZoom()-1,O,pt),this}getBearing(){return this.transform.bearing}setBearing(O,pt){return this.jumpTo({bearing:O},pt),this}getPadding(){return this.transform.padding}setPadding(O,pt){return this.jumpTo({padding:O},pt),this}rotateTo(O,pt,Dt){return this.easeTo(i.e({bearing:O},pt),Dt)}resetNorth(O,pt){return this.rotateTo(0,i.e({duration:1e3},O),pt),this}resetNorthPitch(O,pt){return this.easeTo(i.e({bearing:0,pitch:0,duration:1e3},O),pt),this}snapToNorth(O,pt){return Math.abs(this.getBearing()){if(this._zooming&&(Ft.zoom=i.y.number(qt,Te,Xr)),this._rotating&&(Ft.bearing=i.y.number(Ee,wr,Xr)),this._pitching&&(Ft.pitch=i.y.number(je,Gr,Xr)),this._padding&&(Ft.interpolatePadding(er,Zr,Xr),qn=Ft.centerPoint.add(Tn)),this.terrain&&!O.freezeElevation&&this._updateElevation(Xr),Xe)Ft.setLocationAtPoint(Xe,Pr);else{let gn=Ft.zoomScale(Ft.zoom-qt),zn=Te>qt?Math.min(2,Ne):Math.max(.5,Ne),Qn=Math.pow(zn,1-Xr),ai=Ft.unproject(Pe.add(We.mult(Xr*Qn)).mult(gn));Ft.setLocationAtPoint(Ft.renderWorldCopies?ai.wrap():ai,qn)}this._applyUpdatedTransform(Ft),this._fireMoveEvents(pt)},Xr=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pt,Xr)},O),this}_prepareEase(O,pt,Dt={}){this._moving=!0,pt||Dt.moving||this.fire(new i.k("movestart",O)),this._zooming&&!Dt.zooming&&this.fire(new i.k("zoomstart",O)),this._rotating&&!Dt.rotating&&this.fire(new i.k("rotatestart",O)),this._pitching&&!Dt.pitching&&this.fire(new i.k("pitchstart",O))}_prepareElevation(O){this._elevationCenter=O,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(O,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(O){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let pt=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(O<1&&pt!==this._elevationTarget){let Dt=this._elevationTarget-this._elevationStart;this._elevationStart+=O*(Dt-(pt-(Dt*O+this._elevationStart))/(1-O)),this._elevationTarget=pt}this.transform.elevation=i.y.number(this._elevationStart,this._elevationTarget,O)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(O){let pt=O.getCameraPosition(),Dt=this.terrain.getElevationForLngLatZoom(pt.lngLat,O.zoom);if(pt.altitudethis._elevateCameraIfInsideTerrain(Ft)),this.transformCameraUpdate&&pt.push(Ft=>this.transformCameraUpdate(Ft)),!pt.length)return;let Dt=O.clone();for(let Ft of pt){let qt=Dt.clone(),{center:Ee,zoom:je,pitch:er,bearing:wr,elevation:Gr}=Ft(qt);Ee&&(qt.center=Ee),je!==void 0&&(qt.zoom=je),er!==void 0&&(qt.pitch=er),wr!==void 0&&(qt.bearing=wr),Gr!==void 0&&(qt.elevation=Gr),Dt.apply(qt)}this.transform.apply(Dt)}_fireMoveEvents(O){this.fire(new i.k("move",O)),this._zooming&&this.fire(new i.k("zoom",O)),this._rotating&&this.fire(new i.k("rotate",O)),this._pitching&&this.fire(new i.k("pitch",O))}_afterEase(O,pt){if(this._easeId&&pt&&this._easeId===pt)return;delete this._easeId;let Dt=this._zooming,Ft=this._rotating,qt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Dt&&this.fire(new i.k("zoomend",O)),Ft&&this.fire(new i.k("rotateend",O)),qt&&this.fire(new i.k("pitchend",O)),this.fire(new i.k("moveend",O))}flyTo(O,pt){var Dt;if(!O.essential&&c.prefersReducedMotion){let Fa=i.M(O,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Fa,pt)}this.stop(),O=i.e({offset:[0,0],speed:1.2,curve:1.42,easing:i.b9},O);let Ft=this._getTransformForUpdate(),qt=Ft.zoom,Ee=Ft.bearing,je=Ft.pitch,er=Ft.padding,wr="bearing"in O?this._normalizeBearing(O.bearing,Ee):Ee,Gr="pitch"in O?+O.pitch:je,Zr="padding"in O?O.padding:Ft.padding,Tn=i.P.convert(O.offset),qn=Ft.centerPoint.add(Tn),te=Ft.pointLocation(qn),{center:le,zoom:Te}=Ft.getConstrained(i.N.convert(O.center||te),(Dt=O.zoom)!==null&&Dt!==void 0?Dt:qt);this._normalizeCenter(le,Ft);let Pe=Ft.zoomScale(Te-qt),We=Ft.project(te),Ne=Ft.project(le).sub(We),Xe=O.curve,Pr=Math.max(Ft.width,Ft.height),qr=Pr/Pe,Xr=Ne.mag();if("minZoom"in O){let Fa=i.ac(Math.min(O.minZoom,qt,Te),Ft.minZoom,Ft.maxZoom),wo=Pr/Ft.zoomScale(Fa-qt);Xe=Math.sqrt(wo/Xr*2)}let gn=Xe*Xe;function zn(Fa){let wo=(qr*qr-Pr*Pr+(Fa?-1:1)*gn*gn*Xr*Xr)/(2*(Fa?qr:Pr)*gn*Xr);return Math.log(Math.sqrt(wo*wo+1)-wo)}function Qn(Fa){return(Math.exp(Fa)-Math.exp(-Fa))/2}function ai(Fa){return(Math.exp(Fa)+Math.exp(-Fa))/2}let Ti=zn(!1),Qi=function(Fa){return ai(Ti)/ai(Ti+Xe*Fa)},Ma=function(Fa){return Pr*((ai(Ti)*(Qn(wo=Ti+Xe*Fa)/ai(wo))-Qn(Ti))/gn)/Xr;var wo},Aa=(zn(!0)-Ti)/Xe;if(Math.abs(Xr)<1e-6||!isFinite(Aa)){if(Math.abs(Pr-qr)<1e-6)return this.easeTo(O,pt);let Fa=qr0,Qi=wo=>Math.exp(Fa*Xe*wo)}return O.duration="duration"in O?+O.duration:1e3*Aa/("screenSpeed"in O?+O.screenSpeed/Xe:+O.speed),O.maxDuration&&O.duration>O.maxDuration&&(O.duration=0),this._zooming=!0,this._rotating=Ee!==wr,this._pitching=Gr!==je,this._padding=!Ft.isPaddingEqual(Zr),this._prepareEase(pt,!1),this.terrain&&this._prepareElevation(le),this._ease(Fa=>{let wo=Fa*Aa,Yo=1/Qi(wo);Ft.zoom=Fa===1?Te:qt+Ft.scaleZoom(Yo),this._rotating&&(Ft.bearing=i.y.number(Ee,wr,Fa)),this._pitching&&(Ft.pitch=i.y.number(je,Gr,Fa)),this._padding&&(Ft.interpolatePadding(er,Zr,Fa),qn=Ft.centerPoint.add(Tn)),this.terrain&&!O.freezeElevation&&this._updateElevation(Fa);let Fo=Fa===1?le:Ft.unproject(We.add(Ne.mult(Ma(wo))).mult(Yo));Ft.setLocationAtPoint(Ft.renderWorldCopies?Fo.wrap():Fo,qn),this._applyUpdatedTransform(Ft),this._fireMoveEvents(pt)},()=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pt)},O),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(O,pt){var Dt;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Ft=this._onEaseEnd;delete this._onEaseEnd,Ft.call(this,pt)}return O||(Dt=this.handlers)===null||Dt===void 0||Dt.stop(!1),this}_ease(O,pt,Dt){Dt.animate===!1||Dt.duration===0?(O(1),pt()):(this._easeStart=c.now(),this._easeOptions=Dt,this._onEaseFrame=O,this._onEaseEnd=pt,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(O,pt){O=i.b3(O,-180,180);let Dt=Math.abs(O-pt);return Math.abs(O-360-pt)180?-360:Dt<-180?360:0}queryTerrainElevation(O){return this.terrain?this.terrain.getElevationForLngLatZoom(i.N.convert(O),this.transform.tileZoom)-this.transform.elevation:null}}let gs={compact:!0,customAttribution:'MapLibre'};class ws{constructor(O=gs){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=pt=>{!pt||pt.sourceDataType!=="metadata"&&pt.sourceDataType!=="visibility"&&pt.dataType!=="style"&&pt.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=O}getDefaultPosition(){return"bottom-right"}onAdd(O){return this._map=O,this._compact=this.options.compact,this._container=s.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=s.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=s.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(){s.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(O,pt){let Dt=this._map._getUIString(`AttributionControl.${pt}`);O.title=Dt,O.setAttribute("aria-label",Dt)}_updateAttributions(){if(!this._map.style)return;let O=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?O=O.concat(this.options.customAttribution.map(Ft=>typeof Ft!="string"?"":Ft)):typeof this.options.customAttribution=="string"&&O.push(this.options.customAttribution)),this._map.style.stylesheet){let Ft=this._map.style.stylesheet;this.styleOwner=Ft.owner,this.styleId=Ft.id}let pt=this._map.style.sourceCaches;for(let Ft in pt){let qt=pt[Ft];if(qt.used||qt.usedForTerrain){let Ee=qt.getSource();Ee.attribution&&O.indexOf(Ee.attribution)<0&&O.push(Ee.attribution)}}O=O.filter(Ft=>String(Ft).trim()),O.sort((Ft,qt)=>Ft.length-qt.length),O=O.filter((Ft,qt)=>{for(let Ee=qt+1;Ee=0)return!1;return!0});let Dt=O.join(" | ");Dt!==this._attribHTML&&(this._attribHTML=Dt,O.length?(this._innerContainer.innerHTML=Dt,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class bo{constructor(O={}){this._updateCompact=()=>{let pt=this._container.children;if(pt.length){let Dt=pt[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Dt.classList.add("maplibregl-compact"):Dt.classList.remove("maplibregl-compact")}},this.options=O}getDefaultPosition(){return"bottom-left"}onAdd(O){this._map=O,this._compact=this.options&&this.options.compact,this._container=s.create("div","maplibregl-ctrl");let pt=s.create("a","maplibregl-ctrl-logo");return pt.target="_blank",pt.rel="noopener nofollow",pt.href="https://maplibre.org/",pt.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),pt.setAttribute("rel","noopener nofollow"),this._container.appendChild(pt),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){s.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class lo{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(O){let pt=++this._id;return this._queue.push({callback:O,id:pt,cancelled:!1}),pt}remove(O){let pt=this._currentlyRunning,Dt=pt?this._queue.concat(pt):this._queue;for(let Ft of Dt)if(Ft.id===O)return void(Ft.cancelled=!0)}run(O=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let pt=this._currentlyRunning=this._queue;this._queue=[];for(let Dt of pt)if(!Dt.cancelled&&(Dt.callback(O),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ks=i.Y([{name:"a_pos3d",type:"Int16",components:3}]);class dl extends i.E{constructor(O){super(),this.sourceCache=O,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,O.usedForTerrain=!0,O.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(O,pt){this.sourceCache.update(O,pt),this._renderableTilesKeys=[];let Dt={};for(let Ft of O.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:pt}))Dt[Ft.key]=!0,this._renderableTilesKeys.push(Ft.key),this._tiles[Ft.key]||(Ft.posMatrix=new Float64Array(16),i.aP(Ft.posMatrix,0,i.X,0,i.X,0,1),this._tiles[Ft.key]=new ce(Ft,this.tileSize));for(let Ft in this._tiles)Dt[Ft]||delete this._tiles[Ft]}freeRtt(O){for(let pt in this._tiles){let Dt=this._tiles[pt];(!O||Dt.tileID.equals(O)||Dt.tileID.isChildOf(O)||O.isChildOf(Dt.tileID))&&(Dt.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(O=>this.getTileByID(O))}getTileByID(O){return this._tiles[O]}getTerrainCoords(O){let pt={};for(let Dt of this._renderableTilesKeys){let Ft=this._tiles[Dt].tileID;if(Ft.canonical.equals(O.canonical)){let qt=O.clone();qt.posMatrix=new Float64Array(16),i.aP(qt.posMatrix,0,i.X,0,i.X,0,1),pt[Dt]=qt}else if(Ft.canonical.isChildOf(O.canonical)){let qt=O.clone();qt.posMatrix=new Float64Array(16);let Ee=Ft.canonical.z-O.canonical.z,je=Ft.canonical.x-(Ft.canonical.x>>Ee<>Ee<>Ee;i.aP(qt.posMatrix,0,wr,0,wr,0,1),i.J(qt.posMatrix,qt.posMatrix,[-je*wr,-er*wr,0]),pt[Dt]=qt}else if(O.canonical.isChildOf(Ft.canonical)){let qt=O.clone();qt.posMatrix=new Float64Array(16);let Ee=O.canonical.z-Ft.canonical.z,je=O.canonical.x-(O.canonical.x>>Ee<>Ee<>Ee;i.aP(qt.posMatrix,0,i.X,0,i.X,0,1),i.J(qt.posMatrix,qt.posMatrix,[je*wr,er*wr,0]),i.K(qt.posMatrix,qt.posMatrix,[1/2**Ee,1/2**Ee,0]),pt[Dt]=qt}}return pt}getSourceTile(O,pt){let Dt=this.sourceCache._source,Ft=O.overscaledZ-this.deltaZoom;if(Ft>Dt.maxzoom&&(Ft=Dt.maxzoom),Ft=Dt.minzoom&&(!qt||!qt.dem);)qt=this.sourceCache.getTileByID(O.scaledTo(Ft--).key);return qt}tilesAfterTime(O=Date.now()){return Object.values(this._tiles).filter(pt=>pt.timeAdded>=O)}}class Vl{constructor(O,pt,Dt){this.painter=O,this.sourceCache=new dl(pt),this.options=Dt,this.exaggeration=typeof Dt.exaggeration=="number"?Dt.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(O,pt,Dt,Ft=i.X){var qt;if(!(pt>=0&&pt=0&&DtO.canonical.z&&(O.canonical.z>=Ft?qt=O.canonical.z-Ft:i.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let Ee=O.canonical.x-(O.canonical.x>>qt<>qt<>8<<4|qt>>8,pt[Ee+3]=0;let Dt=new i.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(pt.buffer)),Ft=new g(O,Dt,O.gl.RGBA,{premultiply:!1});return Ft.bind(O.gl.NEAREST,O.gl.CLAMP_TO_EDGE),this._coordsTexture=Ft,Ft}pointCoordinate(O){this.painter.maybeDrawDepthAndCoords(!0);let pt=new Uint8Array(4),Dt=this.painter.context,Ft=Dt.gl,qt=Math.round(O.x*this.painter.pixelRatio/devicePixelRatio),Ee=Math.round(O.y*this.painter.pixelRatio/devicePixelRatio),je=Math.round(this.painter.height/devicePixelRatio);Dt.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Ft.readPixels(qt,je-Ee-1,1,1,Ft.RGBA,Ft.UNSIGNED_BYTE,pt),Dt.bindFramebuffer.set(null);let er=pt[0]+(pt[2]>>4<<8),wr=pt[1]+((15&pt[2])<<8),Gr=this.coordsIndex[255-pt[3]],Zr=Gr&&this.sourceCache.getTileByID(Gr);if(!Zr)return null;let Tn=this._coordsTextureSize,qn=(1<O.id!==pt),this._recentlyUsed.push(O.id)}stampObject(O){O.stamp=++this._stamp}getOrCreateFreeObject(){for(let pt of this._recentlyUsed)if(!this._objects[pt].inUse)return this._objects[pt];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let O=this._createObject(this._objects.length);return this._objects.push(O),O}freeObject(O){O.inUse=!1}freeAllObjects(){for(let O of this._objects)this.freeObject(O)}isFull(){return!(this._objects.length!O.inUse)===!1}}let ec={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class vc{constructor(O,pt){this.painter=O,this.terrain=pt,this.pool=new gc(O.context,30,pt.sourceCache.tileSize*pt.qualityFactor)}destruct(){this.pool.destruct()}getTexture(O){return this.pool.getObjectForId(O.rtt[this._stacks.length-1].id).texture}prepareForRender(O,pt){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=O._order.filter(Dt=>!O._layers[Dt].isHidden(pt)),this._coordsDescendingInv={};for(let Dt in O.sourceCaches){this._coordsDescendingInv[Dt]={};let Ft=O.sourceCaches[Dt].getVisibleCoordinates();for(let qt of Ft){let Ee=this.terrain.sourceCache.getTerrainCoords(qt);for(let je in Ee)this._coordsDescendingInv[Dt][je]||(this._coordsDescendingInv[Dt][je]=[]),this._coordsDescendingInv[Dt][je].push(Ee[je])}}this._coordsDescendingInvStr={};for(let Dt of O._order){let Ft=O._layers[Dt],qt=Ft.source;if(ec[Ft.type]&&!this._coordsDescendingInvStr[qt]){this._coordsDescendingInvStr[qt]={};for(let Ee in this._coordsDescendingInv[qt])this._coordsDescendingInvStr[qt][Ee]=this._coordsDescendingInv[qt][Ee].map(je=>je.key).sort().join()}}for(let Dt of this._renderableTiles)for(let Ft in this._coordsDescendingInvStr){let qt=this._coordsDescendingInvStr[Ft][Dt.tileID.key];qt&&qt!==Dt.rttCoords[Ft]&&(Dt.rtt=[])}}renderLayer(O){if(O.isHidden(this.painter.transform.zoom))return!1;let pt=O.type,Dt=this.painter,Ft=this._renderableLayerIds[this._renderableLayerIds.length-1]===O.id;if(ec[pt]&&(this._prevType&&ec[this._prevType]||this._stacks.push([]),this._prevType=pt,this._stacks[this._stacks.length-1].push(O.id),!Ft))return!0;if(ec[this._prevType]||ec[pt]&&Ft){this._prevType=pt;let qt=this._stacks.length-1,Ee=this._stacks[qt]||[];for(let je of this._renderableTiles){if(this.pool.isFull()&&(Vc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(je),je.rtt[qt]){let wr=this.pool.getObjectForId(je.rtt[qt].id);if(wr.stamp===je.rtt[qt].stamp){this.pool.useObject(wr);continue}}let er=this.pool.getOrCreateFreeObject();this.pool.useObject(er),this.pool.stampObject(er),je.rtt[qt]={id:er.id,stamp:er.stamp},Dt.context.bindFramebuffer.set(er.fbo.framebuffer),Dt.context.clear({color:i.aM.transparent,stencil:0}),Dt.currentStencilSource=void 0;for(let wr=0;wr{Kt.touchstart=Kt.dragStart,Kt.touchmoveWindow=Kt.dragMove,Kt.touchend=Kt.dragEnd},qo={showCompass:!0,showZoom:!0,visualizePitch:!1};class Bs{constructor(O,pt,Dt=!1){this.mousedown=Ee=>{this.startMouse(i.e({},Ee,{ctrlKey:!0,preventDefault:()=>Ee.preventDefault()}),s.mousePos(this.element,Ee)),s.addEventListener(window,"mousemove",this.mousemove),s.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=Ee=>{this.moveMouse(Ee,s.mousePos(this.element,Ee))},this.mouseup=Ee=>{this.mouseRotate.dragEnd(Ee),this.mousePitch&&this.mousePitch.dragEnd(Ee),this.offTemp()},this.touchstart=Ee=>{Ee.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=s.touchPos(this.element,Ee.targetTouches)[0],this.startTouch(Ee,this._startPos),s.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.addEventListener(window,"touchend",this.touchend))},this.touchmove=Ee=>{Ee.targetTouches.length!==1?this.reset():(this._lastPos=s.touchPos(this.element,Ee.targetTouches)[0],this.moveTouch(Ee,this._lastPos))},this.touchend=Ee=>{Ee.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let Ft=O.dragRotate._mouseRotate.getClickTolerance(),qt=O.dragRotate._mousePitch.getClickTolerance();this.element=pt,this.mouseRotate=Au({clickTolerance:Ft,enable:!0}),this.touchRotate=(({enable:Ee,clickTolerance:je,bearingDegreesPerPixelMoved:er=.8})=>{let wr=new Dd;return new dh({clickTolerance:je,move:(Gr,Zr)=>({bearingDelta:(Zr.x-Gr.x)*er}),moveStateManager:wr,enable:Ee,assignEvents:bc})})({clickTolerance:Ft,enable:!0}),this.map=O,Dt&&(this.mousePitch=gf({clickTolerance:qt,enable:!0}),this.touchPitch=(({enable:Ee,clickTolerance:je,pitchDegreesPerPixelMoved:er=-.5})=>{let wr=new Dd;return new dh({clickTolerance:je,move:(Gr,Zr)=>({pitchDelta:(Zr.y-Gr.y)*er}),moveStateManager:wr,enable:Ee,assignEvents:bc})})({clickTolerance:qt,enable:!0})),s.addEventListener(pt,"mousedown",this.mousedown),s.addEventListener(pt,"touchstart",this.touchstart,{passive:!1}),s.addEventListener(pt,"touchcancel",this.reset)}startMouse(O,pt){this.mouseRotate.dragStart(O,pt),this.mousePitch&&this.mousePitch.dragStart(O,pt),s.disableDrag()}startTouch(O,pt){this.touchRotate.dragStart(O,pt),this.touchPitch&&this.touchPitch.dragStart(O,pt),s.disableDrag()}moveMouse(O,pt){let Dt=this.map,{bearingDelta:Ft}=this.mouseRotate.dragMove(O,pt)||{};if(Ft&&Dt.setBearing(Dt.getBearing()+Ft),this.mousePitch){let{pitchDelta:qt}=this.mousePitch.dragMove(O,pt)||{};qt&&Dt.setPitch(Dt.getPitch()+qt)}}moveTouch(O,pt){let Dt=this.map,{bearingDelta:Ft}=this.touchRotate.dragMove(O,pt)||{};if(Ft&&Dt.setBearing(Dt.getBearing()+Ft),this.touchPitch){let{pitchDelta:qt}=this.touchPitch.dragMove(O,pt)||{};qt&&Dt.setPitch(Dt.getPitch()+qt)}}off(){let O=this.element;s.removeEventListener(O,"mousedown",this.mousedown),s.removeEventListener(O,"touchstart",this.touchstart,{passive:!1}),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend),s.removeEventListener(O,"touchcancel",this.reset),this.offTemp()}offTemp(){s.enableDrag(),s.removeEventListener(window,"mousemove",this.mousemove),s.removeEventListener(window,"mouseup",this.mouseup),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend)}}let ac;function Zl(Kt,O,pt){let Dt=new i.N(Kt.lng,Kt.lat);if(Kt=new i.N(Kt.lng,Kt.lat),O){let Ft=new i.N(Kt.lng-360,Kt.lat),qt=new i.N(Kt.lng+360,Kt.lat),Ee=pt.locationPoint(Kt).distSqr(O);pt.locationPoint(Ft).distSqr(O)180;){let Ft=pt.locationPoint(Kt);if(Ft.x>=0&&Ft.y>=0&&Ft.x<=pt.width&&Ft.y<=pt.height)break;Kt.lng>pt.center.lng?Kt.lng-=360:Kt.lng+=360}return Kt.lng!==Dt.lng&&pt.locationPoint(Kt).y>pt.height/2-pt.getHorizon()?Kt:Dt}let Mu={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 eh(Kt,O,pt){let Dt=Kt.classList;for(let Ft in Mu)Dt.remove(`maplibregl-${pt}-anchor-${Ft}`);Dt.add(`maplibregl-${pt}-anchor-${O}`)}class Vu extends i.E{constructor(O){if(super(),this._onKeyPress=pt=>{let Dt=pt.code,Ft=pt.charCode||pt.keyCode;Dt!=="Space"&&Dt!=="Enter"&&Ft!==32&&Ft!==13||this.togglePopup()},this._onMapClick=pt=>{let Dt=pt.originalEvent.target,Ft=this._element;this._popup&&(Dt===Ft||Ft.contains(Dt))&&this.togglePopup()},this._update=pt=>{var Dt;if(!this._map)return;let Ft=this._map.loaded()&&!this._map.isMoving();(pt?.type==="terrain"||pt?.type==="render"&&!Ft)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Zl(this._lngLat,this._flatPos,this._map.transform):(Dt=this._lngLat)===null||Dt===void 0?void 0:Dt.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let qt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?qt=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(qt=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let Ee="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Ee="rotateX(0deg)":this._pitchAlignment==="map"&&(Ee=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||pt&&pt.type!=="moveend"||(this._pos=this._pos.round()),s.setTransform(this._element,`${Mu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${Ee} ${qt}`),c.frameAsync(new AbortController).then(()=>{this._updateOpacity(pt&&pt.type==="moveend")}).catch(()=>{})},this._onMove=pt=>{if(!this._isDragging){let Dt=this._clickTolerance||this._map._clickTolerance;this._isDragging=pt.point.dist(this._pointerdownPos)>=Dt}this._isDragging&&(this._pos=pt.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new i.k("dragstart"))),this.fire(new i.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new i.k("dragend")),this._state="inactive"},this._addDragHandler=pt=>{this._element.contains(pt.originalEvent.target)&&(pt.preventDefault(),this._positionDelta=pt.point.sub(this._pos).add(this._offset),this._pointerdownPos=pt.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=O&&O.anchor||"center",this._color=O&&O.color||"#3FB1CE",this._scale=O&&O.scale||1,this._draggable=O&&O.draggable||!1,this._clickTolerance=O&&O.clickTolerance||0,this._subpixelPositioning=O&&O.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=O&&O.rotation||0,this._rotationAlignment=O&&O.rotationAlignment||"auto",this._pitchAlignment=O&&O.pitchAlignment&&O.pitchAlignment!=="auto"?O.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(O?.opacity,O?.opacityWhenCovered),O&&O.element)this._element=O.element,this._offset=i.P.convert(O&&O.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");let pt=s.createNS("http://www.w3.org/2000/svg","svg"),Dt=41,Ft=27;pt.setAttributeNS(null,"display","block"),pt.setAttributeNS(null,"height",`${Dt}px`),pt.setAttributeNS(null,"width",`${Ft}px`),pt.setAttributeNS(null,"viewBox",`0 0 ${Ft} ${Dt}`);let qt=s.createNS("http://www.w3.org/2000/svg","g");qt.setAttributeNS(null,"stroke","none"),qt.setAttributeNS(null,"stroke-width","1"),qt.setAttributeNS(null,"fill","none"),qt.setAttributeNS(null,"fill-rule","evenodd");let Ee=s.createNS("http://www.w3.org/2000/svg","g");Ee.setAttributeNS(null,"fill-rule","nonzero");let je=s.createNS("http://www.w3.org/2000/svg","g");je.setAttributeNS(null,"transform","translate(3.0, 29.0)"),je.setAttributeNS(null,"fill","#000000");let er=[{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(let Pe of er){let We=s.createNS("http://www.w3.org/2000/svg","ellipse");We.setAttributeNS(null,"opacity","0.04"),We.setAttributeNS(null,"cx","10.5"),We.setAttributeNS(null,"cy","5.80029008"),We.setAttributeNS(null,"rx",Pe.rx),We.setAttributeNS(null,"ry",Pe.ry),je.appendChild(We)}let wr=s.createNS("http://www.w3.org/2000/svg","g");wr.setAttributeNS(null,"fill",this._color);let Gr=s.createNS("http://www.w3.org/2000/svg","path");Gr.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"),wr.appendChild(Gr);let Zr=s.createNS("http://www.w3.org/2000/svg","g");Zr.setAttributeNS(null,"opacity","0.25"),Zr.setAttributeNS(null,"fill","#000000");let Tn=s.createNS("http://www.w3.org/2000/svg","path");Tn.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"),Zr.appendChild(Tn);let qn=s.createNS("http://www.w3.org/2000/svg","g");qn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),qn.setAttributeNS(null,"fill","#FFFFFF");let te=s.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"transform","translate(8.0, 8.0)");let le=s.createNS("http://www.w3.org/2000/svg","circle");le.setAttributeNS(null,"fill","#000000"),le.setAttributeNS(null,"opacity","0.25"),le.setAttributeNS(null,"cx","5.5"),le.setAttributeNS(null,"cy","5.5"),le.setAttributeNS(null,"r","5.4999962");let Te=s.createNS("http://www.w3.org/2000/svg","circle");Te.setAttributeNS(null,"fill","#FFFFFF"),Te.setAttributeNS(null,"cx","5.5"),Te.setAttributeNS(null,"cy","5.5"),Te.setAttributeNS(null,"r","5.4999962"),te.appendChild(le),te.appendChild(Te),Ee.appendChild(je),Ee.appendChild(wr),Ee.appendChild(Zr),Ee.appendChild(qn),Ee.appendChild(te),pt.appendChild(Ee),pt.setAttributeNS(null,"height",Dt*this._scale+"px"),pt.setAttributeNS(null,"width",Ft*this._scale+"px"),this._element.appendChild(pt),this._offset=i.P.convert(O&&O.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",pt=>{pt.preventDefault()}),this._element.addEventListener("mousedown",pt=>{pt.preventDefault()}),eh(this._element,this._anchor,"marker"),O&&O.className)for(let pt of O.className.split(" "))this._element.classList.add(pt);this._popup=null}addTo(O){return this.remove(),this._map=O,this._element.setAttribute("aria-label",O._getUIString("Marker.Title")),O.getCanvasContainer().appendChild(this._element),O.on("move",this._update),O.on("moveend",this._update),O.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("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),s.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(O){return this._lngLat=i.N.convert(O),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(O){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),O){if(!("offset"in O.options)){let pt=Math.abs(13.5)/Math.SQRT2;O.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[pt,-1*(38.1-13.5+pt)],"bottom-right":[-pt,-1*(38.1-13.5+pt)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=O,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(O){return this._subpixelPositioning=O,this}getPopup(){return this._popup}togglePopup(){let O=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:O?(O.isOpen()?O.remove():(O.setLngLat(this._lngLat),O.addTo(this._map)),this):this}_updateOpacity(O=!1){var pt,Dt;if(!(!((pt=this._map)===null||pt===void 0)&&pt.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(O)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Ft=this._map,qt=Ft.terrain.depthAtPoint(this._pos),Ee=Ft.terrain.getElevationForLngLatZoom(this._lngLat,Ft.transform.tileZoom);if(Ft.transform.lngLatToCameraDepth(this._lngLat,Ee)-qt<.006)return void(this._element.style.opacity=this._opacity);let je=-this._offset.y/Ft.transform._pixelPerMeter,er=Math.sin(Ft.getPitch()*Math.PI/180)*je,wr=Ft.terrain.depthAtPoint(new i.P(this._pos.x,this._pos.y-this._offset.y)),Gr=Ft.transform.lngLatToCameraDepth(this._lngLat,Ee+er)-wr>.006;!((Dt=this._popup)===null||Dt===void 0)&&Dt.isOpen()&&Gr&&this._popup.remove(),this._element.style.opacity=Gr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(O){return this._offset=i.P.convert(O),this._update(),this}addClassName(O){this._element.classList.add(O)}removeClassName(O){this._element.classList.remove(O)}toggleClassName(O){return this._element.classList.toggle(O)}setDraggable(O){return this._draggable=!!O,this._map&&(O?(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(O){return this._rotation=O||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(O){return this._rotationAlignment=O||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(O){return this._pitchAlignment=O&&O!=="auto"?O:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(O,pt){return O===void 0&&pt===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),O!==void 0&&(this._opacity=O),pt!==void 0&&(this._opacityWhenCovered=pt),this._map&&this._updateOpacity(!0),this}}let Wh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},rh=0,qh=!1,Wc={maxWidth:100,unit:"metric"};function Gh(Kt,O,pt){let Dt=pt&&pt.maxWidth||100,Ft=Kt._container.clientHeight/2,qt=Kt.unproject([0,Ft]),Ee=Kt.unproject([Dt,Ft]),je=qt.distanceTo(Ee);if(pt&&pt.unit==="imperial"){let er=3.2808*je;er>5280?ds(O,Dt,er/5280,Kt._getUIString("ScaleControl.Miles")):ds(O,Dt,er,Kt._getUIString("ScaleControl.Feet"))}else pt&&pt.unit==="nautical"?ds(O,Dt,je/1852,Kt._getUIString("ScaleControl.NauticalMiles")):je>=1e3?ds(O,Dt,je/1e3,Kt._getUIString("ScaleControl.Kilometers")):ds(O,Dt,je,Kt._getUIString("ScaleControl.Meters"))}function ds(Kt,O,pt,Dt){let Ft=function(qt){let Ee=Math.pow(10,`${Math.floor(qt)}`.length-1),je=qt/Ee;return je=je>=10?10:je>=5?5:je>=3?3:je>=2?2:je>=1?1:function(er){let wr=Math.pow(10,Math.ceil(-Math.log(er)/Math.LN10));return Math.round(er*wr)/wr}(je),Ee*je}(pt);Kt.style.width=O*(Ft/pt)+"px",Kt.innerHTML=`${Ft} ${Dt}`}let $s={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},nh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function eu(Kt){if(Kt){if(typeof Kt=="number"){let O=Math.round(Math.abs(Kt)/Math.SQRT2);return{center:new i.P(0,0),top:new i.P(0,Kt),"top-left":new i.P(O,O),"top-right":new i.P(-O,O),bottom:new i.P(0,-Kt),"bottom-left":new i.P(O,-O),"bottom-right":new i.P(-O,-O),left:new i.P(Kt,0),right:new i.P(-Kt,0)}}if(Kt instanceof i.P||Array.isArray(Kt)){let O=i.P.convert(Kt);return{center:O,top:O,"top-left":O,"top-right":O,bottom:O,"bottom-left":O,"bottom-right":O,left:O,right:O}}return{center:i.P.convert(Kt.center||[0,0]),top:i.P.convert(Kt.top||[0,0]),"top-left":i.P.convert(Kt["top-left"]||[0,0]),"top-right":i.P.convert(Kt["top-right"]||[0,0]),bottom:i.P.convert(Kt.bottom||[0,0]),"bottom-left":i.P.convert(Kt["bottom-left"]||[0,0]),"bottom-right":i.P.convert(Kt["bottom-right"]||[0,0]),left:i.P.convert(Kt.left||[0,0]),right:i.P.convert(Kt.right||[0,0])}}return eu(new i.P(0,0))}let lf=a;n.AJAXError=i.bh,n.Evented=i.E,n.LngLat=i.N,n.MercatorCoordinate=i.Z,n.Point=i.P,n.addProtocol=i.bi,n.config=i.a,n.removeProtocol=i.bj,n.AttributionControl=ws,n.BoxZoomHandler=th,n.CanvasSource=ye,n.CooperativeGesturesHandler=Za,n.DoubleClickZoomHandler=Pi,n.DragPanHandler=Ja,n.DragRotateHandler=uo,n.EdgeInsets=ju,n.FullscreenControl=class extends i.E{constructor(Kt={}){super(),this._onFullscreenChange=()=>{var O;let pt=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((O=pt?.shadowRoot)===null||O===void 0)&&O.fullscreenElement;)pt=pt.shadowRoot.fullscreenElement;pt===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Kt&&Kt.container&&(Kt.container instanceof HTMLElement?this._container=Kt.container:i.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Kt){return this._map=Kt,this._container||(this._container=this._map.getContainer()),this._controlContainer=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){s.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Kt=this._fullscreenButton=s.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);s.create("span","maplibregl-ctrl-icon",Kt).setAttribute("aria-hidden","true"),Kt.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Kt=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Kt),this._fullscreenButton.title=Kt}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new i.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new i.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},n.GeoJSONSource=Gt,n.GeolocateControl=class extends i.E{constructor(Kt){super(),this._onSuccess=O=>{if(this._map){if(this._isOutOfMapMaxBounds(O))return this._setErrorState(),this.fire(new i.k("outofmaxbounds",O)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=O,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(O),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(O),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new i.k("geolocate",O)),this._finish()}},this._updateCamera=O=>{let pt=new i.N(O.coords.longitude,O.coords.latitude),Dt=O.coords.accuracy,Ft=this._map.getBearing(),qt=i.e({bearing:Ft},this.options.fitBoundsOptions),Ee=dt.fromLngLat(pt,Dt);this._map.fitBounds(Ee,qt,{geolocateSource:!0})},this._updateMarker=O=>{if(O){let pt=new i.N(O.coords.longitude,O.coords.latitude);this._accuracyCircleMarker.setLngLat(pt).addTo(this._map),this._userLocationDotMarker.setLngLat(pt).addTo(this._map),this._accuracy=O.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=O=>{if(this._map){if(this.options.trackUserLocation)if(O.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let pt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=pt,this._geolocateButton.setAttribute("aria-label",pt),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(O.code===3&&qh)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new i.k("error",O)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",O=>O.preventDefault()),this._geolocateButton=s.create("button","maplibregl-ctrl-geolocate",this._container),s.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=O=>{if(this._map){if(O===!1){i.w("Geolocation support is not available so the GeolocateControl will be disabled.");let pt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=pt,this._geolocateButton.setAttribute("aria-label",pt)}else{let pt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=pt,this._geolocateButton.setAttribute("aria-label",pt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=s.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Vu({element:this._dotElement}),this._circleElement=s.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Vu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",pt=>{pt.geolocateSource||this._watchState!=="ACTIVE_LOCK"||pt.originalEvent&&pt.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new i.k("trackuserlocationend")),this.fire(new i.k("userlocationlostfocus")))})}},this.options=i.e({},Wh,Kt)}onAdd(Kt){return this._map=Kt,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return i._(this,arguments,void 0,function*(O=!1){if(ac!==void 0&&!O)return ac;if(window.navigator.permissions===void 0)return ac=!!window.navigator.geolocation,ac;try{ac=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ac=!!window.navigator.geolocation}return ac})}().then(O=>this._finishSetupUI(O)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),s.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,rh=0,qh=!1}_isOutOfMapMaxBounds(Kt){let O=this._map.getMaxBounds(),pt=Kt.coords;return O&&(pt.longitudeO.getEast()||pt.latitudeO.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let Kt=this._map.getBounds(),O=Kt.getSouthEast(),pt=Kt.getNorthEast(),Dt=O.distanceTo(pt),Ft=Math.ceil(this._accuracy/(Dt/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Ft}px`,this._circleElement.style.height=`${Ft}px`}trigger(){if(!this._setup)return i.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new i.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":rh--,qh=!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 i.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new i.k("trackuserlocationstart")),this.fire(new i.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Kt;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),rh++,rh>1?(Kt={maximumAge:6e5,timeout:0},qh=!0):(Kt=this.options.positionOptions,qh=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Kt)}}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)}},n.Hash=Eh,n.ImageSource=xe,n.KeyboardHandler=Qr,n.LngLatBounds=dt,n.LogoControl=bo,n.Map=class extends os{constructor(Kt){i.bf.mark(i.bg.create);let O=Object.assign(Object.assign({},$c),Kt);if(O.minZoom!=null&&O.maxZoom!=null&&O.minZoom>O.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(O.minPitch!=null&&O.maxPitch!=null&&O.minPitch>O.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(O.minPitch!=null&&O.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(O.maxPitch!=null&&O.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Pc(O.minZoom,O.maxZoom,O.minPitch,O.maxPitch,O.renderWorldCopies),{bearingSnap:O.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new lo,this._controls=[],this._mapId=i.a4(),this._contextLost=pt=>{pt.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new i.k("webglcontextlost",{originalEvent:pt}))},this._contextRestored=pt=>{this._setupPainter(),this.resize(),this._update(),this.fire(new i.k("webglcontextrestored",{originalEvent:pt}))},this._onMapScroll=pt=>{if(pt.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=O.interactive,this._maxTileCacheSize=O.maxTileCacheSize,this._maxTileCacheZoomLevels=O.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=O.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=O.preserveDrawingBuffer===!0,this._antialias=O.antialias===!0,this._trackResize=O.trackResize===!0,this._bearingSnap=O.bearingSnap,this._refreshExpiredTiles=O.refreshExpiredTiles===!0,this._fadeDuration=O.fadeDuration,this._crossSourceCollisions=O.crossSourceCollisions===!0,this._collectResourceTiming=O.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},El),O.locale),this._clickTolerance=O.clickTolerance,this._overridePixelRatio=O.pixelRatio,this._maxCanvasSize=O.maxCanvasSize,this.transformCameraUpdate=O.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=O.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=d.addThrottleControl(()=>this.isMoving()),this._requestManager=new k(O.transformRequest),typeof O.container=="string"){if(this._container=document.getElementById(O.container),!this._container)throw new Error(`Container '${O.container}' not found.`)}else{if(!(O.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=O.container}if(O.maxBounds&&this.setMaxBounds(O.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let pt=!1,Dt=xd(Ft=>{this._trackResize&&!this._removed&&(this.resize(Ft),this.redraw())},50);this._resizeObserver=new ResizeObserver(Ft=>{pt?Dt(Ft):pt=!0}),this._resizeObserver.observe(this._container)}this.handlers=new fs(this,O),this._hash=O.hash&&new Eh(typeof O.hash=="string"&&O.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:O.center,zoom:O.zoom,bearing:O.bearing,pitch:O.pitch}),O.bounds&&(this.resize(),this.fitBounds(O.bounds,i.e({},O.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=O.localIdeographFontFamily,this._validateStyle=O.validateStyle,O.style&&this.setStyle(O.style,{localIdeographFontFamily:O.localIdeographFontFamily}),O.attributionControl&&this.addControl(new ws(typeof O.attributionControl=="boolean"?void 0:O.attributionControl)),O.maplibreLogo&&this.addControl(new bo,O.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",pt=>{this._update(pt.dataType==="style"),this.fire(new i.k(`${pt.dataType}data`,pt))}),this.on("dataloading",pt=>{this.fire(new i.k(`${pt.dataType}dataloading`,pt))}),this.on("dataabort",pt=>{this.fire(new i.k("sourcedataabort",pt))})}_getMapId(){return this._mapId}addControl(Kt,O){if(O===void 0&&(O=Kt.getDefaultPosition?Kt.getDefaultPosition():"top-right"),!Kt||!Kt.onAdd)return this.fire(new i.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let pt=Kt.onAdd(this);this._controls.push(Kt);let Dt=this._controlPositions[O];return O.indexOf("bottom")!==-1?Dt.insertBefore(pt,Dt.firstChild):Dt.appendChild(pt),this}removeControl(Kt){if(!Kt||!Kt.onRemove)return this.fire(new i.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let O=this._controls.indexOf(Kt);return O>-1&&this._controls.splice(O,1),Kt.onRemove(this),this}hasControl(Kt){return this._controls.indexOf(Kt)>-1}calculateCameraOptionsFromTo(Kt,O,pt,Dt){return Dt==null&&this.terrain&&(Dt=this.terrain.getElevationForLngLatZoom(pt,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Kt,O,pt,Dt)}resize(Kt){var O;let pt=this._containerDimensions(),Dt=pt[0],Ft=pt[1],qt=this._getClampedPixelRatio(Dt,Ft);if(this._resizeCanvas(Dt,Ft,qt),this.painter.resize(Dt,Ft,qt),this.painter.overLimit()){let je=this.painter.context.gl;this._maxCanvasSize=[je.drawingBufferWidth,je.drawingBufferHeight];let er=this._getClampedPixelRatio(Dt,Ft);this._resizeCanvas(Dt,Ft,er),this.painter.resize(Dt,Ft,er)}this.transform.resize(Dt,Ft),(O=this._requestedCameraState)===null||O===void 0||O.resize(Dt,Ft);let Ee=!this._moving;return Ee&&(this.stop(),this.fire(new i.k("movestart",Kt)).fire(new i.k("move",Kt))),this.fire(new i.k("resize",Kt)),Ee&&this.fire(new i.k("moveend",Kt)),this}_getClampedPixelRatio(Kt,O){let{0:pt,1:Dt}=this._maxCanvasSize,Ft=this.getPixelRatio(),qt=Kt*Ft,Ee=O*Ft;return Math.min(qt>pt?pt/qt:1,Ee>Dt?Dt/Ee:1)*Ft}getPixelRatio(){var Kt;return(Kt=this._overridePixelRatio)!==null&&Kt!==void 0?Kt:devicePixelRatio}setPixelRatio(Kt){this._overridePixelRatio=Kt,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Kt){return this.transform.setMaxBounds(dt.convert(Kt)),this._update()}setMinZoom(Kt){if((Kt=Kt??-2)>=-2&&Kt<=this.transform.maxZoom)return this.transform.minZoom=Kt,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Kt,this._update(),this.getZoom()>Kt&&this.setZoom(Kt),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Kt){if((Kt=Kt??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Kt>=0&&Kt<=this.transform.maxPitch)return this.transform.minPitch=Kt,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Kt>=this.transform.minPitch)return this.transform.maxPitch=Kt,this._update(),this.getPitch()>Kt&&this.setPitch(Kt),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Kt){return this.transform.renderWorldCopies=Kt,this._update()}project(Kt){return this.transform.locationPoint(i.N.convert(Kt),this.style&&this.terrain)}unproject(Kt){return this.transform.pointLocation(i.P.convert(Kt),this.terrain)}isMoving(){var Kt;return this._moving||((Kt=this.handlers)===null||Kt===void 0?void 0:Kt.isMoving())}isZooming(){var Kt;return this._zooming||((Kt=this.handlers)===null||Kt===void 0?void 0:Kt.isZooming())}isRotating(){var Kt;return this._rotating||((Kt=this.handlers)===null||Kt===void 0?void 0:Kt.isRotating())}_createDelegatedListener(Kt,O,pt){if(Kt==="mouseenter"||Kt==="mouseover"){let Dt=!1;return{layers:O,listener:pt,delegates:{mousemove:Ft=>{let qt=O.filter(je=>this.getLayer(je)),Ee=qt.length!==0?this.queryRenderedFeatures(Ft.point,{layers:qt}):[];Ee.length?Dt||(Dt=!0,pt.call(this,new hh(Kt,this,Ft.originalEvent,{features:Ee}))):Dt=!1},mouseout:()=>{Dt=!1}}}}if(Kt==="mouseleave"||Kt==="mouseout"){let Dt=!1;return{layers:O,listener:pt,delegates:{mousemove:Ft=>{let qt=O.filter(Ee=>this.getLayer(Ee));(qt.length!==0?this.queryRenderedFeatures(Ft.point,{layers:qt}):[]).length?Dt=!0:Dt&&(Dt=!1,pt.call(this,new hh(Kt,this,Ft.originalEvent)))},mouseout:Ft=>{Dt&&(Dt=!1,pt.call(this,new hh(Kt,this,Ft.originalEvent)))}}}}{let Dt=Ft=>{let qt=O.filter(je=>this.getLayer(je)),Ee=qt.length!==0?this.queryRenderedFeatures(Ft.point,{layers:qt}):[];Ee.length&&(Ft.features=Ee,pt.call(this,Ft),delete Ft.features)};return{layers:O,listener:pt,delegates:{[Kt]:Dt}}}}_saveDelegatedListener(Kt,O){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Kt]=this._delegatedListeners[Kt]||[],this._delegatedListeners[Kt].push(O)}_removeDelegatedListener(Kt,O,pt){if(!this._delegatedListeners||!this._delegatedListeners[Kt])return;let Dt=this._delegatedListeners[Kt];for(let Ft=0;FtO.includes(Ee))){for(let Ee in qt.delegates)this.off(Ee,qt.delegates[Ee]);return void Dt.splice(Ft,1)}}}on(Kt,O,pt){if(pt===void 0)return super.on(Kt,O);let Dt=this._createDelegatedListener(Kt,typeof O=="string"?[O]:O,pt);this._saveDelegatedListener(Kt,Dt);for(let Ft in Dt.delegates)this.on(Ft,Dt.delegates[Ft]);return this}once(Kt,O,pt){if(pt===void 0)return super.once(Kt,O);let Dt=typeof O=="string"?[O]:O,Ft=this._createDelegatedListener(Kt,Dt,pt);for(let qt in Ft.delegates){let Ee=Ft.delegates[qt];Ft.delegates[qt]=(...je)=>{this._removeDelegatedListener(Kt,Dt,pt),Ee(...je)}}this._saveDelegatedListener(Kt,Ft);for(let qt in Ft.delegates)this.once(qt,Ft.delegates[qt]);return this}off(Kt,O,pt){return pt===void 0?super.off(Kt,O):(this._removeDelegatedListener(Kt,typeof O=="string"?[O]:O,pt),this)}queryRenderedFeatures(Kt,O){if(!this.style)return[];let pt,Dt=Kt instanceof i.P||Array.isArray(Kt),Ft=Dt?Kt:[[0,0],[this.transform.width,this.transform.height]];if(O=O||(Dt?{}:Kt)||{},Ft instanceof i.P||typeof Ft[0]=="number")pt=[i.P.convert(Ft)];else{let qt=i.P.convert(Ft[0]),Ee=i.P.convert(Ft[1]);pt=[qt,new i.P(Ee.x,qt.y),Ee,new i.P(qt.x,Ee.y),qt]}return this.style.queryRenderedFeatures(pt,O,this.transform)}querySourceFeatures(Kt,O){return this.style.querySourceFeatures(Kt,O)}setStyle(Kt,O){return(O=i.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},O)).diff!==!1&&O.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Kt?(this._diffStyle(Kt,O),this):(this._localIdeographFontFamily=O.localIdeographFontFamily,this._updateStyle(Kt,O))}setTransformRequest(Kt){return this._requestManager.setTransformRequest(Kt),this}_getUIString(Kt){let O=this._locale[Kt];if(O==null)throw new Error(`Missing UI string '${Kt}'`);return O}_updateStyle(Kt,O){if(O.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Kt,O));let pt=this.style&&O.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Kt)),Kt?(this.style=new un(this,O||{}),this.style.setEventedParent(this,{style:this.style}),typeof Kt=="string"?this.style.loadURL(Kt,O,pt):this.style.loadJSON(Kt,O,pt),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new un(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Kt,O){if(typeof Kt=="string"){let pt=this._requestManager.transformRequest(Kt,"Style");i.h(pt,new AbortController).then(Dt=>{this._updateDiff(Dt.data,O)}).catch(Dt=>{Dt&&this.fire(new i.j(Dt))})}else typeof Kt=="object"&&this._updateDiff(Kt,O)}_updateDiff(Kt,O){try{this.style.setState(Kt,O)&&this._update(!0)}catch(pt){i.w(`Unable to perform style diff: ${pt.message||pt.error||pt}. Rebuilding the style from scratch.`),this._updateStyle(Kt,O)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():i.w("There is no style added to the map.")}addSource(Kt,O){return this._lazyInitEmptyStyle(),this.style.addSource(Kt,O),this._update(!0)}isSourceLoaded(Kt){let O=this.style&&this.style.sourceCaches[Kt];if(O!==void 0)return O.loaded();this.fire(new i.j(new Error(`There is no source with ID '${Kt}'`)))}setTerrain(Kt){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Kt){let O=this.style.sourceCaches[Kt.source];if(!O)throw new Error(`cannot load terrain, because there exists no source with ID: ${Kt.source}`);this.terrain===null&&O.reload();for(let pt in this.style._layers){let Dt=this.style._layers[pt];Dt.type==="hillshade"&&Dt.source===Kt.source&&i.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Vl(this.painter,O,Kt),this.painter.renderToTexture=new vc(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=pt=>{pt.dataType==="style"?this.terrain.sourceCache.freeRtt():pt.dataType==="source"&&pt.tile&&(pt.sourceId!==Kt.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(pt.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.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new i.k("terrain",{terrain:Kt})),this}getTerrain(){var Kt,O;return(O=(Kt=this.terrain)===null||Kt===void 0?void 0:Kt.options)!==null&&O!==void 0?O:null}areTilesLoaded(){let Kt=this.style&&this.style.sourceCaches;for(let O in Kt){let pt=Kt[O]._tiles;for(let Dt in pt){let Ft=pt[Dt];if(Ft.state!=="loaded"&&Ft.state!=="errored")return!1}}return!0}removeSource(Kt){return this.style.removeSource(Kt),this._update(!0)}getSource(Kt){return this.style.getSource(Kt)}addImage(Kt,O,pt={}){let{pixelRatio:Dt=1,sdf:Ft=!1,stretchX:qt,stretchY:Ee,content:je,textFitWidth:er,textFitHeight:wr}=pt;if(this._lazyInitEmptyStyle(),!(O instanceof HTMLImageElement||i.b(O))){if(O.width===void 0||O.height===void 0)return this.fire(new i.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:Gr,height:Zr,data:Tn}=O,qn=O;return this.style.addImage(Kt,{data:new i.R({width:Gr,height:Zr},new Uint8Array(Tn)),pixelRatio:Dt,stretchX:qt,stretchY:Ee,content:je,textFitWidth:er,textFitHeight:wr,sdf:Ft,version:0,userImage:qn}),qn.onAdd&&qn.onAdd(this,Kt),this}}{let{width:Gr,height:Zr,data:Tn}=c.getImageData(O);this.style.addImage(Kt,{data:new i.R({width:Gr,height:Zr},Tn),pixelRatio:Dt,stretchX:qt,stretchY:Ee,content:je,textFitWidth:er,textFitHeight:wr,sdf:Ft,version:0})}}updateImage(Kt,O){let pt=this.style.getImage(Kt);if(!pt)return this.fire(new i.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let Dt=O instanceof HTMLImageElement||i.b(O)?c.getImageData(O):O,{width:Ft,height:qt,data:Ee}=Dt;if(Ft===void 0||qt===void 0)return this.fire(new i.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Ft!==pt.data.width||qt!==pt.data.height)return this.fire(new i.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let je=!(O instanceof HTMLImageElement||i.b(O));return pt.data.replace(Ee,je),this.style.updateImage(Kt,pt),this}getImage(Kt){return this.style.getImage(Kt)}hasImage(Kt){return Kt?!!this.style.getImage(Kt):(this.fire(new i.j(new Error("Missing required image id"))),!1)}removeImage(Kt){this.style.removeImage(Kt)}loadImage(Kt){return d.getImage(this._requestManager.transformRequest(Kt,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Kt,O){return this._lazyInitEmptyStyle(),this.style.addLayer(Kt,O),this._update(!0)}moveLayer(Kt,O){return this.style.moveLayer(Kt,O),this._update(!0)}removeLayer(Kt){return this.style.removeLayer(Kt),this._update(!0)}getLayer(Kt){return this.style.getLayer(Kt)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Kt,O,pt){return this.style.setLayerZoomRange(Kt,O,pt),this._update(!0)}setFilter(Kt,O,pt={}){return this.style.setFilter(Kt,O,pt),this._update(!0)}getFilter(Kt){return this.style.getFilter(Kt)}setPaintProperty(Kt,O,pt,Dt={}){return this.style.setPaintProperty(Kt,O,pt,Dt),this._update(!0)}getPaintProperty(Kt,O){return this.style.getPaintProperty(Kt,O)}setLayoutProperty(Kt,O,pt,Dt={}){return this.style.setLayoutProperty(Kt,O,pt,Dt),this._update(!0)}getLayoutProperty(Kt,O){return this.style.getLayoutProperty(Kt,O)}setGlyphs(Kt,O={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Kt,O),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Kt,O,pt={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Kt,O,pt,Dt=>{Dt||this._update(!0)}),this}removeSprite(Kt){return this._lazyInitEmptyStyle(),this.style.removeSprite(Kt),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Kt,O={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Kt,O,pt=>{pt||this._update(!0)}),this}setLight(Kt,O={}){return this._lazyInitEmptyStyle(),this.style.setLight(Kt,O),this._update(!0)}getLight(){return this.style.getLight()}setSky(Kt){return this._lazyInitEmptyStyle(),this.style.setSky(Kt),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Kt,O){return this.style.setFeatureState(Kt,O),this._update()}removeFeatureState(Kt,O){return this.style.removeFeatureState(Kt,O),this._update()}getFeatureState(Kt){return this.style.getFeatureState(Kt)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Kt=0,O=0;return this._container&&(Kt=this._container.clientWidth||400,O=this._container.clientHeight||300),[Kt,O]}_setupContainer(){let Kt=this._container;Kt.classList.add("maplibregl-map");let O=this._canvasContainer=s.create("div","maplibregl-canvas-container",Kt);this._interactive&&O.classList.add("maplibregl-interactive"),this._canvas=s.create("canvas","maplibregl-canvas",O),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let pt=this._containerDimensions(),Dt=this._getClampedPixelRatio(pt[0],pt[1]);this._resizeCanvas(pt[0],pt[1],Dt);let Ft=this._controlContainer=s.create("div","maplibregl-control-container",Kt),qt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(Ee=>{qt[Ee]=s.create("div",`maplibregl-ctrl-${Ee} `,Ft)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Kt,O,pt){this._canvas.width=Math.floor(pt*Kt),this._canvas.height=Math.floor(pt*O),this._canvas.style.width=`${Kt}px`,this._canvas.style.height=`${O}px`}_setupPainter(){let Kt={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},O=null;this._canvas.addEventListener("webglcontextcreationerror",Dt=>{O={requestedAttributes:Kt},Dt&&(O.statusMessage=Dt.statusMessage,O.type=Dt.type)},{once:!0});let pt=this._canvas.getContext("webgl2",Kt)||this._canvas.getContext("webgl",Kt);if(!pt){let Dt="Failed to initialize WebGL";throw O?(O.message=Dt,new Error(JSON.stringify(O))):new Error(Dt)}this.painter=new rd(pt,this.transform),h.testSupport(pt)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Kt){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Kt,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Kt){return this._update(),this._renderTaskQueue.add(Kt)}_cancelRenderFrame(Kt){this._renderTaskQueue.remove(Kt)}_render(Kt){let O=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Kt),this._removed)return;let pt=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Ft=this.transform.zoom,qt=c.now();this.style.zoomHistory.update(Ft,qt);let Ee=new i.z(Ft,{now:qt,fadeDuration:O,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),je=Ee.crossFadingFactor();je===1&&je===this._crossFadingFactor||(pt=!0,this._crossFadingFactor=je),this.style.update(Ee)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,O,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:O,showPadding:this.showPadding}),this.fire(new i.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,i.bf.mark(i.bg.load),this.fire(new i.k("load"))),this.style&&(this.style.hasTransitions()||pt)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let Dt=this._sourcesDirty||this._styleDirty||this._placementDirty;return Dt||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new i.k("idle")),!this._loaded||this._fullyLoaded||Dt||(this._fullyLoaded=!0,i.bf.mark(i.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Kt;this._hash&&this._hash.remove();for(let pt of this._controls)pt.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),d.removeThrottleControl(this._imageQueueHandle),(Kt=this._resizeObserver)===null||Kt===void 0||Kt.disconnect();let O=this.painter.context.gl.getExtension("WEBGL_lose_context");O!=null&&O.loseContext&&O.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),s.remove(this._canvasContainer),s.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),i.bf.clearMetrics(),this._removed=!0,this.fire(new i.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,c.frameAsync(this._frameRequest).then(Kt=>{i.bf.frame(Kt),this._frameRequest=null,this._render(Kt)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Kt){this._showTileBoundaries!==Kt&&(this._showTileBoundaries=Kt,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Kt){this._showPadding!==Kt&&(this._showPadding=Kt,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Kt){this._showCollisionBoxes!==Kt&&(this._showCollisionBoxes=Kt,Kt?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Kt){this._showOverdrawInspector!==Kt&&(this._showOverdrawInspector=Kt,this._update())}get repaint(){return!!this._repaint}set repaint(Kt){this._repaint!==Kt&&(this._repaint=Kt,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Kt){this._vertices=Kt,this._update()}get version(){return tu}getCameraTargetElevation(){return this.transform.elevation}},n.MapMouseEvent=hh,n.MapTouchEvent=kd,n.MapWheelEvent=Hd,n.Marker=Vu,n.NavigationControl=class{constructor(Kt){this._updateZoomButtons=()=>{let O=this._map.getZoom(),pt=O===this._map.getMaxZoom(),Dt=O===this._map.getMinZoom();this._zoomInButton.disabled=pt,this._zoomOutButton.disabled=Dt,this._zoomInButton.setAttribute("aria-disabled",pt.toString()),this._zoomOutButton.setAttribute("aria-disabled",Dt.toString())},this._rotateCompassArrow=()=>{let O=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=O},this._setButtonTitle=(O,pt)=>{let Dt=this._map._getUIString(`NavigationControl.${pt}`);O.title=Dt,O.setAttribute("aria-label",Dt)},this.options=i.e({},qo,Kt),this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",O=>O.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",O=>this._map.zoomIn({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",O=>this._map.zoomOut({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",O=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:O}):this._map.resetNorth({},{originalEvent:O})}),this._compassIcon=s.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Kt){return this._map=Kt,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 Bs(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){s.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(Kt,O){let pt=s.create("button",Kt,this._container);return pt.type="button",pt.addEventListener("click",O),pt}},n.Popup=class extends i.E{constructor(Kt){super(),this.remove=()=>(this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new i.k("close"))),this),this._onMouseUp=O=>{this._update(O.point)},this._onMouseMove=O=>{this._update(O.point)},this._onDrag=O=>{this._update(O.point)},this._update=O=>{var pt;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=s.create("div","maplibregl-popup",this._map.getContainer()),this._tip=s.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let je of this.options.className.split(" "))this._container.classList.add(je);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Zl(this._lngLat,this._flatPos,this._map.transform):(pt=this._lngLat)===null||pt===void 0?void 0:pt.wrap(),this._trackPointer&&!O)return;let Dt=this._flatPos=this._pos=this._trackPointer&&O?O:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&O?O:this._map.transform.locationPoint(this._lngLat));let Ft=this.options.anchor,qt=eu(this.options.offset);if(!Ft){let je=this._container.offsetWidth,er=this._container.offsetHeight,wr;wr=Dt.y+qt.bottom.ythis._map.transform.height-er?["bottom"]:[],Dt.xthis._map.transform.width-je/2&&wr.push("right"),Ft=wr.length===0?"bottom":wr.join("-")}let Ee=Dt.add(qt[Ft]);this.options.subpixelPositioning||(Ee=Ee.round()),s.setTransform(this._container,`${Mu[Ft]} translate(${Ee.x}px,${Ee.y}px)`),eh(this._container,Ft,"popup")},this._onClose=()=>{this.remove()},this.options=i.e(Object.create($s),Kt)}addTo(Kt){return this._map&&this.remove(),this._map=Kt,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 i.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Kt){return this._lngLat=i.N.convert(Kt),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Kt){return this.setDOMContent(document.createTextNode(Kt))}setHTML(Kt){let O=document.createDocumentFragment(),pt=document.createElement("body"),Dt;for(pt.innerHTML=Kt;Dt=pt.firstChild,Dt;)O.appendChild(Dt);return this.setDOMContent(O)}getMaxWidth(){var Kt;return(Kt=this._container)===null||Kt===void 0?void 0:Kt.style.maxWidth}setMaxWidth(Kt){return this.options.maxWidth=Kt,this._update(),this}setDOMContent(Kt){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=s.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Kt),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Kt){return this._container&&this._container.classList.add(Kt),this}removeClassName(Kt){return this._container&&this._container.classList.remove(Kt),this}setOffset(Kt){return this.options.offset=Kt,this._update(),this}toggleClassName(Kt){if(this._container)return this._container.classList.toggle(Kt)}setSubpixelPositioning(Kt){this.options.subpixelPositioning=Kt}_createCloseButton(){this.options.closeButton&&(this._closeButton=s.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Kt=this._container.querySelector(nh);Kt&&Kt.focus()}},n.RasterDEMTileSource=Zt,n.RasterTileSource=Bt,n.ScaleControl=class{constructor(Kt){this._onMove=()=>{Gh(this._map,this._container,this.options)},this.setUnit=O=>{this.options.unit=O,Gh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Wc),Kt)}getDefaultPosition(){return"bottom-left"}onAdd(Kt){return this._map=Kt,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Kt.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},n.ScrollZoomHandler=di,n.Style=un,n.TerrainControl=class{constructor(Kt){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Kt}onAdd(Kt){return this._map=Kt,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=s.create("button","maplibregl-ctrl-terrain",this._container),s.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(){s.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},n.TwoFingersTouchPitchHandler=sf,n.TwoFingersTouchRotateHandler=Td,n.TwoFingersTouchZoomHandler=fc,n.TwoFingersTouchZoomRotateHandler=Sa,n.VectorTileSource=Rt,n.VideoSource=ge,n.addSourceType=(Kt,O)=>i._(void 0,void 0,void 0,function*(){if(Mt(Kt))throw new Error(`A source type called "${Kt}" already exists.`);((pt,Dt)=>{ue[pt]=Dt})(Kt,O)}),n.clearPrewarmedResources=function(){let Kt=ut;Kt&&(Kt.isPreloaded()&&Kt.numActive()===1?(Kt.release(ht),ut=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()"))},n.getMaxParallelImageRequests=function(){return i.a.MAX_PARALLEL_IMAGE_REQUESTS},n.getRTLTextPluginStatus=function(){return be().getRTLTextPluginStatus()},n.getVersion=function(){return lf},n.getWorkerCount=function(){return bt.workerCount},n.getWorkerUrl=function(){return i.a.WORKER_URL},n.importScriptInWorkers=function(Kt){return st().broadcast("IS",Kt)},n.prewarm=function(){gt().acquire(ht)},n.setMaxParallelImageRequests=function(Kt){i.a.MAX_PARALLEL_IMAGE_REQUESTS=Kt},n.setRTLTextPlugin=function(Kt,O){return be().setRTLTextPlugin(Kt,O)},n.setWorkerCount=function(Kt){bt.workerCount=Kt},n.setWorkerUrl=function(Kt){i.a.WORKER_URL=Kt}});var P=f;return P})}),Mtt=It((et,Y)=>{var f=jn(),y=uu().sanitizeHTML,z=Az(),P=Y_();function n(c,s){this.subplot=c,this.uid=c.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var i=n.prototype;i.update=function(c){this.visible?this.needsNewImage(c)?this.updateImage(c):this.needsNewSource(c)?(this.removeLayer(),this.updateSource(c),this.updateLayer(c)):this.needsNewLayer(c)?this.updateLayer(c):this.updateStyle(c):(this.updateSource(c),this.updateLayer(c)),this.visible=a(c)},i.needsNewImage=function(c){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&c.sourcetype==="image"&&(this.source!==c.source||JSON.stringify(this.coordinates)!==JSON.stringify(c.coordinates))},i.needsNewSource=function(c){return this.sourceType!==c.sourcetype||JSON.stringify(this.source)!==JSON.stringify(c.source)||this.layerType!==c.type},i.needsNewLayer=function(c){return this.layerType!==c.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},i.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},i.updateImage=function(c){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:c.source,coordinates:c.coordinates});var h=this.findFollowingMapLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},i.updateSource=function(c){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=c.sourcetype,this.source=c.source,!!a(c)){var h=o(c);s.addSource(this.idSource,h)}},i.findFollowingMapLayerId=function(c){if(c==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(c){var s={},h={};switch(c.type){case"circle":f.extendFlat(h,{"circle-radius":c.circle.radius,"circle-color":c.color,"circle-opacity":c.opacity});break;case"line":f.extendFlat(h,{"line-width":c.line.width,"line-color":c.color,"line-opacity":c.opacity,"line-dasharray":c.line.dash});break;case"fill":f.extendFlat(h,{"fill-color":c.color,"fill-outline-color":c.fill.outlinecolor,"fill-opacity":c.opacity});break;case"symbol":var m=c.symbol,b=z(m.textposition,m.iconsize);f.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),f.extendFlat(h,{"icon-color":c.color,"text-color":m.textfont.color,"text-opacity":c.opacity});break;case"raster":f.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":c.opacity});break}return{layout:s,paint:h}}function o(c){var s=c.sourcetype,h=c.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=c.coordinates),m[b]=h,c.sourceattribution&&(m.attribution=y(c.sourceattribution)),m}Y.exports=function(c,s,h){var m=new n(c,s);return m.update(h),m}}),Ett=It((et,Y)=>{var f=Att(),y=jn(),z=q_(),P=ls(),n=Fs(),i=Up(),a=hd(),l=dm(),o=l.drawMode,c=l.selectMode,s=Md().prepSelect,h=Md().clearOutline,m=Md().clearSelectionsCache,b=Md().selectOnClick,x=Y_(),_=Mtt();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var d=A.prototype;d.plot=function(I,M,p){var g=this,C;g.map?C=new Promise(function(S,N){g.updateMap(I,M,S,N)}):C=new Promise(function(S,N){g.createMap(I,M,S,N)}),p.push(C)},d.createMap=function(I,M,p,g){var C=this,S=M[C.id],N=C.styleObj=w(S.style),B=S.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new f.Map({container:C.div,style:N.style,center:E(S.center),zoom:S.zoom,bearing:S.bearing,pitch:S.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new f.AttributionControl({compact:!0})),W={};V.on("styleimagemissing",function(H){var q=H.id;if(!W[q]&&q.includes("-15")){W[q]=!0;var G=new Image(15,15);G.onload=function(){V.addImage(q,G)},G.crossOrigin="Anonymous",G.src="https://unpkg.com/maki@2.1.0/icons/"+q+".svg"}}),V.setTransformRequest(function(H){return H=H.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),H=H.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),H=H.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:H}}),V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var F=[];F.push(new Promise(function(H){V.once("load",H)})),F=F.concat(z.fetchTraceGeoData(I)),Promise.all(F).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.updateMap=function(I,M,p,g){var C=this,S=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,S.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){S.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,S,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},d.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var S=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),c(S)||o(S)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,S)},i.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},d.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},d.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var f=jn(),y=O_(),z=Zf(),P=Fk();Y.exports=function(a,l,o){y(a,l,o,{type:"map",attributes:P,handleDefaults:n,partition:"y"})};function n(a,l,o){o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var c=o("bounds.west"),s=o("bounds.east"),h=o("bounds.south"),m=o("bounds.north");(c===void 0||s===void 0||h===void 0||m===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:i}),l._input=a}function i(a,l){function o(x,_){return f.coerce(a,l,P.layers,x,_)}var c=o("visible");if(c){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",f.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),f.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),kA=It(et=>{var Y=jn(),f=Y.strTranslate,y=Y.strScale,z=Mf().getSubplotCalcData,P=k0(),n=Br(),i=Js(),a=uu(),l=Ett(),o="map";et.name=o,et.attr="subplot",et.idRoot=o,et.idRegex=et.attrRegex=Y.counterRegex(o),et.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},et.layoutAttributes=Fk(),et.supplyLayoutDefaults=Ltt(),et.plot=function(c){for(var s=c._fullLayout,h=c.calcdata,m=s._subplots[o],b=0;bp/2){var g=D.split("|").join("
");I.text(g).attr("data-unformatted",g).call(a.convertToTspans,c),M=i.bBox(I.node())}I.attr("transform",f(-3,-M.height+8)),E.insert("rect",".static-attribution").attr({x:-M.width-6,y:-M.height-3,width:M.width+6,height:M.height+3,fill:"rgba(255, 255, 255, 0.75)"});var C=1;M.width+6>p&&(C=p/(M.width+6));var S=[m.l+m.w*_.x[1],m.t+m.h*(1-_.y[0])];E.attr("transform",f(S[0],S[1])+y(C))}},et.updateFx=function(c){for(var s=c._fullLayout,h=s._subplots[o],m=0;m{Y.exports={attributes:bA(),supplyDefaults:wtt(),colorbar:Do(),formatLabels:Cz(),calc:JC(),plot:Ttt(),hoverPoints:wA().hoverPoints,eventData:Stt(),selectPoints:Ctt(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermap",basePlotModule:kA(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),Itt=It((et,Y)=>{Y.exports=Ptt()}),Mz=It((et,Y)=>{var f=Kw(),y=Ru(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=xa(),i=Yn().extendFlat;Y.exports=i({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:i({},f.featureidkey,{}),below:{valType:"string",editType:"plot"},text:f.text,hovertext:f.hovertext,marker:{line:{color:i({},f.marker.line.color,{editType:"plot"}),width:i({},f.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:i({},f.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:i({},f.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i({},f.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:f.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:i({},n.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),Dtt=It((et,Y)=>{var f=jn(),y=Cu(),z=Mz();Y.exports=function(P,n,i,a){function l(m,b){return f.coerce(P,n,z,m,b)}var o=l("locations"),c=l("z"),s=l("geojson");if(!f.isArrayOrTypedArray(o)||!o.length||!f.isArrayOrTypedArray(c)||!c.length||!(typeof s=="string"&&s!==""||f.isPlainObject(s))){n.visible=!1;return}l("featureidkey"),n._length=Math.min(o.length,c.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,n,a,l,{prefix:"",cLetter:"z"}),f.coerceSelectionMarkerOpacity(n,l)}}),Ez=It((et,Y)=>{var f=Sr(),y=jn(),z=ch(),P=Js(),n=W_().makeBlank,i=q_();function a(o){var c=o[0].trace,s=c.visible===!0&&c._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=c._opts={fill:h,line:m,geojson:n()};if(!s)return b;var x=i.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(c),A=c.marker,d=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var S=C.mo;return f(S)?+y.constrain(S,0,1):0});var w;y.isArrayOrTypedArray(d.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(d.width)&&(D=function(C){return C.mlw});for(var E=0;E{var f=Ez().convert,y=Ez().convertOnSelect,z=Y_().traceLayerPrefix;function P(i,a){this.type="choroplethmap",this.subplot=i,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var n=P.prototype;n.update=function(i){this._update(f(i)),i[0].trace._glTrace=this},n.updateOnSelect=function(i){this._update(y(i))},n._update=function(i){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(i.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(i,o),this.below=o);for(var c=0;c=0;l--)i.removeLayer(a[l][1])},n.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,a){var l=a[0].trace,o=new P(i,l.uid),c=o.sourceId,s=f(a),h=o.below=i.belowLookup["trace-"+l.uid];return i.map.addSource(c,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),Ott=It((et,Y)=>{Y.exports={attributes:Mz(),supplyDefaults:Dtt(),colorbar:z_(),calc:rA(),plot:ztt(),hoverPoints:iA(),eventData:aA(),selectPoints:oA(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(f,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var n=z[P].id;if(typeof n=="string"&&n.indexOf("water")===0){for(var i=P+1;i{Y.exports=Ott()}),Lz=It((et,Y)=>{var f=Ru(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=xa(),n=bA(),i=Yn().extendFlat;Y.exports=i({lon:n.lon,lat:n.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,hoverinfo:i({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:i({},P.showlegend,{dflt:!1})},f("",{cLetter:"z",editTypeOverride:"calc"}))}),Rtt=It((et,Y)=>{var f=jn(),y=Cu(),z=Lz();Y.exports=function(P,n,i,a){function l(h,m){return f.coerce(P,n,z,h,m)}var o=l("lon")||[],c=l("lat")||[],s=Math.min(o.length,c.length);if(!s){n.visible=!1;return}n._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,n,a,l,{prefix:"",cLetter:"z"})}}),Ftt=It((et,Y)=>{var f=Sr(),y=jn().isArrayOrTypedArray,z=Dr().BADNUM,P=Cp(),n=jn()._;Y.exports=function(i,a){for(var l=a._length,o=new Array(l),c=a.z,s=y(c)&&c.length,h=0;h{var f=Sr(),y=jn(),z=Hn(),P=ch(),n=Dr().BADNUM,i=W_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,c={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:c,geojson:i()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var f=Ntt(),y=Y_().traceLayerPrefix;function z(n,i){this.type="densitymap",this.subplot=n,this.uid=i,this.sourceId="source-"+i,this.layerList=[["heatmap",y+i+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(n){var i=this.subplot,a=this.layerList,l=f(n),o=i.belowLookup["trace-"+this.uid];i.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var c=0;c=0;a--)n.removeLayer(i[a][1])},P.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,i){var a=i[0].trace,l=new z(n,a.uid),o=l.sourceId,c=f(i),s=l.below=n.belowLookup["trace-"+a.uid];return n.map.addSource(o,{type:"geojson",data:c.geojson}),l._addLayers(c,s),l}}),Utt=It((et,Y)=>{var f=Fs(),y=wA().hoverPoints,z=wA().getExtraText;Y.exports=function(P,n,i){var a=y(P,n,i);if(a){var l=a[0],o=l.cd,c=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=f.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(c,s,o[0].t.labels),[l]}}}),$tt=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f.z=y.z,f}}),Htt=It((et,Y)=>{Y.exports={attributes:Lz(),supplyDefaults:Rtt(),colorbar:z_(),formatLabels:Cz(),calc:Ftt(),plot:jtt(),hoverPoints:Utt(),eventData:$tt(),getBelow:function(f,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=Htt()}),Pz=It((et,Y)=>{var f=hi(),y=xa(),z=Sn(),P=oo(),n=Jh().attributes,{hovertemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=Ru(),o=Tc().templatedArray,c=Sh().descriptionOnlyNumbers,s=Yn().extendFlat,h=sh().overrideAll;Y.exports=h({hoverinfo:s({},y.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:P.hoverlabel,domain:n({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:c("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:f({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:i({},{keys:["value","label"]}),hovertemplatefallback:a(),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:i({},{keys:["value","label"]}),hovertemplatefallback:a(),colorscales:o("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:s(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),Wtt=It((et,Y)=>{var f=jn(),y=Pz(),z=Hn(),P=Xi(),n=Jh().defaults,i=qv(),a=Tc(),l=Zf();Y.exports=function(c,s,h,m){function b(N,B){return f.coerce(c,s,y,N,B)}var x=f.extendDeep(m.hoverlabel,c.hoverlabel),_=c.node,A=a.newContainer(s,"node");function d(N,B){return f.coerce(_,A,y.node,N,B)}d("label"),d("groups"),d("x"),d("y"),d("pad"),d("thickness"),d("line.color"),d("line.width"),d("hoverinfo",c.hoverinfo),i(_,A,d,x),d("hovertemplate"),d("align");var k=m.colorway,w=function(N){return k[N%k.length]};d("color",A.label.map(function(N,B){return z.addOpacity(w(B),.8)})),d("customdata");var D=c.link||{},E=a.newContainer(s,"link");function I(N,B){return f.coerce(D,E,y.link,N,B)}I("label"),I("arrowlen"),I("source"),I("target"),I("value"),I("line.color"),I("line.width"),I("hoverinfo",c.hoverinfo),i(D,E,I,x),I("hovertemplate");var M=P(m.paper_bgcolor).getLuminance()<.333,p=M?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",g=I("color",p);function C(N){var B=P(N);if(!B.isValid())return N;var U=B.getAlpha();return U<=.8?B.setAlpha(U+.2):B=M?B.brighten():B.darken(),B.toRgbString()}I("hovercolor",Array.isArray(g)?g.map(C):C(g)),I("customdata"),l(D,E,{name:"colorscales",handleItemDefaults:o}),n(s,m,b),b("orientation"),b("valueformat"),b("valuesuffix");var S;A.x.length&&A.y.length&&(S="freeform"),b("arrangement",S),f.coerceFont(b,"textfont",m.font,{autoShadowDflt:!0}),s._length=null};function o(c,s){function h(m,b){return f.coerce(c,s,y.link.colorscales,m,b)}h("label"),h("cmin"),h("cmax"),h("colorscale")}}),Iz=It((et,Y)=>{Y.exports=f;function f(y){for(var z=y.length,P=new Array(z),n=new Array(z),i=new Array(z),a=new Array(z),l=new Array(z),o=new Array(z),c=0;c0;){d=w[w.length-1];var D=y[d];if(a[d]=0&&o[d].push(l[I])}a[d]=E}else{if(n[d]===P[d]){for(var M=[],p=[],g=0,E=k.length-1;E>=0;--E){var C=k[E];if(i[C]=!1,M.push(C),p.push(o[C]),g+=o[C].length,l[C]=h.length,C===d){k.length=E;break}}h.push(M);for(var S=new Array(g),E=0;E{var f=Iz(),y=jn(),z=e1().wrap,P=y.isArrayOrTypedArray,n=y.isIndex,i=ch();function a(o){var c=o.node,s=o.link,h=[],m=P(s.color),b=P(s.hovercolor),x=P(s.customdata),_={},A={},d=s.colorscales.length,k;for(k=0;kI&&(I=s.source[k]),s.target[k]>I&&(I=s.target[k]);var M=I+1;o.node._count=M;var p,g=o.node.groups,C={};for(k=0;k0&&n(W,M)&&n(F,M)&&!(C.hasOwnProperty(W)&&C.hasOwnProperty(F)&&C[W]===C[F])){C.hasOwnProperty(F)&&(F=C[F]),C.hasOwnProperty(W)&&(W=C[W]),W=+W,F=+F,_[W]=_[F]=!0;var H="";s.label&&s.label[k]&&(H=s.label[k]);var q=null;H&&A.hasOwnProperty(H)&&(q=A[H]),h.push({pointNumber:k,label:H,color:m?s.color[k]:s.color,hovercolor:b?s.hovercolor[k]:s.hovercolor,customdata:x?s.customdata[k]:s.customdata,concentrationscale:q,source:W,target:F,value:+V}),U.source.push(W),U.target.push(F)}}var G=M+g.length,tt=P(c.color),ht=P(c.customdata),bt=[];for(k=0;kM-1,childrenNodes:[],pointNumber:k,label:vt,color:tt?c.color[k]:c.color,customdata:ht?c.customdata[k]:c.customdata})}var ut=!1;return l(G,U.source,U.target)&&(ut=!0),{circular:ut,links:h,nodes:bt,groups:g,groupLookup:C}}function l(o,c,s){for(var h=y.init2dArray(o,0),m=0;m1})}Y.exports=function(o,c){var s=a(c);return z({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}),Gtt=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){function y(M){var p=+this._x.call(null,M),g=+this._y.call(null,M);return z(this.cover(p,g),p,g,M)}function z(M,p,g,C){if(isNaN(p)||isNaN(g))return M;var S,N=M._root,B={data:C},U=M._x0,V=M._y0,W=M._x1,F=M._y1,H,q,G,tt,ht,bt,vt,ut;if(!N)return M._root=B,M;for(;N.length;)if((ht=p>=(H=(U+W)/2))?U=H:W=H,(bt=g>=(q=(V+F)/2))?V=q:F=q,S=N,!(N=N[vt=bt<<1|ht]))return S[vt]=B,M;if(G=+M._x.call(null,N.data),tt=+M._y.call(null,N.data),p===G&&g===tt)return B.next=N,S?S[vt]=B:M._root=B,M;do S=S?S[vt]=new Array(4):M._root=new Array(4),(ht=p>=(H=(U+W)/2))?U=H:W=H,(bt=g>=(q=(V+F)/2))?V=q:F=q;while((vt=bt<<1|ht)===(ut=(tt>=q)<<1|G>=H));return S[ut]=N,S[vt]=B,M}function P(M){var p,g,C=M.length,S,N,B=new Array(C),U=new Array(C),V=1/0,W=1/0,F=-1/0,H=-1/0;for(g=0;gF&&(F=S),NH&&(H=N));if(V>F||W>H)return this;for(this.cover(V,W).cover(F,H),g=0;gM||M>=S||C>p||p>=N;)switch(W=(pF||(U=tt.y0)>H||(V=tt.x1)=vt)<<1|M>=bt)&&(tt=q[q.length-1],q[q.length-1]=q[q.length-1-ht],q[q.length-1-ht]=tt)}else{var ut=M-+this._x.call(null,G.data),rt=p-+this._y.call(null,G.data),gt=ut*ut+rt*rt;if(gt=(q=(B+V)/2))?B=q:V=q,(ht=H>=(G=(U+W)/2))?U=G:W=G,p=g,!(g=g[bt=ht<<1|tt]))return this;if(!g.length)break;(p[bt+1&3]||p[bt+2&3]||p[bt+3&3])&&(C=p,vt=bt)}for(;g.data!==M;)if(S=g,!(g=g.next))return this;return(N=g.next)&&delete g.next,S?(N?S.next=N:delete S.next,this):p?(N?p[bt]=N:delete p[bt],(g=p[0]||p[1]||p[2]||p[3])&&g===(p[3]||p[2]||p[1]||p[0])&&!g.length&&(C?C[vt]=g:this._root=g),this):(this._root=N,this)}function s(M){for(var p=0,g=M.length;p{(function(f,y){y(typeof et=="object"&&typeof Y<"u"?et:f.d3=f.d3||{})})(et,function(f){var y="$";function z(){}z.prototype=P.prototype={constructor:z,has:function(_){return y+_ in this},get:function(_){return this[y+_]},set:function(_,A){return this[y+_]=A,this},remove:function(_){var A=y+_;return A in this&&delete this[A]},clear:function(){for(var _ in this)_[0]===y&&delete this[_]},keys:function(){var _=[];for(var A in this)A[0]===y&&_.push(A.slice(1));return _},values:function(){var _=[];for(var A in this)A[0]===y&&_.push(this[A]);return _},entries:function(){var _=[];for(var A in this)A[0]===y&&_.push({key:A.slice(1),value:this[A]});return _},size:function(){var _=0;for(var A in this)A[0]===y&&++_;return _},empty:function(){for(var _ in this)if(_[0]===y)return!1;return!0},each:function(_){for(var A in this)A[0]===y&&_(this[A],A.slice(1),this)}};function P(_,A){var d=new z;if(_ instanceof z)_.each(function(I,M){d.set(M,I)});else if(Array.isArray(_)){var k=-1,w=_.length,D;if(A==null)for(;++k=_.length)return d!=null&&I.sort(d),k!=null?k(I):I;for(var C=-1,S=I.length,N=_[M++],B,U,V=P(),W,F=p();++C_.length)return I;var p,g=A[M-1];return k!=null&&M>=_.length?p=I.entries():(p=[],I.each(function(C,S){p.push({key:S,values:E(C,M)})})),g!=null?p.sort(function(C,S){return g(C.key,S.key)}):p}return w={object:function(I){return D(I,0,i,a)},map:function(I){return D(I,0,l,o)},entries:function(I){return E(D(I,0,l,o),0)},key:function(I){return _.push(I),w},sortKeys:function(I){return A[_.length-1]=I,w},sortValues:function(I){return d=I,w},rollup:function(I){return k=I,w}}}function i(){return{}}function a(_,A,d){_[A]=d}function l(){return P()}function o(_,A,d){_.set(A,d)}function c(){}var s=P.prototype;c.prototype=h.prototype={constructor:c,has:s.has,add:function(_){return _+="",this[y+_]=_,this},remove:s.remove,clear:s.clear,values:s.keys,size:s.size,empty:s.empty,each:s.each};function h(_,A){var d=new c;if(_ instanceof c)_.each(function(D){d.add(D)});else if(_){var k=-1,w=_.length;if(A==null)for(;++k{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y={value:function(){}};function z(){for(var l=0,o=arguments.length,c={},s;l=0&&(s=c.slice(h+1),c=c.slice(0,h)),c&&!o.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:s}})}P.prototype=z.prototype={constructor:P,on:function(l,o){var c=this._,s=n(l+"",c),h,m=-1,b=s.length;if(arguments.length<2){for(;++m0)for(var c=new Array(h),s=0,h,m;s{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y=0,z=0,P=0,n=1e3,i,a,l=0,o=0,c=0,s=typeof performance=="object"&&performance.now?performance:Date,h=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(M){setTimeout(M,17)};function m(){return o||(h(b),o=s.now()+c)}function b(){o=0}function x(){this._call=this._time=this._next=null}x.prototype=_.prototype={constructor:x,restart:function(M,p,g){if(typeof M!="function")throw new TypeError("callback is not a function");g=(g==null?m():+g)+(p==null?0:+p),!this._next&&a!==this&&(a?a._next=this:i=this,a=this),this._call=M,this._time=g,D()},stop:function(){this._call&&(this._call=null,this._time=1/0,D())}};function _(M,p,g){var C=new x;return C.restart(M,p,g),C}function A(){m(),++y;for(var M=i,p;M;)(p=o-M._time)>=0&&M._call.call(null,p),M=M._next;--y}function d(){o=(l=s.now())+c,y=z=0;try{A()}finally{y=0,w(),o=0}}function k(){var M=s.now(),p=M-l;p>n&&(c-=p,l=M)}function w(){for(var M,p=i,g,C=1/0;p;)p._call?(C>p._time&&(C=p._time),M=p,p=p._next):(g=p._next,p._next=null,p=M?M._next=g:i=g);a=M,D(C)}function D(M){if(!y){z&&(z=clearTimeout(z));var p=M-o;p>24?(M<1/0&&(z=setTimeout(d,M-s.now()-c)),P&&(P=clearInterval(P))):(P||(l=s.now(),P=setInterval(k,n)),y=1,h(d))}}function E(M,p,g){var C=new x;return p=p==null?0:+p,C.restart(function(S){C.stop(),M(S+p)},p,g),C}function I(M,p,g){var C=new x,S=p;return p==null?(C.restart(M,p,g),C):(p=+p,g=g==null?m():+g,C.restart(function N(B){B+=S,C.restart(N,S+=p,g),M(B)},p,g),C)}f.interval=I,f.now=m,f.timeout=E,f.timer=_,f.timerFlush=A,Object.defineProperty(f,"__esModule",{value:!0})})}),Ytt=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Gtt(),TA(),Ztt(),Ktt()):y(f.d3=f.d3||{},f.d3,f.d3,f.d3,f.d3)})(et,function(f,y,z,P,n){function i(M,p){var g;M==null&&(M=0),p==null&&(p=0);function C(){var S,N=g.length,B,U=0,V=0;for(S=0;SH.index){var mt=q-xt.x-xt.vx,dt=G-xt.y-xt.vy,Ct=mt*mt+dt*dt;Ctq+J||itG+J||stV.r&&(V.r=V[W].r)}function U(){if(p){var V,W=p.length,F;for(g=new Array(W),V=0;V1?(ht==null?U.remove(tt):U.set(tt,G(ht)),p):U.get(tt)},find:function(tt,ht,bt){var vt=0,ut=M.length,rt,gt,it,st,xt;for(bt==null?bt=1/0:bt*=bt,vt=0;vt1?(W.on(tt,ht),p):W.on(tt)}}}function w(){var M,p,g,C=a(-30),S,N=1,B=1/0,U=.81;function V(q){var G,tt=M.length,ht=y.quadtree(M,x,_).visitAfter(F);for(g=q,G=0;G=B)){(q.data!==p||q.next)&&(bt===0&&(bt=l(),rt+=bt*bt),vt===0&&(vt=l(),rt+=vt*vt),rt{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y=Math.PI,z=2*y,P=1e-6,n=z-P;function i(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function a(){return new i}i.prototype=a.prototype={constructor:i,moveTo:function(l,o){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(l,o){this._+="L"+(this._x1=+l)+","+(this._y1=+o)},quadraticCurveTo:function(l,o,c,s){this._+="Q"+ +l+","+ +o+","+(this._x1=+c)+","+(this._y1=+s)},bezierCurveTo:function(l,o,c,s,h,m){this._+="C"+ +l+","+ +o+","+ +c+","+ +s+","+(this._x1=+h)+","+(this._y1=+m)},arcTo:function(l,o,c,s,h){l=+l,o=+o,c=+c,s=+s,h=+h;var m=this._x1,b=this._y1,x=c-l,_=s-o,A=m-l,d=b-o,k=A*A+d*d;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=l)+","+(this._y1=o);else if(k>P)if(!(Math.abs(d*x-_*A)>P)||!h)this._+="L"+(this._x1=l)+","+(this._y1=o);else{var w=c-m,D=s-b,E=x*x+_*_,I=w*w+D*D,M=Math.sqrt(E),p=Math.sqrt(k),g=h*Math.tan((y-Math.acos((E+k-I)/(2*M*p)))/2),C=g/p,S=g/M;Math.abs(C-1)>P&&(this._+="L"+(l+C*A)+","+(o+C*d)),this._+="A"+h+","+h+",0,0,"+ +(d*w>A*D)+","+(this._x1=l+S*x)+","+(this._y1=o+S*_)}},arc:function(l,o,c,s,h,m){l=+l,o=+o,c=+c,m=!!m;var b=c*Math.cos(s),x=c*Math.sin(s),_=l+b,A=o+x,d=1^m,k=m?s-h:h-s;if(c<0)throw new Error("negative radius: "+c);this._x1===null?this._+="M"+_+","+A:(Math.abs(this._x1-_)>P||Math.abs(this._y1-A)>P)&&(this._+="L"+_+","+A),c&&(k<0&&(k=k%z+z),k>n?this._+="A"+c+","+c+",0,1,"+d+","+(l-b)+","+(o-x)+"A"+c+","+c+",0,1,"+d+","+(this._x1=_)+","+(this._y1=A):k>P&&(this._+="A"+c+","+c+",0,"+ +(k>=y)+","+d+","+(this._x1=l+c*Math.cos(h))+","+(this._y1=o+c*Math.sin(h))))},rect:function(l,o,c,s){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)+"h"+ +c+"v"+ +s+"h"+-c+"Z"},toString:function(){return this._}},f.path=a,Object.defineProperty(f,"__esModule",{value:!0})})}),Dz=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Xtt()):(f=f||self,y(f.d3=f.d3||{},f.d3))})(et,function(f,y){function z(ze){return function(){return ze}}var P=Math.abs,n=Math.atan2,i=Math.cos,a=Math.max,l=Math.min,o=Math.sin,c=Math.sqrt,s=1e-12,h=Math.PI,m=h/2,b=2*h;function x(ze){return ze>1?0:ze<-1?h:Math.acos(ze)}function _(ze){return ze>=1?m:ze<=-1?-m:Math.asin(ze)}function A(ze){return ze.innerRadius}function d(ze){return ze.outerRadius}function k(ze){return ze.startAngle}function w(ze){return ze.endAngle}function D(ze){return ze&&ze.padAngle}function E(ze,yr,en,Rn,ni,xi,Jn,Gn){var pi=en-ze,Va=Rn-yr,ea=Jn-ni,go=Gn-xi,mo=go*pi-ea*Va;if(!(mo*moOl*Ol+tc*tc&&(ul=vs,Kl=Ns),{cx:ul,cy:Kl,x01:-ea,y01:-go,x11:ul*(ni/ol-1),y11:Kl*(ni/ol-1)}}function M(){var ze=A,yr=d,en=z(0),Rn=null,ni=k,xi=w,Jn=D,Gn=null;function pi(){var Va,ea,go=+ze.apply(this,arguments),mo=+yr.apply(this,arguments),Go=ni.apply(this,arguments)-m,Lo=xi.apply(this,arguments)-m,Zo=P(Lo-Go),Ka=Lo>Go;if(Gn||(Gn=Va=y.path()),mos))Gn.moveTo(0,0);else if(Zo>b-s)Gn.moveTo(mo*i(Go),mo*o(Go)),Gn.arc(0,0,mo,Go,Lo,!Ka),go>s&&(Gn.moveTo(go*i(Lo),go*o(Lo)),Gn.arc(0,0,go,Lo,Go,Ka));else{var Cs=Go,ps=Lo,wl=Go,is=Lo,ol=Zo,ms=Zo,kl=Jn.apply(this,arguments)/2,ul=kl>s&&(Rn?+Rn.apply(this,arguments):c(go*go+mo*mo)),Kl=l(P(mo-go)/2,+en.apply(this,arguments)),vs=Kl,Ns=Kl,Uo,Ds;if(ul>s){var Ol=_(ul/go*o(kl)),tc=_(ul/mo*o(kl));(ol-=Ol*2)>s?(Ol*=Ka?1:-1,wl+=Ol,is-=Ol):(ol=0,wl=is=(Go+Lo)/2),(ms-=tc*2)>s?(tc*=Ka?1:-1,Cs+=tc,ps-=tc):(ms=0,Cs=ps=(Go+Lo)/2)}var sc=mo*i(Cs),Xs=mo*o(Cs),Wa=go*i(is),Co=go*o(is);if(Kl>s){var el=mo*i(ps),lc=mo*o(ps),ss=go*i(wl),nc=go*o(wl),yl;if(Zos?Ns>s?(Uo=I(ss,nc,sc,Xs,mo,Ns,Ka),Ds=I(el,lc,Wa,Co,mo,Ns,Ka),Gn.moveTo(Uo.cx+Uo.x01,Uo.cy+Uo.y01),Nss)||!(ol>s)?Gn.lineTo(Wa,Co):vs>s?(Uo=I(Wa,Co,el,lc,go,-vs,Ka),Ds=I(sc,Xs,ss,nc,go,-vs,Ka),Gn.lineTo(Uo.cx+Uo.x01,Uo.cy+Uo.y01),vs=mo;--Go)Gn.point(ps[Go],wl[Go]);Gn.lineEnd(),Gn.areaEnd()}Ka&&(ps[go]=+ze(Zo,go,ea),wl[go]=+en(Zo,go,ea),Gn.point(yr?+yr(Zo,go,ea):ps[go],Rn?+Rn(Zo,go,ea):wl[go]))}if(Cs)return Gn=null,Cs+""||null}function Va(){return N().defined(ni).curve(Jn).context(xi)}return pi.x=function(ea){return arguments.length?(ze=typeof ea=="function"?ea:z(+ea),yr=null,pi):ze},pi.x0=function(ea){return arguments.length?(ze=typeof ea=="function"?ea:z(+ea),pi):ze},pi.x1=function(ea){return arguments.length?(yr=ea==null?null:typeof ea=="function"?ea:z(+ea),pi):yr},pi.y=function(ea){return arguments.length?(en=typeof ea=="function"?ea:z(+ea),Rn=null,pi):en},pi.y0=function(ea){return arguments.length?(en=typeof ea=="function"?ea:z(+ea),pi):en},pi.y1=function(ea){return arguments.length?(Rn=ea==null?null:typeof ea=="function"?ea:z(+ea),pi):Rn},pi.lineX0=pi.lineY0=function(){return Va().x(ze).y(en)},pi.lineY1=function(){return Va().x(ze).y(Rn)},pi.lineX1=function(){return Va().x(yr).y(en)},pi.defined=function(ea){return arguments.length?(ni=typeof ea=="function"?ea:z(!!ea),pi):ni},pi.curve=function(ea){return arguments.length?(Jn=ea,xi!=null&&(Gn=Jn(xi)),pi):Jn},pi.context=function(ea){return arguments.length?(ea==null?xi=Gn=null:Gn=Jn(xi=ea),pi):xi},pi}function U(ze,yr){return yrze?1:yr>=ze?0:NaN}function V(ze){return ze}function W(){var ze=V,yr=U,en=null,Rn=z(0),ni=z(b),xi=z(0);function Jn(Gn){var pi,Va=Gn.length,ea,go,mo=0,Go=new Array(Va),Lo=new Array(Va),Zo=+Rn.apply(this,arguments),Ka=Math.min(b,Math.max(-b,ni.apply(this,arguments)-Zo)),Cs,ps=Math.min(Math.abs(Ka)/Va,xi.apply(this,arguments)),wl=ps*(Ka<0?-1:1),is;for(pi=0;pi0&&(mo+=is);for(yr!=null?Go.sort(function(ol,ms){return yr(Lo[ol],Lo[ms])}):en!=null&&Go.sort(function(ol,ms){return en(Gn[ol],Gn[ms])}),pi=0,go=mo?(Ka-Va*wl)/mo:0;pi0?is*go:0)+wl,Lo[ea]={data:Gn[ea],index:pi,value:is,startAngle:Zo,endAngle:Cs,padAngle:ps};return Lo}return Jn.value=function(Gn){return arguments.length?(ze=typeof Gn=="function"?Gn:z(+Gn),Jn):ze},Jn.sortValues=function(Gn){return arguments.length?(yr=Gn,en=null,Jn):yr},Jn.sort=function(Gn){return arguments.length?(en=Gn,yr=null,Jn):en},Jn.startAngle=function(Gn){return arguments.length?(Rn=typeof Gn=="function"?Gn:z(+Gn),Jn):Rn},Jn.endAngle=function(Gn){return arguments.length?(ni=typeof Gn=="function"?Gn:z(+Gn),Jn):ni},Jn.padAngle=function(Gn){return arguments.length?(xi=typeof Gn=="function"?Gn:z(+Gn),Jn):xi},Jn}var F=q(g);function H(ze){this._curve=ze}H.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(ze,yr){this._curve.point(yr*Math.sin(ze),yr*-Math.cos(ze))}};function q(ze){function yr(en){return new H(ze(en))}return yr._curve=ze,yr}function G(ze){var yr=ze.curve;return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze.curve=function(en){return arguments.length?yr(q(en)):yr()._curve},ze}function tt(){return G(N().curve(F))}function ht(){var ze=B().curve(F),yr=ze.curve,en=ze.lineX0,Rn=ze.lineX1,ni=ze.lineY0,xi=ze.lineY1;return ze.angle=ze.x,delete ze.x,ze.startAngle=ze.x0,delete ze.x0,ze.endAngle=ze.x1,delete ze.x1,ze.radius=ze.y,delete ze.y,ze.innerRadius=ze.y0,delete ze.y0,ze.outerRadius=ze.y1,delete ze.y1,ze.lineStartAngle=function(){return G(en())},delete ze.lineX0,ze.lineEndAngle=function(){return G(Rn())},delete ze.lineX1,ze.lineInnerRadius=function(){return G(ni())},delete ze.lineY0,ze.lineOuterRadius=function(){return G(xi())},delete ze.lineY1,ze.curve=function(Jn){return arguments.length?yr(q(Jn)):yr()._curve},ze}function bt(ze,yr){return[(yr=+yr)*Math.cos(ze-=Math.PI/2),yr*Math.sin(ze)]}var vt=Array.prototype.slice;function ut(ze){return ze.source}function rt(ze){return ze.target}function gt(ze){var yr=ut,en=rt,Rn=C,ni=S,xi=null;function Jn(){var Gn,pi=vt.call(arguments),Va=yr.apply(this,pi),ea=en.apply(this,pi);if(xi||(xi=Gn=y.path()),ze(xi,+Rn.apply(this,(pi[0]=Va,pi)),+ni.apply(this,pi),+Rn.apply(this,(pi[0]=ea,pi)),+ni.apply(this,pi)),Gn)return xi=null,Gn+""||null}return Jn.source=function(Gn){return arguments.length?(yr=Gn,Jn):yr},Jn.target=function(Gn){return arguments.length?(en=Gn,Jn):en},Jn.x=function(Gn){return arguments.length?(Rn=typeof Gn=="function"?Gn:z(+Gn),Jn):Rn},Jn.y=function(Gn){return arguments.length?(ni=typeof Gn=="function"?Gn:z(+Gn),Jn):ni},Jn.context=function(Gn){return arguments.length?(xi=Gn??null,Jn):xi},Jn}function it(ze,yr,en,Rn,ni){ze.moveTo(yr,en),ze.bezierCurveTo(yr=(yr+Rn)/2,en,yr,ni,Rn,ni)}function st(ze,yr,en,Rn,ni){ze.moveTo(yr,en),ze.bezierCurveTo(yr,en=(en+ni)/2,Rn,en,Rn,ni)}function xt(ze,yr,en,Rn,ni){var xi=bt(yr,en),Jn=bt(yr,en=(en+ni)/2),Gn=bt(Rn,en),pi=bt(Rn,ni);ze.moveTo(xi[0],xi[1]),ze.bezierCurveTo(Jn[0],Jn[1],Gn[0],Gn[1],pi[0],pi[1])}function ot(){return gt(it)}function J(){return gt(st)}function mt(){var ze=gt(xt);return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze}var dt={draw:function(ze,yr){var en=Math.sqrt(yr/h);ze.moveTo(en,0),ze.arc(0,0,en,0,b)}},Ct={draw:function(ze,yr){var en=Math.sqrt(yr/5)/2;ze.moveTo(-3*en,-en),ze.lineTo(-en,-en),ze.lineTo(-en,-3*en),ze.lineTo(en,-3*en),ze.lineTo(en,-en),ze.lineTo(3*en,-en),ze.lineTo(3*en,en),ze.lineTo(en,en),ze.lineTo(en,3*en),ze.lineTo(-en,3*en),ze.lineTo(-en,en),ze.lineTo(-3*en,en),ze.closePath()}},Rt=Math.sqrt(1/3),Bt=Rt*2,Zt={draw:function(ze,yr){var en=Math.sqrt(yr/Bt),Rn=en*Rt;ze.moveTo(0,-en),ze.lineTo(Rn,0),ze.lineTo(0,en),ze.lineTo(-Rn,0),ze.closePath()}},Gt=.8908130915292852,ee=Math.sin(h/10)/Math.sin(7*h/10),xe=Math.sin(b/10)*ee,ge=-Math.cos(b/10)*ee,ye={draw:function(ze,yr){var en=Math.sqrt(yr*Gt),Rn=xe*en,ni=ge*en;ze.moveTo(0,-en),ze.lineTo(Rn,ni);for(var xi=1;xi<5;++xi){var Jn=b*xi/5,Gn=Math.cos(Jn),pi=Math.sin(Jn);ze.lineTo(pi*en,-Gn*en),ze.lineTo(Gn*Rn-pi*ni,pi*Rn+Gn*ni)}ze.closePath()}},ue={draw:function(ze,yr){var en=Math.sqrt(yr),Rn=-en/2;ze.rect(Rn,Rn,en,en)}},Mt=Math.sqrt(3),Ot={draw:function(ze,yr){var en=-Math.sqrt(yr/(Mt*3));ze.moveTo(0,en*2),ze.lineTo(-Mt*en,-en),ze.lineTo(Mt*en,-en),ze.closePath()}},Lt=-.5,ie=Math.sqrt(3)/2,be=1/Math.sqrt(12),ce=(be/2+1)*3,Le={draw:function(ze,yr){var en=Math.sqrt(yr/ce),Rn=en/2,ni=en*be,xi=Rn,Jn=en*be+en,Gn=-xi,pi=Jn;ze.moveTo(Rn,ni),ze.lineTo(xi,Jn),ze.lineTo(Gn,pi),ze.lineTo(Lt*Rn-ie*ni,ie*Rn+Lt*ni),ze.lineTo(Lt*xi-ie*Jn,ie*xi+Lt*Jn),ze.lineTo(Lt*Gn-ie*pi,ie*Gn+Lt*pi),ze.lineTo(Lt*Rn+ie*ni,Lt*ni-ie*Rn),ze.lineTo(Lt*xi+ie*Jn,Lt*Jn-ie*xi),ze.lineTo(Lt*Gn+ie*pi,Lt*pi-ie*Gn),ze.closePath()}},Ze=[dt,Ct,Zt,ue,ye,Ot,Le];function Qe(){var ze=z(dt),yr=z(64),en=null;function Rn(){var ni;if(en||(en=ni=y.path()),ze.apply(this,arguments).draw(en,+yr.apply(this,arguments)),ni)return en=null,ni+""||null}return Rn.type=function(ni){return arguments.length?(ze=typeof ni=="function"?ni:z(ni),Rn):ze},Rn.size=function(ni){return arguments.length?(yr=typeof ni=="function"?ni:z(+ni),Rn):yr},Rn.context=function(ni){return arguments.length?(en=ni??null,Rn):en},Rn}function mr(){}function fr(ze,yr,en){ze._context.bezierCurveTo((2*ze._x0+ze._x1)/3,(2*ze._y0+ze._y1)/3,(ze._x0+2*ze._x1)/3,(ze._y0+2*ze._y1)/3,(ze._x0+4*ze._x1+yr)/6,(ze._y0+4*ze._y1+en)/6)}function Jr(ze){this._context=ze}Jr.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:fr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);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:fr(this,ze,yr);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr}};function an(ze){return new Jr(ze)}function Er(ze){this._context=ze}Er.prototype={areaStart:mr,areaEnd:mr,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);break}}},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._x2=ze,this._y2=yr;break;case 1:this._point=2,this._x3=ze,this._y3=yr;break;case 2:this._point=3,this._x4=ze,this._y4=yr,this._context.moveTo((this._x0+4*this._x1+ze)/6,(this._y0+4*this._y1+yr)/6);break;default:fr(this,ze,yr);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr}};function dn(ze){return new Er(ze)}function _n(ze){this._context=ze}_n.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var en=(this._x0+4*this._x1+ze)/6,Rn=(this._y0+4*this._y1+yr)/6;this._line?this._context.lineTo(en,Rn):this._context.moveTo(en,Rn);break;case 3:this._point=4;default:fr(this,ze,yr);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr}};function Oe(ze){return new _n(ze)}function Xt(ze,yr){this._basis=new Jr(ze),this._beta=yr}Xt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var ze=this._x,yr=this._y,en=ze.length-1;if(en>0)for(var Rn=ze[0],ni=yr[0],xi=ze[en]-Rn,Jn=yr[en]-ni,Gn=-1,pi;++Gn<=en;)pi=Gn/en,this._basis.point(this._beta*ze[Gn]+(1-this._beta)*(Rn+pi*xi),this._beta*yr[Gn]+(1-this._beta)*(ni+pi*Jn));this._x=this._y=null,this._basis.lineEnd()},point:function(ze,yr){this._x.push(+ze),this._y.push(+yr)}};var oe=function ze(yr){function en(Rn){return yr===1?new Jr(Rn):new Xt(Rn,yr)}return en.beta=function(Rn){return ze(+Rn)},en}(.85);function zt(ze,yr,en){ze._context.bezierCurveTo(ze._x1+ze._k*(ze._x2-ze._x0),ze._y1+ze._k*(ze._y2-ze._y0),ze._x2+ze._k*(ze._x1-yr),ze._y2+ze._k*(ze._y1-en),ze._x2,ze._y2)}function _t(ze,yr){this._context=ze,this._k=(1-yr)/6}_t.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:zt(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2,this._x1=ze,this._y1=yr;break;case 2:this._point=3;default:zt(this,ze,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Pt=function ze(yr){function en(Rn){return new _t(Rn,yr)}return en.tension=function(Rn){return ze(+Rn)},en}(0);function Ht(ze,yr){this._context=ze,this._k=(1-yr)/6}Ht.prototype={areaStart:mr,areaEnd:mr,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);break}}},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._x3=ze,this._y3=yr;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=yr);break;case 2:this._point=3,this._x5=ze,this._y5=yr;break;default:zt(this,ze,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var ae=function ze(yr){function en(Rn){return new Ht(Rn,yr)}return en.tension=function(Rn){return ze(+Rn)},en}(0);function he(ze,yr){this._context=ze,this._k=(1-yr)/6}he.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,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:zt(this,ze,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Me=function ze(yr){function en(Rn){return new he(Rn,yr)}return en.tension=function(Rn){return ze(+Rn)},en}(0);function qe(ze,yr,en){var Rn=ze._x1,ni=ze._y1,xi=ze._x2,Jn=ze._y2;if(ze._l01_a>s){var Gn=2*ze._l01_2a+3*ze._l01_a*ze._l12_a+ze._l12_2a,pi=3*ze._l01_a*(ze._l01_a+ze._l12_a);Rn=(Rn*Gn-ze._x0*ze._l12_2a+ze._x2*ze._l01_2a)/pi,ni=(ni*Gn-ze._y0*ze._l12_2a+ze._y2*ze._l01_2a)/pi}if(ze._l23_a>s){var Va=2*ze._l23_2a+3*ze._l23_a*ze._l12_a+ze._l12_2a,ea=3*ze._l23_a*(ze._l23_a+ze._l12_a);xi=(xi*Va+ze._x1*ze._l23_2a-yr*ze._l12_2a)/ea,Jn=(Jn*Va+ze._y1*ze._l23_2a-en*ze._l12_2a)/ea}ze._context.bezierCurveTo(Rn,ni,xi,Jn,ze._x2,ze._y2)}function Ye(ze,yr){this._context=ze,this._alpha=yr}Ye.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);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){if(ze=+ze,yr=+yr,this._point){var en=this._x2-ze,Rn=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(en*en+Rn*Rn,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2;break;case 2:this._point=3;default:qe(this,ze,yr);break}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=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var ur=function ze(yr){function en(Rn){return yr?new Ye(Rn,yr):new _t(Rn,0)}return en.alpha=function(Rn){return ze(+Rn)},en}(.5);function Rr(ze,yr){this._context=ze,this._alpha=yr}Rr.prototype={areaStart:mr,areaEnd:mr,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);break}}},point:function(ze,yr){if(ze=+ze,yr=+yr,this._point){var en=this._x2-ze,Rn=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(en*en+Rn*Rn,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=ze,this._y3=yr;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=yr);break;case 2:this._point=3,this._x5=ze,this._y5=yr;break;default:qe(this,ze,yr);break}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=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var zr=function ze(yr){function en(Rn){return yr?new Rr(Rn,yr):new Ht(Rn,0)}return en.alpha=function(Rn){return ze(+Rn)},en}(.5);function xr(ze,yr){this._context=ze,this._alpha=yr}xr.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){if(ze=+ze,yr=+yr,this._point){var en=this._x2-ze,Rn=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(en*en+Rn*Rn,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:qe(this,ze,yr);break}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=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var pn=function ze(yr){function en(Rn){return yr?new xr(Rn,yr):new he(Rn,0)}return en.alpha=function(Rn){return ze(+Rn)},en}(.5);function ci(ze){this._context=ze}ci.prototype={areaStart:mr,areaEnd:mr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(ze,yr){ze=+ze,yr=+yr,this._point?this._context.lineTo(ze,yr):(this._point=1,this._context.moveTo(ze,yr))}};function ui(ze){return new ci(ze)}function yi(ze){return ze<0?-1:1}function Gi(ze,yr,en){var Rn=ze._x1-ze._x0,ni=yr-ze._x1,xi=(ze._y1-ze._y0)/(Rn||ni<0&&-0),Jn=(en-ze._y1)/(ni||Rn<0&&-0),Gn=(xi*ni+Jn*Rn)/(Rn+ni);return(yi(xi)+yi(Jn))*Math.min(Math.abs(xi),Math.abs(Jn),.5*Math.abs(Gn))||0}function Ci(ze,yr){var en=ze._x1-ze._x0;return en?(3*(ze._y1-ze._y0)/en-yr)/2:yr}function fi(ze,yr,en){var Rn=ze._x0,ni=ze._y0,xi=ze._x1,Jn=ze._y1,Gn=(xi-Rn)/3;ze._context.bezierCurveTo(Rn+Gn,ni+Gn*yr,xi-Gn,Jn-Gn*en,xi,Jn)}function ba(ze){this._context=ze}ba.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:fi(this,this._t0,Ci(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){var en=NaN;if(ze=+ze,yr=+yr,!(ze===this._x1&&yr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2;break;case 2:this._point=3,fi(this,Ci(this,en=Gi(this,ze,yr)),en);break;default:fi(this,this._t0,en=Gi(this,ze,yr));break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr,this._t0=en}}};function oa(ze){this._context=new Ke(ze)}(oa.prototype=Object.create(ba.prototype)).point=function(ze,yr){ba.prototype.point.call(this,yr,ze)};function Ke(ze){this._context=ze}Ke.prototype={moveTo:function(ze,yr){this._context.moveTo(yr,ze)},closePath:function(){this._context.closePath()},lineTo:function(ze,yr){this._context.lineTo(yr,ze)},bezierCurveTo:function(ze,yr,en,Rn,ni,xi){this._context.bezierCurveTo(yr,ze,Rn,en,xi,ni)}};function sr(ze){return new ba(ze)}function vr(ze){return new oa(ze)}function Ar(ze){this._context=ze}Ar.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var ze=this._x,yr=this._y,en=ze.length;if(en)if(this._line?this._context.lineTo(ze[0],yr[0]):this._context.moveTo(ze[0],yr[0]),en===2)this._context.lineTo(ze[1],yr[1]);else for(var Rn=mn(ze),ni=mn(yr),xi=0,Jn=1;Jn=0;--yr)ni[yr]=(Jn[yr]-ni[yr+1])/xi[yr];for(xi[en-1]=(ze[en]+ni[en-1])/2,yr=0;yr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,yr),this._context.lineTo(ze,yr);else{var en=this._x*(1-this._t)+ze*this._t;this._context.lineTo(en,this._y),this._context.lineTo(en,yr)}break}}this._x=ze,this._y=yr}};function Wn(ze){return new Un(ze,.5)}function Li(ze){return new Un(ze,0)}function Fi(ze){return new Un(ze,1)}function Zi(ze,yr){if((Jn=ze.length)>1)for(var en=1,Rn,ni,xi=ze[yr[0]],Jn,Gn=xi.length;en=0;)en[yr]=yr;return en}function ca(ze,yr){return ze[yr]}function Ei(){var ze=z([]),yr=Ji,en=Zi,Rn=ca;function ni(xi){var Jn=ze.apply(this,arguments),Gn,pi=xi.length,Va=Jn.length,ea=new Array(Va),go;for(Gn=0;Gn0){for(var en,Rn,ni=0,xi=ze[0].length,Jn;ni0)for(var en,Rn=0,ni,xi,Jn,Gn,pi,Va=ze[yr[0]].length;Rn0?(ni[0]=Jn,ni[1]=Jn+=xi):xi<0?(ni[1]=Gn,ni[0]=Gn+=xi):(ni[0]=0,ni[1]=xi)}function Fe(ze,yr){if((ni=ze.length)>0){for(var en=0,Rn=ze[yr[0]],ni,xi=Rn.length;en0)||!((xi=(ni=ze[yr[0]]).length)>0))){for(var en=0,Rn=1,ni,xi,Jn;Rnxi&&(xi=ni,en=yr);return en}function cn(ze){var yr=ze.map(Yr);return Ji(ze).sort(function(en,Rn){return yr[en]-yr[Rn]})}function Yr(ze){for(var yr=0,en=-1,Rn=ze.length,ni;++en{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Ek(),TA(),Dz()):y(f.d3=f.d3||{},f.d3,f.d3,f.d3)})(et,function(f,y,z,P){function n(g){return g.target.depth}function i(g){return g.depth}function a(g,C){return C-1-g.height}function l(g,C){return g.sourceLinks.length?g.depth:C-1}function o(g){return g.targetLinks.length?g.depth:g.sourceLinks.length?y.min(g.sourceLinks,n)-1:0}function c(g){return function(){return g}}function s(g,C){return m(g.source,C.source)||g.index-C.index}function h(g,C){return m(g.target,C.target)||g.index-C.index}function m(g,C){return g.y0-C.y0}function b(g){return g.value}function x(g){return(g.y0+g.y1)/2}function _(g){return x(g.source)*g.value}function A(g){return x(g.target)*g.value}function d(g){return g.index}function k(g){return g.nodes}function w(g){return g.links}function D(g,C){var S=g.get(C);if(!S)throw new Error("missing: "+C);return S}var E=function(){var g=0,C=0,S=1,N=1,B=24,U=8,V=d,W=l,F=k,H=w,q=32,G=2/3;function tt(){var gt={nodes:F.apply(null,arguments),links:H.apply(null,arguments)};return ht(gt),bt(gt),vt(gt),ut(gt),rt(gt),gt}tt.update=function(gt){return rt(gt),gt},tt.nodeId=function(gt){return arguments.length?(V=typeof gt=="function"?gt:c(gt),tt):V},tt.nodeAlign=function(gt){return arguments.length?(W=typeof gt=="function"?gt:c(gt),tt):W},tt.nodeWidth=function(gt){return arguments.length?(B=+gt,tt):B},tt.nodePadding=function(gt){return arguments.length?(U=+gt,tt):U},tt.nodes=function(gt){return arguments.length?(F=typeof gt=="function"?gt:c(gt),tt):F},tt.links=function(gt){return arguments.length?(H=typeof gt=="function"?gt:c(gt),tt):H},tt.size=function(gt){return arguments.length?(g=C=0,S=+gt[0],N=+gt[1],tt):[S-g,N-C]},tt.extent=function(gt){return arguments.length?(g=+gt[0][0],S=+gt[1][0],C=+gt[0][1],N=+gt[1][1],tt):[[g,C],[S,N]]},tt.iterations=function(gt){return arguments.length?(q=+gt,tt):q};function ht(gt){gt.nodes.forEach(function(st,xt){st.index=xt,st.sourceLinks=[],st.targetLinks=[]});var it=z.map(gt.nodes,V);gt.links.forEach(function(st,xt){st.index=xt;var ot=st.source,J=st.target;typeof ot!="object"&&(ot=st.source=D(it,ot)),typeof J!="object"&&(J=st.target=D(it,J)),ot.sourceLinks.push(st),J.targetLinks.push(st)})}function bt(gt){gt.nodes.forEach(function(it){it.value=Math.max(y.sum(it.sourceLinks,b),y.sum(it.targetLinks,b))})}function vt(gt){var it,st,xt;for(it=gt.nodes,st=[],xt=0;it.length;++xt,it=st,st=[])it.forEach(function(J){J.depth=xt,J.sourceLinks.forEach(function(mt){st.indexOf(mt.target)<0&&st.push(mt.target)})});for(it=gt.nodes,st=[],xt=0;it.length;++xt,it=st,st=[])it.forEach(function(J){J.height=xt,J.targetLinks.forEach(function(mt){st.indexOf(mt.source)<0&&st.push(mt.source)})});var ot=(S-g-B)/(xt-1);gt.nodes.forEach(function(J){J.x1=(J.x0=g+Math.max(0,Math.min(xt-1,Math.floor(W.call(null,J,xt))))*ot)+B})}function ut(gt){var it=z.nest().key(function(Ct){return Ct.x0}).sortKeys(y.ascending).entries(gt.nodes).map(function(Ct){return Ct.values});ot(),dt();for(var st=1,xt=q;xt>0;--xt)mt(st*=.99),dt(),J(st),dt();function ot(){var Ct=y.max(it,function(Zt){return Zt.length}),Rt=G*(N-C)/(Ct-1);U>Rt&&(U=Rt);var Bt=y.min(it,function(Zt){return(N-C-(Zt.length-1)*U)/y.sum(Zt,b)});it.forEach(function(Zt){Zt.forEach(function(Gt,ee){Gt.y1=(Gt.y0=ee)+Gt.value*Bt})}),gt.links.forEach(function(Zt){Zt.width=Zt.value*Bt})}function J(Ct){it.forEach(function(Rt){Rt.forEach(function(Bt){if(Bt.targetLinks.length){var Zt=(y.sum(Bt.targetLinks,_)/y.sum(Bt.targetLinks,b)-x(Bt))*Ct;Bt.y0+=Zt,Bt.y1+=Zt}})})}function mt(Ct){it.slice().reverse().forEach(function(Rt){Rt.forEach(function(Bt){if(Bt.sourceLinks.length){var Zt=(y.sum(Bt.sourceLinks,A)/y.sum(Bt.sourceLinks,b)-x(Bt))*Ct;Bt.y0+=Zt,Bt.y1+=Zt}})})}function dt(){it.forEach(function(Ct){var Rt,Bt,Zt=C,Gt=Ct.length,ee;for(Ct.sort(m),ee=0;ee0&&(Rt.y0+=Bt,Rt.y1+=Bt),Zt=Rt.y1+U;if(Bt=Zt-U-N,Bt>0)for(Zt=Rt.y0-=Bt,Rt.y1-=Bt,ee=Gt-2;ee>=0;--ee)Rt=Ct[ee],Bt=Rt.y1+U-Zt,Bt>0&&(Rt.y0-=Bt,Rt.y1-=Bt),Zt=Rt.y0})}}function rt(gt){gt.nodes.forEach(function(it){it.sourceLinks.sort(h),it.targetLinks.sort(s)}),gt.nodes.forEach(function(it){var st=it.y0,xt=st;it.sourceLinks.forEach(function(ot){ot.y0=st+ot.width/2,st+=ot.width}),it.targetLinks.forEach(function(ot){ot.y1=xt+ot.width/2,xt+=ot.width})})}return tt};function I(g){return[g.source.x1,g.y0]}function M(g){return[g.target.x0,g.y1]}var p=function(){return P.linkHorizontal().source(I).target(M)};f.sankey=E,f.sankeyCenter=o,f.sankeyLeft=i,f.sankeyRight=a,f.sankeyJustify=l,f.sankeyLinkHorizontal=p,Object.defineProperty(f,"__esModule",{value:!0})})}),Qtt=It((et,Y)=>{var f=Iz();Y.exports=function(y,z){var P=[],n=[],i=[],a={},l=[],o;function c(w){i[w]=!1,a.hasOwnProperty(w)&&Object.keys(a[w]).forEach(function(D){delete a[w][D],i[D]&&c(D)})}function s(w){var D=!1;n.push(w),i[w]=!0;var E,I;for(E=0;E=w})}function b(w){m(w);for(var D=y,E=f(D),I=E.components.filter(function(B){return B.length>1}),M=1/0,p,g=0;g{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Ek(),TA(),Dz(),Qtt()):y(f.d3=f.d3||{},f.d3,f.d3,f.d3,null)})(et,function(f,y,z,P,n){n=n&&n.hasOwnProperty("default")?n.default:n;function i(Gt){return Gt.target.depth}function a(Gt){return Gt.depth}function l(Gt,ee){return ee-1-Gt.height}function o(Gt,ee){return Gt.sourceLinks.length?Gt.depth:ee-1}function c(Gt){return Gt.targetLinks.length?Gt.depth:Gt.sourceLinks.length?y.min(Gt.sourceLinks,i)-1:0}function s(Gt){return function(){return Gt}}var h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Gt){return typeof Gt}:function(Gt){return Gt&&typeof Symbol=="function"&&Gt.constructor===Symbol&&Gt!==Symbol.prototype?"symbol":typeof Gt};function m(Gt,ee){return x(Gt.source,ee.source)||Gt.index-ee.index}function b(Gt,ee){return x(Gt.target,ee.target)||Gt.index-ee.index}function x(Gt,ee){return Gt.partOfCycle===ee.partOfCycle?Gt.y0-ee.y0:Gt.circularLinkType==="top"||ee.circularLinkType==="bottom"?-1:1}function _(Gt){return Gt.value}function A(Gt){return(Gt.y0+Gt.y1)/2}function d(Gt){return A(Gt.source)}function k(Gt){return A(Gt.target)}function w(Gt){return Gt.index}function D(Gt){return Gt.nodes}function E(Gt){return Gt.links}function I(Gt,ee){var xe=Gt.get(ee);if(!xe)throw new Error("missing: "+ee);return xe}function M(Gt,ee){return ee(Gt)}var p=25,g=10,C=.3;function S(){var Gt=0,ee=0,xe=1,ge=1,ye=24,ue,Mt=w,Ot=o,Lt=D,ie=E,be=32,ce=2,Le,Ze=null;function Qe(){var Oe={nodes:Lt.apply(null,arguments),links:ie.apply(null,arguments)};mr(Oe),N(Oe,Mt,Ze),fr(Oe),Er(Oe),B(Oe,Mt),dn(Oe,be,Mt),_n(Oe);for(var Xt=4,oe=0;oe"u"?"undefined":h(_t))!=="object"&&(_t=oe.source=I(Xt,_t)),(typeof Pt>"u"?"undefined":h(Pt))!=="object"&&(Pt=oe.target=I(Xt,Pt)),_t.sourceLinks.push(oe),Pt.targetLinks.push(oe)}),Oe}function fr(Oe){Oe.nodes.forEach(function(Xt){Xt.partOfCycle=!1,Xt.value=Math.max(y.sum(Xt.sourceLinks,_),y.sum(Xt.targetLinks,_)),Xt.sourceLinks.forEach(function(oe){oe.circular&&(Xt.partOfCycle=!0,Xt.circularLinkType=oe.circularLinkType)}),Xt.targetLinks.forEach(function(oe){oe.circular&&(Xt.partOfCycle=!0,Xt.circularLinkType=oe.circularLinkType)})})}function Jr(Oe){var Xt=0,oe=0,zt=0,_t=0,Pt=y.max(Oe.nodes,function(Ht){return Ht.column});return Oe.links.forEach(function(Ht){Ht.circular&&(Ht.circularLinkType=="top"?Xt=Xt+Ht.width:oe=oe+Ht.width,Ht.target.column==0&&(_t=_t+Ht.width),Ht.source.column==Pt&&(zt=zt+Ht.width))}),Xt=Xt>0?Xt+p+g:Xt,oe=oe>0?oe+p+g:oe,zt=zt>0?zt+p+g:zt,_t=_t>0?_t+p+g:_t,{top:Xt,bottom:oe,left:_t,right:zt}}function an(Oe,Xt){var oe=y.max(Oe.nodes,function(Me){return Me.column}),zt=xe-Gt,_t=ge-ee,Pt=zt+Xt.right+Xt.left,Ht=_t+Xt.top+Xt.bottom,ae=zt/Pt,he=_t/Ht;return Gt=Gt*ae+Xt.left,xe=Xt.right==0?xe:xe*ae,ee=ee*he+Xt.top,ge=ge*he,Oe.nodes.forEach(function(Me){Me.x0=Gt+Me.column*((xe-Gt-ye)/oe),Me.x1=Me.x0+ye}),he}function Er(Oe){var Xt,oe,zt;for(Xt=Oe.nodes,oe=[],zt=0;Xt.length;++zt,Xt=oe,oe=[])Xt.forEach(function(_t){_t.depth=zt,_t.sourceLinks.forEach(function(Pt){oe.indexOf(Pt.target)<0&&!Pt.circular&&oe.push(Pt.target)})});for(Xt=Oe.nodes,oe=[],zt=0;Xt.length;++zt,Xt=oe,oe=[])Xt.forEach(function(_t){_t.height=zt,_t.targetLinks.forEach(function(Pt){oe.indexOf(Pt.source)<0&&!Pt.circular&&oe.push(Pt.source)})});Oe.nodes.forEach(function(_t){_t.column=Math.floor(Ot.call(null,_t,zt))})}function dn(Oe,Xt,oe){var zt=z.nest().key(function(Me){return Me.column}).sortKeys(y.ascending).entries(Oe.nodes).map(function(Me){return Me.values});Ht(oe),he();for(var _t=1,Pt=Xt;Pt>0;--Pt)ae(_t*=.99,oe),he();function Ht(Me){if(Le){var qe=1/0;zt.forEach(function(zr){var xr=ge*Le/(zr.length+1);qe=xr0))if(zr==0&&Rr==1)pn=xr.y1-xr.y0,xr.y0=ge/2-pn/2,xr.y1=ge/2+pn/2;else if(zr==Ye-1&&Rr==1)pn=xr.y1-xr.y0,xr.y0=ge/2-pn/2,xr.y1=ge/2+pn/2;else{var ci=0,ui=y.mean(xr.sourceLinks,k),yi=y.mean(xr.targetLinks,d);ui&&yi?ci=(ui+yi)/2:ci=ui||yi;var Gi=(ci-A(xr))*Me;xr.y0+=Gi,xr.y1+=Gi}})})}function he(){zt.forEach(function(Me){var qe,Ye,ur=ee,Rr=Me.length,zr;for(Me.sort(x),zr=0;zr0&&(qe.y0+=Ye,qe.y1+=Ye),ur=qe.y1+ue;if(Ye=ur-ue-ge,Ye>0)for(ur=qe.y0-=Ye,qe.y1-=Ye,zr=Rr-2;zr>=0;--zr)qe=Me[zr],Ye=qe.y1+ue-ur,Ye>0&&(qe.y0-=Ye,qe.y1-=Ye),ur=qe.y0})}}function _n(Oe){Oe.nodes.forEach(function(Xt){Xt.sourceLinks.sort(b),Xt.targetLinks.sort(m)}),Oe.nodes.forEach(function(Xt){var oe=Xt.y0,zt=oe,_t=Xt.y1,Pt=_t;Xt.sourceLinks.forEach(function(Ht){Ht.circular?(Ht.y0=_t-Ht.width/2,_t=_t-Ht.width):(Ht.y0=oe+Ht.width/2,oe+=Ht.width)}),Xt.targetLinks.forEach(function(Ht){Ht.circular?(Ht.y1=Pt-Ht.width/2,Pt=Pt-Ht.width):(Ht.y1=zt+Ht.width/2,zt+=Ht.width)})})}return Qe}function N(Gt,ee,xe){var ge=0;if(xe===null){for(var ye=[],ue=0;ueee.source.column)}function W(Gt,ee){var xe=0;Gt.sourceLinks.forEach(function(ye){xe=ye.circular&&!Bt(ye,ee)?xe+1:xe});var ge=0;return Gt.targetLinks.forEach(function(ye){ge=ye.circular&&!Bt(ye,ee)?ge+1:ge}),xe+ge}function F(Gt){var ee=Gt.source.sourceLinks,xe=0;ee.forEach(function(ue){xe=ue.circular?xe+1:xe});var ge=Gt.target.targetLinks,ye=0;return ge.forEach(function(ue){ye=ue.circular?ye+1:ye}),!(xe>1||ye>1)}function H(Gt,ee,xe){return Gt.sort(tt),Gt.forEach(function(ge,ye){var ue=0;if(Bt(ge,xe)&&F(ge))ge.circularPathData.verticalBuffer=ue+ge.width/2;else{var Mt=0;for(Mt;Mtue?Ot:ue}ge.circularPathData.verticalBuffer=ue+ge.width/2}}),Gt}function q(Gt,ee,xe,ge){var ye=5,ue=y.min(Gt.links,function(Lt){return Lt.source.y0});Gt.links.forEach(function(Lt){Lt.circular&&(Lt.circularPathData={})});var Mt=Gt.links.filter(function(Lt){return Lt.circularLinkType=="top"});H(Mt,ee,ge);var Ot=Gt.links.filter(function(Lt){return Lt.circularLinkType=="bottom"});H(Ot,ee,ge),Gt.links.forEach(function(Lt){if(Lt.circular){if(Lt.circularPathData.arcRadius=Lt.width+g,Lt.circularPathData.leftNodeBuffer=ye,Lt.circularPathData.rightNodeBuffer=ye,Lt.circularPathData.sourceWidth=Lt.source.x1-Lt.source.x0,Lt.circularPathData.sourceX=Lt.source.x0+Lt.circularPathData.sourceWidth,Lt.circularPathData.targetX=Lt.target.x0,Lt.circularPathData.sourceY=Lt.y0,Lt.circularPathData.targetY=Lt.y1,Bt(Lt,ge)&&F(Lt))Lt.circularPathData.leftSmallArcRadius=g+Lt.width/2,Lt.circularPathData.leftLargeArcRadius=g+Lt.width/2,Lt.circularPathData.rightSmallArcRadius=g+Lt.width/2,Lt.circularPathData.rightLargeArcRadius=g+Lt.width/2,Lt.circularLinkType=="bottom"?(Lt.circularPathData.verticalFullExtent=Lt.source.y1+p+Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.rightLargeArcRadius):(Lt.circularPathData.verticalFullExtent=Lt.source.y0-p-Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.rightLargeArcRadius);else{var ie=Lt.source.column,be=Lt.circularLinkType,ce=Gt.links.filter(function(Qe){return Qe.source.column==ie&&Qe.circularLinkType==be});Lt.circularLinkType=="bottom"?ce.sort(bt):ce.sort(ht);var Le=0;ce.forEach(function(Qe,mr){Qe.circularLinkID==Lt.circularLinkID&&(Lt.circularPathData.leftSmallArcRadius=g+Lt.width/2+Le,Lt.circularPathData.leftLargeArcRadius=g+Lt.width/2+mr*ee+Le),Le=Le+Qe.width}),ie=Lt.target.column,ce=Gt.links.filter(function(Qe){return Qe.target.column==ie&&Qe.circularLinkType==be}),Lt.circularLinkType=="bottom"?ce.sort(ut):ce.sort(vt),Le=0,ce.forEach(function(Qe,mr){Qe.circularLinkID==Lt.circularLinkID&&(Lt.circularPathData.rightSmallArcRadius=g+Lt.width/2+Le,Lt.circularPathData.rightLargeArcRadius=g+Lt.width/2+mr*ee+Le),Le=Le+Qe.width}),Lt.circularLinkType=="bottom"?(Lt.circularPathData.verticalFullExtent=Math.max(xe,Lt.source.y1,Lt.target.y1)+p+Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.rightLargeArcRadius):(Lt.circularPathData.verticalFullExtent=ue-p-Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.rightLargeArcRadius)}Lt.circularPathData.leftInnerExtent=Lt.circularPathData.sourceX+Lt.circularPathData.leftNodeBuffer,Lt.circularPathData.rightInnerExtent=Lt.circularPathData.targetX-Lt.circularPathData.rightNodeBuffer,Lt.circularPathData.leftFullExtent=Lt.circularPathData.sourceX+Lt.circularPathData.leftLargeArcRadius+Lt.circularPathData.leftNodeBuffer,Lt.circularPathData.rightFullExtent=Lt.circularPathData.targetX-Lt.circularPathData.rightLargeArcRadius-Lt.circularPathData.rightNodeBuffer}if(Lt.circular)Lt.path=G(Lt);else{var Ze=P.linkHorizontal().source(function(Qe){var mr=Qe.source.x0+(Qe.source.x1-Qe.source.x0),fr=Qe.y0;return[mr,fr]}).target(function(Qe){var mr=Qe.target.x0,fr=Qe.y1;return[mr,fr]});Lt.path=Ze(Lt)}})}function G(Gt){var ee="";return Gt.circularLinkType=="top"?ee="M"+Gt.circularPathData.sourceX+" "+Gt.circularPathData.sourceY+" L"+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.sourceY+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftSmallArcRadius+" 0 0 0 "+Gt.circularPathData.leftFullExtent+" "+(Gt.circularPathData.sourceY-Gt.circularPathData.leftSmallArcRadius)+" L"+Gt.circularPathData.leftFullExtent+" "+Gt.circularPathData.verticalLeftInnerExtent+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftLargeArcRadius+" 0 0 0 "+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" L"+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightLargeArcRadius+" 0 0 0 "+Gt.circularPathData.rightFullExtent+" "+Gt.circularPathData.verticalRightInnerExtent+" L"+Gt.circularPathData.rightFullExtent+" "+(Gt.circularPathData.targetY-Gt.circularPathData.rightSmallArcRadius)+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightSmallArcRadius+" 0 0 0 "+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.targetY+" L"+Gt.circularPathData.targetX+" "+Gt.circularPathData.targetY:ee="M"+Gt.circularPathData.sourceX+" "+Gt.circularPathData.sourceY+" L"+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.sourceY+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftSmallArcRadius+" 0 0 1 "+Gt.circularPathData.leftFullExtent+" "+(Gt.circularPathData.sourceY+Gt.circularPathData.leftSmallArcRadius)+" L"+Gt.circularPathData.leftFullExtent+" "+Gt.circularPathData.verticalLeftInnerExtent+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftLargeArcRadius+" 0 0 1 "+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" L"+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightLargeArcRadius+" 0 0 1 "+Gt.circularPathData.rightFullExtent+" "+Gt.circularPathData.verticalRightInnerExtent+" L"+Gt.circularPathData.rightFullExtent+" "+(Gt.circularPathData.targetY+Gt.circularPathData.rightSmallArcRadius)+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightSmallArcRadius+" 0 0 1 "+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.targetY+" L"+Gt.circularPathData.targetX+" "+Gt.circularPathData.targetY,ee}function tt(Gt,ee){return rt(Gt)==rt(ee)?Gt.circularLinkType=="bottom"?bt(Gt,ee):ht(Gt,ee):rt(ee)-rt(Gt)}function ht(Gt,ee){return Gt.y0-ee.y0}function bt(Gt,ee){return ee.y0-Gt.y0}function vt(Gt,ee){return Gt.y1-ee.y1}function ut(Gt,ee){return ee.y1-Gt.y1}function rt(Gt){return Gt.target.column-Gt.source.column}function gt(Gt){return Gt.target.x0-Gt.source.x1}function it(Gt,ee){var xe=U(Gt),ge=gt(ee)/Math.tan(xe),ye=Rt(Gt)=="up"?Gt.y1+ge:Gt.y1-ge;return ye}function st(Gt,ee){var xe=U(Gt),ge=gt(ee)/Math.tan(xe),ye=Rt(Gt)=="up"?Gt.y1-ge:Gt.y1+ge;return ye}function xt(Gt,ee,xe,ge){Gt.links.forEach(function(ye){if(!ye.circular&&ye.target.column-ye.source.column>1){var ue=ye.source.column+1,Mt=ye.target.column-1,Ot=1,Lt=Mt-ue+1;for(Ot=1;ue<=Mt;ue++,Ot++)Gt.nodes.forEach(function(ie){if(ie.column==ue){var be=Ot/(Lt+1),ce=Math.pow(1-be,3),Le=3*be*Math.pow(1-be,2),Ze=3*Math.pow(be,2)*(1-be),Qe=Math.pow(be,3),mr=ce*ye.y0+Le*ye.y0+Ze*ye.y1+Qe*ye.y1,fr=mr-ye.width/2,Jr=mr+ye.width/2,an;fr>ie.y0&&frie.y0&&Jrie.y1&&J(Er,an,ee,xe)})):frie.y1&&(an=Jr-ie.y0+10,ie=J(ie,an,ee,xe),Gt.nodes.forEach(function(Er){M(Er,ge)==M(ie,ge)||Er.column!=ie.column||Er.y0ie.y1&&J(Er,an,ee,xe)}))}})}})}function ot(Gt,ee){return Gt.y0>ee.y0&&Gt.y0ee.y0&&Gt.y1ee.y1}function J(Gt,ee,xe,ge){return Gt.y0+ee>=xe&&Gt.y1+ee<=ge&&(Gt.y0=Gt.y0+ee,Gt.y1=Gt.y1+ee,Gt.targetLinks.forEach(function(ye){ye.y1=ye.y1+ee}),Gt.sourceLinks.forEach(function(ye){ye.y0=ye.y0+ee})),Gt}function mt(Gt,ee,xe,ge){Gt.nodes.forEach(function(ye){ge&&ye.y+(ye.y1-ye.y0)>ee&&(ye.y=ye.y-(ye.y+(ye.y1-ye.y0)-ee));var ue=Gt.links.filter(function(Lt){return M(Lt.source,xe)==M(ye,xe)}),Mt=ue.length;Mt>1&&ue.sort(function(Lt,ie){if(!Lt.circular&&!ie.circular){if(Lt.target.column==ie.target.column)return Lt.y1-ie.y1;if(Ct(Lt,ie)){if(Lt.target.column>ie.target.column){var be=st(ie,Lt);return Lt.y1-be}if(ie.target.column>Lt.target.column){var ce=st(Lt,ie);return ce-ie.y1}}else return Lt.y1-ie.y1}if(Lt.circular&&!ie.circular)return Lt.circularLinkType=="top"?-1:1;if(ie.circular&&!Lt.circular)return ie.circularLinkType=="top"?1:-1;if(Lt.circular&&ie.circular)return Lt.circularLinkType===ie.circularLinkType&&Lt.circularLinkType=="top"?Lt.target.column===ie.target.column?Lt.target.y1-ie.target.y1:ie.target.column-Lt.target.column:Lt.circularLinkType===ie.circularLinkType&&Lt.circularLinkType=="bottom"?Lt.target.column===ie.target.column?ie.target.y1-Lt.target.y1:Lt.target.column-ie.target.column:Lt.circularLinkType=="top"?-1:1});var Ot=ye.y0;ue.forEach(function(Lt){Lt.y0=Ot+Lt.width/2,Ot=Ot+Lt.width}),ue.forEach(function(Lt,ie){if(Lt.circularLinkType=="bottom"){var be=ie+1,ce=0;for(be;be1&&ye.sort(function(Ot,Lt){if(!Ot.circular&&!Lt.circular){if(Ot.source.column==Lt.source.column)return Ot.y0-Lt.y0;if(Ct(Ot,Lt)){if(Lt.source.column0?"up":"down"}function Bt(Gt,ee){return M(Gt.source,ee)==M(Gt.target,ee)}function Zt(Gt,ee,xe){var ge=Gt.nodes,ye=Gt.links,ue=!1,Mt=!1;if(ye.forEach(function(Le){Le.circularLinkType=="top"?ue=!0:Le.circularLinkType=="bottom"&&(Mt=!0)}),ue==!1||Mt==!1){var Ot=y.min(ge,function(Le){return Le.y0}),Lt=y.max(ge,function(Le){return Le.y1}),ie=Lt-Ot,be=xe-ee,ce=be/ie;ge.forEach(function(Le){var Ze=(Le.y1-Le.y0)*ce;Le.y0=(Le.y0-Ot)*ce,Le.y1=Le.y0+Ze}),ye.forEach(function(Le){Le.y0=(Le.y0-Ot)*ce,Le.y1=(Le.y1-Ot)*ce,Le.width=Le.width*ce})}}f.sankeyCircular=S,f.sankeyCenter=c,f.sankeyLeft=a,f.sankeyRight=l,f.sankeyJustify=o,Object.defineProperty(f,"__esModule",{value:!0})})}),zz=It((et,Y)=>{Y.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}),eet=It((et,Y)=>{var f=Ytt(),y=(Eb(),tn($_)).interpolateNumber,z=Br(),P=Jtt(),n=tet(),i=zz(),a=Xi(),l=Hn(),o=Js(),c=jn(),s=c.strTranslate,h=c.strRotate,m=e1(),b=m.keyFun,x=m.repeat,_=m.unwrap,A=uu(),d=ls(),k=Rd(),w=k.CAP_SHIFT,D=k.LINE_SPACING,E=3;function I(it,st,xt){var ot=_(st),J=ot.trace,mt=J.domain,dt=J.orientation==="h",Ct=J.node.pad,Rt=J.node.thickness,Bt={justify:P.sankeyJustify,left:P.sankeyLeft,right:P.sankeyRight,center:P.sankeyCenter}[J.node.align],Zt=it.width*(mt.x[1]-mt.x[0]),Gt=it.height*(mt.y[1]-mt.y[0]),ee=ot._nodes,xe=ot._links,ge=ot.circular,ye;ge?ye=n.sankeyCircular().circularLinkGap(0):ye=P.sankey(),ye.iterations(i.sankeyIterations).size(dt?[Zt,Gt]:[Gt,Zt]).nodeWidth(Rt).nodePadding(Ct).nodeId(function(Er){return Er.pointNumber}).nodeAlign(Bt).nodes(ee).links(xe);var ue=ye();ye.nodePadding()=Xt||(Oe=Xt-_n.y0,Oe>1e-6&&(_n.y0+=Oe,_n.y1+=Oe)),Xt=_n.y1+Ct})}function mr(Er){var dn=Er.map(function(Pt,Ht){return{x0:Pt.x0,index:Ht}}).sort(function(Pt,Ht){return Pt.x0-Ht.x0}),_n=[],Oe=-1,Xt,oe=-1/0,zt;for(Mt=0;Mtoe+Rt&&(Oe+=1,Xt=_t.x0),oe=_t.x0,_n[Oe]||(_n[Oe]=[]),_n[Oe].push(_t),zt=Xt-_t.x0,_t.x0+=zt,_t.x1+=zt}return _n}if(J.node.x.length&&J.node.y.length){for(Mt=0;Mt0?" L "+J.targetX+" "+J.targetY:"")+"Z"):(xt="M "+(J.targetX-st)+" "+(J.targetY-ot)+" L "+(J.rightInnerExtent-st)+" "+(J.targetY-ot)+" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightSmallArcRadius+ot)+" 0 0 0 "+(J.rightFullExtent-ot-st)+" "+(J.targetY+J.rightSmallArcRadius)+" L "+(J.rightFullExtent-ot-st)+" "+J.verticalRightInnerExtent,mt&&dt?xt+=" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.rightInnerExtent-ot-st)+" "+(J.verticalFullExtent+ot)+" L "+(J.rightFullExtent+ot-st-(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent+ot)+" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.leftFullExtent+ot)+" "+J.verticalLeftInnerExtent:mt?xt+=" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.rightFullExtent-st-ot-(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" L "+(J.leftFullExtent+ot+(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.leftFullExtent+ot)+" "+J.verticalLeftInnerExtent:xt+=" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.rightInnerExtent-st)+" "+(J.verticalFullExtent+ot)+" L "+J.leftInnerExtent+" "+(J.verticalFullExtent+ot)+" A "+(J.leftLargeArcRadius+ot)+" "+(J.leftLargeArcRadius+ot)+" 0 0 0 "+(J.leftFullExtent+ot)+" "+J.verticalLeftInnerExtent,xt+=" L "+(J.leftFullExtent+ot)+" "+(J.sourceY+J.leftSmallArcRadius)+" A "+(J.leftLargeArcRadius+ot)+" "+(J.leftSmallArcRadius+ot)+" 0 0 0 "+J.leftInnerExtent+" "+(J.sourceY-ot)+" L "+J.sourceX+" "+(J.sourceY-ot)+" L "+J.sourceX+" "+(J.sourceY+ot)+" L "+J.leftInnerExtent+" "+(J.sourceY+ot)+" A "+(J.leftLargeArcRadius-ot)+" "+(J.leftSmallArcRadius-ot)+" 0 0 1 "+(J.leftFullExtent-ot)+" "+(J.sourceY+J.leftSmallArcRadius)+" L "+(J.leftFullExtent-ot)+" "+J.verticalLeftInnerExtent,mt&&dt?xt+=" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.leftFullExtent-ot-(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" L "+(J.rightFullExtent+ot-st+(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.rightFullExtent+ot-st)+" "+J.verticalRightInnerExtent:mt?xt+=" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.leftFullExtent+ot)+" "+(J.verticalFullExtent+ot)+" L "+(J.rightFullExtent-st-ot)+" "+(J.verticalFullExtent+ot)+" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.rightFullExtent+ot-st)+" "+J.verticalRightInnerExtent:xt+=" A "+(J.leftLargeArcRadius-ot)+" "+(J.leftLargeArcRadius-ot)+" 0 0 1 "+J.leftInnerExtent+" "+(J.verticalFullExtent-ot)+" L "+(J.rightInnerExtent-st)+" "+(J.verticalFullExtent-ot)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightLargeArcRadius-ot)+" 0 0 1 "+(J.rightFullExtent+ot-st)+" "+J.verticalRightInnerExtent,xt+=" L "+(J.rightFullExtent+ot-st)+" "+(J.targetY+J.rightSmallArcRadius)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.rightInnerExtent-st)+" "+(J.targetY+ot)+" L "+(J.targetX-st)+" "+(J.targetY+ot)+(st>0?" L "+J.targetX+" "+J.targetY:"")+"Z"),xt}function g(){var it=.5;function st(xt){var ot=xt.linkArrowLength;if(xt.link.circular)return p(xt.link,ot);var J=Math.abs((xt.link.target.x0-xt.link.source.x1)/2);ot>J&&(ot=J);var mt=xt.link.source.x1,dt=xt.link.target.x0-ot,Ct=y(mt,dt),Rt=Ct(it),Bt=Ct(1-it),Zt=xt.link.y0-xt.link.width/2,Gt=xt.link.y0+xt.link.width/2,ee=xt.link.y1-xt.link.width/2,xe=xt.link.y1+xt.link.width/2,ge="M"+mt+","+Zt,ye="C"+Rt+","+Zt+" "+Bt+","+ee+" "+dt+","+ee,ue="C"+Bt+","+xe+" "+Rt+","+Gt+" "+mt+","+Gt,Mt=ot>0?"L"+(dt+ot)+","+(ee+xt.link.width/2):"";return Mt+="L"+dt+","+xe,ge+ye+Mt+ue+"Z"}return st}function C(it,st){var xt=a(st.color),ot=i.nodePadAcross,J=it.nodePad/2;st.dx=st.x1-st.x0,st.dy=st.y1-st.y0;var mt=st.dx,dt=Math.max(.5,st.dy),Ct="node_"+st.pointNumber;return st.group&&(Ct=c.randstr()),st.trace=it.trace,st.curveNumber=it.trace.index,{index:st.pointNumber,key:Ct,partOfGroup:st.partOfGroup||!1,group:st.group,traceId:it.key,trace:it.trace,node:st,nodePad:it.nodePad,nodeLineColor:it.nodeLineColor,nodeLineWidth:it.nodeLineWidth,textFont:it.textFont,size:it.horizontal?it.height:it.width,visibleWidth:Math.ceil(mt),visibleHeight:dt,zoneX:-ot,zoneY:-J,zoneWidth:mt+2*ot,zoneHeight:dt+2*J,labelY:it.horizontal?st.dy/2+1:st.dx/2+1,left:st.originalLayer===1,sizeAcross:it.width,forceLayouts:it.forceLayouts,horizontal:it.horizontal,darkBackground:xt.getBrightness()<=128,tinyColorHue:l.tinyRGB(xt),tinyColorAlpha:xt.getAlpha(),valueFormat:it.valueFormat,valueSuffix:it.valueSuffix,sankey:it.sankey,graph:it.graph,arrangement:it.arrangement,uniqueNodeLabelPathId:[it.guid,it.key,Ct].join("_"),interactionState:it.interactionState,figure:it}}function S(it){it.attr("transform",function(st){return s(st.node.x0.toFixed(3),st.node.y0.toFixed(3))})}function N(it){it.call(S)}function B(it,st){it.call(N),st.attr("d",g())}function U(it){it.attr("width",function(st){return st.node.x1-st.node.x0}).attr("height",function(st){return st.visibleHeight})}function V(it){return it.link.width>1||it.linkLineWidth>0}function W(it){var st=s(it.translateX,it.translateY);return st+(it.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function F(it,st,xt){it.on(".basic",null).on("mouseover.basic",function(ot){!ot.interactionState.dragInProgress&&!ot.partOfGroup&&(xt.hover(this,ot,st),ot.interactionState.hovered=[this,ot])}).on("mousemove.basic",function(ot){!ot.interactionState.dragInProgress&&!ot.partOfGroup&&(xt.follow(this,ot),ot.interactionState.hovered=[this,ot])}).on("mouseout.basic",function(ot){!ot.interactionState.dragInProgress&&!ot.partOfGroup&&(xt.unhover(this,ot,st),ot.interactionState.hovered=!1)}).on("click.basic",function(ot){ot.interactionState.hovered&&(xt.unhover(this,ot,st),ot.interactionState.hovered=!1),!ot.interactionState.dragInProgress&&!ot.partOfGroup&&xt.select(this,ot,st)})}function H(it,st,xt,ot){var J=z.behavior.drag().origin(function(mt){return{x:mt.node.x0+mt.visibleWidth/2,y:mt.node.y0+mt.visibleHeight/2}}).on("dragstart",function(mt){if(mt.arrangement!=="fixed"&&(c.ensureSingle(ot._fullLayout._infolayer,"g","dragcover",function(Ct){ot._fullLayout._dragCover=Ct}),c.raiseToTop(this),mt.interactionState.dragInProgress=mt.node,vt(mt.node),mt.interactionState.hovered&&(xt.nodeEvents.unhover.apply(0,mt.interactionState.hovered),mt.interactionState.hovered=!1),mt.arrangement==="snap")){var dt=mt.traceId+"|"+mt.key;mt.forceLayouts[dt]?mt.forceLayouts[dt].alpha(1):q(it,dt,mt),G(it,st,mt,dt,ot)}}).on("drag",function(mt){if(mt.arrangement!=="fixed"){var dt=z.event.x,Ct=z.event.y;mt.arrangement==="snap"?(mt.node.x0=dt-mt.visibleWidth/2,mt.node.x1=dt+mt.visibleWidth/2,mt.node.y0=Ct-mt.visibleHeight/2,mt.node.y1=Ct+mt.visibleHeight/2):(mt.arrangement==="freeform"&&(mt.node.x0=dt-mt.visibleWidth/2,mt.node.x1=dt+mt.visibleWidth/2),Ct=Math.max(0,Math.min(mt.size-mt.visibleHeight/2,Ct)),mt.node.y0=Ct-mt.visibleHeight/2,mt.node.y1=Ct+mt.visibleHeight/2),vt(mt.node),mt.arrangement!=="snap"&&(mt.sankey.update(mt.graph),B(it.filter(ut(mt)),st))}}).on("dragend",function(mt){if(mt.arrangement!=="fixed"){mt.interactionState.dragInProgress=!1;for(var dt=0;dt0)window.requestAnimationFrame(mt);else{var Rt=xt.node.originalX;xt.node.x0=Rt-xt.visibleWidth/2,xt.node.x1=Rt+xt.visibleWidth/2,ht(xt,J)}})}function tt(it,st,xt,ot){return function(){for(var J=0,mt=0;mt0&&ot.forceLayouts[st].alpha(0)}}function ht(it,st){for(var xt=[],ot=[],J=0;J{var f=Br(),y=jn(),z=y.numberFormat,P=eet(),n=hd(),i=Hn(),a=zz().cn,l=y._;function o(w){return w!==""}function c(w,D){return w.filter(function(E){return E.key===D.traceId})}function s(w,D){f.select(w).select("path").style("fill-opacity",D),f.select(w).select("rect").style("fill-opacity",D)}function h(w){f.select(w).select("text.name").style("fill","black")}function m(w){return function(D){return w.node.sourceLinks.indexOf(D.link)!==-1||w.node.targetLinks.indexOf(D.link)!==-1}}function b(w){return function(D){return D.node.sourceLinks.indexOf(w.link)!==-1||D.node.targetLinks.indexOf(w.link)!==-1}}function x(w,D,E){D&&E&&c(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(A.bind(0,D,E,!1))}function _(w,D,E){D&&E&&c(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(d.bind(0,D,E,!1))}function A(w,D,E,I){I.style("fill",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverHue}).style("fill-opacity",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverAlpha}),I.each(function(M){var p=M.link.label;p!==""&&c(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverHue}).style("fill-opacity",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverAlpha})}),E&&c(D,w).selectAll("."+a.sankeyNode).filter(b(w)).call(x)}function d(w,D,E,I){I.style("fill",function(M){return M.tinyColorHue}).style("fill-opacity",function(M){return M.tinyColorAlpha}),I.each(function(M){var p=M.link.label;p!==""&&c(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){return g.tinyColorHue}).style("fill-opacity",function(g){return g.tinyColorAlpha})}),E&&c(D,w).selectAll(a.sankeyNode).filter(b(w)).call(_)}function k(w,D){var E=w.hoverlabel||{},I=y.nestedProperty(E,D).get();return Array.isArray(I)?!1:I}Y.exports=function(w,D){for(var E=w._fullLayout,I=E._paper,M=E._size,p=0;p"),color:k(ut,"bgcolor")||i.addOpacity(xt.color,1),borderColor:k(ut,"bordercolor"),fontFamily:k(ut,"font.family"),fontSize:k(ut,"font.size"),fontColor:k(ut,"font.color"),fontWeight:k(ut,"font.weight"),fontStyle:k(ut,"font.style"),fontVariant:k(ut,"font.variant"),fontTextcase:k(ut,"font.textcase"),fontLineposition:k(ut,"font.lineposition"),fontShadow:k(ut,"font.shadow"),nameLength:k(ut,"namelength"),textAlign:k(ut,"align"),idealAlign:f.event.x"),color:k(ut,"bgcolor")||vt.tinyColorHue,borderColor:k(ut,"bordercolor"),fontFamily:k(ut,"font.family"),fontSize:k(ut,"font.size"),fontColor:k(ut,"font.color"),fontWeight:k(ut,"font.weight"),fontStyle:k(ut,"font.style"),fontVariant:k(ut,"font.variant"),fontTextcase:k(ut,"font.textcase"),fontLineposition:k(ut,"font.lineposition"),fontShadow:k(ut,"font.shadow"),nameLength:k(ut,"namelength"),textAlign:k(ut,"align"),idealAlign:"left",hovertemplate:ut.hovertemplate,hovertemplateLabels:J,eventData:[vt.node]},{container:E._hoverlayer.node(),outerContainer:E._paper.node(),gd:w});s(Ct,.85),h(Ct)}}},ht=function(bt,vt,ut){w._fullLayout.hovermode!==!1&&(f.select(bt).call(_,vt,ut),vt.node.trace.node.hoverinfo!=="skip"&&(vt.node.fullData=vt.node.trace,w.emit("plotly_unhover",{event:f.event,points:[vt.node]})),n.loneUnhover(E._hoverlayer.node()))};P(w,I,D,{width:M.w,height:M.h,margin:{t:M.t,r:M.r,b:M.b,l:M.l}},{linkEvents:{hover:S,follow:F,unhover:H,select:C},nodeEvents:{hover:G,follow:tt,unhover:ht,select:q}})}}),ret=It(et=>{var Y=sh().overrideAll,f=Mf().getModuleCalcData,y=Oz(),z=io(),P=Mm(),n=Up(),i=Md().prepSelect,a=jn(),l=ls(),o="sankey";et.name=o,et.baseLayoutAttrOverrides=Y({hoverlabel:z.hoverlabel},"plot","nested"),et.plot=function(s){var h=f(s.calcdata,o)[0];y(s,h),et.updateFx(s)},et.clean=function(s,h,m,b){var x=b._has&&b._has(o),_=h._has&&h._has(o);x&&!_&&(b._paperdiv.selectAll(".sankey").remove(),b._paperdiv.selectAll(".bgsankey").remove())},et.updateFx=function(s){for(var h=0;h{Y.exports=function(f,y){for(var z=f.cd,P=[],n=z[0].trace,i=n._sankey.graph.nodes,a=0;a{Y.exports={attributes:Pz(),supplyDefaults:Wtt(),calc:qtt(),plot:Oz(),moduleType:"trace",name:"sankey",basePlotModule:ret(),selectPoints:net(),categories:["noOpacity"],meta:{}}}),aet=It((et,Y)=>{Y.exports=iet()}),oet=It(et=>{var Y=lh();et.name="indicator",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),Bz=It((et,Y)=>{var f=Yn().extendFlat,y=Yn().extendDeep,z=sh().overrideAll,P=hi(),n=Sn(),i=Jh().attributes,a=Gf(),l=Tc().templatedArray,o=Ow(),c=Sh().descriptionOnlyNumbers,s=P({editType:"plot",colorEditType:"plot"}),h={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:n.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},m={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},b=l("step",y({},h,{range:m}));Y.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:i({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:f({},s,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:c("value")},font:f({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:c("value")},increasing:{symbol:{valType:"string",dflt:o.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:o.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:f({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:y({},h,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:z({range:m,visible:f({},a.visible,{dflt:!0}),tickmode:a.minor.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:f({},a.ticks,{dflt:"outside"}),ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,ticklabelstep:a.ticklabelstep,showticklabels:a.showticklabels,labelalias:a.labelalias,tickfont:P({}),tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,tickprefix:a.tickprefix,showtickprefix:a.showtickprefix,ticksuffix:a.ticksuffix,showticksuffix:a.showticksuffix,separatethousands:a.separatethousands,exponentformat:a.exponentformat,minexponent:a.minexponent,showexponent:a.showexponent,editType:"plot"},"plot"),steps:b,threshold:{line:{color:f({},h.line.color,{}),width:f({},h.line.width,{dflt:1}),editType:"plot"},thickness:f({},h.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),Rz=It((et,Y)=>{Y.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),set=It((et,Y)=>{var f=jn(),y=Bz(),z=Jh().defaults,P=Tc(),n=Zf(),i=Rz(),a=jv(),l=Uv(),o=q0(),c=Sg();function s(m,b,x,_){function A(H,q){return f.coerce(m,b,y,H,q)}z(b,_,A),A("mode"),b._hasNumber=b.mode.indexOf("number")!==-1,b._hasDelta=b.mode.indexOf("delta")!==-1,b._hasGauge=b.mode.indexOf("gauge")!==-1;var d=A("value");b._range=[0,typeof d=="number"?1.5*d:1];var k=new Array(2),w;if(b._hasNumber){A("number.valueformat");var D=f.extendFlat({},_.font);D.size=void 0,f.coerceFont(A,"number.font",D),b.number.font.size===void 0&&(b.number.font.size=i.defaultNumberFontSize,k[0]=!0),A("number.prefix"),A("number.suffix"),w=b.number.font.size}var E;if(b._hasDelta){var I=f.extendFlat({},_.font);I.size=void 0,f.coerceFont(A,"delta.font",I),b.delta.font.size===void 0&&(b.delta.font.size=(b._hasNumber?.5:1)*(w||i.defaultNumberFontSize),k[1]=!0),A("delta.reference",b.value),A("delta.relative"),A("delta.valueformat",b.delta.relative?"2%":""),A("delta.increasing.symbol"),A("delta.increasing.color"),A("delta.decreasing.symbol"),A("delta.decreasing.color"),A("delta.position"),A("delta.prefix"),A("delta.suffix"),E=b.delta.font.size}b._scaleNumbers=(!b._hasNumber||k[0])&&(!b._hasDelta||k[1])||!1;var M=f.extendFlat({},_.font);M.size=.25*(w||E||i.defaultNumberFontSize),f.coerceFont(A,"title.font",M),A("title.text");var p,g,C,S;function N(H,q){return f.coerce(p,g,y.gauge,H,q)}function B(H,q){return f.coerce(C,S,y.gauge.axis,H,q)}if(b._hasGauge){p=m.gauge,p||(p={}),g=P.newContainer(b,"gauge"),N("shape");var U=b._isBullet=b.gauge.shape==="bullet";U||A("title.align","center");var V=b._isAngular=b.gauge.shape==="angular";V||A("align","center"),N("bgcolor",_.paper_bgcolor),N("borderwidth"),N("bordercolor"),N("bar.color"),N("bar.line.color"),N("bar.line.width");var W=i.valueThickness*(b.gauge.shape==="bullet"?.5:1);N("bar.thickness",W),n(p,g,{name:"steps",handleItemDefaults:h}),N("threshold.value"),N("threshold.thickness"),N("threshold.line.width"),N("threshold.line.color"),C={},p&&(C=p.axis||{}),S=P.newContainer(g,"axis"),B("visible"),b._range=B("range",b._range);var F={font:_.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};a(C,S,B,"linear"),c(C,S,B,"linear",F),o(C,S,B,"linear",F),l(C,S,B,F)}else A("title.align","center"),A("align","center"),b._isAngular=b._isBullet=!1;b._length=null}function h(m,b){function x(_,A){return f.coerce(m,b,y.gauge.steps,_,A)}x("color"),x("line.color"),x("line.width"),x("range"),x("thickness")}Y.exports={supplyDefaults:s}}),cet=It((et,Y)=>{function f(y,z){var P=[],n=z.value;typeof z._lastValue!="number"&&(z._lastValue=z.value);var i=z._lastValue,a=i;return z._hasDelta&&typeof z.delta.reference=="number"&&(a=z.delta.reference),P[0]={y:n,lastY:i,delta:n-a,relativeDelta:(n-a)/a},P}Y.exports={calc:f}}),uet=It((et,Y)=>{var f=Br(),y=(Eb(),tn($_)).interpolate,z=(Eb(),tn($_)).interpolateNumber,P=jn(),n=P.strScale,i=P.strTranslate,a=P.rad2deg,l=Rd().MID_SHIFT,o=Js(),c=Rz(),s=uu(),h=Fs(),m=pb(),b=Ew(),x=Gf(),_=Hn(),A={left:"start",center:"middle",right:"end"},d={left:0,center:.5,right:1},k=/[yzafpnµmkMGTPEZY]/;function w(U){return U&&U.duration>0}Y.exports=function(U,V,W,F){var H=U._fullLayout,q;w(W)&&F&&(q=F()),P.makeTraceGroups(H._indicatorlayer,V,"trace").each(function(G){var tt=G[0],ht=tt.trace,bt=f.select(this),vt=ht._hasGauge,ut=ht._isAngular,rt=ht._isBullet,gt=ht.domain,it={w:H._size.w*(gt.x[1]-gt.x[0]),h:H._size.h*(gt.y[1]-gt.y[0]),l:H._size.l+H._size.w*gt.x[0],r:H._size.r+H._size.w*(1-gt.x[1]),t:H._size.t+H._size.h*(1-gt.y[1]),b:H._size.b+H._size.h*gt.y[0]},st=it.l+it.w/2,xt=it.t+it.h/2,ot=Math.min(it.w/2,it.h),J=c.innerRadius*ot,mt,dt,Ct,Rt=ht.align||"center";if(dt=xt,!vt)mt=it.l+d[Rt]*it.w,Ct=function(Ot){return C(Ot,it.w,it.h)};else if(ut&&(mt=st,dt=xt+ot/2,Ct=function(Ot){return S(Ot,.9*J)}),rt){var Bt=c.bulletPadding,Zt=1-c.bulletNumberDomainSize+Bt;mt=it.l+(Zt+(1-Zt)*d[Rt])*it.w,Ct=function(Ot){return C(Ot,(c.bulletNumberDomainSize-Bt)*it.w,it.h)}}I(U,bt,G,{numbersX:mt,numbersY:dt,numbersScaler:Ct,transitionOpts:W,onComplete:q});var Gt,ee;vt&&(Gt={range:ht.gauge.axis.range,color:ht.gauge.bgcolor,line:{color:ht.gauge.bordercolor,width:0},thickness:1},ee={range:ht.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:ht.gauge.bordercolor,width:ht.gauge.borderwidth},thickness:1});var xe=bt.selectAll("g.angular").data(ut?G:[]);xe.exit().remove();var ge=bt.selectAll("g.angularaxis").data(ut?G:[]);ge.exit().remove(),ut&&E(U,bt,G,{radius:ot,innerRadius:J,gauge:xe,layer:ge,size:it,gaugeBg:Gt,gaugeOutline:ee,transitionOpts:W,onComplete:q});var ye=bt.selectAll("g.bullet").data(rt?G:[]);ye.exit().remove();var ue=bt.selectAll("g.bulletaxis").data(rt?G:[]);ue.exit().remove(),rt&&D(U,bt,G,{gauge:ye,layer:ue,size:it,gaugeBg:Gt,gaugeOutline:ee,transitionOpts:W,onComplete:q});var Mt=bt.selectAll("text.title").data(G);Mt.exit().remove(),Mt.enter().append("text").classed("title",!0),Mt.attr("text-anchor",function(){return rt?A.right:A[ht.title.align]}).text(ht.title.text).call(o.font,ht.title.font).call(s.convertToTspans,U),Mt.attr("transform",function(){var Ot=it.l+it.w*d[ht.title.align],Lt,ie=c.titlePadding,be=o.bBox(Mt.node());if(vt){if(ut)if(ht.gauge.axis.visible){var ce=o.bBox(ge.node());Lt=ce.top-ie-be.bottom}else Lt=it.t+it.h/2-ot/2-be.bottom-ie;rt&&(Lt=dt-(be.top+be.bottom)/2,Ot=it.l-c.bulletPadding*it.w)}else Lt=ht._numbersTop-ie-be.bottom;return i(Ot,Lt)})})};function D(U,V,W,F){var H=W[0].trace,q=F.gauge,G=F.layer,tt=F.gaugeBg,ht=F.gaugeOutline,bt=F.size,vt=H.domain,ut=F.transitionOpts,rt=F.onComplete,gt,it,st,xt,ot;q.enter().append("g").classed("bullet",!0),q.attr("transform",i(bt.l,bt.t)),G.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),G.selectAll("g.xbulletaxistick,path,text").remove();var J=bt.h,mt=H.gauge.bar.thickness*J,dt=vt.x[0],Ct=vt.x[0]+(vt.x[1]-vt.x[0])*(H._hasNumber||H._hasDelta?1-c.bulletNumberDomainSize:1);gt=g(U,H.gauge.axis),gt._id="xbulletaxis",gt.domain=[dt,Ct],gt.setScale(),it=h.calcTicks(gt),st=h.makeTransTickFn(gt),xt=h.getTickSigns(gt)[2],ot=bt.t+bt.h,gt.visible&&(h.drawTicks(U,gt,{vals:gt.ticks==="inside"?h.clipEnds(gt,it):it,layer:G,path:h.makeTickPath(gt,ot,xt),transFn:st}),h.drawLabels(U,gt,{vals:it,layer:G,transFn:st,labelFns:h.makeLabelFns(gt,ot)}));function Rt(ye){ye.attr("width",function(ue){return Math.max(0,gt.c2p(ue.range[1])-gt.c2p(ue.range[0]))}).attr("x",function(ue){return gt.c2p(ue.range[0])}).attr("y",function(ue){return .5*(1-ue.thickness)*J}).attr("height",function(ue){return ue.thickness*J})}var Bt=[tt].concat(H.gauge.steps),Zt=q.selectAll("g.bg-bullet").data(Bt);Zt.enter().append("g").classed("bg-bullet",!0).append("rect"),Zt.select("rect").call(Rt).call(M),Zt.exit().remove();var Gt=q.selectAll("g.value-bullet").data([H.gauge.bar]);Gt.enter().append("g").classed("value-bullet",!0).append("rect"),Gt.select("rect").attr("height",mt).attr("y",(J-mt)/2).call(M),w(ut)?Gt.select("rect").transition().duration(ut.duration).ease(ut.easing).each("end",function(){rt&&rt()}).each("interrupt",function(){rt&&rt()}).attr("width",Math.max(0,gt.c2p(Math.min(H.gauge.axis.range[1],W[0].y)))):Gt.select("rect").attr("width",typeof W[0].y=="number"?Math.max(0,gt.c2p(Math.min(H.gauge.axis.range[1],W[0].y))):0),Gt.exit().remove();var ee=W.filter(function(){return H.gauge.threshold.value||H.gauge.threshold.value===0}),xe=q.selectAll("g.threshold-bullet").data(ee);xe.enter().append("g").classed("threshold-bullet",!0).append("line"),xe.select("line").attr("x1",gt.c2p(H.gauge.threshold.value)).attr("x2",gt.c2p(H.gauge.threshold.value)).attr("y1",(1-H.gauge.threshold.thickness)/2*J).attr("y2",(1-(1-H.gauge.threshold.thickness)/2)*J).call(_.stroke,H.gauge.threshold.line.color).style("stroke-width",H.gauge.threshold.line.width),xe.exit().remove();var ge=q.selectAll("g.gauge-outline").data([ht]);ge.enter().append("g").classed("gauge-outline",!0).append("rect"),ge.select("rect").call(Rt).call(M),ge.exit().remove()}function E(U,V,W,F){var H=W[0].trace,q=F.size,G=F.radius,tt=F.innerRadius,ht=F.gaugeBg,bt=F.gaugeOutline,vt=[q.l+q.w/2,q.t+q.h/2+G/2],ut=F.gauge,rt=F.layer,gt=F.transitionOpts,it=F.onComplete,st=Math.PI/2;function xt(Ze){var Qe=H.gauge.axis.range[0],mr=H.gauge.axis.range[1],fr=(Ze-Qe)/(mr-Qe)*Math.PI-st;return fr<-st?-st:fr>st?st:fr}function ot(Ze){return f.svg.arc().innerRadius((tt+G)/2-Ze/2*(G-tt)).outerRadius((tt+G)/2+Ze/2*(G-tt)).startAngle(-st)}function J(Ze){Ze.attr("d",function(Qe){return ot(Qe.thickness).startAngle(xt(Qe.range[0])).endAngle(xt(Qe.range[1]))()})}var mt,dt,Ct,Rt;ut.enter().append("g").classed("angular",!0),ut.attr("transform",i(vt[0],vt[1])),rt.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),rt.selectAll("g.xangularaxistick,path,text").remove(),mt=g(U,H.gauge.axis),mt.type="linear",mt.range=H.gauge.axis.range,mt._id="xangularaxis",mt.ticklabeloverflow="allow",mt.setScale();var Bt=function(Ze){return(mt.range[0]-Ze.x)/(mt.range[1]-mt.range[0])*Math.PI+Math.PI},Zt={},Gt=h.makeLabelFns(mt,0),ee=Gt.labelStandoff;Zt.xFn=function(Ze){var Qe=Bt(Ze);return Math.cos(Qe)*ee},Zt.yFn=function(Ze){var Qe=Bt(Ze),mr=Math.sin(Qe)>0?.2:1;return-Math.sin(Qe)*(ee+Ze.fontSize*mr)+Math.abs(Math.cos(Qe))*(Ze.fontSize*l)},Zt.anchorFn=function(Ze){var Qe=Bt(Ze),mr=Math.cos(Qe);return Math.abs(mr)<.1?"middle":mr>0?"start":"end"},Zt.heightFn=function(Ze,Qe,mr){var fr=Bt(Ze);return-.5*(1+Math.sin(fr))*mr};var xe=function(Ze){return i(vt[0]+G*Math.cos(Ze),vt[1]-G*Math.sin(Ze))};Ct=function(Ze){return xe(Bt(Ze))};var ge=function(Ze){var Qe=Bt(Ze);return xe(Qe)+"rotate("+-a(Qe)+")"};if(dt=h.calcTicks(mt),Rt=h.getTickSigns(mt)[2],mt.visible){Rt=mt.ticks==="inside"?-1:1;var ye=(mt.linewidth||1)/2;h.drawTicks(U,mt,{vals:dt,layer:rt,path:"M"+Rt*ye+",0h"+Rt*mt.ticklen,transFn:ge}),h.drawLabels(U,mt,{vals:dt,layer:rt,transFn:Ct,labelFns:Zt})}var ue=[ht].concat(H.gauge.steps),Mt=ut.selectAll("g.bg-arc").data(ue);Mt.enter().append("g").classed("bg-arc",!0).append("path"),Mt.select("path").call(J).call(M),Mt.exit().remove();var Ot=ot(H.gauge.bar.thickness),Lt=ut.selectAll("g.value-arc").data([H.gauge.bar]);Lt.enter().append("g").classed("value-arc",!0).append("path");var ie=Lt.select("path");w(gt)?(ie.transition().duration(gt.duration).ease(gt.easing).each("end",function(){it&&it()}).each("interrupt",function(){it&&it()}).attrTween("d",p(Ot,xt(W[0].lastY),xt(W[0].y))),H._lastValue=W[0].y):ie.attr("d",typeof W[0].y=="number"?Ot.endAngle(xt(W[0].y)):"M0,0Z"),ie.call(M),Lt.exit().remove(),ue=[];var be=H.gauge.threshold.value;(be||be===0)&&ue.push({range:[be,be],color:H.gauge.threshold.color,line:{color:H.gauge.threshold.line.color,width:H.gauge.threshold.line.width},thickness:H.gauge.threshold.thickness});var ce=ut.selectAll("g.threshold-arc").data(ue);ce.enter().append("g").classed("threshold-arc",!0).append("path"),ce.select("path").call(J).call(M),ce.exit().remove();var Le=ut.selectAll("g.gauge-outline").data([bt]);Le.enter().append("g").classed("gauge-outline",!0).append("path"),Le.select("path").call(J).call(M),Le.exit().remove()}function I(U,V,W,F){var H=W[0].trace,q=F.numbersX,G=F.numbersY,tt=H.align||"center",ht=A[tt],bt=F.transitionOpts,vt=F.onComplete,ut=P.ensureSingle(V,"g","numbers"),rt,gt,it,st=[];H._hasNumber&&st.push("number"),H._hasDelta&&(st.push("delta"),H.delta.position==="left"&&st.reverse());var xt=ut.selectAll("text").data(st);xt.enter().append("text"),xt.attr("text-anchor",function(){return ht}).attr("class",function(xe){return xe}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),xt.exit().remove();function ot(xe,ge,ye,ue){if(xe.match("s")&&ye>=0!=ue>=0&&!ge(ye).slice(-1).match(k)&&!ge(ue).slice(-1).match(k)){var Mt=xe.slice().replace("s","f").replace(/\d+/,function(Lt){return parseInt(Lt)-1}),Ot=g(U,{tickformat:Mt});return function(Lt){return Math.abs(Lt)<1?h.tickText(Ot,Lt).text:ge(Lt)}}else return ge}function J(){var xe=g(U,{tickformat:H.number.valueformat},H._range);xe.setScale(),h.prepTicks(xe);var ge=function(Lt){return h.tickText(xe,Lt).text},ye=H.number.suffix,ue=H.number.prefix,Mt=ut.select("text.number");function Ot(){var Lt=typeof W[0].y=="number"?ue+ge(W[0].y)+ye:"-";Mt.text(Lt).call(o.font,H.number.font).call(s.convertToTspans,U)}return w(bt)?Mt.transition().duration(bt.duration).ease(bt.easing).each("end",function(){Ot(),vt&&vt()}).each("interrupt",function(){Ot(),vt&&vt()}).attrTween("text",function(){var Lt=f.select(this),ie=z(W[0].lastY,W[0].y);H._lastValue=W[0].y;var be=ot(H.number.valueformat,ge,W[0].lastY,W[0].y);return function(ce){Lt.text(ue+be(ie(ce))+ye)}}):Ot(),rt=N(ue+ge(W[0].y)+ye,H.number.font,ht,U),Mt}function mt(){var xe=g(U,{tickformat:H.delta.valueformat},H._range);xe.setScale(),h.prepTicks(xe);var ge=function(ce){return h.tickText(xe,ce).text},ye=H.delta.suffix,ue=H.delta.prefix,Mt=function(ce){var Le=H.delta.relative?ce.relativeDelta:ce.delta;return Le},Ot=function(ce,Le){return ce===0||typeof ce!="number"||isNaN(ce)?"-":(ce>0?H.delta.increasing.symbol:H.delta.decreasing.symbol)+ue+Le(ce)+ye},Lt=function(ce){return ce.delta>=0?H.delta.increasing.color:H.delta.decreasing.color};H._deltaLastValue===void 0&&(H._deltaLastValue=Mt(W[0]));var ie=ut.select("text.delta");ie.call(o.font,H.delta.font).call(_.fill,Lt({delta:H._deltaLastValue}));function be(){ie.text(Ot(Mt(W[0]),ge)).call(_.fill,Lt(W[0])).call(s.convertToTspans,U)}return w(bt)?ie.transition().duration(bt.duration).ease(bt.easing).tween("text",function(){var ce=f.select(this),Le=Mt(W[0]),Ze=H._deltaLastValue,Qe=ot(H.delta.valueformat,ge,Ze,Le),mr=z(Ze,Le);return H._deltaLastValue=Le,function(fr){ce.text(Ot(mr(fr),Qe)),ce.call(_.fill,Lt({delta:mr(fr)}))}}).each("end",function(){be(),vt&&vt()}).each("interrupt",function(){be(),vt&&vt()}):be(),gt=N(Ot(Mt(W[0]),ge),H.delta.font,ht,U),ie}var dt=H.mode+H.align,Ct;if(H._hasDelta&&(Ct=mt(),dt+=H.delta.position+H.delta.font.size+H.delta.font.family+H.delta.valueformat,dt+=H.delta.increasing.symbol+H.delta.decreasing.symbol,it=gt),H._hasNumber&&(J(),dt+=H.number.font.size+H.number.font.family+H.number.valueformat+H.number.suffix+H.number.prefix,it=rt),H._hasDelta&&H._hasNumber){var Rt=[(rt.left+rt.right)/2,(rt.top+rt.bottom)/2],Bt=[(gt.left+gt.right)/2,(gt.top+gt.bottom)/2],Zt,Gt,ee=.75*H.delta.font.size;H.delta.position==="left"&&(Zt=B(H,"deltaPos",0,-1*(rt.width*d[H.align]+gt.width*(1-d[H.align])+ee),dt,Math.min),Gt=Rt[1]-Bt[1],it={width:rt.width+gt.width+ee,height:Math.max(rt.height,gt.height),left:gt.left+Zt,right:rt.right,top:Math.min(rt.top,gt.top+Gt),bottom:Math.max(rt.bottom,gt.bottom+Gt)}),H.delta.position==="right"&&(Zt=B(H,"deltaPos",0,rt.width*(1-d[H.align])+gt.width*d[H.align]+ee,dt,Math.max),Gt=Rt[1]-Bt[1],it={width:rt.width+gt.width+ee,height:Math.max(rt.height,gt.height),left:rt.left,right:gt.right+Zt,top:Math.min(rt.top,gt.top+Gt),bottom:Math.max(rt.bottom,gt.bottom+Gt)}),H.delta.position==="bottom"&&(Zt=null,Gt=gt.height,it={width:Math.max(rt.width,gt.width),height:rt.height+gt.height,left:Math.min(rt.left,gt.left),right:Math.max(rt.right,gt.right),top:rt.bottom-rt.height,bottom:rt.bottom+gt.height}),H.delta.position==="top"&&(Zt=null,Gt=rt.top,it={width:Math.max(rt.width,gt.width),height:rt.height+gt.height,left:Math.min(rt.left,gt.left),right:Math.max(rt.right,gt.right),top:rt.bottom-rt.height-gt.height,bottom:rt.bottom}),Ct.attr({dx:Zt,dy:Gt})}(H._hasNumber||H._hasDelta)&&ut.attr("transform",function(){var xe=F.numbersScaler(it);dt+=xe[2];var ge=B(H,"numbersScale",1,xe[0],dt,Math.min),ye;H._scaleNumbers||(ge=1),H._isAngular?ye=G-ge*it.bottom:ye=G-ge*(it.top+it.bottom)/2,H._numbersTop=ge*it.top+ye;var ue=it[tt];tt==="center"&&(ue=(it.left+it.right)/2);var Mt=q-ge*ue;return Mt=B(H,"numbersTranslate",0,Mt,dt,Math.max),i(Mt,ye)+n(ge)})}function M(U){U.each(function(V){_.stroke(f.select(this),V.line.color)}).each(function(V){_.fill(f.select(this),V.color)}).style("stroke-width",function(V){return V.line.width})}function p(U,V,W){return function(){var F=y(V,W);return function(H){return U.endAngle(F(H))()}}}function g(U,V,W){var F=U._fullLayout,H=P.extendFlat({type:"linear",ticks:"outside",range:W,showline:!0},V),q={type:"linear",_id:"x"+V._id},G={letter:"x",font:F.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function tt(ht,bt){return P.coerce(H,q,x,ht,bt)}return m(H,q,tt,G,F),b(H,q,tt,G),q}function C(U,V,W){var F=Math.min(V/U.width,W/U.height);return[F,U,V+"x"+W]}function S(U,V){var W=Math.sqrt(U.width/2*(U.width/2)+U.height*U.height),F=V/W;return[F,U,V]}function N(U,V,W,F){var H=document.createElementNS("http://www.w3.org/2000/svg","text"),q=f.select(H);return q.text(U).attr("x",0).attr("y",0).attr("text-anchor",W).attr("data-unformatted",U).call(s.convertToTspans,F).call(o.font,V),o.bBox(q.node())}function B(U,V,W,F,H,q){var G="_cache"+V;U[G]&&U[G].key===H||(U[G]={key:H,value:W});var tt=P.aggNums(q,null,[U[G].value,F],2);return U[G].value=tt,tt}}),het=It((et,Y)=>{Y.exports={moduleType:"trace",name:"indicator",basePlotModule:oet(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:Bz(),supplyDefaults:set().supplyDefaults,calc:cet().calc,plot:uet(),meta:{}}}),det=It((et,Y)=>{Y.exports=het()}),Fz=It((et,Y)=>{var f=Mg(),y=Yn().extendFlat,z=sh().overrideAll,P=hi(),n=Jh().attributes,i=Sh().descriptionOnlyNumbers;Y.exports=z({domain:n({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:i("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:y({},f.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:i("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:y({},f.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))}},"calc","from-root")}),fet=It((et,Y)=>{var f=jn(),y=Fz(),z=Jh().defaults;function P(n,i){for(var a=n.columnorder||[],l=n.header.values.length,o=a.slice(0,l),c=o.slice().sort(function(m,b){return m-b}),s=o.map(function(m){return c.indexOf(m)}),h=s.length;h{var f=e1().wrap;Y.exports=function(){return f({})}}),Nz=It((et,Y)=>{Y.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"
",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}),met=It((et,Y)=>{var f=Nz(),y=Yn().extendFlat,z=Sr(),P=Xn().isTypedArray,n=Xn().isArrayOrTypedArray;Y.exports=function(b,x){var _=l(x.cells.values),A=function(tt){return tt.slice(x.header.values.length,tt.length)},d=l(x.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var k=d.concat(A(_).map(function(){return o((d[0]||[""]).length)})),w=x.domain,D=Math.floor(b._fullLayout._size.w*(w.x[1]-w.x[0])),E=Math.floor(b._fullLayout._size.h*(w.y[1]-w.y[0])),I=x.header.values.length?k[0].map(function(){return x.header.height}):[f.emptyHeaderHeight],M=_.length?_[0].map(function(){return x.cells.height}):[],p=I.reduce(a,0),g=E-p,C=g+f.uplift,S=h(M,C),N=h(I,p),B=s(N,[]),U=s(S,B),V={},W=x._fullInput.columnorder;n(W)&&(W=Array.from(W)),W=W.concat(A(_.map(function(tt,ht){return ht})));var F=k.map(function(tt,ht){var bt=n(x.columnwidth)?x.columnwidth[Math.min(ht,x.columnwidth.length-1)]:x.columnwidth;return z(bt)?Number(bt):1}),H=F.reduce(a,0);F=F.map(function(tt){return tt/H*D});var q=Math.max(i(x.header.line.width),i(x.cells.line.width)),G={key:x.uid+b._context.staticPlot,translateX:w.x[0]*b._fullLayout._size.w,translateY:b._fullLayout._size.h*(1-w.y[1]),size:b._fullLayout._size,width:D,maxLineWidth:q,height:E,columnOrder:W,groupHeight:E,rowBlocks:U,headerRowBlocks:B,scrollY:0,cells:y({},x.cells,{values:_}),headerCells:y({},x.header,{values:k}),gdColumns:k.map(function(tt){return tt[0]}),gdColumnsOriginalOrder:k.map(function(tt){return tt[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:k.map(function(tt,ht){var bt=V[tt];V[tt]=(bt||0)+1;var vt=tt+"__"+V[tt];return{key:vt,label:tt,specIndex:ht,xIndex:W[ht],xScale:c,x:void 0,calcdata:void 0,columnWidth:F[ht]}})};return G.columns.forEach(function(tt){tt.calcdata=G,tt.x=c(tt)}),G};function i(b){if(n(b)){for(var x=0,_=0;_=x||I===b.length-1)&&(_[d]=w,w.key=E++,w.firstRowIndex=D,w.lastRowIndex=I,w=m(),d+=k,D=I+1,k=0);return _}function m(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),get=It(et=>{var Y=Yn().extendFlat;et.splitToPanels=function(y){var z=[0,0],P=Y({},y,{key:"header",type:"header",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!0,values:y.calcdata.headerCells.values[y.specIndex],rowBlocks:y.calcdata.headerRowBlocks,calcdata:Y({},y.calcdata,{cells:y.calcdata.headerCells})}),n=Y({},y,{key:"cells1",type:"cells",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks}),i=Y({},y,{key:"cells2",type:"cells",page:1,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks});return[n,i,P]},et.splitToCells=function(y){var z=f(y);return(y.values||[]).slice(z[0],z[1]).map(function(P,n){var i=typeof P=="string"&&P.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:n+i,key:z[0]+n,column:y,calcdata:y.calcdata,page:y.page,rowBlocks:y.rowBlocks,value:P}})};function f(y){var z=y.rowBlocks[y.page],P=z?z.rows[0].rowIndex:0,n=z?P+z.rows.length:0;return[P,n]}}),jz=It((et,Y)=>{var f=Nz(),y=Br(),z=jn(),P=z.numberFormat,n=e1(),i=Js(),a=uu(),l=jn().raiseToTop,o=jn().strTranslate,c=jn().cancelTransition,s=met(),h=get(),m=Hn();Y.exports=function(mt,dt){var Ct=!mt._context.staticPlot,Rt=mt._fullLayout._paper.selectAll("."+f.cn.table).data(dt.map(function(ce){var Le=n.unwrap(ce),Ze=Le.trace;return s(mt,Ze)}),n.keyFun);Rt.exit().remove(),Rt.enter().append("g").classed(f.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Rt.attr("width",function(ce){return ce.width+ce.size.l+ce.size.r}).attr("height",function(ce){return ce.height+ce.size.t+ce.size.b}).attr("transform",function(ce){return o(ce.translateX,ce.translateY)});var Bt=Rt.selectAll("."+f.cn.tableControlView).data(n.repeat,n.keyFun),Zt=Bt.enter().append("g").classed(f.cn.tableControlView,!0).style("box-sizing","content-box");if(Ct){var Gt="onwheel"in document?"wheel":"mousewheel";Zt.on("mousemove",function(ce){Bt.filter(function(Le){return ce===Le}).call(d,mt)}).on(Gt,function(ce){if(!ce.scrollbarState.wheeling){ce.scrollbarState.wheeling=!0;var Le=ce.scrollY+y.event.deltaY,Ze=ht(mt,Bt,null,Le)(ce);Ze||(y.event.stopPropagation(),y.event.preventDefault()),ce.scrollbarState.wheeling=!1}}).call(d,mt,!0)}Bt.attr("transform",function(ce){return o(ce.size.l,ce.size.t)});var ee=Bt.selectAll("."+f.cn.scrollBackground).data(n.repeat,n.keyFun);ee.enter().append("rect").classed(f.cn.scrollBackground,!0).attr("fill","none"),ee.attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}),Bt.each(function(ce){i.setClipUrl(y.select(this),x(mt,ce),mt)});var xe=Bt.selectAll("."+f.cn.yColumn).data(function(ce){return ce.columns},n.keyFun);xe.enter().append("g").classed(f.cn.yColumn,!0),xe.exit().remove(),xe.attr("transform",function(ce){return o(ce.x,0)}),Ct&&xe.call(y.behavior.drag().origin(function(ce){var Le=y.select(this);return W(Le,ce,-f.uplift),l(this),ce.calcdata.columnDragInProgress=!0,d(Bt.filter(function(Ze){return ce.calcdata.key===Ze.key}),mt),ce}).on("drag",function(ce){var Le=y.select(this),Ze=function(fr){return(ce===fr?y.event.x:fr.x)+fr.columnWidth/2};ce.x=Math.max(-f.overdrag,Math.min(ce.calcdata.width+f.overdrag-ce.columnWidth,y.event.x));var Qe=A(xe).filter(function(fr){return fr.calcdata.key===ce.calcdata.key}),mr=Qe.sort(function(fr,Jr){return Ze(fr)-Ze(Jr)});mr.forEach(function(fr,Jr){fr.xIndex=Jr,fr.x=ce===fr?fr.x:fr.xScale(fr)}),xe.filter(function(fr){return ce!==fr}).transition().ease(f.transitionEase).duration(f.transitionDuration).attr("transform",function(fr){return o(fr.x,0)}),Le.call(c).attr("transform",o(ce.x,-f.uplift))}).on("dragend",function(ce){var Le=y.select(this),Ze=ce.calcdata;ce.x=ce.xScale(ce),ce.calcdata.columnDragInProgress=!1,W(Le,ce,0),U(mt,Ze,Ze.columns.map(function(Qe){return Qe.xIndex}))})),xe.each(function(ce){i.setClipUrl(y.select(this),_(mt,ce),mt)});var ge=xe.selectAll("."+f.cn.columnBlock).data(h.splitToPanels,n.keyFun);ge.enter().append("g").classed(f.cn.columnBlock,!0).attr("id",function(ce){return ce.key}),ge.style("cursor",function(ce){return ce.dragHandle?"ew-resize":ce.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ye=ge.filter(H),ue=ge.filter(F);Ct&&ue.call(y.behavior.drag().origin(function(ce){return y.event.stopPropagation(),ce}).on("drag",ht(mt,Bt,-1)).on("dragend",function(){})),k(mt,Bt,ye,ge),k(mt,Bt,ue,ge);var Mt=Bt.selectAll("."+f.cn.scrollAreaClip).data(n.repeat,n.keyFun);Mt.enter().append("clipPath").classed(f.cn.scrollAreaClip,!0).attr("id",function(ce){return x(mt,ce)});var Ot=Mt.selectAll("."+f.cn.scrollAreaClipRect).data(n.repeat,n.keyFun);Ot.enter().append("rect").classed(f.cn.scrollAreaClipRect,!0).attr("x",-f.overdrag).attr("y",-f.uplift).attr("fill","none"),Ot.attr("width",function(ce){return ce.width+2*f.overdrag}).attr("height",function(ce){return ce.height+f.uplift});var Lt=xe.selectAll("."+f.cn.columnBoundary).data(n.repeat,n.keyFun);Lt.enter().append("g").classed(f.cn.columnBoundary,!0);var ie=xe.selectAll("."+f.cn.columnBoundaryClippath).data(n.repeat,n.keyFun);ie.enter().append("clipPath").classed(f.cn.columnBoundaryClippath,!0),ie.attr("id",function(ce){return _(mt,ce)});var be=ie.selectAll("."+f.cn.columnBoundaryRect).data(n.repeat,n.keyFun);be.enter().append("rect").classed(f.cn.columnBoundaryRect,!0).attr("fill","none"),be.attr("width",function(ce){return ce.columnWidth+2*b(ce)}).attr("height",function(ce){return ce.calcdata.height+2*b(ce)+f.uplift}).attr("x",function(ce){return-b(ce)}).attr("y",function(ce){return-b(ce)}),tt(null,ue,Bt)};function b(mt){return Math.ceil(mt.calcdata.maxLineWidth/2)}function x(mt,dt){return"clip"+mt._fullLayout._uid+"_scrollAreaBottomClip_"+dt.key}function _(mt,dt){return"clip"+mt._fullLayout._uid+"_columnBoundaryClippath_"+dt.calcdata.key+"_"+dt.specIndex}function A(mt){return[].concat.apply([],mt.map(function(dt){return dt})).map(function(dt){return dt.__data__})}function d(mt,dt,Ct){function Rt(ge){var ye=ge.rowBlocks;return it(ye,ye.length-1)+(ye.length?st(ye[ye.length-1],1/0):1)}var Bt=mt.selectAll("."+f.cn.scrollbarKit).data(n.repeat,n.keyFun);Bt.enter().append("g").classed(f.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Bt.each(function(ge){var ye=ge.scrollbarState;ye.totalHeight=Rt(ge),ye.scrollableAreaHeight=ge.groupHeight-q(ge),ye.currentlyVisibleHeight=Math.min(ye.totalHeight,ye.scrollableAreaHeight),ye.ratio=ye.currentlyVisibleHeight/ye.totalHeight,ye.barLength=Math.max(ye.ratio*ye.currentlyVisibleHeight,f.goldenRatio*f.scrollbarWidth),ye.barWiggleRoom=ye.currentlyVisibleHeight-ye.barLength,ye.wiggleRoom=Math.max(0,ye.totalHeight-ye.scrollableAreaHeight),ye.topY=ye.barWiggleRoom===0?0:ge.scrollY/ye.wiggleRoom*ye.barWiggleRoom,ye.bottomY=ye.topY+ye.barLength,ye.dragMultiplier=ye.wiggleRoom/ye.barWiggleRoom}).attr("transform",function(ge){var ye=ge.width+f.scrollbarWidth/2+f.scrollbarOffset;return o(ye,q(ge))});var Zt=Bt.selectAll("."+f.cn.scrollbar).data(n.repeat,n.keyFun);Zt.enter().append("g").classed(f.cn.scrollbar,!0);var Gt=Zt.selectAll("."+f.cn.scrollbarSlider).data(n.repeat,n.keyFun);Gt.enter().append("g").classed(f.cn.scrollbarSlider,!0),Gt.attr("transform",function(ge){return o(0,ge.scrollbarState.topY||0)});var ee=Gt.selectAll("."+f.cn.scrollbarGlyph).data(n.repeat,n.keyFun);ee.enter().append("line").classed(f.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",f.scrollbarWidth).attr("stroke-linecap","round").attr("y1",f.scrollbarWidth/2),ee.attr("y2",function(ge){return ge.scrollbarState.barLength-f.scrollbarWidth/2}).attr("stroke-opacity",function(ge){return ge.columnDragInProgress||!ge.scrollbarState.barWiggleRoom||Ct?0:.4}),ee.transition().delay(0).duration(0),ee.transition().delay(f.scrollbarHideDelay).duration(f.scrollbarHideDuration).attr("stroke-opacity",0);var xe=Zt.selectAll("."+f.cn.scrollbarCaptureZone).data(n.repeat,n.keyFun);xe.enter().append("line").classed(f.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",f.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(ge){var ye=y.event.y,ue=this.getBoundingClientRect(),Mt=ge.scrollbarState,Ot=ye-ue.top,Lt=y.scale.linear().domain([0,Mt.scrollableAreaHeight]).range([0,Mt.totalHeight]).clamp(!0);Mt.topY<=Ot&&Ot<=Mt.bottomY||ht(dt,mt,null,Lt(Ot-Mt.barLength/2))(ge)}).call(y.behavior.drag().origin(function(ge){return y.event.stopPropagation(),ge.scrollbarState.scrollbarScrollInProgress=!0,ge}).on("drag",ht(dt,mt)).on("dragend",function(){})),xe.attr("y2",function(ge){return ge.scrollbarState.scrollableAreaHeight}),dt._context.staticPlot&&(ee.remove(),xe.remove())}function k(mt,dt,Ct,Rt){var Bt=w(Ct),Zt=D(Bt);p(Zt);var Gt=E(Zt);C(Gt);var ee=M(Zt),xe=I(ee);g(xe),S(xe,dt,Rt,mt),gt(Zt)}function w(mt){var dt=mt.selectAll("."+f.cn.columnCells).data(n.repeat,n.keyFun);return dt.enter().append("g").classed(f.cn.columnCells,!0),dt.exit().remove(),dt}function D(mt){var dt=mt.selectAll("."+f.cn.columnCell).data(h.splitToCells,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("g").classed(f.cn.columnCell,!0),dt.exit().remove(),dt}function E(mt){var dt=mt.selectAll("."+f.cn.cellRect).data(n.repeat,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("rect").classed(f.cn.cellRect,!0),dt}function I(mt){var dt=mt.selectAll("."+f.cn.cellText).data(n.repeat,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("text").classed(f.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){y.event.stopPropagation()}),dt}function M(mt){var dt=mt.selectAll("."+f.cn.cellTextHolder).data(n.repeat,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("g").classed(f.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),dt}function p(mt){mt.each(function(dt,Ct){var Rt=dt.calcdata.cells.font,Bt=dt.column.specIndex,Zt={size:V(Rt.size,Bt,Ct),color:V(Rt.color,Bt,Ct),family:V(Rt.family,Bt,Ct),weight:V(Rt.weight,Bt,Ct),style:V(Rt.style,Bt,Ct),variant:V(Rt.variant,Bt,Ct),textcase:V(Rt.textcase,Bt,Ct),lineposition:V(Rt.lineposition,Bt,Ct),shadow:V(Rt.shadow,Bt,Ct)};dt.rowNumber=dt.key,dt.align=V(dt.calcdata.cells.align,Bt,Ct),dt.cellBorderWidth=V(dt.calcdata.cells.line.width,Bt,Ct),dt.font=Zt})}function g(mt){mt.each(function(dt){i.font(y.select(this),dt.font)})}function C(mt){mt.attr("width",function(dt){return dt.column.columnWidth}).attr("stroke-width",function(dt){return dt.cellBorderWidth}).each(function(dt){var Ct=y.select(this);m.stroke(Ct,V(dt.calcdata.cells.line.color,dt.column.specIndex,dt.rowNumber)),m.fill(Ct,V(dt.calcdata.cells.fill.color,dt.column.specIndex,dt.rowNumber))})}function S(mt,dt,Ct,Rt){mt.text(function(Bt){var Zt=Bt.column.specIndex,Gt=Bt.rowNumber,ee=Bt.value,xe=typeof ee=="string",ge=xe&&ee.match(/
/i),ye=!xe||ge;Bt.mayHaveMarkup=xe&&ee.match(/[<&>]/);var ue=N(ee);Bt.latex=ue;var Mt=ue?"":V(Bt.calcdata.cells.prefix,Zt,Gt)||"",Ot=ue?"":V(Bt.calcdata.cells.suffix,Zt,Gt)||"",Lt=ue?null:V(Bt.calcdata.cells.format,Zt,Gt)||null,ie=Mt+(Lt?P(Lt)(Bt.value):Bt.value)+Ot,be;Bt.wrappingNeeded=!Bt.wrapped&&!ye&&!ue&&(be=B(ie)),Bt.cellHeightMayIncrease=ge||ue||Bt.mayHaveMarkup||(be===void 0?B(ie):be),Bt.needsConvertToTspans=Bt.mayHaveMarkup||Bt.wrappingNeeded||Bt.latex;var ce;if(Bt.wrappingNeeded){var Le=f.wrapSplitCharacter===" "?ie.replace(/Bt&&Rt.push(Zt),Bt+=xe}return Rt}function tt(mt,dt,Ct){var Rt=A(dt)[0];if(Rt!==void 0){var Bt=Rt.rowBlocks,Zt=Rt.calcdata,Gt=it(Bt,Bt.length),ee=Rt.calcdata.groupHeight-q(Rt),xe=Zt.scrollY=Math.max(0,Math.min(Gt-ee,Zt.scrollY)),ge=G(Bt,xe,ee);ge.length===1&&(ge[0]===Bt.length-1?ge.unshift(ge[0]-1):ge.push(ge[0]+1)),ge[0]%2&&ge.reverse(),dt.each(function(ye,ue){ye.page=ge[ue],ye.scrollY=xe}),dt.attr("transform",function(ye){var ue=it(ye.rowBlocks,ye.page)-ye.scrollY;return o(0,ue)}),mt&&(bt(mt,Ct,dt,ge,Rt.prevPages,Rt,0),bt(mt,Ct,dt,ge,Rt.prevPages,Rt,1),d(Ct,mt))}}function ht(mt,dt,Ct,Rt){return function(Bt){var Zt=Bt.calcdata?Bt.calcdata:Bt,Gt=dt.filter(function(ye){return Zt.key===ye.key}),ee=Ct||Zt.scrollbarState.dragMultiplier,xe=Zt.scrollY;Zt.scrollY=Rt===void 0?Zt.scrollY+ee*y.event.dy:Rt;var ge=Gt.selectAll("."+f.cn.yColumn).selectAll("."+f.cn.columnBlock).filter(F);return tt(mt,ge,Gt),Zt.scrollY===xe}}function bt(mt,dt,Ct,Rt,Bt,Zt,Gt){var ee=Rt[Gt]!==Bt[Gt];ee&&(clearTimeout(Zt.currentRepaint[Gt]),Zt.currentRepaint[Gt]=setTimeout(function(){var xe=Ct.filter(function(ge,ye){return ye===Gt&&Rt[ye]!==Bt[ye]});k(mt,dt,xe,Ct),Bt[Gt]=Rt[Gt]}))}function vt(mt,dt,Ct,Rt){return function(){var Bt=y.select(dt.parentNode);Bt.each(function(Zt){var Gt=Zt.fragments;Bt.selectAll("tspan.line").each(function(Lt,ie){Gt[ie].width=this.getComputedTextLength()});var ee=Gt[Gt.length-1].width,xe=Gt.slice(0,-1),ge=[],ye,ue,Mt=0,Ot=Zt.column.columnWidth-2*f.cellPad;for(Zt.value="";xe.length;)ye=xe.shift(),ue=ye.width+ee,Mt+ue>Ot&&(Zt.value+=ge.join(f.wrapSpacer)+f.lineBreaker,ge=[],Mt=0),ge.push(ye.text),Mt+=ue;Mt&&(Zt.value+=ge.join(f.wrapSpacer)),Zt.wrapped=!0}),Bt.selectAll("tspan.line").remove(),S(Bt.select("."+f.cn.cellText),Ct,mt,Rt),y.select(dt.parentNode.parentNode).call(gt)}}function ut(mt,dt,Ct,Rt,Bt){return function(){if(!Bt.settledY){var Zt=y.select(dt.parentNode),Gt=ot(Bt),ee=Bt.key-Gt.firstRowIndex,xe=Gt.rows[ee].rowHeight,ge=Bt.cellHeightMayIncrease?dt.parentNode.getBoundingClientRect().height+2*f.cellPad:xe,ye=Math.max(ge,xe),ue=ye-Gt.rows[ee].rowHeight;ue&&(Gt.rows[ee].rowHeight=ye,mt.selectAll("."+f.cn.columnCell).call(gt),tt(null,mt.filter(F),0),d(Ct,Rt,!0)),Zt.attr("transform",function(){var Mt=this,Ot=Mt.parentNode,Lt=Ot.getBoundingClientRect(),ie=y.select(Mt.parentNode).select("."+f.cn.cellRect).node().getBoundingClientRect(),be=Mt.transform.baseVal.consolidate(),ce=ie.top-Lt.top+(be?be.matrix.f:f.cellPad);return o(rt(Bt,y.select(Mt.parentNode).select("."+f.cn.cellTextHolder).node().getBoundingClientRect().width),ce)}),Bt.settledY=!0}}}function rt(mt,dt){switch(mt.align){case"left":return f.cellPad;case"right":return mt.column.columnWidth-(dt||0)-f.cellPad;case"center":return(mt.column.columnWidth-(dt||0))/2;default:return f.cellPad}}function gt(mt){mt.attr("transform",function(dt){var Ct=dt.rowBlocks[0].auxiliaryBlocks.reduce(function(Gt,ee){return Gt+st(ee,1/0)},0),Rt=ot(dt),Bt=st(Rt,dt.key),Zt=Bt+Ct;return o(0,Zt)}).selectAll("."+f.cn.cellRect).attr("height",function(dt){return J(ot(dt),dt.key).rowHeight})}function it(mt,dt){for(var Ct=0,Rt=dt-1;Rt>=0;Rt--)Ct+=xt(mt[Rt]);return Ct}function st(mt,dt){for(var Ct=0,Rt=0;Rt{var Y=Mf().getModuleCalcData,f=jz(),y="table";et.name=y,et.plot=function(z){var P=Y(z.calcdata,y)[0];P.length&&f(z,P)},et.clean=function(z,P,n,i){var a=i._has&&i._has(y),l=P._has&&P._has(y);a&&!l&&i._paperdiv.selectAll(".table").remove()}}),yet=It((et,Y)=>{Y.exports={attributes:Fz(),supplyDefaults:fet(),calc:pet(),plot:jz(),moduleType:"trace",name:"table",basePlotModule:vet(),categories:["noOpacity"],meta:{}}}),_et=It((et,Y)=>{Y.exports=yet()}),xet=It((et,Y)=>{var f=hi(),y=Sn(),z=Gf(),P=Sh().descriptionWithDates,n=sh().overrideAll,i=qf().dash,a=Yn().extendFlat;Y.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:f({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:z.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:a({},z.labelalias,{editType:"calc"}),tickfont:f({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:P("tick label")},tickformatstops:n(z.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:a({},i,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:a({},i,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:y.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),SA=It((et,Y)=>{var f=hi(),y=xet(),z=Sn(),P=f({editType:"calc"}),n=dd().zorder;P.family.dflt='"Open Sans", verdana, arial, sans-serif',P.size.dflt=12,P.color.dflt=z.defaultLine,Y.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:y,baxis:y,font:P,color:{valType:"color",dflt:z.defaultLine,editType:"plot"},zorder:n}}),bet=It((et,Y)=>{var f=jn().isArray1D;Y.exports=function(y,z,P){var n=P("x"),i=n&&n.length,a=P("y"),l=a&&a.length;if(!i&&!l)return!1;if(z._cheater=!n,(!i||f(n))&&(!l||f(a))){var o=i?n.length:1/0;l&&(o=Math.min(o,a.length)),z.a&&z.a.length&&(o=Math.min(o,z.a.length)),z.b&&z.b.length&&(o=Math.min(o,z.b.length)),z._length=o}else z._length=null;return!0}}),wet=It((et,Y)=>{var f=SA(),y=Hn().addOpacity,z=ls(),P=jn(),n=jv(),i=q0(),a=Sg(),l=Jg(),o=G0(),c=ty();Y.exports=function(h,m,b){var x=b.letter,_=b.font||{},A=f[x+"axis"];function d(q,G){return P.coerce(h,m,A,q,G)}function k(q,G){return P.coerce2(h,m,A,q,G)}b.name&&(m._name=b.name,m._id=b.name),d("autotypenumbers",b.autotypenumbersDflt);var w=d("type");if(w==="-"&&(b.data&&s(m,b.data),m.type==="-"?m.type="linear":w=h.type=m.type),d("smoothing"),d("cheatertype"),d("showticklabels"),d("labelprefix",x+" = "),d("labelsuffix"),d("showtickprefix"),d("showticksuffix"),d("separatethousands"),d("tickformat"),d("exponentformat"),d("minexponent"),d("showexponent"),d("categoryorder"),d("tickmode"),d("tickvals"),d("ticktext"),d("tick0"),d("dtick"),m.tickmode==="array"&&(d("arraytick0"),d("arraydtick")),d("labelpadding"),m._hovertitle=x,w==="date"){var D=z.getComponentMethod("calendars","handleDefaults");D(h,m,"calendar",b.calendar)}o(m,b.fullLayout),m.c2p=P.identity;var E=d("color",b.dfltColor),I=E===h.color?E:_.color,M=d("title.text");M&&(P.coerceFont(d,"title.font",_,{overrideDflt:{size:P.bigFont(_.size),color:I}}),d("title.offset")),d("tickangle");var p=d("autorange",!m.isValidRange(h.range));p&&d("rangemode"),d("range"),m.cleanRange(),d("fixedrange"),n(h,m,d,w),a(h,m,d,w,b),i(h,m,d,w,b),l(h,m,d,{data:b.data,dataAttr:x});var g=k("gridcolor",y(E,.3)),C=k("gridwidth"),S=k("griddash"),N=d("showgrid");N||(delete m.gridcolor,delete m.gridwidth,delete m.griddash);var B=k("startlinecolor",E),U=k("startlinewidth",C),V=d("startline",m.showgrid||!!B||!!U);V||(delete m.startlinecolor,delete m.startlinewidth);var W=k("endlinecolor",E),F=k("endlinewidth",C),H=d("endline",m.showgrid||!!W||!!F);return H||(delete m.endlinecolor,delete m.endlinewidth),N?(d("minorgridcount"),d("minorgridwidth",C),d("minorgriddash",S),d("minorgridcolor",y(g,.06)),m.minorgridcount||(delete m.minorgridwidth,delete m.minorgriddash,delete m.minorgridcolor)):(delete m.gridcolor,delete m.gridwidth,delete m.griddash),m.showticklabels==="none"&&(delete m.tickfont,delete m.tickangle,delete m.showexponent,delete m.exponentformat,delete m.minexponent,delete m.tickformat,delete m.showticksuffix,delete m.showtickprefix),m.showticksuffix||delete m.ticksuffix,m.showtickprefix||delete m.tickprefix,d("tickmode"),m};function s(h,m){if(h.type==="-"){var b=h._id,x=b.charAt(0),_=x+"calendar",A=h[_];h.type=c(m,A,{autotypenumbers:h.autotypenumbers})}}}),ket=It((et,Y)=>{var f=wet(),y=Tc();Y.exports=function(P,n,i,a,l){var o=a("a");o||(a("da"),a("a0"));var c=a("b");c||(a("db"),a("b0")),z(P,n,i,l)};function z(P,n,i,a){var l=["aaxis","baxis"];l.forEach(function(o){var c=o.charAt(0),s=P[o]||{},h=y.newContainer(n,o),m={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:c+"axis",letter:c,font:n.font,name:o,data:P[c],calendar:n.calendar,dfltColor:a,bgColor:i.paper_bgcolor,autotypenumbersDflt:i.autotypenumbers,fullLayout:i};f(s,h,m),h._categories=h._categories||[],!P[o]&&s.type!=="-"&&(P[o]={type:s.type})})}}),Tet=It((et,Y)=>{var f=jn(),y=bet(),z=ket(),P=SA(),n=Sn();Y.exports=function(i,a,l,o){function c(m,b){return f.coerce(i,a,P,m,b)}a._clipPathId="clip"+a.uid+"carpet";var s=c("color",n.defaultLine);if(f.coerceFont(c,"font",o.font),c("carpet"),z(i,a,o,c,s),!a.a||!a.b){a.visible=!1;return}a.a.length<3&&(a.aaxis.smoothing=0),a.b.length<3&&(a.baxis.smoothing=0);var h=y(i,a,c);h||(a.visible=!1),a._cheater&&c("cheaterslope"),c("zorder")}}),Uz=It((et,Y)=>{var f=jn().isArrayOrTypedArray;Y.exports=function(y,z,P){var n;for(f(y)?y.length>z.length&&(y=y.slice(0,z.length)):y=[],n=0;n{Y.exports=function(f,y,z){if(f.length===0)return"";var P,n=[],i=z?3:1;for(P=0;P{Y.exports=function(f,y,z,P,n,i){var a=n[0]*f.dpdx(y),l=n[1]*f.dpdy(z),o=1,c=1;if(i){var s=Math.sqrt(n[0]*n[0]+n[1]*n[1]),h=Math.sqrt(i[0]*i[0]+i[1]*i[1]),m=(n[0]*i[0]+n[1]*i[1])/s/h;c=Math.max(0,m)}var b=Math.atan2(l,a)*180/Math.PI;return b<-90?(b+=180,o=-o):b>90&&(b-=180,o=-o),{angle:b,flip:o,p:f.c2p(P,y,z),offsetMultplier:c}}}),Aet=It((et,Y)=>{var f=Br(),y=Js(),z=Uz(),P=$z(),n=Cet(),i=uu(),a=jn(),l=a.strRotate,o=a.strTranslate,c=Rd();Y.exports=function(d,k,w,D){var E=d._context.staticPlot,I=k.xaxis,M=k.yaxis,p=d._fullLayout,g=p._clips;a.makeTraceGroups(D,w,"trace").each(function(C){var S=f.select(this),N=C[0],B=N.trace,U=B.aaxis,V=B.baxis,W=a.ensureSingle(S,"g","minorlayer"),F=a.ensureSingle(S,"g","majorlayer"),H=a.ensureSingle(S,"g","boundarylayer"),q=a.ensureSingle(S,"g","labellayer");S.style("opacity",B.opacity),h(I,M,F,U,"a",U._gridlines,!0),h(I,M,F,V,"b",V._gridlines,!0),h(I,M,W,U,"a",U._minorgridlines,!0),h(I,M,W,V,"b",V._minorgridlines,!0),h(I,M,H,U,"a-boundary",U._boundarylines,E),h(I,M,H,V,"b-boundary",V._boundarylines,E);var G=m(d,I,M,B,N,q,U._labels,"a-label"),tt=m(d,I,M,B,N,q,V._labels,"b-label");b(d,q,B,N,I,M,G,tt),s(B,N,g,I,M)})};function s(d,k,w,D,E){var I,M,p,g,C=w.select("#"+d._clipPathId);C.size()||(C=w.append("clipPath").classed("carpetclip",!0));var S=a.ensureSingle(C,"path","carpetboundary"),N=k.clipsegments,B=[];for(g=0;g0?"start":"end","data-notex":1}).call(y.font,N.font).text(N.text).call(i.convertToTspans,d),H=y.bBox(this);F.attr("transform",o(U.p[0],U.p[1])+l(U.angle)+o(N.axis.labelpadding*W,H.height*.3)),C=Math.max(C,H.width+N.axis.labelpadding)}),g.exit().remove(),S.maxExtent=C,S}function b(d,k,w,D,E,I,M,p){var g,C,S,N,B=a.aggNums(Math.min,null,w.a),U=a.aggNums(Math.max,null,w.a),V=a.aggNums(Math.min,null,w.b),W=a.aggNums(Math.max,null,w.b);g=.5*(B+U),C=V,S=w.ab2xy(g,C,!0),N=w.dxyda_rough(g,C),M.angle===void 0&&a.extendFlat(M,n(w,E,I,S,w.dxydb_rough(g,C))),A(d,k,w,D,S,N,w.aaxis,E,I,M,"a-title"),g=B,C=.5*(V+W),S=w.ab2xy(g,C,!0),N=w.dxydb_rough(g,C),p.angle===void 0&&a.extendFlat(p,n(w,E,I,S,w.dxyda_rough(g,C))),A(d,k,w,D,S,N,w.baxis,E,I,p,"b-title")}var x=c.LINE_SPACING,_=(1-c.MID_SHIFT)/x+1;function A(d,k,w,D,E,I,M,p,g,C,S){var N=[];M.title.text&&N.push(M.title.text);var B=k.selectAll("text."+S).data(N),U=C.maxExtent;B.enter().append("text").classed(S,!0),B.each(function(){var V=n(w,p,g,E,I);["start","both"].indexOf(M.showticklabels)===-1&&(U=0);var W=M.title.font.size;U+=W+M.title.offset;var F=C.angle+(C.flip<0?180:0),H=(F-V.angle+450)%360,q=H>90&&H<270,G=f.select(this);G.text(M.title.text).call(i.convertToTspans,d),q&&(U=(-i.lineCount(G)+_)*x*W-U),G.attr("transform",o(V.p[0],V.p[1])+l(V.angle)+o(0,U)).attr("text-anchor","middle").call(y.font,M.title.font)}),B.exit().remove()}}),Met=It((et,Y)=>{var f=jn().isArrayOrTypedArray;Y.exports=function(y,z,P){var n,i,a,l,o,c,s=[],h=f(y)?y.length:y,m=f(z)?z.length:z,b=f(y)?y:null,x=f(z)?z:null;b&&(a=(b.length-1)/(b[b.length-1]-b[0])/(h-1)),x&&(l=(x.length-1)/(x[x.length-1]-x[0])/(m-1));var _,A=1/0,d=-1/0;for(i=0;i{var f=jn().isArrayOrTypedArray;Y.exports=function(z){return y(z,0)};function y(z,P){if(!f(z)||P>=10)return null;for(var n=1/0,i=-1/0,a=z.length,l=0;l{var f=Fs(),y=Yn().extendFlat;Y.exports=function(z,P,n){var i,a,l,o,c,s,h,m,b,x,_,A,d,k,w=z["_"+P],D=z[P+"axis"],E=D._gridlines=[],I=D._minorgridlines=[],M=D._boundarylines=[],p=z["_"+n],g=z[n+"axis"];D.tickmode==="array"&&(D.tickvals=w.slice());var C=z._xctrl,S=z._yctrl,N=C[0].length,B=C.length,U=z._a.length,V=z._b.length;f.prepTicks(D),D.tickmode==="array"&&delete D.tickvals;var W=D.smoothing?3:1;function F(q){var G,tt,ht,bt,vt,ut,rt,gt,it,st,xt,ot,J=[],mt=[],dt={};if(P==="b")for(tt=z.b2j(q),ht=Math.floor(Math.max(0,Math.min(V-2,tt))),bt=tt-ht,dt.length=V,dt.crossLength=U,dt.xy=function(Ct){return z.evalxy([],Ct,tt)},dt.dxy=function(Ct,Rt){return z.dxydi([],Ct,ht,Rt,bt)},G=0;G0&&(it=z.dxydi([],G-1,ht,0,bt),J.push(vt[0]+it[0]/3),mt.push(vt[1]+it[1]/3),st=z.dxydi([],G-1,ht,1,bt),J.push(gt[0]-st[0]/3),mt.push(gt[1]-st[1]/3)),J.push(gt[0]),mt.push(gt[1]),vt=gt;else for(G=z.a2i(q),ut=Math.floor(Math.max(0,Math.min(U-2,G))),rt=G-ut,dt.length=U,dt.crossLength=V,dt.xy=function(Ct){return z.evalxy([],G,Ct)},dt.dxy=function(Ct,Rt){return z.dxydj([],ut,Ct,rt,Rt)},tt=0;tt0&&(xt=z.dxydj([],ut,tt-1,rt,0),J.push(vt[0]+xt[0]/3),mt.push(vt[1]+xt[1]/3),ot=z.dxydj([],ut,tt-1,rt,1),J.push(gt[0]-ot[0]/3),mt.push(gt[1]-ot[1]/3)),J.push(gt[0]),mt.push(gt[1]),vt=gt;return dt.axisLetter=P,dt.axis=D,dt.crossAxis=g,dt.value=q,dt.constvar=n,dt.index=m,dt.x=J,dt.y=mt,dt.smoothing=g.smoothing,dt}function H(q){var G,tt,ht,bt,vt,ut=[],rt=[],gt={};if(gt.length=w.length,gt.crossLength=p.length,P==="b")for(ht=Math.max(0,Math.min(V-2,q)),vt=Math.min(1,Math.max(0,q-ht)),gt.xy=function(it){return z.evalxy([],it,q)},gt.dxy=function(it,st){return z.dxydi([],it,ht,st,vt)},G=0;Gw.length-1)&&E.push(y(H(a),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s;mw.length-1)&&!(_<0||_>w.length-1))for(A=w[l],d=w[_],i=0;iw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash})));D.startline&&M.push(y(H(0),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y(H(w.length-1),{color:D.endlinecolor,width:D.endlinewidth}))}else{for(o=5e-15,c=[Math.floor((w[w.length-1]-D.tick0)/D.dtick*(1+o)),Math.ceil((w[0]-D.tick0)/D.dtick/(1+o))].sort(function(q,G){return q-G}),s=c[0],h=c[1],m=s;m<=h;m++)b=D.tick0+D.dtick*m,E.push(y(F(b),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s-1;mw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash}));D.startline&&M.push(y(F(w[0]),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y(F(w[w.length-1]),{color:D.endlinecolor,width:D.endlinewidth}))}}}),Pet=It((et,Y)=>{var f=Fs(),y=Yn().extendFlat;Y.exports=function(z,P){var n,i,a,l,o,c=P._labels=[],s=P._gridlines;for(n=0;n{Y.exports=function(f,y,z,P){var n,i,a,l=[],o=!!z.smoothing,c=!!P.smoothing,s=f[0].length-1,h=f.length-1;for(n=0,i=[],a=[];n<=s;n++)i[n]=f[0][n],a[n]=y[0][n];for(l.push({x:i,y:a,bicubic:o}),n=0,i=[],a=[];n<=h;n++)i[n]=f[n][s],a[n]=y[n][s];for(l.push({x:i,y:a,bicubic:c}),n=s,i=[],a=[];n>=0;n--)i[s-n]=f[h][n],a[s-n]=y[h][n];for(l.push({x:i,y:a,bicubic:o}),n=h,i=[],a=[];n>=0;n--)i[h-n]=f[n][0],a[h-n]=y[n][0];return l.push({x:i,y:a,bicubic:c}),l}}),Det=It((et,Y)=>{var f=jn();Y.exports=function(y,z,P){var n,i,a,l=[],o=[],c=y[0].length,s=y.length;function h(tt,ht){var bt=0,vt,ut=0;return tt>0&&(vt=y[ht][tt-1])!==void 0&&(ut++,bt+=vt),tt0&&(vt=y[ht-1][tt])!==void 0&&(ut++,bt+=vt),ht0&&i0&&np);return f.log("Smoother converged to",g,"after",S,"iterations"),y}}),zet=It((et,Y)=>{Y.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),Oet=It((et,Y)=>{var f=.5;Y.exports=function(y,z,P,n){var i=y[0]-z[0],a=y[1]-z[1],l=P[0]-z[0],o=P[1]-z[1],c=Math.pow(i*i+a*a,f/2),s=Math.pow(l*l+o*o,f/2),h=(s*s*i-c*c*l)*n,m=(s*s*a-c*c*o)*n,b=s*(c+s)*3,x=c*(c+s)*3;return[[z[0]+(b&&h/b),z[1]+(b&&m/b)],[z[0]-(x&&h/x),z[1]-(x&&m/x)]]}}),Bet=It((et,Y)=>{var f=Oet(),y=jn().ensureArray;function z(P,n,i){var a=-.5*i[0]+1.5*n[0],l=-.5*i[1]+1.5*n[1];return[(2*a+P[0])/3,(2*l+P[1])/3]}Y.exports=function(P,n,i,a,l,o){var c,s,h,m,b,x,_,A,d,k,w=i[0].length,D=i.length,E=l?3*w-2:w,I=o?3*D-2:D;for(P=y(P,I),n=y(n,I),h=0;h{Y.exports=function(f,y,z,P,n){var i=y-2,a=z-2;return P&&n?function(l,o,c){l||(l=[]);var s,h,m,b,x,_,A=Math.max(0,Math.min(Math.floor(o),i)),d=Math.max(0,Math.min(Math.floor(c),a)),k=Math.max(0,Math.min(1,o-A)),w=Math.max(0,Math.min(1,c-d));A*=3,d*=3;var D=k*k,E=D*k,I=1-k,M=I*I,p=M*I,g=w*w,C=g*w,S=1-w,N=S*S,B=N*S;for(_=0;_{Y.exports=function(f,y,z){return y&&z?function(P,n,i,a,l){P||(P=[]);var o,c,s,h,m,b;n*=3,i*=3;var x=a*a,_=1-a,A=_*_,d=_*a*2,k=-3*A,w=3*(A-d),D=3*(d-x),E=3*x,I=l*l,M=I*l,p=1-l,g=p*p,C=g*p;for(b=0;b{Y.exports=function(f,y,z){return y&&z?function(P,n,i,a,l){P||(P=[]);var o,c,s,h,m,b;n*=3,i*=3;var x=a*a,_=x*a,A=1-a,d=A*A,k=d*A,w=l*l,D=1-l,E=D*D,I=D*l*2,M=-3*E,p=3*(E-I),g=3*(I-w),C=3*w;for(b=0;b{var f=zet(),y=sw().findBin,z=Bet(),P=Ret(),n=Fet(),i=Net();Y.exports=function(a){var l=a._a,o=a._b,c=l.length,s=o.length,h=a.aaxis,m=a.baxis,b=l[0],x=l[c-1],_=o[0],A=o[s-1],d=l[l.length-1]-l[0],k=o[o.length-1]-o[0],w=d*f.RELATIVE_CULL_TOLERANCE,D=k*f.RELATIVE_CULL_TOLERANCE;b-=w,x+=w,_-=D,A+=D,a.isVisible=function(E,I){return E>b&&E_&&Ix||I<_||I>A},a.setScale=function(){var E=a._x,I=a._y,M=z(a._xctrl,a._yctrl,E,I,h.smoothing,m.smoothing);a._xctrl=M[0],a._yctrl=M[1],a.evalxy=P([a._xctrl,a._yctrl],c,s,h.smoothing,m.smoothing),a.dxydi=n([a._xctrl,a._yctrl],h.smoothing,m.smoothing),a.dxydj=i([a._xctrl,a._yctrl],h.smoothing,m.smoothing)},a.i2a=function(E){var I=Math.max(0,Math.floor(E[0]),c-2),M=E[0]-I;return(1-M)*l[I]+M*l[I+1]},a.j2b=function(E){var I=Math.max(0,Math.floor(E[1]),c-2),M=E[1]-I;return(1-M)*o[I]+M*o[I+1]},a.ij2ab=function(E){return[a.i2a(E[0]),a.j2b(E[1])]},a.a2i=function(E){var I=Math.max(0,Math.min(y(E,l),c-2)),M=l[I],p=l[I+1];return Math.max(0,Math.min(c-1,I+(E-M)/(p-M)))},a.b2j=function(E){var I=Math.max(0,Math.min(y(E,o),s-2)),M=o[I],p=o[I+1];return Math.max(0,Math.min(s-1,I+(E-M)/(p-M)))},a.ab2ij=function(E){return[a.a2i(E[0]),a.b2j(E[1])]},a.i2c=function(E,I){return a.evalxy([],E,I)},a.ab2xy=function(E,I,M){if(!M&&(El[c-1]|Io[s-1]))return[!1,!1];var p=a.a2i(E),g=a.b2j(I),C=a.evalxy([],p,g);if(M){var S=0,N=0,B=[],U,V,W,F;El[c-1]?(U=c-2,V=1,S=(E-l[c-1])/(l[c-1]-l[c-2])):(U=Math.max(0,Math.min(c-2,Math.floor(p))),V=p-U),Io[s-1]?(W=s-2,F=1,N=(I-o[s-1])/(o[s-1]-o[s-2])):(W=Math.max(0,Math.min(s-2,Math.floor(g))),F=g-W),S&&(a.dxydi(B,U,W,V,F),C[0]+=B[0]*S,C[1]+=B[1]*S),N&&(a.dxydj(B,U,W,V,F),C[0]+=B[0]*N,C[1]+=B[1]*N)}return C},a.c2p=function(E,I,M){return[I.c2p(E[0]),M.c2p(E[1])]},a.p2x=function(E,I,M){return[I.p2c(E[0]),M.p2c(E[1])]},a.dadi=function(E){var I=Math.max(0,Math.min(l.length-2,E));return l[I+1]-l[I]},a.dbdj=function(E){var I=Math.max(0,Math.min(o.length-2,E));return o[I+1]-o[I]},a.dxyda=function(E,I,M,p){var g=a.dxydi(null,E,I,M,p),C=a.dadi(E,M);return[g[0]/C,g[1]/C]},a.dxydb=function(E,I,M,p){var g=a.dxydj(null,E,I,M,p),C=a.dbdj(I,p);return[g[0]/C,g[1]/C]},a.dxyda_rough=function(E,I,M){var p=d*(M||.1),g=a.ab2xy(E+p,I,!0),C=a.ab2xy(E-p,I,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dxydb_rough=function(E,I,M){var p=k*(M||.1),g=a.ab2xy(E,I+p,!0),C=a.ab2xy(E,I-p,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dpdx=function(E){return E._m},a.dpdy=function(E){return E._m}}}),Uet=It((et,Y)=>{var f=Fs(),y=jn().isArray1D,z=Met(),P=Eet(),n=Let(),i=Pet(),a=Iet(),l=H8(),o=Det(),c=$8(),s=jet();Y.exports=function(h,m){var b=f.getFromId(h,m.xaxis),x=f.getFromId(h,m.yaxis),_=m.aaxis,A=m.baxis,d=m.x,k=m.y,w=[];d&&y(d)&&w.push("x"),k&&y(k)&&w.push("y"),w.length&&c(m,_,A,"a","b",w);var D=m._a=m._a||m.a,E=m._b=m._b||m.b;d=m._x||m.x,k=m._y||m.y;var I={};if(m._cheater){var M=_.cheatertype==="index"?D.length:D,p=A.cheatertype==="index"?E.length:E;d=z(M,p,m.cheaterslope)}m._x=d=l(d),m._y=k=l(k),o(d,D,E),o(k,D,E),s(m),m.setScale();var g=P(d),C=P(k),S=.5*(g[1]-g[0]),N=.5*(g[1]+g[0]),B=.5*(C[1]-C[0]),U=.5*(C[1]+C[0]),V=1.3;return g=[N-S*V,N+S*V],C=[U-B*V,U+B*V],m._extremes[b._id]=f.findExtremes(b,g,{padded:!0}),m._extremes[x._id]=f.findExtremes(x,C,{padded:!0}),n(m,"a","b"),n(m,"b","a"),i(m,_),i(m,A),I.clipsegments=a(m._xctrl,m._yctrl,_,A),I.x=d,I.y=k,I.a=D,I.b=E,[I]}}),$et=It((et,Y)=>{Y.exports={attributes:SA(),supplyDefaults:Tet(),plot:Aet(),calc:Uet(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Fd(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),Het=It((et,Y)=>{Y.exports=$et()}),Hz=It((et,Y)=>{var f=Em(),y=dd(),z=xa(),{hovertemplateAttrs:P,texttemplateAttrs:n,templatefallbackAttrs:i}=nu(),a=Ru(),l=Yn().extendFlat,o=y.marker,c=y.line,s=o.line;Y.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},y.mode,{dflt:"markers"}),text:l({},y.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:i({editType:"plot"}),hovertext:l({},y.hovertext,{}),line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:y.connectgaps,fill:l({},y.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:f(),marker:l({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:l({width:s.width,editType:"calc"},a("marker.line")),gradient:o.gradient,editType:"calc"},a("marker")),textfont:y.textfont,textposition:y.textposition,selected:y.selected,unselected:y.unselected,hoverinfo:l({},z.hoverinfo,{flags:["a","b","text","name"]}),hoveron:y.hoveron,hovertemplate:P(),hovertemplatefallback:i(),zorder:y.zorder}}),Vet=It((et,Y)=>{var f=jn(),y=Eg(),z=Fu(),P=Y0(),n=Lm(),i=oy(),a=pm(),l=Pm(),o=Hz();Y.exports=function(c,s,h,m){function b(D,E){return f.coerce(c,s,o,D,E)}b("carpet"),s.xaxis="x",s.yaxis="y";var x=b("a"),_=b("b"),A=Math.min(x.length,_.length);if(!A){s.visible=!1;return}s._length=A,b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext");var d=A{Y.exports=function(f,y){var z={},P=y._carpet,n=P.ab2ij([f.a,f.b]),i=Math.floor(n[0]),a=n[0]-i,l=Math.floor(n[1]),o=n[1]-l,c=P.evalxy([],i,l,a,o);return z.yLabel=c[1].toFixed(3),z}}),CA=It((et,Y)=>{Y.exports=function(f,y){for(var z=f._fullData.length,P,n=0;n{var f=Sr(),y=Dm(),z=ft(),P=$t(),n=_e().calcMarkerSize,i=CA();Y.exports=function(a,l){var o=l._carpetTrace=i(a,l);if(!(!o||!o.visible||o.visible==="legendonly")){var c;l.xaxis=o.xaxis,l.yaxis=o.yaxis;var s=l._length,h=new Array(s),m,b,x=!1;for(c=0;c{var f=fo(),y=Fs(),z=Js();Y.exports=function(P,n,i,a){var l,o,c,s=i[0][0].carpet,h=y.getFromId(P,s.xaxis||"x"),m=y.getFromId(P,s.yaxis||"y"),b={xaxis:h,yaxis:m,plot:n.plot};for(l=0;l{var f=Kf(),y=jn().fillText;Y.exports=function(z,P,n,i){var a=f(z,P,n,i);if(!a||a[0].index===!1)return;var l=a[0];if(l.index===void 0){var o=1-l.y0/z.ya._length,c=z.xa._length,s=c*o/2,h=c-s;return l.x0=Math.max(Math.min(l.x0,h),s),l.x1=Math.max(Math.min(l.x1,h),s),a}var m=l.cd[l.index];l.a=m.a,l.b=m.b,l.xLabelVal=void 0,l.yLabelVal=void 0;var b=l.trace,x=b._carpet,_=b._module.formatLabels(m,b);l.yLabel=_.yLabel,delete l.text;var A=[];function d(D,E){var I;D.labelprefix&&D.labelprefix.length>0?I=D.labelprefix.replace(/ = $/,""):I=D._hovertitle,A.push(I+": "+E.toFixed(3)+D.labelsuffix)}if(!b.hovertemplate){var k=m.hi||b.hoverinfo,w=k.split("+");w.indexOf("all")!==-1&&(w=["a","b","text"]),w.indexOf("a")!==-1&&d(x.aaxis,m.a),w.indexOf("b")!==-1&&d(x.baxis,m.b),A.push("y: "+l.yLabel),w.indexOf("text")!==-1&&y(m,b,A),l.extraText=A.join("
")}return a}}),Ket=It((et,Y)=>{Y.exports=function(f,y,z,P,n){var i=P[n];return f.a=i.a,f.b=i.b,f.y=i.y,f}}),Yet=It((et,Y)=>{Y.exports={attributes:Hz(),supplyDefaults:Vet(),colorbar:Do(),formatLabels:Wet(),calc:qet(),plot:Get(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:Zet(),selectPoints:Qd(),eventData:Ket(),moduleType:"trace",name:"scattercarpet",basePlotModule:Fd(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),Xet=It((et,Y)=>{Y.exports=Yet()}),Vz=It((et,Y)=>{var f=zw(),y=Q4(),z=Ru(),P=Yn().extendFlat,n=y.contours;Y.exports=P({carpet:{valType:"string",editType:"calc"},z:f.z,a:f.x,a0:f.x0,da:f.dx,b:f.y,b0:f.y0,db:f.dy,text:f.text,hovertext:f.hovertext,transpose:f.transpose,atype:f.xtype,btype:f.ytype,fillcolor:y.fillcolor,autocontour:y.autocontour,ncontours:y.ncontours,contours:{type:n.type,start:n.start,end:n.end,size:n.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:n.showlines,showlabels:n.showlabels,labelfont:n.labelfont,labelformat:n.labelformat,operation:n.operation,value:n.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:y.line.color,width:y.line.width,dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},zorder:y.zorder},z("",{cLetter:"z",autoColorDflt:!1}))}),Wz=It((et,Y)=>{var f=jn(),y=U8(),z=Vz(),P=gP(),n=eC(),i=rC();Y.exports=function(a,l,o,c){function s(x,_){return f.coerce(a,l,z,x,_)}function h(x){return f.coerce2(a,l,z,x)}if(s("carpet"),a.a&&a.b){var m=y(a,l,s,c,"a","b");if(!m){l.visible=!1;return}s("text");var b=s("contours.type")==="constraint";b?P(a,l,s,c,o,{hasHover:!1}):(n(a,l,s,h),i(a,l,s,c,{hasHover:!1}))}else l._defaultColor=o,l._length=null;s("zorder")}}),Jet=It((et,Y)=>{var f=Cp(),y=jn(),z=$8(),P=H8(),n=V8(),i=W8(),a=tP(),l=Wz(),o=CA(),c=sP();Y.exports=function(h,m){var b=m._carpetTrace=o(h,m);if(!(!b||!b.visible||b.visible==="legendonly")){if(!m.a||!m.b){var x=h.data[b.index],_=h.data[m.index];_.a||(_.a=x.a),_.b||(_.b=x.b),l(_,m,m._defaultColor,h._fullLayout)}var A=s(h,m);return c(m,m._z),A}};function s(h,m){var b=m._carpetTrace,x=b.aaxis,_=b.baxis,A,d,k,w,D,E,I;x._minDtick=0,_._minDtick=0,y.isArray1D(m.z)&&z(m,x,_,"a","b",["z"]),A=m._a=m._a||m.a,w=m._b=m._b||m.b,A=A?x.makeCalcdata(m,"_a"):[],w=w?_.makeCalcdata(m,"_b"):[],d=m.a0||0,k=m.da||1,D=m.b0||0,E=m.db||1,I=m._z=P(m._z||m.z,m.transpose),m._emptypoints=i(I),n(I,m._emptypoints);var M=y.maxRowLength(I),p=m.xtype==="scaled"?"":A,g=a(m,p,d,k,M,x),C=m.ytype==="scaled"?"":w,S=a(m,C,D,E,I.length,_),N={a:g,b:S,z:I};return m.contours.type==="levels"&&m.contours.coloring!=="none"&&f(h,m,{vals:I,containerStr:"",cLetter:"z"}),[N]}}),Qet=It((et,Y)=>{var f=jn().isArrayOrTypedArray;Y.exports=function(y,z,P,n){var i,a,l,o,c,s,h,m,b,x,_,A,d,k=f(P)?"a":"b",w=k==="a"?y.aaxis:y.baxis,D=w.smoothing,E=k==="a"?y.a2i:y.b2j,I=k==="a"?P:n,M=k==="a"?n:P,p=k==="a"?z.a.length:z.b.length,g=k==="a"?z.b.length:z.a.length,C=Math.floor(k==="a"?y.b2j(M):y.a2i(M)),S=k==="a"?function(bt){return y.evalxy([],bt,C)}:function(bt){return y.evalxy([],C,bt)};D&&(l=Math.max(0,Math.min(g-2,C)),o=C-l,a=k==="a"?function(bt,vt){return y.dxydi([],bt,l,vt,o)}:function(bt,vt){return y.dxydj([],l,bt,o,vt)});var N=E(I[0]),B=E(I[1]),U=N0?Math.floor:Math.ceil,F=U>0?Math.ceil:Math.floor,H=U>0?Math.min:Math.max,q=U>0?Math.max:Math.min,G=W(N+V),tt=F(B-V);h=S(N);var ht=[[h]];for(i=G;i*U{var f=Br(),y=Uz(),z=$z(),P=Js(),n=jn(),i=cP(),a=uP(),l=nC(),o=ek(),c=dP(),s=hP(),h=fP(),m=CA(),b=Qet();Y.exports=function(M,p,g,C){var S=p.xaxis,N=p.yaxis;n.makeTraceGroups(C,g,"contour").each(function(B){var U=f.select(this),V=B[0],W=V.trace,F=W._carpetTrace=m(M,W),H=M.calcdata[F.index][0];if(!F.visible||F.visible==="legendonly")return;var q=V.a,G=V.b,tt=W.contours,ht=s(tt,p,V),bt=tt.type==="constraint",vt=tt._operation,ut=bt?vt==="="?"lines":"fill":tt.coloring;function rt(Bt){var Zt=F.ab2xy(Bt[0],Bt[1],!0);return[S.c2p(Zt[0]),N.c2p(Zt[1])]}var gt=[[q[0],G[G.length-1]],[q[q.length-1],G[G.length-1]],[q[q.length-1],G[0]],[q[0],G[0]]];i(ht);var it=(q[q.length-1]-q[0])*1e-8,st=(G[G.length-1]-G[0])*1e-8;a(ht,it,st);var xt=ht;tt.type==="constraint"&&(xt=c(ht,vt)),x(ht,rt);var ot,J,mt,dt,Ct=[];for(dt=H.clipsegments.length-1;dt>=0;dt--)ot=H.clipsegments[dt],J=y([],ot.x,S.c2p),mt=y([],ot.y,N.c2p),J.reverse(),mt.reverse(),Ct.push(z(J,mt,ot.bicubic));var Rt="M"+Ct.join("L")+"Z";D(U,H.clipsegments,S,N,bt,ut),E(W,U,S,N,xt,gt,rt,F,H,ut,Rt),_(U,ht,M,V,tt,p,F),P.setClipUrl(U,F._clipPathId,M)})};function x(M,p){var g,C,S,N,B,U,V,W,F;for(g=0;gbt&&(C.max=bt),C.len=C.max-C.min}function d(M,p,g){var C=M.getPointAtLength(p),S=M.getPointAtLength(g),N=S.x-C.x,B=S.y-C.y,U=Math.sqrt(N*N+B*B);return[N/U,B/U]}function k(M){var p=Math.sqrt(M[0]*M[0]+M[1]*M[1]);return[M[0]/p,M[1]/p]}function w(M,p){var g=Math.abs(M[0]*p[0]+M[1]*p[1]),C=Math.sqrt(1-g*g);return C/g}function D(M,p,g,C,S,N){var B,U,V,W,F=n.ensureSingle(M,"g","contourbg"),H=F.selectAll("path").data(N==="fill"&&!S?[0]:[]);H.enter().append("path"),H.exit().remove();var q=[];for(W=0;W=0&&(G=mt,ht=bt):Math.abs(q[1]-G[1])=0&&(G=mt,ht=bt):n.log("endpt to newendpt is not vert. or horz.",q,G,mt)}if(ht>=0)break;W+=ot(q,G),q=G}if(ht===p.edgepaths.length){n.log("unclosed perimeter path");break}V=ht,H=F.indexOf(V)===-1,H&&(V=F[0],W+=ot(q,G)+"Z",q=null)}for(V=0;V{Y.exports={attributes:Vz(),supplyDefaults:Wz(),colorbar:aC(),calc:Jet(),plot:trt(),style:iC(),moduleType:"trace",name:"contourcarpet",basePlotModule:Fd(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),rrt=It((et,Y)=>{Y.exports=ert()}),AA=It((et,Y)=>{var f=jn().extendFlat,y=dd(),z=Sh().axisHoverFormat,P=qf().dash,n=oo(),i=Ow(),a=i.INCREASING.COLOR,l=i.DECREASING.COLOR,o=y.line;function c(s){return{line:{color:f({},o.color,{dflt:s}),width:o.width,dash:P,editType:"style"},editType:"style"}}Y.exports={xperiod:y.xperiod,xperiod0:y.xperiod0,xperiodalignment:y.xperiodalignment,xhoverformat:z("x"),yhoverformat:z("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:f({},o.width,{}),dash:f({},P,{}),editType:"style"},increasing:c(a),decreasing:c(l),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:f({},n.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:y.zorder}}),qz=It((et,Y)=>{var f=ls(),y=jn();Y.exports=function(z,P,n,i){var a=n("x"),l=n("open"),o=n("high"),c=n("low"),s=n("close");n("hoverlabel.split");var h=f.getComponentMethod("calendars","handleTraceDefaults");if(h(z,P,["x"],i),!!(l&&o&&c&&s)){var m=Math.min(l.length,o.length,c.length,s.length);return a&&(m=Math.min(m,y.minRowLength(a))),P._length=m,m}}}),nrt=It((et,Y)=>{var f=jn(),y=qz(),z=S0(),P=AA();Y.exports=function(i,a,l,o){function c(h,m){return f.coerce(i,a,P,h,m)}var s=y(i,a,c,o);if(!s){a.visible=!1;return}z(i,a,o,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),c("line.dash"),n(i,a,c,"increasing"),n(i,a,c,"decreasing"),c("text"),c("hovertext"),c("tickwidth"),o._requestRangeslider[a.xaxis]=!0,c("zorder")};function n(i,a,l,o){l(o+".line.color"),l(o+".line.width",a.line.width),l(o+".line.dash",a.line.dash)}}),Gz=It((et,Y)=>{var f=jn(),y=f._,z=Fs(),P=Im(),n=Dr().BADNUM;function i(c,s){var h=z.getFromId(c,s.xaxis),m=z.getFromId(c,s.yaxis),b=o(c,h,s),x=s._minDiff;s._minDiff=null;var _=s._origX;s._origX=null;var A=s._xcalc;s._xcalc=null;var d=l(c,s,_,A,m,a);return s._extremes[h._id]=z.findExtremes(h,A,{vpad:x/2}),d.length?(f.extendFlat(d[0].t,{wHover:x/2,tickLen:b}),d):[{t:{empty:!0}}]}function a(c,s,h,m){return{o:c,h:s,l:h,c:m}}function l(c,s,h,m,b,x){for(var _=b.makeCalcdata(s,"open"),A=b.makeCalcdata(s,"high"),d=b.makeCalcdata(s,"low"),k=b.makeCalcdata(s,"close"),w=f.isArrayOrTypedArray(s.text),D=f.isArrayOrTypedArray(s.hovertext),E=!0,I=null,M=!!s.xperiodalignment,p=[],g=0;gI):E=U>S,I=U;var V=x(S,N,B,U);V.pos=C,V.yc=(S+U)/2,V.i=g,V.dir=E?"increasing":"decreasing",V.x=V.pos,V.y=[B,N],M&&(V.orig_p=h[g]),w&&(V.tx=s.text[g]),D&&(V.htx=s.hovertext[g]),p.push(V)}else p.push({pos:C,empty:!0})}return s._extremes[b._id]=z.findExtremes(b,f.concat(d,A),{padded:!0}),p.length&&(p[0].t={labels:{open:y(c,"open:")+" ",high:y(c,"high:")+" ",low:y(c,"low:")+" ",close:y(c,"close:")+" "}}),p}function o(c,s,h){var m=h._minDiff;if(!m){var b=c._fullData,x=[];m=1/0;var _;for(_=0;_{var f=Br(),y=jn();Y.exports=function(z,P,n,i){var a=P.yaxis,l=P.xaxis,o=!!l.rangebreaks;y.makeTraceGroups(i,n,"trace ohlc").each(function(c){var s=f.select(this),h=c[0],m=h.t,b=h.trace;if(b.visible!==!0||m.empty){s.remove();return}var x=m.tickLen,_=s.selectAll("path").data(y.identity);_.enter().append("path"),_.exit().remove(),_.attr("d",function(A){if(A.empty)return"M0,0Z";var d=l.c2p(A.pos-x,!0),k=l.c2p(A.pos+x,!0),w=o?(d+k)/2:l.c2p(A.pos,!0),D=a.c2p(A.o,!0),E=a.c2p(A.h,!0),I=a.c2p(A.l,!0),M=a.c2p(A.c,!0);return"M"+d+","+D+"H"+w+"M"+w+","+E+"V"+I+"M"+k+","+M+"H"+w})})}}),art=It((et,Y)=>{var f=Br(),y=Js(),z=Hn();Y.exports=function(P,n,i){var a=i||f.select(P).selectAll("g.ohlclayer").selectAll("g.trace");a.style("opacity",function(l){return l[0].trace.opacity}),a.each(function(l){var o=l[0].trace;f.select(this).selectAll("path").each(function(c){if(!c.empty){var s=o[c.dir].line;f.select(this).style("fill","none").call(z.stroke,s.color).call(y.dashLine,s.dash,s.width).style("opacity",o.selectedpoints&&!c.selected?.3:1)}})})}}),Zz=It((et,Y)=>{var f=Fs(),y=jn(),z=hd(),P=Hn(),n=jn().fillText,i=Ow(),a={increasing:i.INCREASING.SYMBOL,decreasing:i.DECREASING.SYMBOL};function l(h,m,b,x){var _=h.cd,A=_[0].trace;return A.hoverlabel.split?c(h,m,b,x):s(h,m,b,x)}function o(h,m,b,x){var _=h.cd,A=h.xa,d=_[0].trace,k=_[0].t,w=d.type,D=w==="ohlc"?"l":"min",E=w==="ohlc"?"h":"max",I,M,p=k.bPos||0,g=function(tt){return tt.pos+p-m},C=k.bdPos||k.tickLen,S=k.wHover,N=Math.min(1,C/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));I=h.maxHoverDistance-N,M=h.maxSpikeDistance-N;function B(tt){var ht=g(tt);return z.inbox(ht-S,ht+S,I)}function U(tt){var ht=tt[D],bt=tt[E];return ht===bt||z.inbox(ht-b,bt-b,I)}function V(tt){return(B(tt)+U(tt))/2}var W=z.getDistanceFunction(x,B,U,V);if(z.getClosest(_,W,h),h.index===!1)return null;var F=_[h.index];if(F.empty)return null;var H=F.dir,q=d[H],G=q.line.color;return P.opacity(G)&&q.line.width?h.color=G:h.color=q.fillcolor,h.x0=A.c2p(F.pos+p-C,!0),h.x1=A.c2p(F.pos+p+C,!0),h.xLabelVal=F.orig_p!==void 0?F.orig_p:F.pos,h.spikeDistance=V(F)*M/I,h.xSpike=A.c2p(F.pos,!0),h}function c(h,m,b,x){var _=h.cd,A=h.ya,d=_[0].trace,k=_[0].t,w=[],D=o(h,m,b,x);if(!D)return[];var E=D.index,I=_[E],M=I.hi||d.hoverinfo,p=M.split("+"),g=M==="all",C=g||p.indexOf("y")!==-1;if(!C)return[];for(var S=["high","open","close","low"],N={},B=0;B"+k.labels[U]+f.hoverLabelText(A,V,d.yhoverformat)):(F=y.extendFlat({},D),F.y0=F.y1=W,F.yLabelVal=V,F.yLabel=k.labels[U]+f.hoverLabelText(A,V,d.yhoverformat),F.name="",w.push(F),N[V]=F)}return w}function s(h,m,b,x){var _=h.cd,A=h.ya,d=_[0].trace,k=_[0].t,w=o(h,m,b,x);if(!w)return[];var D=w.index,E=_[D],I=w.index=E.i,M=E.dir;function p(V){return k.labels[V]+f.hoverLabelText(A,d[V][I],d.yhoverformat)}var g=E.hi||d.hoverinfo,C=g.split("+"),S=g==="all",N=S||C.indexOf("y")!==-1,B=S||C.indexOf("text")!==-1,U=N?[p("open"),p("high"),p("low"),p("close")+" "+a[M]]:[];return B&&n(E,d,U),w.extraText=U.join("
"),w.y0=w.y1=A.c2p(E.yc,!0),[w]}Y.exports={hoverPoints:l,hoverSplit:c,hoverOnPoints:s}}),Kz=It((et,Y)=>{Y.exports=function(f,y){var z=f.cd,P=f.xaxis,n=f.yaxis,i=[],a,l=z[0].t.bPos||0;if(y===!1)for(a=0;a{Y.exports={moduleType:"trace",name:"ohlc",basePlotModule:Fd(),categories:["cartesian","svg","showLegend"],meta:{},attributes:AA(),supplyDefaults:nrt(),calc:Gz().calc,plot:irt(),style:art(),hoverPoints:Zz().hoverPoints,selectPoints:Kz()}}),srt=It((et,Y)=>{Y.exports=ort()}),Yz=It((et,Y)=>{var f=jn().extendFlat,y=Sh().axisHoverFormat,z=AA(),P=K4();function n(i){return{line:{color:f({},P.line.color,{dflt:i}),width:P.line.width,editType:"style"},fillcolor:P.fillcolor,editType:"style"}}Y.exports={xperiod:z.xperiod,xperiod0:z.xperiod0,xperiodalignment:z.xperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),x:z.x,open:z.open,high:z.high,low:z.low,close:z.close,line:{width:f({},P.line.width,{}),editType:"style"},increasing:n(z.increasing.line.color.dflt),decreasing:n(z.decreasing.line.color.dflt),text:z.text,hovertext:z.hovertext,whiskerwidth:f({},P.whiskerwidth,{dflt:0}),hoverlabel:z.hoverlabel,zorder:P.zorder}}),lrt=It((et,Y)=>{var f=jn(),y=Hn(),z=qz(),P=S0(),n=Yz();Y.exports=function(a,l,o,c){function s(m,b){return f.coerce(a,l,n,m,b)}var h=z(a,l,s,c);if(!h){l.visible=!1;return}P(a,l,c,s,{x:!0}),s("xhoverformat"),s("yhoverformat"),s("line.width"),i(a,l,s,"increasing"),i(a,l,s,"decreasing"),s("text"),s("hovertext"),s("whiskerwidth"),c._requestRangeslider[l.xaxis]=!0,s("zorder")};function i(a,l,o,c){var s=o(c+".line.color");o(c+".line.width",l.line.width),o(c+".fillcolor",y.addOpacity(s,.5))}}),crt=It((et,Y)=>{var f=jn(),y=Fs(),z=Im(),P=Gz().calcCommon;Y.exports=function(i,a){var l=i._fullLayout,o=y.getFromId(i,a.xaxis),c=y.getFromId(i,a.yaxis),s=o.makeCalcdata(a,"x"),h=z(a,o,"x",s).vals,m=P(i,a,s,h,c,n);return m.length?(f.extendFlat(m[0].t,{num:l._numBoxes,dPos:f.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),l._numBoxes++,m):[{t:{empty:!0}}]};function n(i,a,l,o){return{min:l,q1:Math.min(i,o),med:o,q3:Math.max(i,o),max:a}}}),urt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"candlestick",basePlotModule:Fd(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:Yz(),layoutAttributes:Y4(),supplyLayoutDefaults:R8().supplyLayoutDefaults,crossTraceCalc:F8().crossTraceCalc,supplyDefaults:lrt(),calc:crt(),plot:N8().plot,layerName:"boxlayer",style:j8().style,hoverPoints:Zz().hoverPoints,selectPoints:Kz()}}),hrt=It((et,Y)=>{Y.exports=urt()}),Xz=It((et,Y)=>{var f=jn(),y=G0(),z=f.deg2rad,P=f.rad2deg;Y.exports=function(o,c,s){switch(y(o,s),o._id){case"x":case"radialaxis":n(o,c);break;case"angularaxis":l(o,c);break}};function n(o,c){var s=c._subplot;o.setGeometry=function(){var h=o._rl[0],m=o._rl[1],b=s.innerRadius,x=(s.radius-b)/(m-h),_=b/x,A=h>m?function(d){return d<=0}:function(d){return d>=0};o.c2g=function(d){var k=o.c2l(d)-h;return(A(k)?k:0)+_},o.g2c=function(d){return o.l2c(d+h-_)},o.g2p=function(d){return d*x},o.c2p=function(d){return o.g2p(o.c2g(d))}}}function i(o,c){return c==="degrees"?z(o):o}function a(o,c){return c==="degrees"?P(o):o}function l(o,c){var s=o.type;if(s==="linear"){var h=o.d2c,m=o.c2d;o.d2c=function(b,x){return i(h(b),x)},o.c2d=function(b,x){return m(a(b,x))}}o.makeCalcdata=function(b,x){var _=b[x],A=b._length,d,k,w=function(p){return o.d2c(p,b.thetaunit)};if(_)for(d=new Array(A),k=0;k{Y.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}),EA=It((et,Y)=>{var f=jn(),y=Ag().tester,z=f.findIndexOfMin,P=f.isAngleInsideSector,n=f.angleDelta,i=f.angleDist;function a(k,w,D,E,I){if(!P(w,E))return!1;var M,p;D[0]0?p:1/0},E=z(w,D),I=f.mod(E+1,w.length);return[w[E],w[I]]}function x(k){return Math.abs(k)>1e-10?k:0}function _(k,w,D){w=w||0,D=D||0;for(var E=k.length,I=new Array(E),M=0;M{function f(a){return a<0?-1:a>0?1:0}function y(a){var l=a[0],o=a[1];if(!isFinite(l)||!isFinite(o))return[1,0];var c=(l+1)*(l+1)+o*o;return[(l*l+o*o-1)/c,2*o/c]}function z(a,l){var o=l[0],c=l[1];return[o*a.radius+a.cx,-c*a.radius+a.cy]}function P(a,l){return l*a.radius}function n(a,l,o,c){var s=z(a,y([o,l])),h=s[0],m=s[1],b=z(a,y([c,l])),x=b[0],_=b[1];if(l===0)return["M"+h+","+m,"L"+x+","+_].join(" ");var A=P(a,1/Math.abs(l));return["M"+h+","+m,"A"+A+","+A+" 0 0,"+(l<0?1:0)+" "+x+","+_].join(" ")}function i(a,l,o,c){var s=P(a,1/(l+1)),h=z(a,y([l,o])),m=h[0],b=h[1],x=z(a,y([l,c])),_=x[0],A=x[1];if(f(o)!==f(c)){var d=z(a,y([l,0])),k=d[0],w=d[1];return["M"+m+","+b,"A"+s+","+s+" 0 0,"+(0{var f=Br(),y=Xi(),z=ls(),P=jn(),n=P.strRotate,i=P.strTranslate,a=Hn(),l=Js(),o=lh(),c=Fs(),s=G0(),h=Xz(),m=Jm().doAutoRange,b=P_(),x=Up(),_=hd(),A=jp(),d=Md().prepSelect,k=Md().selectOnClick,w=Md().clearOutline,D=Mm(),E=ry(),I=fm().redrawReglTraces,M=Rd().MID_SHIFT,p=MA(),g=EA(),C=Jz(),S=C.smith,N=C.reactanceArc,B=C.resistanceArc,U=C.smithTransform,V=P._,W=P.mod,F=P.deg2rad,H=P.rad2deg;function q(ut,rt,gt){this.isSmith=gt||!1,this.id=rt,this.gd=ut,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var it=ut._fullLayout,st="clip"+it._uid+rt;this.clipIds.forTraces=st+"-for-traces",this.clipPaths.forTraces=it._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=it["_"+(gt?"smith":"polar")+"layer"].append("g").attr("class",rt),this.getHole=function(xt){return this.isSmith?0:xt.hole},this.getSector=function(xt){return this.isSmith?[0,360]:xt.sector},this.getRadial=function(xt){return this.isSmith?xt.realaxis:xt.radialaxis},this.getAngular=function(xt){return this.isSmith?xt.imaginaryaxis:xt.angularaxis},gt||(this.radialTickLayout=null,this.angularTickLayout=null)}var G=q.prototype;Y.exports=function(ut,rt,gt){return new q(ut,rt,gt)},G.plot=function(ut,rt){for(var gt=this,it=rt[gt.id],st=!1,xt=0;xtxe?(ge=dt,ye=dt*xe,Ot=(Ct-ye)/st.h/2,ue=[J[0],J[1]],Mt=[mt[0]+Ot,mt[1]-Ot]):(ge=Ct/xe,ye=Ct,Ot=(dt-ge)/st.w/2,ue=[J[0]+Ot,J[1]-Ot],Mt=[mt[0],mt[1]]),gt.xLength2=ge,gt.yLength2=ye,gt.xDomain2=ue,gt.yDomain2=Mt;var Lt=gt.xOffset2=st.l+st.w*ue[0],ie=gt.yOffset2=st.t+st.h*(1-Mt[1]),be=gt.radius=ge/Zt,ce=gt.innerRadius=gt.getHole(rt)*be,Le=gt.cx=Lt-be*Bt[0],Ze=gt.cy=ie+be*Bt[3],Qe=gt.cxx=Le-Lt,mr=gt.cyy=Ze-ie,fr=xt.side,Jr;fr==="counterclockwise"?(Jr=fr,fr="top"):fr==="clockwise"&&(Jr=fr,fr="bottom"),gt.radialAxis=gt.mockAxis(ut,rt,xt,{_id:"x",side:fr,_trueSide:Jr,domain:[ce/st.w,be/st.w]}),gt.angularAxis=gt.mockAxis(ut,rt,ot,{side:"right",domain:[0,Math.PI],autorange:!1}),gt.doAutoRange(ut,rt),gt.updateAngularAxis(ut,rt),gt.updateRadialAxis(ut,rt),gt.updateRadialAxisTitle(ut,rt),gt.xaxis=gt.mockCartesianAxis(ut,rt,{_id:"x",domain:ue}),gt.yaxis=gt.mockCartesianAxis(ut,rt,{_id:"y",domain:Mt});var an=gt.pathSubplot();gt.clipPaths.forTraces.select("path").attr("d",an).attr("transform",i(Qe,mr)),it.frontplot.attr("transform",i(Lt,ie)).call(l.setClipUrl,gt._hasClipOnAxisFalse?null:gt.clipIds.forTraces,gt.gd),it.bg.attr("d",an).attr("transform",i(Le,Ze)).call(a.fill,rt.bgcolor)},G.mockAxis=function(ut,rt,gt,it){var st=P.extendFlat({},gt,it);return h(st,rt,ut),st},G.mockCartesianAxis=function(ut,rt,gt){var it=this,st=it.isSmith,xt=gt._id,ot=P.extendFlat({type:"linear"},gt);s(ot,ut);var J={x:[0,2],y:[1,3]};return ot.setRange=function(){var mt=it.sectorBBox,dt=J[xt],Ct=it.radialAxis._rl,Rt=(Ct[1]-Ct[0])/(1-it.getHole(rt));ot.range=[mt[dt[0]]*Rt,mt[dt[1]]*Rt]},ot.isPtWithinRange=xt==="x"&&!st?function(mt){return it.isPtInside(mt)}:function(){return!0},ot.setRange(),ot.setScale(),ot},G.doAutoRange=function(ut,rt){var gt=this,it=gt.gd,st=gt.radialAxis,xt=gt.getRadial(rt);m(it,st);var ot=st.range;if(xt.range=ot.slice(),xt._input.range=ot.slice(),st._rl=[st.r2l(ot[0],null,"gregorian"),st.r2l(ot[1],null,"gregorian")],st.minallowed!==void 0){var J=st.r2l(st.minallowed);st._rl[0]>st._rl[1]?st._rl[1]=Math.max(st._rl[1],J):st._rl[0]=Math.max(st._rl[0],J)}if(st.maxallowed!==void 0){var mt=st.r2l(st.maxallowed);st._rl[0]90&&Ct<=270&&(Rt.tickangle=180);var Gt=Zt?function(be){var ce=U(gt,S([be.x,0]));return i(ce[0]-J,ce[1]-mt)}:function(be){return i(Rt.l2p(be.x)+ot,0)},ee=Zt?function(be){return B(gt,be.x,-1/0,1/0)}:function(be){return gt.pathArc(Rt.r2p(be.x)+ot)},xe=tt(dt);if(gt.radialTickLayout!==xe&&(st["radial-axis"].selectAll(".xtick").remove(),gt.radialTickLayout=xe),Bt){Rt.setScale();var ge=0,ye=Zt?(Rt.tickvals||[]).filter(function(be){return be>=0}).map(function(be){return c.tickText(Rt,be,!0,!1)}):c.calcTicks(Rt),ue=Zt?ye:c.clipEnds(Rt,ye),Mt=c.getTickSigns(Rt)[2];Zt&&((Rt.ticks==="top"&&Rt.side==="bottom"||Rt.ticks==="bottom"&&Rt.side==="top")&&(Mt=-Mt),Rt.ticks==="top"&&Rt.side==="top"&&(ge=-Rt.ticklen),Rt.ticks==="bottom"&&Rt.side==="bottom"&&(ge=Rt.ticklen)),c.drawTicks(it,Rt,{vals:ye,layer:st["radial-axis"],path:c.makeTickPath(Rt,0,Mt),transFn:Gt,crisp:!1}),c.drawGrid(it,Rt,{vals:ue,layer:st["radial-grid"],path:ee,transFn:P.noop,crisp:!1}),c.drawLabels(it,Rt,{vals:ye,layer:st["radial-axis"],transFn:Gt,labelFns:c.makeLabelFns(Rt,ge)})}var Ot=gt.radialAxisAngle=gt.vangles?H(bt(F(dt.angle),gt.vangles)):dt.angle,Lt=i(J,mt),ie=Lt+n(-Ot);vt(st["radial-axis"],Bt&&(dt.showticklabels||dt.ticks),{transform:ie}),vt(st["radial-grid"],Bt&&dt.showgrid,{transform:Zt?"":Lt}),vt(st["radial-line"].select("line"),Bt&&dt.showline,{x1:Zt?-xt:ot,y1:0,x2:xt,y2:0,transform:ie}).attr("stroke-width",dt.linewidth).call(a.stroke,dt.linecolor)},G.updateRadialAxisTitle=function(ut,rt,gt){if(!this.isSmith){var it=this,st=it.gd,xt=it.radius,ot=it.cx,J=it.cy,mt=it.getRadial(rt),dt=it.id+"title",Ct=0;if(mt.title){var Rt=l.bBox(it.layers["radial-axis"].node()).height,Bt=mt.title.font.size,Zt=mt.side;Ct=Zt==="top"?Bt:Zt==="counterclockwise"?-(Rt+Bt*.4):Rt+Bt*.8}var Gt=gt!==void 0?gt:it.radialAxisAngle,ee=F(Gt),xe=Math.cos(ee),ge=Math.sin(ee),ye=ot+xt/2*xe+Ct*ge,ue=J-xt/2*ge+Ct*xe;it.layers["radial-axis-title"]=A.draw(st,dt,{propContainer:mt,propName:it.id+".radialaxis.title.text",placeholder:V(st,"Click to enter radial axis title"),attributes:{x:ye,y:ue,"text-anchor":"middle"},transform:{rotate:-Gt}})}},G.updateAngularAxis=function(ut,rt){var gt=this,it=gt.gd,st=gt.layers,xt=gt.radius,ot=gt.innerRadius,J=gt.cx,mt=gt.cy,dt=gt.getAngular(rt),Ct=gt.angularAxis,Rt=gt.isSmith;Rt||(gt.fillViewInitialKey("angularaxis.rotation",dt.rotation),Ct.setGeometry(),Ct.setScale());var Bt=Rt?function(ce){var Le=U(gt,S([0,ce.x]));return Math.atan2(Le[0]-J,Le[1]-mt)-Math.PI/2}:function(ce){return Ct.t2g(ce.x)};Ct.type==="linear"&&Ct.thetaunit==="radians"&&(Ct.tick0=H(Ct.tick0),Ct.dtick=H(Ct.dtick));var Zt=function(ce){return i(J+xt*Math.cos(ce),mt-xt*Math.sin(ce))},Gt=Rt?function(ce){var Le=U(gt,S([0,ce.x]));return i(Le[0],Le[1])}:function(ce){return Zt(Bt(ce))},ee=Rt?function(ce){var Le=U(gt,S([0,ce.x])),Ze=Math.atan2(Le[0]-J,Le[1]-mt)-Math.PI/2;return i(Le[0],Le[1])+n(-H(Ze))}:function(ce){var Le=Bt(ce);return Zt(Le)+n(-H(Le))},xe=Rt?function(ce){return N(gt,ce.x,0,1/0)}:function(ce){var Le=Bt(ce),Ze=Math.cos(Le),Qe=Math.sin(Le);return"M"+[J+ot*Ze,mt-ot*Qe]+"L"+[J+xt*Ze,mt-xt*Qe]},ge=c.makeLabelFns(Ct,0),ye=ge.labelStandoff,ue={};ue.xFn=function(ce){var Le=Bt(ce);return Math.cos(Le)*ye},ue.yFn=function(ce){var Le=Bt(ce),Ze=Math.sin(Le)>0?.2:1;return-Math.sin(Le)*(ye+ce.fontSize*Ze)+Math.abs(Math.cos(Le))*(ce.fontSize*M)},ue.anchorFn=function(ce){var Le=Bt(ce),Ze=Math.cos(Le);return Math.abs(Ze)<.1?"middle":Ze>0?"start":"end"},ue.heightFn=function(ce,Le,Ze){var Qe=Bt(ce);return-.5*(1+Math.sin(Qe))*Ze};var Mt=tt(dt);gt.angularTickLayout!==Mt&&(st["angular-axis"].selectAll("."+Ct._id+"tick").remove(),gt.angularTickLayout=Mt);var Ot=Rt?[1/0].concat(Ct.tickvals||[]).map(function(ce){return c.tickText(Ct,ce,!0,!1)}):c.calcTicks(Ct);Rt&&(Ot[0].text="∞",Ot[0].fontSize*=1.75);var Lt;if(rt.gridshape==="linear"?(Lt=Ot.map(Bt),P.angleDelta(Lt[0],Lt[1])<0&&(Lt=Lt.slice().reverse())):Lt=null,gt.vangles=Lt,Ct.type==="category"&&(Ot=Ot.filter(function(ce){return P.isAngleInsideSector(Bt(ce),gt.sectorInRad)})),Ct.visible){var ie=Ct.ticks==="inside"?-1:1,be=(Ct.linewidth||1)/2;c.drawTicks(it,Ct,{vals:Ot,layer:st["angular-axis"],path:"M"+ie*be+",0h"+ie*Ct.ticklen,transFn:ee,crisp:!1}),c.drawGrid(it,Ct,{vals:Ot,layer:st["angular-grid"],path:xe,transFn:P.noop,crisp:!1}),c.drawLabels(it,Ct,{vals:Ot,layer:st["angular-axis"],repositionOnUpdate:!0,transFn:Gt,labelFns:ue})}vt(st["angular-line"].select("path"),dt.showline,{d:gt.pathSubplot(),transform:i(J,mt)}).attr("stroke-width",dt.linewidth).call(a.stroke,dt.linecolor)},G.updateFx=function(ut,rt){if(!this.gd._context.staticPlot){var gt=!this.isSmith;gt&&(this.updateAngularDrag(ut),this.updateRadialDrag(ut,rt,0),this.updateRadialDrag(ut,rt,1)),this.updateHoverAndMainDrag(ut)}},G.updateHoverAndMainDrag=function(ut){var rt=this,gt=rt.isSmith,it=rt.gd,st=rt.layers,xt=ut._zoomlayer,ot=p.MINZOOM,J=p.OFFEDGE,mt=rt.radius,dt=rt.innerRadius,Ct=rt.cx,Rt=rt.cy,Bt=rt.cxx,Zt=rt.cyy,Gt=rt.sectorInRad,ee=rt.vangles,xe=rt.radialAxis,ge=g.clampTiny,ye=g.findXYatLength,ue=g.findEnclosingVertexAngles,Mt=p.cornerHalfWidth,Ot=p.cornerLen/2,Lt,ie,be=b.makeDragger(st,"path","maindrag",ut.dragmode===!1?"none":"crosshair");f.select(be).attr("d",rt.pathSubplot()).attr("transform",i(Ct,Rt)),be.onmousemove=function(zr){_.hover(it,zr,rt.id),it._fullLayout._lasthover=be,it._fullLayout._hoversubplot=rt.id},be.onmouseout=function(zr){it._dragging||x.unhover(it,zr)};var ce={element:be,gd:it,subplot:rt.id,plotinfo:{id:rt.id,xaxis:rt.xaxis,yaxis:rt.yaxis},xaxes:[rt.xaxis],yaxes:[rt.yaxis]},Le,Ze,Qe,mr,fr,Jr,an,Er,dn;function _n(zr,xr){return Math.sqrt(zr*zr+xr*xr)}function Oe(zr,xr){return _n(zr-Bt,xr-Zt)}function Xt(zr,xr){return Math.atan2(Zt-xr,zr-Bt)}function oe(zr,xr){return[zr*Math.cos(xr),zr*Math.sin(-xr)]}function zt(zr,xr){if(zr===0)return rt.pathSector(2*Mt);var pn=Ot/zr,ci=xr-pn,ui=xr+pn,yi=Math.max(0,Math.min(zr,mt)),Gi=yi-Mt,Ci=yi+Mt;return"M"+oe(Gi,ci)+"A"+[Gi,Gi]+" 0,0,0 "+oe(Gi,ui)+"L"+oe(Ci,ui)+"A"+[Ci,Ci]+" 0,0,1 "+oe(Ci,ci)+"Z"}function _t(zr,xr,pn){if(zr===0)return rt.pathSector(2*Mt);var ci=oe(zr,xr),ui=oe(zr,pn),yi=ge((ci[0]+ui[0])/2),Gi=ge((ci[1]+ui[1])/2),Ci,fi;if(yi&&Gi){var ba=Gi/yi,oa=-1/ba,Ke=ye(Mt,ba,yi,Gi);Ci=ye(Ot,oa,Ke[0][0],Ke[0][1]),fi=ye(Ot,oa,Ke[1][0],Ke[1][1])}else{var sr,vr;Gi?(sr=Ot,vr=Mt):(sr=Mt,vr=Ot),Ci=[[yi-sr,Gi-vr],[yi+sr,Gi-vr]],fi=[[yi-sr,Gi+vr],[yi+sr,Gi+vr]]}return"M"+Ci.join("L")+"L"+fi.reverse().join("L")+"Z"}function Pt(){Qe=null,mr=null,fr=rt.pathSubplot(),Jr=!1;var zr=it._fullLayout[rt.id];an=y(zr.bgcolor).getLuminance(),Er=b.makeZoombox(xt,an,Ct,Rt,fr),Er.attr("fill-rule","evenodd"),dn=b.makeCorners(xt,Ct,Rt),w(it)}function Ht(zr,xr){return xr=Math.max(Math.min(xr,mt),dt),zrot?(zr-1&&zr===1&&k(xr,it,[rt.xaxis],[rt.yaxis],rt.id,ce),pn.indexOf("event")>-1&&_.click(it,xr,rt.id)}ce.prepFn=function(zr,xr,pn){var ci=it._fullLayout.dragmode,ui=be.getBoundingClientRect();it._fullLayout._calcInverseTransform(it);var yi=it._fullLayout._invTransform;Lt=it._fullLayout._invScaleX,ie=it._fullLayout._invScaleY;var Gi=P.apply3DTransform(yi)(xr-ui.left,pn-ui.top);if(Le=Gi[0],Ze=Gi[1],ee){var Ci=g.findPolygonOffset(mt,Gt[0],Gt[1],ee);Le+=Bt+Ci[0],Ze+=Zt+Ci[1]}switch(ci){case"zoom":ce.clickFn=Rr,gt||(ee?ce.moveFn=qe:ce.moveFn=he,ce.doneFn=Ye,Pt());break;case"select":case"lasso":d(zr,xr,pn,ce,ci);break}},x.init(ce)},G.updateRadialDrag=function(ut,rt,gt){var it=this,st=it.gd,xt=it.layers,ot=it.radius,J=it.innerRadius,mt=it.cx,dt=it.cy,Ct=it.radialAxis,Rt=p.radialDragBoxSize,Bt=Rt/2;if(!Ct.visible)return;var Zt=F(it.radialAxisAngle),Gt=Ct._rl,ee=Gt[0],xe=Gt[1],ge=Gt[gt],ye=.75*(Gt[1]-Gt[0])/(1-it.getHole(rt))/ot,ue,Mt,Ot;gt?(ue=mt+(ot+Bt)*Math.cos(Zt),Mt=dt-(ot+Bt)*Math.sin(Zt),Ot="radialdrag"):(ue=mt+(J-Bt)*Math.cos(Zt),Mt=dt-(J-Bt)*Math.sin(Zt),Ot="radialdrag-inner");var Lt=b.makeRectDragger(xt,Ot,"crosshair",-Bt,-Bt,Rt,Rt),ie={element:Lt,gd:st};ut.dragmode===!1&&(ie.dragmode=!1),vt(f.select(Lt),Ct.visible&&J0!=(gt?Le>ee:Le=90||st>90&&xt>=450?Zt=1:J<=0&&dt<=0?Zt=0:Zt=Math.max(J,dt),st<=180&&xt>=180||st>180&&xt>=540?Ct=-1:ot>=0&&mt>=0?Ct=0:Ct=Math.min(ot,mt),st<=270&&xt>=270||st>270&&xt>=630?Rt=-1:J>=0&&dt>=0?Rt=0:Rt=Math.min(J,dt),xt>=360?Bt=1:ot<=0&&mt<=0?Bt=0:Bt=Math.max(ot,mt),[Ct,Rt,Bt,Zt]}function bt(ut,rt){var gt=function(st){return P.angleDist(ut,st)},it=P.findIndexOfMin(rt,gt);return rt[it]}function vt(ut,rt,gt){return rt?(ut.attr("display",null),ut.attr(gt)):ut&&ut.attr("display","none"),ut}}),tO=It((et,Y)=>{var f=Sn(),y=Gf(),z=Jh().attributes,P=jn().extendFlat,n=sh().overrideAll,i=n({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=n({tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,ticklabelstep:y.ticklabelstep,showticklabels:y.showticklabels,labelalias:y.labelalias,minorloglabels:y.minorloglabels,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickfont:y.tickfont,tickangle:y.tickangle,tickformat:y.tickformat,tickformatstops:y.tickformatstops,layer:y.layer},"plot","from-root"),l={visible:P({},y.visible,{dflt:!0}),type:P({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},autorange:P({},y.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:P({},y.minallowed,{editType:"plot"}),maxallowed:P({},y.maxallowed,{editType:"plot"}),range:P({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:y.categoryorder,categoryarray:y.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:y.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:P({},y.title.text,{editType:"plot",dflt:""}),font:P({},y.title.font,{editType:"plot"}),editType:"plot"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(l,i,a);var o={visible:P({},y.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:y.autotypenumbers,categoryorder:y.categoryorder,categoryarray:y.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(o,i,a),Y.exports={domain:z({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:f.background},radialaxis:l,angularaxis:o,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),drt=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=O_(),n=Mf().getSubplotData,i=jv(),a=Uv(),l=q0(),o=Sg(),c=Jg(),s=fb(),h=A4(),m=ty(),b=tO(),x=Xz(),_=MA(),A=_.axisNames;function d(w,D,E,I){var M=E("bgcolor");I.bgColor=y.combine(M,I.paper_bgcolor);var p=E("sector");E("hole");var g=n(I.fullData,_.name,I.id),C=I.layoutOut,S;function N(Rt,Bt){return E(S+"."+Rt,Bt)}for(var B=0;B{var f=Mf().getSubplotCalcData,y=jn().counterRegex,z=Qz(),P=MA(),n=P.attr,i=P.name,a=y(i),l={};l[n]={valType:"subplotid",dflt:i,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[i],x=0;x{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Yn().extendFlat,n=Em(),i=dd(),a=xa(),l=i.line;Y.exports={mode:i.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:i.text,texttemplate:y({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:i.connectgaps,marker:i.marker,cliponaxis:P({},i.cliponaxis,{dflt:!1}),textposition:i.textposition,textfont:i.textfont,fill:P({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n(),hoverinfo:P({},a.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:i.hoveron,hovertemplate:f(),hovertemplatefallback:z(),selected:i.selected,unselected:i.unselected}}),PA=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=oy(),i=pm(),a=Pm(),l=Eg().PTS_LINESONLY,o=Nk();function c(h,m,b,x){function _(k,w){return f.coerce(h,m,o,k,w)}var A=s(h,m,x,_);if(!A){m.visible=!1;return}_("thetaunit"),_("mode",A{var f=jn(),y=Fs();Y.exports=function(z,P,n){var i={},a=n[P.subplot]._subplot,l,o;a?(l=a.radialAxis,o=a.angularAxis):(a=n[P.subplot],l=a.radialaxis,o=a.angularaxis);var c=l.c2l(z.r);i.rLabel=y.tickText(l,c,!0).text;var s=o.thetaunit==="degrees"?f.rad2deg(z.theta):z.theta;return i.thetaLabel=y.tickText(o,s,!0).text,i}}),frt=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Fs(),P=Dm(),n=ft(),i=$t(),a=_e().calcMarkerSize;Y.exports=function(l,o){for(var c=l._fullLayout,s=o.subplot,h=c[s].radialaxis,m=c[s].angularaxis,b=h.makeCalcdata(o,"r"),x=m.makeCalcdata(o,"theta"),_=o._length,A=new Array(_),d=0;d<_;d++){var k=b[d],w=x[d],D=A[d]={};f(k)&&f(w)?(D.r=k,D.theta=w):D.r=y}var E=a(o,_);return o._extremes.x=z.findExtremes(h,b,{ppad:E}),P(l,o),n(A,o),i(A,o),A}}),prt=It((et,Y)=>{var f=fo(),y=Dr().BADNUM;Y.exports=function(z,P,n){for(var i=P.layers.frontplot.select("g.scatterlayer"),a=P.xaxis,l=P.yaxis,o={xaxis:a,yaxis:l,plot:P.framework,layerClipId:P._hasClipOnAxisFalse?P.clipIds.forTraces:null},c=P.radialAxis,s=P.angularAxis,h=0;h{var f=Kf();function y(P,n,i,a){var l=f(P,n,i,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var c=P.subplot,s=o.cd[o.index],h=o.trace;if(c.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,c,o),o.hovertemplate=h.hovertemplate,l}}function z(P,n,i,a){var l=i.radialAxis,o=i.angularAxis;l._hovertitle="r",o._hovertitle="θ";var c={};c[n.subplot]={_subplot:i};var s=n._module.formatLabels(P,n,c);a.rLabel=s.rLabel,a.thetaLabel=s.thetaLabel;var h=P.hi||n.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!n.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["r","theta","text"]),x.indexOf("r")!==-1&&b(l,a.rLabel),x.indexOf("theta")!==-1&&b(o,a.thetaLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),mrt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:LA(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Nk(),supplyDefaults:PA().supplyDefaults,colorbar:Do(),formatLabels:IA(),calc:frt(),plot:prt(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:DA().hoverPoints,selectPoints:Qd(),meta:{}}}),grt=It((et,Y)=>{Y.exports=mrt()}),eO=It((et,Y)=>{var f=Nk(),{cliponaxis:y,hoveron:z}=f,P=Ve(f,["cliponaxis","hoveron"]),{connectgaps:n,line:{color:i,dash:a,width:l},fill:o,fillcolor:c,marker:s,textfont:h,textposition:m}=Lk();Y.exports=Ce(we({},P),{connectgaps:n,fill:o,fillcolor:c,line:{color:i,dash:a,editType:"calc",width:l},marker:s,textfont:h,textposition:m})}),vrt=It((et,Y)=>{var f=jn(),y=Fu(),z=PA().handleRThetaDefaults,P=Y0(),n=Lm(),i=pm(),a=Pm(),l=Eg().PTS_LINESONLY,o=eO();Y.exports=function(c,s,h,m){function b(_,A){return f.coerce(c,s,o,_,A)}var x=z(c,s,m,b);if(!x){s.visible=!1;return}b("thetaunit"),b("mode",x{var f=IA();Y.exports=function(y,z,P){var n=y.i;return"r"in y||(y.r=z._r[n]),"theta"in y||(y.theta=z._theta[n]),f(y,z,P)}}),_rt=It((et,Y)=>{var f=Dm(),y=_e().calcMarkerSize,z=zb(),P=Fs(),n=G_().TOO_MANY_POINTS;Y.exports=function(i,a){var l=i._fullLayout,o=a.subplot,c=l[o].radialaxis,s=l[o].angularaxis,h=a._r=c.makeCalcdata(a,"r"),m=a._theta=s.makeCalcdata(a,"theta"),b=a._length,x={};b{var f=sA(),y=DA().makeHoverPointText;function z(P,n,i,a){var l=P.cd,o=l[0].t,c=o.r,s=o.theta,h=f.hoverPoints(P,n,i,a);if(!(!h||h[0].index===!1)){var m=h[0];if(m.index===void 0)return h;var b=P.subplot,x=m.cd[m.index],_=m.trace;if(x.r=c[m.index],x.theta=s[m.index],!!b.isPtInside(x))return m.xLabelVal=void 0,m.yLabelVal=void 0,y(x,_,b,m),h}}Y.exports={hoverPoints:z}}),brt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:LA(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:eO(),supplyDefaults:vrt(),colorbar:Do(),formatLabels:yrt(),calc:_rt(),hoverPoints:xrt().hoverPoints,selectPoints:BD(),meta:{}}}),wrt=It((et,Y)=>{var f=cA(),y=Sr(),z=oz(),P=zD(),n=zb(),i=jn(),a=G_().TOO_MANY_POINTS,l={};Y.exports=function(o,c,s){if(s.length){var h=c.radialAxis,m=c.angularAxis,b=P(o,c);return s.forEach(function(x){if(!(!x||!x[0]||!x[0].trace)){var _=x[0],A=_.trace,d=_.t,k=A._length,w=d.r,D=d.theta,E=d.opts,I,M=w.slice(),p=D.slice();for(I=0;I=a&&(E.marker.cluster=d.tree),E.marker&&(E.markerSel.positions=E.markerUnsel.positions=E.marker.positions=g),E.line&&g.length>1&&i.extendFlat(E.line,n.linePositions(o,A,g)),E.text&&(i.extendFlat(E.text,{positions:g},n.textPosition(o,A,E.text,E.marker)),i.extendFlat(E.textSel,{positions:g},n.textPosition(o,A,E.text,E.markerSel)),i.extendFlat(E.textUnsel,{positions:g},n.textPosition(o,A,E.text,E.markerUnsel))),E.fill&&!b.fill2d&&(b.fill2d=!0),E.marker&&!b.scatter2d&&(b.scatter2d=!0),E.line&&!b.line2d&&(b.line2d=!0),E.text&&!b.glText&&(b.glText=!0),b.lineOptions.push(E.line),b.fillOptions.push(E.fill),b.markerOptions.push(E.marker),b.markerSelectedOptions.push(E.markerSel),b.markerUnselectedOptions.push(E.markerUnsel),b.textOptions.push(E.text),b.textSelectedOptions.push(E.textSel),b.textUnselectedOptions.push(E.textUnsel),b.selectBatch.push([]),b.unselectBatch.push([]),d.x=C,d.y=S,d.rawx=C,d.rawy=S,d.r=w,d.theta=D,d.positions=g,d._scene=b,d.index=b.count,b.count++}}),z(o,c,s)}},Y.exports.reglPrecompiled=l}),krt=It((et,Y)=>{var f=brt();f.plot=wrt(),Y.exports=f}),Trt=It((et,Y)=>{Y.exports=krt()}),rO=It((et,Y)=>{var{hovertemplateAttrs:f,templatefallbackAttrs:y}=nu(),z=Yn().extendFlat,P=Nk(),n=Jv();Y.exports={r:P.r,theta:P.theta,r0:P.r0,dr:P.dr,theta0:P.theta0,dtheta:P.dtheta,thetaunit:P.thetaunit,base:z({},n.base,{}),offset:z({},n.offset,{}),width:z({},n.width,{}),text:z({},n.text,{}),hovertext:z({},n.hovertext,{}),marker:i(),hoverinfo:P.hoverinfo,hovertemplate:f(),hovertemplatefallback:y(),selected:n.selected,unselected:n.unselected};function i(){var a=z({},n.marker);return delete a.cornerradius,a}}),nO=It((et,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),Srt=It((et,Y)=>{var f=jn(),y=PA().handleRThetaDefaults,z=O8(),P=rO();Y.exports=function(n,i,a,l){function o(s,h){return f.coerce(n,i,P,s,h)}var c=y(n,i,l,o);if(!c){i.visible=!1;return}o("thetaunit"),o("base"),o("offset"),o("width"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),z(n,i,o,a,l),f.coerceSelectionMarkerOpacity(i,o)}}),Crt=It((et,Y)=>{var f=jn(),y=nO();Y.exports=function(z,P,n){var i={},a;function l(s,h){return f.coerce(z[a]||{},P[a],y,s,h)}for(var o=0;o{var f=fp().hasColorscale,y=Cp(),z=jn().isArrayOrTypedArray,P=Z4(),n=Wr().setGroupPositions,i=$t(),a=ls().traceIs,l=jn().extendFlat;function o(s,h){for(var m=s._fullLayout,b=h.subplot,x=m[b].radialaxis,_=m[b].angularaxis,A=x.makeCalcdata(h,"r"),d=_.makeCalcdata(h,"theta"),k=h._length,w=new Array(k),D=A,E=d,I=0;I{var f=Br(),y=Sr(),z=jn(),P=Js(),n=EA();Y.exports=function(a,l,o){var c=a._context.staticPlot,s=l.xaxis,h=l.yaxis,m=l.radialAxis,b=l.angularAxis,x=i(l),_=l.layers.frontplot.select("g.barlayer");z.makeTraceGroups(_,o,"trace bars").each(function(){var A=f.select(this),d=z.ensureSingle(A,"g","points"),k=d.selectAll("g.point").data(z.identity);k.enter().append("g").style("vector-effect",c?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),k.exit().remove(),k.each(function(w){var D=f.select(this),E=w.rp0=m.c2p(w.s0),I=w.rp1=m.c2p(w.s1),M=w.thetag0=b.c2g(w.p0),p=w.thetag1=b.c2g(w.p1),g;if(!y(E)||!y(I)||!y(M)||!y(p)||E===I||M===p)g="M0,0Z";else{var C=m.c2g(w.s1),S=(M+p)/2;w.ct=[s.c2p(C*Math.cos(S)),h.c2p(C*Math.sin(S))],g=x(E,I,M,p)}z.ensureSingle(D,"path").attr("d",g)}),P.setClipUrl(A,l._hasClipOnAxisFalse?l.clipIds.forTraces:null,a)})};function i(a){var l=a.cxx,o=a.cyy;return a.vangles?function(c,s,h,m){var b,x;z.angleDelta(h,m)>0?(b=h,x=m):(b=m,x=h);var _=n.findEnclosingVertexAngles(b,a.vangles)[0],A=n.findEnclosingVertexAngles(x,a.vangles)[1],d=[_,(b+x)/2,A];return n.pathPolygonAnnulus(c,s,b,x,d,l,o)}:function(c,s,h,m){return z.pathAnnulus(c,s,h,m,l,o)}}}),Mrt=It((et,Y)=>{var f=hd(),y=jn(),z=Iw().getTraceColor,P=y.fillText,n=DA().makeHoverPointText,i=EA().isPtInsidePolygon;Y.exports=function(a,l,o){var c=a.cd,s=c[0].trace,h=a.subplot,m=h.radialAxis,b=h.angularAxis,x=h.vangles,_=x?i:y.isPtInsideSector,A=a.maxHoverDistance,d=b._period||2*Math.PI,k=Math.abs(m.g2p(Math.sqrt(l*l+o*o))),w=Math.atan2(o,l);m.range[0]>m.range[1]&&(w+=Math.PI);var D=function(p){return _(k,w,[p.rp0,p.rp1],[p.thetag0,p.thetag1],x)?A+Math.min(1,Math.abs(p.thetag1-p.thetag0)/d)-1+(p.rp1-k)/(p.rp1-p.rp0)-1:1/0};if(f.getClosest(c,D,a),a.index!==!1){var E=a.index,I=c[E];a.x0=a.x1=I.ct[0],a.y0=a.y1=I.ct[1];var M=y.extendFlat({},I,{r:I.s,theta:I.p});return P(I,s,a),n(M,s,h,a),a.hovertemplate=s.hovertemplate,a.color=z(s,I),a.xLabelVal=a.yLabelVal=void 0,I.s<0&&(a.idealAlign="left"),[a]}}}),Ert=It((et,Y)=>{Y.exports={moduleType:"trace",name:"barpolar",basePlotModule:LA(),categories:["polar","bar","showLegend"],attributes:rO(),layoutAttributes:nO(),supplyDefaults:Srt(),supplyLayoutDefaults:Crt(),calc:iO().calc,crossTraceCalc:iO().crossTraceCalc,plot:Art(),colorbar:Do(),formatLabels:IA(),style:Pg().style,styleOnSelect:Pg().styleOnSelect,hoverPoints:Mrt(),selectPoints:Dw(),meta:{}}}),Lrt=It((et,Y)=>{Y.exports=Ert()}),aO=It((et,Y)=>{Y.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),oO=It((et,Y)=>{var f=Sn(),y=Gf(),z=Jh().attributes,P=jn().extendFlat,n=sh().overrideAll,i=n({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=n({ticklen:y.ticklen,tickwidth:P({},y.tickwidth,{dflt:2}),tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,tickfont:y.tickfont,tickformat:y.tickformat,hoverformat:y.hoverformat,layer:y.layer},"plot","from-root"),l=P({visible:P({},y.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:P({},y.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},i,a),o=P({visible:P({},y.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:y.ticks,editType:"calc"},i,a);Y.exports={domain:z({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:f.background},realaxis:l,imaginaryaxis:o,editType:"calc"}}),Prt=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=O_(),n=Mf().getSubplotData,i=Sg(),a=q0(),l=fb(),o=G0(),c=oO(),s=aO(),h=s.axisNames,m=x(function(_){return f.isTypedArray(_)&&(_=Array.from(_)),_.slice().reverse().map(function(A){return-A}).concat([0]).concat(_)},String);function b(_,A,d,k){var w=d("bgcolor");k.bgColor=y.combine(w,k.paper_bgcolor);var D=n(k.fullData,s.name,k.id),E=k.layoutOut,I;function M(G,tt){return d(I+"."+G,tt)}for(var p=0;p{var f=Mf().getSubplotCalcData,y=jn().counterRegex,z=Qz(),P=aO(),n=P.attr,i=P.name,a=y(i),l={};l[n]={valType:"subplotid",dflt:i,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[i],x=0;x{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Yn().extendFlat,n=Em(),i=dd(),a=xa(),l=i.line;Y.exports={mode:i.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:i.text,texttemplate:y({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:i.connectgaps,marker:i.marker,cliponaxis:P({},i.cliponaxis,{dflt:!1}),textposition:i.textposition,textfont:i.textfont,fill:P({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n(),hoverinfo:P({},a.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:i.hoveron,hovertemplate:f(),hovertemplatefallback:z(),selected:i.selected,unselected:i.unselected}}),Drt=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=oy(),i=pm(),a=Pm(),l=Eg().PTS_LINESONLY,o=sO();Y.exports=function(s,h,m,b){function x(d,k){return f.coerce(s,h,o,d,k)}var _=c(s,h,b,x);if(!_){h.visible=!1;return}x("mode",_{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot;return n.realLabel=f.tickText(i.radialAxis,y.real,!0).text,n.imagLabel=f.tickText(i.angularAxis,y.imag,!0).text,n}}),Ort=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Dm(),P=ft(),n=$t(),i=_e().calcMarkerSize;Y.exports=function(a,l){for(var o=a._fullLayout,c=l.subplot,s=o[c].realaxis,h=o[c].imaginaryaxis,m=s.makeCalcdata(l,"real"),b=h.makeCalcdata(l,"imag"),x=l._length,_=new Array(x),A=0;A{var f=fo(),y=Dr().BADNUM,z=Jz(),P=z.smith;Y.exports=function(n,i,a){for(var l=i.layers.frontplot.select("g.scatterlayer"),o=i.xaxis,c=i.yaxis,s={xaxis:o,yaxis:c,plot:i.framework,layerClipId:i._hasClipOnAxisFalse?i.clipIds.forTraces:null},h=0;h{var f=Kf();function y(P,n,i,a){var l=f(P,n,i,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var c=P.subplot,s=o.cd[o.index],h=o.trace;if(c.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,c,o),o.hovertemplate=h.hovertemplate,l}}function z(P,n,i,a){var l=i.radialAxis,o=i.angularAxis;l._hovertitle="real",o._hovertitle="imag";var c={};c[n.subplot]={_subplot:i};var s=n._module.formatLabels(P,n,c);a.realLabel=s.realLabel,a.imagLabel=s.imagLabel;var h=P.hi||n.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!n.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["real","imag","text"]),x.indexOf("real")!==-1&&b(l,a.realLabel),x.indexOf("imag")!==-1&&b(o,a.imagLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),Frt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"scattersmith",basePlotModule:Irt(),categories:["smith","symbols","showLegend","scatter-like"],attributes:sO(),supplyDefaults:Drt(),colorbar:Do(),formatLabels:zrt(),calc:Ort(),plot:Brt(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:Rrt().hoverPoints,selectPoints:Qd(),meta:{}}}),Nrt=It((et,Y)=>{Y.exports=Frt()}),A0=It((et,Y)=>{var f=Yf();function y(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}f(y.prototype,{instance:function(l,o){l=(l||"gregorian").toLowerCase(),o=o||"";var c=this._localCals[l+"-"+o];if(!c&&this.calendars[l]&&(c=new this.calendars[l](o),this._localCals[l+"-"+o]=c),!c)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,l);return c},newDate:function(l,o,c,s,h){return s=(l!=null&&l.year?l.calendar():typeof s=="string"?this.instance(s,h):s)||this.instance(),s.newDate(l,o,c)},substituteDigits:function(l){return function(o){return(o+"").replace(/[0-9]/g,function(c){return l[c]})}},substituteChineseDigits:function(l,o){return function(c){for(var s="",h=0;c>0;){var m=c%10;s=(m===0?"":l[m]+o[h])+s,h++,c=Math.floor(c/10)}return s.indexOf(l[1]+o[1])===0&&(s=s.substr(1)),s||l[0]}}});function z(l,o,c,s){if(this._calendar=l,this._year=o,this._month=c,this._day=s,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function P(l,o){return l=""+l,"000000".substring(0,o-l.length)+l}f(z.prototype,{newDate:function(l,o,c){return this._calendar.newDate(l??this,o,c)},year:function(l){return arguments.length===0?this._year:this.set(l,"y")},month:function(l){return arguments.length===0?this._month:this.set(l,"m")},day:function(l){return arguments.length===0?this._day:this.set(l,"d")},date:function(l,o,c){if(!this._calendar.isValid(l,o,c))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=l,this._month=o,this._day=c,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(l,o){return this._calendar.add(this,l,o)},set:function(l,o){return this._calendar.set(this,l,o)},compareTo:function(l){if(this._calendar.name!==l._calendar.name)throw(a.local.differentCalendars||a.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,l._calendar.local.name);var o=this._year!==l._year?this._year-l._year:this._month!==l._month?this.monthOfYear()-l.monthOfYear():this._day-l._day;return o===0?0:o<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(l){return this._calendar.fromJD(l)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(l){return this._calendar.fromJSDate(l)},toString:function(){return(this.year()<0?"-":"")+P(Math.abs(this.year()),4)+"-"+P(this.month(),2)+"-"+P(this.day(),2)}});function n(){this.shortYearCutoff="+10"}f(n.prototype,{_validateLevel:0,newDate:function(l,o,c){return l==null?this.today():(l.year&&(this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate),c=l.day(),o=l.month(),l=l.year()),new z(this,l,o,c))},today:function(){return this.fromJSDate(new Date)},epoch:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return o.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return(o.year()<0?"-":"")+P(Math.abs(o.year()),4)},monthsInYear:function(l){return this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear),12},monthOfYear:function(l,o){var c=this._validate(l,o,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth);return(c.month()+this.monthsInYear(c)-this.firstMonth)%this.monthsInYear(c)+this.minMonth},fromMonthOfYear:function(l,o){var c=(o+this.firstMonth-2*this.minMonth)%this.monthsInYear(l)+this.minMonth;return this._validate(l,c,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth),c},daysInYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return this.leapYear(o)?366:365},dayOfYear:function(l,o,c){var s=this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate);return s.toJD()-this.newDate(s.year(),this.fromMonthOfYear(s.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(l,o,c){var s=this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(s))+2)%this.daysInWeek()},extraInfo:function(l,o,c){return this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate),{}},add:function(l,o,c){return this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate),this._correctAdd(l,this._add(l,o,c),o,c)},_add:function(l,o,c){if(this._validateLevel++,c==="d"||c==="w"){var s=l.toJD()+o*(c==="w"?this.daysInWeek():1),h=l.calendar().fromJD(s);return this._validateLevel--,[h.year(),h.month(),h.day()]}try{var m=l.year()+(c==="y"?o:0),b=l.monthOfYear()+(c==="m"?o:0),h=l.day(),x=function(d){for(;bk-1+d.minMonth;)m++,b-=k,k=d.monthsInYear(m)};c==="y"?(l.month()!==this.fromMonthOfYear(m,b)&&(b=this.newDate(m,l.month(),this.minDay).monthOfYear()),b=Math.min(b,this.monthsInYear(m)),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b)))):c==="m"&&(x(this),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b))));var _=[m,this.fromMonthOfYear(m,b),h];return this._validateLevel--,_}catch(A){throw this._validateLevel--,A}},_correctAdd:function(l,o,c,s){if(!this.hasYearZero&&(s==="y"||s==="m")&&(o[0]===0||l.year()>0!=o[0]>0)){var h={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[s],m=c<0?-1:1;o=this._add(l,c*h[0]+m*h[1],h[2])}return l.date(o[0],o[1],o[2])},set:function(l,o,c){this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate);var s=c==="y"?o:l.year(),h=c==="m"?o:l.month(),m=c==="d"?o:l.day();return(c==="y"||c==="m")&&(m=Math.min(m,this.daysInMonth(s,h))),l.date(s,h,m)},isValid:function(l,o,c){this._validateLevel++;var s=this.hasYearZero||l!==0;if(s){var h=this.newDate(l,o,this.minDay);s=o>=this.minMonth&&o-this.minMonth=this.minDay&&c-this.minDay13.5?13:1),A=h-(_>2.5?4716:4715);return A<=0&&A--,this.newDate(A,_,x)},toJSDate:function(l,o,c){var s=this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate),h=new Date(s.year(),s.month()-1,s.day());return h.setHours(0),h.setMinutes(0),h.setSeconds(0),h.setMilliseconds(0),h.setHours(h.getHours()>12?h.getHours()+2:0),h},fromJSDate:function(l){return this.newDate(l.getFullYear(),l.getMonth()+1,l.getDate())}});var a=Y.exports=new y;a.cdate=z,a.baseCalendar=n,a.calendars.gregorian=i}),jrt=It(()=>{var et=Yf(),Y=A0();et(Y.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),Y.local=Y.regionalOptions[""],et(Y.cdate.prototype,{formatDate:function(f,y){return typeof f!="string"&&(y=f,f=""),this._calendar.formatDate(f||"",this,y)}}),et(Y.baseCalendar.prototype,{UNIX_EPOCH:Y.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:Y.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(f,y,z){if(typeof f!="string"&&(z=y,y=f,f=""),!y)return"";if(y.calendar()!==this)throw Y.local.invalidFormat||Y.regionalOptions[""].invalidFormat;f=f||this.local.dateFormat,z=z||{};for(var P=z.dayNamesShort||this.local.dayNamesShort,n=z.dayNames||this.local.dayNames,i=z.monthNumbers||this.local.monthNumbers,a=z.monthNamesShort||this.local.monthNamesShort,l=z.monthNames||this.local.monthNames,o=z.calculateWeek||this.local.calculateWeek,c=function(D,E){for(var I=1;w+I1},s=function(D,E,I,M){var p=""+E;if(c(D,M))for(;p.length1},k=function(N,B){var U=d(N,B),V=[2,3,U?4:2,U?4:2,10,11,20]["oyYJ@!".indexOf(N)+1],W=new RegExp("^-?\\d{1,"+V+"}"),F=y.substring(p).match(W);if(!F)throw(Y.local.missingNumberAt||Y.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=F[0].length,parseInt(F[0],10)},w=this,D=function(){if(typeof l=="function"){d("m");var N=l.call(w,y.substring(p));return p+=N.length,N}return k("m")},E=function(N,B,U,V){for(var W=d(N,V)?U:B,F=0;F-1){m=1,b=x;for(var S=this.daysInMonth(h,m);b>S;S=this.daysInMonth(h,m))m++,b-=S}return s>-1?this.fromJD(s):this.newDate(h,m,b)},determineDate:function(f,y,z,P,n){z&&typeof z!="object"&&(n=P,P=z,z=null),typeof P!="string"&&(n=P,P="");var i=this,a=function(l){try{return i.parseDate(P,l,n)}catch{}l=l.toLowerCase();for(var o=(l.match(/^c/)&&z?z.newDate():null)||i.today(),c=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=c.exec(l);s;)o.add(parseInt(s[1],10),s[2]||"d"),s=c.exec(l);return o};return y=y?y.newDate():null,f=f==null?y:typeof f=="string"?a(f):typeof f=="number"?isNaN(f)||f===1/0||f===-1/0?y:i.today().add(f,"d"):i.newDate(f),f}})}),Urt=It(()=>{var et=A0(),Y=Yf(),f=et.instance();function y(s){this.local=this.regionalOptions[s||""]||this.regionalOptions[""]}y.prototype=new et.baseCalendar,Y(y.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(s,h){if(typeof s=="string"){var m=s.match(P);return m?m[0]:""}var b=this._validateYear(s),x=s.month(),_=""+this.toChineseMonth(b,x);return h&&_.length<2&&(_="0"+_),this.isIntercalaryMonth(b,x)&&(_+="i"),_},monthNames:function(s){if(typeof s=="string"){var h=s.match(n);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},monthNamesShort:function(s){if(typeof s=="string"){var h=s.match(i);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一","二","三","四","五","六","七","八","九","十","十一","十二"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},parseMonth:function(s,h){s=this._validateYear(s);var m=parseInt(h),b;if(isNaN(m))h[0]==="闰"&&(b=!0,h=h.substring(1)),h[h.length-1]==="月"&&(h=h.substring(0,h.length-1)),m=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(h);else{var x=h[h.length-1];b=x==="i"||x==="I"}var _=this.toMonthIndex(s,m,b);return _},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(s,h){if(s.year&&(s=s.year()),typeof s!="number"||s<1888||s>2111)throw h.replace(/\{0\}/,this.local.name);return s},toMonthIndex:function(s,h,m){var b=this.intercalaryMonth(s),x=m&&h!==b;if(x||h<1||h>12)throw et.local.invalidMonth.replace(/\{0\}/,this.local.name);var _;return b?!m&&h<=b?_=h-1:_=h:_=h-1,_},toChineseMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s),b=m?12:11;if(h<0||h>b)throw et.local.invalidMonth.replace(/\{0\}/,this.local.name);var x;return m?h>13;return m},isIntercalaryMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s);return!!m&&m===h},leapYear:function(s){return this.intercalaryMonth(s)!==0},weekOfYear:function(s,h,m){var b=this._validateYear(s,et.local.invalidyear),x=l[b-l[0]],_=x>>9&4095,A=x>>5&15,d=x&31,k;k=f.newDate(_,A,d),k.add(4-(k.dayOfWeek()||7),"d");var w=this.toJD(s,h,m)-k.toJD();return 1+Math.floor(w/7)},monthsInYear:function(s){return this.leapYear(s)?13:12},daysInMonth:function(s,h){s.year&&(h=s.month(),s=s.year()),s=this._validateYear(s);var m=a[s-a[0]],b=m>>13,x=b?12:11;if(h>x)throw et.local.invalidMonth.replace(/\{0\}/,this.local.name);var _=m&1<<12-h?30:29;return _},weekDay:function(s,h,m){return(this.dayOfWeek(s,h,m)||7)<6},toJD:function(s,h,m){var b=this._validate(s,_,m,et.local.invalidDate);s=this._validateYear(b.year()),h=b.month(),m=b.day();var x=this.isIntercalaryMonth(s,h),_=this.toChineseMonth(s,h),A=c(s,_,m,x);return f.toJD(A.year,A.month,A.day)},fromJD:function(s){var h=f.fromJD(s),m=o(h.year(),h.month(),h.day()),b=this.toMonthIndex(m.year,m.month,m.isIntercalary);return this.newDate(m.year,b,m.day)},fromString:function(s){var h=s.match(z),m=this._validateYear(+h[1]),b=+h[2],x=!!h[3],_=this.toMonthIndex(m,b,x),A=+h[4];return this.newDate(m,_,A)},add:function(s,h,m){var b=s.year(),x=s.month(),_=this.isIntercalaryMonth(b,x),A=this.toChineseMonth(b,x),d=Object.getPrototypeOf(y.prototype).add.call(this,s,h,m);if(m==="y"){var k=d.year(),w=d.month(),D=this.isIntercalaryMonth(k,A),E=_&&D?this.toMonthIndex(k,A,!0):this.toMonthIndex(k,A,!1);E!==w&&d.month(E)}return d}});var z=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,P=/^\d?\d[iI]?/m,n=/^闰?十?[一二三四五六七八九]?月/m,i=/^闰?十?[一二三四五六七八九]?/m;et.calendars.chinese=y;var a=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],l=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function o(s,h,m,b){var x,_;if(typeof s=="object")x=s,_=h||{};else{var A=typeof s=="number"&&s>=1888&&s<=2111;if(!A)throw new Error("Solar year outside range 1888-2111");var d=typeof h=="number"&&h>=1&&h<=12;if(!d)throw new Error("Solar month outside range 1 - 12");var k=typeof m=="number"&&m>=1&&m<=31;if(!k)throw new Error("Solar day outside range 1 - 31");x={year:s,month:h,day:m},_={}}var w=l[x.year-l[0]],D=x.year<<9|x.month<<5|x.day;_.year=D>=w?x.year:x.year-1,w=l[_.year-l[0]];var E=w>>9&4095,I=w>>5&15,M=w&31,p,g=new Date(E,I-1,M),C=new Date(x.year,x.month-1,x.day);p=Math.round((C-g)/(24*3600*1e3));var S=a[_.year-a[0]],N;for(N=0;N<13;N++){var B=S&1<<12-N?30:29;if(p>13;return!U||N=1888&&s<=2111;if(!d)throw new Error("Lunar year outside range 1888-2111");var k=typeof h=="number"&&h>=1&&h<=12;if(!k)throw new Error("Lunar month outside range 1 - 12");var w=typeof m=="number"&&m>=1&&m<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var D;typeof b=="object"?(D=!1,_=b):(D=!!b,_={}),A={year:s,month:h,day:m,isIntercalary:D}}var E;E=A.day-1;var I=a[A.year-a[0]],M=I>>13,p;M&&(A.month>M||A.isIntercalary)?p=A.month:p=A.month-1;for(var g=0;g>9&4095,B=S>>5&15,U=S&31,V=new Date(N,B-1,U+E);return _.year=V.getFullYear(),_.month=1+V.getMonth(),_.day=V.getDate(),_}}),$rt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,et.local.invalidYear||et.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),y<0&&y++,n.day()+(n.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var n=Math.floor(z/30)+1,i=z-(n-1)*30+1;return this.newDate(P,n,i)}}),et.calendars.coptic=f}),Hrt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),!1},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),13},daysInYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),400},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/8)+1},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return(i.day()+1)%8},weekDay:function(z,P,n){var i=this.dayOfWeek(z,P,n);return i>=2&&i<=6},extraInfo:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return{century:y[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return z=i.year()+(i.year()<0?1:0),P=i.month(),n=i.day(),n+(P>1?16:0)+(P>2?(P-2)*32:0)+(z-1)*400+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z+.5)-Math.floor(this.jdEpoch)-1;var P=Math.floor(z/400)+1;z-=(P-1)*400,z+=z>15?16:0;var n=Math.floor(z/32)+1,i=z-(n-1)*32+1;return this.newDate(P<=0?P-1:P,n,i)}});var y={20:"Fruitbat",21:"Anchovy"};et.calendars.discworld=f}),Vrt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,et.local.invalidYear||et.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),y<0&&y++,n.day()+(n.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var n=Math.floor(z/30)+1,i=z-(n-1)*30+1;return this.newDate(P,n,i)}}),et.calendars.ethiopian=f}),Wrt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return this._leapYear(P.year())},_leapYear:function(z){return z=z<0?z+1:z,y(z*7+1,19)<7},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),this._leapYear(z.year?z.year():z)?13:12},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return z=P.year(),this.toJD(z===-1?1:z+1,7,1)-this.toJD(z,7,1)},daysInMonth:function(z,P){return z.year&&(P=z.month(),z=z.year()),this._validate(z,P,this.minDay,et.local.invalidMonth),P===12&&this.leapYear(z)||P===8&&y(this.daysInYear(z),10)===5?30:P===9&&y(this.daysInYear(z),10)===3?29:this.daysPerMonth[P-1]},weekDay:function(z,P,n){return this.dayOfWeek(z,P,n)!==6},extraInfo:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);z=i.year(),P=i.month(),n=i.day();var a=z<=0?z+1:z,l=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(P<7){for(var o=7;o<=this.monthsInYear(z);o++)l+=this.daysInMonth(z,o);for(var o=1;o=this.toJD(P===-1?1:P+1,7,1);)P++;for(var n=zthis.toJD(P,n,this.daysInMonth(P,n));)n++;var i=z-this.toJD(P,n,1)+1;return this.newDate(P,n,i)}});function y(z,P){return z-P*Math.floor(z/P)}et.calendars.hebrew=f}),qrt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,et.local.invalidYear);return(z.year()*11+14)%30<11},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(y){return this.leapYear(y)?355:354},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===12&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==5},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),z=n.month(),P=n.day(),y=y<=0?y+1:y,P+Math.ceil(29.5*(z-1))+(y-1)*354+Math.floor((3+11*y)/30)+this.jdEpoch-1},fromJD:function(y){y=Math.floor(y)+.5;var z=Math.floor((30*(y-this.jdEpoch)+10646)/10631);z=z<=0?z-1:z;var P=Math.min(12,Math.ceil((y-29-this.toJD(z,1,1))/29.5)+1),n=y-this.toJD(z,P,1)+1;return this.newDate(z,P,n)}}),et.calendars.islamic=f}),Grt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),P=z.year()<0?z.year()+1:z.year();return P%4===0},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===2&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),z=n.month(),P=n.day(),y<0&&y++,z<=2&&(y--,z+=12),Math.floor(365.25*(y+4716))+Math.floor(30.6001*(z+1))+P-1524.5},fromJD:function(y){var z=Math.floor(y+.5),P=z+1524,n=Math.floor((P-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((P-i)/30.6001),l=a-Math.floor(a<14?1:13),o=n-Math.floor(l>2?4716:4715),c=P-i-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,l,c)}}),et.calendars.julian=f}),Zrt=It(()=>{var et=A0(),Y=Yf();function f(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(P){return this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),!1},formatYear:function(P){var n=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear);P=n.year();var i=Math.floor(P/400);P=P%400,P+=P<0?400:0;var a=Math.floor(P/20);return i+"."+a+"."+P%20},forYear:function(P){if(P=P.split("."),P.length<3)throw"Invalid Mayan year";for(var n=0,i=0;i19||i>0&&a<0)throw"Invalid Mayan year";n=n*20+a}return n},monthsInYear:function(P){return this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),18},weekOfYear:function(P,n,i){return this._validate(P,n,i,et.local.invalidDate),0},daysInYear:function(P){return this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),360},daysInMonth:function(P,n){return this._validate(P,n,this.minDay,et.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(P,n,i){var a=this._validate(P,n,i,et.local.invalidDate);return a.day()},weekDay:function(P,n,i){return this._validate(P,n,i,et.local.invalidDate),!0},extraInfo:function(P,n,i){var a=this._validate(P,n,i,et.local.invalidDate),l=a.toJD(),o=this._toHaab(l),c=this._toTzolkin(l);return{haabMonthName:this.local.haabMonths[o[0]-1],haabMonth:o[0],haabDay:o[1],tzolkinDayName:this.local.tzolkinMonths[c[0]-1],tzolkinDay:c[0],tzolkinTrecena:c[1]}},_toHaab:function(P){P-=this.jdEpoch;var n=y(P+8+340,365);return[Math.floor(n/20)+1,y(n,20)]},_toTzolkin:function(P){return P-=this.jdEpoch,[z(P+20,20),z(P+4,13)]},toJD:function(P,n,i){var a=this._validate(P,n,i,et.local.invalidDate);return a.day()+a.month()*20+a.year()*360+this.jdEpoch},fromJD:function(P){P=Math.floor(P)+.5-this.jdEpoch;var n=Math.floor(P/360);P=P%360,P+=P<0?360:0;var i=Math.floor(P/20),a=P%20;return this.newDate(n,i,a)}});function y(P,n){return P-n*Math.floor(P/n)}function z(P,n){return y(P-1,n)+1}et.calendars.mayan=f}),Krt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar;var y=et.instance("gregorian");Y(f.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear||et.regionalOptions[""].invalidYear);return y.leapYear(P.year()+(P.year()<1?1:0)+1469)},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(1-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===12&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return(this.dayOfWeek(z,P,n)||7)<6},toJD:function(a,P,n){var i=this._validate(a,P,n,et.local.invalidMonth),a=i.year();a<0&&a++;for(var l=i.day(),o=1;o=this.toJD(P+1,1,1);)P++;for(var n=z-Math.floor(this.toJD(P,1,1)+.5)+1,i=1;n>this.daysInMonth(P,i);)n-=this.daysInMonth(P,i),i++;return this.newDate(P,i,n)}}),et.calendars.nanakshahi=f}),Yrt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(y){return this.daysInYear(y)!==this.daysPerYear},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,et.local.invalidYear);if(y=z.year(),typeof this.NEPALI_CALENDAR_DATA[y]>"u")return this.daysPerYear;for(var P=0,n=this.minMonth;n<=12;n++)P+=this.NEPALI_CALENDAR_DATA[y][n];return P},daysInMonth:function(y,z){return y.year&&(z=y.month(),y=y.year()),this._validate(y,z,this.minDay,et.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[y]>"u"?this.daysPerMonth[z-1]:this.NEPALI_CALENDAR_DATA[y][z]},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);y=n.year(),z=n.month(),P=n.day();var i=et.instance(),a=0,l=z,o=y;this._createMissingCalendarData(y);var c=y-(l>9||l===9&&P>=this.NEPALI_CALENDAR_DATA[o][0]?56:57);for(z!==9&&(a=P,l--);l!==9;)l<=0&&(l=12,o--),a+=this.NEPALI_CALENDAR_DATA[o][l],l--;return z===9?(a+=P-this.NEPALI_CALENDAR_DATA[o][0],a<0&&(a+=i.daysInYear(c))):a+=this.NEPALI_CALENDAR_DATA[o][9]-this.NEPALI_CALENDAR_DATA[o][0],i.newDate(c,1,1).add(a,"d").toJD()},fromJD:function(y){var z=et.instance(),P=z.fromJD(y),n=P.year(),i=P.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var l=9,o=this.NEPALI_CALENDAR_DATA[a][0],c=this.NEPALI_CALENDAR_DATA[a][l]-o+1;i>c;)l++,l>12&&(l=1,a++),c+=this.NEPALI_CALENDAR_DATA[a][l];var s=this.NEPALI_CALENDAR_DATA[a][l]-(c-i);return this.newDate(a,l,s)},_createMissingCalendarData:function(y){var z=this.daysPerMonth.slice(0);z.unshift(17);for(var P=y-1;P"u"&&(this.NEPALI_CALENDAR_DATA[P]=z)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),et.calendars.nepali=f}),Xrt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}function y(z){var P=z-475;z<0&&P++;var n=.242197,i=n*P,a=n*(P+1),l=i-Math.floor(i),o=a-Math.floor(a);return l>o}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return y(P.year())},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-((i.dayOfWeek()+1)%7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===12&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return this.dayOfWeek(z,P,n)!==5},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);z=i.year(),P=i.month(),n=i.day();var a=0;if(z>0)for(var l=1;l0?z-1:z)*365+a+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z)+.5;var P=475+(z-this.toJD(475,1,1))/365.242197,n=Math.floor(P);n<=0&&n--,z>this.toJD(n,12,y(n)?30:29)&&(n++,n===0&&n++);var i=z-this.toJD(n,1,1)+1,a=i<=186?Math.ceil(i/31):Math.ceil((i-6)/30),l=z-this.toJD(n,a,1)+1;return this.newDate(n,a,l)}}),et.calendars.persian=f,et.calendars.jalali=f}),Jrt=It(()=>{var et=A0(),Y=Yf(),f=et.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new et.baseCalendar,Y(y.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(n){var P=this._validate(n,this.minMonth,this.minDay,et.local.invalidYear),n=this._t2gYear(P.year());return f.leapYear(n)},weekOfYear:function(a,P,n){var i=this._validate(a,this.minMonth,this.minDay,et.local.invalidYear),a=this._t2gYear(i.year());return f.weekOfYear(a,i.month(),i.day())},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===2&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return(this.dayOfWeek(z,P,n)||7)<6},toJD:function(a,P,n){var i=this._validate(a,P,n,et.local.invalidDate),a=this._t2gYear(i.year());return f.toJD(a,i.month(),i.day())},fromJD:function(z){var P=f.fromJD(z),n=this._g2tYear(P.year());return this.newDate(n,P.month(),P.day())},_t2gYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)},_g2tYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)}}),et.calendars.taiwan=y}),Qrt=It(()=>{var et=A0(),Y=Yf(),f=et.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new et.baseCalendar,Y(y.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(n){var P=this._validate(n,this.minMonth,this.minDay,et.local.invalidYear),n=this._t2gYear(P.year());return f.leapYear(n)},weekOfYear:function(a,P,n){var i=this._validate(a,this.minMonth,this.minDay,et.local.invalidYear),a=this._t2gYear(i.year());return f.weekOfYear(a,i.month(),i.day())},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===2&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return(this.dayOfWeek(z,P,n)||7)<6},toJD:function(a,P,n){var i=this._validate(a,P,n,et.local.invalidDate),a=this._t2gYear(i.year());return f.toJD(a,i.month(),i.day())},fromJD:function(z){var P=f.fromJD(z),n=this._g2tYear(P.year());return this.newDate(n,P.month(),P.day())},_t2gYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)},_g2tYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)}}),et.calendars.thai=y}),tnt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return this.daysInYear(P.year())===355},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(z){for(var P=0,n=1;n<=12;n++)P+=this.daysInMonth(z,n);return P},daysInMonth:function(z,P){for(var n=this._validate(z,P,this.minDay,et.local.invalidMonth),i=n.toJD()-24e5+.5,a=0,l=0;li)return y[a]-y[a-1];a++}return 30},weekDay:function(z,P,n){return this.dayOfWeek(z,P,n)!==5},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate),a=12*(i.year()-1)+i.month()-15292,l=i.day()+y[a-1]-1;return l+24e5-.5},fromJD:function(z){for(var P=z-24e5+.5,n=0,i=0;iP);i++)n++;var a=n+15292,l=Math.floor((a-1)/12),o=l+1,c=a-12*l,s=P-y[n-1]+1;return this.newDate(o,c,s)},isValid:function(z,P,n){var i=et.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(z=z.year!=null?z.year:z,i=z>=1276&&z<=1500),i},_validate:function(z,P,n,i){var a=et.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),et.calendars.ummalqura=f;var y=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),ent=It((et,Y)=>{Y.exports=A0(),jrt(),Urt(),$rt(),Hrt(),Vrt(),Wrt(),qrt(),Grt(),Zrt(),Krt(),Yrt(),Xrt(),Jrt(),Qrt(),tnt()}),rnt=It((et,Y)=>{var f=ent(),y=jn(),z=Dr(),P=z.EPOCHJD,n=z.ONEDAY,i={valType:"enumerated",values:y.sortObjectKeys(f.calendars),editType:"calc",dflt:"gregorian"},a=function(I,M,p,g){var C={};return C[p]=i,y.coerce(I,M,C,p,g)},l=function(I,M,p,g){for(var C=0;C{Y.exports=rnt()}),int=It((et,Y)=>{var f=Dq();f.register([Rq(),jq(),Vq(),Kq(),Qq(),nG(),oG(),vG(),CG(),RG(),GG(),fK(),_K(),aY(),pY(),wY(),EY(),qY(),YY(),JY(),rX(),sX(),dX(),gX(),PX(),zX(),vQ(),IQ(),WQ(),XQ(),stt(),htt(),_tt(),Itt(),Btt(),Vtt(),aet(),det(),_et(),Het(),Xet(),rrt(),srt(),hrt(),grt(),Trt(),Lrt(),Nrt(),nnt()]),Y.exports=f});return int()})();/*! +`),Ne=je.createShader(je.FRAGMENT_SHADER);if(je.isContextLost())return void(this.failedToCreate=!0);if(je.shaderSource(Ne,Pe),je.compileShader(Ne),!je.getShaderParameter(Ne,je.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${je.getShaderInfoLog(Ne)}`);je.attachShader(this.program,Ne);let Xe=je.createShader(je.VERTEX_SHADER);if(je.isContextLost())return void(this.failedToCreate=!0);if(je.shaderSource(Xe,We),je.compileShader(Xe),!je.getShaderParameter(Xe,je.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${je.getShaderInfoLog(Xe)}`);je.attachShader(this.program,Xe),this.attributes={};let Pr={};this.numAttributes=Gr.length;for(let qr=0;qr({u_depth:new i.aH(qr,Xr.u_depth),u_terrain:new i.aH(qr,Xr.u_terrain),u_terrain_dim:new i.aI(qr,Xr.u_terrain_dim),u_terrain_matrix:new i.aJ(qr,Xr.u_terrain_matrix),u_terrain_unpack:new i.aK(qr,Xr.u_terrain_unpack),u_terrain_exaggeration:new i.aI(qr,Xr.u_terrain_exaggeration)}))(O,Pr),this.binderUniforms=Dt?Dt.getUniforms(O,Pr):[]}draw(O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te,le,Te,Pe,We){let Ne=O.gl;if(this.failedToCreate)return;if(O.program.set(this.program),O.setDepthMode(Dt),O.setStencilMode(Ft),O.setColorMode(qt),O.setCullFace(Ee),er){O.activeTexture.set(Ne.TEXTURE2),Ne.bindTexture(Ne.TEXTURE_2D,er.depthTexture),O.activeTexture.set(Ne.TEXTURE3),Ne.bindTexture(Ne.TEXTURE_2D,er.texture);for(let Pr in this.terrainUniforms)this.terrainUniforms[Pr].set(er[Pr])}for(let Pr in this.fixedUniforms)this.fixedUniforms[Pr].set(je[Pr]);le&&le.setUniforms(O,this.binderUniforms,qn,{zoom:te});let Xe=0;switch(pt){case Ne.LINES:Xe=2;break;case Ne.TRIANGLES:Xe=3;break;case Ne.LINE_STRIP:Xe=1}for(let Pr of Tn.get()){let qr=Pr.vaos||(Pr.vaos={});(qr[wr]||(qr[wr]=new yr)).bind(O,this,Gr,le?le.getPaintVertexBuffers():[],Zr,Pr.vertexOffset,Te,Pe,We),Ne.drawElements(pt,Pr.primitiveLength*Xe,Ne.UNSIGNED_SHORT,Pr.primitiveOffset*Xe*2)}}}function xi(Kt,O,pt){let Dt=1/ui(pt,1,O.transform.tileZoom),Ft=Math.pow(2,pt.tileID.overscaledZ),qt=pt.tileSize*Math.pow(2,O.transform.tileZoom)/Ft,Ee=qt*(pt.tileID.canonical.x+pt.tileID.wrap*Ft),je=qt*pt.tileID.canonical.y;return{u_image:0,u_texsize:pt.imageAtlasTexture.size,u_scale:[Dt,Kt.fromScale,Kt.toScale],u_fade:Kt.t,u_pixel_coord_upper:[Ee>>16,je>>16],u_pixel_coord_lower:[65535&Ee,65535&je]}}let Jn=(Kt,O,pt,Dt)=>{let Ft=O.style.light,qt=Ft.properties.get("position"),Ee=[qt.x,qt.y,qt.z],je=function(){var wr=new i.A(9);return i.A!=Float32Array&&(wr[1]=0,wr[2]=0,wr[3]=0,wr[5]=0,wr[6]=0,wr[7]=0),wr[0]=1,wr[4]=1,wr[8]=1,wr}();Ft.properties.get("anchor")==="viewport"&&function(wr,Gr){var Zr=Math.sin(Gr),Tn=Math.cos(Gr);wr[0]=Tn,wr[1]=Zr,wr[2]=0,wr[3]=-Zr,wr[4]=Tn,wr[5]=0,wr[6]=0,wr[7]=0,wr[8]=1}(je,-O.transform.angle),function(wr,Gr,Zr){var Tn=Gr[0],qn=Gr[1],te=Gr[2];wr[0]=Tn*Zr[0]+qn*Zr[3]+te*Zr[6],wr[1]=Tn*Zr[1]+qn*Zr[4]+te*Zr[7],wr[2]=Tn*Zr[2]+qn*Zr[5]+te*Zr[8]}(Ee,Ee,je);let er=Ft.properties.get("color");return{u_matrix:Kt,u_lightpos:Ee,u_lightintensity:Ft.properties.get("intensity"),u_lightcolor:[er.r,er.g,er.b],u_vertical_gradient:+pt,u_opacity:Dt}},Gn=(Kt,O,pt,Dt,Ft,qt,Ee)=>i.e(Jn(Kt,O,pt,Dt),xi(qt,O,Ee),{u_height_factor:-Math.pow(2,Ft.overscaledZ)/Ee.tileSize/8}),pi=Kt=>({u_matrix:Kt}),Va=(Kt,O,pt,Dt)=>i.e(pi(Kt),xi(pt,O,Dt)),ea=(Kt,O)=>({u_matrix:Kt,u_world:O}),go=(Kt,O,pt,Dt,Ft)=>i.e(Va(Kt,O,pt,Dt),{u_world:Ft}),mo=(Kt,O,pt,Dt)=>{let Ft=Kt.transform,qt,Ee;if(Dt.paint.get("circle-pitch-alignment")==="map"){let je=ui(pt,1,Ft.zoom);qt=!0,Ee=[je,je]}else qt=!1,Ee=Ft.pixelsToGLUnits;return{u_camera_to_center_distance:Ft.cameraToCenterDistance,u_scale_with_map:+(Dt.paint.get("circle-pitch-scale")==="map"),u_matrix:Kt.translatePosMatrix(O.posMatrix,pt,Dt.paint.get("circle-translate"),Dt.paint.get("circle-translate-anchor")),u_pitch_with_map:+qt,u_device_pixel_ratio:Kt.pixelRatio,u_extrude_scale:Ee}},Go=(Kt,O,pt)=>({u_matrix:Kt,u_inv_matrix:O,u_camera_to_center_distance:pt.cameraToCenterDistance,u_viewport_size:[pt.width,pt.height]}),Po=(Kt,O,pt=1)=>({u_matrix:Kt,u_color:O,u_overlay:0,u_overlay_scale:pt}),Zo=Kt=>({u_matrix:Kt}),Ka=(Kt,O,pt,Dt)=>({u_matrix:Kt,u_extrude_scale:ui(O,1,pt),u_intensity:Dt}),Cs=(Kt,O,pt,Dt)=>{let Ft=i.H();i.aP(Ft,0,Kt.width,Kt.height,0,0,1);let qt=Kt.context.gl;return{u_matrix:Ft,u_world:[qt.drawingBufferWidth,qt.drawingBufferHeight],u_image:pt,u_color_ramp:Dt,u_opacity:O.paint.get("heatmap-opacity")}};function ps(Kt,O){let pt=Math.pow(2,O.canonical.z),Dt=O.canonical.y;return[new i.Z(0,Dt/pt).toLngLat().lat,new i.Z(0,(Dt+1)/pt).toLngLat().lat]}let wl=(Kt,O,pt,Dt)=>{let Ft=Kt.transform;return{u_matrix:ul(Kt,O,pt,Dt),u_ratio:1/ui(O,1,Ft.zoom),u_device_pixel_ratio:Kt.pixelRatio,u_units_to_pixels:[1/Ft.pixelsToGLUnits[0],1/Ft.pixelsToGLUnits[1]]}},is=(Kt,O,pt,Dt,Ft)=>i.e(wl(Kt,O,pt,Ft),{u_image:0,u_image_height:Dt}),ol=(Kt,O,pt,Dt,Ft)=>{let qt=Kt.transform,Ee=kl(O,qt);return{u_matrix:ul(Kt,O,pt,Ft),u_texsize:O.imageAtlasTexture.size,u_ratio:1/ui(O,1,qt.zoom),u_device_pixel_ratio:Kt.pixelRatio,u_image:0,u_scale:[Ee,Dt.fromScale,Dt.toScale],u_fade:Dt.t,u_units_to_pixels:[1/qt.pixelsToGLUnits[0],1/qt.pixelsToGLUnits[1]]}},ms=(Kt,O,pt,Dt,Ft,qt)=>{let Ee=Kt.lineAtlas,je=kl(O,Kt.transform),er=pt.layout.get("line-cap")==="round",wr=Ee.getDash(Dt.from,er),Gr=Ee.getDash(Dt.to,er),Zr=wr.width*Ft.fromScale,Tn=Gr.width*Ft.toScale;return i.e(wl(Kt,O,pt,qt),{u_patternscale_a:[je/Zr,-wr.height/2],u_patternscale_b:[je/Tn,-Gr.height/2],u_sdfgamma:Ee.width/(256*Math.min(Zr,Tn)*Kt.pixelRatio)/2,u_image:0,u_tex_y_a:wr.y,u_tex_y_b:Gr.y,u_mix:Ft.t})};function kl(Kt,O){return 1/ui(Kt,1,O.tileZoom)}function ul(Kt,O,pt,Dt){return Kt.translatePosMatrix(Dt?Dt.posMatrix:O.tileID.posMatrix,O,pt.paint.get("line-translate"),pt.paint.get("line-translate-anchor"))}let Kl=(Kt,O,pt,Dt,Ft)=>{return{u_matrix:Kt,u_tl_parent:O,u_scale_parent:pt,u_buffer_scale:1,u_fade_t:Dt.mix,u_opacity:Dt.opacity*Ft.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ft.paint.get("raster-brightness-min"),u_brightness_high:Ft.paint.get("raster-brightness-max"),u_saturation_factor:(Ee=Ft.paint.get("raster-saturation"),Ee>0?1-1/(1.001-Ee):-Ee),u_contrast_factor:(qt=Ft.paint.get("raster-contrast"),qt>0?1/(1-qt):1+qt),u_spin_weights:vs(Ft.paint.get("raster-hue-rotate"))};var qt,Ee};function vs(Kt){Kt*=Math.PI/180;let O=Math.sin(Kt),pt=Math.cos(Kt);return[(2*pt+1)/3,(-Math.sqrt(3)*O-pt+1)/3,(Math.sqrt(3)*O-pt+1)/3]}let Ns=(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn)=>{let te=Ee.transform;return{u_is_size_zoom_constant:+(Kt==="constant"||Kt==="source"),u_is_size_feature_constant:+(Kt==="constant"||Kt==="camera"),u_size_t:O?O.uSizeT:0,u_size:O?O.uSize:0,u_camera_to_center_distance:te.cameraToCenterDistance,u_pitch:te.pitch/360*2*Math.PI,u_rotate_symbol:+pt,u_aspect_ratio:te.width/te.height,u_fade_change:Ee.options.fadeDuration?Ee.symbolFadeChange:1,u_matrix:je,u_label_plane_matrix:er,u_coord_matrix:wr,u_is_text:+Zr,u_pitch_with_map:+Dt,u_is_along_line:Ft,u_is_variable_anchor:qt,u_texsize:Tn,u_texture:0,u_translation:Gr,u_pitched_scale:qn}},Uo=(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn,te)=>{let le=Ee.transform;return i.e(Ns(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,te),{u_gamma_scale:Dt?Math.cos(le._pitch)*le.cameraToCenterDistance:1,u_device_pixel_ratio:Ee.pixelRatio,u_is_halo:1})},Ds=(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,Zr,Tn,qn)=>i.e(Uo(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr,Gr,!0,Zr,!0,qn),{u_texsize_icon:Tn,u_texture_icon:1}),Ol=(Kt,O,pt)=>({u_matrix:Kt,u_opacity:O,u_color:pt}),tc=(Kt,O,pt,Dt,Ft,qt)=>i.e(function(Ee,je,er,wr){let Gr=er.imageManager.getPattern(Ee.from.toString()),Zr=er.imageManager.getPattern(Ee.to.toString()),{width:Tn,height:qn}=er.imageManager.getPixelSize(),te=Math.pow(2,wr.tileID.overscaledZ),le=wr.tileSize*Math.pow(2,er.transform.tileZoom)/te,Te=le*(wr.tileID.canonical.x+wr.tileID.wrap*te),Pe=le*wr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Gr.tl,u_pattern_br_a:Gr.br,u_pattern_tl_b:Zr.tl,u_pattern_br_b:Zr.br,u_texsize:[Tn,qn],u_mix:je.t,u_pattern_size_a:Gr.displaySize,u_pattern_size_b:Zr.displaySize,u_scale_a:je.fromScale,u_scale_b:je.toScale,u_tile_units_to_pixels:1/ui(wr,1,er.transform.tileZoom),u_pixel_coord_upper:[Te>>16,Pe>>16],u_pixel_coord_lower:[65535&Te,65535&Pe]}}(Dt,qt,pt,Ft),{u_matrix:Kt,u_opacity:O}),sc={fillExtrusion:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_lightpos:new i.aN(Kt,O.u_lightpos),u_lightintensity:new i.aI(Kt,O.u_lightintensity),u_lightcolor:new i.aN(Kt,O.u_lightcolor),u_vertical_gradient:new i.aI(Kt,O.u_vertical_gradient),u_opacity:new i.aI(Kt,O.u_opacity)}),fillExtrusionPattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_lightpos:new i.aN(Kt,O.u_lightpos),u_lightintensity:new i.aI(Kt,O.u_lightintensity),u_lightcolor:new i.aN(Kt,O.u_lightcolor),u_vertical_gradient:new i.aI(Kt,O.u_vertical_gradient),u_height_factor:new i.aI(Kt,O.u_height_factor),u_image:new i.aH(Kt,O.u_image),u_texsize:new i.aO(Kt,O.u_texsize),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade),u_opacity:new i.aI(Kt,O.u_opacity)}),fill:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix)}),fillPattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_image:new i.aH(Kt,O.u_image),u_texsize:new i.aO(Kt,O.u_texsize),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade)}),fillOutline:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_world:new i.aO(Kt,O.u_world)}),fillOutlinePattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_world:new i.aO(Kt,O.u_world),u_image:new i.aH(Kt,O.u_image),u_texsize:new i.aO(Kt,O.u_texsize),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade)}),circle:(Kt,O)=>({u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_scale_with_map:new i.aH(Kt,O.u_scale_with_map),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_extrude_scale:new i.aO(Kt,O.u_extrude_scale),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_matrix:new i.aJ(Kt,O.u_matrix)}),collisionBox:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_pixel_extrude_scale:new i.aO(Kt,O.u_pixel_extrude_scale)}),collisionCircle:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_inv_matrix:new i.aJ(Kt,O.u_inv_matrix),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_viewport_size:new i.aO(Kt,O.u_viewport_size)}),debug:(Kt,O)=>({u_color:new i.aL(Kt,O.u_color),u_matrix:new i.aJ(Kt,O.u_matrix),u_overlay:new i.aH(Kt,O.u_overlay),u_overlay_scale:new i.aI(Kt,O.u_overlay_scale)}),clippingMask:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix)}),heatmap:(Kt,O)=>({u_extrude_scale:new i.aI(Kt,O.u_extrude_scale),u_intensity:new i.aI(Kt,O.u_intensity),u_matrix:new i.aJ(Kt,O.u_matrix)}),heatmapTexture:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_world:new i.aO(Kt,O.u_world),u_image:new i.aH(Kt,O.u_image),u_color_ramp:new i.aH(Kt,O.u_color_ramp),u_opacity:new i.aI(Kt,O.u_opacity)}),hillshade:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_image:new i.aH(Kt,O.u_image),u_latrange:new i.aO(Kt,O.u_latrange),u_light:new i.aO(Kt,O.u_light),u_shadow:new i.aL(Kt,O.u_shadow),u_highlight:new i.aL(Kt,O.u_highlight),u_accent:new i.aL(Kt,O.u_accent)}),hillshadePrepare:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_image:new i.aH(Kt,O.u_image),u_dimension:new i.aO(Kt,O.u_dimension),u_zoom:new i.aI(Kt,O.u_zoom),u_unpack:new i.aK(Kt,O.u_unpack)}),line:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels)}),lineGradient:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels),u_image:new i.aH(Kt,O.u_image),u_image_height:new i.aI(Kt,O.u_image_height)}),linePattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_texsize:new i.aO(Kt,O.u_texsize),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_image:new i.aH(Kt,O.u_image),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels),u_scale:new i.aN(Kt,O.u_scale),u_fade:new i.aI(Kt,O.u_fade)}),lineSDF:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ratio:new i.aI(Kt,O.u_ratio),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_units_to_pixels:new i.aO(Kt,O.u_units_to_pixels),u_patternscale_a:new i.aO(Kt,O.u_patternscale_a),u_patternscale_b:new i.aO(Kt,O.u_patternscale_b),u_sdfgamma:new i.aI(Kt,O.u_sdfgamma),u_image:new i.aH(Kt,O.u_image),u_tex_y_a:new i.aI(Kt,O.u_tex_y_a),u_tex_y_b:new i.aI(Kt,O.u_tex_y_b),u_mix:new i.aI(Kt,O.u_mix)}),raster:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_tl_parent:new i.aO(Kt,O.u_tl_parent),u_scale_parent:new i.aI(Kt,O.u_scale_parent),u_buffer_scale:new i.aI(Kt,O.u_buffer_scale),u_fade_t:new i.aI(Kt,O.u_fade_t),u_opacity:new i.aI(Kt,O.u_opacity),u_image0:new i.aH(Kt,O.u_image0),u_image1:new i.aH(Kt,O.u_image1),u_brightness_low:new i.aI(Kt,O.u_brightness_low),u_brightness_high:new i.aI(Kt,O.u_brightness_high),u_saturation_factor:new i.aI(Kt,O.u_saturation_factor),u_contrast_factor:new i.aI(Kt,O.u_contrast_factor),u_spin_weights:new i.aN(Kt,O.u_spin_weights)}),symbolIcon:(Kt,O)=>({u_is_size_zoom_constant:new i.aH(Kt,O.u_is_size_zoom_constant),u_is_size_feature_constant:new i.aH(Kt,O.u_is_size_feature_constant),u_size_t:new i.aI(Kt,O.u_size_t),u_size:new i.aI(Kt,O.u_size),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_pitch:new i.aI(Kt,O.u_pitch),u_rotate_symbol:new i.aH(Kt,O.u_rotate_symbol),u_aspect_ratio:new i.aI(Kt,O.u_aspect_ratio),u_fade_change:new i.aI(Kt,O.u_fade_change),u_matrix:new i.aJ(Kt,O.u_matrix),u_label_plane_matrix:new i.aJ(Kt,O.u_label_plane_matrix),u_coord_matrix:new i.aJ(Kt,O.u_coord_matrix),u_is_text:new i.aH(Kt,O.u_is_text),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_is_along_line:new i.aH(Kt,O.u_is_along_line),u_is_variable_anchor:new i.aH(Kt,O.u_is_variable_anchor),u_texsize:new i.aO(Kt,O.u_texsize),u_texture:new i.aH(Kt,O.u_texture),u_translation:new i.aO(Kt,O.u_translation),u_pitched_scale:new i.aI(Kt,O.u_pitched_scale)}),symbolSDF:(Kt,O)=>({u_is_size_zoom_constant:new i.aH(Kt,O.u_is_size_zoom_constant),u_is_size_feature_constant:new i.aH(Kt,O.u_is_size_feature_constant),u_size_t:new i.aI(Kt,O.u_size_t),u_size:new i.aI(Kt,O.u_size),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_pitch:new i.aI(Kt,O.u_pitch),u_rotate_symbol:new i.aH(Kt,O.u_rotate_symbol),u_aspect_ratio:new i.aI(Kt,O.u_aspect_ratio),u_fade_change:new i.aI(Kt,O.u_fade_change),u_matrix:new i.aJ(Kt,O.u_matrix),u_label_plane_matrix:new i.aJ(Kt,O.u_label_plane_matrix),u_coord_matrix:new i.aJ(Kt,O.u_coord_matrix),u_is_text:new i.aH(Kt,O.u_is_text),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_is_along_line:new i.aH(Kt,O.u_is_along_line),u_is_variable_anchor:new i.aH(Kt,O.u_is_variable_anchor),u_texsize:new i.aO(Kt,O.u_texsize),u_texture:new i.aH(Kt,O.u_texture),u_gamma_scale:new i.aI(Kt,O.u_gamma_scale),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_is_halo:new i.aH(Kt,O.u_is_halo),u_translation:new i.aO(Kt,O.u_translation),u_pitched_scale:new i.aI(Kt,O.u_pitched_scale)}),symbolTextAndIcon:(Kt,O)=>({u_is_size_zoom_constant:new i.aH(Kt,O.u_is_size_zoom_constant),u_is_size_feature_constant:new i.aH(Kt,O.u_is_size_feature_constant),u_size_t:new i.aI(Kt,O.u_size_t),u_size:new i.aI(Kt,O.u_size),u_camera_to_center_distance:new i.aI(Kt,O.u_camera_to_center_distance),u_pitch:new i.aI(Kt,O.u_pitch),u_rotate_symbol:new i.aH(Kt,O.u_rotate_symbol),u_aspect_ratio:new i.aI(Kt,O.u_aspect_ratio),u_fade_change:new i.aI(Kt,O.u_fade_change),u_matrix:new i.aJ(Kt,O.u_matrix),u_label_plane_matrix:new i.aJ(Kt,O.u_label_plane_matrix),u_coord_matrix:new i.aJ(Kt,O.u_coord_matrix),u_is_text:new i.aH(Kt,O.u_is_text),u_pitch_with_map:new i.aH(Kt,O.u_pitch_with_map),u_is_along_line:new i.aH(Kt,O.u_is_along_line),u_is_variable_anchor:new i.aH(Kt,O.u_is_variable_anchor),u_texsize:new i.aO(Kt,O.u_texsize),u_texsize_icon:new i.aO(Kt,O.u_texsize_icon),u_texture:new i.aH(Kt,O.u_texture),u_texture_icon:new i.aH(Kt,O.u_texture_icon),u_gamma_scale:new i.aI(Kt,O.u_gamma_scale),u_device_pixel_ratio:new i.aI(Kt,O.u_device_pixel_ratio),u_is_halo:new i.aH(Kt,O.u_is_halo),u_translation:new i.aO(Kt,O.u_translation),u_pitched_scale:new i.aI(Kt,O.u_pitched_scale)}),background:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_opacity:new i.aI(Kt,O.u_opacity),u_color:new i.aL(Kt,O.u_color)}),backgroundPattern:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_opacity:new i.aI(Kt,O.u_opacity),u_image:new i.aH(Kt,O.u_image),u_pattern_tl_a:new i.aO(Kt,O.u_pattern_tl_a),u_pattern_br_a:new i.aO(Kt,O.u_pattern_br_a),u_pattern_tl_b:new i.aO(Kt,O.u_pattern_tl_b),u_pattern_br_b:new i.aO(Kt,O.u_pattern_br_b),u_texsize:new i.aO(Kt,O.u_texsize),u_mix:new i.aI(Kt,O.u_mix),u_pattern_size_a:new i.aO(Kt,O.u_pattern_size_a),u_pattern_size_b:new i.aO(Kt,O.u_pattern_size_b),u_scale_a:new i.aI(Kt,O.u_scale_a),u_scale_b:new i.aI(Kt,O.u_scale_b),u_pixel_coord_upper:new i.aO(Kt,O.u_pixel_coord_upper),u_pixel_coord_lower:new i.aO(Kt,O.u_pixel_coord_lower),u_tile_units_to_pixels:new i.aI(Kt,O.u_tile_units_to_pixels)}),terrain:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_texture:new i.aH(Kt,O.u_texture),u_ele_delta:new i.aI(Kt,O.u_ele_delta),u_fog_matrix:new i.aJ(Kt,O.u_fog_matrix),u_fog_color:new i.aL(Kt,O.u_fog_color),u_fog_ground_blend:new i.aI(Kt,O.u_fog_ground_blend),u_fog_ground_blend_opacity:new i.aI(Kt,O.u_fog_ground_blend_opacity),u_horizon_color:new i.aL(Kt,O.u_horizon_color),u_horizon_fog_blend:new i.aI(Kt,O.u_horizon_fog_blend)}),terrainDepth:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_ele_delta:new i.aI(Kt,O.u_ele_delta)}),terrainCoords:(Kt,O)=>({u_matrix:new i.aJ(Kt,O.u_matrix),u_texture:new i.aH(Kt,O.u_texture),u_terrain_coords_id:new i.aI(Kt,O.u_terrain_coords_id),u_ele_delta:new i.aI(Kt,O.u_ele_delta)}),sky:(Kt,O)=>({u_sky_color:new i.aL(Kt,O.u_sky_color),u_horizon_color:new i.aL(Kt,O.u_horizon_color),u_horizon:new i.aI(Kt,O.u_horizon),u_sky_horizon_blend:new i.aI(Kt,O.u_sky_horizon_blend)})};class Xs{constructor(O,pt,Dt){this.context=O;let Ft=O.gl;this.buffer=Ft.createBuffer(),this.dynamicDraw=!!Dt,this.context.unbindVAO(),O.bindElementBuffer.set(this.buffer),Ft.bufferData(Ft.ELEMENT_ARRAY_BUFFER,pt.arrayBuffer,this.dynamicDraw?Ft.DYNAMIC_DRAW:Ft.STATIC_DRAW),this.dynamicDraw||delete pt.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(O){let pt=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),pt.bufferSubData(pt.ELEMENT_ARRAY_BUFFER,0,O.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Wa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Co{constructor(O,pt,Dt,Ft){this.length=pt.length,this.attributes=Dt,this.itemSize=pt.bytesPerElement,this.dynamicDraw=Ft,this.context=O;let qt=O.gl;this.buffer=qt.createBuffer(),O.bindVertexBuffer.set(this.buffer),qt.bufferData(qt.ARRAY_BUFFER,pt.arrayBuffer,this.dynamicDraw?qt.DYNAMIC_DRAW:qt.STATIC_DRAW),this.dynamicDraw||delete pt.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(O){if(O.length!==this.length)throw new Error(`Length of new data is ${O.length}, which doesn't match current length of ${this.length}`);let pt=this.context.gl;this.bind(),pt.bufferSubData(pt.ARRAY_BUFFER,0,O.arrayBuffer)}enableAttributes(O,pt){for(let Dt=0;Dt0){let qr=i.H();i.aQ(qr,Ne.placementInvProjMatrix,Kt.transform.glCoordMatrix),i.aQ(qr,qr,Ne.placementViewportMatrix),er.push({circleArray:Pr,circleOffset:Gr,transform:We.posMatrix,invTransform:qr,coord:We}),wr+=Pr.length/4,Gr=wr}Xe&&je.draw(qt,Ee.LINES,hl.disabled,Hl.disabled,Kt.colorModeForRenderPass(),cs.disabled,{u_matrix:We.posMatrix,u_pixel_extrude_scale:[1/(Zr=Kt.transform).width,1/Zr.height]},Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(We),pt.id,Xe.layoutVertexBuffer,Xe.indexBuffer,Xe.segments,null,Kt.transform.zoom,null,null,Xe.collisionVertexBuffer)}var Zr;if(!Ft||!er.length)return;let Tn=Kt.useProgram("collisionCircle"),qn=new i.aR;qn.resize(4*wr),qn._trim();let te=0;for(let Pe of er)for(let We=0;We=0&&(Pe[Ne.associatedIconIndex]={shiftedAnchor:wo,angle:Yo})}else zr(Ne.numGlyphs,le)}if(wr){Te.clear();let We=Kt.icon.placedSymbolArray;for(let Ne=0;NeKt.style.map.terrain.getElevation(ai,ei,ra):null,ti=pt.layout.get("text-rotation-alignment")==="map";zt(Qi,ai.posMatrix,Kt,Ft,wu,Et,Pe,wr,ti,le,ai.toUnwrapped(),te.width,te.height,Vt,Bn)}let Be=ai.posMatrix,He=Ft&&gn||Ie,hr=We||He?hu:wu,cr=ih,Fr=Fa&&pt.paint.get(Ft?"text-halo-width":"icon-halo-width").constantOr(1)!==0,vn;vn=Fa?Qi.iconsInText?Ds(wo.kind,xs,Ne,Pe,We,He,Kt,Be,hr,cr,Vt,Ll,Sc,Qn):Uo(wo.kind,xs,Ne,Pe,We,He,Kt,Be,hr,cr,Vt,Ft,Ll,!0,Qn):Ns(wo.kind,xs,Ne,Pe,We,He,Kt,Be,hr,cr,Vt,Ft,Ll,Qn);let fn={program:Fo,buffers:Ma,uniformValues:vn,atlasTexture:Ws,atlasTextureIcon:rl,atlasInterpolation:zl,atlasInterpolationIcon:Fc,isSDF:Fa,hasHalo:Fr};if(Pr&&Qi.canOverlap){qr=!0;let Bn=Ma.segments.get();for(let ti of Bn)zn.push({segments:new i.a0([ti]),sortKey:ti.sortKey,state:fn,terrainData:Sl})}else zn.push({segments:Ma.segments,sortKey:0,state:fn,terrainData:Sl})}qr&&zn.sort((ai,Ti)=>ai.sortKey-Ti.sortKey);for(let ai of zn){let Ti=ai.state;if(Tn.activeTexture.set(qn.TEXTURE0),Ti.atlasTexture.bind(Ti.atlasInterpolation,qn.CLAMP_TO_EDGE),Ti.atlasTextureIcon&&(Tn.activeTexture.set(qn.TEXTURE1),Ti.atlasTextureIcon&&Ti.atlasTextureIcon.bind(Ti.atlasInterpolationIcon,qn.CLAMP_TO_EDGE)),Ti.isSDF){let Qi=Ti.uniformValues;Ti.hasHalo&&(Qi.u_is_halo=1,hf(Ti.buffers,ai.segments,pt,Kt,Ti.program,Xr,Gr,Zr,Qi,ai.terrainData)),Qi.u_is_halo=0}hf(Ti.buffers,ai.segments,pt,Kt,Ti.program,Xr,Gr,Zr,Ti.uniformValues,ai.terrainData)}}function hf(Kt,O,pt,Dt,Ft,qt,Ee,je,er,wr){let Gr=Dt.context;Ft.draw(Gr,Gr.gl.TRIANGLES,qt,Ee,je,cs.disabled,er,wr,pt.id,Kt.layoutVertexBuffer,Kt.indexBuffer,O,pt.paint,Dt.transform.zoom,Kt.programConfigurations.get(pt.id),Kt.dynamicLayoutVertexBuffer,Kt.opacityVertexBuffer)}function Ld(Kt,O,pt,Dt){let Ft=Kt.context,qt=Ft.gl,Ee=Hl.disabled,je=new Lc([qt.ONE,qt.ONE],i.aM.transparent,[!0,!0,!0,!0]),er=O.getBucket(pt);if(!er)return;let wr=Dt.key,Gr=pt.heatmapFbos.get(wr);Gr||(Gr=nf(Ft,O.tileSize,O.tileSize),pt.heatmapFbos.set(wr,Gr)),Ft.bindFramebuffer.set(Gr.framebuffer),Ft.viewport.set([0,0,O.tileSize,O.tileSize]),Ft.clear({color:i.aM.transparent});let Zr=er.programConfigurations.get(pt.id),Tn=Kt.useProgram("heatmap",Zr),qn=Kt.style.map.terrain.getTerrainData(Dt);Tn.draw(Ft,qt.TRIANGLES,hl.disabled,Ee,je,cs.disabled,Ka(Dt.posMatrix,O,Kt.transform.zoom,pt.paint.get("heatmap-intensity")),qn,pt.id,er.layoutVertexBuffer,er.indexBuffer,er.segments,pt.paint,Kt.transform.zoom,Zr)}function ed(Kt,O,pt){let Dt=Kt.context,Ft=Dt.gl;Dt.setColorMode(Kt.colorModeForRenderPass());let qt=af(Dt,O),Ee=pt.key,je=O.heatmapFbos.get(Ee);je&&(Dt.activeTexture.set(Ft.TEXTURE0),Ft.bindTexture(Ft.TEXTURE_2D,je.colorAttachment.get()),Dt.activeTexture.set(Ft.TEXTURE1),qt.bind(Ft.LINEAR,Ft.CLAMP_TO_EDGE),Kt.useProgram("heatmapTexture").draw(Dt,Ft.TRIANGLES,hl.disabled,Hl.disabled,Kt.colorModeForRenderPass(),cs.disabled,Cs(Kt,O,0,1),null,O.id,Kt.rasterBoundsBuffer,Kt.quadTriangleIndexBuffer,Kt.rasterBoundsSegments,O.paint,Kt.transform.zoom),je.destroy(),O.heatmapFbos.delete(Ee))}function nf(Kt,O,pt){var Dt,Ft;let qt=Kt.gl,Ee=qt.createTexture();qt.bindTexture(qt.TEXTURE_2D,Ee),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_S,qt.CLAMP_TO_EDGE),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_WRAP_T,qt.CLAMP_TO_EDGE),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MIN_FILTER,qt.LINEAR),qt.texParameteri(qt.TEXTURE_2D,qt.TEXTURE_MAG_FILTER,qt.LINEAR);let je=(Dt=Kt.HALF_FLOAT)!==null&&Dt!==void 0?Dt:qt.UNSIGNED_BYTE,er=(Ft=Kt.RGBA16F)!==null&&Ft!==void 0?Ft:qt.RGBA;qt.texImage2D(qt.TEXTURE_2D,0,er,O,pt,0,qt.RGBA,je,null);let wr=Kt.createFramebuffer(O,pt,!1,!1);return wr.colorAttachment.set(Ee),wr}function af(Kt,O){return O.colorRampTexture||(O.colorRampTexture=new g(Kt,O.colorRamp,Kt.gl.RGBA)),O.colorRampTexture}function bh(Kt,O,pt,Dt,Ft){if(!pt||!Dt||!Dt.imageAtlas)return;let qt=Dt.imageAtlas.patternPositions,Ee=qt[pt.to.toString()],je=qt[pt.from.toString()];if(!Ee&&je&&(Ee=je),!je&&Ee&&(je=Ee),!Ee||!je){let er=Ft.getPaintProperty(O);Ee=qt[er],je=qt[er]}Ee&&je&&Kt.setConstantPatternPositions(Ee,je)}function df(Kt,O,pt,Dt,Ft,qt,Ee){let je=Kt.context.gl,er="fill-pattern",wr=pt.paint.get(er),Gr=wr&&wr.constantOr(1),Zr=pt.getCrossfadeParameters(),Tn,qn,te,le,Te;Ee?(qn=Gr&&!pt.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Tn=je.LINES):(qn=Gr?"fillPattern":"fill",Tn=je.TRIANGLES);let Pe=wr.constantOr(null);for(let We of Dt){let Ne=O.getTile(We);if(Gr&&!Ne.patternsLoaded())continue;let Xe=Ne.getBucket(pt);if(!Xe)continue;let Pr=Xe.programConfigurations.get(pt.id),qr=Kt.useProgram(qn,Pr),Xr=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(We);Gr&&(Kt.context.activeTexture.set(je.TEXTURE0),Ne.imageAtlasTexture.bind(je.LINEAR,je.CLAMP_TO_EDGE),Pr.updatePaintBuffers(Zr)),bh(Pr,er,Pe,Ne,pt);let gn=Xr?We:null,zn=Kt.translatePosMatrix(gn?gn.posMatrix:We.posMatrix,Ne,pt.paint.get("fill-translate"),pt.paint.get("fill-translate-anchor"));if(Ee){le=Xe.indexBuffer2,Te=Xe.segments2;let Qn=[je.drawingBufferWidth,je.drawingBufferHeight];te=qn==="fillOutlinePattern"&&Gr?go(zn,Kt,Zr,Ne,Qn):ea(zn,Qn)}else le=Xe.indexBuffer,Te=Xe.segments,te=Gr?Va(zn,Kt,Zr,Ne):pi(zn);qr.draw(Kt.context,Tn,Ft,Kt.stencilModeForClipping(We),qt,cs.disabled,te,Xr,pt.id,Xe.layoutVertexBuffer,le,Te,pt.paint,Kt.transform.zoom,Pr)}}function Uh(Kt,O,pt,Dt,Ft,qt,Ee){let je=Kt.context,er=je.gl,wr="fill-extrusion-pattern",Gr=pt.paint.get(wr),Zr=Gr.constantOr(1),Tn=pt.getCrossfadeParameters(),qn=pt.paint.get("fill-extrusion-opacity"),te=Gr.constantOr(null);for(let le of Dt){let Te=O.getTile(le),Pe=Te.getBucket(pt);if(!Pe)continue;let We=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(le),Ne=Pe.programConfigurations.get(pt.id),Xe=Kt.useProgram(Zr?"fillExtrusionPattern":"fillExtrusion",Ne);Zr&&(Kt.context.activeTexture.set(er.TEXTURE0),Te.imageAtlasTexture.bind(er.LINEAR,er.CLAMP_TO_EDGE),Ne.updatePaintBuffers(Tn)),bh(Ne,wr,te,Te,pt);let Pr=Kt.translatePosMatrix(le.posMatrix,Te,pt.paint.get("fill-extrusion-translate"),pt.paint.get("fill-extrusion-translate-anchor")),qr=pt.paint.get("fill-extrusion-vertical-gradient"),Xr=Zr?Gn(Pr,Kt,qr,qn,le,Tn,Te):Jn(Pr,Kt,qr,qn);Xe.draw(je,je.gl.TRIANGLES,Ft,qt,Ee,cs.backCCW,Xr,We,pt.id,Pe.layoutVertexBuffer,Pe.indexBuffer,Pe.segments,pt.paint,Kt.transform.zoom,Ne,Kt.style.map.terrain&&Pe.centroidVertexBuffer)}}function Mh(Kt,O,pt,Dt,Ft,qt,Ee){let je=Kt.context,er=je.gl,wr=pt.fbo;if(!wr)return;let Gr=Kt.useProgram("hillshade"),Zr=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(O);je.activeTexture.set(er.TEXTURE0),er.bindTexture(er.TEXTURE_2D,wr.colorAttachment.get()),Gr.draw(je,er.TRIANGLES,Ft,qt,Ee,cs.disabled,((Tn,qn,te,le)=>{let Te=te.paint.get("hillshade-shadow-color"),Pe=te.paint.get("hillshade-highlight-color"),We=te.paint.get("hillshade-accent-color"),Ne=te.paint.get("hillshade-illumination-direction")*(Math.PI/180);te.paint.get("hillshade-illumination-anchor")==="viewport"&&(Ne-=Tn.transform.angle);let Xe=!Tn.options.moving;return{u_matrix:le?le.posMatrix:Tn.transform.calculatePosMatrix(qn.tileID.toUnwrapped(),Xe),u_image:0,u_latrange:ps(0,qn.tileID),u_light:[te.paint.get("hillshade-exaggeration"),Ne],u_shadow:Te,u_highlight:Pe,u_accent:We}})(Kt,pt,Dt,Zr?O:null),Zr,Dt.id,Kt.rasterBoundsBuffer,Kt.quadTriangleIndexBuffer,Kt.rasterBoundsSegments)}function yu(Kt,O,pt,Dt,Ft,qt){let Ee=Kt.context,je=Ee.gl,er=O.dem;if(er&&er.data){let wr=er.dim,Gr=er.stride,Zr=er.getPixels();if(Ee.activeTexture.set(je.TEXTURE1),Ee.pixelStoreUnpackPremultiplyAlpha.set(!1),O.demTexture=O.demTexture||Kt.getTileTexture(Gr),O.demTexture){let qn=O.demTexture;qn.update(Zr,{premultiply:!1}),qn.bind(je.NEAREST,je.CLAMP_TO_EDGE)}else O.demTexture=new g(Ee,Zr,je.RGBA,{premultiply:!1}),O.demTexture.bind(je.NEAREST,je.CLAMP_TO_EDGE);Ee.activeTexture.set(je.TEXTURE0);let Tn=O.fbo;if(!Tn){let qn=new g(Ee,{width:wr,height:wr,data:null},je.RGBA);qn.bind(je.LINEAR,je.CLAMP_TO_EDGE),Tn=O.fbo=Ee.createFramebuffer(wr,wr,!0,!1),Tn.colorAttachment.set(qn.texture)}Ee.bindFramebuffer.set(Tn.framebuffer),Ee.viewport.set([0,0,wr,wr]),Kt.useProgram("hillshadePrepare").draw(Ee,je.TRIANGLES,Dt,Ft,qt,cs.disabled,((qn,te)=>{let le=te.stride,Te=i.H();return i.aP(Te,0,i.X,-i.X,0,0,1),i.J(Te,Te,[0,-i.X,0]),{u_matrix:Te,u_image:1,u_dimension:[le,le],u_zoom:qn.overscaledZ,u_unpack:te.getUnpackVector()}})(O.tileID,er),null,pt.id,Kt.rasterBoundsBuffer,Kt.quadTriangleIndexBuffer,Kt.rasterBoundsSegments),O.needsHillshadePrepare=!1}}function fd(Kt,O,pt,Dt,Ft,qt){let Ee=Dt.paint.get("raster-fade-duration");if(!qt&&Ee>0){let je=c.now(),er=(je-Kt.timeAdded)/Ee,wr=O?(je-O.timeAdded)/Ee:-1,Gr=pt.getSource(),Zr=Ft.coveringZoomLevel({tileSize:Gr.tileSize,roundZoom:Gr.roundZoom}),Tn=!O||Math.abs(O.tileID.overscaledZ-Zr)>Math.abs(Kt.tileID.overscaledZ-Zr),qn=Tn&&Kt.refreshedUponExpiration?1:i.ac(Tn?er:1-wr,0,1);return Kt.refreshedUponExpiration&&er>=1&&(Kt.refreshedUponExpiration=!1),O?{opacity:1,mix:1-qn}:{opacity:qn,mix:0}}return{opacity:1,mix:0}}let of=new i.aM(1,0,0,1),uc=new i.aM(0,1,0,1),jd=new i.aM(0,0,1,1),Jf=new i.aM(1,0,1,1),ff=new i.aM(0,1,1,1);function Pd(Kt,O,pt,Dt){Xu(Kt,0,O+pt/2,Kt.transform.width,pt,Dt)}function pf(Kt,O,pt,Dt){Xu(Kt,O-pt/2,0,pt,Kt.transform.height,Dt)}function Xu(Kt,O,pt,Dt,Ft,qt){let Ee=Kt.context,je=Ee.gl;je.enable(je.SCISSOR_TEST),je.scissor(O*Kt.pixelRatio,pt*Kt.pixelRatio,Dt*Kt.pixelRatio,Ft*Kt.pixelRatio),Ee.clear({color:qt}),je.disable(je.SCISSOR_TEST)}function mf(Kt,O,pt){let Dt=Kt.context,Ft=Dt.gl,qt=pt.posMatrix,Ee=Kt.useProgram("debug"),je=hl.disabled,er=Hl.disabled,wr=Kt.colorModeForRenderPass(),Gr="$debug",Zr=Kt.style.map.terrain&&Kt.style.map.terrain.getTerrainData(pt);Dt.activeTexture.set(Ft.TEXTURE0);let Tn=O.getTileByID(pt.key).latestRawTileData,qn=Math.floor((Tn&&Tn.byteLength||0)/1024),te=O.getTile(pt).tileSize,le=512/Math.min(te,512)*(pt.overscaledZ/Kt.transform.zoom)*.5,Te=pt.canonical.toString();pt.overscaledZ!==pt.canonical.z&&(Te+=` => ${pt.overscaledZ}`),function(Pe,We){Pe.initDebugOverlayCanvas();let Ne=Pe.debugOverlayCanvas,Xe=Pe.context.gl,Pr=Pe.debugOverlayCanvas.getContext("2d");Pr.clearRect(0,0,Ne.width,Ne.height),Pr.shadowColor="white",Pr.shadowBlur=2,Pr.lineWidth=1.5,Pr.strokeStyle="white",Pr.textBaseline="top",Pr.font="bold 36px Open Sans, sans-serif",Pr.fillText(We,5,5),Pr.strokeText(We,5,5),Pe.debugOverlayTexture.update(Ne),Pe.debugOverlayTexture.bind(Xe.LINEAR,Xe.CLAMP_TO_EDGE)}(Kt,`${Te} ${qn}kB`),Ee.draw(Dt,Ft.TRIANGLES,je,er,Lc.alphaBlended,cs.disabled,Po(qt,i.aM.transparent,le),null,Gr,Kt.debugBuffer,Kt.quadTriangleIndexBuffer,Kt.debugSegments),Ee.draw(Dt,Ft.LINE_STRIP,je,er,wr,cs.disabled,Po(qt,i.aM.red),Zr,Gr,Kt.debugBuffer,Kt.tileBorderIndexBuffer,Kt.debugSegments)}function Vc(Kt,O,pt){let Dt=Kt.context,Ft=Dt.gl,qt=Kt.colorModeForRenderPass(),Ee=new hl(Ft.LEQUAL,hl.ReadWrite,Kt.depthRangeFor3D),je=Kt.useProgram("terrain"),er=O.getTerrainMesh();Dt.bindFramebuffer.set(null),Dt.viewport.set([0,0,Kt.width,Kt.height]);for(let wr of pt){let Gr=Kt.renderToTexture.getTexture(wr),Zr=O.getTerrainData(wr.tileID);Dt.activeTexture.set(Ft.TEXTURE0),Ft.bindTexture(Ft.TEXTURE_2D,Gr.texture);let Tn=Kt.transform.calculatePosMatrix(wr.tileID.toUnwrapped()),qn=O.getMeshFrameDelta(Kt.transform.zoom),te=Kt.transform.calculateFogMatrix(wr.tileID.toUnwrapped()),le=en(Tn,qn,te,Kt.style.sky,Kt.transform.pitch);je.draw(Dt,Ft.TRIANGLES,Ee,Hl.disabled,qt,cs.backCCW,le,Zr,"terrain",er.vertexBuffer,er.indexBuffer,er.segments)}}class Ju{constructor(O,pt,Dt){this.vertexBuffer=O,this.indexBuffer=pt,this.segments=Dt}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class rd{constructor(O,pt){this.context=new Xf(O),this.transform=pt,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:i.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Qe.maxUnderzooming+Qe.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new sn}resize(O,pt,Dt){if(this.width=Math.floor(O*Dt),this.height=Math.floor(pt*Dt),this.pixelRatio=Dt,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Ft of this.style._order)this.style._layers[Ft].resize()}setup(){let O=this.context,pt=new i.aX;pt.emplaceBack(0,0),pt.emplaceBack(i.X,0),pt.emplaceBack(0,i.X),pt.emplaceBack(i.X,i.X),this.tileExtentBuffer=O.createVertexBuffer(pt,Pn.members),this.tileExtentSegments=i.a0.simpleSegment(0,0,4,2);let Dt=new i.aX;Dt.emplaceBack(0,0),Dt.emplaceBack(i.X,0),Dt.emplaceBack(0,i.X),Dt.emplaceBack(i.X,i.X),this.debugBuffer=O.createVertexBuffer(Dt,Pn.members),this.debugSegments=i.a0.simpleSegment(0,0,4,5);let Ft=new i.$;Ft.emplaceBack(0,0,0,0),Ft.emplaceBack(i.X,0,i.X,0),Ft.emplaceBack(0,i.X,0,i.X),Ft.emplaceBack(i.X,i.X,i.X,i.X),this.rasterBoundsBuffer=O.createVertexBuffer(Ft,ee.members),this.rasterBoundsSegments=i.a0.simpleSegment(0,0,4,2);let qt=new i.aX;qt.emplaceBack(0,0),qt.emplaceBack(1,0),qt.emplaceBack(0,1),qt.emplaceBack(1,1),this.viewportBuffer=O.createVertexBuffer(qt,Pn.members),this.viewportSegments=i.a0.simpleSegment(0,0,4,2);let Ee=new i.aZ;Ee.emplaceBack(0),Ee.emplaceBack(1),Ee.emplaceBack(3),Ee.emplaceBack(2),Ee.emplaceBack(0),this.tileBorderIndexBuffer=O.createIndexBuffer(Ee);let je=new i.aY;je.emplaceBack(0,1,2),je.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=O.createIndexBuffer(je);let er=this.context.gl;this.stencilClearMode=new Hl({func:er.ALWAYS,mask:0},0,255,er.ZERO,er.ZERO,er.ZERO)}clearStencil(){let O=this.context,pt=O.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let Dt=i.H();i.aP(Dt,0,this.width,this.height,0,0,1),i.K(Dt,Dt,[pt.drawingBufferWidth,pt.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(O,pt.TRIANGLES,hl.disabled,this.stencilClearMode,Lc.disabled,cs.disabled,Zo(Dt),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(O,pt){if(this.currentStencilSource===O.source||!O.isTileClipped()||!pt||!pt.length)return;this.currentStencilSource=O.source;let Dt=this.context,Ft=Dt.gl;this.nextStencilID+pt.length>256&&this.clearStencil(),Dt.setColorMode(Lc.disabled),Dt.setDepthMode(hl.disabled);let qt=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let Ee of pt){let je=this._tileClippingMaskIDs[Ee.key]=this.nextStencilID++,er=this.style.map.terrain&&this.style.map.terrain.getTerrainData(Ee);qt.draw(Dt,Ft.TRIANGLES,hl.disabled,new Hl({func:Ft.ALWAYS,mask:0},je,255,Ft.KEEP,Ft.KEEP,Ft.REPLACE),Lc.disabled,cs.disabled,Zo(Ee.posMatrix),er,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let O=this.nextStencilID++,pt=this.context.gl;return new Hl({func:pt.NOTEQUAL,mask:255},O,255,pt.KEEP,pt.KEEP,pt.REPLACE)}stencilModeForClipping(O){let pt=this.context.gl;return new Hl({func:pt.EQUAL,mask:255},this._tileClippingMaskIDs[O.key],0,pt.KEEP,pt.KEEP,pt.REPLACE)}stencilConfigForOverlap(O){let pt=this.context.gl,Dt=O.sort((Ee,je)=>je.overscaledZ-Ee.overscaledZ),Ft=Dt[Dt.length-1].overscaledZ,qt=Dt[0].overscaledZ-Ft+1;if(qt>1){this.currentStencilSource=void 0,this.nextStencilID+qt>256&&this.clearStencil();let Ee={};for(let je=0;je({u_sky_color:Pe.properties.get("sky-color"),u_horizon_color:Pe.properties.get("horizon-color"),u_horizon:(We.height/2+We.getHorizon())*Ne,u_sky_horizon_blend:Pe.properties.get("sky-horizon-blend")*We.height/2*Ne}))(wr,er.style.map.transform,er.pixelRatio),qn=new hl(Zr.LEQUAL,hl.ReadWrite,[0,1]),te=Hl.disabled,le=er.colorModeForRenderPass(),Te=er.useProgram("sky");if(!wr.mesh){let Pe=new i.aX;Pe.emplaceBack(-1,-1),Pe.emplaceBack(1,-1),Pe.emplaceBack(1,1),Pe.emplaceBack(-1,1);let We=new i.aY;We.emplaceBack(0,1,2),We.emplaceBack(0,2,3),wr.mesh=new Ju(Gr.createVertexBuffer(Pe,Pn.members),Gr.createIndexBuffer(We),i.a0.simpleSegment(0,0,Pe.length,We.length))}Te.draw(Gr,Zr.TRIANGLES,qn,te,le,cs.disabled,Tn,void 0,"sky",wr.mesh.vertexBuffer,wr.mesh.indexBuffer,wr.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=pt.showOverdrawInspector,this.depthRangeFor3D=[0,1-(O._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Dt.length-1;this.currentLayer>=0;this.currentLayer--){let er=this.style._layers[Dt[this.currentLayer]],wr=Ft[er.source],Gr=qt[er.source];this._renderTileClippingMasks(er,Gr),this.renderLayer(this,wr,er,Gr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerTe.source&&!Te.isHidden(Gr)?[wr.sourceCaches[Te.source]]:[]),qn=Tn.filter(Te=>Te.getSource().type==="vector"),te=Tn.filter(Te=>Te.getSource().type!=="vector"),le=Te=>{(!Zr||Zr.getSource().maxzoomle(Te)),Zr||te.forEach(Te=>le(Te)),Zr}(this.style,this.transform.zoom);er&&function(wr,Gr,Zr){for(let Tn=0;Tn0),Ft&&(i.b0(pt,Dt),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(qt,Ee){let je=qt.context,er=je.gl,wr=Lc.unblended,Gr=new hl(er.LEQUAL,hl.ReadWrite,[0,1]),Zr=Ee.getTerrainMesh(),Tn=Ee.sourceCache.getRenderableTiles(),qn=qt.useProgram("terrainDepth");je.bindFramebuffer.set(Ee.getFramebuffer("depth").framebuffer),je.viewport.set([0,0,qt.width/devicePixelRatio,qt.height/devicePixelRatio]),je.clear({color:i.aM.transparent,depth:1});for(let te of Tn){let le=Ee.getTerrainData(te.tileID),Te={u_matrix:qt.transform.calculatePosMatrix(te.tileID.toUnwrapped()),u_ele_delta:Ee.getMeshFrameDelta(qt.transform.zoom)};qn.draw(je,er.TRIANGLES,Gr,Hl.disabled,wr,cs.backCCW,Te,le,"terrain",Zr.vertexBuffer,Zr.indexBuffer,Zr.segments)}je.bindFramebuffer.set(null),je.viewport.set([0,0,qt.width,qt.height])}(this,this.style.map.terrain),function(qt,Ee){let je=qt.context,er=je.gl,wr=Lc.unblended,Gr=new hl(er.LEQUAL,hl.ReadWrite,[0,1]),Zr=Ee.getTerrainMesh(),Tn=Ee.getCoordsTexture(),qn=Ee.sourceCache.getRenderableTiles(),te=qt.useProgram("terrainCoords");je.bindFramebuffer.set(Ee.getFramebuffer("coords").framebuffer),je.viewport.set([0,0,qt.width/devicePixelRatio,qt.height/devicePixelRatio]),je.clear({color:i.aM.transparent,depth:1}),Ee.coordsIndex=[];for(let le of qn){let Te=Ee.getTerrainData(le.tileID);je.activeTexture.set(er.TEXTURE0),er.bindTexture(er.TEXTURE_2D,Tn.texture);let Pe={u_matrix:qt.transform.calculatePosMatrix(le.tileID.toUnwrapped()),u_terrain_coords_id:(255-Ee.coordsIndex.length)/255,u_texture:0,u_ele_delta:Ee.getMeshFrameDelta(qt.transform.zoom)};te.draw(je,er.TRIANGLES,Gr,Hl.disabled,wr,cs.backCCW,Pe,Te,"terrain",Zr.vertexBuffer,Zr.indexBuffer,Zr.segments),Ee.coordsIndex.push(le.tileID.key)}je.bindFramebuffer.set(null),je.viewport.set([0,0,qt.width,qt.height])}(this,this.style.map.terrain))}renderLayer(O,pt,Dt,Ft){if(!Dt.isHidden(this.transform.zoom)&&(Dt.type==="background"||Dt.type==="custom"||(Ft||[]).length))switch(this.id=Dt.id,Dt.type){case"symbol":(function(qt,Ee,je,er,wr){if(qt.renderPass!=="translucent")return;let Gr=Hl.disabled,Zr=qt.colorModeForRenderPass();(je._unevaluatedLayout.hasValue("text-variable-anchor")||je._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Tn,qn,te,le,Te,Pe,We,Ne,Xe){let Pr=qn.transform,qr=ca(),Xr=Te==="map",gn=Pe==="map";for(let zn of Tn){let Qn=le.getTile(zn),ai=Qn.getBucket(te);if(!ai||!ai.text||!ai.text.segments.get().length)continue;let Ti=i.ag(ai.textSizeData,Pr.zoom),Qi=ui(Qn,1,qn.transform.zoom),Ma=dn(zn.posMatrix,gn,Xr,qn.transform,Qi),Aa=te.layout.get("icon-text-fit")!=="none"&&ai.hasIconData();if(Ti){let Fa=Math.pow(2,Pr.zoom-Qn.tileID.overscaledZ),wo=qn.style.map.terrain?(Fo,xs)=>qn.style.map.terrain.getElevation(zn,Fo,xs):null,Yo=qr.translatePosition(Pr,Qn,We,Ne);Ed(ai,Xr,gn,Xe,Pr,Ma,zn.posMatrix,Fa,Ti,Aa,qr,Yo,zn.toUnwrapped(),wo)}}}(er,qt,je,Ee,je.layout.get("text-rotation-alignment"),je.layout.get("text-pitch-alignment"),je.paint.get("text-translate"),je.paint.get("text-translate-anchor"),wr),je.paint.get("icon-opacity").constantOr(1)!==0&&Lf(qt,Ee,je,er,!1,je.paint.get("icon-translate"),je.paint.get("icon-translate-anchor"),je.layout.get("icon-rotation-alignment"),je.layout.get("icon-pitch-alignment"),je.layout.get("icon-keep-upright"),Gr,Zr),je.paint.get("text-opacity").constantOr(1)!==0&&Lf(qt,Ee,je,er,!0,je.paint.get("text-translate"),je.paint.get("text-translate-anchor"),je.layout.get("text-rotation-alignment"),je.layout.get("text-pitch-alignment"),je.layout.get("text-keep-upright"),Gr,Zr),Ee.map.showCollisionBoxes&&(xh(qt,Ee,je,er,!0),xh(qt,Ee,je,er,!1))})(O,pt,Dt,Ft,this.style.placement.variableOffsets);break;case"circle":(function(qt,Ee,je,er){if(qt.renderPass!=="translucent")return;let wr=je.paint.get("circle-opacity"),Gr=je.paint.get("circle-stroke-width"),Zr=je.paint.get("circle-stroke-opacity"),Tn=!je.layout.get("circle-sort-key").isConstant();if(wr.constantOr(1)===0&&(Gr.constantOr(1)===0||Zr.constantOr(1)===0))return;let qn=qt.context,te=qn.gl,le=qt.depthModeForSublayer(0,hl.ReadOnly),Te=Hl.disabled,Pe=qt.colorModeForRenderPass(),We=[];for(let Ne=0;NeNe.sortKey-Xe.sortKey);for(let Ne of We){let{programConfiguration:Xe,program:Pr,layoutVertexBuffer:qr,indexBuffer:Xr,uniformValues:gn,terrainData:zn}=Ne.state;Pr.draw(qn,te.TRIANGLES,le,Te,Pe,cs.disabled,gn,zn,je.id,qr,Xr,Ne.segments,je.paint,qt.transform.zoom,Xe)}})(O,pt,Dt,Ft);break;case"heatmap":(function(qt,Ee,je,er){if(je.paint.get("heatmap-opacity")===0)return;let wr=qt.context;if(qt.style.map.terrain){for(let Gr of er){let Zr=Ee.getTile(Gr);Ee.hasRenderableParent(Gr)||(qt.renderPass==="offscreen"?Ld(qt,Zr,je,Gr):qt.renderPass==="translucent"&&ed(qt,je,Gr))}wr.viewport.set([0,0,qt.width,qt.height])}else qt.renderPass==="offscreen"?function(Gr,Zr,Tn,qn){let te=Gr.context,le=te.gl,Te=Hl.disabled,Pe=new Lc([le.ONE,le.ONE],i.aM.transparent,[!0,!0,!0,!0]);(function(We,Ne,Xe){let Pr=We.gl;We.activeTexture.set(Pr.TEXTURE1),We.viewport.set([0,0,Ne.width/4,Ne.height/4]);let qr=Xe.heatmapFbos.get(i.aU);qr?(Pr.bindTexture(Pr.TEXTURE_2D,qr.colorAttachment.get()),We.bindFramebuffer.set(qr.framebuffer)):(qr=nf(We,Ne.width/4,Ne.height/4),Xe.heatmapFbos.set(i.aU,qr))})(te,Gr,Tn),te.clear({color:i.aM.transparent});for(let We=0;We20&&Gr.texParameterf(Gr.TEXTURE_2D,wr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,wr.extTextureFilterAnisotropicMax);let ai=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(We),Ti=ai?We:null,Qi=Ti?Ti.posMatrix:qt.transform.calculatePosMatrix(We.toUnwrapped(),Pe),Ma=Kl(Qi,zn||[0,0],gn||1,Xr,je);Zr instanceof xe?Tn.draw(wr,Gr.TRIANGLES,Ne,Hl.disabled,qn,cs.disabled,Ma,ai,je.id,Zr.boundsBuffer,qt.quadTriangleIndexBuffer,Zr.boundsSegments):Tn.draw(wr,Gr.TRIANGLES,Ne,te[We.overscaledZ],qn,cs.disabled,Ma,ai,je.id,qt.rasterBoundsBuffer,qt.quadTriangleIndexBuffer,qt.rasterBoundsSegments)}})(O,pt,Dt,Ft);break;case"background":(function(qt,Ee,je,er){let wr=je.paint.get("background-color"),Gr=je.paint.get("background-opacity");if(Gr===0)return;let Zr=qt.context,Tn=Zr.gl,qn=qt.transform,te=qn.tileSize,le=je.paint.get("background-pattern");if(qt.isPatternMissing(le))return;let Te=!le&&wr.a===1&&Gr===1&&qt.opaquePassEnabledForLayer()?"opaque":"translucent";if(qt.renderPass!==Te)return;let Pe=Hl.disabled,We=qt.depthModeForSublayer(0,Te==="opaque"?hl.ReadWrite:hl.ReadOnly),Ne=qt.colorModeForRenderPass(),Xe=qt.useProgram(le?"backgroundPattern":"background"),Pr=er||qn.coveringTiles({tileSize:te,terrain:qt.style.map.terrain});le&&(Zr.activeTexture.set(Tn.TEXTURE0),qt.imageManager.bind(qt.context));let qr=je.getCrossfadeParameters();for(let Xr of Pr){let gn=er?Xr.posMatrix:qt.transform.calculatePosMatrix(Xr.toUnwrapped()),zn=le?tc(gn,Gr,qt,le,{tileID:Xr,tileSize:te},qr):Ol(gn,Gr,wr),Qn=qt.style.map.terrain&&qt.style.map.terrain.getTerrainData(Xr);Xe.draw(Zr,Tn.TRIANGLES,We,Pe,Ne,cs.disabled,zn,Qn,je.id,qt.tileExtentBuffer,qt.quadTriangleIndexBuffer,qt.tileExtentSegments)}})(O,0,Dt,Ft);break;case"custom":(function(qt,Ee,je){let er=qt.context,wr=je.implementation;if(qt.renderPass==="offscreen"){let Gr=wr.prerender;Gr&&(qt.setCustomLayerDefaults(),er.setColorMode(qt.colorModeForRenderPass()),Gr.call(wr,er.gl,qt.transform.customLayerMatrix()),er.setDirty(),qt.setBaseState())}else if(qt.renderPass==="translucent"){qt.setCustomLayerDefaults(),er.setColorMode(qt.colorModeForRenderPass()),er.setStencilMode(Hl.disabled);let Gr=wr.renderingMode==="3d"?new hl(qt.context.gl.LEQUAL,hl.ReadWrite,qt.depthRangeFor3D):qt.depthModeForSublayer(0,hl.ReadOnly);er.setDepthMode(Gr),wr.render(er.gl,qt.transform.customLayerMatrix(),{farZ:qt.transform.farZ,nearZ:qt.transform.nearZ,fov:qt.transform._fov,modelViewProjectionMatrix:qt.transform.modelViewProjectionMatrix,projectionMatrix:qt.transform.projectionMatrix}),er.setDirty(),qt.setBaseState(),er.bindFramebuffer.set(null)}})(O,0,Dt)}}translatePosMatrix(O,pt,Dt,Ft,qt){if(!Dt[0]&&!Dt[1])return O;let Ee=qt?Ft==="map"?this.transform.angle:0:Ft==="viewport"?-this.transform.angle:0;if(Ee){let wr=Math.sin(Ee),Gr=Math.cos(Ee);Dt=[Dt[0]*Gr-Dt[1]*wr,Dt[0]*wr+Dt[1]*Gr]}let je=[qt?Dt[0]:ui(pt,Dt[0],this.transform.zoom),qt?Dt[1]:ui(pt,Dt[1],this.transform.zoom),0],er=new Float32Array(16);return i.J(er,O,je),er}saveTileTexture(O){let pt=this._tileTextures[O.size[0]];pt?pt.push(O):this._tileTextures[O.size[0]]=[O]}getTileTexture(O){let pt=this._tileTextures[O];return pt&&pt.length>0?pt.pop():null}isPatternMissing(O){if(!O)return!1;if(!O.from||!O.to)return!0;let pt=this.imageManager.getPattern(O.from.toString()),Dt=this.imageManager.getPattern(O.to.toString());return!pt||!Dt}useProgram(O,pt){this.cache=this.cache||{};let Dt=O+(pt?pt.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Dt]||(this.cache[Dt]=new ni(this.context,bn[O],pt,sc[O],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Dt]}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(){let O=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(O.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new g(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:O,drawingBufferHeight:pt}=this.context.gl;return this.width!==O||this.height!==pt}}class xc{constructor(O,pt){this.points=O,this.planes=pt}static fromInvProjectionMatrix(O,pt,Dt){let Ft=Math.pow(2,Dt),qt=[[-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(je=>{let er=1/(je=i.af([],je,O))[3]/pt*Ft;return i.b1(je,je,[er,er,1/je[3],er])}),Ee=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(je=>{let er=function(Tn,qn){var te=qn[0],le=qn[1],Te=qn[2],Pe=te*te+le*le+Te*Te;return Pe>0&&(Pe=1/Math.sqrt(Pe)),Tn[0]=qn[0]*Pe,Tn[1]=qn[1]*Pe,Tn[2]=qn[2]*Pe,Tn}([],function(Tn,qn,te){var le=qn[0],Te=qn[1],Pe=qn[2],We=te[0],Ne=te[1],Xe=te[2];return Tn[0]=Te*Xe-Pe*Ne,Tn[1]=Pe*We-le*Xe,Tn[2]=le*Ne-Te*We,Tn}([],E([],qt[je[0]],qt[je[1]]),E([],qt[je[2]],qt[je[1]]))),wr=-((Gr=er)[0]*(Zr=qt[je[1]])[0]+Gr[1]*Zr[1]+Gr[2]*Zr[2]);var Gr,Zr;return er.concat(wr)});return new xc(qt,Ee)}}class $h{constructor(O,pt){this.min=O,this.max=pt,this.center=function(Dt,Ft,qt){return Dt[0]=.5*Ft[0],Dt[1]=.5*Ft[1],Dt[2]=.5*Ft[2],Dt}([],function(Dt,Ft,qt){return Dt[0]=Ft[0]+qt[0],Dt[1]=Ft[1]+qt[1],Dt[2]=Ft[2]+qt[2],Dt}([],this.min,this.max))}quadrant(O){let pt=[O%2==0,O<2],Dt=w(this.min),Ft=w(this.max);for(let qt=0;qt=0&&Ee++;if(Ee===0)return 0;Ee!==pt.length&&(Dt=!1)}if(Dt)return 2;for(let Ft=0;Ft<3;Ft++){let qt=Number.MAX_VALUE,Ee=-Number.MAX_VALUE;for(let je=0;jethis.max[Ft]-this.min[Ft])return 0}return 1}}class ju{constructor(O=0,pt=0,Dt=0,Ft=0){if(isNaN(O)||O<0||isNaN(pt)||pt<0||isNaN(Dt)||Dt<0||isNaN(Ft)||Ft<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=O,this.bottom=pt,this.left=Dt,this.right=Ft}interpolate(O,pt,Dt){return pt.top!=null&&O.top!=null&&(this.top=i.y.number(O.top,pt.top,Dt)),pt.bottom!=null&&O.bottom!=null&&(this.bottom=i.y.number(O.bottom,pt.bottom,Dt)),pt.left!=null&&O.left!=null&&(this.left=i.y.number(O.left,pt.left,Dt)),pt.right!=null&&O.right!=null&&(this.right=i.y.number(O.right,pt.right,Dt)),this}getCenter(O,pt){let Dt=i.ac((this.left+O-this.right)/2,0,O),Ft=i.ac((this.top+pt-this.bottom)/2,0,pt);return new i.P(Dt,Ft)}equals(O){return this.top===O.top&&this.bottom===O.bottom&&this.left===O.left&&this.right===O.right}clone(){return new ju(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Qu=85.051129;class Pc{constructor(O,pt,Dt,Ft,qt){this.tileSize=512,this._renderWorldCopies=qt===void 0||!!qt,this._minZoom=O||0,this._maxZoom=pt||22,this._minPitch=Dt??0,this._maxPitch=Ft??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new i.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ju,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let O=new Pc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return O.apply(this),O}apply(O){this.tileSize=O.tileSize,this.latRange=O.latRange,this.lngRange=O.lngRange,this.width=O.width,this.height=O.height,this._center=O._center,this._elevation=O._elevation,this.minElevationForCurrentTile=O.minElevationForCurrentTile,this.zoom=O.zoom,this.angle=O.angle,this._fov=O._fov,this._pitch=O._pitch,this._unmodified=O._unmodified,this._edgeInsets=O._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(O){this._minZoom!==O&&(this._minZoom=O,this.zoom=Math.max(this.zoom,O))}get maxZoom(){return this._maxZoom}set maxZoom(O){this._maxZoom!==O&&(this._maxZoom=O,this.zoom=Math.min(this.zoom,O))}get minPitch(){return this._minPitch}set minPitch(O){this._minPitch!==O&&(this._minPitch=O,this.pitch=Math.max(this.pitch,O))}get maxPitch(){return this._maxPitch}set maxPitch(O){this._maxPitch!==O&&(this._maxPitch=O,this.pitch=Math.min(this.pitch,O))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(O){O===void 0?O=!0:O===null&&(O=!1),this._renderWorldCopies=O}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new i.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(O){let pt=-i.b3(O,-180,180)*Math.PI/180;this.angle!==pt&&(this._unmodified=!1,this.angle=pt,this._calcMatrices(),this.rotationMatrix=function(){var Dt=new i.A(4);return i.A!=Float32Array&&(Dt[1]=0,Dt[2]=0),Dt[0]=1,Dt[3]=1,Dt}(),function(Dt,Ft,qt){var Ee=Ft[0],je=Ft[1],er=Ft[2],wr=Ft[3],Gr=Math.sin(qt),Zr=Math.cos(qt);Dt[0]=Ee*Zr+er*Gr,Dt[1]=je*Zr+wr*Gr,Dt[2]=Ee*-Gr+er*Zr,Dt[3]=je*-Gr+wr*Zr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(O){let pt=i.ac(O,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==pt&&(this._unmodified=!1,this._pitch=pt,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(O){O=Math.max(.01,Math.min(60,O)),this._fov!==O&&(this._unmodified=!1,this._fov=O/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(O){let pt=Math.min(Math.max(O,this.minZoom),this.maxZoom);this._zoom!==pt&&(this._unmodified=!1,this._zoom=pt,this.tileZoom=Math.max(0,Math.floor(pt)),this.scale=this.zoomScale(pt),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(O){O.lat===this._center.lat&&O.lng===this._center.lng||(this._unmodified=!1,this._center=O,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(O){O!==this._elevation&&(this._elevation=O,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(O){this._edgeInsets.equals(O)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,O,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(O){return this._edgeInsets.equals(O)}interpolatePadding(O,pt,Dt){this._unmodified=!1,this._edgeInsets.interpolate(O,pt,Dt),this._constrain(),this._calcMatrices()}coveringZoomLevel(O){let pt=(O.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/O.tileSize));return Math.max(0,pt)}getVisibleUnwrappedCoordinates(O){let pt=[new i.b4(0,O)];if(this._renderWorldCopies){let Dt=this.pointCoordinate(new i.P(0,0)),Ft=this.pointCoordinate(new i.P(this.width,0)),qt=this.pointCoordinate(new i.P(this.width,this.height)),Ee=this.pointCoordinate(new i.P(0,this.height)),je=Math.floor(Math.min(Dt.x,Ft.x,qt.x,Ee.x)),er=Math.floor(Math.max(Dt.x,Ft.x,qt.x,Ee.x)),wr=1;for(let Gr=je-wr;Gr<=er+wr;Gr++)Gr!==0&&pt.push(new i.b4(Gr,O))}return pt}coveringTiles(O){var pt,Dt;let Ft=this.coveringZoomLevel(O),qt=Ft;if(O.minzoom!==void 0&&FtO.maxzoom&&(Ft=O.maxzoom);let Ee=this.pointCoordinate(this.getCameraPoint()),je=i.Z.fromLngLat(this.center),er=Math.pow(2,Ft),wr=[er*Ee.x,er*Ee.y,0],Gr=[er*je.x,er*je.y,0],Zr=xc.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ft),Tn=O.minzoom||0;!O.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Tn=Ft);let qn=O.terrain?2/Math.min(this.tileSize,O.tileSize)*this.tileSize:3,te=Ne=>({aabb:new $h([Ne*er,0,0],[(Ne+1)*er,er,0]),zoom:0,x:0,y:0,wrap:Ne,fullyVisible:!1}),le=[],Te=[],Pe=Ft,We=O.reparseOverscaled?qt:Ft;if(this._renderWorldCopies)for(let Ne=1;Ne<=3;Ne++)le.push(te(-Ne)),le.push(te(Ne));for(le.push(te(0));le.length>0;){let Ne=le.pop(),Xe=Ne.x,Pr=Ne.y,qr=Ne.fullyVisible;if(!qr){let ai=Ne.aabb.intersects(Zr);if(ai===0)continue;qr=ai===2}let Xr=O.terrain?wr:Gr,gn=Ne.aabb.distanceX(Xr),zn=Ne.aabb.distanceY(Xr),Qn=Math.max(Math.abs(gn),Math.abs(zn));if(Ne.zoom===Pe||Qn>qn+(1<=Tn){let ai=Pe-Ne.zoom,Ti=wr[0]-.5-(Xe<>1),Ma=Ne.zoom+1,Aa=Ne.aabb.quadrant(ai);if(O.terrain){let Fa=new i.S(Ma,Ne.wrap,Ma,Ti,Qi),wo=O.terrain.getMinMaxElevation(Fa),Yo=(pt=wo.minElevation)!==null&&pt!==void 0?pt:this.elevation,Fo=(Dt=wo.maxElevation)!==null&&Dt!==void 0?Dt:this.elevation;Aa=new $h([Aa.min[0],Aa.min[1],Yo],[Aa.max[0],Aa.max[1],Fo])}le.push({aabb:Aa,zoom:Ma,x:Ti,y:Qi,wrap:Ne.wrap,fullyVisible:qr})}}return Te.sort((Ne,Xe)=>Ne.distanceSq-Xe.distanceSq).map(Ne=>Ne.tileID)}resize(O,pt){this.width=O,this.height=pt,this.pixelsToGLUnits=[2/O,-2/pt],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(O){return Math.pow(2,O)}scaleZoom(O){return Math.log(O)/Math.LN2}project(O){let pt=i.ac(O.lat,-85.051129,Qu);return new i.P(i.O(O.lng)*this.worldSize,i.Q(pt)*this.worldSize)}unproject(O){return new i.Z(O.x/this.worldSize,O.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(O){let pt=this.elevation,Dt=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Ft=this.pointLocation(this.centerPoint,O),qt=O.getElevationForLngLatZoom(Ft,this.tileZoom);if(!(this.elevation-qt))return;let Ee=Dt+pt-qt,je=Math.cos(this._pitch)*this.cameraToCenterDistance/Ee/i.b5(1,Ft.lat),er=this.scaleZoom(je/this.tileSize);this._elevation=qt,this._center=Ft,this.zoom=er}setLocationAtPoint(O,pt){let Dt=this.pointCoordinate(pt),Ft=this.pointCoordinate(this.centerPoint),qt=this.locationCoordinate(O),Ee=new i.Z(qt.x-(Dt.x-Ft.x),qt.y-(Dt.y-Ft.y));this.center=this.coordinateLocation(Ee),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(O,pt){return pt?this.coordinatePoint(this.locationCoordinate(O),pt.getElevationForLngLatZoom(O,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(O))}pointLocation(O,pt){return this.coordinateLocation(this.pointCoordinate(O,pt))}locationCoordinate(O){return i.Z.fromLngLat(O)}coordinateLocation(O){return O&&O.toLngLat()}pointCoordinate(O,pt){if(pt){let Tn=pt.pointCoordinate(O);if(Tn!=null)return Tn}let Dt=[O.x,O.y,0,1],Ft=[O.x,O.y,1,1];i.af(Dt,Dt,this.pixelMatrixInverse),i.af(Ft,Ft,this.pixelMatrixInverse);let qt=Dt[3],Ee=Ft[3],je=Dt[1]/qt,er=Ft[1]/Ee,wr=Dt[2]/qt,Gr=Ft[2]/Ee,Zr=wr===Gr?0:(0-wr)/(Gr-wr);return new i.Z(i.y.number(Dt[0]/qt,Ft[0]/Ee,Zr)/this.worldSize,i.y.number(je,er,Zr)/this.worldSize)}coordinatePoint(O,pt=0,Dt=this.pixelMatrix){let Ft=[O.x*this.worldSize,O.y*this.worldSize,pt,1];return i.af(Ft,Ft,Dt),new i.P(Ft[0]/Ft[3],Ft[1]/Ft[3])}getBounds(){let O=Math.max(0,this.height/2-this.getHorizon());return new dt().extend(this.pointLocation(new i.P(0,O))).extend(this.pointLocation(new i.P(this.width,O))).extend(this.pointLocation(new i.P(this.width,this.height))).extend(this.pointLocation(new i.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new dt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(O){O?(this.lngRange=[O.getWest(),O.getEast()],this.latRange=[O.getSouth(),O.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Qu])}calculateTileMatrix(O){let pt=O.canonical,Dt=this.worldSize/this.zoomScale(pt.z),Ft=pt.x+Math.pow(2,pt.z)*O.wrap,qt=i.an(new Float64Array(16));return i.J(qt,qt,[Ft*Dt,pt.y*Dt,0]),i.K(qt,qt,[Dt/i.X,Dt/i.X,1]),qt}calculatePosMatrix(O,pt=!1){let Dt=O.key,Ft=pt?this._alignedPosMatrixCache:this._posMatrixCache;if(Ft[Dt])return Ft[Dt];let qt=this.calculateTileMatrix(O);return i.L(qt,pt?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,qt),Ft[Dt]=new Float32Array(qt),Ft[Dt]}calculateFogMatrix(O){let pt=O.key,Dt=this._fogMatrixCache;if(Dt[pt])return Dt[pt];let Ft=this.calculateTileMatrix(O);return i.L(Ft,this.fogMatrix,Ft),Dt[pt]=new Float32Array(Ft),Dt[pt]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(O,pt){pt=i.ac(+pt,this.minZoom,this.maxZoom);let Dt={center:new i.N(O.lng,O.lat),zoom:pt},Ft=this.lngRange;if(!this._renderWorldCopies&&Ft===null){let Ne=179.9999999999;Ft=[-Ne,Ne]}let qt=this.tileSize*this.zoomScale(Dt.zoom),Ee=0,je=qt,er=0,wr=qt,Gr=0,Zr=0,{x:Tn,y:qn}=this.size;if(this.latRange){let Ne=this.latRange;Ee=i.Q(Ne[1])*qt,je=i.Q(Ne[0])*qt,je-Eeje&&(Pe=je-Ne)}if(Ft){let Ne=(er+wr)/2,Xe=te;this._renderWorldCopies&&(Xe=i.b3(te,Ne-qt/2,Ne+qt/2));let Pr=Tn/2;Xe-Prwr&&(Te=wr-Pr)}if(Te!==void 0||Pe!==void 0){let Ne=new i.P(Te??te,Pe??le);Dt.center=this.unproject.call({worldSize:qt},Ne).wrap()}return Dt}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let O=this._unmodified,{center:pt,zoom:Dt}=this.getConstrained(this.center,this.zoom);this.center=pt,this.zoom=Dt,this._unmodified=O,this._constraining=!1}_calcMatrices(){if(!this.height)return;let O=this.centerOffset,pt=this.point.x,Dt=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=i.b5(1,this.center.lat)*this.worldSize;let Ft=i.an(new Float64Array(16));i.K(Ft,Ft,[this.width/2,-this.height/2,1]),i.J(Ft,Ft,[1,-1,0]),this.labelPlaneMatrix=Ft,Ft=i.an(new Float64Array(16)),i.K(Ft,Ft,[1,-1,1]),i.J(Ft,Ft,[-1,-1,0]),i.K(Ft,Ft,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ft;let qt=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),Ee=Math.min(this.elevation,this.minElevationForCurrentTile),je=qt-Ee*this._pixelPerMeter/Math.cos(this._pitch),er=Ee<0?je:qt,wr=Math.PI/2+this._pitch,Gr=this._fov*(.5+O.y/this.height),Zr=Math.sin(Gr)*er/Math.sin(i.ac(Math.PI-wr-Gr,.01,Math.PI-.01)),Tn=this.getHorizon(),qn=2*Math.atan(Tn/this.cameraToCenterDistance)*(.5+O.y/(2*Tn)),te=Math.sin(qn)*er/Math.sin(i.ac(Math.PI-wr-qn,.01,Math.PI-.01)),le=Math.min(Zr,te);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*le+er),this.nearZ=this.height/50,Ft=new Float64Array(16),i.b6(Ft,this._fov,this.width/this.height,this.nearZ,this.farZ),Ft[8]=2*-O.x/this.width,Ft[9]=2*O.y/this.height,this.projectionMatrix=i.ae(Ft),i.K(Ft,Ft,[1,-1,1]),i.J(Ft,Ft,[0,0,-this.cameraToCenterDistance]),i.b7(Ft,Ft,this._pitch),i.ad(Ft,Ft,this.angle),i.J(Ft,Ft,[-pt,-Dt,0]),this.mercatorMatrix=i.K([],Ft,[this.worldSize,this.worldSize,this.worldSize]),i.K(Ft,Ft,[1,1,this._pixelPerMeter]),this.pixelMatrix=i.L(new Float64Array(16),this.labelPlaneMatrix,Ft),i.J(Ft,Ft,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Ft,this.invModelViewProjectionMatrix=i.as([],Ft),this.fogMatrix=new Float64Array(16),i.b6(this.fogMatrix,this._fov,this.width/this.height,qt,this.farZ),this.fogMatrix[8]=2*-O.x/this.width,this.fogMatrix[9]=2*O.y/this.height,i.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),i.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),i.b7(this.fogMatrix,this.fogMatrix,this._pitch),i.ad(this.fogMatrix,this.fogMatrix,this.angle),i.J(this.fogMatrix,this.fogMatrix,[-pt,-Dt,0]),i.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),i.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=i.L(new Float64Array(16),this.labelPlaneMatrix,Ft);let Te=this.width%2/2,Pe=this.height%2/2,We=Math.cos(this.angle),Ne=Math.sin(this.angle),Xe=pt-Math.round(pt)+We*Te+Ne*Pe,Pr=Dt-Math.round(Dt)+We*Pe+Ne*Te,qr=new Float64Array(Ft);if(i.J(qr,qr,[Xe>.5?Xe-1:Xe,Pr>.5?Pr-1:Pr,0]),this.alignedModelViewProjectionMatrix=qr,Ft=i.as(new Float64Array(16),this.pixelMatrix),!Ft)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ft,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let O=this.pointCoordinate(new i.P(0,0)),pt=[O.x*this.worldSize,O.y*this.worldSize,0,1];return i.af(pt,pt,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let O=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i.P(0,O))}getCameraQueryGeometry(O){let pt=this.getCameraPoint();if(O.length===1)return[O[0],pt];{let Dt=pt.x,Ft=pt.y,qt=pt.x,Ee=pt.y;for(let je of O)Dt=Math.min(Dt,je.x),Ft=Math.min(Ft,je.y),qt=Math.max(qt,je.x),Ee=Math.max(Ee,je.y);return[new i.P(Dt,Ft),new i.P(qt,Ft),new i.P(qt,Ee),new i.P(Dt,Ee),new i.P(Dt,Ft)]}}lngLatToCameraDepth(O,pt){let Dt=this.locationCoordinate(O),Ft=[Dt.x*this.worldSize,Dt.y*this.worldSize,pt,1];return i.af(Ft,Ft,this.modelViewProjectionMatrix),Ft[2]/Ft[3]}}function xd(Kt,O){let pt,Dt=!1,Ft=null,qt=null,Ee=()=>{Ft=null,Dt&&(Kt.apply(qt,pt),Ft=setTimeout(Ee,O),Dt=!1)};return(...je)=>(Dt=!0,qt=this,pt=je,Ft||Ee(),Ft)}class Eh{constructor(O){this._getCurrentHash=()=>{let pt=window.location.hash.replace("#","");if(this._hashName){let Dt;return pt.split("&").map(Ft=>Ft.split("=")).forEach(Ft=>{Ft[0]===this._hashName&&(Dt=Ft)}),(Dt&&Dt[1]||"").split("/")}return pt.split("/")},this._onHashChange=()=>{let pt=this._getCurrentHash();if(pt.length>=3&&!pt.some(Dt=>isNaN(Dt))){let Dt=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(pt[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+pt[2],+pt[1]],zoom:+pt[0],bearing:Dt,pitch:+(pt[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let pt=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,pt)},this._removeHash=()=>{let pt=this._getCurrentHash();if(pt.length===0)return;let Dt=pt.join("/"),Ft=Dt;Ft.split("&").length>0&&(Ft=Ft.split("&")[0]),this._hashName&&(Ft=`${this._hashName}=${Dt}`);let qt=window.location.hash.replace(Ft,"");qt.startsWith("#&")?qt=qt.slice(0,1)+qt.slice(2):qt==="#"&&(qt="");let Ee=window.location.href.replace(/(#.+)?$/,qt);Ee=Ee.replace("&&","&"),window.history.replaceState(window.history.state,null,Ee)},this._updateHash=xd(this._updateHashUnthrottled,300),this._hashName=O&&encodeURIComponent(O)}addTo(O){return this._map=O,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(O){let pt=this._map.getCenter(),Dt=Math.round(100*this._map.getZoom())/100,Ft=Math.ceil((Dt*Math.LN2+Math.log(512/360/.5))/Math.LN10),qt=Math.pow(10,Ft),Ee=Math.round(pt.lng*qt)/qt,je=Math.round(pt.lat*qt)/qt,er=this._map.getBearing(),wr=this._map.getPitch(),Gr="";if(Gr+=O?`/${Ee}/${je}/${Dt}`:`${Dt}/${je}/${Ee}`,(er||wr)&&(Gr+="/"+Math.round(10*er)/10),wr&&(Gr+=`/${Math.round(wr)}`),this._hashName){let Zr=this._hashName,Tn=!1,qn=window.location.hash.slice(1).split("&").map(te=>{let le=te.split("=")[0];return le===Zr?(Tn=!0,`${le}=${Gr}`):te}).filter(te=>te);return Tn||qn.push(`${Zr}=${Gr}`),`#${qn.join("&")}`}return`#${Gr}`}}let nd={linearity:.3,easing:i.b8(0,0,.3,1)},Ud=i.e({deceleration:2500,maxSpeed:1400},nd),Qf=i.e({deceleration:20,maxSpeed:1400},nd),Ap=i.e({deceleration:1e3,maxSpeed:360},nd),bd=i.e({deceleration:1e3,maxSpeed:90},nd);class $d{constructor(O){this._map=O,this.clear()}clear(){this._inertiaBuffer=[]}record(O){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.now(),settings:O})}_drainInertiaBuffer(){let O=this._inertiaBuffer,pt=c.now();for(;O.length>0&&pt-O[0].time>160;)O.shift()}_onMoveEnd(O){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let pt={zoom:0,bearing:0,pitch:0,pan:new i.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:qt}of this._inertiaBuffer)pt.zoom+=qt.zoomDelta||0,pt.bearing+=qt.bearingDelta||0,pt.pitch+=qt.pitchDelta||0,qt.panDelta&&pt.pan._add(qt.panDelta),qt.around&&(pt.around=qt.around),qt.pinchAround&&(pt.pinchAround=qt.pinchAround);let Dt=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Ft={};if(pt.pan.mag()){let qt=wd(pt.pan.mag(),Dt,i.e({},Ud,O||{}));Ft.offset=pt.pan.mult(qt.amount/pt.pan.mag()),Ft.center=this._map.transform.center,zu(Ft,qt)}if(pt.zoom){let qt=wd(pt.zoom,Dt,Qf);Ft.zoom=this._map.transform.zoom+qt.amount,zu(Ft,qt)}if(pt.bearing){let qt=wd(pt.bearing,Dt,Ap);Ft.bearing=this._map.transform.bearing+i.ac(qt.amount,-179,179),zu(Ft,qt)}if(pt.pitch){let qt=wd(pt.pitch,Dt,bd);Ft.pitch=this._map.transform.pitch+qt.amount,zu(Ft,qt)}if(Ft.zoom||Ft.bearing){let qt=pt.pinchAround===void 0?pt.around:pt.pinchAround;Ft.around=qt?this._map.unproject(qt):this._map.getCenter()}return this.clear(),i.e(Ft,{noMoveStart:!0})}}function zu(Kt,O){(!Kt.duration||Kt.durationpt.unproject(er)),je=qt.reduce((er,wr,Gr,Zr)=>er.add(wr.div(Zr.length)),new i.P(0,0));super(O,{points:qt,point:je,lngLats:Ee,lngLat:pt.unproject(je),originalEvent:Dt}),this._defaultPrevented=!1}}class Hd extends i.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(O,pt,Dt){super(O,{originalEvent:Dt}),this._defaultPrevented=!1}}class Lh{constructor(O,pt){this._map=O,this._clickTolerance=pt.clickTolerance}reset(){delete this._mousedownPos}wheel(O){return this._firePreventable(new Hd(O.type,this._map,O))}mousedown(O,pt){return this._mousedownPos=pt,this._firePreventable(new hh(O.type,this._map,O))}mouseup(O){this._map.fire(new hh(O.type,this._map,O))}click(O,pt){this._mousedownPos&&this._mousedownPos.dist(pt)>=this._clickTolerance||this._map.fire(new hh(O.type,this._map,O))}dblclick(O){return this._firePreventable(new hh(O.type,this._map,O))}mouseover(O){this._map.fire(new hh(O.type,this._map,O))}mouseout(O){this._map.fire(new hh(O.type,this._map,O))}touchstart(O){return this._firePreventable(new kd(O.type,this._map,O))}touchmove(O){this._map.fire(new kd(O.type,this._map,O))}touchend(O){this._map.fire(new kd(O.type,this._map,O))}touchcancel(O){this._map.fire(new kd(O.type,this._map,O))}_firePreventable(O){if(this._map.fire(O),O.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ic{constructor(O){this._map=O}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(O){this._map.fire(new hh(O.type,this._map,O))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new hh("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(O){this._delayContextMenu?this._contextMenuEvent=O:this._ignoreContextMenu||this._map.fire(new hh(O.type,this._map,O)),this._map.listens("contextmenu")&&O.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Hh{constructor(O){this._map=O}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(O){return this.transform.pointLocation(i.P.convert(O),this._map.terrain)}}class th{constructor(O,pt){this._map=O,this._tr=new Hh(O),this._el=O.getCanvasContainer(),this._container=O.getContainer(),this._clickTolerance=pt.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(O,pt){this.isEnabled()&&O.shiftKey&&O.button===0&&(s.disableDrag(),this._startPos=this._lastPos=pt,this._active=!0)}mousemoveWindow(O,pt){if(!this._active)return;let Dt=pt;if(this._lastPos.equals(Dt)||!this._box&&Dt.dist(this._startPos)qt.fitScreenCoordinates(Dt,Ft,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",O)}keydown(O){this._active&&O.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",O))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(O,pt){return this._map.fire(new i.k(O,{originalEvent:pt}))}}function Pf(Kt,O){if(Kt.length!==O.length)throw new Error(`The number of touches and points are not equal - touches ${Kt.length}, points ${O.length}`);let pt={};for(let Dt=0;Dtthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=O.timeStamp),Dt.length===this.numTouches&&(this.centroid=function(Ft){let qt=new i.P(0,0);for(let Ee of Ft)qt._add(Ee);return qt.div(Ft.length)}(pt),this.touches=Pf(Dt,pt)))}touchmove(O,pt,Dt){if(this.aborted||!this.centroid)return;let Ft=Pf(Dt,pt);for(let qt in this.touches){let Ee=Ft[qt];(!Ee||Ee.dist(this.touches[qt])>30)&&(this.aborted=!0)}}touchend(O,pt,Dt){if((!this.centroid||O.timeStamp-this.startTime>500)&&(this.aborted=!0),Dt.length===0){let Ft=!this.aborted&&this.centroid;if(this.reset(),Ft)return Ft}}}class Id{constructor(O){this.singleTap=new Mc(O),this.numTaps=O.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(O,pt,Dt){this.singleTap.touchstart(O,pt,Dt)}touchmove(O,pt,Dt){this.singleTap.touchmove(O,pt,Dt)}touchend(O,pt,Dt){let Ft=this.singleTap.touchend(O,pt,Dt);if(Ft){let qt=O.timeStamp-this.lastTime<500,Ee=!this.lastTap||this.lastTap.dist(Ft)<30;if(qt&&Ee||this.reset(),this.count++,this.lastTime=O.timeStamp,this.lastTap=Ft,this.count===this.numTaps)return this.reset(),Ft}}}class id{constructor(O){this._tr=new Hh(O),this._zoomIn=new Id({numTouches:1,numTaps:2}),this._zoomOut=new Id({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(O,pt,Dt){this._zoomIn.touchstart(O,pt,Dt),this._zoomOut.touchstart(O,pt,Dt)}touchmove(O,pt,Dt){this._zoomIn.touchmove(O,pt,Dt),this._zoomOut.touchmove(O,pt,Dt)}touchend(O,pt,Dt){let Ft=this._zoomIn.touchend(O,pt,Dt),qt=this._zoomOut.touchend(O,pt,Dt),Ee=this._tr;return Ft?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:je=>je.easeTo({duration:300,zoom:Ee.zoom+1,around:Ee.unproject(Ft)},{originalEvent:O})}):qt?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:je=>je.easeTo({duration:300,zoom:Ee.zoom-1,around:Ee.unproject(qt)},{originalEvent:O})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class dh{constructor(O){this._enabled=!!O.enable,this._moveStateManager=O.moveStateManager,this._clickTolerance=O.clickTolerance||1,this._moveFunction=O.move,this._activateOnStart=!!O.activateOnStart,O.assignEvents(this),this.reset()}reset(O){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(O)}_move(...O){let pt=this._moveFunction(...O);if(pt.bearingDelta||pt.pitchDelta||pt.around||pt.panDelta)return this._active=!0,pt}dragStart(O,pt){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(O)&&(this._moveStateManager.startMove(O),this._lastPoint=pt.length?pt[0]:pt,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(O,pt){if(!this.isEnabled())return;let Dt=this._lastPoint;if(!Dt)return;if(O.preventDefault(),!this._moveStateManager.isValidMoveEvent(O))return void this.reset(O);let Ft=pt.length?pt[0]:pt;return!this._moved&&Ft.dist(Dt){Kt.mousedown=Kt.dragStart,Kt.mousemoveWindow=Kt.dragMove,Kt.mouseup=Kt.dragEnd,Kt.contextmenu=O=>{O.preventDefault()}},Au=({enable:Kt,clickTolerance:O,bearingDegreesPerPixelMoved:pt=.8})=>{let Dt=new ad({checkCorrectEvent:Ft=>s.mouseButton(Ft)===0&&Ft.ctrlKey||s.mouseButton(Ft)===2});return new dh({clickTolerance:O,move:(Ft,qt)=>({bearingDelta:(qt.x-Ft.x)*pt}),moveStateManager:Dt,enable:Kt,assignEvents:tp})},gf=({enable:Kt,clickTolerance:O,pitchDegreesPerPixelMoved:pt=-.5})=>{let Dt=new ad({checkCorrectEvent:Ft=>s.mouseButton(Ft)===0&&Ft.ctrlKey||s.mouseButton(Ft)===2});return new dh({clickTolerance:O,move:(Ft,qt)=>({pitchDelta:(qt.y-Ft.y)*pt}),moveStateManager:Dt,enable:Kt,assignEvents:tp})};class fh{constructor(O,pt){this._clickTolerance=O.clickTolerance||1,this._map=pt,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new i.P(0,0)}_shouldBePrevented(O){return O<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(O,pt,Dt){return this._calculateTransform(O,pt,Dt)}touchmove(O,pt,Dt){if(this._active){if(!this._shouldBePrevented(Dt.length))return O.preventDefault(),this._calculateTransform(O,pt,Dt);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",O)}}touchend(O,pt,Dt){this._calculateTransform(O,pt,Dt),this._active&&this._shouldBePrevented(Dt.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(O,pt,Dt){Dt.length>0&&(this._active=!0);let Ft=Pf(Dt,pt),qt=new i.P(0,0),Ee=new i.P(0,0),je=0;for(let wr in Ft){let Gr=Ft[wr],Zr=this._touches[wr];Zr&&(qt._add(Gr),Ee._add(Gr.sub(Zr)),je++,Ft[wr]=Gr)}if(this._touches=Ft,this._shouldBePrevented(je)||!Ee.mag())return;let er=Ee.div(je);return this._sum._add(er),this._sum.mag()Math.abs(Kt.x)}class sf extends Vh{constructor(O){super(),this._currentTouchCount=0,this._map=O}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(O,pt,Dt){super.touchstart(O,pt,Dt),this._currentTouchCount=Dt.length}_start(O){this._lastPoints=O,Dh(O[0].sub(O[1]))&&(this._valid=!1)}_move(O,pt,Dt){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Ft=O[0].sub(this._lastPoints[0]),qt=O[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Ft,qt,Dt.timeStamp),this._valid?(this._lastPoints=O,this._active=!0,{pitchDelta:(Ft.y+qt.y)/2*-.5}):void 0}gestureBeginsVertically(O,pt,Dt){if(this._valid!==void 0)return this._valid;let Ft=O.mag()>=2,qt=pt.mag()>=2;if(!Ft&&!qt)return;if(!Ft||!qt)return this._firstMove===void 0&&(this._firstMove=Dt),Dt-this._firstMove<100&&void 0;let Ee=O.y>0==pt.y>0;return Dh(O)&&Dh(pt)&&Ee}}let br={panStep:100,bearingStep:15,pitchStep:10};class Qr{constructor(O){this._tr=new Hh(O);let pt=br;this._panStep=pt.panStep,this._bearingStep=pt.bearingStep,this._pitchStep=pt.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(O){if(O.altKey||O.ctrlKey||O.metaKey)return;let pt=0,Dt=0,Ft=0,qt=0,Ee=0;switch(O.keyCode){case 61:case 107:case 171:case 187:pt=1;break;case 189:case 109:case 173:pt=-1;break;case 37:O.shiftKey?Dt=-1:(O.preventDefault(),qt=-1);break;case 39:O.shiftKey?Dt=1:(O.preventDefault(),qt=1);break;case 38:O.shiftKey?Ft=1:(O.preventDefault(),Ee=-1);break;case 40:O.shiftKey?Ft=-1:(O.preventDefault(),Ee=1);break;default:return}return this._rotationDisabled&&(Dt=0,Ft=0),{cameraAnimation:je=>{let er=this._tr;je.easeTo({duration:300,easeId:"keyboardHandler",easing:Nn,zoom:pt?Math.round(er.zoom)+pt*(O.shiftKey?2:1):er.zoom,bearing:er.bearing+Dt*this._bearingStep,pitch:er.pitch+Ft*this._pitchStep,offset:[-qt*this._panStep,-Ee*this._panStep],center:er.center},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Nn(Kt){return Kt*(2-Kt)}let An=4.000244140625;class di{constructor(O,pt){this._onTimeout=Dt=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Dt)},this._map=O,this._tr=new Hh(O),this._triggerRenderFrame=pt,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(O){this._defaultZoomRate=O}setWheelZoomRate(O){this._wheelZoomRate=O}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(O){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!O&&O.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(O){return!!this._map.cooperativeGestures.isEnabled()&&!(O.ctrlKey||this._map.cooperativeGestures.isBypassed(O))}wheel(O){if(!this.isEnabled())return;if(this._shouldBePrevented(O))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",O);let pt=O.deltaMode===WheelEvent.DOM_DELTA_LINE?40*O.deltaY:O.deltaY,Dt=c.now(),Ft=Dt-(this._lastWheelEventTime||0);this._lastWheelEventTime=Dt,pt!==0&&pt%An==0?this._type="wheel":pt!==0&&Math.abs(pt)<4?this._type="trackpad":Ft>400?(this._type=null,this._lastValue=pt,this._timeout=setTimeout(this._onTimeout,40,O)):this._type||(this._type=Math.abs(Ft*pt)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,pt+=this._lastValue)),O.shiftKey&&pt&&(pt/=4),this._type&&(this._lastWheelEvent=O,this._delta-=pt,this._active||this._start(O)),O.preventDefault()}_start(O){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let pt=s.mousePos(this._map.getCanvas(),O),Dt=this._tr;this._around=pt.y>Dt.transform.height/2-Dt.transform.getHorizon()?i.N.convert(this._aroundCenter?Dt.center:Dt.unproject(pt)):i.N.convert(Dt.center),this._aroundPoint=Dt.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let O=this._tr.transform;if(this._delta!==0){let er=this._type==="wheel"&&Math.abs(this._delta)>An?this._wheelZoomRate:this._defaultZoomRate,wr=2/(1+Math.exp(-Math.abs(this._delta*er)));this._delta<0&&wr!==0&&(wr=1/wr);let Gr=typeof this._targetZoom=="number"?O.zoomScale(this._targetZoom):O.scale;this._targetZoom=Math.min(O.maxZoom,Math.max(O.minZoom,O.scaleZoom(Gr*wr))),this._type==="wheel"&&(this._startZoom=O.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let pt=typeof this._targetZoom=="number"?this._targetZoom:O.zoom,Dt=this._startZoom,Ft=this._easing,qt,Ee=!1,je=c.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Dt&&Ft&&je){let er=Math.min(je/200,1),wr=Ft(er);qt=i.y.number(Dt,pt,wr),er<1?this._frameId||(this._frameId=!0):Ee=!0}else qt=pt,Ee=!0;return this._active=!0,Ee&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Ee,zoomDelta:qt-O.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(O){let pt=i.b9;if(this._prevEase){let Dt=this._prevEase,Ft=(c.now()-Dt.start)/Dt.duration,qt=Dt.easing(Ft+.01)-Dt.easing(Ft),Ee=.27/Math.sqrt(qt*qt+1e-4)*.01,je=Math.sqrt(.0729-Ee*Ee);pt=i.b8(Ee,je,.25,1)}return this._prevEase={start:c.now(),duration:O,easing:pt},pt}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Pi{constructor(O,pt){this._clickZoom=O,this._tapZoom=pt}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 ga{constructor(O){this._tr=new Hh(O),this.reset()}reset(){this._active=!1}dblclick(O,pt){return O.preventDefault(),{cameraAnimation:Dt=>{Dt.easeTo({duration:300,zoom:this._tr.zoom+(O.shiftKey?-1:1),around:this._tr.unproject(pt)},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Pa{constructor(){this._tap=new Id({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(O,pt,Dt){if(!this._swipePoint)if(this._tapTime){let Ft=pt[0],qt=O.timeStamp-this._tapTime<500,Ee=this._tapPoint.dist(Ft)<30;qt&&Ee?Dt.length>0&&(this._swipePoint=Ft,this._swipeTouch=Dt[0].identifier):this.reset()}else this._tap.touchstart(O,pt,Dt)}touchmove(O,pt,Dt){if(this._tapTime){if(this._swipePoint){if(Dt[0].identifier!==this._swipeTouch)return;let Ft=pt[0],qt=Ft.y-this._swipePoint.y;return this._swipePoint=Ft,O.preventDefault(),this._active=!0,{zoomDelta:qt/128}}}else this._tap.touchmove(O,pt,Dt)}touchend(O,pt,Dt){if(this._tapTime)this._swipePoint&&Dt.length===0&&this.reset();else{let Ft=this._tap.touchend(O,pt,Dt);Ft&&(this._tapTime=O.timeStamp,this._tapPoint=Ft)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Qa{constructor(O,pt,Dt){this._el=O,this._mousePan=pt,this._touchPan=Dt}enable(O){this._inertiaOptions=O||{},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 uo{constructor(O,pt,Dt){this._pitchWithRotate=O.pitchWithRotate,this._mouseRotate=pt,this._mousePitch=Dt}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 Sa{constructor(O,pt,Dt,Ft){this._el=O,this._touchZoom=pt,this._touchRotate=Dt,this._tapDragZoom=Ft,this._rotationDisabled=!1,this._enabled=!0}enable(O){this._touchZoom.enable(O),this._rotationDisabled||this._touchRotate.enable(O),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Za{constructor(O,pt){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=O,this._options=pt,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let O=this._map.getCanvasContainer();O.classList.add("maplibregl-cooperative-gestures"),this._container=s.create("div","maplibregl-cooperative-gesture-screen",O);let pt=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(pt=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let Dt=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Ft=document.createElement("div");Ft.className="maplibregl-desktop-message",Ft.textContent=pt,this._container.appendChild(Ft);let qt=document.createElement("div");qt.className="maplibregl-mobile-message",qt.textContent=Dt,this._container.appendChild(qt),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(s.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(O){return O[this._bypassKey]}notifyGestureBlocked(O,pt){this._enabled&&(this._map.fire(new i.k("cooperativegestureprevented",{gestureType:O,originalEvent:pt})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Ra=Kt=>Kt.zoom||Kt.drag||Kt.pitch||Kt.rotate;class pa extends i.k{}function _o(Kt){return Kt.panDelta&&Kt.panDelta.mag()||Kt.zoomDelta||Kt.bearingDelta||Kt.pitchDelta}class fs{constructor(O,pt){this.handleWindowEvent=Ft=>{this.handleEvent(Ft,`${Ft.type}Window`)},this.handleEvent=(Ft,qt)=>{if(Ft.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let Ee=Ft.type==="renderFrame"?void 0:Ft,je={needsRenderFrame:!1},er={},wr={},Gr=Ft.touches,Zr=Gr?this._getMapTouches(Gr):void 0,Tn=Zr?s.touchPos(this._map.getCanvas(),Zr):s.mousePos(this._map.getCanvas(),Ft);for(let{handlerName:le,handler:Te,allowed:Pe}of this._handlers){if(!Te.isEnabled())continue;let We;this._blockedByActive(wr,Pe,le)?Te.reset():Te[qt||Ft.type]&&(We=Te[qt||Ft.type](Ft,Tn,Zr),this.mergeHandlerResult(je,er,We,le,Ee),We&&We.needsRenderFrame&&this._triggerRenderFrame()),(We||Te.isActive())&&(wr[le]=Te)}let qn={};for(let le in this._previousActiveHandlers)wr[le]||(qn[le]=Ee);this._previousActiveHandlers=wr,(Object.keys(qn).length||_o(je))&&(this._changes.push([je,er,qn]),this._triggerRenderFrame()),(Object.keys(wr).length||_o(je))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:te}=je;te&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],te(this._map))},this._map=O,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new $d(O),this._bearingSnap=pt.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(pt);let Dt=this._el;this._listeners=[[Dt,"touchstart",{passive:!0}],[Dt,"touchmove",{passive:!1}],[Dt,"touchend",void 0],[Dt,"touchcancel",void 0],[Dt,"mousedown",void 0],[Dt,"mousemove",void 0],[Dt,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Dt,"mouseover",void 0],[Dt,"mouseout",void 0],[Dt,"dblclick",void 0],[Dt,"click",void 0],[Dt,"keydown",{capture:!1}],[Dt,"keyup",void 0],[Dt,"wheel",{passive:!1}],[Dt,"contextmenu",void 0],[window,"blur",void 0]];for(let[Ft,qt,Ee]of this._listeners)s.addEventListener(Ft,qt,Ft===document?this.handleWindowEvent:this.handleEvent,Ee)}destroy(){for(let[O,pt,Dt]of this._listeners)s.removeEventListener(O,pt,O===document?this.handleWindowEvent:this.handleEvent,Dt)}_addDefaultHandlers(O){let pt=this._map,Dt=pt.getCanvasContainer();this._add("mapEvent",new Lh(pt,O));let Ft=pt.boxZoom=new th(pt,O);this._add("boxZoom",Ft),O.interactive&&O.boxZoom&&Ft.enable();let qt=pt.cooperativeGestures=new Za(pt,O.cooperativeGestures);this._add("cooperativeGestures",qt),O.cooperativeGestures&&qt.enable();let Ee=new id(pt),je=new ga(pt);pt.doubleClickZoom=new Pi(je,Ee),this._add("tapZoom",Ee),this._add("clickZoom",je),O.interactive&&O.doubleClickZoom&&pt.doubleClickZoom.enable();let er=new Pa;this._add("tapDragZoom",er);let wr=pt.touchPitch=new sf(pt);this._add("touchPitch",wr),O.interactive&&O.touchPitch&&pt.touchPitch.enable(O.touchPitch);let Gr=Au(O),Zr=gf(O);pt.dragRotate=new uo(O,Gr,Zr),this._add("mouseRotate",Gr,["mousePitch"]),this._add("mousePitch",Zr,["mouseRotate"]),O.interactive&&O.dragRotate&&pt.dragRotate.enable();let Tn=(({enable:We,clickTolerance:Ne})=>{let Xe=new ad({checkCorrectEvent:Pr=>s.mouseButton(Pr)===0&&!Pr.ctrlKey});return new dh({clickTolerance:Ne,move:(Pr,qr)=>({around:qr,panDelta:qr.sub(Pr)}),activateOnStart:!0,moveStateManager:Xe,enable:We,assignEvents:tp})})(O),qn=new fh(O,pt);pt.dragPan=new Qa(Dt,Tn,qn),this._add("mousePan",Tn),this._add("touchPan",qn,["touchZoom","touchRotate"]),O.interactive&&O.dragPan&&pt.dragPan.enable(O.dragPan);let te=new Td,le=new fc;pt.touchZoomRotate=new Sa(Dt,le,te,er),this._add("touchRotate",te,["touchPan","touchZoom"]),this._add("touchZoom",le,["touchPan","touchRotate"]),O.interactive&&O.touchZoomRotate&&pt.touchZoomRotate.enable(O.touchZoomRotate);let Te=pt.scrollZoom=new di(pt,()=>this._triggerRenderFrame());this._add("scrollZoom",Te,["mousePan"]),O.interactive&&O.scrollZoom&&pt.scrollZoom.enable(O.scrollZoom);let Pe=pt.keyboard=new Qr(pt);this._add("keyboard",Pe),O.interactive&&O.keyboard&&pt.keyboard.enable(),this._add("blockableMapEvent",new Ic(pt))}_add(O,pt,Dt){this._handlers.push({handlerName:O,handler:pt,allowed:Dt}),this._handlersById[O]=pt}stop(O){if(!this._updatingCamera){for(let{handler:pt}of this._handlers)pt.reset();this._inertia.clear(),this._fireEvents({},{},O),this._changes=[]}}isActive(){for(let{handler:O}of this._handlers)if(O.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Ra(this._eventsInProgress)||this.isZooming()}_blockedByActive(O,pt,Dt){for(let Ft in O)if(Ft!==Dt&&(!pt||pt.indexOf(Ft)<0))return!0;return!1}_getMapTouches(O){let pt=[];for(let Dt of O)this._el.contains(Dt.target)&&pt.push(Dt);return pt}mergeHandlerResult(O,pt,Dt,Ft,qt){if(!Dt)return;i.e(O,Dt);let Ee={handlerName:Ft,originalEvent:Dt.originalEvent||qt};Dt.zoomDelta!==void 0&&(pt.zoom=Ee),Dt.panDelta!==void 0&&(pt.drag=Ee),Dt.pitchDelta!==void 0&&(pt.pitch=Ee),Dt.bearingDelta!==void 0&&(pt.rotate=Ee)}_applyChanges(){let O={},pt={},Dt={};for(let[Ft,qt,Ee]of this._changes)Ft.panDelta&&(O.panDelta=(O.panDelta||new i.P(0,0))._add(Ft.panDelta)),Ft.zoomDelta&&(O.zoomDelta=(O.zoomDelta||0)+Ft.zoomDelta),Ft.bearingDelta&&(O.bearingDelta=(O.bearingDelta||0)+Ft.bearingDelta),Ft.pitchDelta&&(O.pitchDelta=(O.pitchDelta||0)+Ft.pitchDelta),Ft.around!==void 0&&(O.around=Ft.around),Ft.pinchAround!==void 0&&(O.pinchAround=Ft.pinchAround),Ft.noInertia&&(O.noInertia=Ft.noInertia),i.e(pt,qt),i.e(Dt,Ee);this._updateMapTransform(O,pt,Dt),this._changes=[]}_updateMapTransform(O,pt,Dt){let Ft=this._map,qt=Ft._getTransformForUpdate(),Ee=Ft.terrain;if(!(_o(O)||Ee&&this._terrainMovement))return this._fireEvents(pt,Dt,!0);let{panDelta:je,zoomDelta:er,bearingDelta:wr,pitchDelta:Gr,around:Zr,pinchAround:Tn}=O;Tn!==void 0&&(Zr=Tn),Ft._stop(!0),Zr=Zr||Ft.transform.centerPoint;let qn=qt.pointLocation(je?Zr.sub(je):Zr);wr&&(qt.bearing+=wr),Gr&&(qt.pitch+=Gr),er&&(qt.zoom+=er),Ee?this._terrainMovement||!pt.drag&&!pt.zoom?pt.drag&&this._terrainMovement?qt.center=qt.pointLocation(qt.centerPoint.sub(je)):qt.setLocationAtPoint(qn,Zr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,qt.setLocationAtPoint(qn,Zr)):qt.setLocationAtPoint(qn,Zr),Ft._applyUpdatedTransform(qt),this._map._update(),O.noInertia||this._inertia.record(O),this._fireEvents(pt,Dt,!0)}_fireEvents(O,pt,Dt){let Ft=Ra(this._eventsInProgress),qt=Ra(O),Ee={};for(let Zr in O){let{originalEvent:Tn}=O[Zr];this._eventsInProgress[Zr]||(Ee[`${Zr}start`]=Tn),this._eventsInProgress[Zr]=O[Zr]}!Ft&&qt&&this._fireEvent("movestart",qt.originalEvent);for(let Zr in Ee)this._fireEvent(Zr,Ee[Zr]);qt&&this._fireEvent("move",qt.originalEvent);for(let Zr in O){let{originalEvent:Tn}=O[Zr];this._fireEvent(Zr,Tn)}let je={},er;for(let Zr in this._eventsInProgress){let{handlerName:Tn,originalEvent:qn}=this._eventsInProgress[Zr];this._handlersById[Tn].isActive()||(delete this._eventsInProgress[Zr],er=pt[Tn]||qn,je[`${Zr}end`]=er)}for(let Zr in je)this._fireEvent(Zr,je[Zr]);let wr=Ra(this._eventsInProgress),Gr=(Ft||qt)&&!wr;if(Gr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Zr=this._map._getTransformForUpdate();Zr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Zr)}if(Dt&&Gr){this._updatingCamera=!0;let Zr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Tn=qn=>qn!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new pa("renderFrame",{timeStamp:O})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class os extends i.E{constructor(O,pt){super(),this._renderFrameCallback=()=>{let Dt=Math.min((c.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Dt)),Dt<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=O,this._bearingSnap=pt.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new i.N(this.transform.center.lng,this.transform.center.lat)}setCenter(O,pt){return this.jumpTo({center:O},pt)}panBy(O,pt,Dt){return O=i.P.convert(O).mult(-1),this.panTo(this.transform.center,i.e({offset:O},pt),Dt)}panTo(O,pt,Dt){return this.easeTo(i.e({center:O},pt),Dt)}getZoom(){return this.transform.zoom}setZoom(O,pt){return this.jumpTo({zoom:O},pt),this}zoomTo(O,pt,Dt){return this.easeTo(i.e({zoom:O},pt),Dt)}zoomIn(O,pt){return this.zoomTo(this.getZoom()+1,O,pt),this}zoomOut(O,pt){return this.zoomTo(this.getZoom()-1,O,pt),this}getBearing(){return this.transform.bearing}setBearing(O,pt){return this.jumpTo({bearing:O},pt),this}getPadding(){return this.transform.padding}setPadding(O,pt){return this.jumpTo({padding:O},pt),this}rotateTo(O,pt,Dt){return this.easeTo(i.e({bearing:O},pt),Dt)}resetNorth(O,pt){return this.rotateTo(0,i.e({duration:1e3},O),pt),this}resetNorthPitch(O,pt){return this.easeTo(i.e({bearing:0,pitch:0,duration:1e3},O),pt),this}snapToNorth(O,pt){return Math.abs(this.getBearing()){if(this._zooming&&(Ft.zoom=i.y.number(qt,Te,Xr)),this._rotating&&(Ft.bearing=i.y.number(Ee,wr,Xr)),this._pitching&&(Ft.pitch=i.y.number(je,Gr,Xr)),this._padding&&(Ft.interpolatePadding(er,Zr,Xr),qn=Ft.centerPoint.add(Tn)),this.terrain&&!O.freezeElevation&&this._updateElevation(Xr),Xe)Ft.setLocationAtPoint(Xe,Pr);else{let gn=Ft.zoomScale(Ft.zoom-qt),zn=Te>qt?Math.min(2,Ne):Math.max(.5,Ne),Qn=Math.pow(zn,1-Xr),ai=Ft.unproject(Pe.add(We.mult(Xr*Qn)).mult(gn));Ft.setLocationAtPoint(Ft.renderWorldCopies?ai.wrap():ai,qn)}this._applyUpdatedTransform(Ft),this._fireMoveEvents(pt)},Xr=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pt,Xr)},O),this}_prepareEase(O,pt,Dt={}){this._moving=!0,pt||Dt.moving||this.fire(new i.k("movestart",O)),this._zooming&&!Dt.zooming&&this.fire(new i.k("zoomstart",O)),this._rotating&&!Dt.rotating&&this.fire(new i.k("rotatestart",O)),this._pitching&&!Dt.pitching&&this.fire(new i.k("pitchstart",O))}_prepareElevation(O){this._elevationCenter=O,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(O,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(O){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let pt=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(O<1&&pt!==this._elevationTarget){let Dt=this._elevationTarget-this._elevationStart;this._elevationStart+=O*(Dt-(pt-(Dt*O+this._elevationStart))/(1-O)),this._elevationTarget=pt}this.transform.elevation=i.y.number(this._elevationStart,this._elevationTarget,O)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(O){let pt=O.getCameraPosition(),Dt=this.terrain.getElevationForLngLatZoom(pt.lngLat,O.zoom);if(pt.altitudethis._elevateCameraIfInsideTerrain(Ft)),this.transformCameraUpdate&&pt.push(Ft=>this.transformCameraUpdate(Ft)),!pt.length)return;let Dt=O.clone();for(let Ft of pt){let qt=Dt.clone(),{center:Ee,zoom:je,pitch:er,bearing:wr,elevation:Gr}=Ft(qt);Ee&&(qt.center=Ee),je!==void 0&&(qt.zoom=je),er!==void 0&&(qt.pitch=er),wr!==void 0&&(qt.bearing=wr),Gr!==void 0&&(qt.elevation=Gr),Dt.apply(qt)}this.transform.apply(Dt)}_fireMoveEvents(O){this.fire(new i.k("move",O)),this._zooming&&this.fire(new i.k("zoom",O)),this._rotating&&this.fire(new i.k("rotate",O)),this._pitching&&this.fire(new i.k("pitch",O))}_afterEase(O,pt){if(this._easeId&&pt&&this._easeId===pt)return;delete this._easeId;let Dt=this._zooming,Ft=this._rotating,qt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Dt&&this.fire(new i.k("zoomend",O)),Ft&&this.fire(new i.k("rotateend",O)),qt&&this.fire(new i.k("pitchend",O)),this.fire(new i.k("moveend",O))}flyTo(O,pt){var Dt;if(!O.essential&&c.prefersReducedMotion){let Fa=i.M(O,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Fa,pt)}this.stop(),O=i.e({offset:[0,0],speed:1.2,curve:1.42,easing:i.b9},O);let Ft=this._getTransformForUpdate(),qt=Ft.zoom,Ee=Ft.bearing,je=Ft.pitch,er=Ft.padding,wr="bearing"in O?this._normalizeBearing(O.bearing,Ee):Ee,Gr="pitch"in O?+O.pitch:je,Zr="padding"in O?O.padding:Ft.padding,Tn=i.P.convert(O.offset),qn=Ft.centerPoint.add(Tn),te=Ft.pointLocation(qn),{center:le,zoom:Te}=Ft.getConstrained(i.N.convert(O.center||te),(Dt=O.zoom)!==null&&Dt!==void 0?Dt:qt);this._normalizeCenter(le,Ft);let Pe=Ft.zoomScale(Te-qt),We=Ft.project(te),Ne=Ft.project(le).sub(We),Xe=O.curve,Pr=Math.max(Ft.width,Ft.height),qr=Pr/Pe,Xr=Ne.mag();if("minZoom"in O){let Fa=i.ac(Math.min(O.minZoom,qt,Te),Ft.minZoom,Ft.maxZoom),wo=Pr/Ft.zoomScale(Fa-qt);Xe=Math.sqrt(wo/Xr*2)}let gn=Xe*Xe;function zn(Fa){let wo=(qr*qr-Pr*Pr+(Fa?-1:1)*gn*gn*Xr*Xr)/(2*(Fa?qr:Pr)*gn*Xr);return Math.log(Math.sqrt(wo*wo+1)-wo)}function Qn(Fa){return(Math.exp(Fa)-Math.exp(-Fa))/2}function ai(Fa){return(Math.exp(Fa)+Math.exp(-Fa))/2}let Ti=zn(!1),Qi=function(Fa){return ai(Ti)/ai(Ti+Xe*Fa)},Ma=function(Fa){return Pr*((ai(Ti)*(Qn(wo=Ti+Xe*Fa)/ai(wo))-Qn(Ti))/gn)/Xr;var wo},Aa=(zn(!0)-Ti)/Xe;if(Math.abs(Xr)<1e-6||!isFinite(Aa)){if(Math.abs(Pr-qr)<1e-6)return this.easeTo(O,pt);let Fa=qr0,Qi=wo=>Math.exp(Fa*Xe*wo)}return O.duration="duration"in O?+O.duration:1e3*Aa/("screenSpeed"in O?+O.screenSpeed/Xe:+O.speed),O.maxDuration&&O.duration>O.maxDuration&&(O.duration=0),this._zooming=!0,this._rotating=Ee!==wr,this._pitching=Gr!==je,this._padding=!Ft.isPaddingEqual(Zr),this._prepareEase(pt,!1),this.terrain&&this._prepareElevation(le),this._ease(Fa=>{let wo=Fa*Aa,Yo=1/Qi(wo);Ft.zoom=Fa===1?Te:qt+Ft.scaleZoom(Yo),this._rotating&&(Ft.bearing=i.y.number(Ee,wr,Fa)),this._pitching&&(Ft.pitch=i.y.number(je,Gr,Fa)),this._padding&&(Ft.interpolatePadding(er,Zr,Fa),qn=Ft.centerPoint.add(Tn)),this.terrain&&!O.freezeElevation&&this._updateElevation(Fa);let Fo=Fa===1?le:Ft.unproject(We.add(Ne.mult(Ma(wo))).mult(Yo));Ft.setLocationAtPoint(Ft.renderWorldCopies?Fo.wrap():Fo,qn),this._applyUpdatedTransform(Ft),this._fireMoveEvents(pt)},()=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pt)},O),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(O,pt){var Dt;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Ft=this._onEaseEnd;delete this._onEaseEnd,Ft.call(this,pt)}return O||(Dt=this.handlers)===null||Dt===void 0||Dt.stop(!1),this}_ease(O,pt,Dt){Dt.animate===!1||Dt.duration===0?(O(1),pt()):(this._easeStart=c.now(),this._easeOptions=Dt,this._onEaseFrame=O,this._onEaseEnd=pt,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(O,pt){O=i.b3(O,-180,180);let Dt=Math.abs(O-pt);return Math.abs(O-360-pt)180?-360:Dt<-180?360:0}queryTerrainElevation(O){return this.terrain?this.terrain.getElevationForLngLatZoom(i.N.convert(O),this.transform.tileZoom)-this.transform.elevation:null}}let gs={compact:!0,customAttribution:'
MapLibre'};class ws{constructor(O=gs){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=pt=>{!pt||pt.sourceDataType!=="metadata"&&pt.sourceDataType!=="visibility"&&pt.dataType!=="style"&&pt.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=O}getDefaultPosition(){return"bottom-right"}onAdd(O){return this._map=O,this._compact=this.options.compact,this._container=s.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=s.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=s.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(){s.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(O,pt){let Dt=this._map._getUIString(`AttributionControl.${pt}`);O.title=Dt,O.setAttribute("aria-label",Dt)}_updateAttributions(){if(!this._map.style)return;let O=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?O=O.concat(this.options.customAttribution.map(Ft=>typeof Ft!="string"?"":Ft)):typeof this.options.customAttribution=="string"&&O.push(this.options.customAttribution)),this._map.style.stylesheet){let Ft=this._map.style.stylesheet;this.styleOwner=Ft.owner,this.styleId=Ft.id}let pt=this._map.style.sourceCaches;for(let Ft in pt){let qt=pt[Ft];if(qt.used||qt.usedForTerrain){let Ee=qt.getSource();Ee.attribution&&O.indexOf(Ee.attribution)<0&&O.push(Ee.attribution)}}O=O.filter(Ft=>String(Ft).trim()),O.sort((Ft,qt)=>Ft.length-qt.length),O=O.filter((Ft,qt)=>{for(let Ee=qt+1;Ee=0)return!1;return!0});let Dt=O.join(" | ");Dt!==this._attribHTML&&(this._attribHTML=Dt,O.length?(this._innerContainer.innerHTML=Dt,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class bo{constructor(O={}){this._updateCompact=()=>{let pt=this._container.children;if(pt.length){let Dt=pt[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Dt.classList.add("maplibregl-compact"):Dt.classList.remove("maplibregl-compact")}},this.options=O}getDefaultPosition(){return"bottom-left"}onAdd(O){this._map=O,this._compact=this.options&&this.options.compact,this._container=s.create("div","maplibregl-ctrl");let pt=s.create("a","maplibregl-ctrl-logo");return pt.target="_blank",pt.rel="noopener nofollow",pt.href="https://maplibre.org/",pt.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),pt.setAttribute("rel","noopener nofollow"),this._container.appendChild(pt),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){s.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class lo{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(O){let pt=++this._id;return this._queue.push({callback:O,id:pt,cancelled:!1}),pt}remove(O){let pt=this._currentlyRunning,Dt=pt?this._queue.concat(pt):this._queue;for(let Ft of Dt)if(Ft.id===O)return void(Ft.cancelled=!0)}run(O=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let pt=this._currentlyRunning=this._queue;this._queue=[];for(let Dt of pt)if(!Dt.cancelled&&(Dt.callback(O),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ks=i.Y([{name:"a_pos3d",type:"Int16",components:3}]);class dl extends i.E{constructor(O){super(),this.sourceCache=O,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,O.usedForTerrain=!0,O.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(O,pt){this.sourceCache.update(O,pt),this._renderableTilesKeys=[];let Dt={};for(let Ft of O.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:pt}))Dt[Ft.key]=!0,this._renderableTilesKeys.push(Ft.key),this._tiles[Ft.key]||(Ft.posMatrix=new Float64Array(16),i.aP(Ft.posMatrix,0,i.X,0,i.X,0,1),this._tiles[Ft.key]=new ce(Ft,this.tileSize));for(let Ft in this._tiles)Dt[Ft]||delete this._tiles[Ft]}freeRtt(O){for(let pt in this._tiles){let Dt=this._tiles[pt];(!O||Dt.tileID.equals(O)||Dt.tileID.isChildOf(O)||O.isChildOf(Dt.tileID))&&(Dt.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(O=>this.getTileByID(O))}getTileByID(O){return this._tiles[O]}getTerrainCoords(O){let pt={};for(let Dt of this._renderableTilesKeys){let Ft=this._tiles[Dt].tileID;if(Ft.canonical.equals(O.canonical)){let qt=O.clone();qt.posMatrix=new Float64Array(16),i.aP(qt.posMatrix,0,i.X,0,i.X,0,1),pt[Dt]=qt}else if(Ft.canonical.isChildOf(O.canonical)){let qt=O.clone();qt.posMatrix=new Float64Array(16);let Ee=Ft.canonical.z-O.canonical.z,je=Ft.canonical.x-(Ft.canonical.x>>Ee<>Ee<>Ee;i.aP(qt.posMatrix,0,wr,0,wr,0,1),i.J(qt.posMatrix,qt.posMatrix,[-je*wr,-er*wr,0]),pt[Dt]=qt}else if(O.canonical.isChildOf(Ft.canonical)){let qt=O.clone();qt.posMatrix=new Float64Array(16);let Ee=O.canonical.z-Ft.canonical.z,je=O.canonical.x-(O.canonical.x>>Ee<>Ee<>Ee;i.aP(qt.posMatrix,0,i.X,0,i.X,0,1),i.J(qt.posMatrix,qt.posMatrix,[je*wr,er*wr,0]),i.K(qt.posMatrix,qt.posMatrix,[1/2**Ee,1/2**Ee,0]),pt[Dt]=qt}}return pt}getSourceTile(O,pt){let Dt=this.sourceCache._source,Ft=O.overscaledZ-this.deltaZoom;if(Ft>Dt.maxzoom&&(Ft=Dt.maxzoom),Ft=Dt.minzoom&&(!qt||!qt.dem);)qt=this.sourceCache.getTileByID(O.scaledTo(Ft--).key);return qt}tilesAfterTime(O=Date.now()){return Object.values(this._tiles).filter(pt=>pt.timeAdded>=O)}}class Vl{constructor(O,pt,Dt){this.painter=O,this.sourceCache=new dl(pt),this.options=Dt,this.exaggeration=typeof Dt.exaggeration=="number"?Dt.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(O,pt,Dt,Ft=i.X){var qt;if(!(pt>=0&&pt=0&&DtO.canonical.z&&(O.canonical.z>=Ft?qt=O.canonical.z-Ft:i.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let Ee=O.canonical.x-(O.canonical.x>>qt<>qt<>8<<4|qt>>8,pt[Ee+3]=0;let Dt=new i.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(pt.buffer)),Ft=new g(O,Dt,O.gl.RGBA,{premultiply:!1});return Ft.bind(O.gl.NEAREST,O.gl.CLAMP_TO_EDGE),this._coordsTexture=Ft,Ft}pointCoordinate(O){this.painter.maybeDrawDepthAndCoords(!0);let pt=new Uint8Array(4),Dt=this.painter.context,Ft=Dt.gl,qt=Math.round(O.x*this.painter.pixelRatio/devicePixelRatio),Ee=Math.round(O.y*this.painter.pixelRatio/devicePixelRatio),je=Math.round(this.painter.height/devicePixelRatio);Dt.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Ft.readPixels(qt,je-Ee-1,1,1,Ft.RGBA,Ft.UNSIGNED_BYTE,pt),Dt.bindFramebuffer.set(null);let er=pt[0]+(pt[2]>>4<<8),wr=pt[1]+((15&pt[2])<<8),Gr=this.coordsIndex[255-pt[3]],Zr=Gr&&this.sourceCache.getTileByID(Gr);if(!Zr)return null;let Tn=this._coordsTextureSize,qn=(1<O.id!==pt),this._recentlyUsed.push(O.id)}stampObject(O){O.stamp=++this._stamp}getOrCreateFreeObject(){for(let pt of this._recentlyUsed)if(!this._objects[pt].inUse)return this._objects[pt];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let O=this._createObject(this._objects.length);return this._objects.push(O),O}freeObject(O){O.inUse=!1}freeAllObjects(){for(let O of this._objects)this.freeObject(O)}isFull(){return!(this._objects.length!O.inUse)===!1}}let ec={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class vc{constructor(O,pt){this.painter=O,this.terrain=pt,this.pool=new gc(O.context,30,pt.sourceCache.tileSize*pt.qualityFactor)}destruct(){this.pool.destruct()}getTexture(O){return this.pool.getObjectForId(O.rtt[this._stacks.length-1].id).texture}prepareForRender(O,pt){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=O._order.filter(Dt=>!O._layers[Dt].isHidden(pt)),this._coordsDescendingInv={};for(let Dt in O.sourceCaches){this._coordsDescendingInv[Dt]={};let Ft=O.sourceCaches[Dt].getVisibleCoordinates();for(let qt of Ft){let Ee=this.terrain.sourceCache.getTerrainCoords(qt);for(let je in Ee)this._coordsDescendingInv[Dt][je]||(this._coordsDescendingInv[Dt][je]=[]),this._coordsDescendingInv[Dt][je].push(Ee[je])}}this._coordsDescendingInvStr={};for(let Dt of O._order){let Ft=O._layers[Dt],qt=Ft.source;if(ec[Ft.type]&&!this._coordsDescendingInvStr[qt]){this._coordsDescendingInvStr[qt]={};for(let Ee in this._coordsDescendingInv[qt])this._coordsDescendingInvStr[qt][Ee]=this._coordsDescendingInv[qt][Ee].map(je=>je.key).sort().join()}}for(let Dt of this._renderableTiles)for(let Ft in this._coordsDescendingInvStr){let qt=this._coordsDescendingInvStr[Ft][Dt.tileID.key];qt&&qt!==Dt.rttCoords[Ft]&&(Dt.rtt=[])}}renderLayer(O){if(O.isHidden(this.painter.transform.zoom))return!1;let pt=O.type,Dt=this.painter,Ft=this._renderableLayerIds[this._renderableLayerIds.length-1]===O.id;if(ec[pt]&&(this._prevType&&ec[this._prevType]||this._stacks.push([]),this._prevType=pt,this._stacks[this._stacks.length-1].push(O.id),!Ft))return!0;if(ec[this._prevType]||ec[pt]&&Ft){this._prevType=pt;let qt=this._stacks.length-1,Ee=this._stacks[qt]||[];for(let je of this._renderableTiles){if(this.pool.isFull()&&(Vc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(je),je.rtt[qt]){let wr=this.pool.getObjectForId(je.rtt[qt].id);if(wr.stamp===je.rtt[qt].stamp){this.pool.useObject(wr);continue}}let er=this.pool.getOrCreateFreeObject();this.pool.useObject(er),this.pool.stampObject(er),je.rtt[qt]={id:er.id,stamp:er.stamp},Dt.context.bindFramebuffer.set(er.fbo.framebuffer),Dt.context.clear({color:i.aM.transparent,stencil:0}),Dt.currentStencilSource=void 0;for(let wr=0;wr{Kt.touchstart=Kt.dragStart,Kt.touchmoveWindow=Kt.dragMove,Kt.touchend=Kt.dragEnd},qo={showCompass:!0,showZoom:!0,visualizePitch:!1};class Bs{constructor(O,pt,Dt=!1){this.mousedown=Ee=>{this.startMouse(i.e({},Ee,{ctrlKey:!0,preventDefault:()=>Ee.preventDefault()}),s.mousePos(this.element,Ee)),s.addEventListener(window,"mousemove",this.mousemove),s.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=Ee=>{this.moveMouse(Ee,s.mousePos(this.element,Ee))},this.mouseup=Ee=>{this.mouseRotate.dragEnd(Ee),this.mousePitch&&this.mousePitch.dragEnd(Ee),this.offTemp()},this.touchstart=Ee=>{Ee.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=s.touchPos(this.element,Ee.targetTouches)[0],this.startTouch(Ee,this._startPos),s.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.addEventListener(window,"touchend",this.touchend))},this.touchmove=Ee=>{Ee.targetTouches.length!==1?this.reset():(this._lastPos=s.touchPos(this.element,Ee.targetTouches)[0],this.moveTouch(Ee,this._lastPos))},this.touchend=Ee=>{Ee.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let Ft=O.dragRotate._mouseRotate.getClickTolerance(),qt=O.dragRotate._mousePitch.getClickTolerance();this.element=pt,this.mouseRotate=Au({clickTolerance:Ft,enable:!0}),this.touchRotate=(({enable:Ee,clickTolerance:je,bearingDegreesPerPixelMoved:er=.8})=>{let wr=new Dd;return new dh({clickTolerance:je,move:(Gr,Zr)=>({bearingDelta:(Zr.x-Gr.x)*er}),moveStateManager:wr,enable:Ee,assignEvents:bc})})({clickTolerance:Ft,enable:!0}),this.map=O,Dt&&(this.mousePitch=gf({clickTolerance:qt,enable:!0}),this.touchPitch=(({enable:Ee,clickTolerance:je,pitchDegreesPerPixelMoved:er=-.5})=>{let wr=new Dd;return new dh({clickTolerance:je,move:(Gr,Zr)=>({pitchDelta:(Zr.y-Gr.y)*er}),moveStateManager:wr,enable:Ee,assignEvents:bc})})({clickTolerance:qt,enable:!0})),s.addEventListener(pt,"mousedown",this.mousedown),s.addEventListener(pt,"touchstart",this.touchstart,{passive:!1}),s.addEventListener(pt,"touchcancel",this.reset)}startMouse(O,pt){this.mouseRotate.dragStart(O,pt),this.mousePitch&&this.mousePitch.dragStart(O,pt),s.disableDrag()}startTouch(O,pt){this.touchRotate.dragStart(O,pt),this.touchPitch&&this.touchPitch.dragStart(O,pt),s.disableDrag()}moveMouse(O,pt){let Dt=this.map,{bearingDelta:Ft}=this.mouseRotate.dragMove(O,pt)||{};if(Ft&&Dt.setBearing(Dt.getBearing()+Ft),this.mousePitch){let{pitchDelta:qt}=this.mousePitch.dragMove(O,pt)||{};qt&&Dt.setPitch(Dt.getPitch()+qt)}}moveTouch(O,pt){let Dt=this.map,{bearingDelta:Ft}=this.touchRotate.dragMove(O,pt)||{};if(Ft&&Dt.setBearing(Dt.getBearing()+Ft),this.touchPitch){let{pitchDelta:qt}=this.touchPitch.dragMove(O,pt)||{};qt&&Dt.setPitch(Dt.getPitch()+qt)}}off(){let O=this.element;s.removeEventListener(O,"mousedown",this.mousedown),s.removeEventListener(O,"touchstart",this.touchstart,{passive:!1}),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend),s.removeEventListener(O,"touchcancel",this.reset),this.offTemp()}offTemp(){s.enableDrag(),s.removeEventListener(window,"mousemove",this.mousemove),s.removeEventListener(window,"mouseup",this.mouseup),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend)}}let ac;function Zl(Kt,O,pt){let Dt=new i.N(Kt.lng,Kt.lat);if(Kt=new i.N(Kt.lng,Kt.lat),O){let Ft=new i.N(Kt.lng-360,Kt.lat),qt=new i.N(Kt.lng+360,Kt.lat),Ee=pt.locationPoint(Kt).distSqr(O);pt.locationPoint(Ft).distSqr(O)180;){let Ft=pt.locationPoint(Kt);if(Ft.x>=0&&Ft.y>=0&&Ft.x<=pt.width&&Ft.y<=pt.height)break;Kt.lng>pt.center.lng?Kt.lng-=360:Kt.lng+=360}return Kt.lng!==Dt.lng&&pt.locationPoint(Kt).y>pt.height/2-pt.getHorizon()?Kt:Dt}let Mu={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 eh(Kt,O,pt){let Dt=Kt.classList;for(let Ft in Mu)Dt.remove(`maplibregl-${pt}-anchor-${Ft}`);Dt.add(`maplibregl-${pt}-anchor-${O}`)}class Vu extends i.E{constructor(O){if(super(),this._onKeyPress=pt=>{let Dt=pt.code,Ft=pt.charCode||pt.keyCode;Dt!=="Space"&&Dt!=="Enter"&&Ft!==32&&Ft!==13||this.togglePopup()},this._onMapClick=pt=>{let Dt=pt.originalEvent.target,Ft=this._element;this._popup&&(Dt===Ft||Ft.contains(Dt))&&this.togglePopup()},this._update=pt=>{var Dt;if(!this._map)return;let Ft=this._map.loaded()&&!this._map.isMoving();(pt?.type==="terrain"||pt?.type==="render"&&!Ft)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Zl(this._lngLat,this._flatPos,this._map.transform):(Dt=this._lngLat)===null||Dt===void 0?void 0:Dt.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let qt="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?qt=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(qt=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let Ee="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Ee="rotateX(0deg)":this._pitchAlignment==="map"&&(Ee=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||pt&&pt.type!=="moveend"||(this._pos=this._pos.round()),s.setTransform(this._element,`${Mu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${Ee} ${qt}`),c.frameAsync(new AbortController).then(()=>{this._updateOpacity(pt&&pt.type==="moveend")}).catch(()=>{})},this._onMove=pt=>{if(!this._isDragging){let Dt=this._clickTolerance||this._map._clickTolerance;this._isDragging=pt.point.dist(this._pointerdownPos)>=Dt}this._isDragging&&(this._pos=pt.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new i.k("dragstart"))),this.fire(new i.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new i.k("dragend")),this._state="inactive"},this._addDragHandler=pt=>{this._element.contains(pt.originalEvent.target)&&(pt.preventDefault(),this._positionDelta=pt.point.sub(this._pos).add(this._offset),this._pointerdownPos=pt.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=O&&O.anchor||"center",this._color=O&&O.color||"#3FB1CE",this._scale=O&&O.scale||1,this._draggable=O&&O.draggable||!1,this._clickTolerance=O&&O.clickTolerance||0,this._subpixelPositioning=O&&O.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=O&&O.rotation||0,this._rotationAlignment=O&&O.rotationAlignment||"auto",this._pitchAlignment=O&&O.pitchAlignment&&O.pitchAlignment!=="auto"?O.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(O?.opacity,O?.opacityWhenCovered),O&&O.element)this._element=O.element,this._offset=i.P.convert(O&&O.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");let pt=s.createNS("http://www.w3.org/2000/svg","svg"),Dt=41,Ft=27;pt.setAttributeNS(null,"display","block"),pt.setAttributeNS(null,"height",`${Dt}px`),pt.setAttributeNS(null,"width",`${Ft}px`),pt.setAttributeNS(null,"viewBox",`0 0 ${Ft} ${Dt}`);let qt=s.createNS("http://www.w3.org/2000/svg","g");qt.setAttributeNS(null,"stroke","none"),qt.setAttributeNS(null,"stroke-width","1"),qt.setAttributeNS(null,"fill","none"),qt.setAttributeNS(null,"fill-rule","evenodd");let Ee=s.createNS("http://www.w3.org/2000/svg","g");Ee.setAttributeNS(null,"fill-rule","nonzero");let je=s.createNS("http://www.w3.org/2000/svg","g");je.setAttributeNS(null,"transform","translate(3.0, 29.0)"),je.setAttributeNS(null,"fill","#000000");let er=[{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(let Pe of er){let We=s.createNS("http://www.w3.org/2000/svg","ellipse");We.setAttributeNS(null,"opacity","0.04"),We.setAttributeNS(null,"cx","10.5"),We.setAttributeNS(null,"cy","5.80029008"),We.setAttributeNS(null,"rx",Pe.rx),We.setAttributeNS(null,"ry",Pe.ry),je.appendChild(We)}let wr=s.createNS("http://www.w3.org/2000/svg","g");wr.setAttributeNS(null,"fill",this._color);let Gr=s.createNS("http://www.w3.org/2000/svg","path");Gr.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"),wr.appendChild(Gr);let Zr=s.createNS("http://www.w3.org/2000/svg","g");Zr.setAttributeNS(null,"opacity","0.25"),Zr.setAttributeNS(null,"fill","#000000");let Tn=s.createNS("http://www.w3.org/2000/svg","path");Tn.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"),Zr.appendChild(Tn);let qn=s.createNS("http://www.w3.org/2000/svg","g");qn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),qn.setAttributeNS(null,"fill","#FFFFFF");let te=s.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"transform","translate(8.0, 8.0)");let le=s.createNS("http://www.w3.org/2000/svg","circle");le.setAttributeNS(null,"fill","#000000"),le.setAttributeNS(null,"opacity","0.25"),le.setAttributeNS(null,"cx","5.5"),le.setAttributeNS(null,"cy","5.5"),le.setAttributeNS(null,"r","5.4999962");let Te=s.createNS("http://www.w3.org/2000/svg","circle");Te.setAttributeNS(null,"fill","#FFFFFF"),Te.setAttributeNS(null,"cx","5.5"),Te.setAttributeNS(null,"cy","5.5"),Te.setAttributeNS(null,"r","5.4999962"),te.appendChild(le),te.appendChild(Te),Ee.appendChild(je),Ee.appendChild(wr),Ee.appendChild(Zr),Ee.appendChild(qn),Ee.appendChild(te),pt.appendChild(Ee),pt.setAttributeNS(null,"height",Dt*this._scale+"px"),pt.setAttributeNS(null,"width",Ft*this._scale+"px"),this._element.appendChild(pt),this._offset=i.P.convert(O&&O.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",pt=>{pt.preventDefault()}),this._element.addEventListener("mousedown",pt=>{pt.preventDefault()}),eh(this._element,this._anchor,"marker"),O&&O.className)for(let pt of O.className.split(" "))this._element.classList.add(pt);this._popup=null}addTo(O){return this.remove(),this._map=O,this._element.setAttribute("aria-label",O._getUIString("Marker.Title")),O.getCanvasContainer().appendChild(this._element),O.on("move",this._update),O.on("moveend",this._update),O.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("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),s.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(O){return this._lngLat=i.N.convert(O),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(O){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),O){if(!("offset"in O.options)){let pt=Math.abs(13.5)/Math.SQRT2;O.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[pt,-1*(38.1-13.5+pt)],"bottom-right":[-pt,-1*(38.1-13.5+pt)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=O,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(O){return this._subpixelPositioning=O,this}getPopup(){return this._popup}togglePopup(){let O=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:O?(O.isOpen()?O.remove():(O.setLngLat(this._lngLat),O.addTo(this._map)),this):this}_updateOpacity(O=!1){var pt,Dt;if(!(!((pt=this._map)===null||pt===void 0)&&pt.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(O)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Ft=this._map,qt=Ft.terrain.depthAtPoint(this._pos),Ee=Ft.terrain.getElevationForLngLatZoom(this._lngLat,Ft.transform.tileZoom);if(Ft.transform.lngLatToCameraDepth(this._lngLat,Ee)-qt<.006)return void(this._element.style.opacity=this._opacity);let je=-this._offset.y/Ft.transform._pixelPerMeter,er=Math.sin(Ft.getPitch()*Math.PI/180)*je,wr=Ft.terrain.depthAtPoint(new i.P(this._pos.x,this._pos.y-this._offset.y)),Gr=Ft.transform.lngLatToCameraDepth(this._lngLat,Ee+er)-wr>.006;!((Dt=this._popup)===null||Dt===void 0)&&Dt.isOpen()&&Gr&&this._popup.remove(),this._element.style.opacity=Gr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(O){return this._offset=i.P.convert(O),this._update(),this}addClassName(O){this._element.classList.add(O)}removeClassName(O){this._element.classList.remove(O)}toggleClassName(O){return this._element.classList.toggle(O)}setDraggable(O){return this._draggable=!!O,this._map&&(O?(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(O){return this._rotation=O||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(O){return this._rotationAlignment=O||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(O){return this._pitchAlignment=O&&O!=="auto"?O:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(O,pt){return O===void 0&&pt===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),O!==void 0&&(this._opacity=O),pt!==void 0&&(this._opacityWhenCovered=pt),this._map&&this._updateOpacity(!0),this}}let Wh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},rh=0,qh=!1,Wc={maxWidth:100,unit:"metric"};function Gh(Kt,O,pt){let Dt=pt&&pt.maxWidth||100,Ft=Kt._container.clientHeight/2,qt=Kt.unproject([0,Ft]),Ee=Kt.unproject([Dt,Ft]),je=qt.distanceTo(Ee);if(pt&&pt.unit==="imperial"){let er=3.2808*je;er>5280?ds(O,Dt,er/5280,Kt._getUIString("ScaleControl.Miles")):ds(O,Dt,er,Kt._getUIString("ScaleControl.Feet"))}else pt&&pt.unit==="nautical"?ds(O,Dt,je/1852,Kt._getUIString("ScaleControl.NauticalMiles")):je>=1e3?ds(O,Dt,je/1e3,Kt._getUIString("ScaleControl.Kilometers")):ds(O,Dt,je,Kt._getUIString("ScaleControl.Meters"))}function ds(Kt,O,pt,Dt){let Ft=function(qt){let Ee=Math.pow(10,`${Math.floor(qt)}`.length-1),je=qt/Ee;return je=je>=10?10:je>=5?5:je>=3?3:je>=2?2:je>=1?1:function(er){let wr=Math.pow(10,Math.ceil(-Math.log(er)/Math.LN10));return Math.round(er*wr)/wr}(je),Ee*je}(pt);Kt.style.width=O*(Ft/pt)+"px",Kt.innerHTML=`${Ft} ${Dt}`}let $s={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},nh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function eu(Kt){if(Kt){if(typeof Kt=="number"){let O=Math.round(Math.abs(Kt)/Math.SQRT2);return{center:new i.P(0,0),top:new i.P(0,Kt),"top-left":new i.P(O,O),"top-right":new i.P(-O,O),bottom:new i.P(0,-Kt),"bottom-left":new i.P(O,-O),"bottom-right":new i.P(-O,-O),left:new i.P(Kt,0),right:new i.P(-Kt,0)}}if(Kt instanceof i.P||Array.isArray(Kt)){let O=i.P.convert(Kt);return{center:O,top:O,"top-left":O,"top-right":O,bottom:O,"bottom-left":O,"bottom-right":O,left:O,right:O}}return{center:i.P.convert(Kt.center||[0,0]),top:i.P.convert(Kt.top||[0,0]),"top-left":i.P.convert(Kt["top-left"]||[0,0]),"top-right":i.P.convert(Kt["top-right"]||[0,0]),bottom:i.P.convert(Kt.bottom||[0,0]),"bottom-left":i.P.convert(Kt["bottom-left"]||[0,0]),"bottom-right":i.P.convert(Kt["bottom-right"]||[0,0]),left:i.P.convert(Kt.left||[0,0]),right:i.P.convert(Kt.right||[0,0])}}return eu(new i.P(0,0))}let lf=a;n.AJAXError=i.bh,n.Evented=i.E,n.LngLat=i.N,n.MercatorCoordinate=i.Z,n.Point=i.P,n.addProtocol=i.bi,n.config=i.a,n.removeProtocol=i.bj,n.AttributionControl=ws,n.BoxZoomHandler=th,n.CanvasSource=ye,n.CooperativeGesturesHandler=Za,n.DoubleClickZoomHandler=Pi,n.DragPanHandler=Qa,n.DragRotateHandler=uo,n.EdgeInsets=ju,n.FullscreenControl=class extends i.E{constructor(Kt={}){super(),this._onFullscreenChange=()=>{var O;let pt=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((O=pt?.shadowRoot)===null||O===void 0)&&O.fullscreenElement;)pt=pt.shadowRoot.fullscreenElement;pt===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Kt&&Kt.container&&(Kt.container instanceof HTMLElement?this._container=Kt.container:i.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Kt){return this._map=Kt,this._container||(this._container=this._map.getContainer()),this._controlContainer=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){s.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Kt=this._fullscreenButton=s.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);s.create("span","maplibregl-ctrl-icon",Kt).setAttribute("aria-hidden","true"),Kt.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Kt=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Kt),this._fullscreenButton.title=Kt}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new i.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new i.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},n.GeoJSONSource=Gt,n.GeolocateControl=class extends i.E{constructor(Kt){super(),this._onSuccess=O=>{if(this._map){if(this._isOutOfMapMaxBounds(O))return this._setErrorState(),this.fire(new i.k("outofmaxbounds",O)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=O,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(O),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(O),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new i.k("geolocate",O)),this._finish()}},this._updateCamera=O=>{let pt=new i.N(O.coords.longitude,O.coords.latitude),Dt=O.coords.accuracy,Ft=this._map.getBearing(),qt=i.e({bearing:Ft},this.options.fitBoundsOptions),Ee=dt.fromLngLat(pt,Dt);this._map.fitBounds(Ee,qt,{geolocateSource:!0})},this._updateMarker=O=>{if(O){let pt=new i.N(O.coords.longitude,O.coords.latitude);this._accuracyCircleMarker.setLngLat(pt).addTo(this._map),this._userLocationDotMarker.setLngLat(pt).addTo(this._map),this._accuracy=O.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=O=>{if(this._map){if(this.options.trackUserLocation)if(O.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let pt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=pt,this._geolocateButton.setAttribute("aria-label",pt),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(O.code===3&&qh)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new i.k("error",O)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",O=>O.preventDefault()),this._geolocateButton=s.create("button","maplibregl-ctrl-geolocate",this._container),s.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=O=>{if(this._map){if(O===!1){i.w("Geolocation support is not available so the GeolocateControl will be disabled.");let pt=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=pt,this._geolocateButton.setAttribute("aria-label",pt)}else{let pt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=pt,this._geolocateButton.setAttribute("aria-label",pt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=s.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Vu({element:this._dotElement}),this._circleElement=s.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Vu({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",pt=>{pt.geolocateSource||this._watchState!=="ACTIVE_LOCK"||pt.originalEvent&&pt.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new i.k("trackuserlocationend")),this.fire(new i.k("userlocationlostfocus")))})}},this.options=i.e({},Wh,Kt)}onAdd(Kt){return this._map=Kt,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return i._(this,arguments,void 0,function*(O=!1){if(ac!==void 0&&!O)return ac;if(window.navigator.permissions===void 0)return ac=!!window.navigator.geolocation,ac;try{ac=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{ac=!!window.navigator.geolocation}return ac})}().then(O=>this._finishSetupUI(O)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),s.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,rh=0,qh=!1}_isOutOfMapMaxBounds(Kt){let O=this._map.getMaxBounds(),pt=Kt.coords;return O&&(pt.longitudeO.getEast()||pt.latitudeO.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let Kt=this._map.getBounds(),O=Kt.getSouthEast(),pt=Kt.getNorthEast(),Dt=O.distanceTo(pt),Ft=Math.ceil(this._accuracy/(Dt/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Ft}px`,this._circleElement.style.height=`${Ft}px`}trigger(){if(!this._setup)return i.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new i.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":rh--,qh=!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 i.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new i.k("trackuserlocationstart")),this.fire(new i.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Kt;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),rh++,rh>1?(Kt={maximumAge:6e5,timeout:0},qh=!0):(Kt=this.options.positionOptions,qh=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Kt)}}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)}},n.Hash=Eh,n.ImageSource=xe,n.KeyboardHandler=Qr,n.LngLatBounds=dt,n.LogoControl=bo,n.Map=class extends os{constructor(Kt){i.bf.mark(i.bg.create);let O=Object.assign(Object.assign({},$c),Kt);if(O.minZoom!=null&&O.maxZoom!=null&&O.minZoom>O.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(O.minPitch!=null&&O.maxPitch!=null&&O.minPitch>O.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(O.minPitch!=null&&O.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(O.maxPitch!=null&&O.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Pc(O.minZoom,O.maxZoom,O.minPitch,O.maxPitch,O.renderWorldCopies),{bearingSnap:O.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new lo,this._controls=[],this._mapId=i.a4(),this._contextLost=pt=>{pt.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new i.k("webglcontextlost",{originalEvent:pt}))},this._contextRestored=pt=>{this._setupPainter(),this.resize(),this._update(),this.fire(new i.k("webglcontextrestored",{originalEvent:pt}))},this._onMapScroll=pt=>{if(pt.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=O.interactive,this._maxTileCacheSize=O.maxTileCacheSize,this._maxTileCacheZoomLevels=O.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=O.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=O.preserveDrawingBuffer===!0,this._antialias=O.antialias===!0,this._trackResize=O.trackResize===!0,this._bearingSnap=O.bearingSnap,this._refreshExpiredTiles=O.refreshExpiredTiles===!0,this._fadeDuration=O.fadeDuration,this._crossSourceCollisions=O.crossSourceCollisions===!0,this._collectResourceTiming=O.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},El),O.locale),this._clickTolerance=O.clickTolerance,this._overridePixelRatio=O.pixelRatio,this._maxCanvasSize=O.maxCanvasSize,this.transformCameraUpdate=O.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=O.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=d.addThrottleControl(()=>this.isMoving()),this._requestManager=new k(O.transformRequest),typeof O.container=="string"){if(this._container=document.getElementById(O.container),!this._container)throw new Error(`Container '${O.container}' not found.`)}else{if(!(O.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=O.container}if(O.maxBounds&&this.setMaxBounds(O.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let pt=!1,Dt=xd(Ft=>{this._trackResize&&!this._removed&&(this.resize(Ft),this.redraw())},50);this._resizeObserver=new ResizeObserver(Ft=>{pt?Dt(Ft):pt=!0}),this._resizeObserver.observe(this._container)}this.handlers=new fs(this,O),this._hash=O.hash&&new Eh(typeof O.hash=="string"&&O.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:O.center,zoom:O.zoom,bearing:O.bearing,pitch:O.pitch}),O.bounds&&(this.resize(),this.fitBounds(O.bounds,i.e({},O.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=O.localIdeographFontFamily,this._validateStyle=O.validateStyle,O.style&&this.setStyle(O.style,{localIdeographFontFamily:O.localIdeographFontFamily}),O.attributionControl&&this.addControl(new ws(typeof O.attributionControl=="boolean"?void 0:O.attributionControl)),O.maplibreLogo&&this.addControl(new bo,O.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",pt=>{this._update(pt.dataType==="style"),this.fire(new i.k(`${pt.dataType}data`,pt))}),this.on("dataloading",pt=>{this.fire(new i.k(`${pt.dataType}dataloading`,pt))}),this.on("dataabort",pt=>{this.fire(new i.k("sourcedataabort",pt))})}_getMapId(){return this._mapId}addControl(Kt,O){if(O===void 0&&(O=Kt.getDefaultPosition?Kt.getDefaultPosition():"top-right"),!Kt||!Kt.onAdd)return this.fire(new i.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let pt=Kt.onAdd(this);this._controls.push(Kt);let Dt=this._controlPositions[O];return O.indexOf("bottom")!==-1?Dt.insertBefore(pt,Dt.firstChild):Dt.appendChild(pt),this}removeControl(Kt){if(!Kt||!Kt.onRemove)return this.fire(new i.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let O=this._controls.indexOf(Kt);return O>-1&&this._controls.splice(O,1),Kt.onRemove(this),this}hasControl(Kt){return this._controls.indexOf(Kt)>-1}calculateCameraOptionsFromTo(Kt,O,pt,Dt){return Dt==null&&this.terrain&&(Dt=this.terrain.getElevationForLngLatZoom(pt,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Kt,O,pt,Dt)}resize(Kt){var O;let pt=this._containerDimensions(),Dt=pt[0],Ft=pt[1],qt=this._getClampedPixelRatio(Dt,Ft);if(this._resizeCanvas(Dt,Ft,qt),this.painter.resize(Dt,Ft,qt),this.painter.overLimit()){let je=this.painter.context.gl;this._maxCanvasSize=[je.drawingBufferWidth,je.drawingBufferHeight];let er=this._getClampedPixelRatio(Dt,Ft);this._resizeCanvas(Dt,Ft,er),this.painter.resize(Dt,Ft,er)}this.transform.resize(Dt,Ft),(O=this._requestedCameraState)===null||O===void 0||O.resize(Dt,Ft);let Ee=!this._moving;return Ee&&(this.stop(),this.fire(new i.k("movestart",Kt)).fire(new i.k("move",Kt))),this.fire(new i.k("resize",Kt)),Ee&&this.fire(new i.k("moveend",Kt)),this}_getClampedPixelRatio(Kt,O){let{0:pt,1:Dt}=this._maxCanvasSize,Ft=this.getPixelRatio(),qt=Kt*Ft,Ee=O*Ft;return Math.min(qt>pt?pt/qt:1,Ee>Dt?Dt/Ee:1)*Ft}getPixelRatio(){var Kt;return(Kt=this._overridePixelRatio)!==null&&Kt!==void 0?Kt:devicePixelRatio}setPixelRatio(Kt){this._overridePixelRatio=Kt,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Kt){return this.transform.setMaxBounds(dt.convert(Kt)),this._update()}setMinZoom(Kt){if((Kt=Kt??-2)>=-2&&Kt<=this.transform.maxZoom)return this.transform.minZoom=Kt,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Kt,this._update(),this.getZoom()>Kt&&this.setZoom(Kt),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Kt){if((Kt=Kt??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Kt>=0&&Kt<=this.transform.maxPitch)return this.transform.minPitch=Kt,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Kt>=this.transform.minPitch)return this.transform.maxPitch=Kt,this._update(),this.getPitch()>Kt&&this.setPitch(Kt),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Kt){return this.transform.renderWorldCopies=Kt,this._update()}project(Kt){return this.transform.locationPoint(i.N.convert(Kt),this.style&&this.terrain)}unproject(Kt){return this.transform.pointLocation(i.P.convert(Kt),this.terrain)}isMoving(){var Kt;return this._moving||((Kt=this.handlers)===null||Kt===void 0?void 0:Kt.isMoving())}isZooming(){var Kt;return this._zooming||((Kt=this.handlers)===null||Kt===void 0?void 0:Kt.isZooming())}isRotating(){var Kt;return this._rotating||((Kt=this.handlers)===null||Kt===void 0?void 0:Kt.isRotating())}_createDelegatedListener(Kt,O,pt){if(Kt==="mouseenter"||Kt==="mouseover"){let Dt=!1;return{layers:O,listener:pt,delegates:{mousemove:Ft=>{let qt=O.filter(je=>this.getLayer(je)),Ee=qt.length!==0?this.queryRenderedFeatures(Ft.point,{layers:qt}):[];Ee.length?Dt||(Dt=!0,pt.call(this,new hh(Kt,this,Ft.originalEvent,{features:Ee}))):Dt=!1},mouseout:()=>{Dt=!1}}}}if(Kt==="mouseleave"||Kt==="mouseout"){let Dt=!1;return{layers:O,listener:pt,delegates:{mousemove:Ft=>{let qt=O.filter(Ee=>this.getLayer(Ee));(qt.length!==0?this.queryRenderedFeatures(Ft.point,{layers:qt}):[]).length?Dt=!0:Dt&&(Dt=!1,pt.call(this,new hh(Kt,this,Ft.originalEvent)))},mouseout:Ft=>{Dt&&(Dt=!1,pt.call(this,new hh(Kt,this,Ft.originalEvent)))}}}}{let Dt=Ft=>{let qt=O.filter(je=>this.getLayer(je)),Ee=qt.length!==0?this.queryRenderedFeatures(Ft.point,{layers:qt}):[];Ee.length&&(Ft.features=Ee,pt.call(this,Ft),delete Ft.features)};return{layers:O,listener:pt,delegates:{[Kt]:Dt}}}}_saveDelegatedListener(Kt,O){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Kt]=this._delegatedListeners[Kt]||[],this._delegatedListeners[Kt].push(O)}_removeDelegatedListener(Kt,O,pt){if(!this._delegatedListeners||!this._delegatedListeners[Kt])return;let Dt=this._delegatedListeners[Kt];for(let Ft=0;FtO.includes(Ee))){for(let Ee in qt.delegates)this.off(Ee,qt.delegates[Ee]);return void Dt.splice(Ft,1)}}}on(Kt,O,pt){if(pt===void 0)return super.on(Kt,O);let Dt=this._createDelegatedListener(Kt,typeof O=="string"?[O]:O,pt);this._saveDelegatedListener(Kt,Dt);for(let Ft in Dt.delegates)this.on(Ft,Dt.delegates[Ft]);return this}once(Kt,O,pt){if(pt===void 0)return super.once(Kt,O);let Dt=typeof O=="string"?[O]:O,Ft=this._createDelegatedListener(Kt,Dt,pt);for(let qt in Ft.delegates){let Ee=Ft.delegates[qt];Ft.delegates[qt]=(...je)=>{this._removeDelegatedListener(Kt,Dt,pt),Ee(...je)}}this._saveDelegatedListener(Kt,Ft);for(let qt in Ft.delegates)this.once(qt,Ft.delegates[qt]);return this}off(Kt,O,pt){return pt===void 0?super.off(Kt,O):(this._removeDelegatedListener(Kt,typeof O=="string"?[O]:O,pt),this)}queryRenderedFeatures(Kt,O){if(!this.style)return[];let pt,Dt=Kt instanceof i.P||Array.isArray(Kt),Ft=Dt?Kt:[[0,0],[this.transform.width,this.transform.height]];if(O=O||(Dt?{}:Kt)||{},Ft instanceof i.P||typeof Ft[0]=="number")pt=[i.P.convert(Ft)];else{let qt=i.P.convert(Ft[0]),Ee=i.P.convert(Ft[1]);pt=[qt,new i.P(Ee.x,qt.y),Ee,new i.P(qt.x,Ee.y),qt]}return this.style.queryRenderedFeatures(pt,O,this.transform)}querySourceFeatures(Kt,O){return this.style.querySourceFeatures(Kt,O)}setStyle(Kt,O){return(O=i.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},O)).diff!==!1&&O.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Kt?(this._diffStyle(Kt,O),this):(this._localIdeographFontFamily=O.localIdeographFontFamily,this._updateStyle(Kt,O))}setTransformRequest(Kt){return this._requestManager.setTransformRequest(Kt),this}_getUIString(Kt){let O=this._locale[Kt];if(O==null)throw new Error(`Missing UI string '${Kt}'`);return O}_updateStyle(Kt,O){if(O.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Kt,O));let pt=this.style&&O.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Kt)),Kt?(this.style=new un(this,O||{}),this.style.setEventedParent(this,{style:this.style}),typeof Kt=="string"?this.style.loadURL(Kt,O,pt):this.style.loadJSON(Kt,O,pt),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new un(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Kt,O){if(typeof Kt=="string"){let pt=this._requestManager.transformRequest(Kt,"Style");i.h(pt,new AbortController).then(Dt=>{this._updateDiff(Dt.data,O)}).catch(Dt=>{Dt&&this.fire(new i.j(Dt))})}else typeof Kt=="object"&&this._updateDiff(Kt,O)}_updateDiff(Kt,O){try{this.style.setState(Kt,O)&&this._update(!0)}catch(pt){i.w(`Unable to perform style diff: ${pt.message||pt.error||pt}. Rebuilding the style from scratch.`),this._updateStyle(Kt,O)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():i.w("There is no style added to the map.")}addSource(Kt,O){return this._lazyInitEmptyStyle(),this.style.addSource(Kt,O),this._update(!0)}isSourceLoaded(Kt){let O=this.style&&this.style.sourceCaches[Kt];if(O!==void 0)return O.loaded();this.fire(new i.j(new Error(`There is no source with ID '${Kt}'`)))}setTerrain(Kt){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Kt){let O=this.style.sourceCaches[Kt.source];if(!O)throw new Error(`cannot load terrain, because there exists no source with ID: ${Kt.source}`);this.terrain===null&&O.reload();for(let pt in this.style._layers){let Dt=this.style._layers[pt];Dt.type==="hillshade"&&Dt.source===Kt.source&&i.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Vl(this.painter,O,Kt),this.painter.renderToTexture=new vc(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=pt=>{pt.dataType==="style"?this.terrain.sourceCache.freeRtt():pt.dataType==="source"&&pt.tile&&(pt.sourceId!==Kt.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(pt.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.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new i.k("terrain",{terrain:Kt})),this}getTerrain(){var Kt,O;return(O=(Kt=this.terrain)===null||Kt===void 0?void 0:Kt.options)!==null&&O!==void 0?O:null}areTilesLoaded(){let Kt=this.style&&this.style.sourceCaches;for(let O in Kt){let pt=Kt[O]._tiles;for(let Dt in pt){let Ft=pt[Dt];if(Ft.state!=="loaded"&&Ft.state!=="errored")return!1}}return!0}removeSource(Kt){return this.style.removeSource(Kt),this._update(!0)}getSource(Kt){return this.style.getSource(Kt)}addImage(Kt,O,pt={}){let{pixelRatio:Dt=1,sdf:Ft=!1,stretchX:qt,stretchY:Ee,content:je,textFitWidth:er,textFitHeight:wr}=pt;if(this._lazyInitEmptyStyle(),!(O instanceof HTMLImageElement||i.b(O))){if(O.width===void 0||O.height===void 0)return this.fire(new i.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:Gr,height:Zr,data:Tn}=O,qn=O;return this.style.addImage(Kt,{data:new i.R({width:Gr,height:Zr},new Uint8Array(Tn)),pixelRatio:Dt,stretchX:qt,stretchY:Ee,content:je,textFitWidth:er,textFitHeight:wr,sdf:Ft,version:0,userImage:qn}),qn.onAdd&&qn.onAdd(this,Kt),this}}{let{width:Gr,height:Zr,data:Tn}=c.getImageData(O);this.style.addImage(Kt,{data:new i.R({width:Gr,height:Zr},Tn),pixelRatio:Dt,stretchX:qt,stretchY:Ee,content:je,textFitWidth:er,textFitHeight:wr,sdf:Ft,version:0})}}updateImage(Kt,O){let pt=this.style.getImage(Kt);if(!pt)return this.fire(new i.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let Dt=O instanceof HTMLImageElement||i.b(O)?c.getImageData(O):O,{width:Ft,height:qt,data:Ee}=Dt;if(Ft===void 0||qt===void 0)return this.fire(new i.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Ft!==pt.data.width||qt!==pt.data.height)return this.fire(new i.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let je=!(O instanceof HTMLImageElement||i.b(O));return pt.data.replace(Ee,je),this.style.updateImage(Kt,pt),this}getImage(Kt){return this.style.getImage(Kt)}hasImage(Kt){return Kt?!!this.style.getImage(Kt):(this.fire(new i.j(new Error("Missing required image id"))),!1)}removeImage(Kt){this.style.removeImage(Kt)}loadImage(Kt){return d.getImage(this._requestManager.transformRequest(Kt,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Kt,O){return this._lazyInitEmptyStyle(),this.style.addLayer(Kt,O),this._update(!0)}moveLayer(Kt,O){return this.style.moveLayer(Kt,O),this._update(!0)}removeLayer(Kt){return this.style.removeLayer(Kt),this._update(!0)}getLayer(Kt){return this.style.getLayer(Kt)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Kt,O,pt){return this.style.setLayerZoomRange(Kt,O,pt),this._update(!0)}setFilter(Kt,O,pt={}){return this.style.setFilter(Kt,O,pt),this._update(!0)}getFilter(Kt){return this.style.getFilter(Kt)}setPaintProperty(Kt,O,pt,Dt={}){return this.style.setPaintProperty(Kt,O,pt,Dt),this._update(!0)}getPaintProperty(Kt,O){return this.style.getPaintProperty(Kt,O)}setLayoutProperty(Kt,O,pt,Dt={}){return this.style.setLayoutProperty(Kt,O,pt,Dt),this._update(!0)}getLayoutProperty(Kt,O){return this.style.getLayoutProperty(Kt,O)}setGlyphs(Kt,O={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Kt,O),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Kt,O,pt={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Kt,O,pt,Dt=>{Dt||this._update(!0)}),this}removeSprite(Kt){return this._lazyInitEmptyStyle(),this.style.removeSprite(Kt),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Kt,O={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Kt,O,pt=>{pt||this._update(!0)}),this}setLight(Kt,O={}){return this._lazyInitEmptyStyle(),this.style.setLight(Kt,O),this._update(!0)}getLight(){return this.style.getLight()}setSky(Kt){return this._lazyInitEmptyStyle(),this.style.setSky(Kt),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Kt,O){return this.style.setFeatureState(Kt,O),this._update()}removeFeatureState(Kt,O){return this.style.removeFeatureState(Kt,O),this._update()}getFeatureState(Kt){return this.style.getFeatureState(Kt)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Kt=0,O=0;return this._container&&(Kt=this._container.clientWidth||400,O=this._container.clientHeight||300),[Kt,O]}_setupContainer(){let Kt=this._container;Kt.classList.add("maplibregl-map");let O=this._canvasContainer=s.create("div","maplibregl-canvas-container",Kt);this._interactive&&O.classList.add("maplibregl-interactive"),this._canvas=s.create("canvas","maplibregl-canvas",O),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let pt=this._containerDimensions(),Dt=this._getClampedPixelRatio(pt[0],pt[1]);this._resizeCanvas(pt[0],pt[1],Dt);let Ft=this._controlContainer=s.create("div","maplibregl-control-container",Kt),qt=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(Ee=>{qt[Ee]=s.create("div",`maplibregl-ctrl-${Ee} `,Ft)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Kt,O,pt){this._canvas.width=Math.floor(pt*Kt),this._canvas.height=Math.floor(pt*O),this._canvas.style.width=`${Kt}px`,this._canvas.style.height=`${O}px`}_setupPainter(){let Kt={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},O=null;this._canvas.addEventListener("webglcontextcreationerror",Dt=>{O={requestedAttributes:Kt},Dt&&(O.statusMessage=Dt.statusMessage,O.type=Dt.type)},{once:!0});let pt=this._canvas.getContext("webgl2",Kt)||this._canvas.getContext("webgl",Kt);if(!pt){let Dt="Failed to initialize WebGL";throw O?(O.message=Dt,new Error(JSON.stringify(O))):new Error(Dt)}this.painter=new rd(pt,this.transform),h.testSupport(pt)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Kt){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Kt,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Kt){return this._update(),this._renderTaskQueue.add(Kt)}_cancelRenderFrame(Kt){this._renderTaskQueue.remove(Kt)}_render(Kt){let O=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Kt),this._removed)return;let pt=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Ft=this.transform.zoom,qt=c.now();this.style.zoomHistory.update(Ft,qt);let Ee=new i.z(Ft,{now:qt,fadeDuration:O,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),je=Ee.crossFadingFactor();je===1&&je===this._crossFadingFactor||(pt=!0,this._crossFadingFactor=je),this.style.update(Ee)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,O,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:O,showPadding:this.showPadding}),this.fire(new i.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,i.bf.mark(i.bg.load),this.fire(new i.k("load"))),this.style&&(this.style.hasTransitions()||pt)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let Dt=this._sourcesDirty||this._styleDirty||this._placementDirty;return Dt||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new i.k("idle")),!this._loaded||this._fullyLoaded||Dt||(this._fullyLoaded=!0,i.bf.mark(i.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Kt;this._hash&&this._hash.remove();for(let pt of this._controls)pt.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),d.removeThrottleControl(this._imageQueueHandle),(Kt=this._resizeObserver)===null||Kt===void 0||Kt.disconnect();let O=this.painter.context.gl.getExtension("WEBGL_lose_context");O!=null&&O.loseContext&&O.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),s.remove(this._canvasContainer),s.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),i.bf.clearMetrics(),this._removed=!0,this.fire(new i.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,c.frameAsync(this._frameRequest).then(Kt=>{i.bf.frame(Kt),this._frameRequest=null,this._render(Kt)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Kt){this._showTileBoundaries!==Kt&&(this._showTileBoundaries=Kt,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Kt){this._showPadding!==Kt&&(this._showPadding=Kt,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Kt){this._showCollisionBoxes!==Kt&&(this._showCollisionBoxes=Kt,Kt?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Kt){this._showOverdrawInspector!==Kt&&(this._showOverdrawInspector=Kt,this._update())}get repaint(){return!!this._repaint}set repaint(Kt){this._repaint!==Kt&&(this._repaint=Kt,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Kt){this._vertices=Kt,this._update()}get version(){return tu}getCameraTargetElevation(){return this.transform.elevation}},n.MapMouseEvent=hh,n.MapTouchEvent=kd,n.MapWheelEvent=Hd,n.Marker=Vu,n.NavigationControl=class{constructor(Kt){this._updateZoomButtons=()=>{let O=this._map.getZoom(),pt=O===this._map.getMaxZoom(),Dt=O===this._map.getMinZoom();this._zoomInButton.disabled=pt,this._zoomOutButton.disabled=Dt,this._zoomInButton.setAttribute("aria-disabled",pt.toString()),this._zoomOutButton.setAttribute("aria-disabled",Dt.toString())},this._rotateCompassArrow=()=>{let O=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=O},this._setButtonTitle=(O,pt)=>{let Dt=this._map._getUIString(`NavigationControl.${pt}`);O.title=Dt,O.setAttribute("aria-label",Dt)},this.options=i.e({},qo,Kt),this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",O=>O.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",O=>this._map.zoomIn({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",O=>this._map.zoomOut({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",O=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:O}):this._map.resetNorth({},{originalEvent:O})}),this._compassIcon=s.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Kt){return this._map=Kt,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 Bs(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){s.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(Kt,O){let pt=s.create("button",Kt,this._container);return pt.type="button",pt.addEventListener("click",O),pt}},n.Popup=class extends i.E{constructor(Kt){super(),this.remove=()=>(this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new i.k("close"))),this),this._onMouseUp=O=>{this._update(O.point)},this._onMouseMove=O=>{this._update(O.point)},this._onDrag=O=>{this._update(O.point)},this._update=O=>{var pt;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=s.create("div","maplibregl-popup",this._map.getContainer()),this._tip=s.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let je of this.options.className.split(" "))this._container.classList.add(je);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Zl(this._lngLat,this._flatPos,this._map.transform):(pt=this._lngLat)===null||pt===void 0?void 0:pt.wrap(),this._trackPointer&&!O)return;let Dt=this._flatPos=this._pos=this._trackPointer&&O?O:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&O?O:this._map.transform.locationPoint(this._lngLat));let Ft=this.options.anchor,qt=eu(this.options.offset);if(!Ft){let je=this._container.offsetWidth,er=this._container.offsetHeight,wr;wr=Dt.y+qt.bottom.ythis._map.transform.height-er?["bottom"]:[],Dt.xthis._map.transform.width-je/2&&wr.push("right"),Ft=wr.length===0?"bottom":wr.join("-")}let Ee=Dt.add(qt[Ft]);this.options.subpixelPositioning||(Ee=Ee.round()),s.setTransform(this._container,`${Mu[Ft]} translate(${Ee.x}px,${Ee.y}px)`),eh(this._container,Ft,"popup")},this._onClose=()=>{this.remove()},this.options=i.e(Object.create($s),Kt)}addTo(Kt){return this._map&&this.remove(),this._map=Kt,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 i.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Kt){return this._lngLat=i.N.convert(Kt),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Kt){return this.setDOMContent(document.createTextNode(Kt))}setHTML(Kt){let O=document.createDocumentFragment(),pt=document.createElement("body"),Dt;for(pt.innerHTML=Kt;Dt=pt.firstChild,Dt;)O.appendChild(Dt);return this.setDOMContent(O)}getMaxWidth(){var Kt;return(Kt=this._container)===null||Kt===void 0?void 0:Kt.style.maxWidth}setMaxWidth(Kt){return this.options.maxWidth=Kt,this._update(),this}setDOMContent(Kt){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=s.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Kt),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Kt){return this._container&&this._container.classList.add(Kt),this}removeClassName(Kt){return this._container&&this._container.classList.remove(Kt),this}setOffset(Kt){return this.options.offset=Kt,this._update(),this}toggleClassName(Kt){if(this._container)return this._container.classList.toggle(Kt)}setSubpixelPositioning(Kt){this.options.subpixelPositioning=Kt}_createCloseButton(){this.options.closeButton&&(this._closeButton=s.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Kt=this._container.querySelector(nh);Kt&&Kt.focus()}},n.RasterDEMTileSource=Zt,n.RasterTileSource=Bt,n.ScaleControl=class{constructor(Kt){this._onMove=()=>{Gh(this._map,this._container,this.options)},this.setUnit=O=>{this.options.unit=O,Gh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Wc),Kt)}getDefaultPosition(){return"bottom-left"}onAdd(Kt){return this._map=Kt,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Kt.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},n.ScrollZoomHandler=di,n.Style=un,n.TerrainControl=class{constructor(Kt){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Kt}onAdd(Kt){return this._map=Kt,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=s.create("button","maplibregl-ctrl-terrain",this._container),s.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(){s.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},n.TwoFingersTouchPitchHandler=sf,n.TwoFingersTouchRotateHandler=Td,n.TwoFingersTouchZoomHandler=fc,n.TwoFingersTouchZoomRotateHandler=Sa,n.VectorTileSource=Rt,n.VideoSource=ge,n.addSourceType=(Kt,O)=>i._(void 0,void 0,void 0,function*(){if(Mt(Kt))throw new Error(`A source type called "${Kt}" already exists.`);((pt,Dt)=>{ue[pt]=Dt})(Kt,O)}),n.clearPrewarmedResources=function(){let Kt=ut;Kt&&(Kt.isPreloaded()&&Kt.numActive()===1?(Kt.release(ht),ut=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()"))},n.getMaxParallelImageRequests=function(){return i.a.MAX_PARALLEL_IMAGE_REQUESTS},n.getRTLTextPluginStatus=function(){return be().getRTLTextPluginStatus()},n.getVersion=function(){return lf},n.getWorkerCount=function(){return bt.workerCount},n.getWorkerUrl=function(){return i.a.WORKER_URL},n.importScriptInWorkers=function(Kt){return st().broadcast("IS",Kt)},n.prewarm=function(){gt().acquire(ht)},n.setMaxParallelImageRequests=function(Kt){i.a.MAX_PARALLEL_IMAGE_REQUESTS=Kt},n.setRTLTextPlugin=function(Kt,O){return be().setRTLTextPlugin(Kt,O)},n.setWorkerCount=function(Kt){bt.workerCount=Kt},n.setWorkerUrl=function(Kt){i.a.WORKER_URL=Kt}});var P=f;return P})}),Mtt=It((et,Y)=>{var f=jn(),y=uu().sanitizeHTML,z=Az(),P=Y_();function n(c,s){this.subplot=c,this.uid=c.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var i=n.prototype;i.update=function(c){this.visible?this.needsNewImage(c)?this.updateImage(c):this.needsNewSource(c)?(this.removeLayer(),this.updateSource(c),this.updateLayer(c)):this.needsNewLayer(c)?this.updateLayer(c):this.updateStyle(c):(this.updateSource(c),this.updateLayer(c)),this.visible=a(c)},i.needsNewImage=function(c){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&c.sourcetype==="image"&&(this.source!==c.source||JSON.stringify(this.coordinates)!==JSON.stringify(c.coordinates))},i.needsNewSource=function(c){return this.sourceType!==c.sourcetype||JSON.stringify(this.source)!==JSON.stringify(c.source)||this.layerType!==c.type},i.needsNewLayer=function(c){return this.layerType!==c.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},i.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},i.updateImage=function(c){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:c.source,coordinates:c.coordinates});var h=this.findFollowingMapLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},i.updateSource=function(c){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=c.sourcetype,this.source=c.source,!!a(c)){var h=o(c);s.addSource(this.idSource,h)}},i.findFollowingMapLayerId=function(c){if(c==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(c){var s={},h={};switch(c.type){case"circle":f.extendFlat(h,{"circle-radius":c.circle.radius,"circle-color":c.color,"circle-opacity":c.opacity});break;case"line":f.extendFlat(h,{"line-width":c.line.width,"line-color":c.color,"line-opacity":c.opacity,"line-dasharray":c.line.dash});break;case"fill":f.extendFlat(h,{"fill-color":c.color,"fill-outline-color":c.fill.outlinecolor,"fill-opacity":c.opacity});break;case"symbol":var m=c.symbol,b=z(m.textposition,m.iconsize);f.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),f.extendFlat(h,{"icon-color":c.color,"text-color":m.textfont.color,"text-opacity":c.opacity});break;case"raster":f.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":c.opacity});break}return{layout:s,paint:h}}function o(c){var s=c.sourcetype,h=c.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=c.coordinates),m[b]=h,c.sourceattribution&&(m.attribution=y(c.sourceattribution)),m}Y.exports=function(c,s,h){var m=new n(c,s);return m.update(h),m}}),Ett=It((et,Y)=>{var f=Att(),y=jn(),z=q_(),P=ls(),n=Fs(),i=Up(),a=hd(),l=dm(),o=l.drawMode,c=l.selectMode,s=Md().prepSelect,h=Md().clearOutline,m=Md().clearSelectionsCache,b=Md().selectOnClick,x=Y_(),_=Mtt();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var d=A.prototype;d.plot=function(I,M,p){var g=this,C;g.map?C=new Promise(function(S,N){g.updateMap(I,M,S,N)}):C=new Promise(function(S,N){g.createMap(I,M,S,N)}),p.push(C)},d.createMap=function(I,M,p,g){var C=this,S=M[C.id],N=C.styleObj=w(S.style),B=S.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new f.Map({container:C.div,style:N.style,center:E(S.center),zoom:S.zoom,bearing:S.bearing,pitch:S.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new f.AttributionControl({compact:!0})),W={};V.on("styleimagemissing",function(H){var q=H.id;if(!W[q]&&q.includes("-15")){W[q]=!0;var G=new Image(15,15);G.onload=function(){V.addImage(q,G)},G.crossOrigin="Anonymous",G.src="https://unpkg.com/maki@2.1.0/icons/"+q+".svg"}}),V.setTransformRequest(function(H){return H=H.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),H=H.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),H=H.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:H}}),V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var F=[];F.push(new Promise(function(H){V.once("load",H)})),F=F.concat(z.fetchTraceGeoData(I)),Promise.all(F).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.updateMap=function(I,M,p,g){var C=this,S=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,S.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){S.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},d.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,S,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},d.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var S=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),c(S)||o(S)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,S)},i.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},d.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},d.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var f=jn(),y=O_(),z=Zf(),P=Fk();Y.exports=function(a,l,o){y(a,l,o,{type:"map",attributes:P,handleDefaults:n,partition:"y"})};function n(a,l,o){o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var c=o("bounds.west"),s=o("bounds.east"),h=o("bounds.south"),m=o("bounds.north");(c===void 0||s===void 0||h===void 0||m===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:i}),l._input=a}function i(a,l){function o(x,_){return f.coerce(a,l,P.layers,x,_)}var c=o("visible");if(c){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",f.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),f.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),kA=It(et=>{var Y=jn(),f=Y.strTranslate,y=Y.strScale,z=Mf().getSubplotCalcData,P=k0(),n=Br(),i=Js(),a=uu(),l=Ett(),o="map";et.name=o,et.attr="subplot",et.idRoot=o,et.idRegex=et.attrRegex=Y.counterRegex(o),et.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},et.layoutAttributes=Fk(),et.supplyLayoutDefaults=Ltt(),et.plot=function(c){for(var s=c._fullLayout,h=c.calcdata,m=s._subplots[o],b=0;bp/2){var g=D.split("|").join("
");I.text(g).attr("data-unformatted",g).call(a.convertToTspans,c),M=i.bBox(I.node())}I.attr("transform",f(-3,-M.height+8)),E.insert("rect",".static-attribution").attr({x:-M.width-6,y:-M.height-3,width:M.width+6,height:M.height+3,fill:"rgba(255, 255, 255, 0.75)"});var C=1;M.width+6>p&&(C=p/(M.width+6));var S=[m.l+m.w*_.x[1],m.t+m.h*(1-_.y[0])];E.attr("transform",f(S[0],S[1])+y(C))}},et.updateFx=function(c){for(var s=c._fullLayout,h=s._subplots[o],m=0;m{Y.exports={attributes:bA(),supplyDefaults:wtt(),colorbar:Do(),formatLabels:Cz(),calc:JC(),plot:Ttt(),hoverPoints:wA().hoverPoints,eventData:Stt(),selectPoints:Ctt(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermap",basePlotModule:kA(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),Itt=It((et,Y)=>{Y.exports=Ptt()}),Mz=It((et,Y)=>{var f=Kw(),y=Ru(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=nu(),n=xa(),i=Yn().extendFlat;Y.exports=i({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:i({},f.featureidkey,{}),below:{valType:"string",editType:"plot"},text:f.text,hovertext:f.hovertext,marker:{line:{color:i({},f.marker.line.color,{editType:"plot"}),width:i({},f.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:i({},f.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:i({},f.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:i({},f.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:f.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:i({},n.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),Dtt=It((et,Y)=>{var f=jn(),y=Cu(),z=Mz();Y.exports=function(P,n,i,a){function l(m,b){return f.coerce(P,n,z,m,b)}var o=l("locations"),c=l("z"),s=l("geojson");if(!f.isArrayOrTypedArray(o)||!o.length||!f.isArrayOrTypedArray(c)||!c.length||!(typeof s=="string"&&s!==""||f.isPlainObject(s))){n.visible=!1;return}l("featureidkey"),n._length=Math.min(o.length,c.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,n,a,l,{prefix:"",cLetter:"z"}),f.coerceSelectionMarkerOpacity(n,l)}}),Ez=It((et,Y)=>{var f=Sr(),y=jn(),z=ch(),P=Js(),n=W_().makeBlank,i=q_();function a(o){var c=o[0].trace,s=c.visible===!0&&c._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=c._opts={fill:h,line:m,geojson:n()};if(!s)return b;var x=i.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(c),A=c.marker,d=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var S=C.mo;return f(S)?+y.constrain(S,0,1):0});var w;y.isArrayOrTypedArray(d.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(d.width)&&(D=function(C){return C.mlw});for(var E=0;E{var f=Ez().convert,y=Ez().convertOnSelect,z=Y_().traceLayerPrefix;function P(i,a){this.type="choroplethmap",this.subplot=i,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var n=P.prototype;n.update=function(i){this._update(f(i)),i[0].trace._glTrace=this},n.updateOnSelect=function(i){this._update(y(i))},n._update=function(i){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(i.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(i,o),this.below=o);for(var c=0;c=0;l--)i.removeLayer(a[l][1])},n.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,a){var l=a[0].trace,o=new P(i,l.uid),c=o.sourceId,s=f(a),h=o.below=i.belowLookup["trace-"+l.uid];return i.map.addSource(c,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),Ott=It((et,Y)=>{Y.exports={attributes:Mz(),supplyDefaults:Dtt(),colorbar:z_(),calc:rA(),plot:ztt(),hoverPoints:iA(),eventData:aA(),selectPoints:oA(),styleOnSelect:function(f,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(f,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var n=z[P].id;if(typeof n=="string"&&n.indexOf("water")===0){for(var i=P+1;i{Y.exports=Ott()}),Lz=It((et,Y)=>{var f=Ru(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=xa(),n=bA(),i=Yn().extendFlat;Y.exports=i({lon:n.lon,lat:n.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:n.text,hovertext:n.hovertext,hoverinfo:i({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:i({},P.showlegend,{dflt:!1})},f("",{cLetter:"z",editTypeOverride:"calc"}))}),Rtt=It((et,Y)=>{var f=jn(),y=Cu(),z=Lz();Y.exports=function(P,n,i,a){function l(h,m){return f.coerce(P,n,z,h,m)}var o=l("lon")||[],c=l("lat")||[],s=Math.min(o.length,c.length);if(!s){n.visible=!1;return}n._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,n,a,l,{prefix:"",cLetter:"z"})}}),Ftt=It((et,Y)=>{var f=Sr(),y=jn().isArrayOrTypedArray,z=Dr().BADNUM,P=Cp(),n=jn()._;Y.exports=function(i,a){for(var l=a._length,o=new Array(l),c=a.z,s=y(c)&&c.length,h=0;h{var f=Sr(),y=jn(),z=Hn(),P=ch(),n=Dr().BADNUM,i=W_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,c={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:c,geojson:i()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var f=Ntt(),y=Y_().traceLayerPrefix;function z(n,i){this.type="densitymap",this.subplot=n,this.uid=i,this.sourceId="source-"+i,this.layerList=[["heatmap",y+i+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(n){var i=this.subplot,a=this.layerList,l=f(n),o=i.belowLookup["trace-"+this.uid];i.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var c=0;c=0;a--)n.removeLayer(i[a][1])},P.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,i){var a=i[0].trace,l=new z(n,a.uid),o=l.sourceId,c=f(i),s=l.below=n.belowLookup["trace-"+a.uid];return n.map.addSource(o,{type:"geojson",data:c.geojson}),l._addLayers(c,s),l}}),Utt=It((et,Y)=>{var f=Fs(),y=wA().hoverPoints,z=wA().getExtraText;Y.exports=function(P,n,i){var a=y(P,n,i);if(a){var l=a[0],o=l.cd,c=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=f.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(c,s,o[0].t.labels),[l]}}}),$tt=It((et,Y)=>{Y.exports=function(f,y){return f.lon=y.lon,f.lat=y.lat,f.z=y.z,f}}),Htt=It((et,Y)=>{Y.exports={attributes:Lz(),supplyDefaults:Rtt(),colorbar:z_(),formatLabels:Cz(),calc:Ftt(),plot:jtt(),hoverPoints:Utt(),eventData:$tt(),getBelow:function(f,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=Htt()}),Pz=It((et,Y)=>{var f=hi(),y=xa(),z=Sn(),P=oo(),n=Jh().attributes,{hovertemplateAttrs:i,templatefallbackAttrs:a}=nu(),l=Ru(),o=Tc().templatedArray,c=Sh().descriptionOnlyNumbers,s=Yn().extendFlat,h=sh().overrideAll;Y.exports=h({hoverinfo:s({},y.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:P.hoverlabel,domain:n({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:c("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:f({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:i({},{keys:["value","label"]}),hovertemplatefallback:a(),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:i({},{keys:["value","label"]}),hovertemplatefallback:a(),colorscales:o("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:s(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),Wtt=It((et,Y)=>{var f=jn(),y=Pz(),z=Hn(),P=Xi(),n=Jh().defaults,i=qv(),a=Tc(),l=Zf();Y.exports=function(c,s,h,m){function b(N,B){return f.coerce(c,s,y,N,B)}var x=f.extendDeep(m.hoverlabel,c.hoverlabel),_=c.node,A=a.newContainer(s,"node");function d(N,B){return f.coerce(_,A,y.node,N,B)}d("label"),d("groups"),d("x"),d("y"),d("pad"),d("thickness"),d("line.color"),d("line.width"),d("hoverinfo",c.hoverinfo),i(_,A,d,x),d("hovertemplate"),d("align");var k=m.colorway,w=function(N){return k[N%k.length]};d("color",A.label.map(function(N,B){return z.addOpacity(w(B),.8)})),d("customdata");var D=c.link||{},E=a.newContainer(s,"link");function I(N,B){return f.coerce(D,E,y.link,N,B)}I("label"),I("arrowlen"),I("source"),I("target"),I("value"),I("line.color"),I("line.width"),I("hoverinfo",c.hoverinfo),i(D,E,I,x),I("hovertemplate");var M=P(m.paper_bgcolor).getLuminance()<.333,p=M?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",g=I("color",p);function C(N){var B=P(N);if(!B.isValid())return N;var U=B.getAlpha();return U<=.8?B.setAlpha(U+.2):B=M?B.brighten():B.darken(),B.toRgbString()}I("hovercolor",Array.isArray(g)?g.map(C):C(g)),I("customdata"),l(D,E,{name:"colorscales",handleItemDefaults:o}),n(s,m,b),b("orientation"),b("valueformat"),b("valuesuffix");var S;A.x.length&&A.y.length&&(S="freeform"),b("arrangement",S),f.coerceFont(b,"textfont",m.font,{autoShadowDflt:!0}),s._length=null};function o(c,s){function h(m,b){return f.coerce(c,s,y.link.colorscales,m,b)}h("label"),h("cmin"),h("cmax"),h("colorscale")}}),Iz=It((et,Y)=>{Y.exports=f;function f(y){for(var z=y.length,P=new Array(z),n=new Array(z),i=new Array(z),a=new Array(z),l=new Array(z),o=new Array(z),c=0;c0;){d=w[w.length-1];var D=y[d];if(a[d]=0&&o[d].push(l[I])}a[d]=E}else{if(n[d]===P[d]){for(var M=[],p=[],g=0,E=k.length-1;E>=0;--E){var C=k[E];if(i[C]=!1,M.push(C),p.push(o[C]),g+=o[C].length,l[C]=h.length,C===d){k.length=E;break}}h.push(M);for(var S=new Array(g),E=0;E{var f=Iz(),y=jn(),z=e1().wrap,P=y.isArrayOrTypedArray,n=y.isIndex,i=ch();function a(o){var c=o.node,s=o.link,h=[],m=P(s.color),b=P(s.hovercolor),x=P(s.customdata),_={},A={},d=s.colorscales.length,k;for(k=0;kI&&(I=s.source[k]),s.target[k]>I&&(I=s.target[k]);var M=I+1;o.node._count=M;var p,g=o.node.groups,C={};for(k=0;k0&&n(W,M)&&n(F,M)&&!(C.hasOwnProperty(W)&&C.hasOwnProperty(F)&&C[W]===C[F])){C.hasOwnProperty(F)&&(F=C[F]),C.hasOwnProperty(W)&&(W=C[W]),W=+W,F=+F,_[W]=_[F]=!0;var H="";s.label&&s.label[k]&&(H=s.label[k]);var q=null;H&&A.hasOwnProperty(H)&&(q=A[H]),h.push({pointNumber:k,label:H,color:m?s.color[k]:s.color,hovercolor:b?s.hovercolor[k]:s.hovercolor,customdata:x?s.customdata[k]:s.customdata,concentrationscale:q,source:W,target:F,value:+V}),U.source.push(W),U.target.push(F)}}var G=M+g.length,tt=P(c.color),ht=P(c.customdata),bt=[];for(k=0;kM-1,childrenNodes:[],pointNumber:k,label:vt,color:tt?c.color[k]:c.color,customdata:ht?c.customdata[k]:c.customdata})}var ut=!1;return l(G,U.source,U.target)&&(ut=!0),{circular:ut,links:h,nodes:bt,groups:g,groupLookup:C}}function l(o,c,s){for(var h=y.init2dArray(o,0),m=0;m1})}Y.exports=function(o,c){var s=a(c);return z({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}),Gtt=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){function y(M){var p=+this._x.call(null,M),g=+this._y.call(null,M);return z(this.cover(p,g),p,g,M)}function z(M,p,g,C){if(isNaN(p)||isNaN(g))return M;var S,N=M._root,B={data:C},U=M._x0,V=M._y0,W=M._x1,F=M._y1,H,q,G,tt,ht,bt,vt,ut;if(!N)return M._root=B,M;for(;N.length;)if((ht=p>=(H=(U+W)/2))?U=H:W=H,(bt=g>=(q=(V+F)/2))?V=q:F=q,S=N,!(N=N[vt=bt<<1|ht]))return S[vt]=B,M;if(G=+M._x.call(null,N.data),tt=+M._y.call(null,N.data),p===G&&g===tt)return B.next=N,S?S[vt]=B:M._root=B,M;do S=S?S[vt]=new Array(4):M._root=new Array(4),(ht=p>=(H=(U+W)/2))?U=H:W=H,(bt=g>=(q=(V+F)/2))?V=q:F=q;while((vt=bt<<1|ht)===(ut=(tt>=q)<<1|G>=H));return S[ut]=N,S[vt]=B,M}function P(M){var p,g,C=M.length,S,N,B=new Array(C),U=new Array(C),V=1/0,W=1/0,F=-1/0,H=-1/0;for(g=0;gF&&(F=S),NH&&(H=N));if(V>F||W>H)return this;for(this.cover(V,W).cover(F,H),g=0;gM||M>=S||C>p||p>=N;)switch(W=(pF||(U=tt.y0)>H||(V=tt.x1)=vt)<<1|M>=bt)&&(tt=q[q.length-1],q[q.length-1]=q[q.length-1-ht],q[q.length-1-ht]=tt)}else{var ut=M-+this._x.call(null,G.data),rt=p-+this._y.call(null,G.data),gt=ut*ut+rt*rt;if(gt=(q=(B+V)/2))?B=q:V=q,(ht=H>=(G=(U+W)/2))?U=G:W=G,p=g,!(g=g[bt=ht<<1|tt]))return this;if(!g.length)break;(p[bt+1&3]||p[bt+2&3]||p[bt+3&3])&&(C=p,vt=bt)}for(;g.data!==M;)if(S=g,!(g=g.next))return this;return(N=g.next)&&delete g.next,S?(N?S.next=N:delete S.next,this):p?(N?p[bt]=N:delete p[bt],(g=p[0]||p[1]||p[2]||p[3])&&g===(p[3]||p[2]||p[1]||p[0])&&!g.length&&(C?C[vt]=g:this._root=g),this):(this._root=N,this)}function s(M){for(var p=0,g=M.length;p{(function(f,y){y(typeof et=="object"&&typeof Y<"u"?et:f.d3=f.d3||{})})(et,function(f){var y="$";function z(){}z.prototype=P.prototype={constructor:z,has:function(_){return y+_ in this},get:function(_){return this[y+_]},set:function(_,A){return this[y+_]=A,this},remove:function(_){var A=y+_;return A in this&&delete this[A]},clear:function(){for(var _ in this)_[0]===y&&delete this[_]},keys:function(){var _=[];for(var A in this)A[0]===y&&_.push(A.slice(1));return _},values:function(){var _=[];for(var A in this)A[0]===y&&_.push(this[A]);return _},entries:function(){var _=[];for(var A in this)A[0]===y&&_.push({key:A.slice(1),value:this[A]});return _},size:function(){var _=0;for(var A in this)A[0]===y&&++_;return _},empty:function(){for(var _ in this)if(_[0]===y)return!1;return!0},each:function(_){for(var A in this)A[0]===y&&_(this[A],A.slice(1),this)}};function P(_,A){var d=new z;if(_ instanceof z)_.each(function(I,M){d.set(M,I)});else if(Array.isArray(_)){var k=-1,w=_.length,D;if(A==null)for(;++k=_.length)return d!=null&&I.sort(d),k!=null?k(I):I;for(var C=-1,S=I.length,N=_[M++],B,U,V=P(),W,F=p();++C_.length)return I;var p,g=A[M-1];return k!=null&&M>=_.length?p=I.entries():(p=[],I.each(function(C,S){p.push({key:S,values:E(C,M)})})),g!=null?p.sort(function(C,S){return g(C.key,S.key)}):p}return w={object:function(I){return D(I,0,i,a)},map:function(I){return D(I,0,l,o)},entries:function(I){return E(D(I,0,l,o),0)},key:function(I){return _.push(I),w},sortKeys:function(I){return A[_.length-1]=I,w},sortValues:function(I){return d=I,w},rollup:function(I){return k=I,w}}}function i(){return{}}function a(_,A,d){_[A]=d}function l(){return P()}function o(_,A,d){_.set(A,d)}function c(){}var s=P.prototype;c.prototype=h.prototype={constructor:c,has:s.has,add:function(_){return _+="",this[y+_]=_,this},remove:s.remove,clear:s.clear,values:s.keys,size:s.size,empty:s.empty,each:s.each};function h(_,A){var d=new c;if(_ instanceof c)_.each(function(D){d.add(D)});else if(_){var k=-1,w=_.length;if(A==null)for(;++k{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y={value:function(){}};function z(){for(var l=0,o=arguments.length,c={},s;l=0&&(s=c.slice(h+1),c=c.slice(0,h)),c&&!o.hasOwnProperty(c))throw new Error("unknown type: "+c);return{type:c,name:s}})}P.prototype=z.prototype={constructor:P,on:function(l,o){var c=this._,s=n(l+"",c),h,m=-1,b=s.length;if(arguments.length<2){for(;++m0)for(var c=new Array(h),s=0,h,m;s{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y=0,z=0,P=0,n=1e3,i,a,l=0,o=0,c=0,s=typeof performance=="object"&&performance.now?performance:Date,h=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(M){setTimeout(M,17)};function m(){return o||(h(b),o=s.now()+c)}function b(){o=0}function x(){this._call=this._time=this._next=null}x.prototype=_.prototype={constructor:x,restart:function(M,p,g){if(typeof M!="function")throw new TypeError("callback is not a function");g=(g==null?m():+g)+(p==null?0:+p),!this._next&&a!==this&&(a?a._next=this:i=this,a=this),this._call=M,this._time=g,D()},stop:function(){this._call&&(this._call=null,this._time=1/0,D())}};function _(M,p,g){var C=new x;return C.restart(M,p,g),C}function A(){m(),++y;for(var M=i,p;M;)(p=o-M._time)>=0&&M._call.call(null,p),M=M._next;--y}function d(){o=(l=s.now())+c,y=z=0;try{A()}finally{y=0,w(),o=0}}function k(){var M=s.now(),p=M-l;p>n&&(c-=p,l=M)}function w(){for(var M,p=i,g,C=1/0;p;)p._call?(C>p._time&&(C=p._time),M=p,p=p._next):(g=p._next,p._next=null,p=M?M._next=g:i=g);a=M,D(C)}function D(M){if(!y){z&&(z=clearTimeout(z));var p=M-o;p>24?(M<1/0&&(z=setTimeout(d,M-s.now()-c)),P&&(P=clearInterval(P))):(P||(l=s.now(),P=setInterval(k,n)),y=1,h(d))}}function E(M,p,g){var C=new x;return p=p==null?0:+p,C.restart(function(S){C.stop(),M(S+p)},p,g),C}function I(M,p,g){var C=new x,S=p;return p==null?(C.restart(M,p,g),C):(p=+p,g=g==null?m():+g,C.restart(function N(B){B+=S,C.restart(N,S+=p,g),M(B)},p,g),C)}f.interval=I,f.now=m,f.timeout=E,f.timer=_,f.timerFlush=A,Object.defineProperty(f,"__esModule",{value:!0})})}),Ytt=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Gtt(),TA(),Ztt(),Ktt()):y(f.d3=f.d3||{},f.d3,f.d3,f.d3,f.d3)})(et,function(f,y,z,P,n){function i(M,p){var g;M==null&&(M=0),p==null&&(p=0);function C(){var S,N=g.length,B,U=0,V=0;for(S=0;SH.index){var mt=q-xt.x-xt.vx,dt=G-xt.y-xt.vy,Ct=mt*mt+dt*dt;Ctq+J||itG+J||stV.r&&(V.r=V[W].r)}function U(){if(p){var V,W=p.length,F;for(g=new Array(W),V=0;V1?(ht==null?U.remove(tt):U.set(tt,G(ht)),p):U.get(tt)},find:function(tt,ht,bt){var vt=0,ut=M.length,rt,gt,it,st,xt;for(bt==null?bt=1/0:bt*=bt,vt=0;vt1?(W.on(tt,ht),p):W.on(tt)}}}function w(){var M,p,g,C=a(-30),S,N=1,B=1/0,U=.81;function V(q){var G,tt=M.length,ht=y.quadtree(M,x,_).visitAfter(F);for(g=q,G=0;G=B)){(q.data!==p||q.next)&&(bt===0&&(bt=l(),rt+=bt*bt),vt===0&&(vt=l(),rt+=vt*vt),rt{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et):(f=f||self,y(f.d3=f.d3||{}))})(et,function(f){var y=Math.PI,z=2*y,P=1e-6,n=z-P;function i(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function a(){return new i}i.prototype=a.prototype={constructor:i,moveTo:function(l,o){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(l,o){this._+="L"+(this._x1=+l)+","+(this._y1=+o)},quadraticCurveTo:function(l,o,c,s){this._+="Q"+ +l+","+ +o+","+(this._x1=+c)+","+(this._y1=+s)},bezierCurveTo:function(l,o,c,s,h,m){this._+="C"+ +l+","+ +o+","+ +c+","+ +s+","+(this._x1=+h)+","+(this._y1=+m)},arcTo:function(l,o,c,s,h){l=+l,o=+o,c=+c,s=+s,h=+h;var m=this._x1,b=this._y1,x=c-l,_=s-o,A=m-l,d=b-o,k=A*A+d*d;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=l)+","+(this._y1=o);else if(k>P)if(!(Math.abs(d*x-_*A)>P)||!h)this._+="L"+(this._x1=l)+","+(this._y1=o);else{var w=c-m,D=s-b,E=x*x+_*_,I=w*w+D*D,M=Math.sqrt(E),p=Math.sqrt(k),g=h*Math.tan((y-Math.acos((E+k-I)/(2*M*p)))/2),C=g/p,S=g/M;Math.abs(C-1)>P&&(this._+="L"+(l+C*A)+","+(o+C*d)),this._+="A"+h+","+h+",0,0,"+ +(d*w>A*D)+","+(this._x1=l+S*x)+","+(this._y1=o+S*_)}},arc:function(l,o,c,s,h,m){l=+l,o=+o,c=+c,m=!!m;var b=c*Math.cos(s),x=c*Math.sin(s),_=l+b,A=o+x,d=1^m,k=m?s-h:h-s;if(c<0)throw new Error("negative radius: "+c);this._x1===null?this._+="M"+_+","+A:(Math.abs(this._x1-_)>P||Math.abs(this._y1-A)>P)&&(this._+="L"+_+","+A),c&&(k<0&&(k=k%z+z),k>n?this._+="A"+c+","+c+",0,1,"+d+","+(l-b)+","+(o-x)+"A"+c+","+c+",0,1,"+d+","+(this._x1=_)+","+(this._y1=A):k>P&&(this._+="A"+c+","+c+",0,"+ +(k>=y)+","+d+","+(this._x1=l+c*Math.cos(h))+","+(this._y1=o+c*Math.sin(h))))},rect:function(l,o,c,s){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)+"h"+ +c+"v"+ +s+"h"+-c+"Z"},toString:function(){return this._}},f.path=a,Object.defineProperty(f,"__esModule",{value:!0})})}),Dz=It((et,Y)=>{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Xtt()):(f=f||self,y(f.d3=f.d3||{},f.d3))})(et,function(f,y){function z(ze){return function(){return ze}}var P=Math.abs,n=Math.atan2,i=Math.cos,a=Math.max,l=Math.min,o=Math.sin,c=Math.sqrt,s=1e-12,h=Math.PI,m=h/2,b=2*h;function x(ze){return ze>1?0:ze<-1?h:Math.acos(ze)}function _(ze){return ze>=1?m:ze<=-1?-m:Math.asin(ze)}function A(ze){return ze.innerRadius}function d(ze){return ze.outerRadius}function k(ze){return ze.startAngle}function w(ze){return ze.endAngle}function D(ze){return ze&&ze.padAngle}function E(ze,yr,en,Rn,ni,xi,Jn,Gn){var pi=en-ze,Va=Rn-yr,ea=Jn-ni,go=Gn-xi,mo=go*pi-ea*Va;if(!(mo*moOl*Ol+tc*tc&&(ul=vs,Kl=Ns),{cx:ul,cy:Kl,x01:-ea,y01:-go,x11:ul*(ni/ol-1),y11:Kl*(ni/ol-1)}}function M(){var ze=A,yr=d,en=z(0),Rn=null,ni=k,xi=w,Jn=D,Gn=null;function pi(){var Va,ea,go=+ze.apply(this,arguments),mo=+yr.apply(this,arguments),Go=ni.apply(this,arguments)-m,Po=xi.apply(this,arguments)-m,Zo=P(Po-Go),Ka=Po>Go;if(Gn||(Gn=Va=y.path()),mos))Gn.moveTo(0,0);else if(Zo>b-s)Gn.moveTo(mo*i(Go),mo*o(Go)),Gn.arc(0,0,mo,Go,Po,!Ka),go>s&&(Gn.moveTo(go*i(Po),go*o(Po)),Gn.arc(0,0,go,Po,Go,Ka));else{var Cs=Go,ps=Po,wl=Go,is=Po,ol=Zo,ms=Zo,kl=Jn.apply(this,arguments)/2,ul=kl>s&&(Rn?+Rn.apply(this,arguments):c(go*go+mo*mo)),Kl=l(P(mo-go)/2,+en.apply(this,arguments)),vs=Kl,Ns=Kl,Uo,Ds;if(ul>s){var Ol=_(ul/go*o(kl)),tc=_(ul/mo*o(kl));(ol-=Ol*2)>s?(Ol*=Ka?1:-1,wl+=Ol,is-=Ol):(ol=0,wl=is=(Go+Po)/2),(ms-=tc*2)>s?(tc*=Ka?1:-1,Cs+=tc,ps-=tc):(ms=0,Cs=ps=(Go+Po)/2)}var sc=mo*i(Cs),Xs=mo*o(Cs),Wa=go*i(is),Co=go*o(is);if(Kl>s){var el=mo*i(ps),lc=mo*o(ps),ss=go*i(wl),nc=go*o(wl),yl;if(Zos?Ns>s?(Uo=I(ss,nc,sc,Xs,mo,Ns,Ka),Ds=I(el,lc,Wa,Co,mo,Ns,Ka),Gn.moveTo(Uo.cx+Uo.x01,Uo.cy+Uo.y01),Nss)||!(ol>s)?Gn.lineTo(Wa,Co):vs>s?(Uo=I(Wa,Co,el,lc,go,-vs,Ka),Ds=I(sc,Xs,ss,nc,go,-vs,Ka),Gn.lineTo(Uo.cx+Uo.x01,Uo.cy+Uo.y01),vs=mo;--Go)Gn.point(ps[Go],wl[Go]);Gn.lineEnd(),Gn.areaEnd()}Ka&&(ps[go]=+ze(Zo,go,ea),wl[go]=+en(Zo,go,ea),Gn.point(yr?+yr(Zo,go,ea):ps[go],Rn?+Rn(Zo,go,ea):wl[go]))}if(Cs)return Gn=null,Cs+""||null}function Va(){return N().defined(ni).curve(Jn).context(xi)}return pi.x=function(ea){return arguments.length?(ze=typeof ea=="function"?ea:z(+ea),yr=null,pi):ze},pi.x0=function(ea){return arguments.length?(ze=typeof ea=="function"?ea:z(+ea),pi):ze},pi.x1=function(ea){return arguments.length?(yr=ea==null?null:typeof ea=="function"?ea:z(+ea),pi):yr},pi.y=function(ea){return arguments.length?(en=typeof ea=="function"?ea:z(+ea),Rn=null,pi):en},pi.y0=function(ea){return arguments.length?(en=typeof ea=="function"?ea:z(+ea),pi):en},pi.y1=function(ea){return arguments.length?(Rn=ea==null?null:typeof ea=="function"?ea:z(+ea),pi):Rn},pi.lineX0=pi.lineY0=function(){return Va().x(ze).y(en)},pi.lineY1=function(){return Va().x(ze).y(Rn)},pi.lineX1=function(){return Va().x(yr).y(en)},pi.defined=function(ea){return arguments.length?(ni=typeof ea=="function"?ea:z(!!ea),pi):ni},pi.curve=function(ea){return arguments.length?(Jn=ea,xi!=null&&(Gn=Jn(xi)),pi):Jn},pi.context=function(ea){return arguments.length?(ea==null?xi=Gn=null:Gn=Jn(xi=ea),pi):xi},pi}function U(ze,yr){return yrze?1:yr>=ze?0:NaN}function V(ze){return ze}function W(){var ze=V,yr=U,en=null,Rn=z(0),ni=z(b),xi=z(0);function Jn(Gn){var pi,Va=Gn.length,ea,go,mo=0,Go=new Array(Va),Po=new Array(Va),Zo=+Rn.apply(this,arguments),Ka=Math.min(b,Math.max(-b,ni.apply(this,arguments)-Zo)),Cs,ps=Math.min(Math.abs(Ka)/Va,xi.apply(this,arguments)),wl=ps*(Ka<0?-1:1),is;for(pi=0;pi0&&(mo+=is);for(yr!=null?Go.sort(function(ol,ms){return yr(Po[ol],Po[ms])}):en!=null&&Go.sort(function(ol,ms){return en(Gn[ol],Gn[ms])}),pi=0,go=mo?(Ka-Va*wl)/mo:0;pi0?is*go:0)+wl,Po[ea]={data:Gn[ea],index:pi,value:is,startAngle:Zo,endAngle:Cs,padAngle:ps};return Po}return Jn.value=function(Gn){return arguments.length?(ze=typeof Gn=="function"?Gn:z(+Gn),Jn):ze},Jn.sortValues=function(Gn){return arguments.length?(yr=Gn,en=null,Jn):yr},Jn.sort=function(Gn){return arguments.length?(en=Gn,yr=null,Jn):en},Jn.startAngle=function(Gn){return arguments.length?(Rn=typeof Gn=="function"?Gn:z(+Gn),Jn):Rn},Jn.endAngle=function(Gn){return arguments.length?(ni=typeof Gn=="function"?Gn:z(+Gn),Jn):ni},Jn.padAngle=function(Gn){return arguments.length?(xi=typeof Gn=="function"?Gn:z(+Gn),Jn):xi},Jn}var F=q(g);function H(ze){this._curve=ze}H.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(ze,yr){this._curve.point(yr*Math.sin(ze),yr*-Math.cos(ze))}};function q(ze){function yr(en){return new H(ze(en))}return yr._curve=ze,yr}function G(ze){var yr=ze.curve;return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze.curve=function(en){return arguments.length?yr(q(en)):yr()._curve},ze}function tt(){return G(N().curve(F))}function ht(){var ze=B().curve(F),yr=ze.curve,en=ze.lineX0,Rn=ze.lineX1,ni=ze.lineY0,xi=ze.lineY1;return ze.angle=ze.x,delete ze.x,ze.startAngle=ze.x0,delete ze.x0,ze.endAngle=ze.x1,delete ze.x1,ze.radius=ze.y,delete ze.y,ze.innerRadius=ze.y0,delete ze.y0,ze.outerRadius=ze.y1,delete ze.y1,ze.lineStartAngle=function(){return G(en())},delete ze.lineX0,ze.lineEndAngle=function(){return G(Rn())},delete ze.lineX1,ze.lineInnerRadius=function(){return G(ni())},delete ze.lineY0,ze.lineOuterRadius=function(){return G(xi())},delete ze.lineY1,ze.curve=function(Jn){return arguments.length?yr(q(Jn)):yr()._curve},ze}function bt(ze,yr){return[(yr=+yr)*Math.cos(ze-=Math.PI/2),yr*Math.sin(ze)]}var vt=Array.prototype.slice;function ut(ze){return ze.source}function rt(ze){return ze.target}function gt(ze){var yr=ut,en=rt,Rn=C,ni=S,xi=null;function Jn(){var Gn,pi=vt.call(arguments),Va=yr.apply(this,pi),ea=en.apply(this,pi);if(xi||(xi=Gn=y.path()),ze(xi,+Rn.apply(this,(pi[0]=Va,pi)),+ni.apply(this,pi),+Rn.apply(this,(pi[0]=ea,pi)),+ni.apply(this,pi)),Gn)return xi=null,Gn+""||null}return Jn.source=function(Gn){return arguments.length?(yr=Gn,Jn):yr},Jn.target=function(Gn){return arguments.length?(en=Gn,Jn):en},Jn.x=function(Gn){return arguments.length?(Rn=typeof Gn=="function"?Gn:z(+Gn),Jn):Rn},Jn.y=function(Gn){return arguments.length?(ni=typeof Gn=="function"?Gn:z(+Gn),Jn):ni},Jn.context=function(Gn){return arguments.length?(xi=Gn??null,Jn):xi},Jn}function it(ze,yr,en,Rn,ni){ze.moveTo(yr,en),ze.bezierCurveTo(yr=(yr+Rn)/2,en,yr,ni,Rn,ni)}function st(ze,yr,en,Rn,ni){ze.moveTo(yr,en),ze.bezierCurveTo(yr,en=(en+ni)/2,Rn,en,Rn,ni)}function xt(ze,yr,en,Rn,ni){var xi=bt(yr,en),Jn=bt(yr,en=(en+ni)/2),Gn=bt(Rn,en),pi=bt(Rn,ni);ze.moveTo(xi[0],xi[1]),ze.bezierCurveTo(Jn[0],Jn[1],Gn[0],Gn[1],pi[0],pi[1])}function ot(){return gt(it)}function J(){return gt(st)}function mt(){var ze=gt(xt);return ze.angle=ze.x,delete ze.x,ze.radius=ze.y,delete ze.y,ze}var dt={draw:function(ze,yr){var en=Math.sqrt(yr/h);ze.moveTo(en,0),ze.arc(0,0,en,0,b)}},Ct={draw:function(ze,yr){var en=Math.sqrt(yr/5)/2;ze.moveTo(-3*en,-en),ze.lineTo(-en,-en),ze.lineTo(-en,-3*en),ze.lineTo(en,-3*en),ze.lineTo(en,-en),ze.lineTo(3*en,-en),ze.lineTo(3*en,en),ze.lineTo(en,en),ze.lineTo(en,3*en),ze.lineTo(-en,3*en),ze.lineTo(-en,en),ze.lineTo(-3*en,en),ze.closePath()}},Rt=Math.sqrt(1/3),Bt=Rt*2,Zt={draw:function(ze,yr){var en=Math.sqrt(yr/Bt),Rn=en*Rt;ze.moveTo(0,-en),ze.lineTo(Rn,0),ze.lineTo(0,en),ze.lineTo(-Rn,0),ze.closePath()}},Gt=.8908130915292852,ee=Math.sin(h/10)/Math.sin(7*h/10),xe=Math.sin(b/10)*ee,ge=-Math.cos(b/10)*ee,ye={draw:function(ze,yr){var en=Math.sqrt(yr*Gt),Rn=xe*en,ni=ge*en;ze.moveTo(0,-en),ze.lineTo(Rn,ni);for(var xi=1;xi<5;++xi){var Jn=b*xi/5,Gn=Math.cos(Jn),pi=Math.sin(Jn);ze.lineTo(pi*en,-Gn*en),ze.lineTo(Gn*Rn-pi*ni,pi*Rn+Gn*ni)}ze.closePath()}},ue={draw:function(ze,yr){var en=Math.sqrt(yr),Rn=-en/2;ze.rect(Rn,Rn,en,en)}},Mt=Math.sqrt(3),Ot={draw:function(ze,yr){var en=-Math.sqrt(yr/(Mt*3));ze.moveTo(0,en*2),ze.lineTo(-Mt*en,-en),ze.lineTo(Mt*en,-en),ze.closePath()}},Lt=-.5,ie=Math.sqrt(3)/2,be=1/Math.sqrt(12),ce=(be/2+1)*3,Le={draw:function(ze,yr){var en=Math.sqrt(yr/ce),Rn=en/2,ni=en*be,xi=Rn,Jn=en*be+en,Gn=-xi,pi=Jn;ze.moveTo(Rn,ni),ze.lineTo(xi,Jn),ze.lineTo(Gn,pi),ze.lineTo(Lt*Rn-ie*ni,ie*Rn+Lt*ni),ze.lineTo(Lt*xi-ie*Jn,ie*xi+Lt*Jn),ze.lineTo(Lt*Gn-ie*pi,ie*Gn+Lt*pi),ze.lineTo(Lt*Rn+ie*ni,Lt*ni-ie*Rn),ze.lineTo(Lt*xi+ie*Jn,Lt*Jn-ie*xi),ze.lineTo(Lt*Gn+ie*pi,Lt*pi-ie*Gn),ze.closePath()}},Ze=[dt,Ct,Zt,ue,ye,Ot,Le];function Qe(){var ze=z(dt),yr=z(64),en=null;function Rn(){var ni;if(en||(en=ni=y.path()),ze.apply(this,arguments).draw(en,+yr.apply(this,arguments)),ni)return en=null,ni+""||null}return Rn.type=function(ni){return arguments.length?(ze=typeof ni=="function"?ni:z(ni),Rn):ze},Rn.size=function(ni){return arguments.length?(yr=typeof ni=="function"?ni:z(+ni),Rn):yr},Rn.context=function(ni){return arguments.length?(en=ni??null,Rn):en},Rn}function mr(){}function fr(ze,yr,en){ze._context.bezierCurveTo((2*ze._x0+ze._x1)/3,(2*ze._y0+ze._y1)/3,(ze._x0+2*ze._x1)/3,(ze._y0+2*ze._y1)/3,(ze._x0+4*ze._x1+yr)/6,(ze._y0+4*ze._y1+en)/6)}function Jr(ze){this._context=ze}Jr.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:fr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);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:fr(this,ze,yr);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr}};function an(ze){return new Jr(ze)}function Er(ze){this._context=ze}Er.prototype={areaStart:mr,areaEnd:mr,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);break}}},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._x2=ze,this._y2=yr;break;case 1:this._point=2,this._x3=ze,this._y3=yr;break;case 2:this._point=3,this._x4=ze,this._y4=yr,this._context.moveTo((this._x0+4*this._x1+ze)/6,(this._y0+4*this._y1+yr)/6);break;default:fr(this,ze,yr);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr}};function dn(ze){return new Er(ze)}function _n(ze){this._context=ze}_n.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var en=(this._x0+4*this._x1+ze)/6,Rn=(this._y0+4*this._y1+yr)/6;this._line?this._context.lineTo(en,Rn):this._context.moveTo(en,Rn);break;case 3:this._point=4;default:fr(this,ze,yr);break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr}};function Oe(ze){return new _n(ze)}function Xt(ze,yr){this._basis=new Jr(ze),this._beta=yr}Xt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var ze=this._x,yr=this._y,en=ze.length-1;if(en>0)for(var Rn=ze[0],ni=yr[0],xi=ze[en]-Rn,Jn=yr[en]-ni,Gn=-1,pi;++Gn<=en;)pi=Gn/en,this._basis.point(this._beta*ze[Gn]+(1-this._beta)*(Rn+pi*xi),this._beta*yr[Gn]+(1-this._beta)*(ni+pi*Jn));this._x=this._y=null,this._basis.lineEnd()},point:function(ze,yr){this._x.push(+ze),this._y.push(+yr)}};var oe=function ze(yr){function en(Rn){return yr===1?new Jr(Rn):new Xt(Rn,yr)}return en.beta=function(Rn){return ze(+Rn)},en}(.85);function zt(ze,yr,en){ze._context.bezierCurveTo(ze._x1+ze._k*(ze._x2-ze._x0),ze._y1+ze._k*(ze._y2-ze._y0),ze._x2+ze._k*(ze._x1-yr),ze._y2+ze._k*(ze._y1-en),ze._x2,ze._y2)}function _t(ze,yr){this._context=ze,this._k=(1-yr)/6}_t.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:zt(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2,this._x1=ze,this._y1=yr;break;case 2:this._point=3;default:zt(this,ze,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Pt=function ze(yr){function en(Rn){return new _t(Rn,yr)}return en.tension=function(Rn){return ze(+Rn)},en}(0);function Ht(ze,yr){this._context=ze,this._k=(1-yr)/6}Ht.prototype={areaStart:mr,areaEnd:mr,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);break}}},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._x3=ze,this._y3=yr;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=yr);break;case 2:this._point=3,this._x5=ze,this._y5=yr;break;default:zt(this,ze,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var ae=function ze(yr){function en(Rn){return new Ht(Rn,yr)}return en.tension=function(Rn){return ze(+Rn)},en}(0);function he(ze,yr){this._context=ze,this._k=(1-yr)/6}he.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){switch(ze=+ze,yr=+yr,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:zt(this,ze,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Me=function ze(yr){function en(Rn){return new he(Rn,yr)}return en.tension=function(Rn){return ze(+Rn)},en}(0);function qe(ze,yr,en){var Rn=ze._x1,ni=ze._y1,xi=ze._x2,Jn=ze._y2;if(ze._l01_a>s){var Gn=2*ze._l01_2a+3*ze._l01_a*ze._l12_a+ze._l12_2a,pi=3*ze._l01_a*(ze._l01_a+ze._l12_a);Rn=(Rn*Gn-ze._x0*ze._l12_2a+ze._x2*ze._l01_2a)/pi,ni=(ni*Gn-ze._y0*ze._l12_2a+ze._y2*ze._l01_2a)/pi}if(ze._l23_a>s){var Va=2*ze._l23_2a+3*ze._l23_a*ze._l12_a+ze._l12_2a,ea=3*ze._l23_a*(ze._l23_a+ze._l12_a);xi=(xi*Va+ze._x1*ze._l23_2a-yr*ze._l12_2a)/ea,Jn=(Jn*Va+ze._y1*ze._l23_2a-en*ze._l12_2a)/ea}ze._context.bezierCurveTo(Rn,ni,xi,Jn,ze._x2,ze._y2)}function Ye(ze,yr){this._context=ze,this._alpha=yr}Ye.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);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){if(ze=+ze,yr=+yr,this._point){var en=this._x2-ze,Rn=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(en*en+Rn*Rn,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2;break;case 2:this._point=3;default:qe(this,ze,yr);break}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=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var ur=function ze(yr){function en(Rn){return yr?new Ye(Rn,yr):new _t(Rn,0)}return en.alpha=function(Rn){return ze(+Rn)},en}(.5);function Rr(ze,yr){this._context=ze,this._alpha=yr}Rr.prototype={areaStart:mr,areaEnd:mr,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);break}}},point:function(ze,yr){if(ze=+ze,yr=+yr,this._point){var en=this._x2-ze,Rn=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(en*en+Rn*Rn,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=ze,this._y3=yr;break;case 1:this._point=2,this._context.moveTo(this._x4=ze,this._y4=yr);break;case 2:this._point=3,this._x5=ze,this._y5=yr;break;default:qe(this,ze,yr);break}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=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var zr=function ze(yr){function en(Rn){return yr?new Rr(Rn,yr):new Ht(Rn,0)}return en.alpha=function(Rn){return ze(+Rn)},en}(.5);function xr(ze,yr){this._context=ze,this._alpha=yr}xr.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||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){if(ze=+ze,yr=+yr,this._point){var en=this._x2-ze,Rn=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(en*en+Rn*Rn,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:qe(this,ze,yr);break}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=ze,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var pn=function ze(yr){function en(Rn){return yr?new xr(Rn,yr):new he(Rn,0)}return en.alpha=function(Rn){return ze(+Rn)},en}(.5);function ci(ze){this._context=ze}ci.prototype={areaStart:mr,areaEnd:mr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(ze,yr){ze=+ze,yr=+yr,this._point?this._context.lineTo(ze,yr):(this._point=1,this._context.moveTo(ze,yr))}};function ui(ze){return new ci(ze)}function yi(ze){return ze<0?-1:1}function Gi(ze,yr,en){var Rn=ze._x1-ze._x0,ni=yr-ze._x1,xi=(ze._y1-ze._y0)/(Rn||ni<0&&-0),Jn=(en-ze._y1)/(ni||Rn<0&&-0),Gn=(xi*ni+Jn*Rn)/(Rn+ni);return(yi(xi)+yi(Jn))*Math.min(Math.abs(xi),Math.abs(Jn),.5*Math.abs(Gn))||0}function Ci(ze,yr){var en=ze._x1-ze._x0;return en?(3*(ze._y1-ze._y0)/en-yr)/2:yr}function fi(ze,yr,en){var Rn=ze._x0,ni=ze._y0,xi=ze._x1,Jn=ze._y1,Gn=(xi-Rn)/3;ze._context.bezierCurveTo(Rn+Gn,ni+Gn*yr,xi-Gn,Jn-Gn*en,xi,Jn)}function ba(ze){this._context=ze}ba.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:fi(this,this._t0,Ci(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(ze,yr){var en=NaN;if(ze=+ze,yr=+yr,!(ze===this._x1&&yr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2;break;case 2:this._point=3,fi(this,Ci(this,en=Gi(this,ze,yr)),en);break;default:fi(this,this._t0,en=Gi(this,ze,yr));break}this._x0=this._x1,this._x1=ze,this._y0=this._y1,this._y1=yr,this._t0=en}}};function oa(ze){this._context=new Ke(ze)}(oa.prototype=Object.create(ba.prototype)).point=function(ze,yr){ba.prototype.point.call(this,yr,ze)};function Ke(ze){this._context=ze}Ke.prototype={moveTo:function(ze,yr){this._context.moveTo(yr,ze)},closePath:function(){this._context.closePath()},lineTo:function(ze,yr){this._context.lineTo(yr,ze)},bezierCurveTo:function(ze,yr,en,Rn,ni,xi){this._context.bezierCurveTo(yr,ze,Rn,en,xi,ni)}};function sr(ze){return new ba(ze)}function vr(ze){return new oa(ze)}function Ar(ze){this._context=ze}Ar.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var ze=this._x,yr=this._y,en=ze.length;if(en)if(this._line?this._context.lineTo(ze[0],yr[0]):this._context.moveTo(ze[0],yr[0]),en===2)this._context.lineTo(ze[1],yr[1]);else for(var Rn=mn(ze),ni=mn(yr),xi=0,Jn=1;Jn=0;--yr)ni[yr]=(Jn[yr]-ni[yr+1])/xi[yr];for(xi[en-1]=(ze[en]+ni[en-1])/2,yr=0;yr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(ze,yr){switch(ze=+ze,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(ze,yr):this._context.moveTo(ze,yr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,yr),this._context.lineTo(ze,yr);else{var en=this._x*(1-this._t)+ze*this._t;this._context.lineTo(en,this._y),this._context.lineTo(en,yr)}break}}this._x=ze,this._y=yr}};function Wn(ze){return new Un(ze,.5)}function Li(ze){return new Un(ze,0)}function Fi(ze){return new Un(ze,1)}function Zi(ze,yr){if((Jn=ze.length)>1)for(var en=1,Rn,ni,xi=ze[yr[0]],Jn,Gn=xi.length;en=0;)en[yr]=yr;return en}function ca(ze,yr){return ze[yr]}function Ei(){var ze=z([]),yr=Ji,en=Zi,Rn=ca;function ni(xi){var Jn=ze.apply(this,arguments),Gn,pi=xi.length,Va=Jn.length,ea=new Array(Va),go;for(Gn=0;Gn0){for(var en,Rn,ni=0,xi=ze[0].length,Jn;ni0)for(var en,Rn=0,ni,xi,Jn,Gn,pi,Va=ze[yr[0]].length;Rn0?(ni[0]=Jn,ni[1]=Jn+=xi):xi<0?(ni[1]=Gn,ni[0]=Gn+=xi):(ni[0]=0,ni[1]=xi)}function Fe(ze,yr){if((ni=ze.length)>0){for(var en=0,Rn=ze[yr[0]],ni,xi=Rn.length;en0)||!((xi=(ni=ze[yr[0]]).length)>0))){for(var en=0,Rn=1,ni,xi,Jn;Rnxi&&(xi=ni,en=yr);return en}function cn(ze){var yr=ze.map(Yr);return Ji(ze).sort(function(en,Rn){return yr[en]-yr[Rn]})}function Yr(ze){for(var yr=0,en=-1,Rn=ze.length,ni;++en{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Ek(),TA(),Dz()):y(f.d3=f.d3||{},f.d3,f.d3,f.d3)})(et,function(f,y,z,P){function n(g){return g.target.depth}function i(g){return g.depth}function a(g,C){return C-1-g.height}function l(g,C){return g.sourceLinks.length?g.depth:C-1}function o(g){return g.targetLinks.length?g.depth:g.sourceLinks.length?y.min(g.sourceLinks,n)-1:0}function c(g){return function(){return g}}function s(g,C){return m(g.source,C.source)||g.index-C.index}function h(g,C){return m(g.target,C.target)||g.index-C.index}function m(g,C){return g.y0-C.y0}function b(g){return g.value}function x(g){return(g.y0+g.y1)/2}function _(g){return x(g.source)*g.value}function A(g){return x(g.target)*g.value}function d(g){return g.index}function k(g){return g.nodes}function w(g){return g.links}function D(g,C){var S=g.get(C);if(!S)throw new Error("missing: "+C);return S}var E=function(){var g=0,C=0,S=1,N=1,B=24,U=8,V=d,W=l,F=k,H=w,q=32,G=2/3;function tt(){var gt={nodes:F.apply(null,arguments),links:H.apply(null,arguments)};return ht(gt),bt(gt),vt(gt),ut(gt),rt(gt),gt}tt.update=function(gt){return rt(gt),gt},tt.nodeId=function(gt){return arguments.length?(V=typeof gt=="function"?gt:c(gt),tt):V},tt.nodeAlign=function(gt){return arguments.length?(W=typeof gt=="function"?gt:c(gt),tt):W},tt.nodeWidth=function(gt){return arguments.length?(B=+gt,tt):B},tt.nodePadding=function(gt){return arguments.length?(U=+gt,tt):U},tt.nodes=function(gt){return arguments.length?(F=typeof gt=="function"?gt:c(gt),tt):F},tt.links=function(gt){return arguments.length?(H=typeof gt=="function"?gt:c(gt),tt):H},tt.size=function(gt){return arguments.length?(g=C=0,S=+gt[0],N=+gt[1],tt):[S-g,N-C]},tt.extent=function(gt){return arguments.length?(g=+gt[0][0],S=+gt[1][0],C=+gt[0][1],N=+gt[1][1],tt):[[g,C],[S,N]]},tt.iterations=function(gt){return arguments.length?(q=+gt,tt):q};function ht(gt){gt.nodes.forEach(function(st,xt){st.index=xt,st.sourceLinks=[],st.targetLinks=[]});var it=z.map(gt.nodes,V);gt.links.forEach(function(st,xt){st.index=xt;var ot=st.source,J=st.target;typeof ot!="object"&&(ot=st.source=D(it,ot)),typeof J!="object"&&(J=st.target=D(it,J)),ot.sourceLinks.push(st),J.targetLinks.push(st)})}function bt(gt){gt.nodes.forEach(function(it){it.value=Math.max(y.sum(it.sourceLinks,b),y.sum(it.targetLinks,b))})}function vt(gt){var it,st,xt;for(it=gt.nodes,st=[],xt=0;it.length;++xt,it=st,st=[])it.forEach(function(J){J.depth=xt,J.sourceLinks.forEach(function(mt){st.indexOf(mt.target)<0&&st.push(mt.target)})});for(it=gt.nodes,st=[],xt=0;it.length;++xt,it=st,st=[])it.forEach(function(J){J.height=xt,J.targetLinks.forEach(function(mt){st.indexOf(mt.source)<0&&st.push(mt.source)})});var ot=(S-g-B)/(xt-1);gt.nodes.forEach(function(J){J.x1=(J.x0=g+Math.max(0,Math.min(xt-1,Math.floor(W.call(null,J,xt))))*ot)+B})}function ut(gt){var it=z.nest().key(function(Ct){return Ct.x0}).sortKeys(y.ascending).entries(gt.nodes).map(function(Ct){return Ct.values});ot(),dt();for(var st=1,xt=q;xt>0;--xt)mt(st*=.99),dt(),J(st),dt();function ot(){var Ct=y.max(it,function(Zt){return Zt.length}),Rt=G*(N-C)/(Ct-1);U>Rt&&(U=Rt);var Bt=y.min(it,function(Zt){return(N-C-(Zt.length-1)*U)/y.sum(Zt,b)});it.forEach(function(Zt){Zt.forEach(function(Gt,ee){Gt.y1=(Gt.y0=ee)+Gt.value*Bt})}),gt.links.forEach(function(Zt){Zt.width=Zt.value*Bt})}function J(Ct){it.forEach(function(Rt){Rt.forEach(function(Bt){if(Bt.targetLinks.length){var Zt=(y.sum(Bt.targetLinks,_)/y.sum(Bt.targetLinks,b)-x(Bt))*Ct;Bt.y0+=Zt,Bt.y1+=Zt}})})}function mt(Ct){it.slice().reverse().forEach(function(Rt){Rt.forEach(function(Bt){if(Bt.sourceLinks.length){var Zt=(y.sum(Bt.sourceLinks,A)/y.sum(Bt.sourceLinks,b)-x(Bt))*Ct;Bt.y0+=Zt,Bt.y1+=Zt}})})}function dt(){it.forEach(function(Ct){var Rt,Bt,Zt=C,Gt=Ct.length,ee;for(Ct.sort(m),ee=0;ee0&&(Rt.y0+=Bt,Rt.y1+=Bt),Zt=Rt.y1+U;if(Bt=Zt-U-N,Bt>0)for(Zt=Rt.y0-=Bt,Rt.y1-=Bt,ee=Gt-2;ee>=0;--ee)Rt=Ct[ee],Bt=Rt.y1+U-Zt,Bt>0&&(Rt.y0-=Bt,Rt.y1-=Bt),Zt=Rt.y0})}}function rt(gt){gt.nodes.forEach(function(it){it.sourceLinks.sort(h),it.targetLinks.sort(s)}),gt.nodes.forEach(function(it){var st=it.y0,xt=st;it.sourceLinks.forEach(function(ot){ot.y0=st+ot.width/2,st+=ot.width}),it.targetLinks.forEach(function(ot){ot.y1=xt+ot.width/2,xt+=ot.width})})}return tt};function I(g){return[g.source.x1,g.y0]}function M(g){return[g.target.x0,g.y1]}var p=function(){return P.linkHorizontal().source(I).target(M)};f.sankey=E,f.sankeyCenter=o,f.sankeyLeft=i,f.sankeyRight=a,f.sankeyJustify=l,f.sankeyLinkHorizontal=p,Object.defineProperty(f,"__esModule",{value:!0})})}),Qtt=It((et,Y)=>{var f=Iz();Y.exports=function(y,z){var P=[],n=[],i=[],a={},l=[],o;function c(w){i[w]=!1,a.hasOwnProperty(w)&&Object.keys(a[w]).forEach(function(D){delete a[w][D],i[D]&&c(D)})}function s(w){var D=!1;n.push(w),i[w]=!0;var E,I;for(E=0;E=w})}function b(w){m(w);for(var D=y,E=f(D),I=E.components.filter(function(B){return B.length>1}),M=1/0,p,g=0;g{(function(f,y){typeof et=="object"&&typeof Y<"u"?y(et,Ek(),TA(),Dz(),Qtt()):y(f.d3=f.d3||{},f.d3,f.d3,f.d3,null)})(et,function(f,y,z,P,n){n=n&&n.hasOwnProperty("default")?n.default:n;function i(Gt){return Gt.target.depth}function a(Gt){return Gt.depth}function l(Gt,ee){return ee-1-Gt.height}function o(Gt,ee){return Gt.sourceLinks.length?Gt.depth:ee-1}function c(Gt){return Gt.targetLinks.length?Gt.depth:Gt.sourceLinks.length?y.min(Gt.sourceLinks,i)-1:0}function s(Gt){return function(){return Gt}}var h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Gt){return typeof Gt}:function(Gt){return Gt&&typeof Symbol=="function"&&Gt.constructor===Symbol&&Gt!==Symbol.prototype?"symbol":typeof Gt};function m(Gt,ee){return x(Gt.source,ee.source)||Gt.index-ee.index}function b(Gt,ee){return x(Gt.target,ee.target)||Gt.index-ee.index}function x(Gt,ee){return Gt.partOfCycle===ee.partOfCycle?Gt.y0-ee.y0:Gt.circularLinkType==="top"||ee.circularLinkType==="bottom"?-1:1}function _(Gt){return Gt.value}function A(Gt){return(Gt.y0+Gt.y1)/2}function d(Gt){return A(Gt.source)}function k(Gt){return A(Gt.target)}function w(Gt){return Gt.index}function D(Gt){return Gt.nodes}function E(Gt){return Gt.links}function I(Gt,ee){var xe=Gt.get(ee);if(!xe)throw new Error("missing: "+ee);return xe}function M(Gt,ee){return ee(Gt)}var p=25,g=10,C=.3;function S(){var Gt=0,ee=0,xe=1,ge=1,ye=24,ue,Mt=w,Ot=o,Lt=D,ie=E,be=32,ce=2,Le,Ze=null;function Qe(){var Oe={nodes:Lt.apply(null,arguments),links:ie.apply(null,arguments)};mr(Oe),N(Oe,Mt,Ze),fr(Oe),Er(Oe),B(Oe,Mt),dn(Oe,be,Mt),_n(Oe);for(var Xt=4,oe=0;oe"u"?"undefined":h(_t))!=="object"&&(_t=oe.source=I(Xt,_t)),(typeof Pt>"u"?"undefined":h(Pt))!=="object"&&(Pt=oe.target=I(Xt,Pt)),_t.sourceLinks.push(oe),Pt.targetLinks.push(oe)}),Oe}function fr(Oe){Oe.nodes.forEach(function(Xt){Xt.partOfCycle=!1,Xt.value=Math.max(y.sum(Xt.sourceLinks,_),y.sum(Xt.targetLinks,_)),Xt.sourceLinks.forEach(function(oe){oe.circular&&(Xt.partOfCycle=!0,Xt.circularLinkType=oe.circularLinkType)}),Xt.targetLinks.forEach(function(oe){oe.circular&&(Xt.partOfCycle=!0,Xt.circularLinkType=oe.circularLinkType)})})}function Jr(Oe){var Xt=0,oe=0,zt=0,_t=0,Pt=y.max(Oe.nodes,function(Ht){return Ht.column});return Oe.links.forEach(function(Ht){Ht.circular&&(Ht.circularLinkType=="top"?Xt=Xt+Ht.width:oe=oe+Ht.width,Ht.target.column==0&&(_t=_t+Ht.width),Ht.source.column==Pt&&(zt=zt+Ht.width))}),Xt=Xt>0?Xt+p+g:Xt,oe=oe>0?oe+p+g:oe,zt=zt>0?zt+p+g:zt,_t=_t>0?_t+p+g:_t,{top:Xt,bottom:oe,left:_t,right:zt}}function an(Oe,Xt){var oe=y.max(Oe.nodes,function(Me){return Me.column}),zt=xe-Gt,_t=ge-ee,Pt=zt+Xt.right+Xt.left,Ht=_t+Xt.top+Xt.bottom,ae=zt/Pt,he=_t/Ht;return Gt=Gt*ae+Xt.left,xe=Xt.right==0?xe:xe*ae,ee=ee*he+Xt.top,ge=ge*he,Oe.nodes.forEach(function(Me){Me.x0=Gt+Me.column*((xe-Gt-ye)/oe),Me.x1=Me.x0+ye}),he}function Er(Oe){var Xt,oe,zt;for(Xt=Oe.nodes,oe=[],zt=0;Xt.length;++zt,Xt=oe,oe=[])Xt.forEach(function(_t){_t.depth=zt,_t.sourceLinks.forEach(function(Pt){oe.indexOf(Pt.target)<0&&!Pt.circular&&oe.push(Pt.target)})});for(Xt=Oe.nodes,oe=[],zt=0;Xt.length;++zt,Xt=oe,oe=[])Xt.forEach(function(_t){_t.height=zt,_t.targetLinks.forEach(function(Pt){oe.indexOf(Pt.source)<0&&!Pt.circular&&oe.push(Pt.source)})});Oe.nodes.forEach(function(_t){_t.column=Math.floor(Ot.call(null,_t,zt))})}function dn(Oe,Xt,oe){var zt=z.nest().key(function(Me){return Me.column}).sortKeys(y.ascending).entries(Oe.nodes).map(function(Me){return Me.values});Ht(oe),he();for(var _t=1,Pt=Xt;Pt>0;--Pt)ae(_t*=.99,oe),he();function Ht(Me){if(Le){var qe=1/0;zt.forEach(function(zr){var xr=ge*Le/(zr.length+1);qe=xr0))if(zr==0&&Rr==1)pn=xr.y1-xr.y0,xr.y0=ge/2-pn/2,xr.y1=ge/2+pn/2;else if(zr==Ye-1&&Rr==1)pn=xr.y1-xr.y0,xr.y0=ge/2-pn/2,xr.y1=ge/2+pn/2;else{var ci=0,ui=y.mean(xr.sourceLinks,k),yi=y.mean(xr.targetLinks,d);ui&&yi?ci=(ui+yi)/2:ci=ui||yi;var Gi=(ci-A(xr))*Me;xr.y0+=Gi,xr.y1+=Gi}})})}function he(){zt.forEach(function(Me){var qe,Ye,ur=ee,Rr=Me.length,zr;for(Me.sort(x),zr=0;zr0&&(qe.y0+=Ye,qe.y1+=Ye),ur=qe.y1+ue;if(Ye=ur-ue-ge,Ye>0)for(ur=qe.y0-=Ye,qe.y1-=Ye,zr=Rr-2;zr>=0;--zr)qe=Me[zr],Ye=qe.y1+ue-ur,Ye>0&&(qe.y0-=Ye,qe.y1-=Ye),ur=qe.y0})}}function _n(Oe){Oe.nodes.forEach(function(Xt){Xt.sourceLinks.sort(b),Xt.targetLinks.sort(m)}),Oe.nodes.forEach(function(Xt){var oe=Xt.y0,zt=oe,_t=Xt.y1,Pt=_t;Xt.sourceLinks.forEach(function(Ht){Ht.circular?(Ht.y0=_t-Ht.width/2,_t=_t-Ht.width):(Ht.y0=oe+Ht.width/2,oe+=Ht.width)}),Xt.targetLinks.forEach(function(Ht){Ht.circular?(Ht.y1=Pt-Ht.width/2,Pt=Pt-Ht.width):(Ht.y1=zt+Ht.width/2,zt+=Ht.width)})})}return Qe}function N(Gt,ee,xe){var ge=0;if(xe===null){for(var ye=[],ue=0;ueee.source.column)}function W(Gt,ee){var xe=0;Gt.sourceLinks.forEach(function(ye){xe=ye.circular&&!Bt(ye,ee)?xe+1:xe});var ge=0;return Gt.targetLinks.forEach(function(ye){ge=ye.circular&&!Bt(ye,ee)?ge+1:ge}),xe+ge}function F(Gt){var ee=Gt.source.sourceLinks,xe=0;ee.forEach(function(ue){xe=ue.circular?xe+1:xe});var ge=Gt.target.targetLinks,ye=0;return ge.forEach(function(ue){ye=ue.circular?ye+1:ye}),!(xe>1||ye>1)}function H(Gt,ee,xe){return Gt.sort(tt),Gt.forEach(function(ge,ye){var ue=0;if(Bt(ge,xe)&&F(ge))ge.circularPathData.verticalBuffer=ue+ge.width/2;else{var Mt=0;for(Mt;Mtue?Ot:ue}ge.circularPathData.verticalBuffer=ue+ge.width/2}}),Gt}function q(Gt,ee,xe,ge){var ye=5,ue=y.min(Gt.links,function(Lt){return Lt.source.y0});Gt.links.forEach(function(Lt){Lt.circular&&(Lt.circularPathData={})});var Mt=Gt.links.filter(function(Lt){return Lt.circularLinkType=="top"});H(Mt,ee,ge);var Ot=Gt.links.filter(function(Lt){return Lt.circularLinkType=="bottom"});H(Ot,ee,ge),Gt.links.forEach(function(Lt){if(Lt.circular){if(Lt.circularPathData.arcRadius=Lt.width+g,Lt.circularPathData.leftNodeBuffer=ye,Lt.circularPathData.rightNodeBuffer=ye,Lt.circularPathData.sourceWidth=Lt.source.x1-Lt.source.x0,Lt.circularPathData.sourceX=Lt.source.x0+Lt.circularPathData.sourceWidth,Lt.circularPathData.targetX=Lt.target.x0,Lt.circularPathData.sourceY=Lt.y0,Lt.circularPathData.targetY=Lt.y1,Bt(Lt,ge)&&F(Lt))Lt.circularPathData.leftSmallArcRadius=g+Lt.width/2,Lt.circularPathData.leftLargeArcRadius=g+Lt.width/2,Lt.circularPathData.rightSmallArcRadius=g+Lt.width/2,Lt.circularPathData.rightLargeArcRadius=g+Lt.width/2,Lt.circularLinkType=="bottom"?(Lt.circularPathData.verticalFullExtent=Lt.source.y1+p+Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.rightLargeArcRadius):(Lt.circularPathData.verticalFullExtent=Lt.source.y0-p-Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.rightLargeArcRadius);else{var ie=Lt.source.column,be=Lt.circularLinkType,ce=Gt.links.filter(function(Qe){return Qe.source.column==ie&&Qe.circularLinkType==be});Lt.circularLinkType=="bottom"?ce.sort(bt):ce.sort(ht);var Le=0;ce.forEach(function(Qe,mr){Qe.circularLinkID==Lt.circularLinkID&&(Lt.circularPathData.leftSmallArcRadius=g+Lt.width/2+Le,Lt.circularPathData.leftLargeArcRadius=g+Lt.width/2+mr*ee+Le),Le=Le+Qe.width}),ie=Lt.target.column,ce=Gt.links.filter(function(Qe){return Qe.target.column==ie&&Qe.circularLinkType==be}),Lt.circularLinkType=="bottom"?ce.sort(ut):ce.sort(vt),Le=0,ce.forEach(function(Qe,mr){Qe.circularLinkID==Lt.circularLinkID&&(Lt.circularPathData.rightSmallArcRadius=g+Lt.width/2+Le,Lt.circularPathData.rightLargeArcRadius=g+Lt.width/2+mr*ee+Le),Le=Le+Qe.width}),Lt.circularLinkType=="bottom"?(Lt.circularPathData.verticalFullExtent=Math.max(xe,Lt.source.y1,Lt.target.y1)+p+Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent-Lt.circularPathData.rightLargeArcRadius):(Lt.circularPathData.verticalFullExtent=ue-p-Lt.circularPathData.verticalBuffer,Lt.circularPathData.verticalLeftInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.leftLargeArcRadius,Lt.circularPathData.verticalRightInnerExtent=Lt.circularPathData.verticalFullExtent+Lt.circularPathData.rightLargeArcRadius)}Lt.circularPathData.leftInnerExtent=Lt.circularPathData.sourceX+Lt.circularPathData.leftNodeBuffer,Lt.circularPathData.rightInnerExtent=Lt.circularPathData.targetX-Lt.circularPathData.rightNodeBuffer,Lt.circularPathData.leftFullExtent=Lt.circularPathData.sourceX+Lt.circularPathData.leftLargeArcRadius+Lt.circularPathData.leftNodeBuffer,Lt.circularPathData.rightFullExtent=Lt.circularPathData.targetX-Lt.circularPathData.rightLargeArcRadius-Lt.circularPathData.rightNodeBuffer}if(Lt.circular)Lt.path=G(Lt);else{var Ze=P.linkHorizontal().source(function(Qe){var mr=Qe.source.x0+(Qe.source.x1-Qe.source.x0),fr=Qe.y0;return[mr,fr]}).target(function(Qe){var mr=Qe.target.x0,fr=Qe.y1;return[mr,fr]});Lt.path=Ze(Lt)}})}function G(Gt){var ee="";return Gt.circularLinkType=="top"?ee="M"+Gt.circularPathData.sourceX+" "+Gt.circularPathData.sourceY+" L"+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.sourceY+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftSmallArcRadius+" 0 0 0 "+Gt.circularPathData.leftFullExtent+" "+(Gt.circularPathData.sourceY-Gt.circularPathData.leftSmallArcRadius)+" L"+Gt.circularPathData.leftFullExtent+" "+Gt.circularPathData.verticalLeftInnerExtent+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftLargeArcRadius+" 0 0 0 "+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" L"+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightLargeArcRadius+" 0 0 0 "+Gt.circularPathData.rightFullExtent+" "+Gt.circularPathData.verticalRightInnerExtent+" L"+Gt.circularPathData.rightFullExtent+" "+(Gt.circularPathData.targetY-Gt.circularPathData.rightSmallArcRadius)+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightSmallArcRadius+" 0 0 0 "+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.targetY+" L"+Gt.circularPathData.targetX+" "+Gt.circularPathData.targetY:ee="M"+Gt.circularPathData.sourceX+" "+Gt.circularPathData.sourceY+" L"+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.sourceY+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftSmallArcRadius+" 0 0 1 "+Gt.circularPathData.leftFullExtent+" "+(Gt.circularPathData.sourceY+Gt.circularPathData.leftSmallArcRadius)+" L"+Gt.circularPathData.leftFullExtent+" "+Gt.circularPathData.verticalLeftInnerExtent+" A"+Gt.circularPathData.leftLargeArcRadius+" "+Gt.circularPathData.leftLargeArcRadius+" 0 0 1 "+Gt.circularPathData.leftInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" L"+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.verticalFullExtent+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightLargeArcRadius+" 0 0 1 "+Gt.circularPathData.rightFullExtent+" "+Gt.circularPathData.verticalRightInnerExtent+" L"+Gt.circularPathData.rightFullExtent+" "+(Gt.circularPathData.targetY+Gt.circularPathData.rightSmallArcRadius)+" A"+Gt.circularPathData.rightLargeArcRadius+" "+Gt.circularPathData.rightSmallArcRadius+" 0 0 1 "+Gt.circularPathData.rightInnerExtent+" "+Gt.circularPathData.targetY+" L"+Gt.circularPathData.targetX+" "+Gt.circularPathData.targetY,ee}function tt(Gt,ee){return rt(Gt)==rt(ee)?Gt.circularLinkType=="bottom"?bt(Gt,ee):ht(Gt,ee):rt(ee)-rt(Gt)}function ht(Gt,ee){return Gt.y0-ee.y0}function bt(Gt,ee){return ee.y0-Gt.y0}function vt(Gt,ee){return Gt.y1-ee.y1}function ut(Gt,ee){return ee.y1-Gt.y1}function rt(Gt){return Gt.target.column-Gt.source.column}function gt(Gt){return Gt.target.x0-Gt.source.x1}function it(Gt,ee){var xe=U(Gt),ge=gt(ee)/Math.tan(xe),ye=Rt(Gt)=="up"?Gt.y1+ge:Gt.y1-ge;return ye}function st(Gt,ee){var xe=U(Gt),ge=gt(ee)/Math.tan(xe),ye=Rt(Gt)=="up"?Gt.y1-ge:Gt.y1+ge;return ye}function xt(Gt,ee,xe,ge){Gt.links.forEach(function(ye){if(!ye.circular&&ye.target.column-ye.source.column>1){var ue=ye.source.column+1,Mt=ye.target.column-1,Ot=1,Lt=Mt-ue+1;for(Ot=1;ue<=Mt;ue++,Ot++)Gt.nodes.forEach(function(ie){if(ie.column==ue){var be=Ot/(Lt+1),ce=Math.pow(1-be,3),Le=3*be*Math.pow(1-be,2),Ze=3*Math.pow(be,2)*(1-be),Qe=Math.pow(be,3),mr=ce*ye.y0+Le*ye.y0+Ze*ye.y1+Qe*ye.y1,fr=mr-ye.width/2,Jr=mr+ye.width/2,an;fr>ie.y0&&frie.y0&&Jrie.y1&&J(Er,an,ee,xe)})):frie.y1&&(an=Jr-ie.y0+10,ie=J(ie,an,ee,xe),Gt.nodes.forEach(function(Er){M(Er,ge)==M(ie,ge)||Er.column!=ie.column||Er.y0ie.y1&&J(Er,an,ee,xe)}))}})}})}function ot(Gt,ee){return Gt.y0>ee.y0&&Gt.y0ee.y0&&Gt.y1ee.y1}function J(Gt,ee,xe,ge){return Gt.y0+ee>=xe&&Gt.y1+ee<=ge&&(Gt.y0=Gt.y0+ee,Gt.y1=Gt.y1+ee,Gt.targetLinks.forEach(function(ye){ye.y1=ye.y1+ee}),Gt.sourceLinks.forEach(function(ye){ye.y0=ye.y0+ee})),Gt}function mt(Gt,ee,xe,ge){Gt.nodes.forEach(function(ye){ge&&ye.y+(ye.y1-ye.y0)>ee&&(ye.y=ye.y-(ye.y+(ye.y1-ye.y0)-ee));var ue=Gt.links.filter(function(Lt){return M(Lt.source,xe)==M(ye,xe)}),Mt=ue.length;Mt>1&&ue.sort(function(Lt,ie){if(!Lt.circular&&!ie.circular){if(Lt.target.column==ie.target.column)return Lt.y1-ie.y1;if(Ct(Lt,ie)){if(Lt.target.column>ie.target.column){var be=st(ie,Lt);return Lt.y1-be}if(ie.target.column>Lt.target.column){var ce=st(Lt,ie);return ce-ie.y1}}else return Lt.y1-ie.y1}if(Lt.circular&&!ie.circular)return Lt.circularLinkType=="top"?-1:1;if(ie.circular&&!Lt.circular)return ie.circularLinkType=="top"?1:-1;if(Lt.circular&&ie.circular)return Lt.circularLinkType===ie.circularLinkType&&Lt.circularLinkType=="top"?Lt.target.column===ie.target.column?Lt.target.y1-ie.target.y1:ie.target.column-Lt.target.column:Lt.circularLinkType===ie.circularLinkType&&Lt.circularLinkType=="bottom"?Lt.target.column===ie.target.column?ie.target.y1-Lt.target.y1:Lt.target.column-ie.target.column:Lt.circularLinkType=="top"?-1:1});var Ot=ye.y0;ue.forEach(function(Lt){Lt.y0=Ot+Lt.width/2,Ot=Ot+Lt.width}),ue.forEach(function(Lt,ie){if(Lt.circularLinkType=="bottom"){var be=ie+1,ce=0;for(be;be1&&ye.sort(function(Ot,Lt){if(!Ot.circular&&!Lt.circular){if(Ot.source.column==Lt.source.column)return Ot.y0-Lt.y0;if(Ct(Ot,Lt)){if(Lt.source.column0?"up":"down"}function Bt(Gt,ee){return M(Gt.source,ee)==M(Gt.target,ee)}function Zt(Gt,ee,xe){var ge=Gt.nodes,ye=Gt.links,ue=!1,Mt=!1;if(ye.forEach(function(Le){Le.circularLinkType=="top"?ue=!0:Le.circularLinkType=="bottom"&&(Mt=!0)}),ue==!1||Mt==!1){var Ot=y.min(ge,function(Le){return Le.y0}),Lt=y.max(ge,function(Le){return Le.y1}),ie=Lt-Ot,be=xe-ee,ce=be/ie;ge.forEach(function(Le){var Ze=(Le.y1-Le.y0)*ce;Le.y0=(Le.y0-Ot)*ce,Le.y1=Le.y0+Ze}),ye.forEach(function(Le){Le.y0=(Le.y0-Ot)*ce,Le.y1=(Le.y1-Ot)*ce,Le.width=Le.width*ce})}}f.sankeyCircular=S,f.sankeyCenter=c,f.sankeyLeft=a,f.sankeyRight=l,f.sankeyJustify=o,Object.defineProperty(f,"__esModule",{value:!0})})}),zz=It((et,Y)=>{Y.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}),eet=It((et,Y)=>{var f=Ytt(),y=(Lb(),tn($_)).interpolateNumber,z=Br(),P=Jtt(),n=tet(),i=zz(),a=Xi(),l=Hn(),o=Js(),c=jn(),s=c.strTranslate,h=c.strRotate,m=e1(),b=m.keyFun,x=m.repeat,_=m.unwrap,A=uu(),d=ls(),k=Rd(),w=k.CAP_SHIFT,D=k.LINE_SPACING,E=3;function I(it,st,xt){var ot=_(st),J=ot.trace,mt=J.domain,dt=J.orientation==="h",Ct=J.node.pad,Rt=J.node.thickness,Bt={justify:P.sankeyJustify,left:P.sankeyLeft,right:P.sankeyRight,center:P.sankeyCenter}[J.node.align],Zt=it.width*(mt.x[1]-mt.x[0]),Gt=it.height*(mt.y[1]-mt.y[0]),ee=ot._nodes,xe=ot._links,ge=ot.circular,ye;ge?ye=n.sankeyCircular().circularLinkGap(0):ye=P.sankey(),ye.iterations(i.sankeyIterations).size(dt?[Zt,Gt]:[Gt,Zt]).nodeWidth(Rt).nodePadding(Ct).nodeId(function(Er){return Er.pointNumber}).nodeAlign(Bt).nodes(ee).links(xe);var ue=ye();ye.nodePadding()=Xt||(Oe=Xt-_n.y0,Oe>1e-6&&(_n.y0+=Oe,_n.y1+=Oe)),Xt=_n.y1+Ct})}function mr(Er){var dn=Er.map(function(Pt,Ht){return{x0:Pt.x0,index:Ht}}).sort(function(Pt,Ht){return Pt.x0-Ht.x0}),_n=[],Oe=-1,Xt,oe=-1/0,zt;for(Mt=0;Mtoe+Rt&&(Oe+=1,Xt=_t.x0),oe=_t.x0,_n[Oe]||(_n[Oe]=[]),_n[Oe].push(_t),zt=Xt-_t.x0,_t.x0+=zt,_t.x1+=zt}return _n}if(J.node.x.length&&J.node.y.length){for(Mt=0;Mt0?" L "+J.targetX+" "+J.targetY:"")+"Z"):(xt="M "+(J.targetX-st)+" "+(J.targetY-ot)+" L "+(J.rightInnerExtent-st)+" "+(J.targetY-ot)+" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightSmallArcRadius+ot)+" 0 0 0 "+(J.rightFullExtent-ot-st)+" "+(J.targetY+J.rightSmallArcRadius)+" L "+(J.rightFullExtent-ot-st)+" "+J.verticalRightInnerExtent,mt&&dt?xt+=" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.rightInnerExtent-ot-st)+" "+(J.verticalFullExtent+ot)+" L "+(J.rightFullExtent+ot-st-(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent+ot)+" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.leftFullExtent+ot)+" "+J.verticalLeftInnerExtent:mt?xt+=" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.rightFullExtent-st-ot-(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" L "+(J.leftFullExtent+ot+(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.leftFullExtent+ot)+" "+J.verticalLeftInnerExtent:xt+=" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.rightInnerExtent-st)+" "+(J.verticalFullExtent+ot)+" L "+J.leftInnerExtent+" "+(J.verticalFullExtent+ot)+" A "+(J.leftLargeArcRadius+ot)+" "+(J.leftLargeArcRadius+ot)+" 0 0 0 "+(J.leftFullExtent+ot)+" "+J.verticalLeftInnerExtent,xt+=" L "+(J.leftFullExtent+ot)+" "+(J.sourceY+J.leftSmallArcRadius)+" A "+(J.leftLargeArcRadius+ot)+" "+(J.leftSmallArcRadius+ot)+" 0 0 0 "+J.leftInnerExtent+" "+(J.sourceY-ot)+" L "+J.sourceX+" "+(J.sourceY-ot)+" L "+J.sourceX+" "+(J.sourceY+ot)+" L "+J.leftInnerExtent+" "+(J.sourceY+ot)+" A "+(J.leftLargeArcRadius-ot)+" "+(J.leftSmallArcRadius-ot)+" 0 0 1 "+(J.leftFullExtent-ot)+" "+(J.sourceY+J.leftSmallArcRadius)+" L "+(J.leftFullExtent-ot)+" "+J.verticalLeftInnerExtent,mt&&dt?xt+=" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.leftFullExtent-ot-(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" L "+(J.rightFullExtent+ot-st+(J.rightLargeArcRadius-ot))+" "+(J.verticalFullExtent-ot)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.rightFullExtent+ot-st)+" "+J.verticalRightInnerExtent:mt?xt+=" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.leftFullExtent+ot)+" "+(J.verticalFullExtent+ot)+" L "+(J.rightFullExtent-st-ot)+" "+(J.verticalFullExtent+ot)+" A "+(J.rightLargeArcRadius+ot)+" "+(J.rightLargeArcRadius+ot)+" 0 0 0 "+(J.rightFullExtent+ot-st)+" "+J.verticalRightInnerExtent:xt+=" A "+(J.leftLargeArcRadius-ot)+" "+(J.leftLargeArcRadius-ot)+" 0 0 1 "+J.leftInnerExtent+" "+(J.verticalFullExtent-ot)+" L "+(J.rightInnerExtent-st)+" "+(J.verticalFullExtent-ot)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightLargeArcRadius-ot)+" 0 0 1 "+(J.rightFullExtent+ot-st)+" "+J.verticalRightInnerExtent,xt+=" L "+(J.rightFullExtent+ot-st)+" "+(J.targetY+J.rightSmallArcRadius)+" A "+(J.rightLargeArcRadius-ot)+" "+(J.rightSmallArcRadius-ot)+" 0 0 1 "+(J.rightInnerExtent-st)+" "+(J.targetY+ot)+" L "+(J.targetX-st)+" "+(J.targetY+ot)+(st>0?" L "+J.targetX+" "+J.targetY:"")+"Z"),xt}function g(){var it=.5;function st(xt){var ot=xt.linkArrowLength;if(xt.link.circular)return p(xt.link,ot);var J=Math.abs((xt.link.target.x0-xt.link.source.x1)/2);ot>J&&(ot=J);var mt=xt.link.source.x1,dt=xt.link.target.x0-ot,Ct=y(mt,dt),Rt=Ct(it),Bt=Ct(1-it),Zt=xt.link.y0-xt.link.width/2,Gt=xt.link.y0+xt.link.width/2,ee=xt.link.y1-xt.link.width/2,xe=xt.link.y1+xt.link.width/2,ge="M"+mt+","+Zt,ye="C"+Rt+","+Zt+" "+Bt+","+ee+" "+dt+","+ee,ue="C"+Bt+","+xe+" "+Rt+","+Gt+" "+mt+","+Gt,Mt=ot>0?"L"+(dt+ot)+","+(ee+xt.link.width/2):"";return Mt+="L"+dt+","+xe,ge+ye+Mt+ue+"Z"}return st}function C(it,st){var xt=a(st.color),ot=i.nodePadAcross,J=it.nodePad/2;st.dx=st.x1-st.x0,st.dy=st.y1-st.y0;var mt=st.dx,dt=Math.max(.5,st.dy),Ct="node_"+st.pointNumber;return st.group&&(Ct=c.randstr()),st.trace=it.trace,st.curveNumber=it.trace.index,{index:st.pointNumber,key:Ct,partOfGroup:st.partOfGroup||!1,group:st.group,traceId:it.key,trace:it.trace,node:st,nodePad:it.nodePad,nodeLineColor:it.nodeLineColor,nodeLineWidth:it.nodeLineWidth,textFont:it.textFont,size:it.horizontal?it.height:it.width,visibleWidth:Math.ceil(mt),visibleHeight:dt,zoneX:-ot,zoneY:-J,zoneWidth:mt+2*ot,zoneHeight:dt+2*J,labelY:it.horizontal?st.dy/2+1:st.dx/2+1,left:st.originalLayer===1,sizeAcross:it.width,forceLayouts:it.forceLayouts,horizontal:it.horizontal,darkBackground:xt.getBrightness()<=128,tinyColorHue:l.tinyRGB(xt),tinyColorAlpha:xt.getAlpha(),valueFormat:it.valueFormat,valueSuffix:it.valueSuffix,sankey:it.sankey,graph:it.graph,arrangement:it.arrangement,uniqueNodeLabelPathId:[it.guid,it.key,Ct].join("_"),interactionState:it.interactionState,figure:it}}function S(it){it.attr("transform",function(st){return s(st.node.x0.toFixed(3),st.node.y0.toFixed(3))})}function N(it){it.call(S)}function B(it,st){it.call(N),st.attr("d",g())}function U(it){it.attr("width",function(st){return st.node.x1-st.node.x0}).attr("height",function(st){return st.visibleHeight})}function V(it){return it.link.width>1||it.linkLineWidth>0}function W(it){var st=s(it.translateX,it.translateY);return st+(it.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function F(it,st,xt){it.on(".basic",null).on("mouseover.basic",function(ot){!ot.interactionState.dragInProgress&&!ot.partOfGroup&&(xt.hover(this,ot,st),ot.interactionState.hovered=[this,ot])}).on("mousemove.basic",function(ot){!ot.interactionState.dragInProgress&&!ot.partOfGroup&&(xt.follow(this,ot),ot.interactionState.hovered=[this,ot])}).on("mouseout.basic",function(ot){!ot.interactionState.dragInProgress&&!ot.partOfGroup&&(xt.unhover(this,ot,st),ot.interactionState.hovered=!1)}).on("click.basic",function(ot){ot.interactionState.hovered&&(xt.unhover(this,ot,st),ot.interactionState.hovered=!1),!ot.interactionState.dragInProgress&&!ot.partOfGroup&&xt.select(this,ot,st)})}function H(it,st,xt,ot){var J=z.behavior.drag().origin(function(mt){return{x:mt.node.x0+mt.visibleWidth/2,y:mt.node.y0+mt.visibleHeight/2}}).on("dragstart",function(mt){if(mt.arrangement!=="fixed"&&(c.ensureSingle(ot._fullLayout._infolayer,"g","dragcover",function(Ct){ot._fullLayout._dragCover=Ct}),c.raiseToTop(this),mt.interactionState.dragInProgress=mt.node,vt(mt.node),mt.interactionState.hovered&&(xt.nodeEvents.unhover.apply(0,mt.interactionState.hovered),mt.interactionState.hovered=!1),mt.arrangement==="snap")){var dt=mt.traceId+"|"+mt.key;mt.forceLayouts[dt]?mt.forceLayouts[dt].alpha(1):q(it,dt,mt),G(it,st,mt,dt,ot)}}).on("drag",function(mt){if(mt.arrangement!=="fixed"){var dt=z.event.x,Ct=z.event.y;mt.arrangement==="snap"?(mt.node.x0=dt-mt.visibleWidth/2,mt.node.x1=dt+mt.visibleWidth/2,mt.node.y0=Ct-mt.visibleHeight/2,mt.node.y1=Ct+mt.visibleHeight/2):(mt.arrangement==="freeform"&&(mt.node.x0=dt-mt.visibleWidth/2,mt.node.x1=dt+mt.visibleWidth/2),Ct=Math.max(0,Math.min(mt.size-mt.visibleHeight/2,Ct)),mt.node.y0=Ct-mt.visibleHeight/2,mt.node.y1=Ct+mt.visibleHeight/2),vt(mt.node),mt.arrangement!=="snap"&&(mt.sankey.update(mt.graph),B(it.filter(ut(mt)),st))}}).on("dragend",function(mt){if(mt.arrangement!=="fixed"){mt.interactionState.dragInProgress=!1;for(var dt=0;dt0)window.requestAnimationFrame(mt);else{var Rt=xt.node.originalX;xt.node.x0=Rt-xt.visibleWidth/2,xt.node.x1=Rt+xt.visibleWidth/2,ht(xt,J)}})}function tt(it,st,xt,ot){return function(){for(var J=0,mt=0;mt0&&ot.forceLayouts[st].alpha(0)}}function ht(it,st){for(var xt=[],ot=[],J=0;J{var f=Br(),y=jn(),z=y.numberFormat,P=eet(),n=hd(),i=Hn(),a=zz().cn,l=y._;function o(w){return w!==""}function c(w,D){return w.filter(function(E){return E.key===D.traceId})}function s(w,D){f.select(w).select("path").style("fill-opacity",D),f.select(w).select("rect").style("fill-opacity",D)}function h(w){f.select(w).select("text.name").style("fill","black")}function m(w){return function(D){return w.node.sourceLinks.indexOf(D.link)!==-1||w.node.targetLinks.indexOf(D.link)!==-1}}function b(w){return function(D){return D.node.sourceLinks.indexOf(w.link)!==-1||D.node.targetLinks.indexOf(w.link)!==-1}}function x(w,D,E){D&&E&&c(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(A.bind(0,D,E,!1))}function _(w,D,E){D&&E&&c(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(d.bind(0,D,E,!1))}function A(w,D,E,I){I.style("fill",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverHue}).style("fill-opacity",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverAlpha}),I.each(function(M){var p=M.link.label;p!==""&&c(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverHue}).style("fill-opacity",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverAlpha})}),E&&c(D,w).selectAll("."+a.sankeyNode).filter(b(w)).call(x)}function d(w,D,E,I){I.style("fill",function(M){return M.tinyColorHue}).style("fill-opacity",function(M){return M.tinyColorAlpha}),I.each(function(M){var p=M.link.label;p!==""&&c(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){return g.tinyColorHue}).style("fill-opacity",function(g){return g.tinyColorAlpha})}),E&&c(D,w).selectAll(a.sankeyNode).filter(b(w)).call(_)}function k(w,D){var E=w.hoverlabel||{},I=y.nestedProperty(E,D).get();return Array.isArray(I)?!1:I}Y.exports=function(w,D){for(var E=w._fullLayout,I=E._paper,M=E._size,p=0;p"),color:k(ut,"bgcolor")||i.addOpacity(xt.color,1),borderColor:k(ut,"bordercolor"),fontFamily:k(ut,"font.family"),fontSize:k(ut,"font.size"),fontColor:k(ut,"font.color"),fontWeight:k(ut,"font.weight"),fontStyle:k(ut,"font.style"),fontVariant:k(ut,"font.variant"),fontTextcase:k(ut,"font.textcase"),fontLineposition:k(ut,"font.lineposition"),fontShadow:k(ut,"font.shadow"),nameLength:k(ut,"namelength"),textAlign:k(ut,"align"),idealAlign:f.event.x"),color:k(ut,"bgcolor")||vt.tinyColorHue,borderColor:k(ut,"bordercolor"),fontFamily:k(ut,"font.family"),fontSize:k(ut,"font.size"),fontColor:k(ut,"font.color"),fontWeight:k(ut,"font.weight"),fontStyle:k(ut,"font.style"),fontVariant:k(ut,"font.variant"),fontTextcase:k(ut,"font.textcase"),fontLineposition:k(ut,"font.lineposition"),fontShadow:k(ut,"font.shadow"),nameLength:k(ut,"namelength"),textAlign:k(ut,"align"),idealAlign:"left",hovertemplate:ut.hovertemplate,hovertemplateLabels:J,eventData:[vt.node]},{container:E._hoverlayer.node(),outerContainer:E._paper.node(),gd:w});s(Ct,.85),h(Ct)}}},ht=function(bt,vt,ut){w._fullLayout.hovermode!==!1&&(f.select(bt).call(_,vt,ut),vt.node.trace.node.hoverinfo!=="skip"&&(vt.node.fullData=vt.node.trace,w.emit("plotly_unhover",{event:f.event,points:[vt.node]})),n.loneUnhover(E._hoverlayer.node()))};P(w,I,D,{width:M.w,height:M.h,margin:{t:M.t,r:M.r,b:M.b,l:M.l}},{linkEvents:{hover:S,follow:F,unhover:H,select:C},nodeEvents:{hover:G,follow:tt,unhover:ht,select:q}})}}),ret=It(et=>{var Y=sh().overrideAll,f=Mf().getModuleCalcData,y=Oz(),z=Xa(),P=Mm(),n=Up(),i=Md().prepSelect,a=jn(),l=ls(),o="sankey";et.name=o,et.baseLayoutAttrOverrides=Y({hoverlabel:z.hoverlabel},"plot","nested"),et.plot=function(s){var h=f(s.calcdata,o)[0];y(s,h),et.updateFx(s)},et.clean=function(s,h,m,b){var x=b._has&&b._has(o),_=h._has&&h._has(o);x&&!_&&(b._paperdiv.selectAll(".sankey").remove(),b._paperdiv.selectAll(".bgsankey").remove())},et.updateFx=function(s){for(var h=0;h{Y.exports=function(f,y){for(var z=f.cd,P=[],n=z[0].trace,i=n._sankey.graph.nodes,a=0;a{Y.exports={attributes:Pz(),supplyDefaults:Wtt(),calc:qtt(),plot:Oz(),moduleType:"trace",name:"sankey",basePlotModule:ret(),selectPoints:net(),categories:["noOpacity"],meta:{}}}),aet=It((et,Y)=>{Y.exports=iet()}),oet=It(et=>{var Y=lh();et.name="indicator",et.plot=function(f,y,z,P){Y.plotBasePlot(et.name,f,y,z,P)},et.clean=function(f,y,z,P){Y.cleanBasePlot(et.name,f,y,z,P)}}),Bz=It((et,Y)=>{var f=Yn().extendFlat,y=Yn().extendDeep,z=sh().overrideAll,P=hi(),n=Sn(),i=Jh().attributes,a=Gf(),l=Tc().templatedArray,o=Ow(),c=Sh().descriptionOnlyNumbers,s=P({editType:"plot",colorEditType:"plot"}),h={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:n.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},m={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},b=l("step",y({},h,{range:m}));Y.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:i({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:f({},s,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:c("value")},font:f({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:c("value")},increasing:{symbol:{valType:"string",dflt:o.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:o.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:f({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:y({},h,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:z({range:m,visible:f({},a.visible,{dflt:!0}),tickmode:a.minor.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:f({},a.ticks,{dflt:"outside"}),ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,ticklabelstep:a.ticklabelstep,showticklabels:a.showticklabels,labelalias:a.labelalias,tickfont:P({}),tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,tickprefix:a.tickprefix,showtickprefix:a.showtickprefix,ticksuffix:a.ticksuffix,showticksuffix:a.showticksuffix,separatethousands:a.separatethousands,exponentformat:a.exponentformat,minexponent:a.minexponent,showexponent:a.showexponent,editType:"plot"},"plot"),steps:b,threshold:{line:{color:f({},h.line.color,{}),width:f({},h.line.width,{dflt:1}),editType:"plot"},thickness:f({},h.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),Rz=It((et,Y)=>{Y.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),set=It((et,Y)=>{var f=jn(),y=Bz(),z=Jh().defaults,P=Tc(),n=Zf(),i=Rz(),a=jv(),l=Uv(),o=q0(),c=Sg();function s(m,b,x,_){function A(H,q){return f.coerce(m,b,y,H,q)}z(b,_,A),A("mode"),b._hasNumber=b.mode.indexOf("number")!==-1,b._hasDelta=b.mode.indexOf("delta")!==-1,b._hasGauge=b.mode.indexOf("gauge")!==-1;var d=A("value");b._range=[0,typeof d=="number"?1.5*d:1];var k=new Array(2),w;if(b._hasNumber){A("number.valueformat");var D=f.extendFlat({},_.font);D.size=void 0,f.coerceFont(A,"number.font",D),b.number.font.size===void 0&&(b.number.font.size=i.defaultNumberFontSize,k[0]=!0),A("number.prefix"),A("number.suffix"),w=b.number.font.size}var E;if(b._hasDelta){var I=f.extendFlat({},_.font);I.size=void 0,f.coerceFont(A,"delta.font",I),b.delta.font.size===void 0&&(b.delta.font.size=(b._hasNumber?.5:1)*(w||i.defaultNumberFontSize),k[1]=!0),A("delta.reference",b.value),A("delta.relative"),A("delta.valueformat",b.delta.relative?"2%":""),A("delta.increasing.symbol"),A("delta.increasing.color"),A("delta.decreasing.symbol"),A("delta.decreasing.color"),A("delta.position"),A("delta.prefix"),A("delta.suffix"),E=b.delta.font.size}b._scaleNumbers=(!b._hasNumber||k[0])&&(!b._hasDelta||k[1])||!1;var M=f.extendFlat({},_.font);M.size=.25*(w||E||i.defaultNumberFontSize),f.coerceFont(A,"title.font",M),A("title.text");var p,g,C,S;function N(H,q){return f.coerce(p,g,y.gauge,H,q)}function B(H,q){return f.coerce(C,S,y.gauge.axis,H,q)}if(b._hasGauge){p=m.gauge,p||(p={}),g=P.newContainer(b,"gauge"),N("shape");var U=b._isBullet=b.gauge.shape==="bullet";U||A("title.align","center");var V=b._isAngular=b.gauge.shape==="angular";V||A("align","center"),N("bgcolor",_.paper_bgcolor),N("borderwidth"),N("bordercolor"),N("bar.color"),N("bar.line.color"),N("bar.line.width");var W=i.valueThickness*(b.gauge.shape==="bullet"?.5:1);N("bar.thickness",W),n(p,g,{name:"steps",handleItemDefaults:h}),N("threshold.value"),N("threshold.thickness"),N("threshold.line.width"),N("threshold.line.color"),C={},p&&(C=p.axis||{}),S=P.newContainer(g,"axis"),B("visible"),b._range=B("range",b._range);var F={font:_.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};a(C,S,B,"linear"),c(C,S,B,"linear",F),o(C,S,B,"linear",F),l(C,S,B,F)}else A("title.align","center"),A("align","center"),b._isAngular=b._isBullet=!1;b._length=null}function h(m,b){function x(_,A){return f.coerce(m,b,y.gauge.steps,_,A)}x("color"),x("line.color"),x("line.width"),x("range"),x("thickness")}Y.exports={supplyDefaults:s}}),cet=It((et,Y)=>{function f(y,z){var P=[],n=z.value;typeof z._lastValue!="number"&&(z._lastValue=z.value);var i=z._lastValue,a=i;return z._hasDelta&&typeof z.delta.reference=="number"&&(a=z.delta.reference),P[0]={y:n,lastY:i,delta:n-a,relativeDelta:(n-a)/a},P}Y.exports={calc:f}}),uet=It((et,Y)=>{var f=Br(),y=(Lb(),tn($_)).interpolate,z=(Lb(),tn($_)).interpolateNumber,P=jn(),n=P.strScale,i=P.strTranslate,a=P.rad2deg,l=Rd().MID_SHIFT,o=Js(),c=Rz(),s=uu(),h=Fs(),m=mb(),b=Ew(),x=Gf(),_=Hn(),A={left:"start",center:"middle",right:"end"},d={left:0,center:.5,right:1},k=/[yzafpnµmkMGTPEZY]/;function w(U){return U&&U.duration>0}Y.exports=function(U,V,W,F){var H=U._fullLayout,q;w(W)&&F&&(q=F()),P.makeTraceGroups(H._indicatorlayer,V,"trace").each(function(G){var tt=G[0],ht=tt.trace,bt=f.select(this),vt=ht._hasGauge,ut=ht._isAngular,rt=ht._isBullet,gt=ht.domain,it={w:H._size.w*(gt.x[1]-gt.x[0]),h:H._size.h*(gt.y[1]-gt.y[0]),l:H._size.l+H._size.w*gt.x[0],r:H._size.r+H._size.w*(1-gt.x[1]),t:H._size.t+H._size.h*(1-gt.y[1]),b:H._size.b+H._size.h*gt.y[0]},st=it.l+it.w/2,xt=it.t+it.h/2,ot=Math.min(it.w/2,it.h),J=c.innerRadius*ot,mt,dt,Ct,Rt=ht.align||"center";if(dt=xt,!vt)mt=it.l+d[Rt]*it.w,Ct=function(Ot){return C(Ot,it.w,it.h)};else if(ut&&(mt=st,dt=xt+ot/2,Ct=function(Ot){return S(Ot,.9*J)}),rt){var Bt=c.bulletPadding,Zt=1-c.bulletNumberDomainSize+Bt;mt=it.l+(Zt+(1-Zt)*d[Rt])*it.w,Ct=function(Ot){return C(Ot,(c.bulletNumberDomainSize-Bt)*it.w,it.h)}}I(U,bt,G,{numbersX:mt,numbersY:dt,numbersScaler:Ct,transitionOpts:W,onComplete:q});var Gt,ee;vt&&(Gt={range:ht.gauge.axis.range,color:ht.gauge.bgcolor,line:{color:ht.gauge.bordercolor,width:0},thickness:1},ee={range:ht.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:ht.gauge.bordercolor,width:ht.gauge.borderwidth},thickness:1});var xe=bt.selectAll("g.angular").data(ut?G:[]);xe.exit().remove();var ge=bt.selectAll("g.angularaxis").data(ut?G:[]);ge.exit().remove(),ut&&E(U,bt,G,{radius:ot,innerRadius:J,gauge:xe,layer:ge,size:it,gaugeBg:Gt,gaugeOutline:ee,transitionOpts:W,onComplete:q});var ye=bt.selectAll("g.bullet").data(rt?G:[]);ye.exit().remove();var ue=bt.selectAll("g.bulletaxis").data(rt?G:[]);ue.exit().remove(),rt&&D(U,bt,G,{gauge:ye,layer:ue,size:it,gaugeBg:Gt,gaugeOutline:ee,transitionOpts:W,onComplete:q});var Mt=bt.selectAll("text.title").data(G);Mt.exit().remove(),Mt.enter().append("text").classed("title",!0),Mt.attr("text-anchor",function(){return rt?A.right:A[ht.title.align]}).text(ht.title.text).call(o.font,ht.title.font).call(s.convertToTspans,U),Mt.attr("transform",function(){var Ot=it.l+it.w*d[ht.title.align],Lt,ie=c.titlePadding,be=o.bBox(Mt.node());if(vt){if(ut)if(ht.gauge.axis.visible){var ce=o.bBox(ge.node());Lt=ce.top-ie-be.bottom}else Lt=it.t+it.h/2-ot/2-be.bottom-ie;rt&&(Lt=dt-(be.top+be.bottom)/2,Ot=it.l-c.bulletPadding*it.w)}else Lt=ht._numbersTop-ie-be.bottom;return i(Ot,Lt)})})};function D(U,V,W,F){var H=W[0].trace,q=F.gauge,G=F.layer,tt=F.gaugeBg,ht=F.gaugeOutline,bt=F.size,vt=H.domain,ut=F.transitionOpts,rt=F.onComplete,gt,it,st,xt,ot;q.enter().append("g").classed("bullet",!0),q.attr("transform",i(bt.l,bt.t)),G.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),G.selectAll("g.xbulletaxistick,path,text").remove();var J=bt.h,mt=H.gauge.bar.thickness*J,dt=vt.x[0],Ct=vt.x[0]+(vt.x[1]-vt.x[0])*(H._hasNumber||H._hasDelta?1-c.bulletNumberDomainSize:1);gt=g(U,H.gauge.axis),gt._id="xbulletaxis",gt.domain=[dt,Ct],gt.setScale(),it=h.calcTicks(gt),st=h.makeTransTickFn(gt),xt=h.getTickSigns(gt)[2],ot=bt.t+bt.h,gt.visible&&(h.drawTicks(U,gt,{vals:gt.ticks==="inside"?h.clipEnds(gt,it):it,layer:G,path:h.makeTickPath(gt,ot,xt),transFn:st}),h.drawLabels(U,gt,{vals:it,layer:G,transFn:st,labelFns:h.makeLabelFns(gt,ot)}));function Rt(ye){ye.attr("width",function(ue){return Math.max(0,gt.c2p(ue.range[1])-gt.c2p(ue.range[0]))}).attr("x",function(ue){return gt.c2p(ue.range[0])}).attr("y",function(ue){return .5*(1-ue.thickness)*J}).attr("height",function(ue){return ue.thickness*J})}var Bt=[tt].concat(H.gauge.steps),Zt=q.selectAll("g.bg-bullet").data(Bt);Zt.enter().append("g").classed("bg-bullet",!0).append("rect"),Zt.select("rect").call(Rt).call(M),Zt.exit().remove();var Gt=q.selectAll("g.value-bullet").data([H.gauge.bar]);Gt.enter().append("g").classed("value-bullet",!0).append("rect"),Gt.select("rect").attr("height",mt).attr("y",(J-mt)/2).call(M),w(ut)?Gt.select("rect").transition().duration(ut.duration).ease(ut.easing).each("end",function(){rt&&rt()}).each("interrupt",function(){rt&&rt()}).attr("width",Math.max(0,gt.c2p(Math.min(H.gauge.axis.range[1],W[0].y)))):Gt.select("rect").attr("width",typeof W[0].y=="number"?Math.max(0,gt.c2p(Math.min(H.gauge.axis.range[1],W[0].y))):0),Gt.exit().remove();var ee=W.filter(function(){return H.gauge.threshold.value||H.gauge.threshold.value===0}),xe=q.selectAll("g.threshold-bullet").data(ee);xe.enter().append("g").classed("threshold-bullet",!0).append("line"),xe.select("line").attr("x1",gt.c2p(H.gauge.threshold.value)).attr("x2",gt.c2p(H.gauge.threshold.value)).attr("y1",(1-H.gauge.threshold.thickness)/2*J).attr("y2",(1-(1-H.gauge.threshold.thickness)/2)*J).call(_.stroke,H.gauge.threshold.line.color).style("stroke-width",H.gauge.threshold.line.width),xe.exit().remove();var ge=q.selectAll("g.gauge-outline").data([ht]);ge.enter().append("g").classed("gauge-outline",!0).append("rect"),ge.select("rect").call(Rt).call(M),ge.exit().remove()}function E(U,V,W,F){var H=W[0].trace,q=F.size,G=F.radius,tt=F.innerRadius,ht=F.gaugeBg,bt=F.gaugeOutline,vt=[q.l+q.w/2,q.t+q.h/2+G/2],ut=F.gauge,rt=F.layer,gt=F.transitionOpts,it=F.onComplete,st=Math.PI/2;function xt(Ze){var Qe=H.gauge.axis.range[0],mr=H.gauge.axis.range[1],fr=(Ze-Qe)/(mr-Qe)*Math.PI-st;return fr<-st?-st:fr>st?st:fr}function ot(Ze){return f.svg.arc().innerRadius((tt+G)/2-Ze/2*(G-tt)).outerRadius((tt+G)/2+Ze/2*(G-tt)).startAngle(-st)}function J(Ze){Ze.attr("d",function(Qe){return ot(Qe.thickness).startAngle(xt(Qe.range[0])).endAngle(xt(Qe.range[1]))()})}var mt,dt,Ct,Rt;ut.enter().append("g").classed("angular",!0),ut.attr("transform",i(vt[0],vt[1])),rt.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),rt.selectAll("g.xangularaxistick,path,text").remove(),mt=g(U,H.gauge.axis),mt.type="linear",mt.range=H.gauge.axis.range,mt._id="xangularaxis",mt.ticklabeloverflow="allow",mt.setScale();var Bt=function(Ze){return(mt.range[0]-Ze.x)/(mt.range[1]-mt.range[0])*Math.PI+Math.PI},Zt={},Gt=h.makeLabelFns(mt,0),ee=Gt.labelStandoff;Zt.xFn=function(Ze){var Qe=Bt(Ze);return Math.cos(Qe)*ee},Zt.yFn=function(Ze){var Qe=Bt(Ze),mr=Math.sin(Qe)>0?.2:1;return-Math.sin(Qe)*(ee+Ze.fontSize*mr)+Math.abs(Math.cos(Qe))*(Ze.fontSize*l)},Zt.anchorFn=function(Ze){var Qe=Bt(Ze),mr=Math.cos(Qe);return Math.abs(mr)<.1?"middle":mr>0?"start":"end"},Zt.heightFn=function(Ze,Qe,mr){var fr=Bt(Ze);return-.5*(1+Math.sin(fr))*mr};var xe=function(Ze){return i(vt[0]+G*Math.cos(Ze),vt[1]-G*Math.sin(Ze))};Ct=function(Ze){return xe(Bt(Ze))};var ge=function(Ze){var Qe=Bt(Ze);return xe(Qe)+"rotate("+-a(Qe)+")"};if(dt=h.calcTicks(mt),Rt=h.getTickSigns(mt)[2],mt.visible){Rt=mt.ticks==="inside"?-1:1;var ye=(mt.linewidth||1)/2;h.drawTicks(U,mt,{vals:dt,layer:rt,path:"M"+Rt*ye+",0h"+Rt*mt.ticklen,transFn:ge}),h.drawLabels(U,mt,{vals:dt,layer:rt,transFn:Ct,labelFns:Zt})}var ue=[ht].concat(H.gauge.steps),Mt=ut.selectAll("g.bg-arc").data(ue);Mt.enter().append("g").classed("bg-arc",!0).append("path"),Mt.select("path").call(J).call(M),Mt.exit().remove();var Ot=ot(H.gauge.bar.thickness),Lt=ut.selectAll("g.value-arc").data([H.gauge.bar]);Lt.enter().append("g").classed("value-arc",!0).append("path");var ie=Lt.select("path");w(gt)?(ie.transition().duration(gt.duration).ease(gt.easing).each("end",function(){it&&it()}).each("interrupt",function(){it&&it()}).attrTween("d",p(Ot,xt(W[0].lastY),xt(W[0].y))),H._lastValue=W[0].y):ie.attr("d",typeof W[0].y=="number"?Ot.endAngle(xt(W[0].y)):"M0,0Z"),ie.call(M),Lt.exit().remove(),ue=[];var be=H.gauge.threshold.value;(be||be===0)&&ue.push({range:[be,be],color:H.gauge.threshold.color,line:{color:H.gauge.threshold.line.color,width:H.gauge.threshold.line.width},thickness:H.gauge.threshold.thickness});var ce=ut.selectAll("g.threshold-arc").data(ue);ce.enter().append("g").classed("threshold-arc",!0).append("path"),ce.select("path").call(J).call(M),ce.exit().remove();var Le=ut.selectAll("g.gauge-outline").data([bt]);Le.enter().append("g").classed("gauge-outline",!0).append("path"),Le.select("path").call(J).call(M),Le.exit().remove()}function I(U,V,W,F){var H=W[0].trace,q=F.numbersX,G=F.numbersY,tt=H.align||"center",ht=A[tt],bt=F.transitionOpts,vt=F.onComplete,ut=P.ensureSingle(V,"g","numbers"),rt,gt,it,st=[];H._hasNumber&&st.push("number"),H._hasDelta&&(st.push("delta"),H.delta.position==="left"&&st.reverse());var xt=ut.selectAll("text").data(st);xt.enter().append("text"),xt.attr("text-anchor",function(){return ht}).attr("class",function(xe){return xe}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),xt.exit().remove();function ot(xe,ge,ye,ue){if(xe.match("s")&&ye>=0!=ue>=0&&!ge(ye).slice(-1).match(k)&&!ge(ue).slice(-1).match(k)){var Mt=xe.slice().replace("s","f").replace(/\d+/,function(Lt){return parseInt(Lt)-1}),Ot=g(U,{tickformat:Mt});return function(Lt){return Math.abs(Lt)<1?h.tickText(Ot,Lt).text:ge(Lt)}}else return ge}function J(){var xe=g(U,{tickformat:H.number.valueformat},H._range);xe.setScale(),h.prepTicks(xe);var ge=function(Lt){return h.tickText(xe,Lt).text},ye=H.number.suffix,ue=H.number.prefix,Mt=ut.select("text.number");function Ot(){var Lt=typeof W[0].y=="number"?ue+ge(W[0].y)+ye:"-";Mt.text(Lt).call(o.font,H.number.font).call(s.convertToTspans,U)}return w(bt)?Mt.transition().duration(bt.duration).ease(bt.easing).each("end",function(){Ot(),vt&&vt()}).each("interrupt",function(){Ot(),vt&&vt()}).attrTween("text",function(){var Lt=f.select(this),ie=z(W[0].lastY,W[0].y);H._lastValue=W[0].y;var be=ot(H.number.valueformat,ge,W[0].lastY,W[0].y);return function(ce){Lt.text(ue+be(ie(ce))+ye)}}):Ot(),rt=N(ue+ge(W[0].y)+ye,H.number.font,ht,U),Mt}function mt(){var xe=g(U,{tickformat:H.delta.valueformat},H._range);xe.setScale(),h.prepTicks(xe);var ge=function(ce){return h.tickText(xe,ce).text},ye=H.delta.suffix,ue=H.delta.prefix,Mt=function(ce){var Le=H.delta.relative?ce.relativeDelta:ce.delta;return Le},Ot=function(ce,Le){return ce===0||typeof ce!="number"||isNaN(ce)?"-":(ce>0?H.delta.increasing.symbol:H.delta.decreasing.symbol)+ue+Le(ce)+ye},Lt=function(ce){return ce.delta>=0?H.delta.increasing.color:H.delta.decreasing.color};H._deltaLastValue===void 0&&(H._deltaLastValue=Mt(W[0]));var ie=ut.select("text.delta");ie.call(o.font,H.delta.font).call(_.fill,Lt({delta:H._deltaLastValue}));function be(){ie.text(Ot(Mt(W[0]),ge)).call(_.fill,Lt(W[0])).call(s.convertToTspans,U)}return w(bt)?ie.transition().duration(bt.duration).ease(bt.easing).tween("text",function(){var ce=f.select(this),Le=Mt(W[0]),Ze=H._deltaLastValue,Qe=ot(H.delta.valueformat,ge,Ze,Le),mr=z(Ze,Le);return H._deltaLastValue=Le,function(fr){ce.text(Ot(mr(fr),Qe)),ce.call(_.fill,Lt({delta:mr(fr)}))}}).each("end",function(){be(),vt&&vt()}).each("interrupt",function(){be(),vt&&vt()}):be(),gt=N(Ot(Mt(W[0]),ge),H.delta.font,ht,U),ie}var dt=H.mode+H.align,Ct;if(H._hasDelta&&(Ct=mt(),dt+=H.delta.position+H.delta.font.size+H.delta.font.family+H.delta.valueformat,dt+=H.delta.increasing.symbol+H.delta.decreasing.symbol,it=gt),H._hasNumber&&(J(),dt+=H.number.font.size+H.number.font.family+H.number.valueformat+H.number.suffix+H.number.prefix,it=rt),H._hasDelta&&H._hasNumber){var Rt=[(rt.left+rt.right)/2,(rt.top+rt.bottom)/2],Bt=[(gt.left+gt.right)/2,(gt.top+gt.bottom)/2],Zt,Gt,ee=.75*H.delta.font.size;H.delta.position==="left"&&(Zt=B(H,"deltaPos",0,-1*(rt.width*d[H.align]+gt.width*(1-d[H.align])+ee),dt,Math.min),Gt=Rt[1]-Bt[1],it={width:rt.width+gt.width+ee,height:Math.max(rt.height,gt.height),left:gt.left+Zt,right:rt.right,top:Math.min(rt.top,gt.top+Gt),bottom:Math.max(rt.bottom,gt.bottom+Gt)}),H.delta.position==="right"&&(Zt=B(H,"deltaPos",0,rt.width*(1-d[H.align])+gt.width*d[H.align]+ee,dt,Math.max),Gt=Rt[1]-Bt[1],it={width:rt.width+gt.width+ee,height:Math.max(rt.height,gt.height),left:rt.left,right:gt.right+Zt,top:Math.min(rt.top,gt.top+Gt),bottom:Math.max(rt.bottom,gt.bottom+Gt)}),H.delta.position==="bottom"&&(Zt=null,Gt=gt.height,it={width:Math.max(rt.width,gt.width),height:rt.height+gt.height,left:Math.min(rt.left,gt.left),right:Math.max(rt.right,gt.right),top:rt.bottom-rt.height,bottom:rt.bottom+gt.height}),H.delta.position==="top"&&(Zt=null,Gt=rt.top,it={width:Math.max(rt.width,gt.width),height:rt.height+gt.height,left:Math.min(rt.left,gt.left),right:Math.max(rt.right,gt.right),top:rt.bottom-rt.height-gt.height,bottom:rt.bottom}),Ct.attr({dx:Zt,dy:Gt})}(H._hasNumber||H._hasDelta)&&ut.attr("transform",function(){var xe=F.numbersScaler(it);dt+=xe[2];var ge=B(H,"numbersScale",1,xe[0],dt,Math.min),ye;H._scaleNumbers||(ge=1),H._isAngular?ye=G-ge*it.bottom:ye=G-ge*(it.top+it.bottom)/2,H._numbersTop=ge*it.top+ye;var ue=it[tt];tt==="center"&&(ue=(it.left+it.right)/2);var Mt=q-ge*ue;return Mt=B(H,"numbersTranslate",0,Mt,dt,Math.max),i(Mt,ye)+n(ge)})}function M(U){U.each(function(V){_.stroke(f.select(this),V.line.color)}).each(function(V){_.fill(f.select(this),V.color)}).style("stroke-width",function(V){return V.line.width})}function p(U,V,W){return function(){var F=y(V,W);return function(H){return U.endAngle(F(H))()}}}function g(U,V,W){var F=U._fullLayout,H=P.extendFlat({type:"linear",ticks:"outside",range:W,showline:!0},V),q={type:"linear",_id:"x"+V._id},G={letter:"x",font:F.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function tt(ht,bt){return P.coerce(H,q,x,ht,bt)}return m(H,q,tt,G,F),b(H,q,tt,G),q}function C(U,V,W){var F=Math.min(V/U.width,W/U.height);return[F,U,V+"x"+W]}function S(U,V){var W=Math.sqrt(U.width/2*(U.width/2)+U.height*U.height),F=V/W;return[F,U,V]}function N(U,V,W,F){var H=document.createElementNS("http://www.w3.org/2000/svg","text"),q=f.select(H);return q.text(U).attr("x",0).attr("y",0).attr("text-anchor",W).attr("data-unformatted",U).call(s.convertToTspans,F).call(o.font,V),o.bBox(q.node())}function B(U,V,W,F,H,q){var G="_cache"+V;U[G]&&U[G].key===H||(U[G]={key:H,value:W});var tt=P.aggNums(q,null,[U[G].value,F],2);return U[G].value=tt,tt}}),het=It((et,Y)=>{Y.exports={moduleType:"trace",name:"indicator",basePlotModule:oet(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:Bz(),supplyDefaults:set().supplyDefaults,calc:cet().calc,plot:uet(),meta:{}}}),det=It((et,Y)=>{Y.exports=het()}),Fz=It((et,Y)=>{var f=Mg(),y=Yn().extendFlat,z=sh().overrideAll,P=hi(),n=Jh().attributes,i=Sh().descriptionOnlyNumbers;Y.exports=z({domain:n({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:i("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:y({},f.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:i("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:y({},f.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))}},"calc","from-root")}),fet=It((et,Y)=>{var f=jn(),y=Fz(),z=Jh().defaults;function P(n,i){for(var a=n.columnorder||[],l=n.header.values.length,o=a.slice(0,l),c=o.slice().sort(function(m,b){return m-b}),s=o.map(function(m){return c.indexOf(m)}),h=s.length;h{var f=e1().wrap;Y.exports=function(){return f({})}}),Nz=It((et,Y)=>{Y.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"
",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}),met=It((et,Y)=>{var f=Nz(),y=Yn().extendFlat,z=Sr(),P=Xn().isTypedArray,n=Xn().isArrayOrTypedArray;Y.exports=function(b,x){var _=l(x.cells.values),A=function(tt){return tt.slice(x.header.values.length,tt.length)},d=l(x.header.values);d.length&&!d[0].length&&(d[0]=[""],d=l(d));var k=d.concat(A(_).map(function(){return o((d[0]||[""]).length)})),w=x.domain,D=Math.floor(b._fullLayout._size.w*(w.x[1]-w.x[0])),E=Math.floor(b._fullLayout._size.h*(w.y[1]-w.y[0])),I=x.header.values.length?k[0].map(function(){return x.header.height}):[f.emptyHeaderHeight],M=_.length?_[0].map(function(){return x.cells.height}):[],p=I.reduce(a,0),g=E-p,C=g+f.uplift,S=h(M,C),N=h(I,p),B=s(N,[]),U=s(S,B),V={},W=x._fullInput.columnorder;n(W)&&(W=Array.from(W)),W=W.concat(A(_.map(function(tt,ht){return ht})));var F=k.map(function(tt,ht){var bt=n(x.columnwidth)?x.columnwidth[Math.min(ht,x.columnwidth.length-1)]:x.columnwidth;return z(bt)?Number(bt):1}),H=F.reduce(a,0);F=F.map(function(tt){return tt/H*D});var q=Math.max(i(x.header.line.width),i(x.cells.line.width)),G={key:x.uid+b._context.staticPlot,translateX:w.x[0]*b._fullLayout._size.w,translateY:b._fullLayout._size.h*(1-w.y[1]),size:b._fullLayout._size,width:D,maxLineWidth:q,height:E,columnOrder:W,groupHeight:E,rowBlocks:U,headerRowBlocks:B,scrollY:0,cells:y({},x.cells,{values:_}),headerCells:y({},x.header,{values:k}),gdColumns:k.map(function(tt){return tt[0]}),gdColumnsOriginalOrder:k.map(function(tt){return tt[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:k.map(function(tt,ht){var bt=V[tt];V[tt]=(bt||0)+1;var vt=tt+"__"+V[tt];return{key:vt,label:tt,specIndex:ht,xIndex:W[ht],xScale:c,x:void 0,calcdata:void 0,columnWidth:F[ht]}})};return G.columns.forEach(function(tt){tt.calcdata=G,tt.x=c(tt)}),G};function i(b){if(n(b)){for(var x=0,_=0;_=x||I===b.length-1)&&(_[d]=w,w.key=E++,w.firstRowIndex=D,w.lastRowIndex=I,w=m(),d+=k,D=I+1,k=0);return _}function m(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),get=It(et=>{var Y=Yn().extendFlat;et.splitToPanels=function(y){var z=[0,0],P=Y({},y,{key:"header",type:"header",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!0,values:y.calcdata.headerCells.values[y.specIndex],rowBlocks:y.calcdata.headerRowBlocks,calcdata:Y({},y.calcdata,{cells:y.calcdata.headerCells})}),n=Y({},y,{key:"cells1",type:"cells",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks}),i=Y({},y,{key:"cells2",type:"cells",page:1,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks});return[n,i,P]},et.splitToCells=function(y){var z=f(y);return(y.values||[]).slice(z[0],z[1]).map(function(P,n){var i=typeof P=="string"&&P.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:n+i,key:z[0]+n,column:y,calcdata:y.calcdata,page:y.page,rowBlocks:y.rowBlocks,value:P}})};function f(y){var z=y.rowBlocks[y.page],P=z?z.rows[0].rowIndex:0,n=z?P+z.rows.length:0;return[P,n]}}),jz=It((et,Y)=>{var f=Nz(),y=Br(),z=jn(),P=z.numberFormat,n=e1(),i=Js(),a=uu(),l=jn().raiseToTop,o=jn().strTranslate,c=jn().cancelTransition,s=met(),h=get(),m=Hn();Y.exports=function(mt,dt){var Ct=!mt._context.staticPlot,Rt=mt._fullLayout._paper.selectAll("."+f.cn.table).data(dt.map(function(ce){var Le=n.unwrap(ce),Ze=Le.trace;return s(mt,Ze)}),n.keyFun);Rt.exit().remove(),Rt.enter().append("g").classed(f.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Rt.attr("width",function(ce){return ce.width+ce.size.l+ce.size.r}).attr("height",function(ce){return ce.height+ce.size.t+ce.size.b}).attr("transform",function(ce){return o(ce.translateX,ce.translateY)});var Bt=Rt.selectAll("."+f.cn.tableControlView).data(n.repeat,n.keyFun),Zt=Bt.enter().append("g").classed(f.cn.tableControlView,!0).style("box-sizing","content-box");if(Ct){var Gt="onwheel"in document?"wheel":"mousewheel";Zt.on("mousemove",function(ce){Bt.filter(function(Le){return ce===Le}).call(d,mt)}).on(Gt,function(ce){if(!ce.scrollbarState.wheeling){ce.scrollbarState.wheeling=!0;var Le=ce.scrollY+y.event.deltaY,Ze=ht(mt,Bt,null,Le)(ce);Ze||(y.event.stopPropagation(),y.event.preventDefault()),ce.scrollbarState.wheeling=!1}}).call(d,mt,!0)}Bt.attr("transform",function(ce){return o(ce.size.l,ce.size.t)});var ee=Bt.selectAll("."+f.cn.scrollBackground).data(n.repeat,n.keyFun);ee.enter().append("rect").classed(f.cn.scrollBackground,!0).attr("fill","none"),ee.attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}),Bt.each(function(ce){i.setClipUrl(y.select(this),x(mt,ce),mt)});var xe=Bt.selectAll("."+f.cn.yColumn).data(function(ce){return ce.columns},n.keyFun);xe.enter().append("g").classed(f.cn.yColumn,!0),xe.exit().remove(),xe.attr("transform",function(ce){return o(ce.x,0)}),Ct&&xe.call(y.behavior.drag().origin(function(ce){var Le=y.select(this);return W(Le,ce,-f.uplift),l(this),ce.calcdata.columnDragInProgress=!0,d(Bt.filter(function(Ze){return ce.calcdata.key===Ze.key}),mt),ce}).on("drag",function(ce){var Le=y.select(this),Ze=function(fr){return(ce===fr?y.event.x:fr.x)+fr.columnWidth/2};ce.x=Math.max(-f.overdrag,Math.min(ce.calcdata.width+f.overdrag-ce.columnWidth,y.event.x));var Qe=A(xe).filter(function(fr){return fr.calcdata.key===ce.calcdata.key}),mr=Qe.sort(function(fr,Jr){return Ze(fr)-Ze(Jr)});mr.forEach(function(fr,Jr){fr.xIndex=Jr,fr.x=ce===fr?fr.x:fr.xScale(fr)}),xe.filter(function(fr){return ce!==fr}).transition().ease(f.transitionEase).duration(f.transitionDuration).attr("transform",function(fr){return o(fr.x,0)}),Le.call(c).attr("transform",o(ce.x,-f.uplift))}).on("dragend",function(ce){var Le=y.select(this),Ze=ce.calcdata;ce.x=ce.xScale(ce),ce.calcdata.columnDragInProgress=!1,W(Le,ce,0),U(mt,Ze,Ze.columns.map(function(Qe){return Qe.xIndex}))})),xe.each(function(ce){i.setClipUrl(y.select(this),_(mt,ce),mt)});var ge=xe.selectAll("."+f.cn.columnBlock).data(h.splitToPanels,n.keyFun);ge.enter().append("g").classed(f.cn.columnBlock,!0).attr("id",function(ce){return ce.key}),ge.style("cursor",function(ce){return ce.dragHandle?"ew-resize":ce.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ye=ge.filter(H),ue=ge.filter(F);Ct&&ue.call(y.behavior.drag().origin(function(ce){return y.event.stopPropagation(),ce}).on("drag",ht(mt,Bt,-1)).on("dragend",function(){})),k(mt,Bt,ye,ge),k(mt,Bt,ue,ge);var Mt=Bt.selectAll("."+f.cn.scrollAreaClip).data(n.repeat,n.keyFun);Mt.enter().append("clipPath").classed(f.cn.scrollAreaClip,!0).attr("id",function(ce){return x(mt,ce)});var Ot=Mt.selectAll("."+f.cn.scrollAreaClipRect).data(n.repeat,n.keyFun);Ot.enter().append("rect").classed(f.cn.scrollAreaClipRect,!0).attr("x",-f.overdrag).attr("y",-f.uplift).attr("fill","none"),Ot.attr("width",function(ce){return ce.width+2*f.overdrag}).attr("height",function(ce){return ce.height+f.uplift});var Lt=xe.selectAll("."+f.cn.columnBoundary).data(n.repeat,n.keyFun);Lt.enter().append("g").classed(f.cn.columnBoundary,!0);var ie=xe.selectAll("."+f.cn.columnBoundaryClippath).data(n.repeat,n.keyFun);ie.enter().append("clipPath").classed(f.cn.columnBoundaryClippath,!0),ie.attr("id",function(ce){return _(mt,ce)});var be=ie.selectAll("."+f.cn.columnBoundaryRect).data(n.repeat,n.keyFun);be.enter().append("rect").classed(f.cn.columnBoundaryRect,!0).attr("fill","none"),be.attr("width",function(ce){return ce.columnWidth+2*b(ce)}).attr("height",function(ce){return ce.calcdata.height+2*b(ce)+f.uplift}).attr("x",function(ce){return-b(ce)}).attr("y",function(ce){return-b(ce)}),tt(null,ue,Bt)};function b(mt){return Math.ceil(mt.calcdata.maxLineWidth/2)}function x(mt,dt){return"clip"+mt._fullLayout._uid+"_scrollAreaBottomClip_"+dt.key}function _(mt,dt){return"clip"+mt._fullLayout._uid+"_columnBoundaryClippath_"+dt.calcdata.key+"_"+dt.specIndex}function A(mt){return[].concat.apply([],mt.map(function(dt){return dt})).map(function(dt){return dt.__data__})}function d(mt,dt,Ct){function Rt(ge){var ye=ge.rowBlocks;return it(ye,ye.length-1)+(ye.length?st(ye[ye.length-1],1/0):1)}var Bt=mt.selectAll("."+f.cn.scrollbarKit).data(n.repeat,n.keyFun);Bt.enter().append("g").classed(f.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Bt.each(function(ge){var ye=ge.scrollbarState;ye.totalHeight=Rt(ge),ye.scrollableAreaHeight=ge.groupHeight-q(ge),ye.currentlyVisibleHeight=Math.min(ye.totalHeight,ye.scrollableAreaHeight),ye.ratio=ye.currentlyVisibleHeight/ye.totalHeight,ye.barLength=Math.max(ye.ratio*ye.currentlyVisibleHeight,f.goldenRatio*f.scrollbarWidth),ye.barWiggleRoom=ye.currentlyVisibleHeight-ye.barLength,ye.wiggleRoom=Math.max(0,ye.totalHeight-ye.scrollableAreaHeight),ye.topY=ye.barWiggleRoom===0?0:ge.scrollY/ye.wiggleRoom*ye.barWiggleRoom,ye.bottomY=ye.topY+ye.barLength,ye.dragMultiplier=ye.wiggleRoom/ye.barWiggleRoom}).attr("transform",function(ge){var ye=ge.width+f.scrollbarWidth/2+f.scrollbarOffset;return o(ye,q(ge))});var Zt=Bt.selectAll("."+f.cn.scrollbar).data(n.repeat,n.keyFun);Zt.enter().append("g").classed(f.cn.scrollbar,!0);var Gt=Zt.selectAll("."+f.cn.scrollbarSlider).data(n.repeat,n.keyFun);Gt.enter().append("g").classed(f.cn.scrollbarSlider,!0),Gt.attr("transform",function(ge){return o(0,ge.scrollbarState.topY||0)});var ee=Gt.selectAll("."+f.cn.scrollbarGlyph).data(n.repeat,n.keyFun);ee.enter().append("line").classed(f.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",f.scrollbarWidth).attr("stroke-linecap","round").attr("y1",f.scrollbarWidth/2),ee.attr("y2",function(ge){return ge.scrollbarState.barLength-f.scrollbarWidth/2}).attr("stroke-opacity",function(ge){return ge.columnDragInProgress||!ge.scrollbarState.barWiggleRoom||Ct?0:.4}),ee.transition().delay(0).duration(0),ee.transition().delay(f.scrollbarHideDelay).duration(f.scrollbarHideDuration).attr("stroke-opacity",0);var xe=Zt.selectAll("."+f.cn.scrollbarCaptureZone).data(n.repeat,n.keyFun);xe.enter().append("line").classed(f.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",f.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(ge){var ye=y.event.y,ue=this.getBoundingClientRect(),Mt=ge.scrollbarState,Ot=ye-ue.top,Lt=y.scale.linear().domain([0,Mt.scrollableAreaHeight]).range([0,Mt.totalHeight]).clamp(!0);Mt.topY<=Ot&&Ot<=Mt.bottomY||ht(dt,mt,null,Lt(Ot-Mt.barLength/2))(ge)}).call(y.behavior.drag().origin(function(ge){return y.event.stopPropagation(),ge.scrollbarState.scrollbarScrollInProgress=!0,ge}).on("drag",ht(dt,mt)).on("dragend",function(){})),xe.attr("y2",function(ge){return ge.scrollbarState.scrollableAreaHeight}),dt._context.staticPlot&&(ee.remove(),xe.remove())}function k(mt,dt,Ct,Rt){var Bt=w(Ct),Zt=D(Bt);p(Zt);var Gt=E(Zt);C(Gt);var ee=M(Zt),xe=I(ee);g(xe),S(xe,dt,Rt,mt),gt(Zt)}function w(mt){var dt=mt.selectAll("."+f.cn.columnCells).data(n.repeat,n.keyFun);return dt.enter().append("g").classed(f.cn.columnCells,!0),dt.exit().remove(),dt}function D(mt){var dt=mt.selectAll("."+f.cn.columnCell).data(h.splitToCells,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("g").classed(f.cn.columnCell,!0),dt.exit().remove(),dt}function E(mt){var dt=mt.selectAll("."+f.cn.cellRect).data(n.repeat,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("rect").classed(f.cn.cellRect,!0),dt}function I(mt){var dt=mt.selectAll("."+f.cn.cellText).data(n.repeat,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("text").classed(f.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){y.event.stopPropagation()}),dt}function M(mt){var dt=mt.selectAll("."+f.cn.cellTextHolder).data(n.repeat,function(Ct){return Ct.keyWithinBlock});return dt.enter().append("g").classed(f.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),dt}function p(mt){mt.each(function(dt,Ct){var Rt=dt.calcdata.cells.font,Bt=dt.column.specIndex,Zt={size:V(Rt.size,Bt,Ct),color:V(Rt.color,Bt,Ct),family:V(Rt.family,Bt,Ct),weight:V(Rt.weight,Bt,Ct),style:V(Rt.style,Bt,Ct),variant:V(Rt.variant,Bt,Ct),textcase:V(Rt.textcase,Bt,Ct),lineposition:V(Rt.lineposition,Bt,Ct),shadow:V(Rt.shadow,Bt,Ct)};dt.rowNumber=dt.key,dt.align=V(dt.calcdata.cells.align,Bt,Ct),dt.cellBorderWidth=V(dt.calcdata.cells.line.width,Bt,Ct),dt.font=Zt})}function g(mt){mt.each(function(dt){i.font(y.select(this),dt.font)})}function C(mt){mt.attr("width",function(dt){return dt.column.columnWidth}).attr("stroke-width",function(dt){return dt.cellBorderWidth}).each(function(dt){var Ct=y.select(this);m.stroke(Ct,V(dt.calcdata.cells.line.color,dt.column.specIndex,dt.rowNumber)),m.fill(Ct,V(dt.calcdata.cells.fill.color,dt.column.specIndex,dt.rowNumber))})}function S(mt,dt,Ct,Rt){mt.text(function(Bt){var Zt=Bt.column.specIndex,Gt=Bt.rowNumber,ee=Bt.value,xe=typeof ee=="string",ge=xe&&ee.match(/
/i),ye=!xe||ge;Bt.mayHaveMarkup=xe&&ee.match(/[<&>]/);var ue=N(ee);Bt.latex=ue;var Mt=ue?"":V(Bt.calcdata.cells.prefix,Zt,Gt)||"",Ot=ue?"":V(Bt.calcdata.cells.suffix,Zt,Gt)||"",Lt=ue?null:V(Bt.calcdata.cells.format,Zt,Gt)||null,ie=Mt+(Lt?P(Lt)(Bt.value):Bt.value)+Ot,be;Bt.wrappingNeeded=!Bt.wrapped&&!ye&&!ue&&(be=B(ie)),Bt.cellHeightMayIncrease=ge||ue||Bt.mayHaveMarkup||(be===void 0?B(ie):be),Bt.needsConvertToTspans=Bt.mayHaveMarkup||Bt.wrappingNeeded||Bt.latex;var ce;if(Bt.wrappingNeeded){var Le=f.wrapSplitCharacter===" "?ie.replace(/Bt&&Rt.push(Zt),Bt+=xe}return Rt}function tt(mt,dt,Ct){var Rt=A(dt)[0];if(Rt!==void 0){var Bt=Rt.rowBlocks,Zt=Rt.calcdata,Gt=it(Bt,Bt.length),ee=Rt.calcdata.groupHeight-q(Rt),xe=Zt.scrollY=Math.max(0,Math.min(Gt-ee,Zt.scrollY)),ge=G(Bt,xe,ee);ge.length===1&&(ge[0]===Bt.length-1?ge.unshift(ge[0]-1):ge.push(ge[0]+1)),ge[0]%2&&ge.reverse(),dt.each(function(ye,ue){ye.page=ge[ue],ye.scrollY=xe}),dt.attr("transform",function(ye){var ue=it(ye.rowBlocks,ye.page)-ye.scrollY;return o(0,ue)}),mt&&(bt(mt,Ct,dt,ge,Rt.prevPages,Rt,0),bt(mt,Ct,dt,ge,Rt.prevPages,Rt,1),d(Ct,mt))}}function ht(mt,dt,Ct,Rt){return function(Bt){var Zt=Bt.calcdata?Bt.calcdata:Bt,Gt=dt.filter(function(ye){return Zt.key===ye.key}),ee=Ct||Zt.scrollbarState.dragMultiplier,xe=Zt.scrollY;Zt.scrollY=Rt===void 0?Zt.scrollY+ee*y.event.dy:Rt;var ge=Gt.selectAll("."+f.cn.yColumn).selectAll("."+f.cn.columnBlock).filter(F);return tt(mt,ge,Gt),Zt.scrollY===xe}}function bt(mt,dt,Ct,Rt,Bt,Zt,Gt){var ee=Rt[Gt]!==Bt[Gt];ee&&(clearTimeout(Zt.currentRepaint[Gt]),Zt.currentRepaint[Gt]=setTimeout(function(){var xe=Ct.filter(function(ge,ye){return ye===Gt&&Rt[ye]!==Bt[ye]});k(mt,dt,xe,Ct),Bt[Gt]=Rt[Gt]}))}function vt(mt,dt,Ct,Rt){return function(){var Bt=y.select(dt.parentNode);Bt.each(function(Zt){var Gt=Zt.fragments;Bt.selectAll("tspan.line").each(function(Lt,ie){Gt[ie].width=this.getComputedTextLength()});var ee=Gt[Gt.length-1].width,xe=Gt.slice(0,-1),ge=[],ye,ue,Mt=0,Ot=Zt.column.columnWidth-2*f.cellPad;for(Zt.value="";xe.length;)ye=xe.shift(),ue=ye.width+ee,Mt+ue>Ot&&(Zt.value+=ge.join(f.wrapSpacer)+f.lineBreaker,ge=[],Mt=0),ge.push(ye.text),Mt+=ue;Mt&&(Zt.value+=ge.join(f.wrapSpacer)),Zt.wrapped=!0}),Bt.selectAll("tspan.line").remove(),S(Bt.select("."+f.cn.cellText),Ct,mt,Rt),y.select(dt.parentNode.parentNode).call(gt)}}function ut(mt,dt,Ct,Rt,Bt){return function(){if(!Bt.settledY){var Zt=y.select(dt.parentNode),Gt=ot(Bt),ee=Bt.key-Gt.firstRowIndex,xe=Gt.rows[ee].rowHeight,ge=Bt.cellHeightMayIncrease?dt.parentNode.getBoundingClientRect().height+2*f.cellPad:xe,ye=Math.max(ge,xe),ue=ye-Gt.rows[ee].rowHeight;ue&&(Gt.rows[ee].rowHeight=ye,mt.selectAll("."+f.cn.columnCell).call(gt),tt(null,mt.filter(F),0),d(Ct,Rt,!0)),Zt.attr("transform",function(){var Mt=this,Ot=Mt.parentNode,Lt=Ot.getBoundingClientRect(),ie=y.select(Mt.parentNode).select("."+f.cn.cellRect).node().getBoundingClientRect(),be=Mt.transform.baseVal.consolidate(),ce=ie.top-Lt.top+(be?be.matrix.f:f.cellPad);return o(rt(Bt,y.select(Mt.parentNode).select("."+f.cn.cellTextHolder).node().getBoundingClientRect().width),ce)}),Bt.settledY=!0}}}function rt(mt,dt){switch(mt.align){case"left":return f.cellPad;case"right":return mt.column.columnWidth-(dt||0)-f.cellPad;case"center":return(mt.column.columnWidth-(dt||0))/2;default:return f.cellPad}}function gt(mt){mt.attr("transform",function(dt){var Ct=dt.rowBlocks[0].auxiliaryBlocks.reduce(function(Gt,ee){return Gt+st(ee,1/0)},0),Rt=ot(dt),Bt=st(Rt,dt.key),Zt=Bt+Ct;return o(0,Zt)}).selectAll("."+f.cn.cellRect).attr("height",function(dt){return J(ot(dt),dt.key).rowHeight})}function it(mt,dt){for(var Ct=0,Rt=dt-1;Rt>=0;Rt--)Ct+=xt(mt[Rt]);return Ct}function st(mt,dt){for(var Ct=0,Rt=0;Rt{var Y=Mf().getModuleCalcData,f=jz(),y="table";et.name=y,et.plot=function(z){var P=Y(z.calcdata,y)[0];P.length&&f(z,P)},et.clean=function(z,P,n,i){var a=i._has&&i._has(y),l=P._has&&P._has(y);a&&!l&&i._paperdiv.selectAll(".table").remove()}}),yet=It((et,Y)=>{Y.exports={attributes:Fz(),supplyDefaults:fet(),calc:pet(),plot:jz(),moduleType:"trace",name:"table",basePlotModule:vet(),categories:["noOpacity"],meta:{}}}),_et=It((et,Y)=>{Y.exports=yet()}),xet=It((et,Y)=>{var f=hi(),y=Sn(),z=Gf(),P=Sh().descriptionWithDates,n=sh().overrideAll,i=qf().dash,a=Yn().extendFlat;Y.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:f({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:z.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:a({},z.labelalias,{editType:"calc"}),tickfont:f({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:P("tick label")},tickformatstops:n(z.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:a({},i,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:a({},i,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:y.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),SA=It((et,Y)=>{var f=hi(),y=xet(),z=Sn(),P=f({editType:"calc"}),n=dd().zorder;P.family.dflt='"Open Sans", verdana, arial, sans-serif',P.size.dflt=12,P.color.dflt=z.defaultLine,Y.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:y,baxis:y,font:P,color:{valType:"color",dflt:z.defaultLine,editType:"plot"},zorder:n}}),bet=It((et,Y)=>{var f=jn().isArray1D;Y.exports=function(y,z,P){var n=P("x"),i=n&&n.length,a=P("y"),l=a&&a.length;if(!i&&!l)return!1;if(z._cheater=!n,(!i||f(n))&&(!l||f(a))){var o=i?n.length:1/0;l&&(o=Math.min(o,a.length)),z.a&&z.a.length&&(o=Math.min(o,z.a.length)),z.b&&z.b.length&&(o=Math.min(o,z.b.length)),z._length=o}else z._length=null;return!0}}),wet=It((et,Y)=>{var f=SA(),y=Hn().addOpacity,z=ls(),P=jn(),n=jv(),i=q0(),a=Sg(),l=Jg(),o=G0(),c=ty();Y.exports=function(h,m,b){var x=b.letter,_=b.font||{},A=f[x+"axis"];function d(q,G){return P.coerce(h,m,A,q,G)}function k(q,G){return P.coerce2(h,m,A,q,G)}b.name&&(m._name=b.name,m._id=b.name),d("autotypenumbers",b.autotypenumbersDflt);var w=d("type");if(w==="-"&&(b.data&&s(m,b.data),m.type==="-"?m.type="linear":w=h.type=m.type),d("smoothing"),d("cheatertype"),d("showticklabels"),d("labelprefix",x+" = "),d("labelsuffix"),d("showtickprefix"),d("showticksuffix"),d("separatethousands"),d("tickformat"),d("exponentformat"),d("minexponent"),d("showexponent"),d("categoryorder"),d("tickmode"),d("tickvals"),d("ticktext"),d("tick0"),d("dtick"),m.tickmode==="array"&&(d("arraytick0"),d("arraydtick")),d("labelpadding"),m._hovertitle=x,w==="date"){var D=z.getComponentMethod("calendars","handleDefaults");D(h,m,"calendar",b.calendar)}o(m,b.fullLayout),m.c2p=P.identity;var E=d("color",b.dfltColor),I=E===h.color?E:_.color,M=d("title.text");M&&(P.coerceFont(d,"title.font",_,{overrideDflt:{size:P.bigFont(_.size),color:I}}),d("title.offset")),d("tickangle");var p=d("autorange",!m.isValidRange(h.range));p&&d("rangemode"),d("range"),m.cleanRange(),d("fixedrange"),n(h,m,d,w),a(h,m,d,w,b),i(h,m,d,w,b),l(h,m,d,{data:b.data,dataAttr:x});var g=k("gridcolor",y(E,.3)),C=k("gridwidth"),S=k("griddash"),N=d("showgrid");N||(delete m.gridcolor,delete m.gridwidth,delete m.griddash);var B=k("startlinecolor",E),U=k("startlinewidth",C),V=d("startline",m.showgrid||!!B||!!U);V||(delete m.startlinecolor,delete m.startlinewidth);var W=k("endlinecolor",E),F=k("endlinewidth",C),H=d("endline",m.showgrid||!!W||!!F);return H||(delete m.endlinecolor,delete m.endlinewidth),N?(d("minorgridcount"),d("minorgridwidth",C),d("minorgriddash",S),d("minorgridcolor",y(g,.06)),m.minorgridcount||(delete m.minorgridwidth,delete m.minorgriddash,delete m.minorgridcolor)):(delete m.gridcolor,delete m.gridwidth,delete m.griddash),m.showticklabels==="none"&&(delete m.tickfont,delete m.tickangle,delete m.showexponent,delete m.exponentformat,delete m.minexponent,delete m.tickformat,delete m.showticksuffix,delete m.showtickprefix),m.showticksuffix||delete m.ticksuffix,m.showtickprefix||delete m.tickprefix,d("tickmode"),m};function s(h,m){if(h.type==="-"){var b=h._id,x=b.charAt(0),_=x+"calendar",A=h[_];h.type=c(m,A,{autotypenumbers:h.autotypenumbers})}}}),ket=It((et,Y)=>{var f=wet(),y=Tc();Y.exports=function(P,n,i,a,l){var o=a("a");o||(a("da"),a("a0"));var c=a("b");c||(a("db"),a("b0")),z(P,n,i,l)};function z(P,n,i,a){var l=["aaxis","baxis"];l.forEach(function(o){var c=o.charAt(0),s=P[o]||{},h=y.newContainer(n,o),m={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:c+"axis",letter:c,font:n.font,name:o,data:P[c],calendar:n.calendar,dfltColor:a,bgColor:i.paper_bgcolor,autotypenumbersDflt:i.autotypenumbers,fullLayout:i};f(s,h,m),h._categories=h._categories||[],!P[o]&&s.type!=="-"&&(P[o]={type:s.type})})}}),Tet=It((et,Y)=>{var f=jn(),y=bet(),z=ket(),P=SA(),n=Sn();Y.exports=function(i,a,l,o){function c(m,b){return f.coerce(i,a,P,m,b)}a._clipPathId="clip"+a.uid+"carpet";var s=c("color",n.defaultLine);if(f.coerceFont(c,"font",o.font),c("carpet"),z(i,a,o,c,s),!a.a||!a.b){a.visible=!1;return}a.a.length<3&&(a.aaxis.smoothing=0),a.b.length<3&&(a.baxis.smoothing=0);var h=y(i,a,c);h||(a.visible=!1),a._cheater&&c("cheaterslope"),c("zorder")}}),Uz=It((et,Y)=>{var f=jn().isArrayOrTypedArray;Y.exports=function(y,z,P){var n;for(f(y)?y.length>z.length&&(y=y.slice(0,z.length)):y=[],n=0;n{Y.exports=function(f,y,z){if(f.length===0)return"";var P,n=[],i=z?3:1;for(P=0;P{Y.exports=function(f,y,z,P,n,i){var a=n[0]*f.dpdx(y),l=n[1]*f.dpdy(z),o=1,c=1;if(i){var s=Math.sqrt(n[0]*n[0]+n[1]*n[1]),h=Math.sqrt(i[0]*i[0]+i[1]*i[1]),m=(n[0]*i[0]+n[1]*i[1])/s/h;c=Math.max(0,m)}var b=Math.atan2(l,a)*180/Math.PI;return b<-90?(b+=180,o=-o):b>90&&(b-=180,o=-o),{angle:b,flip:o,p:f.c2p(P,y,z),offsetMultplier:c}}}),Aet=It((et,Y)=>{var f=Br(),y=Js(),z=Uz(),P=$z(),n=Cet(),i=uu(),a=jn(),l=a.strRotate,o=a.strTranslate,c=Rd();Y.exports=function(d,k,w,D){var E=d._context.staticPlot,I=k.xaxis,M=k.yaxis,p=d._fullLayout,g=p._clips;a.makeTraceGroups(D,w,"trace").each(function(C){var S=f.select(this),N=C[0],B=N.trace,U=B.aaxis,V=B.baxis,W=a.ensureSingle(S,"g","minorlayer"),F=a.ensureSingle(S,"g","majorlayer"),H=a.ensureSingle(S,"g","boundarylayer"),q=a.ensureSingle(S,"g","labellayer");S.style("opacity",B.opacity),h(I,M,F,U,"a",U._gridlines,!0),h(I,M,F,V,"b",V._gridlines,!0),h(I,M,W,U,"a",U._minorgridlines,!0),h(I,M,W,V,"b",V._minorgridlines,!0),h(I,M,H,U,"a-boundary",U._boundarylines,E),h(I,M,H,V,"b-boundary",V._boundarylines,E);var G=m(d,I,M,B,N,q,U._labels,"a-label"),tt=m(d,I,M,B,N,q,V._labels,"b-label");b(d,q,B,N,I,M,G,tt),s(B,N,g,I,M)})};function s(d,k,w,D,E){var I,M,p,g,C=w.select("#"+d._clipPathId);C.size()||(C=w.append("clipPath").classed("carpetclip",!0));var S=a.ensureSingle(C,"path","carpetboundary"),N=k.clipsegments,B=[];for(g=0;g0?"start":"end","data-notex":1}).call(y.font,N.font).text(N.text).call(i.convertToTspans,d),H=y.bBox(this);F.attr("transform",o(U.p[0],U.p[1])+l(U.angle)+o(N.axis.labelpadding*W,H.height*.3)),C=Math.max(C,H.width+N.axis.labelpadding)}),g.exit().remove(),S.maxExtent=C,S}function b(d,k,w,D,E,I,M,p){var g,C,S,N,B=a.aggNums(Math.min,null,w.a),U=a.aggNums(Math.max,null,w.a),V=a.aggNums(Math.min,null,w.b),W=a.aggNums(Math.max,null,w.b);g=.5*(B+U),C=V,S=w.ab2xy(g,C,!0),N=w.dxyda_rough(g,C),M.angle===void 0&&a.extendFlat(M,n(w,E,I,S,w.dxydb_rough(g,C))),A(d,k,w,D,S,N,w.aaxis,E,I,M,"a-title"),g=B,C=.5*(V+W),S=w.ab2xy(g,C,!0),N=w.dxydb_rough(g,C),p.angle===void 0&&a.extendFlat(p,n(w,E,I,S,w.dxyda_rough(g,C))),A(d,k,w,D,S,N,w.baxis,E,I,p,"b-title")}var x=c.LINE_SPACING,_=(1-c.MID_SHIFT)/x+1;function A(d,k,w,D,E,I,M,p,g,C,S){var N=[];M.title.text&&N.push(M.title.text);var B=k.selectAll("text."+S).data(N),U=C.maxExtent;B.enter().append("text").classed(S,!0),B.each(function(){var V=n(w,p,g,E,I);["start","both"].indexOf(M.showticklabels)===-1&&(U=0);var W=M.title.font.size;U+=W+M.title.offset;var F=C.angle+(C.flip<0?180:0),H=(F-V.angle+450)%360,q=H>90&&H<270,G=f.select(this);G.text(M.title.text).call(i.convertToTspans,d),q&&(U=(-i.lineCount(G)+_)*x*W-U),G.attr("transform",o(V.p[0],V.p[1])+l(V.angle)+o(0,U)).attr("text-anchor","middle").call(y.font,M.title.font)}),B.exit().remove()}}),Met=It((et,Y)=>{var f=jn().isArrayOrTypedArray;Y.exports=function(y,z,P){var n,i,a,l,o,c,s=[],h=f(y)?y.length:y,m=f(z)?z.length:z,b=f(y)?y:null,x=f(z)?z:null;b&&(a=(b.length-1)/(b[b.length-1]-b[0])/(h-1)),x&&(l=(x.length-1)/(x[x.length-1]-x[0])/(m-1));var _,A=1/0,d=-1/0;for(i=0;i{var f=jn().isArrayOrTypedArray;Y.exports=function(z){return y(z,0)};function y(z,P){if(!f(z)||P>=10)return null;for(var n=1/0,i=-1/0,a=z.length,l=0;l{var f=Fs(),y=Yn().extendFlat;Y.exports=function(z,P,n){var i,a,l,o,c,s,h,m,b,x,_,A,d,k,w=z["_"+P],D=z[P+"axis"],E=D._gridlines=[],I=D._minorgridlines=[],M=D._boundarylines=[],p=z["_"+n],g=z[n+"axis"];D.tickmode==="array"&&(D.tickvals=w.slice());var C=z._xctrl,S=z._yctrl,N=C[0].length,B=C.length,U=z._a.length,V=z._b.length;f.prepTicks(D),D.tickmode==="array"&&delete D.tickvals;var W=D.smoothing?3:1;function F(q){var G,tt,ht,bt,vt,ut,rt,gt,it,st,xt,ot,J=[],mt=[],dt={};if(P==="b")for(tt=z.b2j(q),ht=Math.floor(Math.max(0,Math.min(V-2,tt))),bt=tt-ht,dt.length=V,dt.crossLength=U,dt.xy=function(Ct){return z.evalxy([],Ct,tt)},dt.dxy=function(Ct,Rt){return z.dxydi([],Ct,ht,Rt,bt)},G=0;G0&&(it=z.dxydi([],G-1,ht,0,bt),J.push(vt[0]+it[0]/3),mt.push(vt[1]+it[1]/3),st=z.dxydi([],G-1,ht,1,bt),J.push(gt[0]-st[0]/3),mt.push(gt[1]-st[1]/3)),J.push(gt[0]),mt.push(gt[1]),vt=gt;else for(G=z.a2i(q),ut=Math.floor(Math.max(0,Math.min(U-2,G))),rt=G-ut,dt.length=U,dt.crossLength=V,dt.xy=function(Ct){return z.evalxy([],G,Ct)},dt.dxy=function(Ct,Rt){return z.dxydj([],ut,Ct,rt,Rt)},tt=0;tt0&&(xt=z.dxydj([],ut,tt-1,rt,0),J.push(vt[0]+xt[0]/3),mt.push(vt[1]+xt[1]/3),ot=z.dxydj([],ut,tt-1,rt,1),J.push(gt[0]-ot[0]/3),mt.push(gt[1]-ot[1]/3)),J.push(gt[0]),mt.push(gt[1]),vt=gt;return dt.axisLetter=P,dt.axis=D,dt.crossAxis=g,dt.value=q,dt.constvar=n,dt.index=m,dt.x=J,dt.y=mt,dt.smoothing=g.smoothing,dt}function H(q){var G,tt,ht,bt,vt,ut=[],rt=[],gt={};if(gt.length=w.length,gt.crossLength=p.length,P==="b")for(ht=Math.max(0,Math.min(V-2,q)),vt=Math.min(1,Math.max(0,q-ht)),gt.xy=function(it){return z.evalxy([],it,q)},gt.dxy=function(it,st){return z.dxydi([],it,ht,st,vt)},G=0;Gw.length-1)&&E.push(y(H(a),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s;mw.length-1)&&!(_<0||_>w.length-1))for(A=w[l],d=w[_],i=0;iw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash})));D.startline&&M.push(y(H(0),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y(H(w.length-1),{color:D.endlinecolor,width:D.endlinewidth}))}else{for(o=5e-15,c=[Math.floor((w[w.length-1]-D.tick0)/D.dtick*(1+o)),Math.ceil((w[0]-D.tick0)/D.dtick/(1+o))].sort(function(q,G){return q-G}),s=c[0],h=c[1],m=s;m<=h;m++)b=D.tick0+D.dtick*m,E.push(y(F(b),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s-1;mw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash}));D.startline&&M.push(y(F(w[0]),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y(F(w[w.length-1]),{color:D.endlinecolor,width:D.endlinewidth}))}}}),Pet=It((et,Y)=>{var f=Fs(),y=Yn().extendFlat;Y.exports=function(z,P){var n,i,a,l,o,c=P._labels=[],s=P._gridlines;for(n=0;n{Y.exports=function(f,y,z,P){var n,i,a,l=[],o=!!z.smoothing,c=!!P.smoothing,s=f[0].length-1,h=f.length-1;for(n=0,i=[],a=[];n<=s;n++)i[n]=f[0][n],a[n]=y[0][n];for(l.push({x:i,y:a,bicubic:o}),n=0,i=[],a=[];n<=h;n++)i[n]=f[n][s],a[n]=y[n][s];for(l.push({x:i,y:a,bicubic:c}),n=s,i=[],a=[];n>=0;n--)i[s-n]=f[h][n],a[s-n]=y[h][n];for(l.push({x:i,y:a,bicubic:o}),n=h,i=[],a=[];n>=0;n--)i[h-n]=f[n][0],a[h-n]=y[n][0];return l.push({x:i,y:a,bicubic:c}),l}}),Det=It((et,Y)=>{var f=jn();Y.exports=function(y,z,P){var n,i,a,l=[],o=[],c=y[0].length,s=y.length;function h(tt,ht){var bt=0,vt,ut=0;return tt>0&&(vt=y[ht][tt-1])!==void 0&&(ut++,bt+=vt),tt0&&(vt=y[ht-1][tt])!==void 0&&(ut++,bt+=vt),ht0&&i0&&np);return f.log("Smoother converged to",g,"after",S,"iterations"),y}}),zet=It((et,Y)=>{Y.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),Oet=It((et,Y)=>{var f=.5;Y.exports=function(y,z,P,n){var i=y[0]-z[0],a=y[1]-z[1],l=P[0]-z[0],o=P[1]-z[1],c=Math.pow(i*i+a*a,f/2),s=Math.pow(l*l+o*o,f/2),h=(s*s*i-c*c*l)*n,m=(s*s*a-c*c*o)*n,b=s*(c+s)*3,x=c*(c+s)*3;return[[z[0]+(b&&h/b),z[1]+(b&&m/b)],[z[0]-(x&&h/x),z[1]-(x&&m/x)]]}}),Bet=It((et,Y)=>{var f=Oet(),y=jn().ensureArray;function z(P,n,i){var a=-.5*i[0]+1.5*n[0],l=-.5*i[1]+1.5*n[1];return[(2*a+P[0])/3,(2*l+P[1])/3]}Y.exports=function(P,n,i,a,l,o){var c,s,h,m,b,x,_,A,d,k,w=i[0].length,D=i.length,E=l?3*w-2:w,I=o?3*D-2:D;for(P=y(P,I),n=y(n,I),h=0;h{Y.exports=function(f,y,z,P,n){var i=y-2,a=z-2;return P&&n?function(l,o,c){l||(l=[]);var s,h,m,b,x,_,A=Math.max(0,Math.min(Math.floor(o),i)),d=Math.max(0,Math.min(Math.floor(c),a)),k=Math.max(0,Math.min(1,o-A)),w=Math.max(0,Math.min(1,c-d));A*=3,d*=3;var D=k*k,E=D*k,I=1-k,M=I*I,p=M*I,g=w*w,C=g*w,S=1-w,N=S*S,B=N*S;for(_=0;_{Y.exports=function(f,y,z){return y&&z?function(P,n,i,a,l){P||(P=[]);var o,c,s,h,m,b;n*=3,i*=3;var x=a*a,_=1-a,A=_*_,d=_*a*2,k=-3*A,w=3*(A-d),D=3*(d-x),E=3*x,I=l*l,M=I*l,p=1-l,g=p*p,C=g*p;for(b=0;b{Y.exports=function(f,y,z){return y&&z?function(P,n,i,a,l){P||(P=[]);var o,c,s,h,m,b;n*=3,i*=3;var x=a*a,_=x*a,A=1-a,d=A*A,k=d*A,w=l*l,D=1-l,E=D*D,I=D*l*2,M=-3*E,p=3*(E-I),g=3*(I-w),C=3*w;for(b=0;b{var f=zet(),y=sw().findBin,z=Bet(),P=Ret(),n=Fet(),i=Net();Y.exports=function(a){var l=a._a,o=a._b,c=l.length,s=o.length,h=a.aaxis,m=a.baxis,b=l[0],x=l[c-1],_=o[0],A=o[s-1],d=l[l.length-1]-l[0],k=o[o.length-1]-o[0],w=d*f.RELATIVE_CULL_TOLERANCE,D=k*f.RELATIVE_CULL_TOLERANCE;b-=w,x+=w,_-=D,A+=D,a.isVisible=function(E,I){return E>b&&E_&&Ix||I<_||I>A},a.setScale=function(){var E=a._x,I=a._y,M=z(a._xctrl,a._yctrl,E,I,h.smoothing,m.smoothing);a._xctrl=M[0],a._yctrl=M[1],a.evalxy=P([a._xctrl,a._yctrl],c,s,h.smoothing,m.smoothing),a.dxydi=n([a._xctrl,a._yctrl],h.smoothing,m.smoothing),a.dxydj=i([a._xctrl,a._yctrl],h.smoothing,m.smoothing)},a.i2a=function(E){var I=Math.max(0,Math.floor(E[0]),c-2),M=E[0]-I;return(1-M)*l[I]+M*l[I+1]},a.j2b=function(E){var I=Math.max(0,Math.floor(E[1]),c-2),M=E[1]-I;return(1-M)*o[I]+M*o[I+1]},a.ij2ab=function(E){return[a.i2a(E[0]),a.j2b(E[1])]},a.a2i=function(E){var I=Math.max(0,Math.min(y(E,l),c-2)),M=l[I],p=l[I+1];return Math.max(0,Math.min(c-1,I+(E-M)/(p-M)))},a.b2j=function(E){var I=Math.max(0,Math.min(y(E,o),s-2)),M=o[I],p=o[I+1];return Math.max(0,Math.min(s-1,I+(E-M)/(p-M)))},a.ab2ij=function(E){return[a.a2i(E[0]),a.b2j(E[1])]},a.i2c=function(E,I){return a.evalxy([],E,I)},a.ab2xy=function(E,I,M){if(!M&&(El[c-1]|Io[s-1]))return[!1,!1];var p=a.a2i(E),g=a.b2j(I),C=a.evalxy([],p,g);if(M){var S=0,N=0,B=[],U,V,W,F;El[c-1]?(U=c-2,V=1,S=(E-l[c-1])/(l[c-1]-l[c-2])):(U=Math.max(0,Math.min(c-2,Math.floor(p))),V=p-U),Io[s-1]?(W=s-2,F=1,N=(I-o[s-1])/(o[s-1]-o[s-2])):(W=Math.max(0,Math.min(s-2,Math.floor(g))),F=g-W),S&&(a.dxydi(B,U,W,V,F),C[0]+=B[0]*S,C[1]+=B[1]*S),N&&(a.dxydj(B,U,W,V,F),C[0]+=B[0]*N,C[1]+=B[1]*N)}return C},a.c2p=function(E,I,M){return[I.c2p(E[0]),M.c2p(E[1])]},a.p2x=function(E,I,M){return[I.p2c(E[0]),M.p2c(E[1])]},a.dadi=function(E){var I=Math.max(0,Math.min(l.length-2,E));return l[I+1]-l[I]},a.dbdj=function(E){var I=Math.max(0,Math.min(o.length-2,E));return o[I+1]-o[I]},a.dxyda=function(E,I,M,p){var g=a.dxydi(null,E,I,M,p),C=a.dadi(E,M);return[g[0]/C,g[1]/C]},a.dxydb=function(E,I,M,p){var g=a.dxydj(null,E,I,M,p),C=a.dbdj(I,p);return[g[0]/C,g[1]/C]},a.dxyda_rough=function(E,I,M){var p=d*(M||.1),g=a.ab2xy(E+p,I,!0),C=a.ab2xy(E-p,I,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dxydb_rough=function(E,I,M){var p=k*(M||.1),g=a.ab2xy(E,I+p,!0),C=a.ab2xy(E,I-p,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dpdx=function(E){return E._m},a.dpdy=function(E){return E._m}}}),Uet=It((et,Y)=>{var f=Fs(),y=jn().isArray1D,z=Met(),P=Eet(),n=Let(),i=Pet(),a=Iet(),l=H8(),o=Det(),c=$8(),s=jet();Y.exports=function(h,m){var b=f.getFromId(h,m.xaxis),x=f.getFromId(h,m.yaxis),_=m.aaxis,A=m.baxis,d=m.x,k=m.y,w=[];d&&y(d)&&w.push("x"),k&&y(k)&&w.push("y"),w.length&&c(m,_,A,"a","b",w);var D=m._a=m._a||m.a,E=m._b=m._b||m.b;d=m._x||m.x,k=m._y||m.y;var I={};if(m._cheater){var M=_.cheatertype==="index"?D.length:D,p=A.cheatertype==="index"?E.length:E;d=z(M,p,m.cheaterslope)}m._x=d=l(d),m._y=k=l(k),o(d,D,E),o(k,D,E),s(m),m.setScale();var g=P(d),C=P(k),S=.5*(g[1]-g[0]),N=.5*(g[1]+g[0]),B=.5*(C[1]-C[0]),U=.5*(C[1]+C[0]),V=1.3;return g=[N-S*V,N+S*V],C=[U-B*V,U+B*V],m._extremes[b._id]=f.findExtremes(b,g,{padded:!0}),m._extremes[x._id]=f.findExtremes(x,C,{padded:!0}),n(m,"a","b"),n(m,"b","a"),i(m,_),i(m,A),I.clipsegments=a(m._xctrl,m._yctrl,_,A),I.x=d,I.y=k,I.a=D,I.b=E,[I]}}),$et=It((et,Y)=>{Y.exports={attributes:SA(),supplyDefaults:Tet(),plot:Aet(),calc:Uet(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Fd(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),Het=It((et,Y)=>{Y.exports=$et()}),Hz=It((et,Y)=>{var f=Em(),y=dd(),z=xa(),{hovertemplateAttrs:P,texttemplateAttrs:n,templatefallbackAttrs:i}=nu(),a=Ru(),l=Yn().extendFlat,o=y.marker,c=y.line,s=o.line;Y.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},y.mode,{dflt:"markers"}),text:l({},y.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:i({editType:"plot"}),hovertext:l({},y.hovertext,{}),line:{color:c.color,width:c.width,dash:c.dash,backoff:c.backoff,shape:l({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:y.connectgaps,fill:l({},y.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:f(),marker:l({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:l({width:s.width,editType:"calc"},a("marker.line")),gradient:o.gradient,editType:"calc"},a("marker")),textfont:y.textfont,textposition:y.textposition,selected:y.selected,unselected:y.unselected,hoverinfo:l({},z.hoverinfo,{flags:["a","b","text","name"]}),hoveron:y.hoveron,hovertemplate:P(),hovertemplatefallback:i(),zorder:y.zorder}}),Vet=It((et,Y)=>{var f=jn(),y=Eg(),z=Fu(),P=Y0(),n=Lm(),i=oy(),a=pm(),l=Pm(),o=Hz();Y.exports=function(c,s,h,m){function b(D,E){return f.coerce(c,s,o,D,E)}b("carpet"),s.xaxis="x",s.yaxis="y";var x=b("a"),_=b("b"),A=Math.min(x.length,_.length);if(!A){s.visible=!1;return}s._length=A,b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext");var d=A{Y.exports=function(f,y){var z={},P=y._carpet,n=P.ab2ij([f.a,f.b]),i=Math.floor(n[0]),a=n[0]-i,l=Math.floor(n[1]),o=n[1]-l,c=P.evalxy([],i,l,a,o);return z.yLabel=c[1].toFixed(3),z}}),CA=It((et,Y)=>{Y.exports=function(f,y){for(var z=f._fullData.length,P,n=0;n{var f=Sr(),y=Dm(),z=ft(),P=$t(),n=_e().calcMarkerSize,i=CA();Y.exports=function(a,l){var o=l._carpetTrace=i(a,l);if(!(!o||!o.visible||o.visible==="legendonly")){var c;l.xaxis=o.xaxis,l.yaxis=o.yaxis;var s=l._length,h=new Array(s),m,b,x=!1;for(c=0;c{var f=fo(),y=Fs(),z=Js();Y.exports=function(P,n,i,a){var l,o,c,s=i[0][0].carpet,h=y.getFromId(P,s.xaxis||"x"),m=y.getFromId(P,s.yaxis||"y"),b={xaxis:h,yaxis:m,plot:n.plot};for(l=0;l{var f=Kf(),y=jn().fillText;Y.exports=function(z,P,n,i){var a=f(z,P,n,i);if(!a||a[0].index===!1)return;var l=a[0];if(l.index===void 0){var o=1-l.y0/z.ya._length,c=z.xa._length,s=c*o/2,h=c-s;return l.x0=Math.max(Math.min(l.x0,h),s),l.x1=Math.max(Math.min(l.x1,h),s),a}var m=l.cd[l.index];l.a=m.a,l.b=m.b,l.xLabelVal=void 0,l.yLabelVal=void 0;var b=l.trace,x=b._carpet,_=b._module.formatLabels(m,b);l.yLabel=_.yLabel,delete l.text;var A=[];function d(D,E){var I;D.labelprefix&&D.labelprefix.length>0?I=D.labelprefix.replace(/ = $/,""):I=D._hovertitle,A.push(I+": "+E.toFixed(3)+D.labelsuffix)}if(!b.hovertemplate){var k=m.hi||b.hoverinfo,w=k.split("+");w.indexOf("all")!==-1&&(w=["a","b","text"]),w.indexOf("a")!==-1&&d(x.aaxis,m.a),w.indexOf("b")!==-1&&d(x.baxis,m.b),A.push("y: "+l.yLabel),w.indexOf("text")!==-1&&y(m,b,A),l.extraText=A.join("
")}return a}}),Ket=It((et,Y)=>{Y.exports=function(f,y,z,P,n){var i=P[n];return f.a=i.a,f.b=i.b,f.y=i.y,f}}),Yet=It((et,Y)=>{Y.exports={attributes:Hz(),supplyDefaults:Vet(),colorbar:Do(),formatLabels:Wet(),calc:qet(),plot:Get(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:Zet(),selectPoints:Qd(),eventData:Ket(),moduleType:"trace",name:"scattercarpet",basePlotModule:Fd(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),Xet=It((et,Y)=>{Y.exports=Yet()}),Vz=It((et,Y)=>{var f=zw(),y=Q4(),z=Ru(),P=Yn().extendFlat,n=y.contours;Y.exports=P({carpet:{valType:"string",editType:"calc"},z:f.z,a:f.x,a0:f.x0,da:f.dx,b:f.y,b0:f.y0,db:f.dy,text:f.text,hovertext:f.hovertext,transpose:f.transpose,atype:f.xtype,btype:f.ytype,fillcolor:y.fillcolor,autocontour:y.autocontour,ncontours:y.ncontours,contours:{type:n.type,start:n.start,end:n.end,size:n.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:n.showlines,showlabels:n.showlabels,labelfont:n.labelfont,labelformat:n.labelformat,operation:n.operation,value:n.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:y.line.color,width:y.line.width,dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},zorder:y.zorder},z("",{cLetter:"z",autoColorDflt:!1}))}),Wz=It((et,Y)=>{var f=jn(),y=U8(),z=Vz(),P=gP(),n=eC(),i=rC();Y.exports=function(a,l,o,c){function s(x,_){return f.coerce(a,l,z,x,_)}function h(x){return f.coerce2(a,l,z,x)}if(s("carpet"),a.a&&a.b){var m=y(a,l,s,c,"a","b");if(!m){l.visible=!1;return}s("text");var b=s("contours.type")==="constraint";b?P(a,l,s,c,o,{hasHover:!1}):(n(a,l,s,h),i(a,l,s,c,{hasHover:!1}))}else l._defaultColor=o,l._length=null;s("zorder")}}),Jet=It((et,Y)=>{var f=Cp(),y=jn(),z=$8(),P=H8(),n=V8(),i=W8(),a=tP(),l=Wz(),o=CA(),c=sP();Y.exports=function(h,m){var b=m._carpetTrace=o(h,m);if(!(!b||!b.visible||b.visible==="legendonly")){if(!m.a||!m.b){var x=h.data[b.index],_=h.data[m.index];_.a||(_.a=x.a),_.b||(_.b=x.b),l(_,m,m._defaultColor,h._fullLayout)}var A=s(h,m);return c(m,m._z),A}};function s(h,m){var b=m._carpetTrace,x=b.aaxis,_=b.baxis,A,d,k,w,D,E,I;x._minDtick=0,_._minDtick=0,y.isArray1D(m.z)&&z(m,x,_,"a","b",["z"]),A=m._a=m._a||m.a,w=m._b=m._b||m.b,A=A?x.makeCalcdata(m,"_a"):[],w=w?_.makeCalcdata(m,"_b"):[],d=m.a0||0,k=m.da||1,D=m.b0||0,E=m.db||1,I=m._z=P(m._z||m.z,m.transpose),m._emptypoints=i(I),n(I,m._emptypoints);var M=y.maxRowLength(I),p=m.xtype==="scaled"?"":A,g=a(m,p,d,k,M,x),C=m.ytype==="scaled"?"":w,S=a(m,C,D,E,I.length,_),N={a:g,b:S,z:I};return m.contours.type==="levels"&&m.contours.coloring!=="none"&&f(h,m,{vals:I,containerStr:"",cLetter:"z"}),[N]}}),Qet=It((et,Y)=>{var f=jn().isArrayOrTypedArray;Y.exports=function(y,z,P,n){var i,a,l,o,c,s,h,m,b,x,_,A,d,k=f(P)?"a":"b",w=k==="a"?y.aaxis:y.baxis,D=w.smoothing,E=k==="a"?y.a2i:y.b2j,I=k==="a"?P:n,M=k==="a"?n:P,p=k==="a"?z.a.length:z.b.length,g=k==="a"?z.b.length:z.a.length,C=Math.floor(k==="a"?y.b2j(M):y.a2i(M)),S=k==="a"?function(bt){return y.evalxy([],bt,C)}:function(bt){return y.evalxy([],C,bt)};D&&(l=Math.max(0,Math.min(g-2,C)),o=C-l,a=k==="a"?function(bt,vt){return y.dxydi([],bt,l,vt,o)}:function(bt,vt){return y.dxydj([],l,bt,o,vt)});var N=E(I[0]),B=E(I[1]),U=N0?Math.floor:Math.ceil,F=U>0?Math.ceil:Math.floor,H=U>0?Math.min:Math.max,q=U>0?Math.max:Math.min,G=W(N+V),tt=F(B-V);h=S(N);var ht=[[h]];for(i=G;i*U{var f=Br(),y=Uz(),z=$z(),P=Js(),n=jn(),i=cP(),a=uP(),l=nC(),o=ek(),c=dP(),s=hP(),h=fP(),m=CA(),b=Qet();Y.exports=function(M,p,g,C){var S=p.xaxis,N=p.yaxis;n.makeTraceGroups(C,g,"contour").each(function(B){var U=f.select(this),V=B[0],W=V.trace,F=W._carpetTrace=m(M,W),H=M.calcdata[F.index][0];if(!F.visible||F.visible==="legendonly")return;var q=V.a,G=V.b,tt=W.contours,ht=s(tt,p,V),bt=tt.type==="constraint",vt=tt._operation,ut=bt?vt==="="?"lines":"fill":tt.coloring;function rt(Bt){var Zt=F.ab2xy(Bt[0],Bt[1],!0);return[S.c2p(Zt[0]),N.c2p(Zt[1])]}var gt=[[q[0],G[G.length-1]],[q[q.length-1],G[G.length-1]],[q[q.length-1],G[0]],[q[0],G[0]]];i(ht);var it=(q[q.length-1]-q[0])*1e-8,st=(G[G.length-1]-G[0])*1e-8;a(ht,it,st);var xt=ht;tt.type==="constraint"&&(xt=c(ht,vt)),x(ht,rt);var ot,J,mt,dt,Ct=[];for(dt=H.clipsegments.length-1;dt>=0;dt--)ot=H.clipsegments[dt],J=y([],ot.x,S.c2p),mt=y([],ot.y,N.c2p),J.reverse(),mt.reverse(),Ct.push(z(J,mt,ot.bicubic));var Rt="M"+Ct.join("L")+"Z";D(U,H.clipsegments,S,N,bt,ut),E(W,U,S,N,xt,gt,rt,F,H,ut,Rt),_(U,ht,M,V,tt,p,F),P.setClipUrl(U,F._clipPathId,M)})};function x(M,p){var g,C,S,N,B,U,V,W,F;for(g=0;gbt&&(C.max=bt),C.len=C.max-C.min}function d(M,p,g){var C=M.getPointAtLength(p),S=M.getPointAtLength(g),N=S.x-C.x,B=S.y-C.y,U=Math.sqrt(N*N+B*B);return[N/U,B/U]}function k(M){var p=Math.sqrt(M[0]*M[0]+M[1]*M[1]);return[M[0]/p,M[1]/p]}function w(M,p){var g=Math.abs(M[0]*p[0]+M[1]*p[1]),C=Math.sqrt(1-g*g);return C/g}function D(M,p,g,C,S,N){var B,U,V,W,F=n.ensureSingle(M,"g","contourbg"),H=F.selectAll("path").data(N==="fill"&&!S?[0]:[]);H.enter().append("path"),H.exit().remove();var q=[];for(W=0;W=0&&(G=mt,ht=bt):Math.abs(q[1]-G[1])=0&&(G=mt,ht=bt):n.log("endpt to newendpt is not vert. or horz.",q,G,mt)}if(ht>=0)break;W+=ot(q,G),q=G}if(ht===p.edgepaths.length){n.log("unclosed perimeter path");break}V=ht,H=F.indexOf(V)===-1,H&&(V=F[0],W+=ot(q,G)+"Z",q=null)}for(V=0;V{Y.exports={attributes:Vz(),supplyDefaults:Wz(),colorbar:aC(),calc:Jet(),plot:trt(),style:iC(),moduleType:"trace",name:"contourcarpet",basePlotModule:Fd(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),rrt=It((et,Y)=>{Y.exports=ert()}),AA=It((et,Y)=>{var f=jn().extendFlat,y=dd(),z=Sh().axisHoverFormat,P=qf().dash,n=oo(),i=Ow(),a=i.INCREASING.COLOR,l=i.DECREASING.COLOR,o=y.line;function c(s){return{line:{color:f({},o.color,{dflt:s}),width:o.width,dash:P,editType:"style"},editType:"style"}}Y.exports={xperiod:y.xperiod,xperiod0:y.xperiod0,xperiodalignment:y.xperiodalignment,xhoverformat:z("x"),yhoverformat:z("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:f({},o.width,{}),dash:f({},P,{}),editType:"style"},increasing:c(a),decreasing:c(l),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:f({},n.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:y.zorder}}),qz=It((et,Y)=>{var f=ls(),y=jn();Y.exports=function(z,P,n,i){var a=n("x"),l=n("open"),o=n("high"),c=n("low"),s=n("close");n("hoverlabel.split");var h=f.getComponentMethod("calendars","handleTraceDefaults");if(h(z,P,["x"],i),!!(l&&o&&c&&s)){var m=Math.min(l.length,o.length,c.length,s.length);return a&&(m=Math.min(m,y.minRowLength(a))),P._length=m,m}}}),nrt=It((et,Y)=>{var f=jn(),y=qz(),z=S0(),P=AA();Y.exports=function(i,a,l,o){function c(h,m){return f.coerce(i,a,P,h,m)}var s=y(i,a,c,o);if(!s){a.visible=!1;return}z(i,a,o,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),c("line.dash"),n(i,a,c,"increasing"),n(i,a,c,"decreasing"),c("text"),c("hovertext"),c("tickwidth"),o._requestRangeslider[a.xaxis]=!0,c("zorder")};function n(i,a,l,o){l(o+".line.color"),l(o+".line.width",a.line.width),l(o+".line.dash",a.line.dash)}}),Gz=It((et,Y)=>{var f=jn(),y=f._,z=Fs(),P=Im(),n=Dr().BADNUM;function i(c,s){var h=z.getFromId(c,s.xaxis),m=z.getFromId(c,s.yaxis),b=o(c,h,s),x=s._minDiff;s._minDiff=null;var _=s._origX;s._origX=null;var A=s._xcalc;s._xcalc=null;var d=l(c,s,_,A,m,a);return s._extremes[h._id]=z.findExtremes(h,A,{vpad:x/2}),d.length?(f.extendFlat(d[0].t,{wHover:x/2,tickLen:b}),d):[{t:{empty:!0}}]}function a(c,s,h,m){return{o:c,h:s,l:h,c:m}}function l(c,s,h,m,b,x){for(var _=b.makeCalcdata(s,"open"),A=b.makeCalcdata(s,"high"),d=b.makeCalcdata(s,"low"),k=b.makeCalcdata(s,"close"),w=f.isArrayOrTypedArray(s.text),D=f.isArrayOrTypedArray(s.hovertext),E=!0,I=null,M=!!s.xperiodalignment,p=[],g=0;gI):E=U>S,I=U;var V=x(S,N,B,U);V.pos=C,V.yc=(S+U)/2,V.i=g,V.dir=E?"increasing":"decreasing",V.x=V.pos,V.y=[B,N],M&&(V.orig_p=h[g]),w&&(V.tx=s.text[g]),D&&(V.htx=s.hovertext[g]),p.push(V)}else p.push({pos:C,empty:!0})}return s._extremes[b._id]=z.findExtremes(b,f.concat(d,A),{padded:!0}),p.length&&(p[0].t={labels:{open:y(c,"open:")+" ",high:y(c,"high:")+" ",low:y(c,"low:")+" ",close:y(c,"close:")+" "}}),p}function o(c,s,h){var m=h._minDiff;if(!m){var b=c._fullData,x=[];m=1/0;var _;for(_=0;_{var f=Br(),y=jn();Y.exports=function(z,P,n,i){var a=P.yaxis,l=P.xaxis,o=!!l.rangebreaks;y.makeTraceGroups(i,n,"trace ohlc").each(function(c){var s=f.select(this),h=c[0],m=h.t,b=h.trace;if(b.visible!==!0||m.empty){s.remove();return}var x=m.tickLen,_=s.selectAll("path").data(y.identity);_.enter().append("path"),_.exit().remove(),_.attr("d",function(A){if(A.empty)return"M0,0Z";var d=l.c2p(A.pos-x,!0),k=l.c2p(A.pos+x,!0),w=o?(d+k)/2:l.c2p(A.pos,!0),D=a.c2p(A.o,!0),E=a.c2p(A.h,!0),I=a.c2p(A.l,!0),M=a.c2p(A.c,!0);return"M"+d+","+D+"H"+w+"M"+w+","+E+"V"+I+"M"+k+","+M+"H"+w})})}}),art=It((et,Y)=>{var f=Br(),y=Js(),z=Hn();Y.exports=function(P,n,i){var a=i||f.select(P).selectAll("g.ohlclayer").selectAll("g.trace");a.style("opacity",function(l){return l[0].trace.opacity}),a.each(function(l){var o=l[0].trace;f.select(this).selectAll("path").each(function(c){if(!c.empty){var s=o[c.dir].line;f.select(this).style("fill","none").call(z.stroke,s.color).call(y.dashLine,s.dash,s.width).style("opacity",o.selectedpoints&&!c.selected?.3:1)}})})}}),Zz=It((et,Y)=>{var f=Fs(),y=jn(),z=hd(),P=Hn(),n=jn().fillText,i=Ow(),a={increasing:i.INCREASING.SYMBOL,decreasing:i.DECREASING.SYMBOL};function l(h,m,b,x){var _=h.cd,A=_[0].trace;return A.hoverlabel.split?c(h,m,b,x):s(h,m,b,x)}function o(h,m,b,x){var _=h.cd,A=h.xa,d=_[0].trace,k=_[0].t,w=d.type,D=w==="ohlc"?"l":"min",E=w==="ohlc"?"h":"max",I,M,p=k.bPos||0,g=function(tt){return tt.pos+p-m},C=k.bdPos||k.tickLen,S=k.wHover,N=Math.min(1,C/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));I=h.maxHoverDistance-N,M=h.maxSpikeDistance-N;function B(tt){var ht=g(tt);return z.inbox(ht-S,ht+S,I)}function U(tt){var ht=tt[D],bt=tt[E];return ht===bt||z.inbox(ht-b,bt-b,I)}function V(tt){return(B(tt)+U(tt))/2}var W=z.getDistanceFunction(x,B,U,V);if(z.getClosest(_,W,h),h.index===!1)return null;var F=_[h.index];if(F.empty)return null;var H=F.dir,q=d[H],G=q.line.color;return P.opacity(G)&&q.line.width?h.color=G:h.color=q.fillcolor,h.x0=A.c2p(F.pos+p-C,!0),h.x1=A.c2p(F.pos+p+C,!0),h.xLabelVal=F.orig_p!==void 0?F.orig_p:F.pos,h.spikeDistance=V(F)*M/I,h.xSpike=A.c2p(F.pos,!0),h}function c(h,m,b,x){var _=h.cd,A=h.ya,d=_[0].trace,k=_[0].t,w=[],D=o(h,m,b,x);if(!D)return[];var E=D.index,I=_[E],M=I.hi||d.hoverinfo,p=M.split("+"),g=M==="all",C=g||p.indexOf("y")!==-1;if(!C)return[];for(var S=["high","open","close","low"],N={},B=0;B"+k.labels[U]+f.hoverLabelText(A,V,d.yhoverformat)):(F=y.extendFlat({},D),F.y0=F.y1=W,F.yLabelVal=V,F.yLabel=k.labels[U]+f.hoverLabelText(A,V,d.yhoverformat),F.name="",w.push(F),N[V]=F)}return w}function s(h,m,b,x){var _=h.cd,A=h.ya,d=_[0].trace,k=_[0].t,w=o(h,m,b,x);if(!w)return[];var D=w.index,E=_[D],I=w.index=E.i,M=E.dir;function p(V){return k.labels[V]+f.hoverLabelText(A,d[V][I],d.yhoverformat)}var g=E.hi||d.hoverinfo,C=g.split("+"),S=g==="all",N=S||C.indexOf("y")!==-1,B=S||C.indexOf("text")!==-1,U=N?[p("open"),p("high"),p("low"),p("close")+" "+a[M]]:[];return B&&n(E,d,U),w.extraText=U.join("
"),w.y0=w.y1=A.c2p(E.yc,!0),[w]}Y.exports={hoverPoints:l,hoverSplit:c,hoverOnPoints:s}}),Kz=It((et,Y)=>{Y.exports=function(f,y){var z=f.cd,P=f.xaxis,n=f.yaxis,i=[],a,l=z[0].t.bPos||0;if(y===!1)for(a=0;a{Y.exports={moduleType:"trace",name:"ohlc",basePlotModule:Fd(),categories:["cartesian","svg","showLegend"],meta:{},attributes:AA(),supplyDefaults:nrt(),calc:Gz().calc,plot:irt(),style:art(),hoverPoints:Zz().hoverPoints,selectPoints:Kz()}}),srt=It((et,Y)=>{Y.exports=ort()}),Yz=It((et,Y)=>{var f=jn().extendFlat,y=Sh().axisHoverFormat,z=AA(),P=K4();function n(i){return{line:{color:f({},P.line.color,{dflt:i}),width:P.line.width,editType:"style"},fillcolor:P.fillcolor,editType:"style"}}Y.exports={xperiod:z.xperiod,xperiod0:z.xperiod0,xperiodalignment:z.xperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),x:z.x,open:z.open,high:z.high,low:z.low,close:z.close,line:{width:f({},P.line.width,{}),editType:"style"},increasing:n(z.increasing.line.color.dflt),decreasing:n(z.decreasing.line.color.dflt),text:z.text,hovertext:z.hovertext,whiskerwidth:f({},P.whiskerwidth,{dflt:0}),hoverlabel:z.hoverlabel,zorder:P.zorder}}),lrt=It((et,Y)=>{var f=jn(),y=Hn(),z=qz(),P=S0(),n=Yz();Y.exports=function(a,l,o,c){function s(m,b){return f.coerce(a,l,n,m,b)}var h=z(a,l,s,c);if(!h){l.visible=!1;return}P(a,l,c,s,{x:!0}),s("xhoverformat"),s("yhoverformat"),s("line.width"),i(a,l,s,"increasing"),i(a,l,s,"decreasing"),s("text"),s("hovertext"),s("whiskerwidth"),c._requestRangeslider[l.xaxis]=!0,s("zorder")};function i(a,l,o,c){var s=o(c+".line.color");o(c+".line.width",l.line.width),o(c+".fillcolor",y.addOpacity(s,.5))}}),crt=It((et,Y)=>{var f=jn(),y=Fs(),z=Im(),P=Gz().calcCommon;Y.exports=function(i,a){var l=i._fullLayout,o=y.getFromId(i,a.xaxis),c=y.getFromId(i,a.yaxis),s=o.makeCalcdata(a,"x"),h=z(a,o,"x",s).vals,m=P(i,a,s,h,c,n);return m.length?(f.extendFlat(m[0].t,{num:l._numBoxes,dPos:f.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),l._numBoxes++,m):[{t:{empty:!0}}]};function n(i,a,l,o){return{min:l,q1:Math.min(i,o),med:o,q3:Math.max(i,o),max:a}}}),urt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"candlestick",basePlotModule:Fd(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:Yz(),layoutAttributes:Y4(),supplyLayoutDefaults:R8().supplyLayoutDefaults,crossTraceCalc:F8().crossTraceCalc,supplyDefaults:lrt(),calc:crt(),plot:N8().plot,layerName:"boxlayer",style:j8().style,hoverPoints:Zz().hoverPoints,selectPoints:Kz()}}),hrt=It((et,Y)=>{Y.exports=urt()}),Xz=It((et,Y)=>{var f=jn(),y=G0(),z=f.deg2rad,P=f.rad2deg;Y.exports=function(o,c,s){switch(y(o,s),o._id){case"x":case"radialaxis":n(o,c);break;case"angularaxis":l(o,c);break}};function n(o,c){var s=c._subplot;o.setGeometry=function(){var h=o._rl[0],m=o._rl[1],b=s.innerRadius,x=(s.radius-b)/(m-h),_=b/x,A=h>m?function(d){return d<=0}:function(d){return d>=0};o.c2g=function(d){var k=o.c2l(d)-h;return(A(k)?k:0)+_},o.g2c=function(d){return o.l2c(d+h-_)},o.g2p=function(d){return d*x},o.c2p=function(d){return o.g2p(o.c2g(d))}}}function i(o,c){return c==="degrees"?z(o):o}function a(o,c){return c==="degrees"?P(o):o}function l(o,c){var s=o.type;if(s==="linear"){var h=o.d2c,m=o.c2d;o.d2c=function(b,x){return i(h(b),x)},o.c2d=function(b,x){return m(a(b,x))}}o.makeCalcdata=function(b,x){var _=b[x],A=b._length,d,k,w=function(p){return o.d2c(p,b.thetaunit)};if(_)for(d=new Array(A),k=0;k{Y.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}),EA=It((et,Y)=>{var f=jn(),y=Ag().tester,z=f.findIndexOfMin,P=f.isAngleInsideSector,n=f.angleDelta,i=f.angleDist;function a(k,w,D,E,I){if(!P(w,E))return!1;var M,p;D[0]0?p:1/0},E=z(w,D),I=f.mod(E+1,w.length);return[w[E],w[I]]}function x(k){return Math.abs(k)>1e-10?k:0}function _(k,w,D){w=w||0,D=D||0;for(var E=k.length,I=new Array(E),M=0;M{function f(a){return a<0?-1:a>0?1:0}function y(a){var l=a[0],o=a[1];if(!isFinite(l)||!isFinite(o))return[1,0];var c=(l+1)*(l+1)+o*o;return[(l*l+o*o-1)/c,2*o/c]}function z(a,l){var o=l[0],c=l[1];return[o*a.radius+a.cx,-c*a.radius+a.cy]}function P(a,l){return l*a.radius}function n(a,l,o,c){var s=z(a,y([o,l])),h=s[0],m=s[1],b=z(a,y([c,l])),x=b[0],_=b[1];if(l===0)return["M"+h+","+m,"L"+x+","+_].join(" ");var A=P(a,1/Math.abs(l));return["M"+h+","+m,"A"+A+","+A+" 0 0,"+(l<0?1:0)+" "+x+","+_].join(" ")}function i(a,l,o,c){var s=P(a,1/(l+1)),h=z(a,y([l,o])),m=h[0],b=h[1],x=z(a,y([l,c])),_=x[0],A=x[1];if(f(o)!==f(c)){var d=z(a,y([l,0])),k=d[0],w=d[1];return["M"+m+","+b,"A"+s+","+s+" 0 0,"+(0{var f=Br(),y=Xi(),z=ls(),P=jn(),n=P.strRotate,i=P.strTranslate,a=Hn(),l=Js(),o=lh(),c=Fs(),s=G0(),h=Xz(),m=Jm().doAutoRange,b=P_(),x=Up(),_=hd(),A=jp(),d=Md().prepSelect,k=Md().selectOnClick,w=Md().clearOutline,D=Mm(),E=ry(),I=fm().redrawReglTraces,M=Rd().MID_SHIFT,p=MA(),g=EA(),C=Jz(),S=C.smith,N=C.reactanceArc,B=C.resistanceArc,U=C.smithTransform,V=P._,W=P.mod,F=P.deg2rad,H=P.rad2deg;function q(ut,rt,gt){this.isSmith=gt||!1,this.id=rt,this.gd=ut,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var it=ut._fullLayout,st="clip"+it._uid+rt;this.clipIds.forTraces=st+"-for-traces",this.clipPaths.forTraces=it._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=it["_"+(gt?"smith":"polar")+"layer"].append("g").attr("class",rt),this.getHole=function(xt){return this.isSmith?0:xt.hole},this.getSector=function(xt){return this.isSmith?[0,360]:xt.sector},this.getRadial=function(xt){return this.isSmith?xt.realaxis:xt.radialaxis},this.getAngular=function(xt){return this.isSmith?xt.imaginaryaxis:xt.angularaxis},gt||(this.radialTickLayout=null,this.angularTickLayout=null)}var G=q.prototype;Y.exports=function(ut,rt,gt){return new q(ut,rt,gt)},G.plot=function(ut,rt){for(var gt=this,it=rt[gt.id],st=!1,xt=0;xtxe?(ge=dt,ye=dt*xe,Ot=(Ct-ye)/st.h/2,ue=[J[0],J[1]],Mt=[mt[0]+Ot,mt[1]-Ot]):(ge=Ct/xe,ye=Ct,Ot=(dt-ge)/st.w/2,ue=[J[0]+Ot,J[1]-Ot],Mt=[mt[0],mt[1]]),gt.xLength2=ge,gt.yLength2=ye,gt.xDomain2=ue,gt.yDomain2=Mt;var Lt=gt.xOffset2=st.l+st.w*ue[0],ie=gt.yOffset2=st.t+st.h*(1-Mt[1]),be=gt.radius=ge/Zt,ce=gt.innerRadius=gt.getHole(rt)*be,Le=gt.cx=Lt-be*Bt[0],Ze=gt.cy=ie+be*Bt[3],Qe=gt.cxx=Le-Lt,mr=gt.cyy=Ze-ie,fr=xt.side,Jr;fr==="counterclockwise"?(Jr=fr,fr="top"):fr==="clockwise"&&(Jr=fr,fr="bottom"),gt.radialAxis=gt.mockAxis(ut,rt,xt,{_id:"x",side:fr,_trueSide:Jr,domain:[ce/st.w,be/st.w]}),gt.angularAxis=gt.mockAxis(ut,rt,ot,{side:"right",domain:[0,Math.PI],autorange:!1}),gt.doAutoRange(ut,rt),gt.updateAngularAxis(ut,rt),gt.updateRadialAxis(ut,rt),gt.updateRadialAxisTitle(ut,rt),gt.xaxis=gt.mockCartesianAxis(ut,rt,{_id:"x",domain:ue}),gt.yaxis=gt.mockCartesianAxis(ut,rt,{_id:"y",domain:Mt});var an=gt.pathSubplot();gt.clipPaths.forTraces.select("path").attr("d",an).attr("transform",i(Qe,mr)),it.frontplot.attr("transform",i(Lt,ie)).call(l.setClipUrl,gt._hasClipOnAxisFalse?null:gt.clipIds.forTraces,gt.gd),it.bg.attr("d",an).attr("transform",i(Le,Ze)).call(a.fill,rt.bgcolor)},G.mockAxis=function(ut,rt,gt,it){var st=P.extendFlat({},gt,it);return h(st,rt,ut),st},G.mockCartesianAxis=function(ut,rt,gt){var it=this,st=it.isSmith,xt=gt._id,ot=P.extendFlat({type:"linear"},gt);s(ot,ut);var J={x:[0,2],y:[1,3]};return ot.setRange=function(){var mt=it.sectorBBox,dt=J[xt],Ct=it.radialAxis._rl,Rt=(Ct[1]-Ct[0])/(1-it.getHole(rt));ot.range=[mt[dt[0]]*Rt,mt[dt[1]]*Rt]},ot.isPtWithinRange=xt==="x"&&!st?function(mt){return it.isPtInside(mt)}:function(){return!0},ot.setRange(),ot.setScale(),ot},G.doAutoRange=function(ut,rt){var gt=this,it=gt.gd,st=gt.radialAxis,xt=gt.getRadial(rt);m(it,st);var ot=st.range;if(xt.range=ot.slice(),xt._input.range=ot.slice(),st._rl=[st.r2l(ot[0],null,"gregorian"),st.r2l(ot[1],null,"gregorian")],st.minallowed!==void 0){var J=st.r2l(st.minallowed);st._rl[0]>st._rl[1]?st._rl[1]=Math.max(st._rl[1],J):st._rl[0]=Math.max(st._rl[0],J)}if(st.maxallowed!==void 0){var mt=st.r2l(st.maxallowed);st._rl[0]90&&Ct<=270&&(Rt.tickangle=180);var Gt=Zt?function(be){var ce=U(gt,S([be.x,0]));return i(ce[0]-J,ce[1]-mt)}:function(be){return i(Rt.l2p(be.x)+ot,0)},ee=Zt?function(be){return B(gt,be.x,-1/0,1/0)}:function(be){return gt.pathArc(Rt.r2p(be.x)+ot)},xe=tt(dt);if(gt.radialTickLayout!==xe&&(st["radial-axis"].selectAll(".xtick").remove(),gt.radialTickLayout=xe),Bt){Rt.setScale();var ge=0,ye=Zt?(Rt.tickvals||[]).filter(function(be){return be>=0}).map(function(be){return c.tickText(Rt,be,!0,!1)}):c.calcTicks(Rt),ue=Zt?ye:c.clipEnds(Rt,ye),Mt=c.getTickSigns(Rt)[2];Zt&&((Rt.ticks==="top"&&Rt.side==="bottom"||Rt.ticks==="bottom"&&Rt.side==="top")&&(Mt=-Mt),Rt.ticks==="top"&&Rt.side==="top"&&(ge=-Rt.ticklen),Rt.ticks==="bottom"&&Rt.side==="bottom"&&(ge=Rt.ticklen)),c.drawTicks(it,Rt,{vals:ye,layer:st["radial-axis"],path:c.makeTickPath(Rt,0,Mt),transFn:Gt,crisp:!1}),c.drawGrid(it,Rt,{vals:ue,layer:st["radial-grid"],path:ee,transFn:P.noop,crisp:!1}),c.drawLabels(it,Rt,{vals:ye,layer:st["radial-axis"],transFn:Gt,labelFns:c.makeLabelFns(Rt,ge)})}var Ot=gt.radialAxisAngle=gt.vangles?H(bt(F(dt.angle),gt.vangles)):dt.angle,Lt=i(J,mt),ie=Lt+n(-Ot);vt(st["radial-axis"],Bt&&(dt.showticklabels||dt.ticks),{transform:ie}),vt(st["radial-grid"],Bt&&dt.showgrid,{transform:Zt?"":Lt}),vt(st["radial-line"].select("line"),Bt&&dt.showline,{x1:Zt?-xt:ot,y1:0,x2:xt,y2:0,transform:ie}).attr("stroke-width",dt.linewidth).call(a.stroke,dt.linecolor)},G.updateRadialAxisTitle=function(ut,rt,gt){if(!this.isSmith){var it=this,st=it.gd,xt=it.radius,ot=it.cx,J=it.cy,mt=it.getRadial(rt),dt=it.id+"title",Ct=0;if(mt.title){var Rt=l.bBox(it.layers["radial-axis"].node()).height,Bt=mt.title.font.size,Zt=mt.side;Ct=Zt==="top"?Bt:Zt==="counterclockwise"?-(Rt+Bt*.4):Rt+Bt*.8}var Gt=gt!==void 0?gt:it.radialAxisAngle,ee=F(Gt),xe=Math.cos(ee),ge=Math.sin(ee),ye=ot+xt/2*xe+Ct*ge,ue=J-xt/2*ge+Ct*xe;it.layers["radial-axis-title"]=A.draw(st,dt,{propContainer:mt,propName:it.id+".radialaxis.title.text",placeholder:V(st,"Click to enter radial axis title"),attributes:{x:ye,y:ue,"text-anchor":"middle"},transform:{rotate:-Gt}})}},G.updateAngularAxis=function(ut,rt){var gt=this,it=gt.gd,st=gt.layers,xt=gt.radius,ot=gt.innerRadius,J=gt.cx,mt=gt.cy,dt=gt.getAngular(rt),Ct=gt.angularAxis,Rt=gt.isSmith;Rt||(gt.fillViewInitialKey("angularaxis.rotation",dt.rotation),Ct.setGeometry(),Ct.setScale());var Bt=Rt?function(ce){var Le=U(gt,S([0,ce.x]));return Math.atan2(Le[0]-J,Le[1]-mt)-Math.PI/2}:function(ce){return Ct.t2g(ce.x)};Ct.type==="linear"&&Ct.thetaunit==="radians"&&(Ct.tick0=H(Ct.tick0),Ct.dtick=H(Ct.dtick));var Zt=function(ce){return i(J+xt*Math.cos(ce),mt-xt*Math.sin(ce))},Gt=Rt?function(ce){var Le=U(gt,S([0,ce.x]));return i(Le[0],Le[1])}:function(ce){return Zt(Bt(ce))},ee=Rt?function(ce){var Le=U(gt,S([0,ce.x])),Ze=Math.atan2(Le[0]-J,Le[1]-mt)-Math.PI/2;return i(Le[0],Le[1])+n(-H(Ze))}:function(ce){var Le=Bt(ce);return Zt(Le)+n(-H(Le))},xe=Rt?function(ce){return N(gt,ce.x,0,1/0)}:function(ce){var Le=Bt(ce),Ze=Math.cos(Le),Qe=Math.sin(Le);return"M"+[J+ot*Ze,mt-ot*Qe]+"L"+[J+xt*Ze,mt-xt*Qe]},ge=c.makeLabelFns(Ct,0),ye=ge.labelStandoff,ue={};ue.xFn=function(ce){var Le=Bt(ce);return Math.cos(Le)*ye},ue.yFn=function(ce){var Le=Bt(ce),Ze=Math.sin(Le)>0?.2:1;return-Math.sin(Le)*(ye+ce.fontSize*Ze)+Math.abs(Math.cos(Le))*(ce.fontSize*M)},ue.anchorFn=function(ce){var Le=Bt(ce),Ze=Math.cos(Le);return Math.abs(Ze)<.1?"middle":Ze>0?"start":"end"},ue.heightFn=function(ce,Le,Ze){var Qe=Bt(ce);return-.5*(1+Math.sin(Qe))*Ze};var Mt=tt(dt);gt.angularTickLayout!==Mt&&(st["angular-axis"].selectAll("."+Ct._id+"tick").remove(),gt.angularTickLayout=Mt);var Ot=Rt?[1/0].concat(Ct.tickvals||[]).map(function(ce){return c.tickText(Ct,ce,!0,!1)}):c.calcTicks(Ct);Rt&&(Ot[0].text="∞",Ot[0].fontSize*=1.75);var Lt;if(rt.gridshape==="linear"?(Lt=Ot.map(Bt),P.angleDelta(Lt[0],Lt[1])<0&&(Lt=Lt.slice().reverse())):Lt=null,gt.vangles=Lt,Ct.type==="category"&&(Ot=Ot.filter(function(ce){return P.isAngleInsideSector(Bt(ce),gt.sectorInRad)})),Ct.visible){var ie=Ct.ticks==="inside"?-1:1,be=(Ct.linewidth||1)/2;c.drawTicks(it,Ct,{vals:Ot,layer:st["angular-axis"],path:"M"+ie*be+",0h"+ie*Ct.ticklen,transFn:ee,crisp:!1}),c.drawGrid(it,Ct,{vals:Ot,layer:st["angular-grid"],path:xe,transFn:P.noop,crisp:!1}),c.drawLabels(it,Ct,{vals:Ot,layer:st["angular-axis"],repositionOnUpdate:!0,transFn:Gt,labelFns:ue})}vt(st["angular-line"].select("path"),dt.showline,{d:gt.pathSubplot(),transform:i(J,mt)}).attr("stroke-width",dt.linewidth).call(a.stroke,dt.linecolor)},G.updateFx=function(ut,rt){if(!this.gd._context.staticPlot){var gt=!this.isSmith;gt&&(this.updateAngularDrag(ut),this.updateRadialDrag(ut,rt,0),this.updateRadialDrag(ut,rt,1)),this.updateHoverAndMainDrag(ut)}},G.updateHoverAndMainDrag=function(ut){var rt=this,gt=rt.isSmith,it=rt.gd,st=rt.layers,xt=ut._zoomlayer,ot=p.MINZOOM,J=p.OFFEDGE,mt=rt.radius,dt=rt.innerRadius,Ct=rt.cx,Rt=rt.cy,Bt=rt.cxx,Zt=rt.cyy,Gt=rt.sectorInRad,ee=rt.vangles,xe=rt.radialAxis,ge=g.clampTiny,ye=g.findXYatLength,ue=g.findEnclosingVertexAngles,Mt=p.cornerHalfWidth,Ot=p.cornerLen/2,Lt,ie,be=b.makeDragger(st,"path","maindrag",ut.dragmode===!1?"none":"crosshair");f.select(be).attr("d",rt.pathSubplot()).attr("transform",i(Ct,Rt)),be.onmousemove=function(zr){_.hover(it,zr,rt.id),it._fullLayout._lasthover=be,it._fullLayout._hoversubplot=rt.id},be.onmouseout=function(zr){it._dragging||x.unhover(it,zr)};var ce={element:be,gd:it,subplot:rt.id,plotinfo:{id:rt.id,xaxis:rt.xaxis,yaxis:rt.yaxis},xaxes:[rt.xaxis],yaxes:[rt.yaxis]},Le,Ze,Qe,mr,fr,Jr,an,Er,dn;function _n(zr,xr){return Math.sqrt(zr*zr+xr*xr)}function Oe(zr,xr){return _n(zr-Bt,xr-Zt)}function Xt(zr,xr){return Math.atan2(Zt-xr,zr-Bt)}function oe(zr,xr){return[zr*Math.cos(xr),zr*Math.sin(-xr)]}function zt(zr,xr){if(zr===0)return rt.pathSector(2*Mt);var pn=Ot/zr,ci=xr-pn,ui=xr+pn,yi=Math.max(0,Math.min(zr,mt)),Gi=yi-Mt,Ci=yi+Mt;return"M"+oe(Gi,ci)+"A"+[Gi,Gi]+" 0,0,0 "+oe(Gi,ui)+"L"+oe(Ci,ui)+"A"+[Ci,Ci]+" 0,0,1 "+oe(Ci,ci)+"Z"}function _t(zr,xr,pn){if(zr===0)return rt.pathSector(2*Mt);var ci=oe(zr,xr),ui=oe(zr,pn),yi=ge((ci[0]+ui[0])/2),Gi=ge((ci[1]+ui[1])/2),Ci,fi;if(yi&&Gi){var ba=Gi/yi,oa=-1/ba,Ke=ye(Mt,ba,yi,Gi);Ci=ye(Ot,oa,Ke[0][0],Ke[0][1]),fi=ye(Ot,oa,Ke[1][0],Ke[1][1])}else{var sr,vr;Gi?(sr=Ot,vr=Mt):(sr=Mt,vr=Ot),Ci=[[yi-sr,Gi-vr],[yi+sr,Gi-vr]],fi=[[yi-sr,Gi+vr],[yi+sr,Gi+vr]]}return"M"+Ci.join("L")+"L"+fi.reverse().join("L")+"Z"}function Pt(){Qe=null,mr=null,fr=rt.pathSubplot(),Jr=!1;var zr=it._fullLayout[rt.id];an=y(zr.bgcolor).getLuminance(),Er=b.makeZoombox(xt,an,Ct,Rt,fr),Er.attr("fill-rule","evenodd"),dn=b.makeCorners(xt,Ct,Rt),w(it)}function Ht(zr,xr){return xr=Math.max(Math.min(xr,mt),dt),zrot?(zr-1&&zr===1&&k(xr,it,[rt.xaxis],[rt.yaxis],rt.id,ce),pn.indexOf("event")>-1&&_.click(it,xr,rt.id)}ce.prepFn=function(zr,xr,pn){var ci=it._fullLayout.dragmode,ui=be.getBoundingClientRect();it._fullLayout._calcInverseTransform(it);var yi=it._fullLayout._invTransform;Lt=it._fullLayout._invScaleX,ie=it._fullLayout._invScaleY;var Gi=P.apply3DTransform(yi)(xr-ui.left,pn-ui.top);if(Le=Gi[0],Ze=Gi[1],ee){var Ci=g.findPolygonOffset(mt,Gt[0],Gt[1],ee);Le+=Bt+Ci[0],Ze+=Zt+Ci[1]}switch(ci){case"zoom":ce.clickFn=Rr,gt||(ee?ce.moveFn=qe:ce.moveFn=he,ce.doneFn=Ye,Pt());break;case"select":case"lasso":d(zr,xr,pn,ce,ci);break}},x.init(ce)},G.updateRadialDrag=function(ut,rt,gt){var it=this,st=it.gd,xt=it.layers,ot=it.radius,J=it.innerRadius,mt=it.cx,dt=it.cy,Ct=it.radialAxis,Rt=p.radialDragBoxSize,Bt=Rt/2;if(!Ct.visible)return;var Zt=F(it.radialAxisAngle),Gt=Ct._rl,ee=Gt[0],xe=Gt[1],ge=Gt[gt],ye=.75*(Gt[1]-Gt[0])/(1-it.getHole(rt))/ot,ue,Mt,Ot;gt?(ue=mt+(ot+Bt)*Math.cos(Zt),Mt=dt-(ot+Bt)*Math.sin(Zt),Ot="radialdrag"):(ue=mt+(J-Bt)*Math.cos(Zt),Mt=dt-(J-Bt)*Math.sin(Zt),Ot="radialdrag-inner");var Lt=b.makeRectDragger(xt,Ot,"crosshair",-Bt,-Bt,Rt,Rt),ie={element:Lt,gd:st};ut.dragmode===!1&&(ie.dragmode=!1),vt(f.select(Lt),Ct.visible&&J0!=(gt?Le>ee:Le=90||st>90&&xt>=450?Zt=1:J<=0&&dt<=0?Zt=0:Zt=Math.max(J,dt),st<=180&&xt>=180||st>180&&xt>=540?Ct=-1:ot>=0&&mt>=0?Ct=0:Ct=Math.min(ot,mt),st<=270&&xt>=270||st>270&&xt>=630?Rt=-1:J>=0&&dt>=0?Rt=0:Rt=Math.min(J,dt),xt>=360?Bt=1:ot<=0&&mt<=0?Bt=0:Bt=Math.max(ot,mt),[Ct,Rt,Bt,Zt]}function bt(ut,rt){var gt=function(st){return P.angleDist(ut,st)},it=P.findIndexOfMin(rt,gt);return rt[it]}function vt(ut,rt,gt){return rt?(ut.attr("display",null),ut.attr(gt)):ut&&ut.attr("display","none"),ut}}),tO=It((et,Y)=>{var f=Sn(),y=Gf(),z=Jh().attributes,P=jn().extendFlat,n=sh().overrideAll,i=n({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=n({tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,ticklabelstep:y.ticklabelstep,showticklabels:y.showticklabels,labelalias:y.labelalias,minorloglabels:y.minorloglabels,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickfont:y.tickfont,tickangle:y.tickangle,tickformat:y.tickformat,tickformatstops:y.tickformatstops,layer:y.layer},"plot","from-root"),l={visible:P({},y.visible,{dflt:!0}),type:P({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},autorange:P({},y.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:P({},y.minallowed,{editType:"plot"}),maxallowed:P({},y.maxallowed,{editType:"plot"}),range:P({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:y.categoryorder,categoryarray:y.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:y.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:P({},y.title.text,{editType:"plot",dflt:""}),font:P({},y.title.font,{editType:"plot"}),editType:"plot"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(l,i,a);var o={visible:P({},y.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:y.autotypenumbers,categoryorder:y.categoryorder,categoryarray:y.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(o,i,a),Y.exports={domain:z({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:f.background},radialaxis:l,angularaxis:o,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),drt=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=O_(),n=Mf().getSubplotData,i=jv(),a=Uv(),l=q0(),o=Sg(),c=Jg(),s=pb(),h=A4(),m=ty(),b=tO(),x=Xz(),_=MA(),A=_.axisNames;function d(w,D,E,I){var M=E("bgcolor");I.bgColor=y.combine(M,I.paper_bgcolor);var p=E("sector");E("hole");var g=n(I.fullData,_.name,I.id),C=I.layoutOut,S;function N(Rt,Bt){return E(S+"."+Rt,Bt)}for(var B=0;B{var f=Mf().getSubplotCalcData,y=jn().counterRegex,z=Qz(),P=MA(),n=P.attr,i=P.name,a=y(i),l={};l[n]={valType:"subplotid",dflt:i,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[i],x=0;x{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Yn().extendFlat,n=Em(),i=dd(),a=xa(),l=i.line;Y.exports={mode:i.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:i.text,texttemplate:y({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:i.connectgaps,marker:i.marker,cliponaxis:P({},i.cliponaxis,{dflt:!1}),textposition:i.textposition,textfont:i.textfont,fill:P({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n(),hoverinfo:P({},a.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:i.hoveron,hovertemplate:f(),hovertemplatefallback:z(),selected:i.selected,unselected:i.unselected}}),PA=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=oy(),i=pm(),a=Pm(),l=Eg().PTS_LINESONLY,o=Nk();function c(h,m,b,x){function _(k,w){return f.coerce(h,m,o,k,w)}var A=s(h,m,x,_);if(!A){m.visible=!1;return}_("thetaunit"),_("mode",A{var f=jn(),y=Fs();Y.exports=function(z,P,n){var i={},a=n[P.subplot]._subplot,l,o;a?(l=a.radialAxis,o=a.angularAxis):(a=n[P.subplot],l=a.radialaxis,o=a.angularaxis);var c=l.c2l(z.r);i.rLabel=y.tickText(l,c,!0).text;var s=o.thetaunit==="degrees"?f.rad2deg(z.theta):z.theta;return i.thetaLabel=y.tickText(o,s,!0).text,i}}),frt=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Fs(),P=Dm(),n=ft(),i=$t(),a=_e().calcMarkerSize;Y.exports=function(l,o){for(var c=l._fullLayout,s=o.subplot,h=c[s].radialaxis,m=c[s].angularaxis,b=h.makeCalcdata(o,"r"),x=m.makeCalcdata(o,"theta"),_=o._length,A=new Array(_),d=0;d<_;d++){var k=b[d],w=x[d],D=A[d]={};f(k)&&f(w)?(D.r=k,D.theta=w):D.r=y}var E=a(o,_);return o._extremes.x=z.findExtremes(h,b,{ppad:E}),P(l,o),n(A,o),i(A,o),A}}),prt=It((et,Y)=>{var f=fo(),y=Dr().BADNUM;Y.exports=function(z,P,n){for(var i=P.layers.frontplot.select("g.scatterlayer"),a=P.xaxis,l=P.yaxis,o={xaxis:a,yaxis:l,plot:P.framework,layerClipId:P._hasClipOnAxisFalse?P.clipIds.forTraces:null},c=P.radialAxis,s=P.angularAxis,h=0;h{var f=Kf();function y(P,n,i,a){var l=f(P,n,i,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var c=P.subplot,s=o.cd[o.index],h=o.trace;if(c.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,c,o),o.hovertemplate=h.hovertemplate,l}}function z(P,n,i,a){var l=i.radialAxis,o=i.angularAxis;l._hovertitle="r",o._hovertitle="θ";var c={};c[n.subplot]={_subplot:i};var s=n._module.formatLabels(P,n,c);a.rLabel=s.rLabel,a.thetaLabel=s.thetaLabel;var h=P.hi||n.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!n.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["r","theta","text"]),x.indexOf("r")!==-1&&b(l,a.rLabel),x.indexOf("theta")!==-1&&b(o,a.thetaLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),mrt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:LA(),categories:["polar","symbols","showLegend","scatter-like"],attributes:Nk(),supplyDefaults:PA().supplyDefaults,colorbar:Do(),formatLabels:IA(),calc:frt(),plot:prt(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:DA().hoverPoints,selectPoints:Qd(),meta:{}}}),grt=It((et,Y)=>{Y.exports=mrt()}),eO=It((et,Y)=>{var f=Nk(),{cliponaxis:y,hoveron:z}=f,P=Ve(f,["cliponaxis","hoveron"]),{connectgaps:n,line:{color:i,dash:a,width:l},fill:o,fillcolor:c,marker:s,textfont:h,textposition:m}=Lk();Y.exports=Ce(we({},P),{connectgaps:n,fill:o,fillcolor:c,line:{color:i,dash:a,editType:"calc",width:l},marker:s,textfont:h,textposition:m})}),vrt=It((et,Y)=>{var f=jn(),y=Fu(),z=PA().handleRThetaDefaults,P=Y0(),n=Lm(),i=pm(),a=Pm(),l=Eg().PTS_LINESONLY,o=eO();Y.exports=function(c,s,h,m){function b(_,A){return f.coerce(c,s,o,_,A)}var x=z(c,s,m,b);if(!x){s.visible=!1;return}b("thetaunit"),b("mode",x{var f=IA();Y.exports=function(y,z,P){var n=y.i;return"r"in y||(y.r=z._r[n]),"theta"in y||(y.theta=z._theta[n]),f(y,z,P)}}),_rt=It((et,Y)=>{var f=Dm(),y=_e().calcMarkerSize,z=Ob(),P=Fs(),n=G_().TOO_MANY_POINTS;Y.exports=function(i,a){var l=i._fullLayout,o=a.subplot,c=l[o].radialaxis,s=l[o].angularaxis,h=a._r=c.makeCalcdata(a,"r"),m=a._theta=s.makeCalcdata(a,"theta"),b=a._length,x={};b{var f=sA(),y=DA().makeHoverPointText;function z(P,n,i,a){var l=P.cd,o=l[0].t,c=o.r,s=o.theta,h=f.hoverPoints(P,n,i,a);if(!(!h||h[0].index===!1)){var m=h[0];if(m.index===void 0)return h;var b=P.subplot,x=m.cd[m.index],_=m.trace;if(x.r=c[m.index],x.theta=s[m.index],!!b.isPtInside(x))return m.xLabelVal=void 0,m.yLabelVal=void 0,y(x,_,b,m),h}}Y.exports={hoverPoints:z}}),brt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:LA(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:eO(),supplyDefaults:vrt(),colorbar:Do(),formatLabels:yrt(),calc:_rt(),hoverPoints:xrt().hoverPoints,selectPoints:BD(),meta:{}}}),wrt=It((et,Y)=>{var f=cA(),y=Sr(),z=oz(),P=zD(),n=Ob(),i=jn(),a=G_().TOO_MANY_POINTS,l={};Y.exports=function(o,c,s){if(s.length){var h=c.radialAxis,m=c.angularAxis,b=P(o,c);return s.forEach(function(x){if(!(!x||!x[0]||!x[0].trace)){var _=x[0],A=_.trace,d=_.t,k=A._length,w=d.r,D=d.theta,E=d.opts,I,M=w.slice(),p=D.slice();for(I=0;I=a&&(E.marker.cluster=d.tree),E.marker&&(E.markerSel.positions=E.markerUnsel.positions=E.marker.positions=g),E.line&&g.length>1&&i.extendFlat(E.line,n.linePositions(o,A,g)),E.text&&(i.extendFlat(E.text,{positions:g},n.textPosition(o,A,E.text,E.marker)),i.extendFlat(E.textSel,{positions:g},n.textPosition(o,A,E.text,E.markerSel)),i.extendFlat(E.textUnsel,{positions:g},n.textPosition(o,A,E.text,E.markerUnsel))),E.fill&&!b.fill2d&&(b.fill2d=!0),E.marker&&!b.scatter2d&&(b.scatter2d=!0),E.line&&!b.line2d&&(b.line2d=!0),E.text&&!b.glText&&(b.glText=!0),b.lineOptions.push(E.line),b.fillOptions.push(E.fill),b.markerOptions.push(E.marker),b.markerSelectedOptions.push(E.markerSel),b.markerUnselectedOptions.push(E.markerUnsel),b.textOptions.push(E.text),b.textSelectedOptions.push(E.textSel),b.textUnselectedOptions.push(E.textUnsel),b.selectBatch.push([]),b.unselectBatch.push([]),d.x=C,d.y=S,d.rawx=C,d.rawy=S,d.r=w,d.theta=D,d.positions=g,d._scene=b,d.index=b.count,b.count++}}),z(o,c,s)}},Y.exports.reglPrecompiled=l}),krt=It((et,Y)=>{var f=brt();f.plot=wrt(),Y.exports=f}),Trt=It((et,Y)=>{Y.exports=krt()}),rO=It((et,Y)=>{var{hovertemplateAttrs:f,templatefallbackAttrs:y}=nu(),z=Yn().extendFlat,P=Nk(),n=Jv();Y.exports={r:P.r,theta:P.theta,r0:P.r0,dr:P.dr,theta0:P.theta0,dtheta:P.dtheta,thetaunit:P.thetaunit,base:z({},n.base,{}),offset:z({},n.offset,{}),width:z({},n.width,{}),text:z({},n.text,{}),hovertext:z({},n.hovertext,{}),marker:i(),hoverinfo:P.hoverinfo,hovertemplate:f(),hovertemplatefallback:y(),selected:n.selected,unselected:n.unselected};function i(){var a=z({},n.marker);return delete a.cornerradius,a}}),nO=It((et,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),Srt=It((et,Y)=>{var f=jn(),y=PA().handleRThetaDefaults,z=O8(),P=rO();Y.exports=function(n,i,a,l){function o(s,h){return f.coerce(n,i,P,s,h)}var c=y(n,i,l,o);if(!c){i.visible=!1;return}o("thetaunit"),o("base"),o("offset"),o("width"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),z(n,i,o,a,l),f.coerceSelectionMarkerOpacity(i,o)}}),Crt=It((et,Y)=>{var f=jn(),y=nO();Y.exports=function(z,P,n){var i={},a;function l(s,h){return f.coerce(z[a]||{},P[a],y,s,h)}for(var o=0;o{var f=fp().hasColorscale,y=Cp(),z=jn().isArrayOrTypedArray,P=Z4(),n=Wr().setGroupPositions,i=$t(),a=ls().traceIs,l=jn().extendFlat;function o(s,h){for(var m=s._fullLayout,b=h.subplot,x=m[b].radialaxis,_=m[b].angularaxis,A=x.makeCalcdata(h,"r"),d=_.makeCalcdata(h,"theta"),k=h._length,w=new Array(k),D=A,E=d,I=0;I{var f=Br(),y=Sr(),z=jn(),P=Js(),n=EA();Y.exports=function(a,l,o){var c=a._context.staticPlot,s=l.xaxis,h=l.yaxis,m=l.radialAxis,b=l.angularAxis,x=i(l),_=l.layers.frontplot.select("g.barlayer");z.makeTraceGroups(_,o,"trace bars").each(function(){var A=f.select(this),d=z.ensureSingle(A,"g","points"),k=d.selectAll("g.point").data(z.identity);k.enter().append("g").style("vector-effect",c?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),k.exit().remove(),k.each(function(w){var D=f.select(this),E=w.rp0=m.c2p(w.s0),I=w.rp1=m.c2p(w.s1),M=w.thetag0=b.c2g(w.p0),p=w.thetag1=b.c2g(w.p1),g;if(!y(E)||!y(I)||!y(M)||!y(p)||E===I||M===p)g="M0,0Z";else{var C=m.c2g(w.s1),S=(M+p)/2;w.ct=[s.c2p(C*Math.cos(S)),h.c2p(C*Math.sin(S))],g=x(E,I,M,p)}z.ensureSingle(D,"path").attr("d",g)}),P.setClipUrl(A,l._hasClipOnAxisFalse?l.clipIds.forTraces:null,a)})};function i(a){var l=a.cxx,o=a.cyy;return a.vangles?function(c,s,h,m){var b,x;z.angleDelta(h,m)>0?(b=h,x=m):(b=m,x=h);var _=n.findEnclosingVertexAngles(b,a.vangles)[0],A=n.findEnclosingVertexAngles(x,a.vangles)[1],d=[_,(b+x)/2,A];return n.pathPolygonAnnulus(c,s,b,x,d,l,o)}:function(c,s,h,m){return z.pathAnnulus(c,s,h,m,l,o)}}}),Mrt=It((et,Y)=>{var f=hd(),y=jn(),z=Iw().getTraceColor,P=y.fillText,n=DA().makeHoverPointText,i=EA().isPtInsidePolygon;Y.exports=function(a,l,o){var c=a.cd,s=c[0].trace,h=a.subplot,m=h.radialAxis,b=h.angularAxis,x=h.vangles,_=x?i:y.isPtInsideSector,A=a.maxHoverDistance,d=b._period||2*Math.PI,k=Math.abs(m.g2p(Math.sqrt(l*l+o*o))),w=Math.atan2(o,l);m.range[0]>m.range[1]&&(w+=Math.PI);var D=function(p){return _(k,w,[p.rp0,p.rp1],[p.thetag0,p.thetag1],x)?A+Math.min(1,Math.abs(p.thetag1-p.thetag0)/d)-1+(p.rp1-k)/(p.rp1-p.rp0)-1:1/0};if(f.getClosest(c,D,a),a.index!==!1){var E=a.index,I=c[E];a.x0=a.x1=I.ct[0],a.y0=a.y1=I.ct[1];var M=y.extendFlat({},I,{r:I.s,theta:I.p});return P(I,s,a),n(M,s,h,a),a.hovertemplate=s.hovertemplate,a.color=z(s,I),a.xLabelVal=a.yLabelVal=void 0,I.s<0&&(a.idealAlign="left"),[a]}}}),Ert=It((et,Y)=>{Y.exports={moduleType:"trace",name:"barpolar",basePlotModule:LA(),categories:["polar","bar","showLegend"],attributes:rO(),layoutAttributes:nO(),supplyDefaults:Srt(),supplyLayoutDefaults:Crt(),calc:iO().calc,crossTraceCalc:iO().crossTraceCalc,plot:Art(),colorbar:Do(),formatLabels:IA(),style:Pg().style,styleOnSelect:Pg().styleOnSelect,hoverPoints:Mrt(),selectPoints:Dw(),meta:{}}}),Lrt=It((et,Y)=>{Y.exports=Ert()}),aO=It((et,Y)=>{Y.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),oO=It((et,Y)=>{var f=Sn(),y=Gf(),z=Jh().attributes,P=jn().extendFlat,n=sh().overrideAll,i=n({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=n({ticklen:y.ticklen,tickwidth:P({},y.tickwidth,{dflt:2}),tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,tickfont:y.tickfont,tickformat:y.tickformat,hoverformat:y.hoverformat,layer:y.layer},"plot","from-root"),l=P({visible:P({},y.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:P({},y.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},i,a),o=P({visible:P({},y.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:y.ticks,editType:"calc"},i,a);Y.exports={domain:z({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:f.background},realaxis:l,imaginaryaxis:o,editType:"calc"}}),Prt=It((et,Y)=>{var f=jn(),y=Hn(),z=Tc(),P=O_(),n=Mf().getSubplotData,i=Sg(),a=q0(),l=pb(),o=G0(),c=oO(),s=aO(),h=s.axisNames,m=x(function(_){return f.isTypedArray(_)&&(_=Array.from(_)),_.slice().reverse().map(function(A){return-A}).concat([0]).concat(_)},String);function b(_,A,d,k){var w=d("bgcolor");k.bgColor=y.combine(w,k.paper_bgcolor);var D=n(k.fullData,s.name,k.id),E=k.layoutOut,I;function M(G,tt){return d(I+"."+G,tt)}for(var p=0;p{var f=Mf().getSubplotCalcData,y=jn().counterRegex,z=Qz(),P=aO(),n=P.attr,i=P.name,a=y(i),l={};l[n]={valType:"subplotid",dflt:i,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[i],x=0;x{var{hovertemplateAttrs:f,texttemplateAttrs:y,templatefallbackAttrs:z}=nu(),P=Yn().extendFlat,n=Em(),i=dd(),a=xa(),l=i.line;Y.exports={mode:i.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:i.text,texttemplate:y({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:i.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:i.connectgaps,marker:i.marker,cliponaxis:P({},i.cliponaxis,{dflt:!1}),textposition:i.textposition,textfont:i.textfont,fill:P({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:n(),hoverinfo:P({},a.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:i.hoveron,hovertemplate:f(),hovertemplatefallback:z(),selected:i.selected,unselected:i.unselected}}),Drt=It((et,Y)=>{var f=jn(),y=Fu(),z=Y0(),P=Lm(),n=oy(),i=pm(),a=Pm(),l=Eg().PTS_LINESONLY,o=sO();Y.exports=function(s,h,m,b){function x(d,k){return f.coerce(s,h,o,d,k)}var _=c(s,h,b,x);if(!_){h.visible=!1;return}x("mode",_{var f=Fs();Y.exports=function(y,z,P){var n={},i=P[z.subplot]._subplot;return n.realLabel=f.tickText(i.radialAxis,y.real,!0).text,n.imagLabel=f.tickText(i.angularAxis,y.imag,!0).text,n}}),Ort=It((et,Y)=>{var f=Sr(),y=Dr().BADNUM,z=Dm(),P=ft(),n=$t(),i=_e().calcMarkerSize;Y.exports=function(a,l){for(var o=a._fullLayout,c=l.subplot,s=o[c].realaxis,h=o[c].imaginaryaxis,m=s.makeCalcdata(l,"real"),b=h.makeCalcdata(l,"imag"),x=l._length,_=new Array(x),A=0;A{var f=fo(),y=Dr().BADNUM,z=Jz(),P=z.smith;Y.exports=function(n,i,a){for(var l=i.layers.frontplot.select("g.scatterlayer"),o=i.xaxis,c=i.yaxis,s={xaxis:o,yaxis:c,plot:i.framework,layerClipId:i._hasClipOnAxisFalse?i.clipIds.forTraces:null},h=0;h{var f=Kf();function y(P,n,i,a){var l=f(P,n,i,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var c=P.subplot,s=o.cd[o.index],h=o.trace;if(c.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,c,o),o.hovertemplate=h.hovertemplate,l}}function z(P,n,i,a){var l=i.radialAxis,o=i.angularAxis;l._hovertitle="real",o._hovertitle="imag";var c={};c[n.subplot]={_subplot:i};var s=n._module.formatLabels(P,n,c);a.realLabel=s.realLabel,a.imagLabel=s.imagLabel;var h=P.hi||n.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!n.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["real","imag","text"]),x.indexOf("real")!==-1&&b(l,a.realLabel),x.indexOf("imag")!==-1&&b(o,a.imagLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),Frt=It((et,Y)=>{Y.exports={moduleType:"trace",name:"scattersmith",basePlotModule:Irt(),categories:["smith","symbols","showLegend","scatter-like"],attributes:sO(),supplyDefaults:Drt(),colorbar:Do(),formatLabels:zrt(),calc:Ort(),plot:Brt(),style:Il().style,styleOnSelect:Il().styleOnSelect,hoverPoints:Rrt().hoverPoints,selectPoints:Qd(),meta:{}}}),Nrt=It((et,Y)=>{Y.exports=Frt()}),A0=It((et,Y)=>{var f=Yf();function y(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}f(y.prototype,{instance:function(l,o){l=(l||"gregorian").toLowerCase(),o=o||"";var c=this._localCals[l+"-"+o];if(!c&&this.calendars[l]&&(c=new this.calendars[l](o),this._localCals[l+"-"+o]=c),!c)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,l);return c},newDate:function(l,o,c,s,h){return s=(l!=null&&l.year?l.calendar():typeof s=="string"?this.instance(s,h):s)||this.instance(),s.newDate(l,o,c)},substituteDigits:function(l){return function(o){return(o+"").replace(/[0-9]/g,function(c){return l[c]})}},substituteChineseDigits:function(l,o){return function(c){for(var s="",h=0;c>0;){var m=c%10;s=(m===0?"":l[m]+o[h])+s,h++,c=Math.floor(c/10)}return s.indexOf(l[1]+o[1])===0&&(s=s.substr(1)),s||l[0]}}});function z(l,o,c,s){if(this._calendar=l,this._year=o,this._month=c,this._day=s,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function P(l,o){return l=""+l,"000000".substring(0,o-l.length)+l}f(z.prototype,{newDate:function(l,o,c){return this._calendar.newDate(l??this,o,c)},year:function(l){return arguments.length===0?this._year:this.set(l,"y")},month:function(l){return arguments.length===0?this._month:this.set(l,"m")},day:function(l){return arguments.length===0?this._day:this.set(l,"d")},date:function(l,o,c){if(!this._calendar.isValid(l,o,c))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=l,this._month=o,this._day=c,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(l,o){return this._calendar.add(this,l,o)},set:function(l,o){return this._calendar.set(this,l,o)},compareTo:function(l){if(this._calendar.name!==l._calendar.name)throw(a.local.differentCalendars||a.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,l._calendar.local.name);var o=this._year!==l._year?this._year-l._year:this._month!==l._month?this.monthOfYear()-l.monthOfYear():this._day-l._day;return o===0?0:o<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(l){return this._calendar.fromJD(l)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(l){return this._calendar.fromJSDate(l)},toString:function(){return(this.year()<0?"-":"")+P(Math.abs(this.year()),4)+"-"+P(this.month(),2)+"-"+P(this.day(),2)}});function n(){this.shortYearCutoff="+10"}f(n.prototype,{_validateLevel:0,newDate:function(l,o,c){return l==null?this.today():(l.year&&(this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate),c=l.day(),o=l.month(),l=l.year()),new z(this,l,o,c))},today:function(){return this.fromJSDate(new Date)},epoch:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return o.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return(o.year()<0?"-":"")+P(Math.abs(o.year()),4)},monthsInYear:function(l){return this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear),12},monthOfYear:function(l,o){var c=this._validate(l,o,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth);return(c.month()+this.monthsInYear(c)-this.firstMonth)%this.monthsInYear(c)+this.minMonth},fromMonthOfYear:function(l,o){var c=(o+this.firstMonth-2*this.minMonth)%this.monthsInYear(l)+this.minMonth;return this._validate(l,c,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth),c},daysInYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return this.leapYear(o)?366:365},dayOfYear:function(l,o,c){var s=this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate);return s.toJD()-this.newDate(s.year(),this.fromMonthOfYear(s.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(l,o,c){var s=this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(s))+2)%this.daysInWeek()},extraInfo:function(l,o,c){return this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate),{}},add:function(l,o,c){return this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate),this._correctAdd(l,this._add(l,o,c),o,c)},_add:function(l,o,c){if(this._validateLevel++,c==="d"||c==="w"){var s=l.toJD()+o*(c==="w"?this.daysInWeek():1),h=l.calendar().fromJD(s);return this._validateLevel--,[h.year(),h.month(),h.day()]}try{var m=l.year()+(c==="y"?o:0),b=l.monthOfYear()+(c==="m"?o:0),h=l.day(),x=function(d){for(;bk-1+d.minMonth;)m++,b-=k,k=d.monthsInYear(m)};c==="y"?(l.month()!==this.fromMonthOfYear(m,b)&&(b=this.newDate(m,l.month(),this.minDay).monthOfYear()),b=Math.min(b,this.monthsInYear(m)),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b)))):c==="m"&&(x(this),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b))));var _=[m,this.fromMonthOfYear(m,b),h];return this._validateLevel--,_}catch(A){throw this._validateLevel--,A}},_correctAdd:function(l,o,c,s){if(!this.hasYearZero&&(s==="y"||s==="m")&&(o[0]===0||l.year()>0!=o[0]>0)){var h={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[s],m=c<0?-1:1;o=this._add(l,c*h[0]+m*h[1],h[2])}return l.date(o[0],o[1],o[2])},set:function(l,o,c){this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate);var s=c==="y"?o:l.year(),h=c==="m"?o:l.month(),m=c==="d"?o:l.day();return(c==="y"||c==="m")&&(m=Math.min(m,this.daysInMonth(s,h))),l.date(s,h,m)},isValid:function(l,o,c){this._validateLevel++;var s=this.hasYearZero||l!==0;if(s){var h=this.newDate(l,o,this.minDay);s=o>=this.minMonth&&o-this.minMonth=this.minDay&&c-this.minDay13.5?13:1),A=h-(_>2.5?4716:4715);return A<=0&&A--,this.newDate(A,_,x)},toJSDate:function(l,o,c){var s=this._validate(l,o,c,a.local.invalidDate||a.regionalOptions[""].invalidDate),h=new Date(s.year(),s.month()-1,s.day());return h.setHours(0),h.setMinutes(0),h.setSeconds(0),h.setMilliseconds(0),h.setHours(h.getHours()>12?h.getHours()+2:0),h},fromJSDate:function(l){return this.newDate(l.getFullYear(),l.getMonth()+1,l.getDate())}});var a=Y.exports=new y;a.cdate=z,a.baseCalendar=n,a.calendars.gregorian=i}),jrt=It(()=>{var et=Yf(),Y=A0();et(Y.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),Y.local=Y.regionalOptions[""],et(Y.cdate.prototype,{formatDate:function(f,y){return typeof f!="string"&&(y=f,f=""),this._calendar.formatDate(f||"",this,y)}}),et(Y.baseCalendar.prototype,{UNIX_EPOCH:Y.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:Y.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(f,y,z){if(typeof f!="string"&&(z=y,y=f,f=""),!y)return"";if(y.calendar()!==this)throw Y.local.invalidFormat||Y.regionalOptions[""].invalidFormat;f=f||this.local.dateFormat,z=z||{};for(var P=z.dayNamesShort||this.local.dayNamesShort,n=z.dayNames||this.local.dayNames,i=z.monthNumbers||this.local.monthNumbers,a=z.monthNamesShort||this.local.monthNamesShort,l=z.monthNames||this.local.monthNames,o=z.calculateWeek||this.local.calculateWeek,c=function(D,E){for(var I=1;w+I1},s=function(D,E,I,M){var p=""+E;if(c(D,M))for(;p.length1},k=function(N,B){var U=d(N,B),V=[2,3,U?4:2,U?4:2,10,11,20]["oyYJ@!".indexOf(N)+1],W=new RegExp("^-?\\d{1,"+V+"}"),F=y.substring(p).match(W);if(!F)throw(Y.local.missingNumberAt||Y.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=F[0].length,parseInt(F[0],10)},w=this,D=function(){if(typeof l=="function"){d("m");var N=l.call(w,y.substring(p));return p+=N.length,N}return k("m")},E=function(N,B,U,V){for(var W=d(N,V)?U:B,F=0;F-1){m=1,b=x;for(var S=this.daysInMonth(h,m);b>S;S=this.daysInMonth(h,m))m++,b-=S}return s>-1?this.fromJD(s):this.newDate(h,m,b)},determineDate:function(f,y,z,P,n){z&&typeof z!="object"&&(n=P,P=z,z=null),typeof P!="string"&&(n=P,P="");var i=this,a=function(l){try{return i.parseDate(P,l,n)}catch{}l=l.toLowerCase();for(var o=(l.match(/^c/)&&z?z.newDate():null)||i.today(),c=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=c.exec(l);s;)o.add(parseInt(s[1],10),s[2]||"d"),s=c.exec(l);return o};return y=y?y.newDate():null,f=f==null?y:typeof f=="string"?a(f):typeof f=="number"?isNaN(f)||f===1/0||f===-1/0?y:i.today().add(f,"d"):i.newDate(f),f}})}),Urt=It(()=>{var et=A0(),Y=Yf(),f=et.instance();function y(s){this.local=this.regionalOptions[s||""]||this.regionalOptions[""]}y.prototype=new et.baseCalendar,Y(y.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(s,h){if(typeof s=="string"){var m=s.match(P);return m?m[0]:""}var b=this._validateYear(s),x=s.month(),_=""+this.toChineseMonth(b,x);return h&&_.length<2&&(_="0"+_),this.isIntercalaryMonth(b,x)&&(_+="i"),_},monthNames:function(s){if(typeof s=="string"){var h=s.match(n);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},monthNamesShort:function(s){if(typeof s=="string"){var h=s.match(i);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一","二","三","四","五","六","七","八","九","十","十一","十二"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},parseMonth:function(s,h){s=this._validateYear(s);var m=parseInt(h),b;if(isNaN(m))h[0]==="闰"&&(b=!0,h=h.substring(1)),h[h.length-1]==="月"&&(h=h.substring(0,h.length-1)),m=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(h);else{var x=h[h.length-1];b=x==="i"||x==="I"}var _=this.toMonthIndex(s,m,b);return _},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(s,h){if(s.year&&(s=s.year()),typeof s!="number"||s<1888||s>2111)throw h.replace(/\{0\}/,this.local.name);return s},toMonthIndex:function(s,h,m){var b=this.intercalaryMonth(s),x=m&&h!==b;if(x||h<1||h>12)throw et.local.invalidMonth.replace(/\{0\}/,this.local.name);var _;return b?!m&&h<=b?_=h-1:_=h:_=h-1,_},toChineseMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s),b=m?12:11;if(h<0||h>b)throw et.local.invalidMonth.replace(/\{0\}/,this.local.name);var x;return m?h>13;return m},isIntercalaryMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s);return!!m&&m===h},leapYear:function(s){return this.intercalaryMonth(s)!==0},weekOfYear:function(s,h,m){var b=this._validateYear(s,et.local.invalidyear),x=l[b-l[0]],_=x>>9&4095,A=x>>5&15,d=x&31,k;k=f.newDate(_,A,d),k.add(4-(k.dayOfWeek()||7),"d");var w=this.toJD(s,h,m)-k.toJD();return 1+Math.floor(w/7)},monthsInYear:function(s){return this.leapYear(s)?13:12},daysInMonth:function(s,h){s.year&&(h=s.month(),s=s.year()),s=this._validateYear(s);var m=a[s-a[0]],b=m>>13,x=b?12:11;if(h>x)throw et.local.invalidMonth.replace(/\{0\}/,this.local.name);var _=m&1<<12-h?30:29;return _},weekDay:function(s,h,m){return(this.dayOfWeek(s,h,m)||7)<6},toJD:function(s,h,m){var b=this._validate(s,_,m,et.local.invalidDate);s=this._validateYear(b.year()),h=b.month(),m=b.day();var x=this.isIntercalaryMonth(s,h),_=this.toChineseMonth(s,h),A=c(s,_,m,x);return f.toJD(A.year,A.month,A.day)},fromJD:function(s){var h=f.fromJD(s),m=o(h.year(),h.month(),h.day()),b=this.toMonthIndex(m.year,m.month,m.isIntercalary);return this.newDate(m.year,b,m.day)},fromString:function(s){var h=s.match(z),m=this._validateYear(+h[1]),b=+h[2],x=!!h[3],_=this.toMonthIndex(m,b,x),A=+h[4];return this.newDate(m,_,A)},add:function(s,h,m){var b=s.year(),x=s.month(),_=this.isIntercalaryMonth(b,x),A=this.toChineseMonth(b,x),d=Object.getPrototypeOf(y.prototype).add.call(this,s,h,m);if(m==="y"){var k=d.year(),w=d.month(),D=this.isIntercalaryMonth(k,A),E=_&&D?this.toMonthIndex(k,A,!0):this.toMonthIndex(k,A,!1);E!==w&&d.month(E)}return d}});var z=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,P=/^\d?\d[iI]?/m,n=/^闰?十?[一二三四五六七八九]?月/m,i=/^闰?十?[一二三四五六七八九]?/m;et.calendars.chinese=y;var a=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],l=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function o(s,h,m,b){var x,_;if(typeof s=="object")x=s,_=h||{};else{var A=typeof s=="number"&&s>=1888&&s<=2111;if(!A)throw new Error("Solar year outside range 1888-2111");var d=typeof h=="number"&&h>=1&&h<=12;if(!d)throw new Error("Solar month outside range 1 - 12");var k=typeof m=="number"&&m>=1&&m<=31;if(!k)throw new Error("Solar day outside range 1 - 31");x={year:s,month:h,day:m},_={}}var w=l[x.year-l[0]],D=x.year<<9|x.month<<5|x.day;_.year=D>=w?x.year:x.year-1,w=l[_.year-l[0]];var E=w>>9&4095,I=w>>5&15,M=w&31,p,g=new Date(E,I-1,M),C=new Date(x.year,x.month-1,x.day);p=Math.round((C-g)/(24*3600*1e3));var S=a[_.year-a[0]],N;for(N=0;N<13;N++){var B=S&1<<12-N?30:29;if(p>13;return!U||N=1888&&s<=2111;if(!d)throw new Error("Lunar year outside range 1888-2111");var k=typeof h=="number"&&h>=1&&h<=12;if(!k)throw new Error("Lunar month outside range 1 - 12");var w=typeof m=="number"&&m>=1&&m<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var D;typeof b=="object"?(D=!1,_=b):(D=!!b,_={}),A={year:s,month:h,day:m,isIntercalary:D}}var E;E=A.day-1;var I=a[A.year-a[0]],M=I>>13,p;M&&(A.month>M||A.isIntercalary)?p=A.month:p=A.month-1;for(var g=0;g>9&4095,B=S>>5&15,U=S&31,V=new Date(N,B-1,U+E);return _.year=V.getFullYear(),_.month=1+V.getMonth(),_.day=V.getDate(),_}}),$rt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,et.local.invalidYear||et.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),y<0&&y++,n.day()+(n.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var n=Math.floor(z/30)+1,i=z-(n-1)*30+1;return this.newDate(P,n,i)}}),et.calendars.coptic=f}),Hrt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),!1},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),13},daysInYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),400},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/8)+1},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return(i.day()+1)%8},weekDay:function(z,P,n){var i=this.dayOfWeek(z,P,n);return i>=2&&i<=6},extraInfo:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return{century:y[Math.floor((i.year()-1)/100)+1]||""}},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return z=i.year()+(i.year()<0?1:0),P=i.month(),n=i.day(),n+(P>1?16:0)+(P>2?(P-2)*32:0)+(z-1)*400+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z+.5)-Math.floor(this.jdEpoch)-1;var P=Math.floor(z/400)+1;z-=(P-1)*400,z+=z>15?16:0;var n=Math.floor(z/32)+1,i=z-(n-1)*32+1;return this.newDate(P<=0?P-1:P,n,i)}});var y={20:"Fruitbat",21:"Anchovy"};et.calendars.discworld=f}),Vrt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,et.local.invalidYear||et.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),y<0&&y++,n.day()+(n.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var n=Math.floor(z/30)+1,i=z-(n-1)*30+1;return this.newDate(P,n,i)}}),et.calendars.ethiopian=f}),Wrt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return this._leapYear(P.year())},_leapYear:function(z){return z=z<0?z+1:z,y(z*7+1,19)<7},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,et.local.invalidYear),this._leapYear(z.year?z.year():z)?13:12},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return z=P.year(),this.toJD(z===-1?1:z+1,7,1)-this.toJD(z,7,1)},daysInMonth:function(z,P){return z.year&&(P=z.month(),z=z.year()),this._validate(z,P,this.minDay,et.local.invalidMonth),P===12&&this.leapYear(z)||P===8&&y(this.daysInYear(z),10)===5?30:P===9&&y(this.daysInYear(z),10)===3?29:this.daysPerMonth[P-1]},weekDay:function(z,P,n){return this.dayOfWeek(z,P,n)!==6},extraInfo:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);z=i.year(),P=i.month(),n=i.day();var a=z<=0?z+1:z,l=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(P<7){for(var o=7;o<=this.monthsInYear(z);o++)l+=this.daysInMonth(z,o);for(var o=1;o=this.toJD(P===-1?1:P+1,7,1);)P++;for(var n=zthis.toJD(P,n,this.daysInMonth(P,n));)n++;var i=z-this.toJD(P,n,1)+1;return this.newDate(P,n,i)}});function y(z,P){return z-P*Math.floor(z/P)}et.calendars.hebrew=f}),qrt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,et.local.invalidYear);return(z.year()*11+14)%30<11},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(y){return this.leapYear(y)?355:354},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===12&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==5},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),z=n.month(),P=n.day(),y=y<=0?y+1:y,P+Math.ceil(29.5*(z-1))+(y-1)*354+Math.floor((3+11*y)/30)+this.jdEpoch-1},fromJD:function(y){y=Math.floor(y)+.5;var z=Math.floor((30*(y-this.jdEpoch)+10646)/10631);z=z<=0?z-1:z;var P=Math.min(12,Math.ceil((y-29-this.toJD(z,1,1))/29.5)+1),n=y-this.toJD(z,P,1)+1;return this.newDate(z,P,n)}}),et.calendars.islamic=f}),Grt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),P=z.year()<0?z.year()+1:z.year();return P%4===0},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,et.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===2&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);return y=n.year(),z=n.month(),P=n.day(),y<0&&y++,z<=2&&(y--,z+=12),Math.floor(365.25*(y+4716))+Math.floor(30.6001*(z+1))+P-1524.5},fromJD:function(y){var z=Math.floor(y+.5),P=z+1524,n=Math.floor((P-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((P-i)/30.6001),l=a-Math.floor(a<14?1:13),o=n-Math.floor(l>2?4716:4715),c=P-i-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,l,c)}}),et.calendars.julian=f}),Zrt=It(()=>{var et=A0(),Y=Yf();function f(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(P){return this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),!1},formatYear:function(P){var n=this._validate(P,this.minMonth,this.minDay,et.local.invalidYear);P=n.year();var i=Math.floor(P/400);P=P%400,P+=P<0?400:0;var a=Math.floor(P/20);return i+"."+a+"."+P%20},forYear:function(P){if(P=P.split("."),P.length<3)throw"Invalid Mayan year";for(var n=0,i=0;i19||i>0&&a<0)throw"Invalid Mayan year";n=n*20+a}return n},monthsInYear:function(P){return this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),18},weekOfYear:function(P,n,i){return this._validate(P,n,i,et.local.invalidDate),0},daysInYear:function(P){return this._validate(P,this.minMonth,this.minDay,et.local.invalidYear),360},daysInMonth:function(P,n){return this._validate(P,n,this.minDay,et.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(P,n,i){var a=this._validate(P,n,i,et.local.invalidDate);return a.day()},weekDay:function(P,n,i){return this._validate(P,n,i,et.local.invalidDate),!0},extraInfo:function(P,n,i){var a=this._validate(P,n,i,et.local.invalidDate),l=a.toJD(),o=this._toHaab(l),c=this._toTzolkin(l);return{haabMonthName:this.local.haabMonths[o[0]-1],haabMonth:o[0],haabDay:o[1],tzolkinDayName:this.local.tzolkinMonths[c[0]-1],tzolkinDay:c[0],tzolkinTrecena:c[1]}},_toHaab:function(P){P-=this.jdEpoch;var n=y(P+8+340,365);return[Math.floor(n/20)+1,y(n,20)]},_toTzolkin:function(P){return P-=this.jdEpoch,[z(P+20,20),z(P+4,13)]},toJD:function(P,n,i){var a=this._validate(P,n,i,et.local.invalidDate);return a.day()+a.month()*20+a.year()*360+this.jdEpoch},fromJD:function(P){P=Math.floor(P)+.5-this.jdEpoch;var n=Math.floor(P/360);P=P%360,P+=P<0?360:0;var i=Math.floor(P/20),a=P%20;return this.newDate(n,i,a)}});function y(P,n){return P-n*Math.floor(P/n)}function z(P,n){return y(P-1,n)+1}et.calendars.mayan=f}),Krt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar;var y=et.instance("gregorian");Y(f.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear||et.regionalOptions[""].invalidYear);return y.leapYear(P.year()+(P.year()<1?1:0)+1469)},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(1-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===12&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return(this.dayOfWeek(z,P,n)||7)<6},toJD:function(a,P,n){var i=this._validate(a,P,n,et.local.invalidMonth),a=i.year();a<0&&a++;for(var l=i.day(),o=1;o=this.toJD(P+1,1,1);)P++;for(var n=z-Math.floor(this.toJD(P,1,1)+.5)+1,i=1;n>this.daysInMonth(P,i);)n-=this.daysInMonth(P,i),i++;return this.newDate(P,i,n)}}),et.calendars.nanakshahi=f}),Yrt=It(()=>{var et=A0(),Y=Yf();function f(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(y){return this.daysInYear(y)!==this.daysPerYear},weekOfYear:function(y,z,P){var n=this.newDate(y,z,P);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,et.local.invalidYear);if(y=z.year(),typeof this.NEPALI_CALENDAR_DATA[y]>"u")return this.daysPerYear;for(var P=0,n=this.minMonth;n<=12;n++)P+=this.NEPALI_CALENDAR_DATA[y][n];return P},daysInMonth:function(y,z){return y.year&&(z=y.month(),y=y.year()),this._validate(y,z,this.minDay,et.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[y]>"u"?this.daysPerMonth[z-1]:this.NEPALI_CALENDAR_DATA[y][z]},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==6},toJD:function(y,z,P){var n=this._validate(y,z,P,et.local.invalidDate);y=n.year(),z=n.month(),P=n.day();var i=et.instance(),a=0,l=z,o=y;this._createMissingCalendarData(y);var c=y-(l>9||l===9&&P>=this.NEPALI_CALENDAR_DATA[o][0]?56:57);for(z!==9&&(a=P,l--);l!==9;)l<=0&&(l=12,o--),a+=this.NEPALI_CALENDAR_DATA[o][l],l--;return z===9?(a+=P-this.NEPALI_CALENDAR_DATA[o][0],a<0&&(a+=i.daysInYear(c))):a+=this.NEPALI_CALENDAR_DATA[o][9]-this.NEPALI_CALENDAR_DATA[o][0],i.newDate(c,1,1).add(a,"d").toJD()},fromJD:function(y){var z=et.instance(),P=z.fromJD(y),n=P.year(),i=P.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var l=9,o=this.NEPALI_CALENDAR_DATA[a][0],c=this.NEPALI_CALENDAR_DATA[a][l]-o+1;i>c;)l++,l>12&&(l=1,a++),c+=this.NEPALI_CALENDAR_DATA[a][l];var s=this.NEPALI_CALENDAR_DATA[a][l]-(c-i);return this.newDate(a,l,s)},_createMissingCalendarData:function(y){var z=this.daysPerMonth.slice(0);z.unshift(17);for(var P=y-1;P"u"&&(this.NEPALI_CALENDAR_DATA[P]=z)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),et.calendars.nepali=f}),Xrt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}function y(z){var P=z-475;z<0&&P++;var n=.242197,i=n*P,a=n*(P+1),l=i-Math.floor(i),o=a-Math.floor(a);return l>o}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return y(P.year())},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-((i.dayOfWeek()+1)%7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===12&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return this.dayOfWeek(z,P,n)!==5},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate);z=i.year(),P=i.month(),n=i.day();var a=0;if(z>0)for(var l=1;l0?z-1:z)*365+a+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z)+.5;var P=475+(z-this.toJD(475,1,1))/365.242197,n=Math.floor(P);n<=0&&n--,z>this.toJD(n,12,y(n)?30:29)&&(n++,n===0&&n++);var i=z-this.toJD(n,1,1)+1,a=i<=186?Math.ceil(i/31):Math.ceil((i-6)/30),l=z-this.toJD(n,a,1)+1;return this.newDate(n,a,l)}}),et.calendars.persian=f,et.calendars.jalali=f}),Jrt=It(()=>{var et=A0(),Y=Yf(),f=et.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new et.baseCalendar,Y(y.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(n){var P=this._validate(n,this.minMonth,this.minDay,et.local.invalidYear),n=this._t2gYear(P.year());return f.leapYear(n)},weekOfYear:function(a,P,n){var i=this._validate(a,this.minMonth,this.minDay,et.local.invalidYear),a=this._t2gYear(i.year());return f.weekOfYear(a,i.month(),i.day())},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===2&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return(this.dayOfWeek(z,P,n)||7)<6},toJD:function(a,P,n){var i=this._validate(a,P,n,et.local.invalidDate),a=this._t2gYear(i.year());return f.toJD(a,i.month(),i.day())},fromJD:function(z){var P=f.fromJD(z),n=this._g2tYear(P.year());return this.newDate(n,P.month(),P.day())},_t2gYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)},_g2tYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)}}),et.calendars.taiwan=y}),Qrt=It(()=>{var et=A0(),Y=Yf(),f=et.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new et.baseCalendar,Y(y.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(n){var P=this._validate(n,this.minMonth,this.minDay,et.local.invalidYear),n=this._t2gYear(P.year());return f.leapYear(n)},weekOfYear:function(a,P,n){var i=this._validate(a,this.minMonth,this.minDay,et.local.invalidYear),a=this._t2gYear(i.year());return f.weekOfYear(a,i.month(),i.day())},daysInMonth:function(z,P){var n=this._validate(z,P,this.minDay,et.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(n.month()===2&&this.leapYear(n.year())?1:0)},weekDay:function(z,P,n){return(this.dayOfWeek(z,P,n)||7)<6},toJD:function(a,P,n){var i=this._validate(a,P,n,et.local.invalidDate),a=this._t2gYear(i.year());return f.toJD(a,i.month(),i.day())},fromJD:function(z){var P=f.fromJD(z),n=this._g2tYear(P.year());return this.newDate(n,P.month(),P.day())},_t2gYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)},_g2tYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)}}),et.calendars.thai=y}),tnt=It(()=>{var et=A0(),Y=Yf();function f(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}f.prototype=new et.baseCalendar,Y(f.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,et.local.invalidYear);return this.daysInYear(P.year())===355},weekOfYear:function(z,P,n){var i=this.newDate(z,P,n);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(z){for(var P=0,n=1;n<=12;n++)P+=this.daysInMonth(z,n);return P},daysInMonth:function(z,P){for(var n=this._validate(z,P,this.minDay,et.local.invalidMonth),i=n.toJD()-24e5+.5,a=0,l=0;li)return y[a]-y[a-1];a++}return 30},weekDay:function(z,P,n){return this.dayOfWeek(z,P,n)!==5},toJD:function(z,P,n){var i=this._validate(z,P,n,et.local.invalidDate),a=12*(i.year()-1)+i.month()-15292,l=i.day()+y[a-1]-1;return l+24e5-.5},fromJD:function(z){for(var P=z-24e5+.5,n=0,i=0;iP);i++)n++;var a=n+15292,l=Math.floor((a-1)/12),o=l+1,c=a-12*l,s=P-y[n-1]+1;return this.newDate(o,c,s)},isValid:function(z,P,n){var i=et.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(z=z.year!=null?z.year:z,i=z>=1276&&z<=1500),i},_validate:function(z,P,n,i){var a=et.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),et.calendars.ummalqura=f;var y=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),ent=It((et,Y)=>{Y.exports=A0(),jrt(),Urt(),$rt(),Hrt(),Vrt(),Wrt(),qrt(),Grt(),Zrt(),Krt(),Yrt(),Xrt(),Jrt(),Qrt(),tnt()}),rnt=It((et,Y)=>{var f=ent(),y=jn(),z=Dr(),P=z.EPOCHJD,n=z.ONEDAY,i={valType:"enumerated",values:y.sortObjectKeys(f.calendars),editType:"calc",dflt:"gregorian"},a=function(I,M,p,g){var C={};return C[p]=i,y.coerce(I,M,C,p,g)},l=function(I,M,p,g){for(var C=0;C{Y.exports=rnt()}),int=It((et,Y)=>{var f=Dq();f.register([Rq(),jq(),Vq(),Kq(),Qq(),nG(),oG(),vG(),CG(),RG(),GG(),fK(),_K(),aY(),pY(),wY(),EY(),qY(),YY(),JY(),rX(),sX(),dX(),gX(),PX(),zX(),vQ(),IQ(),WQ(),XQ(),stt(),htt(),_tt(),Itt(),Btt(),Vtt(),aet(),det(),_et(),Het(),Xet(),rrt(),srt(),hrt(),grt(),Trt(),Lrt(),Nrt(),nnt()]),Y.exports=f});return int()})();/*! * pad-left * * Copyright (c) 2014-2015, Jon Schlinkert. @@ -3978,7 +3978,7 @@ maplibre-gl/dist/maplibre-gl.js: * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt *) -*/return window.Plotly=r,r})}(CT)),CT.exports}var VH=Cbt();const D1=_H(VH),tM=Unt({__proto__:null,default:D1},[VH]),Abt={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},Mbt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3"},Ebt={class:"flex items-center gap-2 sm:gap-3"},Lbt=["value"],Pbt={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},Ibt={class:"glass-card rounded-[15px] p-3 sm:p-6"},Dbt={class:"relative h-40 sm:h-48 rounded-lg p-2 sm:p-4"},zbt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},Obt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},Bbt={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 items-stretch"},Rbt={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},Fbt={class:"relative flex-1 min-h-[12rem] sm:min-h-[16rem] rounded-lg"},Nbt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},jbt={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},Ubt={class:"flex-1 flex flex-col justify-evenly"},$bt={key:0,class:"flex items-center justify-center flex-1"},Hbt={key:1,class:"flex items-center justify-center flex-1"},Vbt={class:"w-28 sm:w-32 text-sm text-content-secondary dark:text-content-primary/80 truncate"},Wbt={class:"flex-1 h-12 bg-background-mute dark:bg-stroke/10 rounded overflow-hidden"},qbt={class:"w-20 text-sm text-content-secondary dark:text-content-muted text-right tabular-nums"},Gbt={key:0,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Zbt={key:1,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Kbt={class:"text-content-secondary dark:text-content-muted text-sm"},Ybt=Cc({name:"StatisticsView",__name:"Statistics",setup(e){Av.register(aL,oL,nL,J2,eL,G$,Z$,xht,mH,vH,fH,aH,cH,iL,iS);const t=u4(),r=li(null),u=li(!1),T=()=>{const Yn=document.documentElement.classList.contains("dark");return{gridColor:Yn?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",tickColor:Yn?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)",legendColor:Yn?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:Yn?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)"}},$=li(B1("statistics_selectedHours",24)),K=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}];Fh($,Yn=>R1("statistics_selectedHours",Yn));const ct=li(null),yt=li(null),St=li([]),Ut=li(null),ne=li([]),pe=li(!0),me=li(null),we=li({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0,sparklines:!0}),Ce=li(!1),Ve=li(!1),kr=li(!1),It=li(null),rn=li(null),Lr=li(null),Mr=li(null),tn=li(null),Dn=li(null),Mn=li(null),Br=Ao(()=>{const Yn=t.packetStats;return Yn?{totalRx:Yn.total_packets||0,totalTx:Yn.transmitted_packets||0}:{totalRx:0,totalTx:0}}),Vn=(Yn,hi)=>{if(Yn.length===0)return[];const io=Math.round(hi*60*60*1e3/72),oo=new Map;return Yn.forEach(([xa,Ur])=>{let Sn=xa;xa>1e15?Sn=xa/1e3:xa>1e9&&xa<1e12&&(Sn=xa*1e3);const Hn=Math.floor(Sn/io)*io;oo.has(Hn)||oo.set(Hn,[]),oo.get(Hn).push(Ur)}),Array.from(oo.entries()).sort((xa,Ur)=>xa[0]-Ur[0]).map(([,xa])=>xa.reduce((Ur,Sn)=>Ur+Sn,0)/xa.length)},on=Ao(()=>{let Yn=[],hi=[];if(ct.value?.series){const aa=ct.value.series.find(oo=>oo.type==="rx_count"),io=ct.value.series.find(oo=>oo.type==="tx_count");aa?.data&&(Yn=Vn(aa.data,$.value)),io?.data&&(hi=Vn(io.data,$.value))}return{totalPackets:Yn,transmittedPackets:hi,droppedPackets:[]}}),pr=async()=>{try{pe.value=!0,me.value=null,await Promise.all([t.fetchPacketStats({hours:$.value}),t.fetchSystemStats()]),pe.value=!1,_r()}catch(Yn){me.value=Yn instanceof Error?Yn.message:"Failed to fetch data",pe.value=!1}},_r=async()=>{we.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0};const Yn=[Sr(),Dr(),nn(),Cn()];try{await Promise.allSettled(Yn),await sp(),!Mr.value||!tn.value?setTimeout(()=>{ta()},100):ta()}catch(hi){console.error("Error loading chart data:",hi)}},Sr=async()=>{try{const Yn=await bs.get("/metrics_graph_data",{hours:$.value,resolution:"average",metrics:"rx_count,tx_count"});Yn?.success&&(ct.value=Yn.data)}catch{ct.value=null}},Dr=async()=>{try{const Yn=await bs.get("/packet_type_graph_data",{hours:$.value,resolution:"average",types:"all"});if(Yn?.success&&Yn.data){const hi=Yn.data;St.value=hi.series||[]}}catch{St.value=[]}},nn=async()=>{try{const Yn=await bs.get("/route_stats",{hours:$.value});Yn?.success&&Yn.data&&(Ut.value=Yn.data)}catch{Ut.value=null}},Cn=async()=>{try{const Yn=await bs.get("/noise_floor_history",{hours:$.value});if(Yn.success&&Yn.data){const aa=Yn.data.history||[];Array.isArray(aa)&&aa.length>0&&(yt.value={chart_data:aa.map(io=>({timestamp:io.timestamp||Date.now()/1e3,noise_floor_dbm:io.noise_floor_dbm||io.noise_floor||-120}))},_i())}}catch{yt.value={chart_data:[]}}},Xn=()=>{we.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0},va(),Ce.value=!1,Ve.value=!1,kr.value=!1,pr()},_i=()=>{if(ne.value=[],yt.value?.chart_data&&yt.value.chart_data.length>0){const Yn=yt.value.chart_data;ne.value=Yn.map(hi=>({timestamp:hi.timestamp*1e3,snr:null,rssi:null,noiseFloor:hi.noise_floor_dbm}))}},ta=()=>{if(!u.value){u.value=!0;try{_a(),qi(),Bi(),Xi(),setTimeout(()=>{we.value={packetRate:!1,packetType:!1,noiseFloor:!1,routePie:!1,sparklines:!1},setTimeout(()=>{const Yn=ru(It.value),hi=ru(rn.value),aa=ru(Lr.value);Yn&&Yn.update("none"),hi&&hi.update("none"),aa&&aa.update("none")},50)},100)}catch(Yn){console.error("Error creating/updating charts:",Yn),va()}finally{u.value=!1}}},va=()=>{try{It.value&&(It.value.destroy(),It.value=null),rn.value&&(rn.value.destroy(),rn.value=null),Lr.value&&(Lr.value.destroy(),Lr.value=null),Mn.value&&D1.purge(Mn.value)}catch(Yn){console.error("Error destroying charts:",Yn)}},_a=()=>{if(!Mr.value)return;const Yn=Mr.value.getContext("2d");if(!Yn)return;let hi=[],aa=[];if(ct.value?.series){const Po=ct.value.series.find(Jo=>Jo.type==="rx_count"),Ys=ct.value.series.find(Jo=>Jo.type==="tx_count");Po?.data&&(hi=Po.data.map(([Jo,Ss])=>{let Us=Jo;return Jo>1e15?Us=Jo/1e3:Jo>1e12?Us=Jo:Jo>1e9?Us=Jo*1e3:Us=Date.now(),{x:Us,y:Ss}})),Ys?.data&&(aa=Ys.data.map(([Jo,Ss])=>{let Us=Jo;return Jo>1e15?Us=Jo/1e3:Jo>1e12?Us=Jo:Jo>1e9?Us=Jo*1e3:Us=Date.now(),{x:Us,y:Ss}}))}if(hi.length===0&&aa.length===0){Ce.value=!0;return}Ce.value=!1,It.value&&(It.value.destroy(),It.value=null);const oo=Math.round($.value*60*60*1e3/72),xa=Po=>{if(Po.length===0)return[];const Ys=new Map;return Po.forEach(Ss=>{const Us=Math.floor(Ss.x/oo)*oo;Ys.has(Us)||Ys.set(Us,[]),Ys.get(Us).push(Ss.y)}),Array.from(Ys.entries()).map(([Ss,Us])=>({x:Ss,y:Us.reduce((Ac,Ou)=>Ac+Ou,0)/Us.length})).sort((Ss,Us)=>Ss.x-Us.x)},Ur=(Po,Ys=3)=>{if(Po.lengthdp+Wf.y,0)/Ou.length;Jo.push({x:Po[Ss].x,y:Bu})}return Jo},Sn=Ur(xa(hi)),Hn=Ur(xa(aa)),Qa=[...Sn.map(Po=>Po.y),...Hn.map(Po=>Po.y)],Ha=Math.min(...Qa),qa=Math.max(...Qa),Mo=qa-Ha||qa*.1||.001,Wo=Math.max(0,Ha-Mo*.05),es=qa+Mo*.05;try{const Po=JSON.parse(JSON.stringify(Sn)),Ys=JSON.parse(JSON.stringify(Hn)),Jo=new Av(Yn,{type:"line",data:{datasets:[{label:"TX/hr",data:Ys,borderColor:"#F59E0B",backgroundColor:"#F59E0B",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:1},{label:"RX/hr",data:Po,borderColor:"#C084FC",backgroundColor:"#C084FC",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:2}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},title:{display:!1},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(Ss){const Us=Ss[0]?.parsed?.x;return Us==null?"":new Date(Us).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(Ss){const Us=Ss.dataset?.label||"",Ac=Ss.parsed?.y;return Ac==null?Us:`${Us}: ${Ac.toFixed(3)}`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:T().gridColor},ticks:{color:T().tickColor,callback:function(Ss){return typeof Ss=="number"?Ss.toFixed(3):Ss}},min:Wo,max:es}}}});It.value=j1(Jo)}catch(Po){console.error("Error creating packet rate chart:",Po),Ce.value=!0}},qi=()=>{if(!tn.value)return;const Yn=tn.value.getContext("2d");if(!Yn)return;const hi=[],aa=[],io=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(St.value.length>0)St.value.forEach(oo=>{const xa=oo.data?oo.data.reduce((Ur,Sn)=>Ur+Sn[1],0):0;xa>0&&(hi.push(oo.name.replace(/\([^)]*\)/g,"").trim()),aa.push(xa))});else{Ve.value=!0;return}Ve.value=!1,rn.value&&(rn.value.destroy(),rn.value=null);try{const oo=JSON.parse(JSON.stringify(hi)),xa=JSON.parse(JSON.stringify(aa)),Ur=new Av(Yn,{type:"bar",data:{labels:oo,datasets:[{data:xa,backgroundColor:io.slice(0,xa.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});rn.value=j1(Ur)}catch(oo){console.error("Error creating packet type chart:",oo),Ve.value=!0}},Bi=()=>{if(!Dn.value)return;const Yn=Dn.value.getContext("2d");if(!Yn)return;const hi=ne.value.map(Ha=>({x:Ha.timestamp,y:Ha.noiseFloor})).filter(Ha=>Ha.y!==null&&Ha.y!==void 0),aa=hi.map(Ha=>Ha.y),io=aa.length>0?Math.min(...aa):-120,oo=aa.length>0?Math.max(...aa):-110,xa=oo-io||1,Ur=io-xa*.05,Sn=oo+xa*.05;if(Lr.value)try{const Ha=ru(Lr.value),qa=JSON.parse(JSON.stringify(hi));Ha.data.datasets[0]&&(Ha.data.datasets[0].data=qa),Ha.update("active");return}catch{Lr.value.destroy(),Lr.value=null}const Hn=JSON.parse(JSON.stringify(hi)),Qa=new Av(Yn,{type:"scatter",data:{datasets:[{label:"Noise Floor (dBm)",data:Hn,borderWidth:0,backgroundColor:"rgba(245, 158, 11, 0.8)",pointRadius:3,pointHoverRadius:5,pointStyle:"circle"}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:T().legendColor,usePointStyle:!0,padding:20}},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(Ha){const qa=Ha[0]?.parsed?.x;return qa==null?"":new Date(qa).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(Ha){const qa=Ha.dataset?.label||"",Mo=Ha.parsed?.y;return Mo==null?qa:`${qa}: ${Mo.toFixed(1)} dBm`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:T().titleColor},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",callback:function(Ha){return typeof Ha=="number"?Ha.toFixed(1):Ha}},min:Ur,max:Sn}}}});Lr.value=j1(Qa)},Xi=()=>{if(!Mn.value)return;if(!Ut.value||!Ut.value.route_totals){kr.value=!0;return}kr.value=!1;const Yn=Ut.value.route_totals,hi=Object.keys(Yn),aa=Object.values(Yn),io=["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"];try{const oo=JSON.parse(JSON.stringify(hi)),xa=JSON.parse(JSON.stringify(aa)),Ur=xa.reduce((qa,Mo)=>qa+Mo,0),Sn=xa.map(qa=>qa/Ur*100),Hn=oo.map((qa,Mo)=>({type:"bar",name:qa,x:[Sn[Mo]],y:[""],orientation:"h",marker:{color:io[Mo%io.length]},text:Sn[Mo]>=5?`${qa} ${Sn[Mo].toFixed(0)}%`:"",textposition:"inside",textfont:{color:"white",size:11},hoverinfo:"none",insidetextanchor:"middle"})),Qa={paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:10,b:60,l:10,r:10},barmode:"stack",showlegend:!0,legend:{orientation:"h",x:0,y:-.3,xanchor:"left",font:{color:"rgba(255, 255, 255, 0.8)",size:10}},xaxis:{showgrid:!1,showticklabels:!1,zeroline:!1,range:[0,100]},yaxis:{showgrid:!1,showticklabels:!1,zeroline:!1},hovermode:!1,bargap:0},Ha={responsive:!0,displayModeBar:!1,staticPlot:!0};D1.newPlot(Mn.value,Hn,Qa,Ha)}catch(oo){console.error("Error creating route treemap chart:",oo),kr.value=!0}};return Xd(async()=>{await sp(),pr(),r.value=window.setInterval(pr,3e4),window.addEventListener("resize",()=>{setTimeout(()=>{ru(It.value)?.resize(),ru(rn.value)?.resize(),ru(Lr.value)?.resize(),Mn.value&&D1.Plots&&D1.Plots.resize(Mn.value)},100)})}),Tg(()=>{r.value&&clearInterval(r.value),It.value?.destroy(),rn.value?.destroy(),Lr.value?.destroy(),Mn.value&&D1.purge(Mn.value),window.removeEventListener("resize",()=>{})}),(Yn,hi)=>(Or(),Nr("div",Abt,[At("div",Mbt,[hi[2]||(hi[2]=At("h2",{class:"text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary"},"Statistics",-1)),At("div",Ebt,[hi[1]||(hi[1]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Time Range:",-1)),Ml(At("select",{"onUpdate:modelValue":hi[0]||(hi[0]=aa=>$.value=aa),onChange:Xn,class:"bg-white dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-2 sm:px-3 py-1.5 sm:py-2 text-content-primary dark:text-content-primary text-xs sm:text-sm focus:outline-hidden focus:border-primary dark:focus:border-accent-purple/50 transition-colors"},[(Or(),Nr(Es,null,jl(K,aa=>At("option",{key:aa.value,value:aa.value,class:"bg-white dark:bg-gray-800 text-content-primary dark:text-content-primary"},yn(aa.label),9,Lbt)),64))],544),[[xg,$.value]])])]),At("div",Pbt,[Vs(S2,{title:"Total RX",value:Br.value.totalRx,color:"#AAE8E8",data:on.value.totalPackets,loading:we.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),Vs(S2,{title:"Total TX",value:Br.value.totalTx,color:"#FFC246",data:on.value.transmittedPackets,loading:we.value.sparklines,variant:"classic"},null,8,["value","data","loading"])]),At("div",Ibt,[hi[6]||(hi[6]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Performance Metrics",-1)),At("div",null,[hi[5]||(hi[5]=Du('

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
',2)),At("div",Dbt,[At("canvas",{ref_key:"packetRateCanvasRef",ref:Mr,class:"w-full h-full relative z-10"},null,512),we.value.packetRate?(Or(),Nr("div",zbt,hi[3]||(hi[3]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-purple-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading packet rate data...")],-1)]))):Ta("",!0),Ce.value&&!we.value.packetRate?(Or(),Nr("div",Obt,hi[4]||(hi[4]=[At("div",{class:"text-center"},[At("div",{class:"text-red-600 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Packet rate data not found")],-1)]))):Ta("",!0)])])]),At("div",Bbt,[At("div",Rbt,[hi[8]||(hi[8]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"}," Noise Floor Over Time ",-1)),At("div",Fbt,[At("canvas",{ref_key:"signalMetricsCanvasRef",ref:Dn,class:"w-full h-full"},null,512),we.value.noiseFloor?(Or(),Nr("div",Nbt,hi[7]||(hi[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-amber-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading noise floor data...")],-1)]))):Ta("",!0)])]),At("div",jbt,[hi[11]||(hi[11]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Route Distribution",-1)),At("div",Ubt,[we.value.routePie?(Or(),Nr("div",$bt,hi[9]||(hi[9]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading route data...")],-1)]))):kr.value?(Or(),Nr("div",Hbt,hi[10]||(hi[10]=[At("div",{class:"text-center"},[At("div",{class:"text-red-600 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Route statistics not found")],-1)]))):Ut.value?.route_totals?(Or(!0),Nr(Es,{key:2},jl(Ut.value.route_totals,(aa,io,oo)=>(Or(),Nr("div",{key:io,class:"flex items-center gap-3"},[At("div",Vbt,yn(io),1),At("div",Wbt,[At("div",{class:"h-full rounded transition-all duration-300",style:Sp({width:`${aa/Math.max(...Object.values(Ut.value.route_totals))*100}%`,backgroundColor:["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"][oo%5]})},null,4)]),At("div",qbt,yn(aa.toLocaleString()),1)]))),128)):Ta("",!0)])])]),pe.value?(Or(),Nr("div",Gbt,hi[12]||(hi[12]=[At("div",{class:"text-content-secondary dark:text-content-muted mb-2 text-sm"},"Loading statistics...",-1),At("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-gray-600 dark:border-t-white/70 rounded-full mx-auto"},null,-1)]))):Ta("",!0),me.value?(Or(),Nr("div",Zbt,[hi[13]||(hi[13]=At("div",{class:"text-red-600 dark:text-red-400 mb-2 text-sm"},"Failed to load statistics",-1)),At("p",Kbt,yn(me.value),1),At("button",{onClick:pr,class:"mt-4 px-4 py-2 bg-primary/80 dark:bg-accent-purple/20 hover:bg-primary/90 dark:hover:bg-accent-purple/30 text-white rounded-lg border border-primary dark:border-accent-purple/50 transition-colors"}," Retry ")])):Ta("",!0)]))}}),Xbt=vh(Ybt,[["__scopeId","data-v-b3c77d0f"]]),Jbt="modulepreload",Qbt=function(e){return"/"+e},EF={},P5=function(t,r,u){let T=Promise.resolve();if(r&&r.length>0){let St=function(Ut){return Promise.all(Ut.map(ne=>Promise.resolve(ne).then(pe=>({status:"fulfilled",value:pe}),pe=>({status:"rejected",reason:pe}))))};var K=St;document.getElementsByTagName("link");const ct=document.querySelector("meta[property=csp-nonce]"),yt=ct?.nonce||ct?.getAttribute("nonce");T=St(r.map(Ut=>{if(Ut=Qbt(Ut),Ut in EF)return;EF[Ut]=!0;const ne=Ut.endsWith(".css"),pe=ne?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${Ut}"]${pe}`))return;const me=document.createElement("link");if(me.rel=ne?"stylesheet":Jbt,ne||(me.as="script"),me.crossOrigin="",me.href=Ut,yt&&me.setAttribute("nonce",yt),document.head.appendChild(me),ne)return new Promise((we,Ce)=>{me.addEventListener("load",we),me.addEventListener("error",()=>Ce(new Error(`Unable to preload CSS for ${Ut}`)))})}))}function $(ct){const yt=new Event("vite:preloadError",{cancelable:!0});if(yt.payload=ct,window.dispatchEvent(yt),!yt.defaultPrevented)throw ct}return T.then(ct=>{for(const yt of ct||[])yt.status==="rejected"&&$(yt.reason);return t().catch($)})},t2t={class:"p-6 space-y-6"},e2t={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},r2t={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},n2t={class:"glass-card rounded-[15px] p-6"},i2t={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},a2t={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},o2t={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},s2t={key:0,class:"grid grid-cols-2 gap-4 text-sm"},l2t={class:"text-content-primary dark:text-content-primary font-semibold"},c2t={class:"text-content-primary dark:text-content-primary font-semibold"},u2t={class:"text-content-primary dark:text-content-primary font-semibold"},h2t={class:"text-content-primary dark:text-content-primary font-semibold"},d2t={class:"glass-card rounded-[15px] p-6"},f2t={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},p2t={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},m2t={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},g2t={key:0,class:"grid grid-cols-2 gap-4 text-sm"},v2t={class:"text-content-primary dark:text-content-primary font-semibold"},y2t={class:"text-content-primary dark:text-content-primary font-semibold"},_2t={class:"text-content-primary dark:text-content-primary font-semibold"},x2t={class:"text-content-primary dark:text-content-primary font-semibold"},b2t={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},w2t={class:"glass-card rounded-[15px] p-6"},k2t={class:"relative h-48"},T2t={key:0,class:"grid grid-cols-3 gap-4 text-sm mt-4"},S2t={class:"text-center"},C2t={class:"text-content-primary dark:text-content-primary font-semibold"},A2t={class:"text-center"},M2t={class:"font-semibold text-red-500 dark:text-red-400"},E2t={class:"text-center"},L2t={class:"font-semibold text-green-700 dark:text-green-400"},P2t={class:"glass-card rounded-[15px] p-6"},I2t={key:0,class:"space-y-4"},D2t={class:"grid grid-cols-2 gap-4 text-sm"},z2t={class:"text-content-primary dark:text-content-primary font-semibold"},O2t={class:"text-content-primary dark:text-content-primary font-semibold"},B2t={class:"text-content-primary dark:text-content-primary font-semibold"},R2t={class:"text-content-primary dark:text-content-primary font-semibold"},F2t={key:0,class:"pt-4 border-t border-stroke-subtle dark:border-stroke/10"},N2t={class:"grid grid-cols-2 gap-2 text-sm"},j2t={class:"text-content-secondary dark:text-content-muted"},U2t={class:"text-content-primary dark:text-content-primary font-semibold ml-1"},$2t={class:"glass-card rounded-[15px] p-6"},H2t={key:0,class:"overflow-x-auto"},V2t={class:"w-full text-sm"},W2t={class:"text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},q2t={class:"text-content-primary dark:text-content-primary font-semibold py-2 transition-all duration-300"},G2t={class:"text-center text-orange-500 dark:text-orange-400 py-2 transition-all duration-300"},Z2t={class:"text-center text-green-700 dark:text-green-400 py-2 transition-all duration-300"},K2t={class:"text-right text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},Y2t={key:0,class:"mt-4 text-center text-content-secondary dark:text-content-muted text-sm transition-all duration-300"},X2t={key:1,class:"text-center text-content-secondary dark:text-content-muted py-8"},J2t={key:0,class:"glass-card rounded-[15px] p-8 text-center"},Q2t={key:1,class:"glass-card rounded-[15px] p-8 text-center"},twt={class:"text-content-secondary dark:text-content-muted text-sm"},ewt=Cc({name:"SystemStatsView",__name:"SystemStats",setup(e){Av.register(aL,oL,nL,J2,eL,G$,Z$,mH,vH,fH,aH,cH,iL,iS);const t=li(null),r=li(!0),u=li(null),T=li(null),$=li(null),K=li([]),ct=li(null),yt=li({cpuChart:!0,memoryChart:!0,diskChart:!1,processChart:!0}),St=li(!1),Ut=li(!1),ne=li(null),pe=li(null),me=li(null),we=li(null),Ce=li(null),Ve=Ao(()=>T.value?{cpuUsage:T.value.cpu.usage_percent,memoryUsage:T.value.memory.usage_percent,diskUsage:T.value.disk.usage_percent,uptime:T.value.system.uptime}:{cpuUsage:0,memoryUsage:0,diskUsage:0,uptime:0}),kr=Ao(()=>K.value.length===0?{cpu:[],memory:[],disk:[],network:[]}:{cpu:K.value.map(Sr=>Sr.cpu.usage_percent),memory:K.value.map(Sr=>Sr.memory.usage_percent),disk:K.value.map(Sr=>Sr.disk.usage_percent),network:K.value.map(Sr=>Sr.network.bytes_recv/1024/1024)}),It=Sr=>{const Dr=["B","KB","MB","GB","TB"];if(Sr===0)return"0 B";const nn=Math.floor(Math.log(Sr)/Math.log(1024));return parseFloat((Sr/Math.pow(1024,nn)).toFixed(2))+" "+Dr[nn]},rn=Sr=>{const Dr=Math.floor(Sr/86400),nn=Math.floor(Sr%86400/3600),Cn=Math.floor(Sr%3600/60);return Dr>0?`${Dr}d ${nn}h ${Cn}m`:nn>0?`${nn}h ${Cn}m`:`${Cn}m`},Lr=async()=>{try{const Sr=await bs.get("/hardware_stats");if(Sr?.success&&Sr.data){const Dr=Sr.data;if(T.value=Dr,K.value.length===0)for(let Cn=0;Cn<12;Cn++)K.value.push(JSON.parse(JSON.stringify(Dr)));else K.value.push(Dr),K.value.length>20&&K.value.shift()}}catch(Sr){console.error("Failed to fetch hardware stats:",Sr),u.value="Failed to fetch hardware stats"}},Mr=async()=>{try{const Sr=await bs.get("/hardware_processes");Sr?.success&&Sr.data&&(ct.value=$.value,$.value=Sr.data)}catch(Sr){console.error("Failed to fetch process stats:",Sr)}},tn=(Sr,Dr)=>{if(!ct.value)return!1;const nn=ct.value.processes.find(Cn=>Cn.pid===Sr.pid);return nn?nn[Dr]!==Sr[Dr]:!0},Dn=async()=>{try{r.value=!0,u.value=null,await Promise.all([Lr(),Mr()]),r.value=!1,await sp(),Mn()}catch(Sr){u.value=Sr instanceof Error?Sr.message:"Failed to fetch system data",r.value=!1}},Mn=()=>{T.value&&(Br(),Vn(),on())},Br=()=>{if(!me.value||!T.value){yt.value.cpuChart=!1;return}const Sr=me.value.getContext("2d");if(!Sr){yt.value.cpuChart=!1;return}const Dr=T.value.cpu.usage_percent,nn=100-Dr;if(ne.value)try{ne.value.data.datasets[0].data=[Dr,nn],ne.value.update("none");return}catch(va){console.warn("Failed to update CPU chart, recreating...",va),ne.value.destroy(),ne.value=null}const Cn=document.documentElement.classList.contains("dark"),Xn=Cn?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",_i=Cn?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)",ta=Cn?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)";try{const va=new Av(Sr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Dr,nn],backgroundColor:["#FFC246",Xn],borderColor:["#FFC246",_i],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(_a){return`${_a.label}: ${_a.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(_a){const qi=_a.ctx;qi.save();const Bi=(_a.chartArea.left+_a.chartArea.right)/2,Xi=(_a.chartArea.top+_a.chartArea.bottom)/2;qi.textAlign="center",qi.textBaseline="middle",qi.fillStyle="#FFC246",qi.font="bold 18px sans-serif",qi.fillText(`${Dr.toFixed(1)}%`,Bi,Xi-5),qi.fillStyle=ta,qi.font="10px sans-serif",qi.fillText("CPU",Bi,Xi+12),qi.restore()}}]});ne.value=j1(va),St.value=!1,yt.value.cpuChart=!1}catch(va){console.error("Error creating CPU chart:",va),St.value=!0,yt.value.cpuChart=!1}},Vn=()=>{if(!we.value||!T.value){yt.value.memoryChart=!1;return}const Sr=we.value.getContext("2d");if(!Sr){yt.value.memoryChart=!1;return}const Dr=T.value.memory.usage_percent,nn=100-Dr;if(pe.value)try{pe.value.data.datasets[0].data=[Dr,nn],pe.value.update("none");return}catch(va){console.warn("Failed to update Memory chart, recreating...",va),pe.value.destroy(),pe.value=null}const Cn=document.documentElement.classList.contains("dark"),Xn=Cn?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",_i=Cn?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)",ta=Cn?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)";try{const va=new Av(Sr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Dr,nn],backgroundColor:["#A5E5B6",Xn],borderColor:["#A5E5B6",_i],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(_a){return`${_a.label}: ${_a.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(_a){const qi=_a.ctx;qi.save();const Bi=(_a.chartArea.left+_a.chartArea.right)/2,Xi=(_a.chartArea.top+_a.chartArea.bottom)/2;qi.textAlign="center",qi.textBaseline="middle",qi.fillStyle="#A5E5B6",qi.font="bold 18px sans-serif",qi.fillText(`${Dr.toFixed(1)}%`,Bi,Xi-5),qi.fillStyle=ta,qi.font="10px sans-serif",qi.fillText("Memory",Bi,Xi+12),qi.restore()}}]});pe.value=j1(va),Ut.value=!1,yt.value.memoryChart=!1}catch(va){console.error("Error creating Memory chart:",va),Ut.value=!0,yt.value.memoryChart=!1}},on=()=>{if(!Ce.value||!T.value)return;const Dr=document.documentElement.classList.contains("dark")?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)";try{P5(()=>Promise.resolve().then(()=>tM),void 0).then(nn=>{const Cn=nn.default||nn,Xn=T.value.disk,_i=[{type:"pie",labels:["Used","Free"],values:[Xn.used,Xn.free],marker:{colors:["#FB787B","#A5E5B6"]},hovertemplate:"%{label}
Size: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",hole:.4}],ta={title:{text:"",font:{color:Dr}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:Dr,size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:Dr,size:10}}},va={responsive:!0,displayModeBar:!1,staticPlot:!1};Cn.newPlot(Ce.value,_i,ta,va)})}catch(nn){console.error("Error creating disk chart:",nn)}},pr=()=>{try{if(ne.value&&(ne.value.destroy(),ne.value=null),pe.value&&(pe.value.destroy(),pe.value=null),Ce.value)try{P5(()=>Promise.resolve().then(()=>tM),void 0).then(Sr=>{const Dr=Sr?.default||Sr;Dr?.purge&&Dr.purge(Ce.value)}).catch(()=>{})}catch{}}catch(Sr){console.error("Error destroying charts:",Sr)}},_r=new MutationObserver(Sr=>{Sr.forEach(Dr=>{Dr.attributeName==="class"&&(pr(),sp(()=>{Mn()}))})});return Xd(async()=>{await sp(),Dn(),t.value=window.setInterval(Dn,5e3),_r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",()=>{setTimeout(()=>{ru(ne.value)?.resize(),ru(pe.value)?.resize();try{P5(()=>Promise.resolve().then(()=>tM),void 0).then(Sr=>{const Dr=Sr?.default||Sr;Dr?.Plots&&Dr.Plots.resize(Ce.value)}).catch(()=>{})}catch{}},100)})}),Tg(()=>{t.value&&clearInterval(t.value),_r.disconnect(),pr(),window.removeEventListener("resize",()=>{})}),(Sr,Dr)=>(Or(),Nr("div",t2t,[Dr[28]||(Dr[28]=At("div",{class:"flex justify-between items-center"},[At("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"System Statistics"),At("div",{class:"text-content-secondary dark:text-content-muted text-sm"}," Updates every 5 seconds ")],-1)),At("div",e2t,[Vs(S2,{title:"CPU Usage",value:`${Ve.value.cpuUsage.toFixed(1)}%`,color:"#FFC246",data:kr.value.cpu},null,8,["value","data"]),Vs(S2,{title:"Memory Usage",value:`${Ve.value.memoryUsage.toFixed(1)}%`,color:"#A5E5B6",data:kr.value.memory},null,8,["value","data"]),Vs(S2,{title:"Disk Usage",value:`${Ve.value.diskUsage.toFixed(1)}%`,color:"#FB787B",data:kr.value.disk},null,8,["value","data"]),Vs(S2,{title:"Uptime",value:rn(Ve.value.uptime),color:"#EBA0FC",data:kr.value.network},null,8,["value","data"])]),At("div",r2t,[At("div",n2t,[Dr[6]||(Dr[6]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"CPU Performance",-1)),At("div",i2t,[At("canvas",{ref_key:"cpuCanvasRef",ref:me,class:"w-full h-full relative z-10"},null,512),yt.value.cpuChart?(Or(),Nr("div",a2t,Dr[0]||(Dr[0]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-orange-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading CPU data...")],-1)]))):Ta("",!0),St.value&&!yt.value.cpuChart?(Or(),Nr("div",o2t,Dr[1]||(Dr[1]=[At("div",{class:"text-center"},[At("div",{class:"text-red-500 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"CPU data not found")],-1)]))):Ta("",!0)]),T.value?(Or(),Nr("div",s2t,[At("div",null,[Dr[2]||(Dr[2]=At("div",{class:"text-content-secondary dark:text-content-muted"},"CPU Count",-1)),At("div",l2t,yn(T.value.cpu.count)+" cores",1)]),At("div",null,[Dr[3]||(Dr[3]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Frequency",-1)),At("div",c2t,yn(T.value.cpu.frequency.toFixed(0))+" MHz",1)]),At("div",null,[Dr[4]||(Dr[4]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Load (1m)",-1)),At("div",u2t,yn(T.value.cpu.load_avg["1min"].toFixed(2)),1)]),At("div",null,[Dr[5]||(Dr[5]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Load (5m)",-1)),At("div",h2t,yn(T.value.cpu.load_avg["5min"].toFixed(2)),1)])])):Ta("",!0)]),At("div",d2t,[Dr[13]||(Dr[13]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Memory Usage",-1)),At("div",f2t,[At("canvas",{ref_key:"memoryCanvasRef",ref:we,class:"w-full h-full relative z-10"},null,512),yt.value.memoryChart?(Or(),Nr("div",p2t,Dr[7]||(Dr[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading memory data...")],-1)]))):Ta("",!0),Ut.value&&!yt.value.memoryChart?(Or(),Nr("div",m2t,Dr[8]||(Dr[8]=[At("div",{class:"text-center"},[At("div",{class:"text-red-500 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Memory data not found")],-1)]))):Ta("",!0)]),T.value?(Or(),Nr("div",g2t,[At("div",null,[Dr[9]||(Dr[9]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Total",-1)),At("div",v2t,yn(It(T.value.memory.total)),1)]),At("div",null,[Dr[10]||(Dr[10]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Used",-1)),At("div",y2t,yn(It(T.value.memory.used)),1)]),At("div",null,[Dr[11]||(Dr[11]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Available",-1)),At("div",_2t,yn(It(T.value.memory.available)),1)]),At("div",null,[Dr[12]||(Dr[12]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Usage",-1)),At("div",x2t,yn(T.value.memory.usage_percent.toFixed(1))+"%",1)])])):Ta("",!0)])]),At("div",b2t,[At("div",w2t,[Dr[17]||(Dr[17]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Storage Usage",-1)),At("div",k2t,[At("div",{ref_key:"diskCanvasRef",ref:Ce,class:"w-full h-full"},null,512)]),T.value?(Or(),Nr("div",T2t,[At("div",S2t,[Dr[14]||(Dr[14]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Total",-1)),At("div",C2t,yn(It(T.value.disk.total)),1)]),At("div",A2t,[Dr[15]||(Dr[15]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Used",-1)),At("div",M2t,yn(It(T.value.disk.used)),1)]),At("div",E2t,[Dr[16]||(Dr[16]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Free",-1)),At("div",L2t,yn(It(T.value.disk.free)),1)])])):Ta("",!0)]),At("div",P2t,[Dr[23]||(Dr[23]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Network Statistics",-1)),T.value?(Or(),Nr("div",I2t,[At("div",D2t,[At("div",null,[Dr[18]||(Dr[18]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Bytes Sent",-1)),At("div",z2t,yn(It(T.value.network.bytes_sent)),1)]),At("div",null,[Dr[19]||(Dr[19]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Bytes Received",-1)),At("div",O2t,yn(It(T.value.network.bytes_recv)),1)]),At("div",null,[Dr[20]||(Dr[20]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Packets Sent",-1)),At("div",B2t,yn(T.value.network.packets_sent.toLocaleString()),1)]),At("div",null,[Dr[21]||(Dr[21]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Packets Received",-1)),At("div",R2t,yn(T.value.network.packets_recv.toLocaleString()),1)])]),T.value.temperatures&&Object.keys(T.value.temperatures).length>0?(Or(),Nr("div",F2t,[Dr[22]||(Dr[22]=At("div",{class:"text-content-secondary dark:text-content-muted mb-2"},"System Temperatures",-1)),At("div",N2t,[(Or(!0),Nr(Es,null,jl(T.value.temperatures,(nn,Cn)=>(Or(),Nr("div",{key:Cn},[At("span",j2t,yn(Cn)+":",1),At("span",U2t,yn(nn.toFixed(1))+"°C",1)]))),128))])])):Ta("",!0)])):Ta("",!0)])]),At("div",$2t,[Dr[25]||(Dr[25]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Top Processes",-1)),$.value?.processes&&$.value.processes.length>0?(Or(),Nr("div",H2t,[At("table",V2t,[Dr[24]||(Dr[24]=At("thead",null,[At("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[At("th",{class:"text-left text-content-secondary dark:text-content-muted py-2"},"PID"),At("th",{class:"text-left text-content-secondary dark:text-content-muted py-2"},"Name"),At("th",{class:"text-center text-content-secondary dark:text-content-muted py-2"},"CPU %"),At("th",{class:"text-center text-content-secondary dark:text-content-muted py-2"},"Memory %"),At("th",{class:"text-right text-content-secondary dark:text-content-muted py-2"},"Memory")])],-1)),At("tbody",null,[(Or(!0),Nr(Es,null,jl($.value.processes.slice(0,10),nn=>(Or(),Nr("tr",{key:nn.pid,class:"border-b border-stroke-subtle dark:border-white/5 process-row"},[At("td",W2t,yn(nn.pid),1),At("td",q2t,yn(nn.name),1),At("td",G2t,[At("span",{class:ja(["cpu-value",{"value-updated":tn(nn,"cpu_percent")}])},yn(nn.cpu_percent.toFixed(1))+"% ",3)]),At("td",Z2t,[At("span",{class:ja(["memory-value",{"value-updated":tn(nn,"memory_percent")}])},yn(nn.memory_percent.toFixed(1))+"% ",3)]),At("td",K2t,[At("span",{class:ja({"value-updated":tn(nn,"memory_mb")})},yn(nn.memory_mb.toFixed(1))+" MB ",3)])]))),128))])]),$.value.total_processes?(Or(),Nr("div",Y2t," Showing top 10 of "+yn($.value.total_processes)+" total processes ",1)):Ta("",!0)])):r.value?Ta("",!0):(Or(),Nr("div",X2t," No process data available "))]),r.value?(Or(),Nr("div",J2t,Dr[26]||(Dr[26]=[At("div",{class:"text-content-secondary dark:text-content-muted mb-2"},"Loading system statistics...",-1),At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-gray-900 dark:border-t-white/70 rounded-full mx-auto"},null,-1)]))):Ta("",!0),u.value?(Or(),Nr("div",Q2t,[Dr[27]||(Dr[27]=At("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load system statistics",-1)),At("p",twt,yn(u.value),1),At("button",{onClick:Dn,class:"mt-4 px-4 py-2 bg-purple-500/20 dark:bg-accent-purple/20 hover:bg-purple-500/30 dark:hover:bg-accent-purple/30 text-content-primary dark:text-content-primary rounded-lg border border-purple-500/50 dark:border-accent-purple/50 transition-colors"}," Retry ")])):Ta("",!0)]))}}),rwt=vh(ewt,[["__scopeId","data-v-eab6d04d"]]),nwt={class:"space-y-4"},iwt={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500/50 rounded-lg p-3"},awt={class:"text-green-600 dark:text-green-400 text-sm"},owt={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500/50 rounded-lg p-3"},swt={class:"text-red-600 dark:text-red-400 text-sm"},lwt={class:"flex justify-end gap-2"},cwt=["disabled"],uwt=["disabled"],hwt={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},dwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},fwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},pwt={key:1,class:"flex items-center gap-2"},mwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},gwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},vwt={key:1},ywt=["value"],_wt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},xwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},bwt={key:1},wwt=["value"],kwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Twt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Swt={key:1,class:"flex items-center gap-2"},Cwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Awt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Mwt={key:1},Ewt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},Lwt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Pwt={key:2,class:"bg-yellow-500/10 dark:bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3"},Iwt=Cc({__name:"RadioSettings",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config?.radio||{}),u=li(!1),T=li(!1),$=li(null),K=li(null),ct=li(0),yt=li(0),St=li(0),Ut=li(0),ne=li(0),pe=li(0),me=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}];Fh(r,Dn=>{Dn&&!u.value&&(ct.value=Dn.frequency?Number((Dn.frequency/1e6).toFixed(3)):0,yt.value=Dn.spreading_factor??0,St.value=Dn.bandwidth?Number((Dn.bandwidth/1e3).toFixed(1)):0,Ut.value=Dn.tx_power??0,ne.value=Dn.coding_rate??0,pe.value=Dn.preamble_length??0)},{immediate:!0});const we=Ao(()=>{const Dn=r.value.frequency;return Dn?(Dn/1e6).toFixed(3)+" MHz":"Not set"}),Ce=Ao(()=>{const Dn=r.value.bandwidth;return Dn?(Dn/1e3).toFixed(1)+" kHz":"Not set"}),Ve=Ao(()=>{const Dn=r.value.tx_power;return Dn!==void 0?Dn+" dBm":"Not set"}),kr=Ao(()=>{const Dn=r.value.coding_rate;return Dn?"4/"+Dn:"Not set"}),It=Ao(()=>{const Dn=r.value.preamble_length;return Dn?Dn+" symbols":"Not set"}),rn=Ao(()=>r.value.spreading_factor??"Not set"),Lr=()=>{u.value=!0,$.value=null,K.value=null},Mr=()=>{u.value=!1,$.value=null;const Dn=r.value;ct.value=Dn.frequency?Number((Dn.frequency/1e6).toFixed(3)):0,yt.value=Dn.spreading_factor??0,St.value=Dn.bandwidth?Number((Dn.bandwidth/1e3).toFixed(1)):0,Ut.value=Dn.tx_power??0,ne.value=Dn.coding_rate??0,pe.value=Dn.preamble_length??0},tn=async()=>{T.value=!0,$.value=null,K.value=null;try{const Dn={};ct.value&&(Dn.frequency=ct.value*1e6),yt.value&&(Dn.spreading_factor=yt.value),St.value&&(Dn.bandwidth=St.value*1e3),Ut.value&&(Dn.tx_power=Ut.value),ne.value&&(Dn.coding_rate=ne.value);const Br=(await bs.post("/update_radio_config",Dn)).data;Br.message||Br.persisted?(K.value=Br.message||"Settings saved successfully",u.value=!1,await t.fetchStats(),setTimeout(()=>{K.value=null},3e3)):Br.error?$.value=Br.error:$.value="Unknown response from server"}catch(Dn){console.error("Failed to update radio settings:",Dn);const Mn=Dn;$.value=Mn.response?.data?.error||"Failed to update settings"}finally{T.value=!1}};return(Dn,Mn)=>(Or(),Nr("div",nwt,[K.value?(Or(),Nr("div",iwt,[At("p",awt,yn(K.value),1)])):Ta("",!0),$.value?(Or(),Nr("div",owt,[At("p",swt,yn($.value),1)])):Ta("",!0),At("div",lwt,[u.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:Mr,disabled:T.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,cwt),At("button",{onClick:tn,disabled:T.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(T.value?"Saving...":"Save Changes"),9,uwt)],64)):(Or(),Nr("button",{key:0,onClick:Lr,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",hwt,[At("div",dwt,[Mn[6]||(Mn[6]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Frequency",-1)),u.value?(Or(),Nr("div",pwt,[Ml(At("input",{"onUpdate:modelValue":Mn[0]||(Mn[0]=Br=>ct.value=Br),type:"number",step:"0.001",min:"100",max:"1000",class:"w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[lu,ct.value,void 0,{number:!0}]]),Mn[5]||(Mn[5]=At("span",{class:"text-content-muted dark:text-content-muted text-sm"},"MHz",-1))])):(Or(),Nr("div",fwt,yn(we.value),1))]),At("div",mwt,[Mn[7]||(Mn[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Spreading Factor",-1)),u.value?(Or(),Nr("div",vwt,[Ml(At("select",{"onUpdate:modelValue":Mn[1]||(Mn[1]=Br=>yt.value=Br),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},[(Or(),Nr(Es,null,jl([5,6,7,8,9,10,11,12],Br=>At("option",{key:Br,value:Br},yn(Br),9,ywt)),64))],512),[[xg,yt.value,void 0,{number:!0}]])])):(Or(),Nr("div",gwt,yn(rn.value),1))]),At("div",_wt,[Mn[8]||(Mn[8]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Bandwidth",-1)),u.value?(Or(),Nr("div",bwt,[Ml(At("select",{"onUpdate:modelValue":Mn[2]||(Mn[2]=Br=>St.value=Br),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},[(Or(),Nr(Es,null,jl(me,Br=>At("option",{key:Br.value,value:Br.value},yn(Br.label),9,wwt)),64))],512),[[xg,St.value,void 0,{number:!0}]])])):(Or(),Nr("div",xwt,yn(Ce.value),1))]),At("div",kwt,[Mn[10]||(Mn[10]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"TX Power",-1)),u.value?(Or(),Nr("div",Swt,[Ml(At("input",{"onUpdate:modelValue":Mn[3]||(Mn[3]=Br=>Ut.value=Br),type:"number",min:"2",max:"30",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[lu,Ut.value,void 0,{number:!0}]]),Mn[9]||(Mn[9]=At("span",{class:"text-content-muted dark:text-content-muted text-sm"},"dBm",-1))])):(Or(),Nr("div",Twt,yn(Ve.value),1))]),At("div",Cwt,[Mn[12]||(Mn[12]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Coding Rate",-1)),u.value?(Or(),Nr("div",Mwt,[Ml(At("select",{"onUpdate:modelValue":Mn[4]||(Mn[4]=Br=>ne.value=Br),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},Mn[11]||(Mn[11]=[At("option",{value:5},"4/5",-1),At("option",{value:6},"4/6",-1),At("option",{value:7},"4/7",-1),At("option",{value:8},"4/8",-1)]),512),[[xg,ne.value,void 0,{number:!0}]])])):(Or(),Nr("div",Awt,yn(kr.value),1))]),At("div",Ewt,[Mn[13]||(Mn[13]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Preamble Length",-1)),At("span",Lwt,yn(It.value),1)])]),u.value?(Or(),Nr("div",Pwt,Mn[14]||(Mn[14]=[At("p",{class:"text-yellow-700 dark:text-yellow-400 text-xs"},[At("strong",null,"Note:"),cl(" Radio hardware changes (frequency, bandwidth, spreading factor, coding rate) may require a service restart to apply. ")],-1)]))):Ta("",!0)]))}}),Dwt={class:"glass-card border border-stroke-subtle dark:border-white/20 rounded-[15px] w-full max-w-3xl max-h-[90vh] flex flex-col shadow-2xl"},zwt={class:"flex-1 relative min-h-[400px]"},Owt={class:"p-6 border-t border-stroke-subtle dark:border-stroke/10 space-y-4"},Bwt={class:"grid grid-cols-2 gap-4"},Rwt=Cc({__name:"LocationPicker",props:{isOpen:{type:Boolean},latitude:{},longitude:{}},emits:["close","select"],setup(e,{emit:t}){const r=e,u=t,T=li(null),$=li(r.latitude||0),K=li(r.longitude||0);let ct=null,yt=null;const St=async()=>{if(T.value){Ut();try{const we=(await P5(async()=>{const{default:It}=await Promise.resolve().then(()=>gF);return{default:It}},void 0)).default;delete we.Icon.Default.prototype._getIconUrl,we.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"}),await sp();const Ce=$.value||0,Ve=K.value||0,kr=Ce===0&&Ve===0?2:13;ct=we.map(T.value).setView([Ce,Ve],kr);try{const It=we.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:'©
OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),rn=we.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});It.addTo(ct),rn.addTo(ct)}catch(It){console.warn("Error loading tiles:",It)}(Ce!==0||Ve!==0)&&(yt=we.marker([Ce,Ve]).addTo(ct)),ct.on("click",It=>{$.value=It.latlng.lat,K.value=It.latlng.lng,yt?yt.setLatLng(It.latlng):yt=we.marker(It.latlng).addTo(ct)}),setTimeout(()=>{ct?.invalidateSize()},200)}catch(we){console.error("Failed to initialize map:",we)}}},Ut=()=>{ct&&(ct.remove(),ct=null,yt=null)};Fh(()=>r.isOpen,async we=>{we?(await sp(),await St()):Ut()}),Fh(()=>[r.latitude,r.longitude],([we,Ce])=>{$.value=we,K.value=Ce});const ne=()=>{u("select",{latitude:$.value,longitude:K.value}),u("close")},pe=()=>{u("close")},me=()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(async we=>{if($.value=we.coords.latitude,K.value=we.coords.longitude,ct){ct.setView([$.value,K.value],13);const Ce=(await P5(async()=>{const{default:Ve}=await Promise.resolve().then(()=>gF);return{default:Ve}},void 0)).default;yt?yt.setLatLng([$.value,K.value]):yt=Ce.marker([$.value,K.value]).addTo(ct)}},we=>{console.error("Error getting location:",we),alert("Unable to get current location. Please check browser permissions.")}):alert("Geolocation is not supported by this browser.")};return Dv(()=>{Ut()}),(we,Ce)=>we.isOpen?(Or(),Nr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Od(pe,["self"])},[At("div",Dwt,[At("div",{class:"flex items-center justify-between p-6 border-b border-stroke-subtle dark:border-stroke/10"},[Ce[3]||(Ce[3]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Select Location",-1)),At("button",{onClick:pe,class:"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},Ce[2]||(Ce[2]=[At("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",zwt,[At("div",{ref_key:"mapContainer",ref:T,class:"absolute inset-0 rounded-b-[15px] overflow-hidden"},null,512)]),At("div",Owt,[At("div",Bwt,[At("div",null,[Ce[4]||(Ce[4]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Latitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>$.value=Ve),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary",readonly:""},null,512),[[lu,$.value,void 0,{number:!0}]])]),At("div",null,[Ce[5]||(Ce[5]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Longitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ce[1]||(Ce[1]=Ve=>K.value=Ve),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary",readonly:""},null,512),[[lu,K.value,void 0,{number:!0}]])])]),At("div",{class:"flex gap-3"},[At("button",{onClick:me,class:"flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm flex items-center justify-center gap-2"},Ce[6]||(Ce[6]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),cl(" Use Current Location ",-1)])),At("button",{onClick:pe,class:"px-6 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm"}," Cancel "),At("button",{onClick:ne,class:"px-6 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Select Location ")]),Ce[7]||(Ce[7]=At("p",{class:"text-content-muted dark:text-content-muted text-xs text-center"},"Click on the map to select a location",-1))])])])):Ta("",!0)}}),Fwt=vh(Rwt,[["__scopeId","data-v-186d3c86"]]),Nwt={class:"space-y-4"},jwt={key:0,class:"bg-green-100 dark:bg-green-500/10 border border-green-300 dark:border-green-500/30 rounded-lg p-3"},Uwt={class:"text-green-700 dark:text-green-400 text-sm"},$wt={key:1,class:"bg-red-100 dark:bg-red-500/10 border border-red-300 dark:border-red-500/30 rounded-lg p-3"},Hwt={class:"text-red-700 dark:text-red-400 text-sm"},Vwt={class:"flex justify-end gap-2"},Wwt=["disabled"],qwt=["disabled"],Gwt={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Zwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Kwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm break-all"},Ywt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Xwt={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all"},Jwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Qwt={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all sm:text-right sm:max-w-xs"},t3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},e3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},r3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},n3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},i3t={key:0,class:"flex justify-end"},a3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},o3t={class:"text-content-primary dark:text-content-primary font-mono text-sm"},s3t={class:"flex flex-col py-2 gap-2"},l3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},c3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},u3t={key:1,class:"flex items-center gap-2"},h3t=Cc({__name:"RepeaterSettings",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config||{}),u=Ao(()=>r.value.repeater||{}),T=Ao(()=>t.stats),$=li(!1),K=li(!1),ct=li(null),yt=li(null),St=li(!1),Ut=li(""),ne=li(0),pe=li(0),me=li(0);Fh([r,u],()=>{$.value||(Ut.value=r.value.node_name||"",ne.value=u.value.latitude||0,pe.value=u.value.longitude||0,me.value=u.value.send_advert_interval_hours||0)},{immediate:!0});const we=Ao(()=>r.value.node_name||"Not set"),Ce=Ao(()=>T.value?.local_hash||"Not available"),Ve=Ao(()=>{const Vn=T.value?.public_key;return!Vn||Vn==="Not set"?"Not set":Vn}),kr=Ao(()=>{const Vn=u.value.latitude;return Vn&&Vn!==0?Vn.toFixed(6):"Not set"}),It=Ao(()=>{const Vn=u.value.longitude;return Vn&&Vn!==0?Vn.toFixed(6):"Not set"}),rn=Ao(()=>{const Vn=u.value.mode;return Vn?Vn.charAt(0).toUpperCase()+Vn.slice(1):"Not set"}),Lr=Ao(()=>{const Vn=u.value.send_advert_interval_hours;return Vn===void 0?"Not set":Vn===0?"Disabled":Vn+" hour"+(Vn!==1?"s":"")}),Mr=()=>{$.value=!0,ct.value=null,yt.value=null},tn=()=>{$.value=!1,ct.value=null,Ut.value=r.value.node_name||"",ne.value=u.value.latitude||0,pe.value=u.value.longitude||0,me.value=u.value.send_advert_interval_hours||0},Dn=async()=>{K.value=!0,ct.value=null,yt.value=null;try{const Vn={};Ut.value&&(Vn.node_name=Ut.value),Vn.latitude=ne.value,Vn.longitude=pe.value,Vn.flood_advert_interval_hours=me.value;const pr=(await bs.post("/update_radio_config",Vn)).data;pr.message||pr.persisted?(yt.value=pr.message||"Settings saved successfully",$.value=!1,await t.fetchStats(),setTimeout(()=>{yt.value=null},3e3)):pr.error?ct.value=pr.error:ct.value="Unknown response from server"}catch(Vn){console.error("Failed to update repeater settings:",Vn);const on=Vn;ct.value=on.response?.data?.error||"Failed to update settings"}finally{K.value=!1}},Mn=()=>{St.value=!0},Br=Vn=>{ne.value=Vn.latitude,pe.value=Vn.longitude};return(Vn,on)=>(Or(),Nr("div",Nwt,[yt.value?(Or(),Nr("div",jwt,[At("p",Uwt,yn(yt.value),1)])):Ta("",!0),ct.value?(Or(),Nr("div",$wt,[At("p",Hwt,yn(ct.value),1)])):Ta("",!0),At("div",Vwt,[$.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:tn,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,Wwt),At("button",{onClick:Dn,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(K.value?"Saving...":"Save Changes"),9,qwt)],64)):(Or(),Nr("button",{key:0,onClick:Mr,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",Gwt,[At("div",Zwt,[on[5]||(on[5]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Node Name",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":on[0]||(on[0]=pr=>Ut.value=pr),type:"text",maxlength:"50",class:"w-full sm:w-64 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary",placeholder:"Enter node name"},null,512)),[[lu,Ut.value]]):(Or(),Nr("div",Kwt,yn(we.value),1))]),At("div",Ywt,[on[6]||(on[6]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Local Hash",-1)),At("span",Xwt,yn(Ce.value),1)]),At("div",Jwt,[on[7]||(on[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm flex-shrink-0"},"Public Key",-1)),At("span",Qwt,yn(Ve.value),1)]),At("div",t3t,[on[8]||(on[8]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Latitude",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":on[1]||(on[1]=pr=>ne.value=pr),type:"number",step:"0.000001",min:"-90",max:"90",class:"w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,ne.value,void 0,{number:!0}]]):(Or(),Nr("div",e3t,yn(kr.value),1))]),At("div",r3t,[on[9]||(on[9]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Longitude",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":on[2]||(on[2]=pr=>pe.value=pr),type:"number",step:"0.000001",min:"-180",max:"180",class:"w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,pe.value,void 0,{number:!0}]]):(Or(),Nr("div",n3t,yn(It.value),1))]),$.value?(Or(),Nr("div",i3t,[At("button",{onClick:Mn,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm flex items-center gap-2",title:"Pick location on map"},on[10]||(on[10]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),cl(" Pick Location on Map ",-1)]))])):Ta("",!0),At("div",a3t,[on[11]||(on[11]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Mode",-1)),At("span",o3t,yn(rn.value),1)]),At("div",s3t,[At("div",l3t,[on[13]||(on[13]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Periodic Advertisement Interval",-1)),$.value?(Or(),Nr("div",u3t,[Ml(At("input",{"onUpdate:modelValue":on[3]||(on[3]=pr=>me.value=pr),type:"number",min:"0",max:"48",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[lu,me.value,void 0,{number:!0}]]),on[12]||(on[12]=At("span",{class:"text-content-muted dark:text-content-muted text-sm"},"hours",-1))])):(Or(),Nr("div",c3t,yn(Lr.value),1))]),on[14]||(on[14]=At("span",{class:"text-content-muted dark:text-content-muted text-xs"},"How often the repeater sends an advertisement packet (0 = disabled, 3-48 hours)",-1))])]),Vs(Fwt,{"is-open":St.value,latitude:ne.value,longitude:pe.value,onClose:on[4]||(on[4]=pr=>St.value=!1),onSelect:Br},null,8,["is-open","latitude","longitude"])]))}}),d3t={class:"space-y-4"},f3t={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm"},p3t={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm"},m3t={class:"flex justify-end gap-2"},g3t=["disabled"],v3t=["disabled"],y3t={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},_3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},x3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},b3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},w3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},k3t=Cc({__name:"DutyCycle",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config?.duty_cycle||{}),u=Ao(()=>{const we=r.value.max_airtime_percent;return typeof we=="number"?we.toFixed(1)+"%":we&&typeof we=="object"&&"parsedValue"in we?(we.parsedValue||0).toFixed(1)+"%":"Not set"}),T=Ao(()=>r.value.enforcement_enabled?"Enabled":"Disabled"),$=li(!1),K=li(!1),ct=li(""),yt=li(""),St=li(0),Ut=li(!0),ne=()=>{const we=r.value.max_airtime_percent;typeof we=="number"?St.value=we:we&&typeof we=="object"&&"parsedValue"in we?St.value=we.parsedValue||0:St.value=6,Ut.value=r.value.enforcement_enabled!==!1,$.value=!0,ct.value="",yt.value=""},pe=()=>{$.value=!1,ct.value="",yt.value=""},me=async()=>{K.value=!0,yt.value="",ct.value="";try{const Ce=(await nw.post("/api/update_duty_cycle_config",{max_airtime_percent:St.value,enforcement_enabled:Ut.value})).data;Ce.message||Ce.persisted?(ct.value=Ce.message||"Settings saved successfully",$.value=!1,await t.fetchStats(),setTimeout(()=>{ct.value=""},3e3)):yt.value="Failed to save settings"}catch(we){console.error("Failed to save duty cycle settings:",we),yt.value=we.response?.data?.error||"Failed to save settings"}finally{K.value=!1}};return(we,Ce)=>(Or(),Nr("div",d3t,[ct.value?(Or(),Nr("div",f3t,yn(ct.value),1)):Ta("",!0),yt.value?(Or(),Nr("div",p3t,yn(yt.value),1)):Ta("",!0),At("div",m3t,[$.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:pe,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,g3t),At("button",{onClick:me,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(K.value?"Saving...":"Save Changes"),9,v3t)],64)):(Or(),Nr("button",{key:0,onClick:ne,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",y3t,[At("div",_3t,[Ce[2]||(Ce[2]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Max Airtime %",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>St.value=Ve),type:"number",step:"0.1",min:"0.1",max:"100",class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,St.value,void 0,{number:!0}]]):(Or(),Nr("div",x3t,yn(u.value),1))]),At("div",b3t,[Ce[4]||(Ce[4]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Enforcement",-1)),$.value?Ml((Or(),Nr("select",{key:1,"onUpdate:modelValue":Ce[1]||(Ce[1]=Ve=>Ut.value=Ve),class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},Ce[3]||(Ce[3]=[At("option",{value:!0},"Enabled",-1),At("option",{value:!1},"Disabled",-1)]),512)),[[xg,Ut.value]]):(Or(),Nr("div",w3t,yn(T.value),1))])])]))}}),T3t={class:"space-y-4"},S3t={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm"},C3t={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm"},A3t={class:"flex justify-end gap-2"},M3t=["disabled"],E3t=["disabled"],L3t={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},P3t={class:"flex flex-col py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-2"},I3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},D3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},z3t={class:"flex flex-col py-2 gap-2"},O3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},B3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},R3t=Cc({__name:"TransmissionDelays",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config?.delays||{}),u=Ao(()=>{const we=r.value.tx_delay_factor;if(we&&typeof we=="object"&&we!==null&&"parsedValue"in we){const Ce=we.parsedValue;if(typeof Ce=="number")return Ce.toFixed(2)+"x"}return"Not set"}),T=Ao(()=>{const we=r.value.direct_tx_delay_factor;return typeof we=="number"?we.toFixed(2)+"s":"Not set"}),$=li(!1),K=li(!1),ct=li(""),yt=li(""),St=li(0),Ut=li(0),ne=()=>{const we=r.value.tx_delay_factor;we&&typeof we=="object"&&"parsedValue"in we?St.value=we.parsedValue||1:typeof we=="number"?St.value=we:St.value=1;const Ce=r.value.direct_tx_delay_factor;Ut.value=typeof Ce=="number"?Ce:.5,$.value=!0,ct.value="",yt.value=""},pe=()=>{$.value=!1,ct.value="",yt.value=""},me=async()=>{K.value=!0,yt.value="",ct.value="";try{const Ce=(await nw.post("/api/update_radio_config",{tx_delay_factor:St.value,direct_tx_delay_factor:Ut.value})).data;Ce.message||Ce.persisted?(ct.value=Ce.message||"Settings saved successfully",$.value=!1,await t.fetchStats(),setTimeout(()=>{ct.value=""},3e3)):yt.value="Failed to save settings"}catch(we){console.error("Failed to save delay settings:",we),yt.value=we.response?.data?.error||"Failed to save settings"}finally{K.value=!1}};return(we,Ce)=>(Or(),Nr("div",T3t,[ct.value?(Or(),Nr("div",S3t,yn(ct.value),1)):Ta("",!0),yt.value?(Or(),Nr("div",C3t,yn(yt.value),1)):Ta("",!0),At("div",A3t,[$.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:pe,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,M3t),At("button",{onClick:me,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(K.value?"Saving...":"Save Changes"),9,E3t)],64)):(Or(),Nr("button",{key:0,onClick:ne,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",L3t,[At("div",P3t,[At("div",I3t,[Ce[2]||(Ce[2]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Flood TX Delay Factor",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>St.value=Ve),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,St.value,void 0,{number:!0}]]):(Or(),Nr("div",D3t,yn(u.value),1))]),Ce[3]||(Ce[3]=At("span",{class:"text-content-muted dark:text-content-muted text-xs"},"Multiplier for flood packet transmission delays (collision avoidance)",-1))]),At("div",z3t,[At("div",O3t,[Ce[4]||(Ce[4]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Direct TX Delay Factor",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":Ce[1]||(Ce[1]=Ve=>Ut.value=Ve),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,Ut.value,void 0,{number:!0}]]):(Or(),Nr("div",B3t,yn(T.value),1))]),Ce[5]||(Ce[5]=At("span",{class:"text-content-muted dark:text-content-muted text-xs"},"Base delay for direct-routed packet transmission (seconds)",-1))])])]))}}),WH=OS("treeState",()=>{const e=g_(new Set),t=g_({value:null}),r=ct=>{e.add(ct)},u=ct=>{e.delete(ct)};return{expandedNodes:e,selectedNodeId:t,addExpandedNode:r,removeExpandedNode:u,isNodeExpanded:ct=>e.has(ct),setSelectedNode:ct=>{t.value=ct},toggleExpanded:ct=>{e.has(ct)?u(ct):r(ct)}}}),F3t={class:"select-none"},N3t={class:"flex-shrink-0"},j3t={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},U3t={key:1,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$3t={key:0,class:"hidden sm:flex items-center gap-1 ml-2"},H3t={class:"relative group"},V3t=["title"],W3t={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},q3t={class:"flex justify-between items-start mb-4"},G3t={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},Z3t={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},K3t={class:"flex items-center gap-1 sm:gap-2 ml-auto flex-shrink-0"},Y3t={key:0,class:"hidden sm:flex items-center gap-1"},X3t=["title"],J3t={key:1,class:"hidden sm:flex items-center gap-1"},Q3t={key:2,class:"hidden sm:inline-block px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},t5t={key:0,class:"space-y-1"},e5t=Cc({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const r=e,u=t,T=WH(),$=li(!1),K=Ao({get:()=>T.isNodeExpanded(r.node.id),set:Ce=>{Ce?T.addExpandedNode(r.node.id):T.removeExpandedNode(r.node.id)}}),ct=Ao(()=>r.node.children.length>0);function yt(Ce){if(!Ce)return"Never";const kr=new Date().getTime()-Ce.getTime(),It=Math.floor(kr/(1e3*60)),rn=Math.floor(kr/(1e3*60*60)),Lr=Math.floor(kr/(1e3*60*60*24)),Mr=Math.floor(Lr/365);return It<60?`${It}m ago`:rn<24?`${rn}h ago`:Lr<365?`${Lr}d ago`:`${Mr}y ago`}function St(Ce){return Ce?Ce.length<=16?Ce:`${Ce.slice(0,8)}...${Ce.slice(-8)}`:"No key"}function Ut(){if(ct.value){const Ce=!K.value;K.value=Ce}}function ne(){u("select",r.node.id)}function pe(Ce){u("select",Ce)}function me(Ce){Ce.stopPropagation(),$.value=!$.value}function we(Ce){Ce.stopPropagation(),r.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(r.node.transport_key)}return(Ce,Ve)=>{const kr=ES("TreeNode",!0);return Or(),Nr("div",F3t,[At("div",{class:ja(["flex flex-wrap sm:flex-nowrap items-start sm:items-center gap-1 sm:gap-2 py-2 px-2 sm:px-3 rounded-lg cursor-pointer transition-all duration-200",r.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",Ce.selectedNodeId===Ce.node.id&&!r.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${Ce.level*4}`]),onClick:Ve[3]||(Ve[3]=It=>!r.disabled&&ne())},[At("div",{class:"flex-shrink-0 w-3 h-3 sm:w-4 sm:h-4 flex items-center justify-center",onClick:Od(Ut,["stop"])},[ct.value?(Or(),Nr("svg",{key:0,class:ja(["w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-200",K.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ve[4]||(Ve[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):Ta("",!0)]),At("div",N3t,[r.node.name.startsWith("#")?(Or(),Nr("svg",j3t,Ve[5]||(Ve[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",U3t,Ve[6]||(Ve[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),At("span",{class:ja(["font-mono text-xs sm:text-sm transition-colors duration-200 break-all",Ce.selectedNodeId===Ce.node.id?"text-primary font-medium":""])},yn(Ce.node.name),3),Ce.node.transport_key?(Or(),Nr("div",$3t,[At("div",H3t,[At("button",{onClick:me,class:"p-1 rounded hover:bg-white/10 transition-colors",title:$.value?"Hide full key":"Show full key"},Ve[7]||(Ve[7]=[At("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,V3t),$.value?Ta("",!0):(Or(),Nr("span",W3t,yn(St(Ce.node.transport_key)),1)),$.value?(Or(),Nr("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:Ve[2]||(Ve[2]=It=>$.value=!1)},[At("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:Ve[1]||(Ve[1]=Od(()=>{},["stop"]))},[At("div",q3t,[Ve[9]||(Ve[9]=At("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),At("button",{onClick:Ve[0]||(Ve[0]=It=>$.value=!1),class:"text-white/60 hover:text-white transition-colors"},Ve[8]||(Ve[8]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",G3t,[At("div",Z3t,yn(Ce.node.transport_key),1)]),At("div",{class:"flex justify-end"},[At("button",{onClick:we,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},Ve[10]||(Ve[10]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),cl(" Copy Key ",-1)]))])])])):Ta("",!0)])])):Ta("",!0),At("div",K3t,[Ce.node.last_used?(Or(),Nr("div",Y3t,[Ve[11]||(Ve[11]=At("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),At("span",{class:"text-xs text-white/50",title:Ce.node.last_used.toLocaleString()},yn(yt(Ce.node.last_used)),9,X3t)])):(Or(),Nr("div",J3t,Ve[12]||(Ve[12]=[At("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),At("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),At("span",{class:ja(["px-1.5 sm:px-2 py-0.5 text-[10px] sm:text-xs font-medium rounded-md transition-colors",Ce.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},yn(Ce.node.floodPolicy==="allow"?"ALLOW":"DENY"),3),ct.value?(Or(),Nr("span",Q3t," > "+yn(Ce.node.children.length),1)):Ta("",!0)])],2),Vs(F2,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:V1(()=>[K.value&&Ce.node.children.length>0?(Or(),Nr("div",t5t,[(Or(!0),Nr(Es,null,jl(Ce.node.children,It=>(Or(),w0(kr,{key:It.id,node:It,"selected-node-id":Ce.selectedNodeId,level:Ce.level+1,disabled:r.disabled,onSelect:pe},null,8,["node","selected-node-id","level","disabled"]))),128))])):Ta("",!0)]),_:1})])}}}),r5t=vh(e5t,[["__scopeId","data-v-59e9974c"]]),n5t={class:"flex items-center justify-between mb-6"},i5t={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},a5t={key:0},o5t={class:"text-primary font-mono"},s5t={key:1},l5t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},c5t={class:"flex items-center gap-2"},u5t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},h5t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},d5t={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},f5t={class:"flex items-center gap-3 mb-2"},p5t={class:"flex items-center gap-2"},m5t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},g5t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},v5t={class:"text-content-secondary dark:text-content-muted text-sm"},y5t={class:"grid grid-cols-2 gap-3"},_5t={class:"relative cursor-pointer group"},x5t={class:"relative cursor-pointer group"},b5t={class:"flex gap-3 pt-4"},w5t=["disabled"],k5t=Cc({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(e,{emit:t}){const r=e,u=t,T=li(""),$=li(""),K=li("allow"),ct=Ao(()=>T.value.startsWith("#")),yt=Ao(()=>({type:ct.value?"Region":"Private Key",description:ct.value?"Regional organizational key":"Individual assigned key"}));Fh(ct,me=>{me?$.value="This will create a new region for organizing keys":$.value="This will create a new private key entry"},{immediate:!0});const St=Ao(()=>T.value.trim().length>0),Ut=()=>{St.value&&(u("add",{name:T.value.trim(),floodPolicy:K.value,parentId:r.selectedNodeId}),T.value="",$.value="",K.value="allow")},ne=()=>{T.value="",$.value="",K.value="allow",u("close")},pe=me=>{me.target===me.currentTarget&&ne()};return(me,we)=>me.show?(Or(),Nr("div",{key:0,onClick:pe,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:we[3]||(we[3]=Od(()=>{},["stop"]))},[At("div",n5t,[At("div",null,[we[5]||(we[5]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Add New Entry",-1)),At("p",i5t,[r.selectedNodeName?(Or(),Nr("span",a5t,[we[4]||(we[4]=cl(" Add to: ",-1)),At("span",o5t,yn(r.selectedNodeName),1)])):(Or(),Nr("span",s5t," Add to root level (#uk) "))])]),At("button",{onClick:ne,class:"text-white/60 hover:text-white transition-colors"},we[6]||(we[6]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("form",{onSubmit:Od(Ut,["prevent"]),class:"space-y-4"},[At("div",null,[At("label",l5t,[At("div",c5t,[ct.value?(Or(),Nr("svg",u5t,we[7]||(we[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",h5t,we[8]||(we[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),we[9]||(we[9]=cl(" Region/Key Name ",-1))])]),Ml(At("input",{id:"keyName","onUpdate:modelValue":we[0]||(we[0]=Ce=>T.value=Ce),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[lu,T.value]])]),At("div",d5t,[At("div",f5t,[At("div",p5t,[ct.value?(Or(),Nr("svg",m5t,we[10]||(we[10]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",g5t,we[11]||(we[11]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),At("span",{class:ja([ct.value?"text-secondary":"text-accent-green","font-medium"])},yn(yt.value.type),3)]),At("div",{class:ja(["flex-1 h-px",ct.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),At("p",v5t,yn(yt.value.description),1)]),At("div",null,[we[14]||(we[14]=At("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-3"},[At("div",{class:"flex items-center gap-2"},[At("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),cl(" Flood Policy ")])],-1)),At("div",y5t,[At("label",_5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":we[1]||(we[1]=Ce=>K.value=Ce),value:"allow",class:"sr-only"},null,512),[[j5,K.value]]),we[12]||(we[12]=Du('
Allow

Permit flooding

',1))]),At("label",x5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":we[2]||(we[2]=Ce=>K.value=Ce),value:"deny",class:"sr-only"},null,512),[[j5,K.value]]),we[13]||(we[13]=Du('
Deny

Block flooding

',1))])])]),At("div",b5t,[At("button",{type:"button",onClick:ne,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{type:"submit",disabled:!St.value,class:ja(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",St.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-background-mute dark:bg-stroke/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted cursor-not-allowed"])}," Add "+yn(yt.value.type),11,w5t)])],32)])])):Ta("",!0)}}),T5t={class:"flex items-center justify-between mb-6"},S5t={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},C5t={class:"text-primary font-mono"},A5t={for:"keyName",class:"block text-sm font-medium text-content-secondary dark:text-content-primary mb-2"},M5t={class:"flex items-center gap-2"},E5t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},L5t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},P5t={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},I5t={class:"flex items-center gap-3 mb-2"},D5t={class:"flex items-center gap-2"},z5t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},O5t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},B5t={class:"text-content-secondary dark:text-content-muted text-sm"},R5t={key:0,class:"space-y-4"},F5t={key:0,class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},N5t={class:"bg-background-mute dark:bg-black/20 border border-stroke-subtle dark:border-stroke/10 rounded-md p-3"},j5t={class:"text-xs font-mono text-content-primary dark:text-content-primary/80 break-all"},U5t={key:1,class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},$5t={class:"flex items-center justify-between"},H5t={class:"text-sm text-content-secondary dark:text-content-muted"},V5t={class:"text-xs text-content-muted dark:text-content-muted"},W5t={class:"grid grid-cols-2 gap-3"},q5t={class:"relative cursor-pointer group"},G5t={class:"relative cursor-pointer group"},Z5t={class:"flex gap-3 pt-4"},K5t=["disabled"],Y5t=Cc({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(e,{emit:t}){const r=e,u=t,T=li(""),$=li("allow"),K=Ao(()=>T.value.startsWith("#")),ct=Ao(()=>({type:K.value?"Region":"Private Key",description:K.value?"Regional organizational key":"Individual assigned key"}));Fh(()=>r.node,Ce=>{Ce?(T.value=Ce.name,$.value=Ce.floodPolicy):(T.value="",$.value="allow")},{immediate:!0});const yt=Ao(()=>T.value.trim().length>0&&r.node),St=Ce=>{const kr=new Date().getTime()-Ce.getTime(),It=Math.floor(kr/(1e3*60)),rn=Math.floor(kr/(1e3*60*60)),Lr=Math.floor(kr/(1e3*60*60*24)),Mr=Math.floor(Lr/365);return It<60?`${It}m ago`:rn<24?`${rn}h ago`:Lr<365?`${Lr}d ago`:`${Mr}y ago`},Ut=Ce=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(Ce)},ne=()=>{!yt.value||!r.node||(u("save",{id:r.node.id,name:T.value.trim(),floodPolicy:$.value}),me())},pe=()=>{r.node&&(u("request-delete",r.node),me())},me=()=>{u("close")},we=Ce=>{Ce.target===Ce.currentTarget&&me()};return(Ce,Ve)=>Ce.show?(Or(),Nr("div",{key:0,onClick:we,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10",onClick:Ve[4]||(Ve[4]=Od(()=>{},["stop"]))},[At("div",T5t,[At("div",null,[Ve[6]||(Ve[6]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Edit Entry",-1)),At("p",S5t,[Ve[5]||(Ve[5]=cl(" Modify ",-1)),At("span",C5t,yn(Ce.node?.name),1)])]),At("button",{onClick:me,class:"text-white/60 hover:text-white transition-colors"},Ve[7]||(Ve[7]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("form",{onSubmit:Od(ne,["prevent"]),class:"space-y-4"},[At("div",null,[At("label",A5t,[At("div",M5t,[K.value?(Or(),Nr("svg",E5t,Ve[8]||(Ve[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",L5t,Ve[9]||(Ve[9]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Ve[10]||(Ve[10]=cl(" Region/Key Name ",-1))])]),Ml(At("input",{id:"keyName","onUpdate:modelValue":Ve[0]||(Ve[0]=kr=>T.value=kr),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[lu,T.value]])]),At("div",P5t,[At("div",I5t,[At("div",D5t,[K.value?(Or(),Nr("svg",z5t,Ve[11]||(Ve[11]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",O5t,Ve[12]||(Ve[12]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),At("span",{class:ja([K.value?"text-secondary":"text-accent-green","font-medium"])},yn(ct.value.type),3)]),At("div",{class:ja(["flex-1 h-px",K.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),At("p",B5t,yn(ct.value.description),1)]),Ce.node?(Or(),Nr("div",R5t,[Ce.node.transport_key?(Or(),Nr("div",F5t,[Ve[14]||(Ve[14]=Du('
Transport Key
',1)),At("div",N5t,[At("div",j5t,yn(Ce.node.transport_key),1),At("button",{onClick:Ve[1]||(Ve[1]=kr=>Ut(Ce.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},Ve[13]||(Ve[13]=[At("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),cl(" Copy Key ",-1)]))])])):Ta("",!0),Ce.node.last_used?(Or(),Nr("div",U5t,[Ve[15]||(Ve[15]=At("div",{class:"flex items-center gap-2 mb-3"},[At("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),At("span",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Last Used")],-1)),At("div",$5t,[At("div",H5t,yn(Ce.node.last_used.toLocaleDateString())+" at "+yn(Ce.node.last_used.toLocaleTimeString()),1),At("div",V5t,yn(St(Ce.node.last_used)),1)])])):Ta("",!0)])):Ta("",!0),At("div",null,[Ve[18]||(Ve[18]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary mb-3"},[At("div",{class:"flex items-center gap-2"},[At("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),cl(" Flood Policy ")])],-1)),At("div",W5t,[At("label",q5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":Ve[2]||(Ve[2]=kr=>$.value=kr),value:"allow",class:"sr-only"},null,512),[[j5,$.value]]),Ve[16]||(Ve[16]=Du('
Allow

Permit flooding

',1))]),At("label",G5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":Ve[3]||(Ve[3]=kr=>$.value=kr),value:"deny",class:"sr-only"},null,512),[[j5,$.value]]),Ve[17]||(Ve[17]=Du('
Deny

Block flooding

',1))])])]),At("div",Z5t,[At("button",{type:"button",onClick:pe,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),At("button",{type:"button",onClick:me,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{type:"submit",disabled:!yt.value,class:ja(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",yt.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted/70 cursor-not-allowed"])}," Save Changes ",10,K5t)])],32)])])):Ta("",!0)}}),X5t={class:"flex items-center gap-3 mb-6"},J5t={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},Q5t={class:"text-accent-red font-mono"},t4t={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},e4t={class:"flex items-start gap-3"},r4t={class:"flex-1"},n4t={class:"text-accent-red font-medium text-sm mb-2"},i4t={class:"space-y-1 max-h-32 overflow-y-auto"},a4t={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o4t={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},s4t={class:"font-mono"},l4t={key:0,class:"text-content-secondary dark:text-content-muted text-xs"},c4t={key:1,class:"mb-6"},u4t={class:"mb-3"},h4t={class:"relative"},d4t={class:"space-y-2 max-h-40 overflow-y-auto border border-stroke-subtle dark:border-stroke/20 rounded-lg p-3 bg-gray-50 dark:bg-white/5"},f4t={key:0,class:"text-center py-4 text-content-secondary dark:text-content-muted text-sm"},p4t={class:"relative"},m4t=["value"],g4t={class:"flex items-center gap-2 flex-1"},v4t={class:"text-content-primary dark:text-content-primary font-mono text-sm"},y4t={key:0,class:"ml-auto px-2 py-0.5 bg-background-mute dark:bg-stroke/10 text-content-secondary dark:text-content-muted text-xs rounded-full"},_4t={class:"flex gap-3"},x4t=Cc({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(e,{emit:t}){const r=e,u=t,T=li(null),$=li(""),K=we=>{const Ce=[],Ve=kr=>{for(const It of kr.children)Ce.push(It),Ve(It)};return Ve(we),Ce},ct=Ao(()=>r.node?K(r.node):[]),yt=Ao(()=>{if(!r.node)return[];const we=new Set([r.node.id,...ct.value.map(Ve=>Ve.id)]),Ce=Ve=>{const kr=[];for(const It of Ve)It.name.startsWith("#")&&!we.has(It.id)&&kr.push(It),It.children.length>0&&kr.push(...Ce(It.children));return kr};return Ce(r.allNodes)}),St=Ao(()=>{if(!$.value.trim())return yt.value;const we=$.value.toLowerCase();return yt.value.filter(Ce=>Ce.name.toLowerCase().includes(we))}),Ut=()=>{r.node&&(u("delete-all",r.node.id),pe())},ne=()=>{!r.node||!T.value||(u("move-children",{nodeId:r.node.id,targetParentId:T.value}),pe())},pe=()=>{T.value=null,$.value="",u("close")},me=we=>{we.target===we.currentTarget&&pe()};return(we,Ce)=>we.show&&we.node?(Or(),Nr("div",{key:0,onClick:me,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10",onClick:Ce[2]||(Ce[2]=Od(()=>{},["stop"]))},[At("div",X5t,[Ce[6]||(Ce[6]=At("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),At("div",null,[Ce[4]||(Ce[4]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Confirm Deletion",-1)),At("p",J5t,[Ce[3]||(Ce[3]=cl(" Deleting ",-1)),At("span",Q5t,yn(we.node?.name),1)])]),At("button",{onClick:pe,class:"ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},Ce[5]||(Ce[5]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),ct.value.length>0?(Or(),Nr("div",t4t,[At("div",e4t,[Ce[9]||(Ce[9]=At("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),At("div",r4t,[At("h4",n4t," This will affect "+yn(ct.value.length)+" child "+yn(ct.value.length===1?"entry":"entries")+": ",1),At("div",i4t,[(Or(!0),Nr(Es,null,jl(ct.value.slice(0,10),Ve=>(Or(),Nr("div",{key:Ve.id,class:"flex items-center gap-2 text-xs text-content-secondary dark:text-content-primary/80"},[Ve.name.startsWith("#")?(Or(),Nr("svg",a4t,Ce[7]||(Ce[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",o4t,Ce[8]||(Ce[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),At("span",s4t,yn(Ve.name),1),At("span",{class:ja(["px-1 py-0.5 text-xs rounded",Ve.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},yn(Ve.floodPolicy),3)]))),128)),ct.value.length>10?(Or(),Nr("div",l4t," ...and "+yn(ct.value.length-10)+" more ",1)):Ta("",!0)])])])])):Ta("",!0),ct.value.length>0&&yt.value.length>0?(Or(),Nr("div",c4t,[Ce[13]||(Ce[13]=At("h4",{class:"text-content-primary dark:text-content-primary font-medium text-sm mb-3"},"Move children to another region:",-1)),At("div",u4t,[At("div",h4t,[Ce[10]||(Ce[10]=At("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-content-muted dark:text-content-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),Ml(At("input",{"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>$.value=Ve),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[lu,$.value]])])]),At("div",d4t,[St.value.length===0?(Or(),Nr("div",f4t,yn($.value?"No regions match your search":"No available regions"),1)):Ta("",!0),(Or(!0),Nr(Es,null,jl(St.value,Ve=>(Or(),Nr("label",{key:Ve.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors group"},[At("div",p4t,[Ml(At("input",{type:"radio",value:Ve.id,"onUpdate:modelValue":Ce[1]||(Ce[1]=kr=>T.value=kr),class:"sr-only peer"},null,8,m4t),[[j5,T.value]]),Ce[11]||(Ce[11]=At("div",{class:"w-4 h-4 border-2 border-stroke dark:border-stroke/30 rounded-full group-hover:border-stroke dark:group-hover:border-stroke/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[At("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),At("div",g4t,[Ce[12]||(Ce[12]=At("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),At("span",v4t,yn(Ve.name),1),Ve.children.length>0?(Or(),Nr("span",y4t,yn(Ve.children.length),1)):Ta("",!0)])]))),128))])])):Ta("",!0),At("div",_4t,[At("button",{onClick:pe,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),ct.value.length>0&&T.value?(Or(),Nr("button",{key:0,onClick:ne,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):Ta("",!0),At("button",{onClick:Ut,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},yn(ct.value.length>0?"Delete All":"Delete"),1)])])])):Ta("",!0)}}),b4t={class:"space-y-4 sm:space-y-6"},w4t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3"},k4t={class:"flex gap-2 flex-wrap"},T4t=["disabled"],S4t=["disabled"],C4t=["disabled"],A4t={class:"glass-card rounded-[15px] p-3 sm:p-4 border border-stroke-subtle dark:border-stroke/10 bg-background-mute dark:bg-white/5"},M4t={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},E4t={class:"flex items-center gap-2 sm:gap-3"},L4t={class:"flex bg-background-mute dark:bg-stroke/5 rounded-lg border border-stroke-subtle dark:border-stroke/20 p-0.5 sm:p-1"},P4t={class:"glass-card rounded-[15px] p-3 sm:p-6 border border-stroke-subtle dark:border-stroke/10"},I4t={key:0,class:"flex items-center justify-center py-8"},D4t={key:1,class:"text-center py-8"},z4t={class:"text-content-secondary dark:text-content-muted text-sm"},O4t={key:2,class:"text-center py-8"},B4t={key:3,class:"space-y-2"},R4t=Cc({name:"TransportKeys",__name:"TransportKeys",setup(e){const t=WH(),r=li(!1),u=li(!1),T=li(!1),$=li(null),K=li(null),ct=li("deny"),yt=li([]),St=li(!1),Ut=li(null),ne=pr=>{const _r=new Map,Sr=[];return pr.forEach(Dr=>{const nn={id:Dr.id,name:Dr.name,floodPolicy:Dr.flood_policy,transport_key:Dr.transport_key,last_used:Dr.last_used?new Date(Dr.last_used*1e3):void 0,parent_id:Dr.parent_id,children:[]};_r.set(Dr.id,nn)}),_r.forEach(Dr=>{Dr.parent_id&&_r.has(Dr.parent_id)?_r.get(Dr.parent_id).children.push(Dr):Sr.push(Dr)}),Sr},pe=async()=>{try{St.value=!0,Ut.value=null;const pr=await bs.getTransportKeys();pr.success&&pr.data?yt.value=ne(pr.data):Ut.value=pr.error||"Failed to load transport keys"}catch(pr){Ut.value=pr instanceof Error?pr.message:"Unknown error occurred",console.error("Error loading transport keys:",pr)}finally{St.value=!1}};Xd(()=>{pe()});function me(pr,_r){for(const Sr of pr){if(Sr.id===_r)return Sr;if(Sr.children){const Dr=me(Sr.children,_r);if(Dr)return Dr}}return null}function we(){const pr=t.selectedNodeId.value;return pr?me(yt.value,pr)?.name:void 0}function Ce(pr){ct.value==="deny"&&t.setSelectedNode(pr)}function Ve(){ct.value==="deny"&&(r.value=!0)}function kr(){if(ct.value==="deny"&&t.selectedNodeId.value){const pr=me(yt.value,t.selectedNodeId.value);pr&&(K.value=pr,T.value=!0)}}function It(){if(ct.value==="deny"&&t.selectedNodeId.value){const pr=me(yt.value,t.selectedNodeId.value);pr&&($.value=pr,u.value=!0)}}const rn=async pr=>{try{const _r=await bs.createTransportKey(pr.name,pr.floodPolicy,void 0,pr.parentId,void 0);_r.success?await pe():(console.error("Failed to add transport key:",_r.error),Ut.value=_r.error||"Failed to add transport key")}catch(_r){console.error("Error adding transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{r.value=!1}};function Lr(){r.value=!1}async function Mr(pr){try{const _r=pr==="allow",Sr=await bs.updateGlobalFloodPolicy(_r);Sr.success?ct.value=pr:(console.error("Failed to update global flood policy:",Sr.error),Ut.value=Sr.error||"Failed to update global flood policy")}catch(_r){console.error("Error updating global flood policy:",_r),Ut.value=_r instanceof Error?_r.message:"Failed to update global flood policy"}}function tn(){u.value=!1,$.value=null}async function Dn(pr){try{const _r=await bs.updateTransportKey(pr.id,pr.name,pr.floodPolicy);_r.success?await pe():(console.error("Failed to update transport key:",_r.error),Ut.value=_r.error||"Failed to update transport key")}catch(_r){console.error("Error updating transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{tn()}}function Mn(pr){u.value=!1,$.value=null,K.value=pr,T.value=!0}function Br(){T.value=!1,K.value=null}async function Vn(pr){try{const _r=await bs.deleteTransportKey(pr);_r.success?(await pe(),t.setSelectedNode(null)):(console.error("Failed to delete transport key:",_r.error),Ut.value=_r.error||"Failed to delete transport key")}catch(_r){console.error("Error deleting transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{Br()}}async function on(pr){try{const _r=await bs.deleteTransportKey(pr.nodeId);_r.success?(await pe(),t.setSelectedNode(null)):(console.error("Failed to delete transport key:",_r.error),Ut.value=_r.error||"Failed to delete transport key")}catch(_r){console.error("Error deleting transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{Br()}}return(pr,_r)=>(Or(),Nr("div",b4t,[At("div",w4t,[_r[3]||(_r[3]=At("div",null,[At("h3",{class:"text-base sm:text-lg font-semibold text-content-primary dark:text-content-primary mb-1 sm:mb-2"},"Regions/Keys"),At("p",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Manage regional key hierarchy")],-1)),At("div",k4t,[At("button",{onClick:Ve,disabled:ct.value==="allow",class:ja(["flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",ct.value==="allow"?"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed":"bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"])},_r[2]||(_r[2]=[At("svg",{class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),cl(" Add ",-1)]),10,T4t),At("button",{onClick:It,disabled:!Io(t).selectedNodeId.value||ct.value==="allow",class:ja(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Io(t).selectedNodeId.value||ct.value==="allow"?"bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed":"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50"])}," Edit ",10,S4t),At("button",{onClick:kr,disabled:!Io(t).selectedNodeId.value||ct.value==="allow",class:ja(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Io(t).selectedNodeId.value||ct.value==="allow"?"bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed":"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50"])}," Delete ",10,C4t)])]),At("div",A4t,[At("div",M4t,[_r[4]||(_r[4]=At("div",null,[At("h4",{class:"text-xs sm:text-sm font-medium text-content-primary dark:text-content-primary mb-1"},"Global Flood Policy (*)"),At("p",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Master control for repeater flooding")],-1)),At("div",E4t,[At("div",L4t,[At("button",{onClick:_r[0]||(_r[0]=Sr=>Mr("deny")),class:ja(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ct.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary"])}," DENY ",2),At("button",{onClick:_r[1]||(_r[1]=Sr=>Mr("allow")),class:ja(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ct.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary"])}," ALLOW ",2)])])])]),At("div",P4t,[St.value?(Or(),Nr("div",I4t,_r[5]||(_r[5]=[At("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),At("span",{class:"ml-2 text-content-secondary dark:text-content-muted"},"Loading transport keys...",-1)]))):Ut.value?(Or(),Nr("div",D4t,[_r[6]||(_r[6]=At("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),At("div",z4t,yn(Ut.value),1),At("button",{onClick:pe,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):yt.value.length===0?(Or(),Nr("div",O4t,_r[7]||(_r[7]=[At("div",{class:"text-content-muted dark:text-content-muted mb-2"},"📝 No transport keys found",-1),At("div",{class:"text-content-muted dark:text-content-muted/60 text-sm"},"Add your first transport key to get started",-1)]))):(Or(),Nr("div",B4t,[(Or(!0),Nr(Es,null,jl(yt.value,Sr=>(Or(),w0(r5t,{key:Sr.id,node:Sr,"selected-node-id":Io(t).selectedNodeId.value,level:0,disabled:ct.value==="allow",onSelect:Ce},null,8,["node","selected-node-id","disabled"]))),128))]))]),Vs(k5t,{show:r.value,"selected-node-name":we(),"selected-node-id":Io(t).selectedNodeId.value||void 0,onClose:Lr,onAdd:rn},null,8,["show","selected-node-name","selected-node-id"]),Vs(Y5t,{show:u.value,node:$.value,onClose:tn,onSave:Dn,onRequestDelete:Mn},null,8,["show","node"]),Vs(x4t,{show:T.value,node:K.value,"all-nodes":yt.value,onClose:Br,onDeleteAll:Vn,onMoveChildren:on},null,8,["show","node","all-nodes"])]))}}),F4t={class:"flex items-center justify-between mb-4"},N4t={class:"text-xl font-semibold text-content-primary dark:text-content-primary"},j4t={class:"mb-6"},U4t={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$4t={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},H4t={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},V4t={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},W4t={class:"flex gap-3"},qH=Cc({__name:"ConfirmDialog",props:{show:{type:Boolean},title:{default:"Confirm Action"},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"warning"}},emits:["close","confirm"],setup(e,{emit:t}){const r=e,u=t,T=ct=>{ct.target===ct.currentTarget&&u("close")},$={danger:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",warning:"bg-yellow-100 dark:bg-yellow-500/20 border-yellow-500/30 text-yellow-600 dark:text-yellow-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},K={danger:"bg-red-500 hover:bg-red-600",warning:"bg-yellow-500 hover:bg-yellow-600",info:"bg-blue-500 hover:bg-blue-600"};return(ct,yt)=>r.show?(Or(),Nr("div",{key:0,onClick:T,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:yt[3]||(yt[3]=Od(()=>{},["stop"]))},[At("div",F4t,[At("h3",N4t,yn(r.title),1),At("button",{onClick:yt[0]||(yt[0]=St=>u("close")),class:"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},yt[4]||(yt[4]=[At("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",j4t,[At("div",{class:ja(["inline-flex p-3 rounded-xl mb-4",$[r.variant]])},[r.variant==="danger"?(Or(),Nr("svg",U4t,yt[5]||(yt[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):r.variant==="warning"?(Or(),Nr("svg",$4t,yt[6]||(yt[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):(Or(),Nr("svg",H4t,yt[7]||(yt[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),At("p",V4t,yn(r.message),1)]),At("div",W4t,[At("button",{onClick:yt[1]||(yt[1]=St=>u("close")),class:"flex-1 px-4 py-3 rounded-xl bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary transition-all duration-200 border border-stroke-subtle dark:border-stroke/10"},yn(r.cancelText),1),At("button",{onClick:yt[2]||(yt[2]=St=>u("confirm")),class:ja(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",K[r.variant]])},yn(r.confirmText),3)])])])):Ta("",!0)}}),q4t={class:"space-y-4 sm:space-y-6"},G4t={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},Z4t={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-4"},K4t={class:"flex items-center gap-2 text-red-600 dark:text-red-400"},Y4t={key:1,class:"flex items-center justify-center py-12"},X4t={key:2,class:"space-y-3"},J4t={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},Q4t={class:"flex-1"},tkt={class:"flex items-center gap-2 sm:gap-3"},ekt={class:"min-w-0 flex-1"},rkt={class:"text-content-primary dark:text-content-primary font-medium text-sm sm:text-base break-all"},nkt={class:"flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-1 text-xs text-content-secondary dark:text-content-muted"},ikt={class:"truncate"},akt={class:"truncate"},okt=["onClick","disabled"],skt={key:3,class:"text-center py-12"},lkt={class:"bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},ckt={class:"space-y-4"},ukt={class:"flex justify-end gap-3 mt-6"},hkt=["disabled"],dkt=["disabled"],fkt={class:"bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-lg w-full shadow-2xl"},pkt={class:"space-y-4"},mkt={class:"flex gap-2"},gkt=["value"],vkt={class:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4"},ykt={class:"block bg-blue-500/20 px-3 py-2 rounded text-xs text-blue-100 font-mono overflow-x-auto"},_kt=Cc({name:"APITokens",__name:"APITokens",setup(e){const t=li([]),r=li(!1),u=li(null),T=li(!1),$=li(""),K=li(null),ct=li(!1),yt=li(!1),St=li(null),Ut=async()=>{r.value=!0,u.value=null;try{const rn=await bs.get("/auth/tokens"),Lr=rn.data||rn;t.value=Lr.tokens||[]}catch(rn){console.error("Failed to fetch API tokens:",rn),u.value=rn instanceof Error?rn.message:"Failed to fetch tokens"}finally{r.value=!1}},ne=async()=>{if(!$.value.trim()){u.value="Token name is required";return}r.value=!0,u.value=null;try{const rn=await bs.post("/auth/tokens",{name:$.value.trim()}),Lr=rn.data||rn;K.value=Lr.token||null,T.value=!1,ct.value=!0,$.value="",await Ut()}catch(rn){console.error("Failed to create API token:",rn),u.value=rn instanceof Error?rn.message:"Failed to create token"}finally{r.value=!1}},pe=(rn,Lr)=>{St.value={id:rn,name:Lr},yt.value=!0},me=async()=>{if(St.value){r.value=!0,u.value=null;try{await bs.delete(`/auth/tokens/${St.value.id}`),await Ut(),yt.value=!1,St.value=null}catch(rn){console.error("Failed to revoke API token:",rn),u.value=rn instanceof Error?rn.message:"Failed to revoke token"}finally{r.value=!1}}},we=()=>{T.value=!1,$.value="",u.value=null},Ce=()=>{ct.value=!1,K.value=null},Ve=()=>{K.value&&navigator.clipboard.writeText(K.value)},kr=rn=>rn?new Date(rn*1e3).toLocaleString():"Never",It=Ao(()=>`${window.location.origin}/api/stats`);return Xd(()=>{Ut()}),(rn,Lr)=>(Or(),Nr(Es,null,[At("div",q4t,[At("div",G4t,[Lr[5]||(Lr[5]=At("div",null,[At("h2",{class:"text-lg sm:text-xl font-semibold text-content-primary dark:text-content-primary"},"API Tokens"),At("p",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm mt-1"},"Manage API tokens for machine-to-machine authentication")],-1)),At("button",{onClick:Lr[0]||(Lr[0]=Mr=>T.value=!0),class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center justify-center gap-2 text-sm sm:text-base"},Lr[4]||(Lr[4]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),cl(" Create Token ",-1)]))]),Lr[20]||(Lr[20]=Du('

API tokens are used for machine-to-machine authentication. Include the token in the X-API-Key header when making API requests.

Tokens are only shown once at creation. Store them securely.

',1)),u.value?(Or(),Nr("div",Z4t,[At("div",K4t,[Lr[6]||(Lr[6]=At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),cl(" "+yn(u.value),1)])])):Ta("",!0),r.value&&t.value.length===0?(Or(),Nr("div",Y4t,Lr[7]||(Lr[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-muted"},"Loading tokens...")],-1)]))):t.value.length>0?(Or(),Nr("div",X4t,[(Or(!0),Nr(Es,null,jl(t.value,Mr=>(Or(),Nr("div",{key:Mr.id,class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-3 sm:p-4 hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors"},[At("div",J4t,[At("div",Q4t,[At("div",tkt,[Lr[8]||(Lr[8]=At("svg",{class:"w-4 h-4 sm:w-5 sm:h-5 text-primary flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),At("div",ekt,[At("h3",rkt,yn(Mr.name),1),At("div",nkt,[At("span",ikt,"Created: "+yn(kr(Mr.created_at)),1),At("span",akt,"Last used: "+yn(kr(Mr.last_used)),1)])])])]),At("button",{onClick:tn=>pe(Mr.id,Mr.name),disabled:r.value,class:"w-full sm:w-auto px-3 py-1.5 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 rounded-lg border border-red-500/50 transition-colors disabled:opacity-50 text-sm"}," Revoke ",8,okt)])]))),128))])):(Or(),Nr("div",skt,[Lr[9]||(Lr[9]=At("svg",{class:"w-16 h-16 text-content-muted dark:text-content-muted/40 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),Lr[10]||(Lr[10]=At("h3",{class:"text-content-primary dark:text-content-primary font-medium mb-2"},"No API Tokens",-1)),Lr[11]||(Lr[11]=At("p",{class:"text-content-secondary dark:text-content-muted text-sm mb-4"},"Create a token to enable API access",-1)),At("button",{onClick:Lr[1]||(Lr[1]=Mr=>T.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Create Your First Token ")])),T.value?(Or(),Nr("div",{key:4,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Od(we,["self"])},[At("div",lkt,[Lr[14]||(Lr[14]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-4"},"Create API Token",-1)),At("div",ckt,[At("div",null,[Lr[12]||(Lr[12]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Token Name",-1)),Ml(At("input",{"onUpdate:modelValue":Lr[2]||(Lr[2]=Mr=>$.value=Mr),type:"text",placeholder:"e.g., Production Server, CI/CD Pipeline",class:"w-full px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-400 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",onKeydown:Sx(ne,["enter"])},null,544),[[lu,$.value]]),Lr[13]||(Lr[13]=At("p",{class:"text-xs text-content-muted dark:text-content-muted mt-1"},"Give your token a descriptive name to identify its purpose",-1))]),At("div",ukt,[At("button",{onClick:we,disabled:r.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50"}," Cancel ",8,hkt),At("button",{onClick:ne,disabled:r.value||!$.value.trim(),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50"},yn(r.value?"Creating...":"Create Token"),9,dkt)])])])])):Ta("",!0),ct.value&&K.value?(Or(),Nr("div",{key:5,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Od(Ce,["self"])},[At("div",fkt,[Lr[19]||(Lr[19]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-4"},"Token Created Successfully",-1)),At("div",pkt,[Lr[18]||(Lr[18]=Du('
Save this token now! For security reasons, it will not be shown again.
',1)),At("div",null,[Lr[16]||(Lr[16]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Your API Token",-1)),At("div",mkt,[At("input",{value:K.value,readonly:"",class:"flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary font-mono text-sm"},null,8,gkt),At("button",{onClick:Ve,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center gap-2",title:"Copy to clipboard"},Lr[15]||(Lr[15]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),cl(" Copy ",-1)]))])]),At("div",vkt,[Lr[17]||(Lr[17]=At("p",{class:"text-sm text-blue-200 mb-2"},[At("strong",null,"Usage Example:")],-1)),At("code",ykt,' curl -H "X-API-Key: '+yn(K.value)+'" '+yn(It.value),1)]),At("div",{class:"flex justify-end mt-6"},[At("button",{onClick:Ce,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Done ")])])])])):Ta("",!0)]),Vs(qH,{show:yt.value,title:"Revoke API Token",message:`Are you sure you want to revoke the token '${St.value?.name}'? This action cannot be undone.`,"confirm-text":"Revoke","cancel-text":"Cancel",variant:"danger",onConfirm:me,onClose:Lr[3]||(Lr[3]=Mr=>yt.value=!1)},null,8,["show","message"])],64))}}),xkt={class:"space-y-6"},bkt={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},wkt={class:"space-y-4"},kkt={class:"flex items-center justify-between"},Tkt=["disabled"],Skt={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},Ckt={class:"space-y-4"},Akt={class:"space-y-3"},Mkt=["checked","disabled"],Ekt=["checked","disabled"],Lkt={class:"flex items-start gap-3"},Pkt={key:0,class:"w-5 h-5 text-green-600 dark:text-green-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Ikt={key:1,class:"w-5 h-5 text-accent-blue flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Dkt={class:"flex-1"},zkt={class:"text-sm font-medium text-content-primary dark:text-content-primary"},Okt={key:0,class:"text-xs text-green-600 dark:text-green-400 mt-1"},Bkt={key:1,class:"p-4 bg-amber-500/10 border border-amber-500/30 rounded-lg"},Rkt={class:"flex items-start justify-between gap-3"},Fkt=["disabled"],Nkt={key:0,class:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24"},jkt={key:1,class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Ukt={class:"flex items-center space-x-2"},$kt={key:0,class:"w-5 h-5 text-green-600 dark:text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Hkt={key:1,class:"w-5 h-5 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Vkt=Cc({name:"WebSettings",__name:"WebSettings",setup(e){const t=li(!1),r=li(""),u=li(!1),T=li(!1),$=li(!1),K=li(!1),ct=li(!0),yt=g_({cors_enabled:!1,use_default_frontend:!0}),St=Ao(()=>u.value?"bg-green-500/10 border-green-600/40 dark:border-green-500/30":"bg-red-500/10 border-red-500/30");async function Ut(){try{ct.value=!0;const It=await bs.get("/check_pymc_console");It.success&&It.data&&(K.value=It.data.exists,console.log("PyMC Console exists:",K.value))}catch(It){console.error("Failed to check PyMC Console:",It),K.value=!1}finally{ct.value=!1}}async function ne(){try{const It=await bs.get("/stats");console.log("WebSettings: Full response:",It);let rn=null;if(It.success&&It.data?rn=It.data:It&&"version"in It&&(rn=It),rn){const Lr=rn.config?.web||{};console.log("WebSettings: webConfig:",Lr),yt.cors_enabled=Lr.cors_enabled===!0,console.log("WebSettings: Set cors_enabled to:",yt.cors_enabled);const Mr=Lr.web_path;yt.use_default_frontend=!Mr||Mr==="",console.log("WebSettings: Set use_default_frontend to:",yt.use_default_frontend,"from web_path:",Mr)}}catch(It){console.error("Failed to load web settings:",It),Ve("Failed to load settings",!1)}}async function pe(){t.value=!0,r.value="";try{const It={web:{cors_enabled:yt.cors_enabled}};yt.use_default_frontend?It.web.web_path=null:It.web.web_path="/opt/pymc_console/web/html";const rn=await bs.post("/update_web_config",It);rn.success?(Ve("Settings saved successfully",!0),T.value=!0):Ve(rn.error||"Failed to save settings",!1)}catch(It){console.error("Failed to save web settings:",It),Ve(It.message||"Failed to save settings",!1)}finally{t.value=!1}}async function me(){yt.cors_enabled=!yt.cors_enabled,await pe()}async function we(){yt.use_default_frontend=!0,await pe()}async function Ce(){yt.use_default_frontend=!1,await pe()}function Ve(It,rn){r.value=It,u.value=rn,setTimeout(()=>{r.value=""},5e3)}async function kr(){$.value=!0,r.value="";try{const It=await bs.post("/restart_service",{});It.success?(Ve("Service restart initiated. Page will reload...",!0),T.value=!1,setTimeout(()=>{window.location.reload()},2e3)):Ve(It.error||"Failed to restart service",!1)}catch(It){It.code==="ERR_NETWORK"||It.message?.includes("Network error")?(Ve("Service restarting... Page will reload",!0),T.value=!1,setTimeout(()=>{window.location.reload()},3e3)):(console.error("Failed to restart service:",It),Ve(It.message||"Failed to restart service",!1))}finally{$.value=!1}}return Xd(()=>{ne(),Ut()}),(It,rn)=>(Or(),Nr("div",xkt,[At("div",bkt,[rn[1]||(rn[1]=At("div",{class:"flex items-start justify-between mb-4"},[At("div",null,[At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"CORS Settings"),At("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Control cross-origin resource sharing for API access")])],-1)),At("div",wkt,[At("div",kkt,[rn[0]||(rn[0]=At("div",null,[At("label",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Enable CORS"),At("p",{class:"text-xs text-content-secondary dark:text-content-muted mt-1"},"Allow web frontends from different origins to access the API")],-1)),At("button",{onClick:me,disabled:t.value,class:ja(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",yt.cors_enabled?"bg-accent-blue border-accent-blue":"bg-gray-600 border-gray-600",t.value?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[At("span",{class:ja(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",yt.cors_enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,Tkt)])])]),At("div",Skt,[rn[11]||(rn[11]=At("div",{class:"flex items-start justify-between mb-4"},[At("div",null,[At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Web Frontend"),At("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Choose which web interface to use")])],-1)),At("div",Ckt,[At("div",Akt,[At("label",{class:ja(["flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all",yt.use_default_frontend?"border-accent-blue bg-accent-blue/10":"border-stroke-subtle dark:border-stroke/10 hover:border-accent-blue/50"])},[At("input",{type:"radio",name:"frontend",checked:yt.use_default_frontend,onChange:we,disabled:t.value,class:"mt-1 h-4 w-4 text-accent-blue focus:ring-accent-blue focus:ring-offset-background"},null,40,Mkt),rn[2]||(rn[2]=At("div",{class:"flex-1"},[At("div",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Default Frontend"),At("div",{class:"text-xs text-content-secondary dark:text-content-muted mt-1"},"Built-in pyMC Repeater web interface"),At("div",{class:"text-xs text-content-muted dark:text-content-muted/60 mt-1 font-mono"},"Built-in")],-1))],2),At("label",{class:ja(["flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all",yt.use_default_frontend?"border-stroke-subtle dark:border-stroke/10 hover:border-accent-blue/50":"border-accent-blue bg-accent-blue/10"])},[At("input",{type:"radio",name:"frontend",checked:!yt.use_default_frontend,onChange:Ce,disabled:t.value,class:"mt-1 h-4 w-4 text-accent-blue focus:ring-accent-blue focus:ring-offset-background"},null,40,Ekt),rn[3]||(rn[3]=Du('
PyMC Console
@Treehouse⚡
Alternative web interface for pyMC Repeater
/opt/pymc_console/web/html
',1))],2)]),ct.value?Ta("",!0):(Or(),Nr("div",{key:0,class:ja(["p-4 rounded-lg border",K.value?"bg-green-500/5 border-green-500/20":"bg-accent-blue/5 border-accent-blue/20"])},[At("div",Lkt,[K.value?(Or(),Nr("svg",Pkt,rn[4]||(rn[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(Or(),Nr("svg",Ikt,rn[5]||(rn[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))),At("div",Dkt,[At("h4",zkt,yn(K.value?"PyMC Console has been detected":"PyMC Console Not Installed"),1),K.value?(Or(),Nr("p",Okt,rn[6]||(rn[6]=[cl(" PyMC Console is installed at ",-1),At("code",{class:"text-green-700 dark:text-green-300"},"/opt/pymc_console/web/html",-1)]))):(Or(),Nr(Es,{key:1},[rn[7]||(rn[7]=Du('

PyMC Console must be installed at /opt/pymc_console/web/html before selecting this option.

PyMC Console Install Instructions ',2))],64))])])],2)),T.value?(Or(),Nr("div",Bkt,[At("div",Rkt,[rn[10]||(rn[10]=Du('

Service restart required

Web frontend changes will take effect after restarting the pymc-repeater service.

',1)),At("button",{onClick:kr,disabled:$.value,class:"px-4 py-2 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-500/50 text-white font-medium rounded-lg transition-colors disabled:cursor-not-allowed flex items-center gap-2 whitespace-nowrap"},[$.value?(Or(),Nr("svg",Nkt,rn[8]||(rn[8]=[At("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),At("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):(Or(),Nr("svg",jkt,rn[9]||(rn[9]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]))),cl(" "+yn($.value?"Restarting...":"Restart Now"),1)],8,Fkt)])])):Ta("",!0)])]),r.value?(Or(),Nr("div",{key:0,class:ja(["p-4 rounded-lg border",St.value])},[At("div",Ukt,[u.value?(Or(),Nr("svg",$kt,rn[12]||(rn[12]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):(Or(),Nr("svg",Hkt,rn[13]||(rn[13]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))),At("span",{class:ja(u.value?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400")},yn(r.value),3)])],2)):Ta("",!0)]))}}),Wkt={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},qkt={class:"glass-card rounded-[15px] z-10 p-3 sm:p-4 border border-cyan-400 dark:border-primary/30 bg-cyan-500/10 dark:bg-primary/10"},Gkt={class:"text-cyan-700 dark:text-primary text-sm sm:text-base"},Zkt={class:"mt-1 sm:mt-2 text-cyan-600 dark:text-primary/80"},Kkt={class:"glass-card rounded-[15px] p-3 sm:p-6"},Ykt={class:"flex overflow-x-auto border-b border-stroke-subtle dark:border-stroke/10 mb-4 sm:mb-6 -mx-3 px-3 sm:mx-0 sm:px-0 scrollbar-hide"},Xkt=["onClick"],Jkt={class:"flex items-center gap-1 sm:gap-2"},Qkt={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},t6t={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e6t={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},r6t={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n6t={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},i6t={key:5,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a6t={key:6,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o6t={class:"min-h-[400px]"},s6t={key:0,class:"flex items-center justify-center py-12"},l6t={key:1,class:"flex items-center justify-center py-12"},c6t={class:"text-center"},u6t={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},h6t={key:2},d6t=Cc({name:"ConfigurationView",__name:"Configuration",setup(e){const t=Ym(),r=li(B1("configuration_activeTab","radio")),u=li(!1);Fh(r,K=>R1("configuration_activeTab",K));const T=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"},{id:"api-tokens",label:"API Tokens",icon:"tokens"},{id:"web",label:"Web Options",icon:"web"}];Xd(async()=>{try{await t.fetchStats(),u.value=!0}catch(K){console.error("Failed to load configuration data:",K),u.value=!0}});function $(K){r.value=K}return(K,ct)=>{const yt=ES("router-link");return Or(),Nr("div",Wkt,[ct[13]||(ct[13]=At("div",null,[At("h1",{class:"text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary"},"Configuration"),At("p",{class:"text-content-secondary dark:text-content-muted mt-1 sm:mt-2 text-sm sm:text-base"},"System configuration and settings")],-1)),At("div",qkt,[At("div",Gkt,[ct[3]||(ct[3]=At("strong",null,"CAD Calibration Tool Available",-1)),At("p",Zkt,[ct[2]||(ct[2]=cl(" Optimize your Channel Activity Detection settings. ",-1)),Vs(yt,{to:"/cad-calibration",class:"underline hover:text-cyan-800 dark:hover:text-primary transition-colors"},{default:V1(()=>ct[1]||(ct[1]=[cl(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[1]})])])]),At("div",Kkt,[At("div",Ykt,[(Or(),Nr(Es,null,jl(T,St=>At("button",{key:St.id,onClick:Ut=>$(St.id),class:ja(["px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium transition-colors duration-200 border-b-2 mr-3 sm:mr-6 whitespace-nowrap flex-shrink-0",r.value===St.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[At("div",Jkt,[St.icon==="radio"?(Or(),Nr("svg",Qkt,ct[4]||(ct[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):St.icon==="repeater"?(Or(),Nr("svg",t6t,ct[5]||(ct[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):St.icon==="duty"?(Or(),Nr("svg",e6t,ct[6]||(ct[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):St.icon==="delays"?(Or(),Nr("svg",r6t,ct[7]||(ct[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):St.icon==="keys"?(Or(),Nr("svg",n6t,ct[8]||(ct[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):St.icon==="tokens"?(Or(),Nr("svg",i6t,ct[9]||(ct[9]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)]))):St.icon==="web"?(Or(),Nr("svg",a6t,ct[10]||(ct[10]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)]))):Ta("",!0),cl(" "+yn(St.label),1)])],10,Xkt)),64))]),At("div",o6t,[!u.value&&Io(t).isLoading?(Or(),Nr("div",s6t,ct[11]||(ct[11]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-muted"},"Loading configuration...")],-1)]))):Io(t).error&&!u.value?(Or(),Nr("div",l6t,[At("div",c6t,[ct[12]||(ct[12]=At("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load configuration",-1)),At("div",u6t,yn(Io(t).error),1),At("button",{onClick:ct[0]||(ct[0]=St=>Io(t).fetchStats()),class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):(Or(),Nr("div",h6t,[Ml(At("div",null,[Vs(Iwt,{key:"radio-settings"})],512),[[Zy,r.value==="radio"]]),Ml(At("div",null,[Vs(h3t,{key:"repeater-settings"})],512),[[Zy,r.value==="repeater"]]),Ml(At("div",null,[Vs(k3t,{key:"duty-cycle"})],512),[[Zy,r.value==="duty"]]),Ml(At("div",null,[Vs(R3t,{key:"transmission-delays"})],512),[[Zy,r.value==="delays"]]),Ml(At("div",null,[Vs(R4t,{key:"transport-keys"})],512),[[Zy,r.value==="transport"]]),Ml(At("div",null,[Vs(_kt,{key:"api-tokens"})],512),[[Zy,r.value==="api-tokens"]]),Ml(At("div",null,[Vs(Vkt,{key:"web-settings"})],512),[[Zy,r.value==="web"]])]))])])])}}}),f6t={class:"p-6 space-y-6"},p6t={class:"glass-card rounded-[15px] p-6"},m6t={class:"flex justify-center"},g6t={class:"flex gap-4"},v6t=["disabled"],y6t=["disabled"],_6t={class:"glass-card rounded-[15px] p-6 space-y-4"},x6t={class:"text-white"},b6t={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},w6t={class:"text-primary/90"},k6t={class:"space-y-2"},T6t={class:"w-full bg-white/10 rounded-full h-2"},S6t={class:"text-white/70 text-sm"},C6t={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},A6t={class:"glass-card rounded-[15px] p-4 text-center"},M6t={class:"text-2xl font-bold text-primary"},E6t={class:"glass-card rounded-[15px] p-4 text-center"},L6t={class:"text-2xl font-bold text-primary"},P6t={class:"glass-card rounded-[15px] p-4 text-center"},I6t={class:"text-2xl font-bold text-primary"},D6t={class:"glass-card rounded-[15px] p-4 text-center"},z6t={class:"text-2xl font-bold text-primary"},O6t={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},B6t={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},R6t={class:"text-white/80 mb-4"},F6t={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},N6t=Cc({name:"CADCalibrationView",__name:"CADCalibration",setup(e){const t=Ym(),r=li(!1),u=li(null),T=li(null),$=li({}),K=li(null),ct=li([]),yt=li({}),St=li("Ready to start calibration"),Ut=li(0),ne=li(0),pe=li(0),me=li(0),we=li(0),Ce=li(0),Ve=li(null),kr=li(!1),It=li(!1),rn=li(!1),Lr=li(!1);let Mr=null;const tn={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function Dn(){const nn=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:"#ffffff",size:14}},tickfont:{color:"#ffffff"},bgcolor:"rgba(0,0,0,0)",bordercolor:"rgba(255,255,255,0.2)",borderwidth:1,thickness:15},line:{color:"rgba(255,255,255,0.2)",width:1}},hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
",name:"Test Results"}],Cn={title:{text:'CAD Detection Rate
Channel Activity Detection Calibration',font:{color:"#ffffff",size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},yaxis:{title:{text:"CAD Min Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:"#ffffff",family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};D1.newPlot("plotly-chart",nn,Cn,tn)}function Mn(){if(Object.keys($.value).length===0)return;const nn=Object.values($.value),Cn=[],Xn=[],_i=[];for(const va of nn)Cn.push(va.det_peak),Xn.push(va.det_min),_i.push(va.detection_rate);const ta={x:[Cn],y:[Xn],"marker.color":[_i],hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
"};D1.restyle("plotly-chart",ta,[0])}async function Br(){try{const Xn=await bs.post("/cad-calibration-start",{samples:10,delay_ms:50});if(Xn.success)r.value=!0,u.value=Date.now(),t.setCadCalibrationRunning(!0),$.value={},ct.value=[],yt.value={},K.value=null,kr.value=!1,It.value=!1,rn.value=!1,Lr.value=!1,pe.value=0,me.value=0,we.value=0,Ce.value=0,Ut.value=0,ne.value=0,Mr=setInterval(()=>{u.value&&(Ce.value=Math.floor((Date.now()-u.value)/1e3))},1e3),on();else throw new Error(Xn.error||"Failed to start calibration")}catch(Xn){St.value=`Error: ${Xn instanceof Error?Xn.message:"Unknown error"}`}}async function Vn(){try{(await bs.post("/cad-calibration-stop")).success&&(r.value=!1,t.setCadCalibrationRunning(!1),T.value&&(T.value.close(),T.value=null),Mr&&(clearInterval(Mr),Mr=null))}catch(nn){console.error("Failed to stop calibration:",nn)}}function on(){T.value&&T.value.close(),T.value=new EventSource(`${PL}/api/cad-calibration-stream`),T.value.onmessage=function(nn){try{const Cn=JSON.parse(nn.data);pr(Cn)}catch(Cn){console.error("Failed to parse SSE data:",Cn)}},T.value.onerror=function(nn){console.error("SSE connection error:",nn),r.value||T.value&&(T.value.close(),T.value=null)}}function pr(nn){switch(nn.type){case"status":St.value=nn.message||"Status update",nn.test_ranges&&(Ve.value=nn.test_ranges,kr.value=!0);break;case"progress":Ut.value=nn.current||0,ne.value=nn.total||0,pe.value=nn.current||0;break;case"result":if(nn.det_peak!==void 0&&nn.det_min!==void 0&&nn.detection_rate!==void 0&&nn.detections!==void 0&&nn.samples!==void 0){const Cn=`${nn.det_peak}_${nn.det_min}`;$.value[Cn]={det_peak:nn.det_peak,det_min:nn.det_min,detection_rate:nn.detection_rate,detections:nn.detections,samples:nn.samples},Mn(),_r()}break;case"complete":case"completed":r.value=!1,St.value=nn.message||"Calibration completed",t.setCadCalibrationRunning(!1),Sr(),T.value&&(T.value.close(),T.value=null),Mr&&(clearInterval(Mr),Mr=null);break;case"error":St.value=`Error: ${nn.message}`,t.setCadCalibrationRunning(!1),Vn();break}}function _r(){const nn=Object.values($.value).map(Cn=>Cn.detection_rate);nn.length!==0&&(me.value=Math.max(...nn),we.value=nn.reduce((Cn,Xn)=>Cn+Xn,0)/nn.length)}function Sr(){It.value=!0;let nn=null,Cn=0;for(const Xn of Object.values($.value))Xn.detection_rate>Cn&&(Cn=Xn.detection_rate,nn=Xn);K.value=nn,nn&&Cn>0?(rn.value=!0,Lr.value=!1):(rn.value=!1,Lr.value=!0)}async function Dr(){if(!K.value){St.value="Error: No calibration results to save";return}try{const nn=await bs.post("/save_cad_settings",{peak:K.value.det_peak,min_val:K.value.det_min,detection_rate:K.value.detection_rate});if(nn.success)St.value=`Settings saved! Peak=${K.value.det_peak}, Min=${K.value.det_min} applied to configuration.`;else throw new Error(nn.error||"Failed to save settings")}catch(nn){St.value=`Error: Failed to save settings: ${nn instanceof Error?nn.message:"Unknown error"}`}}return Xd(()=>{Dn()}),Dv(()=>{T.value&&T.value.close(),Mr&&clearInterval(Mr),t.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&D1.purge("plotly-chart")}),(nn,Cn)=>(Or(),Nr("div",f6t,[Cn[14]||(Cn[14]=At("div",null,[At("h1",{class:"text-2xl font-bold text-white"},"CAD Calibration Tool"),At("p",{class:"text-white/70 mt-2"},"Channel Activity Detection calibration")],-1)),At("div",p6t,[At("div",m6t,[At("div",g6t,[At("button",{onClick:Br,disabled:r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Cn[0]||(Cn[0]=[Du('
Start Calibration
Begin testing
',2)]),8,v6t),At("button",{onClick:Vn,disabled:!r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Cn[1]||(Cn[1]=[Du('
Stop
Halt calibration
',2)]),8,y6t)])])]),At("div",_6t,[At("div",x6t,yn(St.value),1),kr.value&&Ve.value?(Or(),Nr("div",b6t,[At("div",w6t,[Cn[2]||(Cn[2]=At("strong",null,"Configuration:",-1)),cl(" SF"+yn(Ve.value.spreading_factor)+" | Peak: "+yn(Ve.value.peak_min)+" - "+yn(Ve.value.peak_max)+" | Min: "+yn(Ve.value.min_min)+" - "+yn(Ve.value.min_max)+" | "+yn((Ve.value.peak_max-Ve.value.peak_min+1)*(Ve.value.min_max-Ve.value.min_min+1))+" tests ",1)])])):Ta("",!0),At("div",k6t,[At("div",T6t,[At("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:Sp({width:ne.value>0?`${Ut.value/ne.value*100}%`:"0%"})},null,4)]),At("div",S6t,yn(Ut.value)+" / "+yn(ne.value)+" tests completed",1)])]),At("div",C6t,[At("div",A6t,[At("div",M6t,yn(pe.value),1),Cn[3]||(Cn[3]=At("div",{class:"text-white/70 text-sm"},"Tests Completed",-1))]),At("div",E6t,[At("div",L6t,yn(me.value.toFixed(1))+"%",1),Cn[4]||(Cn[4]=At("div",{class:"text-white/70 text-sm"},"Best Detection Rate",-1))]),At("div",P6t,[At("div",I6t,yn(we.value.toFixed(1))+"%",1),Cn[5]||(Cn[5]=At("div",{class:"text-white/70 text-sm"},"Average Rate",-1))]),At("div",D6t,[At("div",z6t,yn(Ce.value)+"s",1),Cn[6]||(Cn[6]=At("div",{class:"text-white/70 text-sm"},"Elapsed Time",-1))])]),Cn[15]||(Cn[15]=At("div",{class:"glass-card rounded-[15px] p-6"},[At("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),It.value?(Or(),Nr("div",O6t,[Cn[13]||(Cn[13]=At("h3",{class:"text-xl font-bold text-white"},"Calibration Results",-1)),rn.value&&K.value?(Or(),Nr("div",B6t,[Cn[11]||(Cn[11]=At("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),At("p",R6t,[Cn[7]||(Cn[7]=cl(" Peak: ",-1)),At("strong",null,yn(K.value.det_peak),1),Cn[8]||(Cn[8]=cl(", Min: ",-1)),At("strong",null,yn(K.value.det_min),1),Cn[9]||(Cn[9]=cl(", Rate: ",-1)),At("strong",null,yn(K.value.detection_rate.toFixed(1))+"%",1)]),At("div",{class:"flex justify-center"},[At("button",{onClick:Dr,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},Cn[10]||(Cn[10]=[Du('
Save Settings
Apply to configuration
',2)]))])])):Ta("",!0),Lr.value?(Or(),Nr("div",F6t,Cn[12]||(Cn[12]=[At("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),At("p",{class:"text-white/70"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):Ta("",!0)])):Ta("",!0)]))}}),j6t=vh(N6t,[["__scopeId","data-v-854f5f55"]]),U6t={class:"p-6 space-y-6"},$6t={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},H6t={class:"glass-card rounded-[15px] p-4"},V6t={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},W6t={class:"glass-card rounded-[15px] p-4"},q6t={class:"text-2xl font-bold text-cyan-500 dark:text-primary"},G6t={class:"glass-card rounded-[15px] p-4"},Z6t={class:"text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green"},K6t={class:"glass-card rounded-[15px] p-4"},Y6t={class:"text-2xl font-bold text-yellow-500 dark:text-secondary"},X6t={class:"glass-card rounded-[15px] p-6"},J6t={class:"flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6"},Q6t=["onClick"],tTt={class:"flex items-center gap-2"},eTt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},rTt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},nTt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},iTt={class:"min-h-[400px]"},aTt={key:0,class:"flex items-center justify-center py-12"},oTt={key:1,class:"flex items-center justify-center py-12"},sTt={class:"text-center"},lTt={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},cTt={key:2,class:"space-y-4"},uTt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},hTt={key:1,class:"space-y-4"},dTt={class:"flex items-start justify-between"},fTt={class:"flex-1"},pTt={class:"flex items-center gap-3 mb-2"},mTt={class:"text-lg font-semibold text-content-primary dark:text-content-primary"},gTt={class:"text-content-muted dark:text-content-muted text-sm"},vTt={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},yTt={class:"text-content-primary dark:text-content-primary font-medium"},_Tt={class:"text-cyan-500 dark:text-primary font-medium"},xTt={class:"mt-3 flex items-center gap-2"},bTt={key:3,class:"space-y-4"},wTt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},kTt={key:1,class:"overflow-x-auto"},TTt={class:"w-full"},STt={class:"py-3"},CTt={class:"font-mono text-sm text-content-primary dark:text-content-primary"},ATt={class:"py-3"},MTt={class:"font-mono text-xs text-content-secondary dark:text-content-muted"},ETt={class:"py-3"},LTt={class:"text-sm text-content-primary dark:text-content-primary"},PTt={class:"text-xs text-content-muted dark:text-content-muted"},ITt={class:"py-3"},DTt={class:"py-3"},zTt={class:"text-sm text-content-secondary dark:text-content-muted"},OTt={class:"py-3"},BTt=["onClick"],RTt={key:4,class:"space-y-4"},FTt={class:"mb-4"},NTt=["value"],jTt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},UTt={key:1,class:"grid grid-cols-1 gap-4"},$Tt={class:"flex items-start justify-between"},HTt={class:"flex-1"},VTt={class:"flex items-center gap-3 mb-3"},WTt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},qTt={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},GTt={class:"text-content-primary dark:text-content-primary/90 font-mono ml-2"},ZTt={class:"text-content-primary dark:text-content-primary/90 ml-2"},KTt={class:"text-content-primary dark:text-content-primary/90 ml-2"},YTt={class:"text-content-primary dark:text-content-primary/90 ml-2"},XTt=["onClick"],JTt={class:"flex justify-end"},QTt=["disabled"],tSt=Cc({name:"SessionsView",__name:"Sessions",setup(e){const t=li("overview"),r=li(!1),u=li(!1),T=li(null),$=li(null),K=li([]),ct=li(null),yt=li(null),St=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];Xd(async()=>{await Ut(),r.value=!0});async function Ut(){u.value=!0,T.value=null;try{const Ve=await bs.getACLInfo();Ve.success&&($.value=Ve.data);const kr=await bs.getACLClients();kr.success&&kr.data&&(K.value=kr.data.clients||[]);const It=await bs.getACLStats();It.success&&(ct.value=It.data)}catch(Ve){T.value=Ve instanceof Error?Ve.message:"Failed to load ACL data",console.error("Error fetching ACL data:",Ve)}finally{u.value=!1}}async function ne(Ve,kr){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const It=await bs.removeACLClient({public_key:Ve,identity_hash:kr});It.success?await Ut():alert(`Failed to remove client: ${It.error}`)}catch(It){alert(`Error removing client: ${It}`)}}function pe(Ve){return Ve?new Date(Ve*1e3).toLocaleString():"Never"}function me(Ve){t.value=Ve}const we=Ao(()=>yt.value?K.value.filter(Ve=>Ve.identity_name===yt.value):K.value),Ce=Ao(()=>$.value?$.value.acls||[]:[]);return(Ve,kr)=>(Or(),Nr("div",U6t,[kr[22]||(kr[22]=At("div",null,[At("h1",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"Sessions & Access Control"),At("p",{class:"text-content-secondary dark:text-content-muted mt-2"},"Manage authenticated clients and access control lists")],-1)),ct.value?(Or(),Nr("div",$6t,[At("div",H6t,[kr[1]||(kr[1]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Total Identities",-1)),At("div",V6t,yn(ct.value.total_identities),1)]),At("div",W6t,[kr[2]||(kr[2]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Authenticated Clients",-1)),At("div",q6t,yn(ct.value.total_clients),1)]),At("div",G6t,[kr[3]||(kr[3]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Admin Clients",-1)),At("div",Z6t,yn(ct.value.admin_clients),1)]),At("div",K6t,[kr[4]||(kr[4]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Guest Clients",-1)),At("div",Y6t,yn(ct.value.guest_clients),1)])])):Ta("",!0),At("div",X6t,[At("div",J6t,[(Or(),Nr(Es,null,jl(St,It=>At("button",{key:It.id,onClick:rn=>me(It.id),class:ja(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",t.value===It.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[At("div",tTt,[It.icon==="overview"?(Or(),Nr("svg",eTt,kr[5]||(kr[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):It.icon==="clients"?(Or(),Nr("svg",rTt,kr[6]||(kr[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):It.icon==="identities"?(Or(),Nr("svg",nTt,kr[7]||(kr[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"},null,-1)]))):Ta("",!0),cl(" "+yn(It.label),1)])],10,Q6t)),64))]),At("div",iTt,[u.value&&!r.value?(Or(),Nr("div",aTt,kr[8]||(kr[8]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-muted"},"Loading ACL data...")],-1)]))):T.value?(Or(),Nr("div",oTt,[At("div",sTt,[kr[9]||(kr[9]=At("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load ACL data",-1)),At("div",lTt,yn(T.value),1),At("button",{onClick:Ut,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):t.value==="overview"?(Or(),Nr("div",cTt,[Ce.value.length===0?(Or(),Nr("div",uTt," No identities configured ")):(Or(),Nr("div",hTt,[(Or(!0),Nr(Es,null,jl(Ce.value,It=>(Or(),Nr("div",{key:It.hash,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors"},[At("div",dTt,[At("div",fTt,[At("div",pTt,[At("h3",mTt,yn(It.name),1),At("span",{class:ja(["px-2 py-1 text-xs font-medium rounded",It.type==="repeater"?"bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},yn(It.type),3),At("span",gTt,yn(It.hash),1)]),At("div",vTt,[At("div",null,[kr[10]||(kr[10]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Max Clients",-1)),At("div",yTt,yn(It.max_clients),1)]),At("div",null,[kr[11]||(kr[11]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Authenticated",-1)),At("div",_Tt,yn(It.authenticated_clients),1)]),At("div",null,[kr[12]||(kr[12]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Admin Password",-1)),At("div",{class:ja(It.has_admin_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},yn(It.has_admin_password?"✓ Set":"✗ Not Set"),3)]),At("div",null,[kr[13]||(kr[13]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Guest Password",-1)),At("div",{class:ja(It.has_guest_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},yn(It.has_guest_password?"✓ Set":"✗ Not Set"),3)])]),At("div",xTt,[kr[14]||(kr[14]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"Read-Only Access:",-1)),At("span",{class:ja(It.allow_read_only?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},yn(It.allow_read_only?"Allowed":"Disabled"),3)])])])]))),128))]))])):t.value==="clients"?(Or(),Nr("div",bTt,[K.value.length===0?(Or(),Nr("div",wTt," No authenticated clients ")):(Or(),Nr("div",kTt,[At("table",TTt,[kr[15]||(kr[15]=At("thead",null,[At("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Client"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Address"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Identity"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Permissions"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Last Activity"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Actions")])],-1)),At("tbody",null,[(Or(!0),Nr(Es,null,jl(K.value,It=>(Or(),Nr("tr",{key:It.public_key_full,class:"border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors"},[At("td",STt,[At("div",CTt,yn(It.public_key),1)]),At("td",ATt,[At("div",MTt,yn(It.address),1)]),At("td",ETt,[At("div",LTt,yn(It.identity_name),1),At("div",PTt,yn(It.identity_hash),1)]),At("td",ITt,[At("span",{class:ja(["px-2 py-1 text-xs font-medium rounded",It.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},yn(It.permissions),3)]),At("td",DTt,[At("div",zTt,yn(pe(It.last_activity)),1)]),At("td",OTt,[At("button",{onClick:rn=>ne(It.public_key_full,It.identity_hash),class:"px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,BTt)])]))),128))])])]))])):t.value==="identities"?(Or(),Nr("div",RTt,[At("div",FTt,[kr[17]||(kr[17]=At("label",{class:"block text-content-secondary dark:text-content-muted text-sm mb-2"},"Filter by Identity",-1)),Ml(At("select",{"onUpdate:modelValue":kr[0]||(kr[0]=It=>yt.value=It),class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors"},[kr[16]||(kr[16]=At("option",{value:null},"All Identities",-1)),(Or(!0),Nr(Es,null,jl(Ce.value,It=>(Or(),Nr("option",{key:It.name,value:It.name},yn(It.name)+" ("+yn(It.authenticated_clients)+" clients) ",9,NTt))),128))],512),[[xg,yt.value]])]),we.value.length===0?(Or(),Nr("div",jTt," No clients for selected identity ")):(Or(),Nr("div",UTt,[(Or(!0),Nr(Es,null,jl(we.value,It=>(Or(),Nr("div",{key:It.public_key_full,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[At("div",$Tt,[At("div",HTt,[At("div",VTt,[At("span",{class:ja(["px-2 py-1 text-xs font-medium rounded",It.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},yn(It.permissions),3),At("span",WTt,yn(It.public_key),1)]),At("div",qTt,[At("div",null,[kr[18]||(kr[18]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Address:",-1)),At("span",GTt,yn(It.address),1)]),At("div",null,[kr[19]||(kr[19]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Identity:",-1)),At("span",ZTt,yn(It.identity_name)+" ("+yn(It.identity_hash)+")",1)]),At("div",null,[kr[20]||(kr[20]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Last Activity:",-1)),At("span",KTt,yn(pe(It.last_activity)),1)]),At("div",null,[kr[21]||(kr[21]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Last Login:",-1)),At("span",YTt,yn(pe(It.last_login_success)),1)])])]),At("button",{onClick:rn=>ne(It.public_key_full,It.identity_hash),class:"ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,XTt)])]))),128))]))])):Ta("",!0)])]),At("div",JTt,[At("button",{onClick:Ut,disabled:u.value,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50"},yn(u.value?"Refreshing...":"Refresh Data"),9,QTt)])]))}}),eSt={class:"mb-6"},rSt={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},nSt={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},iSt={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},aSt={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},oSt={class:"flex"},sSt=Cc({__name:"MessageDialog",props:{show:{type:Boolean},message:{},variant:{default:"success"}},emits:["close"],setup(e,{emit:t}){const r=e,u=t,T=ct=>{ct.target===ct.currentTarget&&u("close")},$={success:"bg-green-100 dark:bg-green-500/20 border-green-600/40 dark:border-green-500/30 text-green-600 dark:text-green-400",error:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},K={success:"bg-green-500 hover:bg-green-600",error:"bg-red-500 hover:bg-red-600",info:"bg-blue-500 hover:bg-blue-600"};return(ct,yt)=>r.show?(Or(),Nr("div",{key:0,onClick:T,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:yt[1]||(yt[1]=Od(()=>{},["stop"]))},[At("div",eSt,[At("div",{class:ja(["inline-flex p-3 rounded-xl mb-4",$[r.variant]])},[r.variant==="success"?(Or(),Nr("svg",rSt,yt[2]||(yt[2]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):r.variant==="error"?(Or(),Nr("svg",nSt,yt[3]||(yt[3]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(Or(),Nr("svg",iSt,yt[4]||(yt[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),At("p",aSt,yn(r.message),1)]),At("div",oSt,[At("button",{onClick:yt[0]||(yt[0]=St=>u("close")),class:ja(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",K[r.variant]])}," OK ",2)])])])):Ta("",!0)}}),lSt={class:"p-6 space-y-6"},cSt={class:"relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10"},uSt={class:"relative flex items-center justify-between"},hSt={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},dSt={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},fSt={class:"relative flex items-center justify-between"},pSt={class:"text-3xl font-bold text-content-primary dark:text-content-primary mb-1"},mSt={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},gSt={class:"relative flex items-center justify-between"},vSt={class:"text-3xl font-bold text-primary mb-1"},ySt={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},_St={class:"relative flex items-center justify-between"},xSt={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},bSt={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},wSt={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},kSt={key:0,class:"flex items-center justify-center py-12"},TSt={key:1,class:"flex items-center justify-center py-12"},SSt={class:"text-center"},CSt={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},ASt={key:2,class:"space-y-4"},MSt={class:"relative flex items-start justify-between"},ESt={class:"flex-1"},LSt={class:"flex items-center gap-3 mb-4"},PSt={class:"relative"},ISt={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},DSt={class:"text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"},zSt={key:0,class:"text-content-muted dark:text-content-muted text-sm"},OSt={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},BSt={class:"text-content-primary dark:text-content-primary/90 ml-2"},RSt={class:"flex items-center gap-2"},FSt={key:0,class:"text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs"},NSt={key:1,class:"text-content-muted dark:text-content-muted ml-2 text-xs"},jSt=["onClick"],USt={class:"text-content-primary dark:text-content-primary/90 ml-2"},$St={key:0},HSt={class:"text-content-primary dark:text-content-primary/90 ml-2"},VSt={key:0,class:"text-accent-green"},WSt={key:1,class:"text-content-muted dark:text-content-muted"},qSt={key:2,class:"text-primary"},GSt={key:0,class:"text-xs text-content-muted dark:text-content-muted font-mono"},ZSt={class:"ml-4 flex flex-wrap gap-2"},KSt=["onClick","disabled","title"],YSt=["onClick","disabled","title"],XSt=["onClick"],JSt=["onClick"],QSt={key:3,class:"text-center py-12 text-content-secondary dark:text-content-muted"},t8t={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},e8t={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},r8t={class:"space-y-4"},n8t={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},i8t={key:0},a8t={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},o8t={class:"grid grid-cols-2 gap-4"},s8t={class:"grid grid-cols-2 gap-4"},l8t={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},c8t={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},u8t={class:"space-y-4"},h8t=["value"],d8t={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},f8t={key:0},p8t={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},m8t={class:"grid grid-cols-2 gap-4"},g8t={class:"grid grid-cols-2 gap-4"},v8t={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},y8t={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl"},_8t={class:"relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10"},x8t={class:"relative flex items-center justify-between"},b8t={class:"flex items-center gap-4"},w8t={class:"text-content-secondary dark:text-content-muted text-sm flex items-center gap-2"},k8t={class:"text-primary font-semibold"},T8t={class:"flex items-center gap-2"},S8t={class:"bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]"},C8t={class:"flex-1 overflow-y-auto mb-4 space-y-3"},A8t={key:0,class:"flex items-center justify-center py-12"},M8t={key:1,class:"flex items-center justify-center py-12"},E8t={class:"text-center"},L8t={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},P8t={key:2,class:"space-y-3"},I8t={class:"relative flex items-start justify-between gap-3"},D8t={class:"flex-1 min-w-0"},z8t={class:"flex items-center gap-2 mb-3"},O8t={class:"flex items-center gap-2 flex-wrap"},B8t={key:0,class:"text-primary text-sm font-bold"},R8t={key:1,class:"text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20"},F8t={key:2,class:"text-content-muted dark:text-content-muted text-xs"},N8t={class:"text-content-secondary dark:text-content-muted text-xs flex items-center gap-1"},j8t={key:3,class:"text-content-muted dark:text-content-muted/50 text-[10px] font-mono bg-background-mute dark:bg-white/5 px-1.5 py-0.5 rounded"},U8t={class:"text-content-primary dark:text-content-primary/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-gray-50 dark:bg-white/5 p-3 rounded-[10px] border border-stroke-subtle dark:border-white/5"},$8t=["onClick"],H8t={key:0,class:"text-center pt-4"},V8t={key:1,class:"text-center pt-4"},W8t={key:3,class:"flex items-center justify-center h-full"},q8t={class:"relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4"},G8t={class:"relative space-y-3"},Z8t={class:"flex gap-3"},K8t={class:"flex-1 relative"},Y8t=["onKeydown"],X8t=["disabled"],J8t={key:1,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4"},Q8t={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col"},tCt={class:"flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10"},eCt={class:"text-content-secondary dark:text-content-primary/70 text-sm mt-1"},rCt={class:"text-primary"},nCt={class:"flex-1 overflow-y-auto space-y-3"},iCt={key:0,class:"text-center py-12"},aCt={class:"space-y-2"},oCt={class:"flex items-center justify-between"},sCt={class:"flex items-center gap-2"},lCt={class:"text-content-primary dark:text-content-primary font-semibold"},cCt={class:"flex items-center gap-2"},uCt={class:"text-content-secondary dark:text-content-muted text-xs"},hCt=["onClick"],dCt={class:"space-y-1 text-xs"},fCt={class:"flex items-center gap-2"},pCt={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded"},mCt={class:"flex items-center gap-2"},gCt={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all"},vCt={class:"flex items-center justify-between text-xs text-content-secondary dark:text-content-muted"},yCt={class:"flex items-center gap-4"},_Ct={key:0},xCt={key:1},bCt={key:0},wCt=Cc({name:"RoomServersView",__name:"RoomServers",setup(e){const t=li(!1),r=li(null),u=li(null),T=li(!1),$=li(!1),K=li(null),ct=li(!1),yt=li(!1),St=li(new Set),Ut=li(!1),ne=li(""),pe=li(!1),me=li({message:"",variant:"success"}),we=li(!1),Ce=li(""),Ve=li(""),kr=li([]),It=li(!1),rn=li(null),Lr=li(""),Mr=li(B1("roomServers_messagesLimit",50)),tn=li(0),Dn=li(!0);Fh(Mr,xa=>R1("roomServers_messagesLimit",xa));const Mn=li([]),Br=li(!1),Vn=li({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});Xd(async()=>{await on()});async function on(){t.value=!0,r.value=null;try{const xa=await bs.getIdentities();xa.success?u.value=xa.data:r.value=xa.error||"Failed to load identities"}catch(xa){r.value=xa instanceof Error?xa.message:"Failed to load identities"}finally{t.value=!1}}async function pr(){try{const xa=await bs.createIdentity(Vn.value);xa.success?(T.value=!1,_i(),await on(),nn(xa.message||"Identity created successfully!","success")):nn(`Failed to create identity: ${xa.error}`,"error")}catch(xa){nn(`Error creating identity: ${xa}`,"error")}}async function _r(){try{const xa=await bs.updateIdentity(K.value);xa.success?($.value=!1,K.value=null,await on(),nn(xa.message||"Identity updated successfully!","success")):nn(`Failed to update identity: ${xa.error}`,"error")}catch(xa){nn(`Error updating identity: ${xa}`,"error")}}function Sr(xa){ne.value=xa,Ut.value=!0}async function Dr(){const xa=ne.value;Ut.value=!1;try{const Ur=await bs.deleteIdentity(xa);Ur.success?(await on(),nn(Ur.message||"Identity deleted successfully!","success")):nn(`Failed to delete identity: ${Ur.error}`,"error")}catch(Ur){nn(`Error deleting identity: ${Ur}`,"error")}finally{ne.value=""}}function nn(xa,Ur){me.value={message:xa,variant:Ur},pe.value=!0}async function Cn(xa){try{const Ur=await bs.sendRoomServerAdvert(xa);Ur.success?nn(Ur.message||`Advert sent for '${xa}'!`,"success"):nn(`Failed to send advert: ${Ur.error}`,"error")}catch(Ur){nn(`Error sending advert: ${Ur}`,"error")}}function Xn(xa){K.value=JSON.parse(JSON.stringify(xa)),K.value.settings||(K.value.settings={}),K.value.settings.admin_password||(K.value.settings.admin_password=""),K.value.settings.guest_password||(K.value.settings.guest_password=""),yt.value=!1,$.value=!0}function _i(){Vn.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},ct.value=!1}function ta(){T.value=!1,$.value=!1,K.value=null,ct.value=!1,yt.value=!1,_i()}function va(xa){St.value.has(xa)?St.value.delete(xa):St.value.add(xa)}async function _a(xa){Ce.value=xa,we.value=!0,tn.value=0,Dn.value=!0;const Ur=u.value?.configured.find(Sn=>Sn.name===xa);Ve.value=Ur?.hash||"",await qi(),await Bi(!0)}async function qi(){try{console.log("Fetching ACL clients for room:",Ce.value,"hash:",Ve.value);const xa=await bs.getACLClients({identity_hash:Ve.value,identity_name:Ce.value});console.log("ACL clients response:",xa),xa.success&&xa.data&&(Mn.value=xa.data.clients||[],console.log("ACL clients loaded:",Mn.value.length))}catch(xa){console.error("Failed to fetch ACL clients:",xa)}}async function Bi(xa=!1){xa&&(tn.value=0,kr.value=[]),It.value=!0,rn.value=null;try{const Ur=await bs.getRoomMessages({room_name:Ce.value,limit:Mr.value,offset:tn.value});if(Ur.success&&Ur.data){const Sn=Ur.data.messages||[];xa?kr.value=Sn:kr.value=[...kr.value,...Sn],Dn.value=Sn.length===Mr.value}else rn.value=Ur.error||"Failed to load messages"}catch(Ur){rn.value=Ur instanceof Error?Ur.message:"Failed to load messages"}finally{It.value=!1}}async function Xi(){tn.value+=Mr.value,await Bi(!1)}async function Yn(){if(Lr.value.trim())try{const xa=await bs.postRoomMessage({room_name:Ce.value,message:Lr.value,author_pubkey:"server"});xa.success?(Lr.value="",await Bi(!0)):nn(`Failed to send message: ${xa.error}`,"error")}catch(xa){nn(`Error sending message: ${xa}`,"error")}}async function hi(xa){if(confirm("Are you sure you want to delete this message?"))try{const Ur=await bs.deleteRoomMessage({room_name:Ce.value,message_id:xa});Ur.success?(await Bi(!0),nn("Message deleted successfully","success")):nn(`Failed to delete message: ${Ur.error}`,"error")}catch(Ur){nn(`Error deleting message: ${Ur}`,"error")}}function aa(){we.value=!1,Ce.value="",Ve.value="",kr.value=[],Lr.value="",rn.value=null,Mn.value=[]}function io(xa){return xa?new Date(xa*1e3).toLocaleString():"Unknown"}async function oo(xa,Ur){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const Sn=await bs.removeACLClient({public_key:xa,identity_hash:Ur});Sn.success?(await qi(),nn("Client removed successfully","success")):nn(`Failed to remove client: ${Sn.error}`,"error")}catch(Sn){nn(`Error removing client: ${Sn}`,"error")}}return(xa,Ur)=>(Or(),Nr(Es,null,[At("div",lSt,[At("div",cSt,[Ur[26]||(Ur[26]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),Ur[27]||(Ur[27]=At("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),At("div",uSt,[Ur[25]||(Ur[25]=Du('

Room Servers

Manage room server identities and messages

',1)),At("button",{onClick:Ur[0]||(Ur[0]=Sn=>T.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},Ur[24]||(Ur[24]=[At("span",{class:"flex items-center gap-2"},[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})]),cl(" Add Room Server ")],-1)]))])]),u.value&&u.value.total_configured>0?(Or(),Nr("div",hSt,[At("div",dSt,[Ur[30]||(Ur[30]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",fSt,[At("div",null,[Ur[28]||(Ur[28]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),At("div",pSt,yn(u.value.total_configured),1)]),Ur[29]||(Ur[29]=At("div",{class:"bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors"},[At("svg",{class:"w-6 h-6 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),At("div",mSt,[Ur[33]||(Ur[33]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",gSt,[At("div",null,[Ur[31]||(Ur[31]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),At("div",vSt,yn(u.value.total_registered),1)]),Ur[32]||(Ur[32]=At("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[At("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),At("div",ySt,[Ur[37]||(Ur[37]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",_St,[At("div",null,[Ur[34]||(Ur[34]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),At("div",{class:ja(["text-3xl font-bold",u.value.total_registered===u.value.total_configured?"text-accent-green":"text-accent-yellow"])},yn(u.value.total_registered===u.value.total_configured?"Synced":"Out of Sync"),3)]),At("div",{class:ja(["p-3 rounded-[12px] transition-colors",u.value.total_registered===u.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[u.value.total_registered===u.value.total_configured?(Or(),Nr("svg",xSt,Ur[35]||(Ur[35]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(Or(),Nr("svg",bSt,Ur[36]||(Ur[36]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):Ta("",!0),At("div",wSt,[t.value?(Or(),Nr("div",kSt,Ur[38]||(Ur[38]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading room servers...")],-1)]))):r.value?(Or(),Nr("div",TSt,[At("div",SSt,[Ur[39]||(Ur[39]=At("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load room servers",-1)),At("div",CSt,yn(r.value),1),At("button",{onClick:on,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):u.value&&u.value.configured.length>0?(Or(),Nr("div",ASt,[(Or(!0),Nr(Es,null,jl(u.value.configured,Sn=>(Or(),Nr("div",{key:Sn.name,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[Ur[46]||(Ur[46]=At("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",MSt,[At("div",ESt,[At("div",LSt,[At("div",PSt,[Sn.registered?(Or(),Nr("div",ISt)):Ta("",!0),At("div",{class:ja(["relative w-3 h-3 rounded-full",Sn.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),At("h3",DSt,yn(Sn.name),1),At("span",{class:ja(["px-3 py-1 text-xs font-semibold rounded-full",Sn.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},yn(Sn.registered?"● Active":"○ Inactive"),3),Sn.hash?(Or(),Nr("span",zSt,yn(Sn.hash),1)):Ta("",!0)]),At("div",OSt,[At("div",null,[Ur[40]||(Ur[40]=At("span",{class:"text-content-muted dark:text-content-muted"},"Node Name:",-1)),At("span",BSt,yn(Sn.settings?.node_name||"Not set"),1)]),At("div",RSt,[Ur[41]||(Ur[41]=At("span",{class:"text-content-muted dark:text-content-muted"},"Identity Key:",-1)),St.value.has(Sn.name)?(Or(),Nr("span",FSt,yn(Sn.identity_key),1)):(Or(),Nr("span",NSt," •••••••••••••••• ")),At("button",{onClick:Hn=>va(Sn.name),class:"text-primary/70 hover:text-primary text-xs underline"},yn(St.value.has(Sn.name)?"Hide":"Show"),9,jSt)]),At("div",null,[Ur[42]||(Ur[42]=At("span",{class:"text-content-muted dark:text-content-muted"},"Location:",-1)),At("span",USt,yn(Sn.settings?.latitude||0)+", "+yn(Sn.settings?.longitude||0),1)]),Sn.settings?.admin_password||Sn.settings?.guest_password?(Or(),Nr("div",$St,[Ur[43]||(Ur[43]=At("span",{class:"text-content-muted dark:text-content-muted"},"Passwords:",-1)),At("span",HSt,[Sn.settings?.admin_password?(Or(),Nr("span",VSt,"Admin")):Ta("",!0),Sn.settings?.admin_password&&Sn.settings?.guest_password?(Or(),Nr("span",WSt," / ")):Ta("",!0),Sn.settings?.guest_password?(Or(),Nr("span",qSt,"Guest")):Ta("",!0)])])):Ta("",!0)]),Sn.address?(Or(),Nr("div",GSt," Address: "+yn(Sn.address),1)):Ta("",!0)]),At("div",ZSt,[At("button",{onClick:Hn=>_a(Sn.name),disabled:!Sn.registered,class:ja(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Sn.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:Sn.registered?"Manage messages for this room":"Room server must be active to manage messages"},Ur[44]||(Ur[44]=[At("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),cl(" Messages ",-1)]),10,KSt),At("button",{onClick:Hn=>Cn(Sn.name),disabled:!Sn.registered,class:ja(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Sn.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:Sn.registered?"Send advert for this room server":"Room server must be active to send advert"},Ur[45]||(Ur[45]=[At("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),cl(" Send Advert ",-1)]),10,YSt),At("button",{onClick:Hn=>Xn(Sn),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,XSt),At("button",{onClick:Hn=>Sr(Sn.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,JSt)])])]))),128))])):(Or(),Nr("div",QSt,[Ur[47]||(Ur[47]=At("svg",{class:"w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),Ur[48]||(Ur[48]=At("p",{class:"text-lg mb-2"},"No room servers configured",-1)),Ur[49]||(Ur[49]=At("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),At("button",{onClick:Ur[1]||(Ur[1]=Sn=>T.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),T.value?(Or(),Nr("div",t8t,[At("div",e8t,[Ur[60]||(Ur[60]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Add Room Server",-1)),At("div",r8t,[At("div",null,[Ur[50]||(Ur[50]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Name *",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[2]||(Ur[2]=Sn=>Vn.value.name=Sn),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.name]])]),At("div",null,[At("label",n8t,[Ur[51]||(Ur[51]=cl(" Identity Key (Optional) ",-1)),At("button",{onClick:Ur[3]||(Ur[3]=Sn=>ct.value=!ct.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},yn(ct.value?"Hide":"Show/Edit"),1)]),ct.value?(Or(),Nr("div",i8t,[Ml(At("input",{"onUpdate:modelValue":Ur[4]||(Ur[4]=Sn=>Vn.value.identity_key=Sn),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.identity_key]]),Ur[52]||(Ur[52]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(Or(),Nr("div",a8t," Will be auto-generated if not provided "))]),At("div",null,[Ur[53]||(Ur[53]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[5]||(Ur[5]=Sn=>Vn.value.settings.node_name=Sn),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.node_name]])]),At("div",o8t,[At("div",null,[Ur[54]||(Ur[54]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[6]||(Ur[6]=Sn=>Vn.value.settings.latitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.latitude,void 0,{number:!0}]])]),At("div",null,[Ur[55]||(Ur[55]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[7]||(Ur[7]=Sn=>Vn.value.settings.longitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.longitude,void 0,{number:!0}]])])]),At("div",s8t,[At("div",null,[Ur[56]||(Ur[56]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password (Optional)",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[8]||(Ur[8]=Sn=>Vn.value.settings.admin_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.admin_password]]),Ur[57]||(Ur[57]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),At("div",null,[Ur[58]||(Ur[58]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password (Optional)",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[9]||(Ur[9]=Sn=>Vn.value.settings.guest_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.guest_password]]),Ur[59]||(Ur[59]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),At("div",{class:"flex justify-end gap-3 mt-6"},[At("button",{onClick:ta,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{onClick:pr,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):Ta("",!0),$.value&&K.value?(Or(),Nr("div",l8t,[At("div",c8t,[Ur[72]||(Ur[72]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Edit Room Server",-1)),At("div",u8t,[At("div",null,[Ur[61]||(Ur[61]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Current Name",-1)),At("input",{value:K.value.name,disabled:"",type:"text",class:"w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed"},null,8,h8t)]),At("div",null,[Ur[62]||(Ur[62]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"New Name (optional)",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[10]||(Ur[10]=Sn=>K.value.new_name=Sn),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.new_name]])]),At("div",null,[At("label",d8t,[Ur[63]||(Ur[63]=cl(" Identity Key (Optional) ",-1)),At("button",{onClick:Ur[11]||(Ur[11]=Sn=>yt.value=!yt.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},yn(yt.value?"Hide":"Show/Edit"),1)]),yt.value?(Or(),Nr("div",f8t,[Ml(At("input",{"onUpdate:modelValue":Ur[12]||(Ur[12]=Sn=>K.value.identity_key=Sn),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.identity_key]]),Ur[64]||(Ur[64]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(Or(),Nr("div",p8t,' Click "Show/Edit" to change the identity key '))]),At("div",null,[Ur[65]||(Ur[65]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[13]||(Ur[13]=Sn=>K.value.settings.node_name=Sn),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.node_name]])]),At("div",m8t,[At("div",null,[Ur[66]||(Ur[66]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[14]||(Ur[14]=Sn=>K.value.settings.latitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.latitude,void 0,{number:!0}]])]),At("div",null,[Ur[67]||(Ur[67]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[15]||(Ur[15]=Sn=>K.value.settings.longitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.longitude,void 0,{number:!0}]])])]),At("div",g8t,[At("div",null,[Ur[68]||(Ur[68]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[16]||(Ur[16]=Sn=>K.value.settings.admin_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.admin_password]]),Ur[69]||(Ur[69]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),At("div",null,[Ur[70]||(Ur[70]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[17]||(Ur[17]=Sn=>K.value.settings.guest_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.guest_password]]),Ur[71]||(Ur[71]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),At("div",{class:"flex justify-end gap-3 mt-6"},[At("button",{onClick:ta,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{onClick:_r,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):Ta("",!0)]),Vs(qH,{show:Ut.value,title:"Delete Room Server",message:`Are you sure you want to delete '${ne.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:Ur[18]||(Ur[18]=Sn=>Ut.value=!1),onConfirm:Dr},null,8,["show","message"]),Vs(sSt,{show:pe.value,message:me.value.message,variant:me.value.variant,onClose:Ur[19]||(Ur[19]=Sn=>pe.value=!1)},null,8,["show","message","variant"]),we.value?(Or(),Nr("div",v8t,[At("div",y8t,[At("div",_8t,[Ur[79]||(Ur[79]=At("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),Ur[80]||(Ur[80]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),At("div",x8t,[At("div",b8t,[Ur[75]||(Ur[75]=Du('
',1)),At("div",null,[Ur[74]||(Ur[74]=At("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Room Messages",-1)),At("p",w8t,[Ur[73]||(Ur[73]=At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),At("span",k8t,yn(Ce.value),1)])])]),At("div",T8t,[At("button",{onClick:Ur[20]||(Ur[20]=Sn=>Br.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[Ur[76]||(Ur[76]=At("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),Ur[77]||(Ur[77]=At("span",{class:"hidden sm:inline"},"Sessions",-1)),At("span",S8t,yn(Mn.value.length),1)]),At("button",{onClick:aa,class:"p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all"},Ur[78]||(Ur[78]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])]),At("div",C8t,[It.value&&kr.value.length===0?(Or(),Nr("div",A8t,Ur[81]||(Ur[81]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading messages...")],-1)]))):rn.value?(Or(),Nr("div",M8t,[At("div",E8t,[Ur[82]||(Ur[82]=At("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load messages",-1)),At("div",L8t,yn(rn.value),1),At("button",{onClick:Ur[21]||(Ur[21]=Sn=>Bi(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):kr.value.length>0?(Or(),Nr("div",P8t,[(Or(!0),Nr(Es,null,jl(kr.value,(Sn,Hn)=>(Or(),Nr("div",{key:Sn.id||Hn,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[Ur[87]||(Ur[87]=At("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",I8t,[At("div",D8t,[At("div",z8t,[At("div",O8t,[Ur[84]||(Ur[84]=At("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[At("svg",{class:"w-3 h-3 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),Sn.author_name?(Or(),Nr("span",B8t,yn(Sn.author_name),1)):Ta("",!0),Sn.author_pubkey?(Or(),Nr("span",R8t,yn(Sn.author_pubkey.substring(0,8))+"... ",1)):(Or(),Nr("span",F8t," Anonymous ")),Ur[85]||(Ur[85]=At("span",{class:"text-content-muted dark:text-content-muted/60 text-xs"},"•",-1)),At("span",N8t,[Ur[83]||(Ur[83]=At("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),cl(" "+yn(io(Sn.timestamp)),1)]),Sn.id?(Or(),Nr("span",j8t," #"+yn(Sn.id),1)):Ta("",!0)])]),At("div",U8t,yn(Sn.message_text),1)]),At("button",{onClick:Qa=>hi(Sn.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},Ur[86]||(Ur[86]=[At("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,$8t)])]))),128)),Dn.value&&!It.value?(Or(),Nr("div",H8t,[At("button",{onClick:Xi,class:"group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto"},Ur[88]||(Ur[88]=[At("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),cl(" Load More Messages ",-1)]))])):It.value?(Or(),Nr("div",V8t,Ur[89]||(Ur[89]=[At("div",{class:"flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm"},[At("div",{class:"animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full"}),cl(" Loading... ")],-1)]))):Ta("",!0)])):(Or(),Nr("div",W8t,Ur[90]||(Ur[90]=[Du('

No messages yet

Be the first to start the conversation

',1)])))]),At("div",q8t,[Ur[93]||(Ur[93]=At("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),At("div",G8t,[At("div",Z8t,[At("div",K8t,[Ml(At("textarea",{"onUpdate:modelValue":Ur[22]||(Ur[22]=Sn=>Lr.value=Sn),onKeydown:[Sx(Od(Yn,["ctrl"]),["enter"]),Sx(Od(Yn,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none"},null,40,Y8t),[[lu,Lr.value]])]),At("button",{onClick:Yn,disabled:!Lr.value.trim(),class:ja(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",Lr.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"])},Ur[91]||(Ur[91]=[At("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),At("span",{class:"hidden sm:inline"},"Send",-1)]),10,X8t)]),Ur[92]||(Ur[92]=At("p",{class:"text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2"},[At("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),cl(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):Ta("",!0),Br.value?(Or(),Nr("div",J8t,[At("div",Q8t,[At("div",tCt,[At("div",null,[Ur[95]||(Ur[95]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Active Sessions",-1)),At("p",eCt,[Ur[94]||(Ur[94]=cl("Room: ",-1)),At("span",rCt,yn(Ce.value),1)])]),At("button",{onClick:Ur[23]||(Ur[23]=Sn=>Br.value=!1),class:"text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors"},Ur[96]||(Ur[96]=[At("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",nCt,[Mn.value.length===0?(Or(),Nr("div",iCt,Ur[97]||(Ur[97]=[At("div",{class:"text-content-secondary dark:text-content-muted"},"No active sessions found",-1)]))):Ta("",!0),(Or(!0),Nr(Es,null,jl(Mn.value,(Sn,Hn)=>(Or(),Nr("div",{key:Sn.public_key_full||Hn,class:"glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[At("div",aCt,[At("div",oCt,[At("div",sCt,[At("span",lCt,yn(Sn.identity_name||"Unknown"),1),At("span",{class:ja(["px-2 py-0.5 text-xs font-medium rounded",Sn.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},yn(Sn.permissions),3)]),At("div",cCt,[At("span",uCt,yn(Sn.identity_type),1),At("button",{onClick:Qa=>oo(Sn.public_key_full,Sn.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,hCt)])]),At("div",dCt,[At("div",fCt,[Ur[98]||(Ur[98]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Short Key:",-1)),At("code",pCt,yn(Sn.public_key),1)]),At("div",mCt,[Ur[99]||(Ur[99]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Full Key:",-1)),At("code",gCt,yn(Sn.public_key_full),1)])]),At("div",vCt,[At("div",yCt,[Sn.address?(Or(),Nr("span",_Ct,"📍 "+yn(Sn.address),1)):Ta("",!0),Sn.last_login_success?(Or(),Nr("span",xCt,"Last Login: "+yn(new Date(Sn.last_login_success*1e3).toLocaleString()),1)):Ta("",!0)]),Sn.last_activity?(Or(),Nr("span",bCt,"Active: "+yn(Math.floor((Date.now()/1e3-Sn.last_activity)/60))+"m ago",1)):Ta("",!0)])])]))),128))])])])):Ta("",!0)],64))}}),kCt={class:"space-y-6"},TCt={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},SCt={class:"flex items-center justify-between mb-4"},CCt=["disabled"],ACt={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},MCt={class:"flex flex-wrap gap-2"},ECt=["onClick"],LCt={key:0,class:"w-px h-6 bg-stroke-subtle dark:bg-stroke/20 mx-2 self-center"},PCt=["onClick"],ICt={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden"},DCt={key:0,class:"p-8 text-center"},zCt={key:1,class:"p-8 text-center"},OCt={class:"text-content-secondary dark:text-content-muted mb-4"},BCt={key:2,class:"max-h-[600px] overflow-y-auto"},RCt={key:0,class:"p-8 text-center"},FCt={key:1,class:"divide-y divide-gray-200 dark:divide-white/5"},NCt={class:"flex-shrink-0 text-content-secondary dark:text-content-muted"},jCt={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-600 dark:text-blue-400"},UCt={class:"text-content-primary dark:text-content-primary flex-1 break-all"},$Ct=Cc({name:"LogsView",__name:"Logs",setup(e){const t=li([]),r=li(new Set),u=li(new Set(["DEBUG","INFO","WARNING","ERROR"])),T=li(new Set),$=li(new Set),K=li(!0),ct=li(null);let yt=null;const St=on=>{const pr=on.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return pr?pr[1].trim():"Unknown"},Ut=on=>{const pr=on.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return pr?pr[1]:on},ne=(on,pr)=>{if(on.size!==pr.size)return!1;for(const _r of on)if(!pr.has(_r))return!1;return!0},pe=async()=>{try{const on=await bs.getLogs();if(on.logs&&on.logs.length>0){t.value=on.logs;const pr=new Set;t.value.forEach(nn=>{const Cn=St(nn.message);pr.add(Cn)});const _r=new Set;t.value.forEach(nn=>{_r.add(nn.level)}),r.value.size===0&&(r.value=new Set(pr));const Sr=!ne(T.value,pr),Dr=!ne($.value,_r);Sr&&(T.value=pr),Dr&&($.value=_r),ct.value=null}}catch(on){console.error("Error loading logs:",on),ct.value=on instanceof Error?on.message:"Failed to load logs"}finally{K.value=!1}},me=Ao(()=>t.value.filter(pr=>{const _r=St(pr.message),Sr=r.value.has(_r),Dr=u.value.has(pr.level);return Sr&&Dr})),we=Ao(()=>Array.from(T.value).sort()),Ce=Ao(()=>{const on=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from($.value).sort((_r,Sr)=>{const Dr=on.indexOf(_r),nn=on.indexOf(Sr);return Dr!==-1&&nn!==-1?Dr-nn:_r.localeCompare(Sr)})}),Ve=on=>{u.value.has(on)?u.value.delete(on):u.value.add(on),u.value=new Set(u.value)},kr=on=>new Date(on).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),It=on=>({ERROR:"text-red-600 dark:text-red-400 bg-red-900/20",WARNING:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",INFO:"text-blue-600 dark:text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[on]||"text-gray-400 bg-gray-900/20",rn=(on,pr)=>pr?{ERROR:"bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400 border-red-500/50",WARNING:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[on]||"bg-primary/20 text-primary border-primary/50":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-white/60 border-stroke-subtle dark:border-white/20 hover:bg-stroke-subtle dark:hover:bg-white/10",Lr=on=>{r.value.has(on)?r.value.delete(on):r.value.add(on),r.value=new Set(r.value)},Mr=()=>{r.value=new Set(T.value)},tn=()=>{r.value=new Set},Dn=()=>{u.value=new Set($.value)},Mn=()=>{u.value=new Set},Br=()=>{yt&&clearInterval(yt),yt=setInterval(pe,5e3)},Vn=()=>{yt&&(clearInterval(yt),yt=null)};return Xd(()=>{pe(),Br()}),Tg(()=>{Vn()}),(on,pr)=>(Or(),Nr("div",kCt,[At("div",TCt,[At("div",SCt,[pr[1]||(pr[1]=At("div",null,[At("h1",{class:"text-content-primary dark:text-content-primary text-2xl font-semibold mb-2"},"System Logs"),At("p",{class:"text-content-secondary dark:text-content-muted"},"Real-time system events and diagnostics")],-1)),At("button",{onClick:pe,disabled:K.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(Or(),Nr("svg",{class:ja(["w-4 h-4",{"animate-spin":K.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},pr[0]||(pr[0]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),cl(" "+yn(K.value?"Loading...":"Refresh"),1)],8,CCt)]),At("div",ACt,[At("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[pr[2]||(pr[2]=At("span",{class:"text-content-primary dark:text-content-primary font-medium"},"Filters:",-1)),At("button",{onClick:Mr,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),At("button",{onClick:tn,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),pr[3]||(pr[3]=At("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),At("button",{onClick:Dn,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),At("button",{onClick:Mn,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),At("div",MCt,[(Or(!0),Nr(Es,null,jl(we.value,_r=>(Or(),Nr("button",{key:"logger-"+_r,onClick:Sr=>Lr(_r),class:ja(["px-3 py-1 text-xs border rounded-full transition-colors",r.value.has(_r)?"bg-primary/20 text-primary border-primary/50":"bg-background-mute dark:bg-white/5 text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/10"])},yn(_r),11,ECt))),128)),we.value.length>0&&Ce.value.length>0?(Or(),Nr("div",LCt)):Ta("",!0),(Or(!0),Nr(Es,null,jl(Ce.value,_r=>(Or(),Nr("button",{key:"level-"+_r,onClick:Sr=>Ve(_r),class:ja(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",u.value.has(_r)?rn(_r,!0):rn(_r,!1)])},yn(_r),11,PCt))),128))])])]),At("div",ICt,[K.value&&t.value.length===0?(Or(),Nr("div",DCt,pr[4]||(pr[4]=[At("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),At("p",{class:"text-content-secondary dark:text-content-muted"},"Loading system logs...",-1)]))):ct.value?(Or(),Nr("div",zCt,[pr[5]||(pr[5]=At("div",{class:"text-red-600 dark:text-red-400 mb-4"},[At("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),pr[6]||(pr[6]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg font-medium mb-2"},"Error Loading Logs",-1)),At("p",OCt,yn(ct.value),1),At("button",{onClick:pe,class:"px-4 py-2 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(Or(),Nr("div",BCt,[me.value.length===0?(Or(),Nr("div",RCt,pr[7]||(pr[7]=[Du('

No Logs to Display

No logs match the current filter criteria.

',3)]))):(Or(),Nr("div",FCt,[(Or(!0),Nr(Es,null,jl(me.value,(_r,Sr)=>(Or(),Nr("div",{key:Sr,class:"flex items-start gap-4 p-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors font-mono text-sm"},[At("span",NCt," ["+yn(kr(_r.timestamp))+"] ",1),At("span",jCt,yn(St(_r.message)),1),At("span",{class:ja(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",It(_r.level)])},yn(_r.level),3),At("span",UCt,yn(Ut(_r.message)),1)]))),128))]))]))])]))}});/** +*/return window.Plotly=r,r})}(CT)),CT.exports}var VH=Abt();const D1=_H(VH),tM=Unt({__proto__:null,default:D1},[VH]),Mbt={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},Ebt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3"},Lbt={class:"flex items-center gap-2 sm:gap-3"},Pbt=["value"],Ibt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"},Dbt={class:"glass-card rounded-[15px] p-3 sm:p-6"},zbt={class:"relative h-40 sm:h-48 rounded-lg p-2 sm:p-4"},Obt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},Bbt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},Rbt={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 items-stretch"},Fbt={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},Nbt={class:"relative flex-1 min-h-[12rem] sm:min-h-[16rem] rounded-lg"},jbt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},Ubt={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},$bt={class:"flex-1 flex flex-col justify-evenly"},Hbt={key:0,class:"flex items-center justify-center flex-1"},Vbt={key:1,class:"flex items-center justify-center flex-1"},Wbt={class:"w-28 sm:w-32 text-sm text-content-secondary dark:text-content-primary/80 truncate"},qbt={class:"flex-1 h-12 bg-background-mute dark:bg-stroke/10 rounded overflow-hidden"},Gbt={class:"w-20 text-sm text-content-secondary dark:text-content-muted text-right tabular-nums"},Zbt={key:0,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Kbt={key:1,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Ybt={class:"text-content-secondary dark:text-content-muted text-sm"},Xbt=Cc({name:"StatisticsView",__name:"Statistics",setup(e){Av.register(aL,oL,nL,J2,eL,G$,Z$,xht,mH,vH,fH,aH,cH,iL,iS);const t=u4(),r=li(null),u=li(!1),T=()=>{const Yn=document.documentElement.classList.contains("dark");return{gridColor:Yn?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",tickColor:Yn?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)",legendColor:Yn?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:Yn?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)"}},$=li(B1("statistics_selectedHours",24)),K=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}];Fh($,Yn=>R1("statistics_selectedHours",Yn));const ct=li(null),yt=li(null),St=li([]),Ut=li(null),ne=li([]),pe=li(!0),me=li(null),we=li({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0,sparklines:!0}),Ce=li(!1),Ve=li(!1),kr=li(!1),It=li(null),rn=li(null),Lr=li(null),Mr=li(null),tn=li(null),Dn=li(null),Mn=li(null),Br=Ao(()=>{const Yn=t.packetStats;return Yn?{totalRx:Yn.total_packets||0,totalTx:Yn.transmitted_packets||0}:{totalRx:0,totalTx:0}}),Vn=(Yn,hi)=>{if(Yn.length===0)return[];const Xa=Math.round(hi*60*60*1e3/72),oo=new Map;return Yn.forEach(([xa,Ur])=>{let Sn=xa;xa>1e15?Sn=xa/1e3:xa>1e9&&xa<1e12&&(Sn=xa*1e3);const Hn=Math.floor(Sn/Xa)*Xa;oo.has(Hn)||oo.set(Hn,[]),oo.get(Hn).push(Ur)}),Array.from(oo.entries()).sort((xa,Ur)=>xa[0]-Ur[0]).map(([,xa])=>xa.reduce((Ur,Sn)=>Ur+Sn,0)/xa.length)},on=Ao(()=>{let Yn=[],hi=[];if(ct.value?.series){const na=ct.value.series.find(oo=>oo.type==="rx_count"),Xa=ct.value.series.find(oo=>oo.type==="tx_count");na?.data&&(Yn=Vn(na.data,$.value)),Xa?.data&&(hi=Vn(Xa.data,$.value))}return{totalPackets:Yn,transmittedPackets:hi,droppedPackets:[]}}),pr=async()=>{try{pe.value=!0,me.value=null,await Promise.all([t.fetchPacketStats({hours:$.value}),t.fetchSystemStats()]),pe.value=!1,_r()}catch(Yn){me.value=Yn instanceof Error?Yn.message:"Failed to fetch data",pe.value=!1}},_r=async()=>{we.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0};const Yn=[Sr(),Dr(),nn(),Cn()];try{await Promise.allSettled(Yn),await sp(),!Mr.value||!tn.value?setTimeout(()=>{ta()},100):ta()}catch(hi){console.error("Error loading chart data:",hi)}},Sr=async()=>{try{const Yn=await bs.get("/metrics_graph_data",{hours:$.value,resolution:"average",metrics:"rx_count,tx_count"});Yn?.success&&(ct.value=Yn.data)}catch{ct.value=null}},Dr=async()=>{try{const Yn=await bs.get("/packet_type_graph_data",{hours:$.value,resolution:"average",types:"all"});if(Yn?.success&&Yn.data){const hi=Yn.data;St.value=hi.series||[]}}catch{St.value=[]}},nn=async()=>{try{const Yn=await bs.get("/route_stats",{hours:$.value});Yn?.success&&Yn.data&&(Ut.value=Yn.data)}catch{Ut.value=null}},Cn=async()=>{try{const Yn=await bs.get("/noise_floor_history",{hours:$.value});if(Yn.success&&Yn.data){const na=Yn.data.history||[];Array.isArray(na)&&na.length>0&&(yt.value={chart_data:na.map(Xa=>({timestamp:Xa.timestamp||Date.now()/1e3,noise_floor_dbm:Xa.noise_floor_dbm||Xa.noise_floor||-120}))},_i())}}catch{yt.value={chart_data:[]}}},Xn=()=>{we.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0},va(),Ce.value=!1,Ve.value=!1,kr.value=!1,pr()},_i=()=>{if(ne.value=[],yt.value?.chart_data&&yt.value.chart_data.length>0){const Yn=yt.value.chart_data;ne.value=Yn.map(hi=>({timestamp:hi.timestamp*1e3,snr:null,rssi:null,noiseFloor:hi.noise_floor_dbm}))}},ta=()=>{if(!u.value){u.value=!0;try{_a(),qi(),Bi(),Xi(),setTimeout(()=>{we.value={packetRate:!1,packetType:!1,noiseFloor:!1,routePie:!1,sparklines:!1},setTimeout(()=>{const Yn=ru(It.value),hi=ru(rn.value),na=ru(Lr.value);Yn&&Yn.update("none"),hi&&hi.update("none"),na&&na.update("none")},50)},100)}catch(Yn){console.error("Error creating/updating charts:",Yn),va()}finally{u.value=!1}}},va=()=>{try{It.value&&(It.value.destroy(),It.value=null),rn.value&&(rn.value.destroy(),rn.value=null),Lr.value&&(Lr.value.destroy(),Lr.value=null),Mn.value&&D1.purge(Mn.value)}catch(Yn){console.error("Error destroying charts:",Yn)}},_a=()=>{if(!Mr.value)return;const Yn=Mr.value.getContext("2d");if(!Yn)return;let hi=[],na=[];if(ct.value?.series){const Io=ct.value.series.find(Jo=>Jo.type==="rx_count"),Ys=ct.value.series.find(Jo=>Jo.type==="tx_count");Io?.data&&(hi=Io.data.map(([Jo,Ss])=>{let Us=Jo;return Jo>1e15?Us=Jo/1e3:Jo>1e12?Us=Jo:Jo>1e9?Us=Jo*1e3:Us=Date.now(),{x:Us,y:Ss}})),Ys?.data&&(na=Ys.data.map(([Jo,Ss])=>{let Us=Jo;return Jo>1e15?Us=Jo/1e3:Jo>1e12?Us=Jo:Jo>1e9?Us=Jo*1e3:Us=Date.now(),{x:Us,y:Ss}}))}if(hi.length===0&&na.length===0){Ce.value=!0;return}Ce.value=!1,It.value&&(It.value.destroy(),It.value=null);const oo=Math.round($.value*60*60*1e3/72),xa=Io=>{if(Io.length===0)return[];const Ys=new Map;return Io.forEach(Ss=>{const Us=Math.floor(Ss.x/oo)*oo;Ys.has(Us)||Ys.set(Us,[]),Ys.get(Us).push(Ss.y)}),Array.from(Ys.entries()).map(([Ss,Us])=>({x:Ss,y:Us.reduce((Ac,Ou)=>Ac+Ou,0)/Us.length})).sort((Ss,Us)=>Ss.x-Us.x)},Ur=(Io,Ys=3)=>{if(Io.lengthdp+Wf.y,0)/Ou.length;Jo.push({x:Io[Ss].x,y:Bu})}return Jo},Sn=Ur(xa(hi)),Hn=Ur(xa(na)),to=[...Sn.map(Io=>Io.y),...Hn.map(Io=>Io.y)],Ha=Math.min(...to),qa=Math.max(...to),Mo=qa-Ha||qa*.1||.001,Wo=Math.max(0,Ha-Mo*.05),es=qa+Mo*.05;try{const Io=JSON.parse(JSON.stringify(Sn)),Ys=JSON.parse(JSON.stringify(Hn)),Jo=new Av(Yn,{type:"line",data:{datasets:[{label:"TX/hr",data:Ys,borderColor:"#F59E0B",backgroundColor:"#F59E0B",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:1},{label:"RX/hr",data:Io,borderColor:"#C084FC",backgroundColor:"#C084FC",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:2}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},title:{display:!1},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(Ss){const Us=Ss[0]?.parsed?.x;return Us==null?"":new Date(Us).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(Ss){const Us=Ss.dataset?.label||"",Ac=Ss.parsed?.y;return Ac==null?Us:`${Us}: ${Ac.toFixed(3)}`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:T().gridColor},ticks:{color:T().tickColor,callback:function(Ss){return typeof Ss=="number"?Ss.toFixed(3):Ss}},min:Wo,max:es}}}});It.value=j1(Jo)}catch(Io){console.error("Error creating packet rate chart:",Io),Ce.value=!0}},qi=()=>{if(!tn.value)return;const Yn=tn.value.getContext("2d");if(!Yn)return;const hi=[],na=[],Xa=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(St.value.length>0)St.value.forEach(oo=>{const xa=oo.data?oo.data.reduce((Ur,Sn)=>Ur+Sn[1],0):0;xa>0&&(hi.push(oo.name.replace(/\([^)]*\)/g,"").trim()),na.push(xa))});else{Ve.value=!0;return}Ve.value=!1,rn.value&&(rn.value.destroy(),rn.value=null);try{const oo=JSON.parse(JSON.stringify(hi)),xa=JSON.parse(JSON.stringify(na)),Ur=new Av(Yn,{type:"bar",data:{labels:oo,datasets:[{data:xa,backgroundColor:Xa.slice(0,xa.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});rn.value=j1(Ur)}catch(oo){console.error("Error creating packet type chart:",oo),Ve.value=!0}},Bi=()=>{if(!Dn.value)return;const Yn=Dn.value.getContext("2d");if(!Yn)return;const hi=ne.value.map(Ha=>({x:Ha.timestamp,y:Ha.noiseFloor})).filter(Ha=>Ha.y!==null&&Ha.y!==void 0),na=hi.map(Ha=>Ha.y),Xa=na.length>0?Math.min(...na):-120,oo=na.length>0?Math.max(...na):-110,xa=oo-Xa||1,Ur=Xa-xa*.05,Sn=oo+xa*.05;if(Lr.value)try{const Ha=ru(Lr.value),qa=JSON.parse(JSON.stringify(hi));Ha.data.datasets[0]&&(Ha.data.datasets[0].data=qa),Ha.update("active");return}catch{Lr.value.destroy(),Lr.value=null}const Hn=JSON.parse(JSON.stringify(hi)),to=new Av(Yn,{type:"scatter",data:{datasets:[{label:"Noise Floor (dBm)",data:Hn,borderWidth:0,backgroundColor:"rgba(245, 158, 11, 0.8)",pointRadius:3,pointHoverRadius:5,pointStyle:"circle"}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:T().legendColor,usePointStyle:!0,padding:20}},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(Ha){const qa=Ha[0]?.parsed?.x;return qa==null?"":new Date(qa).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(Ha){const qa=Ha.dataset?.label||"",Mo=Ha.parsed?.y;return Mo==null?qa:`${qa}: ${Mo.toFixed(1)} dBm`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:T().titleColor},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",callback:function(Ha){return typeof Ha=="number"?Ha.toFixed(1):Ha}},min:Ur,max:Sn}}}});Lr.value=j1(to)},Xi=()=>{if(!Mn.value)return;if(!Ut.value||!Ut.value.route_totals){kr.value=!0;return}kr.value=!1;const Yn=Ut.value.route_totals,hi=Object.keys(Yn),na=Object.values(Yn),Xa=["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"];try{const oo=JSON.parse(JSON.stringify(hi)),xa=JSON.parse(JSON.stringify(na)),Ur=xa.reduce((qa,Mo)=>qa+Mo,0),Sn=xa.map(qa=>qa/Ur*100),Hn=oo.map((qa,Mo)=>({type:"bar",name:qa,x:[Sn[Mo]],y:[""],orientation:"h",marker:{color:Xa[Mo%Xa.length]},text:Sn[Mo]>=5?`${qa} ${Sn[Mo].toFixed(0)}%`:"",textposition:"inside",textfont:{color:"white",size:11},hoverinfo:"none",insidetextanchor:"middle"})),to={paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:10,b:60,l:10,r:10},barmode:"stack",showlegend:!0,legend:{orientation:"h",x:0,y:-.3,xanchor:"left",font:{color:"rgba(255, 255, 255, 0.8)",size:10}},xaxis:{showgrid:!1,showticklabels:!1,zeroline:!1,range:[0,100]},yaxis:{showgrid:!1,showticklabels:!1,zeroline:!1},hovermode:!1,bargap:0},Ha={responsive:!0,displayModeBar:!1,staticPlot:!0};D1.newPlot(Mn.value,Hn,to,Ha)}catch(oo){console.error("Error creating route treemap chart:",oo),kr.value=!0}};return Xd(async()=>{await sp(),pr(),r.value=window.setInterval(pr,3e4),window.addEventListener("resize",()=>{setTimeout(()=>{ru(It.value)?.resize(),ru(rn.value)?.resize(),ru(Lr.value)?.resize(),Mn.value&&D1.Plots&&D1.Plots.resize(Mn.value)},100)})}),Tg(()=>{r.value&&clearInterval(r.value),It.value?.destroy(),rn.value?.destroy(),Lr.value?.destroy(),Mn.value&&D1.purge(Mn.value),window.removeEventListener("resize",()=>{})}),(Yn,hi)=>(Or(),Nr("div",Mbt,[At("div",Ebt,[hi[2]||(hi[2]=At("h2",{class:"text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary"},"Statistics",-1)),At("div",Lbt,[hi[1]||(hi[1]=At("label",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Time Range:",-1)),Ml(At("select",{"onUpdate:modelValue":hi[0]||(hi[0]=na=>$.value=na),onChange:Xn,class:"bg-white dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-2 sm:px-3 py-1.5 sm:py-2 text-content-primary dark:text-content-primary text-xs sm:text-sm focus:outline-hidden focus:border-primary dark:focus:border-accent-purple/50 transition-colors"},[(Or(),Nr(Es,null,jl(K,na=>At("option",{key:na.value,value:na.value,class:"bg-white dark:bg-gray-800 text-content-primary dark:text-content-primary"},yn(na.label),9,Pbt)),64))],544),[[xg,$.value]])])]),At("div",Ibt,[Vs(Ex,{title:"Total RX",value:Br.value.totalRx,color:"#AAE8E8",data:on.value.totalPackets,loading:we.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),Vs(Ex,{title:"Total TX",value:Br.value.totalTx,color:"#FFC246",data:on.value.transmittedPackets,loading:we.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),Vs(Ex,{title:"Packet Hash Cache",value:Lo(t).systemStats?.duplicate_cache_size??0,color:"#9F7AEA",data:[],loading:!1,variant:"smooth",subtitle:`Entries expire after ${(()=>{const na=Lo(t).systemStats?.cache_ttl??3600,Xa=Math.floor(na/60);return Xa>=60?`${Math.floor(Xa/60)}h`:`${Xa}m`})()}`},null,8,["value","subtitle"])]),At("div",Dbt,[hi[6]||(hi[6]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Performance Metrics",-1)),At("div",null,[hi[5]||(hi[5]=Du('

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
',2)),At("div",zbt,[At("canvas",{ref_key:"packetRateCanvasRef",ref:Mr,class:"w-full h-full relative z-10"},null,512),we.value.packetRate?(Or(),Nr("div",Obt,hi[3]||(hi[3]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-purple-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading packet rate data...")],-1)]))):Ta("",!0),Ce.value&&!we.value.packetRate?(Or(),Nr("div",Bbt,hi[4]||(hi[4]=[At("div",{class:"text-center"},[At("div",{class:"text-red-600 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Packet rate data not found")],-1)]))):Ta("",!0)])])]),At("div",Rbt,[At("div",Fbt,[hi[8]||(hi[8]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"}," Noise Floor Over Time ",-1)),At("div",Nbt,[At("canvas",{ref_key:"signalMetricsCanvasRef",ref:Dn,class:"w-full h-full"},null,512),we.value.noiseFloor?(Or(),Nr("div",jbt,hi[7]||(hi[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-amber-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading noise floor data...")],-1)]))):Ta("",!0)])]),At("div",Ubt,[hi[11]||(hi[11]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Route Distribution",-1)),At("div",$bt,[we.value.routePie?(Or(),Nr("div",Hbt,hi[9]||(hi[9]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading route data...")],-1)]))):kr.value?(Or(),Nr("div",Vbt,hi[10]||(hi[10]=[At("div",{class:"text-center"},[At("div",{class:"text-red-600 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Route statistics not found")],-1)]))):Ut.value?.route_totals?(Or(!0),Nr(Es,{key:2},jl(Ut.value.route_totals,(na,Xa,oo)=>(Or(),Nr("div",{key:Xa,class:"flex items-center gap-3"},[At("div",Wbt,yn(Xa),1),At("div",qbt,[At("div",{class:"h-full rounded transition-all duration-300",style:Sp({width:`${na/Math.max(...Object.values(Ut.value.route_totals))*100}%`,backgroundColor:["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"][oo%5]})},null,4)]),At("div",Gbt,yn(na.toLocaleString()),1)]))),128)):Ta("",!0)])])]),pe.value?(Or(),Nr("div",Zbt,hi[12]||(hi[12]=[At("div",{class:"text-content-secondary dark:text-content-muted mb-2 text-sm"},"Loading statistics...",-1),At("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-gray-600 dark:border-t-white/70 rounded-full mx-auto"},null,-1)]))):Ta("",!0),me.value?(Or(),Nr("div",Kbt,[hi[13]||(hi[13]=At("div",{class:"text-red-600 dark:text-red-400 mb-2 text-sm"},"Failed to load statistics",-1)),At("p",Ybt,yn(me.value),1),At("button",{onClick:pr,class:"mt-4 px-4 py-2 bg-primary/80 dark:bg-accent-purple/20 hover:bg-primary/90 dark:hover:bg-accent-purple/30 text-white rounded-lg border border-primary dark:border-accent-purple/50 transition-colors"}," Retry ")])):Ta("",!0)]))}}),Jbt=vh(Xbt,[["__scopeId","data-v-a0621c5f"]]),Qbt="modulepreload",t2t=function(e){return"/"+e},EF={},P5=function(t,r,u){let T=Promise.resolve();if(r&&r.length>0){let St=function(Ut){return Promise.all(Ut.map(ne=>Promise.resolve(ne).then(pe=>({status:"fulfilled",value:pe}),pe=>({status:"rejected",reason:pe}))))};var K=St;document.getElementsByTagName("link");const ct=document.querySelector("meta[property=csp-nonce]"),yt=ct?.nonce||ct?.getAttribute("nonce");T=St(r.map(Ut=>{if(Ut=t2t(Ut),Ut in EF)return;EF[Ut]=!0;const ne=Ut.endsWith(".css"),pe=ne?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${Ut}"]${pe}`))return;const me=document.createElement("link");if(me.rel=ne?"stylesheet":Qbt,ne||(me.as="script"),me.crossOrigin="",me.href=Ut,yt&&me.setAttribute("nonce",yt),document.head.appendChild(me),ne)return new Promise((we,Ce)=>{me.addEventListener("load",we),me.addEventListener("error",()=>Ce(new Error(`Unable to preload CSS for ${Ut}`)))})}))}function $(ct){const yt=new Event("vite:preloadError",{cancelable:!0});if(yt.payload=ct,window.dispatchEvent(yt),!yt.defaultPrevented)throw ct}return T.then(ct=>{for(const yt of ct||[])yt.status==="rejected"&&$(yt.reason);return t().catch($)})},e2t={class:"p-6 space-y-6"},r2t={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},n2t={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},i2t={class:"glass-card rounded-[15px] p-6"},a2t={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},o2t={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},s2t={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},l2t={key:0,class:"grid grid-cols-2 gap-4 text-sm"},c2t={class:"text-content-primary dark:text-content-primary font-semibold"},u2t={class:"text-content-primary dark:text-content-primary font-semibold"},h2t={class:"text-content-primary dark:text-content-primary font-semibold"},d2t={class:"text-content-primary dark:text-content-primary font-semibold"},f2t={class:"glass-card rounded-[15px] p-6"},p2t={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},m2t={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},g2t={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},v2t={key:0,class:"grid grid-cols-2 gap-4 text-sm"},y2t={class:"text-content-primary dark:text-content-primary font-semibold"},_2t={class:"text-content-primary dark:text-content-primary font-semibold"},x2t={class:"text-content-primary dark:text-content-primary font-semibold"},b2t={class:"text-content-primary dark:text-content-primary font-semibold"},w2t={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},k2t={class:"glass-card rounded-[15px] p-6"},T2t={class:"relative h-48"},S2t={key:0,class:"grid grid-cols-3 gap-4 text-sm mt-4"},C2t={class:"text-center"},A2t={class:"text-content-primary dark:text-content-primary font-semibold"},M2t={class:"text-center"},E2t={class:"font-semibold text-red-500 dark:text-red-400"},L2t={class:"text-center"},P2t={class:"font-semibold text-green-700 dark:text-green-400"},I2t={class:"glass-card rounded-[15px] p-6"},D2t={key:0,class:"space-y-4"},z2t={class:"grid grid-cols-2 gap-4 text-sm"},O2t={class:"text-content-primary dark:text-content-primary font-semibold"},B2t={class:"text-content-primary dark:text-content-primary font-semibold"},R2t={class:"text-content-primary dark:text-content-primary font-semibold"},F2t={class:"text-content-primary dark:text-content-primary font-semibold"},N2t={key:0,class:"pt-4 border-t border-stroke-subtle dark:border-stroke/10"},j2t={class:"grid grid-cols-2 gap-2 text-sm"},U2t={class:"text-content-secondary dark:text-content-muted"},$2t={class:"text-content-primary dark:text-content-primary font-semibold ml-1"},H2t={class:"glass-card rounded-[15px] p-6"},V2t={key:0,class:"overflow-x-auto"},W2t={class:"w-full text-sm"},q2t={class:"text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},G2t={class:"text-content-primary dark:text-content-primary font-semibold py-2 transition-all duration-300"},Z2t={class:"text-center text-orange-500 dark:text-orange-400 py-2 transition-all duration-300"},K2t={class:"text-center text-green-700 dark:text-green-400 py-2 transition-all duration-300"},Y2t={class:"text-right text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},X2t={key:0,class:"mt-4 text-center text-content-secondary dark:text-content-muted text-sm transition-all duration-300"},J2t={key:1,class:"text-center text-content-secondary dark:text-content-muted py-8"},Q2t={key:0,class:"glass-card rounded-[15px] p-8 text-center"},twt={key:1,class:"glass-card rounded-[15px] p-8 text-center"},ewt={class:"text-content-secondary dark:text-content-muted text-sm"},rwt=Cc({name:"SystemStatsView",__name:"SystemStats",setup(e){Av.register(aL,oL,nL,J2,eL,G$,Z$,mH,vH,fH,aH,cH,iL,iS);const t=li(null),r=li(!0),u=li(null),T=li(null),$=li(null),K=li([]),ct=li(null),yt=li({cpuChart:!0,memoryChart:!0,diskChart:!1,processChart:!0}),St=li(!1),Ut=li(!1),ne=li(null),pe=li(null),me=li(null),we=li(null),Ce=li(null),Ve=Ao(()=>T.value?{cpuUsage:T.value.cpu.usage_percent,memoryUsage:T.value.memory.usage_percent,diskUsage:T.value.disk.usage_percent,uptime:T.value.system.uptime}:{cpuUsage:0,memoryUsage:0,diskUsage:0,uptime:0}),kr=Ao(()=>K.value.length===0?{cpu:[],memory:[],disk:[],network:[]}:{cpu:K.value.map(Sr=>Sr.cpu.usage_percent),memory:K.value.map(Sr=>Sr.memory.usage_percent),disk:K.value.map(Sr=>Sr.disk.usage_percent),network:K.value.map(Sr=>Sr.network.bytes_recv/1024/1024)}),It=Sr=>{const Dr=["B","KB","MB","GB","TB"];if(Sr===0)return"0 B";const nn=Math.floor(Math.log(Sr)/Math.log(1024));return parseFloat((Sr/Math.pow(1024,nn)).toFixed(2))+" "+Dr[nn]},rn=Sr=>{const Dr=Math.floor(Sr/86400),nn=Math.floor(Sr%86400/3600),Cn=Math.floor(Sr%3600/60);return Dr>0?`${Dr}d ${nn}h ${Cn}m`:nn>0?`${nn}h ${Cn}m`:`${Cn}m`},Lr=async()=>{try{const Sr=await bs.get("/hardware_stats");if(Sr?.success&&Sr.data){const Dr=Sr.data;if(T.value=Dr,K.value.length===0)for(let Cn=0;Cn<12;Cn++)K.value.push(JSON.parse(JSON.stringify(Dr)));else K.value.push(Dr),K.value.length>20&&K.value.shift()}}catch(Sr){console.error("Failed to fetch hardware stats:",Sr),u.value="Failed to fetch hardware stats"}},Mr=async()=>{try{const Sr=await bs.get("/hardware_processes");Sr?.success&&Sr.data&&(ct.value=$.value,$.value=Sr.data)}catch(Sr){console.error("Failed to fetch process stats:",Sr)}},tn=(Sr,Dr)=>{if(!ct.value)return!1;const nn=ct.value.processes.find(Cn=>Cn.pid===Sr.pid);return nn?nn[Dr]!==Sr[Dr]:!0},Dn=async()=>{try{r.value=!0,u.value=null,await Promise.all([Lr(),Mr()]),r.value=!1,await sp(),Mn()}catch(Sr){u.value=Sr instanceof Error?Sr.message:"Failed to fetch system data",r.value=!1}},Mn=()=>{T.value&&(Br(),Vn(),on())},Br=()=>{if(!me.value||!T.value){yt.value.cpuChart=!1;return}const Sr=me.value.getContext("2d");if(!Sr){yt.value.cpuChart=!1;return}const Dr=T.value.cpu.usage_percent,nn=100-Dr;if(ne.value)try{ne.value.data.datasets[0].data=[Dr,nn],ne.value.update("none");return}catch(va){console.warn("Failed to update CPU chart, recreating...",va),ne.value.destroy(),ne.value=null}const Cn=document.documentElement.classList.contains("dark"),Xn=Cn?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",_i=Cn?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)",ta=Cn?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)";try{const va=new Av(Sr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Dr,nn],backgroundColor:["#FFC246",Xn],borderColor:["#FFC246",_i],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(_a){return`${_a.label}: ${_a.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(_a){const qi=_a.ctx;qi.save();const Bi=(_a.chartArea.left+_a.chartArea.right)/2,Xi=(_a.chartArea.top+_a.chartArea.bottom)/2;qi.textAlign="center",qi.textBaseline="middle",qi.fillStyle="#FFC246",qi.font="bold 18px sans-serif",qi.fillText(`${Dr.toFixed(1)}%`,Bi,Xi-5),qi.fillStyle=ta,qi.font="10px sans-serif",qi.fillText("CPU",Bi,Xi+12),qi.restore()}}]});ne.value=j1(va),St.value=!1,yt.value.cpuChart=!1}catch(va){console.error("Error creating CPU chart:",va),St.value=!0,yt.value.cpuChart=!1}},Vn=()=>{if(!we.value||!T.value){yt.value.memoryChart=!1;return}const Sr=we.value.getContext("2d");if(!Sr){yt.value.memoryChart=!1;return}const Dr=T.value.memory.usage_percent,nn=100-Dr;if(pe.value)try{pe.value.data.datasets[0].data=[Dr,nn],pe.value.update("none");return}catch(va){console.warn("Failed to update Memory chart, recreating...",va),pe.value.destroy(),pe.value=null}const Cn=document.documentElement.classList.contains("dark"),Xn=Cn?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",_i=Cn?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)",ta=Cn?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)";try{const va=new Av(Sr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Dr,nn],backgroundColor:["#A5E5B6",Xn],borderColor:["#A5E5B6",_i],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(_a){return`${_a.label}: ${_a.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(_a){const qi=_a.ctx;qi.save();const Bi=(_a.chartArea.left+_a.chartArea.right)/2,Xi=(_a.chartArea.top+_a.chartArea.bottom)/2;qi.textAlign="center",qi.textBaseline="middle",qi.fillStyle="#A5E5B6",qi.font="bold 18px sans-serif",qi.fillText(`${Dr.toFixed(1)}%`,Bi,Xi-5),qi.fillStyle=ta,qi.font="10px sans-serif",qi.fillText("Memory",Bi,Xi+12),qi.restore()}}]});pe.value=j1(va),Ut.value=!1,yt.value.memoryChart=!1}catch(va){console.error("Error creating Memory chart:",va),Ut.value=!0,yt.value.memoryChart=!1}},on=()=>{if(!Ce.value||!T.value)return;const Dr=document.documentElement.classList.contains("dark")?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)";try{P5(()=>Promise.resolve().then(()=>tM),void 0).then(nn=>{const Cn=nn.default||nn,Xn=T.value.disk,_i=[{type:"pie",labels:["Used","Free"],values:[Xn.used,Xn.free],marker:{colors:["#FB787B","#A5E5B6"]},hovertemplate:"%{label}
Size: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",hole:.4}],ta={title:{text:"",font:{color:Dr}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:Dr,size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:Dr,size:10}}},va={responsive:!0,displayModeBar:!1,staticPlot:!1};Cn.newPlot(Ce.value,_i,ta,va)})}catch(nn){console.error("Error creating disk chart:",nn)}},pr=()=>{try{if(ne.value&&(ne.value.destroy(),ne.value=null),pe.value&&(pe.value.destroy(),pe.value=null),Ce.value)try{P5(()=>Promise.resolve().then(()=>tM),void 0).then(Sr=>{const Dr=Sr?.default||Sr;Dr?.purge&&Dr.purge(Ce.value)}).catch(()=>{})}catch{}}catch(Sr){console.error("Error destroying charts:",Sr)}},_r=new MutationObserver(Sr=>{Sr.forEach(Dr=>{Dr.attributeName==="class"&&(pr(),sp(()=>{Mn()}))})});return Xd(async()=>{await sp(),Dn(),t.value=window.setInterval(Dn,5e3),_r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",()=>{setTimeout(()=>{ru(ne.value)?.resize(),ru(pe.value)?.resize();try{P5(()=>Promise.resolve().then(()=>tM),void 0).then(Sr=>{const Dr=Sr?.default||Sr;Dr?.Plots&&Dr.Plots.resize(Ce.value)}).catch(()=>{})}catch{}},100)})}),Tg(()=>{t.value&&clearInterval(t.value),_r.disconnect(),pr(),window.removeEventListener("resize",()=>{})}),(Sr,Dr)=>(Or(),Nr("div",e2t,[Dr[28]||(Dr[28]=At("div",{class:"flex justify-between items-center"},[At("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"System Statistics"),At("div",{class:"text-content-secondary dark:text-content-muted text-sm"}," Updates every 5 seconds ")],-1)),At("div",r2t,[Vs(Ex,{title:"CPU Usage",value:`${Ve.value.cpuUsage.toFixed(1)}%`,color:"#FFC246",data:kr.value.cpu},null,8,["value","data"]),Vs(Ex,{title:"Memory Usage",value:`${Ve.value.memoryUsage.toFixed(1)}%`,color:"#A5E5B6",data:kr.value.memory},null,8,["value","data"]),Vs(Ex,{title:"Disk Usage",value:`${Ve.value.diskUsage.toFixed(1)}%`,color:"#FB787B",data:kr.value.disk},null,8,["value","data"]),Vs(Ex,{title:"Uptime",value:rn(Ve.value.uptime),color:"#EBA0FC",data:kr.value.network},null,8,["value","data"])]),At("div",n2t,[At("div",i2t,[Dr[6]||(Dr[6]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"CPU Performance",-1)),At("div",a2t,[At("canvas",{ref_key:"cpuCanvasRef",ref:me,class:"w-full h-full relative z-10"},null,512),yt.value.cpuChart?(Or(),Nr("div",o2t,Dr[0]||(Dr[0]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-orange-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading CPU data...")],-1)]))):Ta("",!0),St.value&&!yt.value.cpuChart?(Or(),Nr("div",s2t,Dr[1]||(Dr[1]=[At("div",{class:"text-center"},[At("div",{class:"text-red-500 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"CPU data not found")],-1)]))):Ta("",!0)]),T.value?(Or(),Nr("div",l2t,[At("div",null,[Dr[2]||(Dr[2]=At("div",{class:"text-content-secondary dark:text-content-muted"},"CPU Count",-1)),At("div",c2t,yn(T.value.cpu.count)+" cores",1)]),At("div",null,[Dr[3]||(Dr[3]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Frequency",-1)),At("div",u2t,yn(T.value.cpu.frequency.toFixed(0))+" MHz",1)]),At("div",null,[Dr[4]||(Dr[4]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Load (1m)",-1)),At("div",h2t,yn(T.value.cpu.load_avg["1min"].toFixed(2)),1)]),At("div",null,[Dr[5]||(Dr[5]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Load (5m)",-1)),At("div",d2t,yn(T.value.cpu.load_avg["5min"].toFixed(2)),1)])])):Ta("",!0)]),At("div",f2t,[Dr[13]||(Dr[13]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Memory Usage",-1)),At("div",p2t,[At("canvas",{ref_key:"memoryCanvasRef",ref:we,class:"w-full h-full relative z-10"},null,512),yt.value.memoryChart?(Or(),Nr("div",m2t,Dr[7]||(Dr[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-400 rounded-full mx-auto mb-2"}),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading memory data...")],-1)]))):Ta("",!0),Ut.value&&!yt.value.memoryChart?(Or(),Nr("div",g2t,Dr[8]||(Dr[8]=[At("div",{class:"text-center"},[At("div",{class:"text-red-500 dark:text-red-400 text-sm mb-1"},"No Data Available"),At("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Memory data not found")],-1)]))):Ta("",!0)]),T.value?(Or(),Nr("div",v2t,[At("div",null,[Dr[9]||(Dr[9]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Total",-1)),At("div",y2t,yn(It(T.value.memory.total)),1)]),At("div",null,[Dr[10]||(Dr[10]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Used",-1)),At("div",_2t,yn(It(T.value.memory.used)),1)]),At("div",null,[Dr[11]||(Dr[11]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Available",-1)),At("div",x2t,yn(It(T.value.memory.available)),1)]),At("div",null,[Dr[12]||(Dr[12]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Usage",-1)),At("div",b2t,yn(T.value.memory.usage_percent.toFixed(1))+"%",1)])])):Ta("",!0)])]),At("div",w2t,[At("div",k2t,[Dr[17]||(Dr[17]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Storage Usage",-1)),At("div",T2t,[At("div",{ref_key:"diskCanvasRef",ref:Ce,class:"w-full h-full"},null,512)]),T.value?(Or(),Nr("div",S2t,[At("div",C2t,[Dr[14]||(Dr[14]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Total",-1)),At("div",A2t,yn(It(T.value.disk.total)),1)]),At("div",M2t,[Dr[15]||(Dr[15]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Used",-1)),At("div",E2t,yn(It(T.value.disk.used)),1)]),At("div",L2t,[Dr[16]||(Dr[16]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Free",-1)),At("div",P2t,yn(It(T.value.disk.free)),1)])])):Ta("",!0)]),At("div",I2t,[Dr[23]||(Dr[23]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Network Statistics",-1)),T.value?(Or(),Nr("div",D2t,[At("div",z2t,[At("div",null,[Dr[18]||(Dr[18]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Bytes Sent",-1)),At("div",O2t,yn(It(T.value.network.bytes_sent)),1)]),At("div",null,[Dr[19]||(Dr[19]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Bytes Received",-1)),At("div",B2t,yn(It(T.value.network.bytes_recv)),1)]),At("div",null,[Dr[20]||(Dr[20]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Packets Sent",-1)),At("div",R2t,yn(T.value.network.packets_sent.toLocaleString()),1)]),At("div",null,[Dr[21]||(Dr[21]=At("div",{class:"text-content-secondary dark:text-content-muted"},"Packets Received",-1)),At("div",F2t,yn(T.value.network.packets_recv.toLocaleString()),1)])]),T.value.temperatures&&Object.keys(T.value.temperatures).length>0?(Or(),Nr("div",N2t,[Dr[22]||(Dr[22]=At("div",{class:"text-content-secondary dark:text-content-muted mb-2"},"System Temperatures",-1)),At("div",j2t,[(Or(!0),Nr(Es,null,jl(T.value.temperatures,(nn,Cn)=>(Or(),Nr("div",{key:Cn},[At("span",U2t,yn(Cn)+":",1),At("span",$2t,yn(nn.toFixed(1))+"°C",1)]))),128))])])):Ta("",!0)])):Ta("",!0)])]),At("div",H2t,[Dr[25]||(Dr[25]=At("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Top Processes",-1)),$.value?.processes&&$.value.processes.length>0?(Or(),Nr("div",V2t,[At("table",W2t,[Dr[24]||(Dr[24]=At("thead",null,[At("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[At("th",{class:"text-left text-content-secondary dark:text-content-muted py-2"},"PID"),At("th",{class:"text-left text-content-secondary dark:text-content-muted py-2"},"Name"),At("th",{class:"text-center text-content-secondary dark:text-content-muted py-2"},"CPU %"),At("th",{class:"text-center text-content-secondary dark:text-content-muted py-2"},"Memory %"),At("th",{class:"text-right text-content-secondary dark:text-content-muted py-2"},"Memory")])],-1)),At("tbody",null,[(Or(!0),Nr(Es,null,jl($.value.processes.slice(0,10),nn=>(Or(),Nr("tr",{key:nn.pid,class:"border-b border-stroke-subtle dark:border-white/5 process-row"},[At("td",q2t,yn(nn.pid),1),At("td",G2t,yn(nn.name),1),At("td",Z2t,[At("span",{class:ja(["cpu-value",{"value-updated":tn(nn,"cpu_percent")}])},yn(nn.cpu_percent.toFixed(1))+"% ",3)]),At("td",K2t,[At("span",{class:ja(["memory-value",{"value-updated":tn(nn,"memory_percent")}])},yn(nn.memory_percent.toFixed(1))+"% ",3)]),At("td",Y2t,[At("span",{class:ja({"value-updated":tn(nn,"memory_mb")})},yn(nn.memory_mb.toFixed(1))+" MB ",3)])]))),128))])]),$.value.total_processes?(Or(),Nr("div",X2t," Showing top 10 of "+yn($.value.total_processes)+" total processes ",1)):Ta("",!0)])):r.value?Ta("",!0):(Or(),Nr("div",J2t," No process data available "))]),r.value?(Or(),Nr("div",Q2t,Dr[26]||(Dr[26]=[At("div",{class:"text-content-secondary dark:text-content-muted mb-2"},"Loading system statistics...",-1),At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-gray-900 dark:border-t-white/70 rounded-full mx-auto"},null,-1)]))):Ta("",!0),u.value?(Or(),Nr("div",twt,[Dr[27]||(Dr[27]=At("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load system statistics",-1)),At("p",ewt,yn(u.value),1),At("button",{onClick:Dn,class:"mt-4 px-4 py-2 bg-purple-500/20 dark:bg-accent-purple/20 hover:bg-purple-500/30 dark:hover:bg-accent-purple/30 text-content-primary dark:text-content-primary rounded-lg border border-purple-500/50 dark:border-accent-purple/50 transition-colors"}," Retry ")])):Ta("",!0)]))}}),nwt=vh(rwt,[["__scopeId","data-v-eab6d04d"]]),iwt={class:"space-y-4"},awt={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500/50 rounded-lg p-3"},owt={class:"text-green-600 dark:text-green-400 text-sm"},swt={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500/50 rounded-lg p-3"},lwt={class:"text-red-600 dark:text-red-400 text-sm"},cwt={class:"flex justify-end gap-2"},uwt=["disabled"],hwt=["disabled"],dwt={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},fwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},pwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},mwt={key:1,class:"flex items-center gap-2"},gwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},vwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},ywt={key:1},_wt=["value"],xwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},bwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},wwt={key:1},kwt=["value"],Twt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Swt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Cwt={key:1,class:"flex items-center gap-2"},Awt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Mwt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ewt={key:1},Lwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},Pwt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Iwt={key:2,class:"bg-yellow-500/10 dark:bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3"},Dwt=Cc({__name:"RadioSettings",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config?.radio||{}),u=li(!1),T=li(!1),$=li(null),K=li(null),ct=li(0),yt=li(0),St=li(0),Ut=li(0),ne=li(0),pe=li(0),me=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}];Fh(r,Dn=>{Dn&&!u.value&&(ct.value=Dn.frequency?Number((Dn.frequency/1e6).toFixed(3)):0,yt.value=Dn.spreading_factor??0,St.value=Dn.bandwidth?Number((Dn.bandwidth/1e3).toFixed(1)):0,Ut.value=Dn.tx_power??0,ne.value=Dn.coding_rate??0,pe.value=Dn.preamble_length??0)},{immediate:!0});const we=Ao(()=>{const Dn=r.value.frequency;return Dn?(Dn/1e6).toFixed(3)+" MHz":"Not set"}),Ce=Ao(()=>{const Dn=r.value.bandwidth;return Dn?(Dn/1e3).toFixed(1)+" kHz":"Not set"}),Ve=Ao(()=>{const Dn=r.value.tx_power;return Dn!==void 0?Dn+" dBm":"Not set"}),kr=Ao(()=>{const Dn=r.value.coding_rate;return Dn?"4/"+Dn:"Not set"}),It=Ao(()=>{const Dn=r.value.preamble_length;return Dn?Dn+" symbols":"Not set"}),rn=Ao(()=>r.value.spreading_factor??"Not set"),Lr=()=>{u.value=!0,$.value=null,K.value=null},Mr=()=>{u.value=!1,$.value=null;const Dn=r.value;ct.value=Dn.frequency?Number((Dn.frequency/1e6).toFixed(3)):0,yt.value=Dn.spreading_factor??0,St.value=Dn.bandwidth?Number((Dn.bandwidth/1e3).toFixed(1)):0,Ut.value=Dn.tx_power??0,ne.value=Dn.coding_rate??0,pe.value=Dn.preamble_length??0},tn=async()=>{T.value=!0,$.value=null,K.value=null;try{const Dn={};ct.value&&(Dn.frequency=ct.value*1e6),yt.value&&(Dn.spreading_factor=yt.value),St.value&&(Dn.bandwidth=St.value*1e3),Ut.value&&(Dn.tx_power=Ut.value),ne.value&&(Dn.coding_rate=ne.value);const Br=(await bs.post("/update_radio_config",Dn)).data;Br.message||Br.persisted?(K.value=Br.message||"Settings saved successfully",u.value=!1,await t.fetchStats(),setTimeout(()=>{K.value=null},3e3)):Br.error?$.value=Br.error:$.value="Unknown response from server"}catch(Dn){console.error("Failed to update radio settings:",Dn);const Mn=Dn;$.value=Mn.response?.data?.error||"Failed to update settings"}finally{T.value=!1}};return(Dn,Mn)=>(Or(),Nr("div",iwt,[K.value?(Or(),Nr("div",awt,[At("p",owt,yn(K.value),1)])):Ta("",!0),$.value?(Or(),Nr("div",swt,[At("p",lwt,yn($.value),1)])):Ta("",!0),At("div",cwt,[u.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:Mr,disabled:T.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,uwt),At("button",{onClick:tn,disabled:T.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(T.value?"Saving...":"Save Changes"),9,hwt)],64)):(Or(),Nr("button",{key:0,onClick:Lr,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",dwt,[At("div",fwt,[Mn[6]||(Mn[6]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Frequency",-1)),u.value?(Or(),Nr("div",mwt,[Ml(At("input",{"onUpdate:modelValue":Mn[0]||(Mn[0]=Br=>ct.value=Br),type:"number",step:"0.001",min:"100",max:"1000",class:"w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[lu,ct.value,void 0,{number:!0}]]),Mn[5]||(Mn[5]=At("span",{class:"text-content-muted dark:text-content-muted text-sm"},"MHz",-1))])):(Or(),Nr("div",pwt,yn(we.value),1))]),At("div",gwt,[Mn[7]||(Mn[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Spreading Factor",-1)),u.value?(Or(),Nr("div",ywt,[Ml(At("select",{"onUpdate:modelValue":Mn[1]||(Mn[1]=Br=>yt.value=Br),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},[(Or(),Nr(Es,null,jl([5,6,7,8,9,10,11,12],Br=>At("option",{key:Br,value:Br},yn(Br),9,_wt)),64))],512),[[xg,yt.value,void 0,{number:!0}]])])):(Or(),Nr("div",vwt,yn(rn.value),1))]),At("div",xwt,[Mn[8]||(Mn[8]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Bandwidth",-1)),u.value?(Or(),Nr("div",wwt,[Ml(At("select",{"onUpdate:modelValue":Mn[2]||(Mn[2]=Br=>St.value=Br),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},[(Or(),Nr(Es,null,jl(me,Br=>At("option",{key:Br.value,value:Br.value},yn(Br.label),9,kwt)),64))],512),[[xg,St.value,void 0,{number:!0}]])])):(Or(),Nr("div",bwt,yn(Ce.value),1))]),At("div",Twt,[Mn[10]||(Mn[10]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"TX Power",-1)),u.value?(Or(),Nr("div",Cwt,[Ml(At("input",{"onUpdate:modelValue":Mn[3]||(Mn[3]=Br=>Ut.value=Br),type:"number",min:"2",max:"30",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[lu,Ut.value,void 0,{number:!0}]]),Mn[9]||(Mn[9]=At("span",{class:"text-content-muted dark:text-content-muted text-sm"},"dBm",-1))])):(Or(),Nr("div",Swt,yn(Ve.value),1))]),At("div",Awt,[Mn[12]||(Mn[12]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Coding Rate",-1)),u.value?(Or(),Nr("div",Ewt,[Ml(At("select",{"onUpdate:modelValue":Mn[4]||(Mn[4]=Br=>ne.value=Br),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},Mn[11]||(Mn[11]=[At("option",{value:5},"4/5",-1),At("option",{value:6},"4/6",-1),At("option",{value:7},"4/7",-1),At("option",{value:8},"4/8",-1)]),512),[[xg,ne.value,void 0,{number:!0}]])])):(Or(),Nr("div",Mwt,yn(kr.value),1))]),At("div",Lwt,[Mn[13]||(Mn[13]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Preamble Length",-1)),At("span",Pwt,yn(It.value),1)])]),u.value?(Or(),Nr("div",Iwt,Mn[14]||(Mn[14]=[At("p",{class:"text-yellow-700 dark:text-yellow-400 text-xs"},[At("strong",null,"Note:"),cl(" Radio hardware changes (frequency, bandwidth, spreading factor, coding rate) may require a service restart to apply. ")],-1)]))):Ta("",!0)]))}}),zwt={class:"glass-card border border-stroke-subtle dark:border-white/20 rounded-[15px] w-full max-w-3xl max-h-[90vh] flex flex-col shadow-2xl"},Owt={class:"flex-1 relative min-h-[400px]"},Bwt={class:"p-6 border-t border-stroke-subtle dark:border-stroke/10 space-y-4"},Rwt={class:"grid grid-cols-2 gap-4"},Fwt=Cc({__name:"LocationPicker",props:{isOpen:{type:Boolean},latitude:{},longitude:{}},emits:["close","select"],setup(e,{emit:t}){const r=e,u=t,T=li(null),$=li(r.latitude||0),K=li(r.longitude||0);let ct=null,yt=null;const St=async()=>{if(T.value){Ut();try{const we=(await P5(async()=>{const{default:It}=await Promise.resolve().then(()=>gF);return{default:It}},void 0)).default;delete we.Icon.Default.prototype._getIconUrl,we.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"}),await sp();const Ce=$.value||0,Ve=K.value||0,kr=Ce===0&&Ve===0?2:13;ct=we.map(T.value).setView([Ce,Ve],kr);try{const It=we.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),rn=we.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});It.addTo(ct),rn.addTo(ct)}catch(It){console.warn("Error loading tiles:",It)}(Ce!==0||Ve!==0)&&(yt=we.marker([Ce,Ve]).addTo(ct)),ct.on("click",It=>{$.value=It.latlng.lat,K.value=It.latlng.lng,yt?yt.setLatLng(It.latlng):yt=we.marker(It.latlng).addTo(ct)}),setTimeout(()=>{ct?.invalidateSize()},200)}catch(we){console.error("Failed to initialize map:",we)}}},Ut=()=>{ct&&(ct.remove(),ct=null,yt=null)};Fh(()=>r.isOpen,async we=>{we?(await sp(),await St()):Ut()}),Fh(()=>[r.latitude,r.longitude],([we,Ce])=>{$.value=we,K.value=Ce});const ne=()=>{u("select",{latitude:$.value,longitude:K.value}),u("close")},pe=()=>{u("close")},me=()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(async we=>{if($.value=we.coords.latitude,K.value=we.coords.longitude,ct){ct.setView([$.value,K.value],13);const Ce=(await P5(async()=>{const{default:Ve}=await Promise.resolve().then(()=>gF);return{default:Ve}},void 0)).default;yt?yt.setLatLng([$.value,K.value]):yt=Ce.marker([$.value,K.value]).addTo(ct)}},we=>{console.error("Error getting location:",we),alert("Unable to get current location. Please check browser permissions.")}):alert("Geolocation is not supported by this browser.")};return Dv(()=>{Ut()}),(we,Ce)=>we.isOpen?(Or(),Nr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Od(pe,["self"])},[At("div",zwt,[At("div",{class:"flex items-center justify-between p-6 border-b border-stroke-subtle dark:border-stroke/10"},[Ce[3]||(Ce[3]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Select Location",-1)),At("button",{onClick:pe,class:"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},Ce[2]||(Ce[2]=[At("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",Owt,[At("div",{ref_key:"mapContainer",ref:T,class:"absolute inset-0 rounded-b-[15px] overflow-hidden"},null,512)]),At("div",Bwt,[At("div",Rwt,[At("div",null,[Ce[4]||(Ce[4]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Latitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>$.value=Ve),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary",readonly:""},null,512),[[lu,$.value,void 0,{number:!0}]])]),At("div",null,[Ce[5]||(Ce[5]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Longitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ce[1]||(Ce[1]=Ve=>K.value=Ve),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary",readonly:""},null,512),[[lu,K.value,void 0,{number:!0}]])])]),At("div",{class:"flex gap-3"},[At("button",{onClick:me,class:"flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm flex items-center justify-center gap-2"},Ce[6]||(Ce[6]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),cl(" Use Current Location ",-1)])),At("button",{onClick:pe,class:"px-6 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm"}," Cancel "),At("button",{onClick:ne,class:"px-6 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Select Location ")]),Ce[7]||(Ce[7]=At("p",{class:"text-content-muted dark:text-content-muted text-xs text-center"},"Click on the map to select a location",-1))])])])):Ta("",!0)}}),Nwt=vh(Fwt,[["__scopeId","data-v-186d3c86"]]),jwt={class:"space-y-4"},Uwt={key:0,class:"bg-green-100 dark:bg-green-500/10 border border-green-300 dark:border-green-500/30 rounded-lg p-3"},$wt={class:"text-green-700 dark:text-green-400 text-sm"},Hwt={key:1,class:"bg-red-100 dark:bg-red-500/10 border border-red-300 dark:border-red-500/30 rounded-lg p-3"},Vwt={class:"text-red-700 dark:text-red-400 text-sm"},Wwt={class:"flex justify-end gap-2"},qwt=["disabled"],Gwt=["disabled"],Zwt={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Kwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ywt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm break-all"},Xwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Jwt={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all"},Qwt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},t3t={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all sm:text-right sm:max-w-xs"},e3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},r3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},n3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},i3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},a3t={key:0,class:"flex justify-end"},o3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},s3t={class:"text-content-primary dark:text-content-primary font-mono text-sm"},l3t={class:"flex flex-col py-2 gap-2"},c3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},u3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},h3t={key:1,class:"flex items-center gap-2"},d3t=Cc({__name:"RepeaterSettings",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config||{}),u=Ao(()=>r.value.repeater||{}),T=Ao(()=>t.stats),$=li(!1),K=li(!1),ct=li(null),yt=li(null),St=li(!1),Ut=li(""),ne=li(0),pe=li(0),me=li(0);Fh([r,u],()=>{$.value||(Ut.value=r.value.node_name||"",ne.value=u.value.latitude||0,pe.value=u.value.longitude||0,me.value=u.value.send_advert_interval_hours||0)},{immediate:!0});const we=Ao(()=>r.value.node_name||"Not set"),Ce=Ao(()=>T.value?.local_hash||"Not available"),Ve=Ao(()=>{const Vn=T.value?.public_key;return!Vn||Vn==="Not set"?"Not set":Vn}),kr=Ao(()=>{const Vn=u.value.latitude;return Vn&&Vn!==0?Vn.toFixed(6):"Not set"}),It=Ao(()=>{const Vn=u.value.longitude;return Vn&&Vn!==0?Vn.toFixed(6):"Not set"}),rn=Ao(()=>{const Vn=u.value.mode;return Vn?Vn.charAt(0).toUpperCase()+Vn.slice(1):"Not set"}),Lr=Ao(()=>{const Vn=u.value.send_advert_interval_hours;return Vn===void 0?"Not set":Vn===0?"Disabled":Vn+" hour"+(Vn!==1?"s":"")}),Mr=()=>{$.value=!0,ct.value=null,yt.value=null},tn=()=>{$.value=!1,ct.value=null,Ut.value=r.value.node_name||"",ne.value=u.value.latitude||0,pe.value=u.value.longitude||0,me.value=u.value.send_advert_interval_hours||0},Dn=async()=>{K.value=!0,ct.value=null,yt.value=null;try{const Vn={};Ut.value&&(Vn.node_name=Ut.value),Vn.latitude=ne.value,Vn.longitude=pe.value,Vn.flood_advert_interval_hours=me.value;const pr=(await bs.post("/update_radio_config",Vn)).data;pr.message||pr.persisted?(yt.value=pr.message||"Settings saved successfully",$.value=!1,await t.fetchStats(),setTimeout(()=>{yt.value=null},3e3)):pr.error?ct.value=pr.error:ct.value="Unknown response from server"}catch(Vn){console.error("Failed to update repeater settings:",Vn);const on=Vn;ct.value=on.response?.data?.error||"Failed to update settings"}finally{K.value=!1}},Mn=()=>{St.value=!0},Br=Vn=>{ne.value=Vn.latitude,pe.value=Vn.longitude};return(Vn,on)=>(Or(),Nr("div",jwt,[yt.value?(Or(),Nr("div",Uwt,[At("p",$wt,yn(yt.value),1)])):Ta("",!0),ct.value?(Or(),Nr("div",Hwt,[At("p",Vwt,yn(ct.value),1)])):Ta("",!0),At("div",Wwt,[$.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:tn,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,qwt),At("button",{onClick:Dn,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(K.value?"Saving...":"Save Changes"),9,Gwt)],64)):(Or(),Nr("button",{key:0,onClick:Mr,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",Zwt,[At("div",Kwt,[on[5]||(on[5]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Node Name",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":on[0]||(on[0]=pr=>Ut.value=pr),type:"text",maxlength:"50",class:"w-full sm:w-64 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary",placeholder:"Enter node name"},null,512)),[[lu,Ut.value]]):(Or(),Nr("div",Ywt,yn(we.value),1))]),At("div",Xwt,[on[6]||(on[6]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Local Hash",-1)),At("span",Jwt,yn(Ce.value),1)]),At("div",Qwt,[on[7]||(on[7]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm flex-shrink-0"},"Public Key",-1)),At("span",t3t,yn(Ve.value),1)]),At("div",e3t,[on[8]||(on[8]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Latitude",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":on[1]||(on[1]=pr=>ne.value=pr),type:"number",step:"0.000001",min:"-90",max:"90",class:"w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,ne.value,void 0,{number:!0}]]):(Or(),Nr("div",r3t,yn(kr.value),1))]),At("div",n3t,[on[9]||(on[9]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Longitude",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":on[2]||(on[2]=pr=>pe.value=pr),type:"number",step:"0.000001",min:"-180",max:"180",class:"w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,pe.value,void 0,{number:!0}]]):(Or(),Nr("div",i3t,yn(It.value),1))]),$.value?(Or(),Nr("div",a3t,[At("button",{onClick:Mn,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm flex items-center gap-2",title:"Pick location on map"},on[10]||(on[10]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),cl(" Pick Location on Map ",-1)]))])):Ta("",!0),At("div",o3t,[on[11]||(on[11]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Mode",-1)),At("span",s3t,yn(rn.value),1)]),At("div",l3t,[At("div",c3t,[on[13]||(on[13]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Periodic Advertisement Interval",-1)),$.value?(Or(),Nr("div",h3t,[Ml(At("input",{"onUpdate:modelValue":on[3]||(on[3]=pr=>me.value=pr),type:"number",min:"0",max:"48",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[lu,me.value,void 0,{number:!0}]]),on[12]||(on[12]=At("span",{class:"text-content-muted dark:text-content-muted text-sm"},"hours",-1))])):(Or(),Nr("div",u3t,yn(Lr.value),1))]),on[14]||(on[14]=At("span",{class:"text-content-muted dark:text-content-muted text-xs"},"How often the repeater sends an advertisement packet (0 = disabled, 3-48 hours)",-1))])]),Vs(Nwt,{"is-open":St.value,latitude:ne.value,longitude:pe.value,onClose:on[4]||(on[4]=pr=>St.value=!1),onSelect:Br},null,8,["is-open","latitude","longitude"])]))}}),f3t={class:"space-y-4"},p3t={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm"},m3t={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm"},g3t={class:"flex justify-end gap-2"},v3t=["disabled"],y3t=["disabled"],_3t={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},x3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},b3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},w3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},k3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},T3t=Cc({__name:"DutyCycle",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config?.duty_cycle||{}),u=Ao(()=>{const we=r.value.max_airtime_percent;return typeof we=="number"?we.toFixed(1)+"%":we&&typeof we=="object"&&"parsedValue"in we?(we.parsedValue||0).toFixed(1)+"%":"Not set"}),T=Ao(()=>r.value.enforcement_enabled?"Enabled":"Disabled"),$=li(!1),K=li(!1),ct=li(""),yt=li(""),St=li(0),Ut=li(!0),ne=()=>{const we=r.value.max_airtime_percent;typeof we=="number"?St.value=we:we&&typeof we=="object"&&"parsedValue"in we?St.value=we.parsedValue||0:St.value=6,Ut.value=r.value.enforcement_enabled!==!1,$.value=!0,ct.value="",yt.value=""},pe=()=>{$.value=!1,ct.value="",yt.value=""},me=async()=>{K.value=!0,yt.value="",ct.value="";try{const Ce=(await nw.post("/api/update_duty_cycle_config",{max_airtime_percent:St.value,enforcement_enabled:Ut.value})).data;Ce.message||Ce.persisted?(ct.value=Ce.message||"Settings saved successfully",$.value=!1,await t.fetchStats(),setTimeout(()=>{ct.value=""},3e3)):yt.value="Failed to save settings"}catch(we){console.error("Failed to save duty cycle settings:",we),yt.value=we.response?.data?.error||"Failed to save settings"}finally{K.value=!1}};return(we,Ce)=>(Or(),Nr("div",f3t,[ct.value?(Or(),Nr("div",p3t,yn(ct.value),1)):Ta("",!0),yt.value?(Or(),Nr("div",m3t,yn(yt.value),1)):Ta("",!0),At("div",g3t,[$.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:pe,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,v3t),At("button",{onClick:me,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(K.value?"Saving...":"Save Changes"),9,y3t)],64)):(Or(),Nr("button",{key:0,onClick:ne,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",_3t,[At("div",x3t,[Ce[2]||(Ce[2]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Max Airtime %",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>St.value=Ve),type:"number",step:"0.1",min:"0.1",max:"100",class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,St.value,void 0,{number:!0}]]):(Or(),Nr("div",b3t,yn(u.value),1))]),At("div",w3t,[Ce[4]||(Ce[4]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Enforcement",-1)),$.value?Ml((Or(),Nr("select",{key:1,"onUpdate:modelValue":Ce[1]||(Ce[1]=Ve=>Ut.value=Ve),class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},Ce[3]||(Ce[3]=[At("option",{value:!0},"Enabled",-1),At("option",{value:!1},"Disabled",-1)]),512)),[[xg,Ut.value]]):(Or(),Nr("div",k3t,yn(T.value),1))])])]))}}),S3t={class:"space-y-4"},C3t={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm"},A3t={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm"},M3t={class:"flex justify-end gap-2"},E3t=["disabled"],L3t=["disabled"],P3t={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},I3t={class:"flex flex-col py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-2"},D3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},z3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},O3t={class:"flex flex-col py-2 gap-2"},B3t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},R3t={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},F3t=Cc({__name:"TransmissionDelays",setup(e){const t=Ym(),r=Ao(()=>t.stats?.config?.delays||{}),u=Ao(()=>{const we=r.value.tx_delay_factor;if(we&&typeof we=="object"&&we!==null&&"parsedValue"in we){const Ce=we.parsedValue;if(typeof Ce=="number")return Ce.toFixed(2)+"x"}return"Not set"}),T=Ao(()=>{const we=r.value.direct_tx_delay_factor;return typeof we=="number"?we.toFixed(2)+"s":"Not set"}),$=li(!1),K=li(!1),ct=li(""),yt=li(""),St=li(0),Ut=li(0),ne=()=>{const we=r.value.tx_delay_factor;we&&typeof we=="object"&&"parsedValue"in we?St.value=we.parsedValue||1:typeof we=="number"?St.value=we:St.value=1;const Ce=r.value.direct_tx_delay_factor;Ut.value=typeof Ce=="number"?Ce:.5,$.value=!0,ct.value="",yt.value=""},pe=()=>{$.value=!1,ct.value="",yt.value=""},me=async()=>{K.value=!0,yt.value="",ct.value="";try{const Ce=(await nw.post("/api/update_radio_config",{tx_delay_factor:St.value,direct_tx_delay_factor:Ut.value})).data;Ce.message||Ce.persisted?(ct.value=Ce.message||"Settings saved successfully",$.value=!1,await t.fetchStats(),setTimeout(()=>{ct.value=""},3e3)):yt.value="Failed to save settings"}catch(we){console.error("Failed to save delay settings:",we),yt.value=we.response?.data?.error||"Failed to save settings"}finally{K.value=!1}};return(we,Ce)=>(Or(),Nr("div",S3t,[ct.value?(Or(),Nr("div",C3t,yn(ct.value),1)):Ta("",!0),yt.value?(Or(),Nr("div",A3t,yn(yt.value),1)):Ta("",!0),At("div",M3t,[$.value?(Or(),Nr(Es,{key:1},[At("button",{onClick:pe,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,E3t),At("button",{onClick:me,disabled:K.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},yn(K.value?"Saving...":"Save Changes"),9,L3t)],64)):(Or(),Nr("button",{key:0,onClick:ne,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),At("div",P3t,[At("div",I3t,[At("div",D3t,[Ce[2]||(Ce[2]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Flood TX Delay Factor",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>St.value=Ve),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,St.value,void 0,{number:!0}]]):(Or(),Nr("div",z3t,yn(u.value),1))]),Ce[3]||(Ce[3]=At("span",{class:"text-content-muted dark:text-content-muted text-xs"},"Multiplier for flood packet transmission delays (collision avoidance)",-1))]),At("div",O3t,[At("div",B3t,[Ce[4]||(Ce[4]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Direct TX Delay Factor",-1)),$.value?Ml((Or(),Nr("input",{key:1,"onUpdate:modelValue":Ce[1]||(Ce[1]=Ve=>Ut.value=Ve),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[lu,Ut.value,void 0,{number:!0}]]):(Or(),Nr("div",R3t,yn(T.value),1))]),Ce[5]||(Ce[5]=At("span",{class:"text-content-muted dark:text-content-muted text-xs"},"Base delay for direct-routed packet transmission (seconds)",-1))])])]))}}),WH=OS("treeState",()=>{const e=g_(new Set),t=g_({value:null}),r=ct=>{e.add(ct)},u=ct=>{e.delete(ct)};return{expandedNodes:e,selectedNodeId:t,addExpandedNode:r,removeExpandedNode:u,isNodeExpanded:ct=>e.has(ct),setSelectedNode:ct=>{t.value=ct},toggleExpanded:ct=>{e.has(ct)?u(ct):r(ct)}}}),N3t={class:"select-none"},j3t={class:"flex-shrink-0"},U3t={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$3t={key:1,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},H3t={key:0,class:"hidden sm:flex items-center gap-1 ml-2"},V3t={class:"relative group"},W3t=["title"],q3t={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},G3t={class:"flex justify-between items-start mb-4"},Z3t={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},K3t={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},Y3t={class:"flex items-center gap-1 sm:gap-2 ml-auto flex-shrink-0"},X3t={key:0,class:"hidden sm:flex items-center gap-1"},J3t=["title"],Q3t={key:1,class:"hidden sm:flex items-center gap-1"},t5t={key:2,class:"hidden sm:inline-block px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},e5t={key:0,class:"space-y-1"},r5t=Cc({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const r=e,u=t,T=WH(),$=li(!1),K=Ao({get:()=>T.isNodeExpanded(r.node.id),set:Ce=>{Ce?T.addExpandedNode(r.node.id):T.removeExpandedNode(r.node.id)}}),ct=Ao(()=>r.node.children.length>0);function yt(Ce){if(!Ce)return"Never";const kr=new Date().getTime()-Ce.getTime(),It=Math.floor(kr/(1e3*60)),rn=Math.floor(kr/(1e3*60*60)),Lr=Math.floor(kr/(1e3*60*60*24)),Mr=Math.floor(Lr/365);return It<60?`${It}m ago`:rn<24?`${rn}h ago`:Lr<365?`${Lr}d ago`:`${Mr}y ago`}function St(Ce){return Ce?Ce.length<=16?Ce:`${Ce.slice(0,8)}...${Ce.slice(-8)}`:"No key"}function Ut(){if(ct.value){const Ce=!K.value;K.value=Ce}}function ne(){u("select",r.node.id)}function pe(Ce){u("select",Ce)}function me(Ce){Ce.stopPropagation(),$.value=!$.value}function we(Ce){Ce.stopPropagation(),r.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(r.node.transport_key)}return(Ce,Ve)=>{const kr=ES("TreeNode",!0);return Or(),Nr("div",N3t,[At("div",{class:ja(["flex flex-wrap sm:flex-nowrap items-start sm:items-center gap-1 sm:gap-2 py-2 px-2 sm:px-3 rounded-lg cursor-pointer transition-all duration-200",r.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",Ce.selectedNodeId===Ce.node.id&&!r.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${Ce.level*4}`]),onClick:Ve[3]||(Ve[3]=It=>!r.disabled&&ne())},[At("div",{class:"flex-shrink-0 w-3 h-3 sm:w-4 sm:h-4 flex items-center justify-center",onClick:Od(Ut,["stop"])},[ct.value?(Or(),Nr("svg",{key:0,class:ja(["w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-200",K.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ve[4]||(Ve[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):Ta("",!0)]),At("div",j3t,[r.node.name.startsWith("#")?(Or(),Nr("svg",U3t,Ve[5]||(Ve[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",$3t,Ve[6]||(Ve[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),At("span",{class:ja(["font-mono text-xs sm:text-sm transition-colors duration-200 break-all",Ce.selectedNodeId===Ce.node.id?"text-primary font-medium":""])},yn(Ce.node.name),3),Ce.node.transport_key?(Or(),Nr("div",H3t,[At("div",V3t,[At("button",{onClick:me,class:"p-1 rounded hover:bg-white/10 transition-colors",title:$.value?"Hide full key":"Show full key"},Ve[7]||(Ve[7]=[At("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,W3t),$.value?Ta("",!0):(Or(),Nr("span",q3t,yn(St(Ce.node.transport_key)),1)),$.value?(Or(),Nr("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:Ve[2]||(Ve[2]=It=>$.value=!1)},[At("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:Ve[1]||(Ve[1]=Od(()=>{},["stop"]))},[At("div",G3t,[Ve[9]||(Ve[9]=At("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),At("button",{onClick:Ve[0]||(Ve[0]=It=>$.value=!1),class:"text-white/60 hover:text-white transition-colors"},Ve[8]||(Ve[8]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",Z3t,[At("div",K3t,yn(Ce.node.transport_key),1)]),At("div",{class:"flex justify-end"},[At("button",{onClick:we,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},Ve[10]||(Ve[10]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),cl(" Copy Key ",-1)]))])])])):Ta("",!0)])])):Ta("",!0),At("div",Y3t,[Ce.node.last_used?(Or(),Nr("div",X3t,[Ve[11]||(Ve[11]=At("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),At("span",{class:"text-xs text-white/50",title:Ce.node.last_used.toLocaleString()},yn(yt(Ce.node.last_used)),9,J3t)])):(Or(),Nr("div",Q3t,Ve[12]||(Ve[12]=[At("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),At("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),At("span",{class:ja(["px-1.5 sm:px-2 py-0.5 text-[10px] sm:text-xs font-medium rounded-md transition-colors",Ce.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},yn(Ce.node.floodPolicy==="allow"?"ALLOW":"DENY"),3),ct.value?(Or(),Nr("span",t5t," > "+yn(Ce.node.children.length),1)):Ta("",!0)])],2),Vs(F2,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:V1(()=>[K.value&&Ce.node.children.length>0?(Or(),Nr("div",e5t,[(Or(!0),Nr(Es,null,jl(Ce.node.children,It=>(Or(),w0(kr,{key:It.id,node:It,"selected-node-id":Ce.selectedNodeId,level:Ce.level+1,disabled:r.disabled,onSelect:pe},null,8,["node","selected-node-id","level","disabled"]))),128))])):Ta("",!0)]),_:1})])}}}),n5t=vh(r5t,[["__scopeId","data-v-59e9974c"]]),i5t={class:"flex items-center justify-between mb-6"},a5t={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},o5t={key:0},s5t={class:"text-primary font-mono"},l5t={key:1},c5t={for:"keyName",class:"block text-sm font-medium text-white mb-2"},u5t={class:"flex items-center gap-2"},h5t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},d5t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},f5t={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},p5t={class:"flex items-center gap-3 mb-2"},m5t={class:"flex items-center gap-2"},g5t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},v5t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},y5t={class:"text-content-secondary dark:text-content-muted text-sm"},_5t={class:"grid grid-cols-2 gap-3"},x5t={class:"relative cursor-pointer group"},b5t={class:"relative cursor-pointer group"},w5t={class:"flex gap-3 pt-4"},k5t=["disabled"],T5t=Cc({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(e,{emit:t}){const r=e,u=t,T=li(""),$=li(""),K=li("allow"),ct=Ao(()=>T.value.startsWith("#")),yt=Ao(()=>({type:ct.value?"Region":"Private Key",description:ct.value?"Regional organizational key":"Individual assigned key"}));Fh(ct,me=>{me?$.value="This will create a new region for organizing keys":$.value="This will create a new private key entry"},{immediate:!0});const St=Ao(()=>T.value.trim().length>0),Ut=()=>{St.value&&(u("add",{name:T.value.trim(),floodPolicy:K.value,parentId:r.selectedNodeId}),T.value="",$.value="",K.value="allow")},ne=()=>{T.value="",$.value="",K.value="allow",u("close")},pe=me=>{me.target===me.currentTarget&&ne()};return(me,we)=>me.show?(Or(),Nr("div",{key:0,onClick:pe,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:we[3]||(we[3]=Od(()=>{},["stop"]))},[At("div",i5t,[At("div",null,[we[5]||(we[5]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Add New Entry",-1)),At("p",a5t,[r.selectedNodeName?(Or(),Nr("span",o5t,[we[4]||(we[4]=cl(" Add to: ",-1)),At("span",s5t,yn(r.selectedNodeName),1)])):(Or(),Nr("span",l5t," Add to root level (#uk) "))])]),At("button",{onClick:ne,class:"text-white/60 hover:text-white transition-colors"},we[6]||(we[6]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("form",{onSubmit:Od(Ut,["prevent"]),class:"space-y-4"},[At("div",null,[At("label",c5t,[At("div",u5t,[ct.value?(Or(),Nr("svg",h5t,we[7]||(we[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",d5t,we[8]||(we[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),we[9]||(we[9]=cl(" Region/Key Name ",-1))])]),Ml(At("input",{id:"keyName","onUpdate:modelValue":we[0]||(we[0]=Ce=>T.value=Ce),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[lu,T.value]])]),At("div",f5t,[At("div",p5t,[At("div",m5t,[ct.value?(Or(),Nr("svg",g5t,we[10]||(we[10]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",v5t,we[11]||(we[11]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),At("span",{class:ja([ct.value?"text-secondary":"text-accent-green","font-medium"])},yn(yt.value.type),3)]),At("div",{class:ja(["flex-1 h-px",ct.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),At("p",y5t,yn(yt.value.description),1)]),At("div",null,[we[14]||(we[14]=At("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-3"},[At("div",{class:"flex items-center gap-2"},[At("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),cl(" Flood Policy ")])],-1)),At("div",_5t,[At("label",x5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":we[1]||(we[1]=Ce=>K.value=Ce),value:"allow",class:"sr-only"},null,512),[[j5,K.value]]),we[12]||(we[12]=Du('
Allow

Permit flooding

',1))]),At("label",b5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":we[2]||(we[2]=Ce=>K.value=Ce),value:"deny",class:"sr-only"},null,512),[[j5,K.value]]),we[13]||(we[13]=Du('
Deny

Block flooding

',1))])])]),At("div",w5t,[At("button",{type:"button",onClick:ne,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{type:"submit",disabled:!St.value,class:ja(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",St.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-background-mute dark:bg-stroke/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted cursor-not-allowed"])}," Add "+yn(yt.value.type),11,k5t)])],32)])])):Ta("",!0)}}),S5t={class:"flex items-center justify-between mb-6"},C5t={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},A5t={class:"text-primary font-mono"},M5t={for:"keyName",class:"block text-sm font-medium text-content-secondary dark:text-content-primary mb-2"},E5t={class:"flex items-center gap-2"},L5t={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},P5t={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},I5t={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},D5t={class:"flex items-center gap-3 mb-2"},z5t={class:"flex items-center gap-2"},O5t={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},B5t={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},R5t={class:"text-content-secondary dark:text-content-muted text-sm"},F5t={key:0,class:"space-y-4"},N5t={key:0,class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},j5t={class:"bg-background-mute dark:bg-black/20 border border-stroke-subtle dark:border-stroke/10 rounded-md p-3"},U5t={class:"text-xs font-mono text-content-primary dark:text-content-primary/80 break-all"},$5t={key:1,class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},H5t={class:"flex items-center justify-between"},V5t={class:"text-sm text-content-secondary dark:text-content-muted"},W5t={class:"text-xs text-content-muted dark:text-content-muted"},q5t={class:"grid grid-cols-2 gap-3"},G5t={class:"relative cursor-pointer group"},Z5t={class:"relative cursor-pointer group"},K5t={class:"flex gap-3 pt-4"},Y5t=["disabled"],X5t=Cc({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(e,{emit:t}){const r=e,u=t,T=li(""),$=li("allow"),K=Ao(()=>T.value.startsWith("#")),ct=Ao(()=>({type:K.value?"Region":"Private Key",description:K.value?"Regional organizational key":"Individual assigned key"}));Fh(()=>r.node,Ce=>{Ce?(T.value=Ce.name,$.value=Ce.floodPolicy):(T.value="",$.value="allow")},{immediate:!0});const yt=Ao(()=>T.value.trim().length>0&&r.node),St=Ce=>{const kr=new Date().getTime()-Ce.getTime(),It=Math.floor(kr/(1e3*60)),rn=Math.floor(kr/(1e3*60*60)),Lr=Math.floor(kr/(1e3*60*60*24)),Mr=Math.floor(Lr/365);return It<60?`${It}m ago`:rn<24?`${rn}h ago`:Lr<365?`${Lr}d ago`:`${Mr}y ago`},Ut=Ce=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(Ce)},ne=()=>{!yt.value||!r.node||(u("save",{id:r.node.id,name:T.value.trim(),floodPolicy:$.value}),me())},pe=()=>{r.node&&(u("request-delete",r.node),me())},me=()=>{u("close")},we=Ce=>{Ce.target===Ce.currentTarget&&me()};return(Ce,Ve)=>Ce.show?(Or(),Nr("div",{key:0,onClick:we,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10",onClick:Ve[4]||(Ve[4]=Od(()=>{},["stop"]))},[At("div",S5t,[At("div",null,[Ve[6]||(Ve[6]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Edit Entry",-1)),At("p",C5t,[Ve[5]||(Ve[5]=cl(" Modify ",-1)),At("span",A5t,yn(Ce.node?.name),1)])]),At("button",{onClick:me,class:"text-white/60 hover:text-white transition-colors"},Ve[7]||(Ve[7]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("form",{onSubmit:Od(ne,["prevent"]),class:"space-y-4"},[At("div",null,[At("label",M5t,[At("div",E5t,[K.value?(Or(),Nr("svg",L5t,Ve[8]||(Ve[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",P5t,Ve[9]||(Ve[9]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Ve[10]||(Ve[10]=cl(" Region/Key Name ",-1))])]),Ml(At("input",{id:"keyName","onUpdate:modelValue":Ve[0]||(Ve[0]=kr=>T.value=kr),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[lu,T.value]])]),At("div",I5t,[At("div",D5t,[At("div",z5t,[K.value?(Or(),Nr("svg",O5t,Ve[11]||(Ve[11]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",B5t,Ve[12]||(Ve[12]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),At("span",{class:ja([K.value?"text-secondary":"text-accent-green","font-medium"])},yn(ct.value.type),3)]),At("div",{class:ja(["flex-1 h-px",K.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),At("p",R5t,yn(ct.value.description),1)]),Ce.node?(Or(),Nr("div",F5t,[Ce.node.transport_key?(Or(),Nr("div",N5t,[Ve[14]||(Ve[14]=Du('
Transport Key
',1)),At("div",j5t,[At("div",U5t,yn(Ce.node.transport_key),1),At("button",{onClick:Ve[1]||(Ve[1]=kr=>Ut(Ce.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},Ve[13]||(Ve[13]=[At("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),cl(" Copy Key ",-1)]))])])):Ta("",!0),Ce.node.last_used?(Or(),Nr("div",$5t,[Ve[15]||(Ve[15]=At("div",{class:"flex items-center gap-2 mb-3"},[At("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),At("span",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Last Used")],-1)),At("div",H5t,[At("div",V5t,yn(Ce.node.last_used.toLocaleDateString())+" at "+yn(Ce.node.last_used.toLocaleTimeString()),1),At("div",W5t,yn(St(Ce.node.last_used)),1)])])):Ta("",!0)])):Ta("",!0),At("div",null,[Ve[18]||(Ve[18]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary mb-3"},[At("div",{class:"flex items-center gap-2"},[At("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),cl(" Flood Policy ")])],-1)),At("div",q5t,[At("label",G5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":Ve[2]||(Ve[2]=kr=>$.value=kr),value:"allow",class:"sr-only"},null,512),[[j5,$.value]]),Ve[16]||(Ve[16]=Du('
Allow

Permit flooding

',1))]),At("label",Z5t,[Ml(At("input",{type:"radio","onUpdate:modelValue":Ve[3]||(Ve[3]=kr=>$.value=kr),value:"deny",class:"sr-only"},null,512),[[j5,$.value]]),Ve[17]||(Ve[17]=Du('
Deny

Block flooding

',1))])])]),At("div",K5t,[At("button",{type:"button",onClick:pe,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),At("button",{type:"button",onClick:me,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{type:"submit",disabled:!yt.value,class:ja(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",yt.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted/70 cursor-not-allowed"])}," Save Changes ",10,Y5t)])],32)])])):Ta("",!0)}}),J5t={class:"flex items-center gap-3 mb-6"},Q5t={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},t4t={class:"text-accent-red font-mono"},e4t={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},r4t={class:"flex items-start gap-3"},n4t={class:"flex-1"},i4t={class:"text-accent-red font-medium text-sm mb-2"},a4t={class:"space-y-1 max-h-32 overflow-y-auto"},o4t={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},s4t={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},l4t={class:"font-mono"},c4t={key:0,class:"text-content-secondary dark:text-content-muted text-xs"},u4t={key:1,class:"mb-6"},h4t={class:"mb-3"},d4t={class:"relative"},f4t={class:"space-y-2 max-h-40 overflow-y-auto border border-stroke-subtle dark:border-stroke/20 rounded-lg p-3 bg-gray-50 dark:bg-white/5"},p4t={key:0,class:"text-center py-4 text-content-secondary dark:text-content-muted text-sm"},m4t={class:"relative"},g4t=["value"],v4t={class:"flex items-center gap-2 flex-1"},y4t={class:"text-content-primary dark:text-content-primary font-mono text-sm"},_4t={key:0,class:"ml-auto px-2 py-0.5 bg-background-mute dark:bg-stroke/10 text-content-secondary dark:text-content-muted text-xs rounded-full"},x4t={class:"flex gap-3"},b4t=Cc({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(e,{emit:t}){const r=e,u=t,T=li(null),$=li(""),K=we=>{const Ce=[],Ve=kr=>{for(const It of kr.children)Ce.push(It),Ve(It)};return Ve(we),Ce},ct=Ao(()=>r.node?K(r.node):[]),yt=Ao(()=>{if(!r.node)return[];const we=new Set([r.node.id,...ct.value.map(Ve=>Ve.id)]),Ce=Ve=>{const kr=[];for(const It of Ve)It.name.startsWith("#")&&!we.has(It.id)&&kr.push(It),It.children.length>0&&kr.push(...Ce(It.children));return kr};return Ce(r.allNodes)}),St=Ao(()=>{if(!$.value.trim())return yt.value;const we=$.value.toLowerCase();return yt.value.filter(Ce=>Ce.name.toLowerCase().includes(we))}),Ut=()=>{r.node&&(u("delete-all",r.node.id),pe())},ne=()=>{!r.node||!T.value||(u("move-children",{nodeId:r.node.id,targetParentId:T.value}),pe())},pe=()=>{T.value=null,$.value="",u("close")},me=we=>{we.target===we.currentTarget&&pe()};return(we,Ce)=>we.show&&we.node?(Or(),Nr("div",{key:0,onClick:me,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10",onClick:Ce[2]||(Ce[2]=Od(()=>{},["stop"]))},[At("div",J5t,[Ce[6]||(Ce[6]=At("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),At("div",null,[Ce[4]||(Ce[4]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Confirm Deletion",-1)),At("p",Q5t,[Ce[3]||(Ce[3]=cl(" Deleting ",-1)),At("span",t4t,yn(we.node?.name),1)])]),At("button",{onClick:pe,class:"ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},Ce[5]||(Ce[5]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),ct.value.length>0?(Or(),Nr("div",e4t,[At("div",r4t,[Ce[9]||(Ce[9]=At("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),At("div",n4t,[At("h4",i4t," This will affect "+yn(ct.value.length)+" child "+yn(ct.value.length===1?"entry":"entries")+": ",1),At("div",a4t,[(Or(!0),Nr(Es,null,jl(ct.value.slice(0,10),Ve=>(Or(),Nr("div",{key:Ve.id,class:"flex items-center gap-2 text-xs text-content-secondary dark:text-content-primary/80"},[Ve.name.startsWith("#")?(Or(),Nr("svg",o4t,Ce[7]||(Ce[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Or(),Nr("svg",s4t,Ce[8]||(Ce[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),At("span",l4t,yn(Ve.name),1),At("span",{class:ja(["px-1 py-0.5 text-xs rounded",Ve.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},yn(Ve.floodPolicy),3)]))),128)),ct.value.length>10?(Or(),Nr("div",c4t," ...and "+yn(ct.value.length-10)+" more ",1)):Ta("",!0)])])])])):Ta("",!0),ct.value.length>0&&yt.value.length>0?(Or(),Nr("div",u4t,[Ce[13]||(Ce[13]=At("h4",{class:"text-content-primary dark:text-content-primary font-medium text-sm mb-3"},"Move children to another region:",-1)),At("div",h4t,[At("div",d4t,[Ce[10]||(Ce[10]=At("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-content-muted dark:text-content-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),Ml(At("input",{"onUpdate:modelValue":Ce[0]||(Ce[0]=Ve=>$.value=Ve),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[lu,$.value]])])]),At("div",f4t,[St.value.length===0?(Or(),Nr("div",p4t,yn($.value?"No regions match your search":"No available regions"),1)):Ta("",!0),(Or(!0),Nr(Es,null,jl(St.value,Ve=>(Or(),Nr("label",{key:Ve.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors group"},[At("div",m4t,[Ml(At("input",{type:"radio",value:Ve.id,"onUpdate:modelValue":Ce[1]||(Ce[1]=kr=>T.value=kr),class:"sr-only peer"},null,8,g4t),[[j5,T.value]]),Ce[11]||(Ce[11]=At("div",{class:"w-4 h-4 border-2 border-stroke dark:border-stroke/30 rounded-full group-hover:border-stroke dark:group-hover:border-stroke/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[At("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),At("div",v4t,[Ce[12]||(Ce[12]=At("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),At("span",y4t,yn(Ve.name),1),Ve.children.length>0?(Or(),Nr("span",_4t,yn(Ve.children.length),1)):Ta("",!0)])]))),128))])])):Ta("",!0),At("div",x4t,[At("button",{onClick:pe,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),ct.value.length>0&&T.value?(Or(),Nr("button",{key:0,onClick:ne,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):Ta("",!0),At("button",{onClick:Ut,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},yn(ct.value.length>0?"Delete All":"Delete"),1)])])])):Ta("",!0)}}),w4t={class:"space-y-4 sm:space-y-6"},k4t={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3"},T4t={class:"flex gap-2 flex-wrap"},S4t=["disabled"],C4t=["disabled"],A4t=["disabled"],M4t={class:"glass-card rounded-[15px] p-3 sm:p-4 border border-stroke-subtle dark:border-stroke/10 bg-background-mute dark:bg-white/5"},E4t={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},L4t={class:"flex items-center gap-2 sm:gap-3"},P4t={class:"flex bg-background-mute dark:bg-stroke/5 rounded-lg border border-stroke-subtle dark:border-stroke/20 p-0.5 sm:p-1"},I4t={class:"glass-card rounded-[15px] p-3 sm:p-6 border border-stroke-subtle dark:border-stroke/10"},D4t={key:0,class:"flex items-center justify-center py-8"},z4t={key:1,class:"text-center py-8"},O4t={class:"text-content-secondary dark:text-content-muted text-sm"},B4t={key:2,class:"text-center py-8"},R4t={key:3,class:"space-y-2"},F4t=Cc({name:"TransportKeys",__name:"TransportKeys",setup(e){const t=WH(),r=li(!1),u=li(!1),T=li(!1),$=li(null),K=li(null),ct=li("deny"),yt=li([]),St=li(!1),Ut=li(null),ne=pr=>{const _r=new Map,Sr=[];return pr.forEach(Dr=>{const nn={id:Dr.id,name:Dr.name,floodPolicy:Dr.flood_policy,transport_key:Dr.transport_key,last_used:Dr.last_used?new Date(Dr.last_used*1e3):void 0,parent_id:Dr.parent_id,children:[]};_r.set(Dr.id,nn)}),_r.forEach(Dr=>{Dr.parent_id&&_r.has(Dr.parent_id)?_r.get(Dr.parent_id).children.push(Dr):Sr.push(Dr)}),Sr},pe=async()=>{try{St.value=!0,Ut.value=null;const pr=await bs.getTransportKeys();pr.success&&pr.data?yt.value=ne(pr.data):Ut.value=pr.error||"Failed to load transport keys"}catch(pr){Ut.value=pr instanceof Error?pr.message:"Unknown error occurred",console.error("Error loading transport keys:",pr)}finally{St.value=!1}};Xd(()=>{pe()});function me(pr,_r){for(const Sr of pr){if(Sr.id===_r)return Sr;if(Sr.children){const Dr=me(Sr.children,_r);if(Dr)return Dr}}return null}function we(){const pr=t.selectedNodeId.value;return pr?me(yt.value,pr)?.name:void 0}function Ce(pr){ct.value==="deny"&&t.setSelectedNode(pr)}function Ve(){ct.value==="deny"&&(r.value=!0)}function kr(){if(ct.value==="deny"&&t.selectedNodeId.value){const pr=me(yt.value,t.selectedNodeId.value);pr&&(K.value=pr,T.value=!0)}}function It(){if(ct.value==="deny"&&t.selectedNodeId.value){const pr=me(yt.value,t.selectedNodeId.value);pr&&($.value=pr,u.value=!0)}}const rn=async pr=>{try{const _r=await bs.createTransportKey(pr.name,pr.floodPolicy,void 0,pr.parentId,void 0);_r.success?await pe():(console.error("Failed to add transport key:",_r.error),Ut.value=_r.error||"Failed to add transport key")}catch(_r){console.error("Error adding transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{r.value=!1}};function Lr(){r.value=!1}async function Mr(pr){try{const _r=pr==="allow",Sr=await bs.updateGlobalFloodPolicy(_r);Sr.success?ct.value=pr:(console.error("Failed to update global flood policy:",Sr.error),Ut.value=Sr.error||"Failed to update global flood policy")}catch(_r){console.error("Error updating global flood policy:",_r),Ut.value=_r instanceof Error?_r.message:"Failed to update global flood policy"}}function tn(){u.value=!1,$.value=null}async function Dn(pr){try{const _r=await bs.updateTransportKey(pr.id,pr.name,pr.floodPolicy);_r.success?await pe():(console.error("Failed to update transport key:",_r.error),Ut.value=_r.error||"Failed to update transport key")}catch(_r){console.error("Error updating transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{tn()}}function Mn(pr){u.value=!1,$.value=null,K.value=pr,T.value=!0}function Br(){T.value=!1,K.value=null}async function Vn(pr){try{const _r=await bs.deleteTransportKey(pr);_r.success?(await pe(),t.setSelectedNode(null)):(console.error("Failed to delete transport key:",_r.error),Ut.value=_r.error||"Failed to delete transport key")}catch(_r){console.error("Error deleting transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{Br()}}async function on(pr){try{const _r=await bs.deleteTransportKey(pr.nodeId);_r.success?(await pe(),t.setSelectedNode(null)):(console.error("Failed to delete transport key:",_r.error),Ut.value=_r.error||"Failed to delete transport key")}catch(_r){console.error("Error deleting transport key:",_r),Ut.value=_r instanceof Error?_r.message:"Unknown error occurred"}finally{Br()}}return(pr,_r)=>(Or(),Nr("div",w4t,[At("div",k4t,[_r[3]||(_r[3]=At("div",null,[At("h3",{class:"text-base sm:text-lg font-semibold text-content-primary dark:text-content-primary mb-1 sm:mb-2"},"Regions/Keys"),At("p",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Manage regional key hierarchy")],-1)),At("div",T4t,[At("button",{onClick:Ve,disabled:ct.value==="allow",class:ja(["flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",ct.value==="allow"?"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed":"bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"])},_r[2]||(_r[2]=[At("svg",{class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),cl(" Add ",-1)]),10,S4t),At("button",{onClick:It,disabled:!Lo(t).selectedNodeId.value||ct.value==="allow",class:ja(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Lo(t).selectedNodeId.value||ct.value==="allow"?"bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed":"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50"])}," Edit ",10,C4t),At("button",{onClick:kr,disabled:!Lo(t).selectedNodeId.value||ct.value==="allow",class:ja(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Lo(t).selectedNodeId.value||ct.value==="allow"?"bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed":"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50"])}," Delete ",10,A4t)])]),At("div",M4t,[At("div",E4t,[_r[4]||(_r[4]=At("div",null,[At("h4",{class:"text-xs sm:text-sm font-medium text-content-primary dark:text-content-primary mb-1"},"Global Flood Policy (*)"),At("p",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Master control for repeater flooding")],-1)),At("div",L4t,[At("div",P4t,[At("button",{onClick:_r[0]||(_r[0]=Sr=>Mr("deny")),class:ja(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ct.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary"])}," DENY ",2),At("button",{onClick:_r[1]||(_r[1]=Sr=>Mr("allow")),class:ja(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ct.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary"])}," ALLOW ",2)])])])]),At("div",I4t,[St.value?(Or(),Nr("div",D4t,_r[5]||(_r[5]=[At("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),At("span",{class:"ml-2 text-content-secondary dark:text-content-muted"},"Loading transport keys...",-1)]))):Ut.value?(Or(),Nr("div",z4t,[_r[6]||(_r[6]=At("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),At("div",O4t,yn(Ut.value),1),At("button",{onClick:pe,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):yt.value.length===0?(Or(),Nr("div",B4t,_r[7]||(_r[7]=[At("div",{class:"text-content-muted dark:text-content-muted mb-2"},"📝 No transport keys found",-1),At("div",{class:"text-content-muted dark:text-content-muted/60 text-sm"},"Add your first transport key to get started",-1)]))):(Or(),Nr("div",R4t,[(Or(!0),Nr(Es,null,jl(yt.value,Sr=>(Or(),w0(n5t,{key:Sr.id,node:Sr,"selected-node-id":Lo(t).selectedNodeId.value,level:0,disabled:ct.value==="allow",onSelect:Ce},null,8,["node","selected-node-id","disabled"]))),128))]))]),Vs(T5t,{show:r.value,"selected-node-name":we(),"selected-node-id":Lo(t).selectedNodeId.value||void 0,onClose:Lr,onAdd:rn},null,8,["show","selected-node-name","selected-node-id"]),Vs(X5t,{show:u.value,node:$.value,onClose:tn,onSave:Dn,onRequestDelete:Mn},null,8,["show","node"]),Vs(b4t,{show:T.value,node:K.value,"all-nodes":yt.value,onClose:Br,onDeleteAll:Vn,onMoveChildren:on},null,8,["show","node","all-nodes"])]))}}),N4t={class:"flex items-center justify-between mb-4"},j4t={class:"text-xl font-semibold text-content-primary dark:text-content-primary"},U4t={class:"mb-6"},$4t={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},H4t={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},V4t={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},W4t={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},q4t={class:"flex gap-3"},qH=Cc({__name:"ConfirmDialog",props:{show:{type:Boolean},title:{default:"Confirm Action"},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"warning"}},emits:["close","confirm"],setup(e,{emit:t}){const r=e,u=t,T=ct=>{ct.target===ct.currentTarget&&u("close")},$={danger:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",warning:"bg-yellow-100 dark:bg-yellow-500/20 border-yellow-500/30 text-yellow-600 dark:text-yellow-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},K={danger:"bg-red-500 hover:bg-red-600",warning:"bg-yellow-500 hover:bg-yellow-600",info:"bg-blue-500 hover:bg-blue-600"};return(ct,yt)=>r.show?(Or(),Nr("div",{key:0,onClick:T,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:yt[3]||(yt[3]=Od(()=>{},["stop"]))},[At("div",N4t,[At("h3",j4t,yn(r.title),1),At("button",{onClick:yt[0]||(yt[0]=St=>u("close")),class:"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},yt[4]||(yt[4]=[At("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",U4t,[At("div",{class:ja(["inline-flex p-3 rounded-xl mb-4",$[r.variant]])},[r.variant==="danger"?(Or(),Nr("svg",$4t,yt[5]||(yt[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):r.variant==="warning"?(Or(),Nr("svg",H4t,yt[6]||(yt[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):(Or(),Nr("svg",V4t,yt[7]||(yt[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),At("p",W4t,yn(r.message),1)]),At("div",q4t,[At("button",{onClick:yt[1]||(yt[1]=St=>u("close")),class:"flex-1 px-4 py-3 rounded-xl bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary transition-all duration-200 border border-stroke-subtle dark:border-stroke/10"},yn(r.cancelText),1),At("button",{onClick:yt[2]||(yt[2]=St=>u("confirm")),class:ja(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",K[r.variant]])},yn(r.confirmText),3)])])])):Ta("",!0)}}),G4t={class:"space-y-4 sm:space-y-6"},Z4t={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},K4t={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-4"},Y4t={class:"flex items-center gap-2 text-red-600 dark:text-red-400"},X4t={key:1,class:"flex items-center justify-center py-12"},J4t={key:2,class:"space-y-3"},Q4t={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},tkt={class:"flex-1"},ekt={class:"flex items-center gap-2 sm:gap-3"},rkt={class:"min-w-0 flex-1"},nkt={class:"text-content-primary dark:text-content-primary font-medium text-sm sm:text-base break-all"},ikt={class:"flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-1 text-xs text-content-secondary dark:text-content-muted"},akt={class:"truncate"},okt={class:"truncate"},skt=["onClick","disabled"],lkt={key:3,class:"text-center py-12"},ckt={class:"bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},ukt={class:"space-y-4"},hkt={class:"flex justify-end gap-3 mt-6"},dkt=["disabled"],fkt=["disabled"],pkt={class:"bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-lg w-full shadow-2xl"},mkt={class:"space-y-4"},gkt={class:"flex gap-2"},vkt=["value"],ykt={class:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4"},_kt={class:"block bg-blue-500/20 px-3 py-2 rounded text-xs text-blue-100 font-mono overflow-x-auto"},xkt=Cc({name:"APITokens",__name:"APITokens",setup(e){const t=li([]),r=li(!1),u=li(null),T=li(!1),$=li(""),K=li(null),ct=li(!1),yt=li(!1),St=li(null),Ut=async()=>{r.value=!0,u.value=null;try{const rn=await bs.get("/auth/tokens"),Lr=rn.data||rn;t.value=Lr.tokens||[]}catch(rn){console.error("Failed to fetch API tokens:",rn),u.value=rn instanceof Error?rn.message:"Failed to fetch tokens"}finally{r.value=!1}},ne=async()=>{if(!$.value.trim()){u.value="Token name is required";return}r.value=!0,u.value=null;try{const rn=await bs.post("/auth/tokens",{name:$.value.trim()}),Lr=rn.data||rn;K.value=Lr.token||null,T.value=!1,ct.value=!0,$.value="",await Ut()}catch(rn){console.error("Failed to create API token:",rn),u.value=rn instanceof Error?rn.message:"Failed to create token"}finally{r.value=!1}},pe=(rn,Lr)=>{St.value={id:rn,name:Lr},yt.value=!0},me=async()=>{if(St.value){r.value=!0,u.value=null;try{await bs.delete(`/auth/tokens/${St.value.id}`),await Ut(),yt.value=!1,St.value=null}catch(rn){console.error("Failed to revoke API token:",rn),u.value=rn instanceof Error?rn.message:"Failed to revoke token"}finally{r.value=!1}}},we=()=>{T.value=!1,$.value="",u.value=null},Ce=()=>{ct.value=!1,K.value=null},Ve=()=>{K.value&&navigator.clipboard.writeText(K.value)},kr=rn=>rn?new Date(rn*1e3).toLocaleString():"Never",It=Ao(()=>`${window.location.origin}/api/stats`);return Xd(()=>{Ut()}),(rn,Lr)=>(Or(),Nr(Es,null,[At("div",G4t,[At("div",Z4t,[Lr[5]||(Lr[5]=At("div",null,[At("h2",{class:"text-lg sm:text-xl font-semibold text-content-primary dark:text-content-primary"},"API Tokens"),At("p",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm mt-1"},"Manage API tokens for machine-to-machine authentication")],-1)),At("button",{onClick:Lr[0]||(Lr[0]=Mr=>T.value=!0),class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center justify-center gap-2 text-sm sm:text-base"},Lr[4]||(Lr[4]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),cl(" Create Token ",-1)]))]),Lr[20]||(Lr[20]=Du('

API tokens are used for machine-to-machine authentication. Include the token in the X-API-Key header when making API requests.

Tokens are only shown once at creation. Store them securely.

',1)),u.value?(Or(),Nr("div",K4t,[At("div",Y4t,[Lr[6]||(Lr[6]=At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),cl(" "+yn(u.value),1)])])):Ta("",!0),r.value&&t.value.length===0?(Or(),Nr("div",X4t,Lr[7]||(Lr[7]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-muted"},"Loading tokens...")],-1)]))):t.value.length>0?(Or(),Nr("div",J4t,[(Or(!0),Nr(Es,null,jl(t.value,Mr=>(Or(),Nr("div",{key:Mr.id,class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-3 sm:p-4 hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors"},[At("div",Q4t,[At("div",tkt,[At("div",ekt,[Lr[8]||(Lr[8]=At("svg",{class:"w-4 h-4 sm:w-5 sm:h-5 text-primary flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),At("div",rkt,[At("h3",nkt,yn(Mr.name),1),At("div",ikt,[At("span",akt,"Created: "+yn(kr(Mr.created_at)),1),At("span",okt,"Last used: "+yn(kr(Mr.last_used)),1)])])])]),At("button",{onClick:tn=>pe(Mr.id,Mr.name),disabled:r.value,class:"w-full sm:w-auto px-3 py-1.5 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 rounded-lg border border-red-500/50 transition-colors disabled:opacity-50 text-sm"}," Revoke ",8,skt)])]))),128))])):(Or(),Nr("div",lkt,[Lr[9]||(Lr[9]=At("svg",{class:"w-16 h-16 text-content-muted dark:text-content-muted/40 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),Lr[10]||(Lr[10]=At("h3",{class:"text-content-primary dark:text-content-primary font-medium mb-2"},"No API Tokens",-1)),Lr[11]||(Lr[11]=At("p",{class:"text-content-secondary dark:text-content-muted text-sm mb-4"},"Create a token to enable API access",-1)),At("button",{onClick:Lr[1]||(Lr[1]=Mr=>T.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Create Your First Token ")])),T.value?(Or(),Nr("div",{key:4,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Od(we,["self"])},[At("div",ckt,[Lr[14]||(Lr[14]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-4"},"Create API Token",-1)),At("div",ukt,[At("div",null,[Lr[12]||(Lr[12]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Token Name",-1)),Ml(At("input",{"onUpdate:modelValue":Lr[2]||(Lr[2]=Mr=>$.value=Mr),type:"text",placeholder:"e.g., Production Server, CI/CD Pipeline",class:"w-full px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-400 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",onKeydown:Sx(ne,["enter"])},null,544),[[lu,$.value]]),Lr[13]||(Lr[13]=At("p",{class:"text-xs text-content-muted dark:text-content-muted mt-1"},"Give your token a descriptive name to identify its purpose",-1))]),At("div",hkt,[At("button",{onClick:we,disabled:r.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50"}," Cancel ",8,dkt),At("button",{onClick:ne,disabled:r.value||!$.value.trim(),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50"},yn(r.value?"Creating...":"Create Token"),9,fkt)])])])])):Ta("",!0),ct.value&&K.value?(Or(),Nr("div",{key:5,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Od(Ce,["self"])},[At("div",pkt,[Lr[19]||(Lr[19]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-4"},"Token Created Successfully",-1)),At("div",mkt,[Lr[18]||(Lr[18]=Du('
Save this token now! For security reasons, it will not be shown again.
',1)),At("div",null,[Lr[16]||(Lr[16]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Your API Token",-1)),At("div",gkt,[At("input",{value:K.value,readonly:"",class:"flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary font-mono text-sm"},null,8,vkt),At("button",{onClick:Ve,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center gap-2",title:"Copy to clipboard"},Lr[15]||(Lr[15]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),cl(" Copy ",-1)]))])]),At("div",ykt,[Lr[17]||(Lr[17]=At("p",{class:"text-sm text-blue-200 mb-2"},[At("strong",null,"Usage Example:")],-1)),At("code",_kt,' curl -H "X-API-Key: '+yn(K.value)+'" '+yn(It.value),1)]),At("div",{class:"flex justify-end mt-6"},[At("button",{onClick:Ce,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Done ")])])])])):Ta("",!0)]),Vs(qH,{show:yt.value,title:"Revoke API Token",message:`Are you sure you want to revoke the token '${St.value?.name}'? This action cannot be undone.`,"confirm-text":"Revoke","cancel-text":"Cancel",variant:"danger",onConfirm:me,onClose:Lr[3]||(Lr[3]=Mr=>yt.value=!1)},null,8,["show","message"])],64))}}),bkt={class:"space-y-6"},wkt={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},kkt={class:"space-y-4"},Tkt={class:"flex items-center justify-between"},Skt=["disabled"],Ckt={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},Akt={class:"space-y-4"},Mkt={class:"space-y-3"},Ekt=["checked","disabled"],Lkt=["checked","disabled"],Pkt={class:"flex items-start gap-3"},Ikt={key:0,class:"w-5 h-5 text-green-600 dark:text-green-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Dkt={key:1,class:"w-5 h-5 text-accent-blue flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},zkt={class:"flex-1"},Okt={class:"text-sm font-medium text-content-primary dark:text-content-primary"},Bkt={key:0,class:"text-xs text-green-600 dark:text-green-400 mt-1"},Rkt={key:1,class:"p-4 bg-amber-500/10 border border-amber-500/30 rounded-lg"},Fkt={class:"flex items-start justify-between gap-3"},Nkt=["disabled"],jkt={key:0,class:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24"},Ukt={key:1,class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},$kt={class:"flex items-center space-x-2"},Hkt={key:0,class:"w-5 h-5 text-green-600 dark:text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Vkt={key:1,class:"w-5 h-5 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Wkt=Cc({name:"WebSettings",__name:"WebSettings",setup(e){const t=li(!1),r=li(""),u=li(!1),T=li(!1),$=li(!1),K=li(!1),ct=li(!0),yt=g_({cors_enabled:!1,use_default_frontend:!0}),St=Ao(()=>u.value?"bg-green-500/10 border-green-600/40 dark:border-green-500/30":"bg-red-500/10 border-red-500/30");async function Ut(){try{ct.value=!0;const It=await bs.get("/check_pymc_console");It.success&&It.data&&(K.value=It.data.exists,console.log("PyMC Console exists:",K.value))}catch(It){console.error("Failed to check PyMC Console:",It),K.value=!1}finally{ct.value=!1}}async function ne(){try{const It=await bs.get("/stats");console.log("WebSettings: Full response:",It);let rn=null;if(It.success&&It.data?rn=It.data:It&&"version"in It&&(rn=It),rn){const Lr=rn.config?.web||{};console.log("WebSettings: webConfig:",Lr),yt.cors_enabled=Lr.cors_enabled===!0,console.log("WebSettings: Set cors_enabled to:",yt.cors_enabled);const Mr=Lr.web_path;yt.use_default_frontend=!Mr||Mr==="",console.log("WebSettings: Set use_default_frontend to:",yt.use_default_frontend,"from web_path:",Mr)}}catch(It){console.error("Failed to load web settings:",It),Ve("Failed to load settings",!1)}}async function pe(){t.value=!0,r.value="";try{const It={web:{cors_enabled:yt.cors_enabled}};yt.use_default_frontend?It.web.web_path=null:It.web.web_path="/opt/pymc_console/web/html";const rn=await bs.post("/update_web_config",It);rn.success?(Ve("Settings saved successfully",!0),T.value=!0):Ve(rn.error||"Failed to save settings",!1)}catch(It){console.error("Failed to save web settings:",It),Ve(It.message||"Failed to save settings",!1)}finally{t.value=!1}}async function me(){yt.cors_enabled=!yt.cors_enabled,await pe()}async function we(){yt.use_default_frontend=!0,await pe()}async function Ce(){yt.use_default_frontend=!1,await pe()}function Ve(It,rn){r.value=It,u.value=rn,setTimeout(()=>{r.value=""},5e3)}async function kr(){$.value=!0,r.value="";try{const It=await bs.post("/restart_service",{});It.success?(Ve("Service restart initiated. Page will reload...",!0),T.value=!1,setTimeout(()=>{window.location.reload()},2e3)):Ve(It.error||"Failed to restart service",!1)}catch(It){It.code==="ERR_NETWORK"||It.message?.includes("Network error")?(Ve("Service restarting... Page will reload",!0),T.value=!1,setTimeout(()=>{window.location.reload()},3e3)):(console.error("Failed to restart service:",It),Ve(It.message||"Failed to restart service",!1))}finally{$.value=!1}}return Xd(()=>{ne(),Ut()}),(It,rn)=>(Or(),Nr("div",bkt,[At("div",wkt,[rn[1]||(rn[1]=At("div",{class:"flex items-start justify-between mb-4"},[At("div",null,[At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"CORS Settings"),At("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Control cross-origin resource sharing for API access")])],-1)),At("div",kkt,[At("div",Tkt,[rn[0]||(rn[0]=At("div",null,[At("label",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Enable CORS"),At("p",{class:"text-xs text-content-secondary dark:text-content-muted mt-1"},"Allow web frontends from different origins to access the API")],-1)),At("button",{onClick:me,disabled:t.value,class:ja(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",yt.cors_enabled?"bg-accent-blue border-accent-blue":"bg-gray-600 border-gray-600",t.value?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[At("span",{class:ja(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",yt.cors_enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,Skt)])])]),At("div",Ckt,[rn[11]||(rn[11]=At("div",{class:"flex items-start justify-between mb-4"},[At("div",null,[At("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Web Frontend"),At("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Choose which web interface to use")])],-1)),At("div",Akt,[At("div",Mkt,[At("label",{class:ja(["flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all",yt.use_default_frontend?"border-accent-blue bg-accent-blue/10":"border-stroke-subtle dark:border-stroke/10 hover:border-accent-blue/50"])},[At("input",{type:"radio",name:"frontend",checked:yt.use_default_frontend,onChange:we,disabled:t.value,class:"mt-1 h-4 w-4 text-accent-blue focus:ring-accent-blue focus:ring-offset-background"},null,40,Ekt),rn[2]||(rn[2]=At("div",{class:"flex-1"},[At("div",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Default Frontend"),At("div",{class:"text-xs text-content-secondary dark:text-content-muted mt-1"},"Built-in pyMC Repeater web interface"),At("div",{class:"text-xs text-content-muted dark:text-content-muted/60 mt-1 font-mono"},"Built-in")],-1))],2),At("label",{class:ja(["flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all",yt.use_default_frontend?"border-stroke-subtle dark:border-stroke/10 hover:border-accent-blue/50":"border-accent-blue bg-accent-blue/10"])},[At("input",{type:"radio",name:"frontend",checked:!yt.use_default_frontend,onChange:Ce,disabled:t.value,class:"mt-1 h-4 w-4 text-accent-blue focus:ring-accent-blue focus:ring-offset-background"},null,40,Lkt),rn[3]||(rn[3]=Du('
PyMC Console
@Treehouse⚡
Alternative web interface for pyMC Repeater
/opt/pymc_console/web/html
',1))],2)]),ct.value?Ta("",!0):(Or(),Nr("div",{key:0,class:ja(["p-4 rounded-lg border",K.value?"bg-green-500/5 border-green-500/20":"bg-accent-blue/5 border-accent-blue/20"])},[At("div",Pkt,[K.value?(Or(),Nr("svg",Ikt,rn[4]||(rn[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(Or(),Nr("svg",Dkt,rn[5]||(rn[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))),At("div",zkt,[At("h4",Okt,yn(K.value?"PyMC Console has been detected":"PyMC Console Not Installed"),1),K.value?(Or(),Nr("p",Bkt,rn[6]||(rn[6]=[cl(" PyMC Console is installed at ",-1),At("code",{class:"text-green-700 dark:text-green-300"},"/opt/pymc_console/web/html",-1)]))):(Or(),Nr(Es,{key:1},[rn[7]||(rn[7]=Du('

PyMC Console must be installed at /opt/pymc_console/web/html before selecting this option.

PyMC Console Install Instructions ',2))],64))])])],2)),T.value?(Or(),Nr("div",Rkt,[At("div",Fkt,[rn[10]||(rn[10]=Du('

Service restart required

Web frontend changes will take effect after restarting the pymc-repeater service.

',1)),At("button",{onClick:kr,disabled:$.value,class:"px-4 py-2 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-500/50 text-white font-medium rounded-lg transition-colors disabled:cursor-not-allowed flex items-center gap-2 whitespace-nowrap"},[$.value?(Or(),Nr("svg",jkt,rn[8]||(rn[8]=[At("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),At("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):(Or(),Nr("svg",Ukt,rn[9]||(rn[9]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]))),cl(" "+yn($.value?"Restarting...":"Restart Now"),1)],8,Nkt)])])):Ta("",!0)])]),r.value?(Or(),Nr("div",{key:0,class:ja(["p-4 rounded-lg border",St.value])},[At("div",$kt,[u.value?(Or(),Nr("svg",Hkt,rn[12]||(rn[12]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):(Or(),Nr("svg",Vkt,rn[13]||(rn[13]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))),At("span",{class:ja(u.value?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400")},yn(r.value),3)])],2)):Ta("",!0)]))}}),qkt={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},Gkt={class:"glass-card rounded-[15px] z-10 p-3 sm:p-4 border border-cyan-400 dark:border-primary/30 bg-cyan-500/10 dark:bg-primary/10"},Zkt={class:"text-cyan-700 dark:text-primary text-sm sm:text-base"},Kkt={class:"mt-1 sm:mt-2 text-cyan-600 dark:text-primary/80"},Ykt={class:"glass-card rounded-[15px] p-3 sm:p-6"},Xkt={class:"flex overflow-x-auto border-b border-stroke-subtle dark:border-stroke/10 mb-4 sm:mb-6 -mx-3 px-3 sm:mx-0 sm:px-0 scrollbar-hide"},Jkt=["onClick"],Qkt={class:"flex items-center gap-1 sm:gap-2"},t6t={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e6t={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},r6t={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n6t={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},i6t={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a6t={key:5,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o6t={key:6,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},s6t={class:"min-h-[400px]"},l6t={key:0,class:"flex items-center justify-center py-12"},c6t={key:1,class:"flex items-center justify-center py-12"},u6t={class:"text-center"},h6t={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},d6t={key:2},f6t=Cc({name:"ConfigurationView",__name:"Configuration",setup(e){const t=Ym(),r=li(B1("configuration_activeTab","radio")),u=li(!1);Fh(r,K=>R1("configuration_activeTab",K));const T=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"},{id:"api-tokens",label:"API Tokens",icon:"tokens"},{id:"web",label:"Web Options",icon:"web"}];Xd(async()=>{try{await t.fetchStats(),u.value=!0}catch(K){console.error("Failed to load configuration data:",K),u.value=!0}});function $(K){r.value=K}return(K,ct)=>{const yt=ES("router-link");return Or(),Nr("div",qkt,[ct[13]||(ct[13]=At("div",null,[At("h1",{class:"text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary"},"Configuration"),At("p",{class:"text-content-secondary dark:text-content-muted mt-1 sm:mt-2 text-sm sm:text-base"},"System configuration and settings")],-1)),At("div",Gkt,[At("div",Zkt,[ct[3]||(ct[3]=At("strong",null,"CAD Calibration Tool Available",-1)),At("p",Kkt,[ct[2]||(ct[2]=cl(" Optimize your Channel Activity Detection settings. ",-1)),Vs(yt,{to:"/cad-calibration",class:"underline hover:text-cyan-800 dark:hover:text-primary transition-colors"},{default:V1(()=>ct[1]||(ct[1]=[cl(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[1]})])])]),At("div",Ykt,[At("div",Xkt,[(Or(),Nr(Es,null,jl(T,St=>At("button",{key:St.id,onClick:Ut=>$(St.id),class:ja(["px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium transition-colors duration-200 border-b-2 mr-3 sm:mr-6 whitespace-nowrap flex-shrink-0",r.value===St.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[At("div",Qkt,[St.icon==="radio"?(Or(),Nr("svg",t6t,ct[4]||(ct[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):St.icon==="repeater"?(Or(),Nr("svg",e6t,ct[5]||(ct[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):St.icon==="duty"?(Or(),Nr("svg",r6t,ct[6]||(ct[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):St.icon==="delays"?(Or(),Nr("svg",n6t,ct[7]||(ct[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):St.icon==="keys"?(Or(),Nr("svg",i6t,ct[8]||(ct[8]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):St.icon==="tokens"?(Or(),Nr("svg",a6t,ct[9]||(ct[9]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)]))):St.icon==="web"?(Or(),Nr("svg",o6t,ct[10]||(ct[10]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)]))):Ta("",!0),cl(" "+yn(St.label),1)])],10,Jkt)),64))]),At("div",s6t,[!u.value&&Lo(t).isLoading?(Or(),Nr("div",l6t,ct[11]||(ct[11]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-muted"},"Loading configuration...")],-1)]))):Lo(t).error&&!u.value?(Or(),Nr("div",c6t,[At("div",u6t,[ct[12]||(ct[12]=At("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load configuration",-1)),At("div",h6t,yn(Lo(t).error),1),At("button",{onClick:ct[0]||(ct[0]=St=>Lo(t).fetchStats()),class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):(Or(),Nr("div",d6t,[Ml(At("div",null,[Vs(Dwt,{key:"radio-settings"})],512),[[Zy,r.value==="radio"]]),Ml(At("div",null,[Vs(d3t,{key:"repeater-settings"})],512),[[Zy,r.value==="repeater"]]),Ml(At("div",null,[Vs(T3t,{key:"duty-cycle"})],512),[[Zy,r.value==="duty"]]),Ml(At("div",null,[Vs(F3t,{key:"transmission-delays"})],512),[[Zy,r.value==="delays"]]),Ml(At("div",null,[Vs(F4t,{key:"transport-keys"})],512),[[Zy,r.value==="transport"]]),Ml(At("div",null,[Vs(xkt,{key:"api-tokens"})],512),[[Zy,r.value==="api-tokens"]]),Ml(At("div",null,[Vs(Wkt,{key:"web-settings"})],512),[[Zy,r.value==="web"]])]))])])])}}}),p6t={class:"p-6 space-y-6"},m6t={class:"glass-card rounded-[15px] p-6"},g6t={class:"flex justify-center"},v6t={class:"flex gap-4"},y6t=["disabled"],_6t=["disabled"],x6t={class:"glass-card rounded-[15px] p-6 space-y-4"},b6t={class:"text-white"},w6t={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},k6t={class:"text-primary/90"},T6t={class:"space-y-2"},S6t={class:"w-full bg-white/10 rounded-full h-2"},C6t={class:"text-white/70 text-sm"},A6t={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},M6t={class:"glass-card rounded-[15px] p-4 text-center"},E6t={class:"text-2xl font-bold text-primary"},L6t={class:"glass-card rounded-[15px] p-4 text-center"},P6t={class:"text-2xl font-bold text-primary"},I6t={class:"glass-card rounded-[15px] p-4 text-center"},D6t={class:"text-2xl font-bold text-primary"},z6t={class:"glass-card rounded-[15px] p-4 text-center"},O6t={class:"text-2xl font-bold text-primary"},B6t={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},R6t={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},F6t={class:"text-white/80 mb-4"},N6t={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},j6t=Cc({name:"CADCalibrationView",__name:"CADCalibration",setup(e){const t=Ym(),r=li(!1),u=li(null),T=li(null),$=li({}),K=li(null),ct=li([]),yt=li({}),St=li("Ready to start calibration"),Ut=li(0),ne=li(0),pe=li(0),me=li(0),we=li(0),Ce=li(0),Ve=li(null),kr=li(!1),It=li(!1),rn=li(!1),Lr=li(!1);let Mr=null;const tn={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function Dn(){const nn=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:"#ffffff",size:14}},tickfont:{color:"#ffffff"},bgcolor:"rgba(0,0,0,0)",bordercolor:"rgba(255,255,255,0.2)",borderwidth:1,thickness:15},line:{color:"rgba(255,255,255,0.2)",width:1}},hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
",name:"Test Results"}],Cn={title:{text:'CAD Detection Rate
Channel Activity Detection Calibration',font:{color:"#ffffff",size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},yaxis:{title:{text:"CAD Min Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:"#ffffff",family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};D1.newPlot("plotly-chart",nn,Cn,tn)}function Mn(){if(Object.keys($.value).length===0)return;const nn=Object.values($.value),Cn=[],Xn=[],_i=[];for(const va of nn)Cn.push(va.det_peak),Xn.push(va.det_min),_i.push(va.detection_rate);const ta={x:[Cn],y:[Xn],"marker.color":[_i],hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
"};D1.restyle("plotly-chart",ta,[0])}async function Br(){try{const Xn=await bs.post("/cad-calibration-start",{samples:10,delay_ms:50});if(Xn.success)r.value=!0,u.value=Date.now(),t.setCadCalibrationRunning(!0),$.value={},ct.value=[],yt.value={},K.value=null,kr.value=!1,It.value=!1,rn.value=!1,Lr.value=!1,pe.value=0,me.value=0,we.value=0,Ce.value=0,Ut.value=0,ne.value=0,Mr=setInterval(()=>{u.value&&(Ce.value=Math.floor((Date.now()-u.value)/1e3))},1e3),on();else throw new Error(Xn.error||"Failed to start calibration")}catch(Xn){St.value=`Error: ${Xn instanceof Error?Xn.message:"Unknown error"}`}}async function Vn(){try{(await bs.post("/cad-calibration-stop")).success&&(r.value=!1,t.setCadCalibrationRunning(!1),T.value&&(T.value.close(),T.value=null),Mr&&(clearInterval(Mr),Mr=null))}catch(nn){console.error("Failed to stop calibration:",nn)}}function on(){T.value&&T.value.close(),T.value=new EventSource(`${PL}/api/cad-calibration-stream`),T.value.onmessage=function(nn){try{const Cn=JSON.parse(nn.data);pr(Cn)}catch(Cn){console.error("Failed to parse SSE data:",Cn)}},T.value.onerror=function(nn){console.error("SSE connection error:",nn),r.value||T.value&&(T.value.close(),T.value=null)}}function pr(nn){switch(nn.type){case"status":St.value=nn.message||"Status update",nn.test_ranges&&(Ve.value=nn.test_ranges,kr.value=!0);break;case"progress":Ut.value=nn.current||0,ne.value=nn.total||0,pe.value=nn.current||0;break;case"result":if(nn.det_peak!==void 0&&nn.det_min!==void 0&&nn.detection_rate!==void 0&&nn.detections!==void 0&&nn.samples!==void 0){const Cn=`${nn.det_peak}_${nn.det_min}`;$.value[Cn]={det_peak:nn.det_peak,det_min:nn.det_min,detection_rate:nn.detection_rate,detections:nn.detections,samples:nn.samples},Mn(),_r()}break;case"complete":case"completed":r.value=!1,St.value=nn.message||"Calibration completed",t.setCadCalibrationRunning(!1),Sr(),T.value&&(T.value.close(),T.value=null),Mr&&(clearInterval(Mr),Mr=null);break;case"error":St.value=`Error: ${nn.message}`,t.setCadCalibrationRunning(!1),Vn();break}}function _r(){const nn=Object.values($.value).map(Cn=>Cn.detection_rate);nn.length!==0&&(me.value=Math.max(...nn),we.value=nn.reduce((Cn,Xn)=>Cn+Xn,0)/nn.length)}function Sr(){It.value=!0;let nn=null,Cn=0;for(const Xn of Object.values($.value))Xn.detection_rate>Cn&&(Cn=Xn.detection_rate,nn=Xn);K.value=nn,nn&&Cn>0?(rn.value=!0,Lr.value=!1):(rn.value=!1,Lr.value=!0)}async function Dr(){if(!K.value){St.value="Error: No calibration results to save";return}try{const nn=await bs.post("/save_cad_settings",{peak:K.value.det_peak,min_val:K.value.det_min,detection_rate:K.value.detection_rate});if(nn.success)St.value=`Settings saved! Peak=${K.value.det_peak}, Min=${K.value.det_min} applied to configuration.`;else throw new Error(nn.error||"Failed to save settings")}catch(nn){St.value=`Error: Failed to save settings: ${nn instanceof Error?nn.message:"Unknown error"}`}}return Xd(()=>{Dn()}),Dv(()=>{T.value&&T.value.close(),Mr&&clearInterval(Mr),t.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&D1.purge("plotly-chart")}),(nn,Cn)=>(Or(),Nr("div",p6t,[Cn[14]||(Cn[14]=At("div",null,[At("h1",{class:"text-2xl font-bold text-white"},"CAD Calibration Tool"),At("p",{class:"text-white/70 mt-2"},"Channel Activity Detection calibration")],-1)),At("div",m6t,[At("div",g6t,[At("div",v6t,[At("button",{onClick:Br,disabled:r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Cn[0]||(Cn[0]=[Du('
Start Calibration
Begin testing
',2)]),8,y6t),At("button",{onClick:Vn,disabled:!r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},Cn[1]||(Cn[1]=[Du('
Stop
Halt calibration
',2)]),8,_6t)])])]),At("div",x6t,[At("div",b6t,yn(St.value),1),kr.value&&Ve.value?(Or(),Nr("div",w6t,[At("div",k6t,[Cn[2]||(Cn[2]=At("strong",null,"Configuration:",-1)),cl(" SF"+yn(Ve.value.spreading_factor)+" | Peak: "+yn(Ve.value.peak_min)+" - "+yn(Ve.value.peak_max)+" | Min: "+yn(Ve.value.min_min)+" - "+yn(Ve.value.min_max)+" | "+yn((Ve.value.peak_max-Ve.value.peak_min+1)*(Ve.value.min_max-Ve.value.min_min+1))+" tests ",1)])])):Ta("",!0),At("div",T6t,[At("div",S6t,[At("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:Sp({width:ne.value>0?`${Ut.value/ne.value*100}%`:"0%"})},null,4)]),At("div",C6t,yn(Ut.value)+" / "+yn(ne.value)+" tests completed",1)])]),At("div",A6t,[At("div",M6t,[At("div",E6t,yn(pe.value),1),Cn[3]||(Cn[3]=At("div",{class:"text-white/70 text-sm"},"Tests Completed",-1))]),At("div",L6t,[At("div",P6t,yn(me.value.toFixed(1))+"%",1),Cn[4]||(Cn[4]=At("div",{class:"text-white/70 text-sm"},"Best Detection Rate",-1))]),At("div",I6t,[At("div",D6t,yn(we.value.toFixed(1))+"%",1),Cn[5]||(Cn[5]=At("div",{class:"text-white/70 text-sm"},"Average Rate",-1))]),At("div",z6t,[At("div",O6t,yn(Ce.value)+"s",1),Cn[6]||(Cn[6]=At("div",{class:"text-white/70 text-sm"},"Elapsed Time",-1))])]),Cn[15]||(Cn[15]=At("div",{class:"glass-card rounded-[15px] p-6"},[At("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),It.value?(Or(),Nr("div",B6t,[Cn[13]||(Cn[13]=At("h3",{class:"text-xl font-bold text-white"},"Calibration Results",-1)),rn.value&&K.value?(Or(),Nr("div",R6t,[Cn[11]||(Cn[11]=At("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),At("p",F6t,[Cn[7]||(Cn[7]=cl(" Peak: ",-1)),At("strong",null,yn(K.value.det_peak),1),Cn[8]||(Cn[8]=cl(", Min: ",-1)),At("strong",null,yn(K.value.det_min),1),Cn[9]||(Cn[9]=cl(", Rate: ",-1)),At("strong",null,yn(K.value.detection_rate.toFixed(1))+"%",1)]),At("div",{class:"flex justify-center"},[At("button",{onClick:Dr,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},Cn[10]||(Cn[10]=[Du('
Save Settings
Apply to configuration
',2)]))])])):Ta("",!0),Lr.value?(Or(),Nr("div",N6t,Cn[12]||(Cn[12]=[At("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),At("p",{class:"text-white/70"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):Ta("",!0)])):Ta("",!0)]))}}),U6t=vh(j6t,[["__scopeId","data-v-854f5f55"]]),$6t={class:"p-6 space-y-6"},H6t={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},V6t={class:"glass-card rounded-[15px] p-4"},W6t={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},q6t={class:"glass-card rounded-[15px] p-4"},G6t={class:"text-2xl font-bold text-cyan-500 dark:text-primary"},Z6t={class:"glass-card rounded-[15px] p-4"},K6t={class:"text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green"},Y6t={class:"glass-card rounded-[15px] p-4"},X6t={class:"text-2xl font-bold text-yellow-500 dark:text-secondary"},J6t={class:"glass-card rounded-[15px] p-6"},Q6t={class:"flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6"},tTt=["onClick"],eTt={class:"flex items-center gap-2"},rTt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},nTt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},iTt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},aTt={class:"min-h-[400px]"},oTt={key:0,class:"flex items-center justify-center py-12"},sTt={key:1,class:"flex items-center justify-center py-12"},lTt={class:"text-center"},cTt={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},uTt={key:2,class:"space-y-4"},hTt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},dTt={key:1,class:"space-y-4"},fTt={class:"flex items-start justify-between"},pTt={class:"flex-1"},mTt={class:"flex items-center gap-3 mb-2"},gTt={class:"text-lg font-semibold text-content-primary dark:text-content-primary"},vTt={class:"text-content-muted dark:text-content-muted text-sm"},yTt={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},_Tt={class:"text-content-primary dark:text-content-primary font-medium"},xTt={class:"text-cyan-500 dark:text-primary font-medium"},bTt={class:"mt-3 flex items-center gap-2"},wTt={key:3,class:"space-y-4"},kTt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},TTt={key:1,class:"overflow-x-auto"},STt={class:"w-full"},CTt={class:"py-3"},ATt={class:"font-mono text-sm text-content-primary dark:text-content-primary"},MTt={class:"py-3"},ETt={class:"font-mono text-xs text-content-secondary dark:text-content-muted"},LTt={class:"py-3"},PTt={class:"text-sm text-content-primary dark:text-content-primary"},ITt={class:"text-xs text-content-muted dark:text-content-muted"},DTt={class:"py-3"},zTt={class:"py-3"},OTt={class:"text-sm text-content-secondary dark:text-content-muted"},BTt={class:"py-3"},RTt=["onClick"],FTt={key:4,class:"space-y-4"},NTt={class:"mb-4"},jTt=["value"],UTt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},$Tt={key:1,class:"grid grid-cols-1 gap-4"},HTt={class:"flex items-start justify-between"},VTt={class:"flex-1"},WTt={class:"flex items-center gap-3 mb-3"},qTt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},GTt={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},ZTt={class:"text-content-primary dark:text-content-primary/90 font-mono ml-2"},KTt={class:"text-content-primary dark:text-content-primary/90 ml-2"},YTt={class:"text-content-primary dark:text-content-primary/90 ml-2"},XTt={class:"text-content-primary dark:text-content-primary/90 ml-2"},JTt=["onClick"],QTt={class:"flex justify-end"},tSt=["disabled"],eSt=Cc({name:"SessionsView",__name:"Sessions",setup(e){const t=li("overview"),r=li(!1),u=li(!1),T=li(null),$=li(null),K=li([]),ct=li(null),yt=li(null),St=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];Xd(async()=>{await Ut(),r.value=!0});async function Ut(){u.value=!0,T.value=null;try{const Ve=await bs.getACLInfo();Ve.success&&($.value=Ve.data);const kr=await bs.getACLClients();kr.success&&kr.data&&(K.value=kr.data.clients||[]);const It=await bs.getACLStats();It.success&&(ct.value=It.data)}catch(Ve){T.value=Ve instanceof Error?Ve.message:"Failed to load ACL data",console.error("Error fetching ACL data:",Ve)}finally{u.value=!1}}async function ne(Ve,kr){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const It=await bs.removeACLClient({public_key:Ve,identity_hash:kr});It.success?await Ut():alert(`Failed to remove client: ${It.error}`)}catch(It){alert(`Error removing client: ${It}`)}}function pe(Ve){return Ve?new Date(Ve*1e3).toLocaleString():"Never"}function me(Ve){t.value=Ve}const we=Ao(()=>yt.value?K.value.filter(Ve=>Ve.identity_name===yt.value):K.value),Ce=Ao(()=>$.value?$.value.acls||[]:[]);return(Ve,kr)=>(Or(),Nr("div",$6t,[kr[22]||(kr[22]=At("div",null,[At("h1",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"Sessions & Access Control"),At("p",{class:"text-content-secondary dark:text-content-muted mt-2"},"Manage authenticated clients and access control lists")],-1)),ct.value?(Or(),Nr("div",H6t,[At("div",V6t,[kr[1]||(kr[1]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Total Identities",-1)),At("div",W6t,yn(ct.value.total_identities),1)]),At("div",q6t,[kr[2]||(kr[2]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Authenticated Clients",-1)),At("div",G6t,yn(ct.value.total_clients),1)]),At("div",Z6t,[kr[3]||(kr[3]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Admin Clients",-1)),At("div",K6t,yn(ct.value.admin_clients),1)]),At("div",Y6t,[kr[4]||(kr[4]=At("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Guest Clients",-1)),At("div",X6t,yn(ct.value.guest_clients),1)])])):Ta("",!0),At("div",J6t,[At("div",Q6t,[(Or(),Nr(Es,null,jl(St,It=>At("button",{key:It.id,onClick:rn=>me(It.id),class:ja(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",t.value===It.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[At("div",eTt,[It.icon==="overview"?(Or(),Nr("svg",rTt,kr[5]||(kr[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):It.icon==="clients"?(Or(),Nr("svg",nTt,kr[6]||(kr[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):It.icon==="identities"?(Or(),Nr("svg",iTt,kr[7]||(kr[7]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"},null,-1)]))):Ta("",!0),cl(" "+yn(It.label),1)])],10,tTt)),64))]),At("div",aTt,[u.value&&!r.value?(Or(),Nr("div",oTt,kr[8]||(kr[8]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-muted"},"Loading ACL data...")],-1)]))):T.value?(Or(),Nr("div",sTt,[At("div",lTt,[kr[9]||(kr[9]=At("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load ACL data",-1)),At("div",cTt,yn(T.value),1),At("button",{onClick:Ut,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):t.value==="overview"?(Or(),Nr("div",uTt,[Ce.value.length===0?(Or(),Nr("div",hTt," No identities configured ")):(Or(),Nr("div",dTt,[(Or(!0),Nr(Es,null,jl(Ce.value,It=>(Or(),Nr("div",{key:It.hash,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors"},[At("div",fTt,[At("div",pTt,[At("div",mTt,[At("h3",gTt,yn(It.name),1),At("span",{class:ja(["px-2 py-1 text-xs font-medium rounded",It.type==="repeater"?"bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},yn(It.type),3),At("span",vTt,yn(It.hash),1)]),At("div",yTt,[At("div",null,[kr[10]||(kr[10]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Max Clients",-1)),At("div",_Tt,yn(It.max_clients),1)]),At("div",null,[kr[11]||(kr[11]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Authenticated",-1)),At("div",xTt,yn(It.authenticated_clients),1)]),At("div",null,[kr[12]||(kr[12]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Admin Password",-1)),At("div",{class:ja(It.has_admin_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},yn(It.has_admin_password?"✓ Set":"✗ Not Set"),3)]),At("div",null,[kr[13]||(kr[13]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Guest Password",-1)),At("div",{class:ja(It.has_guest_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},yn(It.has_guest_password?"✓ Set":"✗ Not Set"),3)])]),At("div",bTt,[kr[14]||(kr[14]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"Read-Only Access:",-1)),At("span",{class:ja(It.allow_read_only?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},yn(It.allow_read_only?"Allowed":"Disabled"),3)])])])]))),128))]))])):t.value==="clients"?(Or(),Nr("div",wTt,[K.value.length===0?(Or(),Nr("div",kTt," No authenticated clients ")):(Or(),Nr("div",TTt,[At("table",STt,[kr[15]||(kr[15]=At("thead",null,[At("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Client"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Address"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Identity"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Permissions"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Last Activity"),At("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Actions")])],-1)),At("tbody",null,[(Or(!0),Nr(Es,null,jl(K.value,It=>(Or(),Nr("tr",{key:It.public_key_full,class:"border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors"},[At("td",CTt,[At("div",ATt,yn(It.public_key),1)]),At("td",MTt,[At("div",ETt,yn(It.address),1)]),At("td",LTt,[At("div",PTt,yn(It.identity_name),1),At("div",ITt,yn(It.identity_hash),1)]),At("td",DTt,[At("span",{class:ja(["px-2 py-1 text-xs font-medium rounded",It.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},yn(It.permissions),3)]),At("td",zTt,[At("div",OTt,yn(pe(It.last_activity)),1)]),At("td",BTt,[At("button",{onClick:rn=>ne(It.public_key_full,It.identity_hash),class:"px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,RTt)])]))),128))])])]))])):t.value==="identities"?(Or(),Nr("div",FTt,[At("div",NTt,[kr[17]||(kr[17]=At("label",{class:"block text-content-secondary dark:text-content-muted text-sm mb-2"},"Filter by Identity",-1)),Ml(At("select",{"onUpdate:modelValue":kr[0]||(kr[0]=It=>yt.value=It),class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors"},[kr[16]||(kr[16]=At("option",{value:null},"All Identities",-1)),(Or(!0),Nr(Es,null,jl(Ce.value,It=>(Or(),Nr("option",{key:It.name,value:It.name},yn(It.name)+" ("+yn(It.authenticated_clients)+" clients) ",9,jTt))),128))],512),[[xg,yt.value]])]),we.value.length===0?(Or(),Nr("div",UTt," No clients for selected identity ")):(Or(),Nr("div",$Tt,[(Or(!0),Nr(Es,null,jl(we.value,It=>(Or(),Nr("div",{key:It.public_key_full,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[At("div",HTt,[At("div",VTt,[At("div",WTt,[At("span",{class:ja(["px-2 py-1 text-xs font-medium rounded",It.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},yn(It.permissions),3),At("span",qTt,yn(It.public_key),1)]),At("div",GTt,[At("div",null,[kr[18]||(kr[18]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Address:",-1)),At("span",ZTt,yn(It.address),1)]),At("div",null,[kr[19]||(kr[19]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Identity:",-1)),At("span",KTt,yn(It.identity_name)+" ("+yn(It.identity_hash)+")",1)]),At("div",null,[kr[20]||(kr[20]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Last Activity:",-1)),At("span",YTt,yn(pe(It.last_activity)),1)]),At("div",null,[kr[21]||(kr[21]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Last Login:",-1)),At("span",XTt,yn(pe(It.last_login_success)),1)])])]),At("button",{onClick:rn=>ne(It.public_key_full,It.identity_hash),class:"ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,JTt)])]))),128))]))])):Ta("",!0)])]),At("div",QTt,[At("button",{onClick:Ut,disabled:u.value,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50"},yn(u.value?"Refreshing...":"Refresh Data"),9,tSt)])]))}}),rSt={class:"mb-6"},nSt={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},iSt={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},aSt={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},oSt={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},sSt={class:"flex"},lSt=Cc({__name:"MessageDialog",props:{show:{type:Boolean},message:{},variant:{default:"success"}},emits:["close"],setup(e,{emit:t}){const r=e,u=t,T=ct=>{ct.target===ct.currentTarget&&u("close")},$={success:"bg-green-100 dark:bg-green-500/20 border-green-600/40 dark:border-green-500/30 text-green-600 dark:text-green-400",error:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},K={success:"bg-green-500 hover:bg-green-600",error:"bg-red-500 hover:bg-red-600",info:"bg-blue-500 hover:bg-blue-600"};return(ct,yt)=>r.show?(Or(),Nr("div",{key:0,onClick:T,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:yt[1]||(yt[1]=Od(()=>{},["stop"]))},[At("div",rSt,[At("div",{class:ja(["inline-flex p-3 rounded-xl mb-4",$[r.variant]])},[r.variant==="success"?(Or(),Nr("svg",nSt,yt[2]||(yt[2]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):r.variant==="error"?(Or(),Nr("svg",iSt,yt[3]||(yt[3]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(Or(),Nr("svg",aSt,yt[4]||(yt[4]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),At("p",oSt,yn(r.message),1)]),At("div",sSt,[At("button",{onClick:yt[0]||(yt[0]=St=>u("close")),class:ja(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",K[r.variant]])}," OK ",2)])])])):Ta("",!0)}}),cSt={class:"p-6 space-y-6"},uSt={class:"relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10"},hSt={class:"relative flex items-center justify-between"},dSt={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},fSt={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},pSt={class:"relative flex items-center justify-between"},mSt={class:"text-3xl font-bold text-content-primary dark:text-content-primary mb-1"},gSt={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},vSt={class:"relative flex items-center justify-between"},ySt={class:"text-3xl font-bold text-primary mb-1"},_St={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},xSt={class:"relative flex items-center justify-between"},bSt={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},wSt={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},kSt={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},TSt={key:0,class:"flex items-center justify-center py-12"},SSt={key:1,class:"flex items-center justify-center py-12"},CSt={class:"text-center"},ASt={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},MSt={key:2,class:"space-y-4"},ESt={class:"relative flex items-start justify-between"},LSt={class:"flex-1"},PSt={class:"flex items-center gap-3 mb-4"},ISt={class:"relative"},DSt={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},zSt={class:"text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"},OSt={key:0,class:"text-content-muted dark:text-content-muted text-sm"},BSt={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},RSt={class:"text-content-primary dark:text-content-primary/90 ml-2"},FSt={class:"flex items-center gap-2"},NSt={key:0,class:"text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs"},jSt={key:1,class:"text-content-muted dark:text-content-muted ml-2 text-xs"},USt=["onClick"],$St={class:"text-content-primary dark:text-content-primary/90 ml-2"},HSt={key:0},VSt={class:"text-content-primary dark:text-content-primary/90 ml-2"},WSt={key:0,class:"text-accent-green"},qSt={key:1,class:"text-content-muted dark:text-content-muted"},GSt={key:2,class:"text-primary"},ZSt={key:0,class:"text-xs text-content-muted dark:text-content-muted font-mono"},KSt={class:"ml-4 flex flex-wrap gap-2"},YSt=["onClick","disabled","title"],XSt=["onClick","disabled","title"],JSt=["onClick"],QSt=["onClick"],t8t={key:3,class:"text-center py-12 text-content-secondary dark:text-content-muted"},e8t={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},r8t={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},n8t={class:"space-y-4"},i8t={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},a8t={key:0},o8t={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},s8t={class:"grid grid-cols-2 gap-4"},l8t={class:"grid grid-cols-2 gap-4"},c8t={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},u8t={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},h8t={class:"space-y-4"},d8t=["value"],f8t={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},p8t={key:0},m8t={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},g8t={class:"grid grid-cols-2 gap-4"},v8t={class:"grid grid-cols-2 gap-4"},y8t={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},_8t={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl"},x8t={class:"relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10"},b8t={class:"relative flex items-center justify-between"},w8t={class:"flex items-center gap-4"},k8t={class:"text-content-secondary dark:text-content-muted text-sm flex items-center gap-2"},T8t={class:"text-primary font-semibold"},S8t={class:"flex items-center gap-2"},C8t={class:"bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]"},A8t={class:"flex-1 overflow-y-auto mb-4 space-y-3"},M8t={key:0,class:"flex items-center justify-center py-12"},E8t={key:1,class:"flex items-center justify-center py-12"},L8t={class:"text-center"},P8t={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},I8t={key:2,class:"space-y-3"},D8t={class:"relative flex items-start justify-between gap-3"},z8t={class:"flex-1 min-w-0"},O8t={class:"flex items-center gap-2 mb-3"},B8t={class:"flex items-center gap-2 flex-wrap"},R8t={key:0,class:"text-primary text-sm font-bold"},F8t={key:1,class:"text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20"},N8t={key:2,class:"text-content-muted dark:text-content-muted text-xs"},j8t={class:"text-content-secondary dark:text-content-muted text-xs flex items-center gap-1"},U8t={key:3,class:"text-content-muted dark:text-content-muted/50 text-[10px] font-mono bg-background-mute dark:bg-white/5 px-1.5 py-0.5 rounded"},$8t={class:"text-content-primary dark:text-content-primary/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-gray-50 dark:bg-white/5 p-3 rounded-[10px] border border-stroke-subtle dark:border-white/5"},H8t=["onClick"],V8t={key:0,class:"text-center pt-4"},W8t={key:1,class:"text-center pt-4"},q8t={key:3,class:"flex items-center justify-center h-full"},G8t={class:"relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4"},Z8t={class:"relative space-y-3"},K8t={class:"flex gap-3"},Y8t={class:"flex-1 relative"},X8t=["onKeydown"],J8t=["disabled"],Q8t={key:1,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4"},tCt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col"},eCt={class:"flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10"},rCt={class:"text-content-secondary dark:text-content-primary/70 text-sm mt-1"},nCt={class:"text-primary"},iCt={class:"flex-1 overflow-y-auto space-y-3"},aCt={key:0,class:"text-center py-12"},oCt={class:"space-y-2"},sCt={class:"flex items-center justify-between"},lCt={class:"flex items-center gap-2"},cCt={class:"text-content-primary dark:text-content-primary font-semibold"},uCt={class:"flex items-center gap-2"},hCt={class:"text-content-secondary dark:text-content-muted text-xs"},dCt=["onClick"],fCt={class:"space-y-1 text-xs"},pCt={class:"flex items-center gap-2"},mCt={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded"},gCt={class:"flex items-center gap-2"},vCt={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all"},yCt={class:"flex items-center justify-between text-xs text-content-secondary dark:text-content-muted"},_Ct={class:"flex items-center gap-4"},xCt={key:0},bCt={key:1},wCt={key:0},kCt=Cc({name:"RoomServersView",__name:"RoomServers",setup(e){const t=li(!1),r=li(null),u=li(null),T=li(!1),$=li(!1),K=li(null),ct=li(!1),yt=li(!1),St=li(new Set),Ut=li(!1),ne=li(""),pe=li(!1),me=li({message:"",variant:"success"}),we=li(!1),Ce=li(""),Ve=li(""),kr=li([]),It=li(!1),rn=li(null),Lr=li(""),Mr=li(B1("roomServers_messagesLimit",50)),tn=li(0),Dn=li(!0);Fh(Mr,xa=>R1("roomServers_messagesLimit",xa));const Mn=li([]),Br=li(!1),Vn=li({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});Xd(async()=>{await on()});async function on(){t.value=!0,r.value=null;try{const xa=await bs.getIdentities();xa.success?u.value=xa.data:r.value=xa.error||"Failed to load identities"}catch(xa){r.value=xa instanceof Error?xa.message:"Failed to load identities"}finally{t.value=!1}}async function pr(){try{const xa=await bs.createIdentity(Vn.value);xa.success?(T.value=!1,_i(),await on(),nn(xa.message||"Identity created successfully!","success")):nn(`Failed to create identity: ${xa.error}`,"error")}catch(xa){nn(`Error creating identity: ${xa}`,"error")}}async function _r(){try{const xa=await bs.updateIdentity(K.value);xa.success?($.value=!1,K.value=null,await on(),nn(xa.message||"Identity updated successfully!","success")):nn(`Failed to update identity: ${xa.error}`,"error")}catch(xa){nn(`Error updating identity: ${xa}`,"error")}}function Sr(xa){ne.value=xa,Ut.value=!0}async function Dr(){const xa=ne.value;Ut.value=!1;try{const Ur=await bs.deleteIdentity(xa);Ur.success?(await on(),nn(Ur.message||"Identity deleted successfully!","success")):nn(`Failed to delete identity: ${Ur.error}`,"error")}catch(Ur){nn(`Error deleting identity: ${Ur}`,"error")}finally{ne.value=""}}function nn(xa,Ur){me.value={message:xa,variant:Ur},pe.value=!0}async function Cn(xa){try{const Ur=await bs.sendRoomServerAdvert(xa);Ur.success?nn(Ur.message||`Advert sent for '${xa}'!`,"success"):nn(`Failed to send advert: ${Ur.error}`,"error")}catch(Ur){nn(`Error sending advert: ${Ur}`,"error")}}function Xn(xa){K.value=JSON.parse(JSON.stringify(xa)),K.value.settings||(K.value.settings={}),K.value.settings.admin_password||(K.value.settings.admin_password=""),K.value.settings.guest_password||(K.value.settings.guest_password=""),yt.value=!1,$.value=!0}function _i(){Vn.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},ct.value=!1}function ta(){T.value=!1,$.value=!1,K.value=null,ct.value=!1,yt.value=!1,_i()}function va(xa){St.value.has(xa)?St.value.delete(xa):St.value.add(xa)}async function _a(xa){Ce.value=xa,we.value=!0,tn.value=0,Dn.value=!0;const Ur=u.value?.configured.find(Sn=>Sn.name===xa);Ve.value=Ur?.hash||"",await qi(),await Bi(!0)}async function qi(){try{console.log("Fetching ACL clients for room:",Ce.value,"hash:",Ve.value);const xa=await bs.getACLClients({identity_hash:Ve.value,identity_name:Ce.value});console.log("ACL clients response:",xa),xa.success&&xa.data&&(Mn.value=xa.data.clients||[],console.log("ACL clients loaded:",Mn.value.length))}catch(xa){console.error("Failed to fetch ACL clients:",xa)}}async function Bi(xa=!1){xa&&(tn.value=0,kr.value=[]),It.value=!0,rn.value=null;try{const Ur=await bs.getRoomMessages({room_name:Ce.value,limit:Mr.value,offset:tn.value});if(Ur.success&&Ur.data){const Sn=Ur.data.messages||[];xa?kr.value=Sn:kr.value=[...kr.value,...Sn],Dn.value=Sn.length===Mr.value}else rn.value=Ur.error||"Failed to load messages"}catch(Ur){rn.value=Ur instanceof Error?Ur.message:"Failed to load messages"}finally{It.value=!1}}async function Xi(){tn.value+=Mr.value,await Bi(!1)}async function Yn(){if(Lr.value.trim())try{const xa=await bs.postRoomMessage({room_name:Ce.value,message:Lr.value,author_pubkey:"server"});xa.success?(Lr.value="",await Bi(!0)):nn(`Failed to send message: ${xa.error}`,"error")}catch(xa){nn(`Error sending message: ${xa}`,"error")}}async function hi(xa){if(confirm("Are you sure you want to delete this message?"))try{const Ur=await bs.deleteRoomMessage({room_name:Ce.value,message_id:xa});Ur.success?(await Bi(!0),nn("Message deleted successfully","success")):nn(`Failed to delete message: ${Ur.error}`,"error")}catch(Ur){nn(`Error deleting message: ${Ur}`,"error")}}function na(){we.value=!1,Ce.value="",Ve.value="",kr.value=[],Lr.value="",rn.value=null,Mn.value=[]}function Xa(xa){return xa?new Date(xa*1e3).toLocaleString():"Unknown"}async function oo(xa,Ur){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const Sn=await bs.removeACLClient({public_key:xa,identity_hash:Ur});Sn.success?(await qi(),nn("Client removed successfully","success")):nn(`Failed to remove client: ${Sn.error}`,"error")}catch(Sn){nn(`Error removing client: ${Sn}`,"error")}}return(xa,Ur)=>(Or(),Nr(Es,null,[At("div",cSt,[At("div",uSt,[Ur[26]||(Ur[26]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),Ur[27]||(Ur[27]=At("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),At("div",hSt,[Ur[25]||(Ur[25]=Du('

Room Servers

Manage room server identities and messages

',1)),At("button",{onClick:Ur[0]||(Ur[0]=Sn=>T.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},Ur[24]||(Ur[24]=[At("span",{class:"flex items-center gap-2"},[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})]),cl(" Add Room Server ")],-1)]))])]),u.value&&u.value.total_configured>0?(Or(),Nr("div",dSt,[At("div",fSt,[Ur[30]||(Ur[30]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",pSt,[At("div",null,[Ur[28]||(Ur[28]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),At("div",mSt,yn(u.value.total_configured),1)]),Ur[29]||(Ur[29]=At("div",{class:"bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors"},[At("svg",{class:"w-6 h-6 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),At("div",gSt,[Ur[33]||(Ur[33]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",vSt,[At("div",null,[Ur[31]||(Ur[31]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),At("div",ySt,yn(u.value.total_registered),1)]),Ur[32]||(Ur[32]=At("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[At("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),At("div",_St,[Ur[37]||(Ur[37]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",xSt,[At("div",null,[Ur[34]||(Ur[34]=At("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),At("div",{class:ja(["text-3xl font-bold",u.value.total_registered===u.value.total_configured?"text-accent-green":"text-accent-yellow"])},yn(u.value.total_registered===u.value.total_configured?"Synced":"Out of Sync"),3)]),At("div",{class:ja(["p-3 rounded-[12px] transition-colors",u.value.total_registered===u.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[u.value.total_registered===u.value.total_configured?(Or(),Nr("svg",bSt,Ur[35]||(Ur[35]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(Or(),Nr("svg",wSt,Ur[36]||(Ur[36]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):Ta("",!0),At("div",kSt,[t.value?(Or(),Nr("div",TSt,Ur[38]||(Ur[38]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading room servers...")],-1)]))):r.value?(Or(),Nr("div",SSt,[At("div",CSt,[Ur[39]||(Ur[39]=At("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load room servers",-1)),At("div",ASt,yn(r.value),1),At("button",{onClick:on,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):u.value&&u.value.configured.length>0?(Or(),Nr("div",MSt,[(Or(!0),Nr(Es,null,jl(u.value.configured,Sn=>(Or(),Nr("div",{key:Sn.name,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[Ur[46]||(Ur[46]=At("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",ESt,[At("div",LSt,[At("div",PSt,[At("div",ISt,[Sn.registered?(Or(),Nr("div",DSt)):Ta("",!0),At("div",{class:ja(["relative w-3 h-3 rounded-full",Sn.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),At("h3",zSt,yn(Sn.name),1),At("span",{class:ja(["px-3 py-1 text-xs font-semibold rounded-full",Sn.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},yn(Sn.registered?"● Active":"○ Inactive"),3),Sn.hash?(Or(),Nr("span",OSt,yn(Sn.hash),1)):Ta("",!0)]),At("div",BSt,[At("div",null,[Ur[40]||(Ur[40]=At("span",{class:"text-content-muted dark:text-content-muted"},"Node Name:",-1)),At("span",RSt,yn(Sn.settings?.node_name||"Not set"),1)]),At("div",FSt,[Ur[41]||(Ur[41]=At("span",{class:"text-content-muted dark:text-content-muted"},"Identity Key:",-1)),St.value.has(Sn.name)?(Or(),Nr("span",NSt,yn(Sn.identity_key),1)):(Or(),Nr("span",jSt," •••••••••••••••• ")),At("button",{onClick:Hn=>va(Sn.name),class:"text-primary/70 hover:text-primary text-xs underline"},yn(St.value.has(Sn.name)?"Hide":"Show"),9,USt)]),At("div",null,[Ur[42]||(Ur[42]=At("span",{class:"text-content-muted dark:text-content-muted"},"Location:",-1)),At("span",$St,yn(Sn.settings?.latitude||0)+", "+yn(Sn.settings?.longitude||0),1)]),Sn.settings?.admin_password||Sn.settings?.guest_password?(Or(),Nr("div",HSt,[Ur[43]||(Ur[43]=At("span",{class:"text-content-muted dark:text-content-muted"},"Passwords:",-1)),At("span",VSt,[Sn.settings?.admin_password?(Or(),Nr("span",WSt,"Admin")):Ta("",!0),Sn.settings?.admin_password&&Sn.settings?.guest_password?(Or(),Nr("span",qSt," / ")):Ta("",!0),Sn.settings?.guest_password?(Or(),Nr("span",GSt,"Guest")):Ta("",!0)])])):Ta("",!0)]),Sn.address?(Or(),Nr("div",ZSt," Address: "+yn(Sn.address),1)):Ta("",!0)]),At("div",KSt,[At("button",{onClick:Hn=>_a(Sn.name),disabled:!Sn.registered,class:ja(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Sn.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:Sn.registered?"Manage messages for this room":"Room server must be active to manage messages"},Ur[44]||(Ur[44]=[At("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),cl(" Messages ",-1)]),10,YSt),At("button",{onClick:Hn=>Cn(Sn.name),disabled:!Sn.registered,class:ja(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Sn.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:Sn.registered?"Send advert for this room server":"Room server must be active to send advert"},Ur[45]||(Ur[45]=[At("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),cl(" Send Advert ",-1)]),10,XSt),At("button",{onClick:Hn=>Xn(Sn),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,JSt),At("button",{onClick:Hn=>Sr(Sn.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,QSt)])])]))),128))])):(Or(),Nr("div",t8t,[Ur[47]||(Ur[47]=At("svg",{class:"w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),Ur[48]||(Ur[48]=At("p",{class:"text-lg mb-2"},"No room servers configured",-1)),Ur[49]||(Ur[49]=At("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),At("button",{onClick:Ur[1]||(Ur[1]=Sn=>T.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),T.value?(Or(),Nr("div",e8t,[At("div",r8t,[Ur[60]||(Ur[60]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Add Room Server",-1)),At("div",n8t,[At("div",null,[Ur[50]||(Ur[50]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Name *",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[2]||(Ur[2]=Sn=>Vn.value.name=Sn),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.name]])]),At("div",null,[At("label",i8t,[Ur[51]||(Ur[51]=cl(" Identity Key (Optional) ",-1)),At("button",{onClick:Ur[3]||(Ur[3]=Sn=>ct.value=!ct.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},yn(ct.value?"Hide":"Show/Edit"),1)]),ct.value?(Or(),Nr("div",a8t,[Ml(At("input",{"onUpdate:modelValue":Ur[4]||(Ur[4]=Sn=>Vn.value.identity_key=Sn),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.identity_key]]),Ur[52]||(Ur[52]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(Or(),Nr("div",o8t," Will be auto-generated if not provided "))]),At("div",null,[Ur[53]||(Ur[53]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[5]||(Ur[5]=Sn=>Vn.value.settings.node_name=Sn),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.node_name]])]),At("div",s8t,[At("div",null,[Ur[54]||(Ur[54]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[6]||(Ur[6]=Sn=>Vn.value.settings.latitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.latitude,void 0,{number:!0}]])]),At("div",null,[Ur[55]||(Ur[55]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[7]||(Ur[7]=Sn=>Vn.value.settings.longitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.longitude,void 0,{number:!0}]])])]),At("div",l8t,[At("div",null,[Ur[56]||(Ur[56]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password (Optional)",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[8]||(Ur[8]=Sn=>Vn.value.settings.admin_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.admin_password]]),Ur[57]||(Ur[57]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),At("div",null,[Ur[58]||(Ur[58]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password (Optional)",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[9]||(Ur[9]=Sn=>Vn.value.settings.guest_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,Vn.value.settings.guest_password]]),Ur[59]||(Ur[59]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),At("div",{class:"flex justify-end gap-3 mt-6"},[At("button",{onClick:ta,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{onClick:pr,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):Ta("",!0),$.value&&K.value?(Or(),Nr("div",c8t,[At("div",u8t,[Ur[72]||(Ur[72]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Edit Room Server",-1)),At("div",h8t,[At("div",null,[Ur[61]||(Ur[61]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Current Name",-1)),At("input",{value:K.value.name,disabled:"",type:"text",class:"w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed"},null,8,d8t)]),At("div",null,[Ur[62]||(Ur[62]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"New Name (optional)",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[10]||(Ur[10]=Sn=>K.value.new_name=Sn),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.new_name]])]),At("div",null,[At("label",f8t,[Ur[63]||(Ur[63]=cl(" Identity Key (Optional) ",-1)),At("button",{onClick:Ur[11]||(Ur[11]=Sn=>yt.value=!yt.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},yn(yt.value?"Hide":"Show/Edit"),1)]),yt.value?(Or(),Nr("div",p8t,[Ml(At("input",{"onUpdate:modelValue":Ur[12]||(Ur[12]=Sn=>K.value.identity_key=Sn),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.identity_key]]),Ur[64]||(Ur[64]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(Or(),Nr("div",m8t,' Click "Show/Edit" to change the identity key '))]),At("div",null,[Ur[65]||(Ur[65]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[13]||(Ur[13]=Sn=>K.value.settings.node_name=Sn),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.node_name]])]),At("div",g8t,[At("div",null,[Ur[66]||(Ur[66]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[14]||(Ur[14]=Sn=>K.value.settings.latitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.latitude,void 0,{number:!0}]])]),At("div",null,[Ur[67]||(Ur[67]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[15]||(Ur[15]=Sn=>K.value.settings.longitude=Sn),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.longitude,void 0,{number:!0}]])])]),At("div",v8t,[At("div",null,[Ur[68]||(Ur[68]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[16]||(Ur[16]=Sn=>K.value.settings.admin_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.admin_password]]),Ur[69]||(Ur[69]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),At("div",null,[Ur[70]||(Ur[70]=At("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password",-1)),Ml(At("input",{"onUpdate:modelValue":Ur[17]||(Ur[17]=Sn=>K.value.settings.guest_password=Sn),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[lu,K.value.settings.guest_password]]),Ur[71]||(Ur[71]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),At("div",{class:"flex justify-end gap-3 mt-6"},[At("button",{onClick:ta,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),At("button",{onClick:_r,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):Ta("",!0)]),Vs(qH,{show:Ut.value,title:"Delete Room Server",message:`Are you sure you want to delete '${ne.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:Ur[18]||(Ur[18]=Sn=>Ut.value=!1),onConfirm:Dr},null,8,["show","message"]),Vs(lSt,{show:pe.value,message:me.value.message,variant:me.value.variant,onClose:Ur[19]||(Ur[19]=Sn=>pe.value=!1)},null,8,["show","message","variant"]),we.value?(Or(),Nr("div",y8t,[At("div",_8t,[At("div",x8t,[Ur[79]||(Ur[79]=At("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),Ur[80]||(Ur[80]=At("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),At("div",b8t,[At("div",w8t,[Ur[75]||(Ur[75]=Du('
',1)),At("div",null,[Ur[74]||(Ur[74]=At("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Room Messages",-1)),At("p",k8t,[Ur[73]||(Ur[73]=At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),At("span",T8t,yn(Ce.value),1)])])]),At("div",S8t,[At("button",{onClick:Ur[20]||(Ur[20]=Sn=>Br.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[Ur[76]||(Ur[76]=At("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),Ur[77]||(Ur[77]=At("span",{class:"hidden sm:inline"},"Sessions",-1)),At("span",C8t,yn(Mn.value.length),1)]),At("button",{onClick:na,class:"p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all"},Ur[78]||(Ur[78]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])]),At("div",A8t,[It.value&&kr.value.length===0?(Or(),Nr("div",M8t,Ur[81]||(Ur[81]=[At("div",{class:"text-center"},[At("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),At("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading messages...")],-1)]))):rn.value?(Or(),Nr("div",E8t,[At("div",L8t,[Ur[82]||(Ur[82]=At("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load messages",-1)),At("div",P8t,yn(rn.value),1),At("button",{onClick:Ur[21]||(Ur[21]=Sn=>Bi(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):kr.value.length>0?(Or(),Nr("div",I8t,[(Or(!0),Nr(Es,null,jl(kr.value,(Sn,Hn)=>(Or(),Nr("div",{key:Sn.id||Hn,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[Ur[87]||(Ur[87]=At("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),At("div",D8t,[At("div",z8t,[At("div",O8t,[At("div",B8t,[Ur[84]||(Ur[84]=At("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[At("svg",{class:"w-3 h-3 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),Sn.author_name?(Or(),Nr("span",R8t,yn(Sn.author_name),1)):Ta("",!0),Sn.author_pubkey?(Or(),Nr("span",F8t,yn(Sn.author_pubkey.substring(0,8))+"... ",1)):(Or(),Nr("span",N8t," Anonymous ")),Ur[85]||(Ur[85]=At("span",{class:"text-content-muted dark:text-content-muted/60 text-xs"},"•",-1)),At("span",j8t,[Ur[83]||(Ur[83]=At("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),cl(" "+yn(Xa(Sn.timestamp)),1)]),Sn.id?(Or(),Nr("span",U8t," #"+yn(Sn.id),1)):Ta("",!0)])]),At("div",$8t,yn(Sn.message_text),1)]),At("button",{onClick:to=>hi(Sn.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},Ur[86]||(Ur[86]=[At("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,H8t)])]))),128)),Dn.value&&!It.value?(Or(),Nr("div",V8t,[At("button",{onClick:Xi,class:"group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto"},Ur[88]||(Ur[88]=[At("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),cl(" Load More Messages ",-1)]))])):It.value?(Or(),Nr("div",W8t,Ur[89]||(Ur[89]=[At("div",{class:"flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm"},[At("div",{class:"animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full"}),cl(" Loading... ")],-1)]))):Ta("",!0)])):(Or(),Nr("div",q8t,Ur[90]||(Ur[90]=[Du('

No messages yet

Be the first to start the conversation

',1)])))]),At("div",G8t,[Ur[93]||(Ur[93]=At("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),At("div",Z8t,[At("div",K8t,[At("div",Y8t,[Ml(At("textarea",{"onUpdate:modelValue":Ur[22]||(Ur[22]=Sn=>Lr.value=Sn),onKeydown:[Sx(Od(Yn,["ctrl"]),["enter"]),Sx(Od(Yn,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none"},null,40,X8t),[[lu,Lr.value]])]),At("button",{onClick:Yn,disabled:!Lr.value.trim(),class:ja(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",Lr.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"])},Ur[91]||(Ur[91]=[At("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),At("span",{class:"hidden sm:inline"},"Send",-1)]),10,J8t)]),Ur[92]||(Ur[92]=At("p",{class:"text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2"},[At("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),cl(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):Ta("",!0),Br.value?(Or(),Nr("div",Q8t,[At("div",tCt,[At("div",eCt,[At("div",null,[Ur[95]||(Ur[95]=At("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Active Sessions",-1)),At("p",rCt,[Ur[94]||(Ur[94]=cl("Room: ",-1)),At("span",nCt,yn(Ce.value),1)])]),At("button",{onClick:Ur[23]||(Ur[23]=Sn=>Br.value=!1),class:"text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors"},Ur[96]||(Ur[96]=[At("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),At("div",iCt,[Mn.value.length===0?(Or(),Nr("div",aCt,Ur[97]||(Ur[97]=[At("div",{class:"text-content-secondary dark:text-content-muted"},"No active sessions found",-1)]))):Ta("",!0),(Or(!0),Nr(Es,null,jl(Mn.value,(Sn,Hn)=>(Or(),Nr("div",{key:Sn.public_key_full||Hn,class:"glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[At("div",oCt,[At("div",sCt,[At("div",lCt,[At("span",cCt,yn(Sn.identity_name||"Unknown"),1),At("span",{class:ja(["px-2 py-0.5 text-xs font-medium rounded",Sn.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},yn(Sn.permissions),3)]),At("div",uCt,[At("span",hCt,yn(Sn.identity_type),1),At("button",{onClick:to=>oo(Sn.public_key_full,Sn.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,dCt)])]),At("div",fCt,[At("div",pCt,[Ur[98]||(Ur[98]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Short Key:",-1)),At("code",mCt,yn(Sn.public_key),1)]),At("div",gCt,[Ur[99]||(Ur[99]=At("span",{class:"text-content-secondary dark:text-content-muted"},"Full Key:",-1)),At("code",vCt,yn(Sn.public_key_full),1)])]),At("div",yCt,[At("div",_Ct,[Sn.address?(Or(),Nr("span",xCt,"📍 "+yn(Sn.address),1)):Ta("",!0),Sn.last_login_success?(Or(),Nr("span",bCt,"Last Login: "+yn(new Date(Sn.last_login_success*1e3).toLocaleString()),1)):Ta("",!0)]),Sn.last_activity?(Or(),Nr("span",wCt,"Active: "+yn(Math.floor((Date.now()/1e3-Sn.last_activity)/60))+"m ago",1)):Ta("",!0)])])]))),128))])])])):Ta("",!0)],64))}}),TCt={class:"space-y-6"},SCt={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},CCt={class:"flex items-center justify-between mb-4"},ACt=["disabled"],MCt={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},ECt={class:"flex flex-wrap gap-2"},LCt=["onClick"],PCt={key:0,class:"w-px h-6 bg-stroke-subtle dark:bg-stroke/20 mx-2 self-center"},ICt=["onClick"],DCt={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden"},zCt={key:0,class:"p-8 text-center"},OCt={key:1,class:"p-8 text-center"},BCt={class:"text-content-secondary dark:text-content-muted mb-4"},RCt={key:2,class:"max-h-[600px] overflow-y-auto"},FCt={key:0,class:"p-8 text-center"},NCt={key:1,class:"divide-y divide-gray-200 dark:divide-white/5"},jCt={class:"flex-shrink-0 text-content-secondary dark:text-content-muted"},UCt={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-600 dark:text-blue-400"},$Ct={class:"text-content-primary dark:text-content-primary flex-1 break-all"},HCt=Cc({name:"LogsView",__name:"Logs",setup(e){const t=li([]),r=li(new Set),u=li(new Set(["DEBUG","INFO","WARNING","ERROR"])),T=li(new Set),$=li(new Set),K=li(!0),ct=li(null);let yt=null;const St=on=>{const pr=on.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return pr?pr[1].trim():"Unknown"},Ut=on=>{const pr=on.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return pr?pr[1]:on},ne=(on,pr)=>{if(on.size!==pr.size)return!1;for(const _r of on)if(!pr.has(_r))return!1;return!0},pe=async()=>{try{const on=await bs.getLogs();if(on.logs&&on.logs.length>0){t.value=on.logs;const pr=new Set;t.value.forEach(nn=>{const Cn=St(nn.message);pr.add(Cn)});const _r=new Set;t.value.forEach(nn=>{_r.add(nn.level)}),r.value.size===0&&(r.value=new Set(pr));const Sr=!ne(T.value,pr),Dr=!ne($.value,_r);Sr&&(T.value=pr),Dr&&($.value=_r),ct.value=null}}catch(on){console.error("Error loading logs:",on),ct.value=on instanceof Error?on.message:"Failed to load logs"}finally{K.value=!1}},me=Ao(()=>t.value.filter(pr=>{const _r=St(pr.message),Sr=r.value.has(_r),Dr=u.value.has(pr.level);return Sr&&Dr})),we=Ao(()=>Array.from(T.value).sort()),Ce=Ao(()=>{const on=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from($.value).sort((_r,Sr)=>{const Dr=on.indexOf(_r),nn=on.indexOf(Sr);return Dr!==-1&&nn!==-1?Dr-nn:_r.localeCompare(Sr)})}),Ve=on=>{u.value.has(on)?u.value.delete(on):u.value.add(on),u.value=new Set(u.value)},kr=on=>new Date(on).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),It=on=>({ERROR:"text-red-600 dark:text-red-400 bg-red-900/20",WARNING:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",INFO:"text-blue-600 dark:text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[on]||"text-gray-400 bg-gray-900/20",rn=(on,pr)=>pr?{ERROR:"bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400 border-red-500/50",WARNING:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[on]||"bg-primary/20 text-primary border-primary/50":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-white/60 border-stroke-subtle dark:border-white/20 hover:bg-stroke-subtle dark:hover:bg-white/10",Lr=on=>{r.value.has(on)?r.value.delete(on):r.value.add(on),r.value=new Set(r.value)},Mr=()=>{r.value=new Set(T.value)},tn=()=>{r.value=new Set},Dn=()=>{u.value=new Set($.value)},Mn=()=>{u.value=new Set},Br=()=>{yt&&clearInterval(yt),yt=setInterval(pe,5e3)},Vn=()=>{yt&&(clearInterval(yt),yt=null)};return Xd(()=>{pe(),Br()}),Tg(()=>{Vn()}),(on,pr)=>(Or(),Nr("div",TCt,[At("div",SCt,[At("div",CCt,[pr[1]||(pr[1]=At("div",null,[At("h1",{class:"text-content-primary dark:text-content-primary text-2xl font-semibold mb-2"},"System Logs"),At("p",{class:"text-content-secondary dark:text-content-muted"},"Real-time system events and diagnostics")],-1)),At("button",{onClick:pe,disabled:K.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(Or(),Nr("svg",{class:ja(["w-4 h-4",{"animate-spin":K.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},pr[0]||(pr[0]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),cl(" "+yn(K.value?"Loading...":"Refresh"),1)],8,ACt)]),At("div",MCt,[At("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[pr[2]||(pr[2]=At("span",{class:"text-content-primary dark:text-content-primary font-medium"},"Filters:",-1)),At("button",{onClick:Mr,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),At("button",{onClick:tn,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),pr[3]||(pr[3]=At("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),At("button",{onClick:Dn,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),At("button",{onClick:Mn,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),At("div",ECt,[(Or(!0),Nr(Es,null,jl(we.value,_r=>(Or(),Nr("button",{key:"logger-"+_r,onClick:Sr=>Lr(_r),class:ja(["px-3 py-1 text-xs border rounded-full transition-colors",r.value.has(_r)?"bg-primary/20 text-primary border-primary/50":"bg-background-mute dark:bg-white/5 text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/10"])},yn(_r),11,LCt))),128)),we.value.length>0&&Ce.value.length>0?(Or(),Nr("div",PCt)):Ta("",!0),(Or(!0),Nr(Es,null,jl(Ce.value,_r=>(Or(),Nr("button",{key:"level-"+_r,onClick:Sr=>Ve(_r),class:ja(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",u.value.has(_r)?rn(_r,!0):rn(_r,!1)])},yn(_r),11,ICt))),128))])])]),At("div",DCt,[K.value&&t.value.length===0?(Or(),Nr("div",zCt,pr[4]||(pr[4]=[At("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),At("p",{class:"text-content-secondary dark:text-content-muted"},"Loading system logs...",-1)]))):ct.value?(Or(),Nr("div",OCt,[pr[5]||(pr[5]=At("div",{class:"text-red-600 dark:text-red-400 mb-4"},[At("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),pr[6]||(pr[6]=At("h3",{class:"text-content-primary dark:text-content-primary text-lg font-medium mb-2"},"Error Loading Logs",-1)),At("p",BCt,yn(ct.value),1),At("button",{onClick:pe,class:"px-4 py-2 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(Or(),Nr("div",RCt,[me.value.length===0?(Or(),Nr("div",FCt,pr[7]||(pr[7]=[Du('

No Logs to Display

No logs match the current filter criteria.

',3)]))):(Or(),Nr("div",NCt,[(Or(!0),Nr(Es,null,jl(me.value,(_r,Sr)=>(Or(),Nr("div",{key:Sr,class:"flex items-start gap-4 p-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors font-mono text-sm"},[At("span",jCt," ["+yn(kr(_r.timestamp))+"] ",1),At("span",UCt,yn(St(_r.message)),1),At("span",{class:ja(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",It(_r.level)])},yn(_r.level),3),At("span",$Ct,yn(Ut(_r.message)),1)]))),128))]))]))])]))}});/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -3989,21 +3989,21 @@ maplibre-gl/dist/maplibre-gl.js: * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var GH=Object.defineProperty,HCt=Object.getOwnPropertyDescriptor,VCt=(e,t)=>{for(var r in t)GH(e,r,{get:t[r],enumerable:!0})},Vf=(e,t,r,u)=>{for(var T=u>1?void 0:u?HCt(t,r):t,$=e.length-1,K;$>=0;$--)(K=e[$])&&(T=(u?K(t,r,T):K(T))||T);return u&&T&&GH(t,r,T),T},fl=(e,t)=>(r,u)=>t(r,u,e),LF="Terminal input",v9={get:()=>LF,set:e=>LF=e},PF="Too much output to announce, navigate to rows manually to read",y9={get:()=>PF,set:e=>PF=e};function WCt(e){return e.replace(/\r?\n/g,"\r")}function qCt(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function GCt(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function ZCt(e,t,r,u){if(e.stopPropagation(),e.clipboardData){let T=e.clipboardData.getData("text/plain");ZH(T,t,r,u)}}function ZH(e,t,r,u){e=WCt(e),e=qCt(e,r.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function KH(e,t,r){let u=r.getBoundingClientRect(),T=e.clientX-u.left-10,$=e.clientY-u.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${T}px`,t.style.top=`${$}px`,t.style.zIndex="1000",t.focus()}function IF(e,t,r,u,T){KH(e,t,r),T&&u.rightClickSelect(e),t.value=u.selectionText,t.select()}function a_(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function YS(e,t=0,r=e.length){let u="";for(let T=t;T65535?($-=65536,u+=String.fromCharCode(($>>10)+55296)+String.fromCharCode($%1024+56320)):u+=String.fromCharCode($)}return u}var KCt=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,r){let u=t.length;if(!u)return 0;let T=0,$=0;if(this._interim){let K=t.charCodeAt($++);56320<=K&&K<=57343?r[T++]=(this._interim-55296)*1024+K-56320+65536:(r[T++]=this._interim,r[T++]=K),this._interim=0}for(let K=$;K=u)return this._interim=ct,T;let yt=t.charCodeAt(K);56320<=yt&&yt<=57343?r[T++]=(ct-55296)*1024+yt-56320+65536:(r[T++]=ct,r[T++]=yt);continue}ct!==65279&&(r[T++]=ct)}return T}},YCt=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,r){let u=t.length;if(!u)return 0;let T=0,$,K,ct,yt,St=0,Ut=0;if(this.interim[0]){let me=!1,we=this.interim[0];we&=(we&224)===192?31:(we&240)===224?15:7;let Ce=0,Ve;for(;(Ve=this.interim[++Ce]&63)&&Ce<4;)we<<=6,we|=Ve;let kr=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,It=kr-Ce;for(;Ut=u)return 0;if(Ve=t[Ut++],(Ve&192)!==128){Ut--,me=!0;break}else this.interim[Ce++]=Ve,we<<=6,we|=Ve&63}me||(kr===2?we<128?Ut--:r[T++]=we:kr===3?we<2048||we>=55296&&we<=57343||we===65279||(r[T++]=we):we<65536||we>1114111||(r[T++]=we)),this.interim.fill(0)}let ne=u-4,pe=Ut;for(;pe=u)return this.interim[0]=$,T;if(K=t[pe++],(K&192)!==128){pe--;continue}if(St=($&31)<<6|K&63,St<128){pe--;continue}r[T++]=St}else if(($&240)===224){if(pe>=u)return this.interim[0]=$,T;if(K=t[pe++],(K&192)!==128){pe--;continue}if(pe>=u)return this.interim[0]=$,this.interim[1]=K,T;if(ct=t[pe++],(ct&192)!==128){pe--;continue}if(St=($&15)<<12|(K&63)<<6|ct&63,St<2048||St>=55296&&St<=57343||St===65279)continue;r[T++]=St}else if(($&248)===240){if(pe>=u)return this.interim[0]=$,T;if(K=t[pe++],(K&192)!==128){pe--;continue}if(pe>=u)return this.interim[0]=$,this.interim[1]=K,T;if(ct=t[pe++],(ct&192)!==128){pe--;continue}if(pe>=u)return this.interim[0]=$,this.interim[1]=K,this.interim[2]=ct,T;if(yt=t[pe++],(yt&192)!==128){pe--;continue}if(St=($&7)<<18|(K&63)<<12|(ct&63)<<6|yt&63,St<65536||St>1114111)continue;r[T++]=St}}return T}},YH="",h_=" ",p4=class XH{constructor(){this.fg=0,this.bg=0,this.extended=new sS}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new XH;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},sS=class JH{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new JH(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},bg=class QH extends p4{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new sS,this.combinedData=""}static fromCharData(t){let r=new QH;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?a_(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let u=t[1].charCodeAt(0);if(55296<=u&&u<=56319){let T=t[1].charCodeAt(1);56320<=T&&T<=57343?this.content=(u-55296)*1024+T-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},DF="di$target",_9="di$dependencies",eM=new Map;function XCt(e){return e[_9]||[]}function s0(e){if(eM.has(e))return eM.get(e);let t=function(r,u,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");JCt(t,r,T)};return t._id=e,eM.set(e,t),t}function JCt(e,t,r){t[DF]===t?t[_9].push({id:e,index:r}):(t[_9]=[{id:e,index:r}],t[DF]=t)}var om=s0("BufferService"),tV=s0("CoreMouseService"),Kx=s0("CoreService"),QCt=s0("CharsetService"),pL=s0("InstantiationService"),eV=s0("LogService"),sm=s0("OptionsService"),rV=s0("OscLinkService"),tAt=s0("UnicodeService"),m4=s0("DecorationService"),x9=class{constructor(t,r,u){this._bufferService=t,this._optionsService=r,this._oscLinkService=u}provideLinks(t,r){let u=this._bufferService.buffer.lines.get(t-1);if(!u){r(void 0);return}let T=[],$=this._optionsService.rawOptions.linkHandler,K=new bg,ct=u.getTrimmedLength(),yt=-1,St=-1,Ut=!1;for(let ne=0;ne$?$.activate(Ce,Ve,me):eAt(Ce,Ve),hover:(Ce,Ve)=>$?.hover?.(Ce,Ve,me),leave:(Ce,Ve)=>$?.leave?.(Ce,Ve,me)})}Ut=!1,K.hasExtendedAttrs()&&K.extended.urlId?(St=ne,yt=K.extended.urlId):(St=-1,yt=-1)}}r(T)}};x9=Vf([fl(0,om),fl(1,sm),fl(2,rV)],x9);function eAt(e,t){if(confirm(`Do you want to navigate to ${t}? + */var GH=Object.defineProperty,VCt=Object.getOwnPropertyDescriptor,WCt=(e,t)=>{for(var r in t)GH(e,r,{get:t[r],enumerable:!0})},Vf=(e,t,r,u)=>{for(var T=u>1?void 0:u?VCt(t,r):t,$=e.length-1,K;$>=0;$--)(K=e[$])&&(T=(u?K(t,r,T):K(T))||T);return u&&T&&GH(t,r,T),T},fl=(e,t)=>(r,u)=>t(r,u,e),LF="Terminal input",v9={get:()=>LF,set:e=>LF=e},PF="Too much output to announce, navigate to rows manually to read",y9={get:()=>PF,set:e=>PF=e};function qCt(e){return e.replace(/\r?\n/g,"\r")}function GCt(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function ZCt(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function KCt(e,t,r,u){if(e.stopPropagation(),e.clipboardData){let T=e.clipboardData.getData("text/plain");ZH(T,t,r,u)}}function ZH(e,t,r,u){e=qCt(e),e=GCt(e,r.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function KH(e,t,r){let u=r.getBoundingClientRect(),T=e.clientX-u.left-10,$=e.clientY-u.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${T}px`,t.style.top=`${$}px`,t.style.zIndex="1000",t.focus()}function IF(e,t,r,u,T){KH(e,t,r),T&&u.rightClickSelect(e),t.value=u.selectionText,t.select()}function a_(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function YS(e,t=0,r=e.length){let u="";for(let T=t;T65535?($-=65536,u+=String.fromCharCode(($>>10)+55296)+String.fromCharCode($%1024+56320)):u+=String.fromCharCode($)}return u}var YCt=class{constructor(){this._interim=0}clear(){this._interim=0}decode(t,r){let u=t.length;if(!u)return 0;let T=0,$=0;if(this._interim){let K=t.charCodeAt($++);56320<=K&&K<=57343?r[T++]=(this._interim-55296)*1024+K-56320+65536:(r[T++]=this._interim,r[T++]=K),this._interim=0}for(let K=$;K=u)return this._interim=ct,T;let yt=t.charCodeAt(K);56320<=yt&&yt<=57343?r[T++]=(ct-55296)*1024+yt-56320+65536:(r[T++]=ct,r[T++]=yt);continue}ct!==65279&&(r[T++]=ct)}return T}},XCt=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(t,r){let u=t.length;if(!u)return 0;let T=0,$,K,ct,yt,St=0,Ut=0;if(this.interim[0]){let me=!1,we=this.interim[0];we&=(we&224)===192?31:(we&240)===224?15:7;let Ce=0,Ve;for(;(Ve=this.interim[++Ce]&63)&&Ce<4;)we<<=6,we|=Ve;let kr=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,It=kr-Ce;for(;Ut=u)return 0;if(Ve=t[Ut++],(Ve&192)!==128){Ut--,me=!0;break}else this.interim[Ce++]=Ve,we<<=6,we|=Ve&63}me||(kr===2?we<128?Ut--:r[T++]=we:kr===3?we<2048||we>=55296&&we<=57343||we===65279||(r[T++]=we):we<65536||we>1114111||(r[T++]=we)),this.interim.fill(0)}let ne=u-4,pe=Ut;for(;pe=u)return this.interim[0]=$,T;if(K=t[pe++],(K&192)!==128){pe--;continue}if(St=($&31)<<6|K&63,St<128){pe--;continue}r[T++]=St}else if(($&240)===224){if(pe>=u)return this.interim[0]=$,T;if(K=t[pe++],(K&192)!==128){pe--;continue}if(pe>=u)return this.interim[0]=$,this.interim[1]=K,T;if(ct=t[pe++],(ct&192)!==128){pe--;continue}if(St=($&15)<<12|(K&63)<<6|ct&63,St<2048||St>=55296&&St<=57343||St===65279)continue;r[T++]=St}else if(($&248)===240){if(pe>=u)return this.interim[0]=$,T;if(K=t[pe++],(K&192)!==128){pe--;continue}if(pe>=u)return this.interim[0]=$,this.interim[1]=K,T;if(ct=t[pe++],(ct&192)!==128){pe--;continue}if(pe>=u)return this.interim[0]=$,this.interim[1]=K,this.interim[2]=ct,T;if(yt=t[pe++],(yt&192)!==128){pe--;continue}if(St=($&7)<<18|(K&63)<<12|(ct&63)<<6|yt&63,St<65536||St>1114111)continue;r[T++]=St}}return T}},YH="",h_=" ",p4=class XH{constructor(){this.fg=0,this.bg=0,this.extended=new sS}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new XH;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},sS=class JH{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new JH(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},bg=class QH extends p4{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new sS,this.combinedData=""}static fromCharData(t){let r=new QH;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?a_(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let u=t[1].charCodeAt(0);if(55296<=u&&u<=56319){let T=t[1].charCodeAt(1);56320<=T&&T<=57343?this.content=(u-55296)*1024+T-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},DF="di$target",_9="di$dependencies",eM=new Map;function JCt(e){return e[_9]||[]}function s0(e){if(eM.has(e))return eM.get(e);let t=function(r,u,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");QCt(t,r,T)};return t._id=e,eM.set(e,t),t}function QCt(e,t,r){t[DF]===t?t[_9].push({id:e,index:r}):(t[_9]=[{id:e,index:r}],t[DF]=t)}var om=s0("BufferService"),tV=s0("CoreMouseService"),Yx=s0("CoreService"),tAt=s0("CharsetService"),pL=s0("InstantiationService"),eV=s0("LogService"),sm=s0("OptionsService"),rV=s0("OscLinkService"),eAt=s0("UnicodeService"),m4=s0("DecorationService"),x9=class{constructor(t,r,u){this._bufferService=t,this._optionsService=r,this._oscLinkService=u}provideLinks(t,r){let u=this._bufferService.buffer.lines.get(t-1);if(!u){r(void 0);return}let T=[],$=this._optionsService.rawOptions.linkHandler,K=new bg,ct=u.getTrimmedLength(),yt=-1,St=-1,Ut=!1;for(let ne=0;ne$?$.activate(Ce,Ve,me):rAt(Ce,Ve),hover:(Ce,Ve)=>$?.hover?.(Ce,Ve,me),leave:(Ce,Ve)=>$?.leave?.(Ce,Ve,me)})}Ut=!1,K.hasExtendedAttrs()&&K.extended.urlId?(St=ne,yt=K.extended.urlId):(St=-1,yt=-1)}}r(T)}};x9=Vf([fl(0,om),fl(1,sm),fl(2,rV)],x9);function rAt(e,t){if(confirm(`Do you want to navigate to ${t}? -WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var XS=s0("CharSizeService"),Z1=s0("CoreBrowserService"),mL=s0("MouseService"),K1=s0("RenderService"),rAt=s0("SelectionService"),nV=s0("CharacterJoinerService"),Q2=s0("ThemeService"),iV=s0("LinkProviderService"),nAt=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?zF.isErrorNoTelemetry(t)?new zF(t.message+` +WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var XS=s0("CharSizeService"),Z1=s0("CoreBrowserService"),mL=s0("MouseService"),K1=s0("RenderService"),nAt=s0("SelectionService"),nV=s0("CharacterJoinerService"),Q2=s0("ThemeService"),iV=s0("LinkProviderService"),iAt=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?zF.isErrorNoTelemetry(t)?new zF(t.message+` `+t.stack):new Error(t.message+` -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(r=>{r(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},iAt=new nAt;function AT(e){aAt(e)||iAt.onUnexpectedError(e)}var b9="Canceled";function aAt(e){return e instanceof oAt?!0:e instanceof Error&&e.name===b9&&e.message===b9}var oAt=class extends Error{constructor(){super(b9),this.name=this.message}};function sAt(e){return new Error(`Illegal argument: ${e}`)}var zF=class w9 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof w9)return t;let r=new w9;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},k9=class aV extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,aV.prototype)}};function $m(e,t=0){return e[e.length-(1+t)]}var lAt;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(lAt||={});function cAt(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var oV;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function uAt(...e){return uf(()=>Hx(e))}function uf(e){return{dispose:cAt(()=>{e()})}}var sV=class lV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hx(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?lV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};sV.DISABLE_DISPOSED_WARNING=!1;var m_=sV,Su=class{constructor(){this._store=new m_,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Su.None=Object.freeze({dispose(){}});var G2=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},F1=typeof window=="object"?window:globalThis,T9=class S9{constructor(t){this.element=t,this.next=S9.Undefined,this.prev=S9.Undefined}};T9.Undefined=new T9(void 0);var kf=T9,OF=class{constructor(){this._first=kf.Undefined,this._last=kf.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===kf.Undefined}clear(){let t=this._first;for(;t!==kf.Undefined;){let r=t.next;t.prev=kf.Undefined,t.next=kf.Undefined,t=r}this._first=kf.Undefined,this._last=kf.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,r){let u=new kf(t);if(this._first===kf.Undefined)this._first=u,this._last=u;else if(r){let $=this._last;this._last=u,u.prev=$,$.next=u}else{let $=this._first;this._first=u,u.next=$,$.prev=u}this._size+=1;let T=!1;return()=>{T||(T=!0,this._remove(u))}}shift(){if(this._first!==kf.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==kf.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==kf.Undefined&&t.next!==kf.Undefined){let r=t.prev;r.next=t.next,t.next.prev=r}else t.prev===kf.Undefined&&t.next===kf.Undefined?(this._first=kf.Undefined,this._last=kf.Undefined):t.next===kf.Undefined?(this._last=this._last.prev,this._last.next=kf.Undefined):t.prev===kf.Undefined&&(this._first=this._first.next,this._first.prev=kf.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==kf.Undefined;)yield t.element,t=t.next}},hAt=globalThis.performance&&typeof globalThis.performance.now=="function",dAt=class cV{static create(t){return new cV(t)}constructor(t){this._now=hAt&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},b0;(e=>{e.None=()=>Su.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=uAt(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new Is(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new Is(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new Is({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new Is({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new Is({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new Is;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new Is(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof m_?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(b0||={});var C9=class A9{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${A9._idPool++}`,A9.all.add(this)}start(t){this._stopWatch=new dAt,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};C9.all=new Set,C9._idPool=0;var fAt=C9,pAt=-1,uV=class hV{constructor(t,r,u=(hV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{this._removeListener(t)}}emit(t){this.listeners.forEach(r=>{r(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},aAt=new iAt;function AT(e){oAt(e)||aAt.onUnexpectedError(e)}var b9="Canceled";function oAt(e){return e instanceof sAt?!0:e instanceof Error&&e.name===b9&&e.message===b9}var sAt=class extends Error{constructor(){super(b9),this.name=this.message}};function lAt(e){return new Error(`Illegal argument: ${e}`)}var zF=class w9 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof w9)return t;let r=new w9;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},k9=class aV extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,aV.prototype)}};function $m(e,t=0){return e[e.length-(1+t)]}var cAt;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(cAt||={});function uAt(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var oV;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function hAt(...e){return uf(()=>Vx(e))}function uf(e){return{dispose:uAt(()=>{e()})}}var sV=class lV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Vx(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?lV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};sV.DISABLE_DISPOSED_WARNING=!1;var m_=sV,Su=class{constructor(){this._store=new m_,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Su.None=Object.freeze({dispose(){}});var G2=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},F1=typeof window=="object"?window:globalThis,T9=class S9{constructor(t){this.element=t,this.next=S9.Undefined,this.prev=S9.Undefined}};T9.Undefined=new T9(void 0);var kf=T9,OF=class{constructor(){this._first=kf.Undefined,this._last=kf.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===kf.Undefined}clear(){let t=this._first;for(;t!==kf.Undefined;){let r=t.next;t.prev=kf.Undefined,t.next=kf.Undefined,t=r}this._first=kf.Undefined,this._last=kf.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}_insert(t,r){let u=new kf(t);if(this._first===kf.Undefined)this._first=u,this._last=u;else if(r){let $=this._last;this._last=u,u.prev=$,$.next=u}else{let $=this._first;this._first=u,u.next=$,$.prev=u}this._size+=1;let T=!1;return()=>{T||(T=!0,this._remove(u))}}shift(){if(this._first!==kf.Undefined){let t=this._first.element;return this._remove(this._first),t}}pop(){if(this._last!==kf.Undefined){let t=this._last.element;return this._remove(this._last),t}}_remove(t){if(t.prev!==kf.Undefined&&t.next!==kf.Undefined){let r=t.prev;r.next=t.next,t.next.prev=r}else t.prev===kf.Undefined&&t.next===kf.Undefined?(this._first=kf.Undefined,this._last=kf.Undefined):t.next===kf.Undefined?(this._last=this._last.prev,this._last.next=kf.Undefined):t.prev===kf.Undefined&&(this._first=this._first.next,this._first.prev=kf.Undefined);this._size-=1}*[Symbol.iterator](){let t=this._first;for(;t!==kf.Undefined;)yield t.element,t=t.next}},dAt=globalThis.performance&&typeof globalThis.performance.now=="function",fAt=class cV{static create(t){return new cV(t)}constructor(t){this._now=dAt&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},b0;(e=>{e.None=()=>Su.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=hAt(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new Is(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new Is(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new Is({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new Is({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new Is({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new Is;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new Is(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof m_?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(b0||={});var C9=class A9{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${A9._idPool++}`,A9.all.add(this)}start(t){this._stopWatch=new fAt,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};C9.all=new Set,C9._idPool=0;var pAt=C9,mAt=-1,uV=class hV{constructor(t,r,u=(hV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ct=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ct);let yt=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],St=new yAt(`${ct}. HINT: Stack shows most frequent listener (${yt[1]}-times)`,yt[0]);return(this._options?.onListenerError||AT)(St),Su.None}if(this._disposed)return Su.None;r&&(t=t.bind(r));let T=new rM(t),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(T.stack=gAt.create(),$=this._leakageMon.check(T.stack,this._size+1)),this._listeners?this._listeners instanceof rM?(this._deliveryQueue??=new wAt,this._listeners=[this._listeners,T]):this._listeners.push(T):(this._options?.onWillAddFirstListener?.(this),this._listeners=T,this._options?.onDidAddFirstListener?.(this)),this._size++;let K=uf(()=>{$?.(),this._removeListener(T)});return u instanceof m_?u.add(K):Array.isArray(u)&&u.push(K),K},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,u=r.indexOf(t);if(u===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[u]=void 0;let T=this._deliveryQueue.current===this;if(this._size*xAt<=r.length){let $=0;for(let K=0;K0}},wAt=class{constructor(){this.i=-1,this.end=0}enqueue(t,r,u){this.i=0,this.end=u,this.current=t,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},M9=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Is,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Is,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let u=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(u,t),this._onDidChangeZoomLevel.fire(u)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let u=this.getWindowId(r);this.mapWindowIdToFullScreen.set(u,t),this._onDidChangeFullscreen.fire(u)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};M9.INSTANCE=new M9;var gL=M9;function kAt(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}gL.INSTANCE.onDidChangeZoomLevel;function TAt(e){return gL.INSTANCE.getZoomFactor(e)}gL.INSTANCE.onDidChangeFullscreen;var tw=typeof navigator=="object"?navigator.userAgent:"",E9=tw.indexOf("Firefox")>=0,SAt=tw.indexOf("AppleWebKit")>=0,vL=tw.indexOf("Chrome")>=0,CAt=!vL&&tw.indexOf("Safari")>=0;tw.indexOf("Electron/")>=0;tw.indexOf("Android")>=0;var nM=!1;if(typeof F1.matchMedia=="function"){let e=F1.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=F1.matchMedia("(display-mode: fullscreen)");nM=e.matches,kAt(F1,e,({matches:r})=>{nM&&t.matches||(nM=r)})}var C2="en",L9=!1,P9=!1,MT=!1,fV=!1,nT,ET=C2,BF=C2,AAt,S1,Ox=globalThis,Vm;typeof Ox.vscode<"u"&&typeof Ox.vscode.process<"u"?Vm=Ox.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Vm=process);var MAt=typeof Vm?.versions?.electron=="string",EAt=MAt&&Vm?.type==="renderer";if(typeof Vm=="object"){L9=Vm.platform==="win32",P9=Vm.platform==="darwin",MT=Vm.platform==="linux",MT&&Vm.env.SNAP&&Vm.env.SNAP_REVISION,Vm.env.CI||Vm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,nT=C2,ET=C2;let e=Vm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);nT=t.userLocale,BF=t.osLocale,ET=t.resolvedLanguage||C2,AAt=t.languagePack?.translationsConfigFile}catch{}fV=!0}else typeof navigator=="object"&&!EAt?(S1=navigator.userAgent,L9=S1.indexOf("Windows")>=0,P9=S1.indexOf("Macintosh")>=0,(S1.indexOf("Macintosh")>=0||S1.indexOf("iPad")>=0||S1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,MT=S1.indexOf("Linux")>=0,S1?.indexOf("Mobi")>=0,ET=globalThis._VSCODE_NLS_LANGUAGE||C2,nT=navigator.language.toLowerCase(),BF=nT):console.error("Unable to resolve platform.");var pV=L9,Pv=P9,LAt=MT,RF=fV,Ov=S1,$y=ET,PAt;(e=>{function t(){return $y}e.value=t;function r(){return $y.length===2?$y==="en":$y.length>=3?$y[0]==="e"&&$y[1]==="n"&&$y[2]==="-":!1}e.isDefaultVariant=r;function u(){return $y==="en"}e.isDefault=u})(PAt||={});var IAt=typeof Ox.postMessage=="function"&&!Ox.importScripts;(()=>{if(IAt){let e=[];Ox.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let u=0,T=e.length;u{let u=++t;e.push({id:u,callback:r}),Ox.postMessage({vscodeScheduleAsyncWork:u},"*")}}return e=>setTimeout(e)})();var DAt=!!(Ov&&Ov.indexOf("Chrome")>=0);Ov&&Ov.indexOf("Firefox")>=0;!DAt&&Ov&&Ov.indexOf("Safari")>=0;Ov&&Ov.indexOf("Edg/")>=0;Ov&&Ov.indexOf("Android")>=0;var y2=typeof navigator=="object"?navigator:{};RF||document.queryCommandSupported&&document.queryCommandSupported("copy")||y2&&y2.clipboard&&y2.clipboard.writeText,RF||y2&&y2.clipboard&&y2.clipboard.readText;var yL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,r){this._keyCodeToStr[t]=r,this._strToKeyCode[r.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},iM=new yL,FF=new yL,NF=new yL,zAt=new Array(230),mV;(e=>{function t(ct){return iM.keyCodeToStr(ct)}e.toString=t;function r(ct){return iM.strToKeyCode(ct)}e.fromString=r;function u(ct){return FF.keyCodeToStr(ct)}e.toUserSettingsUS=u;function T(ct){return NF.keyCodeToStr(ct)}e.toUserSettingsGeneral=T;function $(ct){return FF.strToKeyCode(ct)||NF.strToKeyCode(ct)}e.fromUserSettings=$;function K(ct){if(ct>=98&&ct<=113)return null;switch(ct){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return iM.keyCodeToStr(ct)}e.toElectronAccelerator=K})(mV||={});var OAt=class gV{constructor(t,r,u,T,$){this.ctrlKey=t,this.shiftKey=r,this.altKey=u,this.metaKey=T,this.keyCode=$}equals(t){return t instanceof gV&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",u=this.altKey?"1":"0",T=this.metaKey?"1":"0";return`K${t}${r}${u}${T}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new BAt([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},BAt=class{constructor(e){if(e.length===0)throw sAt("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t{function t(r){return r===e.None||r===e.Cancelled||r instanceof WAt?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:b0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:vV})})(VAt||={});var WAt=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?vV:(this._emitter||(this._emitter=new Is),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},_L=class{constructor(t,r){this._isDisposed=!1,this._token=-1,typeof t=="function"&&typeof r=="number"&&this.setIfNotSet(t,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,r){if(this._isDisposed)throw new k9("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},r)}setIfNotSet(t,r){if(this._isDisposed)throw new k9("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},r))}},qAt=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(t,r,u=globalThis){if(this.isDisposed)throw new k9("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let T=u.setInterval(()=>{t()},r);this.disposable=uf(()=>{u.clearInterval(T),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},GAt;(e=>{async function t(u){let T,$=await Promise.all(u.map(K=>K.then(ct=>ct,ct=>{T||(T=ct)})));if(typeof T<"u")throw T;return $}e.settled=t;function r(u){return new Promise(async(T,$)=>{try{await u(T,$)}catch(K){$(K)}})}e.withAsyncBody=r})(GAt||={});var HF=class hg{static fromArray(t){return new hg(r=>{r.emitMany(t)})}static fromPromise(t){return new hg(async r=>{r.emitMany(await t)})}static fromPromises(t){return new hg(async r=>{await Promise.all(t.map(async u=>r.emitOne(await u)))})}static merge(t){return new hg(async r=>{await Promise.all(t.map(async u=>{for await(let T of u)r.emitOne(T)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Is,queueMicrotask(async()=>{let u={emitOne:T=>this.emitOne(T),emitMany:T=>this.emitMany(T),reject:T=>this.reject(T)};try{await Promise.resolve(t(u)),this.resolve()}catch(T){this.reject(T)}finally{u.emitOne=void 0,u.emitMany=void 0,u.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new hg(async u=>{for await(let T of t)u.emitOne(r(T))})}map(t){return hg.map(this,t)}static filter(t,r){return new hg(async u=>{for await(let T of t)r(T)&&u.emitOne(T)})}filter(t){return hg.filter(this,t)}static coalesce(t){return hg.filter(t,r=>!!r)}coalesce(){return hg.coalesce(this)}static async toPromise(t){let r=[];for await(let u of t)r.push(u);return r}toPromise(){return hg.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};HF.EMPTY=HF.fromArray([]);var{getWindow:Mv,getWindowId:ZAt,onDidRegisterWindow:KAt}=function(){let e=new Map,t={window:F1,disposables:new m_};e.set(F1.vscodeWindowId,t);let r=new Is,u=new Is,T=new Is;function $(K,ct){return(typeof K=="number"?e.get(K):void 0)??(ct?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:T.event,onDidUnregisterWindow:u.event,registerWindow(K){if(e.has(K.vscodeWindowId))return Su.None;let ct=new m_,yt={window:K,disposables:ct.add(new m_)};return e.set(K.vscodeWindowId,yt),ct.add(uf(()=>{e.delete(K.vscodeWindowId),u.fire(K)})),ct.add(Uc(K,t0.BEFORE_UNLOAD,()=>{T.fire(K)})),r.fire(yt),ct},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(K){return K.vscodeWindowId},hasWindow(K){return e.has(K)},getWindowById:$,getWindow(K){let ct=K;if(ct?.ownerDocument?.defaultView)return ct.ownerDocument.defaultView.window;let yt=K;return yt?.view?yt.view.window:F1},getDocument(K){return Mv(K).document}}}(),YAt=class{constructor(t,r,u,T){this._node=t,this._type=r,this._handler=u,this._options=T||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Uc(e,t,r,u){return new YAt(e,t,r,u)}var VF=function(e,t,r,u){return Uc(e,t,r,u)},xL,XAt=class extends qAt{constructor(e){super(),this.defaultTarget=e&&Mv(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},WF=class{constructor(t,r=0){this._runner=t,this.priority=r,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(t){AT(t)}}static sort(t,r){return r.priority-t.priority}};(function(){let e=new Map,t=new Map,r=new Map,u=new Map,T=$=>{r.set($,!1);let K=e.get($)??[];for(t.set($,K),e.set($,[]),u.set($,!0);K.length>0;)K.sort(WF.sort),K.shift().execute();u.set($,!1)};xL=($,K,ct=0)=>{let yt=ZAt($),St=new WF(K,ct),Ut=e.get(yt);return Ut||(Ut=[],e.set(yt,Ut)),Ut.push(St),r.get(yt)||(r.set(yt,!0),$.requestAnimationFrame(()=>T(yt))),St}})();function JAt(e){let t=e.getBoundingClientRect(),r=Mv(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var t0={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},QAt=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=bm(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=bm(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=bm(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=bm(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=bm(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=bm(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=bm(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=bm(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=bm(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=bm(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=bm(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=bm(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=bm(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=bm(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function bm(e){return typeof e=="number"?`${e}px`:e}function I5(e){return new QAt(e)}var yV=class{constructor(){this._hooks=new m_,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(t,r){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let u=this._onStopCallback;this._onStopCallback=null,t&&u&&u(r)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(t,r,u,T,$){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=T,this._onStopCallback=$;let K=t;try{t.setPointerCapture(r),this._hooks.add(uf(()=>{try{t.releasePointerCapture(r)}catch{}}))}catch{K=Mv(t)}this._hooks.add(Uc(K,t0.POINTER_MOVE,ct=>{if(ct.buttons!==u){this.stopMonitoring(!0);return}ct.preventDefault(),this._pointerMoveCallback(ct)})),this._hooks.add(Uc(K,t0.POINTER_UP,ct=>this.stopMonitoring(!0)))}};function t7t(e,t,r){let u=null,T=null;if(typeof r.value=="function"?(u="value",T=r.value,T.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(u="get",T=r.get),!T)throw new Error("not supported");let $=`$memoize$${t}`;r[u]=function(...K){return this.hasOwnProperty($)||Object.defineProperty(this,$,{configurable:!1,enumerable:!1,writable:!1,value:T.apply(this,K)}),this[$]}}var _v;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(_v||={});var u5=class D0 extends Su{constructor(){super(),this.dispatched=!1,this.targets=new OF,this.ignoreTargets=new OF,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(b0.runAndSubscribe(KAt,({window:t,disposables:r})=>{r.add(Uc(t.document,"touchstart",u=>this.onTouchStart(u),{passive:!1})),r.add(Uc(t.document,"touchend",u=>this.onTouchEnd(t,u))),r.add(Uc(t.document,"touchmove",u=>this.onTouchMove(u),{passive:!1}))},{window:F1,disposables:this._store}))}static addTarget(t){if(!D0.isTouchDevice())return Su.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.targets.push(t);return uf(r)}static ignoreTarget(t){if(!D0.isTouchDevice())return Su.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.ignoreTargets.push(t);return uf(r)}static isTouchDevice(){return"ontouchstart"in F1||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let u=0,T=t.targetTouches.length;u=D0.HOLD_DELAY&&Math.abs(yt.initialPageX-$m(yt.rollingPageX))<30&&Math.abs(yt.initialPageY-$m(yt.rollingPageY))<30){let Ut=this.newGestureEvent(_v.Contextmenu,yt.initialTarget);Ut.pageX=$m(yt.rollingPageX),Ut.pageY=$m(yt.rollingPageY),this.dispatchEvent(Ut)}else if(T===1){let Ut=$m(yt.rollingPageX),ne=$m(yt.rollingPageY),pe=$m(yt.rollingTimestamps)-yt.rollingTimestamps[0],me=Ut-yt.rollingPageX[0],we=ne-yt.rollingPageY[0],Ce=[...this.targets].filter(Ve=>yt.initialTarget instanceof Node&&Ve.contains(yt.initialTarget));this.inertia(t,Ce,u,Math.abs(me)/pe,me>0?1:-1,Ut,Math.abs(we)/pe,we>0?1:-1,ne)}this.dispatchEvent(this.newGestureEvent(_v.End,yt.initialTarget)),delete this.activeTouches[ct.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let u=document.createEvent("CustomEvent");return u.initEvent(t,!1,!0),u.initialTarget=r,u.tapCount=0,u}dispatchEvent(t){if(t.type===_v.Tap){let r=new Date().getTime(),u=0;r-this._lastSetTapCountTime>D0.CLEAR_TAP_COUNT_TIME?u=1:u=2,this._lastSetTapCountTime=r,t.tapCount=u}else(t.type===_v.Change||t.type===_v.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let u of this.ignoreTargets)if(u.contains(t.initialTarget))return;let r=[];for(let u of this.targets)if(u.contains(t.initialTarget)){let T=0,$=t.initialTarget;for(;$&&$!==u;)T++,$=$.parentElement;r.push([T,u])}r.sort((u,T)=>u[0]-T[0]);for(let[u,T]of r)T.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,u,T,$,K,ct,yt,St){this.handle=xL(t,()=>{let Ut=Date.now(),ne=Ut-u,pe=0,me=0,we=!0;T+=D0.SCROLL_FRICTION*ne,ct+=D0.SCROLL_FRICTION*ne,T>0&&(we=!1,pe=$*T*ne),ct>0&&(we=!1,me=yt*ct*ne);let Ce=this.newGestureEvent(_v.Change);Ce.translationX=pe,Ce.translationY=me,r.forEach(Ve=>Ve.dispatchEvent(Ce)),we||this.inertia(t,r,Ut,T,$,K+pe,ct,yt,St+me)})}onTouchMove(t){let r=Date.now();for(let u=0,T=t.changedTouches.length;u3&&(K.rollingPageX.shift(),K.rollingPageY.shift(),K.rollingTimestamps.shift()),K.rollingPageX.push($.pageX),K.rollingPageY.push($.pageY),K.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};u5.SCROLL_FRICTION=-.005,u5.HOLD_DELAY=700,u5.CLEAR_TAP_COUNT_TIME=400,Vf([t7t],u5,"isTouchDevice",1);var e7t=u5,bL=class extends Su{onclick(t,r){this._register(Uc(t,t0.CLICK,u=>r(new iT(Mv(t),u))))}onmousedown(t,r){this._register(Uc(t,t0.MOUSE_DOWN,u=>r(new iT(Mv(t),u))))}onmouseover(t,r){this._register(Uc(t,t0.MOUSE_OVER,u=>r(new iT(Mv(t),u))))}onmouseleave(t,r){this._register(Uc(t,t0.MOUSE_LEAVE,u=>r(new iT(Mv(t),u))))}onkeydown(t,r){this._register(Uc(t,t0.KEY_DOWN,u=>r(new jF(u))))}onkeyup(t,r){this._register(Uc(t,t0.KEY_UP,u=>r(new jF(u))))}oninput(t,r){this._register(Uc(t,t0.INPUT,r))}onblur(t,r){this._register(Uc(t,t0.BLUR,r))}onfocus(t,r){this._register(Uc(t,t0.FOCUS,r))}onchange(t,r){this._register(Uc(t,t0.CHANGE,r))}ignoreGesture(t){return e7t.ignoreTarget(t)}},qF=11,r7t=class extends bL{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=qF+"px",this.domNode.style.height=qF+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new yV),this._register(VF(this.bgDomNode,t0.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(VF(this.domNode,t0.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new XAt),this._pointerdownScheduleRepeatTimer=this._register(new _L)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Mv(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},n7t=class I9{constructor(t,r,u,T,$,K,ct){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,u=u|0,T=T|0,$=$|0,K=K|0,ct=ct|0),this.rawScrollLeft=T,this.rawScrollTop=ct,r<0&&(r=0),T+r>u&&(T=u-r),T<0&&(T=0),$<0&&($=0),ct+$>K&&(ct=K-$),ct<0&&(ct=0),this.width=r,this.scrollWidth=u,this.scrollLeft=T,this.height=$,this.scrollHeight=K,this.scrollTop=ct}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new I9(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new I9(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let u=this.width!==t.width,T=this.scrollWidth!==t.scrollWidth,$=this.scrollLeft!==t.scrollLeft,K=this.height!==t.height,ct=this.scrollHeight!==t.scrollHeight,yt=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:u,scrollWidthChanged:T,scrollLeftChanged:$,heightChanged:K,scrollHeightChanged:ct,scrollTopChanged:yt}}},i7t=class extends Su{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new n7t(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let u;t?u=new ZF(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):u=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=u}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=ZF.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},GF=class{constructor(t,r,u){this.scrollLeft=t,this.scrollTop=r,this.isDone=u}};function aM(e,t){let r=t-e;return function(u){return e+r*s7t(u)}}function a7t(e,t,r){return function(u){return u2.5*u){let T,$;return t{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(t){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(t?" fade":"")))}},c7t=140,_V=class extends bL{constructor(t){super(),this._lazyRender=t.lazyRender,this._host=t.host,this._scrollable=t.scrollable,this._scrollByPage=t.scrollByPage,this._scrollbarState=t.scrollbarState,this._visibilityController=this._register(new l7t(t.visibility,"visible scrollbar "+t.extraScrollbarClassName,"invisible scrollbar "+t.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new yV),this._shouldRender=!0,this.domNode=I5(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Uc(this.domNode.domNode,t0.POINTER_DOWN,r=>this._domNodePointerDown(r)))}_createArrow(t){let r=this._register(new r7t(t));this.domNode.domNode.appendChild(r.bgDomNode),this.domNode.domNode.appendChild(r.domNode)}_createSlider(t,r,u,T){this.slider=I5(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(t),this.slider.setLeft(r),typeof u=="number"&&this.slider.setWidth(u),typeof T=="number"&&this.slider.setHeight(T),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Uc(this.slider.domNode,t0.POINTER_DOWN,$=>{$.button===0&&($.preventDefault(),this._sliderPointerDown($))})),this.onclick(this.slider.domNode,$=>{$.leftButton&&$.stopPropagation()})}_onElementSize(t){return this._scrollbarState.setVisibleSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(t){return this._scrollbarState.setScrollSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(t){return this._scrollbarState.setScrollPosition(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(t){t.target===this.domNode.domNode&&this._onPointerDown(t)}delegatePointerDown(t){let r=this.domNode.domNode.getClientRects()[0].top,u=r+this._scrollbarState.getSliderPosition(),T=r+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),$=this._sliderPointerPosition(t);u<=$&&$<=T?t.button===0&&(t.preventDefault(),this._sliderPointerDown(t)):this._onPointerDown(t)}_onPointerDown(t){let r,u;if(t.target===this.domNode.domNode&&typeof t.offsetX=="number"&&typeof t.offsetY=="number")r=t.offsetX,u=t.offsetY;else{let $=JAt(this.domNode.domNode);r=t.pageX-$.left,u=t.pageY-$.top}let T=this._pointerDownRelativePosition(r,u);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(T):this._scrollbarState.getDesiredScrollPositionFromOffset(T)),t.button===0&&(t.preventDefault(),this._sliderPointerDown(t))}_sliderPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let r=this._sliderPointerPosition(t),u=this._sliderOrthogonalPointerPosition(t),T=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,$=>{let K=this._sliderOrthogonalPointerPosition($),ct=Math.abs(K-u);if(pV&&ct>c7t){this._setDesiredScrollPositionNow(T.getScrollPosition());return}let yt=this._sliderPointerPosition($)-r;this._setDesiredScrollPositionNow(T.getDesiredScrollPositionFromDelta(yt))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(t){let r={};this.writeScrollPosition(r,t),this._scrollable.setScrollPositionNow(r)}updateScrollbarSize(t){this._updateScrollbarSize(t),this._scrollbarState.setScrollbarSize(t),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},xV=class z9{constructor(t,r,u,T,$,K){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(u),this._arrowSize=Math.round(t),this._visibleSize=T,this._scrollSize=$,this._scrollPosition=K,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new z9(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,u,T,$){let K=Math.max(0,u-t),ct=Math.max(0,K-2*r),yt=T>0&&T>u;if(!yt)return{computedAvailableSize:Math.round(K),computedIsNeeded:yt,computedSliderSize:Math.round(ct),computedSliderRatio:0,computedSliderPosition:0};let St=Math.round(Math.max(20,Math.floor(u*ct/T))),Ut=(ct-St)/(T-u),ne=$*Ut;return{computedAvailableSize:Math.round(K),computedIsNeeded:yt,computedSliderSize:Math.round(St),computedSliderRatio:Ut,computedSliderPosition:Math.round(ne)}}_refreshComputedValues(){let t=z9._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,u=this._scrollPosition;return r0&&Math.abs(t.deltaY)>0)return 1;let u=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(u+=.25),r){let T=Math.abs(t.deltaX),$=Math.abs(t.deltaY),K=Math.abs(r.deltaX),ct=Math.abs(r.deltaY),yt=Math.max(Math.min(T,K),1),St=Math.max(Math.min($,ct),1),Ut=Math.max(T,K),ne=Math.max($,ct);Ut%yt===0&&ne%St===0&&(u-=.5)}return Math.min(Math.max(u,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};O9.INSTANCE=new O9;var p7t=O9,m7t=class extends bL{constructor(e,t,r){super(),this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Is),this.onWillScroll=this._onWillScroll.event,this._options=v7t(t),this._scrollable=r,this._register(this._scrollable.onScroll(T=>{this._onWillScroll.fire(T),this._onDidScroll(T),this._onScroll.fire(T)}));let u={onMouseWheel:T=>this._onMouseWheel(T),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new h7t(this._scrollable,this._options,u)),this._horizontalScrollbar=this._register(new u7t(this._scrollable,this._options,u)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=I5(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=I5(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=I5(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,T=>this._onMouseOver(T)),this.onmouseleave(this._listenOnDomNode,T=>this._onMouseLeave(T)),this._hideTimeout=this._register(new _L),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Hx(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Pv&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new $F(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Hx(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new $F(r))};this._mouseWheelToDispose.push(Uc(this._listenOnDomNode,t0.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=p7t.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let T=e.deltaY*this._options.mouseWheelScrollSensitivity,$=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&$+T===0?$=T=0:Math.abs(T)>=Math.abs($)?$=0:T=0),this._options.flipAxes&&([T,$]=[$,T]);let K=!Pv&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||K)&&!$&&($=T,T=0),e.browserEvent&&e.browserEvent.altKey&&($=$*this._options.fastScrollSensitivity,T=T*this._options.fastScrollSensitivity);let ct=this._scrollable.getFutureScrollPosition(),yt={};if(T){let St=KF*T,Ut=ct.scrollTop-(St<0?Math.floor(St):Math.ceil(St));this._verticalScrollbar.writeScrollPosition(yt,Ut)}if($){let St=KF*$,Ut=ct.scrollLeft-(St<0?Math.floor(St):Math.ceil(St));this._horizontalScrollbar.writeScrollPosition(yt,Ut)}yt=this._scrollable.validateScrollPosition(yt),(ct.scrollLeft!==yt.scrollLeft||ct.scrollTop!==yt.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(yt):this._scrollable.setScrollPositionNow(yt),r=!0)}let u=r;!u&&this._options.alwaysConsumeMouseWheel&&(u=!0),!u&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(u=!0),u&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,u=r?" left":"",T=t?" top":"",$=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${u}`),this._topShadowDomNode.setClassName(`shadow${T}`),this._topLeftShadowDomNode.setClassName(`shadow${$}${T}${u}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),d7t)}},g7t=class extends m7t{constructor(t,r,u){super(t,r,u)}setScrollPosition(t){t.reuseAnimation?this._scrollable.setScrollPositionSmooth(t,t.reuseAnimation):this._scrollable.setScrollPositionNow(t)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function v7t(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Pv&&(t.className+=" mac"),t}var B9=class extends Su{constructor(t,r,u,T,$,K,ct,yt){super(),this._bufferService=u,this._optionsService=ct,this._renderService=yt,this._onRequestScrollLines=this._register(new Is),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let St=this._register(new i7t({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:Ut=>xL(T.window,Ut)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{St.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new g7t(r,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},St)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register($.onProtocolChange(Ut=>{this._scrollableElement.updateOptions({handleMouseWheel:!(Ut&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(b0.runAndSubscribe(K.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=K.colors.background.css})),t.appendChild(this._scrollableElement.getDomNode()),this._register(uf(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=T.mainDocument.createElement("style"),r.appendChild(this._styleElement),this._register(uf(()=>this._styleElement.remove())),this._register(b0.runAndSubscribe(K.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${K.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${K.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${K.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` -`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(Ut=>this._handleScroll(Ut)))}scrollLines(t){let r=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:r.scrollTop+t*this._renderService.dimensions.css.cell.height})}scrollToLine(t,r){r&&(this._latestYDisp=t),this._scrollableElement.setScrollPosition({reuseAnimation:!r,scrollTop:t*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(t){t!==void 0&&(this._latestYDisp=t),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(t=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,t!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:t*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(t){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let r=Math.round(t.scrollTop/this._renderService.dimensions.css.cell.height),u=r-this._bufferService.buffer.ydisp;u!==0&&(this._latestYDisp=r,this._onRequestScrollLines.fire(u)),this._isHandlingScroll=!1}};B9=Vf([fl(2,om),fl(3,Z1),fl(4,tV),fl(5,Q2),fl(6,sm),fl(7,K1)],B9);var R9=class extends Su{constructor(t,r,u,T,$){super(),this._screenElement=t,this._bufferService=r,this._coreBrowserService=u,this._decorationService=T,this._renderService=$,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(K=>this._removeDecoration(K))),this._register(uf(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let t of this._decorationService.decorations)this._renderDecoration(t);this._dimensionsChanged=!1}_renderDecoration(t){this._refreshStyle(t),this._dimensionsChanged&&this._refreshXPosition(t)}_createElement(t){let r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",t?.options?.layer==="top"),r.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${(t.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let u=t.options.x??0;return u&&u>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(t,r),r}_refreshStyle(t){let r=t.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let u=this._decorationElements.get(t);u||(u=this._createElement(t),t.element=u,this._decorationElements.set(t,u),this._container.appendChild(u),t.onDispose(()=>{this._decorationElements.delete(t),u.remove()})),u.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(u.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,u.style.top=`${r*this._renderService.dimensions.css.cell.height}px`,u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),t.onRenderEmitter.fire(u)}}_refreshXPosition(t,r=t.element){if(!r)return;let u=t.options.x??0;(t.options.anchor||"left")==="right"?r.style.right=u?`${u*this._renderService.dimensions.css.cell.width}px`:"":r.style.left=u?`${u*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(t){this._decorationElements.get(t)?.remove(),this._decorationElements.delete(t),t.dispose()}};R9=Vf([fl(1,om),fl(2,Z1),fl(3,m4),fl(4,K1)],R9);var y7t=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(t){if(t.options.overviewRulerOptions){for(let r of this._zones)if(r.color===t.options.overviewRulerOptions.color&&r.position===t.options.overviewRulerOptions.position){if(this._lineIntersectsZone(r,t.marker.line))return;if(this._lineAdjacentToZone(r,t.marker.line,t.options.overviewRulerOptions.position)){this._addLineToZone(r,t.marker.line);return}}if(this._zonePoolIndex=t.startBufferLine&&r<=t.endBufferLine}_lineAdjacentToZone(t,r,u){return r>=t.startBufferLine-this._linePadding[u||"full"]&&r<=t.endBufferLine+this._linePadding[u||"full"]}_addLineToZone(t,r){t.startBufferLine=Math.min(t.startBufferLine,r),t.endBufferLine=Math.max(t.endBufferLine,r)}},pv={full:0,left:0,center:0,right:0},Hy={full:0,left:0,center:0,right:0},G3={full:0,left:0,center:0,right:0},lS=class extends Su{constructor(t,r,u,T,$,K,ct,yt){super(),this._viewportElement=t,this._screenElement=r,this._bufferService=u,this._decorationService=T,this._renderService=$,this._optionsService=K,this._themeService=ct,this._coreBrowserService=yt,this._colorZoneStore=new y7t,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(uf(()=>this._canvas?.remove()));let St=this._canvas.getContext("2d");if(St)this._ctx=St;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let t=Math.floor((this._canvas.width-1)/3),r=Math.ceil((this._canvas.width-1)/3);Hy.full=this._canvas.width,Hy.left=t,Hy.center=r,Hy.right=t,this._refreshDrawHeightConstants(),G3.full=1,G3.left=1,G3.center=1+Hy.left,G3.right=1+Hy.left+Hy.center}_refreshDrawHeightConstants(){pv.full=Math.round(2*this._coreBrowserService.dpr);let t=this._canvas.height/this._bufferService.buffer.lines.length,r=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);pv.left=r,pv.center=r,pv.right=r}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let r of this._decorationService.decorations)this._colorZoneStore.addDecoration(r);this._ctx.lineWidth=1,this._renderRulerOutline();let t=this._colorZoneStore.zones;for(let r of t)r.position!=="full"&&this._renderColorZone(r);for(let r of t)r.position==="full"&&this._renderColorZone(r);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(G3[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-pv[t.position||"full"]/2),Hy[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+pv[t.position||"full"]))}_queueRefresh(t,r){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=r||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};lS=Vf([fl(2,om),fl(3,m4),fl(4,K1),fl(5,sm),fl(6,Q2),fl(7,Z1)],lS);var Ho;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=` -`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(Ho||={});var LT;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(LT||={});var bV;(e=>e.ST=`${Ho.ESC}\\`)(bV||={});var F9=class{constructor(t,r,u,T,$,K){this._textarea=t,this._compositionView=r,this._bufferService=u,this._optionsService=T,this._coreService=$,this._renderService=K,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(t){this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(t){if(this._isComposing||this._isSendingComposition){if(t.keyCode===20||t.keyCode===229||t.keyCode===16||t.keyCode===17||t.keyCode===18)return!1;this._finalizeComposition(!1)}return t.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(t){if(this._compositionView.classList.remove("active"),this._isComposing=!1,t){let r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let u;r.start+=this._dataAlreadySent.length,this._isComposing?u=this._textarea.value.substring(r.start,this._compositionPosition.start):u=this._textarea.value.substring(r.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}},0)}else{this._isSendingComposition=!1;let r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){let t=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let r=this._textarea.value,u=r.replace(t,"");this._dataAlreadySent=u,r.length>t.length?this._coreService.triggerDataEvent(u,!0):r.lengththis.updateCompositionElements(!0),0)}}};F9=Vf([fl(2,om),fl(3,sm),fl(4,Kx),fl(5,K1)],F9);var e0=0,r0=0,n0=0,jf=0,YF={css:"#00000000",rgba:0},kp;(e=>{function t(T,$,K,ct){return ct!==void 0?`#${mx(T)}${mx($)}${mx(K)}${mx(ct)}`:`#${mx(T)}${mx($)}${mx(K)}`}e.toCss=t;function r(T,$,K,ct=255){return(T<<24|$<<16|K<<8|ct)>>>0}e.toRgba=r;function u(T,$,K,ct){return{css:e.toCss(T,$,K,ct),rgba:e.toRgba(T,$,K,ct)}}e.toColor=u})(kp||={});var Zd;(e=>{function t(yt,St){if(jf=(St.rgba&255)/255,jf===1)return{css:St.css,rgba:St.rgba};let Ut=St.rgba>>24&255,ne=St.rgba>>16&255,pe=St.rgba>>8&255,me=yt.rgba>>24&255,we=yt.rgba>>16&255,Ce=yt.rgba>>8&255;e0=me+Math.round((Ut-me)*jf),r0=we+Math.round((ne-we)*jf),n0=Ce+Math.round((pe-Ce)*jf);let Ve=kp.toCss(e0,r0,n0),kr=kp.toRgba(e0,r0,n0);return{css:Ve,rgba:kr}}e.blend=t;function r(yt){return(yt.rgba&255)===255}e.isOpaque=r;function u(yt,St,Ut){let ne=PT.ensureContrastRatio(yt.rgba,St.rgba,Ut);if(ne)return kp.toColor(ne>>24&255,ne>>16&255,ne>>8&255)}e.ensureContrastRatio=u;function T(yt){let St=(yt.rgba|255)>>>0;return[e0,r0,n0]=PT.toChannels(St),{css:kp.toCss(e0,r0,n0),rgba:St}}e.opaque=T;function $(yt,St){return jf=Math.round(St*255),[e0,r0,n0]=PT.toChannels(yt.rgba),{css:kp.toCss(e0,r0,n0,jf),rgba:kp.toRgba(e0,r0,n0,jf)}}e.opacity=$;function K(yt,St){return jf=yt.rgba&255,$(yt,jf*St/255)}e.multiplyOpacity=K;function ct(yt){return[yt.rgba>>24&255,yt.rgba>>16&255,yt.rgba>>8&255]}e.toColorRGB=ct})(Zd||={});var Tf;(e=>{let t,r;try{let T=document.createElement("canvas");T.width=1,T.height=1;let $=T.getContext("2d",{willReadFrequently:!0});$&&(t=$,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function u(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return e0=parseInt(T.slice(1,2).repeat(2),16),r0=parseInt(T.slice(2,3).repeat(2),16),n0=parseInt(T.slice(3,4).repeat(2),16),kp.toColor(e0,r0,n0);case 5:return e0=parseInt(T.slice(1,2).repeat(2),16),r0=parseInt(T.slice(2,3).repeat(2),16),n0=parseInt(T.slice(3,4).repeat(2),16),jf=parseInt(T.slice(4,5).repeat(2),16),kp.toColor(e0,r0,n0,jf);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}let $=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if($)return e0=parseInt($[1]),r0=parseInt($[2]),n0=parseInt($[3]),jf=Math.round(($[5]===void 0?1:parseFloat($[5]))*255),kp.toColor(e0,r0,n0,jf);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=T,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[e0,r0,n0,jf]=t.getImageData(0,0,1,1).data,jf!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:kp.toRgba(e0,r0,n0,jf),css:T}}e.toColor=u})(Tf||={});var Q0;(e=>{function t(u){return r(u>>16&255,u>>8&255,u&255)}e.relativeLuminance=t;function r(u,T,$){let K=u/255,ct=T/255,yt=$/255,St=K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4),Ut=ct<=.03928?ct/12.92:Math.pow((ct+.055)/1.055,2.4),ne=yt<=.03928?yt/12.92:Math.pow((yt+.055)/1.055,2.4);return St*.2126+Ut*.7152+ne*.0722}e.relativeLuminance2=r})(Q0||={});var PT;(e=>{function t(K,ct){if(jf=(ct&255)/255,jf===1)return ct;let yt=ct>>24&255,St=ct>>16&255,Ut=ct>>8&255,ne=K>>24&255,pe=K>>16&255,me=K>>8&255;return e0=ne+Math.round((yt-ne)*jf),r0=pe+Math.round((St-pe)*jf),n0=me+Math.round((Ut-me)*jf),kp.toRgba(e0,r0,n0)}e.blend=t;function r(K,ct,yt){let St=Q0.relativeLuminance(K>>8),Ut=Q0.relativeLuminance(ct>>8);if(y1(St,Ut)>8));if(we>8));return we>Ve?me:Ce}return me}let ne=T(K,ct,yt),pe=y1(St,Q0.relativeLuminance(ne>>8));if(pe>8));return pe>we?ne:me}return ne}}e.ensureContrastRatio=r;function u(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=y1(Q0.relativeLuminance2(pe,me,we),Q0.relativeLuminance2(St,Ut,ne));for(;Ce0||me>0||we>0);)pe-=Math.max(0,Math.ceil(pe*.1)),me-=Math.max(0,Math.ceil(me*.1)),we-=Math.max(0,Math.ceil(we*.1)),Ce=y1(Q0.relativeLuminance2(pe,me,we),Q0.relativeLuminance2(St,Ut,ne));return(pe<<24|me<<16|we<<8|255)>>>0}e.reduceLuminance=u;function T(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=y1(Q0.relativeLuminance2(pe,me,we),Q0.relativeLuminance2(St,Ut,ne));for(;Ce>>0}e.increaseLuminance=T;function $(K){return[K>>24&255,K>>16&255,K>>8&255,K&255]}e.toChannels=$})(PT||={});function mx(e){let t=e.toString(16);return t.length<2?"0"+t:t}function y1(e,t){return e1){let Ut=this._getJoinedRanges(u,K,$,t,T);for(let ne=0;ne1){let St=this._getJoinedRanges(u,K,$,t,T);for(let Ut=0;Ut=on,Xn=Sr,_i=this._workCell;if(me.length>0&&Sr===me[0][0]&&Cn){let Hn=me.shift(),Qa=this._isCellInSelection(Hn[0],r);for(rn=Hn[0]+1;rn=Hn[1],Cn?(nn=!0,_i=new _7t(this._workCell,t.translateToString(!0,Hn[0],Hn[1]),Hn[1]-Hn[0]),Xn=Hn[1]-1,Dr=_i.getWidth()):on=Hn[1]}let ta=this._isCellInSelection(Sr,r),va=u&&Sr===K,_a=_r&&Sr>=Ut&&Sr<=ne,qi=!1;this._decorationService.forEachDecorationAtCell(Sr,r,void 0,Hn=>{qi=!0});let Bi=_i.getChars()||h_;if(Bi===" "&&(_i.isUnderline()||_i.isOverline())&&(Bi=" "),Vn=Dr*yt-St.get(Bi,_i.isBold(),_i.isItalic()),!Ve)Ve=this._document.createElement("span");else if(kr&&(ta&&Br||!ta&&!Br&&_i.bg===Lr)&&(ta&&Br&&we.selectionForeground||_i.fg===Mr)&&_i.extended.ext===tn&&_a===Dn&&Vn===Mn&&!va&&!nn&&!qi&&Cn){_i.isInvisible()?It+=h_:It+=Bi,kr++;continue}else kr&&(Ve.textContent=It),Ve=this._document.createElement("span"),kr=0,It="";if(Lr=_i.bg,Mr=_i.fg,tn=_i.extended.ext,Dn=_a,Mn=Vn,Br=ta,nn&&K>=Sr&&K<=Xn&&(K=Sr),!this._coreService.isCursorHidden&&va&&this._coreService.isCursorInitialized){if(pr.push("xterm-cursor"),this._coreBrowserService.isFocused)ct&&pr.push("xterm-cursor-blink"),pr.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":pr.push("xterm-cursor-outline");break;case"block":pr.push("xterm-cursor-block");break;case"bar":pr.push("xterm-cursor-bar");break;case"underline":pr.push("xterm-cursor-underline");break}}if(_i.isBold()&&pr.push("xterm-bold"),_i.isItalic()&&pr.push("xterm-italic"),_i.isDim()&&pr.push("xterm-dim"),_i.isInvisible()?It=h_:It=_i.getChars()||h_,_i.isUnderline()&&(pr.push(`xterm-underline-${_i.extended.underlineStyle}`),It===" "&&(It=" "),!_i.isUnderlineColorDefault()))if(_i.isUnderlineColorRGB())Ve.style.textDecorationColor=`rgb(${p4.toColorRGB(_i.getUnderlineColor()).join(",")})`;else{let Hn=_i.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&_i.isBold()&&Hn<8&&(Hn+=8),Ve.style.textDecorationColor=we.ansi[Hn].css}_i.isOverline()&&(pr.push("xterm-overline"),It===" "&&(It=" ")),_i.isStrikethrough()&&pr.push("xterm-strikethrough"),_a&&(Ve.style.textDecoration="underline");let Xi=_i.getFgColor(),Yn=_i.getFgColorMode(),hi=_i.getBgColor(),aa=_i.getBgColorMode(),io=!!_i.isInverse();if(io){let Hn=Xi;Xi=hi,hi=Hn;let Qa=Yn;Yn=aa,aa=Qa}let oo,xa,Ur=!1;this._decorationService.forEachDecorationAtCell(Sr,r,void 0,Hn=>{Hn.options.layer!=="top"&&Ur||(Hn.backgroundColorRGB&&(aa=50331648,hi=Hn.backgroundColorRGB.rgba>>8&16777215,oo=Hn.backgroundColorRGB),Hn.foregroundColorRGB&&(Yn=50331648,Xi=Hn.foregroundColorRGB.rgba>>8&16777215,xa=Hn.foregroundColorRGB),Ur=Hn.options.layer==="top")}),!Ur&&ta&&(oo=this._coreBrowserService.isFocused?we.selectionBackgroundOpaque:we.selectionInactiveBackgroundOpaque,hi=oo.rgba>>8&16777215,aa=50331648,Ur=!0,we.selectionForeground&&(Yn=50331648,Xi=we.selectionForeground.rgba>>8&16777215,xa=we.selectionForeground)),Ur&&pr.push("xterm-decoration-top");let Sn;switch(aa){case 16777216:case 33554432:Sn=we.ansi[hi],pr.push(`xterm-bg-${hi}`);break;case 50331648:Sn=kp.toColor(hi>>16,hi>>8&255,hi&255),this._addStyle(Ve,`background-color:#${XF((hi>>>0).toString(16),"0",6)}`);break;case 0:default:io?(Sn=we.foreground,pr.push("xterm-bg-257")):Sn=we.background}switch(oo||_i.isDim()&&(oo=Zd.multiplyOpacity(Sn,.5)),Yn){case 16777216:case 33554432:_i.isBold()&&Xi<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Xi+=8),this._applyMinimumContrast(Ve,Sn,we.ansi[Xi],_i,oo,void 0)||pr.push(`xterm-fg-${Xi}`);break;case 50331648:let Hn=kp.toColor(Xi>>16&255,Xi>>8&255,Xi&255);this._applyMinimumContrast(Ve,Sn,Hn,_i,oo,xa)||this._addStyle(Ve,`color:#${XF(Xi.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(Ve,Sn,we.foreground,_i,oo,xa)||io&&pr.push("xterm-fg-257")}pr.length&&(Ve.className=pr.join(" "),pr.length=0),!va&&!nn&&!qi&&Cn?kr++:Ve.textContent=It,Vn!==this.defaultSpacing&&(Ve.style.letterSpacing=`${Vn}px`),pe.push(Ve),Sr=Xn}return Ve&&kr&&(Ve.textContent=It),pe}_applyMinimumContrast(t,r,u,T,$,K){if(this._optionsService.rawOptions.minimumContrastRatio===1||w7t(T.getCode()))return!1;let ct=this._getContrastCache(T),yt;if(!$&&!K&&(yt=ct.getColor(r.rgba,u.rgba)),yt===void 0){let St=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);yt=Zd.ensureContrastRatio($||r,K||u,St),ct.setColor(($||r).rgba,(K||u).rgba,yt??null)}return yt?(this._addStyle(t,`color:${yt.css}`),!0):!1}_getContrastCache(t){return t.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(t,r){t.setAttribute("style",`${t.getAttribute("style")||""}${r};`)}_isCellInSelection(t,r){let u=this._selectionStart,T=this._selectionEnd;return!u||!T?!1:this._columnSelectMode?u[0]<=T[0]?t>=u[0]&&r>=u[1]&&t=u[1]&&t>=T[0]&&r<=T[1]:r>u[1]&&r=u[0]&&t=u[0]}};N9=Vf([fl(1,nV),fl(2,sm),fl(3,Z1),fl(4,Kx),fl(5,m4),fl(6,Q2)],N9);function XF(e,t,r){for(;e.length0&&(this._flat[T]=ct),ct}let $=t;r&&($+="B"),u&&($+="I");let K=this._holey.get($);if(K===void 0){let ct=0;r&&(ct|=1),u&&(ct|=2),K=this._measure(t,ct),K>0&&this._holey.set($,K)}return K}_measure(t,r){let u=this._measureElements[r];return u.textContent=t.repeat(32),u.offsetWidth/32}},S7t=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,r,u,T=!1){if(this.selectionStart=r,this.selectionEnd=u,!r||!u||r[0]===u[0]&&r[1]===u[1]){this.clear();return}let $=t.buffers.active.ydisp,K=r[1]-$,ct=u[1]-$,yt=Math.max(K,0),St=Math.min(ct,t.rows-1);if(yt>=t.rows||St<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=T,this.viewportStartRow=K,this.viewportEndRow=ct,this.viewportCappedStartRow=yt,this.viewportCappedEndRow=St,this.startCol=r[0],this.endCol=u[0]}isCellSelected(t,r,u){return this.hasSelection?(u-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?r>=this.startCol&&u>=this.viewportCappedStartRow&&r=this.viewportCappedStartRow&&r>=this.endCol&&u<=this.viewportCappedEndRow:u>this.viewportStartRow&&u=this.startCol&&r=this.startCol):!1}};function C7t(){return new S7t}var oM="xterm-dom-renderer-owner-",cg="xterm-rows",oT="xterm-fg-",JF="xterm-bg-",Z3="xterm-focus",sT="xterm-selection",A7t=1,j9=class extends Su{constructor(t,r,u,T,$,K,ct,yt,St,Ut,ne,pe,me,we){super(),this._terminal=t,this._document=r,this._element=u,this._screenElement=T,this._viewportElement=$,this._helperContainer=K,this._linkifier2=ct,this._charSizeService=St,this._optionsService=Ut,this._bufferService=ne,this._coreService=pe,this._coreBrowserService=me,this._themeService=we,this._terminalClass=A7t++,this._rowElements=[],this._selectionRenderModel=C7t(),this.onRequestRedraw=this._register(new Is).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(cg),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(sT),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=k7t(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(Ce=>this._injectCss(Ce))),this._injectCss(this._themeService.colors),this._rowFactory=yt.createInstance(N9,document),this._element.classList.add(oM+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(Ce=>this._handleLinkHover(Ce))),this._register(this._linkifier2.onHideLinkUnderline(Ce=>this._handleLinkLeave(Ce))),this._register(uf(()=>{this._element.classList.remove(oM+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new T7t(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let t=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*t,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*t),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/t),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/t),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let u of this._rowElements)u.style.width=`${this.dimensions.css.canvas.width}px`,u.style.height=`${this.dimensions.css.cell.height}px`,u.style.lineHeight=`${this.dimensions.css.cell.height}px`,u.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let r=`${this._terminalSelector} .${cg} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=r,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(t){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let r=`${this._terminalSelector} .${cg} { pointer-events: none; color: ${t.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;r+=`${this._terminalSelector} .${cg} .xterm-dim { color: ${Zd.multiplyOpacity(t.foreground,.5).css};}`,r+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let u=`blink_underline_${this._terminalClass}`,T=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;r+=`@keyframes ${u} { 50% { border-bottom-style: hidden; }}`,r+=`@keyframes ${T} { 50% { box-shadow: none; }}`,r+=`@keyframes ${$} { 0% { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css}; } 50% { background-color: inherit; color: ${t.cursor.css}; }}`,r+=`${this._terminalSelector} .${cg}.${Z3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${u} 1s step-end infinite;}${this._terminalSelector} .${cg}.${Z3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${T} 1s step-end infinite;}${this._terminalSelector} .${cg}.${Z3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-block { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css};}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${t.cursor.css} !important; color: ${t.cursorAccent.css} !important;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${t.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${t.cursor.css} inset;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${t.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,r+=`${this._terminalSelector} .${sT} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${sT} div { position: absolute; background-color: ${t.selectionBackgroundOpaque.css};}${this._terminalSelector} .${sT} div { position: absolute; background-color: ${t.selectionInactiveBackgroundOpaque.css};}`;for(let[K,ct]of t.ansi.entries())r+=`${this._terminalSelector} .${oT}${K} { color: ${ct.css}; }${this._terminalSelector} .${oT}${K}.xterm-dim { color: ${Zd.multiplyOpacity(ct,.5).css}; }${this._terminalSelector} .${JF}${K} { background-color: ${ct.css}; }`;r+=`${this._terminalSelector} .${oT}257 { color: ${Zd.opaque(t.background).css}; }${this._terminalSelector} .${oT}257.xterm-dim { color: ${Zd.multiplyOpacity(Zd.opaque(t.background),.5).css}; }${this._terminalSelector} .${JF}257 { background-color: ${t.foreground.css}; }`,this._themeStyleElement.textContent=r}_setDefaultSpacing(){let t=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${t}px`,this._rowFactory.defaultSpacing=t}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(t,r){for(let u=this._rowElements.length;u<=r;u++){let T=this._document.createElement("div");this._rowContainer.appendChild(T),this._rowElements.push(T)}for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(t,r){this._refreshRowElements(t,r),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Z3),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Z3),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(t,r,u){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(t,r,u),this.renderRows(0,this._bufferService.rows-1),!t||!r||(this._selectionRenderModel.update(this._terminal,t,r,u),!this._selectionRenderModel.hasSelection))return;let T=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,ct=this._selectionRenderModel.viewportCappedEndRow,yt=this._document.createDocumentFragment();if(u){let St=t[0]>r[0];yt.appendChild(this._createSelectionElement(K,St?r[0]:t[0],St?t[0]:r[0],ct-K+1))}else{let St=T===K?t[0]:0,Ut=K===$?r[0]:this._bufferService.cols;yt.appendChild(this._createSelectionElement(K,St,Ut));let ne=ct-K-1;if(yt.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,ne)),K!==ct){let pe=$===ct?r[0]:this._bufferService.cols;yt.appendChild(this._createSelectionElement(ct,0,pe))}}this._selectionContainer.appendChild(yt)}_createSelectionElement(t,r,u,T=1){let $=this._document.createElement("div"),K=r*this.dimensions.css.cell.width,ct=this.dimensions.css.cell.width*(u-r);return K+ct>this.dimensions.css.canvas.width&&(ct=this.dimensions.css.canvas.width-K),$.style.height=`${T*this.dimensions.css.cell.height}px`,$.style.top=`${t*this.dimensions.css.cell.height}px`,$.style.left=`${K}px`,$.style.width=`${ct}px`,$}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let t of this._rowElements)t.replaceChildren()}renderRows(t,r){let u=this._bufferService.buffer,T=u.ybase+u.y,$=Math.min(u.x,this._bufferService.cols-1),K=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,ct=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,yt=this._optionsService.rawOptions.cursorInactiveStyle;for(let St=t;St<=r;St++){let Ut=St+u.ydisp,ne=this._rowElements[St],pe=u.lines.get(Ut);if(!ne||!pe)break;ne.replaceChildren(...this._rowFactory.createRow(pe,Ut,Ut===T,ct,yt,$,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${oM}${this._terminalClass}`}_handleLinkHover(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)}_handleLinkLeave(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)}_setCellUnderline(t,r,u,T,$,K){u<0&&(t=0),T<0&&(r=0);let ct=this._bufferService.rows-1;u=Math.max(Math.min(u,ct),0),T=Math.max(Math.min(T,ct),0),$=Math.min($,this._bufferService.cols);let yt=this._bufferService.buffer,St=yt.ybase+yt.y,Ut=Math.min(yt.x,$-1),ne=this._optionsService.rawOptions.cursorBlink,pe=this._optionsService.rawOptions.cursorStyle,me=this._optionsService.rawOptions.cursorInactiveStyle;for(let we=u;we<=T;++we){let Ce=we+yt.ydisp,Ve=this._rowElements[we],kr=yt.lines.get(Ce);if(!Ve||!kr)break;Ve.replaceChildren(...this._rowFactory.createRow(kr,Ce,Ce===St,pe,me,Ut,ne,this.dimensions.css.cell.width,this._widthCache,K?we===u?t:0:-1,K?(we===T?r:$)-1:-1))}}};j9=Vf([fl(7,pL),fl(8,XS),fl(9,sm),fl(10,om),fl(11,Kx),fl(12,Z1),fl(13,Q2)],j9);var U9=class extends Su{constructor(t,r,u){super(),this._optionsService=u,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Is),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new E7t(this._optionsService))}catch{this._measureStrategy=this._register(new M7t(t,r,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let t=this._measureStrategy.measure();(t.width!==this.width||t.height!==this.height)&&(this.width=t.width,this.height=t.height,this._onCharSizeChange.fire())}};U9=Vf([fl(2,sm)],U9);var wV=class extends Su{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},M7t=class extends wV{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},E7t=class extends wV{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let r=this._ctx.measureText("W");if(!("width"in r&&"fontBoundingBoxAscent"in r&&"fontBoundingBoxDescent"in r))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}},L7t=class extends Su{constructor(t,r,u){super(),this._textarea=t,this._window=r,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new P7t(this._window)),this._onDprChange=this._register(new Is),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Is),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(T=>this._screenDprMonitor.setWindow(T))),this._register(b0.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Uc(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Uc(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(t){this._window!==t&&(this._window=t,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},P7t=class extends Su{constructor(t){super(),this._parentWindow=t,this._windowResizeListener=this._register(new G2),this._onDprChange=this._register(new Is),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(uf(()=>this.clearListener()))}setWindow(t){this._parentWindow=t,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Uc(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},I7t=class extends Su{constructor(){super(),this.linkProviders=[],this._register(uf(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function wL(e,t,r){let u=r.getBoundingClientRect(),T=e.getComputedStyle(r),$=parseInt(T.getPropertyValue("padding-left")),K=parseInt(T.getPropertyValue("padding-top"));return[t.clientX-u.left-$,t.clientY-u.top-K]}function D7t(e,t,r,u,T,$,K,ct,yt){if(!$)return;let St=wL(e,t,r);if(St)return St[0]=Math.ceil((St[0]+(yt?K/2:0))/K),St[1]=Math.ceil(St[1]/ct),St[0]=Math.min(Math.max(St[0],1),u+(yt?1:0)),St[1]=Math.min(Math.max(St[1],1),T),St}var $9=class{constructor(t,r){this._renderService=t,this._charSizeService=r}getCoords(t,r,u,T,$){return D7t(window,t,r,u,T,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,$)}getMouseReportCoords(t,r){let u=wL(window,t,r);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};$9=Vf([fl(0,K1),fl(1,XS)],$9);var z7t=class{constructor(t,r){this._renderCallback=t,this._coreBrowserService=r,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(t){return this._refreshCallbacks.push(t),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(t,r,u){this._rowCount=u,t=t!==void 0?t:0,r=r!==void 0?r:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,r):r,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let t=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,r),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let t of this._refreshCallbacks)t(0);this._refreshCallbacks=[]}},kV={};VCt(kV,{getSafariVersion:()=>B7t,isChromeOS:()=>AV,isFirefox:()=>TV,isIpad:()=>R7t,isIphone:()=>F7t,isLegacyEdge:()=>O7t,isLinux:()=>kL,isMac:()=>uS,isNode:()=>JS,isSafari:()=>SV,isWindows:()=>CV});var JS=typeof process<"u"&&"title"in process,g4=JS?"node":navigator.userAgent,v4=JS?"node":navigator.platform,TV=g4.includes("Firefox"),O7t=g4.includes("Edge"),SV=/^((?!chrome|android).)*safari/i.test(g4);function B7t(){if(!SV)return 0;let e=g4.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var uS=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(v4),R7t=v4==="iPad",F7t=v4==="iPhone",CV=["Windows","Win16","Win32","WinCE"].includes(v4),kL=v4.indexOf("Linux")>=0,AV=/\bCrOS\b/.test(g4),MV=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._iT){u-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-t))}ms`),this._start();return}u=T}this.clear()}},N7t=class extends MV{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let r=performance.now()+t;return{timeRemaining:()=>Math.max(0,r-performance.now())}}},j7t=class extends MV{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},hS=!JS&&"requestIdleCallback"in window?j7t:N7t,U7t=class{constructor(){this._queue=new hS}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},H9=class extends Su{constructor(t,r,u,T,$,K,ct,yt,St){super(),this._rowCount=t,this._optionsService=u,this._charSizeService=T,this._coreService=$,this._coreBrowserService=yt,this._renderer=this._register(new G2),this._pausedResizeTask=new U7t,this._observerDisposable=this._register(new G2),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Is),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Is),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Is),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Is),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new z7t((Ut,ne)=>this._renderRows(Ut,ne),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new $7t(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(uf(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(ct.onResize(()=>this._fullRefresh())),this._register(ct.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(K.onDecorationRegistered(()=>this._fullRefresh())),this._register(K.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(ct.cols,ct.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(ct.buffer.y,ct.buffer.y,!0))),this._register(St.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,r),this._register(this._coreBrowserService.onWindowChange(Ut=>this._registerIntersectionObserver(Ut,r)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(t,r){if("IntersectionObserver"in t){let u=new t.IntersectionObserver(T=>this._handleIntersectionChange(T[T.length-1]),{threshold:0});u.observe(r),this._observerDisposable.value=uf(()=>u.disconnect())}}_handleIntersectionChange(t){this._isPaused=t.isIntersecting===void 0?t.intersectionRatio===0:!t.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(t,r,u=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,r);return}let T=this._syncOutputHandler.flush();T&&(t=Math.min(t,T.start),r=Math.max(r,T.end)),u||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(t,r,this._rowCount)}_renderRows(t,r){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,r);return}t=Math.min(t,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(t,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:t,end:r}),this._onRender.fire({start:t,end:r}),this._isNextRenderRedrawOnly=!0}}resize(t,r){this._rowCount=r,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(t){this._renderer.value=t,this._renderer.value&&(this._renderer.value.onRequestRedraw(r=>this.refreshRows(r.start,r.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(t){return this._renderDebouncer.addRefreshCallback(t)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(t,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(t,r)):this._renderer.value.handleResize(t,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(t,r,u){this._selectionState.start=t,this._selectionState.end=r,this._selectionState.columnSelectMode=u,this._renderer.value?.handleSelectionChanged(t,r,u)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};H9=Vf([fl(2,sm),fl(3,XS),fl(4,Kx),fl(5,m4),fl(6,om),fl(7,Z1),fl(8,Q2)],H9);var $7t=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function H7t(e,t,r,u){let T=r.buffer.x,$=r.buffer.y;if(!r.buffer.hasScrollback)return q7t(T,$,e,t,r,u)+QS($,t,r,u)+G7t(T,$,e,t,r,u);let K;if($===t)return K=T>e?"D":"C",X5(Math.abs(T-e),Y5(K,u));K=$>t?"D":"C";let ct=Math.abs($-t),yt=W7t($>t?e:T,r)+(ct-1)*r.cols+1+V7t($>t?T:e);return X5(yt,Y5(K,u))}function V7t(e,t){return e-1}function W7t(e,t){return t.cols-e}function q7t(e,t,r,u,T,$){return QS(t,u,T,$).length===0?"":X5(LV(e,t,e,t-Vx(t,T),!1,T).length,Y5("D",$))}function QS(e,t,r,u){let T=e-Vx(e,r),$=t-Vx(t,r),K=Math.abs(T-$)-Z7t(e,t,r);return X5(K,Y5(EV(e,t),u))}function G7t(e,t,r,u,T,$){let K;QS(t,u,T,$).length>0?K=u-Vx(u,T):K=t;let ct=u,yt=K7t(e,t,r,u,T,$);return X5(LV(e,K,r,ct,yt==="C",T).length,Y5(yt,$))}function Z7t(e,t,r){let u=0,T=e-Vx(e,r),$=t-Vx(t,r);for(let K=0;K=0&&e0?K=u-Vx(u,T):K=t,e=r&&Kt?"A":"B"}function LV(e,t,r,u,T,$){let K=e,ct=t,yt="";for(;(K!==r||ct!==u)&&ct>=0&&ct<$.buffer.lines.length;)K+=T?1:-1,T&&K>$.cols-1?(yt+=$.buffer.translateBufferLineToString(ct,!1,e,K),K=0,e=0,ct++):!T&&K<0&&(yt+=$.buffer.translateBufferLineToString(ct,!1,0,e+1),K=$.cols-1,e=K,ct--);return yt+$.buffer.translateBufferLineToString(ct,!1,e,K)}function Y5(e,t){let r=t?"O":"[";return Ho.ESC+r+e}function X5(e,t){e=Math.floor(e);let r="";for(let u=0;uthis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function QF(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var sM=50,X7t=15,J7t=50,Q7t=500,tMt=" ",eMt=new RegExp(tMt,"g"),V9=class extends Su{constructor(t,r,u,T,$,K,ct,yt,St){super(),this._element=t,this._screenElement=r,this._linkifier=u,this._bufferService=T,this._coreService=$,this._mouseService=K,this._optionsService=ct,this._renderService=yt,this._coreBrowserService=St,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new bg,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Is),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Is),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Is),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Is),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Ut=>this._handleMouseMove(Ut),this._mouseUpListener=Ut=>this._handleMouseUp(Ut),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(Ut=>this._handleTrim(Ut)),this._register(this._bufferService.buffers.onBufferActivate(Ut=>this._handleBufferActivate(Ut))),this.enable(),this._model=new Y7t(this._bufferService),this._activeSelectionMode=0,this._register(uf(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(Ut=>{Ut.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let t=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!t||!r?!1:t[0]!==r[0]||t[1]!==r[1]}get selectionText(){let t=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;if(!t||!r)return"";let u=this._bufferService.buffer,T=[];if(this._activeSelectionMode===3){if(t[0]===r[0])return"";let $=t[0]$.replace(eMt," ")).join(CV?`\r +`))}},yAt=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},_At=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},xAt=0,rM=class{constructor(t){this.value=t,this.id=xAt++}},bAt=2,wAt,Is=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new gAt(t?.onListenerError??AT,this._options?.leakWarningThreshold??mAt):void 0,this._perfMon=this._options?._profName?new pAt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,r,u)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ct=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ct);let yt=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],St=new _At(`${ct}. HINT: Stack shows most frequent listener (${yt[1]}-times)`,yt[0]);return(this._options?.onListenerError||AT)(St),Su.None}if(this._disposed)return Su.None;r&&(t=t.bind(r));let T=new rM(t),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(T.stack=vAt.create(),$=this._leakageMon.check(T.stack,this._size+1)),this._listeners?this._listeners instanceof rM?(this._deliveryQueue??=new kAt,this._listeners=[this._listeners,T]):this._listeners.push(T):(this._options?.onWillAddFirstListener?.(this),this._listeners=T,this._options?.onDidAddFirstListener?.(this)),this._size++;let K=uf(()=>{$?.(),this._removeListener(T)});return u instanceof m_?u.add(K):Array.isArray(u)&&u.push(K),K},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,u=r.indexOf(t);if(u===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[u]=void 0;let T=this._deliveryQueue.current===this;if(this._size*bAt<=r.length){let $=0;for(let K=0;K0}},kAt=class{constructor(){this.i=-1,this.end=0}enqueue(t,r,u){this.i=0,this.end=u,this.current=t,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},M9=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Is,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Is,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let u=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(u,t),this._onDidChangeZoomLevel.fire(u)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let u=this.getWindowId(r);this.mapWindowIdToFullScreen.set(u,t),this._onDidChangeFullscreen.fire(u)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};M9.INSTANCE=new M9;var gL=M9;function TAt(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}gL.INSTANCE.onDidChangeZoomLevel;function SAt(e){return gL.INSTANCE.getZoomFactor(e)}gL.INSTANCE.onDidChangeFullscreen;var tw=typeof navigator=="object"?navigator.userAgent:"",E9=tw.indexOf("Firefox")>=0,CAt=tw.indexOf("AppleWebKit")>=0,vL=tw.indexOf("Chrome")>=0,AAt=!vL&&tw.indexOf("Safari")>=0;tw.indexOf("Electron/")>=0;tw.indexOf("Android")>=0;var nM=!1;if(typeof F1.matchMedia=="function"){let e=F1.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=F1.matchMedia("(display-mode: fullscreen)");nM=e.matches,TAt(F1,e,({matches:r})=>{nM&&t.matches||(nM=r)})}var C2="en",L9=!1,P9=!1,MT=!1,fV=!1,nT,ET=C2,BF=C2,MAt,S1,Bx=globalThis,Vm;typeof Bx.vscode<"u"&&typeof Bx.vscode.process<"u"?Vm=Bx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Vm=process);var EAt=typeof Vm?.versions?.electron=="string",LAt=EAt&&Vm?.type==="renderer";if(typeof Vm=="object"){L9=Vm.platform==="win32",P9=Vm.platform==="darwin",MT=Vm.platform==="linux",MT&&Vm.env.SNAP&&Vm.env.SNAP_REVISION,Vm.env.CI||Vm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,nT=C2,ET=C2;let e=Vm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);nT=t.userLocale,BF=t.osLocale,ET=t.resolvedLanguage||C2,MAt=t.languagePack?.translationsConfigFile}catch{}fV=!0}else typeof navigator=="object"&&!LAt?(S1=navigator.userAgent,L9=S1.indexOf("Windows")>=0,P9=S1.indexOf("Macintosh")>=0,(S1.indexOf("Macintosh")>=0||S1.indexOf("iPad")>=0||S1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,MT=S1.indexOf("Linux")>=0,S1?.indexOf("Mobi")>=0,ET=globalThis._VSCODE_NLS_LANGUAGE||C2,nT=navigator.language.toLowerCase(),BF=nT):console.error("Unable to resolve platform.");var pV=L9,Pv=P9,PAt=MT,RF=fV,Ov=S1,$y=ET,IAt;(e=>{function t(){return $y}e.value=t;function r(){return $y.length===2?$y==="en":$y.length>=3?$y[0]==="e"&&$y[1]==="n"&&$y[2]==="-":!1}e.isDefaultVariant=r;function u(){return $y==="en"}e.isDefault=u})(IAt||={});var DAt=typeof Bx.postMessage=="function"&&!Bx.importScripts;(()=>{if(DAt){let e=[];Bx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let u=0,T=e.length;u{let u=++t;e.push({id:u,callback:r}),Bx.postMessage({vscodeScheduleAsyncWork:u},"*")}}return e=>setTimeout(e)})();var zAt=!!(Ov&&Ov.indexOf("Chrome")>=0);Ov&&Ov.indexOf("Firefox")>=0;!zAt&&Ov&&Ov.indexOf("Safari")>=0;Ov&&Ov.indexOf("Edg/")>=0;Ov&&Ov.indexOf("Android")>=0;var _2=typeof navigator=="object"?navigator:{};RF||document.queryCommandSupported&&document.queryCommandSupported("copy")||_2&&_2.clipboard&&_2.clipboard.writeText,RF||_2&&_2.clipboard&&_2.clipboard.readText;var yL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,r){this._keyCodeToStr[t]=r,this._strToKeyCode[r.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},iM=new yL,FF=new yL,NF=new yL,OAt=new Array(230),mV;(e=>{function t(ct){return iM.keyCodeToStr(ct)}e.toString=t;function r(ct){return iM.strToKeyCode(ct)}e.fromString=r;function u(ct){return FF.keyCodeToStr(ct)}e.toUserSettingsUS=u;function T(ct){return NF.keyCodeToStr(ct)}e.toUserSettingsGeneral=T;function $(ct){return FF.strToKeyCode(ct)||NF.strToKeyCode(ct)}e.fromUserSettings=$;function K(ct){if(ct>=98&&ct<=113)return null;switch(ct){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return iM.keyCodeToStr(ct)}e.toElectronAccelerator=K})(mV||={});var BAt=class gV{constructor(t,r,u,T,$){this.ctrlKey=t,this.shiftKey=r,this.altKey=u,this.metaKey=T,this.keyCode=$}equals(t){return t instanceof gV&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",u=this.altKey?"1":"0",T=this.metaKey?"1":"0";return`K${t}${r}${u}${T}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new RAt([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},RAt=class{constructor(e){if(e.length===0)throw lAt("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t{function t(r){return r===e.None||r===e.Cancelled||r instanceof qAt?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:b0.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:vV})})(WAt||={});var qAt=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?vV:(this._emitter||(this._emitter=new Is),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},_L=class{constructor(t,r){this._isDisposed=!1,this._token=-1,typeof t=="function"&&typeof r=="number"&&this.setIfNotSet(t,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(t,r){if(this._isDisposed)throw new k9("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,t()},r)}setIfNotSet(t,r){if(this._isDisposed)throw new k9("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,t()},r))}},GAt=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(t,r,u=globalThis){if(this.isDisposed)throw new k9("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let T=u.setInterval(()=>{t()},r);this.disposable=uf(()=>{u.clearInterval(T),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},ZAt;(e=>{async function t(u){let T,$=await Promise.all(u.map(K=>K.then(ct=>ct,ct=>{T||(T=ct)})));if(typeof T<"u")throw T;return $}e.settled=t;function r(u){return new Promise(async(T,$)=>{try{await u(T,$)}catch(K){$(K)}})}e.withAsyncBody=r})(ZAt||={});var HF=class hg{static fromArray(t){return new hg(r=>{r.emitMany(t)})}static fromPromise(t){return new hg(async r=>{r.emitMany(await t)})}static fromPromises(t){return new hg(async r=>{await Promise.all(t.map(async u=>r.emitOne(await u)))})}static merge(t){return new hg(async r=>{await Promise.all(t.map(async u=>{for await(let T of u)r.emitOne(T)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Is,queueMicrotask(async()=>{let u={emitOne:T=>this.emitOne(T),emitMany:T=>this.emitMany(T),reject:T=>this.reject(T)};try{await Promise.resolve(t(u)),this.resolve()}catch(T){this.reject(T)}finally{u.emitOne=void 0,u.emitMany=void 0,u.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new hg(async u=>{for await(let T of t)u.emitOne(r(T))})}map(t){return hg.map(this,t)}static filter(t,r){return new hg(async u=>{for await(let T of t)r(T)&&u.emitOne(T)})}filter(t){return hg.filter(this,t)}static coalesce(t){return hg.filter(t,r=>!!r)}coalesce(){return hg.coalesce(this)}static async toPromise(t){let r=[];for await(let u of t)r.push(u);return r}toPromise(){return hg.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};HF.EMPTY=HF.fromArray([]);var{getWindow:Mv,getWindowId:KAt,onDidRegisterWindow:YAt}=function(){let e=new Map,t={window:F1,disposables:new m_};e.set(F1.vscodeWindowId,t);let r=new Is,u=new Is,T=new Is;function $(K,ct){return(typeof K=="number"?e.get(K):void 0)??(ct?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:T.event,onDidUnregisterWindow:u.event,registerWindow(K){if(e.has(K.vscodeWindowId))return Su.None;let ct=new m_,yt={window:K,disposables:ct.add(new m_)};return e.set(K.vscodeWindowId,yt),ct.add(uf(()=>{e.delete(K.vscodeWindowId),u.fire(K)})),ct.add(Uc(K,t0.BEFORE_UNLOAD,()=>{T.fire(K)})),r.fire(yt),ct},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(K){return K.vscodeWindowId},hasWindow(K){return e.has(K)},getWindowById:$,getWindow(K){let ct=K;if(ct?.ownerDocument?.defaultView)return ct.ownerDocument.defaultView.window;let yt=K;return yt?.view?yt.view.window:F1},getDocument(K){return Mv(K).document}}}(),XAt=class{constructor(t,r,u,T){this._node=t,this._type=r,this._handler=u,this._options=T||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Uc(e,t,r,u){return new XAt(e,t,r,u)}var VF=function(e,t,r,u){return Uc(e,t,r,u)},xL,JAt=class extends GAt{constructor(e){super(),this.defaultTarget=e&&Mv(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},WF=class{constructor(t,r=0){this._runner=t,this.priority=r,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(t){AT(t)}}static sort(t,r){return r.priority-t.priority}};(function(){let e=new Map,t=new Map,r=new Map,u=new Map,T=$=>{r.set($,!1);let K=e.get($)??[];for(t.set($,K),e.set($,[]),u.set($,!0);K.length>0;)K.sort(WF.sort),K.shift().execute();u.set($,!1)};xL=($,K,ct=0)=>{let yt=KAt($),St=new WF(K,ct),Ut=e.get(yt);return Ut||(Ut=[],e.set(yt,Ut)),Ut.push(St),r.get(yt)||(r.set(yt,!0),$.requestAnimationFrame(()=>T(yt))),St}})();function QAt(e){let t=e.getBoundingClientRect(),r=Mv(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var t0={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},t7t=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=bm(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=bm(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=bm(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=bm(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=bm(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=bm(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=bm(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=bm(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=bm(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=bm(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=bm(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=bm(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=bm(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=bm(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function bm(e){return typeof e=="number"?`${e}px`:e}function I5(e){return new t7t(e)}var yV=class{constructor(){this._hooks=new m_,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(t,r){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let u=this._onStopCallback;this._onStopCallback=null,t&&u&&u(r)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(t,r,u,T,$){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=T,this._onStopCallback=$;let K=t;try{t.setPointerCapture(r),this._hooks.add(uf(()=>{try{t.releasePointerCapture(r)}catch{}}))}catch{K=Mv(t)}this._hooks.add(Uc(K,t0.POINTER_MOVE,ct=>{if(ct.buttons!==u){this.stopMonitoring(!0);return}ct.preventDefault(),this._pointerMoveCallback(ct)})),this._hooks.add(Uc(K,t0.POINTER_UP,ct=>this.stopMonitoring(!0)))}};function e7t(e,t,r){let u=null,T=null;if(typeof r.value=="function"?(u="value",T=r.value,T.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(u="get",T=r.get),!T)throw new Error("not supported");let $=`$memoize$${t}`;r[u]=function(...K){return this.hasOwnProperty($)||Object.defineProperty(this,$,{configurable:!1,enumerable:!1,writable:!1,value:T.apply(this,K)}),this[$]}}var _v;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(_v||={});var u5=class D0 extends Su{constructor(){super(),this.dispatched=!1,this.targets=new OF,this.ignoreTargets=new OF,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(b0.runAndSubscribe(YAt,({window:t,disposables:r})=>{r.add(Uc(t.document,"touchstart",u=>this.onTouchStart(u),{passive:!1})),r.add(Uc(t.document,"touchend",u=>this.onTouchEnd(t,u))),r.add(Uc(t.document,"touchmove",u=>this.onTouchMove(u),{passive:!1}))},{window:F1,disposables:this._store}))}static addTarget(t){if(!D0.isTouchDevice())return Su.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.targets.push(t);return uf(r)}static ignoreTarget(t){if(!D0.isTouchDevice())return Su.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.ignoreTargets.push(t);return uf(r)}static isTouchDevice(){return"ontouchstart"in F1||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let u=0,T=t.targetTouches.length;u=D0.HOLD_DELAY&&Math.abs(yt.initialPageX-$m(yt.rollingPageX))<30&&Math.abs(yt.initialPageY-$m(yt.rollingPageY))<30){let Ut=this.newGestureEvent(_v.Contextmenu,yt.initialTarget);Ut.pageX=$m(yt.rollingPageX),Ut.pageY=$m(yt.rollingPageY),this.dispatchEvent(Ut)}else if(T===1){let Ut=$m(yt.rollingPageX),ne=$m(yt.rollingPageY),pe=$m(yt.rollingTimestamps)-yt.rollingTimestamps[0],me=Ut-yt.rollingPageX[0],we=ne-yt.rollingPageY[0],Ce=[...this.targets].filter(Ve=>yt.initialTarget instanceof Node&&Ve.contains(yt.initialTarget));this.inertia(t,Ce,u,Math.abs(me)/pe,me>0?1:-1,Ut,Math.abs(we)/pe,we>0?1:-1,ne)}this.dispatchEvent(this.newGestureEvent(_v.End,yt.initialTarget)),delete this.activeTouches[ct.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let u=document.createEvent("CustomEvent");return u.initEvent(t,!1,!0),u.initialTarget=r,u.tapCount=0,u}dispatchEvent(t){if(t.type===_v.Tap){let r=new Date().getTime(),u=0;r-this._lastSetTapCountTime>D0.CLEAR_TAP_COUNT_TIME?u=1:u=2,this._lastSetTapCountTime=r,t.tapCount=u}else(t.type===_v.Change||t.type===_v.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let u of this.ignoreTargets)if(u.contains(t.initialTarget))return;let r=[];for(let u of this.targets)if(u.contains(t.initialTarget)){let T=0,$=t.initialTarget;for(;$&&$!==u;)T++,$=$.parentElement;r.push([T,u])}r.sort((u,T)=>u[0]-T[0]);for(let[u,T]of r)T.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,u,T,$,K,ct,yt,St){this.handle=xL(t,()=>{let Ut=Date.now(),ne=Ut-u,pe=0,me=0,we=!0;T+=D0.SCROLL_FRICTION*ne,ct+=D0.SCROLL_FRICTION*ne,T>0&&(we=!1,pe=$*T*ne),ct>0&&(we=!1,me=yt*ct*ne);let Ce=this.newGestureEvent(_v.Change);Ce.translationX=pe,Ce.translationY=me,r.forEach(Ve=>Ve.dispatchEvent(Ce)),we||this.inertia(t,r,Ut,T,$,K+pe,ct,yt,St+me)})}onTouchMove(t){let r=Date.now();for(let u=0,T=t.changedTouches.length;u3&&(K.rollingPageX.shift(),K.rollingPageY.shift(),K.rollingTimestamps.shift()),K.rollingPageX.push($.pageX),K.rollingPageY.push($.pageY),K.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};u5.SCROLL_FRICTION=-.005,u5.HOLD_DELAY=700,u5.CLEAR_TAP_COUNT_TIME=400,Vf([e7t],u5,"isTouchDevice",1);var r7t=u5,bL=class extends Su{onclick(t,r){this._register(Uc(t,t0.CLICK,u=>r(new iT(Mv(t),u))))}onmousedown(t,r){this._register(Uc(t,t0.MOUSE_DOWN,u=>r(new iT(Mv(t),u))))}onmouseover(t,r){this._register(Uc(t,t0.MOUSE_OVER,u=>r(new iT(Mv(t),u))))}onmouseleave(t,r){this._register(Uc(t,t0.MOUSE_LEAVE,u=>r(new iT(Mv(t),u))))}onkeydown(t,r){this._register(Uc(t,t0.KEY_DOWN,u=>r(new jF(u))))}onkeyup(t,r){this._register(Uc(t,t0.KEY_UP,u=>r(new jF(u))))}oninput(t,r){this._register(Uc(t,t0.INPUT,r))}onblur(t,r){this._register(Uc(t,t0.BLUR,r))}onfocus(t,r){this._register(Uc(t,t0.FOCUS,r))}onchange(t,r){this._register(Uc(t,t0.CHANGE,r))}ignoreGesture(t){return r7t.ignoreTarget(t)}},qF=11,n7t=class extends bL{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=qF+"px",this.domNode.style.height=qF+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new yV),this._register(VF(this.bgDomNode,t0.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(VF(this.domNode,t0.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new JAt),this._pointerdownScheduleRepeatTimer=this._register(new _L)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Mv(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},i7t=class I9{constructor(t,r,u,T,$,K,ct){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,u=u|0,T=T|0,$=$|0,K=K|0,ct=ct|0),this.rawScrollLeft=T,this.rawScrollTop=ct,r<0&&(r=0),T+r>u&&(T=u-r),T<0&&(T=0),$<0&&($=0),ct+$>K&&(ct=K-$),ct<0&&(ct=0),this.width=r,this.scrollWidth=u,this.scrollLeft=T,this.height=$,this.scrollHeight=K,this.scrollTop=ct}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new I9(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new I9(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let u=this.width!==t.width,T=this.scrollWidth!==t.scrollWidth,$=this.scrollLeft!==t.scrollLeft,K=this.height!==t.height,ct=this.scrollHeight!==t.scrollHeight,yt=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:u,scrollWidthChanged:T,scrollLeftChanged:$,heightChanged:K,scrollHeightChanged:ct,scrollTopChanged:yt}}},a7t=class extends Su{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new i7t(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let u;t?u=new ZF(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):u=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=u}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=ZF.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},GF=class{constructor(t,r,u){this.scrollLeft=t,this.scrollTop=r,this.isDone=u}};function aM(e,t){let r=t-e;return function(u){return e+r*l7t(u)}}function o7t(e,t,r){return function(u){return u2.5*u){let T,$;return t{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(t){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(t?" fade":"")))}},u7t=140,_V=class extends bL{constructor(t){super(),this._lazyRender=t.lazyRender,this._host=t.host,this._scrollable=t.scrollable,this._scrollByPage=t.scrollByPage,this._scrollbarState=t.scrollbarState,this._visibilityController=this._register(new c7t(t.visibility,"visible scrollbar "+t.extraScrollbarClassName,"invisible scrollbar "+t.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new yV),this._shouldRender=!0,this.domNode=I5(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Uc(this.domNode.domNode,t0.POINTER_DOWN,r=>this._domNodePointerDown(r)))}_createArrow(t){let r=this._register(new n7t(t));this.domNode.domNode.appendChild(r.bgDomNode),this.domNode.domNode.appendChild(r.domNode)}_createSlider(t,r,u,T){this.slider=I5(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(t),this.slider.setLeft(r),typeof u=="number"&&this.slider.setWidth(u),typeof T=="number"&&this.slider.setHeight(T),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Uc(this.slider.domNode,t0.POINTER_DOWN,$=>{$.button===0&&($.preventDefault(),this._sliderPointerDown($))})),this.onclick(this.slider.domNode,$=>{$.leftButton&&$.stopPropagation()})}_onElementSize(t){return this._scrollbarState.setVisibleSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(t){return this._scrollbarState.setScrollSize(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(t){return this._scrollbarState.setScrollPosition(t)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(t){t.target===this.domNode.domNode&&this._onPointerDown(t)}delegatePointerDown(t){let r=this.domNode.domNode.getClientRects()[0].top,u=r+this._scrollbarState.getSliderPosition(),T=r+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),$=this._sliderPointerPosition(t);u<=$&&$<=T?t.button===0&&(t.preventDefault(),this._sliderPointerDown(t)):this._onPointerDown(t)}_onPointerDown(t){let r,u;if(t.target===this.domNode.domNode&&typeof t.offsetX=="number"&&typeof t.offsetY=="number")r=t.offsetX,u=t.offsetY;else{let $=QAt(this.domNode.domNode);r=t.pageX-$.left,u=t.pageY-$.top}let T=this._pointerDownRelativePosition(r,u);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(T):this._scrollbarState.getDesiredScrollPositionFromOffset(T)),t.button===0&&(t.preventDefault(),this._sliderPointerDown(t))}_sliderPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let r=this._sliderPointerPosition(t),u=this._sliderOrthogonalPointerPosition(t),T=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,$=>{let K=this._sliderOrthogonalPointerPosition($),ct=Math.abs(K-u);if(pV&&ct>u7t){this._setDesiredScrollPositionNow(T.getScrollPosition());return}let yt=this._sliderPointerPosition($)-r;this._setDesiredScrollPositionNow(T.getDesiredScrollPositionFromDelta(yt))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(t){let r={};this.writeScrollPosition(r,t),this._scrollable.setScrollPositionNow(r)}updateScrollbarSize(t){this._updateScrollbarSize(t),this._scrollbarState.setScrollbarSize(t),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},xV=class z9{constructor(t,r,u,T,$,K){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(u),this._arrowSize=Math.round(t),this._visibleSize=T,this._scrollSize=$,this._scrollPosition=K,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new z9(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,u,T,$){let K=Math.max(0,u-t),ct=Math.max(0,K-2*r),yt=T>0&&T>u;if(!yt)return{computedAvailableSize:Math.round(K),computedIsNeeded:yt,computedSliderSize:Math.round(ct),computedSliderRatio:0,computedSliderPosition:0};let St=Math.round(Math.max(20,Math.floor(u*ct/T))),Ut=(ct-St)/(T-u),ne=$*Ut;return{computedAvailableSize:Math.round(K),computedIsNeeded:yt,computedSliderSize:Math.round(St),computedSliderRatio:Ut,computedSliderPosition:Math.round(ne)}}_refreshComputedValues(){let t=z9._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,u=this._scrollPosition;return r0&&Math.abs(t.deltaY)>0)return 1;let u=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(u+=.25),r){let T=Math.abs(t.deltaX),$=Math.abs(t.deltaY),K=Math.abs(r.deltaX),ct=Math.abs(r.deltaY),yt=Math.max(Math.min(T,K),1),St=Math.max(Math.min($,ct),1),Ut=Math.max(T,K),ne=Math.max($,ct);Ut%yt===0&&ne%St===0&&(u-=.5)}return Math.min(Math.max(u,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};O9.INSTANCE=new O9;var m7t=O9,g7t=class extends bL{constructor(e,t,r){super(),this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Is),this.onWillScroll=this._onWillScroll.event,this._options=y7t(t),this._scrollable=r,this._register(this._scrollable.onScroll(T=>{this._onWillScroll.fire(T),this._onDidScroll(T),this._onScroll.fire(T)}));let u={onMouseWheel:T=>this._onMouseWheel(T),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new d7t(this._scrollable,this._options,u)),this._horizontalScrollbar=this._register(new h7t(this._scrollable,this._options,u)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=I5(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=I5(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=I5(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,T=>this._onMouseOver(T)),this.onmouseleave(this._listenOnDomNode,T=>this._onMouseLeave(T)),this._hideTimeout=this._register(new _L),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Vx(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Pv&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new $F(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Vx(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new $F(r))};this._mouseWheelToDispose.push(Uc(this._listenOnDomNode,t0.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=m7t.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let T=e.deltaY*this._options.mouseWheelScrollSensitivity,$=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&$+T===0?$=T=0:Math.abs(T)>=Math.abs($)?$=0:T=0),this._options.flipAxes&&([T,$]=[$,T]);let K=!Pv&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||K)&&!$&&($=T,T=0),e.browserEvent&&e.browserEvent.altKey&&($=$*this._options.fastScrollSensitivity,T=T*this._options.fastScrollSensitivity);let ct=this._scrollable.getFutureScrollPosition(),yt={};if(T){let St=KF*T,Ut=ct.scrollTop-(St<0?Math.floor(St):Math.ceil(St));this._verticalScrollbar.writeScrollPosition(yt,Ut)}if($){let St=KF*$,Ut=ct.scrollLeft-(St<0?Math.floor(St):Math.ceil(St));this._horizontalScrollbar.writeScrollPosition(yt,Ut)}yt=this._scrollable.validateScrollPosition(yt),(ct.scrollLeft!==yt.scrollLeft||ct.scrollTop!==yt.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(yt):this._scrollable.setScrollPositionNow(yt),r=!0)}let u=r;!u&&this._options.alwaysConsumeMouseWheel&&(u=!0),!u&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(u=!0),u&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,u=r?" left":"",T=t?" top":"",$=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${u}`),this._topShadowDomNode.setClassName(`shadow${T}`),this._topLeftShadowDomNode.setClassName(`shadow${$}${T}${u}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),f7t)}},v7t=class extends g7t{constructor(t,r,u){super(t,r,u)}setScrollPosition(t){t.reuseAnimation?this._scrollable.setScrollPositionSmooth(t,t.reuseAnimation):this._scrollable.setScrollPositionNow(t)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function y7t(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Pv&&(t.className+=" mac"),t}var B9=class extends Su{constructor(t,r,u,T,$,K,ct,yt){super(),this._bufferService=u,this._optionsService=ct,this._renderService=yt,this._onRequestScrollLines=this._register(new Is),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let St=this._register(new a7t({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:Ut=>xL(T.window,Ut)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{St.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new v7t(r,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},St)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register($.onProtocolChange(Ut=>{this._scrollableElement.updateOptions({handleMouseWheel:!(Ut&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(b0.runAndSubscribe(K.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=K.colors.background.css})),t.appendChild(this._scrollableElement.getDomNode()),this._register(uf(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=T.mainDocument.createElement("style"),r.appendChild(this._styleElement),this._register(uf(()=>this._styleElement.remove())),this._register(b0.runAndSubscribe(K.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${K.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${K.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${K.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` +`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(Ut=>this._handleScroll(Ut)))}scrollLines(t){let r=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:r.scrollTop+t*this._renderService.dimensions.css.cell.height})}scrollToLine(t,r){r&&(this._latestYDisp=t),this._scrollableElement.setScrollPosition({reuseAnimation:!r,scrollTop:t*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(t){t!==void 0&&(this._latestYDisp=t),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(t=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,t!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:t*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(t){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let r=Math.round(t.scrollTop/this._renderService.dimensions.css.cell.height),u=r-this._bufferService.buffer.ydisp;u!==0&&(this._latestYDisp=r,this._onRequestScrollLines.fire(u)),this._isHandlingScroll=!1}};B9=Vf([fl(2,om),fl(3,Z1),fl(4,tV),fl(5,Q2),fl(6,sm),fl(7,K1)],B9);var R9=class extends Su{constructor(t,r,u,T,$){super(),this._screenElement=t,this._bufferService=r,this._coreBrowserService=u,this._decorationService=T,this._renderService=$,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(K=>this._removeDecoration(K))),this._register(uf(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let t of this._decorationService.decorations)this._renderDecoration(t);this._dimensionsChanged=!1}_renderDecoration(t){this._refreshStyle(t),this._dimensionsChanged&&this._refreshXPosition(t)}_createElement(t){let r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",t?.options?.layer==="top"),r.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${(t.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let u=t.options.x??0;return u&&u>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(t,r),r}_refreshStyle(t){let r=t.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let u=this._decorationElements.get(t);u||(u=this._createElement(t),t.element=u,this._decorationElements.set(t,u),this._container.appendChild(u),t.onDispose(()=>{this._decorationElements.delete(t),u.remove()})),u.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(u.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=`${(t.options.height||1)*this._renderService.dimensions.css.cell.height}px`,u.style.top=`${r*this._renderService.dimensions.css.cell.height}px`,u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),t.onRenderEmitter.fire(u)}}_refreshXPosition(t,r=t.element){if(!r)return;let u=t.options.x??0;(t.options.anchor||"left")==="right"?r.style.right=u?`${u*this._renderService.dimensions.css.cell.width}px`:"":r.style.left=u?`${u*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(t){this._decorationElements.get(t)?.remove(),this._decorationElements.delete(t),t.dispose()}};R9=Vf([fl(1,om),fl(2,Z1),fl(3,m4),fl(4,K1)],R9);var _7t=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(t){if(t.options.overviewRulerOptions){for(let r of this._zones)if(r.color===t.options.overviewRulerOptions.color&&r.position===t.options.overviewRulerOptions.position){if(this._lineIntersectsZone(r,t.marker.line))return;if(this._lineAdjacentToZone(r,t.marker.line,t.options.overviewRulerOptions.position)){this._addLineToZone(r,t.marker.line);return}}if(this._zonePoolIndex=t.startBufferLine&&r<=t.endBufferLine}_lineAdjacentToZone(t,r,u){return r>=t.startBufferLine-this._linePadding[u||"full"]&&r<=t.endBufferLine+this._linePadding[u||"full"]}_addLineToZone(t,r){t.startBufferLine=Math.min(t.startBufferLine,r),t.endBufferLine=Math.max(t.endBufferLine,r)}},pv={full:0,left:0,center:0,right:0},Hy={full:0,left:0,center:0,right:0},G3={full:0,left:0,center:0,right:0},lS=class extends Su{constructor(t,r,u,T,$,K,ct,yt){super(),this._viewportElement=t,this._screenElement=r,this._bufferService=u,this._decorationService=T,this._renderService=$,this._optionsService=K,this._themeService=ct,this._coreBrowserService=yt,this._colorZoneStore=new _7t,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(uf(()=>this._canvas?.remove()));let St=this._canvas.getContext("2d");if(St)this._ctx=St;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let t=Math.floor((this._canvas.width-1)/3),r=Math.ceil((this._canvas.width-1)/3);Hy.full=this._canvas.width,Hy.left=t,Hy.center=r,Hy.right=t,this._refreshDrawHeightConstants(),G3.full=1,G3.left=1,G3.center=1+Hy.left,G3.right=1+Hy.left+Hy.center}_refreshDrawHeightConstants(){pv.full=Math.round(2*this._coreBrowserService.dpr);let t=this._canvas.height/this._bufferService.buffer.lines.length,r=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);pv.left=r,pv.center=r,pv.right=r}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*pv.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let r of this._decorationService.decorations)this._colorZoneStore.addDecoration(r);this._ctx.lineWidth=1,this._renderRulerOutline();let t=this._colorZoneStore.zones;for(let r of t)r.position!=="full"&&this._renderColorZone(r);for(let r of t)r.position==="full"&&this._renderColorZone(r);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(G3[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-pv[t.position||"full"]/2),Hy[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+pv[t.position||"full"]))}_queueRefresh(t,r){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=r||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};lS=Vf([fl(2,om),fl(3,m4),fl(4,K1),fl(5,sm),fl(6,Q2),fl(7,Z1)],lS);var Ho;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=` +`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(Ho||={});var LT;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(LT||={});var bV;(e=>e.ST=`${Ho.ESC}\\`)(bV||={});var F9=class{constructor(t,r,u,T,$,K){this._textarea=t,this._compositionView=r,this._bufferService=u,this._optionsService=T,this._coreService=$,this._renderService=K,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(t){this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(t){if(this._isComposing||this._isSendingComposition){if(t.keyCode===20||t.keyCode===229||t.keyCode===16||t.keyCode===17||t.keyCode===18)return!1;this._finalizeComposition(!1)}return t.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(t){if(this._compositionView.classList.remove("active"),this._isComposing=!1,t){let r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let u;r.start+=this._dataAlreadySent.length,this._isComposing?u=this._textarea.value.substring(r.start,this._compositionPosition.start):u=this._textarea.value.substring(r.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}},0)}else{this._isSendingComposition=!1;let r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){let t=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let r=this._textarea.value,u=r.replace(t,"");this._dataAlreadySent=u,r.length>t.length?this._coreService.triggerDataEvent(u,!0):r.lengththis.updateCompositionElements(!0),0)}}};F9=Vf([fl(2,om),fl(3,sm),fl(4,Yx),fl(5,K1)],F9);var e0=0,r0=0,n0=0,jf=0,YF={css:"#00000000",rgba:0},kp;(e=>{function t(T,$,K,ct){return ct!==void 0?`#${mx(T)}${mx($)}${mx(K)}${mx(ct)}`:`#${mx(T)}${mx($)}${mx(K)}`}e.toCss=t;function r(T,$,K,ct=255){return(T<<24|$<<16|K<<8|ct)>>>0}e.toRgba=r;function u(T,$,K,ct){return{css:e.toCss(T,$,K,ct),rgba:e.toRgba(T,$,K,ct)}}e.toColor=u})(kp||={});var Zd;(e=>{function t(yt,St){if(jf=(St.rgba&255)/255,jf===1)return{css:St.css,rgba:St.rgba};let Ut=St.rgba>>24&255,ne=St.rgba>>16&255,pe=St.rgba>>8&255,me=yt.rgba>>24&255,we=yt.rgba>>16&255,Ce=yt.rgba>>8&255;e0=me+Math.round((Ut-me)*jf),r0=we+Math.round((ne-we)*jf),n0=Ce+Math.round((pe-Ce)*jf);let Ve=kp.toCss(e0,r0,n0),kr=kp.toRgba(e0,r0,n0);return{css:Ve,rgba:kr}}e.blend=t;function r(yt){return(yt.rgba&255)===255}e.isOpaque=r;function u(yt,St,Ut){let ne=PT.ensureContrastRatio(yt.rgba,St.rgba,Ut);if(ne)return kp.toColor(ne>>24&255,ne>>16&255,ne>>8&255)}e.ensureContrastRatio=u;function T(yt){let St=(yt.rgba|255)>>>0;return[e0,r0,n0]=PT.toChannels(St),{css:kp.toCss(e0,r0,n0),rgba:St}}e.opaque=T;function $(yt,St){return jf=Math.round(St*255),[e0,r0,n0]=PT.toChannels(yt.rgba),{css:kp.toCss(e0,r0,n0,jf),rgba:kp.toRgba(e0,r0,n0,jf)}}e.opacity=$;function K(yt,St){return jf=yt.rgba&255,$(yt,jf*St/255)}e.multiplyOpacity=K;function ct(yt){return[yt.rgba>>24&255,yt.rgba>>16&255,yt.rgba>>8&255]}e.toColorRGB=ct})(Zd||={});var Tf;(e=>{let t,r;try{let T=document.createElement("canvas");T.width=1,T.height=1;let $=T.getContext("2d",{willReadFrequently:!0});$&&(t=$,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function u(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return e0=parseInt(T.slice(1,2).repeat(2),16),r0=parseInt(T.slice(2,3).repeat(2),16),n0=parseInt(T.slice(3,4).repeat(2),16),kp.toColor(e0,r0,n0);case 5:return e0=parseInt(T.slice(1,2).repeat(2),16),r0=parseInt(T.slice(2,3).repeat(2),16),n0=parseInt(T.slice(3,4).repeat(2),16),jf=parseInt(T.slice(4,5).repeat(2),16),kp.toColor(e0,r0,n0,jf);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}let $=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if($)return e0=parseInt($[1]),r0=parseInt($[2]),n0=parseInt($[3]),jf=Math.round(($[5]===void 0?1:parseFloat($[5]))*255),kp.toColor(e0,r0,n0,jf);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=T,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[e0,r0,n0,jf]=t.getImageData(0,0,1,1).data,jf!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:kp.toRgba(e0,r0,n0,jf),css:T}}e.toColor=u})(Tf||={});var Q0;(e=>{function t(u){return r(u>>16&255,u>>8&255,u&255)}e.relativeLuminance=t;function r(u,T,$){let K=u/255,ct=T/255,yt=$/255,St=K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4),Ut=ct<=.03928?ct/12.92:Math.pow((ct+.055)/1.055,2.4),ne=yt<=.03928?yt/12.92:Math.pow((yt+.055)/1.055,2.4);return St*.2126+Ut*.7152+ne*.0722}e.relativeLuminance2=r})(Q0||={});var PT;(e=>{function t(K,ct){if(jf=(ct&255)/255,jf===1)return ct;let yt=ct>>24&255,St=ct>>16&255,Ut=ct>>8&255,ne=K>>24&255,pe=K>>16&255,me=K>>8&255;return e0=ne+Math.round((yt-ne)*jf),r0=pe+Math.round((St-pe)*jf),n0=me+Math.round((Ut-me)*jf),kp.toRgba(e0,r0,n0)}e.blend=t;function r(K,ct,yt){let St=Q0.relativeLuminance(K>>8),Ut=Q0.relativeLuminance(ct>>8);if(y1(St,Ut)>8));if(we>8));return we>Ve?me:Ce}return me}let ne=T(K,ct,yt),pe=y1(St,Q0.relativeLuminance(ne>>8));if(pe>8));return pe>we?ne:me}return ne}}e.ensureContrastRatio=r;function u(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=y1(Q0.relativeLuminance2(pe,me,we),Q0.relativeLuminance2(St,Ut,ne));for(;Ce0||me>0||we>0);)pe-=Math.max(0,Math.ceil(pe*.1)),me-=Math.max(0,Math.ceil(me*.1)),we-=Math.max(0,Math.ceil(we*.1)),Ce=y1(Q0.relativeLuminance2(pe,me,we),Q0.relativeLuminance2(St,Ut,ne));return(pe<<24|me<<16|we<<8|255)>>>0}e.reduceLuminance=u;function T(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=y1(Q0.relativeLuminance2(pe,me,we),Q0.relativeLuminance2(St,Ut,ne));for(;Ce>>0}e.increaseLuminance=T;function $(K){return[K>>24&255,K>>16&255,K>>8&255,K&255]}e.toChannels=$})(PT||={});function mx(e){let t=e.toString(16);return t.length<2?"0"+t:t}function y1(e,t){return e1){let Ut=this._getJoinedRanges(u,K,$,t,T);for(let ne=0;ne1){let St=this._getJoinedRanges(u,K,$,t,T);for(let Ut=0;Ut=on,Xn=Sr,_i=this._workCell;if(me.length>0&&Sr===me[0][0]&&Cn){let Hn=me.shift(),to=this._isCellInSelection(Hn[0],r);for(rn=Hn[0]+1;rn=Hn[1],Cn?(nn=!0,_i=new x7t(this._workCell,t.translateToString(!0,Hn[0],Hn[1]),Hn[1]-Hn[0]),Xn=Hn[1]-1,Dr=_i.getWidth()):on=Hn[1]}let ta=this._isCellInSelection(Sr,r),va=u&&Sr===K,_a=_r&&Sr>=Ut&&Sr<=ne,qi=!1;this._decorationService.forEachDecorationAtCell(Sr,r,void 0,Hn=>{qi=!0});let Bi=_i.getChars()||h_;if(Bi===" "&&(_i.isUnderline()||_i.isOverline())&&(Bi=" "),Vn=Dr*yt-St.get(Bi,_i.isBold(),_i.isItalic()),!Ve)Ve=this._document.createElement("span");else if(kr&&(ta&&Br||!ta&&!Br&&_i.bg===Lr)&&(ta&&Br&&we.selectionForeground||_i.fg===Mr)&&_i.extended.ext===tn&&_a===Dn&&Vn===Mn&&!va&&!nn&&!qi&&Cn){_i.isInvisible()?It+=h_:It+=Bi,kr++;continue}else kr&&(Ve.textContent=It),Ve=this._document.createElement("span"),kr=0,It="";if(Lr=_i.bg,Mr=_i.fg,tn=_i.extended.ext,Dn=_a,Mn=Vn,Br=ta,nn&&K>=Sr&&K<=Xn&&(K=Sr),!this._coreService.isCursorHidden&&va&&this._coreService.isCursorInitialized){if(pr.push("xterm-cursor"),this._coreBrowserService.isFocused)ct&&pr.push("xterm-cursor-blink"),pr.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":pr.push("xterm-cursor-outline");break;case"block":pr.push("xterm-cursor-block");break;case"bar":pr.push("xterm-cursor-bar");break;case"underline":pr.push("xterm-cursor-underline");break}}if(_i.isBold()&&pr.push("xterm-bold"),_i.isItalic()&&pr.push("xterm-italic"),_i.isDim()&&pr.push("xterm-dim"),_i.isInvisible()?It=h_:It=_i.getChars()||h_,_i.isUnderline()&&(pr.push(`xterm-underline-${_i.extended.underlineStyle}`),It===" "&&(It=" "),!_i.isUnderlineColorDefault()))if(_i.isUnderlineColorRGB())Ve.style.textDecorationColor=`rgb(${p4.toColorRGB(_i.getUnderlineColor()).join(",")})`;else{let Hn=_i.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&_i.isBold()&&Hn<8&&(Hn+=8),Ve.style.textDecorationColor=we.ansi[Hn].css}_i.isOverline()&&(pr.push("xterm-overline"),It===" "&&(It=" ")),_i.isStrikethrough()&&pr.push("xterm-strikethrough"),_a&&(Ve.style.textDecoration="underline");let Xi=_i.getFgColor(),Yn=_i.getFgColorMode(),hi=_i.getBgColor(),na=_i.getBgColorMode(),Xa=!!_i.isInverse();if(Xa){let Hn=Xi;Xi=hi,hi=Hn;let to=Yn;Yn=na,na=to}let oo,xa,Ur=!1;this._decorationService.forEachDecorationAtCell(Sr,r,void 0,Hn=>{Hn.options.layer!=="top"&&Ur||(Hn.backgroundColorRGB&&(na=50331648,hi=Hn.backgroundColorRGB.rgba>>8&16777215,oo=Hn.backgroundColorRGB),Hn.foregroundColorRGB&&(Yn=50331648,Xi=Hn.foregroundColorRGB.rgba>>8&16777215,xa=Hn.foregroundColorRGB),Ur=Hn.options.layer==="top")}),!Ur&&ta&&(oo=this._coreBrowserService.isFocused?we.selectionBackgroundOpaque:we.selectionInactiveBackgroundOpaque,hi=oo.rgba>>8&16777215,na=50331648,Ur=!0,we.selectionForeground&&(Yn=50331648,Xi=we.selectionForeground.rgba>>8&16777215,xa=we.selectionForeground)),Ur&&pr.push("xterm-decoration-top");let Sn;switch(na){case 16777216:case 33554432:Sn=we.ansi[hi],pr.push(`xterm-bg-${hi}`);break;case 50331648:Sn=kp.toColor(hi>>16,hi>>8&255,hi&255),this._addStyle(Ve,`background-color:#${XF((hi>>>0).toString(16),"0",6)}`);break;case 0:default:Xa?(Sn=we.foreground,pr.push("xterm-bg-257")):Sn=we.background}switch(oo||_i.isDim()&&(oo=Zd.multiplyOpacity(Sn,.5)),Yn){case 16777216:case 33554432:_i.isBold()&&Xi<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Xi+=8),this._applyMinimumContrast(Ve,Sn,we.ansi[Xi],_i,oo,void 0)||pr.push(`xterm-fg-${Xi}`);break;case 50331648:let Hn=kp.toColor(Xi>>16&255,Xi>>8&255,Xi&255);this._applyMinimumContrast(Ve,Sn,Hn,_i,oo,xa)||this._addStyle(Ve,`color:#${XF(Xi.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(Ve,Sn,we.foreground,_i,oo,xa)||Xa&&pr.push("xterm-fg-257")}pr.length&&(Ve.className=pr.join(" "),pr.length=0),!va&&!nn&&!qi&&Cn?kr++:Ve.textContent=It,Vn!==this.defaultSpacing&&(Ve.style.letterSpacing=`${Vn}px`),pe.push(Ve),Sr=Xn}return Ve&&kr&&(Ve.textContent=It),pe}_applyMinimumContrast(t,r,u,T,$,K){if(this._optionsService.rawOptions.minimumContrastRatio===1||k7t(T.getCode()))return!1;let ct=this._getContrastCache(T),yt;if(!$&&!K&&(yt=ct.getColor(r.rgba,u.rgba)),yt===void 0){let St=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);yt=Zd.ensureContrastRatio($||r,K||u,St),ct.setColor(($||r).rgba,(K||u).rgba,yt??null)}return yt?(this._addStyle(t,`color:${yt.css}`),!0):!1}_getContrastCache(t){return t.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(t,r){t.setAttribute("style",`${t.getAttribute("style")||""}${r};`)}_isCellInSelection(t,r){let u=this._selectionStart,T=this._selectionEnd;return!u||!T?!1:this._columnSelectMode?u[0]<=T[0]?t>=u[0]&&r>=u[1]&&t=u[1]&&t>=T[0]&&r<=T[1]:r>u[1]&&r=u[0]&&t=u[0]}};N9=Vf([fl(1,nV),fl(2,sm),fl(3,Z1),fl(4,Yx),fl(5,m4),fl(6,Q2)],N9);function XF(e,t,r){for(;e.length0&&(this._flat[T]=ct),ct}let $=t;r&&($+="B"),u&&($+="I");let K=this._holey.get($);if(K===void 0){let ct=0;r&&(ct|=1),u&&(ct|=2),K=this._measure(t,ct),K>0&&this._holey.set($,K)}return K}_measure(t,r){let u=this._measureElements[r];return u.textContent=t.repeat(32),u.offsetWidth/32}},C7t=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,r,u,T=!1){if(this.selectionStart=r,this.selectionEnd=u,!r||!u||r[0]===u[0]&&r[1]===u[1]){this.clear();return}let $=t.buffers.active.ydisp,K=r[1]-$,ct=u[1]-$,yt=Math.max(K,0),St=Math.min(ct,t.rows-1);if(yt>=t.rows||St<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=T,this.viewportStartRow=K,this.viewportEndRow=ct,this.viewportCappedStartRow=yt,this.viewportCappedEndRow=St,this.startCol=r[0],this.endCol=u[0]}isCellSelected(t,r,u){return this.hasSelection?(u-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?r>=this.startCol&&u>=this.viewportCappedStartRow&&r=this.viewportCappedStartRow&&r>=this.endCol&&u<=this.viewportCappedEndRow:u>this.viewportStartRow&&u=this.startCol&&r=this.startCol):!1}};function A7t(){return new C7t}var oM="xterm-dom-renderer-owner-",cg="xterm-rows",oT="xterm-fg-",JF="xterm-bg-",Z3="xterm-focus",sT="xterm-selection",M7t=1,j9=class extends Su{constructor(t,r,u,T,$,K,ct,yt,St,Ut,ne,pe,me,we){super(),this._terminal=t,this._document=r,this._element=u,this._screenElement=T,this._viewportElement=$,this._helperContainer=K,this._linkifier2=ct,this._charSizeService=St,this._optionsService=Ut,this._bufferService=ne,this._coreService=pe,this._coreBrowserService=me,this._themeService=we,this._terminalClass=M7t++,this._rowElements=[],this._selectionRenderModel=A7t(),this.onRequestRedraw=this._register(new Is).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(cg),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(sT),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=T7t(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(Ce=>this._injectCss(Ce))),this._injectCss(this._themeService.colors),this._rowFactory=yt.createInstance(N9,document),this._element.classList.add(oM+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(Ce=>this._handleLinkHover(Ce))),this._register(this._linkifier2.onHideLinkUnderline(Ce=>this._handleLinkLeave(Ce))),this._register(uf(()=>{this._element.classList.remove(oM+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new S7t(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let t=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*t,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*t),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/t),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/t),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let u of this._rowElements)u.style.width=`${this.dimensions.css.canvas.width}px`,u.style.height=`${this.dimensions.css.cell.height}px`,u.style.lineHeight=`${this.dimensions.css.cell.height}px`,u.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let r=`${this._terminalSelector} .${cg} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=r,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(t){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let r=`${this._terminalSelector} .${cg} { pointer-events: none; color: ${t.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;r+=`${this._terminalSelector} .${cg} .xterm-dim { color: ${Zd.multiplyOpacity(t.foreground,.5).css};}`,r+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let u=`blink_underline_${this._terminalClass}`,T=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;r+=`@keyframes ${u} { 50% { border-bottom-style: hidden; }}`,r+=`@keyframes ${T} { 50% { box-shadow: none; }}`,r+=`@keyframes ${$} { 0% { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css}; } 50% { background-color: inherit; color: ${t.cursor.css}; }}`,r+=`${this._terminalSelector} .${cg}.${Z3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${u} 1s step-end infinite;}${this._terminalSelector} .${cg}.${Z3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${T} 1s step-end infinite;}${this._terminalSelector} .${cg}.${Z3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-block { background-color: ${t.cursor.css}; color: ${t.cursorAccent.css};}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${t.cursor.css} !important; color: ${t.cursorAccent.css} !important;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${t.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${t.cursor.css} inset;}${this._terminalSelector} .${cg} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${t.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,r+=`${this._terminalSelector} .${sT} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${sT} div { position: absolute; background-color: ${t.selectionBackgroundOpaque.css};}${this._terminalSelector} .${sT} div { position: absolute; background-color: ${t.selectionInactiveBackgroundOpaque.css};}`;for(let[K,ct]of t.ansi.entries())r+=`${this._terminalSelector} .${oT}${K} { color: ${ct.css}; }${this._terminalSelector} .${oT}${K}.xterm-dim { color: ${Zd.multiplyOpacity(ct,.5).css}; }${this._terminalSelector} .${JF}${K} { background-color: ${ct.css}; }`;r+=`${this._terminalSelector} .${oT}257 { color: ${Zd.opaque(t.background).css}; }${this._terminalSelector} .${oT}257.xterm-dim { color: ${Zd.multiplyOpacity(Zd.opaque(t.background),.5).css}; }${this._terminalSelector} .${JF}257 { background-color: ${t.foreground.css}; }`,this._themeStyleElement.textContent=r}_setDefaultSpacing(){let t=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${t}px`,this._rowFactory.defaultSpacing=t}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(t,r){for(let u=this._rowElements.length;u<=r;u++){let T=this._document.createElement("div");this._rowContainer.appendChild(T),this._rowElements.push(T)}for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(t,r){this._refreshRowElements(t,r),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Z3),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Z3),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(t,r,u){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(t,r,u),this.renderRows(0,this._bufferService.rows-1),!t||!r||(this._selectionRenderModel.update(this._terminal,t,r,u),!this._selectionRenderModel.hasSelection))return;let T=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,ct=this._selectionRenderModel.viewportCappedEndRow,yt=this._document.createDocumentFragment();if(u){let St=t[0]>r[0];yt.appendChild(this._createSelectionElement(K,St?r[0]:t[0],St?t[0]:r[0],ct-K+1))}else{let St=T===K?t[0]:0,Ut=K===$?r[0]:this._bufferService.cols;yt.appendChild(this._createSelectionElement(K,St,Ut));let ne=ct-K-1;if(yt.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,ne)),K!==ct){let pe=$===ct?r[0]:this._bufferService.cols;yt.appendChild(this._createSelectionElement(ct,0,pe))}}this._selectionContainer.appendChild(yt)}_createSelectionElement(t,r,u,T=1){let $=this._document.createElement("div"),K=r*this.dimensions.css.cell.width,ct=this.dimensions.css.cell.width*(u-r);return K+ct>this.dimensions.css.canvas.width&&(ct=this.dimensions.css.canvas.width-K),$.style.height=`${T*this.dimensions.css.cell.height}px`,$.style.top=`${t*this.dimensions.css.cell.height}px`,$.style.left=`${K}px`,$.style.width=`${ct}px`,$}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let t of this._rowElements)t.replaceChildren()}renderRows(t,r){let u=this._bufferService.buffer,T=u.ybase+u.y,$=Math.min(u.x,this._bufferService.cols-1),K=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,ct=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,yt=this._optionsService.rawOptions.cursorInactiveStyle;for(let St=t;St<=r;St++){let Ut=St+u.ydisp,ne=this._rowElements[St],pe=u.lines.get(Ut);if(!ne||!pe)break;ne.replaceChildren(...this._rowFactory.createRow(pe,Ut,Ut===T,ct,yt,$,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${oM}${this._terminalClass}`}_handleLinkHover(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)}_handleLinkLeave(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)}_setCellUnderline(t,r,u,T,$,K){u<0&&(t=0),T<0&&(r=0);let ct=this._bufferService.rows-1;u=Math.max(Math.min(u,ct),0),T=Math.max(Math.min(T,ct),0),$=Math.min($,this._bufferService.cols);let yt=this._bufferService.buffer,St=yt.ybase+yt.y,Ut=Math.min(yt.x,$-1),ne=this._optionsService.rawOptions.cursorBlink,pe=this._optionsService.rawOptions.cursorStyle,me=this._optionsService.rawOptions.cursorInactiveStyle;for(let we=u;we<=T;++we){let Ce=we+yt.ydisp,Ve=this._rowElements[we],kr=yt.lines.get(Ce);if(!Ve||!kr)break;Ve.replaceChildren(...this._rowFactory.createRow(kr,Ce,Ce===St,pe,me,Ut,ne,this.dimensions.css.cell.width,this._widthCache,K?we===u?t:0:-1,K?(we===T?r:$)-1:-1))}}};j9=Vf([fl(7,pL),fl(8,XS),fl(9,sm),fl(10,om),fl(11,Yx),fl(12,Z1),fl(13,Q2)],j9);var U9=class extends Su{constructor(t,r,u){super(),this._optionsService=u,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Is),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new L7t(this._optionsService))}catch{this._measureStrategy=this._register(new E7t(t,r,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let t=this._measureStrategy.measure();(t.width!==this.width||t.height!==this.height)&&(this.width=t.width,this.height=t.height,this._onCharSizeChange.fire())}};U9=Vf([fl(2,sm)],U9);var wV=class extends Su{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},E7t=class extends wV{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},L7t=class extends wV{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let r=this._ctx.measureText("W");if(!("width"in r&&"fontBoundingBoxAscent"in r&&"fontBoundingBoxDescent"in r))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}},P7t=class extends Su{constructor(t,r,u){super(),this._textarea=t,this._window=r,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new I7t(this._window)),this._onDprChange=this._register(new Is),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Is),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(T=>this._screenDprMonitor.setWindow(T))),this._register(b0.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Uc(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Uc(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(t){this._window!==t&&(this._window=t,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},I7t=class extends Su{constructor(t){super(),this._parentWindow=t,this._windowResizeListener=this._register(new G2),this._onDprChange=this._register(new Is),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(uf(()=>this.clearListener()))}setWindow(t){this._parentWindow=t,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Uc(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},D7t=class extends Su{constructor(){super(),this.linkProviders=[],this._register(uf(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function wL(e,t,r){let u=r.getBoundingClientRect(),T=e.getComputedStyle(r),$=parseInt(T.getPropertyValue("padding-left")),K=parseInt(T.getPropertyValue("padding-top"));return[t.clientX-u.left-$,t.clientY-u.top-K]}function z7t(e,t,r,u,T,$,K,ct,yt){if(!$)return;let St=wL(e,t,r);if(St)return St[0]=Math.ceil((St[0]+(yt?K/2:0))/K),St[1]=Math.ceil(St[1]/ct),St[0]=Math.min(Math.max(St[0],1),u+(yt?1:0)),St[1]=Math.min(Math.max(St[1],1),T),St}var $9=class{constructor(t,r){this._renderService=t,this._charSizeService=r}getCoords(t,r,u,T,$){return z7t(window,t,r,u,T,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,$)}getMouseReportCoords(t,r){let u=wL(window,t,r);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};$9=Vf([fl(0,K1),fl(1,XS)],$9);var O7t=class{constructor(t,r){this._renderCallback=t,this._coreBrowserService=r,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(t){return this._refreshCallbacks.push(t),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(t,r,u){this._rowCount=u,t=t!==void 0?t:0,r=r!==void 0?r:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,t):t,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,r):r,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let t=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,r),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let t of this._refreshCallbacks)t(0);this._refreshCallbacks=[]}},kV={};WCt(kV,{getSafariVersion:()=>R7t,isChromeOS:()=>AV,isFirefox:()=>TV,isIpad:()=>F7t,isIphone:()=>N7t,isLegacyEdge:()=>B7t,isLinux:()=>kL,isMac:()=>uS,isNode:()=>JS,isSafari:()=>SV,isWindows:()=>CV});var JS=typeof process<"u"&&"title"in process,g4=JS?"node":navigator.userAgent,v4=JS?"node":navigator.platform,TV=g4.includes("Firefox"),B7t=g4.includes("Edge"),SV=/^((?!chrome|android).)*safari/i.test(g4);function R7t(){if(!SV)return 0;let e=g4.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var uS=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(v4),F7t=v4==="iPad",N7t=v4==="iPhone",CV=["Windows","Win16","Win32","WinCE"].includes(v4),kL=v4.indexOf("Linux")>=0,AV=/\bCrOS\b/.test(g4),MV=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._iT){u-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-t))}ms`),this._start();return}u=T}this.clear()}},j7t=class extends MV{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let r=performance.now()+t;return{timeRemaining:()=>Math.max(0,r-performance.now())}}},U7t=class extends MV{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},hS=!JS&&"requestIdleCallback"in window?U7t:j7t,$7t=class{constructor(){this._queue=new hS}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},H9=class extends Su{constructor(t,r,u,T,$,K,ct,yt,St){super(),this._rowCount=t,this._optionsService=u,this._charSizeService=T,this._coreService=$,this._coreBrowserService=yt,this._renderer=this._register(new G2),this._pausedResizeTask=new $7t,this._observerDisposable=this._register(new G2),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Is),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Is),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Is),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Is),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new O7t((Ut,ne)=>this._renderRows(Ut,ne),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new H7t(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(uf(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(ct.onResize(()=>this._fullRefresh())),this._register(ct.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(K.onDecorationRegistered(()=>this._fullRefresh())),this._register(K.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(ct.cols,ct.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(ct.buffer.y,ct.buffer.y,!0))),this._register(St.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,r),this._register(this._coreBrowserService.onWindowChange(Ut=>this._registerIntersectionObserver(Ut,r)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(t,r){if("IntersectionObserver"in t){let u=new t.IntersectionObserver(T=>this._handleIntersectionChange(T[T.length-1]),{threshold:0});u.observe(r),this._observerDisposable.value=uf(()=>u.disconnect())}}_handleIntersectionChange(t){this._isPaused=t.isIntersecting===void 0?t.intersectionRatio===0:!t.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(t,r,u=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,r);return}let T=this._syncOutputHandler.flush();T&&(t=Math.min(t,T.start),r=Math.max(r,T.end)),u||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(t,r,this._rowCount)}_renderRows(t,r){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(t,r);return}t=Math.min(t,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(t,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:t,end:r}),this._onRender.fire({start:t,end:r}),this._isNextRenderRedrawOnly=!0}}resize(t,r){this._rowCount=r,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(t){this._renderer.value=t,this._renderer.value&&(this._renderer.value.onRequestRedraw(r=>this.refreshRows(r.start,r.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(t){return this._renderDebouncer.addRefreshCallback(t)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(t,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(t,r)):this._renderer.value.handleResize(t,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(t,r,u){this._selectionState.start=t,this._selectionState.end=r,this._selectionState.columnSelectMode=u,this._renderer.value?.handleSelectionChanged(t,r,u)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};H9=Vf([fl(2,sm),fl(3,XS),fl(4,Yx),fl(5,m4),fl(6,om),fl(7,Z1),fl(8,Q2)],H9);var H7t=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function V7t(e,t,r,u){let T=r.buffer.x,$=r.buffer.y;if(!r.buffer.hasScrollback)return G7t(T,$,e,t,r,u)+QS($,t,r,u)+Z7t(T,$,e,t,r,u);let K;if($===t)return K=T>e?"D":"C",X5(Math.abs(T-e),Y5(K,u));K=$>t?"D":"C";let ct=Math.abs($-t),yt=q7t($>t?e:T,r)+(ct-1)*r.cols+1+W7t($>t?T:e);return X5(yt,Y5(K,u))}function W7t(e,t){return e-1}function q7t(e,t){return t.cols-e}function G7t(e,t,r,u,T,$){return QS(t,u,T,$).length===0?"":X5(LV(e,t,e,t-Wx(t,T),!1,T).length,Y5("D",$))}function QS(e,t,r,u){let T=e-Wx(e,r),$=t-Wx(t,r),K=Math.abs(T-$)-K7t(e,t,r);return X5(K,Y5(EV(e,t),u))}function Z7t(e,t,r,u,T,$){let K;QS(t,u,T,$).length>0?K=u-Wx(u,T):K=t;let ct=u,yt=Y7t(e,t,r,u,T,$);return X5(LV(e,K,r,ct,yt==="C",T).length,Y5(yt,$))}function K7t(e,t,r){let u=0,T=e-Wx(e,r),$=t-Wx(t,r);for(let K=0;K=0&&e0?K=u-Wx(u,T):K=t,e=r&&Kt?"A":"B"}function LV(e,t,r,u,T,$){let K=e,ct=t,yt="";for(;(K!==r||ct!==u)&&ct>=0&&ct<$.buffer.lines.length;)K+=T?1:-1,T&&K>$.cols-1?(yt+=$.buffer.translateBufferLineToString(ct,!1,e,K),K=0,e=0,ct++):!T&&K<0&&(yt+=$.buffer.translateBufferLineToString(ct,!1,0,e+1),K=$.cols-1,e=K,ct--);return yt+$.buffer.translateBufferLineToString(ct,!1,e,K)}function Y5(e,t){let r=t?"O":"[";return Ho.ESC+r+e}function X5(e,t){e=Math.floor(e);let r="";for(let u=0;uthis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function QF(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var sM=50,J7t=15,Q7t=50,tMt=500,eMt=" ",rMt=new RegExp(eMt,"g"),V9=class extends Su{constructor(t,r,u,T,$,K,ct,yt,St){super(),this._element=t,this._screenElement=r,this._linkifier=u,this._bufferService=T,this._coreService=$,this._mouseService=K,this._optionsService=ct,this._renderService=yt,this._coreBrowserService=St,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new bg,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Is),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Is),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Is),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Is),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Ut=>this._handleMouseMove(Ut),this._mouseUpListener=Ut=>this._handleMouseUp(Ut),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(Ut=>this._handleTrim(Ut)),this._register(this._bufferService.buffers.onBufferActivate(Ut=>this._handleBufferActivate(Ut))),this.enable(),this._model=new X7t(this._bufferService),this._activeSelectionMode=0,this._register(uf(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(Ut=>{Ut.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let t=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!t||!r?!1:t[0]!==r[0]||t[1]!==r[1]}get selectionText(){let t=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;if(!t||!r)return"";let u=this._bufferService.buffer,T=[];if(this._activeSelectionMode===3){if(t[0]===r[0])return"";let $=t[0]$.replace(rMt," ")).join(CV?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(t){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),kL&&t&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(t){let r=this._getMouseBufferCoords(t),u=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!u||!T||!r?!1:this._areCoordsInSelection(r,u,T)}isCellInSelection(t,r){let u=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!u||!T?!1:this._areCoordsInSelection([t,r],u,T)}_areCoordsInSelection(t,r,u){return t[1]>r[1]&&t[1]=r[0]&&t[0]=r[0]}_selectWordAtCursor(t,r){let u=this._linkifier.currentLink?.link?.range;if(u)return this._model.selectionStart=[u.start.x-1,u.start.y-1],this._model.selectionStartLength=QF(u,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let T=this._getMouseBufferCoords(t);return T?(this._selectWordAt(T,r),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(t,r){this._model.clearSelection(),t=Math.max(t,0),r=Math.min(r,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._bufferService.cols,r],this.refresh(),this._onSelectionChange.fire()}_handleTrim(t){this._model.handleTrim(t)&&this.refresh()}_getMouseBufferCoords(t){let r=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(r)return r[0]--,r[1]--,r[1]+=this._bufferService.buffer.ydisp,r}_getMouseEventScrollAmount(t){let r=wL(this._coreBrowserService.window,t,this._screenElement)[1],u=this._renderService.dimensions.css.canvas.height;return r>=0&&r<=u?0:(r>u&&(r-=u),r=Math.min(Math.max(r,-sM),sM),r/=sM,r/Math.abs(r)+Math.round(r*(X7t-1)))}shouldForceSelection(t){return uS?t.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:t.shiftKey}handleMouseDown(t){if(this._mouseDownTimeStamp=t.timeStamp,!(t.button===2&&this.hasSelection)&&t.button===0){if(!this._enabled){if(!this.shouldForceSelection(t))return;t.stopPropagation()}t.preventDefault(),this._dragScrollAmount=0,this._enabled&&t.shiftKey?this._handleIncrementalClick(t):t.detail===1?this._handleSingleClick(t):t.detail===2?this._handleDoubleClick(t):t.detail===3&&this._handleTripleClick(t),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),J7t)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))}_handleSingleClick(t){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(t)?3:0,this._model.selectionStart=this._getMouseBufferCoords(t),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let r=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);r&&r.length!==this._model.selectionStart[0]&&r.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(t){this._selectWordAtCursor(t,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(t){let r=this._getMouseBufferCoords(t);r&&(this._activeSelectionMode=2,this._selectLineAt(r[1]))}shouldColumnSelect(t){return t.altKey&&!(uS&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(t){if(t.stopImmediatePropagation(),!this._model.selectionStart)return;let r=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let u=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(t.ydisp+this._bufferService.rows,t.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=t.ydisp),this.refresh()}}_handleMouseUp(t){let r=t.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&rthis._handleTrim(r))}_convertViewportColToCharacterIndex(t,r){let u=r;for(let T=0;r>=T;T++){let $=t.loadCell(T,this._workCell).getChars().length;this._workCell.getWidth()===0?u--:$>1&&r!==T&&(u+=$-1)}return u}setSelection(t,r,u){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[t,r],this._model.selectionStartLength=u,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(t){this._isClickInSelection(t)||(this._selectWordAtCursor(t,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(t,r,u=!0,T=!0){if(t[0]>=this._bufferService.cols)return;let $=this._bufferService.buffer,K=$.lines.get(t[1]);if(!K)return;let ct=$.translateBufferLineToString(t[1],!1),yt=this._convertViewportColToCharacterIndex(K,t[0]),St=yt,Ut=t[0]-yt,ne=0,pe=0,me=0,we=0;if(ct.charAt(yt)===" "){for(;yt>0&&ct.charAt(yt-1)===" ";)yt--;for(;St1&&(we+=rn-1,St+=rn-1);kr>0&&yt>0&&!this._isCharWordSeparator(K.loadCell(kr-1,this._workCell));){K.loadCell(kr-1,this._workCell);let Lr=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,kr--):Lr>1&&(me+=Lr-1,yt-=Lr-1),yt--,kr--}for(;It1&&(we+=Lr-1,St+=Lr-1),St++,It++}}St++;let Ce=yt+Ut-ne+me,Ve=Math.min(this._bufferService.cols,St-yt+ne+pe-me-we);if(!(!r&&ct.slice(yt,St).trim()==="")){if(u&&Ce===0&&K.getCodePoint(0)!==32){let kr=$.lines.get(t[1]-1);if(kr&&K.isWrapped&&kr.getCodePoint(this._bufferService.cols-1)!==32){let It=this._getWordAt([this._bufferService.cols-1,t[1]-1],!1,!0,!1);if(It){let rn=this._bufferService.cols-It.start;Ce-=rn,Ve+=rn}}}if(T&&Ce+Ve===this._bufferService.cols&&K.getCodePoint(this._bufferService.cols-1)!==32){let kr=$.lines.get(t[1]+1);if(kr?.isWrapped&&kr.getCodePoint(0)!==32){let It=this._getWordAt([0,t[1]+1],!1,!1,!0);It&&(Ve+=It.length)}}return{start:Ce,length:Ve}}}_selectWordAt(t,r){let u=this._getWordAt(t,r);if(u){for(;u.start<0;)u.start+=this._bufferService.cols,t[1]--;this._model.selectionStart=[u.start,t[1]],this._model.selectionStartLength=u.length}}_selectToWordAt(t){let r=this._getWordAt(t,!0);if(r){let u=t[1];for(;r.start<0;)r.start+=this._bufferService.cols,u--;if(!this._model.areSelectionValuesReversed())for(;r.start+r.length>this._bufferService.cols;)r.length-=this._bufferService.cols,u++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?r.start:r.start+r.length,u]}}_isCharWordSeparator(t){return t.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(t.getChars())>=0}_selectLineAt(t){let r=this._bufferService.buffer.getWrappedRangeForLine(t),u={start:{x:0,y:r.first},end:{x:this._bufferService.cols-1,y:r.last}};this._model.selectionStart=[0,r.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=QF(u,this._bufferService.cols)}};V9=Vf([fl(3,om),fl(4,Kx),fl(5,mL),fl(6,sm),fl(7,K1),fl(8,Z1)],V9);var tN=class{constructor(){this._data={}}set(t,r,u){this._data[t]||(this._data[t]={}),this._data[t][r]=u}get(t,r){return this._data[t]?this._data[t][r]:void 0}clear(){this._data={}}},eN=class{constructor(){this._color=new tN,this._css=new tN}setCss(t,r,u){this._css.set(t,r,u)}getCss(t,r){return this._css.get(t,r)}setColor(t,r,u){this._color.set(t,r,u)}getColor(t,r){return this._color.get(t,r)}clear(){this._color.clear(),this._css.clear()}},Ip=Object.freeze((()=>{let e=[Tf.toColor("#2e3436"),Tf.toColor("#cc0000"),Tf.toColor("#4e9a06"),Tf.toColor("#c4a000"),Tf.toColor("#3465a4"),Tf.toColor("#75507b"),Tf.toColor("#06989a"),Tf.toColor("#d3d7cf"),Tf.toColor("#555753"),Tf.toColor("#ef2929"),Tf.toColor("#8ae234"),Tf.toColor("#fce94f"),Tf.toColor("#729fcf"),Tf.toColor("#ad7fa8"),Tf.toColor("#34e2e2"),Tf.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let u=t[r/36%6|0],T=t[r/6%6|0],$=t[r%6];e.push({css:kp.toCss(u,T,$),rgba:kp.toRgba(u,T,$)})}for(let r=0;r<24;r++){let u=8+r*10;e.push({css:kp.toCss(u,u,u),rgba:kp.toRgba(u,u,u)})}return e})()),bx=Tf.toColor("#ffffff"),h5=Tf.toColor("#000000"),rN=Tf.toColor("#ffffff"),nN=h5,K3={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},rMt=bx,W9=class extends Su{constructor(t){super(),this._optionsService=t,this._contrastCache=new eN,this._halfContrastCache=new eN,this._onChangeColors=this._register(new Is),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:bx,background:h5,cursor:rN,cursorAccent:nN,selectionForeground:void 0,selectionBackgroundTransparent:K3,selectionBackgroundOpaque:Zd.blend(h5,K3),selectionInactiveBackgroundTransparent:K3,selectionInactiveBackgroundOpaque:Zd.blend(h5,K3),scrollbarSliderBackground:Zd.opacity(bx,.2),scrollbarSliderHoverBackground:Zd.opacity(bx,.4),scrollbarSliderActiveBackground:Zd.opacity(bx,.5),overviewRulerBorder:bx,ansi:Ip.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(t={}){let r=this._colors;if(r.foreground=yd(t.foreground,bx),r.background=yd(t.background,h5),r.cursor=Zd.blend(r.background,yd(t.cursor,rN)),r.cursorAccent=Zd.blend(r.background,yd(t.cursorAccent,nN)),r.selectionBackgroundTransparent=yd(t.selectionBackground,K3),r.selectionBackgroundOpaque=Zd.blend(r.background,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundTransparent=yd(t.selectionInactiveBackground,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundOpaque=Zd.blend(r.background,r.selectionInactiveBackgroundTransparent),r.selectionForeground=t.selectionForeground?yd(t.selectionForeground,YF):void 0,r.selectionForeground===YF&&(r.selectionForeground=void 0),Zd.isOpaque(r.selectionBackgroundTransparent)&&(r.selectionBackgroundTransparent=Zd.opacity(r.selectionBackgroundTransparent,.3)),Zd.isOpaque(r.selectionInactiveBackgroundTransparent)&&(r.selectionInactiveBackgroundTransparent=Zd.opacity(r.selectionInactiveBackgroundTransparent,.3)),r.scrollbarSliderBackground=yd(t.scrollbarSliderBackground,Zd.opacity(r.foreground,.2)),r.scrollbarSliderHoverBackground=yd(t.scrollbarSliderHoverBackground,Zd.opacity(r.foreground,.4)),r.scrollbarSliderActiveBackground=yd(t.scrollbarSliderActiveBackground,Zd.opacity(r.foreground,.5)),r.overviewRulerBorder=yd(t.overviewRulerBorder,rMt),r.ansi=Ip.slice(),r.ansi[0]=yd(t.black,Ip[0]),r.ansi[1]=yd(t.red,Ip[1]),r.ansi[2]=yd(t.green,Ip[2]),r.ansi[3]=yd(t.yellow,Ip[3]),r.ansi[4]=yd(t.blue,Ip[4]),r.ansi[5]=yd(t.magenta,Ip[5]),r.ansi[6]=yd(t.cyan,Ip[6]),r.ansi[7]=yd(t.white,Ip[7]),r.ansi[8]=yd(t.brightBlack,Ip[8]),r.ansi[9]=yd(t.brightRed,Ip[9]),r.ansi[10]=yd(t.brightGreen,Ip[10]),r.ansi[11]=yd(t.brightYellow,Ip[11]),r.ansi[12]=yd(t.brightBlue,Ip[12]),r.ansi[13]=yd(t.brightMagenta,Ip[13]),r.ansi[14]=yd(t.brightCyan,Ip[14]),r.ansi[15]=yd(t.brightWhite,Ip[15]),t.extendedAnsi){let u=Math.min(r.ansi.length-16,t.extendedAnsi.length);for(let T=0;T$.index-K.index),u=[];for(let $ of r){let K=this._services.get($.id);if(!K)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${$.id._id}.`);u.push(K)}let T=r.length>0?r[0].index:t.length;if(t.length!==T)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${T+1} conflicts with ${t.length} static arguments`);return new e(...t,...u)}},aMt={trace:0,debug:1,info:2,warn:3,error:4,off:5},oMt="xterm.js: ",q9=class extends Su{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=aMt[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let r=0;rthis._length)for(let r=this._length;r=t;T--)this._array[this._getCyclicIndex(T+u.length)]=this._array[this._getCyclicIndex(T)];for(let T=0;Tthis._maxLength){let T=this._length+u.length-this._maxLength;this._startIndex+=T,this._length=this._maxLength,this.onTrimEmitter.fire(T)}else this._length+=u.length}trimStart(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)}shiftElements(t,r,u){if(!(r<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let $=r-1;$>=0;$--)this.set(t+$+u,this.get(t+$));let T=t+r+u-this._length;if(T>0)for(this._length+=T;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let T=0;T>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):u]}set(t,r){this._data[t*Tu+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Tu+0]=t|2097152|r[2]<<22):this._data[t*Tu+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Tu+0]>>22}hasWidth(t){return this._data[t*Tu+0]&12582912}getFg(t){return this._data[t*Tu+1]}getBg(t){return this._data[t*Tu+2]}hasContent(t){return this._data[t*Tu+0]&4194303}getCodePoint(t){let r=this._data[t*Tu+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Tu+0]&2097152}getString(t){let r=this._data[t*Tu+0];return r&2097152?this._combined[t]:r&2097151?a_(r&2097151):""}isProtected(t){return this._data[t*Tu+2]&536870912}loadCell(t,r){return lT=t*Tu,r.content=this._data[lT+0],r.fg=this._data[lT+1],r.bg=this._data[lT+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Tu+0]=r.content,this._data[t*Tu+1]=r.fg,this._data[t*Tu+2]=r.bg}setCellFromCodepoint(t,r,u,T){T.bg&268435456&&(this._extendedAttrs[t]=T.extended),this._data[t*Tu+0]=r|u<<22,this._data[t*Tu+1]=T.fg,this._data[t*Tu+2]=T.bg}addCodepointToCell(t,r,u){let T=this._data[t*Tu+0];T&2097152?this._combined[t]+=a_(r):T&2097151?(this._combined[t]=a_(T&2097151)+a_(r),T&=-2097152,T|=2097152):T=r|1<<22,u&&(T&=-12582913,T|=u<<22),this._data[t*Tu+0]=T}insertCells(t,r,u){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,u),r=0;--$)this.setCell(t+r+$,this.loadCell(t+$,T));for(let $=0;$this.length){if(this._data.buffer.byteLength>=u*4)this._data=new Uint32Array(this._data.buffer,0,u);else{let T=new Uint32Array(u);T.set(this._data),this._data=T}for(let T=this.length;T=t&&delete this._combined[ct]}let $=Object.keys(this._extendedAttrs);for(let K=0;K<$.length;K++){let ct=parseInt($[K],10);ct>=t&&delete this._extendedAttrs[ct]}}return this.length=t,u*4*lM=0;--t)if(this._data[t*Tu+0]&4194303)return t+(this._data[t*Tu+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Tu+0]&4194303||this._data[t*Tu+2]&50331648)return t+(this._data[t*Tu+0]>>22);return 0}copyCellsFrom(t,r,u,T,$){let K=t._data;if($)for(let yt=T-1;yt>=0;yt--){for(let St=0;St=r&&(this._combined[St-r+u]=t._combined[St])}}translateToString(t,r,u,T){r=r??0,u=u??this.length,t&&(u=Math.min(u,this.getTrimmedLength())),T&&(T.length=0);let $="";for(;r>22||1}return T&&T.push(r),$}};function sMt(e,t,r,u,T,$){let K=[];for(let ct=0;ct=ct&&u0&&(Ve>ne||Ut[Ve].getTrimmedLength()===0);Ve--)Ce++;Ce>0&&(K.push(ct+Ut.length-Ce),K.push(Ce)),ct+=Ut.length-1}return K}function lMt(e,t){let r=[],u=0,T=t[u],$=0;for(let K=0;KJ5(e,St,t)).reduce((yt,St)=>yt+St),$=0,K=0,ct=0;for(;ctyt&&($-=yt,K++);let St=e[K].getWidth($-1)===2;St&&$--;let Ut=St?r-1:r;u.push(Ut),ct+=Ut}return u}function J5(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let u=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,T=e[t+1].getWidth(0)===2;return u&&T?r-1:r}var IV=class DV{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=DV._nextId++,this._onDispose=this.register(new Is),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Hx(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};IV._nextId=1;var hMt=IV,Fp={},wx=Fp.B;Fp[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Fp.A={"#":"£"};Fp.B=void 0;Fp[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Fp.C=Fp[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Fp.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Fp.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Fp.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Fp.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Fp.E=Fp[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Fp.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Fp.H=Fp[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Fp["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var aN=4294967295,oN=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=bp.clone(),this.savedCharset=wx,this.markers=[],this._nullCell=bg.fromCharData([0,YH,1,0]),this._whitespaceCell=bg.fromCharData([0,h_,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new hS,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new iN(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new sS),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new sS),this._whitespaceCell}getBlankLine(e,t){return new d5(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&eaN?aN:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=bp);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new iN(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(bp),u=0,T=this._getCorrectBufferLength(t);if(T>this.lines.maxLength&&(this.lines.maxLength=T),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+$+1?(this.ybase--,$++,this.ydisp>0&&this.ydisp--):this.lines.push(new d5(e,r)));else for(let K=this._rows;K>t;K--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(T0&&(this.lines.trimStart(K),this.ybase=Math.max(this.ybase-K,0),this.ydisp=Math.max(this.ydisp-K,0),this.savedY=Math.max(this.savedY-K,0)),this.lines.maxLength=T}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),$&&(this.y+=$),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let $=0;$.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,u=sMt(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(bp),r);if(u.length>0){let T=lMt(this.lines,u);cMt(this.lines,T.layout),this._reflowLargerAdjustViewport(e,t,T.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let u=this.getNullCell(bp),T=r;for(;T-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;K--){let ct=this.lines.get(K);if(!ct||!ct.isWrapped&&ct.getTrimmedLength()<=e)continue;let yt=[ct];for(;ct.isWrapped&&K>0;)ct=this.lines.get(--K),yt.unshift(ct);if(!r){let rn=this.ybase+this.y;if(rn>=K&&rn0&&(T.push({start:K+yt.length+$,newLines:me}),$+=me.length),yt.push(...me);let we=Ut.length-1,Ce=Ut[we];Ce===0&&(we--,Ce=Ut[we]);let Ve=yt.length-ne-1,kr=St;for(;Ve>=0;){let rn=Math.min(kr,Ce);if(yt[we]===void 0)break;if(yt[we].copyCellsFrom(yt[Ve],kr-rn,Ce-rn,rn,!0),Ce-=rn,Ce===0&&(we--,Ce=Ut[we]),kr-=rn,kr===0){Ve--;let Lr=Math.max(Ve,0);kr=J5(yt,Lr,this._cols)}}for(let rn=0;rn0;)this.ybase===0?this.y0){let K=[],ct=[];for(let Ce=0;Ce=0;Ce--)if(ne&&ne.start>St+pe){for(let Ve=ne.newLines.length-1;Ve>=0;Ve--)this.lines.set(Ce--,ne.newLines[Ve]);Ce++,K.push({index:St+1,amount:ne.newLines.length}),pe+=ne.newLines.length,ne=T[++Ut]}else this.lines.set(Ce,ct[St--]);let me=0;for(let Ce=K.length-1;Ce>=0;Ce--)K[Ce].index+=me,this.lines.onInsertEmitter.fire(K[Ce]),me+=K[Ce].amount;let we=Math.max(0,yt+$-this.lines.maxLength);we>0&&this.lines.onTrimEmitter.fire(we)}}translateBufferLineToString(e,t,r=0,u){let T=this.lines.get(e);return T?T.translateToString(t,r,u):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.liner.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},dMt=class extends Su{constructor(t,r){super(),this._optionsService=t,this._bufferService=r,this._onBufferActivate=this._register(new Is),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new oN(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new oN(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(t,r){this._normal.resize(t,r),this._alt.resize(t,r),this.setupTabStops(t)}setupTabStops(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)}},zV=2,OV=1,G9=class extends Su{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Is),this.onResize=this._onResize.event,this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,zV),this.rows=Math.max(e.rawOptions.rows||0,OV),this.buffers=this._register(new dMt(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,u=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,u;u=this._cachedBlankLine,(!u||u.length!==this.cols||u.getFg(0)!==e.fg||u.getBg(0)!==e.bg)&&(u=r.getBlankLine(e,t),this._cachedBlankLine=u),u.isWrapped=t;let T=r.ybase+r.scrollTop,$=r.ybase+r.scrollBottom;if(r.scrollTop===0){let K=r.lines.isFull;$===r.lines.length-1?K?r.lines.recycle().copyFrom(u):r.lines.push(u.clone()):r.lines.splice($+1,0,u.clone()),K?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let K=$-T+1;r.lines.shiftElements(T+1,K-1,-1),r.lines.set($,u.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let u=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),u!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};G9=Vf([fl(0,sm)],G9);var _2={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:uS,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},fMt=["normal","bold","100","200","300","400","500","600","700","800","900"],pMt=class extends Su{constructor(t){super(),this._onOptionChange=this._register(new Is),this.onOptionChange=this._onOptionChange.event;let r={..._2};for(let u in t)if(u in r)try{let T=t[u];r[u]=this._sanitizeAndValidateOption(u,T)}catch(T){console.error(T)}this.rawOptions=r,this.options={...r},this._setupOptions(),this._register(uf(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(t,r){return this.onOptionChange(u=>{u===t&&r(this.rawOptions[t])})}onMultipleOptionChange(t,r){return this.onOptionChange(u=>{t.indexOf(u)!==-1&&r()})}_setupOptions(){let t=u=>{if(!(u in _2))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},r=(u,T)=>{if(!(u in _2))throw new Error(`No option with key "${u}"`);T=this._sanitizeAndValidateOption(u,T),this.rawOptions[u]!==T&&(this.rawOptions[u]=T,this._onOptionChange.fire(u))};for(let u in this.rawOptions){let T={get:t.bind(this,u),set:r.bind(this,u)};Object.defineProperty(this.options,u,T)}}_sanitizeAndValidateOption(t,r){switch(t){case"cursorStyle":if(r||(r=_2[t]),!mMt(r))throw new Error(`"${r}" is not a valid value for ${t}`);break;case"wordSeparator":r||(r=_2[t]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=fMt.includes(r)?r:_2[t];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${t} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(r*10)/10));break;case"scrollback":if(r=Math.min(r,4294967295),r<0)throw new Error(`${t} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${t} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${t} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{};break}return r}};function mMt(e){return e==="block"||e==="underline"||e==="bar"}function f5(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let u in e)r[u]=t<=1?e[u]:e[u]&&f5(e[u],t-1);return r}var sN=Object.freeze({insertMode:!1}),lN=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Z9=class extends Su{constructor(t,r,u){super(),this._bufferService=t,this._logService=r,this._optionsService=u,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Is),this.onData=this._onData.event,this._onUserInput=this._register(new Is),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Is),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Is),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=f5(sN),this.decPrivateModes=f5(lN)}reset(){this.modes=f5(sN),this.decPrivateModes=f5(lN)}triggerDataEvent(t,r=!1){if(this._optionsService.rawOptions.disableStdin)return;let u=this._bufferService.buffer;r&&this._optionsService.rawOptions.scrollOnUserInput&&u.ybase!==u.ydisp&&this._onRequestScrollToBottom.fire(),r&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`),this._logService.trace("sending data (codes)",()=>t.split("").map(T=>T.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`),this._logService.trace("sending binary (codes)",()=>t.split("").map(r=>r.charCodeAt(0))),this._onBinary.fire(t))}};Z9=Vf([fl(0,om),fl(1,eV),fl(2,sm)],Z9);var cN={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function cM(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var uM=String.fromCharCode,uN={DEFAULT:e=>{let t=[cM(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${uM(t[0])}${uM(t[1])}${uM(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${cM(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${cM(e,!0)};${e.x};${e.y}${t}`}},K9=class extends Su{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Is),this.onProtocolChange=this._onProtocolChange.event;for(let u of Object.keys(cN))this.addProtocol(u,cN[u]);for(let u of Object.keys(uN))this.addEncoding(u,uN[u]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let u=t/r,T=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(T/=u+0,Math.abs(e.deltaY)<50&&(T*=.3),this._wheelPartialScroll+=T,T=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(T*=this._bufferService.rows),T}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};K9=Vf([fl(0,om),fl(1,Kx),fl(2,sm)],K9);var hM=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],gMt=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Dp;function vMt(e,t){let r=0,u=t.length-1,T;if(et[u][1])return!1;for(;u>=r;)if(T=r+u>>1,e>t[T][1])r=T+1;else if(e=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,r){let u=this.wcwidth(t),T=u===0&&r!==0;if(T){let $=Ex.extractWidth(r);$===0?T=!1:$>u&&(u=$)}return Ex.createPropertyValue(0,u,T)}},Ex=class IT{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Is,this.onChange=this._onChange.event;let t=new yMt;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,u=!1){return(t&16777215)<<3|(r&3)<<1|(u?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,u=0,T=t.length;for(let $=0;$=T)return r+this.wcwidth(K);let St=t.charCodeAt($);56320<=St&&St<=57343?K=(K-55296)*1024+St-56320+65536:r+=this.wcwidth(St)}let ct=this.charProperties(K,u),yt=IT.extractWidth(ct);IT.extractShouldJoin(ct)&&(yt-=IT.extractWidth(u)),r+=yt,u=ct}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},_Mt=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(t){this.glevel=t,this.charset=this._charsets[t]}setgCharset(t,r){this._charsets[t]=r,this.glevel===t&&(this.charset=r)}};function hN(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var Y3=2147483647,xMt=256,BV=class Y9{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>xMt)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new Y9;if(!t.length)return r;for(let u=Array.isArray(t[0])?1:0;u>8,T=this._subParamsIdx[r]&255;T-u>0&&t.push(Array.prototype.slice.call(this._subParams,u,T))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Y3?Y3:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Y3?Y3:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,u=this._subParamsIdx[t]&255;return u-r>0?this._subParams.subarray(r,u):null}getSubParamsAll(){let t={};for(let r=0;r>8,T=this._subParamsIdx[r]&255;T-u>0&&(t[r]=this._subParams.slice(u,T))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let u=this._digitIsSub?this._subParams:this.params,T=u[r-1];u[r-1]=~T?Math.min(T*10+t,Y3):t}},X3=[],bMt=class{constructor(){this._state=0,this._active=X3,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(t,r){this._handlers[t]===void 0&&(this._handlers[t]=[]);let u=this._handlers[t];return u.push(r),{dispose:()=>{let T=u.indexOf(r);T!==-1&&u.splice(T,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=X3}reset(){if(this._state===2)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].end(!1);this._stack.paused=!1,this._active=X3,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||X3,!this._active.length)this._handlerFb(this._id,"START");else for(let t=this._active.length-1;t>=0;t--)this._active[t].start()}_put(t,r,u){if(!this._active.length)this._handlerFb(this._id,"PUT",YS(t,r,u));else for(let T=this._active.length-1;T>=0;T--)this._active[T].put(t,r,u)}start(){this.reset(),this._state=1}put(t,r,u){if(this._state!==3){if(this._state===1)for(;r0&&this._put(t,r,u)}}end(t,r=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",t);else{let u=!1,T=this._active.length-1,$=!1;if(this._stack.paused&&(T=this._stack.loopPosition-1,u=r,$=this._stack.fallThrough,this._stack.paused=!1),!$&&u===!1){for(;T>=0&&(u=this._active[T].end(t),u!==!0);T--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!1,u;T--}for(;T>=0;T--)if(u=this._active[T].end(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!0,u}this._active=X3,this._id=-1,this._state=0}}},Hm=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,r,u){this._hitLimit||(this._data+=YS(t,r,u),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let r=!1;if(this._hitLimit)r=!1;else if(t&&(r=this._handler(this._data),r instanceof Promise))return r.then(u=>(this._data="",this._hitLimit=!1,u));return this._data="",this._hitLimit=!1,r}},J3=[],wMt=class{constructor(){this._handlers=Object.create(null),this._active=J3,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=J3}registerHandler(t,r){this._handlers[t]===void 0&&(this._handlers[t]=[]);let u=this._handlers[t];return u.push(r),{dispose:()=>{let T=u.indexOf(r);T!==-1&&u.splice(T,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}reset(){if(this._active.length)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].unhook(!1);this._stack.paused=!1,this._active=J3,this._ident=0}hook(t,r){if(this.reset(),this._ident=t,this._active=this._handlers[t]||J3,!this._active.length)this._handlerFb(this._ident,"HOOK",r);else for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(r)}put(t,r,u){if(!this._active.length)this._handlerFb(this._ident,"PUT",YS(t,r,u));else for(let T=this._active.length-1;T>=0;T--)this._active[T].put(t,r,u)}unhook(t,r=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",t);else{let u=!1,T=this._active.length-1,$=!1;if(this._stack.paused&&(T=this._stack.loopPosition-1,u=r,$=this._stack.fallThrough,this._stack.paused=!1),!$&&u===!1){for(;T>=0&&(u=this._active[T].unhook(t),u!==!0);T--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!1,u;T--}for(;T>=0;T--)if(u=this._active[T].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!0,u}this._active=J3,this._ident=0}},p5=new BV;p5.addParam(0);var dN=class{constructor(e){this._handler=e,this._data="",this._params=p5,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():p5,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=YS(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=p5,this._data="",this._hitLimit=!1,r));return this._params=p5,this._data="",this._hitLimit=!1,t}},kMt=class{constructor(t){this.table=new Uint8Array(t)}setDefault(t,r){this.table.fill(t<<4|r)}add(t,r,u,T){this.table[r<<8|t]=u<<4|T}addMany(t,r,u,T){for(let $=0;$yt),r=(ct,yt)=>t.slice(ct,yt),u=r(32,127),T=r(0,24);T.push(25),T.push.apply(T,r(28,32));let $=r(0,14),K;e.setDefault(1,0),e.addMany(u,0,2,0);for(K in $)e.addMany([24,26,153,154],K,3,0),e.addMany(r(128,144),K,3,0),e.addMany(r(144,152),K,3,0),e.add(156,K,0,0),e.add(27,K,11,1),e.add(157,K,4,8),e.addMany([152,158,159],K,0,7),e.add(155,K,11,3),e.add(144,K,11,9);return e.addMany(T,0,3,0),e.addMany(T,1,3,1),e.add(127,1,0,1),e.addMany(T,8,0,8),e.addMany(T,3,3,3),e.add(127,3,0,3),e.addMany(T,4,3,4),e.add(127,4,0,4),e.addMany(T,6,3,6),e.addMany(T,5,3,5),e.add(127,5,0,5),e.addMany(T,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(u,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(u,7,0,7),e.addMany(T,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(T,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(T,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(T,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(T,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(T,13,13,13),e.addMany(u,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(mg,0,2,0),e.add(mg,8,5,8),e.add(mg,6,0,6),e.add(mg,11,0,11),e.add(mg,13,13,13),e}(),SMt=class extends Su{constructor(t=TMt){super(),this._transitions=t,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new BV,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(r,u,T)=>{},this._executeHandlerFb=r=>{},this._csiHandlerFb=(r,u)=>{},this._escHandlerFb=r=>{},this._errorHandlerFb=r=>r,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(uf(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new bMt),this._dcsParser=this._register(new wMt),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(t,r=[64,126]){let u=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if(u=t.prefix.charCodeAt(0),u&&60>u||u>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let $=0;$K||K>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");u<<=8,u|=K}}if(t.final.length!==1)throw new Error("final must be a single byte");let T=t.final.charCodeAt(0);if(r[0]>T||T>r[1])throw new Error(`final must be in range ${r[0]} .. ${r[1]}`);return u<<=8,u|=T,u}identToString(t){let r=[];for(;t;)r.push(String.fromCharCode(t&255)),t>>=8;return r.reverse().join("")}setPrintHandler(t){this._printHandler=t}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(t,r){let u=this._identifier(t,[48,126]);this._escHandlers[u]===void 0&&(this._escHandlers[u]=[]);let T=this._escHandlers[u];return T.push(r),{dispose:()=>{let $=T.indexOf(r);$!==-1&&T.splice($,1)}}}clearEscHandler(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]}setEscHandlerFallback(t){this._escHandlerFb=t}setExecuteHandler(t,r){this._executeHandlers[t.charCodeAt(0)]=r}clearExecuteHandler(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]}setExecuteHandlerFallback(t){this._executeHandlerFb=t}registerCsiHandler(t,r){let u=this._identifier(t);this._csiHandlers[u]===void 0&&(this._csiHandlers[u]=[]);let T=this._csiHandlers[u];return T.push(r),{dispose:()=>{let $=T.indexOf(r);$!==-1&&T.splice($,1)}}}clearCsiHandler(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]}setCsiHandlerFallback(t){this._csiHandlerFb=t}registerDcsHandler(t,r){return this._dcsParser.registerHandler(this._identifier(t),r)}clearDcsHandler(t){this._dcsParser.clearHandler(this._identifier(t))}setDcsHandlerFallback(t){this._dcsParser.setHandlerFallback(t)}registerOscHandler(t,r){return this._oscParser.registerHandler(t,r)}clearOscHandler(t){this._oscParser.clearHandler(t)}setOscHandlerFallback(t){this._oscParser.setHandlerFallback(t)}setErrorHandler(t){this._errorHandler=t}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(t,r,u,T,$){this._parseStack.state=t,this._parseStack.handlers=r,this._parseStack.handlerPos=u,this._parseStack.transition=T,this._parseStack.chunkPos=$}parse(t,r,u){let T=0,$=0,K=0,ct;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,K=this._parseStack.chunkPos+1;else{if(u===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let yt=this._parseStack.handlers,St=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(u===!1&&St>-1){for(;St>=0&&(ct=yt[St](this._params),ct!==!0);St--)if(ct instanceof Promise)return this._parseStack.handlerPos=St,ct}this._parseStack.handlers=[];break;case 4:if(u===!1&&St>-1){for(;St>=0&&(ct=yt[St](),ct!==!0);St--)if(ct instanceof Promise)return this._parseStack.handlerPos=St,ct}this._parseStack.handlers=[];break;case 6:if(T=t[this._parseStack.chunkPos],ct=this._dcsParser.unhook(T!==24&&T!==26,u),ct)return ct;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=t[this._parseStack.chunkPos],ct=this._oscParser.end(T!==24&&T!==26,u),ct)return ct;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,K=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let yt=K;yt>4){case 2:for(let me=yt+1;;++me){if(me>=r||(T=t[me])<32||T>126&&T=r||(T=t[me])<32||T>126&&T=r||(T=t[me])<32||T>126&&T=r||(T=t[me])<32||T>126&&T=0&&(ct=St[Ut](this._params),ct!==!0);Ut--)if(ct instanceof Promise)return this._preserveStack(3,St,Ut,$,yt),ct;Ut<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++yt47&&T<60);yt--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:let ne=this._escHandlers[this._collect<<8|T],pe=ne?ne.length-1:-1;for(;pe>=0&&(ct=ne[pe](),ct!==!0);pe--)if(ct instanceof Promise)return this._preserveStack(4,ne,pe,$,yt),ct;pe<0&&this._escHandlerFb(this._collect<<8|T),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|T,this._params);break;case 13:for(let me=yt+1;;++me)if(me>=r||(T=t[me])===24||T===26||T===27||T>127&&T=r||(T=t[me])<32||T>127&&T>4:$>>8}return u}}function dM(e,t){let r=e.toString(16),u=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}function MMt(e,t=16){let[r,u,T]=e;return`rgb:${dM(r,t)}/${dM(u,t)}/${dM(T,t)}`}var EMt={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Vy=131072,pN=10;function mN(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var gN=5e3,vN=0,LMt=class extends Su{constructor(e,t,r,u,T,$,K,ct,yt=new SMt){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=u,this._optionsService=T,this._oscLinkService=$,this._coreMouseService=K,this._unicodeService=ct,this._parser=yt,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new KCt,this._utf8Decoder=new YCt,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=bp.clone(),this._eraseAttrDataInternal=bp.clone(),this._onRequestBell=this._register(new Is),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Is),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Is),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Is),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Is),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Is),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Is),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Is),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Is),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Is),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Is),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Is),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new X9(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(St=>this._activeBuffer=St.activeBuffer)),this._parser.setCsiHandlerFallback((St,Ut)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(St),params:Ut.toArray()})}),this._parser.setEscHandlerFallback(St=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(St)})}),this._parser.setExecuteHandlerFallback(St=>{this._logService.debug("Unknown EXECUTE code: ",{code:St})}),this._parser.setOscHandlerFallback((St,Ut,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:St,action:Ut,data:ne})}),this._parser.setDcsHandlerFallback((St,Ut,ne)=>{Ut==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(St),action:Ut,payload:ne})}),this._parser.setPrintHandler((St,Ut,ne)=>this.print(St,Ut,ne)),this._parser.registerCsiHandler({final:"@"},St=>this.insertChars(St)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},St=>this.scrollLeft(St)),this._parser.registerCsiHandler({final:"A"},St=>this.cursorUp(St)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},St=>this.scrollRight(St)),this._parser.registerCsiHandler({final:"B"},St=>this.cursorDown(St)),this._parser.registerCsiHandler({final:"C"},St=>this.cursorForward(St)),this._parser.registerCsiHandler({final:"D"},St=>this.cursorBackward(St)),this._parser.registerCsiHandler({final:"E"},St=>this.cursorNextLine(St)),this._parser.registerCsiHandler({final:"F"},St=>this.cursorPrecedingLine(St)),this._parser.registerCsiHandler({final:"G"},St=>this.cursorCharAbsolute(St)),this._parser.registerCsiHandler({final:"H"},St=>this.cursorPosition(St)),this._parser.registerCsiHandler({final:"I"},St=>this.cursorForwardTab(St)),this._parser.registerCsiHandler({final:"J"},St=>this.eraseInDisplay(St,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},St=>this.eraseInDisplay(St,!0)),this._parser.registerCsiHandler({final:"K"},St=>this.eraseInLine(St,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},St=>this.eraseInLine(St,!0)),this._parser.registerCsiHandler({final:"L"},St=>this.insertLines(St)),this._parser.registerCsiHandler({final:"M"},St=>this.deleteLines(St)),this._parser.registerCsiHandler({final:"P"},St=>this.deleteChars(St)),this._parser.registerCsiHandler({final:"S"},St=>this.scrollUp(St)),this._parser.registerCsiHandler({final:"T"},St=>this.scrollDown(St)),this._parser.registerCsiHandler({final:"X"},St=>this.eraseChars(St)),this._parser.registerCsiHandler({final:"Z"},St=>this.cursorBackwardTab(St)),this._parser.registerCsiHandler({final:"`"},St=>this.charPosAbsolute(St)),this._parser.registerCsiHandler({final:"a"},St=>this.hPositionRelative(St)),this._parser.registerCsiHandler({final:"b"},St=>this.repeatPrecedingCharacter(St)),this._parser.registerCsiHandler({final:"c"},St=>this.sendDeviceAttributesPrimary(St)),this._parser.registerCsiHandler({prefix:">",final:"c"},St=>this.sendDeviceAttributesSecondary(St)),this._parser.registerCsiHandler({final:"d"},St=>this.linePosAbsolute(St)),this._parser.registerCsiHandler({final:"e"},St=>this.vPositionRelative(St)),this._parser.registerCsiHandler({final:"f"},St=>this.hVPosition(St)),this._parser.registerCsiHandler({final:"g"},St=>this.tabClear(St)),this._parser.registerCsiHandler({final:"h"},St=>this.setMode(St)),this._parser.registerCsiHandler({prefix:"?",final:"h"},St=>this.setModePrivate(St)),this._parser.registerCsiHandler({final:"l"},St=>this.resetMode(St)),this._parser.registerCsiHandler({prefix:"?",final:"l"},St=>this.resetModePrivate(St)),this._parser.registerCsiHandler({final:"m"},St=>this.charAttributes(St)),this._parser.registerCsiHandler({final:"n"},St=>this.deviceStatus(St)),this._parser.registerCsiHandler({prefix:"?",final:"n"},St=>this.deviceStatusPrivate(St)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},St=>this.softReset(St)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},St=>this.setCursorStyle(St)),this._parser.registerCsiHandler({final:"r"},St=>this.setScrollRegion(St)),this._parser.registerCsiHandler({final:"s"},St=>this.saveCursor(St)),this._parser.registerCsiHandler({final:"t"},St=>this.windowOptions(St)),this._parser.registerCsiHandler({final:"u"},St=>this.restoreCursor(St)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},St=>this.insertColumns(St)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},St=>this.deleteColumns(St)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},St=>this.selectProtected(St)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},St=>this.requestMode(St,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},St=>this.requestMode(St,!1)),this._parser.setExecuteHandler(Ho.BEL,()=>this.bell()),this._parser.setExecuteHandler(Ho.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Ho.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Ho.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Ho.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Ho.BS,()=>this.backspace()),this._parser.setExecuteHandler(Ho.HT,()=>this.tab()),this._parser.setExecuteHandler(Ho.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Ho.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(LT.IND,()=>this.index()),this._parser.setExecuteHandler(LT.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(LT.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Hm(St=>(this.setTitle(St),this.setIconName(St),!0))),this._parser.registerOscHandler(1,new Hm(St=>this.setIconName(St))),this._parser.registerOscHandler(2,new Hm(St=>this.setTitle(St))),this._parser.registerOscHandler(4,new Hm(St=>this.setOrReportIndexedColor(St))),this._parser.registerOscHandler(8,new Hm(St=>this.setHyperlink(St))),this._parser.registerOscHandler(10,new Hm(St=>this.setOrReportFgColor(St))),this._parser.registerOscHandler(11,new Hm(St=>this.setOrReportBgColor(St))),this._parser.registerOscHandler(12,new Hm(St=>this.setOrReportCursorColor(St))),this._parser.registerOscHandler(104,new Hm(St=>this.restoreIndexedColor(St))),this._parser.registerOscHandler(110,new Hm(St=>this.restoreFgColor(St))),this._parser.registerOscHandler(111,new Hm(St=>this.restoreBgColor(St))),this._parser.registerOscHandler(112,new Hm(St=>this.restoreCursorColor(St))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let St in Fp)this._parser.registerEscHandler({intermediates:"(",final:St},()=>this.selectCharset("("+St)),this._parser.registerEscHandler({intermediates:")",final:St},()=>this.selectCharset(")"+St)),this._parser.registerEscHandler({intermediates:"*",final:St},()=>this.selectCharset("*"+St)),this._parser.registerEscHandler({intermediates:"+",final:St},()=>this.selectCharset("+"+St)),this._parser.registerEscHandler({intermediates:"-",final:St},()=>this.selectCharset("-"+St)),this._parser.registerEscHandler({intermediates:".",final:St},()=>this.selectCharset("."+St)),this._parser.registerEscHandler({intermediates:"/",final:St},()=>this.selectCharset("/"+St));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(St=>(this._logService.error("Parsing error: ",St),St)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new dN((St,Ut)=>this.requestStatusString(St,Ut)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,u){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=u}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),gN))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${gN} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,u=this._activeBuffer.x,T=this._activeBuffer.y,$=0,K=this._parseStack.paused;if(K){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;u=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Vy&&($=this._parseStack.position+Vy)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,St=>String.fromCharCode(St)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(St=>St.charCodeAt(0)):e),this._parseBuffer.lengthVy)for(let St=$;St0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Ut);let pe=this._parser.precedingJoinState;for(let me=t;mect){if(yt){let kr=ne,It=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ve>0&&ne instanceof d5&&ne.copyCellsFrom(kr,It,0,Ve,!1);It=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ut);continue}if(St&&(ne.insertCells(this._activeBuffer.x,T-Ve,this._activeBuffer.getNullCell(Ut)),ne.getWidth(ct-1)===2&&ne.setCellFromCodepoint(ct-1,0,1,Ut)),ne.setCellFromCodepoint(this._activeBuffer.x++,u,T,Ut),T>0)for(;--T;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ut)}this._parser.precedingJoinState=pe,this._activeBuffer.x0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,Ut),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>mN(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new dN(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Hm(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,u=!1,T=!1){let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);$.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),T),u&&($.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let u=this._activeBuffer.lines.length-this._bufferService.rows;u>0&&(this._activeBuffer.lines.trimStart(u),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-u,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-u,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let yt=ct;for(let St=1;St0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(Ho.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(Ho.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(Ho.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(Ho.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(Ho.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t(Ce[Ce.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",Ce[Ce.SET=1]="SET",Ce[Ce.RESET=2]="RESET",Ce[Ce.PERMANENTLY_SET=3]="PERMANENTLY_SET",Ce[Ce.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(r||={});let u=this._coreService.decPrivateModes,{activeProtocol:T,activeEncoding:$}=this._coreMouseService,K=this._coreService,{buffers:ct,cols:yt}=this._bufferService,{active:St,alt:Ut}=ct,ne=this._optionsService.rawOptions,pe=(Ce,Ve)=>(K.triggerDataEvent(`${Ho.ESC}[${t?"":"?"}${Ce};${Ve}$y`),!0),me=Ce=>Ce?1:2,we=e.params[0];return t?we===2?pe(we,4):we===4?pe(we,me(K.modes.insertMode)):we===12?pe(we,3):we===20?pe(we,me(ne.convertEol)):pe(we,0):we===1?pe(we,me(u.applicationCursorKeys)):we===3?pe(we,ne.windowOptions.setWinLines?yt===80?2:yt===132?1:0:0):we===6?pe(we,me(u.origin)):we===7?pe(we,me(u.wraparound)):we===8?pe(we,3):we===9?pe(we,me(T==="X10")):we===12?pe(we,me(ne.cursorBlink)):we===25?pe(we,me(!K.isCursorHidden)):we===45?pe(we,me(u.reverseWraparound)):we===66?pe(we,me(u.applicationKeypad)):we===67?pe(we,4):we===1e3?pe(we,me(T==="VT200")):we===1002?pe(we,me(T==="DRAG")):we===1003?pe(we,me(T==="ANY")):we===1004?pe(we,me(u.sendFocus)):we===1005?pe(we,4):we===1006?pe(we,me($==="SGR")):we===1015?pe(we,4):we===1016?pe(we,me($==="SGR_PIXELS")):we===1048?pe(we,1):we===47||we===1047||we===1049?pe(we,me(St===Ut)):we===2004?pe(we,me(u.bracketedPasteMode)):we===2026?pe(we,me(u.synchronizedOutput)):pe(we,0)}_updateAttrColor(e,t,r,u,T){return t===2?(e|=50331648,e&=-16777216,e|=p4.fromColorRGB([r,u,T])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let u=[0,0,-1,0,0,0],T=0,$=0;do{if(u[$+T]=e.params[t+$],e.hasSubParams(t+$)){let K=e.getSubParams(t+$),ct=0;do u[1]===5&&(T=1),u[$+ct+1+T]=K[ct];while(++ct=2||u[1]===2&&$+T>=5)break;u[1]&&(T=1)}while(++$+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=bp.fg,e.bg=bp.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,u=this._curAttrData;for(let T=0;T=30&&r<=37?(u.fg&=-50331904,u.fg|=16777216|r-30):r>=40&&r<=47?(u.bg&=-50331904,u.bg|=16777216|r-40):r>=90&&r<=97?(u.fg&=-50331904,u.fg|=16777216|r-90|8):r>=100&&r<=107?(u.bg&=-50331904,u.bg|=16777216|r-100|8):r===0?this._processSGR0(u):r===1?u.fg|=134217728:r===3?u.bg|=67108864:r===4?(u.fg|=268435456,this._processUnderline(e.hasSubParams(T)?e.getSubParams(T)[0]:1,u)):r===5?u.fg|=536870912:r===7?u.fg|=67108864:r===8?u.fg|=1073741824:r===9?u.fg|=2147483648:r===2?u.bg|=134217728:r===21?this._processUnderline(2,u):r===22?(u.fg&=-134217729,u.bg&=-134217729):r===23?u.bg&=-67108865:r===24?(u.fg&=-268435457,this._processUnderline(0,u)):r===25?u.fg&=-536870913:r===27?u.fg&=-67108865:r===28?u.fg&=-1073741825:r===29?u.fg&=2147483647:r===39?(u.fg&=-67108864,u.fg|=bp.fg&16777215):r===49?(u.bg&=-67108864,u.bg|=bp.bg&16777215):r===38||r===48||r===58?T+=this._extractColor(e,T,u):r===53?u.bg|=1073741824:r===55?u.bg&=-1073741825:r===59?(u.extended=u.extended.clone(),u.extended.underlineColor=-1,u.updateExtended()):r===100?(u.fg&=-67108864,u.fg|=bp.fg&16777215,u.bg&=-67108864,u.bg|=bp.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${Ho.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Ho.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Ho.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=bp.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!mN(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Ho.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>pN&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>pN&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let u=r.shift(),T=r.shift();if(/^\d+$/.exec(u)){let $=parseInt(u);if(yN($))if(T==="?")t.push({type:0,index:$});else{let K=fN(T);K&&t.push({type:1,index:$,color:K})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),u=e.slice(t+1);return u?this._createHyperlink(r,u):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),u,T=r.findIndex($=>$.startsWith("id="));return T!==-1&&(u=r[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:u,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let u=0;u=this._specialColors.length);++u,++t)if(r[u]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let T=fN(r[u]);T&&this._onColor.fire([{type:1,index:this._specialColors[t],color:T}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let u=0;u=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=bp.clone(),this._eraseAttrDataInternal=bp.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new bg;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${Ho.ESC}${K}${Ho.ESC}\\`),!0),u=this._bufferService.buffer,T=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${u.scrollTop+1};${u.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[T.cursorStyle]-(T.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},X9=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(vN=e,e=t,t=vN),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};X9=Vf([fl(0,om)],X9);function yN(e){return 0<=e&&e<256}var PMt=5e7,_N=12,IMt=50,DMt=class extends Su{constructor(t){super(),this._action=t,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Is),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(t,r){if(r!==void 0&&this._syncCalls>r){this._syncCalls=0;return}if(this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let u;for(;u=this._writeBuffer.shift();){this._action(u);let T=this._callbacks.shift();T&&T()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(t,r){if(this._pendingData>PMt)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(r),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(r)}_innerWrite(t=0,r=!0){let u=t||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let T=this._writeBuffer[this._bufferOffset],$=this._action(T,r);if($){let ct=yt=>performance.now()-u>=_N?setTimeout(()=>this._innerWrite(0,yt)):this._innerWrite(u,yt);$.catch(yt=>(queueMicrotask(()=>{throw yt}),Promise.resolve(!1))).then(ct);return}let K=this._callbacks[this._bufferOffset];if(K&&K(),this._bufferOffset++,this._pendingData-=T.length,performance.now()-u>=_N)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>IMt&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},J9=class{constructor(t){this._bufferService=t,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(t){let r=this._bufferService.buffer;if(t.id===void 0){let yt=r.addMarker(r.ybase+r.y),St={data:t,id:this._nextId++,lines:[yt]};return yt.onDispose(()=>this._removeMarkerFromLink(St,yt)),this._dataByLinkId.set(St.id,St),St.id}let u=t,T=this._getEntryIdKey(u),$=this._entriesWithId.get(T);if($)return this.addLineToLink($.id,r.ybase+r.y),$.id;let K=r.addMarker(r.ybase+r.y),ct={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[K]};return K.onDispose(()=>this._removeMarkerFromLink(ct,K)),this._entriesWithId.set(ct.key,ct),this._dataByLinkId.set(ct.id,ct),ct.id}addLineToLink(t,r){let u=this._dataByLinkId.get(t);if(u&&u.lines.every(T=>T.line!==r)){let T=this._bufferService.buffer.addMarker(r);u.lines.push(T),T.onDispose(()=>this._removeMarkerFromLink(u,T))}}getLinkData(t){return this._dataByLinkId.get(t)?.data}_getEntryIdKey(t){return`${t.id};;${t.uri}`}_removeMarkerFromLink(t,r){let u=t.lines.indexOf(r);u!==-1&&(t.lines.splice(u,1),t.lines.length===0&&(t.data.id!==void 0&&this._entriesWithId.delete(t.key),this._dataByLinkId.delete(t.id)))}};J9=Vf([fl(0,om)],J9);var xN=!1,zMt=class extends Su{constructor(t){super(),this._windowsWrappingHeuristics=this._register(new G2),this._onBinary=this._register(new Is),this.onBinary=this._onBinary.event,this._onData=this._register(new Is),this.onData=this._onData.event,this._onLineFeed=this._register(new Is),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Is),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Is),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Is),this._instantiationService=new iMt,this.optionsService=this._register(new pMt(t)),this._instantiationService.setService(sm,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(G9)),this._instantiationService.setService(om,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(q9)),this._instantiationService.setService(eV,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Z9)),this._instantiationService.setService(Kx,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(K9)),this._instantiationService.setService(tV,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ex)),this._instantiationService.setService(tAt,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_Mt),this._instantiationService.setService(QCt,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(J9),this._instantiationService.setService(rV,this._oscLinkService),this._inputHandler=this._register(new LMt(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(b0.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(b0.forward(this._bufferService.onResize,this._onResize)),this._register(b0.forward(this.coreService.onData,this._onData)),this._register(b0.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new DMt((r,u)=>this._inputHandler.parse(r,u))),this._register(b0.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Is),this._onScroll.event(t=>{this._onScrollApi?.fire(t.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(t){for(let r in t)this.optionsService.options[r]=t[r]}write(t,r){this._writeBuffer.write(t,r)}writeSync(t,r){this._logService.logLevel<=3&&!xN&&(this._logService.warn("writeSync is unreliable and will be removed soon."),xN=!0),this._writeBuffer.writeSync(t,r)}input(t,r=!0){this.coreService.triggerDataEvent(t,r)}resize(t,r){isNaN(t)||isNaN(r)||(t=Math.max(t,zV),r=Math.max(r,OV),this._bufferService.resize(t,r))}scroll(t,r=!1){this._bufferService.scroll(t,r)}scrollLines(t,r){this._bufferService.scrollLines(t,r)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let r=t-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}registerEscHandler(t,r){return this._inputHandler.registerEscHandler(t,r)}registerDcsHandler(t,r){return this._inputHandler.registerDcsHandler(t,r)}registerCsiHandler(t,r){return this._inputHandler.registerCsiHandler(t,r)}registerOscHandler(t,r){return this._inputHandler.registerOscHandler(t,r)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let t=!1,r=this.optionsService.rawOptions.windowsPty;r&&r.buildNumber!==void 0&&r.buildNumber!==void 0?t=r.backend==="conpty"&&r.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(t=!0),t?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let t=[];t.push(this.onLineFeed(hN.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},()=>(hN(this._bufferService),!1))),this._windowsWrappingHeuristics.value=uf(()=>{for(let r of t)r.dispose()})}}},OMt={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function BMt(e,t,r,u){let T={type:0,cancel:!1,key:void 0},$=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?T.key=Ho.ESC+"OA":T.key=Ho.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?T.key=Ho.ESC+"OD":T.key=Ho.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?T.key=Ho.ESC+"OC":T.key=Ho.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?T.key=Ho.ESC+"OB":T.key=Ho.ESC+"[B");break;case 8:T.key=e.ctrlKey?"\b":Ho.DEL,e.altKey&&(T.key=Ho.ESC+T.key);break;case 9:if(e.shiftKey){T.key=Ho.ESC+"[Z";break}T.key=Ho.HT,T.cancel=!0;break;case 13:T.key=e.altKey?Ho.ESC+Ho.CR:Ho.CR,T.cancel=!0;break;case 27:T.key=Ho.ESC,e.altKey&&(T.key=Ho.ESC+Ho.ESC),T.cancel=!0;break;case 37:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"D":t?T.key=Ho.ESC+"OD":T.key=Ho.ESC+"[D";break;case 39:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"C":t?T.key=Ho.ESC+"OC":T.key=Ho.ESC+"[C";break;case 38:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"A":t?T.key=Ho.ESC+"OA":T.key=Ho.ESC+"[A";break;case 40:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"B":t?T.key=Ho.ESC+"OB":T.key=Ho.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(T.key=Ho.ESC+"[2~");break;case 46:$?T.key=Ho.ESC+"[3;"+($+1)+"~":T.key=Ho.ESC+"[3~";break;case 36:$?T.key=Ho.ESC+"[1;"+($+1)+"H":t?T.key=Ho.ESC+"OH":T.key=Ho.ESC+"[H";break;case 35:$?T.key=Ho.ESC+"[1;"+($+1)+"F":t?T.key=Ho.ESC+"OF":T.key=Ho.ESC+"[F";break;case 33:e.shiftKey?T.type=2:e.ctrlKey?T.key=Ho.ESC+"[5;"+($+1)+"~":T.key=Ho.ESC+"[5~";break;case 34:e.shiftKey?T.type=3:e.ctrlKey?T.key=Ho.ESC+"[6;"+($+1)+"~":T.key=Ho.ESC+"[6~";break;case 112:$?T.key=Ho.ESC+"[1;"+($+1)+"P":T.key=Ho.ESC+"OP";break;case 113:$?T.key=Ho.ESC+"[1;"+($+1)+"Q":T.key=Ho.ESC+"OQ";break;case 114:$?T.key=Ho.ESC+"[1;"+($+1)+"R":T.key=Ho.ESC+"OR";break;case 115:$?T.key=Ho.ESC+"[1;"+($+1)+"S":T.key=Ho.ESC+"OS";break;case 116:$?T.key=Ho.ESC+"[15;"+($+1)+"~":T.key=Ho.ESC+"[15~";break;case 117:$?T.key=Ho.ESC+"[17;"+($+1)+"~":T.key=Ho.ESC+"[17~";break;case 118:$?T.key=Ho.ESC+"[18;"+($+1)+"~":T.key=Ho.ESC+"[18~";break;case 119:$?T.key=Ho.ESC+"[19;"+($+1)+"~":T.key=Ho.ESC+"[19~";break;case 120:$?T.key=Ho.ESC+"[20;"+($+1)+"~":T.key=Ho.ESC+"[20~";break;case 121:$?T.key=Ho.ESC+"[21;"+($+1)+"~":T.key=Ho.ESC+"[21~";break;case 122:$?T.key=Ho.ESC+"[23;"+($+1)+"~":T.key=Ho.ESC+"[23~";break;case 123:$?T.key=Ho.ESC+"[24;"+($+1)+"~":T.key=Ho.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?T.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?T.key=Ho.NUL:e.keyCode>=51&&e.keyCode<=55?T.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?T.key=Ho.DEL:e.keyCode===219?T.key=Ho.ESC:e.keyCode===220?T.key=Ho.FS:e.keyCode===221&&(T.key=Ho.GS);else if((!r||u)&&e.altKey&&!e.metaKey){let K=OMt[e.keyCode]?.[e.shiftKey?1:0];if(K)T.key=Ho.ESC+K;else if(e.keyCode>=65&&e.keyCode<=90){let ct=e.ctrlKey?e.keyCode-64:e.keyCode+32,yt=String.fromCharCode(ct);e.shiftKey&&(yt=yt.toUpperCase()),T.key=Ho.ESC+yt}else if(e.keyCode===32)T.key=Ho.ESC+(e.ctrlKey?Ho.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let ct=e.code.slice(3,4);e.shiftKey||(ct=ct.toLowerCase()),T.key=Ho.ESC+ct,T.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(T.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?T.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(T.key=Ho.US),e.key==="@"&&(T.key=Ho.NUL));break}return T}var op=0,RMt=class{constructor(t){this._getKey=t,this._array=[],this._insertedValues=[],this._flushInsertedTask=new hS,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new hS,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(t){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(t)}_flushInserted(){let t=this._insertedValues.sort(($,K)=>this._getKey($)-this._getKey(K)),r=0,u=0,T=new Array(this._array.length+this._insertedValues.length);for(let $=0;$=this._array.length||this._getKey(t[r])<=this._getKey(this._array[u])?(T[$]=t[r],r++):T[$]=this._array[u++];this._array=T,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(t){if(this._flushCleanupInserted(),this._array.length===0)return!1;let r=this._getKey(t);if(r===void 0||(op=this._search(r),op===-1)||this._getKey(this._array[op])!==r)return!1;do if(this._array[op]===t)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(op),!0;while(++op$-K),r=0,u=new Array(this._array.length-t.length),T=0;for(let $=0;$0&&this._flushDeletedTask.flush()}*getKeyIterator(t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(op=this._search(t),!(op<0||op>=this._array.length)&&this._getKey(this._array[op])===t))do yield this._array[op];while(++op=this._array.length)&&this._getKey(this._array[op])===t))do r(this._array[op]);while(++op=r;){let T=r+u>>1,$=this._getKey(this._array[T]);if($>t)u=T-1;else if($0&&this._getKey(this._array[T-1])===t;)T--;return T}}return r}},fM=0,bN=0,FMt=class extends Su{constructor(){super(),this._decorations=new RMt(e=>e?.marker.line),this._onDecorationRegistered=this._register(new Is),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Is),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(uf(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new NMt(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),u=t.onDispose(()=>{u.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let u=0,T=0;for(let $ of this._decorations.getKeyIterator(t))u=$.options.x??0,T=u+($.options.width??1),e>=u&&e{fM=T.options.x??0,bN=fM+(T.options.width??1),e>=fM&&e=this._debounceThresholdMS)this._lastRefreshMs=T,this._innerRefresh();else if(!this._additionalRefreshRequested){let $=T-this._lastRefreshMs,K=this._debounceThresholdMS-$;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},K)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let t=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,r)}},wN=20,dS=class extends Su{constructor(e,t,r,u){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=u,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let T=this._coreBrowserService.mainDocument;this._accessibilityContainer=T.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=T.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let $=0;$this._handleBoundaryFocus($,0),this._bottomBoundaryFocusListener=$=>this._handleBoundaryFocus($,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=T.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new UMt(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize($=>this._handleResize($.rows))),this._register(this._terminal.onRender($=>this._refreshRows($.start,$.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar($=>this._handleChar($))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(t){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),kL&&t&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(t){let r=this._getMouseBufferCoords(t),u=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!u||!T||!r?!1:this._areCoordsInSelection(r,u,T)}isCellInSelection(t,r){let u=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!u||!T?!1:this._areCoordsInSelection([t,r],u,T)}_areCoordsInSelection(t,r,u){return t[1]>r[1]&&t[1]=r[0]&&t[0]=r[0]}_selectWordAtCursor(t,r){let u=this._linkifier.currentLink?.link?.range;if(u)return this._model.selectionStart=[u.start.x-1,u.start.y-1],this._model.selectionStartLength=QF(u,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let T=this._getMouseBufferCoords(t);return T?(this._selectWordAt(T,r),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(t,r){this._model.clearSelection(),t=Math.max(t,0),r=Math.min(r,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._bufferService.cols,r],this.refresh(),this._onSelectionChange.fire()}_handleTrim(t){this._model.handleTrim(t)&&this.refresh()}_getMouseBufferCoords(t){let r=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(r)return r[0]--,r[1]--,r[1]+=this._bufferService.buffer.ydisp,r}_getMouseEventScrollAmount(t){let r=wL(this._coreBrowserService.window,t,this._screenElement)[1],u=this._renderService.dimensions.css.canvas.height;return r>=0&&r<=u?0:(r>u&&(r-=u),r=Math.min(Math.max(r,-sM),sM),r/=sM,r/Math.abs(r)+Math.round(r*(J7t-1)))}shouldForceSelection(t){return uS?t.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:t.shiftKey}handleMouseDown(t){if(this._mouseDownTimeStamp=t.timeStamp,!(t.button===2&&this.hasSelection)&&t.button===0){if(!this._enabled){if(!this.shouldForceSelection(t))return;t.stopPropagation()}t.preventDefault(),this._dragScrollAmount=0,this._enabled&&t.shiftKey?this._handleIncrementalClick(t):t.detail===1?this._handleSingleClick(t):t.detail===2?this._handleDoubleClick(t):t.detail===3&&this._handleTripleClick(t),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),Q7t)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))}_handleSingleClick(t){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(t)?3:0,this._model.selectionStart=this._getMouseBufferCoords(t),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let r=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);r&&r.length!==this._model.selectionStart[0]&&r.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(t){this._selectWordAtCursor(t,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(t){let r=this._getMouseBufferCoords(t);r&&(this._activeSelectionMode=2,this._selectLineAt(r[1]))}shouldColumnSelect(t){return t.altKey&&!(uS&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(t){if(t.stopImmediatePropagation(),!this._model.selectionStart)return;let r=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let u=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(t.ydisp+this._bufferService.rows,t.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=t.ydisp),this.refresh()}}_handleMouseUp(t){let r=t.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&rthis._handleTrim(r))}_convertViewportColToCharacterIndex(t,r){let u=r;for(let T=0;r>=T;T++){let $=t.loadCell(T,this._workCell).getChars().length;this._workCell.getWidth()===0?u--:$>1&&r!==T&&(u+=$-1)}return u}setSelection(t,r,u){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[t,r],this._model.selectionStartLength=u,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(t){this._isClickInSelection(t)||(this._selectWordAtCursor(t,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(t,r,u=!0,T=!0){if(t[0]>=this._bufferService.cols)return;let $=this._bufferService.buffer,K=$.lines.get(t[1]);if(!K)return;let ct=$.translateBufferLineToString(t[1],!1),yt=this._convertViewportColToCharacterIndex(K,t[0]),St=yt,Ut=t[0]-yt,ne=0,pe=0,me=0,we=0;if(ct.charAt(yt)===" "){for(;yt>0&&ct.charAt(yt-1)===" ";)yt--;for(;St1&&(we+=rn-1,St+=rn-1);kr>0&&yt>0&&!this._isCharWordSeparator(K.loadCell(kr-1,this._workCell));){K.loadCell(kr-1,this._workCell);let Lr=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,kr--):Lr>1&&(me+=Lr-1,yt-=Lr-1),yt--,kr--}for(;It1&&(we+=Lr-1,St+=Lr-1),St++,It++}}St++;let Ce=yt+Ut-ne+me,Ve=Math.min(this._bufferService.cols,St-yt+ne+pe-me-we);if(!(!r&&ct.slice(yt,St).trim()==="")){if(u&&Ce===0&&K.getCodePoint(0)!==32){let kr=$.lines.get(t[1]-1);if(kr&&K.isWrapped&&kr.getCodePoint(this._bufferService.cols-1)!==32){let It=this._getWordAt([this._bufferService.cols-1,t[1]-1],!1,!0,!1);if(It){let rn=this._bufferService.cols-It.start;Ce-=rn,Ve+=rn}}}if(T&&Ce+Ve===this._bufferService.cols&&K.getCodePoint(this._bufferService.cols-1)!==32){let kr=$.lines.get(t[1]+1);if(kr?.isWrapped&&kr.getCodePoint(0)!==32){let It=this._getWordAt([0,t[1]+1],!1,!1,!0);It&&(Ve+=It.length)}}return{start:Ce,length:Ve}}}_selectWordAt(t,r){let u=this._getWordAt(t,r);if(u){for(;u.start<0;)u.start+=this._bufferService.cols,t[1]--;this._model.selectionStart=[u.start,t[1]],this._model.selectionStartLength=u.length}}_selectToWordAt(t){let r=this._getWordAt(t,!0);if(r){let u=t[1];for(;r.start<0;)r.start+=this._bufferService.cols,u--;if(!this._model.areSelectionValuesReversed())for(;r.start+r.length>this._bufferService.cols;)r.length-=this._bufferService.cols,u++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?r.start:r.start+r.length,u]}}_isCharWordSeparator(t){return t.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(t.getChars())>=0}_selectLineAt(t){let r=this._bufferService.buffer.getWrappedRangeForLine(t),u={start:{x:0,y:r.first},end:{x:this._bufferService.cols-1,y:r.last}};this._model.selectionStart=[0,r.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=QF(u,this._bufferService.cols)}};V9=Vf([fl(3,om),fl(4,Yx),fl(5,mL),fl(6,sm),fl(7,K1),fl(8,Z1)],V9);var tN=class{constructor(){this._data={}}set(t,r,u){this._data[t]||(this._data[t]={}),this._data[t][r]=u}get(t,r){return this._data[t]?this._data[t][r]:void 0}clear(){this._data={}}},eN=class{constructor(){this._color=new tN,this._css=new tN}setCss(t,r,u){this._css.set(t,r,u)}getCss(t,r){return this._css.get(t,r)}setColor(t,r,u){this._color.set(t,r,u)}getColor(t,r){return this._color.get(t,r)}clear(){this._color.clear(),this._css.clear()}},Ip=Object.freeze((()=>{let e=[Tf.toColor("#2e3436"),Tf.toColor("#cc0000"),Tf.toColor("#4e9a06"),Tf.toColor("#c4a000"),Tf.toColor("#3465a4"),Tf.toColor("#75507b"),Tf.toColor("#06989a"),Tf.toColor("#d3d7cf"),Tf.toColor("#555753"),Tf.toColor("#ef2929"),Tf.toColor("#8ae234"),Tf.toColor("#fce94f"),Tf.toColor("#729fcf"),Tf.toColor("#ad7fa8"),Tf.toColor("#34e2e2"),Tf.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let u=t[r/36%6|0],T=t[r/6%6|0],$=t[r%6];e.push({css:kp.toCss(u,T,$),rgba:kp.toRgba(u,T,$)})}for(let r=0;r<24;r++){let u=8+r*10;e.push({css:kp.toCss(u,u,u),rgba:kp.toRgba(u,u,u)})}return e})()),bx=Tf.toColor("#ffffff"),h5=Tf.toColor("#000000"),rN=Tf.toColor("#ffffff"),nN=h5,K3={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},nMt=bx,W9=class extends Su{constructor(t){super(),this._optionsService=t,this._contrastCache=new eN,this._halfContrastCache=new eN,this._onChangeColors=this._register(new Is),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:bx,background:h5,cursor:rN,cursorAccent:nN,selectionForeground:void 0,selectionBackgroundTransparent:K3,selectionBackgroundOpaque:Zd.blend(h5,K3),selectionInactiveBackgroundTransparent:K3,selectionInactiveBackgroundOpaque:Zd.blend(h5,K3),scrollbarSliderBackground:Zd.opacity(bx,.2),scrollbarSliderHoverBackground:Zd.opacity(bx,.4),scrollbarSliderActiveBackground:Zd.opacity(bx,.5),overviewRulerBorder:bx,ansi:Ip.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(t={}){let r=this._colors;if(r.foreground=yd(t.foreground,bx),r.background=yd(t.background,h5),r.cursor=Zd.blend(r.background,yd(t.cursor,rN)),r.cursorAccent=Zd.blend(r.background,yd(t.cursorAccent,nN)),r.selectionBackgroundTransparent=yd(t.selectionBackground,K3),r.selectionBackgroundOpaque=Zd.blend(r.background,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundTransparent=yd(t.selectionInactiveBackground,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundOpaque=Zd.blend(r.background,r.selectionInactiveBackgroundTransparent),r.selectionForeground=t.selectionForeground?yd(t.selectionForeground,YF):void 0,r.selectionForeground===YF&&(r.selectionForeground=void 0),Zd.isOpaque(r.selectionBackgroundTransparent)&&(r.selectionBackgroundTransparent=Zd.opacity(r.selectionBackgroundTransparent,.3)),Zd.isOpaque(r.selectionInactiveBackgroundTransparent)&&(r.selectionInactiveBackgroundTransparent=Zd.opacity(r.selectionInactiveBackgroundTransparent,.3)),r.scrollbarSliderBackground=yd(t.scrollbarSliderBackground,Zd.opacity(r.foreground,.2)),r.scrollbarSliderHoverBackground=yd(t.scrollbarSliderHoverBackground,Zd.opacity(r.foreground,.4)),r.scrollbarSliderActiveBackground=yd(t.scrollbarSliderActiveBackground,Zd.opacity(r.foreground,.5)),r.overviewRulerBorder=yd(t.overviewRulerBorder,nMt),r.ansi=Ip.slice(),r.ansi[0]=yd(t.black,Ip[0]),r.ansi[1]=yd(t.red,Ip[1]),r.ansi[2]=yd(t.green,Ip[2]),r.ansi[3]=yd(t.yellow,Ip[3]),r.ansi[4]=yd(t.blue,Ip[4]),r.ansi[5]=yd(t.magenta,Ip[5]),r.ansi[6]=yd(t.cyan,Ip[6]),r.ansi[7]=yd(t.white,Ip[7]),r.ansi[8]=yd(t.brightBlack,Ip[8]),r.ansi[9]=yd(t.brightRed,Ip[9]),r.ansi[10]=yd(t.brightGreen,Ip[10]),r.ansi[11]=yd(t.brightYellow,Ip[11]),r.ansi[12]=yd(t.brightBlue,Ip[12]),r.ansi[13]=yd(t.brightMagenta,Ip[13]),r.ansi[14]=yd(t.brightCyan,Ip[14]),r.ansi[15]=yd(t.brightWhite,Ip[15]),t.extendedAnsi){let u=Math.min(r.ansi.length-16,t.extendedAnsi.length);for(let T=0;T$.index-K.index),u=[];for(let $ of r){let K=this._services.get($.id);if(!K)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${$.id._id}.`);u.push(K)}let T=r.length>0?r[0].index:t.length;if(t.length!==T)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${T+1} conflicts with ${t.length} static arguments`);return new e(...t,...u)}},oMt={trace:0,debug:1,info:2,warn:3,error:4,off:5},sMt="xterm.js: ",q9=class extends Su{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=oMt[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let r=0;rthis._length)for(let r=this._length;r=t;T--)this._array[this._getCyclicIndex(T+u.length)]=this._array[this._getCyclicIndex(T)];for(let T=0;Tthis._maxLength){let T=this._length+u.length-this._maxLength;this._startIndex+=T,this._length=this._maxLength,this.onTrimEmitter.fire(T)}else this._length+=u.length}trimStart(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)}shiftElements(t,r,u){if(!(r<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let $=r-1;$>=0;$--)this.set(t+$+u,this.get(t+$));let T=t+r+u-this._length;if(T>0)for(this._length+=T;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let T=0;T>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):u]}set(t,r){this._data[t*Tu+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Tu+0]=t|2097152|r[2]<<22):this._data[t*Tu+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Tu+0]>>22}hasWidth(t){return this._data[t*Tu+0]&12582912}getFg(t){return this._data[t*Tu+1]}getBg(t){return this._data[t*Tu+2]}hasContent(t){return this._data[t*Tu+0]&4194303}getCodePoint(t){let r=this._data[t*Tu+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Tu+0]&2097152}getString(t){let r=this._data[t*Tu+0];return r&2097152?this._combined[t]:r&2097151?a_(r&2097151):""}isProtected(t){return this._data[t*Tu+2]&536870912}loadCell(t,r){return lT=t*Tu,r.content=this._data[lT+0],r.fg=this._data[lT+1],r.bg=this._data[lT+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Tu+0]=r.content,this._data[t*Tu+1]=r.fg,this._data[t*Tu+2]=r.bg}setCellFromCodepoint(t,r,u,T){T.bg&268435456&&(this._extendedAttrs[t]=T.extended),this._data[t*Tu+0]=r|u<<22,this._data[t*Tu+1]=T.fg,this._data[t*Tu+2]=T.bg}addCodepointToCell(t,r,u){let T=this._data[t*Tu+0];T&2097152?this._combined[t]+=a_(r):T&2097151?(this._combined[t]=a_(T&2097151)+a_(r),T&=-2097152,T|=2097152):T=r|1<<22,u&&(T&=-12582913,T|=u<<22),this._data[t*Tu+0]=T}insertCells(t,r,u){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,u),r=0;--$)this.setCell(t+r+$,this.loadCell(t+$,T));for(let $=0;$this.length){if(this._data.buffer.byteLength>=u*4)this._data=new Uint32Array(this._data.buffer,0,u);else{let T=new Uint32Array(u);T.set(this._data),this._data=T}for(let T=this.length;T=t&&delete this._combined[ct]}let $=Object.keys(this._extendedAttrs);for(let K=0;K<$.length;K++){let ct=parseInt($[K],10);ct>=t&&delete this._extendedAttrs[ct]}}return this.length=t,u*4*lM=0;--t)if(this._data[t*Tu+0]&4194303)return t+(this._data[t*Tu+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Tu+0]&4194303||this._data[t*Tu+2]&50331648)return t+(this._data[t*Tu+0]>>22);return 0}copyCellsFrom(t,r,u,T,$){let K=t._data;if($)for(let yt=T-1;yt>=0;yt--){for(let St=0;St=r&&(this._combined[St-r+u]=t._combined[St])}}translateToString(t,r,u,T){r=r??0,u=u??this.length,t&&(u=Math.min(u,this.getTrimmedLength())),T&&(T.length=0);let $="";for(;r>22||1}return T&&T.push(r),$}};function lMt(e,t,r,u,T,$){let K=[];for(let ct=0;ct=ct&&u0&&(Ve>ne||Ut[Ve].getTrimmedLength()===0);Ve--)Ce++;Ce>0&&(K.push(ct+Ut.length-Ce),K.push(Ce)),ct+=Ut.length-1}return K}function cMt(e,t){let r=[],u=0,T=t[u],$=0;for(let K=0;KJ5(e,St,t)).reduce((yt,St)=>yt+St),$=0,K=0,ct=0;for(;ctyt&&($-=yt,K++);let St=e[K].getWidth($-1)===2;St&&$--;let Ut=St?r-1:r;u.push(Ut),ct+=Ut}return u}function J5(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let u=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,T=e[t+1].getWidth(0)===2;return u&&T?r-1:r}var IV=class DV{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=DV._nextId++,this._onDispose=this.register(new Is),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Vx(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};IV._nextId=1;var dMt=IV,Fp={},wx=Fp.B;Fp[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Fp.A={"#":"£"};Fp.B=void 0;Fp[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Fp.C=Fp[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Fp.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Fp.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Fp.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Fp.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Fp.E=Fp[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Fp.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Fp.H=Fp[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Fp["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var aN=4294967295,oN=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=bp.clone(),this.savedCharset=wx,this.markers=[],this._nullCell=bg.fromCharData([0,YH,1,0]),this._whitespaceCell=bg.fromCharData([0,h_,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new hS,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new iN(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new sS),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new sS),this._whitespaceCell}getBlankLine(e,t){return new d5(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&eaN?aN:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=bp);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new iN(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(bp),u=0,T=this._getCorrectBufferLength(t);if(T>this.lines.maxLength&&(this.lines.maxLength=T),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+$+1?(this.ybase--,$++,this.ydisp>0&&this.ydisp--):this.lines.push(new d5(e,r)));else for(let K=this._rows;K>t;K--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(T0&&(this.lines.trimStart(K),this.ybase=Math.max(this.ybase-K,0),this.ydisp=Math.max(this.ydisp-K,0),this.savedY=Math.max(this.savedY-K,0)),this.lines.maxLength=T}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),$&&(this.y+=$),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let $=0;$.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,u=lMt(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(bp),r);if(u.length>0){let T=cMt(this.lines,u);uMt(this.lines,T.layout),this._reflowLargerAdjustViewport(e,t,T.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let u=this.getNullCell(bp),T=r;for(;T-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;K--){let ct=this.lines.get(K);if(!ct||!ct.isWrapped&&ct.getTrimmedLength()<=e)continue;let yt=[ct];for(;ct.isWrapped&&K>0;)ct=this.lines.get(--K),yt.unshift(ct);if(!r){let rn=this.ybase+this.y;if(rn>=K&&rn0&&(T.push({start:K+yt.length+$,newLines:me}),$+=me.length),yt.push(...me);let we=Ut.length-1,Ce=Ut[we];Ce===0&&(we--,Ce=Ut[we]);let Ve=yt.length-ne-1,kr=St;for(;Ve>=0;){let rn=Math.min(kr,Ce);if(yt[we]===void 0)break;if(yt[we].copyCellsFrom(yt[Ve],kr-rn,Ce-rn,rn,!0),Ce-=rn,Ce===0&&(we--,Ce=Ut[we]),kr-=rn,kr===0){Ve--;let Lr=Math.max(Ve,0);kr=J5(yt,Lr,this._cols)}}for(let rn=0;rn0;)this.ybase===0?this.y0){let K=[],ct=[];for(let Ce=0;Ce=0;Ce--)if(ne&&ne.start>St+pe){for(let Ve=ne.newLines.length-1;Ve>=0;Ve--)this.lines.set(Ce--,ne.newLines[Ve]);Ce++,K.push({index:St+1,amount:ne.newLines.length}),pe+=ne.newLines.length,ne=T[++Ut]}else this.lines.set(Ce,ct[St--]);let me=0;for(let Ce=K.length-1;Ce>=0;Ce--)K[Ce].index+=me,this.lines.onInsertEmitter.fire(K[Ce]),me+=K[Ce].amount;let we=Math.max(0,yt+$-this.lines.maxLength);we>0&&this.lines.onTrimEmitter.fire(we)}}translateBufferLineToString(e,t,r=0,u){let T=this.lines.get(e);return T?T.translateToString(t,r,u):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.liner.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},fMt=class extends Su{constructor(t,r){super(),this._optionsService=t,this._bufferService=r,this._onBufferActivate=this._register(new Is),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new oN(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new oN(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(t,r){this._normal.resize(t,r),this._alt.resize(t,r),this.setupTabStops(t)}setupTabStops(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)}},zV=2,OV=1,G9=class extends Su{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Is),this.onResize=this._onResize.event,this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,zV),this.rows=Math.max(e.rawOptions.rows||0,OV),this.buffers=this._register(new fMt(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,u=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,u;u=this._cachedBlankLine,(!u||u.length!==this.cols||u.getFg(0)!==e.fg||u.getBg(0)!==e.bg)&&(u=r.getBlankLine(e,t),this._cachedBlankLine=u),u.isWrapped=t;let T=r.ybase+r.scrollTop,$=r.ybase+r.scrollBottom;if(r.scrollTop===0){let K=r.lines.isFull;$===r.lines.length-1?K?r.lines.recycle().copyFrom(u):r.lines.push(u.clone()):r.lines.splice($+1,0,u.clone()),K?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let K=$-T+1;r.lines.shiftElements(T+1,K-1,-1),r.lines.set($,u.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let u=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),u!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};G9=Vf([fl(0,sm)],G9);var x2={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:uS,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},pMt=["normal","bold","100","200","300","400","500","600","700","800","900"],mMt=class extends Su{constructor(t){super(),this._onOptionChange=this._register(new Is),this.onOptionChange=this._onOptionChange.event;let r={...x2};for(let u in t)if(u in r)try{let T=t[u];r[u]=this._sanitizeAndValidateOption(u,T)}catch(T){console.error(T)}this.rawOptions=r,this.options={...r},this._setupOptions(),this._register(uf(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(t,r){return this.onOptionChange(u=>{u===t&&r(this.rawOptions[t])})}onMultipleOptionChange(t,r){return this.onOptionChange(u=>{t.indexOf(u)!==-1&&r()})}_setupOptions(){let t=u=>{if(!(u in x2))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},r=(u,T)=>{if(!(u in x2))throw new Error(`No option with key "${u}"`);T=this._sanitizeAndValidateOption(u,T),this.rawOptions[u]!==T&&(this.rawOptions[u]=T,this._onOptionChange.fire(u))};for(let u in this.rawOptions){let T={get:t.bind(this,u),set:r.bind(this,u)};Object.defineProperty(this.options,u,T)}}_sanitizeAndValidateOption(t,r){switch(t){case"cursorStyle":if(r||(r=x2[t]),!gMt(r))throw new Error(`"${r}" is not a valid value for ${t}`);break;case"wordSeparator":r||(r=x2[t]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=pMt.includes(r)?r:x2[t];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${t} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(r*10)/10));break;case"scrollback":if(r=Math.min(r,4294967295),r<0)throw new Error(`${t} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${t} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${t} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{};break}return r}};function gMt(e){return e==="block"||e==="underline"||e==="bar"}function f5(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let u in e)r[u]=t<=1?e[u]:e[u]&&f5(e[u],t-1);return r}var sN=Object.freeze({insertMode:!1}),lN=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Z9=class extends Su{constructor(t,r,u){super(),this._bufferService=t,this._logService=r,this._optionsService=u,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Is),this.onData=this._onData.event,this._onUserInput=this._register(new Is),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Is),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Is),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=f5(sN),this.decPrivateModes=f5(lN)}reset(){this.modes=f5(sN),this.decPrivateModes=f5(lN)}triggerDataEvent(t,r=!1){if(this._optionsService.rawOptions.disableStdin)return;let u=this._bufferService.buffer;r&&this._optionsService.rawOptions.scrollOnUserInput&&u.ybase!==u.ydisp&&this._onRequestScrollToBottom.fire(),r&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`),this._logService.trace("sending data (codes)",()=>t.split("").map(T=>T.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`),this._logService.trace("sending binary (codes)",()=>t.split("").map(r=>r.charCodeAt(0))),this._onBinary.fire(t))}};Z9=Vf([fl(0,om),fl(1,eV),fl(2,sm)],Z9);var cN={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function cM(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var uM=String.fromCharCode,uN={DEFAULT:e=>{let t=[cM(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${uM(t[0])}${uM(t[1])}${uM(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${cM(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${cM(e,!0)};${e.x};${e.y}${t}`}},K9=class extends Su{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Is),this.onProtocolChange=this._onProtocolChange.event;for(let u of Object.keys(cN))this.addProtocol(u,cN[u]);for(let u of Object.keys(uN))this.addEncoding(u,uN[u]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let u=t/r,T=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(T/=u+0,Math.abs(e.deltaY)<50&&(T*=.3),this._wheelPartialScroll+=T,T=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(T*=this._bufferService.rows),T}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};K9=Vf([fl(0,om),fl(1,Yx),fl(2,sm)],K9);var hM=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],vMt=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Dp;function yMt(e,t){let r=0,u=t.length-1,T;if(et[u][1])return!1;for(;u>=r;)if(T=r+u>>1,e>t[T][1])r=T+1;else if(e=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,r){let u=this.wcwidth(t),T=u===0&&r!==0;if(T){let $=Lx.extractWidth(r);$===0?T=!1:$>u&&(u=$)}return Lx.createPropertyValue(0,u,T)}},Lx=class IT{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Is,this.onChange=this._onChange.event;let t=new _Mt;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,u=!1){return(t&16777215)<<3|(r&3)<<1|(u?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,u=0,T=t.length;for(let $=0;$=T)return r+this.wcwidth(K);let St=t.charCodeAt($);56320<=St&&St<=57343?K=(K-55296)*1024+St-56320+65536:r+=this.wcwidth(St)}let ct=this.charProperties(K,u),yt=IT.extractWidth(ct);IT.extractShouldJoin(ct)&&(yt-=IT.extractWidth(u)),r+=yt,u=ct}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},xMt=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(t){this.glevel=t,this.charset=this._charsets[t]}setgCharset(t,r){this._charsets[t]=r,this.glevel===t&&(this.charset=r)}};function hN(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var Y3=2147483647,bMt=256,BV=class Y9{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>bMt)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new Y9;if(!t.length)return r;for(let u=Array.isArray(t[0])?1:0;u>8,T=this._subParamsIdx[r]&255;T-u>0&&t.push(Array.prototype.slice.call(this._subParams,u,T))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Y3?Y3:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Y3?Y3:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,u=this._subParamsIdx[t]&255;return u-r>0?this._subParams.subarray(r,u):null}getSubParamsAll(){let t={};for(let r=0;r>8,T=this._subParamsIdx[r]&255;T-u>0&&(t[r]=this._subParams.slice(u,T))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let u=this._digitIsSub?this._subParams:this.params,T=u[r-1];u[r-1]=~T?Math.min(T*10+t,Y3):t}},X3=[],wMt=class{constructor(){this._state=0,this._active=X3,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(t,r){this._handlers[t]===void 0&&(this._handlers[t]=[]);let u=this._handlers[t];return u.push(r),{dispose:()=>{let T=u.indexOf(r);T!==-1&&u.splice(T,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=X3}reset(){if(this._state===2)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].end(!1);this._stack.paused=!1,this._active=X3,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||X3,!this._active.length)this._handlerFb(this._id,"START");else for(let t=this._active.length-1;t>=0;t--)this._active[t].start()}_put(t,r,u){if(!this._active.length)this._handlerFb(this._id,"PUT",YS(t,r,u));else for(let T=this._active.length-1;T>=0;T--)this._active[T].put(t,r,u)}start(){this.reset(),this._state=1}put(t,r,u){if(this._state!==3){if(this._state===1)for(;r0&&this._put(t,r,u)}}end(t,r=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",t);else{let u=!1,T=this._active.length-1,$=!1;if(this._stack.paused&&(T=this._stack.loopPosition-1,u=r,$=this._stack.fallThrough,this._stack.paused=!1),!$&&u===!1){for(;T>=0&&(u=this._active[T].end(t),u!==!0);T--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!1,u;T--}for(;T>=0;T--)if(u=this._active[T].end(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!0,u}this._active=X3,this._id=-1,this._state=0}}},Hm=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,r,u){this._hitLimit||(this._data+=YS(t,r,u),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let r=!1;if(this._hitLimit)r=!1;else if(t&&(r=this._handler(this._data),r instanceof Promise))return r.then(u=>(this._data="",this._hitLimit=!1,u));return this._data="",this._hitLimit=!1,r}},J3=[],kMt=class{constructor(){this._handlers=Object.create(null),this._active=J3,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=J3}registerHandler(t,r){this._handlers[t]===void 0&&(this._handlers[t]=[]);let u=this._handlers[t];return u.push(r),{dispose:()=>{let T=u.indexOf(r);T!==-1&&u.splice(T,1)}}}clearHandler(t){this._handlers[t]&&delete this._handlers[t]}setHandlerFallback(t){this._handlerFb=t}reset(){if(this._active.length)for(let t=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;t>=0;--t)this._active[t].unhook(!1);this._stack.paused=!1,this._active=J3,this._ident=0}hook(t,r){if(this.reset(),this._ident=t,this._active=this._handlers[t]||J3,!this._active.length)this._handlerFb(this._ident,"HOOK",r);else for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(r)}put(t,r,u){if(!this._active.length)this._handlerFb(this._ident,"PUT",YS(t,r,u));else for(let T=this._active.length-1;T>=0;T--)this._active[T].put(t,r,u)}unhook(t,r=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",t);else{let u=!1,T=this._active.length-1,$=!1;if(this._stack.paused&&(T=this._stack.loopPosition-1,u=r,$=this._stack.fallThrough,this._stack.paused=!1),!$&&u===!1){for(;T>=0&&(u=this._active[T].unhook(t),u!==!0);T--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!1,u;T--}for(;T>=0;T--)if(u=this._active[T].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!0,u}this._active=J3,this._ident=0}},p5=new BV;p5.addParam(0);var dN=class{constructor(e){this._handler=e,this._data="",this._params=p5,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():p5,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=YS(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=p5,this._data="",this._hitLimit=!1,r));return this._params=p5,this._data="",this._hitLimit=!1,t}},TMt=class{constructor(t){this.table=new Uint8Array(t)}setDefault(t,r){this.table.fill(t<<4|r)}add(t,r,u,T){this.table[r<<8|t]=u<<4|T}addMany(t,r,u,T){for(let $=0;$yt),r=(ct,yt)=>t.slice(ct,yt),u=r(32,127),T=r(0,24);T.push(25),T.push.apply(T,r(28,32));let $=r(0,14),K;e.setDefault(1,0),e.addMany(u,0,2,0);for(K in $)e.addMany([24,26,153,154],K,3,0),e.addMany(r(128,144),K,3,0),e.addMany(r(144,152),K,3,0),e.add(156,K,0,0),e.add(27,K,11,1),e.add(157,K,4,8),e.addMany([152,158,159],K,0,7),e.add(155,K,11,3),e.add(144,K,11,9);return e.addMany(T,0,3,0),e.addMany(T,1,3,1),e.add(127,1,0,1),e.addMany(T,8,0,8),e.addMany(T,3,3,3),e.add(127,3,0,3),e.addMany(T,4,3,4),e.add(127,4,0,4),e.addMany(T,6,3,6),e.addMany(T,5,3,5),e.add(127,5,0,5),e.addMany(T,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(u,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(u,7,0,7),e.addMany(T,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(T,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(T,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(T,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(T,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(T,13,13,13),e.addMany(u,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(mg,0,2,0),e.add(mg,8,5,8),e.add(mg,6,0,6),e.add(mg,11,0,11),e.add(mg,13,13,13),e}(),CMt=class extends Su{constructor(t=SMt){super(),this._transitions=t,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new BV,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(r,u,T)=>{},this._executeHandlerFb=r=>{},this._csiHandlerFb=(r,u)=>{},this._escHandlerFb=r=>{},this._errorHandlerFb=r=>r,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(uf(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new wMt),this._dcsParser=this._register(new kMt),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(t,r=[64,126]){let u=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if(u=t.prefix.charCodeAt(0),u&&60>u||u>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let $=0;$K||K>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");u<<=8,u|=K}}if(t.final.length!==1)throw new Error("final must be a single byte");let T=t.final.charCodeAt(0);if(r[0]>T||T>r[1])throw new Error(`final must be in range ${r[0]} .. ${r[1]}`);return u<<=8,u|=T,u}identToString(t){let r=[];for(;t;)r.push(String.fromCharCode(t&255)),t>>=8;return r.reverse().join("")}setPrintHandler(t){this._printHandler=t}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(t,r){let u=this._identifier(t,[48,126]);this._escHandlers[u]===void 0&&(this._escHandlers[u]=[]);let T=this._escHandlers[u];return T.push(r),{dispose:()=>{let $=T.indexOf(r);$!==-1&&T.splice($,1)}}}clearEscHandler(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]}setEscHandlerFallback(t){this._escHandlerFb=t}setExecuteHandler(t,r){this._executeHandlers[t.charCodeAt(0)]=r}clearExecuteHandler(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]}setExecuteHandlerFallback(t){this._executeHandlerFb=t}registerCsiHandler(t,r){let u=this._identifier(t);this._csiHandlers[u]===void 0&&(this._csiHandlers[u]=[]);let T=this._csiHandlers[u];return T.push(r),{dispose:()=>{let $=T.indexOf(r);$!==-1&&T.splice($,1)}}}clearCsiHandler(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]}setCsiHandlerFallback(t){this._csiHandlerFb=t}registerDcsHandler(t,r){return this._dcsParser.registerHandler(this._identifier(t),r)}clearDcsHandler(t){this._dcsParser.clearHandler(this._identifier(t))}setDcsHandlerFallback(t){this._dcsParser.setHandlerFallback(t)}registerOscHandler(t,r){return this._oscParser.registerHandler(t,r)}clearOscHandler(t){this._oscParser.clearHandler(t)}setOscHandlerFallback(t){this._oscParser.setHandlerFallback(t)}setErrorHandler(t){this._errorHandler=t}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(t,r,u,T,$){this._parseStack.state=t,this._parseStack.handlers=r,this._parseStack.handlerPos=u,this._parseStack.transition=T,this._parseStack.chunkPos=$}parse(t,r,u){let T=0,$=0,K=0,ct;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,K=this._parseStack.chunkPos+1;else{if(u===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let yt=this._parseStack.handlers,St=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(u===!1&&St>-1){for(;St>=0&&(ct=yt[St](this._params),ct!==!0);St--)if(ct instanceof Promise)return this._parseStack.handlerPos=St,ct}this._parseStack.handlers=[];break;case 4:if(u===!1&&St>-1){for(;St>=0&&(ct=yt[St](),ct!==!0);St--)if(ct instanceof Promise)return this._parseStack.handlerPos=St,ct}this._parseStack.handlers=[];break;case 6:if(T=t[this._parseStack.chunkPos],ct=this._dcsParser.unhook(T!==24&&T!==26,u),ct)return ct;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=t[this._parseStack.chunkPos],ct=this._oscParser.end(T!==24&&T!==26,u),ct)return ct;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,K=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let yt=K;yt>4){case 2:for(let me=yt+1;;++me){if(me>=r||(T=t[me])<32||T>126&&T=r||(T=t[me])<32||T>126&&T=r||(T=t[me])<32||T>126&&T=r||(T=t[me])<32||T>126&&T=0&&(ct=St[Ut](this._params),ct!==!0);Ut--)if(ct instanceof Promise)return this._preserveStack(3,St,Ut,$,yt),ct;Ut<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++yt47&&T<60);yt--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:let ne=this._escHandlers[this._collect<<8|T],pe=ne?ne.length-1:-1;for(;pe>=0&&(ct=ne[pe](),ct!==!0);pe--)if(ct instanceof Promise)return this._preserveStack(4,ne,pe,$,yt),ct;pe<0&&this._escHandlerFb(this._collect<<8|T),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|T,this._params);break;case 13:for(let me=yt+1;;++me)if(me>=r||(T=t[me])===24||T===26||T===27||T>127&&T=r||(T=t[me])<32||T>127&&T>4:$>>8}return u}}function dM(e,t){let r=e.toString(16),u=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}function EMt(e,t=16){let[r,u,T]=e;return`rgb:${dM(r,t)}/${dM(u,t)}/${dM(T,t)}`}var LMt={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Vy=131072,pN=10;function mN(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var gN=5e3,vN=0,PMt=class extends Su{constructor(e,t,r,u,T,$,K,ct,yt=new CMt){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=u,this._optionsService=T,this._oscLinkService=$,this._coreMouseService=K,this._unicodeService=ct,this._parser=yt,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new YCt,this._utf8Decoder=new XCt,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=bp.clone(),this._eraseAttrDataInternal=bp.clone(),this._onRequestBell=this._register(new Is),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Is),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Is),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Is),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Is),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Is),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Is),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Is),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Is),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Is),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Is),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Is),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Is),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new X9(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(St=>this._activeBuffer=St.activeBuffer)),this._parser.setCsiHandlerFallback((St,Ut)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(St),params:Ut.toArray()})}),this._parser.setEscHandlerFallback(St=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(St)})}),this._parser.setExecuteHandlerFallback(St=>{this._logService.debug("Unknown EXECUTE code: ",{code:St})}),this._parser.setOscHandlerFallback((St,Ut,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:St,action:Ut,data:ne})}),this._parser.setDcsHandlerFallback((St,Ut,ne)=>{Ut==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(St),action:Ut,payload:ne})}),this._parser.setPrintHandler((St,Ut,ne)=>this.print(St,Ut,ne)),this._parser.registerCsiHandler({final:"@"},St=>this.insertChars(St)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},St=>this.scrollLeft(St)),this._parser.registerCsiHandler({final:"A"},St=>this.cursorUp(St)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},St=>this.scrollRight(St)),this._parser.registerCsiHandler({final:"B"},St=>this.cursorDown(St)),this._parser.registerCsiHandler({final:"C"},St=>this.cursorForward(St)),this._parser.registerCsiHandler({final:"D"},St=>this.cursorBackward(St)),this._parser.registerCsiHandler({final:"E"},St=>this.cursorNextLine(St)),this._parser.registerCsiHandler({final:"F"},St=>this.cursorPrecedingLine(St)),this._parser.registerCsiHandler({final:"G"},St=>this.cursorCharAbsolute(St)),this._parser.registerCsiHandler({final:"H"},St=>this.cursorPosition(St)),this._parser.registerCsiHandler({final:"I"},St=>this.cursorForwardTab(St)),this._parser.registerCsiHandler({final:"J"},St=>this.eraseInDisplay(St,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},St=>this.eraseInDisplay(St,!0)),this._parser.registerCsiHandler({final:"K"},St=>this.eraseInLine(St,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},St=>this.eraseInLine(St,!0)),this._parser.registerCsiHandler({final:"L"},St=>this.insertLines(St)),this._parser.registerCsiHandler({final:"M"},St=>this.deleteLines(St)),this._parser.registerCsiHandler({final:"P"},St=>this.deleteChars(St)),this._parser.registerCsiHandler({final:"S"},St=>this.scrollUp(St)),this._parser.registerCsiHandler({final:"T"},St=>this.scrollDown(St)),this._parser.registerCsiHandler({final:"X"},St=>this.eraseChars(St)),this._parser.registerCsiHandler({final:"Z"},St=>this.cursorBackwardTab(St)),this._parser.registerCsiHandler({final:"`"},St=>this.charPosAbsolute(St)),this._parser.registerCsiHandler({final:"a"},St=>this.hPositionRelative(St)),this._parser.registerCsiHandler({final:"b"},St=>this.repeatPrecedingCharacter(St)),this._parser.registerCsiHandler({final:"c"},St=>this.sendDeviceAttributesPrimary(St)),this._parser.registerCsiHandler({prefix:">",final:"c"},St=>this.sendDeviceAttributesSecondary(St)),this._parser.registerCsiHandler({final:"d"},St=>this.linePosAbsolute(St)),this._parser.registerCsiHandler({final:"e"},St=>this.vPositionRelative(St)),this._parser.registerCsiHandler({final:"f"},St=>this.hVPosition(St)),this._parser.registerCsiHandler({final:"g"},St=>this.tabClear(St)),this._parser.registerCsiHandler({final:"h"},St=>this.setMode(St)),this._parser.registerCsiHandler({prefix:"?",final:"h"},St=>this.setModePrivate(St)),this._parser.registerCsiHandler({final:"l"},St=>this.resetMode(St)),this._parser.registerCsiHandler({prefix:"?",final:"l"},St=>this.resetModePrivate(St)),this._parser.registerCsiHandler({final:"m"},St=>this.charAttributes(St)),this._parser.registerCsiHandler({final:"n"},St=>this.deviceStatus(St)),this._parser.registerCsiHandler({prefix:"?",final:"n"},St=>this.deviceStatusPrivate(St)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},St=>this.softReset(St)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},St=>this.setCursorStyle(St)),this._parser.registerCsiHandler({final:"r"},St=>this.setScrollRegion(St)),this._parser.registerCsiHandler({final:"s"},St=>this.saveCursor(St)),this._parser.registerCsiHandler({final:"t"},St=>this.windowOptions(St)),this._parser.registerCsiHandler({final:"u"},St=>this.restoreCursor(St)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},St=>this.insertColumns(St)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},St=>this.deleteColumns(St)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},St=>this.selectProtected(St)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},St=>this.requestMode(St,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},St=>this.requestMode(St,!1)),this._parser.setExecuteHandler(Ho.BEL,()=>this.bell()),this._parser.setExecuteHandler(Ho.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Ho.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Ho.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Ho.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Ho.BS,()=>this.backspace()),this._parser.setExecuteHandler(Ho.HT,()=>this.tab()),this._parser.setExecuteHandler(Ho.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Ho.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(LT.IND,()=>this.index()),this._parser.setExecuteHandler(LT.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(LT.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Hm(St=>(this.setTitle(St),this.setIconName(St),!0))),this._parser.registerOscHandler(1,new Hm(St=>this.setIconName(St))),this._parser.registerOscHandler(2,new Hm(St=>this.setTitle(St))),this._parser.registerOscHandler(4,new Hm(St=>this.setOrReportIndexedColor(St))),this._parser.registerOscHandler(8,new Hm(St=>this.setHyperlink(St))),this._parser.registerOscHandler(10,new Hm(St=>this.setOrReportFgColor(St))),this._parser.registerOscHandler(11,new Hm(St=>this.setOrReportBgColor(St))),this._parser.registerOscHandler(12,new Hm(St=>this.setOrReportCursorColor(St))),this._parser.registerOscHandler(104,new Hm(St=>this.restoreIndexedColor(St))),this._parser.registerOscHandler(110,new Hm(St=>this.restoreFgColor(St))),this._parser.registerOscHandler(111,new Hm(St=>this.restoreBgColor(St))),this._parser.registerOscHandler(112,new Hm(St=>this.restoreCursorColor(St))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let St in Fp)this._parser.registerEscHandler({intermediates:"(",final:St},()=>this.selectCharset("("+St)),this._parser.registerEscHandler({intermediates:")",final:St},()=>this.selectCharset(")"+St)),this._parser.registerEscHandler({intermediates:"*",final:St},()=>this.selectCharset("*"+St)),this._parser.registerEscHandler({intermediates:"+",final:St},()=>this.selectCharset("+"+St)),this._parser.registerEscHandler({intermediates:"-",final:St},()=>this.selectCharset("-"+St)),this._parser.registerEscHandler({intermediates:".",final:St},()=>this.selectCharset("."+St)),this._parser.registerEscHandler({intermediates:"/",final:St},()=>this.selectCharset("/"+St));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(St=>(this._logService.error("Parsing error: ",St),St)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new dN((St,Ut)=>this.requestStatusString(St,Ut)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,u){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=u}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),gN))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${gN} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,u=this._activeBuffer.x,T=this._activeBuffer.y,$=0,K=this._parseStack.paused;if(K){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;u=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Vy&&($=this._parseStack.position+Vy)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,St=>String.fromCharCode(St)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(St=>St.charCodeAt(0)):e),this._parseBuffer.lengthVy)for(let St=$;St0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Ut);let pe=this._parser.precedingJoinState;for(let me=t;mect){if(yt){let kr=ne,It=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ve>0&&ne instanceof d5&&ne.copyCellsFrom(kr,It,0,Ve,!1);It=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ut);continue}if(St&&(ne.insertCells(this._activeBuffer.x,T-Ve,this._activeBuffer.getNullCell(Ut)),ne.getWidth(ct-1)===2&&ne.setCellFromCodepoint(ct-1,0,1,Ut)),ne.setCellFromCodepoint(this._activeBuffer.x++,u,T,Ut),T>0)for(;--T;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ut)}this._parser.precedingJoinState=pe,this._activeBuffer.x0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,Ut),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>mN(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new dN(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Hm(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,u=!1,T=!1){let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);$.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),T),u&&($.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let u=this._activeBuffer.lines.length-this._bufferService.rows;u>0&&(this._activeBuffer.lines.trimStart(u),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-u,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-u,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let yt=ct;for(let St=1;St0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(Ho.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(Ho.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(Ho.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(Ho.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(Ho.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t(Ce[Ce.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",Ce[Ce.SET=1]="SET",Ce[Ce.RESET=2]="RESET",Ce[Ce.PERMANENTLY_SET=3]="PERMANENTLY_SET",Ce[Ce.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(r||={});let u=this._coreService.decPrivateModes,{activeProtocol:T,activeEncoding:$}=this._coreMouseService,K=this._coreService,{buffers:ct,cols:yt}=this._bufferService,{active:St,alt:Ut}=ct,ne=this._optionsService.rawOptions,pe=(Ce,Ve)=>(K.triggerDataEvent(`${Ho.ESC}[${t?"":"?"}${Ce};${Ve}$y`),!0),me=Ce=>Ce?1:2,we=e.params[0];return t?we===2?pe(we,4):we===4?pe(we,me(K.modes.insertMode)):we===12?pe(we,3):we===20?pe(we,me(ne.convertEol)):pe(we,0):we===1?pe(we,me(u.applicationCursorKeys)):we===3?pe(we,ne.windowOptions.setWinLines?yt===80?2:yt===132?1:0:0):we===6?pe(we,me(u.origin)):we===7?pe(we,me(u.wraparound)):we===8?pe(we,3):we===9?pe(we,me(T==="X10")):we===12?pe(we,me(ne.cursorBlink)):we===25?pe(we,me(!K.isCursorHidden)):we===45?pe(we,me(u.reverseWraparound)):we===66?pe(we,me(u.applicationKeypad)):we===67?pe(we,4):we===1e3?pe(we,me(T==="VT200")):we===1002?pe(we,me(T==="DRAG")):we===1003?pe(we,me(T==="ANY")):we===1004?pe(we,me(u.sendFocus)):we===1005?pe(we,4):we===1006?pe(we,me($==="SGR")):we===1015?pe(we,4):we===1016?pe(we,me($==="SGR_PIXELS")):we===1048?pe(we,1):we===47||we===1047||we===1049?pe(we,me(St===Ut)):we===2004?pe(we,me(u.bracketedPasteMode)):we===2026?pe(we,me(u.synchronizedOutput)):pe(we,0)}_updateAttrColor(e,t,r,u,T){return t===2?(e|=50331648,e&=-16777216,e|=p4.fromColorRGB([r,u,T])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let u=[0,0,-1,0,0,0],T=0,$=0;do{if(u[$+T]=e.params[t+$],e.hasSubParams(t+$)){let K=e.getSubParams(t+$),ct=0;do u[1]===5&&(T=1),u[$+ct+1+T]=K[ct];while(++ct=2||u[1]===2&&$+T>=5)break;u[1]&&(T=1)}while(++$+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=bp.fg,e.bg=bp.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,u=this._curAttrData;for(let T=0;T=30&&r<=37?(u.fg&=-50331904,u.fg|=16777216|r-30):r>=40&&r<=47?(u.bg&=-50331904,u.bg|=16777216|r-40):r>=90&&r<=97?(u.fg&=-50331904,u.fg|=16777216|r-90|8):r>=100&&r<=107?(u.bg&=-50331904,u.bg|=16777216|r-100|8):r===0?this._processSGR0(u):r===1?u.fg|=134217728:r===3?u.bg|=67108864:r===4?(u.fg|=268435456,this._processUnderline(e.hasSubParams(T)?e.getSubParams(T)[0]:1,u)):r===5?u.fg|=536870912:r===7?u.fg|=67108864:r===8?u.fg|=1073741824:r===9?u.fg|=2147483648:r===2?u.bg|=134217728:r===21?this._processUnderline(2,u):r===22?(u.fg&=-134217729,u.bg&=-134217729):r===23?u.bg&=-67108865:r===24?(u.fg&=-268435457,this._processUnderline(0,u)):r===25?u.fg&=-536870913:r===27?u.fg&=-67108865:r===28?u.fg&=-1073741825:r===29?u.fg&=2147483647:r===39?(u.fg&=-67108864,u.fg|=bp.fg&16777215):r===49?(u.bg&=-67108864,u.bg|=bp.bg&16777215):r===38||r===48||r===58?T+=this._extractColor(e,T,u):r===53?u.bg|=1073741824:r===55?u.bg&=-1073741825:r===59?(u.extended=u.extended.clone(),u.extended.underlineColor=-1,u.updateExtended()):r===100?(u.fg&=-67108864,u.fg|=bp.fg&16777215,u.bg&=-67108864,u.bg|=bp.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${Ho.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Ho.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Ho.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=bp.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!mN(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Ho.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>pN&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>pN&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let u=r.shift(),T=r.shift();if(/^\d+$/.exec(u)){let $=parseInt(u);if(yN($))if(T==="?")t.push({type:0,index:$});else{let K=fN(T);K&&t.push({type:1,index:$,color:K})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),u=e.slice(t+1);return u?this._createHyperlink(r,u):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),u,T=r.findIndex($=>$.startsWith("id="));return T!==-1&&(u=r[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:u,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let u=0;u=this._specialColors.length);++u,++t)if(r[u]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let T=fN(r[u]);T&&this._onColor.fire([{type:1,index:this._specialColors[t],color:T}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let u=0;u=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=bp.clone(),this._eraseAttrDataInternal=bp.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new bg;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${Ho.ESC}${K}${Ho.ESC}\\`),!0),u=this._bufferService.buffer,T=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${u.scrollTop+1};${u.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[T.cursorStyle]-(T.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},X9=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(vN=e,e=t,t=vN),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};X9=Vf([fl(0,om)],X9);function yN(e){return 0<=e&&e<256}var IMt=5e7,_N=12,DMt=50,zMt=class extends Su{constructor(t){super(),this._action=t,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Is),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(t,r){if(r!==void 0&&this._syncCalls>r){this._syncCalls=0;return}if(this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let u;for(;u=this._writeBuffer.shift();){this._action(u);let T=this._callbacks.shift();T&&T()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(t,r){if(this._pendingData>IMt)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(r),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=t.length,this._writeBuffer.push(t),this._callbacks.push(r)}_innerWrite(t=0,r=!0){let u=t||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let T=this._writeBuffer[this._bufferOffset],$=this._action(T,r);if($){let ct=yt=>performance.now()-u>=_N?setTimeout(()=>this._innerWrite(0,yt)):this._innerWrite(u,yt);$.catch(yt=>(queueMicrotask(()=>{throw yt}),Promise.resolve(!1))).then(ct);return}let K=this._callbacks[this._bufferOffset];if(K&&K(),this._bufferOffset++,this._pendingData-=T.length,performance.now()-u>=_N)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>DMt&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},J9=class{constructor(t){this._bufferService=t,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(t){let r=this._bufferService.buffer;if(t.id===void 0){let yt=r.addMarker(r.ybase+r.y),St={data:t,id:this._nextId++,lines:[yt]};return yt.onDispose(()=>this._removeMarkerFromLink(St,yt)),this._dataByLinkId.set(St.id,St),St.id}let u=t,T=this._getEntryIdKey(u),$=this._entriesWithId.get(T);if($)return this.addLineToLink($.id,r.ybase+r.y),$.id;let K=r.addMarker(r.ybase+r.y),ct={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[K]};return K.onDispose(()=>this._removeMarkerFromLink(ct,K)),this._entriesWithId.set(ct.key,ct),this._dataByLinkId.set(ct.id,ct),ct.id}addLineToLink(t,r){let u=this._dataByLinkId.get(t);if(u&&u.lines.every(T=>T.line!==r)){let T=this._bufferService.buffer.addMarker(r);u.lines.push(T),T.onDispose(()=>this._removeMarkerFromLink(u,T))}}getLinkData(t){return this._dataByLinkId.get(t)?.data}_getEntryIdKey(t){return`${t.id};;${t.uri}`}_removeMarkerFromLink(t,r){let u=t.lines.indexOf(r);u!==-1&&(t.lines.splice(u,1),t.lines.length===0&&(t.data.id!==void 0&&this._entriesWithId.delete(t.key),this._dataByLinkId.delete(t.id)))}};J9=Vf([fl(0,om)],J9);var xN=!1,OMt=class extends Su{constructor(t){super(),this._windowsWrappingHeuristics=this._register(new G2),this._onBinary=this._register(new Is),this.onBinary=this._onBinary.event,this._onData=this._register(new Is),this.onData=this._onData.event,this._onLineFeed=this._register(new Is),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Is),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Is),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Is),this._instantiationService=new aMt,this.optionsService=this._register(new mMt(t)),this._instantiationService.setService(sm,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(G9)),this._instantiationService.setService(om,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(q9)),this._instantiationService.setService(eV,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Z9)),this._instantiationService.setService(Yx,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(K9)),this._instantiationService.setService(tV,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Lx)),this._instantiationService.setService(eAt,this.unicodeService),this._charsetService=this._instantiationService.createInstance(xMt),this._instantiationService.setService(tAt,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(J9),this._instantiationService.setService(rV,this._oscLinkService),this._inputHandler=this._register(new PMt(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(b0.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(b0.forward(this._bufferService.onResize,this._onResize)),this._register(b0.forward(this.coreService.onData,this._onData)),this._register(b0.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new zMt((r,u)=>this._inputHandler.parse(r,u))),this._register(b0.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Is),this._onScroll.event(t=>{this._onScrollApi?.fire(t.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(t){for(let r in t)this.optionsService.options[r]=t[r]}write(t,r){this._writeBuffer.write(t,r)}writeSync(t,r){this._logService.logLevel<=3&&!xN&&(this._logService.warn("writeSync is unreliable and will be removed soon."),xN=!0),this._writeBuffer.writeSync(t,r)}input(t,r=!0){this.coreService.triggerDataEvent(t,r)}resize(t,r){isNaN(t)||isNaN(r)||(t=Math.max(t,zV),r=Math.max(r,OV),this._bufferService.resize(t,r))}scroll(t,r=!1){this._bufferService.scroll(t,r)}scrollLines(t,r){this._bufferService.scrollLines(t,r)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let r=t-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}registerEscHandler(t,r){return this._inputHandler.registerEscHandler(t,r)}registerDcsHandler(t,r){return this._inputHandler.registerDcsHandler(t,r)}registerCsiHandler(t,r){return this._inputHandler.registerCsiHandler(t,r)}registerOscHandler(t,r){return this._inputHandler.registerOscHandler(t,r)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let t=!1,r=this.optionsService.rawOptions.windowsPty;r&&r.buildNumber!==void 0&&r.buildNumber!==void 0?t=r.backend==="conpty"&&r.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(t=!0),t?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let t=[];t.push(this.onLineFeed(hN.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},()=>(hN(this._bufferService),!1))),this._windowsWrappingHeuristics.value=uf(()=>{for(let r of t)r.dispose()})}}},BMt={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function RMt(e,t,r,u){let T={type:0,cancel:!1,key:void 0},$=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?T.key=Ho.ESC+"OA":T.key=Ho.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?T.key=Ho.ESC+"OD":T.key=Ho.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?T.key=Ho.ESC+"OC":T.key=Ho.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?T.key=Ho.ESC+"OB":T.key=Ho.ESC+"[B");break;case 8:T.key=e.ctrlKey?"\b":Ho.DEL,e.altKey&&(T.key=Ho.ESC+T.key);break;case 9:if(e.shiftKey){T.key=Ho.ESC+"[Z";break}T.key=Ho.HT,T.cancel=!0;break;case 13:T.key=e.altKey?Ho.ESC+Ho.CR:Ho.CR,T.cancel=!0;break;case 27:T.key=Ho.ESC,e.altKey&&(T.key=Ho.ESC+Ho.ESC),T.cancel=!0;break;case 37:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"D":t?T.key=Ho.ESC+"OD":T.key=Ho.ESC+"[D";break;case 39:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"C":t?T.key=Ho.ESC+"OC":T.key=Ho.ESC+"[C";break;case 38:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"A":t?T.key=Ho.ESC+"OA":T.key=Ho.ESC+"[A";break;case 40:if(e.metaKey)break;$?T.key=Ho.ESC+"[1;"+($+1)+"B":t?T.key=Ho.ESC+"OB":T.key=Ho.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(T.key=Ho.ESC+"[2~");break;case 46:$?T.key=Ho.ESC+"[3;"+($+1)+"~":T.key=Ho.ESC+"[3~";break;case 36:$?T.key=Ho.ESC+"[1;"+($+1)+"H":t?T.key=Ho.ESC+"OH":T.key=Ho.ESC+"[H";break;case 35:$?T.key=Ho.ESC+"[1;"+($+1)+"F":t?T.key=Ho.ESC+"OF":T.key=Ho.ESC+"[F";break;case 33:e.shiftKey?T.type=2:e.ctrlKey?T.key=Ho.ESC+"[5;"+($+1)+"~":T.key=Ho.ESC+"[5~";break;case 34:e.shiftKey?T.type=3:e.ctrlKey?T.key=Ho.ESC+"[6;"+($+1)+"~":T.key=Ho.ESC+"[6~";break;case 112:$?T.key=Ho.ESC+"[1;"+($+1)+"P":T.key=Ho.ESC+"OP";break;case 113:$?T.key=Ho.ESC+"[1;"+($+1)+"Q":T.key=Ho.ESC+"OQ";break;case 114:$?T.key=Ho.ESC+"[1;"+($+1)+"R":T.key=Ho.ESC+"OR";break;case 115:$?T.key=Ho.ESC+"[1;"+($+1)+"S":T.key=Ho.ESC+"OS";break;case 116:$?T.key=Ho.ESC+"[15;"+($+1)+"~":T.key=Ho.ESC+"[15~";break;case 117:$?T.key=Ho.ESC+"[17;"+($+1)+"~":T.key=Ho.ESC+"[17~";break;case 118:$?T.key=Ho.ESC+"[18;"+($+1)+"~":T.key=Ho.ESC+"[18~";break;case 119:$?T.key=Ho.ESC+"[19;"+($+1)+"~":T.key=Ho.ESC+"[19~";break;case 120:$?T.key=Ho.ESC+"[20;"+($+1)+"~":T.key=Ho.ESC+"[20~";break;case 121:$?T.key=Ho.ESC+"[21;"+($+1)+"~":T.key=Ho.ESC+"[21~";break;case 122:$?T.key=Ho.ESC+"[23;"+($+1)+"~":T.key=Ho.ESC+"[23~";break;case 123:$?T.key=Ho.ESC+"[24;"+($+1)+"~":T.key=Ho.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?T.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?T.key=Ho.NUL:e.keyCode>=51&&e.keyCode<=55?T.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?T.key=Ho.DEL:e.keyCode===219?T.key=Ho.ESC:e.keyCode===220?T.key=Ho.FS:e.keyCode===221&&(T.key=Ho.GS);else if((!r||u)&&e.altKey&&!e.metaKey){let K=BMt[e.keyCode]?.[e.shiftKey?1:0];if(K)T.key=Ho.ESC+K;else if(e.keyCode>=65&&e.keyCode<=90){let ct=e.ctrlKey?e.keyCode-64:e.keyCode+32,yt=String.fromCharCode(ct);e.shiftKey&&(yt=yt.toUpperCase()),T.key=Ho.ESC+yt}else if(e.keyCode===32)T.key=Ho.ESC+(e.ctrlKey?Ho.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let ct=e.code.slice(3,4);e.shiftKey||(ct=ct.toLowerCase()),T.key=Ho.ESC+ct,T.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(T.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?T.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(T.key=Ho.US),e.key==="@"&&(T.key=Ho.NUL));break}return T}var op=0,FMt=class{constructor(t){this._getKey=t,this._array=[],this._insertedValues=[],this._flushInsertedTask=new hS,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new hS,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(t){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(t)}_flushInserted(){let t=this._insertedValues.sort(($,K)=>this._getKey($)-this._getKey(K)),r=0,u=0,T=new Array(this._array.length+this._insertedValues.length);for(let $=0;$=this._array.length||this._getKey(t[r])<=this._getKey(this._array[u])?(T[$]=t[r],r++):T[$]=this._array[u++];this._array=T,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(t){if(this._flushCleanupInserted(),this._array.length===0)return!1;let r=this._getKey(t);if(r===void 0||(op=this._search(r),op===-1)||this._getKey(this._array[op])!==r)return!1;do if(this._array[op]===t)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(op),!0;while(++op$-K),r=0,u=new Array(this._array.length-t.length),T=0;for(let $=0;$0&&this._flushDeletedTask.flush()}*getKeyIterator(t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(op=this._search(t),!(op<0||op>=this._array.length)&&this._getKey(this._array[op])===t))do yield this._array[op];while(++op=this._array.length)&&this._getKey(this._array[op])===t))do r(this._array[op]);while(++op=r;){let T=r+u>>1,$=this._getKey(this._array[T]);if($>t)u=T-1;else if($0&&this._getKey(this._array[T-1])===t;)T--;return T}}return r}},fM=0,bN=0,NMt=class extends Su{constructor(){super(),this._decorations=new FMt(e=>e?.marker.line),this._onDecorationRegistered=this._register(new Is),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Is),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(uf(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new jMt(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),u=t.onDispose(()=>{u.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let u=0,T=0;for(let $ of this._decorations.getKeyIterator(t))u=$.options.x??0,T=u+($.options.width??1),e>=u&&e{fM=T.options.x??0,bN=fM+(T.options.width??1),e>=fM&&e=this._debounceThresholdMS)this._lastRefreshMs=T,this._innerRefresh();else if(!this._additionalRefreshRequested){let $=T-this._lastRefreshMs,K=this._debounceThresholdMS-$;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},K)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let t=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(t,r)}},wN=20,dS=class extends Su{constructor(e,t,r,u){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=u,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let T=this._coreBrowserService.mainDocument;this._accessibilityContainer=T.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=T.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let $=0;$this._handleBoundaryFocus($,0),this._bottomBoundaryFocusListener=$=>this._handleBoundaryFocus($,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=T.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new $Mt(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize($=>this._handleResize($.rows))),this._register(this._terminal.onRender($=>this._refreshRows($.start,$.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar($=>this._handleChar($))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` `))),this._register(this._terminal.onA11yTab($=>this._handleTab($))),this._register(this._terminal.onKey($=>this._handleKey($.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Uc(T,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(uf(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===wN+1&&(this._liveRegion.textContent+=y9.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,u=r.lines.length.toString();for(let T=e;T<=t;T++){let $=r.lines.get(r.ydisp+T),K=[],ct=$?.translateToString(!0,void 0,void 0,K)||"",yt=(r.ydisp+T+1).toString(),St=this._rowElements[T];St&&(ct.length===0?(St.textContent=" ",this._rowColumns.set(St,[0,1])):(St.textContent=ct,this._rowColumns.set(St,K)),St.setAttribute("aria-posinset",yt),St.setAttribute("aria-setsize",u),this._alignRowWidth(St))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,u=this._rowElements[t===0?1:this._rowElements.length-2],T=r.getAttribute("aria-posinset"),$=t===0?"1":`${this._terminal.buffer.lines.length}`;if(T===$||e.relatedTarget!==u)return;let K,ct;if(t===0?(K=r,ct=this._rowElements.pop(),this._rowContainer.removeChild(ct)):(K=this._rowElements.shift(),ct=r,this._rowContainer.removeChild(K)),K.removeEventListener("focus",this._topBoundaryFocusListener),ct.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let yt=this._createAccessibilityTreeNode();this._rowElements.unshift(yt),this._rowContainer.insertAdjacentElement("afterbegin",yt)}else{let yt=this._createAccessibilityTreeNode();this._rowElements.push(yt),this._rowContainer.appendChild(yt)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let u=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(u)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:u,offset:u.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let T=({node:ct,offset:yt})=>{let St=ct instanceof Text?ct.parentNode:ct,Ut=parseInt(St?.getAttribute("aria-posinset"),10)-1;if(isNaN(Ut))return console.warn("row is invalid. Race condition?"),null;let ne=this._rowColumns.get(St);if(!ne)return console.warn("columns is null. Race condition?"),null;let pe=yt=this._terminal.cols&&(++Ut,pe=0),{row:Ut,column:pe}},$=T(t),K=T(r);if(!(!$||!K)){if($.row>K.row||$.row===K.row&&$.column>=K.column)throw new Error("invalid range");this._terminal.select($.column,$.row,(K.row-$.row)*this._terminal.cols-$.column+K.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{Hx(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Uc(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Uc(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Uc(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Uc(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let u=0;u{u?.forEach(T=>{T.link.dispose&&T.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[u,T]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(u)&&(r=this._checkLinkProviderResult(u,e,r)):T.provideLinks(e.y,$=>{if(this._isMouseOut)return;let K=$?.map(ct=>({link:ct}));this._activeProviderReplies?.set(u,K),r=this._checkLinkProviderResult(u,e,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let u=0;ue?this._bufferService.cols:K.link.range.end.x;for(let St=ct;St<=yt;St++){if(r.has(St)){T.splice($--,1);break}r.add(St)}}}}_checkLinkProviderResult(e,t,r){if(!this._activeProviderReplies)return r;let u=this._activeProviderReplies.get(e),T=!1;for(let $=0;$this._linkAtPosition(K.link,t));$&&(r=!0,this._handleNewLink($))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let $=0;$this._linkAtPosition(ct.link,t));if(K){r=!0,this._handleNewLink(K);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&$Mt(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Hx(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let u=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(u,T),this._lastMouseEvent)){let $=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);$&&this._askForLink($,!1)}})))}_linkHover(e,t,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,u=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-u-1,r.end.x,r.end.y-u-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(e,t,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,u=e.range.end.y*this._bufferService.cols+e.range.end.x,T=t.y*this._bufferService.cols+t.x;return r<=T&&T<=u}_positionFromMouseEvent(e,t,r){let u=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,u,T){return{x1:e,y1:t,x2:r,y2:u,cols:this._bufferService.cols,fg:T}}};Q9=Vf([fl(1,mL),fl(2,K1),fl(3,om),fl(4,iV)],Q9);function $Mt(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var HMt=class extends zMt{constructor(t={}){super(t),this._linkifier=this._register(new G2),this.browser=kV,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new G2),this._onCursorMove=this._register(new Is),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Is),this.onKey=this._onKey.event,this._onRender=this._register(new Is),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Is),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Is),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Is),this.onBell=this._onBell.event,this._onFocus=this._register(new Is),this._onBlur=this._register(new Is),this._onA11yCharEmitter=this._register(new Is),this._onA11yTabEmitter=this._register(new Is),this._onWillOpen=this._register(new Is),this._setup(),this._decorationService=this._instantiationService.createInstance(FMt),this._instantiationService.setService(m4,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(I7t),this._instantiationService.setService(iV,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x9)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(r=>this.refresh(r?.start??0,r?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(r=>this._reportWindowsOptions(r))),this._register(this._inputHandler.onColor(r=>this._handleColorEvent(r))),this._register(b0.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(b0.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(b0.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(b0.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(r=>this._afterResize(r.cols,r.rows))),this._register(uf(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(t){if(this._themeService)for(let r of t){let u,T="";switch(r.index){case 256:u="foreground",T="10";break;case 257:u="background",T="11";break;case 258:u="cursor",T="12";break;default:u="ansi",T="4;"+r.index}switch(r.type){case 0:let $=Zd.toColorRGB(u==="ansi"?this._themeService.colors.ansi[r.index]:this._themeService.colors[u]);this.coreService.triggerDataEvent(`${Ho.ESC}]${T};${MMt($)}${bV.ST}`);break;case 1:if(u==="ansi")this._themeService.modifyColors(K=>K.ansi[r.index]=kp.toColor(...r.color));else{let K=u;this._themeService.modifyColors(ct=>ct[K]=kp.toColor(...r.color))}break;case 2:this._themeService.restoreColor(r.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(t){t?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(dS,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(t){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Ho.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Ho.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let t=this.buffer.ybase+this.buffer.y,r=this.buffer.lines.get(t);if(!r)return;let u=Math.min(this.buffer.x,this.cols-1),T=this._renderService.dimensions.css.cell.height,$=r.getWidth(u),K=this._renderService.dimensions.css.cell.width*$,ct=this.buffer.y*this._renderService.dimensions.css.cell.height,yt=u*this._renderService.dimensions.css.cell.width;this.textarea.style.left=yt+"px",this.textarea.style.top=ct+"px",this.textarea.style.width=K+"px",this.textarea.style.height=T+"px",this.textarea.style.lineHeight=T+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Uc(this.element,"copy",r=>{this.hasSelection()&&GCt(r,this._selectionService)}));let t=r=>ZCt(r,this.textarea,this.coreService,this.optionsService);this._register(Uc(this.textarea,"paste",t)),this._register(Uc(this.element,"paste",t)),TV?this._register(Uc(this.element,"mousedown",r=>{r.button===2&&IF(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Uc(this.element,"contextmenu",r=>{IF(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),kL&&this._register(Uc(this.element,"auxclick",r=>{r.button===1&&KH(r,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Uc(this.textarea,"keyup",t=>this._keyUp(t),!0)),this._register(Uc(this.textarea,"keydown",t=>this._keyDown(t),!0)),this._register(Uc(this.textarea,"keypress",t=>this._keyPress(t),!0)),this._register(Uc(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Uc(this.textarea,"compositionupdate",t=>this._compositionHelper.compositionupdate(t))),this._register(Uc(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Uc(this.textarea,"input",t=>this._inputEvent(t),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(t){if(!t)throw new Error("Terminal requires a parent element.");if(t.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=t.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),t.appendChild(this.element);let r=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Uc(this.screenElement,"mousemove",$=>this.updateCursorStyle($))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement);let u=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v9.get()),AV||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>u.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(L7t,this.textarea,t.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Z1,this._coreBrowserService),this._register(Uc(this.textarea,"focus",$=>this._handleTextAreaFocus($))),this._register(Uc(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(U9,this._document,this._helperContainer),this._instantiationService.setService(XS,this._charSizeService),this._themeService=this._instantiationService.createInstance(W9),this._instantiationService.setService(Q2,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(cS),this._instantiationService.setService(nV,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(H9,this.rows,this.screenElement)),this._instantiationService.setService(K1,this._renderService),this._register(this._renderService.onRenderedViewportChange($=>this._onRender.fire($))),this.onResize($=>this._renderService.resize($.cols,$.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(F9,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance($9),this._instantiationService.setService(mL,this._mouseService);let T=this._linkifier.value=this._register(this._instantiationService.createInstance(Q9,this.screenElement));this.element.appendChild(r);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(B9,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines($=>{super.scrollLines($,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(V9,this.element,this.screenElement,T)),this._instantiationService.setService(rAt,this._selectionService),this._register(this._selectionService.onRequestScrollLines($=>this.scrollLines($.amount,$.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw($=>this._renderService.handleSelectionChanged($.start,$.end,$.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection($=>{this.textarea.value=$,this.textarea.focus(),this.textarea.select()})),this._register(b0.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(R9,this.screenElement)),this._register(Uc(this.element,"mousedown",$=>this._selectionService.handleMouseDown($))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(dS,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",$=>this._handleScreenReaderModeOptionChange($))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(lS,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",$=>{!this._overviewRulerRenderer&&$&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(lS,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(j9,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let t=this,r=this.element;function u(K){let ct=t._mouseService.getMouseReportCoords(K,t.screenElement);if(!ct)return!1;let yt,St;switch(K.overrideType||K.type){case"mousemove":St=32,K.buttons===void 0?(yt=3,K.button!==void 0&&(yt=K.button<3?K.button:3)):yt=K.buttons&1?0:K.buttons&4?1:K.buttons&2?2:3;break;case"mouseup":St=0,yt=K.button<3?K.button:3;break;case"mousedown":St=1,yt=K.button<3?K.button:3;break;case"wheel":if(t._customWheelEventHandler&&t._customWheelEventHandler(K)===!1)return!1;let Ut=K.deltaY;if(Ut===0||t.coreMouseService.consumeWheelEvent(K,t._renderService?.dimensions?.device?.cell?.height,t._coreBrowserService?.dpr)===0)return!1;St=Ut<0?0:1,yt=4;break;default:return!1}return St===void 0||yt===void 0||yt>4?!1:t.coreMouseService.triggerMouseEvent({col:ct.col,row:ct.row,x:ct.x,y:ct.y,button:yt,action:St,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}let T={mouseup:null,wheel:null,mousedrag:null,mousemove:null},$={mouseup:K=>(u(K),K.buttons||(this._document.removeEventListener("mouseup",T.mouseup),T.mousedrag&&this._document.removeEventListener("mousemove",T.mousedrag)),this.cancel(K)),wheel:K=>(u(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&u(K)},mousemove:K=>{K.buttons||u(K)}};this._register(this.coreMouseService.onProtocolChange(K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),K&8?T.mousemove||(r.addEventListener("mousemove",$.mousemove),T.mousemove=$.mousemove):(r.removeEventListener("mousemove",T.mousemove),T.mousemove=null),K&16?T.wheel||(r.addEventListener("wheel",$.wheel,{passive:!1}),T.wheel=$.wheel):(r.removeEventListener("wheel",T.wheel),T.wheel=null),K&2?T.mouseup||(T.mouseup=$.mouseup):(this._document.removeEventListener("mouseup",T.mouseup),T.mouseup=null),K&4?T.mousedrag||(T.mousedrag=$.mousedrag):(this._document.removeEventListener("mousemove",T.mousedrag),T.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Uc(r,"mousedown",K=>{if(K.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(K)))return u(K),T.mouseup&&this._document.addEventListener("mouseup",T.mouseup),T.mousedrag&&this._document.addEventListener("mousemove",T.mousedrag),this.cancel(K)})),this._register(Uc(r,"wheel",K=>{if(!T.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(K)===!1)return!1;if(!this.buffer.hasScrollback){if(K.deltaY===0)return!1;if(t.coreMouseService.consumeWheelEvent(K,t._renderService?.dimensions?.device?.cell?.height,t._coreBrowserService?.dpr)===0)return this.cancel(K,!0);let ct=Ho.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(ct,!0),this.cancel(K,!0)}}},{passive:!1}))}refresh(t,r){this._renderService?.refreshRows(t,r)}updateCursorStyle(t){this._selectionService?.shouldColumnSelect(t)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(t,r){this._viewport?this._viewport.scrollLines(t):super.scrollLines(t,r),this.refresh(0,this.rows-1)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){t&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let r=t-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}paste(t){ZH(t,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(t){this._customKeyEventHandler=t}attachCustomWheelEventHandler(t){this._customWheelEventHandler=t}registerLinkProvider(t){return this._linkProviderService.registerLinkProvider(t)}registerCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let r=this._characterJoinerService.register(t);return this.refresh(0,this.rows-1),r}deregisterCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(t)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(t){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+t)}registerDecoration(t){return this._decorationService.registerDecoration(t)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(t,r,u){this._selectionService.setSelection(t,r,u)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(t,r){this._selectionService?.selectLines(t,r)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;let r=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!r&&!this._compositionHelper.keydown(t))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!r&&(t.key==="Dead"||t.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let u=BMt(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),u.type===3||u.type===2){let T=this.rows-1;return this.scrollLines(u.type===2?-T:T),this.cancel(t,!0)}if(u.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,t)||(u.cancel&&this.cancel(t,!0),!u.key)||t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.key.length===1&&t.key.charCodeAt(0)>=65&&t.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((u.key===Ho.ETX||u.key===Ho.CR)&&(this.textarea.value=""),this._onKey.fire({key:u.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(u.key,!0),!this.optionsService.rawOptions.screenReaderMode||t.altKey||t.ctrlKey)return this.cancel(t,!0);this._keyDownHandled=!0}_isThirdLevelShift(t,r){let u=t.isMac&&!this.options.macOptionIsMeta&&r.altKey&&!r.ctrlKey&&!r.metaKey||t.isWindows&&r.altKey&&r.ctrlKey&&!r.metaKey||t.isWindows&&r.getModifierState("AltGraph");return r.type==="keypress"?u:u&&(!r.keyCode||r.keyCode>47)}_keyUp(t){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)&&(VMt(t)||this.focus(),this.updateCursorStyle(t),this._keyPressHandled=!1)}_keyPress(t){let r;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;if(this.cancel(t),t.charCode)r=t.charCode;else if(t.which===null||t.which===void 0)r=t.keyCode;else if(t.which!==0&&t.charCode!==0)r=t.which;else return!1;return!r||(t.altKey||t.ctrlKey||t.metaKey)&&!this._isThirdLevelShift(this.browser,t)?!1:(r=String.fromCharCode(r),this._onKey.fire({key:r,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(r,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(t){if(t.data&&t.inputType==="insertText"&&(!t.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let r=t.data;return this.coreService.triggerDataEvent(r,!0),this.cancel(t),!0}return!1}resize(t,r){if(t===this.cols&&r===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(t,r)}_afterResize(t,r){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let t=1;t=0;t--)this._addons[t].instance.dispose()}loadAddon(t,r){let u={instance:r,dispose:r.dispose,isDisposed:!1};this._addons.push(u),r.dispose=()=>this._wrappedAddonDispose(u),r.activate(t)}_wrappedAddonDispose(t){if(t.isDisposed)return;let r=-1;for(let u=0;u=this._line.length))return r?(this._line.loadCell(t,r),r):this._line.loadCell(t,new bg)}translateToString(t,r,u){return this._line.translateToString(t,r,u)}},kN=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new qMt(t)}getNullCell(){return new bg}},GMt=class extends Su{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Is),this.onBufferChange=this._onBufferChange.event,this._normal=new kN(this._core.buffers.normal,"normal"),this._alternate=new kN(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},ZMt=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,u)=>t(r,u.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},KMt=class{constructor(t){this._core=t}register(t){this._core.unicodeService.register(t)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(t){this._core.unicodeService.activeVersion=t}},YMt=["cols","rows"],mv=0,XMt=class extends Su{constructor(e){super(),this._core=this._register(new HMt(e)),this._addonManager=this._register(new WMt),this._publicOptions={...this._core.options};let t=u=>this._core.options[u],r=(u,T)=>{this._checkReadonlyOptions(u),this._core.options[u]=T};for(let u in this._core.options){let T={get:t.bind(this,u),set:r.bind(this,u)};Object.defineProperty(this._publicOptions,u,T)}}_checkReadonlyOptions(e){if(YMt.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new ZMt(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new KMt(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new GMt(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===wN+1&&(this._liveRegion.textContent+=y9.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,u=r.lines.length.toString();for(let T=e;T<=t;T++){let $=r.lines.get(r.ydisp+T),K=[],ct=$?.translateToString(!0,void 0,void 0,K)||"",yt=(r.ydisp+T+1).toString(),St=this._rowElements[T];St&&(ct.length===0?(St.textContent=" ",this._rowColumns.set(St,[0,1])):(St.textContent=ct,this._rowColumns.set(St,K)),St.setAttribute("aria-posinset",yt),St.setAttribute("aria-setsize",u),this._alignRowWidth(St))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,u=this._rowElements[t===0?1:this._rowElements.length-2],T=r.getAttribute("aria-posinset"),$=t===0?"1":`${this._terminal.buffer.lines.length}`;if(T===$||e.relatedTarget!==u)return;let K,ct;if(t===0?(K=r,ct=this._rowElements.pop(),this._rowContainer.removeChild(ct)):(K=this._rowElements.shift(),ct=r,this._rowContainer.removeChild(K)),K.removeEventListener("focus",this._topBoundaryFocusListener),ct.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let yt=this._createAccessibilityTreeNode();this._rowElements.unshift(yt),this._rowContainer.insertAdjacentElement("afterbegin",yt)}else{let yt=this._createAccessibilityTreeNode();this._rowElements.push(yt),this._rowContainer.appendChild(yt)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let u=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(u)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:u,offset:u.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let T=({node:ct,offset:yt})=>{let St=ct instanceof Text?ct.parentNode:ct,Ut=parseInt(St?.getAttribute("aria-posinset"),10)-1;if(isNaN(Ut))return console.warn("row is invalid. Race condition?"),null;let ne=this._rowColumns.get(St);if(!ne)return console.warn("columns is null. Race condition?"),null;let pe=yt=this._terminal.cols&&(++Ut,pe=0),{row:Ut,column:pe}},$=T(t),K=T(r);if(!(!$||!K)){if($.row>K.row||$.row===K.row&&$.column>=K.column)throw new Error("invalid range");this._terminal.select($.column,$.row,(K.row-$.row)*this._terminal.cols-$.column+K.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{Vx(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Uc(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Uc(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Uc(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Uc(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let u=0;u{u?.forEach(T=>{T.link.dispose&&T.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[u,T]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(u)&&(r=this._checkLinkProviderResult(u,e,r)):T.provideLinks(e.y,$=>{if(this._isMouseOut)return;let K=$?.map(ct=>({link:ct}));this._activeProviderReplies?.set(u,K),r=this._checkLinkProviderResult(u,e,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let u=0;ue?this._bufferService.cols:K.link.range.end.x;for(let St=ct;St<=yt;St++){if(r.has(St)){T.splice($--,1);break}r.add(St)}}}}_checkLinkProviderResult(e,t,r){if(!this._activeProviderReplies)return r;let u=this._activeProviderReplies.get(e),T=!1;for(let $=0;$this._linkAtPosition(K.link,t));$&&(r=!0,this._handleNewLink($))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let $=0;$this._linkAtPosition(ct.link,t));if(K){r=!0,this._handleNewLink(K);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&HMt(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Vx(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let u=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(u,T),this._lastMouseEvent)){let $=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);$&&this._askForLink($,!1)}})))}_linkHover(e,t,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,u=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-u-1,r.end.x,r.end.y-u-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(e,t,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,u=e.range.end.y*this._bufferService.cols+e.range.end.x,T=t.y*this._bufferService.cols+t.x;return r<=T&&T<=u}_positionFromMouseEvent(e,t,r){let u=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(u)return{x:u[0],y:u[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,u,T){return{x1:e,y1:t,x2:r,y2:u,cols:this._bufferService.cols,fg:T}}};Q9=Vf([fl(1,mL),fl(2,K1),fl(3,om),fl(4,iV)],Q9);function HMt(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var VMt=class extends OMt{constructor(t={}){super(t),this._linkifier=this._register(new G2),this.browser=kV,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new G2),this._onCursorMove=this._register(new Is),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Is),this.onKey=this._onKey.event,this._onRender=this._register(new Is),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Is),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Is),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Is),this.onBell=this._onBell.event,this._onFocus=this._register(new Is),this._onBlur=this._register(new Is),this._onA11yCharEmitter=this._register(new Is),this._onA11yTabEmitter=this._register(new Is),this._onWillOpen=this._register(new Is),this._setup(),this._decorationService=this._instantiationService.createInstance(NMt),this._instantiationService.setService(m4,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(D7t),this._instantiationService.setService(iV,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x9)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(r=>this.refresh(r?.start??0,r?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(r=>this._reportWindowsOptions(r))),this._register(this._inputHandler.onColor(r=>this._handleColorEvent(r))),this._register(b0.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(b0.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(b0.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(b0.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(r=>this._afterResize(r.cols,r.rows))),this._register(uf(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(t){if(this._themeService)for(let r of t){let u,T="";switch(r.index){case 256:u="foreground",T="10";break;case 257:u="background",T="11";break;case 258:u="cursor",T="12";break;default:u="ansi",T="4;"+r.index}switch(r.type){case 0:let $=Zd.toColorRGB(u==="ansi"?this._themeService.colors.ansi[r.index]:this._themeService.colors[u]);this.coreService.triggerDataEvent(`${Ho.ESC}]${T};${EMt($)}${bV.ST}`);break;case 1:if(u==="ansi")this._themeService.modifyColors(K=>K.ansi[r.index]=kp.toColor(...r.color));else{let K=u;this._themeService.modifyColors(ct=>ct[K]=kp.toColor(...r.color))}break;case 2:this._themeService.restoreColor(r.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(t){t?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(dS,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(t){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Ho.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Ho.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let t=this.buffer.ybase+this.buffer.y,r=this.buffer.lines.get(t);if(!r)return;let u=Math.min(this.buffer.x,this.cols-1),T=this._renderService.dimensions.css.cell.height,$=r.getWidth(u),K=this._renderService.dimensions.css.cell.width*$,ct=this.buffer.y*this._renderService.dimensions.css.cell.height,yt=u*this._renderService.dimensions.css.cell.width;this.textarea.style.left=yt+"px",this.textarea.style.top=ct+"px",this.textarea.style.width=K+"px",this.textarea.style.height=T+"px",this.textarea.style.lineHeight=T+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Uc(this.element,"copy",r=>{this.hasSelection()&&ZCt(r,this._selectionService)}));let t=r=>KCt(r,this.textarea,this.coreService,this.optionsService);this._register(Uc(this.textarea,"paste",t)),this._register(Uc(this.element,"paste",t)),TV?this._register(Uc(this.element,"mousedown",r=>{r.button===2&&IF(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Uc(this.element,"contextmenu",r=>{IF(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),kL&&this._register(Uc(this.element,"auxclick",r=>{r.button===1&&KH(r,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Uc(this.textarea,"keyup",t=>this._keyUp(t),!0)),this._register(Uc(this.textarea,"keydown",t=>this._keyDown(t),!0)),this._register(Uc(this.textarea,"keypress",t=>this._keyPress(t),!0)),this._register(Uc(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Uc(this.textarea,"compositionupdate",t=>this._compositionHelper.compositionupdate(t))),this._register(Uc(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Uc(this.textarea,"input",t=>this._inputEvent(t),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(t){if(!t)throw new Error("Terminal requires a parent element.");if(t.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=t.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),t.appendChild(this.element);let r=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Uc(this.screenElement,"mousemove",$=>this.updateCursorStyle($))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement);let u=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v9.get()),AV||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>u.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(P7t,this.textarea,t.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Z1,this._coreBrowserService),this._register(Uc(this.textarea,"focus",$=>this._handleTextAreaFocus($))),this._register(Uc(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(U9,this._document,this._helperContainer),this._instantiationService.setService(XS,this._charSizeService),this._themeService=this._instantiationService.createInstance(W9),this._instantiationService.setService(Q2,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(cS),this._instantiationService.setService(nV,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(H9,this.rows,this.screenElement)),this._instantiationService.setService(K1,this._renderService),this._register(this._renderService.onRenderedViewportChange($=>this._onRender.fire($))),this.onResize($=>this._renderService.resize($.cols,$.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(F9,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance($9),this._instantiationService.setService(mL,this._mouseService);let T=this._linkifier.value=this._register(this._instantiationService.createInstance(Q9,this.screenElement));this.element.appendChild(r);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(B9,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines($=>{super.scrollLines($,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(V9,this.element,this.screenElement,T)),this._instantiationService.setService(nAt,this._selectionService),this._register(this._selectionService.onRequestScrollLines($=>this.scrollLines($.amount,$.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw($=>this._renderService.handleSelectionChanged($.start,$.end,$.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection($=>{this.textarea.value=$,this.textarea.focus(),this.textarea.select()})),this._register(b0.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(R9,this.screenElement)),this._register(Uc(this.element,"mousedown",$=>this._selectionService.handleMouseDown($))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(dS,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",$=>this._handleScreenReaderModeOptionChange($))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(lS,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",$=>{!this._overviewRulerRenderer&&$&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(lS,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(j9,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let t=this,r=this.element;function u(K){let ct=t._mouseService.getMouseReportCoords(K,t.screenElement);if(!ct)return!1;let yt,St;switch(K.overrideType||K.type){case"mousemove":St=32,K.buttons===void 0?(yt=3,K.button!==void 0&&(yt=K.button<3?K.button:3)):yt=K.buttons&1?0:K.buttons&4?1:K.buttons&2?2:3;break;case"mouseup":St=0,yt=K.button<3?K.button:3;break;case"mousedown":St=1,yt=K.button<3?K.button:3;break;case"wheel":if(t._customWheelEventHandler&&t._customWheelEventHandler(K)===!1)return!1;let Ut=K.deltaY;if(Ut===0||t.coreMouseService.consumeWheelEvent(K,t._renderService?.dimensions?.device?.cell?.height,t._coreBrowserService?.dpr)===0)return!1;St=Ut<0?0:1,yt=4;break;default:return!1}return St===void 0||yt===void 0||yt>4?!1:t.coreMouseService.triggerMouseEvent({col:ct.col,row:ct.row,x:ct.x,y:ct.y,button:yt,action:St,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}let T={mouseup:null,wheel:null,mousedrag:null,mousemove:null},$={mouseup:K=>(u(K),K.buttons||(this._document.removeEventListener("mouseup",T.mouseup),T.mousedrag&&this._document.removeEventListener("mousemove",T.mousedrag)),this.cancel(K)),wheel:K=>(u(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&u(K)},mousemove:K=>{K.buttons||u(K)}};this._register(this.coreMouseService.onProtocolChange(K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),K&8?T.mousemove||(r.addEventListener("mousemove",$.mousemove),T.mousemove=$.mousemove):(r.removeEventListener("mousemove",T.mousemove),T.mousemove=null),K&16?T.wheel||(r.addEventListener("wheel",$.wheel,{passive:!1}),T.wheel=$.wheel):(r.removeEventListener("wheel",T.wheel),T.wheel=null),K&2?T.mouseup||(T.mouseup=$.mouseup):(this._document.removeEventListener("mouseup",T.mouseup),T.mouseup=null),K&4?T.mousedrag||(T.mousedrag=$.mousedrag):(this._document.removeEventListener("mousemove",T.mousedrag),T.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Uc(r,"mousedown",K=>{if(K.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(K)))return u(K),T.mouseup&&this._document.addEventListener("mouseup",T.mouseup),T.mousedrag&&this._document.addEventListener("mousemove",T.mousedrag),this.cancel(K)})),this._register(Uc(r,"wheel",K=>{if(!T.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(K)===!1)return!1;if(!this.buffer.hasScrollback){if(K.deltaY===0)return!1;if(t.coreMouseService.consumeWheelEvent(K,t._renderService?.dimensions?.device?.cell?.height,t._coreBrowserService?.dpr)===0)return this.cancel(K,!0);let ct=Ho.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(ct,!0),this.cancel(K,!0)}}},{passive:!1}))}refresh(t,r){this._renderService?.refreshRows(t,r)}updateCursorStyle(t){this._selectionService?.shouldColumnSelect(t)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(t,r){this._viewport?this._viewport.scrollLines(t):super.scrollLines(t,r),this.refresh(0,this.rows-1)}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(t){t&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(t){let r=t-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}paste(t){ZH(t,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(t){this._customKeyEventHandler=t}attachCustomWheelEventHandler(t){this._customWheelEventHandler=t}registerLinkProvider(t){return this._linkProviderService.registerLinkProvider(t)}registerCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let r=this._characterJoinerService.register(t);return this.refresh(0,this.rows-1),r}deregisterCharacterJoiner(t){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(t)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(t){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+t)}registerDecoration(t){return this._decorationService.registerDecoration(t)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(t,r,u){this._selectionService.setSelection(t,r,u)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(t,r){this._selectionService?.selectLines(t,r)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;let r=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!r&&!this._compositionHelper.keydown(t))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!r&&(t.key==="Dead"||t.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let u=RMt(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),u.type===3||u.type===2){let T=this.rows-1;return this.scrollLines(u.type===2?-T:T),this.cancel(t,!0)}if(u.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,t)||(u.cancel&&this.cancel(t,!0),!u.key)||t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.key.length===1&&t.key.charCodeAt(0)>=65&&t.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((u.key===Ho.ETX||u.key===Ho.CR)&&(this.textarea.value=""),this._onKey.fire({key:u.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(u.key,!0),!this.optionsService.rawOptions.screenReaderMode||t.altKey||t.ctrlKey)return this.cancel(t,!0);this._keyDownHandled=!0}_isThirdLevelShift(t,r){let u=t.isMac&&!this.options.macOptionIsMeta&&r.altKey&&!r.ctrlKey&&!r.metaKey||t.isWindows&&r.altKey&&r.ctrlKey&&!r.metaKey||t.isWindows&&r.getModifierState("AltGraph");return r.type==="keypress"?u:u&&(!r.keyCode||r.keyCode>47)}_keyUp(t){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)&&(WMt(t)||this.focus(),this.updateCursorStyle(t),this._keyPressHandled=!1)}_keyPress(t){let r;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(t)===!1)return!1;if(this.cancel(t),t.charCode)r=t.charCode;else if(t.which===null||t.which===void 0)r=t.keyCode;else if(t.which!==0&&t.charCode!==0)r=t.which;else return!1;return!r||(t.altKey||t.ctrlKey||t.metaKey)&&!this._isThirdLevelShift(this.browser,t)?!1:(r=String.fromCharCode(r),this._onKey.fire({key:r,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(r,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(t){if(t.data&&t.inputType==="insertText"&&(!t.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let r=t.data;return this.coreService.triggerDataEvent(r,!0),this.cancel(t),!0}return!1}resize(t,r){if(t===this.cols&&r===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(t,r)}_afterResize(t,r){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let t=1;t=0;t--)this._addons[t].instance.dispose()}loadAddon(t,r){let u={instance:r,dispose:r.dispose,isDisposed:!1};this._addons.push(u),r.dispose=()=>this._wrappedAddonDispose(u),r.activate(t)}_wrappedAddonDispose(t){if(t.isDisposed)return;let r=-1;for(let u=0;u=this._line.length))return r?(this._line.loadCell(t,r),r):this._line.loadCell(t,new bg)}translateToString(t,r,u){return this._line.translateToString(t,r,u)}},kN=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new GMt(t)}getNullCell(){return new bg}},ZMt=class extends Su{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Is),this.onBufferChange=this._onBufferChange.event,this._normal=new kN(this._core.buffers.normal,"normal"),this._alternate=new kN(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},KMt=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,u)=>t(r,u.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},YMt=class{constructor(t){this._core=t}register(t){this._core.unicodeService.register(t)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(t){this._core.unicodeService.activeVersion=t}},XMt=["cols","rows"],mv=0,JMt=class extends Su{constructor(e){super(),this._core=this._register(new VMt(e)),this._addonManager=this._register(new qMt),this._publicOptions={...this._core.options};let t=u=>this._core.options[u],r=(u,T)=>{this._checkReadonlyOptions(u),this._core.options[u]=T};for(let u in this._core.options){let T={get:t.bind(this,u),set:r.bind(this,u)};Object.defineProperty(this._publicOptions,u,T)}}_checkReadonlyOptions(e){if(XMt.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new KMt(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new YMt(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new ZMt(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return v9.get()},set promptLabel(e){v9.set(e)},get tooMuchOutput(){return y9.get()},set tooMuchOutput(e){y9.set(e)}}}_verifyIntegers(...e){for(mv of e)if(mv===1/0||isNaN(mv)||mv%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(mv of e)if(mv&&(mv===1/0||isNaN(mv)||mv%1!==0||mv<0))throw new Error("This API only accepts positive integers")}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT @@ -4015,7 +4015,7 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var JMt=2,QMt=1,t9t=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(r.getPropertyValue("height")),T=Math.max(0,parseInt(r.getPropertyValue("width"))),$=window.getComputedStyle(this._terminal.element),K={top:parseInt($.getPropertyValue("padding-top")),bottom:parseInt($.getPropertyValue("padding-bottom")),right:parseInt($.getPropertyValue("padding-right")),left:parseInt($.getPropertyValue("padding-left"))},ct=K.top+K.bottom,yt=K.right+K.left,St=u-ct,Ut=T-yt-t;return{cols:Math.max(JMt,Math.floor(Ut/e.css.cell.width)),rows:Math.max(QMt,Math.floor(St/e.css.cell.height))}}};/** + */var QMt=2,t9t=1,e9t=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(r.getPropertyValue("height")),T=Math.max(0,parseInt(r.getPropertyValue("width"))),$=window.getComputedStyle(this._terminal.element),K={top:parseInt($.getPropertyValue("padding-top")),bottom:parseInt($.getPropertyValue("padding-bottom")),right:parseInt($.getPropertyValue("padding-right")),left:parseInt($.getPropertyValue("padding-left"))},ct=K.top+K.bottom,yt=K.right+K.left,St=u-ct,Ut=T-yt-t;return{cols:Math.max(QMt,Math.floor(Ut/e.css.cell.width)),rows:Math.max(t9t,Math.floor(St/e.css.cell.height))}}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -4026,7 +4026,7 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var e9t=class{constructor(e,t,r,u={}){this._terminal=e,this._regex=t,this._handler=r,this._options=u}provideLinks(e,t){let r=n9t.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(r,u)=>{if(this._options.hover){let{range:T}=t;this._options.hover(r,u,T)}},t))}};function r9t(e){try{let t=new URL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch{return!1}}var n9t=class DT{static computeLink(t,r,u,T){let $=new RegExp(r.source,(r.flags||"")+"g"),[K,ct]=DT._getWindowedLineStrings(t-1,u),yt=K.join(""),St,Ut=[];for(;St=$.exec(yt);){let ne=St[0];if(!r9t(ne))continue;let[pe,me]=DT._mapStrIdx(u,ct,0,St.index),[we,Ce]=DT._mapStrIdx(u,pe,me,ne.length);if(pe===-1||me===-1||we===-1||Ce===-1)continue;let Ve={start:{x:me+1,y:pe+1},end:{x:Ce,y:we+1}};Ut.push({range:Ve,text:ne,activate:T})}return Ut}static _getWindowedLineStrings(t,r){let u,T=t,$=t,K=0,ct="",yt=[];if(u=r.buffer.active.getLine(t)){let St=u.translateToString(!0);if(u.isWrapped&&St[0]!==" "){for(K=0;(u=r.buffer.active.getLine(--T))&&K<2048&&(ct=u.translateToString(!0),K+=ct.length,yt.push(ct),!(!u.isWrapped||ct.indexOf(" ")!==-1)););yt.reverse()}for(yt.push(St),K=0;(u=r.buffer.active.getLine(++$))&&u.isWrapped&&K<2048&&(ct=u.translateToString(!0),K+=ct.length,yt.push(ct),ct.indexOf(" ")===-1););}return[yt,T]}static _mapStrIdx(t,r,u,T){let $=t.buffer.active,K=$.getNullCell(),ct=u;for(;T;){let yt=$.getLine(r);if(!yt)return[-1,-1];for(let St=ct;St`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function a9t(e,t){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var o9t=class{constructor(t=a9t,r={}){this._handler=t,this._options=r}activate(t){this._terminal=t;let r=this._options,u=r.urlRegex||i9t;this._linkProvider=this._terminal.registerLinkProvider(new e9t(this._terminal,u,this._handler,r))}dispose(){this._linkProvider?.dispose()}};/** + */var r9t=class{constructor(e,t,r,u={}){this._terminal=e,this._regex=t,this._handler=r,this._options=u}provideLinks(e,t){let r=i9t.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(r,u)=>{if(this._options.hover){let{range:T}=t;this._options.hover(r,u,T)}},t))}};function n9t(e){try{let t=new URL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch{return!1}}var i9t=class DT{static computeLink(t,r,u,T){let $=new RegExp(r.source,(r.flags||"")+"g"),[K,ct]=DT._getWindowedLineStrings(t-1,u),yt=K.join(""),St,Ut=[];for(;St=$.exec(yt);){let ne=St[0];if(!n9t(ne))continue;let[pe,me]=DT._mapStrIdx(u,ct,0,St.index),[we,Ce]=DT._mapStrIdx(u,pe,me,ne.length);if(pe===-1||me===-1||we===-1||Ce===-1)continue;let Ve={start:{x:me+1,y:pe+1},end:{x:Ce,y:we+1}};Ut.push({range:Ve,text:ne,activate:T})}return Ut}static _getWindowedLineStrings(t,r){let u,T=t,$=t,K=0,ct="",yt=[];if(u=r.buffer.active.getLine(t)){let St=u.translateToString(!0);if(u.isWrapped&&St[0]!==" "){for(K=0;(u=r.buffer.active.getLine(--T))&&K<2048&&(ct=u.translateToString(!0),K+=ct.length,yt.push(ct),!(!u.isWrapped||ct.indexOf(" ")!==-1)););yt.reverse()}for(yt.push(St),K=0;(u=r.buffer.active.getLine(++$))&&u.isWrapped&&K<2048&&(ct=u.translateToString(!0),K+=ct.length,yt.push(ct),ct.indexOf(" ")===-1););}return[yt,T]}static _mapStrIdx(t,r,u,T){let $=t.buffer.active,K=$.getNullCell(),ct=u;for(;T;){let yt=$.getLine(r);if(!yt)return[-1,-1];for(let St=ct;St`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function o9t(e,t){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var s9t=class{constructor(t=o9t,r={}){this._handler=t,this._options=r}activate(t){this._terminal=t;let r=this._options,u=r.urlRegex||a9t;this._linkProvider=this._terminal.registerLinkProvider(new r9t(this._terminal,u,this._handler,r))}dispose(){this._linkProvider?.dispose()}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -4037,13 +4037,13 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var s9t=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?TN.isErrorNoTelemetry(e)?new TN(e.message+` + */var l9t=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?TN.isErrorNoTelemetry(e)?new TN(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},l9t=new s9t;function pM(e){c9t(e)||l9t.onUnexpectedError(e)}var tE="Canceled";function c9t(e){return e instanceof u9t?!0:e instanceof Error&&e.name===tE&&e.message===tE}var u9t=class extends Error{constructor(){super(tE),this.name=this.message}},TN=class eE extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof eE)return t;let r=new eE;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},h9t;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(h9t||={});function d9t(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var RV;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function FV(...e){return ew(()=>D5(e))}function ew(e){return{dispose:d9t(()=>{e()})}}var NV=class jV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{D5(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?jV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};NV.DISABLE_DISPOSED_WARNING=!1;var TL=NV,x_=class{constructor(){this._store=new TL,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};x_.None=Object.freeze({dispose(){}});var fS=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},f9t=globalThis.performance&&typeof globalThis.performance.now=="function",p9t=class UV{static create(t){return new UV(t)}constructor(t){this._now=f9t&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},SL;(e=>{e.None=()=>x_.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=FV(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new wv(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new wv(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new wv({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new wv({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new wv({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new wv;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new wv(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof TL?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(SL||={});var rE=class nE{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${nE._idPool++}`,nE.all.add(this)}start(t){this._stopWatch=new p9t,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};rE.all=new Set,rE._idPool=0;var m9t=rE,g9t=-1,$V=class HV{constructor(t,r,u=(HV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},c9t=new l9t;function pM(e){u9t(e)||c9t.onUnexpectedError(e)}var tE="Canceled";function u9t(e){return e instanceof h9t?!0:e instanceof Error&&e.name===tE&&e.message===tE}var h9t=class extends Error{constructor(){super(tE),this.name=this.message}},TN=class eE extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof eE)return t;let r=new eE;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},d9t;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(d9t||={});function f9t(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var RV;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function FV(...e){return ew(()=>D5(e))}function ew(e){return{dispose:f9t(()=>{e()})}}var NV=class jV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{D5(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?jV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};NV.DISABLE_DISPOSED_WARNING=!1;var TL=NV,x_=class{constructor(){this._store=new TL,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};x_.None=Object.freeze({dispose(){}});var fS=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},p9t=globalThis.performance&&typeof globalThis.performance.now=="function",m9t=class UV{static create(t){return new UV(t)}constructor(t){this._now=p9t&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},SL;(e=>{e.None=()=>x_.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=FV(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new wv(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new wv(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new wv({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new wv({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new wv({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new wv;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new wv(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof TL?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(SL||={});var rE=class nE{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${nE._idPool++}`,nE.all.add(this)}start(t){this._stopWatch=new m9t,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};rE.all=new Set,rE._idPool=0;var g9t=rE,v9t=-1,$V=class HV{constructor(t,r,u=(HV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ct=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ct);let yt=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],St=new x9t(`${ct}. HINT: Stack shows most frequent listener (${yt[1]}-times)`,yt[0]);return(this._options?.onListenerError||pM)(St),x_.None}if(this._disposed)return x_.None;r&&(t=t.bind(r));let T=new mM(t),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(T.stack=y9t.create(),$=this._leakageMon.check(T.stack,this._size+1)),this._listeners?this._listeners instanceof mM?(this._deliveryQueue??=new T9t,this._listeners=[this._listeners,T]):this._listeners.push(T):(this._options?.onWillAddFirstListener?.(this),this._listeners=T,this._options?.onDidAddFirstListener?.(this)),this._size++;let K=ew(()=>{$?.(),this._removeListener(T)});return u instanceof TL?u.add(K):Array.isArray(u)&&u.push(K),K},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,u=r.indexOf(t);if(u===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[u]=void 0;let T=this._deliveryQueue.current===this;if(this._size*w9t<=r.length){let $=0;for(let K=0;K0}},T9t=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},WV=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),S9t;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof C9t?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:SL.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:WV})})(S9t||={});var C9t=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?WV:(this._emitter||(this._emitter=new wv),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},A2="en",gM=!1,cT,zT=A2,SN=A2,A9t,C1,Bx=globalThis,Wm;typeof Bx.vscode<"u"&&typeof Bx.vscode.process<"u"?Wm=Bx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Wm=process);var M9t=typeof Wm?.versions?.electron=="string",E9t=M9t&&Wm?.type==="renderer";if(typeof Wm=="object"){Wm.platform,Wm.platform,gM=Wm.platform==="linux",gM&&Wm.env.SNAP&&Wm.env.SNAP_REVISION,Wm.env.CI||Wm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cT=A2,zT=A2;let e=Wm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);cT=t.userLocale,SN=t.osLocale,zT=t.resolvedLanguage||A2,A9t=t.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!E9t?(C1=navigator.userAgent,C1.indexOf("Windows")>=0,C1.indexOf("Macintosh")>=0,(C1.indexOf("Macintosh")>=0||C1.indexOf("iPad")>=0||C1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,gM=C1.indexOf("Linux")>=0,C1?.indexOf("Mobi")>=0,zT=globalThis._VSCODE_NLS_LANGUAGE||A2,cT=navigator.language.toLowerCase(),SN=cT):console.error("Unable to resolve platform.");var Bv=C1,Wy=zT,L9t;(e=>{function t(){return Wy}e.value=t;function r(){return Wy.length===2?Wy==="en":Wy.length>=3?Wy[0]==="e"&&Wy[1]==="n"&&Wy[2]==="-":!1}e.isDefaultVariant=r;function u(){return Wy==="en"}e.isDefault=u})(L9t||={});var P9t=typeof Bx.postMessage=="function"&&!Bx.importScripts;(()=>{if(P9t){let e=[];Bx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let u=0,T=e.length;u{let u=++t;e.push({id:u,callback:r}),Bx.postMessage({vscodeScheduleAsyncWork:u},"*")}}return e=>setTimeout(e)})();var I9t=!!(Bv&&Bv.indexOf("Chrome")>=0);Bv&&Bv.indexOf("Firefox")>=0;!I9t&&Bv&&Bv.indexOf("Safari")>=0;Bv&&Bv.indexOf("Edg/")>=0;Bv&&Bv.indexOf("Android")>=0;function qV(e,t=0,r){let u=setTimeout(()=>{e()},t);return ew(()=>{clearTimeout(u)})}var D9t;(e=>{async function t(u){let T,$=await Promise.all(u.map(K=>K.then(ct=>ct,ct=>{T||(T=ct)})));if(typeof T<"u")throw T;return $}e.settled=t;function r(u){return new Promise(async(T,$)=>{try{await u(T,$)}catch(K){$(K)}})}e.withAsyncBody=r})(D9t||={});var CN=class dg{static fromArray(t){return new dg(r=>{r.emitMany(t)})}static fromPromise(t){return new dg(async r=>{r.emitMany(await t)})}static fromPromises(t){return new dg(async r=>{await Promise.all(t.map(async u=>r.emitOne(await u)))})}static merge(t){return new dg(async r=>{await Promise.all(t.map(async u=>{for await(let T of u)r.emitOne(T)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new wv,queueMicrotask(async()=>{let u={emitOne:T=>this.emitOne(T),emitMany:T=>this.emitMany(T),reject:T=>this.reject(T)};try{await Promise.resolve(t(u)),this.resolve()}catch(T){this.reject(T)}finally{u.emitOne=void 0,u.emitMany=void 0,u.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new dg(async u=>{for await(let T of t)u.emitOne(r(T))})}map(t){return dg.map(this,t)}static filter(t,r){return new dg(async u=>{for await(let T of t)r(T)&&u.emitOne(T)})}filter(t){return dg.filter(this,t)}static coalesce(t){return dg.filter(t,r=>!!r)}coalesce(){return dg.coalesce(this)}static async toPromise(t){let r=[];for await(let u of t)r.push(u);return r}toPromise(){return dg.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};CN.EMPTY=CN.fromArray([]);var z9t=class extends x_{constructor(t){super(),this._terminal=t,this._linesCacheTimeout=this._register(new fS),this._linesCacheDisposables=this._register(new fS),this._register(ew(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=FV(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=qV(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(t){return this._linesCache?.[t]}setLineInCache(t,r){this._linesCache&&(this._linesCache[t]=r)}translateBufferLineToStringWithWrap(t,r){let u=[],T=[0],$=this._terminal.buffer.active.getLine(t);for(;$;){let K=this._terminal.buffer.active.getLine(t+1),ct=K?K.isWrapped:!1,yt=$.translateToString(!ct&&r);if(ct&&K){let St=$.getCell($.length-1);St&&St.getCode()===0&&St.getWidth()===1&&K.getCell(0)?.getWidth()===2&&(yt=yt.slice(0,-1))}if(u.push(yt),ct)T.push(T[T.length-1]+yt.length);else break;t++,$=K}return[u.join(""),T]}},O9t=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(t){this._cachedSearchTerm=t}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(t){this._lastSearchOptions=t}isValidSearchTerm(t){return!!(t&&t.length>0)}didOptionsChange(t){return this._lastSearchOptions?t?this._lastSearchOptions.caseSensitive!==t.caseSensitive||this._lastSearchOptions.regex!==t.regex||this._lastSearchOptions.wholeWord!==t.wholeWord:!1:!0}shouldUpdateHighlighting(t,r){return r?.decorations?this._cachedSearchTerm===void 0||t!==this._cachedSearchTerm||this.didOptionsChange(r):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},B9t=class{constructor(t,r){this._terminal=t,this._lineCache=r}find(t,r,u,T){if(!t||t.length===0){this._terminal.clearSelection();return}if(u>this._terminal.cols)throw new Error(`Invalid col: ${u} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let $={startRow:r,startCol:u},K=this._findInLine(t,$,T);if(!K)for(let ct=r+1;ct=0&&(yt.startRow=Ut,St=this._findInLine(t,yt,r,ct),!St);Ut--);}if(!St&&$!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let Ut=this._terminal.buffer.active.baseY+this._terminal.rows-1;Ut>=$&&(yt.startRow=Ut,St=this._findInLine(t,yt,r,ct),!St);Ut--);return St}_isWholeWord(t,r,u){return(t===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[t-1]))&&(t+u.length===r.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[t+u.length]))}_findInLine(t,r,u={},T=!1){let $=r.startRow,K=r.startCol;if(this._terminal.buffer.active.getLine($)?.isWrapped){if(T){r.startCol+=this._terminal.cols;return}return r.startRow--,r.startCol+=this._terminal.cols,this._findInLine(t,r,u)}let ct=this._lineCache.getLineFromCache($);ct||(ct=this._lineCache.translateBufferLineToStringWithWrap($,!0),this._lineCache.setLineInCache($,ct));let[yt,St]=ct,Ut=this._bufferColsToStringOffset($,K),ne=t,pe=yt;u.regex||(ne=u.caseSensitive?t:t.toLowerCase(),pe=u.caseSensitive?yt:yt.toLowerCase());let me=-1;if(u.regex){let we=RegExp(ne,u.caseSensitive?"g":"gi"),Ce;if(T)for(;Ce=we.exec(pe.slice(0,Ut));)me=we.lastIndex-Ce[0].length,t=Ce[0],we.lastIndex-=t.length-1;else Ce=we.exec(pe.slice(Ut)),Ce&&Ce[0].length>0&&(me=Ut+(we.lastIndex-Ce[0].length),t=Ce[0])}else T?Ut-ne.length>=0&&(me=pe.lastIndexOf(ne,Ut-ne.length)):me=pe.indexOf(ne,Ut);if(me>=0){if(u.wholeWord&&!this._isWholeWord(me,pe,t))return;let we=0;for(;we=St[we+1];)we++;let Ce=we;for(;Ce=St[Ce+1];)Ce++;let Ve=me-St[we],kr=me+t.length-St[Ce],It=this._stringLengthToBufferSize($+we,Ve),rn=this._stringLengthToBufferSize($+Ce,kr)-It+this._terminal.cols*(Ce-we);return{term:t,col:It,row:$+we,size:rn}}}_stringLengthToBufferSize(t,r){let u=this._terminal.buffer.active.getLine(t);if(!u)return 0;for(let T=0;T1&&(r-=K.length-1);let ct=u.getCell(T+1);ct&&ct.getWidth()===0&&r++}return r}_bufferColsToStringOffset(t,r){let u=t,T=0,$=this._terminal.buffer.active.getLine(u);for(;r>0&&$;){for(let K=0;Kthis.clearHighlightDecorations()))}createHighlightDecorations(e,t){this.clearHighlightDecorations();for(let r of e){let u=this._createResultDecorations(r,t,!1);if(u)for(let T of u)this._storeDecoration(T,r)}}createActiveDecoration(e,t){let r=this._createResultDecorations(e,t,!0);if(r)return{decorations:r,match:e,dispose(){D5(r)}}}clearHighlightDecorations(){D5(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,r){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),r&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,r){let u=[],T=e.col,$=e.size,K=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;$>0;){let yt=Math.min(this._terminal.cols-T,$);u.push([K,T,yt]),T=0,$-=yt,K++}let ct=[];for(let yt of u){let St=this._terminal.registerMarker(yt[0]),Ut=this._terminal.registerDecoration({marker:St,x:yt[1],width:yt[2],backgroundColor:r?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(St.line)?void 0:{color:r?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(Ut){let ne=[];ne.push(St),ne.push(Ut.onRender(pe=>this._applyStyles(pe,r?t.activeMatchBorder:t.matchBorder,!1))),ne.push(Ut.onDispose(()=>D5(ne))),ct.push(Ut)}}return ct.length===0?void 0:ct}},F9t=class extends x_{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new wv)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;tthis._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(ew(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=qV(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let u=this._findNextAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,u}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e)){this.clearDecorations();return}this.clearDecorations(!0);let r=[],u,T=this._engine.find(e,0,0,t);for(;T&&(u?.row!==T.row||u?.col!==T.col)&&!(r.length>=this._highlightLimit);)u=T,r.push(u),T=this._engine.find(e,u.col+u.term.length>=this._terminal.cols?u.row+1:u.row,u.col+u.term.length>=this._terminal.cols?0:u.col+1,t);this._resultTracker.updateResults(r,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(r,t.decorations)}_findNextAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let u=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(u,t?.decorations,r?.noScroll)}findPrevious(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let u=this._findPreviousAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,u}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let u=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(u,t?.decorations,r?.noScroll)}_selectResult(e,t,r){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let u=this._decorationManager.createActiveDecoration(e,t);u&&(this._resultTracker.selectedDecoration=u)}if(!r&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ct=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ct);let yt=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],St=new b9t(`${ct}. HINT: Stack shows most frequent listener (${yt[1]}-times)`,yt[0]);return(this._options?.onListenerError||pM)(St),x_.None}if(this._disposed)return x_.None;r&&(t=t.bind(r));let T=new mM(t),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(T.stack=_9t.create(),$=this._leakageMon.check(T.stack,this._size+1)),this._listeners?this._listeners instanceof mM?(this._deliveryQueue??=new S9t,this._listeners=[this._listeners,T]):this._listeners.push(T):(this._options?.onWillAddFirstListener?.(this),this._listeners=T,this._options?.onDidAddFirstListener?.(this)),this._size++;let K=ew(()=>{$?.(),this._removeListener(T)});return u instanceof TL?u.add(K):Array.isArray(u)&&u.push(K),K},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,u=r.indexOf(t);if(u===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[u]=void 0;let T=this._deliveryQueue.current===this;if(this._size*k9t<=r.length){let $=0;for(let K=0;K0}},S9t=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},WV=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),C9t;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof A9t?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:SL.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:WV})})(C9t||={});var A9t=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?WV:(this._emitter||(this._emitter=new wv),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},A2="en",gM=!1,cT,zT=A2,SN=A2,M9t,C1,Rx=globalThis,Wm;typeof Rx.vscode<"u"&&typeof Rx.vscode.process<"u"?Wm=Rx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Wm=process);var E9t=typeof Wm?.versions?.electron=="string",L9t=E9t&&Wm?.type==="renderer";if(typeof Wm=="object"){Wm.platform,Wm.platform,gM=Wm.platform==="linux",gM&&Wm.env.SNAP&&Wm.env.SNAP_REVISION,Wm.env.CI||Wm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cT=A2,zT=A2;let e=Wm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);cT=t.userLocale,SN=t.osLocale,zT=t.resolvedLanguage||A2,M9t=t.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!L9t?(C1=navigator.userAgent,C1.indexOf("Windows")>=0,C1.indexOf("Macintosh")>=0,(C1.indexOf("Macintosh")>=0||C1.indexOf("iPad")>=0||C1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,gM=C1.indexOf("Linux")>=0,C1?.indexOf("Mobi")>=0,zT=globalThis._VSCODE_NLS_LANGUAGE||A2,cT=navigator.language.toLowerCase(),SN=cT):console.error("Unable to resolve platform.");var Bv=C1,Wy=zT,P9t;(e=>{function t(){return Wy}e.value=t;function r(){return Wy.length===2?Wy==="en":Wy.length>=3?Wy[0]==="e"&&Wy[1]==="n"&&Wy[2]==="-":!1}e.isDefaultVariant=r;function u(){return Wy==="en"}e.isDefault=u})(P9t||={});var I9t=typeof Rx.postMessage=="function"&&!Rx.importScripts;(()=>{if(I9t){let e=[];Rx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let u=0,T=e.length;u{let u=++t;e.push({id:u,callback:r}),Rx.postMessage({vscodeScheduleAsyncWork:u},"*")}}return e=>setTimeout(e)})();var D9t=!!(Bv&&Bv.indexOf("Chrome")>=0);Bv&&Bv.indexOf("Firefox")>=0;!D9t&&Bv&&Bv.indexOf("Safari")>=0;Bv&&Bv.indexOf("Edg/")>=0;Bv&&Bv.indexOf("Android")>=0;function qV(e,t=0,r){let u=setTimeout(()=>{e()},t);return ew(()=>{clearTimeout(u)})}var z9t;(e=>{async function t(u){let T,$=await Promise.all(u.map(K=>K.then(ct=>ct,ct=>{T||(T=ct)})));if(typeof T<"u")throw T;return $}e.settled=t;function r(u){return new Promise(async(T,$)=>{try{await u(T,$)}catch(K){$(K)}})}e.withAsyncBody=r})(z9t||={});var CN=class dg{static fromArray(t){return new dg(r=>{r.emitMany(t)})}static fromPromise(t){return new dg(async r=>{r.emitMany(await t)})}static fromPromises(t){return new dg(async r=>{await Promise.all(t.map(async u=>r.emitOne(await u)))})}static merge(t){return new dg(async r=>{await Promise.all(t.map(async u=>{for await(let T of u)r.emitOne(T)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new wv,queueMicrotask(async()=>{let u={emitOne:T=>this.emitOne(T),emitMany:T=>this.emitMany(T),reject:T=>this.reject(T)};try{await Promise.resolve(t(u)),this.resolve()}catch(T){this.reject(T)}finally{u.emitOne=void 0,u.emitMany=void 0,u.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new dg(async u=>{for await(let T of t)u.emitOne(r(T))})}map(t){return dg.map(this,t)}static filter(t,r){return new dg(async u=>{for await(let T of t)r(T)&&u.emitOne(T)})}filter(t){return dg.filter(this,t)}static coalesce(t){return dg.filter(t,r=>!!r)}coalesce(){return dg.coalesce(this)}static async toPromise(t){let r=[];for await(let u of t)r.push(u);return r}toPromise(){return dg.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};CN.EMPTY=CN.fromArray([]);var O9t=class extends x_{constructor(t){super(),this._terminal=t,this._linesCacheTimeout=this._register(new fS),this._linesCacheDisposables=this._register(new fS),this._register(ew(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=FV(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=qV(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(t){return this._linesCache?.[t]}setLineInCache(t,r){this._linesCache&&(this._linesCache[t]=r)}translateBufferLineToStringWithWrap(t,r){let u=[],T=[0],$=this._terminal.buffer.active.getLine(t);for(;$;){let K=this._terminal.buffer.active.getLine(t+1),ct=K?K.isWrapped:!1,yt=$.translateToString(!ct&&r);if(ct&&K){let St=$.getCell($.length-1);St&&St.getCode()===0&&St.getWidth()===1&&K.getCell(0)?.getWidth()===2&&(yt=yt.slice(0,-1))}if(u.push(yt),ct)T.push(T[T.length-1]+yt.length);else break;t++,$=K}return[u.join(""),T]}},B9t=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(t){this._cachedSearchTerm=t}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(t){this._lastSearchOptions=t}isValidSearchTerm(t){return!!(t&&t.length>0)}didOptionsChange(t){return this._lastSearchOptions?t?this._lastSearchOptions.caseSensitive!==t.caseSensitive||this._lastSearchOptions.regex!==t.regex||this._lastSearchOptions.wholeWord!==t.wholeWord:!1:!0}shouldUpdateHighlighting(t,r){return r?.decorations?this._cachedSearchTerm===void 0||t!==this._cachedSearchTerm||this.didOptionsChange(r):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},R9t=class{constructor(t,r){this._terminal=t,this._lineCache=r}find(t,r,u,T){if(!t||t.length===0){this._terminal.clearSelection();return}if(u>this._terminal.cols)throw new Error(`Invalid col: ${u} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let $={startRow:r,startCol:u},K=this._findInLine(t,$,T);if(!K)for(let ct=r+1;ct=0&&(yt.startRow=Ut,St=this._findInLine(t,yt,r,ct),!St);Ut--);}if(!St&&$!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let Ut=this._terminal.buffer.active.baseY+this._terminal.rows-1;Ut>=$&&(yt.startRow=Ut,St=this._findInLine(t,yt,r,ct),!St);Ut--);return St}_isWholeWord(t,r,u){return(t===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[t-1]))&&(t+u.length===r.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[t+u.length]))}_findInLine(t,r,u={},T=!1){let $=r.startRow,K=r.startCol;if(this._terminal.buffer.active.getLine($)?.isWrapped){if(T){r.startCol+=this._terminal.cols;return}return r.startRow--,r.startCol+=this._terminal.cols,this._findInLine(t,r,u)}let ct=this._lineCache.getLineFromCache($);ct||(ct=this._lineCache.translateBufferLineToStringWithWrap($,!0),this._lineCache.setLineInCache($,ct));let[yt,St]=ct,Ut=this._bufferColsToStringOffset($,K),ne=t,pe=yt;u.regex||(ne=u.caseSensitive?t:t.toLowerCase(),pe=u.caseSensitive?yt:yt.toLowerCase());let me=-1;if(u.regex){let we=RegExp(ne,u.caseSensitive?"g":"gi"),Ce;if(T)for(;Ce=we.exec(pe.slice(0,Ut));)me=we.lastIndex-Ce[0].length,t=Ce[0],we.lastIndex-=t.length-1;else Ce=we.exec(pe.slice(Ut)),Ce&&Ce[0].length>0&&(me=Ut+(we.lastIndex-Ce[0].length),t=Ce[0])}else T?Ut-ne.length>=0&&(me=pe.lastIndexOf(ne,Ut-ne.length)):me=pe.indexOf(ne,Ut);if(me>=0){if(u.wholeWord&&!this._isWholeWord(me,pe,t))return;let we=0;for(;we=St[we+1];)we++;let Ce=we;for(;Ce=St[Ce+1];)Ce++;let Ve=me-St[we],kr=me+t.length-St[Ce],It=this._stringLengthToBufferSize($+we,Ve),rn=this._stringLengthToBufferSize($+Ce,kr)-It+this._terminal.cols*(Ce-we);return{term:t,col:It,row:$+we,size:rn}}}_stringLengthToBufferSize(t,r){let u=this._terminal.buffer.active.getLine(t);if(!u)return 0;for(let T=0;T1&&(r-=K.length-1);let ct=u.getCell(T+1);ct&&ct.getWidth()===0&&r++}return r}_bufferColsToStringOffset(t,r){let u=t,T=0,$=this._terminal.buffer.active.getLine(u);for(;r>0&&$;){for(let K=0;Kthis.clearHighlightDecorations()))}createHighlightDecorations(e,t){this.clearHighlightDecorations();for(let r of e){let u=this._createResultDecorations(r,t,!1);if(u)for(let T of u)this._storeDecoration(T,r)}}createActiveDecoration(e,t){let r=this._createResultDecorations(e,t,!0);if(r)return{decorations:r,match:e,dispose(){D5(r)}}}clearHighlightDecorations(){D5(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,r){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),r&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,r){let u=[],T=e.col,$=e.size,K=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;$>0;){let yt=Math.min(this._terminal.cols-T,$);u.push([K,T,yt]),T=0,$-=yt,K++}let ct=[];for(let yt of u){let St=this._terminal.registerMarker(yt[0]),Ut=this._terminal.registerDecoration({marker:St,x:yt[1],width:yt[2],backgroundColor:r?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(St.line)?void 0:{color:r?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(Ut){let ne=[];ne.push(St),ne.push(Ut.onRender(pe=>this._applyStyles(pe,r?t.activeMatchBorder:t.matchBorder,!1))),ne.push(Ut.onDispose(()=>D5(ne))),ct.push(Ut)}}return ct.length===0?void 0:ct}},N9t=class extends x_{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new wv)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;tthis._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(ew(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=qV(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let u=this._findNextAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,u}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e)){this.clearDecorations();return}this.clearDecorations(!0);let r=[],u,T=this._engine.find(e,0,0,t);for(;T&&(u?.row!==T.row||u?.col!==T.col)&&!(r.length>=this._highlightLimit);)u=T,r.push(u),T=this._engine.find(e,u.col+u.term.length>=this._terminal.cols?u.row+1:u.row,u.col+u.term.length>=this._terminal.cols?0:u.col+1,t);this._resultTracker.updateResults(r,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(r,t.decorations)}_findNextAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let u=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(u,t?.decorations,r?.noScroll)}findPrevious(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let u=this._findPreviousAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,u}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let u=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(u,t?.decorations,r?.noScroll)}_selectResult(e,t,r){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let u=this._decorationManager.createActiveDecoration(e,t);u&&(this._resultTracker.selectedDecoration=u)}if(!r&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.rowt[u][1])return!1;for(;u>=r;)if(T=r+u>>1,e>t[T][1])r=T+1;else if(e=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,r){let u=this.wcwidth(t),T=u===0&&r!==0;if(T){let $=mS.extractWidth(r);$===0?T=!1:$>u&&(u=$)}return mS.createPropertyValue(0,u,T)}},H9t=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?AN.isErrorNoTelemetry(e)?new AN(e.message+` + */var vM=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],U9t=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],zp;function $9t(e,t){let r=0,u=t.length-1,T;if(et[u][1])return!1;for(;u>=r;)if(T=r+u>>1,e>t[T][1])r=T+1;else if(e=131072&&t<=196605||t>=196608&&t<=262141?2:1}charProperties(t,r){let u=this.wcwidth(t),T=u===0&&r!==0;if(T){let $=mS.extractWidth(r);$===0?T=!1:$>u&&(u=$)}return mS.createPropertyValue(0,u,T)}},V9t=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?AN.isErrorNoTelemetry(e)?new AN(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},V9t=new H9t;function yM(e){W9t(e)||V9t.onUnexpectedError(e)}var iE="Canceled";function W9t(e){return e instanceof q9t?!0:e instanceof Error&&e.name===iE&&e.message===iE}var q9t=class extends Error{constructor(){super(iE),this.name=this.message}},AN=class aE extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof aE)return t;let r=new aE;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function G9t(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var Z9t;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Z9t||={});var GV;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function K9t(...e){return KV(()=>ZV(e))}function KV(e){return{dispose:G9t(()=>{e()})}}var YV=class XV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ZV(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?XV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};YV.DISABLE_DISPOSED_WARNING=!1;var CL=YV,pS=class{constructor(){this._store=new CL,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};pS.None=Object.freeze({dispose(){}});var Y9t=globalThis.performance&&typeof globalThis.performance.now=="function",X9t=class JV{static create(t){return new JV(t)}constructor(t){this._now=Y9t&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},J9t;(e=>{e.None=()=>pS.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=K9t(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new Xy(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new Xy(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new Xy({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new Xy({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new Xy({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new Xy;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new Xy(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof CL?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(J9t||={});var oE=class sE{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${sE._idPool++}`,sE.all.add(this)}start(t){this._stopWatch=new X9t,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};oE.all=new Set,oE._idPool=0;var Q9t=oE,tEt=-1,QV=class tW{constructor(t,r,u=(tW._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},W9t=new V9t;function yM(e){q9t(e)||W9t.onUnexpectedError(e)}var iE="Canceled";function q9t(e){return e instanceof G9t?!0:e instanceof Error&&e.name===iE&&e.message===iE}var G9t=class extends Error{constructor(){super(iE),this.name=this.message}},AN=class aE extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof aE)return t;let r=new aE;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function Z9t(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var K9t;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(K9t||={});var GV;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Y9t(...e){return KV(()=>ZV(e))}function KV(e){return{dispose:Z9t(()=>{e()})}}var YV=class XV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ZV(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?XV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};YV.DISABLE_DISPOSED_WARNING=!1;var CL=YV,pS=class{constructor(){this._store=new CL,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};pS.None=Object.freeze({dispose(){}});var X9t=globalThis.performance&&typeof globalThis.performance.now=="function",J9t=class JV{static create(t){return new JV(t)}constructor(t){this._now=X9t&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Q9t;(e=>{e.None=()=>pS.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=Y9t(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new Xy(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new Xy(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new Xy({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new Xy({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new Xy({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new Xy;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new Xy(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof CL?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(Q9t||={});var oE=class sE{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${sE._idPool++}`,sE.all.add(this)}start(t){this._stopWatch=new J9t,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};oE.all=new Set,oE._idPool=0;var tEt=oE,eEt=-1,QV=class tW{constructor(t,r,u=(tW._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ct=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ct);let yt=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],St=new iEt(`${ct}. HINT: Stack shows most frequent listener (${yt[1]}-times)`,yt[0]);return(this._options?.onListenerError||yM)(St),pS.None}if(this._disposed)return pS.None;r&&(t=t.bind(r));let T=new _M(t),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(T.stack=rEt.create(),$=this._leakageMon.check(T.stack,this._size+1)),this._listeners?this._listeners instanceof _M?(this._deliveryQueue??=new lEt,this._listeners=[this._listeners,T]):this._listeners.push(T):(this._options?.onWillAddFirstListener?.(this),this._listeners=T,this._options?.onDidAddFirstListener?.(this)),this._size++;let K=KV(()=>{$?.(),this._removeListener(T)});return u instanceof CL?u.add(K):Array.isArray(u)&&u.push(K),K},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,u=r.indexOf(t);if(u===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[u]=void 0;let T=this._deliveryQueue.current===this;if(this._size*oEt<=r.length){let $=0;for(let K=0;K0}},lEt=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},mS=class OT{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Xy,this.onChange=this._onChange.event;let t=new $9t;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,u=!1){return(t&16777215)<<3|(r&3)<<1|(u?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,u=0,T=t.length;for(let $=0;$=T)return r+this.wcwidth(K);let St=t.charCodeAt($);56320<=St&&St<=57343?K=(K-55296)*1024+St-56320+65536:r+=this.wcwidth(St)}let ct=this.charProperties(K,u),yt=OT.extractWidth(ct);OT.extractShouldJoin(ct)&&(yt-=OT.extractWidth(u)),r+=yt,u=ct}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},xM=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],cEt=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],bM=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],uEt=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],_1;function MN(e,t){let r=0,u=t.length-1,T;if(et[u][1])return!1;for(;u>=r;)if(T=r+u>>1,e>t[T][1])r=T+1;else if(er&&(r=T)}return mS.createPropertyValue(0,r,u)}},dEt=class{activate(e){e.unicode.register(new hEt)}dispose(){}};/** +`))}},iEt=class extends Error{constructor(t,r){super(t),this.name="ListenerLeakError",this.stack=r}},aEt=class extends Error{constructor(t,r){super(t),this.name="ListenerRefusalError",this.stack=r}},oEt=0,_M=class{constructor(e){this.value=e,this.id=oEt++}},sEt=2,lEt,Xy=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new rEt(t?.onListenerError??yM,this._options?.leakWarningThreshold??eEt):void 0,this._perfMon=this._options?._profName?new tEt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,r,u)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ct=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ct);let yt=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],St=new aEt(`${ct}. HINT: Stack shows most frequent listener (${yt[1]}-times)`,yt[0]);return(this._options?.onListenerError||yM)(St),pS.None}if(this._disposed)return pS.None;r&&(t=t.bind(r));let T=new _M(t),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(T.stack=nEt.create(),$=this._leakageMon.check(T.stack,this._size+1)),this._listeners?this._listeners instanceof _M?(this._deliveryQueue??=new cEt,this._listeners=[this._listeners,T]):this._listeners.push(T):(this._options?.onWillAddFirstListener?.(this),this._listeners=T,this._options?.onDidAddFirstListener?.(this)),this._size++;let K=KV(()=>{$?.(),this._removeListener(T)});return u instanceof CL?u.add(K):Array.isArray(u)&&u.push(K),K},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,u=r.indexOf(t);if(u===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[u]=void 0;let T=this._deliveryQueue.current===this;if(this._size*sEt<=r.length){let $=0;for(let K=0;K0}},cEt=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},mS=class OT{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Xy,this.onChange=this._onChange.event;let t=new H9t;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,u=!1){return(t&16777215)<<3|(r&3)<<1|(u?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,u=0,T=t.length;for(let $=0;$=T)return r+this.wcwidth(K);let St=t.charCodeAt($);56320<=St&&St<=57343?K=(K-55296)*1024+St-56320+65536:r+=this.wcwidth(St)}let ct=this.charProperties(K,u),yt=OT.extractWidth(ct);OT.extractShouldJoin(ct)&&(yt-=OT.extractWidth(u)),r+=yt,u=ct}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},xM=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],uEt=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],bM=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],hEt=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],_1;function MN(e,t){let r=0,u=t.length-1,T;if(et[u][1])return!1;for(;u>=r;)if(T=r+u>>1,e>t[T][1])r=T+1;else if(er&&(r=T)}return mS.createPropertyValue(0,r,u)}},fEt=class{activate(e){e.unicode.register(new dEt)}dispose(){}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -4071,13 +4071,13 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var fEt=(e,t,r,u)=>{for(var T=t,$=e.length-1,K;$>=0;$--)(K=e[$])&&(T=K(T)||T);return T},pEt=(e,t)=>(r,u)=>t(r,u,e),mEt=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?EN.isErrorNoTelemetry(e)?new EN(e.message+` + */var pEt=(e,t,r,u)=>{for(var T=t,$=e.length-1,K;$>=0;$--)(K=e[$])&&(T=K(T)||T);return T},mEt=(e,t)=>(r,u)=>t(r,u,e),gEt=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?EN.isErrorNoTelemetry(e)?new EN(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},gEt=new mEt;function wM(e){vEt(e)||gEt.onUnexpectedError(e)}var lE="Canceled";function vEt(e){return e instanceof yEt?!0:e instanceof Error&&e.name===lE&&e.message===lE}var yEt=class extends Error{constructor(){super(lE),this.name=this.message}},EN=class cE extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof cE)return t;let r=new cE;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},_Et;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(_Et||={});function xEt(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var rW;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function iW(...e){return N0(()=>nW(e))}function N0(e){return{dispose:xEt(()=>{e()})}}var aW=class oW{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{nW(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?oW.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};aW.DISABLE_DISPOSED_WARNING=!1;var O2=aW,Ug=class{constructor(){this._store=new O2,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ug.None=Object.freeze({dispose(){}});var Q3=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},AL=typeof process<"u"&&"title"in process,t8=AL?"node":navigator.userAgent,bEt=AL?"node":navigator.platform,wEt=t8.includes("Firefox"),kEt=t8.includes("Edge"),sW=/^((?!chrome|android).)*safari/i.test(t8);function TEt(){if(!sW)return 0;let e=t8.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}bEt.indexOf("Linux")>=0;var SEt="",i0=0,a0=0,o0=0,Uf=0,fg={css:"#00000000",rgba:0},im;(e=>{function t(T,$,K,ct){return ct!==void 0?`#${gx(T)}${gx($)}${gx(K)}${gx(ct)}`:`#${gx(T)}${gx($)}${gx(K)}`}e.toCss=t;function r(T,$,K,ct=255){return(T<<24|$<<16|K<<8|ct)>>>0}e.toRgba=r;function u(T,$,K,ct){return{css:e.toCss(T,$,K,ct),rgba:e.toRgba(T,$,K,ct)}}e.toColor=u})(im||={});var m5;(e=>{function t(yt,St){if(Uf=(St.rgba&255)/255,Uf===1)return{css:St.css,rgba:St.rgba};let Ut=St.rgba>>24&255,ne=St.rgba>>16&255,pe=St.rgba>>8&255,me=yt.rgba>>24&255,we=yt.rgba>>16&255,Ce=yt.rgba>>8&255;i0=me+Math.round((Ut-me)*Uf),a0=we+Math.round((ne-we)*Uf),o0=Ce+Math.round((pe-Ce)*Uf);let Ve=im.toCss(i0,a0,o0),kr=im.toRgba(i0,a0,o0);return{css:Ve,rgba:kr}}e.blend=t;function r(yt){return(yt.rgba&255)===255}e.isOpaque=r;function u(yt,St,Ut){let ne=Rx.ensureContrastRatio(yt.rgba,St.rgba,Ut);if(ne)return im.toColor(ne>>24&255,ne>>16&255,ne>>8&255)}e.ensureContrastRatio=u;function T(yt){let St=(yt.rgba|255)>>>0;return[i0,a0,o0]=Rx.toChannels(St),{css:im.toCss(i0,a0,o0),rgba:St}}e.opaque=T;function $(yt,St){return Uf=Math.round(St*255),[i0,a0,o0]=Rx.toChannels(yt.rgba),{css:im.toCss(i0,a0,o0,Uf),rgba:im.toRgba(i0,a0,o0,Uf)}}e.opacity=$;function K(yt,St){return Uf=yt.rgba&255,$(yt,Uf*St/255)}e.multiplyOpacity=K;function ct(yt){return[yt.rgba>>24&255,yt.rgba>>16&255,yt.rgba>>8&255]}e.toColorRGB=ct})(m5||={});var CEt;(e=>{let t,r;try{let T=document.createElement("canvas");T.width=1,T.height=1;let $=T.getContext("2d",{willReadFrequently:!0});$&&(t=$,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function u(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return i0=parseInt(T.slice(1,2).repeat(2),16),a0=parseInt(T.slice(2,3).repeat(2),16),o0=parseInt(T.slice(3,4).repeat(2),16),im.toColor(i0,a0,o0);case 5:return i0=parseInt(T.slice(1,2).repeat(2),16),a0=parseInt(T.slice(2,3).repeat(2),16),o0=parseInt(T.slice(3,4).repeat(2),16),Uf=parseInt(T.slice(4,5).repeat(2),16),im.toColor(i0,a0,o0,Uf);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}let $=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if($)return i0=parseInt($[1]),a0=parseInt($[2]),o0=parseInt($[3]),Uf=Math.round(($[5]===void 0?1:parseFloat($[5]))*255),im.toColor(i0,a0,o0,Uf);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=T,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[i0,a0,o0,Uf]=t.getImageData(0,0,1,1).data,Uf!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:im.toRgba(i0,a0,o0,Uf),css:T}}e.toColor=u})(CEt||={});var tm;(e=>{function t(u){return r(u>>16&255,u>>8&255,u&255)}e.relativeLuminance=t;function r(u,T,$){let K=u/255,ct=T/255,yt=$/255,St=K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4),Ut=ct<=.03928?ct/12.92:Math.pow((ct+.055)/1.055,2.4),ne=yt<=.03928?yt/12.92:Math.pow((yt+.055)/1.055,2.4);return St*.2126+Ut*.7152+ne*.0722}e.relativeLuminance2=r})(tm||={});var Rx;(e=>{function t(K,ct){if(Uf=(ct&255)/255,Uf===1)return ct;let yt=ct>>24&255,St=ct>>16&255,Ut=ct>>8&255,ne=K>>24&255,pe=K>>16&255,me=K>>8&255;return i0=ne+Math.round((yt-ne)*Uf),a0=pe+Math.round((St-pe)*Uf),o0=me+Math.round((Ut-me)*Uf),im.toRgba(i0,a0,o0)}e.blend=t;function r(K,ct,yt){let St=tm.relativeLuminance(K>>8),Ut=tm.relativeLuminance(ct>>8);if(x1(St,Ut)>8));if(we>8));return we>Ve?me:Ce}return me}let ne=T(K,ct,yt),pe=x1(St,tm.relativeLuminance(ne>>8));if(pe>8));return pe>we?ne:me}return ne}}e.ensureContrastRatio=r;function u(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=x1(tm.relativeLuminance2(pe,me,we),tm.relativeLuminance2(St,Ut,ne));for(;Ce0||me>0||we>0);)pe-=Math.max(0,Math.ceil(pe*.1)),me-=Math.max(0,Math.ceil(me*.1)),we-=Math.max(0,Math.ceil(we*.1)),Ce=x1(tm.relativeLuminance2(pe,me,we),tm.relativeLuminance2(St,Ut,ne));return(pe<<24|me<<16|we<<8|255)>>>0}e.reduceLuminance=u;function T(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=x1(tm.relativeLuminance2(pe,me,we),tm.relativeLuminance2(St,Ut,ne));for(;Ce>>0}e.increaseLuminance=T;function $(K){return[K>>24&255,K>>16&255,K>>8&255,K&255]}e.toChannels=$})(Rx||={});function gx(e){let t=e.toString(16);return t.length<2?"0"+t:t}function x1(e,t){return e=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function PEt(e,t,r,u){return t===1&&r>Math.ceil(u*1.5)&&e!==void 0&&e>255&&!LEt(e)&&!ML(e)&&!MEt(e)}function lW(e){return ML(e)||EEt(e)}function IEt(){return{css:{canvas:uT(),cell:uT()},device:{canvas:uT(),cell:uT(),char:{width:0,height:0,left:0,top:0}}}}function uT(){return{width:0,height:0}}function DEt(e,t,r=0){return(e-(Math.round(t)*2-r))%(Math.round(t)*2)}var _0=0,Qp=0,gv=!1,b1=!1,hT=!1,wm,kM=0,zEt=class{constructor(e,t,r,u,T,$){this._terminal=e,this._optionService=t,this._selectionRenderModel=r,this._decorationService=u,this._coreBrowserService=T,this._themeService=$,this.result={fg:0,bg:0,ext:0}}resolve(e,t,r,u){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,Qp=0,_0=0,b1=!1,gv=!1,hT=!1,wm=this._themeService.colors,kM=0,e.getCode()!==0&&e.extended.underlineStyle===4){let T=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));kM=t*u%(Math.round(T)*2)}if(this._decorationService.forEachDecorationAtCell(t,r,"bottom",T=>{T.backgroundColorRGB&&(Qp=T.backgroundColorRGB.rgba>>8&16777215,b1=!0),T.foregroundColorRGB&&(_0=T.foregroundColorRGB.rgba>>8&16777215,gv=!0)}),hT=this._selectionRenderModel.isCellSelected(this._terminal,t,r),hT){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Qp=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Qp=(this.result.fg&16777215)<<8|255;break;case 0:default:Qp=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Qp=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Qp=(this.result.bg&16777215)<<8|255;break}Qp=Rx.blend(Qp,(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Qp=(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(b1=!0,wm.selectionForeground&&(_0=wm.selectionForeground.rgba>>8&16777215,gv=!0),lW(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)_0=(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:_0=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:_0=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:_0=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:_0=(this.result.fg&16777215)<<8|255;break;case 0:default:_0=this._themeService.colors.foreground.rgba}_0=Rx.blend(_0,(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}gv=!0}}this._decorationService.forEachDecorationAtCell(t,r,"top",T=>{T.backgroundColorRGB&&(Qp=T.backgroundColorRGB.rgba>>8&16777215,b1=!0),T.foregroundColorRGB&&(_0=T.foregroundColorRGB.rgba>>8&16777215,gv=!0)}),b1&&(hT?Qp=e.bg&-16777216&-134217729|Qp|50331648:Qp=e.bg&-16777216|Qp|50331648),gv&&(_0=e.fg&-16777216&-67108865|_0|50331648),this.result.fg&67108864&&(b1&&!gv&&((this.result.bg&50331648)===0?_0=this.result.fg&-134217728|wm.background.rgba>>8&16777215&16777215|50331648:_0=this.result.fg&-134217728|this.result.bg&67108863,gv=!0),!b1&&gv&&((this.result.fg&50331648)===0?Qp=this.result.bg&-67108864|wm.foreground.rgba>>8&16777215&16777215|50331648:Qp=this.result.bg&-67108864|this.result.fg&67108863,b1=!0)),wm=void 0,this.result.bg=b1?Qp:this.result.bg,this.result.fg=gv?_0:this.result.fg,this.result.ext&=536870911,this.result.ext|=kM<<29&3758096384}},OEt=.5,cW=wEt||kEt?"bottom":"ideographic",BEt={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},REt={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},FEt={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},Q5={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Q5[""]=Q5[""];Q5[""]=Q5[""];function NEt(e,t,r,u,T,$,K,ct){let yt=BEt[t];if(yt)return jEt(e,yt,r,u,T,$),!0;let St=REt[t];if(St)return UEt(e,St,r,u,T,$),!0;let Ut=FEt[t];if(Ut)return $Et(e,Ut,r,u,T,$,ct),!0;let ne=Q5[t];return ne?(HEt(e,ne,r,u,T,$,K,ct),!0):!1}function jEt(e,t,r,u,T,$){for(let K=0;K7&&parseInt(ct.slice(7,9),16)||1;else if(ct.startsWith("rgba"))[we,Ce,Ve,kr]=ct.substring(5,ct.length-1).split(",").map(It=>parseFloat(It));else throw new Error(`Unexpected fillStyle color format "${ct}" when drawing pattern glyph`);for(let It=0;Ite.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function hW(e,t,r,u,T,$,K,ct=0,yt=0){let St=e.map(Ut=>parseFloat(Ut)||parseInt(Ut));if(St.length<2)throw new Error("Too few arguments for instruction");for(let Ut=0;UtT){u-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-t))}ms`),this._start();return}u=T}this.clear()}},VEt=class extends dW{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},WEt=class extends dW{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},qEt=!AL&&"requestIdleCallback"in window?WEt:VEt,M2=class fW{constructor(){this.fg=0,this.bg=0,this.extended=new pW}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new fW;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},pW=class mW{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new mW(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},GEt=globalThis.performance&&typeof globalThis.performance.now=="function",ZEt=class gW{static create(t){return new gW(t)}constructor(t){this._now=GEt&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},N1;(e=>{e.None=()=>Ug.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=iW(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new Yd(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new Yd(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new Yd({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new Yd({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new Yd({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new Yd;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new Yd(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof O2?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(N1||={});var uE=class hE{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${hE._idPool++}`,hE.all.add(this)}start(t){this._stopWatch=new ZEt,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};uE.all=new Set,uE._idPool=0;var KEt=uE,YEt=-1,vW=class yW{constructor(t,r,u=(yW._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},vEt=new gEt;function wM(e){yEt(e)||vEt.onUnexpectedError(e)}var lE="Canceled";function yEt(e){return e instanceof _Et?!0:e instanceof Error&&e.name===lE&&e.message===lE}var _Et=class extends Error{constructor(){super(lE),this.name=this.message}},EN=class cE extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof cE)return t;let r=new cE;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},xEt;(e=>{function t($){return $<0}e.isLessThan=t;function r($){return $<=0}e.isLessThanOrEqual=r;function u($){return $>0}e.isGreaterThan=u;function T($){return $===0}e.isNeitherLessOrGreaterThan=T,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(xEt||={});function bEt(e,t){let r=this,u=!1,T;return function(){return u||(u=!0,t||(T=e.apply(r,arguments))),T}}var rW;(e=>{function t(Lr){return Lr&&typeof Lr=="object"&&typeof Lr[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function u(){return r}e.empty=u;function*T(Lr){yield Lr}e.single=T;function $(Lr){return t(Lr)?Lr:T(Lr)}e.wrap=$;function K(Lr){return Lr||r}e.from=K;function*ct(Lr){for(let Mr=Lr.length-1;Mr>=0;Mr--)yield Lr[Mr]}e.reverse=ct;function yt(Lr){return!Lr||Lr[Symbol.iterator]().next().done===!0}e.isEmpty=yt;function St(Lr){return Lr[Symbol.iterator]().next().value}e.first=St;function Ut(Lr,Mr){let tn=0;for(let Dn of Lr)if(Mr(Dn,tn++))return!0;return!1}e.some=Ut;function ne(Lr,Mr){for(let tn of Lr)if(Mr(tn))return tn}e.find=ne;function*pe(Lr,Mr){for(let tn of Lr)Mr(tn)&&(yield tn)}e.filter=pe;function*me(Lr,Mr){let tn=0;for(let Dn of Lr)yield Mr(Dn,tn++)}e.map=me;function*we(Lr,Mr){let tn=0;for(let Dn of Lr)yield*Mr(Dn,tn++)}e.flatMap=we;function*Ce(...Lr){for(let Mr of Lr)yield*Mr}e.concat=Ce;function Ve(Lr,Mr,tn){let Dn=tn;for(let Mn of Lr)Dn=Mr(Dn,Mn);return Dn}e.reduce=Ve;function*kr(Lr,Mr,tn=Lr.length){for(Mr<0&&(Mr+=Lr.length),tn<0?tn+=Lr.length:tn>Lr.length&&(tn=Lr.length);Mr1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function iW(...e){return N0(()=>nW(e))}function N0(e){return{dispose:bEt(()=>{e()})}}var aW=class oW{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{nW(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?oW.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};aW.DISABLE_DISPOSED_WARNING=!1;var O2=aW,Ug=class{constructor(){this._store=new O2,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ug.None=Object.freeze({dispose(){}});var Q3=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},AL=typeof process<"u"&&"title"in process,t8=AL?"node":navigator.userAgent,wEt=AL?"node":navigator.platform,kEt=t8.includes("Firefox"),TEt=t8.includes("Edge"),sW=/^((?!chrome|android).)*safari/i.test(t8);function SEt(){if(!sW)return 0;let e=t8.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}wEt.indexOf("Linux")>=0;var CEt="",i0=0,a0=0,o0=0,Uf=0,fg={css:"#00000000",rgba:0},im;(e=>{function t(T,$,K,ct){return ct!==void 0?`#${gx(T)}${gx($)}${gx(K)}${gx(ct)}`:`#${gx(T)}${gx($)}${gx(K)}`}e.toCss=t;function r(T,$,K,ct=255){return(T<<24|$<<16|K<<8|ct)>>>0}e.toRgba=r;function u(T,$,K,ct){return{css:e.toCss(T,$,K,ct),rgba:e.toRgba(T,$,K,ct)}}e.toColor=u})(im||={});var m5;(e=>{function t(yt,St){if(Uf=(St.rgba&255)/255,Uf===1)return{css:St.css,rgba:St.rgba};let Ut=St.rgba>>24&255,ne=St.rgba>>16&255,pe=St.rgba>>8&255,me=yt.rgba>>24&255,we=yt.rgba>>16&255,Ce=yt.rgba>>8&255;i0=me+Math.round((Ut-me)*Uf),a0=we+Math.round((ne-we)*Uf),o0=Ce+Math.round((pe-Ce)*Uf);let Ve=im.toCss(i0,a0,o0),kr=im.toRgba(i0,a0,o0);return{css:Ve,rgba:kr}}e.blend=t;function r(yt){return(yt.rgba&255)===255}e.isOpaque=r;function u(yt,St,Ut){let ne=Fx.ensureContrastRatio(yt.rgba,St.rgba,Ut);if(ne)return im.toColor(ne>>24&255,ne>>16&255,ne>>8&255)}e.ensureContrastRatio=u;function T(yt){let St=(yt.rgba|255)>>>0;return[i0,a0,o0]=Fx.toChannels(St),{css:im.toCss(i0,a0,o0),rgba:St}}e.opaque=T;function $(yt,St){return Uf=Math.round(St*255),[i0,a0,o0]=Fx.toChannels(yt.rgba),{css:im.toCss(i0,a0,o0,Uf),rgba:im.toRgba(i0,a0,o0,Uf)}}e.opacity=$;function K(yt,St){return Uf=yt.rgba&255,$(yt,Uf*St/255)}e.multiplyOpacity=K;function ct(yt){return[yt.rgba>>24&255,yt.rgba>>16&255,yt.rgba>>8&255]}e.toColorRGB=ct})(m5||={});var AEt;(e=>{let t,r;try{let T=document.createElement("canvas");T.width=1,T.height=1;let $=T.getContext("2d",{willReadFrequently:!0});$&&(t=$,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function u(T){if(T.match(/#[\da-f]{3,8}/i))switch(T.length){case 4:return i0=parseInt(T.slice(1,2).repeat(2),16),a0=parseInt(T.slice(2,3).repeat(2),16),o0=parseInt(T.slice(3,4).repeat(2),16),im.toColor(i0,a0,o0);case 5:return i0=parseInt(T.slice(1,2).repeat(2),16),a0=parseInt(T.slice(2,3).repeat(2),16),o0=parseInt(T.slice(3,4).repeat(2),16),Uf=parseInt(T.slice(4,5).repeat(2),16),im.toColor(i0,a0,o0,Uf);case 7:return{css:T,rgba:(parseInt(T.slice(1),16)<<8|255)>>>0};case 9:return{css:T,rgba:parseInt(T.slice(1),16)>>>0}}let $=T.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if($)return i0=parseInt($[1]),a0=parseInt($[2]),o0=parseInt($[3]),Uf=Math.round(($[5]===void 0?1:parseFloat($[5]))*255),im.toColor(i0,a0,o0,Uf);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=T,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[i0,a0,o0,Uf]=t.getImageData(0,0,1,1).data,Uf!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:im.toRgba(i0,a0,o0,Uf),css:T}}e.toColor=u})(AEt||={});var tm;(e=>{function t(u){return r(u>>16&255,u>>8&255,u&255)}e.relativeLuminance=t;function r(u,T,$){let K=u/255,ct=T/255,yt=$/255,St=K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4),Ut=ct<=.03928?ct/12.92:Math.pow((ct+.055)/1.055,2.4),ne=yt<=.03928?yt/12.92:Math.pow((yt+.055)/1.055,2.4);return St*.2126+Ut*.7152+ne*.0722}e.relativeLuminance2=r})(tm||={});var Fx;(e=>{function t(K,ct){if(Uf=(ct&255)/255,Uf===1)return ct;let yt=ct>>24&255,St=ct>>16&255,Ut=ct>>8&255,ne=K>>24&255,pe=K>>16&255,me=K>>8&255;return i0=ne+Math.round((yt-ne)*Uf),a0=pe+Math.round((St-pe)*Uf),o0=me+Math.round((Ut-me)*Uf),im.toRgba(i0,a0,o0)}e.blend=t;function r(K,ct,yt){let St=tm.relativeLuminance(K>>8),Ut=tm.relativeLuminance(ct>>8);if(x1(St,Ut)>8));if(we>8));return we>Ve?me:Ce}return me}let ne=T(K,ct,yt),pe=x1(St,tm.relativeLuminance(ne>>8));if(pe>8));return pe>we?ne:me}return ne}}e.ensureContrastRatio=r;function u(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=x1(tm.relativeLuminance2(pe,me,we),tm.relativeLuminance2(St,Ut,ne));for(;Ce0||me>0||we>0);)pe-=Math.max(0,Math.ceil(pe*.1)),me-=Math.max(0,Math.ceil(me*.1)),we-=Math.max(0,Math.ceil(we*.1)),Ce=x1(tm.relativeLuminance2(pe,me,we),tm.relativeLuminance2(St,Ut,ne));return(pe<<24|me<<16|we<<8|255)>>>0}e.reduceLuminance=u;function T(K,ct,yt){let St=K>>24&255,Ut=K>>16&255,ne=K>>8&255,pe=ct>>24&255,me=ct>>16&255,we=ct>>8&255,Ce=x1(tm.relativeLuminance2(pe,me,we),tm.relativeLuminance2(St,Ut,ne));for(;Ce>>0}e.increaseLuminance=T;function $(K){return[K>>24&255,K>>16&255,K>>8&255,K&255]}e.toChannels=$})(Fx||={});function gx(e){let t=e.toString(16);return t.length<2?"0"+t:t}function x1(e,t){return e=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function IEt(e,t,r,u){return t===1&&r>Math.ceil(u*1.5)&&e!==void 0&&e>255&&!PEt(e)&&!ML(e)&&!EEt(e)}function lW(e){return ML(e)||LEt(e)}function DEt(){return{css:{canvas:uT(),cell:uT()},device:{canvas:uT(),cell:uT(),char:{width:0,height:0,left:0,top:0}}}}function uT(){return{width:0,height:0}}function zEt(e,t,r=0){return(e-(Math.round(t)*2-r))%(Math.round(t)*2)}var _0=0,Qp=0,gv=!1,b1=!1,hT=!1,wm,kM=0,OEt=class{constructor(e,t,r,u,T,$){this._terminal=e,this._optionService=t,this._selectionRenderModel=r,this._decorationService=u,this._coreBrowserService=T,this._themeService=$,this.result={fg:0,bg:0,ext:0}}resolve(e,t,r,u){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,Qp=0,_0=0,b1=!1,gv=!1,hT=!1,wm=this._themeService.colors,kM=0,e.getCode()!==0&&e.extended.underlineStyle===4){let T=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));kM=t*u%(Math.round(T)*2)}if(this._decorationService.forEachDecorationAtCell(t,r,"bottom",T=>{T.backgroundColorRGB&&(Qp=T.backgroundColorRGB.rgba>>8&16777215,b1=!0),T.foregroundColorRGB&&(_0=T.foregroundColorRGB.rgba>>8&16777215,gv=!0)}),hT=this._selectionRenderModel.isCellSelected(this._terminal,t,r),hT){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Qp=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Qp=(this.result.fg&16777215)<<8|255;break;case 0:default:Qp=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Qp=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Qp=(this.result.bg&16777215)<<8|255;break}Qp=Fx.blend(Qp,(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Qp=(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(b1=!0,wm.selectionForeground&&(_0=wm.selectionForeground.rgba>>8&16777215,gv=!0),lW(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)_0=(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:_0=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:_0=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:_0=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:_0=(this.result.fg&16777215)<<8|255;break;case 0:default:_0=this._themeService.colors.foreground.rgba}_0=Fx.blend(_0,(this._coreBrowserService.isFocused?wm.selectionBackgroundOpaque:wm.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}gv=!0}}this._decorationService.forEachDecorationAtCell(t,r,"top",T=>{T.backgroundColorRGB&&(Qp=T.backgroundColorRGB.rgba>>8&16777215,b1=!0),T.foregroundColorRGB&&(_0=T.foregroundColorRGB.rgba>>8&16777215,gv=!0)}),b1&&(hT?Qp=e.bg&-16777216&-134217729|Qp|50331648:Qp=e.bg&-16777216|Qp|50331648),gv&&(_0=e.fg&-16777216&-67108865|_0|50331648),this.result.fg&67108864&&(b1&&!gv&&((this.result.bg&50331648)===0?_0=this.result.fg&-134217728|wm.background.rgba>>8&16777215&16777215|50331648:_0=this.result.fg&-134217728|this.result.bg&67108863,gv=!0),!b1&&gv&&((this.result.fg&50331648)===0?Qp=this.result.bg&-67108864|wm.foreground.rgba>>8&16777215&16777215|50331648:Qp=this.result.bg&-67108864|this.result.fg&67108863,b1=!0)),wm=void 0,this.result.bg=b1?Qp:this.result.bg,this.result.fg=gv?_0:this.result.fg,this.result.ext&=536870911,this.result.ext|=kM<<29&3758096384}},BEt=.5,cW=kEt||TEt?"bottom":"ideographic",REt={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},FEt={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},NEt={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},Q5={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Q5[""]=Q5[""];Q5[""]=Q5[""];function jEt(e,t,r,u,T,$,K,ct){let yt=REt[t];if(yt)return UEt(e,yt,r,u,T,$),!0;let St=FEt[t];if(St)return $Et(e,St,r,u,T,$),!0;let Ut=NEt[t];if(Ut)return HEt(e,Ut,r,u,T,$,ct),!0;let ne=Q5[t];return ne?(VEt(e,ne,r,u,T,$,K,ct),!0):!1}function UEt(e,t,r,u,T,$){for(let K=0;K7&&parseInt(ct.slice(7,9),16)||1;else if(ct.startsWith("rgba"))[we,Ce,Ve,kr]=ct.substring(5,ct.length-1).split(",").map(It=>parseFloat(It));else throw new Error(`Unexpected fillStyle color format "${ct}" when drawing pattern glyph`);for(let It=0;Ite.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function hW(e,t,r,u,T,$,K,ct=0,yt=0){let St=e.map(Ut=>parseFloat(Ut)||parseInt(Ut));if(St.length<2)throw new Error("Too few arguments for instruction");for(let Ut=0;UtT){u-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-t))}ms`),this._start();return}u=T}this.clear()}},WEt=class extends dW{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},qEt=class extends dW{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},GEt=!AL&&"requestIdleCallback"in window?qEt:WEt,M2=class fW{constructor(){this.fg=0,this.bg=0,this.extended=new pW}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new fW;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},pW=class mW{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new mW(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ZEt=globalThis.performance&&typeof globalThis.performance.now=="function",KEt=class gW{static create(t){return new gW(t)}constructor(t){this._now=ZEt&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},N1;(e=>{e.None=()=>Ug.None;function t(pr,_r){return ne(pr,()=>{},0,void 0,!0,void 0,_r)}e.defer=t;function r(pr){return(_r,Sr=null,Dr)=>{let nn=!1,Cn;return Cn=pr(Xn=>{if(!nn)return Cn?Cn.dispose():nn=!0,_r.call(Sr,Xn)},null,Dr),nn&&Cn.dispose(),Cn}}e.once=r;function u(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>Dr.call(nn,_r(Xn)),null,Cn),Sr)}e.map=u;function T(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>{_r(Xn),Dr.call(nn,Xn)},null,Cn),Sr)}e.forEach=T;function $(pr,_r,Sr){return St((Dr,nn=null,Cn)=>pr(Xn=>_r(Xn)&&Dr.call(nn,Xn),null,Cn),Sr)}e.filter=$;function K(pr){return pr}e.signal=K;function ct(...pr){return(_r,Sr=null,Dr)=>{let nn=iW(...pr.map(Cn=>Cn(Xn=>_r.call(Sr,Xn))));return Ut(nn,Dr)}}e.any=ct;function yt(pr,_r,Sr,Dr){let nn=Sr;return u(pr,Cn=>(nn=_r(nn,Cn),nn),Dr)}e.reduce=yt;function St(pr,_r){let Sr,Dr={onWillAddFirstListener(){Sr=pr(nn.fire,nn)},onDidRemoveLastListener(){Sr?.dispose()}},nn=new Yd(Dr);return _r?.add(nn),nn.event}function Ut(pr,_r){return _r instanceof Array?_r.push(pr):_r&&_r.add(pr),pr}function ne(pr,_r,Sr=100,Dr=!1,nn=!1,Cn,Xn){let _i,ta,va,_a=0,qi,Bi={leakWarningThreshold:Cn,onWillAddFirstListener(){_i=pr(Yn=>{_a++,ta=_r(ta,Yn),Dr&&!va&&(Xi.fire(ta),ta=void 0),qi=()=>{let hi=ta;ta=void 0,va=void 0,(!Dr||_a>1)&&Xi.fire(hi),_a=0},typeof Sr=="number"?(clearTimeout(va),va=setTimeout(qi,Sr)):va===void 0&&(va=0,queueMicrotask(qi))})},onWillRemoveListener(){nn&&_a>0&&qi?.()},onDidRemoveLastListener(){qi=void 0,_i.dispose()}},Xi=new Yd(Bi);return Xn?.add(Xi),Xi.event}e.debounce=ne;function pe(pr,_r=0,Sr){return e.debounce(pr,(Dr,nn)=>Dr?(Dr.push(nn),Dr):[nn],_r,void 0,!0,void 0,Sr)}e.accumulate=pe;function me(pr,_r=(Dr,nn)=>Dr===nn,Sr){let Dr=!0,nn;return $(pr,Cn=>{let Xn=Dr||!_r(Cn,nn);return Dr=!1,nn=Cn,Xn},Sr)}e.latch=me;function we(pr,_r,Sr){return[e.filter(pr,_r,Sr),e.filter(pr,Dr=>!_r(Dr),Sr)]}e.split=we;function Ce(pr,_r=!1,Sr=[],Dr){let nn=Sr.slice(),Cn=pr(ta=>{nn?nn.push(ta):_i.fire(ta)});Dr&&Dr.add(Cn);let Xn=()=>{nn?.forEach(ta=>_i.fire(ta)),nn=null},_i=new Yd({onWillAddFirstListener(){Cn||(Cn=pr(ta=>_i.fire(ta)),Dr&&Dr.add(Cn))},onDidAddFirstListener(){nn&&(_r?setTimeout(Xn):Xn())},onDidRemoveLastListener(){Cn&&Cn.dispose(),Cn=null}});return Dr&&Dr.add(_i),_i.event}e.buffer=Ce;function Ve(pr,_r){return(Sr,Dr,nn)=>{let Cn=_r(new It);return pr(function(Xn){let _i=Cn.evaluate(Xn);_i!==kr&&Sr.call(Dr,_i)},void 0,nn)}}e.chain=Ve;let kr=Symbol("HaltChainable");class It{constructor(){this.steps=[]}map(_r){return this.steps.push(_r),this}forEach(_r){return this.steps.push(Sr=>(_r(Sr),Sr)),this}filter(_r){return this.steps.push(Sr=>_r(Sr)?Sr:kr),this}reduce(_r,Sr){let Dr=Sr;return this.steps.push(nn=>(Dr=_r(Dr,nn),Dr)),this}latch(_r=(Sr,Dr)=>Sr===Dr){let Sr=!0,Dr;return this.steps.push(nn=>{let Cn=Sr||!_r(nn,Dr);return Sr=!1,Dr=nn,Cn?nn:kr}),this}evaluate(_r){for(let Sr of this.steps)if(_r=Sr(_r),_r===kr)break;return _r}}function rn(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.on(_r,Dr),Cn=()=>pr.removeListener(_r,Dr),Xn=new Yd({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromNodeEventEmitter=rn;function Lr(pr,_r,Sr=Dr=>Dr){let Dr=(..._i)=>Xn.fire(Sr(..._i)),nn=()=>pr.addEventListener(_r,Dr),Cn=()=>pr.removeEventListener(_r,Dr),Xn=new Yd({onWillAddFirstListener:nn,onDidRemoveLastListener:Cn});return Xn.event}e.fromDOMEventEmitter=Lr;function Mr(pr){return new Promise(_r=>r(pr)(_r))}e.toPromise=Mr;function tn(pr){let _r=new Yd;return pr.then(Sr=>{_r.fire(Sr)},()=>{_r.fire(void 0)}).finally(()=>{_r.dispose()}),_r.event}e.fromPromise=tn;function Dn(pr,_r){return pr(Sr=>_r.fire(Sr))}e.forward=Dn;function Mn(pr,_r,Sr){return _r(Sr),pr(Dr=>_r(Dr))}e.runAndSubscribe=Mn;class Br{constructor(_r,Sr){this._observable=_r,this._counter=0,this._hasChanged=!1;let Dr={onWillAddFirstListener:()=>{_r.addObserver(this)},onDidRemoveLastListener:()=>{_r.removeObserver(this)}};this.emitter=new Yd(Dr),Sr&&Sr.add(this.emitter)}beginUpdate(_r){this._counter++}handlePossibleChange(_r){}handleChange(_r,Sr){this._hasChanged=!0}endUpdate(_r){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Vn(pr,_r){return new Br(pr,_r).emitter.event}e.fromObservable=Vn;function on(pr){return(_r,Sr,Dr)=>{let nn=0,Cn=!1,Xn={beginUpdate(){nn++},endUpdate(){nn--,nn===0&&(pr.reportChanges(),Cn&&(Cn=!1,_r.call(Sr)))},handlePossibleChange(){},handleChange(){Cn=!0}};pr.addObserver(Xn),pr.reportChanges();let _i={dispose(){pr.removeObserver(Xn)}};return Dr instanceof O2?Dr.add(_i):Array.isArray(Dr)&&Dr.push(_i),_i}}e.fromObservableLight=on})(N1||={});var uE=class hE{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${hE._idPool++}`,hE.all.add(this)}start(t){this._stopWatch=new KEt,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};uE.all=new Set,uE._idPool=0;var YEt=uE,XEt=-1,vW=class yW{constructor(t,r,u=(yW._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=u,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let u=this.threshold;if(u<=0||r{let $=this._stacks.get(t.value)||0;this._stacks.set(t.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[u,T]of this._stacks)(!t||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let K=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(K);let ct=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],yt=new tLt(`${K}. HINT: Stack shows most frequent listener (${ct[1]}-times)`,ct[0]);return(this._options?.onListenerError||wM)(yt),Ug.None}if(this._disposed)return Ug.None;t&&(e=e.bind(t));let u=new TM(e),T;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=JEt.create(),T=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof TM?(this._deliveryQueue??=new iLt,this._listeners=[this._listeners,u]):this._listeners.push(u):(this._options?.onWillAddFirstListener?.(this),this._listeners=u,this._options?.onDidAddFirstListener?.(this)),this._size++;let $=N0(()=>{T?.(),this._removeListener(u)});return r instanceof O2?r.add($):Array.isArray(r)&&r.push($),$},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[r]=void 0;let u=this._deliveryQueue.current===this;if(this._size*rLt<=t.length){let T=0;for(let $=0;$0}},iLt=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},zN={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},t5=2,e5,Jy=class T2{constructor(t,r,u){this._document=t,this._config=r,this._unicodeService=u,this._didWarmUp=!1,this._cacheMap=new DN,this._cacheMapCombined=new DN,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new M2,this._textureSize=512,this._onAddTextureAtlasCanvas=new Yd,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Yd,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=xW(t,this._config.deviceCellWidth*4+t5*2,this._config.deviceCellHeight+t5*2),this._tmpCtx=wp(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let t of this.pages)t.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let t=new qEt;for(let r=33;r<126;r++)t.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let u=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,u)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let t of this._pages)t.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(T2.maxAtlasPages&&this._pages.length>=Math.max(4,T2.maxAtlasPages)){let r=this._pages.filter(St=>St.canvas.width*2<=(T2.maxTextureSize||4096)).sort((St,Ut)=>Ut.canvas.width!==St.canvas.width?Ut.canvas.width-St.canvas.width:Ut.percentageUsed-St.percentageUsed),u=-1,T=0;for(let St=0;StSt.glyphs[0].texturePage).sort((St,Ut)=>St>Ut?1:-1),ct=this.pages.length-$.length,yt=this._mergePages($,ct);yt.version++;for(let St=K.length-1;St>=0;St--)this._deletePage(K[St]);this.pages.push(yt),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(yt.canvas)}let t=new SM(this._document,this._textureSize);return this._pages.push(t),this._activePages.push(t),this._onAddTextureAtlasCanvas.fire(t.canvas),t}_mergePages(t,r){let u=t[0].canvas.width*2,T=new SM(this._document,u,t);for(let[$,K]of t.entries()){let ct=$*K.canvas.width%u,yt=Math.floor($/2)*K.canvas.height;T.ctx.drawImage(K.canvas,ct,yt);for(let Ut of K.glyphs)Ut.texturePage=r,Ut.sizeClipSpace.x=Ut.size.x/u,Ut.sizeClipSpace.y=Ut.size.y/u,Ut.texturePosition.x+=ct,Ut.texturePosition.y+=yt,Ut.texturePositionClipSpace.x=Ut.texturePosition.x/u,Ut.texturePositionClipSpace.y=Ut.texturePosition.y/u;this._onRemoveTextureAtlasCanvas.fire(K.canvas);let St=this._activePages.indexOf(K);St!==-1&&this._activePages.splice(St,1)}return T}_deletePage(t){this._pages.splice(t,1);for(let r=t;r=this._config.colors.ansi.length)throw new Error("No color found for idx "+t);return this._config.colors.ansi[t]}_getBackgroundColor(t,r,u,T){if(this._config.allowTransparency)return fg;let $;switch(t){case 16777216:case 33554432:$=this._getColorFromAnsiIndex(r);break;case 50331648:let K=M2.toColorRGB(r);$=im.toColor(K[0],K[1],K[2]);break;case 0:default:u?$=m5.opaque(this._config.colors.foreground):$=this._config.colors.background;break}return this._config.allowTransparency||($=m5.opaque($)),$}_getForegroundColor(t,r,u,T,$,K,ct,yt,St,Ut){let ne=this._getMinimumContrastColor(t,r,u,T,$,K,ct,St,yt,Ut);if(ne)return ne;let pe;switch($){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&St&&K<8&&(K+=8),pe=this._getColorFromAnsiIndex(K);break;case 50331648:let me=M2.toColorRGB(K);pe=im.toColor(me[0],me[1],me[2]);break;case 0:default:ct?pe=this._config.colors.background:pe=this._config.colors.foreground}return this._config.allowTransparency&&(pe=m5.opaque(pe)),yt&&(pe=m5.multiplyOpacity(pe,OEt)),pe}_resolveBackgroundRgba(t,r,u){switch(t){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return u?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(t,r,u,T){switch(t){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&T&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return u?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(t,r,u,T,$,K,ct,yt,St,Ut){if(this._config.minimumContrastRatio===1||Ut)return;let ne=this._getContrastCache(St),pe=ne.getColor(t,T);if(pe!==void 0)return pe||void 0;let me=this._resolveBackgroundRgba(r,u,ct),we=this._resolveForegroundRgba($,K,ct,yt),Ce=Rx.ensureContrastRatio(me,we,this._config.minimumContrastRatio/(St?2:1));if(!Ce){ne.setColor(t,T,null);return}let Ve=im.toColor(Ce>>24&255,Ce>>16&255,Ce>>8&255);return ne.setColor(t,T,Ve),Ve}_getContrastCache(t){return t?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(t,r,u,T,$,K){let ct=typeof t=="number"?String.fromCharCode(t):t;K&&this._tmpCanvas.parentElement!==K&&(this._tmpCanvas.style.display="none",K.append(this._tmpCanvas));let yt=Math.min(this._config.deviceCellWidth*Math.max(ct.length,2)+t5*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width=ta?ta*2-Yn:ta-Yn;Yn>=ta||Hn===0?(this._tmpCtx.setLineDash([Math.round(ta),Math.round(ta)]),this._tmpCtx.moveTo(aa+Hn,qi),this._tmpCtx.lineTo(io,qi)):(this._tmpCtx.setLineDash([Math.round(ta),Math.round(ta)]),this._tmpCtx.moveTo(aa,qi),this._tmpCtx.lineTo(aa+Hn,qi),this._tmpCtx.moveTo(aa+Hn+ta,qi),this._tmpCtx.lineTo(io,qi)),Yn=DEt(io-aa,ta,Yn);break;case 5:let Qa=.6,Ha=.3,qa=io-aa,Mo=Math.floor(Qa*qa),Wo=Math.floor(Ha*qa),es=qa-Mo-Wo;this._tmpCtx.setLineDash([Mo,Wo,es]),this._tmpCtx.moveTo(aa,qi),this._tmpCtx.lineTo(io,qi);break;case 1:default:this._tmpCtx.moveTo(aa,qi),this._tmpCtx.lineTo(io,qi);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!pr&&this._config.fontSize>=12&&!this._config.allowTransparency&&ct!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let hi=this._tmpCtx.measureText(ct);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in hi&&hi.actualBoundingBoxDescent>0){this._tmpCtx.save();let aa=new Path2D;aa.rect(_a,qi-Math.ceil(ta/2),this._config.deviceCellWidth*Sr,Xi-qi+Math.ceil(ta/2)),this._tmpCtx.clip(aa),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=Mr.css,this._tmpCtx.strokeText(ct,on,on+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Ve){let ta=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),va=ta%2===1?.5:0;this._tmpCtx.lineWidth=ta,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(on,on+va),this._tmpCtx.lineTo(on+this._config.deviceCharWidth*Sr,on+va),this._tmpCtx.stroke()}if(pr||this._tmpCtx.fillText(ct,on,on+this._config.deviceCharHeight),ct==="_"&&!this._config.allowTransparency){let ta=CM(this._tmpCtx.getImageData(on,on,this._config.deviceCellWidth,this._config.deviceCellHeight),Mr,Vn,_r);if(ta)for(let va=1;va<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=Mr.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(ct,on,on+this._config.deviceCharHeight-va),ta=CM(this._tmpCtx.getImageData(on,on,this._config.deviceCellWidth,this._config.deviceCellHeight),Mr,Vn,_r),!!ta);va++);}if(Ce){let ta=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),va=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=ta,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(on,on+Math.floor(this._config.deviceCharHeight/2)-va),this._tmpCtx.lineTo(on+this._config.deviceCharWidth*Sr,on+Math.floor(this._config.deviceCharHeight/2)-va),this._tmpCtx.stroke()}this._tmpCtx.restore();let Dr=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),nn;if(this._config.allowTransparency?nn=aLt(Dr):nn=CM(Dr,Mr,Vn,_r),nn)return zN;let Cn=this._findGlyphBoundingBox(Dr,this._workBoundingBox,yt,Br,pr,on),Xn,_i;for(;;){if(this._activePages.length===0){let ta=this._createNewPage();Xn=ta,_i=ta.currentRow,_i.height=Cn.size.y;break}Xn=this._activePages[this._activePages.length-1],_i=Xn.currentRow;for(let ta of this._activePages)Cn.size.y<=ta.currentRow.height&&(Xn=ta,_i=ta.currentRow);for(let ta=this._activePages.length-1;ta>=0;ta--)for(let va of this._activePages[ta].fixedRows)va.height<=_i.height&&Cn.size.y<=va.height&&(Xn=this._activePages[ta],_i=va);if(Cn.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new SM(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Xn=this._overflowSizePage,_i=this._overflowSizePage.currentRow,_i.x+Cn.size.x>=Xn.canvas.width&&(_i.x=0,_i.y+=_i.height,_i.height=0);break}if(_i.y+Cn.size.y>=Xn.canvas.height||_i.height>Cn.size.y+2){let ta=!1;if(Xn.currentRow.y+Xn.currentRow.height+Cn.size.y>=Xn.canvas.height){let va;for(let _a of this._activePages)if(_a.currentRow.y+_a.currentRow.height+Cn.size.y<_a.canvas.height){va=_a;break}if(va)Xn=va;else if(T2.maxAtlasPages&&this._pages.length>=T2.maxAtlasPages&&_i.y+Cn.size.y<=Xn.canvas.height&&_i.height>=Cn.size.y&&_i.x+Cn.size.x<=Xn.canvas.width)ta=!0;else{let _a=this._createNewPage();Xn=_a,_i=_a.currentRow,_i.height=Cn.size.y,ta=!0}}ta||(Xn.currentRow.height>0&&Xn.fixedRows.push(Xn.currentRow),_i={x:0,y:Xn.currentRow.y+Xn.currentRow.height,height:Cn.size.y},Xn.fixedRows.push(_i),Xn.currentRow={x:0,y:_i.y+_i.height,height:0})}if(_i.x+Cn.size.x<=Xn.canvas.width)break;_i===Xn.currentRow?(_i.x=0,_i.y+=_i.height,_i.height=0):Xn.fixedRows.splice(Xn.fixedRows.indexOf(_i),1)}return Cn.texturePage=this._pages.indexOf(Xn),Cn.texturePosition.x=_i.x,Cn.texturePosition.y=_i.y,Cn.texturePositionClipSpace.x=_i.x/Xn.canvas.width,Cn.texturePositionClipSpace.y=_i.y/Xn.canvas.height,Cn.sizeClipSpace.x/=Xn.canvas.width,Cn.sizeClipSpace.y/=Xn.canvas.height,_i.height=Math.max(_i.height,Cn.size.y),_i.x+=Cn.size.x,Xn.ctx.putImageData(Dr,Cn.texturePosition.x-this._workBoundingBox.left,Cn.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Cn.size.x,Cn.size.y),Xn.addGlyph(Cn),Xn.version++,Cn}_findGlyphBoundingBox(t,r,u,T,$,K){r.top=0;let ct=T?this._config.deviceCellHeight:this._tmpCanvas.height,yt=T?this._config.deviceCellWidth:u,St=!1;for(let Ut=0;Ut=K;Ut--){for(let ne=0;ne=0;Ut--){for(let ne=0;ne>>24,$=t.rgba>>>16&255,K=t.rgba>>>8&255,ct=r.rgba>>>24,yt=r.rgba>>>16&255,St=r.rgba>>>8&255,Ut=Math.floor((Math.abs(T-ct)+Math.abs($-yt)+Math.abs(K-St))/12),ne=!0;for(let pe=0;pe0)return!1;return!0}function xW(e,t,r){let u=e.createElement("canvas");return u.width=t,u.height=r,u}function oLt(e,t,r,u,T,$,K,ct){let yt={foreground:$.foreground,background:$.background,cursor:fg,cursorAccent:fg,selectionForeground:fg,selectionBackgroundTransparent:fg,selectionBackgroundOpaque:fg,selectionInactiveBackgroundTransparent:fg,selectionInactiveBackgroundOpaque:fg,overviewRulerBorder:fg,scrollbarSliderBackground:fg,scrollbarSliderHoverBackground:fg,scrollbarSliderActiveBackground:fg,ansi:$.ansi.slice(),contrastCache:$.contrastCache,halfContrastCache:$.halfContrastCache};return{customGlyphs:T.customGlyphs,devicePixelRatio:K,deviceMaxTextureSize:ct,letterSpacing:T.letterSpacing,lineHeight:T.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:r,deviceCharHeight:u,fontFamily:T.fontFamily,fontSize:T.fontSize,fontWeight:T.fontWeight,fontWeightBold:T.fontWeightBold,allowTransparency:T.allowTransparency,drawBoldTextInBrightColors:T.drawBoldTextInBrightColors,minimumContrastRatio:T.minimumContrastRatio,colors:yt}}function ON(e,t){for(let r=0;r=0){if(ON(me.config,St))return me.atlas;me.ownedBy.length===1?(me.atlas.dispose(),gg.splice(pe,1)):me.ownedBy.splice(we,1);break}}for(let pe=0;pe{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=dT){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let t=dT-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0){this._restartInterval(t);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let t=dT-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(t);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},dT)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function RN(e,t,r){let u=new t.ResizeObserver(T=>{let $=T.find(yt=>yt.target===e);if(!$)return;if(!("devicePixelContentBoxSize"in $)){u?.disconnect(),u=void 0;return}let K=$.devicePixelContentBoxSize[0].inlineSize,ct=$.devicePixelContentBoxSize[0].blockSize;K>0&&ct>0&&r(K,ct)});try{u.observe(e,{box:["device-pixel-content-box"]})}catch{u.disconnect(),u=void 0}return N0(()=>u?.disconnect())}function cLt(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var FN=class wW extends M2{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new pW,this.combinedData=""}static fromCharData(t){let r=new wW;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?cLt(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let u=t[1].charCodeAt(0);if(55296<=u&&u<=56319){let T=t[1].charCodeAt(1);56320<=T&&T<=57343?this.content=(u-55296)*1024+T-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},kW=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function TW(e,t,r){let u=wp(e.createProgram());if(e.attachShader(u,wp(NN(e,e.VERTEX_SHADER,t))),e.attachShader(u,wp(NN(e,e.FRAGMENT_SHADER,r))),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS))return u;console.error(e.getProgramInfoLog(u)),e.deleteProgram(u)}function NN(e,t,r){let u=wp(e.createShader(t));if(e.shaderSource(u,r),e.compileShader(u),e.getShaderParameter(u,e.COMPILE_STATUS))return u;console.error(e.getShaderInfoLog(u)),e.deleteShader(u)}function uLt(e,t){let r=Math.min(e.length*2,t),u=new Float32Array(r);for(let T=0;T{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let K=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(K);let ct=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],yt=new eLt(`${K}. HINT: Stack shows most frequent listener (${ct[1]}-times)`,ct[0]);return(this._options?.onListenerError||wM)(yt),Ug.None}if(this._disposed)return Ug.None;t&&(e=e.bind(t));let u=new TM(e),T;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=QEt.create(),T=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof TM?(this._deliveryQueue??=new aLt,this._listeners=[this._listeners,u]):this._listeners.push(u):(this._options?.onWillAddFirstListener?.(this),this._listeners=u,this._options?.onDidAddFirstListener?.(this)),this._size++;let $=N0(()=>{T?.(),this._removeListener(u)});return r instanceof O2?r.add($):Array.isArray(r)&&r.push($),$},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[r]=void 0;let u=this._deliveryQueue.current===this;if(this._size*nLt<=t.length){let T=0;for(let $=0;$0}},aLt=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},zN={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},t5=2,e5,Jy=class S2{constructor(t,r,u){this._document=t,this._config=r,this._unicodeService=u,this._didWarmUp=!1,this._cacheMap=new DN,this._cacheMapCombined=new DN,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new M2,this._textureSize=512,this._onAddTextureAtlasCanvas=new Yd,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Yd,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=xW(t,this._config.deviceCellWidth*4+t5*2,this._config.deviceCellHeight+t5*2),this._tmpCtx=wp(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let t of this.pages)t.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let t=new GEt;for(let r=33;r<126;r++)t.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let u=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,u)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let t of this._pages)t.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S2.maxAtlasPages&&this._pages.length>=Math.max(4,S2.maxAtlasPages)){let r=this._pages.filter(St=>St.canvas.width*2<=(S2.maxTextureSize||4096)).sort((St,Ut)=>Ut.canvas.width!==St.canvas.width?Ut.canvas.width-St.canvas.width:Ut.percentageUsed-St.percentageUsed),u=-1,T=0;for(let St=0;StSt.glyphs[0].texturePage).sort((St,Ut)=>St>Ut?1:-1),ct=this.pages.length-$.length,yt=this._mergePages($,ct);yt.version++;for(let St=K.length-1;St>=0;St--)this._deletePage(K[St]);this.pages.push(yt),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(yt.canvas)}let t=new SM(this._document,this._textureSize);return this._pages.push(t),this._activePages.push(t),this._onAddTextureAtlasCanvas.fire(t.canvas),t}_mergePages(t,r){let u=t[0].canvas.width*2,T=new SM(this._document,u,t);for(let[$,K]of t.entries()){let ct=$*K.canvas.width%u,yt=Math.floor($/2)*K.canvas.height;T.ctx.drawImage(K.canvas,ct,yt);for(let Ut of K.glyphs)Ut.texturePage=r,Ut.sizeClipSpace.x=Ut.size.x/u,Ut.sizeClipSpace.y=Ut.size.y/u,Ut.texturePosition.x+=ct,Ut.texturePosition.y+=yt,Ut.texturePositionClipSpace.x=Ut.texturePosition.x/u,Ut.texturePositionClipSpace.y=Ut.texturePosition.y/u;this._onRemoveTextureAtlasCanvas.fire(K.canvas);let St=this._activePages.indexOf(K);St!==-1&&this._activePages.splice(St,1)}return T}_deletePage(t){this._pages.splice(t,1);for(let r=t;r=this._config.colors.ansi.length)throw new Error("No color found for idx "+t);return this._config.colors.ansi[t]}_getBackgroundColor(t,r,u,T){if(this._config.allowTransparency)return fg;let $;switch(t){case 16777216:case 33554432:$=this._getColorFromAnsiIndex(r);break;case 50331648:let K=M2.toColorRGB(r);$=im.toColor(K[0],K[1],K[2]);break;case 0:default:u?$=m5.opaque(this._config.colors.foreground):$=this._config.colors.background;break}return this._config.allowTransparency||($=m5.opaque($)),$}_getForegroundColor(t,r,u,T,$,K,ct,yt,St,Ut){let ne=this._getMinimumContrastColor(t,r,u,T,$,K,ct,St,yt,Ut);if(ne)return ne;let pe;switch($){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&St&&K<8&&(K+=8),pe=this._getColorFromAnsiIndex(K);break;case 50331648:let me=M2.toColorRGB(K);pe=im.toColor(me[0],me[1],me[2]);break;case 0:default:ct?pe=this._config.colors.background:pe=this._config.colors.foreground}return this._config.allowTransparency&&(pe=m5.opaque(pe)),yt&&(pe=m5.multiplyOpacity(pe,BEt)),pe}_resolveBackgroundRgba(t,r,u){switch(t){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return u?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(t,r,u,T){switch(t){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&T&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return u?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(t,r,u,T,$,K,ct,yt,St,Ut){if(this._config.minimumContrastRatio===1||Ut)return;let ne=this._getContrastCache(St),pe=ne.getColor(t,T);if(pe!==void 0)return pe||void 0;let me=this._resolveBackgroundRgba(r,u,ct),we=this._resolveForegroundRgba($,K,ct,yt),Ce=Fx.ensureContrastRatio(me,we,this._config.minimumContrastRatio/(St?2:1));if(!Ce){ne.setColor(t,T,null);return}let Ve=im.toColor(Ce>>24&255,Ce>>16&255,Ce>>8&255);return ne.setColor(t,T,Ve),Ve}_getContrastCache(t){return t?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(t,r,u,T,$,K){let ct=typeof t=="number"?String.fromCharCode(t):t;K&&this._tmpCanvas.parentElement!==K&&(this._tmpCanvas.style.display="none",K.append(this._tmpCanvas));let yt=Math.min(this._config.deviceCellWidth*Math.max(ct.length,2)+t5*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width=ta?ta*2-Yn:ta-Yn;Yn>=ta||Hn===0?(this._tmpCtx.setLineDash([Math.round(ta),Math.round(ta)]),this._tmpCtx.moveTo(na+Hn,qi),this._tmpCtx.lineTo(Xa,qi)):(this._tmpCtx.setLineDash([Math.round(ta),Math.round(ta)]),this._tmpCtx.moveTo(na,qi),this._tmpCtx.lineTo(na+Hn,qi),this._tmpCtx.moveTo(na+Hn+ta,qi),this._tmpCtx.lineTo(Xa,qi)),Yn=zEt(Xa-na,ta,Yn);break;case 5:let to=.6,Ha=.3,qa=Xa-na,Mo=Math.floor(to*qa),Wo=Math.floor(Ha*qa),es=qa-Mo-Wo;this._tmpCtx.setLineDash([Mo,Wo,es]),this._tmpCtx.moveTo(na,qi),this._tmpCtx.lineTo(Xa,qi);break;case 1:default:this._tmpCtx.moveTo(na,qi),this._tmpCtx.lineTo(Xa,qi);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!pr&&this._config.fontSize>=12&&!this._config.allowTransparency&&ct!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let hi=this._tmpCtx.measureText(ct);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in hi&&hi.actualBoundingBoxDescent>0){this._tmpCtx.save();let na=new Path2D;na.rect(_a,qi-Math.ceil(ta/2),this._config.deviceCellWidth*Sr,Xi-qi+Math.ceil(ta/2)),this._tmpCtx.clip(na),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=Mr.css,this._tmpCtx.strokeText(ct,on,on+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Ve){let ta=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),va=ta%2===1?.5:0;this._tmpCtx.lineWidth=ta,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(on,on+va),this._tmpCtx.lineTo(on+this._config.deviceCharWidth*Sr,on+va),this._tmpCtx.stroke()}if(pr||this._tmpCtx.fillText(ct,on,on+this._config.deviceCharHeight),ct==="_"&&!this._config.allowTransparency){let ta=CM(this._tmpCtx.getImageData(on,on,this._config.deviceCellWidth,this._config.deviceCellHeight),Mr,Vn,_r);if(ta)for(let va=1;va<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=Mr.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(ct,on,on+this._config.deviceCharHeight-va),ta=CM(this._tmpCtx.getImageData(on,on,this._config.deviceCellWidth,this._config.deviceCellHeight),Mr,Vn,_r),!!ta);va++);}if(Ce){let ta=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),va=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=ta,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(on,on+Math.floor(this._config.deviceCharHeight/2)-va),this._tmpCtx.lineTo(on+this._config.deviceCharWidth*Sr,on+Math.floor(this._config.deviceCharHeight/2)-va),this._tmpCtx.stroke()}this._tmpCtx.restore();let Dr=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),nn;if(this._config.allowTransparency?nn=oLt(Dr):nn=CM(Dr,Mr,Vn,_r),nn)return zN;let Cn=this._findGlyphBoundingBox(Dr,this._workBoundingBox,yt,Br,pr,on),Xn,_i;for(;;){if(this._activePages.length===0){let ta=this._createNewPage();Xn=ta,_i=ta.currentRow,_i.height=Cn.size.y;break}Xn=this._activePages[this._activePages.length-1],_i=Xn.currentRow;for(let ta of this._activePages)Cn.size.y<=ta.currentRow.height&&(Xn=ta,_i=ta.currentRow);for(let ta=this._activePages.length-1;ta>=0;ta--)for(let va of this._activePages[ta].fixedRows)va.height<=_i.height&&Cn.size.y<=va.height&&(Xn=this._activePages[ta],_i=va);if(Cn.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new SM(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Xn=this._overflowSizePage,_i=this._overflowSizePage.currentRow,_i.x+Cn.size.x>=Xn.canvas.width&&(_i.x=0,_i.y+=_i.height,_i.height=0);break}if(_i.y+Cn.size.y>=Xn.canvas.height||_i.height>Cn.size.y+2){let ta=!1;if(Xn.currentRow.y+Xn.currentRow.height+Cn.size.y>=Xn.canvas.height){let va;for(let _a of this._activePages)if(_a.currentRow.y+_a.currentRow.height+Cn.size.y<_a.canvas.height){va=_a;break}if(va)Xn=va;else if(S2.maxAtlasPages&&this._pages.length>=S2.maxAtlasPages&&_i.y+Cn.size.y<=Xn.canvas.height&&_i.height>=Cn.size.y&&_i.x+Cn.size.x<=Xn.canvas.width)ta=!0;else{let _a=this._createNewPage();Xn=_a,_i=_a.currentRow,_i.height=Cn.size.y,ta=!0}}ta||(Xn.currentRow.height>0&&Xn.fixedRows.push(Xn.currentRow),_i={x:0,y:Xn.currentRow.y+Xn.currentRow.height,height:Cn.size.y},Xn.fixedRows.push(_i),Xn.currentRow={x:0,y:_i.y+_i.height,height:0})}if(_i.x+Cn.size.x<=Xn.canvas.width)break;_i===Xn.currentRow?(_i.x=0,_i.y+=_i.height,_i.height=0):Xn.fixedRows.splice(Xn.fixedRows.indexOf(_i),1)}return Cn.texturePage=this._pages.indexOf(Xn),Cn.texturePosition.x=_i.x,Cn.texturePosition.y=_i.y,Cn.texturePositionClipSpace.x=_i.x/Xn.canvas.width,Cn.texturePositionClipSpace.y=_i.y/Xn.canvas.height,Cn.sizeClipSpace.x/=Xn.canvas.width,Cn.sizeClipSpace.y/=Xn.canvas.height,_i.height=Math.max(_i.height,Cn.size.y),_i.x+=Cn.size.x,Xn.ctx.putImageData(Dr,Cn.texturePosition.x-this._workBoundingBox.left,Cn.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Cn.size.x,Cn.size.y),Xn.addGlyph(Cn),Xn.version++,Cn}_findGlyphBoundingBox(t,r,u,T,$,K){r.top=0;let ct=T?this._config.deviceCellHeight:this._tmpCanvas.height,yt=T?this._config.deviceCellWidth:u,St=!1;for(let Ut=0;Ut=K;Ut--){for(let ne=0;ne=0;Ut--){for(let ne=0;ne>>24,$=t.rgba>>>16&255,K=t.rgba>>>8&255,ct=r.rgba>>>24,yt=r.rgba>>>16&255,St=r.rgba>>>8&255,Ut=Math.floor((Math.abs(T-ct)+Math.abs($-yt)+Math.abs(K-St))/12),ne=!0;for(let pe=0;pe0)return!1;return!0}function xW(e,t,r){let u=e.createElement("canvas");return u.width=t,u.height=r,u}function sLt(e,t,r,u,T,$,K,ct){let yt={foreground:$.foreground,background:$.background,cursor:fg,cursorAccent:fg,selectionForeground:fg,selectionBackgroundTransparent:fg,selectionBackgroundOpaque:fg,selectionInactiveBackgroundTransparent:fg,selectionInactiveBackgroundOpaque:fg,overviewRulerBorder:fg,scrollbarSliderBackground:fg,scrollbarSliderHoverBackground:fg,scrollbarSliderActiveBackground:fg,ansi:$.ansi.slice(),contrastCache:$.contrastCache,halfContrastCache:$.halfContrastCache};return{customGlyphs:T.customGlyphs,devicePixelRatio:K,deviceMaxTextureSize:ct,letterSpacing:T.letterSpacing,lineHeight:T.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:r,deviceCharHeight:u,fontFamily:T.fontFamily,fontSize:T.fontSize,fontWeight:T.fontWeight,fontWeightBold:T.fontWeightBold,allowTransparency:T.allowTransparency,drawBoldTextInBrightColors:T.drawBoldTextInBrightColors,minimumContrastRatio:T.minimumContrastRatio,colors:yt}}function ON(e,t){for(let r=0;r=0){if(ON(me.config,St))return me.atlas;me.ownedBy.length===1?(me.atlas.dispose(),gg.splice(pe,1)):me.ownedBy.splice(we,1);break}}for(let pe=0;pe{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=dT){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let t=dT-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0){this._restartInterval(t);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let t=dT-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(t);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},dT)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function RN(e,t,r){let u=new t.ResizeObserver(T=>{let $=T.find(yt=>yt.target===e);if(!$)return;if(!("devicePixelContentBoxSize"in $)){u?.disconnect(),u=void 0;return}let K=$.devicePixelContentBoxSize[0].inlineSize,ct=$.devicePixelContentBoxSize[0].blockSize;K>0&&ct>0&&r(K,ct)});try{u.observe(e,{box:["device-pixel-content-box"]})}catch{u.disconnect(),u=void 0}return N0(()=>u?.disconnect())}function uLt(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var FN=class wW extends M2{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new pW,this.combinedData=""}static fromCharData(t){let r=new wW;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?uLt(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let u=t[1].charCodeAt(0);if(55296<=u&&u<=56319){let T=t[1].charCodeAt(1);56320<=T&&T<=57343?this.content=(u-55296)*1024+T-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},kW=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function TW(e,t,r){let u=wp(e.createProgram());if(e.attachShader(u,wp(NN(e,e.VERTEX_SHADER,t))),e.attachShader(u,wp(NN(e,e.FRAGMENT_SHADER,r))),e.linkProgram(u),e.getProgramParameter(u,e.LINK_STATUS))return u;console.error(e.getProgramInfoLog(u)),e.deleteProgram(u)}function NN(e,t,r){let u=wp(e.createShader(t));if(e.shaderSource(u,r),e.compileShader(u),e.getShaderParameter(u,e.COMPILE_STATUS))return u;console.error(e.getShaderInfoLog(u)),e.deleteShader(u)}function hLt(e,t){let r=Math.min(e.length*2,t),u=new Float32Array(r);for(let T=0;TT.deleteProgram(this._program))),this._projectionLocation=wp(T.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=wp(T.getUniformLocation(this._program,"u_resolution")),this._textureLocation=wp(T.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);let $=new Float32Array([0,0,1,0,0,1,1,1]),K=T.createBuffer();this._register(N0(()=>T.deleteBuffer(K))),T.bindBuffer(T.ARRAY_BUFFER,K),T.bufferData(T.ARRAY_BUFFER,$,T.STATIC_DRAW),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let ct=new Uint8Array([0,1,2,3]),yt=T.createBuffer();this._register(N0(()=>T.deleteBuffer(yt))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,yt),T.bufferData(T.ELEMENT_ARRAY_BUFFER,ct,T.STATIC_DRAW),this._attributesBuffer=wp(T.createBuffer()),this._register(N0(()=>T.deleteBuffer(this._attributesBuffer))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,2,T.FLOAT,!1,x2,0),T.vertexAttribDivisor(2,1),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,T.FLOAT,!1,x2,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(3,1),T.enableVertexAttribArray(4),T.vertexAttribPointer(4,1,T.FLOAT,!1,x2,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(4,1),T.enableVertexAttribArray(5),T.vertexAttribPointer(5,2,T.FLOAT,!1,x2,5*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(5,1),T.enableVertexAttribArray(6),T.vertexAttribPointer(6,2,T.FLOAT,!1,x2,7*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(6,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,x2,9*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.useProgram(this._program);let St=new Int32Array(Jy.maxAtlasPages);for(let Ut=0;UtT.deleteTexture(ne.texture))),T.activeTexture(T.TEXTURE0+Ut),T.bindTexture(T.TEXTURE_2D,ne.texture),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.texImage2D(T.TEXTURE_2D,0,T.RGBA,1,1,0,T.RGBA,T.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Ut]=ne}T.enable(T.BLEND),T.blendFunc(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,r,u,T,$,K,ct,yt){this._updateCell(this._vertices.attributes,e,t,r,u,T,$,K,ct,yt)}_updateCell(e,t,r,u,T,$,K,ct,yt,St){if(Ff=(r*this._terminal.cols+t)*Qy,u===0||u===void 0){e.fill(0,Ff,Ff+Qy-1-pLt);return}this._atlas&&(ct&&ct.length>1?Gd=this._atlas.getRasterizedGlyphCombinedChar(ct,T,$,K,!1,this._terminal.element):Gd=this._atlas.getRasterizedGlyph(u,T,$,K,!1,this._terminal.element),AM=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),T!==St&&Gd.offset.x>AM?(r5=Gd.offset.x-AM,e[Ff]=-(Gd.offset.x-r5)+this._dimensions.device.char.left,e[Ff+1]=-Gd.offset.y+this._dimensions.device.char.top,e[Ff+2]=(Gd.size.x-r5)/this._dimensions.device.canvas.width,e[Ff+3]=Gd.size.y/this._dimensions.device.canvas.height,e[Ff+4]=Gd.texturePage,e[Ff+5]=Gd.texturePositionClipSpace.x+r5/this._atlas.pages[Gd.texturePage].canvas.width,e[Ff+6]=Gd.texturePositionClipSpace.y,e[Ff+7]=Gd.sizeClipSpace.x-r5/this._atlas.pages[Gd.texturePage].canvas.width,e[Ff+8]=Gd.sizeClipSpace.y):(e[Ff]=-Gd.offset.x+this._dimensions.device.char.left,e[Ff+1]=-Gd.offset.y+this._dimensions.device.char.top,e[Ff+2]=Gd.size.x/this._dimensions.device.canvas.width,e[Ff+3]=Gd.size.y/this._dimensions.device.canvas.height,e[Ff+4]=Gd.texturePage,e[Ff+5]=Gd.texturePositionClipSpace.x,e[Ff+6]=Gd.texturePositionClipSpace.y,e[Ff+7]=Gd.sizeClipSpace.x,e[Ff+8]=Gd.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&PEt(u,yt,Gd.size.x,this._dimensions.device.cell.width)&&(e[Ff+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,t=e.cols*e.rows*Qy;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);let r=0;for(;r=e.rows||yt<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=u,this.viewportStartRow=$,this.viewportEndRow=K,this.viewportCappedStartRow=ct,this.viewportCappedEndRow=yt,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r=this.startCol&&t=this.startCol):!1}};function vLt(){return new gLt}var gS=4,BT=1,RT=2,MM=3,yLt=2147483648,_Lt=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=vLt()}resize(e,t){let r=e*t*gS;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(t))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},xLt=`#version 300 es +}`}var Qy=11,b2=Qy*Float32Array.BYTES_PER_ELEMENT,mLt=2,Ff=0,Gd,AM=0,r5=0,gLt=class extends Ug{constructor(e,t,r,u){super(),this._terminal=e,this._gl=t,this._dimensions=r,this._optionsService=u,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let T=this._gl;Jy.maxAtlasPages===void 0&&(Jy.maxAtlasPages=Math.min(32,wp(T.getParameter(T.MAX_TEXTURE_IMAGE_UNITS))),Jy.maxTextureSize=wp(T.getParameter(T.MAX_TEXTURE_SIZE))),this._program=wp(TW(T,fLt,pLt(Jy.maxAtlasPages))),this._register(N0(()=>T.deleteProgram(this._program))),this._projectionLocation=wp(T.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=wp(T.getUniformLocation(this._program,"u_resolution")),this._textureLocation=wp(T.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);let $=new Float32Array([0,0,1,0,0,1,1,1]),K=T.createBuffer();this._register(N0(()=>T.deleteBuffer(K))),T.bindBuffer(T.ARRAY_BUFFER,K),T.bufferData(T.ARRAY_BUFFER,$,T.STATIC_DRAW),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let ct=new Uint8Array([0,1,2,3]),yt=T.createBuffer();this._register(N0(()=>T.deleteBuffer(yt))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,yt),T.bufferData(T.ELEMENT_ARRAY_BUFFER,ct,T.STATIC_DRAW),this._attributesBuffer=wp(T.createBuffer()),this._register(N0(()=>T.deleteBuffer(this._attributesBuffer))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,2,T.FLOAT,!1,b2,0),T.vertexAttribDivisor(2,1),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,T.FLOAT,!1,b2,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(3,1),T.enableVertexAttribArray(4),T.vertexAttribPointer(4,1,T.FLOAT,!1,b2,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(4,1),T.enableVertexAttribArray(5),T.vertexAttribPointer(5,2,T.FLOAT,!1,b2,5*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(5,1),T.enableVertexAttribArray(6),T.vertexAttribPointer(6,2,T.FLOAT,!1,b2,7*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(6,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,b2,9*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.useProgram(this._program);let St=new Int32Array(Jy.maxAtlasPages);for(let Ut=0;UtT.deleteTexture(ne.texture))),T.activeTexture(T.TEXTURE0+Ut),T.bindTexture(T.TEXTURE_2D,ne.texture),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.texImage2D(T.TEXTURE_2D,0,T.RGBA,1,1,0,T.RGBA,T.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Ut]=ne}T.enable(T.BLEND),T.blendFunc(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,r,u,T,$,K,ct,yt){this._updateCell(this._vertices.attributes,e,t,r,u,T,$,K,ct,yt)}_updateCell(e,t,r,u,T,$,K,ct,yt,St){if(Ff=(r*this._terminal.cols+t)*Qy,u===0||u===void 0){e.fill(0,Ff,Ff+Qy-1-mLt);return}this._atlas&&(ct&&ct.length>1?Gd=this._atlas.getRasterizedGlyphCombinedChar(ct,T,$,K,!1,this._terminal.element):Gd=this._atlas.getRasterizedGlyph(u,T,$,K,!1,this._terminal.element),AM=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),T!==St&&Gd.offset.x>AM?(r5=Gd.offset.x-AM,e[Ff]=-(Gd.offset.x-r5)+this._dimensions.device.char.left,e[Ff+1]=-Gd.offset.y+this._dimensions.device.char.top,e[Ff+2]=(Gd.size.x-r5)/this._dimensions.device.canvas.width,e[Ff+3]=Gd.size.y/this._dimensions.device.canvas.height,e[Ff+4]=Gd.texturePage,e[Ff+5]=Gd.texturePositionClipSpace.x+r5/this._atlas.pages[Gd.texturePage].canvas.width,e[Ff+6]=Gd.texturePositionClipSpace.y,e[Ff+7]=Gd.sizeClipSpace.x-r5/this._atlas.pages[Gd.texturePage].canvas.width,e[Ff+8]=Gd.sizeClipSpace.y):(e[Ff]=-Gd.offset.x+this._dimensions.device.char.left,e[Ff+1]=-Gd.offset.y+this._dimensions.device.char.top,e[Ff+2]=Gd.size.x/this._dimensions.device.canvas.width,e[Ff+3]=Gd.size.y/this._dimensions.device.canvas.height,e[Ff+4]=Gd.texturePage,e[Ff+5]=Gd.texturePositionClipSpace.x,e[Ff+6]=Gd.texturePositionClipSpace.y,e[Ff+7]=Gd.sizeClipSpace.x,e[Ff+8]=Gd.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&IEt(u,yt,Gd.size.x,this._dimensions.device.cell.width)&&(e[Ff+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,t=e.cols*e.rows*Qy;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);let r=0;for(;r=e.rows||yt<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=u,this.viewportStartRow=$,this.viewportEndRow=K,this.viewportCappedStartRow=ct,this.viewportCappedEndRow=yt,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r=this.startCol&&t=this.startCol):!1}};function yLt(){return new vLt}var gS=4,BT=1,RT=2,MM=3,_Lt=2147483648,xLt=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=yLt()}resize(e,t){let r=e*t*gS;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(t))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},bLt=`#version 300 es layout (location = 0) in vec2 a_position; layout (location = 1) in vec2 a_size; layout (location = 2) in vec4 a_color; @@ -4125,7 +4125,7 @@ void main() { vec2 zeroToOne = a_position + (a_unitquad * a_size); gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); v_color = a_color; -}`,bLt=`#version 300 es +}`,wLt=`#version 300 es precision lowp float; in vec4 v_color; @@ -4134,10 +4134,10 @@ out vec4 outColor; void main() { outColor = v_color; -}`,E1=8,EM=E1*Float32Array.BYTES_PER_ELEMENT,wLt=20*E1,jN=class{constructor(){this.attributes=new Float32Array(wLt),this.count=0}},w1=0,UN=0,$N=0,HN=0,VN=0,WN=0,qN=0,kLt=class extends Ug{constructor(e,t,r,u){super(),this._terminal=e,this._gl=t,this._dimensions=r,this._themeService=u,this._vertices=new jN,this._verticesCursor=new jN;let T=this._gl;this._program=wp(TW(T,xLt,bLt)),this._register(N0(()=>T.deleteProgram(this._program))),this._projectionLocation=wp(T.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);let $=new Float32Array([0,0,1,0,0,1,1,1]),K=T.createBuffer();this._register(N0(()=>T.deleteBuffer(K))),T.bindBuffer(T.ARRAY_BUFFER,K),T.bufferData(T.ARRAY_BUFFER,$,T.STATIC_DRAW),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let ct=new Uint8Array([0,1,2,3]),yt=T.createBuffer();this._register(N0(()=>T.deleteBuffer(yt))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,yt),T.bufferData(T.ELEMENT_ARRAY_BUFFER,ct,T.STATIC_DRAW),this._attributesBuffer=wp(T.createBuffer()),this._register(N0(()=>T.deleteBuffer(this._attributesBuffer))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,T.FLOAT,!1,EM,0),T.vertexAttribDivisor(0,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,EM,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,4,T.FLOAT,!1,EM,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(2,1),this._updateCachedColors(u.colors),this._register(this._themeService.onChangeColors(St=>{this._updateCachedColors(St),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,kW),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,r=this._vertices,u=1,T,$,K,ct,yt,St,Ut,ne,pe,me,we;for(T=0;T>24&255)/255,VN=(w1>>16&255)/255,WN=(w1>>8&255)/255,qN=1,this._addRectangle(e.attributes,t,UN,$N,($-T)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,HN,VN,WN,qN)}_addRectangle(e,t,r,u,T,$,K,ct,yt,St){e[t]=r/this._dimensions.device.canvas.width,e[t+1]=u/this._dimensions.device.canvas.height,e[t+2]=T/this._dimensions.device.canvas.width,e[t+3]=$/this._dimensions.device.canvas.height,e[t+4]=K,e[t+5]=ct,e[t+6]=yt,e[t+7]=St}_addRectangleFloat(e,t,r,u,T,$,K){e[t]=r/this._dimensions.device.canvas.width,e[t+1]=u/this._dimensions.device.canvas.height,e[t+2]=T/this._dimensions.device.canvas.width,e[t+3]=$/this._dimensions.device.canvas.height,e[t+4]=K[0],e[t+5]=K[1],e[t+6]=K[2],e[t+7]=K[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},TLt=class extends Ug{constructor(e,t,r,u,T,$,K,ct){super(),this._container=t,this._alpha=T,this._coreBrowserService=$,this._optionsService=K,this._themeService=ct,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=u.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(yt=>{this._refreshCharAtlas(e,yt),this.reset(e)})),this._register(N0(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=wp(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,r){}handleSelectionChanged(e,t,r,u=!1){}_setTransparency(e,t){if(t===this._alpha)return;let r=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=bW(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,r,u){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,r*this._deviceCellWidth,u*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,r*this._deviceCellWidth,u*this._deviceCellHeight))}_fillCharTrueColor(e,t,r,u){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=cW,this._clipCell(r,u,t.getWidth()),this._ctx.fillText(t.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,u*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,r){let u=t?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${u} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},SLt=class extends TLt{constructor(e,t,r,u,T,$,K){super(r,e,"link",t,!0,T,$,K),this._register(u.onShowLinkUnderline(ct=>this._handleShowLinkUnderline(ct))),this._register(u.onHideLinkUnderline(ct=>this._handleHideLinkUnderline(ct)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&sLt(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t=0;rw.indexOf("AppleWebKit")>=0;var ALt=rw.indexOf("Chrome")>=0;!ALt&&rw.indexOf("Safari")>=0;rw.indexOf("Electron/")>=0;rw.indexOf("Android")>=0;var LM=!1;if(typeof Lx.matchMedia=="function"){let e=Lx.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Lx.matchMedia("(display-mode: fullscreen)");LM=e.matches,CLt(Lx,e,({matches:r})=>{LM&&t.matches||(LM=r)})}var E2="en",PM=!1,CW=!1,fT,FT=E2,GN=E2,MLt,A1,Fx=globalThis,qm;typeof Fx.vscode<"u"&&typeof Fx.vscode.process<"u"?qm=Fx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(qm=process);var ELt=typeof qm?.versions?.electron=="string",LLt=ELt&&qm?.type==="renderer";if(typeof qm=="object"){qm.platform,qm.platform,PM=qm.platform==="linux",PM&&qm.env.SNAP&&qm.env.SNAP_REVISION,qm.env.CI||qm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,fT=E2,FT=E2;let e=qm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);fT=t.userLocale,GN=t.osLocale,FT=t.resolvedLanguage||E2,MLt=t.languagePack?.translationsConfigFile}catch{}CW=!0}else typeof navigator=="object"&&!LLt?(A1=navigator.userAgent,A1.indexOf("Windows")>=0,A1.indexOf("Macintosh")>=0,(A1.indexOf("Macintosh")>=0||A1.indexOf("iPad")>=0||A1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,PM=A1.indexOf("Linux")>=0,A1?.indexOf("Mobi")>=0,FT=globalThis._VSCODE_NLS_LANGUAGE||E2,fT=navigator.language.toLowerCase(),GN=fT):console.error("Unable to resolve platform.");var ZN=CW,Rv=A1,qy=FT,PLt;(e=>{function t(){return qy}e.value=t;function r(){return qy.length===2?qy==="en":qy.length>=3?qy[0]==="e"&&qy[1]==="n"&&qy[2]==="-":!1}e.isDefaultVariant=r;function u(){return qy==="en"}e.isDefault=u})(PLt||={});var ILt=typeof Fx.postMessage=="function"&&!Fx.importScripts;(()=>{if(ILt){let e=[];Fx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let u=0,T=e.length;u{let u=++t;e.push({id:u,callback:r}),Fx.postMessage({vscodeScheduleAsyncWork:u},"*")}}return e=>setTimeout(e)})();var DLt=!!(Rv&&Rv.indexOf("Chrome")>=0);Rv&&Rv.indexOf("Firefox")>=0;!DLt&&Rv&&Rv.indexOf("Safari")>=0;Rv&&Rv.indexOf("Edg/")>=0;Rv&&Rv.indexOf("Android")>=0;var b2=typeof navigator=="object"?navigator:{};ZN||document.queryCommandSupported&&document.queryCommandSupported("copy")||b2&&b2.clipboard&&b2.clipboard.writeText,ZN||b2&&b2.clipboard&&b2.clipboard.readText;var EL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},IM=new EL,KN=new EL,YN=new EL;new Array(230);var zLt;(e=>{function t(ct){return IM.keyCodeToStr(ct)}e.toString=t;function r(ct){return IM.strToKeyCode(ct)}e.fromString=r;function u(ct){return KN.keyCodeToStr(ct)}e.toUserSettingsUS=u;function T(ct){return YN.keyCodeToStr(ct)}e.toUserSettingsGeneral=T;function $(ct){return KN.strToKeyCode(ct)||YN.strToKeyCode(ct)}e.fromUserSettings=$;function K(ct){if(ct>=98&&ct<=113)return null;switch(ct){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return IM.keyCodeToStr(ct)}e.toElectronAccelerator=K})(zLt||={});var AW=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),OLt;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof BLt?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:N1.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:AW})})(OLt||={});var BLt=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?AW:(this._emitter||(this._emitter=new Yd),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},RLt;(e=>{async function t(u){let T,$=await Promise.all(u.map(K=>K.then(ct=>ct,ct=>{T||(T=ct)})));if(typeof T<"u")throw T;return $}e.settled=t;function r(u){return new Promise(async(T,$)=>{try{await u(T,$)}catch(K){$(K)}})}e.withAsyncBody=r})(RLt||={});var XN=class pg{static fromArray(t){return new pg(r=>{r.emitMany(t)})}static fromPromise(t){return new pg(async r=>{r.emitMany(await t)})}static fromPromises(t){return new pg(async r=>{await Promise.all(t.map(async u=>r.emitOne(await u)))})}static merge(t){return new pg(async r=>{await Promise.all(t.map(async u=>{for await(let T of u)r.emitOne(T)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Yd,queueMicrotask(async()=>{let u={emitOne:T=>this.emitOne(T),emitMany:T=>this.emitMany(T),reject:T=>this.reject(T)};try{await Promise.resolve(t(u)),this.resolve()}catch(T){this.reject(T)}finally{u.emitOne=void 0,u.emitMany=void 0,u.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new pg(async u=>{for await(let T of t)u.emitOne(r(T))})}map(t){return pg.map(this,t)}static filter(t,r){return new pg(async u=>{for await(let T of t)r(T)&&u.emitOne(T)})}filter(t){return pg.filter(this,t)}static coalesce(t){return pg.filter(t,r=>!!r)}coalesce(){return pg.coalesce(this)}static async toPromise(t){let r=[];for await(let u of t)r.push(u);return r}toPromise(){return pg.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};XN.EMPTY=XN.fromArray([]);var{getWindow:FLt}=function(){let e=new Map,t={window:Lx,disposables:new O2};e.set(Lx.vscodeWindowId,t);let r=new Yd,u=new Yd,T=new Yd;function $(K,ct){return(typeof K=="number"?e.get(K):void 0)??(ct?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:T.event,onDidUnregisterWindow:u.event,registerWindow(K){if(e.has(K.vscodeWindowId))return Ug.None;let ct=new O2,yt={window:K,disposables:ct.add(new O2)};return e.set(K.vscodeWindowId,yt),ct.add(N0(()=>{e.delete(K.vscodeWindowId),u.fire(K)})),ct.add(fE(K,jLt.BEFORE_UNLOAD,()=>{T.fire(K)})),r.fire(yt),ct},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(K){return K.vscodeWindowId},hasWindow(K){return e.has(K)},getWindowById:$,getWindow(K){let ct=K;if(ct?.ownerDocument?.defaultView)return ct.ownerDocument.defaultView.window;let yt=K;return yt?.view?yt.view.window:Lx},getDocument(K){return FLt(K).document}}}(),NLt=class{constructor(e,t,r,u){this._node=e,this._type=t,this._handler=r,this._options=u||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function fE(e,t,r,u){return new NLt(e,t,r,u)}var jLt={BEFORE_UNLOAD:"beforeunload"},ULt=class extends Ug{constructor(e,t,r,u,T,$,K,ct,yt){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=r,this._coreBrowserService=u,this._coreService=T,this._decorationService=$,this._optionsService=K,this._themeService=ct,this._cursorBlinkStateManager=new Q3,this._charAtlasDisposable=this._register(new Q3),this._observerDisposable=this._register(new Q3),this._model=new _Lt,this._workCell=new FN,this._workCell2=new FN,this._rectangleRenderer=this._register(new Q3),this._glyphRenderer=this._register(new Q3),this._onChangeTextureAtlas=this._register(new Yd),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Yd),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Yd),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Yd),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Yd),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let St={antialias:!1,depth:!1,preserveDrawingBuffer:yt};if(this._gl=this._canvas.getContext("webgl2",St),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new zEt(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new SLt(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,K,this._themeService)],this.dimensions=IEt(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(K.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(fE(this._canvas,"webglcontextlost",Ut=>{console.log("webglcontextlost event received"),Ut.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Ut)},3e3)})),this._register(fE(this._canvas,"webglcontextrestored",Ut=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,BN(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=RN(this._canvas,this._coreBrowserService.window,(Ut,ne)=>this._setCanvasDevicePixelDimensions(Ut,ne)),this._register(this._coreBrowserService.onWindowChange(Ut=>{this._observerDisposable.value=RN(this._canvas,Ut,(ne,pe)=>this._setCanvasDevicePixelDimensions(ne,pe))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(N0(()=>{for(let Ut of this._renderLayers)Ut.dispose();this._canvas.parentElement?.removeChild(this._canvas),BN(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,r){for(let u of this._renderLayers)u.handleSelectionChanged(this._terminal,e,t,r);this._model.selection.update(this._core,e,t,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new kLt(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new mLt(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=bW(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=iW(N1.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),N1.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new lLt(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let r=this._core,u=this._workCell,T,$,K,ct,yt,St,Ut=0,ne=!0,pe,me,we,Ce,Ve,kr,It,rn,Lr;e=JN(e,r.rows-1,0),t=JN(t,r.rows-1,0);let Mr=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",tn=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Dn=tn-r.buffer.ydisp,Mn=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),Br=-1,Vn=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let on=!1;for($=e;$<=t;$++)for(K=$+r.buffer.ydisp,ct=r.buffer.lines.get(K),this._model.lineLengths[$]=0,we=tn===K,Ut=0,yt=this._characterJoinerService.getJoinedCharacters(K),rn=0;rn=Ut,pe=rn,yt.length>0&&rn===yt[0][0]&&ne){me=yt.shift();let pr=this._model.selection.isCellSelected(this._terminal,me[0],K);for(It=me[0]+1;It=me[1],ne?(St=!0,u=new $Lt(u,ct.translateToString(!0,me[0],me[1]),me[1]-me[0]),pe=me[1]-1):Ut=me[1]}if(Ce=u.getChars(),Ve=u.getCode(),It=($*r.cols+rn)*gS,this._cellColorResolver.resolve(u,rn,K,this.dimensions.device.cell.width),Vn&&K===tn&&(rn===Mn&&(this._model.cursor={x:Mn,y:Dn,width:u.getWidth(),style:this._coreBrowserService.isFocused?Mr:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},Br=Mn+u.getWidth()-1),rn>=Mn&&rn<=Br&&(this._coreBrowserService.isFocused&&Mr==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),Ve!==0&&(this._model.lineLengths[$]=rn+1),!(this._model.cells[It]===Ve&&this._model.cells[It+BT]===this._cellColorResolver.result.bg&&this._model.cells[It+RT]===this._cellColorResolver.result.fg&&this._model.cells[It+MM]===this._cellColorResolver.result.ext)&&(on=!0,Ce.length>1&&(Ve|=yLt),this._model.cells[It]=Ve,this._model.cells[It+BT]=this._cellColorResolver.result.bg,this._model.cells[It+RT]=this._cellColorResolver.result.fg,this._model.cells[It+MM]=this._cellColorResolver.result.ext,kr=u.getWidth(),this._glyphRenderer.value.updateCell(rn,$,Ve,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Ce,kr,T),St)){for(u=this._workCell,rn++;rn<=pe;rn++)Lr=($*r.cols+rn)*gS,this._glyphRenderer.value.updateCell(rn,$,0,0,0,0,SEt,0,0),this._model.cells[Lr]=0,this._model.cells[Lr+BT]=this._cellColorResolver.result.bg,this._model.cells[Lr+RT]=this._cellColorResolver.result.fg,this._model.cells[Lr+MM]=this._cellColorResolver.result.ext;rn--}}on&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},$Lt=class extends M2{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function JN(e,t,r=0){return Math.max(Math.min(e,t),r)}var QN="di$target",tj="di$dependencies",DM=new Map;function Fv(e){if(DM.has(e))return DM.get(e);let t=function(r,u,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");HLt(t,r,T)};return t._id=e,DM.set(e,t),t}function HLt(e,t,r){t[QN]===t?t[tj].push({id:e,index:r}):(t[tj]=[{id:e,index:r}],t[QN]=t)}Fv("BufferService");Fv("CoreMouseService");Fv("CoreService");Fv("CharsetService");Fv("InstantiationService");Fv("LogService");var VLt=Fv("OptionsService");Fv("OscLinkService");Fv("UnicodeService");Fv("DecorationService");var WLt={trace:0,debug:1,info:2,warn:3,error:4,off:5},qLt="xterm.js: ",ej=class extends Ug{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=WLt[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis.activate(e)));return}this._terminal=e;let r=t.coreService,u=t.optionsService,T=t,$=T._renderService,K=T._characterJoinerService,ct=T._charSizeService,yt=T._coreBrowserService,St=T._decorationService;T._logService;let Ut=T._themeService;this._renderer=this._register(new ULt(e,K,ct,yt,r,St,u,Ut,this._preserveDrawingBuffer)),this._register(N1.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(N1.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(N1.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(N1.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),$.setRenderer(this._renderer),this._register(N0(()=>{if(this._terminal._core._store._isDisposed)return;let ne=this._terminal._core._renderService;ne.setRenderer(this._terminal._core._createRenderer()),ne.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};class H0{aliases;usage;matches(t){const r=t.toLowerCase();return r===this.name.toLowerCase()||(this.aliases?.some(u=>r===u.toLowerCase())??!1)}writeLine(t,r,u){u?t.writeln(`${u}${r}\x1B[0m`):t.writeln(r)}writeSuccess(t,r){t.writeln(`\x1B[1;32m✓\x1B[0m ${r}`)}writeError(t,r){t.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${r}`)}writeInfo(t,r){t.writeln(`\x1B[90m${r}\x1B[0m`)}startLoading(t,r){const u=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];let T=0,$=!0;const K=setInterval(()=>{if(!$){clearInterval(K);return}t.write(`\r\x1B[36m${u[T]}\x1B[0m ${r}`),T=(T+1)%u.length},80);return()=>{$=!1,clearInterval(K),t.write("\r\x1B[K")}}}class ZLt extends H0{constructor(t){super(),this.commands=t}name="help";description="Show available commands";aliases=["?","h"];execute({term:t,writePrompt:r}){t.writeln(""),t.writeln("\x1B[1;33mAvailable Commands:\x1B[0m"),t.writeln(""),this.commands.forEach(u=>{const T=u.aliases?.length?` (${u.aliases.join(", ")})`:"";t.writeln(` \x1B[1;36m${u.name.padEnd(15)}\x1B[0m ${u.description}${T}`)}),t.writeln(""),t.writeln("\x1B[90mTip: Use Tab for autocomplete, ↑↓ for history, Ctrl+F to search\x1B[0m"),r()}}class KLt extends H0{name="clear";description="Clear terminal screen";aliases=["cls"];execute({term:t,writePrompt:r}){t.clear(),r()}}class YLt extends H0{name="status";description="Show repeater status";aliases=["st"];async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching status...");try{const T=await bs.get("/stats");u();const $=T.success&&T.data?T.data:T;if($&&typeof $=="object"){this.writeSuccess(t,"Repeater Status:"),t.writeln("");for(const[K,ct]of Object.entries($))t.writeln(` \x1B[36m${K.padEnd(20)}\x1B[0m ${ct}`)}else this.writeError(t,"No status data available")}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch status")}r()}}class XLt extends H0{name="uptime";description="Show system uptime";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching uptime...");try{const T=await bs.get("/stats");u();const K=(T.data||T).uptime_seconds||0,ct=this.formatUptime(K);this.writeSuccess(t,ct)}catch(T){u(),this.writeError(t,`Failed to get uptime: ${T}`)}r()}formatUptime(t){const r=Math.floor(t/86400),u=Math.floor(t%86400/3600),T=Math.floor(t%3600/60);return r>0?`${r}d ${u}h ${T}m`:u>0?`${u}h ${T}m`:`${T}m`}}class JLt extends H0{name="packets";description="Show packet statistics";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching packet stats...");try{const T=await bs.get("/stats");u();const $=T.data||T;this.writeLine(t,""),this.isMobile()?(this.writeLine(t," \x1B[1;36mPacket Statistics\x1B[0m"),this.writeLine(t," \x1B[90mRX:\x1B[0m "+($.rx_count||0)),this.writeLine(t," \x1B[90mTX:\x1B[0m "+($.tx_count||0)),this.writeLine(t," \x1B[90mForward:\x1B[0m "+($.forwarded_count||0)),this.writeLine(t," \x1B[90mDropped:\x1B[0m "+($.dropped_count||0))):(this.writeLine(t," \x1B[36m┌──────────┬──────────┐\x1B[0m"),this.writeLine(t," \x1B[36m│\x1B[0m \x1B[1mMetric\x1B[0m \x1B[36m│\x1B[0m \x1B[1mCount\x1B[0m \x1B[36m│\x1B[0m"),this.writeLine(t," \x1B[36m├──────────┼──────────┤\x1B[0m"),this.writeLine(t,` \x1B[36m│\x1B[0m RX \x1B[36m│\x1B[0m ${String($.rx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t,` \x1B[36m│\x1B[0m TX \x1B[36m│\x1B[0m ${String($.tx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t,` \x1B[36m│\x1B[0m Forward \x1B[36m│\x1B[0m ${String($.forwarded_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t,` \x1B[36m│\x1B[0m Dropped \x1B[36m│\x1B[0m ${String($.dropped_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t," \x1B[36m└──────────┴──────────┘\x1B[0m")),this.writeLine(t,"")}catch(T){u(),this.writeError(t,`Failed to get packet stats: ${T}`)}r()}}class QLt extends H0{name="board";description="Show board information";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching board info...");try{const T=await bs.get("/stats");u();const K=(T.data||T).board_info||"pyMC_Repeater (Linux/RPi)";this.writeSuccess(t,K)}catch{u(),this.writeSuccess(t,"pyMC_Repeater (Linux/RPi)")}r()}}class tPt extends H0{name="advert";description="Send neighbor advert immediately";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Sending advert...");try{const T=await bs.post("/send_advert",{},{timeout:1e4});u(),T.success?this.writeSuccess(t,T.data||"Advert sent successfully"):this.writeError(t,T.error||"Failed to send advert")}catch(T){u(),this.writeError(t,`Failed to send advert: ${T}`)}r()}}class ePt extends H0{name="get";description="Get configuration values (name, freq, tx, mode, duty, etc.)";matches(t){const r=t.toLowerCase();return r==="get"||r.startsWith("get ")}async execute({term:t,args:r,writePrompt:u}){const T=r[0]?.toLowerCase();if(!T){this.writeError(t,"Usage: get "),this.writeLine(t,""),this.writeInfo(t,"Available parameters:"),this.writeLine(t,""),this.writeLine(t," \x1B[36mname\x1B[0m Node name"),this.writeLine(t," \x1B[36mrole\x1B[0m Node role"),this.writeLine(t," \x1B[36mlat\x1B[0m Latitude"),this.writeLine(t," \x1B[36mlon\x1B[0m Longitude"),this.writeLine(t," \x1B[36mfreq\x1B[0m Frequency (MHz)"),this.writeLine(t," \x1B[36mtx\x1B[0m TX power (dBm)"),this.writeLine(t," \x1B[36mbw\x1B[0m Bandwidth (kHz)"),this.writeLine(t," \x1B[36msf\x1B[0m Spreading factor"),this.writeLine(t," \x1B[36mcr\x1B[0m Coding rate"),this.writeLine(t," \x1B[36mradio\x1B[0m All radio settings"),this.writeLine(t," \x1B[36mtxdelay\x1B[0m TX delay factor"),this.writeLine(t," \x1B[36mdirect.txdelay\x1B[0m Direct TX delay"),this.writeLine(t," \x1B[36mrxdelay\x1B[0m RX delay base"),this.writeLine(t," \x1B[36maf\x1B[0m Airtime factor"),this.writeLine(t," \x1B[36mmode\x1B[0m Repeater mode"),this.writeLine(t," \x1B[36mrepeat\x1B[0m Repeat on/off"),this.writeLine(t," \x1B[36mflood.max\x1B[0m Max flood hops"),this.writeLine(t," \x1B[36madvert.interval\x1B[0m Advert interval"),this.writeLine(t," \x1B[36mduty\x1B[0m Duty cycle enabled"),this.writeLine(t," \x1B[36mduty.max\x1B[0m Max airtime %"),this.writeLine(t," \x1B[36mpublic.key\x1B[0m Public key"),this.writeLine(t,""),u();return}const $=this.startLoading(t,"Fetching configuration...");try{const K=await bs.get("/stats");$();const ct=K.data||K,yt=ct.config||{},St=yt.radio||{},Ut=yt.repeater||{},ne=yt.delays||{},pe=yt.duty_cycle||{};let me="";switch(T){case"name":me=yt.node_name||"Unknown";break;case"role":me="repeater";break;case"lat":me=Ut.latitude!=null?String(Ut.latitude):"not set";break;case"lon":me=Ut.longitude!=null?String(Ut.longitude):"not set";break;case"freq":me=St.frequency?`${(St.frequency/1e6).toFixed(3)} MHz`:"?";break;case"tx":me=St.tx_power!=null?`${St.tx_power}dBm`:"?";break;case"bw":me=St.bandwidth?`${St.bandwidth/1e3} kHz`:"?";break;case"sf":me=St.spreading_factor!=null?String(St.spreading_factor):"?";break;case"cr":me=St.coding_rate!=null?`4/${St.coding_rate}`:"?";break;case"radio":if(St.frequency){this.writeSuccess(t,"Radio Configuration:"),this.writeLine(t,""),this.writeLine(t,` \x1B[36mFrequency:\x1B[0m ${(St.frequency/1e6).toFixed(3)} MHz`),this.writeLine(t,` \x1B[36mBandwidth:\x1B[0m ${St.bandwidth/1e3} kHz`),this.writeLine(t,` \x1B[36mSpreading Factor:\x1B[0m ${St.spreading_factor}`),this.writeLine(t,` \x1B[36mCoding Rate:\x1B[0m 4/${St.coding_rate}`),this.writeLine(t,` \x1B[36mTX Power:\x1B[0m ${St.tx_power}dBm`),this.writeLine(t,""),u();return}else me="Radio configuration not available";break;case"af":case"txdelay":me=ne.tx_delay_factor!=null?String(ne.tx_delay_factor):"\x1B[90mnot set (default: 1.0)\x1B[0m";break;case"direct.txdelay":me=ne.direct_tx_delay_factor!=null?String(ne.direct_tx_delay_factor):"\x1B[90mnot set (default: 0.5)\x1B[0m";break;case"rxdelay":me=ne.rx_delay_base!=null?`${ne.rx_delay_base}s`:"\x1B[90mnot set (default: 0.0s)\x1B[0m";break;case"mode":me=Ut.mode!=null?Ut.mode:"\x1B[90mnot set (default: forward)\x1B[0m";break;case"repeat":Ut.mode!=null?me=Ut.mode==="forward"?"on":"off":me="\x1B[90mnot set (default: on)\x1B[0m";break;case"flood.max":me=Ut.max_flood_hops!=null?String(Ut.max_flood_hops):"\x1B[90mnot set (default: 3)\x1B[0m";break;case"flood.advert.interval":me=Ut.send_advert_interval_hours!=null?`${Ut.send_advert_interval_hours}h`:"\x1B[90mnot set\x1B[0m";break;case"advert.interval":me=Ut.advert_interval_minutes!=null?`${Ut.advert_interval_minutes}m`:"\x1B[90mnot set (default: 120m)\x1B[0m";break;case"duty":case"duty.enabled":me=pe.enforcement_enabled!=null?pe.enforcement_enabled?"on":"off":"\x1B[90mnot set (default: off)\x1B[0m";break;case"duty.max":me=pe.max_airtime_percent!=null?`${pe.max_airtime_percent}%`:"\x1B[90mnot set\x1B[0m";break;case"public.key":me=ct.public_key||"\x1B[90mnot available\x1B[0m";break;case"prv.key":this.writeWarning(t,"Private key not exposed via API for security"),this.writeInfo(t,"Check /etc/pymc_repeater/config.yaml"),u();return;case"guest.password":case"allow.read.only":this.writeWarning(t,"Security settings not exposed via API"),this.writeInfo(t,"Check /etc/pymc_repeater/config.yaml"),u();return;default:this.writeError(t,`Unknown parameter: ${T}`),this.writeLine(t,""),this.writeInfo(t,"Available parameters:"),this.writeInfo(t," Identity: name, role, lat, lon"),this.writeInfo(t," Radio: freq, tx, bw, sf, cr, radio"),this.writeInfo(t," Timing: txdelay, direct.txdelay, rxdelay, af"),this.writeInfo(t," Repeater: mode, repeat, flood.max, advert.interval"),this.writeInfo(t," Duty: duty, duty.max"),this.writeInfo(t," Security: public.key"),u();return}this.writeSuccess(t,me)}catch(K){$(),this.writeError(t,`Failed to get ${T}: ${K}`)}u()}writeWarning(t,r){t.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class rPt extends H0{name="set";description="Set configuration values (tx, txdelay, mode, duty, etc.)";matches(t){const r=t.toLowerCase();return r==="set"||r.startsWith("set ")}async execute({term:t,args:r,writePrompt:u}){const T=r[0]?.toLowerCase(),$=r.slice(1).join(" ").trim();if(!T){this.writeError(t,"Usage: set "),this.writeLine(t,""),this.writeInfo(t,"Available parameters:"),this.writeLine(t,""),this.writeLine(t," \x1B[33mRadio:\x1B[0m"),this.writeLine(t," \x1B[36mtx <2-30>\x1B[0m TX power in dBm"),this.writeLine(t," \x1B[36mfreq \x1B[0m Frequency (100-1000 MHz) *restart required*"),this.writeLine(t," \x1B[36mbw \x1B[0m Bandwidth (7.8-500 kHz) *restart required*"),this.writeLine(t," \x1B[36msf <5-12>\x1B[0m Spreading factor *restart required*"),this.writeLine(t," \x1B[36mcr <5-8>\x1B[0m Coding rate (for 4/5 to 4/8) *restart required*"),this.writeLine(t,""),this.writeLine(t," \x1B[33mTiming:\x1B[0m"),this.writeLine(t," \x1B[36mtxdelay <0.0-5.0>\x1B[0m TX delay factor"),this.writeLine(t," \x1B[36mdirect.txdelay <0.0-5.0>\x1B[0m Direct TX delay factor"),this.writeLine(t," \x1B[36mrxdelay \x1B[0m RX delay base (>= 0)"),this.writeLine(t,""),this.writeLine(t," \x1B[33mIdentity:\x1B[0m"),this.writeLine(t," \x1B[36mname \x1B[0m Node name"),this.writeLine(t," \x1B[36mlat <-90 to 90>\x1B[0m Latitude"),this.writeLine(t," \x1B[36mlon <-180 to 180>\x1B[0m Longitude"),this.writeLine(t,""),this.writeLine(t," \x1B[33mRepeater:\x1B[0m"),this.writeLine(t," \x1B[36mmode \x1B[0m Repeater mode"),this.writeLine(t," \x1B[36mduty \x1B[0m Duty cycle enforcement"),this.writeLine(t," \x1B[36mflood.max <0-64>\x1B[0m Max flood hops"),this.writeLine(t," \x1B[36madvert.interval \x1B[0m Local advert interval"),this.writeLine(t,""),u();return}const K=this.startLoading(t,"Updating configuration...");try{let ct;switch(T){case"tx":{const St=parseInt($);if(isNaN(St)||St<2||St>30){K(),this.writeError(t,"TX power must be 2-30 dBm"),u();return}ct=await bs.post("/update_radio_config",{tx_power:St},{timeout:3e4});break}case"freq":{const St=parseFloat($);if(isNaN(St)||St<100||St>1e3){K(),this.writeError(t,"Frequency must be 100-1000 MHz"),u();return}ct=await bs.post("/update_radio_config",{frequency:St*1e6},{timeout:3e4});break}case"bw":{const St=parseFloat($),Ut=[7.8,10.4,15.6,20.8,31.25,41.7,62.5,125,250,500];if(isNaN(St)||!Ut.includes(St)){K(),this.writeError(t,`Bandwidth must be one of: ${Ut.join(", ")} kHz`),u();return}ct=await bs.post("/update_radio_config",{bandwidth:St*1e3},{timeout:3e4});break}case"sf":{const St=parseInt($);if(isNaN(St)||St<5||St>12){K(),this.writeError(t,"Spreading factor must be 5-12"),u();return}ct=await bs.post("/update_radio_config",{spreading_factor:St},{timeout:3e4});break}case"cr":{const St=parseInt($);if(isNaN(St)||St<5||St>8){K(),this.writeError(t,"Coding rate must be 5-8 (for 4/5 to 4/8)"),u();return}ct=await bs.post("/update_radio_config",{coding_rate:St},{timeout:3e4});break}case"af":case"txdelay":{const St=parseFloat($);if(isNaN(St)||St<0||St>5){K(),this.writeError(t,"TX delay factor must be 0.0-5.0"),u();return}ct=await bs.post("/update_radio_config",{tx_delay_factor:St},{timeout:3e4});break}case"direct.txdelay":{const St=parseFloat($);if(isNaN(St)||St<0||St>5){K(),this.writeError(t,"Direct TX delay factor must be 0.0-5.0"),u();return}ct=await bs.post("/update_radio_config",{direct_tx_delay_factor:St},{timeout:3e4});break}case"rxdelay":{const St=parseFloat($);if(isNaN(St)||St<0){K(),this.writeError(t,"RX delay must be >= 0"),u();return}ct=await bs.post("/update_radio_config",{rx_delay_base:St},{timeout:3e4});break}case"name":{if(!$.trim()){K(),this.writeError(t,"Node name cannot be empty"),u();return}ct=await bs.post("/update_radio_config",{node_name:$.trim()},{timeout:3e4});break}case"lat":{const St=parseFloat($);if(isNaN(St)||St<-90||St>90){K(),this.writeError(t,"Latitude must be -90 to 90"),u();return}ct=await bs.post("/update_radio_config",{latitude:St},{timeout:3e4});break}case"lon":{const St=parseFloat($);if(isNaN(St)||St<-180||St>180){K(),this.writeError(t,"Longitude must be -180 to 180"),u();return}ct=await bs.post("/update_radio_config",{longitude:St},{timeout:3e4});break}case"mode":{const St=$.toLowerCase();if(St!=="forward"&&St!=="monitor"){K(),this.writeError(t,'Mode must be "forward" or "monitor"'),this.writeLine(t,""),this.writeInfo(t,"Valid values:"),this.writeLine(t," \x1B[36mforward\x1B[0m - Forward packets"),this.writeLine(t," \x1B[36mmonitor\x1B[0m - Monitor only (no forwarding)"),u();return}ct=await bs.post("/set_mode",{mode:St},{timeout:3e4}),ct.data&&(ct.data.applied=[`mode=${St}`],ct.data.persisted=!0,ct.data.live_update=!0);break}case"duty":{const St=$.toLowerCase();if(St!=="on"&&St!=="off"){K(),this.writeError(t,'Duty cycle must be "on" or "off"'),this.writeLine(t,""),this.writeInfo(t,"Valid values:"),this.writeLine(t," \x1B[36mon\x1B[0m - Enable duty cycle enforcement"),this.writeLine(t," \x1B[36moff\x1B[0m - Disable duty cycle enforcement"),u();return}const Ut=St==="on";ct=await bs.post("/set_duty_cycle",{enabled:Ut},{timeout:3e4}),ct.data&&(ct.data.applied=[`duty=${St}`],ct.data.persisted=!0,ct.data.live_update=!0);break}case"flood.max":{const St=parseInt($);if(isNaN(St)||St<0||St>64){K(),this.writeError(t,"Max flood hops must be 0-64"),u();return}ct=await bs.post("/update_radio_config",{max_flood_hops:St},{timeout:3e4});break}case"flood.advert.interval":{const St=parseInt($);if(isNaN(St)||St!==0&&(St<3||St>48)){K(),this.writeError(t,"Flood advert interval must be 0 (off) or 3-48 hours"),u();return}ct=await bs.post("/update_radio_config",{flood_advert_interval_hours:St},{timeout:3e4});break}case"advert.interval":{const St=parseInt($);if(isNaN(St)||St!==0&&(St<1||St>10080)){K(),this.writeError(t,"Advert interval must be 0 (off) or 1-10080 minutes"),u();return}ct=await bs.post("/update_radio_config",{advert_interval_minutes:St},{timeout:3e4});break}case"log":K(),this.writeWarning(t,"Log level configuration not yet implemented"),this.writeInfo(t,"Backend endpoint /set_log_level does not exist"),u();return;default:K(),this.writeError(t,`Unknown parameter: ${T}`),this.writeLine(t,""),this.writeInfo(t,'Type "set" without arguments to see available parameters'),u();return}K();const yt=ct.data||ct;ct.success?(yt.applied&&yt.applied.length>0?this.writeSuccess(t,`Configuration updated: ${yt.applied.join(", ")}`):this.writeSuccess(t,"Configuration updated"),yt.restart_required?(this.writeLine(t,""),this.writeWarning(t,"⚠ Service restart required for changes to take effect"),this.writeInfo(t,"Run: sudo systemctl restart pymc_repeater")):yt.message&&!yt.live_update&&(this.writeLine(t,""),this.writeInfo(t,yt.message))):this.writeError(t,ct.error||"Failed to update configuration")}catch(ct){K(),this.writeError(t,`Failed to update ${T}: ${ct}`)}this.writeLine(t,""),u()}writeWarning(t,r){t.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class nPt extends H0{name="identities";description="List all identities";aliases=["id","ids"];isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching identities...");try{const T=await bs.getIdentities();u();let $=[];if(T.success&&T.data){const K=T.data,ct=K.registered||[],yt=K.configured||[];$=yt.length>0?yt:ct}else Array.isArray(T)&&($=T);$.length===0?this.writeInfo(t,"No identities found"):(this.writeSuccess(t,`Found \x1B[1m${$.length}\x1B[0m identit${$.length===1?"y":"ies"}`),t.writeln(""),this.isMobile()?$.forEach((K,ct)=>{t.writeln(`\x1B[1;36m[${ct+1}] ${K.name||"Unnamed"}\x1B[0m`),t.writeln(` \x1B[90mType:\x1B[0m ${K.type||"-"}`),t.writeln(` \x1B[90mHash:\x1B[0m ${K.hash||"-"}`),t.writeln(` \x1B[90mAddress:\x1B[0m ${K.address||"-"}`),t.writeln(` \x1B[90mRegistered:\x1B[0m ${K.registered?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ct<$.length-1&&t.writeln("")}):(t.writeln("\x1B[36m┌────┬─────────────────────────────┬───────────────┬──────┬─────────┬────────────┐\x1B[0m"),t.writeln("\x1B[36m│ # │ Name │ Type │ Hash │ Address │ Registered │\x1B[0m"),t.writeln("\x1B[36m├────┼─────────────────────────────┼───────────────┼──────┼─────────┼────────────┤\x1B[0m"),$.forEach((K,ct)=>{const yt=(ct+1).toString().padEnd(2),St=(K.name||"Unnamed").padEnd(27),Ut=(K.type||"-").padEnd(13),ne=(K.hash||"-").padEnd(4),pe=(K.address||"-").padEnd(7),me=(K.registered?"yes":"no").padEnd(10);t.writeln(`\x1B[36m│\x1B[0m ${yt} \x1B[36m│\x1B[0m \x1B[1m${St}\x1B[0m \x1B[36m│\x1B[0m ${Ut} \x1B[36m│\x1B[0m ${ne} \x1B[36m│\x1B[0m ${pe} \x1B[36m│\x1B[0m ${me} \x1B[36m│\x1B[0m`)}),t.writeln("\x1B[36m└────┴─────────────────────────────┴───────────────┴──────┴─────────┴────────────┘\x1B[0m")))}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch identities")}r()}}class iPt extends H0{name="keys";description="List transport keys";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching transport keys...");try{const T=await bs.getTransportKeys();u();const $=T.success&&T.data?T.data:T,K=Array.isArray($)?$:[];K.length===0?this.writeInfo(t,"No transport keys found"):(this.writeSuccess(t,`Found \x1B[1m${K.length}\x1B[0m transport key${K.length===1?"":"s"}`),t.writeln(""),K.forEach((ct,yt)=>{t.writeln(`\x1B[36m${(yt+1).toString().padStart(2)}.\x1B[0m \x1B[1m${ct.name||"Unnamed"}\x1B[0m`),ct.flood_policy&&t.writeln(` Policy: \x1B[90m${ct.flood_policy}\x1B[0m`),ct.parent_id&&t.writeln(` Parent: \x1B[90m${ct.parent_id}\x1B[0m`),yt{if(t.writeln(`\x1B[1;36m[${ct+1}] ${K.node_name||"Unknown"}\x1B[0m`),t.writeln(` \x1B[90mPubKey:\x1B[0m ${K.pubkey?.substring(0,8)||"----"}`),t.writeln(` \x1B[90mType:\x1B[0m ${K.contact_type||"-"}`),K.last_seen){const yt=new Date(K.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});t.writeln(` \x1B[90mLast Seen:\x1B[0m ${yt}`)}K.rssi&&t.writeln(` \x1B[90mRSSI:\x1B[0m ${K.rssi}`),K.snr&&t.writeln(` \x1B[90mSNR:\x1B[0m ${K.snr}`),t.writeln(` \x1B[90mAdverts:\x1B[0m ${K.advert_count||0}`),t.writeln(` \x1B[90mDirect:\x1B[0m ${K.zero_hop?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ct{const yt=(ct+1).toString().padEnd(2),St=(K.node_name||"Unknown").padEnd(20),Ut=(K.pubkey?.substring(0,4)||"----").padEnd(6),ne=(K.contact_type||"-").padEnd(12),pe=K.last_seen?new Date(K.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).padEnd(20):"-".padEnd(20),me=(K.rssi?`${K.rssi}`:"-").padEnd(8),we=(K.snr?`${K.snr}`:"-").padEnd(4),Ce=(K.advert_count?.toString()||"0").padEnd(6),Ve=(K.zero_hop?"yes":"no").padEnd(6);t.writeln(`\x1B[36m│\x1B[0m ${yt} \x1B[36m│\x1B[0m \x1B[1m${St}\x1B[0m \x1B[36m│\x1B[0m ${Ut} \x1B[36m│\x1B[0m ${ne} \x1B[36m│\x1B[0m ${pe} \x1B[36m│\x1B[0m ${me} \x1B[36m│\x1B[0m ${we} \x1B[36m│\x1B[0m ${Ce} \x1B[36m│\x1B[0m ${Ve} \x1B[36m│\x1B[0m`)}),t.writeln("\x1B[36m└────┴──────────────────────┴────────┴──────────────┴──────────────────────┴──────────┴──────┴────────┴────────┘\x1B[0m")),$.length>10&&(t.writeln(""),t.writeln(`\x1B[90m... and ${$.length-10} more neighbors\x1B[0m`)))}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch neighbors")}r()}}class oPt extends H0{name="acl";description="Show ACL statistics";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching ACL stats...");try{const T=await bs.getACLStats();u();const $=T.success&&T.data?T.data:T;if($&&typeof $=="object"){this.writeSuccess(t,"ACL Statistics:"),t.writeln("");const K=(ct,yt=" ")=>{if(typeof ct=="object"&&ct!==null&&!Array.isArray(ct))for(const[St,Ut]of Object.entries(ct))typeof Ut=="object"&&Ut!==null?(t.writeln(`${yt}\x1B[90m${St}:\x1B[0m`),K(Ut,yt+" ")):t.writeln(`${yt}\x1B[90m${St.padEnd(18)}\x1B[0m ${Ut}`);else t.writeln(`${yt}${ct}`)};for(const[ct,yt]of Object.entries($))typeof yt=="object"&&yt!==null?(t.writeln(` \x1B[36m${ct}\x1B[0m`),K(yt," ")):t.writeln(` \x1B[36m${ct.padEnd(20)}\x1B[0m ${yt}`)}else this.writeError(t,"No ACL data available")}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch ACL stats")}r()}}class sPt extends H0{name="rooms";description="List room servers";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching room stats...");try{const T=await bs.getRoomStats();u();let $=[];T.success&&T.data?$=T.data.rooms||(Array.isArray(T.data)?T.data:[]):Array.isArray(T)&&($=T),$.length===0?this.writeInfo(t,"No room servers found"):(this.writeSuccess(t,`Found \x1B[1m${$.length}\x1B[0m room server${$.length===1?"":"s"}`),t.writeln(""),this.isMobile()?$.forEach((K,ct)=>{t.writeln(`\x1B[1;36m[${ct+1}] ${K.room_name||"Unnamed"}\x1B[0m`),t.writeln(` \x1B[90mMessages:\x1B[0m ${K.total_messages||0}`),t.writeln(` \x1B[90mTotal Clients:\x1B[0m ${K.total_clients||0}`),t.writeln(` \x1B[90mActive Clients:\x1B[0m ${K.active_clients||0}`),t.writeln(` \x1B[90mSync:\x1B[0m ${K.sync_running?"\x1B[32mrunning\x1B[0m":"\x1B[31mstopped\x1B[0m"}`),ct<$.length-1&&t.writeln("")}):(t.writeln("\x1B[36m┌────┬─────────────────────────────┬──────────┬──────────────┬────────────────┬──────────┐\x1B[0m"),t.writeln("\x1B[36m│ # │ Room Name │ Messages │ Total Clients│ Active Clients │ Sync │\x1B[0m"),t.writeln("\x1B[36m├────┼─────────────────────────────┼──────────┼──────────────┼────────────────┼──────────┤\x1B[0m"),$.forEach((K,ct)=>{const yt=(ct+1).toString().padEnd(2),St=(K.room_name||"Unnamed").padEnd(27),Ut=(K.total_messages?.toString()||"0").padEnd(8),ne=(K.total_clients?.toString()||"0").padEnd(12),pe=(K.active_clients?.toString()||"0").padEnd(14),me=(K.sync_running?"running":"stopped").padEnd(8);t.writeln(`\x1B[36m│\x1B[0m ${yt} \x1B[36m│\x1B[0m \x1B[1m${St}\x1B[0m \x1B[36m│\x1B[0m ${Ut} \x1B[36m│\x1B[0m ${ne} \x1B[36m│\x1B[0m ${pe} \x1B[36m│\x1B[0m ${me} \x1B[36m│\x1B[0m`)}),t.writeln("\x1B[36m└────┴─────────────────────────────┴──────────┴──────────────┴────────────────┴──────────┘\x1B[0m")))}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch room stats")}r()}}class lPt extends H0{name="restart";description="Restart the pymc-repeater service";aliases=["reboot"];matches(t){const r=t.toLowerCase();return r==="restart"||r==="reboot"}async execute({term:t,writePrompt:r}){this.writeLine(t,""),this.writeLine(t,"\x1B[33m⚠️ This will restart the repeater service!\x1B[0m"),this.writeLine(t,""),this.writeInfo(t,"Attempting to restart service...");const u=this.startLoading(t,"Restarting...");try{const T=await bs.post("/restart_service",{},{timeout:1e4});u(),T.success?(this.writeLine(t,""),this.writeSuccess(t,T.message||"Service restart initiated"),this.writeLine(t,""),this.writeInfo(t,"The service will restart momentarily. You may need to refresh this page.")):(this.writeLine(t,""),this.writeError(t,"Restart failed: "+(T.error||T.message||"Unknown error")),this.writeLine(t,""),this.writeInfo(t,"You may need to manually restart: sudo systemctl restart pymc-repeater"))}catch(T){u(),this.writeLine(t,"");const $=T;if($.code==="ERR_NETWORK"||$.message?.includes("Network error")||$.message?.includes("ECONNRESET")||$.code==="ECONNRESET"){this.writeSuccess(t,"Service restart initiated successfully"),this.writeLine(t,""),await this.waitForServiceRestart(t,r);return}else $.code==="ECONNABORTED"||$.message?.includes("timeout")?(this.writeLine(t,"\x1B[33m⚠️ Request timed out - service may be restarting\x1B[0m"),this.writeLine(t,""),this.writeInfo(t,"Refresh the page in a few seconds to reconnect.")):$.response?.status===403||$.response?.status===401?(this.writeError(t,"Permission denied. Polkit rules may need configuration."),this.writeLine(t,""),this.writeInfo(t,"Run: sudo bash -c 'mkdir -p /etc/polkit-1/rules.d && cat > /etc/polkit-1/rules.d/10-pymc-repeater.rules <0;St--)t.write(`\r\x1B[36m⏳\x1B[0m Restarting service... ${St}s`),await new Promise(Ut=>setTimeout(Ut,1e3));t.write("\r\x1B[K");let K=4,ct=0;const yt="\r\x1B[36m⏳\x1B[0m Verifying restart (attempt ";for(;K<20;){ct++,t.write(`${yt}${ct})... `);try{if((await fetch(`${window.location.protocol}//${window.location.host}/api/stats`,{signal:AbortSignal.timeout(3e3)})).ok){t.write("\r\x1B[K"),this.writeLine(t,""),this.writeSuccess(t,`Service is back online! (took ~${K}s)`),this.writeLine(t,""),r();return}}catch(St){const Ut=St;Ut.code&&!["ERR_NETWORK","ECONNREFUSED","ECONNRESET"].includes(Ut.code)&&t.write(`[${Ut.code}] `)}await new Promise(St=>setTimeout(St,1*1e3)),K+=1}t.write("\r\x1B[K"),this.writeLine(t,""),this.writeLine(t,"\x1B[33m⚠️ Service did not respond within 20 seconds\x1B[0m"),this.writeLine(t,""),this.writeInfo(t,"The service may still be starting. Try: status"),this.writeLine(t,""),r()}}class cPt extends H0{name="ping";description="Ping a neighbor node to measure latency and signal quality";usage="ping [timeout_seconds]";async execute({term:t,args:r,writePrompt:u}){if(r.length===0){this.writeError(t,"Missing target node"),t.writeln(""),this.writeInfo(t,`Usage: ${this.usage}`),t.writeln(""),this.writeInfo(t,"Examples:"),this.writeInfo(t," ping MyNeighbor - Ping node by name"),this.writeInfo(t," ping 0xb5 - Ping node by pubkey hash"),this.writeInfo(t," ping MyNeighbor 20 - Ping with 20s timeout"),u();return}const T=r[0],$=r.length>1?parseInt(r[1]):10;if(isNaN($)||$<1||$>60){this.writeError(t,"Invalid timeout. Must be between 1-60 seconds"),u();return}let K=null;const ct=T.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(ct)K=`0x${ct[2].padStart(2,"0")}`;else{const St=this.startLoading(t,"Resolving target...");try{const Ut=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];let ne=!1;for(const pe of Ut)try{const me=await bs.get("/adverts_by_contact_type",{contact_type:pe,hours:168}),we=me.success&&me.data?me.data:me,Ve=(Array.isArray(we)?we:[]).find(kr=>kr.node_name&&kr.node_name.toLowerCase()===T.toLowerCase());if(Ve&&Ve.pubkey){K=`0x${Ve.pubkey.substring(0,2)}`,ne=!0;break}}catch{continue}if(St(),!ne){this.writeError(t,`Node '${T}' not found in neighbors`),t.writeln(""),this.writeInfo(t,"Try: neighbors - to list available nodes"),u();return}}catch(Ut){St(),this.writeError(t,`Failed to resolve target: ${Ut}`),u();return}}this.writeLine(t,`\x1B[36mPinging ${T} (${K}) with ${$}s timeout...\x1B[0m`),t.writeln("");const yt=this.startLoading(t,"Waiting for response...");try{const St=await bs.pingNeighbor(K,$);if(yt(),St.success&&St.data){const Ut=St.data;this.writeSuccess(t,`Reply from ${T} (${Ut.target_id})`),t.writeln("");let ne="\x1B[32m";if(Ut.rtt_ms>500?ne="\x1B[31m":Ut.rtt_ms>250&&(ne="\x1B[33m"),t.writeln(` \x1B[1mRound-Trip Time:\x1B[0m ${ne}${Ut.rtt_ms.toFixed(2)} ms\x1B[0m`),t.writeln(` \x1B[1mRSSI:\x1B[0m ${Ut.rssi} dBm`),t.writeln(` \x1B[1mSNR:\x1B[0m ${Ut.snr_db} dB`),Ut.path&&Ut.path.length>0){const we=Ut.path.join(" → "),Ce=Ut.path.length;t.writeln(` \x1B[1mPath:\x1B[0m ${we}`),t.writeln(` \x1B[1mHops:\x1B[0m ${Ce}`)}t.writeln("");let pe="Excellent",me="\x1B[32m";Ut.rtt_ms>500||Ut.rssi<-120?(pe="Poor",me="\x1B[31m"):Ut.rtt_ms>250||Ut.rssi<-100?(pe="Fair",me="\x1B[33m"):(Ut.rtt_ms>100||Ut.rssi<-80)&&(pe="Good",me="\x1B[36m"),t.writeln(` \x1B[1mLink Quality:\x1B[0m ${me}${pe}\x1B[0m`)}else this.writeError(t,St.error||"Ping failed")}catch(St){yt(),this.writeError(t,`Ping failed: ${St.message||St}`)}t.writeln(""),u()}}async function rj(){try{const e=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"],t=[];for(const r of e)try{const u=await bs.get("/adverts_by_contact_type",{contact_type:r,hours:168}),T=u.success&&u.data?u.data:u;(Array.isArray(T)?T:[]).forEach(K=>{K.node_name&&!t.includes(K.node_name)&&t.push(K.node_name)})}catch{continue}return t.sort()}catch{return[]}}class uPt{commands=[];constructor(){const t=new KLt,r=new YLt,u=new XLt,T=new JLt,$=new QLt,K=new tPt,ct=new ePt,yt=new rPt,St=new nPt,Ut=new iPt,ne=new aPt,pe=new oPt,me=new sPt,we=new lPt,Ce=new cPt,Ve=new ZLt([t,r,u,T,$,K,ct,yt,St,Ut,ne,pe,me,we,Ce]);this.commands=[Ve,t,r,u,T,$,K,ct,yt,St,Ut,ne,pe,me,we,Ce]}findCommand(t){return this.commands.find(r=>r.matches(t))}getAllCommands(){return this.commands}getCommandNames(){return this.commands.map(t=>t.name)}}const MW="theme-preference",Cv=li("dark"),nj=li(!1);function EW(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function hPt(){if(nj.value)return;const e=localStorage.getItem(MW);e&&(e==="light"||e==="dark")?Cv.value=e:window.matchMedia("(prefers-color-scheme: light)").matches?Cv.value="light":Cv.value="dark",EW(Cv.value),nj.value=!0}typeof window<"u"&&hPt();Fh(Cv,e=>{localStorage.setItem(MW,e),EW(e)});function LW(){return{theme:Cv,toggleTheme:()=>{Cv.value=Cv.value==="dark"?"light":"dark"},setTheme:u=>{Cv.value=u},isDark:()=>Cv.value==="dark"}}const dPt={class:"space-y-4 md:space-y-6"},fPt={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-3 md:p-4"},pPt={class:"flex items-center justify-between"},mPt={class:"flex items-center gap-2 md:gap-3"},gPt=["title"],vPt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},yPt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_Pt={class:"hidden sm:inline"},xPt=["title"],bPt={class:"hidden sm:inline"},wPt=["title"],kPt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},TPt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},SPt={class:"hidden sm:inline"},CPt={key:0,class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-4"},APt={class:"flex items-center gap-3"},MPt=["onKeydown"],EPt={key:1,class:"absolute top-4 right-4 bg-black/80 backdrop-blur-sm px-3 py-2 rounded-lg border border-primary/30 flex items-center gap-2"},LPt=Cc({name:"TerminalView",__name:"Terminal",setup(e){const{theme:t}=LW(),r={background:"#1A1E1F",foreground:"#e0e0e0",cursor:"#00d9ff",cursorAccent:"#000000",selectionBackground:"#00d9ff40",selectionForeground:"#ffffff",black:"#000000",red:"#ff6b6b",green:"#51cf66",yellow:"#ffd93d",blue:"#00d9ff",magenta:"#e599f7",cyan:"#00d9ff",white:"#e0e0e0",brightBlack:"#6c757d",brightRed:"#ff8787",brightGreen:"#69db7c",brightYellow:"#ffe066",brightBlue:"#74c0fc",brightMagenta:"#f3a6ff",brightCyan:"#3bc9db",brightWhite:"#ffffff"},u={background:"#F3F4F6",foreground:"#1f2937",cursor:"#0D7377",cursorAccent:"#ffffff",selectionBackground:"#0D737740",selectionForeground:"#000000",black:"#1f2937",red:"#dc2626",green:"#15803d",yellow:"#a16207",blue:"#0D7377",magenta:"#7c3aed",cyan:"#0e7490",white:"#f3f4f6",brightBlack:"#6b7280",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#0891b2",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"},T=li(null),$=li(null),K=li(null),ct=li(""),yt=li(!1),St=li(!1),Ut=li(!1),ne=li(!1),pe=li(!1);li(0);let me=null,we=null,Ce=null,Ve="";const kr=[];let It=-1,rn="";const Lr=new uPt,Mr=Lr.getCommandNames();let tn=[],Dn=0;const Mn={get:["name","role","lat","lon","freq","tx","bw","sf","cr","radio","txdelay","direct.txdelay","rxdelay","af","mode","repeat","flood.max","advert.interval","duty","duty.max","public.key"],set:["tx","freq","bw","sf","cr","txdelay","direct.txdelay","rxdelay","name","lat","lon","mode","duty","flood.max","advert.interval","flood.advert.interval"],ping:[]},Br={set:{mode:["forward","monitor"],duty:["on","off"]}},Vn={get:{name:"Node name",role:"Node role",lat:"Latitude",lon:"Longitude",freq:"Frequency (MHz)",tx:"TX power (dBm)",bw:"Bandwidth (kHz)",sf:"Spreading factor",cr:"Coding rate",radio:"All radio settings",txdelay:"TX delay factor","direct.txdelay":"Direct TX delay",rxdelay:"RX delay base",af:"Airtime factor",mode:"Repeater mode",repeat:"Repeat on/off","flood.max":"Max flood hops","advert.interval":"Advert interval",duty:"Duty cycle enabled","duty.max":"Max airtime %","public.key":"Public key"},set:{tx:"TX power (2-30 dBm)",freq:"Frequency (100-1000 MHz) *restart required*",bw:"Bandwidth (7.8-500 kHz) *restart required*",sf:"Spreading factor (5-12) *restart required*",cr:"Coding rate (5-8) *restart required*",txdelay:"TX delay factor (0.0-5.0)","direct.txdelay":"Direct TX delay (0.0-5.0)",rxdelay:"RX delay base (>= 0)",name:"Node name",lat:"Latitude (-90 to 90)",lon:"Longitude (-180 to 180)",mode:"Repeater mode (forward/monitor)",duty:"Duty cycle (on/off)","flood.max":"Max flood hops (0-64)","advert.interval":"Advert interval (0 or 1-10080 mins)","flood.advert.interval":"Flood advert (0 or 3-48 hrs)"},ping:{}};Xd(()=>{if(!T.value)return;Ut.value=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const hi=window.innerWidth<768;me=new XMt({cursorBlink:!1,cursorStyle:"underline",cursorWidth:3,fontFamily:'"JetBrains Mono", "Fira Code", Menlo, Monaco, "Courier New", monospace',fontSize:hi?11:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.3,letterSpacing:.5,smoothScrollDuration:50,scrollSensitivity:3,fastScrollSensitivity:5,allowProposedApi:!0,screenReaderMode:Ut.value,theme:t.value==="dark"?r:u,scrollback:1e4,tabStopWidth:4,macOptionIsMeta:!0}),we=new t9t,me.loadAddon(we);try{const Ha=new GLt;me.loadAddon(Ha)}catch{console.warn("WebGL addon failed to load, falling back to canvas renderer")}const aa=new o9t((Ha,qa)=>{window.open(qa,"_blank")});me.loadAddon(aa);const io=new dEt;if(me.loadAddon(io),me.unicode.activeVersion="11",Ce=new N9t,me.loadAddon(Ce),me.open(T.value),we.fit(),me.focus(),Ut.value&&$.value){const Ha=$.value,qa=()=>{Ha.focus({preventScroll:!1})};T.value?.addEventListener("click",qa),T.value?.addEventListener("touchstart",qa),Ha.addEventListener("input",()=>{setTimeout(()=>{me?.scrollToBottom()},10)}),Dv(()=>{T.value?.removeEventListener("click",qa),T.value?.removeEventListener("touchstart",qa)})}const oo=t.value==="dark"?"\x1B[1;37m":"\x1B[1;90m",xa=(t.value==="dark","\x1B[1;36m"),Ur=(t.value==="dark","\x1B[90m"),Sn="\x1B[36m",Hn="\x1B[0m";me.writeln(""),me.writeln(`${oo} ██████ ██ ██ ███ ███ ██████${Hn}`),me.writeln(`${oo} ██ ██ ██ ██ ████ ████ ██ ${Hn}`),me.writeln(`${oo} ██████ ████ ██ ████ ██ ██ ${Hn}`),me.writeln(`${oo} ██ ██ ██ ██ ██ ██ ${Hn}`),me.writeln(`${oo} ██ ██ ██ ██ ██████${Hn}`),me.writeln(""),me.writeln(`${xa} Repeater Terminal${Hn}`),me.writeln(""),me.writeln(`${Ur} Type ${Sn}help${Ur} for available commands${Hn}`),me.writeln(""),on(),me.onData(Ha=>{Sr(Ha)});const Qa=new ResizeObserver(()=>{we?.fit()});Qa.observe(T.value),Dv(()=>{Qa.disconnect(),me?.dispose()})});const on=()=>{me?.write(`\r -\x1B[1;36m❯\x1B[0m `)},pr=hi=>{if(!(!me||!hi)){me.write(`\x1B[90m${hi}\x1B[0m`);for(let aa=0;aa{if(!(!me||!rn)){for(let hi=0;hi{if(!me)return;const aa=hi.charCodeAt(0);if(aa===13){_r(),me.write(`\r -`),Ve.trim()?(nn(Ve.trim()),kr.push(Ve.trim()),It=kr.length):on(),Ve="";return}if(aa===127){Ve.length>0&&(_r(),Ve=Ve.slice(0,-1),me.write("\b \b"),Dr());return}if(aa===3){_r(),me.write(`^C\r -`),Ve="",on();return}if(aa===12){me.clear(),Ve="",on();return}if(aa===6){yt.value=!yt.value;return}if(hi==="\x1B[A"){kr.length>0&&It>0&&(_r(),It--,me.write("\r\x1B[K"),on(),Ve=kr[It],me.write(Ve));return}if(hi==="\x1B[B"){_r(),It2&&Br[xa]){const Hn=oo[1]?.toLowerCase(),Qa=oo.slice(2).join(" ").toLowerCase(),Ha=Br[xa][Hn];if(Ha){const qa=Ha.filter(Mo=>Mo.toLowerCase().startsWith(Qa));if(qa.length===1){const Mo=oo.slice(2).join(" "),Wo=qa[0].slice(Mo.length);Ve+=Wo,me.write(Wo)}else qa.length>1&&(me.write(`\r +}`,E1=8,EM=E1*Float32Array.BYTES_PER_ELEMENT,kLt=20*E1,jN=class{constructor(){this.attributes=new Float32Array(kLt),this.count=0}},w1=0,UN=0,$N=0,HN=0,VN=0,WN=0,qN=0,TLt=class extends Ug{constructor(e,t,r,u){super(),this._terminal=e,this._gl=t,this._dimensions=r,this._themeService=u,this._vertices=new jN,this._verticesCursor=new jN;let T=this._gl;this._program=wp(TW(T,bLt,wLt)),this._register(N0(()=>T.deleteProgram(this._program))),this._projectionLocation=wp(T.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);let $=new Float32Array([0,0,1,0,0,1,1,1]),K=T.createBuffer();this._register(N0(()=>T.deleteBuffer(K))),T.bindBuffer(T.ARRAY_BUFFER,K),T.bufferData(T.ARRAY_BUFFER,$,T.STATIC_DRAW),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let ct=new Uint8Array([0,1,2,3]),yt=T.createBuffer();this._register(N0(()=>T.deleteBuffer(yt))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,yt),T.bufferData(T.ELEMENT_ARRAY_BUFFER,ct,T.STATIC_DRAW),this._attributesBuffer=wp(T.createBuffer()),this._register(N0(()=>T.deleteBuffer(this._attributesBuffer))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,T.FLOAT,!1,EM,0),T.vertexAttribDivisor(0,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,EM,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,4,T.FLOAT,!1,EM,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(2,1),this._updateCachedColors(u.colors),this._register(this._themeService.onChangeColors(St=>{this._updateCachedColors(St),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,kW),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,r=this._vertices,u=1,T,$,K,ct,yt,St,Ut,ne,pe,me,we;for(T=0;T>24&255)/255,VN=(w1>>16&255)/255,WN=(w1>>8&255)/255,qN=1,this._addRectangle(e.attributes,t,UN,$N,($-T)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,HN,VN,WN,qN)}_addRectangle(e,t,r,u,T,$,K,ct,yt,St){e[t]=r/this._dimensions.device.canvas.width,e[t+1]=u/this._dimensions.device.canvas.height,e[t+2]=T/this._dimensions.device.canvas.width,e[t+3]=$/this._dimensions.device.canvas.height,e[t+4]=K,e[t+5]=ct,e[t+6]=yt,e[t+7]=St}_addRectangleFloat(e,t,r,u,T,$,K){e[t]=r/this._dimensions.device.canvas.width,e[t+1]=u/this._dimensions.device.canvas.height,e[t+2]=T/this._dimensions.device.canvas.width,e[t+3]=$/this._dimensions.device.canvas.height,e[t+4]=K[0],e[t+5]=K[1],e[t+6]=K[2],e[t+7]=K[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},SLt=class extends Ug{constructor(e,t,r,u,T,$,K,ct){super(),this._container=t,this._alpha=T,this._coreBrowserService=$,this._optionsService=K,this._themeService=ct,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=u.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(yt=>{this._refreshCharAtlas(e,yt),this.reset(e)})),this._register(N0(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=wp(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,r){}handleSelectionChanged(e,t,r,u=!1){}_setTransparency(e,t){if(t===this._alpha)return;let r=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=bW(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,r,u){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,r*this._deviceCellWidth,u*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,r*this._deviceCellWidth,u*this._deviceCellHeight))}_fillCharTrueColor(e,t,r,u){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=cW,this._clipCell(r,u,t.getWidth()),this._ctx.fillText(t.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,u*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,r){let u=t?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${u} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},CLt=class extends SLt{constructor(e,t,r,u,T,$,K){super(r,e,"link",t,!0,T,$,K),this._register(u.onShowLinkUnderline(ct=>this._handleShowLinkUnderline(ct))),this._register(u.onHideLinkUnderline(ct=>this._handleHideLinkUnderline(ct)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&lLt(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t=0;rw.indexOf("AppleWebKit")>=0;var MLt=rw.indexOf("Chrome")>=0;!MLt&&rw.indexOf("Safari")>=0;rw.indexOf("Electron/")>=0;rw.indexOf("Android")>=0;var LM=!1;if(typeof Px.matchMedia=="function"){let e=Px.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Px.matchMedia("(display-mode: fullscreen)");LM=e.matches,ALt(Px,e,({matches:r})=>{LM&&t.matches||(LM=r)})}var E2="en",PM=!1,CW=!1,fT,FT=E2,GN=E2,ELt,A1,Nx=globalThis,qm;typeof Nx.vscode<"u"&&typeof Nx.vscode.process<"u"?qm=Nx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(qm=process);var LLt=typeof qm?.versions?.electron=="string",PLt=LLt&&qm?.type==="renderer";if(typeof qm=="object"){qm.platform,qm.platform,PM=qm.platform==="linux",PM&&qm.env.SNAP&&qm.env.SNAP_REVISION,qm.env.CI||qm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,fT=E2,FT=E2;let e=qm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);fT=t.userLocale,GN=t.osLocale,FT=t.resolvedLanguage||E2,ELt=t.languagePack?.translationsConfigFile}catch{}CW=!0}else typeof navigator=="object"&&!PLt?(A1=navigator.userAgent,A1.indexOf("Windows")>=0,A1.indexOf("Macintosh")>=0,(A1.indexOf("Macintosh")>=0||A1.indexOf("iPad")>=0||A1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,PM=A1.indexOf("Linux")>=0,A1?.indexOf("Mobi")>=0,FT=globalThis._VSCODE_NLS_LANGUAGE||E2,fT=navigator.language.toLowerCase(),GN=fT):console.error("Unable to resolve platform.");var ZN=CW,Rv=A1,qy=FT,ILt;(e=>{function t(){return qy}e.value=t;function r(){return qy.length===2?qy==="en":qy.length>=3?qy[0]==="e"&&qy[1]==="n"&&qy[2]==="-":!1}e.isDefaultVariant=r;function u(){return qy==="en"}e.isDefault=u})(ILt||={});var DLt=typeof Nx.postMessage=="function"&&!Nx.importScripts;(()=>{if(DLt){let e=[];Nx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let u=0,T=e.length;u{let u=++t;e.push({id:u,callback:r}),Nx.postMessage({vscodeScheduleAsyncWork:u},"*")}}return e=>setTimeout(e)})();var zLt=!!(Rv&&Rv.indexOf("Chrome")>=0);Rv&&Rv.indexOf("Firefox")>=0;!zLt&&Rv&&Rv.indexOf("Safari")>=0;Rv&&Rv.indexOf("Edg/")>=0;Rv&&Rv.indexOf("Android")>=0;var w2=typeof navigator=="object"?navigator:{};ZN||document.queryCommandSupported&&document.queryCommandSupported("copy")||w2&&w2.clipboard&&w2.clipboard.writeText,ZN||w2&&w2.clipboard&&w2.clipboard.readText;var EL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},IM=new EL,KN=new EL,YN=new EL;new Array(230);var OLt;(e=>{function t(ct){return IM.keyCodeToStr(ct)}e.toString=t;function r(ct){return IM.strToKeyCode(ct)}e.fromString=r;function u(ct){return KN.keyCodeToStr(ct)}e.toUserSettingsUS=u;function T(ct){return YN.keyCodeToStr(ct)}e.toUserSettingsGeneral=T;function $(ct){return KN.strToKeyCode(ct)||YN.strToKeyCode(ct)}e.fromUserSettings=$;function K(ct){if(ct>=98&&ct<=113)return null;switch(ct){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return IM.keyCodeToStr(ct)}e.toElectronAccelerator=K})(OLt||={});var AW=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),BLt;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof RLt?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:N1.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:AW})})(BLt||={});var RLt=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?AW:(this._emitter||(this._emitter=new Yd),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},FLt;(e=>{async function t(u){let T,$=await Promise.all(u.map(K=>K.then(ct=>ct,ct=>{T||(T=ct)})));if(typeof T<"u")throw T;return $}e.settled=t;function r(u){return new Promise(async(T,$)=>{try{await u(T,$)}catch(K){$(K)}})}e.withAsyncBody=r})(FLt||={});var XN=class pg{static fromArray(t){return new pg(r=>{r.emitMany(t)})}static fromPromise(t){return new pg(async r=>{r.emitMany(await t)})}static fromPromises(t){return new pg(async r=>{await Promise.all(t.map(async u=>r.emitOne(await u)))})}static merge(t){return new pg(async r=>{await Promise.all(t.map(async u=>{for await(let T of u)r.emitOne(T)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Yd,queueMicrotask(async()=>{let u={emitOne:T=>this.emitOne(T),emitMany:T=>this.emitMany(T),reject:T=>this.reject(T)};try{await Promise.resolve(t(u)),this.resolve()}catch(T){this.reject(T)}finally{u.emitOne=void 0,u.emitMany=void 0,u.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new pg(async u=>{for await(let T of t)u.emitOne(r(T))})}map(t){return pg.map(this,t)}static filter(t,r){return new pg(async u=>{for await(let T of t)r(T)&&u.emitOne(T)})}filter(t){return pg.filter(this,t)}static coalesce(t){return pg.filter(t,r=>!!r)}coalesce(){return pg.coalesce(this)}static async toPromise(t){let r=[];for await(let u of t)r.push(u);return r}toPromise(){return pg.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};XN.EMPTY=XN.fromArray([]);var{getWindow:NLt}=function(){let e=new Map,t={window:Px,disposables:new O2};e.set(Px.vscodeWindowId,t);let r=new Yd,u=new Yd,T=new Yd;function $(K,ct){return(typeof K=="number"?e.get(K):void 0)??(ct?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:T.event,onDidUnregisterWindow:u.event,registerWindow(K){if(e.has(K.vscodeWindowId))return Ug.None;let ct=new O2,yt={window:K,disposables:ct.add(new O2)};return e.set(K.vscodeWindowId,yt),ct.add(N0(()=>{e.delete(K.vscodeWindowId),u.fire(K)})),ct.add(fE(K,ULt.BEFORE_UNLOAD,()=>{T.fire(K)})),r.fire(yt),ct},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(K){return K.vscodeWindowId},hasWindow(K){return e.has(K)},getWindowById:$,getWindow(K){let ct=K;if(ct?.ownerDocument?.defaultView)return ct.ownerDocument.defaultView.window;let yt=K;return yt?.view?yt.view.window:Px},getDocument(K){return NLt(K).document}}}(),jLt=class{constructor(e,t,r,u){this._node=e,this._type=t,this._handler=r,this._options=u||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function fE(e,t,r,u){return new jLt(e,t,r,u)}var ULt={BEFORE_UNLOAD:"beforeunload"},$Lt=class extends Ug{constructor(e,t,r,u,T,$,K,ct,yt){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=r,this._coreBrowserService=u,this._coreService=T,this._decorationService=$,this._optionsService=K,this._themeService=ct,this._cursorBlinkStateManager=new Q3,this._charAtlasDisposable=this._register(new Q3),this._observerDisposable=this._register(new Q3),this._model=new xLt,this._workCell=new FN,this._workCell2=new FN,this._rectangleRenderer=this._register(new Q3),this._glyphRenderer=this._register(new Q3),this._onChangeTextureAtlas=this._register(new Yd),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Yd),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Yd),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Yd),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Yd),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let St={antialias:!1,depth:!1,preserveDrawingBuffer:yt};if(this._gl=this._canvas.getContext("webgl2",St),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new OEt(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new CLt(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,K,this._themeService)],this.dimensions=DEt(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(K.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(fE(this._canvas,"webglcontextlost",Ut=>{console.log("webglcontextlost event received"),Ut.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Ut)},3e3)})),this._register(fE(this._canvas,"webglcontextrestored",Ut=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,BN(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=RN(this._canvas,this._coreBrowserService.window,(Ut,ne)=>this._setCanvasDevicePixelDimensions(Ut,ne)),this._register(this._coreBrowserService.onWindowChange(Ut=>{this._observerDisposable.value=RN(this._canvas,Ut,(ne,pe)=>this._setCanvasDevicePixelDimensions(ne,pe))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(N0(()=>{for(let Ut of this._renderLayers)Ut.dispose();this._canvas.parentElement?.removeChild(this._canvas),BN(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,r){for(let u of this._renderLayers)u.handleSelectionChanged(this._terminal,e,t,r);this._model.selection.update(this._core,e,t,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new TLt(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new gLt(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=bW(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=iW(N1.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),N1.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new cLt(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let r=this._core,u=this._workCell,T,$,K,ct,yt,St,Ut=0,ne=!0,pe,me,we,Ce,Ve,kr,It,rn,Lr;e=JN(e,r.rows-1,0),t=JN(t,r.rows-1,0);let Mr=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",tn=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Dn=tn-r.buffer.ydisp,Mn=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),Br=-1,Vn=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let on=!1;for($=e;$<=t;$++)for(K=$+r.buffer.ydisp,ct=r.buffer.lines.get(K),this._model.lineLengths[$]=0,we=tn===K,Ut=0,yt=this._characterJoinerService.getJoinedCharacters(K),rn=0;rn=Ut,pe=rn,yt.length>0&&rn===yt[0][0]&&ne){me=yt.shift();let pr=this._model.selection.isCellSelected(this._terminal,me[0],K);for(It=me[0]+1;It=me[1],ne?(St=!0,u=new HLt(u,ct.translateToString(!0,me[0],me[1]),me[1]-me[0]),pe=me[1]-1):Ut=me[1]}if(Ce=u.getChars(),Ve=u.getCode(),It=($*r.cols+rn)*gS,this._cellColorResolver.resolve(u,rn,K,this.dimensions.device.cell.width),Vn&&K===tn&&(rn===Mn&&(this._model.cursor={x:Mn,y:Dn,width:u.getWidth(),style:this._coreBrowserService.isFocused?Mr:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},Br=Mn+u.getWidth()-1),rn>=Mn&&rn<=Br&&(this._coreBrowserService.isFocused&&Mr==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),Ve!==0&&(this._model.lineLengths[$]=rn+1),!(this._model.cells[It]===Ve&&this._model.cells[It+BT]===this._cellColorResolver.result.bg&&this._model.cells[It+RT]===this._cellColorResolver.result.fg&&this._model.cells[It+MM]===this._cellColorResolver.result.ext)&&(on=!0,Ce.length>1&&(Ve|=_Lt),this._model.cells[It]=Ve,this._model.cells[It+BT]=this._cellColorResolver.result.bg,this._model.cells[It+RT]=this._cellColorResolver.result.fg,this._model.cells[It+MM]=this._cellColorResolver.result.ext,kr=u.getWidth(),this._glyphRenderer.value.updateCell(rn,$,Ve,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Ce,kr,T),St)){for(u=this._workCell,rn++;rn<=pe;rn++)Lr=($*r.cols+rn)*gS,this._glyphRenderer.value.updateCell(rn,$,0,0,0,0,CEt,0,0),this._model.cells[Lr]=0,this._model.cells[Lr+BT]=this._cellColorResolver.result.bg,this._model.cells[Lr+RT]=this._cellColorResolver.result.fg,this._model.cells[Lr+MM]=this._cellColorResolver.result.ext;rn--}}on&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},HLt=class extends M2{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function JN(e,t,r=0){return Math.max(Math.min(e,t),r)}var QN="di$target",tj="di$dependencies",DM=new Map;function Fv(e){if(DM.has(e))return DM.get(e);let t=function(r,u,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");VLt(t,r,T)};return t._id=e,DM.set(e,t),t}function VLt(e,t,r){t[QN]===t?t[tj].push({id:e,index:r}):(t[tj]=[{id:e,index:r}],t[QN]=t)}Fv("BufferService");Fv("CoreMouseService");Fv("CoreService");Fv("CharsetService");Fv("InstantiationService");Fv("LogService");var WLt=Fv("OptionsService");Fv("OscLinkService");Fv("UnicodeService");Fv("DecorationService");var qLt={trace:0,debug:1,info:2,warn:3,error:4,off:5},GLt="xterm.js: ",ej=class extends Ug{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=qLt[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis.activate(e)));return}this._terminal=e;let r=t.coreService,u=t.optionsService,T=t,$=T._renderService,K=T._characterJoinerService,ct=T._charSizeService,yt=T._coreBrowserService,St=T._decorationService;T._logService;let Ut=T._themeService;this._renderer=this._register(new $Lt(e,K,ct,yt,r,St,u,Ut,this._preserveDrawingBuffer)),this._register(N1.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(N1.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(N1.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(N1.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),$.setRenderer(this._renderer),this._register(N0(()=>{if(this._terminal._core._store._isDisposed)return;let ne=this._terminal._core._renderService;ne.setRenderer(this._terminal._core._createRenderer()),ne.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};class H0{aliases;usage;matches(t){const r=t.toLowerCase();return r===this.name.toLowerCase()||(this.aliases?.some(u=>r===u.toLowerCase())??!1)}writeLine(t,r,u){u?t.writeln(`${u}${r}\x1B[0m`):t.writeln(r)}writeSuccess(t,r){t.writeln(`\x1B[1;32m✓\x1B[0m ${r}`)}writeError(t,r){t.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${r}`)}writeInfo(t,r){t.writeln(`\x1B[90m${r}\x1B[0m`)}startLoading(t,r){const u=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];let T=0,$=!0;const K=setInterval(()=>{if(!$){clearInterval(K);return}t.write(`\r\x1B[36m${u[T]}\x1B[0m ${r}`),T=(T+1)%u.length},80);return()=>{$=!1,clearInterval(K),t.write("\r\x1B[K")}}}class KLt extends H0{constructor(t){super(),this.commands=t}name="help";description="Show available commands";aliases=["?","h"];execute({term:t,writePrompt:r}){t.writeln(""),t.writeln("\x1B[1;33mAvailable Commands:\x1B[0m"),t.writeln(""),this.commands.forEach(u=>{const T=u.aliases?.length?` (${u.aliases.join(", ")})`:"";t.writeln(` \x1B[1;36m${u.name.padEnd(15)}\x1B[0m ${u.description}${T}`)}),t.writeln(""),t.writeln("\x1B[90mTip: Use Tab for autocomplete, ↑↓ for history, Ctrl+F to search\x1B[0m"),r()}}class YLt extends H0{name="clear";description="Clear terminal screen";aliases=["cls"];execute({term:t,writePrompt:r}){t.clear(),r()}}class XLt extends H0{name="status";description="Show repeater status";aliases=["st"];async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching status...");try{const T=await bs.get("/stats");u();const $=T.success&&T.data?T.data:T;if($&&typeof $=="object"){this.writeSuccess(t,"Repeater Status:"),t.writeln("");for(const[K,ct]of Object.entries($))t.writeln(` \x1B[36m${K.padEnd(20)}\x1B[0m ${ct}`)}else this.writeError(t,"No status data available")}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch status")}r()}}class JLt extends H0{name="uptime";description="Show system uptime";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching uptime...");try{const T=await bs.get("/stats");u();const K=(T.data||T).uptime_seconds||0,ct=this.formatUptime(K);this.writeSuccess(t,ct)}catch(T){u(),this.writeError(t,`Failed to get uptime: ${T}`)}r()}formatUptime(t){const r=Math.floor(t/86400),u=Math.floor(t%86400/3600),T=Math.floor(t%3600/60);return r>0?`${r}d ${u}h ${T}m`:u>0?`${u}h ${T}m`:`${T}m`}}class QLt extends H0{name="packets";description="Show packet statistics";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching packet stats...");try{const T=await bs.get("/stats");u();const $=T.data||T;this.writeLine(t,""),this.isMobile()?(this.writeLine(t," \x1B[1;36mPacket Statistics\x1B[0m"),this.writeLine(t," \x1B[90mRX:\x1B[0m "+($.rx_count||0)),this.writeLine(t," \x1B[90mTX:\x1B[0m "+($.tx_count||0)),this.writeLine(t," \x1B[90mForward:\x1B[0m "+($.forwarded_count||0)),this.writeLine(t," \x1B[90mDropped:\x1B[0m "+($.dropped_count||0))):(this.writeLine(t," \x1B[36m┌──────────┬──────────┐\x1B[0m"),this.writeLine(t," \x1B[36m│\x1B[0m \x1B[1mMetric\x1B[0m \x1B[36m│\x1B[0m \x1B[1mCount\x1B[0m \x1B[36m│\x1B[0m"),this.writeLine(t," \x1B[36m├──────────┼──────────┤\x1B[0m"),this.writeLine(t,` \x1B[36m│\x1B[0m RX \x1B[36m│\x1B[0m ${String($.rx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t,` \x1B[36m│\x1B[0m TX \x1B[36m│\x1B[0m ${String($.tx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t,` \x1B[36m│\x1B[0m Forward \x1B[36m│\x1B[0m ${String($.forwarded_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t,` \x1B[36m│\x1B[0m Dropped \x1B[36m│\x1B[0m ${String($.dropped_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(t," \x1B[36m└──────────┴──────────┘\x1B[0m")),this.writeLine(t,"")}catch(T){u(),this.writeError(t,`Failed to get packet stats: ${T}`)}r()}}class tPt extends H0{name="board";description="Show board information";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching board info...");try{const T=await bs.get("/stats");u();const K=(T.data||T).board_info||"pyMC_Repeater (Linux/RPi)";this.writeSuccess(t,K)}catch{u(),this.writeSuccess(t,"pyMC_Repeater (Linux/RPi)")}r()}}class ePt extends H0{name="advert";description="Send neighbor advert immediately";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Sending advert...");try{const T=await bs.post("/send_advert",{},{timeout:1e4});u(),T.success?this.writeSuccess(t,T.data||"Advert sent successfully"):this.writeError(t,T.error||"Failed to send advert")}catch(T){u(),this.writeError(t,`Failed to send advert: ${T}`)}r()}}class rPt extends H0{name="get";description="Get configuration values (name, freq, tx, mode, duty, etc.)";matches(t){const r=t.toLowerCase();return r==="get"||r.startsWith("get ")}async execute({term:t,args:r,writePrompt:u}){const T=r[0]?.toLowerCase();if(!T){this.writeError(t,"Usage: get "),this.writeLine(t,""),this.writeInfo(t,"Available parameters:"),this.writeLine(t,""),this.writeLine(t," \x1B[36mname\x1B[0m Node name"),this.writeLine(t," \x1B[36mrole\x1B[0m Node role"),this.writeLine(t," \x1B[36mlat\x1B[0m Latitude"),this.writeLine(t," \x1B[36mlon\x1B[0m Longitude"),this.writeLine(t," \x1B[36mfreq\x1B[0m Frequency (MHz)"),this.writeLine(t," \x1B[36mtx\x1B[0m TX power (dBm)"),this.writeLine(t," \x1B[36mbw\x1B[0m Bandwidth (kHz)"),this.writeLine(t," \x1B[36msf\x1B[0m Spreading factor"),this.writeLine(t," \x1B[36mcr\x1B[0m Coding rate"),this.writeLine(t," \x1B[36mradio\x1B[0m All radio settings"),this.writeLine(t," \x1B[36mtxdelay\x1B[0m TX delay factor"),this.writeLine(t," \x1B[36mdirect.txdelay\x1B[0m Direct TX delay"),this.writeLine(t," \x1B[36mrxdelay\x1B[0m RX delay base"),this.writeLine(t," \x1B[36maf\x1B[0m Airtime factor"),this.writeLine(t," \x1B[36mmode\x1B[0m Repeater mode"),this.writeLine(t," \x1B[36mrepeat\x1B[0m Repeat on/off"),this.writeLine(t," \x1B[36mflood.max\x1B[0m Max flood hops"),this.writeLine(t," \x1B[36madvert.interval\x1B[0m Advert interval"),this.writeLine(t," \x1B[36mduty\x1B[0m Duty cycle enabled"),this.writeLine(t," \x1B[36mduty.max\x1B[0m Max airtime %"),this.writeLine(t," \x1B[36mpublic.key\x1B[0m Public key"),this.writeLine(t,""),u();return}const $=this.startLoading(t,"Fetching configuration...");try{const K=await bs.get("/stats");$();const ct=K.data||K,yt=ct.config||{},St=yt.radio||{},Ut=yt.repeater||{},ne=yt.delays||{},pe=yt.duty_cycle||{};let me="";switch(T){case"name":me=yt.node_name||"Unknown";break;case"role":me="repeater";break;case"lat":me=Ut.latitude!=null?String(Ut.latitude):"not set";break;case"lon":me=Ut.longitude!=null?String(Ut.longitude):"not set";break;case"freq":me=St.frequency?`${(St.frequency/1e6).toFixed(3)} MHz`:"?";break;case"tx":me=St.tx_power!=null?`${St.tx_power}dBm`:"?";break;case"bw":me=St.bandwidth?`${St.bandwidth/1e3} kHz`:"?";break;case"sf":me=St.spreading_factor!=null?String(St.spreading_factor):"?";break;case"cr":me=St.coding_rate!=null?`4/${St.coding_rate}`:"?";break;case"radio":if(St.frequency){this.writeSuccess(t,"Radio Configuration:"),this.writeLine(t,""),this.writeLine(t,` \x1B[36mFrequency:\x1B[0m ${(St.frequency/1e6).toFixed(3)} MHz`),this.writeLine(t,` \x1B[36mBandwidth:\x1B[0m ${St.bandwidth/1e3} kHz`),this.writeLine(t,` \x1B[36mSpreading Factor:\x1B[0m ${St.spreading_factor}`),this.writeLine(t,` \x1B[36mCoding Rate:\x1B[0m 4/${St.coding_rate}`),this.writeLine(t,` \x1B[36mTX Power:\x1B[0m ${St.tx_power}dBm`),this.writeLine(t,""),u();return}else me="Radio configuration not available";break;case"af":case"txdelay":me=ne.tx_delay_factor!=null?String(ne.tx_delay_factor):"\x1B[90mnot set (default: 1.0)\x1B[0m";break;case"direct.txdelay":me=ne.direct_tx_delay_factor!=null?String(ne.direct_tx_delay_factor):"\x1B[90mnot set (default: 0.5)\x1B[0m";break;case"rxdelay":me=ne.rx_delay_base!=null?`${ne.rx_delay_base}s`:"\x1B[90mnot set (default: 0.0s)\x1B[0m";break;case"mode":me=Ut.mode!=null?Ut.mode:"\x1B[90mnot set (default: forward)\x1B[0m";break;case"repeat":Ut.mode!=null?me=Ut.mode==="forward"?"on":"off":me="\x1B[90mnot set (default: on)\x1B[0m";break;case"flood.max":me=Ut.max_flood_hops!=null?String(Ut.max_flood_hops):"\x1B[90mnot set (default: 3)\x1B[0m";break;case"flood.advert.interval":me=Ut.send_advert_interval_hours!=null?`${Ut.send_advert_interval_hours}h`:"\x1B[90mnot set\x1B[0m";break;case"advert.interval":me=Ut.advert_interval_minutes!=null?`${Ut.advert_interval_minutes}m`:"\x1B[90mnot set (default: 120m)\x1B[0m";break;case"duty":case"duty.enabled":me=pe.enforcement_enabled!=null?pe.enforcement_enabled?"on":"off":"\x1B[90mnot set (default: off)\x1B[0m";break;case"duty.max":me=pe.max_airtime_percent!=null?`${pe.max_airtime_percent}%`:"\x1B[90mnot set\x1B[0m";break;case"public.key":me=ct.public_key||"\x1B[90mnot available\x1B[0m";break;case"prv.key":this.writeWarning(t,"Private key not exposed via API for security"),this.writeInfo(t,"Check /etc/pymc_repeater/config.yaml"),u();return;case"guest.password":case"allow.read.only":this.writeWarning(t,"Security settings not exposed via API"),this.writeInfo(t,"Check /etc/pymc_repeater/config.yaml"),u();return;default:this.writeError(t,`Unknown parameter: ${T}`),this.writeLine(t,""),this.writeInfo(t,"Available parameters:"),this.writeInfo(t," Identity: name, role, lat, lon"),this.writeInfo(t," Radio: freq, tx, bw, sf, cr, radio"),this.writeInfo(t," Timing: txdelay, direct.txdelay, rxdelay, af"),this.writeInfo(t," Repeater: mode, repeat, flood.max, advert.interval"),this.writeInfo(t," Duty: duty, duty.max"),this.writeInfo(t," Security: public.key"),u();return}this.writeSuccess(t,me)}catch(K){$(),this.writeError(t,`Failed to get ${T}: ${K}`)}u()}writeWarning(t,r){t.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class nPt extends H0{name="set";description="Set configuration values (tx, txdelay, mode, duty, etc.)";matches(t){const r=t.toLowerCase();return r==="set"||r.startsWith("set ")}async execute({term:t,args:r,writePrompt:u}){const T=r[0]?.toLowerCase(),$=r.slice(1).join(" ").trim();if(!T){this.writeError(t,"Usage: set "),this.writeLine(t,""),this.writeInfo(t,"Available parameters:"),this.writeLine(t,""),this.writeLine(t," \x1B[33mRadio:\x1B[0m"),this.writeLine(t," \x1B[36mtx <2-30>\x1B[0m TX power in dBm"),this.writeLine(t," \x1B[36mfreq \x1B[0m Frequency (100-1000 MHz) *restart required*"),this.writeLine(t," \x1B[36mbw \x1B[0m Bandwidth (7.8-500 kHz) *restart required*"),this.writeLine(t," \x1B[36msf <5-12>\x1B[0m Spreading factor *restart required*"),this.writeLine(t," \x1B[36mcr <5-8>\x1B[0m Coding rate (for 4/5 to 4/8) *restart required*"),this.writeLine(t,""),this.writeLine(t," \x1B[33mTiming:\x1B[0m"),this.writeLine(t," \x1B[36mtxdelay <0.0-5.0>\x1B[0m TX delay factor"),this.writeLine(t," \x1B[36mdirect.txdelay <0.0-5.0>\x1B[0m Direct TX delay factor"),this.writeLine(t," \x1B[36mrxdelay \x1B[0m RX delay base (>= 0)"),this.writeLine(t,""),this.writeLine(t," \x1B[33mIdentity:\x1B[0m"),this.writeLine(t," \x1B[36mname \x1B[0m Node name"),this.writeLine(t," \x1B[36mlat <-90 to 90>\x1B[0m Latitude"),this.writeLine(t," \x1B[36mlon <-180 to 180>\x1B[0m Longitude"),this.writeLine(t,""),this.writeLine(t," \x1B[33mRepeater:\x1B[0m"),this.writeLine(t," \x1B[36mmode \x1B[0m Repeater mode"),this.writeLine(t," \x1B[36mduty \x1B[0m Duty cycle enforcement"),this.writeLine(t," \x1B[36mflood.max <0-64>\x1B[0m Max flood hops"),this.writeLine(t," \x1B[36madvert.interval \x1B[0m Local advert interval"),this.writeLine(t,""),u();return}const K=this.startLoading(t,"Updating configuration...");try{let ct;switch(T){case"tx":{const St=parseInt($);if(isNaN(St)||St<2||St>30){K(),this.writeError(t,"TX power must be 2-30 dBm"),u();return}ct=await bs.post("/update_radio_config",{tx_power:St},{timeout:3e4});break}case"freq":{const St=parseFloat($);if(isNaN(St)||St<100||St>1e3){K(),this.writeError(t,"Frequency must be 100-1000 MHz"),u();return}ct=await bs.post("/update_radio_config",{frequency:St*1e6},{timeout:3e4});break}case"bw":{const St=parseFloat($),Ut=[7.8,10.4,15.6,20.8,31.25,41.7,62.5,125,250,500];if(isNaN(St)||!Ut.includes(St)){K(),this.writeError(t,`Bandwidth must be one of: ${Ut.join(", ")} kHz`),u();return}ct=await bs.post("/update_radio_config",{bandwidth:St*1e3},{timeout:3e4});break}case"sf":{const St=parseInt($);if(isNaN(St)||St<5||St>12){K(),this.writeError(t,"Spreading factor must be 5-12"),u();return}ct=await bs.post("/update_radio_config",{spreading_factor:St},{timeout:3e4});break}case"cr":{const St=parseInt($);if(isNaN(St)||St<5||St>8){K(),this.writeError(t,"Coding rate must be 5-8 (for 4/5 to 4/8)"),u();return}ct=await bs.post("/update_radio_config",{coding_rate:St},{timeout:3e4});break}case"af":case"txdelay":{const St=parseFloat($);if(isNaN(St)||St<0||St>5){K(),this.writeError(t,"TX delay factor must be 0.0-5.0"),u();return}ct=await bs.post("/update_radio_config",{tx_delay_factor:St},{timeout:3e4});break}case"direct.txdelay":{const St=parseFloat($);if(isNaN(St)||St<0||St>5){K(),this.writeError(t,"Direct TX delay factor must be 0.0-5.0"),u();return}ct=await bs.post("/update_radio_config",{direct_tx_delay_factor:St},{timeout:3e4});break}case"rxdelay":{const St=parseFloat($);if(isNaN(St)||St<0){K(),this.writeError(t,"RX delay must be >= 0"),u();return}ct=await bs.post("/update_radio_config",{rx_delay_base:St},{timeout:3e4});break}case"name":{if(!$.trim()){K(),this.writeError(t,"Node name cannot be empty"),u();return}ct=await bs.post("/update_radio_config",{node_name:$.trim()},{timeout:3e4});break}case"lat":{const St=parseFloat($);if(isNaN(St)||St<-90||St>90){K(),this.writeError(t,"Latitude must be -90 to 90"),u();return}ct=await bs.post("/update_radio_config",{latitude:St},{timeout:3e4});break}case"lon":{const St=parseFloat($);if(isNaN(St)||St<-180||St>180){K(),this.writeError(t,"Longitude must be -180 to 180"),u();return}ct=await bs.post("/update_radio_config",{longitude:St},{timeout:3e4});break}case"mode":{const St=$.toLowerCase();if(St!=="forward"&&St!=="monitor"){K(),this.writeError(t,'Mode must be "forward" or "monitor"'),this.writeLine(t,""),this.writeInfo(t,"Valid values:"),this.writeLine(t," \x1B[36mforward\x1B[0m - Forward packets"),this.writeLine(t," \x1B[36mmonitor\x1B[0m - Monitor only (no forwarding)"),u();return}ct=await bs.post("/set_mode",{mode:St},{timeout:3e4}),ct.data&&(ct.data.applied=[`mode=${St}`],ct.data.persisted=!0,ct.data.live_update=!0);break}case"duty":{const St=$.toLowerCase();if(St!=="on"&&St!=="off"){K(),this.writeError(t,'Duty cycle must be "on" or "off"'),this.writeLine(t,""),this.writeInfo(t,"Valid values:"),this.writeLine(t," \x1B[36mon\x1B[0m - Enable duty cycle enforcement"),this.writeLine(t," \x1B[36moff\x1B[0m - Disable duty cycle enforcement"),u();return}const Ut=St==="on";ct=await bs.post("/set_duty_cycle",{enabled:Ut},{timeout:3e4}),ct.data&&(ct.data.applied=[`duty=${St}`],ct.data.persisted=!0,ct.data.live_update=!0);break}case"flood.max":{const St=parseInt($);if(isNaN(St)||St<0||St>64){K(),this.writeError(t,"Max flood hops must be 0-64"),u();return}ct=await bs.post("/update_radio_config",{max_flood_hops:St},{timeout:3e4});break}case"flood.advert.interval":{const St=parseInt($);if(isNaN(St)||St!==0&&(St<3||St>48)){K(),this.writeError(t,"Flood advert interval must be 0 (off) or 3-48 hours"),u();return}ct=await bs.post("/update_radio_config",{flood_advert_interval_hours:St},{timeout:3e4});break}case"advert.interval":{const St=parseInt($);if(isNaN(St)||St!==0&&(St<1||St>10080)){K(),this.writeError(t,"Advert interval must be 0 (off) or 1-10080 minutes"),u();return}ct=await bs.post("/update_radio_config",{advert_interval_minutes:St},{timeout:3e4});break}case"log":K(),this.writeWarning(t,"Log level configuration not yet implemented"),this.writeInfo(t,"Backend endpoint /set_log_level does not exist"),u();return;default:K(),this.writeError(t,`Unknown parameter: ${T}`),this.writeLine(t,""),this.writeInfo(t,'Type "set" without arguments to see available parameters'),u();return}K();const yt=ct.data||ct;ct.success?(yt.applied&&yt.applied.length>0?this.writeSuccess(t,`Configuration updated: ${yt.applied.join(", ")}`):this.writeSuccess(t,"Configuration updated"),yt.restart_required?(this.writeLine(t,""),this.writeWarning(t,"⚠ Service restart required for changes to take effect"),this.writeInfo(t,"Run: sudo systemctl restart pymc_repeater")):yt.message&&!yt.live_update&&(this.writeLine(t,""),this.writeInfo(t,yt.message))):this.writeError(t,ct.error||"Failed to update configuration")}catch(ct){K(),this.writeError(t,`Failed to update ${T}: ${ct}`)}this.writeLine(t,""),u()}writeWarning(t,r){t.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class iPt extends H0{name="identities";description="List all identities";aliases=["id","ids"];isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching identities...");try{const T=await bs.getIdentities();u();let $=[];if(T.success&&T.data){const K=T.data,ct=K.registered||[],yt=K.configured||[];$=yt.length>0?yt:ct}else Array.isArray(T)&&($=T);$.length===0?this.writeInfo(t,"No identities found"):(this.writeSuccess(t,`Found \x1B[1m${$.length}\x1B[0m identit${$.length===1?"y":"ies"}`),t.writeln(""),this.isMobile()?$.forEach((K,ct)=>{t.writeln(`\x1B[1;36m[${ct+1}] ${K.name||"Unnamed"}\x1B[0m`),t.writeln(` \x1B[90mType:\x1B[0m ${K.type||"-"}`),t.writeln(` \x1B[90mHash:\x1B[0m ${K.hash||"-"}`),t.writeln(` \x1B[90mAddress:\x1B[0m ${K.address||"-"}`),t.writeln(` \x1B[90mRegistered:\x1B[0m ${K.registered?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ct<$.length-1&&t.writeln("")}):(t.writeln("\x1B[36m┌────┬─────────────────────────────┬───────────────┬──────┬─────────┬────────────┐\x1B[0m"),t.writeln("\x1B[36m│ # │ Name │ Type │ Hash │ Address │ Registered │\x1B[0m"),t.writeln("\x1B[36m├────┼─────────────────────────────┼───────────────┼──────┼─────────┼────────────┤\x1B[0m"),$.forEach((K,ct)=>{const yt=(ct+1).toString().padEnd(2),St=(K.name||"Unnamed").padEnd(27),Ut=(K.type||"-").padEnd(13),ne=(K.hash||"-").padEnd(4),pe=(K.address||"-").padEnd(7),me=(K.registered?"yes":"no").padEnd(10);t.writeln(`\x1B[36m│\x1B[0m ${yt} \x1B[36m│\x1B[0m \x1B[1m${St}\x1B[0m \x1B[36m│\x1B[0m ${Ut} \x1B[36m│\x1B[0m ${ne} \x1B[36m│\x1B[0m ${pe} \x1B[36m│\x1B[0m ${me} \x1B[36m│\x1B[0m`)}),t.writeln("\x1B[36m└────┴─────────────────────────────┴───────────────┴──────┴─────────┴────────────┘\x1B[0m")))}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch identities")}r()}}class aPt extends H0{name="keys";description="List transport keys";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching transport keys...");try{const T=await bs.getTransportKeys();u();const $=T.success&&T.data?T.data:T,K=Array.isArray($)?$:[];K.length===0?this.writeInfo(t,"No transport keys found"):(this.writeSuccess(t,`Found \x1B[1m${K.length}\x1B[0m transport key${K.length===1?"":"s"}`),t.writeln(""),K.forEach((ct,yt)=>{t.writeln(`\x1B[36m${(yt+1).toString().padStart(2)}.\x1B[0m \x1B[1m${ct.name||"Unnamed"}\x1B[0m`),ct.flood_policy&&t.writeln(` Policy: \x1B[90m${ct.flood_policy}\x1B[0m`),ct.parent_id&&t.writeln(` Parent: \x1B[90m${ct.parent_id}\x1B[0m`),yt{if(t.writeln(`\x1B[1;36m[${ct+1}] ${K.node_name||"Unknown"}\x1B[0m`),t.writeln(` \x1B[90mPubKey:\x1B[0m ${K.pubkey?.substring(0,8)||"----"}`),t.writeln(` \x1B[90mType:\x1B[0m ${K.contact_type||"-"}`),K.last_seen){const yt=new Date(K.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});t.writeln(` \x1B[90mLast Seen:\x1B[0m ${yt}`)}K.rssi&&t.writeln(` \x1B[90mRSSI:\x1B[0m ${K.rssi}`),K.snr&&t.writeln(` \x1B[90mSNR:\x1B[0m ${K.snr}`),t.writeln(` \x1B[90mAdverts:\x1B[0m ${K.advert_count||0}`),t.writeln(` \x1B[90mDirect:\x1B[0m ${K.zero_hop?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ct{const yt=(ct+1).toString().padEnd(2),St=(K.node_name||"Unknown").padEnd(20),Ut=(K.pubkey?.substring(0,4)||"----").padEnd(6),ne=(K.contact_type||"-").padEnd(12),pe=K.last_seen?new Date(K.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).padEnd(20):"-".padEnd(20),me=(K.rssi?`${K.rssi}`:"-").padEnd(8),we=(K.snr?`${K.snr}`:"-").padEnd(4),Ce=(K.advert_count?.toString()||"0").padEnd(6),Ve=(K.zero_hop?"yes":"no").padEnd(6);t.writeln(`\x1B[36m│\x1B[0m ${yt} \x1B[36m│\x1B[0m \x1B[1m${St}\x1B[0m \x1B[36m│\x1B[0m ${Ut} \x1B[36m│\x1B[0m ${ne} \x1B[36m│\x1B[0m ${pe} \x1B[36m│\x1B[0m ${me} \x1B[36m│\x1B[0m ${we} \x1B[36m│\x1B[0m ${Ce} \x1B[36m│\x1B[0m ${Ve} \x1B[36m│\x1B[0m`)}),t.writeln("\x1B[36m└────┴──────────────────────┴────────┴──────────────┴──────────────────────┴──────────┴──────┴────────┴────────┘\x1B[0m")),$.length>10&&(t.writeln(""),t.writeln(`\x1B[90m... and ${$.length-10} more neighbors\x1B[0m`)))}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch neighbors")}r()}}class sPt extends H0{name="acl";description="Show ACL statistics";async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching ACL stats...");try{const T=await bs.getACLStats();u();const $=T.success&&T.data?T.data:T;if($&&typeof $=="object"){this.writeSuccess(t,"ACL Statistics:"),t.writeln("");const K=(ct,yt=" ")=>{if(typeof ct=="object"&&ct!==null&&!Array.isArray(ct))for(const[St,Ut]of Object.entries(ct))typeof Ut=="object"&&Ut!==null?(t.writeln(`${yt}\x1B[90m${St}:\x1B[0m`),K(Ut,yt+" ")):t.writeln(`${yt}\x1B[90m${St.padEnd(18)}\x1B[0m ${Ut}`);else t.writeln(`${yt}${ct}`)};for(const[ct,yt]of Object.entries($))typeof yt=="object"&&yt!==null?(t.writeln(` \x1B[36m${ct}\x1B[0m`),K(yt," ")):t.writeln(` \x1B[36m${ct.padEnd(20)}\x1B[0m ${yt}`)}else this.writeError(t,"No ACL data available")}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch ACL stats")}r()}}class lPt extends H0{name="rooms";description="List room servers";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:t,writePrompt:r}){const u=this.startLoading(t,"Fetching room stats...");try{const T=await bs.getRoomStats();u();let $=[];T.success&&T.data?$=T.data.rooms||(Array.isArray(T.data)?T.data:[]):Array.isArray(T)&&($=T),$.length===0?this.writeInfo(t,"No room servers found"):(this.writeSuccess(t,`Found \x1B[1m${$.length}\x1B[0m room server${$.length===1?"":"s"}`),t.writeln(""),this.isMobile()?$.forEach((K,ct)=>{t.writeln(`\x1B[1;36m[${ct+1}] ${K.room_name||"Unnamed"}\x1B[0m`),t.writeln(` \x1B[90mMessages:\x1B[0m ${K.total_messages||0}`),t.writeln(` \x1B[90mTotal Clients:\x1B[0m ${K.total_clients||0}`),t.writeln(` \x1B[90mActive Clients:\x1B[0m ${K.active_clients||0}`),t.writeln(` \x1B[90mSync:\x1B[0m ${K.sync_running?"\x1B[32mrunning\x1B[0m":"\x1B[31mstopped\x1B[0m"}`),ct<$.length-1&&t.writeln("")}):(t.writeln("\x1B[36m┌────┬─────────────────────────────┬──────────┬──────────────┬────────────────┬──────────┐\x1B[0m"),t.writeln("\x1B[36m│ # │ Room Name │ Messages │ Total Clients│ Active Clients │ Sync │\x1B[0m"),t.writeln("\x1B[36m├────┼─────────────────────────────┼──────────┼──────────────┼────────────────┼──────────┤\x1B[0m"),$.forEach((K,ct)=>{const yt=(ct+1).toString().padEnd(2),St=(K.room_name||"Unnamed").padEnd(27),Ut=(K.total_messages?.toString()||"0").padEnd(8),ne=(K.total_clients?.toString()||"0").padEnd(12),pe=(K.active_clients?.toString()||"0").padEnd(14),me=(K.sync_running?"running":"stopped").padEnd(8);t.writeln(`\x1B[36m│\x1B[0m ${yt} \x1B[36m│\x1B[0m \x1B[1m${St}\x1B[0m \x1B[36m│\x1B[0m ${Ut} \x1B[36m│\x1B[0m ${ne} \x1B[36m│\x1B[0m ${pe} \x1B[36m│\x1B[0m ${me} \x1B[36m│\x1B[0m`)}),t.writeln("\x1B[36m└────┴─────────────────────────────┴──────────┴──────────────┴────────────────┴──────────┘\x1B[0m")))}catch(T){u(),this.writeError(t,T instanceof Error?T.message:"Failed to fetch room stats")}r()}}class cPt extends H0{name="restart";description="Restart the pymc-repeater service";aliases=["reboot"];matches(t){const r=t.toLowerCase();return r==="restart"||r==="reboot"}async execute({term:t,writePrompt:r}){this.writeLine(t,""),this.writeLine(t,"\x1B[33m⚠️ This will restart the repeater service!\x1B[0m"),this.writeLine(t,""),this.writeInfo(t,"Attempting to restart service...");const u=this.startLoading(t,"Restarting...");try{const T=await bs.post("/restart_service",{},{timeout:1e4});u(),T.success?(this.writeLine(t,""),this.writeSuccess(t,T.message||"Service restart initiated"),this.writeLine(t,""),this.writeInfo(t,"The service will restart momentarily. You may need to refresh this page.")):(this.writeLine(t,""),this.writeError(t,"Restart failed: "+(T.error||T.message||"Unknown error")),this.writeLine(t,""),this.writeInfo(t,"You may need to manually restart: sudo systemctl restart pymc-repeater"))}catch(T){u(),this.writeLine(t,"");const $=T;if($.code==="ERR_NETWORK"||$.message?.includes("Network error")||$.message?.includes("ECONNRESET")||$.code==="ECONNRESET"){this.writeSuccess(t,"Service restart initiated successfully"),this.writeLine(t,""),await this.waitForServiceRestart(t,r);return}else $.code==="ECONNABORTED"||$.message?.includes("timeout")?(this.writeLine(t,"\x1B[33m⚠️ Request timed out - service may be restarting\x1B[0m"),this.writeLine(t,""),this.writeInfo(t,"Refresh the page in a few seconds to reconnect.")):$.response?.status===403||$.response?.status===401?(this.writeError(t,"Permission denied. Polkit rules may need configuration."),this.writeLine(t,""),this.writeInfo(t,"Run: sudo bash -c 'mkdir -p /etc/polkit-1/rules.d && cat > /etc/polkit-1/rules.d/10-pymc-repeater.rules <0;St--)t.write(`\r\x1B[36m⏳\x1B[0m Restarting service... ${St}s`),await new Promise(Ut=>setTimeout(Ut,1e3));t.write("\r\x1B[K");let K=4,ct=0;const yt="\r\x1B[36m⏳\x1B[0m Verifying restart (attempt ";for(;K<20;){ct++,t.write(`${yt}${ct})... `);try{if((await fetch(`${window.location.protocol}//${window.location.host}/api/stats`,{signal:AbortSignal.timeout(3e3)})).ok){t.write("\r\x1B[K"),this.writeLine(t,""),this.writeSuccess(t,`Service is back online! (took ~${K}s)`),this.writeLine(t,""),r();return}}catch(St){const Ut=St;Ut.code&&!["ERR_NETWORK","ECONNREFUSED","ECONNRESET"].includes(Ut.code)&&t.write(`[${Ut.code}] `)}await new Promise(St=>setTimeout(St,1*1e3)),K+=1}t.write("\r\x1B[K"),this.writeLine(t,""),this.writeLine(t,"\x1B[33m⚠️ Service did not respond within 20 seconds\x1B[0m"),this.writeLine(t,""),this.writeInfo(t,"The service may still be starting. Try: status"),this.writeLine(t,""),r()}}class uPt extends H0{name="ping";description="Ping a neighbor node to measure latency and signal quality";usage="ping [timeout_seconds]";async execute({term:t,args:r,writePrompt:u}){if(r.length===0){this.writeError(t,"Missing target node"),t.writeln(""),this.writeInfo(t,`Usage: ${this.usage}`),t.writeln(""),this.writeInfo(t,"Examples:"),this.writeInfo(t," ping MyNeighbor - Ping node by name"),this.writeInfo(t," ping 0xb5 - Ping node by pubkey hash"),this.writeInfo(t," ping MyNeighbor 20 - Ping with 20s timeout"),u();return}const T=r[0],$=r.length>1?parseInt(r[1]):10;if(isNaN($)||$<1||$>60){this.writeError(t,"Invalid timeout. Must be between 1-60 seconds"),u();return}let K=null;const ct=T.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(ct)K=`0x${ct[2].padStart(2,"0")}`;else{const St=this.startLoading(t,"Resolving target...");try{const Ut=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];let ne=!1;for(const pe of Ut)try{const me=await bs.get("/adverts_by_contact_type",{contact_type:pe,hours:168}),we=me.success&&me.data?me.data:me,Ve=(Array.isArray(we)?we:[]).find(kr=>kr.node_name&&kr.node_name.toLowerCase()===T.toLowerCase());if(Ve&&Ve.pubkey){K=`0x${Ve.pubkey.substring(0,2)}`,ne=!0;break}}catch{continue}if(St(),!ne){this.writeError(t,`Node '${T}' not found in neighbors`),t.writeln(""),this.writeInfo(t,"Try: neighbors - to list available nodes"),u();return}}catch(Ut){St(),this.writeError(t,`Failed to resolve target: ${Ut}`),u();return}}this.writeLine(t,`\x1B[36mPinging ${T} (${K}) with ${$}s timeout...\x1B[0m`),t.writeln("");const yt=this.startLoading(t,"Waiting for response...");try{const St=await bs.pingNeighbor(K,$);if(yt(),St.success&&St.data){const Ut=St.data;this.writeSuccess(t,`Reply from ${T} (${Ut.target_id})`),t.writeln("");let ne="\x1B[32m";if(Ut.rtt_ms>500?ne="\x1B[31m":Ut.rtt_ms>250&&(ne="\x1B[33m"),t.writeln(` \x1B[1mRound-Trip Time:\x1B[0m ${ne}${Ut.rtt_ms.toFixed(2)} ms\x1B[0m`),t.writeln(` \x1B[1mRSSI:\x1B[0m ${Ut.rssi} dBm`),t.writeln(` \x1B[1mSNR:\x1B[0m ${Ut.snr_db} dB`),Ut.path&&Ut.path.length>0){const we=Ut.path.join(" → "),Ce=Ut.path.length;t.writeln(` \x1B[1mPath:\x1B[0m ${we}`),t.writeln(` \x1B[1mHops:\x1B[0m ${Ce}`)}t.writeln("");let pe="Excellent",me="\x1B[32m";Ut.rtt_ms>500||Ut.rssi<-120?(pe="Poor",me="\x1B[31m"):Ut.rtt_ms>250||Ut.rssi<-100?(pe="Fair",me="\x1B[33m"):(Ut.rtt_ms>100||Ut.rssi<-80)&&(pe="Good",me="\x1B[36m"),t.writeln(` \x1B[1mLink Quality:\x1B[0m ${me}${pe}\x1B[0m`)}else this.writeError(t,St.error||"Ping failed")}catch(St){yt(),this.writeError(t,`Ping failed: ${St.message||St}`)}t.writeln(""),u()}}async function rj(){try{const e=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"],t=[];for(const r of e)try{const u=await bs.get("/adverts_by_contact_type",{contact_type:r,hours:168}),T=u.success&&u.data?u.data:u;(Array.isArray(T)?T:[]).forEach(K=>{K.node_name&&!t.includes(K.node_name)&&t.push(K.node_name)})}catch{continue}return t.sort()}catch{return[]}}class hPt{commands=[];constructor(){const t=new YLt,r=new XLt,u=new JLt,T=new QLt,$=new tPt,K=new ePt,ct=new rPt,yt=new nPt,St=new iPt,Ut=new aPt,ne=new oPt,pe=new sPt,me=new lPt,we=new cPt,Ce=new uPt,Ve=new KLt([t,r,u,T,$,K,ct,yt,St,Ut,ne,pe,me,we,Ce]);this.commands=[Ve,t,r,u,T,$,K,ct,yt,St,Ut,ne,pe,me,we,Ce]}findCommand(t){return this.commands.find(r=>r.matches(t))}getAllCommands(){return this.commands}getCommandNames(){return this.commands.map(t=>t.name)}}const MW="theme-preference",Cv=li("dark"),nj=li(!1);function EW(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function dPt(){if(nj.value)return;const e=localStorage.getItem(MW);e&&(e==="light"||e==="dark")?Cv.value=e:window.matchMedia("(prefers-color-scheme: light)").matches?Cv.value="light":Cv.value="dark",EW(Cv.value),nj.value=!0}typeof window<"u"&&dPt();Fh(Cv,e=>{localStorage.setItem(MW,e),EW(e)});function LW(){return{theme:Cv,toggleTheme:()=>{Cv.value=Cv.value==="dark"?"light":"dark"},setTheme:u=>{Cv.value=u},isDark:()=>Cv.value==="dark"}}const fPt={class:"space-y-4 md:space-y-6"},pPt={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-3 md:p-4"},mPt={class:"flex items-center justify-between"},gPt={class:"flex items-center gap-2 md:gap-3"},vPt=["title"],yPt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_Pt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},xPt={class:"hidden sm:inline"},bPt=["title"],wPt={class:"hidden sm:inline"},kPt=["title"],TPt={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},SPt={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},CPt={class:"hidden sm:inline"},APt={key:0,class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-4"},MPt={class:"flex items-center gap-3"},EPt=["onKeydown"],LPt={key:1,class:"absolute top-4 right-4 bg-black/80 backdrop-blur-sm px-3 py-2 rounded-lg border border-primary/30 flex items-center gap-2"},PPt=Cc({name:"TerminalView",__name:"Terminal",setup(e){const{theme:t}=LW(),r={background:"#1A1E1F",foreground:"#e0e0e0",cursor:"#00d9ff",cursorAccent:"#000000",selectionBackground:"#00d9ff40",selectionForeground:"#ffffff",black:"#000000",red:"#ff6b6b",green:"#51cf66",yellow:"#ffd93d",blue:"#00d9ff",magenta:"#e599f7",cyan:"#00d9ff",white:"#e0e0e0",brightBlack:"#6c757d",brightRed:"#ff8787",brightGreen:"#69db7c",brightYellow:"#ffe066",brightBlue:"#74c0fc",brightMagenta:"#f3a6ff",brightCyan:"#3bc9db",brightWhite:"#ffffff"},u={background:"#F3F4F6",foreground:"#1f2937",cursor:"#0D7377",cursorAccent:"#ffffff",selectionBackground:"#0D737740",selectionForeground:"#000000",black:"#1f2937",red:"#dc2626",green:"#15803d",yellow:"#a16207",blue:"#0D7377",magenta:"#7c3aed",cyan:"#0e7490",white:"#f3f4f6",brightBlack:"#6b7280",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#0891b2",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"},T=li(null),$=li(null),K=li(null),ct=li(""),yt=li(!1),St=li(!1),Ut=li(!1),ne=li(!1),pe=li(!1);li(0);let me=null,we=null,Ce=null,Ve="";const kr=[];let It=-1,rn="";const Lr=new hPt,Mr=Lr.getCommandNames();let tn=[],Dn=0;const Mn={get:["name","role","lat","lon","freq","tx","bw","sf","cr","radio","txdelay","direct.txdelay","rxdelay","af","mode","repeat","flood.max","advert.interval","duty","duty.max","public.key"],set:["tx","freq","bw","sf","cr","txdelay","direct.txdelay","rxdelay","name","lat","lon","mode","duty","flood.max","advert.interval","flood.advert.interval"],ping:[]},Br={set:{mode:["forward","monitor"],duty:["on","off"]}},Vn={get:{name:"Node name",role:"Node role",lat:"Latitude",lon:"Longitude",freq:"Frequency (MHz)",tx:"TX power (dBm)",bw:"Bandwidth (kHz)",sf:"Spreading factor",cr:"Coding rate",radio:"All radio settings",txdelay:"TX delay factor","direct.txdelay":"Direct TX delay",rxdelay:"RX delay base",af:"Airtime factor",mode:"Repeater mode",repeat:"Repeat on/off","flood.max":"Max flood hops","advert.interval":"Advert interval",duty:"Duty cycle enabled","duty.max":"Max airtime %","public.key":"Public key"},set:{tx:"TX power (2-30 dBm)",freq:"Frequency (100-1000 MHz) *restart required*",bw:"Bandwidth (7.8-500 kHz) *restart required*",sf:"Spreading factor (5-12) *restart required*",cr:"Coding rate (5-8) *restart required*",txdelay:"TX delay factor (0.0-5.0)","direct.txdelay":"Direct TX delay (0.0-5.0)",rxdelay:"RX delay base (>= 0)",name:"Node name",lat:"Latitude (-90 to 90)",lon:"Longitude (-180 to 180)",mode:"Repeater mode (forward/monitor)",duty:"Duty cycle (on/off)","flood.max":"Max flood hops (0-64)","advert.interval":"Advert interval (0 or 1-10080 mins)","flood.advert.interval":"Flood advert (0 or 3-48 hrs)"},ping:{}};Xd(()=>{if(!T.value)return;Ut.value=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const hi=window.innerWidth<768;me=new JMt({cursorBlink:!1,cursorStyle:"underline",cursorWidth:3,fontFamily:'"JetBrains Mono", "Fira Code", Menlo, Monaco, "Courier New", monospace',fontSize:hi?11:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.3,letterSpacing:.5,smoothScrollDuration:50,scrollSensitivity:3,fastScrollSensitivity:5,allowProposedApi:!0,screenReaderMode:Ut.value,theme:t.value==="dark"?r:u,scrollback:1e4,tabStopWidth:4,macOptionIsMeta:!0}),we=new e9t,me.loadAddon(we);try{const Ha=new ZLt;me.loadAddon(Ha)}catch{console.warn("WebGL addon failed to load, falling back to canvas renderer")}const na=new s9t((Ha,qa)=>{window.open(qa,"_blank")});me.loadAddon(na);const Xa=new fEt;if(me.loadAddon(Xa),me.unicode.activeVersion="11",Ce=new j9t,me.loadAddon(Ce),me.open(T.value),we.fit(),me.focus(),Ut.value&&$.value){const Ha=$.value,qa=()=>{Ha.focus({preventScroll:!1})};T.value?.addEventListener("click",qa),T.value?.addEventListener("touchstart",qa),Ha.addEventListener("input",()=>{setTimeout(()=>{me?.scrollToBottom()},10)}),Dv(()=>{T.value?.removeEventListener("click",qa),T.value?.removeEventListener("touchstart",qa)})}const oo=t.value==="dark"?"\x1B[1;37m":"\x1B[1;90m",xa=(t.value==="dark","\x1B[1;36m"),Ur=(t.value==="dark","\x1B[90m"),Sn="\x1B[36m",Hn="\x1B[0m";me.writeln(""),me.writeln(`${oo} ██████ ██ ██ ███ ███ ██████${Hn}`),me.writeln(`${oo} ██ ██ ██ ██ ████ ████ ██ ${Hn}`),me.writeln(`${oo} ██████ ████ ██ ████ ██ ██ ${Hn}`),me.writeln(`${oo} ██ ██ ██ ██ ██ ██ ${Hn}`),me.writeln(`${oo} ██ ██ ██ ██ ██████${Hn}`),me.writeln(""),me.writeln(`${xa} Repeater Terminal${Hn}`),me.writeln(""),me.writeln(`${Ur} Type ${Sn}help${Ur} for available commands${Hn}`),me.writeln(""),on(),me.onData(Ha=>{Sr(Ha)});const to=new ResizeObserver(()=>{we?.fit()});to.observe(T.value),Dv(()=>{to.disconnect(),me?.dispose()})});const on=()=>{me?.write(`\r +\x1B[1;36m❯\x1B[0m `)},pr=hi=>{if(!(!me||!hi)){me.write(`\x1B[90m${hi}\x1B[0m`);for(let na=0;na{if(!(!me||!rn)){for(let hi=0;hi{if(!me)return;const na=hi.charCodeAt(0);if(na===13){_r(),me.write(`\r +`),Ve.trim()?(nn(Ve.trim()),kr.push(Ve.trim()),It=kr.length):on(),Ve="";return}if(na===127){Ve.length>0&&(_r(),Ve=Ve.slice(0,-1),me.write("\b \b"),Dr());return}if(na===3){_r(),me.write(`^C\r +`),Ve="",on();return}if(na===12){me.clear(),Ve="",on();return}if(na===6){yt.value=!yt.value;return}if(hi==="\x1B[A"){kr.length>0&&It>0&&(_r(),It--,me.write("\r\x1B[K"),on(),Ve=kr[It],me.write(Ve));return}if(hi==="\x1B[B"){_r(),It2&&Br[xa]){const Hn=oo[1]?.toLowerCase(),to=oo.slice(2).join(" ").toLowerCase(),Ha=Br[xa][Hn];if(Ha){const qa=Ha.filter(Mo=>Mo.toLowerCase().startsWith(to));if(qa.length===1){const Mo=oo.slice(2).join(" "),Wo=qa[0].slice(Mo.length);Ve+=Wo,me.write(Wo)}else qa.length>1&&(me.write(`\r \r \x1B[33mAvailable values:\x1B[0m\r \r @@ -4153,12 +4153,12 @@ void main() { \r `),Wo.forEach(es=>{me.writeln(` \x1B[36m${es}\x1B[0m`)}),on(),me.write(Ve)}).catch(()=>{me.write(`\r \x1B[31mFailed to fetch neighbors\x1B[0m\r -`),on(),me.write(Ve)}));return}const Hn=oo.slice(1).join(" ").toLowerCase(),Qa=Mn[xa].filter(Ha=>Ha.toLowerCase().startsWith(Hn));if(Qa.length===1){const Ha=oo.slice(1).join(" "),qa=Qa[0].slice(Ha.length)+" ";Ve+=qa,me.write(qa)}else if(Qa.length>1){me.write(`\r +`),on(),me.write(Ve)}));return}const Hn=oo.slice(1).join(" ").toLowerCase(),to=Mn[xa].filter(Ha=>Ha.toLowerCase().startsWith(Hn));if(to.length===1){const Ha=oo.slice(1).join(" "),qa=to[0].slice(Ha.length)+" ";Ve+=qa,me.write(qa)}else if(to.length>1){me.write(`\r \r \x1B[33mAvailable parameters:\x1B[0m\r \r -`);const Ha=Vn[xa]||{};Qa.forEach(qa=>{const Mo=Ha[qa]||"",Wo=qa.padEnd(20);me.writeln(` \x1B[36m${Wo}\x1B[0m\x1B[90m${Mo}\x1B[0m`)}),on(),me.write(Ve)}return}const Sn=Lr.getAllCommands().filter(Hn=>!!(Hn.name.toLowerCase().startsWith(io)||Hn.aliases?.some(Qa=>Qa.toLowerCase().startsWith(io))));if(Sn.length===1){const Hn=Sn[0].name.slice(Ve.length)+" ";Ve+=Hn,me.write(Hn)}else Sn.length>1&&(me.write(`\r +`);const Ha=Vn[xa]||{};to.forEach(qa=>{const Mo=Ha[qa]||"",Wo=qa.padEnd(20);me.writeln(` \x1B[36m${Wo}\x1B[0m\x1B[90m${Mo}\x1B[0m`)}),on(),me.write(Ve)}return}const Sn=Lr.getAllCommands().filter(Hn=>!!(Hn.name.toLowerCase().startsWith(Xa)||Hn.aliases?.some(to=>to.toLowerCase().startsWith(Xa))));if(Sn.length===1){const Hn=Sn[0].name.slice(Ve.length)+" ";Ve+=Hn,me.write(Hn)}else Sn.length>1&&(me.write(`\r \r \x1B[33mAvailable commands:\x1B[0m\r \r -`),Sn.forEach(Hn=>{const Qa=Hn.aliases&&Hn.aliases.length>0?` (${Hn.aliases.join(", ")})`:"";me.writeln(` \x1B[36m${Hn.name.padEnd(15)}\x1B[0m ${Hn.description}${Qa}`)}),on(),me.write(Ve));return}aa>=32&&aa<127&&(_r(),Ve+=hi,me.write(hi),Ut.value||Dr())},Dr=()=>{if(Ve.length===0){rn="";return}const hi=Mr.filter(aa=>aa.startsWith(Ve.toLowerCase()));hi.length===1&&hi[0]!==Ve?(rn=hi[0].slice(Ve.length),pr(rn)):rn=""},nn=async hi=>{if(!me)return;const aa=hi.trim(),[io,...oo]=aa.split(/\s+/),xa=Lr.findCommand(io);if(xa)try{await xa.execute({term:me,args:oo,writePrompt:on})}catch(Ur){console.error("Command execution error:",Ur),me.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${Ur instanceof Error?Ur.message:"Command failed"}`),on()}else me.writeln(`\x1B[1;31m✗ Unknown command:\x1B[0m ${io}`),me.writeln("\x1B[90mType \x1B[36mhelp\x1B[90m for available commands\x1B[0m"),on()},Cn=()=>{!Ce||!ct.value||Ce.findNext(ct.value,{caseSensitive:!1})},Xn=()=>{!Ce||!ct.value||Ce.findPrevious(ct.value,{caseSensitive:!1})},_i=()=>{yt.value=!1,ct.value="",me?.focus()},ta=async()=>{if(K.value){if(ne.value)try{document.exitFullscreen&&await document.exitFullscreen(),ne.value=!1}catch(hi){console.error("Failed to exit fullscreen:",hi)}else try{K.value.requestFullscreen&&await K.value.requestFullscreen(),ne.value=!0,setTimeout(()=>{Ut.value&&$.value?$.value.focus():me&&me.focus()},100)}catch(hi){console.error("Failed to enter fullscreen:",hi)}setTimeout(()=>{we?.fit()},100)}},va=()=>{pe.value=!pe.value,pe.value&&Ut.value&&setTimeout(()=>{window.scrollTo(0,1)},100),setTimeout(()=>{Ut.value&&$.value?$.value.focus():me?.focus(),we?.fit()},150)},_a=()=>{pe.value=!1,setTimeout(()=>{we?.fit()},100)};Fh(t,hi=>{me&&(me.options.theme=hi==="dark"?r:u)}),typeof document<"u"&&(document.addEventListener("fullscreenchange",()=>{ne.value=!!document.fullscreenElement,setTimeout(()=>we?.fit(),100)}),document.addEventListener("keydown",hi=>{hi.key==="Escape"&&pe.value&&!ne.value&&_a()}),document.addEventListener("keydown",hi=>{hi.key==="Escape"&&pe.value&&!ne.value&&_a()}));const qi=()=>{Ut.value&&$.value&&$.value.focus()},Bi=hi=>{const aa=hi.target,io=aa.value;if(io&&me){const oo=io.slice(-1);Sr(oo)}aa.value=""},Xi=()=>{me&&Sr("\r"),$.value&&($.value.value="")},Yn=()=>{me&&Sr(""),$.value&&($.value.value="")};return(hi,aa)=>(Or(),Nr("div",dPt,[At("div",fPt,[At("div",pPt,[aa[8]||(aa[8]=At("div",null,[At("h1",{class:"text-content-primary dark:text-content-primary text-lg md:text-xl font-semibold"},"Terminal"),At("p",{class:"text-content-secondary dark:text-content-muted text-sm hidden md:block"},"Interactive command-line interface")],-1)),At("div",mPt,[Ut.value?(Or(),Nr("button",{key:0,onClick:va,class:"flex items-center gap-2 px-3 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:pe.value?"Exit fullscreen":"Enter fullscreen"},[pe.value?(Or(),Nr("svg",yPt,aa[3]||(aa[3]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(Or(),Nr("svg",vPt,aa[2]||(aa[2]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),At("span",_Pt,yn(pe.value?"Exit":"Fullscreen"),1)],8,gPt)):Ta("",!0),Ut.value?Ta("",!0):(Or(),Nr("button",{key:1,onClick:va,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:pe.value?"Exit full window":"Full window"},[aa[4]||(aa[4]=At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})],-1)),At("span",bPt,yn(pe.value?"Exit Window":"Full Window"),1)],8,xPt)),Ut.value?Ta("",!0):(Or(),Nr("button",{key:2,onClick:ta,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:ne.value?"Exit fullscreen":"Fullscreen"},[ne.value?(Or(),Nr("svg",TPt,aa[6]||(aa[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(Or(),Nr("svg",kPt,aa[5]||(aa[5]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),At("span",SPt,yn(ne.value?"Exit Full":"Fullscreen"),1)],8,wPt)),At("button",{onClick:aa[0]||(aa[0]=io=>yt.value=!yt.value),class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors"},aa[7]||(aa[7]=[At("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),At("span",{class:"hidden sm:inline"},"Search",-1)]))])])]),yt.value?(Or(),Nr("div",CPt,[At("div",APt,[Ml(At("input",{"onUpdate:modelValue":aa[1]||(aa[1]=io=>ct.value=io),onKeydown:[Sx(Cn,["enter"]),Sx(_i,["esc"])],type:"text",placeholder:"Search terminal output...",class:"flex-1 px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 outline-none focus:border-primary/50 transition-colors"},null,544),[[lu,ct.value]]),At("button",{onClick:Xn,class:"px-3 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary transition-colors",title:"Previous (Shift+Enter)"}," ↑ "),At("button",{onClick:Cn,class:"px-3 py-2 bg-primary/20 hover:bg-primary/30 border border-primary/50 rounded-lg text-primary transition-colors",title:"Next (Enter)"}," ↓ "),At("button",{onClick:_i,class:"px-3 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary transition-colors"}," ✕ ")])])):Ta("",!0),At("div",{ref_key:"terminalContainerRef",ref:K,class:ja(["bg-surface dark:bg-surface-elevated/80 backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden relative",{"fullscreen-terminal":ne.value,"full-window-terminal":pe.value}])},[pe.value&&!ne.value?(Or(),Nr("button",{key:0,onClick:_a,class:"absolute top-4 right-4 z-50 p-2 bg-black/80 backdrop-blur-sm hover:bg-black/90 text-white border border-white/20 rounded-lg transition-colors",title:"Exit full window (ESC)"},aa[9]||(aa[9]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))):Ta("",!0),At("div",{ref_key:"terminalRef",ref:T,class:ja(["terminal-container",{"fullscreen-content":ne.value}]),onClick:qi,onTouchstart:qi},[Ut.value?(Or(),Nr("input",{key:0,ref_key:"mobileInputRef",ref:$,type:"text",class:"mobile-keyboard-input",onInput:Bi,onKeydown:[Sx(Od(Xi,["prevent"]),["enter"]),Sx(Yn,["delete"])],inputmode:"text",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},null,40,MPt)):Ta("",!0)],34),St.value?(Or(),Nr("div",EPt,aa[10]||(aa[10]=[At("div",{class:"w-2 h-2 bg-primary rounded-full animate-pulse"},null,-1),At("span",{class:"text-primary text-sm font-medium"},"Processing...",-1)]))):Ta("",!0)],2)]))}}),PPt=vh(LPt,[["__scopeId","data-v-7ea2281b"]]),IPt=Cc({name:"HelpView",__name:"Help",setup(e){return(t,r)=>(Or(),Nr("div",null,r[0]||(r[0]=[Du('

Help & Documentation

pyMC Repeater Wiki

Access documentation, setup guides, troubleshooting tips, and community resources on our official wiki.

Visit Wiki Documentation
Opens in a new tab
',1)])))}}),DPt={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},zPt={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},OPt={class:"text-red-600 dark:text-red-400 text-sm"},BPt={key:1,class:"bg-green-500/10 border border-green-600/40 dark:border-green-500/30 rounded-lg p-3"},RPt={class:"text-green-600 dark:text-green-400 text-sm"},FPt={class:"flex justify-end gap-3 mt-6"},NPt=["disabled"],jPt=["disabled"],UPt={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},$Pt=Cc({name:"ChangePasswordModal",__name:"ChangePasswordModal",props:{isOpen:{type:Boolean},canSkip:{type:Boolean,default:!0}},emits:["close","success"],setup(e,{emit:t}){const r=t,u=li(""),T=li(""),$=li(""),K=li(!1),ct=li(""),yt=li(""),St=()=>{K.value||r("close")},Ut=()=>{r("close")},ne=async()=>{if(ct.value="",yt.value="",T.value.length<8){ct.value="New password must be at least 8 characters long";return}if(T.value!==$.value){ct.value="Passwords do not match";return}if(T.value===u.value){ct.value="New password must be different from current password";return}K.value=!0;try{const me=(await nw.post("/auth/change_password",{current_password:u.value,new_password:T.value})).data;me&&me.success?(yt.value=me.message||"Password changed successfully!",setTimeout(()=>{r("success"),r("close")},1500)):ct.value=me?.error||"Failed to change password"}catch(pe){console.error("Password change error:",pe),ct.value=pe.response?.data?.error||"Failed to change password. Please try again."}finally{K.value=!1}};return(pe,me)=>pe.isOpen?(Or(),Nr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Od(St,["self"])},[At("div",DPt,[me[6]||(me[6]=At("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-2"},"Change Default Password",-1)),me[7]||(me[7]=At("p",{class:"text-content-secondary dark:text-content-muted text-sm mb-6"}," You're using the default password. Please change it to secure your account. ",-1)),At("form",{onSubmit:Od(ne,["prevent"]),class:"space-y-4"},[At("div",null,[me[3]||(me[3]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"Current Password",-1)),Ml(At("input",{"onUpdate:modelValue":me[0]||(me[0]=we=>u.value=we),type:"password",required:"",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter current password"},null,512),[[lu,u.value]])]),At("div",null,[me[4]||(me[4]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"New Password",-1)),Ml(At("input",{"onUpdate:modelValue":me[1]||(me[1]=we=>T.value=we),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter new password (min 8 characters)"},null,512),[[lu,T.value]])]),At("div",null,[me[5]||(me[5]=At("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"Confirm New Password",-1)),Ml(At("input",{"onUpdate:modelValue":me[2]||(me[2]=we=>$.value=we),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Confirm new password"},null,512),[[lu,$.value]])]),ct.value?(Or(),Nr("div",zPt,[At("p",OPt,yn(ct.value),1)])):Ta("",!0),yt.value?(Or(),Nr("div",BPt,[At("p",RPt,yn(yt.value),1)])):Ta("",!0),At("div",FPt,[pe.canSkip?(Or(),Nr("button",{key:0,type:"button",onClick:Ut,disabled:K.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50"}," Skip for Now ",8,NPt)):Ta("",!0),At("button",{type:"submit",disabled:K.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2"},[K.value?(Or(),Nr("div",UPt)):Ta("",!0),cl(" "+yn(K.value?"Changing...":"Change Password"),1)],8,jPt)])],32)])])):Ta("",!0)}}),HPt={},VPt={width:"23",height:"25",viewBox:"0 0 23 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function WPt(e,t){return Or(),Nr("svg",VPt,t[0]||(t[0]=[At("path",{d:"M2.84279 2.25795C2.90709 1.12053 3.17879 0.625914 3.95795 0.228723C4.79631 -0.198778 6.11858 0.000168182 7.67449 0.788054C8.34465 1.12757 8.41289 1.13448 9.58736 0.983905C11.1485 0.783681 13.1582 0.784388 14.5991 0.985738C15.6887 1.13801 15.7603 1.1304 16.4321 0.790174C18.6406 -0.328212 20.3842 -0.255036 21.0156 0.982491C21.3308 1.6002 21.3893 3.20304 21.1449 4.52503C21.0094 5.25793 21.0238 5.34943 21.3502 5.83037C23.6466 9.21443 21.9919 14.6998 18.0569 16.7469C17.7558 16.9036 17.502 17.0005 17.2952 17.0795C16.6602 17.3219 16.4674 17.3956 16.7008 18.5117C16.8132 19.0486 16.9486 20.3833 17.0018 21.478C17.098 23.4567 17.0966 23.4705 16.7495 23.8742C16.2772 24.4233 15.5963 24.4326 15.135 23.8962C14.8341 23.5464 14.8047 23.3812 14.8047 22.0315C14.8047 20.037 14.5861 18.7113 14.0695 17.5753C13.4553 16.2235 13.9106 15.7194 15.3154 15.4173C17.268 14.9973 18.793 13.7923 19.643 11.9978C20.4511 10.2921 20.5729 7.93485 19.1119 6.50124C18.6964 6.00746 18.6674 5.56022 18.9641 4.21159C19.075 3.70754 19.168 3.05725 19.1707 2.76637C19.1749 2.30701 19.1331 2.23764 18.8509 2.23764C18.6724 2.23764 17.9902 2.49736 17.3352 2.81474L16.2897 3.32145C16.1947 3.36751 16.0883 3.38522 15.9834 3.37318C13.3251 3.06805 10.7991 3.06334 8.12774 3.37438C8.02244 3.38663 7.91563 3.36892 7.82025 3.32263L6.77535 2.81559C6.12027 2.49764 5.43813 2.23764 5.25963 2.23764C4.84693 2.23764 4.84072 2.54233 5.2169 4.35258C5.44669 5.45816 5.60133 5.70451 4.93703 6.58851C3.94131 7.91359 3.69258 9.55902 4.22654 11.2878C4.89952 13.4664 6.54749 14.9382 8.86436 15.4292C10.261 15.7253 10.6261 16.1115 10.0928 17.713C9.67293 18.9734 9.40748 19.2982 8.79738 19.2982C7.97649 19.2982 7.46228 18.5871 7.74527 17.843C7.86991 17.5151 7.83283 17.4801 7.06383 17.1996C4.71637 16.3437 2.9209 14.4254 2.10002 11.8959C1.46553 9.94098 1.74471 7.39642 2.76257 5.85843C3.10914 5.33477 3.1145 5.29036 2.95277 4.28787C2.86126 3.72037 2.81177 2.80699 2.84279 2.25795Z",fill:"currentColor"},null,-1),At("path",{d:"M2.02306 16.5589C1.68479 16.0516 0.999227 15.9144 0.491814 16.2527C-0.0155884 16.591 -0.152708 17.2765 0.185564 17.7839C0.435301 18.1586 0.734065 18.4663 0.987777 18.72C1.03455 18.7668 1.08 18.8119 1.12438 18.856C1.3369 19.0671 1.52455 19.2535 1.71302 19.4748C2.12986 19.964 2.54572 20.623 2.78206 21.8047C2.88733 22.3311 3.26569 22.6147 3.47533 22.7386C3.70269 22.8728 3.9511 22.952 4.15552 23.0036C4.57369 23.109 5.08133 23.1638 5.56309 23.1957C6.09196 23.2308 6.665 23.2422 7.17743 23.2453C7.1778 23.8547 7.67202 24.3487 8.28162 24.3487C8.89146 24.3487 9.38582 23.8543 9.38582 23.2445V22.1403C9.38582 21.5305 8.89146 21.0361 8.28162 21.0361C8.17753 21.0361 8.06491 21.0364 7.94562 21.0369C7.29761 21.0389 6.45295 21.0414 5.70905 20.9922C5.35033 20.9684 5.05544 20.9347 4.8392 20.8936C4.50619 19.5863 3.96821 18.7165 3.39415 18.0426C3.14038 17.7448 2.87761 17.4842 2.66387 17.2722C2.62385 17.2326 2.58556 17.1946 2.54935 17.1584C2.30273 16.9118 2.1414 16.7365 2.02306 16.5589Z",fill:"currentColor"},null,-1)]))}const PW=vh(HPt,[["render",WPt]]),qPt={},GPt={width:"17",height:"24",viewBox:"0 0 17 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ZPt(e,t){return Or(),Nr("svg",GPt,t[0]||(t[0]=[Du('',12)]))}const IW=vh(qPt,[["render",ZPt]]),KPt=["aria-label","title"],YPt={key:0,xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5 text-yellow-600 dark:text-yellow-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},XPt={key:1,xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5 text-content-secondary dark:text-content",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},LL=Cc({__name:"ThemeToggle",setup(e){const{theme:t,toggleTheme:r}=LW();return(u,T)=>(Or(),Nr("button",{onClick:T[0]||(T[0]=(...$)=>Io(r)&&Io(r)(...$)),class:"w-[35px] h-[35px] rounded bg-background-mute dark:bg-surface-elevated flex items-center justify-center hover:bg-stroke-subtle dark:hover:bg-stroke/30 transition-colors","aria-label":Io(t)==="dark"?"Switch to light mode":"Switch to dark mode",title:Io(t)==="dark"?"Switch to light mode":"Switch to dark mode"},[Io(t)==="dark"?(Or(),Nr("svg",YPt,T[1]||(T[1]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):(Or(),Nr("svg",XPt,T[2]||(T[2]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"},null,-1)])))],8,KPt))}}),JPt={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-start sm:items-center justify-center p-2 sm:p-4 pt-8 sm:pt-4"},QPt={class:"absolute top-4 right-4 z-20"},tIt={class:"login-card relative z-10 w-full max-w-md p-6 sm:p-10 rounded-[16px] sm:rounded-[24px] border-0 sm:border sm:border-stroke-subtle dark:sm:border-stroke/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.1)] dark:shadow-[0_8px_32px_0_rgba(0,0,0,0.37)] backdrop-blur-xl"},eIt={class:"relative login-content"},rIt={class:"form-group"},nIt={class:"relative"},iIt=["disabled"],aIt={class:"form-group"},oIt={class:"relative"},sIt=["disabled"],lIt={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-[12px] p-2.5 sm:p-3.5 backdrop-blur-sm animate-shake"},cIt={class:"text-red-600 dark:text-red-400 text-xs sm:text-sm font-medium"},uIt=["disabled"],hIt={key:0,class:"w-4 h-4 sm:w-5 sm:h-5 border-2 border-white border-t-transparent rounded-full animate-spin"},dIt={key:1,class:"w-4 h-4 sm:w-5 sm:h-5 group-hover:translate-x-1 transition-transform duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},fIt={class:"relative"},pIt={class:"mt-6 sm:mt-8 pt-4 sm:pt-6 border-t border-stroke-subtle dark:border-stroke/10"},mIt={class:"flex items-center justify-center gap-3"},gIt={href:"https://github.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-primary/20 dark:hover:bg-primary/30 hover:border-primary/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"GitHub"},vIt={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-yellow-50 dark:hover:bg-yellow-500/20 hover:border-yellow-500/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"Buy Me a Coffee"},yIt=Cc({name:"LoginView",__name:"Login",setup(e){const t=n4(),r=li("admin"),u=li(""),T=li(!1),$=li(""),K=li(!1),ct=li(!1),yt=async()=>{$.value="",T.value=!0;try{const ne=f$(),me=(await nw.post("/auth/login",{username:r.value,password:u.value,client_id:ne})).data;me.success&&me.token?u.value==="admin123"?(i9(me.token),ct.value=!0,K.value=!0):(i9(me.token),t.push("/")):$.value=me.error||"Login failed"}catch(ne){console.error("Login error:",ne);const pe=ne;$.value=pe.response?.data?.error||"Connection error. Please try again."}finally{T.value=!1}},St=()=>{K.value=!1,t.push("/")},Ut=()=>{K.value=!1,ct.value&&t.push("/")};return(ne,pe)=>(Or(),Nr("div",JPt,[At("div",QPt,[Vs(LL)]),pe[9]||(pe[9]=At("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),pe[10]||(pe[10]=At("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),pe[11]||(pe[11]=At("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),At("div",tIt,[pe[8]||(pe[8]=At("div",{class:"absolute inset-0 rounded-[24px] bg-gradient-to-br from-primary/3 dark:from-primary/5 to-transparent pointer-events-none"},null,-1)),At("div",eIt,[pe[7]||(pe[7]=Du('
MeshCore

pyMC Repeater

Sign in to access your dashboard

',1)),At("form",{onSubmit:Od(yt,["prevent"]),class:"space-y-4 sm:space-y-5"},[At("div",rIt,[pe[3]||(pe[3]=At("label",{for:"username",class:"block text-content-secondary dark:text-content-primary/90 text-xs sm:text-sm font-medium mb-2"}," Username ",-1)),At("div",nIt,[Ml(At("input",{id:"username","onUpdate:modelValue":pe[0]||(pe[0]=me=>r.value=me),type:"text",autocomplete:"username",required:"",class:"input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] text-content-primary dark:text-content-primary text-sm placeholder-gray-400 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 transition-all duration-300",placeholder:"Enter username",disabled:T.value},null,8,iIt),[[lu,r.value]]),pe[2]||(pe[2]=At("div",{class:"absolute inset-0 rounded-[12px] pointer-events-none input-glow"},null,-1))])]),At("div",aIt,[pe[5]||(pe[5]=At("label",{for:"password",class:"block text-content-secondary dark:text-content-primary/90 text-xs sm:text-sm font-medium mb-2"}," Password ",-1)),At("div",oIt,[Ml(At("input",{id:"password","onUpdate:modelValue":pe[1]||(pe[1]=me=>u.value=me),type:"password",autocomplete:"current-password",required:"",class:"input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] text-content-primary dark:text-content-primary text-sm placeholder-gray-400 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 transition-all duration-300",placeholder:"Enter password",disabled:T.value},null,8,sIt),[[lu,u.value]]),pe[4]||(pe[4]=At("div",{class:"absolute inset-0 rounded-[12px] pointer-events-none input-glow"},null,-1))])]),$.value?(Or(),Nr("div",lIt,[At("p",cIt,yn($.value),1)])):Ta("",!0),At("button",{type:"submit",disabled:T.value,class:"button-glass w-full relative overflow-hidden bg-primary/20 hover:bg-primary/30 active:scale-[0.98] text-primary dark:text-white font-semibold py-3 sm:py-4 px-4 rounded-[12px] border border-primary/50 hover:border-primary/60 transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 sm:gap-2.5 group mt-6 sm:mt-8 text-sm sm:text-base backdrop-blur-sm"},[T.value?(Or(),Nr("div",hIt)):(Or(),Nr("svg",dIt,pe[6]||(pe[6]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"},null,-1)]))),At("span",fIt,yn(T.value?"Signing in...":"Sign In"),1)],8,uIt)],32),At("div",pIt,[At("div",mIt,[At("a",gIt,[Vs(PW,{class:"w-5 h-5 sm:w-6 sm:h-6 text-white group-hover:text-primary transition-colors"})]),At("a",vIt,[Vs(IW,{class:"w-5 h-5 sm:w-6 sm:h-6 text-white group-hover:text-yellow-500 transition-colors"})])])])])]),Vs($Pt,{"is-open":K.value,"can-skip":!0,onClose:Ut,onSuccess:St},null,8,["is-open"])]))}}),_It=vh(yIt,[["__scopeId","data-v-7d3a3377"]]),xIt=OS("setup",()=>{const e=li(1),t=li(5),r=li(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`),u=li(null),T=li(null),$=li(""),K=li(""),ct=li(!1),yt=li({frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"}),St=li([]),Ut=li([]),ne=li(!1),pe=li(!1),me=li(null),we=Ao(()=>{switch(e.value){case 1:return!0;case 2:return r.value.trim().length>0;case 3:return u.value!==null;case 4:return ct.value?yt.value.frequency&&yt.value.spreading_factor&&yt.value.bandwidth&&yt.value.coding_rate:T.value!==null;case 5:return $.value.length>=6&&$.value===K.value;default:return!1}}),Ce=Ao(()=>e.value>1),Ve=Ao(()=>e.value===t.value);async function kr(){ne.value=!0,me.value=null;try{const Br=await(await fetch("/api/hardware_options")).json();if(Br.error)throw new Error(Br.error);St.value=Br.hardware||[]}catch(Mn){me.value=Mn instanceof Error?Mn.message:"Failed to load hardware options",console.error("Error fetching hardware options:",Mn)}finally{ne.value=!1}}async function It(){ne.value=!0,me.value=null;try{const Br=await(await fetch("/api/radio_presets")).json();if(Br.error)throw new Error(Br.error);Ut.value=Br.presets||[]}catch(Mn){me.value=Mn instanceof Error?Mn.message:"Failed to load radio presets",console.error("Error fetching radio presets:",Mn)}finally{ne.value=!1}}async function rn(){if(!we.value)return{success:!1,error:"Please complete all required fields"};pe.value=!0,me.value=null;try{const Mn=ct.value?{title:"Custom Configuration",description:"Custom radio settings",frequency:yt.value.frequency,spreading_factor:yt.value.spreading_factor,bandwidth:yt.value.bandwidth,coding_rate:yt.value.coding_rate}:T.value,Vn=await(await fetch("/api/setup_wizard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_name:r.value.trim(),hardware_key:u.value?.key,radio_preset:Mn,admin_password:$.value})})).json();if(!Vn.success)throw new Error(Vn.error||"Setup failed");return{success:!0,data:Vn}}catch(Mn){const Br=Mn instanceof Error?Mn.message:"Failed to complete setup";return me.value=Br,{success:!1,error:Br}}finally{pe.value=!1}}function Lr(){we.value&&e.value=1&&Mn<=t.value&&(e.value=Mn)}function Dn(){e.value=1,r.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`,u.value=null,T.value=null,ct.value=!1,yt.value={frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"},$.value="",K.value="",me.value=null}return{currentStep:e,totalSteps:t,nodeName:r,selectedHardware:u,selectedRadioPreset:T,useCustomRadio:ct,customRadio:yt,adminPassword:$,confirmPassword:K,hardwareOptions:St,radioPresets:Ut,isLoading:ne,isSubmitting:pe,error:me,canGoNext:we,canGoBack:Ce,isLastStep:Ve,fetchHardwareOptions:kr,fetchRadioPresets:It,completeSetup:rn,nextStep:Lr,previousStep:Mr,goToStep:tn,reset:Dn}}),bIt={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4"},wIt={class:"absolute top-4 right-4 z-20"},kIt={class:"w-full max-w-4xl relative z-10"},TIt={class:"mb-8"},SIt={class:"flex justify-between mb-2"},CIt={class:"text-content-secondary dark:text-content-muted text-sm"},AIt={class:"text-content-secondary dark:text-content-muted text-sm"},MIt={class:"h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden"},EIt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12"},LIt={class:"flex justify-center mb-8"},PIt={class:"flex gap-2"},IIt={class:"mb-8"},DIt={class:"text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center"},zIt={key:0,class:"space-y-6 mt-8"},OIt={key:1,class:"space-y-6 mt-8"},BIt={class:"max-w-md mx-auto"},RIt={key:2,class:"space-y-6 mt-8"},FIt={key:0,class:"text-center text-content-secondary dark:text-content-muted"},NIt={key:1,class:"text-center text-content-secondary dark:text-content-muted"},jIt={key:2,class:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto"},UIt=["onClick"],$It={class:"font-medium text-content-primary dark:text-content-primary mb-1"},HIt={class:"text-sm text-content-secondary dark:text-content-muted"},VIt={key:3,class:"space-y-6 mt-8"},WIt={key:0,class:"text-center text-content-secondary dark:text-content-muted"},qIt={key:1,class:"text-center text-content-secondary dark:text-content-muted"},GIt={key:2,class:"max-w-5xl mx-auto"},ZIt={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4"},KIt=["onClick"],YIt={class:"relative z-10"},XIt={class:"font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2"},JIt={class:"flex items-center gap-2"},QIt={class:"text-2xl"},tDt={key:0,class:"text-primary flex-shrink-0"},eDt={class:"text-xs text-content-secondary dark:text-content-muted mb-3"},rDt={class:"grid grid-cols-2 gap-2 text-xs"},nDt={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},iDt={class:"text-content-primary dark:text-content-primary/80 font-medium"},aDt={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},oDt={class:"text-content-primary dark:text-content-primary/80 font-medium"},sDt={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},lDt={class:"text-content-primary dark:text-content-primary/80 font-medium"},cDt={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},uDt={class:"text-content-primary dark:text-content-primary/80 font-medium"},hDt={class:"border-t border-stroke-subtle dark:border-stroke/10 pt-6"},dDt={class:"flex items-center justify-between mb-2"},fDt={key:0,class:"text-primary"},pDt={key:0,class:"mt-4 grid grid-cols-2 gap-4"},mDt={key:4,class:"space-y-6 mt-8"},gDt={class:"max-w-md mx-auto space-y-4"},vDt={key:0,class:"text-red-600 dark:text-red-400 text-sm"},yDt={key:0,class:"mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-600 dark:text-red-200"},_Dt={class:"flex justify-between gap-4"},xDt={key:1},bDt=["disabled"],wDt={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},kDt={key:1},TDt={key:2},SDt={key:3},CDt={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ADt={class:"flex justify-center mb-6"},MDt={key:0,class:"w-16 h-16 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center"},EDt={key:1,class:"w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center"},LDt={class:"text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4"},PDt={class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"},IDt=Cc({name:"SetupView",__name:"Setup",setup(e){const t=xIt(),r=n4(),u=li(!1),T=li(""),$=li(""),K=li("success"),ct=me=>{const we=me.toLowerCase();return we.includes("australia")?"🇦🇺":we.includes("eu")||we.includes("uk")?"🇪🇺":we.includes("czech")?"🇨🇿":we.includes("new zealand")?"🇳🇿":we.includes("portugal")?"🇵🇹":we.includes("switzerland")?"🇨🇭":we.includes("usa")||we.includes("canada")?"🇺🇸":we.includes("vietnam")?"🇻🇳":"🌍"};Xd(async()=>{await Promise.all([t.fetchHardwareOptions(),t.fetchRadioPresets()])});const yt=Ao(()=>t.currentStep/t.totalSteps*100);async function St(){if(t.isLastStep){const me=await t.completeSetup();me.success?(K.value="success",T.value="Setup Complete!",$.value="Your repeater has been configured successfully. The service is restarting now...",u.value=!0,setTimeout(()=>{u.value=!1,r.push("/login")},5e3)):(K.value="error",T.value="Setup Failed",$.value=me.error||"An unknown error occurred",u.value=!0)}else t.nextStep()}function Ut(){t.previousStep()}function ne(){u.value=!1,K.value==="success"&&r.push("/login")}const pe=["Welcome","Repeater Name","Hardware Selection","Radio Configuration","Security Setup"];return(me,we)=>(Or(),Nr("div",bIt,[At("div",wIt,[Vs(LL)]),we[36]||(we[36]=At("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),we[37]||(we[37]=At("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),we[38]||(we[38]=At("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),At("div",kIt,[At("div",TIt,[At("div",SIt,[At("span",CIt,"Step "+yn(Io(t).currentStep)+" of "+yn(Io(t).totalSteps),1),At("span",AIt,yn(Math.round(yt.value))+"% Complete",1)]),At("div",MIt,[At("div",{class:"h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500",style:Sp({width:`${yt.value}%`})},null,4)])]),At("div",EIt,[At("div",LIt,[At("div",PIt,[(Or(!0),Nr(Es,null,jl(Io(t).totalSteps,Ce=>(Or(),Nr("div",{key:Ce,class:ja(["w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all",Ce===Io(t).currentStep?"bg-primary text-white":Ce

Welcome to your pyMC Repeater! Let's get you set up in just a few steps.

You'll configure:

  • Repeater name and identification
  • Hardware board selection
  • Radio frequency and settings
  • Admin password for secure access
',1)]))):Io(t).currentStep===2?(Or(),Nr("div",OIt,[we[12]||(we[12]=At("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Choose a unique name for your repeater. This will be used for identification on the mesh network. ",-1)),At("div",BIt,[we[10]||(we[10]=At("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Repeater Name",-1)),Ml(At("input",{"onUpdate:modelValue":we[0]||(we[0]=Ce=>Io(t).nodeName=Ce),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"e.g., pyRpt0001",maxlength:"32"},null,512),[[lu,Io(t).nodeName]]),we[11]||(we[11]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-2"}," Use letters, numbers, hyphens, or underscores (3-32 characters) ",-1))])])):Io(t).currentStep===3?(Or(),Nr("div",RIt,[we[13]||(we[13]=At("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Select your hardware board type ",-1)),Io(t).isLoading?(Or(),Nr("div",FIt," Loading hardware options... ")):Io(t).hardwareOptions.length===0?(Or(),Nr("div",NIt," No hardware options available ")):(Or(),Nr("div",jIt,[(Or(!0),Nr(Es,null,jl(Io(t).hardwareOptions,Ce=>(Or(),Nr("button",{key:Ce.key,onClick:Ve=>Io(t).selectedHardware=Ce,class:ja(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",Io(t).selectedHardware?.key===Ce.key?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[At("div",$It,yn(Ce.name),1),At("div",HIt,yn(Ce.description||Ce.key),1)],10,UIt))),128))]))])):Io(t).currentStep===4?(Or(),Nr("div",VIt,[we[28]||(we[28]=At("p",{class:"text-white/70 text-center mb-6"}," Choose a radio configuration preset for your region or create a custom configuration ",-1)),Io(t).isLoading?(Or(),Nr("div",WIt," Loading radio presets... ")):Io(t).radioPresets.length===0?(Or(),Nr("div",qIt," No radio presets available ")):(Or(),Nr("div",GIt,[At("div",ZIt,[(Or(!0),Nr(Es,null,jl(Io(t).radioPresets,Ce=>(Or(),Nr("button",{key:Ce.title,onClick:Ve=>{Io(t).selectedRadioPreset=Ce,Io(t).useCustomRadio=!1},class:ja(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden",!Io(t).useCustomRadio&&Io(t).selectedRadioPreset?.title===Ce.title?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[At("div",YIt,[At("div",XIt,[At("span",JIt,[At("span",QIt,yn(ct(Ce.title)),1),At("span",null,yn(Ce.title),1)]),!Io(t).useCustomRadio&&Io(t).selectedRadioPreset?.title===Ce.title?(Or(),Nr("div",tDt,we[14]||(we[14]=[At("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[At("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):Ta("",!0)]),At("div",eDt,yn(Ce.description),1),At("div",rDt,[At("div",nDt,[we[15]||(we[15]=At("div",{class:"text-content-muted dark:text-content-muted"},"Freq",-1)),At("div",iDt,yn(Ce.frequency),1)]),At("div",aDt,[we[16]||(we[16]=At("div",{class:"text-content-muted dark:text-content-muted"},"BW",-1)),At("div",oDt,yn(Ce.bandwidth),1)]),At("div",sDt,[we[17]||(we[17]=At("div",{class:"text-content-muted dark:text-content-muted"},"SF",-1)),At("div",lDt,yn(Ce.spreading_factor),1)]),At("div",cDt,[we[18]||(we[18]=At("div",{class:"text-content-muted dark:text-content-muted"},"CR",-1)),At("div",uDt,yn(Ce.coding_rate),1)])])])],10,KIt))),128))]),At("div",hDt,[At("button",{onClick:we[1]||(we[1]=Ce=>{Io(t).useCustomRadio=!Io(t).useCustomRadio,Io(t).useCustomRadio&&(Io(t).selectedRadioPreset=null)}),class:ja(["w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",Io(t).useCustomRadio?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[At("div",dDt,[we[20]||(we[20]=At("div",{class:"font-medium text-content-primary dark:text-content-primary flex items-center gap-2"},[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})]),cl(" Custom Configuration ")],-1)),Io(t).useCustomRadio?(Or(),Nr("div",fDt,we[19]||(we[19]=[At("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[At("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):Ta("",!0)]),we[21]||(we[21]=At("div",{class:"text-xs text-content-secondary dark:text-content-muted"},"Manually configure frequency, bandwidth, spreading factor, and coding rate",-1))],2),Vs(F2,{name:"slide"},{default:V1(()=>[Io(t).useCustomRadio?(Or(),Nr("div",pDt,[At("div",null,[we[22]||(we[22]=At("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Frequency (MHz)",-1)),Ml(At("input",{"onUpdate:modelValue":we[2]||(we[2]=Ce=>Io(t).customRadio.frequency=Ce),type:"number",step:"0.1",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"915.0"},null,512),[[lu,Io(t).customRadio.frequency]])]),At("div",null,[we[23]||(we[23]=At("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Bandwidth (kHz)",-1)),Ml(At("input",{"onUpdate:modelValue":we[3]||(we[3]=Ce=>Io(t).customRadio.bandwidth=Ce),type:"number",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"125"},null,512),[[lu,Io(t).customRadio.bandwidth]])]),At("div",null,[we[25]||(we[25]=At("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Spreading Factor",-1)),Ml(At("select",{"onUpdate:modelValue":we[4]||(we[4]=Ce=>Io(t).customRadio.spreading_factor=Ce),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},we[24]||(we[24]=[At("option",{value:"7"},"7",-1),At("option",{value:"8"},"8",-1),At("option",{value:"9"},"9",-1),At("option",{value:"10"},"10",-1),At("option",{value:"11"},"11",-1),At("option",{value:"12"},"12",-1)]),512),[[xg,Io(t).customRadio.spreading_factor]])]),At("div",null,[we[27]||(we[27]=At("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Coding Rate",-1)),Ml(At("select",{"onUpdate:modelValue":we[5]||(we[5]=Ce=>Io(t).customRadio.coding_rate=Ce),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},we[26]||(we[26]=[At("option",{value:"5"},"4/5",-1),At("option",{value:"6"},"4/6",-1),At("option",{value:"7"},"4/7",-1),At("option",{value:"8"},"4/8",-1)]),512),[[xg,Io(t).customRadio.coding_rate]])])])):Ta("",!0)]),_:1})])]))])):Io(t).currentStep===5?(Or(),Nr("div",mDt,[we[32]||(we[32]=At("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Set a secure admin password to protect your repeater ",-1)),At("div",gDt,[At("div",null,[we[29]||(we[29]=At("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Admin Password",-1)),Ml(At("input",{"onUpdate:modelValue":we[6]||(we[6]=Ce=>Io(t).adminPassword=Ce),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Enter password (min 6 characters)",minlength:"6"},null,512),[[lu,Io(t).adminPassword]])]),At("div",null,[we[30]||(we[30]=At("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Confirm Password",-1)),Ml(At("input",{"onUpdate:modelValue":we[7]||(we[7]=Ce=>Io(t).confirmPassword=Ce),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Confirm password"},null,512),[[lu,Io(t).confirmPassword]])]),Io(t).adminPassword&&Io(t).confirmPassword&&Io(t).adminPassword!==Io(t).confirmPassword?(Or(),Nr("div",vDt," Passwords do not match ")):Ta("",!0),we[31]||(we[31]=At("div",{class:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200"},[At("strong",null,"Important:"),cl(" Remember this password - you'll need it to access the dashboard. ")],-1))])])):Ta("",!0)]),Io(t).error?(Or(),Nr("div",yDt,yn(Io(t).error),1)):Ta("",!0),At("div",_Dt,[Io(t).canGoBack?(Or(),Nr("button",{key:0,onClick:Ut,class:"px-6 py-3 rounded-[12px] bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20 transition-all duration-300 font-medium"}," Back ")):(Or(),Nr("div",xDt)),At("button",{onClick:St,disabled:!Io(t).canGoNext||Io(t).isSubmitting,class:ja(["px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",Io(t).canGoNext&&!Io(t).isSubmitting?"bg-gradient-to-r from-primary/20 to-primary/10 hover:from-primary/30 hover:to-primary/20 text-white border border-primary/30 hover:border-primary/50":"bg-background-mute dark:bg-stroke/5 text-content-muted dark:text-content-muted border border-stroke-subtle dark:border-stroke/10"])},[Io(t).isSubmitting?(Or(),Nr("div",wDt)):Ta("",!0),Io(t).isSubmitting?(Or(),Nr("span",kDt,"Setting up...")):Io(t).isLastStep?(Or(),Nr("span",TDt,"Complete Setup")):(Or(),Nr("span",SDt,"Next")),!Io(t).isSubmitting&&!Io(t).isLastStep?(Or(),Nr("svg",CDt,we[33]||(we[33]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]))):Ta("",!0)],10,bDt)])])]),Vs(F2,{name:"modal"},{default:V1(()=>[u.value?(Or(),Nr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",onClick:ne},[At("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-md w-full p-8 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]",onClick:we[8]||(we[8]=Od(()=>{},["stop"]))},[At("div",ADt,[K.value==="success"?(Or(),Nr("div",MDt,we[34]||(we[34]=[At("svg",{class:"w-8 h-8 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)]))):(Or(),Nr("div",EDt,we[35]||(we[35]=[At("svg",{class:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])))]),At("h3",LDt,yn(T.value),1),At("p",PDt,yn($.value),1),At("button",{onClick:ne,class:ja(["w-full px-6 py-3 rounded-lg font-medium transition-all",K.value==="success"?"bg-gradient-to-r from-primary/20 to-primary/10 hover:from-primary/30 hover:to-primary/20 text-white":"bg-gradient-to-r from-red-500/20 to-red-500/10 hover:from-red-500/30 hover:to-red-500/20 text-white"])},yn(K.value==="success"?"Continue to Login":"Close"),3)])])):Ta("",!0)]),_:1})]))}}),DDt=vh(IDt,[["__scopeId","data-v-51265336"]]),W1=Est({history:sst("/"),routes:[{path:"/setup",name:"setup",component:DDt,meta:{requiresAuth:!1,requiresSetup:!1}},{path:"/login",name:"login",component:_It,meta:{requiresAuth:!1}},{path:"/",name:"dashboard",component:uvt,meta:{requiresAuth:!0}},{path:"/neighbors",name:"neighbors",component:Eyt,meta:{requiresAuth:!0}},{path:"/statistics",name:"statistics",component:Xbt,meta:{requiresAuth:!0}},{path:"/system-stats",name:"system-stats",component:rwt,meta:{requiresAuth:!0}},{path:"/configuration",name:"configuration",component:d6t,meta:{requiresAuth:!0}},{path:"/cad-calibration",name:"cad-calibration",component:j6t,meta:{requiresAuth:!0}},{path:"/sessions",name:"sessions",component:tSt,meta:{requiresAuth:!0}},{path:"/room-servers",name:"room-servers",component:wCt,meta:{requiresAuth:!0}},{path:"/logs",name:"logs",component:$Ct,meta:{requiresAuth:!0}},{path:"/terminal",name:"terminal",component:PPt,meta:{requiresAuth:!0}},{path:"/help",name:"help",component:IPt,meta:{requiresAuth:!0}}]});async function ij(){try{const e=await fetch("/api/needs_setup",{headers:{Accept:"application/json"}});if(!e.ok)return console.error("Setup check failed:",e.status),!1;const t=await e.json();return console.log("Setup status check:",t),t.needs_setup===!0}catch(e){return console.error("Error checking setup status:",e),!1}}W1.beforeEach(async(e,t,r)=>{const u=e.meta.requiresAuth!==!1,T=p$();if(e.path!=="/setup"&&await ij()){r("/setup");return}if(e.path==="/setup"&&!await ij()){r("/login");return}u&&!T?r("/login"):e.path==="/login"&&T?r("/"):r()});const zDt="/api",PL="";let zM=!1,n5=null;async function DW(){return zM&&n5||(zM=!0,n5=(async()=>{try{const e=Wx();if(!e)throw new Error("No token to refresh");const t=f$(),r=await cf.post(`${PL}/auth/refresh`,{client_id:t},{headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}});if(r.data.success&&r.data.token){const u=r.data.token;return i9(u),console.log("Token refreshed successfully"),u}else throw new Error("Token refresh failed")}catch(e){throw console.error("Token refresh error:",e),Y2(),W1.push("/login"),e}finally{zM=!1,n5=null}})()),n5}const Tx=cf.create({baseURL:zDt,timeout:5e3,headers:{"Content-Type":"application/json"}}),nw=cf.create({baseURL:PL,timeout:5e3,headers:{"Content-Type":"application/json"}});nw.interceptors.request.use(async e=>{if(e.url?.includes("/auth/login")||e.url?.includes("/auth/refresh"))return e;const t=Wx();if(t){if(g$())try{const r=await DW();return e.headers.Authorization=`Bearer ${r}`,e}catch(r){return Promise.reject(r)}if(m$())return Y2(),W1.push("/login"),Promise.reject(new Error("Token expired"));e.headers.Authorization=`Bearer ${t}`}return e},e=>(console.error("Auth API Request Error:",e),Promise.reject(e)));nw.interceptors.response.use(e=>e,e=>(e.response?.status===401&&(Y2(),W1.currentRoute.value.path!=="/login"&&W1.push("/login")),console.error("Auth API Response Error:",e.response?.data||e.message),Promise.reject(e)));Tx.interceptors.request.use(async e=>{if(e.url?.includes("/auth/login"))return e;const t=Wx();if(t){if(g$())try{const r=await DW();return e.headers.Authorization=`Bearer ${r}`,e}catch(r){return Promise.reject(r)}if(m$())return Y2(),W1.push("/login"),Promise.reject(new Error("Token expired"));e.headers.Authorization=`Bearer ${t}`}return e},e=>(console.error("API Request Error:",e),Promise.reject(e)));Tx.interceptors.response.use(e=>e,e=>(e.response?.status===401&&(Y2(),W1.currentRoute.value.path!=="/login"&&W1.push("/login")),console.error("API Response Error:",e.response?.data||e.message),Promise.reject(e)));class bs{static async get(t,r){try{return(await Tx.get(t,{params:r})).data}catch(u){throw this.handleError(u)}}static async post(t,r,u){try{return(await Tx.post(t,r,u)).data}catch(T){throw this.handleError(T)}}static async put(t,r,u){try{return(await Tx.put(t,r,u)).data}catch(T){throw this.handleError(T)}}static async delete(t,r){try{return(await Tx.delete(t,r)).data}catch(u){throw this.handleError(u)}}static async getTransportKeys(){return this.get("transport_keys")}static async sendAdvert(){return this.post("send_advert",{},{headers:{"Content-Type":"application/json"}})}static async createTransportKey(t,r,u,T,$){const K={name:t,flood_policy:r,parent_id:T,last_used:$};return u!==void 0&&(K.transport_key=u),this.post("transport_keys",K)}static async getTransportKey(t){return this.get(`transport_key/${t}`)}static async updateTransportKey(t,r,u,T,$,K){return this.put(`transport_key/${t}`,{name:r,flood_policy:u,transport_key:T,parent_id:$,last_used:K})}static async deleteTransportKey(t){return this.delete(`transport_key/${t}`)}static async updateGlobalFloodPolicy(t){return this.post("global_flood_policy",{global_flood_allow:t})}static async getLogs(){try{return(await Tx.get("logs")).data}catch(t){throw this.handleError(t)}}static async deleteAdvert(t){return this.delete(`advert/${t}`)}static async pingNeighbor(t,r=10){return this.post("ping_neighbor",{target_id:t,timeout:r})}static async getIdentities(){return this.get("identities")}static async getIdentity(t){return this.get("identity",{name:t})}static async createIdentity(t){return this.post("create_identity",t)}static async updateIdentity(t){return this.put("update_identity",t)}static async deleteIdentity(t){return this.delete(`delete_identity?name=${encodeURIComponent(t)}`)}static async sendRoomServerAdvert(t){return this.post("send_room_server_advert",{name:t})}static async getACLInfo(){return this.get("acl_info")}static async getACLClients(t){return this.get("acl_clients",t)}static async removeACLClient(t){return this.post("acl_remove_client",t)}static async getACLStats(){return this.get("acl_stats")}static async getRoomMessages(t){return this.get("room_messages",t)}static async postRoomMessage(t){return this.post("room_post_message",t)}static async deleteRoomMessage(t){return this.delete(`room_message?room_name=${encodeURIComponent(t.room_name)}&message_id=${t.message_id}`)}static async clearRoomMessages(t){return this.delete(`room_messages?room_name=${encodeURIComponent(t)}`)}static async getRoomStats(t){return this.get("room_stats",t?{room_name:t}:void 0)}static async getRoomClients(t){return this.get("room_clients",{room_name:t})}static handleError(t){if(cf.isAxiosError(t)){if(t.response){const r=t.response.data?.error||t.response.data?.message||`HTTP ${t.response.status}`;return new Error(r)}else if(t.request)return new Error("Network error - no response received")}return new Error(t instanceof Error?t.message:"Unknown error occurred")}}const Ym=OS("system",()=>{const e=li(null),t=li(!1),r=li(null),u=li(null),T=li("forward"),$=li(!0),K=li(0),ct=li(10),yt=li(!1),St=Ao(()=>e.value?.config?.node_name??"Unknown"),Ut=Ao(()=>{const _r=e.value?.public_key;return!_r||_r==="Unknown"?"Unknown":_r.length>=16?`${_r.slice(0,8)} ... ${_r.slice(-8)}`:`${_r}`}),ne=Ao(()=>e.value!==null),pe=Ao(()=>e.value?.version??"Unknown"),me=Ao(()=>e.value?.core_version??"Unknown"),we=Ao(()=>e.value?.noise_floor_dbm??null),Ce=Ao(()=>ct.value>0?Math.min(K.value/ct.value*100,100):0),Ve=Ao(()=>T.value==="monitor"?{text:"Monitor Mode",title:"Monitoring only - not forwarding packets"}:$.value?{text:"Active",title:"Forwarding with duty cycle enforcement"}:{text:"No Limits",title:"Forwarding without duty cycle enforcement"}),kr=Ao(()=>T.value==="monitor"?{active:!1,warning:!0}:{active:!0,warning:!1}),It=Ao(()=>$.value?{active:!0,warning:!1}:{active:!1,warning:!0}),rn=_r=>{yt.value=_r};async function Lr(){try{t.value=!0,r.value=null;const _r=await bs.get("/stats");if(_r.success&&_r.data)return e.value=_r.data,u.value=new Date,Mr(_r.data),_r.data;if(_r&&"version"in _r){const Sr=_r;return e.value=Sr,u.value=new Date,Mr(Sr),Sr}else throw new Error(_r.error||"Failed to fetch stats")}catch(_r){throw r.value=_r instanceof Error?_r.message:"Unknown error occurred",console.error("Error fetching stats:",_r),_r}finally{t.value=!1}}function Mr(_r){if(_r.config){const Dr=_r.config.repeater?.mode;(Dr==="forward"||Dr==="monitor")&&(T.value=Dr);const nn=_r.config.duty_cycle;if(nn){$.value=nn.enforcement_enabled!==!1;const Cn=nn.max_airtime_percent;typeof Cn=="number"?ct.value=Cn:Cn&&typeof Cn=="object"&&"parsedValue"in Cn&&(ct.value=Cn.parsedValue||10)}}const Sr=_r.utilization_percent;typeof Sr=="number"?K.value=Sr:Sr&&typeof Sr=="object"&&"parsedValue"in Sr&&(K.value=Sr.parsedValue||0)}async function tn(_r){try{const Sr=await bs.post("/set_mode",{mode:_r});if(Sr.success)return T.value=_r,!0;throw new Error(Sr.error||"Failed to set mode")}catch(Sr){throw r.value=Sr instanceof Error?Sr.message:"Unknown error occurred",console.error("Error setting mode:",Sr),Sr}}async function Dn(_r){try{const Sr=await bs.post("/set_duty_cycle",{enabled:_r});if(Sr.success)return $.value=_r,!0;throw new Error(Sr.error||"Failed to set duty cycle")}catch(Sr){throw r.value=Sr instanceof Error?Sr.message:"Unknown error occurred",console.error("Error setting duty cycle:",Sr),Sr}}async function Mn(){try{const _r=await bs.post("/send_advert",{},{timeout:1e4});if(_r.success)return console.log("Advertisement sent successfully:",_r.data),!0;throw new Error(_r.error||"Failed to send advert")}catch(_r){throw r.value=_r instanceof Error?_r.message:"Unknown error occurred",console.error("Error sending advert:",_r),_r}}async function Br(){const _r=T.value==="forward"?"monitor":"forward";return await tn(_r)}async function Vn(){return await Dn(!$.value)}async function on(_r=5e3){await Lr();const Sr=setInterval(async()=>{try{await Lr()}catch(Dr){console.error("Auto-refresh error:",Dr)}},_r);return()=>clearInterval(Sr)}function pr(){e.value=null,r.value=null,u.value=null,t.value=!1,T.value="forward",$.value=!0,K.value=0,ct.value=10}return{stats:e,isLoading:t,error:r,lastUpdated:u,currentMode:T,dutyCycleEnabled:$,dutyCycleUtilization:K,dutyCycleMax:ct,cadCalibrationRunning:yt,nodeName:St,pubKey:Ut,hasStats:ne,version:pe,coreVersion:me,noiseFloorDbm:we,dutyCyclePercentage:Ce,statusBadge:Ve,modeButtonState:kr,dutyCycleButtonState:It,fetchStats:Lr,setMode:tn,setDutyCycle:Dn,sendAdvert:Mn,toggleMode:Br,toggleDutyCycle:Vn,startAutoRefresh:on,reset:pr,setCadCalibrationRunning:rn}}),ODt={class:"glass-card p-5 relative overflow-hidden"},BDt={key:0,class:"absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-10 rounded-lg"},RDt={class:"flex items-baseline gap-2 mb-4"},FDt={class:"text-content-primary dark:text-content-primary text-2xl font-medium"},NDt=["viewBox"],jDt=["y1","y2"],UDt=["cx","cy"],OM=200,i5=50,pT=4,$Dt=Cc({__name:"RFNoiseFloor",setup(e){const t=u4(),r=Ym(),u=li(null),T=(St,Ut)=>{const ne=Ut/100*(St.length-1),pe=Math.floor(ne),me=Math.ceil(ne);return pe===me?St[pe]:St[pe]+(St[me]-St[pe])*(ne-pe)},$=Ao(()=>{const St=yt.value;if(St.length===0)return[];const Ut=[...St].sort((It,rn)=>It-rn),ne=T(Ut,2.5),pe=T(Ut,97.5),me=pe-ne,we=Math.max(me*.05,.5),Ce=ne-we,Ve=pe+we,kr=Ve-Ce||1;return St.map((It,rn)=>{const Lr=pT+rn/Math.max(St.length-1,1)*(OM-pT*2),tn=(Math.max(Ce,Math.min(Ve,It))-Ce)/kr,Dn=i5-pT-tn*(i5-pT*2);return{x:Lr,y:Dn}})}),K=async()=>{try{await Promise.all([t.fetchNoiseFloorHistory({hours:1}),t.fetchNoiseFloorStats({hours:1})])}catch(St){console.error("Error fetching noise floor data:",St)}};Xd(()=>{K(),u.value=window.setInterval(K,5e3)}),Tg(()=>{u.value&&clearInterval(u.value)});const ct=Ao(()=>{const St=t.noiseFloorSparklineData;return St&&St.length>0?St[St.length-1]:t.noiseFloorStats?.avg_noise_floor??-116}),yt=Ao(()=>t.noiseFloorSparklineData);return(St,Ut)=>(Or(),Nr("div",ODt,[Io(r).cadCalibrationRunning?(Or(),Nr("div",BDt,Ut[0]||(Ut[0]=[Du('
CAD Calibration

In Progress

',1)]))):Ta("",!0),Ut[2]||(Ut[2]=At("p",{class:"text-content-secondary dark:text-content-muted text-xs uppercase mb-2"},"RF NOISE FLOOR",-1)),At("div",RDt,[At("span",FDt,yn(ct.value),1),Ut[1]||(Ut[1]=At("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase"},"dBm",-1))]),(Or(),Nr("svg",{class:"w-full h-[50px]",viewBox:`0 0 ${OM} ${i5}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(Or(),Nr(Es,null,jl(3,ne=>At("line",{key:"grid-"+ne,x1:0,y1:ne*i5/4,x2:OM,y2:ne*i5/4,stroke:"rgba(255, 255, 255, 0.1)","stroke-width":"1"},null,8,jDt)),64)),(Or(!0),Nr(Es,null,jl($.value,(ne,pe)=>(Or(),Nr("circle",{key:"point-"+pe,cx:ne.x,cy:ne.y,r:"2.5",fill:"rgba(245, 158, 11, 0.8)",class:"transition-all duration-300"},null,8,UDt))),128))],8,NDt))]))}}),zW=vh($Dt,[["__scopeId","data-v-ed727f45"]]),HDt={},VDt={width:"800px",height:"800px",viewBox:"0 -1.5 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"w-full h-full"};function WDt(e,t){return Or(),Nr("svg",VDt,t[0]||(t[0]=[At("g",{id:"Page-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[At("g",{transform:"translate(-420.000000, -3641.000000)",fill:"currentColor"},[At("g",{id:"icons",transform:"translate(56.000000, 160.000000)"},[At("path",{d:"M378.195439,3483.828 L376.781439,3485.242 C378.195439,3486.656 378.294439,3489.588 376.880439,3491.002 L378.294439,3492.417 C380.415439,3490.295 380.316439,3485.949 378.195439,3483.828 M381.023439,3481 L379.609439,3482.414 C382.438439,3485.242 382.537439,3491.002 379.708439,3493.831 L381.122439,3495.245 C385.365439,3491.002 384.559439,3484.535 381.023439,3481 M375.432439,3486.737 C375.409439,3486.711 375.392439,3486.682 375.367439,3486.656 L375.363439,3486.66 C374.582439,3485.879 373.243439,3485.952 372.536439,3486.659 C371.829439,3487.366 371.831439,3488.778 372.538439,3489.485 C372.547439,3489.494 372.558439,3489.499 372.567439,3489.508 C372.590439,3489.534 372.607439,3489.563 372.632439,3489.588 L372.636439,3489.585 C373.201439,3490.15 373.000439,3488.284 373.000439,3498 L375.000439,3498 C375.000439,3488.058 374.753439,3490.296 375.463439,3489.586 C376.170439,3488.879 376.168439,3487.467 375.461439,3486.76 C375.452439,3486.751 375.441439,3486.746 375.432439,3486.737 M371.119439,3485.242 L369.705439,3483.828 C367.584439,3485.949 367.683439,3490.295 369.804439,3492.417 L371.218439,3491.002 C369.804439,3489.588 369.705439,3486.656 371.119439,3485.242 M368.390439,3493.831 L366.976439,3495.245 C363.440439,3491.709 362.634439,3485.242 366.877439,3481 L368.291439,3482.414 C365.462439,3485.242 365.561439,3491.002 368.390439,3493.831",id:"radio_tower-[#1019]"})])])],-1)]))}const qDt=vh(HDt,[["render",WDt]]),GDt={class:"text-center"},ZDt={class:"relative flex items-center justify-center mb-8"},KDt={class:"relative w-32 h-32"},YDt={class:"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2"},XDt={key:0,class:"absolute inset-0 flex items-center justify-center"},JDt={key:1,class:"absolute inset-0 flex items-center justify-center"},QDt={key:2,class:"absolute inset-0"},tzt={class:"mb-6"},ezt={key:0,class:"text-content-primary dark:text-content-primary text-lg"},rzt={key:1,class:"text-accent-green text-lg font-medium"},nzt={key:2,class:"text-secondary text-lg"},izt={key:3,class:"text-accent-red text-lg"},azt={key:4,class:"text-content-secondary dark:text-content-muted"},ozt={key:5,class:"mt-3"},szt={key:0,class:"text-secondary text-sm"},lzt={key:1,class:"text-accent-red text-sm"},czt={key:0,class:"flex gap-3"},uzt={key:1,class:"text-content-muted text-sm"},hzt=Cc({name:"AdvertModal",__name:"AdvertModal",props:{isOpen:{type:Boolean},isLoading:{type:Boolean},isSuccess:{type:Boolean},error:{default:null}},emits:["close","send"],setup(e,{emit:t}){const r=e,u=t,T=li(!1),$=li(!1),K=li(!1);Fh(()=>r.isOpen,Ut=>{Ut?(T.value=!0,setTimeout(()=>{$.value=!0},50)):($.value=!1,K.value=!1,setTimeout(()=>{T.value=!1},300))},{immediate:!0}),Fh(()=>r.isLoading,Ut=>{Ut||setTimeout(()=>{K.value=!1},1e3)});const ct=()=>{r.isLoading||u("close")},yt=()=>{r.isLoading||(K.value=!0,u("send"))},St=Ut=>Ut?.includes("Network error - no response received")||Ut?.includes("timeout");return(Ut,ne)=>(Or(),w0(CS,{to:"body"},[T.value?(Or(),Nr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:Od(ct,["self"])},[At("div",{class:ja(["absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-300",$.value?"opacity-100":"opacity-0"])},null,2),At("div",{class:ja(["relative bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-8 max-w-md w-full transform transition-all duration-300 border border-stroke-subtle dark:border-white/10",$.value?"scale-100 opacity-100":"scale-95 opacity-0"])},[Ut.isLoading?Ta("",!0):(Or(),Nr("button",{key:0,onClick:ct,class:"absolute top-4 right-4 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors p-2"},ne[0]||(ne[0]=[At("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))),At("div",GDt,[ne[6]||(ne[6]=At("h2",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-6"},"Send Advertisement",-1)),At("div",ZDt,[At("div",KDt,[At("div",YDt,[Vs(qDt,{class:ja(["w-16 h-16 transition-all duration-500",[Ut.isLoading?"animate-pulse":"",Ut.isSuccess?"text-accent-green":Ut.error&&!St(Ut.error)?"text-accent-red":"text-primary"]]),style:Sp({filter:Ut.isLoading?"drop-shadow(0 0 8px currentColor)":Ut.isSuccess?"drop-shadow(0 0 8px #A5E5B6)":Ut.error&&!St(Ut.error)?"drop-shadow(0 0 8px #FB787B)":"drop-shadow(0 0 4px #AAE8E8)"})},null,8,["class","style"])]),Ut.isLoading||Ut.isSuccess?(Or(),Nr("div",XDt,[At("div",{class:ja(["absolute w-16 h-16 rounded-full border-2 animate-ping",[Ut.isSuccess?"border-accent-green/60":"border-primary/60"]]),style:{"animation-duration":"1.5s"}},null,2),At("div",{class:ja(["absolute w-24 h-24 rounded-full border-2 animate-ping",[Ut.isSuccess?"border-accent-green/40":"border-primary/40"]]),style:{"animation-duration":"2s","animation-delay":"0.3s"}},null,2),At("div",{class:ja(["absolute w-32 h-32 rounded-full border-2 animate-ping",[Ut.isSuccess?"border-accent-green/20":"border-primary/20"]]),style:{"animation-duration":"2.5s","animation-delay":"0.6s"}},null,2)])):Ta("",!0),K.value?(Or(),Nr("div",JDt,ne[1]||(ne[1]=[At("div",{class:"absolute w-8 h-8 rounded-full border-4 border-secondary animate-ping-fast"},null,-1),At("div",{class:"absolute w-16 h-16 rounded-full border-3 border-secondary/70 animate-ping-fast",style:{"animation-delay":"0.1s"}},null,-1),At("div",{class:"absolute w-24 h-24 rounded-full border-2 border-secondary/50 animate-ping-fast",style:{"animation-delay":"0.2s"}},null,-1),At("div",{class:"absolute w-32 h-32 rounded-full border-2 border-secondary/30 animate-ping-fast",style:{"animation-delay":"0.3s"}},null,-1)]))):Ta("",!0),Ut.isLoading||Ut.isSuccess?(Or(),Nr("div",QDt,[At("div",{class:ja(["absolute top-2 right-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Ut.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"0.5s"}},ne[2]||(ne[2]=[At("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),At("div",{class:ja(["absolute bottom-2 left-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Ut.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1s"}},ne[3]||(ne[3]=[At("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),At("div",{class:ja(["absolute top-1/2 right-1 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Ut.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1.5s",transform:"translateY(-50%)"}},ne[4]||(ne[4]=[At("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),At("div",{class:ja(["absolute top-3 left-3 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Ut.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"2s"}},ne[5]||(ne[5]=[At("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2)])):Ta("",!0)])]),At("div",tzt,[Ut.isLoading?(Or(),Nr("p",ezt," Broadcasting advertisement... ")):Ut.isSuccess?(Or(),Nr("p",rzt," Advertisement sent successfully! ")):Ut.error&&St(Ut.error)?(Or(),Nr("p",nzt," Advertisement likely sent ")):Ut.error?(Or(),Nr("p",izt," Failed to send advertisement ")):(Or(),Nr("p",azt," This will broadcast your node's presence to nearby nodes. ")),Ut.error?(Or(),Nr("div",ozt,[St(Ut.error)?(Or(),Nr("p",szt," Network timeout occurred, but the advertisement may have been successfully transmitted to nearby nodes. ")):(Or(),Nr("p",lzt,yn(Ut.error),1))])):Ta("",!0)]),!Ut.isLoading&&!Ut.isSuccess?(Or(),Nr("div",czt,[At("button",{onClick:ct,class:"flex-1 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 hover:border-primary rounded-[10px] px-6 py-3 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 transition-all duration-200"}," Cancel "),At("button",{onClick:yt,class:ja(["flex-1 rounded-[10px] px-6 py-3 font-medium transition-all duration-200 shadow-lg",[Ut.error&&St(Ut.error)?"bg-secondary hover:bg-secondary/90 text-background hover:shadow-secondary/20":"bg-primary hover:bg-primary/90 text-background hover:shadow-primary/20"]])},yn(Ut.error&&St(Ut.error)?"Try Again":"Send Advertisement"),3)])):Ta("",!0),Ut.isSuccess?(Or(),Nr("div",uzt," Closing automatically... ")):Ta("",!0)])],2)])):Ta("",!0)]))}}),OW=vh(hzt,[["__scopeId","data-v-2eb89c71"]]),dzt={},fzt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pzt(e,t){return Or(),Nr("svg",fzt,t[0]||(t[0]=[Du('',2)]))}const vS=vh(dzt,[["render",pzt]]),mzt={},gzt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function vzt(e,t){return Or(),Nr("svg",gzt,t[0]||(t[0]=[Du('',9)]))}const BW=vh(mzt,[["render",vzt]]),yzt={},_zt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xzt(e,t){return Or(),Nr("svg",_zt,t[0]||(t[0]=[Du('',2)]))}const RW=vh(yzt,[["render",xzt]]),bzt={},wzt={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kzt(e,t){return Or(),Nr("svg",wzt,t[0]||(t[0]=[At("path",{d:"M9.81633 1.99133L8.5085 0.683492C8.29229 0.466088 8.03511 0.293723 7.75185 0.176372C7.46859 0.059021 7.16486 -0.000985579 6.85825 -0.000175002H1.75C1.28587 -0.000175002 0.840752 0.184199 0.512563 0.512388C0.184375 0.840577 0 1.2857 0 1.74983V13.9998H10.5V3.64099C10.4985 3.02248 10.2528 2.4296 9.81633 1.99133ZM8.9915 2.81616C9.02083 2.84799 9.04829 2.88149 9.07375 2.91649H7.58333V1.42608C7.61834 1.45153 7.65184 1.479 7.68367 1.50833L8.9915 2.81616ZM1.16667 12.8332V1.74983C1.16667 1.59512 1.22812 1.44674 1.33752 1.33735C1.44692 1.22795 1.59529 1.16649 1.75 1.16649H6.41667V4.08316H9.33333V12.8332H1.16667ZM2.33333 9.33316H8.16667V5.83316H2.33333V9.33316ZM3.5 6.99983H7V8.16649H3.5V6.99983ZM2.33333 10.4998H8.16667V11.6665H2.33333V10.4998Z",fill:"currentColor"},null,-1)]))}const FW=vh(bzt,[["render",kzt]]),Tzt={},Szt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Czt(e,t){return Or(),Nr("svg",Szt,t[0]||(t[0]=[At("path",{d:"M12.25 0H1.75C1.28587 0 0.840752 0.184375 0.512563 0.512563C0.184375 0.840752 0 1.28587 0 1.75V12.25C0 12.7141 0.184375 13.1592 0.512563 13.4874C0.840752 13.8156 1.28587 14 1.75 14H12.25C12.7141 14 13.1592 13.8156 13.4874 13.4874C13.8156 13.1592 14 12.7141 14 12.25V1.75C14 1.28587 13.8156 0.840752 13.4874 0.512563C13.1592 0.184375 12.7141 0 12.25 0ZM12.8333 12.25C12.8333 12.4047 12.7719 12.5531 12.6625 12.6625C12.5531 12.7719 12.4047 12.8333 12.25 12.8333H1.75C1.59529 12.8333 1.44692 12.7719 1.33752 12.6625C1.22812 12.5531 1.16667 12.4047 1.16667 12.25V1.75C1.16667 1.59529 1.22812 1.44692 1.33752 1.33752C1.44692 1.22812 1.59529 1.16667 1.75 1.16667H12.25C12.4047 1.16667 12.5531 1.22812 12.6625 1.33752C12.7719 1.44692 12.8333 1.59529 12.8333 1.75V12.25ZM3.23583 7.41317L5.23583 9.41317C5.29134 9.46685 5.35738 9.50892 5.43004 9.53689C5.5027 9.56485 5.58055 9.57812 5.65892 9.57579C5.73729 9.57347 5.81418 9.5556 5.88513 9.52325C5.95608 9.4909 6.01963 9.44476 6.07175 9.38792C6.12387 9.33108 6.16351 9.26467 6.18833 9.19237C6.21315 9.12007 6.22263 9.04335 6.21618 8.96725C6.20973 8.89115 6.18746 8.81722 6.15078 8.74965C6.11411 8.68207 6.06376 8.62223 6.00292 8.57383L4.66708 7.23617L6.00292 5.90033C6.10827 5.78972 6.16669 5.64161 6.16522 5.48792C6.16375 5.33423 6.10251 5.1873 5.99491 5.07882C5.88731 4.97034 5.74082 4.90791 5.58716 4.90522C5.4335 4.90254 5.28489 4.95982 5.17367 5.06417L3.17367 7.06417C3.06317 7.17386 3.00063 7.32313 3.00063 7.47867C3.00063 7.63421 3.06317 7.78348 3.17367 7.89317L3.23583 7.41317ZM8.75 10.5H7.58333C7.4286 10.5 7.28025 10.5615 7.17085 10.6709C7.06146 10.7803 7 10.9286 7 11.0833C7 11.2381 7.06146 11.3864 7.17085 11.4958C7.28025 11.6052 7.4286 11.6667 7.58333 11.6667H8.75C8.90473 11.6667 9.05308 11.6052 9.16248 11.4958C9.27188 11.3864 9.33333 11.2381 9.33333 11.0833C9.33333 10.9286 9.27188 10.7803 9.16248 10.6709C9.05308 10.5615 8.90473 10.5 8.75 10.5Z",fill:"currentColor"},null,-1)]))}const NW=vh(Tzt,[["render",Czt]]),Azt={},Mzt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ezt(e,t){return Or(),Nr("svg",Mzt,t[0]||(t[0]=[Du('',2)]))}const jW=vh(Azt,[["render",Ezt]]),Lzt={name:"SystemIcon"},Pzt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Izt(e,t,r,u,T,$){return Or(),Nr("svg",Pzt,t[0]||(t[0]=[Du('',5)]))}const yS=vh(Lzt,[["render",Izt]]),Dzt={},zzt={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ozt(e,t){return Or(),Nr("svg",zzt,t[0]||(t[0]=[At("path",{d:"M10.5 14.0004H9.33333V11.0586C9.33287 10.6013 9.15099 10.1628 8.82761 9.83942C8.50422 9.51603 8.06575 9.33415 7.60842 9.33369H2.89158C2.43425 9.33415 1.99578 9.51603 1.67239 9.83942C1.34901 10.1628 1.16713 10.6013 1.16667 11.0586V14.0004H0V11.0586C0.000926233 10.292 0.305872 9.55705 0.847948 9.01497C1.39002 8.47289 2.12497 8.16795 2.89158 8.16702H7.60842C8.37503 8.16795 9.10998 8.47289 9.65205 9.01497C10.1941 9.55705 10.4991 10.292 10.5 11.0586V14.0004Z",fill:"currentColor"},null,-1),At("path",{d:"M5.25 6.99997C4.55777 6.99997 3.88108 6.7947 3.30551 6.41011C2.72993 6.02553 2.28133 5.4789 2.01642 4.83936C1.75152 4.19982 1.6822 3.49609 1.81725 2.81716C1.9523 2.13822 2.28564 1.51458 2.77513 1.0251C3.26461 0.535614 3.88825 0.202271 4.56719 0.0672226C5.24612 -0.0678257 5.94985 0.00148598 6.58939 0.266393C7.22894 0.531299 7.77556 0.979903 8.16015 1.55548C8.54473 2.13105 8.75 2.80774 8.75 3.49997C8.74908 4.42794 8.38003 5.31765 7.72385 5.97382C7.06768 6.63 6.17798 6.99904 5.25 6.99997ZM5.25 1.16664C4.78851 1.16664 4.33739 1.30349 3.95367 1.55988C3.56996 1.81627 3.27089 2.18068 3.09428 2.60704C2.91768 3.0334 2.87147 3.50256 2.9615 3.95518C3.05153 4.4078 3.27376 4.82357 3.60009 5.14989C3.92641 5.47621 4.34217 5.69844 4.79479 5.78847C5.24741 5.8785 5.71657 5.83229 6.14293 5.65569C6.56929 5.47909 6.93371 5.18002 7.1901 4.7963C7.44649 4.41259 7.58334 3.96146 7.58334 3.49997C7.58334 2.88113 7.3375 2.28764 6.89992 1.85006C6.46233 1.41247 5.86884 1.16664 5.25 1.16664Z",fill:"currentColor"},null,-1)]))}const UW=vh(Dzt,[["render",Ozt]]),Bzt={},Rzt={width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fzt(e,t){return Or(),Nr("svg",Rzt,t[0]||(t[0]=[At("path",{d:"M6.77889 9.16667H10.1122V12.5M4.11222 3.83333H0.77889V0.5M10.3906 4.50227C10.0168 3.57711 9.39097 2.77536 8.58423 2.18815C7.77749 1.60094 6.82233 1.25168 5.82707 1.18034C4.8318 1.109 3.83627 1.31827 2.95402 1.78441C2.07177 2.25055 1.3381 2.95503 0.836182 3.81742M0.500244 8.49805C0.874034 9.42321 1.49986 10.225 2.30661 10.8122C3.11335 11.3994 4.06948 11.7482 5.06474 11.8195C6.06001 11.8909 7.05473 11.6816 7.93697 11.2155C8.81922 10.7494 9.55239 10.045 10.0543 9.18262",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const $W=vh(Bzt,[["render",Fzt]]),Nzt={},jzt={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Uzt(e,t){return Or(),Nr("svg",jzt,t[0]||(t[0]=[Du('',2)]))}const HW=vh(Nzt,[["render",Uzt]]),$zt={class:"w-[285px] flex-shrink-0 p-[15px] hidden lg:block"},Hzt={class:"glass-card h-full p-6"},Vzt={class:"mb-12"},Wzt={class:"text-content-secondary dark:text-content-muted text-sm"},qzt=["title"],Gzt={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},Zzt={class:"mb-8"},Kzt={class:"mb-8"},Yzt={class:"space-y-2"},Xzt=["onClick"],Jzt={class:"mb-8"},Qzt={class:"space-y-2"},tOt=["onClick"],eOt={class:"mb-8"},rOt={class:"space-y-2"},nOt=["onClick"],iOt={class:"mb-8"},aOt={class:"space-y-2"},oOt=["onClick"],sOt=["disabled"],lOt={class:"flex items-center gap-3"},cOt=["disabled"],uOt={class:"flex items-center gap-3"},hOt={class:"mb-4"},dOt={key:0,class:"mb-2 glass-card px-3 py-2 rounded-lg border border-blue-500/30 dark:border-blue-400/50 bg-blue-500/10 dark:bg-blue-400/20"},fOt={class:"flex items-center gap-2"},pOt={key:0,class:"mt-2 glass-card px-3 py-2 rounded-lg border border-stroke-subtle dark:border-stroke/30 space-y-2 text-xs animate-fade-in"},mOt={class:"space-y-1"},gOt={class:"flex items-center justify-between"},vOt={class:"text-content-primary dark:text-content-primary font-mono"},yOt={key:0,class:"pl-2 space-y-0.5 text-[10px] text-content-secondary dark:text-content-muted"},_Ot={key:0,class:"flex items-center gap-1"},xOt={class:"bg-white/5 dark:bg-black/20 px-1 py-0.5 rounded"},bOt={class:"space-y-1"},wOt={class:"flex items-center justify-between"},kOt={class:"text-content-primary dark:text-content-primary font-mono"},TOt={key:0,class:"pl-2 space-y-0.5 text-[10px] text-content-secondary dark:text-content-muted"},SOt={key:0,class:"flex items-center gap-1"},COt={class:"bg-white/5 dark:bg-black/20 px-1 py-0.5 rounded"},AOt={key:0,class:"mb-4"},MOt={class:"text-content-secondary dark:text-content-muted text-xs mb-2"},EOt={class:"text-content-primary dark:text-content-primary"},LOt={class:"w-full h-1 bg-white/10 rounded-full overflow-hidden"},POt={class:"flex items-center gap-2 text-content-secondary dark:text-content-muted text-xs mb-3"},IOt={class:"flex items-center justify-center gap-3"},DOt={href:"https://github.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-primary/20 dark:hover:bg-primary/30 hover:border-primary/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"GitHub"},zOt={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-yellow-50 dark:hover:bg-yellow-500/20 hover:border-yellow-500/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"Buy Me a Coffee"},OOt=Cc({name:"SidebarNav",__name:"Sidebar",setup(e){const t=n4(),r=zE(),u=Ym(),T=li(!1),$=li(!1),K=li(!1),ct=li(!1),yt=li(!1),St=li(null);let Ut=null;Xd(async()=>{Ut=await u.startAutoRefresh(5e3)}),Dv(()=>{Ut&&Ut()});const ne={dashboard:BW,neighbors:UW,statistics:jW,"system-stats":yS,sessions:yS,configuration:vS,"room-servers":vS,logs:FW,terminal:NW,help:RW},pe=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"System Stats",icon:"system-stats",route:"/system-stats"},{name:"Sessions",icon:"sessions",route:"/sessions"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Terminal",icon:"terminal",route:"/terminal"},{name:"Room Servers",icon:"room-servers",route:"/room-servers"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],me=Ao(()=>Vn=>r.path===Vn),we=Vn=>{t.push(Vn)},Ce=async()=>{T.value=!0,St.value=null;try{await u.sendAdvert(),yt.value=!0,setTimeout(()=>{Ve()},2e3)}catch(Vn){St.value=Vn instanceof Error?Vn.message:"Unknown error occurred",console.error("Failed to send advert:",Vn)}finally{T.value=!1}},Ve=()=>{ct.value=!1,yt.value=!1,St.value=null,T.value=!1},kr=async()=>{if(!$.value){$.value=!0;try{await u.toggleMode()}catch(Vn){console.error("Failed to toggle mode:",Vn)}finally{$.value=!1}}},It=async()=>{if(!K.value){K.value=!0;try{await u.toggleDutyCycle()}catch(Vn){console.error("Failed to toggle duty cycle:",Vn)}finally{K.value=!1}}},rn=li(new Date().toLocaleTimeString());setInterval(()=>{rn.value=new Date().toLocaleTimeString()},1e3);const Lr=Ao(()=>{const Vn=u.dutyCyclePercentage;let on="#A5E5B6";return Vn>90?on="#FB787B":Vn>70&&(on="#FFC246"),{width:Vn===0?"2px":`${Math.max(Vn,2)}%`,backgroundColor:on}}),Mr=li(!1),tn=Ao(()=>u.version.includes("dev")||u.coreVersion.includes("dev")),Dn=Vn=>{const on=Vn.match(/^([\d.]+)(\.dev(\d+))?((\+g)([a-f0-9]+))?$/);return on?{base:on[1],isDev:!!on[2],devNumber:on[3]||null,commit:on[6]||null}:{base:Vn,isDev:!1,devNumber:null,commit:null}},Mn=Ao(()=>Dn(u.version)),Br=Ao(()=>Dn(u.coreVersion));return(Vn,on)=>(Or(),Nr(Es,null,[At("aside",$zt,[At("div",Hzt,[At("div",Vzt,[on[2]||(on[2]=At("div",{class:"mb-2 flex justify-center"},[At("img",{src:$U,alt:"MeshCore",class:"h-4 opacity-80 dark:invert-0 invert"})],-1)),on[3]||(on[3]=At("h1",{class:"text-content-primary dark:text-content-primary text-[22px] font-extrabold tracking-tight mb-3 text-center",style:{"font-family":"system-ui, -apple-system, sans-serif"}},"pyMC Repeater",-1)),At("p",Wzt,[cl(yn(Io(u).nodeName)+" ",1),At("span",{class:ja(["inline-block w-2 h-2 rounded-full ml-2",Io(u).statusBadge.text==="Active"?"bg-accent-green":Io(u).statusBadge.text==="Monitor Mode"?"bg-secondary":"bg-accent-red"]),title:Io(u).statusBadge.title},null,10,qzt)]),At("p",Gzt,"<"+yn(Io(u).pubKey)+">",1)]),on[21]||(on[21]=At("div",{class:"border-t border-stroke-subtle dark:border-stroke mb-6"},null,-1)),At("div",Zzt,[on[5]||(on[5]=At("p",{class:"text-content-muted dark:text-content-muted text-xs uppercase mb-4"},"Actions",-1)),At("button",{onClick:on[0]||(on[0]=pr=>ct.value=!0),class:"w-full bg-white dark:bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] border border-stroke-subtle dark:border-transparent hover:bg-background-mute dark:hover:bg-background-mute transition-colors"},on[4]||(on[4]=[At("svg",{class:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z",fill:"#212122"})],-1),cl(" Send Advert ",-1)]))]),At("div",Kzt,[on[6]||(on[6]=At("p",{class:"text-content-muted dark:text-content-muted text-xs uppercase mb-4"},"Monitoring",-1)),At("div",Yzt,[(Or(!0),Nr(Es,null,jl(pe.slice(0,3),pr=>(Or(),Nr("button",{key:pr.name,onClick:_r=>we(pr.route),class:ja([me.value(pr.route)?"bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold":"text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,232,0.15)] border border-stroke-subtle dark:border-transparent","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200"])},[(Or(),w0(s_(ne[pr.icon]),{class:ja(me.value(pr.route)?"w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current":"w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current")},null,8,["class"])),cl(" "+yn(pr.name),1)],10,Xzt))),128))])]),At("div",Jzt,[on[7]||(on[7]=At("p",{class:"text-content-muted dark:text-content-muted text-xs uppercase mb-4"},"System",-1)),At("div",Qzt,[(Or(!0),Nr(Es,null,jl(pe.slice(3,7),pr=>(Or(),Nr("button",{key:pr.name,onClick:_r=>we(pr.route),class:ja([me.value(pr.route)?"bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold":"text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,232,0.15)] border border-stroke-subtle dark:border-transparent","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200"])},[(Or(),w0(s_(ne[pr.icon]),{class:ja(me.value(pr.route)?"w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current":"w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current")},null,8,["class"])),cl(" "+yn(pr.name),1)],10,tOt))),128))])]),At("div",eOt,[on[8]||(on[8]=At("p",{class:"text-content-muted dark:text-content-muted text-xs uppercase mb-4"},"Room Servers",-1)),At("div",rOt,[(Or(!0),Nr(Es,null,jl(pe.slice(7,8),pr=>(Or(),Nr("button",{key:pr.name,onClick:_r=>we(pr.route),class:ja([me.value(pr.route)?"bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold":"text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,212,0.15)] border border-stroke-subtle dark:border-transparent","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200"])},[(Or(),w0(s_(ne[pr.icon]),{class:ja(me.value(pr.route)?"w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current":"w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current")},null,8,["class"])),cl(" "+yn(pr.name),1)],10,nOt))),128))])]),At("div",iOt,[on[9]||(on[9]=At("p",{class:"text-content-muted dark:text-content-muted text-xs uppercase mb-4"},"Other",-1)),At("div",aOt,[(Or(!0),Nr(Es,null,jl(pe.slice(8),pr=>(Or(),Nr("button",{key:pr.name,onClick:_r=>we(pr.route),class:ja([me.value(pr.route)?"bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold":"text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,232,0.15)] border border-stroke-subtle dark:border-transparent","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200"])},[(Or(),w0(s_(ne[pr.icon]),{class:ja(me.value(pr.route)?"w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current":"w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current")},null,8,["class"])),cl(" "+yn(pr.name),1)],10,oOt))),128))])]),Vs(zW,{"current-value":Io(u).noiseFloorDbm||-116,"update-interval":3e3,class:"mb-6"},null,8,["current-value"]),At("button",{onClick:kr,disabled:$.value,class:ja(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Io(u).modeButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[At("div",lOt,[Vs($W,{class:"w-4 h-4 text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"}),on[10]||(on[10]=At("span",{class:"text-content-primary dark:text-content-primary text-sm group-hover:text-primary transition-colors"},"Mode",-1))]),At("span",{class:ja(["text-xs font-medium group-hover:text-white transition-colors",Io(u).modeButtonState.warning?"text-accent-red":"text-accent-green"])},yn($.value?"Changing...":Io(u).currentMode.charAt(0).toUpperCase()+Io(u).currentMode.slice(1)),3)],10,sOt),At("button",{onClick:It,disabled:K.value,class:ja(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Io(u).dutyCycleButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[At("div",uOt,[Vs(HW,{class:"w-3.5 h-3.5 text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"}),on[11]||(on[11]=At("span",{class:"text-content-primary dark:text-content-primary text-sm group-hover:text-primary transition-colors"},"Duty Cycle",-1))]),At("span",{class:ja(["text-xs font-medium group-hover:text-white transition-colors",Io(u).dutyCycleButtonState.warning?"text-accent-red":"text-primary"])},yn(K.value?"Changing...":Io(u).dutyCycleEnabled?"Enabled":"Disabled"),3)],10,cOt),At("div",hOt,[tn.value?(Or(),Nr("div",dOt,on[12]||(on[12]=[At("div",{class:"flex items-center justify-center gap-2"},[At("svg",{class:"w-4 h-4 text-blue-500 dark:text-blue-400 flex-shrink-0",viewBox:"0 0 20 20",fill:"currentColor"},[At("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})]),At("span",{class:"text-blue-500 dark:text-blue-400 text-xs font-semibold"},"Development Build")],-1)]))):Ta("",!0),At("div",{onClick:on[1]||(on[1]=pr=>Mr.value=!Mr.value),class:"cursor-pointer transition-all duration-200 hover:scale-[1.02]"},[At("div",fOt,[At("span",{class:ja(["glass-card px-2 py-1 text-xs font-medium rounded border transition-colors",Mn.value.isDev?"text-yellow-600 dark:text-yellow-400 border-yellow-500/30 dark:border-yellow-500/30":"text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke"])}," R:v"+yn(Mn.value.base)+yn(Mn.value.isDev?"-dev"+Mn.value.devNumber:""),3),At("span",{class:ja(["glass-card px-2 py-1 text-xs font-medium rounded border transition-colors",Br.value.isDev?"text-yellow-600 dark:text-yellow-400 border-yellow-500/30 dark:border-yellow-500/30":"text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke"])}," Core:v"+yn(Br.value.base)+yn(Br.value.isDev?"-dev"+Br.value.devNumber:""),3),(Or(),Nr("svg",{class:ja(["w-3 h-3 text-content-muted transition-transform duration-200",Mr.value?"rotate-180":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},on[13]||(on[13]=[At("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))]),Mr.value?(Or(),Nr("div",pOt,[At("div",mOt,[At("div",gOt,[on[14]||(on[14]=At("span",{class:"text-content-muted font-medium"},"Repeater:",-1)),At("span",vOt,"v"+yn(Mn.value.base),1)]),Mn.value.isDev?(Or(),Nr("div",yOt,[At("div",null,"Dev Build: "+yn(Mn.value.devNumber),1),Mn.value.commit?(Or(),Nr("div",_Ot,[on[15]||(on[15]=At("span",null,"Commit:",-1)),At("code",xOt,yn(Mn.value.commit),1)])):Ta("",!0)])):Ta("",!0)]),on[18]||(on[18]=At("div",{class:"border-t border-stroke-subtle dark:border-stroke/20"},null,-1)),At("div",bOt,[At("div",wOt,[on[16]||(on[16]=At("span",{class:"text-content-muted font-medium"},"Core:",-1)),At("span",kOt,"v"+yn(Br.value.base),1)]),Br.value.isDev?(Or(),Nr("div",TOt,[At("div",null,"Dev Build: "+yn(Br.value.devNumber),1),Br.value.commit?(Or(),Nr("div",SOt,[on[17]||(on[17]=At("span",null,"Commit:",-1)),At("code",COt,yn(Br.value.commit),1)])):Ta("",!0)])):Ta("",!0)])])):Ta("",!0)])]),on[22]||(on[22]=At("div",{class:"border-t border-accent-green mb-4"},null,-1)),Io(u).dutyCycleEnabled?(Or(),Nr("div",AOt,[At("p",MOt,[on[19]||(on[19]=cl(" Duty Cycle: ",-1)),At("span",EOt,yn(Io(u).dutyCycleUtilization.toFixed(1))+"% / "+yn(Io(u).dutyCycleMax.toFixed(1))+"%",1)]),At("div",LOt,[At("div",{class:"h-full rounded-full transition-all duration-300",style:Sp(Lr.value)},null,4)])])):Ta("",!0),At("div",POt,[on[20]||(on[20]=At("svg",{class:"w-3 h-3",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M6.5 13C5.59722 13 4.75174 12.8286 3.96355 12.4858C3.17537 12.143 2.48926 11.6795 1.90522 11.0955C1.32119 10.5115 0.85776 9.82535 0.514945 9.03717C0.172131 8.24898 0.000482491 7.40326 1.0101e-06 6.5C-0.000480471 5.59674 0.171168 4.75126 0.514945 3.96356C0.858723 3.17585 1.32191 2.48974 1.9045 1.90522C2.48709 1.3207 3.1732 0.857278 3.96283 0.514944C4.75246 0.172611 5.59818 0.000962963 6.5 0C7.48703 0 8.42303 0.210648 9.30799 0.631944C10.193 1.05324 10.9421 1.64907 11.5555 2.41944V1.44444C11.5555 1.23981 11.6249 1.06841 11.7635 0.930222C11.9022 0.792037 12.0736 0.722704 12.2778 0.722222C12.4819 0.721741 12.6536 0.791074 12.7927 0.930222C12.9319 1.06937 13.001 1.24078 13 1.44444V4.33333C13 4.53796 12.9307 4.70961 12.792 4.84828C12.6533 4.98694 12.4819 5.05604 12.2778 5.05556H9.38888C9.18425 5.05556 9.01285 4.98622 8.87466 4.84756C8.73647 4.70889 8.66714 4.53748 8.66666 4.33333C8.66618 4.12919 8.73551 3.95778 8.87466 3.81911C9.01381 3.68044 9.18521 3.61111 9.38888 3.61111H10.6528C10.1593 2.93704 9.55138 2.40741 8.82916 2.02222C8.10694 1.63704 7.33055 1.44444 6.5 1.44444C5.09166 1.44444 3.89711 1.93507 2.91633 2.91633C1.93555 3.89759 1.44493 5.09215 1.44444 6.5C1.44396 7.90785 1.93459 9.10265 2.91633 10.0844C3.89807 11.0661 5.09263 11.5565 6.5 11.5556C7.64351 11.5556 8.66666 11.2125 9.56944 10.5264C10.4722 9.84028 11.068 8.95555 11.3569 7.87222C11.4171 7.67963 11.5255 7.53519 11.6819 7.43889C11.8384 7.34259 12.013 7.30648 12.2055 7.33055C12.4102 7.35463 12.5727 7.44178 12.693 7.592C12.8134 7.74222 12.8495 7.90785 12.8014 8.08889C12.4523 9.5213 11.694 10.698 10.5264 11.6191C9.35879 12.5402 8.01666 13.0005 6.5 13ZM7.22222 6.21111L9.02777 8.01667C9.16018 8.14907 9.22638 8.31759 9.22638 8.52222C9.22638 8.72685 9.16018 8.89537 9.02777 9.02778C8.89536 9.16018 8.72685 9.22639 8.52222 9.22639C8.31759 9.22639 8.14907 9.16018 8.01666 9.02778L5.99444 7.00556C5.92222 6.93333 5.86805 6.8522 5.83194 6.76217C5.79583 6.67213 5.77777 6.57872 5.77777 6.48194V3.61111C5.77777 3.40648 5.84711 3.23507 5.98577 3.09689C6.12444 2.9587 6.29585 2.88937 6.5 2.88889C6.70414 2.88841 6.87579 2.95774 7.01494 3.09689C7.15409 3.23604 7.22318 3.40744 7.22222 3.61111V6.21111Z",fill:"currentColor"})],-1)),cl(" Last Updated: "+yn(rn.value),1)]),At("div",IOt,[At("a",DOt,[Vs(PW,{class:"w-5 h-5 text-white group-hover:text-primary transition-colors"})]),At("a",zOt,[Vs(IW,{class:"w-5 h-5 text-white group-hover:text-yellow-500 transition-colors"})])])])]),Vs(OW,{isOpen:ct.value,isLoading:T.value,isSuccess:yt.value,error:St.value,onClose:Ve,onSend:Ce},null,8,["isOpen","isLoading","isSuccess","error"])],64))}}),BOt={key:0,class:"fixed inset-0 z-[1010] lg:hidden"},ROt={class:"absolute left-0 top-0 bottom-0 w-72 p-4"},FOt={class:"bg-black/20 backdrop-blur-xl border border-white/10 rounded-2xl h-full p-6 overflow-auto shadow-2xl"},NOt={class:"mb-6 flex items-center justify-between"},jOt={class:"text-[#C3C3C3] text-sm"},UOt=["title"],$Ot={class:"text-[#C3C3C3] text-sm mt-1"},HOt={class:"mb-4"},VOt={class:"mb-4"},WOt={class:"space-y-2 mb-3"},qOt=["onClick"],GOt={class:"mb-4"},ZOt={class:"space-y-2 mb-3"},KOt=["onClick"],YOt={class:"mb-4"},XOt={class:"space-y-2 mb-3"},JOt=["onClick"],QOt={class:"mb-4"},tBt={class:"space-y-2 mb-3"},eBt=["onClick"],rBt=["disabled"],nBt={class:"flex items-center gap-3"},iBt=["disabled"],aBt={class:"flex items-center gap-3"},oBt={class:"mb-4"},sBt={class:"flex items-center gap-2"},lBt={class:"glass-card px-2 py-1 text-content-muted text-xs font-medium rounded border border-dark-border"},cBt={class:"glass-card px-2 py-1 text-content-muted text-xs font-medium rounded border border-dark-border"},uBt={key:0,class:"mb-4"},hBt={class:"text-content-muted text-xs mb-2"},dBt={class:"text-white"},fBt={class:"w-full h-1 bg-white/10 rounded-full overflow-hidden"},pBt={class:"text-content-muted text-xs"},mBt=Cc({name:"MobileSidebar",__name:"MobileSidebar",props:{showMobileSidebar:{type:Boolean}},emits:["update:showMobileSidebar","close"],setup(e,{emit:t}){const r=t,u=n4(),T=zE(),$=Ym(),K=li(!1),ct=li(!1),yt=li(!1),St=li(!1),Ut=li(!1),ne=li(null);let pe=null;Xd(async()=>{pe=await $.startAutoRefresh(5e3)}),Dv(()=>{pe&&pe()});const me={dashboard:BW,neighbors:UW,statistics:jW,"system-stats":yS,sessions:yS,configuration:vS,"room-servers":vS,logs:FW,terminal:NW,help:RW},we=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"System Stats",icon:"system-stats",route:"/system-stats"},{name:"Sessions",icon:"sessions",route:"/sessions"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Terminal",icon:"terminal",route:"/terminal"},{name:"Room Servers",icon:"room-servers",route:"/room-servers"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],Ce=Ao(()=>Mn=>T.path===Mn),Ve=Mn=>{u.push(Mn),kr()},kr=()=>{r("update:showMobileSidebar",!1)},It=async()=>{K.value=!0,ne.value=null;try{await $.sendAdvert(),Ut.value=!0,setTimeout(()=>{rn()},2e3)}catch(Mn){ne.value=Mn instanceof Error?Mn.message:"Unknown error occurred",console.error("Failed to send advert:",Mn)}finally{K.value=!1}},rn=()=>{St.value=!1,Ut.value=!1,ne.value=null,K.value=!1},Lr=async()=>{if(!ct.value){ct.value=!0;try{await $.toggleMode()}catch(Mn){console.error("Failed to toggle mode:",Mn)}finally{ct.value=!1}}},Mr=async()=>{if(!yt.value){yt.value=!0;try{await $.toggleDutyCycle()}catch(Mn){console.error("Failed to toggle duty cycle:",Mn)}finally{yt.value=!1}}},tn=li(new Date().toLocaleTimeString());setInterval(()=>{tn.value=new Date().toLocaleTimeString()},1e3);const Dn=Ao(()=>{const Mn=$.dutyCyclePercentage;let Br="#A5E5B6";return Mn>90?Br="#FB787B":Mn>70&&(Br="#FFC246"),{width:Mn===0?"2px":`${Math.max(Mn,2)}%`,backgroundColor:Br}});return(Mn,Br)=>(Or(),Nr(Es,null,[Mn.showMobileSidebar?(Or(),Nr("div",BOt,[At("div",{class:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:kr}),At("div",ROt,[At("div",FOt,[At("div",NOt,[At("div",null,[Br[1]||(Br[1]=At("h1",{class:"text-white text-[20px] font-bold"},"pyMC Repeater",-1)),At("p",jOt,[cl(yn(Io($).nodeName)+" ",1),At("span",{class:ja(["inline-block w-2 h-2 rounded-full ml-2",Io($).statusBadge.text==="Active"?"bg-accent-green":Io($).statusBadge.text==="Monitor Mode"?"bg-secondary":"bg-accent-red"]),title:Io($).statusBadge.title},null,10,UOt)]),At("p",$Ot,"<"+yn(Io($).pubKey)+">",1)]),At("button",{onClick:kr,class:"text-content-muted"},"✕")]),Br[11]||(Br[11]=At("div",{class:"border-t border-dark-border mb-4"},null,-1)),At("div",HOt,[Br[3]||(Br[3]=At("p",{class:"text-content-muted text-xs uppercase mb-2"},"Actions",-1)),At("button",{onClick:Br[0]||(Br[0]=Vn=>{St.value=!0,kr()}),class:"w-full bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] hover:bg-gray-100 transition-colors mb-2"},Br[2]||(Br[2]=[At("svg",{class:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z",fill:"#212122"})],-1),cl(" Send Advert ",-1)]))]),At("div",VOt,[Br[4]||(Br[4]=At("p",{class:"text-content-muted text-xs uppercase mb-2"},"Monitoring",-1)),At("div",WOt,[(Or(!0),Nr(Es,null,jl(we.slice(0,3),Vn=>(Or(),Nr("button",{key:Vn.name,onClick:on=>Ve(Vn.route),class:ja([Ce.value(Vn.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Or(),w0(s_(me[Vn.icon]),{class:"w-3.5 h-3.5"})),cl(" "+yn(Vn.name),1)],10,qOt))),128))])]),At("div",GOt,[Br[5]||(Br[5]=At("p",{class:"text-content-muted text-xs uppercase mb-2"},"System",-1)),At("div",ZOt,[(Or(!0),Nr(Es,null,jl(we.slice(3,7),Vn=>(Or(),Nr("button",{key:Vn.name,onClick:on=>Ve(Vn.route),class:ja([Ce.value(Vn.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Or(),w0(s_(me[Vn.icon]),{class:"w-3.5 h-3.5"})),cl(" "+yn(Vn.name),1)],10,KOt))),128))])]),At("div",YOt,[Br[6]||(Br[6]=At("p",{class:"text-content-muted text-xs uppercase mb-2"},"Room Servers",-1)),At("div",XOt,[(Or(!0),Nr(Es,null,jl(we.slice(7,8),Vn=>(Or(),Nr("button",{key:Vn.name,onClick:on=>Ve(Vn.route),class:ja([Ce.value(Vn.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Or(),w0(s_(me[Vn.icon]),{class:"w-3.5 h-3.5"})),cl(" "+yn(Vn.name),1)],10,JOt))),128))])]),At("div",QOt,[Br[7]||(Br[7]=At("p",{class:"text-content-muted text-xs uppercase mb-2"},"Other",-1)),At("div",tBt,[(Or(!0),Nr(Es,null,jl(we.slice(8),Vn=>(Or(),Nr("button",{key:Vn.name,onClick:on=>Ve(Vn.route),class:ja([Ce.value(Vn.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Or(),w0(s_(me[Vn.icon]),{class:"w-3.5 h-3.5"})),cl(" "+yn(Vn.name),1)],10,eBt))),128))])]),Vs(zW,{"current-value":Io($).noiseFloorDbm||-116,"update-interval":3e3,class:"mb-4"},null,8,["current-value"]),At("button",{onClick:Lr,disabled:ct.value,class:ja(["p-4 flex items-center justify-between mb-3 w-full transition-all duration-200 cursor-pointer group",Io($).modeButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[At("div",nBt,[Vs($W,{class:"w-4 h-4 text-white group-hover:text-primary transition-colors"}),Br[8]||(Br[8]=At("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Mode",-1))]),At("span",{class:ja(["text-xs font-medium group-hover:text-white transition-colors",Io($).modeButtonState.warning?"text-accent-red":"text-accent-green"])},yn(ct.value?"Changing...":Io($).currentMode.charAt(0).toUpperCase()+Io($).currentMode.slice(1)),3)],10,rBt),At("button",{onClick:Mr,disabled:yt.value,class:ja(["p-4 flex items-center justify-between mb-3 w-full transition-all duration-200 cursor-pointer group",Io($).dutyCycleButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[At("div",aBt,[Vs(HW,{class:"w-3.5 h-3.5 text-white group-hover:text-primary transition-colors"}),Br[9]||(Br[9]=At("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Duty Cycle",-1))]),At("span",{class:ja(["text-xs font-medium group-hover:text-white transition-colors",Io($).dutyCycleButtonState.warning?"text-accent-red":"text-primary"])},yn(yt.value?"Changing...":Io($).dutyCycleEnabled?"Enabled":"Disabled"),3)],10,iBt),At("div",oBt,[At("div",sBt,[At("span",lBt," R:v"+yn(Io($).version),1),At("span",cBt," C:v"+yn(Io($).coreVersion),1)])]),Br[12]||(Br[12]=At("div",{class:"border-t border-accent-green mb-4"},null,-1)),Io($).dutyCycleEnabled?(Or(),Nr("div",uBt,[At("p",hBt,[Br[10]||(Br[10]=cl(" Duty Cycle: ",-1)),At("span",dBt,yn(Io($).dutyCycleUtilization.toFixed(1))+"% / "+yn(Io($).dutyCycleMax.toFixed(1))+"%",1)]),At("div",fBt,[At("div",{class:"h-full rounded-full transition-all duration-300",style:Sp(Dn.value)},null,4)])])):Ta("",!0),At("p",pBt,"Last Updated: "+yn(tn.value),1)])])])):Ta("",!0),Vs(OW,{isOpen:St.value,isLoading:K.value,isSuccess:Ut.value,error:ne.value,onClose:rn,onSend:It},null,8,["isOpen","isLoading","isSuccess","error"])],64))}}),gBt={class:"glass-card p-3 sm:p-6 mb-5 rounded-[20px] relative z-10"},vBt={class:"flex justify-between items-center"},yBt={class:"flex items-center gap-3"},_Bt={class:"hidden sm:block"},xBt={class:"text-content-primary dark:text-content-primary text-2xl lg:text-[35px] font-bold mb-1 sm:mb-2"},bBt={class:"flex items-center gap-3 sm:gap-4"},wBt={class:"text-right",style:{"min-width":"180px"}},kBt={key:0,class:"flex items-center gap-2 justify-end"},TBt={key:1,class:"space-y-1"},SBt={class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},CBt={class:"text-primary font-medium"},ABt={key:0,class:"text-xs text-content-muted dark:text-content-muted/80",style:{"min-height":"16px"}},MBt={key:0},EBt={key:2},LBt={key:0,class:"text-xs text-content-muted dark:text-content-muted/60 hidden sm:block",style:{"min-height":"16px"}},PBt={class:"flex items-center justify-between mb-3"},IBt={class:"flex items-center gap-2"},DBt=["disabled"],zBt=["disabled"],OBt={class:"space-y-3 text-sm"},BBt={key:0,class:"bg-red-50 dark:bg-background-mute p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},RBt={class:"flex items-center justify-between"},FBt={class:"text-accent-red font-bold"},NBt={class:"text-xs text-content-muted dark:text-content-muted mt-1"},jBt={key:1,class:"bg-green-50 dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10 border-l-2 border-l-accent-green"},UBt={class:"flex items-center justify-between"},$Bt={class:"text-accent-green font-bold"},HBt={key:0,class:"text-xs text-content-muted dark:text-content-muted mt-1"},VBt={key:2,class:"bg-background-mute dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10"},WBt={key:3,class:"bg-red-50 dark:bg-background-mute p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},qBt={class:"text-xs text-content-secondary dark:text-content-muted"},GBt={class:"bg-background-mute dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10 border-l-2 border-l-primary"},ZBt={class:"flex items-center justify-between"},KBt={class:"text-primary font-bold"},YBt={key:0,class:"text-xs text-content-muted dark:text-content-muted mt-1"},XBt={class:"flex items-center justify-between"},JBt={class:"text-content-primary dark:text-content-primary font-medium"},QBt={key:0,class:"mt-2"},tRt={class:"text-xs text-content-muted dark:text-content-muted"},eRt={class:"text-content-secondary dark:text-content-secondary"},rRt={key:4,class:"bg-background-mute dark:bg-background-mute p-4 rounded-lg border border-stroke-subtle dark:border-stroke/10 text-center"},nRt={key:5,class:"bg-background-mute dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10 text-center"},iRt=Cc({name:"TopBar",__name:"TopBar",emits:["toggleMobileSidebar"],setup(e,{emit:t}){const r=t,u=n4(),T=Ym(),$=li(!1),K=li(null),ct=li({hasUpdate:!1,currentVersion:"",latestVersion:"",isChecking:!1,lastChecked:null,error:null}),yt=li({}),St=li(!0),Ut=li(null),ne=li(act()||"User"),pe=["Chat Node","Repeater","Room Server"];function me(on){const pr=on.target;K.value&&!K.value.contains(pr)&&($.value=!1)}const we=async()=>{try{St.value=!0;const on={};for(const pr of pe)try{const _r=await bs.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(pr)}&hours=168`);_r.success&&Array.isArray(_r.data)?on[pr]=_r.data:on[pr]=[]}catch(_r){console.error(`Error fetching ${pr} nodes:`,_r),on[pr]=[]}yt.value=on,Ut.value=new Date}catch(on){console.error("Error updating tracked nodes:",on)}finally{St.value=!1}},Ce=async()=>{if(!ct.value.isChecking)try{ct.value.isChecking=!0,ct.value.error=null,await T.fetchStats();const on=T.version;if(!on||on==="Unknown"){ct.value.error="Unable to determine current version";return}const _r=await fetch("https://raw.githubusercontent.com/rightup/pyMC_Repeater/main/repeater/__init__.py");if(!_r.ok)throw new Error(`GitHub request failed: ${_r.status}`);const Dr=(await _r.text()).match(/__version__\s*=\s*["']([^"']+)["']/);if(!Dr)throw new Error("Could not parse version from GitHub file");const nn=Dr[1];ct.value.currentVersion=on,ct.value.latestVersion=nn,ct.value.lastChecked=new Date,ct.value.hasUpdate=on!==nn}catch(on){console.error("Error checking for updates:",on),ct.value.error=on instanceof Error?on.message:"Failed to check for updates"}finally{ct.value.isChecking=!1}},Ve=()=>{Y2(),u.push("/login")},kr=Ao(()=>Object.values(yt.value).reduce((pr,_r)=>pr+_r.length,0)),It=Ao(()=>pe.map(pr=>({type:pr,count:yt.value[pr]?.length||0})).filter(pr=>pr.count>0)),rn=Ao(()=>ct.value.hasUpdate||kr.value>0),Lr=on=>({"Chat Node":"text-blue-600 dark:text-blue-400",Repeater:"text-accent-green","Room Server":"text-accent-purple"})[on]||"text-gray-400",Mr=on=>{const pr=yt.value[on]||[];return pr.length===0?"None":pr.reduce((Sr,Dr)=>Dr.last_seen>Sr.last_seen?Dr:Sr,pr[0]).node_name||"Unknown Node"};let tn=null,Dn=null;const Mn=()=>{tn&&clearInterval(tn),tn=setInterval(()=>{we()},3e4),Dn&&clearInterval(Dn),Dn=setInterval(()=>{Ce()},6e5)},Br=()=>{tn&&(clearInterval(tn),tn=null),Dn&&(clearInterval(Dn),Dn=null)};Xd(()=>{document.addEventListener("click",me),we(),Ce(),Mn()}),Tg(()=>{document.removeEventListener("click",me),Br()});const Vn=()=>{r("toggleMobileSidebar")};return(on,pr)=>(Or(),Nr("div",gBt,[At("div",vBt,[At("div",yBt,[At("button",{onClick:Vn,class:"lg:hidden w-10 h-10 rounded bg-background-mute dark:bg-surface-elevated flex items-center justify-center hover:bg-stroke-subtle dark:hover:bg-stroke/30 transition-colors"},pr[2]||(pr[2]=[At("svg",{class:"w-5 h-5 text-content-secondary dark:text-content-primary",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[At("path",{d:"M3 6h14M3 10h14M3 14h14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),At("div",_Bt,[At("h1",xBt,"Hi "+yn(ne.value)+"👋",1)])]),At("div",bBt,[At("div",wBt,[St.value?(Or(),Nr("div",kBt,pr[3]||(pr[3]=[At("div",{class:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary"},null,-1),At("p",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Loading...",-1)]))):kr.value>0?(Or(),Nr("div",TBt,[At("p",SBt,[pr[4]||(pr[4]=cl(" Tracking: ",-1)),At("span",CBt,yn(kr.value)+" node"+yn(kr.value===1?"":"s"),1)]),It.value.length>0?(Or(),Nr("div",ABt,[(Or(!0),Nr(Es,null,jl(It.value,(_r,Sr)=>(Or(),Nr("span",{key:_r.type,class:"inline"},[cl(yn(_r.count)+" "+yn(_r.type)+yn(_r.count===1?"":"s"),1),Sr