diff --git a/assets/index-BNlDA3OC.js b/assets/index-BNlDA3OC.js new file mode 100644 index 0000000..8368599 --- /dev/null +++ b/assets/index-BNlDA3OC.js @@ -0,0 +1,4834 @@ +var b6=Object.defineProperty;var w6=(t,e,n)=>e in t?b6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Te=(t,e,n)=>(w6(t,typeof e!="symbol"?e+"":e,n),n),V0=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var H=(t,e,n)=>(V0(t,e,"read from private field"),n?n.call(t):e.get(t)),_t=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},rt=(t,e,n,s)=>(V0(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n);var hp=(t,e,n,s)=>({set _(i){rt(t,e,i,n)},get _(){return H(t,e,s)}}),Qe=(t,e,n)=>(V0(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();/** +* @vue/shared v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function Ub(t,e){const n=new Set(t.split(","));return s=>n.has(s)}const un={},uu=[],Si=()=>{},x6=()=>!1,__=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),$b=t=>t.startsWith("onUpdate:"),Pn=Object.assign,Bb=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},S6=Object.prototype.hasOwnProperty,Ot=(t,e)=>S6.call(t,e),et=Array.isArray,du=t=>Hf(t)==="[object Map]",ld=t=>Hf(t)==="[object Set]",E2=t=>Hf(t)==="[object Date]",ft=t=>typeof t=="function",On=t=>typeof t=="string",So=t=>typeof t=="symbol",Zt=t=>t!==null&&typeof t=="object",VR=t=>(Zt(t)||ft(t))&&ft(t.then)&&ft(t.catch),WR=Object.prototype.toString,Hf=t=>WR.call(t),E6=t=>Hf(t).slice(8,-1),jR=t=>Hf(t)==="[object Object]",Hb=t=>On(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,kh=Ub(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),v_=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},T6=/-(\w)/g,Cr=v_(t=>t.replace(T6,(e,n)=>n?n.toUpperCase():"")),A6=/\B([A-Z])/g,cd=v_(t=>t.replace(A6,"-$1").toLowerCase()),y_=v_(t=>t.charAt(0).toUpperCase()+t.slice(1)),W0=v_(t=>t?`on${y_(t)}`:""),Da=(t,e)=>!Object.is(t,e),$m=(t,e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:n})},vg=t=>{const e=parseFloat(t);return isNaN(e)?t:e},M6=t=>{const e=On(t)?Number(t):NaN;return isNaN(e)?t:e};let T2;const YR=()=>T2||(T2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function b_(t){if(et(t)){const e={};for(let n=0;n{if(n){const s=n.split(k6);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function ms(t){let e="";if(On(t))e=t;else if(et(t))for(let n=0;nGf(n,e))}const Be=t=>On(t)?t:t==null?"":et(t)||Zt(t)&&(t.toString===WR||!ft(t.toString))?JSON.stringify(t,KR,2):String(t),KR=(t,e)=>e&&e.__v_isRef?KR(t,e.value):du(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,i],r)=>(n[j0(s,r)+" =>"]=i,n),{})}:ld(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>j0(n))}:So(e)?j0(e):Zt(e)&&!et(e)&&!jR(e)?String(e):e,j0=(t,e="")=>{var n;return So(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** +* @vue/reactivity v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let si;class ZR{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=si,!e&&si&&(this.index=(si.scopes||(si.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const n=si;try{return si=this,e()}finally{si=n}}}on(){si=this}off(){si=this.parent}stop(e){if(this._active){let n,s;for(n=0,s=this.effects.length;n=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),qa()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Ra,n=Yl;try{return Ra=!0,Yl=this,this._runnings++,A2(this),this.fn()}finally{M2(this),this._runnings--,Yl=n,Ra=e}}stop(){this.active&&(A2(this),M2(this),this.onStop&&this.onStop(),this.active=!1)}}function F6(t){return t.value}function A2(t){t._trackId++,t._depsLength=0}function M2(t){if(t.deps.length>t._depsLength){for(let e=t._depsLength;e{const n=new Map;return n.cleanup=t,n.computed=e,n},yg=new WeakMap,Xl=Symbol(""),Kv=Symbol("");function Ws(t,e,n){if(Ra&&Yl){let s=yg.get(t);s||yg.set(t,s=new Map);let i=s.get(n);i||s.set(n,i=i4(()=>s.delete(n))),n4(Yl,i)}}function go(t,e,n,s,i,r){const o=yg.get(t);if(!o)return;let a=[];if(e==="clear")a=[...o.values()];else if(n==="length"&&et(t)){const l=Number(s);o.forEach((c,u)=>{(u==="length"||!So(u)&&u>=l)&&a.push(c)})}else switch(n!==void 0&&a.push(o.get(n)),e){case"add":et(t)?Hb(n)&&a.push(o.get("length")):(a.push(o.get(Xl)),du(t)&&a.push(o.get(Kv)));break;case"delete":et(t)||(a.push(o.get(Xl)),du(t)&&a.push(o.get(Kv)));break;case"set":du(t)&&a.push(o.get(Xl));break}Vb();for(const l of a)l&&s4(l,4);Wb()}function U6(t,e){const n=yg.get(t);return n&&n.get(e)}const $6=Ub("__proto__,__v_isRef,__isVue"),r4=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(So)),R2=B6();function B6(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...n){const s=Mt(this);for(let r=0,o=this.length;r{t[e]=function(...n){ja(),Vb();const s=Mt(this)[e].apply(this,n);return Wb(),qa(),s}}),t}function H6(t){So(t)||(t=String(t));const e=Mt(this);return Ws(e,"has",t),e.hasOwnProperty(t)}class o4{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){const i=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(i?r?eL:u4:r?c4:l4).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=et(e);if(!i){if(o&&Ot(R2,n))return Reflect.get(R2,n,s);if(n==="hasOwnProperty")return H6}const a=Reflect.get(e,n,s);return(So(n)?r4.has(n):$6(n))||(i||Ws(e,"get",n),r)?a:Hn(a)?o&&Hb(n)?a:a.value:Zt(a)?i?h4(a):ud(a):a}}class a4 extends o4{constructor(e=!1){super(!1,e)}set(e,n,s,i){let r=e[n];if(!this._isShallow){const l=Kh(r);if(!bg(s)&&!Kh(s)&&(r=Mt(r),s=Mt(s)),!et(e)&&Hn(r)&&!Hn(s))return l?!1:(r.value=s,!0)}const o=et(e)&&Hb(n)?Number(n)t,w_=t=>Reflect.getPrototypeOf(t);function fp(t,e,n=!1,s=!1){t=t.__v_raw;const i=Mt(t),r=Mt(e);n||(Da(e,r)&&Ws(i,"get",e),Ws(i,"get",r));const{has:o}=w_(i),a=s?jb:n?Kb:Zh;if(o.call(i,e))return a(t.get(e));if(o.call(i,r))return a(t.get(r));t!==i&&t.get(e)}function pp(t,e=!1){const n=this.__v_raw,s=Mt(n),i=Mt(t);return e||(Da(t,i)&&Ws(s,"has",t),Ws(s,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)}function mp(t,e=!1){return t=t.__v_raw,!e&&Ws(Mt(t),"iterate",Xl),Reflect.get(t,"size",t)}function k2(t){t=Mt(t);const e=Mt(this);return w_(e).has.call(e,t)||(e.add(t),go(e,"add",t,t)),this}function C2(t,e){e=Mt(e);const n=Mt(this),{has:s,get:i}=w_(n);let r=s.call(n,t);r||(t=Mt(t),r=s.call(n,t));const o=i.call(n,t);return n.set(t,e),r?Da(e,o)&&go(n,"set",t,e):go(n,"add",t,e),this}function P2(t){const e=Mt(this),{has:n,get:s}=w_(e);let i=n.call(e,t);i||(t=Mt(t),i=n.call(e,t)),s&&s.call(e,t);const r=e.delete(t);return i&&go(e,"delete",t,void 0),r}function O2(){const t=Mt(this),e=t.size!==0,n=t.clear();return e&&go(t,"clear",void 0,void 0),n}function gp(t,e){return function(s,i){const r=this,o=r.__v_raw,a=Mt(o),l=e?jb:t?Kb:Zh;return!t&&Ws(a,"iterate",Xl),o.forEach((c,u)=>s.call(i,l(c),l(u),r))}}function _p(t,e,n){return function(...s){const i=this.__v_raw,r=Mt(i),o=du(r),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=i[t](...s),u=n?jb:e?Kb:Zh;return!e&&Ws(r,"iterate",l?Kv:Xl),{next(){const{value:d,done:h}=c.next();return h?{value:d,done:h}:{value:a?[u(d[0]),u(d[1])]:u(d),done:h}},[Symbol.iterator](){return this}}}}function Bo(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function j6(){const t={get(r){return fp(this,r)},get size(){return mp(this)},has:pp,add:k2,set:C2,delete:P2,clear:O2,forEach:gp(!1,!1)},e={get(r){return fp(this,r,!1,!0)},get size(){return mp(this)},has:pp,add:k2,set:C2,delete:P2,clear:O2,forEach:gp(!1,!0)},n={get(r){return fp(this,r,!0)},get size(){return mp(this,!0)},has(r){return pp.call(this,r,!0)},add:Bo("add"),set:Bo("set"),delete:Bo("delete"),clear:Bo("clear"),forEach:gp(!0,!1)},s={get(r){return fp(this,r,!0,!0)},get size(){return mp(this,!0)},has(r){return pp.call(this,r,!0)},add:Bo("add"),set:Bo("set"),delete:Bo("delete"),clear:Bo("clear"),forEach:gp(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=_p(r,!1,!1),n[r]=_p(r,!0,!1),e[r]=_p(r,!1,!0),s[r]=_p(r,!0,!0)}),[t,n,e,s]}const[q6,Y6,X6,K6]=j6();function qb(t,e){const n=e?t?K6:X6:t?Y6:q6;return(s,i,r)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?s:Reflect.get(Ot(n,i)&&i in s?n:s,i,r)}const Z6={get:qb(!1,!1)},J6={get:qb(!1,!0)},Q6={get:qb(!0,!1)};const l4=new WeakMap,c4=new WeakMap,u4=new WeakMap,eL=new WeakMap;function tL(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function nL(t){return t.__v_skip||!Object.isExtensible(t)?0:tL(E6(t))}function ud(t){return Kh(t)?t:Yb(t,!1,z6,Z6,l4)}function d4(t){return Yb(t,!1,W6,J6,c4)}function h4(t){return Yb(t,!0,V6,Q6,u4)}function Yb(t,e,n,s,i){if(!Zt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const o=nL(t);if(o===0)return t;const a=new Proxy(t,o===2?s:n);return i.set(t,a),a}function Kl(t){return Kh(t)?Kl(t.__v_raw):!!(t&&t.__v_isReactive)}function Kh(t){return!!(t&&t.__v_isReadonly)}function bg(t){return!!(t&&t.__v_isShallow)}function x_(t){return t?!!t.__v_raw:!1}function Mt(t){const e=t&&t.__v_raw;return e?Mt(e):t}function Xb(t){return Object.isExtensible(t)&&qR(t,"__v_skip",!0),t}const Zh=t=>Zt(t)?ud(t):t,Kb=t=>Zt(t)?h4(t):t;class f4{constructor(e,n,s,i){this.getter=e,this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new zb(()=>e(this._value),()=>Bm(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=s}get value(){const e=Mt(this);return(!e._cacheable||e.effect.dirty)&&Da(e._value,e._value=e.effect.run())&&Bm(e,4),p4(e),e.effect._dirtyLevel>=2&&Bm(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function sL(t,e,n=!1){let s,i;const r=ft(t);return r?(s=t,i=Si):(s=t.get,i=t.set),new f4(s,i,r||!i,n)}function p4(t){var e;Ra&&Yl&&(t=Mt(t),n4(Yl,(e=t.dep)!=null?e:t.dep=i4(()=>t.dep=void 0,t instanceof f4?t:void 0)))}function Bm(t,e=4,n){t=Mt(t);const s=t.dep;s&&s4(s,e)}function Hn(t){return!!(t&&t.__v_isRef===!0)}function S_(t){return m4(t,!1)}function E_(t){return m4(t,!0)}function m4(t,e){return Hn(t)?t:new iL(t,e)}class iL{constructor(e,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?e:Mt(e),this._value=n?e:Zh(e)}get value(){return p4(this),this._value}set value(e){const n=this.__v_isShallow||bg(e)||Kh(e);e=n?e:Mt(e),Da(e,this._rawValue)&&(this._rawValue=e,this._value=n?e:Zh(e),Bm(this,4))}}function hu(t){return Hn(t)?t.value:t}const rL={get:(t,e,n)=>hu(Reflect.get(t,e,n)),set:(t,e,n,s)=>{const i=t[e];return Hn(i)&&!Hn(n)?(i.value=n,!0):Reflect.set(t,e,n,s)}};function g4(t){return Kl(t)?t:new Proxy(t,rL)}function oL(t){const e=et(t)?new Array(t.length):{};for(const n in t)e[n]=lL(t,n);return e}class aL{constructor(e,n,s){this._object=e,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return U6(Mt(this._object),this._key)}}function lL(t,e,n){const s=t[e];return Hn(s)?s:new aL(t,e,n)}/** +* @vue/runtime-core v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function ka(t,e,n,s){try{return s?t(...s):t()}catch(i){T_(i,e,n)}}function Ai(t,e,n,s){if(ft(t)){const i=ka(t,e,n,s);return i&&VR(i)&&i.catch(r=>{T_(r,e,n)}),i}if(et(t)){const i=[];for(let r=0;r>>1,i=ps[s],r=Qh(i);rvr&&ps.splice(e,1)}function hL(t){et(t)?fu.push(...t):(!la||!la.includes(t,t.allowRecurse?Tl+1:Tl))&&fu.push(t),v4()}function I2(t,e,n=Jh?vr+1:0){for(;nQh(n)-Qh(s));if(fu.length=0,la){la.push(...e);return}for(la=e,Tl=0;Tlt.id==null?1/0:t.id,fL=(t,e)=>{const n=Qh(t)-Qh(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function b4(t){Zv=!1,Jh=!0,ps.sort(fL);try{for(vr=0;vrOn(f)?f.trim():f)),d&&(i=n.map(vg))}let a,l=s[a=W0(e)]||s[a=W0(Cr(e))];!l&&r&&(l=s[a=W0(cd(e))]),l&&Ai(l,t,6,i);const c=s[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Ai(c,t,6,i)}}function w4(t,e,n=!1){const s=e.emitsCache,i=s.get(t);if(i!==void 0)return i;const r=t.emits;let o={},a=!1;if(!ft(t)){const l=c=>{const u=w4(c,e,!0);u&&(a=!0,Pn(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!r&&!a?(Zt(t)&&s.set(t,null),null):(et(r)?r.forEach(l=>o[l]=null):Pn(o,r),Zt(t)&&s.set(t,o),o)}function A_(t,e){return!t||!__(e)?!1:(e=e.slice(2).replace(/Once$/,""),Ot(t,e[0].toLowerCase()+e.slice(1))||Ot(t,cd(e))||Ot(t,e))}let Nn=null,M_=null;function wg(t){const e=Nn;return Nn=t,M_=t&&t.type.__scopeId||null,e}function dd(t){M_=t}function hd(){M_=null}function nt(t,e=Nn,n){if(!e||t._n)return t;const s=(...i)=>{s._d&&W2(-1);const r=wg(e);let o;try{o=t(...i)}finally{wg(r),s._d&&W2(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function q0(t){const{type:e,vnode:n,proxy:s,withProxy:i,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:h,setupState:f,ctx:v,inheritAttrs:_}=t,m=wg(t);let g,y;try{if(n.shapeFlag&4){const w=i||s,T=w;g=gr(c.call(T,w,u,d,f,h,v)),y=a}else{const w=e;g=gr(w.length>1?w(d,{attrs:a,slots:o,emit:l}):w(d,null)),y=e.props?a:mL(a)}}catch(w){Oh.length=0,T_(w,t,1),g=Y(ai)}let b=g;if(y&&_!==!1){const w=Object.keys(y),{shapeFlag:T}=b;w.length&&T&7&&(r&&w.some($b)&&(y=gL(y,r)),b=Na(b,y,!1,!0))}return n.dirs&&(b=Na(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&(b.transition=n.transition),g=b,wg(m),g}const mL=t=>{let e;for(const n in t)(n==="class"||n==="style"||__(n))&&((e||(e={}))[n]=t[n]);return e},gL=(t,e)=>{const n={};for(const s in t)(!$b(s)||!(s.slice(9)in e))&&(n[s]=t[s]);return n};function _L(t,e,n){const{props:s,children:i,component:r}=t,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return s?L2(s,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dt.__isSuspense;function SL(t,e){e&&e.pendingBranch?et(t)?e.effects.push(...t):e.effects.push(t):hL(t)}const EL=Symbol.for("v-scx"),TL=()=>Tr(EL),vp={};function Zl(t,e,n){return S4(t,e,n)}function S4(t,e,{immediate:n,deep:s,flush:i,once:r,onTrack:o,onTrigger:a}=un){if(e&&r){const x=e;e=(...A)=>{x(...A),T()}}const l=Zn,c=x=>s===!0?x:Ll(x,s===!1?1:void 0);let u,d=!1,h=!1;if(Hn(t)?(u=()=>t.value,d=bg(t)):Kl(t)?(u=()=>c(t),d=!0):et(t)?(h=!0,d=t.some(x=>Kl(x)||bg(x)),u=()=>t.map(x=>{if(Hn(x))return x.value;if(Kl(x))return c(x);if(ft(x))return ka(x,l,2)})):ft(t)?e?u=()=>ka(t,l,2):u=()=>(f&&f(),Ai(t,l,3,[v])):u=Si,e&&s){const x=u;u=()=>Ll(x())}let f,v=x=>{f=b.onStop=()=>{ka(x,l,4),f=b.onStop=void 0}},_;if(O_)if(v=Si,e?n&&Ai(e,l,3,[u(),h?[]:void 0,v]):u(),i==="sync"){const x=TL();_=x.__watcherHandles||(x.__watcherHandles=[])}else return Si;let m=h?new Array(t.length).fill(vp):vp;const g=()=>{if(!(!b.active||!b.dirty))if(e){const x=b.run();(s||d||(h?x.some((A,M)=>Da(A,m[M])):Da(x,m)))&&(f&&f(),Ai(e,l,3,[x,m===vp?void 0:h&&m[0]===vp?[]:m,v]),m=x)}else b.run()};g.allowRecurse=!!e;let y;i==="sync"?y=g:i==="post"?y=()=>Ns(g,l&&l.suspense):(g.pre=!0,l&&(g.id=l.uid),y=()=>Jb(g));const b=new zb(u,Si,y),w=QR(),T=()=>{b.stop(),w&&Bb(w.effects,b)};return e?n?g():m=b.run():i==="post"?Ns(b.run.bind(b),l&&l.suspense):b.run(),_&&_.push(T),T}function AL(t,e,n){const s=this.proxy,i=On(t)?t.includes(".")?E4(s,t):()=>s[t]:t.bind(s,s);let r;ft(e)?r=e:(r=e.handler,n=e);const o=Vf(this),a=S4(i,r.bind(s),n);return o(),a}function E4(t,e){const n=e.split(".");return()=>{let s=t;for(let i=0;i{Ll(s,e,n)});else if(jR(t))for(const s in t)Ll(t[s],e,n);return t}function Ye(t,e){if(Nn===null)return t;const n=I_(Nn)||Nn.proxy,s=t.dirs||(t.dirs=[]);for(let i=0;i{t.isMounted=!0}),C4(()=>{t.isUnmounting=!0}),t}const pi=[Function,Array],A4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:pi,onEnter:pi,onAfterEnter:pi,onEnterCancelled:pi,onBeforeLeave:pi,onLeave:pi,onAfterLeave:pi,onLeaveCancelled:pi,onBeforeAppear:pi,onAppear:pi,onAfterAppear:pi,onAppearCancelled:pi},ML={name:"BaseTransition",props:A4,setup(t,{slots:e}){const n=q4(),s=T4();return()=>{const i=e.default&&tw(e.default(),!0);if(!i||!i.length)return;let r=i[0];if(i.length>1){for(const h of i)if(h.type!==ai){r=h;break}}const o=Mt(t),{mode:a}=o;if(s.isLeaving)return Y0(r);const l=N2(r);if(!l)return Y0(r);const c=ef(l,o,s,n);tf(l,c);const u=n.subTree,d=u&&N2(u);if(d&&d.type!==ai&&!Al(l,d)){const h=ef(d,o,s,n);if(tf(d,h),a==="out-in"&&l.type!==ai)return s.isLeaving=!0,h.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},Y0(r);a==="in-out"&&l.type!==ai&&(h.delayLeave=(f,v,_)=>{const m=M4(s,d);m[String(d.key)]=d,f[ca]=()=>{v(),f[ca]=void 0,delete c.delayedLeave},c.delayedLeave=_})}return r}}},RL=ML;function M4(t,e){const{leavingVNodes:n}=t;let s=n.get(e.type);return s||(s=Object.create(null),n.set(e.type,s)),s}function ef(t,e,n,s){const{appear:i,mode:r,persisted:o=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:h,onAfterLeave:f,onLeaveCancelled:v,onBeforeAppear:_,onAppear:m,onAfterAppear:g,onAppearCancelled:y}=e,b=String(t.key),w=M4(n,t),T=(M,E)=>{M&&Ai(M,s,9,E)},x=(M,E)=>{const S=E[1];T(M,E),et(M)?M.every(P=>P.length<=1)&&S():M.length<=1&&S()},A={mode:r,persisted:o,beforeEnter(M){let E=a;if(!n.isMounted)if(i)E=_||a;else return;M[ca]&&M[ca](!0);const S=w[b];S&&Al(t,S)&&S.el[ca]&&S.el[ca](),T(E,[M])},enter(M){let E=l,S=c,P=u;if(!n.isMounted)if(i)E=m||l,S=g||c,P=y||u;else return;let D=!1;const k=M[yp]=U=>{D||(D=!0,U?T(P,[M]):T(S,[M]),A.delayedLeave&&A.delayedLeave(),M[yp]=void 0)};E?x(E,[M,k]):k()},leave(M,E){const S=String(t.key);if(M[yp]&&M[yp](!0),n.isUnmounting)return E();T(d,[M]);let P=!1;const D=M[ca]=k=>{P||(P=!0,E(),k?T(v,[M]):T(f,[M]),M[ca]=void 0,w[S]===t&&delete w[S])};w[S]=t,h?x(h,[M,D]):D()},clone(M){return ef(M,e,n,s)}};return A}function Y0(t){if(R_(t))return t=Na(t),t.children=null,t}function N2(t){if(!R_(t))return t;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&ft(n.default))return n.default()}}function tf(t,e){t.shapeFlag&6&&t.component?tf(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function tw(t,e=!1,n){let s=[],i=0;for(let r=0;r1)for(let r=0;r!!t.type.__asyncLoader,R_=t=>t.type.__isKeepAlive;function kL(t,e){R4(t,"a",e)}function CL(t,e){R4(t,"da",e)}function R4(t,e,n=Zn){const s=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(k_(e,s,n),n){let i=n.parent;for(;i&&i.parent;)R_(i.parent.vnode)&&PL(s,e,n,i),i=i.parent}}function PL(t,e,n,s){const i=k_(e,t,s,!0);sw(()=>{Bb(s[e],i)},n)}function k_(t,e,n=Zn,s=!1){if(n){const i=n[t]||(n[t]=[]),r=e.__weh||(e.__weh=(...o)=>{if(n.isUnmounted)return;ja();const a=Vf(n),l=Ai(e,n,t,o);return a(),qa(),l});return s?i.unshift(r):i.push(r),r}}const Io=t=>(e,n=Zn)=>(!O_||t==="sp")&&k_(t,(...s)=>e(...s),n),OL=Io("bm"),nw=Io("m"),IL=Io("bu"),k4=Io("u"),C4=Io("bum"),sw=Io("um"),LL=Io("sp"),DL=Io("rtg"),NL=Io("rtc");function FL(t,e=Zn){k_("ec",t,e)}function qt(t,e,n,s){let i;const r=n;if(et(t)||On(t)){i=new Array(t.length);for(let o=0,a=t.length;oe(o,a,void 0,r));else{const o=Object.keys(t);i=new Array(o.length);for(let a=0,l=o.length;aSg(e)?!(e.type===ai||e.type===ot&&!O4(e.children)):!0)?t:null}const Jv=t=>t?Y4(t)?I_(t)||t.proxy:Jv(t.parent):null,Ph=Pn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Jv(t.parent),$root:t=>Jv(t.root),$emit:t=>t.emit,$options:t=>iw(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,Jb(t.update)}),$nextTick:t=>t.n||(t.n=zf.bind(t.proxy)),$watch:t=>AL.bind(t)}),X0=(t,e)=>t!==un&&!t.__isScriptSetup&&Ot(t,e),UL={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:s,data:i,props:r,accessCache:o,type:a,appContext:l}=t;let c;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return s[e];case 2:return i[e];case 4:return n[e];case 3:return r[e]}else{if(X0(s,e))return o[e]=1,s[e];if(i!==un&&Ot(i,e))return o[e]=2,i[e];if((c=t.propsOptions[0])&&Ot(c,e))return o[e]=3,r[e];if(n!==un&&Ot(n,e))return o[e]=4,n[e];Qv&&(o[e]=0)}}const u=Ph[e];let d,h;if(u)return e==="$attrs"&&Ws(t.attrs,"get",""),u(t);if((d=a.__cssModules)&&(d=d[e]))return d;if(n!==un&&Ot(n,e))return o[e]=4,n[e];if(h=l.config.globalProperties,Ot(h,e))return h[e]},set({_:t},e,n){const{data:s,setupState:i,ctx:r}=t;return X0(i,e)?(i[e]=n,!0):s!==un&&Ot(s,e)?(s[e]=n,!0):Ot(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:s,appContext:i,propsOptions:r}},o){let a;return!!n[o]||t!==un&&Ot(t,o)||X0(e,o)||(a=r[0])&&Ot(a,o)||Ot(s,o)||Ot(Ph,o)||Ot(i.config.globalProperties,o)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Ot(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function F2(t){return et(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let Qv=!0;function $L(t){const e=iw(t),n=t.proxy,s=t.ctx;Qv=!1,e.beforeCreate&&U2(e.beforeCreate,t,"bc");const{data:i,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:h,beforeUpdate:f,updated:v,activated:_,deactivated:m,beforeDestroy:g,beforeUnmount:y,destroyed:b,unmounted:w,render:T,renderTracked:x,renderTriggered:A,errorCaptured:M,serverPrefetch:E,expose:S,inheritAttrs:P,components:D,directives:k,filters:U}=e;if(c&&BL(c,s,null),o)for(const J in o){const B=o[J];ft(B)&&(s[J]=B.bind(n))}if(i){const J=i.call(n,n);Zt(J)&&(t.data=ud(J))}if(Qv=!0,r)for(const J in r){const B=r[J],fe=ft(B)?B.bind(n,n):ft(B.get)?B.get.bind(n,n):Si,se=!ft(B)&&ft(B.set)?B.set.bind(n):Si,we=kn({get:fe,set:se});Object.defineProperty(s,J,{enumerable:!0,configurable:!0,get:()=>we.value,set:xe=>we.value=xe})}if(a)for(const J in a)I4(a[J],s,n,J);if(l){const J=ft(l)?l.call(n):l;Reflect.ownKeys(J).forEach(B=>{Hm(B,J[B])})}u&&U2(u,t,"c");function G(J,B){et(B)?B.forEach(fe=>J(fe.bind(n))):B&&J(B.bind(n))}if(G(OL,d),G(nw,h),G(IL,f),G(k4,v),G(kL,_),G(CL,m),G(FL,M),G(NL,x),G(DL,A),G(C4,y),G(sw,w),G(LL,E),et(S))if(S.length){const J=t.exposed||(t.exposed={});S.forEach(B=>{Object.defineProperty(J,B,{get:()=>n[B],set:fe=>n[B]=fe})})}else t.exposed||(t.exposed={});T&&t.render===Si&&(t.render=T),P!=null&&(t.inheritAttrs=P),D&&(t.components=D),k&&(t.directives=k)}function BL(t,e,n=Si){et(t)&&(t=ey(t));for(const s in t){const i=t[s];let r;Zt(i)?"default"in i?r=Tr(i.from||s,i.default,!0):r=Tr(i.from||s):r=Tr(i),Hn(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function U2(t,e,n){Ai(et(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,n)}function I4(t,e,n,s){const i=s.includes(".")?E4(n,s):()=>n[s];if(On(t)){const r=e[t];ft(r)&&Zl(i,r)}else if(ft(t))Zl(i,t.bind(n));else if(Zt(t))if(et(t))t.forEach(r=>I4(r,e,n,s));else{const r=ft(t.handler)?t.handler.bind(n):e[t.handler];ft(r)&&Zl(i,r,t)}}function iw(t){const e=t.type,{mixins:n,extends:s}=e,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,a=r.get(e);let l;return a?l=a:!i.length&&!n&&!s?l=e:(l={},i.length&&i.forEach(c=>xg(l,c,o,!0)),xg(l,e,o)),Zt(e)&&r.set(e,l),l}function xg(t,e,n,s=!1){const{mixins:i,extends:r}=e;r&&xg(t,r,n,!0),i&&i.forEach(o=>xg(t,o,n,!0));for(const o in e)if(!(s&&o==="expose")){const a=HL[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const HL={data:$2,props:B2,emits:B2,methods:mh,computed:mh,beforeCreate:xs,created:xs,beforeMount:xs,mounted:xs,beforeUpdate:xs,updated:xs,beforeDestroy:xs,beforeUnmount:xs,destroyed:xs,unmounted:xs,activated:xs,deactivated:xs,errorCaptured:xs,serverPrefetch:xs,components:mh,directives:mh,watch:zL,provide:$2,inject:GL};function $2(t,e){return e?t?function(){return Pn(ft(t)?t.call(this,this):t,ft(e)?e.call(this,this):e)}:e:t}function GL(t,e){return mh(ey(t),ey(e))}function ey(t){if(et(t)){const e={};for(let n=0;n1)return n&&ft(e)?e.call(s&&s.proxy):e}}function jL(){return!!(Zn||Nn||pu)}const D4={},N4=()=>Object.create(D4),F4=t=>Object.getPrototypeOf(t)===D4;function qL(t,e,n,s=!1){const i={},r=N4();t.propsDefaults=Object.create(null),U4(t,e,i,r);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);n?t.props=s?i:d4(i):t.type.props?t.props=i:t.props=r,t.attrs=r}function YL(t,e,n,s){const{props:i,attrs:r,vnode:{patchFlag:o}}=t,a=Mt(i),[l]=t.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[h,f]=$4(d,e,!0);Pn(o,h),f&&a.push(...f)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!r&&!l)return Zt(t)&&s.set(t,uu),uu;if(et(r))for(let u=0;u-1,f[1]=_<0||v<_,(v>-1||Ot(f,"default"))&&a.push(d)}}}const c=[o,a];return Zt(t)&&s.set(t,c),c}function H2(t){return t[0]!=="$"&&!kh(t)}function G2(t){return t===null?"null":typeof t=="function"?t.name||"":typeof t=="object"&&t.constructor&&t.constructor.name||""}function z2(t,e){return G2(t)===G2(e)}function V2(t,e){return et(e)?e.findIndex(n=>z2(n,t)):ft(e)&&z2(e,t)?0:-1}const B4=t=>t[0]==="_"||t==="$stable",rw=t=>et(t)?t.map(gr):[gr(t)],XL=(t,e,n)=>{if(e._n)return e;const s=nt((...i)=>rw(e(...i)),n);return s._c=!1,s},H4=(t,e,n)=>{const s=t._ctx;for(const i in t){if(B4(i))continue;const r=t[i];if(ft(r))e[i]=XL(i,r,s);else if(r!=null){const o=rw(r);e[i]=()=>o}}},G4=(t,e)=>{const n=rw(e);t.slots.default=()=>n},KL=(t,e)=>{const n=t.slots=N4();if(t.vnode.shapeFlag&32){const s=e._;s?(Pn(n,e),qR(n,"_",s,!0)):H4(e,n)}else e&&G4(t,e)},ZL=(t,e,n)=>{const{vnode:s,slots:i}=t;let r=!0,o=un;if(s.shapeFlag&32){const a=e._;a?n&&a===1?r=!1:(Pn(i,e),!n&&a===1&&delete i._):(r=!e.$stable,H4(e,i)),o=e}else e&&(G4(t,e),o={default:1});if(r)for(const a in i)!B4(a)&&o[a]==null&&delete i[a]};function ny(t,e,n,s,i=!1){if(et(t)){t.forEach((h,f)=>ny(h,e&&(et(e)?e[f]:e),n,s,i));return}if(Ch(s)&&!i)return;const r=s.shapeFlag&4?I_(s.component)||s.component.proxy:s.el,o=i?null:r,{i:a,r:l}=t,c=e&&e.r,u=a.refs===un?a.refs={}:a.refs,d=a.setupState;if(c!=null&&c!==l&&(On(c)?(u[c]=null,Ot(d,c)&&(d[c]=null)):Hn(c)&&(c.value=null)),ft(l))ka(l,a,12,[o,u]);else{const h=On(l),f=Hn(l);if(h||f){const v=()=>{if(t.f){const _=h?Ot(d,l)?d[l]:u[l]:l.value;i?et(_)&&Bb(_,r):et(_)?_.includes(r)||_.push(r):h?(u[l]=[r],Ot(d,l)&&(d[l]=u[l])):(l.value=[r],t.k&&(u[t.k]=l.value))}else h?(u[l]=o,Ot(d,l)&&(d[l]=o)):f&&(l.value=o,t.k&&(u[t.k]=o))};o?(v.id=-1,Ns(v,n)):v()}}}const Ns=SL;function JL(t){return QL(t)}function QL(t,e){const n=YR();n.__VUE__=!0;const{insert:s,remove:i,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:h,setScopeId:f=Si,insertStaticContent:v}=t,_=(L,$,ee,de=null,he=null,ke=null,O=void 0,R=null,q=!!$.dynamicChildren)=>{if(L===$)return;L&&!Al(L,$)&&(de=ne(L),xe(L,he,ke,!0),L=null),$.patchFlag===-2&&(q=!1,$.dynamicChildren=null);const{type:K,ref:ae,shapeFlag:pe}=$;switch(K){case C_:m(L,$,ee,de);break;case ai:g(L,$,ee,de);break;case Gm:L==null&&y($,ee,de,O);break;case ot:D(L,$,ee,de,he,ke,O,R,q);break;default:pe&1?T(L,$,ee,de,he,ke,O,R,q):pe&6?k(L,$,ee,de,he,ke,O,R,q):(pe&64||pe&128)&&K.process(L,$,ee,de,he,ke,O,R,q,j)}ae!=null&&he&&ny(ae,L&&L.ref,ke,$||L,!$)},m=(L,$,ee,de)=>{if(L==null)s($.el=a($.children),ee,de);else{const he=$.el=L.el;$.children!==L.children&&c(he,$.children)}},g=(L,$,ee,de)=>{L==null?s($.el=l($.children||""),ee,de):$.el=L.el},y=(L,$,ee,de)=>{[L.el,L.anchor]=v(L.children,$,ee,de,L.el,L.anchor)},b=({el:L,anchor:$},ee,de)=>{let he;for(;L&&L!==$;)he=h(L),s(L,ee,de),L=he;s($,ee,de)},w=({el:L,anchor:$})=>{let ee;for(;L&&L!==$;)ee=h(L),i(L),L=ee;i($)},T=(L,$,ee,de,he,ke,O,R,q)=>{$.type==="svg"?O="svg":$.type==="math"&&(O="mathml"),L==null?x($,ee,de,he,ke,O,R,q):E(L,$,he,ke,O,R,q)},x=(L,$,ee,de,he,ke,O,R)=>{let q,K;const{props:ae,shapeFlag:pe,transition:Me,dirs:be}=L;if(q=L.el=o(L.type,ke,ae&&ae.is,ae),pe&8?u(q,L.children):pe&16&&M(L.children,q,null,de,he,K0(L,ke),O,R),be&&sl(L,null,de,"created"),A(q,L,L.scopeId,O,de),ae){for(const He in ae)He!=="value"&&!kh(He)&&r(q,He,null,ae[He],ke,L.children,de,he,Ce);"value"in ae&&r(q,"value",null,ae.value,ke),(K=ae.onVnodeBeforeMount)&&cr(K,de,L)}be&&sl(L,null,de,"beforeMount");const Se=eD(he,Me);Se&&Me.beforeEnter(q),s(q,$,ee),((K=ae&&ae.onVnodeMounted)||Se||be)&&Ns(()=>{K&&cr(K,de,L),Se&&Me.enter(q),be&&sl(L,null,de,"mounted")},he)},A=(L,$,ee,de,he)=>{if(ee&&f(L,ee),de)for(let ke=0;ke{for(let K=q;K{const R=$.el=L.el;let{patchFlag:q,dynamicChildren:K,dirs:ae}=$;q|=L.patchFlag&16;const pe=L.props||un,Me=$.props||un;let be;if(ee&&il(ee,!1),(be=Me.onVnodeBeforeUpdate)&&cr(be,ee,$,L),ae&&sl($,L,ee,"beforeUpdate"),ee&&il(ee,!0),K?S(L.dynamicChildren,K,R,ee,de,K0($,he),ke):O||B(L,$,R,null,ee,de,K0($,he),ke,!1),q>0){if(q&16)P(R,$,pe,Me,ee,de,he);else if(q&2&&pe.class!==Me.class&&r(R,"class",null,Me.class,he),q&4&&r(R,"style",pe.style,Me.style,he),q&8){const Se=$.dynamicProps;for(let He=0;He{be&&cr(be,ee,$,L),ae&&sl($,L,ee,"updated")},de)},S=(L,$,ee,de,he,ke,O)=>{for(let R=0;R<$.length;R++){const q=L[R],K=$[R],ae=q.el&&(q.type===ot||!Al(q,K)||q.shapeFlag&70)?d(q.el):ee;_(q,K,ae,null,de,he,ke,O,!0)}},P=(L,$,ee,de,he,ke,O)=>{if(ee!==de){if(ee!==un)for(const R in ee)!kh(R)&&!(R in de)&&r(L,R,ee[R],null,O,$.children,he,ke,Ce);for(const R in de){if(kh(R))continue;const q=de[R],K=ee[R];q!==K&&R!=="value"&&r(L,R,K,q,O,$.children,he,ke,Ce)}"value"in de&&r(L,"value",ee.value,de.value,O)}},D=(L,$,ee,de,he,ke,O,R,q)=>{const K=$.el=L?L.el:a(""),ae=$.anchor=L?L.anchor:a("");let{patchFlag:pe,dynamicChildren:Me,slotScopeIds:be}=$;be&&(R=R?R.concat(be):be),L==null?(s(K,ee,de),s(ae,ee,de),M($.children||[],ee,ae,he,ke,O,R,q)):pe>0&&pe&64&&Me&&L.dynamicChildren?(S(L.dynamicChildren,Me,ee,he,ke,O,R),($.key!=null||he&&$===he.subTree)&&z4(L,$,!0)):B(L,$,ee,ae,he,ke,O,R,q)},k=(L,$,ee,de,he,ke,O,R,q)=>{$.slotScopeIds=R,L==null?$.shapeFlag&512?he.ctx.activate($,ee,de,O,q):U($,ee,de,he,ke,O,q):z(L,$,q)},U=(L,$,ee,de,he,ke,O)=>{const R=L.component=lD(L,de,he);if(R_(L)&&(R.ctx.renderer=j),cD(R),R.asyncDep){if(he&&he.registerDep(R,G),!L.el){const q=R.subTree=Y(ai);g(null,q,$,ee)}}else G(R,L,$,ee,he,ke,O)},z=(L,$,ee)=>{const de=$.component=L.component;if(_L(L,$,ee))if(de.asyncDep&&!de.asyncResolved){J(de,$,ee);return}else de.next=$,dL(de.update),de.effect.dirty=!0,de.update();else $.el=L.el,de.vnode=$},G=(L,$,ee,de,he,ke,O)=>{const R=()=>{if(L.isMounted){let{next:ae,bu:pe,u:Me,parent:be,vnode:Se}=L;{const C=V4(L);if(C){ae&&(ae.el=Se.el,J(L,ae,O)),C.asyncDep.then(()=>{L.isUnmounted||R()});return}}let He=ae,Pe;il(L,!1),ae?(ae.el=Se.el,J(L,ae,O)):ae=Se,pe&&$m(pe),(Pe=ae.props&&ae.props.onVnodeBeforeUpdate)&&cr(Pe,be,ae,Se),il(L,!0);const ye=q0(L),te=L.subTree;L.subTree=ye,_(te,ye,d(te.el),ne(te),L,he,ke),ae.el=ye.el,He===null&&vL(L,ye.el),Me&&Ns(Me,he),(Pe=ae.props&&ae.props.onVnodeUpdated)&&Ns(()=>cr(Pe,be,ae,Se),he)}else{let ae;const{el:pe,props:Me}=$,{bm:be,m:Se,parent:He}=L,Pe=Ch($);if(il(L,!1),be&&$m(be),!Pe&&(ae=Me&&Me.onVnodeBeforeMount)&&cr(ae,He,$),il(L,!0),pe&&Fe){const ye=()=>{L.subTree=q0(L),Fe(pe,L.subTree,L,he,null)};Pe?$.type.__asyncLoader().then(()=>!L.isUnmounted&&ye()):ye()}else{const ye=L.subTree=q0(L);_(null,ye,ee,de,L,he,ke),$.el=ye.el}if(Se&&Ns(Se,he),!Pe&&(ae=Me&&Me.onVnodeMounted)){const ye=$;Ns(()=>cr(ae,He,ye),he)}($.shapeFlag&256||He&&Ch(He.vnode)&&He.vnode.shapeFlag&256)&&L.a&&Ns(L.a,he),L.isMounted=!0,$=ee=de=null}},q=L.effect=new zb(R,Si,()=>Jb(K),L.scope),K=L.update=()=>{q.dirty&&q.run()};K.id=L.uid,il(L,!0),K()},J=(L,$,ee)=>{$.component=L;const de=L.vnode.props;L.vnode=$,L.next=null,YL(L,$.props,de,ee),ZL(L,$.children,ee),ja(),I2(L),qa()},B=(L,$,ee,de,he,ke,O,R,q=!1)=>{const K=L&&L.children,ae=L?L.shapeFlag:0,pe=$.children,{patchFlag:Me,shapeFlag:be}=$;if(Me>0){if(Me&128){se(K,pe,ee,de,he,ke,O,R,q);return}else if(Me&256){fe(K,pe,ee,de,he,ke,O,R,q);return}}be&8?(ae&16&&Ce(K,he,ke),pe!==K&&u(ee,pe)):ae&16?be&16?se(K,pe,ee,de,he,ke,O,R,q):Ce(K,he,ke,!0):(ae&8&&u(ee,""),be&16&&M(pe,ee,de,he,ke,O,R,q))},fe=(L,$,ee,de,he,ke,O,R,q)=>{L=L||uu,$=$||uu;const K=L.length,ae=$.length,pe=Math.min(K,ae);let Me;for(Me=0;Meae?Ce(L,he,ke,!0,!1,pe):M($,ee,de,he,ke,O,R,q,pe)},se=(L,$,ee,de,he,ke,O,R,q)=>{let K=0;const ae=$.length;let pe=L.length-1,Me=ae-1;for(;K<=pe&&K<=Me;){const be=L[K],Se=$[K]=q?ua($[K]):gr($[K]);if(Al(be,Se))_(be,Se,ee,null,he,ke,O,R,q);else break;K++}for(;K<=pe&&K<=Me;){const be=L[pe],Se=$[Me]=q?ua($[Me]):gr($[Me]);if(Al(be,Se))_(be,Se,ee,null,he,ke,O,R,q);else break;pe--,Me--}if(K>pe){if(K<=Me){const be=Me+1,Se=beMe)for(;K<=pe;)xe(L[K],he,ke,!0),K++;else{const be=K,Se=K,He=new Map;for(K=Se;K<=Me;K++){const W=$[K]=q?ua($[K]):gr($[K]);W.key!=null&&He.set(W.key,K)}let Pe,ye=0;const te=Me-Se+1;let C=!1,X=0;const N=new Array(te);for(K=0;K=te){xe(W,he,ke,!0);continue}let Q;if(W.key!=null)Q=He.get(W.key);else for(Pe=Se;Pe<=Me;Pe++)if(N[Pe-Se]===0&&Al(W,$[Pe])){Q=Pe;break}Q===void 0?xe(W,he,ke,!0):(N[Q-Se]=K+1,Q>=X?X=Q:C=!0,_(W,$[Q],ee,null,he,ke,O,R,q),ye++)}const V=C?tD(N):uu;for(Pe=V.length-1,K=te-1;K>=0;K--){const W=Se+K,Q=$[W],F=W+1{const{el:ke,type:O,transition:R,children:q,shapeFlag:K}=L;if(K&6){we(L.component.subTree,$,ee,de);return}if(K&128){L.suspense.move($,ee,de);return}if(K&64){O.move(L,$,ee,j);return}if(O===ot){s(ke,$,ee);for(let pe=0;peR.enter(ke),he);else{const{leave:pe,delayLeave:Me,afterLeave:be}=R,Se=()=>s(ke,$,ee),He=()=>{pe(ke,()=>{Se(),be&&be()})};Me?Me(ke,Se,He):He()}else s(ke,$,ee)},xe=(L,$,ee,de=!1,he=!1)=>{const{type:ke,props:O,ref:R,children:q,dynamicChildren:K,shapeFlag:ae,patchFlag:pe,dirs:Me}=L;if(R!=null&&ny(R,null,ee,L,!0),ae&256){$.ctx.deactivate(L);return}const be=ae&1&&Me,Se=!Ch(L);let He;if(Se&&(He=O&&O.onVnodeBeforeUnmount)&&cr(He,$,L),ae&6)Ee(L.component,ee,de);else{if(ae&128){L.suspense.unmount(ee,de);return}be&&sl(L,null,$,"beforeUnmount"),ae&64?L.type.remove(L,$,ee,he,j,de):K&&(ke!==ot||pe>0&&pe&64)?Ce(K,$,ee,!1,!0):(ke===ot&&pe&384||!he&&ae&16)&&Ce(q,$,ee),de&&Ne(L)}(Se&&(He=O&&O.onVnodeUnmounted)||be)&&Ns(()=>{He&&cr(He,$,L),be&&sl(L,null,$,"unmounted")},ee)},Ne=L=>{const{type:$,el:ee,anchor:de,transition:he}=L;if($===ot){oe(ee,de);return}if($===Gm){w(L);return}const ke=()=>{i(ee),he&&!he.persisted&&he.afterLeave&&he.afterLeave()};if(L.shapeFlag&1&&he&&!he.persisted){const{leave:O,delayLeave:R}=he,q=()=>O(ee,ke);R?R(L.el,ke,q):q()}else ke()},oe=(L,$)=>{let ee;for(;L!==$;)ee=h(L),i(L),L=ee;i($)},Ee=(L,$,ee)=>{const{bum:de,scope:he,update:ke,subTree:O,um:R}=L;de&&$m(de),he.stop(),ke&&(ke.active=!1,xe(O,L,$,ee)),R&&Ns(R,$),Ns(()=>{L.isUnmounted=!0},$),$&&$.pendingBranch&&!$.isUnmounted&&L.asyncDep&&!L.asyncResolved&&L.suspenseId===$.pendingId&&($.deps--,$.deps===0&&$.resolve())},Ce=(L,$,ee,de=!1,he=!1,ke=0)=>{for(let O=ke;OL.shapeFlag&6?ne(L.component.subTree):L.shapeFlag&128?L.suspense.next():h(L.anchor||L.el);let Re=!1;const Ae=(L,$,ee)=>{L==null?$._vnode&&xe($._vnode,null,null,!0):_($._vnode||null,L,$,null,null,null,ee),Re||(Re=!0,I2(),y4(),Re=!1),$._vnode=L},j={p:_,um:xe,m:we,r:Ne,mt:U,mc:M,pc:B,pbc:S,n:ne,o:t};let qe,Fe;return{render:Ae,hydrate:qe,createApp:WL(Ae,qe)}}function K0({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function il({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function eD(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function z4(t,e,n=!1){const s=t.children,i=e.children;if(et(s)&&et(i))for(let r=0;r>1,t[n[a]]0&&(e[s]=n[r-1]),n[r]=s)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=e[o];return n}function V4(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:V4(e)}const nD=t=>t.__isTeleport,ot=Symbol.for("v-fgt"),C_=Symbol.for("v-txt"),ai=Symbol.for("v-cmt"),Gm=Symbol.for("v-stc"),Oh=[];let Ki=null;function Z(t=!1){Oh.push(Ki=t?null:[])}function sD(){Oh.pop(),Ki=Oh[Oh.length-1]||null}let nf=1;function W2(t){nf+=t}function W4(t){return t.dynamicChildren=nf>0?Ki||uu:null,sD(),nf>0&&Ki&&Ki.push(t),t}function ie(t,e,n,s,i,r){return W4(p(t,e,n,s,i,r,!0))}function en(t,e,n,s,i){return W4(Y(t,e,n,s,i,!0))}function Sg(t){return t?t.__v_isVNode===!0:!1}function Al(t,e){return t.type===e.type&&t.key===e.key}const j4=({key:t})=>t??null,zm=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?On(t)||Hn(t)||ft(t)?{i:Nn,r:t,k:e,f:!!n}:t:null);function p(t,e=null,n=null,s=0,i=null,r=t===ot?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&j4(e),ref:e&&zm(e),scopeId:M_,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Nn};return a?(ow(l,n),r&128&&t.normalize(l)):n&&(l.shapeFlag|=On(n)?8:16),nf>0&&!o&&Ki&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&Ki.push(l),l}const Y=iD;function iD(t,e=null,n=null,s=0,i=null,r=!1){if((!t||t===x4)&&(t=ai),Sg(t)){const a=Na(t,e,!0);return n&&ow(a,n),nf>0&&!r&&Ki&&(a.shapeFlag&6?Ki[Ki.indexOf(t)]=a:Ki.push(a)),a.patchFlag|=-2,a}if(pD(t)&&(t=t.__vccOpts),e){e=rD(e);let{class:a,style:l}=e;a&&!On(a)&&(e.class=ms(a)),Zt(l)&&(x_(l)&&!et(l)&&(l=Pn({},l)),e.style=b_(l))}const o=On(t)?1:xL(t)?128:nD(t)?64:Zt(t)?4:ft(t)?2:0;return p(t,e,n,s,i,o,r,!0)}function rD(t){return t?x_(t)||F4(t)?Pn({},t):t:null}function Na(t,e,n=!1,s=!1){const{props:i,ref:r,patchFlag:o,children:a,transition:l}=t,c=e?P_(i||{},e):i,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&j4(c),ref:e&&e.ref?n&&r?et(r)?r.concat(zm(e)):[r,zm(e)]:zm(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ot?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Na(t.ssContent),ssFallback:t.ssFallback&&Na(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&s&&(u.transition=l.clone(u)),u}function me(t=" ",e=0){return Y(C_,null,t,e)}function Ya(t,e){const n=Y(Gm,null,t);return n.staticCount=e,n}function ze(t="",e=!1){return e?(Z(),en(ai,null,t)):Y(ai,null,t)}function gr(t){return t==null||typeof t=="boolean"?Y(ai):et(t)?Y(ot,null,t.slice()):typeof t=="object"?ua(t):Y(C_,null,String(t))}function ua(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Na(t)}function ow(t,e){let n=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(et(e))n=16;else if(typeof e=="object")if(s&65){const i=e.default;i&&(i._c&&(i._d=!1),ow(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!F4(e)?e._ctx=Nn:i===3&&Nn&&(Nn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ft(e)?(e={default:e,_ctx:Nn},n=32):(e=String(e),s&64?(n=16,e=[me(e)]):n=8);t.children=e,t.shapeFlag|=n}function P_(...t){const e={};for(let n=0;nZn||Nn;let Eg,sy;{const t=YR(),e=(n,s)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(s),r=>{i.length>1?i.forEach(o=>o(r)):i[0](r)}};Eg=e("__VUE_INSTANCE_SETTERS__",n=>Zn=n),sy=e("__VUE_SSR_SETTERS__",n=>O_=n)}const Vf=t=>{const e=Zn;return Eg(t),t.scope.on(),()=>{t.scope.off(),Eg(e)}},j2=()=>{Zn&&Zn.scope.off(),Eg(null)};function Y4(t){return t.vnode.shapeFlag&4}let O_=!1;function cD(t,e=!1){e&&sy(e);const{props:n,children:s}=t.vnode,i=Y4(t);qL(t,n,i,e),KL(t,s);const r=i?uD(t,e):void 0;return e&&sy(!1),r}function uD(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,UL);const{setup:s}=n;if(s){const i=t.setupContext=s.length>1?hD(t):null,r=Vf(t);ja();const o=ka(s,t,0,[t.props,i]);if(qa(),r(),VR(o)){if(o.then(j2,j2),e)return o.then(a=>{q2(t,a,e)}).catch(a=>{T_(a,t,0)});t.asyncDep=o}else q2(t,o,e)}else X4(t,e)}function q2(t,e,n){ft(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Zt(e)&&(t.setupState=g4(e)),X4(t,n)}let Y2;function X4(t,e,n){const s=t.type;if(!t.render){if(!e&&Y2&&!s.render){const i=s.template||iw(t).template;if(i){const{isCustomElement:r,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:l}=s,c=Pn(Pn({isCustomElement:r,delimiters:a},o),l);s.render=Y2(i,c)}}t.render=s.render||Si}{const i=Vf(t);ja();try{$L(t)}finally{qa(),i()}}}const dD={get(t,e){return Ws(t,"get",""),t[e]}};function hD(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,dD),slots:t.slots,emit:t.emit,expose:e}}function I_(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(g4(Xb(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Ph)return Ph[n](t)},has(e,n){return n in e||n in Ph}}))}function fD(t,e=!0){return ft(t)?t.displayName||t.name:t.name||e&&t.__name}function pD(t){return ft(t)&&"__vccOpts"in t}const kn=(t,e)=>sL(t,e,O_);function nc(t,e,n){const s=arguments.length;return s===2?Zt(e)&&!et(e)?Sg(e)?Y(t,null,[e]):Y(t,e):Y(t,null,e):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Sg(n)&&(n=[n]),Y(t,e,n))}const K4="3.4.26";/** +* @vue/runtime-dom v3.4.26 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const mD="http://www.w3.org/2000/svg",gD="http://www.w3.org/1998/Math/MathML",da=typeof document<"u"?document:null,X2=da&&da.createElement("template"),_D={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,s)=>{const i=e==="svg"?da.createElementNS(mD,t):e==="mathml"?da.createElementNS(gD,t):da.createElement(t,n?{is:n}:void 0);return t==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:t=>da.createTextNode(t),createComment:t=>da.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>da.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,s,i,r){const o=n?n.previousSibling:e.lastChild;if(i&&(i===r||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{X2.innerHTML=s==="svg"?`${t}`:s==="mathml"?`${t}`:t;const a=X2.content;if(s==="svg"||s==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Ho="transition",Hd="animation",Uu=Symbol("_vtc"),aw=(t,{slots:e})=>nc(RL,J4(t),e);aw.displayName="Transition";const Z4={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},vD=aw.props=Pn({},A4,Z4),rl=(t,e=[])=>{et(t)?t.forEach(n=>n(...e)):t&&t(...e)},K2=t=>t?et(t)?t.some(e=>e.length>1):t.length>1:!1;function J4(t){const e={};for(const D in t)D in Z4||(e[D]=t[D]);if(t.css===!1)return e;const{name:n="v",type:s,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=t,v=yD(i),_=v&&v[0],m=v&&v[1],{onBeforeEnter:g,onEnter:y,onEnterCancelled:b,onLeave:w,onLeaveCancelled:T,onBeforeAppear:x=g,onAppear:A=y,onAppearCancelled:M=b}=e,E=(D,k,U)=>{ta(D,k?u:a),ta(D,k?c:o),U&&U()},S=(D,k)=>{D._isLeaving=!1,ta(D,d),ta(D,f),ta(D,h),k&&k()},P=D=>(k,U)=>{const z=D?A:y,G=()=>E(k,D,U);rl(z,[k,G]),Z2(()=>{ta(k,D?l:r),Zr(k,D?u:a),K2(z)||J2(k,s,_,G)})};return Pn(e,{onBeforeEnter(D){rl(g,[D]),Zr(D,r),Zr(D,o)},onBeforeAppear(D){rl(x,[D]),Zr(D,l),Zr(D,c)},onEnter:P(!1),onAppear:P(!0),onLeave(D,k){D._isLeaving=!0;const U=()=>S(D,k);Zr(D,d),Zr(D,h),ek(),Z2(()=>{D._isLeaving&&(ta(D,d),Zr(D,f),K2(w)||J2(D,s,m,U))}),rl(w,[D,U])},onEnterCancelled(D){E(D,!1),rl(b,[D])},onAppearCancelled(D){E(D,!0),rl(M,[D])},onLeaveCancelled(D){S(D),rl(T,[D])}})}function yD(t){if(t==null)return null;if(Zt(t))return[Z0(t.enter),Z0(t.leave)];{const e=Z0(t);return[e,e]}}function Z0(t){return M6(t)}function Zr(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Uu]||(t[Uu]=new Set)).add(e)}function ta(t,e){e.split(/\s+/).forEach(s=>s&&t.classList.remove(s));const n=t[Uu];n&&(n.delete(e),n.size||(t[Uu]=void 0))}function Z2(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let bD=0;function J2(t,e,n,s){const i=t._endId=++bD,r=()=>{i===t._endId&&s()};if(n)return setTimeout(r,n);const{type:o,timeout:a,propCount:l}=Q4(t,e);if(!o)return s();const c=o+"end";let u=0;const d=()=>{t.removeEventListener(c,h),r()},h=f=>{f.target===t&&++u>=l&&d()};setTimeout(()=>{u(n[v]||"").split(", "),i=s(`${Ho}Delay`),r=s(`${Ho}Duration`),o=Q2(i,r),a=s(`${Hd}Delay`),l=s(`${Hd}Duration`),c=Q2(a,l);let u=null,d=0,h=0;e===Ho?o>0&&(u=Ho,d=o,h=r.length):e===Hd?c>0&&(u=Hd,d=c,h=l.length):(d=Math.max(o,c),u=d>0?o>c?Ho:Hd:null,h=u?u===Ho?r.length:l.length:0);const f=u===Ho&&/\b(transform|all)(,|$)/.test(s(`${Ho}Property`).toString());return{type:u,timeout:d,propCount:h,hasTransform:f}}function Q2(t,e){for(;t.lengtheS(n)+eS(t[s])))}function eS(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function ek(){return document.body.offsetHeight}function wD(t,e,n){const s=t[Uu];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Tg=Symbol("_vod"),tk=Symbol("_vsh"),Ag={beforeMount(t,{value:e},{transition:n}){t[Tg]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Gd(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:s}){!e!=!n&&(s?e?(s.beforeEnter(t),Gd(t,!0),s.enter(t)):s.leave(t,()=>{Gd(t,!1)}):Gd(t,e))},beforeUnmount(t,{value:e}){Gd(t,e)}};function Gd(t,e){t.style.display=e?t[Tg]:"none",t[tk]=!e}const xD=Symbol(""),SD=/(^|;)\s*display\s*:/;function ED(t,e,n){const s=t.style,i=On(n);let r=!1;if(n&&!i){if(e)if(On(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Vm(s,a,"")}else for(const o in e)n[o]==null&&Vm(s,o,"");for(const o in n)o==="display"&&(r=!0),Vm(s,o,n[o])}else if(i){if(e!==n){const o=s[xD];o&&(n+=";"+o),s.cssText=n,r=SD.test(n)}}else e&&t.removeAttribute("style");Tg in t&&(t[Tg]=r?s.display:"",t[tk]&&(s.display="none"))}const tS=/\s*!important$/;function Vm(t,e,n){if(et(n))n.forEach(s=>Vm(t,e,s));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const s=TD(t,e);tS.test(n)?t.setProperty(cd(s),n.replace(tS,""),"important"):t[s]=n}}const nS=["Webkit","Moz","ms"],J0={};function TD(t,e){const n=J0[e];if(n)return n;let s=Cr(e);if(s!=="filter"&&s in t)return J0[e]=s;s=y_(s);for(let i=0;iQ0||(PD.then(()=>Q0=0),Q0=Date.now());function ID(t,e){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Ai(LD(s,n.value),e,5,[s])};return n.value=t,n.attached=OD(),n}function LD(t,e){if(et(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(s=>i=>!i._stopped&&s&&s(i))}else return e}const oS=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,DD=(t,e,n,s,i,r,o,a,l)=>{const c=i==="svg";e==="class"?wD(t,s,c):e==="style"?ED(t,n,s):__(e)?$b(e)||kD(t,e,n,s,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):ND(t,e,s,c))?MD(t,e,s,r,o,a,l):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),AD(t,e,s,c))};function ND(t,e,n,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&oS(e)&&ft(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return oS(e)&&On(n)?!1:e in t}const nk=new WeakMap,sk=new WeakMap,Mg=Symbol("_moveCb"),aS=Symbol("_enterCb"),ik={name:"TransitionGroup",props:Pn({},vD,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=q4(),s=T4();let i,r;return k4(()=>{if(!i.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!GD(i[0].el,n.vnode.el,o))return;i.forEach($D),i.forEach(BD);const a=i.filter(HD);ek(),a.forEach(l=>{const c=l.el,u=c.style;Zr(c,o),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[Mg]=h=>{h&&h.target!==c||(!h||/transform$/.test(h.propertyName))&&(c.removeEventListener("transitionend",d),c[Mg]=null,ta(c,o))};c.addEventListener("transitionend",d)})}),()=>{const o=Mt(t),a=J4(o);let l=o.tag||ot;if(i=[],r)for(let c=0;cdelete t.mode;ik.props;const UD=ik;function $D(t){const e=t.el;e[Mg]&&e[Mg](),e[aS]&&e[aS]()}function BD(t){sk.set(t,t.el.getBoundingClientRect())}function HD(t){const e=nk.get(t),n=sk.get(t),s=e.left-n.left,i=e.top-n.top;if(s||i){const r=t.el.style;return r.transform=r.webkitTransform=`translate(${s}px,${i}px)`,r.transitionDuration="0s",t}}function GD(t,e,n){const s=t.cloneNode(),i=t[Uu];i&&i.forEach(a=>{a.split(/\s+/).forEach(l=>l&&s.classList.remove(l))}),n.split(/\s+/).forEach(a=>a&&s.classList.add(a)),s.style.display="none";const r=e.nodeType===1?e:e.parentNode;r.appendChild(s);const{hasTransform:o}=Q4(s);return r.removeChild(s),o}const $u=t=>{const e=t.props["onUpdate:modelValue"]||!1;return et(e)?n=>$m(e,n):e};function zD(t){t.target.composing=!0}function lS(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const _o=Symbol("_assign"),st={created(t,{modifiers:{lazy:e,trim:n,number:s}},i){t[_o]=$u(i);const r=s||i.props&&i.props.type==="number";_a(t,e?"change":"input",o=>{if(o.target.composing)return;let a=t.value;n&&(a=a.trim()),r&&(a=vg(a)),t[_o](a)}),n&&_a(t,"change",()=>{t.value=t.value.trim()}),e||(_a(t,"compositionstart",zD),_a(t,"compositionend",lS),_a(t,"change",lS))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:n,trim:s,number:i}},r){if(t[_o]=$u(r),t.composing)return;const o=(i||t.type==="number")&&!/^0\d/.test(t.value)?vg(t.value):t.value,a=e??"";o!==a&&(document.activeElement===t&&t.type!=="range"&&(n||s&&t.value.trim()===a)||(t.value=a))}},rk={deep:!0,created(t,e,n){t[_o]=$u(n),_a(t,"change",()=>{const s=t._modelValue,i=sf(t),r=t.checked,o=t[_o];if(et(s)){const a=Gb(s,i),l=a!==-1;if(r&&!l)o(s.concat(i));else if(!r&&l){const c=[...s];c.splice(a,1),o(c)}}else if(ld(s)){const a=new Set(s);r?a.add(i):a.delete(i),o(a)}else o(ok(t,r))})},mounted:cS,beforeUpdate(t,e,n){t[_o]=$u(n),cS(t,e,n)}};function cS(t,{value:e,oldValue:n},s){t._modelValue=e,et(e)?t.checked=Gb(e,s.props.value)>-1:ld(e)?t.checked=e.has(s.props.value):e!==n&&(t.checked=Gf(e,ok(t,!0)))}const L_={deep:!0,created(t,{value:e,modifiers:{number:n}},s){const i=ld(e);_a(t,"change",()=>{const r=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?vg(sf(o)):sf(o));t[_o](t.multiple?i?new Set(r):r:r[0]),t._assigning=!0,zf(()=>{t._assigning=!1})}),t[_o]=$u(s)},mounted(t,{value:e,modifiers:{number:n}}){uS(t,e)},beforeUpdate(t,e,n){t[_o]=$u(n)},updated(t,{value:e,modifiers:{number:n}}){t._assigning||uS(t,e)}};function uS(t,e,n){const s=t.multiple,i=et(e);if(!(s&&!i&&!ld(e))){for(let r=0,o=t.options.length;rString(u)===String(l)):a.selected=Gb(e,l)>-1}else a.selected=e.has(l);else if(Gf(sf(a),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function sf(t){return"_value"in t?t._value:t.value}function ok(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const VD=["ctrl","shift","alt","meta"],WD={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>VD.some(n=>t[`${n}Key`]&&!e.includes(n))},jD=(t,e)=>{const n=t._withMods||(t._withMods={}),s=e.join(".");return n[s]||(n[s]=(i,...r)=>{for(let o=0;o{const e=YD().createApp(...t),{mount:n}=e;return e.mount=s=>{const i=ZD(s);if(!i)return;const r=e._component;!ft(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.innerHTML="";const o=n(i,!1,KD(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function KD(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function ZD(t){return On(t)?document.querySelector(t):t}const JD="modulepreload",QD=function(t){return"/"+t},hS={},eN=function(e,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),o=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));i=Promise.all(n.map(a=>{if(a=QD(a),a in hS)return;hS[a]=!0;const l=a.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":JD,l||(u.as="script",u.crossOrigin=""),u.href=a,o&&u.setAttribute("nonce",o),document.head.appendChild(u),l)return new Promise((d,h)=>{u.addEventListener("load",d),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})}))}return i.then(()=>e()).catch(r=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r})};function tN(){class t{constructor(){Te(this,"hasUpdate",!1);Te(this,"updateSW");Te(this,"updateCallback")}updatePreparing(){return!1}updatePending(){return!1}async checkForUpdate(n,s){if(this.updateCallback=s,!this.updateSW)try{const i=this,{registerSW:r}=await eN(()=>import("./virtual_pwa-register-C8olz8gX.js"),[]);this.updateSW=r({immediate:!0,onOfflineReady(){console.log("PWA offline ready")},onNeedRefresh(){i.hasUpdate=!0,i.updateCallback&&i.updateCallback(i.hasUpdate)},onRegistered(o){},onRegisterError(o){}})}catch{console.log("PWA disabled")}}async update(n){this.hasUpdate&&(this.hasUpdate=!1,this.updateSW&&this.updateSW(!0))}async finishUpdate(){}}return new t}function nN(){try{throw new Error("new.App undefined")}catch{return console.log("Registering PWA updater"),tN()}}const Dl=nN();/*! + * vue-router v4.3.2 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const Xc=typeof document<"u";function sN(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Gt=Object.assign;function e1(t,e){const n={};for(const s in e){const i=e[s];n[s]=tr(i)?i.map(t):t(i)}return n}const Ih=()=>{},tr=Array.isArray,ak=/#/g,iN=/&/g,rN=/\//g,oN=/=/g,aN=/\?/g,lk=/\+/g,lN=/%5B/g,cN=/%5D/g,ck=/%5E/g,uN=/%60/g,uk=/%7B/g,dN=/%7C/g,dk=/%7D/g,hN=/%20/g;function lw(t){return encodeURI(""+t).replace(dN,"|").replace(lN,"[").replace(cN,"]")}function fN(t){return lw(t).replace(uk,"{").replace(dk,"}").replace(ck,"^")}function iy(t){return lw(t).replace(lk,"%2B").replace(hN,"+").replace(ak,"%23").replace(iN,"%26").replace(uN,"`").replace(uk,"{").replace(dk,"}").replace(ck,"^")}function pN(t){return iy(t).replace(oN,"%3D")}function mN(t){return lw(t).replace(ak,"%23").replace(aN,"%3F")}function gN(t){return t==null?"":mN(t).replace(rN,"%2F")}function rf(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const _N=/\/$/,vN=t=>t.replace(_N,"");function t1(t,e,n="/"){let s,i={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(s=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),i=t(r)),a>-1&&(s=s||e.slice(0,a),o=e.slice(a,e.length)),s=xN(s??e,n),{fullPath:s+(r&&"?")+r+o,path:s,query:i,hash:rf(o)}}function yN(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function fS(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function bN(t,e,n){const s=e.matched.length-1,i=n.matched.length-1;return s>-1&&s===i&&Bu(e.matched[s],n.matched[i])&&hk(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Bu(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function hk(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!wN(t[n],e[n]))return!1;return!0}function wN(t,e){return tr(t)?pS(t,e):tr(e)?pS(e,t):t===e}function pS(t,e){return tr(e)?t.length===e.length&&t.every((n,s)=>n===e[s]):t.length===1&&t[0]===e}function xN(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),s=t.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let r=n.length-1,o,a;for(o=0;o1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(o).join("/")}var of;(function(t){t.pop="pop",t.push="push"})(of||(of={}));var Lh;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Lh||(Lh={}));function SN(t){if(!t)if(Xc){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),vN(t)}const EN=/^[^#]+#/;function TN(t,e){return t.replace(EN,"#")+e}function AN(t,e){const n=document.documentElement.getBoundingClientRect(),s=t.getBoundingClientRect();return{behavior:e.behavior,left:s.left-n.left-(e.left||0),top:s.top-n.top-(e.top||0)}}const D_=()=>({left:window.scrollX,top:window.scrollY});function MN(t){let e;if("el"in t){const n=t.el,s=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;e=AN(i,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function mS(t,e){return(history.state?history.state.position-e:-1)+t}const ry=new Map;function RN(t,e){ry.set(t,e)}function kN(t){const e=ry.get(t);return ry.delete(t),e}let CN=()=>location.protocol+"//"+location.host;function fk(t,e){const{pathname:n,search:s,hash:i}=e,r=t.indexOf("#");if(r>-1){let a=i.includes(t.slice(r))?t.slice(r).length:1,l=i.slice(a);return l[0]!=="/"&&(l="/"+l),fS(l,"")}return fS(n,t)+s+i}function PN(t,e,n,s){let i=[],r=[],o=null;const a=({state:h})=>{const f=fk(t,location),v=n.value,_=e.value;let m=0;if(h){if(n.value=f,e.value=h,o&&o===v){o=null;return}m=_?h.position-_.position:0}else s(f);i.forEach(g=>{g(n.value,v,{delta:m,type:of.pop,direction:m?m>0?Lh.forward:Lh.back:Lh.unknown})})};function l(){o=n.value}function c(h){i.push(h);const f=()=>{const v=i.indexOf(h);v>-1&&i.splice(v,1)};return r.push(f),f}function u(){const{history:h}=window;h.state&&h.replaceState(Gt({},h.state,{scroll:D_()}),"")}function d(){for(const h of r)h();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:d}}function gS(t,e,n,s=!1,i=!1){return{back:t,current:e,forward:n,replaced:s,position:window.history.length,scroll:i?D_():null}}function ON(t){const{history:e,location:n}=window,s={value:fk(t,n)},i={value:e.state};i.value||r(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const d=t.indexOf("#"),h=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+l:CN()+t+l;try{e[u?"replaceState":"pushState"](c,"",h),i.value=c}catch(f){console.error(f),n[u?"replace":"assign"](h)}}function o(l,c){const u=Gt({},e.state,gS(i.value.back,l,i.value.forward,!0),c,{position:i.value.position});r(l,u,!0),s.value=l}function a(l,c){const u=Gt({},i.value,e.state,{forward:l,scroll:D_()});r(u.current,u,!0);const d=Gt({},gS(s.value,l,null),{position:u.position+1},c);r(l,d,!1),s.value=l}return{location:s,state:i,push:a,replace:o}}function IN(t){t=SN(t);const e=ON(t),n=PN(t,e.state,e.location,e.replace);function s(r,o=!0){o||n.pauseListeners(),history.go(r)}const i=Gt({location:"",base:t,go:s,createHref:TN.bind(null,t)},e,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>e.state.value}),i}function LN(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),IN(t)}function DN(t){return typeof t=="string"||t&&typeof t=="object"}function pk(t){return typeof t=="string"||typeof t=="symbol"}const Go={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},mk=Symbol("");var _S;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(_S||(_S={}));function Hu(t,e){return Gt(new Error,{type:t,[mk]:!0},e)}function Hr(t,e){return t instanceof Error&&mk in t&&(e==null||!!(t.type&e))}const vS="[^/]+?",NN={sensitive:!1,strict:!1,start:!0,end:!0},FN=/[.+*?^${}()[\]/\\]/g;function UN(t,e){const n=Gt({},NN,e),s=[];let i=n.start?"^":"";const r=[];for(const c of t){const u=c.length?[]:[90];n.strict&&!c.length&&(i+="/");for(let d=0;de.length?e.length===1&&e[0]===80?1:-1:0}function BN(t,e){let n=0;const s=t.score,i=e.score;for(;n0&&e[e.length-1]<0}const HN={type:0,value:""},GN=/[a-zA-Z0-9_]/;function zN(t){if(!t)return[[]];if(t==="/")return[[HN]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(f){throw new Error(`ERR (${n})/"${c}": ${f}`)}let n=0,s=n;const i=[];let r;function o(){r&&i.push(r),r=[]}let a=0,l,c="",u="";function d(){c&&(n===0?r.push({type:0,value:c}):n===1||n===2||n===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function h(){c+=l}for(;a{o(y)}:Ih}function o(u){if(pk(u)){const d=s.get(u);d&&(s.delete(u),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(u);d>-1&&(n.splice(d,1),u.record.name&&s.delete(u.record.name),u.children.forEach(o),u.alias.forEach(o))}}function a(){return n}function l(u){let d=0;for(;d=0&&(u.record.path!==n[d].record.path||!gk(u,n[d]));)d++;n.splice(d,0,u),u.record.name&&!wS(u)&&s.set(u.record.name,u)}function c(u,d){let h,f={},v,_;if("name"in u&&u.name){if(h=s.get(u.name),!h)throw Hu(1,{location:u});_=h.record.name,f=Gt(bS(d.params,h.keys.filter(y=>!y.optional).concat(h.parent?h.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),u.params&&bS(u.params,h.keys.map(y=>y.name))),v=h.stringify(f)}else if(u.path!=null)v=u.path,h=n.find(y=>y.re.test(v)),h&&(f=h.parse(v),_=h.record.name);else{if(h=d.name?s.get(d.name):n.find(y=>y.re.test(d.path)),!h)throw Hu(1,{location:u,currentLocation:d});_=h.record.name,f=Gt({},d.params,u.params),v=h.stringify(f)}const m=[];let g=h;for(;g;)m.unshift(g.record),g=g.parent;return{name:_,path:v,params:f,matched:m,meta:YN(m)}}return t.forEach(u=>r(u)),{addRoute:r,resolve:c,removeRoute:o,getRoutes:a,getRecordMatcher:i}}function bS(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n}function jN(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:qN(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function qN(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const s in t.components)e[s]=typeof n=="object"?n[s]:n;return e}function wS(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function YN(t){return t.reduce((e,n)=>Gt(e,n.meta),{})}function xS(t,e){const n={};for(const s in t)n[s]=s in e?e[s]:t[s];return n}function gk(t,e){return e.children.some(n=>n===t||gk(t,n))}function XN(t){const e={};if(t===""||t==="?")return e;const s=(t[0]==="?"?t.slice(1):t).split("&");for(let i=0;ir&&iy(r)):[s&&iy(s)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function KN(t){const e={};for(const n in t){const s=t[n];s!==void 0&&(e[n]=tr(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return e}const ZN=Symbol(""),ES=Symbol(""),cw=Symbol(""),_k=Symbol(""),oy=Symbol("");function zd(){let t=[];function e(s){return t.push(s),()=>{const i=t.indexOf(s);i>-1&&t.splice(i,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function ha(t,e,n,s,i,r=o=>o()){const o=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(Hu(4,{from:n,to:e})):h instanceof Error?l(h):DN(h)?l(Hu(2,{from:e,to:h})):(o&&s.enterCallbacks[i]===o&&typeof h=="function"&&o.push(h),a())},u=r(()=>t.call(s&&s.instances[i],e,n,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(h=>l(h))})}function n1(t,e,n,s,i=r=>r()){const r=[];for(const o of t)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(JN(l)){const u=(l.__vccOpts||l)[e];u&&r.push(ha(u,n,s,o,a,i))}else{let c=l();r.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${o.path}"`));const d=sN(u)?u.default:u;o.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&ha(f,n,s,o,a,i)()}))}}return r}function JN(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function TS(t){const e=Tr(cw),n=Tr(_k),s=kn(()=>{const l=hu(t.to);return e.resolve(l)}),i=kn(()=>{const{matched:l}=s.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const h=d.findIndex(Bu.bind(null,u));if(h>-1)return h;const f=AS(l[c-2]);return c>1&&AS(u)===f&&d[d.length-1].path!==f?d.findIndex(Bu.bind(null,l[c-2])):h}),r=kn(()=>i.value>-1&&t7(n.params,s.value.params)),o=kn(()=>i.value>-1&&i.value===n.matched.length-1&&hk(n.params,s.value.params));function a(l={}){return e7(l)?e[hu(t.replace)?"replace":"push"](hu(t.to)).catch(Ih):Promise.resolve()}return{route:s,href:kn(()=>s.value.href),isActive:r,isExactActive:o,navigate:a}}const QN=it({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"}},useLink:TS,setup(t,{slots:e}){const n=ud(TS(t)),{options:s}=Tr(cw),i=kn(()=>({[MS(t.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[MS(t.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=e.default&&e.default(n);return t.custom?r:nc("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),vk=QN;function e7(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function t7(t,e){for(const n in e){const s=e[n],i=t[n];if(typeof s=="string"){if(s!==i)return!1}else if(!tr(i)||i.length!==s.length||s.some((r,o)=>r!==i[o]))return!1}return!0}function AS(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const MS=(t,e,n)=>t??e??n,n7=it({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const s=Tr(oy),i=kn(()=>t.route||s.value),r=Tr(ES,0),o=kn(()=>{let c=hu(r);const{matched:u}=i.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=kn(()=>i.value.matched[o.value]);Hm(ES,kn(()=>o.value+1)),Hm(ZN,a),Hm(oy,i);const l=S_();return Zl(()=>[l.value,a.value,t.name],([c,u,d],[h,f,v])=>{u&&(u.instances[d]=c,f&&f!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=f.leaveGuards),u.updateGuards.size||(u.updateGuards=f.updateGuards))),c&&u&&(!f||!Bu(u,f)||!h)&&(u.enterCallbacks[d]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=i.value,u=t.name,d=a.value,h=d&&d.components[u];if(!h)return RS(n.default,{Component:h,route:c});const f=d.props[u],v=f?f===!0?c.params:typeof f=="function"?f(c):f:null,m=nc(h,Gt({},v,e,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return RS(n.default,{Component:m,route:c})||m}}});function RS(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const yk=n7;function s7(t){const e=WN(t.routes,t),n=t.parseQuery||XN,s=t.stringifyQuery||SS,i=t.history,r=zd(),o=zd(),a=zd(),l=E_(Go);let c=Go;Xc&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=e1.bind(null,ne=>""+ne),d=e1.bind(null,gN),h=e1.bind(null,rf);function f(ne,Re){let Ae,j;return pk(ne)?(Ae=e.getRecordMatcher(ne),j=Re):j=ne,e.addRoute(j,Ae)}function v(ne){const Re=e.getRecordMatcher(ne);Re&&e.removeRoute(Re)}function _(){return e.getRoutes().map(ne=>ne.record)}function m(ne){return!!e.getRecordMatcher(ne)}function g(ne,Re){if(Re=Gt({},Re||l.value),typeof ne=="string"){const $=t1(n,ne,Re.path),ee=e.resolve({path:$.path},Re),de=i.createHref($.fullPath);return Gt($,ee,{params:h(ee.params),hash:rf($.hash),redirectedFrom:void 0,href:de})}let Ae;if(ne.path!=null)Ae=Gt({},ne,{path:t1(n,ne.path,Re.path).path});else{const $=Gt({},ne.params);for(const ee in $)$[ee]==null&&delete $[ee];Ae=Gt({},ne,{params:d($)}),Re.params=d(Re.params)}const j=e.resolve(Ae,Re),qe=ne.hash||"";j.params=u(h(j.params));const Fe=yN(s,Gt({},ne,{hash:fN(qe),path:j.path})),L=i.createHref(Fe);return Gt({fullPath:Fe,hash:qe,query:s===SS?KN(ne.query):ne.query||{}},j,{redirectedFrom:void 0,href:L})}function y(ne){return typeof ne=="string"?t1(n,ne,l.value.path):Gt({},ne)}function b(ne,Re){if(c!==ne)return Hu(8,{from:Re,to:ne})}function w(ne){return A(ne)}function T(ne){return w(Gt(y(ne),{replace:!0}))}function x(ne){const Re=ne.matched[ne.matched.length-1];if(Re&&Re.redirect){const{redirect:Ae}=Re;let j=typeof Ae=="function"?Ae(ne):Ae;return typeof j=="string"&&(j=j.includes("?")||j.includes("#")?j=y(j):{path:j},j.params={}),Gt({query:ne.query,hash:ne.hash,params:j.path!=null?{}:ne.params},j)}}function A(ne,Re){const Ae=c=g(ne),j=l.value,qe=ne.state,Fe=ne.force,L=ne.replace===!0,$=x(Ae);if($)return A(Gt(y($),{state:typeof $=="object"?Gt({},qe,$.state):qe,force:Fe,replace:L}),Re||Ae);const ee=Ae;ee.redirectedFrom=Re;let de;return!Fe&&bN(s,j,Ae)&&(de=Hu(16,{to:ee,from:j}),we(j,j,!0,!1)),(de?Promise.resolve(de):S(ee,j)).catch(he=>Hr(he)?Hr(he,2)?he:se(he):B(he,ee,j)).then(he=>{if(he){if(Hr(he,2))return A(Gt({replace:L},y(he.to),{state:typeof he.to=="object"?Gt({},qe,he.to.state):qe,force:Fe}),Re||ee)}else he=D(ee,j,!0,L,qe);return P(ee,j,he),he})}function M(ne,Re){const Ae=b(ne,Re);return Ae?Promise.reject(Ae):Promise.resolve()}function E(ne){const Re=oe.values().next().value;return Re&&typeof Re.runWithContext=="function"?Re.runWithContext(ne):ne()}function S(ne,Re){let Ae;const[j,qe,Fe]=i7(ne,Re);Ae=n1(j.reverse(),"beforeRouteLeave",ne,Re);for(const $ of j)$.leaveGuards.forEach(ee=>{Ae.push(ha(ee,ne,Re))});const L=M.bind(null,ne,Re);return Ae.push(L),Ce(Ae).then(()=>{Ae=[];for(const $ of r.list())Ae.push(ha($,ne,Re));return Ae.push(L),Ce(Ae)}).then(()=>{Ae=n1(qe,"beforeRouteUpdate",ne,Re);for(const $ of qe)$.updateGuards.forEach(ee=>{Ae.push(ha(ee,ne,Re))});return Ae.push(L),Ce(Ae)}).then(()=>{Ae=[];for(const $ of Fe)if($.beforeEnter)if(tr($.beforeEnter))for(const ee of $.beforeEnter)Ae.push(ha(ee,ne,Re));else Ae.push(ha($.beforeEnter,ne,Re));return Ae.push(L),Ce(Ae)}).then(()=>(ne.matched.forEach($=>$.enterCallbacks={}),Ae=n1(Fe,"beforeRouteEnter",ne,Re,E),Ae.push(L),Ce(Ae))).then(()=>{Ae=[];for(const $ of o.list())Ae.push(ha($,ne,Re));return Ae.push(L),Ce(Ae)}).catch($=>Hr($,8)?$:Promise.reject($))}function P(ne,Re,Ae){a.list().forEach(j=>E(()=>j(ne,Re,Ae)))}function D(ne,Re,Ae,j,qe){const Fe=b(ne,Re);if(Fe)return Fe;const L=Re===Go,$=Xc?history.state:{};Ae&&(j||L?i.replace(ne.fullPath,Gt({scroll:L&&$&&$.scroll},qe)):i.push(ne.fullPath,qe)),l.value=ne,we(ne,Re,Ae,L),se()}let k;function U(){k||(k=i.listen((ne,Re,Ae)=>{if(!Ee.listening)return;const j=g(ne),qe=x(j);if(qe){A(Gt(qe,{replace:!0}),j).catch(Ih);return}c=j;const Fe=l.value;Xc&&RN(mS(Fe.fullPath,Ae.delta),D_()),S(j,Fe).catch(L=>Hr(L,12)?L:Hr(L,2)?(A(L.to,j).then($=>{Hr($,20)&&!Ae.delta&&Ae.type===of.pop&&i.go(-1,!1)}).catch(Ih),Promise.reject()):(Ae.delta&&i.go(-Ae.delta,!1),B(L,j,Fe))).then(L=>{L=L||D(j,Fe,!1),L&&(Ae.delta&&!Hr(L,8)?i.go(-Ae.delta,!1):Ae.type===of.pop&&Hr(L,20)&&i.go(-1,!1)),P(j,Fe,L)}).catch(Ih)}))}let z=zd(),G=zd(),J;function B(ne,Re,Ae){se(ne);const j=G.list();return j.length?j.forEach(qe=>qe(ne,Re,Ae)):console.error(ne),Promise.reject(ne)}function fe(){return J&&l.value!==Go?Promise.resolve():new Promise((ne,Re)=>{z.add([ne,Re])})}function se(ne){return J||(J=!ne,U(),z.list().forEach(([Re,Ae])=>ne?Ae(ne):Re()),z.reset()),ne}function we(ne,Re,Ae,j){const{scrollBehavior:qe}=t;if(!Xc||!qe)return Promise.resolve();const Fe=!Ae&&kN(mS(ne.fullPath,0))||(j||!Ae)&&history.state&&history.state.scroll||null;return zf().then(()=>qe(ne,Re,Fe)).then(L=>L&&MN(L)).catch(L=>B(L,ne,Re))}const xe=ne=>i.go(ne);let Ne;const oe=new Set,Ee={currentRoute:l,listening:!0,addRoute:f,removeRoute:v,hasRoute:m,getRoutes:_,resolve:g,options:t,push:w,replace:T,go:xe,back:()=>xe(-1),forward:()=>xe(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:G.add,isReady:fe,install(ne){const Re=this;ne.component("RouterLink",vk),ne.component("RouterView",yk),ne.config.globalProperties.$router=Re,Object.defineProperty(ne.config.globalProperties,"$route",{enumerable:!0,get:()=>hu(l)}),Xc&&!Ne&&l.value===Go&&(Ne=!0,w(i.location).catch(qe=>{}));const Ae={};for(const qe in Go)Object.defineProperty(Ae,qe,{get:()=>l.value[qe],enumerable:!0});ne.provide(cw,Re),ne.provide(_k,d4(Ae)),ne.provide(oy,l);const j=ne.unmount;oe.add(ne),ne.unmount=function(){oe.delete(ne),oe.size<1&&(c=Go,k&&k(),k=null,l.value=Go,Ne=!1,J=!1),j()}}};function Ce(ne){return ne.reduce((Re,Ae)=>Re.then(()=>E(Ae)),Promise.resolve())}return Ee}function i7(t,e){const n=[],s=[],i=[],r=Math.max(e.matched.length,t.matched.length);for(let o=0;oBu(c,a))?s.push(a):n.push(a));const l=t.matched[o];l&&(e.matched.find(c=>Bu(c,l))||i.push(l))}return[n,s,i]}var r7=!1;/*! + * pinia v2.1.7 + * (c) 2023 Eduardo San Martin Morote + * @license MIT + */let bk;const N_=t=>bk=t,wk=Symbol();function ay(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Dh;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Dh||(Dh={}));function o7(){const t=JR(!0),e=t.run(()=>S_({}));let n=[],s=[];const i=Xb({install(r){N_(i),i._a=r,r.provide(wk,i),r.config.globalProperties.$pinia=i,s.forEach(o=>n.push(o)),s=[]},use(r){return!this._a&&!r7?s.push(r):n.push(r),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return i}const xk=()=>{};function kS(t,e,n,s=xk){t.push(e);const i=()=>{const r=t.indexOf(e);r>-1&&(t.splice(r,1),s())};return!n&&QR()&&N6(i),i}function _c(t,...e){t.slice().forEach(n=>{n(...e)})}const a7=t=>t();function ly(t,e){t instanceof Map&&e instanceof Map&&e.forEach((n,s)=>t.set(s,n)),t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const s=e[n],i=t[n];ay(i)&&ay(s)&&t.hasOwnProperty(n)&&!Hn(s)&&!Kl(s)?t[n]=ly(i,s):t[n]=s}return t}const l7=Symbol();function c7(t){return!ay(t)||!t.hasOwnProperty(l7)}const{assign:na}=Object;function u7(t){return!!(Hn(t)&&t.effect)}function d7(t,e,n,s){const{state:i,actions:r,getters:o}=e,a=n.state.value[t];let l;function c(){a||(n.state.value[t]=i?i():{});const u=oL(n.state.value[t]);return na(u,r,Object.keys(o||{}).reduce((d,h)=>(d[h]=Xb(kn(()=>{N_(n);const f=n._s.get(t);return o[h].call(f,f)})),d),{}))}return l=Sk(t,c,e,n,s,!0),l}function Sk(t,e,n={},s,i,r){let o;const a=na({actions:{}},n),l={deep:!0};let c,u,d=[],h=[],f;const v=s.state.value[t];!r&&!v&&(s.state.value[t]={}),S_({});let _;function m(M){let E;c=u=!1,typeof M=="function"?(M(s.state.value[t]),E={type:Dh.patchFunction,storeId:t,events:f}):(ly(s.state.value[t],M),E={type:Dh.patchObject,payload:M,storeId:t,events:f});const S=_=Symbol();zf().then(()=>{_===S&&(c=!0)}),u=!0,_c(d,E,s.state.value[t])}const g=r?function(){const{state:E}=n,S=E?E():{};this.$patch(P=>{na(P,S)})}:xk;function y(){o.stop(),d=[],h=[],s._s.delete(t)}function b(M,E){return function(){N_(s);const S=Array.from(arguments),P=[],D=[];function k(G){P.push(G)}function U(G){D.push(G)}_c(h,{args:S,name:M,store:T,after:k,onError:U});let z;try{z=E.apply(this&&this.$id===t?this:T,S)}catch(G){throw _c(D,G),G}return z instanceof Promise?z.then(G=>(_c(P,G),G)).catch(G=>(_c(D,G),Promise.reject(G))):(_c(P,z),z)}}const w={_p:s,$id:t,$onAction:kS.bind(null,h),$patch:m,$reset:g,$subscribe(M,E={}){const S=kS(d,M,E.detached,()=>P()),P=o.run(()=>Zl(()=>s.state.value[t],D=>{(E.flush==="sync"?u:c)&&M({storeId:t,type:Dh.direct,events:f},D)},na({},l,E)));return S},$dispose:y},T=ud(w);s._s.set(t,T);const A=(s._a&&s._a.runWithContext||a7)(()=>s._e.run(()=>(o=JR()).run(e)));for(const M in A){const E=A[M];if(Hn(E)&&!u7(E)||Kl(E))r||(v&&c7(E)&&(Hn(E)?E.value=v[M]:ly(E,v[M])),s.state.value[t][M]=E);else if(typeof E=="function"){const S=b(M,E);A[M]=S,a.actions[M]=E}}return na(T,A),na(Mt(T),A),Object.defineProperty(T,"$state",{get:()=>s.state.value[t],set:M=>{m(E=>{na(E,M)})}}),s._p.forEach(M=>{na(T,o.run(()=>M({store:T,app:s._a,pinia:s,options:a})))}),v&&r&&n.hydrate&&n.hydrate(T.$state,v),c=!0,u=!0,T}function ys(t,e,n){let s,i;const r=typeof e=="function";typeof t=="string"?(s=t,i=r?n:e):(i=t,s=t.id);function o(a,l){const c=jL();return a=a||(c?Tr(wk,null):null),a&&N_(a),a=bk,a._s.has(s)||(r?Sk(s,e,i,a):d7(s,i,a)),a._s.get(s)}return o.$id=s,o}function uw(t,e){return Array.isArray(e)?e.reduce((n,s)=>(n[s]=function(){return t(this.$pinia)[s]},n),{}):Object.keys(e).reduce((n,s)=>(n[s]=function(){const i=t(this.$pinia),r=e[s];return typeof r=="function"?r.call(this,i):i[r]},n),{})}const Ek=35;var Jn=(t=>(t[t.Invalid=0]="Invalid",t[t.Get=1]="Get",t[t.Set=2]="Set",t[t.Log=3]="Log",t[t.CalImu=4]="CalImu",t[t.Blackbox=5]="Blackbox",t[t.Motor=6]="Motor",t[t.CalSticks=7]="CalSticks",t[t.Serial=8]="Serial",t[t.OSD=9]="OSD",t[t.Max=10]="Max",t))(Jn||{}),xn=(t=>(t[t.Invalid=0]="Invalid",t[t.Info=1]="Info",t[t.Profile=2]="Profile",t[t.DefaultProfile=3]="DefaultProfile",t[t.State=4]="State",t[t.PidRatePresets=5]="PidRatePresets",t[t.VtxSettings=6]="VtxSettings",t[t.OSDFont=7]="OSDFont",t[t.BLHeliSettings=8]="BLHeliSettings",t[t.BindInfo=9]="BindInfo",t[t.PerfCounters=10]="PerfCounters",t[t.BlackboxPresets=11]="BlackboxPresets",t[t.Target=12]="Target",t))(xn||{}),gh=(t=>(t[t.Reset=0]="Reset",t[t.List=1]="List",t[t.Get=2]="Get",t))(gh||{}),_h=(t=>(t[t.TestStatus=0]="TestStatus",t[t.TestEnable=1]="TestEnable",t[t.TestDisable=2]="TestDisable",t[t.TestSetValue=3]="TestSetValue",t[t.Esc4WayIf=4]="Esc4WayIf",t))(_h||{}),cy=(t=>(t[t.ReadChar=0]="ReadChar",t[t.WriteChar=1]="WriteChar",t))(cy||{}),Wm=(t=>(t[t.None=0]="None",t[t.Error=1]="Error",t[t.Streaming=2]="Streaming",t[t.Exit=3]="Exit",t))(Wm||{}),s1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ir(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(n,s,i.get?i:{enumerable:!0,get:function(){return t[s]}})}),n}var uy={exports:{}};const h7="2.0.0",Tk=256,f7=Number.MAX_SAFE_INTEGER||9007199254740991,p7=16,m7=Tk-6,g7=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var F_={MAX_LENGTH:Tk,MAX_SAFE_COMPONENT_LENGTH:p7,MAX_SAFE_BUILD_LENGTH:m7,MAX_SAFE_INTEGER:f7,RELEASE_TYPES:g7,SEMVER_SPEC_VERSION:h7,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},i1={};const _7=typeof process=="object"&&i1&&i1.NODE_DEBUG&&/\bsemver\b/i.test(i1.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var U_=_7;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:i}=F_,r=U_;e=t.exports={};const o=e.re=[],a=e.safeRe=[],l=e.src=[],c=e.t={};let u=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[d,s]],f=_=>{for(const[m,g]of h)_=_.split(`${m}*`).join(`${m}{0,${g}}`).split(`${m}+`).join(`${m}{1,${g}}`);return _},v=(_,m,g)=>{const y=f(m),b=u++;r(_,b,m),c[_]=b,l[b]=m,o[b]=new RegExp(m,g?"g":void 0),a[b]=new RegExp(y,g?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),v("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${d}+`),v("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),v("FULL",`^${l[c.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),v("LOOSE",`^${l[c.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),v("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),v("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",l[c.COERCE],!0),v("COERCERTLFULL",l[c.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",v("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",v("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(uy,uy.exports);var Wf=uy.exports;const v7=Object.freeze({loose:!0}),y7=Object.freeze({}),b7=t=>t?typeof t!="object"?v7:t:y7;var dw=b7;const CS=/^[0-9]+$/,Ak=(t,e)=>{const n=CS.test(t),s=CS.test(e);return n&&s&&(t=+t,e=+e),t===e?0:n&&!s?-1:s&&!n?1:tAk(e,t);var Mk={compareIdentifiers:Ak,rcompareIdentifiers:w7};const bp=U_,{MAX_LENGTH:PS,MAX_SAFE_INTEGER:wp}=F_,{safeRe:OS,t:IS}=Wf,x7=dw,{compareIdentifiers:vc}=Mk;let S7=class dr{constructor(e,n){if(n=x7(n),e instanceof dr){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>PS)throw new TypeError(`version is longer than ${PS} characters`);bp("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const s=e.trim().match(n.loose?OS[IS.LOOSE]:OS[IS.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>wp||this.major<0)throw new TypeError("Invalid major version");if(this.minor>wp||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>wp||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const r=+i;if(r>=0&&r=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);if(r===-1){if(n===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let r=[n,i];s===!1&&(r=[n]),vc(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Os=S7;const LS=Os,E7=(t,e,n=!1)=>{if(t instanceof LS)return t;try{return new LS(t,e)}catch(s){if(!n)return null;throw s}};var pd=E7;const T7=pd,A7=(t,e)=>{const n=T7(t,e);return n?n.version:null};var M7=A7;const R7=pd,k7=(t,e)=>{const n=R7(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var C7=k7;const DS=Os,P7=(t,e,n,s,i)=>{typeof n=="string"&&(i=s,s=n,n=void 0);try{return new DS(t instanceof DS?t.version:t,n).inc(e,s,i).version}catch{return null}};var O7=P7;const NS=pd,I7=(t,e)=>{const n=NS(t,null,!0),s=NS(e,null,!0),i=n.compare(s);if(i===0)return null;const r=i>0,o=r?n:s,a=r?s:n,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const u=l?"pre":"";return n.major!==s.major?u+"major":n.minor!==s.minor?u+"minor":n.patch!==s.patch?u+"patch":"prerelease"};var L7=I7;const D7=Os,N7=(t,e)=>new D7(t,e).major;var F7=N7;const U7=Os,$7=(t,e)=>new U7(t,e).minor;var B7=$7;const H7=Os,G7=(t,e)=>new H7(t,e).patch;var z7=G7;const V7=pd,W7=(t,e)=>{const n=V7(t,e);return n&&n.prerelease.length?n.prerelease:null};var j7=W7;const FS=Os,q7=(t,e,n)=>new FS(t,n).compare(new FS(e,n));var ir=q7;const Y7=ir,X7=(t,e,n)=>Y7(e,t,n);var K7=X7;const Z7=ir,J7=(t,e)=>Z7(t,e,!0);var Q7=J7;const US=Os,e9=(t,e,n)=>{const s=new US(t,n),i=new US(e,n);return s.compare(i)||s.compareBuild(i)};var hw=e9;const t9=hw,n9=(t,e)=>t.sort((n,s)=>t9(n,s,e));var s9=n9;const i9=hw,r9=(t,e)=>t.sort((n,s)=>i9(s,n,e));var o9=r9;const a9=ir,l9=(t,e,n)=>a9(t,e,n)>0;var $_=l9;const c9=ir,u9=(t,e,n)=>c9(t,e,n)<0;var fw=u9;const d9=ir,h9=(t,e,n)=>d9(t,e,n)===0;var Rk=h9;const f9=ir,p9=(t,e,n)=>f9(t,e,n)!==0;var kk=p9;const m9=ir,g9=(t,e,n)=>m9(t,e,n)>=0;var pw=g9;const _9=ir,v9=(t,e,n)=>_9(t,e,n)<=0;var mw=v9;const y9=Rk,b9=kk,w9=$_,x9=pw,S9=fw,E9=mw,T9=(t,e,n,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return y9(t,n,s);case"!=":return b9(t,n,s);case">":return w9(t,n,s);case">=":return x9(t,n,s);case"<":return S9(t,n,s);case"<=":return E9(t,n,s);default:throw new TypeError(`Invalid operator: ${e}`)}};var Ck=T9;const A9=Os,M9=pd,{safeRe:xp,t:Sp}=Wf,R9=(t,e)=>{if(t instanceof A9)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?xp[Sp.COERCEFULL]:xp[Sp.COERCE]);else{const l=e.includePrerelease?xp[Sp.COERCERTLFULL]:xp[Sp.COERCERTL];let c;for(;(c=l.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||c.index+c[0].length!==n.index+n[0].length)&&(n=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(n===null)return null;const s=n[2],i=n[3]||"0",r=n[4]||"0",o=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return M9(`${s}.${i}.${r}${o}${a}`,e)};var k9=R9,r1,$S;function C9(){return $S||($S=1,r1=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),r1}var P9=Nt;Nt.Node=sc;Nt.create=Nt;function Nt(t){var e=this;if(e instanceof Nt||(e=new Nt),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var n=0,s=arguments.length;n1)n=e;else if(this.head)s=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;s!==null;i++)n=t(n,s.value,i),s=s.next;return n};Nt.prototype.reduceReverse=function(t,e){var n,s=this.tail;if(arguments.length>1)n=e;else if(this.tail)s=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;s!==null;i--)n=t(n,s.value,i),s=s.prev;return n};Nt.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};Nt.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};Nt.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new Nt;if(ethis.length&&(e=this.length);for(var s=0,i=this.head;i!==null&&sthis.length&&(e=this.length);for(var s=this.length,i=this.tail;i!==null&&s>e;s--)i=i.prev;for(;i!==null&&s>t;s--,i=i.prev)n.push(i.value);return n};Nt.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var s=0,i=this.head;i!==null&&s1;let N9=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Ml]=e.max||1/0;const n=e.length||o1;if(this[yc]=typeof n!="function"?o1:n,this[Nh]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Nl]=e.maxAge||0,this[to]=e.dispose,this[BS]=e.noDisposeOnSet||!1,this[Pk]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Ml]=e||1/0,Vd(this)}get max(){return this[Ml]}set allowStale(e){this[Nh]=!!e}get allowStale(){return this[Nh]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Nl]=e,Vd(this)}get maxAge(){return this[Nl]}set lengthCalculator(e){typeof e!="function"&&(e=o1),e!==this[yc]&&(this[yc]=e,this[io]=0,this[jn].forEach(n=>{n.length=this[yc](n.value,n.key),this[io]+=n.length})),Vd(this)}get lengthCalculator(){return this[yc]}get length(){return this[io]}get itemCount(){return this[jn].length}rforEach(e,n){n=n||this;for(let s=this[jn].tail;s!==null;){const i=s.prev;HS(this,e,s,n),s=i}}forEach(e,n){n=n||this;for(let s=this[jn].head;s!==null;){const i=s.next;HS(this,e,s,n),s=i}}keys(){return this[jn].toArray().map(e=>e.key)}values(){return this[jn].toArray().map(e=>e.value)}reset(){this[to]&&this[jn]&&this[jn].length&&this[jn].forEach(e=>this[to](e.key,e.value)),this[Ni]=new Map,this[jn]=new D9,this[io]=0}dump(){return this[jn].map(e=>Rg(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[jn]}set(e,n,s){if(s=s||this[Nl],s&&typeof s!="number")throw new TypeError("maxAge must be a number");const i=s?Date.now():0,r=this[yc](n,e);if(this[Ni].has(e)){if(r>this[Ml])return mu(this,this[Ni].get(e)),!1;const l=this[Ni].get(e).value;return this[to]&&(this[BS]||this[to](e,l.value)),l.now=i,l.maxAge=s,l.value=n,this[io]+=r-l.length,l.length=r,this.get(e),Vd(this),!0}const o=new F9(e,n,r,i,s);return o.length>this[Ml]?(this[to]&&this[to](e,n),!1):(this[io]+=o.length,this[jn].unshift(o),this[Ni].set(e,this[jn].head),Vd(this),!0)}has(e){if(!this[Ni].has(e))return!1;const n=this[Ni].get(e).value;return!Rg(this,n)}get(e){return a1(this,e,!0)}peek(e){return a1(this,e,!1)}pop(){const e=this[jn].tail;return e?(mu(this,e),e.value):null}del(e){mu(this,this[Ni].get(e))}load(e){this.reset();const n=Date.now();for(let s=e.length-1;s>=0;s--){const i=e[s],r=i.e||0;if(r===0)this.set(i.k,i.v);else{const o=r-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ni].forEach((e,n)=>a1(this,n,!1))}};const a1=(t,e,n)=>{const s=t[Ni].get(e);if(s){const i=s.value;if(Rg(t,i)){if(mu(t,s),!t[Nh])return}else n&&(t[Pk]&&(s.value.now=Date.now()),t[jn].unshiftNode(s));return i.value}},Rg=(t,e)=>{if(!e||!e.maxAge&&!t[Nl])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Nl]&&n>t[Nl]},Vd=t=>{if(t[io]>t[Ml])for(let e=t[jn].tail;t[io]>t[Ml]&&e!==null;){const n=e.prev;mu(t,e),e=n}},mu=(t,e)=>{if(e){const n=e.value;t[to]&&t[to](n.key,n.value),t[io]-=n.length,t[Ni].delete(n.key),t[jn].removeNode(e)}};let F9=class{constructor(e,n,s,i,r){this.key=e,this.value=n,this.length=s,this.now=i,this.maxAge=r||0}};const HS=(t,e,n,s)=>{let i=n.value;Rg(t,i)&&(mu(t,n),t[Nh]||(i=void 0)),i&&e.call(s,i.value,i.key,t)};var U9=N9,l1,GS;function rr(){if(GS)return l1;GS=1;class t{constructor(U,z){if(z=s(z),U instanceof t)return U.loose===!!z.loose&&U.includePrerelease===!!z.includePrerelease?U:new t(U.raw,z);if(U instanceof i)return this.raw=U.value,this.set=[[U]],this.format(),this;if(this.options=z,this.loose=!!z.loose,this.includePrerelease=!!z.includePrerelease,this.raw=U.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(G=>this.parseRange(G.trim())).filter(G=>G.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const G=this.set[0];if(this.set=this.set.filter(J=>!v(J[0])),this.set.length===0)this.set=[G];else if(this.set.length>1){for(const J of this.set)if(J.length===1&&_(J[0])){this.set=[J];break}}}this.format()}format(){return this.range=this.set.map(U=>U.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(U){const G=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+U,J=n.get(G);if(J)return J;const B=this.options.loose,fe=B?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];U=U.replace(fe,P(this.options.includePrerelease)),r("hyphen replace",U),U=U.replace(a[l.COMPARATORTRIM],c),r("comparator trim",U),U=U.replace(a[l.TILDETRIM],u),r("tilde trim",U),U=U.replace(a[l.CARETTRIM],d),r("caret trim",U);let se=U.split(" ").map(oe=>g(oe,this.options)).join(" ").split(/\s+/).map(oe=>S(oe,this.options));B&&(se=se.filter(oe=>(r("loose invalid filter",oe,this.options),!!oe.match(a[l.COMPARATORLOOSE])))),r("range list",se);const we=new Map,xe=se.map(oe=>new i(oe,this.options));for(const oe of xe){if(v(oe))return[oe];we.set(oe.value,oe)}we.size>1&&we.has("")&&we.delete("");const Ne=[...we.values()];return n.set(G,Ne),Ne}intersects(U,z){if(!(U instanceof t))throw new TypeError("a Range is required");return this.set.some(G=>m(G,z)&&U.set.some(J=>m(J,z)&&G.every(B=>J.every(fe=>B.intersects(fe,z)))))}test(U){if(!U)return!1;if(typeof U=="string")try{U=new o(U,this.options)}catch{return!1}for(let z=0;zk.value==="<0.0.0-0",_=k=>k.value==="",m=(k,U)=>{let z=!0;const G=k.slice();let J=G.pop();for(;z&&G.length;)z=G.every(B=>J.intersects(B,U)),J=G.pop();return z},g=(k,U)=>(r("comp",k,U),k=T(k,U),r("caret",k),k=b(k,U),r("tildes",k),k=A(k,U),r("xrange",k),k=E(k,U),r("stars",k),k),y=k=>!k||k.toLowerCase()==="x"||k==="*",b=(k,U)=>k.trim().split(/\s+/).map(z=>w(z,U)).join(" "),w=(k,U)=>{const z=U.loose?a[l.TILDELOOSE]:a[l.TILDE];return k.replace(z,(G,J,B,fe,se)=>{r("tilde",k,G,J,B,fe,se);let we;return y(J)?we="":y(B)?we=`>=${J}.0.0 <${+J+1}.0.0-0`:y(fe)?we=`>=${J}.${B}.0 <${J}.${+B+1}.0-0`:se?(r("replaceTilde pr",se),we=`>=${J}.${B}.${fe}-${se} <${J}.${+B+1}.0-0`):we=`>=${J}.${B}.${fe} <${J}.${+B+1}.0-0`,r("tilde return",we),we})},T=(k,U)=>k.trim().split(/\s+/).map(z=>x(z,U)).join(" "),x=(k,U)=>{r("caret",k,U);const z=U.loose?a[l.CARETLOOSE]:a[l.CARET],G=U.includePrerelease?"-0":"";return k.replace(z,(J,B,fe,se,we)=>{r("caret",k,J,B,fe,se,we);let xe;return y(B)?xe="":y(fe)?xe=`>=${B}.0.0${G} <${+B+1}.0.0-0`:y(se)?B==="0"?xe=`>=${B}.${fe}.0${G} <${B}.${+fe+1}.0-0`:xe=`>=${B}.${fe}.0${G} <${+B+1}.0.0-0`:we?(r("replaceCaret pr",we),B==="0"?fe==="0"?xe=`>=${B}.${fe}.${se}-${we} <${B}.${fe}.${+se+1}-0`:xe=`>=${B}.${fe}.${se}-${we} <${B}.${+fe+1}.0-0`:xe=`>=${B}.${fe}.${se}-${we} <${+B+1}.0.0-0`):(r("no pr"),B==="0"?fe==="0"?xe=`>=${B}.${fe}.${se}${G} <${B}.${fe}.${+se+1}-0`:xe=`>=${B}.${fe}.${se}${G} <${B}.${+fe+1}.0-0`:xe=`>=${B}.${fe}.${se} <${+B+1}.0.0-0`),r("caret return",xe),xe})},A=(k,U)=>(r("replaceXRanges",k,U),k.split(/\s+/).map(z=>M(z,U)).join(" ")),M=(k,U)=>{k=k.trim();const z=U.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return k.replace(z,(G,J,B,fe,se,we)=>{r("xRange",k,G,J,B,fe,se,we);const xe=y(B),Ne=xe||y(fe),oe=Ne||y(se),Ee=oe;return J==="="&&Ee&&(J=""),we=U.includePrerelease?"-0":"",xe?J===">"||J==="<"?G="<0.0.0-0":G="*":J&&Ee?(Ne&&(fe=0),se=0,J===">"?(J=">=",Ne?(B=+B+1,fe=0,se=0):(fe=+fe+1,se=0)):J==="<="&&(J="<",Ne?B=+B+1:fe=+fe+1),J==="<"&&(we="-0"),G=`${J+B}.${fe}.${se}${we}`):Ne?G=`>=${B}.0.0${we} <${+B+1}.0.0-0`:oe&&(G=`>=${B}.${fe}.0${we} <${B}.${+fe+1}.0-0`),r("xRange return",G),G})},E=(k,U)=>(r("replaceStars",k,U),k.trim().replace(a[l.STAR],"")),S=(k,U)=>(r("replaceGTE0",k,U),k.trim().replace(a[U.includePrerelease?l.GTE0PRE:l.GTE0],"")),P=k=>(U,z,G,J,B,fe,se,we,xe,Ne,oe,Ee,Ce)=>(y(G)?z="":y(J)?z=`>=${G}.0.0${k?"-0":""}`:y(B)?z=`>=${G}.${J}.0${k?"-0":""}`:fe?z=`>=${z}`:z=`>=${z}${k?"-0":""}`,y(xe)?we="":y(Ne)?we=`<${+xe+1}.0.0-0`:y(oe)?we=`<${xe}.${+Ne+1}.0-0`:Ee?we=`<=${xe}.${Ne}.${oe}-${Ee}`:k?we=`<${xe}.${Ne}.${+oe+1}-0`:we=`<=${we}`,`${z} ${we}`.trim()),D=(k,U,z)=>{for(let G=0;G0){const J=k[G].semver;if(J.major===U.major&&J.minor===U.minor&&J.patch===U.patch)return!0}return!1}return!0};return l1}var c1,zS;function B_(){if(zS)return c1;zS=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(u,d){if(d=n(d),u instanceof e){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?s[i.COMPARATORLOOSE]:s[i.COMPARATOR],h=u.match(d);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return r(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,d).test(u.semver):(d=n(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||r(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||r(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}c1=e;const n=dw,{safeRe:s,t:i}=Wf,r=Ck,o=U_,a=Os,l=rr();return c1}const $9=rr(),B9=(t,e,n)=>{try{e=new $9(e,n)}catch{return!1}return e.test(t)};var H_=B9;const H9=rr(),G9=(t,e)=>new H9(t,e).set.map(n=>n.map(s=>s.value).join(" ").trim().split(" "));var z9=G9;const V9=Os,W9=rr(),j9=(t,e,n)=>{let s=null,i=null,r=null;try{r=new W9(e,n)}catch{return null}return t.forEach(o=>{r.test(o)&&(!s||i.compare(o)===-1)&&(s=o,i=new V9(s,n))}),s};var q9=j9;const Y9=Os,X9=rr(),K9=(t,e,n)=>{let s=null,i=null,r=null;try{r=new X9(e,n)}catch{return null}return t.forEach(o=>{r.test(o)&&(!s||i.compare(o)===1)&&(s=o,i=new Y9(s,n))}),s};var Z9=K9;const u1=Os,J9=rr(),VS=$_,Q9=(t,e)=>{t=new J9(t,e);let n=new u1("0.0.0");if(t.test(n)||(n=new u1("0.0.0-0"),t.test(n)))return n;n=null;for(let s=0;s{const a=new u1(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!r||VS(a,r))&&(r=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),r&&(!n||VS(n,r))&&(n=r)}return n&&t.test(n)?n:null};var eF=Q9;const tF=rr(),nF=(t,e)=>{try{return new tF(t,e).range||"*"}catch{return null}};var sF=nF;const iF=Os,Ok=B_(),{ANY:rF}=Ok,oF=rr(),aF=H_,WS=$_,jS=fw,lF=mw,cF=pw,uF=(t,e,n,s)=>{t=new iF(t,s),e=new oF(e,s);let i,r,o,a,l;switch(n){case">":i=WS,r=lF,o=jS,a=">",l=">=";break;case"<":i=jS,r=cF,o=WS,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(aF(t,e,s))return!1;for(let c=0;c{f.semver===rF&&(f=new Ok(">=0.0.0")),d=d||f,h=h||f,i(f.semver,d.semver,s)?d=f:o(f.semver,h.semver,s)&&(h=f)}),d.operator===a||d.operator===l||(!h.operator||h.operator===a)&&r(t,h.semver))return!1;if(h.operator===l&&o(t,h.semver))return!1}return!0};var gw=uF;const dF=gw,hF=(t,e,n)=>dF(t,e,">",n);var fF=hF;const pF=gw,mF=(t,e,n)=>pF(t,e,"<",n);var gF=mF;const qS=rr(),_F=(t,e,n)=>(t=new qS(t,n),e=new qS(e,n),t.intersects(e,n));var vF=_F;const yF=H_,bF=ir;var wF=(t,e,n)=>{const s=[];let i=null,r=null;const o=t.sort((u,d)=>bF(u,d,n));for(const u of o)yF(u,e,n)?(r=u,i||(i=u)):(r&&s.push([i,r]),r=null,i=null);i&&s.push([i,null]);const a=[];for(const[u,d]of s)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);const l=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length{if(t===e)return!0;t=new YS(t,n),e=new YS(e,n);let s=!1;e:for(const i of t.set){for(const r of e.set){const o=EF(i,r,n);if(s=s||o!==null,o)continue e}if(s)return!1}return!0},SF=[new _w(">=0.0.0-0")],XS=[new _w(">=0.0.0")],EF=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===d1){if(e.length===1&&e[0].semver===d1)return!0;n.includePrerelease?t=SF:t=XS}if(e.length===1&&e[0].semver===d1){if(n.includePrerelease)return!0;e=XS}const s=new Set;let i,r;for(const f of t)f.operator===">"||f.operator===">="?i=KS(i,f,n):f.operator==="<"||f.operator==="<="?r=ZS(r,f,n):s.add(f.semver);if(s.size>1)return null;let o;if(i&&r){if(o=vw(i.semver,r.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||r.operator!=="<="))return null}for(const f of s){if(i&&!Wd(f,String(i),n)||r&&!Wd(f,String(r),n))return null;for(const v of e)if(!Wd(f,String(v),n))return!1;return!0}let a,l,c,u,d=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1,h=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&r.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const f of e){if(u=u||f.operator===">"||f.operator===">=",c=c||f.operator==="<"||f.operator==="<=",i){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator===">"||f.operator===">="){if(a=KS(i,f,n),a===f&&a!==i)return!1}else if(i.operator===">="&&!Wd(i.semver,String(f),n))return!1}if(r){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(l=ZS(r,f,n),l===f&&l!==r)return!1}else if(r.operator==="<="&&!Wd(r.semver,String(f),n))return!1}if(!f.operator&&(r||i)&&o!==0)return!1}return!(i&&c&&!r&&o!==0||r&&u&&!i&&o!==0||h||d)},KS=(t,e,n)=>{if(!t)return e;const s=vw(t.semver,e.semver,n);return s>0?t:s<0||e.operator===">"&&t.operator===">="?e:t},ZS=(t,e,n)=>{if(!t)return e;const s=vw(t.semver,e.semver,n);return s<0?t:s>0||e.operator==="<"&&t.operator==="<="?e:t};var TF=xF;const h1=Wf,JS=F_,AF=Os,QS=Mk,MF=pd,RF=M7,kF=C7,CF=O7,PF=L7,OF=F7,IF=B7,LF=z7,DF=j7,NF=ir,FF=K7,UF=Q7,$F=hw,BF=s9,HF=o9,GF=$_,zF=fw,VF=Rk,WF=kk,jF=pw,qF=mw,YF=Ck,XF=k9,KF=B_(),ZF=rr(),JF=H_,QF=z9,eU=q9,tU=Z9,nU=eF,sU=sF,iU=gw,rU=fF,oU=gF,aU=vF,lU=wF,cU=TF;var jm={parse:MF,valid:RF,clean:kF,inc:CF,diff:PF,major:OF,minor:IF,patch:LF,prerelease:DF,compare:NF,rcompare:FF,compareLoose:UF,compareBuild:$F,sort:BF,rsort:HF,gt:GF,lt:zF,eq:VF,neq:WF,gte:jF,lte:qF,cmp:YF,coerce:XF,Comparator:KF,Range:ZF,satisfies:JF,toComparators:QF,maxSatisfying:eU,minSatisfying:tU,minVersion:nU,validRange:sU,outside:iU,gtr:rU,ltr:oU,intersects:aU,simplifyRange:lU,subset:cU,SemVer:AF,re:h1.re,src:h1.src,tokens:h1.t,SEMVER_SPEC_VERSION:JS.SEMVER_SPEC_VERSION,RELEASE_TYPES:JS.RELEASE_TYPES,compareIdentifiers:QS.compareIdentifiers,rcompareIdentifiers:QS.rcompareIdentifiers};const zs=fd(jm);function Fh(t,e){const n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function f1(t){const e=new Uint8Array(t.length);for(let n=0;n=this.buf.byteLength){let n=this.buf.byteLength;for(;n>16&255}.${t>>8&255}.${t>>0&255}`}function fa(t){return new Promise(e=>{setTimeout(e,t)})}const uU={0:"trace",1:"debug",2:"info",3:"warning",4:"error"},yi=class yi{static trace(e,...n){yi.log(0,e,...n)}static debug(e,...n){yi.log(1,e,...n)}static info(e,...n){yi.log(2,e,...n)}static warn(e,...n){yi.log(3,e,...n)}static warning(e,...n){yi.log(3,e,...n)}static error(e,...n){yi.log(4,e,...n)}static logFmtStr(e,n,s){let i="["+uU[e]+"]";for(n&&n.length&&(i+="["+n+"]");typeof s[0]=="string";)i+=s.shift();return i}static logToFile(e,n,...s){for(const i of s)n+=" ",typeof i=="string"?n+=i:n+=JSON.stringify(i);yi.history.push(n)}static log(e,n,...s){if(!(e>>0===e)this.encodeRaw(0,e,bc(e));else if(e>>0===e){const n=-e-1;this.encodeRaw(1,n,bc(n))}else this.encodeHeader(7,26),this.buf.writeFloat32(e)}encodeObject(e){const n=Object.entries(e);this.encodeRaw(5,n.length,bc(n.length));for(const[s,i]of n)this.encode(s),this.encode(i)}encodeArray(e){this.encodeRaw(4,e.length,bc(e.length));for(const n of e)this.encode(n)}encodeString(e){this.encodeRaw(3,e.length,bc(e.length));for(let n=0;n=0;r--)this.buf.writeUint8(n>>r*8&255)}encodeHeader(e,n){return this.buf.writeUint8(e<{if(n)return n;if(this.buf.remaining()<=0)return 0;const{type:s,max:i}=this.decodeType();return s==7&&i==31?(this.buf.advance(1),0):1/0}}decodeSimpleValue(e){switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:return e}}decodeFloat16(e){const n=(e&31744)>>10,s=e&1023;return(e>>15?-1:1)*(n?n===31?s?NaN:1/0:Math.pow(2,n-15)*(1+s/1024):6103515625e-14*(s/1024))}decodeFloat(e){switch(e){case 24:{const n=this.decodeSimpleValue(this.buf.peekUint8());return this.buf.advance(1),n}case 25:{const n=this.buf.peekUint16();return this.buf.advance(2),this.decodeFloat16(n)}case 26:{const n=[this.buf.peekUint8(),this.buf.peekUint8(),this.buf.peekUint8(),this.buf.peekUint8()],s=this.buf.peekFloat32();this.buf.advance(4);const i=Dk[(n[0]&127)<<1|n[1]>>7];return(i*s+(s>0?.5:-.5)>>0)/i}case 27:{const n=this.buf.peekFloat64();return this.buf.advance(8),n}default:{if(e<24)return this.decodeSimpleValue(e);throw new Error("wrong size "+e+" on float")}}}decodeRaw(e){if(e<24)return e;const n=1<=0;i--){const r=this.buf.peekUint8();this.buf.advance(1),s|=r<>>0}decodeType(){if(this.buf.remaining()<=0)throw new Error("EOF");const e=this.buf.peekUint8();return{type:(e&dU)>>Ik,max:e&Lk}}}class qm{static encode(e){return new hU().encode(e)}static decode(e){const n=[],s=new fU(e);for(;!s.isEOF();)try{n.push(s.decode())}catch(i){if(i.message!="EOF")throw i}return n}}var dy;(function(t){t[t.UsbCdcAcm=0]="UsbCdcAcm"})(dy||(dy={}));const pU=32,mU=34,gU=35,tE=255,_U=8,vU="none",yU=1,bU=[16,8,7,6,5],wU=[1,2],xU=["none","even","odd"],SU=["none","odd","even"],EU=[1,1.5,2],hy={protocol:dy.UsbCdcAcm,usbControlInterfaceClass:2,usbTransferInterfaceClass:10};function nE(t,e){const n=t.configurations[0];for(const s of n.interfaces)if(s.alternates[0].interfaceClass===e)return s;throw new TypeError(`Unable to find interface with class ${e}.`)}function sE(t,e){const n=t.alternates[0];for(const s of n.endpoints)if(s.direction==e)return s;throw new TypeError(`Interface ${t.interfaceNumber} does not have an ${e} endpoint.`)}class TU{constructor(e,n,s){this.type="bytes",this.device_=e,this.endpoint_=n,this.onError_=s}pull(e){(async()=>{var n;const s=e.desiredSize||this.endpoint_.packetSize;let i=Math.ceil(s/this.endpoint_.packetSize);try{for(;i;){const r=await this.device_.transferIn(this.endpoint_.endpointNumber,this.endpoint_.packetSize);if(r.status!="ok"){e.error(`USB error: ${r.status}`),this.onError_();break}if(!((n=r.data)===null||n===void 0)&&n.buffer&&r.data.byteLength>0){const o=new Uint8Array(r.data.buffer,r.data.byteOffset,r.data.byteLength);e.enqueue(o),i--}}}catch(r){e.error(r.toString()),this.onError_()}})()}}class AU{constructor(e,n,s){this.device_=e,this.endpoint_=n,this.onError_=s}async write(e,n){try{const s=await this.device_.transferOut(this.endpoint_.endpointNumber,e);s.status!="ok"&&(n.error(s.status),this.onError_())}catch(s){n.error(s.toString()),this.onError_()}}}class iE{constructor(e,n){this.polyfillOptions_=Object.assign(Object.assign({},hy),n),this.outputSignals_={dataTerminalReady:!1,requestToSend:!1,break:!1},this.device_=e,this.controlInterface_=nE(this.device_,this.polyfillOptions_.usbControlInterfaceClass),this.transferInterface_=nE(this.device_,this.polyfillOptions_.usbTransferInterfaceClass),this.inEndpoint_=sE(this.transferInterface_,"in"),this.outEndpoint_=sE(this.transferInterface_,"out")}get readable(){var e;return!this.readable_&&this.device_.opened&&(this.readable_=new ReadableStream(new TU(this.device_,this.inEndpoint_,()=>{this.readable_=null}),{highWaterMark:(e=this.serialOptions_.bufferSize)!==null&&e!==void 0?e:tE})),this.readable_}get writable(){var e;return!this.writable_&&this.device_.opened&&(this.writable_=new WritableStream(new AU(this.device_,this.outEndpoint_,()=>{this.writable_=null}),new ByteLengthQueuingStrategy({highWaterMark:(e=this.serialOptions_.bufferSize)!==null&&e!==void 0?e:tE}))),this.writable_}async open(e){this.serialOptions_=e,this.validateOptions();try{await this.device_.open(),this.device_.configuration===null&&await this.device_.selectConfiguration(1),await this.device_.claimInterface(this.controlInterface_.interfaceNumber),this.controlInterface_!==this.transferInterface_&&await this.device_.claimInterface(this.transferInterface_.interfaceNumber),await this.setLineCoding(),await this.setSignals({dataTerminalReady:!0})}catch(n){throw this.device_.opened&&await this.device_.close(),new Error("Error setting up device: "+n.toString())}}async close(){const e=[];this.readable_&&e.push(this.readable_.cancel()),this.writable_&&e.push(this.writable_.abort()),await Promise.all(e),this.readable_=null,this.writable_=null,this.device_.opened&&(await this.setSignals({dataTerminalReady:!1,requestToSend:!1}),await this.device_.close())}async forget(){return this.device_.forget()}getInfo(){return{usbVendorId:this.device_.vendorId,usbProductId:this.device_.productId}}reconfigure(e){return this.serialOptions_=Object.assign(Object.assign({},this.serialOptions_),e),this.validateOptions(),this.setLineCoding()}async setSignals(e){if(this.outputSignals_=Object.assign(Object.assign({},this.outputSignals_),e),e.dataTerminalReady!==void 0||e.requestToSend!==void 0){const n=(this.outputSignals_.dataTerminalReady?1:0)|(this.outputSignals_.requestToSend?2:0);await this.device_.controlTransferOut({requestType:"class",recipient:"interface",request:mU,value:n,index:this.controlInterface_.interfaceNumber})}if(e.break!==void 0){const n=this.outputSignals_.break?65535:0;await this.device_.controlTransferOut({requestType:"class",recipient:"interface",request:gU,value:n,index:this.controlInterface_.interfaceNumber})}}validateOptions(){if(!this.isValidBaudRate(this.serialOptions_.baudRate))throw new RangeError("invalid Baud Rate "+this.serialOptions_.baudRate);if(!this.isValidDataBits(this.serialOptions_.dataBits))throw new RangeError("invalid dataBits "+this.serialOptions_.dataBits);if(!this.isValidStopBits(this.serialOptions_.stopBits))throw new RangeError("invalid stopBits "+this.serialOptions_.stopBits);if(!this.isValidParity(this.serialOptions_.parity))throw new RangeError("invalid parity "+this.serialOptions_.parity)}isValidBaudRate(e){return e%1===0}isValidDataBits(e){return typeof e>"u"?!0:bU.includes(e)}isValidStopBits(e){return typeof e>"u"?!0:wU.includes(e)}isValidParity(e){return typeof e>"u"?!0:xU.includes(e)}async setLineCoding(){var e,n,s;const i=new ArrayBuffer(7),r=new DataView(i);if(r.setUint32(0,this.serialOptions_.baudRate,!0),r.setUint8(4,EU.indexOf((e=this.serialOptions_.stopBits)!==null&&e!==void 0?e:yU)),r.setUint8(5,SU.indexOf((n=this.serialOptions_.parity)!==null&&n!==void 0?n:vU)),r.setUint8(6,(s=this.serialOptions_.dataBits)!==null&&s!==void 0?s:_U),(await this.device_.controlTransferOut({requestType:"class",recipient:"interface",request:pU,value:0,index:this.controlInterface_.interfaceNumber},i)).status!="ok")throw new DOMException("NetworkError","Failed to set line coding.")}}let MU=class{async requestPort(e,n){n=Object.assign(Object.assign({},hy),n);const s=[];if(e&&e.filters)for(const o of e.filters){const a={classCode:n.usbControlInterfaceClass};o.usbVendorId!==void 0&&(a.vendorId=o.usbVendorId),o.usbProductId!==void 0&&(a.productId=o.usbProductId),s.push(a)}s.length===0&&s.push({classCode:n.usbControlInterfaceClass});const i=await navigator.usb.requestDevice({filters:s});return new iE(i,n)}async getPorts(e){e=Object.assign(Object.assign({},hy),e);const n=await navigator.usb.getDevices(),s=[];return n.forEach(i=>{try{const r=new iE(i,e);s.push(r)}catch{}}),s}};const RU=new MU,gu=navigator.serial?navigator.serial:RU,kU=/(android)/i.test(navigator.userAgent),CU={baudRate:921600,bufferSize:4*1024*1024,updateInterval:1e3},PU={baudRate:921600,bufferSize:4*1024*1024,updateInterval:250},fy={serial:kU?CU:PU},OU="S",IU="R",rE=[{usbVendorId:1155,usbProductId:22336},{usbVendorId:11836,usbProductId:22336}],oE=()=>{};class LU extends TransformStream{constructor(){super({transform:(n,s)=>{for(const i of n){const r=this.push(i);r&&s.enqueue(r)}}});Te(this,"state",0);Te(this,"header",{cmd:0,flag:0,len:0});Te(this,"payload",new Uint8Array(0));Te(this,"offset",0)}push(n){switch(this.state){case 0:n==Ek&&(this.state=1);break;case 1:this.header.cmd=n&31,this.header.flag=n>>5,this.state=2;break;case 2:this.header.len=n<<8,this.state=3;break;case 3:if(this.header.len|=n,this.offset=0,this.payload=new Uint8Array(this.header.len),this.state=4,this.header.len==0)return this.state=0,{...this.header,payload:this.payload};break;case 4:if(this.payload[this.offset++]=n,this.offsets.name).catch(()=>{});return await this.write(f1(IU)),await this.write(f1(`\r +bl\r +`)),await this.close(),n}async get(e,n){const s=await this._command(Jn.Get,oE,n,[e]);if(s.payload[0]!=e)throw new Error("invalid value");if(s.payload.length<2)throw new Error("no payload");return s.payload.length==2?s.payload[1]:s.payload.slice(1)}async set(e,...n){const s=await this.command(Jn.Set,e,...n);if(s.payload[0]!=e)throw new Error("invalid value");if(s.payload.length<2)throw new Error("no payload");return s.payload.length==2?s.payload[1]:s.payload.slice(1)}async command(e,...n){return this._command(e,oE,void 0,n)}async commandProgress(e,n,...s){return this._command(e,n,void 0,s)}async close(){var e,n,s,i,r;try{await((e=this.reader)==null?void 0:e.cancel().catch(console.warn)),await(this.transfromClosed||Promise.resolve()).catch(()=>{}),(n=this.reader)==null||n.releaseLock()}catch(o){ct.warn("serial",o)}try{await((s=this.writer)==null?void 0:s.close()),(i=this.writer)==null||i.releaseLock()}catch(o){ct.warn("serial",o)}await((r=this.port)==null?void 0:r.close().catch(console.warn)),this.reader=void 0,this.writer=void 0,this.transfromClosed=void 0,this.port=void 0}async _command(e,n,s,i){return this.waitingCommands=this.waitingCommands.then(()=>this.send(e,n,s,i)).then(r=>{if(r.cmd!=e)throw new Error("invalid command");if(r.flag&Wm.Error)throw new Error(r.payload[0]);return r}).catch(r=>{throw this.errorCallback&&this.errorCallback(r),r})}async write(e){if(this.writer)await this.writer.write(e);else throw new Error("no serial writer")}async send(e,n,s,i){const r=this.encodeValues(i),o=Uint8Array.from([Ek,e,r.length>>8&255,r.length&255]);ct.trace("serial","[quic] sent cmd:",e,"len:",r.length,i),await this.write(Fh(o,r));let a=await this.readPacket(n,s);for(;a.cmd==Jn.Log;)ct.info("serial","[quic] "+a.payload[0]),a=await this.readPacket(n,s);return ct.trace("serial","[quic] recv cmd:",a.cmd,"flag:",a.flag,"len:",a.len,a.payload),a}encodeValues(e){let n=new Uint8Array;for(const s of e){const i=qm.encode(s);n=Fh(n,i)}return n}async readPacket(e,n){if(!this.reader)throw new Error("no serial reader");const s=[this.reader.read().then(l=>l.value)];n&&s.push(new Promise((l,c)=>setTimeout(()=>c("timeout"),n)));const i=await Promise.race(s);if(!i)throw new Error("no packet");if(i.cmd>=Jn.Max||i.cmd==Jn.Invalid)throw new Error("invalid command");if(!(i.flag&Wm.Streaming))return{...i,payload:qm.decode(i.payload)};const r=new yw;r.writeUint8s(i.payload),ct.trace("serial","[quic] recv stream chunk",r.length),e(r.length);const o=i.cmd;for(;r;){const{value:l}=await this.reader.read();if(!l)throw new Error("no packet");if(l.cmd!=o||!(l.flag&Wm.Streaming))throw new Error("invalid command");if(l.len==0)break;r.writeUint8s(l.payload),ct.trace("serial","[quic] recv stream chunk",r.length),e(r.length)}const a=qm.decode(r.array());return{...i,payload:a}}};const Et=new DU,vn=ys("root",{state:()=>({needs_apply:!1,needs_reboot:!1,alerts:[],pid_rate_presets:[]}),actions:{append_alert(t){this.alerts=[...this.alerts,{id:Date.now().toString()+"-"+this.alerts.length.toString(),...t}]},pop_alert(t){this.alerts=[...this.alerts.filter(e=>e.id!=t)]},set_needs_apply(){this.needs_apply=!0},set_needs_reboot(){this.needs_apply=!0,this.needs_reboot=!0},reset_needs_apply(){this.needs_apply=!1},reset_needs_reboot(){this.needs_apply=!1,this.needs_reboot=!1},fetch_pid_rate_presets(){return Et.get(xn.PidRatePresets).then(t=>this.pid_rate_presets=t)},cal_imu(){return Et.command(Jn.CalImu)},cal_sticks(){return Et.command(Jn.CalSticks)}}}),NU=it({name:"AlterPortal",setup(){return{root:vn()}},data(){return{timeouts:{}}},watch:{"root.alerts"(t,e){if(t.length<=e.length)return;const n=t[t.length-1].id;this.timeouts[n]=window.setTimeout(()=>{this.root.pop_alert(n),delete this.timeouts[n]},2500)}},methods:{dismiss(t){clearTimeout(this.timeouts[t]),this.root.pop_alert(t),delete this.timeouts[t]}}}),lt=(t,e)=>{const n=t.__vccOpts||t;for(const[s,i]of e)n[s]=i;return n},FU={class:"alert-portal"},UU=["onClick"];function $U(t,e,n,s,i,r){return Z(),ie("div",FU,[Y(UD,{name:"alert",tag:"div"},{default:nt(()=>[(Z(!0),ie(ot,null,qt(t.root.alerts,o=>(Z(),ie("div",{key:o.id,class:ms(["notification",["is-"+o.type]])},[p("button",{class:"delete",onClick:a=>t.dismiss(o.id)},null,8,UU),me(" "+Be(o.msg),1)],2))),128))]),_:1})])}const BU=lt(NU,[["render",$U]]),HU=it({name:"ModalPortal"}),GU={class:"modal-portal"},zU={key:0,class:"modal is-active"},VU=p("div",{class:"modal-background"},null,-1);function WU(t,e,n,s,i,r){return Z(),ie("div",GU,[me(Be(t.$modal.isShown)+" ",1),t.$modal.isShown?(Z(),ie("div",zU,[VU,(Z(),en(bL(t.$modal.component),P_(t.$modal.props,{onClose:e[0]||(e[0]=o=>t.$modal.close(o))}),null,16))])):ze("",!0)])}const jU=lt(HU,[["render",WU]]),qU=it({name:"SelectModal",props:["options","title"],data(){return{value:void 0}}}),YU={class:"modal-card"},XU={class:"modal-card-head"},KU={class:"modal-card-title"},ZU={class:"modal-card-body"},JU={class:"select is-fullwidth is-multiple select-list"},QU={class:"control"},e$=["value"],t$={class:"modal-card-foot"},n$=["disabled"];function s$(t,e,n,s,i,r){return Z(),ie("div",YU,[p("header",XU,[p("p",KU,"Select "+Be(t.title),1),p("button",{class:"delete has-background-primary","aria-label":"close",onClick:e[0]||(e[0]=o=>t.$emit("close"))})]),p("section",ZU,[p("div",JU,[p("div",QU,[Ye(p("select",{"onUpdate:modelValue":e[1]||(e[1]=o=>t.value=o),size:"8"},[(Z(!0),ie(ot,null,qt(t.options,o=>(Z(),ie("option",{key:o.value,value:o.value},Be(o.text),9,e$))),128))],512),[[L_,t.value]])])])]),p("footer",t$,[p("button",{class:"button",onClick:e[2]||(e[2]=o=>t.$emit("close"))},"Cancel"),p("button",{class:"button is-success",disabled:t.value==null,onClick:e[3]||(e[3]=o=>t.$emit("close",t.value))}," Select ",8,n$)])])}const aE=lt(qU,[["render",s$]]);var Nk=(t=>(t[t.BRUSHLESS=2]="BRUSHLESS",t[t.OSD=4]="OSD",t[t.BLACKBOX=8]="BLACKBOX",t[t.DEBUG=16]="DEBUG",t))(Nk||{}),Fk=(t=>(t[t.ROTATE_NONE=0]="ROTATE_NONE",t[t.ROTATE_45_CCW=1]="ROTATE_45_CCW",t[t.ROTATE_45_CW=2]="ROTATE_45_CW",t[t.ROTATE_90_CW=4]="ROTATE_90_CW",t[t.ROTATE_90_CCW=8]="ROTATE_90_CCW",t[t.ROTATE_180=16]="ROTATE_180",t[t.FLIP_180=32]="FLIP_180",t))(Fk||{}),Uk=(t=>(t[t.INVALID=0]="INVALID",t[t.MPU6000=1]="MPU6000",t[t.MPU6500=2]="MPU6500",t[t.ICM20601=3]="ICM20601",t[t.ICM20602=4]="ICM20602",t[t.ICM20608=5]="ICM20608",t[t.ICM20649=6]="ICM20649",t[t.ICM20689=7]="ICM20689",t[t.ICM42605=8]="ICM42605",t[t.ICM42688P=9]="ICM42688P",t[t.BMI270=10]="BMI270",t))(Uk||{}),$k=(t=>(t[t.INVALID=0]="INVALID",t[t.MPU6000=1]="MPU6000",t[t.MPU6500=2]="MPU6500",t[t.ICM20601=3]="ICM20601",t[t.ICM20602=4]="ICM20602",t[t.ICM20608=5]="ICM20608",t[t.ICM20689=6]="ICM20689",t[t.ICM42605=7]="ICM42605",t[t.ICM42688P=8]="ICM42688P",t[t.BMI270=9]="BMI270",t[t.BMI323=10]="BMI323",t))($k||{}),Bk=(t=>(t[t.CHANNEL_5=0]="CHANNEL_5",t[t.CHANNEL_6=1]="CHANNEL_6",t[t.CHANNEL_7=2]="CHANNEL_7",t[t.CHANNEL_8=3]="CHANNEL_8",t[t.CHANNEL_9=4]="CHANNEL_9",t[t.CHANNEL_10=5]="CHANNEL_10",t[t.CHANNEL_11=6]="CHANNEL_11",t[t.CHANNEL_12=7]="CHANNEL_12",t[t.CHANNEL_13=8]="CHANNEL_13",t[t.CHANNEL_14=9]="CHANNEL_14",t[t.CHANNEL_15=10]="CHANNEL_15",t[t.CHANNEL_16=11]="CHANNEL_16",t[t.OFF=12]="OFF",t[t.ON=13]="ON",t[t.AUX_GESTURE=14]="AUX_GESTURE",t))(Bk||{}),Hk=(t=>(t[t.AUX_ARMING=0]="AUX_ARMING",t[t.AUX_IDLE_UP=1]="AUX_IDLE_UP",t[t.AUX_LEVELMODE=2]="AUX_LEVELMODE",t[t.AUX_RACEMODE=3]="AUX_RACEMODE",t[t.AUX_HORIZON=4]="AUX_HORIZON",t[t.AUX_STICK_BOOST_PROFILE=5]="AUX_STICK_BOOST_PROFILE",t[t._AUX_RATE_PROFILE=6]="_AUX_RATE_PROFILE",t[t.AUX_BUZZER_ENABLE=7]="AUX_BUZZER_ENABLE",t[t.AUX_TURTLE=8]="AUX_TURTLE",t[t.AUX_MOTOR_TEST=9]="AUX_MOTOR_TEST",t[t.AUX_RSSI=10]="AUX_RSSI",t[t.AUX_FPV_SWITCH=11]="AUX_FPV_SWITCH",t[t.AUX_BLACKBOX=12]="AUX_BLACKBOX",t))(Hk||{}),Gk=(t=>(t[t.AUX_ARMING=0]="AUX_ARMING",t[t.AUX_IDLE_UP=1]="AUX_IDLE_UP",t[t.AUX_LEVELMODE=2]="AUX_LEVELMODE",t[t.AUX_RACEMODE=3]="AUX_RACEMODE",t[t.AUX_HORIZON=4]="AUX_HORIZON",t[t.AUX_STICK_BOOST_PROFILE=5]="AUX_STICK_BOOST_PROFILE",t[t._AUX_RATE_PROFILE=6]="_AUX_RATE_PROFILE",t[t.AUX_BUZZER_ENABLE=7]="AUX_BUZZER_ENABLE",t[t.AUX_TURTLE=8]="AUX_TURTLE",t[t.AUX_MOTOR_TEST=9]="AUX_MOTOR_TEST",t[t.AUX_RSSI=10]="AUX_RSSI",t[t.AUX_FPV_SWITCH=11]="AUX_FPV_SWITCH",t[t.AUX_BLACKBOX=12]="AUX_BLACKBOX",t[t.AUX_PREARM=13]="AUX_PREARM",t))(Gk||{}),zk=(t=>(t[t.INVALID=0]="INVALID",t[t.UNIFIED_SERIAL=1]="UNIFIED_SERIAL",t[t.SBUS=2]="SBUS",t[t.CRSF=3]="CRSF",t[t.IBUS=4]="IBUS",t[t.FPORT=5]="FPORT",t[t.DSMX_2048=6]="DSMX_2048",t[t.DSM2_1024=7]="DSM2_1024",t[t.NRF24_BAYANG_TELEMETRY=8]="NRF24_BAYANG_TELEMETRY",t[t.BAYANG_PROTOCOL_BLE_BEACON=9]="BAYANG_PROTOCOL_BLE_BEACON",t[t.BAYANG_PROTOCOL_TELEMETRY_AUTOBIND=10]="BAYANG_PROTOCOL_TELEMETRY_AUTOBIND",t[t.FRSKY_D8=11]="FRSKY_D8",t[t.FRSKY_D16=12]="FRSKY_D16",t[t.REDPINE=13]="REDPINE",t[t.EXPRESS_LRS=14]="EXPRESS_LRS",t))(zk||{}),Vk=(t=>(t[t.INVALID=0]="INVALID",t[t.UNIFIED_SERIAL=1]="UNIFIED_SERIAL",t[t.SBUS=2]="SBUS",t[t.CRSF=3]="CRSF",t[t.IBUS=4]="IBUS",t[t.FPORT=5]="FPORT",t[t.DSM=6]="DSM",t[t.NRF24_BAYANG_TELEMETRY=7]="NRF24_BAYANG_TELEMETRY",t[t.BAYANG_PROTOCOL_BLE_BEACON=8]="BAYANG_PROTOCOL_BLE_BEACON",t[t.BAYANG_PROTOCOL_TELEMETRY_AUTOBIND=9]="BAYANG_PROTOCOL_TELEMETRY_AUTOBIND",t[t.FRSKY_D8=10]="FRSKY_D8",t[t.FRSKY_D16=11]="FRSKY_D16",t[t.REDPINE=12]="REDPINE",t[t.EXPRESS_LRS=13]="EXPRESS_LRS",t))(Vk||{}),Wk=(t=>(t[t.INVALID=0]="INVALID",t[t.UNIFIED_SERIAL=1]="UNIFIED_SERIAL",t[t.SBUS=2]="SBUS",t[t.CRSF=3]="CRSF",t[t.IBUS=4]="IBUS",t[t.FPORT=5]="FPORT",t[t.DSM=6]="DSM",t[t.NRF24_BAYANG_TELEMETRY=7]="NRF24_BAYANG_TELEMETRY",t[t.BAYANG_PROTOCOL_BLE_BEACON=8]="BAYANG_PROTOCOL_BLE_BEACON",t[t.BAYANG_PROTOCOL_TELEMETRY_AUTOBIND=9]="BAYANG_PROTOCOL_TELEMETRY_AUTOBIND",t[t.FRSKY_D8=10]="FRSKY_D8",t[t.FRSKY_D16_FCC=11]="FRSKY_D16_FCC",t[t.FRSKY_D16_LBT=12]="FRSKY_D16_LBT",t[t.REDPINE=13]="REDPINE",t[t.EXPRESS_LRS=14]="EXPRESS_LRS",t[t.FLYSKY_AFHDS=15]="FLYSKY_AFHDS",t[t.FLYSKY_AFHDS2A=16]="FLYSKY_AFHDS2A",t))(Wk||{}),jk=(t=>(t[t.INVALID=0]="INVALID",t[t.DSM=1]="DSM",t[t.SBUS=2]="SBUS",t[t.IBUS=3]="IBUS",t[t.FPORT=4]="FPORT",t[t.CRSF=5]="CRSF",t[t.REDPINE=6]="REDPINE",t[t.SBUS_INVERTED=7]="SBUS_INVERTED",t[t.FPORT_INVERTED=8]="FPORT_INVERTED",t[t.REDPINE_INVERTED=9]="REDPINE_INVERTED",t))(jk||{}),Jc=(t=>(t[t.STICK_WIZARD_INACTIVE=0]="STICK_WIZARD_INACTIVE",t[t.STICK_WIZARD_SUCCESS=1]="STICK_WIZARD_SUCCESS",t[t.STICK_WIZARD_FAILED=2]="STICK_WIZARD_FAILED",t[t.STICK_WIZARD_START=3]="STICK_WIZARD_START",t[t.STICK_WIZARD_CAPTURE_STICKS=4]="STICK_WIZARD_CAPTURE_STICKS",t[t.STICK_WIZARD_WAIT_FOR_CONFIRM=5]="STICK_WIZARD_WAIT_FOR_CONFIRM",t[t.STICK_WIZARD_CONFIRMED=6]="STICK_WIZARD_CONFIRMED",t[t.STICK_WIZARD_TIMEOUT=7]="STICK_WIZARD_TIMEOUT",t))(Jc||{}),qk=(t=>(t[t.FAILLOOP_NONE=0]="FAILLOOP_NONE",t[t.FAILLOOP_LOW_BATTERY=2]="FAILLOOP_LOW_BATTERY",t[t.FAILLOOP_RADIO=3]="FAILLOOP_RADIO",t[t.FAILLOOP_GYRO=4]="FAILLOOP_GYRO",t[t.FAILLOOP_FAULT=5]="FAILLOOP_FAULT",t[t.FAILLOOP_LOOPTIME=6]="FAILLOOP_LOOPTIME",t[t.FAILLOOP_SPI=7]="FAILLOOP_SPI",t[t.FAILLOOP_SPI_MAIN=8]="FAILLOOP_SPI_MAIN",t))(qk||{}),Ze=(t=>(t[t.LOOP=0]="LOOP",t[t.TIME=1]="TIME",t[t.PID_P_TERM=2]="PID_P_TERM",t[t.PID_I_TERM=3]="PID_I_TERM",t[t.PID_D_TERM=4]="PID_D_TERM",t[t.RX=5]="RX",t[t.SETPOINT=6]="SETPOINT",t[t.ACCEL_RAW=7]="ACCEL_RAW",t[t.ACCEL_FILTER=8]="ACCEL_FILTER",t[t.GYRO_RAW=9]="GYRO_RAW",t[t.GYRO_FILTER=10]="GYRO_FILTER",t[t.MOTOR=11]="MOTOR",t[t.CPU_LOAD=12]="CPU_LOAD",t[t.DEBUG=13]="DEBUG",t))(Ze||{}),Yk=(t=>(t[t.PACKET_RATE=0]="PACKET_RATE",t[t.CHANNEL=1]="CHANNEL",t[t.DIRECT=2]="DIRECT",t))(Yk||{});const i$={0:"",2:"low battery at powerup - currently unused",3:"radio chip not found",4:"gyro not found",5:"clock, intterrupts, systick, gcc bad code, bad memory access (code issues like bad pointers) - this should not come up",6:"loop time issue - if loop time exceeds 20mS",7:"spi error - triggered by hardware spi driver only",8:"spi error main loop - triggered by hardware spi driver only"},Xa=ys("constant",{state:()=>({Features:Nk,GyroRotation:Fk,AuxChannels:Bk,RXSerialProtocol:jk,StickWizardState:Jc,Failloop:qk,LQISource:Yk}),getters:{RXProtocol(){const t=An();return zs.gt(t.quic_protocol_semver,"0.1.0")?Wk:t.quic_protocol_version>5?Vk:zk},AuxFunctions(){const t=An();return zs.gt(t.quic_protocol_semver,"0.1.0")?Gk:Hk},GyroType(){const t=An();return zs.gt(t.quic_protocol_semver,"0.2.0")?$k:Uk}},actions:{}}),js=ys("state",{state:()=>({looptime_autodetect:0,cpu_load:0,cpu_temp:0,vbat_filtered:0,vbattfilt:null,ibat_filtered:0,ibat_drawn:0,rx:[],rx_filtered:[],rx_status:0,rx_rssi:0,GEstG:null,accel:null,aux:[],stick_calibration_wizard:0,failloop:0,pidoutput:null,accel_raw:null,gyro:null,gyro_raw:null}),getters:{vbat(t){return t.vbattfilt||t.vbat_filtered},failloopMessage(t){return i$[t.failloop]}},actions:{fetch_state(){return Et.get(xn.State).then(t=>this.$patch(t)).catch(t=>ct.warn("state",t))}}});function G_(t){return t!==String(parseFloat(t))}function r$(t){return Object.getOwnPropertyNames(t).filter(function(e){return t.propertyIsEnumerable(e)&&G_(e)})}function o$(t){return Object.keys(t).filter(G_)}function a$(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&t.propertyIsEnumerable(n)&&G_(n)&&e.push(n);return e}var l$=Object.getOwnPropertyNames?r$:Object.keys?o$:a$,Xk=function(){function t(e){this.enumObj=e,this.keysList=Object.freeze(l$(e));for(var n=this.keysList.length,s=new Array(n),i=new Map,r=0;r=n.length,r={done:i,value:n.keysList[s]};return++s,r}},e[Symbol.iterator]=function(){return this},e},t.prototype.values=function(){var e,n=this,s=0;return e={next:function(){var i=s>=n.length,r={done:i,value:n.valuesList[s]};return++s,r}},e[Symbol.iterator]=function(){return this},e},t.prototype.entries=function(){var e,n=this,s=0;return e={next:function(){var i=s>=n.length,r={done:i,value:n[s]};return++s,r}},e[Symbol.iterator]=function(){return this},e},t.prototype[Symbol.iterator]=function(){return this.entries()},t.prototype.forEach=function(e,n){for(var s=this.length,i=0;i({usart_ports:[],motor_pins:[],mcu:"",target_name:"",git_version:"",quic_protocol_version:0,quic_protocol_semver:"v0.0.0",gyro_id:0,gyro_name:"",rx_protocol:0,rx_protocols:[],features:0}),getters:{has_feature(t){return e=>t.features==null?!0:t.features&e},quicVersionGt(t){return e=>zs.gt(t.quic_protocol_semver,e)},quicVersionGte(t){return e=>zs.gte(t.quic_protocol_semver,e)},is_read_only(t){const e=js();return t.quic_protocol_version<5||e.failloop>0}},actions:{set_info(t){this.$patch(t),this.quic_protocol_version&&(this.quic_protocol_semver=Gu(this.quic_protocol_version));const e=Xa();this.gyro_name=ns(e.GyroType).getKeys()[this.gyro_id]}}}),jf=ys("default_profile",{state:()=>({serial:{rx:0,smart_audio:0,hdzero:0},filter:{gyro:[{},{}],dterm:[{},{}]},osd:{callsign:"",elements:[],elements_hd:[]},meta:{version:0,datetime:0},motor:{invert_yaw:1},rate:{mode:0,silverware:{},betaflight:{}},voltage:{},receiver:{lqi_source:-1,aux:[]},pid:{pid_profile:0,pid_rates:[{}],stick_profile:0,stick_rates:[{}],big_angle:{},small_angle:{},throttle_dterm_attenuation:{}}}),getters:{has_legacy_stickrates(t){return zs.lte(Gu(t.meta.version),"v0.1.0")},has_legacy_osd(t){return zs.lte(Gu(t.meta.version),"v0.1.0")}},actions:{fetch_default_profile(){return Et.get(xn.DefaultProfile).then(t=>{t.meta.name=t.meta.name.replace(/\0/g,""),this.$patch(t)})}}});//! moment.js +//! version : 2.30.1 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +var Zk;function Ue(){return Zk.apply(null,arguments)}function _$(t){Zk=t}function nr(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Jl(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Dt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ww(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Dt(t,e))return!1;return!0}function Fs(t){return t===void 0}function Eo(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function qf(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function Jk(t,e){var n=[],s,i=t.length;for(s=0;s>>0,s;for(s=0;s0)for(n=0;n=0;return(r?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var Tw=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ep=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,m1={},_u={};function tt(t,e,n,s){var i=s;typeof s=="string"&&(i=function(){return this[s]()}),t&&(_u[t]=i),e&&(_u[e[0]]=function(){return Pr(i.apply(this,arguments),e[1],e[2])}),n&&(_u[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function x$(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function S$(t){var e=t.match(Tw),n,s;for(n=0,s=e.length;n=0&&Ep.test(t);)t=t.replace(Ep,s),Ep.lastIndex=0,n-=1;return t}var E$={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function T$(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Tw).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[t])}var A$="Invalid date";function M$(){return this._invalidDate}var R$="%d",k$=/\d{1,2}/;function C$(t){return this._ordinal.replace("%d",t)}var P$={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function O$(t,e,n,s){var i=this._relativeTime[n];return Dr(i)?i(t,e,n,s):i.replace(/%d/i,t)}function I$(t,e){var n=this._relativeTime[t>0?"future":"past"];return Dr(n)?n(e):n.replace(/%s/i,e)}var dE={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Pi(t){return typeof t=="string"?dE[t]||dE[t.toLowerCase()]:void 0}function Aw(t){var e={},n,s;for(s in t)Dt(t,s)&&(n=Pi(s),n&&(e[n]=t[s]));return e}var L$={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function D$(t){var e=[],n;for(n in t)Dt(t,n)&&e.push({unit:n,priority:L$[n]});return e.sort(function(s,i){return s.priority-i.priority}),e}var n5=/\d/,di=/\d\d/,s5=/\d{3}/,Mw=/\d{4}/,V_=/[+-]?\d{6}/,pn=/\d\d?/,i5=/\d\d\d\d?/,r5=/\d\d\d\d\d\d?/,W_=/\d{1,3}/,Rw=/\d{1,4}/,j_=/[+-]?\d{1,6}/,md=/\d+/,q_=/[+-]?\d+/,N$=/Z|[+-]\d\d:?\d\d/gi,Y_=/Z|[+-]\d\d(?::?\d\d)?/gi,F$=/[+-]?\d+(\.\d{1,3})?/,Xf=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,gd=/^[1-9]\d?/,kw=/^([1-9]\d|\d)/,kg;kg={};function je(t,e,n){kg[t]=Dr(e)?e:function(s,i){return s&&n?n:e}}function U$(t,e){return Dt(kg,t)?kg[t](e._strict,e._locale):new RegExp($$(t))}function $$(t){return vo(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,s,i,r){return n||s||i||r}))}function vo(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function wi(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function kt(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=wi(e)),n}var _y={};function Yt(t,e){var n,s=e,i;for(typeof t=="string"&&(t=[t]),Eo(e)&&(s=function(r,o){o[e]=kt(r)}),i=t.length,n=0;n68?1900:2e3)};var o5=_d("FullYear",!0);function z$(){return X_(this.year())}function _d(t,e){return function(n){return n!=null?(a5(this,t,n),Ue.updateOffset(this,e),this):cf(this,t)}}function cf(t,e){if(!t.isValid())return NaN;var n=t._d,s=t._isUTC;switch(e){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function a5(t,e,n){var s,i,r,o,a;if(!(!t.isValid()||isNaN(n))){switch(s=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(i?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(i?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(i?s.setUTCHours(n):s.setHours(n));case"Date":return void(i?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}r=n,o=t.month(),a=t.date(),a=a===29&&o===1&&!X_(r)?28:a,i?s.setUTCFullYear(r,o,a):s.setFullYear(r,o,a)}}function V$(t){return t=Pi(t),Dr(this[t])?this[t]():this}function W$(t,e){if(typeof t=="object"){t=Aw(t);var n=D$(t),s,i=n.length;for(s=0;s=0?(a=new Date(t+400,e,n,s,i,r,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,s,i,r,o),a}function uf(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Cg(t,e,n){var s=7+e-n,i=(7+uf(t,0,s).getUTCDay()-e)%7;return-i+s-1}function f5(t,e,n,s,i){var r=(7+n-s)%7,o=Cg(t,s,i),a=1+7*(e-1)+r+o,l,c;return a<=0?(l=t-1,c=Uh(l)+a):a>Uh(t)?(l=t+1,c=a-Uh(t)):(l=t,c=a),{year:l,dayOfYear:c}}function df(t,e,n){var s=Cg(t.year(),e,n),i=Math.floor((t.dayOfYear()-s-1)/7)+1,r,o;return i<1?(o=t.year()-1,r=i+yo(o,e,n)):i>yo(t.year(),e,n)?(r=i-yo(t.year(),e,n),o=t.year()+1):(o=t.year(),r=i),{week:r,year:o}}function yo(t,e,n){var s=Cg(t,e,n),i=Cg(t+1,e,n);return(Uh(t)-s+i)/7}tt("w",["ww",2],"wo","week");tt("W",["WW",2],"Wo","isoWeek");je("w",pn,gd);je("ww",pn,di);je("W",pn,gd);je("WW",pn,di);Kf(["w","ww","W","WW"],function(t,e,n,s){e[s.substr(0,1)]=kt(t)});function iB(t){return df(t,this._week.dow,this._week.doy).week}var rB={dow:0,doy:6};function oB(){return this._week.dow}function aB(){return this._week.doy}function lB(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function cB(t){var e=df(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}tt("d",0,"do","day");tt("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});tt("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});tt("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});tt("e",0,0,"weekday");tt("E",0,0,"isoWeekday");je("d",pn);je("e",pn);je("E",pn);je("dd",function(t,e){return e.weekdaysMinRegex(t)});je("ddd",function(t,e){return e.weekdaysShortRegex(t)});je("dddd",function(t,e){return e.weekdaysRegex(t)});Kf(["dd","ddd","dddd"],function(t,e,n,s){var i=n._locale.weekdaysParse(t,s,n._strict);i!=null?e.d=i:vt(n).invalidWeekday=t});Kf(["d","e","E"],function(t,e,n,s){e[s]=kt(t)});function uB(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function dB(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Pw(t,e){return t.slice(e,7).concat(t.slice(0,e))}var hB="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),p5="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),fB="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),pB=Xf,mB=Xf,gB=Xf;function _B(t,e){var n=nr(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Pw(n,this._week.dow):t?n[t.day()]:n}function vB(t){return t===!0?Pw(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function yB(t){return t===!0?Pw(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function bB(t,e,n){var s,i,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=Lr([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?e==="dddd"?(i=Mn.call(this._weekdaysParse,o),i!==-1?i:null):e==="ddd"?(i=Mn.call(this._shortWeekdaysParse,o),i!==-1?i:null):(i=Mn.call(this._minWeekdaysParse,o),i!==-1?i:null):e==="dddd"?(i=Mn.call(this._weekdaysParse,o),i!==-1||(i=Mn.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=Mn.call(this._minWeekdaysParse,o),i!==-1?i:null)):e==="ddd"?(i=Mn.call(this._shortWeekdaysParse,o),i!==-1||(i=Mn.call(this._weekdaysParse,o),i!==-1)?i:(i=Mn.call(this._minWeekdaysParse,o),i!==-1?i:null)):(i=Mn.call(this._minWeekdaysParse,o),i!==-1||(i=Mn.call(this._weekdaysParse,o),i!==-1)?i:(i=Mn.call(this._shortWeekdaysParse,o),i!==-1?i:null))}function wB(t,e,n){var s,i,r;if(this._weekdaysParseExact)return bB.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=Lr([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[s].test(t))return s;if(n&&e==="ddd"&&this._shortWeekdaysParse[s].test(t))return s;if(n&&e==="dd"&&this._minWeekdaysParse[s].test(t))return s;if(!n&&this._weekdaysParse[s].test(t))return s}}function xB(t){if(!this.isValid())return t!=null?this:NaN;var e=cf(this,"Day");return t!=null?(t=uB(t,this.localeData()),this.add(t-e,"d")):e}function SB(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function EB(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=dB(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function TB(t){return this._weekdaysParseExact?(Dt(this,"_weekdaysRegex")||Ow.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Dt(this,"_weekdaysRegex")||(this._weekdaysRegex=pB),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function AB(t){return this._weekdaysParseExact?(Dt(this,"_weekdaysRegex")||Ow.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Dt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=mB),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function MB(t){return this._weekdaysParseExact?(Dt(this,"_weekdaysRegex")||Ow.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Dt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=gB),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ow(){function t(u,d){return d.length-u.length}var e=[],n=[],s=[],i=[],r,o,a,l,c;for(r=0;r<7;r++)o=Lr([2e3,1]).day(r),a=vo(this.weekdaysMin(o,"")),l=vo(this.weekdaysShort(o,"")),c=vo(this.weekdays(o,"")),e.push(a),n.push(l),s.push(c),i.push(a),i.push(l),i.push(c);e.sort(t),n.sort(t),s.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Iw(){return this.hours()%12||12}function RB(){return this.hours()||24}tt("H",["HH",2],0,"hour");tt("h",["hh",2],0,Iw);tt("k",["kk",2],0,RB);tt("hmm",0,0,function(){return""+Iw.apply(this)+Pr(this.minutes(),2)});tt("hmmss",0,0,function(){return""+Iw.apply(this)+Pr(this.minutes(),2)+Pr(this.seconds(),2)});tt("Hmm",0,0,function(){return""+this.hours()+Pr(this.minutes(),2)});tt("Hmmss",0,0,function(){return""+this.hours()+Pr(this.minutes(),2)+Pr(this.seconds(),2)});function m5(t,e){tt(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}m5("a",!0);m5("A",!1);function g5(t,e){return e._meridiemParse}je("a",g5);je("A",g5);je("H",pn,kw);je("h",pn,gd);je("k",pn,gd);je("HH",pn,di);je("hh",pn,di);je("kk",pn,di);je("hmm",i5);je("hmmss",r5);je("Hmm",i5);je("Hmmss",r5);Yt(["H","HH"],$n);Yt(["k","kk"],function(t,e,n){var s=kt(t);e[$n]=s===24?0:s});Yt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});Yt(["h","hh"],function(t,e,n){e[$n]=kt(t),vt(n).bigHour=!0});Yt("hmm",function(t,e,n){var s=t.length-2;e[$n]=kt(t.substr(0,s)),e[Zi]=kt(t.substr(s)),vt(n).bigHour=!0});Yt("hmmss",function(t,e,n){var s=t.length-4,i=t.length-2;e[$n]=kt(t.substr(0,s)),e[Zi]=kt(t.substr(s,2)),e[uo]=kt(t.substr(i)),vt(n).bigHour=!0});Yt("Hmm",function(t,e,n){var s=t.length-2;e[$n]=kt(t.substr(0,s)),e[Zi]=kt(t.substr(s))});Yt("Hmmss",function(t,e,n){var s=t.length-4,i=t.length-2;e[$n]=kt(t.substr(0,s)),e[Zi]=kt(t.substr(s,2)),e[uo]=kt(t.substr(i))});function kB(t){return(t+"").toLowerCase().charAt(0)==="p"}var CB=/[ap]\.?m?\.?/i,PB=_d("Hours",!0);function OB(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var _5={calendar:b$,longDateFormat:E$,invalidDate:A$,ordinal:R$,dayOfMonthOrdinalParse:k$,relativeTime:P$,months:q$,monthsShort:l5,week:rB,weekdays:hB,weekdaysMin:fB,weekdaysShort:p5,meridiemParse:CB},_n={},jd={},hf;function IB(t,e){var n,s=Math.min(t.length,e.length);for(n=0;n0;){if(i=K_(r.slice(0,n).join("-")),i)return i;if(s&&s.length>=n&&IB(r,s)>=n-1)break;n--}e++}return hf}function DB(t){return!!(t&&t.match("^[^/\\\\]*$"))}function K_(t){var e=null,n;if(_n[t]===void 0&&typeof module<"u"&&module&&module.exports&&DB(t))try{e=hf._abbr,n=require,n("./locale/"+t),Ca(e)}catch{_n[t]=null}return _n[t]}function Ca(t,e){var n;return t&&(Fs(e)?n=Lo(t):n=Lw(t,e),n?hf=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),hf._abbr}function Lw(t,e){if(e!==null){var n,s=_5;if(e.abbr=t,_n[t]!=null)e5("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=_n[t]._config;else if(e.parentLocale!=null)if(_n[e.parentLocale]!=null)s=_n[e.parentLocale]._config;else if(n=K_(e.parentLocale),n!=null)s=n._config;else return jd[e.parentLocale]||(jd[e.parentLocale]=[]),jd[e.parentLocale].push({name:t,config:e}),null;return _n[t]=new Ew(my(s,e)),jd[t]&&jd[t].forEach(function(i){Lw(i.name,i.config)}),Ca(t),_n[t]}else return delete _n[t],null}function NB(t,e){if(e!=null){var n,s,i=_5;_n[t]!=null&&_n[t].parentLocale!=null?_n[t].set(my(_n[t]._config,e)):(s=K_(t),s!=null&&(i=s._config),e=my(i,e),s==null&&(e.abbr=t),n=new Ew(e),n.parentLocale=_n[t],_n[t]=n),Ca(t)}else _n[t]!=null&&(_n[t].parentLocale!=null?(_n[t]=_n[t].parentLocale,t===Ca()&&Ca(t)):_n[t]!=null&&delete _n[t]);return _n[t]}function Lo(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return hf;if(!nr(t)){if(e=K_(t),e)return e;t=[t]}return LB(t)}function FB(){return gy(_n)}function Dw(t){var e,n=t._a;return n&&vt(t).overflow===-2&&(e=n[co]<0||n[co]>11?co:n[yr]<1||n[yr]>Cw(n[gs],n[co])?yr:n[$n]<0||n[$n]>24||n[$n]===24&&(n[Zi]!==0||n[uo]!==0||n[Fl]!==0)?$n:n[Zi]<0||n[Zi]>59?Zi:n[uo]<0||n[uo]>59?uo:n[Fl]<0||n[Fl]>999?Fl:-1,vt(t)._overflowDayOfYear&&(eyr)&&(e=yr),vt(t)._overflowWeeks&&e===-1&&(e=H$),vt(t)._overflowWeekday&&e===-1&&(e=G$),vt(t).overflow=e),t}var UB=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,$B=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,BB=/Z|[+-]\d\d(?::?\d\d)?/,Tp=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],g1=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],HB=/^\/?Date\((-?\d+)/i,GB=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,zB={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function v5(t){var e,n,s=t._i,i=UB.exec(s)||$B.exec(s),r,o,a,l,c=Tp.length,u=g1.length;if(i){for(vt(t).iso=!0,e=0,n=c;eUh(o)||t._dayOfYear===0)&&(vt(t)._overflowDayOfYear=!0),n=uf(o,0,t._dayOfYear),t._a[co]=n.getUTCMonth(),t._a[yr]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=s[e]=i[e];for(;e<7;e++)t._a[e]=s[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[$n]===24&&t._a[Zi]===0&&t._a[uo]===0&&t._a[Fl]===0&&(t._nextDay=!0,t._a[$n]=0),t._d=(t._useUTC?uf:sB).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[$n]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==r&&(vt(t).weekdayMismatch=!0)}}function ZB(t){var e,n,s,i,r,o,a,l,c;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(r=1,o=4,n=Kc(e.GG,t._a[gs],df(fn(),1,4).year),s=Kc(e.W,1),i=Kc(e.E,1),(i<1||i>7)&&(l=!0)):(r=t._locale._week.dow,o=t._locale._week.doy,c=df(fn(),r,o),n=Kc(e.gg,t._a[gs],c.year),s=Kc(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+r,(e.e<0||e.e>6)&&(l=!0)):i=r),s<1||s>yo(n,r,o)?vt(t)._overflowWeeks=!0:l!=null?vt(t)._overflowWeekday=!0:(a=f5(n,s,i,r,o),t._a[gs]=a.year,t._dayOfYear=a.dayOfYear)}Ue.ISO_8601=function(){};Ue.RFC_2822=function(){};function Fw(t){if(t._f===Ue.ISO_8601){v5(t);return}if(t._f===Ue.RFC_2822){y5(t);return}t._a=[],vt(t).empty=!0;var e=""+t._i,n,s,i,r,o,a=e.length,l=0,c,u;for(i=t5(t._f,t._locale).match(Tw)||[],u=i.length,n=0;n0&&vt(t).unusedInput.push(o),e=e.slice(e.indexOf(s)+s.length),l+=s.length),_u[r]?(s?vt(t).empty=!1:vt(t).unusedTokens.push(r),B$(r,s,t)):t._strict&&!s&&vt(t).unusedTokens.push(r);vt(t).charsLeftOver=a-l,e.length>0&&vt(t).unusedInput.push(e),t._a[$n]<=12&&vt(t).bigHour===!0&&t._a[$n]>0&&(vt(t).bigHour=void 0),vt(t).parsedDateParts=t._a.slice(0),vt(t).meridiem=t._meridiem,t._a[$n]=JB(t._locale,t._a[$n],t._meridiem),c=vt(t).era,c!==null&&(t._a[gs]=t._locale.erasConvertYear(c,t._a[gs])),Nw(t),Dw(t)}function JB(t,e,n){var s;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(s=t.isPM(n),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function QB(t){var e,n,s,i,r,o,a=!1,l=t._f.length;if(l===0){vt(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;ithis?this:t:z_()});function x5(t,e){var n,s;if(e.length===1&&nr(e[0])&&(e=e[0]),!e.length)return fn();for(n=e[0],s=1;sthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function bH(){if(!Fs(this._isDSTShifted))return this._isDSTShifted;var t={},e;return Sw(t,this),t=b5(t),t._a?(e=t._isUTC?Lr(t._a):fn(t._a),this._isDSTShifted=this.isValid()&&dH(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function wH(){return this.isValid()?!this._isUTC:!1}function xH(){return this.isValid()?this._isUTC:!1}function E5(){return this.isValid()?this._isUTC&&this._offset===0:!1}var SH=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,EH=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function or(t,e){var n=t,s=null,i,r,o;return Xm(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:Eo(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(s=SH.exec(t))?(i=s[1]==="-"?-1:1,n={y:0,d:kt(s[yr])*i,h:kt(s[$n])*i,m:kt(s[Zi])*i,s:kt(s[uo])*i,ms:kt(vy(s[Fl]*1e3))*i}):(s=EH.exec(t))?(i=s[1]==="-"?-1:1,n={y:ol(s[2],i),M:ol(s[3],i),w:ol(s[4],i),d:ol(s[5],i),h:ol(s[6],i),m:ol(s[7],i),s:ol(s[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(o=TH(fn(n.from),fn(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),r=new Z_(n),Xm(t)&&Dt(t,"_locale")&&(r._locale=t._locale),Xm(t)&&Dt(t,"_isValid")&&(r._isValid=t._isValid),r}or.fn=Z_.prototype;or.invalid=uH;function ol(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function fE(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function TH(t,e){var n;return t.isValid()&&e.isValid()?(e=$w(e,t),t.isBefore(e)?n=fE(t,e):(n=fE(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function T5(t,e){return function(n,s){var i,r;return s!==null&&!isNaN(+s)&&(e5(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=s,s=r),i=or(n,s),A5(this,i,t),this}}function A5(t,e,n,s){var i=e._milliseconds,r=vy(e._days),o=vy(e._months);t.isValid()&&(s=s??!0,o&&u5(t,cf(t,"Month")+o*n),r&&a5(t,"Date",cf(t,"Date")+r*n),i&&t._d.setTime(t._d.valueOf()+i*n),s&&Ue.updateOffset(t,r||o))}var AH=T5(1,"add"),MH=T5(-1,"subtract");function M5(t){return typeof t=="string"||t instanceof String}function RH(t){return sr(t)||qf(t)||M5(t)||Eo(t)||CH(t)||kH(t)||t===null||t===void 0}function kH(t){var e=Jl(t)&&!ww(t),n=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,r,o=s.length;for(i=0;in.valueOf():n.valueOf()9999?Ym(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Dr(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ym(n,"Z")):Ym(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function VH(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,s,i,r;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",r=e+'[")]',this.format(n+s+i+r)}function WH(t){t||(t=this.isUtc()?Ue.defaultFormatUtc:Ue.defaultFormat);var e=Ym(this,t);return this.localeData().postformat(e)}function jH(t,e){return this.isValid()&&(sr(t)&&t.isValid()||fn(t).isValid())?or({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function qH(t){return this.from(fn(),t)}function YH(t,e){return this.isValid()&&(sr(t)&&t.isValid()||fn(t).isValid())?or({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function XH(t){return this.to(fn(),t)}function R5(t){var e;return t===void 0?this._locale._abbr:(e=Lo(t),e!=null&&(this._locale=e),this)}var k5=Ci("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function C5(){return this._locale}var Pg=1e3,vu=60*Pg,Og=60*vu,P5=(365*400+97)*24*Og;function yu(t,e){return(t%e+e)%e}function O5(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-P5:new Date(t,e,n).valueOf()}function I5(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-P5:Date.UTC(t,e,n)}function KH(t){var e,n;if(t=Pi(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?I5:O5,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=yu(e+(this._isUTC?0:this.utcOffset()*vu),Og);break;case"minute":e=this._d.valueOf(),e-=yu(e,vu);break;case"second":e=this._d.valueOf(),e-=yu(e,Pg);break}return this._d.setTime(e),Ue.updateOffset(this,!0),this}function ZH(t){var e,n;if(t=Pi(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?I5:O5,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Og-yu(e+(this._isUTC?0:this.utcOffset()*vu),Og)-1;break;case"minute":e=this._d.valueOf(),e+=vu-yu(e,vu)-1;break;case"second":e=this._d.valueOf(),e+=Pg-yu(e,Pg)-1;break}return this._d.setTime(e),Ue.updateOffset(this,!0),this}function JH(){return this._d.valueOf()-(this._offset||0)*6e4}function QH(){return Math.floor(this.valueOf()/1e3)}function eG(){return new Date(this.valueOf())}function tG(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function nG(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function sG(){return this.isValid()?this.toISOString():null}function iG(){return xw(this)}function rG(){return ba({},vt(this))}function oG(){return vt(this).overflow}function aG(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}tt("N",0,0,"eraAbbr");tt("NN",0,0,"eraAbbr");tt("NNN",0,0,"eraAbbr");tt("NNNN",0,0,"eraName");tt("NNNNN",0,0,"eraNarrow");tt("y",["y",1],"yo","eraYear");tt("y",["yy",2],0,"eraYear");tt("y",["yyy",3],0,"eraYear");tt("y",["yyyy",4],0,"eraYear");je("N",Bw);je("NN",Bw);je("NNN",Bw);je("NNNN",vG);je("NNNNN",yG);Yt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,s){var i=n._locale.erasParse(t,s,n._strict);i?vt(n).era=i:vt(n).invalidEra=t});je("y",md);je("yy",md);je("yyy",md);je("yyyy",md);je("yo",bG);Yt(["y","yy","yyy","yyyy"],gs);Yt(["yo"],function(t,e,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[gs]=n._locale.eraYearOrdinalParse(t,i):e[gs]=parseInt(t,10)});function lG(t,e){var n,s,i,r=this._eras||Lo("en")._eras;for(n=0,s=r.length;n=0)return r[s]}function uG(t,e){var n=t.since<=t.until?1:-1;return e===void 0?Ue(t.since).year():Ue(t.since).year()+(e-t.offset)*n}function dG(){var t,e,n,s=this.localeData().eras();for(t=0,e=s.length;tr&&(e=r),MG.call(this,t,e,n,s,i))}function MG(t,e,n,s,i){var r=f5(t,e,n,s,i),o=uf(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}tt("Q",0,"Qo","quarter");je("Q",n5);Yt("Q",function(t,e){e[co]=(kt(t)-1)*3});function RG(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}tt("D",["DD",2],"Do","date");je("D",pn,gd);je("DD",pn,di);je("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Yt(["D","DD"],yr);Yt("Do",function(t,e){e[yr]=kt(t.match(pn)[0])});var D5=_d("Date",!0);tt("DDD",["DDDD",3],"DDDo","dayOfYear");je("DDD",W_);je("DDDD",s5);Yt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=kt(t)});function kG(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}tt("m",["mm",2],0,"minute");je("m",pn,kw);je("mm",pn,di);Yt(["m","mm"],Zi);var CG=_d("Minutes",!1);tt("s",["ss",2],0,"second");je("s",pn,kw);je("ss",pn,di);Yt(["s","ss"],uo);var PG=_d("Seconds",!1);tt("S",0,0,function(){return~~(this.millisecond()/100)});tt(0,["SS",2],0,function(){return~~(this.millisecond()/10)});tt(0,["SSS",3],0,"millisecond");tt(0,["SSSS",4],0,function(){return this.millisecond()*10});tt(0,["SSSSS",5],0,function(){return this.millisecond()*100});tt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});tt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});tt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});tt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});je("S",W_,n5);je("SS",W_,di);je("SSS",W_,s5);var wa,N5;for(wa="SSSS";wa.length<=9;wa+="S")je(wa,md);function OG(t,e){e[Fl]=kt(("0."+t)*1e3)}for(wa="S";wa.length<=9;wa+="S")Yt(wa,OG);N5=_d("Milliseconds",!1);tt("z",0,0,"zoneAbbr");tt("zz",0,0,"zoneName");function IG(){return this._isUTC?"UTC":""}function LG(){return this._isUTC?"Coordinated Universal Time":""}var De=Yf.prototype;De.add=AH;De.calendar=IH;De.clone=LH;De.diff=HH;De.endOf=ZH;De.format=WH;De.from=jH;De.fromNow=qH;De.to=YH;De.toNow=XH;De.get=V$;De.invalidAt=oG;De.isAfter=DH;De.isBefore=NH;De.isBetween=FH;De.isSame=UH;De.isSameOrAfter=$H;De.isSameOrBefore=BH;De.isValid=iG;De.lang=k5;De.locale=R5;De.localeData=C5;De.max=iH;De.min=sH;De.parsingFlags=rG;De.set=W$;De.startOf=KH;De.subtract=MH;De.toArray=tG;De.toObject=nG;De.toDate=eG;De.toISOString=zH;De.inspect=VH;typeof Symbol<"u"&&Symbol.for!=null&&(De[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});De.toJSON=sG;De.toString=GH;De.unix=QH;De.valueOf=JH;De.creationData=aG;De.eraName=dG;De.eraNarrow=hG;De.eraAbbr=fG;De.eraYear=pG;De.year=o5;De.isLeapYear=z$;De.weekYear=wG;De.isoWeekYear=xG;De.quarter=De.quarters=RG;De.month=d5;De.daysInMonth=eB;De.week=De.weeks=lB;De.isoWeek=De.isoWeeks=cB;De.weeksInYear=TG;De.weeksInWeekYear=AG;De.isoWeeksInYear=SG;De.isoWeeksInISOWeekYear=EG;De.date=D5;De.day=De.days=xB;De.weekday=SB;De.isoWeekday=EB;De.dayOfYear=kG;De.hour=De.hours=PB;De.minute=De.minutes=CG;De.second=De.seconds=PG;De.millisecond=De.milliseconds=N5;De.utcOffset=fH;De.utc=mH;De.local=gH;De.parseZone=_H;De.hasAlignedHourOffset=vH;De.isDST=yH;De.isLocal=wH;De.isUtcOffset=xH;De.isUtc=E5;De.isUTC=E5;De.zoneAbbr=IG;De.zoneName=LG;De.dates=Ci("dates accessor is deprecated. Use date instead.",D5);De.months=Ci("months accessor is deprecated. Use month instead",d5);De.years=Ci("years accessor is deprecated. Use year instead",o5);De.zone=Ci("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",pH);De.isDSTShifted=Ci("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",bH);function DG(t){return fn(t*1e3)}function NG(){return fn.apply(null,arguments).parseZone()}function F5(t){return t}var Ft=Ew.prototype;Ft.calendar=w$;Ft.longDateFormat=T$;Ft.invalidDate=M$;Ft.ordinal=C$;Ft.preparse=F5;Ft.postformat=F5;Ft.relativeTime=O$;Ft.pastFuture=I$;Ft.set=y$;Ft.eras=lG;Ft.erasParse=cG;Ft.erasConvertYear=uG;Ft.erasAbbrRegex=gG;Ft.erasNameRegex=mG;Ft.erasNarrowRegex=_G;Ft.months=K$;Ft.monthsShort=Z$;Ft.monthsParse=Q$;Ft.monthsRegex=nB;Ft.monthsShortRegex=tB;Ft.week=iB;Ft.firstDayOfYear=aB;Ft.firstDayOfWeek=oB;Ft.weekdays=_B;Ft.weekdaysMin=yB;Ft.weekdaysShort=vB;Ft.weekdaysParse=wB;Ft.weekdaysRegex=TB;Ft.weekdaysShortRegex=AB;Ft.weekdaysMinRegex=MB;Ft.isPM=kB;Ft.meridiem=OB;function Ig(t,e,n,s){var i=Lo(),r=Lr().set(s,e);return i[n](r,t)}function U5(t,e,n){if(Eo(t)&&(e=t,t=void 0),t=t||"",e!=null)return Ig(t,e,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=Ig(t,s,n,"month");return i}function Gw(t,e,n,s){typeof t=="boolean"?(Eo(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,Eo(e)&&(n=e,e=void 0),e=e||"");var i=Lo(),r=t?i._week.dow:0,o,a=[];if(n!=null)return Ig(e,(n+r)%7,s,"day");for(o=0;o<7;o++)a[o]=Ig(e,(o+r)%7,s,"day");return a}function FG(t,e){return U5(t,e,"months")}function UG(t,e){return U5(t,e,"monthsShort")}function $G(t,e,n){return Gw(t,e,n,"weekdays")}function BG(t,e,n){return Gw(t,e,n,"weekdaysShort")}function HG(t,e,n){return Gw(t,e,n,"weekdaysMin")}Ca("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=kt(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});Ue.lang=Ci("moment.lang is deprecated. Use moment.locale instead.",Ca);Ue.langData=Ci("moment.langData is deprecated. Use moment.localeData instead.",Lo);var Gr=Math.abs;function GG(){var t=this._data;return this._milliseconds=Gr(this._milliseconds),this._days=Gr(this._days),this._months=Gr(this._months),t.milliseconds=Gr(t.milliseconds),t.seconds=Gr(t.seconds),t.minutes=Gr(t.minutes),t.hours=Gr(t.hours),t.months=Gr(t.months),t.years=Gr(t.years),this}function $5(t,e,n,s){var i=or(e,n);return t._milliseconds+=s*i._milliseconds,t._days+=s*i._days,t._months+=s*i._months,t._bubble()}function zG(t,e){return $5(this,t,e,1)}function VG(t,e){return $5(this,t,e,-1)}function pE(t){return t<0?Math.floor(t):Math.ceil(t)}function WG(){var t=this._milliseconds,e=this._days,n=this._months,s=this._data,i,r,o,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=pE(by(n)+e)*864e5,e=0,n=0),s.milliseconds=t%1e3,i=wi(t/1e3),s.seconds=i%60,r=wi(i/60),s.minutes=r%60,o=wi(r/60),s.hours=o%24,e+=wi(o/24),l=wi(B5(e)),n+=l,e-=pE(by(l)),a=wi(n/12),n%=12,s.days=e,s.months=n,s.years=a,this}function B5(t){return t*4800/146097}function by(t){return t*146097/4800}function jG(t){if(!this.isValid())return NaN;var e,n,s=this._milliseconds;if(t=Pi(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+s/864e5,n=this._months+B5(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(by(this._months)),t){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+t)}}function Do(t){return function(){return this.as(t)}}var H5=Do("ms"),qG=Do("s"),YG=Do("m"),XG=Do("h"),KG=Do("d"),ZG=Do("w"),JG=Do("M"),QG=Do("Q"),ez=Do("y"),tz=H5;function nz(){return or(this)}function sz(t){return t=Pi(t),this.isValid()?this[t+"s"]():NaN}function hc(t){return function(){return this.isValid()?this._data[t]:NaN}}var iz=hc("milliseconds"),rz=hc("seconds"),oz=hc("minutes"),az=hc("hours"),lz=hc("days"),cz=hc("months"),uz=hc("years");function dz(){return wi(this.days()/7)}var no=Math.round,Qc={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function hz(t,e,n,s,i){return i.relativeTime(e||1,!!n,t,s)}function fz(t,e,n,s){var i=or(t).abs(),r=no(i.as("s")),o=no(i.as("m")),a=no(i.as("h")),l=no(i.as("d")),c=no(i.as("M")),u=no(i.as("w")),d=no(i.as("y")),h=r<=n.ss&&["s",r]||r0,h[4]=s,hz.apply(null,h)}function pz(t){return t===void 0?no:typeof t=="function"?(no=t,!0):!1}function mz(t,e){return Qc[t]===void 0?!1:e===void 0?Qc[t]:(Qc[t]=e,t==="s"&&(Qc.ss=e-1),!0)}function gz(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=Qc,i,r;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(s=Object.assign({},Qc,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),i=this.localeData(),r=fz(this,!n,s,i),n&&(r=i.pastFuture(+this,r)),i.postformat(r)}var _1=Math.abs;function wc(t){return(t>0)-(t<0)||+t}function Q_(){if(!this.isValid())return this.localeData().invalidDate();var t=_1(this._milliseconds)/1e3,e=_1(this._days),n=_1(this._months),s,i,r,o,a=this.asSeconds(),l,c,u,d;return a?(s=wi(t/60),i=wi(s/60),t%=60,s%=60,r=wi(n/12),n%=12,o=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=wc(this._months)!==wc(a)?"-":"",u=wc(this._days)!==wc(a)?"-":"",d=wc(this._milliseconds)!==wc(a)?"-":"",l+"P"+(r?c+r+"Y":"")+(n?c+n+"M":"")+(e?u+e+"D":"")+(i||s||t?"T":"")+(i?d+i+"H":"")+(s?d+s+"M":"")+(t?d+o+"S":"")):"P0D"}var Pt=Z_.prototype;Pt.isValid=cH;Pt.abs=GG;Pt.add=zG;Pt.subtract=VG;Pt.as=jG;Pt.asMilliseconds=H5;Pt.asSeconds=qG;Pt.asMinutes=YG;Pt.asHours=XG;Pt.asDays=KG;Pt.asWeeks=ZG;Pt.asMonths=JG;Pt.asQuarters=QG;Pt.asYears=ez;Pt.valueOf=tz;Pt._bubble=WG;Pt.clone=nz;Pt.get=sz;Pt.milliseconds=iz;Pt.seconds=rz;Pt.minutes=oz;Pt.hours=az;Pt.days=lz;Pt.weeks=dz;Pt.months=cz;Pt.years=uz;Pt.humanize=gz;Pt.toISOString=Q_;Pt.toString=Q_;Pt.toJSON=Q_;Pt.locale=R5;Pt.localeData=C5;Pt.toIsoString=Ci("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Q_);Pt.lang=k5;tt("X",0,0,"unix");tt("x",0,0,"valueOf");je("x",q_);je("X",F$);Yt("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});Yt("x",function(t,e,n){n._d=new Date(kt(t))});//! moment.js +Ue.version="2.30.1";_$(fn);Ue.fn=De;Ue.min=rH;Ue.max=oH;Ue.now=aH;Ue.utc=Lr;Ue.unix=DG;Ue.months=FG;Ue.isDate=qf;Ue.locale=Ca;Ue.invalid=z_;Ue.duration=or;Ue.isMoment=sr;Ue.weekdays=$G;Ue.parseZone=NG;Ue.localeData=Lo;Ue.isDuration=Xm;Ue.monthsShort=UG;Ue.weekdaysMin=HG;Ue.defineLocale=Lw;Ue.updateLocale=NB;Ue.locales=FB;Ue.weekdaysShort=BG;Ue.normalizeUnits=Pi;Ue.relativeTimeRounding=pz;Ue.relativeTimeThreshold=mz;Ue.calendarFormat=OH;Ue.prototype=De;Ue.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function _z(t){return Ue(t).fromNow()}function vz(t,e=!1,n=1){const s=e?1e3:1024;if(Math.abs(t)=s&&r!!t&&typeof t=="object"&&t[ki]===zw,yd=t=>!!t&&typeof t=="object"&&t[ki]===wy,bd=t=>!!t&&typeof t=="object"&&t[ki]===Pa,bn=t=>!!t&&typeof t=="object"&&t[ki]===G5,nn=t=>!!t&&typeof t=="object"&&t[ki]===To,wd=t=>!!t&&typeof t=="object"&&t[ki]===vd;function wn(t){if(t&&typeof t=="object")switch(t[ki]){case Pa:case vd:return!0}return!1}function Cn(t){if(t&&typeof t=="object")switch(t[ki]){case zw:case Pa:case To:case vd:return!0}return!1}const yz=t=>(nn(t)||wn(t))&&!!t.anchor,Bs=Symbol("break visit"),z5=Symbol("skip children"),Ar=Symbol("remove node");function Fa(t,e){const n=V5(e);yd(t)?eu(null,t.contents,n,Object.freeze([t]))===Ar&&(t.contents=null):eu(null,t,n,Object.freeze([]))}Fa.BREAK=Bs;Fa.SKIP=z5;Fa.REMOVE=Ar;function eu(t,e,n,s){const i=W5(t,e,n,s);if(Cn(i)||bn(i))return j5(t,s,i),eu(t,i,n,s);if(typeof i!="symbol"){if(wn(e)){s=Object.freeze(s.concat(e));for(let r=0;rt.replace(/[!,[\]{}]/g,e=>bz[e]);class As{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},As.defaultYaml,e),this.tags=Object.assign({},As.defaultTags,n)}clone(){const e=new As(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new As(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:As.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},As.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:As.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},As.defaultTags),this.atNextDocument=!1);const s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return n(String(o)),null}return s==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,s]of Object.entries(this.tags))if(e.startsWith(s))return n+wz(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(e&&s.length>0&&Cn(e.contents)){const r={};Fa(e.contents,(o,a)=>{Cn(a)&&a.tag&&(r[a.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(` +`)}}As.defaultYaml={explicit:!1,version:"1.2"};As.defaultTags={"!!":"tag:yaml.org,2002:"};function q5(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function Y5(t){const e=new Set;return Fa(t,{Value(n,s){s.anchor&&e.add(s.anchor)}}),e}function X5(t,e){for(let n=1;;++n){const s=`${t}${n}`;if(!e.has(s))return s}}function xz(t,e){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=Y5(t));const o=X5(e,i);return i.add(o),o},setAnchors:()=>{for(const r of n){const o=s.get(r);if(typeof o=="object"&&o.anchor&&(nn(o.node)||wn(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:s}}function nu(t,e,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;iMi(s,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!yz(t))return t.toJSON(e,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(t,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class Vw{constructor(e){Object.defineProperty(this,ki,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!yd(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Mi(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof r=="function"?nu(r,{"":a},"",a):a}}class t0 extends Vw{constructor(e){super(zw),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return Fa(e,{Node:(s,i)=>{if(i===this)return Fa.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(e,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=s.get(o);if(a||(Mi(o,null,n),a=s.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Zm(i,o,s)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,s){const i=`*${this.source}`;if(e){if(q5(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}}function Zm(t,e,n){if(fc(e)){const s=e.resolve(t),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(wn(e)){let s=0;for(const i of e.items){const r=Zm(t,i,n);r>s&&(s=r)}return s}else if(bn(e)){const s=Zm(t,e.key,n),i=Zm(t,e.value,n);return Math.max(s,i)}return 1}const K5=t=>!t||typeof t!="function"&&typeof t!="object";class gt extends Vw{constructor(e){super(To),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:Mi(this.value,e,n)}toString(){return String(this.value)}}gt.BLOCK_FOLDED="BLOCK_FOLDED";gt.BLOCK_LITERAL="BLOCK_LITERAL";gt.PLAIN="PLAIN";gt.QUOTE_DOUBLE="QUOTE_DOUBLE";gt.QUOTE_SINGLE="QUOTE_SINGLE";const Sz="tag:yaml.org,2002:";function Ez(t,e,n){if(e){const s=n.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(s=>{var i;return((i=s.identify)==null?void 0:i.call(s,t))&&!s.format})}function ff(t,e,n){var d,h,f;if(yd(t)&&(t=t.contents),Cn(t))return t;if(bn(t)){const v=(h=(d=n.schema[Pa]).createNode)==null?void 0:h.call(d,n.schema,null,n);return v.items.push(t),v}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:a}=n;let l;if(s&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor||(l.anchor=i(t)),new t0(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=Sz+e.slice(2));let c=Ez(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const v=new gt(t);return l&&(l.node=v),v}c=t instanceof Map?o[Pa]:Symbol.iterator in Object(t)?o[vd]:o[Pa]}r&&(r(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,t,n):typeof((f=c==null?void 0:c.nodeClass)==null?void 0:f.from)=="function"?c.nodeClass.from(n.schema,t,n):new gt(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function Lg(t,e,n){let s=n;for(let i=e.length-1;i>=0;--i){const r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return ff(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const vh=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;let Ww=class extends Vw{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(s=>Cn(s)||bn(s)?s.clone(e):s),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(vh(e))this.add(n);else{const[s,...i]=e,r=this.get(s,!0);if(wn(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,Lg(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){const[n,...s]=e;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(wn(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(e,n){const[s,...i]=e,r=this.get(s,!0);return i.length===0?!n&&nn(r)?r.value:r:wn(r)?r.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!bn(n))return!1;const s=n.value;return s==null||e&&nn(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){const[n,...s]=e;if(s.length===0)return this.has(n);const i=this.get(n,!0);return wn(i)?i.hasIn(s):!1}setIn(e,n){const[s,...i]=e;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(wn(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,Lg(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};Ww.maxFlowStringSingleLineLength=60;const Tz=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ho(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Ul=(t,e,n)=>t.endsWith(` +`)?ho(n,e):n.includes(` +`)?` +`+ho(n,e):(t.endsWith(" ")?"":" ")+n,Z5="flow",xy="block",Jm="quoted";function n0(t,e,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return t;const l=Math.max(1+r,1+i-e.length);if(t.length<=l)return t;const c=[],u={};let d=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?c.push(0):d=i-s);let h,f,v=!1,_=-1,m=-1,g=-1;n===xy&&(_=mE(t,_,e.length),_!==-1&&(d=_+l));for(let b;b=t[_+=1];){if(n===Jm&&b==="\\"){switch(m=_,t[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}g=_}if(b===` +`)n===xy&&(_=mE(t,_,e.length)),d=_+e.length+l,h=void 0;else{if(b===" "&&f&&f!==" "&&f!==` +`&&f!==" "){const w=t[_+1];w&&w!==" "&&w!==` +`&&w!==" "&&(h=_)}if(_>=d)if(h)c.push(h),d=h+l,h=void 0;else if(n===Jm){for(;f===" "||f===" ";)f=b,b=t[_+=1],v=!0;const w=_>g+1?_-2:m-1;if(u[w])return t;c.push(w),u[w]=!0,d=w+l,h=void 0}else v=!0}f=b}if(v&&a&&a(),c.length===0)return t;o&&o();let y=t.slice(0,c[0]);for(let b=0;b({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),i0=t=>/^(%|---|\.\.\.)/m.test(t);function Az(t,e,n){if(!e||e<0)return!1;const s=e-n,i=t.length;if(i<=s)return!1;for(let r=0,o=0;rs)return!0;if(o=r+1,i-o<=s)return!1}return!0}function $h(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(i0(t)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const u=n.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||n[l+2]==='"'||n.length +`;let d,h;for(h=n.length;h>0;--h){const x=n[h-1];if(x!==` +`&&x!==" "&&x!==" ")break}let f=n.substring(h);const v=f.indexOf(` +`);v===-1?d="-":n===f||v!==f.length-1?(d="+",r&&r()):d="",f&&(n=n.slice(0,-f.length),f[f.length-1]===` +`&&(f=f.slice(0,-1)),f=f.replace(Ey,`$&${c}`));let _=!1,m,g=-1;for(m=0;m")+(_?c?"2":"1":"")+d;if(t&&(w+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),u)return n=n.replace(/\n+/g,`$&${c}`),`${w} +${c}${y}${n}${f}`;n=n.replace(/\n+/g,` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);const T=n0(`${y}${n}${f}`,c,xy,s0(s,!0));return`${w} +${c}${T}`}function Mz(t,e,n,s){const{type:i,value:r}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&r.includes(` +`)||u&&/[[\]{},]/.test(r))return su(r,e);if(!r||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||u||!r.includes(` +`)?su(r,e):Qm(t,e,n,s);if(!a&&!u&&i!==gt.PLAIN&&r.includes(` +`))return Qm(t,e,n,s);if(i0(r)){if(l==="")return e.forceBlockIndent=!0,Qm(t,e,n,s);if(a&&l===c)return su(r,e)}const d=r.replace(/\n+/g,`$& +${l}`);if(o){const h=_=>{var m;return _.default&&_.tag!=="tag:yaml.org,2002:str"&&((m=_.test)==null?void 0:m.test(d))},{compat:f,tags:v}=e.doc.schema;if(v.some(h)||f!=null&&f.some(h))return su(r,e)}return a?d:n0(d,l,Z5,s0(e,!1))}function Zf(t,e,n,s){const{implicitKey:i,inFlow:r}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==gt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=gt.QUOTE_DOUBLE);const l=u=>{switch(u){case gt.BLOCK_FOLDED:case gt.BLOCK_LITERAL:return i||r?su(o.value,e):Qm(o,e,n,s);case gt.QUOTE_DOUBLE:return $h(o.value,e);case gt.QUOTE_SINGLE:return Sy(o.value,e);case gt.PLAIN:return Mz(o,e,n,s);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:u,defaultStringType:d}=e.options,h=i&&u||d;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function J5(t,e){const n=Object.assign({blockQuote:!0,commentString:Tz,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Rz(t,e){var i;if(e.tag){const r=t.filter(o=>o.tag===e.tag);if(r.length>0)return r.find(o=>o.format===e.format)??r[0]}let n,s;if(nn(e)){s=e.value;const r=t.filter(o=>{var a;return(a=o.identify)==null?void 0:a.call(o,s)});n=r.find(o=>o.format===e.format)??r.find(o=>!o.format)}else s=e,n=t.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){const r=((i=s==null?void 0:s.constructor)==null?void 0:i.name)??typeof s;throw new Error(`Tag not resolved for ${r} value`)}return n}function kz(t,e,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(nn(t)||wn(t))&&t.anchor;r&&q5(r)&&(n.add(r),i.push(`&${r}`));const o=t.tag?t.tag:e.default?null:e.tag;return o&&i.push(s.directives.tagString(o)),i.join(" ")}function Wu(t,e,n,s){var l;if(bn(t))return t.toString(e,n,s);if(fc(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const r=Cn(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i||(i=Rz(e.doc.schema.tags,r));const o=kz(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(r,e,n,s):nn(r)?Zf(r,e,n,s):r.toString(e,n,s);return o?nn(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} +${e.indent}${a}`:a}function Cz({key:t,value:e},n,s,i){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=n;let h=Cn(t)&&t.comment||null;if(d){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(wn(t)){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let f=!d&&(!t||h&&e==null&&!n.inFlow||wn(t)||(nn(t)?t.type===gt.BLOCK_FOLDED||t.type===gt.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(d||!r),indent:a+l});let v=!1,_=!1,m=Wu(t,n,()=>v=!0,()=>_=!0);if(!f&&!n.inFlow&&m.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(r||e==null)return v&&s&&s(),m===""?"?":f?`? ${m}`:m}else if(r&&!d||e==null&&f)return m=`? ${m}`,h&&!v?m+=Ul(m,n.indent,c(h)):_&&i&&i(),m;v&&(h=null),f?(h&&(m+=Ul(m,n.indent,c(h))),m=`? ${m} +${a}:`):(m=`${m}:`,h&&(m+=Ul(m,n.indent,c(h))));let g,y,b;Cn(e)?(g=!!e.spaceBefore,y=e.commentBefore,b=e.comment):(g=!1,y=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!f&&!h&&nn(e)&&(n.indentAtStart=m.length+1),_=!1,!u&&l.length>=2&&!n.inFlow&&!f&&wd(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let w=!1;const T=Wu(e,n,()=>w=!0,()=>_=!0);let x=" ";if(h||g||y){if(x=g?` +`:"",y){const A=c(y);x+=` +${ho(A,n.indent)}`}T===""&&!n.inFlow?x===` +`&&(x=` + +`):x+=` +${n.indent}`}else if(!f&&wn(e)){const A=T[0],M=T.indexOf(` +`),E=M!==-1,S=n.inFlow??e.flow??e.items.length===0;if(E||!S){let P=!1;if(E&&(A==="&"||A==="!")){let D=T.indexOf(" ");A==="&"&&D!==-1&&Dt===gE||nn(t)&&t.value===gE&&(!t.type||t.type===gt.PLAIN);function v1(t,e,n){const s=t&&fc(n)?n.resolve(t.doc):n;if(!bd(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,t,Map);for(const[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Oz(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Cn(t)&&(n!=null&&n.doc)){const s=J5(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=t.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Q5(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}function jw(t,e,n){const s=ff(t,void 0,n),i=ff(e,void 0,n);return new _s(s,i)}class _s{constructor(e,n=null){Object.defineProperty(this,ki,{value:G5}),this.key=e,this.value=n}clone(e){let{key:n,value:s}=this;return Cn(n)&&(n=n.clone(e)),Cn(s)&&(s=s.clone(e)),new _s(n,s)}toJSON(e,n){const s=n!=null&&n.mapAsMap?new Map:{};return eC(n,s,this)}toString(e,n,s){return e!=null&&e.doc?Cz(this,e,n,s):JSON.stringify(this)}}function tC(t,e,n){return(e.inFlow??t.flow?Lz:Iz)(t,e,n)}function Iz({comment:t,items:e},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:r,type:null});let d=!1;const h=[];for(let v=0;vm=null,()=>d=!0);m&&(g+=Ul(g,r,c(m))),d&&m&&(d=!1),h.push(s+g)}let f;if(h.length===0)f=i.start+i.end;else{f=h[0];for(let v=1;vm=null);vu||g.includes(` +`))&&(c=!0),d.push(g),u=d.length}const{start:h,end:f}=n;if(d.length===0)return h+f;if(!c){const v=d.reduce((_,m)=>_+m.length+2,2);c=e.options.lineWidth>0&&v>e.options.lineWidth}if(c){let v=h;for(const _ of d)v+=_?` +${r}${i}${_}`:` +`;return`${v} +${i}${f}`}else return`${h}${o}${d.join(" ")}${o}${f}`}function Dg({indent:t,options:{commentString:e}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=ho(e(s),t);n.push(r.trimStart())}}function $l(t,e){const n=nn(e)?e.value:e;for(const s of t)if(bn(s)&&(s.key===e||s.key===n||nn(s.key)&&s.key.value===n))return s}class ri extends Ww{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Pa,e),this.items=[]}static from(e,n,s){const{keepUndefined:i,replacer:r}=s,o=new this(e),a=(l,c)=>{if(typeof r=="function")c=r.call(n,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||i)&&o.items.push(jw(l,c,s))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){var o;let s;bn(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new _s(e,e==null?void 0:e.value):s=new _s(e.key,e.value);const i=$l(this.items,s.key),r=(o=this.schema)==null?void 0:o.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);nn(i.value)&&K5(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const a=this.items.findIndex(l=>r(s,l)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(e){const n=$l(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const s=$l(this.items,e),i=s==null?void 0:s.value;return(!n&&nn(i)?i.value:i)??void 0}has(e){return!!$l(this.items,e)}set(e,n){this.add(new _s(e,n),!0)}toJSON(e,n,s){const i=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items)eC(n,i,r);return i}toString(e,n,s){if(!e)return JSON.stringify(this);for(const i of this.items)if(!bn(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),tC(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:n})}}const xd={collection:"map",default:!0,nodeClass:ri,tag:"tag:yaml.org,2002:map",resolve(t,e){return bd(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>ri.from(t,e,n)};class Ua extends Ww{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(vd,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Ap(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const s=Ap(e);if(typeof s!="number")return;const i=this.items[s];return!n&&nn(i)?i.value:i}has(e){const n=Ap(e);return typeof n=="number"&&n=0?e:null}const Sd={collection:"seq",default:!0,nodeClass:Ua,tag:"tag:yaml.org,2002:seq",resolve(t,e){return wd(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ua.from(t,e,n)},r0={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,s){return e=Object.assign({actualString:!0},e),Zf(t,e,n,s)}},o0={identify:t=>t==null,createNode:()=>new gt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new gt(null),stringify:({source:t},e)=>typeof t=="string"&&o0.test.test(t)?t:e.options.nullStr},qw={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new gt(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&qw.test.test(t)){const s=t[0]==="t"||t[0]==="T";if(e===s)return t}return e?n.options.trueStr:n.options.falseStr}};function ar({format:t,minFractionDigits:e,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(s);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(r)){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=e-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const nC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ar},sC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ar(t)}},iC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new gt(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ar},a0=t=>typeof t=="bigint"||Number.isInteger(t),Yw=(t,e,n,{intAsBigInt:s})=>s?BigInt(t):parseInt(t.substring(e),n);function rC(t,e,n){const{value:s}=t;return a0(s)&&s>=0?n+s.toString(e):ar(t)}const oC={identify:t=>a0(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Yw(t,2,8,n),stringify:t=>rC(t,8,"0o")},aC={identify:a0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Yw(t,0,10,n),stringify:ar},lC={identify:t=>a0(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Yw(t,2,16,n),stringify:t=>rC(t,16,"0x")},Dz=[xd,Sd,r0,o0,qw,oC,aC,lC,nC,sC,iC];function _E(t){return typeof t=="bigint"||Number.isInteger(t)}const Mp=({value:t})=>JSON.stringify(t),Nz=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Mp},{identify:t=>t==null,createNode:()=>new gt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Mp},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:Mp},{identify:_E,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>_E(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Mp}],Fz={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Uz=[xd,Sd].concat(Nz,Fz),Xw={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i1&&e("Each pair must have its own sequence indicator");const i=s.items[0]||new _s(new gt(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore} +${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment} +${r.comment}`:s.comment}s=i}t.items[n]=bn(s)?s:new _s(s)}}else e("Expected a sequence for this tag");return t}function uC(t,e,n){const{replacer:s}=n,i=new Ua(t);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(jw(a,l,n))}return i}const Kw={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cC,createNode:uC};class bu extends Ua{constructor(){super(),this.add=ri.prototype.add.bind(this),this.delete=ri.prototype.delete.bind(this),this.get=ri.prototype.get.bind(this),this.has=ri.prototype.has.bind(this),this.set=ri.prototype.set.bind(this),this.tag=bu.tag}toJSON(e,n){if(!n)return super.toJSON(e);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items){let r,o;if(bn(i)?(r=Mi(i.key,"",n),o=Mi(i.value,r,n)):r=Mi(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,n,s){const i=uC(e,n,s),r=new this;return r.items=i.items,r}}bu.tag="tag:yaml.org,2002:omap";const Zw={collection:"seq",identify:t=>t instanceof Map,nodeClass:bu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=cC(t,e),s=[];for(const{key:i}of n.items)nn(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new bu,n)},createNode:(t,e,n)=>bu.from(t,e,n)};function dC({value:t,source:e},n){return e&&(t?hC:fC).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const hC={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new gt(!0),stringify:dC},fC={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new gt(!1),stringify:dC},$z={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ar},Bz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ar(t)}},Hz={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new gt(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const s=t.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:ar},Jf=t=>typeof t=="bigint"||Number.isInteger(t);function l0(t,e,n,{intAsBigInt:s}){const i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),s){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return i==="-"?BigInt(-1)*o:o}const r=parseInt(t,n);return i==="-"?-1*r:r}function Jw(t,e,n){const{value:s}=t;if(Jf(s)){const i=s.toString(e);return s<0?"-"+n+i.substr(1):n+i}return ar(t)}const Gz={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>l0(t,2,2,n),stringify:t=>Jw(t,2,"0b")},zz={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>l0(t,1,8,n),stringify:t=>Jw(t,8,"0")},Vz={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>l0(t,0,10,n),stringify:ar},Wz={identify:Jf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>l0(t,2,16,n),stringify:t=>Jw(t,16,"0x")};class wu extends ri{constructor(e){super(e),this.tag=wu.tag}add(e){let n;bn(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new _s(e.key,null):n=new _s(e,null),$l(this.items,n.key)||this.items.push(n)}get(e,n){const s=$l(this.items,e);return!n&&bn(s)?nn(s.key)?s.key.value:s.key:s}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=$l(this.items,e);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new _s(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(e,n,s){const{replacer:i}=s,r=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),r.items.push(jw(o,null,s));return r}}wu.tag="tag:yaml.org,2002:set";const Qw={collection:"map",identify:t=>t instanceof Set,nodeClass:wu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>wu.from(t,e,n),resolve(t,e){if(bd(t)){if(t.hasAllNullValues(!0))return Object.assign(new wu,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function ex(t,e){const n=t[0],s=n==="-"||n==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),r=s.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return n==="-"?i(-1)*r:r}function pC(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ar(t);let s="";e<0&&(s="-",e*=n(-1));const i=n(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const mC={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>ex(t,n),stringify:pC},gC={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>ex(t,!1),stringify:pC},c0={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(c0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(n,s-1,i,r||0,o||0,a||0,l);const u=e[8];if(u&&u!=="Z"){let d=ex(u,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},vE=[xd,Sd,r0,o0,hC,fC,Gz,zz,Vz,Wz,$z,Bz,Hz,Xw,Zw,Kw,Qw,mC,gC,c0],yE=new Map([["core",Dz],["failsafe",[xd,Sd,r0]],["json",Uz],["yaml11",vE],["yaml-1.1",vE]]),bE={binary:Xw,bool:qw,float:iC,floatExp:sC,floatNaN:nC,floatTime:gC,int:aC,intHex:lC,intOct:oC,intTime:mC,map:xd,null:o0,omap:Zw,pairs:Kw,seq:Sd,set:Qw,timestamp:c0},jz={"tag:yaml.org,2002:binary":Xw,"tag:yaml.org,2002:omap":Zw,"tag:yaml.org,2002:pairs":Kw,"tag:yaml.org,2002:set":Qw,"tag:yaml.org,2002:timestamp":c0};function y1(t,e){let n=yE.get(e);if(!n)if(Array.isArray(t))n=[];else{const s=Array.from(yE.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(const s of t)n=n.concat(s);else typeof t=="function"&&(n=t(n.slice()));return n.map(s=>{if(typeof s!="string")return s;const i=bE[s];if(i)return i;const r=Object.keys(bE).map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown custom tag "${s}"; use one of ${r}`)})}const qz=(t,e)=>t.keye.key?1:0;class u0{constructor({compat:e,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?y1(e,"compat"):e?y1(null,e):null,this.merge=!!s,this.name=typeof r=="string"&&r||"core",this.knownTags=i?jz:{},this.tags=y1(n,this.name),this.toStringOptions=a??null,Object.defineProperty(this,Pa,{value:xd}),Object.defineProperty(this,To,{value:r0}),Object.defineProperty(this,vd,{value:Sd}),this.sortMapEntries=typeof o=="function"?o:o===!0?qz:null}clone(){const e=Object.create(u0.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Yz(t,e){var l;const n=[];let s=e.directives===!0;if(e.directives!==!1&&t.directives){const c=t.directives.toString(t);c?(n.push(c),s=!0):t.directives.docStart&&(s=!0)}s&&n.push("---");const i=J5(t,e),{commentString:r}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");const c=r(t.commentBefore);n.unshift(ho(c,""))}let o=!1,a=null;if(t.contents){if(Cn(t.contents)){if(t.contents.spaceBefore&&s&&n.push(""),t.contents.commentBefore){const d=r(t.contents.commentBefore);n.push(ho(d,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}const c=a?void 0:()=>o=!0;let u=Wu(t.contents,i,()=>a=null,c);a&&(u+=Ul(u,"",r(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(Wu(t.contents,i));if((l=t.directives)!=null&&l.docEnd)if(t.comment){const c=r(t.comment);c.includes(` +`)?(n.push("..."),n.push(ho(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(ho(r(c),"")))}return n.join(` +`)+` +`}class Ed{constructor(e,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ki,{value:wy});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new As({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){const e=Object.create(Ed.prototype,{[ki]:{value:wy}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Cn(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){xc(this.contents)&&this.contents.add(e)}addIn(e,n){xc(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const s=Y5(this);e.anchor=!n||s.has(n)?X5(n||"a",s):n}return new t0(e.anchor)}createNode(e,n,s){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){const m=y=>typeof y=="number"||y instanceof String||y instanceof Number,g=n.filter(m).map(String);g.length>0&&(n=n.concat(g)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=s??{},{onAnchor:d,setAnchors:h,sourceObjects:f}=xz(this,o||"a"),v={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:f},_=ff(e,u,v);return a&&wn(_)&&(_.flow=!0),h(),_}createPair(e,n,s={}){const i=this.createNode(e,null,s),r=this.createNode(n,null,s);return new _s(i,r)}delete(e){return xc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return vh(e)?this.contents==null?!1:(this.contents=null,!0):xc(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return wn(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return vh(e)?!n&&nn(this.contents)?this.contents.value:this.contents:wn(this.contents)?this.contents.getIn(e,n):void 0}has(e){return wn(this.contents)?this.contents.has(e):!1}hasIn(e){return vh(e)?this.contents!==void 0:wn(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Lg(this.schema,[e],n):xc(this.contents)&&this.contents.set(e,n)}setIn(e,n){vh(e)?this.contents=n:this.contents==null?this.contents=Lg(this.schema,Array.from(e),n):xc(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new As({version:"1.1"}),s={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new As({version:e}),s={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new u0(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Mi(this.contents,n??"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof o=="function"?nu(o,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Yz(this,e)}}function xc(t){if(wn(t))return!0;throw new Error("Expected a YAML collection as document contents")}class tx extends Error{constructor(e,n,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=n}}class Bl extends tx{constructor(e,n,s){super("YAMLParseError",e,n,s)}}class _C extends tx{constructor(e,n,s){super("YAMLWarning",e,n,s)}}const Ng=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,o=t.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let a=t.substring(e.lineStarts[s-2],e.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`… +`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];l&&l.line===s&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-r)));const c=" ".repeat(r)+"^".repeat(a);n.message+=`: + +${o} +${c} +`}};function ju(t,{flow:e,indicator:n,next:s,offset:i,onError:r,startOnNewline:o}){let a=!1,l=o,c=o,u="",d="",h=!1,f=!1,v=!1,_=null,m=null,g=null,y=null,b=null;for(const x of t)switch(v&&(x.type!=="space"&&x.type!=="newline"&&x.type!=="comma"&&r(x.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=!1),x.type){case"space":!e&&l&&n!=="doc-start"&&x.source[0]===" "&&r(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),c=!0;break;case"comment":{c||r(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const A=x.source.substring(1)||" ";u?u+=d+A:u=A,d="",l=!1;break}case"newline":l?u?u+=x.source:a=!0:d+=x.source,l=!0,h=!0,(_||m)&&(f=!0),c=!0;break;case"anchor":_&&r(x,"MULTIPLE_ANCHORS","A node can have at most one anchor"),x.source.endsWith(":")&&r(x.offset+x.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),_=x,b===null&&(b=x.offset),l=!1,c=!1,v=!0;break;case"tag":{m&&r(x,"MULTIPLE_TAGS","A node can have at most one tag"),m=x,b===null&&(b=x.offset),l=!1,c=!1,v=!0;break}case n:(_||m)&&r(x,"BAD_PROP_ORDER",`Anchors and tags must be after the ${x.source} indicator`),y&&r(x,"UNEXPECTED_TOKEN",`Unexpected ${x.source} in ${e??"collection"}`),y=x,l=!1,c=!1;break;case"comma":if(e){g&&r(x,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),g=x,l=!1,c=!1;break}default:r(x,"UNEXPECTED_TOKEN",`Unexpected ${x.type} token`),l=!1,c=!1}const w=t[t.length-1],T=w?w.offset+w.source.length:i;return v&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:g,found:y,spaceBefore:a,comment:u,hasNewline:h,hasNewlineAfterProp:f,anchor:_,tag:m,end:T,start:b??T}}function pf(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(pf(e.key)||pf(e.value))return!0}return!1;default:return!0}}function Ty(t,e,n){if((e==null?void 0:e.type)==="flow-collection"){const s=e.end[0];s.indent===t&&(s.source==="]"||s.source==="}")&&pf(e)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function vC(t,e,n){const{uniqueKeys:s}=t.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,o)=>r===o||nn(r)&&nn(o)&&r.value===o.value&&!(r.value==="<<"&&t.schema.merge);return e.some(r=>i(r.key,n))}const wE="All mapping items must start at the same column";function Xz({composeNode:t,composeEmptyNode:e},n,s,i,r){var u;const o=(r==null?void 0:r.nodeClass)??ri,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(const d of s.items){const{start:h,key:f,sep:v,value:_}=d,m=ju(h,{indicator:"explicit-key-ind",next:f??(v==null?void 0:v[0]),offset:l,onError:i,startOnNewline:!0}),g=!m.found;if(g){if(f&&(f.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==s.indent&&i(l,"BAD_INDENT",wE)),!m.anchor&&!m.tag&&!v){c=m.end,m.comment&&(a.comment?a.comment+=` +`+m.comment:a.comment=m.comment);continue}(m.hasNewlineAfterProp||pf(f))&&i(f??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((u=m.found)==null?void 0:u.indent)!==s.indent&&i(l,"BAD_INDENT",wE);const y=m.end,b=f?t(n,f,m,i):e(n,y,h,null,m,i);n.schema.compat&&Ty(s.indent,f,i),vC(n,a.items,b)&&i(y,"DUPLICATE_KEY","Map keys must be unique");const w=ju(v??[],{indicator:"map-value-ind",next:_,offset:b.range[2],onError:i,startOnNewline:!f||f.type==="block-scalar"});if(l=w.end,w.found){g&&((_==null?void 0:_.type)==="block-map"&&!w.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.startt&&(t.type==="block-map"||t.type==="block-seq");function Zz({composeNode:t,composeEmptyNode:e},n,s,i,r){const o=s.start.source==="{",a=o?"flow map":"flow sequence",l=(r==null?void 0:r.nodeClass)??(o?ri:Ua),c=new l(n.schema);c.flow=!0;const u=n.atRoot;u&&(n.atRoot=!1);let d=s.offset+s.start.source.length;for(let m=0;m0){const m=Qf(v,_,n.options.strict,i);m.comment&&(c.comment?c.comment+=` +`+m.comment:c.comment=m.comment),c.range=[s.offset,_,m.offset]}else c.range=[s.offset,_,_];return c}function x1(t,e,n,s,i,r){const o=n.type==="block-map"?Xz(t,e,n,s,r):n.type==="block-seq"?Kz(t,e,n,s,r):Zz(t,e,n,s,r),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function Jz(t,e,n,s,i){var d;const r=s?e.directives.tagName(s.source,h=>i(s,"TAG_RESOLVE_FAILED",h)):null,o=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!r||r==="!"||r===ri.tagName&&o==="map"||r===Ua.tagName&&o==="seq"||!o)return x1(t,e,n,i,r);let a=e.schema.tags.find(h=>h.tag===r&&h.collection===o);if(!a){const h=e.schema.knownTags[r];if(h&&h.collection===o)e.schema.tags.push(Object.assign({},h,{default:!1})),a=h;else return h!=null&&h.collection?i(s,"BAD_COLLECTION_TYPE",`${h.tag} used for ${o} collection, but expects ${h.collection}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,!0),x1(t,e,n,i,r)}const l=x1(t,e,n,i,r,a),c=((d=a.resolve)==null?void 0:d.call(a,l,h=>i(s,"TAG_RESOLVE_FAILED",h),e.options))??l,u=Cn(c)?c:new gt(c);return u.range=l.range,u.tag=r,a!=null&&a.format&&(u.format=a.format),u}function yC(t,e,n){const s=t.offset,i=Qz(t,e,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?gt.BLOCK_FOLDED:gt.BLOCK_LITERAL,o=t.source?eV(t.source):[];let a=o.length;for(let _=o.length-1;_>=0;--_){const m=o[_][1];if(m===""||m==="\r")a=_;else break}if(a===0){const _=i.chomp==="+"&&o.length>0?` +`.repeat(Math.max(1,o.length-1)):"";let m=s+i.length;return t.source&&(m+=t.source.length),{value:_,type:r,comment:i.comment,range:[s,m,m]}}let l=t.indent+i.indent,c=t.offset+i.length,u=0;for(let _=0;_l&&(l=m.length);else{m.length=a;--_)o[_][0].length>l&&(a=_+1);let d="",h="",f=!1;for(let _=0;_l||g[0]===" "?(h===" "?h=` +`:!f&&h===` +`&&(h=` + +`),d+=h+m.slice(l)+g,h=` +`,f=!0):g===""?h===` +`?d+=` +`:h=` +`:(d+=h+g,h=" ",f=!1)}switch(i.chomp){case"-":break;case"+":for(let _=a;_n(s+h,f,v);switch(i){case"scalar":a=gt.PLAIN,l=tV(r,c);break;case"single-quoted-scalar":a=gt.QUOTE_SINGLE,l=nV(r,c);break;case"double-quoted-scalar":a=gt.QUOTE_DOUBLE,l=sV(r,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const u=s+r.length,d=Qf(o,u,e,n);return{value:l,type:a,comment:d.comment,range:[s,u,d.offset]}}function tV(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),wC(t)}function nV(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),wC(t.slice(1,-1)).replace(/''/g,"'")}function wC(t){let e,n;try{e=new RegExp(`(.*?)(?r?t.slice(r,s+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function iV(t,e){let n="",s=t[e+1];for(;(s===" "||s===" "||s===` +`||s==="\r")&&!(s==="\r"&&t[e+2]!==` +`);)s===` +`&&(n+=` +`),e+=1,s=t[e+1];return n||(n=" "),{fold:n,offset:e}}const rV={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function oV(t,e,n,s){const i=t.substr(e,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=t.substr(e-2,n+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function xC(t,e,n,s){const{value:i,type:r,comment:o,range:a}=e.type==="block-scalar"?yC(e,t.options.strict,s):bC(e,t.options.strict,s),l=n?t.directives.tagName(n.source,d=>s(n,"TAG_RESOLVE_FAILED",d)):null,c=n&&l?aV(t.schema,i,l,n,s):e.type==="scalar"?lV(t,i,e,s):t.schema[To];let u;try{const d=c.resolve(i,h=>s(n??e,"TAG_RESOLVE_FAILED",h),t.options);u=nn(d)?d:new gt(d)}catch(d){const h=d instanceof Error?d.message:String(d);s(n??e,"TAG_RESOLVE_FAILED",h),u=new gt(i)}return u.range=a,u.source=i,r&&(u.type=r),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function aV(t,e,n,s,i){var a;if(n==="!")return t[To];const r=[];for(const l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)r.push(l);else return l;for(const l of r)if((a=l.test)!=null&&a.test(e))return l;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[To])}function lV({directives:t,schema:e},n,s,i){const r=e.tags.find(o=>{var a;return o.default&&((a=o.test)==null?void 0:a.test(n))})||e[To];if(e.compat){const o=e.compat.find(a=>{var l;return a.default&&((l=a.test)==null?void 0:l.test(n))})??e[To];if(r.tag!==o.tag){const a=t.tagString(r.tag),l=t.tagString(o.tag),c=`Value may be parsed as either ${a} or ${l}`;i(s,"TAG_RESOLVE_FAILED",c,!0)}}return r}function cV(t,e,n){if(e){n===null&&(n=e.length);for(let s=n-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++s];(i==null?void 0:i.type)==="space";)t+=i.source.length,i=e[++s];break}}return t}const uV={composeNode:SC,composeEmptyNode:nx};function SC(t,e,n,s){const{spaceBefore:i,comment:r,anchor:o,tag:a}=n;let l,c=!0;switch(e.type){case"alias":l=dV(t,e,s),(o||a)&&s(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=xC(t,e,a,s),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=Jz(uV,t,e,a,s),o&&(l.anchor=o.source.substring(1));break;default:{const u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",u),l=nx(t,e.offset,void 0,null,n,s),c=!1}}return o&&l.anchor===""&&s(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(l.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?l.comment=r:l.commentBefore=r),t.options.keepSourceTokens&&c&&(l.srcToken=e),l}function nx(t,e,n,s,{spaceBefore:i,comment:r,anchor:o,tag:a,end:l},c){const u={type:"scalar",offset:cV(e,n,s),indent:-1,source:""},d=xC(t,u,a,c);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),r&&(d.comment=r,d.range[2]=l),d}function dV({options:t},{offset:e,source:n,end:s},i){const r=new t0(n.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,a=Qf(s,o,t.strict,i);return r.range=[e,o,a.offset],a.comment&&(r.comment=a.comment),r}function hV(t,e,{offset:n,start:s,value:i,end:r},o){const a=Object.assign({_directives:e},t),l=new Ed(void 0,a),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=ju(s,{indicator:"doc-start",next:i??(r==null?void 0:r[0]),offset:n,onError:o,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?SC(c,i,u,o):nx(c,u.end,s,null,u,o);const d=l.contents.range[2],h=Qf(r,d,!1,o);return h.comment&&(l.comment=h.comment),l.range=[n,d,h.offset],l}function Yd(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function xE(t){var i;let e="",n=!1,s=!1;for(let r=0;r{const o=Yd(n);r?this.warnings.push(new _C(o,s,i)):this.errors.push(new Bl(o,s,i))},this.directives=new As({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:s,afterEmptyLine:i}=xE(this.prelude);if(s){const r=e.contents;if(n)e.comment=e.comment?`${e.comment} +${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(wn(r)&&!r.flow&&r.items.length>0){let o=r.items[0];bn(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${s} +${a}`:s}else{const o=r.commentBefore;r.commentBefore=o?`${s} +${o}`:s}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:xE(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,s=-1){for(const i of e)yield*this.next(i);yield*this.end(n,s)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,s,i)=>{const r=Yd(e);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=hV(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new Bl(Yd(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Bl(Yd(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Qf(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Bl(Yd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const s=Object.assign({_directives:this.directives},this.options),i=new Ed(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}function fV(t,e=!0,n){if(t){const s=(i,r,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,r,o);else throw new Bl([a,a+1],r,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return bC(t,e,s);case"block-scalar":return yC(t,e,s)}}return null}function pV(t,e){const{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,a=Zf({type:o,value:t},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:s,source:` +`}];switch(a[0]){case"|":case">":{const c=a.indexOf(` +`),u=a.substring(0,c),d=a.substring(c+1)+` +`,h=[{type:"block-scalar-header",offset:r,indent:s,source:u}];return EC(h,l)||h.push({type:"newline",offset:-1,indent:s,source:` +`}),{type:"block-scalar",offset:r,indent:s,props:h,source:d}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:a,end:l};default:return{type:"scalar",offset:r,indent:s,source:a,end:l}}}function mV(t,e,n={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=n,a="indent"in t?t.indent:null;if(s&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Zf({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":gV(t,l);break;case'"':S1(t,l,"double-quoted-scalar");break;case"'":S1(t,l,"single-quoted-scalar");break;default:S1(t,l,"scalar")}}function gV(t,e){const n=e.indexOf(` +`),s=e.substring(0,n),i=e.substring(n+1)+` +`;if(t.type==="block-scalar"){const r=t.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,t.source=i}else{const{offset:r}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:r,indent:o,source:s}];EC(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` +`});for(const l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:i})}}function EC(t,e){if(e)for(const n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function S1(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{const s=t.props.slice(1);let i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(const r of s)r.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:s});break}case"block-map":case"block-seq":{const i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{const s="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(const r of Object.keys(t))r!=="type"&&r!=="offset"&&delete t[r];Object.assign(t,{type:n,indent:s,source:e,end:i})}}}const _V=t=>"type"in t?Fg(t):eg(t);function Fg(t){switch(t.type){case"block-scalar":{let e="";for(const n of t.props)e+=Fg(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(const n of t.items)e+=eg(n);return e}case"flow-collection":{let e=t.start.source;for(const n of t.items)e+=eg(n);for(const n of t.end)e+=n.source;return e}case"document":{let e=eg(t);if(t.end)for(const n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(const n of t.end)e+=n.source;return e}}}function eg({start:t,key:e,sep:n,value:s}){let i="";for(const r of t)i+=r.source;if(e&&(i+=Fg(e)),n)for(const r of n)i+=r.source;return s&&(i+=Fg(s)),i}const Ay=Symbol("break visit"),vV=Symbol("skip children"),TC=Symbol("remove item");function ic(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),AC(Object.freeze([]),t,e)}ic.BREAK=Ay;ic.SKIP=vV;ic.REMOVE=TC;ic.itemAtPath=(t,e)=>{let n=t;for(const[s,i]of e){const r=n==null?void 0:n[s];if(r&&"items"in r)n=r.items[i];else return}return n};ic.parentCollection=(t,e)=>{const n=ic.itemAtPath(t,e.slice(0,-1)),s=e[e.length-1][0],i=n==null?void 0:n[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function AC(t,e,n){let s=n(e,t);if(typeof s=="symbol")return s;for(const i of["key","value"]){const r=e[i];if(r&&"items"in r){for(let o=0;o!!t&&"items"in t,bV=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function wV(t){switch(t){case d0:return"";case h0:return"";case f0:return"";case mf:return"";default:return JSON.stringify(t)}}function MC(t){switch(t){case d0:return"byte-order-mark";case h0:return"doc-mode";case f0:return"flow-error-end";case mf:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`:case`\r +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const xV=Object.freeze(Object.defineProperty({__proto__:null,BOM:d0,DOCUMENT:h0,FLOW_END:f0,SCALAR:mf,createScalarToken:pV,isCollection:yV,isScalar:bV,prettyToken:wV,resolveAsScalar:fV,setScalarValue:mV,stringify:_V,tokenType:MC,visit:ic},Symbol.toStringTag,{value:"Module"}));function mi(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const SE="0123456789ABCDEFabcdef".split(""),SV="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),E1=",[]{}".split(""),EV=` ,[]{} +\r `.split(""),T1=t=>!t||EV.includes(t);class RC{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){e&&(this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null),this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===` +`?!0:n==="\r"?this.buffer[e+1]===` +`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+e];if(n==="\r"){const i=this.buffer[s+e+1];if(i===` +`||!i&&!this.atEnd)return e+s+1}return n===` +`||s>=this.indentNext||!n&&!this.atEnd?e+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&mi(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!mi(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&mi(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(T1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,s=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>mi(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,s;e:for(let i=this.pos;s=this.buffer[i];++i)switch(s){case" ":n+=1;break;case` +`:e=i,n=0;break;case"\r":{const r=this.buffer[i+1];if(!r&&!this.atEnd)return this.setNext("block-scalar");if(r===` +`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{const i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(` +`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}if(!this.blockScalarKeep)do{let i=e-1,r=this.buffer[i];r==="\r"&&(r=this.buffer[--i]);const o=i;for(;r===" "||r===" ";)r=this.buffer[--i];if(r===` +`&&i>=this.pos&&i+1+n>o)e=i;else break}while(!0);return yield mf,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(mi(r)||e&&r===",")break;n=s}else if(mi(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===` +`?(s+=1,i=` +`,r=this.buffer[s+1]):n=s),r==="#"||e&&E1.includes(r))break;if(i===` +`){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&E1.includes(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield mf,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(T1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(mi(n)||e&&E1.includes(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!mi(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(SV.includes(n))n=this.buffer[++e];else if(n==="%"&&SE.includes(this.buffer[e+1])&&SE.includes(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===` +`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` +`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||e&&s===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,s=this.buffer[n];for(;!e(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class kC{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,s=this.lineStarts.length;for(;n>1;this.lineStarts[r]=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=t[++e])==null?void 0:n.type)==="space";);return t.splice(e,t.length)}function TE(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!Fi(e.start,"explicit-key-ind")&&!Fi(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,CC(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class ix{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new RC,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(e,n))yield*this.next(s);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=MC(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&TE(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!Fi(i.start,"explicit-key-ind");return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&EE(i.start)===-1&&(n.indent===0||i.start.every(r=>r.type!=="comment"||r.indent=e.indent){const i=!this.onKeyLine&&this.indent===e.indent&&n.sep&&this.type!=="seq-item-ind";let r=[];if(i&&n.sep&&!n.value){const o=[];for(let a=0;ae.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!Fi(n.start,"explicit-key-ind")?n.start.push(this.sourceToken):i||n.value?(r.push(this.sourceToken),e.items.push({start:r})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}),this.onKeyLine=!0;return;case"map-value-ind":if(Fi(n.start,"explicit-key-ind"))if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Fi(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(CC(n.key)&&!Fi(n.sep,"newline")){const o=Sc(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?n.sep=n.sep.concat(r,this.sourceToken):n.sep.push(this.sourceToken);else if(Fi(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Sc(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):Fi(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){i&&o.type!=="block-seq"&&Fi(n.start,"explicit-key-ind")&&e.items.push({start:r}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const i=e.items[e.items.length-2],r=(s=i==null?void 0:i.value)==null?void 0:s.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Fi(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=Rp(s),r=Sc(i);TE(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(` +`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` +`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Rp(e),s=Sc(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Rp(e),s=Sc(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function PC(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new kC||null,prettyErrors:e}}function TV(t,e={}){const{lineCounter:n,prettyErrors:s}=PC(e),i=new ix(n==null?void 0:n.addNewLine),r=new sx(e),o=Array.from(r.compose(i.parse(t)));if(s&&n)for(const a of o)a.errors.forEach(Ng(t,n)),a.warnings.forEach(Ng(t,n));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}function OC(t,e={}){const{lineCounter:n,prettyErrors:s}=PC(e),i=new ix(n==null?void 0:n.addNewLine),r=new sx(e);let o=null;for(const a of r.compose(i.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Bl(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(Ng(t,n)),o.warnings.forEach(Ng(t,n))),o}function AV(t,e,n){let s;typeof e=="function"?s=e:n===void 0&&e&&typeof e=="object"&&(n=e);const i=OC(t,n);if(!i)return null;if(i.warnings.forEach(r=>Q5(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}function MV(t,e,n){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){const{keepUndefined:i}=n??e??{};if(!i)return}return new Ed(t,s,n).toString(n)}const Ao=Object.freeze(Object.defineProperty({__proto__:null,Alias:t0,CST:xV,Composer:sx,Document:Ed,Lexer:RC,LineCounter:kC,Pair:_s,Parser:ix,Scalar:gt,Schema:u0,YAMLError:tx,YAMLMap:ri,YAMLParseError:Bl,YAMLSeq:Ua,YAMLWarning:_C,isAlias:fc,isCollection:wn,isDocument:yd,isMap:bd,isNode:Cn,isPair:bn,isScalar:nn,isSeq:wd,parse:AV,parseAllDocuments:TV,parseDocument:OC,stringify:MV,visit:Fa,visitAsync:e0},Symbol.toStringTag,{value:"Module"}));function My(t){if(t!==void 0&&t!=="NONE"){if(Array.isArray(t)){for(let e=t.length-1;e>=0;e--)t[e]=My(t[e]),t[e]||t.splice(e,1);if(t.length==0)return}if(Object.getPrototypeOf(t)===Object.prototype){const e=Object.keys(t);for(let n=e.length-1;n>=0;n--)t[e[n]]=My(t[e[n]]),t[e[n]]||delete t[e[n]];if(Object.keys(t).length==0)return}return t}}const Td=ys("target",{state:()=>({name:"",brushless:!0,gyro_orientation:0,leds:[],serial_ports:[],serial_soft_ports:[],spi_ports:[],motor_pins:[]}),getters:{yaml(t){const e=An();return Ao.stringify(My({mcu:e.mcu,...t.$state}))},serial_port_names(t){const e={},n=An();if(n.quicVersionGte("0.2.0")){for(const s of t.serial_ports)s.index!=0&&(e[`SERIAL_PORT${s.index}`]=s.index);for(const s of t.serial_soft_ports)s.index!=0&&(e[`SERIAL_SOFT_PORT${s.index}`]=100+s.index)}else for(let s=1;sthis.$patch(t))},apply(t){const e=vn();return Et.set(xn.Target,t).then(()=>this.fetch()).then(()=>e.append_alert({type:"success",msg:"Target applied!"}))}}});function Ug(t,e){for(const[n,s]of Object.entries(e))s!==null&&typeof s=="object"?(t[n]===void 0&&(t[n]=new s.__proto__.constructor),Ug(t[n],s)):t[n]=s;return t}function A1(t,e,n){return t<<16|e<<8|n}function AE(t){return t=t||A1(0,1,0),th.index!=0);for(const h of Object.keys(t.serial))t.serial[h]!=0&&(t.serial[h]<=d.length?t.serial[h]=d[t.serial[h]-1].index:t.serial[h]=t.serial[h]-d.length+100)}return t.meta.name&&(t.meta.name=t.meta.name.replace(/\0/g,"")),(u=t.osd)!=null&&u.callsign&&(t.osd.callsign=t.osd.callsign.replace(/\0/g,"")),t}function M1(t){var o,a;const e=Td(),n=jf(),s=AE((o=n==null?void 0:n.meta)==null?void 0:o.version),i=AE((a=t==null?void 0:t.meta)==null?void 0:a.version);let r=JSON.parse(JSON.stringify(t));return r.meta||(r.meta={}),s!=i&&(r=RV(r,e.$state,Gu(i),Gu(s))),r.meta.datetime=Math.floor(Date.now()/1e3),r}const Jt=ys("profile",{state:()=>({semver:"v0.0.0",modified:"",serial:{rx:0,smart_audio:0,hdzero:0},filter:{gyro:[{},{}],dterm:[{},{}]},osd:{callsign:"",elements:[],elements_hd:[]},meta:{name:"",datetime:0},motor:{gyro_orientation:0,invert_yaw:1,motor_pins:[]},rate:{mode:0,profile:0,silverware:{},betaflight:{},low_rate_mulitplier:0,level_max_angle:0,sticks_deadband:0,rates:[],throttle_expo:0,throttle_mid:0},voltage:{vbat_scale:0,ibat_scale:0},receiver:{lqi_source:-1,channel_mapping:0,aux:[],protocol:0},pid:{pid_profile:0,pid_rates:[{}],stick_profile:0,stick_rates:[{}],big_angle:{},small_angle:{},throttle_dterm_attenuation:{}},blackbox:{field_flags:0,sample_rate_hz:0}}),getters:{current_pid_rate:t=>t.pid.pid_rates[t.pid.pid_profile],current_stick_rate:t=>t.pid.stick_rates[t.pid.stick_profile],profileVersionGt(t){return e=>zs.gt(t.semver,e)}},actions:{set_profile(t){t.modified=_z(new Date(t.meta.datetime*1e3)),t.semver=Gu(t.meta.version),t.meta.name=t.meta.name.replace(/\0/g,""),this.$patch(t)},set_current_pid_rate(t){const e=[...this.pid.pid_rates];e[this.pid.pid_profile]=t,this.pid={...this.pid,pid_rates:e}},set_current_stick_rate(t){const e=[...this.pid.stick_rates];e[this.pid.stick_profile]=t,this.pid={...this.pid,stick_rates:e}},set_osd_elements(t){this.osd={...this.osd,elements:t}},set_osd_elements_hd(t){this.osd={...this.osd,elements_hd:t}},reset(){const t=jf();return this.apply_profile(t.$state)},fetch_profile(){return Et.get(xn.Profile).then(t=>this.set_profile(t))},async merge_profile(t){const e=M1(await Et.get(xn.Profile)),n=M1(t),s=Ug(e,n);return this.apply_profile(s)},apply_profile(t){const e=vn(),n=M1(t);return Et.set(xn.Profile,n).then(s=>this.set_profile(s)).then(()=>e.append_alert({type:"success",msg:"Profile applied!"})).then(()=>e.reset_needs_apply()).catch(s=>{ct.error(s),e.append_alert({type:"danger",msg:"Apply failed! "+s})})}}}),Ry=ys("vtx",{state:()=>({settings:{protocol:0,detected:0,channel:0,band:0,power_table:{levels:0,labels:[],values:[]}}}),actions:{apply_vtx_settings(t){const e=vn();if(t.power_table)for(let n=0;nthis.settings=n).then(()=>{e.append_alert({type:"success",msg:"Apply successful!"})}).catch(()=>{e.append_alert({type:"danger",msg:"Apply failed"})})},update_vtx_settings(t=!1){if(this.settings.detected==0||t)return Et.get(xn.VtxSettings).then(e=>{const n=e.detected==0?this.settings.protocol:e.protocol;this.settings={...e,protocol:n}})}}}),IC=ys("perf",{state:()=>({counters:[]}),actions:{fetch_perf_counters(){return Et.get(xn.PerfCounters).then(t=>this.counters=t)}}}),rx=ys("bind",{state:()=>({info:{bind_saved:0,raw:new Uint8Array}}),actions:{fetch_bind_info(){return Et.get(xn.BindInfo).then(t=>this.info=t)},apply_bind_info(t){const e=vn();return Et.set(xn.BindInfo,t).then(n=>this.info=n).then(()=>e.set_needs_reboot()).then(()=>e.append_alert({type:"success",msg:"Bind info applied!"})).catch(n=>{ct.error(n),e.append_alert({type:"danger",msg:"Apply failed! "+n})})}}}),kV=it({name:"Motor",setup(){return{profile:Jt(),info:An(),constants:Xa()}},data(){return{invertYawModes:[{value:0,text:"Props In"},{value:1,text:"Props Out"}],dshotTimes:[{value:150,text:"150"},{value:300,text:"300"},{value:600,text:"600"}]}},computed:{gyroOrientation:{get(){return this.profile.motor.gyro_orientation&31},set(t){this.profile.motor.gyro_orientation=t|(this.gyroFlip?this.constants.GyroRotation.FLIP_180:0)}},gyroOrientations(){return[{value:this.constants.GyroRotation.ROTATE_NONE,text:"ROTATE_NONE"},{value:this.constants.GyroRotation.ROTATE_45_CCW,text:"ROTATE_45_CCW"},{value:this.constants.GyroRotation.ROTATE_45_CW,text:"ROTATE_45_CW"},{value:this.constants.GyroRotation.ROTATE_90_CW,text:"ROTATE_90_CW"},{value:this.constants.GyroRotation.ROTATE_90_CCW,text:"ROTATE_90_CCW"},{value:this.constants.GyroRotation.ROTATE_90_CCW|this.constants.GyroRotation.ROTATE_45_CCW,text:"ROTATE_135_CW"},{value:this.constants.GyroRotation.ROTATE_90_CW|this.constants.GyroRotation.ROTATE_45_CW,text:"ROTATE_135_CCW"},{value:this.constants.GyroRotation.ROTATE_180,text:"ROTATE_180"}]},gyroFlip:{get(){return(this.profile.motor.gyro_orientation&this.constants.GyroRotation.FLIP_180)>0},set(t){this.profile.motor.gyro_orientation=this.gyroOrientation|(t?this.constants.GyroRotation.FLIP_180:0)}}}}),CV={class:"card"},PV=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Motor")],-1),OV={class:"card-content"},IV={class:"content column-narrow field-is-5"},LV={class:"columns"},DV={class:"column is-6"},NV={id:"svg1",width:"400",height:"400",viewBox:"0 0 135.46665 135.46665",version:"1.1","sodipodi:docname":"props_view.svg","inkscape:version":"1.3.2 (091e20ef0f, 2023-11-25, custom)","xml:space":"preserve","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg"},FV=p("path",{id:"path1",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"11.1468","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"M 108.49869,108.49869 26.967982,26.967982"},null,-1),UV=p("path",{id:"path2",style:{display:"inline",fill:"#7a7a7a","fill-opacity":"1",stroke:"#7a7a7a","stroke-width":"11.1468","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"M 26.967982,108.49869 108.49869,26.967982","inkscape:label":"path2"},null,-1),$V={key:0,id:"g5",style:{"stroke-width":"2.64583","stroke-dasharray":"none"},transform:"matrix(1.2037011,0,0,1.2037011,-13.909145,-13.640148)","inkscape:label":"props_in_bl"},BV=p("circle",{id:"path4",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),HV=p("path",{id:"path5",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),GV=p("path",{id:"path5-6",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1),zV=[BV,HV,GV],VV={key:1,id:"g5-2",transform:"matrix(-1.2037011,0,0,-1.2037011,149.37581,149.26403)",style:{"stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_in_fr"},WV=p("circle",{id:"path4-0",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),jV=p("path",{id:"path5-2",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),qV=p("path",{id:"path5-6-3",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1),YV=[WV,jV,qV],XV={key:2,id:"g5-2-2",transform:"matrix(-1.2037013,0,0,1.2037013,149.37582,-13.797383)",style:{"stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_in_br"},KV=p("circle",{id:"path4-0-2",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),ZV=p("path",{id:"path5-2-8",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),JV=p("path",{id:"path5-6-3-9",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1),QV=[KV,ZV,JV],eW={key:3,id:"g5-2-1-2",transform:"matrix(1.2037013,0,0,-1.2037013,-13.829304,149.26404)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_in_fl"},tW=p("circle",{id:"path4-0-29-54",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),nW=p("path",{id:"path5-2-3-7",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 0.346888,-6.75997"},null,-1),sW=p("path",{id:"path5-6-3-1-4",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 25.42414,111.81499 -6.759978,0.34689"},null,-1),iW=[tW,nW,sW],rW={key:4,id:"g5-2-1",transform:"matrix(1.2037013,0,0,-1.2037013,-13.909145,149.65895)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_fl"},oW=p("circle",{id:"path4-0-29",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),aW=p("path",{id:"path5-2-3",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),lW=p("path",{id:"path5-6-3-1",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1),cW=[oW,aW,lW],uW={key:5,id:"g5-2-1-8",transform:"matrix(-1.2037011,0,0,-1.2037011,149.37581,149.26403)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_fr"},dW=p("circle",{id:"path4-0-29-4",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),hW=p("path",{id:"path5-2-3-5",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),fW=p("path",{id:"path5-6-3-1-0",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1),pW=[dW,hW,fW],mW={key:6,id:"g5-2-1-0",transform:"matrix(-1.2037013,0,0,1.2037013,149.37582,-13.988638)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_br"},gW=p("circle",{id:"path4-0-29-6",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),_W=p("path",{id:"path5-2-3-3",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),vW=p("path",{id:"path5-6-3-1-2",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1),yW=[gW,_W,vW],bW={key:7,id:"g5-2-1-5",transform:"matrix(1.2037011,0,0,1.2037011,-13.909145,-13.842473)",style:{display:"inline","stroke-width":"2.64583","stroke-dasharray":"none"},"inkscape:label":"props_out_bl"},wW=p("circle",{id:"path4-0-29-5",style:{fill:"none","fill-opacity":"1",stroke:"#62a834","stroke-width":"2.64583","stroke-linecap":"round","stroke-dasharray":"none","stroke-opacity":"1"},cx:"33.959526",cy:"101.60001",r:"13.229167"},null,-1),xW=p("path",{id:"path5-2-3-4",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 -0.34689,6.75997"},null,-1),SW=p("path",{id:"path5-6-3-1-7",style:{fill:"none",stroke:"#7a7a7a","stroke-width":"2.64583","stroke-linecap":"round","stroke-linejoin":"miter","stroke-dasharray":"none","stroke-opacity":"1"},d:"m 22.533776,108.2281 6.75997,-0.34689"},null,-1),EW=[wW,xW,SW],TW={class:"column is-6"},AW={class:"field is-horizontal"},MW={class:"field-label"},RW={class:"label"},kW={class:"field-body"},CW={class:"field"},PW={class:"control is-expanded"},OW={class:"field is-horizontal"},IW={class:"field-label"},LW={class:"label"},DW={class:"field-body"},NW={class:"field"},FW={class:"control is-expanded"},UW={key:0,class:"field is-horizontal"},$W={class:"field-label"},BW={class:"label"},HW={class:"field-body"},GW={class:"field"},zW={class:"control is-expanded"},VW={class:"field is-horizontal"},WW={class:"field-label"},jW={class:"label"},qW={class:"field-body"},YW={class:"field"},XW={class:"control is-expanded"},KW=p("label",{class:"py-0",style:{height:"2em"},for:"gyro-flip"},null,-1),ZW={class:"field is-horizontal"},JW={class:"field-label"},QW={class:"label"},ej={class:"field-body"},tj={class:"field"},nj={class:"control is-expanded"},sj={class:"field is-horizontal"},ij={class:"field-label"},rj={class:"label"},oj={class:"field-body"},aj={class:"field"},lj={class:"control is-expanded"},cj={class:"field is-horizontal"},uj={class:"field-label"},dj={class:"label"},hj={class:"field-body"},fj={class:"field"},pj={class:"control is-expanded"},mj={class:"field is-horizontal"},gj={class:"field-label"},_j={class:"label"},vj={class:"field-body"},yj={class:"field"},bj={class:"control is-expanded"},wj={key:1,class:"field is-horizontal"},xj={class:"field-label"},Sj={class:"label"},Ej={class:"field-body"},Tj={class:"field"},Aj={class:"control is-expanded"};function Mj(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select");return Z(),ie("div",CV,[PV,p("div",OV,[p("div",IV,[p("div",LV,[p("div",DV,[p("div",null,[p("h4",null,[me(" Props "+Be(t.profile.motor.invert_yaw?"Out":"In")+" ",1),Y(o,{entry:"motor.invert_yaw"})]),(Z(),ie("svg",NV,[FV,UV,t.profile.motor.invert_yaw?ze("",!0):(Z(),ie("g",$V,zV)),t.profile.motor.invert_yaw?ze("",!0):(Z(),ie("g",VV,YV)),t.profile.motor.invert_yaw?ze("",!0):(Z(),ie("g",XV,QV)),t.profile.motor.invert_yaw?ze("",!0):(Z(),ie("g",eW,iW)),t.profile.motor.invert_yaw?(Z(),ie("g",rW,cW)):ze("",!0),t.profile.motor.invert_yaw?(Z(),ie("g",uW,pW)):ze("",!0),t.profile.motor.invert_yaw?(Z(),ie("g",mW,yW)):ze("",!0),t.profile.motor.invert_yaw?(Z(),ie("g",bW,EW)):ze("",!0)]))])]),p("div",TW,[p("div",AW,[p("div",MW,[p("label",RW,[me(" Invert Yaw "),Y(o,{entry:"motor.invert_yaw"})])]),p("div",kW,[p("div",CW,[p("div",PW,[Y(a,{id:"invert-yaw",modelValue:t.profile.motor.invert_yaw,"onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.motor.invert_yaw=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.invertYawModes},null,8,["modelValue","options"])])])])]),p("div",OW,[p("div",IW,[p("label",LW,[me(" Digital Idle "),Y(o,{entry:"motor.digital_idle"})])]),p("div",DW,[p("div",NW,[p("div",FW,[Ye(p("input",{id:"digital-idle","onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.motor.digital_idle=l),class:"input",type:"number",step:"0.5",min:"0",max:"100"},null,512),[[st,t.profile.motor.digital_idle,void 0,{number:!0}]])])])])]),t.info.quic_protocol_version>1&&t.info.has_feature(t.constants.Features.BRUSHLESS)?(Z(),ie("div",UW,[p("div",$W,[p("label",BW,[me(" DShot Time "),Y(o,{entry:"motor.dshot_time"})])]),p("div",HW,[p("div",GW,[p("div",zW,[Y(a,{id:"dshot-time",modelValue:t.profile.motor.dshot_time,"onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.motor.dshot_time=l),class:"is-fullwidth",options:t.dshotTimes},null,8,["modelValue","options"])])])])])):ze("",!0),p("div",VW,[p("div",WW,[p("label",jW,[me(" Flip Gyro "),Y(o,{entry:"motor.flip_gyro"})])]),p("div",qW,[p("div",YW,[p("div",XW,[Ye(p("input",{id:"gyro-flip","onUpdate:modelValue":e[3]||(e[3]=l=>t.gyroFlip=l),type:"checkbox",class:"switch"},null,512),[[rk,t.gyroFlip]]),KW])])])]),p("div",ZW,[p("div",JW,[p("label",QW,[me(" Gyro Orientation "),Y(o,{entry:"motor.gyro_orientation"})])]),p("div",ej,[p("div",tj,[p("div",nj,[Y(a,{id:"gyro-orientation",modelValue:t.gyroOrientation,"onUpdate:modelValue":e[4]||(e[4]=l=>t.gyroOrientation=l),class:"is-fullwidth",options:t.gyroOrientations},null,8,["modelValue","options"])])])])]),p("div",sj,[p("div",ij,[p("label",rj,[me(" Torque Boost "),Y(o,{entry:"motor.torque_boost"})])]),p("div",oj,[p("div",aj,[p("div",lj,[Ye(p("input",{id:"torque-boost","onUpdate:modelValue":e[5]||(e[5]=l=>t.profile.motor.torque_boost=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[st,t.profile.motor.torque_boost,void 0,{number:!0}]])])])])]),p("div",cj,[p("div",uj,[p("label",dj,[me(" Throttle Boost "),Y(o,{entry:"motor.throttle_boost"})])]),p("div",hj,[p("div",fj,[p("div",pj,[Ye(p("input",{id:"throttle-boost","onUpdate:modelValue":e[6]||(e[6]=l=>t.profile.motor.throttle_boost=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[st,t.profile.motor.throttle_boost,void 0,{number:!0}]])])])])]),p("div",mj,[p("div",gj,[p("label",_j,[me(" Turtle Throttle Percent "),Y(o,{entry:"motor.turtle_throttle_percent"})])]),p("div",vj,[p("div",yj,[p("div",bj,[Ye(p("input",{id:"turtle-throttle-percent","onUpdate:modelValue":e[7]||(e[7]=l=>t.profile.motor.turtle_throttle_percent=l),class:"input",type:"number",step:"1",min:"0",max:"100"},null,512),[[st,t.profile.motor.turtle_throttle_percent,void 0,{number:!0}]])])])])]),t.profile.profileVersionGt("0.2.0")?(Z(),ie("div",wj,[p("div",xj,[p("label",Sj,[me(" Motor Limit Percent "),Y(o,{entry:"motor.motor_limit"})])]),p("div",Ej,[p("div",Tj,[p("div",Aj,[Ye(p("input",{id:"motor-limit-percent","onUpdate:modelValue":e[8]||(e[8]=l=>t.profile.motor.motor_limit=l),class:"input",type:"number",step:"1",min:"0",max:"100"},null,512),[[st,t.profile.motor.motor_limit,void 0,{number:!0}]])])])])])):ze("",!0)])])])])])}const Rj=lt(kV,[["render",Mj]]),kj=it({name:"Voltage",setup(){return{profile:Jt(),state:js()}},data(){return{pidVoltageCompensationOptions:[{value:0,text:"Off"},{value:1,text:"On"}]}},computed:{pid_voltage_compensation:{get(){return this.profile.voltage.pid_voltage_compensation},set(t){this.profile.voltage.pid_voltage_compensation=t?1:0}}}}),Cj={class:"card"},Pj={class:"card-header"},Oj=p("p",{class:"card-header-title"},"Voltage",-1),Ij={class:"card-header-icon"},Lj={class:"card-content"},Dj={class:"content column-narrow field-is-5"},Nj={class:"field is-horizontal"},Fj={class:"field-label"},Uj={class:"label"},$j={class:"field-body"},Bj={class:"field"},Hj={class:"control is-expanded"},Gj={class:"field is-horizontal"},zj={class:"field-label"},Vj={class:"label"},Wj={class:"field-body"},jj={class:"field"},qj={class:"control is-expanded"},Yj={class:"field is-horizontal"},Xj={class:"field-label"},Kj={class:"label"},Zj={class:"field-body"},Jj={class:"field"},Qj={class:"control is-expanded"},eq={class:"field is-horizontal"},tq={class:"field-label"},nq={class:"label"},sq={class:"field-body"},iq={class:"field"},rq={class:"control is-expanded"},oq={class:"field is-horizontal"},aq={class:"field-label"},lq={class:"label"},cq={class:"field-body"},uq={class:"field"},dq={class:"control is-expanded"},hq={class:"field is-horizontal"},fq={class:"field-label"},pq={class:"label"},mq={class:"field-body"},gq={class:"field"},_q={class:"control is-expanded"},vq={class:"field is-horizontal"},yq={class:"field-label"},bq={class:"label"},wq={class:"field-body"},xq={class:"field"},Sq={class:"control is-expanded"},Eq={key:0,class:"field is-horizontal"},Tq={class:"field-label"},Aq={class:"label"},Mq={class:"field-body"},Rq={class:"field"},kq={class:"control is-expanded"},Cq=["checked"],Pq=p("label",{class:"py-0",style:{height:"2em"},for:"use_filtered_voltage_for_warnings"},null,-1);function Oq(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select");return Z(),ie("div",Cj,[p("header",Pj,[Oj,p("small",Ij,Be(t.state.vbat.toFixed(2))+"V "+Be(t.state.ibat_filtered.toFixed(2))+"mA ",1)]),p("div",Lj,[p("div",Dj,[p("div",Nj,[p("div",Fj,[p("label",Uj,[me(" LipoCellCount "),Y(o,{entry:"voltage.lipo_cell_count"})])]),p("div",$j,[p("div",Bj,[p("div",Hj,[Ye(p("input",{id:"lipo-cell-count","onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.voltage.lipo_cell_count=l),class:"input",type:"number",step:"1",min:"0"},null,512),[[st,t.profile.voltage.lipo_cell_count,void 0,{number:!0}]])])])])]),p("div",Gj,[p("div",zj,[p("label",Vj,[me(" PidVoltageCompensation "),Y(o,{entry:"voltage.pid_voltage_compensation"})])]),p("div",Wj,[p("div",jj,[p("div",qj,[Y(a,{modelValue:t.profile.voltage.pid_voltage_compensation,"onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.voltage.pid_voltage_compensation=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.pidVoltageCompensationOptions},null,8,["modelValue","options"])])])])]),p("div",Yj,[p("div",Xj,[p("label",Kj,[me(" VBattLow "),Y(o,{entry:"voltage.vbattlow"})])]),p("div",Zj,[p("div",Jj,[p("div",Qj,[Ye(p("input",{id:"vbattlow","onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.voltage.vbattlow=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[st,t.profile.voltage.vbattlow,void 0,{number:!0}]])])])])]),p("div",eq,[p("div",tq,[p("label",nq,[me(" ActualBatteryVoltage "),Y(o,{entry:"voltage.actual_battery_voltage"})])]),p("div",sq,[p("div",iq,[p("div",rq,[Ye(p("input",{id:"actual-battery-voltage","onUpdate:modelValue":e[3]||(e[3]=l=>t.profile.voltage.actual_battery_voltage=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[st,t.profile.voltage.actual_battery_voltage,void 0,{number:!0}]])])])])]),p("div",oq,[p("div",aq,[p("label",lq,[me(" ReportedTelemetryVoltage "),Y(o,{entry:"voltage.reported_telemetry_voltage"})])]),p("div",cq,[p("div",uq,[p("div",dq,[Ye(p("input",{id:"reported-telemetry-voltage","onUpdate:modelValue":e[4]||(e[4]=l=>t.profile.voltage.reported_telemetry_voltage=l),class:"input",type:"number",step:"0.1",min:"0"},null,512),[[st,t.profile.voltage.reported_telemetry_voltage,void 0,{number:!0}]])])])])]),p("div",hq,[p("div",fq,[p("label",pq,[me(" Voltage Meter Scale "),Y(o,{entry:"voltage.vbat_scale"})])]),p("div",mq,[p("div",gq,[p("div",_q,[Ye(p("input",{id:"vbat_scale","onUpdate:modelValue":e[5]||(e[5]=l=>t.profile.voltage.vbat_scale=l),class:"input",type:"number",step:"1",min:"0"},null,512),[[st,t.profile.voltage.vbat_scale,void 0,{number:!0}]])])])])]),p("div",vq,[p("div",yq,[p("label",bq,[me(" Current Meter Scale "),Y(o,{entry:"voltage.ibat_scale"})])]),p("div",wq,[p("div",xq,[p("div",Sq,[Ye(p("input",{id:"ibat_scale","onUpdate:modelValue":e[6]||(e[6]=l=>t.profile.voltage.ibat_scale=l),class:"input",type:"number",step:"1",min:"0"},null,512),[[st,t.profile.voltage.ibat_scale,void 0,{number:!0}]])])])])]),t.profile.profileVersionGt("0.2.2")?(Z(),ie("div",Eq,[p("div",Tq,[p("label",Aq,[me(" Filtered voltage warnings "),Y(o,{entry:"voltage.use_filtered_voltage_for_warnings"})])]),p("div",Mq,[p("div",Rq,[p("div",kq,[p("input",{type:"checkbox",class:"switch",id:"use_filtered_voltage_for_warnings",checked:t.profile.voltage.use_filtered_voltage_for_warnings||0,onChange:e[7]||(e[7]=l=>t.profile.voltage.use_filtered_voltage_for_warnings=t.profile.voltage.use_filtered_voltage_for_warnings?0:1)},null,40,Cq),Pq])])])])):ze("",!0)])])])}const Iq=lt(kj,[["render",Oq]]),Lq=it({name:"Serial",setup(){return{root:vn(),target:Td(),profile:Jt()}},computed:{serialPorts(){const t=[{value:0,text:"None"}];for(const[e,n]of Object.entries(this.target.serial_port_names))t.push({value:n,text:e});return t}},watch:{"profile.serial":{handler(){this.root.set_needs_reboot()},deep:!0}}}),Dq={class:"card"},Nq=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Serial")],-1),Fq={class:"card-content"},Uq={class:"content column-narrow field-is-5"},$q={class:"field is-horizontal"},Bq={class:"field-label"},Hq={class:"label"},Gq={class:"field-body"},zq={class:"field"},Vq={class:"control is-expanded"},Wq={class:"field is-horizontal"},jq={class:"field-label"},qq={class:"label"},Yq={class:"field-body"},Xq={class:"field"},Kq={class:"control is-expanded"},Zq={class:"field is-horizontal"},Jq={class:"field-label"},Qq={class:"label"},eY={class:"field-body"},tY={class:"field"},nY={class:"control is-expanded"};function sY(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select");return Z(),ie("div",Dq,[Nq,p("div",Fq,[p("div",Uq,[p("div",$q,[p("div",Bq,[p("label",Hq,[me(" RX "),Y(o,{entry:"serial.rx"})])]),p("div",Gq,[p("div",zq,[p("div",Vq,[Y(a,{id:"rx",modelValue:t.profile.serial.rx,"onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.serial.rx=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])])]),p("div",Wq,[p("div",jq,[p("label",qq,[me(" VTX "),Y(o,{entry:"serial.smart_audio"})])]),p("div",Yq,[p("div",Xq,[p("div",Kq,[Y(a,{id:"smart-audio",modelValue:t.profile.serial.smart_audio,"onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.serial.smart_audio=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])])]),p("div",Zq,[p("div",Jq,[p("label",Qq,[me(" Digital VTX "),Y(o,{entry:"serial.digital_vtx"})])]),p("div",eY,[p("div",tY,[p("div",nY,[Y(a,{id:"digital_vtx",modelValue:t.profile.serial.hdzero,"onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.serial.hdzero=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])])])])])])}const iY=lt(Lq,[["render",sY]]),rY=it({name:"Vtx",setup(){return{vtx:Ry(),info:An()}},data(){return{protocolNames:["INVALID","TRAMP","SMARTAUDIO","MSP_VTX"],frequencyTable:[[5865,5845,5825,5805,5785,5765,5745,5725],[5733,5752,5771,5790,5809,5828,5847,5866],[5705,5685,5665,5645,5885,5905,5925,5945],[5740,5760,5780,5800,5820,5840,5860,5880],[5658,5695,5732,5769,5806,5843,5880,5917],[5333,5373,5413,5453,5493,5533,5573,5613]]}},computed:{displayValueEdit(){return this.vtx.settings.protocol==1},vtxProtocolOptions(){const t=[{value:0,text:"AUTO"},{value:1,text:"TRAMP"},{value:2,text:"SMARTAUDIO"}];return this.info.quicVersionGt("0.1.1")&&t.push({value:3,text:"MSP_VTX"}),t},vtxBandOptions(){const t=[{value:0,text:"VTX_BAND_A"},{value:1,text:"VTX_BAND_B"},{value:2,text:"VTX_BAND_E"},{value:3,text:"VTX_BAND_F"},{value:4,text:"VTX_BAND_R"}];return this.info.quicVersionGt("0.1.1")&&t.push({value:5,text:"VTX_BAND_L"}),t},vtxPowerLevelOptions(){if(this.vtx.settings.power_table)return this.vtx.settings.power_table.labels.map((e,n)=>({value:n,text:e}));const t=[{value:0,text:"VTX_POWER_LEVEL_1"},{value:1,text:"VTX_POWER_LEVEL_2"},{value:2,text:"VTX_POWER_LEVEL_3"},{value:3,text:"VTX_POWER_LEVEL_4"}];return this.info.quicVersionGt("0.1.1")&&t.push({value:4,text:"VTX_POWER_LEVEL_5"}),t},vtxChannelOptions(){return[{value:0,text:"VTX_CHANNEL_1"},{value:1,text:"VTX_CHANNEL_2"},{value:2,text:"VTX_CHANNEL_3"},{value:3,text:"VTX_CHANNEL_4"},{value:4,text:"VTX_CHANNEL_5"},{value:5,text:"VTX_CHANNEL_6"},{value:6,text:"VTX_CHANNEL_7"},{value:7,text:"VTX_CHANNEL_8"}]},vtxPitModeOptions(){return[{value:0,text:"Off"},{value:1,text:"On"}]}},created(){this.vtx.update_vtx_settings(!0)}}),oY={class:"card"},aY=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"VTX")],-1),lY={class:"card-content"},cY={class:"content columns"},uY={class:"column field-is-3"},dY={class:"field is-horizontal"},hY=p("div",{class:"field-label"},[p("label",{class:"label"},"Protocol")],-1),fY={class:"field-body"},pY={class:"field"},mY={class:"control is-expanded"},gY={class:"field is-horizontal"},_Y=p("div",{class:"field-label"},[p("label",{class:"label"},"Frequency")],-1),vY={class:"field-body"},yY={class:"field"},bY={class:"control is-expanded"},wY={class:"field is-horizontal"},xY=p("div",{class:"field-label"},[p("label",{class:"label"},"Band")],-1),SY={class:"field-body"},EY={class:"field"},TY={class:"control is-expanded"},AY={class:"field is-horizontal"},MY=p("div",{class:"field-label"},[p("label",{class:"label"},"Channel")],-1),RY={class:"field-body"},kY={class:"field"},CY={class:"control is-expanded"},PY={key:0,class:"field is-horizontal"},OY=p("div",{class:"field-label"},[p("label",{class:"label"},"Pit Mode")],-1),IY={class:"field-body"},LY={class:"field"},DY={class:"control is-expanded"},NY={class:"field is-horizontal"},FY=p("div",{class:"field-label"},[p("label",{class:"label"},"Power")],-1),UY={class:"field-body"},$Y={class:"field"},BY={class:"control is-expanded"},HY={key:1,class:"is-size-5 has-text-centered has-text-weight-semibold"},GY={class:"column field-is-3"},zY={class:"columns"},VY=p("div",{class:"column is-4",style:{"margin-left":"30%"}},[p("h6",{class:"mb-1 ml-2"},"Label")],-1),WY={key:0,class:"column is-4"},jY=p("h6",{class:"mb-1 ml-3"},"Value",-1),qY=[jY],YY={class:"field field-is-2 is-horizontal"},XY={class:"field-label"},KY={class:"label"},ZY={class:"field-body"},JY={class:"field"},QY={class:"control is-expanded"},eX={class:"columns is-multiline"},tX={class:"column is-6"},nX=["id","onUpdate:modelValue","readonly"],sX={key:0,class:"column is-6"},iX=["id","onUpdate:modelValue"],rX={class:"card-footer"},oX=p("span",{class:"card-footer-item"},null,-1);function aX(t,e,n,s,i,r){const o=Oe("input-select"),a=Oe("spinner-btn");return Z(),ie("div",oY,[aY,p("div",lY,[p("div",cY,[p("div",uY,[p("div",dY,[hY,p("div",fY,[p("div",pY,[p("div",mY,[Y(o,{id:"vtx-protocol",modelValue:t.vtx.settings.protocol,"onUpdate:modelValue":e[0]||(e[0]=l=>t.vtx.settings.protocol=l),modelModifiers:{number:!0},options:t.vtxProtocolOptions},null,8,["modelValue","options"])])])])]),t.vtx.settings.detected?(Z(),ie(ot,{key:0},[p("div",gY,[_Y,p("div",vY,[p("div",yY,[p("div",bY,Be(t.frequencyTable[t.vtx.settings.band][t.vtx.settings.channel]),1)])])]),p("div",wY,[xY,p("div",SY,[p("div",EY,[p("div",TY,[Y(o,{id:"vtx-band",modelValue:t.vtx.settings.band,"onUpdate:modelValue":e[1]||(e[1]=l=>t.vtx.settings.band=l),modelModifiers:{number:!0},options:t.vtxBandOptions},null,8,["modelValue","options"])])])])]),p("div",AY,[MY,p("div",RY,[p("div",kY,[p("div",CY,[Y(o,{id:"vtx-channel",modelValue:t.vtx.settings.channel,"onUpdate:modelValue":e[2]||(e[2]=l=>t.vtx.settings.channel=l),modelModifiers:{number:!0},options:t.vtxChannelOptions},null,8,["modelValue","options"])])])])]),t.vtx.settings.pit_mode!=2?(Z(),ie("div",PY,[OY,p("div",IY,[p("div",LY,[p("div",DY,[Y(o,{id:"vtx-pit-mode",modelValue:t.vtx.settings.pit_mode,"onUpdate:modelValue":e[3]||(e[3]=l=>t.vtx.settings.pit_mode=l),modelModifiers:{number:!0},options:t.vtxPitModeOptions},null,8,["modelValue","options"])])])])])):ze("",!0),p("div",NY,[FY,p("div",UY,[p("div",$Y,[p("div",BY,[Y(o,{id:"vtx-power-level",modelValue:t.vtx.settings.power_level,"onUpdate:modelValue":e[4]||(e[4]=l=>t.vtx.settings.power_level=l),modelModifiers:{number:!0},options:t.vtxPowerLevelOptions},null,8,["modelValue","options"])])])])])],64)):(Z(),ie("div",HY," Not detected "))]),p("div",GY,[t.vtx.settings.detected&&t.vtx.settings.power_table?(Z(),ie(ot,{key:0},[p("div",zY,[VY,t.displayValueEdit?(Z(),ie("div",WY,qY)):ze("",!0)]),(Z(!0),ie(ot,null,qt(t.vtx.settings.power_table.labels,(l,c)=>(Z(),ie("div",YY,[p("div",XY,[p("label",KY,"Power Level "+Be(c+1),1)]),p("div",ZY,[p("div",JY,[p("div",QY,[p("div",eX,[p("div",tX,[Ye(p("input",{id:"power-level-value-"+c,"onUpdate:modelValue":u=>t.vtx.settings.power_table.labels[c]=u,class:ms(["input",{"is-static":t.vtx.settings.protocol==3}]),readonly:t.vtx.settings.protocol==3,type:"text",maxlength:"3"},null,10,nX),[[st,t.vtx.settings.power_table.labels[c],void 0,{text:!0}]])]),t.displayValueEdit?(Z(),ie("div",sX,[Ye(p("input",{id:"power-level-value-"+c,"onUpdate:modelValue":u=>t.vtx.settings.power_table.values[c]=u,class:"input",type:"number",step:"0.1",min:"0"},null,8,iX),[[st,t.vtx.settings.power_table.values[c],void 0,{number:!0}]])])):ze("",!0)])])])])]))),256))],64)):ze("",!0)])])]),p("footer",rX,[oX,Y(a,{class:"card-footer-item is-primary",onClick:e[5]||(e[5]=l=>t.vtx.apply_vtx_settings(t.vtx.settings))},{default:nt(()=>[me(" Apply ")]),_:1})])])}const lX=lt(rY,[["render",aX]]);/** + * @license + * Copyright 2010-2024 Three.js Authors + * SPDX-License-Identifier: MIT + */const ox="164",cX=0,ME=1,uX=2,LC=1,dX=2,Jr=3,Mo=0,Vs=1,br=2,Oa=0,xu=1,RE=2,kE=3,CE=4,hX=5,Rl=100,fX=101,pX=102,mX=103,gX=104,_X=200,vX=201,yX=202,bX=203,ky=204,Cy=205,wX=206,xX=207,SX=208,EX=209,TX=210,AX=211,MX=212,RX=213,kX=214,CX=0,PX=1,OX=2,$g=3,IX=4,LX=5,DX=6,NX=7,DC=0,FX=1,UX=2,Ia=0,$X=1,BX=2,HX=3,GX=4,zX=5,VX=6,WX=7,PE="attached",jX="detached",NC=300,qu=301,Yu=302,Py=303,Oy=304,p0=306,Xu=1e3,xa=1001,Bg=1002,Cs=1003,FC=1004,yh=1005,oi=1006,tg=1007,fo=1008,$a=1009,qX=1010,YX=1011,UC=1012,$C=1013,Ku=1014,xr=1015,m0=1016,BC=1017,HC=1018,ep=1020,XX=35902,KX=1021,ZX=1022,Ji=1023,JX=1024,QX=1025,Su=1026,gf=1027,GC=1028,zC=1029,eK=1030,VC=1031,WC=1033,R1=33776,k1=33777,C1=33778,P1=33779,OE=35840,IE=35841,LE=35842,DE=35843,NE=36196,FE=37492,UE=37496,$E=37808,BE=37809,HE=37810,GE=37811,zE=37812,VE=37813,WE=37814,jE=37815,qE=37816,YE=37817,XE=37818,KE=37819,ZE=37820,JE=37821,O1=36492,QE=36494,eT=36495,tK=36283,tT=36284,nT=36285,sT=36286,_f=2300,Zu=2301,I1=2302,iT=2400,rT=2401,oT=2402,nK=2500,sK=0,jC=1,Iy=2,iK=3200,rK=3201,qC=0,oK=1,va="",Ms="srgb",ss="srgb-linear",ax="display-p3",g0="display-p3-linear",Hg="linear",an="srgb",Gg="rec709",zg="p3",Ec=7680,aT=519,aK=512,lK=513,cK=514,YC=515,uK=516,dK=517,hK=518,fK=519,Ly=35044,lT="300 es",po=2e3,Vg=2001;class Ad{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(n)===-1&&s[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r>8&255]+ls[t>>16&255]+ls[t>>24&255]+"-"+ls[e&255]+ls[e>>8&255]+"-"+ls[e>>16&15|64]+ls[e>>24&255]+"-"+ls[n&63|128]+ls[n>>8&255]+"-"+ls[n>>16&255]+ls[n>>24&255]+ls[s&255]+ls[s>>8&255]+ls[s>>16&255]+ls[s>>24&255]).toLowerCase()}function fs(t,e,n){return Math.max(e,Math.min(n,t))}function lx(t,e){return(t%e+e)%e}function pK(t,e,n,s,i){return s+(t-e)*(i-s)/(n-e)}function mK(t,e,n){return t!==e?(n-t)/(e-t):0}function Hh(t,e,n){return(1-n)*t+n*e}function gK(t,e,n,s){return Hh(t,e,1-Math.exp(-n*s))}function _K(t,e=1){return e-Math.abs(lx(t,e*2)-e)}function vK(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function yK(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function bK(t,e){return t+Math.floor(Math.random()*(e-t+1))}function wK(t,e){return t+Math.random()*(e-t)}function xK(t){return t*(.5-Math.random())}function SK(t){t!==void 0&&(cT=t);let e=cT+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function EK(t){return t*Bh}function TK(t){return t*Ju}function AK(t){return(t&t-1)===0&&t!==0}function MK(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function RK(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function kK(t,e,n,s,i){const r=Math.cos,o=Math.sin,a=r(n/2),l=o(n/2),c=r((e+s)/2),u=o((e+s)/2),d=r((e-s)/2),h=o((e-s)/2),f=r((s-e)/2),v=o((s-e)/2);switch(i){case"XYX":t.set(a*u,l*d,l*h,a*c);break;case"YZY":t.set(l*h,a*u,l*d,a*c);break;case"ZXZ":t.set(l*d,l*h,a*u,a*c);break;case"XZX":t.set(a*u,l*v,l*f,a*c);break;case"YXY":t.set(l*f,a*u,l*v,a*c);break;case"ZYZ":t.set(l*v,l*f,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Xi(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function zt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const CK={DEG2RAD:Bh,RAD2DEG:Ju,generateUUID:er,clamp:fs,euclideanModulo:lx,mapLinear:pK,inverseLerp:mK,lerp:Hh,damp:gK,pingpong:_K,smoothstep:vK,smootherstep:yK,randInt:bK,randFloat:wK,randFloatSpread:xK,seededRandom:SK,degToRad:EK,radToDeg:TK,isPowerOfTwo:AK,ceilPowerOfTwo:MK,floorPowerOfTwo:RK,setQuaternionFromProperEuler:kK,normalize:zt,denormalize:Xi};class Rt{constructor(e=0,n=0){Rt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,s=this.y,i=e.elements;return this.x=i[0]*n+i[3]*s+i[6],this.y=i[1]*n+i[4]*s+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(n,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const s=this.dot(e)/n;return Math.acos(fs(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,s=this.y-e.y;return n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,s){return this.x=e.x+(n.x-e.x)*s,this.y=e.y+(n.y-e.y)*s,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const s=Math.cos(n),i=Math.sin(n),r=this.x-e.x,o=this.y-e.y;return this.x=r*s-o*i+e.x,this.y=r*i+o*s+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class wt{constructor(e,n,s,i,r,o,a,l,c){wt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,s,i,r,o,a,l,c)}set(e,n,s,i,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=r,u[5]=l,u[6]=s,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,s=e.elements;return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],this}extractBasis(e,n,s){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const s=e.elements,i=n.elements,r=this.elements,o=s[0],a=s[3],l=s[6],c=s[1],u=s[4],d=s[7],h=s[2],f=s[5],v=s[8],_=i[0],m=i[3],g=i[6],y=i[1],b=i[4],w=i[7],T=i[2],x=i[5],A=i[8];return r[0]=o*_+a*y+l*T,r[3]=o*m+a*b+l*x,r[6]=o*g+a*w+l*A,r[1]=c*_+u*y+d*T,r[4]=c*m+u*b+d*x,r[7]=c*g+u*w+d*A,r[2]=h*_+f*y+v*T,r[5]=h*m+f*b+v*x,r[8]=h*g+f*w+v*A,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*o*u-n*a*c-s*r*u+s*a*l+i*r*c-i*o*l}invert(){const e=this.elements,n=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,h=a*l-u*r,f=c*r-o*l,v=n*d+s*h+i*f;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=d*_,e[1]=(i*c-u*s)*_,e[2]=(a*s-i*o)*_,e[3]=h*_,e[4]=(u*n-i*l)*_,e[5]=(i*r-a*n)*_,e[6]=f*_,e[7]=(s*l-c*n)*_,e[8]=(o*n-s*r)*_,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,s,i,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(s*l,s*c,-s*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(L1.makeScale(e,n)),this}rotate(e){return this.premultiply(L1.makeRotation(-e)),this}translate(e,n){return this.premultiply(L1.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),s=Math.sin(e);return this.set(n,-s,0,s,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,s=e.elements;for(let i=0;i<9;i++)if(n[i]!==s[i])return!1;return!0}fromArray(e,n=0){for(let s=0;s<9;s++)this.elements[s]=e[s+n];return this}toArray(e=[],n=0){const s=this.elements;return e[n]=s[0],e[n+1]=s[1],e[n+2]=s[2],e[n+3]=s[3],e[n+4]=s[4],e[n+5]=s[5],e[n+6]=s[6],e[n+7]=s[7],e[n+8]=s[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const L1=new wt;function XC(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function vf(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function PK(){const t=vf("canvas");return t.style.display="block",t}const uT={};function KC(t){t in uT||(uT[t]=!0,console.warn(t))}const dT=new wt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),hT=new wt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),kp={[ss]:{transfer:Hg,primaries:Gg,toReference:t=>t,fromReference:t=>t},[Ms]:{transfer:an,primaries:Gg,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[g0]:{transfer:Hg,primaries:zg,toReference:t=>t.applyMatrix3(hT),fromReference:t=>t.applyMatrix3(dT)},[ax]:{transfer:an,primaries:zg,toReference:t=>t.convertSRGBToLinear().applyMatrix3(hT),fromReference:t=>t.applyMatrix3(dT).convertLinearToSRGB()}},OK=new Set([ss,g0]),Bt={enabled:!0,_workingColorSpace:ss,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!OK.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const s=kp[e].toReference,i=kp[n].fromReference;return i(s(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return kp[t].primaries},getTransfer:function(t){return t===va?Hg:kp[t].transfer}};function Eu(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function D1(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Tc;class IK{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Tc===void 0&&(Tc=vf("canvas")),Tc.width=e.width,Tc.height=e.height;const s=Tc.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=Tc}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=vf("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height);const i=s.getImageData(0,0,e.width,e.height),r=i.data;for(let o=0;o0&&(s.userData=this.userData),n||(e.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==NC)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Xu:e.x=e.x-Math.floor(e.x);break;case xa:e.x=e.x<0?0:1;break;case Bg:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Xu:e.y=e.y-Math.floor(e.y);break;case xa:e.y=e.y<0?0:1;break;case Bg:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}es.DEFAULT_IMAGE=null;es.DEFAULT_MAPPING=NC;es.DEFAULT_ANISOTROPY=1;class Kt{constructor(e=0,n=0,s=0,i=1){Kt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=s,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,s,i){return this.x=e,this.y=n,this.z=s,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,s=this.y,i=this.z,r=this.w,o=e.elements;return this.x=o[0]*n+o[4]*s+o[8]*i+o[12]*r,this.y=o[1]*n+o[5]*s+o[9]*i+o[13]*r,this.z=o[2]*n+o[6]*s+o[10]*i+o[14]*r,this.w=o[3]*n+o[7]*s+o[11]*i+o[15]*r,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,s,i,r;const l=e.elements,c=l[0],u=l[4],d=l[8],h=l[1],f=l[5],v=l[9],_=l[2],m=l[6],g=l[10];if(Math.abs(u-h)<.01&&Math.abs(d-_)<.01&&Math.abs(v-m)<.01){if(Math.abs(u+h)<.1&&Math.abs(d+_)<.1&&Math.abs(v+m)<.1&&Math.abs(c+f+g-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const b=(c+1)/2,w=(f+1)/2,T=(g+1)/2,x=(u+h)/4,A=(d+_)/4,M=(v+m)/4;return b>w&&b>T?b<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(b),i=x/s,r=A/s):w>T?w<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(w),s=x/i,r=M/i):T<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(T),s=A/r,i=M/r),this.set(s,i,r,n),this}let y=Math.sqrt((m-v)*(m-v)+(d-_)*(d-_)+(h-u)*(h-u));return Math.abs(y)<.001&&(y=1),this.x=(m-v)/y,this.y=(d-_)/y,this.z=(h-u)/y,this.w=Math.acos((c+f+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(n,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,s){return this.x=e.x+(n.x-e.x)*s,this.y=e.y+(n.y-e.y)*s,this.z=e.z+(n.z-e.z)*s,this.w=e.w+(n.w-e.w)*s,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class NK extends Ad{constructor(e=1,n=1,s={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Kt(0,0,e,n),this.scissorTest=!1,this.viewport=new Kt(0,0,e,n);const i={width:e,height:n,depth:1};s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:oi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},s);const r=new es(i,s.mapping,s.wrapS,s.wrapT,s.magFilter,s.minFilter,s.format,s.type,s.anisotropy,s.colorSpace);r.flipY=!1,r.generateMipmaps=s.generateMipmaps,r.internalFormat=s.internalFormat,this.textures=[];const o=s.count;for(let a=0;a=0?1:-1,b=1-g*g;if(b>Number.EPSILON){const T=Math.sqrt(b),x=Math.atan2(T,g*y);m=Math.sin(m*x)/T,a=Math.sin(a*x)/T}const w=a*y;if(l=l*m+h*w,c=c*m+f*w,u=u*m+v*w,d=d*m+_*w,m===1-a){const T=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=T,c*=T,u*=T,d*=T}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,s,i,r,o){const a=s[i],l=s[i+1],c=s[i+2],u=s[i+3],d=r[o],h=r[o+1],f=r[o+2],v=r[o+3];return e[n]=a*v+u*d+l*f-c*h,e[n+1]=l*v+u*h+c*d-a*f,e[n+2]=c*v+u*f+a*h-l*d,e[n+3]=u*v-a*d-l*h-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,s,i){return this._x=e,this._y=n,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const s=e._x,i=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(s/2),u=a(i/2),d=a(r/2),h=l(s/2),f=l(i/2),v=l(r/2);switch(o){case"XYZ":this._x=h*u*d+c*f*v,this._y=c*f*d-h*u*v,this._z=c*u*v+h*f*d,this._w=c*u*d-h*f*v;break;case"YXZ":this._x=h*u*d+c*f*v,this._y=c*f*d-h*u*v,this._z=c*u*v-h*f*d,this._w=c*u*d+h*f*v;break;case"ZXY":this._x=h*u*d-c*f*v,this._y=c*f*d+h*u*v,this._z=c*u*v+h*f*d,this._w=c*u*d-h*f*v;break;case"ZYX":this._x=h*u*d-c*f*v,this._y=c*f*d+h*u*v,this._z=c*u*v-h*f*d,this._w=c*u*d+h*f*v;break;case"YZX":this._x=h*u*d+c*f*v,this._y=c*f*d+h*u*v,this._z=c*u*v-h*f*d,this._w=c*u*d-h*f*v;break;case"XZY":this._x=h*u*d-c*f*v,this._y=c*f*d-h*u*v,this._z=c*u*v+h*f*d,this._w=c*u*d+h*f*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const s=n/2,i=Math.sin(s);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,s=n[0],i=n[4],r=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],d=n[10],h=s+a+d;if(h>0){const f=.5/Math.sqrt(h+1);this._w=.25/f,this._x=(u-l)*f,this._y=(r-c)*f,this._z=(o-i)*f}else if(s>a&&s>d){const f=2*Math.sqrt(1+s-a-d);this._w=(u-l)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+c)/f}else if(a>d){const f=2*Math.sqrt(1+a-s-d);this._w=(r-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+d-s-a);this._w=(o-i)/f,this._x=(r+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let s=e.dot(n)+1;return sMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=s):(this._x=0,this._y=-e.z,this._z=e.y,this._w=s)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=s),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(fs(this.dot(e),-1,1)))}rotateTowards(e,n){const s=this.angleTo(e);if(s===0)return this;const i=Math.min(1,n/s);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const s=e._x,i=e._y,r=e._z,o=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=s*u+o*a+i*c-r*l,this._y=i*u+o*l+r*a-s*c,this._z=r*u+o*c+s*l-i*a,this._w=o*u-s*a-i*l-r*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const s=this._x,i=this._y,r=this._z,o=this._w;let a=o*e._w+s*e._x+i*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=s,this._y=i,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const f=1-n;return this._w=f*o+n*this._w,this._x=f*s+n*this._x,this._y=f*i+n*this._y,this._z=f*r+n*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),d=Math.sin((1-n)*u)/c,h=Math.sin(n*u)/c;return this._w=o*d+this._w*h,this._x=s*d+this._x*h,this._y=i*d+this._y*h,this._z=r*d+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,n,s){return this.copy(e).slerp(n,s)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),r=Math.sqrt(s);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(n),r*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class re{constructor(e=0,n=0,s=0){re.prototype.isVector3=!0,this.x=e,this.y=n,this.z=s}set(e,n,s){return s===void 0&&(s=this.z),this.x=e,this.y=n,this.z=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(fT.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(fT.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[3]*s+r[6]*i,this.y=r[1]*n+r[4]*s+r[7]*i,this.z=r[2]*n+r[5]*s+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,s=this.y,i=this.z,r=e.elements,o=1/(r[3]*n+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*n+r[4]*s+r[8]*i+r[12])*o,this.y=(r[1]*n+r[5]*s+r[9]*i+r[13])*o,this.z=(r[2]*n+r[6]*s+r[10]*i+r[14])*o,this}applyQuaternion(e){const n=this.x,s=this.y,i=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*i-a*s),u=2*(a*n-r*i),d=2*(r*s-o*n);return this.x=n+l*c+o*d-a*u,this.y=s+l*u+a*c-r*d,this.z=i+l*d+r*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,s=this.y,i=this.z,r=e.elements;return this.x=r[0]*n+r[4]*s+r[8]*i,this.y=r[1]*n+r[5]*s+r[9]*i,this.z=r[2]*n+r[6]*s+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const s=this.length();return this.divideScalar(s||1).multiplyScalar(Math.max(e,Math.min(n,s)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,s){return this.x=e.x+(n.x-e.x)*s,this.y=e.y+(n.y-e.y)*s,this.z=e.z+(n.z-e.z)*s,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const s=e.x,i=e.y,r=e.z,o=n.x,a=n.y,l=n.z;return this.x=i*l-r*a,this.y=r*o-s*l,this.z=s*a-i*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const s=e.dot(this)/n;return this.copy(e).multiplyScalar(s)}projectOnPlane(e){return F1.copy(this).projectOnVector(e),this.sub(F1)}reflect(e){return this.sub(F1.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const s=this.dot(e)/n;return Math.acos(fs(s,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,s=this.y-e.y,i=this.z-e.z;return n*n+s*s+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,s){const i=Math.sin(n)*e;return this.x=i*Math.sin(s),this.y=Math.cos(n)*e,this.z=i*Math.cos(s),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,s){return this.x=e*Math.sin(n),this.y=s,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),s=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=s,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,s=Math.sqrt(1-n*n);return this.x=s*Math.cos(e),this.y=n,this.z=s*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const F1=new re,fT=new No;class Fo{constructor(e=new re(1/0,1/0,1/0),n=new re(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,s=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Oi),Oi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,s;return e.normal.x>0?(n=e.normal.x*this.min.x,s=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,s=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,s+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,s+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,s+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,s+=e.normal.z*this.min.z),n<=-e.constant&&s>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Xd),Pp.subVectors(this.max,Xd),Ac.subVectors(e.a,Xd),Mc.subVectors(e.b,Xd),Rc.subVectors(e.c,Xd),zo.subVectors(Mc,Ac),Vo.subVectors(Rc,Mc),al.subVectors(Ac,Rc);let n=[0,-zo.z,zo.y,0,-Vo.z,Vo.y,0,-al.z,al.y,zo.z,0,-zo.x,Vo.z,0,-Vo.x,al.z,0,-al.x,-zo.y,zo.x,0,-Vo.y,Vo.x,0,-al.y,al.x,0];return!U1(n,Ac,Mc,Rc,Pp)||(n=[1,0,0,0,1,0,0,0,1],!U1(n,Ac,Mc,Rc,Pp))?!1:(Op.crossVectors(zo,Vo),n=[Op.x,Op.y,Op.z],U1(n,Ac,Mc,Rc,Pp))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Oi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Oi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(zr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),zr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),zr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),zr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),zr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),zr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),zr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),zr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(zr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const zr=[new re,new re,new re,new re,new re,new re,new re,new re],Oi=new re,Cp=new Fo,Ac=new re,Mc=new re,Rc=new re,zo=new re,Vo=new re,al=new re,Xd=new re,Pp=new re,Op=new re,ll=new re;function U1(t,e,n,s,i){for(let r=0,o=t.length-3;r<=o;r+=3){ll.fromArray(t,r);const a=i.x*Math.abs(ll.x)+i.y*Math.abs(ll.y)+i.z*Math.abs(ll.z),l=e.dot(ll),c=n.dot(ll),u=s.dot(ll);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const UK=new Fo,Kd=new re,$1=new re;class Nr{constructor(e=new re,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const s=this.center;n!==void 0?s.copy(n):UK.setFromPoints(e).getCenter(s);let i=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Kd.subVectors(e,this.center);const n=Kd.lengthSq();if(n>this.radius*this.radius){const s=Math.sqrt(n),i=(s-this.radius)*.5;this.center.addScaledVector(Kd,i/s),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):($1.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Kd.copy(e.center).add($1)),this.expandByPoint(Kd.copy(e.center).sub($1))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Vr=new re,B1=new re,Ip=new re,Wo=new re,H1=new re,Lp=new re,G1=new re;class _0{constructor(e=new re,n=new re(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Vr)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const s=n.dot(this.direction);return s<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=Vr.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(Vr.copy(this.origin).addScaledVector(this.direction,n),Vr.distanceToSquared(e))}distanceSqToSegment(e,n,s,i){B1.copy(e).add(n).multiplyScalar(.5),Ip.copy(n).sub(e).normalize(),Wo.copy(this.origin).sub(B1);const r=e.distanceTo(n)*.5,o=-this.direction.dot(Ip),a=Wo.dot(this.direction),l=-Wo.dot(Ip),c=Wo.lengthSq(),u=Math.abs(1-o*o);let d,h,f,v;if(u>0)if(d=o*l-a,h=o*a-l,v=r*u,d>=0)if(h>=-v)if(h<=v){const _=1/u;d*=_,h*=_,f=d*(d+o*h+2*a)+h*(o*d+h+2*l)+c}else h=r,d=Math.max(0,-(o*h+a)),f=-d*d+h*(h+2*l)+c;else h=-r,d=Math.max(0,-(o*h+a)),f=-d*d+h*(h+2*l)+c;else h<=-v?(d=Math.max(0,-(-o*r+a)),h=d>0?-r:Math.min(Math.max(-r,-l),r),f=-d*d+h*(h+2*l)+c):h<=v?(d=0,h=Math.min(Math.max(-r,-l),r),f=h*(h+2*l)+c):(d=Math.max(0,-(o*r+a)),h=d>0?r:Math.min(Math.max(-r,-l),r),f=-d*d+h*(h+2*l)+c);else h=o>0?-r:r,d=Math.max(0,-(o*h+a)),f=-d*d+h*(h+2*l)+c;return s&&s.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(B1).addScaledVector(Ip,h),f}intersectSphere(e,n){Vr.subVectors(e.center,this.origin);const s=Vr.dot(this.direction),i=Vr.dot(Vr)-s*s,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=s-o,l=s+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(e.normal)+e.constant)/n;return s>=0?s:null}intersectPlane(e,n){const s=this.distanceToPlane(e);return s===null?null:this.at(s,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let s,i,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,h=this.origin;return c>=0?(s=(e.min.x-h.x)*c,i=(e.max.x-h.x)*c):(s=(e.max.x-h.x)*c,i=(e.min.x-h.x)*c),u>=0?(r=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(r=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),s>o||r>i||((r>s||isNaN(s))&&(s=r),(o=0?(a=(e.min.z-h.z)*d,l=(e.max.z-h.z)*d):(a=(e.max.z-h.z)*d,l=(e.min.z-h.z)*d),s>l||a>i)||((a>s||s!==s)&&(s=a),(l=0?s:i,n)}intersectsBox(e){return this.intersectBox(e,Vr)!==null}intersectTriangle(e,n,s,i,r){H1.subVectors(n,e),Lp.subVectors(s,e),G1.crossVectors(H1,Lp);let o=this.direction.dot(G1),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Wo.subVectors(this.origin,e);const l=a*this.direction.dot(Lp.crossVectors(Wo,Lp));if(l<0)return null;const c=a*this.direction.dot(H1.cross(Wo));if(c<0||l+c>o)return null;const u=-a*Wo.dot(G1);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class xt{constructor(e,n,s,i,r,o,a,l,c,u,d,h,f,v,_,m){xt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,s,i,r,o,a,l,c,u,d,h,f,v,_,m)}set(e,n,s,i,r,o,a,l,c,u,d,h,f,v,_,m){const g=this.elements;return g[0]=e,g[4]=n,g[8]=s,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=d,g[14]=h,g[3]=f,g[7]=v,g[11]=_,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new xt().fromArray(this.elements)}copy(e){const n=this.elements,s=e.elements;return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],this}copyPosition(e){const n=this.elements,s=e.elements;return n[12]=s[12],n[13]=s[13],n[14]=s[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,s){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(e,n,s){return this.set(e.x,n.x,s.x,0,e.y,n.y,s.y,0,e.z,n.z,s.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,s=e.elements,i=1/kc.setFromMatrixColumn(e,0).length(),r=1/kc.setFromMatrixColumn(e,1).length(),o=1/kc.setFromMatrixColumn(e,2).length();return n[0]=s[0]*i,n[1]=s[1]*i,n[2]=s[2]*i,n[3]=0,n[4]=s[4]*r,n[5]=s[5]*r,n[6]=s[6]*r,n[7]=0,n[8]=s[8]*o,n[9]=s[9]*o,n[10]=s[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,s=e.x,i=e.y,r=e.z,o=Math.cos(s),a=Math.sin(s),l=Math.cos(i),c=Math.sin(i),u=Math.cos(r),d=Math.sin(r);if(e.order==="XYZ"){const h=o*u,f=o*d,v=a*u,_=a*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=f+v*c,n[5]=h-_*c,n[9]=-a*l,n[2]=_-h*c,n[6]=v+f*c,n[10]=o*l}else if(e.order==="YXZ"){const h=l*u,f=l*d,v=c*u,_=c*d;n[0]=h+_*a,n[4]=v*a-f,n[8]=o*c,n[1]=o*d,n[5]=o*u,n[9]=-a,n[2]=f*a-v,n[6]=_+h*a,n[10]=o*l}else if(e.order==="ZXY"){const h=l*u,f=l*d,v=c*u,_=c*d;n[0]=h-_*a,n[4]=-o*d,n[8]=v+f*a,n[1]=f+v*a,n[5]=o*u,n[9]=_-h*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const h=o*u,f=o*d,v=a*u,_=a*d;n[0]=l*u,n[4]=v*c-f,n[8]=h*c+_,n[1]=l*d,n[5]=_*c+h,n[9]=f*c-v,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const h=o*l,f=o*c,v=a*l,_=a*c;n[0]=l*u,n[4]=_-h*d,n[8]=v*d+f,n[1]=d,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=f*d+v,n[10]=h-_*d}else if(e.order==="XZY"){const h=o*l,f=o*c,v=a*l,_=a*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=h*d+_,n[5]=o*u,n[9]=f*d-v,n[2]=v*d-f,n[6]=a*u,n[10]=_*d+h}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose($K,e,BK)}lookAt(e,n,s){const i=this.elements;return Ys.subVectors(e,n),Ys.lengthSq()===0&&(Ys.z=1),Ys.normalize(),jo.crossVectors(s,Ys),jo.lengthSq()===0&&(Math.abs(s.z)===1?Ys.x+=1e-4:Ys.z+=1e-4,Ys.normalize(),jo.crossVectors(s,Ys)),jo.normalize(),Dp.crossVectors(Ys,jo),i[0]=jo.x,i[4]=Dp.x,i[8]=Ys.x,i[1]=jo.y,i[5]=Dp.y,i[9]=Ys.y,i[2]=jo.z,i[6]=Dp.z,i[10]=Ys.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const s=e.elements,i=n.elements,r=this.elements,o=s[0],a=s[4],l=s[8],c=s[12],u=s[1],d=s[5],h=s[9],f=s[13],v=s[2],_=s[6],m=s[10],g=s[14],y=s[3],b=s[7],w=s[11],T=s[15],x=i[0],A=i[4],M=i[8],E=i[12],S=i[1],P=i[5],D=i[9],k=i[13],U=i[2],z=i[6],G=i[10],J=i[14],B=i[3],fe=i[7],se=i[11],we=i[15];return r[0]=o*x+a*S+l*U+c*B,r[4]=o*A+a*P+l*z+c*fe,r[8]=o*M+a*D+l*G+c*se,r[12]=o*E+a*k+l*J+c*we,r[1]=u*x+d*S+h*U+f*B,r[5]=u*A+d*P+h*z+f*fe,r[9]=u*M+d*D+h*G+f*se,r[13]=u*E+d*k+h*J+f*we,r[2]=v*x+_*S+m*U+g*B,r[6]=v*A+_*P+m*z+g*fe,r[10]=v*M+_*D+m*G+g*se,r[14]=v*E+_*k+m*J+g*we,r[3]=y*x+b*S+w*U+T*B,r[7]=y*A+b*P+w*z+T*fe,r[11]=y*M+b*D+w*G+T*se,r[15]=y*E+b*k+w*J+T*we,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],s=e[4],i=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],h=e[10],f=e[14],v=e[3],_=e[7],m=e[11],g=e[15];return v*(+r*l*d-i*c*d-r*a*h+s*c*h+i*a*f-s*l*f)+_*(+n*l*f-n*c*h+r*o*h-i*o*f+i*c*u-r*l*u)+m*(+n*c*d-n*a*f-r*o*d+s*o*f+r*a*u-s*c*u)+g*(-i*a*u-n*l*d+n*a*h+i*o*d-s*o*h+s*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,s){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=s),this}invert(){const e=this.elements,n=e[0],s=e[1],i=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],h=e[10],f=e[11],v=e[12],_=e[13],m=e[14],g=e[15],y=d*m*c-_*h*c+_*l*f-a*m*f-d*l*g+a*h*g,b=v*h*c-u*m*c-v*l*f+o*m*f+u*l*g-o*h*g,w=u*_*c-v*d*c+v*a*f-o*_*f-u*a*g+o*d*g,T=v*d*l-u*_*l-v*a*h+o*_*h+u*a*m-o*d*m,x=n*y+s*b+i*w+r*T;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/x;return e[0]=y*A,e[1]=(_*h*r-d*m*r-_*i*f+s*m*f+d*i*g-s*h*g)*A,e[2]=(a*m*r-_*l*r+_*i*c-s*m*c-a*i*g+s*l*g)*A,e[3]=(d*l*r-a*h*r-d*i*c+s*h*c+a*i*f-s*l*f)*A,e[4]=b*A,e[5]=(u*m*r-v*h*r+v*i*f-n*m*f-u*i*g+n*h*g)*A,e[6]=(v*l*r-o*m*r-v*i*c+n*m*c+o*i*g-n*l*g)*A,e[7]=(o*h*r-u*l*r+u*i*c-n*h*c-o*i*f+n*l*f)*A,e[8]=w*A,e[9]=(v*d*r-u*_*r-v*s*f+n*_*f+u*s*g-n*d*g)*A,e[10]=(o*_*r-v*a*r+v*s*c-n*_*c-o*s*g+n*a*g)*A,e[11]=(u*a*r-o*d*r-u*s*c+n*d*c+o*s*f-n*a*f)*A,e[12]=T*A,e[13]=(u*_*i-v*d*i+v*s*h-n*_*h-u*s*m+n*d*m)*A,e[14]=(v*a*i-o*_*i-v*s*l+n*_*l+o*s*m-n*a*m)*A,e[15]=(o*d*i-u*a*i+u*s*l-n*d*l-o*s*h+n*a*h)*A,this}scale(e){const n=this.elements,s=e.x,i=e.y,r=e.z;return n[0]*=s,n[4]*=i,n[8]*=r,n[1]*=s,n[5]*=i,n[9]*=r,n[2]*=s,n[6]*=i,n[10]*=r,n[3]*=s,n[7]*=i,n[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],s=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,s,i))}makeTranslation(e,n,s){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,s,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),s=Math.sin(e);return this.set(1,0,0,0,0,n,-s,0,0,s,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),s=Math.sin(e);return this.set(n,0,s,0,0,1,0,0,-s,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),s=Math.sin(e);return this.set(n,-s,0,0,s,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const s=Math.cos(n),i=Math.sin(n),r=1-s,o=e.x,a=e.y,l=e.z,c=r*o,u=r*a;return this.set(c*o+s,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+s,u*l-i*o,0,c*l-i*a,u*l+i*o,r*l*l+s,0,0,0,0,1),this}makeScale(e,n,s){return this.set(e,0,0,0,0,n,0,0,0,0,s,0,0,0,0,1),this}makeShear(e,n,s,i,r,o){return this.set(1,s,r,0,e,1,o,0,n,i,1,0,0,0,0,1),this}compose(e,n,s){const i=this.elements,r=n._x,o=n._y,a=n._z,l=n._w,c=r+r,u=o+o,d=a+a,h=r*c,f=r*u,v=r*d,_=o*u,m=o*d,g=a*d,y=l*c,b=l*u,w=l*d,T=s.x,x=s.y,A=s.z;return i[0]=(1-(_+g))*T,i[1]=(f+w)*T,i[2]=(v-b)*T,i[3]=0,i[4]=(f-w)*x,i[5]=(1-(h+g))*x,i[6]=(m+y)*x,i[7]=0,i[8]=(v+b)*A,i[9]=(m-y)*A,i[10]=(1-(h+_))*A,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,s){const i=this.elements;let r=kc.set(i[0],i[1],i[2]).length();const o=kc.set(i[4],i[5],i[6]).length(),a=kc.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],Ii.copy(this);const c=1/r,u=1/o,d=1/a;return Ii.elements[0]*=c,Ii.elements[1]*=c,Ii.elements[2]*=c,Ii.elements[4]*=u,Ii.elements[5]*=u,Ii.elements[6]*=u,Ii.elements[8]*=d,Ii.elements[9]*=d,Ii.elements[10]*=d,n.setFromRotationMatrix(Ii),s.x=r,s.y=o,s.z=a,this}makePerspective(e,n,s,i,r,o,a=po){const l=this.elements,c=2*r/(n-e),u=2*r/(s-i),d=(n+e)/(n-e),h=(s+i)/(s-i);let f,v;if(a===po)f=-(o+r)/(o-r),v=-2*o*r/(o-r);else if(a===Vg)f=-o/(o-r),v=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=u,l[9]=h,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,s,i,r,o,a=po){const l=this.elements,c=1/(n-e),u=1/(s-i),d=1/(o-r),h=(n+e)*c,f=(s+i)*u;let v,_;if(a===po)v=(o+r)*d,_=-2*d;else if(a===Vg)v=r*d,_=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-h,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,s=e.elements;for(let i=0;i<16;i++)if(n[i]!==s[i])return!1;return!0}fromArray(e,n=0){for(let s=0;s<16;s++)this.elements[s]=e[s+n];return this}toArray(e=[],n=0){const s=this.elements;return e[n]=s[0],e[n+1]=s[1],e[n+2]=s[2],e[n+3]=s[3],e[n+4]=s[4],e[n+5]=s[5],e[n+6]=s[6],e[n+7]=s[7],e[n+8]=s[8],e[n+9]=s[9],e[n+10]=s[10],e[n+11]=s[11],e[n+12]=s[12],e[n+13]=s[13],e[n+14]=s[14],e[n+15]=s[15],e}}const kc=new re,Ii=new xt,$K=new re(0,0,0),BK=new re(1,1,1),jo=new re,Dp=new re,Ys=new re,pT=new xt,mT=new No;class Or{constructor(e=0,n=0,s=0,i=Or.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=s,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,s,i=this._order){return this._x=e,this._y=n,this._z=s,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,s=!0){const i=e.elements,r=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],d=i[2],h=i[6],f=i[10];switch(n){case"XYZ":this._y=Math.asin(fs(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-fs(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(fs(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-fs(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(h,f),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(fs(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(a,f));break;case"XZY":this._z=Math.asin(-fs(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,s===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,s){return pT.makeRotationFromQuaternion(e),this.setFromRotationMatrix(pT,n,s)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return mT.setFromEuler(this),this.setFromQuaternion(mT,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Or.DEFAULT_ORDER="XYZ";let QC=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let s=0;s0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(s.geometries=a),l.length>0&&(s.materials=l),c.length>0&&(s.textures=c),u.length>0&&(s.images=u),d.length>0&&(s.shapes=d),h.length>0&&(s.skeletons=h),f.length>0&&(s.animations=f),v.length>0&&(s.nodes=v)}return s.object=i,s;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let s=0;s0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,n,s,i,r){Li.subVectors(i,n),jr.subVectors(s,n),V1.subVectors(e,n);const o=Li.dot(Li),a=Li.dot(jr),l=Li.dot(V1),c=jr.dot(jr),u=jr.dot(V1),d=o*c-a*a;if(d===0)return r.set(0,0,0),null;const h=1/d,f=(c*l-a*u)*h,v=(o*u-a*l)*h;return r.set(1-f-v,v,f)}static containsPoint(e,n,s,i){return this.getBarycoord(e,n,s,i,qr)===null?!1:qr.x>=0&&qr.y>=0&&qr.x+qr.y<=1}static getInterpolation(e,n,s,i,r,o,a,l){return this.getBarycoord(e,n,s,i,qr)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,qr.x),l.addScaledVector(o,qr.y),l.addScaledVector(a,qr.z),l)}static isFrontFacing(e,n,s,i){return Li.subVectors(s,n),jr.subVectors(e,n),Li.cross(jr).dot(i)<0}set(e,n,s){return this.a.copy(e),this.b.copy(n),this.c.copy(s),this}setFromPointsAndIndices(e,n,s,i){return this.a.copy(e[n]),this.b.copy(e[s]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,s,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,s),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Li.subVectors(this.c,this.b),jr.subVectors(this.a,this.b),Li.cross(jr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return wr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return wr.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,s,i,r){return wr.getInterpolation(e,this.a,this.b,this.c,n,s,i,r)}containsPoint(e){return wr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return wr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const s=this.a,i=this.b,r=this.c;let o,a;Oc.subVectors(i,s),Ic.subVectors(r,s),W1.subVectors(e,s);const l=Oc.dot(W1),c=Ic.dot(W1);if(l<=0&&c<=0)return n.copy(s);j1.subVectors(e,i);const u=Oc.dot(j1),d=Ic.dot(j1);if(u>=0&&d<=u)return n.copy(i);const h=l*d-u*c;if(h<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(s).addScaledVector(Oc,o);q1.subVectors(e,r);const f=Oc.dot(q1),v=Ic.dot(q1);if(v>=0&&f<=v)return n.copy(r);const _=f*c-l*v;if(_<=0&&c>=0&&v<=0)return a=c/(c-v),n.copy(s).addScaledVector(Ic,a);const m=u*v-f*d;if(m<=0&&d-u>=0&&f-v>=0)return wT.subVectors(r,i),a=(d-u)/(d-u+(f-v)),n.copy(i).addScaledVector(wT,a);const g=1/(m+_+h);return o=_*g,a=h*g,n.copy(s).addScaledVector(Oc,o).addScaledVector(Ic,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const e8={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},qo={h:0,s:0,l:0},Fp={h:0,s:0,l:0};function Y1(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let ht=class{constructor(e,n,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,s)}set(e,n,s){if(n===void 0&&s===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,s);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Ms){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Bt.toWorkingColorSpace(this,n),this}setRGB(e,n,s,i=Bt.workingColorSpace){return this.r=e,this.g=n,this.b=s,Bt.toWorkingColorSpace(this,i),this}setHSL(e,n,s,i=Bt.workingColorSpace){if(e=lx(e,1),n=fs(n,0,1),s=fs(s,0,1),n===0)this.r=this.g=this.b=s;else{const r=s<=.5?s*(1+n):s+n-s*n,o=2*s-r;this.r=Y1(o,r,e+1/3),this.g=Y1(o,r,e),this.b=Y1(o,r,e-1/3)}return Bt.toWorkingColorSpace(this,i),this}setStyle(e,n=Ms){function s(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,n);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,n);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return s(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(r,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Ms){const s=e8[e.toLowerCase()];return s!==void 0?this.setHex(s,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Eu(e.r),this.g=Eu(e.g),this.b=Eu(e.b),this}copyLinearToSRGB(e){return this.r=D1(e.r),this.g=D1(e.g),this.b=D1(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ms){return Bt.fromWorkingColorSpace(cs.copy(this),e),Math.round(fs(cs.r*255,0,255))*65536+Math.round(fs(cs.g*255,0,255))*256+Math.round(fs(cs.b*255,0,255))}getHexString(e=Ms){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Bt.workingColorSpace){Bt.fromWorkingColorSpace(cs.copy(this),n);const s=cs.r,i=cs.g,r=cs.b,o=Math.max(s,i,r),a=Math.min(s,i,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case s:l=(i-r)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const s=e[n];if(s===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(s):i&&i.isVector3&&s&&s.isVector3?i.copy(s):this[n]=s}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const s={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(e).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(e).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(e).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(e).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(e).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==xu&&(s.blending=this.blending),this.side!==Mo&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==ky&&(s.blendSrc=this.blendSrc),this.blendDst!==Cy&&(s.blendDst=this.blendDst),this.blendEquation!==Rl&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==$g&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==aT&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ec&&(s.stencilFail=this.stencilFail),this.stencilZFail!==Ec&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==Ec&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function i(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(n){const r=i(e.textures),o=i(e.images);r.length>0&&(s.textures=r),o.length>0&&(s.images=o)}return s}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let s=null;if(n!==null){const i=n.length;s=new Array(i);for(let r=0;r!==i;++r)s[r]=n[r].clone()}return this.clippingPlanes=s,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Sa extends Mr{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Or,this.combine=DC,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Ln=new re,Up=new Rt;class Ps{constructor(e,n,s=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=s,this.usage=Ly,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=xr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return KC("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,s){e*=this.itemSize,s*=n.itemSize;for(let i=0,r=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const s=this.attributes;for(const l in s){const c=s[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,h=c.length;d0&&(i[l]=u,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const s=e.index;s!==null&&this.setIndex(s.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const r=e.morphAttributes;for(const c in r){const u=[],d=r[c];for(let h=0,f=d.length;h0){const i=n[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;r(e.far-e.near)**2))&&(xT.copy(r).invert(),cl.copy(e.ray).applyMatrix4(xT),!(s.boundingBox!==null&&cl.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(e,n,cl)))}_computeIntersections(e,n,s){let i;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,d=r.attributes.normal,h=r.groups,f=r.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=h.length;v<_;v++){const m=h[v],g=o[m.materialIndex],y=Math.max(m.start,f.start),b=Math.min(a.count,Math.min(m.start+m.count,f.start+f.count));for(let w=y,T=b;wn.far?null:{distance:c,point:Wp.clone(),object:t}}function jp(t,e,n,s,i,r,o,a,l,c){t.getVertexPosition(a,Dc),t.getVertexPosition(l,Nc),t.getVertexPosition(c,Fc);const u=qK(t,e,n,s,Dc,Nc,Fc,Vp);if(u){i&&(Hp.fromBufferAttribute(i,a),Gp.fromBufferAttribute(i,l),zp.fromBufferAttribute(i,c),u.uv=wr.getInterpolation(Vp,Dc,Nc,Fc,Hp,Gp,zp,new Rt)),r&&(Hp.fromBufferAttribute(r,a),Gp.fromBufferAttribute(r,l),zp.fromBufferAttribute(r,c),u.uv1=wr.getInterpolation(Vp,Dc,Nc,Fc,Hp,Gp,zp,new Rt)),o&&(ET.fromBufferAttribute(o,a),TT.fromBufferAttribute(o,l),AT.fromBufferAttribute(o,c),u.normal=wr.getInterpolation(Vp,Dc,Nc,Fc,ET,TT,AT,new re),u.normal.dot(s.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new re,materialIndex:0};wr.getNormal(Dc,Nc,Fc,d.normal),u.face=d}return u}class Md extends Fr{constructor(e=1,n=1,s=1,i=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:s,widthSegments:i,heightSegments:r,depthSegments:o};const a=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],d=[];let h=0,f=0;v("z","y","x",-1,-1,s,n,e,o,r,0),v("z","y","x",1,-1,s,n,-e,o,r,1),v("x","z","y",1,1,e,s,n,i,o,2),v("x","z","y",1,-1,e,s,-n,i,o,3),v("x","y","z",1,-1,e,n,s,i,r,4),v("x","y","z",-1,-1,e,n,-s,i,r,5),this.setIndex(l),this.setAttribute("position",new bo(c,3)),this.setAttribute("normal",new bo(u,3)),this.setAttribute("uv",new bo(d,2));function v(_,m,g,y,b,w,T,x,A,M,E){const S=w/A,P=T/M,D=w/2,k=T/2,U=x/2,z=A+1,G=M+1;let J=0,B=0;const fe=new re;for(let se=0;se0?1:-1,u.push(fe.x,fe.y,fe.z),d.push(xe/A),d.push(1-se/M),J+=1}}for(let se=0;se0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const s={};for(const i in this.extensions)this.extensions[i]===!0&&(s[i]=!0);return Object.keys(s).length>0&&(n.extensions=s),n}}class i8 extends yn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new xt,this.projectionMatrix=new xt,this.projectionMatrixInverse=new xt,this.coordinateSystem=po}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Yo=new re,MT=new Rt,RT=new Rt;class Rs extends i8{constructor(e=50,n=1,s=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=s,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Ju*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Bh*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ju*2*Math.atan(Math.tan(Bh*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,s){Yo.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Yo.x,Yo.y).multiplyScalar(-e/Yo.z),Yo.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(Yo.x,Yo.y).multiplyScalar(-e/Yo.z)}getViewSize(e,n){return this.getViewBounds(e,MT,RT),n.subVectors(RT,MT)}setViewOffset(e,n,s,i,r,o){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Bh*.5*this.fov)/this.zoom,s=2*n,i=this.aspect*s,r=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*i/l,n-=o.offsetY*s/c,i*=o.width/l,s*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,n,n-s,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const Uc=-90,$c=1;class JK extends yn{constructor(e,n,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Rs(Uc,$c,e,n);i.layers=this.layers,this.add(i);const r=new Rs(Uc,$c,e,n);r.layers=this.layers,this.add(r);const o=new Rs(Uc,$c,e,n);o.layers=this.layers,this.add(o);const a=new Rs(Uc,$c,e,n);a.layers=this.layers,this.add(a);const l=new Rs(Uc,$c,e,n);l.layers=this.layers,this.add(l);const c=new Rs(Uc,$c,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[s,i,r,o,a,l]=n;for(const c of n)this.remove(c);if(e===po)s.up.set(0,1,0),s.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Vg)s.up.set(0,-1,0),s.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,d=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const _=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,e.setRenderTarget(s,0,i),e.render(n,r),e.setRenderTarget(s,1,i),e.render(n,o),e.setRenderTarget(s,2,i),e.render(n,a),e.setRenderTarget(s,3,i),e.render(n,l),e.setRenderTarget(s,4,i),e.render(n,c),s.texture.generateMipmaps=_,e.setRenderTarget(s,5,i),e.render(n,u),e.setRenderTarget(d,h,f),e.xr.enabled=v,s.texture.needsPMREMUpdate=!0}}class r8 extends es{constructor(e,n,s,i,r,o,a,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:qu,super(e,n,s,i,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class QK extends rc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const s={width:e,height:e,depth:1},i=[s,s,s,s,s,s];this.texture=new r8(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:oi}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new Md(5,5,5),r=new Ba({name:"CubemapFromEquirect",uniforms:Qu(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:Vs,blending:Oa});r.uniforms.tEquirect.value=n;const o=new Gs(i,r),a=n.minFilter;return n.minFilter===fo&&(n.minFilter=oi),new JK(1,10,this).update(e,o),n.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,n,s,i){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(n,s,i);e.setRenderTarget(r)}}const Z1=new re,eZ=new re,tZ=new wt;class bl{constructor(e=new re(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,s,i){return this.normal.set(e,n,s),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,s){const i=Z1.subVectors(s,n).cross(eZ.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const s=e.delta(Z1),i=this.normal.dot(s);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:n.copy(e.start).addScaledVector(s,r)}intersectsLine(e){const n=this.distanceToPoint(e.start),s=this.distanceToPoint(e.end);return n<0&&s>0||s<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const s=n||tZ.getNormalMatrix(e),i=this.coplanarPoint(Z1).applyMatrix4(e),r=this.normal.applyMatrix3(s).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ul=new Nr,qp=new re;class cx{constructor(e=new bl,n=new bl,s=new bl,i=new bl,r=new bl,o=new bl){this.planes=[e,n,s,i,r,o]}set(e,n,s,i,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(s),a[3].copy(i),a[4].copy(r),a[5].copy(o),this}copy(e){const n=this.planes;for(let s=0;s<6;s++)n[s].copy(e.planes[s]);return this}setFromProjectionMatrix(e,n=po){const s=this.planes,i=e.elements,r=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6],h=i[7],f=i[8],v=i[9],_=i[10],m=i[11],g=i[12],y=i[13],b=i[14],w=i[15];if(s[0].setComponents(l-r,h-c,m-f,w-g).normalize(),s[1].setComponents(l+r,h+c,m+f,w+g).normalize(),s[2].setComponents(l+o,h+u,m+v,w+y).normalize(),s[3].setComponents(l-o,h-u,m-v,w-y).normalize(),s[4].setComponents(l-a,h-d,m-_,w-b).normalize(),n===po)s[5].setComponents(l+a,h+d,m+_,w+b).normalize();else if(n===Vg)s[5].setComponents(a,d,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ul.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),ul.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ul)}intersectsSprite(e){return ul.center.set(0,0,0),ul.radius=.7071067811865476,ul.applyMatrix4(e.matrixWorld),this.intersectsSphere(ul)}intersectsSphere(e){const n=this.planes,s=e.center,i=-e.radius;for(let r=0;r<6;r++)if(n[r].distanceToPoint(s)0?e.max.x:e.min.x,qp.y=i.normal.y>0?e.max.y:e.min.y,qp.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(qp)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let s=0;s<6;s++)if(n[s].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function o8(){let t=null,e=!1,n=null,s=null;function i(r,o){n(r,o),s=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(s=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(s),e=!1},setAnimationLoop:function(r){n=r},setContext:function(r){t=r}}}function nZ(t){const e=new WeakMap;function n(a,l){const c=a.array,u=a.usage,d=c.byteLength,h=t.createBuffer();t.bindBuffer(l,h),t.bufferData(l,c,u),a.onUploadCallback();let f;if(c instanceof Float32Array)f=t.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?f=t.HALF_FLOAT:f=t.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=t.SHORT;else if(c instanceof Uint32Array)f=t.UNSIGNED_INT;else if(c instanceof Int32Array)f=t.INT;else if(c instanceof Int8Array)f=t.BYTE;else if(c instanceof Uint8Array)f=t.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:h,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:d}}function s(a,l,c){const u=l.array,d=l._updateRange,h=l.updateRanges;if(t.bindBuffer(c,a),d.count===-1&&h.length===0&&t.bufferSubData(c,0,u),h.length!==0){for(let f=0,v=h.length;f 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,yZ=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,bZ=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,wZ=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,xZ=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,SZ=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,EZ=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,TZ=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,AZ=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,MZ=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,RZ=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,kZ=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,CZ=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,PZ=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,OZ=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,IZ="gl_FragColor = linearToOutputTexel( gl_FragColor );",LZ=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,DZ=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,NZ=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,FZ=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,UZ=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,$Z=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,BZ=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,HZ=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,GZ=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,zZ=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,VZ=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,WZ=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,jZ=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,qZ=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,YZ=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,XZ=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,KZ=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,ZZ=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,JZ=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,QZ=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,eJ=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,tJ=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,nJ=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,sJ=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,iJ=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,rJ=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,oJ=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,aJ=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,lJ=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,cJ=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,uJ=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,dJ=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,hJ=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,fJ=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,pJ=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,mJ=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[MORPHTARGETS_COUNT]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,gJ=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,_J=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,vJ=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + #endif + #ifdef MORPHTARGETS_TEXTURE + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,yJ=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,bJ=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,wJ=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,xJ=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,SJ=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,EJ=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,TJ=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,AJ=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,MJ=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,RJ=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,kJ=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,CJ=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,PJ=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,OJ=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,IJ=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,LJ=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,DJ=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,NJ=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,FJ=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,UJ=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return shadow; + } +#endif`,$J=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,BJ=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,HJ=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,GJ=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,zJ=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,VJ=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,WJ=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,jJ=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,qJ=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,YJ=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,XJ=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,KJ=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,ZJ=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + + #else + + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,JJ=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,QJ=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,eQ=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,tQ=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const nQ=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,sQ=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,iQ=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,rQ=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,oQ=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,aQ=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,lQ=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,cQ=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,uQ=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,dQ=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,hQ=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,fQ=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,pQ=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,mQ=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,gQ=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,_Q=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,vQ=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,yQ=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,bQ=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,wQ=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,xQ=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,SQ=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,EQ=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,TQ=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,AQ=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,MQ=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,RQ=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,kQ=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,CQ=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,PQ=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,OQ=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,IQ=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,LQ=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,DQ=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,bt={alphahash_fragment:sZ,alphahash_pars_fragment:iZ,alphamap_fragment:rZ,alphamap_pars_fragment:oZ,alphatest_fragment:aZ,alphatest_pars_fragment:lZ,aomap_fragment:cZ,aomap_pars_fragment:uZ,batching_pars_vertex:dZ,batching_vertex:hZ,begin_vertex:fZ,beginnormal_vertex:pZ,bsdfs:mZ,iridescence_fragment:gZ,bumpmap_pars_fragment:_Z,clipping_planes_fragment:vZ,clipping_planes_pars_fragment:yZ,clipping_planes_pars_vertex:bZ,clipping_planes_vertex:wZ,color_fragment:xZ,color_pars_fragment:SZ,color_pars_vertex:EZ,color_vertex:TZ,common:AZ,cube_uv_reflection_fragment:MZ,defaultnormal_vertex:RZ,displacementmap_pars_vertex:kZ,displacementmap_vertex:CZ,emissivemap_fragment:PZ,emissivemap_pars_fragment:OZ,colorspace_fragment:IZ,colorspace_pars_fragment:LZ,envmap_fragment:DZ,envmap_common_pars_fragment:NZ,envmap_pars_fragment:FZ,envmap_pars_vertex:UZ,envmap_physical_pars_fragment:XZ,envmap_vertex:$Z,fog_vertex:BZ,fog_pars_vertex:HZ,fog_fragment:GZ,fog_pars_fragment:zZ,gradientmap_pars_fragment:VZ,lightmap_pars_fragment:WZ,lights_lambert_fragment:jZ,lights_lambert_pars_fragment:qZ,lights_pars_begin:YZ,lights_toon_fragment:KZ,lights_toon_pars_fragment:ZZ,lights_phong_fragment:JZ,lights_phong_pars_fragment:QZ,lights_physical_fragment:eJ,lights_physical_pars_fragment:tJ,lights_fragment_begin:nJ,lights_fragment_maps:sJ,lights_fragment_end:iJ,logdepthbuf_fragment:rJ,logdepthbuf_pars_fragment:oJ,logdepthbuf_pars_vertex:aJ,logdepthbuf_vertex:lJ,map_fragment:cJ,map_pars_fragment:uJ,map_particle_fragment:dJ,map_particle_pars_fragment:hJ,metalnessmap_fragment:fJ,metalnessmap_pars_fragment:pJ,morphinstance_vertex:mJ,morphcolor_vertex:gJ,morphnormal_vertex:_J,morphtarget_pars_vertex:vJ,morphtarget_vertex:yJ,normal_fragment_begin:bJ,normal_fragment_maps:wJ,normal_pars_fragment:xJ,normal_pars_vertex:SJ,normal_vertex:EJ,normalmap_pars_fragment:TJ,clearcoat_normal_fragment_begin:AJ,clearcoat_normal_fragment_maps:MJ,clearcoat_pars_fragment:RJ,iridescence_pars_fragment:kJ,opaque_fragment:CJ,packing:PJ,premultiplied_alpha_fragment:OJ,project_vertex:IJ,dithering_fragment:LJ,dithering_pars_fragment:DJ,roughnessmap_fragment:NJ,roughnessmap_pars_fragment:FJ,shadowmap_pars_fragment:UJ,shadowmap_pars_vertex:$J,shadowmap_vertex:BJ,shadowmask_pars_fragment:HJ,skinbase_vertex:GJ,skinning_pars_vertex:zJ,skinning_vertex:VJ,skinnormal_vertex:WJ,specularmap_fragment:jJ,specularmap_pars_fragment:qJ,tonemapping_fragment:YJ,tonemapping_pars_fragment:XJ,transmission_fragment:KJ,transmission_pars_fragment:ZJ,uv_pars_fragment:JJ,uv_pars_vertex:QJ,uv_vertex:eQ,worldpos_vertex:tQ,background_vert:nQ,background_frag:sQ,backgroundCube_vert:iQ,backgroundCube_frag:rQ,cube_vert:oQ,cube_frag:aQ,depth_vert:lQ,depth_frag:cQ,distanceRGBA_vert:uQ,distanceRGBA_frag:dQ,equirect_vert:hQ,equirect_frag:fQ,linedashed_vert:pQ,linedashed_frag:mQ,meshbasic_vert:gQ,meshbasic_frag:_Q,meshlambert_vert:vQ,meshlambert_frag:yQ,meshmatcap_vert:bQ,meshmatcap_frag:wQ,meshnormal_vert:xQ,meshnormal_frag:SQ,meshphong_vert:EQ,meshphong_frag:TQ,meshphysical_vert:AQ,meshphysical_frag:MQ,meshtoon_vert:RQ,meshtoon_frag:kQ,points_vert:CQ,points_frag:PQ,shadow_vert:OQ,shadow_frag:IQ,sprite_vert:LQ,sprite_frag:DQ},Ge={common:{diffuse:{value:new ht(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new wt}},envmap:{envMap:{value:null},envMapRotation:{value:new wt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new wt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new wt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new wt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new wt},normalScale:{value:new Rt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new wt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new wt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new wt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new wt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ht(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ht(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0},uvTransform:{value:new wt}},sprite:{diffuse:{value:new ht(16777215)},opacity:{value:1},center:{value:new Rt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new wt},alphaMap:{value:null},alphaMapTransform:{value:new wt},alphaTest:{value:0}}},_r={basic:{uniforms:Ss([Ge.common,Ge.specularmap,Ge.envmap,Ge.aomap,Ge.lightmap,Ge.fog]),vertexShader:bt.meshbasic_vert,fragmentShader:bt.meshbasic_frag},lambert:{uniforms:Ss([Ge.common,Ge.specularmap,Ge.envmap,Ge.aomap,Ge.lightmap,Ge.emissivemap,Ge.bumpmap,Ge.normalmap,Ge.displacementmap,Ge.fog,Ge.lights,{emissive:{value:new ht(0)}}]),vertexShader:bt.meshlambert_vert,fragmentShader:bt.meshlambert_frag},phong:{uniforms:Ss([Ge.common,Ge.specularmap,Ge.envmap,Ge.aomap,Ge.lightmap,Ge.emissivemap,Ge.bumpmap,Ge.normalmap,Ge.displacementmap,Ge.fog,Ge.lights,{emissive:{value:new ht(0)},specular:{value:new ht(1118481)},shininess:{value:30}}]),vertexShader:bt.meshphong_vert,fragmentShader:bt.meshphong_frag},standard:{uniforms:Ss([Ge.common,Ge.envmap,Ge.aomap,Ge.lightmap,Ge.emissivemap,Ge.bumpmap,Ge.normalmap,Ge.displacementmap,Ge.roughnessmap,Ge.metalnessmap,Ge.fog,Ge.lights,{emissive:{value:new ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bt.meshphysical_vert,fragmentShader:bt.meshphysical_frag},toon:{uniforms:Ss([Ge.common,Ge.aomap,Ge.lightmap,Ge.emissivemap,Ge.bumpmap,Ge.normalmap,Ge.displacementmap,Ge.gradientmap,Ge.fog,Ge.lights,{emissive:{value:new ht(0)}}]),vertexShader:bt.meshtoon_vert,fragmentShader:bt.meshtoon_frag},matcap:{uniforms:Ss([Ge.common,Ge.bumpmap,Ge.normalmap,Ge.displacementmap,Ge.fog,{matcap:{value:null}}]),vertexShader:bt.meshmatcap_vert,fragmentShader:bt.meshmatcap_frag},points:{uniforms:Ss([Ge.points,Ge.fog]),vertexShader:bt.points_vert,fragmentShader:bt.points_frag},dashed:{uniforms:Ss([Ge.common,Ge.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bt.linedashed_vert,fragmentShader:bt.linedashed_frag},depth:{uniforms:Ss([Ge.common,Ge.displacementmap]),vertexShader:bt.depth_vert,fragmentShader:bt.depth_frag},normal:{uniforms:Ss([Ge.common,Ge.bumpmap,Ge.normalmap,Ge.displacementmap,{opacity:{value:1}}]),vertexShader:bt.meshnormal_vert,fragmentShader:bt.meshnormal_frag},sprite:{uniforms:Ss([Ge.sprite,Ge.fog]),vertexShader:bt.sprite_vert,fragmentShader:bt.sprite_frag},background:{uniforms:{uvTransform:{value:new wt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bt.background_vert,fragmentShader:bt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new wt}},vertexShader:bt.backgroundCube_vert,fragmentShader:bt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bt.cube_vert,fragmentShader:bt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bt.equirect_vert,fragmentShader:bt.equirect_frag},distanceRGBA:{uniforms:Ss([Ge.common,Ge.displacementmap,{referencePosition:{value:new re},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bt.distanceRGBA_vert,fragmentShader:bt.distanceRGBA_frag},shadow:{uniforms:Ss([Ge.lights,Ge.fog,{color:{value:new ht(0)},opacity:{value:1}}]),vertexShader:bt.shadow_vert,fragmentShader:bt.shadow_frag}};_r.physical={uniforms:Ss([_r.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new wt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new wt},clearcoatNormalScale:{value:new Rt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new wt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new wt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new wt},sheen:{value:0},sheenColor:{value:new ht(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new wt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new wt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new wt},transmissionSamplerSize:{value:new Rt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new wt},attenuationDistance:{value:0},attenuationColor:{value:new ht(0)},specularColor:{value:new ht(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new wt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new wt},anisotropyVector:{value:new Rt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new wt}}]),vertexShader:bt.meshphysical_vert,fragmentShader:bt.meshphysical_frag};const Yp={r:0,b:0,g:0},dl=new Or,NQ=new xt;function FQ(t,e,n,s,i,r,o){const a=new ht(0);let l=r===!0?0:1,c,u,d=null,h=0,f=null;function v(y){let b=y.isScene===!0?y.background:null;return b&&b.isTexture&&(b=(y.backgroundBlurriness>0?n:e).get(b)),b}function _(y){let b=!1;const w=v(y);w===null?g(a,l):w&&w.isColor&&(g(w,1),b=!0);const T=t.xr.getEnvironmentBlendMode();T==="additive"?s.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,o),(t.autoClear||b)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil)}function m(y,b){const w=v(b);w&&(w.isCubeTexture||w.mapping===p0)?(u===void 0&&(u=new Gs(new Md(1,1,1),new Ba({name:"BackgroundCubeMaterial",uniforms:Qu(_r.backgroundCube.uniforms),vertexShader:_r.backgroundCube.vertexShader,fragmentShader:_r.backgroundCube.fragmentShader,side:Vs,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,x,A){this.matrixWorld.copyPosition(A.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),dl.copy(b.backgroundRotation),dl.x*=-1,dl.y*=-1,dl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(dl.y*=-1,dl.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(NQ.makeRotationFromEuler(dl)),u.material.toneMapped=Bt.getTransfer(w.colorSpace)!==an,(d!==w||h!==w.version||f!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,h=w.version,f=t.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new Gs(new v0(2,2),new Ba({name:"BackgroundMaterial",uniforms:Qu(_r.background.uniforms),vertexShader:_r.background.vertexShader,fragmentShader:_r.background.fragmentShader,side:Mo,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=Bt.getTransfer(w.colorSpace)!==an,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||h!==w.version||f!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,h=w.version,f=t.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function g(y,b){y.getRGB(Yp,s8(t)),s.buffers.color.setClear(Yp.r,Yp.g,Yp.b,b,o)}return{getClearColor:function(){return a},setClearColor:function(y,b=1){a.set(y),l=b,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,g(a,l)},render:_,addToRenderList:m}}function UQ(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),s={},i=h(null);let r=i,o=!1;function a(S,P,D,k,U){let z=!1;const G=d(k,D,P);r!==G&&(r=G,c(r.object)),z=f(S,k,D,U),z&&v(S,k,D,U),U!==null&&e.update(U,t.ELEMENT_ARRAY_BUFFER),(z||o)&&(o=!1,w(S,P,D,k),U!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(U).buffer))}function l(){return t.createVertexArray()}function c(S){return t.bindVertexArray(S)}function u(S){return t.deleteVertexArray(S)}function d(S,P,D){const k=D.wireframe===!0;let U=s[S.id];U===void 0&&(U={},s[S.id]=U);let z=U[P.id];z===void 0&&(z={},U[P.id]=z);let G=z[k];return G===void 0&&(G=h(l()),z[k]=G),G}function h(S){const P=[],D=[],k=[];for(let U=0;U=0){const se=U[B];let we=z[B];if(we===void 0&&(B==="instanceMatrix"&&S.instanceMatrix&&(we=S.instanceMatrix),B==="instanceColor"&&S.instanceColor&&(we=S.instanceColor)),se===void 0||se.attribute!==we||we&&se.data!==we.data)return!0;G++}return r.attributesNum!==G||r.index!==k}function v(S,P,D,k){const U={},z=P.attributes;let G=0;const J=D.getAttributes();for(const B in J)if(J[B].location>=0){let se=z[B];se===void 0&&(B==="instanceMatrix"&&S.instanceMatrix&&(se=S.instanceMatrix),B==="instanceColor"&&S.instanceColor&&(se=S.instanceColor));const we={};we.attribute=se,se&&se.data&&(we.data=se.data),U[B]=we,G++}r.attributes=U,r.attributesNum=G,r.index=k}function _(){const S=r.newAttributes;for(let P=0,D=S.length;P=0){let fe=U[J];if(fe===void 0&&(J==="instanceMatrix"&&S.instanceMatrix&&(fe=S.instanceMatrix),J==="instanceColor"&&S.instanceColor&&(fe=S.instanceColor)),fe!==void 0){const se=fe.normalized,we=fe.itemSize,xe=e.get(fe);if(xe===void 0)continue;const Ne=xe.buffer,oe=xe.type,Ee=xe.bytesPerElement,Ce=oe===t.INT||oe===t.UNSIGNED_INT||fe.gpuType===$C;if(fe.isInterleavedBufferAttribute){const ne=fe.data,Re=ne.stride,Ae=fe.offset;if(ne.isInstancedInterleavedBuffer){for(let j=0;j0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),_=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),m=t.getParameter(t.MAX_VERTEX_ATTRIBS),g=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),y=t.getParameter(t.MAX_VARYING_VECTORS),b=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=f>0,T=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,maxTextures:h,maxVertexTextures:f,maxTextureSize:v,maxCubemapSize:_,maxAttributes:m,maxVertexUniforms:g,maxVaryings:y,maxFragmentUniforms:b,vertexTextures:w,maxSamples:T}}function HQ(t){const e=this;let n=null,s=0,i=!1,r=!1;const o=new bl,a=new wt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,h){const f=d.length!==0||h||s!==0||i;return i=h,s=d.length,f},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,h){n=u(d,h,0)},this.setState=function(d,h,f){const v=d.clippingPlanes,_=d.clipIntersection,m=d.clipShadows,g=t.get(d);if(!i||v===null||v.length===0||r&&!m)r?u(null):c();else{const y=r?0:s,b=y*4;let w=g.clippingState||null;l.value=w,w=u(v,h,b,f);for(let T=0;T!==b;++T)w[T]=n[T];g.clippingState=w,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=s>0),e.numPlanes=s,e.numIntersection=0}function u(d,h,f,v){const _=d!==null?d.length:0;let m=null;if(_!==0){if(m=l.value,v!==!0||m===null){const g=f+_*4,y=h.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new QK(l.height);return c.fromEquirectangularTexture(t,o),e.set(o,c),o.addEventListener("dispose",i),n(c.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:s,dispose:r}}class ux extends i8{constructor(e=-1,n=1,s=1,i=-1,r=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=s,this.bottom=i,this.near=r,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,s,i,r,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=s,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=s-e,o=s+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,o=r+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(r,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const iu=4,kT=[.125,.215,.35,.446,.526,.582],kl=20,J1=new ux,CT=new ht;let Q1=null,ev=0,tv=0,nv=!1;const wl=(1+Math.sqrt(5))/2,Bc=1/wl,PT=[new re(-wl,Bc,0),new re(wl,Bc,0),new re(-Bc,0,wl),new re(Bc,0,wl),new re(0,wl,-Bc),new re(0,wl,Bc),new re(-1,1,-1),new re(1,1,-1),new re(-1,1,1),new re(1,1,1)];class OT{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,s=.1,i=100){Q1=this._renderer.getRenderTarget(),ev=this._renderer.getActiveCubeFace(),tv=this._renderer.getActiveMipmapLevel(),nv=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(e,s,i,r),n>0&&this._blur(r,0,0,n),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=DT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=LT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?b:0,b,b),u.setRenderTarget(i),_&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=h,u.autoClear=d,e.background=m}_textureToCubeUV(e,n){const s=this._renderer,i=e.mapping===qu||e.mapping===Yu;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=DT()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=LT());const r=i?this._cubemapMaterial:this._equirectMaterial,o=new Gs(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Xp(n,0,0,3*l,2*l),s.setRenderTarget(n),s.render(o,J1)}_applyPMREM(e){const n=this._renderer,s=n.autoClear;n.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;rkl&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${kl}`);const g=[];let y=0;for(let A=0;Ab-iu?i-b+iu:0),x=4*(this._cubeSize-w);Xp(n,T,x,3*w,2*w),l.setRenderTarget(n),l.render(d,J1)}}function zQ(t){const e=[],n=[],s=[];let i=t;const r=t-iu+1+kT.length;for(let o=0;ot-iu?l=kT[o-t+iu-1]:o===0&&(l=0),s.push(l);const c=1/(a-2),u=-c,d=1+c,h=[u,u,d,u,d,d,u,u,d,d,u,d],f=6,v=6,_=3,m=2,g=1,y=new Float32Array(_*v*f),b=new Float32Array(m*v*f),w=new Float32Array(g*v*f);for(let x=0;x2?0:-1,E=[A,M,0,A+2/3,M,0,A+2/3,M+1,0,A,M,0,A+2/3,M+1,0,A,M+1,0];y.set(E,_*v*x),b.set(h,m*v*x);const S=[x,x,x,x,x,x];w.set(S,g*v*x)}const T=new Fr;T.setAttribute("position",new Ps(y,_)),T.setAttribute("uv",new Ps(b,m)),T.setAttribute("faceIndex",new Ps(w,g)),e.push(T),i>iu&&i--}return{lodPlanes:e,sizeLods:n,sigmas:s}}function IT(t,e,n){const s=new rc(t,e,n);return s.texture.mapping=p0,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Xp(t,e,n,s,i){t.viewport.set(e,n,s,i),t.scissor.set(e,n,s,i)}function VQ(t,e,n){const s=new Float32Array(kl),i=new re(0,1,0);return new Ba({name:"SphericalGaussianBlur",defines:{n:kl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:dx(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Oa,depthTest:!1,depthWrite:!1})}function LT(){return new Ba({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:dx(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Oa,depthTest:!1,depthWrite:!1})}function DT(){return new Ba({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:dx(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Oa,depthTest:!1,depthWrite:!1})}function dx(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function WQ(t){let e=new WeakMap,n=null;function s(a){if(a&&a.isTexture){const l=a.mapping,c=l===Py||l===Oy,u=l===qu||l===Yu;if(c||u){let d=e.get(a);const h=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==h)return n===null&&(n=new OT(t)),d=c?n.fromEquirectangular(a,d):n.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),d.texture;if(d!==void 0)return d.texture;{const f=a.image;return c&&f&&f.height>0||u&&f&&i(f)?(n===null&&(n=new OT(t)),d=c?n.fromEquirectangular(a):n.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),a.addEventListener("dispose",r),d.texture):null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(T=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const x=new Float32Array(w*T*4*d),A=new JC(x,w,T,d);A.type=xr,A.needsUpdate=!0;const M=b*4;for(let S=0;S0)return t;const i=e*n;let r=NT[i];if(r===void 0&&(r=new Float32Array(i),NT[i]=r),e!==0){s.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(r,a)}return r}function Gn(t,e){if(t.length!==e.length)return!1;for(let n=0,s=t.length;n":" "} ${a}: ${n[o]}`)}return s.join(` +`)}function Wee(t){const e=Bt.getPrimaries(Bt.workingColorSpace),n=Bt.getPrimaries(t);let s;switch(e===n?s="":e===zg&&n===Gg?s="LinearDisplayP3ToLinearSRGB":e===Gg&&n===zg&&(s="LinearSRGBToLinearDisplayP3"),t){case ss:case g0:return[s,"LinearTransferOETF"];case Ms:case ax:return[s,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[s,"LinearTransferOETF"]}}function zT(t,e,n){const s=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(s&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const o=parseInt(r[1]);return n.toUpperCase()+` + +`+i+` + +`+Vee(t.getShaderSource(e),o)}else return i}function jee(t,e){const n=Wee(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function qee(t,e){let n;switch(e){case $X:n="Linear";break;case BX:n="Reinhard";break;case HX:n="OptimizedCineon";break;case GX:n="ACESFilmic";break;case VX:n="AgX";break;case WX:n="Neutral";break;case zX:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Yee(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(bh).join(` +`)}function Xee(t){const e=[];for(const n in t){const s=t[n];s!==!1&&e.push("#define "+n+" "+s)}return e.join(` +`)}function Kee(t,e){const n={},s=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function Dy(t){return t.replace(Zee,Qee)}const Jee=new Map;function Qee(t,e){let n=bt[e];if(n===void 0){const s=Jee.get(e);if(s!==void 0)n=bt[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,s);else throw new Error("Can not resolve #include <"+e+">")}return Dy(n)}const ete=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function jT(t){return t.replace(ete,tte)}function tte(t,e,n,s){let i="";for(let r=parseInt(e);r0&&(m+=` +`),g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(bh).join(` +`),g.length>0&&(g+=` +`)):(m=[qT(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(bh).join(` +`),g=[qT(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Ia?"#define TONE_MAPPING":"",n.toneMapping!==Ia?bt.tonemapping_pars_fragment:"",n.toneMapping!==Ia?qee("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",bt.colorspace_pars_fragment,jee("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(bh).join(` +`)),o=Dy(o),o=VT(o,n),o=WT(o,n),a=Dy(a),a=VT(a,n),a=WT(a,n),o=jT(o),a=jT(a),n.isRawShaderMaterial!==!0&&(y=`#version 300 es +`,m=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+m,g=["#define varying in",n.glslVersion===lT?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===lT?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+g);const b=y+m+o,w=y+g+a,T=GT(i,i.VERTEX_SHADER,b),x=GT(i,i.FRAGMENT_SHADER,w);i.attachShader(_,T),i.attachShader(_,x),n.index0AttributeName!==void 0?i.bindAttribLocation(_,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function A(P){if(t.debug.checkShaderErrors){const D=i.getProgramInfoLog(_).trim(),k=i.getShaderInfoLog(T).trim(),U=i.getShaderInfoLog(x).trim();let z=!0,G=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(z=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(i,_,T,x);else{const J=zT(i,T,"vertex"),B=zT(i,x,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+` + +Material Name: `+P.name+` +Material Type: `+P.type+` + +Program Info Log: `+D+` +`+J+` +`+B)}else D!==""?console.warn("THREE.WebGLProgram: Program Info Log:",D):(k===""||U==="")&&(G=!1);G&&(P.diagnostics={runnable:z,programLog:D,vertexShader:{log:k,prefix:m},fragmentShader:{log:U,prefix:g}})}i.deleteShader(T),i.deleteShader(x),M=new ng(i,_),E=Kee(i,_)}let M;this.getUniforms=function(){return M===void 0&&A(this),M};let E;this.getAttributes=function(){return E===void 0&&A(this),E};let S=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=i.getProgramParameter(_,Gee)),S},this.destroy=function(){s.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=zee++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=x,this}let lte=0;class cte{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,s=e.fragmentShader,i=this._getShaderStage(n),r=this._getShaderStage(s),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const s of n)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let s=n.get(e);return s===void 0&&(s=new Set,n.set(e,s)),s}_getShaderStage(e){const n=this.shaderCache;let s=n.get(e);return s===void 0&&(s=new ute(e),n.set(e,s)),s}}class ute{constructor(e){this.id=lte++,this.code=e,this.usedTimes=0}}function dte(t,e,n,s,i,r,o){const a=new QC,l=new cte,c=new Set,u=[],d=i.logarithmicDepthBuffer,h=i.vertexTextures;let f=i.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(E){return c.add(E),E===0?"uv":`uv${E}`}function m(E,S,P,D,k){const U=D.fog,z=k.geometry,G=E.isMeshStandardMaterial?D.environment:null,J=(E.isMeshStandardMaterial?n:e).get(E.envMap||G),B=J&&J.mapping===p0?J.image.height:null,fe=v[E.type];E.precision!==null&&(f=i.getMaxPrecision(E.precision),f!==E.precision&&console.warn("THREE.WebGLProgram.getParameters:",E.precision,"not supported, using",f,"instead."));const se=z.morphAttributes.position||z.morphAttributes.normal||z.morphAttributes.color,we=se!==void 0?se.length:0;let xe=0;z.morphAttributes.position!==void 0&&(xe=1),z.morphAttributes.normal!==void 0&&(xe=2),z.morphAttributes.color!==void 0&&(xe=3);let Ne,oe,Ee,Ce;if(fe){const Ht=_r[fe];Ne=Ht.vertexShader,oe=Ht.fragmentShader}else Ne=E.vertexShader,oe=E.fragmentShader,l.update(E),Ee=l.getVertexShaderID(E),Ce=l.getFragmentShaderID(E);const ne=t.getRenderTarget(),Re=k.isInstancedMesh===!0,Ae=k.isBatchedMesh===!0,j=!!E.map,qe=!!E.matcap,Fe=!!J,L=!!E.aoMap,$=!!E.lightMap,ee=!!E.bumpMap,de=!!E.normalMap,he=!!E.displacementMap,ke=!!E.emissiveMap,O=!!E.metalnessMap,R=!!E.roughnessMap,q=E.anisotropy>0,K=E.clearcoat>0,ae=E.dispersion>0,pe=E.iridescence>0,Me=E.sheen>0,be=E.transmission>0,Se=q&&!!E.anisotropyMap,He=K&&!!E.clearcoatMap,Pe=K&&!!E.clearcoatNormalMap,ye=K&&!!E.clearcoatRoughnessMap,te=pe&&!!E.iridescenceMap,C=pe&&!!E.iridescenceThicknessMap,X=Me&&!!E.sheenColorMap,N=Me&&!!E.sheenRoughnessMap,V=!!E.specularMap,W=!!E.specularColorMap,Q=!!E.specularIntensityMap,F=be&&!!E.transmissionMap,le=be&&!!E.thicknessMap,ue=!!E.gradientMap,Le=!!E.alphaMap,$e=E.alphaTest>0,St=!!E.alphaHash,jt=!!E.extensions;let sn=Ia;E.toneMapped&&(ne===null||ne.isXRRenderTarget===!0)&&(sn=t.toneMapping);const rs={shaderID:fe,shaderType:E.type,shaderName:E.name,vertexShader:Ne,fragmentShader:oe,defines:E.defines,customVertexShaderID:Ee,customFragmentShaderID:Ce,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:f,batching:Ae,instancing:Re,instancingColor:Re&&k.instanceColor!==null,instancingMorph:Re&&k.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:ne===null?t.outputColorSpace:ne.isXRRenderTarget===!0?ne.texture.colorSpace:ss,alphaToCoverage:!!E.alphaToCoverage,map:j,matcap:qe,envMap:Fe,envMapMode:Fe&&J.mapping,envMapCubeUVHeight:B,aoMap:L,lightMap:$,bumpMap:ee,normalMap:de,displacementMap:h&&he,emissiveMap:ke,normalMapObjectSpace:de&&E.normalMapType===oK,normalMapTangentSpace:de&&E.normalMapType===qC,metalnessMap:O,roughnessMap:R,anisotropy:q,anisotropyMap:Se,clearcoat:K,clearcoatMap:He,clearcoatNormalMap:Pe,clearcoatRoughnessMap:ye,dispersion:ae,iridescence:pe,iridescenceMap:te,iridescenceThicknessMap:C,sheen:Me,sheenColorMap:X,sheenRoughnessMap:N,specularMap:V,specularColorMap:W,specularIntensityMap:Q,transmission:be,transmissionMap:F,thicknessMap:le,gradientMap:ue,opaque:E.transparent===!1&&E.blending===xu&&E.alphaToCoverage===!1,alphaMap:Le,alphaTest:$e,alphaHash:St,combine:E.combine,mapUv:j&&_(E.map.channel),aoMapUv:L&&_(E.aoMap.channel),lightMapUv:$&&_(E.lightMap.channel),bumpMapUv:ee&&_(E.bumpMap.channel),normalMapUv:de&&_(E.normalMap.channel),displacementMapUv:he&&_(E.displacementMap.channel),emissiveMapUv:ke&&_(E.emissiveMap.channel),metalnessMapUv:O&&_(E.metalnessMap.channel),roughnessMapUv:R&&_(E.roughnessMap.channel),anisotropyMapUv:Se&&_(E.anisotropyMap.channel),clearcoatMapUv:He&&_(E.clearcoatMap.channel),clearcoatNormalMapUv:Pe&&_(E.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ye&&_(E.clearcoatRoughnessMap.channel),iridescenceMapUv:te&&_(E.iridescenceMap.channel),iridescenceThicknessMapUv:C&&_(E.iridescenceThicknessMap.channel),sheenColorMapUv:X&&_(E.sheenColorMap.channel),sheenRoughnessMapUv:N&&_(E.sheenRoughnessMap.channel),specularMapUv:V&&_(E.specularMap.channel),specularColorMapUv:W&&_(E.specularColorMap.channel),specularIntensityMapUv:Q&&_(E.specularIntensityMap.channel),transmissionMapUv:F&&_(E.transmissionMap.channel),thicknessMapUv:le&&_(E.thicknessMap.channel),alphaMapUv:Le&&_(E.alphaMap.channel),vertexTangents:!!z.attributes.tangent&&(de||q),vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!z.attributes.color&&z.attributes.color.itemSize===4,pointsUvs:k.isPoints===!0&&!!z.attributes.uv&&(j||Le),fog:!!U,useFog:E.fog===!0,fogExp2:!!U&&U.isFogExp2,flatShading:E.flatShading===!0,sizeAttenuation:E.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:k.isSkinnedMesh===!0,morphTargets:z.morphAttributes.position!==void 0,morphNormals:z.morphAttributes.normal!==void 0,morphColors:z.morphAttributes.color!==void 0,morphTargetsCount:we,morphTextureStride:xe,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numLightProbes:S.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:E.dithering,shadowMapEnabled:t.shadowMap.enabled&&P.length>0,shadowMapType:t.shadowMap.type,toneMapping:sn,useLegacyLights:t._useLegacyLights,decodeVideoTexture:j&&E.map.isVideoTexture===!0&&Bt.getTransfer(E.map.colorSpace)===an,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===br,flipSided:E.side===Vs,useDepthPacking:E.depthPacking>=0,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionClipCullDistance:jt&&E.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:jt&&E.extensions.multiDraw===!0&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:E.customProgramCacheKey()};return rs.vertexUv1s=c.has(1),rs.vertexUv2s=c.has(2),rs.vertexUv3s=c.has(3),c.clear(),rs}function g(E){const S=[];if(E.shaderID?S.push(E.shaderID):(S.push(E.customVertexShaderID),S.push(E.customFragmentShaderID)),E.defines!==void 0)for(const P in E.defines)S.push(P),S.push(E.defines[P]);return E.isRawShaderMaterial===!1&&(y(S,E),b(S,E),S.push(t.outputColorSpace)),S.push(E.customProgramCacheKey),S.join()}function y(E,S){E.push(S.precision),E.push(S.outputColorSpace),E.push(S.envMapMode),E.push(S.envMapCubeUVHeight),E.push(S.mapUv),E.push(S.alphaMapUv),E.push(S.lightMapUv),E.push(S.aoMapUv),E.push(S.bumpMapUv),E.push(S.normalMapUv),E.push(S.displacementMapUv),E.push(S.emissiveMapUv),E.push(S.metalnessMapUv),E.push(S.roughnessMapUv),E.push(S.anisotropyMapUv),E.push(S.clearcoatMapUv),E.push(S.clearcoatNormalMapUv),E.push(S.clearcoatRoughnessMapUv),E.push(S.iridescenceMapUv),E.push(S.iridescenceThicknessMapUv),E.push(S.sheenColorMapUv),E.push(S.sheenRoughnessMapUv),E.push(S.specularMapUv),E.push(S.specularColorMapUv),E.push(S.specularIntensityMapUv),E.push(S.transmissionMapUv),E.push(S.thicknessMapUv),E.push(S.combine),E.push(S.fogExp2),E.push(S.sizeAttenuation),E.push(S.morphTargetsCount),E.push(S.morphAttributeCount),E.push(S.numDirLights),E.push(S.numPointLights),E.push(S.numSpotLights),E.push(S.numSpotLightMaps),E.push(S.numHemiLights),E.push(S.numRectAreaLights),E.push(S.numDirLightShadows),E.push(S.numPointLightShadows),E.push(S.numSpotLightShadows),E.push(S.numSpotLightShadowsWithMaps),E.push(S.numLightProbes),E.push(S.shadowMapType),E.push(S.toneMapping),E.push(S.numClippingPlanes),E.push(S.numClipIntersection),E.push(S.depthPacking)}function b(E,S){a.disableAll(),S.supportsVertexTextures&&a.enable(0),S.instancing&&a.enable(1),S.instancingColor&&a.enable(2),S.instancingMorph&&a.enable(3),S.matcap&&a.enable(4),S.envMap&&a.enable(5),S.normalMapObjectSpace&&a.enable(6),S.normalMapTangentSpace&&a.enable(7),S.clearcoat&&a.enable(8),S.iridescence&&a.enable(9),S.alphaTest&&a.enable(10),S.vertexColors&&a.enable(11),S.vertexAlphas&&a.enable(12),S.vertexUv1s&&a.enable(13),S.vertexUv2s&&a.enable(14),S.vertexUv3s&&a.enable(15),S.vertexTangents&&a.enable(16),S.anisotropy&&a.enable(17),S.alphaHash&&a.enable(18),S.batching&&a.enable(19),S.dispersion&&a.enable(20),E.push(a.mask),a.disableAll(),S.fog&&a.enable(0),S.useFog&&a.enable(1),S.flatShading&&a.enable(2),S.logarithmicDepthBuffer&&a.enable(3),S.skinning&&a.enable(4),S.morphTargets&&a.enable(5),S.morphNormals&&a.enable(6),S.morphColors&&a.enable(7),S.premultipliedAlpha&&a.enable(8),S.shadowMapEnabled&&a.enable(9),S.useLegacyLights&&a.enable(10),S.doubleSided&&a.enable(11),S.flipSided&&a.enable(12),S.useDepthPacking&&a.enable(13),S.dithering&&a.enable(14),S.transmission&&a.enable(15),S.sheen&&a.enable(16),S.opaque&&a.enable(17),S.pointsUvs&&a.enable(18),S.decodeVideoTexture&&a.enable(19),S.alphaToCoverage&&a.enable(20),E.push(a.mask)}function w(E){const S=v[E.type];let P;if(S){const D=_r[S];P=XK.clone(D.uniforms)}else P=E.uniforms;return P}function T(E,S){let P;for(let D=0,k=u.length;D0?s.push(g):f.transparent===!0?i.push(g):n.push(g)}function l(d,h,f,v,_,m){const g=o(d,h,f,v,_,m);f.transmission>0?s.unshift(g):f.transparent===!0?i.unshift(g):n.unshift(g)}function c(d,h){n.length>1&&n.sort(d||fte),s.length>1&&s.sort(h||YT),i.length>1&&i.sort(h||YT)}function u(){for(let d=e,h=t.length;d=r.length?(o=new XT,r.push(o)):o=r[i],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function mte(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new re,color:new ht};break;case"SpotLight":n={position:new re,direction:new re,color:new ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new re,color:new ht,distance:0,decay:0};break;case"HemisphereLight":n={direction:new re,skyColor:new ht,groundColor:new ht};break;case"RectAreaLight":n={color:new ht,position:new re,halfWidth:new re,halfHeight:new re};break}return t[e.id]=n,n}}}function gte(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Rt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let _te=0;function vte(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function yte(t){const e=new mte,n=gte(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)s.probe.push(new re);const i=new re,r=new xt,o=new xt;function a(c,u){let d=0,h=0,f=0;for(let P=0;P<9;P++)s.probe[P].set(0,0,0);let v=0,_=0,m=0,g=0,y=0,b=0,w=0,T=0,x=0,A=0,M=0;c.sort(vte);const E=u===!0?Math.PI:1;for(let P=0,D=c.length;P0&&(t.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Ge.LTC_FLOAT_1,s.rectAreaLTC2=Ge.LTC_FLOAT_2):(s.rectAreaLTC1=Ge.LTC_HALF_1,s.rectAreaLTC2=Ge.LTC_HALF_2)),s.ambient[0]=d,s.ambient[1]=h,s.ambient[2]=f;const S=s.hash;(S.directionalLength!==v||S.pointLength!==_||S.spotLength!==m||S.rectAreaLength!==g||S.hemiLength!==y||S.numDirectionalShadows!==b||S.numPointShadows!==w||S.numSpotShadows!==T||S.numSpotMaps!==x||S.numLightProbes!==M)&&(s.directional.length=v,s.spot.length=m,s.rectArea.length=g,s.point.length=_,s.hemi.length=y,s.directionalShadow.length=b,s.directionalShadowMap.length=b,s.pointShadow.length=w,s.pointShadowMap.length=w,s.spotShadow.length=T,s.spotShadowMap.length=T,s.directionalShadowMatrix.length=b,s.pointShadowMatrix.length=w,s.spotLightMatrix.length=T+x-A,s.spotLightMap.length=x,s.numSpotLightShadowsWithMaps=A,s.numLightProbes=M,S.directionalLength=v,S.pointLength=_,S.spotLength=m,S.rectAreaLength=g,S.hemiLength=y,S.numDirectionalShadows=b,S.numPointShadows=w,S.numSpotShadows=T,S.numSpotMaps=x,S.numLightProbes=M,s.version=_te++)}function l(c,u){let d=0,h=0,f=0,v=0,_=0;const m=u.matrixWorldInverse;for(let g=0,y=c.length;g=o.length?(a=new KT(t),o.push(a)):a=o[r],a}function s(){e=new WeakMap}return{get:n,dispose:s}}class wte extends Mr{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=iK,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class xte extends Mr{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Ste=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,Ete=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function Tte(t,e,n){let s=new cx;const i=new Rt,r=new Rt,o=new Kt,a=new wte({depthPacking:rK}),l=new xte,c={},u=n.maxTextureSize,d={[Mo]:Vs,[Vs]:Mo,[br]:br},h=new Ba({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Rt},radius:{value:4}},vertexShader:Ste,fragmentShader:Ete}),f=h.clone();f.defines.HORIZONTAL_PASS=1;const v=new Fr;v.setAttribute("position",new Ps(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Gs(v,h),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=LC;let g=this.type;this.render=function(x,A,M){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||x.length===0)return;const E=t.getRenderTarget(),S=t.getActiveCubeFace(),P=t.getActiveMipmapLevel(),D=t.state;D.setBlending(Oa),D.buffers.color.setClear(1,1,1,1),D.buffers.depth.setTest(!0),D.setScissorTest(!1);const k=g!==Jr&&this.type===Jr,U=g===Jr&&this.type!==Jr;for(let z=0,G=x.length;zu||i.y>u)&&(i.x>u&&(r.x=Math.floor(u/fe.x),i.x=r.x*fe.x,B.mapSize.x=r.x),i.y>u&&(r.y=Math.floor(u/fe.y),i.y=r.y*fe.y,B.mapSize.y=r.y)),B.map===null||k===!0||U===!0){const we=this.type!==Jr?{minFilter:Cs,magFilter:Cs}:{};B.map!==null&&B.map.dispose(),B.map=new rc(i.x,i.y,we),B.map.texture.name=J.name+".shadowMap",B.camera.updateProjectionMatrix()}t.setRenderTarget(B.map),t.clear();const se=B.getViewportCount();for(let we=0;we0||A.map&&A.alphaTest>0){const D=S.uuid,k=A.uuid;let U=c[D];U===void 0&&(U={},c[D]=U);let z=U[k];z===void 0&&(z=S.clone(),U[k]=z,A.addEventListener("dispose",T)),S=z}if(S.visible=A.visible,S.wireframe=A.wireframe,E===Jr?S.side=A.shadowSide!==null?A.shadowSide:A.side:S.side=A.shadowSide!==null?A.shadowSide:d[A.side],S.alphaMap=A.alphaMap,S.alphaTest=A.alphaTest,S.map=A.map,S.clipShadows=A.clipShadows,S.clippingPlanes=A.clippingPlanes,S.clipIntersection=A.clipIntersection,S.displacementMap=A.displacementMap,S.displacementScale=A.displacementScale,S.displacementBias=A.displacementBias,S.wireframeLinewidth=A.wireframeLinewidth,S.linewidth=A.linewidth,M.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const D=t.properties.get(S);D.light=M}return S}function w(x,A,M,E,S){if(x.visible===!1)return;if(x.layers.test(A.layers)&&(x.isMesh||x.isLine||x.isPoints)&&(x.castShadow||x.receiveShadow&&S===Jr)&&(!x.frustumCulled||s.intersectsObject(x))){x.modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,x.matrixWorld);const k=e.update(x),U=x.material;if(Array.isArray(U)){const z=k.groups;for(let G=0,J=z.length;G=1):J.indexOf("OpenGL ES")!==-1&&(G=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),z=G>=2);let B=null,fe={};const se=t.getParameter(t.SCISSOR_BOX),we=t.getParameter(t.VIEWPORT),xe=new Kt().fromArray(se),Ne=new Kt().fromArray(we);function oe(F,le,ue,Le){const $e=new Uint8Array(4),St=t.createTexture();t.bindTexture(F,St),t.texParameteri(F,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(F,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let jt=0;jt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Rt,u=new WeakMap;let d;const h=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(O,R){return f?new OffscreenCanvas(O,R):vf("canvas")}function _(O,R,q){let K=1;const ae=ke(O);if((ae.width>q||ae.height>q)&&(K=q/Math.max(ae.width,ae.height)),K<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const pe=Math.floor(K*ae.width),Me=Math.floor(K*ae.height);d===void 0&&(d=v(pe,Me));const be=R?v(pe,Me):d;return be.width=pe,be.height=Me,be.getContext("2d").drawImage(O,0,0,pe,Me),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ae.width+"x"+ae.height+") to ("+pe+"x"+Me+")."),be}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ae.width+"x"+ae.height+")."),O;return O}function m(O){return O.generateMipmaps&&O.minFilter!==Cs&&O.minFilter!==oi}function g(O){t.generateMipmap(O)}function y(O,R,q,K,ae=!1){if(O!==null){if(t[O]!==void 0)return t[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let pe=R;if(R===t.RED&&(q===t.FLOAT&&(pe=t.R32F),q===t.HALF_FLOAT&&(pe=t.R16F),q===t.UNSIGNED_BYTE&&(pe=t.R8)),R===t.RED_INTEGER&&(q===t.UNSIGNED_BYTE&&(pe=t.R8UI),q===t.UNSIGNED_SHORT&&(pe=t.R16UI),q===t.UNSIGNED_INT&&(pe=t.R32UI),q===t.BYTE&&(pe=t.R8I),q===t.SHORT&&(pe=t.R16I),q===t.INT&&(pe=t.R32I)),R===t.RG&&(q===t.FLOAT&&(pe=t.RG32F),q===t.HALF_FLOAT&&(pe=t.RG16F),q===t.UNSIGNED_BYTE&&(pe=t.RG8)),R===t.RG_INTEGER&&(q===t.UNSIGNED_BYTE&&(pe=t.RG8UI),q===t.UNSIGNED_SHORT&&(pe=t.RG16UI),q===t.UNSIGNED_INT&&(pe=t.RG32UI),q===t.BYTE&&(pe=t.RG8I),q===t.SHORT&&(pe=t.RG16I),q===t.INT&&(pe=t.RG32I)),R===t.RGB&&q===t.UNSIGNED_INT_5_9_9_9_REV&&(pe=t.RGB9_E5),R===t.RGBA){const Me=ae?Hg:Bt.getTransfer(K);q===t.FLOAT&&(pe=t.RGBA32F),q===t.HALF_FLOAT&&(pe=t.RGBA16F),q===t.UNSIGNED_BYTE&&(pe=Me===an?t.SRGB8_ALPHA8:t.RGBA8),q===t.UNSIGNED_SHORT_4_4_4_4&&(pe=t.RGBA4),q===t.UNSIGNED_SHORT_5_5_5_1&&(pe=t.RGB5_A1)}return(pe===t.R16F||pe===t.R32F||pe===t.RG16F||pe===t.RG32F||pe===t.RGBA16F||pe===t.RGBA32F)&&e.get("EXT_color_buffer_float"),pe}function b(O,R){return m(O)===!0||O.isFramebufferTexture&&O.minFilter!==Cs&&O.minFilter!==oi?Math.log2(Math.max(R.width,R.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?R.mipmaps.length:1}function w(O){const R=O.target;R.removeEventListener("dispose",w),x(R),R.isVideoTexture&&u.delete(R)}function T(O){const R=O.target;R.removeEventListener("dispose",T),M(R)}function x(O){const R=s.get(O);if(R.__webglInit===void 0)return;const q=O.source,K=h.get(q);if(K){const ae=K[R.__cacheKey];ae.usedTimes--,ae.usedTimes===0&&A(O),Object.keys(K).length===0&&h.delete(q)}s.remove(O)}function A(O){const R=s.get(O);t.deleteTexture(R.__webglTexture);const q=O.source,K=h.get(q);delete K[R.__cacheKey],o.memory.textures--}function M(O){const R=s.get(O);if(O.depthTexture&&O.depthTexture.dispose(),O.isWebGLCubeRenderTarget)for(let K=0;K<6;K++){if(Array.isArray(R.__webglFramebuffer[K]))for(let ae=0;ae=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+i.maxTextures),E+=1,O}function D(O){const R=[];return R.push(O.wrapS),R.push(O.wrapT),R.push(O.wrapR||0),R.push(O.magFilter),R.push(O.minFilter),R.push(O.anisotropy),R.push(O.internalFormat),R.push(O.format),R.push(O.type),R.push(O.generateMipmaps),R.push(O.premultiplyAlpha),R.push(O.flipY),R.push(O.unpackAlignment),R.push(O.colorSpace),R.join()}function k(O,R){const q=s.get(O);if(O.isVideoTexture&&de(O),O.isRenderTargetTexture===!1&&O.version>0&&q.__version!==O.version){const K=O.image;if(K===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{xe(q,O,R);return}}n.bindTexture(t.TEXTURE_2D,q.__webglTexture,t.TEXTURE0+R)}function U(O,R){const q=s.get(O);if(O.version>0&&q.__version!==O.version){xe(q,O,R);return}n.bindTexture(t.TEXTURE_2D_ARRAY,q.__webglTexture,t.TEXTURE0+R)}function z(O,R){const q=s.get(O);if(O.version>0&&q.__version!==O.version){xe(q,O,R);return}n.bindTexture(t.TEXTURE_3D,q.__webglTexture,t.TEXTURE0+R)}function G(O,R){const q=s.get(O);if(O.version>0&&q.__version!==O.version){Ne(q,O,R);return}n.bindTexture(t.TEXTURE_CUBE_MAP,q.__webglTexture,t.TEXTURE0+R)}const J={[Xu]:t.REPEAT,[xa]:t.CLAMP_TO_EDGE,[Bg]:t.MIRRORED_REPEAT},B={[Cs]:t.NEAREST,[FC]:t.NEAREST_MIPMAP_NEAREST,[yh]:t.NEAREST_MIPMAP_LINEAR,[oi]:t.LINEAR,[tg]:t.LINEAR_MIPMAP_NEAREST,[fo]:t.LINEAR_MIPMAP_LINEAR},fe={[aK]:t.NEVER,[fK]:t.ALWAYS,[lK]:t.LESS,[YC]:t.LEQUAL,[cK]:t.EQUAL,[hK]:t.GEQUAL,[uK]:t.GREATER,[dK]:t.NOTEQUAL};function se(O,R){if(R.type===xr&&e.has("OES_texture_float_linear")===!1&&(R.magFilter===oi||R.magFilter===tg||R.magFilter===yh||R.magFilter===fo||R.minFilter===oi||R.minFilter===tg||R.minFilter===yh||R.minFilter===fo)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(O,t.TEXTURE_WRAP_S,J[R.wrapS]),t.texParameteri(O,t.TEXTURE_WRAP_T,J[R.wrapT]),(O===t.TEXTURE_3D||O===t.TEXTURE_2D_ARRAY)&&t.texParameteri(O,t.TEXTURE_WRAP_R,J[R.wrapR]),t.texParameteri(O,t.TEXTURE_MAG_FILTER,B[R.magFilter]),t.texParameteri(O,t.TEXTURE_MIN_FILTER,B[R.minFilter]),R.compareFunction&&(t.texParameteri(O,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(O,t.TEXTURE_COMPARE_FUNC,fe[R.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(R.magFilter===Cs||R.minFilter!==yh&&R.minFilter!==fo||R.type===xr&&e.has("OES_texture_float_linear")===!1)return;if(R.anisotropy>1||s.get(R).__currentAnisotropy){const q=e.get("EXT_texture_filter_anisotropic");t.texParameterf(O,q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(R.anisotropy,i.getMaxAnisotropy())),s.get(R).__currentAnisotropy=R.anisotropy}}}function we(O,R){let q=!1;O.__webglInit===void 0&&(O.__webglInit=!0,R.addEventListener("dispose",w));const K=R.source;let ae=h.get(K);ae===void 0&&(ae={},h.set(K,ae));const pe=D(R);if(pe!==O.__cacheKey){ae[pe]===void 0&&(ae[pe]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,q=!0),ae[pe].usedTimes++;const Me=ae[O.__cacheKey];Me!==void 0&&(ae[O.__cacheKey].usedTimes--,Me.usedTimes===0&&A(R)),O.__cacheKey=pe,O.__webglTexture=ae[pe].texture}return q}function xe(O,R,q){let K=t.TEXTURE_2D;(R.isDataArrayTexture||R.isCompressedArrayTexture)&&(K=t.TEXTURE_2D_ARRAY),R.isData3DTexture&&(K=t.TEXTURE_3D);const ae=we(O,R),pe=R.source;n.bindTexture(K,O.__webglTexture,t.TEXTURE0+q);const Me=s.get(pe);if(pe.version!==Me.__version||ae===!0){n.activeTexture(t.TEXTURE0+q);const be=Bt.getPrimaries(Bt.workingColorSpace),Se=R.colorSpace===va?null:Bt.getPrimaries(R.colorSpace),He=R.colorSpace===va||be===Se?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,R.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,R.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,R.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,He);let Pe=_(R.image,!1,i.maxTextureSize);Pe=he(R,Pe);const ye=r.convert(R.format,R.colorSpace),te=r.convert(R.type);let C=y(R.internalFormat,ye,te,R.colorSpace,R.isVideoTexture);se(K,R);let X;const N=R.mipmaps,V=R.isVideoTexture!==!0,W=Me.__version===void 0||ae===!0,Q=pe.dataReady,F=b(R,Pe);if(R.isDepthTexture)C=t.DEPTH_COMPONENT16,R.type===xr?C=t.DEPTH_COMPONENT32F:R.type===Ku?C=t.DEPTH_COMPONENT24:R.type===ep&&(C=t.DEPTH24_STENCIL8),W&&(V?n.texStorage2D(t.TEXTURE_2D,1,C,Pe.width,Pe.height):n.texImage2D(t.TEXTURE_2D,0,C,Pe.width,Pe.height,0,ye,te,null));else if(R.isDataTexture)if(N.length>0){V&&W&&n.texStorage2D(t.TEXTURE_2D,F,C,N[0].width,N[0].height);for(let le=0,ue=N.length;le>=1,ue>>=1}}else if(N.length>0){if(V&&W){const le=ke(N[0]);n.texStorage2D(t.TEXTURE_2D,F,C,le.width,le.height)}for(let le=0,ue=N.length;le0&&F++;const ue=ke(ye[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,F,N,ue.width,ue.height)}for(let ue=0;ue<6;ue++)if(Pe){V?Q&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ue,0,0,0,ye[ue].width,ye[ue].height,C,X,ye[ue].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ue,0,N,ye[ue].width,ye[ue].height,0,C,X,ye[ue].data);for(let Le=0;Le>pe),ye=Math.max(1,R.height>>pe);ae===t.TEXTURE_3D||ae===t.TEXTURE_2D_ARRAY?n.texImage3D(ae,pe,Se,Pe,ye,R.depth,0,Me,be,null):n.texImage2D(ae,pe,Se,Pe,ye,0,Me,be,null)}n.bindFramebuffer(t.FRAMEBUFFER,O),ee(R)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,K,ae,s.get(q).__webglTexture,0,$(R)):(ae===t.TEXTURE_2D||ae>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&ae<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,K,ae,s.get(q).__webglTexture,pe),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ee(O,R,q){if(t.bindRenderbuffer(t.RENDERBUFFER,O),R.depthBuffer&&!R.stencilBuffer){let K=t.DEPTH_COMPONENT24;if(q||ee(R)){const ae=R.depthTexture;ae&&ae.isDepthTexture&&(ae.type===xr?K=t.DEPTH_COMPONENT32F:ae.type===Ku&&(K=t.DEPTH_COMPONENT24));const pe=$(R);ee(R)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,pe,K,R.width,R.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,pe,K,R.width,R.height)}else t.renderbufferStorage(t.RENDERBUFFER,K,R.width,R.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,O)}else if(R.depthBuffer&&R.stencilBuffer){const K=$(R);q&&ee(R)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,K,t.DEPTH24_STENCIL8,R.width,R.height):ee(R)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,K,t.DEPTH24_STENCIL8,R.width,R.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,R.width,R.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,O)}else{const K=R.textures;for(let ae=0;ae1;if(Me||(K.__webglTexture===void 0&&(K.__webglTexture=t.createTexture()),K.__version=R.version,o.memory.textures++),pe){q.__webglFramebuffer=[];for(let be=0;be<6;be++)if(R.mipmaps&&R.mipmaps.length>0){q.__webglFramebuffer[be]=[];for(let Se=0;Se0){q.__webglFramebuffer=[];for(let be=0;be0&&ee(O)===!1){q.__webglMultisampledFramebuffer=t.createFramebuffer(),q.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,q.__webglMultisampledFramebuffer);for(let be=0;be0)for(let Se=0;Se0)for(let Se=0;Se0){if(ee(O)===!1){const R=O.textures,q=O.width,K=O.height;let ae=t.COLOR_BUFFER_BIT;const pe=O.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Me=s.get(O),be=R.length>1;if(be)for(let Se=0;Se0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&R.__useRenderToTexture!==!1}function de(O){const R=o.render.frame;u.get(O)!==R&&(u.set(O,R),O.update())}function he(O,R){const q=O.colorSpace,K=O.format,ae=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||q!==ss&&q!==va&&(Bt.getTransfer(q)===an?(K!==Ji||ae!==$a)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",q)),R}function ke(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(c.width=O.naturalWidth||O.width,c.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(c.width=O.displayWidth,c.height=O.displayHeight):(c.width=O.width,c.height=O.height),c}this.allocateTextureUnit=P,this.resetTextureUnits=S,this.setTexture2D=k,this.setTexture2DArray=U,this.setTexture3D=z,this.setTextureCube=G,this.rebindTextures=Re,this.setupRenderTarget=Ae,this.updateRenderTargetMipmap=j,this.updateMultisampleRenderTarget=L,this.setupDepthRenderbuffer=ne,this.setupFrameBufferTexture=oe,this.useMultisampledRTT=ee}function Rte(t,e){function n(s,i=va){let r;const o=Bt.getTransfer(i);if(s===$a)return t.UNSIGNED_BYTE;if(s===BC)return t.UNSIGNED_SHORT_4_4_4_4;if(s===HC)return t.UNSIGNED_SHORT_5_5_5_1;if(s===XX)return t.UNSIGNED_INT_5_9_9_9_REV;if(s===qX)return t.BYTE;if(s===YX)return t.SHORT;if(s===UC)return t.UNSIGNED_SHORT;if(s===$C)return t.INT;if(s===Ku)return t.UNSIGNED_INT;if(s===xr)return t.FLOAT;if(s===m0)return t.HALF_FLOAT;if(s===KX)return t.ALPHA;if(s===ZX)return t.RGB;if(s===Ji)return t.RGBA;if(s===JX)return t.LUMINANCE;if(s===QX)return t.LUMINANCE_ALPHA;if(s===Su)return t.DEPTH_COMPONENT;if(s===gf)return t.DEPTH_STENCIL;if(s===GC)return t.RED;if(s===zC)return t.RED_INTEGER;if(s===eK)return t.RG;if(s===VC)return t.RG_INTEGER;if(s===WC)return t.RGBA_INTEGER;if(s===R1||s===k1||s===C1||s===P1)if(o===an)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(s===R1)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===k1)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===C1)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===P1)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(s===R1)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===k1)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===C1)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===P1)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===OE||s===IE||s===LE||s===DE)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(s===OE)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===IE)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===LE)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===DE)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===NE||s===FE||s===UE)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(s===NE||s===FE)return o===an?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(s===UE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===$E||s===BE||s===HE||s===GE||s===zE||s===VE||s===WE||s===jE||s===qE||s===YE||s===XE||s===KE||s===ZE||s===JE)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(s===$E)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===BE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===HE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===GE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===zE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===VE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===WE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===jE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===qE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===YE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===XE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===KE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===ZE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===JE)return o===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===O1||s===QE||s===eT)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(s===O1)return o===an?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===QE)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===eT)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===tK||s===tT||s===nT||s===sT)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(s===O1)return r.COMPRESSED_RED_RGTC1_EXT;if(s===tT)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===nT)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===sT)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===ep?t.UNSIGNED_INT_24_8:t[s]!==void 0?t[s]:null}return{convert:n}}class kte extends Rs{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Hl extends yn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Cte={type:"move"};class iv{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Hl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Hl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new re,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new re),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Hl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new re,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new re),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const s of e.hand.values())this._getHandJoint(n,s)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,s){let i=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const m=n.getJointPose(_,s),g=this._getHandJoint(c,_);m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=m.radius),g.visible=m!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],h=u.position.distanceTo(d.position),f=.02,v=.005;c.inputState.pinching&&h>f+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&h<=f-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=n.getPose(e.gripSpace,s),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,s),i===null&&r!==null&&(i=r),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Cte)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const s=new Hl;s.matrixAutoUpdate=!1,s.visible=!1,e.joints[n.jointName]=s,e.add(s)}return e.joints[n.jointName]}}const Pte=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,Ote=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class Ite{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n,s){if(this.texture===null){const i=new es,r=e.properties.get(i);r.__webglTexture=n.texture,(n.depthNear!=s.depthNear||n.depthFar!=s.depthFar)&&(this.depthNear=n.depthNear,this.depthFar=n.depthFar),this.texture=i}}render(e,n){if(this.texture!==null){if(this.mesh===null){const s=n.cameras[0].viewport,i=new Ba({vertexShader:Pte,fragmentShader:Ote,uniforms:{depthColor:{value:this.texture},depthWidth:{value:s.z},depthHeight:{value:s.w}}});this.mesh=new Gs(new v0(20,20),i)}e.render(this.mesh,n)}}reset(){this.texture=null,this.mesh=null}}class Lte extends Ad{constructor(e,n){super();const s=this;let i=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,h=null,f=null,v=null;const _=new Ite,m=n.getContextAttributes();let g=null,y=null;const b=[],w=[],T=new Rt;let x=null;const A=new Rs;A.layers.enable(1),A.viewport=new Kt;const M=new Rs;M.layers.enable(2),M.viewport=new Kt;const E=[A,M],S=new kte;S.layers.enable(1),S.layers.enable(2);let P=null,D=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let Ee=b[oe];return Ee===void 0&&(Ee=new iv,b[oe]=Ee),Ee.getTargetRaySpace()},this.getControllerGrip=function(oe){let Ee=b[oe];return Ee===void 0&&(Ee=new iv,b[oe]=Ee),Ee.getGripSpace()},this.getHand=function(oe){let Ee=b[oe];return Ee===void 0&&(Ee=new iv,b[oe]=Ee),Ee.getHandSpace()};function k(oe){const Ee=w.indexOf(oe.inputSource);if(Ee===-1)return;const Ce=b[Ee];Ce!==void 0&&(Ce.update(oe.inputSource,oe.frame,c||o),Ce.dispatchEvent({type:oe.type,data:oe.inputSource}))}function U(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",U),i.removeEventListener("inputsourceschange",z);for(let oe=0;oe=0&&(w[ne]=null,b[ne].disconnect(Ce))}for(let Ee=0;Ee=w.length){w.push(Ce),ne=Ae;break}else if(w[Ae]===null){w[Ae]=Ce,ne=Ae;break}if(ne===-1)break}const Re=b[ne];Re&&Re.connect(Ce)}}const G=new re,J=new re;function B(oe,Ee,Ce){G.setFromMatrixPosition(Ee.matrixWorld),J.setFromMatrixPosition(Ce.matrixWorld);const ne=G.distanceTo(J),Re=Ee.projectionMatrix.elements,Ae=Ce.projectionMatrix.elements,j=Re[14]/(Re[10]-1),qe=Re[14]/(Re[10]+1),Fe=(Re[9]+1)/Re[5],L=(Re[9]-1)/Re[5],$=(Re[8]-1)/Re[0],ee=(Ae[8]+1)/Ae[0],de=j*$,he=j*ee,ke=ne/(-$+ee),O=ke*-$;Ee.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(O),oe.translateZ(ke),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert();const R=j+ke,q=qe+ke,K=de-O,ae=he+(ne-O),pe=Fe*qe/q*R,Me=L*qe/q*R;oe.projectionMatrix.makePerspective(K,ae,pe,Me,R,q),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}function fe(oe,Ee){Ee===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(Ee.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(i===null)return;_.texture!==null&&(oe.near=_.depthNear,oe.far=_.depthFar),S.near=M.near=A.near=oe.near,S.far=M.far=A.far=oe.far,(P!==S.near||D!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),P=S.near,D=S.far,A.near=P,A.far=D,M.near=P,M.far=D,A.updateProjectionMatrix(),M.updateProjectionMatrix(),oe.updateProjectionMatrix());const Ee=oe.parent,Ce=S.cameras;fe(S,Ee);for(let ne=0;ne0&&(m.alphaTest.value=g.alphaTest);const y=e.get(g),b=y.envMap,w=y.envMapRotation;if(b&&(m.envMap.value=b,hl.copy(w),hl.x*=-1,hl.y*=-1,hl.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(hl.y*=-1,hl.z*=-1),m.envMapRotation.value.setFromMatrix4(Dte.makeRotationFromEuler(hl)),m.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;const T=t._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*T,n(g.lightMap,m.lightMapTransform)}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity,n(g.aoMap,m.aoMapTransform))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,g.map&&(m.map.value=g.map,n(g.map,m.mapTransform))}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function l(m,g,y,b){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*y,m.scale.value=b*.5,g.map&&(m.map.value=g.map,n(g.map,m.uvTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,n(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function c(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map,n(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,n(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function u(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function d(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function h(m,g){m.metalness.value=g.metalness,g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap,n(g.metalnessMap,m.metalnessMapTransform)),m.roughness.value=g.roughness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap,n(g.roughnessMap,m.roughnessMapTransform)),g.envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function f(m,g,y){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap,n(g.sheenColorMap,m.sheenColorMapTransform)),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap,n(g.sheenRoughnessMap,m.sheenRoughnessMapTransform))),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap,n(g.clearcoatMap,m.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,n(g.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(m.clearcoatNormalMap.value=g.clearcoatNormalMap,n(g.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Vs&&m.clearcoatNormalScale.value.negate())),g.dispersion>0&&(m.dispersion.value=g.dispersion),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap,n(g.iridescenceMap,m.iridescenceMapTransform)),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap,n(g.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=y.texture,m.transmissionSamplerSize.value.set(y.width,y.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap,n(g.transmissionMap,m.transmissionMapTransform)),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap,n(g.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(m.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(m.anisotropyMap.value=g.anisotropyMap,n(g.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap,n(g.specularColorMap,m.specularColorMapTransform)),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap,n(g.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,g){g.matcap&&(m.matcap.value=g.matcap)}function _(m,g){const y=e.get(g).light;m.referencePosition.value.setFromMatrixPosition(y.matrixWorld),m.nearDistance.value=y.shadow.camera.near,m.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:i}}function Fte(t,e,n,s){let i={},r={},o=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,b){const w=b.program;s.uniformBlockBinding(y,w)}function c(y,b){let w=i[y.id];w===void 0&&(v(y),w=u(y),i[y.id]=w,y.addEventListener("dispose",m));const T=b.program;s.updateUBOMapping(y,T);const x=e.render.frame;r[y.id]!==x&&(h(y),r[y.id]=x)}function u(y){const b=d();y.__bindingPointIndex=b;const w=t.createBuffer(),T=y.__size,x=y.usage;return t.bindBuffer(t.UNIFORM_BUFFER,w),t.bufferData(t.UNIFORM_BUFFER,T,x),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,b,w),w}function d(){for(let y=0;y0&&(w+=T-x),y.__size=w,y.__cache={},this}function _(y){const b={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(b.boundary=4,b.storage=4):y.isVector2?(b.boundary=8,b.storage=8):y.isVector3||y.isColor?(b.boundary=16,b.storage=12):y.isVector4?(b.boundary=16,b.storage=16):y.isMatrix3?(b.boundary=48,b.storage=48):y.isMatrix4?(b.boundary=64,b.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),b}function m(y){const b=y.target;b.removeEventListener("dispose",m);const w=o.indexOf(b.__bindingPointIndex);o.splice(w,1),t.deleteBuffer(i[b.id]),delete i[b.id],delete r[b.id]}function g(){for(const y in i)t.deleteBuffer(i[y]);o=[],i={},r={}}return{bind:l,update:c,dispose:g}}class Ute{constructor(e={}){const{canvas:n=PK(),context:s=null,depth:i=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let h;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=s.getContextAttributes().alpha}else h=o;const f=new Uint32Array(4),v=new Int32Array(4);let _=null,m=null;const g=[],y=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ms,this._useLegacyLights=!1,this.toneMapping=Ia,this.toneMappingExposure=1;const b=this;let w=!1,T=0,x=0,A=null,M=-1,E=null;const S=new Kt,P=new Kt;let D=null;const k=new ht(0);let U=0,z=n.width,G=n.height,J=1,B=null,fe=null;const se=new Kt(0,0,z,G),we=new Kt(0,0,z,G);let xe=!1;const Ne=new cx;let oe=!1,Ee=!1;const Ce=new xt,ne=new re,Re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ae(){return A===null?J:1}let j=s;function qe(I,ce){return n.getContext(I,ce)}try{const I={alpha:!0,depth:i,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${ox}`),n.addEventListener("webglcontextlost",F,!1),n.addEventListener("webglcontextrestored",le,!1),n.addEventListener("webglcontextcreationerror",ue,!1),j===null){const ce="webgl2";if(j=qe(ce,I),j===null)throw qe(ce)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(I){throw console.error("THREE.WebGLRenderer: "+I.message),I}let Fe,L,$,ee,de,he,ke,O,R,q,K,ae,pe,Me,be,Se,He,Pe,ye,te,C,X,N,V;function W(){Fe=new jQ(j),Fe.init(),X=new Rte(j,Fe),L=new BQ(j,Fe,e,X),$=new Ate(j),ee=new XQ(j),de=new hte,he=new Mte(j,Fe,$,de,L,X,ee),ke=new GQ(b),O=new WQ(b),R=new nZ(j),N=new UQ(j,R),q=new qQ(j,R,ee,N),K=new ZQ(j,q,R,ee),ye=new KQ(j,L,he),Se=new HQ(de),ae=new dte(b,ke,O,Fe,L,N,Se),pe=new Nte(b,de),Me=new pte,be=new bte(Fe),Pe=new FQ(b,ke,O,$,K,h,l),He=new Tte(b,K,L),V=new Fte(j,ee,L,$),te=new $Q(j,Fe,ee),C=new YQ(j,Fe,ee),ee.programs=ae.programs,b.capabilities=L,b.extensions=Fe,b.properties=de,b.renderLists=Me,b.shadowMap=He,b.state=$,b.info=ee}W();const Q=new Lte(b,j);this.xr=Q,this.getContext=function(){return j},this.getContextAttributes=function(){return j.getContextAttributes()},this.forceContextLoss=function(){const I=Fe.get("WEBGL_lose_context");I&&I.loseContext()},this.forceContextRestore=function(){const I=Fe.get("WEBGL_lose_context");I&&I.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(I){I!==void 0&&(J=I,this.setSize(z,G,!1))},this.getSize=function(I){return I.set(z,G)},this.setSize=function(I,ce,ve=!0){if(Q.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}z=I,G=ce,n.width=Math.floor(I*J),n.height=Math.floor(ce*J),ve===!0&&(n.style.width=I+"px",n.style.height=ce+"px"),this.setViewport(0,0,I,ce)},this.getDrawingBufferSize=function(I){return I.set(z*J,G*J).floor()},this.setDrawingBufferSize=function(I,ce,ve){z=I,G=ce,J=ve,n.width=Math.floor(I*ve),n.height=Math.floor(ce*ve),this.setViewport(0,0,I,ce)},this.getCurrentViewport=function(I){return I.copy(S)},this.getViewport=function(I){return I.copy(se)},this.setViewport=function(I,ce,ve,ge){I.isVector4?se.set(I.x,I.y,I.z,I.w):se.set(I,ce,ve,ge),$.viewport(S.copy(se).multiplyScalar(J).round())},this.getScissor=function(I){return I.copy(we)},this.setScissor=function(I,ce,ve,ge){I.isVector4?we.set(I.x,I.y,I.z,I.w):we.set(I,ce,ve,ge),$.scissor(P.copy(we).multiplyScalar(J).round())},this.getScissorTest=function(){return xe},this.setScissorTest=function(I){$.setScissorTest(xe=I)},this.setOpaqueSort=function(I){B=I},this.setTransparentSort=function(I){fe=I},this.getClearColor=function(I){return I.copy(Pe.getClearColor())},this.setClearColor=function(){Pe.setClearColor.apply(Pe,arguments)},this.getClearAlpha=function(){return Pe.getClearAlpha()},this.setClearAlpha=function(){Pe.setClearAlpha.apply(Pe,arguments)},this.clear=function(I=!0,ce=!0,ve=!0){let ge=0;if(I){let _e=!1;if(A!==null){const Ve=A.texture.format;_e=Ve===WC||Ve===VC||Ve===zC}if(_e){const Ve=A.texture.type,Ke=Ve===$a||Ve===Ku||Ve===UC||Ve===ep||Ve===BC||Ve===HC,Je=Pe.getClearColor(),at=Pe.getClearAlpha(),pt=Je.r,yt=Je.g,Tt=Je.b;Ke?(f[0]=pt,f[1]=yt,f[2]=Tt,f[3]=at,j.clearBufferuiv(j.COLOR,0,f)):(v[0]=pt,v[1]=yt,v[2]=Tt,v[3]=at,j.clearBufferiv(j.COLOR,0,v))}else ge|=j.COLOR_BUFFER_BIT}ce&&(ge|=j.DEPTH_BUFFER_BIT),ve&&(ge|=j.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),j.clear(ge)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",F,!1),n.removeEventListener("webglcontextrestored",le,!1),n.removeEventListener("webglcontextcreationerror",ue,!1),Me.dispose(),be.dispose(),de.dispose(),ke.dispose(),O.dispose(),K.dispose(),N.dispose(),V.dispose(),ae.dispose(),Q.dispose(),Q.removeEventListener("sessionstart",Ht),Q.removeEventListener("sessionend",lr),bs.stop()};function F(I){I.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function le(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const I=ee.autoReset,ce=He.enabled,ve=He.autoUpdate,ge=He.needsUpdate,_e=He.type;W(),ee.autoReset=I,He.enabled=ce,He.autoUpdate=ve,He.needsUpdate=ge,He.type=_e}function ue(I){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",I.statusMessage)}function Le(I){const ce=I.target;ce.removeEventListener("dispose",Le),$e(ce)}function $e(I){St(I),de.remove(I)}function St(I){const ce=de.get(I).programs;ce!==void 0&&(ce.forEach(function(ve){ae.releaseProgram(ve)}),I.isShaderMaterial&&ae.releaseShaderCache(I))}this.renderBufferDirect=function(I,ce,ve,ge,_e,Ve){ce===null&&(ce=Re);const Ke=_e.isMesh&&_e.matrixWorld.determinant()<0,Je=g6(I,ce,ve,ge,_e);$.setMaterial(ge,Ke);let at=ve.index,pt=1;if(ge.wireframe===!0){if(at=q.getWireframeAttribute(ve),at===void 0)return;pt=2}const yt=ve.drawRange,Tt=ve.attributes.position;let In=yt.start*pt,os=(yt.start+yt.count)*pt;Ve!==null&&(In=Math.max(In,Ve.start*pt),os=Math.min(os,(Ve.start+Ve.count)*pt)),at!==null?(In=Math.max(In,0),os=Math.min(os,at.count)):Tt!=null&&(In=Math.max(In,0),os=Math.min(os,Tt.count));const qs=os-In;if(qs<0||qs===1/0)return;N.setup(_e,ge,Je,ve,at);let Br,$t=te;if(at!==null&&(Br=R.get(at),$t=C,$t.setIndex(Br)),_e.isMesh)ge.wireframe===!0?($.setLineWidth(ge.wireframeLinewidth*Ae()),$t.setMode(j.LINES)):$t.setMode(j.TRIANGLES);else if(_e.isLine){let mt=ge.linewidth;mt===void 0&&(mt=1),$.setLineWidth(mt*Ae()),_e.isLineSegments?$t.setMode(j.LINES):_e.isLineLoop?$t.setMode(j.LINE_LOOP):$t.setMode(j.LINE_STRIP)}else _e.isPoints?$t.setMode(j.POINTS):_e.isSprite&&$t.setMode(j.TRIANGLES);if(_e.isBatchedMesh)_e._multiDrawInstances!==null?$t.renderMultiDrawInstances(_e._multiDrawStarts,_e._multiDrawCounts,_e._multiDrawCount,_e._multiDrawInstances):$t.renderMultiDraw(_e._multiDrawStarts,_e._multiDrawCounts,_e._multiDrawCount);else if(_e.isInstancedMesh)$t.renderInstances(In,qs,_e.count);else if(ve.isInstancedBufferGeometry){const mt=ve._maxInstanceCount!==void 0?ve._maxInstanceCount:1/0,$d=Math.min(ve.instanceCount,mt);$t.renderInstances(In,qs,$d)}else $t.render(In,qs)};function jt(I,ce,ve){I.transparent===!0&&I.side===br&&I.forceSinglePass===!1?(I.side=Vs,I.needsUpdate=!0,dp(I,ce,ve),I.side=Mo,I.needsUpdate=!0,dp(I,ce,ve),I.side=br):dp(I,ce,ve)}this.compile=function(I,ce,ve=null){ve===null&&(ve=I),m=be.get(ve),m.init(ce),y.push(m),ve.traverseVisible(function(_e){_e.isLight&&_e.layers.test(ce.layers)&&(m.pushLight(_e),_e.castShadow&&m.pushShadow(_e))}),I!==ve&&I.traverseVisible(function(_e){_e.isLight&&_e.layers.test(ce.layers)&&(m.pushLight(_e),_e.castShadow&&m.pushShadow(_e))}),m.setupLights(b._useLegacyLights);const ge=new Set;return I.traverse(function(_e){const Ve=_e.material;if(Ve)if(Array.isArray(Ve))for(let Ke=0;Ke{function Ve(){if(ge.forEach(function(Ke){de.get(Ke).currentProgram.isReady()&&ge.delete(Ke)}),ge.size===0){_e(I);return}setTimeout(Ve,10)}Fe.get("KHR_parallel_shader_compile")!==null?Ve():setTimeout(Ve,10)})};let sn=null;function rs(I){sn&&sn(I)}function Ht(){bs.stop()}function lr(){bs.start()}const bs=new o8;bs.setAnimationLoop(rs),typeof self<"u"&&bs.setContext(self),this.setAnimationLoop=function(I){sn=I,Q.setAnimationLoop(I),I===null?bs.stop():bs.start()},Q.addEventListener("sessionstart",Ht),Q.addEventListener("sessionend",lr),this.render=function(I,ce){if(ce!==void 0&&ce.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),ce.parent===null&&ce.matrixWorldAutoUpdate===!0&&ce.updateMatrixWorld(),Q.enabled===!0&&Q.isPresenting===!0&&(Q.cameraAutoUpdate===!0&&Q.updateCamera(ce),ce=Q.getCamera()),I.isScene===!0&&I.onBeforeRender(b,I,ce,A),m=be.get(I,y.length),m.init(ce),y.push(m),Ce.multiplyMatrices(ce.projectionMatrix,ce.matrixWorldInverse),Ne.setFromProjectionMatrix(Ce),Ee=this.localClippingEnabled,oe=Se.init(this.clippingPlanes,Ee),_=Me.get(I,g.length),_.init(),g.push(_),g2(I,ce,0,b.sortObjects),_.finish(),b.sortObjects===!0&&_.sort(B,fe);const ve=Q.enabled===!1||Q.isPresenting===!1||Q.hasDepthSensing()===!1;ve&&Pe.addToRenderList(_,I),this.info.render.frame++,oe===!0&&Se.beginShadows();const ge=m.state.shadowsArray;He.render(ge,I,ce),oe===!0&&Se.endShadows(),this.info.autoReset===!0&&this.info.reset();const _e=_.opaque,Ve=_.transmissive;if(m.setupLights(b._useLegacyLights),ce.isArrayCamera){const Ke=ce.cameras;if(Ve.length>0)for(let Je=0,at=Ke.length;Je0&&v2(_e,Ve,I,ce),ve&&Pe.render(I),_2(_,I,ce);A!==null&&(he.updateMultisampleRenderTarget(A),he.updateRenderTargetMipmap(A)),I.isScene===!0&&I.onAfterRender(b,I,ce),N.resetDefaultState(),M=-1,E=null,y.pop(),y.length>0?(m=y[y.length-1],oe===!0&&Se.setGlobalState(b.clippingPlanes,m.state.camera)):m=null,g.pop(),g.length>0?_=g[g.length-1]:_=null};function g2(I,ce,ve,ge){if(I.visible===!1)return;if(I.layers.test(ce.layers)){if(I.isGroup)ve=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(ce);else if(I.isLight)m.pushLight(I),I.castShadow&&m.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||Ne.intersectsSprite(I)){ge&&ne.setFromMatrixPosition(I.matrixWorld).applyMatrix4(Ce);const Ke=K.update(I),Je=I.material;Je.visible&&_.push(I,Ke,Je,ve,ne.z,null)}}else if((I.isMesh||I.isLine||I.isPoints)&&(!I.frustumCulled||Ne.intersectsObject(I))){const Ke=K.update(I),Je=I.material;if(ge&&(I.boundingSphere!==void 0?(I.boundingSphere===null&&I.computeBoundingSphere(),ne.copy(I.boundingSphere.center)):(Ke.boundingSphere===null&&Ke.computeBoundingSphere(),ne.copy(Ke.boundingSphere.center)),ne.applyMatrix4(I.matrixWorld).applyMatrix4(Ce)),Array.isArray(Je)){const at=Ke.groups;for(let pt=0,yt=at.length;pt0&&up(_e,ce,ve),Ve.length>0&&up(Ve,ce,ve),Ke.length>0&&up(Ke,ce,ve),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function v2(I,ce,ve,ge){if((ve.isScene===!0?ve.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[ge.id]===void 0&&(m.state.transmissionRenderTarget[ge.id]=new rc(1,1,{generateMipmaps:!0,type:Fe.has("EXT_color_buffer_half_float")||Fe.has("EXT_color_buffer_float")?m0:$a,minFilter:fo,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));const Ve=m.state.transmissionRenderTarget[ge.id],Ke=ge.viewport||S;Ve.setSize(Ke.z,Ke.w);const Je=b.getRenderTarget();b.setRenderTarget(Ve),b.getClearColor(k),U=b.getClearAlpha(),U<1&&b.setClearColor(16777215,.5),b.clear();const at=b.toneMapping;b.toneMapping=Ia;const pt=ge.viewport;if(ge.viewport!==void 0&&(ge.viewport=void 0),m.setupLightsView(ge),oe===!0&&Se.setGlobalState(b.clippingPlanes,ge),up(I,ve,ge),he.updateMultisampleRenderTarget(Ve),he.updateRenderTargetMipmap(Ve),Fe.has("WEBGL_multisampled_render_to_texture")===!1){let yt=!1;for(let Tt=0,In=ce.length;Tt0),Tt=!!ve.morphAttributes.position,In=!!ve.morphAttributes.normal,os=!!ve.morphAttributes.color;let qs=Ia;ge.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(qs=b.toneMapping);const Br=ve.morphAttributes.position||ve.morphAttributes.normal||ve.morphAttributes.color,$t=Br!==void 0?Br.length:0,mt=de.get(ge),$d=m.state.lights;if(oe===!0&&(Ee===!0||I!==E)){const fi=I===E&&ge.id===M;Se.setState(ge,I,fi)}let mn=!1;ge.version===mt.__version?(mt.needsLights&&mt.lightsStateVersion!==$d.state.version||mt.outputColorSpace!==Je||_e.isBatchedMesh&&mt.batching===!1||!_e.isBatchedMesh&&mt.batching===!0||_e.isInstancedMesh&&mt.instancing===!1||!_e.isInstancedMesh&&mt.instancing===!0||_e.isSkinnedMesh&&mt.skinning===!1||!_e.isSkinnedMesh&&mt.skinning===!0||_e.isInstancedMesh&&mt.instancingColor===!0&&_e.instanceColor===null||_e.isInstancedMesh&&mt.instancingColor===!1&&_e.instanceColor!==null||_e.isInstancedMesh&&mt.instancingMorph===!0&&_e.morphTexture===null||_e.isInstancedMesh&&mt.instancingMorph===!1&&_e.morphTexture!==null||mt.envMap!==at||ge.fog===!0&&mt.fog!==Ve||mt.numClippingPlanes!==void 0&&(mt.numClippingPlanes!==Se.numPlanes||mt.numIntersection!==Se.numIntersection)||mt.vertexAlphas!==pt||mt.vertexTangents!==yt||mt.morphTargets!==Tt||mt.morphNormals!==In||mt.morphColors!==os||mt.toneMapping!==qs||mt.morphTargetsCount!==$t)&&(mn=!0):(mn=!0,mt.__version=ge.version);let nl=mt.currentProgram;mn===!0&&(nl=dp(ge,ce,_e));let x2=!1,Bd=!1,H0=!1;const as=nl.getUniforms(),$o=mt.uniforms;if($.useProgram(nl.program)&&(x2=!0,Bd=!0,H0=!0),ge.id!==M&&(M=ge.id,Bd=!0),x2||E!==I){as.setValue(j,"projectionMatrix",I.projectionMatrix),as.setValue(j,"viewMatrix",I.matrixWorldInverse);const fi=as.map.cameraPosition;fi!==void 0&&fi.setValue(j,ne.setFromMatrixPosition(I.matrixWorld)),L.logarithmicDepthBuffer&&as.setValue(j,"logDepthBufFC",2/(Math.log(I.far+1)/Math.LN2)),(ge.isMeshPhongMaterial||ge.isMeshToonMaterial||ge.isMeshLambertMaterial||ge.isMeshBasicMaterial||ge.isMeshStandardMaterial||ge.isShaderMaterial)&&as.setValue(j,"isOrthographic",I.isOrthographicCamera===!0),E!==I&&(E=I,Bd=!0,H0=!0)}if(_e.isSkinnedMesh){as.setOptional(j,_e,"bindMatrix"),as.setOptional(j,_e,"bindMatrixInverse");const fi=_e.skeleton;fi&&(fi.boneTexture===null&&fi.computeBoneTexture(),as.setValue(j,"boneTexture",fi.boneTexture,he))}_e.isBatchedMesh&&(as.setOptional(j,_e,"batchingTexture"),as.setValue(j,"batchingTexture",_e._matricesTexture,he));const G0=ve.morphAttributes;if((G0.position!==void 0||G0.normal!==void 0||G0.color!==void 0)&&ye.update(_e,ve,nl),(Bd||mt.receiveShadow!==_e.receiveShadow)&&(mt.receiveShadow=_e.receiveShadow,as.setValue(j,"receiveShadow",_e.receiveShadow)),ge.isMeshGouraudMaterial&&ge.envMap!==null&&($o.envMap.value=at,$o.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),ge.isMeshStandardMaterial&&ge.envMap===null&&ce.environment!==null&&($o.envMapIntensity.value=ce.environmentIntensity),Bd&&(as.setValue(j,"toneMappingExposure",b.toneMappingExposure),mt.needsLights&&_6($o,H0),Ve&&ge.fog===!0&&pe.refreshFogUniforms($o,Ve),pe.refreshMaterialUniforms($o,ge,J,G,m.state.transmissionRenderTarget[I.id]),ng.upload(j,b2(mt),$o,he)),ge.isShaderMaterial&&ge.uniformsNeedUpdate===!0&&(ng.upload(j,b2(mt),$o,he),ge.uniformsNeedUpdate=!1),ge.isSpriteMaterial&&as.setValue(j,"center",_e.center),as.setValue(j,"modelViewMatrix",_e.modelViewMatrix),as.setValue(j,"normalMatrix",_e.normalMatrix),as.setValue(j,"modelMatrix",_e.matrixWorld),ge.isShaderMaterial||ge.isRawShaderMaterial){const fi=ge.uniformsGroups;for(let z0=0,y6=fi.length;z00&&he.useMultisampledRTT(I)===!1?_e=de.get(I).__webglMultisampledFramebuffer:Array.isArray(yt)?_e=yt[ve]:_e=yt,S.copy(I.viewport),P.copy(I.scissor),D=I.scissorTest}else S.copy(se).multiplyScalar(J).floor(),P.copy(we).multiplyScalar(J).floor(),D=xe;if($.bindFramebuffer(j.FRAMEBUFFER,_e)&&ge&&$.drawBuffers(I,_e),$.viewport(S),$.scissor(P),$.setScissorTest(D),Ve){const at=de.get(I.texture);j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_CUBE_MAP_POSITIVE_X+ce,at.__webglTexture,ve)}else if(Ke){const at=de.get(I.texture),pt=ce||0;j.framebufferTextureLayer(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,at.__webglTexture,ve||0,pt)}M=-1},this.readRenderTargetPixels=function(I,ce,ve,ge,_e,Ve,Ke){if(!(I&&I.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Je=de.get(I).__webglFramebuffer;if(I.isWebGLCubeRenderTarget&&Ke!==void 0&&(Je=Je[Ke]),Je){$.bindFramebuffer(j.FRAMEBUFFER,Je);try{const at=I.texture,pt=at.format,yt=at.type;if(!L.textureFormatReadable(pt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!L.textureTypeReadable(yt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ce>=0&&ce<=I.width-ge&&ve>=0&&ve<=I.height-_e&&j.readPixels(ce,ve,ge,_e,X.convert(pt),X.convert(yt),Ve)}finally{const at=A!==null?de.get(A).__webglFramebuffer:null;$.bindFramebuffer(j.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(I,ce,ve=0){const ge=Math.pow(2,-ve),_e=Math.floor(ce.image.width*ge),Ve=Math.floor(ce.image.height*ge);he.setTexture2D(ce,0),j.copyTexSubImage2D(j.TEXTURE_2D,ve,0,0,I.x,I.y,_e,Ve),$.unbindTexture()},this.copyTextureToTexture=function(I,ce,ve,ge=0){const _e=ce.image.width,Ve=ce.image.height,Ke=X.convert(ve.format),Je=X.convert(ve.type);he.setTexture2D(ve,0),j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,ve.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ve.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,ve.unpackAlignment),ce.isDataTexture?j.texSubImage2D(j.TEXTURE_2D,ge,I.x,I.y,_e,Ve,Ke,Je,ce.image.data):ce.isCompressedTexture?j.compressedTexSubImage2D(j.TEXTURE_2D,ge,I.x,I.y,ce.mipmaps[0].width,ce.mipmaps[0].height,Ke,ce.mipmaps[0].data):j.texSubImage2D(j.TEXTURE_2D,ge,I.x,I.y,Ke,Je,ce.image),ge===0&&ve.generateMipmaps&&j.generateMipmap(j.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(I,ce,ve,ge,_e=0){const Ve=I.max.x-I.min.x,Ke=I.max.y-I.min.y,Je=I.max.z-I.min.z,at=X.convert(ge.format),pt=X.convert(ge.type);let yt;if(ge.isData3DTexture)he.setTexture3D(ge,0),yt=j.TEXTURE_3D;else if(ge.isDataArrayTexture||ge.isCompressedArrayTexture)he.setTexture2DArray(ge,0),yt=j.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,ge.flipY),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ge.premultiplyAlpha),j.pixelStorei(j.UNPACK_ALIGNMENT,ge.unpackAlignment);const Tt=j.getParameter(j.UNPACK_ROW_LENGTH),In=j.getParameter(j.UNPACK_IMAGE_HEIGHT),os=j.getParameter(j.UNPACK_SKIP_PIXELS),qs=j.getParameter(j.UNPACK_SKIP_ROWS),Br=j.getParameter(j.UNPACK_SKIP_IMAGES),$t=ve.isCompressedTexture?ve.mipmaps[_e]:ve.image;j.pixelStorei(j.UNPACK_ROW_LENGTH,$t.width),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,$t.height),j.pixelStorei(j.UNPACK_SKIP_PIXELS,I.min.x),j.pixelStorei(j.UNPACK_SKIP_ROWS,I.min.y),j.pixelStorei(j.UNPACK_SKIP_IMAGES,I.min.z),ve.isDataTexture||ve.isData3DTexture?j.texSubImage3D(yt,_e,ce.x,ce.y,ce.z,Ve,Ke,Je,at,pt,$t.data):ge.isCompressedArrayTexture?j.compressedTexSubImage3D(yt,_e,ce.x,ce.y,ce.z,Ve,Ke,Je,at,$t.data):j.texSubImage3D(yt,_e,ce.x,ce.y,ce.z,Ve,Ke,Je,at,pt,$t),j.pixelStorei(j.UNPACK_ROW_LENGTH,Tt),j.pixelStorei(j.UNPACK_IMAGE_HEIGHT,In),j.pixelStorei(j.UNPACK_SKIP_PIXELS,os),j.pixelStorei(j.UNPACK_SKIP_ROWS,qs),j.pixelStorei(j.UNPACK_SKIP_IMAGES,Br),_e===0&&ge.generateMipmaps&&j.generateMipmap(yt),$.unbindTexture()},this.initTexture=function(I){I.isCubeTexture?he.setTextureCube(I,0):I.isData3DTexture?he.setTexture3D(I,0):I.isDataArrayTexture||I.isCompressedArrayTexture?he.setTexture2DArray(I,0):he.setTexture2D(I,0),$.unbindTexture()},this.resetState=function(){T=0,x=0,A=null,$.reset(),N.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return po}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===ax?"display-p3":"srgb",n.unpackColorSpace=Bt.workingColorSpace===g0?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class $te extends yn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Or,this.environmentIntensity=1,this.environmentRotation=new Or,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class Bte{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Ly,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=er()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return KC("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,s){e*=this.stride,s*=n.stride;for(let i=0,r=this.stride;i0){const i=n[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;rs)return;av.applyMatrix4(t.matrixWorld);const l=e.ray.origin.distanceTo(av);if(!(le.far))return{distance:l,point:oA.clone().applyMatrix4(t.matrixWorld),index:i,face:null,faceIndex:null,object:t}}const aA=new re,lA=new re;class jte extends px{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,s=[];for(let i=0,r=n.count;i0){const i=n[s[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=i.length;ri.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class mx extends Mr{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ht(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ht(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qC,this.normalScale=new Rt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Or,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ur extends mx{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Rt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return fs(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new ht(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new ht(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ht(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function nm(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function Xte(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Kte(t){function e(i,r){return t[i]-t[r]}const n=t.length,s=new Array(n);for(let i=0;i!==n;++i)s[i]=i;return s.sort(e),s}function dA(t,e,n){const s=t.length,i=new t.constructor(s);for(let r=0,o=0;o!==s;++r){const a=n[r]*e;for(let l=0;l!==e;++l)i[o++]=t[a+l]}return i}function _8(t,e,n,s){let i=1,r=t[0];for(;r!==void 0&&r[s]===void 0;)r=t[i++];if(r===void 0)return;let o=r[s];if(o!==void 0)if(Array.isArray(o))do o=r[s],o!==void 0&&(e.push(r.time),n.push.apply(n,o)),r=t[i++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[s],o!==void 0&&(e.push(r.time),o.toArray(n,n.length)),r=t[i++];while(r!==void 0);else do o=r[s],o!==void 0&&(e.push(r.time),n.push(o)),r=t[i++];while(r!==void 0)}class tp{constructor(e,n,s,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new n.constructor(s),this.sampleValues=n,this.valueSize=s,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let s=this._cachedIndex,i=n[s],r=n[s-1];e:{t:{let o;n:{s:if(!(e=r)){const a=n[1];e=r)break t}o=s,s=0;break n}break e}for(;s>>1;en;)--o;if(++o,r!==0||o!==i){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=s.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const s=this.times,i=this.values,r=s.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=s[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Xte(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),s=this.getValueSize(),i=this.getInterpolation()===I1,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*s,l=o*s,c=0;c!==s;++c)n[l+c]=n[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=n.slice(0,o*s)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),s=this.constructor,i=new s(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}$r.prototype.TimeBufferType=Float32Array;$r.prototype.ValueBufferType=Float32Array;$r.prototype.DefaultInterpolation=Zu;class kd extends $r{}kd.prototype.ValueTypeName="bool";kd.prototype.ValueBufferType=Array;kd.prototype.DefaultInterpolation=_f;kd.prototype.InterpolantFactoryMethodLinear=void 0;kd.prototype.InterpolantFactoryMethodSmooth=void 0;class v8 extends $r{}v8.prototype.ValueTypeName="color";class ed extends $r{}ed.prototype.ValueTypeName="number";class ene extends tp{constructor(e,n,s,i){super(e,n,s,i)}interpolate_(e,n,s,i){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(s-n)/(i-n);let c=e*a;for(let u=c+a;c!==u;c+=4)No.slerpFlat(r,0,o,c-a,o,c,l);return r}}class oc extends $r{InterpolantFactoryMethodLinear(e){return new ene(this.times,this.values,this.getValueSize(),e)}}oc.prototype.ValueTypeName="quaternion";oc.prototype.DefaultInterpolation=Zu;oc.prototype.InterpolantFactoryMethodSmooth=void 0;class Cd extends $r{}Cd.prototype.ValueTypeName="string";Cd.prototype.ValueBufferType=Array;Cd.prototype.DefaultInterpolation=_f;Cd.prototype.InterpolantFactoryMethodLinear=void 0;Cd.prototype.InterpolantFactoryMethodSmooth=void 0;class td extends $r{}td.prototype.ValueTypeName="vector";class tne{constructor(e="",n=-1,s=[],i=nK){this.name=e,this.tracks=s,this.duration=n,this.blendMode=i,this.uuid=er(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],s=e.tracks,i=1/(e.fps||1);for(let o=0,a=s.length;o!==a;++o)n.push(sne(s[o]).scale(i));const r=new this(e.name,e.duration,n,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const n=[],s=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=s.length;r!==o;++r)n.push($r.toJSON(s[r]));return i}static CreateFromMorphTargetSequence(e,n,s,i){const r=n.length,o=[];for(let a=0;a1){const d=u[1];let h=i[d];h||(i[d]=h=[]),h.push(c)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],n,s));return o}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const s=function(d,h,f,v,_){if(f.length!==0){const m=[],g=[];_8(f,m,g,v),m.length!==0&&_.push(new d(h,m,g))}},i=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d{n&&n(r),this.manager.itemEnd(e)},0),r;if(Yr[e]!==void 0){Yr[e].push({onLoad:n,onProgress:s,onError:i});return}Yr[e]=[],Yr[e].push({onLoad:n,onProgress:s,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Yr[e],d=c.body.getReader(),h=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=h?parseInt(h):0,v=f!==0;let _=0;const m=new ReadableStream({start(g){y();function y(){d.read().then(({done:b,value:w})=>{if(b)g.close();else{_+=w.byteLength;const T=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:f});for(let x=0,A=u.length;x{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),h=d&&d[1]?d[1].toLowerCase():void 0,f=new TextDecoder(h);return c.arrayBuffer().then(v=>f.decode(v))}}}).then(c=>{Ea.add(e,c);const u=Yr[e];delete Yr[e];for(let d=0,h=u.length;d{const u=Yr[e];if(u===void 0)throw this.manager.itemError(e),c;delete Yr[e];for(let d=0,h=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class ane extends Pd{constructor(e){super(e)}load(e,n,s,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ea.get(e);if(o!==void 0)return r.manager.itemStart(e),setTimeout(function(){n&&n(o),r.manager.itemEnd(e)},0),o;const a=vf("img");function l(){u(),Ea.add(e,this),n&&n(this),r.manager.itemEnd(e)}function c(d){u(),i&&i(d),r.manager.itemError(e),r.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a}}class lne extends Pd{constructor(e){super(e)}load(e,n,s,i){const r=new es,o=new ane(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(a){r.image=a,r.needsUpdate=!0,n!==void 0&&n(r)},s,i),r}}class b0 extends yn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new ht(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),n}}class cne extends b0{constructor(e,n,s){super(e,s),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(yn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ht(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const lv=new xt,hA=new re,fA=new re;class gx{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Rt(512,512),this.map=null,this.mapPass=null,this.matrix=new xt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new cx,this._frameExtents=new Rt(1,1),this._viewportCount=1,this._viewports=[new Kt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,s=this.matrix;hA.setFromMatrixPosition(e.matrixWorld),n.position.copy(hA),fA.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(fA),n.updateMatrixWorld(),lv.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(lv),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(lv)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class une extends gx{constructor(){super(new Rs(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const n=this.camera,s=Ju*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=e.distance||n.far;(s!==n.fov||i!==n.aspect||r!==n.far)&&(n.fov=s,n.aspect=i,n.far=r,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class dne extends b0{constructor(e,n,s=0,i=Math.PI/3,r=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(yn.DEFAULT_UP),this.updateMatrix(),this.target=new yn,this.distance=s,this.angle=i,this.penumbra=r,this.decay=o,this.map=null,this.shadow=new une}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const pA=new xt,nh=new re,cv=new re;class hne extends gx{constructor(){super(new Rs(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Rt(4,2),this._viewportCount=6,this._viewports=[new Kt(2,1,1,1),new Kt(0,1,1,1),new Kt(3,1,1,1),new Kt(1,1,1,1),new Kt(3,0,1,1),new Kt(1,0,1,1)],this._cubeDirections=[new re(1,0,0),new re(-1,0,0),new re(0,0,1),new re(0,0,-1),new re(0,1,0),new re(0,-1,0)],this._cubeUps=[new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,1,0),new re(0,0,1),new re(0,0,-1)]}updateMatrices(e,n=0){const s=this.camera,i=this.matrix,r=e.distance||s.far;r!==s.far&&(s.far=r,s.updateProjectionMatrix()),nh.setFromMatrixPosition(e.matrixWorld),s.position.copy(nh),cv.copy(s.position),cv.add(this._cubeDirections[n]),s.up.copy(this._cubeUps[n]),s.lookAt(cv),s.updateMatrixWorld(),i.makeTranslation(-nh.x,-nh.y,-nh.z),pA.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse),this._frustum.setFromProjectionMatrix(pA)}}class fne extends b0{constructor(e,n,s=0,i=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=s,this.decay=i,this.shadow=new hne}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class pne extends gx{constructor(){super(new ux(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class b8 extends b0{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(yn.DEFAULT_UP),this.updateMatrix(),this.target=new yn,this.shadow=new pne}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Gh{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let s=0,i=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,s,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Ea.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(c=>{n&&n(c),r.manager.itemEnd(e)}).catch(c=>{i&&i(c)});return}return setTimeout(function(){n&&n(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return Ea.add(e,c),n&&n(c),r.manager.itemEnd(e),c}).catch(function(c){i&&i(c),Ea.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});Ea.add(e,l),r.manager.itemStart(e)}}const _x="\\[\\]\\.:\\/",gne=new RegExp("["+_x+"]","g"),vx="[^"+_x+"]",_ne="[^"+_x.replace("\\.","")+"]",vne=/((?:WC+[\/:])*)/.source.replace("WC",vx),yne=/(WCOD+)?/.source.replace("WCOD",_ne),bne=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",vx),wne=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",vx),xne=new RegExp("^"+vne+yne+bne+wne+"$"),Sne=["material","materials","bones","map"];class Ene{constructor(e,n,s){const i=s||Vt.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const s=this._targetGroup.nCachedObjects_,i=this._bindings[s];i!==void 0&&i.getValue(e,n)}setValue(e,n){const s=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=s.length;i!==r;++i)s[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=e.length;n!==s;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,s=e.length;n!==s;++n)e[n].unbind()}}class Vt{constructor(e,n,s){this.path=n,this.parsedPath=s||Vt.parseTrackName(n),this.node=Vt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,s){return e&&e.isAnimationObjectGroup?new Vt.Composite(e,n,s):new Vt(e,n,s)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(gne,"")}static parseTrackName(e){const n=xne.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const s={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=s.nodeName&&s.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const r=s.nodeName.substring(i+1);Sne.indexOf(r)!==-1&&(s.nodeName=s.nodeName.substring(0,i),s.objectName=r)}if(s.propertyName===null||s.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return s}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const s=e.skeleton.getBoneByName(n);if(s!==void 0)return s}if(e.children){const s=function(r){for(let o=0;o=2.0 are supported."));return}const c=new ise(r,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(o),c.setPlugins(a),c.parse(s,i)}parseAsync(e,n){const s=this;return new Promise(function(i,r){s.parse(e,n,i,r)})}}function Ane(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const At={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Mne{constructor(e){this.parser=e,this.name=At.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let s=0,i=n.length;s=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,r.source,o)}}class Hne{constructor(e){this.parser=e,this.name=At.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class Gne{constructor(e){this.parser=e,this.name=At.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,s=this.parser,i=s.json,r=i.textures[e];if(!r.extensions||!r.extensions[n])return null;const o=r.extensions[n],a=i.images[o.source];let l=s.textureLoader;if(a.uri){const c=s.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return s.loadTextureImage(e,o.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return s.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class zne{constructor(e){this.name=At.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,s=n.bufferViews[e];if(s.extensions&&s.extensions[this.name]){const i=s.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const l=i.byteOffset||0,c=i.byteLength||0,u=i.count,d=i.byteStride,h=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(u,d,h,i.mode,i.filter).then(function(f){return f.buffer}):o.ready.then(function(){const f=new ArrayBuffer(u*d);return o.decodeGltfBuffer(new Uint8Array(f),u,d,h,i.mode,i.filter),f})})}else return null}}class Vne{constructor(e){this.name=At.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,s=n.nodes[e];if(!s.extensions||!s.extensions[this.name]||s.mesh===void 0)return null;const i=n.meshes[s.mesh];for(const c of i.primitives)if(c.mode!==bi.TRIANGLES&&c.mode!==bi.TRIANGLE_STRIP&&c.mode!==bi.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=s.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(u=>(l[c]=u,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const u=c.pop(),d=u.isGroup?u.children:[u],h=c[0].count,f=[];for(const v of d){const _=new xt,m=new re,g=new No,y=new re(1,1,1),b=new Wte(v.geometry,v.material,h);for(let w=0;w0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const sse=new xt;class ise{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Ane,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let s=!1,i=!1,r=-1;typeof navigator<"u"&&(s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,r=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||s||i&&r<98?this.textureLoader=new lne(this.options.manager):this.textureLoader=new mne(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new y8(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const s=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([s.getDependencies("scene"),s.getDependencies("animation"),s.getDependencies("camera")])}).then(function(o){const a={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:s,userData:{}};return fl(r,a,i),pa(a,i),Promise.all(s._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],s=this.json.meshes||[];for(let i=0,r=n.length;i{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,u]of o.children.entries())r(u,a.children[c])};return r(s,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let s=0;s=2&&m.setY(E,x[A*l+1]),l>=3&&m.setZ(E,x[A*l+2]),l>=4&&m.setW(E,x[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const n=this.json,s=this.options,r=n.textures[e].source,o=n.images[r];let a=this.textureLoader;if(o.uri){const l=s.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,n,s){const i=this,r=this.json,o=r.textures[e],a=r.images[n],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(n,s).then(function(u){u.flipY=!1,u.name=o.name||a.name||"",u.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(u.name=a.uri);const h=(r.samplers||{})[o.sampler]||{};return u.magFilter=_A[h.magFilter]||oi,u.minFilter=_A[h.minFilter]||fo,u.wrapS=vA[h.wrapS]||Xu,u.wrapT=vA[h.wrapT]||Xu,i.associations.set(u,{textures:e}),u}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,n){const s=this,i=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=i.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=s.getDependency("bufferView",o.bufferView).then(function(d){c=!0;const h=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(h),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const u=Promise.resolve(l).then(function(d){return new Promise(function(h,f){let v=h;n.isImageBitmapLoader===!0&&(v=function(_){const m=new es(_);m.needsUpdate=!0,h(m)}),n.load(Gh.resolveURL(d,r.path),v,void 0,f)})}).then(function(d){return c===!0&&a.revokeObjectURL(l),d.userData.mimeType=o.mimeType||nse(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=u,u}assignTexture(e,n,s,i){const r=this;return this.getDependency("texture",s.index).then(function(o){if(!o)return null;if(s.texCoord!==void 0&&s.texCoord>0&&(o=o.clone(),o.channel=s.texCoord),r.extensions[At.KHR_TEXTURE_TRANSFORM]){const a=s.extensions!==void 0?s.extensions[At.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=r.associations.get(o);o=r.extensions[At.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),r.associations.set(o,l)}}return i!==void 0&&(o.colorSpace=i),e[n]=o,o})}assignFinalMaterial(e){const n=e.geometry;let s=e.material;const i=n.attributes.tangent===void 0,r=n.attributes.color!==void 0,o=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new g8,Mr.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,l.sizeAttenuation=!1,this.cache.add(a,l)),s=l}else if(e.isLine){const a="LineBasicMaterial:"+s.uuid;let l=this.cache.get(a);l||(l=new m8,Mr.prototype.copy.call(l,s),l.color.copy(s.color),l.map=s.map,this.cache.add(a,l)),s=l}if(i||r||o){let a="ClonedMaterial:"+s.uuid+":";i&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=s.clone(),r&&(l.vertexColors=!0),o&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(s))),s=l}e.material=s}getMaterialType(){return mx}loadMaterial(e){const n=this,s=this.json,i=this.extensions,r=s.materials[e];let o;const a={},l=r.extensions||{},c=[];if(l[At.KHR_MATERIALS_UNLIT]){const d=i[At.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),c.push(d.extendParams(a,r,n))}else{const d=r.pbrMetallicRoughness||{};if(a.color=new ht(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const h=d.baseColorFactor;a.color.setRGB(h[0],h[1],h[2],ss),a.opacity=h[3]}d.baseColorTexture!==void 0&&c.push(n.assignTexture(a,"map",d.baseColorTexture,Ms)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(n.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),c.push(n.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(h){return h.getMaterialType&&h.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(h){return h.extendMaterialParams&&h.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=br);const u=r.alphaMode||dv.OPAQUE;if(u===dv.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,u===dv.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&o!==Sa&&(c.push(n.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new Rt(1,1),r.normalTexture.scale!==void 0)){const d=r.normalTexture.scale;a.normalScale.set(d,d)}if(r.occlusionTexture!==void 0&&o!==Sa&&(c.push(n.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&o!==Sa){const d=r.emissiveFactor;a.emissive=new ht().setRGB(d[0],d[1],d[2],ss)}return r.emissiveTexture!==void 0&&o!==Sa&&c.push(n.assignTexture(a,"emissiveMap",r.emissiveTexture,Ms)),Promise.all(c).then(function(){const d=new o(a);return r.name&&(d.name=r.name),pa(d,r),n.associations.set(d,{materials:e}),r.extensions&&fl(i,d,r),d})}createUniqueName(e){const n=Vt.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,s=this.extensions,i=this.primitiveCache;function r(a){return s[At.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return yA(l,a,n)})}const o=[];for(let a=0,l=e.length;a0&&ese(g,r),g.name=n.createUniqueName(r.name||"mesh_"+e),pa(g,r),m.extensions&&fl(i,g,m),n.assignFinalMaterial(g),d.push(g)}for(let f=0,v=d.length;f1?u=new Hl:c.length===1?u=c[0]:u=new yn,u!==c[0])for(let d=0,h=c.length;d{const d=new Map;for(const[h,f]of i.associations)(h instanceof Mr||h instanceof es)&&d.set(h,f);return u.traverse(h=>{const f=i.associations.get(h);f!=null&&d.set(h,f)}),d};return i.associations=c(r),r})}_createAnimationTracks(e,n,s,i,r){const o=[],a=e.name?e.name:e.uuid,l=[];Xo[r.path]===Xo.weights?e.traverse(function(h){h.morphTargetInfluences&&l.push(h.name?h.name:h.uuid)}):l.push(a);let c;switch(Xo[r.path]){case Xo.weights:c=ed;break;case Xo.rotation:c=oc;break;case Xo.position:case Xo.scale:c=td;break;default:switch(s.itemSize){case 1:c=ed;break;case 2:case 3:default:c=td;break}break}const u=i.interpolation!==void 0?Zne[i.interpolation]:Zu,d=this._getArrayFromAccessor(s);for(let h=0,f=l.length;ht.root.cal_imu())},{default:nt(()=>[me(" calibrate ")]),_:1})]),use])}const S8=lt(ose,[["render",dse]]),hse=it({name:"Home",components:{Motor:Rj,Voltage:Iq,Serial:iY,VTX:lX,GyroModel:S8},setup(){return{profile:Jt()}}}),fse={class:"columns is-multiline"},pse={class:"column is-12"},mse={class:"column is-12"},gse={class:"columns"},_se={class:"column is-6"},vse={class:"column is-6"},yse={class:"columns"},bse={class:"column is-12"};function wse(t,e,n,s,i,r){const o=Oe("GyroModel"),a=Oe("Motor"),l=Oe("Voltage"),c=Oe("Serial"),u=Oe("VTX");return Z(),ie(ot,null,[p("div",fse,[p("div",pse,[Y(o)]),p("div",mse,[Y(a)])]),p("div",gse,[p("div",_se,[Y(l)]),p("div",vse,[Y(c)])]),p("div",yse,[p("div",bse,[t.profile.serial.smart_audio!=0||t.profile.serial.hdzero!=0?(Z(),en(u,{key:0})):ze("",!0)])])],64)}const xse=lt(hse,[["render",wse]]);/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */function np(t){return t+.5|0}const Ta=(t,e,n)=>Math.max(Math.min(t,n),e);function wh(t){return Ta(np(t*2.55),0,255)}function La(t){return Ta(np(t*255),0,255)}function ro(t){return Ta(np(t/2.55)/100,0,1)}function bA(t){return Ta(np(t*100),0,100)}const _i={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},By=[..."0123456789ABCDEF"],Sse=t=>By[t&15],Ese=t=>By[(t&240)>>4]+By[t&15],sm=t=>(t&240)>>4===(t&15),Tse=t=>sm(t.r)&&sm(t.g)&&sm(t.b)&&sm(t.a);function Ase(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&_i[t[1]]*17,g:255&_i[t[2]]*17,b:255&_i[t[3]]*17,a:e===5?_i[t[4]]*17:255}:(e===7||e===9)&&(n={r:_i[t[1]]<<4|_i[t[2]],g:_i[t[3]]<<4|_i[t[4]],b:_i[t[5]]<<4|_i[t[6]],a:e===9?_i[t[7]]<<4|_i[t[8]]:255})),n}const Mse=(t,e)=>t<255?e(t):"";function Rse(t){var e=Tse(t)?Sse:Ese;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Mse(t.a,e):void 0}const kse=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function E8(t,e,n){const s=e*Math.min(n,1-n),i=(r,o=(r+t/30)%12)=>n-s*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function Cse(t,e,n){const s=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[s(5),s(3),s(1)]}function Pse(t,e,n){const s=E8(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)s[i]*=1-e-n,s[i]+=e;return s}function Ose(t,e,n,s,i){return t===i?(e-n)/s+(e.5?u/(2-r-o):u/(r+o),l=Ose(n,s,i,u,r),l=l*60+.5),[l|0,c||0,a]}function bx(t,e,n,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,s)).map(La)}function wx(t,e,n){return bx(E8,t,e,n)}function Ise(t,e,n){return bx(Pse,t,e,n)}function Lse(t,e,n){return bx(Cse,t,e,n)}function T8(t){return(t%360+360)%360}function Dse(t){const e=kse.exec(t);let n=255,s;if(!e)return;e[5]!==s&&(n=e[6]?wh(+e[5]):La(+e[5]));const i=T8(+e[2]),r=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?s=Ise(i,r,o):e[1]==="hsv"?s=Lse(i,r,o):s=wx(i,r,o),{r:s[0],g:s[1],b:s[2],a:n}}function Nse(t,e){var n=yx(t);n[0]=T8(n[0]+e),n=wx(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Fse(t){if(!t)return;const e=yx(t),n=e[0],s=bA(e[1]),i=bA(e[2]);return t.a<255?`hsla(${n}, ${s}%, ${i}%, ${ro(t.a)})`:`hsl(${n}, ${s}%, ${i}%)`}const wA={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"},xA={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 Use(){const t={},e=Object.keys(xA),n=Object.keys(wA);let s,i,r,o,a;for(s=0;s>16&255,r>>8&255,r&255]}return t}let im;function $se(t){im||(im=Use(),im.transparent=[0,0,0,0]);const e=im[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Bse=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Hse(t){const e=Bse.exec(t);let n=255,s,i,r;if(e){if(e[7]!==s){const o=+e[7];n=e[8]?wh(o):Ta(o*255,0,255)}return s=+e[1],i=+e[3],r=+e[5],s=255&(e[2]?wh(s):Ta(s,0,255)),i=255&(e[4]?wh(i):Ta(i,0,255)),r=255&(e[6]?wh(r):Ta(r,0,255)),{r:s,g:i,b:r,a:n}}}function Gse(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ro(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const fv=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Gc=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function zse(t,e,n){const s=Gc(ro(t.r)),i=Gc(ro(t.g)),r=Gc(ro(t.b));return{r:La(fv(s+n*(Gc(ro(e.r))-s))),g:La(fv(i+n*(Gc(ro(e.g))-i))),b:La(fv(r+n*(Gc(ro(e.b))-r))),a:t.a+n*(e.a-t.a)}}function rm(t,e,n){if(t){let s=yx(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*n,e===0?360:1)),s=wx(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function A8(t,e){return t&&Object.assign(e||{},t)}function SA(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=La(t[3]))):(e=A8(t,{r:0,g:0,b:0,a:1}),e.a=La(e.a)),e}function Vse(t){return t.charAt(0)==="r"?Hse(t):Dse(t)}class yf{constructor(e){if(e instanceof yf)return e;const n=typeof e;let s;n==="object"?s=SA(e):n==="string"&&(s=Ase(e)||$se(e)||Vse(e)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var e=A8(this._rgb);return e&&(e.a=ro(e.a)),e}set rgb(e){this._rgb=SA(e)}rgbString(){return this._valid?Gse(this._rgb):void 0}hexString(){return this._valid?Rse(this._rgb):void 0}hslString(){return this._valid?Fse(this._rgb):void 0}mix(e,n){if(e){const s=this.rgb,i=e.rgb;let r;const o=n===r?.5:n,a=2*o-1,l=s.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,s.r=255&c*s.r+r*i.r+.5,s.g=255&c*s.g+r*i.g+.5,s.b=255&c*s.b+r*i.b+.5,s.a=o*s.a+(1-o)*i.a,this.rgb=s}return this}interpolate(e,n){return e&&(this._rgb=zse(this._rgb,e._rgb,n)),this}clone(){return new yf(this.rgb)}alpha(e){return this._rgb.a=La(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=np(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return rm(this._rgb,2,e),this}darken(e){return rm(this._rgb,2,-e),this}saturate(e){return rm(this._rgb,1,e),this}desaturate(e){return rm(this._rgb,1,-e),this}rotate(e){return Nse(this._rgb,e),this}}/*! + * Chart.js v4.4.2 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */function Xr(){}const Wse=(()=>{let t=0;return()=>t++})();function tn(t){return t===null||typeof t>"u"}function En(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ut(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Qn(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Zs(t,e){return Qn(t)?t:e}function Ct(t,e){return typeof t>"u"?e:t}const jse=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Qt(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Wt(t,e,n,s){let i,r,o;if(En(t))for(r=t.length,i=0;it,x:t=>t.x,y:t=>t.y};function Xse(t){const e=t.split("."),n=[];let s="";for(const i of e)s+=i,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function Kse(t){const e=Xse(t);return n=>{for(const s of e){if(s==="")break;n=n&&n[s]}return n}}function Xg(t,e){return(EA[e]||(EA[e]=Kse(e)))(t)}function xx(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Kg=t=>typeof t<"u",Ha=t=>typeof t=="function",TA=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function Zse(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Fn=Math.PI,Ri=2*Fn,Jse=Ri+Fn,Zg=Number.POSITIVE_INFINITY,Qse=Fn/180,li=Fn/2,pl=Fn/4,AA=Fn*2/3,Aa=Math.log10,nd=Math.sign;function Vh(t,e,n){return Math.abs(t-e)i-r).pop(),e}function sd(t){return!isNaN(parseFloat(t))&&isFinite(t)}function tie(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function R8(t,e,n){let s,i,r;for(s=0,i=t.length;sl&&c=Math.min(e,n)-s&&t<=Math.max(e,n)+s}function Ex(t,e,n){n=n||(o=>t[o]1;)r=i+s>>1,n(r)?i=r:s=r;return{lo:i,hi:s}}const Gl=(t,e,n,s)=>Ex(t,n,s?i=>{const r=t[i][e];return rt[i][e]Ex(t,n,s=>t[s][e]>=n);function oie(t,e,n){let s=0,i=t.length;for(;ss&&t[i-1]>n;)i--;return s>0||i{const s="_onData"+xx(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...r){const o=i.apply(this,r);return t._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...r)}),o}})})}function kA(t,e){const n=t._chartjs;if(!n)return;const s=n.listeners,i=s.indexOf(e);i!==-1&&s.splice(i,1),!(s.length>0)&&(C8.forEach(r=>{delete t[r]}),delete t._chartjs)}function lie(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const P8=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function O8(t,e){let n=[],s=!1;return function(...i){n=i,s||(s=!0,P8.call(window,()=>{s=!1,t.apply(e,n)}))}}function cie(t,e){let n;return function(...s){return e?(clearTimeout(n),n=setTimeout(t,e,s)):t.apply(this,s),e}}const Tx=t=>t==="start"?"left":t==="end"?"right":"center",ds=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,uie=(t,e,n,s)=>t===(s?"left":"right")?n:t==="center"?(e+n)/2:e;function I8(t,e,n){const s=e.length;let i=0,r=s;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(i=Ei(Math.min(Gl(a,l,c).lo,n?s:Gl(e,l,o.getPixelForValue(c)).lo),0,s-1)),h?r=Ei(Math.max(Gl(a,o.axis,u,!0).hi+1,n?0:Gl(e,l,o.getPixelForValue(u),!0).hi+1),i,s)-i:r=s-i}return{start:i,count:r}}function L8(t){const{xScale:e,yScale:n,_scaleRanges:s}=t,i={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!s)return t._scaleRanges=i,!0;const r=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==n.min||s.ymax!==n.max;return Object.assign(s,i),r}const om=t=>t===0||t===1,CA=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ri/n)),PA=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ri/n)+1,Wh={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*li)+1,easeOutSine:t=>Math.sin(t*li),easeInOutSine:t=>-.5*(Math.cos(Fn*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>om(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>om(t)?t:CA(t,.075,.3),easeOutElastic:t=>om(t)?t:PA(t,.075,.3),easeInOutElastic(t){return om(t)?t:t<.5?.5*CA(t*2,.1125,.45):.5+.5*PA(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Wh.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Wh.easeInBounce(t*2)*.5:Wh.easeOutBounce(t*2-1)*.5+.5};function Ax(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function OA(t){return Ax(t)?t:new yf(t)}function pv(t){return Ax(t)?t:new yf(t).saturate(.5).darken(.1).hexString()}const die=["x","y","borderWidth","radius","tension"],hie=["color","borderColor","backgroundColor"];function fie(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:hie},numbers:{type:"number",properties:die}}),t.describe("animations",{_fallback:"animation"}),t.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:e=>e|0}}}})}function pie(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const IA=new Map;function mie(t,e){e=e||{};const n=t+JSON.stringify(e);let s=IA.get(n);return s||(s=new Intl.NumberFormat(t,e),IA.set(n,s)),s}function Mx(t,e,n){return mie(e,n).format(t)}const D8={values(t){return En(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const s=this.chart.options.locale;let i,r=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),r=gie(t,n)}const o=Aa(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Mx(t,s,l)},logarithmic(t,e,n){if(t===0)return"0";const s=n[e].significand||t/Math.pow(10,Math.floor(Aa(t)));return[1,2,3,5,10,15].includes(s)||e>.8*n.length?D8.numeric.call(this,t,e,n):""}};function gie(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var w0={formatters:D8};function _ie(t){t.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:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:w0.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const ac=Object.create(null),Gy=Object.create(null);function jh(t,e){if(!e)return t;const n=e.split(".");for(let s=0,i=n.length;ss.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=(s,i)=>pv(i.backgroundColor),this.hoverBorderColor=(s,i)=>pv(i.borderColor),this.hoverColor=(s,i)=>pv(i.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(e),this.apply(n)}set(e,n){return mv(this,e,n)}get(e){return jh(this,e)}describe(e,n){return mv(Gy,e,n)}override(e,n){return mv(ac,e,n)}route(e,n,s,i){const r=jh(this,e),o=jh(this,s),a="_"+n;Object.defineProperties(r,{[a]:{value:r[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[i];return Ut(l)?Object.assign({},c,l):Ct(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var Tn=new vie({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[fie,pie,_ie]);function yie(t){return!t||tn(t.size)||tn(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Jg(t,e,n,s,i){let r=e[i];return r||(r=e[i]=t.measureText(i).width,n.push(i)),r>s&&(s=r),s}function bie(t,e,n,s){s=s||{};let i=s.data=s.data||{},r=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(i=s.data={},r=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let o=0;const a=n.length;let l,c,u,d,h;for(l=0;ln.length){for(l=0;l0&&t.stroke()}}function mo(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&r.strokeColor!=="";let l,c;for(t.save(),t.font=i.string,Sie(t,r),l=0;l+t||0;function F8(t,e){const n={},s=Ut(e),i=s?Object.keys(e):e,r=Ut(t)?s?o=>Ct(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of i)n[o]=kie(r(o));return n}function Cie(t){return F8(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Au(t){return F8(t,["topLeft","topRight","bottomLeft","bottomRight"])}function vs(t){const e=Cie(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Bn(t,e){t=t||{},e=e||Tn.font;let n=Ct(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let s=Ct(t.style,e.style);s&&!(""+s).match(Mie)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const i={family:Ct(t.family,e.family),lineHeight:Rie(Ct(t.lineHeight,e.lineHeight),n),size:n,style:s,weight:Ct(t.weight,e.weight),string:""};return i.string=yie(i),i}function am(t,e,n,s){let i,r,o;for(i=0,r=t.length;in&&a===0?0:a+l;return{min:o(s,-Math.abs(r)),max:o(i,r)}}function Ka(t,e){return Object.assign(Object.create(t),e)}function Cx(t,e=[""],n,s,i=()=>t[0]){const r=n||t;typeof s>"u"&&(s=H8("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:r,_fallback:s,_getTarget:i,override:a=>Cx([a,...t],e,r,s)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return $8(a,l,()=>$ie(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return NA(a).includes(l)},ownKeys(a){return NA(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function id(t,e,n,s){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:U8(t,s),setContext:r=>id(t,r,n,s),override:r=>id(t.override(r),e,n,s)};return new Proxy(i,{deleteProperty(r,o){return delete r[o],delete t[o],!0},get(r,o,a){return $8(r,o,()=>Iie(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(r,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(r,o,a){return t[o]=a,delete r[o],!0}})}function U8(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:s=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:s,isScriptable:Ha(n)?n:()=>n,isIndexable:Ha(s)?s:()=>s}}const Oie=(t,e)=>t?t+xx(e):e,Px=(t,e)=>Ut(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function $8(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=n();return t[e]=s,s}function Iie(t,e,n){const{_proxy:s,_context:i,_subProxy:r,_descriptors:o}=t;let a=s[e];return Ha(a)&&o.isScriptable(e)&&(a=Lie(e,a,t,n)),En(a)&&a.length&&(a=Die(e,a,t,o.isIndexable)),Px(e,a)&&(a=id(a,i,r&&r[e],o)),a}function Lie(t,e,n,s){const{_proxy:i,_context:r,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(r,o||s);return a.delete(t),Px(t,l)&&(l=Ox(i._scopes,i,t,l)),l}function Die(t,e,n,s){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=n;if(typeof r.index<"u"&&s(t))return e[r.index%e.length];if(Ut(e[0])){const l=e,c=i._scopes.filter(u=>u!==l);e=[];for(const u of l){const d=Ox(c,i,t,u);e.push(id(d,r,o&&o[t],a))}}return e}function B8(t,e,n){return Ha(t)?t(e,n):t}const Nie=(t,e)=>t===!0?e:typeof t=="string"?Xg(e,t):void 0;function Fie(t,e,n,s,i){for(const r of e){const o=Nie(n,r);if(o){t.add(o);const a=B8(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==s)return a}else if(o===!1&&typeof s<"u"&&n!==s)return null}return!1}function Ox(t,e,n,s){const i=e._rootScopes,r=B8(e._fallback,n,s),o=[...t,...i],a=new Set;a.add(s);let l=DA(a,o,n,r||n,s);return l===null||typeof r<"u"&&r!==n&&(l=DA(a,o,r,l,s),l===null)?!1:Cx(Array.from(a),[""],i,r,()=>Uie(e,n,s))}function DA(t,e,n,s,i){for(;n;)n=Fie(t,e,n,s,i);return n}function Uie(t,e,n){const s=t._getTarget();e in s||(s[e]={});const i=s[e];return En(i)&&Ut(n)?n:i||{}}function $ie(t,e,n,s){let i;for(const r of e)if(i=H8(Oie(r,t),n),typeof i<"u")return Px(t,i)?Ox(n,s,t,i):i}function H8(t,e){for(const n of e){if(!n)continue;const s=n[t];if(typeof s<"u")return s}}function NA(t){let e=t._keys;return e||(e=t._keys=Bie(t._scopes)),e}function Bie(t){const e=new Set;for(const n of t)for(const s of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(s);return Array.from(e)}const Hie=Number.EPSILON||1e-14,rd=(t,e)=>et==="x"?"y":"x";function Gie(t,e,n,s){const i=t.skip?e:t,r=e,o=n.skip?e:n,a=Hy(r,i),l=Hy(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=s*c,h=s*u;return{previous:{x:r.x-d*(o.x-i.x),y:r.y-d*(o.y-i.y)},next:{x:r.x+h*(o.x-i.x),y:r.y+h*(o.y-i.y)}}}function zie(t,e,n){const s=t.length;let i,r,o,a,l,c=rd(t,0);for(let u=0;u!c.skip)),e.cubicInterpolationMode==="monotone")Wie(t,i);else{let c=s?t[t.length-1]:t[0];for(r=0,o=t.length;rt.ownerDocument.defaultView.getComputedStyle(t,null);function Yie(t,e){return x0(t).getPropertyValue(e)}const Xie=["top","right","bottom","left"];function Ql(t,e,n){const s={};n=n?"-"+n:"";for(let i=0;i<4;i++){const r=Xie[i];s[r]=parseFloat(t[e+"-"+r+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Kie=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function Zie(t,e){const n=t.touches,s=n&&n.length?n[0]:t,{offsetX:i,offsetY:r}=s;let o=!1,a,l;if(Kie(i,r,t.target))a=i,l=r;else{const c=e.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function xl(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:s}=e,i=x0(n),r=i.boxSizing==="border-box",o=Ql(i,"padding"),a=Ql(i,"border","width"),{x:l,y:c,box:u}=Zie(t,n),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:v}=e;return r&&(f-=o.width+a.width,v-=o.height+a.height),{x:Math.round((l-d)/f*n.width/s),y:Math.round((c-h)/v*n.height/s)}}function Jie(t,e,n){let s,i;if(e===void 0||n===void 0){const r=Lx(t);if(!r)e=t.clientWidth,n=t.clientHeight;else{const o=r.getBoundingClientRect(),a=x0(r),l=Ql(a,"border","width"),c=Ql(a,"padding");e=o.width-c.width-l.width,n=o.height-c.height-l.height,s=e_(a.maxWidth,r,"clientWidth"),i=e_(a.maxHeight,r,"clientHeight")}}return{width:e,height:n,maxWidth:s||Zg,maxHeight:i||Zg}}const cm=t=>Math.round(t*10)/10;function Qie(t,e,n,s){const i=x0(t),r=Ql(i,"margin"),o=e_(i.maxWidth,t,"clientWidth")||Zg,a=e_(i.maxHeight,t,"clientHeight")||Zg,l=Jie(t,e,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const h=Ql(i,"border","width"),f=Ql(i,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,s?c/s:u-r.height),c=cm(Math.min(c,o,l.maxWidth)),u=cm(Math.min(u,a,l.maxHeight)),c&&!u&&(u=cm(c/2)),(e!==void 0||n!==void 0)&&s&&l.height&&u>l.height&&(u=l.height,c=cm(Math.floor(u*s))),{width:c,height:u}}function FA(t,e,n){const s=e||1,i=Math.floor(t.height*s),r=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==s||o.height!==i||o.width!==r?(t.currentDevicePixelRatio=s,o.height=i,o.width=r,t.ctx.setTransform(s,0,0,s,0,0),!0):!1}const ere=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Ix()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function UA(t,e){const n=Yie(t,e),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Sl(t,e,n,s){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function tre(t,e,n,s){return{x:t.x+n*(e.x-t.x),y:s==="middle"?n<.5?t.y:e.y:s==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function nre(t,e,n,s){const i={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},o=Sl(t,i,n),a=Sl(i,r,n),l=Sl(r,e,n),c=Sl(o,a,n),u=Sl(a,l,n);return Sl(c,u,n)}const sre=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},ire=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Mu(t,e,n){return t?sre(e,n):ire()}function z8(t,e){let n,s;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=s)}function V8(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function W8(t){return t==="angle"?{between:k8,compare:sie,normalize:qi}:{between:xh,compare:(e,n)=>e-n,normalize:e=>e}}function $A({start:t,end:e,count:n,loop:s,style:i}){return{start:t%n,end:e%n,loop:s&&(e-t+1)%n===0,style:i}}function rre(t,e,n){const{property:s,start:i,end:r}=n,{between:o,normalize:a}=W8(s),l=e.length;let{start:c,end:u,loop:d}=t,h,f;if(d){for(c+=l,u+=l,h=0,f=l;hl(i,b,g)&&a(i,b)!==0,T=()=>a(r,g)===0||l(r,b,g),x=()=>_||w(),A=()=>!_||T();for(let M=u,E=u;M<=d;++M)y=e[M%o],!y.skip&&(g=c(y[s]),g!==b&&(_=l(g,i,r),m===null&&x()&&(m=a(g,i)===0?M:E),m!==null&&A()&&(v.push($A({start:m,end:M,loop:h,count:o,style:f})),m=null),E=M,b=g));return m!==null&&v.push($A({start:m,end:d,loop:h,count:o,style:f})),v}function are(t,e){const n=[],s=t.segments;for(let i=0;ii&&t[r%e].skip;)r--;return r%=e,{start:i,end:r}}function cre(t,e,n,s){const i=t.length,r=[];let o=e,a=t[e],l;for(l=e+1;l<=n;++l){const c=t[l%i];c.skip||c.stop?a.skip||(s=!1,r.push({start:e%i,end:(l-1)%i,loop:s}),e=o=c.stop?l:null):(o=l,a.skip&&(e=l)),a=c}return o!==null&&r.push({start:e%i,end:o%i,loop:s}),r}function ure(t,e){const n=t.points,s=t.options.spanGaps,i=n.length;if(!i)return[];const r=!!t._loop,{start:o,end:a}=lre(n,i,r,s);if(s===!0)return BA(t,[{start:o,end:a,loop:r}],n,e);const l=aa({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(s-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=P8.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((s,i)=>{if(!s.running||!s.items.length)return;const r=s.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(e),a=!0):(r[o]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,s,e,"progress")),r.length||(s.running=!1,this._notify(i,s,e,"complete"),s.initial=!1),n+=r.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let s=n.get(e);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,s)),s}listen(e,n,s){this._getAnims(e).listeners[n].push(s)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,i)=>Math.max(s,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const s=n.items;let i=s.length-1;for(;i>=0;--i)s[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Qr=new fre;const GA="transparent",pre={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const s=OA(t||GA),i=s.valid&&OA(e||GA);return i&&i.valid?i.mix(s,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class mre{constructor(e,n,s,i){const r=n[s];i=am([e.to,i,r,e.from]);const o=am([e.from,r,i]);this._active=!0,this._fn=e.fn||pre[e.type||typeof o],this._easing=Wh[e.easing]||Wh.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=s,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,s){if(this._active){this._notify(!1);const i=this._target[this._prop],r=s-this._start,o=this._duration-r;this._start=s,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=am([e.to,n,i,e.from]),this._from=am([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,s=this._duration,i=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(r,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,s)=>{e.push({res:n,rej:s})})}_notify(e){const n=e?"res":"rej",s=this._promises||[];for(let i=0;i{const r=e[i];if(!Ut(r))return;const o={};for(const a of n)o[a]=r[a];(En(r.properties)&&r.properties||[i]).forEach(a=>{(a===i||!s.has(a))&&s.set(a,o)})})}_animateOptions(e,n){const s=n.options,i=_re(e,s);if(!i)return[];const r=this._createAnimations(i,s);return s.$shared&&gre(e.options.$animations,s).then(()=>{e.options=s},()=>{}),r}_createAnimations(e,n){const s=this._properties,i=[],r=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(e,n));continue}const u=n[c];let d=r[c];const h=s.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){e[c]=u;continue}r[c]=d=new mre(h,e,c,u),i.push(d)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const s=this._createAnimations(e,n);if(s.length)return Qr.add(this._chart,s),!0}}function gre(t,e){const n=[],s=Object.keys(e);for(let i=0;i0||!n&&r<0)return i.index}return null}function qA(t,e){const{chart:n,_cachedMeta:s}=t,i=n._stacks||(n._stacks={}),{iScale:r,vScale:o,index:a}=s,l=r.axis,c=o.axis,u=wre(r,o,s),d=e.length;let h;for(let f=0;fn[s].axis===e).shift()}function Ere(t,e){return Ka(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Tre(t,e,n){return Ka(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function ih(t,e){const n=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const i of e){const r=i._stacks;if(!r||r[s]===void 0||r[s][n]===void 0)return;delete r[s][n],r[s]._visualValues!==void 0&&r[s]._visualValues[n]!==void 0&&delete r[s]._visualValues[n]}}}const _v=t=>t==="reset"||t==="none",YA=(t,e)=>e?t:Object.assign({},t),Are=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:q8(n,!0),values:null};class Ru{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=WA(e.vScale,e),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(e){this.index!==e&&ih(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,s=this.getDataset(),i=(d,h,f,v)=>d==="x"?h:d==="r"?v:f,r=n.xAxisID=Ct(s.xAxisID,gv(e,"x")),o=n.yAxisID=Ct(s.yAxisID,gv(e,"y")),a=n.rAxisID=Ct(s.rAxisID,gv(e,"r")),l=n.indexAxis,c=n.iAxisID=i(l,r,o,a),u=n.vAxisID=i(l,o,r,a);n.xScale=this.getScaleForId(r),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&kA(this._data,this),e._stacked&&ih(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),s=this._data;if(Ut(n))this._data=bre(n);else if(s!==n){if(s){kA(s,this);const i=this._cachedMeta;ih(i),i._parsed=[]}n&&Object.isExtensible(n)&&aie(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,s=this.getDataset();let i=!1;this._dataCheck();const r=n._stacked;n._stacked=WA(n.vScale,n),n.stack!==s.stack&&(i=!0,ih(n),n.stack=s.stack),this._resyncElements(e),(i||r!==n._stacked)&&qA(this,n._parsed)}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),s=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:s,_data:i}=this,{iScale:r,_stacked:o}=s,a=r.axis;let l=e===0&&n===i.length?!0:s._sorted,c=e>0&&s._parsed[e-1],u,d,h;if(this._parsing===!1)s._parsed=i,s._sorted=!0,h=i;else{En(i[e])?h=this.parseArrayData(s,i,e,n):Ut(i[e])?h=this.parseObjectData(s,i,e,n):h=this.parsePrimitiveData(s,i,e,n);const f=()=>d[a]===null||c&&d[a]_||d<_}for(h=0;h=0;--h)if(!v()){this.updateRangeFromParsed(c,e,f,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,s=[];let i,r,o;for(i=0,r=n.length;i=0&&ethis.getContext(s,i,n),_=c.resolveNamedOptions(h,f,v,d);return _.$shared&&(_.$shared=l,r[o]=Object.freeze(YA(_,l))),_}_resolveAnimations(e,n,s){const i=this.chart,r=this._cachedDataOpts,o=`animation-${n}`,a=r[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(e,s,n))}const c=new j8(i,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||_v(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const s=this.resolveDataElementOptions(e,n),i=this._sharedOptions,r=this.getSharedOptions(s),o=this.includeOptions(n,r)||r!==i;return this.updateSharedOptions(r,n,s),{sharedOptions:r,includeOptions:o}}updateElement(e,n,s,i){_v(i)?Object.assign(e,s):this._resolveAnimations(n,i).update(e,s)}updateSharedOptions(e,n,s){e&&!_v(n)&&this._resolveAnimations(void 0,n).update(e,s)}_setStyle(e,n,s,i){e.active=i;const r=this.getStyle(n,i);this._resolveAnimations(n,s,i).update(e,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(e,n,s){this._setStyle(e,s,"active",!1)}setHoverStyle(e,n,s){this._setStyle(e,s,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=s.length,r=n.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,e):r{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(r),a=e;a0&&this.getParsed(n-1);for(let T=0;T=y){A.skip=!0;continue}const M=this.getParsed(T),E=tn(M[f]),S=A[h]=o.getPixelForValue(M[h],T),P=A[f]=r||E?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[f],T);A.skip=isNaN(S)||isNaN(P)||E,A.stop=T>0&&Math.abs(M[h]-w[h])>m,_&&(A.parsed=M,A.raw=c.data[T]),d&&(A.options=u||this.resolveDataElementOptions(T,x.active?"active":i)),g||this.updateElement(x,T,A,i),w=M}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,s=n.options&&n.options.borderWidth||0,i=e.data||[];if(!i.length)return s;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,r,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Te(sg,"id","line"),Te(sg,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Te(sg,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ig extends Ru{getLabelAndValue(e){const n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:r}=n,o=this.getParsed(e),a=i.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:s[e]||"",value:"("+a+", "+l+")"}}update(e){const n=this._cachedMeta,{data:s=[]}=n,i=this.chart._animationsDisabled;let{start:r,count:o}=I8(n,s,i);if(this._drawStart=r,this._drawCount=o,L8(n)&&(r=0,o=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=s;const c=this.resolveDatasetElementOptions(e);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(s,r,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,s,i){const r=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),d=this.getSharedOptions(u),h=this.includeOptions(i,d),f=o.axis,v=a.axis,{spanGaps:_,segment:m}=this.options,g=sd(_)?_:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||i==="none";let b=n>0&&this.getParsed(n-1);for(let w=n;w0&&Math.abs(x[f]-b[f])>g,m&&(A.parsed=x,A.raw=c.data[w]),h&&(A.options=d||this.resolveDataElementOptions(w,T.active?"active":i)),y||this.updateElement(T,w,A,i),b=x}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=e.dataset,i=s.options&&s.options.borderWidth||0;if(!n.length)return i;const r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,o)/2}}Te(ig,"id","scatter"),Te(ig,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Te(ig,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});function gl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Dx{constructor(e){Te(this,"options");this.options=e||{}}static override(e){Object.assign(Dx.prototype,e)}init(){}formats(){return gl()}parse(){return gl()}format(){return gl()}add(){return gl()}diff(){return gl()}startOf(){return gl()}endOf(){return gl()}}var Y8={_date:Dx};function Mre(t,e,n,s){const{controller:i,data:r,_sorted:o}=t,a=i._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&o&&r.length){const l=a._reversePixels?rie:Gl;if(s){if(i._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const d=l(r,e,n-u),h=l(r,e,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,e,n)}return{lo:0,hi:r.length-1}}function sp(t,e,n,s,i){const r=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=r.length;a{l[o](e[n],i)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(e.x,e.y,i))}),s&&!a?[]:r}var Pre={evaluateInteractionItems:sp,modes:{index(t,e,n,s){const i=xl(e,t),r=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?vv(t,i,r,s,o):yv(t,i,r,!1,s,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(t,e,n,s){const i=xl(e,t),r=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?vv(t,i,r,s,o):yv(t,i,r,!1,s,o);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===e)}function KA(t,e){return t.filter(n=>X8.indexOf(n.pos)===-1&&n.box.axis===e)}function oh(t,e){return t.sort((n,s)=>{const i=e?s:n,r=e?n:s;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function Ore(t){const e=[];let n,s,i,r,o,a;for(n=0,s=(t||[]).length;nc.box.fullSize),!0),s=oh(rh(e,"left"),!0),i=oh(rh(e,"right")),r=oh(rh(e,"top"),!0),o=oh(rh(e,"bottom")),a=KA(e,"x"),l=KA(e,"y");return{fullSize:n,leftAndTop:s.concat(r),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:rh(e,"chartArea"),vertical:s.concat(i).concat(l),horizontal:r.concat(o).concat(a)}}function ZA(t,e,n,s){return Math.max(t[n],e[n])+Math.max(t[s],e[s])}function K8(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Nre(t,e,n,s){const{pos:i,box:r}=n,o=t.maxPadding;if(!Ut(i)){n.size&&(t[i]-=n.size);const d=s[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?r.height:r.width),n.size=d.size/d.count,t[i]+=n.size}r.getPadding&&K8(o,r.getPadding());const a=Math.max(0,e.outerWidth-ZA(o,t,"left","right")),l=Math.max(0,e.outerHeight-ZA(o,t,"top","bottom")),c=a!==t.w,u=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Fre(t){const e=t.maxPadding;function n(s){const i=Math.max(e[s]-t[s],0);return t[s]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Ure(t,e){const n=e.maxPadding;function s(i){const r={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{r[o]=Math.max(e[o],n[o])}),r}return s(t?["left","right"]:["top","bottom"])}function Sh(t,e,n,s){const i=[];let r,o,a,l,c,u;for(r=0,o=t.length,c=0;r{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=l.reduce((_,m)=>m.box.options&&m.box.options.display===!1?_:_+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},i);K8(h,vs(s));const f=Object.assign({maxPadding:h,w:r,h:o,x:i.left,y:i.top},i),v=Lre(l.concat(c),d);Sh(a.fullSize,f,d,v),Sh(l,f,d,v),Sh(c,f,d,v)&&Sh(l,f,d,v),Fre(f),JA(a.leftAndTop,f,d,v),f.x+=f.w,f.y+=f.h,JA(a.rightAndBottom,f,d,v),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Wt(a.chartArea,_=>{const m=_.box;Object.assign(m,t.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Z8{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,s){}removeEventListener(e,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,s,i){return n=Math.max(0,n||e.width),s=s||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):s)}}isAttached(e){return!0}updateConfig(e){}}class $re extends Z8{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const rg="$chartjs",Bre={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},QA=t=>t===null||t==="";function Hre(t,e){const n=t.style,s=t.getAttribute("height"),i=t.getAttribute("width");if(t[rg]={initial:{height:s,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",QA(i)){const r=UA(t,"width");r!==void 0&&(t.width=r)}if(QA(s))if(t.style.height==="")t.height=t.width/(e||2);else{const r=UA(t,"height");r!==void 0&&(t.height=r)}return t}const J8=ere?{passive:!0}:!1;function Gre(t,e,n){t&&t.addEventListener(e,n,J8)}function zre(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,J8)}function Vre(t,e){const n=Bre[t.type]||t.type,{x:s,y:i}=xl(t,e);return{type:n,chart:e,native:t,x:s!==void 0?s:null,y:i!==void 0?i:null}}function t_(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Wre(t,e,n){const s=t.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||t_(a.addedNodes,s),o=o&&!t_(a.removedNodes,s);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function jre(t,e,n){const s=t.canvas,i=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||t_(a.removedNodes,s),o=o&&!t_(a.addedNodes,s);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const wf=new Map;let e3=0;function Q8(){const t=window.devicePixelRatio;t!==e3&&(e3=t,wf.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function qre(t,e){wf.size||window.addEventListener("resize",Q8),wf.set(t,e)}function Yre(t){wf.delete(t),wf.size||window.removeEventListener("resize",Q8)}function Xre(t,e,n){const s=t.canvas,i=s&&Lx(s);if(!i)return;const r=O8((a,l)=>{const c=i.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(i),qre(t,r),o}function bv(t,e,n){n&&n.disconnect(),e==="resize"&&Yre(t)}function Kre(t,e,n){const s=t.canvas,i=O8(r=>{t.ctx!==null&&n(Vre(r,t))},t);return Gre(s,e,i),i}class Zre extends Z8{acquireContext(e,n){const s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(Hre(e,n),s):null}releaseContext(e){const n=e.canvas;if(!n[rg])return!1;const s=n[rg].initial;["height","width"].forEach(r=>{const o=s[r];tn(o)?n.removeAttribute(r):n.setAttribute(r,o)});const i=s.style||{};return Object.keys(i).forEach(r=>{n.style[r]=i[r]}),n.width=n.width,delete n[rg],!0}addEventListener(e,n,s){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),o={attach:Wre,detach:jre,resize:Xre}[n]||Kre;i[n]=o(e,n,s)}removeEventListener(e,n){const s=e.$proxies||(e.$proxies={}),i=s[n];if(!i)return;({attach:bv,detach:bv,resize:bv}[n]||zre)(e,n,i),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,s,i){return Qie(e,n,s,i)}isAttached(e){const n=Lx(e);return!!(n&&n.isConnected)}}function Jre(t){return!Ix()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?$re:Zre}var Um;let pc=(Um=class{constructor(){Te(this,"x");Te(this,"y");Te(this,"active",!1);Te(this,"options");Te(this,"$animations")}tooltipPosition(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}hasValue(){return sd(this.x)&&sd(this.y)}getProps(e,n){const s=this.$animations;if(!n||!s)return this;const i={};return e.forEach(r=>{i[r]=s[r]&&s[r].active()?s[r]._to:this[r]}),i}},Te(Um,"defaults",{}),Te(Um,"defaultRoutes"),Um);function Qre(t,e){const n=t.options.ticks,s=eoe(t),i=Math.min(n.maxTicksLimit||s,s),r=n.major.enabled?noe(e):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>i)return soe(e,c,r,o/i),c;const u=toe(r,e,i);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(dm(e,c,u,tn(f)?0:a-f,a),d=0,h=o-1;di)return l}return Math.max(i,1)}function noe(t){const e=[];let n,s;for(n=0,s=t.length;nt==="left"?"right":t==="right"?"left":t,t3=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,n3=(t,e)=>Math.min(e||t,t);function s3(t,e){const n=[],s=t.length/e,i=t.length;let r=0;for(;ro+a)))return l}function aoe(t,e){Wt(t,n=>{const s=n.gc,i=s.length/2;let r;if(i>e){for(r=0;rs?s:n,s=i&&n>s?n:s,{min:Zs(n,Zs(s,n)),max:Zs(s,Zs(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(e,n,s){const{beginAtZero:i,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Pie(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=r||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=Ei(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(e.offset?.5:1)),l=this.maxHeight-ah(e.grid)-n.padding-i3(e.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=Sx(Math.min(Math.asin(Ei((u.highest.height+6)/a,-1,1)),Math.asin(Ei(l/c,-1,1))-Math.asin(Ei(h/c,-1,1)))),o=Math.max(i,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:s,title:i,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=i3(i,n.options.font);if(a?(e.width=this.maxWidth,e.height=ah(r)+l):(e.height=this.maxHeight,e.width=ah(r)+l),s.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=s.padding*2,v=Ma(this.labelRotation),_=Math.cos(v),m=Math.sin(v);if(a){const g=s.mirror?0:m*d.width+_*h.height;e.height=Math.min(this.maxHeight,e.height+g+f)}else{const g=s.mirror?0:_*d.width+m*h.height;e.width=Math.min(this.maxWidth,e.width+g+f)}this._calculatePadding(c,u,m,_)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,s,i){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=i*e.width,f=s*n.height):(h=s*e.height,f=i*n.width):r==="start"?f=n.width:r==="end"?h=e.width:r!=="inner"&&(h=e.width/2,f=n.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=e.height/2;r==="start"?(u=0,d=e.height):r==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_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(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,s;for(n=0,s=e.length;n({width:o[E]||0,height:a[E]||0});return{first:M(0),last:M(n-1),widest:M(x),highest:M(A),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return iie(this._alignToPixels?ml(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&ea*i?a/s:l/i:l*i0}_computeGridLineItems(e){const n=this.axis,s=this.chart,i=this.options,{grid:r,position:o,border:a}=i,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=ah(r),f=[],v=a.setContext(this.getContext()),_=v.display?v.width:0,m=_/2,g=function(G){return ml(s,G,_)};let y,b,w,T,x,A,M,E,S,P,D,k;if(o==="top")y=g(this.bottom),A=this.bottom-h,E=y-m,P=g(e.top)+m,k=e.bottom;else if(o==="bottom")y=g(this.top),P=e.top,k=g(e.bottom)-m,A=y+m,E=this.top+h;else if(o==="left")y=g(this.right),x=this.right-h,M=y-m,S=g(e.left)+m,D=e.right;else if(o==="right")y=g(this.left),S=e.left,D=g(e.right)-m,x=y+m,M=this.left+h;else if(n==="x"){if(o==="center")y=g((e.top+e.bottom)/2+.5);else if(Ut(o)){const G=Object.keys(o)[0],J=o[G];y=g(this.chart.scales[G].getPixelForValue(J))}P=e.top,k=e.bottom,A=y+m,E=A+h}else if(n==="y"){if(o==="center")y=g((e.left+e.right)/2);else if(Ut(o)){const G=Object.keys(o)[0],J=o[G];y=g(this.chart.scales[G].getPixelForValue(J))}x=y-m,M=x-h,S=e.left,D=e.right}const U=Ct(i.ticks.maxTicksLimit,d),z=Math.max(1,Math.ceil(d/U));for(b=0;b0&&(Ce-=oe/2);break}we={left:Ce,top:Ee,width:oe+xe.width,height:Ne+xe.height,color:z.backdropColor}}m.push({label:w,font:E,textOffset:D,options:{rotation:_,color:J,strokeColor:B,strokeWidth:fe,textAlign:se,textBaseline:k,translation:[T,x],backdrop:we}})}return m}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Ma(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:s,mirror:i,padding:r}}=this.options,o=this._getLabelSizes(),a=e+r,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+r,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+r,s==="near"?c="right":s==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,s==="near"?c="left":s==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:s,top:i,width:r,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(s,i,r,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(r=>r.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(s.save(),s.lineWidth=u.width,s.strokeStyle=u.color,s.setLineDash(u.borderDash||[]),s.lineDashOffset=u.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(n.display)for(r=0,o=i.length;r{this.draw(r)}}]:[{z:s,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",i=[];let r,o;for(r=0,o=n.length;r{const s=n.split("."),i=s.pop(),r=[t].concat(s).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");Tn.route(r,i,l,a)})}function poe(t){return"id"in t&&"defaults"in t}class moe{constructor(){this.controllers=new hm(Ru,"datasets",!0),this.elements=new hm(pc,"elements"),this.plugins=new hm(Object,"plugins"),this.scales=new hm(mc,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,s){[...n].forEach(i=>{const r=s||this._getRegistryForType(i);s||r.isForType(i)||r===this.plugins&&i.id?this._exec(e,r,i):Wt(i,o=>{const a=s||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,s){const i=xx(e);Qt(s["before"+i],[],s),n[e](s),Qt(s["after"+i],[],s)}_getRegistryForType(e){for(let n=0;nr.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,s),e,"stop"),this._notify(i(s,n),e,"start")}}function _oe(t){const e={},n=[],s=Object.keys(fr.plugins.items);for(let r=0;r1&&r3(t[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function o3(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Eoe(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(s=>s.xAxisID===t||s.yAxisID===t);if(n.length)return o3(t,"x",n[0])||o3(t,"y",n[0])}return{}}function Toe(t,e){const n=ac[t.type]||{scales:{}},s=e.scales||{},i=Vy(t.type,e),r=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!Ut(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Wy(o,a,Eoe(o,t),Tn.scales[a.type]),c=xoe(l,i),u=n.scales||{};r[o]=zh(Object.create(null),[{axis:l},a,u[l],u[c]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||Vy(a,e),u=(ac[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=woe(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),zh(r[f],[{axis:h},s[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];zh(a,[Tn.scales[a.type],Tn.scale])}),r}function eP(t){const e=t.options||(t.options={});e.plugins=Ct(e.plugins,{}),e.scales=Toe(t,e)}function tP(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Aoe(t){return t=t||{},t.data=tP(t.data),eP(t),t}const a3=new Map,nP=new Set;function fm(t,e){let n=a3.get(t);return n||(n=e(),a3.set(t,n),nP.add(n)),n}const lh=(t,e,n)=>{const s=Xg(e,n);s!==void 0&&t.add(s)};let Moe=class{constructor(e){this._config=Aoe(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=tP(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),eP(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return fm(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return fm(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return fm(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,s=this.type;return fm(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const s=this._scopeCache;let i=s.get(e);return(!i||n)&&(i=new Map,s.set(e,i)),i}getOptionScopes(e,n,s){const{options:i,type:r}=this,o=this._cachedScopes(e,s),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{e&&(l.add(e),u.forEach(d=>lh(l,e,d))),u.forEach(d=>lh(l,i,d)),u.forEach(d=>lh(l,ac[r]||{},d)),u.forEach(d=>lh(l,Tn,d)),u.forEach(d=>lh(l,Gy,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),nP.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,ac[n]||{},Tn.datasets[n]||{},{type:n},Tn,Gy]}resolveNamedOptions(e,n,s,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=l3(this._resolverCache,e,i);let l=o;if(koe(o,n)){r.$shared=!1,s=Ha(s)?s():s;const c=this.createResolver(e,s,a);l=id(o,s,c)}for(const c of n)r[c]=l[c];return r}createResolver(e,n,s=[""],i){const{resolver:r}=l3(this._resolverCache,e,s);return Ut(n)?id(r,n,void 0,i):r}};function l3(t,e,n){let s=t.get(e);s||(s=new Map,t.set(e,s));const i=n.join();let r=s.get(i);return r||(r={resolver:Cx(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(i,r)),r}const Roe=t=>Ut(t)&&Object.getOwnPropertyNames(t).some(e=>Ha(t[e]));function koe(t,e){const{isScriptable:n,isIndexable:s}=U8(t);for(const i of e){const r=n(i),o=s(i),a=(o||r)&&t[i];if(r&&(Ha(a)||Roe(a))||o&&En(a))return!0}return!1}var Coe="4.4.2";const Poe=["top","bottom","left","right","chartArea"];function c3(t,e){return t==="top"||t==="bottom"||Poe.indexOf(t)===-1&&e==="x"}function u3(t,e){return function(n,s){return n[t]===s[t]?n[e]-s[e]:n[t]-s[t]}}function d3(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Qt(n&&n.onComplete,[t],e)}function Ooe(t){const e=t.chart,n=e.options.animation;Qt(n&&n.onProgress,[t],e)}function sP(t){return Ix()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const og={},h3=t=>{const e=sP(t);return Object.values(og).filter(n=>n.canvas===e).pop()};function Ioe(t,e,n){const s=Object.keys(t);for(const i of s){const r=+i;if(r>=e){const o=t[i];delete t[i],(n>0||r>e)&&(t[r+n]=o)}}}function Loe(t,e,n,s){return!n||t.type==="mouseout"?null:s?e:t}function pm(t,e,n){return t.options.clip?t[n]:e[n]}function Doe(t,e){const{xScale:n,yScale:s}=t;return n&&s?{left:pm(n,e,"left"),right:pm(n,e,"right"),top:pm(s,e,"top"),bottom:pm(s,e,"bottom")}:e}var ea;let S0=(ea=class{static register(...e){fr.add(...e),f3()}static unregister(...e){fr.remove(...e),f3()}constructor(e,n){const s=this.config=new Moe(n),i=sP(e),r=h3(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Jre(i)),this.platform.updateConfig(s);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Wse(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,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 goe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=cie(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],og[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Qr.listen(this,"complete",d3),Qr.listen(this,"progress",Ooe),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:s,height:i,_aspectRatio:r}=this;return tn(e)?n&&r?r:i?s/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return fr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():FA(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return LA(this.canvas,this.ctx),this}stop(){return Qr.stop(this),this}resize(e,n){Qr.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const s=this.options,i=this.canvas,r=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,e,n,r),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,FA(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Qt(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Wt(n,(s,i)=>{s.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,s=this.scales,i=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{});let r=[];n&&(r=r.concat(Object.keys(n).map(o=>{const a=n[o],l=Wy(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Wt(r,o=>{const a=o.options,l=a.id,c=Wy(l,a),u=Ct(a.type,o.dtype);(a.position===void 0||c3(a.position,c)!==c3(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in s&&s[l].type===u)d=s[l];else{const h=fr.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,e)}),Wt(i,(o,a)=>{o||delete s[a]}),Wt(s,o=>{Ti.configure(this,o,o.options),Ti.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,s=e.length;if(e.sort((i,r)=>i.index-r.index),s>n){for(let i=n;in.length&&delete this._stacks,e.forEach((s,i)=>{n.filter(r=>r===s._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let s,i;for(this._removeUnreferencedMetasets(),s=0,i=n.length;s{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(u3("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Wt(this.scales,e=>{Ti.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(e.events);(!TA(n,s)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:s,start:i,count:r}of n){const o=s==="_removeElements"?-r:r;Ioe(e,i,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,s=r=>new Set(e.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),i=s(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ti.update(this,this.width,this.height,e);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],Wt(this.boxes,i=>{s&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,r)=>{i._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,s=e._clip,i=!s.disabled,r=Doe(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(i&&Rx(n,{left:s.left===!1?0:r.left-s.left,right:s.right===!1?this.width:r.right+s.right,top:s.top===!1?0:r.top-s.top,bottom:s.bottom===!1?this.height:r.bottom+s.bottom}),e.controller.draw(),i&&kx(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return mo(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,s,i){const r=Pre.modes[n];return typeof r=="function"?r(this,e,s,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],s=this._metasets;let i=s.filter(r=>r&&r._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},s.push(i)),i}getContext(){return this.$context||(this.$context=Ka(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const s=this.getDatasetMeta(e);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(e,n){const s=this.getDatasetMeta(e);s.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,s){const i=s?"show":"hide",r=this.getDatasetMeta(e),o=r.controller._resolveAnimations(void 0,i);Kg(n)?(r.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(e,s),o.update(r,{visible:s}),this.update(a=>a.datasetIndex===e?i:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Qr.remove(this),e=0,n=this.data.datasets.length;e{n.addEventListener(this,r,o),e[r]=o},i=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};Wt(this.options.events,r=>s(r,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,s=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},i=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),s("resize",r),s("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),s("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Wt(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Wt(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,s){const i=s?"set":"remove";let r,o,a,l;for(n==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=e.length;a{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!qg(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(e,n,s){return this._plugins.notify(this,e,n,s)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,s){const i=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(n,e),a=s?e:r(e,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(e,n){const s={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",s,i)===!1)return;const r=this._handleEvent(e,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,i),(r||s.changed)&&this.render(),this}_handleEvent(e,n,s){const{_active:i=[],options:r}=this,o=n,a=this._getActiveElements(e,i,s,o),l=Zse(e),c=Loe(e,this._lastEvent,s,l);s&&(this._lastEvent=null,Qt(r.onHover,[e,a,this],this),l&&Qt(r.onClick,[e,a,this],this));const u=!qg(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(e,n,s,i){if(e.type==="mouseout")return[];if(!s)return n;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,i)}},Te(ea,"defaults",Tn),Te(ea,"instances",og),Te(ea,"overrides",ac),Te(ea,"registry",fr),Te(ea,"version",Coe),Te(ea,"getChart",h3),ea);function f3(){return Wt(S0.instances,t=>t._plugins.invalidate())}function iP(t,e,n=e){t.lineCap=Ct(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Ct(n.borderDash,e.borderDash)),t.lineDashOffset=Ct(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Ct(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Ct(n.borderWidth,e.borderWidth),t.strokeStyle=Ct(n.borderColor,e.borderColor)}function Noe(t,e,n){t.lineTo(n.x,n.y)}function Foe(t){return t.stepped?wie:t.tension||t.cubicInterpolationMode==="monotone"?xie:Noe}function rP(t,e,n={}){const s=t.length,{start:i=0,end:r=s-1}=n,{start:o,end:a}=e,l=Math.max(i,o),c=Math.min(r,a),u=ia&&r>a;return{count:s,start:l,loop:e.loop,ilen:c(o+(c?a-w:w))%r,b=()=>{_!==m&&(t.lineTo(u,m),t.lineTo(u,_),t.lineTo(u,g))};for(l&&(f=i[y(0)],t.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=i[y(h)],f.skip)continue;const w=f.x,T=f.y,x=w|0;x===v?(T<_?_=T:T>m&&(m=T),u=(d*u+w)/++d):(b(),t.lineTo(w,T),v=x,d=0,_=m=T),g=T}b()}function jy(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?$oe:Uoe}function Boe(t){return t.stepped?tre:t.tension||t.cubicInterpolationMode==="monotone"?nre:Sl}function Hoe(t,e,n,s){let i=e._path;i||(i=e._path=new Path2D,e.path(i,n,s)&&i.closePath()),iP(t,e.options),t.stroke(i)}function Goe(t,e,n,s){const{segments:i,options:r}=e,o=jy(e);for(const a of i)iP(t,r,a.style),t.beginPath(),o(t,e,a,{start:n,end:n+s-1})&&t.closePath(),t.stroke()}const zoe=typeof Path2D=="function";function Voe(t,e,n,s){zoe&&!e.options.segment?Hoe(t,e,n,s):Goe(t,e,n,s)}class Eh extends pc{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const i=s.spanGaps?this._loop:this._fullLoop;qie(this._points,s,e,i,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ure(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,s=e.length;return s&&n[e[s-1].end]}interpolate(e,n){const s=this.options,i=e[n],r=this.points,o=are(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=Boe(s);let c,u;for(c=0,u=o.length;ce!=="borderDash"&&e!=="fill"});function p3(t,e,n,s){const i=t.options,{[n]:r}=t.getProps([n],s);return Math.abs(e-r){let{boxHeight:n=e,boxWidth:s=e}=t;return t.usePointStyle&&(n=Math.min(n,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:n,itemHeight:Math.max(e,n)}},Woe=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class g3 extends pc{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,s){this.maxWidth=e,this.maxHeight=n,this._margins=s,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 e=this.options.labels||{};let n=Qt(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(s=>e.filter(s,this.chart.data))),e.sort&&(n=n.sort((s,i)=>e.sort(s,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const s=e.labels,i=Bn(s.font),r=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=m3(s,r);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,s,i){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=e;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((v,_)=>{const m=s+n/2+r.measureText(v.text).width;(_===0||c[c.length-1]+m+2*a>o)&&(d+=u,c[c.length-(_>0?0:1)]=0,f+=u,h++),l[_]={left:0,top:f,row:h,width:m,height:i},c[c.length-1]+=m+a}),d}_fitCols(e,n,s,i){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-e;let d=a,h=0,f=0,v=0,_=0;return this.legendItems.forEach((m,g)=>{const{itemWidth:y,itemHeight:b}=joe(s,n,r,m,i);g>0&&f+b+2*a>u&&(d+=h+a,c.push({width:h,height:f}),v+=h+a,_++,h=f=0),l[g]={left:v,top:f,col:_,width:y,height:b},h=Math.max(h,y),f+=b+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:s,labels:{padding:i},rtl:r}}=this,o=Mu(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ds(s,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=ds(s,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+e+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=ds(s,this.top+e+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=ds(s,this.top+e+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Rx(e,this),this._draw(),kx(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:s,ctx:i}=this,{align:r,labels:o}=e,a=Tn.color,l=Mu(e.rtl,this.left,this.width),c=Bn(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:_,itemHeight:m}=m3(o,d),g=function(x,A,M){if(isNaN(v)||v<=0||isNaN(_)||_<0)return;i.save();const E=Ct(M.lineWidth,1);if(i.fillStyle=Ct(M.fillStyle,a),i.lineCap=Ct(M.lineCap,"butt"),i.lineDashOffset=Ct(M.lineDashOffset,0),i.lineJoin=Ct(M.lineJoin,"miter"),i.lineWidth=E,i.strokeStyle=Ct(M.strokeStyle,a),i.setLineDash(Ct(M.lineDash,[])),o.usePointStyle){const S={radius:_*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:E},P=l.xPlus(x,v/2),D=A+h;N8(i,S,P,D,o.pointStyleWidth&&v)}else{const S=A+Math.max((d-_)/2,0),P=l.leftForLtr(x,v),D=Au(M.borderRadius);i.beginPath(),Object.values(D).some(k=>k!==0)?Qg(i,{x:P,y:S,w:v,h:_,radius:D}):i.rect(P,S,v,_),i.fill(),E!==0&&i.stroke()}i.restore()},y=function(x,A,M){lc(i,M.text,x,A+m/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},b=this.isHorizontal(),w=this._computeTitleHeight();b?f={x:ds(r,this.left+u,this.right-s[0]),y:this.top+u+w,line:0}:f={x:this.left+u,y:ds(r,this.top+w+u,this.bottom-n[0].height),line:0},z8(this.ctx,e.textDirection);const T=m+u;this.legendItems.forEach((x,A)=>{i.strokeStyle=x.fontColor,i.fillStyle=x.fontColor;const M=i.measureText(x.text).width,E=l.textAlign(x.textAlign||(x.textAlign=o.textAlign)),S=v+h+M;let P=f.x,D=f.y;l.setWidth(this.width),b?A>0&&P+S+u>this.right&&(D=f.y+=T,f.line++,P=f.x=ds(r,this.left+u,this.right-s[f.line])):A>0&&D+T>this.bottom&&(P=f.x=P+n[f.line].width+u,f.line++,D=f.y=ds(r,this.top+w+u,this.bottom-n[f.line].height));const k=l.x(P);if(g(k,D,x),P=uie(E,P+v+h,b?P+S:this.right,e.rtl),y(l.x(P),D,x),b)f.x+=S+u;else if(typeof x.text!="string"){const U=c.lineHeight;f.y+=oP(x,U)+u}else f.y+=T}),V8(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,s=Bn(n.font),i=vs(n.padding);if(!n.display)return;const r=Mu(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=s.size/2,c=i.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=ds(e.align,d,this.right-h);else{const v=this.columnSizes.reduce((_,m)=>Math.max(_,m.height),0);u=c+ds(e.align,this.top,this.bottom-v-e.labels.padding-this._computeTitleHeight())}const f=ds(a,d,d+h);o.textAlign=r.textAlign(Tx(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=s.string,lc(o,n.text,f,u,s)}_computeTitleHeight(){const e=this.options.title,n=Bn(e.font),s=vs(e.padding);return e.display?n.lineHeight+s.height:0}_getLegendItemAt(e,n){let s,i,r;if(xh(e,this.left,this.right)&&xh(n,this.top,this.bottom)){for(r=this.legendHitBoxes,s=0;sr.length>o.length?r:o)),e+n.size/2+s.measureText(i).width}function Yoe(t,e,n){let s=t;return typeof e.text!="string"&&(s=oP(e,n)),s}function oP(t,e){const n=t.text?t.text.length:0;return e*n}function Xoe(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Koe={id:"legend",_element:g3,start(t,e,n){const s=t.legend=new g3({ctx:t.ctx,options:n,chart:t});Ti.configure(t,s,n),Ti.addBox(t,s)},stop(t){Ti.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const s=t.legend;Ti.configure(t,s,n),s.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const s=e.datasetIndex,i=n.chart;i.isDatasetVisible(s)?(i.hide(s),e.hidden=!0):(i.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:i,color:r,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=vs(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class aP extends pc{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=En(s.text)?s.text.length:1;this._padding=vs(s.padding);const r=i*Bn(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:s,bottom:i,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=ds(a,s,r),d=n+e,c=r-s):(o.position==="left"?(u=s+e,d=ds(a,i,n),l=Fn*-.5):(u=r-e,d=ds(a,n,i),l=Fn*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const s=Bn(n.font),r=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);lc(e,n.text,0,0,s,{color:n.color,maxWidth:l,rotation:c,textAlign:Tx(n.align),textBaseline:"middle",translation:[o,a]})}}function Zoe(t,e){const n=new aP({ctx:t.ctx,options:e,chart:t});Ti.configure(t,n,e),Ti.addBox(t,n),t.titleBlock=n}var Joe={id:"title",_element:aP,start(t,e,n){Zoe(t,n)},stop(t){const e=t.titleBlock;Ti.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const s=t.titleBlock;Ti.configure(t,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Th={average(t){if(!t.length)return!1;let e,n,s=new Set,i=0,r=0;for(e=0,n=t.length;ea+l)/s.size,y:i/r}},nearest(t,e){if(!t.length)return!1;let n=e.x,s=e.y,i=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=t.length;r-1?t.split(` +`):t}function Qoe(t,e){const{element:n,datasetIndex:s,index:i}=e,r=t.getDatasetMeta(s).controller,{label:o,value:a}=r.getLabelAndValue(i);return{chart:t,label:o,parsed:r.getParsed(i),raw:t.data.datasets[s].data[i],formattedValue:a,dataset:r.getDataset(),dataIndex:i,datasetIndex:s,element:n}}function _3(t,e){const n=t.chart.ctx,{body:s,footer:i,title:r}=t,{boxWidth:o,boxHeight:a}=e,l=Bn(e.bodyFont),c=Bn(e.titleFont),u=Bn(e.footerFont),d=r.length,h=i.length,f=s.length,v=vs(e.padding);let _=v.height,m=0,g=s.reduce((w,T)=>w+T.before.length+T.lines.length+T.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,d&&(_+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),g){const w=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;_+=f*w+(g-f)*l.lineHeight+(g-1)*e.bodySpacing}h&&(_+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let y=0;const b=function(w){m=Math.max(m,n.measureText(w).width+y)};return n.save(),n.font=c.string,Wt(t.title,b),n.font=l.string,Wt(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?o+2+e.boxPadding:0,Wt(s,w=>{Wt(w.before,b),Wt(w.lines,b),Wt(w.after,b)}),y=0,n.font=u.string,Wt(t.footer,b),n.restore(),m+=v.width,{width:m,height:_}}function eae(t,e){const{y:n,height:s}=e;return nt.height-s/2?"bottom":"center"}function tae(t,e,n,s){const{x:i,width:r}=s,o=n.caretSize+n.caretPadding;if(t==="left"&&i+r+o>e.width||t==="right"&&i-r-o<0)return!0}function nae(t,e,n,s){const{x:i,width:r}=n,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return s==="center"?c=i<=(a+l)/2?"left":"right":i<=r/2?c="left":i>=o-r/2&&(c="right"),tae(c,t,e,n)&&(c="center"),c}function v3(t,e,n){const s=n.yAlign||e.yAlign||eae(t,n);return{xAlign:n.xAlign||e.xAlign||nae(t,e,n,s),yAlign:s}}function sae(t,e){let{x:n,width:s}=t;return e==="right"?n-=s:e==="center"&&(n-=s/2),n}function iae(t,e,n){let{y:s,height:i}=t;return e==="top"?s+=n:e==="bottom"?s-=i+n:s-=i/2,s}function y3(t,e,n,s){const{caretSize:i,caretPadding:r,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,c=i+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Au(o);let v=sae(e,a);const _=iae(e,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(u,h)+i:a==="right"&&(v+=Math.max(d,f)+i),{x:Ei(v,0,s.width-e.width),y:Ei(_,0,s.height-e.height)}}function mm(t,e,n){const s=vs(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-s.right:t.x+s.left}function b3(t){return hr([],eo(t))}function rae(t,e,n){return Ka(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function w3(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const lP={beforeTitle:Xr,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,s=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex"u"?lP[e].call(n,s):i}var qv;let x3=(qv=class extends pc{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,s=this.options.setContext(this.getContext()),i=s.enabled&&n.options.animation&&s.animations,r=new j8(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=rae(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:s}=n,i=Is(s,"beforeTitle",this,e),r=Is(s,"title",this,e),o=Is(s,"afterTitle",this,e);let a=[];return a=hr(a,eo(i)),a=hr(a,eo(r)),a=hr(a,eo(o)),a}getBeforeBody(e,n){return b3(Is(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:s}=n,i=[];return Wt(e,r=>{const o={before:[],lines:[],after:[]},a=w3(s,r);hr(o.before,eo(Is(a,"beforeLabel",this,r))),hr(o.lines,Is(a,"label",this,r)),hr(o.after,eo(Is(a,"afterLabel",this,r))),i.push(o)}),i}getAfterBody(e,n){return b3(Is(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:s}=n,i=Is(s,"beforeFooter",this,e),r=Is(s,"footer",this,e),o=Is(s,"afterFooter",this,e);let a=[];return a=hr(a,eo(i)),a=hr(a,eo(r)),a=hr(a,eo(o)),a}_createItems(e){const n=this._active,s=this.chart.data,i=[],r=[],o=[];let a=[],l,c;for(l=0,c=n.length;le.filter(u,d,h,s))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,s))),Wt(a,u=>{const d=w3(e.callbacks,u);i.push(Is(d,"labelColor",this,u)),r.push(Is(d,"labelPointStyle",this,u)),o.push(Is(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const s=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(!i.length)this.opacity!==0&&(r={opacity:0});else{const a=Th[s.position].call(this,i,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);const l=this._size=_3(this,s),c=Object.assign({},a,l),u=v3(this.chart,s,c),d=y3(s,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,s,i){const r=this.getCaretPosition(e,s,i);n.lineTo(r.x1,r.y1),n.lineTo(r.x2,r.y2),n.lineTo(r.x3,r.y3)}getCaretPosition(e,n,s){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Au(a),{x:h,y:f}=e,{width:v,height:_}=n;let m,g,y,b,w,T;return r==="center"?(w=f+_/2,i==="left"?(m=h,g=m-o,b=w+o,T=w-o):(m=h+v,g=m+o,b=w-o,T=w+o),y=m):(i==="left"?g=h+Math.max(l,u)+o:i==="right"?g=h+v-Math.max(c,d)-o:g=this.caretX,r==="top"?(b=f,w=b-o,m=g-o,y=g+o):(b=f+_,w=b+o,m=g+o,y=g-o),T=b),{x1:m,x2:g,x3:y,y1:b,y2:w,y3:T}}drawTitle(e,n,s){const i=this.title,r=i.length;let o,a,l;if(r){const c=Mu(s.rtl,this.x,this.width);for(e.x=mm(this,s.titleAlign,s),n.textAlign=c.textAlign(s.titleAlign),n.textBaseline="middle",o=Bn(s.titleFont),a=s.titleSpacing,n.fillStyle=s.titleColor,n.font=o.string,l=0;ly!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,Qg(e,{x:_,y:v,w:c,h:l,radius:g}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Qg(e,{x:m,y:v+1,w:c-2,h:l-2,radius:g}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(_,v,c,l),e.strokeRect(_,v,c,l),e.fillStyle=o.backgroundColor,e.fillRect(m,v+1,c-2,l-2))}e.fillStyle=this.labelTextColors[s]}drawBody(e,n,s){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=s,d=Bn(s.bodyFont);let h=d.lineHeight,f=0;const v=Mu(s.rtl,this.x,this.width),_=function(M){n.fillText(M,v.x(e.x+f),e.y+h/2),e.y+=h+r},m=v.textAlign(o);let g,y,b,w,T,x,A;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,e.x=mm(this,m,s),n.fillStyle=s.bodyColor,Wt(this.beforeBody,_),f=a&&m!=="right"?o==="center"?c/2+u:c+2+u:0,w=0,x=i.length;w0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,s=this.$animations,i=s&&s.x,r=s&&s.y;if(i||r){const o=Th[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=_3(this,e),l=Object.assign({},o,this._size),c=v3(n,e,l),u=y3(e,l,c,n);(i._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=vs(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=s,this.drawBackground(r,e,i,n),z8(e,n.textDirection),r.y+=o.top,this.drawTitle(r,e,n),this.drawBody(r,e,n),this.drawFooter(r,e,n),V8(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const s=this._active,i=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!qg(s,i),o=this._positionChanged(i,n);(r||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],o=this._getActiveElements(e,r,n,s),a=this._positionChanged(o,e),l=n||!qg(o,r)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,s,i){const r=this.options;if(e.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,r.mode,r,s);return r.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:s,caretY:i,options:r}=this,o=Th[r.position].call(this,e,n);return o!==!1&&(s!==o.x||i!==o.y)}},Te(qv,"positioners",Th),qv);var oae={id:"tooltip",_element:x3,positioners:Th,afterInit(t,e,n){n&&(t.tooltip=new x3({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:lP},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const aae=(t,e,n,s)=>(typeof e=="string"?(n=t.push(e)-1,s.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function lae(t,e,n,s){const i=t.indexOf(e);if(i===-1)return aae(t,e,n,s);const r=t.lastIndexOf(e);return i!==r?n:i}const cae=(t,e)=>t===null?null:Ei(Math.round(t),0,e);function S3(t){const e=this.getLabels();return t>=0&&tn.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Te(qy,"id","category"),Te(qy,"defaults",{ticks:{callback:S3}});function uae(t,e){const n=[],{bounds:i,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=t,f=r||1,v=u-1,{min:_,max:m}=e,g=!tn(o),y=!tn(a),b=!tn(c),w=(m-_)/(d+1);let T=MA((m-_)/v/f)*f,x,A,M,E;if(T<1e-14&&!g&&!y)return[{value:_},{value:m}];E=Math.ceil(m/T)-Math.floor(_/T),E>v&&(T=MA(E*T/v/f)*f),tn(l)||(x=Math.pow(10,l),T=Math.ceil(T*x)/x),i==="ticks"?(A=Math.floor(_/T)*T,M=Math.ceil(m/T)*T):(A=_,M=m),g&&y&&r&&tie((a-o)/r,T/1e3)?(E=Math.round(Math.min((a-o)/T,u)),T=(a-o)/E,A=o,M=a):b?(A=g?o:A,M=y?a:M,E=c-1,T=(M-A)/E):(E=(M-A)/T,Vh(E,Math.round(E),T/1e3)?E=Math.round(E):E=Math.ceil(E));const S=Math.max(RA(T),RA(A));x=Math.pow(10,tn(l)?S:l),A=Math.round(A*x)/x,M=Math.round(M*x)/x;let P=0;for(g&&(h&&A!==o?(n.push({value:o}),Aa)break;n.push({value:D})}return y&&h&&M!==a?n.length&&Vh(n[n.length-1].value,a,E3(a,w,t))?n[n.length-1].value=a:n.push({value:a}):(!y||M===a)&&n.push({value:M}),n}function E3(t,e,{horizontal:n,minRotation:s}){const i=Ma(s),r=(n?Math.sin(i):Math.cos(i))||.001,o=.75*e*(""+t).length;return Math.min(e/r,o)}class n_ extends mc{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return tn(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds();let{min:i,max:r}=this;const o=l=>i=n?i:l,a=l=>r=s?r:l;if(e){const l=nd(i),c=nd(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===r){let l=r===0?1:Math.abs(r*.05);a(r+l),e||o(i-l)}this.min=i,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:s}=e,i;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let s=this.getTickLimit();s=Math.max(2,s);const i={maxTicks:s,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},r=this._range||this,o=uae(i,r);return e.bounds==="ticks"&&R8(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,s=this.max;if(super.configure(),this.options.offset&&e.length){const i=(s-n)/Math.max(e.length-1,1)/2;n-=i,s+=i}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(e){return Mx(e,this.chart.options.locale,this.options.ticks.format)}}class Yy extends n_{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Qn(e)?e:0,this.max=Qn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,s=Ma(this.options.ticks.minRotation),i=(e?Math.sin(s):Math.cos(s))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,r.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Te(Yy,"id","linear"),Te(Yy,"defaults",{ticks:{callback:w0.formatters.numeric}});const xf=t=>Math.floor(Aa(t)),_l=(t,e)=>Math.pow(10,xf(t)+e);function T3(t){return t/Math.pow(10,xf(t))===1}function A3(t,e,n){const s=Math.pow(10,n),i=Math.floor(t/s);return Math.ceil(e/s)-i}function dae(t,e){const n=e-t;let s=xf(n);for(;A3(t,e,s)>10;)s++;for(;A3(t,e,s)<10;)s--;return Math.min(s,xf(t))}function hae(t,{min:e,max:n}){e=Zs(t.min,e);const s=[],i=xf(e);let r=dae(e,n),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=i>r?Math.pow(10,i):0,c=Math.round((e-l)*o)/o,u=Math.floor((e-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=Zs(t.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=Zs(t.max,h);return s.push({value:f,major:T3(f),significand:d}),s}class M3 extends mc{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const s=n_.prototype.parse.apply(this,[e,n]);if(s===0){this._zero=!0;return}return Qn(s)&&s>0?s:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Qn(e)?Math.max(0,e):null,this.max=Qn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Qn(this._userMin)&&(this.min=e===_l(this.min,0)?_l(this.min,-1):_l(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let s=this.min,i=this.max;const r=a=>s=e?s:a,o=a=>i=n?i:a;s===i&&(s<=0?(r(1),o(10)):(r(_l(s,-1)),o(_l(i,1)))),s<=0&&r(_l(i,-1)),i<=0&&o(_l(s,1)),this.min=s,this.max=i}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},s=hae(n,this);return e.bounds==="ticks"&&R8(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(e){return e===void 0?"0":Mx(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Aa(e),this._valueRange=Aa(this.max)-Aa(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Aa(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}Te(M3,"id","logarithmic"),Te(M3,"defaults",{ticks:{callback:w0.formatters.logarithmic,major:{enabled:!0}}});function Xy(t){const e=t.ticks;if(e.display&&t.display){const n=vs(e.backdropPadding);return Ct(e.font&&e.font.size,Tn.font.size)+n.height}return 0}function fae(t,e,n){return n=En(n)?n:[n],{w:bie(t,e.string,n),h:n.length*e.lineHeight}}function R3(t,e,n,s,i){return t===s||t===i?{start:e-n/2,end:e+n/2}:ti?{start:e-n,end:e}:{start:e,end:e+n}}function pae(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),s=[],i=[],r=t._pointLabels.length,o=t.options.pointLabels,a=o.centerPointLabels?Fn/r:0;for(let l=0;le.r&&(a=(s.end-e.r)/r,t.r=Math.max(t.r,e.r+a)),i.starte.b&&(l=(i.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function gae(t,e,n){const s=t.drawingArea,{extra:i,additionalAngle:r,padding:o,size:a}=n,l=t.getPointPosition(e,s+i+o,r),c=Math.round(Sx(qi(l.angle+li))),u=wae(l.y,a.h,c),d=yae(c),h=bae(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function _ae(t,e){if(!e)return!0;const{left:n,top:s,right:i,bottom:r}=t;return!(mo({x:n,y:s},e)||mo({x:n,y:r},e)||mo({x:i,y:s},e)||mo({x:i,y:r},e))}function vae(t,e,n){const s=[],i=t._pointLabels.length,r=t.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:Xy(r)/2,additionalAngle:o?Fn/i:0};let c;for(let u=0;u270||n<90)&&(t-=e),t}function xae(t,e,n){const{left:s,top:i,right:r,bottom:o}=n,{backdropColor:a}=e;if(!tn(a)){const l=Au(e.borderRadius),c=vs(e.backdropPadding);t.fillStyle=a;const u=s-c.left,d=i-c.top,h=r-s+c.width,f=o-i+c.height;Object.values(l).some(v=>v!==0)?(t.beginPath(),Qg(t,{x:u,y:d,w:h,h:f,radius:l}),t.fill()):t.fillRect(u,d,h,f)}}function Sae(t,e){const{ctx:n,options:{pointLabels:s}}=t;for(let i=e-1;i>=0;i--){const r=t._pointLabelItems[i];if(!r.visible)continue;const o=s.setContext(t.getPointLabelContext(i));xae(n,o,r);const a=Bn(o.font),{x:l,y:c,textAlign:u}=r;lc(n,t._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function cP(t,e,n,s){const{ctx:i}=t;if(n)i.arc(t.xCenter,t.yCenter,e,0,Ri);else{let r=t.getPointPosition(0,e);i.moveTo(r.x,r.y);for(let o=1;o{const i=Qt(this.options.pointLabels.callback,[n,s],this);return i||i===0?i:""}).filter((n,s)=>this.chart.getDataVisibility(s))}fit(){const e=this.options;e.display&&e.pointLabels.display?pae(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,s,i){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((s-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,s,i))}getIndexAngle(e){const n=Ri/(this._pointLabels.length||1),s=this.options.startAngle||0;return qi(e*n+Ma(s))}getDistanceFromCenterForValue(e){if(tn(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(tn(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=i.setContext(h),v=r.setContext(h);Eae(this,f,l,o,v)}}),s.display){for(e.save(),a=o-1;a>=0;a--){const u=s.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(e.lineWidth=h,e.strokeStyle=d,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,s=n.ticks;if(!s.display)return;const i=this.getIndexAngle(0);let r,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=s.setContext(this.getContext(l)),u=Bn(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=u.string,o=e.measureText(a.label).width,e.fillStyle=c.backdropColor;const d=vs(c.backdropPadding);e.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}lc(e,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}Te(gm,"id","radialLinear"),Te(gm,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:w0.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),Te(gm,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Te(gm,"descriptors",{angleLines:{_fallback:"grid"}});const E0={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}},Hs=Object.keys(E0);function k3(t,e){return t-e}function C3(t,e){if(tn(e))return null;const n=t._adapter,{parser:s,round:i,isoWeekday:r}=t._parseOpts;let o=e;return typeof s=="function"&&(o=s(o)),Qn(o)||(o=typeof s=="string"?n.parse(o,s):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(sd(r)||r===!0)?n.startOf(o,"isoWeek",r):n.startOf(o,i)),+o)}function P3(t,e,n,s){const i=Hs.length;for(let r=Hs.indexOf(t);r=Hs.indexOf(n);r--){const o=Hs[r];if(E0[o].common&&t._adapter.diff(i,s,o)>=e-1)return o}return Hs[n?Hs.indexOf(n):0]}function Mae(t){for(let e=Hs.indexOf(t)+1,n=Hs.length;e=e?n[s]:n[i];t[r]=!0}}function Rae(t,e,n,s){const i=t._adapter,r=+i.startOf(e[0].value,s),o=e[e.length-1].value;let a,l;for(a=r;a<=o;a=+i.add(a,1,s))l=n[a],l>=0&&(e[l].major=!0);return e}function I3(t,e,n){const s=[],i={},r=e.length;let o,a;for(o=0;o+e.value))}initOffsets(e=[]){let n=0,s=0,i,r;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?s=r:s=(r-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=Ei(n,0,o),s=Ei(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const e=this._adapter,n=this.min,s=this.max,i=this.options,r=i.time,o=r.unit||P3(r.minUnit,n,s,this._getLabelCapacity(n)),a=Ct(i.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=sd(l)||l===!0,u={};let d=n,h,f;if(c&&(d=+e.startOf(d,"isoWeek",l)),d=+e.startOf(d,c?"day":o),e.diff(s,n,o)>1e5*a)throw new Error(n+" and "+s+" are too far apart with stepSize of "+a+" "+o);const v=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h+_)}getLabelForValue(e){const n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(e,s.tooltipFormat):n.format(e,s.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,r=this._unit,o=n||i[r];return this._adapter.format(e,o)}_tickFormatFunction(e,n,s,i){const r=this.options,o=r.ticks.callback;if(o)return Qt(o,[e,n,s],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=s[n],f=c&&d&&h&&h.major;return this._adapter.format(e,i||(f?d:u))}generateTickLabels(e){let n,s,i;for(n=0,s=e.length;n0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,s;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,s=i.length;n=t[s].pos&&e<=t[i].pos&&({lo:s,hi:i}=Gl(t,"pos",e)),{pos:r,time:a}=t[s],{pos:o,time:l}=t[i]):(e>=t[s].time&&e<=t[i].time&&({lo:s,hi:i}=Gl(t,"time",e)),{time:r,pos:a}=t[s],{time:o,pos:l}=t[i]);const c=o-r;return c?a+(l-a)*(e-r)/c:a}class L3 extends Sf{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=_m(n,this.min),this._tableRange=_m(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:s}=this,i=[],r=[];let o,a,l,c,u;for(o=0,a=e.length;o=n&&c<=s&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(o=0,a=i.length;oi-r)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?e=this.normalize(n.concat(s)):e=n.length?n:s,e=this._cache.all=e,e}getDecimalForValue(e){return(_m(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return _m(this._table,s*this._tableRange+this._minPos,!0)}}Te(L3,"id","timeseries"),Te(L3,"defaults",Sf.defaults);const uP={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},kae={ariaLabel:{type:String},ariaDescribedby:{type:String}},Cae={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...uP,...kae},Pae=K4[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function zc(t){return x_(t)?Mt(t):t}function Oae(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return x_(e)?new Proxy(t,{}):t}function Iae(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function dP(t,e){t.labels=e}function hP(t,e,n){const s=[];t.datasets=e.map(i=>{const r=t.datasets.find(o=>o[n]===i[n]);return!r||!i.data||s.includes(r)?{...i}:(s.push(r),Object.assign(r,i),r)})}function Lae(t,e){const n={labels:[],datasets:[]};return dP(n,t.labels),hP(n,t.datasets,e),n}const Dae=it({props:Cae,setup(t,e){let{expose:n,slots:s}=e;const i=S_(null),r=E_(null);n({chart:r});const o=()=>{if(!i.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:f}=t,v=Lae(u,f),_=Oae(v,u);r.value=new S0(i.value,{type:c,data:_,options:{...d},plugins:h})},a=()=>{const c=Mt(r.value);c&&(t.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},t.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(t.updateMode)};return nw(o),sw(a),Zl([()=>t.options,()=>t.data],(c,u)=>{let[d,h]=c,[f,v]=u;const _=Mt(r.value);if(!_)return;let m=!1;if(d){const g=zc(d),y=zc(f);g&&g!==y&&(Iae(_,g),m=!0)}if(h){const g=zc(h.labels),y=zc(v.labels),b=zc(h.datasets),w=zc(v.datasets);g!==y&&(dP(_.config.data,g),m=!0),b&&b!==w&&(hP(_.config.data,b,t.datasetIdKey),m=!0)}m&&zf(()=>{l(_)})},{deep:!0}),()=>nc("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:i},[nc("p",{},[s.default?s.default():""])])}});function fP(t,e){return S0.register(e),it({props:uP,setup(n,s){let{expose:i}=s;const r=E_(null),o=a=>{r.value=a==null?void 0:a.chart};return i({chart:r}),()=>nc(Dae,Pae({ref:o},{type:t,...n}))}})}const Nae=fP("line",sg),Fae=fP("scatter",ig),Uae=it({name:"line-chart",components:{LineChart:Nae},props:["title","axis","labels"],data(){return{colors:["#1f77b4","#ff7f0e","#2ca02c","#d62728"]}},computed:{chartData(){return{labels:this.labels,datasets:this.axis.map((t,e)=>({label:t.label,data:t.data,borderColor:this.colors[e],fill:!1,radius:1,pointRadius:0,lineTension:.1}))}},chartOptions(){return{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},scales:{x:{type:"linear"}},plugins:{title:{display:!0,text:this.title},tooltip:{enabled:!0,position:"average",mode:"index",intersect:!1}}}}}});function $ae(t,e,n,s,i,r){const o=Oe("LineChart",!0);return Z(),en(o,{data:t.chartData,options:t.chartOptions,ref:"chart"},null,8,["data","options"])}const Nx=lt(Uae,[["render",$ae]]),Bae=it({name:"StickRates",components:{LineChart:Nx},setup(){return{profile:Jt()}},computed:{fileRef(){return this.$refs.file},downloadAnchorRef(){return this.$refs.downloadAnchor},currentProfile(){return this.profile.rate.rates[this.profile.rate.profile]},currentMode:{get(){return this.currentProfile.mode},set(t){const e=this.profile.rate.rates[this.profile.rate.profile].mode;this.rateBackup[e]=JSON.parse(JSON.stringify(this.profile.rate.rates[this.profile.rate.profile].rate)),this.profile.rate.rates[this.profile.rate.profile].mode=t;const n=[...this.rateBackup[t]||this.rateDefaults[t]];this.profile.rate.rates[this.profile.rate.profile].rate=n}},currentModeText(){return this.rateModes[this.currentProfile.mode].text},rateLabel(){return this.rateLabels[this.currentProfile.mode]}},data(){return{rateProfiles:[{value:0,text:"Rate Profile 1"},{value:1,text:"Rate Profile 2"}],MODE_SILVERWARE:0,MODE_BETAFLIGHT:1,MODE_ACTUAL:2,rateBackup:{},rateDefaults:[[[860,860,500],[.8,.8,.6],[.55,0,.55]],[[1.3,1.3,1.3],[.7,.7,.7],[.4,.4,.4]],[[70,70,70],[670,670,670],[0,0,0]]],rateStep:[[5,.05,.05],[.05,.05,.05],[5,5,.05]],rateLimits:[[{min:0,max:1800},{min:0,max:1},{min:0,max:1}],[{min:0,max:3},{min:0,max:3},{min:0,max:1}],[{min:0,max:500},{min:0,max:1800},{min:0,max:1}]],rateModes:[{value:0,text:"Silverware"},{value:1,text:"Betaflight"},{value:2,text:"Actual"}],plot:{axis:[],labels:[]},SILVERWARE_MAX_RATE:0,SILVERWARE_ACRO_EXPO:1,SILVERWARE_ANGLE_EXPO:2,BETAFLIGHT_RC_RATE:0,BETAFLIGHT_SUPER_RATE:1,BETAFLIGHT_EXPO:2,ACTUAL_CENTER_SENSITIVITY:0,ACTUAL_MAX_RATE:1,ACTUAL_EXPO:2,rateLabels:[["MAX_RATE","ACRO_EXPO","ANGLE_EXPO"],["RC_RATE","SUPER_RATE","EXPO"],["CENTER_SENSITIVITY","MAX_RATE","EXPO"]]}},methods:{constrain(t,e,n){return t>n?n:t2&&(r+=14.54*(r-2));let o=200*r*e;const a=this.currentProfile.rate[this.BETAFLIGHT_SUPER_RATE][t];if(a){const l=1/this.constrain(1-i*a,.01,1);o*=l}return o},calcActual(t,e){const n=this.currentProfile.rate[this.ACTUAL_EXPO][t],i=Math.abs(e)*(Math.pow(e,5)*n+e*(1-n)),r=this.currentProfile.rate[this.ACTUAL_CENTER_SENSITIVITY][t],o=this.currentProfile.rate[this.ACTUAL_MAX_RATE][t],a=Math.max(0,o-r);return e*r+a*i},update(){const t=[{label:"Roll",data:[]},{label:"Pitch",data:[]},{label:"Yaw",data:[]}],e=[];for(let n=-100;n<=100;n++){const s=n/100;e.push(""+n.toString());for(let i=0;i<3;i++)switch(this.currentProfile.mode){case this.MODE_SILVERWARE:t[i].data.push({x:n,y:this.calcSilverware(i,s)});break;case this.MODE_BETAFLIGHT:t[i].data.push({x:n,y:this.calcBetatflight(i,s)});break;case this.MODE_ACTUAL:t[i].data.push({x:n,y:this.calcActual(i,s)});break}}this.plot={labels:e,axis:t}},uploadRates(){const t=new FileReader;t.addEventListener("load",e=>{var n,s;if((n=e==null?void 0:e.target)!=null&&n.result){const i=Ao.parse((s=e==null?void 0:e.target)==null?void 0:s.result);this.profile.rate.rates=[...i]}}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},downloadRates(){const t=Ao.stringify(this.profile.rate.rates),n="data:text/yaml;charset=utf-8,"+encodeURIComponent(t),s=new Date().toISOString().substring(0,10),r=`Rates_${this.profile.meta.name.replace(/\0/g,"")}_${s}.yaml`;this.downloadAnchorRef.setAttribute("href",n),this.downloadAnchorRef.setAttribute("download",r),this.downloadAnchorRef.click()}},mounted(){this.update()}}),Hae={class:"card"},Gae=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Rates")],-1),zae={class:"card-content"},Vae={class:"content column-narrow field-is-5"},Wae={class:"columns"},jae={class:"column is-6"},qae={class:"field is-horizontal"},Yae={class:"field-label"},Xae={class:"label",for:"profile"},Kae={class:"field-body"},Zae={class:"field"},Jae={class:"control is-expanded"},Qae={class:"field is-horizontal"},ele={class:"field-label"},tle={class:"label",for:"rate-mode"},nle={class:"field-body"},sle={class:"field"},ile={class:"control is-expanded"},rle={class:"card mt-5 mb-6"},ole={class:"card-header"},ale={class:"card-header-title"},lle={class:"card-content"},cle={class:"content"},ule=Ya('
Roll
Pitch
Yaw
',1),dle={class:"column is-4"},hle=["for"],fle={class:"field-body"},ple={class:"field"},mle={class:"control is-expanded"},gle={class:"columns is-multiline"},_le={class:"column is-4"},vle=["id","step","min","max","onUpdate:modelValue"],yle={class:"column is-4"},ble=["id","step","min","max","onUpdate:modelValue"],wle={class:"column is-4"},xle=["id","step","min","max","onUpdate:modelValue"],Sle={class:"field is-horizontal"},Ele={class:"field-label"},Tle={class:"label",for:"level-max-angle"},Ale={class:"field-body"},Mle={class:"field"},Rle={class:"control is-expanded"},kle={class:"field is-horizontal"},Cle={class:"field-label"},Ple={class:"label",for:"sticks-deadband"},Ole={class:"field-body"},Ile={class:"field"},Lle={class:"control is-expanded"},Dle={class:"column is-6"},Nle={class:"card-footer"},Fle={accept:".yaml",type:"file",ref:"file",style:{display:"none"}},Ule={ref:"downloadAnchor",target:"_blank"};function $le(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select"),l=Oe("LineChart"),c=Oe("spinner-btn");return Z(),ie("div",Hae,[Gae,p("div",zae,[p("div",Vae,[p("div",Wae,[p("div",jae,[p("div",qae,[p("div",Yae,[p("label",Xae,[me(" Profile "),Y(o,{entry:"rate.profile"})])]),p("div",Kae,[p("div",Zae,[p("div",Jae,[Y(a,{id:"profile",class:"is-fullwidth",modelValue:t.profile.rate.profile,"onUpdate:modelValue":e[0]||(e[0]=u=>t.profile.rate.profile=u),modelModifiers:{number:!0},options:t.rateProfiles,onChange:e[1]||(e[1]=u=>t.update())},null,8,["modelValue","options"])])])])]),p("div",Qae,[p("div",ele,[p("label",tle,[me(" Mode "),Y(o,{entry:"rate.mode"})])]),p("div",nle,[p("div",sle,[p("div",ile,[Y(a,{id:"rate-mode",class:"is-fullwidth",modelValue:t.currentMode,"onUpdate:modelValue":e[2]||(e[2]=u=>t.currentMode=u),modelModifiers:{number:!0},options:t.rateModes,onChange:e[3]||(e[3]=u=>t.update())},null,8,["modelValue","options"])])])])]),p("div",rle,[p("header",ole,[p("p",ale,Be(t.currentModeText),1)]),p("div",lle,[p("div",cle,[ule,(Z(!0),ie(ot,null,qt(t.currentProfile.rate,(u,d)=>(Z(),ie("div",{class:"columns is-multiline",key:t.rateLabel[d]},[p("div",dle,[p("label",{for:`${t.currentModeText}-${t.rateLabel[d]}`},Be(t.rateLabel[d]),9,hle)]),p("div",fle,[p("div",ple,[p("div",mle,[p("div",gle,[p("div",_le,[Ye(p("input",{class:"input",id:`${t.currentModeText}-${t.rateLabel[d]}-roll`,type:"number",step:t.rateStep[t.currentMode][d],min:t.rateLimits[t.currentMode][d].min,max:t.rateLimits[t.currentMode][d].max,"onUpdate:modelValue":h=>t.currentProfile.rate[d][0]=h,onInput:e[4]||(e[4]=h=>t.update())},null,40,vle),[[st,t.currentProfile.rate[d][0],void 0,{number:!0}]])]),p("div",yle,[Ye(p("input",{class:"input",id:`${t.currentModeText}-${t.rateLabel[d]}-pitch`,type:"number",step:t.rateStep[t.currentMode][d],min:t.rateLimits[t.currentMode][d].min,max:t.rateLimits[t.currentMode][d].max,"onUpdate:modelValue":h=>t.currentProfile.rate[d][1]=h,onInput:e[5]||(e[5]=h=>t.update())},null,40,ble),[[st,t.currentProfile.rate[d][1],void 0,{number:!0}]])]),p("div",wle,[Ye(p("input",{class:"input",id:`${t.currentModeText}-${t.rateLabel[d]}-yaw`,type:"number",step:t.rateStep[t.currentMode][d],min:t.rateLimits[t.currentMode][d].min,max:t.rateLimits[t.currentMode][d].max,"onUpdate:modelValue":h=>t.currentProfile.rate[d][2]=h,onInput:e[6]||(e[6]=h=>t.update())},null,40,xle),[[st,t.currentProfile.rate[d][2],void 0,{number:!0}]])])])])])])]))),128))])])]),p("div",Sle,[p("div",Ele,[p("label",Tle,[me(" LevelMaxAngle "),Y(o,{entry:"rate.level_max_angle"})])]),p("div",Ale,[p("div",Mle,[p("div",Rle,[Ye(p("input",{class:"input",id:"level-max-angle",type:"number",step:"5","onUpdate:modelValue":e[7]||(e[7]=u=>t.profile.rate.level_max_angle=u)},null,512),[[st,t.profile.rate.level_max_angle,void 0,{number:!0}]])])])])]),p("div",kle,[p("div",Cle,[p("label",Ple,[me(" SticksDeadband "),Y(o,{entry:"rate.sticks_deadband"})])]),p("div",Ole,[p("div",Ile,[p("div",Lle,[Ye(p("input",{class:"input",step:"0.01",id:"sticks-deadband",type:"number","onUpdate:modelValue":e[8]||(e[8]=u=>t.profile.rate.sticks_deadband=u)},null,512),[[st,t.profile.rate.sticks_deadband,void 0,{number:!0}]])])])])])]),p("div",Dle,[Y(l,{title:"Rates",labels:t.plot.labels,axis:t.plot.axis},null,8,["labels","axis"])])])])]),p("footer",Nle,[Y(c,{class:"card-footer-item",onClick:t.downloadRates},{default:nt(()=>[me(" Save Rates ")]),_:1},8,["onClick"]),Y(c,{class:"card-footer-item",onClick:t.uploadRates},{default:nt(()=>[me(" Load Rates ")]),_:1},8,["onClick"])]),p("input",Fle,null,512),p("a",Ule,null,512)])}const Ble=lt(Bae,[["render",$le]]),Hle=it({name:"StickRatesLegacy",components:{LineChart:Nx},setup(){return{profile:Jt()}},data(){return{plotLowRates:!1,rateModes:[{value:0,text:"Silverware"},{value:1,text:"Betaflight"}],plot:{axis:[],labels:[]}}},computed:{currentMode(){return this.rateModes[this.profile.rate.mode]}},watch:{"profile.rate":{handler(t){this.update()},deep:!0},plotLowRates(){this.update()}},methods:{constrainf(t,e,n){return t>n?n:t1&&(e=1),e<-1&&(e=-1);const n=t*t*t*e+t*(1-e);return this.limitf(n,1)},calcSilverware(t,e){const n=this.profile.rate.silverware.acro_expo[t],s=this.profile.rate.silverware.max_rate[t];return this.rcexpo(e,n)*s},calcBetatflight(t,e){const i=this.profile.rate.betaflight.expo[t];e=this.rcexpo(e,i);let r=this.profile.rate.betaflight.rc_rate[t];r>2&&(r+=14.54*(r-2));const o=e>0?e:-e;let a=200*r*e;const l=this.profile.rate.betaflight.super_rate[t];if(l){const c=1/this.constrainf(1-o*l,.01,1);a*=c}return this.constrainf(a,-1998,1998)},update(){const t=[{label:"Roll",data:[]},{label:"Pitch",data:[]},{label:"Yaw",data:[]}],e=[],n=this.plotLowRates?this.profile.rate.low_rate_mulitplier:1;for(let s=-100;s<=100;s++){const i=s/100;e.push(""+s);for(let r=0;r<3;r++)this.currentMode.text=="Silverware"?t[r].data.push({x:s,y:this.calcSilverware(r,i)*n}):this.currentMode.text=="Betaflight"&&t[r].data.push({x:s,y:this.calcBetatflight(r,i)*n})}this.plot={labels:e,axis:t}}},mounted(){this.update()}}),Gle={class:"card"},zle=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Rates")],-1),Vle={class:"card-content"},Wle={class:"content column-narrow field-is-5"},jle={class:"columns"},qle={class:"column is-6"},Yle={class:"field is-horizontal"},Xle={class:"field-label"},Kle={class:"label",for:"rate-mode"},Zle={class:"field-body"},Jle={class:"field"},Qle={class:"control is-expanded"},ece={class:"card mt-5 mb-6"},tce={class:"card-header"},nce={class:"card-header-title"},sce={class:"card-content"},ice={class:"content"},rce=Ya('
Roll
Pitch
Yaw
',1),oce={class:"column is-4"},ace=["for"],lce={class:"field-body"},cce={class:"field"},uce={class:"control is-expanded"},dce={class:"columns is-multiline"},hce={class:"column is-4"},fce=["id","onUpdate:modelValue"],pce={class:"column is-4"},mce=["id","onUpdate:modelValue"],gce={class:"column is-4"},_ce=["id","onUpdate:modelValue"],vce={class:"field is-horizontal"},yce={class:"field-label"},bce={class:"label",for:"level-max-angle"},wce={class:"field-body"},xce={class:"field"},Sce={class:"control is-expanded"},Ece={class:"field is-horizontal"},Tce={class:"field-label"},Ace={class:"label",for:"low-rate-mulitplier"},Mce={class:"field-body"},Rce={class:"field"},kce={class:"control is-expanded"},Cce={class:"field is-horizontal"},Pce={class:"field-label"},Oce={class:"label",for:"sticks-deadband"},Ice={class:"field-body"},Lce={class:"field"},Dce={class:"control is-expanded"},Nce={class:"column is-6"},Fce=p("label",{for:"plotLowRates"},"Plot LowRates",-1);function Uce(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select"),l=Oe("LineChart");return Z(),ie("div",Gle,[zle,p("div",Vle,[p("div",Wle,[p("div",jle,[p("div",qle,[p("div",Yle,[p("div",Xle,[p("label",Kle,[me(" Mode "),Y(o,{entry:"rate.mode"})])]),p("div",Zle,[p("div",Jle,[p("div",Qle,[Y(a,{id:"rate-mode",class:"is-fullwidth",modelValue:t.profile.rate.mode,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.rate.mode=c),modelModifiers:{number:!0},options:t.rateModes,onChange:e[1]||(e[1]=c=>t.update())},null,8,["modelValue","options"])])])])]),p("div",ece,[p("header",tce,[p("p",nce,Be(t.currentMode.text),1)]),p("div",sce,[p("div",ice,[rce,(Z(!0),ie(ot,null,qt(t.profile.rate[t.currentMode.text.toLowerCase()],(c,u)=>(Z(),ie("div",{class:"columns is-multiline",key:u},[p("div",oce,[p("label",{for:`${t.currentMode.text}-${u}`},Be(u),9,ace)]),p("div",lce,[p("div",cce,[p("div",uce,[p("div",dce,[p("div",hce,[Ye(p("input",{class:"input",id:`${t.currentMode.text}-${u}-roll`,type:"number",step:"10","onUpdate:modelValue":d=>t.profile.rate[t.currentMode.text.toLowerCase()][u][0]=d},null,8,fce),[[st,t.profile.rate[t.currentMode.text.toLowerCase()][u][0],void 0,{number:!0}]])]),p("div",pce,[Ye(p("input",{class:"input",id:`${t.currentMode.text}-${u}-pitch`,type:"number",step:"10","onUpdate:modelValue":d=>t.profile.rate[t.currentMode.text.toLowerCase()][u][1]=d},null,8,mce),[[st,t.profile.rate[t.currentMode.text.toLowerCase()][u][1],void 0,{number:!0}]])]),p("div",gce,[Ye(p("input",{class:"input",id:`${t.currentMode.text}-${u}-yaw`,type:"number",step:"10","onUpdate:modelValue":d=>t.profile.rate[t.currentMode.text.toLowerCase()][u][2]=d},null,8,_ce),[[st,t.profile.rate[t.currentMode.text.toLowerCase()][u][2],void 0,{number:!0}]])])])])])])]))),128))])])]),p("div",vce,[p("div",yce,[p("label",bce,[me(" LevelMaxAngle "),Y(o,{entry:"rate.level_max_angle"})])]),p("div",wce,[p("div",xce,[p("div",Sce,[Ye(p("input",{class:"input",id:"level-max-angle",type:"number",step:"5","onUpdate:modelValue":e[2]||(e[2]=c=>t.profile.rate.level_max_angle=c)},null,512),[[st,t.profile.rate.level_max_angle,void 0,{number:!0}]])])])])]),p("div",Ece,[p("div",Tce,[p("label",Ace,[me(" LowRateMulitplier "),Y(o,{entry:"rate.low_rate_mulitplier"})])]),p("div",Mce,[p("div",Rce,[p("div",kce,[Ye(p("input",{class:"input",id:"low-rate-mulitplier",type:"number",step:"0.05","onUpdate:modelValue":e[3]||(e[3]=c=>t.profile.rate.low_rate_mulitplier=c)},null,512),[[st,t.profile.rate.low_rate_mulitplier,void 0,{number:!0}]])])])])]),p("div",Cce,[p("div",Pce,[p("label",Oce,[me(" SticksDeadband "),Y(o,{entry:"rate.sticks_deadband"})])]),p("div",Ice,[p("div",Lce,[p("div",Dce,[Ye(p("input",{class:"input",step:"0.01",id:"sticks-deadband",type:"number","onUpdate:modelValue":e[4]||(e[4]=c=>t.profile.rate.sticks_deadband=c)},null,512),[[st,t.profile.rate.sticks_deadband,void 0,{number:!0}]])])])])])]),p("div",Nce,[t.profile.rate.silverware.acro_expo?(Z(),en(l,{key:0,title:(t.plotLowRates?"Low ":"")+"Rates",labels:t.plot.labels,axis:t.plot.axis},null,8,["title","labels","axis"])):ze("",!0),Ye(p("input",{id:"plotLowRates",name:"plotLowRates",type:"checkbox",class:"switch","onUpdate:modelValue":e[5]||(e[5]=c=>t.plotLowRates=c)},null,512),[[rk,t.plotLowRates]]),Fce])])])])])}const $ce=lt(Hle,[["render",Uce]]),Bce=it({name:"PIDRates",setup(){return{root:vn(),profile:Jt()}},data(){return{pidProfiles:[{value:0,text:"PID Profile 1"},{value:1,text:"PID Profile 2"}],stickProfiles:[{value:0,text:"Stick Boost Profile AUX Off"},{value:1,text:"Stick Boost Profile AUX On"}],tdaOptions:[{value:0,text:"Off"},{value:1,text:"On"}],current_preset:-1}},computed:{pid_rates:{get(){return this.profile.current_pid_rate},set(t){this.profile.set_current_pid_rate(t)}},stick_rates:{get(){return this.profile.current_stick_rate},set(t){this.profile.set_current_stick_rate(t)}},presets(){return[{index:-1,name:"Choose..."},...this.root.pid_rate_presets].map(t=>({value:t.index,text:t.name}))}},methods:{load_preset(t){this.pid_rates=this.root.pid_rate_presets[t].rate}}}),Hce={class:"card"},Gce=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"PID")],-1),zce={class:"card-content"},Vce={class:"content column-narrow field-is-5"},Wce={class:"columns"},jce={class:"column is-6"},qce={class:"field field-is-2 is-horizontal"},Yce={class:"field-label"},Xce={class:"label",for:"pid-preset"},Kce={class:"field-body"},Zce={class:"field has-addons"},Jce={class:"control is-expanded"},Qce={class:"control"},eue={class:"field field-is-2 is-horizontal"},tue={class:"field-label"},nue={class:"label",for:"pid-profile"},sue={class:"field-body"},iue={class:"field"},rue={class:"control is-expanded"},oue=Ya('
Roll
Pitch
Yaw
',1),aue={class:"field-label"},lue={class:"label"},cue={class:"field-body"},uue={class:"field"},due={class:"control is-expanded"},hue=["id","onUpdate:modelValue"],fue={class:"field"},pue={class:"control is-expanded"},mue=["id","onUpdate:modelValue"],gue={class:"field"},_ue={class:"control is-expanded"},vue=["id","onUpdate:modelValue"],yue={class:"field is-horizontal mt-6"},bue={class:"field-label"},wue={class:"label",for:"throttle_dterm_attenuation-enable"},xue={class:"field-body"},Sue={class:"field"},Eue={class:"control is-expanded"},Tue={class:"field is-horizontal"},Aue={class:"field-label"},Mue={class:"label",for:"throttle_dterm_attenuation-breakpoint"},Rue={class:"field-body"},kue={class:"field"},Cue={class:"control is-expanded"},Pue={class:"field is-horizontal"},Oue={class:"field-label"},Iue={class:"label",for:"throttle_dterm_attenuation-percent"},Lue={class:"field-body"},Due={class:"field"},Nue={class:"control is-expanded"},Fue={class:"column is-6"},Uue={class:"field field-is-2 is-horizontal"},$ue={class:"field-label"},Bue={class:"label",for:"stick-profile"},Hue={class:"field-body"},Gue={class:"field"},zue={class:"control is-expanded"},Vue=Ya('
Roll
Pitch
Yaw
',1),Wue={class:"field-label"},jue={class:"label"},que={class:"field-body"},Yue={class:"field"},Xue={class:"control is-expanded"},Kue=["id","onUpdate:modelValue"],Zue={class:"field"},Jue={class:"control is-expanded"},Que=["id","onUpdate:modelValue"],ede={class:"field"},tde={class:"control is-expanded"},nde=["id","onUpdate:modelValue"],sde={class:"columns mt-6 mb-1"},ide={class:"column is-4"},rde={class:"has-text-right"},ode=p("div",{class:"column is-4"},[p("h6",null,"Small")],-1),ade=p("div",{class:"column is-4"},[p("h6",null,"Big")],-1),lde={class:"field-label"},cde={class:"label"},ude={class:"field-body"},dde={class:"field"},hde={class:"control is-expanded"},fde=["id","onUpdate:modelValue"],pde={class:"field"},mde={class:"control is-expanded"},gde=["id","onUpdate:modelValue"];function _de(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select"),l=Oe("spinner-btn");return Z(),ie("div",Hce,[Gce,p("div",zce,[p("div",Vce,[p("div",Wce,[p("div",jce,[p("div",qce,[p("div",Yce,[p("label",Xce,[me(" PID Preset "),Y(o,{entry:"pid.preset"})])]),p("div",Kce,[p("div",Zce,[p("div",Jce,[Y(a,{id:"pid-preset",modelValue:t.current_preset,"onUpdate:modelValue":e[0]||(e[0]=c=>t.current_preset=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.presets},null,8,["modelValue","options"])]),p("div",Qce,[Y(l,{disabled:t.current_preset==-1,onClick:e[1]||(e[1]=c=>t.load_preset(t.current_preset))},{default:nt(()=>[me(" Load ")]),_:1},8,["disabled"])])])])]),p("div",eue,[p("div",tue,[p("label",nue,[me(" PIDProfile "),Y(o,{entry:"pid.profile"})])]),p("div",sue,[p("div",iue,[p("div",rue,[Y(a,{id:"pid-profile",modelValue:t.profile.pid.pid_profile,"onUpdate:modelValue":e[2]||(e[2]=c=>t.profile.pid.pid_profile=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.pidProfiles},null,8,["modelValue","options"])])])])]),oue,(Z(!0),ie(ot,null,qt(t.pid_rates,(c,u)=>(Z(),ie("div",{key:u,class:"field field-is-2 is-horizontal"},[p("div",aue,[p("label",lue,Be(u),1)]),p("div",cue,[p("div",uue,[p("p",due,[Ye(p("input",{id:`pid-${u}-roll`,"onUpdate:modelValue":d=>t.pid_rates[u][0]=d,class:"input",type:"number",step:"1.0",min:"0"},null,8,hue),[[st,t.pid_rates[u][0],void 0,{number:!0}]])])]),p("div",fue,[p("p",pue,[Ye(p("input",{id:`pid-${u}-pitch`,"onUpdate:modelValue":d=>t.pid_rates[u][1]=d,class:"input",type:"number",step:"1.0",min:"0"},null,8,mue),[[st,t.pid_rates[u][1],void 0,{number:!0}]])])]),p("div",gue,[p("p",_ue,[Ye(p("input",{id:`pid-${u}-yaw`,"onUpdate:modelValue":d=>t.pid_rates[u][2]=d,class:"input",type:"number",step:"1.0",min:"0"},null,8,vue),[[st,t.pid_rates[u][2],void 0,{number:!0}]])])])])]))),128)),p("div",yue,[p("div",bue,[p("label",wue,[me(" Throttle DTerm Attenuation "),Y(o,{entry:"pid.tda_active"})])]),p("div",xue,[p("div",Sue,[p("div",Eue,[Y(a,{id:"throttle_dterm_attenuation-enable",modelValue:t.profile.pid.throttle_dterm_attenuation.tda_active,"onUpdate:modelValue":e[3]||(e[3]=c=>t.profile.pid.throttle_dterm_attenuation.tda_active=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.tdaOptions},null,8,["modelValue","options"])])])])]),p("div",Tue,[p("div",Aue,[p("label",Mue,[me(" TDA Breakpoint "),Y(o,{entry:"pid.tda_breakpoint"})])]),p("div",Rue,[p("div",kue,[p("div",Cue,[Ye(p("input",{id:"throttle_dterm_attenuation-breakpoint","onUpdate:modelValue":e[4]||(e[4]=c=>t.profile.pid.throttle_dterm_attenuation.tda_breakpoint=c),class:"input",type:"number",step:"0.05",min:"0"},null,512),[[st,t.profile.pid.throttle_dterm_attenuation.tda_breakpoint,void 0,{number:!0}]])])])])]),p("div",Pue,[p("div",Oue,[p("label",Iue,[me(" TDA Percent "),Y(o,{entry:"pid.tda_percent"})])]),p("div",Lue,[p("div",Due,[p("div",Nue,[Ye(p("input",{id:"throttle_dterm_attenuation-percent","onUpdate:modelValue":e[5]||(e[5]=c=>t.profile.pid.throttle_dterm_attenuation.tda_percent=c),class:"input",type:"number",step:"0.05",min:"0"},null,512),[[st,t.profile.pid.throttle_dterm_attenuation.tda_percent,void 0,{number:!0}]])])])])])]),p("div",Fue,[p("div",Uue,[p("div",$ue,[p("label",Bue,[me(" Stick Boost Profile "),Y(o,{entry:"pid.stick_profile"})])]),p("div",Hue,[p("div",Gue,[p("div",zue,[Y(a,{id:"stick-profile",modelValue:t.profile.pid.stick_profile,"onUpdate:modelValue":e[6]||(e[6]=c=>t.profile.pid.stick_profile=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.stickProfiles},null,8,["modelValue","options"])])])])]),Vue,(Z(!0),ie(ot,null,qt(t.stick_rates,(c,u)=>(Z(),ie("div",{key:u,class:"field field-is-2 is-horizontal"},[p("div",Wue,[p("label",jue,Be(u),1)]),p("div",que,[p("div",Yue,[p("p",Xue,[Ye(p("input",{id:`stick-${u}-roll`,"onUpdate:modelValue":d=>t.stick_rates[u][0]=d,class:"input",type:"number",step:"0.01"},null,8,Kue),[[st,t.stick_rates[u][0],void 0,{number:!0}]])])]),p("div",Zue,[p("p",Jue,[Ye(p("input",{id:`stick-${u}-pitch`,"onUpdate:modelValue":d=>t.stick_rates[u][1]=d,class:"input",type:"number",step:"0.01"},null,8,Que),[[st,t.stick_rates[u][1],void 0,{number:!0}]])])]),p("div",ede,[p("p",tde,[Ye(p("input",{id:`stick-${u}-yaw`,"onUpdate:modelValue":d=>t.stick_rates[u][2]=d,class:"input",type:"number",step:"0.01"},null,8,nde),[[st,t.stick_rates[u][2],void 0,{number:!0}]])])])])]))),128)),p("div",sde,[p("div",ide,[p("h6",rde,[me(" Angle Strength "),Y(o,{entry:"pid.angle_strength"})])]),ode,ade]),(Z(),ie(ot,null,qt(["kp","kd"],(c,u)=>p("div",{key:u,class:"field field-is-2 is-horizontal"},[p("div",lde,[p("label",cde,Be(c),1)]),p("div",ude,[p("div",dde,[p("p",hde,[Ye(p("input",{id:`small-angle-${c}`,"onUpdate:modelValue":d=>t.profile.pid.small_angle[c]=d,class:"input",type:"number",step:"0.01"},null,8,fde),[[st,t.profile.pid.small_angle[c],void 0,{number:!0}]])])]),p("div",pde,[p("p",mde,[Ye(p("input",{id:`big-angle-${c}`,"onUpdate:modelValue":d=>t.profile.pid.big_angle[c]=d,class:"input",type:"number",step:"0.01"},null,8,gde),[[st,t.profile.pid.big_angle[c],void 0,{number:!0}]])])])])])),64))])])])])])}const vde=lt(Bce,[["render",_de]]),yde=it({name:"FilterSettings",setup(){return{profile:Jt()}},data(){return{filterTypeOptions:[{value:0,text:"None"},{value:1,text:"PT1"},{value:2,text:"PT2"},{value:3,text:"PT3"}],toggleOptions:[{value:0,text:"Off"},{value:1,text:"On"}]}}}),bde={class:"card"},wde={class:"card-header"},xde=p("p",{class:"card-header-title"},"Filter",-1),Sde={class:"card-content"},Ede={class:"content column-narrow field-is-5"},Tde={key:0,class:"columns"},Ade={key:0,class:"column is-6"},Mde={class:"field is-horizontal"},Rde={class:"field-label"},kde={class:"label",for:"gyro-1-type"},Cde={class:"field-body"},Pde={class:"field"},Ode={class:"control is-expanded"},Ide={class:"field is-horizontal"},Lde={class:"field-label"},Dde={class:"label",for:"gyro-1-freq"},Nde={class:"field-body"},Fde={class:"field"},Ude={class:"control is-expanded"},$de={class:"field is-horizontal mt-6"},Bde={class:"field-label"},Hde={class:"label",for:"gyro-2-type"},Gde={class:"field-body"},zde={class:"field"},Vde={class:"control is-expanded"},Wde={class:"field is-horizontal"},jde={class:"field-label"},qde={class:"label",for:"gyro-2-freq"},Yde={class:"field-body"},Xde={class:"field"},Kde={class:"control is-expanded"},Zde={key:0,class:"field is-horizontal mt-6"},Jde={class:"field-label"},Qde={class:"label",for:"gyro-dynamic-enable"},ehe={class:"field-body"},the={class:"field"},nhe={class:"control is-expanded"},she={key:1,class:"column is-6"},ihe={class:"field is-horizontal"},rhe={class:"field-label"},ohe={class:"label",for:"dterm-1-type"},ahe={class:"field-body"},lhe={class:"field"},che={class:"control is-expanded"},uhe={class:"field is-horizontal"},dhe={class:"field-label"},hhe={class:"label",for:"dterm-1-freq"},fhe={class:"field-body"},phe={class:"field"},mhe={class:"control is-expanded"},ghe={class:"field is-horizontal mt-6"},_he={class:"field-label"},vhe={class:"label",for:"dterm-2-type"},yhe={class:"field-body"},bhe={class:"field"},whe={class:"control is-expanded"},xhe={class:"field is-horizontal"},She={class:"field-label"},Ehe={class:"label",for:"dterm-2-freq"},The={class:"field-body"},Ahe={class:"field"},Mhe={class:"control is-expanded"},Rhe={class:"field is-horizontal mt-6"},khe={class:"field-label"},Che={class:"label",for:"dterm-dynamic-enable"},Phe={class:"field-body"},Ohe={class:"field"},Ihe={class:"control is-expanded"},Lhe={class:"field is-horizontal"},Dhe={class:"field-label"},Nhe={class:"label",for:"dterm-dynamic-min"},Fhe={class:"field-body"},Uhe={class:"field"},$he={class:"control is-expanded"},Bhe={class:"field is-horizontal"},Hhe={class:"field-label"},Ghe={class:"label",for:"dterm-dynamic-max"},zhe={class:"field-body"},Vhe={class:"field"},Whe={class:"control is-expanded"};function jhe(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select");return Z(),ie("div",bde,[p("header",wde,[xde,Y(o,{class:"card-header-icon",entry:"filter.settings",size:"lg"})]),p("div",Sde,[p("div",Ede,[t.profile?(Z(),ie("div",Tde,[t.profile.filter.gyro?(Z(),ie("div",Ade,[p("div",Mde,[p("div",Rde,[p("label",kde,[me(" Gyro Pass 1 Type "),Y(o,{entry:"filter.gyro_1_type"})])]),p("div",Cde,[p("div",Pde,[p("div",Ode,[Y(a,{id:"gyro-1-type",modelValue:t.profile.filter.gyro[0].type,"onUpdate:modelValue":e[0]||(e[0]=l=>t.profile.filter.gyro[0].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",Ide,[p("div",Lde,[p("label",Dde,[me(" Gyro Pass 1 Freq "),Y(o,{entry:"filter.gyro_1_freq"})])]),p("div",Nde,[p("div",Fde,[p("div",Ude,[Ye(p("input",{id:"gyro-1-freq","onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.filter.gyro[0].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[st,t.profile.filter.gyro[0].cutoff_freq,void 0,{number:!0}]])])])])]),p("div",$de,[p("div",Bde,[p("label",Hde,[me(" Gyro Pass 2 Type "),Y(o,{entry:"filter.gyro_2_type"})])]),p("div",Gde,[p("div",zde,[p("div",Vde,[Y(a,{id:"gyro-2-type",modelValue:t.profile.filter.gyro[1].type,"onUpdate:modelValue":e[2]||(e[2]=l=>t.profile.filter.gyro[1].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",Wde,[p("div",jde,[p("label",qde,[me(" Gyro Pass 2 Freq "),Y(o,{entry:"filter.gyro_2_freq"})])]),p("div",Yde,[p("div",Xde,[p("div",Kde,[Ye(p("input",{id:"gyro-2-freq","onUpdate:modelValue":e[3]||(e[3]=l=>t.profile.filter.gyro[1].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[st,t.profile.filter.gyro[1].cutoff_freq,void 0,{number:!0}]])])])])]),t.profile.profileVersionGt("0.2.2")?(Z(),ie("div",Zde,[p("div",Jde,[p("label",Qde,[me(" Gyro Dynamic Notch "),Y(o,{entry:"filter.gyro_dynamic_notch_enable"})])]),p("div",ehe,[p("div",the,[p("div",nhe,[Y(a,{id:"gyro-dynamic-enable",modelValue:t.profile.filter.gyro_dynamic_notch_enable,"onUpdate:modelValue":e[4]||(e[4]=l=>t.profile.filter.gyro_dynamic_notch_enable=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.toggleOptions},null,8,["modelValue","options"])])])])])):ze("",!0)])):ze("",!0),t.profile.filter.dterm?(Z(),ie("div",she,[p("div",ihe,[p("div",rhe,[p("label",ohe,[me(" DTerm Pass 1 Type "),Y(o,{entry:"filter.dterm_1_type"})])]),p("div",ahe,[p("div",lhe,[p("div",che,[Y(a,{id:"dterm-1-type",modelValue:t.profile.filter.dterm[0].type,"onUpdate:modelValue":e[5]||(e[5]=l=>t.profile.filter.dterm[0].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",uhe,[p("div",dhe,[p("label",hhe,[me(" DTerm Pass 1 Freq "),Y(o,{entry:"filter.dterm_1_freq"})])]),p("div",fhe,[p("div",phe,[p("div",mhe,[Ye(p("input",{id:"dterm-1-freq","onUpdate:modelValue":e[6]||(e[6]=l=>t.profile.filter.dterm[0].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[st,t.profile.filter.dterm[0].cutoff_freq,void 0,{number:!0}]])])])])]),p("div",ghe,[p("div",_he,[p("label",vhe,[me(" DTerm Pass 2 Type "),Y(o,{entry:"filter.dterm_2_type"})])]),p("div",yhe,[p("div",bhe,[p("div",whe,[Y(a,{id:"dterm-2-type",modelValue:t.profile.filter.dterm[1].type,"onUpdate:modelValue":e[7]||(e[7]=l=>t.profile.filter.dterm[1].type=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.filterTypeOptions},null,8,["modelValue","options"])])])])]),p("div",xhe,[p("div",She,[p("label",Ehe,[me(" DTerm Pass 2 Freq "),Y(o,{entry:"filter.dterm_2_freq"})])]),p("div",The,[p("div",Ahe,[p("div",Mhe,[Ye(p("input",{id:"dterm-2-freq","onUpdate:modelValue":e[8]||(e[8]=l=>t.profile.filter.dterm[1].cutoff_freq=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[st,t.profile.filter.dterm[1].cutoff_freq,void 0,{number:!0}]])])])])]),p("div",Rhe,[p("div",khe,[p("label",Che,[me(" DTerm Dynamic "),Y(o,{entry:"filter.dterm_dynamic_enable"})])]),p("div",Phe,[p("div",Ohe,[p("div",Ihe,[Y(a,{id:"dterm-dynamic-enable",modelValue:t.profile.filter.dterm_dynamic_enable,"onUpdate:modelValue":e[9]||(e[9]=l=>t.profile.filter.dterm_dynamic_enable=l),modelModifiers:{number:!0},class:"is-fullwidth",options:t.toggleOptions},null,8,["modelValue","options"])])])])]),p("div",Lhe,[p("div",Dhe,[p("label",Nhe,[me(" DTerm Dynamic Min "),Y(o,{entry:"filter.dterm_dynamic_min"})])]),p("div",Fhe,[p("div",Uhe,[p("div",$he,[Ye(p("input",{id:"dterm-dynamic-min","onUpdate:modelValue":e[10]||(e[10]=l=>t.profile.filter.dterm_dynamic_min=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[st,t.profile.filter.dterm_dynamic_min,void 0,{number:!0}]])])])])]),p("div",Bhe,[p("div",Hhe,[p("label",Ghe,[me(" DTerm Dynamic Max "),Y(o,{entry:"filter.dterm_dynamic_max"})])]),p("div",zhe,[p("div",Vhe,[p("div",Whe,[Ye(p("input",{id:"dterm-dynamic-max","onUpdate:modelValue":e[11]||(e[11]=l=>t.profile.filter.dterm_dynamic_max=l),class:"input",type:"number",step:"5",min:"0"},null,512),[[st,t.profile.filter.dterm_dynamic_max,void 0,{number:!0}]])])])])])])):ze("",!0)])):ze("",!0)])])])}const qhe=lt(yde,[["render",jhe]]),Yhe=it({name:"ThrottleSettings",components:{LineChart:Nx},setup(){return{profile:Jt()}},data(){return{plot:{labels:["Throttle"],axis:[{label:"Throttle",data:[]}]}}},watch:{"profile.rate.throttle_expo"(){this.update()},"profile.rate.throttle_mid"(){this.update()}},methods:{constrainf(t,e,n){return t>n?n:tt.profile.rate.throttle_mid=l)},null,512),[[st,t.profile.rate.throttle_mid,void 0,{number:!0}]])])])])]),p("div",afe,[p("div",lfe,[p("label",cfe,[me(" Throttle Expo "),Y(o,{entry:"rate.throttle_expo"})])]),p("div",ufe,[p("div",dfe,[p("div",hfe,[Ye(p("input",{class:"input",step:"0.01",id:"throttle_expo",type:"number",min:"0",max:"1","onUpdate:modelValue":e[1]||(e[1]=l=>t.profile.rate.throttle_expo=l)},null,512),[[st,t.profile.rate.throttle_expo,void 0,{number:!0}]])])])])])]),p("div",ffe,[Y(a,{title:"Throttle",labels:t.plot.labels,axis:t.plot.axis},null,8,["labels","axis"])])])])])])}const mfe=lt(Yhe,[["render",pfe]]),gfe=it({name:"Rate",components:{StickRates:Ble,PIDRates:vde,FilterSettings:qhe,StickRatesLegacy:$ce,ThrottleSettings:mfe},setup(){return{profile:Jt(),default_profile:jf()}}}),_fe={class:"columns is-multiline"},vfe={class:"column is-12"},yfe={key:0,class:"column is-12"},bfe={class:"column is-12"},wfe={class:"column is-12"};function xfe(t,e,n,s,i,r){const o=Oe("StickRatesLegacy"),a=Oe("StickRates"),l=Oe("ThrottleSettings"),c=Oe("PIDRates"),u=Oe("FilterSettings");return Z(),ie("div",_fe,[p("div",vfe,[t.default_profile.has_legacy_stickrates?(Z(),en(o,{key:0})):(Z(),en(a,{key:1}))]),t.profile.profileVersionGt("0.2.0")?(Z(),ie("div",yfe,[Y(l)])):ze("",!0),p("div",bfe,[Y(c)]),p("div",wfe,[Y(u)])])}const Sfe=lt(gfe,[["render",xfe]]);var pP={exports:{}},mP={exports:{}};(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(n,s){return n<>>32-s},rotr:function(n,s){return n<<32-s|n>>>s},endian:function(n){if(n.constructor==Number)return e.rotl(n,8)&16711935|e.rotl(n,24)&4278255360;for(var s=0;s0;n--)s.push(Math.floor(Math.random()*256));return s},bytesToWords:function(n){for(var s=[],i=0,r=0;i>>5]|=n[i]<<24-r%32;return s},wordsToBytes:function(n){for(var s=[],i=0;i>>5]>>>24-i%32&255);return s},bytesToHex:function(n){for(var s=[],i=0;i>>4).toString(16)),s.push((n[i]&15).toString(16));return s.join("")},hexToBytes:function(n){for(var s=[],i=0;i>>6*(3-o)&63)):s.push("=");return s.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var s=[],i=0,r=0;i>>6-r*2);return s}};mP.exports=e})();var Efe=mP.exports,Ky={utf8:{stringToBytes:function(t){return Ky.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Ky.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n + * @license MIT + */var Tfe=function(t){return t!=null&&(gP(t)||Afe(t)||!!t._isBuffer)};function gP(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Afe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&gP(t.slice(0,0))}(function(){var t=Efe,e=D3.utf8,n=Tfe,s=D3.bin,i=function(r,o){r.constructor==String?o&&o.encoding==="binary"?r=s.stringToBytes(r):r=e.stringToBytes(r):n(r)?r=Array.prototype.slice.call(r,0):!Array.isArray(r)&&r.constructor!==Uint8Array&&(r=r.toString());for(var a=t.bytesToWords(r),l=r.length*8,c=1732584193,u=-271733879,d=-1732584194,h=271733878,f=0;f>>24)&16711935|(a[f]<<24|a[f]>>>8)&4278255360;a[l>>>5]|=128<>>9<<4)+14]=l;for(var v=i._ff,_=i._gg,m=i._hh,g=i._ii,f=0;f>>0,u=u+b>>>0,d=d+w>>>0,h=h+T>>>0}return t.endian([c,u,d,h])};i._ff=function(r,o,a,l,c,u,d){var h=r+(o&a|~o&l)+(c>>>0)+d;return(h<>>32-u)+o},i._gg=function(r,o,a,l,c,u,d){var h=r+(o&l|a&~l)+(c>>>0)+d;return(h<>>32-u)+o},i._hh=function(r,o,a,l,c,u,d){var h=r+(o^a^l)+(c>>>0)+d;return(h<>>32-u)+o},i._ii=function(r,o,a,l,c,u,d){var h=r+(a^(o|~l))+(c>>>0)+d;return(h<>>32-u)+o},i._blocksize=16,i._digestsize=16,pP.exports=function(r,o){if(r==null)throw new Error("Illegal argument "+r);var a=t.wordsToBytes(i(r,o));return o&&o.asBytes?a:o&&o.asString?s.bytesToString(a):t.bytesToHex(a)}})();var Mfe=pP.exports;const _P=fd(Mfe),Rfe=it({name:"ReceiverSettings",data(){return{serialProto:0,elrsBindPhraseInput:""}},setup(){return{profile:Jt(),info:An(),bind:rx(),state:js(),root:vn()}},computed:{...uw(Xa,{serialProtoNames:t=>ns(t.RXSerialProtocol).getKeys(),serialProtoOptions:t=>ns(t.RXSerialProtocol).getKeys().map((e,n)=>({value:n,text:n==0?"AUTO":e})),RXProtocol:t=>t.RXProtocol,protoNames:t=>ns(t.RXProtocol).getKeys(),lqiSourceNames:t=>ns(t.LQISource).getKeys().map((e,n)=>({value:n,text:e}))}),date(){return new Date(this.profile.meta.datetime*1e3)},rx_protocol(){return this.profile.receiver.protocol||this.info.rx_protocol},protocolOptions(){return(this.info.rx_protocols||[]).filter(t=>t>0).map(t=>({value:t,text:this.protoNames[t]}))},isSpiProtocol(){return[this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol)},protoStatus(){return[this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.EXPRESS_LRS,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol)?["RX_STATUS_NONE","RX_STATUS_BINDING","RX_STATUS_BOUND"][this.state.rx_status]:""},serialProtoStatus(){let t=0;return this.state.rx_status>=100&&this.state.rx_status<200?t=this.state.rx_status-100:this.state.rx_status>=200&&this.state.rx_status<300&&(t=this.state.rx_status-200),this.state.rx_status>=200&&this.state.rx_status<300?this.serialProtoNames[t]+" detected":"trying "+this.serialProtoNames[t]},elrsBindPhrase(){var t,e,n;return(n=(e=(t=this.bind)==null?void 0:t.info)==null?void 0:e.raw)==null?void 0:n.slice(1,7).join(", ")},elrsSwitchMode(){var t,e;return(e=(t=this.bind)==null?void 0:t.info)!=null&&e.raw[8]?"Hybrid Switches":"Wide Switches"},downloadAnchor(){return this.$refs.downloadAnchor},fileRef(){return this.$refs.file}},watch:{"profile.receiver.protocol"(){this.reset()}},methods:{async applyBindInfo(t){await this.profile.apply_profile(this.profile.$state),await this.bind.apply_bind_info(t)},parseHexString(t){const e=[];for(;t.length>=2;)e.push(parseInt(t.substring(0,2),16)),t=t.substring(2,t.length);return e},applyElrsBindPhrase(t){var i;const e=_P(`-DMY_BINDING_PHRASE="${t}"`),n=this.parseHexString(e).slice(0,6),s={...(i=this.bind)==null?void 0:i.info};s.bind_saved=1,s.raw[0]=1;for(let r=0;r<6;r++)s.raw[r+1]=n[r];return s.raw[7]=55,this.applyBindInfo(s)},applySerialBindInfo(){var n;this.serialProto==0&&this.state.rx_status>=200&&(this.serialProto=this.state.rx_status-200);const t=this.serialProto,e={...(n=this.bind)==null?void 0:n.info};for(let s=0;s0?1:0,e.raw[0]=t,this.applyBindInfo(e)},downloadBindData(){const t=window.btoa(String.fromCharCode(...new Uint8Array(this.bind.info.raw))),n="data:application/octet-stream;charset=utf-8,"+encodeURIComponent(t),s=this.date.toISOString().substring(0,10),r=`BindData_${this.profile.meta.name.replace(/\0/g,"")}_${s}.base64`;this.downloadAnchor.setAttribute("href",n),this.downloadAnchor.setAttribute("download",r),this.downloadAnchor.click()},uploadBindData(){const t=new FileReader;t.addEventListener("load",e=>{var s,i;const n={...(s=this.bind)==null?void 0:s.info};n.bind_saved=1,n.raw=Uint8Array.from(window.atob((i=e==null?void 0:e.target)==null?void 0:i.result),r=>r.charCodeAt(0)),this.applyBindInfo(n)}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},reset(){var e;const t={...(e=this.bind)==null?void 0:e.info};t.bind_saved=0;for(let n=0;n=200&&(this.serialProto=this.state.rx_status-200))}}),kfe={class:"card"},Cfe={class:"card-header"},Pfe=p("p",{class:"card-header-title"},"Receiver",-1),Ofe={class:"card-content"},Ife={class:"content field-is-2"},Lfe={class:"field is-horizontal"},Dfe={class:"field-label"},Nfe={class:"label"},Ffe={class:"field-body"},Ufe={class:"field"},$fe={class:"control is-expanded"},Bfe={class:"field is-horizontal"},Hfe={class:"field-label"},Gfe={class:"label"},zfe={class:"field-body"},Vfe={class:"field"},Wfe={class:"control is-expanded"},jfe={class:"field is-horizontal"},qfe={class:"field-label"},Yfe={class:"label"},Xfe={class:"field-body"},Kfe={class:"field"},Zfe={class:"control is-expanded"},Jfe={class:"field is-horizontal"},Qfe=p("div",{class:"field-label"},[p("label",{class:"label"},"RSSI")],-1),epe={class:"field-body"},tpe={class:"field"},npe={class:"control is-expanded"},spe={key:0,class:"card mt-4"},ipe=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Serial Protocol")],-1),rpe={class:"card-content"},ope={key:0,class:"content"},ape={class:"field is-horizontal"},lpe=p("div",{class:"field-label"},[p("label",{class:"label"}," Protocol ")],-1),cpe={class:"field-body"},upe={class:"field"},dpe={class:"control is-expanded"},hpe={key:0,class:"field is-horizontal"},fpe=p("div",{class:"field-label"},[p("label",{class:"label"},"Status")],-1),ppe={class:"field-body"},mpe={class:"field"},gpe={class:"control is-expanded"},_pe={key:1,class:"content has-text-centered"},vpe={class:"card-footer"},ype=p("span",{class:"card-footer-item"},null,-1),bpe={key:1,class:"card mt-4"},wpe=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"ExpressLRS")],-1),xpe={class:"card-content"},Spe={class:"field is-horizontal"},Epe=p("div",{class:"field-label"},[p("label",{class:"label"},"Status")],-1),Tpe={class:"field-body"},Ape={class:"field"},Mpe={class:"control is-expanded"},Rpe={class:"content"},kpe={class:"field is-horizontal"},Cpe=p("div",{class:"field-label"},[p("label",{class:"label"},"Switch Mode")],-1),Ppe={class:"field-body"},Ope={class:"field"},Ipe={class:"control is-expanded"},Lpe={class:"field is-horizontal"},Dpe=p("div",{class:"field-label"},[p("label",{class:"label"},"Current Bind Phrase")],-1),Npe={class:"field-body"},Fpe={class:"field"},Upe={class:"control is-expanded"},$pe={class:"field is-horizontal"},Bpe=p("div",{class:"field-label"},[p("label",{class:"label"},"New Bind Phrase")],-1),Hpe={class:"field-body"},Gpe={class:"field"},zpe={class:"control is-expanded"},Vpe={class:"card-footer"},Wpe=p("span",{class:"card-footer-item"},null,-1),jpe={key:2,class:"card mt-4"},qpe=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Bind Data")],-1),Ype={class:"card-content"},Xpe={class:"field is-horizontal"},Kpe=p("div",{class:"field-label"},[p("label",{class:"label"},"Status")],-1),Zpe={class:"field-body"},Jpe={class:"field"},Qpe={class:"control is-expanded"},eme=p("div",{class:"content has-text-centered"},[me(" Save and load bind information for spi protocols."),p("br"),me(" Requires reboot after load. ")],-1),tme={class:"card-footer"},nme={class:"input",accept:".base64",type:"file",ref:"file",style:{display:"none"}},sme={ref:"downloadAnchor",target:"_blank"};function ime(t,e,n,s,i,r){const o=Oe("spinner-btn"),a=Oe("tooltip"),l=Oe("input-select");return Z(),ie("div",kfe,[p("header",Cfe,[Pfe,Y(o,{class:"card-header-button is-warning",onClick:t.reset},{default:nt(()=>[me(" Reset ")]),_:1},8,["onClick"])]),p("div",Ofe,[p("div",Ife,[p("div",Lfe,[p("div",Dfe,[p("label",Nfe,[me(" Protocol "),Y(a,{entry:"receiver.protocol"})])]),p("div",Ffe,[p("div",Ufe,[p("div",$fe,[Y(l,{class:"is-fullwidth",modelValue:t.profile.receiver.protocol,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.receiver.protocol=c),modelModifiers:{number:!0},options:t.protocolOptions},null,8,["modelValue","options"])])])])]),p("div",Bfe,[p("div",Hfe,[p("label",Gfe,[me(" LQI Source "),Y(a,{entry:"receiver.lqi_source"})])]),p("div",zfe,[p("div",Vfe,[p("div",Wfe,[Y(l,{class:"is-fullwidth",modelValue:t.profile.receiver.lqi_source,"onUpdate:modelValue":e[1]||(e[1]=c=>t.profile.receiver.lqi_source=c),modelModifiers:{number:!0},options:t.lqiSourceNames},null,8,["modelValue","options"])])])])]),p("div",jfe,[p("div",qfe,[p("label",Yfe,[me(" Bind Saved "),Y(a,{entry:"receiver.bind_saved"})])]),p("div",Xfe,[p("div",Kfe,[p("div",Zfe,Be(t.bind.info.bind_saved?"yes":"no"),1)])])]),p("div",Jfe,[Qfe,p("div",epe,[p("div",tpe,[p("div",npe,Be(t.state.rx_rssi),1)])])]),t.bind.info.raw&&t.rx_protocol==t.RXProtocol.UNIFIED_SERIAL?(Z(),ie("div",spe,[ipe,p("div",rpe,[t.profile.serial.rx?(Z(),ie("div",ope,[p("div",ape,[lpe,p("div",cpe,[p("div",upe,[p("div",dpe,[Y(l,{class:"is-fullwidth",modelValue:t.serialProto,"onUpdate:modelValue":e[2]||(e[2]=c=>t.serialProto=c),modelModifiers:{number:!0},options:t.serialProtoOptions},null,8,["modelValue","options"])])])])]),t.serialProto==0?(Z(),ie("div",hpe,[fpe,p("div",ppe,[p("div",mpe,[p("div",gpe,Be(t.serialProtoStatus),1)])])])):ze("",!0)])):(Z(),ie("div",_pe," No rx serial port selected. Check setup tab. "))]),p("footer",vpe,[ype,Y(o,{class:"card-footer-item",onClick:e[3]||(e[3]=c=>t.applySerialBindInfo())},{default:nt(()=>[me(" Apply ")]),_:1})])])):ze("",!0),t.bind.info.raw&&t.rx_protocol==t.RXProtocol.EXPRESS_LRS?(Z(),ie("div",bpe,[wpe,p("div",xpe,[p("div",Spe,[Epe,p("div",Tpe,[p("div",Ape,[p("div",Mpe,Be(t.protoStatus),1)])])]),p("div",Rpe,[p("div",kpe,[Cpe,p("div",Ppe,[p("div",Ope,[p("div",Ipe,Be(t.elrsSwitchMode),1)])])]),p("div",Lpe,[Dpe,p("div",Npe,[p("div",Fpe,[p("div",Upe,Be(t.elrsBindPhrase),1)])])]),p("div",$pe,[Bpe,p("div",Hpe,[p("div",Gpe,[p("div",zpe,[Ye(p("input",{class:"input",id:"name",type:"text","onUpdate:modelValue":e[4]||(e[4]=c=>t.elrsBindPhraseInput=c)},null,512),[[st,t.elrsBindPhraseInput]])])])])])])]),p("footer",Vpe,[Wpe,Y(o,{class:"card-footer-item",onClick:e[5]||(e[5]=c=>t.applyElrsBindPhrase(t.elrsBindPhraseInput)),disabled:t.elrsBindPhraseInput.length<2},{default:nt(()=>[me(" Apply ")]),_:1},8,["disabled"])])])):ze("",!0),t.bind.info.raw&&t.isSpiProtocol?(Z(),ie("div",jpe,[qpe,p("div",Ype,[p("div",Xpe,[Kpe,p("div",Zpe,[p("div",Jpe,[p("div",Qpe,Be(t.protoStatus),1)])])]),eme]),p("footer",tme,[Y(o,{class:"card-footer-item",onClick:t.downloadBindData},{default:nt(()=>[me(" Save Bind Data ")]),_:1},8,["onClick"]),Y(o,{class:"card-footer-item",onClick:t.uploadBindData},{default:nt(()=>[me(" Load Bind Data ")]),_:1},8,["onClick"])]),p("input",nme,null,512),p("a",sme,null,512)])):ze("",!0)])])])}const rme=lt(Rfe,[["render",ime]]),ome=it({name:"ReceiverSettingsLegacy",data(){return{lqiSourceNames:[{value:0,text:"PACKET_RATE"},{value:1,text:"CHANNEL"},{value:2,text:"DIRECT"}],elrsBindPhraseInput:""}},setup(){return{profile:Jt(),info:An(),bind:rx(),state:js(),root:vn()}},computed:{...uw(Xa,{serialProtoNames:t=>ns(t.RXSerialProtocol).getKeys(),RXProtocol:t=>t.RXProtocol}),date(){return new Date(this.profile.meta.datetime*1e3)},protoNames(){return ns(this.RXProtocol).getKeys()},rx_protocol(){return this.profile.receiver.protocol||this.info.rx_protocol},protocolOptions(){return(this.info.rx_protocols||[]).filter(t=>t>0).map(t=>({value:t,text:this.protoNames[t]}))},serialProto(){return this.serialProtoNames.reduce((t,e,n)=>(t[e]=n,t),{})},isSpiProtocol(){return[this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol)},protoStatus(){if([this.RXProtocol.FRSKY_D8,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_FCC,this.RXProtocol.FRSKY_D16||this.RXProtocol.FRSKY_D16_LBT,this.RXProtocol.REDPINE,this.RXProtocol.EXPRESS_LRS,this.RXProtocol.FLYSKY_AFHDS,this.RXProtocol.FLYSKY_AFHDS2A].includes(this.rx_protocol))return["RX_STATUS_NONE","RX_STATUS_BINDING","RX_STATUS_BOUND"][this.state.rx_status];if(this.rx_protocol==this.RXProtocol.UNIFIED_SERIAL){if(this.state.rx_status<100)return"RX_STATUS_NONE";if(this.state.rx_status>=100&&this.state.rx_status<200)return"RX_STATUS_DETECTING";if(this.state.rx_status>=200&&this.state.rx_status<300)return"RX_STATUS_DETECTED"}return""},serialProtoStatus(){let t=0;return this.state.rx_status>=100&&this.state.rx_status<200?t=this.state.rx_status-100:this.state.rx_status>=200&&this.state.rx_status<300&&(t=this.state.rx_status-200),this.serialProtoNames[t]},elrsBindPhrase(){var t,e,n;return(n=(e=(t=this.bind)==null?void 0:t.info)==null?void 0:e.raw)==null?void 0:n.slice(1,7).join(", ")},elrsSwitchMode(){var t,e;return(e=(t=this.bind)==null?void 0:t.info)!=null&&e.raw[8]?"Hybrid Switches":"Wide Switches"},downloadAnchor(){return this.$refs.downloadAnchor},fileRef(){return this.$refs.file}},watch:{"profile.receiver.protocol"(){this.reset()}},methods:{async applyBindInfo(t){await this.profile.apply_profile(this.profile.$state),await this.bind.apply_bind_info(t)},parseHexString(t){const e=[];for(;t.length>=2;)e.push(parseInt(t.substring(0,2),16)),t=t.substring(2,t.length);return e},apply_elrs_bind_phrase(t){var i;const e=_P(`-DMY_BINDING_PHRASE="${t}"`),n=this.parseHexString(e).slice(0,6),s={...(i=this.bind)==null?void 0:i.info};s.bind_saved=1,s.raw[0]=1;for(let r=0;r<6;r++)s.raw[r+1]=n[r];return s.raw[7]=55,this.applyBindInfo(s)},downloadBindData(){const t=window.btoa(String.fromCharCode(...new Uint8Array(this.bind.info.raw))),n="data:application/octet-stream;charset=utf-8,"+encodeURIComponent(t),s=this.date.toISOString().substring(0,10),r=`BindData_${this.profile.meta.name.replace(/\0/g,"")}_${s}.base64`;this.downloadAnchor.setAttribute("href",n),this.downloadAnchor.setAttribute("download",r),this.downloadAnchor.click()},uploadBindData(){const t=new FileReader;t.addEventListener("load",e=>{var s,i;const n={...(s=this.bind)==null?void 0:s.info};n.bind_saved=1,n.raw=Uint8Array.from(window.atob((i=e==null?void 0:e.target)==null?void 0:i.result),r=>r.charCodeAt(0)),this.applyBindInfo(n)}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},reset(){var e;const t={...(e=this.bind)==null?void 0:e.info};t.bind_saved=0;for(let n=0;n[me("Reset")]),_:1},8,["onClick"])]),p("div",ume,[p("div",dme,[t.info.rx_protocol&&!t.profile.receiver.protocol?(Z(),ie("div",hme,[p("div",fme,[p("label",pme,[me(" Protocol "),Y(a,{entry:"receiver.protocol"})])]),p("div",mme,[p("div",gme,[p("div",_me,Be(t.protoNames[t.info.rx_protocol]),1)])])])):ze("",!0),t.profile.receiver.protocol?(Z(),ie("div",vme,[p("div",yme,[p("label",bme,[me(" Protocol "),Y(a,{entry:"receiver.protocol"})])]),p("div",wme,[p("div",xme,[p("div",Sme,[Y(l,{class:"is-fullwidth",modelValue:t.profile.receiver.protocol,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.receiver.protocol=c),modelModifiers:{number:!0},options:t.protocolOptions},null,8,["modelValue","options"])])])])])):ze("",!0),t.info.quic_protocol_version>3?(Z(),ie("div",Eme,[p("div",Tme,[p("label",Ame,[me(" LQI Source "),Y(a,{entry:"receiver.lqi_source"})])]),p("div",Mme,[p("div",Rme,[p("div",kme,[Y(l,{class:"is-fullwidth",modelValue:t.profile.receiver.lqi_source,"onUpdate:modelValue":e[1]||(e[1]=c=>t.profile.receiver.lqi_source=c),modelModifiers:{number:!0},options:t.lqiSourceNames},null,8,["modelValue","options"])])])])])):ze("",!0),t.info.quic_protocol_version>2?(Z(),ie("div",Cme,[p("div",Pme,[p("label",Ome,[me(" Bind Saved "),Y(a,{entry:"receiver.bind_saved"})])]),p("div",Ime,[p("div",Lme,[p("div",Dme,Be(t.bind.info.bind_saved?"yes":"no"),1)])])])):ze("",!0),t.info.quic_protocol_version>2?(Z(),ie("div",Nme,[Fme,p("div",Ume,[p("div",$me,[p("div",Bme,Be(t.state.rx_rssi),1)])])])):ze("",!0),t.info.quic_protocol_version>2?(Z(),ie("div",Hme,[Gme,p("div",zme,[p("div",Vme,[p("div",Wme,Be(t.protoStatus),1)])])])):ze("",!0),t.info.quic_protocol_version>2&&t.rx_protocol==t.RXProtocol.UNIFIED_SERIAL?(Z(),ie("div",jme,[qme,p("div",Yme,[p("div",Xme,[p("div",Kme,Be(t.serialProtoStatus),1)])])])):ze("",!0),t.bind.info.raw&&t.rx_protocol==t.RXProtocol.EXPRESS_LRS?(Z(),ie("div",Zme,[Jme,p("div",Qme,[p("div",ege,[p("div",tge,[nge,p("div",sge,[p("div",ige,[p("div",rge,Be(t.elrsSwitchMode),1)])])]),p("div",oge,[age,p("div",lge,[p("div",cge,[p("div",uge,Be(t.elrsBindPhrase),1)])])]),p("div",dge,[hge,p("div",fge,[p("div",pge,[p("div",mge,[Ye(p("input",{class:"input",id:"name",type:"text","onUpdate:modelValue":e[2]||(e[2]=c=>t.elrsBindPhraseInput=c)},null,512),[[st,t.elrsBindPhraseInput]])])])])])])]),p("footer",gge,[_ge,Y(o,{class:"card-footer-item",onClick:e[3]||(e[3]=c=>t.apply_elrs_bind_phrase(t.elrsBindPhraseInput)),disabled:t.elrsBindPhraseInput.length<2},{default:nt(()=>[me(" Apply ")]),_:1},8,["disabled"])])])):ze("",!0),t.bind.info.raw&&t.isSpiProtocol?(Z(),ie("div",vge,[yge,bge,p("footer",wge,[Y(o,{class:"card-footer-item",onClick:t.downloadBindData},{default:nt(()=>[me(" Save Bind Data ")]),_:1},8,["onClick"]),Y(o,{class:"card-footer-item",onClick:t.uploadBindData},{default:nt(()=>[me(" Load Bind Data ")]),_:1},8,["onClick"])]),p("input",xge,null,512),p("a",Sge,null,512)])):ze("",!0),Ege])])])}const Age=lt(ome,[["render",Tge]]),Mge=it({name:"RCChannels",setup(){return{root:vn(),state:js(),profile:Jt()}},data(){return{timerCount:0,timerTimeout:0,receiverChannelMappingOptions:[{value:0,text:"AETR"},{value:1,text:"TAER"}],channelNames:["Roll","Pitch","Yaw","Throttle"],wizardStates:["","Succeeded","Failed","","Recording, move sticks to extents","Testing calibration, move sticks again to extents","",""]}},computed:{channelStyle(){return this.state.rx_filtered.map((t,e)=>{if(e==3)return{"margin-left":"0%",width:2+Math.abs(t)*98+"%"};const n=2+Math.abs(t)*49;return{"margin-left":t<0?51-n+"%":"49%",width:n+"%"}})}},watch:{timerCount:{handler(t){clearTimeout(this.timerTimeout),t>0&&(this.timerTimeout=window.setTimeout(()=>{this.timerCount--},1e3))},immediate:!0},"state.stick_calibration_wizard":{handler(t){switch(t){case Jc.STICK_WIZARD_SUCCESS:case Jc.STICK_WIZARD_FAILED:this.timerCount=0,setTimeout(()=>this.profile.fetch_profile(),500);break;case Jc.STICK_WIZARD_CAPTURE_STICKS:case Jc.STICK_WIZARD_WAIT_FOR_CONFIRM:this.timerCount=19;break}},immediate:!0}}}),ip=t=>(dd("data-v-24202b3e"),t=t(),hd(),t),Rge={class:"card"},kge=ip(()=>p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"RC Channels")],-1)),Cge={class:"card-content"},Pge={class:"content"},Oge={class:"field field-is-2 is-horizontal mb-6"},Ige={class:"field-label"},Lge={class:"label"},Dge={class:"field-body"},Nge={class:"field"},Fge={class:"control is-expanded"},Uge={class:"field-label",style:{"align-self":"unset"}},$ge={class:"label"},Bge={class:"field-body"},Hge={class:"field has-addons"},Gge={class:"control my-0"},zge=["id","onUpdate:modelValue"],Vge=ip(()=>p("p",{class:"control"},[p("a",{class:"button is-small is-static"}," min ")],-1)),Wge={class:"field has-addons"},jge={class:"control my-0"},qge=["id","onUpdate:modelValue"],Yge=ip(()=>p("p",{class:"control"},[p("a",{class:"button is-small is-static"}," max ")],-1)),Xge={class:"column is-6 py-0"},Kge={class:"channel-container"},Zge={class:"columns mt-5"},Jge={class:"column is-8 wizard"},Qge=ip(()=>p("br",null,null,-1)),e_e=ip(()=>p("br",null,null,-1)),t_e={key:0},n_e={class:"column is-4"};function s_e(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select"),l=Oe("spinner-btn");return Z(),ie("div",Rge,[kge,p("div",Cge,[p("div",Pge,[p("div",Oge,[p("div",Ige,[p("label",Lge,[me(" Channel Mapping "),Y(o,{entry:"receiver.channel_mapping"})])]),p("div",Dge,[p("div",Nge,[p("div",Fge,[Y(a,{modelValue:t.profile.receiver.channel_mapping,"onUpdate:modelValue":e[0]||(e[0]=c=>t.profile.receiver.channel_mapping=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.receiverChannelMappingOptions},null,8,["modelValue","options"])])])])]),(Z(!0),ie(ot,null,qt(t.channelStyle,(c,u)=>(Z(),ie("div",{key:"channel-"+u,class:"field is-horizontal"},[p("div",Uge,[p("label",$ge,Be(t.channelNames[u]),1)]),p("div",Bge,[p("div",Hge,[p("p",Gge,[Ye(p("input",{id:`limit-${t.channelNames[u]}-min`,"onUpdate:modelValue":d=>t.profile.receiver.stick_calibration_limits[u].min=d,class:"input is-small",type:"number",step:"0.1"},null,8,zge),[[st,t.profile.receiver.stick_calibration_limits[u].min,void 0,{number:!0}]])]),Vge]),p("div",Wge,[p("p",jge,[Ye(p("input",{id:`limit-${t.channelNames[u]}-max`,"onUpdate:modelValue":d=>t.profile.receiver.stick_calibration_limits[u].max=d,class:"input is-small",type:"number",step:"0.1"},null,8,qge),[[st,t.profile.receiver.stick_calibration_limits[u].max,void 0,{number:!0}]])]),Yge])]),p("div",Xge,[p("div",Kge,[p("div",{class:"channel-bar",style:b_(c)},Be(Math.floor(t.state.rx_filtered[u]*(u!=3?50:100))),5)])])]))),128)),p("div",Zge,[p("div",Jge,[me(" Stick Calibration Wizard "),Qge,me(" "+Be(t.wizardStates[t.state.stick_calibration_wizard])+" ",1),e_e,t.timerCount?(Z(),ie("span",t_e,"Continuing in "+Be(t.timerCount)+"s..",1)):ze("",!0)]),p("div",n_e,[Y(l,{class:"is-pulled-right is-primary",onClick:e[1]||(e[1]=c=>t.root.cal_sticks())},{default:nt(()=>[me(" Calibrate ")]),_:1})])])])])])}const i_e=lt(Mge,[["render",s_e],["__scopeId","data-v-24202b3e"]]),r_e=it({name:"AuxChannels",setup(){return{state:js(),profile:Jt()}},computed:{...uw(Xa,{auxChannels:t=>ns(t.AuxChannels).map((e,n)=>({text:n,value:e})),auxFunctions:t=>ns(t.AuxFunctions).getKeys().map((e,n)=>({index:n,key:e})).filter(e=>!e.key.startsWith("_"))})},methods:{valueForIndex(t){return this.state.aux[t]},classForIndex(t){return this.profile.receiver.aux?this.profile.receiver.aux[t]==12?"text-danger":this.profile.receiver.aux[t]==13||this.valueForIndex(this.profile.receiver.aux[t])?"text-success":"":""}}}),o_e={class:"card"},a_e=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Aux Channels")],-1),l_e={class:"card-content"},c_e={class:"content"},u_e={class:"columns"},d_e={class:"column is-8"},h_e={class:"field-label"},f_e=["for"],p_e={class:"field-body"},m_e={class:"field"},g_e={class:"control is-expanded"},__e={class:"column is-4"},v_e={class:"card"},y_e=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Current AUX State")],-1),b_e={class:"card-content"},w_e={class:"content"},x_e={class:"column is-6 py-1"};function S_e(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select");return Z(),ie("div",o_e,[a_e,p("div",l_e,[p("div",c_e,[p("div",u_e,[p("div",d_e,[(Z(!0),ie(ot,null,qt(t.auxFunctions,l=>(Z(),ie("div",{key:l.key,class:"field field-is-3 is-horizontal mr-4"},[p("div",h_e,[p("label",{class:ms(["label",t.classForIndex(l.index)]),for:l.key},[me(Be(l.key)+" ",1),Y(o,{entry:"channel."+l.key.toLowerCase()},null,8,["entry"])],10,f_e)]),p("div",p_e,[p("div",m_e,[p("div",g_e,[Y(a,{id:l.key,modelValue:t.profile.receiver.aux[l.index],"onUpdate:modelValue":c=>t.profile.receiver.aux[l.index]=c,modelModifiers:{number:!0},class:"is-fullwidth",options:t.auxChannels},null,8,["id","modelValue","onUpdate:modelValue","options"])])])])]))),128))]),p("div",__e,[p("div",v_e,[y_e,p("div",b_e,[p("div",w_e,[(Z(!0),ie(ot,null,qt(t.auxChannels,(l,c)=>(Z(),ie("div",{key:l.text,class:"columns"},[p("div",x_e,Be(l.text),1),p("div",{class:ms(["column is-6 py-1",t.valueForIndex(c)?"text-success":"text-danger"])},Be(t.valueForIndex(c)?"ON":"OFF"),3)]))),128))])])])])])])])])}const E_e=lt(r_e,[["render",S_e]]),T_e=it({name:"Receiver",components:{ReceiverSettings:rme,ReceiverSettingsLegacy:Age,RCChannels:i_e,AuxChannels:E_e},setup(){return{info:An()}}}),A_e={class:"columns is-multiline"},M_e={class:"column is-12"},R_e={key:0,class:"column is-12"},k_e={class:"column is-12"};function C_e(t,e,n,s,i,r){const o=Oe("ReceiverSettings"),a=Oe("ReceiverSettingsLegacy"),l=Oe("RCChannels"),c=Oe("AuxChannels");return Z(),ie("div",A_e,[p("div",M_e,[t.info.quicVersionGt("0.1.0")?(Z(),en(o,{key:0})):(Z(),en(a,{key:1}))]),t.info.quicVersionGt("0.1.0")?(Z(),ie("div",R_e,[Y(l)])):ze("",!0),p("div",k_e,[Y(c)])])}const P_e=lt(T_e,[["render",C_e]]);var Ie;let Lt=(Ie=class{static pixelsWidth(e,n=Ie.BORDER,s=!1){return s&&(n=0),e*(Ie.CHAR_WIDTH*(s?2:1)+n)+n}static pixelsHeight(e,n=Ie.BORDER,s=!1){return s&&(n=0),e*(Ie.CHAR_HEIGHT*(s?2:1)+n)+n}static elementDecode(e,n){switch(n){case"active":return e&1;case"invert":return e>>1&1;case"pos_x":return e>>2&255;case"pos_y":return e>>10&255;default:return 0}}static elementEncode(e,n,s){switch(n){case"active":return s?e|1:e&-2;case"invert":return s?e|2:e&-3;case"pos_x":return e&-1021|(s&255)<<2;case"pos_y":return e&-261121|(s&255)<<10;default:return e}}static unpackFont(e,n){return Ie.unpackFontCanvas(e,n),e.toDataURL()}static unpackFontBitmap(e,n=!1){const s=new global.OffscreenCanvas(209,305);return Ie.unpackFontCanvas(s,e,n),s.transferToImageBitmap()}static unpackFontCanvas(e,n,s=!1){const i=e.getContext("2d");i.clearRect(0,0,e.width,e.height),i.fillStyle="red",i.fillRect(0,0,Ie.FULL_WIDTH,Ie.FULL_HEIGHT);const r=new Uint8ClampedArray(Ie.CHAR_WIDTH*Ie.CHAR_HEIGHT*4);for(let o=0;o>6&3,s),Ie.setPixel(r,c+1,u,h>>4&3,s),Ie.setPixel(r,c+2,u,h>>2&3,s),Ie.setPixel(r,c+3,u,h>>0&3,s),c+=4,c==Ie.CHAR_WIDTH&&(c=0,u++);const d=new ImageData(r,Ie.CHAR_WIDTH,Ie.CHAR_HEIGHT);i.putImageData(d,Ie.pixelsWidth(a),Ie.pixelsHeight(o))}}static packCanvas(e){const n=e.getImageData(0,0,Ie.FULL_WIDTH,Ie.FULL_HEIGHT),s=[];for(let i=0;i0&&(i|=2),e[(s*Ie.FULL_WIDTH+n)*4+3]<255&&(i|=1),i}},Te(Ie,"CHAR_WIDTH",12),Te(Ie,"CHAR_HEIGHT",18),Te(Ie,"BORDER",1),Te(Ie,"FONT_WIDTH",16),Te(Ie,"FONT_HEIGHT",16),Te(Ie,"FULL_WIDTH",Ie.pixelsWidth(Ie.FONT_WIDTH)),Te(Ie,"FULL_HEIGHT",Ie.pixelsHeight(Ie.FONT_HEIGHT)),Te(Ie,"LOGO_HEIGHT",4),Te(Ie,"LOGO_WIDTH",24),Te(Ie,"LOGO_FULL_WIDTH",Ie.pixelsWidth(Ie.LOGO_WIDTH,0)),Te(Ie,"LOGO_FULL_HEIGHT",Ie.pixelsHeight(Ie.LOGO_HEIGHT,0)),Ie);const vP=ys("osd",{state:()=>({font_raw:void 0,font_bitmap:void 0,font_bitmap_inverted:void 0}),actions:{async fetch_sd_osd_font(){if(!An().quicVersionGte("0.2.0"))return Et.get(xn.OSDFont).then(n=>{this.font_raw=n,this.font_bitmap=Lt.unpackFontBitmap(n),this.font_bitmap_inverted=Lt.unpackFontBitmap(n,!0)});const e=[];for(let n=0;n<256;n++){const s=await Et.command(Jn.OSD,cy.ReadChar,n);e[n]=s.payload[0]}this.font_raw=e,this.font_bitmap=Lt.unpackFontBitmap(e),this.font_bitmap_inverted=Lt.unpackFontBitmap(e,!0)},async apply_font(t){if(!An().quicVersionGte("0.2.0"))return Et.set(xn.OSDFont,...t);for(let n=0;n<256;n++)await Et.command(Jn.OSD,cy.WriteChar,n,t[n])},fetch_hd_osd_font(){return new Promise((t,e)=>{const n=new Image;n.onload=()=>{t(n)},n.src="osd/hdzero_quic.png"}).then(t=>createImageBitmap(t)).then(t=>{this.font_raw=void 0,this.font_bitmap=t,this.font_bitmap_inverted=void 0})}}});function O_e(t,e,n,s,i,r){return s<2*r&&(r=s/2),i<2*r&&(r=i/2),t.beginPath(),t.moveTo(e+r,n),t.arcTo(e+s,n,e+s,n+i,r),t.arcTo(e+s,n+i,e,n+i,r),t.arcTo(e,n+i,e,n,r),t.arcTo(e,n,e+s,n,r),t.closePath(),t}const I_e=it({name:"OSDElements",setup(){return{profile:Jt(),osd:vP()}},data(){return{preview:"NTSC",drag:{element:-1,colOffset:0,coord:{x:0,y:0}}}},computed:{is_hd(){return this.profile.serial.hdzero>0},currentElements(){return this.is_hd?this.profile.osd.elements_hd:this.profile.osd.elements},limits(){return{width:this.is_hd?50:30,height:this.is_hd?18:15}},screen(){const t={...this.limits};return!this.is_hd&&this.preview=="NTSC"&&(t.height-=2),t},canvas(){return this.$refs.canvas},canvasWidth(){return this.screen.width*Lt.CHAR_WIDTH},canvasHeight(){return this.screen.height*Lt.CHAR_HEIGHT},elementOptions(){const t=[{name:"CALLSIGN",enabled:!0,text:this.profile.osd.callsign},{name:"CELL COUNT",enabled:!0,text:"1S"},{name:"FUELGAUGE VOLTS",enabled:!0,text:" 4.3p"},{name:"FILTERED VOLTS",enabled:!0,text:" 4.3"},{name:"GYRO TEMP",enabled:!0,text:" 40"},{name:"FLIGHT MODE",enabled:!0,text:" ACRO "},{name:"RSSI",enabled:!0,text:" 90"},{name:"STOPWATCH",enabled:!0,text:"01:20"},{name:"SYSTEM STATUS",enabled:!0,text:" **FAILSAFE** "},{name:"THROTTLE",enabled:!0,text:" 50"},{name:"VTX CHANNEL",enabled:!0,text:"R:7:1"},{name:"CURRENT",enabled:!0,text:"0.00š"}];return this.profile.profileVersionGt("0.2.2")&&t.push({name:"CROSSHAIR",enabled:!0,text:"rst"}),this.profile.profileVersionGt("0.2.3")&&t.push({name:"CURRENT DRAWN",enabled:!0,text:"0.00\x07"}),t},elements(){return this.currentElements.filter((t,e)=>this.elementOptions[e]).map((t,e)=>({index:e,...this.elementOptions[e],active:Lt.elementDecode(t,"active"),invert:Lt.elementDecode(t,"invert"),pos:{x:Lt.elementDecode(t,"pos_x"),y:Lt.elementDecode(t,"pos_y")},value:t}))},callsign:{set(t){let e=t.toUpperCase();for(let n=t.length;n<36;n++)e+="\0";this.profile.osd.callsign=e},get(){return this.profile.osd.callsign.replace(/\0/g,"")}}},watch:{elements(){this.draw_canvas()},drag(){this.draw_canvas()},canvasWidth(){this.$nextTick(()=>{this.draw_canvas()})},canvasHeight(){this.$nextTick(()=>{this.draw_canvas()})},"osd.font_bitmap"(){this.$nextTick(()=>{this.draw_canvas()})}},methods:{translateMouse(t){return{x:t.offsetX*(this.canvasWidth/this.canvas.clientWidth),y:t.offsetY*(this.canvasHeight/this.canvas.clientHeight)}},translateElemement(t){return!this.is_hd&&this.preview=="NTSC"&&t.y>12&&(t.y-=2),{x:t.x*Lt.CHAR_WIDTH,y:Lt.CHAR_HEIGHT-2+(t.y-1)*Lt.CHAR_HEIGHT}},normalizeCoords(t,e=0){return{x:Math.min(Math.max(Math.floor((t.x-e)/Lt.CHAR_WIDTH),0),this.limits.width-1),y:Math.min(Math.max(Math.floor(t.y/Lt.CHAR_HEIGHT),0),this.limits.height-1)}},drag_start(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t),n=this.findElement(e);if(n!=null){const s=this.translateElemement(n.pos),i=e.x-s.x;this.drag={element:n.index,colOffset:i,coord:this.normalizeCoords(e,i)},this.canvas.style.cursor="grab"}},drag_move(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t);if(this.drag.element==-1){const n=this.findElement(e);this.canvas.style.cursor=n!=null?"pointer":"initial";return}this.drag={...this.drag,coord:this.normalizeCoords(e,this.drag.colOffset)}},drag_drop(t){t.preventDefault(),t.stopPropagation();const e=this.translateMouse(t);if(this.drag.element==-1)return;const n=this.normalizeCoords(e,this.drag.colOffset);this.osd_set(this.drag.element,"pos_x",n.x),this.osd_set(this.drag.element,"pos_y",n.y),this.canvas.style.cursor="initial",this.drag={element:-1,colOffset:0,coord:{x:0,y:0}}},osd_set(t,e,n){const s=this.is_hd?this.profile.osd.elements_hd:this.profile.osd.elements,i=[...s];i[t]=Lt.elementEncode(s[t],e,n),this.is_hd?this.profile.set_osd_elements_hd(i):this.profile.set_osd_elements(i)},draw_canvas_text(t,e,n,s){let i=0;for(let r=0;rn.y+Lt.CHAR_HEIGHT)continue;let s=e.text.indexOf("\0");if(s==-1&&(s=e.text.length),!(t.xn.x+s*Lt.CHAR_WIDTH))return e}return null}},mounted(){Promise.resolve().then(()=>{if(this.is_hd)return this.osd.fetch_hd_osd_font()}).then(t=>this.draw_canvas())}}),T0=t=>(dd("data-v-b2099b6e"),t=t(),hd(),t),L_e={class:"card"},D_e={class:"card-header"},N_e=T0(()=>p("p",{class:"card-header-title"},"Elements",-1)),F_e={class:"card-content"},U_e={class:"content"},$_e={class:"columns is-multiline"},B_e={class:"column is-6"},H_e={class:"field field-is-2 is-horizontal"},G_e=T0(()=>p("div",{class:"field-label"},[p("label",{class:"label"}," Callsign Text ")],-1)),z_e={class:"field-body"},V_e={class:"field"},W_e={class:"control is-expanded"},j_e=Ya('
Element
Active
Invert
X
Y
',1),q_e={key:0,class:"field mb-2 field-is-2 is-horizontal"},Y_e={class:"field-label"},X_e={class:"label",for:"pid-preset"},K_e={class:"field-body"},Z_e={class:"field"},J_e={class:"control is-expanded"},Q_e=["id","name","checked","onInput"],e0e=["for"],t0e={class:"field"},n0e={class:"control is-expanded"},s0e=["id","name","checked","onInput"],i0e=["for"],r0e={class:"field",style:{"align-self":"center"}},o0e={class:"control is-expanded"},a0e=["value","max","onInput"],l0e={class:"field",style:{"align-self":"center"}},c0e={class:"control is-expanded"},u0e=["value","max","onInput"],d0e={class:"column is-6"},h0e={class:"card"},f0e={class:"card-header"},p0e={class:"card-header-title"},m0e={key:0,class:"select ml-4"},g0e=T0(()=>p("option",null,"NTSC",-1)),_0e=T0(()=>p("option",null,"PAL",-1)),v0e=[g0e,_0e],y0e={class:"card-content"},b0e={class:"content"},w0e=["width","height"];function x0e(t,e,n,s,i,r){const o=Oe("tooltip");return Z(),ie("div",L_e,[p("header",D_e,[N_e,Y(o,{class:"card-header-icon",entry:"osd.elements",size:"lg"})]),p("div",F_e,[p("div",U_e,[p("div",$_e,[p("div",B_e,[p("div",H_e,[G_e,p("div",z_e,[p("div",V_e,[p("div",W_e,[Ye(p("input",{class:"input",type:"text","onUpdate:modelValue":e[0]||(e[0]=a=>t.callsign=a)},null,512),[[st,t.callsign]])])])])]),j_e,(Z(!0),ie(ot,null,qt(t.elements,(a,l)=>(Z(),ie(ot,{key:l},[a.enabled?(Z(),ie("div",q_e,[p("div",Y_e,[p("label",X_e,Be(a.name),1)]),p("div",K_e,[p("div",Z_e,[p("div",J_e,[p("input",{id:"active-"+l,name:"active-"+l,type:"checkbox",class:"switch",checked:a.active==1,onInput:c=>t.osd_set(l,"active",!a.active)},null,40,Q_e),p("label",{class:"py-0",style:{height:"2em"},for:"active-"+l},null,8,e0e)])]),p("div",t0e,[p("div",n0e,[p("input",{id:"invert-"+l,name:"invert-"+l,type:"checkbox",class:"switch",checked:a.invert==1,onInput:c=>t.osd_set(l,"invert",!a.invert)},null,40,s0e),p("label",{class:"py-0",style:{height:"2em"},for:"invert-"+l},null,8,i0e)])]),p("div",r0e,[p("div",o0e,[p("input",{class:"input",type:"number",step:"1",value:a.pos.x,min:"0",max:t.limits.width-1,onInput:c=>{var u;return t.osd_set(l,"pos_x",(u=c==null?void 0:c.target)==null?void 0:u.value)}},null,40,a0e)])]),p("div",l0e,[p("div",c0e,[p("input",{class:"input",type:"number",step:"1",value:a.pos.y,min:"0",max:t.limits.height-1,onInput:c=>{var u;return t.osd_set(l,"pos_y",(u=c==null?void 0:c.target)==null?void 0:u.value)}},null,40,u0e)])])])])):ze("",!0)],64))),128))]),p("div",d0e,[p("div",h0e,[p("header",f0e,[p("div",p0e,[me(" Preview "),t.is_hd?ze("",!0):(Z(),ie("div",m0e,[Ye(p("select",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.preview=a)},v0e,512),[[L_,t.preview]])]))])]),p("div",y0e,[p("div",b0e,[p("canvas",{width:t.canvasWidth,height:t.canvasHeight,ref:"canvas",class:"osd-canvas",onMousedown:e[2]||(e[2]=(...a)=>t.drag_start&&t.drag_start(...a)),onMousemove:e[3]||(e[3]=(...a)=>t.drag_move&&t.drag_move(...a)),onMouseup:e[4]||(e[4]=(...a)=>t.drag_drop&&t.drag_drop(...a)),onMouseleave:e[5]||(e[5]=(...a)=>t.drag_drop&&t.drag_drop(...a))},null,40,w0e)])])])])])])])])}const S0e=lt(I_e,[["render",x0e],["__scopeId","data-v-b2099b6e"]]),E0e=it({name:"OSDElementsLegacy",setup(){return{profile:Jt()}},data(){return{screen:{width:28,height:14,char_width:12,char_height:18},imageSource:null}},computed:{svg_width(){return this.screen.width*this.screen.char_width},svg_height(){return this.screen.height*this.screen.char_height},viewBox(){return`0 0 ${this.svg_width} ${this.svg_height}`},callsign:{get(){return this.profile.osd.elements.slice(1,5).flatMap(t=>[0,8,16,24].map(e=>{const n=t>>e&255;return n==63?"":String.fromCharCode(n)})).join("")},set(t){const e=t.toUpperCase(),n=Array(20).fill(63).map((i,r)=>r{const a=Math.floor(o/4),l=[0,8,16,24][o%4];return i[a]=i[a]|(r&255)<this.element_options[e]).map((t,e)=>({...this.element_options[e],active:this.osd_decode(t,"active"),invert:this.osd_decode(t,"invert"),pos_x:this.osd_decode(t,"pos_x"),pos_y:this.osd_decode(t,"pos_y"),value:t}))}},methods:{osd_set(t,e,n){const s=[...this.profile.osd.elements];s[t]=this.osd_encode(this.profile.osd.elements[t],e,n),this.profile.set_osd_elements(s)},osd_decode(t,e){switch(e){case"active":return t&1;case"invert":return t>>1&1;case"pos_x":return t>>2&31;case"pos_y":return t>>7&15;default:return 0}},osd_encode(t,e,n){switch(e){case"active":return n?t|1:t&-2;case"invert":return n?t|2:t&-3;case"pos_x":return t&-125|(n&31)<<2;case"pos_y":return t&-1921|(n&15)<<7;default:return t}}}}),Fx=t=>(dd("data-v-e98f51a9"),t=t(),hd(),t),T0e={class:"card"},A0e={class:"card-header"},M0e=Fx(()=>p("p",{class:"card-header-title"},"Elements",-1)),R0e={class:"card-content"},k0e={class:"content"},C0e={class:"columns is-multiline"},P0e={class:"column is-6"},O0e={class:"field field-is-2 is-horizontal"},I0e=Fx(()=>p("div",{class:"field-label"},[p("label",{class:"label"}," Callsign Text ")],-1)),L0e={class:"field-body"},D0e={class:"field"},N0e={class:"control is-expanded"},F0e=Ya('
Element
Active
Invert
X
Y
',1),U0e={key:0,class:"field mb-2 field-is-2 is-horizontal"},$0e={class:"field-label"},B0e={class:"label",for:"pid-preset"},H0e={class:"field-body"},G0e={class:"field"},z0e={class:"control is-expanded"},V0e=["id","name","checked","onInput"],W0e=["for"],j0e={class:"field"},q0e={class:"control is-expanded"},Y0e=["id","name","checked","onInput"],X0e=["for"],K0e={class:"field",style:{"align-self":"center"}},Z0e={class:"control is-expanded"},J0e=["value","onInput"],Q0e={class:"field",style:{"align-self":"center"}},e1e={class:"control is-expanded"},t1e=["value","onInput"],n1e={class:"column is-6"},s1e={class:"card"},i1e=Fx(()=>p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Preview")],-1)),r1e={class:"card-content"},o1e={class:"content"},a1e=["viewBox"],l1e={key:0},c1e=["x","y"];function u1e(t,e,n,s,i,r){const o=Oe("tooltip");return Z(),ie("div",T0e,[p("header",A0e,[M0e,Y(o,{class:"card-header-icon",entry:"osd.elements",size:"lg"})]),p("div",R0e,[p("div",k0e,[p("div",C0e,[p("div",P0e,[p("div",O0e,[I0e,p("div",L0e,[p("div",D0e,[p("div",N0e,[Ye(p("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>t.callsign=a),class:"input",type:"text"},null,512),[[st,t.callsign]])])])])]),F0e,(Z(!0),ie(ot,null,qt(t.elements,(a,l)=>(Z(),ie(ot,{key:l},[a.enabled?(Z(),ie("div",U0e,[p("div",$0e,[p("label",B0e,Be(a.name),1)]),p("div",H0e,[p("div",G0e,[p("div",z0e,[p("input",{id:"active-"+l,name:"active-"+l,type:"checkbox",class:"switch",checked:a.active==1,onInput:c=>t.osd_set(l,"active",!a.active)},null,40,V0e),p("label",{class:"py-0",style:{height:"2em"},for:"active-"+l},null,8,W0e)])]),p("div",j0e,[p("div",q0e,[p("input",{id:"invert-"+l,name:"invert-"+l,type:"checkbox",class:"switch",checked:a.invert==1,onInput:c=>t.osd_set(l,"invert",!a.invert)},null,40,Y0e),p("label",{class:"py-0",style:{height:"2em"},for:"invert-"+l},null,8,X0e)])]),p("div",K0e,[p("div",Z0e,[p("input",{class:"input",type:"number",step:"1",value:a.pos_x,onInput:c=>{var u;return t.osd_set(l,"pos_x",(u=c==null?void 0:c.target)==null?void 0:u.value)}},null,40,J0e)])]),p("div",Q0e,[p("div",e1e,[p("input",{class:"input",type:"number",step:"1",value:a.pos_y,onInput:c=>{var u;return t.osd_set(l,"pos_y",(u=c==null?void 0:c.target)==null?void 0:u.value)}},null,40,t1e)])])])])):ze("",!0)],64))),128))]),p("div",n1e,[p("div",s1e,[i1e,p("div",r1e,[p("div",o1e,[(Z(),ie("svg",{viewBox:t.viewBox,xmlns:"http://www.w3.org/2000/svg"},[(Z(!0),ie(ot,null,qt(t.elements,(a,l)=>(Z(),ie("g",{key:l},[a.enabled&&a.active?(Z(),ie("g",l1e,[(Z(!0),ie(ot,null,qt(a.text,(c,u)=>(Z(),ie("text",{key:"el-"+l+"-"+u,class:ms({"text-invert":a.invert}),x:(a.pos_x+u)*t.screen.char_width,y:a.pos_y*(t.screen.char_height-1)},Be(c),11,c1e))),128))])):ze("",!0)]))),128))],8,a1e))])])])])])])])])}const d1e=lt(E0e,[["render",u1e],["__scopeId","data-v-e98f51a9"]]),h1e=t=>new Promise((e,n)=>{const s=new Image;s.onload=()=>e(s),s.onerror=i=>n(i),s.src=t}),f1e=it({name:"OSDFont",data(){return{fontFiles:[{text:"betaflight",value:"betaflight.png"},{text:"bold",value:"bold.png"},{text:"clarity",value:"clarity.png"},{text:"default",value:"default.png"},{text:"digital",value:"digital.png"},{text:"extra_large",value:"extra_large.png"},{text:"impact_mini",value:"impact_mini.png"},{text:"impact",value:"impact.png"},{text:"large",value:"large.png"},{text:"vision",value:"vision.png"}],current_font_file:"clarity.png",imageSource:void 0}},setup(){return{root:vn(),profile:Jt(),osd:vP()}},methods:{apply_osd_font(t){return h1e("osd/"+t).then(e=>{const n=Lt.packFont(this.$refs.canvas,e);return this.osd.apply_font(n)}).then(()=>this.get_osd_font()).then(()=>this.root.append_alert({type:"success",msg:"Font updated!"})).catch(()=>{this.root.append_alert({type:"danger",msg:"Font update failed!"})})},async get_osd_font(){await this.osd.fetch_sd_osd_font(),this.imageSource=Lt.unpackFont(this.$refs.canvas,this.osd.font_raw)},uploadLogo(){const t=n=>new Promise((s,i)=>{const r=new FileReader;r.onerror=i,r.onabort=i,r.onload=o=>{var l;const a=new Image;a.onerror=i,a.onabort=i,a.onload=function(){s(a)},a.src=((l=o==null?void 0:o.target)==null?void 0:l.result)||""},r.readAsDataURL(n)});return(async()=>{const n={types:[{description:"Images",accept:{"image/*":[".png"]}}],excludeAcceptAllOption:!0,multiple:!1},[s]=await window.showOpenFilePicker(n);return await s.getFile()})().then(n=>t(n)).then(n=>{if(n.width!=288&&n.height!=72)throw new Error("Invalid logo dimensions");const s=Lt.packLogo(this.$refs.canvas,this.$refs.logoCanvas,n);return this.osd.apply_font(s)}).then(()=>this.get_osd_font()).then(()=>this.root.append_alert({type:"success",msg:"Logo updated!"})).catch(n=>{this.root.append_alert({type:"danger",msg:"Logo update failed! "+n.message})}).finally(()=>this.$refs.form.reset())}},created(){this.get_osd_font()}}),p1e={class:"card"},m1e={class:"card-header"},g1e=p("p",{class:"card-header-title"},"Font",-1),_1e={class:"card-content"},v1e={class:"content"},y1e={class:"field field-is-4 is-horizontal"},b1e=p("div",{class:"field-label"},[p("label",{class:"label"}," Full OSD font to upload ")],-1),w1e={class:"field-body"},x1e={class:"field has-addons"},S1e={class:"control is-expanded"},E1e={class:"control"},T1e={ref:"form"},A1e={class:"field field-is-4 is-horizontal"},M1e=p("div",{class:"field-label"},[p("label",{class:"label"},[me(" Custom Logo "),p("br"),me(" 288x72 Black/White/Transparent PNG ")])],-1),R1e={class:"field-body"},k1e={class:"field has-addons"},C1e=p("p",{class:"control is-expanded"},null,-1),P1e={class:"control"},O1e={class:"columns mt-5"},I1e={class:"column is-6"},L1e={class:"card"},D1e=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Preview")],-1),N1e={class:"card-content"},F1e={class:"content"},U1e={class:"image m-0"},$1e=["src"],B1e={class:"column is-6"},H1e={class:"card"},G1e=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Current")],-1),z1e={class:"card-content"},V1e={class:"content"},W1e={class:"image m-0"},j1e=["src"],q1e={ref:"canvas",class:"mx-5 mt-3 is-hidden",width:"209",height:"305"},Y1e={ref:"logoCanvas",class:"mx-5 mt-3 is-hidden",width:"288",height:"72"};function X1e(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select"),l=Oe("spinner-btn");return Z(),ie("div",p1e,[p("header",m1e,[g1e,Y(o,{class:"card-header-icon",entry:"osd.font",size:"lg"})]),p("div",_1e,[p("div",v1e,[p("div",y1e,[b1e,p("div",w1e,[p("div",x1e,[p("p",S1e,[Y(a,{id:"font-file",class:"is-fullwidth",modelValue:t.current_font_file,"onUpdate:modelValue":e[0]||(e[0]=c=>t.current_font_file=c),options:t.fontFiles},null,8,["modelValue","options"])]),p("p",E1e,[Y(l,{class:"float-right",onClick:e[1]||(e[1]=c=>t.apply_osd_font(t.current_font_file))},{default:nt(()=>[me(" Upload Font ")]),_:1})])])])]),p("form",T1e,[p("div",A1e,[M1e,p("div",R1e,[p("div",k1e,[C1e,p("p",P1e,[Y(l,{onClick:e[2]||(e[2]=c=>t.uploadLogo())},{default:nt(()=>[me(" Upload Logo ")]),_:1})])])])])],512),p("div",O1e,[p("div",I1e,[p("div",L1e,[D1e,p("div",N1e,[p("div",F1e,[p("figure",U1e,[p("img",{src:"osd/"+t.current_font_file},null,8,$1e)])])])])]),p("div",B1e,[p("div",H1e,[G1e,p("div",z1e,[p("div",V1e,[p("figure",W1e,[p("img",{src:t.imageSource},null,8,j1e)]),p("canvas",q1e,null,512),p("canvas",Y1e,null,512)])])])])])])])])}const K1e=lt(f1e,[["render",X1e]]),Z1e=it({name:"OSD",components:{OSDElements:S0e,OSDElementsLegacy:d1e,OSDFont:K1e},setup(){return{profile:Jt(),default_profile:jf()}},computed:{is_hd(){return this.profile.serial.hdzero}}}),J1e={class:"columns is-multiline"},Q1e={class:"column is-12"},eve={class:"column is-12"};function tve(t,e,n,s,i,r){const o=Oe("OSDElementsLegacy"),a=Oe("OSDElements"),l=Oe("OSDFont");return Z(),ie("div",J1e,[p("div",Q1e,[t.default_profile.has_legacy_osd?(Z(),en(o,{key:0})):(Z(),en(a,{key:1}))]),p("div",eve,[t.is_hd?ze("",!0):(Z(),en(l,{key:0}))])])}const nve=lt(Z1e,[["render",tve]]),A0=ys("motor",{state:()=>({loading:!1,test:{active:0,value:new Array},settings:null,_pins:[{index:1,id:"MOTOR_FL",label:"Front Left"},{index:3,id:"MOTOR_FR",label:"Front Right"},{index:0,id:"MOTOR_BL",label:"Back Left"},{index:2,id:"MOTOR_BR",label:"Back Right"}]}),getters:{pins(t){const e=Jt();return t._pins.map(n=>({...n,pin:e.motor.motor_pins[n.index]}))}},actions:{fetch_motor_test(){return Et.command(Jn.Motor,_h.TestStatus).then(t=>{this.test=t.payload[0]})},fetch_motor_settings(){const t=vn();return this.loading=!0,Et.get(xn.BLHeliSettings).then(e=>{this.settings=e}).catch(e=>{t.append_alert({type:"danger",msg:"Loading motor settings failed!"}),ct.error("motor",e)}).finally(()=>{this.loading=!1})},apply_motor_settings(t){const e=vn();return this.loading=!0,Et.set(xn.BLHeliSettings,...t).then(()=>{this.settings=t,e.append_alert({type:"success",msg:"Motor settings applied!"})}).catch(n=>{ct.error("motor",n),e.append_alert({type:"danger",msg:"Failed to apply motor settings!"})}).finally(()=>{this.loading=!1})},async motor_test_toggle(){return await this.fetch_motor_test(),Et.command(Jn.Motor,this.test.active?_h.TestDisable:_h.TestEnable).then(()=>{this.test.active=this.test.active?0:1})},motor_test_set_value(t){return Et.command(Jn.Motor,_h.TestSetValue,t).then(e=>{this.test.value=e.payload[0]})}}}),sve=it({name:"MotorTest",setup(){return{motor:A0(),state:js()}},computed:{value(){return this.motor.test.value.map(t=>(t<0&&(t=0),t*100))}},created(){this.motor.fetch_motor_test()},methods:{update(){return this.motor.motor_test_set_value(this.value.map(t=>t/100))}}}),ive={key:0,class:"card"},rve={class:"card-header"},ove=p("p",{class:"card-header-title"},"Motor Test",-1),ave={class:"card-header-icon"},lve=p("br",null,null,-1),cve={class:"card-content"},uve={class:"content"},dve={key:0,class:"columns is-multiline"},hve={class:"field field-is-2 is-horizontal"},fve={class:"field-label"},pve={class:"label",for:"pid-preset"},mve={class:"field-body"},gve={class:"field has-addons"},_ve={class:"control is-expanded"},vve=["id","onUpdate:modelValue"],yve={class:"control"},bve=["id","onUpdate:modelValue"],wve={key:1,class:"is-size-5 has-text-centered has-text-weight-semibold"},xve={class:"card-footer"},Sve=p("span",{class:"card-footer-item"},null,-1),Eve=p("span",{class:"card-footer-item"},null,-1);function Tve(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("spinner-btn");return t.motor.test?(Z(),ie("div",ive,[p("header",rve,[ove,p("small",ave,[me(Be(t.state.vbat.toFixed(2))+"V ",1),lve,me(" "+Be(t.state.ibat_filtered.toFixed(2))+"mA ",1)]),Y(o,{class:"card-header-icon",entry:"motor.test",size:"lg"})]),p("div",cve,[p("div",uve,[t.motor.test.active?(Z(),ie("div",dve,[(Z(!0),ie(ot,null,qt(t.motor.pins,l=>(Z(),ie("div",{key:l.index,class:"column is-6"},[p("div",hve,[p("div",fve,[p("label",pve,Be(l.label),1)]),p("div",mve,[p("div",gve,[p("div",_ve,[Ye(p("input",{id:l.id,"onUpdate:modelValue":c=>t.value[l.index]=c,class:"input",type:"range",step:"1",min:"0",max:"50",onInput:e[0]||(e[0]=c=>t.update())},null,40,vve),[[st,t.value[l.index],void 0,{number:!0}]])]),p("div",yve,[Ye(p("input",{id:l.id,"onUpdate:modelValue":c=>t.value[l.index]=c,class:"input",type:"number",step:"1",min:"0",max:"50",onChange:e[1]||(e[1]=c=>t.update())},null,40,bve),[[st,t.value[l.index],void 0,{number:!0}]])])])])])]))),128))])):(Z(),ie("div",wve," Motor Test disabled "))])]),p("footer",xve,[Sve,Eve,Y(a,{class:"card-footer-item",onClick:e[2]||(e[2]=l=>t.motor.motor_test_toggle())},{default:nt(()=>[me(Be(t.motor.test.active?"Disable":"Enable"),1)]),_:1})])])):ze("",!0)}const Ave=lt(sve,[["render",Tve]]),Mve=it({name:"MotorPins",setup(){return{motor:A0(),target:Td(),profile:Jt()}},computed:{motorPins(){return this.target.motor_pin_names.map((t,e)=>({value:e,text:`Pin ${e} (${t})`}))}}}),Rve={class:"card"},kve={class:"card-header"},Cve=p("p",{class:"card-header-title"},"Motor Pins",-1),Pve={class:"card-content"},Ove={class:"content"},Ive={class:"columns is-multiline my-2"},Lve={class:"field field-is-2 is-horizontal"},Dve={class:"field-label"},Nve={class:"label",for:"pid-profile"},Fve=p("br",null,null,-1),Uve={class:"text-muted"},$ve={class:"field-body"},Bve={class:"field"},Hve={class:"control is-expanded"};function Gve(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select");return Z(),ie("div",Rve,[p("header",kve,[Cve,Y(o,{class:"card-header-icon",entry:"motor_pins",size:"lg"})]),p("div",Pve,[p("div",Ove,[p("div",Ive,[(Z(!0),ie(ot,null,qt(t.motor.pins,l=>(Z(),ie("div",{key:"motor-pin-"+l.index,class:"column is-6"},[p("div",Lve,[p("div",Dve,[p("label",Nve,[me(Be(l.label)+" ",1),Fve,p("span",Uve,"Motor "+Be(l.index),1)])]),p("div",$ve,[p("div",Bve,[p("div",Hve,[Y(a,{id:"motor-pin-"+l.index,modelValue:t.profile.motor.motor_pins[l.index],"onUpdate:modelValue":c=>t.profile.motor.motor_pins[l.index]=c,class:"is-fullwidth",options:t.motorPins},null,8,["id","modelValue","onUpdate:modelValue","options"])])])])])]))),128))])])])])}const zve=lt(Mve,[["render",Gve]]),Vve=it({name:"ESCSettings",setup(){return{motor:A0(),info:An()}},data(){return{motor_direction_options:[{value:1,text:"Normal"},{value:2,text:"Reversed"},{value:3,text:"Bidirectional"},{value:4,text:"Bidirectional Reversed"}]}},methods:{trim(t){return t.replace(/#/g,"").replace(/\$/g," ")},mapPin(t){return zs.gt(this.info.quic_protocol_semver,"0.2.1")?t.index:t.pin}}}),Wve={class:"card"},jve={class:"card-header"},qve=p("p",{class:"card-header-title"},"ESC Settings",-1),Yve={class:"card-content"},Xve={class:"content"},Kve={key:0,class:"columns is-multiline"},Zve={class:"columns is-multiline my-2"},Jve={class:"column is-4"},Qve={class:"column is-8"},eye={class:"column is-4 pt-0 mt-0"},tye=["for"],nye={class:"column is-8 pt-0 mt-0"},sye={key:1,class:"is-size-5 has-text-centered has-text-weight-semibold"},iye={class:"card-footer"},rye=p("span",{class:"card-footer-item"},null,-1),oye=p("span",{class:"card-footer-item"},null,-1);function aye(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select"),l=Oe("spinner-btn");return Z(),ie("div",Wve,[p("header",jve,[qve,Y(o,{class:"card-header-icon",entry:"motor_settings",size:"lg"})]),p("div",Yve,[p("div",Xve,[t.motor.settings&&t.motor.settings.length?(Z(),ie("div",Kve,[(Z(!0),ie(ot,null,qt(t.motor.pins,c=>(Z(),ie("div",{key:"motor-settings-"+c.index,class:"column is-6 px-5"},[p("div",Zve,[p("div",Jve,[p("h6",null,Be(c.label),1)]),p("div",Qve,Be(t.trim(t.motor.settings[t.mapPin(c)].LAYOUT))+" - "+Be(t.trim(t.motor.settings[t.mapPin(c)].NAME))+", "+Be(t.motor.settings[t.mapPin(c)].MAIN_REVISION)+"."+Be(t.motor.settings[t.mapPin(c)].SUB_REVISION),1),p("div",eye,[p("label",{for:"motor-direction-"+c.index},"Direction",8,tye)]),p("div",nye,[Y(a,{id:"motor-direction-"+c.index,modelValue:t.motor.settings[t.mapPin(c)].MOTOR_DIRECTION,"onUpdate:modelValue":u=>t.motor.settings[t.mapPin(c)].MOTOR_DIRECTION=u,modelModifiers:{number:!0},options:t.motor_direction_options},null,8,["id","modelValue","onUpdate:modelValue","options"])])])]))),128))])):(Z(),ie("div",sye," Settings not loaded "))])]),p("footer",iye,[rye,oye,t.motor.settings&&t.motor.settings.length?(Z(),en(l,{key:0,class:"card-footer-item",disabled:t.motor.loading,onClick:e[0]||(e[0]=c=>t.motor.apply_motor_settings(t.motor.settings))},{default:nt(()=>[me(" Apply ")]),_:1},8,["disabled"])):(Z(),en(l,{key:1,class:"card-footer-item",disabled:t.motor.loading,onClick:e[1]||(e[1]=c=>t.motor.fetch_motor_settings())},{default:nt(()=>[me(" Load ")]),_:1},8,["disabled"]))])])}const lye=lt(Vve,[["render",aye]]),cye=it({name:"Motor",components:{MotorTest:Ave,MotorPins:zve,ESCSettings:lye},setup(){return{info:An(),constants:Xa()}}}),uye={class:"columns is-multiline"},dye={class:"column is-12"},hye={class:"column is-12"},fye={key:0,class:"column is-12"};function pye(t,e,n,s,i,r){const o=Oe("MotorTest"),a=Oe("MotorPins"),l=Oe("ESCSettings");return Z(),ie("div",uye,[p("div",dye,[Y(o)]),p("div",hye,[Y(a)]),t.info.has_feature(t.constants.Features.BRUSHLESS)?(Z(),ie("div",fye,[Y(l)])):ze("",!0)])}const mye=lt(cye,[["render",pye]]);function Kr(t){return e=>t*e*1/1e3*180/Math.PI}function wv(t){return e=>t+e}const gye=[{name:"loopIteration",blackbox_field:Ze.LOOP,advance:1,signed:!1},{name:"time",blackbox_field:Ze.TIME,advance:1,signed:!1},{name:"axisP",array_index:0,blackbox_field:Ze.PID_P_TERM,advance:0,signed:!0},{name:"axisP",array_index:1,blackbox_field:Ze.PID_P_TERM,advance:0,signed:!0},{name:"axisP",array_index:2,blackbox_field:Ze.PID_P_TERM,advance:1,signed:!0},{name:"axisI",array_index:0,blackbox_field:Ze.PID_I_TERM,advance:0,signed:!0},{name:"axisI",array_index:1,blackbox_field:Ze.PID_I_TERM,advance:0,signed:!0},{name:"axisI",array_index:2,blackbox_field:Ze.PID_I_TERM,advance:1,signed:!0},{name:"axisD",array_index:0,blackbox_field:Ze.PID_D_TERM,advance:0,signed:!0},{name:"axisD",array_index:1,blackbox_field:Ze.PID_D_TERM,advance:0,signed:!0},{name:"axisD",array_index:2,blackbox_field:Ze.PID_D_TERM,advance:1,signed:!0},{name:"rcCommand",array_index:0,signed:!0,blackbox_field:Ze.RX,advance:0,convert:t=>t/2},{name:"rcCommand",array_index:1,signed:!0,blackbox_field:Ze.RX,advance:0,convert:t=>t/2},{name:"rcCommand",array_index:2,signed:!0,blackbox_field:Ze.RX,advance:0,convert:t=>-t/2},{name:"rcCommand",array_index:3,signed:!0,blackbox_field:Ze.RX,advance:1,convert:wv(1e3)},{name:"setpoint",array_index:0,blackbox_field:Ze.SETPOINT,advance:0,signed:!0,convert:Kr(1)},{name:"setpoint",array_index:1,blackbox_field:Ze.SETPOINT,advance:0,signed:!0,convert:Kr(1)},{name:"setpoint",array_index:2,blackbox_field:Ze.SETPOINT,advance:0,signed:!0,convert:Kr(-1)},{name:"setpoint",array_index:3,blackbox_field:Ze.SETPOINT,advance:1,signed:!0},{name:"accRaw",array_index:0,blackbox_field:Ze.ACCEL_RAW,advance:0,signed:!0},{name:"accRaw",array_index:1,blackbox_field:Ze.ACCEL_RAW,advance:0,signed:!0},{name:"accRaw",array_index:2,blackbox_field:Ze.ACCEL_RAW,advance:1,signed:!0,convert:wv(1e3)},{name:"accSmooth",array_index:0,blackbox_field:Ze.ACCEL_FILTER,advance:0,signed:!0},{name:"accSmooth",array_index:1,blackbox_field:Ze.ACCEL_FILTER,advance:0,signed:!0},{name:"accSmooth",array_index:2,blackbox_field:Ze.ACCEL_FILTER,advance:1,signed:!0,convert:wv(1e3)},{name:"gyroRaw",array_index:0,blackbox_field:Ze.GYRO_RAW,advance:0,signed:!0,convert:Kr(1)},{name:"gyroRaw",array_index:1,blackbox_field:Ze.GYRO_RAW,advance:0,signed:!0,convert:Kr(1)},{name:"gyroRaw",array_index:2,blackbox_field:Ze.GYRO_RAW,advance:1,signed:!0,convert:Kr(-1)},{name:"gyroADC",array_index:0,blackbox_field:Ze.GYRO_FILTER,advance:0,signed:!0,convert:Kr(1)},{name:"gyroADC",array_index:1,blackbox_field:Ze.GYRO_FILTER,advance:0,signed:!0,convert:Kr(1)},{name:"gyroADC",array_index:2,blackbox_field:Ze.GYRO_FILTER,advance:1,signed:!0,convert:Kr(-1)},{name:"motor",array_index:0,blackbox_field:Ze.MOTOR,advance:0,signed:!0},{name:"motor",array_index:1,blackbox_field:Ze.MOTOR,advance:0,signed:!0},{name:"motor",array_index:2,blackbox_field:Ze.MOTOR,advance:0,signed:!0},{name:"motor",array_index:3,blackbox_field:Ze.MOTOR,advance:1,signed:!0},{name:"cpuload",blackbox_field:Ze.CPU_LOAD,advance:1,signed:!1},{name:"debug[0]",array_index:0,blackbox_field:Ze.DEBUG,advance:0,signed:!0},{name:"debug[1]",array_index:1,blackbox_field:Ze.DEBUG,advance:0,signed:!0},{name:"debug[2]",array_index:2,blackbox_field:Ze.DEBUG,advance:0,signed:!0},{name:"debug[3]",array_index:3,blackbox_field:Ze.DEBUG,advance:1,signed:!0}];let _ye=class{constructor(e){Te(this,"buffer",new yw);Te(this,"defs",gye);Te(this,"fieldflags");this.file=e,this.fieldflags=Ux(e.field_flags)}writeHeaders(e){this.writeHeaderRaw("Product","Blackbox flight data recorder by Nicholas Sherlock"),this.writeHeaderRaw("Data version","2"),this.writeHeaderRaw("Firmware type","Cleanflight"),this.writeHeaderRaw("Firmware revision","Betaflight 4.3.0"),this.writeHeaderRaw("gyro_scale","0x3f800000"),this.writeHeaderRaw("acc_1G","1000"),this.writeHeaderRaw("motorOutput","0,1000"),this.writeHeaderRaw("looptime",this.file.looptime.toString()),this.writeHeaderRaw("gyro_sync_denom","1"),this.writeHeaderRaw("pid_process_denom","1"),this.writeHeaderRaw("rates","78,78,78"),this.writeHeaderRaw("rates_type","3"),this.writeHeaderRaw("minthrottle","1000"),this.writeHeaderRaw("maxthrottle","2000"),this.writeHeaderRaw("gyro_notch_hz","0,0"),this.writeHeaderRaw("gyro_notch_cutoff","0,0"),this.writeHeaderRaw("Craft name",e.meta.name.replace(/\0/g,"")),this.writeHeaderRaw("rollPID",[e.pid.pid_rates[e.pid.pid_profile].kp[0],e.pid.pid_rates[e.pid.pid_profile].ki[0],e.pid.pid_rates[e.pid.pid_profile].kd[0]].join(",")),this.writeHeaderRaw("pitchPID",[e.pid.pid_rates[e.pid.pid_profile].kp[1],e.pid.pid_rates[e.pid.pid_profile].ki[1],e.pid.pid_rates[e.pid.pid_profile].kd[1]].join(",")),this.writeHeaderRaw("yawPID",[e.pid.pid_rates[e.pid.pid_profile].kp[2],e.pid.pid_rates[e.pid.pid_profile].ki[2],e.pid.pid_rates[e.pid.pid_profile].kd[2]].join(","));const n={1:0,2:2,3:3};e.filter.gyro[0].type>0&&(this.writeHeaderRaw("gyro_lpf1_type",n[e.filter.gyro[0].type].toString()),this.writeHeaderRaw("gyro_lpf1_static_hz",e.filter.gyro[0].cutoff_freq.toString())),e.filter.gyro[1].type>0&&(this.writeHeaderRaw("gyro_lpf2_type",n[e.filter.gyro[1].type].toString()),this.writeHeaderRaw("gyro_lpf2_static_hz",e.filter.gyro[1].cutoff_freq.toString())),e.filter.dterm[0].type>0&&(this.writeHeaderRaw("dterm_lpf1_type",n[e.filter.dterm[0].type].toString()),this.writeHeaderRaw("dterm_lpf1_static_hz",e.filter.dterm[0].cutoff_freq.toString())),e.filter.dterm_dynamic_enable&&this.writeHeaderRaw("dterm_lpf1_dyn_hz",[e.filter.dterm_dynamic_min,e.filter.dterm_dynamic_max].join(",")),e.filter.dterm[1].type>0&&(this.writeHeaderRaw("dterm_lpf2_type",n[e.filter.dterm[1].type].toString()),this.writeHeaderRaw("dterm_lpf2_static_hz",e.filter.dterm[1].cutoff_freq.toString())),this.writeHeaderRaw("I interval",""+this.file.blackbox_rate),this.writeHeaderRaw("P interval","1/"+this.file.blackbox_rate),this.writeHeaderJoin("Field I name",s=>{let i=s.name;return s.array_index!=null&&(i+="["+s.array_index+"]"),i}),this.writeHeaderJoin("Field I signed",s=>s.signed?"1":"0"),this.writeHeaderJoin("Field I predictor",s=>"0"),this.writeHeaderJoin("Field I encoding",s=>s.signed?"0":"1"),this.writeHeaderJoin("Field P predictor",s=>"0"),this.writeHeaderJoin("Field P encoding",s=>s.signed?"0":"1")}writeValue(e){if(!e[0]){ct.warn("blackbox","skipping blackbox entry");return}this.buffer.writeUint8(73);let n=1,s=0;for(const i of this.defs){if(n&this.fieldflags&1<127;)this.buffer.writeUint8((e&255|128)&255),e>>>=7;this.buffer.writeUint8(e)}writeSigned(e){const n=e<<1^e>>31;return this.writeUnsigned(n)}};const sa=["Roll","Pitch","Yaw"],N3=[...sa,"Throttle"],F3=t=>Array.from(Array(t).keys()).map(e=>e.toString()),Zy={[Ze.LOOP]:{name:"loop",title:"Loop",scale:1,unit:"none"},[Ze.TIME]:{name:"time",title:"Time",scale:1,unit:"us"},[Ze.PID_P_TERM]:{name:"pid_pterm",title:"PID P-Term",axis:sa,scale:1e3,unit:"none"},[Ze.PID_I_TERM]:{name:"pid_iterm",title:"PID I-Term",axis:sa,scale:1e3,unit:"none"},[Ze.PID_D_TERM]:{name:"pid_dterm",title:"PID D-Term",axis:sa,scale:1e3,unit:"none"},[Ze.RX]:{name:"rx",title:"RX",axis:N3,scale:1e3,unit:"none"},[Ze.SETPOINT]:{name:"setpoint",title:"Setpoint",axis:N3,scale:1e3,unit:"rad"},[Ze.ACCEL_RAW]:{name:"accel_raw",title:"Accel Raw",axis:sa,scale:1e3,unit:"rad"},[Ze.ACCEL_FILTER]:{name:"accel_filter",title:"Accel Filter",axis:sa,scale:1e3,unit:"rad"},[Ze.GYRO_RAW]:{name:"gyro_raw",title:"Gyro Raw",axis:sa,scale:1e3,unit:"rad"},[Ze.GYRO_FILTER]:{name:"gyro_filter",title:"Gyro Filter",axis:sa,scale:1e3,unit:"rad"},[Ze.MOTOR]:{name:"motor",title:"Motor",axis:F3(4),scale:1e3,unit:"none"},[Ze.CPU_LOAD]:{name:"cpu_load",title:"CPU Load",scale:1,unit:"us"},[Ze.DEBUG]:{name:"debug",title:"Debug",axis:F3(4),scale:1,unit:"none"}};function Ux(t){return(t??-1)|1<({busy:!1,speed:void 0,progress:void 0,list:{flash_size:0,files:[]},presets:[]}),actions:{reset_blackbox(){const t=vn();return Et.command(Jn.Blackbox,gh.Reset).then(()=>{t.append_alert({type:"success",msg:"Blackbox successfully reset"})}).catch(e=>{t.append_alert({type:"danger",msg:e})})},list_blackbox(){return Et.command(Jn.Blackbox,gh.List).then(t=>this.list=t.payload[0])},fetch_presets(){return Et.get(xn.BlackboxPresets).then(t=>this.presets=t)},download_blackbox_quic(t){const e=vn(),n=this.list.files[t],s=Ux(n.field_flags),i=performance.now();return Et.commandProgress(Jn.Blackbox,r=>{const o=(performance.now()-i)/1e3;this.progress=r/n.size,this.speed=r/o},gh.Get,t).then(r=>{const o=Object.keys(Zy).filter((c,u)=>(s&1<0).map(c=>Zy[c]),a={...n,fields:o,entries:r.payload};return"data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(a))}).then(r=>(e.append_alert({type:"success",msg:"Blackbox successfully downloaded!"}),r)).catch(r=>{throw e.append_alert({type:"danger",msg:"Blackbox download failed"}),r}).finally(()=>{this.progress=void 0,this.speed=void 0})},download_blackbox_btfl(t){const e=vn(),n=this.list.files[t],s=performance.now();return Et.commandProgress(Jn.Blackbox,i=>{const r=(performance.now()-s)/1e3;this.progress=i/n.size,this.speed=i/r},gh.Get,t).then(i=>{const r=Jt(),o=new _ye(n);o.writeHeaders(r);for(const a of i.payload)o.writeValue(a);return o.toUrl()}).then(i=>(e.append_alert({type:"success",msg:"Blackbox successfully downloaded!"}),i)).catch(i=>{throw e.append_alert({type:"danger",msg:"Blackbox download failed"}),i}).finally(()=>{this.progress=void 0,this.speed=void 0})}}}),vye=it({name:"blackbox",setup(){return{blackbox:yP(),profile:Jt(),state:js(),info:An()}},data(){return{current_preset:-1}},computed:{usedSize(){var t,e;return(((e=(t=this.blackbox)==null?void 0:t.list)==null?void 0:e.files)||[]).reduce((n,s)=>n+s.size,0)},blackboxRate(){return this.profile.blackbox.sample_rate_hz.toString()+" Hz"},blackboxFields(){const t=Ux(this.profile.blackbox.field_flags),e=ns(Ze).getEntries().map((n,s)=>({val:s,title:Zy[s].title,active:(t&1<0}));return e.every(n=>n.active)?["All"]:e.filter(n=>n.active).map(n=>n.title)},blackboxPresets(){return[{value:-1,text:"Choose..."},...this.blackbox.presets.map((t,e)=>({value:e,text:t.name}))]}},methods:{humanFileSize:vz,reset(){return this.blackbox.reset_blackbox().then(()=>this.blackbox.list_blackbox())},download_quic(t){return this.blackbox.download_blackbox_quic(t).then(e=>{const n=new Date().toISOString().substring(0,10),i=`${this.profile.meta.name.replace(/\0/g,"")}_${n}_file_${t}.json`;this.$refs.downloadAnchor.setAttribute("href",e),this.$refs.downloadAnchor.setAttribute("download",i),this.$refs.downloadAnchor.click()})},download_btfl(t){return this.blackbox.download_blackbox_btfl(t).then(e=>{const n=new Date().toISOString().substring(0,10),i=`${this.profile.meta.name.replace(/\0/g,"")}_${n}_file_${t}.bfl`;this.$refs.downloadAnchor.setAttribute("href",e),this.$refs.downloadAnchor.setAttribute("download",i),this.$refs.downloadAnchor.click()})},load_preset(t){this.profile.blackbox.field_flags=this.blackbox.presets[t].field_flags,this.profile.blackbox.sample_rate_hz=this.blackbox.presets[t].sample_rate_hz,this.current_preset=-1}},created(){this.blackbox.list_blackbox(),this.info.quicVersionGt("0.1.2")&&this.blackbox.fetch_presets()}}),yye={class:"columns is-multiline"},bye={class:"column is-12"},wye={key:0,class:"card"},xye=p("div",{class:"card-header"},[p("p",{class:"card-header-title"},"Blackbox Settings")],-1),Sye={class:"card-content"},Eye={class:"content column-narrow"},Tye={class:"field field-is-2 is-horizontal"},Aye=p("div",{class:"field-label"},[p("label",{class:"label",for:"pid-preset"}," Preset ")],-1),Mye={class:"field-body"},Rye={class:"field has-addons"},kye={class:"control"},Cye={class:"control"},Pye={class:"field field-is-2 is-horizontal"},Oye=p("div",{class:"field-label"},[p("label",{class:"label"},"Log Rate")],-1),Iye={class:"field-body"},Lye={class:"field"},Dye={class:"control is-expanded"},Nye=["value"],Fye={class:"field field-is-2 is-horizontal"},Uye=p("div",{class:"field-label is-align-self-flex-start pt-2"},[p("label",{class:"label"},"Fields")],-1),$ye={class:"field-body"},Bye={class:"field"},Hye={class:"control is-expanded"},Gye=["value"],zye={class:"column is-12"},Vye={key:0,class:"card"},Wye={class:"card-header"},jye=p("p",{class:"card-header-title"},"Blackbox Files",-1),qye={class:"blackbox-progress has-text-right"},Yye=["value","max"],Xye={class:"card-content"},Kye={class:"content"},Zye={class:"mr-4 is-size-6"},Jye={ref:"downloadAnchor",target:"_blank"},Qye={key:0},ebe=["value"],tbe={class:"card-footer"},nbe={class:"card-footer-item"},sbe=p("span",{class:"card-footer-item"},null,-1);function ibe(t,e,n,s,i,r){var c,u,d;const o=Oe("input-select"),a=Oe("spinner-btn"),l=Oe("font-awesome-icon");return Z(),ie("div",yye,[p("div",bye,[t.info.quicVersionGt("0.1.2")?(Z(),ie("div",wye,[xye,p("div",Sye,[p("div",Eye,[p("div",Tye,[Aye,p("div",Mye,[p("div",Rye,[p("div",kye,[Y(o,{id:"blackbox-preset",modelValue:t.current_preset,"onUpdate:modelValue":e[0]||(e[0]=h=>t.current_preset=h),modelModifiers:{number:!0},options:t.blackboxPresets},null,8,["modelValue","options"])]),p("div",Cye,[Y(a,{onClick:e[1]||(e[1]=h=>t.load_preset(t.current_preset)),disabled:t.current_preset==-1},{default:nt(()=>[me(" Load ")]),_:1},8,["disabled"])])])])]),p("div",Pye,[Oye,p("div",Iye,[p("div",Lye,[p("div",Dye,[p("input",{class:"input is-static",value:t.blackboxRate,readonly:""},null,8,Nye)])])])]),p("div",Fye,[Uye,p("div",$ye,[p("div",Bye,[p("div",Hye,[(Z(!0),ie(ot,null,qt(t.blackboxFields,h=>(Z(),ie("input",{key:h,class:"input is-static",value:h,readonly:""},null,8,Gye))),128))])])])])])])])):ze("",!0)]),p("div",zye,[t.blackbox.list?(Z(),ie("div",Vye,[p("div",Wye,[jye,p("div",qye,[p("progress",{class:"progress my-0 is-danger",value:t.usedSize,max:(t.blackbox.list.flash_size||1)*1024},null,8,Yye),p("h6",null," Used: "+Be(t.humanFileSize(t.usedSize))+" / "+Be(t.humanFileSize(t.blackbox.list.flash_size*1024)),1)])]),p("div",Xye,[p("div",Kye,[(Z(!0),ie(ot,null,qt(t.blackbox.list.files,(h,f)=>(Z(),ie("div",{key:f,class:"is-flex is-align-items-center"},[p("div",Zye," File "+Be(f+1)+": "+Be(t.humanFileSize(h.size)),1),Y(a,{class:"is-small my-2 mx-2",onClick:v=>t.download_btfl(f)},{default:nt(()=>[Y(l,{icon:"fa-solid fa-download",size:"lg",class:"mr-2","fixed-width":""}),me(" BTFL ")]),_:2},1032,["onClick"]),Y(a,{class:"is-small my-2 mx-2",onClick:v=>t.download_quic(f)},{default:nt(()=>[Y(l,{icon:"fa-solid fa-download",size:"lg",class:"mr-2","fixed-width":""}),me(" QUIC ")]),_:2},1032,["onClick"])]))),128)),p("a",Jye,null,512),t.blackbox.progress?(Z(),ie("div",Qye,[me(" Downloading "+Be(t.humanFileSize(t.blackbox.speed||0))+"/s... ",1),p("progress",{class:"progress is-info my-0",value:t.blackbox.progress,max:"1"},null,8,ebe)])):ze("",!0)])]),p("footer",tbe,[p("span",nbe,Be(((d=(u=(c=t.blackbox)==null?void 0:c.list)==null?void 0:u.files)==null?void 0:d.length)||0)+" Files ",1),sbe,Y(a,{class:"card-footer-item is-danger",onClick:e[2]||(e[2]=h=>t.reset())},{default:nt(()=>[me(" Reset ")]),_:1})])])):ze("",!0)])])}const rbe=lt(vye,[["render",ibe]]),obe=it({name:"RealtimePlot",components:{Scatter:Fae},props:["title","time","input","axis","transform"],data(){return{colors:["#1f77b4","#ff7f0e","#2ca02c","#d62728"],lastUpdate:0,chartData:void 0,datasets:[]}},computed:{chartOptions(){return{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},elements:{line:{tension:0}},scales:{x:{type:"time",time:{unit:"second",displayFormats:{second:"HH:mm:ss"}}}},plugins:{title:{display:!0,text:this.title},tooltip:{enabled:!0,mode:"index",position:"average",intersect:!1,callbacks:{label:t=>{let e=t.dataset.label||"";return e&&(e+=": "),e+=t.formattedValue,e}}}}}}},methods:{updateChartData(){let t=[];Array.isArray(this.axis)?t=this.axis.map((e,n)=>({label:e,data:this.datasets[n]||[],fill:!1,borderColor:this.colors[n],showLine:!0,interpolate:!0})):t=[{label:this.axis,data:this.datasets[0]||[],fill:!1,borderColor:this.colors[0],showLine:!0,interpolate:!0}],this.chartData={labels:[],datasets:t}}},watch:{input(t){const e=this.transform||(s=>s),n=this.time||Date.now();if(Array.isArray(this.axis))for(let s=0;s=60;)this.datasets[s].shift()}else for(this.datasets[0]=[...this.datasets[0]||[],{x:n,y:e(t)}];this.datasets[0].length>=60;)this.datasets[0].shift();Date.now()-this.lastUpdate>250&&this.updateChartData()},title(){this.updateChartData()},time(){this.updateChartData()},axis(){this.updateChartData()},transform(){this.updateChartData()}}});function abe(t,e,n,s,i,r){const o=Oe("Scatter");return t.chartData?(Z(),en(o,{key:0,data:t.chartData,options:t.chartOptions,ref:"chart"},null,8,["data","options"])):ze("",!0)}const bP=lt(obe,[["render",abe]]),lbe=it({name:"State",components:{RealtimePlot:bP,GyroModel:S8},setup(){return{state:js()}},data(){return{plots:[{name:"rx_filtered",size:12,title:"Rx Channels",axis:["Roll","Pitch","Yaw","Throttle"]},{name:"cpu_load",size:12,title:"CPU Load",axis:"us"},{name:"gyro_raw",size:6,title:"Gyro Raw",axis:["Roll","Pitch","Yaw"]},{name:"gyro",size:6,title:"Gyro Filter",axis:["Roll","Pitch","Yaw"]},{name:"gyro_temp",size:12,title:"Gyro Temperature",axis:"°C"},{name:"GEstG",size:12,title:"Gyro Vector",axis:["Roll","Pitch","Yaw"]},{name:"accel_raw",size:6,title:"AccelRaw",axis:["Roll","Pitch","Yaw"]},{name:"accel",size:6,title:"AccelFilter",axis:["Roll","Pitch","Yaw"]},{name:"pidoutput",size:12,title:"Pid Output",axis:["Roll","Pitch","Yaw"]}]}}}),cbe={class:"columns is-multiline"},ube={class:"column is-12"};function dbe(t,e,n,s,i,r){const o=Oe("GyroModel"),a=Oe("RealtimePlot");return Z(),ie("div",cbe,[p("div",ube,[Y(o)]),(Z(!0),ie(ot,null,qt(t.plots,l=>(Z(),ie("div",{key:l.name,class:ms(["column",["is-"+l.size]]),style:{height:"35vw"}},[Y(a,{title:l.title,axis:l.axis,input:t.state[l.name]},null,8,["title","axis","input"])],2))),128))])}const hbe=lt(lbe,[["render",dbe]]),fbe=it({name:"Perf",components:{RealtimePlot:bP},setup(){return{perf:IC()}}}),pbe={class:"columns is-multiline"};function mbe(t,e,n,s,i,r){const o=Oe("RealtimePlot");return Z(),ie("div",pbe,[(Z(!0),ie(ot,null,qt(t.perf.counters,(a,l)=>(Z(),ie("div",{key:"counter"+l,class:"column is-6 my-3",style:{height:"35vw"}},[Y(o,{title:a.name,axis:Object.keys(a).slice(1),input:a},null,8,["title","axis","input"])]))),128))])}const gbe=lt(fbe,[["render",mbe]]),_be=it({name:"ProlfileMetadata",setup(){return{state:js(),info:An(),profile:Jt(),serial:Nd()}},computed:{date(){return new Date(this.profile.meta.datetime*1e3)},fileRef(){return this.$refs.file},downloadAnchorRef(){return this.$refs.downloadAnchor},versionLink(){return/^(v\d\..*)/.test(this.info.git_version)?"https://github.com/BossHobby/QUICKSILVER/releases/tag/"+this.info.git_version:"https://github.com/BossHobby/QUICKSILVER/commit/"+this.info.git_version}},methods:{uploadProfile(){const t=new FileReader;t.addEventListener("load",e=>{var n,s;if((n=e==null?void 0:e.target)!=null&&n.result){const i=Ao.parse((s=e==null?void 0:e.target)==null?void 0:s.result);this.profile.apply_profile(i)}}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},downloadProfile(){return Et.get(xn.Profile).then(t=>{const n="data:text/yaml;charset=utf-8,"+encodeURIComponent(Ao.stringify(t)),s=this.date.toISOString().substring(0,10),r=`Profile_${t.meta.name.replace(/\0/g,"")}_${s}.yaml`;this.downloadAnchorRef.setAttribute("href",n),this.downloadAnchorRef.setAttribute("download",r),this.downloadAnchorRef.click()})}}}),vbe={class:"card"},ybe=p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Profile")],-1),bbe={class:"card-content"},wbe={class:"content column-narrow field-is-2"},xbe={class:"field is-horizontal"},Sbe=p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"Name")],-1),Ebe={class:"field-body"},Tbe={class:"field"},Abe={class:"control is-expanded"},Mbe={class:"field is-horizontal"},Rbe=p("div",{class:"field-label"},[p("label",{class:"label"},"Last Modified")],-1),kbe={class:"field-body"},Cbe={class:"field"},Pbe={class:"control is-expanded"},Obe=["value"],Ibe={class:"field is-horizontal"},Lbe=p("div",{class:"field-label"},[p("label",{class:"label"},"Version")],-1),Dbe={class:"field-body"},Nbe={class:"field"},Fbe={class:"control is-expanded"},Ube=["href"],$be={class:"card-footer"},Bbe={accept:".yaml",type:"file",ref:"file",style:{display:"none"}},Hbe={ref:"downloadAnchor",target:"_blank"};function Gbe(t,e,n,s,i,r){const o=Oe("spinner-btn");return Z(),ie("div",vbe,[ybe,p("div",bbe,[p("div",wbe,[p("div",xbe,[Sbe,p("div",Ebe,[p("div",Tbe,[p("div",Abe,[Ye(p("input",{class:"input",type:"text","onUpdate:modelValue":e[0]||(e[0]=a=>t.profile.meta.name=a)},null,512),[[st,t.profile.meta.name]])])])])]),p("div",Mbe,[Rbe,p("div",kbe,[p("div",Cbe,[p("div",Pbe,[p("input",{class:"input is-static",value:t.profile.modified,readonly:""},null,8,Obe)])])])]),p("div",Ibe,[Lbe,p("div",Dbe,[p("div",Nbe,[p("div",Fbe,[p("a",{href:t.versionLink,target:"_blank"},Be(t.info.git_version),9,Ube)])])])])])]),p("footer",$be,[Y(o,{class:"card-footer-item",onClick:t.downloadProfile},{default:nt(()=>[me(" Save Profile ")]),_:1},8,["onClick"]),Y(o,{class:"card-footer-item",onClick:t.uploadProfile,disabled:t.info.is_read_only},{default:nt(()=>[me(" Load Profile ")]),_:1},8,["onClick","disabled"]),Y(o,{class:"card-footer-item is-warning",onClick:t.profile.reset},{default:nt(()=>[me(" Reset Profile ")]),_:1},8,["onClick"])]),p("input",Bbe,null,512),p("a",Hbe,null,512)])}const zbe=lt(_be,[["render",Gbe]]),Vbe={xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",width:"512",height:"512",viewBox:"0 0 135.467 135.467"},Wbe=Ya('',1),jbe=[Wbe];function qbe(t,e){return Z(),ie("svg",Vbe,[...jbe])}const wP={render:qbe},Ybe=it({name:"Info",components:{LogoClean:wP},data(){return{updateAvailable:null,appVersion:"0.9.0"}},created(){Dl.updatePending()||Dl.checkForUpdate(this.appVersion,t=>this.updateAvailable=t)},methods:{doUpdate(){return Dl.update(this.updateAvailable)}}}),Xbe={class:"hero is-primary"},Kbe={class:"hero-body"},Zbe={class:"columns"},Jbe={class:"column is-2 p-0"},Qbe={class:"column"},ewe={class:"title"},twe={class:"text-muted"},nwe=p("p",{class:"subtitle"},[me(" Checkout our "),p("a",{target:"_blank",href:"https://docs.bosshobby.com/",style:{"font-weight":"bold"}}," Docs"),me(" for help on getting started."),p("br"),me(" First time users should start on the FLASH tab. ")],-1),swe={key:0,class:"subtitle"};function iwe(t,e,n,s,i,r){const o=Oe("LogoClean"),a=Oe("spinner-btn");return Z(),ie("section",Xbe,[p("div",Kbe,[p("div",Zbe,[p("div",Jbe,[Y(o,{class:"logo logo-animation",viewBox:"-5 -5 160 160"})]),p("div",Qbe,[p("p",ewe,[me(" QUICKSILVER "),p("small",twe,Be(t.appVersion),1)]),nwe,t.updateAvailable?(Z(),ie("p",swe,"New Version available!")):ze("",!0),t.updateAvailable?(Z(),en(a,{key:1,onClick:t.doUpdate},{default:nt(()=>[me(" Update Now ")]),_:1},8,["onClick"])):ze("",!0)])])])])}const xP=lt(Ybe,[["render",iwe]]),rwe=it({name:"SerialPassthrough",setup(){return{target:Td(),serial:Nd()}},data(){return{serial_port:0,preset:null,presetOptions:[{value:null,text:"Please select an option"},{text:"ExpressLRS",value:{baudrate:42e4,half_duplex:!1,stop_bits:1}},{text:"OpenVTX",value:{baudrate:4800,half_duplex:!0,stop_bits:2}}]}},computed:{serialPorts(){const t=[{value:0,text:"SERIAL_PORT_INVALID"}];for(const[e,n]of Object.entries(this.target.serial_port_names))t.push({value:n,text:e});return t}},methods:{start_passthrough(){return this.serial.serial_passthrough({port:this.serial_port,...this.preset||{}})}}}),owe={class:"card"},awe={class:"card-header"},lwe=p("p",{class:"card-header-title"},"Serial Passthrough",-1),cwe={class:"card-content"},uwe={class:"content"},dwe={class:"columns"},hwe={class:"column is-6"},fwe={class:"field"},pwe=p("label",{class:"label"},"Serial Port",-1),mwe={class:"control is-expanded"},gwe={class:"column is-6"},_we={class:"field"},vwe=p("label",{class:"label"},"Preset",-1),ywe={class:"control is-expanded"},bwe={class:"card-footer"},wwe=p("span",{class:"card-footer-item"},null,-1),xwe=p("span",{class:"card-footer-item"},null,-1);function Swe(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("input-select"),l=Oe("spinner-btn");return Z(),ie("div",owe,[p("header",awe,[lwe,Y(o,{class:"card-header-icon",entry:"serial_passthrough",size:"lg"})]),p("div",cwe,[p("div",uwe,[p("div",dwe,[p("div",hwe,[p("div",fwe,[pwe,p("div",mwe,[Y(a,{modelValue:t.serial_port,"onUpdate:modelValue":e[0]||(e[0]=c=>t.serial_port=c),modelModifiers:{number:!0},class:"is-fullwidth",options:t.serialPorts},null,8,["modelValue","options"])])])]),p("div",gwe,[p("div",_we,[vwe,p("div",ywe,[Y(a,{modelValue:t.preset,"onUpdate:modelValue":e[1]||(e[1]=c=>t.preset=c),class:"is-fullwidth",options:t.presetOptions},null,8,["modelValue","options"])])])])])])]),p("footer",bwe,[wwe,xwe,Y(l,{class:"card-footer-item",disabled:t.serial_port==0||t.preset==null,onClick:t.start_passthrough},{default:nt(()=>[me(" Start ")]),_:1},8,["disabled","onClick"])])])}const Ewe=lt(rwe,[["render",Swe]]),Twe=it({name:"Target",setup(){const t=Xa();return{info:An(),target:Td(),Features:kn(()=>t.Features),GyroType:kn(()=>t.GyroType)}},computed:{fileRef(){return this.$refs.file},downloadAnchorRef(){return this.$refs.downloadAnchor},features(){return ns(this.Features).getKeys().filter((t,e)=>this.info.features&1<{var n,s;if((n=e==null?void 0:e.target)!=null&&n.result){const i=Ao.parse((s=e==null?void 0:e.target)==null?void 0:s.result);this.target.apply(i)}}),this.fileRef.oninput=()=>{var e,n;(n=(e=this.fileRef)==null?void 0:e.files)!=null&&n.length&&t.readAsText(this.fileRef.files[0])},this.fileRef.click()},downloadTarget(){const e="data:text/yaml;charset=utf-8,"+encodeURIComponent(this.target.yaml),n=new Date().toISOString().substring(0,10),s=`Target_${this.target.name}_${n}.yaml`;this.downloadAnchorRef.setAttribute("href",e),this.downloadAnchorRef.setAttribute("download",s),this.downloadAnchorRef.click()}}}),Od=t=>(dd("data-v-1ee68027"),t=t(),hd(),t),Awe={class:"card"},Mwe=Od(()=>p("header",{class:"card-header"},[p("p",{class:"card-header-title"},"Target")],-1)),Rwe={class:"card-content"},kwe={class:"content column-narrow field-is-2"},Cwe={class:"field is-horizontal"},Pwe=Od(()=>p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"Name")],-1)),Owe={class:"field-body"},Iwe={class:"field"},Lwe={class:"control"},Dwe=["value"],Nwe={class:"field is-horizontal"},Fwe=Od(()=>p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"MCU")],-1)),Uwe={class:"field-body"},$we={class:"field"},Bwe={class:"control"},Hwe=["value"],Gwe={key:1,class:"field is-horizontal"},zwe=Od(()=>p("div",{class:"field-label"},[p("label",{class:"label",for:"name"},"Name")],-1)),Vwe={class:"field-body"},Wwe={class:"field"},jwe={class:"control"},qwe=["value"],Ywe={key:2,class:"field is-horizontal"},Xwe=Od(()=>p("div",{class:"field-label"},[p("label",{class:"label"},"Gyro")],-1)),Kwe={class:"field-body"},Zwe={class:"field"},Jwe={class:"control is-expanded"},Qwe=["value"],exe={key:3,class:"field is-horizontal"},txe=Od(()=>p("div",{class:"field-label"},[p("label",{class:"label"},"Features")],-1)),nxe={class:"field-body"},sxe={class:"field"},ixe={class:"control is-expanded"},rxe=["value"],oxe={key:0,class:"card-footer"},axe={accept:".yaml",type:"file",ref:"file",style:{display:"none"}},lxe={ref:"downloadAnchor",target:"_blank"};function cxe(t,e,n,s,i,r){const o=Oe("spinner-btn");return Z(),ie("div",Awe,[Mwe,p("div",Rwe,[p("div",kwe,[t.info.quicVersionGte("0.2.0")?(Z(),ie(ot,{key:0},[p("div",Cwe,[Pwe,p("div",Owe,[p("div",Iwe,[p("div",Lwe,[p("input",{class:"input is-static",value:t.target.name,readonly:""},null,8,Dwe)])])])]),p("div",Nwe,[Fwe,p("div",Uwe,[p("div",$we,[p("div",Bwe,[p("input",{class:"input is-static",value:t.info.mcu,readonly:""},null,8,Hwe)])])])])],64)):(Z(),ie("div",Gwe,[zwe,p("div",Vwe,[p("div",Wwe,[p("div",jwe,[p("input",{class:"input is-static",value:t.info.target_name,readonly:""},null,8,qwe)])])])])),t.info.gyro_id!=null?(Z(),ie("div",Ywe,[Xwe,p("div",Kwe,[p("div",Zwe,[p("div",Jwe,[p("input",{class:"input is-static",value:t.info.gyro_name,readonly:""},null,8,Qwe)])])])])):ze("",!0),t.info.features!=null?(Z(),ie("div",exe,[txe,p("div",nxe,[p("div",sxe,[p("div",ixe,[p("input",{class:"input is-static",value:t.features,readonly:""},null,8,rxe)])])])])):ze("",!0)])]),t.info.quicVersionGte("0.2.0")?(Z(),ie("footer",oxe,[Y(o,{class:"card-footer-item",onClick:t.downloadTarget},{default:nt(()=>[me(" Save Target ")]),_:1},8,["onClick"]),Y(o,{class:"card-footer-item",onClick:t.uploadTarget},{default:nt(()=>[me(" Load Target ")]),_:1},8,["onClick"])])):ze("",!0),p("input",axe,null,512),p("a",lxe,null,512)])}const uxe=lt(Twe,[["render",cxe],["__scopeId","data-v-1ee68027"]]),dxe=it({name:"Profile",components:{Info:xP,ProfileMetadata:zbe,SerialPassthrough:Ewe,Target:uxe},setup(){return{info:An(),state:js()}}}),hxe={class:"columns is-multiline"},fxe={class:"column is-12"},pxe={class:"column is-12"},mxe={class:"notification is-warning"},gxe=p("br",null,null,-1),_xe=p("br",null,null,-1),vxe={class:"notification is-danger"},yxe=p("br",null,null,-1),bxe=p("br",null,null,-1),wxe={class:"column is-12"},xxe={class:"column is-12"},Sxe={class:"column is-12"};function Exe(t,e,n,s,i,r){const o=Oe("Info"),a=Oe("ProfileMetadata"),l=Oe("Target"),c=Oe("SerialPassthrough");return Z(),ie("div",hxe,[p("div",fxe,[Y(o)]),p("div",pxe,[Ye(p("div",mxe,[me(" Incompatible Firmware! "),gxe,me(" Please update to be able to change settings. "),_xe,me(" Current profile can be exported and loaded. ")],512),[[Ag,t.info.quic_protocol_version<5]]),Ye(p("div",vxe,[me(" Faillop "+Be(t.state.failloopMessage)+" ("+Be(t.state.failloop)+") Detected! ",1),yxe,me(" Please fix the issue to be able to change settings. "),bxe],512),[[Ag,t.state.failloop>0]])]),p("div",wxe,[Y(a)]),p("div",xxe,[Y(l)]),p("div",Sxe,[Y(c)])])}const Txe=lt(dxe,[["render",Exe]]);class Axe{constructor(e){Te(this,"progressCallback");this.device=e}onProgress(e){this.progressCallback=e}async open(){await this.device.open(),await this.device.claimInterface(0)}async close(){try{await this.device.close()}catch(e){ct.warn("flash","Close failed",e)}}progress(e,n,s){this.progressCallback&&this.progressCallback({task:e,current:n,total:s})}async getString(e){const n=await this.device.controlTransferIn({recipient:"device",requestType:"standard",request:6,value:768|e,index:0},255);if((n==null?void 0:n.status)!="ok")throw new Error(n.status);const s=n.data,i=s.getUint8(0);let r="";for(let o=2;o{const s=await this.controlTransferIn(3,0,0,6);if(s[4]==2)return s;const i=s[1]|s[2]<<8|s[3]<<16;return await fa(i),n()},n=async()=>(await this.controlTransferOut(4,0,0),e());return e()}async getChipInfo(){const e=s=>{s=="@External Flash /0x90000000/1001*128Kg,3*128Kg,20*128Ka"&&(s="@External Flash /0x90000000/998*128Kg,1*128Kg,4*128Kg,21*128Ka"),s=s.replace("@Option byte","@Option Bytes");const r=s.replace(/[^\x20-\x7E]+/g,"").split("/");if(r.length>3&&(ct.info("flash",'parseDescriptor: shrinking long descriptor "'+s+'"'),r.length=3),!r[0].startsWith("@"))return null;const o=r[0].trim().replace("@",""),a=parseInt(r[1]),l=[];let c=0;const u=r[2].split(",");if(u.length<1)return null;for(let h=0;h>8&255,e>>16&255,e>>24&255];await this.controlTransferOut(1,0,0,s);const i=await this.controlTransferIn(3,0,0,6);if(i[4]!=4)throw new Error("Failed to request address load");const r=i[1]|i[2]<<8|i[3]<<16;await fa(r);const o=await this.controlTransferIn(3,0,0,6);if(o[4]!=5&&n)throw new Error("Failed to request address load");return o}async unlockOptionBytes(e,n){const s=async()=>{ct.info("flash","Initiate read unprotect"),await this.controlTransferOut(1,0,0,[146]);const o=await this.controlTransferIn(3,0,0,6);if(o[4]!=4)throw new Error("Failed to initiate unprotect memory command");const l=(o[1]|o[2]<<8|o[3]<<16)+2e4;await fa(l);try{const c=await this.controlTransferIn(3,0,0,6);throw ct.info("flash","Failed to execute unprotect memory command"),ct.info("flash",c),new Error("Failed to execute unprotect memory command")}catch{ct.info("flash","Unprotect memory command ran successfully. Unplug flight controller. Connect again in DFU mode and try flashing again.")}},i=async()=>{const o=await this.controlTransferIn(2,2,0,n);return(await this.controlTransferIn(3,0,0,6))[4]==9&&o.length==n?(ct.info("flash","Option bytes read successfully"),ct.info("flash","Chip does not appear read protected"),this.clearStatus()):(ct.info("flash","Option bytes could not be read. Quite possibly read protected."),await this.clearStatus(),s())};await this.clearStatus();const r=await this.loadAddress(e,!1);if(r[4]==10&&r[0]==11)return await this.clearStatus(),s();if(r[4]==5)return ct.info("flash","Address load for option bytes sector succeeded."),await this.clearStatus(),i();throw new Error("Address load failed")}async erasePages(e){const n=[];for(let i=0;i>8&255,r>>16&255,r>>24&255];ct.info("flash","Erasing. sector "+i.sector+", page "+i.page+" @ 0x"+r.toString(16)),await this.controlTransferOut(1,0,0,o);const a=await this.controlTransferIn(3,0,0,6);if(a[4]!=4)throw new Error("Failed to initiate page erase, page 0x"+r.toString(16));const l=a[1]|a[2]<<8|a[3]<<16;await fa(l);const c=await this.controlTransferIn(3,0,0,6);if(c[4]!=5)if(c[4]==4){if(ct.info("flash","erase_page: dfuDNBUSY after timeout, clearing"),await this.clearStatus(),(await this.controlTransferIn(3,0,0,6))[4]!=2)throw new Error("Failed to erase page 0x"+r.toString(16)+" (did not reach dfuIDLE after clearing")}else throw new Error("Failed to erase page 0x"+r.toString(16))}}async upload(e,n){ct.info("flash","Writing data...");const s=e.segment_bytes_total;let i=0;for(const r of e.segments){let o=r.address,a=2,l=0;for(await this.loadAddress(o);lr.data.length&&(c=r.data.length-l);const u=r.data.slice(l,l+c);o+=c,l+=c,i+=c,this.progress("write",i,s),this.controlTransferOut(1,a++,0,[...u]);const d=await this.controlTransferIn(3,0,0,6);if(d[4]!=4)throw new Error("Failed to initiate write "+c+"bytes to 0x"+o.toString(16));const h=d[1]|d[2]<<8|d[3]<<16;if(await fa(h),(await this.controlTransferIn(3,0,0,6))[4]!=5)throw new Error("Failed to write "+c+"bytes to 0x"+o.toString(16))}}}async verify(e,n){ct.info("flash","Verifying data...");const s=e.segment_bytes_total;let i=0;for(const r of e.segments){let o=r.address,a=2,l=0;for(await this.clearStatus(),await this.loadAddress(o),await this.clearStatus();lr.data.length&&(c=r.data.length-l);const u=await this.controlTransferIn(2,a++,0,c);for(let d=0;di)throw new Error("Not Enough flash space "+e.linear_bytes_total+"> "+i);let r=2048;try{r=(await this.getFunctionalDescriptor()).wTransferSize}catch{}await this.clearStatus(),n.internal_flash&&await this.unlockOptionBytes(n.option_bytes.start_address,n.option_bytes.total_size),await this.erasePages(s),await this.upload(e,r),await this.verify(e,r),await fa(500),await this.leave(e)}}const Mxe=new Uint8Array([1,0,170,18]),Rxe={stm32f411:134266880,stm32f765:134316032,stm32f745:134316032,stm32h743:134348800,stm32f405:134266880,stm32f722:134266880,at32f435:135200768,at32f435m:135200768};class s_{constructor(e,n){Te(this,"start_linear_address");Te(this,"start_segment_address");Te(this,"segments",[]);this.start_linear_address=e,this.start_segment_address=n}get linear_bytes_total(){return this.end_address-this.start_address}get segment_bytes_total(){return this.segments.reduce((e,n)=>e+=n.data.length,0)}get start_address(){return this.segments[0].address}get end_address(){return this.segments[this.segments.length-1].address+this.segments[this.segments.length-1].data.length}findSegment(e){for(let n=0;n=e&&e<=this.segments[n].address+this.segments[n].data.byteLength)return this.segments[n];return this.segments.push({address:e,data:new Uint8Array}),this.segments[this.segments.length-1]}patch(e,n){n=Fh(Mxe,n);const s=this.findSegment(e),i=s.address-e,r=i+n.byteLength;s.data.byteLength>8)+c+u&255;for(let _=0;_{this.progressCallback&&this.progressCallback(s)}),await n.open(),await n.flash(e),await n.close()}}function Za(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}const Pxe=Object.freeze(Object.defineProperty({__proto__:null,getUserAgent:Za},Symbol.toStringTag,{value:"Module"}));var M0={exports:{}},Oxe=SP;function SP(t,e,n,s){if(typeof n!="function")throw new Error("method for before hook must be a function");return s||(s={}),Array.isArray(e)?e.reverse().reduce(function(i,r){return SP.bind(null,t,r,i,s)},n)():Promise.resolve().then(function(){return t.registry[e]?t.registry[e].reduce(function(i,r){return r.hook.bind(null,i,s)},n)():n(s)})}var Ixe=Lxe;function Lxe(t,e,n,s){var i=s;t.registry[n]||(t.registry[n]=[]),e==="before"&&(s=function(r,o){return Promise.resolve().then(i.bind(null,o)).then(r.bind(null,o))}),e==="after"&&(s=function(r,o){var a;return Promise.resolve().then(r.bind(null,o)).then(function(l){return a=l,i(a,o)}).then(function(){return a})}),e==="error"&&(s=function(r,o){return Promise.resolve().then(r.bind(null,o)).catch(function(a){return i(a,o)})}),t.registry[n].push({hook:s,orig:i})}var Dxe=Nxe;function Nxe(t,e,n){if(t.registry[e]){var s=t.registry[e].map(function(i){return i.orig}).indexOf(n);s!==-1&&t.registry[e].splice(s,1)}}var EP=Oxe,Fxe=Ixe,Uxe=Dxe,U3=Function.bind,$3=U3.bind(U3);function TP(t,e,n){var s=$3(Uxe,null).apply(null,n?[e,n]:[e]);t.api={remove:s},t.remove=s,["before","error","after","wrap"].forEach(function(i){var r=n?[e,i,n]:[e,i];t[i]=t.api[i]=$3(Fxe,null).apply(null,r)})}function $xe(){var t="h",e={registry:{}},n=EP.bind(null,e,t);return TP(n,e,t),n}function AP(){var t={registry:{}},e=EP.bind(null,t);return TP(e,t),e}var B3=!1;function Id(){return B3||(console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4'),B3=!0),AP()}Id.Singular=$xe.bind();Id.Collection=AP.bind();M0.exports=Id;M0.exports.Hook=Id;M0.exports.Singular=Id.Singular;var Bxe=M0.exports.Collection=Id.Collection,Hxe="9.0.5",Gxe=`octokit-endpoint.js/${Hxe} ${Za()}`,zxe={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Gxe},mediaType:{format:""}};function Vxe(t){return t?Object.keys(t).reduce((e,n)=>(e[n.toLowerCase()]=t[n],e),{}):{}}function Wxe(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const n=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(t)}function MP(t,e){const n=Object.assign({},t);return Object.keys(e).forEach(s=>{Wxe(e[s])?s in t?n[s]=MP(t[s],e[s]):Object.assign(n,{[s]:e[s]}):Object.assign(n,{[s]:e[s]})}),n}function H3(t){for(const e in t)t[e]===void 0&&delete t[e];return t}function Jy(t,e,n){var i;if(typeof e=="string"){let[r,o]=e.split(" ");n=Object.assign(o?{method:r,url:o}:{url:r},n)}else n=Object.assign({},e);n.headers=Vxe(n.headers),H3(n),H3(n.headers);const s=MP(t||{},n);return n.url==="/graphql"&&(t&&((i=t.mediaType.previews)!=null&&i.length)&&(s.mediaType.previews=t.mediaType.previews.filter(r=>!s.mediaType.previews.includes(r)).concat(s.mediaType.previews)),s.mediaType.previews=(s.mediaType.previews||[]).map(r=>r.replace(/-preview/,""))),s}function jxe(t,e){const n=/\?/.test(t)?"&":"?",s=Object.keys(e);return s.length===0?t:t+n+s.map(i=>i==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(e[i])}`).join("&")}var qxe=/\{[^}]+\}/g;function Yxe(t){return t.replace(/^\W+|\W+$/g,"").split(/,/)}function Xxe(t){const e=t.match(qxe);return e?e.map(Yxe).reduce((n,s)=>n.concat(s),[]):[]}function G3(t,e){const n={__proto__:null};for(const s of Object.keys(t))e.indexOf(s)===-1&&(n[s]=t[s]);return n}function RP(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}function ru(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function ch(t,e,n){return e=t==="+"||t==="#"?RP(e):ru(e),n?ru(n)+"="+e:e}function Vc(t){return t!=null}function xv(t){return t===";"||t==="&"||t==="?"}function Kxe(t,e,n,s){var i=t[n],r=[];if(Vc(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")i=i.toString(),s&&s!=="*"&&(i=i.substring(0,parseInt(s,10))),r.push(ch(e,i,xv(e)?n:""));else if(s==="*")Array.isArray(i)?i.filter(Vc).forEach(function(o){r.push(ch(e,o,xv(e)?n:""))}):Object.keys(i).forEach(function(o){Vc(i[o])&&r.push(ch(e,i[o],o))});else{const o=[];Array.isArray(i)?i.filter(Vc).forEach(function(a){o.push(ch(e,a))}):Object.keys(i).forEach(function(a){Vc(i[a])&&(o.push(ru(a)),o.push(ch(e,i[a].toString())))}),xv(e)?r.push(ru(n)+"="+o.join(",")):o.length!==0&&r.push(o.join(","))}else e===";"?Vc(i)&&r.push(ru(n)):i===""&&(e==="&"||e==="?")?r.push(ru(n)+"="):i===""&&r.push("");return r}function Zxe(t){return{expand:Jxe.bind(null,t)}}function Jxe(t,e){var n=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,i,r){if(i){let a="";const l=[];if(n.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(c){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(c);l.push(Kxe(e,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var o=",";return a==="?"?o="&":a!=="#"&&(o=a),(l.length!==0?a:"")+l.join(o)}else return l.join(",")}else return RP(r)}),t==="/"?t:t.replace(/\/$/,"")}function kP(t){var u;let e=t.method.toUpperCase(),n=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),s=Object.assign({},t.headers),i,r=G3(t,["method","baseUrl","url","headers","request","mediaType"]);const o=Xxe(n);n=Zxe(n).expand(r),/^http/.test(n)||(n=t.baseUrl+n);const a=Object.keys(t).filter(d=>o.includes(d)).concat("baseUrl"),l=G3(r,a);if(!/application\/octet-stream/i.test(s.accept)&&(t.mediaType.format&&(s.accept=s.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&(u=t.mediaType.previews)!=null&&u.length)){const d=s.accept.match(/[\w-]+(?=-preview)/g)||[];s.accept=d.concat(t.mediaType.previews).map(h=>{const f=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${h}-preview${f}`}).join(",")}return["GET","HEAD"].includes(e)?n=jxe(n,l):"data"in l?i=l.data:Object.keys(l).length&&(i=l),!s["content-type"]&&typeof i<"u"&&(s["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof i>"u"&&(i=""),Object.assign({method:e,url:n,headers:s},typeof i<"u"?{body:i}:null,t.request?{request:t.request}:null)}function Qxe(t,e,n){return kP(Jy(t,e,n))}function CP(t,e){const n=Jy(t,e),s=Qxe.bind(null,n);return Object.assign(s,{DEFAULTS:n,defaults:CP.bind(null,n),merge:Jy.bind(null,n),parse:kP})}var e2e=CP(null,zxe);class Qy extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}}const t2e=Object.freeze(Object.defineProperty({__proto__:null,Deprecation:Qy},Symbol.toStringTag,{value:"Module"}));var $x={exports:{}},n2e=PP;function PP(t,e){if(t&&e)return PP(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(s){n[s]=t[s]}),n;function n(){for(var s=new Array(arguments.length),i=0;iconsole.warn(t)),r2e=LP(t=>console.warn(t)),Cl=class extends Error{constructor(t,e,n){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=e;let s;"headers"in n&&typeof n.headers<"u"&&(s=n.headers),"response"in n&&(this.response=n.response,s=n.response.headers);const i=Object.assign({},n.request);n.request.headers.authorization&&(i.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),i.url=i.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=i,Object.defineProperty(this,"code",{get(){return i2e(new Qy("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),e}}),Object.defineProperty(this,"headers",{get(){return r2e(new Qy("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")),s||{}}})}},o2e="8.4.0";function a2e(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const n=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(t)}function l2e(t){return t.arrayBuffer()}function z3(t){var a,l,c,u;const e=t.request&&t.request.log?t.request.log:console,n=((a=t.request)==null?void 0:a.parseSuccessResponseBody)!==!1;(a2e(t.body)||Array.isArray(t.body))&&(t.body=JSON.stringify(t.body));let s={},i,r,{fetch:o}=globalThis;if((l=t.request)!=null&&l.fetch&&(o=t.request.fetch),!o)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");return o(t.url,{method:t.method,body:t.body,redirect:(c=t.request)==null?void 0:c.redirect,headers:t.headers,signal:(u=t.request)==null?void 0:u.signal,...t.body&&{duplex:"half"}}).then(async d=>{r=d.url,i=d.status;for(const h of d.headers)s[h[0]]=h[1];if("deprecation"in s){const h=s.link&&s.link.match(/<([^>]+)>; rel="deprecation"/),f=h&&h.pop();e.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${s.sunset}${f?`. See ${f}`:""}`)}if(!(i===204||i===205)){if(t.method==="HEAD"){if(i<400)return;throw new Cl(d.statusText,i,{response:{url:r,status:i,headers:s,data:void 0},request:t})}if(i===304)throw new Cl("Not modified",i,{response:{url:r,status:i,headers:s,data:await Sv(d)},request:t});if(i>=400){const h=await Sv(d);throw new Cl(c2e(h),i,{response:{url:r,status:i,headers:s,data:h},request:t})}return n?await Sv(d):d.body}}).then(d=>({status:i,url:r,headers:s,data:d})).catch(d=>{if(d instanceof Cl)throw d;if(d.name==="AbortError")throw d;let h=d.message;throw d.name==="TypeError"&&"cause"in d&&(d.cause instanceof Error?h=d.cause.message:typeof d.cause=="string"&&(h=d.cause)),new Cl(h,500,{request:t})})}async function Sv(t){const e=t.headers.get("content-type");return/application\/json/.test(e)?t.json().catch(()=>t.text()).catch(()=>""):!e||/^text\/|charset=utf-8$/.test(e)?t.text():l2e(t)}function c2e(t){if(typeof t=="string")return t;let e;return"documentation_url"in t?e=` - ${t.documentation_url}`:e="","message"in t?Array.isArray(t.errors)?`${t.message}: ${t.errors.map(JSON.stringify).join(", ")}${e}`:`${t.message}${e}`:`Unknown error: ${JSON.stringify(t)}`}function eb(t,e){const n=t.defaults(e);return Object.assign(function(i,r){const o=n.merge(i,r);if(!o.request||!o.request.hook)return z3(n.parse(o));const a=(l,c)=>z3(n.parse(n.merge(l,c)));return Object.assign(a,{endpoint:n,defaults:eb.bind(null,n)}),o.request.hook(a,o)},{endpoint:n,defaults:eb.bind(null,n)})}var is=eb(e2e,{headers:{"user-agent":`octokit-request.js/${o2e} ${Za()}`}});const u2e=Object.freeze(Object.defineProperty({__proto__:null,request:is},Symbol.toStringTag,{value:"Module"}));var d2e="7.1.0";function h2e(t){return`Request failed due to following response errors: +`+t.errors.map(e=>` - ${e.message}`).join(` +`)}var f2e=class extends Error{constructor(t,e,n){super(h2e(n)),this.request=t,this.headers=e,this.response=n,this.name="GraphqlResponseError",this.errors=n.errors,this.data=n.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},p2e=["method","baseUrl","url","headers","request","query","mediaType"],m2e=["query","method","url"],V3=/\/api\/v3\/?$/;function g2e(t,e,n){if(n){if(typeof e=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(const o in n)if(m2e.includes(o))return Promise.reject(new Error(`[@octokit/graphql] "${o}" cannot be used as variable name`))}const s=typeof e=="string"?Object.assign({query:e},n):e,i=Object.keys(s).reduce((o,a)=>p2e.includes(a)?(o[a]=s[a],o):(o.variables||(o.variables={}),o.variables[a]=s[a],o),{}),r=s.baseUrl||t.endpoint.DEFAULTS.baseUrl;return V3.test(r)&&(i.url=r.replace(V3,"/api/graphql")),t(i).then(o=>{if(o.data.errors){const a={};for(const l of Object.keys(o.headers))a[l]=o.headers[l];throw new f2e(i,a,o.data)}return o.data.data})}function Bx(t,e){const n=t.defaults(e);return Object.assign((i,r)=>g2e(n,i,r),{defaults:Bx.bind(null,n),endpoint:n.endpoint})}Bx(is,{headers:{"user-agent":`octokit-graphql.js/${d2e} ${Za()}`},method:"POST",url:"/graphql"});function _2e(t){return Bx(t,{method:"POST",url:"/graphql"})}var v2e=/^v1\./,y2e=/^ghs_/,b2e=/^ghu_/;async function w2e(t){const e=t.split(/\./).length===3,n=v2e.test(t)||y2e.test(t),s=b2e.test(t);return{type:"token",token:t,tokenType:e?"app":n?"installation":s?"user-to-server":"oauth"}}function x2e(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}async function S2e(t,e,n,s){const i=e.endpoint.merge(n,s);return i.headers.authorization=x2e(t),e(i)}var E2e=function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(w2e.bind(null,e),{hook:S2e.bind(null,e)})},DP="5.2.0",W3=()=>{},T2e=console.warn.bind(console),A2e=console.error.bind(console),j3=`octokit-core.js/${DP} ${Za()}`,ad,Hx=(ad=class{static defaults(e){return class extends this{constructor(...s){const i=s[0]||{};if(typeof e=="function"){super(e(i));return}super(Object.assign({},e,i,i.userAgent&&e.userAgent?{userAgent:`${i.userAgent} ${e.userAgent}`}:null))}}}static plugin(...e){var i;const n=this.plugins;return i=class extends this{},i.plugins=n.concat(e.filter(o=>!n.includes(o))),i}constructor(e={}){const n=new Bxe,s={baseUrl:is.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(s.headers["user-agent"]=e.userAgent?`${e.userAgent} ${j3}`:j3,e.baseUrl&&(s.baseUrl=e.baseUrl),e.previews&&(s.mediaType.previews=e.previews),e.timeZone&&(s.headers["time-zone"]=e.timeZone),this.request=is.defaults(s),this.graphql=_2e(this.request).defaults(s),this.log=Object.assign({debug:W3,info:W3,warn:T2e,error:A2e},e.log),this.hook=n,e.authStrategy){const{authStrategy:r,...o}=e,a=r(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},e.auth));n.wrap("request",a.hook),this.auth=a}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{const r=E2e(e.auth);n.wrap("request",r.hook),this.auth=r}const i=this.constructor;for(let r=0;r({async next(){if(!a)return{done:!0};try{const l=await i({method:r,url:a,headers:o}),c=k2e(l);return a=((c.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1],{value:c}}catch(l){if(l.status!==409)throw l;return a="",{value:{status:200,headers:{},data:[]}}}}})}}function NP(t,e,n,s){return typeof n=="function"&&(s=n,n=void 0),FP(t,[],Gx(t,e,n)[Symbol.asyncIterator](),s)}function FP(t,e,n,s){return n.next().then(i=>{if(i.done)return e;let r=!1;function o(){r=!0}return e=e.concat(s?s(i.value,o):i.value.data),r?e:FP(t,e,n,s)})}Object.assign(NP,{iterator:Gx});function UP(t){return{paginate:Object.assign(NP.bind(null,t),{iterator:Gx.bind(null,t)})}}UP.VERSION=R2e;var C2e=(t,e)=>`The cursor at "${t.join(",")}" did not change its value "${e}" after a page transition. Please make sure your that your query is set up correctly.`,P2e=class extends Error{constructor(t,e){super(C2e(t.pathInQuery,e)),this.pageInfo=t,this.cursorValue=e,this.name="MissingCursorChangeError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},O2e=class extends Error{constructor(t){super(`No pageInfo property found in response. Please make sure to specify the pageInfo in your query. Response-Data: ${JSON.stringify(t,null,2)}`),this.response=t,this.name="MissingPageInfo",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},I2e=t=>Object.prototype.toString.call(t)==="[object Object]";function $P(t){const e=BP(t,"pageInfo");if(e.length===0)throw new O2e(t);return e}var BP=(t,e,n=[])=>{for(const s of Object.keys(t)){const i=[...n,s],r=t[s];if(r.hasOwnProperty(e))return i;if(I2e(r)){const o=BP(r,e,i);if(o.length>0)return o}}return[]},qh=(t,e)=>e.reduce((n,s)=>n[s],t),Ev=(t,e,n)=>{const s=e[e.length-1],i=[...e].slice(0,-1),r=qh(t,i);typeof n=="function"?r[s]=n(r[s]):r[s]=n},L2e=t=>{const e=$P(t);return{pathInQuery:e,pageInfo:qh(t,[...e,"pageInfo"])}},HP=t=>t.hasOwnProperty("hasNextPage"),D2e=t=>HP(t)?t.endCursor:t.startCursor,N2e=t=>HP(t)?t.hasNextPage:t.hasPreviousPage,GP=t=>(e,n={})=>{let s=!0,i={...n};return{[Symbol.asyncIterator]:()=>({async next(){if(!s)return{done:!0,value:{}};const r=await t.graphql(e,i),o=L2e(r),a=D2e(o.pageInfo);if(s=N2e(o.pageInfo),s&&a===i.cursor)throw new P2e(o,a);return i={...i,cursor:a},{done:!1,value:r}}})}},F2e=(t,e)=>{if(Object.keys(t).length===0)return Object.assign(t,e);const n=$P(t),s=[...n,"nodes"],i=qh(e,s);i&&Ev(t,s,l=>[...l,...i]);const r=[...n,"edges"],o=qh(e,r);o&&Ev(t,r,l=>[...l,...o]);const a=[...n,"pageInfo"];return Ev(t,a,qh(e,a)),t},U2e=t=>{const e=GP(t);return async(n,s={})=>{let i={};for await(const r of e(n,s))i=F2e(i,r);return i}};function $2e(t){return t.graphql,{graphql:Object.assign(t.graphql,{paginate:Object.assign(U2e(t),{iterator:GP(t)})})}}var B2e="13.2.2",H2e={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"],usageMetricsForEnterprise:["GET /enterprises/{enterprise}/copilot/usage"],usageMetricsForOrg:["GET /orgs/{org}/copilot/usage"],usageMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/usage"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}"],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createCustomOrganizationRole:["POST /orgs/{org}/organization-roles"],createInvitation:["POST /orgs/{org}/invitations"],createOrUpdateCustomProperties:["PATCH /orgs/{org}/properties/schema"],createOrUpdateCustomPropertiesValuesForRepos:["PATCH /orgs/{org}/properties/values"],createOrUpdateCustomProperty:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],createWebhook:["POST /orgs/{org}/hooks"],delete:["DELETE /orgs/{org}"],deleteCustomOrganizationRole:["DELETE /orgs/{org}/organization-roles/{role_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],enableOrDisableSecurityProductOnAllOrgRepos:["POST /orgs/{org}/{security_product}/{enablement}"],get:["GET /orgs/{org}"],getAllCustomProperties:["GET /orgs/{org}/properties/schema"],getCustomProperty:["GET /orgs/{org}/properties/schema/{custom_property_name}"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listBlockedUsers:["GET /orgs/{org}/blocks"],listCustomPropertiesValuesForRepos:["GET /orgs/{org}/properties/values"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers"],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],patchCustomOrganizationRole:["PATCH /orgs/{org}/organization-roles/{role_id}"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeCustomProperty:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}"],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},projects:{addCollaborator:["PUT /projects/{project_id}/collaborators/{username}"],createCard:["POST /projects/columns/{column_id}/cards"],createColumn:["POST /projects/{project_id}/columns"],createForAuthenticatedUser:["POST /user/projects"],createForOrg:["POST /orgs/{org}/projects"],createForRepo:["POST /repos/{owner}/{repo}/projects"],delete:["DELETE /projects/{project_id}"],deleteCard:["DELETE /projects/columns/cards/{card_id}"],deleteColumn:["DELETE /projects/columns/{column_id}"],get:["GET /projects/{project_id}"],getCard:["GET /projects/columns/cards/{card_id}"],getColumn:["GET /projects/columns/{column_id}"],getPermissionForUser:["GET /projects/{project_id}/collaborators/{username}/permission"],listCards:["GET /projects/columns/{column_id}/cards"],listCollaborators:["GET /projects/{project_id}/collaborators"],listColumns:["GET /projects/{project_id}/columns"],listForOrg:["GET /orgs/{org}/projects"],listForRepo:["GET /repos/{owner}/{repo}/projects"],listForUser:["GET /users/{username}/projects"],moveCard:["POST /projects/columns/cards/{card_id}/moves"],moveColumn:["POST /projects/columns/{column_id}/moves"],removeCollaborator:["DELETE /projects/{project_id}/collaborators/{username}"],update:["PATCH /projects/{project_id}"],updateCard:["PATCH /projects/columns/cards/{card_id}"],updateColumn:["PATCH /projects/columns/{column_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateCustomPropertiesValues:["PATCH /repos/{owner}/{repo}/properties/values"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createTagProtection:["POST /repos/{owner}/{repo}/tags/protection"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteTagProtection:["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getCustomPropertiesValues:["GET /repos/{owner}/{repo}/properties/values"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTagProtection:["GET /repos/{owner}/{repo}/tags/protection"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/secret-scanning/alerts"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateProjectPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForProjectInOrg:["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listProjectsInOrg:["GET /orgs/{org}/teams/{team_slug}/projects"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeProjectInOrg:["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},G2e=H2e,ec=new Map;for(const[t,e]of Object.entries(G2e))for(const[n,s]of Object.entries(e)){const[i,r,o]=s,[a,l]=i.split(/ /),c=Object.assign({method:a,url:l},r);ec.has(t)||ec.set(t,new Map),ec.get(t).set(n,{scope:t,methodName:n,endpointDefaults:c,decorations:o})}var z2e={has({scope:t},e){return ec.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,n){return Object.defineProperty(t.cache,e,n),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[...ec.get(t).keys()]},set(t,e,n){return t.cache[e]=n},get({octokit:t,scope:e,cache:n},s){if(n[s])return n[s];const i=ec.get(e).get(s);if(!i)return;const{endpointDefaults:r,decorations:o}=i;return o?n[s]=W2e(t,e,s,r,o):n[s]=t.request.defaults(r),n[s]}};function V2e(t){const e={};for(const n of ec.keys())e[n]=new Proxy({octokit:t,scope:n,cache:{}},z2e);return e}function W2e(t,e,n,s,i){const r=t.request.defaults(s);function o(...a){let l=r.endpoint.merge(...a);if(i.mapToData)return l=Object.assign({},l,{data:l[i.mapToData],[i.mapToData]:void 0}),r(l);if(i.renamed){const[c,u]=i.renamed;t.log.warn(`octokit.${e}.${n}() has been renamed to octokit.${c}.${u}()`)}if(i.deprecated&&t.log.warn(i.deprecated),i.renamedParameters){const c=r.endpoint.merge(...a);for(const[u,d]of Object.entries(i.renamedParameters))u in c&&(t.log.warn(`"${u}" parameter is deprecated for "octokit.${e}.${n}()". Use "${d}" instead`),d in c||(c[d]=c[u]),delete c[u]);return r(c)}return r(...a)}return Object.assign(o,r)}function zP(t){return{rest:V2e(t)}}zP.VERSION=B2e;var VP={exports:{}};(function(t,e){(function(n,s){t.exports=s()})(s1,function(){var n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof s1<"u"?s1:typeof self<"u"?self:{};function s(ye){return ye&&ye.default||ye}var i=function(ye,te,C={}){var X,N,V;for(X in te)V=te[X],C[X]=(N=ye[X])!=null?N:V;return C},r=function(ye,te,C={}){var X,N;for(X in ye)N=ye[X],te[X]!==void 0&&(C[X]=N);return C},o={load:i,overwrite:r},a;a=class{constructor(te,C){this.incr=te,this.decr=C,this._first=null,this._last=null,this.length=0}push(te){var C;this.length++,typeof this.incr=="function"&&this.incr(),C={value:te,prev:this._last,next:null},this._last!=null?(this._last.next=C,this._last=C):this._first=this._last=C}shift(){var te;if(this._first!=null)return this.length--,typeof this.decr=="function"&&this.decr(),te=this._first.value,(this._first=this._first.next)!=null?this._first.prev=null:this._last=null,te}first(){if(this._first!=null)return this._first.value}getArray(){var te,C,X;for(te=this._first,X=[];te!=null;)X.push((C=te,te=te.next,C.value));return X}forEachShift(te){var C;for(C=this.shift();C!=null;)te(C),C=this.shift()}debug(){var te,C,X,N,V;for(te=this._first,V=[];te!=null;)V.push((C=te,te=te.next,{value:C.value,prev:(X=C.prev)!=null?X.value:void 0,next:(N=C.next)!=null?N.value:void 0}));return V}};var l=a,c;c=class{constructor(te){if(this.instance=te,this._events={},this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null)throw new Error("An Emitter already exists for this object");this.instance.on=(C,X)=>this._addListener(C,"many",X),this.instance.once=(C,X)=>this._addListener(C,"once",X),this.instance.removeAllListeners=(C=null)=>C!=null?delete this._events[C]:this._events={}}_addListener(te,C,X){var N;return(N=this._events)[te]==null&&(N[te]=[]),this._events[te].push({cb:X,status:C}),this.instance}listenerCount(te){return this._events[te]!=null?this._events[te].length:0}async trigger(te,...C){var X,N;try{return te!=="debug"&&this.trigger("debug",`Event triggered: ${te}`,C),this._events[te]==null?void 0:(this._events[te]=this._events[te].filter(function(V){return V.status!=="none"}),N=this._events[te].map(async V=>{var W,Q;if(V.status!=="none"){V.status==="once"&&(V.status="none");try{return Q=typeof V.cb=="function"?V.cb(...C):void 0,typeof(Q!=null?Q.then:void 0)=="function"?await Q:Q}catch(F){return W=F,this.trigger("error",W),null}}}),(await Promise.all(N)).find(function(V){return V!=null}))}catch(V){return X=V,this.trigger("error",X),null}}};var u=c,d,h,f;d=l,h=u,f=class{constructor(te){this.Events=new h(this),this._length=0,this._lists=(function(){var C,X,N;for(N=[],C=1,X=te;1<=X?C<=X:C>=X;1<=X?++C:--C)N.push(new d(()=>this.incr(),()=>this.decr()));return N}).call(this)}incr(){if(this._length++===0)return this.Events.trigger("leftzero")}decr(){if(--this._length===0)return this.Events.trigger("zero")}push(te){return this._lists[te.options.priority].push(te)}queued(te){return te!=null?this._lists[te].length:this._length}shiftAll(te){return this._lists.forEach(function(C){return C.forEachShift(te)})}getFirst(te=this._lists){var C,X,N;for(C=0,X=te.length;C0)return N;return[]}shiftLastFrom(te){return this.getFirst(this._lists.slice(te).reverse()).shift()}};var v=f,_;_=class extends Error{};var m=_,g,y,b,w,T;w=10,y=5,T=o,g=m,b=class{constructor(te,C,X,N,V,W,Q,F){this.task=te,this.args=C,this.rejectOnDrop=V,this.Events=W,this._states=Q,this.Promise=F,this.options=T.load(X,N),this.options.priority=this._sanitizePriority(this.options.priority),this.options.id===N.id&&(this.options.id=`${this.options.id}-${this._randomIndex()}`),this.promise=new this.Promise((le,ue)=>{this._resolve=le,this._reject=ue}),this.retryCount=0}_sanitizePriority(te){var C;return C=~~te!==te?y:te,C<0?0:C>w-1?w-1:C}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:te,message:C="This job has been dropped by Bottleneck"}={}){return this._states.remove(this.options.id)?(this.rejectOnDrop&&this._reject(te??new g(C)),this.Events.trigger("dropped",{args:this.args,options:this.options,task:this.task,promise:this.promise}),!0):!1}_assertStatus(te){var C;if(C=this._states.jobStatus(this.options.id),!(C===te||te==="DONE"&&C===null))throw new g(`Invalid job status ${C}, expected ${te}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}doReceive(){return this._states.start(this.options.id),this.Events.trigger("received",{args:this.args,options:this.options})}doQueue(te,C){return this._assertStatus("RECEIVED"),this._states.next(this.options.id),this.Events.trigger("queued",{args:this.args,options:this.options,reachedHWM:te,blocked:C})}doRun(){return this.retryCount===0?(this._assertStatus("QUEUED"),this._states.next(this.options.id)):this._assertStatus("EXECUTING"),this.Events.trigger("scheduled",{args:this.args,options:this.options})}async doExecute(te,C,X,N){var V,W,Q;this.retryCount===0?(this._assertStatus("RUNNING"),this._states.next(this.options.id)):this._assertStatus("EXECUTING"),W={args:this.args,options:this.options,retryCount:this.retryCount},this.Events.trigger("executing",W);try{if(Q=await(te!=null?te.schedule(this.options,this.task,...this.args):this.task(...this.args)),C())return this.doDone(W),await N(this.options,W),this._assertStatus("DONE"),this._resolve(Q)}catch(F){return V=F,this._onFailure(V,W,C,X,N)}}doExpire(te,C,X){var N,V;return this._states.jobStatus(this.options.id==="RUNNING")&&this._states.next(this.options.id),this._assertStatus("EXECUTING"),V={args:this.args,options:this.options,retryCount:this.retryCount},N=new g(`This job timed out after ${this.options.expiration} ms.`),this._onFailure(N,V,te,C,X)}async _onFailure(te,C,X,N,V){var W,Q;if(X())return W=await this.Events.trigger("failed",te,C),W!=null?(Q=~~W,this.Events.trigger("retry",`Retrying ${this.options.id} after ${Q} ms`,C),this.retryCount++,N(Q)):(this.doDone(C),await V(this.options,C),this._assertStatus("DONE"),this._reject(te))}doDone(te){return this._assertStatus("EXECUTING"),this._states.next(this.options.id),this.Events.trigger("done",te)}};var x=b,A,M,E;E=o,A=m,M=class{constructor(te,C,X){this.instance=te,this.storeOptions=C,this.clientId=this.instance._randomIndex(),E.load(X,X,this),this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now(),this._running=0,this._done=0,this._unblockTime=0,this.ready=this.Promise.resolve(),this.clients={},this._startHeartbeat()}_startHeartbeat(){var te;return this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)?typeof(te=this.heartbeat=setInterval(()=>{var C,X,N,V,W;if(V=Date.now(),this.storeOptions.reservoirRefreshInterval!=null&&V>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval&&(this._lastReservoirRefresh=V,this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount,this.instance._drainAll(this.computeCapacity())),this.storeOptions.reservoirIncreaseInterval!=null&&V>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval&&({reservoirIncreaseAmount:C,reservoirIncreaseMaximum:N,reservoir:W}=this.storeOptions,this._lastReservoirIncrease=V,X=N!=null?Math.min(C,N-W):C,X>0))return this.storeOptions.reservoir+=X,this.instance._drainAll(this.computeCapacity())},this.heartbeatInterval)).unref=="function"?te.unref():void 0:clearInterval(this.heartbeat)}async __publish__(te){return await this.yieldLoop(),this.instance.Events.trigger("message",te.toString())}async __disconnect__(te){return await this.yieldLoop(),clearInterval(this.heartbeat),this.Promise.resolve()}yieldLoop(te=0){return new this.Promise(function(C,X){return setTimeout(C,te)})}computePenalty(){var te;return(te=this.storeOptions.penalty)!=null?te:15*this.storeOptions.minTime||5e3}async __updateSettings__(te){return await this.yieldLoop(),E.overwrite(te,te,this.storeOptions),this._startHeartbeat(),this.instance._drainAll(this.computeCapacity()),!0}async __running__(){return await this.yieldLoop(),this._running}async __queued__(){return await this.yieldLoop(),this.instance.queued()}async __done__(){return await this.yieldLoop(),this._done}async __groupCheck__(te){return await this.yieldLoop(),this._nextRequest+this.timeout=te}check(te,C){return this.conditionsCheck(te)&&this._nextRequest-C<=0}async __check__(te){var C;return await this.yieldLoop(),C=Date.now(),this.check(te,C)}async __register__(te,C,X){var N,V;return await this.yieldLoop(),N=Date.now(),this.conditionsCheck(C)?(this._running+=C,this.storeOptions.reservoir!=null&&(this.storeOptions.reservoir-=C),V=Math.max(this._nextRequest-N,0),this._nextRequest=N+V+this.storeOptions.minTime,{success:!0,wait:V,reservoir:this.storeOptions.reservoir}):{success:!1}}strategyIsBlock(){return this.storeOptions.strategy===3}async __submit__(te,C){var X,N,V;if(await this.yieldLoop(),this.storeOptions.maxConcurrent!=null&&C>this.storeOptions.maxConcurrent)throw new A(`Impossible to add a job having a weight of ${C} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);return N=Date.now(),V=this.storeOptions.highWater!=null&&te===this.storeOptions.highWater&&!this.check(C,N),X=this.strategyIsBlock()&&(V||this.isBlocked(N)),X&&(this._unblockTime=N+this.computePenalty(),this._nextRequest=this._unblockTime+this.storeOptions.minTime,this.instance._dropAllQueued()),{reachedHWM:V,blocked:X,strategy:this.storeOptions.strategy}}async __free__(te,C){return await this.yieldLoop(),this._running-=C,this._done+=C,this.instance._drainAll(this.computeCapacity()),{running:this._running}}};var S=M,P,D;P=m,D=class{constructor(te){this.status=te,this._jobs={},this.counts=this.status.map(function(){return 0})}next(te){var C,X;if(C=this._jobs[te],X=C+1,C!=null&&X(te[this.status[X]]=C,te),{})}};var k=D,U,z;U=l,z=class{constructor(te,C){this.schedule=this.schedule.bind(this),this.name=te,this.Promise=C,this._running=0,this._queue=new U}isEmpty(){return this._queue.length===0}async _tryToRun(){var te,C,X,N,V,W,Q;if(this._running<1&&this._queue.length>0)return this._running++,{task:Q,args:te,resolve:V,reject:N}=this._queue.shift(),C=await async function(){try{return W=await Q(...te),function(){return V(W)}}catch(F){return X=F,function(){return N(X)}}}(),this._running--,this._tryToRun(),C()}schedule(te,...C){var X,N,V;return V=N=null,X=new this.Promise(function(W,Q){return V=W,N=Q}),this._queue.push({task:te,args:C,resolve:V,reject:N}),this._tryToRun(),X}};var G=z,J="2.19.5",B={version:J},fe=Object.freeze({version:J,default:B}),se=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),we=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),xe=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),Ne,oe,Ee,Ce,ne,Re;Re=o,Ne=u,Ce=se,Ee=we,ne=xe,oe=(function(){class ye{constructor(C={}){this.deleteKey=this.deleteKey.bind(this),this.limiterOptions=C,Re.load(this.limiterOptions,this.defaults,this),this.Events=new Ne(this),this.instances={},this.Bottleneck=He,this._startAutoCleanup(),this.sharedConnection=this.connection!=null,this.connection==null&&(this.limiterOptions.datastore==="redis"?this.connection=new Ce(Object.assign({},this.limiterOptions,{Events:this.Events})):this.limiterOptions.datastore==="ioredis"&&(this.connection=new Ee(Object.assign({},this.limiterOptions,{Events:this.Events}))))}key(C=""){var X;return(X=this.instances[C])!=null?X:(()=>{var N;return N=this.instances[C]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${C}`,timeout:this.timeout,connection:this.connection})),this.Events.trigger("created",N,C),N})()}async deleteKey(C=""){var X,N;return N=this.instances[C],this.connection&&(X=await this.connection.__runCommand__(["del",...ne.allKeys(`${this.id}-${C}`)])),N!=null&&(delete this.instances[C],await N.disconnect()),N!=null||X>0}limiters(){var C,X,N,V;X=this.instances,N=[];for(C in X)V=X[C],N.push({key:C,limiter:V});return N}keys(){return Object.keys(this.instances)}async clusterKeys(){var C,X,N,V,W,Q,F,le,ue;if(this.connection==null)return this.Promise.resolve(this.keys());for(Q=[],C=null,ue=`b_${this.id}-`.length,X=9;C!==0;)for([le,N]=await this.connection.__runCommand__(["scan",C??0,"match",`b_${this.id}-*_settings`,"count",1e4]),C=~~le,V=0,F=N.length;V{var X,N,V,W,Q,F;Q=Date.now(),V=this.instances,W=[];for(N in V){F=V[N];try{await F._store.__groupCheck__(Q)?W.push(this.deleteKey(N)):W.push(void 0)}catch(le){X=le,W.push(F.Events.trigger("error",X))}}return W},this.timeout/2)).unref=="function"?C.unref():void 0}updateSettings(C={}){if(Re.overwrite(C,this.defaults,this),Re.overwrite(C,C,this.limiterOptions),C.timeout!=null)return this._startAutoCleanup()}disconnect(C=!0){var X;if(!this.sharedConnection)return(X=this.connection)!=null?X.disconnect(C):void 0}}return ye.prototype.defaults={timeout:1e3*60*5,connection:null,Promise,id:"group-key"},ye}).call(n);var Ae=oe,j,qe,Fe;Fe=o,qe=u,j=(function(){class ye{constructor(C={}){this.options=C,Fe.load(this.options,this.defaults,this),this.Events=new qe(this),this._arr=[],this._resetPromise(),this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise((C,X)=>this._resolve=C)}_flush(){return clearTimeout(this._timeout),this._lastFlush=Date.now(),this._resolve(),this.Events.trigger("batch",this._arr),this._arr=[],this._resetPromise()}add(C){var X;return this._arr.push(C),X=this._promise,this._arr.length===this.maxSize?this._flush():this.maxTime!=null&&this._arr.length===1&&(this._timeout=setTimeout(()=>this._flush(),this.maxTime)),X}}return ye.prototype.defaults={maxTime:null,maxSize:null,Promise},ye}).call(n);var L=j,$=()=>console.log("You must import the full version of Bottleneck in order to use this feature."),ee=s(fe),de,he,ke,O,R,q,K,ae,pe,Me,be,Se=[].splice;q=10,he=5,be=o,K=v,O=x,R=S,ae=$,ke=u,pe=k,Me=G,de=(function(){class ye{constructor(C={},...X){var N,V;this._addToQueue=this._addToQueue.bind(this),this._validateOptions(C,X),be.load(C,this.instanceDefaults,this),this._queues=new K(q),this._scheduled={},this._states=new pe(["RECEIVED","QUEUED","RUNNING","EXECUTING"].concat(this.trackDoneStatus?["DONE"]:[])),this._limiter=null,this.Events=new ke(this),this._submitLock=new Me("submit",this.Promise),this._registerLock=new Me("register",this.Promise),V=be.load(C,this.storeDefaults,{}),this._store=(function(){if(this.datastore==="redis"||this.datastore==="ioredis"||this.connection!=null)return N=be.load(C,this.redisStoreDefaults,{}),new ae(this,V,N);if(this.datastore==="local")return N=be.load(C,this.localStoreDefaults,{}),new R(this,V,N);throw new ye.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}).call(this),this._queues.on("leftzero",()=>{var W;return(W=this._store.heartbeat)!=null&&typeof W.ref=="function"?W.ref():void 0}),this._queues.on("zero",()=>{var W;return(W=this._store.heartbeat)!=null&&typeof W.unref=="function"?W.unref():void 0})}_validateOptions(C,X){if(!(C!=null&&typeof C=="object"&&X.length===0))throw new ye.prototype.BottleneckError("Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.")}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(C){return this._store.__publish__(C)}disconnect(C=!0){return this._store.__disconnect__(C)}chain(C){return this._limiter=C,this}queued(C){return this._queues.queued(C)}clusterQueued(){return this._store.__queued__()}empty(){return this.queued()===0&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(C){return this._states.jobStatus(C)}jobs(C){return this._states.statusJobs(C)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(C=1){return this._store.__check__(C)}_clearGlobalState(C){return this._scheduled[C]!=null?(clearTimeout(this._scheduled[C].expiration),delete this._scheduled[C],!0):!1}async _free(C,X,N,V){var W,Q;try{if({running:Q}=await this._store.__free__(C,N.weight),this.Events.trigger("debug",`Freed ${N.id}`,V),Q===0&&this.empty())return this.Events.trigger("idle")}catch(F){return W=F,this.Events.trigger("error",W)}}_run(C,X,N){var V,W,Q;return X.doRun(),V=this._clearGlobalState.bind(this,C),Q=this._run.bind(this,C,X),W=this._free.bind(this,C,X),this._scheduled[C]={timeout:setTimeout(()=>X.doExecute(this._limiter,V,Q,W),N),expiration:X.options.expiration!=null?setTimeout(function(){return X.doExpire(V,Q,W)},N+X.options.expiration):void 0,job:X}}_drainOne(C){return this._registerLock.schedule(()=>{var X,N,V,W,Q;return this.queued()===0?this.Promise.resolve(null):(Q=this._queues.getFirst(),{options:W,args:X}=V=Q.first(),C!=null&&W.weight>C?this.Promise.resolve(null):(this.Events.trigger("debug",`Draining ${W.id}`,{args:X,options:W}),N=this._randomIndex(),this._store.__register__(N,W.weight,W.expiration).then(({success:F,wait:le,reservoir:ue})=>{var Le;return this.Events.trigger("debug",`Drained ${W.id}`,{success:F,args:X,options:W}),F?(Q.shift(),Le=this.empty(),Le&&this.Events.trigger("empty"),ue===0&&this.Events.trigger("depleted",Le),this._run(N,V,le),this.Promise.resolve(W.weight)):this.Promise.resolve(null)})))})}_drainAll(C,X=0){return this._drainOne(C).then(N=>{var V;return N!=null?(V=C!=null?C-N:C,this._drainAll(V,X+N)):this.Promise.resolve(X)}).catch(N=>this.Events.trigger("error",N))}_dropAllQueued(C){return this._queues.shiftAll(function(X){return X.doDrop({message:C})})}stop(C={}){var X,N;return C=be.load(C,this.stopDefaults),N=V=>{var W;return W=()=>{var Q;return Q=this._states.counts,Q[0]+Q[1]+Q[2]+Q[3]===V},new this.Promise((Q,F)=>W()?Q():this.on("done",()=>{if(W())return this.removeAllListeners("done"),Q()}))},X=C.dropWaitingJobs?(this._run=function(V,W){return W.doDrop({message:C.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule(()=>this._submitLock.schedule(()=>{var V,W,Q;W=this._scheduled;for(V in W)Q=W[V],this.jobStatus(Q.job.options.id)==="RUNNING"&&(clearTimeout(Q.timeout),clearTimeout(Q.expiration),Q.job.doDrop({message:C.dropErrorMessage}));return this._dropAllQueued(C.dropErrorMessage),N(0)}))):this.schedule({priority:q-1,weight:0},()=>N(1)),this._receive=function(V){return V._reject(new ye.prototype.BottleneckError(C.enqueueErrorMessage))},this.stop=()=>this.Promise.reject(new ye.prototype.BottleneckError("stop() has already been called")),X}async _addToQueue(C){var X,N,V,W,Q,F,le;({args:X,options:W}=C);try{({reachedHWM:Q,blocked:N,strategy:le}=await this._store.__submit__(this.queued(),W.weight))}catch(ue){return V=ue,this.Events.trigger("debug",`Could not queue ${W.id}`,{args:X,options:W,error:V}),C.doDrop({error:V}),!1}return N?(C.doDrop(),!0):Q&&(F=le===ye.prototype.strategy.LEAK?this._queues.shiftLastFrom(W.priority):le===ye.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(W.priority+1):le===ye.prototype.strategy.OVERFLOW?C:void 0,F!=null&&F.doDrop(),F==null||le===ye.prototype.strategy.OVERFLOW)?(F==null&&C.doDrop(),Q):(C.doQueue(Q,N),this._queues.push(C),await this._drainAll(),Q)}_receive(C){return this._states.jobStatus(C.options.id)!=null?(C._reject(new ye.prototype.BottleneckError(`A job with the same id already exists (id=${C.options.id})`)),!1):(C.doReceive(),this._submitLock.schedule(this._addToQueue,C))}submit(...C){var X,N,V,W,Q,F,le;return typeof C[0]=="function"?(Q=C,[N,...C]=Q,[X]=Se.call(C,-1),W=be.load({},this.jobDefaults)):(F=C,[W,N,...C]=F,[X]=Se.call(C,-1),W=be.load(W,this.jobDefaults)),le=(...ue)=>new this.Promise(function(Le,$e){return N(...ue,function(...St){return(St[0]!=null?$e:Le)(St)})}),V=new O(le,C,W,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),V.promise.then(function(ue){return typeof X=="function"?X(...ue):void 0}).catch(function(ue){return Array.isArray(ue)?typeof X=="function"?X(...ue):void 0:typeof X=="function"?X(ue):void 0}),this._receive(V)}schedule(...C){var X,N,V;return typeof C[0]=="function"?([V,...C]=C,N={}):[N,V,...C]=C,X=new O(V,C,N,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),this._receive(X),X.promise}wrap(C){var X,N;return X=this.schedule.bind(this),N=function(...V){return X(C.bind(this),...V)},N.withOptions=function(V,...W){return X(V,C,...W)},N}async updateSettings(C={}){return await this._store.__updateSettings__(be.overwrite(C,this.storeDefaults)),be.overwrite(C,this.instanceDefaults,this),this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(C=0){return this._store.__incrementReservoir__(C)}}return ye.default=ye,ye.Events=ke,ye.version=ye.prototype.version=ee.version,ye.strategy=ye.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},ye.BottleneckError=ye.prototype.BottleneckError=m,ye.Group=ye.prototype.Group=Ae,ye.RedisConnection=ye.prototype.RedisConnection=se,ye.IORedisConnection=ye.prototype.IORedisConnection=we,ye.Batcher=ye.prototype.Batcher=L,ye.prototype.jobDefaults={priority:he,weight:1,expiration:null,id:""},ye.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:ye.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null},ye.prototype.localStoreDefaults={Promise,timeout:null,heartbeatInterval:250},ye.prototype.redisStoreDefaults={Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:!1,connection:null},ye.prototype.instanceDefaults={datastore:"local",connection:null,id:"",rejectOnDrop:!0,trackDoneStatus:!1,Promise},ye.prototype.stopDefaults={enqueueErrorMessage:"This limiter has been stopped and cannot accept new jobs.",dropWaitingJobs:!0,dropErrorMessage:"This limiter has been stopped."},ye}).call(n);var He=de,Pe=He;return Pe})})(VP);var j2e=VP.exports;const WP=fd(j2e);async function jP(t,e,n,s){if(!n.request||!n.request.request)throw n;if(n.status>=400&&!t.doNotRetry.includes(n.status)){const i=s.request.retries!=null?s.request.retries:t.retries,r=Math.pow((s.request.retryCount||0)+1,2);throw e.retry.retryRequest(n,i,r)}throw n}async function q2e(t,e,n,s){const i=new WP;return i.on("failed",function(r,o){const a=~~r.request.request.retries,l=~~r.request.request.retryAfter;if(s.request.retryCount=o.retryCount+1,a>o.retryCount)return l*t.retryAfterBaseValue}),i.schedule(Y2e.bind(null,t,e,n),s)}async function Y2e(t,e,n,s){const i=await n(n,s);if(i.data&&i.data.errors&&/Something went wrong while executing your query/.test(i.data.errors[0].message)){const r=new Cl(i.data.errors[0].message,500,{request:s,response:i});return jP(t,e,r,s)}return i}var X2e="6.0.1";function qP(t,e){const n=Object.assign({enabled:!0,retryAfterBaseValue:1e3,doNotRetry:[400,401,403,404,422,451],retries:3},e.retry);return n.enabled&&(t.hook.error("request",jP.bind(null,n,t)),t.hook.wrap("request",q2e.bind(null,n,t))),{retry:{retryRequest:(s,i,r)=>(s.request.request=Object.assign({},s.request.request,{retries:i,retryAfter:r}),s)}}}qP.VERSION=X2e;var K2e="8.2.0",Tv=()=>Promise.resolve();function Z2e(t,e,n){return t.retryLimiter.schedule(J2e,t,e,n)}async function J2e(t,e,n){const s=n.method!=="GET"&&n.method!=="HEAD",{pathname:i}=new URL(n.url,"http://github.test"),r=n.method==="GET"&&i.startsWith("/search/"),o=i.startsWith("/graphql"),l=~~e.retryCount>0?{priority:0,weight:0}:{};t.clustering&&(l.expiration=1e3*60),(s||o)&&await t.write.key(t.id).schedule(l,Tv),s&&t.triggersNotification(i)&&await t.notifications.key(t.id).schedule(l,Tv),r&&await t.search.key(t.id).schedule(l,Tv);const c=t.global.key(t.id).schedule(l,e,n);if(o){const u=await c;if(u.data.errors!=null&&u.data.errors.some(d=>d.type==="RATE_LIMITED"))throw Object.assign(new Error("GraphQL Rate Limit Exceeded"),{response:u,data:u.data})}return c}var Q2e=["/orgs/{org}/invitations","/orgs/{org}/invitations/{invitation_id}","/orgs/{org}/teams/{team_slug}/discussions","/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments","/repos/{owner}/{repo}/collaborators/{username}","/repos/{owner}/{repo}/commits/{commit_sha}/comments","/repos/{owner}/{repo}/issues","/repos/{owner}/{repo}/issues/{issue_number}/comments","/repos/{owner}/{repo}/pulls","/repos/{owner}/{repo}/pulls/{pull_number}/comments","/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies","/repos/{owner}/{repo}/pulls/{pull_number}/merge","/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers","/repos/{owner}/{repo}/pulls/{pull_number}/reviews","/repos/{owner}/{repo}/releases","/teams/{team_id}/discussions","/teams/{team_id}/discussions/{discussion_number}/comments"];function eSe(t){const n=`^(?:${t.map(s=>s.split("/").map(i=>i.startsWith("{")?"(?:.+?)":i).join("/")).map(s=>`(?:${s})`).join("|")})[^/]*$`;return new RegExp(n,"i")}var q3=eSe(Q2e),YP=q3.test.bind(q3),ou={},tSe=function(t,e){ou.global=new t.Group({id:"octokit-global",maxConcurrent:10,...e}),ou.search=new t.Group({id:"octokit-search",maxConcurrent:1,minTime:2e3,...e}),ou.write=new t.Group({id:"octokit-write",maxConcurrent:1,minTime:1e3,...e}),ou.notifications=new t.Group({id:"octokit-notifications",maxConcurrent:1,minTime:3e3,...e})};function zx(t,e){const{enabled:n=!0,Bottleneck:s=WP,id:i="no-id",timeout:r=1e3*60*2,connection:o}=e.throttle||{};if(!n)return{};const a={connection:o,timeout:r};ou.global==null&&tSe(s,a);const l=Object.assign({clustering:o!=null,triggersNotification:YP,fallbackSecondaryRateRetryAfter:60,retryAfterBaseValue:1e3,retryLimiter:new s,id:i,...ou},e.throttle);if(typeof l.onSecondaryRateLimit!="function"||typeof l.onRateLimit!="function")throw new Error(`octokit/plugin-throttling error: + You must pass the onSecondaryRateLimit and onRateLimit error handlers. + See https://octokit.github.io/rest.js/#throttling + + const octokit = new Octokit({ + throttle: { + onSecondaryRateLimit: (retryAfter, options) => {/* ... */}, + onRateLimit: (retryAfter, options) => {/* ... */} + } + }) + `);const c={},u=new s.Events(c);return c.on("secondary-limit",l.onSecondaryRateLimit),c.on("rate-limit",l.onRateLimit),c.on("error",d=>t.log.warn("Error in throttling-plugin limit handler",d)),l.retryLimiter.on("failed",async function(d,h){const[f,v,_]=h.args,{pathname:m}=new URL(_.url,"http://github.test");if(!(m.startsWith("/graphql")&&d.status!==401||d.status===403))return;const y=~~v.retryCount;v.retryCount=y,_.request.retryCount=y;const{wantRetry:b,retryAfter:w=0}=await async function(){var T;if(/\bsecondary rate\b/i.test(d.message)){const x=Number(d.response.headers["retry-after"])||f.fallbackSecondaryRateRetryAfter;return{wantRetry:await u.trigger("secondary-limit",x,_,t,y),retryAfter:x}}if(d.response.headers!=null&&d.response.headers["x-ratelimit-remaining"]==="0"||(((T=d.response.data)==null?void 0:T.errors)??[]).some(x=>x.type==="RATE_LIMITED")){const x=new Date(~~d.response.headers["x-ratelimit-reset"]*1e3).getTime(),A=Math.max(Math.ceil((x-Date.now())/1e3)+1,0);return{wantRetry:await u.trigger("rate-limit",A,_,t,y),retryAfter:A}}return{}}();if(b)return v.retryCount++,w*f.retryAfterBaseValue}),t.hook.wrap("request",Z2e.bind(null,l)),{}}zx.VERSION=K2e;zx.triggersNotification=YP;const XP=Ir(Pxe),nSe=Ir(u2e);var sSe=function(e){return btoa(e)};const Ja=fd(sSe),iSe="4.1.0";function rSe(t){const e=t.clientType||"oauth-app",n=t.baseUrl||"https://github.com",s={clientType:e,allowSignup:t.allowSignup!==!1,clientId:t.clientId,login:t.login||null,redirectUrl:t.redirectUrl||null,state:t.state||Math.random().toString(36).substr(2),url:""};if(e==="oauth-app"){const i="scopes"in t?t.scopes:[];s.scopes=typeof i=="string"?i.split(/[,\s]+/).filter(Boolean):i}return s.url=oSe(`${n}/login/oauth/authorize`,s),s}function oSe(t,e){const n={allowSignup:"allow_signup",clientId:"client_id",login:"login",redirectUrl:"redirect_uri",scopes:"scope",state:"state"};let s=t;return Object.keys(n).filter(i=>e[i]!==null).filter(i=>i!=="scopes"?!0:e.clientType==="github-app"?!1:!Array.isArray(e[i])||e[i].length>0).map(i=>[n[i],`${e[i]}`]).forEach(([i,r],o)=>{s+=o===0?"?":"&",s+=`${i}=${encodeURIComponent(r)}`}),s}function KP(t){const e=t.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(e.baseUrl)?"https://github.com":e.baseUrl.replace("/api/v3","")}async function R0(t,e,n){const s={baseUrl:KP(t),headers:{accept:"application/json"},...n},i=await t(e,s);if("error"in i.data){const r=new Cl(`${i.data.error_description} (${i.data.error}, ${i.data.error_uri})`,400,{request:t.endpoint.merge(e,s),headers:i.headers});throw r.response=i,r}return i}function aSe({request:t=is,...e}){const n=KP(t);return rSe({...e,baseUrl:n})}async function ZP(t){const e=t.request||is,n=await R0(e,"POST /login/oauth/access_token",{client_id:t.clientId,client_secret:t.clientSecret,code:t.code,redirect_uri:t.redirectUrl}),s={clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.data.access_token,scopes:n.data.scope.split(/\s+/).filter(Boolean)};if(t.clientType==="github-app"){if("refresh_token"in n.data){const i=new Date(n.headers.date).getTime();s.refreshToken=n.data.refresh_token,s.expiresAt=Y3(i,n.data.expires_in),s.refreshTokenExpiresAt=Y3(i,n.data.refresh_token_expires_in)}delete s.scopes}return{...n,authentication:s}}function Y3(t,e){return new Date(t+e*1e3).toISOString()}async function JP(t){const e=t.request||is,n={client_id:t.clientId};return"scopes"in t&&Array.isArray(t.scopes)&&(n.scope=t.scopes.join(" ")),R0(e,"POST /login/device/code",n)}async function tb(t){const e=t.request||is,n=await R0(e,"POST /login/oauth/access_token",{client_id:t.clientId,device_code:t.code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),s={clientType:t.clientType,clientId:t.clientId,token:n.data.access_token,scopes:n.data.scope.split(/\s+/).filter(Boolean)};if("clientSecret"in t&&(s.clientSecret=t.clientSecret),t.clientType==="github-app"){if("refresh_token"in n.data){const i=new Date(n.headers.date).getTime();s.refreshToken=n.data.refresh_token,s.expiresAt=X3(i,n.data.expires_in),s.refreshTokenExpiresAt=X3(i,n.data.refresh_token_expires_in)}delete s.scopes}return{...n,authentication:s}}function X3(t,e){return new Date(t+e*1e3).toISOString()}async function QP(t){const n=await(t.request||is)("POST /applications/{client_id}/token",{headers:{authorization:`basic ${Ja(`${t.clientId}:${t.clientSecret}`)}`},client_id:t.clientId,access_token:t.token}),s={clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:t.token,scopes:n.data.scopes};return n.data.expires_at&&(s.expiresAt=n.data.expires_at),t.clientType==="github-app"&&delete s.scopes,{...n,authentication:s}}async function eO(t){const e=t.request||is,n=await R0(e,"POST /login/oauth/access_token",{client_id:t.clientId,client_secret:t.clientSecret,grant_type:"refresh_token",refresh_token:t.refreshToken}),s=new Date(n.headers.date).getTime(),i={clientType:"github-app",clientId:t.clientId,clientSecret:t.clientSecret,token:n.data.access_token,refreshToken:n.data.refresh_token,expiresAt:K3(s,n.data.expires_in),refreshTokenExpiresAt:K3(s,n.data.refresh_token_expires_in)};return{...n,authentication:i}}function K3(t,e){return new Date(t+e*1e3).toISOString()}async function lSe(t){const{request:e,clientType:n,clientId:s,clientSecret:i,token:r,...o}=t,l=await(e||is)("POST /applications/{client_id}/token/scoped",{headers:{authorization:`basic ${Ja(`${s}:${i}`)}`},client_id:s,access_token:r,...o}),c=Object.assign({clientType:n,clientId:s,clientSecret:i,token:l.data.token},l.data.expires_at?{expiresAt:l.data.expires_at}:{});return{...l,authentication:c}}async function tO(t){const e=t.request||is,n=Ja(`${t.clientId}:${t.clientSecret}`),s=await e("PATCH /applications/{client_id}/token",{headers:{authorization:`basic ${n}`},client_id:t.clientId,access_token:t.token}),i={clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:s.data.token,scopes:s.data.scopes};return s.data.expires_at&&(i.expiresAt=s.data.expires_at),t.clientType==="github-app"&&delete i.scopes,{...s,authentication:i}}async function nO(t){const e=t.request||is,n=Ja(`${t.clientId}:${t.clientSecret}`);return e("DELETE /applications/{client_id}/token",{headers:{authorization:`basic ${n}`},client_id:t.clientId,access_token:t.token})}async function sO(t){const e=t.request||is,n=Ja(`${t.clientId}:${t.clientSecret}`);return e("DELETE /applications/{client_id}/grant",{headers:{authorization:`basic ${n}`},client_id:t.clientId,access_token:t.token})}const cSe=Object.freeze(Object.defineProperty({__proto__:null,VERSION:iSe,checkToken:QP,createDeviceCode:JP,deleteAuthorization:sO,deleteToken:nO,exchangeDeviceCode:tb,exchangeWebFlowCode:ZP,getWebFlowAuthorizationUrl:aSe,refreshToken:eO,resetToken:tO,scopeToken:lSe},Symbol.toStringTag,{value:"Module"}));async function iO(t,e){const n=uSe(t,e.auth);if(n)return n;const{data:s}=await JP({clientType:t.clientType,clientId:t.clientId,request:e.request||t.request,scopes:e.auth.scopes||t.scopes});await t.onVerification(s);const i=await nb(e.request||t.request,t.clientId,t.clientType,s);return t.authentication=i,i}function uSe(t,e){if(e.refresh===!0||!t.authentication)return!1;if(t.clientType==="github-app")return t.authentication;const n=t.authentication,s=("scopes"in e&&e.scopes||t.scopes).join(" "),i=n.scopes.join(" ");return s===i?n:!1}async function Z3(t){await new Promise(e=>setTimeout(e,t*1e3))}async function nb(t,e,n,s){try{const i={clientId:e,request:t,code:s.device_code},{authentication:r}=n==="oauth-app"?await tb({...i,clientType:"oauth-app"}):await tb({...i,clientType:"github-app"});return{type:"token",tokenType:"oauth",...r}}catch(i){if(!i.response)throw i;const r=i.response.data.error;if(r==="authorization_pending")return await Z3(s.interval),nb(t,e,n,s);if(r==="slow_down")return await Z3(s.interval+5),nb(t,e,n,s);throw i}}async function dSe(t,e){return iO(t,{auth:e})}async function hSe(t,e,n,s){let i=e.endpoint.merge(n,s);if(/\/login\/(oauth\/access_token|device\/code)$/.test(i.url))return e(i);const{token:r}=await iO(t,{request:e,auth:{type:"oauth"}});return i.headers.authorization=`token ${r}`,e(i)}var fSe="6.1.0";function pSe(t){const e=t.request||is.defaults({headers:{"user-agent":`octokit-auth-oauth-device.js/${fSe} ${Za()}`}}),{request:n=e,...s}=t,i=t.clientType==="github-app"?{...s,clientType:"github-app",request:n}:{...s,clientType:"oauth-app",request:n,scopes:t.scopes||[]};if(!t.clientId)throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');if(!t.onVerification)throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');return Object.assign(dSe.bind(null,i),{hook:hSe.bind(null,i)})}var rO="4.1.0";async function J3(t){if("code"in t.strategyOptions){const{authentication:e}=await ZP({clientId:t.clientId,clientSecret:t.clientSecret,clientType:t.clientType,onTokenCreated:t.onTokenCreated,...t.strategyOptions,request:t.request});return{type:"token",tokenType:"oauth",...e}}if("onVerification"in t.strategyOptions){const n=await pSe({clientType:t.clientType,clientId:t.clientId,onTokenCreated:t.onTokenCreated,...t.strategyOptions,request:t.request})({type:"oauth"});return{clientSecret:t.clientSecret,...n}}if("token"in t.strategyOptions)return{type:"token",tokenType:"oauth",clientId:t.clientId,clientSecret:t.clientSecret,clientType:t.clientType,onTokenCreated:t.onTokenCreated,...t.strategyOptions};throw new Error("[@octokit/auth-oauth-user] Invalid strategy options")}async function sb(t,e={}){var s,i;if(t.authentication||(t.authentication=t.clientType==="oauth-app"?await J3(t):await J3(t)),t.authentication.invalid)throw new Error("[@octokit/auth-oauth-user] Token is invalid");const n=t.authentication;if("expiresAt"in n&&(e.type==="refresh"||new Date(n.expiresAt){typeof ib.emitWarning=="function"?ib.emitWarning(t,e,n,s):console.error(`[${n}] ${e}: ${t}`)};let i_=globalThis.AbortController,nM=globalThis.AbortSignal;var zR;if(typeof i_>"u"){nM=class{constructor(){Te(this,"onabort");Te(this,"_onabort",[]);Te(this,"reason");Te(this,"aborted",!1)}addEventListener(s,i){this._onabort.push(i)}},i_=class{constructor(){Te(this,"signal",new nM);e()}abort(s){var i,r;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const o of this.signal._onabort)o(s);(r=(i=this.signal).onabort)==null||r.call(i,s)}}};let t=((zR=ib.env)==null?void 0:zR.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{t&&(t=!1,uO("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const RSe=t=>!cO.has(t),ia=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),dO=t=>ia(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cg:null:null;class cg extends Array{constructor(e){super(e),this.fill(0)}}var Iu;const Il=class Il{constructor(e,n){Te(this,"heap");Te(this,"length");if(!H(Il,Iu))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0}static create(e){const n=dO(e);if(!n)return[];rt(Il,Iu,!0);const s=new Il(e,n);return rt(Il,Iu,!1),s}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Iu=new WeakMap,_t(Il,Iu,!1);let rb=Il;var $i,Qs,Bi,Hi,Lu,Un,Gi,Dn,on,dt,Es,ei,us,qn,zi,Yn,Vi,Wi,ti,ji,ya,Ts,Lf,ab,Wl,ao,Df,ni,g_,hO,jl,Du,Nf,pr,ra,mr,oa,Ff,lb,k8e,Nu,ug,Fu,dg,Xt,rn,Uf,cb,ql,Ah;const m2=class m2{constructor(e){_t(this,Lf);_t(this,g_);_t(this,pr);_t(this,mr);_t(this,Ff);_t(this,Nu);_t(this,Fu);_t(this,Xt);_t(this,Uf);_t(this,ql);_t(this,$i,void 0);_t(this,Qs,void 0);_t(this,Bi,void 0);_t(this,Hi,void 0);_t(this,Lu,void 0);Te(this,"ttl");Te(this,"ttlResolution");Te(this,"ttlAutopurge");Te(this,"updateAgeOnGet");Te(this,"updateAgeOnHas");Te(this,"allowStale");Te(this,"noDisposeOnSet");Te(this,"noUpdateTTL");Te(this,"maxEntrySize");Te(this,"sizeCalculation");Te(this,"noDeleteOnFetchRejection");Te(this,"noDeleteOnStaleGet");Te(this,"allowStaleOnFetchAbort");Te(this,"allowStaleOnFetchRejection");Te(this,"ignoreFetchAbort");_t(this,Un,void 0);_t(this,Gi,void 0);_t(this,Dn,void 0);_t(this,on,void 0);_t(this,dt,void 0);_t(this,Es,void 0);_t(this,ei,void 0);_t(this,us,void 0);_t(this,qn,void 0);_t(this,zi,void 0);_t(this,Yn,void 0);_t(this,Vi,void 0);_t(this,Wi,void 0);_t(this,ti,void 0);_t(this,ji,void 0);_t(this,ya,void 0);_t(this,Ts,void 0);_t(this,Wl,()=>{});_t(this,ao,()=>{});_t(this,Df,()=>{});_t(this,ni,()=>!1);_t(this,jl,e=>{});_t(this,Du,(e,n,s)=>{});_t(this,Nf,(e,n,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Te(this,k8e,"LRUCache");const{max:n=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:c,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:h,maxSize:f=0,maxEntrySize:v=0,sizeCalculation:_,fetchMethod:m,noDeleteOnFetchRejection:g,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:w,ignoreFetchAbort:T}=e;if(n!==0&&!ia(n))throw new TypeError("max option must be a nonnegative integer");const x=n?dO(n):Array;if(!x)throw new Error("invalid max value: "+n);if(rt(this,$i,n),rt(this,Qs,f),this.maxEntrySize=v||H(this,Qs),this.sizeCalculation=_,this.sizeCalculation){if(!H(this,Qs)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(rt(this,Lu,m),rt(this,ya,!!m),rt(this,Dn,new Map),rt(this,on,new Array(n).fill(void 0)),rt(this,dt,new Array(n).fill(void 0)),rt(this,Es,new x(n)),rt(this,ei,new x(n)),rt(this,us,0),rt(this,qn,0),rt(this,zi,rb.create(n)),rt(this,Un,0),rt(this,Gi,0),typeof c=="function"&&rt(this,Bi,c),typeof u=="function"?(rt(this,Hi,u),rt(this,Yn,[])):(rt(this,Hi,void 0),rt(this,Yn,void 0)),rt(this,ji,!!H(this,Bi)),rt(this,Ts,!!H(this,Hi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!g,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(H(this,Qs)!==0&&!ia(H(this,Qs)))throw new TypeError("maxSize must be a positive integer if specified");if(!ia(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Qe(this,g_,hO).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ia(i)||i===0?i:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!ia(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Qe(this,Lf,ab).call(this)}if(H(this,$i)===0&&this.ttl===0&&H(this,Qs)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!H(this,$i)&&!H(this,Qs)){const A="LRU_CACHE_UNBOUNDED";RSe(A)&&(cO.add(A),uO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,m2))}}static unsafeExposeInternals(e){return{starts:H(e,Wi),ttls:H(e,ti),sizes:H(e,Vi),keyMap:H(e,Dn),keyList:H(e,on),valList:H(e,dt),next:H(e,Es),prev:H(e,ei),get head(){return H(e,us)},get tail(){return H(e,qn)},free:H(e,zi),isBackgroundFetch:n=>{var s;return Qe(s=e,Xt,rn).call(s,n)},backgroundFetch:(n,s,i,r)=>{var o;return Qe(o=e,Fu,dg).call(o,n,s,i,r)},moveToTail:n=>{var s;return Qe(s=e,ql,Ah).call(s,n)},indexes:n=>{var s;return Qe(s=e,pr,ra).call(s,n)},rindexes:n=>{var s;return Qe(s=e,mr,oa).call(s,n)},isStale:n=>{var s;return H(s=e,ni).call(s,n)}}}get max(){return H(this,$i)}get maxSize(){return H(this,Qs)}get calculatedSize(){return H(this,Gi)}get size(){return H(this,Un)}get fetchMethod(){return H(this,Lu)}get dispose(){return H(this,Bi)}get disposeAfter(){return H(this,Hi)}getRemainingTTL(e){return H(this,Dn).has(e)?1/0:0}*entries(){for(const e of Qe(this,pr,ra).call(this))H(this,dt)[e]!==void 0&&H(this,on)[e]!==void 0&&!Qe(this,Xt,rn).call(this,H(this,dt)[e])&&(yield[H(this,on)[e],H(this,dt)[e]])}*rentries(){for(const e of Qe(this,mr,oa).call(this))H(this,dt)[e]!==void 0&&H(this,on)[e]!==void 0&&!Qe(this,Xt,rn).call(this,H(this,dt)[e])&&(yield[H(this,on)[e],H(this,dt)[e]])}*keys(){for(const e of Qe(this,pr,ra).call(this)){const n=H(this,on)[e];n!==void 0&&!Qe(this,Xt,rn).call(this,H(this,dt)[e])&&(yield n)}}*rkeys(){for(const e of Qe(this,mr,oa).call(this)){const n=H(this,on)[e];n!==void 0&&!Qe(this,Xt,rn).call(this,H(this,dt)[e])&&(yield n)}}*values(){for(const e of Qe(this,pr,ra).call(this))H(this,dt)[e]!==void 0&&!Qe(this,Xt,rn).call(this,H(this,dt)[e])&&(yield H(this,dt)[e])}*rvalues(){for(const e of Qe(this,mr,oa).call(this))H(this,dt)[e]!==void 0&&!Qe(this,Xt,rn).call(this,H(this,dt)[e])&&(yield H(this,dt)[e])}[Symbol.iterator](){return this.entries()}find(e,n={}){for(const s of Qe(this,pr,ra).call(this)){const i=H(this,dt)[s],r=Qe(this,Xt,rn).call(this,i)?i.__staleWhileFetching:i;if(r!==void 0&&e(r,H(this,on)[s],this))return this.get(H(this,on)[s],n)}}forEach(e,n=this){for(const s of Qe(this,pr,ra).call(this)){const i=H(this,dt)[s],r=Qe(this,Xt,rn).call(this,i)?i.__staleWhileFetching:i;r!==void 0&&e.call(n,r,H(this,on)[s],this)}}rforEach(e,n=this){for(const s of Qe(this,mr,oa).call(this)){const i=H(this,dt)[s],r=Qe(this,Xt,rn).call(this,i)?i.__staleWhileFetching:i;r!==void 0&&e.call(n,r,H(this,on)[s],this)}}purgeStale(){let e=!1;for(const n of Qe(this,mr,oa).call(this,{allowStale:!0}))H(this,ni).call(this,n)&&(this.delete(H(this,on)[n]),e=!0);return e}info(e){const n=H(this,Dn).get(e);if(n===void 0)return;const s=H(this,dt)[n],i=Qe(this,Xt,rn).call(this,s)?s.__staleWhileFetching:s;if(i===void 0)return;const r={value:i};if(H(this,ti)&&H(this,Wi)){const o=H(this,ti)[n],a=H(this,Wi)[n];if(o&&a){const l=o-(Wc.now()-a);r.ttl=l,r.start=Date.now()}}return H(this,Vi)&&(r.size=H(this,Vi)[n]),r}dump(){const e=[];for(const n of Qe(this,pr,ra).call(this,{allowStale:!0})){const s=H(this,on)[n],i=H(this,dt)[n],r=Qe(this,Xt,rn).call(this,i)?i.__staleWhileFetching:i;if(r===void 0||s===void 0)continue;const o={value:r};if(H(this,ti)&&H(this,Wi)){o.ttl=H(this,ti)[n];const a=Wc.now()-H(this,Wi)[n];o.start=Math.floor(Date.now()-a)}H(this,Vi)&&(o.size=H(this,Vi)[n]),e.unshift([s,o])}return e}load(e){this.clear();for(const[n,s]of e){if(s.start){const i=Date.now()-s.start;s.start=Wc.now()-i}this.set(n,s.value,s)}}set(e,n,s={}){var h,f,v,_,m;if(n===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s;let{noUpdateTTL:c=this.noUpdateTTL}=s;const u=H(this,Nf).call(this,e,n,s.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let d=H(this,Un)===0?void 0:H(this,Dn).get(e);if(d===void 0)d=H(this,Un)===0?H(this,qn):H(this,zi).length!==0?H(this,zi).pop():H(this,Un)===H(this,$i)?Qe(this,Nu,ug).call(this,!1):H(this,Un),H(this,on)[d]=e,H(this,dt)[d]=n,H(this,Dn).set(e,d),H(this,Es)[H(this,qn)]=d,H(this,ei)[d]=H(this,qn),rt(this,qn,d),hp(this,Un)._++,H(this,Du).call(this,d,u,l),l&&(l.set="add"),c=!1;else{Qe(this,ql,Ah).call(this,d);const g=H(this,dt)[d];if(n!==g){if(H(this,ya)&&Qe(this,Xt,rn).call(this,g)){g.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:y}=g;y!==void 0&&!o&&(H(this,ji)&&((h=H(this,Bi))==null||h.call(this,y,e,"set")),H(this,Ts)&&((f=H(this,Yn))==null||f.push([y,e,"set"])))}else o||(H(this,ji)&&((v=H(this,Bi))==null||v.call(this,g,e,"set")),H(this,Ts)&&((_=H(this,Yn))==null||_.push([g,e,"set"])));if(H(this,jl).call(this,d),H(this,Du).call(this,d,u,l),H(this,dt)[d]=n,l){l.set="replace";const y=g&&Qe(this,Xt,rn).call(this,g)?g.__staleWhileFetching:g;y!==void 0&&(l.oldValue=y)}}else l&&(l.set="update")}if(i!==0&&!H(this,ti)&&Qe(this,Lf,ab).call(this),H(this,ti)&&(c||H(this,Df).call(this,d,i,r),l&&H(this,ao).call(this,l,d)),!o&&H(this,Ts)&&H(this,Yn)){const g=H(this,Yn);let y;for(;y=g==null?void 0:g.shift();)(m=H(this,Hi))==null||m.call(this,...y)}return this}pop(){var e;try{for(;H(this,Un);){const n=H(this,dt)[H(this,us)];if(Qe(this,Nu,ug).call(this,!0),Qe(this,Xt,rn).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(H(this,Ts)&&H(this,Yn)){const n=H(this,Yn);let s;for(;s=n==null?void 0:n.shift();)(e=H(this,Hi))==null||e.call(this,...s)}}}has(e,n={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=n,r=H(this,Dn).get(e);if(r!==void 0){const o=H(this,dt)[r];if(Qe(this,Xt,rn).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(H(this,ni).call(this,r))i&&(i.has="stale",H(this,ao).call(this,i,r));else return s&&H(this,Wl).call(this,r),i&&(i.has="hit",H(this,ao).call(this,i,r)),!0}else i&&(i.has="miss");return!1}peek(e,n={}){const{allowStale:s=this.allowStale}=n,i=H(this,Dn).get(e);if(i===void 0||!s&&H(this,ni).call(this,i))return;const r=H(this,dt)[i];return Qe(this,Xt,rn).call(this,r)?r.__staleWhileFetching:r}async fetch(e,n={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:_,forceRefresh:m=!1,status:g,signal:y}=n;if(!H(this,ya))return g&&(g.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:g});const b={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:v,ignoreFetchAbort:f,status:g,signal:y};let w=H(this,Dn).get(e);if(w===void 0){g&&(g.fetch="miss");const T=Qe(this,Fu,dg).call(this,e,w,b,_);return T.__returned=T}else{const T=H(this,dt)[w];if(Qe(this,Xt,rn).call(this,T)){const S=s&&T.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",S&&(g.returnedStale=!0)),S?T.__staleWhileFetching:T.__returned=T}const x=H(this,ni).call(this,w);if(!m&&!x)return g&&(g.fetch="hit"),Qe(this,ql,Ah).call(this,w),i&&H(this,Wl).call(this,w),g&&H(this,ao).call(this,g,w),T;const A=Qe(this,Fu,dg).call(this,e,w,b,_),E=A.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=x?"stale":"refresh",E&&x&&(g.returnedStale=!0)),E?A.__staleWhileFetching:A.__returned=A}}get(e,n={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=n,a=H(this,Dn).get(e);if(a!==void 0){const l=H(this,dt)[a],c=Qe(this,Xt,rn).call(this,l);return o&&H(this,ao).call(this,o,a),H(this,ni).call(this,a)?(o&&(o.get="stale"),c?(o&&s&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?l.__staleWhileFetching:void 0):(r||this.delete(e),o&&s&&(o.returnedStale=!0),s?l:void 0)):(o&&(o.get="hit"),c?l.__staleWhileFetching:(Qe(this,ql,Ah).call(this,a),i&&H(this,Wl).call(this,a),l))}else o&&(o.get="miss")}delete(e){var s,i,r,o;let n=!1;if(H(this,Un)!==0){const a=H(this,Dn).get(e);if(a!==void 0)if(n=!0,H(this,Un)===1)this.clear();else{H(this,jl).call(this,a);const l=H(this,dt)[a];if(Qe(this,Xt,rn).call(this,l)?l.__abortController.abort(new Error("deleted")):(H(this,ji)||H(this,Ts))&&(H(this,ji)&&((s=H(this,Bi))==null||s.call(this,l,e,"delete")),H(this,Ts)&&((i=H(this,Yn))==null||i.push([l,e,"delete"]))),H(this,Dn).delete(e),H(this,on)[a]=void 0,H(this,dt)[a]=void 0,a===H(this,qn))rt(this,qn,H(this,ei)[a]);else if(a===H(this,us))rt(this,us,H(this,Es)[a]);else{const c=H(this,ei)[a];H(this,Es)[c]=H(this,Es)[a];const u=H(this,Es)[a];H(this,ei)[u]=H(this,ei)[a]}hp(this,Un)._--,H(this,zi).push(a)}}if(H(this,Ts)&&((r=H(this,Yn))!=null&&r.length)){const a=H(this,Yn);let l;for(;l=a==null?void 0:a.shift();)(o=H(this,Hi))==null||o.call(this,...l)}return n}clear(){var e,n,s;for(const i of Qe(this,mr,oa).call(this,{allowStale:!0})){const r=H(this,dt)[i];if(Qe(this,Xt,rn).call(this,r))r.__abortController.abort(new Error("deleted"));else{const o=H(this,on)[i];H(this,ji)&&((e=H(this,Bi))==null||e.call(this,r,o,"delete")),H(this,Ts)&&((n=H(this,Yn))==null||n.push([r,o,"delete"]))}}if(H(this,Dn).clear(),H(this,dt).fill(void 0),H(this,on).fill(void 0),H(this,ti)&&H(this,Wi)&&(H(this,ti).fill(0),H(this,Wi).fill(0)),H(this,Vi)&&H(this,Vi).fill(0),rt(this,us,0),rt(this,qn,0),H(this,zi).length=0,rt(this,Gi,0),rt(this,Un,0),H(this,Ts)&&H(this,Yn)){const i=H(this,Yn);let r;for(;r=i==null?void 0:i.shift();)(s=H(this,Hi))==null||s.call(this,...r)}}};k8e=Symbol.toStringTag,$i=new WeakMap,Qs=new WeakMap,Bi=new WeakMap,Hi=new WeakMap,Lu=new WeakMap,Un=new WeakMap,Gi=new WeakMap,Dn=new WeakMap,on=new WeakMap,dt=new WeakMap,Es=new WeakMap,ei=new WeakMap,us=new WeakMap,qn=new WeakMap,zi=new WeakMap,Yn=new WeakMap,Vi=new WeakMap,Wi=new WeakMap,ti=new WeakMap,ji=new WeakMap,ya=new WeakMap,Ts=new WeakMap,Lf=new WeakSet,ab=function(){const e=new cg(H(this,$i)),n=new cg(H(this,$i));rt(this,ti,e),rt(this,Wi,n),rt(this,Df,(r,o,a=Wc.now())=>{if(n[r]=o!==0?a:0,e[r]=o,o!==0&&this.ttlAutopurge){const l=setTimeout(()=>{H(this,ni).call(this,r)&&this.delete(H(this,on)[r])},o+1);l.unref&&l.unref()}}),rt(this,Wl,r=>{n[r]=e[r]!==0?Wc.now():0}),rt(this,ao,(r,o)=>{if(e[o]){const a=e[o],l=n[o];if(!a||!l)return;r.ttl=a,r.start=l,r.now=s||i();const c=r.now-l;r.remainingTTL=a-c}});let s=0;const i=()=>{const r=Wc.now();if(this.ttlResolution>0){s=r;const o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return r};this.getRemainingTTL=r=>{const o=H(this,Dn).get(r);if(o===void 0)return 0;const a=e[o],l=n[o];if(!a||!l)return 1/0;const c=(s||i())-l;return a-c},rt(this,ni,r=>{const o=n[r],a=e[r];return!!a&&!!o&&(s||i())-o>a})},Wl=new WeakMap,ao=new WeakMap,Df=new WeakMap,ni=new WeakMap,g_=new WeakSet,hO=function(){const e=new cg(H(this,$i));rt(this,Gi,0),rt(this,Vi,e),rt(this,jl,n=>{rt(this,Gi,H(this,Gi)-e[n]),e[n]=0}),rt(this,Nf,(n,s,i,r)=>{if(Qe(this,Xt,rn).call(this,s))return 0;if(!ia(i))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(i=r(s,n),!ia(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),rt(this,Du,(n,s,i)=>{if(e[n]=s,H(this,Qs)){const r=H(this,Qs)-e[n];for(;H(this,Gi)>r;)Qe(this,Nu,ug).call(this,!0)}rt(this,Gi,H(this,Gi)+e[n]),i&&(i.entrySize=s,i.totalCalculatedSize=H(this,Gi))})},jl=new WeakMap,Du=new WeakMap,Nf=new WeakMap,pr=new WeakSet,ra=function*({allowStale:e=this.allowStale}={}){if(H(this,Un))for(let n=H(this,qn);!(!Qe(this,Ff,lb).call(this,n)||((e||!H(this,ni).call(this,n))&&(yield n),n===H(this,us)));)n=H(this,ei)[n]},mr=new WeakSet,oa=function*({allowStale:e=this.allowStale}={}){if(H(this,Un))for(let n=H(this,us);!(!Qe(this,Ff,lb).call(this,n)||((e||!H(this,ni).call(this,n))&&(yield n),n===H(this,qn)));)n=H(this,Es)[n]},Ff=new WeakSet,lb=function(e){return e!==void 0&&H(this,Dn).get(H(this,on)[e])===e},Nu=new WeakSet,ug=function(e){var r,o;const n=H(this,us),s=H(this,on)[n],i=H(this,dt)[n];return H(this,ya)&&Qe(this,Xt,rn).call(this,i)?i.__abortController.abort(new Error("evicted")):(H(this,ji)||H(this,Ts))&&(H(this,ji)&&((r=H(this,Bi))==null||r.call(this,i,s,"evict")),H(this,Ts)&&((o=H(this,Yn))==null||o.push([i,s,"evict"]))),H(this,jl).call(this,n),e&&(H(this,on)[n]=void 0,H(this,dt)[n]=void 0,H(this,zi).push(n)),H(this,Un)===1?(rt(this,us,rt(this,qn,0)),H(this,zi).length=0):rt(this,us,H(this,Es)[n]),H(this,Dn).delete(s),hp(this,Un)._--,n},Fu=new WeakSet,dg=function(e,n,s,i){const r=n===void 0?void 0:H(this,dt)[n];if(Qe(this,Xt,rn).call(this,r))return r;const o=new i_,{signal:a}=s;a==null||a.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});const l={signal:o.signal,options:s,context:i},c=(_,m=!1)=>{const{aborted:g}=o.signal,y=s.ignoreFetchAbort&&_!==void 0;if(s.status&&(g&&!m?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),g&&!y&&!m)return d(o.signal.reason);const b=f;return H(this,dt)[n]===f&&(_===void 0?b.__staleWhileFetching?H(this,dt)[n]=b.__staleWhileFetching:this.delete(e):(s.status&&(s.status.fetchUpdated=!0),this.set(e,_,l.options))),_},u=_=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=_),d(_)),d=_=>{const{aborted:m}=o.signal,g=m&&s.allowStaleOnFetchAbort,y=g||s.allowStaleOnFetchRejection,b=y||s.noDeleteOnFetchRejection,w=f;if(H(this,dt)[n]===f&&(!b||w.__staleWhileFetching===void 0?this.delete(e):g||(H(this,dt)[n]=w.__staleWhileFetching)),y)return s.status&&w.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw _},h=(_,m)=>{var y;const g=(y=H(this,Lu))==null?void 0:y.call(this,e,r,l);g&&g instanceof Promise&&g.then(b=>_(b===void 0?void 0:b),m),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(_(void 0),s.allowStaleOnFetchAbort&&(_=b=>c(b,!0)))})};s.status&&(s.status.fetchDispatched=!0);const f=new Promise(h).then(c,u),v=Object.assign(f,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return n===void 0?(this.set(e,v,{...l.options,status:void 0}),n=H(this,Dn).get(e)):H(this,dt)[n]=v,v},Xt=new WeakSet,rn=function(e){if(!H(this,ya))return!1;const n=e;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof i_},Uf=new WeakSet,cb=function(e,n){H(this,ei)[n]=e,H(this,Es)[e]=n},ql=new WeakSet,Ah=function(e){e!==H(this,qn)&&(e===H(this,us)?rt(this,us,H(this,Es)[e]):Qe(this,Uf,cb).call(this,H(this,ei)[e],H(this,Es)[e]),Qe(this,Uf,cb).call(this,H(this,qn),e),rt(this,qn,e))};let ob=m2;C0.LRUCache=ob;const Ld=Ir(_Se);var kSe=Object.create,P0=Object.defineProperty,CSe=Object.getOwnPropertyDescriptor,PSe=Object.getOwnPropertyNames,OSe=Object.getPrototypeOf,ISe=Object.prototype.hasOwnProperty,LSe=(t,e)=>{for(var n in e)P0(t,n,{get:e[n],enumerable:!0})},fO=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of PSe(e))!ISe.call(t,i)&&i!==n&&P0(t,i,{get:()=>e[i],enumerable:!(s=CSe(e,i))||s.enumerable});return t},DSe=(t,e,n)=>(n=t!=null?kSe(OSe(t)):{},fO(!t||!t.__esModule?P0(n,"default",{value:t,enumerable:!0}):n,t)),NSe=t=>fO(P0({},"__esModule",{value:!0}),t),pO={};LSe(pO,{createAppAuth:()=>sEe,createOAuthUserAuth:()=>nEe.createOAuthUserAuth});var Wx=NSe(pO),FSe=XP,USe=nSe,$Se=k0,BSe=SSe;DSe(k0);var HSe=MSe;async function r_({appId:t,privateKey:e,timeDifference:n}){try{const s=await(0,HSe.githubAppJwt)({id:+t,privateKey:e,now:n&&Math.floor(Date.now()/1e3)+n});return{type:"app",token:s.token,appId:s.appId,expiresAt:new Date(s.expiration*1e3).toISOString()}}catch(s){throw e==="-----BEGIN RSA PRIVATE KEY-----"?new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'"):s}}var GSe=C0;function zSe(){return new GSe.LRUCache({max:15e3,ttl:1e3*60*59})}async function VSe(t,e){const n=mO(e),s=await t.get(n);if(!s)return;const[i,r,o,a,l,c]=s.split("|"),u=e.permissions||l.split(/,/).reduce((d,h)=>(/!$/.test(h)?d[h.slice(0,-1)]="write":d[h]="read",d),{});return{token:i,createdAt:r,expiresAt:o,permissions:u,repositoryIds:e.repositoryIds,repositoryNames:e.repositoryNames,singleFileName:c,repositorySelection:a}}async function WSe(t,e,n){const s=mO(e),i=e.permissions?"":Object.keys(n.permissions).map(o=>`${o}${n.permissions[o]==="write"?"!":""}`).join(","),r=[n.token,n.createdAt,n.expiresAt,n.repositorySelection,i,n.singleFileName].join("|");await t.set(s,r)}function mO({installationId:t,permissions:e={},repositoryIds:n=[],repositoryNames:s=[]}){const i=Object.keys(e).sort().map(a=>e[a]==="read"?a:`${a}!`).join(","),r=n.sort().join(","),o=s.join(",");return[t,r,o,i].filter(Boolean).join("|")}function sM({installationId:t,token:e,createdAt:n,expiresAt:s,repositorySelection:i,permissions:r,repositoryIds:o,repositoryNames:a,singleFileName:l}){return Object.assign({type:"token",tokenType:"installation",token:e,installationId:t,permissions:r,createdAt:n,expiresAt:s,repositorySelection:i},o?{repositoryIds:o}:null,a?{repositoryNames:a}:null,l?{singleFileName:l}:null)}async function gO(t,e,n){const s=Number(e.installationId||t.installationId);if(!s)throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");if(e.factory){const{type:y,factory:b,oauthApp:w,...T}={...t,...e};return b(T)}const i=Object.assign({installationId:s},e);if(!e.refresh){const y=await VSe(t.cache,i);if(y){const{token:b,createdAt:w,expiresAt:T,permissions:x,repositoryIds:A,repositoryNames:M,singleFileName:E,repositorySelection:S}=y;return sM({installationId:s,token:b,createdAt:w,expiresAt:T,permissions:x,repositorySelection:S,repositoryIds:A,repositoryNames:M,singleFileName:E})}}const r=await r_(t),o=n||t.request,{data:{token:a,expires_at:l,repositories:c,permissions:u,repository_selection:d,single_file:h}}=await o("POST /app/installations/{installation_id}/access_tokens",{installation_id:s,repository_ids:e.repositoryIds,repositories:e.repositoryNames,permissions:e.permissions,mediaType:{previews:["machine-man"]},headers:{authorization:`bearer ${r.token}`}}),f=u||{},v=d||"all",_=c?c.map(y=>y.id):void 0,m=c?c.map(y=>y.name):void 0,g=new Date().toISOString();return await WSe(t.cache,i,{token:a,createdAt:g,expiresAt:l,repositorySelection:v,permissions:f,repositoryIds:_,repositoryNames:m,singleFileName:h}),sM({installationId:s,token:a,createdAt:g,expiresAt:l,repositorySelection:v,permissions:f,repositoryIds:_,repositoryNames:m,singleFileName:h})}async function jSe(t,e){switch(e.type){case"app":return r_(t);case"oauth":t.log.warn(new BSe.Deprecation('[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead'));case"oauth-app":return t.oauthApp({type:"oauth-app"});case"installation":return gO(t,{...e,type:"installation"});case"oauth-user":return t.oauthApp(e);default:throw new Error(`Invalid auth type: ${e.type}`)}}var qSe=Ld,YSe=["/app","/app/hook/config","/app/hook/deliveries","/app/hook/deliveries/{delivery_id}","/app/hook/deliveries/{delivery_id}/attempts","/app/installations","/app/installations/{installation_id}","/app/installations/{installation_id}/access_tokens","/app/installations/{installation_id}/suspended","/app/installation-requests","/marketplace_listing/accounts/{account_id}","/marketplace_listing/plan","/marketplace_listing/plans","/marketplace_listing/plans/{plan_id}/accounts","/marketplace_listing/stubbed/accounts/{account_id}","/marketplace_listing/stubbed/plan","/marketplace_listing/stubbed/plans","/marketplace_listing/stubbed/plans/{plan_id}/accounts","/orgs/{org}/installation","/repos/{owner}/{repo}/installation","/users/{username}/installation"];function XSe(t){const n=`^(?:${t.map(s=>s.split("/").map(i=>i.startsWith("{")?"(?:.+?)":i).join("/")).map(s=>`(?:${s})`).join("|")})$`;return new RegExp(n,"i")}var KSe=XSe(YSe);function ZSe(t){return!!t&&KSe.test(t.split("?")[0])}var JSe=5*1e3;function QSe(t){return!(t.message.match(/'Expiration time' claim \('exp'\) must be a numeric value representing the future time at which the assertion expires/)||t.message.match(/'Issued at' claim \('iat'\) must be an Integer representing the time that the assertion was issued/))}async function eEe(t,e,n,s){const i=e.endpoint.merge(n,s),r=i.url;if(/\/login\/oauth\/access_token$/.test(r))return e(i);if(ZSe(r.replace(e.endpoint.DEFAULTS.baseUrl,""))){const{token:l}=await r_(t);i.headers.authorization=`bearer ${l}`;let c;try{c=await e(i)}catch(u){if(QSe(u)||typeof u.response.headers.date>"u")throw u;const d=Math.floor((Date.parse(u.response.headers.date)-Date.parse(new Date().toString()))/1e3);t.log.warn(u.message),t.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${d} seconds. Retrying request with the difference accounted for.`);const{token:h}=await r_({...t,timeDifference:d});return i.headers.authorization=`bearer ${h}`,e(i)}return c}if((0,qSe.requiresBasicAuth)(r)){const l=await t.oauthApp({type:"oauth-app"});return i.headers.authorization=l.headers.authorization,e(i)}const{token:o,createdAt:a}=await gO(t,{},e);return i.headers.authorization=`token ${o}`,_O(t,e,i,a)}async function _O(t,e,n,s,i=0){const r=+new Date-+new Date(s);try{return await e(n)}catch(o){if(o.status!==401)throw o;if(r>=JSe)throw i>0&&(o.message=`After ${i} retries within ${r/1e3}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`),o;++i;const a=i*1e3;return t.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${i}, wait: ${a/1e3}s)`),await new Promise(l=>setTimeout(l,a)),_O(t,e,n,s,i)}}var tEe="6.1.1",nEe=Ld;function sEe(t){if(!t.appId)throw new Error("[@octokit/auth-app] appId option is required");if(!Number.isFinite(+t.appId))throw new Error("[@octokit/auth-app] appId option must be a number or numeric string");if(!t.privateKey)throw new Error("[@octokit/auth-app] privateKey option is required");if("installationId"in t&&!t.installationId)throw new Error("[@octokit/auth-app] installationId is set to a falsy value");const e=Object.assign({warn:console.warn.bind(console)},t.log),n=t.request||USe.request.defaults({headers:{"user-agent":`octokit-auth-app.js/${tEe} ${(0,FSe.getUserAgent)()}`}}),s=Object.assign({request:n,cache:zSe()},t,t.installationId?{installationId:Number(t.installationId)}:{},{log:e,oauthApp:(0,$Se.createOAuthAppAuth)({clientType:"github-app",clientId:t.clientId||"",clientSecret:t.clientSecret||"",request:n})});return Object.assign(jSe.bind(null,s),{hook:eEe.bind(null,s)})}const iEe=Ir(M2e),gc=Ir(cSe);async function rEe(t){return{type:"unauthenticated",reason:t}}function oEe(t){return t.status!==403||!t.response?!1:t.response.headers["x-ratelimit-remaining"]==="0"}var aEe=/\babuse\b/i;function lEe(t){return t.status!==403?!1:aEe.test(t.message)}async function cEe(t,e,n,s){const i=e.endpoint.merge(n,s);return e(i).catch(r=>{throw r.status===404?(r.message=`Not found. May be due to lack of authentication. Reason: ${t}`,r):oEe(r)?(r.message=`API rate limit exceeded. This maybe caused by the lack of authentication. Reason: ${t}`,r):lEe(r)?(r.message=`You have triggered an abuse detection mechanism. This maybe caused by the lack of authentication. Reason: ${t}`,r):r.status===401?(r.message=`Unauthorized. "${i.method} ${i.url}" failed most likely due to lack of authentication. Reason: ${t}`,r):(r.status>=400&&r.status<500&&(r.message=r.message.replace(/\.?$/,`. May be caused by lack of authentication (${t}).`)),r)})}var vO=function(e){if(!e||!e.reason)throw new Error("[@octokit/auth-unauthenticated] No reason passed to createUnauthenticatedAuth");return Object.assign(rEe.bind(null,e.reason),{hook:cEe.bind(null,e.reason)})};const uEe=Object.freeze(Object.defineProperty({__proto__:null,createUnauthenticatedAuth:vO},Symbol.toStringTag,{value:"Module"})),yO=Ir(uEe);var dEe=Object.create,O0=Object.defineProperty,hEe=Object.getOwnPropertyDescriptor,fEe=Object.getOwnPropertyNames,pEe=Object.getPrototypeOf,mEe=Object.prototype.hasOwnProperty,gEe=(t,e)=>{for(var n in e)O0(t,n,{get:e[n],enumerable:!0})},bO=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fEe(e))!mEe.call(t,i)&&i!==n&&O0(t,i,{get:()=>e[i],enumerable:!(s=hEe(e,i))||s.enumerable});return t},Qa=(t,e,n)=>(n=t!=null?dEe(pEe(t)):{},bO(!t||!t.__esModule?O0(n,"default",{value:t,enumerable:!0}):n,t)),_Ee=t=>bO(O0({},"__esModule",{value:!0}),t),wO={};gEe(wO,{OAuthApp:()=>YEe,createAWSLambdaAPIGatewayV2Handler:()=>qEe,createNodeMiddleware:()=>HEe,createWebWorkerHandler:()=>VEe,handleRequest:()=>I0,sendNodeResponse:()=>AO,unknownRouteResponse:()=>TO});var xO=_Ee(wO),vEe=k0,SO="6.1.0";function EO(t,e,n){if(Array.isArray(e)){for(const s of e)EO(t,s,n);return}t.eventHandlers[e]||(t.eventHandlers[e]=[]),t.eventHandlers[e].push(n)}var yEe=iEe,bEe=XP,wEe=yEe.Octokit.defaults({userAgent:`octokit-oauth-app.js/${SO} ${(0,bEe.getUserAgent)()}`}),xEe=Ld;async function Ro(t,e){const{name:n,action:s}=e;if(t.eventHandlers[`${n}.${s}`])for(const i of t.eventHandlers[`${n}.${s}`])await i(e);if(t.eventHandlers[n])for(const i of t.eventHandlers[n])await i(e)}async function SEe(t,e){return t.octokit.auth({type:"oauth-user",...e,async factory(n){const s=new t.Octokit({authStrategy:xEe.createOAuthUserAuth,auth:n}),i=await s.auth({type:"get"});return await Ro(t,{name:"token",action:"created",token:i.token,scopes:i.scopes,authentication:i,octokit:s}),s}})}var EEe=Qa(gc);function TEe(t,e){const n={clientId:t.clientId,request:t.octokit.request,...e,allowSignup:t.allowSignup??e.allowSignup,redirectUrl:e.redirectUrl??t.redirectUrl,scopes:e.scopes??t.defaultScopes};return EEe.getWebFlowAuthorizationUrl({clientType:t.clientType,...n})}var AEe=Qa(k0);async function MEe(t,e){const n=await t.octokit.auth({type:"oauth-user",...e});return await Ro(t,{name:"token",action:"created",token:n.token,scopes:n.scopes,authentication:n,octokit:new t.Octokit({authStrategy:AEe.createOAuthUserAuth,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.token,scopes:n.scopes,refreshToken:n.refreshToken,expiresAt:n.expiresAt,refreshTokenExpiresAt:n.refreshTokenExpiresAt}})}),{authentication:n}}var REe=Qa(gc);async function kEe(t,e){const n=await REe.checkToken({clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e});return Object.assign(n.authentication,{type:"token",tokenType:"oauth"}),n}var iM=Qa(gc),rM=Ld;async function CEe(t,e){const n={clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e};if(t.clientType==="oauth-app"){const r=await iM.resetToken({clientType:"oauth-app",...n}),o=Object.assign(r.authentication,{type:"token",tokenType:"oauth"});return await Ro(t,{name:"token",action:"reset",token:r.authentication.token,scopes:r.authentication.scopes||void 0,authentication:o,octokit:new t.Octokit({authStrategy:rM.createOAuthUserAuth,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:r.authentication.token,scopes:r.authentication.scopes}})}),{...r,authentication:o}}const s=await iM.resetToken({clientType:"github-app",...n}),i=Object.assign(s.authentication,{type:"token",tokenType:"oauth"});return await Ro(t,{name:"token",action:"reset",token:s.authentication.token,authentication:i,octokit:new t.Octokit({authStrategy:rM.createOAuthUserAuth,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:s.authentication.token}})}),{...s,authentication:i}}var PEe=Qa(gc),OEe=Ld;async function IEe(t,e){if(t.clientType==="oauth-app")throw new Error("[@octokit/oauth-app] app.refreshToken() is not supported for OAuth Apps");const n=await PEe.refreshToken({clientType:"github-app",clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,refreshToken:e.refreshToken}),s=Object.assign(n.authentication,{type:"token",tokenType:"oauth"});return await Ro(t,{name:"token",action:"refreshed",token:n.authentication.token,authentication:s,octokit:new t.Octokit({authStrategy:OEe.createOAuthUserAuth,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.authentication.token}})}),{...n,authentication:s}}var LEe=Qa(gc),DEe=Ld;async function NEe(t,e){if(t.clientType==="oauth-app")throw new Error("[@octokit/oauth-app] app.scopeToken() is not supported for OAuth Apps");const n=await LEe.scopeToken({clientType:"github-app",clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e}),s=Object.assign(n.authentication,{type:"token",tokenType:"oauth"});return await Ro(t,{name:"token",action:"scoped",token:n.authentication.token,authentication:s,octokit:new t.Octokit({authStrategy:DEe.createOAuthUserAuth,auth:{clientType:t.clientType,clientId:t.clientId,clientSecret:t.clientSecret,token:n.authentication.token}})}),{...n,authentication:s}}var oM=Qa(gc),FEe=yO;async function UEe(t,e){const n={clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e},s=t.clientType==="oauth-app"?await oM.deleteToken({clientType:"oauth-app",...n}):await oM.deleteToken({clientType:"github-app",...n});return await Ro(t,{name:"token",action:"deleted",token:e.token,octokit:new t.Octokit({authStrategy:FEe.createUnauthenticatedAuth,auth:{reason:'Handling "token.deleted" event. The access for the token has been revoked.'}})}),s}var aM=Qa(gc),lM=yO;async function $Ee(t,e){const n={clientId:t.clientId,clientSecret:t.clientSecret,request:t.octokit.request,...e},s=t.clientType==="oauth-app"?await aM.deleteAuthorization({clientType:"oauth-app",...n}):await aM.deleteAuthorization({clientType:"github-app",...n});return await Ro(t,{name:"token",action:"deleted",token:e.token,octokit:new t.Octokit({authStrategy:lM.createUnauthenticatedAuth,auth:{reason:'Handling "token.deleted" event. The access for the token has been revoked.'}})}),await Ro(t,{name:"authorization",action:"deleted",token:e.token,octokit:new t.Octokit({authStrategy:lM.createUnauthenticatedAuth,auth:{reason:'Handling "authorization.deleted" event. The access for the app has been revoked.'}})}),s}function TO(t){return{status:404,headers:{"content-type":"application/json"},text:JSON.stringify({error:`Unknown route: ${t.method} ${t.url}`})}}async function I0(t,{pathPrefix:e="/api/github/oauth"},n){var u,d,h,f,v,_;if(n.method==="OPTIONS")return{status:200,headers:{"access-control-allow-origin":"*","access-control-allow-methods":"*","access-control-allow-headers":"Content-Type, User-Agent, Authorization"}};let{pathname:s}=new URL(n.url,"http://localhost");if(!s.startsWith(`${e}/`))return;s=s.slice(e.length+1);const i=[n.method,s].join(" "),r={getLogin:"GET login",getCallback:"GET callback",createToken:"POST token",getToken:"GET token",patchToken:"PATCH token",patchRefreshToken:"PATCH refresh-token",scopeToken:"POST token/scoped",deleteToken:"DELETE token",deleteGrant:"DELETE grant"};if(!Object.values(r).includes(i))return TO(n);let o;try{const m=await n.text();o=m?JSON.parse(m):{}}catch{return{status:400,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify({error:"[@octokit/oauth-app] request error"})}}const{searchParams:a}=new URL(n.url,"http://localhost"),l=Object.fromEntries(a),c=n.headers;try{if(i===r.getLogin){const{url:g}=t.getWebFlowAuthorizationUrl({state:l.state,scopes:l.scopes?l.scopes.split(","):void 0,allowSignup:l.allowSignup?l.allowSignup==="true":void 0,redirectUrl:l.redirectUrl});return{status:302,headers:{location:g}}}if(i===r.getCallback){if(l.error)throw new Error(`[@octokit/oauth-app] ${l.error} ${l.error_description}`);if(!l.code)throw new Error('[@octokit/oauth-app] "code" parameter is required');const{authentication:{token:g}}=await t.createToken({code:l.code});return{status:200,headers:{"content-type":"text/html"},text:`

Token created successfully

+ +

Your token is: ${g}. Copy it now as it cannot be shown again.

`}}if(i===r.createToken){const{code:g,redirectUrl:y}=o;if(!g)throw new Error('[@octokit/oauth-app] "code" parameter is required');const b=await t.createToken({code:g,redirectUrl:y});return delete b.authentication.clientSecret,{status:201,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(b)}}if(i===r.getToken){const g=(u=c.authorization)==null?void 0:u.substr(6);if(!g)throw new Error('[@octokit/oauth-app] "Authorization" header is required');const y=await t.checkToken({token:g});return delete y.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(y)}}if(i===r.patchToken){const g=(d=c.authorization)==null?void 0:d.substr(6);if(!g)throw new Error('[@octokit/oauth-app] "Authorization" header is required');const y=await t.resetToken({token:g});return delete y.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(y)}}if(i===r.patchRefreshToken){if(!((h=c.authorization)==null?void 0:h.substr(6)))throw new Error('[@octokit/oauth-app] "Authorization" header is required');const{refreshToken:y}=o;if(!y)throw new Error("[@octokit/oauth-app] refreshToken must be sent in request body");const b=await t.refreshToken({refreshToken:y});return delete b.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(b)}}if(i===r.scopeToken){const g=(f=c.authorization)==null?void 0:f.substr(6);if(!g)throw new Error('[@octokit/oauth-app] "Authorization" header is required');const y=await t.scopeToken({token:g,...o});return delete y.authentication.clientSecret,{status:200,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify(y)}}if(i===r.deleteToken){const g=(v=c.authorization)==null?void 0:v.substr(6);if(!g)throw new Error('[@octokit/oauth-app] "Authorization" header is required');return await t.deleteToken({token:g}),{status:204,headers:{"access-control-allow-origin":"*"}}}const m=(_=c.authorization)==null?void 0:_.substr(6);if(!m)throw new Error('[@octokit/oauth-app] "Authorization" header is required');return await t.deleteAuthorization({token:m}),{status:204,headers:{"access-control-allow-origin":"*"}}}catch(m){return{status:400,headers:{"content-type":"application/json","access-control-allow-origin":"*"},text:JSON.stringify({error:m.message})}}}function BEe(t){const{method:e,url:n,headers:s}=t;async function i(){return await new Promise((o,a)=>{let l=[];t.on("error",a).on("data",c=>l.push(c)).on("end",()=>o(Buffer.concat(l).toString()))})}return{method:e,url:n,headers:s,text:i}}function AO(t,e){e.writeHead(t.status,t.headers),e.end(t.text)}function HEe(t,e={}){return async function(n,s,i){const r=await BEe(n),o=await I0(t,e,r);return o?(AO(o,s),!0):(i==null||i(),!1)}}function GEe(t){const e=Object.fromEntries(t.headers.entries());return{method:t.method,url:t.url,headers:e,text:()=>t.text()}}function zEe(t){return new Response(t.text,{status:t.status,headers:t.headers})}function VEe(t,e={}){return async function(n){const s=await GEe(n),i=await I0(t,e,s);return i?zEe(i):void 0}}function WEe(t){const{method:e}=t.requestContext.http;let n=t.rawPath;const{stage:s}=t.requestContext;n.startsWith("/"+s)&&(n=n.substring(s.length+1)),t.rawQueryString&&(n+="?"+t.rawQueryString);const i=t.headers;return{method:e,url:n,headers:i,text:async()=>t.body||""}}function jEe(t){return{statusCode:t.status,headers:t.headers,body:t.text}}function qEe(t,e={}){return async function(n){const s=WEe(n),i=await I0(t,e,s);return i?jEe(i):void 0}}var $f,YEe=($f=class{static defaults(e){return class extends this{constructor(...s){super({...e,...s[0]})}}}constructor(e){const n=e.Octokit||wEe;this.type=e.clientType||"oauth-app";const s=new n({authStrategy:vEe.createOAuthAppAuth,auth:{clientType:this.type,clientId:e.clientId,clientSecret:e.clientSecret}}),i={clientType:this.type,clientId:e.clientId,clientSecret:e.clientSecret,defaultScopes:e.defaultScopes||[],allowSignup:e.allowSignup,baseUrl:e.baseUrl,redirectUrl:e.redirectUrl,log:e.log,Octokit:n,octokit:s,eventHandlers:{}};this.on=EO.bind(null,i),this.octokit=s,this.getUserOctokit=SEe.bind(null,i),this.getWebFlowAuthorizationUrl=TEe.bind(null,i),this.createToken=MEe.bind(null,i),this.checkToken=kEe.bind(null,i),this.resetToken=CEe.bind(null,i),this.refreshToken=IEe.bind(null,i),this.scopeToken=NEe.bind(null,i),this.deleteToken=UEe.bind(null,i),this.deleteAuthorization=$Ee.bind(null,i)}},$f.VERSION=SO,$f),XEe=(t,e=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(e===0)return t;const s=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return t.replace(s,n.indent.repeat(e))};const KEe={},ZEe=Object.freeze(Object.defineProperty({__proto__:null,default:KEe},Symbol.toStringTag,{value:"Module"})),JEe=Ir(ZEe),cM=JEe,uM=/\s+at.*(?:\(|\s)(.*)\)?/,QEe=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,eTe=typeof cM.homedir>"u"?"":cM.homedir();var tTe=(t,e)=>(e=Object.assign({pretty:!1},e),t.replace(/\\/g,"/").split(` +`).filter(n=>{const s=n.match(uM);if(s===null||!s[1])return!0;const i=s[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!QEe.test(i)}).filter(n=>n.trim()!=="").map(n=>e.pretty?n.replace(uM,(s,i)=>s.replace(i,i.replace(eTe,"~"))):n).join(` +`));const nTe=XEe,sTe=tTe,iTe=t=>t.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");class rTe extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);e=[...e].map(s=>s instanceof Error?s:s!==null&&typeof s=="object"?Object.assign(new Error(s.message),s):new Error(s));let n=e.map(s=>typeof s.stack=="string"?iTe(sTe(s.stack)):String(s)).join(` +`);n=` +`+nTe(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors)yield e}}var oTe=rTe;const Mh=fd(oTe);var ku=(t=>(t.SHA1="sha1",t.SHA256="sha256",t))(ku||{}),aTe=t=>t.startsWith("sha256=")?"sha256":"sha1",jx=new TextEncoder;function lTe(t){const n=t.match(/[\dA-F]{2}/gi).map(function(s){return parseInt(s,16)});return new Uint8Array(n)}function cTe(t){return Array.prototype.map.call(new Uint8Array(t),e=>e.toString(16).padStart(2,"0")).join("")}function uTe(t){return{[ku.SHA1]:"SHA-1",[ku.SHA256]:"SHA-256"}[t]}async function MO(t,e){return crypto.subtle.importKey("raw",jx.encode(t),{name:"HMAC",hash:{name:uTe(e)}},!1,["sign","verify"])}async function dTe(t,e){const{secret:n,algorithm:s}=typeof t=="object"?{secret:t.secret,algorithm:t.algorithm||ku.SHA256}:{secret:t,algorithm:ku.SHA256};if(!n||!e)throw new TypeError("[@octokit/webhooks-methods] secret & payload required for sign()");if(typeof e!="string")throw new TypeError("[@octokit/webhooks-methods] payload must be a string");if(!Object.values(ku).includes(s))throw new TypeError(`[@octokit/webhooks] Algorithm ${s} is not supported. Must be 'sha1' or 'sha256'`);const i=await crypto.subtle.sign("HMAC",await MO(n,s),jx.encode(e));return`${s}=${cTe(i)}`}async function RO(t,e,n){if(!t||!e||!n)throw new TypeError("[@octokit/webhooks-methods] secret, eventPayload & signature required");if(typeof e!="string")throw new TypeError("[@octokit/webhooks-methods] eventPayload must be a string");const s=aTe(n);return await crypto.subtle.verify("HMAC",await MO(t,s),lTe(n.replace(`${s}=`,"")),jx.encode(e))}var kO=t=>({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console),...t}),hTe=["branch_protection_configuration","branch_protection_rule.disabled","branch_protection_rule.enabled","branch_protection_rule","branch_protection_rule.created","branch_protection_rule.deleted","branch_protection_rule.edited","check_run","check_run.completed","check_run.created","check_run.requested_action","check_run.rerequested","check_suite","check_suite.completed","check_suite.requested","check_suite.rerequested","code_scanning_alert","code_scanning_alert.appeared_in_branch","code_scanning_alert.closed_by_user","code_scanning_alert.created","code_scanning_alert.fixed","code_scanning_alert.reopened","code_scanning_alert.reopened_by_user","commit_comment","commit_comment.created","create","custom_property","custom_property.created","custom_property.deleted","custom_property_values","custom_property_values.updated","delete","dependabot_alert","dependabot_alert.created","dependabot_alert.dismissed","dependabot_alert.fixed","dependabot_alert.reintroduced","dependabot_alert.reopened","deploy_key","deploy_key.created","deploy_key.deleted","deployment","deployment.created","deployment_protection_rule","deployment_protection_rule.requested","deployment_review","deployment_review.approved","deployment_review.rejected","deployment_review.requested","deployment_status","deployment_status.created","discussion","discussion.answered","discussion.category_changed","discussion.created","discussion.deleted","discussion.edited","discussion.labeled","discussion.locked","discussion.pinned","discussion.transferred","discussion.unanswered","discussion.unlabeled","discussion.unlocked","discussion.unpinned","discussion_comment","discussion_comment.created","discussion_comment.deleted","discussion_comment.edited","fork","github_app_authorization","github_app_authorization.revoked","gollum","installation","installation.created","installation.deleted","installation.new_permissions_accepted","installation.suspend","installation.unsuspend","installation_repositories","installation_repositories.added","installation_repositories.removed","installation_target","installation_target.renamed","issue_comment","issue_comment.created","issue_comment.deleted","issue_comment.edited","issues","issues.assigned","issues.closed","issues.deleted","issues.demilestoned","issues.edited","issues.labeled","issues.locked","issues.milestoned","issues.opened","issues.pinned","issues.reopened","issues.transferred","issues.unassigned","issues.unlabeled","issues.unlocked","issues.unpinned","label","label.created","label.deleted","label.edited","marketplace_purchase","marketplace_purchase.cancelled","marketplace_purchase.changed","marketplace_purchase.pending_change","marketplace_purchase.pending_change_cancelled","marketplace_purchase.purchased","member","member.added","member.edited","member.removed","membership","membership.added","membership.removed","merge_group","merge_group.checks_requested","meta","meta.deleted","milestone","milestone.closed","milestone.created","milestone.deleted","milestone.edited","milestone.opened","org_block","org_block.blocked","org_block.unblocked","organization","organization.deleted","organization.member_added","organization.member_invited","organization.member_removed","organization.renamed","package","package.published","package.updated","page_build","ping","project","project.closed","project.created","project.deleted","project.edited","project.reopened","project_card","project_card.converted","project_card.created","project_card.deleted","project_card.edited","project_card.moved","project_column","project_column.created","project_column.deleted","project_column.edited","project_column.moved","projects_v2_item","projects_v2_item.archived","projects_v2_item.converted","projects_v2_item.created","projects_v2_item.deleted","projects_v2_item.edited","projects_v2_item.reordered","projects_v2_item.restored","public","pull_request","pull_request.assigned","pull_request.auto_merge_disabled","pull_request.auto_merge_enabled","pull_request.closed","pull_request.converted_to_draft","pull_request.demilestoned","pull_request.dequeued","pull_request.edited","pull_request.enqueued","pull_request.labeled","pull_request.locked","pull_request.milestoned","pull_request.opened","pull_request.ready_for_review","pull_request.reopened","pull_request.review_request_removed","pull_request.review_requested","pull_request.synchronize","pull_request.unassigned","pull_request.unlabeled","pull_request.unlocked","pull_request_review","pull_request_review.dismissed","pull_request_review.edited","pull_request_review.submitted","pull_request_review_comment","pull_request_review_comment.created","pull_request_review_comment.deleted","pull_request_review_comment.edited","pull_request_review_thread","pull_request_review_thread.resolved","pull_request_review_thread.unresolved","push","registry_package","registry_package.published","registry_package.updated","release","release.created","release.deleted","release.edited","release.prereleased","release.published","release.released","release.unpublished","repository","repository.archived","repository.created","repository.deleted","repository.edited","repository.privatized","repository.publicized","repository.renamed","repository.transferred","repository.unarchived","repository_dispatch","repository_import","repository_vulnerability_alert","repository_vulnerability_alert.create","repository_vulnerability_alert.dismiss","repository_vulnerability_alert.reopen","repository_vulnerability_alert.resolve","secret_scanning_alert","secret_scanning_alert.created","secret_scanning_alert.reopened","secret_scanning_alert.resolved","secret_scanning_alert.revoked","secret_scanning_alert_location","secret_scanning_alert_location.created","security_advisory","security_advisory.performed","security_advisory.published","security_advisory.updated","security_advisory.withdrawn","sponsorship","sponsorship.cancelled","sponsorship.created","sponsorship.edited","sponsorship.pending_cancellation","sponsorship.pending_tier_change","sponsorship.tier_changed","star","star.created","star.deleted","status","team","team.added_to_repository","team.created","team.deleted","team.edited","team.removed_from_repository","team_add","watch","watch.started","workflow_dispatch","workflow_job","workflow_job.completed","workflow_job.in_progress","workflow_job.queued","workflow_job.waiting","workflow_run","workflow_run.completed","workflow_run.in_progress","workflow_run.requested"];function qx(t,e,n){t.hooks[e]||(t.hooks[e]=[]),t.hooks[e].push(n)}function CO(t,e,n){if(Array.isArray(e)){e.forEach(s=>CO(t,s,n));return}if(["*","error"].includes(e)){const s=e==="*"?"any":e,i=`Using the "${e}" event with the regular Webhooks.on() function is not supported. Please use the Webhooks.on${s.charAt(0).toUpperCase()+s.slice(1)}() method instead`;throw new Error(i)}hTe.includes(e)||t.log.warn(`"${e}" is not a known webhook name (https://developer.github.com/v3/activity/events/types/)`),qx(t,e,n)}function fTe(t,e){qx(t,"*",e)}function pTe(t,e){qx(t,"error",e)}function dM(t,e){let n;try{n=t(e)}catch(s){console.log('FATAL: Error occurred in "error" event handler'),console.log(s)}n&&n.catch&&n.catch(s=>{console.log('FATAL: Error occurred in "error" event handler'),console.log(s)})}function mTe(t,e,n){const s=[t.hooks[n],t.hooks["*"]];return e&&s.unshift(t.hooks[`${n}.${e}`]),[].concat(...s.filter(Boolean))}function gTe(t,e){const n=t.hooks.error||[];if(e instanceof Error){const o=Object.assign(new Mh([e]),{event:e,errors:[e]});return n.forEach(a=>dM(a,o)),Promise.reject(o)}if(!e||!e.name)throw new Mh(["Event name not passed"]);if(!e.payload)throw new Mh(["Event payload not passed"]);const s=mTe(t,"action"in e.payload?e.payload.action:null,e.name);if(s.length===0)return Promise.resolve();const i=[],r=s.map(o=>{let a=Promise.resolve(e);return t.transform&&(a=a.then(t.transform)),a.then(l=>o(l)).catch(l=>i.push(Object.assign(l,{event:e})))});return Promise.all(r).then(()=>{if(i.length===0)return;const o=new Mh(i);throw Object.assign(o,{event:e,errors:i}),n.forEach(a=>dM(a,o)),o})}function PO(t,e,n){if(Array.isArray(e)){e.forEach(s=>PO(t,s,n));return}if(t.hooks[e]){for(let s=t.hooks[e].length-1;s>=0;s--)if(t.hooks[e][s]===n){t.hooks[e].splice(s,1);return}}}function _Te(t){const e={hooks:{},log:kO(t&&t.log)};return t&&t.transform&&(e.transform=t.transform),{on:CO.bind(null,e),onAny:fTe.bind(null,e),onError:pTe.bind(null,e),removeListener:PO.bind(null,e),receive:gTe.bind(null,e)}}async function vTe(t,e){if(!await RO(t.secret,e.payload,e.signature).catch(()=>!1)){const i=new Error("[@octokit/webhooks] signature does not match event payload and secret");return t.eventHandler.receive(Object.assign(i,{event:e,status:400}))}let s;try{s=JSON.parse(e.payload)}catch(i){throw i.message="Invalid JSON",i.status=400,new Mh([i])}return t.eventHandler.receive({id:e.id,name:e.name,payload:s})}var yTe=class{constructor(t){if(!t||!t.secret)throw new Error("[@octokit/webhooks] options.secret required");const e={eventHandler:_Te(t),secret:t.secret,hooks:{},log:kO(t.log)};this.sign=dTe.bind(null,t.secret),this.verify=RO.bind(null,t.secret),this.on=e.eventHandler.on,this.onAny=e.eventHandler.onAny,this.onError=e.eventHandler.onError,this.removeListener=e.eventHandler.removeListener,this.receive=e.eventHandler.receive,this.verifyAndReceive=vTe.bind(null,e)}};function bTe(t){if(!t.data)return{...t,data:[]};if(!("total_count"in t.data&&!("url"in t.data)))return t;const n=t.data.incomplete_results,s=t.data.repository_selection,i=t.data.total_count;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count;const r=Object.keys(t.data)[0],o=t.data[r];return t.data=o,typeof n<"u"&&(t.data.incomplete_results=n),typeof s<"u"&&(t.data.repository_selection=s),t.data.total_count=i,t}function OO(t,e,n){const s=typeof e=="function"?e.endpoint(n):t.request.endpoint(e,n),i=typeof e=="function"?e:t.request,r=s.method,o=s.headers;let a=s.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!a)return{done:!0};try{const l=await i({method:r,url:a,headers:o}),c=bTe(l);return a=((c.headers.link||"").match(/<([^>]+)>;\s*rel="next"/)||[])[1],{value:c}}catch(l){if(l.status!==409)throw l;return a="",{value:{status:200,headers:{},data:[]}}}}})}}function wTe(t,e,n,s){return typeof n=="function"&&(s=n,n=void 0),IO(t,[],OO(t,e,n)[Symbol.asyncIterator](),s)}function IO(t,e,n,s){return n.next().then(i=>{if(i.done)return e;let r=!1;function o(){r=!0}return e=e.concat(s?s(i.value,o):i.value.data),r?e:IO(t,e,n,s)})}var LO=Object.assign(wTe,{iterator:OO}),xTe="14.1.0";function STe(t,e){return new yTe({secret:e.secret,transform:async n=>{if(!("installation"in n.payload)||typeof n.payload.installation!="object"){const r=new t.constructor({authStrategy:vO,auth:{reason:'"installation" key missing in webhook event payload'}});return{...n,octokit:r}}const s=n.payload.installation.id,i=await t.auth({type:"installation",installationId:s,factory(r){return new r.octokit.constructor({...r.octokitOptions,authStrategy:Wx.createAppAuth,auth:{...r,installationId:s}})}});return i.hook.before("request",r=>{r.headers["x-github-delivery"]=n.id}),{...n,octokit:i}}})}async function DO(t,e){return t.octokit.auth({type:"installation",installationId:e,factory(n){const s={...n.octokitOptions,authStrategy:Wx.createAppAuth,auth:{...n,installationId:e}};return new n.octokit.constructor(s)}})}function ETe(t){return Object.assign(TTe.bind(null,t),{iterator:NO.bind(null,t)})}async function TTe(t,e){const n=NO(t)[Symbol.asyncIterator]();let s=await n.next();for(;!s.done;)await e(s.value),s=await n.next()}function NO(t){return{async*[Symbol.asyncIterator](){const e=LO.iterator(t.octokit,"GET /app/installations");for await(const{data:n}of e)for(const s of n)yield{octokit:await DO(t,s.id),installation:s}}}}function ATe(t){return Object.assign(MTe.bind(null,t),{iterator:FO.bind(null,t)})}async function MTe(t,e,n){const s=FO(t,n?e:void 0)[Symbol.asyncIterator]();let i=await s.next();for(;!i.done;)n?await n(i.value):await e(i.value),i=await s.next()}function RTe(t,e){return{async*[Symbol.asyncIterator](){yield{octokit:await t.getInstallationOctokit(e)}}}}function FO(t,e){return{async*[Symbol.asyncIterator](){const n=e?RTe(t,e.installationId):t.eachInstallation.iterator();for await(const{octokit:s}of n){const i=LO.iterator(s,"GET /installation/repositories");for await(const{data:r}of i)for(const o of r)yield{octokit:s,repository:o}}}}}var Bf,kTe=(Bf=class{static defaults(e){return class extends this{constructor(...s){super({...e,...s[0]})}}}constructor(e){const n=e.Octokit||Hx,s=Object.assign({appId:e.appId,privateKey:e.privateKey},e.oauth?{clientId:e.oauth.clientId,clientSecret:e.oauth.clientSecret}:{});this.octokit=new n({authStrategy:Wx.createAppAuth,auth:s,log:e.log}),this.log=Object.assign({debug:()=>{},info:()=>{},warn:console.warn.bind(console),error:console.error.bind(console)},e.log),e.webhooks?this.webhooks=STe(this.octokit,e.webhooks):Object.defineProperty(this,"webhooks",{get(){throw new Error("[@octokit/app] webhooks option not set")}}),e.oauth?this.oauth=new xO.OAuthApp({...e.oauth,clientType:"github-app",Octokit:n}):Object.defineProperty(this,"oauth",{get(){throw new Error("[@octokit/app] oauth.clientId / oauth.clientSecret options are not set")}}),this.getInstallationOctokit=DO.bind(null,this),this.eachInstallation=ETe(this),this.eachRepository=ATe(this)}},Bf.VERSION=xTe,Bf),CTe="3.2.1",UO=Hx.plugin(zP,UP,$2e,qP,zx).defaults({userAgent:`octokit.js/${CTe}`,throttle:{onRateLimit:PTe,onSecondaryRateLimit:OTe}});function PTe(t,e,n){if(n.log.warn(`Request quota exhausted for request ${e.method} ${e.url}`),e.request.retryCount===0)return n.log.info(`Retrying after ${t} seconds!`),!0}function OTe(t,e,n){if(n.log.warn(`SecondaryRateLimit detected for request ${e.method} ${e.url}`),e.request.retryCount===0)return n.log.info(`Retrying after ${t} seconds!`),!0}var ITe=kTe.defaults({Octokit:UO});xO.OAuthApp.defaults({Octokit:UO});const Tf=15,ub=30,db=19,LTe=29,o_=256,Yx=o_+1+LTe,hM=2*Yx+1,uh=256,DTe=7,fM=16,pM=17,mM=18,Av=8*2,a_=-1,NTe=1,vm=2,FTe=0,Zc=0,gM=1,UTe=3,Ls=4,Ui=0,$O=1,ym=2,Yi=-2,$Te=-3,jc=-5;function L0(t){return D0(t.map(([e,n])=>new Array(e).fill(n,0,e)))}function D0(t){return t.reduce((e,n)=>e.concat(Array.isArray(n)?D0(n):n),[])}const _M=[0,1,2,3].concat(...L0([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function ln(){const t=this;function e(i){const r=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,h,f,v,_,m=0;for(f=0;f<=Tf;f++)i.bl_count[f]=0;for(r[i.heap[i.heap_max]*2+1]=0,u=i.heap_max+1;uc&&(f=c,m++),r[d*2+1]=f,!(d>t.max_code)&&(i.bl_count[f]++,v=0,d>=l&&(v=a[d-l]),_=r[d*2],i.opt_len+=_*(f+v),o&&(i.static_len+=_*(o[d*2+1]+v)));if(m!==0){do{for(f=c-1;i.bl_count[f]===0;)f--;i.bl_count[f]--,i.bl_count[f+1]+=2,i.bl_count[c]--,m-=2}while(m>0);for(f=c;f!==0;f--)for(d=i.bl_count[f];d!==0;)h=i.heap[--u],!(h>t.max_code)&&(r[h*2+1]!=f&&(i.opt_len+=(f-r[h*2+1])*r[h*2],r[h*2+1]=f),d--)}}function n(i,r){let o=0;do o|=i&1,i>>>=1,o<<=1;while(--r>0);return o>>>1}function s(i,r,o){const a=[];let l=0,c,u,d;for(c=1;c<=Tf;c++)a[c]=l=l+o[c-1]<<1;for(u=0;u<=r;u++)d=i[u*2+1],d!==0&&(i[u*2]=n(a[d]++,d))}t.build_tree=function(i){const r=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.elems;let l,c,u=-1,d;for(i.heap_len=0,i.heap_max=hM,l=0;l=1;l--)i.pqdownheap(r,l);d=a;do l=i.heap[1],i.heap[1]=i.heap[i.heap_len--],i.pqdownheap(r,1),c=i.heap[1],i.heap[--i.heap_max]=l,i.heap[--i.heap_max]=c,r[d*2]=r[l*2]+r[c*2],i.depth[d]=Math.max(i.depth[l],i.depth[c])+1,r[l*2+1]=r[c*2+1]=d,i.heap[1]=d++,i.pqdownheap(r,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],e(i),s(r,t.max_code,i.bl_count)}}ln._length_code=[0,1,2,3,4,5,6,7].concat(...L0([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));ln.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];ln.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];ln.d_code=function(t){return t<256?_M[t]:_M[256+(t>>>7)]};ln.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];ln.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];ln.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];ln.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function ts(t,e,n,s,i){const r=this;r.static_tree=t,r.extra_bits=e,r.extra_base=n,r.elems=s,r.max_length=i}const BTe=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],HTe=L0([[144,8],[112,9],[24,7],[8,8]]);ts.static_ltree=D0(BTe.map((t,e)=>[t,HTe[e]]));const GTe=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],zTe=L0([[30,5]]);ts.static_dtree=D0(GTe.map((t,e)=>[t,zTe[e]]));ts.static_l_desc=new ts(ts.static_ltree,ln.extra_lbits,o_+1,Yx,Tf);ts.static_d_desc=new ts(ts.static_dtree,ln.extra_dbits,0,ub,Tf);ts.static_bl_desc=new ts(null,ln.extra_blbits,0,db,DTe);const VTe=9,WTe=8;function ur(t,e,n,s,i){const r=this;r.good_length=t,r.max_lazy=e,r.nice_length=n,r.max_chain=s,r.func=i}const BO=0,hg=1,El=2,Di=[new ur(0,0,0,0,BO),new ur(4,4,8,4,hg),new ur(4,5,16,8,hg),new ur(4,6,32,32,hg),new ur(4,4,16,16,El),new ur(8,16,32,32,El),new ur(8,16,128,128,El),new ur(8,32,128,256,El),new ur(32,128,258,1024,El),new ur(32,258,258,4096,El)],bm=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],vi=0,wm=1,dh=2,xm=3,jTe=32,Mv=42,Sm=113,hh=666,Rv=8,qTe=0,kv=1,YTe=2,gn=3,fg=258,Ks=fg+gn+1;function vM(t,e,n,s){const i=t[e*2],r=t[n*2];return i=3&&J[ln.bl_order[N]*2+1]===0;N--);return t.opt_len+=3*(N+1)+5+5+4,N}function Fe(N){t.pending_buf[t.pending++]=N}function L(N){Fe(N&255),Fe(N>>>8&255)}function $(N){Fe(N>>8&255),Fe(N&255&255)}function ee(N,V){let W;const Q=V;Ce>Av-Q?(W=N,Ee|=W<>>Av-Ce,Ce+=Q-Av):(Ee|=N<=8&&(Fe(Ee&255),Ee>>>=8,Ce-=8)}function R(){ee(kv<<1,3),de(uh,ts.static_ltree),O(),1+oe+10-Ce<9&&(ee(kv<<1,3),de(uh,ts.static_ltree),O()),oe=7}function q(N,V){let W,Q,F;if(t.dist_buf[xe]=N,t.lc_buf[xe]=V&255,xe++,N===0?z[V*2]++:(Ne++,N--,z[(ln._length_code[V]+o_+1)*2]++,G[ln.d_code(N)*2]++),!(xe&8191)&&P>2){for(W=xe*8,Q=T-g,F=0;F>>=3,Ne8?L(Ee):Ce>0&&Fe(Ee&255),Ee=0,Ce=0}function pe(N,V,W){ae(),oe=8,L(V),L(~V),t.pending_buf.set(l.subarray(N,N+V),t.pending),t.pending+=V}function Me(N,V,W){ee((qTe<<1)+(W?1:0),3),pe(N,V)}function be(N,V,W){let Q,F,le=0;P>0?(B.build_tree(t),fe.build_tree(t),le=qe(),Q=t.opt_len+3+7>>>3,F=t.static_len+3+7>>>3,F<=Q&&(Q=F)):Q=F=V+5,V+4<=Q&&N!=-1?Me(N,V,W):F==Q?(ee((kv<<1)+(W?1:0),3),K(ts.static_ltree,ts.static_dtree)):(ee((YTe<<1)+(W?1:0),3),ke(B.max_code+1,fe.max_code+1,le+1),K(z,G)),Re(),W&&ae()}function Se(N){be(g>=0?g:-1,T-g,N),g=T,e.flush_pending()}function He(){let N,V,W,Q;do{if(Q=c-A-T,Q===0&&T===0&&A===0)Q=r;else if(Q==-1)Q--;else if(T>=r+r-Ks){l.set(l.subarray(r,r+r),0),x-=r,T-=r,g-=r,N=f,W=N;do V=d[--W]&65535,d[W]=V>=r?V-r:0;while(--N!==0);N=r,W=N;do V=u[--W]&65535,u[W]=V>=r?V-r:0;while(--N!==0);Q+=r}if(e.avail_in===0)return;N=e.read_buf(l,T+A,Q),A+=N,A>=gn&&(h=l[T]&255,h=(h<s-5&&(V=s-5);;){if(A<=1){if(He(),A===0&&N==Zc)return vi;if(A===0)break}if(T+=A,A=0,W=g+V,(T===0||T>=W)&&(A=T-W,T=W,Se(!1),e.avail_out===0)||T-g>=r-Ks&&(Se(!1),e.avail_out===0))return vi}return Se(N==Ls),e.avail_out===0?N==Ls?dh:vi:N==Ls?xm:wm}function ye(N){let V=E,W=T,Q,F,le=M;const ue=T>r-Ks?T-(r-Ks):0;let Le=U;const $e=a,St=T+fg;let jt=l[W+le-1],sn=l[W+le];M>=k&&(V>>=2),Le>A&&(Le=A);do if(Q=N,!(l[Q+le]!=sn||l[Q+le-1]!=jt||l[Q]!=l[W]||l[++Q]!=l[W+1])){W+=2,Q++;do;while(l[++W]==l[++Q]&&l[++W]==l[++Q]&&l[++W]==l[++Q]&&l[++W]==l[++Q]&&l[++W]==l[++Q]&&l[++W]==l[++Q]&&l[++W]==l[++Q]&&l[++W]==l[++Q]&&Wle){if(x=N,le=F,F>=Le)break;jt=l[W+le-1],sn=l[W+le]}}while((N=u[N&$e]&65535)>ue&&--V!==0);return le<=A?le:A}function te(N){let V=0,W;for(;;){if(A=gn&&(h=(h<=gn)if(W=q(T-x,y-gn),A-=y,y<=S&&A>=gn){y--;do T++,h=(h<=gn&&(h=(h<4096)&&(y=gn-1)),M>=gn&&y<=M){Q=T+A-gn,W=q(T-1-b,M-gn),A-=M-1,M-=2;do++T<=Q&&(h=(h<VTe||Q!=Rv||W<9||W>15||V<0||V>9||le<0||le>vm?Yi:(N.dstate=t,o=W,r=1<9||W<0||W>vm?Yi:(Di[P].func!=Di[V].func&&N.total_in!==0&&(Q=N.deflate(gM)),P!=V&&(P=V,S=Di[P].max_lazy,k=Di[P].good_length,U=Di[P].nice_length,E=Di[P].max_chain),D=W,Q)},t.deflateSetDictionary=function(N,V,W){let Q=W,F,le=0;if(!V||n!=Mv)return Yi;if(Qr-Ks&&(Q=r-Ks,le=W-Q),l.set(V.subarray(le,le+Q),0),T=Q,g=Q,h=l[0]&255,h=(h<Ls||V<0)return Yi;if(!N.next_out||!N.next_in&&N.avail_in!==0||n==hh&&V!=Ls)return N.msg=bm[ym-Yi],Yi;if(N.avail_out===0)return N.msg=bm[ym-jc],jc;if(e=N,le=i,i=V,n==Mv&&(Q=Rv+(o-8<<4)<<8,F=(P-1&255)>>1,F>3&&(F=3),Q|=F<<6,T!==0&&(Q|=jTe),Q+=31-Q%31,n=Sm,$(Q)),t.pending!==0){if(e.flush_pending(),e.avail_out===0)return i=-1,Ui}else if(e.avail_in===0&&V<=le&&V!=Ls)return e.msg=bm[ym-jc],jc;if(n==hh&&e.avail_in!==0)return N.msg=bm[ym-jc],jc;if(e.avail_in!==0||A!==0||V!=Zc&&n!=hh){switch(ue=-1,Di[P].func){case BO:ue=Pe(V);break;case hg:ue=te(V);break;case El:ue=C(V);break}if((ue==dh||ue==xm)&&(n=hh),ue==vi||ue==dh)return e.avail_out===0&&(i=-1),Ui;if(ue==wm){if(V==gM)R();else if(Me(0,0,!1),V==UTe)for(W=0;Wn&&(i=n),i===0?0:(s.avail_in-=i,t.set(s.next_in.subarray(s.next_in_index,s.next_in_index+i),e),s.next_in_index+=i,s.total_in+=i,i)},flush_pending(){const t=this;let e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out),e!==0&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,t.dstate.pending===0&&(t.dstate.pending_out=0))}};function KTe(t){const e=this,n=new HO,s=ZTe(t&&t.chunkSize?t.chunkSize:64*1024),i=Zc,r=new Uint8Array(s);let o=t?t.level:a_;typeof o>"u"&&(o=a_),n.deflateInit(o),n.next_out=r,e.append=function(a,l){let c,u,d=0,h=0,f=0;const v=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=s,c=n.deflate(i),c!=Ui)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==s?v.push(new Uint8Array(r)):v.push(r.subarray(0,n.next_out_index))),f+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=d&&(l(n.next_in_index),d=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return v.length>1?(u=new Uint8Array(f),v.forEach(function(_){u.set(_,h),h+=_.length})):u=v[0]?new Uint8Array(v[0]):new Uint8Array,u}},e.flush=function(){let a,l,c=0,u=0;const d=[];do{if(n.next_out_index=0,n.avail_out=s,a=n.deflate(Ls),a!=$O&&a!=Ui)throw new Error("deflating: "+n.msg);s-n.avail_out>0&&d.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),l=new Uint8Array(u),d.forEach(function(h){l.set(h,c),c+=h.length}),l}}function ZTe(t){return t+5*(Math.floor(t/16383)+1)}const JTe=15,It=0,wo=1,QTe=2,$s=-2,cn=-3,yM=-4,xo=-5,Js=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],GO=1440,eAe=0,tAe=4,nAe=9,sAe=5,iAe=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],rAe=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],oAe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],aAe=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],lAe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],cAe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ko=15;function hb(){const t=this;let e,n,s,i,r,o;function a(c,u,d,h,f,v,_,m,g,y,b){let w,T,x,A,M,E,S,P,D,k,U,z,G,J,B;k=0,M=d;do s[c[u+k]]++,k++,M--;while(M!==0);if(s[0]==d)return _[0]=-1,m[0]=0,It;for(P=m[0],E=1;E<=Ko&&s[E]===0;E++);for(S=E,PM&&(P=M),m[0]=P,J=1<z+P;){if(A++,z+=P,B=x-z,B=B>P?P:B,(T=1<<(E=S-z))>w+1&&(T-=w+1,G=S,EGO)return cn;r[A]=U=y[0],y[0]+=B,A!==0?(o[A]=M,i[0]=E,i[1]=P,E=M>>>z-P,i[2]=U-r[A-1]-E,g.set(i,(r[A-1]+E)*3)):_[0]=U}for(i[1]=S-z,k>=d?i[0]=192:b[k]>>z;E>>=1)M^=E;for(M^=E,D=(1<257?(y==cn?g.msg="oversubscribed distance tree":y==xo?(g.msg="incomplete distance tree",y=cn):y!=yM&&(g.msg="empty distance tree with lengths",y=cn),y):It)}}hb.inflate_trees_fixed=function(t,e,n,s){return t[0]=nAe,e[0]=sAe,n[0]=iAe,s[0]=rAe,It};const Em=0,bM=1,wM=2,xM=3,SM=4,EM=5,TM=6,Cv=7,AM=8,Tm=9;function uAe(){const t=this;let e,n=0,s,i=0,r=0,o=0,a=0,l=0,c=0,u=0,d,h=0,f,v=0;function _(m,g,y,b,w,T,x,A){let M,E,S,P,D,k,U,z,G,J,B,fe,se,we,xe,Ne;U=A.next_in_index,z=A.avail_in,D=x.bitb,k=x.bitk,G=x.write,J=G>=E[Ne+1],k-=E[Ne+1],x.win[G++]=E[Ne+2],J--;continue}do{if(D>>=E[Ne+1],k-=E[Ne+1],P&16){for(P&=15,se=E[Ne+2]+(D&Js[P]),D>>=P,k-=P;k<15;)z--,D|=(A.read_byte(U++)&255)<>=E[Ne+1],k-=E[Ne+1],P&16){for(P&=15;k>=P,k-=P,J-=se,G>=we)xe=G-we,G-xe>0&&2>G-xe?(x.win[G++]=x.win[xe++],x.win[G++]=x.win[xe++],se-=2):(x.win.set(x.win.subarray(xe,xe+2),G),G+=2,xe+=2,se-=2);else{xe=G-we;do xe+=x.end;while(xe<0);if(P=x.end-xe,se>P){if(se-=P,G-xe>0&&P>G-xe)do x.win[G++]=x.win[xe++];while(--P!==0);else x.win.set(x.win.subarray(xe,xe+P),G),G+=P,xe+=P,P=0;xe=0}}if(G-xe>0&&se>G-xe)do x.win[G++]=x.win[xe++];while(--se!==0);else x.win.set(x.win.subarray(xe,xe+se),G),G+=se,xe+=se,se=0;break}else if(!(P&64))M+=E[Ne+2],M+=D&Js[P],Ne=(S+M)*3,P=E[Ne];else return A.msg="invalid distance code",se=A.avail_in-z,se=k>>3>3:se,z+=se,U-=se,k-=se<<3,x.bitb=D,x.bitk=k,A.avail_in=z,A.total_in+=U-A.next_in_index,A.next_in_index=U,x.write=G,cn;while(!0);break}if(P&64)return P&32?(se=A.avail_in-z,se=k>>3>3:se,z+=se,U-=se,k-=se<<3,x.bitb=D,x.bitk=k,A.avail_in=z,A.total_in+=U-A.next_in_index,A.next_in_index=U,x.write=G,wo):(A.msg="invalid literal/length code",se=A.avail_in-z,se=k>>3>3:se,z+=se,U-=se,k-=se<<3,x.bitb=D,x.bitk=k,A.avail_in=z,A.total_in+=U-A.next_in_index,A.next_in_index=U,x.write=G,cn);if(M+=E[Ne+2],M+=D&Js[P],Ne=(S+M)*3,(P=E[Ne])===0){D>>=E[Ne+1],k-=E[Ne+1],x.win[G++]=E[Ne+2],J--;break}}while(!0)}while(J>=258&&z>=10);return se=A.avail_in-z,se=k>>3>3:se,z+=se,U-=se,k-=se<<3,x.bitb=D,x.bitk=k,A.avail_in=z,A.total_in+=U-A.next_in_index,A.next_in_index=U,x.write=G,It}t.init=function(m,g,y,b,w,T){e=Em,c=m,u=g,d=y,h=b,f=w,v=T,s=null},t.proc=function(m,g,y){let b,w,T,x=0,A=0,M=0,E,S,P,D;for(M=g.next_in_index,E=g.avail_in,x=m.bitb,A=m.bitk,S=m.write,P=S=258&&E>=10&&(m.bitb=x,m.bitk=A,g.avail_in=E,g.total_in+=M-g.next_in_index,g.next_in_index=M,m.write=S,y=_(c,u,d,h,f,v,m,g),M=g.next_in_index,E=g.avail_in,x=m.bitb,A=m.bitk,S=m.write,P=S>>=s[w+1],A-=s[w+1],T=s[w],T===0){o=s[w+2],e=TM;break}if(T&16){a=T&15,n=s[w+2],e=wM;break}if(!(T&64)){r=T,i=w/3+s[w+2];break}if(T&32){e=Cv;break}return e=Tm,g.msg="invalid literal/length code",y=cn,m.bitb=x,m.bitk=A,g.avail_in=E,g.total_in+=M-g.next_in_index,g.next_in_index=M,m.write=S,m.inflate_flush(g,y);case wM:for(b=a;A>=b,A-=b,r=u,s=f,i=v,e=xM;case xM:for(b=r;A>=s[w+1],A-=s[w+1],T=s[w],T&16){a=T&15,l=s[w+2],e=SM;break}if(!(T&64)){r=T,i=w/3+s[w+2];break}return e=Tm,g.msg="invalid distance code",y=cn,m.bitb=x,m.bitk=A,g.avail_in=E,g.total_in+=M-g.next_in_index,g.next_in_index=M,m.write=S,m.inflate_flush(g,y);case SM:for(b=a;A>=b,A-=b,e=EM;case EM:for(D=S-l;D<0;)D+=m.end;for(;n!==0;){if(P===0&&(S==m.end&&m.read!==0&&(S=0,P=S7&&(A-=8,E++,M--),m.write=S,y=m.inflate_flush(g,y),S=m.write,P=S_.avail_out&&(g=_.avail_out),g!==0&&m==xo&&(m=It),_.avail_out-=g,_.total_out+=g,_.next_out.set(n.win.subarray(b,b+g),y),y+=g,b+=g,b==n.end&&(b=0,n.write==n.end&&(n.write=0),g=n.write-b,g>_.avail_out&&(g=_.avail_out),g!==0&&m==xo&&(m=It),_.avail_out-=g,_.total_out+=g,_.next_out.set(n.win.subarray(b,b+g),y),y+=g,b+=g),_.next_out_index=y,n.read=b,m},n.proc=function(_,m){let g,y,b,w,T,x,A,M;for(w=_.next_in_index,T=_.avail_in,y=n.bitb,b=n.bitk,x=n.write,A=x>>1){case 0:y>>>=3,b-=3,g=b&7,y>>>=g,b-=g,s=Pv;break;case 1:E=[],S=[],P=[[]],D=[[]],hb.inflate_trees_fixed(E,S,P,D),u.init(E[0],S[0],P[0],0,D[0],0),y>>>=3,b-=3,s=Am;break;case 2:y>>>=3,b-=3,s=kM;break;case 3:return y>>>=3,b-=3,s=vl,_.msg="invalid block type",m=cn,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m)}break;case Pv:for(;b<32;){if(T!==0)m=It;else return n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);T--,y|=(_.read_byte(w++)&255)<>>16&65535)!=(y&65535))return s=vl,_.msg="invalid stored block lengths",m=cn,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);i=y&65535,y=b=0,s=i!==0?RM:d!==0?Mm:qc;break;case RM:if(T===0||A===0&&(x==n.end&&n.read!==0&&(x=0,A=xT&&(g=T),g>A&&(g=A),n.win.set(_.read_buf(w,g),x),w+=g,T-=g,x+=g,A-=g,(i-=g)!==0)break;s=d!==0?Mm:qc;break;case kM:for(;b<14;){if(T!==0)m=It;else return n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);T--,y|=(_.read_byte(w++)&255)<29||(g>>5&31)>29)return s=vl,_.msg="too many length or distance symbols",m=cn,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);if(g=258+(g&31)+(g>>5&31),!a||a.length>>=14,b-=14,o=0,s=CM;case CM:for(;o<4+(r>>>10);){for(;b<3;){if(T!==0)m=It;else return n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);T--,y|=(_.read_byte(w++)&255)<>>=3,b-=3}for(;o<19;)a[MM[o++]]=0;if(l[0]=7,g=v.inflate_trees_bits(a,l,c,h,_),g!=It)return m=g,m==cn&&(a=null,s=vl),n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);o=0,s=PM;case PM:for(;g=r,!(o>=258+(g&31)+(g>>5&31));){let J,B;for(g=l[0];b>>=g,b-=g,a[o++]=B;else{for(M=B==18?7:B-14,J=B==18?11:3;b>>=g,b-=g,J+=y&Js[M],y>>>=M,b-=M,M=o,g=r,M+J>258+(g&31)+(g>>5&31)||B==16&&M<1)return a=null,s=vl,_.msg="invalid bit length repeat",m=cn,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);B=B==16?a[M-1]:0;do a[M++]=B;while(--J!==0);o=M}}if(c[0]=-1,k=[],U=[],z=[],G=[],k[0]=9,U[0]=6,g=r,g=v.inflate_trees_dynamic(257+(g&31),1+(g>>5&31),a,k,U,z,G,h,_),g!=It)return g==cn&&(a=null,s=vl),m=g,n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,n.inflate_flush(_,m);u.init(k[0],U[0],h,z[0],h,G[0]),s=Am;case Am:if(n.bitb=y,n.bitk=b,_.avail_in=T,_.total_in+=w-_.next_in_index,_.next_in_index=w,n.write=x,(m=u.proc(n,_,m))!=wo)return n.inflate_flush(_,m);if(m=It,u.free(_),w=_.next_in_index,T=_.avail_in,y=n.bitb,b=n.bitk,x=n.write,A=x15?(t.inflateEnd(n),$s):(t.wbits=s,n.istate.blocks=new dAe(n,1<>4)+8>o.wbits){o.mode=Zo,n.msg="invalid win size",o.marker=5;break}o.mode=IM;case IM:if(n.avail_in===0)return i;if(i=s,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((o.method<<8)+r)%31!==0){o.mode=Zo,n.msg="incorrect header check",o.marker=5;break}if(!(r&hAe)){o.mode=fh;break}o.mode=LM;case LM:if(n.avail_in===0)return i;i=s,n.avail_in--,n.total_in++,o.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,o.mode=DM;case DM:if(n.avail_in===0)return i;i=s,n.avail_in--,n.total_in++,o.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,o.mode=NM;case NM:if(n.avail_in===0)return i;i=s,n.avail_in--,n.total_in++,o.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,o.mode=FM;case FM:return n.avail_in===0?i:(i=s,n.avail_in--,n.total_in++,o.need+=n.read_byte(n.next_in_index++)&255,o.mode=Ov,QTe);case Ov:return o.mode=Zo,n.msg="need dictionary",o.marker=0,$s;case fh:if(i=o.blocks.proc(n,i),i==cn){o.mode=Zo,o.marker=0;break}if(i==It&&(i=s),i!=wo)return i;i=s,o.blocks.reset(n,o.was),o.mode=UM;case UM:return n.avail_in=0,wo;case Zo:return cn;default:return $s}},t.inflateSetDictionary=function(n,s,i){let r=0,o=i;if(!n||!n.istate||n.istate.mode!=Ov)return $s;const a=n.istate;return o>=1<0&&n.next_in_index!=h&&(l(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return c.length>1?(d=new Uint8Array(v),c.forEach(function(_){d.set(_,f),f+=_.length})):d=c[0]?new Uint8Array(c[0]):new Uint8Array,d}},e.flush=function(){n.inflateEnd()}}const tc=4294967295,ma=65535,vAe=8,yAe=0,bAe=99,wAe=67324752,xAe=134695760,$M=33639248,SAe=101010256,BM=101075792,EAe=117853008,Yc=22,Iv=20,Lv=56,TAe=1,AAe=39169,MAe=10,RAe=1,kAe=21589,CAe=28789,PAe=25461,OAe=6534,HM=1,IAe=6,GM=8,zM=2048,VM=16,LAe="/",ci=void 0,Ga="undefined",rp="function";class WM{constructor(e){return class extends TransformStream{constructor(n,s){const i=new e(s);super({transform(r,o){o.enqueue(i.append(r))},flush(r){const o=i.flush();o&&r.enqueue(o)}})}}}}const DAe=64;let VO=2;try{typeof navigator!=Ga&&navigator.hardwareConcurrency&&(VO=navigator.hardwareConcurrency)}catch{}const NAe={chunkSize:512*1024,maxWorkers:VO,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:ci,CompressionStreamNative:typeof CompressionStream!=Ga&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Ga&&DecompressionStream},ga=Object.assign({},NAe);function FAe(){return ga}function UAe(t){return Math.max(t.chunkSize,DAe)}function Xx(t){const{baseURL:e,chunkSize:n,maxWorkers:s,terminateWorkerTimeout:i,useCompressionStream:r,useWebWorkers:o,Deflate:a,Inflate:l,CompressionStream:c,DecompressionStream:u,workerScripts:d}=t;if(Jo("baseURL",e),Jo("chunkSize",n),Jo("maxWorkers",s),Jo("terminateWorkerTimeout",i),Jo("useCompressionStream",r),Jo("useWebWorkers",o),a&&(ga.CompressionStream=new WM(a)),l&&(ga.DecompressionStream=new WM(l)),Jo("CompressionStream",c),Jo("DecompressionStream",u),d!==ci){const{deflate:h,inflate:f}=d;if((h||f)&&(ga.workerScripts||(ga.workerScripts={})),h){if(!Array.isArray(h))throw new Error("workerScripts.deflate must be an array");ga.workerScripts.deflate=h}if(f){if(!Array.isArray(f))throw new Error("workerScripts.inflate must be an array");ga.workerScripts.inflate=f}}}function Jo(t,e){e!==ci&&(ga[t]=e)}const Dv={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const t={};for(const e of Object.keys(Dv))for(const n of Object.keys(Dv[e])){const s=Dv[e][n];if(typeof s=="string")t[s]=e+"/"+n;else for(let i=0;i>>1^3988292384:e=e>>>1;WO[t]=e}class l_{constructor(e){this.crc=e||-1}append(e){let n=this.crc|0;for(let s=0,i=e.length|0;s>>8^WO[(n^e[s])&255];this.crc=n}get(){return~this.crc}}class jO extends TransformStream{constructor(){let e;const n=new l_;super({transform(s,i){n.append(s),i.enqueue(s)},flush(){const s=new Uint8Array(4);new DataView(s.buffer).setUint32(0,n.get()),e.value=s}}),e=this}}function $Ae(t){if(typeof TextEncoder==Ga){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let n=0;n0&&e&&(t[n-1]=ks.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial(t,e,n){return t===32?e:(n?e|0:e<<32-t)+t*1099511627776},getPartial(t){return Math.round(t/1099511627776)||32},_shiftRight(t,e,n,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(e===0)return s.concat(t);for(let o=0;o>>e),n=t[o]<<32-e;const i=t.length?t[t.length-1]:0,r=ks.getPartial(i);return s.push(ks.partial(e+r&31,e+r>32?n:s.pop(),1)),s}},c_={bytes:{fromBits(t){const n=ks.bitLength(t)/8,s=new Uint8Array(n);let i;for(let r=0;r>>24,i<<=8;return s},toBits(t){const e=[];let n,s=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const r=new Uint32Array(n);let o=0;for(let a=e.blockSize+s-(e.blockSize+s&e.blockSize-1);a<=i;a+=e.blockSize)e._block(r.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e}finalize(){const t=this;let e=t._buffer;const n=t._h;e=ks.concat(e,[ks.partial(1,1)]);for(let s=e.length+2;s&15;s++)e.push(0);for(e.push(Math.floor(t._length/4294967296)),e.push(t._length|0);e.length;)t._block(e.splice(0,16));return t.reset(),n}_f(t,e,n,s){if(t<=19)return e&n|~e&s;if(t<=39)return e^n^s;if(t<=59)return e&n|e&s|n&s;if(t<=79)return e^n^s}_S(t,e){return e<>>32-t}_block(t){const e=this,n=e._h,s=Array(80);for(let c=0;c<16;c++)s[c]=t[c];let i=n[0],r=n[1],o=n[2],a=n[3],l=n[4];for(let c=0;c<=79;c++){c>=16&&(s[c]=e._S(1,s[c-3]^s[c-8]^s[c-14]^s[c-16]));const u=e._S(5,i)+e._f(c,r,o,a)+l+s[c]+e._key[Math.floor(c/20)]|0;l=a,a=o,o=e._S(30,r),r=i,i=u}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0}};const YO={};YO.aes=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const n=e._tables[0][4],s=e._tables[1],i=t.length;let r,o,a,l=1;if(i!==4&&i!==6&&i!==8)throw new Error("invalid aes key size");for(e._key=[o=t.slice(0),a=[]],r=i;r<4*i+28;r++){let c=o[r-1];(r%i===0||i===8&&r%i===4)&&(c=n[c>>>24]<<24^n[c>>16&255]<<16^n[c>>8&255]<<8^n[c&255],r%i===0&&(c=c<<8^c>>>24^l<<24,l=l<<1^(l>>7)*283)),o[r]=o[r-i]^c}for(let c=0;r;c++,r--){const u=o[c&3?r:r-4];r<=4||c<4?a[c]=u:a[c]=s[0][n[u>>>24]]^s[1][n[u>>16&255]]^s[2][n[u>>8&255]]^s[3][n[u&255]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],n=t[4],s=e[4],i=[],r=[];let o,a,l,c;for(let u=0;u<256;u++)r[(i[u]=u<<1^(u>>7)*283)^u]=u;for(let u=o=0;!n[u];u^=a||1,o=r[o]||1){let d=o^o<<1^o<<2^o<<3^o<<4;d=d>>8^d&255^99,n[u]=d,s[d]=u,c=i[l=i[a=i[u]]];let h=c*16843009^l*65537^a*257^u*16843008,f=i[d]*257^d*16843008;for(let v=0;v<4;v++)t[v][u]=f=f<<24^f>>>8,e[v][d]=h=h<<24^h>>>8}for(let u=0;u<5;u++)t[u]=t[u].slice(0),e[u]=e[u].slice(0)}_crypt(t,e){if(t.length!==4)throw new Error("invalid aes block size");const n=this._key[e],s=n.length/4-2,i=[0,0,0,0],r=this._tables[e],o=r[0],a=r[1],l=r[2],c=r[3],u=r[4];let d=t[0]^n[0],h=t[e?3:1]^n[1],f=t[2]^n[2],v=t[e?1:3]^n[3],_=4,m,g,y;for(let b=0;b>>24]^a[h>>16&255]^l[f>>8&255]^c[v&255]^n[_],g=o[h>>>24]^a[f>>16&255]^l[v>>8&255]^c[d&255]^n[_+1],y=o[f>>>24]^a[v>>16&255]^l[d>>8&255]^c[h&255]^n[_+2],v=o[v>>>24]^a[d>>16&255]^l[h>>8&255]^c[f&255]^n[_+3],_+=4,d=m,h=g,f=y;for(let b=0;b<4;b++)i[e?3&-b:b]=u[d>>>24]<<24^u[h>>16&255]<<16^u[f>>8&255]<<8^u[v&255]^n[_++],m=d,d=h,h=f,f=v,v=m;return i}};const BAe={getRandomValues(t){const e=new Uint32Array(t.buffer),n=s=>{let i=987654321;const r=4294967295;return function(){return i=36969*(i&65535)+(i>>16)&r,s=18e3*(s&65535)+(s>>16)&r,(((i<<16)+s&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let s=0,i;s>24&255)===255){let e=t>>16&255,n=t>>8&255,s=t&255;e===255?(e=0,n===255?(n=0,s===255?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}else t+=1<<24;return t}incCounter(t){(t[0]=this.incWord(t[0]))===0&&(t[1]=this.incWord(t[1]))}calculate(t,e,n){let s;if(!(s=e.length))return[];const i=ks.bitLength(e);for(let r=0;r>5)+1<<2;let r,o,a,l,c;const u=new ArrayBuffer(i),d=new DataView(u);let h=0;const f=ks;for(e=c_.bytes.toBits(e),c=1;h<(i||1);c++){for(r=o=t.encrypt(f.concat(e,[c])),a=1;ai&&(t=new n().update(t).finalize());for(let r=0;rthis.resolveReady=o),password:sI(e,n),signed:s,strength:i-1,pending:new Uint8Array})},async transform(o,a){const l=this,{password:c,strength:u,resolveReady:d,ready:h}=l;c?(await QAe(l,u,c,xi(o,0,Af[u]+2)),o=xi(o,Af[u]+2),r?a.error(new Error(Kx)):d()):await h;const f=new Uint8Array(o.length-aa-(o.length-aa)%au);a.enqueue(tI(l,o,f,0,aa,!0))},async flush(o){const{signed:a,ctr:l,hmac:c,pending:u,ready:d}=this;if(c&&l){await d;const h=xi(u,0,u.length-aa),f=xi(u,u.length-aa);let v=new Uint8Array;if(h.length){const _=Rf(Rr,h);c.update(_);const m=l.update(_);v=Mf(Rr,m)}if(a){const _=xi(Mf(Rr,c.digest()),0,aa);for(let m=0;mthis.resolveReady=r),password:sI(e,n),strength:s-1,pending:new Uint8Array})},async transform(r,o){const a=this,{password:l,strength:c,resolveReady:u,ready:d}=a;let h=new Uint8Array;l?(h=await e3e(a,c,l),u()):await d;const f=new Uint8Array(h.length+r.length-r.length%au);f.set(h,0),o.enqueue(tI(a,r,f,h.length,0))},async flush(r){const{ctr:o,hmac:a,pending:l,ready:c}=this;if(a&&o){await c;let u=new Uint8Array;if(l.length){const d=o.update(Rf(Rr,l));a.update(d),u=Mf(Rr,d)}i.signature=Mf(Rr,a.digest()).slice(0,aa),r.enqueue(Zx(u,i.signature))}}}),i=this}}function tI(t,e,n,s,i,r){const{ctr:o,hmac:a,pending:l}=t,c=e.length-i;l.length&&(e=Zx(l,e),n=s3e(n,c-c%au));let u;for(u=0;u<=c-au;u+=au){const d=Rf(Rr,xi(e,u,u+au));r&&a.update(d);const h=o.update(d);r||a.update(h),n.set(Mf(Rr,h),u+s)}return t.pending=xi(e,u),n}async function QAe(t,e,n,s){const i=await nI(t,e,n,xi(s,0,Af[e])),r=xi(s,Af[e]);if(i[0]!=r[0]||i[1]!=r[1])throw new Error(KO)}async function e3e(t,e,n){const s=JO(new Uint8Array(Af[e])),i=await nI(t,e,n,s);return Zx(s,i)}async function nI(t,e,n,s){t.password=null;const i=await t3e(GAe,n,WAe,!1,jAe),r=await n3e(Object.assign({salt:s},fb),i,8*(ph[e]*2+2)),o=new Uint8Array(r),a=Rf(Rr,xi(o,0,ph[e])),l=Rf(Rr,xi(o,ph[e],ph[e]*2)),c=xi(o,ph[e]*2);return Object.assign(t,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new XAe(new YAe(a),Array.from(qAe)),hmac:new KAe(l)}),c}async function t3e(t,e,n,s,i){if(jM)try{return await op.importKey(t,e,n,s,i)}catch{return jM=!1,cc.importKey(e)}else return cc.importKey(e)}async function n3e(t,e,n){if(qM)try{return await op.deriveBits(t,e,n)}catch{return qM=!1,cc.pbkdf2(e,t.salt,fb.iterations,n)}else return cc.pbkdf2(e,t.salt,fb.iterations,n)}function sI(t,e){return e===ci?$Ae(t):e}function Zx(t,e){let n=t;return t.length+e.length&&(n=new Uint8Array(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function s3e(t,e){if(e&&e>t.length){const n=t;t=new Uint8Array(e),t.set(n,0)}return t}function xi(t,e,n){return t.subarray(e,n)}function Mf(t,e){return t.fromBits(e)}function Rf(t,e){return t.toBits(e)}const Cu=12;class i3e extends TransformStream{constructor({password:e,passwordVerification:n,checkPasswordOnly:s}){super({start(){Object.assign(this,{password:e,passwordVerification:n}),iI(this,e)},transform(i,r){const o=this;if(o.password){const a=YM(o,i.subarray(0,Cu));if(o.password=null,a[Cu-1]!=o.passwordVerification)throw new Error(KO);i=i.subarray(Cu)}s?r.error(new Error(Kx)):r.enqueue(YM(o,i))}})}}class r3e extends TransformStream{constructor({password:e,passwordVerification:n}){super({start(){Object.assign(this,{password:e,passwordVerification:n}),iI(this,e)},transform(s,i){const r=this;let o,a;if(r.password){r.password=null;const l=JO(new Uint8Array(Cu));l[Cu-1]=r.passwordVerification,o=new Uint8Array(s.length+l.length),o.set(XM(r,l),0),a=Cu}else o=new Uint8Array(s.length),a=0;o.set(XM(r,s),a),i.enqueue(o)}})}}function YM(t,e){const n=new Uint8Array(e.length);for(let s=0;s>>24]),i=~t.crcKey2.get(),t.keys=[n,s,i]}function rI(t){const e=t.keys[2]|2;return oI(Math.imul(e,e^1)>>>8)}function oI(t){return t&255}function KM(t){return t&4294967295}const ZM="deflate-raw";class o3e extends TransformStream{constructor(e,{chunkSize:n,CompressionStream:s,CompressionStreamNative:i}){super({});const{compressed:r,encrypted:o,useCompressionStream:a,zipCrypto:l,signed:c,level:u}=e,d=this;let h,f,v=aI(super.readable);(!o||l)&&c&&(h=new jO,v=kr(v,h)),r&&(v=cI(v,a,{level:u,chunkSize:n},i,s)),o&&(l?v=kr(v,new r3e(e)):(f=new JAe(e),v=kr(v,f))),lI(d,v,()=>{let _;o&&!l&&(_=f.signature),(!o||l)&&c&&(_=new DataView(h.value.buffer).getUint32(0)),d.signature=_})}}class a3e extends TransformStream{constructor(e,{chunkSize:n,DecompressionStream:s,DecompressionStreamNative:i}){super({});const{zipCrypto:r,encrypted:o,signed:a,signature:l,compressed:c,useCompressionStream:u}=e;let d,h,f=aI(super.readable);o&&(r?f=kr(f,new i3e(e)):(h=new ZAe(e),f=kr(f,h))),c&&(f=cI(f,u,{chunkSize:n},i,s)),(!o||r)&&a&&(d=new jO,f=kr(f,d)),lI(this,f,()=>{if((!o||r)&&a){const v=new DataView(d.value.buffer);if(l!=v.getUint32(0,!1))throw new Error(ZO)}})}}function aI(t){return kr(t,new TransformStream({transform(e,n){e&&e.length&&n.enqueue(e)}}))}function lI(t,e,n){e=kr(e,new TransformStream({flush:n})),Object.defineProperty(t,"readable",{get(){return e}})}function cI(t,e,n,s,i){try{const r=e&&s?s:i;t=kr(t,new r(ZM,n))}catch{if(e)try{t=kr(t,new i(ZM,n))}catch{return t}else return t}return t}function kr(t,e){return t.pipeThrough(e)}const l3e="message",c3e="start",u3e="pull",JM="data",d3e="ack",QM="close",h3e="deflate",uI="inflate";class f3e extends TransformStream{constructor(e,n){super({});const s=this,{codecType:i}=e;let r;i.startsWith(h3e)?r=o3e:i.startsWith(uI)&&(r=a3e);let o=0,a=0;const l=new r(e,n),c=super.readable,u=new TransformStream({transform(h,f){h&&h.length&&(a+=h.length,f.enqueue(h))},flush(){Object.assign(s,{inputSize:a})}}),d=new TransformStream({transform(h,f){h&&h.length&&(o+=h.length,f.enqueue(h))},flush(){const{signature:h}=l;Object.assign(s,{signature:h,outputSize:o,inputSize:a})}});Object.defineProperty(s,"readable",{get(){return c.pipeThrough(u).pipeThrough(l).pipeThrough(d)}})}}class p3e extends TransformStream{constructor(e){let n;super({transform:s,flush(i){n&&n.length&&i.enqueue(n)}});function s(i,r){if(n){const o=new Uint8Array(n.length+i.length);o.set(n),o.set(i,n.length),i=o,n=null}i.length>e?(r.enqueue(i.slice(0,e)),s(i.slice(e),r)):n=i}}}let dI=typeof Worker!=Ga;class Nv{constructor(e,{readable:n,writable:s},{options:i,config:r,streamOptions:o,useWebWorkers:a,transferStreams:l,scripts:c},u){const{signal:d}=o;return Object.assign(e,{busy:!0,readable:n.pipeThrough(new p3e(r.chunkSize)).pipeThrough(new m3e(n,o),{signal:d}),writable:s,options:Object.assign({},i),scripts:c,transferStreams:l,terminate(){return new Promise(h=>{const{worker:f,busy:v}=e;f?(v?e.resolveTerminated=h:(f.terminate(),h()),e.interface=null):h()})},onTaskFinished(){const{resolveTerminated:h}=e;h&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),h()),e.busy=!1,u(e)}}),(a&&dI?g3e:hI)(e,r)}}class m3e extends TransformStream{constructor(e,{onstart:n,onprogress:s,size:i,onend:r}){let o=0;super({async start(){n&&await Fv(n,i)},async transform(a,l){o+=a.length,s&&await Fv(s,o,i),l.enqueue(a)},async flush(){e.size=o,r&&await Fv(r,o)}})}}async function Fv(t,...e){try{await t(...e)}catch{}}function hI(t,e){return{run:()=>_3e(t,e)}}function g3e(t,e){const{baseURL:n,chunkSize:s}=e;if(!t.interface){let i;try{i=b3e(t.scripts[0],n,t)}catch{return dI=!1,hI(t,e)}Object.assign(t,{worker:i,interface:{run:()=>v3e(t,{chunkSize:s})}})}return t.interface}async function _3e({options:t,readable:e,writable:n,onTaskFinished:s},i){try{const r=new f3e(t,i);await e.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});const{signature:o,inputSize:a,outputSize:l}=r;return{signature:o,inputSize:a,outputSize:l}}finally{s()}}async function v3e(t,e){let n,s;const i=new Promise((h,f)=>{n=h,s=f});Object.assign(t,{reader:null,writer:null,resolveResult:n,rejectResult:s,result:i});const{readable:r,options:o,scripts:a}=t,{writable:l,closed:c}=y3e(t.writable),u=pg({type:c3e,scripts:a.slice(1),options:o,config:e,readable:r,writable:l},t);u||Object.assign(t,{reader:r.getReader(),writer:l.getWriter()});const d=await i;return u||await l.getWriter().close(),await c,d}function y3e(t){let e;const n=new Promise(i=>e=i);return{writable:new WritableStream({async write(i){const r=t.getWriter();await r.ready,await r.write(i),r.releaseLock()},close(){e()},abort(i){return t.getWriter().abort(i)}}),closed:n}}let eR=!0,tR=!0;function b3e(t,e,n){const s={type:"module"};let i,r;typeof t==rp&&(t=t());try{i=new URL(t,e)}catch{i=t}if(eR)try{r=new Worker(i)}catch{eR=!1,r=new Worker(i,s)}else r=new Worker(i,s);return r.addEventListener(l3e,o=>w3e(o,n)),r}function pg(t,{worker:e,writer:n,onTaskFinished:s,transferStreams:i}){try{let{value:r,readable:o,writable:a}=t;const l=[];if(r&&(r.byteLength!g.busy);if(m)return sR(m),new Nv(m,t,e,_);if(Pl.lengthUv.push({resolve:g,stream:t,workerOptions:e}))}function _(m){if(Uv.length){const[{resolve:g,stream:y,workerOptions:b}]=Uv.splice(0,1);g(new Nv(m,y,b,_))}else m.worker?(sR(m),S3e(m,e)):Pl=Pl.filter(g=>g!=m)}}function S3e(t,e){const{config:n}=e,{terminateWorkerTimeout:s}=n;Number.isFinite(s)&&s>=0&&(t.terminated?t.terminated=!1:t.terminateTimeout=setTimeout(async()=>{Pl=Pl.filter(i=>i!=t);try{await t.terminate()}catch{}},s))}function sR(t){const{terminateTimeout:e}=t;e&&(clearTimeout(e),t.terminateTimeout=null)}function E3e(t){const e=()=>URL.createObjectURL(new Blob([`const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v="undefined",S="function";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={p:{m(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},k(e){const t=[];let n,r=0;for(n=0;n9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.P(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}D(){const e=this;let t=e.A;const n=e.C;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e._/4294967296)),t.push(0|e._);t.length;)e.P(t.splice(0,16));return e.reset(),n}V(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}R(e,t){return t<>>32-e}P(t){const n=this,s=n.C,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.R(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.R(5,o)+n.V(e,c,f,a)+l+i[e]+n.S[r.floor(e/20)]|0;l=a,a=f,f=n.R(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;inew V.B(I.p.k(e)),M(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.p.k(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;ad&&fs&&(e=(new n).update(e).D());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.K[0].update(r[0]),t.K[1].update(r[1]),t.N=new n(t.K[0])}reset(){const e=this;e.N=new e.U(e.K[0]),e.O=!1}update(e){this.O=!0,this.N.update(e)}digest(){const e=this,t=e.N.D(),n=new e.U(e.K[1]).update(t).D();return e.reset(),n}encrypt(e){if(this.O)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B="Invalid password",E="Invalid signature",M="zipjs-abort-check-password";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:"PBKDF2"},O=t.assign({hash:{name:"HMAC"}},N),T=t.assign({iterations:1e3,hash:{name:"SHA-1"}},N),W=["deriveBits"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.p,X=class{constructor(e){const t=this;t.T=[[[],[],[],[],[]],[[],[],[],[],[]]],t.T[0][0][0]||t.W();const n=t.T[0][4],r=t.T[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.S=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.j(e,0)}decrypt(e){return this.j(e,1)}W(){const e=this.T[0],t=this.T[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}j(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.S[t],r=n.length/4-2,i=[0,0,0,0],o=this.T[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.H=e,this.L=t,this.F=t}reset(){this.F=this.L}update(e){return this.q(this.H,e,this.F)}G(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}J(e){0===(e[0]=this.G(e[0]))&&(e[1]=this.G(e[1]))}q(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.J(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.B;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),signed:r,Y:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:o,X:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Z:n,$:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.X=e)),password:ie(e,n),Y:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,Y:s,X:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Z:t,$:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Z:c,$:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey("raw",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.M(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.M(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,ee:u,passwordVerification:w},Z:new Y(new X(l),e.from(F)),$:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n>>24]),i=~e.ne.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge="deflate-raw";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae="data",_e="close";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=ke:s.startsWith("inflate")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,"readable",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=15,Te=573,We=-2;function je(t){return He(t.map((([t,n])=>new e(t).fill(n,0,t))))}function He(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?He(n):n)),[])}const Le=[0,1,2,3].concat(...je([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function Fe(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.re=n=>{const s=e.se,i=e.oe.ie,o=e.oe.ce;let c,f,a,l=-1;for(n.fe=0,n.ae=Te,c=0;o>c;c++)0!==s[2*c]?(n.le[++n.fe]=l=c,n.ue[c]=0):s[2*c+1]=0;for(;2>n.fe;)a=n.le[++n.fe]=2>l?++l:0,s[2*a]=1,n.ue[a]=0,n.we--,i&&(n.he-=i[2*a+1]);for(e.de=l,c=r.floor(n.fe/2);c>=1;c--)n.pe(s,c);a=o;do{c=n.le[1],n.le[1]=n.le[n.fe--],n.pe(s,1),f=n.le[1],n.le[--n.ae]=c,n.le[--n.ae]=f,s[2*a]=s[2*c]+s[2*f],n.ue[a]=r.max(n.ue[c],n.ue[f])+1,s[2*c+1]=s[2*f+1]=a,n.le[1]=a++,n.pe(s,1)}while(n.fe>=2);n.le[--n.ae]=n.le[1],(t=>{const n=e.se,r=e.oe.ie,s=e.oe.ye,i=e.oe.me,o=e.oe.be;let c,f,a,l,u,w,h=0;for(l=0;Oe>=l;l++)t.ge[l]=0;for(n[2*t.le[t.ae]+1]=0,c=t.ae+1;Te>c;c++)f=t.le[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.de||(t.ge[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.we+=w*(l+u),r&&(t.he+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.ge[l];)l--;t.ge[l]--,t.ge[l+1]+=2,t.ge[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.ge[l];0!==f;)a=t.le[--c],a>e.de||(n[2*a+1]!=l&&(t.we+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;Oe>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.de,n.ge)}}function qe(e,t,n,r,s){const i=this;i.ie=e,i.ye=t,i.me=n,i.ce=r,i.be=s}Fe.ke=[0,1,2,3,4,5,6,7].concat(...je([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),Fe.ve=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],Fe.Se=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],Fe.ze=e=>256>e?Le[e]:Le[256+(e>>>7)],Fe.Ce=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Fe.xe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Fe.Ae=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Fe._e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Ge=je([[144,8],[112,9],[24,7],[8,8]]);qe.Ie=He([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Ge[t]])));const Je=je([[30,5]]);function Qe(e,t,n,r,s){const i=this;i.Pe=e,i.De=t,i.Ve=n,i.Re=r,i.Be=s}qe.Ee=He([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,Je[t]]))),qe.Me=new qe(qe.Ie,Fe.Ce,257,286,Oe),qe.Ue=new qe(qe.Ee,Fe.xe,0,30,Oe),qe.Ke=new qe(null,Fe.Ae,0,19,7);const Xe=[new Qe(0,0,0,0,0),new Qe(4,4,8,4,1),new Qe(4,5,16,8,1),new Qe(4,6,32,32,1),new Qe(4,4,16,16,2),new Qe(8,16,32,32,2),new Qe(8,16,128,128,2),new Qe(8,32,128,256,2),new Qe(32,128,258,1024,2),new Qe(32,258,258,4096,2)],Ye=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Ze=113,$e=666,et=262;function tt(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function nt(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new Fe,N=new Fe,O=new Fe;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.we=e.he=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++ii?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ne[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<>>16-F,F+=r-16):(L|=e<=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Oe[W]=t,e.Te[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(Fe.ke[n]+256+1)]++,M[2*Fe.ze(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+Fe.xe[o]);if(s>>>=3,jc);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ne.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.re(e),N.re(e),o=(()=>{let t;for(G(E,K.de),G(M,N.de),O.re(e),t=18;t>=3&&0===U[2*Fe._e[t]+1];t--);return e.we+=14+3*(t+1),t})(),s=e.we+3+7>>>3,i=e.he+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(qe.Ie,qe.Ee)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*Fe._e[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.de+1,N.de+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.We()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-et){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.je)return;e=t.He(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<A&&0!==t.je)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-et?C-(f-et):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.ue=[],e.ge=[],e.le=[],E=[],M=[],U=[],e.pe=(t,n)=>{const r=e.le,s=r[n];let i=n<<1;for(;i<=e.fe&&(i(W||(W=8),j||(j=8),G||(G=0),t.Fe=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?We:(t.qe=e,a=x,f=1<(t.Ge=t.Je=0,t.Fe=null,e.pending=0,e.Qe=0,n=Ze,c=0,K.se=E,K.oe=qe.Me,N.se=M,N.oe=qe.Ue,O.se=U,O.oe=qe.Ke,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Xe[D].De,R=Xe[D].Pe,B=Xe[D].Ve,I=Xe[D].Re,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Xe=()=>42!=n&&n!=Ze&&n!=$e?We:(e.Te=null,e.Oe=null,e.Ne=null,d=null,h=null,u=null,e.qe=null,n==Ze?-3:0),e.Ye=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?We:(Xe[D].Be!=Xe[t].Be&&0!==e.Ge&&(r=e.Ze(1)),D!=t&&(D=t,P=Xe[D].De,R=Xe[D].Pe,B=Xe[D].Ve,I=Xe[D].Re),V=n,r)},e.$e=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return We;if(3>i)return 0;for(i>f-et&&(i=f-et,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<=s;s++)p=(p<{let o,w,m,I,R;if(i>4||0>i)return We;if(!r.et||!r.tt&&0!==r.je||n==$e&&4!=i)return r.Fe=Ye[4],We;if(0===r.nt)return r.Fe=Ye[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Ze,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.We(),0===t.nt)return c=-1,0}else if(0===t.je&&I>=i&&4!=i)return t.Fe=Ye[7],-5;if(n==$e&&0!==t.je)return r.Fe=Ye[7],-5;if(0!==t.je||0!==A||0!=i&&n!=$e){switch(R=-1,Xe[D].Be){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.nt))return 0;if(C-k>=f-et&&(se(!1),0===t.nt))return 0}return se(4==e),0===t.nt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(et>A){if(ie(),et>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<f-et||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<{let n,r,s=0;for(;;){if(et>A){if(ie(),et>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<_&&f-et>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.nt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<1+H+10-F&&(X(2,3),Y(256,qe.Ie),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.We(),0===t.nt)return c=-1,0}}return 4!=i?0:1}}function rt(){const e=this;e.rt=0,e.st=0,e.je=0,e.Ge=0,e.nt=0,e.Je=0}function st(e){const t=new rt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.Le(f),t.et=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,o=t.Ze(0),0!=o)throw new s("deflating: "+t.Fe);t.st&&(t.st==n?w.push(new i(c)):w.push(c.subarray(0,t.st))),u+=t.st,r&&t.rt>0&&t.rt!=a&&(r(t.rt),a=t.rt)}while(t.je>0||0===t.nt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.st=0,t.nt=n,e=t.Ze(4),1!=e&&0!=e)throw new s("deflating: "+t.Fe);n-t.nt>0&&a.push(c.slice(0,t.st)),f+=t.st}while(t.je>0||0===t.nt);return t.Xe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}rt.prototype={Le(e,t){const n=this;return n.qe=new nt,t||(t=Oe),n.qe.Le(n,e,t)},Ze(e){const t=this;return t.qe?t.qe.Ze(t,e):We},Xe(){const e=this;if(!e.qe)return We;const t=e.qe.Xe();return e.qe=null,t},Ye(e,t){const n=this;return n.qe?n.qe.Ye(n,e,t):We},$e(e,t){const n=this;return n.qe?n.qe.$e(n,e,t):We},He(e,t,n){const r=this;let s=r.je;return s>n&&(s=n),0===s?0:(r.je-=s,e.set(r.tt.subarray(r.rt,r.rt+s),t),r.rt+=s,r.Ge+=s,s)},We(){const e=this;let t=e.qe.pending;t>e.nt&&(t=e.nt),0!==t&&(e.et.set(e.qe.Ne.subarray(e.qe.Qe,e.qe.Qe+t),e.st),e.st+=t,e.qe.Qe+=t,e.Je+=t,e.nt-=t,e.qe.pending-=t,0===e.qe.pending&&(e.qe.Qe=0))}};const it=0,ot=1,ct=-2,ft=-3,at=-4,lt=-5,ut=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],wt=1440,ht=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],dt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],pt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],yt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],mt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],bt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],gt=15;function kt(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,it;for(S=u[0],k=1;gt>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=gt;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<k;k++,I<<=1)if(0>(I-=n[k]))return ft;if(0>(I-=n[g]))return ft;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++kn[++_];)y-=n[_];if(P=1<wt)return ft;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<>>=1)g^=k;for(g^=k,z=(1<c;c++)t[c]=0;for(c=0;gt+1>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,gt),0),i.set(n.subarray(0,gt+1),0)}this.it=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==ft?f.Fe="oversubscribed dynamic bit lengths tree":a!=lt&&0!==r[0]||(f.Fe="incomplete dynamic bit lengths tree",a=ft),a},this.ot=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,pt,yt,a,i,u,e,t),h!=it||0===i[0]?(h==ft?w.Fe="oversubscribed literal/length tree":h!=at&&(w.Fe="incomplete literal/length tree",h=ft),h):(c(288),h=o(s,n,r,0,mt,bt,l,f,u,e,t),h!=it||0===f[0]&&n>257?(h==ft?w.Fe="oversubscribed distance tree":h==lt?(w.Fe="incomplete distance tree",h=ft):h!=at&&(w.Fe="empty distance tree with lengths",h=ft),h):it)}}kt.ct=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ht,r[0]=dt,it);const vt=0,St=1,zt=2,Ct=3,xt=4,At=5,_t=6,It=7,Pt=8,Dt=9;function Vt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.rt,p=c.je,w=o.ft,h=o.lt,y=o.write,m=yh;)p--,w|=(255&c.ut(d++))<>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ut[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ut(d++))<>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.ut(d++))<>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.wt[y++]=o.wt[S++]}while(0!=--u);else o.wt.set(o.wt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.wt[y++]=o.wt[S++],o.wt[y++]=o.wt[S++],k-=2):(o.wt.set(o.wt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.wt[y++]=o.wt[S++]}while(0!=--k);else o.wt.set(o.wt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Fe="invalid distance code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ft;f+=a[z+2],f+=w&ut[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ot):(c.Fe="invalid literal/length code",k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,ft);if(f+=a[z+2],f+=w&ut[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.wt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.wt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.je-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ft=w,o.lt=h,c.je=p,c.Ge+=d-c.rt,c.rt=d,o.write=y,it}e.init=(e,i,o,c,f,a)=>{t=vt,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ht=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.rt,v=y.je,x=e.ft,A=e.lt,S=e.write,z=S=258&&v>=10&&(e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.rt,v=y.je,x=e.ft,A=e.lt,S=e.write,z=SA;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=_t;break}if(16&k){a=15&k,i=n[g+2],t=zt;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=It;break}return t=Dt,y.Fe="invalid literal/length code",m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case zt:for(b=a;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<>=b,A-=b,c=w,n=s,o=d,t=Ct;case Ct:for(b=c;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=xt;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=Dt,y.Fe="invalid distance code",m=ft,e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);case xt:for(b=a;b>A;){if(0===v)return e.ft=x,e.lt=A,y.je=v,y.Ge+=_-y.rt,y.rt=_,e.write=S,e.dt(y,m);m=it,v--,x|=(255&y.ut(_++))<>=b,A-=b,t=At;case At:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S7&&(A-=8,v++,_--),e.write=S,m=e.dt(y,m),S=e.write,z=S{}}const Rt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Bt=0,Et=1,Mt=2,Ut=3,Kt=4,Nt=5,Ot=6,Tt=7,Wt=8,jt=9;function Ht(e,t){const n=this;let r,s=Bt,o=0,c=0,a=0;const l=[0],u=[0],w=new Vt;let h=0,d=new f(3*wt);const p=new kt;n.lt=0,n.ft=0,n.wt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),s==Ot&&w.yt(e),s=Bt,n.lt=0,n.ft=0,n.read=n.write=0},n.reset(e,null),n.dt=(e,t)=>{let r,s,i;return s=e.st,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.nt&&(r=e.nt),0!==r&&t==lt&&(t=it),e.nt-=r,e.Je+=r,e.et.set(n.wt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.nt&&(r=e.nt),0!==r&&t==lt&&(t=it),e.nt-=r,e.Je+=r,e.et.set(n.wt.subarray(i,i+r),s),s+=r,i+=r),e.st=s,n.read=i,t},n.ht=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.rt,b=e.je,f=n.ft,y=n.lt,g=n.write,k=gy;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=Et;break;case 1:S=[],z=[],C=[[]],x=[[]],kt.ct(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=Ot;break;case 2:f>>>=3,y-=3,s=Ut;break;case 3:return f>>>=3,y-=3,s=jt,e.Fe="invalid block type",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t)}break;case Et:for(;32>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<>>16&65535)!=(65535&f))return s=jt,e.Fe="invalid stored block lengths",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);o=65535&f,f=y=0,s=0!==o?Mt:0!==h?Tt:Bt;break;case Mt:if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=gb&&(i=b),i>k&&(i=k),n.wt.set(e.He(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?Tt:Bt;break;case Ut:for(;14>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<29||(i>>5&31)>29)return s=jt,e.Fe="too many length or distance symbols",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.lengthv;v++)r[v]=0;f>>>=14,y-=14,a=0,s=Kt;case Kt:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<>>=3,y-=3}for(;19>a;)r[Rt[a++]]=0;if(l[0]=7,i=p.it(r,l,u,d,e),i!=it)return(t=i)==ft&&(r=null,s=jt),n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);a=0,s=Nt;case Nt:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);t=it,b--,f|=(255&e.ut(m++))<>>=i,y-=i,o+=f&ut[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=jt,e.Fe="invalid bit length repeat",t=ft,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.ot(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),i!=it)return i==ft&&(r=null,s=jt),t=i,n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,n.dt(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=Ot;case Ot:if(n.ft=f,n.lt=y,e.je=b,e.Ge+=m-e.rt,e.rt=m,n.write=g,(t=w.ht(n,e,t))!=ot)return n.dt(e,t);if(t=it,w.yt(e),m=e.rt,b=e.je,f=n.ft,y=n.lt,g=n.write,k=g{n.reset(e,null),n.wt=null,d=null},n.bt=(e,t,r)=>{n.wt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.gt=()=>s==Et?1:0}const Lt=13,Ft=[0,0,255,255];function qt(){const e=this;function t(e){return e&&e.kt?(e.Ge=e.Je=0,e.Fe=null,e.kt.mode=7,e.kt.vt.reset(e,null),it):ct}e.mode=0,e.method=0,e.St=[0],e.zt=0,e.marker=0,e.Ct=0,e.xt=t=>(e.vt&&e.vt.yt(t),e.vt=null,it),e.At=(n,r)=>(n.Fe=null,e.vt=null,8>r||r>15?(e.xt(n),ct):(e.Ct=r,n.kt.vt=new Ht(n,1<{let n,r;if(!e||!e.kt||!e.tt)return ct;const s=e.kt;for(t=4==t?lt:it,n=lt;;)switch(s.mode){case 0:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,8!=(15&(s.method=e.ut(e.rt++)))){s.mode=Lt,e.Fe="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.Ct){s.mode=Lt,e.Fe="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.je)return n;if(n=t,e.je--,e.Ge++,r=255&e.ut(e.rt++),((s.method<<8)+r)%31!=0){s.mode=Lt,e.Fe="incorrect header check",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt=(255&e.ut(e.rt++))<<24&4278190080,s.mode=3;case 3:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.ut(e.rt++))<<16&16711680,s.mode=4;case 4:if(0===e.je)return n;n=t,e.je--,e.Ge++,s.zt+=(255&e.ut(e.rt++))<<8&65280,s.mode=5;case 5:return 0===e.je?n:(n=t,e.je--,e.Ge++,s.zt+=255&e.ut(e.rt++),s.mode=6,2);case 6:return s.mode=Lt,e.Fe="need dictionary",s.marker=0,ct;case 7:if(n=s.vt.ht(e,n),n==ft){s.mode=Lt,s.marker=0;break}if(n==it&&(n=t),n!=ot)return n;n=t,s.vt.reset(e,s.St),s.mode=12;case 12:return e.je=0,ot;case Lt:return ft;default:return ct}},e.It=(e,t,n)=>{let r=0,s=n;if(!e||!e.kt||6!=e.kt.mode)return ct;const i=e.kt;return s<1<{let n,r,s,i,o;if(!e||!e.kt)return ct;const c=e.kt;if(c.mode!=Lt&&(c.mode=Lt,c.marker=0),0===(n=e.je))return lt;for(r=e.rt,s=c.marker;0!==n&&4>s;)e.ut(r)==Ft[s]?s++:s=0!==e.ut(r)?0:4-s,r++,n--;return e.Ge+=r-e.rt,e.rt=r,e.je=n,c.marker=s,4!=s?ft:(i=e.Ge,o=e.Je,t(e),e.Ge=i,e.Je=o,c.mode=7,it)},e.Dt=e=>e&&e.kt&&e.kt.vt?e.kt.vt.gt():ct}function Gt(){}function Jt(e){const t=new Gt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.At(),t.et=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.rt=0,t.tt=e,t.je=e.length;do{if(t.st=0,t.nt=n,0!==t.je||c||(t.rt=0,c=!0),a=t._t(0),c&&a===lt){if(0!==t.je)throw new s("inflating: bad input")}else if(a!==it&&a!==ot)throw new s("inflating: "+t.Fe);if((c||a===ot)&&t.je===e.length)throw new s("inflating: bad input");t.st&&(t.st===n?f.push(new i(o)):f.push(o.subarray(0,t.st))),h+=t.st,r&&t.rt>0&&t.rt!=u&&(r(t.rt),u=t.rt)}while(t.je>0||0===t.nt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.xt()}}Gt.prototype={At(e){const t=this;return t.kt=new qt,e||(e=15),t.kt.At(t,e)},_t(e){const t=this;return t.kt?t.kt._t(t,e):ct},xt(){const e=this;if(!e.kt)return ct;const t=e.kt.xt(e);return e.kt=null,t},Pt(){const e=this;return e.kt?e.kt.Pt(e):ct},It(e,t){const n=this;return n.kt?n.kt.It(n,e,t):ct},ut(e){return this.tt[e]},He(e,t){return this.tt.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=st,self.Inflate=Jt}; +`],{type:"text/javascript"}));t({workerScripts:{inflate:[e],deflate:[e]}})}const T3e="Writer iterator completed too soon",A3e="Content-Type",M3e=64*1024,fI="writable";class Qx{constructor(){this.size=0}init(){this.initialized=!0}}class e2 extends Qx{get readable(){const e=this,{chunkSize:n=M3e}=e,s=new ReadableStream({start(){this.chunkOffset=0},async pull(i){const{offset:r=0,size:o,diskNumberStart:a}=s,{chunkOffset:l}=this;i.enqueue(await hs(e,r+l,Math.min(n,o-l),a)),l+n>o?i.close():this.chunkOffset+=n}});return s}}class R3e extends e2{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,n){const s=this,i=e+n;let o=await(e||in&&(o=o.slice(e,i)),new Uint8Array(o)}}class k3e extends Qx{constructor(e){super();const n=this,s=new TransformStream,i=[];e&&i.push([A3e,e]),Object.defineProperty(n,fI,{get(){return s.writable}}),n.blob=new Response(s.readable,{headers:i}).blob()}getData(){return this.blob}}class C3e extends k3e{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:n}=this,s=await super.getData();if(s.text&&n)return s.text();{const i=new FileReader;return new Promise((r,o)=>{Object.assign(i,{onload:({target:a})=>r(a.result),onerror:()=>o(i.error)}),i.readAsText(s,e)})}}}class P3e extends e2{constructor(e){super(),Object.assign(this,{array:e,size:e.length})}readUint8Array(e,n){return this.array.slice(e,e+n)}}class O3e extends e2{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:n}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(n.map(async(s,i)=>{await s.init(),i!=n.length-1&&(e.lastDiskOffset+=s.size),e.size+=s.size})),super.init()}async readUint8Array(e,n,s=0){const i=this,{readers:r}=this;let o,a=s;a==-1&&(a=r.length-1);let l=e;for(;l>=r[a].size;)l-=r[a].size,a++;const c=r[a],u=c.size;if(l+n<=u)o=await hs(c,l,n);else{const d=u-l;o=new Uint8Array(n),o.set(await hs(c,l,d)),o.set(await i.readUint8Array(e+d,n-d,s),d)}return i.lastDiskNumber=Math.max(a,i.lastDiskNumber),o}}class iR extends Qx{constructor(e,n=4294967295){super();const s=this;Object.assign(s,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let i,r,o;const a=new WritableStream({async write(u){const{availableSize:d}=s;if(o)u.length>=d?(await l(u.slice(0,d)),await c(),s.diskOffset+=i.size,s.diskNumber++,o=null,await this.write(u.slice(d))):await l(u);else{const{value:h,done:f}=await e.next();if(f&&!h)throw new Error(T3e);i=h,i.size=0,i.maxSize&&(s.maxSize=i.maxSize),s.availableSize=s.maxSize,await u_(i),r=h.writable,o=r.getWriter(),await this.write(u)}},async close(){await o.ready,await c()}});Object.defineProperty(s,fI,{get(){return a}});async function l(u){const d=u.length;d&&(await o.ready,await o.write(u),i.size+=d,s.size+=d,s.availableSize-=d)}async function c(){r.size=i.size,await o.close()}}}async function u_(t,e){if(t.init&&!t.initialized)await t.init(e);else return Promise.resolve()}function I3e(t){return Array.isArray(t)&&(t=new O3e(t)),t instanceof ReadableStream&&(t={readable:t}),t}function L3e(t){t.writable===ci&&typeof t.next==rp&&(t=new iR(t)),t instanceof WritableStream&&(t={writable:t});const{writable:e}=t;return e.size===ci&&(e.size=0),t instanceof iR||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}function hs(t,e,n,s){return t.readUint8Array(e,n,s)}const pI="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),D3e=pI.length==256;function N3e(t){if(D3e){let e="";for(let n=0;nthis[n]=e[n])}}const $v="File format is not recognized",V3e="End of central directory not found",W3e="End of Zip64 central directory locator not found",j3e="Central directory header not found",q3e="Local file header not found",Y3e="Zip64 extra field not found",X3e="File contains encrypted entry",K3e="Encryption method not supported",oR="Compression method not supported",aR="Split zip file",lR="utf-8",cR="cp437",Z3e=[[bI,tc],[wI,tc],[xI,tc],[pb,ma]],J3e={[ma]:{getValue:Rn,bytes:4},[tc]:{getValue:mg,bytes:8}};class Q3e{constructor(e,n={}){Object.assign(this,{reader:I3e(e),options:n,config:FAe()})}async*getEntriesGenerator(e={}){const n=this;let{reader:s}=n;const{config:i}=n;if(await u_(s),(s.size===ci||!s.readUint8Array)&&(s=new R3e(await new Response(s.readable).blob()),await u_(s)),s.size=s.size&&(m=s.size-l-a-Yc,l=s.size-a-Yc),f!=h)throw new Error(aR);if(l<0)throw new Error($v);let y=0,b=await hs(s,l,a,v),w=Kn(b);if(a){const S=r.offset-a;if(Rn(w,y)!=$M&&l!=S){const P=l;l=S,m+=l-P,b=await hs(s,l,a,v),w=Kn(b)}}const T=r.offset-l-(s.lastDiskOffset||0);if(a!=T&&T>=0&&(a=T,b=await hs(s,l,a,v),w=Kn(b)),l<0||l>=s.size)throw new Error($v);const x=Us(n,e,"filenameEncoding"),A=Us(n,e,"commentEncoding");for(let S=0;S<_;S++){const P=new eMe(s,i,n.options);if(Rn(w,y)!=$M)throw new Error(j3e);TI(P,w,y+6);const D=!!P.bitFlag.languageEncodingFlag,k=y+46,U=k+P.filenameLength,z=U+P.extraFieldLength,G=Xn(w,y+4),J=(G&0)==0,B=b.subarray(k,U),fe=Xn(w,y+32),se=z+fe,we=b.subarray(z,se),xe=D,Ne=D,oe=J&&(Pu(w,y+38)&VM)==VM,Ee=Rn(w,y+42)+m;Object.assign(P,{versionMadeBy:G,msDosCompatible:J,compressedSize:0,uncompressedSize:0,commentLength:fe,directory:oe,offset:Ee,diskNumberStart:Xn(w,y+34),internalFileAttribute:Xn(w,y+36),externalFileAttribute:Rn(w,y+38),rawFilename:B,filenameUTF8:xe,commentUTF8:Ne,rawExtraField:b.subarray(U,z)});const Ce=Us(n,e,"decodeText")||mI,[ne,Re]=await Promise.all([Ce(B,xe?lR:x||cR),Ce(we,Ne?lR:A||cR)]);Object.assign(P,{rawComment:we,filename:ne,comment:Re,directory:oe||ne.endsWith(LAe)}),g=Math.max(Ee,g),await AI(P,P,w,y+6);const Ae=new rR(P);Ae.getData=(qe,Fe)=>P.getData(qe,Ae,Fe),y=se;const{onprogress:j}=e;if(j)try{await j(S+1,_,new rR(P))}catch{}yield Ae}const M=Us(n,e,"extractPrependedData"),E=Us(n,e,"extractAppendedData");return M&&(n.prependedData=g>0?await hs(s,0,g):new Uint8Array),n.comment=u?await hs(s,c+Yc,u):new Uint8Array,E&&(n.appendedData=d>>8&255:h>>>24&255),signature:h,compressed:c!=0,encrypted:T,useWebWorkers:Us(i,s,"useWebWorkers"),useCompressionStream:Us(i,s,"useCompressionStream"),transferStreams:Us(i,s,"transferStreams"),checkPasswordOnly:P},config:u,streamOptions:{signal:S,size:M,onstart:k,onprogress:U,onend:z}};let J=0;try{({outputSize:J}=await x3e({readable:E,writable:D},G))}catch(B){if(!P||B.message!=Kx)throw B}finally{const B=Us(i,s,"preventClose");D.size+=J,!B&&!D.locked&&await D.getWriter().close()}return P?ci:e.getData?e.getData():D}}function TI(t,e,n){const s=t.rawBitFlag=Xn(e,n+2),i=(s&HM)==HM,r=Rn(e,n+6);Object.assign(t,{encrypted:i,version:Xn(e,n),bitFlag:{level:(s&IAe)>>1,dataDescriptor:(s&GM)==GM,languageEncodingFlag:(s&zM)==zM},rawLastModDate:r,lastModDate:oMe(r),filenameLength:Xn(e,n+22),extraFieldLength:Xn(e,n+24)})}async function AI(t,e,n,s,i){const{rawExtraField:r}=e,o=e.extraField=new Map,a=Kn(new Uint8Array(r));let l=0;try{for(;le[i]==r);for(let i=0,r=0;i=5&&(r.push(mb),o.push(gb));let a=1;r.forEach((l,c)=>{if(t.data.length>=a+4){const u=Rn(s,a);e[l]=t[l]=new Date(u*1e3);const d=o[c];t[d]=u}a+=4})}async function rMe(t,e,n,s,i){const r=new Uint8Array(4),o=Kn(r);aMe(o,0,e);const a=s+i;return await l(s)||await l(Math.min(a,n));async function l(c){const u=n-c,d=await hs(t,u,c);for(let h=d.length-s;h>=0;h--)if(d[h]==r[0]&&d[h+1]==r[1]&&d[h+2]==r[2]&&d[h+3]==r[3])return{offset:u+h,buffer:d.slice(h,h+s).buffer}}}function Us(t,e,n){return e[n]===ci?t.options[n]:e[n]}function oMe(t){const e=(t&4294901760)>>16,n=t&65535;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function Bv(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Pu(t,e){return t.getUint8(e)}function Xn(t,e){return t.getUint16(e,!0)}function Rn(t,e){return t.getUint32(e,!0)}function mg(t,e){return Number(t.getBigUint64(e,!0))}function aMe(t,e,n){t.setUint32(e,n,!0)}function Kn(t){return new DataView(t.buffer)}let MI;try{MI=import.meta.url}catch{}Xx({baseURL:MI});E3e(Xx);Xx({Deflate:KTe,Inflate:_Ae});const yl={owner:"BossHobby",repo:"QUICKSILVER"},lMe={owner:"BossHobby",repo:"Configurator"},cMe="https://cors.bubblesort.me/?",uMe=[["Origin","http://localhost"],["X-Requested-With","XMLHttpRequest"]],dMe=336407,hMe=`-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCjm+/HBlaUmeHs +JuPNoLR/llQ+HmyZEdkP7ia6hF232WKRyGtwKAWWI1mAFle/m4L1I6FQQhh4uCqn +8uG01Ex+bBd6C6ecu214tx3xMTnmyh4MqUzjUYmEdcSZ3VjGJwU8J8yyXpfu7H8O +JgK5ibk6AX5qh45VvhjYRbZKLnILrMvOPJ6Y0H31FnucO6SZo7ZZnRK3C6O+Qi/w +0cHmtuQCVk4QOL+oCJIW0QNM2NYVrZY5OJc0lpbMuXmaEG8tIb2qUP0kwcX2oGMg +p68amMS3TXTH3Odc2mYhtLIoPhVyrVXyYHjcdp67vHJfomXcvW4E+TcxckBFwgI5 +iHIDIr+XAgMBAAECggEAB8LtBA8L6m7GZfKOWgHmrirOgkflNPnAx12v3qdK3t7k +KzBL0H1FjpLMuyPUM9XHx6NSEsGf8ZIjC+acyHxNyK2OC48j+250ygY92GRSb91k +wYsCh8IlePAxTG9Qt83AFNN6hXexU3dKq7wn4u9ipxrNCXa2zOCAwznDZQ+A/4a2 +jlIkMN9hqkwnTttkdGDo1gDO/U5lWIHO513vXhqvMXt76j2ekAShs2gGBpBvs+wn +/tyBJDIrSXcMCy4nwE4sDpPTpBcR2NF4wgxkjGBRphQzzBM2q0eNftlRmOlzNe/V +AdldCElnQNYvVmASMcKi+Iz6D7rgpCNU4AU/u8mGcQKBgQDX97mOPHM9Ox9a33RC +P10ifubVzQORBop2rkHsDGGWqTH/06ygUXF/OkPljVWJLhYGrXExiUnO9F7y0+lI +TsVLeqdgUwHqnrR+A78J+2kOQZHe2zD9dSgjrNhANL7lJfNMbat1d9m89a6Cc4cJ +gEpiShocw2T6DLs1+AQ2z0KPvwKBgQDB76as+S2IY9nYxR65E8LlTCAhPOrz7gzp +075MQb/+Ch7WnenX5UWpNtIAI5orXLGBTKoAP7x6eWLiJ4vxjj/C5szBI4nYjZT6 +JkiGGRqhmD8DVWi+eG9Ah5FlK1IOLa4vQdCwlhBx7xtYM/UbfWZjKUu+ZWk4JB0x +luUAvLTGKQKBgDR3+Nq3kP/FR17afvJBVq00y3wR7NXlEuq2d0mT0Hm77WvLz1q7 +rqlMTIaOicNkMPG6XY+9XPMsp4yzMy/gA0rNJ7DdOc/4cr1Sx6zzKZjPEVNlSUeq +mO/h5D/lEKO3Tp643jkRvxKLVbRXwOzsACZU/ncSeYvOYAVCljOCsxcdAoGBAI5a +A4UJ7gMkD96Oaku9lpxKsXbUST29qVrlItTEmlG1SgeMp/3h+60GYUTa3SohAuX+ +yPYf0pAvk4afMpifKmw8j2ThWihLXGP1P9y2hpbAstgWlCjjK/44xF93WeawXx+u +9qj3raCDuxWWJb8E3+e/gyqBM6eS0p74vKU63pJpAoGBAJVWaujxxkojAoVwbs0R +n/vvwY6snT2EgTGFaHllXtQAHkhoonqPQ0W+4NoM7KnZPDQcKERNrYJQkK+YKTnl +p9r9s032bxaycq7WAPoQAisit0zIt0iZzS6xDew0PIq0g4DjH0GG/y25gtx5MFcr +zM39Lg5JAtecNMRkjep4XQdR +-----END PRIVATE KEY-----`;class fMe{constructor(){Te(this,"_octokit")}async kit(){if(this._octokit)return this._octokit;const n=await new ITe({appId:dMe,privateKey:hMe}).getInstallationOctokit(37707080);return this._octokit=n}async fetchReleases(){const s=(await(await this.kit()).rest.repos.listReleases(yl)).data.filter(r=>r.assets.length>0),i={};for(const r of s)i[r.tag_name]=r.assets;return i}async fetchArtifacts(e){const n=await this.kit();return n.rest.actions.listWorkflowRunsForRepo({...yl,branch:e,per_page:1,status:"success"}).then(s=>s.data.total_count==0?[]:n.rest.actions.listWorkflowRunArtifacts({...yl,run_id:s.data.workflow_runs[0].id,per_page:100}).then(i=>i.data.artifacts))}async fetchVersion(e,n){return(await this.kit()).rest.repos.getContent({...e,path:"VERSION",ref:n}).then(i=>{var r,o;return(r=i==null?void 0:i.data)!=null&&r.content?atob((o=i.data)==null?void 0:o.content).trim():"v0.0.0"}).catch(()=>"v0.0.0")}async fetchBranches(){const s=(await(await this.kit()).rest.repos.listBranches(yl)).data.map(r=>Promise.all([this.fetchArtifacts(r.name),this.fetchVersion(yl,r.name)]).then(([o,a])=>({name:r.name,commit:r.commit.sha,version:a,artifacts:o}))),i={};for(const r of await Promise.all(s))r.artifacts.length!=0&&(i[r.name]=r);return i}async fetchPullRequests(){const s=(await(await this.kit()).rest.pulls.list({...yl,state:"open"})).data.map(r=>Promise.all([this.fetchArtifacts(r.head.ref),this.fetchVersion({owner:r.head.repo.owner.login,repo:r.head.repo.name},r.head.ref)]).then(([o,a])=>({name:r.head.label,commit:r.head.sha,version:a,artifacts:o}))),i={};for(const r of await Promise.all(s))r.artifacts.length!=0&&(i[r.name]=r);return i}findNewVersion(e,n){for(const s of e)if(zs.gt(s,n))return s;return null}async checkForUpdate(e){const i=(await(await this.kit()).rest.repos.listReleases(lMe)).data.filter(a=>a.assets.length>0&&zs.valid(a.tag_name)),r=i.map(a=>a.tag_name),o=this.findNewVersion(r,e);return o?i.find(a=>a.tag_name==o):null}fetchAsset(e){const n=`${cMe}${e.browser_download_url}`;return fetch(n,{headers:uMe})}async fetchArtifact(e){const s=await(await this.kit()).rest.actions.downloadArtifact({...yl,artifact_id:e.id,archive_format:"zip"}),i=new Q3e(new P3e(new Uint8Array(s.data))),r=(await i.getEntries()).shift();if(!r)return;const o=await r.getData(new C3e);return await i.close(),o}}const oo=new fMe,dR="https://raw.githubusercontent.com/BossHobby/Targets/targets/",pMe=ys("flash",{state:()=>({releases:{},branches:{},pullRequests:{},targets:[],manufacturers:{}}),actions:{fetchTargets(){return fetch(dR+"_index.json").then(t=>t.json()).then(t=>{this.targets=t.targets,this.manufacturers=t.manufacturers})},fetchReleases(){return oo.fetchReleases().then(t=>this.releases=t)},fetchBranches(){return oo.fetchBranches().then(t=>this.branches=t)},fetchPullRequests(){return oo.fetchPullRequests().then(t=>this.pullRequests=t)},async fetch(t){switch(this.targets.length==0&&await this.fetchTargets(),t){case"release":return this.fetchReleases();case"branch":return this.fetchBranches();case"pull_request":return this.fetchPullRequests()}},fetchRuntimeConfig(t){return fetch(dR+t+".yaml").then(e=>e.ok?e.text():Promise.reject(e)).then(e=>Ao.parse(e)).then(e=>qm.encode(e))}}});function ko(t){return Array.isArray?Array.isArray(t):CI(t)==="[object Array]"}const mMe=1/0;function gMe(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-mMe?"-0":e}function _Me(t){return t==null?"":gMe(t)}function Sr(t){return typeof t=="string"}function RI(t){return typeof t=="number"}function vMe(t){return t===!0||t===!1||yMe(t)&&CI(t)=="[object Boolean]"}function kI(t){return typeof t=="object"}function yMe(t){return kI(t)&&t!==null}function ii(t){return t!=null}function Hv(t){return!t.trim().length}function CI(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const bMe="Incorrect 'index' type",wMe=t=>`Invalid value for key ${t}`,xMe=t=>`Pattern length exceeds max of ${t}.`,SMe=t=>`Missing ${t} property in key`,EMe=t=>`Property 'weight' in key '${t}' must be a positive integer`,hR=Object.prototype.hasOwnProperty;class TMe{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(s=>{let i=PI(s);this._keys.push(i),this._keyMap[i.id]=i,n+=i.weight}),this._keys.forEach(s=>{s.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function PI(t){let e=null,n=null,s=null,i=1,r=null;if(Sr(t)||ko(t))s=t,e=fR(t),n=_b(t);else{if(!hR.call(t,"name"))throw new Error(SMe("name"));const o=t.name;if(s=o,hR.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(EMe(o));e=fR(o),n=_b(o),r=t.getFn}return{path:e,id:n,weight:i,src:s,getFn:r}}function fR(t){return ko(t)?t:t.split(".")}function _b(t){return ko(t)?t.join("."):t}function AMe(t,e){let n=[],s=!1;const i=(r,o,a)=>{if(ii(r))if(!o[a])n.push(r);else{let l=o[a];const c=r[l];if(!ii(c))return;if(a===o.length-1&&(Sr(c)||RI(c)||vMe(c)))n.push(_Me(c));else if(ko(c)){s=!0;for(let u=0,d=c.length;ut.score===e.score?t.idx{this._keysMap[n.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Sr(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();Sr(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,s=this.size();n{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(ii(o)){if(ko(o)){let a=[];const l=[{nestedArrIndex:-1,value:o}];for(;l.length;){const{nestedArrIndex:c,value:u}=l.pop();if(ii(u))if(Sr(u)&&!Hv(u)){let d={v:u,i:c,n:this.norm.get(u)};a.push(d)}else ko(u)&&u.forEach((d,h)=>{l.push({nestedArrIndex:h,value:d})})}s.$[r]=a}else if(Sr(o)&&!Hv(o)){let a={v:o,n:this.norm.get(o)};s.$[r]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function OI(t,e,{getFn:n=ut.getFn,fieldNormWeight:s=ut.fieldNormWeight}={}){const i=new t2({getFn:n,fieldNormWeight:s});return i.setKeys(t.map(PI)),i.setSources(e),i.create(),i}function IMe(t,{getFn:e=ut.getFn,fieldNormWeight:n=ut.fieldNormWeight}={}){const{keys:s,records:i}=t,r=new t2({getFn:e,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(i),r}function Rm(t,{errors:e=0,currentLocation:n=0,expectedLocation:s=0,distance:i=ut.distance,ignoreLocation:r=ut.ignoreLocation}={}){const o=e/t.length;if(r)return o;const a=Math.abs(s-n);return i?o+a/i:a?1:o}function LMe(t=[],e=ut.minMatchCharLength){let n=[],s=-1,i=-1,r=0;for(let o=t.length;r=e&&n.push([s,i]),s=-1)}return t[r-1]&&r-s>=e&&n.push([s,r-1]),n}const Ol=32;function DMe(t,e,n,{location:s=ut.location,distance:i=ut.distance,threshold:r=ut.threshold,findAllMatches:o=ut.findAllMatches,minMatchCharLength:a=ut.minMatchCharLength,includeMatches:l=ut.includeMatches,ignoreLocation:c=ut.ignoreLocation}={}){if(e.length>Ol)throw new Error(xMe(Ol));const u=e.length,d=t.length,h=Math.max(0,Math.min(s,d));let f=r,v=h;const _=a>1||l,m=_?Array(d):[];let g;for(;(g=t.indexOf(e,v))>-1;){let A=Rm(e,{currentLocation:g,expectedLocation:h,distance:i,ignoreLocation:c});if(f=Math.min(A,f),v=g+u,_){let M=0;for(;M=S;U-=1){let z=U-1,G=n[t.charAt(z)];if(_&&(m[z]=+!!G),D[U]=(D[U+1]<<1|1)&G,A&&(D[U]|=(y[U+1]|y[U])<<1|1|y[U+1]),D[U]&T&&(b=Rm(e,{errors:A,currentLocation:z,expectedLocation:h,distance:i,ignoreLocation:c}),b<=f)){if(f=b,v=z,v<=h)break;S=Math.max(1,2*h-v)}}if(Rm(e,{errors:A+1,currentLocation:h,expectedLocation:h,distance:i,ignoreLocation:c})>f)break;y=D}const x={isMatch:v>=0,score:Math.max(.001,b)};if(_){const A=LMe(m,a);A.length?l&&(x.indices=A):x.isMatch=!1}return x}function NMe(t){let e={};for(let n=0,s=t.length;n{this.chunks.push({pattern:h,alphabet:NMe(h),startIndex:f})},d=this.pattern.length;if(d>Ol){let h=0;const f=d%Ol,v=d-f;for(;h{const{isMatch:g,score:y,indices:b}=DMe(e,v,_,{location:i+m,distance:r,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:s,ignoreLocation:c});g&&(h=!0),d+=y,g&&b&&(u=[...u,...b])});let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&s&&(f.indices=u),f}}class el{constructor(e){this.pattern=e}static isMultiMatch(e){return pR(e,this.multiRegex)}static isSingleMatch(e){return pR(e,this.singleRegex)}search(){}}function pR(t,e){const n=t.match(e);return n?n[1]:null}class FMe extends el{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class UMe extends el{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const s=e.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class $Me extends el{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class BMe extends el{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class HMe extends el{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class GMe extends el{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class LI extends el{constructor(e,{location:n=ut.location,threshold:s=ut.threshold,distance:i=ut.distance,includeMatches:r=ut.includeMatches,findAllMatches:o=ut.findAllMatches,minMatchCharLength:a=ut.minMatchCharLength,isCaseSensitive:l=ut.isCaseSensitive,ignoreLocation:c=ut.ignoreLocation}={}){super(e),this._bitapSearch=new II(e,{location:n,threshold:s,distance:i,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class DI extends el{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,s;const i=[],r=this.pattern.length;for(;(s=e.indexOf(this.pattern,n))>-1;)n=s+r,i.push([s,n-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const vb=[FMe,DI,$Me,BMe,GMe,HMe,UMe,LI],mR=vb.length,zMe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,VMe="|";function WMe(t,e={}){return t.split(VMe).map(n=>{let s=n.trim().split(zMe).filter(r=>r&&!!r.trim()),i=[];for(let r=0,o=s.length;r!!(t[d_.AND]||t[d_.OR]),XMe=t=>!!t[wb.PATH],KMe=t=>!ko(t)&&kI(t)&&!xb(t),gR=t=>({[d_.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function NI(t,e,{auto:n=!0}={}){const s=i=>{let r=Object.keys(i);const o=XMe(i);if(!o&&r.length>1&&!xb(i))return s(gR(i));if(KMe(i)){const l=o?i[wb.PATH]:r[0],c=o?i[wb.PATTERN]:i[l];if(!Sr(c))throw new Error(wMe(l));const u={keyId:_b(l),pattern:c};return n&&(u.searcher=bb(c,e)),u}let a={children:[],operator:r[0]};return r.forEach(l=>{const c=i[l];ko(c)&&c.forEach(u=>{a.children.push(s(u))})}),a};return xb(t)||(t=gR(t)),s(t)}function ZMe(t,{ignoreFieldNorm:e=ut.ignoreFieldNorm}){t.forEach(n=>{let s=1;n.matches.forEach(({key:i,norm:r,score:o})=>{const a=i?i.weight:null;s*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),n.score=s})}function JMe(t,e){const n=t.matches;e.matches=[],ii(n)&&n.forEach(s=>{if(!ii(s.indices)||!s.indices.length)return;const{indices:i,value:r}=s;let o={indices:i,value:r};s.key&&(o.key=s.key.src),s.idx>-1&&(o.refIndex=s.idx),e.matches.push(o)})}function QMe(t,e){e.score=t.score}function eRe(t,e,{includeMatches:n=ut.includeMatches,includeScore:s=ut.includeScore}={}){const i=[];return n&&i.push(JMe),s&&i.push(QMe),t.map(r=>{const{idx:o}=r,a={item:e[o],refIndex:o};return i.length&&i.forEach(l=>{l(r,a)}),a})}class Dd{constructor(e,n={},s){this.options={...ut,...n},this.options.useExtendedSearch,this._keyStore=new TMe(this.options.keys),this.setCollection(e,s)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof t2))throw new Error(bMe);this._myIndex=n||OI(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){ii(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let s=0,i=this._docs.length;s-1&&(l=l.slice(0,n)),eRe(l,this._docs,{includeMatches:s,includeScore:i})}_searchStringList(e){const n=bb(e,this.options),{records:s}=this._myIndex,i=[];return s.forEach(({v:r,i:o,n:a})=>{if(!ii(r))return;const{isMatch:l,score:c,indices:u}=n.searchIn(r);l&&i.push({item:r,idx:o,matches:[{score:c,value:r,norm:a,indices:u}]})}),i}_searchLogical(e){const n=NI(e,this.options),s=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:h}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:h});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const u=[];for(let d=0,h=a.children.length;d{if(ii(a)){let c=s(n,a,l);c.length&&(r[l]||(r[l]={idx:l,item:a,matches:[]},o.push(r[l])),c.forEach(({matches:u})=>{r[l].matches.push(...u)}))}}),o}_searchObjectList(e){const n=bb(e,this.options),{keys:s,records:i}=this._myIndex,r=[];return i.forEach(({$:o,i:a})=>{if(!ii(o))return;let l=[];s.forEach((c,u)=>{l.push(...this._findMatches({key:c,value:o[u],searcher:n}))}),l.length&&r.push({idx:a,item:o,matches:l})}),r}_findMatches({key:e,value:n,searcher:s}){if(!ii(n))return[];let i=[];if(ko(n))n.forEach(({v:r,i:o,n:a})=>{if(!ii(r))return;const{isMatch:l,score:c,indices:u}=s.searchIn(r);l&&i.push({score:c,key:e,value:r,idx:o,norm:a,indices:u})});else{const{v:r,n:o}=n,{isMatch:a,score:l,indices:c}=s.searchIn(r);a&&i.push({score:l,key:e,value:r,norm:o,indices:c})}return i}}Dd.version="7.0.0";Dd.createIndex=OI;Dd.parseIndex=IMe;Dd.config=ut;Dd.parseQuery=NI;YMe(qMe);const tRe=it({name:"Flash",setup(){return{root:vn(),flash:pMe(),serial:Nd()}},data(){return{loading:!0,dropdownHover:!1,dropdownActive:!1,sourceOptions:[{value:"release",text:"Release"},{value:"branch",text:"Development Branch"},{value:"pull_request",text:"Pull Request"},{value:"local",text:"Local"}],progress:[],source:"",release:void 0,branch:void 0,pullRequest:void 0,targetSearch:"",currentTarget:void 0,target:void 0,file:void 0}},watch:{async source(){this.loading=!0,await this.flash.fetch(this.source),this.loading=!1,this.release=this.pickRelease(),this.branch=this.branchOptions[0],this.pullRequest=this.pullRequestOptions[0],this.targetSearch="",this.target=void 0,this.file=void 0},release(){this.targetSearch="",this.target=void 0,this.file=void 0},branch(){this.targetSearch="",this.target=void 0,this.file=void 0},pullRequest(){this.targetSearch="",this.target=void 0,this.file=void 0}},computed:{branchOptions(){return Object.keys(this.flash.branches)},pullRequestOptions(){return Object.keys(this.flash.pullRequests)},releaseOptions(){return Object.keys(this.flash.releases)},commitHash(){const t=this.source=="branch"?this.flash.branches[this.branch||""]:this.flash.pullRequests[this.pullRequest||""];return t?t.commit.slice(0,8):""},isRuntimeTarget(){if(this.source=="release"&&this.release)return jm.satisfies(this.release,">=0.10.0-dev",{includePrerelease:!0});if(this.source=="branch"&&this.branch){const t=this.flash.branches[this.branch];return jm.satisfies(t.version,">=0.10.0-dev",{includePrerelease:!0})}if(this.source=="pull_request"&&this.pullRequest){const t=this.flash.pullRequests[this.pullRequest];return jm.satisfies(t.version,">=0.10.0-dev",{includePrerelease:!0})}return!1},targetOptions(){let t=[];if(this.isRuntimeTarget)t=this.flash.targets.map(n=>{const s=this.flash.manufacturers[n.manufacturer||"CUST"];return{value:n,text:`${s.name} / ${n.name}`}});else{let n=[];this.source=="release"&&this.release?n=this.flash.releases[this.release]||[]:this.source=="branch"&&this.branch?n=this.flash.branches[this.branch].artifacts||[]:this.source=="pull_request"&&this.pullRequest&&(n=this.flash.pullRequests[this.pullRequest].artifacts||[]),t=n.map(s=>({value:s,text:s.name.replace("quicksilver.","")}))}return this.targetSearch.length==0?t:new Dd(t,{includeScore:!1,keys:["text"]}).search(this.targetSearch).map(n=>n.item)},canFlash(){return this.loading?!1:this.source=="local"?!!this.file:!!this.target}},methods:{async resetToBootloader(){this.currentTarget=await this.serial.hard_reboot()},pickRelease(){return this.releaseOptions.find(t=>!t.endsWith("-dev")&&!t.includes("-rc"))},selectTarget(t){this.target=t.value,this.targetSearch=t.text,this.dropdownHover=!1,this.dropdownActive=!1},updateFile(){const t=this.$refs.file;t.files&&t.files.length?this.file=t.files[0]:this.file=void 0},fetchFirmware(){switch(this.source){case"local":return new Promise((t,e)=>{if(!this.file)return e();const n=new FileReader;n.addEventListener("load",s=>{var i;(i=s==null?void 0:s.target)!=null&&i.result?t(s.target.result):e()}),n.readAsText(this.file)});case"release":if(this.isRuntimeTarget&&this.release){const e=this.flash.releases[this.release].sort((n,s)=>n.name.length-s.name.length).find(n=>{var s;return n.name.includes((s=this.target)==null?void 0:s.mcu)});return oo.fetchAsset(e).then(n=>n.text())}return oo.fetchAsset(this.target).then(t=>t.text());case"branch":if(this.isRuntimeTarget&&this.branch){const e=this.flash.branches[this.branch].artifacts.sort((n,s)=>n.name.length-s.name.length).find(n=>{var s;return n.name.includes((s=this.target)==null?void 0:s.mcu)});return oo.fetchArtifact(e)}return oo.fetchArtifact(this.target);case"pull_request":if(this.isRuntimeTarget&&this.pullRequest){const e=this.flash.pullRequests[this.pullRequest].artifacts.sort((n,s)=>n.name.length-s.name.length).find(n=>{var s;return n.name.includes((s=this.target)==null?void 0:s.mcu)});return oo.fetchArtifact(e)}return oo.fetchArtifact(this.target);default:return Promise.resolve(void 0)}},updateProgress(t){const e={...this.progress};e[t.task]=t,this.progress=e},onSubmit(t){t.preventDefault(),this.loading=!0;const e=new Cxe;return e.onProgress(n=>this.updateProgress(n)),e.connect().then(()=>(this.updateProgress({task:"download",current:10,total:100}),this.fetchFirmware())).then(async n=>{if(!n)throw new Error("firmware not found");this.updateProgress({task:"download",current:90,total:100});const s=s_.parse(n);if(this.isRuntimeTarget){const i=await this.flash.fetchRuntimeConfig(this.target.target);ct.info("Flash","injecting target ",this.target.target),s.patch(Rxe[this.target.mcu],i)}return this.updateProgress({task:"download",current:100,total:100}),e.flash(s)}).then(()=>this.root.append_alert({type:"success",msg:"Firmware flashed!"})).catch(n=>{ct.error("Flash",n),this.root.append_alert({type:"danger",msg:"Flash failed!"})}).finally(()=>{this.progress=[],this.loading=!1})}},async created(){this.source="release"}}),nRe={class:"columns"},sRe={class:"card"},iRe={class:"card-header"},rRe={class:"card-header-title"},oRe={class:"card-content field-is-3"},aRe={key:0,class:"field is-horizontal"},lRe=p("div",{class:"field-label is-normal"},[p("label",{class:"label"}," Current Target ")],-1),cRe={class:"field-body"},uRe={class:"field"},dRe={class:"control is-expanded"},hRe=["value"],fRe={class:"field is-horizontal"},pRe={class:"field-label is-normal"},mRe={class:"label"},gRe={class:"field-body"},_Re={class:"field is-narrow"},vRe={class:"control"},yRe={class:"select is-fullwidth"},bRe={key:1,class:"field is-horizontal"},wRe={class:"field-label is-medium"},xRe={class:"label"},SRe={class:"field-body"},ERe={class:"field"},TRe={class:"file-label"},ARe=["disabled"],MRe={class:"file-cta"},RRe={class:"file-icon"},kRe=p("span",{class:"file-label"}," Choose a file… ",-1),CRe={key:0,class:"file-name"},PRe={key:2,class:"field is-horizontal"},ORe={class:"field-label is-normal"},IRe={class:"label"},LRe={class:"field-body"},DRe={class:"field is-narrow"},NRe={class:"control"},FRe={class:"select is-fullwidth"},URe={key:3,class:"field is-horizontal"},$Re={class:"field-label is-normal"},BRe={class:"label"},HRe={class:"field-body"},GRe={class:"field is-narrow"},zRe={class:"control"},VRe={class:"select is-fullwidth"},WRe={key:4,class:"field is-horizontal"},jRe={class:"field-label is-normal"},qRe={class:"label"},YRe={class:"field-body"},XRe={class:"field is-narrow"},KRe={class:"control"},ZRe=["value"],JRe={key:5,class:"field is-horizontal"},QRe={class:"field-label is-normal"},e4e={class:"label"},t4e={class:"field-body"},n4e={class:"field is-narrow"},s4e={class:"control"},i4e={class:"select is-fullwidth"},r4e={key:6,class:"field is-horizontal"},o4e={class:"field-label is-normal"},a4e={class:"label"},l4e={class:"field-body"},c4e={class:"field is-narrow"},u4e={class:"control"},d4e={class:"select is-fullwidth"},h4e={class:"dropdown-trigger"},f4e={class:"field"},p4e={class:"control is-expanded has-icons-right"},m4e=["disabled"],g4e={class:"dropdown-content"},_4e=["value","onClick"],v4e={class:"column is-2"},y4e={class:"column is-10"},b4e=["value","max"],w4e={class:"card-footer"};function x4e(t,e,n,s,i,r){const o=Oe("tooltip"),a=Oe("spinner-btn"),l=Oe("input-select"),c=Oe("font-awesome-icon");return Z(),ie("div",nRe,[p("form",{class:"column is-12",onSubmit:e[11]||(e[11]=(...u)=>t.onSubmit&&t.onSubmit(...u))},[p("div",sRe,[p("div",iRe,[p("p",rRe,[me(" Flash "),Y(o,{entry:"flash.reset"})]),Y(a,{class:"card-header-button is-info",type:"button",onClick:e[0]||(e[0]=u=>t.resetToBootloader())},{default:nt(()=>[me(" Reset to Bootloader ")]),_:1})]),p("div",oRe,[t.currentTarget?(Z(),ie("div",aRe,[lRe,p("div",cRe,[p("div",uRe,[p("div",dRe,[p("input",{class:"input is-static",value:t.currentTarget,readonly:""},null,8,hRe)])])])])):ze("",!0),p("div",fRe,[p("div",pRe,[p("label",mRe,[me(" Source "),Y(o,{entry:"flash.source"})])]),p("div",gRe,[p("div",_Re,[p("div",vRe,[p("div",yRe,[Y(l,{modelValue:t.source,"onUpdate:modelValue":e[1]||(e[1]=u=>t.source=u),options:t.sourceOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])]),t.source=="local"?(Z(),ie("div",bRe,[p("div",wRe,[p("label",xRe,[me(" File "),Y(o,{entry:"flash.file-local"})])]),p("div",SRe,[p("div",ERe,[p("div",{class:ms(["file is-boxed is-medium",{"has-name":t.file}])},[p("label",TRe,[p("input",{class:"file-input",type:"file",onChange:e[2]||(e[2]=u=>t.updateFile()),ref:"file",accept:".hex",disabled:t.loading},null,40,ARe),p("span",MRe,[p("span",RRe,[Y(c,{icon:"fa-solid fa-upload"})]),kRe]),t.file?(Z(),ie("span",CRe,Be(t.file.name),1)):ze("",!0)])],2)])])])):ze("",!0),t.source=="branch"?(Z(),ie("div",PRe,[p("div",ORe,[p("label",IRe,[me(" Branch "),Y(o,{entry:"flash.file-branch"})])]),p("div",LRe,[p("div",DRe,[p("div",NRe,[p("div",FRe,[Y(l,{modelValue:t.branch,"onUpdate:modelValue":e[3]||(e[3]=u=>t.branch=u),options:t.branchOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])])):ze("",!0),t.source=="pull_request"?(Z(),ie("div",URe,[p("div",$Re,[p("label",BRe,[me(" Pull Request "),Y(o,{entry:"flash.file-pull-request"})])]),p("div",HRe,[p("div",GRe,[p("div",zRe,[p("div",VRe,[Y(l,{modelValue:t.pullRequest,"onUpdate:modelValue":e[4]||(e[4]=u=>t.pullRequest=u),options:t.pullRequestOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])])):ze("",!0),t.source=="branch"||t.source=="pull_request"?(Z(),ie("div",WRe,[p("div",jRe,[p("label",qRe,[me(" Commit "),Y(o,{entry:"flash.file-commit"})])]),p("div",YRe,[p("div",XRe,[p("div",KRe,[p("input",{class:"input is-fullwidth is-static",type:"text",value:t.commitHash},null,8,ZRe)])])])])):ze("",!0),t.source=="release"?(Z(),ie("div",JRe,[p("div",QRe,[p("label",e4e,[me(" Release "),Y(o,{entry:"flash.file-release"})])]),p("div",t4e,[p("div",n4e,[p("div",s4e,[p("div",i4e,[Y(l,{modelValue:t.release,"onUpdate:modelValue":e[5]||(e[5]=u=>t.release=u),options:t.releaseOptions,disabled:t.loading},null,8,["modelValue","options","disabled"])])])])])])):ze("",!0),t.source!="local"?(Z(),ie("div",r4e,[p("div",o4e,[p("label",a4e,[me(" Target "),Y(o,{entry:"flash.file-remote"})])]),p("div",l4e,[p("div",c4e,[p("div",u4e,[p("div",d4e,[p("div",{class:ms(["dropdown",{"is-active":t.dropdownActive||t.dropdownHover}])},[p("div",h4e,[p("div",f4e,[p("p",p4e,[Ye(p("input",{class:"input is-fullwidth",type:"search",placeholder:"Search...","onUpdate:modelValue":e[6]||(e[6]=u=>t.targetSearch=u),onFocus:e[7]||(e[7]=u=>t.dropdownActive=!0),onBlur:e[8]||(e[8]=u=>t.dropdownActive=!1),disabled:t.loading},null,40,m4e),[[st,t.targetSearch]])])])]),p("div",{class:"dropdown-menu",style:{"overflow-y":"auto","max-height":"50vh"},role:"menu",onMouseover:e[9]||(e[9]=u=>t.dropdownHover=!0),onMouseleave:e[10]||(e[10]=u=>t.dropdownHover=!1)},[p("div",g4e,[(Z(!0),ie(ot,null,qt(t.targetOptions,u=>(Z(),ie("a",{key:u.value,value:u.value,class:ms(["dropdown-item",{"is-active":t.target==u}]),onClick:jD(d=>t.selectTarget(u),["prevent"])},Be(u.text),11,_4e))),128))])],32)],2)])])])])])):ze("",!0),(Z(!0),ie(ot,null,qt(t.progress,(u,d)=>(Z(),ie("div",{key:d,class:"columns my-2 mx-2"},[p("div",v4e,Be(d),1),p("div",y4e,[p("progress",{class:"progress is-primary",height:"20px",value:u.current,max:u.total},null,8,b4e)])]))),128))]),p("footer",w4e,[Y(a,{class:ms(["card-footer-item",{"is-loading":t.loading}]),disabled:!t.canFlash,type:"submit"},{default:nt(()=>[me(" Flash ")]),_:1},8,["class","disabled"])])])],32)])}const S4e=lt(tRe,[["render",x4e]]),E4e=it({name:"Home",components:{Info:xP},methods:{}});function T4e(t,e,n,s,i,r){const o=Oe("Info");return Z(),en(o)}const A4e=lt(E4e,[["render",T4e]]),FI="https://raw.githubusercontent.com/BossHobby/Templates/develop-deploy/";function Sb(t){return FI+t}const M4e=ys("templates",{state:()=>({index:[]}),actions:{fetch_templates(){return fetch(FI+"index.json").then(e=>e.json()).then(e=>{this.index=e.map(n=>(n.image&&(n.image=Sb(n.image)),n.profile=Sb(n.profile),n))})}}}),R4e=it({name:"TemplateModal",props:["template"],setup(){return{info:An(),profile:Jt()}},data(){return{selected:{},tmpl:void 0}},watch:{template(t){this.updateTemplate(t)}},computed:{formValid(){var t;for(const e of((t=this.tmpl)==null?void 0:t.options)||[])if(!this.selected[e.name])return!1;return!0},selectedValues(){var e,n;const t={};for(const s of Object.keys(this.selected)){const i=(n=(e=this.tmpl)==null?void 0:e.options)==null?void 0:n.find(r=>r.name==s);i&&(t[s]=i.entries.find(r=>r.name==this.selected[s]))}return t}},methods:{updateTemplate(t){if(!t){this.tmpl=void 0;return}const e=JSON.parse(JSON.stringify(t)),n={};for(const s of e.options||[]){for(const i of s.entries)for(const r of Object.keys(i.selector||{}))if(i.selector[r].includes(this.info[r])){i.title+=" (auto-selected)",n[s.name]=i.name;break}if(!n[s.name]){const i=s.entries.find(r=>r.name==s.default);i&&(n[s.name]=s.default,i.title+=" (auto-selected)")}}this.tmpl=e,this.selected=n},async applyTemplate(){var e,n;if(!this.tmpl)return;const t=await fetch((e=this.tmpl)==null?void 0:e.profile).then(s=>s.text()).then(s=>Ao.parse(s));for(const s of this.tmpl.options||[]){const i=s.entries.find(o=>o.name==this.selected[s.name]);if(!i)continue;const r=await fetch(Sb(i.file)).then(o=>o.text()).then(o=>Ao.parse(o));ct.info("template","applying option",i.name),Ug(t,r.profile)}if((n=this.tmpl)!=null&&n.mutations)for(const s of this.tmpl.mutations){const i=s.options.find(r=>Object.entries(r.selector).every(([o,a])=>a.includes(this.selected[o])));i&&(ct.info("template","applying mutation",i.name),Ug(t,i.profile))}return this.profile.merge_profile(t)}},created(){this.updateTemplate(this.template)}}),k4e={key:0,class:"card my-5"},C4e={class:"card-content"},P4e={class:"title"},O4e={class:"is-3"},I4e={class:"is-size-5 has-text-weight-normal has-text-grey-lighter is-pulled-right"},L4e={class:"media"},D4e={class:"media-left"},N4e={class:"image",style:{width:"300px"}},F4e=["src"],U4e={class:"media-content"},$4e={class:"m-2"},B4e=p("hr",null,null,-1),H4e={class:"field is-horizontal"},G4e={class:"field-label is-medium is-align-self-flex-start"},z4e={class:"label"},V4e={class:"is-size-5"},W4e={class:"field-body is-flex-grow-2"},j4e={class:"field"},q4e={class:"control mb-2"},Y4e={class:"select is-fullwidth"},X4e=["onUpdate:modelValue"],K4e=["value"],Z4e={key:0,class:"help is-danger"},J4e={key:1,class:"help has-text-grey-light"},Q4e={class:"card-footer"},eke=p("span",{class:"card-footer-item"},null,-1),tke=p("span",{class:"card-footer-item"},null,-1),nke=p("span",{class:"card-footer-item"},null,-1);function ske(t,e,n,s,i,r){const o=Oe("font-awesome-icon"),a=Oe("tooltip"),l=Oe("spinner-btn");return t.tmpl?(Z(),ie("div",k4e,[p("div",C4e,[p("p",P4e,[p("span",O4e,Be(t.tmpl.name),1),p("span",I4e,[Y(o,{icon:"fa-regular fa-pen-to-square","fixed-width":""}),me(" by "+Be(t.tmpl.author),1)])]),p("article",L4e,[p("figure",D4e,[p("p",N4e,[p("img",{src:t.tmpl.image},null,8,F4e)])]),p("div",U4e,[p("p",$4e,Be(t.tmpl.desc),1),B4e,(Z(!0),ie(ot,null,qt(t.tmpl.options,c=>{var u,d;return Z(),ie("div",H4e,[p("div",G4e,[p("label",z4e,[p("span",V4e,Be(c.title),1),Y(a,{text:c.desc},null,8,["text"])])]),p("div",W4e,[p("div",j4e,[p("div",q4e,[p("div",Y4e,[Ye(p("select",{"onUpdate:modelValue":h=>t.selected[c.name]=h},[(Z(!0),ie(ot,null,qt(c.entries,h=>(Z(),ie("option",{value:h.name},Be(h.title),9,K4e))),256))],8,X4e),[[L_,t.selected[c.name]]])])]),t.selected[c.name]?ze("",!0):(Z(),ie("p",Z4e," Please select an option! ")),(u=t.selectedValues[c.name])!=null&&u.desc?(Z(),ie("p",J4e,Be((d=t.selectedValues[c.name])==null?void 0:d.desc),1)):ze("",!0)])])])}),256))])])]),p("footer",Q4e,[eke,tke,nke,Y(l,{class:"card-footer-item is-primary",onClick:e[0]||(e[0]=c=>t.applyTemplate()),disabled:!t.formValid},{default:nt(()=>[me(" Apply ")]),_:1},8,["disabled"])])])):ze("",!0)}const ike=lt(R4e,[["render",ske]]),rke=it({name:"Templates",components:{TemplateCard:ike},setup(){return{templates:M4e(),profile:Jt()}},created(){this.templates.fetch_templates()}}),oke=t=>(dd("data-v-c380dbc8"),t=t(),hd(),t),ake=oke(()=>p("section",{class:"hero is-primary"},[p("div",{class:"hero-body"},[p("h5",{class:"title is-5"}," Templates provide a way to apply configurations supplied by the community. ")])],-1));function lke(t,e,n,s,i,r){const o=Oe("TemplateCard");return Z(),ie(ot,null,[ake,(Z(!0),ie(ot,null,qt(t.templates.index,a=>(Z(),en(o,{key:a.name,template:a},null,8,["template"]))),128))],64)}const cke=lt(rke,[["render",lke],["__scopeId","data-v-c380dbc8"]]),so=s7({history:LN("/"),routes:[{path:"/",redirect:()=>Nd().is_connected?"/profile":"/home"},{path:"/home",name:"home",component:A4e},{path:"/templates",name:"templates",component:cke},{path:"/flash",name:"flash",component:S4e},{path:"/profile",name:"profile",component:Txe},{path:"/setup",name:"setup",component:xse},{path:"/rates",name:"rates",component:Sfe},{path:"/receiver",name:"receiver",component:P_e},{path:"/osd",name:"osd",component:nve},{path:"/motor",name:"motor",component:mye},{path:"/blackbox",name:"blackbox",component:rbe},{path:"/state",name:"state",component:hbe},{path:"/perf",name:"perf",component:gbe}]});so.beforeEach((t,e,n)=>{Nd().is_connected?t.name==="home"?n({name:"profile"}):n():t.name!=="home"&&t.name!=="flash"&&t.name!=="log"?n({name:"home"}):n()});let Eb=null,Tb=0;function UI(){clearInterval(Eb),Eb=null,Tb=0}function uke(t){UI(),Eb=setInterval(async()=>{await t(Tb),Tb++},fy.serial.updateInterval)}const Nd=ys("serial",{state:()=>({is_connected:!1,is_connecting:!1}),actions:{async poll_serial(t){if(!this.is_connected)return;const e=rx(),n=IC(),s=js(),i=Ry();await s.fetch_state(),t%4&&(so.currentRoute.value.fullPath=="/receiver"&&await e.fetch_bind_info(),so.currentRoute.value.fullPath=="/perf"&&await n.fetch_perf_counters(),so.currentRoute.value.fullPath=="/setup"&&await i.update_vtx_settings())},async soft_reboot(){await this.disconnect(),this.is_connecting=!0,await Et.softReboot();for(let t=0;t<10&&(await gu.getPorts()).length;t++)await fa(100);for(let t=0;t<10&&!(await gu.getPorts()).length;t++)await fa(100);await this.connect(Et.connectFirstPort(t=>(ct.error("serial",t),this.disconnect(),Et.close())))},serial_passthrough({port:t,baudrate:e,half_duplex:n,stop_bits:s}){const i=vn();return Et.command(Jn.Serial,0,t,e,n?1:0,s).then(()=>Et.close()).then(()=>this.toggle_connection()).then(()=>{i.append_alert({type:"success",msg:"Serial passthrough successful!"})}).catch(r=>{ct.error("serial",r),i.append_alert({type:"danger",msg:"Serial passthrough failed"})})},hard_reboot(){const t=vn();return Et.hardReboot().then(e=>(t.append_alert({type:"success",msg:"Reset to bootloader successful!"}),e)).catch(e=>{ct.error("serial",e),t.append_alert({type:"danger",msg:"Reset to bootloader failed"})})},disconnect(){const t=vn();UI(),this.is_connected=!1,this.is_connecting=!1,t.reset_needs_reboot(),so.currentRoute.value.fullPath!="/home"&&so.push("/home")},async connect(t){const e=yP(),n=jf(),s=An(),i=A0(),r=Jt(),o=vn(),a=Td(),l=Ry();try{const c=await t;s.$reset(),i.$reset(),l.$reset(),e.$reset(),n.$reset(),r.$reset(),a.$reset(),this.is_connected=!0,s.set_info(c),s.quicVersionGte("0.2.0")&&a.fetch(),n.fetch_default_profile(),o.fetch_pid_rate_presets(),r.fetch_profile(),l.update_vtx_settings(),uke(u=>this.poll_serial(u)),so.currentRoute.value.fullPath!="/profile"&&so.push("/profile")}catch(c){ct.error("serial",c),this.is_connected=!1,o.reset_needs_reboot(),o.append_alert({type:"danger",msg:"Connection to the board failed"})}finally{this.is_connecting=!1}},async toggle_connection(){return this.is_connected?(this.disconnect(),Et.close()):(this.is_connecting=!0,this.connect(Et.connect(t=>(ct.error("serial",t),this.disconnect(),Et.close()))))}}}),dke={xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",width:"512",height:"82"},hke=p("g",{class:"tagline"},[p("path",{d:"M136.296 482.246c-3.928-4.12-4.077-8.114-.683-18.244 3.19-9.522 8.952-17.058 13.143-17.193 9.668-.311 18.425 10.55 16.774 20.804-.755 4.687-.449 5.607 2.558 7.673 6.313 4.338 3.485 8.076-3.563 4.708-2.557-1.223-4.29-.844-9.544 2.086-8.256 4.604-14.401 4.659-18.685.166m15.716-4.63c1.995-2.313 1.83-2.74-2.447-6.32-6.633-5.55-6.138-8.303 1.381-7.676 3.283.274 5.968-.001 5.968-.61 0-2.224-5.394-12.128-6.604-12.128-1.917 0-7.981 7.296-8.782 10.566-.393 1.603-.523 5.354-.29 8.335.325 4.158 1.041 5.523 3.076 5.861 5.595.93 6.82 1.887 3.98 3.112-1.957.844-2.098 1.17-.538 1.242 1.164.054 3.079-1.018 4.256-2.383m23.435-9.629c-1.804-1.304-4.04-3.338-4.97-4.52-2.498-3.18-8.271-15.06-10.414-21.43-2.197-6.53-1.186-7.814 6.136-7.792 4.606.014 4.676.108 9.11 12.151 4.476 12.157 6.273 15.615 8.117 15.615 1.234 0-1.904-14.511-4.603-21.287-2.441-6.128-2.617-12.966-.356-13.818.912-.343 3.52-.1 5.795.54 4.447 1.25 5.648 4.152 8.488 20.496 1.953 11.242 1.652 13.381-2.546 18.095-4.42 4.963-9.637 5.652-14.757 1.95m27.697-11.888c-2.765-5.371-17.05-35.946-17.05-36.494 0-1.53 4.494-4.892 6.539-4.892 4.898 0 18.661 26.952 18.661 36.545 0 7.683-5.12 10.725-8.15 4.84m13.574-7.875c-7.038-7.382-6.52-34.394.808-42.08 5.32-5.58 17.642-6.01 17.642-.614 0 2.81-6.538 5.432-8.747 3.509-1.442-1.256-2.13-.76-3.318 2.393-2.653 7.04-3.055 21.514-.757 27.282 1.827 4.586 2.623 5.213 6.624 5.213 2.509 0 5.32-.977 6.271-2.179 2.28-2.881 8.656-6.287 9.707-5.185 1.814 1.903.505 3.472-7.333 8.785-9.377 6.357-16.627 7.355-20.897 2.876m32.998-13.046c-4.76-8.202-12.098-29.165-11.33-32.373.852-3.563 7.223-5.934 8.791-3.272.66 1.12 1.658.312 3.015-2.439 3.844-7.796 10.167-12.986 15.824-12.986h5.144l-2.75 4.05c-1.512 2.228-4.19 7.312-5.951 11.3l-3.202 7.25 6.193 5.61c8.412 7.622 14.258 16.055 12.447 17.955-.98 1.027-3.623.131-8.834-2.996l-7.435-4.462.365 6.566c.36 6.46.285 6.595-4.66 8.415-4.969 1.828-5.053 1.8-7.617-2.618m38.038-15.437c1.54-3.388 1.888-6.477 1.24-11.008l-.9-6.297-6.712-.969c-6.928-.999-11.729-4.478-11.729-8.5 0-5.248 8.236-14.996 14.845-17.573 1.235-.481 4.1-.317 6.367.365 3.658 1.1 4.034.952 3.346-1.32-.91-3.01 2.435-7.024 5.855-7.024 4.932 0 18.662 26.966 18.662 36.652 0 5.01-2.77 8.648-5.69 7.473-.959-.386-4.968-7.673-8.91-16.193-4.987-10.784-7.72-15.268-8.991-14.756-1.005.404-2.661.735-3.68.735-2.211 0-7.676 10.642-6.756 13.156.353.966 3.312 2.462 6.575 3.323 6.661 1.76 7.964 3.896 6.82 11.183-1.684 10.715-4.886 15.463-10.429 15.463-1.839 0-1.83-.495.087-4.71m37.76-16.656c-1.415-1.789-6.44-15.67-7.435-20.542-.254-1.244-1.73-5.355-3.282-9.136-2.232-5.442-2.538-7.653-1.467-10.607 1.759-4.85 7.422-5.238 8.806-.602.514 1.722 3.308 8.451 6.209 14.955s5.804 13.275 6.451 15.048c.907 2.486 1.82 3.009 3.993 2.285 2.634-.876 5.065 1 5.119 3.95.028 1.541-10.633 6.471-14.076 6.509-1.552.016-3.495-.82-4.317-1.86m17.868-16.303c-12.8-14.501-15.169-23.045-7.13-25.72 2.349-.783 3.845.105 7.464 4.426l4.527 5.405-.7-6.911c-.874-8.61.149-15.658 2.402-16.565.944-.38 3.377-.225 5.406.344l3.69 1.035.45 22.35c.448 22.286.44 22.352-2.583 23.201-5.22 1.467-5.88 1.098-13.526-7.565m29.36-10.13c-5.437-8.588-12.008-26.864-11.354-31.575.325-2.341 2.951-4.634 9.73-8.497 9.392-5.352 17.088-7.242 14.097-3.462-.815 1.03-3.872 3.002-6.795 4.384-5.834 2.76-6.03 3.408-3.745 12.373l1.568 6.148 6.393-3.621c9.344-5.293 10.982-2.385 2.631 4.67l-6.462 5.46 3.296 5.224c1.813 2.873 3.561 5.223 3.885 5.223s3.76-2.382 7.638-5.294l7.048-5.294-1.866-4.655c-1.026-2.56-2.526-8.844-3.332-13.965-1.272-8.08-1.159-9.987.857-14.443 2.997-6.624 6.157-8.287 14.206-7.476 9.264.933 11.045 3.23 9.377 12.081l-1.33 7.051 5.447 1.52c6.165 1.722 9.868 4.691 11.53 9.249 2.477 6.794-2.384 9.956-6.118 3.979-1.147-1.836-3.966-4.293-6.265-5.46-3.88-1.972-4.448-1.925-7.893.647-3.008 2.247-3.46 3.265-2.386 5.37.729 1.428 1.325 5.155 1.325 8.282 0 4.713-.567 5.957-3.31 7.268-2.671 1.276-3.76 1.157-5.637-.62-2.154-2.037-3.02-1.643-11.611 5.282-12.23 9.856-14.769 9.874-20.925.15m37.97-48.188c-1.053-2.487-2.791 3.916-2.832 10.433-.022 3.624.22 3.35 1.846-2.087 1.03-3.443 1.473-7.199.987-8.346",style:{display:"inline",fill:"#000","fill-opacity":".29819","stroke-width":"1.35834"},transform:"matrix(1.43639 .63307 -.61952 1.40565 104.251 -703.335)"}),p("path",{d:"M137.121 482.059c-2.47-2.18-4.08-4.92-4.08-6.941 0-5.546 6.51-20.81 10.647-24.969 3.663-3.68 4.177-3.807 9.12-2.254 7.956 2.5 12.065 8.494 12.065 17.6 0 6.41.491 7.849 3.543 10.366 4.981 4.11 2.376 6.75-3.512 3.556-3.827-2.075-4.477-2.092-6.5-.171-2.887 2.74-11.256 6.414-14.609 6.414-1.426 0-4.43-1.62-6.674-3.601m14.575-3.403c3.613-2.028 3.228-3.6-2.076-8.485-2.554-2.351-4.643-4.836-4.643-5.522 0-1.744 7.576-1.56 10.824.264 2.425 1.361 2.6 1.19 1.763-1.74-1.603-5.614-5.35-11.569-7.561-12.016-3.63-.733-8.936 8.16-9.198 15.416-.228 6.32 2.002 11.452 4.323 9.947.647-.419 1.882-.304 2.746.256 1.079.7.768 1.347-.995 2.07-2.35.966-2.363 1.062-.156 1.152 1.324.054 3.562-.55 4.973-1.342m22.096-12.384c-5.114-4.709-13.165-21.055-13.401-27.205-.151-3.936.161-4.207 5.297-4.601 5.067-.389 5.512-.134 6.215 3.552 1.374 7.206 10.065 25.643 11.615 24.64 1.711-1.11 1.15-4.135-3.637-19.582-1.923-6.206-3.121-12.31-2.662-13.563.987-2.698 6.145-3.001 9.202-.541 2.203 1.773 5.4 13.165 7.025 25.024.853 6.23.647 6.86-3.755 11.477-5.766 6.047-9.971 6.258-15.9.8m30.6-9.478c-2.671-3.238-16.972-34.543-16.972-37.153 0-1.919 3.8-4.931 6.213-4.925 2.73.007 16.018 25.946 17.173 33.522.743 4.874-1.111 10.99-3.332 10.99-.59 0-1.978-1.095-3.082-2.434m13.153-7.887c-3.39-2.696-4.924-9.601-4.924-22.15 0-11.816 2.253-18.965 7.1-22.525 3.085-2.267 11.094-2.685 14.036-.733 3.16 2.098-.9 6.018-5.502 5.31-2.061-.318-4.364.201-5.116 1.152-1.812 2.29-3.157 19.762-2.014 26.152 1.235 6.901 5.95 10.177 11.303 7.852 2.131-.926 4.906-2.879 6.166-4.339 2.469-2.861 7.731-3.677 6.902-1.07-.277.872-4.314 4.002-8.972 6.956-8.898 5.643-14.822 6.703-18.98 3.395m32.48-12.847c-.709-1.412-3.795-8.925-6.859-16.696-4.437-11.255-5.286-14.686-4.174-16.867 1.793-3.513 6.696-4.955 7.682-2.26.5 1.367 1.899.074 4.403-4.068 4.373-7.231 10.41-12.06 15.077-12.06h3.387l-5.378 10.85-5.377 10.85 9.412 9.873c5.7 5.978 9.413 11.027 9.413 12.798 0 1.61-.24 2.927-.536 2.927-.294 0-4.174-2.158-8.62-4.794-4.448-2.636-8.06-4.358-8.028-3.825.031.532.55 3.641 1.153 6.91 1.233 6.684 1.247 6.663-5.418 7.975-3.942.775-5.09.474-6.137-1.613m37.602-14.74c.573-1.72 1.09-6.572 1.15-10.78l.108-7.651-5.305-1.205c-13.561-3.08-15.987-6.1-11.296-14.06 5.709-9.689 13.438-13.849 20.472-11.018 2.952 1.188 2.618 4.72-.447 4.72-2.914 0-8.066 7.863-8.066 12.31 0 2.08 1.065 3.179 3.647 3.758 9.508 2.133 9.981 2.741 9.342 12.01-.492 7.133-1.174 9.04-4.21 11.779-4.643 4.19-6.76 4.244-5.395.138m24.198-11.824c-2.671-3.238-16.971-34.543-16.971-37.153 0-1.919 3.8-4.931 6.212-4.925 2.73.007 16.018 25.946 17.173 33.522.743 4.874-1.111 10.99-3.331 10.99-.591 0-1.978-1.095-3.083-2.434m14.426-7.038c-2.73-3.164-12.82-33.08-12.825-38.024-.003-3.344 2.048-5.366 5.444-5.366.688 0 3.226 4.539 5.64 10.086 12.351 28.384 11.803 27.38 14.212 26.028 1.545-.867 2.744-.685 3.736.569 1.835 2.32-1.225 5.362-7.68 7.636-5.831 2.054-5.966 2.04-8.527-.93m19.382-13.133c-7.945-8.574-14.818-20.125-13.979-23.493.385-1.542 2.205-3.404 4.044-4.138 2.953-1.177 3.826-.72 7.446 3.897l4.1 5.231.663-11.08c.708-11.832 1.635-13.077 8.395-11.286 2.801.742 2.879 1.352 2.879 22.584 0 20.53-.157 21.885-2.653 22.911-4.443 1.827-5.222 1.496-10.895-4.626m29.094-10.433c-5.288-7.058-7.452-11.757-10.904-23.68-2.427-8.385-2.634-10.488-1.21-12.29 1.815-2.292 18.75-11.676 21.072-11.676 3.34 0 .809 3.028-5.204 6.224l-6.564 3.488 2.058 7.316c1.131 4.024 2.199 7.477 2.371 7.673s3.042-1.165 6.376-3.024c5.518-3.077 7.628-3.309 7.628-.837 0 .495-2.664 2.994-5.92 5.553l-5.92 4.652 2.273 4.06c4.122 7.366 5.033 7.492 12.92 1.794 3.992-2.883 7.258-5.466 7.258-5.74s-.881-2.858-1.958-5.743c-2.83-7.582-4.345-19.877-3.08-24.995 2.219-8.983 10.753-12.342 20.502-8.07 4.546 1.993 4.73 2.334 3.937 7.304-.457 2.868-1.178 6.534-1.601 8.148-.67 2.555-.058 3.054 4.732 3.857 6.469 1.085 11.952 6.2 11.952 11.148 0 5.168-2.678 5.979-5.643 1.71-1.425-2.051-4.399-4.71-6.61-5.91-3.756-2.037-4.245-1.997-7.488.611-1.908 1.535-3.243 3.629-2.967 4.654.277 1.024.8 4.827 1.162 8.45.596 5.961.359 6.709-2.492 7.85-2.43.973-3.802.636-5.993-1.473-1.563-1.504-3.055-2.183-3.316-1.51-.928 2.398-18.816 15.672-21.119 15.672-1.289 0-4.102-2.347-6.252-5.216m36.223-45.126c.53-3.287.335-6.159-.475-7.008-1.366-1.433-2.004 1.03-3.288 12.702-.454 4.122-.302 4.42 1.172 2.306.932-1.337 2.098-4.936 2.591-8",style:{display:"inline",fill:"#000","fill-opacity":".600917","stroke-width":"1.35834"},transform:"matrix(1.43639 .63307 -.61952 1.40565 104.251 -703.335)"}),p("path",{d:"M140.023 484.133c-1.567-.608-3.834-2.682-5.038-4.61-2.039-3.263-2.032-4.007.103-10.855 2.897-9.297 4.858-13.333 8.805-18.126 2.741-3.327 3.67-3.659 7.235-2.587 10.133 3.048 14.54 9.177 13.341 18.552-.602 4.708-.183 5.912 3.133 9.011 4.874 4.555 3.785 6.536-2.16 3.93-4.225-1.85-4.967-1.782-9.237.86-5.932 3.672-12.548 5.235-16.182 3.825m12.165-5.608 3.59-2.961-4.737-4.096c-5.847-5.054-6.376-8.76-1.09-7.641 2.006.424 4.692 1.195 5.969 1.713 4.62 1.875 1.553-8.396-4.113-13.775-2.68-2.544-2.794-2.51-6.724 2.002-7.053 8.1-6.926 23.397.198 23.656 1.657.06 2.263.427 1.346.815-1.712.724-1.01 3.249.903 3.249.588 0 2.684-1.333 4.658-2.962m19.956-14.358c-3.78-4.204-12.577-23.114-12.577-27.036 0-1.85 9.176-3.665 10.48-2.073.547.67 1.751 3.749 2.675 6.843 2.603 8.723 8.528 20.63 10.59 21.284 2.463.782 1.412-6.071-3.322-21.664-2.036-6.707-3.044-12.171-2.368-12.834.647-.636 3.092-.842 5.432-.46 4.803.786 5.562 2.462 8.922 19.692 1.499 7.684 1.634 10.994.54 13.215-2.977 6.05-5.43 7.833-10.782 7.833-4.295 0-6.076-.891-9.59-4.8m23.886-24.544c-4.736-10.018-8.61-19.083-8.61-20.144 0-1.062 1.575-2.345 3.499-2.852 4.338-1.142 6.364 1.346 13.782 16.927 6.675 14.02 7.461 24.284 1.861 24.284-1.144 0-5.413-7.383-10.532-18.215m21.82 8.692c-2.258-1.918-3.19-4.47-3.683-10.086-1.374-15.658-.86-24.065 1.755-28.693 3.73-6.603 14.366-9.748 17.893-5.291 2.322 2.935-3.734 5.869-7.616 3.69-2.292-1.287-2.884-.961-4.154 2.29-.815 2.086-1.627 8.904-1.805 15.151-.277 9.69.085 11.94 2.461 15.303 3.892 5.51 7.752 5.665 14.498.584 6.543-4.929 10.28-5.785 6.592-1.511-2.85 3.303-17.354 11.13-20.625 11.13-1.261 0-3.654-1.155-5.316-2.567m29.3-19.975c-7.07-16.514-9.128-24.042-7.293-26.673 1.806-2.592 4.753-2.926 6.806-.773 1.001 1.05 2.418-.314 4.853-4.672 3.9-6.981 9.24-11.253 14.264-11.41l3.422-.108-4.337 7.701c-7.115 12.634-7.073 13.996.65 20.777 6.436 5.651 12.096 13.43 12.096 16.623 0 .852-3.91-.705-8.688-3.46l-8.688-5.009.879 6.944c.945 7.477.7 7.89-5.514 9.286-4.037.907-4.18.752-8.45-9.226m39.746-4.654c0-.42.927-2.645 2.06-4.943 1.456-2.954 1.803-5.977 1.182-10.318-.925-6.473-1.16-6.657-10.537-8.322-9.626-1.708-11.047-5.914-5.061-14.973 4.597-6.958 9.718-9.752 15.708-8.574 5.204 1.024 6.383 4.77 1.503 4.77-2.041 0-3.632 1.217-4.648 3.556-.85 1.956-1.99 3.268-2.534 2.916-1.357-.88-1.258 6.926.106 8.357.603.632 3.587 1.78 6.632 2.55 4.748 1.202 5.599 1.977 5.976 5.447.719 6.61-1.069 13.434-4.447 16.977-2.927 3.07-5.94 4.367-5.94 2.557m16.567-31.36c-4.735-10.019-8.61-19.084-8.61-20.146 0-1.061 1.575-2.344 3.5-2.85 4.338-1.143 6.363 1.345 13.781 16.926 6.675 14.02 7.462 24.284 1.861 24.284-1.143 0-5.412-7.383-10.532-18.215m21.452 7.433c-2.708-5.637-10.349-29.474-10.894-33.987-.33-2.734.276-4.315 2.031-5.3 3.537-1.985 3.383-2.116 6.534 5.565 9.993 24.366 13.094 30.148 16.1 30.022 4.908-.207 4.553 3.214-.567 5.458-7.264 3.183-11.073 2.676-13.204-1.758m21.208-10.554c-10.82-11.469-15.525-21.196-12.389-25.616 2.16-3.042 5.816-1.887 10.057 3.179l4.116 4.917v-9.672c0-11.708.752-14.08 4.453-14.052 5.681.042 6.023 1.268 6.266 22.469.129 11.176-.133 20.941-.58 21.7s-2.073 1.726-3.613 2.148c-2.074.57-4.227-.745-8.31-5.073m27.89-11.704c-5.978-9.082-13.192-29.422-11.858-33.436.787-2.37 18.557-11.704 21.242-11.159 1.168.237-.943 1.92-4.758 3.794-3.772 1.853-6.858 4.089-6.858 4.97 0 2.697 4.173 14.62 5.099 14.567.478-.027 2.362-.944 4.185-2.038 1.824-1.093 4.784-2.01 6.579-2.037 2.834-.043 2.444.544-2.971 4.472-3.429 2.486-6.24 5.158-6.247 5.937s1.522 3.785 3.398 6.681l3.411 5.265 4.215-2.964c2.319-1.63 5.886-4.01 7.927-5.29 2.665-1.67 3.52-3.11 3.03-5.108-5.395-22.04-5.755-27.471-2.22-33.55 3.01-5.18 7.676-6.692 14.606-4.735 7.18 2.027 8.559 4.19 6.831 10.715-2.066 7.806-1.949 8.065 4.472 9.866 6.642 1.863 11.35 6.334 11.35 10.779 0 4.995-1.545 5.03-6.078.134-5.49-5.928-10.084-7.232-14.585-4.139-2.566 1.764-3.186 3.06-2.508 5.245.494 1.597 1.202 4.946 1.571 7.443 1.1 7.428-4.005 11.241-8.868 6.625-1.932-1.833-2.85-1.453-8.67 3.592-12.852 11.138-17.27 12.004-22.295 4.37m35.636-37.168c2.177-5.464 2.535-12.7.688-13.897-1.847-1.196-2.455.565-3.481 10.075-1.045 9.686-.073 11.016 2.793 3.822",style:{display:"inline",fill:"#000200","stroke-width":"1.35834"},transform:"matrix(1.43639 .63307 -.61952 1.40565 104.251 -703.335)"})],-1),fke=[hke];function pke(t,e){return Z(),ie("svg",dke,[...fke])}const mke={render:pke},gke={xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",width:"512",height:"130"},_ke=Ya('DEVELOP',2),vke=[_ke];function yke(t,e){return Z(),ie("svg",gke,[...vke])}const bke={render:yke},wke=it({name:"app",components:{LogoClean:wP,LogoText:mke,LogoTextDevelop:bke,RouterLink:vk,RouterView:yk,AlertPortal:BU,ModalPortal:jU},setup(){const t=Xa();return{info:An(),profile:Jt(),state:js(),serial:Nd(),root:vn(),Features:kn(()=>t.Features)}},data(){return{darkMode:!0,branch:"HEAD",showMenuItem:!1}},watch:{darkMode(t,e){t!=e&&document.firstElementChild&&(t?document.firstElementChild.className="theme-dark":document.firstElementChild.className="")}},computed:{availablePortOptions(){return this.serial.available.map(t=>({value:t,text:t.name}))},date(){return new Date(this.profile.meta.datetime*1e3)},connectButtonText(){return this.serial.is_connecting?"Connecting...":this.serial.is_connected?"Disconnect":"Connect"},canConnect(){return!this.serial.is_connecting&&this.$route.name!="flash"},updateProcessing(){return Dl.updatePreparing()||Dl.updatePending()},hasBrowserSupport(){return navigator.usb&&gu},logDownloadAnchorRef(){return this.$refs.logDownloadAnchor}},methods:{getDarkMode(){return localStorage.getItem("dark-mode")?localStorage.getItem("dark-mode")=="true":!window.matchMedia("(prefers-color-scheme: light)").matches},setDarkMode(t){localStorage.setItem("dark-mode",t?"true":"false"),this.darkMode=t},selectSerial(t,e){this.$modal.show(aE,{title:"Serial",options:e.map(n=>({text:n.displayName+" "+n.portName,value:n.portId}))}).then(n=>{var s;return(s=window.electron)==null?void 0:s.ipcRenderer.send("serial",n)})},selectUSBDevice(t,e){this.$modal.show(aE,{title:"USB Device",options:e.map(n=>({text:n.productName,value:n.deviceId}))}).then(n=>{var s;return(s=window.electron)==null?void 0:s.ipcRenderer.send("usb-device",n)})},downloadLog(){const t=ct.history.join(` +`),e="data:text/plain;charset=utf-8,"+encodeURIComponent(t),n=`Log_${new Date().toISOString()}.txt`;this.logDownloadAnchorRef.setAttribute("href",e),this.logDownloadAnchorRef.setAttribute("download",n),this.logDownloadAnchorRef.click()}},created(){var t,e;this.darkMode=this.getDarkMode(),Dl.updatePending()&&Dl.finishUpdate(),(t=window.electron)==null||t.ipcRenderer.on("select-serial",this.selectSerial),(e=window.electron)==null||e.ipcRenderer.on("select-usb-device",this.selectUSBDevice)},unmounted(){var t,e;clearInterval(this.interval),(t=window.electron)==null||t.ipcRenderer.removeAllListeners("select-serial"),(e=window.electron)==null||e.ipcRenderer.removeAllListeners("select-usb-device")}}),Fd=t=>(dd("data-v-732a5bd4"),t=t(),hd(),t),xke={key:0,class:"modal is-active","z-index":"9999"},Ske=Fd(()=>p("div",{class:"modal-background"},null,-1)),Eke={class:"modal-content"},Tke={class:"text-center"},Ake={class:"m-1"},Mke={key:1,class:"modal is-active","z-index":"9999"},Rke=Fd(()=>p("div",{class:"modal-background"},null,-1)),kke=Fd(()=>p("div",{class:"modal-content"},[p("div",{class:"notification is-danger"},[p("h1",{class:"is-size-3"},"Unsuported Browser!"),me(" Your Browser does not support the APIs necessary to use this application. Please use Chrome, Chromium or Edge! ")])],-1)),Cke=[Rke,kke],Pke={class:"navbar is-fixed-top is-primary",role:"navigation","aria-label":"main navigation"},Oke={class:"navbar-brand"},Ike=Fd(()=>p("span",{"aria-hidden":"true"},null,-1)),Lke=Fd(()=>p("span",{"aria-hidden":"true"},null,-1)),Dke=Fd(()=>p("span",{"aria-hidden":"true"},null,-1)),Nke=[Ike,Lke,Dke],Fke={key:0,class:"navbar-start"},Uke={key:1,class:"navbar-start"},$ke={class:"navbar-end"},Bke={class:"navbar-item"},Hke={class:"buttons"},Gke={ref:"logDownloadAnchor",style:{display:"none"}},zke={class:"container router-outlet-container"},Vke={key:2,class:"navbar is-fixed-bottom has-shadow"},Wke={class:"navbar-brand"},jke={class:"navbar-item is-size-4"},qke={class:"navbar-item"},Yke={class:"navbar-item",style:{"font-size":"70%"}},Xke={class:"navbar-item",style:{"font-size":"60%"}},Kke={class:"navbar-end"},Zke={class:"navbar-item"},Jke={class:"notification is-warning"},Qke={class:"notification is-warning"};function e5e(t,e,n,s,i,r){const o=Oe("font-awesome-icon"),a=Oe("LogoTextDevelop"),l=Oe("LogoText"),c=Oe("router-link"),u=Oe("tooltip"),d=Oe("spinner-btn"),h=Oe("AlertPortal"),f=Oe("ModalPortal"),v=Oe("router-view");return Z(),ie(ot,null,[t.updateProcessing?(Z(),ie("div",xke,[Ske,p("div",Eke,[p("div",Tke,[p("h1",Ake,[Y(o,{icon:"fa-solid fa-spinner",size:"lg","spin-pulse":""}),me(" Updating... ")])])])])):ze("",!0),t.hasBrowserSupport?ze("",!0):(Z(),ie("div",Mke,Cke)),p("nav",Pke,[p("div",Oke,[Y(c,{class:"navbar-item py-1",to:"/profile"},{default:nt(()=>[t.branch=="develop"?(Z(),en(a,{key:0,viewBox:"0 0 512 130",class:"text"})):(Z(),en(l,{key:1,viewBox:"0 0 512 82",class:"text"}))]),_:1}),p("a",{role:"button",class:"navbar-burger","aria-label":"menu","aria-expanded":"false","data-target":"mainMavbar",onClick:e[0]||(e[0]=_=>t.showMenuItem=!t.showMenuItem)},Nke)]),p("div",{id:"mainMavbar",class:ms(["navbar-menu",{"is-active":t.showMenuItem}])},[t.serial.is_connected?(Z(),ie("div",Fke,[Y(c,{"active-class":"is-active",class:"navbar-item",to:"/templates"},{default:nt(()=>[me(" Templates ")]),_:1}),Y(c,{"active-class":"is-active",class:"navbar-item",to:"/profile"},{default:nt(()=>[me(" Profile ")]),_:1}),Y(c,{"active-class":"is-active",class:"navbar-item",to:"/setup"},{default:nt(()=>[me(" Setup ")]),_:1}),Y(c,{"active-class":"is-active",class:"navbar-item",to:"/rates"},{default:nt(()=>[me(" Rates ")]),_:1}),Y(c,{"active-class":"is-active",class:"navbar-item",to:"/receiver"},{default:nt(()=>[me(" Receiver ")]),_:1}),t.info.has_feature(t.Features.OSD)?(Z(),en(c,{key:0,"active-class":"is-active",class:"navbar-item",to:"/osd"},{default:nt(()=>[me(" OSD ")]),_:1})):ze("",!0),Y(c,{"active-class":"is-active",class:"navbar-item",to:"/motor"},{default:nt(()=>[me(" Motor ")]),_:1}),t.info.has_feature(t.Features.BLACKBOX)&&t.info.quic_protocol_version>1?(Z(),en(c,{key:1,"active-class":"is-active",class:"navbar-item",to:"/blackbox"},{default:nt(()=>[me(" Blackbox ")]),_:1})):ze("",!0),Y(c,{"active-class":"is-active",class:"navbar-item",to:"/state"},{default:nt(()=>[me(" State ")]),_:1}),t.info.has_feature(t.Features.DEBUG)&&t.info.quic_protocol_version>1?(Z(),en(c,{key:2,"active-class":"is-active",class:"navbar-item",to:"/perf"},{default:nt(()=>[me(" Perf ")]),_:1})):ze("",!0)])):(Z(),ie("div",Uke,[Y(c,{"active-class":"is-active",class:"navbar-item",to:"/"},{default:nt(()=>[me(" Home ")]),_:1}),Y(c,{"active-class":"is-active",class:"navbar-item",to:"/flash"},{default:nt(()=>[me(" Flash ")]),_:1})])),p("div",$ke,[p("div",Bke,[p("div",Hke,[p("button",{class:"button is-primary",onClick:e[1]||(e[1]=_=>t.downloadLog())},[Y(u,{entry:"log.download"},{default:nt(()=>[Y(o,{icon:"fa-solid fa-file-export",size:"lg","fixed-width":""})]),_:1}),p("a",Gke,null,512)]),p("button",{class:"button is-primary",onClick:e[2]||(e[2]=_=>t.setDarkMode(!t.darkMode))},[t.darkMode?(Z(),en(o,{key:1,icon:"fa-solid fa-cloud-sun",size:"lg","fixed-width":""})):(Z(),en(o,{key:0,icon:"fa-solid fa-cloud-moon",size:"lg","fixed-width":""}))]),Y(d,{class:"button is-primary",onClick:t.serial.toggle_connection,disabled:!t.canConnect},{default:nt(()=>[me(Be(t.connectButtonText),1)]),_:1},8,["onClick","disabled"])])])])],2)]),Y(h),Y(f),p("div",zke,[Y(v)]),t.serial.is_connected?(Z(),ie("div",Vke,[p("div",Wke,[p("span",jke,Be(t.profile.meta.name),1),p("span",qke,"Modified "+Be(t.profile.modified),1),p("span",Yke," Looptime "+Be(t.state.looptime_autodetect)+" CPU Load "+Be(t.state.cpu_load),1),p("span",Xke," CPU Temp "+Be(t.state.cpu_temp.toFixed(2))+"°C ",1)]),p("div",Kke,[p("span",Zke,[Ye(p("div",Jke,[Y(o,{icon:"fa-solid fa-triangle-exclamation"}),me(" Unsaved changes ")],512),[[Ag,t.root.needs_apply]]),Ye(p("div",Qke,[Y(o,{icon:"fa-solid fa-triangle-exclamation"}),me(" Reboot required ")],512),[[Ag,!t.root.needs_apply&&t.root.needs_reboot]])]),Y(d,{class:"navbar-item is-warning my-auto mx-2",onClick:e[3]||(e[3]=_=>t.serial.soft_reboot())},{default:nt(()=>[me(" Reboot ")]),_:1}),Y(d,{class:"navbar-item is-primary my-auto mx-2",onClick:e[4]||(e[4]=_=>t.profile.apply_profile(t.profile.$state)),disabled:t.info.is_read_only},{default:nt(()=>[me(" Apply ")]),_:1},8,["disabled"])])])):ze("",!0)],64)}const t5e=lt(wke,[["render",e5e],["__scopeId","data-v-732a5bd4"]]),$I=o7(),n5e=["profile"];$I.use(({store:t})=>{n5e.includes(t.$id)&&t.$subscribe(e=>{if(e.type!="direct")return;vn().set_needs_apply()})});const s5e=it({inheritAttrs:!1,data(){return{loading:!1}},computed:{filteredAttrs(){const t=/^on[^a-z]/,e={},{$attrs:n}=this;for(const s in n)t.test(s)||(e[s]=n[s]);return e}},methods:{clickHandler(t){const e=this.$attrs.onClick;this.loading=!0,Promise.resolve().then(()=>e?e(t):null).finally(()=>this.loading=!1)}}});function i5e(t,e,n,s,i,r){return Z(),ie("button",P_({class:["button",{"is-loading":t.loading}]},t.filteredAttrs,{onClick:e[0]||(e[0]=(...o)=>t.clickHandler&&t.clickHandler(...o))}),[P4(t.$slots,"default")],16)}const r5e=lt(s5e,[["render",i5e]]),o5e={text:"Use this section to change motor positions, useful when using an fc in non standard configuration"},a5e={text:"Connect a lipo to access esc settings. Change direction of rotation. Not all esc are supported, Blheli-32 does not work"},l5e={text:"Can be used to flash serial receivers via passthrough, set correct uart and Start"},c5e={"channel.aux_arming":{text:"Arm the craft, default is to also activate Idle-up"},"channel.aux_blackbox":{text:"Start/stop blackbox recording"},"channel.aux_buzzer_enable":{disabled:!0},"channel.aux_fpv_switch":{text:"Vtx Pit mode on a switch"},"channel.aux_horizon":{text:"Self levelling up to a specific angle then Acro on both Roll and Pitch, requires Level mode active"},"channel.aux_idle_up":{text:"Ensures props never stop spinning, similar to airmode, default is to use the same channel as ARM"},"channel.aux_levelmode":{text:"Accelerometer data is used to self level, needed for Racemode and Horizon"},"channel.aux_motor_test":{text:"Activate the motor test function, useful to check individual motors in the field"},"channel.aux_prearm":{text:"Allows for a separate AUX channel to be set as a safety for arming, the set AUX should be ON before the ARM switch is activated. If not used leave this as ON"},"channel.aux_racemode":{text:"Uses self levelling only on the roll axis, acro on pitch, requires Level mode active"},"channel.aux_rate_profile":{disabled:!0},"channel.aux_rssi":{text:"For fcs that can send rssi on a channel"},"channel.aux_stick_boost_profile":{disabled:!0},"channel.aux_turtle":{text:"Set this to ON and the fc will detect when landed inverted and activate Turtle when ARM is active, optional to set to an Aux switch",link:"https://docs.bosshobby.com/Features/#turtle-mode"},"filter.dterm_1_freq":{disabled:!0},"filter.dterm_1_type":{disabled:!0},"filter.dterm_2_freq":{disabled:!0},"filter.dterm_2_type":{disabled:!0},"filter.dterm_dynamic_enable":{text:"Enable a dynamic D-term filtercut, you almost always want to leave this ON",link:"https://docs.bosshobby.com/Features/#dynamic-d-term"},"filter.dterm_dynamic_max":{disabled:!0},"filter.dterm_dynamic_min":{disabled:!0},"filter.gyro_1_freq":{disabled:!0},"filter.gyro_1_type":{disabled:!0},"filter.gyro_2_freq":{disabled:!0},"filter.gyro_2_type":{disabled:!0},"filter.settings":{text:"The default filter setting are designed to be safe, before making adjustments refer to the wiki",link:"https://docs.bosshobby.com/Features/#filters"},"flash.file-branch":{text:"Development branch to flash a hex from"},"flash.file-pull-request":{text:"Pull request to flash a hex from"},"flash.file-local":{text:"Choose a self built hex"},"flash.file-release":{text:"The default selection is the latest `stable` release, dev versions are available as testers"},"flash.file-commit":{text:"The latest commit hash on the selected branch"},"flash.file-remote":{text:"Targets are named `board_name.motor_type` choose serial if your rx is separate and attatched to a uart. If you don't see your fc listed exactly then don't flash, please ask for a target in our Discord server",link:"https://discord.gg/qzyvewaCnP"},"flash.reset":{text:"Pressing the `Reset To Bootloader` button should force the fc into DFU mode for flashing, if it doesn't work use the button on the fc while connecting USB"},"flash.source":{text:"If you compile your own hex select `local` and choose it in the next box"},"log.download":{text:"Download log file"},"motor.digital_idle":{text:"Adjust in small ammounts if needed to achieve smooth idle"},"motor.dshot_time":{text:"On some fcs this might need set to 300 to avoid failloops, Default 600"},"motor.flip_gyro":{disabled:!0},"motor.gyro_orientation":{text:"Change this if the fc is mounted in a non standard way, use with the flip-gyro option until the preview model moves correctly"},"motor.invert_yaw":{text:"Default is props out"},"motor.motor_limit":{text:"Set a cap on the maximum throttle"},"motor.test":{text:"Connect a lipo, PROPS OFF, use sliders to confirm motor operation and direction"},"motor.throttle_boost":{text:"Experimental, use with caution, can rob motors of power if set too high"},"motor.torque_boost":{text:"A very experimental feature for more advanced use",link:"https://docs.bosshobby.com/Features/#torque-boost"},"motor.turtle_throttle_percent":{text:"For whoops set to 100% larger craft start at 10% and increase by 10 to suit needs",link:"https://docs.bosshobby.com/Features/#turtle-mode"},motor_pins:o5e,motor_settings:a5e,"osd.elements":{text:"Select and position OSD elements, callsign must use upper case",link:"https://docs.bosshobby.com/Features/#osd"},"osd.font":{text:"A choice of fonts are available, select and upload. You can also upload your own custom boot logo as long as it a 288x72 Black/White/Transparent PNG"},"pid.angle_strength":{text:"Angle Strength adjusts how your craft responds to external forces from bumps to stick inputs",link:"https://docs.bosshobby.com/Features/#angle-strength"},"pid.preset":{text:"Select by thrust to weight ratio or props size, these presets give a safe starting point to further tune if needed"},"pid.profile":{text:"You can have 2 different sets of pids loaded in 2 profiles"},"pid.stick_profile":{text:"Allows for adjustment to stick feel",link:"https://docs.bosshobby.com/Features/#stick-boost"},"pid.tda_active":{text:"As higher throttle levels are reached D-term gain is reduced allowing the D-term notch filter to work safely",link:"https://docs.bosshobby.com/Features/#throttle-d-term-attenuation-tda"},"pid.tda_breakpoint":{text:"Throttle percentage before TDA starts to act"},"pid.tda_percent":{text:"Percentage reduction of D-term at max throttle"},"rate.level_max_angle":{text:"Increase to give a higher velocity for racing, combined with high camera angle, to a max of 90"},"rate.low_rate_mulitplier":{disabled:!0},"rate.mode":{text:"Silverware, Betaflight and Actual rates option"},"rate.profile":{text:"2 slots available for different profiles"},"rate.sticks_deadband":{text:"If your radio has `jitter` on Pitch/Roll stick center raising this a little can help"},"rate.throttle_expo":{text:"Adding some expo will soften the stick feel around the set `Throttle Mid`"},"rate.throttle_mid":{text:"Can be set to about where your `hover point` is giving improved resolution on the stick"},"receiver.bind_saved":{text:"Once you have bind and issued stick gesture up,up,up followed by down,down,down on Pitch this will show YES"},"receiver.channel_mapping":{text:"Quicksilver default is AETR the other option is TAER"},"receiver.lqi_source":{text:"Select the source for your rssi/lqi OSD display. Direct is best for ELRS, others can use Packet-Rate"},"receiver.protocol":{text:"Serial or spi connected rx will be detected automatically here"},"serial.digital_vtx":{text:"MSP serial port for digital systems like HDZero, DJI WTF and Walksnail. HDZero requires TX and RX connected to use msp, define the UART here"},"serial.rx":{text:"Enter the UART number the serial RX is connected to (for spi RX leave as NONE)"},"serial.smart_audio":{text:"Enter the UART the VTX TX line is connected to"},serial_passthrough:l5e,"voltage.actual_battery_voltage":{text:"Default is 4.2V, set to whatever value you get from a multimeter or lipo tester for a full lipo."},"voltage.vbat_scale":{text:"Use the value provided by the FC manufacturer"},"voltage.ibat_scale":{text:"Use the value provided by the FC manufacturer"},"voltage.lipo_cell_count":{text:"Enter the number of cells, leave at 0 to use autodetect"},"voltage.pid_voltage_compensation":{text:"Adjusts the pids to compensate for lipo voltage drop, default ON"},"voltage.reported_telemetry_voltage":{text:"Set to the value received by your tx or in the OSD view with a full lipo"},"voltage.vbattlow":{text:"Set the desired voltage to trigger a warning, single cell voltage is used Default 3.3V (uses Fuel gauge volts by default)",link:"https://docs.bosshobby.com/Features/#voltage"},"voltage.use_filtered_voltage_for_warnings":{text:"Use filtered voltage instead Fuel gauge volts for Warnings"}},u5e={updated(t,{value:e,oldValue:n},{transition:s}){e!==n&&(e?(s.beforeEnter(t),t.style.visibility="visible",s.enter(t)):s.leave(t,()=>{t.style.visibility="hidden"}))}},d5e=it({props:{text:String,entry:String,size:String},directives:{visible:u5e},setup(){return{}},data(){return{placmentClass:{},visbleClick:!1,visbleHover:!1}},computed:{tooltip(){return this.text?{text:this.text}:c5e[this.entry]},danger(){return!this.tooltip||!this.tooltip.text},visible(){return this.visbleClick||this.visbleHover},active(){return(this.text||this.entry)&&(!this.tooltip||!this.tooltip.disabled)}},methods:{onClick(){this.$slots.default||(this.visbleClick=!this.visbleClick)}},mounted(){var s,i;const t=(s=this.$refs.tooltipContainer)==null?void 0:s.offsetTop,e=(i=this.$refs.tooltipContent)==null?void 0:i.clientHeight,n=t>=e;this.placmentClass={"tooltip-bottom":!n,"tooltip-top":n}}}),h5e=["id"],f5e={ref:"tooltipContent",class:"tooltip-text has-text-centered has-text-light has-background-dark"},p5e={key:0},m5e={key:0},g5e=["href"],_5e={key:1};function v5e(t,e,n,s,i,r){const o=Oe("font-awesome-icon"),a=wL("visible");return t.active?(Z(),ie("span",{key:0,ref:"tooltipContainer",class:ms(["tooltip",t.placmentClass]),onMouseenter:e[0]||(e[0]=l=>t.visbleHover=!0),onMouseleave:e[1]||(e[1]=l=>t.visbleHover=!1),onClick:e[2]||(e[2]=(...l)=>t.onClick&&t.onClick(...l))},[P4(t.$slots,"default",{},()=>[p("span",{class:ms(["tooltip-icon",{"has-text-danger":t.danger,"has-text-grey":!t.danger}]),id:"tooltip-"+t.entry},[Y(o,{icon:"fa-solid fa-circle-question",size:t.size,"fixed-width":""},null,8,["size"])],10,h5e)]),Y(aw,{name:"tooltip"},{default:nt(()=>[Ye((Z(),ie("span",f5e,[t.danger?(Z(),ie("span",_5e," Missing tooltip entry "+Be(t.entry),1)):(Z(),ie("span",p5e,[me(Be(t.tooltip.text)+" ",1),t.tooltip.link?(Z(),ie("div",m5e,[p("a",{target:"_blank",href:t.tooltip.link},"read more",8,g5e)])):ze("",!0)]))])),[[a,t.visible]])]),_:1})],34)):ze("",!0)}const y5e=lt(d5e,[["render",v5e]]),b5e=it({props:["modelValue","options"],emits:["update:modelValue"],computed:{inputVal:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},optionMap(){return(this.options||[]).map(t=>typeof t=="string"?{text:t,value:t}:t)}}}),w5e={class:"select"},x5e=["value"];function S5e(t,e,n,s,i,r){return Z(),ie("div",w5e,[Ye(p("select",P_({"onUpdate:modelValue":e[0]||(e[0]=o=>t.inputVal=o)},t.$attrs),[(Z(!0),ie(ot,null,qt(t.optionMap,o=>(Z(),ie("option",{key:o.value,value:o.value},Be(o.text),9,x5e))),128))],16),[[L_,t.inputVal]])])}const E5e=lt(b5e,[["render",S5e]]);function _R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function We(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,s=new Array(e);n-1;i--){var r=n[i],o=(r.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(s=r)}return hn.head.insertBefore(e,s),t}}var K5e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function If(){for(var t=12,e="";t-- >0;)e+=K5e[Math.random()*62|0];return e}function Ud(t){for(var e=[],n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function a2(t){return t.classList?Ud(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(e){return e})}function ZI(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Z5e(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,'="').concat(ZI(t[n]),'" ')},"").trim()}function F0(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,": ").concat(t[n].trim(),";")},"")}function l2(t){return t.size!==Er.size||t.x!==Er.x||t.y!==Er.y||t.rotate!==Er.rotate||t.flipX||t.flipY}function J5e(t){var e=t.transform,n=t.containerWidth,s=t.iconWidth,i={transform:"translate(".concat(n/2," 256)")},r="translate(".concat(e.x*32,", ").concat(e.y*32,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(r," ").concat(o," ").concat(a)},c={transform:"translate(".concat(s/2*-1," -256)")};return{outer:i,inner:l,path:c}}function Q5e(t){var e=t.transform,n=t.width,s=n===void 0?Mb:n,i=t.height,r=i===void 0?Mb:i,o=t.startCentered,a=o===void 0?!1:o,l="";return a&&VI?l+="translate(".concat(e.x/Qo-s/2,"em, ").concat(e.y/Qo-r/2,"em) "):a?l+="translate(calc(-50% + ".concat(e.x/Qo,"em), calc(-50% + ").concat(e.y/Qo,"em)) "):l+="translate(".concat(e.x/Qo,"em, ").concat(e.y/Qo,"em) "),l+="scale(".concat(e.size/Qo*(e.flipX?-1:1),", ").concat(e.size/Qo*(e.flipY?-1:1),") "),l+="rotate(".concat(e.rotate,"deg) "),l}var eCe=`:root, :host { + --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid"; + --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular"; + --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light"; + --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin"; + --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; + --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; + --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; + --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; +} + +svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} + +.svg-inline--fa { + display: var(--fa-display, inline-block); + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +.svg-inline--fa.fa-2xs { + vertical-align: 0.1em; +} +.svg-inline--fa.fa-xs { + vertical-align: 0em; +} +.svg-inline--fa.fa-sm { + vertical-align: -0.0714285705em; +} +.svg-inline--fa.fa-lg { + vertical-align: -0.2em; +} +.svg-inline--fa.fa-xl { + vertical-align: -0.25em; +} +.svg-inline--fa.fa-2xl { + vertical-align: -0.3125em; +} +.svg-inline--fa.fa-pull-left { + margin-right: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-pull-right { + margin-left: var(--fa-pull-margin, 0.3em); + width: auto; +} +.svg-inline--fa.fa-li { + width: var(--fa-li-width, 2em); + top: 0.25em; +} +.svg-inline--fa.fa-fw { + width: var(--fa-fw-width, 1.25em); +} + +.fa-layers svg.svg-inline--fa { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; +} + +.fa-layers-counter, .fa-layers-text { + display: inline-block; + position: absolute; + text-align: center; +} + +.fa-layers { + display: inline-block; + height: 1em; + position: relative; + text-align: center; + vertical-align: -0.125em; + width: 1em; +} +.fa-layers svg.svg-inline--fa { + -webkit-transform-origin: center center; + transform-origin: center center; +} + +.fa-layers-text { + left: 50%; + top: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + -webkit-transform-origin: center center; + transform-origin: center center; +} + +.fa-layers-counter { + background-color: var(--fa-counter-background-color, #ff253a); + border-radius: var(--fa-counter-border-radius, 1em); + box-sizing: border-box; + color: var(--fa-inverse, #fff); + line-height: var(--fa-counter-line-height, 1); + max-width: var(--fa-counter-max-width, 5em); + min-width: var(--fa-counter-min-width, 1.5em); + overflow: hidden; + padding: var(--fa-counter-padding, 0.25em 0.5em); + right: var(--fa-right, 0); + text-overflow: ellipsis; + top: var(--fa-top, 0); + -webkit-transform: scale(var(--fa-counter-scale, 0.25)); + transform: scale(var(--fa-counter-scale, 0.25)); + -webkit-transform-origin: top right; + transform-origin: top right; +} + +.fa-layers-bottom-right { + bottom: var(--fa-bottom, 0); + right: var(--fa-right, 0); + top: auto; + -webkit-transform: scale(var(--fa-layers-scale, 0.25)); + transform: scale(var(--fa-layers-scale, 0.25)); + -webkit-transform-origin: bottom right; + transform-origin: bottom right; +} + +.fa-layers-bottom-left { + bottom: var(--fa-bottom, 0); + left: var(--fa-left, 0); + right: auto; + top: auto; + -webkit-transform: scale(var(--fa-layers-scale, 0.25)); + transform: scale(var(--fa-layers-scale, 0.25)); + -webkit-transform-origin: bottom left; + transform-origin: bottom left; +} + +.fa-layers-top-right { + top: var(--fa-top, 0); + right: var(--fa-right, 0); + -webkit-transform: scale(var(--fa-layers-scale, 0.25)); + transform: scale(var(--fa-layers-scale, 0.25)); + -webkit-transform-origin: top right; + transform-origin: top right; +} + +.fa-layers-top-left { + left: var(--fa-left, 0); + right: auto; + top: var(--fa-top, 0); + -webkit-transform: scale(var(--fa-layers-scale, 0.25)); + transform: scale(var(--fa-layers-scale, 0.25)); + -webkit-transform-origin: top left; + transform-origin: top left; +} + +.fa-1x { + font-size: 1em; +} + +.fa-2x { + font-size: 2em; +} + +.fa-3x { + font-size: 3em; +} + +.fa-4x { + font-size: 4em; +} + +.fa-5x { + font-size: 5em; +} + +.fa-6x { + font-size: 6em; +} + +.fa-7x { + font-size: 7em; +} + +.fa-8x { + font-size: 8em; +} + +.fa-9x { + font-size: 9em; +} + +.fa-10x { + font-size: 10em; +} + +.fa-2xs { + font-size: 0.625em; + line-height: 0.1em; + vertical-align: 0.225em; +} + +.fa-xs { + font-size: 0.75em; + line-height: 0.0833333337em; + vertical-align: 0.125em; +} + +.fa-sm { + font-size: 0.875em; + line-height: 0.0714285718em; + vertical-align: 0.0535714295em; +} + +.fa-lg { + font-size: 1.25em; + line-height: 0.05em; + vertical-align: -0.075em; +} + +.fa-xl { + font-size: 1.5em; + line-height: 0.0416666682em; + vertical-align: -0.125em; +} + +.fa-2xl { + font-size: 2em; + line-height: 0.03125em; + vertical-align: -0.1875em; +} + +.fa-fw { + text-align: center; + width: 1.25em; +} + +.fa-ul { + list-style-type: none; + margin-left: var(--fa-li-margin, 2.5em); + padding-left: 0; +} +.fa-ul > li { + position: relative; +} + +.fa-li { + left: calc(var(--fa-li-width, 2em) * -1); + position: absolute; + text-align: center; + width: var(--fa-li-width, 2em); + line-height: inherit; +} + +.fa-border { + border-color: var(--fa-border-color, #eee); + border-radius: var(--fa-border-radius, 0.1em); + border-style: var(--fa-border-style, solid); + border-width: var(--fa-border-width, 0.08em); + padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); +} + +.fa-pull-left { + float: left; + margin-right: var(--fa-pull-margin, 0.3em); +} + +.fa-pull-right { + float: right; + margin-left: var(--fa-pull-margin, 0.3em); +} + +.fa-beat { + -webkit-animation-name: fa-beat; + animation-name: fa-beat; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-bounce { + -webkit-animation-name: fa-bounce; + animation-name: fa-bounce; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); +} + +.fa-fade { + -webkit-animation-name: fa-fade; + animation-name: fa-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-beat-fade { + -webkit-animation-name: fa-beat-fade; + animation-name: fa-beat-fade; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); +} + +.fa-flip { + -webkit-animation-name: fa-flip; + animation-name: fa-flip; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-timing-function: var(--fa-animation-timing, ease-in-out); +} + +.fa-shake { + -webkit-animation-name: fa-shake; + animation-name: fa-shake; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-delay: var(--fa-animation-delay, 0s); + animation-delay: var(--fa-animation-delay, 0s); + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 2s); + animation-duration: var(--fa-animation-duration, 2s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, linear); + animation-timing-function: var(--fa-animation-timing, linear); +} + +.fa-spin-reverse { + --fa-animation-direction: reverse; +} + +.fa-pulse, +.fa-spin-pulse { + -webkit-animation-name: fa-spin; + animation-name: fa-spin; + -webkit-animation-direction: var(--fa-animation-direction, normal); + animation-direction: var(--fa-animation-direction, normal); + -webkit-animation-duration: var(--fa-animation-duration, 1s); + animation-duration: var(--fa-animation-duration, 1s); + -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + -webkit-animation-timing-function: var(--fa-animation-timing, steps(8)); + animation-timing-function: var(--fa-animation-timing, steps(8)); +} + +@media (prefers-reduced-motion: reduce) { + .fa-beat, +.fa-bounce, +.fa-fade, +.fa-beat-fade, +.fa-flip, +.fa-pulse, +.fa-shake, +.fa-spin, +.fa-spin-pulse { + -webkit-animation-delay: -1ms; + animation-delay: -1ms; + -webkit-animation-duration: 1ms; + animation-duration: 1ms; + -webkit-animation-iteration-count: 1; + animation-iteration-count: 1; + -webkit-transition-delay: 0s; + transition-delay: 0s; + -webkit-transition-duration: 0s; + transition-duration: 0s; + } +} +@-webkit-keyframes fa-beat { + 0%, 90% { + -webkit-transform: scale(1); + transform: scale(1); + } + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); + } +} +@keyframes fa-beat { + 0%, 90% { + -webkit-transform: scale(1); + transform: scale(1); + } + 45% { + -webkit-transform: scale(var(--fa-beat-scale, 1.25)); + transform: scale(var(--fa-beat-scale, 1.25)); + } +} +@-webkit-keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } +} +@keyframes fa-bounce { + 0% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + 10% { + -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + } + 30% { + -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + } + 50% { + -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + } + 57% { + -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + } + 64% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } + 100% { + -webkit-transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); + } +} +@-webkit-keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } +} +@keyframes fa-fade { + 50% { + opacity: var(--fa-fade-opacity, 0.4); + } +} +@-webkit-keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); + } + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } +} +@keyframes fa-beat-fade { + 0%, 100% { + opacity: var(--fa-beat-fade-opacity, 0.4); + -webkit-transform: scale(1); + transform: scale(1); + } + 50% { + opacity: 1; + -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); + } +} +@-webkit-keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } +} +@keyframes fa-flip { + 50% { + -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + } +} +@-webkit-keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); + } + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); + } + 8%, 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); + } + 12%, 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); + } + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); + } + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); + } + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); + } + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); + } + 40%, 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } +} +@keyframes fa-shake { + 0% { + -webkit-transform: rotate(-15deg); + transform: rotate(-15deg); + } + 4% { + -webkit-transform: rotate(15deg); + transform: rotate(15deg); + } + 8%, 24% { + -webkit-transform: rotate(-18deg); + transform: rotate(-18deg); + } + 12%, 28% { + -webkit-transform: rotate(18deg); + transform: rotate(18deg); + } + 16% { + -webkit-transform: rotate(-22deg); + transform: rotate(-22deg); + } + 20% { + -webkit-transform: rotate(22deg); + transform: rotate(22deg); + } + 32% { + -webkit-transform: rotate(-12deg); + transform: rotate(-12deg); + } + 36% { + -webkit-transform: rotate(12deg); + transform: rotate(12deg); + } + 40%, 100% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } +} +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +.fa-rotate-90 { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); +} + +.fa-rotate-180 { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); +} + +.fa-rotate-270 { + -webkit-transform: rotate(270deg); + transform: rotate(270deg); +} + +.fa-flip-horizontal { + -webkit-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.fa-flip-vertical { + -webkit-transform: scale(1, -1); + transform: scale(1, -1); +} + +.fa-flip-both, +.fa-flip-horizontal.fa-flip-vertical { + -webkit-transform: scale(-1, -1); + transform: scale(-1, -1); +} + +.fa-rotate-by { + -webkit-transform: rotate(var(--fa-rotate-angle, 0)); + transform: rotate(var(--fa-rotate-angle, 0)); +} + +.fa-stack { + display: inline-block; + vertical-align: middle; + height: 2em; + position: relative; + width: 2.5em; +} + +.fa-stack-1x, +.fa-stack-2x { + bottom: 0; + left: 0; + margin: auto; + position: absolute; + right: 0; + top: 0; + z-index: var(--fa-stack-z-index, auto); +} + +.svg-inline--fa.fa-stack-1x { + height: 1em; + width: 1.25em; +} +.svg-inline--fa.fa-stack-2x { + height: 2em; + width: 2.5em; +} + +.fa-inverse { + color: var(--fa-inverse, #fff); +} + +.sr-only, +.fa-sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.sr-only-focusable:not(:focus), +.fa-sr-only-focusable:not(:focus) { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.svg-inline--fa .fa-primary { + fill: var(--fa-primary-color, currentColor); + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa .fa-secondary { + fill: var(--fa-secondary-color, currentColor); + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-primary { + opacity: var(--fa-secondary-opacity, 0.4); +} + +.svg-inline--fa.fa-swap-opacity .fa-secondary { + opacity: var(--fa-primary-opacity, 1); +} + +.svg-inline--fa mask .fa-primary, +.svg-inline--fa mask .fa-secondary { + fill: black; +} + +.fad.fa-inverse, +.fa-duotone.fa-inverse { + color: var(--fa-inverse, #fff); +}`;function JI(){var t=WI,e=jI,n=Xe.cssPrefix,s=Xe.replacementClass,i=eCe;if(n!==t||s!==e){var r=new RegExp("\\.".concat(t,"\\-"),"g"),o=new RegExp("\\--".concat(t,"\\-"),"g"),a=new RegExp("\\.".concat(e),"g");i=i.replace(r,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(a,".".concat(s))}return i}var SR=!1;function Gv(){Xe.autoAddCss&&!SR&&(X5e(JI()),SR=!0)}var tCe={mixout:function(){return{dom:{css:JI,insertCss:Gv}}},hooks:function(){return{beforeDOMElementCreation:function(){Gv()},beforeI2svg:function(){Gv()}}}},Po=za||{};Po[Co]||(Po[Co]={});Po[Co].styles||(Po[Co].styles={});Po[Co].hooks||(Po[Co].hooks={});Po[Co].shims||(Po[Co].shims=[]);var Qi=Po[Co],QI=[],nCe=function t(){hn.removeEventListener("DOMContentLoaded",t),f_=1,QI.map(function(e){return e()})},f_=!1;Uo&&(f_=(hn.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(hn.readyState),f_||hn.addEventListener("DOMContentLoaded",nCe));function sCe(t){Uo&&(f_?setTimeout(t,0):QI.push(t))}function cp(t){var e=t.tag,n=t.attributes,s=n===void 0?{}:n,i=t.children,r=i===void 0?[]:i;return typeof t=="string"?ZI(t):"<".concat(e," ").concat(Z5e(s),">").concat(r.map(cp).join(""),"")}function ER(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}var zv=function(e,n,s,i){var r=Object.keys(e),o=r.length,a=n,l,c,u;for(s===void 0?(l=1,u=e[r[0]]):(l=0,u=s);l=55296&&i<=56319&&n=55296&&s<=56319&&n>e+1&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(s-55296)*1024+i-56320+65536:s}function TR(t){return Object.keys(t).reduce(function(e,n){var s=t[n],i=!!s.icon;return i?e[s.iconName]=s.icon:e[n]=s,e},{})}function Cb(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=n.skipHooks,i=s===void 0?!1:s,r=TR(e);typeof Qi.hooks.addPack=="function"&&!i?Qi.hooks.addPack(t,TR(e)):Qi.styles[t]=We(We({},Qi.styles[t]||{}),r),t==="fas"&&Cb("fa",e)}var Dm,Nm,Fm,lu=Qi.styles,oCe=Qi.shims,aCe=(Dm={},Vn(Dm,dn,Object.values(Pf[dn])),Vn(Dm,Sn,Object.values(Pf[Sn])),Dm),c2=null,e6={},t6={},n6={},s6={},i6={},lCe=(Nm={},Vn(Nm,dn,Object.keys(kf[dn])),Vn(Nm,Sn,Object.keys(kf[Sn])),Nm);function cCe(t){return~V5e.indexOf(t)}function uCe(t,e){var n=e.split("-"),s=n[0],i=n.slice(1).join("-");return s===t&&i!==""&&!cCe(i)?i:null}var r6=function(){var e=function(r){return zv(lu,function(o,a,l){return o[l]=zv(a,r,{}),o},{})};e6=e(function(i,r,o){if(r[3]&&(i[r[3]]=o),r[2]){var a=r[2].filter(function(l){return typeof l=="number"});a.forEach(function(l){i[l.toString(16)]=o})}return i}),t6=e(function(i,r,o){if(i[o]=o,r[2]){var a=r[2].filter(function(l){return typeof l=="string"});a.forEach(function(l){i[l]=o})}return i}),i6=e(function(i,r,o){var a=r[2];return i[o]=o,a.forEach(function(l){i[l]=o}),i});var n="far"in lu||Xe.autoFetchSvg,s=zv(oCe,function(i,r){var o=r[0],a=r[1],l=r[2];return a==="far"&&!n&&(a="fas"),typeof o=="string"&&(i.names[o]={prefix:a,iconName:l}),typeof o=="number"&&(i.unicodes[o.toString(16)]={prefix:a,iconName:l}),i},{names:{},unicodes:{}});n6=s.names,s6=s.unicodes,c2=U0(Xe.styleDefault,{family:Xe.familyDefault})};Y5e(function(t){c2=U0(t.styleDefault,{family:Xe.familyDefault})});r6();function u2(t,e){return(e6[t]||{})[e]}function dCe(t,e){return(t6[t]||{})[e]}function Vl(t,e){return(i6[t]||{})[e]}function o6(t){return n6[t]||{prefix:null,iconName:null}}function hCe(t){var e=s6[t],n=u2("fas",t);return e||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Va(){return c2}var d2=function(){return{prefix:null,iconName:null,rest:[]}};function U0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.family,s=n===void 0?dn:n,i=kf[s][t],r=Cf[s][t]||Cf[s][i],o=t in Qi.styles?t:null;return r||o||null}var AR=(Fm={},Vn(Fm,dn,Object.keys(Pf[dn])),Vn(Fm,Sn,Object.keys(Pf[Sn])),Fm);function $0(t){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.skipLookups,i=s===void 0?!1:s,r=(e={},Vn(e,dn,"".concat(Xe.cssPrefix,"-").concat(dn)),Vn(e,Sn,"".concat(Xe.cssPrefix,"-").concat(Sn)),e),o=null,a=dn;(t.includes(r[dn])||t.some(function(c){return AR[dn].includes(c)}))&&(a=dn),(t.includes(r[Sn])||t.some(function(c){return AR[Sn].includes(c)}))&&(a=Sn);var l=t.reduce(function(c,u){var d=uCe(Xe.cssPrefix,u);if(lu[u]?(u=aCe[a].includes(u)?U5e[a][u]:u,o=u,c.prefix=u):lCe[a].indexOf(u)>-1?(o=u,c.prefix=U0(u,{family:a})):d?c.iconName=d:u!==Xe.replacementClass&&u!==r[dn]&&u!==r[Sn]&&c.rest.push(u),!i&&c.prefix&&c.iconName){var h=o==="fa"?o6(c.iconName):{},f=Vl(c.prefix,c.iconName);h.prefix&&(o=null),c.iconName=h.iconName||f||c.iconName,c.prefix=h.prefix||c.prefix,c.prefix==="far"&&!lu.far&&lu.fas&&!Xe.autoFetchSvg&&(c.prefix="fas")}return c},d2());return(t.includes("fa-brands")||t.includes("fab"))&&(l.prefix="fab"),(t.includes("fa-duotone")||t.includes("fad"))&&(l.prefix="fad"),!l.prefix&&a===Sn&&(lu.fass||Xe.autoFetchSvg)&&(l.prefix="fass",l.iconName=Vl(l.prefix,l.iconName)||l.iconName),(l.prefix==="fa"||o==="fa")&&(l.prefix=Va()||"fas"),l}var fCe=function(){function t(){T5e(this,t),this.definitions={}}return M5e(t,[{key:"add",value:function(){for(var n=this,s=arguments.length,i=new Array(s),r=0;r0&&u.forEach(function(d){typeof d=="string"&&(n[a][d]=c)}),n[a][l]=c}),n}}]),t}(),MR=[],cu={},Ou={},pCe=Object.keys(Ou);function mCe(t,e){var n=e.mixoutsTo;return MR=t,cu={},Object.keys(Ou).forEach(function(s){pCe.indexOf(s)===-1&&delete Ou[s]}),MR.forEach(function(s){var i=s.mixout?s.mixout():{};if(Object.keys(i).forEach(function(o){typeof i[o]=="function"&&(n[o]=i[o]),h_(i[o])==="object"&&Object.keys(i[o]).forEach(function(a){n[o]||(n[o]={}),n[o][a]=i[o][a]})}),s.hooks){var r=s.hooks();Object.keys(r).forEach(function(o){cu[o]||(cu[o]=[]),cu[o].push(r[o])})}s.provides&&s.provides(Ou)}),n}function Pb(t,e){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i1?e-1:0),s=1;s0&&arguments[0]!==void 0?arguments[0]:{};return Uo?(dc("beforeI2svg",e),Oo("pseudoElements2svg",e),Oo("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot;Xe.autoReplaceSvg===!1&&(Xe.autoReplaceSvg=!0),Xe.observeMutations=!0,sCe(function(){yCe({autoReplaceSvgRoot:n}),dc("watch",e)})}},vCe={icon:function(e){if(e===null)return null;if(h_(e)==="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:Vl(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var n=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],s=U0(e[0]);return{prefix:s,iconName:Vl(s,n)||n}}if(typeof e=="string"&&(e.indexOf("".concat(Xe.cssPrefix,"-"))>-1||e.match($5e))){var i=$0(e.split(" "),{skipLookups:!0});return{prefix:i.prefix||Va(),iconName:Vl(i.prefix,i.iconName)||i.iconName}}if(typeof e=="string"){var r=Va();return{prefix:r,iconName:Vl(r,e)||e}}}},hi={noAuto:gCe,config:Xe,dom:_Ce,parse:vCe,library:a6,findIconDefinition:Ob,toHtml:cp},yCe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot,s=n===void 0?hn:n;(Object.keys(Qi.styles).length>0||Xe.autoFetchSvg)&&Uo&&Xe.autoReplaceSvg&&hi.dom.i2svg({node:s})};function B0(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(function(s){return cp(s)})}}),Object.defineProperty(t,"node",{get:function(){if(Uo){var s=hn.createElement("div");return s.innerHTML=t.html,s.children}}}),t}function bCe(t){var e=t.children,n=t.main,s=t.mask,i=t.attributes,r=t.styles,o=t.transform;if(l2(o)&&n.found&&!s.found){var a=n.width,l=n.height,c={x:a/l/2,y:.5};i.style=F0(We(We({},r),{},{"transform-origin":"".concat(c.x+o.x/16,"em ").concat(c.y+o.y/16,"em")}))}return[{tag:"svg",attributes:i,children:e}]}function wCe(t){var e=t.prefix,n=t.iconName,s=t.children,i=t.attributes,r=t.symbol,o=r===!0?"".concat(e,"-").concat(Xe.cssPrefix,"-").concat(n):r;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:We(We({},i),{},{id:o}),children:s}]}]}function h2(t){var e=t.icons,n=e.main,s=e.mask,i=t.prefix,r=t.iconName,o=t.transform,a=t.symbol,l=t.title,c=t.maskId,u=t.titleId,d=t.extra,h=t.watchable,f=h===void 0?!1:h,v=s.found?s:n,_=v.width,m=v.height,g=i==="fak",y=[Xe.replacementClass,r?"".concat(Xe.cssPrefix,"-").concat(r):""].filter(function(E){return d.classes.indexOf(E)===-1}).filter(function(E){return E!==""||!!E}).concat(d.classes).join(" "),b={children:[],attributes:We(We({},d.attributes),{},{"data-prefix":i,"data-icon":r,class:y,role:d.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(_," ").concat(m)})},w=g&&!~d.classes.indexOf("fa-fw")?{width:"".concat(_/m*16*.0625,"em")}:{};f&&(b.attributes[uc]=""),l&&(b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(u||If())},children:[l]}),delete b.attributes.title);var T=We(We({},b),{},{prefix:i,iconName:r,main:n,mask:s,maskId:c,transform:o,symbol:a,styles:We(We({},w),d.styles)}),x=s.found&&n.found?Oo("generateAbstractMask",T)||{children:[],attributes:{}}:Oo("generateAbstractIcon",T)||{children:[],attributes:{}},A=x.children,M=x.attributes;return T.children=A,T.attributes=M,a?wCe(T):bCe(T)}function RR(t){var e=t.content,n=t.width,s=t.height,i=t.transform,r=t.title,o=t.extra,a=t.watchable,l=a===void 0?!1:a,c=We(We(We({},o.attributes),r?{title:r}:{}),{},{class:o.classes.join(" ")});l&&(c[uc]="");var u=We({},o.styles);l2(i)&&(u.transform=Q5e({transform:i,startCentered:!0,width:n,height:s}),u["-webkit-transform"]=u.transform);var d=F0(u);d.length>0&&(c.style=d);var h=[];return h.push({tag:"span",attributes:c,children:[e]}),r&&h.push({tag:"span",attributes:{class:"sr-only"},children:[r]}),h}function xCe(t){var e=t.content,n=t.title,s=t.extra,i=We(We(We({},s.attributes),n?{title:n}:{}),{},{class:s.classes.join(" ")}),r=F0(s.styles);r.length>0&&(i.style=r);var o=[];return o.push({tag:"span",attributes:i,children:[e]}),n&&o.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),o}var Vv=Qi.styles;function Ib(t){var e=t[0],n=t[1],s=t.slice(4),i=n2(s,1),r=i[0],o=null;return Array.isArray(r)?o={tag:"g",attributes:{class:"".concat(Xe.cssPrefix,"-").concat(zl.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Xe.cssPrefix,"-").concat(zl.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(Xe.cssPrefix,"-").concat(zl.PRIMARY),fill:"currentColor",d:r[1]}}]}:o={tag:"path",attributes:{fill:"currentColor",d:r}},{found:!0,width:e,height:n,icon:o}}var SCe={found:!1,width:512,height:512};function ECe(t,e){!qI&&!Xe.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(e,'" is missing.'))}function Lb(t,e){var n=e;return e==="fa"&&Xe.styleDefault!==null&&(e=Va()),new Promise(function(s,i){if(Oo("missingIconAbstract"),n==="fa"){var r=o6(t)||{};t=r.iconName||t,e=r.prefix||e}if(t&&e&&Vv[e]&&Vv[e][t]){var o=Vv[e][t];return s(Ib(o))}ECe(t,e),s(We(We({},SCe),{},{icon:Xe.showMissingIcons&&t?Oo("missingIconAbstract")||{}:{}}))})}var kR=function(){},Db=Xe.measurePerformance&&km&&km.mark&&km.measure?km:{mark:kR,measure:kR},Rh='FA "6.5.2"',TCe=function(e){return Db.mark("".concat(Rh," ").concat(e," begins")),function(){return l6(e)}},l6=function(e){Db.mark("".concat(Rh," ").concat(e," ends")),Db.measure("".concat(Rh," ").concat(e),"".concat(Rh," ").concat(e," begins"),"".concat(Rh," ").concat(e," ends"))},f2={begin:TCe,end:l6},gg=function(){};function CR(t){var e=t.getAttribute?t.getAttribute(uc):null;return typeof e=="string"}function ACe(t){var e=t.getAttribute?t.getAttribute(i2):null,n=t.getAttribute?t.getAttribute(r2):null;return e&&n}function MCe(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(Xe.replacementClass)}function RCe(){if(Xe.autoReplaceSvg===!0)return _g.replace;var t=_g[Xe.autoReplaceSvg];return t||_g.replace}function kCe(t){return hn.createElementNS("http://www.w3.org/2000/svg",t)}function CCe(t){return hn.createElement(t)}function c6(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.ceFn,s=n===void 0?t.tag==="svg"?kCe:CCe:n;if(typeof t=="string")return hn.createTextNode(t);var i=s(t.tag);Object.keys(t.attributes||[]).forEach(function(o){i.setAttribute(o,t.attributes[o])});var r=t.children||[];return r.forEach(function(o){i.appendChild(c6(o,{ceFn:s}))}),i}function PCe(t){var e=" ".concat(t.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}var _g={replace:function(e){var n=e[0];if(n.parentNode)if(e[1].forEach(function(i){n.parentNode.insertBefore(c6(i),n)}),n.getAttribute(uc)===null&&Xe.keepOriginalSource){var s=hn.createComment(PCe(n));n.parentNode.replaceChild(s,n)}else n.remove()},nest:function(e){var n=e[0],s=e[1];if(~a2(n).indexOf(Xe.replacementClass))return _g.replace(e);var i=new RegExp("".concat(Xe.cssPrefix,"-.*"));if(delete s[0].attributes.id,s[0].attributes.class){var r=s[0].attributes.class.split(" ").reduce(function(a,l){return l===Xe.replacementClass||l.match(i)?a.toSvg.push(l):a.toNode.push(l),a},{toNode:[],toSvg:[]});s[0].attributes.class=r.toSvg.join(" "),r.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",r.toNode.join(" "))}var o=s.map(function(a){return cp(a)}).join(` +`);n.setAttribute(uc,""),n.innerHTML=o}};function PR(t){t()}function u6(t,e){var n=typeof e=="function"?e:gg;if(t.length===0)n();else{var s=PR;Xe.mutateApproach===N5e&&(s=za.requestAnimationFrame||PR),s(function(){var i=RCe(),r=f2.begin("mutate");t.map(i),r(),n()})}}var p2=!1;function d6(){p2=!0}function Nb(){p2=!1}var p_=null;function OR(t){if(wR&&Xe.observeMutations){var e=t.treeCallback,n=e===void 0?gg:e,s=t.nodeCallback,i=s===void 0?gg:s,r=t.pseudoElementsCallback,o=r===void 0?gg:r,a=t.observeMutationsRoot,l=a===void 0?hn:a;p_=new wR(function(c){if(!p2){var u=Va();Ud(c).forEach(function(d){if(d.type==="childList"&&d.addedNodes.length>0&&!CR(d.addedNodes[0])&&(Xe.searchPseudoElements&&o(d.target),n(d.target)),d.type==="attributes"&&d.target.parentNode&&Xe.searchPseudoElements&&o(d.target.parentNode),d.type==="attributes"&&CR(d.target)&&~z5e.indexOf(d.attributeName))if(d.attributeName==="class"&&ACe(d.target)){var h=$0(a2(d.target)),f=h.prefix,v=h.iconName;d.target.setAttribute(i2,f||u),v&&d.target.setAttribute(r2,v)}else MCe(d.target)&&i(d.target)})}}),Uo&&p_.observe(l,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function OCe(){p_&&p_.disconnect()}function ICe(t){var e=t.getAttribute("style"),n=[];return e&&(n=e.split(";").reduce(function(s,i){var r=i.split(":"),o=r[0],a=r.slice(1);return o&&a.length>0&&(s[o]=a.join(":").trim()),s},{})),n}function LCe(t){var e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),s=t.innerText!==void 0?t.innerText.trim():"",i=$0(a2(t));return i.prefix||(i.prefix=Va()),e&&n&&(i.prefix=e,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&s.length>0&&(i.iconName=dCe(i.prefix,t.innerText)||u2(i.prefix,kb(t.innerText))),!i.iconName&&Xe.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=t.firstChild.data)),i}function DCe(t){var e=Ud(t.attributes).reduce(function(i,r){return i.name!=="class"&&i.name!=="style"&&(i[r.name]=r.value),i},{}),n=t.getAttribute("title"),s=t.getAttribute("data-fa-title-id");return Xe.autoA11y&&(n?e["aria-labelledby"]="".concat(Xe.replacementClass,"-title-").concat(s||If()):(e["aria-hidden"]="true",e.focusable="false")),e}function NCe(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Er,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function IR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=LCe(t),s=n.iconName,i=n.prefix,r=n.rest,o=DCe(t),a=Pb("parseNodeAttributes",{},t),l=e.styleParser?ICe(t):[];return We({iconName:s,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:i,transform:Er,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:r,styles:l,attributes:o}},a)}var FCe=Qi.styles;function h6(t){var e=Xe.autoReplaceSvg==="nest"?IR(t,{styleParser:!1}):IR(t);return~e.extra.classes.indexOf(YI)?Oo("generateLayersText",t,e):Oo("generateSvgReplacementMutation",t,e)}var Wa=new Set;o2.map(function(t){Wa.add("fa-".concat(t))});Object.keys(kf[dn]).map(Wa.add.bind(Wa));Object.keys(kf[Sn]).map(Wa.add.bind(Wa));Wa=ap(Wa);function LR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Uo)return Promise.resolve();var n=hn.documentElement.classList,s=function(d){return n.add("".concat(xR,"-").concat(d))},i=function(d){return n.remove("".concat(xR,"-").concat(d))},r=Xe.autoFetchSvg?Wa:o2.map(function(u){return"fa-".concat(u)}).concat(Object.keys(FCe));r.includes("fa")||r.push("fa");var o=[".".concat(YI,":not([").concat(uc,"])")].concat(r.map(function(u){return".".concat(u,":not([").concat(uc,"])")})).join(", ");if(o.length===0)return Promise.resolve();var a=[];try{a=Ud(t.querySelectorAll(o))}catch{}if(a.length>0)s("pending"),i("complete");else return Promise.resolve();var l=f2.begin("onTree"),c=a.reduce(function(u,d){try{var h=h6(d);h&&u.push(h)}catch(f){qI||f.name==="MissingIcon"&&console.error(f)}return u},[]);return new Promise(function(u,d){Promise.all(c).then(function(h){u6(h,function(){s("active"),s("complete"),i("pending"),typeof e=="function"&&e(),l(),u()})}).catch(function(h){l(),d(h)})})}function UCe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;h6(t).then(function(n){n&&u6([n],e)})}function $Ce(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(e||{}).icon?e:Ob(e||{}),i=n.mask;return i&&(i=(i||{}).icon?i:Ob(i||{})),t(s,We(We({},n),{},{mask:i}))}}var BCe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.transform,i=s===void 0?Er:s,r=n.symbol,o=r===void 0?!1:r,a=n.mask,l=a===void 0?null:a,c=n.maskId,u=c===void 0?null:c,d=n.title,h=d===void 0?null:d,f=n.titleId,v=f===void 0?null:f,_=n.classes,m=_===void 0?[]:_,g=n.attributes,y=g===void 0?{}:g,b=n.styles,w=b===void 0?{}:b;if(e){var T=e.prefix,x=e.iconName,A=e.icon;return B0(We({type:"icon"},e),function(){return dc("beforeDOMElementCreation",{iconDefinition:e,params:n}),Xe.autoA11y&&(h?y["aria-labelledby"]="".concat(Xe.replacementClass,"-title-").concat(v||If()):(y["aria-hidden"]="true",y.focusable="false")),h2({icons:{main:Ib(A),mask:l?Ib(l.icon):{found:!1,width:null,height:null,icon:{}}},prefix:T,iconName:x,transform:We(We({},Er),i),symbol:o,title:h,maskId:u,titleId:v,extra:{attributes:y,styles:w,classes:m}})})}},HCe={mixout:function(){return{icon:$Ce(BCe)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=LR,n.nodeCallback=UCe,n}}},provides:function(e){e.i2svg=function(n){var s=n.node,i=s===void 0?hn:s,r=n.callback,o=r===void 0?function(){}:r;return LR(i,o)},e.generateSvgReplacementMutation=function(n,s){var i=s.iconName,r=s.title,o=s.titleId,a=s.prefix,l=s.transform,c=s.symbol,u=s.mask,d=s.maskId,h=s.extra;return new Promise(function(f,v){Promise.all([Lb(i,a),u.iconName?Lb(u.iconName,u.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(_){var m=n2(_,2),g=m[0],y=m[1];f([n,h2({icons:{main:g,mask:y},prefix:a,iconName:i,transform:l,symbol:c,maskId:d,title:r,titleId:o,extra:h,watchable:!0})])}).catch(v)})},e.generateAbstractIcon=function(n){var s=n.children,i=n.attributes,r=n.main,o=n.transform,a=n.styles,l=F0(a);l.length>0&&(i.style=l);var c;return l2(o)&&(c=Oo("generateAbstractTransformGrouping",{main:r,transform:o,containerWidth:r.width,iconWidth:r.width})),s.push(c||r.icon),{children:s,attributes:i}}}},GCe={mixout:function(){return{layer:function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.classes,r=i===void 0?[]:i;return B0({type:"layer"},function(){dc("beforeDOMElementCreation",{assembler:n,params:s});var o=[];return n(function(a){Array.isArray(a)?a.map(function(l){o=o.concat(l.abstract)}):o=o.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(Xe.cssPrefix,"-layers")].concat(ap(r)).join(" ")},children:o}]})}}}},zCe={mixout:function(){return{counter:function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.title,r=i===void 0?null:i,o=s.classes,a=o===void 0?[]:o,l=s.attributes,c=l===void 0?{}:l,u=s.styles,d=u===void 0?{}:u;return B0({type:"counter",content:n},function(){return dc("beforeDOMElementCreation",{content:n,params:s}),xCe({content:n.toString(),title:r,extra:{attributes:c,styles:d,classes:["".concat(Xe.cssPrefix,"-layers-counter")].concat(ap(a))}})})}}}},VCe={mixout:function(){return{text:function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.transform,r=i===void 0?Er:i,o=s.title,a=o===void 0?null:o,l=s.classes,c=l===void 0?[]:l,u=s.attributes,d=u===void 0?{}:u,h=s.styles,f=h===void 0?{}:h;return B0({type:"text",content:n},function(){return dc("beforeDOMElementCreation",{content:n,params:s}),RR({content:n,transform:We(We({},Er),r),title:a,extra:{attributes:d,styles:f,classes:["".concat(Xe.cssPrefix,"-layers-text")].concat(ap(c))}})})}}},provides:function(e){e.generateLayersText=function(n,s){var i=s.title,r=s.transform,o=s.extra,a=null,l=null;if(VI){var c=parseInt(getComputedStyle(n).fontSize,10),u=n.getBoundingClientRect();a=u.width/c,l=u.height/c}return Xe.autoA11y&&!i&&(o.attributes["aria-hidden"]="true"),Promise.resolve([n,RR({content:n.innerHTML,width:a,height:l,transform:r,title:i,extra:o,watchable:!0})])}}},WCe=new RegExp('"',"ug"),DR=[1105920,1112319];function jCe(t){var e=t.replace(WCe,""),n=rCe(e,0),s=n>=DR[0]&&n<=DR[1],i=e.length===2?e[0]===e[1]:!1;return{value:kb(i?e[0]:e),isSecondary:s||i}}function NR(t,e){var n="".concat(D5e).concat(e.replace(":","-"));return new Promise(function(s,i){if(t.getAttribute(n)!==null)return s();var r=Ud(t.children),o=r.filter(function(A){return A.getAttribute(Rb)===e})[0],a=za.getComputedStyle(t,e),l=a.getPropertyValue("font-family").match(B5e),c=a.getPropertyValue("font-weight"),u=a.getPropertyValue("content");if(o&&!l)return t.removeChild(o),s();if(l&&u!=="none"&&u!==""){var d=a.getPropertyValue("content"),h=~["Sharp"].indexOf(l[2])?Sn:dn,f=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(l[2])?Cf[h][l[2].toLowerCase()]:H5e[h][c],v=jCe(d),_=v.value,m=v.isSecondary,g=l[0].startsWith("FontAwesome"),y=u2(f,_),b=y;if(g){var w=hCe(_);w.iconName&&w.prefix&&(y=w.iconName,f=w.prefix)}if(y&&!m&&(!o||o.getAttribute(i2)!==f||o.getAttribute(r2)!==b)){t.setAttribute(n,b),o&&t.removeChild(o);var T=NCe(),x=T.extra;x.attributes[Rb]=e,Lb(y,f).then(function(A){var M=h2(We(We({},T),{},{icons:{main:A,mask:d2()},prefix:f,iconName:b,extra:x,watchable:!0})),E=hn.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?t.insertBefore(E,t.firstChild):t.appendChild(E),E.outerHTML=M.map(function(S){return cp(S)}).join(` +`),t.removeAttribute(n),s()}).catch(i)}else s()}else s()})}function qCe(t){return Promise.all([NR(t,"::before"),NR(t,"::after")])}function YCe(t){return t.parentNode!==document.head&&!~F5e.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(Rb)&&(!t.parentNode||t.parentNode.tagName!=="svg")}function FR(t){if(Uo)return new Promise(function(e,n){var s=Ud(t.querySelectorAll("*")).filter(YCe).map(qCe),i=f2.begin("searchPseudoElements");d6(),Promise.all(s).then(function(){i(),Nb(),e()}).catch(function(){i(),Nb(),n()})})}var XCe={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=FR,n}}},provides:function(e){e.pseudoElements2svg=function(n){var s=n.node,i=s===void 0?hn:s;Xe.searchPseudoElements&&FR(i)}}},UR=!1,KCe={mixout:function(){return{dom:{unwatch:function(){d6(),UR=!0}}}},hooks:function(){return{bootstrap:function(){OR(Pb("mutationObserverCallbacks",{}))},noAuto:function(){OCe()},watch:function(n){var s=n.observeMutationsRoot;UR?Nb():OR(Pb("mutationObserverCallbacks",{observeMutationsRoot:s}))}}}},$R=function(e){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce(function(s,i){var r=i.toLowerCase().split("-"),o=r[0],a=r.slice(1).join("-");if(o&&a==="h")return s.flipX=!0,s;if(o&&a==="v")return s.flipY=!0,s;if(a=parseFloat(a),isNaN(a))return s;switch(o){case"grow":s.size=s.size+a;break;case"shrink":s.size=s.size-a;break;case"left":s.x=s.x-a;break;case"right":s.x=s.x+a;break;case"up":s.y=s.y-a;break;case"down":s.y=s.y+a;break;case"rotate":s.rotate=s.rotate+a;break}return s},n)},ZCe={mixout:function(){return{parse:{transform:function(n){return $R(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,s){var i=s.getAttribute("data-fa-transform");return i&&(n.transform=$R(i)),n}}},provides:function(e){e.generateAbstractTransformGrouping=function(n){var s=n.main,i=n.transform,r=n.containerWidth,o=n.iconWidth,a={transform:"translate(".concat(r/2," 256)")},l="translate(".concat(i.x*32,", ").concat(i.y*32,") "),c="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),u="rotate(".concat(i.rotate," 0 0)"),d={transform:"".concat(l," ").concat(c," ").concat(u)},h={transform:"translate(".concat(o/2*-1," -256)")},f={outer:a,inner:d,path:h};return{tag:"g",attributes:We({},f.outer),children:[{tag:"g",attributes:We({},f.inner),children:[{tag:s.icon.tag,children:s.icon.children,attributes:We(We({},s.icon.attributes),f.path)}]}]}}}},Wv={x:0,y:0,width:"100%",height:"100%"};function BR(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}function JCe(t){return t.tag==="g"?t.children:[t]}var QCe={hooks:function(){return{parseNodeAttributes:function(n,s){var i=s.getAttribute("data-fa-mask"),r=i?$0(i.split(" ").map(function(o){return o.trim()})):d2();return r.prefix||(r.prefix=Va()),n.mask=r,n.maskId=s.getAttribute("data-fa-mask-id"),n}}},provides:function(e){e.generateAbstractMask=function(n){var s=n.children,i=n.attributes,r=n.main,o=n.mask,a=n.maskId,l=n.transform,c=r.width,u=r.icon,d=o.width,h=o.icon,f=J5e({transform:l,containerWidth:d,iconWidth:c}),v={tag:"rect",attributes:We(We({},Wv),{},{fill:"white"})},_=u.children?{children:u.children.map(BR)}:{},m={tag:"g",attributes:We({},f.inner),children:[BR(We({tag:u.tag,attributes:We(We({},u.attributes),f.path)},_))]},g={tag:"g",attributes:We({},f.outer),children:[m]},y="mask-".concat(a||If()),b="clip-".concat(a||If()),w={tag:"mask",attributes:We(We({},Wv),{},{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[v,g]},T={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:JCe(h)},w]};return s.push(T,{tag:"rect",attributes:We({fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(y,")")},Wv)}),{children:s,attributes:i}}}},e8e={provides:function(e){var n=!1;za.matchMedia&&(n=za.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var s=[],i={fill:"currentColor"},r={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};s.push({tag:"path",attributes:We(We({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var o=We(We({},r),{},{attributeName:"opacity"}),a={tag:"circle",attributes:We(We({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||a.children.push({tag:"animate",attributes:We(We({},r),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:We(We({},o),{},{values:"1;0;1;1;0;1;"})}),s.push(a),s.push({tag:"path",attributes:We(We({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:We(We({},o),{},{values:"1;0;0;0;0;1;"})}]}),n||s.push({tag:"path",attributes:We(We({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:We(We({},o),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:s}}}},t8e={hooks:function(){return{parseNodeAttributes:function(n,s){var i=s.getAttribute("data-fa-symbol"),r=i===null?!1:i===""?!0:i;return n.symbol=r,n}}}},n8e=[tCe,HCe,GCe,zCe,VCe,XCe,KCe,ZCe,QCe,e8e,t8e];mCe(n8e,{mixoutsTo:hi});hi.noAuto;hi.config;var s8e=hi.library;hi.dom;var Fb=hi.parse;hi.findIconDefinition;hi.toHtml;var i8e=hi.icon;hi.layer;hi.text;hi.counter;function HR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function lo(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function o8e(t,e){if(t==null)return{};var n=r8e(t,e),s,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(n[s]=t[s])}return n}function a8e(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,e||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function l8e(t){var e=a8e(t,"string");return typeof e=="symbol"?e:String(e)}var c8e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},f6={exports:{}};(function(t){(function(e){var n=function(g,y,b){if(!c(y)||d(y)||h(y)||f(y)||l(y))return y;var w,T=0,x=0;if(u(y))for(w=[],x=y.length;T1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var s=(t.children||[]).map(function(l){return p6(l)}),i=Object.keys(t.attributes||{}).reduce(function(l,c){var u=t.attributes[c];switch(c){case"class":l.class=f8e(u);break;case"style":l.style=h8e(u);break;default:l.attrs[c]=u}return l},{attrs:{},class:{},style:{}});n.class;var r=n.style,o=r===void 0?{}:r,a=o8e(n,d8e);return nc(t.tag,lo(lo(lo({},e),{},{class:i.class,style:lo(lo({},i.style),o)},i.attrs),a),s)}var m6=!1;try{m6=!0}catch{}function p8e(){if(!m6&&console&&typeof console.error=="function"){var t;(t=console).error.apply(t,arguments)}}function jv(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?Ds({},t,e):{}}function m8e(t){var e,n=(e={"fa-spin":t.spin,"fa-pulse":t.pulse,"fa-fw":t.fixedWidth,"fa-border":t.border,"fa-li":t.listItem,"fa-inverse":t.inverse,"fa-flip":t.flip===!0,"fa-flip-horizontal":t.flip==="horizontal"||t.flip==="both","fa-flip-vertical":t.flip==="vertical"||t.flip==="both"},Ds(e,"fa-".concat(t.size),t.size!==null),Ds(e,"fa-rotate-".concat(t.rotation),t.rotation!==null),Ds(e,"fa-pull-".concat(t.pull),t.pull!==null),Ds(e,"fa-swap-opacity",t.swapOpacity),Ds(e,"fa-bounce",t.bounce),Ds(e,"fa-shake",t.shake),Ds(e,"fa-beat",t.beat),Ds(e,"fa-fade",t.fade),Ds(e,"fa-beat-fade",t.beatFade),Ds(e,"fa-flash",t.flash),Ds(e,"fa-spin-pulse",t.spinPulse),Ds(e,"fa-spin-reverse",t.spinReverse),e);return Object.keys(n).map(function(s){return n[s]?s:null}).filter(function(s){return s})}function GR(t){if(t&&m_(t)==="object"&&t.prefix&&t.iconName&&t.icon)return t;if(Fb.icon)return Fb.icon(t);if(t===null)return null;if(m_(t)==="object"&&t.prefix&&t.iconName)return t;if(Array.isArray(t)&&t.length===2)return{prefix:t[0],iconName:t[1]};if(typeof t=="string")return{prefix:"fas",iconName:t}}var g8e=it({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(e){return[!0,!1,"horizontal","vertical","both"].indexOf(e)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},maskId:{type:String,default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(e){return["right","left"].indexOf(e)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(e){return[90,180,270].indexOf(Number.parseInt(e,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(e){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(e)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},titleId:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(e,n){var s=n.attrs,i=kn(function(){return GR(e.icon)}),r=kn(function(){return jv("classes",m8e(e))}),o=kn(function(){return jv("transform",typeof e.transform=="string"?Fb.transform(e.transform):e.transform)}),a=kn(function(){return jv("mask",GR(e.mask))}),l=kn(function(){return i8e(i.value,lo(lo(lo(lo({},r.value),o.value),a.value),{},{symbol:e.symbol,title:e.title,titleId:e.titleId,maskId:e.maskId}))});Zl(l,function(u){if(!u)return p8e("Could not find one or more icon(s)",i.value,a.value)},{immediate:!0});var c=kn(function(){return l.value?p6(l.value.abstract[0],{},s):null});return function(){return c.value}}}),_8e={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},v8e={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},y8e={prefix:"fas",iconName:"upload",icon:[512,512,[],"f093","M288 109.3V352c0 17.7-14.3 32-32 32s-32-14.3-32-32V109.3l-73.4 73.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l128-128c12.5-12.5 32.8-12.5 45.3 0l128 128c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L288 109.3zM64 352H192c0 35.3 28.7 64 64 64s64-28.7 64-64H448c35.3 0 64 28.7 64 64v32c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V416c0-35.3 28.7-64 64-64zM432 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]},b8e={prefix:"fas",iconName:"spinner",icon:[512,512,[],"f110","M304 48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm0 416a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM48 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm464-48a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM142.9 437A48 48 0 1 0 75 369.1 48 48 0 1 0 142.9 437zm0-294.2A48 48 0 1 0 75 75a48 48 0 1 0 67.9 67.9zM369.1 437A48 48 0 1 0 437 369.1 48 48 0 1 0 369.1 437z"]},w8e={prefix:"fas",iconName:"file-export",icon:[576,512,["arrow-right-from-file"],"f56e","M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V288H216c-13.3 0-24 10.7-24 24s10.7 24 24 24H384V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM384 336V288H494.1l-39-39c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l80 80c9.4 9.4 9.4 24.6 0 33.9l-80 80c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l39-39H384zm0-208H256V0L384 128z"]},x8e={prefix:"fas",iconName:"cloud-moon",icon:[640,512,[],"f6c3","M495.8 0c5.5 0 10.9 .2 16.3 .7c7 .6 12.8 5.7 14.3 12.5s-1.6 13.9-7.7 17.3c-44.4 25.2-74.4 73-74.4 127.8c0 81 65.5 146.6 146.2 146.6c8.6 0 17-.7 25.1-2.1c6.9-1.2 13.8 2.2 17 8.5s1.9 13.8-3.1 18.7c-34.5 33.6-81.7 54.4-133.6 54.4c-9.3 0-18.4-.7-27.4-1.9c-11.2-22.6-29.8-40.9-52.6-51.7c-2.7-58.5-50.3-105.3-109.2-106.7c-1.7-10.4-2.6-21-2.6-31.8C304 86.1 389.8 0 495.8 0zM447.9 431.9c0 44.2-35.8 80-80 80H96c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]},S8e={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},E8e={prefix:"fas",iconName:"cloud-sun",icon:[640,512,[9925],"f6c4","M294.2 1.2c5.1 2.1 8.7 6.7 9.6 12.1l14.1 84.7 84.7 14.1c5.4 .9 10 4.5 12.1 9.6s1.5 10.9-1.6 15.4l-38.5 55c-2.2-.1-4.4-.2-6.7-.2c-23.3 0-45.1 6.2-64 17.1l0-1.1c0-53-43-96-96-96s-96 43-96 96s43 96 96 96c8.1 0 15.9-1 23.4-2.9c-36.6 18.1-63.3 53.1-69.8 94.9l-24.4 17c-4.5 3.1-10.3 3.8-15.4 1.6s-8.7-6.7-9.6-12.1L98.1 317.9 13.4 303.8c-5.4-.9-10-4.5-12.1-9.6s-1.5-10.9 1.6-15.4L52.5 208 2.9 137.2c-3.2-4.5-3.8-10.3-1.6-15.4s6.7-8.7 12.1-9.6L98.1 98.1l14.1-84.7c.9-5.4 4.5-10 9.6-12.1s10.9-1.5 15.4 1.6L208 52.5 278.8 2.9c4.5-3.2 10.3-3.8 15.4-1.6zM144 208a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM639.9 431.9c0 44.2-35.8 80-80 80H288c-53 0-96-43-96-96c0-47.6 34.6-87 80-94.6l0-1.3c0-53 43-96 96-96c34.9 0 65.4 18.6 82.2 46.4c13-9.1 28.8-14.4 45.8-14.4c44.2 0 80 35.8 80 80c0 5.9-.6 11.7-1.9 17.2c37.4 6.7 65.8 39.4 65.8 78.7z"]},T8e={prefix:"far",iconName:"pen-to-square",icon:[512,512,["edit"],"f044","M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152V424c0 48.6 39.4 88 88 88H360c48.6 0 88-39.4 88-88V312c0-13.3-10.7-24-24-24s-24 10.7-24 24V424c0 22.1-17.9 40-40 40H88c-22.1 0-40-17.9-40-40V152c0-22.1 17.9-40 40-40H200c13.3 0 24-10.7 24-24s-10.7-24-24-24H88z"]};s8e.add(_8e,S8e,y8e,x8e,E8e,v8e,T8e,w8e,b8e);class A8e{constructor(){Te(this,"state",ud({isShown:!1,resolve:void 0,component:void 0,props:{}}))}get isShown(){return this.state.isShown}get component(){return this.state.component}get props(){return this.state.props}show(e,n){return this.state.props=n||{},this.state.component=E_(e),this.state.isShown=!0,new Promise(s=>{this.state.resolve=s})}close(e){this.state.resolve&&this.state.resolve(e),this.state.isShown=!1,this.state.component=void 0,this.state.resolve=void 0,this.state.props={}}}const M8e={install(t){t.config.globalProperties.$modal=new A8e}};/*! + * chartjs-adapter-moment v1.0.1 + * https://www.chartjs.org + * (c) 2022 chartjs-adapter-moment Contributors + * Released under the MIT license + */const R8e={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};Y8._date.override(typeof Ue=="function"?{_id:"moment",formats:function(){return R8e},parse:function(t,e){return typeof t=="string"&&typeof e=="string"?t=Ue(t,e):t instanceof Ue||(t=Ue(t)),t.isValid()?t.valueOf():null},format:function(t,e){return Ue(t).format(e)},add:function(t,e,n){return Ue(t).add(e,n).valueOf()},diff:function(t,e,n){return Ue(t).diff(Ue(e),n)},startOf:function(t,e,n){return t=Ue(t),e==="isoWeek"?(n=Math.trunc(Math.min(Math.max(0,n),6)),t.isoWeekday(n).startOf("day").valueOf()):t.startOf(e).valueOf()},endOf:function(t,e){return Ue(t).endOf(e).valueOf()}}:{});S0.register(Joe,Koe,oae,ag,Eh,Sf,Yy,qy);const tl=XD(t5e);tl.component("spinner-btn",r5e);tl.component("tooltip",y5e);tl.component("input-select",E5e);tl.component("FontAwesomeIcon",g8e);tl.use($I);tl.use(so);tl.use(M8e);tl.mount("#app");export{eN as _}; diff --git a/assets/virtual_pwa-register-C8olz8gX.js b/assets/virtual_pwa-register-C8olz8gX.js new file mode 100644 index 0000000..dcd4cac --- /dev/null +++ b/assets/virtual_pwa-register-C8olz8gX.js @@ -0,0 +1 @@ +import{_ as f}from"./index-BNlDA3OC.js";function g(p={}){const{immediate:u=!1,onNeedRefresh:n,onOfflineReady:i,onRegistered:l,onRegisteredSW:o,onRegisterError:s}=p;let t,c,r;const w=async(e=!0)=>{await c,await(r==null?void 0:r())};async function _(){if("serviceWorker"in navigator){if(t=await f(()=>import("./workbox-window.prod.es5-D5gOYdM7.js"),[]).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{s==null||s(e)}),!t)return;r=async()=>{await(t==null?void 0:t.messageSkipWaiting())};{let e=!1;const d=()=>{e=!0,t==null||t.addEventListener("controlling",a=>{a.isUpdate&&window.location.reload()}),n==null||n()};t.addEventListener("installed",a=>{typeof a.isUpdate>"u"?typeof a.isExternal<"u"?a.isExternal?d():!e&&(i==null||i()):a.isExternal?window.location.reload():!e&&(i==null||i()):a.isUpdate||i==null||i()}),t.addEventListener("waiting",d),t.addEventListener("externalwaiting",d)}t.register({immediate:u}).then(e=>{o?o("/sw.js",e):l==null||l(e)}).catch(e=>{s==null||s(e)})}}return c=_(),w}export{g as registerSW}; diff --git a/index.html b/index.html index e74aaff..e6fdda8 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ - + diff --git a/sw.js b/sw.js index aeeb79d..211c616 100644 --- a/sw.js +++ b/sw.js @@ -1,2 +1,2 @@ (function(){"use strict";try{self["workbox:core:7.0.0"]&&_()}catch{}const le=null,x=(a,...e)=>{let t=a;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t};class l extends Error{constructor(e,t){const s=x(e,t);super(s),this.name=e,this.details=t}}const E=new Set,f={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},b=a=>[f.prefix,a,f.suffix].filter(e=>e&&e.length>0).join("-"),O=a=>{for(const e of Object.keys(f))a(e)},m={updateDetails:a=>{O(e=>{typeof a[e]=="string"&&(f[e]=a[e])})},getGoogleAnalyticsName:a=>a||b(f.googleAnalytics),getPrecacheName:a=>a||b(f.precache),getPrefix:()=>f.prefix,getRuntimeName:a=>a||b(f.runtime),getSuffix:()=>f.suffix};function L(a,e){const t=new URL(a);for(const s of e)t.searchParams.delete(s);return t.href}async function I(a,e,t,s){const n=L(e.url,t);if(e.url===n)return a.match(e,s);const r=Object.assign(Object.assign({},s),{ignoreSearch:!0}),c=await a.keys(e,r);for(const i of c){const o=L(i.url,t);if(n===o)return a.match(i,s)}}let g;function M(){if(g===void 0){const a=new Response("");if("body"in a)try{new Response(a.body),g=!0}catch{g=!1}g=!1}return g}class W{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function A(){for(const a of E)await a()}const D=a=>new URL(String(a),location.href).href.replace(new RegExp(`^${location.origin}`),"");function S(a){return new Promise(e=>setTimeout(e,a))}function k(a,e){const t=e();return a.waitUntil(t),t}async function q(a,e){let t=null;if(a.url&&(t=new URL(a.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const s=a.clone(),r={headers:new Headers(s.headers),status:s.status,statusText:s.statusText},c=M()?s.body:await s.blob();return new Response(c,r)}function j(){self.addEventListener("activate",()=>self.clients.claim())}try{self["workbox:routing:7.0.0"]&&_()}catch{}const P="GET",R=a=>a&&typeof a=="object"?a:{handle:a};class p{constructor(e,t,s=P){this.handler=R(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=R(e)}}class F extends p{constructor(e,t,s){const n=({url:r})=>{const c=e.exec(r.href);if(c&&!(r.origin!==location.origin&&c.index!==0))return c.slice(1)};super(n,t,s)}}class H{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,s=Promise.all(t.urlsToCache.map(n=>{typeof n=="string"&&(n=[n]);const r=new Request(...n);return this.handleRequest({request:r,event:e})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:c}=this.findMatchingRoute({event:t,request:e,sameOrigin:n,url:s});let i=c&&c.handler;const o=e.method;if(!i&&this._defaultHandlerMap.has(o)&&(i=this._defaultHandlerMap.get(o)),!i)return;let h;try{h=i.handle({url:s,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const w=c&&c.catchHandler;return h instanceof Promise&&(this._catchHandler||w)&&(h=h.catch(async u=>{if(w)try{return await w.handle({url:s,request:e,event:t,params:r})}catch(N){N instanceof Error&&(u=N)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:s,event:n}){const r=this._routes.get(s.method)||[];for(const c of r){let i;const o=c.match({url:e,sameOrigin:t,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(i=void 0),{route:c,params:i}}return{}}setDefaultHandler(e,t=P){this._defaultHandlerMap.set(t,R(e))}setCatchHandler(e){this._catchHandler=R(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let y;const B=()=>(y||(y=new H,y.addFetchListener(),y.addCacheListener()),y);function K(a,e,t){let s;if(typeof a=="string"){const r=new URL(a,location.href),c=({url:i})=>i.href===r.href;s=new p(c,e,t)}else if(a instanceof RegExp)s=new F(a,e,t);else if(typeof a=="function")s=new p(a,e,t);else if(a instanceof p)s=a;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return B().registerRoute(s),s}try{self["workbox:strategies:7.0.0"]&&_()}catch{}function C(a){return typeof a=="string"?new Request(a):a}class G{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new W,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const s of this._plugins)this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let s=C(e);if(s.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const c=await t.preloadResponse;if(c)return c}const n=this.hasCallback("fetchDidFail")?s.clone():null;try{for(const c of this.iterateCallbacks("requestWillFetch"))s=await c({request:s.clone(),event:t})}catch(c){if(c instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:c.message})}const r=s.clone();try{let c;c=await fetch(s,s.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const i of this.iterateCallbacks("fetchDidSucceed"))c=await i({event:t,request:r,response:c});return c}catch(c){throw n&&await this.runCallbacks("fetchDidFail",{error:c,event:t,originalRequest:n.clone(),request:r.clone()}),c}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=C(e);let s;const{cacheName:n,matchOptions:r}=this._strategy,c=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(c,i);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await o({cacheName:n,matchOptions:r,cachedResponse:s,request:c,event:this.event})||void 0;return s}async cachePut(e,t){const s=C(e);await S(0);const n=await this.getCacheKey(s,"write");if(!t)throw new l("cache-put-with-no-response",{url:D(n.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:c,matchOptions:i}=this._strategy,o=await self.caches.open(c),h=this.hasCallback("cacheDidUpdate"),w=h?await I(o,n.clone(),["__WB_REVISION__"],i):null;try{await o.put(n,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await A(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:c,oldResponse:w,newResponse:r.clone(),request:n,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let n=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))n=C(await r({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[s]=n}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const s=this._pluginStateMap.get(t);yield r=>{const c=Object.assign(Object.assign({},r),{state:s});return t[e](c)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const n of this.iterateCallbacks("cacheWillUpdate"))if(t=await n({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&t.status!==200&&(t=void 0),t}}class v{constructor(e={}){this.cacheName=m.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s=typeof e.request=="string"?new Request(e.request):e.request,n="params"in e?e.params:void 0,r=new G(this,{event:t,request:s,params:n}),c=this._getResponse(r,s,t),i=this._awaitComplete(c,r,s,t);return[c,i]}async _getResponse(e,t,s){await e.runCallbacks("handlerWillStart",{event:s,request:t});let n;try{if(n=await this._handle(t,e),!n||n.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const c of e.iterateCallbacks("handlerDidError"))if(n=await c({error:r,event:s,request:t}),n)break}if(!n)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))n=await r({event:s,request:t,response:n});return n}async _awaitComplete(e,t,s,n){let r,c;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:n,request:s,response:r}),await t.doneWaiting()}catch(i){i instanceof Error&&(c=i)}if(await t.runCallbacks("handlerDidComplete",{event:n,request:s,response:r,error:c}),t.destroy(),c)throw c}}const V={cacheWillUpdate:async({response:a})=>a.status===200||a.status===0?a:null};class $ extends v{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(V)}async _handle(e,t){const s=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(s);let n=await t.cacheMatch(e),r;if(!n)try{n=await s}catch(c){c instanceof Error&&(r=c)}if(!n)throw new l("no-response",{url:e.url,error:r});return n}}try{self["workbox:precaching:7.0.0"]&&_()}catch{}const Q="__WB_REVISION__";function z(a){if(!a)throw new l("add-to-cache-list-unexpected-type",{entry:a});if(typeof a=="string"){const r=new URL(a,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=a;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:a});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const s=new URL(t,location.href),n=new URL(t,location.href);return s.searchParams.set(Q,e),{cacheKey:s.href,url:n.href}}class J{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const n=t.originalRequest.url;s?this.notUpdatedURLs.push(n):this.updatedURLs.push(n)}return s}}}class X{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:s})=>{const n=(s==null?void 0:s.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return n?new Request(n,{headers:t.headers}):t},this._precacheController=e}}class d extends v{constructor(e={}){e.cacheName=m.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(d.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let s;const n=t.params||{};if(this._fallbackToNetwork){const r=n.integrity,c=e.integrity,i=!c||c===r;s=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?c||r:void 0})),r&&i&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,s.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return s}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const s=await t.fetch(e);if(!await t.cachePut(e,s.clone()))throw new l("bad-precaching-response",{url:e.url,status:s.status});return s}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==d.copyRedirectedCacheableResponsesPlugin&&(n===d.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);t===0?this.plugins.push(d.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}d.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:a}){return!a||a.status>=400?null:a}},d.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:a}){return a.redirected?await q(a):a}};class Y{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new d({cacheName:m.getPrecacheName(e),plugins:[...t,new X({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const s of e){typeof s=="string"?t.push(s):s&&s.revision===void 0&&t.push(s.url);const{cacheKey:n,url:r}=z(s),c=typeof s!="string"&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==n)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:n});if(typeof s!="string"&&s.integrity){if(this._cacheKeysToIntegrities.has(n)&&this._cacheKeysToIntegrities.get(n)!==s.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(n,s.integrity)}if(this._urlsToCacheKeys.set(r,n),this._urlsToCacheModes.set(r,c),t.length>0){const i=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(i)}}}install(e){return k(e,async()=>{const t=new J;this.strategy.plugins.push(t);for(const[r,c]of this._urlsToCacheKeys){const i=this._cacheKeysToIntegrities.get(c),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:i,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:c},request:h,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}})}activate(e){return k(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),s=await t.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(const c of s)n.has(c.url)||(await t.delete(c),r.push(c.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let U;const T=()=>(U||(U=new Y),U);function Z(a,e=[]){for(const t of[...a.searchParams.keys()])e.some(s=>s.test(t))&&a.searchParams.delete(t);return a}function*ee(a,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:n}={}){const r=new URL(a,location.href);r.hash="",yield r.href;const c=Z(r,e);if(yield c.href,t&&c.pathname.endsWith("/")){const i=new URL(c.href);i.pathname+=t,yield i.href}if(s){const i=new URL(c.href);i.pathname+=".html",yield i.href}if(n){const i=n({url:r});for(const o of i)yield o.href}}class te extends p{constructor(e,t){const s=({request:n})=>{const r=e.getURLsToCacheKeys();for(const c of ee(n.url,t)){const i=r.get(c);if(i){const o=e.getIntegrityForCacheKey(i);return{cacheKey:i,integrity:o}}}};super(s,e.strategy)}}function se(a){const e=T(),t=new te(e,a);K(t)}const ae="-precache-",ne=async(a,e=ae)=>{const s=(await self.caches.keys()).filter(n=>n.includes(e)&&n.includes(self.registration.scope)&&n!==a);return await Promise.all(s.map(n=>self.caches.delete(n))),s};function re(){self.addEventListener("activate",a=>{const e=m.getPrecacheName();a.waitUntil(ne(e).then(t=>{}))})}function ce(a){T().precache(a)}function ie(a,e){ce(a),se(e)}const oe=["raw.githubusercontent.com","api.github.com","cors.bubblesort.me"];self.__WB_DISABLE_DEV_LOGS=!0,self.addEventListener("message",a=>{a.data&&a.data.type==="SKIP_WAITING"&&self.skipWaiting()}),j(),re(),K(({url:a})=>oe.includes(a.hostname),new $({cacheName:"github-cache",matchOptions:{ignoreVary:!0}})),ie([{"revision":null,"url":"assets/index-C77RKq0t.js"},{"revision":null,"url":"assets/index-DP3E9BYw.css"},{"revision":null,"url":"assets/virtual_pwa-register-Cna-cJwn.js"},{"revision":null,"url":"assets/workbox-window.prod.es5-D5gOYdM7.js"},{"revision":"ca3c32c449b692859f6793613d21e04d","url":"index.html"},{"revision":"2db5793b9be971d50e1a2076028daa6a","url":"pwa-192x192.png"},{"revision":"cab59206261b6d26308ef3dcfa06c135","url":"pwa-512x512.png"},{"revision":"dc6fe59e472af0f31ee12401319ad4d3","url":"manifest.webmanifest"}])})(); +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(i)}}}install(e){return k(e,async()=>{const t=new J;this.strategy.plugins.push(t);for(const[r,c]of this._urlsToCacheKeys){const i=this._cacheKeysToIntegrities.get(c),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:i,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:c},request:h,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}})}activate(e){return k(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),s=await t.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(const c of s)n.has(c.url)||(await t.delete(c),r.push(c.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let U;const T=()=>(U||(U=new Y),U);function Z(a,e=[]){for(const t of[...a.searchParams.keys()])e.some(s=>s.test(t))&&a.searchParams.delete(t);return a}function*ee(a,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:n}={}){const r=new URL(a,location.href);r.hash="",yield r.href;const c=Z(r,e);if(yield c.href,t&&c.pathname.endsWith("/")){const i=new URL(c.href);i.pathname+=t,yield i.href}if(s){const i=new URL(c.href);i.pathname+=".html",yield i.href}if(n){const i=n({url:r});for(const o of i)yield o.href}}class te extends p{constructor(e,t){const s=({request:n})=>{const r=e.getURLsToCacheKeys();for(const c of ee(n.url,t)){const i=r.get(c);if(i){const o=e.getIntegrityForCacheKey(i);return{cacheKey:i,integrity:o}}}};super(s,e.strategy)}}function se(a){const e=T(),t=new te(e,a);K(t)}const ae="-precache-",ne=async(a,e=ae)=>{const s=(await self.caches.keys()).filter(n=>n.includes(e)&&n.includes(self.registration.scope)&&n!==a);return await Promise.all(s.map(n=>self.caches.delete(n))),s};function re(){self.addEventListener("activate",a=>{const e=m.getPrecacheName();a.waitUntil(ne(e).then(t=>{}))})}function ce(a){T().precache(a)}function ie(a,e){ce(a),se(e)}const oe=["raw.githubusercontent.com","api.github.com","cors.bubblesort.me"];self.__WB_DISABLE_DEV_LOGS=!0,self.addEventListener("message",a=>{a.data&&a.data.type==="SKIP_WAITING"&&self.skipWaiting()}),j(),re(),K(({url:a})=>oe.includes(a.hostname),new $({cacheName:"github-cache",matchOptions:{ignoreVary:!0}})),ie([{"revision":null,"url":"assets/index-BNlDA3OC.js"},{"revision":null,"url":"assets/index-DP3E9BYw.css"},{"revision":null,"url":"assets/virtual_pwa-register-C8olz8gX.js"},{"revision":null,"url":"assets/workbox-window.prod.es5-D5gOYdM7.js"},{"revision":"21ea83864998457f06457a2aa3ae75e2","url":"index.html"},{"revision":"2db5793b9be971d50e1a2076028daa6a","url":"pwa-192x192.png"},{"revision":"cab59206261b6d26308ef3dcfa06c135","url":"pwa-512x512.png"},{"revision":"dc6fe59e472af0f31ee12401319ad4d3","url":"manifest.webmanifest"}])})();