codexapp 0.1.33 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1442 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
2
- * @vue/shared v3.5.30
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/function ba(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ut={},zr=[],kn=()=>{},vu=()=>!1,Uo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),_a=e=>e.startsWith("onUpdate:"),Et=Object.assign,ka=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},lh=Object.prototype.hasOwnProperty,rt=(e,t)=>lh.call(e,t),Oe=Array.isArray,Jr=e=>Qs(e)==="[object Map]",yu=e=>Qs(e)==="[object Set]",hl=e=>Qs(e)==="[object Date]",Ue=e=>typeof e=="function",_t=e=>typeof e=="string",ln=e=>typeof e=="symbol",st=e=>e!==null&&typeof e=="object",wu=e=>(st(e)||Ue(e))&&Ue(e.then)&&Ue(e.catch),bu=Object.prototype.toString,Qs=e=>bu.call(e),ch=e=>Qs(e).slice(8,-1),_u=e=>Qs(e)==="[object Object]",Ta=e=>_t(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,As=ba(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ho=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},uh=/-\w/g,Vt=Ho(e=>e.replace(uh,t=>t.slice(1).toUpperCase())),dh=/\B([A-Z])/g,lr=Ho(e=>e.replace(dh,"-$1").toLowerCase()),Vo=Ho(e=>e.charAt(0).toUpperCase()+e.slice(1)),li=Ho(e=>e?`on${Vo(e)}`:""),yn=(e,t)=>!Object.is(e,t),go=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ku=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ia=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fh=e=>{const t=_t(e)?Number(e):NaN;return isNaN(t)?e:t};let pl;const Wo=()=>pl||(pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Dr(e){if(Oe(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=_t(r)?gh(r):Dr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(_t(e)||st(e))return e}const hh=/;(?![^(]*\))/g,ph=/:([^]+)/,mh=/\/\*[^]*?\*\//g;function gh(e){const t={};return e.replace(mh,"").split(hh).forEach(n=>{if(n){const r=n.split(ph);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function dt(e){let t="";if(_t(e))t=e;else if(Oe(e))for(let n=0;n<e.length;n++){const r=dt(e[n]);r&&(t+=r+" ")}else if(st(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const vh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",yh=ba(vh);function Tu(e){return!!e||e===""}function wh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Sa(e[r],t[r]);return n}function Sa(e,t){if(e===t)return!0;let n=hl(e),r=hl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=ln(e),r=ln(t),n||r)return e===t;if(n=Oe(e),r=Oe(t),n||r)return n&&r?wh(e,t):!1;if(n=st(e),r=st(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!Sa(e[i],t[i]))return!1}}return String(e)===String(t)}const Iu=e=>!!(e&&e.__v_isRef===!0),de=e=>_t(e)?e:e==null?"":Oe(e)||st(e)&&(e.toString===bu||!Ue(e.toString))?Iu(e)?de(e.value):JSON.stringify(e,Su,2):String(e),Su=(e,t)=>Iu(t)?Su(e,t.value):Jr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[ci(r,o)+" =>"]=s,n),{})}:yu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ci(n))}:ln(t)?ci(t):st(t)&&!Oe(t)&&!_u(t)?String(t):t,ci=(e,t="")=>{var n;return ln(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
- * @vue/reactivity v3.5.30
7
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
- * @license MIT
9
- **/let Kt;class bh{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Kt,!t&&Kt&&(this.index=(Kt.scopes||(Kt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Kt;try{return Kt=this,t()}finally{Kt=n}}}on(){++this._on===1&&(this.prevScope=Kt,Kt=this)}off(){this._on>0&&--this._on===0&&(Kt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function _h(){return Kt}let ht;const ui=new WeakSet;class Eu{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Kt&&Kt.active&&Kt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ui.has(this)&&(ui.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Au(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ml(this),Ru(this);const t=ht,n=sn;ht=this,sn=!0;try{return this.fn()}finally{Pu(this),ht=t,sn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Aa(t);this.deps=this.depsTail=void 0,ml(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ui.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Hi(this)&&this.run()}get dirty(){return Hi(this)}}let Cu=0,Rs,Ps;function Au(e,t=!1){if(e.flags|=8,t){e.next=Ps,Ps=e;return}e.next=Rs,Rs=e}function Ea(){Cu++}function Ca(){if(--Cu>0)return;if(Ps){let t=Ps;for(Ps=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Rs;){let t=Rs;for(Rs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Ru(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Pu(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Aa(r),kh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Hi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(xu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function xu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===js)||(e.globalVersion=js,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Hi(e))))return;e.flags|=2;const t=e.dep,n=ht,r=sn;ht=e,sn=!0;try{Ru(e);const s=e.fn(e._value);(t.version===0||yn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ht=n,sn=r,Pu(e),e.flags&=-3}}function Aa(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Aa(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function kh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let sn=!0;const Mu=[];function Bn(){Mu.push(sn),sn=!1}function Fn(){const e=Mu.pop();sn=e===void 0?!0:e}function ml(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ht;ht=void 0;try{t()}finally{ht=n}}}let js=0;class Th{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ra{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ht||!sn||ht===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ht)n=this.activeLink=new Th(ht,this),ht.deps?(n.prevDep=ht.depsTail,ht.depsTail.nextDep=n,ht.depsTail=n):ht.deps=ht.depsTail=n,Ou(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ht.depsTail,n.nextDep=void 0,ht.depsTail.nextDep=n,ht.depsTail=n,ht.deps===n&&(ht.deps=r)}return n}trigger(t){this.version++,js++,this.notify(t)}notify(t){Ea();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ca()}}}function Ou(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Ou(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Vi=new WeakMap,Mr=Symbol(""),Wi=Symbol(""),Bs=Symbol("");function Nt(e,t,n){if(sn&&ht){let r=Vi.get(e);r||Vi.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Ra),s.map=r,s.key=n),s.track()}}function Nn(e,t,n,r,s,o){const i=Vi.get(e);if(!i){js++;return}const a=l=>{l&&l.trigger()};if(Ea(),t==="clear")i.forEach(a);else{const l=Oe(e),d=l&&Ta(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,p)=>{(p==="length"||p===Bs||!ln(p)&&p>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(Bs)),t){case"add":l?d&&a(i.get("length")):(a(i.get(Mr)),Jr(e)&&a(i.get(Wi)));break;case"delete":l||(a(i.get(Mr)),Jr(e)&&a(i.get(Wi)));break;case"set":Jr(e)&&a(i.get(Mr));break}}Ca()}function Vr(e){const t=Xe(e);return t===e?t:(Nt(t,"iterate",Bs),Zt(e)?t:t.map(cn))}function qo(e){return Nt(e=Xe(e),"iterate",Bs),e}function gn(e,t){return Un(e)?rs(Or(e)?cn(t):t):cn(t)}const Ih={__proto__:null,[Symbol.iterator](){return di(this,Symbol.iterator,e=>gn(this,e))},concat(...e){return Vr(this).concat(...e.map(t=>Oe(t)?Vr(t):t))},entries(){return di(this,"entries",e=>(e[1]=gn(this,e[1]),e))},every(e,t){return Rn(this,"every",e,t,void 0,arguments)},filter(e,t){return Rn(this,"filter",e,t,n=>n.map(r=>gn(this,r)),arguments)},find(e,t){return Rn(this,"find",e,t,n=>gn(this,n),arguments)},findIndex(e,t){return Rn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Rn(this,"findLast",e,t,n=>gn(this,n),arguments)},findLastIndex(e,t){return Rn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Rn(this,"forEach",e,t,void 0,arguments)},includes(...e){return fi(this,"includes",e)},indexOf(...e){return fi(this,"indexOf",e)},join(e){return Vr(this).join(e)},lastIndexOf(...e){return fi(this,"lastIndexOf",e)},map(e,t){return Rn(this,"map",e,t,void 0,arguments)},pop(){return bs(this,"pop")},push(...e){return bs(this,"push",e)},reduce(e,...t){return gl(this,"reduce",e,t)},reduceRight(e,...t){return gl(this,"reduceRight",e,t)},shift(){return bs(this,"shift")},some(e,t){return Rn(this,"some",e,t,void 0,arguments)},splice(...e){return bs(this,"splice",e)},toReversed(){return Vr(this).toReversed()},toSorted(e){return Vr(this).toSorted(e)},toSpliced(...e){return Vr(this).toSpliced(...e)},unshift(...e){return bs(this,"unshift",e)},values(){return di(this,"values",e=>gn(this,e))}};function di(e,t,n){const r=qo(e),s=r[t]();return r!==e&&!Zt(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Sh=Array.prototype;function Rn(e,t,n,r,s,o){const i=qo(e),a=i!==e&&!Zt(e),l=i[t];if(l!==Sh[t]){const f=l.apply(e,o);return a?cn(f):f}let d=n;i!==e&&(a?d=function(f,p){return n.call(this,gn(e,f),p,e)}:n.length>2&&(d=function(f,p){return n.call(this,f,p,e)}));const c=l.call(i,d,r);return a&&s?s(c):c}function gl(e,t,n,r){const s=qo(e),o=s!==e&&!Zt(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(d,c,f){return a&&(a=!1,d=gn(e,d)),n.call(this,d,gn(e,c),f,e)}):n.length>3&&(i=function(d,c,f){return n.call(this,d,c,f,e)}));const l=s[t](i,...r);return a?gn(e,l):l}function fi(e,t,n){const r=Xe(e);Nt(r,"iterate",Bs);const s=r[t](...n);return(s===-1||s===!1)&&Ma(n[0])?(n[0]=Xe(n[0]),r[t](...n)):s}function bs(e,t,n=[]){Bn(),Ea();const r=Xe(e)[t].apply(e,n);return Ca(),Fn(),r}const Eh=ba("__proto__,__v_isRef,__isVue"),Nu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ln));function Ch(e){ln(e)||(e=String(e));const t=Xe(this);return Nt(t,"has",e),t.hasOwnProperty(e)}class Du{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Lh:Bu:o?ju:Lu).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Oe(t);if(!s){let l;if(i&&(l=Ih[n]))return l;if(n==="hasOwnProperty")return Ch}const a=Reflect.get(t,n,Lt(t)?t:r);if((ln(n)?Nu.has(n):Eh(n))||(s||Nt(t,"get",n),o))return a;if(Lt(a)){const l=i&&Ta(n)?a:a.value;return s&&st(l)?Gi(l):l}return st(a)?s?Gi(a):Go(a):a}}class $u extends Du{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Oe(t)&&Ta(n);if(!this._isShallow){const d=Un(o);if(!Zt(r)&&!Un(r)&&(o=Xe(o),r=Xe(r)),!i&&Lt(o)&&!Lt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:rt(t,n),l=Reflect.set(t,n,r,Lt(t)?t:s);return t===Xe(s)&&(a?yn(r,o)&&Nn(t,"set",n,r):Nn(t,"add",n,r)),l}deleteProperty(t,n){const r=rt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Nn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!ln(n)||!Nu.has(n))&&Nt(t,"has",n),r}ownKeys(t){return Nt(t,"iterate",Oe(t)?"length":Mr),Reflect.ownKeys(t)}}class Ah extends Du{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Rh=new $u,Ph=new Ah,xh=new $u(!0);const qi=e=>e,io=e=>Reflect.getPrototypeOf(e);function Mh(e,t,n){return function(...r){const s=this.__v_raw,o=Xe(s),i=Jr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),c=n?qi:t?rs:cn;return!t&&Nt(o,"iterate",l?Wi:Mr),Et(Object.create(d),{next(){const{value:f,done:p}=d.next();return p?{value:f,done:p}:{value:a?[c(f[0]),c(f[1])]:c(f),done:p}}})}}function ao(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Oh(e,t){const n={get(s){const o=this.__v_raw,i=Xe(o),a=Xe(s);e||(yn(s,a)&&Nt(i,"get",s),Nt(i,"get",a));const{has:l}=io(i),d=t?qi:e?rs:cn;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Nt(Xe(s),"iterate",Mr),s.size},has(s){const o=this.__v_raw,i=Xe(o),a=Xe(s);return e||(yn(s,a)&&Nt(i,"has",s),Nt(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=Xe(a),d=t?qi:e?rs:cn;return!e&&Nt(l,"iterate",Mr),a.forEach((c,f)=>s.call(o,d(c),d(f),i))}};return Et(n,e?{add:ao("add"),set:ao("set"),delete:ao("delete"),clear:ao("clear")}:{add(s){const o=Xe(this),i=io(o),a=Xe(s),l=!t&&!Zt(s)&&!Un(s)?a:s;return i.has.call(o,l)||yn(s,l)&&i.has.call(o,s)||yn(a,l)&&i.has.call(o,a)||(o.add(l),Nn(o,"add",l,l)),this},set(s,o){!t&&!Zt(o)&&!Un(o)&&(o=Xe(o));const i=Xe(this),{has:a,get:l}=io(i);let d=a.call(i,s);d||(s=Xe(s),d=a.call(i,s));const c=l.call(i,s);return i.set(s,o),d?yn(o,c)&&Nn(i,"set",s,o):Nn(i,"add",s,o),this},delete(s){const o=Xe(this),{has:i,get:a}=io(o);let l=i.call(o,s);l||(s=Xe(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&Nn(o,"delete",s,void 0),d},clear(){const s=Xe(this),o=s.size!==0,i=s.clear();return o&&Nn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Mh(s,e,t)}),n}function Pa(e,t){const n=Oh(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(rt(n,s)&&s in r?n:r,s,o)}const Nh={get:Pa(!1,!1)},Dh={get:Pa(!1,!0)},$h={get:Pa(!0,!1)};const Lu=new WeakMap,ju=new WeakMap,Bu=new WeakMap,Lh=new WeakMap;function jh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bh(e){return e.__v_skip||!Object.isExtensible(e)?0:jh(ch(e))}function Go(e){return Un(e)?e:xa(e,!1,Rh,Nh,Lu)}function Fu(e){return xa(e,!1,xh,Dh,ju)}function Gi(e){return xa(e,!0,Ph,$h,Bu)}function xa(e,t,n,r,s){if(!st(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Bh(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function Or(e){return Un(e)?Or(e.__v_raw):!!(e&&e.__v_isReactive)}function Un(e){return!!(e&&e.__v_isReadonly)}function Zt(e){return!!(e&&e.__v_isShallow)}function Ma(e){return e?!!e.__v_raw:!1}function Xe(e){const t=e&&e.__v_raw;return t?Xe(t):e}function Fh(e){return!rt(e,"__v_skip")&&Object.isExtensible(e)&&ku(e,"__v_skip",!0),e}const cn=e=>st(e)?Go(e):e,rs=e=>st(e)?Gi(e):e;function Lt(e){return e?e.__v_isRef===!0:!1}function j(e){return Uu(e,!1)}function Uh(e){return Uu(e,!0)}function Uu(e,t){return Lt(e)?e:new Hh(e,t)}class Hh{constructor(t,n){this.dep=new Ra,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Xe(t),this._value=n?t:cn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Zt(t)||Un(t);t=r?t:Xe(t),yn(t,n)&&(this._rawValue=t,this._value=r?t:cn(t),this.dep.trigger())}}function Me(e){return Lt(e)?e.value:e}const Vh={get:(e,t,n)=>t==="__v_raw"?e:Me(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Lt(s)&&!Lt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Hu(e){return Or(e)?e:new Proxy(e,Vh)}class Wh{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ra(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=js-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ht!==this)return Au(this,!0),!0}get value(){const t=this.dep.track();return xu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function qh(e,t,n=!1){let r,s;return Ue(e)?r=e:(r=e.get,s=e.set),new Wh(r,s,n)}const lo={},So=new WeakMap;let Er;function Gh(e,t=!1,n=Er){if(n){let r=So.get(n);r||So.set(n,r=[]),r.push(e)}}function Kh(e,t,n=ut){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=F=>s?F:Zt(F)||s===!1||s===0?Dn(F,1):Dn(F);let c,f,p,b,O=!1,R=!1;if(Lt(e)?(f=()=>e.value,O=Zt(e)):Or(e)?(f=()=>d(e),O=!0):Oe(e)?(R=!0,O=e.some(F=>Or(F)||Zt(F)),f=()=>e.map(F=>{if(Lt(F))return F.value;if(Or(F))return d(F);if(Ue(F))return l?l(F,2):F()})):Ue(e)?t?f=l?()=>l(e,2):e:f=()=>{if(p){Bn();try{p()}finally{Fn()}}const F=Er;Er=c;try{return l?l(e,3,[b]):e(b)}finally{Er=F}}:f=kn,t&&s){const F=f,ae=s===!0?1/0:s;f=()=>Dn(F(),ae)}const U=_h(),q=()=>{c.stop(),U&&U.active&&ka(U.effects,c)};if(o&&t){const F=t;t=(...ae)=>{F(...ae),q()}}let $=R?new Array(e.length).fill(lo):lo;const B=F=>{if(!(!(c.flags&1)||!c.dirty&&!F))if(t){const ae=c.run();if(s||O||(R?ae.some((ue,he)=>yn(ue,$[he])):yn(ae,$))){p&&p();const ue=Er;Er=c;try{const he=[ae,$===lo?void 0:R&&$[0]===lo?[]:$,b];$=ae,l?l(t,3,he):t(...he)}finally{Er=ue}}}else c.run()};return a&&a(B),c=new Eu(f),c.scheduler=i?()=>i(B,!1):B,b=F=>Gh(F,!1,c),p=c.onStop=()=>{const F=So.get(c);if(F){if(l)l(F,4);else for(const ae of F)ae();So.delete(c)}},t?r?B(!0):$=c.run():i?i(B.bind(null,!0),!0):c.run(),q.pause=c.pause.bind(c),q.resume=c.resume.bind(c),q.stop=q,q}function Dn(e,t=1/0,n){if(t<=0||!st(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Lt(e))Dn(e.value,t,n);else if(Oe(e))for(let r=0;r<e.length;r++)Dn(e[r],t,n);else if(yu(e)||Jr(e))e.forEach(r=>{Dn(r,t,n)});else if(_u(e)){for(const r in e)Dn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Dn(e[r],t,n)}return e}/**
10
- * @vue/runtime-core v3.5.30
11
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
- * @license MIT
13
- **/function Xs(e,t,n,r){try{return r?e(...r):e()}catch(s){Ko(s,t,n)}}function un(e,t,n,r){if(Ue(e)){const s=Xs(e,t,n,r);return s&&wu(s)&&s.catch(o=>{Ko(o,t,n)}),s}if(Oe(e)){const s=[];for(let o=0;o<e.length;o++)s.push(un(e[o],t,n,r));return s}}function Ko(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ut;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,l,d)===!1)return}a=a.parent}if(o){Bn(),Xs(o,null,10,[e,l,d]),Fn();return}}zh(e,n,s,r,i)}function zh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Ut=[];let pn=-1;const Yr=[];let Zn=null,qr=0;const Vu=Promise.resolve();let Eo=null;function Yt(e){const t=Eo||Vu;return e?t.then(this?e.bind(this):e):t}function Jh(e){let t=pn+1,n=Ut.length;for(;t<n;){const r=t+n>>>1,s=Ut[r],o=Fs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function Oa(e){if(!(e.flags&1)){const t=Fs(e),n=Ut[Ut.length-1];!n||!(e.flags&2)&&t>=Fs(n)?Ut.push(e):Ut.splice(Jh(t),0,e),e.flags|=1,Wu()}}function Wu(){Eo||(Eo=Vu.then(Gu))}function Yh(e){Oe(e)?Yr.push(...e):Zn&&e.id===-1?Zn.splice(qr+1,0,e):e.flags&1||(Yr.push(e),e.flags|=1),Wu()}function vl(e,t,n=pn+1){for(;n<Ut.length;n++){const r=Ut[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ut.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function qu(e){if(Yr.length){const t=[...new Set(Yr)].sort((n,r)=>Fs(n)-Fs(r));if(Yr.length=0,Zn){Zn.push(...t);return}for(Zn=t,qr=0;qr<Zn.length;qr++){const n=Zn[qr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Zn=null,qr=0}}const Fs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Gu(e){try{for(pn=0;pn<Ut.length;pn++){const t=Ut[pn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Xs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;pn<Ut.length;pn++){const t=Ut[pn];t&&(t.flags&=-2)}pn=-1,Ut.length=0,qu(),Eo=null,(Ut.length||Yr.length)&&Gu()}}let Rt=null,Ku=null;function Co(e){const t=Rt;return Rt=e,Ku=e&&e.type.__scopeId||null,t}function at(e,t=Rt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&xo(-1);const o=Co(t);let i;try{i=e(...s)}finally{Co(o),r._d&&xo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Hn(e,t){if(Rt===null)return e;const n=Zo(Rt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=ut]=t[s];o&&(Ue(o)&&(o={mounted:o,updated:o}),o.deep&&Dn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function _r(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(Bn(),un(l,n,8,[e.el,a,e,t]),Fn())}}function vo(e,t){if($t){let n=$t.provides;const r=$t.parent&&$t.parent.provides;r===n&&(n=$t.provides=Object.create(r)),n[e]=t}}function on(e,t,n=!1){const r=ja();if(r||Xr){let s=Xr?Xr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Ue(t)?t.call(r&&r.proxy):t}}const Qh=Symbol.for("v-scx"),Xh=()=>on(Qh);function gt(e,t,n){return zu(e,t,n)}function zu(e,t,n=ut){const{immediate:r,deep:s,flush:o,once:i}=n,a=Et({},n),l=t&&r||!t&&o!=="post";let d;if(Ws){if(o==="sync"){const b=Xh();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=kn,b.resume=kn,b.pause=kn,b}}const c=$t;a.call=(b,O,R)=>un(b,c,O,R);let f=!1;o==="post"?a.scheduler=b=>{Ot(b,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,O)=>{O?b():Oa(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const p=Kh(e,t,a);return Ws&&(d?d.push(p):l&&p()),p}function Zh(e,t,n){const r=this.proxy,s=_t(e)?e.includes(".")?Ju(r,e):()=>r[e]:e.bind(r,r);let o;Ue(t)?o=t:(o=t.handler,n=t);const i=Zs(this),a=zu(s,o.bind(r),n);return i(),a}function Ju(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Yu=Symbol("_vte"),Qu=e=>e.__isTeleport,xs=e=>e&&(e.disabled||e.disabled===""),yl=e=>e&&(e.defer||e.defer===""),wl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,bl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ki=(e,t)=>{const n=e&&e.to;return _t(n)?t?t(n):null:n},Xu={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:c,pc:f,pbc:p,o:{insert:b,querySelector:O,createText:R,createComment:U}}=d,q=xs(t.props);let{shapeFlag:$,children:B,dynamicChildren:F}=t;if(e==null){const ae=t.el=R(""),ue=t.anchor=R("");b(ae,n,r),b(ue,n,r);const he=(re,Z)=>{$&16&&c(B,re,Z,s,o,i,a,l)},_e=()=>{const re=t.target=Ki(t.props,O),Z=zi(re,t,R,b);re&&(i!=="svg"&&wl(re)?i="svg":i!=="mathml"&&bl(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),q||(he(re,Z),yo(t,!1)))};q&&(he(n,ue),yo(t,!0)),yl(t.props)?(t.el.__isMounted=!1,Ot(()=>{_e(),delete t.el.__isMounted},o)):_e()}else{if(yl(t.props)&&e.el.__isMounted===!1){Ot(()=>{Xu.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ae=t.anchor=e.anchor,ue=t.target=e.target,he=t.targetAnchor=e.targetAnchor,_e=xs(e.props),re=_e?n:ue,Z=_e?ae:he;if(i==="svg"||wl(ue)?i="svg":(i==="mathml"||bl(ue))&&(i="mathml"),F?(p(e.dynamicChildren,F,re,s,o,i,a),$a(e,t,!0)):l||f(e,t,re,Z,s,o,i,a,!1),q)_e?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):co(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ke=t.target=Ki(t.props,O);ke&&co(t,ke,null,d,0)}else _e&&co(t,ue,he,d,1);yo(t,q)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:c,target:f,props:p}=e;if(f&&(s(d),s(c)),o&&s(l),i&16){const b=o||!xs(p);for(let O=0;O<a.length;O++){const R=a[O];r(R,t,n,b,!!R.dynamicChildren)}}},move:co,hydrate:ep};function co(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||xs(c))&&l&16)for(let p=0;p<d.length;p++)s(d[p],t,n,2);f&&r(a,t,n)}function ep(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:c}},f){function p(U,q){let $=q;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,U._lpa=t.targetAnchor&&i(t.targetAnchor);break}}$=i($)}}function b(U,q){q.anchor=f(i(U),q,a(U),n,r,s,o)}const O=t.target=Ki(t.props,l),R=xs(t.props);if(O){const U=O._lpa||O.firstChild;t.shapeFlag&16&&(R?(b(e,t),p(O,U),t.targetAnchor||zi(O,t,c,d,a(e)===O?e:null)):(t.anchor=i(e),p(O,U),t.targetAnchor||zi(O,t,c,d),f(U&&i(U),t,O,n,r,s,o))),yo(t,R)}else R&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Ao=Xu;function yo(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function zi(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Yu]=i,e&&(r(o,e,s),r(i,e,s)),i}const mn=Symbol("_leaveCb"),_s=Symbol("_enterCb");function tp(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return cr(()=>{e.isMounted=!0}),ur(()=>{e.isUnmounting=!0}),e}const Qt=[Function,Array],Zu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Qt,onEnter:Qt,onAfterEnter:Qt,onEnterCancelled:Qt,onBeforeLeave:Qt,onLeave:Qt,onAfterLeave:Qt,onLeaveCancelled:Qt,onBeforeAppear:Qt,onAppear:Qt,onAfterAppear:Qt,onAppearCancelled:Qt},ed=e=>{const t=e.subTree;return t.component?ed(t.component):t},np={name:"BaseTransition",props:Zu,setup(e,{slots:t}){const n=ja(),r=tp();return()=>{const s=t.default&&rd(t.default(),!0);if(!s||!s.length)return;const o=td(s),i=Xe(e),{mode:a}=i;if(r.isLeaving)return hi(o);const l=_l(o);if(!l)return hi(o);let d=Ji(l,i,r,n,f=>d=f);l.type!==Dt&&Us(l,d);let c=n.subTree&&_l(n.subTree);if(c&&c.type!==Dt&&!Ar(c,l)&&ed(n).type!==Dt){let f=Ji(c,i,r,n);if(Us(c,f),a==="out-in"&&l.type!==Dt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},hi(o);a==="in-out"&&l.type!==Dt?f.delayLeave=(p,b,O)=>{const R=nd(r,c);R[String(c.key)]=c,p[mn]=()=>{b(),p[mn]=void 0,delete d.delayedLeave,c=void 0},d.delayedLeave=()=>{O(),delete d.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function td(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Dt){t=n;break}}return t}const rp=np;function nd(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Ji(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:p,onLeave:b,onAfterLeave:O,onLeaveCancelled:R,onBeforeAppear:U,onAppear:q,onAfterAppear:$,onAppearCancelled:B}=t,F=String(e.key),ae=nd(n,e),ue=(re,Z)=>{re&&un(re,r,9,Z)},he=(re,Z)=>{const ke=Z[1];ue(re,Z),Oe(re)?re.every(te=>te.length<=1)&&ke():re.length<=1&&ke()},_e={mode:i,persisted:a,beforeEnter(re){let Z=l;if(!n.isMounted)if(o)Z=U||l;else return;re[mn]&&re[mn](!0);const ke=ae[F];ke&&Ar(e,ke)&&ke.el[mn]&&ke.el[mn](),ue(Z,[re])},enter(re){if(ae[F]===e)return;let Z=d,ke=c,te=f;if(!n.isMounted)if(o)Z=q||d,ke=$||c,te=B||f;else return;let Te=!1;re[_s]=Ke=>{Te||(Te=!0,Ke?ue(te,[re]):ue(ke,[re]),_e.delayedLeave&&_e.delayedLeave(),re[_s]=void 0)};const Be=re[_s].bind(null,!1);Z?he(Z,[re,Be]):Be()},leave(re,Z){const ke=String(e.key);if(re[_s]&&re[_s](!0),n.isUnmounting)return Z();ue(p,[re]);let te=!1;re[mn]=Be=>{te||(te=!0,Z(),Be?ue(R,[re]):ue(O,[re]),re[mn]=void 0,ae[ke]===e&&delete ae[ke])};const Te=re[mn].bind(null,!1);ae[ke]=e,b?he(b,[re,Te]):Te()},clone(re){const Z=Ji(re,t,n,r,s);return s&&s(Z),Z}};return _e}function hi(e){if(zo(e))return e=ar(e),e.children=null,e}function _l(e){if(!zo(e))return Qu(e.type)&&e.children?td(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ue(n.default))return n.default()}}function Us(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Us(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function rd(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Fe?(i.patchFlag&128&&s++,r=r.concat(rd(i.children,t,a))):(t||i.type!==Dt)&&r.push(a!=null?ar(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Pt(e,t){return Ue(e)?Et({name:e.name},t,{setup:e}):e}function sd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function kl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ro=new WeakMap;function Ms(e,t,n,r,s=!1){if(Oe(e)){e.forEach((R,U)=>Ms(R,t&&(Oe(t)?t[U]:t),n,r,s));return}if(Qr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ms(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Zo(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,c=a.refs===ut?a.refs={}:a.refs,f=a.setupState,p=Xe(f),b=f===ut?vu:R=>kl(c,R)?!1:rt(p,R),O=(R,U)=>!(U&&kl(c,U));if(d!=null&&d!==l){if(Tl(t),_t(d))c[d]=null,b(d)&&(f[d]=null);else if(Lt(d)){const R=t;O(d,R.k)&&(d.value=null),R.k&&(c[R.k]=null)}}if(Ue(l))Xs(l,a,12,[i,c]);else{const R=_t(l),U=Lt(l);if(R||U){const q=()=>{if(e.f){const $=R?b(l)?f[l]:c[l]:O()||!e.k?l.value:c[e.k];if(s)Oe($)&&ka($,o);else if(Oe($))$.includes(o)||$.push(o);else if(R)c[l]=[o],b(l)&&(f[l]=c[l]);else{const B=[o];O(l,e.k)&&(l.value=B),e.k&&(c[e.k]=B)}}else R?(c[l]=i,b(l)&&(f[l]=i)):U&&(O(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const $=()=>{q(),Ro.delete(e)};$.id=-1,Ro.set(e,$),Ot($,n)}else Tl(e),q()}}}function Tl(e){const t=Ro.get(e);t&&(t.flags|=8,Ro.delete(e))}Wo().requestIdleCallback;Wo().cancelIdleCallback;const Qr=e=>!!e.type.__asyncLoader,zo=e=>e.type.__isKeepAlive;function sp(e,t){od(e,"a",t)}function op(e,t){od(e,"da",t)}function od(e,t,n=$t){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Jo(t,r,n),n){let s=n.parent;for(;s&&s.parent;)zo(s.parent.vnode)&&ip(r,t,n,s),s=s.parent}}function ip(e,t,n,r){const s=Jo(t,e,r,!0);Yo(()=>{ka(r[t],s)},n)}function Jo(e,t,n=$t,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Bn();const a=Zs(n),l=un(t,n,e,i);return a(),Fn(),l});return r?s.unshift(o):s.push(o),o}}const Gn=e=>(t,n=$t)=>{(!Ws||e==="sp")&&Jo(e,(...r)=>t(...r),n)},ap=Gn("bm"),cr=Gn("m"),lp=Gn("bu"),cp=Gn("u"),ur=Gn("bum"),Yo=Gn("um"),up=Gn("sp"),dp=Gn("rtg"),fp=Gn("rtc");function hp(e,t=$t){Jo("ec",e,t)}const pp="components",id=Symbol.for("v-ndc");function mp(e){return _t(e)?gp(pp,e,!1)||e:e||id}function gp(e,t,n=!0,r=!1){const s=Rt||$t;if(s){const o=s.type;{const a=em(o,!1);if(a&&(a===t||a===Vt(t)||a===Vo(Vt(t))))return o}const i=Il(s[e]||o[e],t)||Il(s.appContext[e],t);return!i&&r?o:i}}function Il(e,t){return e&&(e[t]||e[Vt(t)]||e[Vo(Vt(t))])}function bt(e,t,n,r){let s;const o=n,i=Oe(e);if(i||_t(e)){const a=i&&Or(e);let l=!1,d=!1;a&&(l=!Zt(e),d=Un(e),e=qo(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?d?rs(cn(e[c])):cn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(st(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,d=a.length;l<d;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function _n(e,t,n={},r,s){if(Rt.ce||Rt.parent&&Qr(Rt.parent)&&Rt.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),_(),pt(Fe,null,[Ie("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),_();const i=o&&ad(o(n)),a=n.key||i&&i.key,l=pt(Fe,{key:(a&&!ln(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function ad(e){return e.some(t=>Vs(t)?!(t.type===Dt||t.type===Fe&&!ad(t.children)):!0)?e:null}const Yi=e=>e?Cd(e)?Zo(e):Yi(e.parent):null,Os=Et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Yi(e.parent),$root:e=>Yi(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>cd(e),$forceUpdate:e=>e.f||(e.f=()=>{Oa(e.update)}),$nextTick:e=>e.n||(e.n=Yt.bind(e.proxy)),$watch:e=>Zh.bind(e)}),pi=(e,t)=>e!==ut&&!e.__isScriptSetup&&rt(e,t),vp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const p=i[t];if(p!==void 0)switch(p){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(pi(r,t))return i[t]=1,r[t];if(s!==ut&&rt(s,t))return i[t]=2,s[t];if(rt(o,t))return i[t]=3,o[t];if(n!==ut&&rt(n,t))return i[t]=4,n[t];Qi&&(i[t]=0)}}const d=Os[t];let c,f;if(d)return t==="$attrs"&&Nt(e.attrs,"get",""),d(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==ut&&rt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,rt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return pi(s,t)?(s[t]=n,!0):r!==ut&&rt(r,t)?(r[t]=n,!0):rt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},a){let l;return!!(n[a]||e!==ut&&a[0]!=="$"&&rt(e,a)||pi(t,a)||rt(o,a)||rt(r,a)||rt(Os,a)||rt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:rt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function yp(){return wp().slots}function wp(e){const t=ja();return t.setupContext||(t.setupContext=Rd(t))}function Sl(e){return Oe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Qi=!0;function bp(e){const t=cd(e),n=e.proxy,r=e.ctx;Qi=!1,t.beforeCreate&&El(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:c,beforeMount:f,mounted:p,beforeUpdate:b,updated:O,activated:R,deactivated:U,beforeDestroy:q,beforeUnmount:$,destroyed:B,unmounted:F,render:ae,renderTracked:ue,renderTriggered:he,errorCaptured:_e,serverPrefetch:re,expose:Z,inheritAttrs:ke,components:te,directives:Te,filters:Be}=t;if(d&&_p(d,r,null),i)for(const we in i){const Ne=i[we];Ue(Ne)&&(r[we]=Ne.bind(n))}if(s){const we=s.call(n,n);st(we)&&(e.data=Go(we))}if(Qi=!0,o)for(const we in o){const Ne=o[we],ot=Ue(Ne)?Ne.bind(n,n):Ue(Ne.get)?Ne.get.bind(n,n):kn,ze=!Ue(Ne)&&Ue(Ne.set)?Ne.set.bind(n):kn,it=ce({get:ot,set:ze});Object.defineProperty(r,we,{enumerable:!0,configurable:!0,get:()=>it.value,set:We=>it.value=We})}if(a)for(const we in a)ld(a[we],r,n,we);if(l){const we=Ue(l)?l.call(n):l;Reflect.ownKeys(we).forEach(Ne=>{vo(Ne,we[Ne])})}c&&El(c,e,"c");function Ee(we,Ne){Oe(Ne)?Ne.forEach(ot=>we(ot.bind(n))):Ne&&we(Ne.bind(n))}if(Ee(ap,f),Ee(cr,p),Ee(lp,b),Ee(cp,O),Ee(sp,R),Ee(op,U),Ee(hp,_e),Ee(fp,ue),Ee(dp,he),Ee(ur,$),Ee(Yo,F),Ee(up,re),Oe(Z))if(Z.length){const we=e.exposed||(e.exposed={});Z.forEach(Ne=>{Object.defineProperty(we,Ne,{get:()=>n[Ne],set:ot=>n[Ne]=ot,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===kn&&(e.render=ae),ke!=null&&(e.inheritAttrs=ke),te&&(e.components=te),Te&&(e.directives=Te),re&&sd(e)}function _p(e,t,n=kn){Oe(e)&&(e=Xi(e));for(const r in e){const s=e[r];let o;st(s)?"default"in s?o=on(s.from||r,s.default,!0):o=on(s.from||r):o=on(s),Lt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function El(e,t,n){un(Oe(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ld(e,t,n,r){let s=r.includes(".")?Ju(n,r):()=>n[r];if(_t(e)){const o=t[e];Ue(o)&&gt(s,o)}else if(Ue(e))gt(s,e.bind(n));else if(st(e))if(Oe(e))e.forEach(o=>ld(o,t,n,r));else{const o=Ue(e.handler)?e.handler.bind(n):t[e.handler];Ue(o)&&gt(s,o,e)}}function cd(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(d=>Po(l,d,i,!0)),Po(l,t,i)),st(t)&&o.set(t,l),l}function Po(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Po(e,o,n,!0),s&&s.forEach(i=>Po(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=kp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const kp={data:Cl,props:Al,emits:Al,methods:Cs,computed:Cs,beforeCreate:Bt,created:Bt,beforeMount:Bt,mounted:Bt,beforeUpdate:Bt,updated:Bt,beforeDestroy:Bt,beforeUnmount:Bt,destroyed:Bt,unmounted:Bt,activated:Bt,deactivated:Bt,errorCaptured:Bt,serverPrefetch:Bt,components:Cs,directives:Cs,watch:Ip,provide:Cl,inject:Tp};function Cl(e,t){return t?e?function(){return Et(Ue(e)?e.call(this,this):e,Ue(t)?t.call(this,this):t)}:t:e}function Tp(e,t){return Cs(Xi(e),Xi(t))}function Xi(e){if(Oe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Bt(e,t){return e?[...new Set([].concat(e,t))]:t}function Cs(e,t){return e?Et(Object.create(null),e,t):t}function Al(e,t){return e?Oe(e)&&Oe(t)?[...new Set([...e,...t])]:Et(Object.create(null),Sl(e),Sl(t??{})):t}function Ip(e,t){if(!e)return t;if(!t)return e;const n=Et(Object.create(null),e);for(const r in t)n[r]=Bt(e[r],t[r]);return n}function ud(){return{app:null,config:{isNativeTag:vu,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Sp=0;function Ep(e,t){return function(r,s=null){Ue(r)||(r=Et({},r)),s!=null&&!st(s)&&(s=null);const o=ud(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Sp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:nm,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&Ue(c.install)?(i.add(c),c.install(d,...f)):Ue(c)&&(i.add(c),c(d,...f))),d},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),d},component(c,f){return f?(o.components[c]=f,d):o.components[c]},directive(c,f){return f?(o.directives[c]=f,d):o.directives[c]},mount(c,f,p){if(!l){const b=d._ceVNode||Ie(r,s);return b.appContext=o,p===!0?p="svg":p===!1&&(p=void 0),e(b,c,p),l=!0,d._container=c,c.__vue_app__=d,Zo(b.component)}},onUnmount(c){a.push(c)},unmount(){l&&(un(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,f){return o.provides[c]=f,d},runWithContext(c){const f=Xr;Xr=d;try{return c()}finally{Xr=f}}};return d}}let Xr=null;const Cp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Vt(t)}Modifiers`]||e[`${lr(t)}Modifiers`];function Ap(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ut;let s=n;const o=t.startsWith("update:"),i=o&&Cp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>_t(c)?c.trim():c)),i.number&&(s=n.map(Ia)));let a,l=r[a=li(t)]||r[a=li(Vt(t))];!l&&o&&(l=r[a=li(lr(t))]),l&&un(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,un(d,e,6,s)}}const Rp=new WeakMap;function dd(e,t,n=!1){const r=n?Rp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ue(e)){const l=d=>{const c=dd(d,t,!0);c&&(a=!0,Et(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(st(e)&&r.set(e,null),null):(Oe(o)?o.forEach(l=>i[l]=null):Et(i,o),st(e)&&r.set(e,i),i)}function Qo(e,t){return!e||!Uo(t)?!1:(t=t.slice(2).replace(/Once$/,""),rt(e,t[0].toLowerCase()+t.slice(1))||rt(e,lr(t))||rt(e,t))}function Rl(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:c,props:f,data:p,setupState:b,ctx:O,inheritAttrs:R}=e,U=Co(e);let q,$;try{if(n.shapeFlag&4){const F=s||r,ae=F;q=vn(d.call(ae,F,c,f,b,p,O)),$=a}else{const F=t;q=vn(F.length>1?F(f,{attrs:a,slots:i,emit:l}):F(f,null)),$=t.props?a:Pp(a)}}catch(F){Ns.length=0,Ko(F,e,1),q=Ie(Dt)}let B=q;if($&&R!==!1){const F=Object.keys($),{shapeFlag:ae}=B;F.length&&ae&7&&(o&&F.some(_a)&&($=xp($,o)),B=ar(B,$,!1,!0))}return n.dirs&&(B=ar(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition&&Us(B,n.transition),q=B,Co(U),q}const Pp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Uo(n))&&((t||(t={}))[n]=e[n]);return t},xp=(e,t)=>{const n={};for(const r in e)(!_a(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Mp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Pl(r,i,d):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const p=c[f];if(fd(i,r,p)&&!Qo(d,p))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Pl(r,i,d):!0:!!i;return!1}function Pl(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(fd(t,e,o)&&!Qo(n,o))return!0}return!1}function fd(e,t,n){const r=e[n],s=t[n];return n==="style"&&st(r)&&st(s)?!Sa(r,s):r!==s}function Op({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const hd={},pd=()=>Object.create(hd),md=e=>Object.getPrototypeOf(e)===hd;function Np(e,t,n,r=!1){const s={},o=pd();e.propsDefaults=Object.create(null),gd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Fu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Dp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=Xe(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let p=c[f];if(Qo(e.emitsOptions,p))continue;const b=t[p];if(l)if(rt(o,p))b!==o[p]&&(o[p]=b,d=!0);else{const O=Vt(p);s[O]=Zi(l,a,O,b,e,!1)}else b!==o[p]&&(o[p]=b,d=!0)}}}else{gd(e,t,s,o)&&(d=!0);let c;for(const f in a)(!t||!rt(t,f)&&((c=lr(f))===f||!rt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=Zi(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!rt(t,f))&&(delete o[f],d=!0)}d&&Nn(e.attrs,"set","")}function gd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(As(l))continue;const d=t[l];let c;s&&rt(s,c=Vt(l))?!o||!o.includes(c)?n[c]=d:(a||(a={}))[c]=d:Qo(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=Xe(n),d=a||ut;for(let c=0;c<o.length;c++){const f=o[c];n[f]=Zi(s,l,f,d[f],e,!rt(d,f))}}return i}function Zi(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=rt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ue(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const c=Zs(s);r=d[n]=l.call(null,t),c()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===lr(n))&&(r=!0))}return r}const $p=new WeakMap;function vd(e,t,n=!1){const r=n?$p:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ue(e)){const c=f=>{l=!0;const[p,b]=vd(f,t,!0);Et(i,p),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return st(e)&&r.set(e,zr),zr;if(Oe(o))for(let c=0;c<o.length;c++){const f=Vt(o[c]);xl(f)&&(i[f]=ut)}else if(o)for(const c in o){const f=Vt(c);if(xl(f)){const p=o[c],b=i[f]=Oe(p)||Ue(p)?{type:p}:Et({},p),O=b.type;let R=!1,U=!0;if(Oe(O))for(let q=0;q<O.length;++q){const $=O[q],B=Ue($)&&$.name;if(B==="Boolean"){R=!0;break}else B==="String"&&(U=!1)}else R=Ue(O)&&O.name==="Boolean";b[0]=R,b[1]=U,(R||rt(b,"default"))&&a.push(f)}}const d=[i,a];return st(e)&&r.set(e,d),d}function xl(e){return e[0]!=="$"&&!As(e)}const Na=e=>e==="_"||e==="_ctx"||e==="$stable",Da=e=>Oe(e)?e.map(vn):[vn(e)],Lp=(e,t,n)=>{if(t._n)return t;const r=at((...s)=>Da(t(...s)),n);return r._c=!1,r},yd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Na(s))continue;const o=e[s];if(Ue(o))t[s]=Lp(s,o,r);else if(o!=null){const i=Da(o);t[s]=()=>i}}},wd=(e,t)=>{const n=Da(t);e.slots.default=()=>n},bd=(e,t,n)=>{for(const r in t)(n||!Na(r))&&(e[r]=t[r])},jp=(e,t,n)=>{const r=e.slots=pd();if(e.vnode.shapeFlag&32){const s=t._;s?(bd(r,t,n),n&&ku(r,"_",s,!0)):yd(t,r)}else t&&wd(e,t)},Bp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=ut;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:bd(s,t,n):(o=!t.$stable,yd(t,s)),i=t}else t&&(wd(e,t),i={default:1});if(o)for(const a in s)!Na(a)&&i[a]==null&&delete s[a]},Ot=Wp;function Fp(e){return Up(e)}function Up(e,t){const n=Wo();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:c,parentNode:f,nextSibling:p,setScopeId:b=kn,insertStaticContent:O}=e,R=(g,h,w,P=null,N=null,D=null,Y=void 0,X=null,J=!!h.dynamicChildren)=>{if(g===h)return;g&&!Ar(g,h)&&(P=L(g),We(g,N,D,!0),g=null),h.patchFlag===-2&&(J=!1,h.dynamicChildren=null);const{type:V,ref:fe,shapeFlag:ie}=h;switch(V){case Xo:U(g,h,w,P);break;case Dt:q(g,h,w,P);break;case gi:g==null&&$(h,w,P,Y);break;case Fe:te(g,h,w,P,N,D,Y,X,J);break;default:ie&1?ae(g,h,w,P,N,D,Y,X,J):ie&6?Te(g,h,w,P,N,D,Y,X,J):(ie&64||ie&128)&&V.process(g,h,w,P,N,D,Y,X,J,pe)}fe!=null&&N?Ms(fe,g&&g.ref,D,h||g,!h):fe==null&&g&&g.ref!=null&&Ms(g.ref,null,D,g,!0)},U=(g,h,w,P)=>{if(g==null)r(h.el=a(h.children),w,P);else{const N=h.el=g.el;h.children!==g.children&&d(N,h.children)}},q=(g,h,w,P)=>{g==null?r(h.el=l(h.children||""),w,P):h.el=g.el},$=(g,h,w,P)=>{[g.el,g.anchor]=O(g.children,h,w,P,g.el,g.anchor)},B=({el:g,anchor:h},w,P)=>{let N;for(;g&&g!==h;)N=p(g),r(g,w,P),g=N;r(h,w,P)},F=({el:g,anchor:h})=>{let w;for(;g&&g!==h;)w=p(g),s(g),g=w;s(h)},ae=(g,h,w,P,N,D,Y,X,J)=>{if(h.type==="svg"?Y="svg":h.type==="math"&&(Y="mathml"),g==null)ue(h,w,P,N,D,Y,X,J);else{const V=g.el&&g.el._isVueCE?g.el:null;try{V&&V._beginPatch(),re(g,h,N,D,Y,X,J)}finally{V&&V._endPatch()}}},ue=(g,h,w,P,N,D,Y,X)=>{let J,V;const{props:fe,shapeFlag:ie,transition:ge,dirs:ve}=g;if(J=g.el=i(g.type,D,fe&&fe.is,fe),ie&8?c(J,g.children):ie&16&&_e(g.children,J,null,P,N,mi(g,D),Y,X),ve&&_r(g,null,P,"created"),he(J,g,g.scopeId,Y,P),fe){for(const Ve in fe)Ve!=="value"&&!As(Ve)&&o(J,Ve,null,fe[Ve],D,P);"value"in fe&&o(J,"value",null,fe.value,D),(V=fe.onVnodeBeforeMount)&&hn(V,P,g)}ve&&_r(g,null,P,"beforeMount");const De=Hp(N,ge);De&&ge.beforeEnter(J),r(J,h,w),((V=fe&&fe.onVnodeMounted)||De||ve)&&Ot(()=>{V&&hn(V,P,g),De&&ge.enter(J),ve&&_r(g,null,P,"mounted")},N)},he=(g,h,w,P,N)=>{if(w&&b(g,w),P)for(let D=0;D<P.length;D++)b(g,P[D]);if(N){let D=N.subTree;if(h===D||Td(D.type)&&(D.ssContent===h||D.ssFallback===h)){const Y=N.vnode;he(g,Y,Y.scopeId,Y.slotScopeIds,N.parent)}}},_e=(g,h,w,P,N,D,Y,X,J=0)=>{for(let V=J;V<g.length;V++){const fe=g[V]=X?On(g[V]):vn(g[V]);R(null,fe,h,w,P,N,D,Y,X)}},re=(g,h,w,P,N,D,Y)=>{const X=h.el=g.el;let{patchFlag:J,dynamicChildren:V,dirs:fe}=h;J|=g.patchFlag&16;const ie=g.props||ut,ge=h.props||ut;let ve;if(w&&kr(w,!1),(ve=ge.onVnodeBeforeUpdate)&&hn(ve,w,h,g),fe&&_r(h,g,w,"beforeUpdate"),w&&kr(w,!0),(ie.innerHTML&&ge.innerHTML==null||ie.textContent&&ge.textContent==null)&&c(X,""),V?Z(g.dynamicChildren,V,X,w,P,mi(h,N),D):Y||Ne(g,h,X,null,w,P,mi(h,N),D,!1),J>0){if(J&16)ke(X,ie,ge,w,N);else if(J&2&&ie.class!==ge.class&&o(X,"class",null,ge.class,N),J&4&&o(X,"style",ie.style,ge.style,N),J&8){const De=h.dynamicProps;for(let Ve=0;Ve<De.length;Ve++){const Pe=De[Ve],et=ie[Pe],ft=ge[Pe];(ft!==et||Pe==="value")&&o(X,Pe,et,ft,N,w)}}J&1&&g.children!==h.children&&c(X,h.children)}else!Y&&V==null&&ke(X,ie,ge,w,N);((ve=ge.onVnodeUpdated)||fe)&&Ot(()=>{ve&&hn(ve,w,h,g),fe&&_r(h,g,w,"updated")},P)},Z=(g,h,w,P,N,D,Y)=>{for(let X=0;X<h.length;X++){const J=g[X],V=h[X],fe=J.el&&(J.type===Fe||!Ar(J,V)||J.shapeFlag&198)?f(J.el):w;R(J,V,fe,null,P,N,D,Y,!0)}},ke=(g,h,w,P,N)=>{if(h!==w){if(h!==ut)for(const D in h)!As(D)&&!(D in w)&&o(g,D,h[D],null,N,P);for(const D in w){if(As(D))continue;const Y=w[D],X=h[D];Y!==X&&D!=="value"&&o(g,D,X,Y,N,P)}"value"in w&&o(g,"value",h.value,w.value,N)}},te=(g,h,w,P,N,D,Y,X,J)=>{const V=h.el=g?g.el:a(""),fe=h.anchor=g?g.anchor:a("");let{patchFlag:ie,dynamicChildren:ge,slotScopeIds:ve}=h;ve&&(X=X?X.concat(ve):ve),g==null?(r(V,w,P),r(fe,w,P),_e(h.children||[],w,fe,N,D,Y,X,J)):ie>0&&ie&64&&ge&&g.dynamicChildren&&g.dynamicChildren.length===ge.length?(Z(g.dynamicChildren,ge,w,N,D,Y,X),(h.key!=null||N&&h===N.subTree)&&$a(g,h,!0)):Ne(g,h,w,fe,N,D,Y,X,J)},Te=(g,h,w,P,N,D,Y,X,J)=>{h.slotScopeIds=X,g==null?h.shapeFlag&512?N.ctx.activate(h,w,P,Y,J):Be(h,w,P,N,D,Y,J):Ke(g,h,J)},Be=(g,h,w,P,N,D,Y)=>{const X=g.component=Yp(g,P,N);if(zo(g)&&(X.ctx.renderer=pe),Qp(X,!1,Y),X.asyncDep){if(N&&N.registerDep(X,Ee,Y),!g.el){const J=X.subTree=Ie(Dt);q(null,J,h,w),g.placeholder=J.el}}else Ee(X,g,h,w,N,D,Y)},Ke=(g,h,w)=>{const P=h.component=g.component;if(Mp(g,h,w))if(P.asyncDep&&!P.asyncResolved){we(P,h,w);return}else P.next=h,P.update();else h.el=g.el,P.vnode=h},Ee=(g,h,w,P,N,D,Y)=>{const X=()=>{if(g.isMounted){let{next:ie,bu:ge,u:ve,parent:De,vnode:Ve}=g;{const W=_d(g);if(W){ie&&(ie.el=Ve.el,we(g,ie,Y)),W.asyncDep.then(()=>{Ot(()=>{g.isUnmounted||V()},N)});return}}let Pe=ie,et;kr(g,!1),ie?(ie.el=Ve.el,we(g,ie,Y)):ie=Ve,ge&&go(ge),(et=ie.props&&ie.props.onVnodeBeforeUpdate)&&hn(et,De,ie,Ve),kr(g,!0);const ft=Rl(g),H=g.subTree;g.subTree=ft,R(H,ft,f(H.el),L(H),g,N,D),ie.el=ft.el,Pe===null&&Op(g,ft.el),ve&&Ot(ve,N),(et=ie.props&&ie.props.onVnodeUpdated)&&Ot(()=>hn(et,De,ie,Ve),N)}else{let ie;const{el:ge,props:ve}=h,{bm:De,m:Ve,parent:Pe,root:et,type:ft}=g,H=Qr(h);kr(g,!1),De&&go(De),!H&&(ie=ve&&ve.onVnodeBeforeMount)&&hn(ie,Pe,h),kr(g,!0);{et.ce&&et.ce._hasShadowRoot()&&et.ce._injectChildStyle(ft,g.parent?g.parent.type:void 0);const W=g.subTree=Rl(g);R(null,W,w,P,g,N,D),h.el=W.el}if(Ve&&Ot(Ve,N),!H&&(ie=ve&&ve.onVnodeMounted)){const W=h;Ot(()=>hn(ie,Pe,W),N)}(h.shapeFlag&256||Pe&&Qr(Pe.vnode)&&Pe.vnode.shapeFlag&256)&&g.a&&Ot(g.a,N),g.isMounted=!0,h=w=P=null}};g.scope.on();const J=g.effect=new Eu(X);g.scope.off();const V=g.update=J.run.bind(J),fe=g.job=J.runIfDirty.bind(J);fe.i=g,fe.id=g.uid,J.scheduler=()=>Oa(fe),kr(g,!0),V()},we=(g,h,w)=>{h.component=g;const P=g.vnode.props;g.vnode=h,g.next=null,Dp(g,h.props,P,w),Bp(g,h.children,w),Bn(),vl(g),Fn()},Ne=(g,h,w,P,N,D,Y,X,J=!1)=>{const V=g&&g.children,fe=g?g.shapeFlag:0,ie=h.children,{patchFlag:ge,shapeFlag:ve}=h;if(ge>0){if(ge&128){ze(V,ie,w,P,N,D,Y,X,J);return}else if(ge&256){ot(V,ie,w,P,N,D,Y,X,J);return}}ve&8?(fe&16&&qe(V,N,D),ie!==V&&c(w,ie)):fe&16?ve&16?ze(V,ie,w,P,N,D,Y,X,J):qe(V,N,D,!0):(fe&8&&c(w,""),ve&16&&_e(ie,w,P,N,D,Y,X,J))},ot=(g,h,w,P,N,D,Y,X,J)=>{g=g||zr,h=h||zr;const V=g.length,fe=h.length,ie=Math.min(V,fe);let ge;for(ge=0;ge<ie;ge++){const ve=h[ge]=J?On(h[ge]):vn(h[ge]);R(g[ge],ve,w,null,N,D,Y,X,J)}V>fe?qe(g,N,D,!0,!1,ie):_e(h,w,P,N,D,Y,X,J,ie)},ze=(g,h,w,P,N,D,Y,X,J)=>{let V=0;const fe=h.length;let ie=g.length-1,ge=fe-1;for(;V<=ie&&V<=ge;){const ve=g[V],De=h[V]=J?On(h[V]):vn(h[V]);if(Ar(ve,De))R(ve,De,w,null,N,D,Y,X,J);else break;V++}for(;V<=ie&&V<=ge;){const ve=g[ie],De=h[ge]=J?On(h[ge]):vn(h[ge]);if(Ar(ve,De))R(ve,De,w,null,N,D,Y,X,J);else break;ie--,ge--}if(V>ie){if(V<=ge){const ve=ge+1,De=ve<fe?h[ve].el:P;for(;V<=ge;)R(null,h[V]=J?On(h[V]):vn(h[V]),w,De,N,D,Y,X,J),V++}}else if(V>ge)for(;V<=ie;)We(g[V],N,D,!0),V++;else{const ve=V,De=V,Ve=new Map;for(V=De;V<=ge;V++){const C=h[V]=J?On(h[V]):vn(h[V]);C.key!=null&&Ve.set(C.key,V)}let Pe,et=0;const ft=ge-De+1;let H=!1,W=0;const Q=new Array(ft);for(V=0;V<ft;V++)Q[V]=0;for(V=ve;V<=ie;V++){const C=g[V];if(et>=ft){We(C,N,D,!0);continue}let A;if(C.key!=null)A=Ve.get(C.key);else for(Pe=De;Pe<=ge;Pe++)if(Q[Pe-De]===0&&Ar(C,h[Pe])){A=Pe;break}A===void 0?We(C,N,D,!0):(Q[A-De]=V+1,A>=W?W=A:H=!0,R(C,h[A],w,null,N,D,Y,X,J),et++)}const k=H?Vp(Q):zr;for(Pe=k.length-1,V=ft-1;V>=0;V--){const C=De+V,A=h[C],ne=h[C+1],be=C+1<fe?ne.el||kd(ne):P;Q[V]===0?R(null,A,w,be,N,D,Y,X,J):H&&(Pe<0||V!==k[Pe]?it(A,w,be,2):Pe--)}}},it=(g,h,w,P,N=null)=>{const{el:D,type:Y,transition:X,children:J,shapeFlag:V}=g;if(V&6){it(g.component.subTree,h,w,P);return}if(V&128){g.suspense.move(h,w,P);return}if(V&64){Y.move(g,h,w,pe);return}if(Y===Fe){r(D,h,w);for(let ie=0;ie<J.length;ie++)it(J[ie],h,w,P);r(g.anchor,h,w);return}if(Y===gi){B(g,h,w);return}if(P!==2&&V&1&&X)if(P===0)X.beforeEnter(D),r(D,h,w),Ot(()=>X.enter(D),N);else{const{leave:ie,delayLeave:ge,afterLeave:ve}=X,De=()=>{g.ctx.isUnmounted?s(D):r(D,h,w)},Ve=()=>{D._isLeaving&&D[mn](!0),ie(D,()=>{De(),ve&&ve()})};ge?ge(D,De,Ve):Ve()}else r(D,h,w)},We=(g,h,w,P=!1,N=!1)=>{const{type:D,props:Y,ref:X,children:J,dynamicChildren:V,shapeFlag:fe,patchFlag:ie,dirs:ge,cacheIndex:ve}=g;if(ie===-2&&(N=!1),X!=null&&(Bn(),Ms(X,null,w,g,!0),Fn()),ve!=null&&(h.renderCache[ve]=void 0),fe&256){h.ctx.deactivate(g);return}const De=fe&1&&ge,Ve=!Qr(g);let Pe;if(Ve&&(Pe=Y&&Y.onVnodeBeforeUnmount)&&hn(Pe,h,g),fe&6)vt(g.component,w,P);else{if(fe&128){g.suspense.unmount(w,P);return}De&&_r(g,null,h,"beforeUnmount"),fe&64?g.type.remove(g,h,w,pe,P):V&&!V.hasOnce&&(D!==Fe||ie>0&&ie&64)?qe(V,h,w,!1,!0):(D===Fe&&ie&384||!N&&fe&16)&&qe(J,h,w),P&&Ze(g)}(Ve&&(Pe=Y&&Y.onVnodeUnmounted)||De)&&Ot(()=>{Pe&&hn(Pe,h,g),De&&_r(g,null,h,"unmounted")},w)},Ze=g=>{const{type:h,el:w,anchor:P,transition:N}=g;if(h===Fe){wt(w,P);return}if(h===gi){F(g);return}const D=()=>{s(w),N&&!N.persisted&&N.afterLeave&&N.afterLeave()};if(g.shapeFlag&1&&N&&!N.persisted){const{leave:Y,delayLeave:X}=N,J=()=>Y(w,D);X?X(g.el,D,J):J()}else D()},wt=(g,h)=>{let w;for(;g!==h;)w=p(g),s(g),g=w;s(h)},vt=(g,h,w)=>{const{bum:P,scope:N,job:D,subTree:Y,um:X,m:J,a:V}=g;Ml(J),Ml(V),P&&go(P),N.stop(),D&&(D.flags|=8,We(Y,g,h,w)),X&&Ot(X,h),Ot(()=>{g.isUnmounted=!0},h)},qe=(g,h,w,P=!1,N=!1,D=0)=>{for(let Y=D;Y<g.length;Y++)We(g[Y],h,w,P,N)},L=g=>{if(g.shapeFlag&6)return L(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const h=p(g.anchor||g.el),w=h&&h[Yu];return w?p(w):h};let se=!1;const ee=(g,h,w)=>{let P;g==null?h._vnode&&(We(h._vnode,null,null,!0),P=h._vnode.component):R(h._vnode||null,g,h,null,null,null,w),h._vnode=g,se||(se=!0,vl(P),qu(),se=!1)},pe={p:R,um:We,m:it,r:Ze,mt:Be,mc:_e,pc:Ne,pbc:Z,n:L,o:e};return{render:ee,hydrate:void 0,createApp:Ep(ee)}}function mi({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function kr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function $a(e,t,n=!1){const r=e.children,s=t.children;if(Oe(r)&&Oe(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=On(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&$a(i,a)),a.type===Xo&&(a.patchFlag===-1&&(a=s[o]=On(a)),a.el=i.el),a.type===Dt&&!a.el&&(a.el=i.el)}}function Vp(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function _d(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_d(t)}function Ml(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function kd(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?kd(t.subTree):null}const Td=e=>e.__isSuspense;function Wp(e,t){t&&t.pendingBranch?Oe(e)?t.effects.push(...e):t.effects.push(e):Yh(e)}const Fe=Symbol.for("v-fgt"),Xo=Symbol.for("v-txt"),Dt=Symbol.for("v-cmt"),gi=Symbol.for("v-stc"),Ns=[];let Jt=null;function _(e=!1){Ns.push(Jt=e?null:[])}function qp(){Ns.pop(),Jt=Ns[Ns.length-1]||null}let Hs=1;function xo(e,t=!1){Hs+=e,e<0&&Jt&&t&&(Jt.hasOnce=!0)}function Id(e){return e.dynamicChildren=Hs>0?Jt||zr:null,qp(),Hs>0&&Jt&&Jt.push(e),e}function S(e,t,n,r,s,o){return Id(v(e,t,n,r,s,o,!0))}function pt(e,t,n,r,s){return Id(Ie(e,t,n,r,s,!0))}function Vs(e){return e?e.__v_isVNode===!0:!1}function Ar(e,t){return e.type===t.type&&e.key===t.key}const Sd=({key:e})=>e??null,wo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?_t(e)||Lt(e)||Ue(e)?{i:Rt,r:e,k:t,f:!!n}:e:null);function v(e,t=null,n=null,r=0,s=null,o=e===Fe?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Sd(t),ref:t&&wo(t),scopeId:Ku,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Rt};return a?(La(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=_t(n)?8:16),Hs>0&&!i&&Jt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Jt.push(l),l}const Ie=Gp;function Gp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===id)&&(e=Dt),Vs(e)){const a=ar(e,t,!0);return n&&La(a,n),Hs>0&&!o&&Jt&&(a.shapeFlag&6?Jt[Jt.indexOf(e)]=a:Jt.push(a)),a.patchFlag=-2,a}if(tm(e)&&(e=e.__vccOpts),t){t=Kp(t);let{class:a,style:l}=t;a&&!_t(a)&&(t.class=dt(a)),st(l)&&(Ma(l)&&!Oe(l)&&(l=Et({},l)),t.style=Dr(l))}const i=_t(e)?1:Td(e)?128:Qu(e)?64:st(e)?4:Ue(e)?2:0;return v(e,t,n,r,s,i,o,!0)}function Kp(e){return e?Ma(e)||md(e)?Et({},e):e:null}function ar(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?Ed(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Sd(d),ref:t&&t.ref?n&&o?Oe(o)?o.concat(wo(t)):[o,wo(t)]:wo(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Fe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ar(e.ssContent),ssFallback:e.ssFallback&&ar(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Us(c,l.clone(c)),c}function ea(e=" ",t=0){return Ie(Xo,null,e,t)}function le(e="",t=!1){return t?(_(),pt(Dt,null,e)):Ie(Dt,null,e)}function vn(e){return e==null||typeof e=="boolean"?Ie(Dt):Oe(e)?Ie(Fe,null,e.slice()):Vs(e)?On(e):Ie(Xo,null,String(e))}function On(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ar(e)}function La(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Oe(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),La(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!md(t)?t._ctx=Rt:s===3&&Rt&&(Rt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ue(t)?(t={default:t,_ctx:Rt},n=32):(t=String(t),r&64?(n=16,t=[ea(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ed(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=dt([t.class,r.class]));else if(s==="style")t.style=Dr([t.style,r.style]);else if(Uo(s)){const o=t[s],i=r[s];i&&o!==i&&!(Oe(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function hn(e,t,n,r=null){un(e,t,7,[n,r])}const zp=ud();let Jp=0;function Yp(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||zp,o={uid:Jp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new bh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:vd(r,s),emitsOptions:dd(r,s),emit:null,emitted:null,propsDefaults:ut,inheritAttrs:r.inheritAttrs,ctx:ut,data:ut,props:ut,attrs:ut,slots:ut,refs:ut,setupState:ut,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Ap.bind(null,o),e.ce&&e.ce(o),o}let $t=null;const ja=()=>$t||Rt;let Mo,ta;{const e=Wo(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Mo=t("__VUE_INSTANCE_SETTERS__",n=>$t=n),ta=t("__VUE_SSR_SETTERS__",n=>Ws=n)}const Zs=e=>{const t=$t;return Mo(e),e.scope.on(),()=>{e.scope.off(),Mo(t)}},Ol=()=>{$t&&$t.scope.off(),Mo(null)};function Cd(e){return e.vnode.shapeFlag&4}let Ws=!1;function Qp(e,t=!1,n=!1){t&&ta(t);const{props:r,children:s}=e.vnode,o=Cd(e);Np(e,r,o,t),jp(e,s,n||t);const i=o?Xp(e,t):void 0;return t&&ta(!1),i}function Xp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vp);const{setup:r}=n;if(r){Bn();const s=e.setupContext=r.length>1?Rd(e):null,o=Zs(e),i=Xs(r,e,0,[e.props,s]),a=wu(i);if(Fn(),o(),(a||e.sp)&&!Qr(e)&&sd(e),a){if(i.then(Ol,Ol),t)return i.then(l=>{Nl(e,l)}).catch(l=>{Ko(l,e,0)});e.asyncDep=i}else Nl(e,i)}else Ad(e)}function Nl(e,t,n){Ue(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:st(t)&&(e.setupState=Hu(t)),Ad(e)}function Ad(e,t,n){const r=e.type;e.render||(e.render=r.render||kn);{const s=Zs(e);Bn();try{bp(e)}finally{Fn(),s()}}}const Zp={get(e,t){return Nt(e,"get",""),e[t]}};function Rd(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Zp),slots:e.slots,emit:e.emit,expose:t}}function Zo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hu(Fh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Os)return Os[n](e)},has(t,n){return n in t||n in Os}})):e.proxy}function em(e,t=!0){return Ue(e)?e.displayName||e.name:e.name||t&&e.__name}function tm(e){return Ue(e)&&"__vccOpts"in e}const ce=(e,t)=>qh(e,t,Ws);function Ba(e,t,n){try{xo(-1);const r=arguments.length;return r===2?st(t)&&!Oe(t)?Vs(t)?Ie(e,null,[t]):Ie(e,t):Ie(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Vs(n)&&(n=[n]),Ie(e,t,n))}finally{xo(1)}}const nm="3.5.30";/**
14
- * @vue/runtime-dom v3.5.30
15
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
- * @license MIT
17
- **/let na;const Dl=typeof window<"u"&&window.trustedTypes;if(Dl)try{na=Dl.createPolicy("vue",{createHTML:e=>e})}catch{}const Pd=na?e=>na.createHTML(e):e=>e,rm="http://www.w3.org/2000/svg",sm="http://www.w3.org/1998/Math/MathML",Mn=typeof document<"u"?document:null,$l=Mn&&Mn.createElement("template"),om={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Mn.createElementNS(rm,e):t==="mathml"?Mn.createElementNS(sm,e):n?Mn.createElement(e,{is:n}):Mn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Mn.createTextNode(e),createComment:e=>Mn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Mn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{$l.innerHTML=Pd(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=$l.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Jn="transition",ks="animation",qs=Symbol("_vtc"),xd={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},im=Et({},Zu,xd),am=e=>(e.displayName="Transition",e.props=im,e),Md=am((e,{slots:t})=>Ba(rp,lm(e),t)),Tr=(e,t=[])=>{Oe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Ll=e=>e?Oe(e)?e.some(t=>t.length>1):e.length>1:!1;function lm(e){const t={};for(const te in e)te in xd||(t[te]=e[te]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:d=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,O=cm(s),R=O&&O[0],U=O&&O[1],{onBeforeEnter:q,onEnter:$,onEnterCancelled:B,onLeave:F,onLeaveCancelled:ae,onBeforeAppear:ue=q,onAppear:he=$,onAppearCancelled:_e=B}=t,re=(te,Te,Be,Ke)=>{te._enterCancelled=Ke,Ir(te,Te?c:a),Ir(te,Te?d:i),Be&&Be()},Z=(te,Te)=>{te._isLeaving=!1,Ir(te,f),Ir(te,b),Ir(te,p),Te&&Te()},ke=te=>(Te,Be)=>{const Ke=te?he:$,Ee=()=>re(Te,te,Be);Tr(Ke,[Te,Ee]),jl(()=>{Ir(Te,te?l:o),Pn(Te,te?c:a),Ll(Ke)||Bl(Te,r,R,Ee)})};return Et(t,{onBeforeEnter(te){Tr(q,[te]),Pn(te,o),Pn(te,i)},onBeforeAppear(te){Tr(ue,[te]),Pn(te,l),Pn(te,d)},onEnter:ke(!1),onAppear:ke(!0),onLeave(te,Te){te._isLeaving=!0;const Be=()=>Z(te,Te);Pn(te,f),te._enterCancelled?(Pn(te,p),Hl(te)):(Hl(te),Pn(te,p)),jl(()=>{te._isLeaving&&(Ir(te,f),Pn(te,b),Ll(F)||Bl(te,r,U,Be))}),Tr(F,[te,Be])},onEnterCancelled(te){re(te,!1,void 0,!0),Tr(B,[te])},onAppearCancelled(te){re(te,!0,void 0,!0),Tr(_e,[te])},onLeaveCancelled(te){Z(te),Tr(ae,[te])}})}function cm(e){if(e==null)return null;if(st(e))return[vi(e.enter),vi(e.leave)];{const t=vi(e);return[t,t]}}function vi(e){return fh(e)}function Pn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[qs]||(e[qs]=new Set)).add(t)}function Ir(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[qs];n&&(n.delete(t),n.size||(e[qs]=void 0))}function jl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let um=0;function Bl(e,t,n,r){const s=e._endId=++um,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=dm(e,t);if(!i)return r();const d=i+"end";let c=0;const f=()=>{e.removeEventListener(d,p),o()},p=b=>{b.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(d,p)}function dm(e,t){const n=window.getComputedStyle(e),r=O=>(n[O]||"").split(", "),s=r(`${Jn}Delay`),o=r(`${Jn}Duration`),i=Fl(s,o),a=r(`${ks}Delay`),l=r(`${ks}Duration`),d=Fl(a,l);let c=null,f=0,p=0;t===Jn?i>0&&(c=Jn,f=i,p=o.length):t===ks?d>0&&(c=ks,f=d,p=l.length):(f=Math.max(i,d),c=f>0?i>d?Jn:ks:null,p=c?c===Jn?o.length:l.length:0);const b=c===Jn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Jn}Property`).toString());return{type:c,timeout:f,propCount:p,hasTransform:b}}function Fl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Ul(n)+Ul(e[r])))}function Ul(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Hl(e){return(e?e.ownerDocument:document).body.offsetHeight}function fm(e,t,n){const r=e[qs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Vl=Symbol("_vod"),hm=Symbol("_vsh"),pm=Symbol(""),mm=/(?:^|;)\s*display\s*:/;function gm(e,t,n){const r=e.style,s=_t(n);let o=!1;if(n&&!s){if(t)if(_t(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&bo(r,a,"")}else for(const i in t)n[i]==null&&bo(r,i,"");for(const i in n)i==="display"&&(o=!0),bo(r,i,n[i])}else if(s){if(t!==n){const i=r[pm];i&&(n+=";"+i),r.cssText=n,o=mm.test(n)}}else t&&e.removeAttribute("style");Vl in e&&(e[Vl]=o?r.display:"",e[hm]&&(r.display="none"))}const Wl=/\s*!important$/;function bo(e,t,n){if(Oe(n))n.forEach(r=>bo(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=vm(e,t);Wl.test(n)?e.setProperty(lr(r),n.replace(Wl,""),"important"):e[r]=n}}const ql=["Webkit","Moz","ms"],yi={};function vm(e,t){const n=yi[t];if(n)return n;let r=Vt(t);if(r!=="filter"&&r in e)return yi[t]=r;r=Vo(r);for(let s=0;s<ql.length;s++){const o=ql[s]+r;if(o in e)return yi[t]=o}return t}const Gl="http://www.w3.org/1999/xlink";function Kl(e,t,n,r,s,o=yh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Gl,t.slice(6,t.length)):e.setAttributeNS(Gl,t,n):n==null||o&&!Tu(n)?e.removeAttribute(t):e.setAttribute(t,o?"":ln(n)?String(n):n)}function zl(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Pd(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Tu(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function Gr(e,t,n,r){e.addEventListener(t,n,r)}function ym(e,t,n,r){e.removeEventListener(t,n,r)}const Jl=Symbol("_vei");function wm(e,t,n,r,s=null){const o=e[Jl]||(e[Jl]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=bm(t);if(r){const d=o[t]=Tm(r,s);Gr(e,a,d,l)}else i&&(ym(e,a,i,l),o[t]=void 0)}}const Yl=/(?:Once|Passive|Capture)$/;function bm(e){let t;if(Yl.test(e)){t={};let r;for(;r=e.match(Yl);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):lr(e.slice(2)),t]}let wi=0;const _m=Promise.resolve(),km=()=>wi||(_m.then(()=>wi=0),wi=Date.now());function Tm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;un(Im(r,n.value),t,5,[r])};return n.value=e,n.attached=km(),n}function Im(e,t){if(Oe(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const Ql=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Sm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?fm(e,r,i):t==="style"?gm(e,n,r):Uo(t)?_a(t)||wm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Em(e,t,r,i))?(zl(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Kl(e,t,r,i,o,t!=="value")):e._isVueCE&&(Cm(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!_t(r)))?zl(e,Vt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Kl(e,t,r,i))};function Em(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ql(t)&&Ue(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ql(t)&&_t(n)?!1:t in e}function Cm(e,t){const n=e._def.props;if(!n)return!1;const r=Vt(t);return Array.isArray(n)?n.some(s=>Vt(s)===r):Object.keys(n).some(s=>Vt(s)===r)}const Xl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Oe(t)?n=>go(t,n):t};function Am(e){e.target.composing=!0}function Zl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bi=Symbol("_assign");function ec(e,t,n){return t&&(e=e.trim()),n&&(e=Ia(e)),e}const Vn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[bi]=Xl(s);const o=r||s.props&&s.props.type==="number";Gr(e,t?"change":"input",i=>{i.target.composing||e[bi](ec(e.value,n,o))}),(n||o)&&Gr(e,"change",()=>{e.value=ec(e.value,n,o)}),t||(Gr(e,"compositionstart",Am),Gr(e,"compositionend",Zl),Gr(e,"change",Zl))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[bi]=Xl(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Ia(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Rm=["ctrl","shift","alt","meta"],Pm={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Rm.some(n=>e[`${n}Key`]&&!t.includes(n))},Ge=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Pm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},xm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ht=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=lr(s.key);if(t.some(i=>i===o||xm[i]===o))return e(s)}))},Mm=Et({patchProp:Sm},om);let tc;function Om(){return tc||(tc=Fp(Mm))}const Nm=((...e)=>{const t=Om().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=$m(r);if(!s)return;const o=t._component;!Ue(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Dm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Dm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function $m(e){return _t(e)?document.querySelector(e):e}/*!
18
- * vue-router v4.6.4
19
- * (c) 2025 Eduardo San Martin Morote
20
- * @license MIT
21
- */const Kr=typeof document<"u";function Od(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Lm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Od(e.default)}const nt=Object.assign;function _i(e,t){const n={};for(const r in t){const s=t[r];n[r]=dn(s)?s.map(e):e(s)}return n}const Ds=()=>{},dn=Array.isArray;function nc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Nd=/#/g,jm=/&/g,Bm=/\//g,Fm=/=/g,Um=/\?/g,Dd=/\+/g,Hm=/%5B/g,Vm=/%5D/g,$d=/%5E/g,Wm=/%60/g,Ld=/%7B/g,qm=/%7C/g,jd=/%7D/g,Gm=/%20/g;function Fa(e){return e==null?"":encodeURI(""+e).replace(qm,"|").replace(Hm,"[").replace(Vm,"]")}function Km(e){return Fa(e).replace(Ld,"{").replace(jd,"}").replace($d,"^")}function ra(e){return Fa(e).replace(Dd,"%2B").replace(Gm,"+").replace(Nd,"%23").replace(jm,"%26").replace(Wm,"`").replace(Ld,"{").replace(jd,"}").replace($d,"^")}function zm(e){return ra(e).replace(Fm,"%3D")}function Jm(e){return Fa(e).replace(Nd,"%23").replace(Um,"%3F")}function Ym(e){return Jm(e).replace(Bm,"%2F")}function Gs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Qm=/\/$/,Xm=e=>e.replace(Qm,"");function ki(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=ng(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Gs(i)}}function Zm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function rc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function eg(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ss(t.matched[r],n.matched[s])&&Bd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ss(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Bd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!tg(e[n],t[n]))return!1;return!0}function tg(e,t){return dn(e)?sc(e,t):dn(t)?sc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function sc(e,t){return dn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function ng(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Yn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let sa=(function(e){return e.pop="pop",e.push="push",e})({}),Ti=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function rg(e){if(!e)if(Kr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Xm(e)}const sg=/^[^#]+#/;function og(e,t){return e.replace(sg,"#")+t}function ig(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const ei=()=>({left:window.scrollX,top:window.scrollY});function ag(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=ig(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function oc(e,t){return(history.state?history.state.position-t:-1)+e}const oa=new Map;function lg(e,t){oa.set(e,t)}function cg(e){const t=oa.get(e);return oa.delete(e),t}function ug(e){return typeof e=="string"||e&&typeof e=="object"}function Fd(e){return typeof e=="string"||typeof e=="symbol"}let kt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Ud=Symbol("");kt.MATCHER_NOT_FOUND+"",kt.NAVIGATION_GUARD_REDIRECT+"",kt.NAVIGATION_ABORTED+"",kt.NAVIGATION_CANCELLED+"",kt.NAVIGATION_DUPLICATED+"";function os(e,t){return nt(new Error,{type:e,[Ud]:!0},t)}function xn(e,t){return e instanceof Error&&Ud in e&&(t==null||!!(e.type&t))}const dg=["params","query","hash"];function fg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of dg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function hg(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(Dd," "),o=s.indexOf("="),i=Gs(o<0?s:s.slice(0,o)),a=o<0?null:Gs(s.slice(o+1));if(i in t){let l=t[i];dn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function ic(e){let t="";for(let n in e){const r=e[n];if(n=zm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(dn(r)?r.map(s=>s&&ra(s)):[r&&ra(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function pg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=dn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const mg=Symbol(""),ac=Symbol(""),ti=Symbol(""),Ua=Symbol(""),ia=Symbol("");function Ts(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function er(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=p=>{p===!1?l(os(kt.NAVIGATION_ABORTED,{from:n,to:t})):p instanceof Error?l(p):ug(p)?l(os(kt.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(i&&r.enterCallbacks[s]===i&&typeof p=="function"&&i.push(p),a())},c=o(()=>e.call(r&&r.instances[s],t,n,d));let f=Promise.resolve(c);e.length<3&&(f=f.then(d)),f.catch(p=>l(p))})}function Ii(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(Od(l)){const d=(l.__vccOpts||l)[t];d&&o.push(er(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Lm(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const p=(f.__vccOpts||f)[t];return p&&er(p,n,r,i,a,s)()}))}}return o}function gg(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>ss(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>ss(d,l))||s.push(l))}return[n,r,s]}/*!
22
- * vue-router v4.6.4
23
- * (c) 2025 Eduardo San Martin Morote
24
- * @license MIT
25
- */let vg=()=>location.protocol+"//"+location.host;function Hd(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),rc(a,"")}return rc(n,e)+r+s}function yg(e,t,n,r){let s=[],o=[],i=null;const a=({state:p})=>{const b=Hd(e,location),O=n.value,R=t.value;let U=0;if(p){if(n.value=b,t.value=p,i&&i===O){i=null;return}U=R?p.position-R.position:0}else r(b);s.forEach(q=>{q(n.value,O,{delta:U,type:sa.pop,direction:U?U>0?Ti.forward:Ti.back:Ti.unknown})})};function l(){i=n.value}function d(p){s.push(p);const b=()=>{const O=s.indexOf(p);O>-1&&s.splice(O,1)};return o.push(b),b}function c(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(nt({},p.state,{scroll:ei()}),"")}}function f(){for(const p of o)p();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:d,destroy:f}}function lc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ei():null}}function wg(e){const{history:t,location:n}=window,r={value:Hd(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,c){const f=e.indexOf("#"),p=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:vg()+e+l;try{t[c?"replaceState":"pushState"](d,"",p),s.value=d}catch(b){console.error(b),n[c?"replace":"assign"](p)}}function i(l,d){o(l,nt({},t.state,lc(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const c=nt({},s.value,t.state,{forward:l,scroll:ei()});o(c.current,c,!0),o(l,nt({},lc(r.value,l,null),{position:c.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function bg(e){e=rg(e);const t=wg(e),n=yg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=nt({location:"",base:e,go:r,createHref:og.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function _g(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),bg(e)}let Pr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var St=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(St||{});const kg={type:Pr.Static,value:""},Tg=/[a-zA-Z0-9_]/;function Ig(e){if(!e)return[[]];if(e==="/")return[[kg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${d}": ${b}`)}let n=St.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",c="";function f(){d&&(n===St.Static?o.push({type:Pr.Static,value:d}):n===St.Param||n===St.ParamRegExp||n===St.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Pr.Param,value:d,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function p(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==St.ParamRegExp){r=n,n=St.EscapeNext;continue}switch(n){case St.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=St.Param):p();break;case St.EscapeNext:p(),n=r;break;case St.Param:l==="("?n=St.ParamRegExp:Tg.test(l)?p():(f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case St.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=St.ParamRegExpEnd:c+=l;break;case St.ParamRegExpEnd:f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===St.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const cc="[^/]+?",Sg={sensitive:!1,strict:!1,start:!0,end:!0};var Ft=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Ft||{});const Eg=/[.+*?^${}()[\]/\\]/g;function Cg(e,t){const n=nt({},Sg,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const c=d.length?[]:[Ft.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const p=d[f];let b=Ft.Segment+(n.sensitive?Ft.BonusCaseSensitive:0);if(p.type===Pr.Static)f||(s+="/"),s+=p.value.replace(Eg,"\\$&"),b+=Ft.Static;else if(p.type===Pr.Param){const{value:O,repeatable:R,optional:U,regexp:q}=p;o.push({name:O,repeatable:R,optional:U});const $=q||cc;if($!==cc){b+=Ft.BonusCustomRegExp;try{`${$}`}catch(F){throw new Error(`Invalid custom RegExp for param "${O}" (${$}): `+F.message)}}let B=R?`((?:${$})(?:/(?:${$}))*)`:`(${$})`;f||(B=U&&d.length<2?`(?:/${B})`:"/"+B),U&&(B+="?"),s+=B,b+=Ft.Dynamic,U&&(b+=Ft.BonusOptional),R&&(b+=Ft.BonusRepeatable),$===".*"&&(b+=Ft.BonusWildcard)}c.push(b)}r.push(c)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Ft.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const c=d.match(i),f={};if(!c)return null;for(let p=1;p<c.length;p++){const b=c[p]||"",O=o[p-1];f[O.name]=b&&O.repeatable?b.split("/"):b}return f}function l(d){let c="",f=!1;for(const p of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const b of p)if(b.type===Pr.Static)c+=b.value;else if(b.type===Pr.Param){const{value:O,repeatable:R,optional:U}=b,q=O in d?d[O]:"";if(dn(q)&&!R)throw new Error(`Provided param "${O}" is an array but it is not repeatable (* or + modifiers)`);const $=dn(q)?q.join("/"):q;if(!$)if(U)p.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${O}"`);c+=$}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Ag(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Ft.Static+Ft.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ft.Static+Ft.Segment?1:-1:0}function Vd(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Ag(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(uc(r))return 1;if(uc(s))return-1}return s.length-r.length}function uc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Rg={strict:!1,end:!0,sensitive:!1};function Pg(e,t,n){const r=Cg(Ig(e.path),n),s=nt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function xg(e,t){const n=[],r=new Map;t=nc(Rg,t);function s(f){return r.get(f)}function o(f,p,b){const O=!b,R=fc(f);R.aliasOf=b&&b.record;const U=nc(t,f),q=[R];if("alias"in f){const F=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of F)q.push(fc(nt({},R,{components:b?b.record.components:R.components,path:ae,aliasOf:b?b.record:R})))}let $,B;for(const F of q){const{path:ae}=F;if(p&&ae[0]!=="/"){const ue=p.record.path,he=ue[ue.length-1]==="/"?"":"/";F.path=p.record.path+(ae&&he+ae)}if($=Pg(F,p,U),b?b.alias.push($):(B=B||$,B!==$&&B.alias.push($),O&&f.name&&!hc($)&&i(f.name)),Wd($)&&l($),R.children){const ue=R.children;for(let he=0;he<ue.length;he++)o(ue[he],$,b&&b.children[he])}b=b||$}return B?()=>{i(B)}:Ds}function i(f){if(Fd(f)){const p=r.get(f);p&&(r.delete(f),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(f);p>-1&&(n.splice(p,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const p=Ng(f,n);n.splice(p,0,f),f.record.name&&!hc(f)&&r.set(f.record.name,f)}function d(f,p){let b,O={},R,U;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw os(kt.MATCHER_NOT_FOUND,{location:f});U=b.record.name,O=nt(dc(p.params,b.keys.filter(B=>!B.optional).concat(b.parent?b.parent.keys.filter(B=>B.optional):[]).map(B=>B.name)),f.params&&dc(f.params,b.keys.map(B=>B.name))),R=b.stringify(O)}else if(f.path!=null)R=f.path,b=n.find(B=>B.re.test(R)),b&&(O=b.parse(R),U=b.record.name);else{if(b=p.name?r.get(p.name):n.find(B=>B.re.test(p.path)),!b)throw os(kt.MATCHER_NOT_FOUND,{location:f,currentLocation:p});U=b.record.name,O=nt({},p.params,f.params),R=b.stringify(O)}const q=[];let $=b;for(;$;)q.unshift($.record),$=$.parent;return{name:U,path:R,params:O,matched:q,meta:Og(q)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function dc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function fc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Mg(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Mg(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function hc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Og(e){return e.reduce((t,n)=>nt(t,n.meta),{})}function Ng(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Vd(e,t[o])<0?r=o:n=o+1}const s=Dg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Dg(e){let t=e;for(;t=t.parent;)if(Wd(t)&&Vd(e,t)===0)return t}function Wd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function pc(e){const t=on(ti),n=on(Ua),r=ce(()=>{const l=Me(e.to);return t.resolve(l)}),s=ce(()=>{const{matched:l}=r.value,{length:d}=l,c=l[d-1],f=n.matched;if(!c||!f.length)return-1;const p=f.findIndex(ss.bind(null,c));if(p>-1)return p;const b=mc(l[d-2]);return d>1&&mc(c)===b&&f[f.length-1].path!==b?f.findIndex(ss.bind(null,l[d-2])):p}),o=ce(()=>s.value>-1&&Fg(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Bd(n.params,r.value.params));function a(l={}){if(Bg(l)){const d=t[Me(e.replace)?"replace":"push"](Me(e.to)).catch(Ds);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function $g(e){return e.length===1?e[0]:e}const Lg=Pt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:pc,setup(e,{slots:t}){const n=Go(pc(e)),{options:r}=on(ti),s=ce(()=>({[gc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[gc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&$g(t.default(n));return e.custom?o:Ba("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),jg=Lg;function Bg(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Fg(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!dn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function mc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const gc=(e,t,n)=>e??t??n,Ug=Pt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=on(ia),s=ce(()=>e.route||r.value),o=on(ac,0),i=ce(()=>{let d=Me(o);const{matched:c}=s.value;let f;for(;(f=c[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);vo(ac,ce(()=>i.value+1)),vo(mg,a),vo(ia,s);const l=j();return gt(()=>[l.value,a.value,e.name],([d,c,f],[p,b,O])=>{c&&(c.instances[f]=d,b&&b!==c&&d&&d===p&&(c.leaveGuards.size||(c.leaveGuards=b.leaveGuards),c.updateGuards.size||(c.updateGuards=b.updateGuards))),d&&c&&(!b||!ss(c,b)||!p)&&(c.enterCallbacks[f]||[]).forEach(R=>R(d))},{flush:"post"}),()=>{const d=s.value,c=e.name,f=a.value,p=f&&f.components[c];if(!p)return vc(n.default,{Component:p,route:d});const b=f.props[c],O=b?b===!0?d.params:typeof b=="function"?b(d):b:null,U=Ba(p,nt({},O,t,{onVnodeUnmounted:q=>{q.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return vc(n.default,{Component:U,route:d})||U}}});function vc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Hg=Ug;function Vg(e){const t=xg(e.routes,e),n=e.parseQuery||hg,r=e.stringifyQuery||ic,s=e.history,o=Ts(),i=Ts(),a=Ts(),l=Uh(Yn);let d=Yn;Kr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=_i.bind(null,L=>""+L),f=_i.bind(null,Ym),p=_i.bind(null,Gs);function b(L,se){let ee,pe;return Fd(L)?(ee=t.getRecordMatcher(L),pe=se):pe=L,t.addRoute(pe,ee)}function O(L){const se=t.getRecordMatcher(L);se&&t.removeRoute(se)}function R(){return t.getRoutes().map(L=>L.record)}function U(L){return!!t.getRecordMatcher(L)}function q(L,se){if(se=nt({},se||l.value),typeof L=="string"){const w=ki(n,L,se.path),P=t.resolve({path:w.path},se),N=s.createHref(w.fullPath);return nt(w,P,{params:p(P.params),hash:Gs(w.hash),redirectedFrom:void 0,href:N})}let ee;if(L.path!=null)ee=nt({},L,{path:ki(n,L.path,se.path).path});else{const w=nt({},L.params);for(const P in w)w[P]==null&&delete w[P];ee=nt({},L,{params:f(w)}),se.params=f(se.params)}const pe=t.resolve(ee,se),Ae=L.hash||"";pe.params=c(p(pe.params));const g=Zm(r,nt({},L,{hash:Km(Ae),path:pe.path})),h=s.createHref(g);return nt({fullPath:g,hash:Ae,query:r===ic?pg(L.query):L.query||{}},pe,{redirectedFrom:void 0,href:h})}function $(L){return typeof L=="string"?ki(n,L,l.value.path):nt({},L)}function B(L,se){if(d!==L)return os(kt.NAVIGATION_CANCELLED,{from:se,to:L})}function F(L){return he(L)}function ae(L){return F(nt($(L),{replace:!0}))}function ue(L,se){const ee=L.matched[L.matched.length-1];if(ee&&ee.redirect){const{redirect:pe}=ee;let Ae=typeof pe=="function"?pe(L,se):pe;return typeof Ae=="string"&&(Ae=Ae.includes("?")||Ae.includes("#")?Ae=$(Ae):{path:Ae},Ae.params={}),nt({query:L.query,hash:L.hash,params:Ae.path!=null?{}:L.params},Ae)}}function he(L,se){const ee=d=q(L),pe=l.value,Ae=L.state,g=L.force,h=L.replace===!0,w=ue(ee,pe);if(w)return he(nt($(w),{state:typeof w=="object"?nt({},Ae,w.state):Ae,force:g,replace:h}),se||ee);const P=ee;P.redirectedFrom=se;let N;return!g&&eg(r,pe,ee)&&(N=os(kt.NAVIGATION_DUPLICATED,{to:P,from:pe}),it(pe,pe,!0,!1)),(N?Promise.resolve(N):Z(P,pe)).catch(D=>xn(D)?xn(D,kt.NAVIGATION_GUARD_REDIRECT)?D:ze(D):Ne(D,P,pe)).then(D=>{if(D){if(xn(D,kt.NAVIGATION_GUARD_REDIRECT))return he(nt({replace:h},$(D.to),{state:typeof D.to=="object"?nt({},Ae,D.to.state):Ae,force:g}),se||P)}else D=te(P,pe,!0,h,Ae);return ke(P,pe,D),D})}function _e(L,se){const ee=B(L,se);return ee?Promise.reject(ee):Promise.resolve()}function re(L){const se=wt.values().next().value;return se&&typeof se.runWithContext=="function"?se.runWithContext(L):L()}function Z(L,se){let ee;const[pe,Ae,g]=gg(L,se);ee=Ii(pe.reverse(),"beforeRouteLeave",L,se);for(const w of pe)w.leaveGuards.forEach(P=>{ee.push(er(P,L,se))});const h=_e.bind(null,L,se);return ee.push(h),qe(ee).then(()=>{ee=[];for(const w of o.list())ee.push(er(w,L,se));return ee.push(h),qe(ee)}).then(()=>{ee=Ii(Ae,"beforeRouteUpdate",L,se);for(const w of Ae)w.updateGuards.forEach(P=>{ee.push(er(P,L,se))});return ee.push(h),qe(ee)}).then(()=>{ee=[];for(const w of g)if(w.beforeEnter)if(dn(w.beforeEnter))for(const P of w.beforeEnter)ee.push(er(P,L,se));else ee.push(er(w.beforeEnter,L,se));return ee.push(h),qe(ee)}).then(()=>(L.matched.forEach(w=>w.enterCallbacks={}),ee=Ii(g,"beforeRouteEnter",L,se,re),ee.push(h),qe(ee))).then(()=>{ee=[];for(const w of i.list())ee.push(er(w,L,se));return ee.push(h),qe(ee)}).catch(w=>xn(w,kt.NAVIGATION_CANCELLED)?w:Promise.reject(w))}function ke(L,se,ee){a.list().forEach(pe=>re(()=>pe(L,se,ee)))}function te(L,se,ee,pe,Ae){const g=B(L,se);if(g)return g;const h=se===Yn,w=Kr?history.state:{};ee&&(pe||h?s.replace(L.fullPath,nt({scroll:h&&w&&w.scroll},Ae)):s.push(L.fullPath,Ae)),l.value=L,it(L,se,ee,h),ze()}let Te;function Be(){Te||(Te=s.listen((L,se,ee)=>{if(!vt.listening)return;const pe=q(L),Ae=ue(pe,vt.currentRoute.value);if(Ae){he(nt(Ae,{replace:!0,force:!0}),pe).catch(Ds);return}d=pe;const g=l.value;Kr&&lg(oc(g.fullPath,ee.delta),ei()),Z(pe,g).catch(h=>xn(h,kt.NAVIGATION_ABORTED|kt.NAVIGATION_CANCELLED)?h:xn(h,kt.NAVIGATION_GUARD_REDIRECT)?(he(nt($(h.to),{force:!0}),pe).then(w=>{xn(w,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&!ee.delta&&ee.type===sa.pop&&s.go(-1,!1)}).catch(Ds),Promise.reject()):(ee.delta&&s.go(-ee.delta,!1),Ne(h,pe,g))).then(h=>{h=h||te(pe,g,!1),h&&(ee.delta&&!xn(h,kt.NAVIGATION_CANCELLED)?s.go(-ee.delta,!1):ee.type===sa.pop&&xn(h,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ke(pe,g,h)}).catch(Ds)}))}let Ke=Ts(),Ee=Ts(),we;function Ne(L,se,ee){ze(L);const pe=Ee.list();return pe.length?pe.forEach(Ae=>Ae(L,se,ee)):console.error(L),Promise.reject(L)}function ot(){return we&&l.value!==Yn?Promise.resolve():new Promise((L,se)=>{Ke.add([L,se])})}function ze(L){return we||(we=!L,Be(),Ke.list().forEach(([se,ee])=>L?ee(L):se()),Ke.reset()),L}function it(L,se,ee,pe){const{scrollBehavior:Ae}=e;if(!Kr||!Ae)return Promise.resolve();const g=!ee&&cg(oc(L.fullPath,0))||(pe||!ee)&&history.state&&history.state.scroll||null;return Yt().then(()=>Ae(L,se,g)).then(h=>h&&ag(h)).catch(h=>Ne(h,L,se))}const We=L=>s.go(L);let Ze;const wt=new Set,vt={currentRoute:l,listening:!0,addRoute:b,removeRoute:O,clearRoutes:t.clearRoutes,hasRoute:U,getRoutes:R,resolve:q,options:e,push:F,replace:ae,go:We,back:()=>We(-1),forward:()=>We(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ee.add,isReady:ot,install(L){L.component("RouterLink",jg),L.component("RouterView",Hg),L.config.globalProperties.$router=vt,Object.defineProperty(L.config.globalProperties,"$route",{enumerable:!0,get:()=>Me(l)}),Kr&&!Ze&&l.value===Yn&&(Ze=!0,F(s.location).catch(pe=>{}));const se={};for(const pe in Yn)Object.defineProperty(se,pe,{get:()=>l.value[pe],enumerable:!0});L.provide(ti,vt),L.provide(Ua,Fu(se)),L.provide(ia,l);const ee=L.unmount;wt.add(L),L.unmount=function(){wt.delete(L),wt.size<1&&(d=Yn,Te&&Te(),Te=null,l.value=Yn,Ze=!1,we=!1),ee()}}};function qe(L){return L.reduce((se,ee)=>se.then(()=>re(ee)),Promise.resolve())}return vt}function Wg(){return on(ti)}function qg(e){return on(Ua)}const yc=768;function qd(){const e=j(typeof window<"u"?window.innerWidth<yc:!1);let t=null;function n(r){e.value=r.matches}return cr(()=>{t=window.matchMedia(`(max-width: ${yc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Yo(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Gg={key:0,class:"desktop-sidebar"},Kg={class:"desktop-main"},wc="codex-web-local.sidebar-width.v1",zg=260,Jg=620,bc=320,Yg=Pt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=qd();function r(d){return Math.min(Jg,Math.max(zg,d))}function s(){if(typeof window>"u")return bc;const d=window.localStorage.getItem(wc),c=Number(d);return Number.isFinite(c)?r(c):bc}const o=j(s()),i=ce(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(d){typeof window>"u"||window.localStorage.setItem(wc,String(d))}function l(d){d.preventDefault();const c=d.clientX,f=o.value,p=O=>{const R=O.clientX-c;o.value=r(f+R)},b=()=>{a(o.value),window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",b)}return(d,c)=>(_(),S("div",{class:dt(["desktop-layout",{"is-mobile":Me(n)}]),style:Dr(i.value)},[Me(n)?(_(),pt(Ao,{key:0,to:"body"},[Ie(Md,{name:"drawer"},{default:at(()=>[e.isSidebarCollapsed?le("",!0):(_(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>d.$emit("close-sidebar"))},[v("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=Ge(()=>{},["stop"]))},[_n(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):le("",!0),Me(n)?le("",!0):(_(),S(Fe,{key:1},[e.isSidebarCollapsed?le("",!0):(_(),S("aside",Gg,[_n(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?le("",!0):(_(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),v("section",Kg,[_n(d.$slots,"content",{},void 0)])],6))}}),Ye=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Qg=Ye(Yg,[["__scopeId","data-v-df29c633"]]),Xg={},Zg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ev(e,t){return _(),S("svg",Zg,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const Ha=Ye(Xg,[["render",ev]]),tv={},nv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rv(e,t){return _(),S("svg",nv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Gd=Ye(tv,[["render",rv]]),sv={},ov={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function iv(e,t){return _(),S("svg",ov,[...t[0]||(t[0]=[v("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Is=Ye(sv,[["render",iv]]),av={},lv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function cv(e,t){return _(),S("svg",lv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const Oo=Ye(av,[["render",cv]]),uv={},dv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fv(e,t){return _(),S("svg",dv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const hv=Ye(uv,[["render",fv]]),pv={},mv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gv(e,t){return _(),S("svg",mv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const vv=Ye(pv,[["render",gv]]),yv={},wv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function bv(e,t){return _(),S("svg",wv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Si=Ye(yv,[["render",bv]]),_v={},kv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Tv(e,t){return _(),S("svg",kv,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const Ei=Ye(_v,[["render",Tv]]),Iv={key:0,class:"sidebar-menu-row-left"},Sv={class:"sidebar-menu-row-main"},Ev={key:1,class:"sidebar-menu-row-right"},Cv={key:0,class:"sidebar-menu-row-right-default"},Av={key:1,class:"sidebar-menu-row-right-hover"},Rv=Pt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=yp(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(_(),pt(mp(t.as),Ed({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:at(()=>[r.value?(_(),S("span",Iv,[_n(a.$slots,"left",{},void 0,!0)])):le("",!0),v("span",Sv,[_n(a.$slots,"default",{},void 0,!0)]),i.value?(_(),S("span",Ev,[s.value?(_(),S("span",Cv,[_n(a.$slots,"right",{},void 0,!0)])):le("",!0),o.value?(_(),S("span",Av,[_n(a.$slots,"right-hover",{},void 0,!0)])):le("",!0)])):le("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Sr=Ye(Rv,[["__scopeId","data-v-daeca4df"]]),Pv={class:"thread-tree-root"},xv={key:0,class:"pinned-section"},Mv={class:"thread-list"},Ov={class:"thread-left-stack"},Nv=["data-state"],Dv=["onClick"],$v=["onClick"],Lv={class:"thread-row-title-wrap"},jv={class:"thread-row-title"},Bv={class:"thread-row-time"},Fv=["onClick"],Uv=["onClick"],Hv=["onClick"],Vv=["aria-expanded"],Wv=["data-active"],qv={key:0},Gv=["data-active"],Kv={key:0},zv={key:1,class:"thread-tree-no-results"},Jv={key:2,class:"thread-tree-loading"},Yv={key:3,class:"thread-list thread-list-global"},Qv={class:"thread-left-stack"},Xv=["data-state"],Zv=["onClick"],ey=["onClick"],ty={class:"thread-row-title-wrap"},ny={class:"thread-row-title"},ry={class:"thread-row-time"},sy=["onClick"],oy=["onClick"],iy=["onClick"],ay=["data-project-name","data-expanded","data-dragging"],ly={class:"project-icon-stack"},cy={class:"project-icon-folder"},uy={class:"project-icon-chevron"},dy=["data-dragging-handle","onMousedown"],fy={class:"project-title"},hy={class:"project-hover-controls"},py=["onClick"],my=["onClick"],gy=["onClick"],vy=["onInput"],yy=["aria-label","title","onClick"],wy={key:0,class:"thread-list"},by={class:"thread-left-stack"},_y=["data-state"],ky=["onClick"],Ty=["onClick"],Iy={class:"thread-row-title-wrap"},Sy={class:"thread-row-title"},Ey={class:"thread-row-time"},Cy=["onClick"],Ay=["onClick"],Ry=["onClick"],Py=["onClick"],xy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},My=["onKeydown"],Oy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Ny={class:"rename-thread-subtitle"},Dy=4,_c=6,kc="codex-web-local.thread-view-mode.v1",Tc="codex-web-local.collapsed-projects.v1",$y=Pt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{}},emits:["select","archive","start-new-thread","rename-project","rename-thread","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=j({}),o=j({}),i=j([]),a=j(""),l=j(""),d=j("actions"),c=j(""),f=j(!1),p=j(""),b=j(""),O=j(null),R=j(!1),U=j(""),q=j(""),$=j(null),B=j(null),F=j(null);let ae=null,ue=null;const he=j(""),_e=j({}),re=new Map,Z=new Map,ke=new Map,te=new WeakMap,Te=j(null),Be=j(!1),Ke=j(Ne()),Ee=typeof window<"u"?new ResizeObserver(T=>{for(const E of T){const x=E.target,G=te.get(x);G&&jt(G,x)}}):null;function we(){if(typeof window>"u")return{};try{const T=window.localStorage.getItem(Tc);if(!T)return{};const E=JSON.parse(T);return!E||typeof E!="object"||Array.isArray(E)?{}:E}catch{return{}}}function Ne(){return typeof window>"u"?"project":window.localStorage.getItem(kc)==="chronological"?"chronological":"project"}o.value=we(),gt(o,T=>{typeof window>"u"||window.localStorage.setItem(Tc,JSON.stringify(T))},{deep:!0}),gt(Ke,T=>{typeof window>"u"||window.localStorage.setItem(kc,T)});const ot=ce(()=>n.searchQuery.trim().toLowerCase()),ze=ce(()=>ot.value.length>0);function it(T){if(!ze.value)return!0;const E=ot.value;return T.title.toLowerCase().includes(E)||T.preview.toLowerCase().includes(E)}const We=ce(()=>ze.value?n.groups.map(T=>({...T,threads:T.threads.filter(it)})).filter(T=>T.threads.length>0):n.groups),Ze=ce(()=>Ke.value==="chronological"),wt=ce(()=>{const T=We.value,E=[];for(const x of T)for(const G of x.threads)g(G.id)||E.push(G);return E.sort((x,G)=>{const je=new Date(x.updatedAtIso||x.createdAtIso).getTime();return new Date(G.updatedAtIso||G.createdAtIso).getTime()-je})}),vt=ce(()=>{const T=new Map;for(const E of n.groups)for(const x of E.threads)T.set(x.id,x);return T}),qe=ce(()=>i.value.map(T=>vt.value.get(T)??null).filter(T=>T!==null).filter(it)),L=ce(()=>{const T=F.value;if(!T||T.dropTargetIndexFull===null||n.groups.length===0)return null;const E=Math.max(0,Math.min(T.dropTargetIndexFull,n.groups.length)),x=E>T.fromIndex?E-1:E,G=Math.max(0,Math.min(x,n.groups.length-1));return G===T.fromIndex?null:G}),se=ce(()=>{const E=(ze.value?We.value:n.groups).map(xt=>xt.projectName),x=F.value,G=L.value;if(!x||G===null)return E;const je=[...E],[Tt]=je.splice(x.fromIndex,1);return Tt?(je.splice(G,0,Tt),je):E}),ee=ce(()=>{const T={};let E=0;for(const x of se.value)T[x]=E,E+=Qe(x);return T}),pe=ce(()=>{let T=0;for(const E of se.value)T+=Qe(E);return{height:`${Math.max(0,T)}px`}});function Ae(T){const E=new Date(T).getTime();if(Number.isNaN(E))return"n/a";const x=Math.abs(Date.now()-E);if(x<6e4)return"now";const G=Math.floor(x/6e4);if(G<60)return`${G}m`;const je=Math.floor(G/60);return je<24?`${je}h`:`${Math.floor(je/24)}d`}function g(T){return i.value.includes(T)}function h(T){if(g(T)){i.value=i.value.filter(E=>E!==T);return}i.value=[T,...i.value]}function w(T){r("select",T)}function P(T){return`start new thread ${Ve(T)}`}function N(T){r("start-new-thread",T)}function D(T){l.value===T&&X()}function Y(T){return l.value===T}function X(){l.value=""}function J(T){if(l.value===T){X();return}l.value=T}function V(T,E){p.value=T,b.value=E,f.value=!0,X(),Yt(()=>{var x,G;(x=O.value)==null||x.focus(),(G=O.value)==null||G.select()})}function fe(){f.value=!1,p.value="",b.value=""}function ie(){const T=p.value,E=b.value.trim();!T||!E||(r("rename-thread",{threadId:T,title:E}),fe())}function ge(T,E){U.value=T,q.value=E,R.value=!0,X()}function ve(){R.value=!1,U.value="",q.value=""}function De(){const T=U.value;T&&(i.value=i.value.filter(E=>E!==T),r("archive",T),ve())}function Ve(T){return n.projectDisplayNameById[T]??T}function Pe(T){return a.value===T}function et(){a.value="",d.value="actions",c.value=""}function ft(){Be.value=!Be.value}function H(T){Ke.value=T,Be.value=!1}function W(T){if(a.value===T){et();return}a.value=T,d.value="actions",c.value=Ve(T)}function Q(T){a.value=T,d.value="rename",c.value=Ve(T)}function k(T){r("rename-project",{projectName:T,displayName:c.value})}function C(T){r("remove-project",T),et()}function A(T,E){if(!T.altKey||T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const x=n.groups.findIndex(Tt=>Tt.projectName===E);if(x<0)return;const G=T.key==="ArrowUp"?-1:1,je=Math.max(0,Math.min(x+G,n.groups.length-1));je!==x&&(T.preventDefault(),r("reorder-project",{projectName:E,toIndex:je}))}function ne(T){return s.value[T]===!0}function be(T){return o.value[T]===!0}function Se(T){s.value={...s.value,[T]:!ne(T)}}function tt(T){if(he.value===T){he.value="";return}o.value={...o.value,[T]:!be(T)}}function Qe(T){const E=_e.value[T]??0,x=F.value,je=((x==null?void 0:x.projectName)===T?x.groupHeight:null)??E,Tt=be(T)?0:_c;return Math.max(0,je+Tt)}function lt(T,E){const x=E instanceof HTMLElement?E:E&&"$el"in E&&E.$el instanceof HTMLElement?E.$el:null;if(x){Z.set(T,x);return}Z.delete(T)}function yt(T,E){const x=E instanceof HTMLElement?E:E&&"$el"in E&&E.$el instanceof HTMLElement?E.$el:null;if(x){ke.set(T,x);return}ke.delete(T)}function Ct(T){const E=a.value;if(!E)return!1;const x=Z.get(E);if(!x)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(x))return!0;const je=T.target;return je instanceof Node?x.contains(je):!1}function $e(T){const E=l.value;if(!E)return!1;const x=ke.get(E);if(!x)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(x))return!0;const je=T.target;return je instanceof Node?x.contains(je):!1}function Re(T){if(Be.value){const E=Te.value,x=typeof T.composedPath=="function"?T.composedPath():[];!!E&&(x.includes(E)||T.target instanceof Node&&E.contains(T.target))||(Be.value=!1)}a.value&&(Ct(T)||et(),l.value&&($e(T)||X()))}function fr(T){a.value&&!Ct(T)&&et(),l.value&&!$e(T)&&X()}function qt(){Be.value&&(Be.value=!1),a.value&&et(),l.value&&X()}function fs(){window.addEventListener("pointerdown",Re,{capture:!0}),window.addEventListener("focusin",fr,{capture:!0}),window.addEventListener("blur",qt)}function hr(){window.removeEventListener("pointerdown",Re,{capture:!0}),window.removeEventListener("focusin",fr,{capture:!0}),window.removeEventListener("blur",qt)}function jt(T,E){const x=E.getBoundingClientRect().height;if(!Number.isFinite(x)||x<=0)return;const G=_e.value[T];G!==void 0&&Math.abs(G-x)<.5||(_e.value={..._e.value,[T]:x})}function pr(T,E){const x=re.get(T);x&&x!==E&&Ee&&Ee.unobserve(x);const G=E instanceof HTMLElement?E:E&&"$el"in E&&E.$el instanceof HTMLElement?E.$el:null;if(G){re.set(T,G),te.set(G,T),jt(T,G),Ee==null||Ee.observe(G);return}x&&(Ee==null||Ee.unobserve(x)),re.delete(T)}function mr(T,E){if(T.button!==0||B.value||F.value)return;const x=n.groups.findIndex(xt=>xt.projectName===E),G=re.get(E);if(x<0||!G)return;const je=G.getBoundingClientRect(),Tt=be(E)?0:_c;B.value={projectName:E,fromIndex:x,startClientX:T.clientX,startClientY:T.clientY,pointerOffsetY:T.clientY-je.top,groupLeft:je.left,groupWidth:je.width,groupHeight:je.height,groupOuterHeight:je.height+Tt},T.preventDefault(),hs()}function hs(){window.addEventListener("mousemove",jr),window.addEventListener("mouseup",Br),window.addEventListener("keydown",Sn)}function Lr(){window.removeEventListener("mousemove",jr),window.removeEventListener("mouseup",Br),window.removeEventListener("keydown",Sn)}function jr(T){ae={clientX:T.clientX,clientY:T.clientY},ps()}function Br(T){gr({clientX:T.clientX,clientY:T.clientY});const E=F.value;if(E&&L.value!==null){const x=n.groups.findIndex(G=>G.projectName===E.projectName);if(x>=0){const G=L.value;G!==x&&r("reorder-project",{projectName:E.projectName,toIndex:G})}}en()}function Sn(T){T.key==="Escape"&&(!B.value&&!F.value||(T.preventDefault(),en()))}function en(){ue!==null&&(window.cancelAnimationFrame(ue),ue=null),ae=null,B.value=null,F.value=null,he.value="",Lr()}function ps(){ue===null&&(ue=window.requestAnimationFrame(()=>{if(ue=null,!ae)return;const T=ae;ae=null,gr(T)}))}function gr(T){const E=B.value;if(!F.value&&E){const x=T.clientX-E.startClientX,G=T.clientY-E.startClientY;if(Math.hypot(x,G)<Dy)return;et(),he.value=E.projectName,F.value={projectName:E.projectName,fromIndex:E.fromIndex,pointerOffsetY:E.pointerOffsetY,groupLeft:E.groupLeft,groupWidth:E.groupWidth,groupHeight:E.groupHeight,groupOuterHeight:E.groupOuterHeight,ghostTop:T.clientY-E.pointerOffsetY,dropTargetIndexFull:null}}F.value&&Fr(T)}function Fr(T){const E=F.value;if(!E)return;if(E.ghostTop=T.clientY-E.pointerOffsetY,!ms(T)){E.dropTargetIndexFull=null;return}const x=T.clientY,G=$.value;if(!G){E.dropTargetIndexFull=null;return}const je=G.getBoundingClientRect(),Tt=new Map(n.groups.map((M,oe)=>[M.projectName,oe])),xt=n.groups.map(M=>M.projectName).filter(M=>M!==E.projectName);let tn=0,yr=n.groups.length;for(const M of xt){const oe=Tt.get(M);if(oe===void 0)continue;const xe=Qe(M),It=je.top+tn+xe/2;if(x<It){yr=oe;break}tn+=xe}E.dropTargetIndexFull=yr}function ms(T){const E=$.value;if(!E)return!1;const x=E.getBoundingClientRect(),G=T.clientX>=x.left&&T.clientX<=x.right,je=T.clientY>=x.top-32&&T.clientY<=x.bottom+32;return G&&je}function vr(T){var E;return((E=F.value)==null?void 0:E.projectName)===T}function Ur(T){const E=F.value,x=ee.value[T]??0,G=a.value===T;return!E||E.projectName!==T?{position:"absolute",top:"0",left:"0",right:"0",zIndex:G?"40":"1",transform:`translate3d(0, ${x}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${E.groupLeft}px`,width:`${E.groupWidth}px`,height:`${E.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${E.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Kn(T){return T.threads.filter(E=>!g(E.id))}function gs(T){if(ze.value)return Kn(T);if(be(T.projectName))return[];const E=Kn(T);return ne(T.projectName)?E:E.slice(0,10)}function vs(T){return ze.value?!1:!be(T.projectName)&&Kn(T).length>10}function ys(T){return Kn(T).length>0}function En(T){return T.inProgress?"working":T.unread?"unread":"idle"}gt(()=>n.groups.map(T=>T.projectName),T=>{var je,Tt;const E=((je=F.value)==null?void 0:je.projectName)??((Tt=B.value)==null?void 0:Tt.projectName)??"";E&&!n.groups.some(xt=>xt.projectName===E)&&en();const x=new Set(T),G=Object.fromEntries(Object.entries(_e.value).filter(([xt])=>x.has(xt)));Object.keys(G).length!==Object.keys(_e.value).length&&(_e.value=G)});const ws=ce(()=>Be.value||a.value!=="");return gt(ws,T=>{if(T){fs();return}hr()}),ur(()=>{for(const T of re.values())Ee==null||Ee.unobserve(T);re.clear(),Z.clear(),hr(),en()}),(T,E)=>(_(),S("section",Pv,[qe.value.length>0?(_(),S("section",xv,[v("ul",Mv,[(_(!0),S(Fe,null,bt(qe.value,x=>(_(),S("li",{key:x.id,class:"thread-row-item"},[Ie(Sr,{class:"thread-row","data-active":x.id===e.selectedThreadId,"data-pinned":g(x.id),onMouseleave:G=>D(x.id)},{left:at(()=>[v("span",Ov,[x.inProgress||x.unread?(_(),S("span",{key:0,class:"thread-status-indicator","data-state":En(x)},null,8,Nv)):le("",!0),v("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:G=>h(x.id)},[Ie(Ei,{class:"thread-icon"})],8,Dv)])]),right:at(()=>[v("span",Bv,de(Ae(x.createdAtIso||x.updatedAtIso)),1)]),"right-hover":at(()=>[v("div",{ref_for:!0,ref:G=>yt(x.id,G),class:"thread-menu-wrap"},[v("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ge(G=>J(x.id),["stop"])},[Ie(Is,{class:"thread-icon"})],8,Fv),Y(x.id)?(_(),S("div",{key:0,class:"thread-menu-panel",onClick:E[0]||(E[0]=Ge(()=>{},["stop"]))},[v("button",{class:"thread-menu-item",type:"button",onClick:G=>V(x.id,x.title)}," Rename thread ",8,Uv),v("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:G=>ge(x.id,x.title)}," Delete thread ",8,Hv)])):le("",!0)],512)]),default:at(()=>[v("button",{class:"thread-main-button",type:"button",onClick:G=>w(x.id)},[v("span",Lv,[v("span",jv,de(x.title),1),x.hasWorktree?(_(),pt(Si,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,$v)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):le("",!0),Ie(Sr,{as:"header",class:"thread-tree-header-row"},{right:at(()=>[v("div",{ref_key:"organizeMenuWrapRef",ref:Te,class:"organize-menu-wrap"},[v("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Be.value,"aria-label":"Organize threads",title:"Organize threads",onClick:ft},[Ie(Is,{class:"thread-icon"})],8,Vv),Be.value?(_(),S("div",{key:0,class:"organize-menu-panel",onClick:E[3]||(E[3]=Ge(()=>{},["stop"]))},[E[11]||(E[11]=v("p",{class:"organize-menu-title"},"Organize",-1)),v("button",{class:"organize-menu-item","data-active":Ke.value==="project",type:"button",onClick:E[1]||(E[1]=x=>H("project"))},[E[9]||(E[9]=v("span",null,"By project",-1)),Ke.value==="project"?(_(),S("span",qv,"✓")):le("",!0)],8,Wv),v("button",{class:"organize-menu-item","data-active":Ke.value==="chronological",type:"button",onClick:E[2]||(E[2]=x=>H("chronological"))},[E[10]||(E[10]=v("span",null,"Chronological list",-1)),Ke.value==="chronological"?(_(),S("span",Kv,"✓")):le("",!0)],8,Gv)])):le("",!0)],512)]),default:at(()=>[E[12]||(E[12]=v("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),ze.value&&We.value.length===0?(_(),S("p",zv,"No matching threads")):e.isLoading&&e.groups.length===0?(_(),S("p",Jv,"Loading threads...")):Ze.value?(_(),S("ul",Yv,[(_(!0),S(Fe,null,bt(wt.value,x=>(_(),S("li",{key:x.id,class:"thread-row-item"},[Ie(Sr,{class:"thread-row","data-active":x.id===e.selectedThreadId,"data-pinned":g(x.id),onMouseleave:G=>D(x.id)},{left:at(()=>[v("span",Qv,[x.inProgress||x.unread?(_(),S("span",{key:0,class:"thread-status-indicator","data-state":En(x)},null,8,Xv)):le("",!0),v("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:G=>h(x.id)},[Ie(Ei,{class:"thread-icon"})],8,Zv)])]),right:at(()=>[v("span",ry,de(Ae(x.createdAtIso||x.updatedAtIso)),1)]),"right-hover":at(()=>[v("div",{ref_for:!0,ref:G=>yt(x.id,G),class:"thread-menu-wrap"},[v("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ge(G=>J(x.id),["stop"])},[Ie(Is,{class:"thread-icon"})],8,sy),Y(x.id)?(_(),S("div",{key:0,class:"thread-menu-panel",onClick:E[4]||(E[4]=Ge(()=>{},["stop"]))},[v("button",{class:"thread-menu-item",type:"button",onClick:G=>V(x.id,x.title)}," Rename thread ",8,oy),v("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:G=>ge(x.id,x.title)}," Delete thread ",8,iy)])):le("",!0)],512)]),default:at(()=>[v("button",{class:"thread-main-button",type:"button",onClick:G=>w(x.id)},[v("span",ty,[v("span",ny,de(x.title),1),x.hasWorktree?(_(),pt(Si,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,ey)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),S("div",{key:4,ref_key:"groupsContainerRef",ref:$,class:"thread-tree-groups",style:Dr(pe.value)},[(_(!0),S(Fe,null,bt(We.value,x=>(_(),S("article",{key:x.projectName,ref_for:!0,ref:G=>pr(x.projectName,G),class:"project-group","data-project-name":x.projectName,"data-expanded":!be(x.projectName),"data-dragging":vr(x.projectName),style:Dr(Ur(x.projectName))},[Ie(Sr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:G=>tt(x.projectName),onKeydown:[G=>A(G,x.projectName),Ht(Ge(G=>tt(x.projectName),["prevent"]),["enter"]),Ht(Ge(G=>tt(x.projectName),["prevent"]),["space"])]},{left:at(()=>[v("span",ly,[v("span",cy,[be(x.projectName)?(_(),pt(hv,{key:0,class:"thread-icon"})):(_(),pt(vv,{key:1,class:"thread-icon"}))]),v("span",uy,[be(x.projectName)?(_(),pt(Gd,{key:0,class:"thread-icon"})):(_(),pt(Ha,{key:1,class:"thread-icon"}))])])]),right:at(()=>[v("div",hy,[v("div",{ref_for:!0,ref:G=>lt(x.projectName,G),class:"project-menu-wrap"},[v("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Ge(G=>W(x.projectName),["stop"])},[Ie(Is,{class:"thread-icon"})],8,py),Pe(x.projectName)?(_(),S("div",{key:0,class:"project-menu-panel",onClick:E[6]||(E[6]=Ge(()=>{},["stop"]))},[d.value==="actions"?(_(),S(Fe,{key:0},[v("button",{class:"project-menu-item",type:"button",onClick:G=>Q(x.projectName)}," Edit name ",8,my),v("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:G=>C(x.projectName)}," Remove ",8,gy)],64)):(_(),S(Fe,{key:1},[E[13]||(E[13]=v("label",{class:"project-menu-label"},"Project name",-1)),Hn(v("input",{"onUpdate:modelValue":E[5]||(E[5]=G=>c.value=G),class:"project-menu-input",type:"text",onInput:G=>k(x.projectName)},null,40,vy),[[Vn,c.value]])],64))])):le("",!0)],512),v("button",{class:"thread-start-button",type:"button","aria-label":P(x.projectName),title:P(x.projectName),onClick:Ge(G=>N(x.projectName),["stop"])},[Ie(Oo,{class:"thread-icon"})],8,yy)])]),default:at(()=>[v("span",{class:"project-main-button","data-dragging-handle":vr(x.projectName),onMousedown:Ge(G=>mr(G,x.projectName),["left"])},[v("span",fy,de(Ve(x.projectName)),1)],40,dy)]),_:2},1032,["onClick","onKeydown"]),ys(x)?(_(),S("ul",wy,[(_(!0),S(Fe,null,bt(gs(x),G=>(_(),S("li",{key:G.id,class:"thread-row-item"},[Ie(Sr,{class:"thread-row","data-active":G.id===e.selectedThreadId,"data-pinned":g(G.id),onMouseleave:je=>D(G.id)},{left:at(()=>[v("span",by,[G.inProgress||G.unread?(_(),S("span",{key:0,class:"thread-status-indicator","data-state":En(G)},null,8,_y)):le("",!0),v("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:je=>h(G.id)},[Ie(Ei,{class:"thread-icon"})],8,ky)])]),right:at(()=>[v("span",Ey,de(Ae(G.createdAtIso||G.updatedAtIso)),1)]),"right-hover":at(()=>[v("div",{ref_for:!0,ref:je=>yt(G.id,je),class:"thread-menu-wrap"},[v("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ge(je=>J(G.id),["stop"])},[Ie(Is,{class:"thread-icon"})],8,Cy),Y(G.id)?(_(),S("div",{key:0,class:"thread-menu-panel",onClick:E[7]||(E[7]=Ge(()=>{},["stop"]))},[v("button",{class:"thread-menu-item",type:"button",onClick:je=>V(G.id,G.title)}," Rename thread ",8,Ay),v("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:je=>ge(G.id,G.title)}," Delete thread ",8,Ry)])):le("",!0)],512)]),default:at(()=>[v("button",{class:"thread-main-button",type:"button",onClick:je=>w(G.id)},[v("span",Iy,[v("span",Sy,de(G.title),1),G.hasWorktree?(_(),pt(Si,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Ty)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),pt(Sr,{key:1,as:"p",class:"project-empty-row"},{left:at(()=>[...E[14]||(E[14]=[v("span",{class:"project-empty-spacer"},null,-1)])]),default:at(()=>[E[15]||(E[15]=v("span",{class:"project-empty"},"No threads",-1))]),_:1})),vs(x)?(_(),pt(Sr,{key:2,class:"thread-show-more-row"},{left:at(()=>[...E[16]||(E[16]=[v("span",{class:"thread-show-more-spacer"},null,-1)])]),default:at(()=>[v("button",{class:"thread-show-more-button",type:"button",onClick:G=>Se(x.projectName)},de(ne(x.projectName)?"Show less":"Show more"),9,Py)]),_:2},1024)):le("",!0)],12,ay))),128))],4)),(_(),pt(Ao,{to:"body"},[f.value?(_(),S("div",{key:0,class:"rename-thread-overlay",onClick:Ge(fe,["self"])},[v("div",xy,[E[17]||(E[17]=v("h3",{class:"rename-thread-title"},"Rename thread",-1)),E[18]||(E[18]=v("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Hn(v("input",{ref_key:"renameThreadInputRef",ref:O,"onUpdate:modelValue":E[8]||(E[8]=x=>b.value=x),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Ht(Ge(ie,["prevent"]),["enter"]),Ht(Ge(fe,["prevent"]),["esc"])]},null,40,My),[[Vn,b.value]]),v("div",{class:"rename-thread-actions"},[v("button",{class:"rename-thread-button",type:"button",onClick:fe},"Cancel"),v("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:ie},"Save")])])])):le("",!0)])),(_(),pt(Ao,{to:"body"},[R.value?(_(),S("div",{key:0,class:"rename-thread-overlay",onClick:Ge(ve,["self"])},[v("div",Oy,[E[19]||(E[19]=v("h3",{class:"rename-thread-title"},"Delete thread?",-1)),v("p",Ny,' This will archive the thread "'+de(q.value)+'". You can find it later in archived threads. ',1),v("div",{class:"rename-thread-actions"},[v("button",{class:"rename-thread-button",type:"button",onClick:ve},"Cancel"),v("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:De},"Delete")])])])):le("",!0)]))]))}}),Ly=Ye($y,[["__scopeId","data-v-1257b57b"]]),jy={class:"content-header"},By={class:"content-leading"},Fy={class:"content-title"},Uy={class:"content-actions"},Hy=Pt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(_(),S("header",jy,[v("div",By,[_n(t.$slots,"leading",{},void 0)]),v("h1",Fy,de(e.title),1),v("div",Uy,[_n(t.$slots,"actions",{},void 0)])]))}}),Vy=Ye(Hy,[["__scopeId","data-v-66ee223c"]]),Wy={},qy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Gy(e,t){return _(),S("svg",qy,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Va=Ye(Wy,[["render",Gy]]),Ky={},zy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Jy(e,t){return _(),S("svg",zy,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Yy=Ye(Ky,[["render",Jy]]),Qy={class:"conversation-root"},Xy={key:0,class:"conversation-loading"},Zy={key:1,class:"conversation-empty"},ew={class:"message-row"},tw={class:"message-stack"},nw={class:"request-card"},rw={class:"request-title"},sw={class:"request-meta"},ow={key:0,class:"request-reason"},iw={key:1,class:"request-actions"},aw=["onClick"],lw=["onClick"],cw=["onClick"],uw=["onClick"],dw={key:2,class:"request-actions"},fw=["onClick"],hw=["onClick"],pw=["onClick"],mw=["onClick"],gw={key:3,class:"request-user-input"},vw={class:"request-question-title"},yw={key:0,class:"request-question-text"},ww=["value","onChange"],bw=["value"],_w=["value","onInput"],kw=["onClick"],Tw={key:4,class:"request-actions"},Iw=["onClick"],Sw=["onClick"],Ew={key:5,class:"request-actions"},Cw=["onClick"],Aw=["onClick"],Rw=["data-role","data-message-type"],Pw={key:0,class:"message-row","data-role":"system"},xw={class:"message-stack","data-role":"system"},Mw=["onClick"],Ow={class:"cmd-label"},Nw={class:"cmd-status"},Dw={class:"cmd-output-inner"},$w={class:"cmd-output"},Lw=["data-role","data-message-type"],jw=["data-role"],Bw=["data-role"],Fw=["data-role"],Uw=["onClick"],Hw=["src"],Vw={key:1,class:"message-file-attachments"},Ww=["title"],qw=["data-role"],Gw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Kw=["onClick"],zw={class:"worked-separator-text"},Jw={key:0,class:"worked-details"},Yw=["onClick"],Qw={class:"cmd-label"},Xw={class:"cmd-status"},Zw={class:"cmd-output-inner"},eb={class:"cmd-output"},tb={key:1,class:"message-text-flow"},nb={key:0,class:"message-text"},rb={key:0},sb={key:2,class:"message-inline-code"},ob={key:1,class:"message-text"},ib=["onClick"],ab=["src","alt","onError"],lb=["onClick"],cb={key:0,class:"conversation-item conversation-item-overlay"},ub={class:"message-row"},db={class:"message-stack"},fb={class:"live-overlay-inline","aria-live":"polite"},hb={class:"live-overlay-label"},pb={key:1,class:"live-overlay-error"},mb=["src"],gb=16,vb=Pt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=j(new Set),r=j(new Set),s=j(new Set),o=j({});function i(k){return k.messageType==="commandExecution"&&!!k.commandExecution}function a(k){var C;return((C=k.commandExecution)==null?void 0:C.status)==="inProgress"||r.value.has(k.id)?!0:n.value.has(k.id)}function l(k){return r.value.has(k.id)}function d(k){var A;if(((A=k.commandExecution)==null?void 0:A.status)==="inProgress")return;const C=new Set(n.value);C.has(k.id)?C.delete(k.id):C.add(k.id),n.value=C}function c(k){const C=new Set(s.value);C.has(k.id)?C.delete(k.id):C.add(k.id),s.value=C}function f(k){return s.value.has(k.id)}function p(k){const C=k.commandExecution;if(!C)return"";switch(C.status){case"inProgress":return"⟳ Running";case"completed":return C.exitCode===0?"✓ Completed":`✗ Exit ${C.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function b(k){var A,ne;const C=(A=k.commandExecution)==null?void 0:A.status;return C==="inProgress"?"cmd-status-running":C==="completed"&&((ne=k.commandExecution)==null?void 0:ne.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function O(k){const C=new Set(r.value);C.add(k),r.value=C,setTimeout(()=>{const A=new Set(r.value);A.delete(k),r.value=A},1e3)}function R(k,C){const A=[];for(let ne=C-1;ne>=0;ne--){const be=k[ne];if(be.messageType==="commandExecution")A.unshift(be);else if(be.role==="user"||be.messageType==="worked")break}return A}const U=e,q=t,$=j(null),B=j(null),F=j(null),ae=j(""),ue=j({}),he=j({});let _e=0,re=0,Z=0;const ke=new WeakSet,te=j(new Set);function Te(k){if(!k||/\s/u.test(k)||k.endsWith("/")||k.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(k))return!1;const C=k.startsWith("/"),A=/^[A-Za-z]:[\\/]/u.test(k),ne=k.startsWith("./")||k.startsWith("../")||k.startsWith("~/"),be=k.includes("/")||k.includes("\\");return C||A||ne||be}function Be(k){return k.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||k}function Ke(k){if(!k)return null;let C=k,A=null;const ne=C.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ne)C=ne[1],A=Number(ne[2]);else{const be=C.match(/^(.*):(\d+)(?::\d+)?$/u);be&&(C=be[1],A=Number(be[2]))}return Te(C)?{path:C,line:A}:null}function Ee(k){if(!k.includes("`"))return[{kind:"text",value:k}];const C=[];let A=0,ne=0;for(;A<k.length;){if(k[A]!=="`"){A+=1;continue}let be=1;for(;A+be<k.length&&k[A+be]==="`";)be+=1;const Se="`".repeat(be);let tt=A+be,Qe=-1;for(;tt<k.length;){const yt=k.indexOf(Se,tt);if(yt<0)break;const Ct=yt>0&&k[yt-1]==="`",$e=yt+be<k.length&&k[yt+be]==="`",Re=k.slice(A+be,yt).includes(`
26
- `);if(!Ct&&!$e&&!Re){Qe=yt;break}tt=yt+1}if(Qe<0){A+=be;continue}A>ne&&C.push({kind:"text",value:k.slice(ne,A)});const lt=k.slice(A+be,Qe);if(lt.length>0){const yt=Ke(lt);if(yt){const Ct=Be(yt.path),$e=yt.line?`${Ct} (line ${String(yt.line)})`:Ct;C.push({kind:"file",value:lt,displayName:$e})}else C.push({kind:"code",value:lt})}else C.push({kind:"text",value:`${Se}${Se}`});A=Qe+be,ne=A}return ne<k.length&&C.push({kind:"text",value:k.slice(ne)}),C}function we(k){const C=k.trim();if(!C)return"";if(C.startsWith("data:")||C.startsWith("blob:")||C.startsWith("http://")||C.startsWith("https://")||C.startsWith("/codex-local-image?"))return C;if(C.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(C)}`;const A=C.startsWith("/"),ne=/^[A-Za-z]:[\\/]/u.test(C);return A||ne?`/codex-local-image?path=${encodeURIComponent(C)}`:C}function Ne(k){if(!k.includes("![")||!k.includes("]("))return[{kind:"text",value:k}];const C=[],A=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let ne=0;for(const be of k.matchAll(A)){const[Se,tt,Qe]=be;if(typeof be.index!="number")continue;const lt=be.index,yt=lt+Se.length,Ct=we(Qe.trim());Ct&&(lt>ne&&C.push({kind:"text",value:k.slice(ne,lt)}),C.push({kind:"image",url:Ct,alt:tt.trim(),markdown:Se}),ne=yt)}return ne<k.length&&C.push({kind:"text",value:k.slice(ne)}),C.length>0?C:[{kind:"text",value:k}]}function ot(k){return k!==null&&typeof k=="object"&&!Array.isArray(k)?k:null}function ze(k){const C=new Date(k);return Number.isNaN(C.getTime())?k:C.toLocaleTimeString()}function it(k){const C=ot(k.params),A=C==null?void 0:C.reason;return typeof A=="string"?A.trim():""}function We(k,C){return`${String(k)}:${C}`}function Ze(k){const C=ot(k.params),A=Array.isArray(C==null?void 0:C.questions)?C.questions:[],ne=[];for(const be of A){const Se=ot(be);if(!Se)continue;const tt=typeof Se.id=="string"?Se.id:"";if(!tt)continue;const Qe=Array.isArray(Se.options)?Se.options.map(lt=>ot(lt)).map(lt=>lt==null?void 0:lt.label).filter(lt=>typeof lt=="string"&&lt.length>0):[];ne.push({id:tt,header:typeof Se.header=="string"?Se.header:"",question:typeof Se.question=="string"?Se.question:"",isOther:Se.isOther===!0,options:Qe})}return ne}function wt(k,C,A){const ne=We(k,C),be=ue.value[ne];return typeof be=="string"&&be.length>0?be:A}function vt(k,C){const A=We(k,C);return he.value[A]??""}function qe(k,C,A){const ne=A.target;if(!(ne instanceof HTMLSelectElement))return;const be=We(k,C);ue.value={...ue.value,[be]:ne.value}}function L(k,C,A){const ne=A.target;if(!(ne instanceof HTMLInputElement))return;const be=We(k,C);he.value={...he.value,[be]:ne.value}}function se(k,C){q("respondServerRequest",{id:k,result:{decision:C}})}function ee(k){const C=Ze(k),A={};for(const ne of C){const be=wt(k.id,ne.id,ne.options[0]||""),Se=vt(k.id,ne.id).trim(),tt=[be,Se].map(Qe=>Qe.trim()).filter(Qe=>Qe.length>0);A[ne.id]={answers:tt}}q("respondServerRequest",{id:k.id,result:{answers:A}})}function pe(k){q("respondServerRequest",{id:k,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function Ae(k){q("respondServerRequest",{id:k,result:{success:!0,contentItems:[]}})}function g(k){q("respondServerRequest",{id:k,result:{}})}function h(k){q("respondServerRequest",{id:k,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function w(k){return!(k.role!=="user"&&k.role!=="assistant"||typeof k.turnIndex!="number"||U.isTurnInProgress||U.isRollingBack)}function P(k){w(k)&&q("rollback",{turnIndex:k.turnIndex})}function N(){const k=$.value,C=B.value;!k||!C||(k.scrollTop=k.scrollHeight,C.scrollIntoView({block:"end"}))}function D(k){return k.scrollHeight-(k.scrollTop+k.clientHeight)<=gb}function Y(k){if(!U.activeThreadId)return;const C=Math.max(k.scrollHeight-k.clientHeight,0),A=C>0?Math.min(Math.max(k.scrollTop/C,0),1):1;q("updateScrollState",{threadId:U.activeThreadId,state:{scrollTop:k.scrollTop,isAtBottom:D(k),scrollRatio:A}})}function X(){const k=$.value;if(!k)return;const C=U.scrollState;if(!C||C.isAtBottom){J();return}const A=Math.max(k.scrollHeight-k.clientHeight,0),ne=typeof C.scrollRatio=="number"?C.scrollRatio*A:C.scrollTop;k.scrollTop=Math.min(Math.max(ne,0),A),Y(k)}function J(){const k=$.value;k&&(N(),Y(k))}function V(){const k=U.scrollState;return!k||k.isAtBottom===!0}function fe(){if(!V()){Z=0,re=0;return}if(J(),Z-=1,Z<=0){re=0;return}re=requestAnimationFrame(fe)}function ie(k=6){V()&&(re&&(cancelAnimationFrame(re),re=0),Z=Math.max(k,1),re=requestAnimationFrame(fe))}function ge(){ie(3)}function ve(){if(!V())return;const k=$.value;if(!k)return;const C=k.querySelectorAll("img.message-image-preview");for(const A of C)A.complete||ke.has(A)||(ke.add(A),A.addEventListener("load",ge,{once:!0}),A.addEventListener("error",ge,{once:!0}))}async function De(){await Yt(),_e&&cancelAnimationFrame(_e),_e=requestAnimationFrame(()=>{_e=0,X(),ve(),ie()})}gt(()=>U.messages,async k=>{if(!U.isLoading){for(const C of k){if(C.messageType!=="commandExecution"||!C.commandExecution)continue;const A=o.value[C.id],ne=C.commandExecution.status;A==="inProgress"&&ne!=="inProgress"&&O(C.id),o.value[C.id]=ne}await De()}}),gt(()=>U.liveOverlay,async k=>{k&&(await Yt(),J(),ie(8))},{deep:!0}),gt(()=>U.isLoading,async k=>{k||await De()}),gt(()=>U.activeThreadId,()=>{ae.value="",te.value=new Set},{flush:"post"});function Ve(){const k=$.value;!k||U.isLoading||Y(k)}function Pe(k){ae.value=we(k)}function et(k,C){return`${k}:${String(C)}`}function ft(k,C){const A=new Set(te.value);A.add(et(k,C)),te.value=A}function H(k,C){return te.value.has(et(k,C))}function W(){ae.value=""}function Q(){const k=F.value;k&&(k.scrollTop=k.scrollHeight)}return gt(()=>{var k;return(k=U.liveOverlay)==null?void 0:k.reasoningText},async k=>{k&&(await Yt(),Q())}),ur(()=>{_e&&cancelAnimationFrame(_e),re&&cancelAnimationFrame(re)}),(k,C)=>(_(),S("section",Qy,[e.isLoading?(_(),S("p",Xy,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(_(),S("p",Zy," No messages in this thread yet. ")):(_(),S("ul",{key:2,ref_key:"conversationListRef",ref:$,class:"conversation-list",onScroll:Ve},[(_(!0),S(Fe,null,bt(e.pendingRequests,A=>(_(),S("li",{key:`server-request:${A.id}`,class:"conversation-item conversation-item-request"},[v("div",ew,[v("div",tw,[v("article",nw,[v("p",rw,de(A.method),1),v("p",sw,"Request #"+de(A.id)+" · "+de(ze(A.receivedAtIso)),1),it(A)?(_(),S("p",ow,de(it(A)),1)):le("",!0),A.method==="item/commandExecution/requestApproval"?(_(),S("section",iw,[v("button",{type:"button",class:"request-button request-button-primary",onClick:ne=>se(A.id,"accept")},"Accept",8,aw),v("button",{type:"button",class:"request-button",onClick:ne=>se(A.id,"acceptForSession")},"Accept for Session",8,lw),v("button",{type:"button",class:"request-button",onClick:ne=>se(A.id,"decline")},"Decline",8,cw),v("button",{type:"button",class:"request-button",onClick:ne=>se(A.id,"cancel")},"Cancel",8,uw)])):A.method==="item/fileChange/requestApproval"?(_(),S("section",dw,[v("button",{type:"button",class:"request-button request-button-primary",onClick:ne=>se(A.id,"accept")},"Accept",8,fw),v("button",{type:"button",class:"request-button",onClick:ne=>se(A.id,"acceptForSession")},"Accept for Session",8,hw),v("button",{type:"button",class:"request-button",onClick:ne=>se(A.id,"decline")},"Decline",8,pw),v("button",{type:"button",class:"request-button",onClick:ne=>se(A.id,"cancel")},"Cancel",8,mw)])):A.method==="item/tool/requestUserInput"?(_(),S("section",gw,[(_(!0),S(Fe,null,bt(Ze(A),ne=>(_(),S("div",{key:`${A.id}:${ne.id}`,class:"request-question"},[v("p",vw,de(ne.header||ne.question),1),ne.header&&ne.question?(_(),S("p",yw,de(ne.question),1)):le("",!0),v("select",{class:"request-select",value:wt(A.id,ne.id,ne.options[0]||""),onChange:be=>qe(A.id,ne.id,be)},[(_(!0),S(Fe,null,bt(ne.options,be=>(_(),S("option",{key:`${A.id}:${ne.id}:${be}`,value:be},de(be),9,bw))),128))],40,ww),ne.isOther?(_(),S("input",{key:1,class:"request-input",type:"text",value:vt(A.id,ne.id),placeholder:"Other answer",onInput:be=>L(A.id,ne.id,be)},null,40,_w)):le("",!0)]))),128)),v("button",{type:"button",class:"request-button request-button-primary",onClick:ne=>ee(A)}," Submit Answers ",8,kw)])):A.method==="item/tool/call"?(_(),S("section",Tw,[v("button",{type:"button",class:"request-button request-button-primary",onClick:ne=>pe(A.id)},"Fail Tool Call",8,Iw),v("button",{type:"button",class:"request-button",onClick:ne=>Ae(A.id)},"Success (Empty)",8,Sw)])):(_(),S("section",Ew,[v("button",{type:"button",class:"request-button request-button-primary",onClick:ne=>g(A.id)},"Return Empty Result",8,Cw),v("button",{type:"button",class:"request-button",onClick:ne=>h(A.id)},"Reject Request",8,Aw)]))])])])]))),128)),(_(!0),S(Fe,null,bt(e.messages,A=>{var ne,be;return _(),S("li",{key:A.id,class:dt(["conversation-item",{"conversation-item-rollbackable":w(A)}]),"data-role":A.role,"data-message-type":A.messageType||""},[i(A)?(_(),S("div",Pw,[v("div",xw,[v("button",{type:"button",class:dt(["cmd-row",[b(A),{"cmd-expanded":a(A)}]]),onClick:Se=>d(A)},[v("span",{class:dt(["cmd-chevron",{"cmd-chevron-open":a(A)}])},"▶",2),v("code",Ow,de(((ne=A.commandExecution)==null?void 0:ne.command)||"(command)"),1),v("span",Nw,de(p(A)),1)],10,Mw),v("div",{class:dt(["cmd-output-wrap",{"cmd-output-visible":a(A),"cmd-output-collapsing":l(A)}])},[v("div",Dw,[v("pre",$w,de(((be=A.commandExecution)==null?void 0:be.aggregatedOutput)||"(no output)"),1)])],2)])])):(_(),S("div",{key:1,class:"message-row","data-role":A.role,"data-message-type":A.messageType||""},[v("div",{class:"message-stack","data-role":A.role},[v("article",{class:"message-body","data-role":A.role},[A.images&&A.images.length>0?(_(),S("ul",{key:0,class:"message-image-list","data-role":A.role},[(_(!0),S(Fe,null,bt(A.images,Se=>(_(),S("li",{key:Se,class:"message-image-item"},[v("button",{class:"message-image-button",type:"button",onClick:tt=>Pe(Se)},[v("img",{class:"message-image-preview",src:we(Se),alt:"Message image preview",loading:"lazy"},null,8,Hw)],8,Uw)]))),128))],8,Fw)):le("",!0),A.fileAttachments&&A.fileAttachments.length>0?(_(),S("div",Vw,[(_(!0),S(Fe,null,bt(A.fileAttachments,Se=>(_(),S("span",{key:Se.path,class:"message-file-chip"},[C[2]||(C[2]=v("span",{class:"message-file-chip-icon"},"📄",-1)),v("span",{class:"message-file-chip-name",title:Se.path},de(Se.label),9,Ww)]))),128))])):le("",!0),A.text.length>0?(_(),S("article",{key:2,class:"message-card","data-role":A.role},[A.messageType==="worked"?(_(),S("div",Gw,[v("button",{type:"button",class:"worked-separator",onClick:Se=>c(A)},[C[3]||(C[3]=v("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),v("span",{class:dt(["worked-chevron",{"worked-chevron-open":f(A)}])},"▶",2),v("p",zw,de(A.text),1),C[4]||(C[4]=v("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Kw),f(A)?(_(),S("div",Jw,[(_(!0),S(Fe,null,bt(R(e.messages,e.messages.indexOf(A)),Se=>{var tt,Qe;return _(),S("div",{key:`worked-cmd-${Se.id}`,class:"worked-cmd-item"},[v("button",{type:"button",class:dt(["cmd-row",[b(Se),{"cmd-expanded":a(Se)}]]),onClick:lt=>d(Se)},[v("span",{class:dt(["cmd-chevron",{"cmd-chevron-open":a(Se)}])},"▶",2),v("code",Qw,de(((tt=Se.commandExecution)==null?void 0:tt.command)||"(command)"),1),v("span",Xw,de(p(Se)),1)],10,Yw),v("div",{class:dt(["cmd-output-wrap",{"cmd-output-visible":a(Se),"cmd-output-collapsing":l(Se)}])},[v("div",Zw,[v("pre",eb,de(((Qe=Se.commandExecution)==null?void 0:Qe.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):le("",!0)])):(_(),S("div",tb,[(_(!0),S(Fe,null,bt(Ne(A.text),(Se,tt)=>(_(),S(Fe,{key:`block-${tt}`},[Se.kind==="text"?(_(),S("p",nb,[(_(!0),S(Fe,null,bt(Ee(Se.value),(Qe,lt)=>(_(),S(Fe,{key:`seg-${tt}-${lt}`},[Qe.kind==="text"?(_(),S("span",rb,de(Qe.value),1)):Qe.kind==="file"?(_(),S("a",{key:1,class:"message-file-link",href:"#",onClick:C[0]||(C[0]=Ge(()=>{},["prevent"]))},de(Qe.displayName),1)):(_(),S("code",sb,de(Qe.value),1))],64))),128))])):H(A.id,tt)?(_(),S("p",ob,de(Se.markdown),1)):(_(),S("button",{key:2,class:"message-image-button",type:"button",onClick:Qe=>Pe(Se.url)},[v("img",{class:"message-image-preview message-markdown-image",src:Se.url,alt:Se.alt||"Embedded message image",loading:"lazy",onError:Qe=>ft(A.id,tt)},null,40,ab)],8,ib))],64))),128))]))],8,qw)):le("",!0)],8,Bw),w(A)?(_(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:Se=>P(A)},[Ie(Yy,{class:"rollback-icon"}),C[5]||(C[5]=v("span",{class:"rollback-label"},"Rollback",-1))],8,lb)):le("",!0)],8,jw)],8,Lw))],10,Rw)}),128)),e.liveOverlay?(_(),S("li",cb,[v("div",ub,[v("div",db,[v("article",fb,[v("p",hb,de(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(_(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:F},de(e.liveOverlay.reasoningText),513)):le("",!0),e.liveOverlay.errorText?(_(),S("p",pb,de(e.liveOverlay.errorText),1)):le("",!0)])])])])):le("",!0),v("li",{ref_key:"bottomAnchorRef",ref:B,class:"conversation-bottom-anchor"},null,512)],544)),ae.value.length>0?(_(),S("div",{key:3,class:"image-modal-backdrop",onClick:W},[v("div",{class:"image-modal-content",onClick:C[1]||(C[1]=Ge(()=>{},["stop"]))},[v("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:W},[Ie(Va,{class:"icon-svg"})]),v("img",{class:"image-modal-image",src:ae.value,alt:"Expanded message image"},null,8,mb)])])):le("",!0)]))}}),yb=Ye(vb,[["__scopeId","data-v-48573075"]]);function wb(e){var c;const t=j("idle"),n=j(typeof navigator<"u"&&!!((c=navigator.mediaDevices)!=null&&c.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=p=>{p.data.size>0&&o.push(p.data)},r.onstop=()=>{var O;const p=o,b=(r==null?void 0:r.mimeType)||((O=p[0])==null?void 0:O.type)||"audio/webm";d(),t.value="idle",l(p,b)},r.start(),t.value="recording"}catch(p){d(),(f=e.onError)==null||f.call(e,p)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,p){var O;if(f.length===0)return;const b=new Blob(f,{type:p});try{const R=p.split(/[/;]/)[1]??"webm",U=`----codex-transcribe-${crypto.randomUUID()}`,q=new Uint8Array(await b.arrayBuffer()),$=new TextEncoder,B=[];B.push($.encode(`--${U}\r
27
- `)),B.push($.encode(`Content-Disposition: form-data; name="file"; filename="codex.${R}"\r
28
- `)),B.push($.encode(`Content-Type: ${p}\r
29
- \r
30
- `)),B.push(q),B.push($.encode(`\r
31
- --${U}--\r
32
- `));let F=0;for(const Z of B)F+=Z.byteLength;const ae=new Uint8Array(F);let ue=0;for(const Z of B)ae.set(Z,ue),ue+=Z.byteLength;const he=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${U}`},body:ae});if(!he.ok)throw new Error(`Transcription failed: ${he.status}`);const re=((await he.json()).text??"").trim();re.length>0&&e.onTranscript(re)}catch(R){(O=e.onError)==null||O.call(e,R)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return ur(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Ic(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class jn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Wa(e,t){const n=Ic(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Ic(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function cs(e,t,n){return e instanceof jn?e:e instanceof Error?new jn(e.message||t,{code:"unknown_error",method:n}):new jn(t,{code:"unknown_error",method:n})}function Kd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function bb(e,t){const n={method:e,params:t??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new jn(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let s=null;try{s=await r.json()}catch{s=null}if(!r.ok)throw new jn(Wa(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new jn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Sc(e){const t=Kd(e);if(!t||typeof t.method!="string"||t.method.length===0)return null;const n=typeof t.atIso=="string"&&t.atIso.length>0?t.atIso:new Date().toISOString();return{method:t.method,params:t.params??null,atIso:n}}function _b(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=Sc(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),c=Sc(d);c&&e(c)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function kb(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){throw new jn(r instanceof Error?r.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await t.json()}catch{n=null}if(!t.ok)throw new jn(Wa(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Tb(){const e=await fetch("/codex-api/server-requests/pending");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new jn(Wa(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Kd(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Ec(e){return new Date(e*1e3).toISOString()}function Ib(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Sb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Eb=/^##\s+(.+?):\s+(.+?)\s*$/,Cb=/^#\s*files mentioned by the user\s*:?\s*$/i;function Ab(e){var s,o;const t=e.split(`
33
- `).findIndex(i=>Cb.test(i.trim()));if(t<0)return[];const n=e.split(`
34
- `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Eb);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&c&&r.push({label:d,path:c})}return r}function Rb(e){const t=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(e.matchAll(t));if(n.length===0)return e.trim();const r=n.at(-1);if(!r||typeof r.index!="number")return e.trim();const s=r.index+r[0].length;return e.slice(s).trim()}function Pb(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],s=[];for(const[a,l]of t.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&r.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&s.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:Sb(l),isUnhandled:!0});const o=n.join(`
35
- `),i=Ab(o);return{text:Rb(o),images:r,fileAttachments:i,rawBlocks:s}}function xb(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Pb(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="reasoning")return[];if(e.type==="commandExecution"){const t=e,n=Mb(t.status),r=typeof t.command=="string"?t.command:"",s=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:s,status:n,aggregatedOutput:o,exitCode:i}}]}return[]}function Mb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Ob(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Nb(e){const t=Ob(e);return t.length>0?t:"Untitled thread"}function zd(e){return(e==null?void 0:e.status)==="inProgress"}function Db(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return zd(r)}function $b(e){const t=e,n=typeof t.cwd=="string"?t.cwd:e.cwd,r=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||n.includes("/.codex/worktrees/")||n.includes("/.git/worktrees/");return{id:e.id,title:Nb(e),projectName:Ib(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Ec(e.createdAt),updatedAtIso:Ec(e.updatedAt),preview:e.preview,unread:!1,inProgress:Db(e)}}function Lb(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((s,o)=>new Date(o.updatedAtIso).getTime()-new Date(s.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const s=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-s})}function jb(e){const t=e.data.map($b);return Lb(t)}function Jd(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of xb(i))n.push({...a,turnIndex:r})}return n}function Bb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return zd(t.at(-1))}async function zt(e,t){try{return await bb(e,t)}catch(n){throw cs(n,`RPC ${e} failed`,e)}}function Fb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Ub(){const e=await zt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return jb(e)}async function Hb(e){const t=await zt("thread/read",{threadId:e,includeTurns:!0});return{messages:Jd(t),inProgress:Bb(t)}}async function Vb(){try{return await Ub()}catch(e){throw cs(e,"Failed to load thread groups","thread/list")}}async function Wb(e){try{return await Hb(e)}catch(t){throw cs(t,`Failed to load thread ${e}`,"thread/read")}}function qb(e){return _b(e)}async function Gb(e,t){await kb({id:e,...t})}async function Kb(){return Tb()}async function Ci(e){await zt("thread/resume",{threadId:e})}async function zb(e){await zt("thread/archive",{threadId:e})}async function Jb(e,t){await zt("thread/name/set",{threadId:e,name:t})}async function Cc(e,t){const n=await zt("thread/rollback",{threadId:e,numTurns:t});return Jd(n)}function Yb(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}async function Ac(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const r=await zt("thread/start",n),s=Yb(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw cs(n,"Failed to start a new thread","thread/start")}}function Qb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
36
- `;for(const r of t)n+=`
37
- ## ${r.label}: ${r.path}
38
- `;return`${n}
39
- ## My request for Codex:
40
-
41
- ${e}
42
- `}async function Ai(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Qb(t,i)}];for(const f of n){const p=f.trim();p&&l.push({type:"image",url:p,image_url:p})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const d=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};d.length>0&&(c.attachments=d),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await zt("turn/start",c)}catch(a){throw cs(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function Xb(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await zt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw cs(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Zb(e){await zt("setDefaultModel",{model:e})}async function e_(){const e=await zt("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}return t}async function t_(){const e=await zt("config/read",{}),t=e.config.model??"",n=Fb(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function n_(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const a of o)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,s={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r))typeof o=="string"&&o.length>0&&typeof i=="string"&&(s[o]=i);return{order:n(t.order),labels:s,active:n(t.active)}}async function Rc(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return n_(n.data)}async function Pc(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function r_(e){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function s_(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=qa(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function o_(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=qa(r,"Failed to suggest project name");throw new Error(i)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function i_(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const d=qa(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d.path,p=typeof f=="string"?f.trim():"";p&&l.push({path:p})}return l}function qa(e,t){const r=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof r=="string"&&r.trim().length>0?r:t}async function a_(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function Ri(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function l_(e,t){var n;try{return((n=(await zt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function c_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await zt("skills/list",t),r=[],s=new Set;for(const o of n.data)for(const i of o.skills)!i.name||s.has(i.path)||(s.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}async function u_(e){try{const t=new FormData;t.append("file",e);const n=await fetch("/codex-api/upload-file",{method:"POST",body:t});return n.ok?(await n.json()).path??null:null}catch{return null}}const d_={},f_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function h_(e,t){return _(),S("svg",f_,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const p_=Ye(d_,[["render",h_]]),m_={},g_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function v_(e,t){return _(),S("svg",g_,[...t[0]||(t[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const y_=Ye(m_,[["render",v_]]),w_={},b_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function __(e,t){return _(),S("svg",b_,[...t[0]||(t[0]=[v("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),v("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const k_=Ye(w_,[["render",__]]),T_=["disabled"],I_={class:"composer-dropdown-value"},S_={class:"composer-dropdown-menu"},E_={key:0,class:"composer-dropdown-search-wrap"},C_=["placeholder","onKeydown"],A_={class:"composer-dropdown-options",role:"listbox"},R_=["onClick"],P_={key:0,class:"composer-dropdown-empty"},x_={key:1,class:"composer-dropdown-add-wrap"},M_=["placeholder","onKeydown"],O_=Pt({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=j(null),o=j(null),i=j(null),a=j(!1),l=j(""),d=j(!1),c=j(""),f=ce(()=>{var ke;const Z=n.options.find(te=>te.value===n.modelValue);return Z?Z.label:((ke=n.placeholder)==null?void 0:ke.trim())||""}),p=ce(()=>n.openDirection??"down"),b=ce(()=>n.enableSearch===!0),O=ce(()=>n.showAddAction===!0),R=ce(()=>{var Z;return((Z=n.searchPlaceholder)==null?void 0:Z.trim())||"Quick search projects"}),U=ce(()=>{var Z;return((Z=n.addActionLabel)==null?void 0:Z.trim())||"Add new project"}),q=ce(()=>{var Z;return((Z=n.addPlaceholder)==null?void 0:Z.trim())||"Project name or absolute path"}),$=ce(()=>{const Z=l.value.trim().toLowerCase();return Z?n.options.filter(ke=>ke.label.toLowerCase().includes(Z)||ke.value.toLowerCase().includes(Z)):n.options});function B(){n.disabled||(a.value=!a.value)}function F(Z){r("update:modelValue",Z),a.value=!1,l.value=""}function ae(){var Z;d.value=!0,c.value=((Z=n.defaultAddValue)==null?void 0:Z.trim())||"",Yt(()=>{var ke;return(ke=i.value)==null?void 0:ke.focus()})}function ue(){if(l.value.length>0){l.value="";return}a.value=!1}function he(){const Z=c.value.trim();Z&&(r("add",Z),d.value=!1,c.value="",a.value=!1,l.value="")}function _e(){d.value=!1,c.value="",a.value=!1,l.value=""}function re(Z){if(!a.value)return;const ke=s.value;if(!ke)return;const te=Z.target;te instanceof Node&&(ke.contains(te)||(a.value=!1,l.value="",d.value=!1,c.value=""))}return gt(a,Z=>{if(!Z){d.value=!1,c.value="";return}b.value&&Yt(()=>{var ke;return(ke=o.value)==null?void 0:ke.focus()})}),cr(()=>{window.addEventListener("pointerdown",re)}),ur(()=>{window.removeEventListener("pointerdown",re)}),(Z,ke)=>(_(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[v("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:B},[v("span",I_,de(f.value),1),Ie(Ha,{class:"composer-dropdown-chevron"})],8,T_),a.value?(_(),S("div",{key:0,class:dt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":p.value==="up","composer-dropdown-menu-wrap-down":p.value==="down"}])},[v("div",S_,[b.value?(_(),S("div",E_,[Hn(v("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ke[0]||(ke[0]=te=>l.value=te),class:"composer-dropdown-search-input",type:"text",placeholder:R.value,onKeydown:Ht(Ge(ue,["prevent"]),["esc"])},null,40,C_),[[Vn,l.value]])])):le("",!0),v("ul",A_,[(_(!0),S(Fe,null,bt($.value,te=>(_(),S("li",{key:te.value},[v("button",{class:dt(["composer-dropdown-option",{"is-selected":te.value===e.modelValue}]),type:"button",onClick:Te=>F(te.value)},de(te.label),11,R_)]))),128)),$.value.length===0?(_(),S("li",P_," No matching projects ")):le("",!0)]),O.value?(_(),S("div",x_,[d.value?(_(),S(Fe,{key:0},[Hn(v("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ke[1]||(ke[1]=te=>c.value=te),class:"composer-dropdown-add-input",type:"text",placeholder:q.value,onKeydown:[Ht(Ge(he,["prevent"]),["enter"]),Ht(Ge(_e,["prevent"]),["esc"])]},null,40,M_),[[Vn,c.value]]),v("div",{class:"composer-dropdown-add-actions"},[v("button",{type:"button",class:"composer-dropdown-add-btn",onClick:he},"Open"),v("button",{type:"button",class:"composer-dropdown-add-btn",onClick:_e},"Cancel")])],64)):(_(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},de(U.value),1))])):le("",!0)])],2)):le("",!0)],512))}}),aa=Ye(O_,[["__scopeId","data-v-7cfa2012"]]),N_=["disabled"],D_={class:"search-dropdown-value"},$_={class:"search-dropdown-search-wrap"},L_=["placeholder","onKeydown"],j_={key:0,class:"search-dropdown-list",role:"listbox"},B_=["onClick","onPointerenter"],F_={class:"search-dropdown-option-check"},U_={class:"search-dropdown-option-label"},H_={key:0,class:"search-dropdown-option-desc"},V_={key:1,class:"search-dropdown-empty"},W_=Pt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=j(null),o=j(null),i=j(!1),a=j(""),l=j(0),d=ce(()=>n.openDirection??"down"),c=ce(()=>new Set(n.selectedValues)),f=ce(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const $=n.options.find(B=>B.value===n.selectedValues[0]);return($==null?void 0:$.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),p=ce(()=>{const $=a.value.toLowerCase().trim();return $?n.options.filter(B=>{var F;return B.label.toLowerCase().includes($)||(((F=B.description)==null?void 0:F.toLowerCase().includes($))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Yt(()=>{var $;return($=o.value)==null?void 0:$.focus()})))}function O($){r("toggle",$.value,!c.value.has($.value))}function R($){p.value.length!==0&&(l.value=(l.value+$+p.value.length)%p.value.length)}function U(){const $=p.value[l.value];$&&O($)}function q($){if(!i.value)return;const B=s.value;if(!B)return;const F=$.target;F instanceof Node&&(B.contains(F)||(i.value=!1))}return gt(a,()=>{l.value=0}),cr(()=>window.addEventListener("pointerdown",q)),ur(()=>window.removeEventListener("pointerdown",q)),($,B)=>(_(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[v("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[v("span",D_,de(f.value),1),Ie(Ha,{class:"search-dropdown-chevron"})],8,N_),i.value?(_(),S("div",{key:0,class:dt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[v("div",$_,[Hn(v("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":B[0]||(B[0]=F=>a.value=F),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[B[1]||(B[1]=Ht(Ge(F=>i.value=!1,["prevent"]),["escape"])),Ht(Ge(U,["prevent"]),["enter"]),B[2]||(B[2]=Ht(Ge(F=>R(1),["prevent"]),["arrow-down"])),B[3]||(B[3]=Ht(Ge(F=>R(-1),["prevent"]),["arrow-up"]))]},null,40,L_),[[Vn,a.value]])]),p.value.length>0?(_(),S("ul",j_,[(_(!0),S(Fe,null,bt(p.value,(F,ae)=>(_(),S("li",{key:F.value},[v("button",{class:dt(["search-dropdown-option",{"is-selected":c.value.has(F.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ue=>O(F),onPointerenter:ue=>l.value=ae},[v("span",F_,de(c.value.has(F.value)?"✓":""),1),v("span",U_,de(F.label),1),F.description?(_(),S("span",H_,de(F.description),1)):le("",!0)],42,B_)]))),128))])):(_(),S("div",V_,"No results"))],2)):le("",!0)],512))}}),q_=Ye(W_,[["__scopeId","data-v-a0f2edd4"]]),G_={class:"skill-picker-header"},K_=["onKeydown"],z_={key:0,class:"skill-picker-list",role:"listbox"},J_=["onClick","onPointerenter"],Y_={class:"skill-picker-name"},Q_={key:0,class:"skill-picker-desc"},X_={key:1,class:"skill-picker-empty"},Z_=Pt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=j(null),o=j(null),i=j(""),a=j(0),l=ce(()=>{const p=i.value.toLowerCase().trim();return p?n.skills.filter(b=>b.name.toLowerCase().includes(p)||b.description.toLowerCase().includes(p)):n.skills}),d=ce(()=>{const p={};return n.anchorBottom!=null&&(p.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(p.left=`${n.anchorLeft}px`),p});function c(p){l.value.length!==0&&(a.value=(a.value+p+l.value.length)%l.value.length)}function f(){const p=l.value[a.value];p&&r("select",p)}return gt(()=>n.visible,p=>{p&&(i.value="",a.value=0,Yt(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),gt(i,()=>{a.value=0}),(p,b)=>e.visible?(_(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Dr(d.value)},[v("div",G_,[Hn(v("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=O=>i.value=O),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Ht(Ge(O=>p.$emit("close"),["prevent"]),["escape"])),Ht(Ge(f,["prevent"]),["enter"]),b[2]||(b[2]=Ht(Ge(O=>c(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Ht(Ge(O=>c(-1),["prevent"]),["arrow-up"]))]},null,40,K_),[[Vn,i.value]])]),l.value.length>0?(_(),S("ul",z_,[(_(!0),S(Fe,null,bt(l.value,(O,R)=>(_(),S("li",{key:O.path},[v("button",{class:dt(["skill-picker-item",{"is-highlighted":R===a.value}]),type:"button",onClick:U=>p.$emit("select",O),onPointerenter:U=>a.value=R},[v("span",Y_,de(O.name),1),O.description?(_(),S("span",Q_,de(O.description),1)):le("",!0)],42,J_)]))),128))])):(_(),S("div",X_,"No skills found"))],4)):le("",!0)}}),e0=Ye(Z_,[["__scopeId","data-v-d6a08788"]]),t0={key:0,class:"thread-composer-attachments"},n0=["src","alt"],r0=["aria-label","disabled","onClick"],s0={key:1,class:"thread-composer-file-chips"},o0=["title"],i0=["aria-label","disabled","onClick"],a0={key:2,class:"thread-composer-skill-chips"},l0={class:"thread-composer-skill-chip-name"},c0=["aria-label","onClick"],u0={class:"thread-composer-input-wrap"},d0={key:0,class:"thread-composer-file-mentions"},f0=["onMousedown"],h0={key:1,class:"thread-composer-file-mention-icon-markdown"},p0={class:"thread-composer-file-mention-text"},m0={class:"thread-composer-file-mention-name"},g0={key:0,class:"thread-composer-file-mention-dir"},v0={key:1,class:"thread-composer-file-mention-empty"},y0=["placeholder","disabled"],w0={class:"thread-composer-controls"},b0=["disabled"],_0={key:0,class:"thread-composer-attach-menu"},k0=["disabled"],T0=["disabled"],I0={class:"thread-composer-actions"},S0=["aria-label","title","disabled"],E0=["disabled"],C0=["aria-label","title","disabled"],A0=["disabled"],R0=["disabled"],P0=Pt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=j(""),o=j([]),i=j([]),a=j([]),{state:l,isSupported:d,startRecording:c,stopRecording:f}=wb({onTranscript:H=>{s.value=s.value?`${s.value}
43
- ${H}`:H}}),p=j(null),b=j(null),O=j(null),R=j(null),U=j(!1),q=j(!1),$=j(null),B=j(""),F=j([]),ae=j(!1),ue=j(0);let he=0,_e=null;const re=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Z=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],ke=ce(()=>n.models.map(H=>({value:H,label:H}))),te=ce(()=>n.skills??[]),Te=ce(()=>i.value.map(H=>H.path)),Be=ce(()=>(n.skills??[]).map(H=>({value:H.path,label:H.name,description:H.description}))),Ke=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ee=ce(()=>n.disabled||!n.activeThreadId),we=ce(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Ne=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function ot(H="steer"){var Q;const W=s.value.trim();if(Ke.value){if(r("submit",{text:W,imageUrls:o.value.map(k=>k.url),fileAttachments:[...a.value],skills:i.value.map(k=>({name:k.name,path:k.path})),mode:H}),s.value="",o.value=[],i.value=[],a.value=[],U.value=!1,q.value=!1,Y(),re){(Q=R.value)==null||Q.blur();return}Yt(()=>{var k;return(k=R.value)==null?void 0:k.focus()})}}function ze(){r("interrupt")}function it(H){r("update:selected-model",H)}function We(H){r("update:selected-reasoning-effort",H)}function Ze(){Ee.value||(U.value=!U.value)}function wt(){var H;(H=b.value)==null||H.click()}function vt(){var H;(H=O.value)==null||H.click()}function qe(H){o.value=o.value.filter(W=>W.id!==H)}function L(H){i.value=i.value.filter(W=>W.path!==H)}function se(H){a.value=a.value.filter(W=>W.fsPath!==H)}function ee(H){const W=H.replace(/\\/g,"/");if(a.value.some(C=>C.fsPath===W))return;const Q=W.split("/").filter(Boolean),k=Q[Q.length-1]??W;a.value=[...a.value,{label:k,path:W,fsPath:W}]}function pe(H){return H.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(H.name)}function Ae(H){if(!(!H||H.length===0))for(const W of Array.from(H))if(pe(W)){const Q=new FileReader;Q.onload=()=>{typeof Q.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:W.name,url:Q.result})},Q.readAsDataURL(W)}else u_(W).then(Q=>{Q&&ee(Q)}).catch(()=>{})}function g(H){H&&(H.value="")}function h(H){const W=H.target;Ae((W==null?void 0:W.files)??null),g(W),U.value=!1}function w(H){const W=H.target;Ae((W==null?void 0:W.files)??null),g(W),U.value=!1}function P(){const W=s.value.startsWith("/");W!==q.value&&(q.value=W),X()}function N(H){if(ae.value){if(H.key==="Escape"){H.preventDefault(),Y();return}if(H.key==="ArrowDown"){H.preventDefault(),F.value.length>0&&(ue.value=(ue.value+1)%F.value.length);return}if(H.key==="ArrowUp"){if(H.preventDefault(),F.value.length>0){const Q=F.value.length;ue.value=(ue.value+Q-1)%Q}return}if(H.key==="Enter"||H.key==="Tab"){H.preventDefault();const Q=F.value[ue.value];Q?V(Q):Y();return}}if(n.sendWithEnter!==!1?H.key==="Enter"&&!H.shiftKey:H.key==="Enter"&&(H.metaKey||H.ctrlKey)){H.preventDefault(),ot(n.isTurnInProgress?we.value:"steer");return}if(q.value){if(H.key==="Escape"){H.preventDefault(),D();return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){H.preventDefault();return}}}function D(){var H;q.value=!1,(H=R.value)==null||H.focus()}function Y(){ae.value=!1,$.value=null,B.value="",F.value=[],ue.value=0}function X(){const H=R.value;if(!H){Y();return}const W=H.selectionStart??s.value.length,k=s.value.slice(0,W).match(/(^|\s)(@[^\s@]*)$/);if(!k){Y();return}const C=k[2]??"",A=C.length,ne=W-A;$.value=ne,B.value=C.slice(1),ae.value=!0,J()}async function J(){if(!ae.value)return;const H=(n.cwd??"").trim();if(!H){F.value=[];return}_e&&clearTimeout(_e);const W=++he;_e=setTimeout(async()=>{try{const Q=await i_(H,B.value,20);if(!ae.value||W!==he)return;F.value=Q,ue.value=0}catch{if(!ae.value||W!==he)return;F.value=[]}},120)}function V(H){const W=R.value,Q=$.value;if(Q!==null&&W){const k=W.selectionStart??s.value.length;s.value=`${s.value.slice(0,Q)}${s.value.slice(k)}`.trimEnd()}ee(H.path),Y(),Yt(()=>W==null?void 0:W.focus())}function fe(H){const W=H.lastIndexOf("/");return W<0?H:H.slice(W+1)}function ie(H){const W=H.lastIndexOf("/");return W<=0?"":H.slice(0,W)}function ge(H){const W=fe(H),Q=W.lastIndexOf(".");return Q<=0?"":W.slice(Q+1).toLowerCase()}function ve(H){const W=ge(H);return W==="ts"?"TS":W==="tsx"?"TSX":W==="js"?"JS":W==="jsx"?"JSX":W==="json"?"{}":""}function De(H){const W=ge(H);return W.startsWith("ts")?"ts":W.startsWith("js")?"js":W==="json"?"json":"default"}function Ve(H){const W=ge(H);return W==="md"||W==="mdx"}function Pe(H){var W;i.value.some(Q=>Q.path===H.path)||(i.value=[...i.value,H]),s.value=s.value.startsWith("/")?"":s.value,q.value=!1,(W=R.value)==null||W.focus()}function et(H,W){if(W){const Q=(n.skills??[]).find(k=>k.path===H);Q&&!i.value.some(k=>k.path===H)&&(i.value=[...i.value,Q])}else i.value=i.value.filter(Q=>Q.path!==H)}function ft(H){if(!U.value)return;const W=p.value;if(!W)return;const Q=H.target;!Q||W.contains(Q)||(U.value=!1)}return cr(()=>{document.addEventListener("click",ft)}),ur(()=>{document.removeEventListener("click",ft),_e&&clearTimeout(_e)}),gt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],U.value=!1,q.value=!1,Y()}),gt(()=>n.cwd,()=>{ae.value&&J()}),(H,W)=>(_(),S("form",{class:"thread-composer",onSubmit:W[7]||(W[7]=Ge(Q=>ot("steer"),["prevent"]))},[v("div",{class:dt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(_(),S("div",t0,[(_(!0),S(Fe,null,bt(o.value,Q=>(_(),S("div",{key:Q.id,class:"thread-composer-attachment"},[v("img",{class:"thread-composer-attachment-image",src:Q.url,alt:Q.name||"Selected image"},null,8,n0),v("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${Q.name||"image"}`,disabled:Ee.value,onClick:k=>qe(Q.id)}," x ",8,r0)]))),128))])):le("",!0),a.value.length>0?(_(),S("div",s0,[(_(!0),S(Fe,null,bt(a.value,Q=>(_(),S("span",{key:Q.fsPath,class:"thread-composer-file-chip"},[Ie(Oo,{class:"thread-composer-file-chip-icon"}),v("span",{class:"thread-composer-file-chip-name",title:Q.fsPath},de(Q.label),9,o0),v("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${Q.label}`,disabled:Ee.value,onClick:k=>se(Q.fsPath)},"×",8,i0)]))),128))])):le("",!0),i.value.length>0?(_(),S("div",a0,[(_(!0),S(Fe,null,bt(i.value,Q=>(_(),S("span",{key:Q.path,class:"thread-composer-skill-chip"},[v("span",l0,de(Q.name),1),v("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${Q.name}`,onClick:k=>L(Q.path)},"×",8,c0)]))),128))])):le("",!0),v("div",u0,[ae.value?(_(),S("div",d0,[F.value.length>0?(_(!0),S(Fe,{key:0},bt(F.value,(Q,k)=>(_(),S("button",{key:Q.path,class:dt(["thread-composer-file-mention-row",{"is-active":k===ue.value}]),type:"button",onMousedown:Ge(C=>V(Q),["prevent"])},[ve(Q.path)?(_(),S("span",{key:0,class:dt(["thread-composer-file-mention-icon-badge",`is-${De(Q.path)}`])},de(ve(Q.path)),3)):Ve(Q.path)?(_(),S("span",h0,"↓")):(_(),pt(Oo,{key:2,class:"thread-composer-file-mention-icon-file"})),v("span",p0,[v("span",m0,de(fe(Q.path)),1),ie(Q.path)?(_(),S("span",g0,de(ie(Q.path)),1)):le("",!0)])],42,f0))),128)):(_(),S("div",v0,"No matching files"))])):le("",!0),Hn(v("textarea",{ref_key:"inputRef",ref:R,"onUpdate:modelValue":W[0]||(W[0]=Q=>s.value=Q),class:"thread-composer-input",placeholder:Ne.value,disabled:Ee.value,onInput:P,onKeydown:N},null,40,y0),[[Vn,s.value]]),Ie(e0,{skills:te.value,visible:q.value,"anchor-bottom":44,"anchor-left":0,onSelect:Pe,onClose:D},null,8,["skills","visible"])]),v("div",w0,[v("div",{ref_key:"attachMenuRootRef",ref:p,class:"thread-composer-attach"},[v("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ee.value,onClick:Ze}," + ",8,b0),U.value?(_(),S("div",_0,[v("button",{class:"thread-composer-attach-item",type:"button",disabled:Ee.value,onClick:wt}," Add photos & files ",8,k0),v("button",{class:"thread-composer-attach-item",type:"button",disabled:Ee.value,onClick:vt}," Take photo ",8,T0)])):le("",!0)],512),Ie(aa,{class:"thread-composer-control","model-value":e.selectedModel,options:ke.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":it},null,8,["model-value","options","disabled"]),Ie(q_,{class:"thread-composer-control",options:Be.value,"selected-values":Te.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:et},null,8,["options","selected-values","disabled"]),Ie(aa,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Z,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":We},null,8,["model-value","disabled"]),v("div",I0,[Me(d)&&!e.isTurnInProgress?(_(),S("button",{key:0,class:dt(["thread-composer-mic",{"thread-composer-mic--active":Me(l)!=="idle"}]),type:"button","aria-label":Me(l)==="recording"?"Stop dictation":"Hold to dictate",title:Me(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ee.value,onMousedown:W[1]||(W[1]=Ge((...Q)=>Me(c)&&Me(c)(...Q),["prevent"])),onMouseup:W[2]||(W[2]=(...Q)=>Me(f)&&Me(f)(...Q)),onMouseleave:W[3]||(W[3]=Q=>Me(l)==="recording"&&Me(f)()),onTouchstart:W[4]||(W[4]=Ge((...Q)=>Me(c)&&Me(c)(...Q),["prevent"])),onTouchend:W[5]||(W[5]=(...Q)=>Me(f)&&Me(f)(...Q))},[Ie(y_,{class:"thread-composer-mic-icon"})],42,S0)):le("",!0),e.isTurnInProgress?(_(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:ze},[Ie(k_,{class:"thread-composer-stop-icon"})],8,E0)):le("",!0),v("button",{class:dt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&we.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&we.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${we.value}`:"Send",disabled:!Ke.value,onClick:W[6]||(W[6]=Q=>ot(e.isTurnInProgress?we.value:"steer"))},[Ie(p_,{class:"thread-composer-submit-icon"})],10,C0)])])],2),v("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ee.value,onChange:h},null,40,A0),v("input",{ref_key:"cameraCaptureInputRef",ref:O,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ee.value,onChange:w},null,40,R0)],32))}}),xc=Ye(P0,[["__scopeId","data-v-983e7906"]]),x0={key:0,class:"queued-messages"},M0={class:"queued-messages-inner"},O0={class:"queued-row-text"},N0={class:"queued-row-actions"},D0=["onClick"],$0=["onClick"],L0=Pt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(_(),S("div",x0,[v("div",M0,[(_(!0),S(Fe,null,bt(e.messages,r=>(_(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=v("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),v("span",O0,de(r.text),1),v("div",N0,[v("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,D0),v("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>t.$emit("delete",r.id)},[...n[0]||(n[0]=[v("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,$0)])]))),128))])])):le("",!0)}}),j0=Ye(L0,[["__scopeId","data-v-ea583733"]]),B0=()=>{};var Mc={};/**
44
- * @license
45
- * Copyright 2017 Google LLC
46
- *
47
- * Licensed under the Apache License, Version 2.0 (the "License");
48
- * you may not use this file except in compliance with the License.
49
- * You may obtain a copy of the License at
50
- *
51
- * http://www.apache.org/licenses/LICENSE-2.0
52
- *
53
- * Unless required by applicable law or agreed to in writing, software
54
- * distributed under the License is distributed on an "AS IS" BASIS,
55
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56
- * See the License for the specific language governing permissions and
57
- * limitations under the License.
58
- */const Yd=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},F0=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},Qd={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,d=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let p=(a&15)<<2|d>>6,b=d&63;l||(b=64,i||(p=64)),r.push(n[c],n[f],n[p],n[b])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Yd(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):F0(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const o=n[e.charAt(s++)],a=s<e.length?n[e.charAt(s)]:0;++s;const d=s<e.length?n[e.charAt(s)]:64;++s;const f=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||d==null||f==null)throw new U0;const p=o<<2|a>>4;if(r.push(p),d!==64){const b=a<<4&240|d>>2;if(r.push(b),f!==64){const O=d<<6&192|f;r.push(O)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class U0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const H0=function(e){const t=Yd(e);return Qd.encodeByteArray(t,!0)},Xd=function(e){return H0(e).replace(/\./g,"")},Zd=function(e){try{return Qd.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
59
- * @license
60
- * Copyright 2022 Google LLC
61
- *
62
- * Licensed under the Apache License, Version 2.0 (the "License");
63
- * you may not use this file except in compliance with the License.
64
- * You may obtain a copy of the License at
65
- *
66
- * http://www.apache.org/licenses/LICENSE-2.0
67
- *
68
- * Unless required by applicable law or agreed to in writing, software
69
- * distributed under the License is distributed on an "AS IS" BASIS,
70
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71
- * See the License for the specific language governing permissions and
72
- * limitations under the License.
73
- */function V0(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
74
- * @license
75
- * Copyright 2022 Google LLC
76
- *
77
- * Licensed under the Apache License, Version 2.0 (the "License");
78
- * you may not use this file except in compliance with the License.
79
- * You may obtain a copy of the License at
80
- *
81
- * http://www.apache.org/licenses/LICENSE-2.0
82
- *
83
- * Unless required by applicable law or agreed to in writing, software
84
- * distributed under the License is distributed on an "AS IS" BASIS,
85
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
- * See the License for the specific language governing permissions and
87
- * limitations under the License.
88
- */const W0=()=>V0().__FIREBASE_DEFAULTS__,q0=()=>{if(typeof process>"u"||typeof Mc>"u")return;const e=Mc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},G0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&Zd(e[1]);return t&&JSON.parse(t)},Ga=()=>{try{return B0()||W0()||q0()||G0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},K0=e=>{var t,n;return(n=(t=Ga())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},ef=()=>{var e;return(e=Ga())==null?void 0:e.config},tf=e=>{var t;return(t=Ga())==null?void 0:t[`_${e}`]};/**
89
- * @license
90
- * Copyright 2017 Google LLC
91
- *
92
- * Licensed under the Apache License, Version 2.0 (the "License");
93
- * you may not use this file except in compliance with the License.
94
- * You may obtain a copy of the License at
95
- *
96
- * http://www.apache.org/licenses/LICENSE-2.0
97
- *
98
- * Unless required by applicable law or agreed to in writing, software
99
- * distributed under the License is distributed on an "AS IS" BASIS,
100
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
101
- * See the License for the specific language governing permissions and
102
- * limitations under the License.
103
- */class z0{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/**
104
- * @license
105
- * Copyright 2025 Google LLC
106
- *
107
- * Licensed under the Apache License, Version 2.0 (the "License");
108
- * you may not use this file except in compliance with the License.
109
- * You may obtain a copy of the License at
110
- *
111
- * http://www.apache.org/licenses/LICENSE-2.0
112
- *
113
- * Unless required by applicable law or agreed to in writing, software
114
- * distributed under the License is distributed on an "AS IS" BASIS,
115
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
116
- * See the License for the specific language governing permissions and
117
- * limitations under the License.
118
- */function ni(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function J0(e){return(await fetch(e,{credentials:"include"})).ok}const $s={};function Y0(){const e={prod:[],emulator:[]};for(const t of Object.keys($s))$s[t]?e.emulator.push(t):e.prod.push(t);return e}function Q0(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let Oc=!1;function X0(e,t){if(typeof window>"u"||typeof document>"u"||!ni(window.location.host)||$s[e]===t||$s[e]||Oc)return;$s[e]=t;function n(p){return`__firebase__banner__${p}`}const r="__firebase__banner",o=Y0().prod.length>0;function i(){const p=document.getElementById(r);p&&p.remove()}function a(p){p.style.display="flex",p.style.background="#7faaf0",p.style.position="fixed",p.style.bottom="5px",p.style.left="5px",p.style.padding=".5em",p.style.borderRadius="5px",p.style.alignItems="center"}function l(p,b){p.setAttribute("width","24"),p.setAttribute("id",b),p.setAttribute("height","24"),p.setAttribute("viewBox","0 0 24 24"),p.setAttribute("fill","none"),p.style.marginLeft="-6px"}function d(){const p=document.createElement("span");return p.style.cursor="pointer",p.style.marginLeft="16px",p.style.fontSize="24px",p.innerHTML=" &times;",p.onclick=()=>{Oc=!0,i()},p}function c(p,b){p.setAttribute("id",b),p.innerText="Learn more",p.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",p.setAttribute("target","__blank"),p.style.paddingLeft="5px",p.style.textDecoration="underline"}function f(){const p=Q0(r),b=n("text"),O=document.getElementById(b)||document.createElement("span"),R=n("learnmore"),U=document.getElementById(R)||document.createElement("a"),q=n("preprendIcon"),$=document.getElementById(q)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.created){const B=p.element;a(B),c(U,R);const F=d();l($,q),B.append($,O,U,F),document.body.appendChild(B)}o?(O.innerText="Preview backend disconnected.",$.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
119
- <path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
120
- </g>
121
- <defs>
122
- <clipPath id="clip0_6013_33858">
123
- <rect width="24" height="24" fill="white"/>
124
- </clipPath>
125
- </defs>`):($.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
126
- <path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
127
- </g>
128
- <defs>
129
- <clipPath id="clip0_6083_34804">
130
- <rect width="24" height="24" fill="white"/>
131
- </clipPath>
132
- </defs>`,O.innerText="Preview backend running in this workspace."),O.setAttribute("id",b)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/**
133
- * @license
134
- * Copyright 2017 Google LLC
135
- *
136
- * Licensed under the Apache License, Version 2.0 (the "License");
137
- * you may not use this file except in compliance with the License.
138
- * You may obtain a copy of the License at
139
- *
140
- * http://www.apache.org/licenses/LICENSE-2.0
141
- *
142
- * Unless required by applicable law or agreed to in writing, software
143
- * distributed under the License is distributed on an "AS IS" BASIS,
144
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
145
- * See the License for the specific language governing permissions and
146
- * limitations under the License.
147
- */function Wt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Z0(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Wt())}function ek(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function tk(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function nk(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function rk(){const e=Wt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function sk(){try{return typeof indexedDB=="object"}catch{return!1}}function ok(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var o;t(((o=s.error)==null?void 0:o.message)||"")}}catch(n){t(n)}})}/**
148
- * @license
149
- * Copyright 2017 Google LLC
150
- *
151
- * Licensed under the Apache License, Version 2.0 (the "License");
152
- * you may not use this file except in compliance with the License.
153
- * You may obtain a copy of the License at
154
- *
155
- * http://www.apache.org/licenses/LICENSE-2.0
156
- *
157
- * Unless required by applicable law or agreed to in writing, software
158
- * distributed under the License is distributed on an "AS IS" BASIS,
159
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160
- * See the License for the specific language governing permissions and
161
- * limitations under the License.
162
- */const ik="FirebaseError";class dr extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=ik,Object.setPrototypeOf(this,dr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,eo.prototype.create)}}class eo{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},s=`${this.service}/${t}`,o=this.errors[t],i=o?ak(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new dr(s,a,r)}}function ak(e,t){return e.replace(lk,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const lk=/\{\$([^}]+)}/g;function ck(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function is(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(Nc(o)&&Nc(i)){if(!is(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function Nc(e){return e!==null&&typeof e=="object"}/**
163
- * @license
164
- * Copyright 2017 Google LLC
165
- *
166
- * Licensed under the Apache License, Version 2.0 (the "License");
167
- * you may not use this file except in compliance with the License.
168
- * You may obtain a copy of the License at
169
- *
170
- * http://www.apache.org/licenses/LICENSE-2.0
171
- *
172
- * Unless required by applicable law or agreed to in writing, software
173
- * distributed under the License is distributed on an "AS IS" BASIS,
174
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
175
- * See the License for the specific language governing permissions and
176
- * limitations under the License.
177
- */function to(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(s=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function uk(e,t){const n=new dk(e,t);return n.subscribe.bind(n)}class dk{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let s;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");fk(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Pi),s.error===void 0&&(s.error=Pi),s.complete===void 0&&(s.complete=Pi);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,t)}sendOne(t,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function fk(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function Pi(){}/**
178
- * @license
179
- * Copyright 2021 Google LLC
180
- *
181
- * Licensed under the Apache License, Version 2.0 (the "License");
182
- * you may not use this file except in compliance with the License.
183
- * You may obtain a copy of the License at
184
- *
185
- * http://www.apache.org/licenses/LICENSE-2.0
186
- *
187
- * Unless required by applicable law or agreed to in writing, software
188
- * distributed under the License is distributed on an "AS IS" BASIS,
189
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
- * See the License for the specific language governing permissions and
191
- * limitations under the License.
192
- */function us(e){return e&&e._delegate?e._delegate:e}class as{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
193
- * @license
194
- * Copyright 2019 Google LLC
195
- *
196
- * Licensed under the Apache License, Version 2.0 (the "License");
197
- * you may not use this file except in compliance with the License.
198
- * You may obtain a copy of the License at
199
- *
200
- * http://www.apache.org/licenses/LICENSE-2.0
201
- *
202
- * Unless required by applicable law or agreed to in writing, software
203
- * distributed under the License is distributed on an "AS IS" BASIS,
204
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
- * See the License for the specific language governing permissions and
206
- * limitations under the License.
207
- */const Cr="[DEFAULT]";/**
208
- * @license
209
- * Copyright 2019 Google LLC
210
- *
211
- * Licensed under the Apache License, Version 2.0 (the "License");
212
- * you may not use this file except in compliance with the License.
213
- * You may obtain a copy of the License at
214
- *
215
- * http://www.apache.org/licenses/LICENSE-2.0
216
- *
217
- * Unless required by applicable law or agreed to in writing, software
218
- * distributed under the License is distributed on an "AS IS" BASIS,
219
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
220
- * See the License for the specific language governing permissions and
221
- * limitations under the License.
222
- */class hk{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new z0;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),r=(t==null?void 0:t.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(mk(t))try{this.getOrInitializeService({instanceIdentifier:Cr})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:s});r.resolve(o)}catch{}}}}clearInstance(t=Cr){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Cr){return this.instances.has(t)}getOptions(t=Cr){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,i]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(o);r===a&&i.resolve(s)}return s}onInit(t,n){const r=this.normalizeInstanceIdentifier(n),s=this.onInitCallbacks.get(r)??new Set;s.add(t),this.onInitCallbacks.set(r,s);const o=this.instances.get(r);return o&&t(o,r),()=>{s.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:pk(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch{}return r||null}normalizeInstanceIdentifier(t=Cr){return this.component?this.component.multipleInstances?t:Cr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function pk(e){return e===Cr?void 0:e}function mk(e){return e.instantiationMode==="EAGER"}/**
223
- * @license
224
- * Copyright 2019 Google LLC
225
- *
226
- * Licensed under the Apache License, Version 2.0 (the "License");
227
- * you may not use this file except in compliance with the License.
228
- * You may obtain a copy of the License at
229
- *
230
- * http://www.apache.org/licenses/LICENSE-2.0
231
- *
232
- * Unless required by applicable law or agreed to in writing, software
233
- * distributed under the License is distributed on an "AS IS" BASIS,
234
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
235
- * See the License for the specific language governing permissions and
236
- * limitations under the License.
237
- */class gk{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new hk(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
238
- * @license
239
- * Copyright 2017 Google LLC
240
- *
241
- * Licensed under the Apache License, Version 2.0 (the "License");
242
- * you may not use this file except in compliance with the License.
243
- * You may obtain a copy of the License at
244
- *
245
- * http://www.apache.org/licenses/LICENSE-2.0
246
- *
247
- * Unless required by applicable law or agreed to in writing, software
248
- * distributed under the License is distributed on an "AS IS" BASIS,
249
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
250
- * See the License for the specific language governing permissions and
251
- * limitations under the License.
252
- */var ct;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(ct||(ct={}));const vk={debug:ct.DEBUG,verbose:ct.VERBOSE,info:ct.INFO,warn:ct.WARN,error:ct.ERROR,silent:ct.SILENT},yk=ct.INFO,wk={[ct.DEBUG]:"log",[ct.VERBOSE]:"log",[ct.INFO]:"info",[ct.WARN]:"warn",[ct.ERROR]:"error"},bk=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=wk[t];if(s)console[s](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class nf{constructor(t){this.name=t,this._logLevel=yk,this._logHandler=bk,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in ct))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?vk[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,ct.DEBUG,...t),this._logHandler(this,ct.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,ct.VERBOSE,...t),this._logHandler(this,ct.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,ct.INFO,...t),this._logHandler(this,ct.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,ct.WARN,...t),this._logHandler(this,ct.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,ct.ERROR,...t),this._logHandler(this,ct.ERROR,...t)}}const _k=(e,t)=>t.some(n=>e instanceof n);let Dc,$c;function kk(){return Dc||(Dc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Tk(){return $c||($c=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rf=new WeakMap,la=new WeakMap,sf=new WeakMap,xi=new WeakMap,Ka=new WeakMap;function Ik(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(or(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&rf.set(n,e)}).catch(()=>{}),Ka.set(t,e),t}function Sk(e){if(la.has(e))return;const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",i),e.removeEventListener("abort",i)},o=()=>{n(),s()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",o),e.addEventListener("error",i),e.addEventListener("abort",i)});la.set(e,t)}let ca={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return la.get(e);if(t==="objectStoreNames")return e.objectStoreNames||sf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return or(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function Ek(e){ca=e(ca)}function Ck(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Mi(this),t,...n);return sf.set(r,t.sort?t.sort():[t]),or(r)}:Tk().includes(e)?function(...t){return e.apply(Mi(this),t),or(rf.get(this))}:function(...t){return or(e.apply(Mi(this),t))}}function Ak(e){return typeof e=="function"?Ck(e):(e instanceof IDBTransaction&&Sk(e),_k(e,kk())?new Proxy(e,ca):e)}function or(e){if(e instanceof IDBRequest)return Ik(e);if(xi.has(e))return xi.get(e);const t=Ak(e);return t!==e&&(xi.set(e,t),Ka.set(t,e)),t}const Mi=e=>Ka.get(e);function Rk(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=or(i);return r&&i.addEventListener("upgradeneeded",l=>{r(or(i.result),l.oldVersion,l.newVersion,or(i.transaction),l)}),n&&i.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{o&&l.addEventListener("close",()=>o()),s&&l.addEventListener("versionchange",d=>s(d.oldVersion,d.newVersion,d))}).catch(()=>{}),a}const Pk=["get","getKey","getAll","getAllKeys","count"],xk=["put","add","delete","clear"],Oi=new Map;function Lc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Oi.get(t))return Oi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=xk.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||Pk.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let d=l.store;return r&&(d=d.index(a.shift())),(await Promise.all([d[n](...a),s&&l.done]))[0]};return Oi.set(t,o),o}Ek(e=>({...e,get:(t,n,r)=>Lc(t,n)||e.get(t,n,r),has:(t,n)=>!!Lc(t,n)||e.has(t,n)}));/**
253
- * @license
254
- * Copyright 2019 Google LLC
255
- *
256
- * Licensed under the Apache License, Version 2.0 (the "License");
257
- * you may not use this file except in compliance with the License.
258
- * You may obtain a copy of the License at
259
- *
260
- * http://www.apache.org/licenses/LICENSE-2.0
261
- *
262
- * Unless required by applicable law or agreed to in writing, software
263
- * distributed under the License is distributed on an "AS IS" BASIS,
264
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
265
- * See the License for the specific language governing permissions and
266
- * limitations under the License.
267
- */class Mk{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(Ok(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function Ok(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const ua="@firebase/app",jc="0.14.9";/**
268
- * @license
269
- * Copyright 2019 Google LLC
270
- *
271
- * Licensed under the Apache License, Version 2.0 (the "License");
272
- * you may not use this file except in compliance with the License.
273
- * You may obtain a copy of the License at
274
- *
275
- * http://www.apache.org/licenses/LICENSE-2.0
276
- *
277
- * Unless required by applicable law or agreed to in writing, software
278
- * distributed under the License is distributed on an "AS IS" BASIS,
279
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
280
- * See the License for the specific language governing permissions and
281
- * limitations under the License.
282
- */const Wn=new nf("@firebase/app"),Nk="@firebase/app-compat",Dk="@firebase/analytics-compat",$k="@firebase/analytics",Lk="@firebase/app-check-compat",jk="@firebase/app-check",Bk="@firebase/auth",Fk="@firebase/auth-compat",Uk="@firebase/database",Hk="@firebase/data-connect",Vk="@firebase/database-compat",Wk="@firebase/functions",qk="@firebase/functions-compat",Gk="@firebase/installations",Kk="@firebase/installations-compat",zk="@firebase/messaging",Jk="@firebase/messaging-compat",Yk="@firebase/performance",Qk="@firebase/performance-compat",Xk="@firebase/remote-config",Zk="@firebase/remote-config-compat",eT="@firebase/storage",tT="@firebase/storage-compat",nT="@firebase/firestore",rT="@firebase/ai",sT="@firebase/firestore-compat",oT="firebase",iT="12.10.0";/**
283
- * @license
284
- * Copyright 2019 Google LLC
285
- *
286
- * Licensed under the Apache License, Version 2.0 (the "License");
287
- * you may not use this file except in compliance with the License.
288
- * You may obtain a copy of the License at
289
- *
290
- * http://www.apache.org/licenses/LICENSE-2.0
291
- *
292
- * Unless required by applicable law or agreed to in writing, software
293
- * distributed under the License is distributed on an "AS IS" BASIS,
294
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
295
- * See the License for the specific language governing permissions and
296
- * limitations under the License.
297
- */const da="[DEFAULT]",aT={[ua]:"fire-core",[Nk]:"fire-core-compat",[$k]:"fire-analytics",[Dk]:"fire-analytics-compat",[jk]:"fire-app-check",[Lk]:"fire-app-check-compat",[Bk]:"fire-auth",[Fk]:"fire-auth-compat",[Uk]:"fire-rtdb",[Hk]:"fire-data-connect",[Vk]:"fire-rtdb-compat",[Wk]:"fire-fn",[qk]:"fire-fn-compat",[Gk]:"fire-iid",[Kk]:"fire-iid-compat",[zk]:"fire-fcm",[Jk]:"fire-fcm-compat",[Yk]:"fire-perf",[Qk]:"fire-perf-compat",[Xk]:"fire-rc",[Zk]:"fire-rc-compat",[eT]:"fire-gcs",[tT]:"fire-gcs-compat",[nT]:"fire-fst",[sT]:"fire-fst-compat",[rT]:"fire-vertex","fire-js":"fire-js",[oT]:"fire-js-all"};/**
298
- * @license
299
- * Copyright 2019 Google LLC
300
- *
301
- * Licensed under the Apache License, Version 2.0 (the "License");
302
- * you may not use this file except in compliance with the License.
303
- * You may obtain a copy of the License at
304
- *
305
- * http://www.apache.org/licenses/LICENSE-2.0
306
- *
307
- * Unless required by applicable law or agreed to in writing, software
308
- * distributed under the License is distributed on an "AS IS" BASIS,
309
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
310
- * See the License for the specific language governing permissions and
311
- * limitations under the License.
312
- */const Ks=new Map,lT=new Map,fa=new Map;function Bc(e,t){try{e.container.addComponent(t)}catch(n){Wn.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function zs(e){const t=e.name;if(fa.has(t))return Wn.debug(`There were multiple attempts to register component ${t}.`),!1;fa.set(t,e);for(const n of Ks.values())Bc(n,e);for(const n of lT.values())Bc(n,e);return!0}function of(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function wn(e){return e==null?!1:e.settings!==void 0}/**
313
- * @license
314
- * Copyright 2019 Google LLC
315
- *
316
- * Licensed under the Apache License, Version 2.0 (the "License");
317
- * you may not use this file except in compliance with the License.
318
- * You may obtain a copy of the License at
319
- *
320
- * http://www.apache.org/licenses/LICENSE-2.0
321
- *
322
- * Unless required by applicable law or agreed to in writing, software
323
- * distributed under the License is distributed on an "AS IS" BASIS,
324
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
325
- * See the License for the specific language governing permissions and
326
- * limitations under the License.
327
- */const cT={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},ir=new eo("app","Firebase",cT);/**
328
- * @license
329
- * Copyright 2019 Google LLC
330
- *
331
- * Licensed under the Apache License, Version 2.0 (the "License");
332
- * you may not use this file except in compliance with the License.
333
- * You may obtain a copy of the License at
334
- *
335
- * http://www.apache.org/licenses/LICENSE-2.0
336
- *
337
- * Unless required by applicable law or agreed to in writing, software
338
- * distributed under the License is distributed on an "AS IS" BASIS,
339
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
340
- * See the License for the specific language governing permissions and
341
- * limitations under the License.
342
- */class uT{constructor(t,n,r){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new as("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw ir.create("app-deleted",{appName:this._name})}}/**
343
- * @license
344
- * Copyright 2019 Google LLC
345
- *
346
- * Licensed under the Apache License, Version 2.0 (the "License");
347
- * you may not use this file except in compliance with the License.
348
- * You may obtain a copy of the License at
349
- *
350
- * http://www.apache.org/licenses/LICENSE-2.0
351
- *
352
- * Unless required by applicable law or agreed to in writing, software
353
- * distributed under the License is distributed on an "AS IS" BASIS,
354
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
355
- * See the License for the specific language governing permissions and
356
- * limitations under the License.
357
- */const no=iT;function af(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:da,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw ir.create("bad-app-name",{appName:String(s)});if(n||(n=ef()),!n)throw ir.create("no-options");const o=Ks.get(s);if(o){if(is(n,o.options)&&is(r,o.config))return o;throw ir.create("duplicate-app",{appName:s})}const i=new gk(s);for(const l of fa.values())i.addComponent(l);const a=new uT(n,r,i);return Ks.set(s,a),a}function lf(e=da){const t=Ks.get(e);if(!t&&e===da&&ef())return af();if(!t)throw ir.create("no-app",{appName:e});return t}function dT(){return Array.from(Ks.values())}function Zr(e,t,n){let r=aT[e]??e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const i=[`Unable to register library "${r}" with version "${t}":`];s&&i.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&i.push("and"),o&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Wn.warn(i.join(" "));return}zs(new as(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
358
- * @license
359
- * Copyright 2021 Google LLC
360
- *
361
- * Licensed under the Apache License, Version 2.0 (the "License");
362
- * you may not use this file except in compliance with the License.
363
- * You may obtain a copy of the License at
364
- *
365
- * http://www.apache.org/licenses/LICENSE-2.0
366
- *
367
- * Unless required by applicable law or agreed to in writing, software
368
- * distributed under the License is distributed on an "AS IS" BASIS,
369
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
370
- * See the License for the specific language governing permissions and
371
- * limitations under the License.
372
- */const fT="firebase-heartbeat-database",hT=1,Js="firebase-heartbeat-store";let Ni=null;function cf(){return Ni||(Ni=Rk(fT,hT,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Js)}catch(n){console.warn(n)}}}}).catch(e=>{throw ir.create("idb-open",{originalErrorMessage:e.message})})),Ni}async function pT(e){try{const n=(await cf()).transaction(Js),r=await n.objectStore(Js).get(uf(e));return await n.done,r}catch(t){if(t instanceof dr)Wn.warn(t.message);else{const n=ir.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Wn.warn(n.message)}}}async function Fc(e,t){try{const r=(await cf()).transaction(Js,"readwrite");await r.objectStore(Js).put(t,uf(e)),await r.done}catch(n){if(n instanceof dr)Wn.warn(n.message);else{const r=ir.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Wn.warn(r.message)}}}function uf(e){return`${e.name}!${e.options.appId}`}/**
373
- * @license
374
- * Copyright 2021 Google LLC
375
- *
376
- * Licensed under the Apache License, Version 2.0 (the "License");
377
- * you may not use this file except in compliance with the License.
378
- * You may obtain a copy of the License at
379
- *
380
- * http://www.apache.org/licenses/LICENSE-2.0
381
- *
382
- * Unless required by applicable law or agreed to in writing, software
383
- * distributed under the License is distributed on an "AS IS" BASIS,
384
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
385
- * See the License for the specific language governing permissions and
386
- * limitations under the License.
387
- */const mT=1024,gT=30;class vT{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new wT(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Uc();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(i=>i.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:s}),this._heartbeatsCache.heartbeats.length>gT){const i=bT(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Wn.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Uc(),{heartbeatsToSend:r,unsentEntries:s}=yT(this._heartbeatsCache.heartbeats),o=Xd(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return Wn.warn(n),""}}}function Uc(){return new Date().toISOString().substring(0,10)}function yT(e,t=mT){const n=[];let r=e.slice();for(const s of e){const o=n.find(i=>i.agent===s.agent);if(o){if(o.dates.push(s.date),Hc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Hc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class wT{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return sk()?ok().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await pT(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Fc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Fc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Hc(e){return Xd(JSON.stringify({version:2,heartbeats:e})).length}function bT(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/**
388
- * @license
389
- * Copyright 2019 Google LLC
390
- *
391
- * Licensed under the Apache License, Version 2.0 (the "License");
392
- * you may not use this file except in compliance with the License.
393
- * You may obtain a copy of the License at
394
- *
395
- * http://www.apache.org/licenses/LICENSE-2.0
396
- *
397
- * Unless required by applicable law or agreed to in writing, software
398
- * distributed under the License is distributed on an "AS IS" BASIS,
399
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
400
- * See the License for the specific language governing permissions and
401
- * limitations under the License.
402
- */function _T(e){zs(new as("platform-logger",t=>new Mk(t),"PRIVATE")),zs(new as("heartbeat",t=>new vT(t),"PRIVATE")),Zr(ua,jc,e),Zr(ua,jc,"esm2020"),Zr("fire-js","")}_T("");var kT="firebase",TT="12.10.0";/**
403
- * @license
404
- * Copyright 2020 Google LLC
405
- *
406
- * Licensed under the Apache License, Version 2.0 (the "License");
407
- * you may not use this file except in compliance with the License.
408
- * You may obtain a copy of the License at
409
- *
410
- * http://www.apache.org/licenses/LICENSE-2.0
411
- *
412
- * Unless required by applicable law or agreed to in writing, software
413
- * distributed under the License is distributed on an "AS IS" BASIS,
414
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
415
- * See the License for the specific language governing permissions and
416
- * limitations under the License.
417
- */Zr(kT,TT,"app");function df(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const IT=df,ff=new eo("auth","Firebase",df());/**
418
- * @license
419
- * Copyright 2020 Google LLC
420
- *
421
- * Licensed under the Apache License, Version 2.0 (the "License");
422
- * you may not use this file except in compliance with the License.
423
- * You may obtain a copy of the License at
424
- *
425
- * http://www.apache.org/licenses/LICENSE-2.0
426
- *
427
- * Unless required by applicable law or agreed to in writing, software
428
- * distributed under the License is distributed on an "AS IS" BASIS,
429
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
430
- * See the License for the specific language governing permissions and
431
- * limitations under the License.
432
- */const No=new nf("@firebase/auth");function ST(e,...t){No.logLevel<=ct.WARN&&No.warn(`Auth (${no}): ${e}`,...t)}function _o(e,...t){No.logLevel<=ct.ERROR&&No.error(`Auth (${no}): ${e}`,...t)}/**
433
- * @license
434
- * Copyright 2020 Google LLC
435
- *
436
- * Licensed under the Apache License, Version 2.0 (the "License");
437
- * you may not use this file except in compliance with the License.
438
- * You may obtain a copy of the License at
439
- *
440
- * http://www.apache.org/licenses/LICENSE-2.0
441
- *
442
- * Unless required by applicable law or agreed to in writing, software
443
- * distributed under the License is distributed on an "AS IS" BASIS,
444
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
445
- * See the License for the specific language governing permissions and
446
- * limitations under the License.
447
- */function In(e,...t){throw Ja(e,...t)}function an(e,...t){return Ja(e,...t)}function za(e,t,n){const r={...IT(),[t]:n};return new eo("auth","Firebase",r).create(t,{appName:e.name})}function Nr(e){return za(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ET(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&In(e,"argument-error"),za(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Ja(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return ff.create(e,...t)}function Le(e,t,...n){if(!e)throw Ja(t,...n)}function $n(e){const t="INTERNAL ASSERTION FAILED: "+e;throw _o(t),new Error(t)}function qn(e,t){e||$n(t)}/**
448
- * @license
449
- * Copyright 2020 Google LLC
450
- *
451
- * Licensed under the Apache License, Version 2.0 (the "License");
452
- * you may not use this file except in compliance with the License.
453
- * You may obtain a copy of the License at
454
- *
455
- * http://www.apache.org/licenses/LICENSE-2.0
456
- *
457
- * Unless required by applicable law or agreed to in writing, software
458
- * distributed under the License is distributed on an "AS IS" BASIS,
459
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
460
- * See the License for the specific language governing permissions and
461
- * limitations under the License.
462
- */function ha(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function CT(){return Vc()==="http:"||Vc()==="https:"}function Vc(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
463
- * @license
464
- * Copyright 2020 Google LLC
465
- *
466
- * Licensed under the Apache License, Version 2.0 (the "License");
467
- * you may not use this file except in compliance with the License.
468
- * You may obtain a copy of the License at
469
- *
470
- * http://www.apache.org/licenses/LICENSE-2.0
471
- *
472
- * Unless required by applicable law or agreed to in writing, software
473
- * distributed under the License is distributed on an "AS IS" BASIS,
474
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
475
- * See the License for the specific language governing permissions and
476
- * limitations under the License.
477
- */function AT(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(CT()||tk()||"connection"in navigator)?navigator.onLine:!0}function RT(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
478
- * @license
479
- * Copyright 2020 Google LLC
480
- *
481
- * Licensed under the Apache License, Version 2.0 (the "License");
482
- * you may not use this file except in compliance with the License.
483
- * You may obtain a copy of the License at
484
- *
485
- * http://www.apache.org/licenses/LICENSE-2.0
486
- *
487
- * Unless required by applicable law or agreed to in writing, software
488
- * distributed under the License is distributed on an "AS IS" BASIS,
489
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
490
- * See the License for the specific language governing permissions and
491
- * limitations under the License.
492
- */class ro{constructor(t,n){this.shortDelay=t,this.longDelay=n,qn(n>t,"Short delay should be less than long delay!"),this.isMobile=Z0()||nk()}get(){return AT()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
493
- * @license
494
- * Copyright 2020 Google LLC
495
- *
496
- * Licensed under the Apache License, Version 2.0 (the "License");
497
- * you may not use this file except in compliance with the License.
498
- * You may obtain a copy of the License at
499
- *
500
- * http://www.apache.org/licenses/LICENSE-2.0
501
- *
502
- * Unless required by applicable law or agreed to in writing, software
503
- * distributed under the License is distributed on an "AS IS" BASIS,
504
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
505
- * See the License for the specific language governing permissions and
506
- * limitations under the License.
507
- */function Ya(e,t){qn(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
508
- * @license
509
- * Copyright 2020 Google LLC
510
- *
511
- * Licensed under the Apache License, Version 2.0 (the "License");
512
- * you may not use this file except in compliance with the License.
513
- * You may obtain a copy of the License at
514
- *
515
- * http://www.apache.org/licenses/LICENSE-2.0
516
- *
517
- * Unless required by applicable law or agreed to in writing, software
518
- * distributed under the License is distributed on an "AS IS" BASIS,
519
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
520
- * See the License for the specific language governing permissions and
521
- * limitations under the License.
522
- */class hf{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;$n("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;$n("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;$n("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
523
- * @license
524
- * Copyright 2020 Google LLC
525
- *
526
- * Licensed under the Apache License, Version 2.0 (the "License");
527
- * you may not use this file except in compliance with the License.
528
- * You may obtain a copy of the License at
529
- *
530
- * http://www.apache.org/licenses/LICENSE-2.0
531
- *
532
- * Unless required by applicable law or agreed to in writing, software
533
- * distributed under the License is distributed on an "AS IS" BASIS,
534
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
535
- * See the License for the specific language governing permissions and
536
- * limitations under the License.
537
- */const PT={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
538
- * @license
539
- * Copyright 2020 Google LLC
540
- *
541
- * Licensed under the Apache License, Version 2.0 (the "License");
542
- * you may not use this file except in compliance with the License.
543
- * You may obtain a copy of the License at
544
- *
545
- * http://www.apache.org/licenses/LICENSE-2.0
546
- *
547
- * Unless required by applicable law or agreed to in writing, software
548
- * distributed under the License is distributed on an "AS IS" BASIS,
549
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
550
- * See the License for the specific language governing permissions and
551
- * limitations under the License.
552
- */const xT=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],MT=new ro(3e4,6e4);function Qa(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function ds(e,t,n,r,s={}){return pf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=to({key:e.config.apiKey,...i}).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const d={method:t,headers:l,...o};return ek()||(d.referrerPolicy="no-referrer"),e.emulatorConfig&&ni(e.emulatorConfig.host)&&(d.credentials="include"),hf.fetch()(await mf(e,e.config.apiHost,n,a),d)})}async function pf(e,t,n){e._canInitEmulator=!1;const r={...PT,...t};try{const s=new NT(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw uo(e,"account-exists-with-different-credential",i);if(o.ok&&!("errorMessage"in i))return i;{const a=o.ok?i.errorMessage:i.error.message,[l,d]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw uo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw uo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw uo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(d)throw za(e,c,d);In(e,c)}}catch(s){if(s instanceof dr)throw s;In(e,"network-request-failed",{message:String(s)})}}async function OT(e,t,n,r,s={}){const o=await ds(e,t,n,r,s);return"mfaPendingCredential"in o&&In(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function mf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?Ya(e.config,s):`${e.config.apiScheme}://${s}`;return xT.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class NT{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(an(this.auth,"network-request-failed")),MT.get())})}}function uo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=an(e,t,r);return s.customData._tokenResponse=n,s}/**
553
- * @license
554
- * Copyright 2020 Google LLC
555
- *
556
- * Licensed under the Apache License, Version 2.0 (the "License");
557
- * you may not use this file except in compliance with the License.
558
- * You may obtain a copy of the License at
559
- *
560
- * http://www.apache.org/licenses/LICENSE-2.0
561
- *
562
- * Unless required by applicable law or agreed to in writing, software
563
- * distributed under the License is distributed on an "AS IS" BASIS,
564
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
565
- * See the License for the specific language governing permissions and
566
- * limitations under the License.
567
- */async function DT(e,t){return ds(e,"POST","/v1/accounts:delete",t)}async function Do(e,t){return ds(e,"POST","/v1/accounts:lookup",t)}/**
568
- * @license
569
- * Copyright 2020 Google LLC
570
- *
571
- * Licensed under the Apache License, Version 2.0 (the "License");
572
- * you may not use this file except in compliance with the License.
573
- * You may obtain a copy of the License at
574
- *
575
- * http://www.apache.org/licenses/LICENSE-2.0
576
- *
577
- * Unless required by applicable law or agreed to in writing, software
578
- * distributed under the License is distributed on an "AS IS" BASIS,
579
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
580
- * See the License for the specific language governing permissions and
581
- * limitations under the License.
582
- */function Ls(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function $T(e,t=!1){const n=us(e),r=await n.getIdToken(t),s=Xa(r);Le(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o=typeof s.firebase=="object"?s.firebase:void 0,i=o==null?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:Ls(Di(s.auth_time)),issuedAtTime:Ls(Di(s.iat)),expirationTime:Ls(Di(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Di(e){return Number(e)*1e3}function Xa(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return _o("JWT malformed, contained fewer than 3 sections"),null;try{const s=Zd(n);return s?JSON.parse(s):(_o("Failed to decode base64 JWT payload"),null)}catch(s){return _o("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function Wc(e){const t=Xa(e);return Le(t,"internal-error"),Le(typeof t.exp<"u","internal-error"),Le(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
583
- * @license
584
- * Copyright 2020 Google LLC
585
- *
586
- * Licensed under the Apache License, Version 2.0 (the "License");
587
- * you may not use this file except in compliance with the License.
588
- * You may obtain a copy of the License at
589
- *
590
- * http://www.apache.org/licenses/LICENSE-2.0
591
- *
592
- * Unless required by applicable law or agreed to in writing, software
593
- * distributed under the License is distributed on an "AS IS" BASIS,
594
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
595
- * See the License for the specific language governing permissions and
596
- * limitations under the License.
597
- */async function Ys(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof dr&&LT(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function LT({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
598
- * @license
599
- * Copyright 2020 Google LLC
600
- *
601
- * Licensed under the Apache License, Version 2.0 (the "License");
602
- * you may not use this file except in compliance with the License.
603
- * You may obtain a copy of the License at
604
- *
605
- * http://www.apache.org/licenses/LICENSE-2.0
606
- *
607
- * Unless required by applicable law or agreed to in writing, software
608
- * distributed under the License is distributed on an "AS IS" BASIS,
609
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
610
- * See the License for the specific language governing permissions and
611
- * limitations under the License.
612
- */class jT{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
613
- * @license
614
- * Copyright 2020 Google LLC
615
- *
616
- * Licensed under the Apache License, Version 2.0 (the "License");
617
- * you may not use this file except in compliance with the License.
618
- * You may obtain a copy of the License at
619
- *
620
- * http://www.apache.org/licenses/LICENSE-2.0
621
- *
622
- * Unless required by applicable law or agreed to in writing, software
623
- * distributed under the License is distributed on an "AS IS" BASIS,
624
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
625
- * See the License for the specific language governing permissions and
626
- * limitations under the License.
627
- */class pa{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ls(this.lastLoginAt),this.creationTime=Ls(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
628
- * @license
629
- * Copyright 2019 Google LLC
630
- *
631
- * Licensed under the Apache License, Version 2.0 (the "License");
632
- * you may not use this file except in compliance with the License.
633
- * You may obtain a copy of the License at
634
- *
635
- * http://www.apache.org/licenses/LICENSE-2.0
636
- *
637
- * Unless required by applicable law or agreed to in writing, software
638
- * distributed under the License is distributed on an "AS IS" BASIS,
639
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
640
- * See the License for the specific language governing permissions and
641
- * limitations under the License.
642
- */async function $o(e){var f;const t=e.auth,n=await e.getIdToken(),r=await Ys(e,Do(t,{idToken:n}));Le(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(f=s.providerUserInfo)!=null&&f.length?gf(s.providerUserInfo):[],i=FT(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),d=a?l:!1,c={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new pa(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(e,c)}async function BT(e){const t=us(e);await $o(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function FT(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function gf(e){return e.map(({providerId:t,...n})=>({providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/**
643
- * @license
644
- * Copyright 2020 Google LLC
645
- *
646
- * Licensed under the Apache License, Version 2.0 (the "License");
647
- * you may not use this file except in compliance with the License.
648
- * You may obtain a copy of the License at
649
- *
650
- * http://www.apache.org/licenses/LICENSE-2.0
651
- *
652
- * Unless required by applicable law or agreed to in writing, software
653
- * distributed under the License is distributed on an "AS IS" BASIS,
654
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
655
- * See the License for the specific language governing permissions and
656
- * limitations under the License.
657
- */async function UT(e,t){const n=await pf(e,{},async()=>{const r=to({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await mf(e,s,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return e.emulatorConfig&&ni(e.emulatorConfig.host)&&(l.credentials="include"),hf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function HT(e,t){return ds(e,"POST","/v2/accounts:revokeToken",Qa(e,t))}/**
658
- * @license
659
- * Copyright 2020 Google LLC
660
- *
661
- * Licensed under the Apache License, Version 2.0 (the "License");
662
- * you may not use this file except in compliance with the License.
663
- * You may obtain a copy of the License at
664
- *
665
- * http://www.apache.org/licenses/LICENSE-2.0
666
- *
667
- * Unless required by applicable law or agreed to in writing, software
668
- * distributed under the License is distributed on an "AS IS" BASIS,
669
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
670
- * See the License for the specific language governing permissions and
671
- * limitations under the License.
672
- */class es{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Le(t.idToken,"internal-error"),Le(typeof t.idToken<"u","internal-error"),Le(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Wc(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Le(t.length!==0,"internal-error");const n=Wc(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Le(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(t,n){const{accessToken:r,refreshToken:s,expiresIn:o}=await UT(t,n);this.updateTokensAndExpiration(r,s,Number(o))}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:s,expirationTime:o}=n,i=new es;return r&&(Le(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Le(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Le(typeof o=="number","internal-error",{appName:t}),i.expirationTime=o),i}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new es,this.toJSON())}_performRefresh(){return $n("not implemented")}}/**
673
- * @license
674
- * Copyright 2020 Google LLC
675
- *
676
- * Licensed under the Apache License, Version 2.0 (the "License");
677
- * you may not use this file except in compliance with the License.
678
- * You may obtain a copy of the License at
679
- *
680
- * http://www.apache.org/licenses/LICENSE-2.0
681
- *
682
- * Unless required by applicable law or agreed to in writing, software
683
- * distributed under the License is distributed on an "AS IS" BASIS,
684
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
685
- * See the License for the specific language governing permissions and
686
- * limitations under the License.
687
- */function Qn(e,t){Le(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class rn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new jT(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new pa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await Ys(this,this.stsTokenManager.getToken(this.auth,t));return Le(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return $T(this,t)}reload(){return BT(this)}_assign(t){this!==t&&(Le(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new rn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Le(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await $o(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(wn(this.auth.app))return Promise.reject(Nr(this.auth));const t=await this.getIdToken();return await Ys(this,DT(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){const r=n.displayName??void 0,s=n.email??void 0,o=n.phoneNumber??void 0,i=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,d=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:p,isAnonymous:b,providerData:O,stsTokenManager:R}=n;Le(f&&R,t,"internal-error");const U=es.fromJSON(this.name,R);Le(typeof f=="string",t,"internal-error"),Qn(r,t.name),Qn(s,t.name),Le(typeof p=="boolean",t,"internal-error"),Le(typeof b=="boolean",t,"internal-error"),Qn(o,t.name),Qn(i,t.name),Qn(a,t.name),Qn(l,t.name),Qn(d,t.name),Qn(c,t.name);const q=new rn({uid:f,auth:t,email:s,emailVerified:p,displayName:r,isAnonymous:b,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:U,createdAt:d,lastLoginAt:c});return O&&Array.isArray(O)&&(q.providerData=O.map($=>({...$}))),l&&(q._redirectEventId=l),q}static async _fromIdTokenResponse(t,n,r=!1){const s=new es;s.updateFromServerResponse(n);const o=new rn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await $o(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Le(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?gf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new es;a.updateFromIdToken(r);const l=new rn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),d={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new pa(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,d),l}}/**
688
- * @license
689
- * Copyright 2020 Google LLC
690
- *
691
- * Licensed under the Apache License, Version 2.0 (the "License");
692
- * you may not use this file except in compliance with the License.
693
- * You may obtain a copy of the License at
694
- *
695
- * http://www.apache.org/licenses/LICENSE-2.0
696
- *
697
- * Unless required by applicable law or agreed to in writing, software
698
- * distributed under the License is distributed on an "AS IS" BASIS,
699
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
700
- * See the License for the specific language governing permissions and
701
- * limitations under the License.
702
- */const qc=new Map;function Ln(e){qn(e instanceof Function,"Expected a class definition");let t=qc.get(e);return t?(qn(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,qc.set(e,t),t)}/**
703
- * @license
704
- * Copyright 2019 Google LLC
705
- *
706
- * Licensed under the Apache License, Version 2.0 (the "License");
707
- * you may not use this file except in compliance with the License.
708
- * You may obtain a copy of the License at
709
- *
710
- * http://www.apache.org/licenses/LICENSE-2.0
711
- *
712
- * Unless required by applicable law or agreed to in writing, software
713
- * distributed under the License is distributed on an "AS IS" BASIS,
714
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
715
- * See the License for the specific language governing permissions and
716
- * limitations under the License.
717
- */class vf{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}vf.type="NONE";const Gc=vf;/**
718
- * @license
719
- * Copyright 2019 Google LLC
720
- *
721
- * Licensed under the Apache License, Version 2.0 (the "License");
722
- * you may not use this file except in compliance with the License.
723
- * You may obtain a copy of the License at
724
- *
725
- * http://www.apache.org/licenses/LICENSE-2.0
726
- *
727
- * Unless required by applicable law or agreed to in writing, software
728
- * distributed under the License is distributed on an "AS IS" BASIS,
729
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
730
- * See the License for the specific language governing permissions and
731
- * limitations under the License.
732
- */function ko(e,t,n){return`firebase:${e}:${t}:${n}`}class ts{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=ko(this.userKey,s.apiKey,o),this.fullPersistenceKey=ko("persistence",s.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);if(!t)return null;if(typeof t=="string"){const n=await Do(this.auth,{idToken:t}).catch(()=>{});return n?rn._fromGetAccountInfoResponse(this.auth,n,t):null}return rn._fromJSON(this.auth,t)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,n,r="authUser"){if(!n.length)return new ts(Ln(Gc),t,r);const s=(await Promise.all(n.map(async d=>{if(await d._isAvailable())return d}))).filter(d=>d);let o=s[0]||Ln(Gc);const i=ko(r,t.config.apiKey,t.name);let a=null;for(const d of n)try{const c=await d._get(i);if(c){let f;if(typeof c=="string"){const p=await Do(t,{idToken:c}).catch(()=>{});if(!p)break;f=await rn._fromGetAccountInfoResponse(t,p,c)}else f=rn._fromJSON(t,c);d!==o&&(a=f),o=d;break}}catch{}const l=s.filter(d=>d._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new ts(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async d=>{if(d!==o)try{await d._remove(i)}catch{}})),new ts(o,t,r))}}/**
733
- * @license
734
- * Copyright 2020 Google LLC
735
- *
736
- * Licensed under the Apache License, Version 2.0 (the "License");
737
- * you may not use this file except in compliance with the License.
738
- * You may obtain a copy of the License at
739
- *
740
- * http://www.apache.org/licenses/LICENSE-2.0
741
- *
742
- * Unless required by applicable law or agreed to in writing, software
743
- * distributed under the License is distributed on an "AS IS" BASIS,
744
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
745
- * See the License for the specific language governing permissions and
746
- * limitations under the License.
747
- */function Kc(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(_f(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(yf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Tf(t))return"Blackberry";if(If(t))return"Webos";if(wf(t))return"Safari";if((t.includes("chrome/")||bf(t))&&!t.includes("edge/"))return"Chrome";if(kf(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function yf(e=Wt()){return/firefox\//i.test(e)}function wf(e=Wt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function bf(e=Wt()){return/crios\//i.test(e)}function _f(e=Wt()){return/iemobile/i.test(e)}function kf(e=Wt()){return/android/i.test(e)}function Tf(e=Wt()){return/blackberry/i.test(e)}function If(e=Wt()){return/webos/i.test(e)}function Za(e=Wt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function VT(e=Wt()){var t;return Za(e)&&!!((t=window.navigator)!=null&&t.standalone)}function WT(){return rk()&&document.documentMode===10}function Sf(e=Wt()){return Za(e)||kf(e)||If(e)||Tf(e)||/windows phone/i.test(e)||_f(e)}/**
748
- * @license
749
- * Copyright 2020 Google LLC
750
- *
751
- * Licensed under the Apache License, Version 2.0 (the "License");
752
- * you may not use this file except in compliance with the License.
753
- * You may obtain a copy of the License at
754
- *
755
- * http://www.apache.org/licenses/LICENSE-2.0
756
- *
757
- * Unless required by applicable law or agreed to in writing, software
758
- * distributed under the License is distributed on an "AS IS" BASIS,
759
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
760
- * See the License for the specific language governing permissions and
761
- * limitations under the License.
762
- */function Ef(e,t=[]){let n;switch(e){case"Browser":n=Kc(Wt());break;case"Worker":n=`${Kc(Wt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${no}/${r}`}/**
763
- * @license
764
- * Copyright 2022 Google LLC
765
- *
766
- * Licensed under the Apache License, Version 2.0 (the "License");
767
- * you may not use this file except in compliance with the License.
768
- * You may obtain a copy of the License at
769
- *
770
- * http://www.apache.org/licenses/LICENSE-2.0
771
- *
772
- * Unless required by applicable law or agreed to in writing, software
773
- * distributed under the License is distributed on an "AS IS" BASIS,
774
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
775
- * See the License for the specific language governing permissions and
776
- * limitations under the License.
777
- */class qT{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((i,a)=>{try{const l=t(o);i(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)await r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
778
- * @license
779
- * Copyright 2023 Google LLC
780
- *
781
- * Licensed under the Apache License, Version 2.0 (the "License");
782
- * you may not use this file except in compliance with the License.
783
- * You may obtain a copy of the License at
784
- *
785
- * http://www.apache.org/licenses/LICENSE-2.0
786
- *
787
- * Unless required by applicable law or agreed to in writing, software
788
- * distributed under the License is distributed on an "AS IS" BASIS,
789
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
790
- * See the License for the specific language governing permissions and
791
- * limitations under the License.
792
- */async function GT(e,t={}){return ds(e,"GET","/v2/passwordPolicy",Qa(e,t))}/**
793
- * @license
794
- * Copyright 2023 Google LLC
795
- *
796
- * Licensed under the Apache License, Version 2.0 (the "License");
797
- * you may not use this file except in compliance with the License.
798
- * You may obtain a copy of the License at
799
- *
800
- * http://www.apache.org/licenses/LICENSE-2.0
801
- *
802
- * Unless required by applicable law or agreed to in writing, software
803
- * distributed under the License is distributed on an "AS IS" BASIS,
804
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
805
- * See the License for the specific language governing permissions and
806
- * limitations under the License.
807
- */const KT=6;class zT{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??KT,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=t.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,n),this.validatePasswordCharacterOptions(t,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),s&&(n.meetsMaxPasswordLength=t.length<=s)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s<t.length;s++)r=t.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,s,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=o))}}/**
808
- * @license
809
- * Copyright 2020 Google LLC
810
- *
811
- * Licensed under the Apache License, Version 2.0 (the "License");
812
- * you may not use this file except in compliance with the License.
813
- * You may obtain a copy of the License at
814
- *
815
- * http://www.apache.org/licenses/LICENSE-2.0
816
- *
817
- * Unless required by applicable law or agreed to in writing, software
818
- * distributed under the License is distributed on an "AS IS" BASIS,
819
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
820
- * See the License for the specific language governing permissions and
821
- * limitations under the License.
822
- */class JT{constructor(t,n,r,s){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new zc(this),this.idTokenSubscription=new zc(this),this.beforeStateQueue=new qT(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=ff,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Ln(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await ts.create(this,t),(r=this._resolvePersistenceManagerAvailable)==null||r.call(this),!this._deleted)){if((s=this._popupRedirectResolver)!=null&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((o=this.currentUser)==null?void 0:o.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const t=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),await this.currentUser.getIdToken();return}await this._updateCurrentUser(t,!0)}}async initializeCurrentUserFromIdToken(t){try{const n=await Do(this,{idToken:t}),r=await rn._fromGetAccountInfoResponse(this,n,t);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(t){var o;if(wn(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(a,a))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=(o=this.redirectUser)==null?void 0:o._redirectEventId,a=r==null?void 0:r._redirectEventId,l=await this.tryRedirectSignIn(t);(!i||i===a)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Le(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(t){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(t){try{await $o(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=RT()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(wn(this.app))return Promise.reject(Nr(this));const n=t?us(t):null;return n&&Le(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(t,n=!1){if(!this._deleted)return t&&Le(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()})}async signOut(){return wn(this.app)?Promise.reject(Nr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return wn(this.app)?Promise.reject(Nr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Ln(t))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(t){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const t=await GT(this),n=new zT(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(t){this._errorFactory=new eo("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}async revokeAccessToken(t){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await HT(this,r)}}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)==null?void 0:t.toJSON()}}async _setRedirectUser(t,n){const r=await this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const n=t&&Ln(t)||this._popupRedirectResolver;Le(n,this,"argument-error"),this.redirectPersistenceManager=await ts.create(this,[Ln(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)==null?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const t=((n=this.currentUser)==null?void 0:n.uid)??null;this.lastNotifiedUid!==t&&(this.lastNotifiedUid=t,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,s){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let i=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Le(a,this,"internal-error"),a.then(()=>{i||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,s);return()=>{i=!0,l()}}else{const l=t.addObserver(n);return()=>{i=!0,l()}}}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return Le(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Ef(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(wn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((n=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:n.getToken());return t!=null&&t.error&&ST(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function ri(e){return us(e)}class zc{constructor(t){this.auth=t,this.observer=null,this.addObserver=uk(n=>this.observer=n)}get next(){return Le(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
823
- * @license
824
- * Copyright 2020 Google LLC
825
- *
826
- * Licensed under the Apache License, Version 2.0 (the "License");
827
- * you may not use this file except in compliance with the License.
828
- * You may obtain a copy of the License at
829
- *
830
- * http://www.apache.org/licenses/LICENSE-2.0
831
- *
832
- * Unless required by applicable law or agreed to in writing, software
833
- * distributed under the License is distributed on an "AS IS" BASIS,
834
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
835
- * See the License for the specific language governing permissions and
836
- * limitations under the License.
837
- */let el={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function YT(e){el=e}function QT(e){return el.loadJS(e)}function XT(){return el.gapiScript}function ZT(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
838
- * @license
839
- * Copyright 2020 Google LLC
840
- *
841
- * Licensed under the Apache License, Version 2.0 (the "License");
842
- * you may not use this file except in compliance with the License.
843
- * You may obtain a copy of the License at
844
- *
845
- * http://www.apache.org/licenses/LICENSE-2.0
846
- *
847
- * Unless required by applicable law or agreed to in writing, software
848
- * distributed under the License is distributed on an "AS IS" BASIS,
849
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
850
- * See the License for the specific language governing permissions and
851
- * limitations under the License.
852
- */function e1(e,t){const n=of(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(is(o,t??{}))return s;In(s,"already-initialized")}return n.initialize({options:t})}function t1(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Ln);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function n1(e,t,n){const r=ri(e);Le(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Cf(t),{host:i,port:a}=r1(t),l=a===null?"":`:${a}`,d={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Le(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Le(is(d,r.config.emulator)&&is(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=d,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,ni(i)?(J0(`${o}//${i}${l}`),X0("Auth",!0)):s1()}function Cf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function r1(e){const t=Cf(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const o=s[1];return{host:o,port:Jc(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:Jc(i)}}}function Jc(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function s1(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
853
- * @license
854
- * Copyright 2020 Google LLC
855
- *
856
- * Licensed under the Apache License, Version 2.0 (the "License");
857
- * you may not use this file except in compliance with the License.
858
- * You may obtain a copy of the License at
859
- *
860
- * http://www.apache.org/licenses/LICENSE-2.0
861
- *
862
- * Unless required by applicable law or agreed to in writing, software
863
- * distributed under the License is distributed on an "AS IS" BASIS,
864
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
865
- * See the License for the specific language governing permissions and
866
- * limitations under the License.
867
- */class Af{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return $n("not implemented")}_getIdTokenResponse(t){return $n("not implemented")}_linkToIdToken(t,n){return $n("not implemented")}_getReauthenticationResolver(t){return $n("not implemented")}}/**
868
- * @license
869
- * Copyright 2020 Google LLC
870
- *
871
- * Licensed under the Apache License, Version 2.0 (the "License");
872
- * you may not use this file except in compliance with the License.
873
- * You may obtain a copy of the License at
874
- *
875
- * http://www.apache.org/licenses/LICENSE-2.0
876
- *
877
- * Unless required by applicable law or agreed to in writing, software
878
- * distributed under the License is distributed on an "AS IS" BASIS,
879
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
880
- * See the License for the specific language governing permissions and
881
- * limitations under the License.
882
- */async function ns(e,t){return OT(e,"POST","/v1/accounts:signInWithIdp",Qa(e,t))}/**
883
- * @license
884
- * Copyright 2020 Google LLC
885
- *
886
- * Licensed under the Apache License, Version 2.0 (the "License");
887
- * you may not use this file except in compliance with the License.
888
- * You may obtain a copy of the License at
889
- *
890
- * http://www.apache.org/licenses/LICENSE-2.0
891
- *
892
- * Unless required by applicable law or agreed to in writing, software
893
- * distributed under the License is distributed on an "AS IS" BASIS,
894
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
895
- * See the License for the specific language governing permissions and
896
- * limitations under the License.
897
- */const o1="http://localhost";class $r extends Af{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new $r(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):In("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:s,...o}=n;if(!r||!s)return null;const i=new $r(r,s);return i.idToken=o.idToken||void 0,i.accessToken=o.accessToken||void 0,i.secret=o.secret,i.nonce=o.nonce,i.pendingToken=o.pendingToken||null,i}_getIdTokenResponse(t){const n=this.buildRequest();return ns(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,ns(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,ns(t,n)}buildRequest(){const t={requestUri:o1,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=to(n)}return t}}/**
898
- * @license
899
- * Copyright 2020 Google LLC
900
- *
901
- * Licensed under the Apache License, Version 2.0 (the "License");
902
- * you may not use this file except in compliance with the License.
903
- * You may obtain a copy of the License at
904
- *
905
- * http://www.apache.org/licenses/LICENSE-2.0
906
- *
907
- * Unless required by applicable law or agreed to in writing, software
908
- * distributed under the License is distributed on an "AS IS" BASIS,
909
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
910
- * See the License for the specific language governing permissions and
911
- * limitations under the License.
912
- */class tl{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
913
- * @license
914
- * Copyright 2019 Google LLC
915
- *
916
- * Licensed under the Apache License, Version 2.0 (the "License");
917
- * you may not use this file except in compliance with the License.
918
- * You may obtain a copy of the License at
919
- *
920
- * http://www.apache.org/licenses/LICENSE-2.0
921
- *
922
- * Unless required by applicable law or agreed to in writing, software
923
- * distributed under the License is distributed on an "AS IS" BASIS,
924
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
925
- * See the License for the specific language governing permissions and
926
- * limitations under the License.
927
- */class so extends tl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
928
- * @license
929
- * Copyright 2020 Google LLC
930
- *
931
- * Licensed under the Apache License, Version 2.0 (the "License");
932
- * you may not use this file except in compliance with the License.
933
- * You may obtain a copy of the License at
934
- *
935
- * http://www.apache.org/licenses/LICENSE-2.0
936
- *
937
- * Unless required by applicable law or agreed to in writing, software
938
- * distributed under the License is distributed on an "AS IS" BASIS,
939
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
940
- * See the License for the specific language governing permissions and
941
- * limitations under the License.
942
- */class nr extends so{constructor(){super("facebook.com")}static credential(t){return $r._fromParams({providerId:nr.PROVIDER_ID,signInMethod:nr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return nr.credentialFromTaggedObject(t)}static credentialFromError(t){return nr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return nr.credential(t.oauthAccessToken)}catch{return null}}}nr.FACEBOOK_SIGN_IN_METHOD="facebook.com";nr.PROVIDER_ID="facebook.com";/**
943
- * @license
944
- * Copyright 2020 Google LLC
945
- *
946
- * Licensed under the Apache License, Version 2.0 (the "License");
947
- * you may not use this file except in compliance with the License.
948
- * You may obtain a copy of the License at
949
- *
950
- * http://www.apache.org/licenses/LICENSE-2.0
951
- *
952
- * Unless required by applicable law or agreed to in writing, software
953
- * distributed under the License is distributed on an "AS IS" BASIS,
954
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
955
- * See the License for the specific language governing permissions and
956
- * limitations under the License.
957
- */class rr extends so{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return $r._fromParams({providerId:rr.PROVIDER_ID,signInMethod:rr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return rr.credentialFromTaggedObject(t)}static credentialFromError(t){return rr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return rr.credential(n,r)}catch{return null}}}rr.GOOGLE_SIGN_IN_METHOD="google.com";rr.PROVIDER_ID="google.com";/**
958
- * @license
959
- * Copyright 2020 Google LLC
960
- *
961
- * Licensed under the Apache License, Version 2.0 (the "License");
962
- * you may not use this file except in compliance with the License.
963
- * You may obtain a copy of the License at
964
- *
965
- * http://www.apache.org/licenses/LICENSE-2.0
966
- *
967
- * Unless required by applicable law or agreed to in writing, software
968
- * distributed under the License is distributed on an "AS IS" BASIS,
969
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
970
- * See the License for the specific language governing permissions and
971
- * limitations under the License.
972
- */class bn extends so{constructor(){super("github.com")}static credential(t){return $r._fromParams({providerId:bn.PROVIDER_ID,signInMethod:bn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return bn.credentialFromTaggedObject(t)}static credentialFromError(t){return bn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return bn.credential(t.oauthAccessToken)}catch{return null}}}bn.GITHUB_SIGN_IN_METHOD="github.com";bn.PROVIDER_ID="github.com";/**
973
- * @license
974
- * Copyright 2020 Google LLC
975
- *
976
- * Licensed under the Apache License, Version 2.0 (the "License");
977
- * you may not use this file except in compliance with the License.
978
- * You may obtain a copy of the License at
979
- *
980
- * http://www.apache.org/licenses/LICENSE-2.0
981
- *
982
- * Unless required by applicable law or agreed to in writing, software
983
- * distributed under the License is distributed on an "AS IS" BASIS,
984
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
985
- * See the License for the specific language governing permissions and
986
- * limitations under the License.
987
- */class sr extends so{constructor(){super("twitter.com")}static credential(t,n){return $r._fromParams({providerId:sr.PROVIDER_ID,signInMethod:sr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return sr.credentialFromTaggedObject(t)}static credentialFromError(t){return sr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return sr.credential(n,r)}catch{return null}}}sr.TWITTER_SIGN_IN_METHOD="twitter.com";sr.PROVIDER_ID="twitter.com";/**
988
- * @license
989
- * Copyright 2020 Google LLC
990
- *
991
- * Licensed under the Apache License, Version 2.0 (the "License");
992
- * you may not use this file except in compliance with the License.
993
- * You may obtain a copy of the License at
994
- *
995
- * http://www.apache.org/licenses/LICENSE-2.0
996
- *
997
- * Unless required by applicable law or agreed to in writing, software
998
- * distributed under the License is distributed on an "AS IS" BASIS,
999
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1000
- * See the License for the specific language governing permissions and
1001
- * limitations under the License.
1002
- */class ls{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,n,r,s=!1){const o=await rn._fromIdTokenResponse(t,r,s),i=Yc(r);return new ls({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=Yc(r);return new ls({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function Yc(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
1003
- * @license
1004
- * Copyright 2020 Google LLC
1005
- *
1006
- * Licensed under the Apache License, Version 2.0 (the "License");
1007
- * you may not use this file except in compliance with the License.
1008
- * You may obtain a copy of the License at
1009
- *
1010
- * http://www.apache.org/licenses/LICENSE-2.0
1011
- *
1012
- * Unless required by applicable law or agreed to in writing, software
1013
- * distributed under the License is distributed on an "AS IS" BASIS,
1014
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1015
- * See the License for the specific language governing permissions and
1016
- * limitations under the License.
1017
- */class Lo extends dr{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Lo.prototype),this.customData={appName:t.name,tenantId:t.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,s){return new Lo(t,n,r,s)}}function Rf(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Lo._fromErrorAndOperation(e,o,t,r):o})}async function i1(e,t,n=!1){const r=await Ys(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ls._forOperation(e,"link",r)}/**
1018
- * @license
1019
- * Copyright 2019 Google LLC
1020
- *
1021
- * Licensed under the Apache License, Version 2.0 (the "License");
1022
- * you may not use this file except in compliance with the License.
1023
- * You may obtain a copy of the License at
1024
- *
1025
- * http://www.apache.org/licenses/LICENSE-2.0
1026
- *
1027
- * Unless required by applicable law or agreed to in writing, software
1028
- * distributed under the License is distributed on an "AS IS" BASIS,
1029
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1030
- * See the License for the specific language governing permissions and
1031
- * limitations under the License.
1032
- */async function a1(e,t,n=!1){const{auth:r}=e;if(wn(r.app))return Promise.reject(Nr(r));const s="reauthenticate";try{const o=await Ys(e,Rf(r,s,t,e),n);Le(o.idToken,r,"internal-error");const i=Xa(o.idToken);Le(i,r,"internal-error");const{sub:a}=i;return Le(e.uid===a,r,"user-mismatch"),ls._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&In(r,"user-mismatch"),o}}/**
1033
- * @license
1034
- * Copyright 2020 Google LLC
1035
- *
1036
- * Licensed under the Apache License, Version 2.0 (the "License");
1037
- * you may not use this file except in compliance with the License.
1038
- * You may obtain a copy of the License at
1039
- *
1040
- * http://www.apache.org/licenses/LICENSE-2.0
1041
- *
1042
- * Unless required by applicable law or agreed to in writing, software
1043
- * distributed under the License is distributed on an "AS IS" BASIS,
1044
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1045
- * See the License for the specific language governing permissions and
1046
- * limitations under the License.
1047
- */async function l1(e,t,n=!1){if(wn(e.app))return Promise.reject(Nr(e));const r="signIn",s=await Rf(e,r,t),o=await ls._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function c1(e,t,n,r){return us(e).onIdTokenChanged(t,n,r)}function u1(e,t,n){return us(e).beforeAuthStateChanged(t,n)}const jo="__sak";/**
1048
- * @license
1049
- * Copyright 2019 Google LLC
1050
- *
1051
- * Licensed under the Apache License, Version 2.0 (the "License");
1052
- * you may not use this file except in compliance with the License.
1053
- * You may obtain a copy of the License at
1054
- *
1055
- * http://www.apache.org/licenses/LICENSE-2.0
1056
- *
1057
- * Unless required by applicable law or agreed to in writing, software
1058
- * distributed under the License is distributed on an "AS IS" BASIS,
1059
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1060
- * See the License for the specific language governing permissions and
1061
- * limitations under the License.
1062
- */class Pf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(jo,"1"),this.storage.removeItem(jo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1063
- * @license
1064
- * Copyright 2020 Google LLC
1065
- *
1066
- * Licensed under the Apache License, Version 2.0 (the "License");
1067
- * you may not use this file except in compliance with the License.
1068
- * You may obtain a copy of the License at
1069
- *
1070
- * http://www.apache.org/licenses/LICENSE-2.0
1071
- *
1072
- * Unless required by applicable law or agreed to in writing, software
1073
- * distributed under the License is distributed on an "AS IS" BASIS,
1074
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1075
- * See the License for the specific language governing permissions and
1076
- * limitations under the License.
1077
- */const d1=1e3,f1=10;class xf extends Pf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Sf(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&t(n,s,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((i,a,l)=>{this.notifyListeners(i,l)});return}const r=t.key;n?this.detachListener():this.stopPolling();const s=()=>{const i=this.storage.getItem(r);!n&&this.localCache[r]===i||this.notifyListeners(r,i)},o=this.storage.getItem(r);WT()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,f1):s()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},d1)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}xf.type="LOCAL";const h1=xf;/**
1078
- * @license
1079
- * Copyright 2020 Google LLC
1080
- *
1081
- * Licensed under the Apache License, Version 2.0 (the "License");
1082
- * you may not use this file except in compliance with the License.
1083
- * You may obtain a copy of the License at
1084
- *
1085
- * http://www.apache.org/licenses/LICENSE-2.0
1086
- *
1087
- * Unless required by applicable law or agreed to in writing, software
1088
- * distributed under the License is distributed on an "AS IS" BASIS,
1089
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1090
- * See the License for the specific language governing permissions and
1091
- * limitations under the License.
1092
- */class Mf extends Pf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}Mf.type="SESSION";const Of=Mf;/**
1093
- * @license
1094
- * Copyright 2019 Google LLC
1095
- *
1096
- * Licensed under the Apache License, Version 2.0 (the "License");
1097
- * you may not use this file except in compliance with the License.
1098
- * You may obtain a copy of the License at
1099
- *
1100
- * http://www.apache.org/licenses/LICENSE-2.0
1101
- *
1102
- * Unless required by applicable law or agreed to in writing, software
1103
- * distributed under the License is distributed on an "AS IS" BASIS,
1104
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1105
- * See the License for the specific language governing permissions and
1106
- * limitations under the License.
1107
- */function p1(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1108
- * @license
1109
- * Copyright 2019 Google LLC
1110
- *
1111
- * Licensed under the Apache License, Version 2.0 (the "License");
1112
- * you may not use this file except in compliance with the License.
1113
- * You may obtain a copy of the License at
1114
- *
1115
- * http://www.apache.org/licenses/LICENSE-2.0
1116
- *
1117
- * Unless required by applicable law or agreed to in writing, software
1118
- * distributed under the License is distributed on an "AS IS" BASIS,
1119
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1120
- * See the License for the specific language governing permissions and
1121
- * limitations under the License.
1122
- */class si{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const n=this.receivers.find(s=>s.isListeningto(t));if(n)return n;const r=new si(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const n=t,{eventId:r,eventType:s,data:o}=n.data,i=this.handlersMap[s];if(!(i!=null&&i.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const a=Array.from(i).map(async d=>d(n.origin,o)),l=await p1(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:l})}_subscribe(t,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(n)}_unsubscribe(t,n){this.handlersMap[t]&&n&&this.handlersMap[t].delete(n),(!n||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}si.receivers=[];/**
1123
- * @license
1124
- * Copyright 2020 Google LLC
1125
- *
1126
- * Licensed under the Apache License, Version 2.0 (the "License");
1127
- * you may not use this file except in compliance with the License.
1128
- * You may obtain a copy of the License at
1129
- *
1130
- * http://www.apache.org/licenses/LICENSE-2.0
1131
- *
1132
- * Unless required by applicable law or agreed to in writing, software
1133
- * distributed under the License is distributed on an "AS IS" BASIS,
1134
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1135
- * See the License for the specific language governing permissions and
1136
- * limitations under the License.
1137
- */function nl(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
1138
- * @license
1139
- * Copyright 2019 Google LLC
1140
- *
1141
- * Licensed under the Apache License, Version 2.0 (the "License");
1142
- * you may not use this file except in compliance with the License.
1143
- * You may obtain a copy of the License at
1144
- *
1145
- * http://www.apache.org/licenses/LICENSE-2.0
1146
- *
1147
- * Unless required by applicable law or agreed to in writing, software
1148
- * distributed under the License is distributed on an "AS IS" BASIS,
1149
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1150
- * See the License for the specific language governing permissions and
1151
- * limitations under the License.
1152
- */class m1{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}async _send(t,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let o,i;return new Promise((a,l)=>{const d=nl("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const p=f;if(p.data.eventId===d)switch(p.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(p.data.response);break;default:clearTimeout(c),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(i),s.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:t,eventId:d,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
1153
- * @license
1154
- * Copyright 2020 Google LLC
1155
- *
1156
- * Licensed under the Apache License, Version 2.0 (the "License");
1157
- * you may not use this file except in compliance with the License.
1158
- * You may obtain a copy of the License at
1159
- *
1160
- * http://www.apache.org/licenses/LICENSE-2.0
1161
- *
1162
- * Unless required by applicable law or agreed to in writing, software
1163
- * distributed under the License is distributed on an "AS IS" BASIS,
1164
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1165
- * See the License for the specific language governing permissions and
1166
- * limitations under the License.
1167
- */function Tn(){return window}function g1(e){Tn().location.href=e}/**
1168
- * @license
1169
- * Copyright 2020 Google LLC.
1170
- *
1171
- * Licensed under the Apache License, Version 2.0 (the "License");
1172
- * you may not use this file except in compliance with the License.
1173
- * You may obtain a copy of the License at
1174
- *
1175
- * http://www.apache.org/licenses/LICENSE-2.0
1176
- *
1177
- * Unless required by applicable law or agreed to in writing, software
1178
- * distributed under the License is distributed on an "AS IS" BASIS,
1179
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1180
- * See the License for the specific language governing permissions and
1181
- * limitations under the License.
1182
- */function Nf(){return typeof Tn().WorkerGlobalScope<"u"&&typeof Tn().importScripts=="function"}async function v1(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function y1(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function w1(){return Nf()?self:null}/**
1183
- * @license
1184
- * Copyright 2019 Google LLC
1185
- *
1186
- * Licensed under the Apache License, Version 2.0 (the "License");
1187
- * you may not use this file except in compliance with the License.
1188
- * You may obtain a copy of the License at
1189
- *
1190
- * http://www.apache.org/licenses/LICENSE-2.0
1191
- *
1192
- * Unless required by applicable law or agreed to in writing, software
1193
- * distributed under the License is distributed on an "AS IS" BASIS,
1194
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1195
- * See the License for the specific language governing permissions and
1196
- * limitations under the License.
1197
- */const Df="firebaseLocalStorageDb",b1=1,Bo="firebaseLocalStorage",$f="fbase_key";class oo{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function oi(e,t){return e.transaction([Bo],t?"readwrite":"readonly").objectStore(Bo)}function _1(){const e=indexedDB.deleteDatabase(Df);return new oo(e).toPromise()}function ma(){const e=indexedDB.open(Df,b1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Bo,{keyPath:$f})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Bo)?t(r):(r.close(),await _1(),t(await ma()))})})}async function Qc(e,t,n){const r=oi(e,!0).put({[$f]:t,value:n});return new oo(r).toPromise()}async function k1(e,t){const n=oi(e,!1).get(t),r=await new oo(n).toPromise();return r===void 0?null:r.value}function Xc(e,t){const n=oi(e,!0).delete(t);return new oo(n).toPromise()}const T1=800,I1=3;class Lf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await ma(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>I1)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Nf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=si._getInstance(w1()),this.receiver._subscribe("keyChanged",async(t,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(t,n)=>["keyChanged"])}async initializeSender(){var n,r;if(this.activeServiceWorker=await v1(),!this.activeServiceWorker)return;this.sender=new m1(this.activeServiceWorker);const t=await this.sender._send("ping",{},800);t&&(n=t[0])!=null&&n.fulfilled&&(r=t[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){if(!(!this.sender||!this.activeServiceWorker||y1()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await ma();return await Qc(t,jo,"1"),await Xc(t,jo),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Qc(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>k1(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Xc(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=oi(s,!1).getAll();return new oo(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:s,value:o}of t)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(o)&&(this.notifyListeners(s,o),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),T1)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Lf.type="LOCAL";const S1=Lf;new ro(3e4,6e4);/**
1198
- * @license
1199
- * Copyright 2021 Google LLC
1200
- *
1201
- * Licensed under the Apache License, Version 2.0 (the "License");
1202
- * you may not use this file except in compliance with the License.
1203
- * You may obtain a copy of the License at
1204
- *
1205
- * http://www.apache.org/licenses/LICENSE-2.0
1206
- *
1207
- * Unless required by applicable law or agreed to in writing, software
1208
- * distributed under the License is distributed on an "AS IS" BASIS,
1209
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1210
- * See the License for the specific language governing permissions and
1211
- * limitations under the License.
1212
- */function jf(e,t){return t?Ln(t):(Le(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
1213
- * @license
1214
- * Copyright 2019 Google LLC
1215
- *
1216
- * Licensed under the Apache License, Version 2.0 (the "License");
1217
- * you may not use this file except in compliance with the License.
1218
- * You may obtain a copy of the License at
1219
- *
1220
- * http://www.apache.org/licenses/LICENSE-2.0
1221
- *
1222
- * Unless required by applicable law or agreed to in writing, software
1223
- * distributed under the License is distributed on an "AS IS" BASIS,
1224
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1225
- * See the License for the specific language governing permissions and
1226
- * limitations under the License.
1227
- */class rl extends Af{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return ns(t,this._buildIdpRequest())}_linkToIdToken(t,n){return ns(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return ns(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function E1(e){return l1(e.auth,new rl(e),e.bypassAuthState)}function C1(e){const{auth:t,user:n}=e;return Le(n,t,"internal-error"),a1(n,new rl(e),e.bypassAuthState)}async function A1(e){const{auth:t,user:n}=e;return Le(n,t,"internal-error"),i1(n,new rl(e),e.bypassAuthState)}/**
1228
- * @license
1229
- * Copyright 2020 Google LLC
1230
- *
1231
- * Licensed under the Apache License, Version 2.0 (the "License");
1232
- * you may not use this file except in compliance with the License.
1233
- * You may obtain a copy of the License at
1234
- *
1235
- * http://www.apache.org/licenses/LICENSE-2.0
1236
- *
1237
- * Unless required by applicable law or agreed to in writing, software
1238
- * distributed under the License is distributed on an "AS IS" BASIS,
1239
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1240
- * See the License for the specific language governing permissions and
1241
- * limitations under the License.
1242
- */class Bf{constructor(t,n,r,s,o=!1){this.auth=t,this.resolver=r,this.user=s,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:s,tenantId:o,error:i,type:a}=t;if(i){this.reject(i);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(d){this.reject(d)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return E1;case"linkViaPopup":case"linkViaRedirect":return A1;case"reauthViaPopup":case"reauthViaRedirect":return C1;default:In(this.auth,"internal-error")}}resolve(t){qn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){qn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1243
- * @license
1244
- * Copyright 2020 Google LLC
1245
- *
1246
- * Licensed under the Apache License, Version 2.0 (the "License");
1247
- * you may not use this file except in compliance with the License.
1248
- * You may obtain a copy of the License at
1249
- *
1250
- * http://www.apache.org/licenses/LICENSE-2.0
1251
- *
1252
- * Unless required by applicable law or agreed to in writing, software
1253
- * distributed under the License is distributed on an "AS IS" BASIS,
1254
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1255
- * See the License for the specific language governing permissions and
1256
- * limitations under the License.
1257
- */const R1=new ro(2e3,1e4);async function P1(e,t,n){if(wn(e.app))return Promise.reject(an(e,"operation-not-supported-in-this-environment"));const r=ri(e);ET(e,t,tl);const s=jf(r,n);return new xr(r,"signInViaPopup",t,s).executeNotNull()}class xr extends Bf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,xr.currentPopupAction&&xr.currentPopupAction.cancel(),xr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return Le(t,this.auth,"internal-error"),t}async onExecution(){qn(this.filter.length===1,"Popup operations only handle one event");const t=nl();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(an(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(an(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,xr.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if((r=(n=this.authWindow)==null?void 0:n.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(an(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,R1.get())};t()}}xr.currentPopupAction=null;/**
1258
- * @license
1259
- * Copyright 2020 Google LLC
1260
- *
1261
- * Licensed under the Apache License, Version 2.0 (the "License");
1262
- * you may not use this file except in compliance with the License.
1263
- * You may obtain a copy of the License at
1264
- *
1265
- * http://www.apache.org/licenses/LICENSE-2.0
1266
- *
1267
- * Unless required by applicable law or agreed to in writing, software
1268
- * distributed under the License is distributed on an "AS IS" BASIS,
1269
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1270
- * See the License for the specific language governing permissions and
1271
- * limitations under the License.
1272
- */const x1="pendingRedirect",To=new Map;class M1 extends Bf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=To.get(this.auth._key());if(!t){try{const r=await O1(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}To.set(this.auth._key(),t)}return this.bypassAuthState||To.set(this.auth._key(),()=>Promise.resolve(null)),t()}async onAuthEvent(t){if(t.type==="signInViaRedirect")return super.onAuthEvent(t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=await this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,super.onAuthEvent(t);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function O1(e,t){const n=$1(t),r=D1(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function N1(e,t){To.set(e._key(),t)}function D1(e){return Ln(e._redirectPersistence)}function $1(e){return ko(x1,e.config.apiKey,e.name)}async function L1(e,t,n=!1){if(wn(e.app))return Promise.reject(Nr(e));const r=ri(e),s=jf(r,t),i=await new M1(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
1273
- * @license
1274
- * Copyright 2020 Google LLC
1275
- *
1276
- * Licensed under the Apache License, Version 2.0 (the "License");
1277
- * you may not use this file except in compliance with the License.
1278
- * You may obtain a copy of the License at
1279
- *
1280
- * http://www.apache.org/licenses/LICENSE-2.0
1281
- *
1282
- * Unless required by applicable law or agreed to in writing, software
1283
- * distributed under the License is distributed on an "AS IS" BASIS,
1284
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1285
- * See the License for the specific language governing permissions and
1286
- * limitations under the License.
1287
- */const j1=600*1e3;class B1{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!F1(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Ff(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(an(this.auth,s))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=j1&&this.cachedEventUids.clear(),this.cachedEventUids.has(Zc(t))}saveEventToCache(t){this.cachedEventUids.add(Zc(t)),this.lastProcessedEventTime=Date.now()}}function Zc(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Ff({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function F1(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Ff(e);default:return!1}}/**
1288
- * @license
1289
- * Copyright 2020 Google LLC
1290
- *
1291
- * Licensed under the Apache License, Version 2.0 (the "License");
1292
- * you may not use this file except in compliance with the License.
1293
- * You may obtain a copy of the License at
1294
- *
1295
- * http://www.apache.org/licenses/LICENSE-2.0
1296
- *
1297
- * Unless required by applicable law or agreed to in writing, software
1298
- * distributed under the License is distributed on an "AS IS" BASIS,
1299
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1300
- * See the License for the specific language governing permissions and
1301
- * limitations under the License.
1302
- */async function U1(e,t={}){return ds(e,"GET","/v1/projects",t)}/**
1303
- * @license
1304
- * Copyright 2020 Google LLC
1305
- *
1306
- * Licensed under the Apache License, Version 2.0 (the "License");
1307
- * you may not use this file except in compliance with the License.
1308
- * You may obtain a copy of the License at
1309
- *
1310
- * http://www.apache.org/licenses/LICENSE-2.0
1311
- *
1312
- * Unless required by applicable law or agreed to in writing, software
1313
- * distributed under the License is distributed on an "AS IS" BASIS,
1314
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1315
- * See the License for the specific language governing permissions and
1316
- * limitations under the License.
1317
- */const H1=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,V1=/^https?/;async function W1(e){if(e.config.emulator)return;const{authorizedDomains:t}=await U1(e);for(const n of t)try{if(q1(n))return}catch{}In(e,"unauthorized-domain")}function q1(e){const t=ha(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return i.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&i.hostname===r}if(!V1.test(n))return!1;if(H1.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1318
- * @license
1319
- * Copyright 2020 Google LLC.
1320
- *
1321
- * Licensed under the Apache License, Version 2.0 (the "License");
1322
- * you may not use this file except in compliance with the License.
1323
- * You may obtain a copy of the License at
1324
- *
1325
- * http://www.apache.org/licenses/LICENSE-2.0
1326
- *
1327
- * Unless required by applicable law or agreed to in writing, software
1328
- * distributed under the License is distributed on an "AS IS" BASIS,
1329
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1330
- * See the License for the specific language governing permissions and
1331
- * limitations under the License.
1332
- */const G1=new ro(3e4,6e4);function eu(){const e=Tn().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function K1(e){return new Promise((t,n)=>{var s,o,i;function r(){eu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{eu(),n(an(e,"network-request-failed"))},timeout:G1.get()})}if((o=(s=Tn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Tn().gapi)!=null&&i.load)r();else{const a=ZT("iframefcb");return Tn()[a]=()=>{gapi.load?r():n(an(e,"network-request-failed"))},QT(`${XT()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw Io=null,t})}let Io=null;function z1(e){return Io=Io||K1(e),Io}/**
1333
- * @license
1334
- * Copyright 2020 Google LLC.
1335
- *
1336
- * Licensed under the Apache License, Version 2.0 (the "License");
1337
- * you may not use this file except in compliance with the License.
1338
- * You may obtain a copy of the License at
1339
- *
1340
- * http://www.apache.org/licenses/LICENSE-2.0
1341
- *
1342
- * Unless required by applicable law or agreed to in writing, software
1343
- * distributed under the License is distributed on an "AS IS" BASIS,
1344
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1345
- * See the License for the specific language governing permissions and
1346
- * limitations under the License.
1347
- */const J1=new ro(5e3,15e3),Y1="__/auth/iframe",Q1="emulator/auth/iframe",X1={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Z1=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function eI(e){const t=e.config;Le(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?Ya(t,Q1):`https://${e.config.authDomain}/${Y1}`,r={apiKey:t.apiKey,appName:e.name,v:no},s=Z1.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${to(r).slice(1)}`}async function tI(e){const t=await z1(e),n=Tn().gapi;return Le(n,e,"internal-error"),t.open({where:document.body,url:eI(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:X1,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=an(e,"network-request-failed"),a=Tn().setTimeout(()=>{o(i)},J1.get());function l(){Tn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
1348
- * @license
1349
- * Copyright 2020 Google LLC.
1350
- *
1351
- * Licensed under the Apache License, Version 2.0 (the "License");
1352
- * you may not use this file except in compliance with the License.
1353
- * You may obtain a copy of the License at
1354
- *
1355
- * http://www.apache.org/licenses/LICENSE-2.0
1356
- *
1357
- * Unless required by applicable law or agreed to in writing, software
1358
- * distributed under the License is distributed on an "AS IS" BASIS,
1359
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1360
- * See the License for the specific language governing permissions and
1361
- * limitations under the License.
1362
- */const nI={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},rI=500,sI=600,oI="_blank",iI="http://localhost";class tu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function aI(e,t,n,r=rI,s=sI){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),i=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...nI,width:r.toString(),height:s.toString(),top:o,left:i},d=Wt().toLowerCase();n&&(a=bf(d)?oI:n),yf(d)&&(t=t||iI,l.scrollbars="yes");const c=Object.entries(l).reduce((p,[b,O])=>`${p}${b}=${O},`,"");if(VT(d)&&a!=="_self")return lI(t||"",a),new tu(null);const f=window.open(t||"",a,c);Le(f,e,"popup-blocked");try{f.focus()}catch{}return new tu(f)}function lI(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1363
- * @license
1364
- * Copyright 2021 Google LLC
1365
- *
1366
- * Licensed under the Apache License, Version 2.0 (the "License");
1367
- * you may not use this file except in compliance with the License.
1368
- * You may obtain a copy of the License at
1369
- *
1370
- * http://www.apache.org/licenses/LICENSE-2.0
1371
- *
1372
- * Unless required by applicable law or agreed to in writing, software
1373
- * distributed under the License is distributed on an "AS IS" BASIS,
1374
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1375
- * See the License for the specific language governing permissions and
1376
- * limitations under the License.
1377
- */const cI="__/auth/handler",uI="emulator/auth/handler",dI=encodeURIComponent("fac");async function nu(e,t,n,r,s,o){Le(e.config.authDomain,e,"auth-domain-config-required"),Le(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:no,eventId:s};if(t instanceof tl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",ck(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof so){const c=t.getScopes().filter(f=>f!=="");c.length>0&&(i.scopes=c.join(","))}e.tenantId&&(i.tid=e.tenantId);const a=i;for(const c of Object.keys(a))a[c]===void 0&&delete a[c];const l=await e._getAppCheckToken(),d=l?`#${dI}=${encodeURIComponent(l)}`:"";return`${fI(e)}?${to(a).slice(1)}${d}`}function fI({config:e}){return e.emulator?Ya(e,uI):`https://${e.authDomain}/${cI}`}/**
1378
- * @license
1379
- * Copyright 2020 Google LLC
1380
- *
1381
- * Licensed under the Apache License, Version 2.0 (the "License");
1382
- * you may not use this file except in compliance with the License.
1383
- * You may obtain a copy of the License at
1384
- *
1385
- * http://www.apache.org/licenses/LICENSE-2.0
1386
- *
1387
- * Unless required by applicable law or agreed to in writing, software
1388
- * distributed under the License is distributed on an "AS IS" BASIS,
1389
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1390
- * See the License for the specific language governing permissions and
1391
- * limitations under the License.
1392
- */const $i="webStorageSupport";class hI{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Of,this._completeRedirectFn=L1,this._overrideRedirectResult=N1}async _openPopup(t,n,r,s){var i;qn((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await nu(t,n,r,ha(),s);return aI(t,o,nl())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await nu(t,n,r,ha(),s);return g1(o),new Promise(()=>{})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:s,promise:o}=this.eventManagers[n];return s?Promise.resolve(s):(qn(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(t){const n=await tI(t),r=new B1(t);return n.register("authEvent",s=>(Le(s==null?void 0:s.authEvent,t,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send($i,{type:$i},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[$i];o!==void 0&&n(!!o),In(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=W1(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Sf()||wf()||Za()}}const pI=hI;var ru="@firebase/auth",su="1.12.1";/**
1393
- * @license
1394
- * Copyright 2020 Google LLC
1395
- *
1396
- * Licensed under the Apache License, Version 2.0 (the "License");
1397
- * you may not use this file except in compliance with the License.
1398
- * You may obtain a copy of the License at
1399
- *
1400
- * http://www.apache.org/licenses/LICENSE-2.0
1401
- *
1402
- * Unless required by applicable law or agreed to in writing, software
1403
- * distributed under the License is distributed on an "AS IS" BASIS,
1404
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1405
- * See the License for the specific language governing permissions and
1406
- * limitations under the License.
1407
- */class mI{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)==null?void 0:t.uid)||null}async getToken(t){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(t)}:null}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const n=this.auth.onIdTokenChanged(r=>{t((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,n),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const n=this.internalListeners.get(t);n&&(this.internalListeners.delete(t),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Le(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1408
- * @license
1409
- * Copyright 2020 Google LLC
1410
- *
1411
- * Licensed under the Apache License, Version 2.0 (the "License");
1412
- * you may not use this file except in compliance with the License.
1413
- * You may obtain a copy of the License at
1414
- *
1415
- * http://www.apache.org/licenses/LICENSE-2.0
1416
- *
1417
- * Unless required by applicable law or agreed to in writing, software
1418
- * distributed under the License is distributed on an "AS IS" BASIS,
1419
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1420
- * See the License for the specific language governing permissions and
1421
- * limitations under the License.
1422
- */function gI(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function vI(e){zs(new as("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:i,authDomain:a}=r.options;Le(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Ef(e)},d=new JT(r,s,o,l);return t1(d,n),d},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),zs(new as("auth-internal",t=>{const n=ri(t.getProvider("auth").getImmediate());return(r=>new mI(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Zr(ru,su,gI(e)),Zr(ru,su,"esm2020")}/**
1423
- * @license
1424
- * Copyright 2021 Google LLC
1425
- *
1426
- * Licensed under the Apache License, Version 2.0 (the "License");
1427
- * you may not use this file except in compliance with the License.
1428
- * You may obtain a copy of the License at
1429
- *
1430
- * http://www.apache.org/licenses/LICENSE-2.0
1431
- *
1432
- * Unless required by applicable law or agreed to in writing, software
1433
- * distributed under the License is distributed on an "AS IS" BASIS,
1434
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1435
- * See the License for the specific language governing permissions and
1436
- * limitations under the License.
1437
- */const yI=300,wI=tf("authIdTokenMaxAge")||yI;let ou=null;const bI=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>wI)return;const s=n==null?void 0:n.token;ou!==s&&(ou=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function _I(e=lf()){const t=of(e,"auth");if(t.isInitialized())return t.getImmediate();const n=e1(e,{popupRedirectResolver:pI,persistence:[S1,h1,Of]}),r=tf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=bI(o.toString());u1(n,i,()=>i(n.currentUser)),c1(n,a=>i(a))}}const s=K0("auth");return s&&n1(n,`http://${s}`),n}function kI(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}YT({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=an("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",kI().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});vI("Browser");const TI={},II={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function SI(e,t){return _(),S("svg",II,[...t[0]||(t[0]=[v("circle",{cx:"11",cy:"11",r:"8"},null,-1),v("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const ga=Ye(TI,[["render",SI]]),EI={class:"skill-card-top"},CI=["src","alt"],AI={key:1,class:"skill-card-avatar-fallback"},RI={class:"skill-card-info"},PI={class:"skill-card-header"},xI={class:"skill-card-name"},MI={key:0,class:"skill-card-badge-disabled"},OI={key:1,class:"skill-card-badge"},NI={class:"skill-card-owner"},DI={key:0,class:"skill-card-desc"},$I={key:1,class:"skill-card-date"},LI=Pt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ce(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(_(),S("button",{class:dt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[v("div",EI,[e.skill.avatarUrl?(_(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,CI)):(_(),S("div",AI,de(e.skill.owner.charAt(0)),1)),v("div",RI,[v("div",PI,[v("span",xI,de(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(_(),S("span",MI,"Disabled")):e.skill.installed?(_(),S("span",OI,"Installed")):le("",!0)]),v("span",NI,de(e.skill.owner),1)])]),e.skill.description?(_(),S("p",DI,de(e.skill.description),1)):le("",!0),n.value?(_(),S("span",$I,de(n.value),1)):le("",!0)],2))}}),iu=Ye(LI,[["__scopeId","data-v-2a1e8196"]]),jI={class:"sdm-panel"},BI={class:"sdm-header"},FI={class:"sdm-title-area"},UI=["src","alt"],HI={class:"sdm-title-col"},VI={class:"sdm-title-row"},WI={class:"sdm-title"},qI={key:0,class:"sdm-badge-disabled"},GI={class:"sdm-owner"},KI={class:"sdm-body"},zI={key:0,class:"sdm-desc"},JI={key:1,class:"sdm-readme-loading"},YI=["innerHTML"],QI=["href"],XI={class:"sdm-footer"},ZI={class:"sdm-footer-actions"},eS=["disabled"],tS=["disabled"],nS=["disabled"],rS=Pt({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=j(null),o=j(""),i=j(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ce(()=>{const R=o.value;if(!R)return"";const U=R.replace(/^---[\s\S]*?---\s*/,"");return c(U)});function c(R){return R.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const R=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),U=await fetch(`/codex-api/skills-hub/readme?${R}`);if(!U.ok)return;const q=await U.json();o.value=q.content??""}catch{}finally{i.value=!1}}}gt(()=>n.visible,R=>{R&&(s.value=null,o.value="",f())});function p(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function O(){const R=!a.value;s.value=R,r("toggle-enabled",n.skill,R)}return(R,U)=>(_(),pt(Ao,{to:"body"},[e.visible?(_(),S("div",{key:0,class:"sdm-overlay",onClick:U[1]||(U[1]=Ge(q=>R.$emit("close"),["self"]))},[v("div",jI,[v("div",BI,[v("div",FI,[e.skill.avatarUrl?(_(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,UI)):le("",!0),v("div",HI,[v("div",VI,[v("h3",WI,de(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(_(),S("span",qI,"Disabled")):le("",!0)]),v("span",GI,de(e.skill.owner),1)])]),v("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:U[0]||(U[0]=q=>R.$emit("close"))},[Ie(Va,{class:"sdm-close-icon"})])]),v("div",KI,[e.skill.description?(_(),S("p",zI,de(e.skill.description),1)):le("",!0),i.value?(_(),S("div",JI,"Loading skill contents...")):o.value?(_(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,YI)):le("",!0),v("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,QI)]),v("div",XI,[v("div",ZI,[e.skill.installed?(_(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},de(n.isUninstalling?"Uninstalling...":"Uninstall"),9,eS)):(_(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:p},de(n.isInstalling?"Installing...":"Install"),9,tS)),e.skill.installed?(_(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:O},de(a.value?"Disable":"Enable"),9,nS)):le("",!0)])])])])):le("",!0)]))}}),sS=Ye(rS,[["__scopeId","data-v-19a385ca"]]),oS={class:"skills-hub"},iS={class:"skills-hub-toolbar"},aS={class:"skills-hub-search-wrap"},lS={key:0,class:"skills-hub-count"},cS={class:"skills-sync-panel"},uS={class:"skills-sync-header"},dS={key:0,class:"skills-sync-badge"},fS={key:1,class:"skills-sync-badge"},hS={key:2,class:"skills-sync-badge"},pS={class:"skills-sync-meta"},mS={key:0,class:"skills-sync-error"},gS={key:1,class:"skills-sync-device"},vS=["href"],yS={class:"skills-sync-actions"},wS=["disabled"],bS=["disabled"],_S={key:1,class:"skills-hub-section"},kS={class:"skills-hub-section-title"},TS={key:0,class:"skills-hub-grid"},IS={class:"skills-hub-section"},SS={key:0,class:"skills-hub-loading"},ES={key:1,class:"skills-hub-error"},CS={key:0,class:"skills-hub-grid"},AS={key:1,class:"skills-hub-empty"},fo="codex-web-local.skills-hub.cache.v1",RS=Pt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=j(null),s=j(""),o=j("date"),i=j([]),a=j([]),l=j(0),d=j(!1),c=j(""),f=j(!0),p=j(!1),b=j(n),O=j(null),R=j(""),U=j(!1),q=j(!1),$=j(null),B=j({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}});let F=null,ae=null;const ue=t,he=ce(()=>o.value==="date"?"Newest":"A-Z"),_e=ce(()=>{var h;return((h=O.value)==null?void 0:h.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),re=ce(()=>`${b.value.owner}/${b.value.name}`),Z=ce(()=>U.value&&R.value===re.value),ke=ce(()=>q.value&&R.value===re.value),te=ce(()=>{const h=s.value.toLowerCase().trim();return h?a.value.filter(w=>w.name.toLowerCase().includes(h)||w.owner.toLowerCase().includes(h)||(w.displayName??"").toLowerCase().includes(h)):a.value});function Te(h,w="success"){O.value={text:h,type:w},ae&&clearTimeout(ae),ae=setTimeout(()=>{O.value=null},3e3)}function Be(){o.value=o.value==="date"?"name":"date",ze(s.value)}function Ke(h){return`${o.value}::${h.trim().toLowerCase()}`}function Ee(h){var w;if(typeof window>"u")return null;try{const P=window.localStorage.getItem(fo);return P?((w=JSON.parse(P).byKey)==null?void 0:w[h])??null:null}catch{return null}}function we(h,w){if(!(typeof window>"u"))try{const P=window.localStorage.getItem(fo),D=(P?JSON.parse(P):{}).byKey??{};D[h]=w,window.localStorage.setItem(fo,JSON.stringify({byKey:D}))}catch{}}function Ne(){if(!(typeof window>"u"))try{window.localStorage.removeItem(fo)}catch{}}function ot(h){const w=h.installed??[];a.value=w;const P=new Set(w.map(N=>N.name));i.value=h.data.map(N=>{if(N.installed||P.has(N.name)){const D=w.find(Y=>Y.name===N.name);return{...N,installed:!0,path:(D==null?void 0:D.path)??N.path,enabled:(D==null?void 0:D.enabled)??N.enabled}}return N}).filter(N=>!N.installed),l.value=h.total}async function ze(h){const w=Ke(h),P=Ee(w);P&&ot(P),d.value=!P,c.value="";try{const N=new URLSearchParams;h.trim()&&N.set("q",h.trim()),N.set("limit","100"),N.set("sort",o.value);const D=await fetch(`/codex-api/skills-hub?${N}`);if(!D.ok)throw new Error(`HTTP ${D.status}`);const Y=await D.json();ot(Y),we(w,Y)}catch(N){c.value=N instanceof Error?N.message:"Failed to load skills"}finally{d.value=!1}}function it(){F&&clearTimeout(F),F=setTimeout(()=>ze(s.value),300)}function We(h){b.value=h,p.value=!0}async function Ze(h){R.value=`${h.owner}/${h.name}`,U.value=!0;try{const P=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:h.owner,name:h.name})})).json();if(!P.ok)throw new Error(P.error||"Install failed");const N={...h,installed:!0,path:P.path,enabled:!0};a.value=[...a.value,N],i.value=i.value.filter(D=>D.name!==h.name),b.value=N,Te(`${h.displayName||h.name} skill installed`),p.value=!1,Ne(),ue("skills-changed")}catch(w){Te(w instanceof Error?w.message:"Failed to install skill","error")}finally{U.value=!1}}async function wt(h){R.value=`${h.owner}/${h.name}`,q.value=!0;try{const P=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h.name,path:h.path})})).json();if(!P.ok)throw new Error(P.error||"Uninstall failed");a.value=a.value.filter(N=>N.name!==h.name),h.owner!=="local"&&(i.value=[...i.value,{...h,installed:!1,path:void 0,enabled:void 0}]),Te(`${h.displayName||h.name} skill uninstalled`),p.value=!1,Ne(),ue("skills-changed")}catch(w){Te(w instanceof Error?w.message:"Failed to uninstall skill","error")}finally{q.value=!1}}async function vt(h,w){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:h.path,enabled:w}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),Te(`${h.displayName||h.name} skill ${w?"enabled":"disabled"}`),await ze(s.value)}catch(P){Te(P instanceof Error?P.message:"Failed to update skill","error")}}async function qe(){try{const h=await fetch("/codex-api/skills-sync/status");if(!h.ok)return;const w=await h.json();w.data&&(B.value=w.data)}catch{}}async function L(){try{const h=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),w=await h.json();if(!h.ok||!w.data)throw new Error("Failed to start GitHub login");$.value=w.data;const P=30,N=Math.max((w.data.interval??5)*1e3,3e3);let D=!1;for(let Y=0;Y<P;Y++){await new Promise(V=>setTimeout(V,N));const X=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:w.data.device_code})}),J=await X.json();if(!X.ok)throw new Error(J.error||"Failed to complete GitHub login");if(J.ok){D=!0;break}if(!J.pending)throw new Error(J.error||"Failed to complete GitHub login")}if(!D)throw new Error("GitHub login timed out. Please retry.");$.value=null,await qe(),Te("GitHub login successful")}catch(h){Te(h instanceof Error?h.message:"Failed GitHub login","error")}}const se={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};async function ee(){try{const h=dT().length>0?lf():af(se),w=_I(h),P=new bn;P.addScope("repo");const N=await P1(w,P),D=bn.credentialFromResult(N),Y=(D==null?void 0:D.accessToken)??"";if(!Y)throw new Error("GitHub access token missing from Firebase login");const X=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:Y})}),J=await X.json();if(!X.ok||!J.ok)throw new Error(J.error||"Failed to login with GitHub token");await qe(),Te("GitHub login successful")}catch(h){const w=h instanceof Error?h.message:"Failed Firebase GitHub login";Te(w,"error")}}async function pe(){try{const h=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),w=await h.json();if(!h.ok||!w.ok)throw new Error(w.error||"Failed to pull synced skills");await ze(s.value),ue("skills-changed"),Te("Pulled skills from private sync repo")}catch(h){Te(h instanceof Error?h.message:"Failed to pull sync","error")}}async function Ae(){try{const h=await fetch("/codex-api/skills-sync/push",{method:"POST"}),w=await h.json();if(!h.ok||!w.ok)throw new Error(w.error||"Failed to push synced skills");Te("Pushed skills to private sync repo")}catch(h){Te(h instanceof Error?h.message:"Failed to push sync","error")}}async function g(){try{const h=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),w=await h.json();if(!h.ok||!w.ok)throw new Error(w.error||"Failed to logout GitHub");await qe(),Te("Logged out from GitHub")}catch(h){Te(h instanceof Error?h.message:"Failed to logout GitHub","error")}}return cr(()=>{ze(""),qe()}),(h,w)=>(_(),S("div",oS,[w[6]||(w[6]=v("div",{class:"skills-hub-header"},[v("h2",{class:"skills-hub-title"},"Skills Hub"),v("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),v("div",iS,[v("div",aS,[Ie(ga,{class:"skills-hub-search-icon"}),Hn(v("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":w[0]||(w[0]=P=>s.value=P),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:it},null,544),[[Vn,s.value]]),l.value>0?(_(),S("span",lS,de(l.value)+" skills",1)):le("",!0)]),v("button",{class:"skills-hub-sort",type:"button",onClick:Be},de(he.value),1)]),v("div",cS,[v("div",uS,[w[3]||(w[3]=v("strong",null,"Skills Sync (GitHub)",-1)),B.value.configured?(_(),S("span",dS,"Connected: "+de(B.value.repoOwner)+"/"+de(B.value.repoName),1)):B.value.loggedIn?(_(),S("span",fS,"Logged in as "+de(B.value.githubUsername),1)):(_(),S("span",hS,"Not connected"))]),v("div",pS,[v("span",null,"Startup: "+de(B.value.startup.mode),1),v("span",null,"Branch: "+de(B.value.startup.branch),1),v("span",null,"Action: "+de(B.value.startup.lastAction),1)]),B.value.startup.lastError?(_(),S("div",mS,de(B.value.startup.lastError),1)):le("",!0),$.value?(_(),S("div",gS,[v("span",null,[w[4]||(w[4]=ea("Open ",-1)),v("a",{href:$.value.verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,vS),w[5]||(w[5]=ea(" and enter code:",-1))]),v("code",null,de($.value.user_code),1)])):le("",!0),v("div",yS,[B.value.loggedIn?le("",!0):(_(),S("button",{key:0,class:"skills-hub-sort",type:"button",onClick:ee},"Login with GitHub")),B.value.loggedIn?le("",!0):(_(),S("button",{key:1,class:"skills-hub-sort",type:"button",onClick:L},"Device Login")),B.value.loggedIn?(_(),S("button",{key:2,class:"skills-hub-sort",type:"button",onClick:g},"Logout GitHub")):le("",!0),v("button",{class:"skills-hub-sort",type:"button",onClick:pe,disabled:!B.value.configured},"Pull",8,wS),v("button",{class:"skills-hub-sort",type:"button",onClick:Ae,disabled:!B.value.configured},"Push",8,bS)])]),O.value?(_(),S("div",{key:0,class:dt(["skills-hub-toast",_e.value])},de(O.value.text),3)):le("",!0),te.value.length>0?(_(),S("div",_S,[v("button",{class:"skills-hub-section-toggle",type:"button",onClick:w[1]||(w[1]=P=>f.value=!f.value)},[v("span",kS,"Installed ("+de(te.value.length)+")",1),Ie(Gd,{class:dt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(_(),S("div",TS,[(_(!0),S(Fe,null,bt(te.value,P=>(_(),pt(iu,{key:P.name,skill:P,onSelect:N=>We(N)},null,8,["skill","onSelect"]))),128))])):le("",!0)])):le("",!0),v("div",IS,[d.value?(_(),S("div",SS,"Loading skills...")):c.value?(_(),S("div",ES,de(c.value),1)):(_(),S(Fe,{key:2},[i.value.length>0?(_(),S("div",CS,[(_(!0),S(Fe,null,bt(i.value,P=>(_(),pt(iu,{key:P.url,skill:P,onSelect:N=>We(N)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(_(),S("div",AS,'No skills found for "'+de(s.value)+'"',1)):le("",!0)],64))]),Ie(sS,{skill:b.value,visible:p.value,"is-installing":Z.value,"is-uninstalling":ke.value,onClose:w[2]||(w[2]=P=>p.value=!1),onInstall:Ze,onUninstall:wt,onToggleEnabled:vt},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),PS=Ye(RS,[["__scopeId","data-v-54c62c82"]]),xS={},MS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function OS(e,t){return _(),S("svg",MS,[...t[0]||(t[0]=[v("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),v("path",{d:"M9 4l0 16"},null,-1)])])}const NS=Ye(xS,[["render",OS]]),DS={},$S={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function LS(e,t){return _(),S("svg",$S,[...t[0]||(t[0]=[v("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const jS=Ye(DS,[["render",LS]]),BS={},FS={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function US(e,t){return _(),S("svg",FS,[...t[0]||(t[0]=[v("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),v("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const HS=Ye(BS,[["render",US]]),VS={class:"sidebar-thread-controls"},WS=["aria-label","title"],qS=["aria-pressed","aria-label","title"],GS=Pt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},isAutoRefreshEnabled:{type:Boolean},autoRefreshButtonLabel:{},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(e){return(t,n)=>(_(),S("div",VS,[v("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(_(),pt(jS,{key:0,class:"sidebar-thread-controls-icon"})):(_(),pt(NS,{key:1,class:"sidebar-thread-controls-icon"}))],8,WS),v("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":e.isAutoRefreshEnabled,"aria-label":e.autoRefreshButtonLabel,title:e.autoRefreshButtonLabel,onClick:n[1]||(n[1]=r=>t.$emit("toggle-auto-refresh"))},[Ie(HS,{class:"sidebar-thread-controls-icon"})],8,qS),_n(t.$slots,"default",{},void 0),e.showNewThreadButton?(_(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=r=>t.$emit("start-new-thread"))},[Ie(Oo,{class:"sidebar-thread-controls-icon"})])):le("",!0)]))}}),au=Ye(GS,[["__scopeId","data-v-57866500"]]),KS={},zS={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function JS(e,t){return _(),S("svg",zS,[...t[0]||(t[0]=[v("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[v("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),v("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const YS=Ye(KS,[["render",JS]]);function tr(e){return e.flatMap(t=>t.threads)}const Uf="codex-web-local.thread-read-state.v1",Hf="codex-web-local.thread-scroll-state.v1",va="codex-web-local.selected-thread-id.v1",Vf="codex-web-local.project-order.v1",Wf="codex-web-local.project-display-name.v1",qf="codex-web-local.auto-refresh-enabled.v1",Li=220,Ss=4e3,lu=["none","minimal","low","medium","high","xhigh"],Es="__global__",Xt="gpt-5.2-codex";function QS(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Uf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function cu(e){typeof window>"u"||window.localStorage.setItem(Uf,JSON.stringify(e))}function XS(){return typeof window>"u"?!1:window.localStorage.getItem(qf)==="1"}function uu(e){typeof window>"u"||window.localStorage.setItem(qf,e?"1":"0")}function Gf(e,t,n){return Math.min(Math.max(e,t),n)}function ZS(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=Gf(t.scrollRatio,0,1)),n}function eE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Hf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=ZS(s);o&&(n[r]=o)}return n}catch{return{}}}function du(e){typeof window>"u"||window.localStorage.setItem(Hf,JSON.stringify(e))}function tE(){return typeof window>"u"?"":window.localStorage.getItem(va)??""}function nE(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(va);return}window.localStorage.setItem(va,e)}}function rE(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Vf);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function Wr(e){typeof window>"u"||window.localStorage.setItem(Vf,JSON.stringify(e))}function sE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Wf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function ji(e){typeof window>"u"||window.localStorage.setItem(Wf,JSON.stringify(e))}function ho(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Rr(e,n)?e:n}function Bi(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Rr(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function oE(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function iE(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function po(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function ya(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Rr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&iE(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Fo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function aE(e,t,n={}){const r=new Map(e.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.id,c])),o=t.map(c=>{const f=r.get(c.id);return f&&ya(f,c)?f:c});if(n.preserveMissing!==!0)return Fo(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||ya(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),d=[...i,...l];return Fo(e,d)?e:d}function wa(e){return e.replace(/\s+/gu," ").trim()}function lE(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>wa(s.text)).filter(s=>s.length>0));if(n.size===0)return e;const r=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;const o=wa(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function fu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(ya(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Kf="worked";function Xn(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function cE(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const i=s>0||o.length===0?s:0;return o.push(`${i}s`),o.join(" ")}function uE(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function dE(e,t){if(!e&&!t)return!0;if(!e||!t||e.label!==t.label||e.details.length!==t.details.length)return!1;for(let n=0;n<e.details.length;n+=1)if(e.details[n]!==t.details[n])return!1;return!0}function fE(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${cE(e.durationMs)}`,messageType:Kf}}function hE(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function pE(e,t){const n=fE(t),r=e.filter(i=>i.messageType!==Kf),s=hE(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function At(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function mE(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress}function gE(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function vE(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Mt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function mo(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const d=i.get(l.id);return d&&mE(d,l)?d:l});return o&&o.projectName===s.projectName&&gE(o.threads,a)?o:{projectName:s.projectName,threads:a}});return vE(e,r)?e:r}function yE(e,t,n){const r=new Set(tr(t).map(a=>a.id)),s=tr(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const d=i.findIndex(c=>c.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function wE(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Fi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function bE(e){const t=e.split(`
1438
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function _E(){const e=j([]),t=j([]),n=j(tE()),r=j({}),s=j({}),o=j({}),i=j({}),a=j({}),l=j({}),d=j({}),c=j([]),f=j(""),p=j("medium"),b=j(QS()),O=j(eE()),R=j(rE()),U=j(sE()),q=j({}),$=j({}),B=j({}),F=j({}),ae=j({}),ue=j({}),he=j({}),_e=j({}),re=j({}),Z=j({}),ke=j([]),te=j(!1),Te=j(!1),Be=j(!1),Ke=j(!1),Ee=j(!1),we=j(""),Ne=j(!1),ot=j(!1),ze=j(XS()),it=j(Math.floor(Ss/1e3));let We=null,Ze=null,wt=null,vt=null,qe=!1;const L=new Set;let se=!1,ee=!1;const pe=new Map,Ae=new Set,g=ce(()=>tr(e.value)),h=ce(()=>g.value.find(u=>u.id===n.value)??null),w=ce(()=>O.value[n.value]??null),P=ce(()=>{const u=[],m=n.value;return m&&Array.isArray(_e.value[m])&&u.push(..._e.value[m]),Array.isArray(_e.value[Es])&&u.push(..._e.value[Es]),u.sort((y,I)=>y.receivedAtIso.localeCompare(I.receivedAtIso))}),N=ce(()=>{var z;const u=n.value;if(!u)return null;const m=ae.value[u],y=(o.value[u]??"").trim(),I=(((z=ue.value[u])==null?void 0:z.message)??"").trim();return!m&&!y&&!I?null:{activityLabel:(m==null?void 0:m.label)||"Thinking",activityDetails:(m==null?void 0:m.details)??[],reasoningText:y,errorText:I}}),D=ce(()=>{const u=n.value;if(!u)return[];const m=r.value[u]??[],y=s.value[u]??[],I=i.value[u]??[],z=[...m,...I,...y],K=F.value[u];return K?pE(z,K):z});function Y(u){n.value!==u&&(n.value=u,nE(u),ee=!1)}function X(u){f.value=u.trim()}async function J(){f.value=Xt,c.value.includes(Xt)||(c.value=[...c.value,Xt]);try{await Zb(Xt)}catch{}}function V(u,m){re.value={...re.value,[u]:m}}function fe(u){re.value[u]&&(re.value=At(re.value,u))}async function ie(u){if(Ae.has(u))return;const m=re.value[u];if(!(!m||m.fallbackRetried)){Ae.add(u),V(u,{...m,fallbackRetried:!0});try{await J();try{const y=await Cc(u,1);Se(u,y),tt(u,[]),Ct(u),i.value[u]&&(i.value=At(i.value,u))}catch{}A(u,null),we.value="",W(u,null),C(u,{label:"Thinking",details:ve(Xt,m.effort)}),Q(u,!0),B.value[u]!==!0&&await Ci(u),await Ai(u,m.text,m.imageUrls,Xt,m.effort||void 0,m.skills.length>0?m.skills:void 0,m.fileAttachments),B.value={...B.value,[u]:!0},L.add(u),qe=!0,await wr()}catch(y){const I=y instanceof Error?y.message:"Unknown application error";A(u,I),we.value=I,Q(u,!1),C(u,null)}finally{Ae.delete(u)}}}function ge(u){u&&!lu.includes(u)||(p.value=u)}function ve(u,m){const y=u.trim()||"default",I=m||"default";return[`Model: ${y}`,`Thinking: ${I}`]}async function De(){try{const[u,m]=await Promise.all([e_(),t_()]);c.value=u,f.value.length>0&&u.includes(f.value)||(m.model&&u.includes(m.model)?f.value=m.model:u.length>0?f.value=u[0]:f.value=""),m.reasoningEffort&&lu.includes(m.reasoningEffort)&&(p.value=m.reasoningEffort)}catch{}}function Ve(u){const m=Z.value;return Object.keys(m).length===0?u:u.map(y=>({projectName:y.projectName,threads:y.threads.map(I=>{const z=m[I.id];return z?{...I,title:z}:I})}))}function Pe(){const m=Ve(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(I=>{const z=a.value[I.id]===!0,K=n.value===I.id,ye=b.value[I.id],Ce=d.value[I.id]===!0,me=!K&&!z&&(Ce||ye!==I.updatedAtIso);return{...I,inProgress:z,unread:me}})}));e.value=mo(e.value,m)}function et(u,m,y){const I=new Date().toISOString(),z=m.trim(),K=wE(z),ye={id:u,title:bE(y),projectName:K,cwd:z,hasWorktree:z.includes("/.codex/worktrees/")||z.includes("/.git/worktrees/"),createdAtIso:I,updatedAtIso:I,preview:y,unread:!1,inProgress:!1},Ce=t.value.findIndex(Je=>Je.projectName===K);if(Ce>=0){const mt=t.value[Ce].threads.filter(zn=>zn.id!==u),Hr={projectName:K,threads:[ye,...mt]},An=[...t.value];An.splice(Ce,1,Hr),t.value=An}else t.value=[{projectName:K,threads:[ye]},...t.value];const me=ho(R.value,t.value);Rr(R.value,me)||(R.value=me,Wr(R.value)),Pe()}function ft(u){const m=new Set(u.map(K=>K.id)),y=Mt(b.value,m);y!==b.value&&(b.value=y,cu(y));const I=Mt(O.value,m);I!==O.value&&(O.value=I,du(I)),$.value=Mt($.value,m),q.value=Mt(q.value,m),B.value=Mt(B.value,m),r.value=Mt(r.value,m),s.value=Mt(s.value,m),o.value=Mt(o.value,m),i.value=Mt(i.value,m),F.value=Mt(F.value,m),ae.value=Mt(ae.value,m),ue.value=Mt(ue.value,m),he.value=Mt(he.value,m),d.value=Mt(d.value,m),a.value=Mt(a.value,m);const z={};for(const[K,ye]of Object.entries(_e.value))(K===Es||m.has(K))&&(z[K]=ye);_e.value=z}function H(u){const m=tr(t.value).find(y=>y.id===u);m&&(b.value={...b.value,[u]:m.updatedAtIso},cu(b.value),d.value[u]&&(d.value=At(d.value,u)),Pe())}function W(u,m){if(!u)return;const y=F.value[u];if(m){if(uE(y,m))return;F.value={...F.value,[u]:m}}else y&&(F.value=At(F.value,u))}function Q(u,m){!u||a.value[u]===!0===m||(m?a.value={...a.value,[u]:!0}:a.value=At(a.value,u),Pe())}function k(u){u&&u!==n.value&&d.value[u]!==!0&&(d.value={...d.value,[u]:!0},Pe())}function C(u,m){if(!u)return;const y=ae.value[u];if(!m){y&&(ae.value=At(ae.value,u));return}const I=Lr(m.label)||"Thinking",z=m.details.map(Ce=>Lr(Ce)).filter(Ce=>Ce.length>0&&Ce!==I),K=Array.from(new Set([...(y==null?void 0:y.details)??[],...z])).slice(-3),ye={label:I,details:K};dE(y,ye)||(ae.value={...ae.value,[u]:ye})}function A(u,m){if(!u)return;const y=ue.value[u],I=m?wa(m):"";if(!I){y&&(ue.value=At(ue.value,u));return}(y==null?void 0:y.message)!==I&&(ue.value={...ue.value,[u]:{message:I}})}function ne(u){const m=tr(t.value).find(y=>y.id===u);return(m==null?void 0:m.updatedAtIso)??""}function be(u,m){if(!u)return;const y={scrollTop:Math.max(0,m.scrollTop),isAtBottom:m.isAtBottom===!0};typeof m.scrollRatio=="number"&&Number.isFinite(m.scrollRatio)&&(y.scrollRatio=Gf(m.scrollRatio,0,1));const I=O.value[u];I&&I.scrollTop===y.scrollTop&&I.isAtBottom===y.isAtBottom&&I.scrollRatio===y.scrollRatio||(O.value={...O.value,[u]:y},du(O.value))}function Se(u,m){const y=r.value[u]??[];Fo(y,m)||(r.value={...r.value,[u]:m})}function tt(u,m){const y=s.value[u]??[];Fo(y,m)||(s.value={...s.value,[u]:m})}function Qe(u,m){const y=s.value[u]??[],I=fu(y,m);tt(u,I)}function lt(u,m){if(!u)return;const y=m.trim(),I=o.value[u]??"";if(y.length===0){if(!I)return;o.value=At(o.value,u);return}I!==y&&(o.value={...o.value,[u]:y})}function yt(u,m){if(!u)return;const y=o.value[u]??"";lt(u,`${y}${m}`)}function Ct(u){u&&u in o.value&&(o.value=At(o.value,u))}function $e(u){return u!==null&&typeof u=="object"&&!Array.isArray(u)?u:null}function Re(u){return typeof u=="string"?u:""}function fr(u){return typeof u=="number"&&Number.isFinite(u)?u:null}function qt(u){const m=$e(u.params);if(!m)return"";const y=Re(m.threadId);if(y)return y;const I=Re(m.thread_id);if(I)return I;const z=Re(m.conversationId);if(z)return z;const K=Re(m.conversation_id);if(K)return K;const ye=$e(m.thread),Ce=Re(ye==null?void 0:ye.id);if(Ce)return Ce;const me=$e(m.turn),Je=Re(me==null?void 0:me.threadId);if(Je)return Je;const mt=Re(me==null?void 0:me.thread_id);return mt||""}function fs(u){if(u.method!=="turn/completed")return"";const m=$e(u.params),y=$e(m==null?void 0:m.turn);if(!y||y.status!=="failed")return"";const I=$e(y.error);return Re(I==null?void 0:I.message)}function hr(u){var y;if(u.method!=="error")return"";const m=$e(u.params);return Re(m==null?void 0:m.message)||Re((y=$e(m==null?void 0:m.error))==null?void 0:y.message)}function jt(u){const m=$e(u);if(!m)return null;const y=m.id,I=Re(m.method),z=m.params;if(typeof y!="number"||!Number.isInteger(y)||!I)return null;const K=$e(z),ye=Re(K==null?void 0:K.threadId)||Es,Ce=Re(K==null?void 0:K.turnId),me=Re(K==null?void 0:K.itemId),Je=Re(m.receivedAtIso)||new Date().toISOString();return{id:y,method:I,threadId:ye,turnId:Ce,itemId:me,receivedAtIso:Je,params:z??null}}function pr(u){const m=u.threadId||Es,y=_e.value[m]??[],I=y.findIndex(K=>K.id===u.id),z=[...y];I>=0?z.splice(I,1,u):z.push(u),_e.value={..._e.value,[m]:z.sort((K,ye)=>K.receivedAtIso.localeCompare(ye.receivedAtIso))}}function mr(u){const m={};for(const[y,I]of Object.entries(_e.value)){const z=I.filter(K=>K.id!==u);z.length>0&&(m[y]=z)}_e.value=m}function hs(u){if(u.method==="server/request"){const m=jt(u.params);return m&&pr(m),!0}if(u.method==="server/request/resolved"){const m=$e(u.params),y=m==null?void 0:m.id;return typeof y=="number"&&Number.isInteger(y)&&mr(y),!0}return!1}function Lr(u){return u.replace(/\s+/gu," ").trim()}function jr(u){const m=qt(u);if(!m)return null;if(u.method==="turn/started")return{threadId:m,activity:{label:"Thinking",details:[]}};if(u.method==="item/started"){const y=$e(u.params),I=$e(y==null?void 0:y.item),z=Re(I==null?void 0:I.type).toLowerCase();if(z==="reasoning")return{threadId:m,activity:{label:"Thinking",details:[]}};if(z==="agentmessage")return{threadId:m,activity:{label:"Writing response",details:[]}};if(z==="commandexecution"){const K=Re(I==null?void 0:I.command);return{threadId:m,activity:{label:"Running command",details:K?[K]:[]}}}}return u.method==="item/commandExecution/outputDelta"?{threadId:m,activity:{label:"Running command",details:[]}}:u.method==="item/reasoning/summaryTextDelta"||u.method==="item/reasoning/summaryPartAdded"?{threadId:m,activity:{label:"Thinking",details:[]}}:u.method==="item/agentMessage/delta"?{threadId:m,activity:{label:"Writing response",details:[]}}:null}function Br(u){if(u.method!=="turn/started")return null;const m=$e(u.params);if(!m)return null;const y=qt(u);if(!y)return null;const I=$e(m.turn),z=Re(I==null?void 0:I.id)||Re(m.turnId)||`${y}:unknown`;if(!z)return null;const K=Xn(Re(I==null?void 0:I.startedAt))??Xn(Re(m.startedAt))??Xn(u.atIso)??Date.now();return{threadId:y,turnId:z,startedAtMs:K}}function Sn(u){if(u.method!=="turn/completed")return null;const m=$e(u.params);if(!m)return null;const y=qt(u);if(!y)return null;const I=$e(m.turn),z=Re(I==null?void 0:I.id)||Re(m.turnId)||`${y}:unknown`;if(!z)return null;const K=Xn(Re(I==null?void 0:I.completedAt))??Xn(Re(m.completedAt))??Xn(u.atIso)??Date.now(),ye=Xn(Re(I==null?void 0:I.startedAt))??Xn(Re(m.startedAt))??void 0;return{threadId:y,turnId:z,completedAtMs:K,startedAtMs:ye}}function en(u){return`${u}:live-reasoning`}function ps(u){const m=$e(u.params);if(!m)return"";if(u.method==="item/started"){const y=$e(m.item);return!y||y.type!=="reasoning"?"":Re(y.id)}return""}function gr(u){const m=$e(u.params);if(!m)return null;if(u.method==="item/reasoning/summaryTextDelta"){const y=Re(m.itemId),I=Re(m.delta);return!y||!I?null:{messageId:en(y),delta:I}}return null}function Fr(u){const m=$e(u.params);if(!m)return"";if(u.method==="item/reasoning/summaryPartAdded"){const y=Re(m.itemId);return y?en(y):""}return""}function ms(u){const m=$e(u.params);if(!m)return"";if(u.method==="item/completed"){const y=$e(m.item);return!y||y.type!=="reasoning"?"":en(Re(y.id))}return""}function vr(u){const m=$e(u.params);if(!m)return"";if(u.method==="item/started"){const y=$e(m.item);return!y||y.type!=="agentMessage"?"":Re(y.id)}return""}function Ur(u){const m=$e(u.params);if(!m)return null;if(u.method==="item/agentMessage/delta"){const y=Re(m.itemId),I=Re(m.delta);return!y||!I?null:{messageId:y,delta:I}}return null}function Kn(u){const m=$e(u.params);if(!m)return null;if(u.method==="item/completed"){const y=$e(m.item);if(!y||y.type!=="agentMessage")return null;const I=Re(y.id),z=Re(y.text);return!I||!z?null:{id:I,role:"assistant",text:z,messageType:"agentMessage.live"}}return null}function gs(u){if(u.method!=="item/started")return null;const m=$e(u.params),y=$e(m==null?void 0:m.item);if(!y||y.type!=="commandExecution")return null;const I=Re(y.id),z=Re(y.command);if(!I)return null;const K=typeof y.cwd=="string"?y.cwd:null;return{id:I,role:"system",text:z,messageType:"commandExecution",commandExecution:{command:z,cwd:K,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function vs(u){if(u.method!=="item/commandExecution/outputDelta")return null;const m=$e(u.params);if(!m)return null;const y=Re(m.itemId),I=Re(m.delta);return!y||!I?null:{itemId:y,delta:I}}function ys(u){if(u.method!=="item/completed")return null;const m=$e(u.params),y=$e(m==null?void 0:m.item);if(!y||y.type!=="commandExecution")return null;const I=Re(y.id),z=Re(y.command);if(!I)return null;const K=typeof y.cwd=="string"?y.cwd:null,ye=Re(y.status),Ce=ye==="failed"?"failed":ye==="declined"?"declined":ye==="interrupted"?"interrupted":"completed",me=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",Je=typeof y.exitCode=="number"?y.exitCode:null;return{id:I,role:"system",text:z,messageType:"commandExecution",commandExecution:{command:z,cwd:K,status:Ce,aggregatedOutput:me,exitCode:Je}}}function En(u,m){const y=i.value[u]??[],I=fu(y,m);I!==y&&(i.value={...i.value,[u]:I})}function ws(u,m){const y=i.value[u];if(!y||y.length===0)return;const I=new Set(m.map(K=>K.id)),z=y.filter(K=>!I.has(K.id));z.length!==y.length&&(z.length===0?i.value=At(i.value,u):i.value={...i.value,[u]:z})}function T(u){if(u.method==="item/agentMessage/delta")return!0;const m=$e(u.params);if(!m)return!1;if(u.method==="item/completed"){const y=$e(m.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function E(u){var cl,ul,dl,fl;if(hs(u))return;if(u.method==="thread/name/updated"){const He=$e(u.params),fn=Re(He==null?void 0:He.threadId),br=Re(He==null?void 0:He.threadName);fn&&br&&(Z.value={...Z.value,[fn]:br},Pe(),Ri(fn,br))}const m=jr(u);m&&C(m.threadId,m.activity);const y=Br(u);y&&(pe.set(y.turnId,y),he.value={...he.value,[y.threadId]:y.turnId},W(y.threadId,null),A(y.threadId,null),Q(y.threadId,!0),d.value[y.threadId]&&(d.value=At(d.value,y.threadId)));const I=Sn(u),z=fs(u),ye=!!((I==null?void 0:I.threadId)??qt(u))&&!!z&&f.value!==Xt&&po(new Error(z));if(I){const He=pe.get(I.turnId);He&&pe.delete(I.turnId);const fn=fr((cl=$e(u.params))==null?void 0:cl.durationMs)??fr((dl=$e((ul=$e(u.params))==null?void 0:ul.turn))==null?void 0:dl.durationMs)??(typeof I.startedAtMs=="number"?I.completedAtMs-I.startedAtMs:null)??(He?I.completedAtMs-He.startedAtMs:null),br=typeof fn=="number"?Math.max(0,fn):0;W(I.threadId,{turnId:I.turnId,durationMs:br}),he.value[I.threadId]&&(he.value=At(he.value,I.threadId)),Q(I.threadId,!1),C(I.threadId,null),k(I.threadId),ye||(fe(I.threadId),sl(I.threadId))}if(z){const He=(I==null?void 0:I.threadId)||qt(u);He&&A(He,z),we.value=z,He&&ye&&ie(He)}else I&&A(I.threadId,null);const Ce=hr(u);if(Ce){const He=qt(u);He&&A(He,Ce),we.value=Ce,f.value!==Xt&&po(new Error(Ce))&&(He?ie(He):J())}const me=qt(u);if(!me||me!==n.value)return;vr(u);const Je=Ur(u);if(Je){const He=(s.value[me]??[]).find(br=>br.id===Je.messageId),fn=`${(He==null?void 0:He.text)??""}${Je.delta}`;Qe(me,{id:Je.messageId,role:"assistant",text:fn,messageType:"agentMessage.live"})}const mt=Kn(u);mt&&Qe(me,mt),ps(u);const Hr=gr(u);if(Hr&&yt(me,Hr.delta),Fr(u)){const He=o.value[me]??"";He.trim().length>0&&!He.endsWith(`
1439
-
1440
- `)&&lt(me,`${He}
1441
-
1442
- `)}ms(u);const zn=gs(u);zn&&(En(me,zn),C(me,{label:"Running command",details:[((fl=zn.commandExecution)==null?void 0:fl.command)??""]}));const ai=vs(u);if(ai){const He=(i.value[me]??[]).find(fn=>fn.id===ai.itemId);He!=null&&He.commandExecution&&En(me,{...He,commandExecution:{...He.commandExecution,aggregatedOutput:`${He.commandExecution.aggregatedOutput}${ai.delta}`}})}const ll=ys(u);if(ll&&En(me,ll),T(u)&&(ee&&n.value&&be(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Ct(me)),u.method==="turn/completed"){ee=!1,Ct(me),i.value[me]&&(i.value=At(i.value,me));const He=qt(u);He&&(Q(He,!1),C(He,null),k(He),ye||(fe(He),sl(He)))}}function x(u){const m=qt(u);m&&L.add(m);const y=u.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(qe=!0),!(Ze!==null||typeof window>"u")&&(Ze=window.setTimeout(()=>{Ze=null,wr()},Li))}async function G(u){if(!se){se=!0;try{const m=await Rc(),y=[];for(const I of m.order){const z=Fi(I);y.includes(z)||y.push(z)}if(y.length>0){const I=ho(y,u);Rr(R.value,I)||(R.value=I,Wr(R.value))}if(Object.keys(m.labels).length>0){const I={...U.value};let z=!1;for(const[K,ye]of Object.entries(m.labels)){const Ce=Fi(K);I[Ce]!==ye&&(I[Ce]=ye,z=!0)}z&&(U.value=I,ji(I))}}catch{}}}async function je(){if(!(Object.keys(Z.value).length>0))try{const u=await a_();Object.keys(u.titles).length>0&&(Z.value=u.titles)}catch{}}async function Tt(u,m,y){if(Z.value[u])return;const I=m.trim();if(!I)return;const z=I.length>300?I.slice(0,300):I;try{const K=await l_(z,y);if(!K||Z.value[u])return;Z.value={...Z.value,[u]:K},Pe(),Ri(u,K)}catch{}}async function xt(){var u;ot.value||(te.value=!0);try{const[m]=await Promise.all([Vb(),je()]);await G(m);const y=ho(R.value,m);Rr(R.value,y)||(R.value=y,Wr(R.value));const I=Bi(m,R.value),z=yE(t.value,I,a.value);t.value=mo(t.value,z),a.value=Mt(a.value,new Set(tr(t.value).map(Ce=>Ce.id))),Pe(),ot.value=!0;const K=tr(e.value);ft(K),K.some(Ce=>Ce.id===n.value)||Y(((u=K[0])==null?void 0:u.id)??"")}finally{te.value=!1}}async function tn(u,m={}){if(!u)return;const y=$.value[u]===!0,I=m.silent!==!0&&!y;I&&(Te.value=!0);try{B.value[u]!==!0&&(await Ci(u),B.value={...B.value,[u]:!0});const{messages:z,inProgress:K}=await Wb(u),ye=r.value[u]??[],Ce=aE(ye,z,{preserveMissing:m.silent===!0});Se(u,Ce);const me=s.value[u]??[],Je=lE(me,z);tt(u,Je),ws(u,z),$.value={...$.value,[u]:!0};const mt=ne(u);mt&&(q.value={...q.value,[u]:mt}),Q(u,K),H(u)}finally{I&&(Te.value=!1)}}async function yr(){try{const u=t.value.flatMap(m=>m.threads.map(y=>y.cwd)).filter(Boolean);ke.value=await c_(u.length>0?[...new Set(u)]:void 0)}catch{}}async function M(){we.value="";try{await xt(),await Promise.all([De(),yr()]),await tn(n.value)}catch(u){we.value=u instanceof Error?u.message:"Unknown application error"}}async function oe(u){Y(u);try{await tn(u)}catch(m){we.value=m instanceof Error?m.message:"Unknown application error"}}async function xe(u){try{await zb(u),await xt(),n.value===u&&await tn(n.value)}catch(m){we.value=m instanceof Error?m.message:"Unknown application error"}}async function It(u,m){const y=m.trim();if(!(!u||!y))try{await Jb(u,y),Z.value={...Z.value,[u]:y},Pe(),Ri(u,y)}catch(I){we.value=I instanceof Error?I.message:"Unknown application error"}}async function Gt(u,m=[],y=[],I="steer",z=[]){const K=n.value,ye=u.trim();if(!K||!ye&&m.length===0&&z.length===0)return;const Ce=a.value[K]===!0;if(Ce&&I==="queue"){const me=l.value[K]??[],Je=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[K]:[...me,{id:Je,text:ye,imageUrls:m,skills:y,fileAttachments:z}]};return}if(Ce){ee=!0,Cn(K,ye,m,y,z).catch(me=>{const Je=me instanceof Error?me.message:"Unknown application error";A(K,Je),we.value=Je});return}we.value="",ee=!0,W(K,null),C(K,{label:"Thinking",details:ve(f.value,p.value)}),A(K,null),Q(K,!0);try{await Cn(K,ye,m,y,z)}catch(me){ee=!1,Q(K,!1),C(K,null);const Je=me instanceof Error?me.message:"Unknown application error";throw A(K,Je),we.value=Je,me}}async function nn(u,m,y=[],I=[],z=[]){const K=u.trim(),ye=m.trim(),Ce=f.value.trim();if(!K&&y.length===0&&z.length===0)return"";Be.value=!0,we.value="";let me="";try{try{me=await Ac(ye||void 0,Ce||void 0)}catch(An){if(Ce&&Ce!==Xt&&po(An))await J(),me=await Ac(ye||void 0,Xt);else throw An}if(!me)return"";et(me,ye,K||"[Image]"),B.value={...B.value,[me]:!0},Y(me),ee=!0,W(me,null),C(me,{label:"Thinking",details:ve(f.value,p.value)}),A(me,null),Q(me,!0);const Je=me,mt=ye||null,Hr=K;return Cn(me,K,y,I,z).catch(An=>{ee=!1,Q(me,!1),C(me,null);const zn=An instanceof Error?An.message:"Unknown application error";A(me,zn),we.value=zn}).finally(()=>{Be.value=!1}),Tt(Je,Hr,mt),me}catch(Je){ee=!1,me&&(Q(me,!1),C(me,null));const mt=Je instanceof Error?Je.message:"Unknown application error";throw me&&A(me,mt),we.value=mt,Be.value=!1,Je}}async function Cn(u,m,y=[],I=[],z=[]){const K=f.value.trim(),ye=p.value,Ce=m.trim(),me=I.map(mt=>({name:mt.name,path:mt.path})),Je=z.map(mt=>({...mt}));V(u,{text:Ce,imageUrls:[...y],skills:me,fileAttachments:Je,effort:ye,fallbackRetried:!1});try{B.value[u]!==!0&&await Ci(u);try{await Ai(u,m,y,K||void 0,ye||void 0,I.length>0?I:void 0,z)}catch(mt){if(K&&K!==Xt&&po(mt))await J(),V(u,{text:Ce,imageUrls:[...y],skills:me,fileAttachments:Je,effort:ye,fallbackRetried:!0}),await Ai(u,m,y,Xt,ye||void 0,I.length>0?I:void 0,z);else throw mt}B.value={...B.value,[u]:!0},L.add(u),qe=!0,await wr()}catch(mt){throw mt}}async function sl(u){const m=l.value[u];if(!m||m.length===0)return;const[y,...I]=m;l.value=I.length>0?{...l.value,[u]:I}:At(l.value,u),Be.value=!0,we.value="",ee=!0,W(u,null),C(u,{label:"Thinking",details:ve(f.value,p.value)}),A(u,null),Q(u,!0);try{await Cn(u,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Q(u,!1),C(u,null)}finally{Be.value=!1}}async function zf(){const u=n.value;if(!u||a.value[u]!==!0)return;const m=he.value[u];Ke.value=!0,we.value="";try{await Xb(u,m),Q(u,!1),C(u,null),A(u,null),he.value[u]&&(he.value=At(he.value,u)),L.add(u),qe=!0,await wr()}catch(y){const I=y instanceof Error?y.message:"Failed to interrupt active turn";A(u,I),we.value=I}finally{Ke.value=!1}}async function Jf(u){const m=n.value;if(!m||Ee.value)return;const I=(r.value[m]??[]).reduce((K,ye)=>typeof ye.turnIndex=="number"&&ye.turnIndex>K?ye.turnIndex:K,-1);if(I<0||u>I)return;const z=I-u+1;if(!(z<1)){Ee.value=!0,we.value="";try{const K=await Cc(m,z);Se(m,K),tt(m,[]),Ct(m),i.value[m]&&(i.value=At(i.value,m)),W(m,null),C(m,null),A(m,null),qe=!0,await wr()}catch(K){we.value=K instanceof Error?K.message:"Failed to rollback thread"}finally{Ee.value=!1}}}function Yf(u,m){u.length===0||(U.value[u]??"")===m||(U.value={...U.value,[u]:m},ji(U.value))}function Qf(u){var z;if(u.length===0)return;const m=R.value.filter(K=>K!==u);if(Rr(R.value,m)||(R.value=m,Wr(R.value)),t.value=t.value.filter(K=>K.projectName!==u),U.value[u]!==void 0){const K={...U.value};delete K[u],U.value=K,ji(K)}Pe();const y=tr(e.value);ft(y),y.some(K=>K.id===n.value)||Y(((z=y[0])==null?void 0:z.id)??""),ii()}function Xf(u,m){if(u.length===0||t.value.length===0)return;const y=t.value.map(me=>me.projectName),I=y.indexOf(u);if(I===-1)return;const z=Math.max(0,Math.min(m,y.length-1)),K=oE(y,I,z);if(K===y)return;const ye=ho(K,t.value);R.value=ye,Wr(R.value);const Ce=Bi(t.value,R.value);t.value=mo(t.value,Ce),Pe(),ii()}function Zf(u){const m=u.trim();if(!m)return;const y=[m,...R.value.filter(z=>z!==m)];if(Rr(R.value,y))return;R.value=y,Wr(R.value);const I=Bi(t.value,R.value);t.value=mo(t.value,I),Pe(),ii()}async function ii(){var u,m;try{const y=await Rc(),I=new Map;for(const ye of y.order){const Ce=Fi(ye);I.has(Ce)||I.set(Ce,ye)}for(const ye of t.value){const Ce=((m=(u=ye.threads[0])==null?void 0:u.cwd)==null?void 0:m.trim())??"";Ce&&I.set(ye.projectName,Ce)}const z=[];for(const ye of R.value){const Ce=I.get(ye);Ce&&!z.includes(Ce)&&z.push(Ce)}for(const ye of y.order)z.includes(ye)||z.push(ye);const K=y.active.filter(ye=>z.includes(ye));K.length===0&&z.length>0&&K.push(z[0]),await r_({order:z,labels:y.labels,active:K})}catch{}}async function eh(){if(!Ne.value){Ne.value=!0;try{if(await xt(),!n.value)return;const u=n.value,m=ne(u),y=q.value[u]??"",I=m.length>0&&m!==y;(a.value[u]===!0||I)&&await tn(u,{silent:!0})}catch{}finally{Ne.value=!1}}}async function wr(){if(Ne.value){typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,wr()},Li));return}Ne.value=!0;const u=qe,m=new Set(L);qe=!1,L.clear();try{u&&await xt();const y=n.value;if(!y)return;const I=m.has(y),z=a.value[y]===!0,K=ne(y),ye=q.value[y]??"",Ce=K.length>0&&K!==ye;(I||z||Ce||u)&&await tn(y,{silent:!0})}catch{}finally{Ne.value=!1,(qe||L.size>0)&&typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,wr()},Li))}}function th(){typeof window>"u"||We||(ze.value&&il(),nh(),We=qb(u=>{E(u),x(u)}))}async function nh(){try{const u=await Kb();for(const m of u){const y=jt(m);y&&pr(y)}}catch{}}async function rh(u){try{await Gb(u.id,{result:u.result,error:u.error}),mr(u.id)}catch(m){we.value=m instanceof Error?m.message:"Failed to reply to server request"}}function ol(u={}){const m=u.updatePreference??!0;wt!==null&&typeof window<"u"&&(window.clearInterval(wt),wt=null),vt!==null&&typeof window<"u"&&(window.clearInterval(vt),vt=null),m&&(ze.value=!1,uu(!1)),it.value=Math.floor(Ss/1e3)}function il(){typeof window>"u"||wt!==null||vt!==null||(ze.value=!0,uu(!0),it.value=Math.floor(Ss/1e3),wt=window.setInterval(()=>{it.value=Math.floor(Ss/1e3),eh()},Ss),vt=window.setInterval(()=>{it.value=Math.max(0,it.value-1)},1e3))}function sh(){if(ze.value){ol();return}il()}function oh(){ol({updatePreference:!1}),We&&(We(),We=null),qe=!1,L.clear(),pe.clear(),Ze!==null&&typeof window<"u"&&(window.clearTimeout(Ze),Ze=null),ee=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},F.value={},ue.value={},he.value={},l.value={}}const ih=ce(()=>{const u=n.value;return u?l.value[u]??[]:[]});function al(u){const m=n.value;if(!m)return;const y=l.value[m];if(!y)return;const I=y.filter(z=>z.id!==u);l.value=I.length>0?{...l.value,[m]:I}:At(l.value,m)}function ah(u){const m=n.value;if(!m)return;const y=l.value[m];if(!y)return;const I=y.find(z=>z.id===u);I&&(al(u),Gt(I.text,I.imageUrls,I.skills,"steer",I.fileAttachments))}return{projectGroups:e,projectDisplayNameById:U,selectedThread:h,selectedThreadScrollState:w,selectedThreadServerRequests:P,selectedLiveOverlay:N,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:p,installedSkills:ke,messages:D,isLoadingThreads:te,isLoadingMessages:Te,isSendingMessage:Be,isInterruptingTurn:Ke,isAutoRefreshEnabled:ze,autoRefreshSecondsLeft:it,error:we,refreshAll:M,refreshSkills:yr,selectThread:oe,setThreadScrollState:be,archiveThreadById:xe,renameThreadById:It,sendMessageToSelectedThread:Gt,sendMessageToNewThread:nn,interruptSelectedThreadTurn:zf,rollbackSelectedThread:Jf,isRollingBack:Ee,selectedThreadQueuedMessages:ih,removeQueuedMessage:al,steerQueuedMessage:ah,setSelectedModelId:X,setSelectedReasoningEffort:ge,respondToPendingServerRequest:rh,renameProject:Yf,removeProject:Qf,reorderProject:Xf,pinProjectToTop:Zf,toggleAutoRefreshTimer:sh,startPolling:th,stopPolling:oh}}const kE={class:"sidebar-root"},TE={class:"sidebar-scrollable"},IE=["aria-pressed"],SE={key:1,class:"sidebar-search-bar"},EE={key:0,class:"sidebar-settings-area"},CE={key:0,class:"sidebar-settings-panel"},AE={class:"sidebar-settings-value"},RE={class:"sidebar-settings-value"},PE={class:"content-root"},xE={class:"content-body"},ME={key:1,class:"content-grid"},OE={class:"new-thread-empty"},NE={key:2,class:"content-grid"},DE={class:"content-thread"},$E={class:"composer-with-queue"},LE={class:"build-badge","aria-label":"Worktree name"},hu="codex-web-local.sidebar-collapsed.v1",pu="codex-web-local.send-with-enter.v1",mu="codex-web-local.in-progress-send-mode.v1",gu="codex-web-local.dark-mode.v1",jE=Pt({__name:"App",setup(e){const t="1781",{projectGroups:n,projectDisplayNameById:r,selectedThread:s,selectedThreadScrollState:o,selectedThreadServerRequests:i,selectedLiveOverlay:a,selectedThreadId:l,availableModelIds:d,selectedModelId:c,selectedReasoningEffort:f,installedSkills:p,messages:b,isLoadingThreads:O,isLoadingMessages:R,isInterruptingTurn:U,isAutoRefreshEnabled:q,autoRefreshSecondsLeft:$,refreshAll:B,refreshSkills:F,selectThread:ae,setThreadScrollState:ue,archiveThreadById:he,renameThreadById:_e,sendMessageToSelectedThread:re,sendMessageToNewThread:Z,interruptSelectedThreadTurn:ke,rollbackSelectedThread:te,isRollingBack:Te,selectedThreadQueuedMessages:Be,removeQueuedMessage:Ke,steerQueuedMessage:Ee,setSelectedModelId:we,setSelectedReasoningEffort:Ne,respondToPendingServerRequest:ot,renameProject:ze,removeProject:it,reorderProject:We,pinProjectToTop:Ze,toggleAutoRefreshTimer:wt,startPolling:vt,stopPolling:qe}=_E(),L=qg(),se=Wg(),{isMobile:ee}=qd(),pe=j(!1),Ae=j(!1),g=j(""),h=j(G()),w=j(""),P=j(!1),N=j(null),D=j("New Project (1)"),Y=j(""),X=j(!1),J=j(vs(pu,!0)),V=j(En()),fe=j(ys()),ie=ce(()=>{const M=L.params.threadId;return typeof M=="string"?M:""}),ge=ce(()=>{const M=new Set;for(const oe of n.value)for(const xe of oe.threads)M.add(xe.id);return M}),ve=ce(()=>L.name==="home"),De=ce(()=>L.name==="skills"),Ve=ce(()=>{var M;return De.value?"Skills":ve.value?"New thread":((M=s.value)==null?void 0:M.title)??"Choose a thread"}),Pe=ce(()=>q.value?`Auto refresh in ${String($.value)}s`:"Enable 4s refresh"),et=ce(()=>b.value.filter(M=>{const oe=Tt(M.messageType,M.role);return oe==="worked"?!0:!(oe==="turnActivity.live"||oe==="turnError.live"||oe==="agentReasoning.live")})),ft=ce(()=>a.value),H=ce(()=>ve.value?"__new-thread__":l.value),W=ce(()=>{var M,oe;return ve.value?g.value.trim():((oe=(M=s.value)==null?void 0:M.cwd)==null?void 0:oe.trim())??""}),Q=ce(()=>{var M;return!ve.value&&((M=s.value)==null?void 0:M.inProgress)===!0}),k=ce(()=>{var It,Gt;const M=[],oe=new Set;for(const nn of n.value){const Cn=((Gt=(It=nn.threads[0])==null?void 0:It.cwd)==null?void 0:Gt.trim())??"";!Cn||oe.has(Cn)||(oe.add(Cn),M.push({value:Cn,label:r.value[nn.projectName]??nn.projectName}))}const xe=g.value.trim();return xe&&!oe.has(xe)&&M.unshift({value:xe,label:Fr(xe)}),M}),C=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;cr(()=>{window.addEventListener("keydown",pr),x(),C==null||C.addEventListener("change",x),xt(),ps(),Sn()}),Yo(()=>{window.removeEventListener("keydown",pr),C==null||C.removeEventListener("change",x),qe()});function A(){F()}function ne(){P.value=!P.value,P.value?Yt(()=>{var M;return(M=N.value)==null?void 0:M.focus()}):w.value=""}function be(){var M;w.value="",(M=N.value)==null||M.focus()}function Se(M){M.key==="Escape"&&(P.value=!1,w.value="")}function tt(M){M&&(L.name==="thread"&&ie.value===M||(se.push({name:"thread",params:{threadId:M}}),ee.value&&jt(!0)))}function Qe(M){he(M)}function lt(M){var It,Gt;const oe=n.value.find(nn=>nn.projectName===M),xe=((Gt=(It=oe==null?void 0:oe.threads[0])==null?void 0:It.cwd)==null?void 0:Gt.trim())??"";xe&&(g.value=xe),ee.value&&jt(!0),!ve.value&&se.push({name:"home"})}function yt(){var oe,xe;const M=((xe=(oe=s.value)==null?void 0:oe.cwd)==null?void 0:xe.trim())??"";M&&(g.value=M),ee.value&&jt(!0),!ve.value&&se.push({name:"home"})}function Ct(M){ze(M.projectName,M.displayName)}function $e(M){_e(M.threadId,M.title)}function Re(M){it(M)}function fr(M){We(M.projectName,M.toIndex)}function qt(M){ue(M.threadId,M.state)}function fs(M){ot(M)}function hr(){wt()}function jt(M){h.value!==M&&(h.value=M,je(M))}function pr(M){M.defaultPrevented||!M.ctrlKey&&!M.metaKey||M.shiftKey||M.altKey||M.key.toLowerCase()==="b"&&(M.preventDefault(),jt(!h.value))}function mr(M){const oe=M.text;if(ve.value){yr(oe,M.imageUrls,M.skills,M.fileAttachments);return}re(oe,M.imageUrls,M.skills,M.mode,M.fileAttachments)}function hs(M){g.value=M.trim()}async function Lr(M){const oe=M.trim();if(!oe)return;const xe=Br(oe),It=await jr(),Gt=xe?oe:ms(It,oe);if(Gt)try{const nn=await s_(Gt,{createIfMissing:!xe,label:xe?"":oe});nn&&(g.value=nn,Ze(Fr(nn)),Sn())}catch{}}async function jr(){const M=en();if(M)return M;try{const oe=await Pc();if(oe)return Y.value=oe,oe}catch{}return""}function Br(M){return M?M.startsWith("~/")||M.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(M):!1}async function Sn(){const M=en();if(!M){D.value="New Project (1)";return}try{const oe=await o_(M);D.value=oe.name||"New Project (1)"}catch{D.value="New Project (1)"}}function en(){var xe,It;const M=g.value.trim();if(M)return gr(M);const oe=((It=(xe=k.value[0])==null?void 0:xe.value)==null?void 0:It.trim())??"";return oe?gr(oe):Y.value.trim()}async function ps(){try{Y.value=await Pc()}catch{Y.value=""}}function gr(M){const oe=M.trim().replace(/\/+$/,"");if(!oe)return"";const xe=oe.lastIndexOf("/");return xe<=0?"":oe.slice(0,xe)}function Fr(M){const oe=M.trim().replace(/\/+$/,"");if(!oe)return"";const xe=oe.lastIndexOf("/");return xe<0?oe:oe.slice(xe+1)}function ms(M,oe){const xe=M.trim().replace(/\/+$/,""),It=oe.trim().replace(/^\/+/,"");return!xe||!It?"":`${xe}/${It}`}function vr(M){we(M)}function Ur(M){Ne(M)}function Kn(){ke()}function gs(M){te(M.turnIndex)}function vs(M,oe){if(typeof window>"u")return oe;const xe=window.localStorage.getItem(M);return xe===null?oe:xe==="1"}function ys(){if(typeof window>"u")return"system";const M=window.localStorage.getItem(gu);return M==="light"||M==="dark"?M:"system"}function En(){return typeof window>"u"?"queue":window.localStorage.getItem(mu)==="steer"?"steer":"queue"}function ws(){J.value=!J.value,window.localStorage.setItem(pu,J.value?"1":"0")}function T(){V.value=V.value==="steer"?"queue":"steer",window.localStorage.setItem(mu,V.value)}function E(){const M=["system","light","dark"],oe=M.indexOf(fe.value);fe.value=M[(oe+1)%M.length],window.localStorage.setItem(gu,fe.value),x()}function x(){const M=document.documentElement;if(fe.value==="dark")M.classList.add("dark");else if(fe.value==="light")M.classList.remove("dark");else{const oe=window.matchMedia("(prefers-color-scheme: dark)").matches;M.classList.toggle("dark",oe)}}function G(){return typeof window>"u"?!1:window.localStorage.getItem(hu)==="1"}function je(M){typeof window>"u"||window.localStorage.setItem(hu,M?"1":"0")}function Tt(M,oe){const xe=(M??"").trim();return xe.length>0?xe:oe.trim()||"message"}async function xt(){await B(),Ae.value=!0,await tn(),vt()}async function tn(){if(!pe.value){pe.value=!0;try{if(L.name==="home"||L.name==="skills"){l.value!==""&&await ae("");return}if(L.name==="thread"){const M=ie.value;if(!M)return;if(!ge.value.has(M)){await se.replace({name:"home"});return}l.value!==M&&await ae(M);return}}finally{pe.value=!1}}}gt(()=>[L.name,ie.value,O.value,ge.value.has(ie.value),l.value],async()=>{Ae.value&&await tn()}),gt(()=>l.value,async M=>{if(Ae.value&&!pe.value&&!(ve.value||De.value)){if(!M){L.name!=="home"&&await se.replace({name:"home"});return}L.name==="thread"&&ie.value===M||await se.replace({name:"thread",params:{threadId:M}})}}),gt(()=>k.value,M=>{if(M.length===0){g.value="";return}M.some(xe=>xe.value===g.value)||(g.value=M[0].value),Sn()},{immediate:!0}),gt(()=>g.value,()=>{Sn()}),gt(ee,M=>{M&&!h.value&&jt(!0)});async function yr(M,oe=[],xe=[],It=[]){try{const Gt=await Z(M,g.value,oe,xe,It);if(!Gt)return;await se.replace({name:"thread",params:{threadId:Gt}})}catch{}}return(M,oe)=>(_(),S(Fe,null,[Ie(Qg,{"is-sidebar-collapsed":h.value,onCloseSidebar:oe[5]||(oe[5]=xe=>jt(!0))},{sidebar:at(()=>[v("section",kE,[v("div",TE,[h.value?le("",!0):(_(),pt(au,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":h.value,"is-auto-refresh-enabled":Me(q),"auto-refresh-button-label":Pe.value,"show-new-thread-button":!0,onToggleSidebar:oe[0]||(oe[0]=xe=>jt(!h.value)),onToggleAutoRefresh:hr,onStartNewThread:yt},{default:at(()=>[v("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":P.value,"aria-label":"Search threads",title:"Search threads",onClick:ne},[Ie(ga,{class:"sidebar-search-toggle-icon"})],8,IE)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!h.value&&P.value?(_(),S("div",SE,[Ie(ga,{class:"sidebar-search-bar-icon"}),Hn(v("input",{ref_key:"sidebarSearchInputRef",ref:N,"onUpdate:modelValue":oe[1]||(oe[1]=xe=>w.value=xe),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Se},null,544),[[Vn,w.value]]),w.value.length>0?(_(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:be},[Ie(Va,{class:"sidebar-search-clear-icon"})])):le("",!0)])):le("",!0),h.value?le("",!0):(_(),S("button",{key:2,class:dt(["sidebar-skills-link",{"is-active":De.value}]),type:"button",onClick:oe[2]||(oe[2]=xe=>{Me(se).push({name:"skills"}),Me(ee)&&jt(!0)})}," Skills Hub ",2)),h.value?le("",!0):(_(),pt(Ly,{key:3,groups:Me(n),"project-display-name-by-id":Me(r),"selected-thread-id":Me(l),"is-loading":Me(O),"search-query":w.value,onSelect:tt,onArchive:Qe,onStartNewThread:lt,onRenameProject:Ct,onRenameThread:$e,onRemoveProject:Re,onReorderProject:fr},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))]),h.value?le("",!0):(_(),S("div",EE,[Ie(Md,{name:"settings-panel"},{default:at(()=>[X.value?(_(),S("div",CE,[v("button",{class:"sidebar-settings-row",type:"button",onClick:ws},[oe[6]||(oe[6]=v("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),v("span",{class:dt(["sidebar-settings-toggle",{"is-on":!J.value}])},null,2)]),v("button",{class:"sidebar-settings-row",type:"button",onClick:T},[oe[7]||(oe[7]=v("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),v("span",AE,de(V.value==="steer"?"Steer":"Queue"),1)]),v("button",{class:"sidebar-settings-row",type:"button",onClick:E},[oe[8]||(oe[8]=v("span",{class:"sidebar-settings-label"},"Appearance",-1)),v("span",RE,de(fe.value==="system"?"System":fe.value==="dark"?"Dark":"Light"),1)])])):le("",!0)]),_:1}),v("button",{class:"sidebar-settings-button",type:"button",onClick:oe[3]||(oe[3]=xe=>X.value=!X.value)},[Ie(YS,{class:"sidebar-settings-icon"}),oe[9]||(oe[9]=v("span",null,"Settings",-1))])]))])]),content:at(()=>[v("section",PE,[Ie(Vy,{title:Ve.value},{leading:at(()=>[h.value||Me(ee)?(_(),pt(au,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":h.value,"is-auto-refresh-enabled":Me(q),"auto-refresh-button-label":Pe.value,"show-new-thread-button":!0,onToggleSidebar:oe[4]||(oe[4]=xe=>jt(!h.value)),onToggleAutoRefresh:hr,onStartNewThread:yt},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):le("",!0)]),_:1},8,["title"]),v("section",xE,[De.value?(_(),pt(PS,{key:0,onSkillsChanged:A})):ve.value?(_(),S("div",ME,[v("div",OE,[oe[10]||(oe[10]=v("p",{class:"new-thread-hero"},"Let's build",-1)),Ie(aa,{class:"new-thread-folder-dropdown","model-value":g.value,options:k.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":D.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":hs,onAdd:Lr},null,8,["model-value","options","default-add-value"])]),Ie(xc,{"active-thread-id":H.value,cwd:W.value,models:Me(d),"selected-model":Me(c),"selected-reasoning-effort":Me(f),skills:Me(p),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":J.value,"in-progress-submit-mode":V.value,onSubmit:mr,"onUpdate:selectedModel":vr,"onUpdate:selectedReasoningEffort":Ur},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(_(),S("div",NE,[v("div",DE,[Ie(yb,{messages:et.value,"is-loading":Me(R),"active-thread-id":H.value,"scroll-state":Me(o),"live-overlay":ft.value,"pending-requests":Me(i),"is-turn-in-progress":Q.value,"is-rolling-back":Me(Te),onUpdateScrollState:qt,onRespondServerRequest:fs,onRollback:gs},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),v("div",$E,[Ie(j0,{messages:Me(Be),onSteer:Me(Ee),onDelete:Me(Ke)},null,8,["messages","onSteer","onDelete"]),Ie(xc,{"active-thread-id":H.value,cwd:W.value,models:Me(d),"selected-model":Me(c),"selected-reasoning-effort":Me(f),skills:Me(p),"is-turn-in-progress":Q.value,"is-interrupting-turn":Me(U),"has-queue-above":Me(Be).length>0,"send-with-enter":J.value,"in-progress-submit-mode":V.value,onSubmit:mr,"onUpdate:selectedModel":vr,"onUpdate:selectedReasoningEffort":Ur,onInterrupt:Kn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),v("div",LE," WT "+de(Me(t)),1)],64))}}),BE=Ye(jE,[["__scopeId","data-v-f5dc91ef"]]),Ui={render:()=>null},FE=Vg({history:_g(),routes:[{path:"/",name:"home",component:Ui},{path:"/thread/:threadId",name:"thread",component:Ui},{path:"/skills",name:"skills",component:Ui},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Nm(BE).use(FE).mount("#app");